From fee02086ca0c9416edf1dedf3675ef37252ea5ca Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sun, 28 Apr 2024 17:27:37 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20demo=20from=20@=20niivue/niivu?= =?UTF-8?q?e-brainchop@fbacdcac040c132b169c661899aacadc98e21495=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{index-mU6FTJQb.js => index-C2IJCTcd.js} | 338 +++++++++--------- index.html | 2 +- models/model18cls/colormap.json | 6 + models/model20chan3cls/colormap.json | 6 + models/model21_104class/colormap.json | 6 + models/model30chan18cls/colormap.json | 6 + models/model30chan50cls/colormap.json | 6 + models/model5_gw_ae/colormap.json | 6 + models/model5_gw_ae/colormap3.json | 6 + 9 files changed, 212 insertions(+), 170 deletions(-) rename assets/{index-mU6FTJQb.js => index-C2IJCTcd.js} (95%) create mode 100644 models/model18cls/colormap.json create mode 100644 models/model20chan3cls/colormap.json create mode 100644 models/model21_104class/colormap.json create mode 100644 models/model30chan18cls/colormap.json create mode 100644 models/model30chan50cls/colormap.json create mode 100644 models/model5_gw_ae/colormap.json create mode 100644 models/model5_gw_ae/colormap3.json diff --git a/assets/index-mU6FTJQb.js b/assets/index-C2IJCTcd.js similarity index 95% rename from assets/index-mU6FTJQb.js rename to assets/index-C2IJCTcd.js index 4a02c1b..d531fc5 100644 --- a/assets/index-mU6FTJQb.js +++ b/assets/index-C2IJCTcd.js @@ -1,4 +1,4 @@ -var tA=Object.defineProperty;var iA=(u,n,s)=>n in u?tA(u,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[n]=s;var ct=(u,n,s)=>(iA(u,typeof n!="symbol"?n+"":n,s),s);function _mergeNamespaces(u,n){for(var s=0;sc[f]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const g of f)if(g.type==="childList")for(const A of g.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&c(A)}).observe(document,{childList:!0,subtree:!0});function s(f){const g={};return f.integrity&&(g.integrity=f.integrity),f.referrerPolicy&&(g.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?g.credentials="include":f.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function c(f){if(f.ep)return;f.ep=!0;const g=s(f);fetch(f.href,g)}})();var EPSILON=1e-6,ARRAY_TYPE=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var u=0,n=arguments.length;n--;)u+=arguments[n]*arguments[n];return Math.sqrt(u)});function create$4(){var u=new ARRAY_TYPE(9);return ARRAY_TYPE!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[5]=0,u[6]=0,u[7]=0),u[0]=1,u[4]=1,u[8]=1,u}function fromValues$4(u,n,s,c,f,g,A,v,y){var T=new ARRAY_TYPE(9);return T[0]=u,T[1]=n,T[2]=s,T[3]=c,T[4]=f,T[5]=g,T[6]=A,T[7]=v,T[8]=y,T}function multiply$3(u,n,s){var c=n[0],f=n[1],g=n[2],A=n[3],v=n[4],y=n[5],T=n[6],I=n[7],S=n[8],k=s[0],e=s[1],N=s[2],M=s[3],O=s[4],z=s[5],B=s[6],V=s[7],b=s[8];return u[0]=k*c+e*A+N*T,u[1]=k*f+e*v+N*I,u[2]=k*g+e*y+N*S,u[3]=M*c+O*A+z*T,u[4]=M*f+O*v+z*I,u[5]=M*g+O*y+z*S,u[6]=B*c+V*A+b*T,u[7]=B*f+V*v+b*I,u[8]=B*g+V*y+b*S,u}function create$3(){var u=new ARRAY_TYPE(16);return ARRAY_TYPE!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=0,u[12]=0,u[13]=0,u[14]=0),u[0]=1,u[5]=1,u[10]=1,u[15]=1,u}function clone$3(u){var n=new ARRAY_TYPE(16);return n[0]=u[0],n[1]=u[1],n[2]=u[2],n[3]=u[3],n[4]=u[4],n[5]=u[5],n[6]=u[6],n[7]=u[7],n[8]=u[8],n[9]=u[9],n[10]=u[10],n[11]=u[11],n[12]=u[12],n[13]=u[13],n[14]=u[14],n[15]=u[15],n}function copy$1(u,n){return u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],u[4]=n[4],u[5]=n[5],u[6]=n[6],u[7]=n[7],u[8]=n[8],u[9]=n[9],u[10]=n[10],u[11]=n[11],u[12]=n[12],u[13]=n[13],u[14]=n[14],u[15]=n[15],u}function fromValues$3(u,n,s,c,f,g,A,v,y,T,I,S,k,e,N,M){var O=new ARRAY_TYPE(16);return O[0]=u,O[1]=n,O[2]=s,O[3]=c,O[4]=f,O[5]=g,O[6]=A,O[7]=v,O[8]=y,O[9]=T,O[10]=I,O[11]=S,O[12]=k,O[13]=e,O[14]=N,O[15]=M,O}function identity$2(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function transpose$3(u,n){if(u===n){var s=n[1],c=n[2],f=n[3],g=n[6],A=n[7],v=n[11];u[1]=n[4],u[2]=n[8],u[3]=n[12],u[4]=s,u[6]=n[9],u[7]=n[13],u[8]=c,u[9]=g,u[11]=n[14],u[12]=f,u[13]=A,u[14]=v}else u[0]=n[0],u[1]=n[4],u[2]=n[8],u[3]=n[12],u[4]=n[1],u[5]=n[5],u[6]=n[9],u[7]=n[13],u[8]=n[2],u[9]=n[6],u[10]=n[10],u[11]=n[14],u[12]=n[3],u[13]=n[7],u[14]=n[11],u[15]=n[15];return u}function invert(u,n){var s=n[0],c=n[1],f=n[2],g=n[3],A=n[4],v=n[5],y=n[6],T=n[7],I=n[8],S=n[9],k=n[10],e=n[11],N=n[12],M=n[13],O=n[14],z=n[15],B=s*v-c*A,V=s*y-f*A,b=s*T-g*A,W=c*y-f*v,q=c*T-g*v,Y=f*T-g*y,X=I*M-S*N,Q=I*O-k*N,m=I*z-e*N,Z=S*O-k*M,ee=S*z-e*M,oe=k*z-e*O,fe=B*oe-V*ee+b*Z+W*m-q*Q+Y*X;return fe?(fe=1/fe,u[0]=(v*oe-y*ee+T*Z)*fe,u[1]=(f*ee-c*oe-g*Z)*fe,u[2]=(M*Y-O*q+z*W)*fe,u[3]=(k*q-S*Y-e*W)*fe,u[4]=(y*m-A*oe-T*Q)*fe,u[5]=(s*oe-f*m+g*Q)*fe,u[6]=(O*b-N*Y-z*V)*fe,u[7]=(I*Y-k*b+e*V)*fe,u[8]=(A*ee-v*m+T*X)*fe,u[9]=(c*m-s*ee-g*X)*fe,u[10]=(N*q-M*b+z*B)*fe,u[11]=(S*b-I*q-e*B)*fe,u[12]=(v*Q-A*Z-y*X)*fe,u[13]=(s*Z-c*Q+f*X)*fe,u[14]=(M*V-N*W-O*B)*fe,u[15]=(I*W-S*V+k*B)*fe,u):null}function multiply$2(u,n,s){var c=n[0],f=n[1],g=n[2],A=n[3],v=n[4],y=n[5],T=n[6],I=n[7],S=n[8],k=n[9],e=n[10],N=n[11],M=n[12],O=n[13],z=n[14],B=n[15],V=s[0],b=s[1],W=s[2],q=s[3];return u[0]=V*c+b*v+W*S+q*M,u[1]=V*f+b*y+W*k+q*O,u[2]=V*g+b*T+W*e+q*z,u[3]=V*A+b*I+W*N+q*B,V=s[4],b=s[5],W=s[6],q=s[7],u[4]=V*c+b*v+W*S+q*M,u[5]=V*f+b*y+W*k+q*O,u[6]=V*g+b*T+W*e+q*z,u[7]=V*A+b*I+W*N+q*B,V=s[8],b=s[9],W=s[10],q=s[11],u[8]=V*c+b*v+W*S+q*M,u[9]=V*f+b*y+W*k+q*O,u[10]=V*g+b*T+W*e+q*z,u[11]=V*A+b*I+W*N+q*B,V=s[12],b=s[13],W=s[14],q=s[15],u[12]=V*c+b*v+W*S+q*M,u[13]=V*f+b*y+W*k+q*O,u[14]=V*g+b*T+W*e+q*z,u[15]=V*A+b*I+W*N+q*B,u}function translate(u,n,s){var c=s[0],f=s[1],g=s[2],A,v,y,T,I,S,k,e,N,M,O,z;return n===u?(u[12]=n[0]*c+n[4]*f+n[8]*g+n[12],u[13]=n[1]*c+n[5]*f+n[9]*g+n[13],u[14]=n[2]*c+n[6]*f+n[10]*g+n[14],u[15]=n[3]*c+n[7]*f+n[11]*g+n[15]):(A=n[0],v=n[1],y=n[2],T=n[3],I=n[4],S=n[5],k=n[6],e=n[7],N=n[8],M=n[9],O=n[10],z=n[11],u[0]=A,u[1]=v,u[2]=y,u[3]=T,u[4]=I,u[5]=S,u[6]=k,u[7]=e,u[8]=N,u[9]=M,u[10]=O,u[11]=z,u[12]=A*c+I*f+N*g+n[12],u[13]=v*c+S*f+M*g+n[13],u[14]=y*c+k*f+O*g+n[14],u[15]=T*c+e*f+z*g+n[15]),u}function scale$4(u,n,s){var c=s[0],f=s[1],g=s[2];return u[0]=n[0]*c,u[1]=n[1]*c,u[2]=n[2]*c,u[3]=n[3]*c,u[4]=n[4]*f,u[5]=n[5]*f,u[6]=n[6]*f,u[7]=n[7]*f,u[8]=n[8]*g,u[9]=n[9]*g,u[10]=n[10]*g,u[11]=n[11]*g,u[12]=n[12],u[13]=n[13],u[14]=n[14],u[15]=n[15],u}function rotateX(u,n,s){var c=Math.sin(s),f=Math.cos(s),g=n[4],A=n[5],v=n[6],y=n[7],T=n[8],I=n[9],S=n[10],k=n[11];return n!==u&&(u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],u[12]=n[12],u[13]=n[13],u[14]=n[14],u[15]=n[15]),u[4]=g*f+T*c,u[5]=A*f+I*c,u[6]=v*f+S*c,u[7]=y*f+k*c,u[8]=T*f-g*c,u[9]=I*f-A*c,u[10]=S*f-v*c,u[11]=k*f-y*c,u}function rotateZ(u,n,s){var c=Math.sin(s),f=Math.cos(s),g=n[0],A=n[1],v=n[2],y=n[3],T=n[4],I=n[5],S=n[6],k=n[7];return n!==u&&(u[8]=n[8],u[9]=n[9],u[10]=n[10],u[11]=n[11],u[12]=n[12],u[13]=n[13],u[14]=n[14],u[15]=n[15]),u[0]=g*f+T*c,u[1]=A*f+I*c,u[2]=v*f+S*c,u[3]=y*f+k*c,u[4]=T*f-g*c,u[5]=I*f-A*c,u[6]=S*f-v*c,u[7]=k*f-y*c,u}function fromRotation(u,n,s){var c=s[0],f=s[1],g=s[2],A=Math.hypot(c,f,g),v,y,T;return A0&&(g=1/Math.sqrt(g)),u[0]=n[0]*g,u[1]=n[1]*g,u[2]=n[2]*g,u}function dot$2(u,n){return u[0]*n[0]+u[1]*n[1]+u[2]*n[2]}function cross(u,n,s){var c=n[0],f=n[1],g=n[2],A=s[0],v=s[1],y=s[2];return u[0]=f*y-g*v,u[1]=g*A-c*y,u[2]=c*v-f*A,u}function lerp(u,n,s,c){var f=n[0],g=n[1],A=n[2];return u[0]=f+c*(s[0]-f),u[1]=g+c*(s[1]-g),u[2]=A+c*(s[2]-A),u}function angle(u,n){var s=u[0],c=u[1],f=u[2],g=n[0],A=n[1],v=n[2],y=Math.sqrt(s*s+c*c+f*f),T=Math.sqrt(g*g+A*A+v*v),I=y*T,S=I&&dot$2(u,n)/I;return Math.acos(Math.min(Math.max(S,-1),1))}var sub$4=subtract$1,len=length$1;(function(){var u=create$2();return function(n,s,c,f,g,A){var v,y;for(s||(s=3),c||(c=0),f?y=Math.min(f*s+c,n.length):y=n.length,v=c;v0&&(f=1/Math.sqrt(f)),u[0]=n[0]*f,u[1]=n[1]*f,u}(function(){var u=create();return function(n,s,c,f,g,A){var v,y;for(s||(s=2),c||(c=0),f?y=Math.min(f*s+c,n.length):y=n.length,v=c;v256){for(BUFFER=Array(u=256);u--;)BUFFER[u]=256*Math.random()|0;u=IDX=0}for(;u<16;u++)n=BUFFER[IDX+u],u==6?s+=HEX[n&15|64]:u==8?s+=HEX[n&63|128]:s+=HEX[n],u&1&&u>1&&u<11&&(s+="-");return IDX++,s}var u8$1=Uint8Array,u16$1=Uint16Array,i32$1=Int32Array,fleb$1=new u8$1([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb$1=new u8$1([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim$1=new u8$1([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb$1=function(u,n){for(var s=new u16$1(31),c=0;c<31;++c)s[c]=n+=1<>1|(i$1&21845)<<1;x$1=(x$1&52428)>>2|(x$1&13107)<<2,x$1=(x$1&61680)>>4|(x$1&3855)<<4,rev$1[i$1]=((x$1&65280)>>8|(x$1&255)<<8)>>1}var hMap$1=function(u,n,s){for(var c=u.length,f=0,g=new u16$1(n);f>y]=T}else for(v=new u16$1(c),f=0;f>15-u[f]);return v},flt$1=new u8$1(288);for(var i$1=0;i$1<144;++i$1)flt$1[i$1]=8;for(var i$1=144;i$1<256;++i$1)flt$1[i$1]=9;for(var i$1=256;i$1<280;++i$1)flt$1[i$1]=7;for(var i$1=280;i$1<288;++i$1)flt$1[i$1]=8;var fdt$1=new u8$1(32);for(var i$1=0;i$1<32;++i$1)fdt$1[i$1]=5;var flm$1=hMap$1(flt$1,9,0),flrm$1=hMap$1(flt$1,9,1),fdm$1=hMap$1(fdt$1,5,0),fdrm$1=hMap$1(fdt$1,5,1),max$5=function(u){for(var n=u[0],s=1;sn&&(n=u[s]);return n},bits$1=function(u,n,s){var c=n/8|0;return(u[c]|u[c+1]<<8)>>(n&7)&s},bits16$1=function(u,n){var s=n/8|0;return(u[s]|u[s+1]<<8|u[s+2]<<16)>>(n&7)},shft$1=function(u){return(u+7)/8|0},slc$1=function(u,n,s){return(n==null||n<0)&&(n=0),(s==null||s>u.length)&&(s=u.length),new u8$1(u.subarray(n,s))},ec$1=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err$1=function(u,n,s){var c=new Error(n||ec$1[u]);if(c.code=u,Error.captureStackTrace&&Error.captureStackTrace(c,err$1),!s)throw c;return c},inflt$1=function(u,n,s,c){var f=u.length,g=c?c.length:0;if(!f||n.f&&!n.l)return s||new u8$1(0);var A=!s,v=A||n.i!=2,y=n.i;A&&(s=new u8$1(f*3));var T=function(Ft){var Mt=s.length;if(Ft>Mt){var Ke=new u8$1(Math.max(Mt*2,Ft));Ke.set(s),s=Ke}},I=n.f||0,S=n.p||0,k=n.b||0,e=n.l,N=n.d,M=n.m,O=n.n,z=f*8;do{if(!e){I=bits$1(u,S,1);var B=bits$1(u,S+1,3);if(S+=3,B)if(B==1)e=flrm$1,N=fdrm$1,M=9,O=5;else if(B==2){var q=bits$1(u,S,31)+257,Y=bits$1(u,S+10,15)+4,X=q+bits$1(u,S+5,31)+1;S+=14;for(var Q=new u8$1(X),m=new u8$1(19),Z=0;Z>4;if(V<16)Q[Z++]=V;else{var pe=0,Se=0;for(V==16?(Se=3+bits$1(u,S,3),S+=2,pe=Q[Z-1]):V==17?(Se=3+bits$1(u,S,7),S+=3):V==18&&(Se=11+bits$1(u,S,127),S+=7);Se--;)Q[Z++]=pe}}var xe=Q.subarray(0,q),we=Q.subarray(q);M=max$5(xe),O=max$5(we),e=hMap$1(xe,M,1),N=hMap$1(we,O,1)}else err$1(1);else{var V=shft$1(S)+4,b=u[V-4]|u[V-3]<<8,W=V+b;if(W>f){y&&err$1(0);break}v&&T(k+b),s.set(u.subarray(V,W),k),n.b=k+=b,n.p=S=W*8,n.f=I;continue}if(S>z){y&&err$1(0);break}}v&&T(k+131072);for(var Fe=(1<>4;if(S+=pe&15,S>z){y&&err$1(0);break}if(pe||err$1(2),nt<256)s[k++]=nt;else if(nt==256){Ze=S,e=null;break}else{var Ue=nt-254;if(nt>264){var Z=nt-257,ye=fleb$1[Z];Ue=bits$1(u,S,(1<>4;at||err$1(3),S+=at&15;var we=fd$1[ft];if(ft>3){var ye=fdeb$1[ft];we+=bits16$1(u,S)&(1<z){y&&err$1(0);break}v&&T(k+131072);var Tt=k+Ue;if(k>8},wbits16$1=function(u,n,s){s<<=n&7;var c=n/8|0;u[c]|=s,u[c+1]|=s>>8,u[c+2]|=s>>16},hTree$1=function(u,n){for(var s=[],c=0;ck&&(k=g[c].s);var e=new u16$1(k+1),N=ln$1(s[I-1],e,0);if(N>n){var c=0,M=0,O=N-n,z=1<n)M+=z-(1<>=O;M>0;){var V=g[c].s;e[V]=0&&M;--c){var b=g[c].s;e[b]==n&&(--e[b],++M)}N=n}return{t:new u8$1(e),l:N}},ln$1=function(u,n,s){return u.s==-1?Math.max(ln$1(u.l,n,s+1),ln$1(u.r,n,s+1)):n[u.s]=s},lc$1=function(u){for(var n=u.length;n&&!u[--n];);for(var s=new u16$1(++n),c=0,f=u[0],g=1,A=function(y){s[c++]=y},v=1;v<=n;++v)if(u[v]==f&&v!=n)++g;else{if(!f&&g>2){for(;g>138;g-=138)A(32754);g>2&&(A(g>10?g-11<<5|28690:g-3<<5|12305),g=0)}else if(g>3){for(A(f),--g;g>6;g-=6)A(8304);g>2&&(A(g-3<<5|8208),g=0)}for(;g--;)A(f);g=1,f=u[v]}return{c:s.subarray(0,c),n}},clen$1=function(u,n){for(var s=0,c=0;c>8,u[f+2]=u[f]^255,u[f+3]=u[f+1]^255;for(var g=0;g4&&!m[clim$1[ee-1]];--ee);var oe=T+5<<3,fe=clen$1(f,flt$1)+clen$1(g,fdt$1)+A,me=clen$1(f,k)+clen$1(g,M)+A+14+3*ee+clen$1(Y,m)+2*Y[16]+3*Y[17]+7*Y[18];if(y>=0&&oe<=fe&&oe<=me)return wfblk$1(n,I,u.subarray(y,y+T));var pe,Se,xe,we;if(wbits$1(n,I,1+(me15&&(wbits$1(n,I,nt[X]>>5&127),I+=nt[X]>>12)}}else pe=flm$1,Se=flt$1,xe=fdm$1,we=fdt$1;for(var X=0;X255){var Ue=ye>>18&31;wbits16$1(n,I,pe[Ue+257]),I+=Se[Ue+257],Ue>7&&(wbits$1(n,I,ye>>23&31),I+=fleb$1[Ue]);var at=ye&31;wbits16$1(n,I,xe[at]),I+=we[at],at>3&&(wbits16$1(n,I,ye>>5&8191),I+=fdeb$1[at])}else wbits16$1(n,I,pe[ye]),I+=Se[ye]}return wbits16$1(n,I,pe[256]),I+Se[256]},deo$1=new i32$1([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et$1=new u8$1(0),dflt$1=function(u,n,s,c,f,g){var A=g.z||u.length,v=new u8$1(c+A+5*(1+Math.ceil(A/7e3))+f),y=v.subarray(c,v.length-f),T=g.l,I=(g.r||0)&7;if(n){I&&(y[0]=g.r>>3);for(var S=deo$1[n-1],k=S>>13,e=S&8191,N=(1<7e3||m>24576)&&(pe>423||!T)){I=wblk$1(u,y,0,b,W,q,X,m,ee,Q-ee,I),m=Y=X=0,ee=Q;for(var Se=0;Se<286;++Se)W[Se]=0;for(var Se=0;Se<30;++Se)q[Se]=0}var xe=2,we=0,Fe=e,De=fe-me&32767;if(pe>2&&oe==V(Q-De))for(var Ze=Math.min(k,pe)-1,nt=Math.min(32767,Q),Ue=Math.min(258,pe);De<=nt&&--Fe&&fe!=me;){if(u[Q+xe]==u[Q+xe-De]){for(var ye=0;yexe){if(xe=ye,we=De,ye>Ze)break;for(var at=Math.min(De,ye-2),ft=0,Se=0;Seft&&(ft=Ot,me=Tt)}}}fe=me,me=M[fe],De+=fe-me&32767}if(we){b[m++]=268435456|revfl$1[xe]<<18|revfd$1[we];var Ft=revfl$1[xe]&31,Mt=revfd$1[we]&31;X+=fleb$1[Ft]+fdeb$1[Mt],++W[257+Ft],++q[Mt],Z=Q+xe,++Y}else b[m++]=u[Q],++W[u[Q]]}}for(Q=Math.max(Q,Z);Q=A&&(y[I/8|0]=T,Ke=A),I=wfblk$1(y,I+1,u.subarray(Q,Ke))}g.i=A}return slc$1(v,0,c+shft$1(I)+f)},crct$1=function(){for(var u=new Int32Array(256),n=0;n<256;++n){for(var s=n,c=9;--c;)s=(s&1&&-306674912)^s>>>1;u[n]=s}return u}(),crc$1=function(){var u=-1;return{p:function(n){for(var s=u,c=0;c>>8;u=s},d:function(){return~u}}},dopt$1=function(u,n,s,c,f){if(!f&&(f={l:1},n.dictionary)){var g=n.dictionary.subarray(-32768),A=new u8$1(g.length+u.length);A.set(g),A.set(u,g.length),u=A,f.w=g.length}return dflt$1(u,n.level==null?6:n.level,n.mem==null?f.l?Math.ceil(Math.max(8,Math.min(13,Math.log(u.length)))*1.5):20:12+n.mem,s,c,f)},b2$1=function(u,n){return u[n]|u[n+1]<<8},b4$1=function(u,n){return(u[n]|u[n+1]<<8|u[n+2]<<16|u[n+3]<<24)>>>0},b8$1=function(u,n){return b4$1(u,n)+b4$1(u,n+4)*4294967296},wbytes$1=function(u,n,s){for(;s;++n)u[n]=s,s>>>=8},gzh$1=function(u,n){var s=n.filename;if(u[0]=31,u[1]=139,u[2]=8,u[8]=n.level<2?4:n.level==9?2:0,u[9]=3,n.mtime!=0&&wbytes$1(u,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),s){u[3]=8;for(var c=0;c<=s.length;++c)u[c+10]=s.charCodeAt(c)}},gzs$1=function(u){(u[0]!=31||u[1]!=139||u[2]!=8)&&err$1(6,"invalid gzip data");var n=u[3],s=10;n&4&&(s+=(u[10]|u[11]<<8)+2);for(var c=(n>>3&1)+(n>>4&1);c>0;c-=!u[s++]);return s+(n&2)},gzl$1=function(u){var n=u.length;return(u[n-4]|u[n-3]<<8|u[n-2]<<16|u[n-1]<<24)>>>0},gzhl$1=function(u){return 10+(u.filename?u.filename.length+1:0)},zls$1=function(u,n){return((u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31)&&err$1(6,"invalid zlib data"),(u[1]>>5&1)==+!n&&err$1(6,"invalid zlib data: "+(u[1]&32?"need":"unexpected")+" dictionary"),(u[1]>>3&4)+2};function StrmOpt$1(u,n){return typeof u=="function"&&(n=u,u={}),this.ondata=n,u}var Inflate$1=function(){function u(n,s){typeof n=="function"&&(s=n,n={}),this.ondata=s;var c=n&&n.dictionary&&n.dictionary.subarray(-32768);this.s={i:0,b:c?c.length:0},this.o=new u8$1(32768),this.p=new u8$1(0),c&&this.o.set(c)}return u.prototype.e=function(n){if(this.ondata||err$1(5),this.d&&err$1(4),!this.p.length)this.p=n;else if(n.length){var s=new u8$1(this.p.length+n.length);s.set(this.p),s.set(n,this.p.length),this.p=s}},u.prototype.c=function(n){this.s.i=+(this.d=n||!1);var s=this.s.b,c=inflt$1(this.p,this.s,this.o);this.ondata(slc$1(c,s,this.s.b),this.d),this.o=slc$1(c,this.s.b-32768),this.s.b=this.o.length,this.p=slc$1(this.p,this.s.p/8|0),this.s.p&=7},u.prototype.push=function(n,s){this.e(n),this.c(s)},u}();function inflateSync$1(u,n){return inflt$1(u,{i:2},n&&n.out,n&&n.dictionary)}function gzipSync$1(u,n){n||(n={});var s=crc$1(),c=u.length;s.p(u);var f=dopt$1(u,n,gzhl$1(n),8),g=f.length;return gzh$1(f,n),wbytes$1(f,g-8,s.d()),wbytes$1(f,g-4,c),f}var Gunzip$1=function(){function u(n,s){this.v=1,this.r=0,Inflate$1.call(this,n,s)}return u.prototype.push=function(n,s){if(Inflate$1.prototype.e.call(this,n),this.r+=n.length,this.v){var c=this.p.subarray(this.v-1),f=c.length>3?gzs$1(c):4;if(f>c.length){if(!s)return}else this.v>1&&this.onmember&&this.onmember(this.r-c.length);this.p=c.subarray(f),this.v=0}Inflate$1.prototype.c.call(this,s),this.s.f&&!this.s.l&&!s&&(this.v=shft$1(this.s.p)+9,this.s={i:0},this.o=new u8$1(0),this.push(new u8$1(0),s))},u}();function gunzipSync$1(u,n){var s=gzs$1(u);return s+8>u.length&&err$1(6,"invalid gzip data"),inflt$1(u.subarray(s,-8),{i:2},n&&n.out||new u8$1(gzl$1(u)),n&&n.dictionary)}var Unzlib$1=function(){function u(n,s){Inflate$1.call(this,n,s),this.v=n&&n.dictionary?2:1}return u.prototype.push=function(n,s){if(Inflate$1.prototype.e.call(this,n),this.v){if(this.p.length<6&&!s)return;this.p=this.p.subarray(zls$1(this.p,this.v-1)),this.v=0}s&&(this.p.length<4&&err$1(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Inflate$1.prototype.c.call(this,s)},u}();function unzlibSync$1(u,n){return inflt$1(u.subarray(zls$1(u,n&&n.dictionary),-4),{i:2},n&&n.out,n&&n.dictionary)}var Decompress$1=function(){function u(n,s){this.o=StrmOpt$1.call(this,n,s)||{},this.G=Gunzip$1,this.I=Inflate$1,this.Z=Unzlib$1}return u.prototype.i=function(){var n=this;this.s.ondata=function(s,c){n.ondata(s,c)}},u.prototype.push=function(n,s){if(this.ondata||err$1(5),this.s)this.s.push(n,s);else{if(this.p&&this.p.length){var c=new u8$1(this.p.length+n.length);c.set(this.p),c.set(n,this.p.length)}else this.p=n;this.p.length>2&&(this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(this.o):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,s),this.p=null)}},u}();function decompressSync$1(u,n){return u[0]==31&&u[1]==139&&u[2]==8?gunzipSync$1(u,n):(u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31?inflateSync$1(u,n):unzlibSync$1(u,n)}var te$1=typeof TextEncoder<"u"&&new TextEncoder,td$1=typeof TextDecoder<"u"&&new TextDecoder,tds$1=0;try{td$1.decode(et$1,{stream:!0}),tds$1=1}catch{}var dutf8$1=function(u){for(var n="",s=0;;){var c=u[s++],f=(c>127)+(c>223)+(c>239);if(s+f>u.length)return{s:n,r:slc$1(u,s-1)};f?f==3?(c=((c&15)<<18|(u[s++]&63)<<12|(u[s++]&63)<<6|u[s++]&63)-65536,n+=String.fromCharCode(55296|c>>10,56320|c&1023)):f&1?n+=String.fromCharCode((c&31)<<6|u[s++]&63):n+=String.fromCharCode((c&15)<<12|(u[s++]&63)<<6|u[s++]&63):n+=String.fromCharCode(c)}};function strToU8$1(u,n){if(n){for(var s=new u8$1(u.length),c=0;c>1)),A=0,v=function(I){g[A++]=I},c=0;cg.length){var y=new u8$1(A+8+(f-c<<1));y.set(g),g=y}var T=u.charCodeAt(c);T<128||n?v(T):T<2048?(v(192|T>>6),v(128|T&63)):T>55295&&T<57344?(T=65536+(T&1047552)|u.charCodeAt(++c)&1023,v(240|T>>18),v(128|T>>12&63),v(128|T>>6&63),v(128|T&63)):(v(224|T>>12),v(128|T>>6&63),v(128|T&63))}return slc$1(g,0,A)}function strFromU8$1(u,n){if(n){for(var s="",c=0;c65558)&&err$1(13);var f=b2$1(u,c+8);if(!f)return{};var g=b4$1(u,c+16),A=g==4294967295||f==65535;if(A){var v=b4$1(u,c-12);A=b4$1(u,v)==101075792,A&&(f=b4$1(u,v+32),g=b4$1(u,v+48))}for(var y=n&&n.filter,T=0;T{const s=(f,g)=>(u.set(g,f),f),c=f=>{if(u.has(f))return u.get(f);const[g,A]=n[f];switch(g){case PRIMITIVE:case VOID:return s(A,f);case ARRAY:{const v=s([],f);for(const y of A)v.push(c(y));return v}case OBJECT:{const v=s({},f);for(const[y,T]of A)v[c(y)]=c(T);return v}case DATE:return s(new Date(A),f);case REGEXP:{const{source:v,flags:y}=A;return s(new RegExp(v,y),f)}case MAP:{const v=s(new Map,f);for(const[y,T]of A)v.set(c(y),c(T));return v}case SET:{const v=s(new Set,f);for(const y of A)v.add(c(y));return v}case ERROR:{const{name:v,message:y}=A;return s(new env$1[v](y),f)}case BIGINT:return s(BigInt(A),f);case"BigInt":return s(Object(BigInt(A)),f)}return s(new env$1[g](A),f)};return c},deserialize$1=u=>deserializer(new Map,u)(0),EMPTY="",{toString}={},{keys}=Object,typeOf=u=>{const n=typeof u;if(n!=="object"||!u)return[PRIMITIVE,n];const s=toString.call(u).slice(8,-1);switch(s){case"Array":return[ARRAY,EMPTY];case"Object":return[OBJECT,EMPTY];case"Date":return[DATE,EMPTY];case"RegExp":return[REGEXP,EMPTY];case"Map":return[MAP,EMPTY];case"Set":return[SET,EMPTY]}return s.includes("Array")?[ARRAY,s]:s.includes("Error")?[ERROR,s]:[OBJECT,s]},shouldSkip=([u,n])=>u===PRIMITIVE&&(n==="function"||n==="symbol"),serializer=(u,n,s,c)=>{const f=(A,v)=>{const y=c.push(A)-1;return s.set(v,y),y},g=A=>{if(s.has(A))return s.get(A);let[v,y]=typeOf(A);switch(v){case PRIMITIVE:{let I=A;switch(y){case"bigint":v=BIGINT,I=A.toString();break;case"function":case"symbol":if(u)throw new TypeError("unable to serialize "+y);I=null;break;case"undefined":return f([VOID],A)}return f([v,I],A)}case ARRAY:{if(y)return f([y,[...A]],A);const I=[],S=f([v,I],A);for(const k of A)I.push(g(k));return S}case OBJECT:{if(y)switch(y){case"BigInt":return f([y,A.toString()],A);case"Boolean":case"Number":case"String":return f([y,A.valueOf()],A)}if(n&&"toJSON"in A)return g(A.toJSON());const I=[],S=f([v,I],A);for(const k of keys(A))(u||!shouldSkip(typeOf(A[k])))&&I.push([g(k),g(A[k])]);return S}case DATE:return f([v,A.toISOString()],A);case REGEXP:{const{source:I,flags:S}=A;return f([v,{source:I,flags:S}],A)}case MAP:{const I=[],S=f([v,I],A);for(const[k,e]of A)(u||!(shouldSkip(typeOf(k))||shouldSkip(typeOf(e))))&&I.push([g(k),g(e)]);return S}case SET:{const I=[],S=f([v,I],A);for(const k of A)(u||!shouldSkip(typeOf(k)))&&I.push(g(k));return S}}const{message:T}=A;return f([v,{name:y,message:T}],A)};return g},serialize=(u,{json:n,lossy:s}={})=>{const c=[];return serializer(!(n||s),!!n,new Map,c)(u),c};var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function getAugmentedNamespace(u){if(u.__esModule)return u;var n=u.default;if(typeof n=="function"){var s=function c(){return this instanceof c?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};s.prototype=n.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(u).forEach(function(c){var f=Object.getOwnPropertyDescriptor(u,c);Object.defineProperty(s,c,f.get?f:{enumerable:!0,get:function(){return u[c]}})}),s}var arrayEqual=function(n,s){var c=n.length;if(n===s)return!0;if(c!==s.length)return!1;for(var f=0;f>1|(i&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,rev[i]=((x&65280)>>8|(x&255)<<8)>>1}var hMap=function(u,n,s){for(var c=u.length,f=0,g=new u16(n);f>y]=T}else for(v=new u16(c),f=0;f>15-u[f]);return v},flt=new u8(288);for(var i=0;i<144;++i)flt[i]=8;for(var i=144;i<256;++i)flt[i]=9;for(var i=256;i<280;++i)flt[i]=7;for(var i=280;i<288;++i)flt[i]=8;var fdt=new u8(32);for(var i=0;i<32;++i)fdt[i]=5;var flm=hMap(flt,9,0),flrm=hMap(flt,9,1),fdm=hMap(fdt,5,0),fdrm=hMap(fdt,5,1),max$4=function(u){for(var n=u[0],s=1;sn&&(n=u[s]);return n},bits=function(u,n,s){var c=n/8|0;return(u[c]|u[c+1]<<8)>>(n&7)&s},bits16=function(u,n){var s=n/8|0;return(u[s]|u[s+1]<<8|u[s+2]<<16)>>(n&7)},shft=function(u){return(u+7)/8|0},slc=function(u,n,s){return(n==null||n<0)&&(n=0),(s==null||s>u.length)&&(s=u.length),new u8(u.subarray(n,s))};browser.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(u,n,s){var c=new Error(n||ec[u]);if(c.code=u,Error.captureStackTrace&&Error.captureStackTrace(c,err),!s)throw c;return c},inflt=function(u,n,s,c){var f=u.length,g=c?c.length:0;if(!f||n.f&&!n.l)return s||new u8(0);var A=!s,v=A||n.i!=2,y=n.i;A&&(s=new u8(f*3));var T=function(Ft){var Mt=s.length;if(Ft>Mt){var Ke=new u8(Math.max(Mt*2,Ft));Ke.set(s),s=Ke}},I=n.f||0,S=n.p||0,k=n.b||0,e=n.l,N=n.d,M=n.m,O=n.n,z=f*8;do{if(!e){I=bits(u,S,1);var B=bits(u,S+1,3);if(S+=3,B)if(B==1)e=flrm,N=fdrm,M=9,O=5;else if(B==2){var q=bits(u,S,31)+257,Y=bits(u,S+10,15)+4,X=q+bits(u,S+5,31)+1;S+=14;for(var Q=new u8(X),m=new u8(19),Z=0;Z>4;if(V<16)Q[Z++]=V;else{var pe=0,Se=0;for(V==16?(Se=3+bits(u,S,3),S+=2,pe=Q[Z-1]):V==17?(Se=3+bits(u,S,7),S+=3):V==18&&(Se=11+bits(u,S,127),S+=7);Se--;)Q[Z++]=pe}}var xe=Q.subarray(0,q),we=Q.subarray(q);M=max$4(xe),O=max$4(we),e=hMap(xe,M,1),N=hMap(we,O,1)}else err(1);else{var V=shft(S)+4,b=u[V-4]|u[V-3]<<8,W=V+b;if(W>f){y&&err(0);break}v&&T(k+b),s.set(u.subarray(V,W),k),n.b=k+=b,n.p=S=W*8,n.f=I;continue}if(S>z){y&&err(0);break}}v&&T(k+131072);for(var Fe=(1<>4;if(S+=pe&15,S>z){y&&err(0);break}if(pe||err(2),nt<256)s[k++]=nt;else if(nt==256){Ze=S,e=null;break}else{var Ue=nt-254;if(nt>264){var Z=nt-257,ye=fleb[Z];Ue=bits(u,S,(1<>4;at||err(3),S+=at&15;var we=fd[ft];if(ft>3){var ye=fdeb[ft];we+=bits16(u,S)&(1<z){y&&err(0);break}v&&T(k+131072);var Tt=k+Ue;if(k>8},wbits16=function(u,n,s){s<<=n&7;var c=n/8|0;u[c]|=s,u[c+1]|=s>>8,u[c+2]|=s>>16},hTree=function(u,n){for(var s=[],c=0;ck&&(k=g[c].s);var e=new u16(k+1),N=ln(s[I-1],e,0);if(N>n){var c=0,M=0,O=N-n,z=1<n)M+=z-(1<>=O;M>0;){var V=g[c].s;e[V]=0&&M;--c){var b=g[c].s;e[b]==n&&(--e[b],++M)}N=n}return{t:new u8(e),l:N}},ln=function(u,n,s){return u.s==-1?Math.max(ln(u.l,n,s+1),ln(u.r,n,s+1)):n[u.s]=s},lc=function(u){for(var n=u.length;n&&!u[--n];);for(var s=new u16(++n),c=0,f=u[0],g=1,A=function(y){s[c++]=y},v=1;v<=n;++v)if(u[v]==f&&v!=n)++g;else{if(!f&&g>2){for(;g>138;g-=138)A(32754);g>2&&(A(g>10?g-11<<5|28690:g-3<<5|12305),g=0)}else if(g>3){for(A(f),--g;g>6;g-=6)A(8304);g>2&&(A(g-3<<5|8208),g=0)}for(;g--;)A(f);g=1,f=u[v]}return{c:s.subarray(0,c),n}},clen=function(u,n){for(var s=0,c=0;c>8,u[f+2]=u[f]^255,u[f+3]=u[f+1]^255;for(var g=0;g4&&!m[clim[ee-1]];--ee);var oe=T+5<<3,fe=clen(f,flt)+clen(g,fdt)+A,me=clen(f,k)+clen(g,M)+A+14+3*ee+clen(Y,m)+2*Y[16]+3*Y[17]+7*Y[18];if(y>=0&&oe<=fe&&oe<=me)return wfblk(n,I,u.subarray(y,y+T));var pe,Se,xe,we;if(wbits(n,I,1+(me15&&(wbits(n,I,nt[X]>>5&127),I+=nt[X]>>12)}}else pe=flm,Se=flt,xe=fdm,we=fdt;for(var X=0;X255){var Ue=ye>>18&31;wbits16(n,I,pe[Ue+257]),I+=Se[Ue+257],Ue>7&&(wbits(n,I,ye>>23&31),I+=fleb[Ue]);var at=ye&31;wbits16(n,I,xe[at]),I+=we[at],at>3&&(wbits16(n,I,ye>>5&8191),I+=fdeb[at])}else wbits16(n,I,pe[ye]),I+=Se[ye]}return wbits16(n,I,pe[256]),I+Se[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et=new u8(0),dflt=function(u,n,s,c,f,g){var A=g.z||u.length,v=new u8(c+A+5*(1+Math.ceil(A/7e3))+f),y=v.subarray(c,v.length-f),T=g.l,I=(g.r||0)&7;if(n){I&&(y[0]=g.r>>3);for(var S=deo[n-1],k=S>>13,e=S&8191,N=(1<7e3||m>24576)&&(pe>423||!T)){I=wblk(u,y,0,b,W,q,X,m,ee,Q-ee,I),m=Y=X=0,ee=Q;for(var Se=0;Se<286;++Se)W[Se]=0;for(var Se=0;Se<30;++Se)q[Se]=0}var xe=2,we=0,Fe=e,De=fe-me&32767;if(pe>2&&oe==V(Q-De))for(var Ze=Math.min(k,pe)-1,nt=Math.min(32767,Q),Ue=Math.min(258,pe);De<=nt&&--Fe&&fe!=me;){if(u[Q+xe]==u[Q+xe-De]){for(var ye=0;yexe){if(xe=ye,we=De,ye>Ze)break;for(var at=Math.min(De,ye-2),ft=0,Se=0;Seft&&(ft=Ot,me=Tt)}}}fe=me,me=M[fe],De+=fe-me&32767}if(we){b[m++]=268435456|revfl[xe]<<18|revfd[we];var Ft=revfl[xe]&31,Mt=revfd[we]&31;X+=fleb[Ft]+fdeb[Mt],++W[257+Ft],++q[Mt],Z=Q+xe,++Y}else b[m++]=u[Q],++W[u[Q]]}}for(Q=Math.max(Q,Z);Q=A&&(y[I/8|0]=T,Ke=A),I=wfblk(y,I+1,u.subarray(Q,Ke))}g.i=A}return slc(v,0,c+shft(I)+f)},crct=function(){for(var u=new Int32Array(256),n=0;n<256;++n){for(var s=n,c=9;--c;)s=(s&1&&-306674912)^s>>>1;u[n]=s}return u}(),crc=function(){var u=-1;return{p:function(n){for(var s=u,c=0;c>>8;u=s},d:function(){return~u}}},adler=function(){var u=1,n=0;return{p:function(s){for(var c=u,f=n,g=s.length|0,A=0;A!=g;){for(var v=Math.min(A+2655,g);A>16),f=(f&65535)+15*(f>>16)}u=c,n=f},d:function(){return u%=65521,n%=65521,(u&255)<<24|(u&65280)<<8|(n&255)<<8|n>>8}}},dopt=function(u,n,s,c,f){if(!f&&(f={l:1},n.dictionary)){var g=n.dictionary.subarray(-32768),A=new u8(g.length+u.length);A.set(g),A.set(u,g.length),u=A,f.w=g.length}return dflt(u,n.level==null?6:n.level,n.mem==null?f.l?Math.ceil(Math.max(8,Math.min(13,Math.log(u.length)))*1.5):20:12+n.mem,s,c,f)},mrg=function(u,n){var s={};for(var c in u)s[c]=u[c];for(var c in n)s[c]=n[c];return s},wcln=function(u,n,s){for(var c=u(),f=u.toString(),g=f.slice(f.indexOf("[")+1,f.lastIndexOf("]")).replace(/\s+/g,"").split(","),A=0;A>>0},b8=function(u,n){return b4(u,n)+b4(u,n+4)*4294967296},wbytes=function(u,n,s){for(;s;++n)u[n]=s,s>>>=8},gzh=function(u,n){var s=n.filename;if(u[0]=31,u[1]=139,u[2]=8,u[8]=n.level<2?4:n.level==9?2:0,u[9]=3,n.mtime!=0&&wbytes(u,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),s){u[3]=8;for(var c=0;c<=s.length;++c)u[c+10]=s.charCodeAt(c)}},gzs=function(u){(u[0]!=31||u[1]!=139||u[2]!=8)&&err(6,"invalid gzip data");var n=u[3],s=10;n&4&&(s+=(u[10]|u[11]<<8)+2);for(var c=(n>>3&1)+(n>>4&1);c>0;c-=!u[s++]);return s+(n&2)},gzl=function(u){var n=u.length;return(u[n-4]|u[n-3]<<8|u[n-2]<<16|u[n-1]<<24)>>>0},gzhl=function(u){return 10+(u.filename?u.filename.length+1:0)},zlh=function(u,n){var s=n.level,c=s==0?0:s<6?1:s==9?3:2;if(u[0]=120,u[1]=c<<6|(n.dictionary&&32),u[1]|=31-(u[0]<<8|u[1])%31,n.dictionary){var f=adler();f.p(n.dictionary),wbytes(u,2,f.d())}},zls=function(u,n){return((u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31)&&err(6,"invalid zlib data"),(u[1]>>5&1)==+!n&&err(6,"invalid zlib data: "+(u[1]&32?"need":"unexpected")+" dictionary"),(u[1]>>3&4)+2};function StrmOpt(u,n){return typeof u=="function"&&(n=u,u={}),this.ondata=n,u}var Deflate=function(){function u(n,s){if(typeof n=="function"&&(s=n,n={}),this.ondata=s,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new u8(98304),this.o.dictionary){var c=this.o.dictionary.subarray(-32768);this.b.set(c,32768-c.length),this.s.i=32768-c.length}}return u.prototype.p=function(n,s){this.ondata(dopt(n,this.o,0,0,this.s),s)},u.prototype.push=function(n,s){this.ondata||err(5),this.s.l&&err(4);var c=n.length+this.s.z;if(c>this.b.length){if(c>2*this.b.length-32768){var f=new u8(c&-32768);f.set(this.b.subarray(0,this.s.z)),this.b=f}var g=this.b.length-this.s.z;this.b.set(n.subarray(0,g),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(g),32768),this.s.z=n.length-g+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=s&1,(this.s.z>this.s.w+8191||s)&&(this.p(this.b,s||!1),this.s.w=this.s.i,this.s.i-=2)},u.prototype.flush=function(){this.ondata||err(5),this.s.l&&err(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},u}();browser.Deflate=Deflate;var AsyncDeflate=function(){function u(n,s){astrmify([bDflt,function(){return[astrm,Deflate]}],this,StrmOpt.call(this,n,s),function(c){var f=new Deflate(c.data);onmessage=astrm(f)},6,1)}return u}();browser.AsyncDeflate=AsyncDeflate;function deflate$2(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bDflt],function(c){return pbf(deflateSync(c.data[0],c.data[1]))},0,s)}browser.deflate=deflate$2;function deflateSync(u,n){return dopt(u,n||{},0,0)}browser.deflateSync=deflateSync;var Inflate=function(){function u(n,s){typeof n=="function"&&(s=n,n={}),this.ondata=s;var c=n&&n.dictionary&&n.dictionary.subarray(-32768);this.s={i:0,b:c?c.length:0},this.o=new u8(32768),this.p=new u8(0),c&&this.o.set(c)}return u.prototype.e=function(n){if(this.ondata||err(5),this.d&&err(4),!this.p.length)this.p=n;else if(n.length){var s=new u8(this.p.length+n.length);s.set(this.p),s.set(n,this.p.length),this.p=s}},u.prototype.c=function(n){this.s.i=+(this.d=n||!1);var s=this.s.b,c=inflt(this.p,this.s,this.o);this.ondata(slc(c,s,this.s.b),this.d),this.o=slc(c,this.s.b-32768),this.s.b=this.o.length,this.p=slc(this.p,this.s.p/8|0),this.s.p&=7},u.prototype.push=function(n,s){this.e(n),this.c(s)},u}();browser.Inflate=Inflate;var AsyncInflate=function(){function u(n,s){astrmify([bInflt,function(){return[astrm,Inflate]}],this,StrmOpt.call(this,n,s),function(c){var f=new Inflate(c.data);onmessage=astrm(f)},7,0)}return u}();browser.AsyncInflate=AsyncInflate;function inflate$2(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bInflt],function(c){return pbf(inflateSync(c.data[0],gopt(c.data[1])))},1,s)}browser.inflate=inflate$2;function inflateSync(u,n){return inflt(u,{i:2},n&&n.out,n&&n.dictionary)}browser.inflateSync=inflateSync;var Gzip=function(){function u(n,s){this.c=crc(),this.l=0,this.v=1,Deflate.call(this,n,s)}return u.prototype.push=function(n,s){this.c.p(n),this.l+=n.length,Deflate.prototype.push.call(this,n,s)},u.prototype.p=function(n,s){var c=dopt(n,this.o,this.v&&gzhl(this.o),s&&8,this.s);this.v&&(gzh(c,this.o),this.v=0),s&&(wbytes(c,c.length-8,this.c.d()),wbytes(c,c.length-4,this.l)),this.ondata(c,s)},u.prototype.flush=function(){Deflate.prototype.flush.call(this)},u}();browser.Gzip=Gzip;browser.Compress=Gzip;var AsyncGzip=function(){function u(n,s){astrmify([bDflt,gze,function(){return[astrm,Deflate,Gzip]}],this,StrmOpt.call(this,n,s),function(c){var f=new Gzip(c.data);onmessage=astrm(f)},8,1)}return u}();browser.AsyncGzip=AsyncGzip;browser.AsyncCompress=AsyncGzip;function gzip(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bDflt,gze,function(){return[gzipSync]}],function(c){return pbf(gzipSync(c.data[0],c.data[1]))},2,s)}browser.gzip=gzip;browser.compress=gzip;function gzipSync(u,n){n||(n={});var s=crc(),c=u.length;s.p(u);var f=dopt(u,n,gzhl(n),8),g=f.length;return gzh(f,n),wbytes(f,g-8,s.d()),wbytes(f,g-4,c),f}browser.gzipSync=gzipSync;browser.compressSync=gzipSync;var Gunzip=function(){function u(n,s){this.v=1,this.r=0,Inflate.call(this,n,s)}return u.prototype.push=function(n,s){if(Inflate.prototype.e.call(this,n),this.r+=n.length,this.v){var c=this.p.subarray(this.v-1),f=c.length>3?gzs(c):4;if(f>c.length){if(!s)return}else this.v>1&&this.onmember&&this.onmember(this.r-c.length);this.p=c.subarray(f),this.v=0}Inflate.prototype.c.call(this,s),this.s.f&&!this.s.l&&!s&&(this.v=shft(this.s.p)+9,this.s={i:0},this.o=new u8(0),this.push(new u8(0),s))},u}();browser.Gunzip=Gunzip;var AsyncGunzip=function(){function u(n,s){var c=this;astrmify([bInflt,guze,function(){return[astrm,Inflate,Gunzip]}],this,StrmOpt.call(this,n,s),function(f){var g=new Gunzip(f.data);g.onmember=function(A){return postMessage(A)},onmessage=astrm(g)},9,0,function(f){return c.onmember&&c.onmember(f)})}return u}();browser.AsyncGunzip=AsyncGunzip;function gunzip(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bInflt,guze,function(){return[gunzipSync]}],function(c){return pbf(gunzipSync(c.data[0],c.data[1]))},3,s)}browser.gunzip=gunzip;function gunzipSync(u,n){var s=gzs(u);return s+8>u.length&&err(6,"invalid gzip data"),inflt(u.subarray(s,-8),{i:2},n&&n.out||new u8(gzl(u)),n&&n.dictionary)}browser.gunzipSync=gunzipSync;var Zlib=function(){function u(n,s){this.c=adler(),this.v=1,Deflate.call(this,n,s)}return u.prototype.push=function(n,s){this.c.p(n),Deflate.prototype.push.call(this,n,s)},u.prototype.p=function(n,s){var c=dopt(n,this.o,this.v&&(this.o.dictionary?6:2),s&&4,this.s);this.v&&(zlh(c,this.o),this.v=0),s&&wbytes(c,c.length-4,this.c.d()),this.ondata(c,s)},u.prototype.flush=function(){Deflate.prototype.flush.call(this)},u}();browser.Zlib=Zlib;var AsyncZlib=function(){function u(n,s){astrmify([bDflt,zle,function(){return[astrm,Deflate,Zlib]}],this,StrmOpt.call(this,n,s),function(c){var f=new Zlib(c.data);onmessage=astrm(f)},10,1)}return u}();browser.AsyncZlib=AsyncZlib;function zlib(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bDflt,zle,function(){return[zlibSync]}],function(c){return pbf(zlibSync(c.data[0],c.data[1]))},4,s)}browser.zlib=zlib;function zlibSync(u,n){n||(n={});var s=adler();s.p(u);var c=dopt(u,n,n.dictionary?6:2,4);return zlh(c,n),wbytes(c,c.length-4,s.d()),c}browser.zlibSync=zlibSync;var Unzlib=function(){function u(n,s){Inflate.call(this,n,s),this.v=n&&n.dictionary?2:1}return u.prototype.push=function(n,s){if(Inflate.prototype.e.call(this,n),this.v){if(this.p.length<6&&!s)return;this.p=this.p.subarray(zls(this.p,this.v-1)),this.v=0}s&&(this.p.length<4&&err(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Inflate.prototype.c.call(this,s)},u}();browser.Unzlib=Unzlib;var AsyncUnzlib=function(){function u(n,s){astrmify([bInflt,zule,function(){return[astrm,Inflate,Unzlib]}],this,StrmOpt.call(this,n,s),function(c){var f=new Unzlib(c.data);onmessage=astrm(f)},11,0)}return u}();browser.AsyncUnzlib=AsyncUnzlib;function unzlib(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bInflt,zule,function(){return[unzlibSync]}],function(c){return pbf(unzlibSync(c.data[0],gopt(c.data[1])))},5,s)}browser.unzlib=unzlib;function unzlibSync(u,n){return inflt(u.subarray(zls(u,n&&n.dictionary),-4),{i:2},n&&n.out,n&&n.dictionary)}browser.unzlibSync=unzlibSync;var Decompress=function(){function u(n,s){this.o=StrmOpt.call(this,n,s)||{},this.G=Gunzip,this.I=Inflate,this.Z=Unzlib}return u.prototype.i=function(){var n=this;this.s.ondata=function(s,c){n.ondata(s,c)}},u.prototype.push=function(n,s){if(this.ondata||err(5),this.s)this.s.push(n,s);else{if(this.p&&this.p.length){var c=new u8(this.p.length+n.length);c.set(this.p),c.set(n,this.p.length)}else this.p=n;this.p.length>2&&(this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(this.o):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,s),this.p=null)}},u}();browser.Decompress=Decompress;var AsyncDecompress=function(){function u(n,s){Decompress.call(this,n,s),this.queuedSize=0,this.G=AsyncGunzip,this.I=AsyncInflate,this.Z=AsyncUnzlib}return u.prototype.i=function(){var n=this;this.s.ondata=function(s,c,f){n.ondata(s,c,f)},this.s.ondrain=function(s){n.queuedSize-=s,n.ondrain&&n.ondrain(s)}},u.prototype.push=function(n,s){this.queuedSize+=n.length,Decompress.prototype.push.call(this,n,s)},u}();browser.AsyncDecompress=AsyncDecompress;function decompress(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),u[0]==31&&u[1]==139&&u[2]==8?gunzip(u,n,s):(u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31?inflate$2(u,n,s):unzlib(u,n,s)}browser.decompress=decompress;function decompressSync(u,n){return u[0]==31&&u[1]==139&&u[2]==8?gunzipSync(u,n):(u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31?inflateSync(u,n):unzlibSync(u,n)}browser.decompressSync=decompressSync;var fltn=function(u,n,s,c){for(var f in u){var g=u[f],A=n+f,v=c;Array.isArray(g)&&(v=mrg(c,g[1]),g=g[0]),g instanceof u8?s[A]=[g,v]:(s[A+="/"]=[new u8(0),v],fltn(g,A,s,c))}},te=typeof TextEncoder<"u"&&new TextEncoder,td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0}),tds=1}catch{}var dutf8=function(u){for(var n="",s=0;;){var c=u[s++],f=(c>127)+(c>223)+(c>239);if(s+f>u.length)return{s:n,r:slc(u,s-1)};f?f==3?(c=((c&15)<<18|(u[s++]&63)<<12|(u[s++]&63)<<6|u[s++]&63)-65536,n+=String.fromCharCode(55296|c>>10,56320|c&1023)):f&1?n+=String.fromCharCode((c&31)<<6|u[s++]&63):n+=String.fromCharCode((c&15)<<12|(u[s++]&63)<<6|u[s++]&63):n+=String.fromCharCode(c)}},DecodeUTF8=function(){function u(n){this.ondata=n,tds?this.t=new TextDecoder:this.p=et}return u.prototype.push=function(n,s){if(this.ondata||err(5),s=!!s,this.t){this.ondata(this.t.decode(n,{stream:!0}),s),s&&(this.t.decode().length&&err(8),this.t=null);return}this.p||err(4);var c=new u8(this.p.length+n.length);c.set(this.p),c.set(n,this.p.length);var f=dutf8(c),g=f.s,A=f.r;s?(A.length&&err(8),this.p=null):this.p=A,this.ondata(g,s)},u}();browser.DecodeUTF8=DecodeUTF8;var EncodeUTF8=function(){function u(n){this.ondata=n}return u.prototype.push=function(n,s){this.ondata||err(5),this.d&&err(4),this.ondata(strToU8(n),this.d=s||!1)},u}();browser.EncodeUTF8=EncodeUTF8;function strToU8(u,n){if(n){for(var s=new u8(u.length),c=0;c>1)),A=0,v=function(I){g[A++]=I},c=0;cg.length){var y=new u8(A+8+(f-c<<1));y.set(g),g=y}var T=u.charCodeAt(c);T<128||n?v(T):T<2048?(v(192|T>>6),v(128|T&63)):T>55295&&T<57344?(T=65536+(T&1047552)|u.charCodeAt(++c)&1023,v(240|T>>18),v(128|T>>12&63),v(128|T>>6&63),v(128|T&63)):(v(224|T>>12),v(128|T>>6&63),v(128|T&63))}return slc(g,0,A)}browser.strToU8=strToU8;function strFromU8(u,n){if(n){for(var s="",c=0;c65535&&err(9),n+=c+4}return n},wzh=function(u,n,s,c,f,g,A,v){var y=c.length,T=s.extra,I=v&&v.length,S=exfl(T);wbytes(u,n,A!=null?33639248:67324752),n+=4,A!=null&&(u[n++]=20,u[n++]=s.os),u[n]=20,n+=2,u[n++]=s.flag<<1|(g<0&&8),u[n++]=f&&8,u[n++]=s.compression&255,u[n++]=s.compression>>8;var k=new Date(s.mtime==null?Date.now():s.mtime),e=k.getFullYear()-1980;if((e<0||e>119)&&err(10),wbytes(u,n,e<<25|k.getMonth()+1<<21|k.getDate()<<16|k.getHours()<<11|k.getMinutes()<<5|k.getSeconds()>>1),n+=4,g!=-1&&(wbytes(u,n,s.crc),wbytes(u,n+4,g<0?-g-2:g),wbytes(u,n+8,s.size)),wbytes(u,n+12,y),wbytes(u,n+14,S),n+=16,A!=null&&(wbytes(u,n,I),wbytes(u,n+6,s.attrs),wbytes(u,n+10,A),n+=14),u.set(c,n),n+=y,S)for(var N in T){var M=T[N],O=M.length;wbytes(u,n,+N),wbytes(u,n+2,O),u.set(M,n+4),n+=4+O}return I&&(u.set(v,n),n+=I),n},wzf=function(u,n,s,c,f){wbytes(u,n,101010256),wbytes(u,n+8,s),wbytes(u,n+10,s),wbytes(u,n+12,c),wbytes(u,n+16,f)},ZipPassThrough=function(){function u(n){this.filename=n,this.c=crc(),this.size=0,this.compression=0}return u.prototype.process=function(n,s){this.ondata(null,n,s)},u.prototype.push=function(n,s){this.ondata||err(5),this.c.p(n),this.size+=n.length,s&&(this.crc=this.c.d()),this.process(n,s||!1)},u}();browser.ZipPassThrough=ZipPassThrough;var ZipDeflate=function(){function u(n,s){var c=this;s||(s={}),ZipPassThrough.call(this,n),this.d=new Deflate(s,function(f,g){c.ondata(null,f,g)}),this.compression=8,this.flag=dbf(s.level)}return u.prototype.process=function(n,s){try{this.d.push(n,s)}catch(c){this.ondata(c,null,s)}},u.prototype.push=function(n,s){ZipPassThrough.prototype.push.call(this,n,s)},u}();browser.ZipDeflate=ZipDeflate;var AsyncZipDeflate=function(){function u(n,s){var c=this;s||(s={}),ZipPassThrough.call(this,n),this.d=new AsyncDeflate(s,function(f,g,A){c.ondata(f,g,A)}),this.compression=8,this.flag=dbf(s.level),this.terminate=this.d.terminate}return u.prototype.process=function(n,s){this.d.push(n,s)},u.prototype.push=function(n,s){ZipPassThrough.prototype.push.call(this,n,s)},u}();browser.AsyncZipDeflate=AsyncZipDeflate;var Zip=function(){function u(n){this.ondata=n,this.u=[],this.d=1}return u.prototype.add=function(n){var s=this;if(this.ondata||err(5),this.d&2)this.ondata(err(4+(this.d&1)*8,0,1),null,!1);else{var c=strToU8(n.filename),f=c.length,g=n.comment,A=g&&strToU8(g),v=f!=n.filename.length||A&&g.length!=A.length,y=f+exfl(n.extra)+30;f>65535&&this.ondata(err(11,0,1),null,!1);var T=new u8(y);wzh(T,0,n,c,v,-1);var I=[T],S=function(){for(var O=0,z=I;O65535&&fe(err(11,0,1),null),!oe)fe(null,V);else if(q<16e4)try{fe(null,deflateSync(V,b))}catch(me){fe(me,null)}else I.push(deflate$2(V,b,fe))},M=0;M65535&&err(11);var z=I?deflateSync(y,T):y,B=z.length,V=crc();V.p(y),c.push(mrg(T,{size:y.length,crc:V.d(),c:z,f:S,m:N,u:k!=A.length||N&&e.length!=M,o:f,compression:I})),f+=30+k+O+B,g+=76+2*(k+O)+(M||0)+B}for(var b=new u8(g+22),W=f,q=g-f,Y=0;Y0){var f=Math.min(this.c,n.length),g=n.subarray(0,f);if(this.c-=f,this.d?this.d.push(g,!this.c):this.k[0].push(g),n=n.subarray(f),n.length)return this.push(n,s)}else{var A=0,v=0,y=void 0,T=void 0;this.p.length?n.length?(T=new u8(this.p.length+n.length),T.set(this.p),T.set(n,this.p.length)):T=this.p:T=n;for(var I=T.length,S=this.c,k=S&&this.d,e=function(){var z,B=b4(T,v);if(B==67324752){A=1,y=v,N.d=null,N.c=0;var V=b2(T,v+6),b=b2(T,v+8),W=V&2048,q=V&8,Y=b2(T,v+26),X=b2(T,v+28);if(I>v+30+Y+X){var Q=[];N.k.unshift(Q),A=2;var m=b4(T,v+18),Z=b4(T,v+22),ee=strFromU8(T.subarray(v+30,v+=30+Y),!W);m==4294967295?(z=q?[-2]:z64e(T,v),m=z[0],Z=z[1]):q&&(m=-1),v+=X,N.c=m;var oe,fe={name:ee,compression:b,start:function(){if(fe.ondata||err(5),!m)fe.ondata(null,et,!0);else{var me=c.o[b];me||fe.ondata(err(14,"unknown compression type "+b,1),null,!1),oe=m<0?new me(ee):new me(ee,m,Z),oe.ondata=function(we,Fe,De){fe.ondata(we,Fe,De)};for(var pe=0,Se=Q;pe=0&&(fe.size=m,fe.originalSize=Z),N.onfile(fe)}return"break"}else if(S){if(B==134695760)return y=v+=12+(S==-2&&8),A=3,N.c=0,"break";if(B==33639248)return y=v-=4,A=3,N.c=0,"break"}},N=this;v65558)return A(err(13,0,1),null),f;var y=b2(u,v+8);if(y){var T=y,I=b4(u,v+16),S=I==4294967295||T==65535;if(S){var k=b4(u,v-12);S=b4(u,k)==101075792,S&&(T=y=b4(u,k+32),I=b4(u,k+48))}for(var e=n&&n.filter,N=function(O){var z=zh(u,I,S),B=z[0],V=z[1],b=z[2],W=z[3],q=z[4],Y=z[5],X=slzh(u,Y);I=q;var Q=function(Z,ee){Z?(f(),A(Z,null)):(ee&&(g[W]=ee),--y||A(null,g))};if(!e||e({name:W,size:V,originalSize:b,compression:B}))if(!B)Q(null,slc(u,X,X+V));else if(B==8){var m=u.subarray(X,X+V);if(b<524288||V>.8*b)try{Q(null,inflateSync(m,{out:new u8(b)}))}catch(Z){Q(Z,null)}else c.push(inflate$2(m,{size:b},Q))}else Q(err(14,"unknown compression type "+B,1),null);else Q(null,null)},M=0;M65558)&&err(13);var f=b2(u,c+8);if(!f)return{};var g=b4(u,c+16),A=g==4294967295||f==65535;if(A){var v=b4(u,c-12);A=b4(u,v)==101075792,A&&(f=b4(u,v+32),g=b4(u,v+48))}for(var y=n&&n.filter,T=0;T=0;f--)A=A*256+g[f];return A}static getExtensionsAt(n,s,c,f){let g=[],A=s;for(;Af&&(v=!v,y=J0.getIntAt(n,A,v),y+A>f))throw new Error("This does not appear to be a valid NIFTI extension");if(y%16!=0)throw new Error("This does not appear to be a NIFTI extension");let T=J0.getIntAt(n,A+4,v),I=n.buffer.slice(A+8,A+y);console.log("extensionByteIndex: "+(A+8)+" esize: "+y),console.log(I);let S=new nifti_extension_1.NIFTIEXTENSION(y,T,I,v);g.push(S),A+=y}return g}static toArrayBuffer(n){var s,c,f;for(s=new ArrayBuffer(n.length),c=new Uint8Array(s),f=0;f>>1:n>>>1;s[c]=n}return s}static crc32(n){J0.crcTable||(J0.crcTable=J0.makeCRCTable());const s=J0.crcTable;let c=-1;for(var f=0;f>>8^s[(c^n.getUint8(f))&255];return(c^-1)>>>0}};ct(J0,"crcTable",null),ct(J0,"GUNZIP_MAGIC_COOKIE1",31),ct(J0,"GUNZIP_MAGIC_COOKIE2",139),ct(J0,"getByteAt",function(n,s){return n.getInt8(s)}),ct(J0,"getShortAt",function(n,s,c){return n.getInt16(s,c)});let Utils=J0;utilities$1.Utils=Utils;Object.defineProperty(nifti1,"__esModule",{value:!0});nifti1.NIFTI1=void 0;const utilities_1$1=utilities$1,Ht=class Ht{constructor(){ct(this,"littleEndian",!1);ct(this,"dim_info",0);ct(this,"dims",[]);ct(this,"intent_p1",0);ct(this,"intent_p2",0);ct(this,"intent_p3",0);ct(this,"intent_code",0);ct(this,"datatypeCode",0);ct(this,"numBitsPerVoxel",0);ct(this,"slice_start",0);ct(this,"slice_end",0);ct(this,"slice_code",0);ct(this,"pixDims",[]);ct(this,"vox_offset",0);ct(this,"scl_slope",1);ct(this,"scl_inter",0);ct(this,"xyzt_units",0);ct(this,"cal_max",0);ct(this,"cal_min",0);ct(this,"slice_duration",0);ct(this,"toffset",0);ct(this,"description","");ct(this,"aux_file","");ct(this,"intent_name","");ct(this,"qform_code",0);ct(this,"sform_code",0);ct(this,"quatern_a",0);ct(this,"quatern_b",0);ct(this,"quatern_c",0);ct(this,"quatern_d",0);ct(this,"qoffset_x",0);ct(this,"qoffset_y",0);ct(this,"qoffset_z",0);ct(this,"affine",[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);ct(this,"qfac",1);ct(this,"quatern_R");ct(this,"magic","0");ct(this,"isHDR",!1);ct(this,"extensionFlag",[0,0,0,0]);ct(this,"extensionSize",0);ct(this,"extensionCode",0);ct(this,"extensions",[]);ct(this,"getDatatypeCodeString",function(n){return n===Ht.TYPE_UINT8?"1-Byte Unsigned Integer":n===Ht.TYPE_INT16?"2-Byte Signed Integer":n===Ht.TYPE_INT32?"4-Byte Signed Integer":n===Ht.TYPE_FLOAT32?"4-Byte Float":n===Ht.TYPE_FLOAT64?"8-Byte Float":n===Ht.TYPE_RGB24?"RGB":n===Ht.TYPE_INT8?"1-Byte Signed Integer":n===Ht.TYPE_UINT16?"2-Byte Unsigned Integer":n===Ht.TYPE_UINT32?"4-Byte Unsigned Integer":n===Ht.TYPE_INT64?"8-Byte Signed Integer":n===Ht.TYPE_UINT64?"8-Byte Unsigned Integer":"Unknown"});ct(this,"getTransformCodeString",function(n){return n===Ht.XFORM_SCANNER_ANAT?"Scanner":n===Ht.XFORM_ALIGNED_ANAT?"Aligned":n===Ht.XFORM_TALAIRACH?"Talairach":n===Ht.XFORM_MNI_152?"MNI":"Unknown"});ct(this,"getUnitsCodeString",function(n){return n===Ht.UNITS_METER?"Meters":n===Ht.UNITS_MM?"Millimeters":n===Ht.UNITS_MICRON?"Microns":n===Ht.UNITS_SEC?"Seconds":n===Ht.UNITS_MSEC?"Milliseconds":n===Ht.UNITS_USEC?"Microseconds":n===Ht.UNITS_HZ?"Hz":n===Ht.UNITS_PPM?"PPM":n===Ht.UNITS_RADS?"Rads":"Unknown"});ct(this,"nifti_mat33_mul",function(n,s){var c=[[0,0,0],[0,0,0],[0,0,0]],f,g;for(f=0;f<3;f+=1)for(g=0;g<3;g+=1)c[f][g]=n[f][0]*s[0][g]+n[f][1]*s[1][g]+n[f][2]*s[2][g];return c});ct(this,"nifti_mat33_determ",function(n){var s,c,f,g,A,v,y,T,I;return s=n[0][0],c=n[0][1],f=n[0][2],g=n[1][0],A=n[1][1],v=n[1][2],y=n[2][0],T=n[2][1],I=n[2][2],s*A*I-s*T*v-g*c*I+g*T*f+y*c*v-y*A*f})}readHeader(n){var s=new DataView(n),c=utilities_1$1.Utils.getIntAt(s,0,this.littleEndian),f,g,A,v;if(c!==Ht.MAGIC_COOKIE&&(this.littleEndian=!0,c=utilities_1$1.Utils.getIntAt(s,0,this.littleEndian)),c!==Ht.MAGIC_COOKIE)throw new Error("This does not appear to be a NIFTI file!");for(this.dim_info=utilities_1$1.Utils.getByteAt(s,39),f=0;f<8;f+=1)v=40+f*2,this.dims[f]=utilities_1$1.Utils.getShortAt(s,v,this.littleEndian);for(this.intent_p1=utilities_1$1.Utils.getFloatAt(s,56,this.littleEndian),this.intent_p2=utilities_1$1.Utils.getFloatAt(s,60,this.littleEndian),this.intent_p3=utilities_1$1.Utils.getFloatAt(s,64,this.littleEndian),this.intent_code=utilities_1$1.Utils.getShortAt(s,68,this.littleEndian),this.datatypeCode=utilities_1$1.Utils.getShortAt(s,70,this.littleEndian),this.numBitsPerVoxel=utilities_1$1.Utils.getShortAt(s,72,this.littleEndian),this.slice_start=utilities_1$1.Utils.getShortAt(s,74,this.littleEndian),f=0;f<8;f+=1)v=76+f*4,this.pixDims[f]=utilities_1$1.Utils.getFloatAt(s,v,this.littleEndian);if(this.vox_offset=utilities_1$1.Utils.getFloatAt(s,108,this.littleEndian),this.scl_slope=utilities_1$1.Utils.getFloatAt(s,112,this.littleEndian),this.scl_inter=utilities_1$1.Utils.getFloatAt(s,116,this.littleEndian),this.slice_end=utilities_1$1.Utils.getShortAt(s,120,this.littleEndian),this.slice_code=utilities_1$1.Utils.getByteAt(s,122),this.xyzt_units=utilities_1$1.Utils.getByteAt(s,123),this.cal_max=utilities_1$1.Utils.getFloatAt(s,124,this.littleEndian),this.cal_min=utilities_1$1.Utils.getFloatAt(s,128,this.littleEndian),this.slice_duration=utilities_1$1.Utils.getFloatAt(s,132,this.littleEndian),this.toffset=utilities_1$1.Utils.getFloatAt(s,136,this.littleEndian),this.description=utilities_1$1.Utils.getStringAt(s,148,228),this.aux_file=utilities_1$1.Utils.getStringAt(s,228,252),this.qform_code=utilities_1$1.Utils.getShortAt(s,252,this.littleEndian),this.sform_code=utilities_1$1.Utils.getShortAt(s,254,this.littleEndian),this.quatern_b=utilities_1$1.Utils.getFloatAt(s,256,this.littleEndian),this.quatern_c=utilities_1$1.Utils.getFloatAt(s,260,this.littleEndian),this.quatern_d=utilities_1$1.Utils.getFloatAt(s,264,this.littleEndian),this.quatern_a=Math.sqrt(1-(Math.pow(this.quatern_b,2)+Math.pow(this.quatern_c,2)+Math.pow(this.quatern_d,2))),this.qoffset_x=utilities_1$1.Utils.getFloatAt(s,268,this.littleEndian),this.qoffset_y=utilities_1$1.Utils.getFloatAt(s,272,this.littleEndian),this.qoffset_z=utilities_1$1.Utils.getFloatAt(s,276,this.littleEndian),this.qform_code<1&&this.sform_code<1&&(this.affine[0][0]=this.pixDims[1],this.affine[1][1]=this.pixDims[2],this.affine[2][2]=this.pixDims[3]),this.qform_code>0&&this.sform_code0)for(g=0;g<3;g+=1)for(A=0;A<4;A+=1)v=280+(g*4+A)*4,this.affine[g][A]=utilities_1$1.Utils.getFloatAt(s,v,this.littleEndian);if(this.affine[3][0]=0,this.affine[3][1]=0,this.affine[3][2]=0,this.affine[3][3]=1,this.intent_name=utilities_1$1.Utils.getStringAt(s,328,344),this.magic=utilities_1$1.Utils.getStringAt(s,344,348),this.isHDR=this.magic===String.fromCharCode.apply(null,Ht.MAGIC_NUMBER2),s.byteLength>Ht.MAGIC_COOKIE){this.extensionFlag[0]=utilities_1$1.Utils.getByteAt(s,348),this.extensionFlag[1]=utilities_1$1.Utils.getByteAt(s,349),this.extensionFlag[2]=utilities_1$1.Utils.getByteAt(s,350),this.extensionFlag[3]=utilities_1$1.Utils.getByteAt(s,351);let y=!0;!this.isHDR&&this.vox_offset<=352&&(y=!1),s.byteLength<=368&&(y=!1),y&&this.extensionFlag[0]&&(this.extensions=utilities_1$1.Utils.getExtensionsAt(s,this.getExtensionLocation(),this.littleEndian,this.vox_offset),this.extensionSize=this.extensions[0].esize,this.extensionCode=this.extensions[0].ecode)}}toFormattedString(){var n=utilities_1$1.Utils.formatNumber,s="";return s+="Dim Info = "+this.dim_info+` +var tA=Object.defineProperty;var iA=(u,n,s)=>n in u?tA(u,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[n]=s;var ct=(u,n,s)=>(iA(u,typeof n!="symbol"?n+"":n,s),s);function _mergeNamespaces(u,n){for(var s=0;sc[f]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const g of f)if(g.type==="childList")for(const A of g.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&c(A)}).observe(document,{childList:!0,subtree:!0});function s(f){const g={};return f.integrity&&(g.integrity=f.integrity),f.referrerPolicy&&(g.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?g.credentials="include":f.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function c(f){if(f.ep)return;f.ep=!0;const g=s(f);fetch(f.href,g)}})();var EPSILON=1e-6,ARRAY_TYPE=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var u=0,n=arguments.length;n--;)u+=arguments[n]*arguments[n];return Math.sqrt(u)});function create$4(){var u=new ARRAY_TYPE(9);return ARRAY_TYPE!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[5]=0,u[6]=0,u[7]=0),u[0]=1,u[4]=1,u[8]=1,u}function fromValues$4(u,n,s,c,f,g,A,v,y){var T=new ARRAY_TYPE(9);return T[0]=u,T[1]=n,T[2]=s,T[3]=c,T[4]=f,T[5]=g,T[6]=A,T[7]=v,T[8]=y,T}function multiply$3(u,n,s){var c=n[0],f=n[1],g=n[2],A=n[3],v=n[4],y=n[5],T=n[6],I=n[7],S=n[8],k=s[0],e=s[1],N=s[2],M=s[3],O=s[4],U=s[5],B=s[6],V=s[7],b=s[8];return u[0]=k*c+e*A+N*T,u[1]=k*f+e*v+N*I,u[2]=k*g+e*y+N*S,u[3]=M*c+O*A+U*T,u[4]=M*f+O*v+U*I,u[5]=M*g+O*y+U*S,u[6]=B*c+V*A+b*T,u[7]=B*f+V*v+b*I,u[8]=B*g+V*y+b*S,u}function create$3(){var u=new ARRAY_TYPE(16);return ARRAY_TYPE!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=0,u[12]=0,u[13]=0,u[14]=0),u[0]=1,u[5]=1,u[10]=1,u[15]=1,u}function clone$3(u){var n=new ARRAY_TYPE(16);return n[0]=u[0],n[1]=u[1],n[2]=u[2],n[3]=u[3],n[4]=u[4],n[5]=u[5],n[6]=u[6],n[7]=u[7],n[8]=u[8],n[9]=u[9],n[10]=u[10],n[11]=u[11],n[12]=u[12],n[13]=u[13],n[14]=u[14],n[15]=u[15],n}function copy$1(u,n){return u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],u[4]=n[4],u[5]=n[5],u[6]=n[6],u[7]=n[7],u[8]=n[8],u[9]=n[9],u[10]=n[10],u[11]=n[11],u[12]=n[12],u[13]=n[13],u[14]=n[14],u[15]=n[15],u}function fromValues$3(u,n,s,c,f,g,A,v,y,T,I,S,k,e,N,M){var O=new ARRAY_TYPE(16);return O[0]=u,O[1]=n,O[2]=s,O[3]=c,O[4]=f,O[5]=g,O[6]=A,O[7]=v,O[8]=y,O[9]=T,O[10]=I,O[11]=S,O[12]=k,O[13]=e,O[14]=N,O[15]=M,O}function identity$2(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function transpose$3(u,n){if(u===n){var s=n[1],c=n[2],f=n[3],g=n[6],A=n[7],v=n[11];u[1]=n[4],u[2]=n[8],u[3]=n[12],u[4]=s,u[6]=n[9],u[7]=n[13],u[8]=c,u[9]=g,u[11]=n[14],u[12]=f,u[13]=A,u[14]=v}else u[0]=n[0],u[1]=n[4],u[2]=n[8],u[3]=n[12],u[4]=n[1],u[5]=n[5],u[6]=n[9],u[7]=n[13],u[8]=n[2],u[9]=n[6],u[10]=n[10],u[11]=n[14],u[12]=n[3],u[13]=n[7],u[14]=n[11],u[15]=n[15];return u}function invert(u,n){var s=n[0],c=n[1],f=n[2],g=n[3],A=n[4],v=n[5],y=n[6],T=n[7],I=n[8],S=n[9],k=n[10],e=n[11],N=n[12],M=n[13],O=n[14],U=n[15],B=s*v-c*A,V=s*y-f*A,b=s*T-g*A,W=c*y-f*v,q=c*T-g*v,Y=f*T-g*y,X=I*M-S*N,Q=I*O-k*N,m=I*U-e*N,Z=S*O-k*M,ee=S*U-e*M,oe=k*U-e*O,fe=B*oe-V*ee+b*Z+W*m-q*Q+Y*X;return fe?(fe=1/fe,u[0]=(v*oe-y*ee+T*Z)*fe,u[1]=(f*ee-c*oe-g*Z)*fe,u[2]=(M*Y-O*q+U*W)*fe,u[3]=(k*q-S*Y-e*W)*fe,u[4]=(y*m-A*oe-T*Q)*fe,u[5]=(s*oe-f*m+g*Q)*fe,u[6]=(O*b-N*Y-U*V)*fe,u[7]=(I*Y-k*b+e*V)*fe,u[8]=(A*ee-v*m+T*X)*fe,u[9]=(c*m-s*ee-g*X)*fe,u[10]=(N*q-M*b+U*B)*fe,u[11]=(S*b-I*q-e*B)*fe,u[12]=(v*Q-A*Z-y*X)*fe,u[13]=(s*Z-c*Q+f*X)*fe,u[14]=(M*V-N*W-O*B)*fe,u[15]=(I*W-S*V+k*B)*fe,u):null}function multiply$2(u,n,s){var c=n[0],f=n[1],g=n[2],A=n[3],v=n[4],y=n[5],T=n[6],I=n[7],S=n[8],k=n[9],e=n[10],N=n[11],M=n[12],O=n[13],U=n[14],B=n[15],V=s[0],b=s[1],W=s[2],q=s[3];return u[0]=V*c+b*v+W*S+q*M,u[1]=V*f+b*y+W*k+q*O,u[2]=V*g+b*T+W*e+q*U,u[3]=V*A+b*I+W*N+q*B,V=s[4],b=s[5],W=s[6],q=s[7],u[4]=V*c+b*v+W*S+q*M,u[5]=V*f+b*y+W*k+q*O,u[6]=V*g+b*T+W*e+q*U,u[7]=V*A+b*I+W*N+q*B,V=s[8],b=s[9],W=s[10],q=s[11],u[8]=V*c+b*v+W*S+q*M,u[9]=V*f+b*y+W*k+q*O,u[10]=V*g+b*T+W*e+q*U,u[11]=V*A+b*I+W*N+q*B,V=s[12],b=s[13],W=s[14],q=s[15],u[12]=V*c+b*v+W*S+q*M,u[13]=V*f+b*y+W*k+q*O,u[14]=V*g+b*T+W*e+q*U,u[15]=V*A+b*I+W*N+q*B,u}function translate(u,n,s){var c=s[0],f=s[1],g=s[2],A,v,y,T,I,S,k,e,N,M,O,U;return n===u?(u[12]=n[0]*c+n[4]*f+n[8]*g+n[12],u[13]=n[1]*c+n[5]*f+n[9]*g+n[13],u[14]=n[2]*c+n[6]*f+n[10]*g+n[14],u[15]=n[3]*c+n[7]*f+n[11]*g+n[15]):(A=n[0],v=n[1],y=n[2],T=n[3],I=n[4],S=n[5],k=n[6],e=n[7],N=n[8],M=n[9],O=n[10],U=n[11],u[0]=A,u[1]=v,u[2]=y,u[3]=T,u[4]=I,u[5]=S,u[6]=k,u[7]=e,u[8]=N,u[9]=M,u[10]=O,u[11]=U,u[12]=A*c+I*f+N*g+n[12],u[13]=v*c+S*f+M*g+n[13],u[14]=y*c+k*f+O*g+n[14],u[15]=T*c+e*f+U*g+n[15]),u}function scale$4(u,n,s){var c=s[0],f=s[1],g=s[2];return u[0]=n[0]*c,u[1]=n[1]*c,u[2]=n[2]*c,u[3]=n[3]*c,u[4]=n[4]*f,u[5]=n[5]*f,u[6]=n[6]*f,u[7]=n[7]*f,u[8]=n[8]*g,u[9]=n[9]*g,u[10]=n[10]*g,u[11]=n[11]*g,u[12]=n[12],u[13]=n[13],u[14]=n[14],u[15]=n[15],u}function rotateX(u,n,s){var c=Math.sin(s),f=Math.cos(s),g=n[4],A=n[5],v=n[6],y=n[7],T=n[8],I=n[9],S=n[10],k=n[11];return n!==u&&(u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],u[12]=n[12],u[13]=n[13],u[14]=n[14],u[15]=n[15]),u[4]=g*f+T*c,u[5]=A*f+I*c,u[6]=v*f+S*c,u[7]=y*f+k*c,u[8]=T*f-g*c,u[9]=I*f-A*c,u[10]=S*f-v*c,u[11]=k*f-y*c,u}function rotateZ(u,n,s){var c=Math.sin(s),f=Math.cos(s),g=n[0],A=n[1],v=n[2],y=n[3],T=n[4],I=n[5],S=n[6],k=n[7];return n!==u&&(u[8]=n[8],u[9]=n[9],u[10]=n[10],u[11]=n[11],u[12]=n[12],u[13]=n[13],u[14]=n[14],u[15]=n[15]),u[0]=g*f+T*c,u[1]=A*f+I*c,u[2]=v*f+S*c,u[3]=y*f+k*c,u[4]=T*f-g*c,u[5]=I*f-A*c,u[6]=S*f-v*c,u[7]=k*f-y*c,u}function fromRotation(u,n,s){var c=s[0],f=s[1],g=s[2],A=Math.hypot(c,f,g),v,y,T;return A0&&(g=1/Math.sqrt(g)),u[0]=n[0]*g,u[1]=n[1]*g,u[2]=n[2]*g,u}function dot$2(u,n){return u[0]*n[0]+u[1]*n[1]+u[2]*n[2]}function cross(u,n,s){var c=n[0],f=n[1],g=n[2],A=s[0],v=s[1],y=s[2];return u[0]=f*y-g*v,u[1]=g*A-c*y,u[2]=c*v-f*A,u}function lerp(u,n,s,c){var f=n[0],g=n[1],A=n[2];return u[0]=f+c*(s[0]-f),u[1]=g+c*(s[1]-g),u[2]=A+c*(s[2]-A),u}function angle(u,n){var s=u[0],c=u[1],f=u[2],g=n[0],A=n[1],v=n[2],y=Math.sqrt(s*s+c*c+f*f),T=Math.sqrt(g*g+A*A+v*v),I=y*T,S=I&&dot$2(u,n)/I;return Math.acos(Math.min(Math.max(S,-1),1))}var sub$4=subtract$1,len=length$1;(function(){var u=create$2();return function(n,s,c,f,g,A){var v,y;for(s||(s=3),c||(c=0),f?y=Math.min(f*s+c,n.length):y=n.length,v=c;v0&&(f=1/Math.sqrt(f)),u[0]=n[0]*f,u[1]=n[1]*f,u}(function(){var u=create();return function(n,s,c,f,g,A){var v,y;for(s||(s=2),c||(c=0),f?y=Math.min(f*s+c,n.length):y=n.length,v=c;v256){for(BUFFER=Array(u=256);u--;)BUFFER[u]=256*Math.random()|0;u=IDX=0}for(;u<16;u++)n=BUFFER[IDX+u],u==6?s+=HEX[n&15|64]:u==8?s+=HEX[n&63|128]:s+=HEX[n],u&1&&u>1&&u<11&&(s+="-");return IDX++,s}var u8$1=Uint8Array,u16$1=Uint16Array,i32$1=Int32Array,fleb$1=new u8$1([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb$1=new u8$1([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim$1=new u8$1([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb$1=function(u,n){for(var s=new u16$1(31),c=0;c<31;++c)s[c]=n+=1<>1|(i$1&21845)<<1;x$1=(x$1&52428)>>2|(x$1&13107)<<2,x$1=(x$1&61680)>>4|(x$1&3855)<<4,rev$1[i$1]=((x$1&65280)>>8|(x$1&255)<<8)>>1}var hMap$1=function(u,n,s){for(var c=u.length,f=0,g=new u16$1(n);f>y]=T}else for(v=new u16$1(c),f=0;f>15-u[f]);return v},flt$1=new u8$1(288);for(var i$1=0;i$1<144;++i$1)flt$1[i$1]=8;for(var i$1=144;i$1<256;++i$1)flt$1[i$1]=9;for(var i$1=256;i$1<280;++i$1)flt$1[i$1]=7;for(var i$1=280;i$1<288;++i$1)flt$1[i$1]=8;var fdt$1=new u8$1(32);for(var i$1=0;i$1<32;++i$1)fdt$1[i$1]=5;var flm$1=hMap$1(flt$1,9,0),flrm$1=hMap$1(flt$1,9,1),fdm$1=hMap$1(fdt$1,5,0),fdrm$1=hMap$1(fdt$1,5,1),max$5=function(u){for(var n=u[0],s=1;sn&&(n=u[s]);return n},bits$1=function(u,n,s){var c=n/8|0;return(u[c]|u[c+1]<<8)>>(n&7)&s},bits16$1=function(u,n){var s=n/8|0;return(u[s]|u[s+1]<<8|u[s+2]<<16)>>(n&7)},shft$1=function(u){return(u+7)/8|0},slc$1=function(u,n,s){return(n==null||n<0)&&(n=0),(s==null||s>u.length)&&(s=u.length),new u8$1(u.subarray(n,s))},ec$1=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err$1=function(u,n,s){var c=new Error(n||ec$1[u]);if(c.code=u,Error.captureStackTrace&&Error.captureStackTrace(c,err$1),!s)throw c;return c},inflt$1=function(u,n,s,c){var f=u.length,g=c?c.length:0;if(!f||n.f&&!n.l)return s||new u8$1(0);var A=!s,v=A||n.i!=2,y=n.i;A&&(s=new u8$1(f*3));var T=function(Ft){var Mt=s.length;if(Ft>Mt){var Ke=new u8$1(Math.max(Mt*2,Ft));Ke.set(s),s=Ke}},I=n.f||0,S=n.p||0,k=n.b||0,e=n.l,N=n.d,M=n.m,O=n.n,U=f*8;do{if(!e){I=bits$1(u,S,1);var B=bits$1(u,S+1,3);if(S+=3,B)if(B==1)e=flrm$1,N=fdrm$1,M=9,O=5;else if(B==2){var q=bits$1(u,S,31)+257,Y=bits$1(u,S+10,15)+4,X=q+bits$1(u,S+5,31)+1;S+=14;for(var Q=new u8$1(X),m=new u8$1(19),Z=0;Z>4;if(V<16)Q[Z++]=V;else{var pe=0,Se=0;for(V==16?(Se=3+bits$1(u,S,3),S+=2,pe=Q[Z-1]):V==17?(Se=3+bits$1(u,S,7),S+=3):V==18&&(Se=11+bits$1(u,S,127),S+=7);Se--;)Q[Z++]=pe}}var xe=Q.subarray(0,q),we=Q.subarray(q);M=max$5(xe),O=max$5(we),e=hMap$1(xe,M,1),N=hMap$1(we,O,1)}else err$1(1);else{var V=shft$1(S)+4,b=u[V-4]|u[V-3]<<8,W=V+b;if(W>f){y&&err$1(0);break}v&&T(k+b),s.set(u.subarray(V,W),k),n.b=k+=b,n.p=S=W*8,n.f=I;continue}if(S>U){y&&err$1(0);break}}v&&T(k+131072);for(var Fe=(1<>4;if(S+=pe&15,S>U){y&&err$1(0);break}if(pe||err$1(2),nt<256)s[k++]=nt;else if(nt==256){Ze=S,e=null;break}else{var Ue=nt-254;if(nt>264){var Z=nt-257,ye=fleb$1[Z];Ue=bits$1(u,S,(1<>4;at||err$1(3),S+=at&15;var we=fd$1[ft];if(ft>3){var ye=fdeb$1[ft];we+=bits16$1(u,S)&(1<U){y&&err$1(0);break}v&&T(k+131072);var Tt=k+Ue;if(k>8},wbits16$1=function(u,n,s){s<<=n&7;var c=n/8|0;u[c]|=s,u[c+1]|=s>>8,u[c+2]|=s>>16},hTree$1=function(u,n){for(var s=[],c=0;ck&&(k=g[c].s);var e=new u16$1(k+1),N=ln$1(s[I-1],e,0);if(N>n){var c=0,M=0,O=N-n,U=1<n)M+=U-(1<>=O;M>0;){var V=g[c].s;e[V]=0&&M;--c){var b=g[c].s;e[b]==n&&(--e[b],++M)}N=n}return{t:new u8$1(e),l:N}},ln$1=function(u,n,s){return u.s==-1?Math.max(ln$1(u.l,n,s+1),ln$1(u.r,n,s+1)):n[u.s]=s},lc$1=function(u){for(var n=u.length;n&&!u[--n];);for(var s=new u16$1(++n),c=0,f=u[0],g=1,A=function(y){s[c++]=y},v=1;v<=n;++v)if(u[v]==f&&v!=n)++g;else{if(!f&&g>2){for(;g>138;g-=138)A(32754);g>2&&(A(g>10?g-11<<5|28690:g-3<<5|12305),g=0)}else if(g>3){for(A(f),--g;g>6;g-=6)A(8304);g>2&&(A(g-3<<5|8208),g=0)}for(;g--;)A(f);g=1,f=u[v]}return{c:s.subarray(0,c),n}},clen$1=function(u,n){for(var s=0,c=0;c>8,u[f+2]=u[f]^255,u[f+3]=u[f+1]^255;for(var g=0;g4&&!m[clim$1[ee-1]];--ee);var oe=T+5<<3,fe=clen$1(f,flt$1)+clen$1(g,fdt$1)+A,me=clen$1(f,k)+clen$1(g,M)+A+14+3*ee+clen$1(Y,m)+2*Y[16]+3*Y[17]+7*Y[18];if(y>=0&&oe<=fe&&oe<=me)return wfblk$1(n,I,u.subarray(y,y+T));var pe,Se,xe,we;if(wbits$1(n,I,1+(me15&&(wbits$1(n,I,nt[X]>>5&127),I+=nt[X]>>12)}}else pe=flm$1,Se=flt$1,xe=fdm$1,we=fdt$1;for(var X=0;X255){var Ue=ye>>18&31;wbits16$1(n,I,pe[Ue+257]),I+=Se[Ue+257],Ue>7&&(wbits$1(n,I,ye>>23&31),I+=fleb$1[Ue]);var at=ye&31;wbits16$1(n,I,xe[at]),I+=we[at],at>3&&(wbits16$1(n,I,ye>>5&8191),I+=fdeb$1[at])}else wbits16$1(n,I,pe[ye]),I+=Se[ye]}return wbits16$1(n,I,pe[256]),I+Se[256]},deo$1=new i32$1([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et$1=new u8$1(0),dflt$1=function(u,n,s,c,f,g){var A=g.z||u.length,v=new u8$1(c+A+5*(1+Math.ceil(A/7e3))+f),y=v.subarray(c,v.length-f),T=g.l,I=(g.r||0)&7;if(n){I&&(y[0]=g.r>>3);for(var S=deo$1[n-1],k=S>>13,e=S&8191,N=(1<7e3||m>24576)&&(pe>423||!T)){I=wblk$1(u,y,0,b,W,q,X,m,ee,Q-ee,I),m=Y=X=0,ee=Q;for(var Se=0;Se<286;++Se)W[Se]=0;for(var Se=0;Se<30;++Se)q[Se]=0}var xe=2,we=0,Fe=e,De=fe-me&32767;if(pe>2&&oe==V(Q-De))for(var Ze=Math.min(k,pe)-1,nt=Math.min(32767,Q),Ue=Math.min(258,pe);De<=nt&&--Fe&&fe!=me;){if(u[Q+xe]==u[Q+xe-De]){for(var ye=0;yexe){if(xe=ye,we=De,ye>Ze)break;for(var at=Math.min(De,ye-2),ft=0,Se=0;Seft&&(ft=Ot,me=Tt)}}}fe=me,me=M[fe],De+=fe-me&32767}if(we){b[m++]=268435456|revfl$1[xe]<<18|revfd$1[we];var Ft=revfl$1[xe]&31,Mt=revfd$1[we]&31;X+=fleb$1[Ft]+fdeb$1[Mt],++W[257+Ft],++q[Mt],Z=Q+xe,++Y}else b[m++]=u[Q],++W[u[Q]]}}for(Q=Math.max(Q,Z);Q=A&&(y[I/8|0]=T,Ke=A),I=wfblk$1(y,I+1,u.subarray(Q,Ke))}g.i=A}return slc$1(v,0,c+shft$1(I)+f)},crct$1=function(){for(var u=new Int32Array(256),n=0;n<256;++n){for(var s=n,c=9;--c;)s=(s&1&&-306674912)^s>>>1;u[n]=s}return u}(),crc$1=function(){var u=-1;return{p:function(n){for(var s=u,c=0;c>>8;u=s},d:function(){return~u}}},dopt$1=function(u,n,s,c,f){if(!f&&(f={l:1},n.dictionary)){var g=n.dictionary.subarray(-32768),A=new u8$1(g.length+u.length);A.set(g),A.set(u,g.length),u=A,f.w=g.length}return dflt$1(u,n.level==null?6:n.level,n.mem==null?f.l?Math.ceil(Math.max(8,Math.min(13,Math.log(u.length)))*1.5):20:12+n.mem,s,c,f)},b2$1=function(u,n){return u[n]|u[n+1]<<8},b4$1=function(u,n){return(u[n]|u[n+1]<<8|u[n+2]<<16|u[n+3]<<24)>>>0},b8$1=function(u,n){return b4$1(u,n)+b4$1(u,n+4)*4294967296},wbytes$1=function(u,n,s){for(;s;++n)u[n]=s,s>>>=8},gzh$1=function(u,n){var s=n.filename;if(u[0]=31,u[1]=139,u[2]=8,u[8]=n.level<2?4:n.level==9?2:0,u[9]=3,n.mtime!=0&&wbytes$1(u,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),s){u[3]=8;for(var c=0;c<=s.length;++c)u[c+10]=s.charCodeAt(c)}},gzs$1=function(u){(u[0]!=31||u[1]!=139||u[2]!=8)&&err$1(6,"invalid gzip data");var n=u[3],s=10;n&4&&(s+=(u[10]|u[11]<<8)+2);for(var c=(n>>3&1)+(n>>4&1);c>0;c-=!u[s++]);return s+(n&2)},gzl$1=function(u){var n=u.length;return(u[n-4]|u[n-3]<<8|u[n-2]<<16|u[n-1]<<24)>>>0},gzhl$1=function(u){return 10+(u.filename?u.filename.length+1:0)},zls$1=function(u,n){return((u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31)&&err$1(6,"invalid zlib data"),(u[1]>>5&1)==+!n&&err$1(6,"invalid zlib data: "+(u[1]&32?"need":"unexpected")+" dictionary"),(u[1]>>3&4)+2};function StrmOpt$1(u,n){return typeof u=="function"&&(n=u,u={}),this.ondata=n,u}var Inflate$1=function(){function u(n,s){typeof n=="function"&&(s=n,n={}),this.ondata=s;var c=n&&n.dictionary&&n.dictionary.subarray(-32768);this.s={i:0,b:c?c.length:0},this.o=new u8$1(32768),this.p=new u8$1(0),c&&this.o.set(c)}return u.prototype.e=function(n){if(this.ondata||err$1(5),this.d&&err$1(4),!this.p.length)this.p=n;else if(n.length){var s=new u8$1(this.p.length+n.length);s.set(this.p),s.set(n,this.p.length),this.p=s}},u.prototype.c=function(n){this.s.i=+(this.d=n||!1);var s=this.s.b,c=inflt$1(this.p,this.s,this.o);this.ondata(slc$1(c,s,this.s.b),this.d),this.o=slc$1(c,this.s.b-32768),this.s.b=this.o.length,this.p=slc$1(this.p,this.s.p/8|0),this.s.p&=7},u.prototype.push=function(n,s){this.e(n),this.c(s)},u}();function inflateSync$1(u,n){return inflt$1(u,{i:2},n&&n.out,n&&n.dictionary)}function gzipSync$1(u,n){n||(n={});var s=crc$1(),c=u.length;s.p(u);var f=dopt$1(u,n,gzhl$1(n),8),g=f.length;return gzh$1(f,n),wbytes$1(f,g-8,s.d()),wbytes$1(f,g-4,c),f}var Gunzip$1=function(){function u(n,s){this.v=1,this.r=0,Inflate$1.call(this,n,s)}return u.prototype.push=function(n,s){if(Inflate$1.prototype.e.call(this,n),this.r+=n.length,this.v){var c=this.p.subarray(this.v-1),f=c.length>3?gzs$1(c):4;if(f>c.length){if(!s)return}else this.v>1&&this.onmember&&this.onmember(this.r-c.length);this.p=c.subarray(f),this.v=0}Inflate$1.prototype.c.call(this,s),this.s.f&&!this.s.l&&!s&&(this.v=shft$1(this.s.p)+9,this.s={i:0},this.o=new u8$1(0),this.push(new u8$1(0),s))},u}();function gunzipSync$1(u,n){var s=gzs$1(u);return s+8>u.length&&err$1(6,"invalid gzip data"),inflt$1(u.subarray(s,-8),{i:2},n&&n.out||new u8$1(gzl$1(u)),n&&n.dictionary)}var Unzlib$1=function(){function u(n,s){Inflate$1.call(this,n,s),this.v=n&&n.dictionary?2:1}return u.prototype.push=function(n,s){if(Inflate$1.prototype.e.call(this,n),this.v){if(this.p.length<6&&!s)return;this.p=this.p.subarray(zls$1(this.p,this.v-1)),this.v=0}s&&(this.p.length<4&&err$1(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Inflate$1.prototype.c.call(this,s)},u}();function unzlibSync$1(u,n){return inflt$1(u.subarray(zls$1(u,n&&n.dictionary),-4),{i:2},n&&n.out,n&&n.dictionary)}var Decompress$1=function(){function u(n,s){this.o=StrmOpt$1.call(this,n,s)||{},this.G=Gunzip$1,this.I=Inflate$1,this.Z=Unzlib$1}return u.prototype.i=function(){var n=this;this.s.ondata=function(s,c){n.ondata(s,c)}},u.prototype.push=function(n,s){if(this.ondata||err$1(5),this.s)this.s.push(n,s);else{if(this.p&&this.p.length){var c=new u8$1(this.p.length+n.length);c.set(this.p),c.set(n,this.p.length)}else this.p=n;this.p.length>2&&(this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(this.o):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,s),this.p=null)}},u}();function decompressSync$1(u,n){return u[0]==31&&u[1]==139&&u[2]==8?gunzipSync$1(u,n):(u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31?inflateSync$1(u,n):unzlibSync$1(u,n)}var te$1=typeof TextEncoder<"u"&&new TextEncoder,td$1=typeof TextDecoder<"u"&&new TextDecoder,tds$1=0;try{td$1.decode(et$1,{stream:!0}),tds$1=1}catch{}var dutf8$1=function(u){for(var n="",s=0;;){var c=u[s++],f=(c>127)+(c>223)+(c>239);if(s+f>u.length)return{s:n,r:slc$1(u,s-1)};f?f==3?(c=((c&15)<<18|(u[s++]&63)<<12|(u[s++]&63)<<6|u[s++]&63)-65536,n+=String.fromCharCode(55296|c>>10,56320|c&1023)):f&1?n+=String.fromCharCode((c&31)<<6|u[s++]&63):n+=String.fromCharCode((c&15)<<12|(u[s++]&63)<<6|u[s++]&63):n+=String.fromCharCode(c)}};function strToU8$1(u,n){if(n){for(var s=new u8$1(u.length),c=0;c>1)),A=0,v=function(I){g[A++]=I},c=0;cg.length){var y=new u8$1(A+8+(f-c<<1));y.set(g),g=y}var T=u.charCodeAt(c);T<128||n?v(T):T<2048?(v(192|T>>6),v(128|T&63)):T>55295&&T<57344?(T=65536+(T&1047552)|u.charCodeAt(++c)&1023,v(240|T>>18),v(128|T>>12&63),v(128|T>>6&63),v(128|T&63)):(v(224|T>>12),v(128|T>>6&63),v(128|T&63))}return slc$1(g,0,A)}function strFromU8$1(u,n){if(n){for(var s="",c=0;c65558)&&err$1(13);var f=b2$1(u,c+8);if(!f)return{};var g=b4$1(u,c+16),A=g==4294967295||f==65535;if(A){var v=b4$1(u,c-12);A=b4$1(u,v)==101075792,A&&(f=b4$1(u,v+32),g=b4$1(u,v+48))}for(var y=n&&n.filter,T=0;T{const s=(f,g)=>(u.set(g,f),f),c=f=>{if(u.has(f))return u.get(f);const[g,A]=n[f];switch(g){case PRIMITIVE:case VOID:return s(A,f);case ARRAY:{const v=s([],f);for(const y of A)v.push(c(y));return v}case OBJECT:{const v=s({},f);for(const[y,T]of A)v[c(y)]=c(T);return v}case DATE:return s(new Date(A),f);case REGEXP:{const{source:v,flags:y}=A;return s(new RegExp(v,y),f)}case MAP:{const v=s(new Map,f);for(const[y,T]of A)v.set(c(y),c(T));return v}case SET:{const v=s(new Set,f);for(const y of A)v.add(c(y));return v}case ERROR:{const{name:v,message:y}=A;return s(new env$1[v](y),f)}case BIGINT:return s(BigInt(A),f);case"BigInt":return s(Object(BigInt(A)),f)}return s(new env$1[g](A),f)};return c},deserialize$1=u=>deserializer(new Map,u)(0),EMPTY="",{toString}={},{keys}=Object,typeOf=u=>{const n=typeof u;if(n!=="object"||!u)return[PRIMITIVE,n];const s=toString.call(u).slice(8,-1);switch(s){case"Array":return[ARRAY,EMPTY];case"Object":return[OBJECT,EMPTY];case"Date":return[DATE,EMPTY];case"RegExp":return[REGEXP,EMPTY];case"Map":return[MAP,EMPTY];case"Set":return[SET,EMPTY]}return s.includes("Array")?[ARRAY,s]:s.includes("Error")?[ERROR,s]:[OBJECT,s]},shouldSkip=([u,n])=>u===PRIMITIVE&&(n==="function"||n==="symbol"),serializer=(u,n,s,c)=>{const f=(A,v)=>{const y=c.push(A)-1;return s.set(v,y),y},g=A=>{if(s.has(A))return s.get(A);let[v,y]=typeOf(A);switch(v){case PRIMITIVE:{let I=A;switch(y){case"bigint":v=BIGINT,I=A.toString();break;case"function":case"symbol":if(u)throw new TypeError("unable to serialize "+y);I=null;break;case"undefined":return f([VOID],A)}return f([v,I],A)}case ARRAY:{if(y)return f([y,[...A]],A);const I=[],S=f([v,I],A);for(const k of A)I.push(g(k));return S}case OBJECT:{if(y)switch(y){case"BigInt":return f([y,A.toString()],A);case"Boolean":case"Number":case"String":return f([y,A.valueOf()],A)}if(n&&"toJSON"in A)return g(A.toJSON());const I=[],S=f([v,I],A);for(const k of keys(A))(u||!shouldSkip(typeOf(A[k])))&&I.push([g(k),g(A[k])]);return S}case DATE:return f([v,A.toISOString()],A);case REGEXP:{const{source:I,flags:S}=A;return f([v,{source:I,flags:S}],A)}case MAP:{const I=[],S=f([v,I],A);for(const[k,e]of A)(u||!(shouldSkip(typeOf(k))||shouldSkip(typeOf(e))))&&I.push([g(k),g(e)]);return S}case SET:{const I=[],S=f([v,I],A);for(const k of A)(u||!shouldSkip(typeOf(k)))&&I.push(g(k));return S}}const{message:T}=A;return f([v,{name:y,message:T}],A)};return g},serialize=(u,{json:n,lossy:s}={})=>{const c=[];return serializer(!(n||s),!!n,new Map,c)(u),c};var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function getAugmentedNamespace(u){if(u.__esModule)return u;var n=u.default;if(typeof n=="function"){var s=function c(){return this instanceof c?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};s.prototype=n.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(u).forEach(function(c){var f=Object.getOwnPropertyDescriptor(u,c);Object.defineProperty(s,c,f.get?f:{enumerable:!0,get:function(){return u[c]}})}),s}var arrayEqual=function(n,s){var c=n.length;if(n===s)return!0;if(c!==s.length)return!1;for(var f=0;f>1|(i&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,rev[i]=((x&65280)>>8|(x&255)<<8)>>1}var hMap=function(u,n,s){for(var c=u.length,f=0,g=new u16(n);f>y]=T}else for(v=new u16(c),f=0;f>15-u[f]);return v},flt=new u8(288);for(var i=0;i<144;++i)flt[i]=8;for(var i=144;i<256;++i)flt[i]=9;for(var i=256;i<280;++i)flt[i]=7;for(var i=280;i<288;++i)flt[i]=8;var fdt=new u8(32);for(var i=0;i<32;++i)fdt[i]=5;var flm=hMap(flt,9,0),flrm=hMap(flt,9,1),fdm=hMap(fdt,5,0),fdrm=hMap(fdt,5,1),max$4=function(u){for(var n=u[0],s=1;sn&&(n=u[s]);return n},bits=function(u,n,s){var c=n/8|0;return(u[c]|u[c+1]<<8)>>(n&7)&s},bits16=function(u,n){var s=n/8|0;return(u[s]|u[s+1]<<8|u[s+2]<<16)>>(n&7)},shft=function(u){return(u+7)/8|0},slc=function(u,n,s){return(n==null||n<0)&&(n=0),(s==null||s>u.length)&&(s=u.length),new u8(u.subarray(n,s))};browser.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(u,n,s){var c=new Error(n||ec[u]);if(c.code=u,Error.captureStackTrace&&Error.captureStackTrace(c,err),!s)throw c;return c},inflt=function(u,n,s,c){var f=u.length,g=c?c.length:0;if(!f||n.f&&!n.l)return s||new u8(0);var A=!s,v=A||n.i!=2,y=n.i;A&&(s=new u8(f*3));var T=function(Ft){var Mt=s.length;if(Ft>Mt){var Ke=new u8(Math.max(Mt*2,Ft));Ke.set(s),s=Ke}},I=n.f||0,S=n.p||0,k=n.b||0,e=n.l,N=n.d,M=n.m,O=n.n,U=f*8;do{if(!e){I=bits(u,S,1);var B=bits(u,S+1,3);if(S+=3,B)if(B==1)e=flrm,N=fdrm,M=9,O=5;else if(B==2){var q=bits(u,S,31)+257,Y=bits(u,S+10,15)+4,X=q+bits(u,S+5,31)+1;S+=14;for(var Q=new u8(X),m=new u8(19),Z=0;Z>4;if(V<16)Q[Z++]=V;else{var pe=0,Se=0;for(V==16?(Se=3+bits(u,S,3),S+=2,pe=Q[Z-1]):V==17?(Se=3+bits(u,S,7),S+=3):V==18&&(Se=11+bits(u,S,127),S+=7);Se--;)Q[Z++]=pe}}var xe=Q.subarray(0,q),we=Q.subarray(q);M=max$4(xe),O=max$4(we),e=hMap(xe,M,1),N=hMap(we,O,1)}else err(1);else{var V=shft(S)+4,b=u[V-4]|u[V-3]<<8,W=V+b;if(W>f){y&&err(0);break}v&&T(k+b),s.set(u.subarray(V,W),k),n.b=k+=b,n.p=S=W*8,n.f=I;continue}if(S>U){y&&err(0);break}}v&&T(k+131072);for(var Fe=(1<>4;if(S+=pe&15,S>U){y&&err(0);break}if(pe||err(2),nt<256)s[k++]=nt;else if(nt==256){Ze=S,e=null;break}else{var Ue=nt-254;if(nt>264){var Z=nt-257,ye=fleb[Z];Ue=bits(u,S,(1<>4;at||err(3),S+=at&15;var we=fd[ft];if(ft>3){var ye=fdeb[ft];we+=bits16(u,S)&(1<U){y&&err(0);break}v&&T(k+131072);var Tt=k+Ue;if(k>8},wbits16=function(u,n,s){s<<=n&7;var c=n/8|0;u[c]|=s,u[c+1]|=s>>8,u[c+2]|=s>>16},hTree=function(u,n){for(var s=[],c=0;ck&&(k=g[c].s);var e=new u16(k+1),N=ln(s[I-1],e,0);if(N>n){var c=0,M=0,O=N-n,U=1<n)M+=U-(1<>=O;M>0;){var V=g[c].s;e[V]=0&&M;--c){var b=g[c].s;e[b]==n&&(--e[b],++M)}N=n}return{t:new u8(e),l:N}},ln=function(u,n,s){return u.s==-1?Math.max(ln(u.l,n,s+1),ln(u.r,n,s+1)):n[u.s]=s},lc=function(u){for(var n=u.length;n&&!u[--n];);for(var s=new u16(++n),c=0,f=u[0],g=1,A=function(y){s[c++]=y},v=1;v<=n;++v)if(u[v]==f&&v!=n)++g;else{if(!f&&g>2){for(;g>138;g-=138)A(32754);g>2&&(A(g>10?g-11<<5|28690:g-3<<5|12305),g=0)}else if(g>3){for(A(f),--g;g>6;g-=6)A(8304);g>2&&(A(g-3<<5|8208),g=0)}for(;g--;)A(f);g=1,f=u[v]}return{c:s.subarray(0,c),n}},clen=function(u,n){for(var s=0,c=0;c>8,u[f+2]=u[f]^255,u[f+3]=u[f+1]^255;for(var g=0;g4&&!m[clim[ee-1]];--ee);var oe=T+5<<3,fe=clen(f,flt)+clen(g,fdt)+A,me=clen(f,k)+clen(g,M)+A+14+3*ee+clen(Y,m)+2*Y[16]+3*Y[17]+7*Y[18];if(y>=0&&oe<=fe&&oe<=me)return wfblk(n,I,u.subarray(y,y+T));var pe,Se,xe,we;if(wbits(n,I,1+(me15&&(wbits(n,I,nt[X]>>5&127),I+=nt[X]>>12)}}else pe=flm,Se=flt,xe=fdm,we=fdt;for(var X=0;X255){var Ue=ye>>18&31;wbits16(n,I,pe[Ue+257]),I+=Se[Ue+257],Ue>7&&(wbits(n,I,ye>>23&31),I+=fleb[Ue]);var at=ye&31;wbits16(n,I,xe[at]),I+=we[at],at>3&&(wbits16(n,I,ye>>5&8191),I+=fdeb[at])}else wbits16(n,I,pe[ye]),I+=Se[ye]}return wbits16(n,I,pe[256]),I+Se[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et=new u8(0),dflt=function(u,n,s,c,f,g){var A=g.z||u.length,v=new u8(c+A+5*(1+Math.ceil(A/7e3))+f),y=v.subarray(c,v.length-f),T=g.l,I=(g.r||0)&7;if(n){I&&(y[0]=g.r>>3);for(var S=deo[n-1],k=S>>13,e=S&8191,N=(1<7e3||m>24576)&&(pe>423||!T)){I=wblk(u,y,0,b,W,q,X,m,ee,Q-ee,I),m=Y=X=0,ee=Q;for(var Se=0;Se<286;++Se)W[Se]=0;for(var Se=0;Se<30;++Se)q[Se]=0}var xe=2,we=0,Fe=e,De=fe-me&32767;if(pe>2&&oe==V(Q-De))for(var Ze=Math.min(k,pe)-1,nt=Math.min(32767,Q),Ue=Math.min(258,pe);De<=nt&&--Fe&&fe!=me;){if(u[Q+xe]==u[Q+xe-De]){for(var ye=0;yexe){if(xe=ye,we=De,ye>Ze)break;for(var at=Math.min(De,ye-2),ft=0,Se=0;Seft&&(ft=Ot,me=Tt)}}}fe=me,me=M[fe],De+=fe-me&32767}if(we){b[m++]=268435456|revfl[xe]<<18|revfd[we];var Ft=revfl[xe]&31,Mt=revfd[we]&31;X+=fleb[Ft]+fdeb[Mt],++W[257+Ft],++q[Mt],Z=Q+xe,++Y}else b[m++]=u[Q],++W[u[Q]]}}for(Q=Math.max(Q,Z);Q=A&&(y[I/8|0]=T,Ke=A),I=wfblk(y,I+1,u.subarray(Q,Ke))}g.i=A}return slc(v,0,c+shft(I)+f)},crct=function(){for(var u=new Int32Array(256),n=0;n<256;++n){for(var s=n,c=9;--c;)s=(s&1&&-306674912)^s>>>1;u[n]=s}return u}(),crc=function(){var u=-1;return{p:function(n){for(var s=u,c=0;c>>8;u=s},d:function(){return~u}}},adler=function(){var u=1,n=0;return{p:function(s){for(var c=u,f=n,g=s.length|0,A=0;A!=g;){for(var v=Math.min(A+2655,g);A>16),f=(f&65535)+15*(f>>16)}u=c,n=f},d:function(){return u%=65521,n%=65521,(u&255)<<24|(u&65280)<<8|(n&255)<<8|n>>8}}},dopt=function(u,n,s,c,f){if(!f&&(f={l:1},n.dictionary)){var g=n.dictionary.subarray(-32768),A=new u8(g.length+u.length);A.set(g),A.set(u,g.length),u=A,f.w=g.length}return dflt(u,n.level==null?6:n.level,n.mem==null?f.l?Math.ceil(Math.max(8,Math.min(13,Math.log(u.length)))*1.5):20:12+n.mem,s,c,f)},mrg=function(u,n){var s={};for(var c in u)s[c]=u[c];for(var c in n)s[c]=n[c];return s},wcln=function(u,n,s){for(var c=u(),f=u.toString(),g=f.slice(f.indexOf("[")+1,f.lastIndexOf("]")).replace(/\s+/g,"").split(","),A=0;A>>0},b8=function(u,n){return b4(u,n)+b4(u,n+4)*4294967296},wbytes=function(u,n,s){for(;s;++n)u[n]=s,s>>>=8},gzh=function(u,n){var s=n.filename;if(u[0]=31,u[1]=139,u[2]=8,u[8]=n.level<2?4:n.level==9?2:0,u[9]=3,n.mtime!=0&&wbytes(u,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),s){u[3]=8;for(var c=0;c<=s.length;++c)u[c+10]=s.charCodeAt(c)}},gzs=function(u){(u[0]!=31||u[1]!=139||u[2]!=8)&&err(6,"invalid gzip data");var n=u[3],s=10;n&4&&(s+=(u[10]|u[11]<<8)+2);for(var c=(n>>3&1)+(n>>4&1);c>0;c-=!u[s++]);return s+(n&2)},gzl=function(u){var n=u.length;return(u[n-4]|u[n-3]<<8|u[n-2]<<16|u[n-1]<<24)>>>0},gzhl=function(u){return 10+(u.filename?u.filename.length+1:0)},zlh=function(u,n){var s=n.level,c=s==0?0:s<6?1:s==9?3:2;if(u[0]=120,u[1]=c<<6|(n.dictionary&&32),u[1]|=31-(u[0]<<8|u[1])%31,n.dictionary){var f=adler();f.p(n.dictionary),wbytes(u,2,f.d())}},zls=function(u,n){return((u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31)&&err(6,"invalid zlib data"),(u[1]>>5&1)==+!n&&err(6,"invalid zlib data: "+(u[1]&32?"need":"unexpected")+" dictionary"),(u[1]>>3&4)+2};function StrmOpt(u,n){return typeof u=="function"&&(n=u,u={}),this.ondata=n,u}var Deflate=function(){function u(n,s){if(typeof n=="function"&&(s=n,n={}),this.ondata=s,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new u8(98304),this.o.dictionary){var c=this.o.dictionary.subarray(-32768);this.b.set(c,32768-c.length),this.s.i=32768-c.length}}return u.prototype.p=function(n,s){this.ondata(dopt(n,this.o,0,0,this.s),s)},u.prototype.push=function(n,s){this.ondata||err(5),this.s.l&&err(4);var c=n.length+this.s.z;if(c>this.b.length){if(c>2*this.b.length-32768){var f=new u8(c&-32768);f.set(this.b.subarray(0,this.s.z)),this.b=f}var g=this.b.length-this.s.z;this.b.set(n.subarray(0,g),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(g),32768),this.s.z=n.length-g+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=s&1,(this.s.z>this.s.w+8191||s)&&(this.p(this.b,s||!1),this.s.w=this.s.i,this.s.i-=2)},u.prototype.flush=function(){this.ondata||err(5),this.s.l&&err(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},u}();browser.Deflate=Deflate;var AsyncDeflate=function(){function u(n,s){astrmify([bDflt,function(){return[astrm,Deflate]}],this,StrmOpt.call(this,n,s),function(c){var f=new Deflate(c.data);onmessage=astrm(f)},6,1)}return u}();browser.AsyncDeflate=AsyncDeflate;function deflate$2(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bDflt],function(c){return pbf(deflateSync(c.data[0],c.data[1]))},0,s)}browser.deflate=deflate$2;function deflateSync(u,n){return dopt(u,n||{},0,0)}browser.deflateSync=deflateSync;var Inflate=function(){function u(n,s){typeof n=="function"&&(s=n,n={}),this.ondata=s;var c=n&&n.dictionary&&n.dictionary.subarray(-32768);this.s={i:0,b:c?c.length:0},this.o=new u8(32768),this.p=new u8(0),c&&this.o.set(c)}return u.prototype.e=function(n){if(this.ondata||err(5),this.d&&err(4),!this.p.length)this.p=n;else if(n.length){var s=new u8(this.p.length+n.length);s.set(this.p),s.set(n,this.p.length),this.p=s}},u.prototype.c=function(n){this.s.i=+(this.d=n||!1);var s=this.s.b,c=inflt(this.p,this.s,this.o);this.ondata(slc(c,s,this.s.b),this.d),this.o=slc(c,this.s.b-32768),this.s.b=this.o.length,this.p=slc(this.p,this.s.p/8|0),this.s.p&=7},u.prototype.push=function(n,s){this.e(n),this.c(s)},u}();browser.Inflate=Inflate;var AsyncInflate=function(){function u(n,s){astrmify([bInflt,function(){return[astrm,Inflate]}],this,StrmOpt.call(this,n,s),function(c){var f=new Inflate(c.data);onmessage=astrm(f)},7,0)}return u}();browser.AsyncInflate=AsyncInflate;function inflate$2(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bInflt],function(c){return pbf(inflateSync(c.data[0],gopt(c.data[1])))},1,s)}browser.inflate=inflate$2;function inflateSync(u,n){return inflt(u,{i:2},n&&n.out,n&&n.dictionary)}browser.inflateSync=inflateSync;var Gzip=function(){function u(n,s){this.c=crc(),this.l=0,this.v=1,Deflate.call(this,n,s)}return u.prototype.push=function(n,s){this.c.p(n),this.l+=n.length,Deflate.prototype.push.call(this,n,s)},u.prototype.p=function(n,s){var c=dopt(n,this.o,this.v&&gzhl(this.o),s&&8,this.s);this.v&&(gzh(c,this.o),this.v=0),s&&(wbytes(c,c.length-8,this.c.d()),wbytes(c,c.length-4,this.l)),this.ondata(c,s)},u.prototype.flush=function(){Deflate.prototype.flush.call(this)},u}();browser.Gzip=Gzip;browser.Compress=Gzip;var AsyncGzip=function(){function u(n,s){astrmify([bDflt,gze,function(){return[astrm,Deflate,Gzip]}],this,StrmOpt.call(this,n,s),function(c){var f=new Gzip(c.data);onmessage=astrm(f)},8,1)}return u}();browser.AsyncGzip=AsyncGzip;browser.AsyncCompress=AsyncGzip;function gzip(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bDflt,gze,function(){return[gzipSync]}],function(c){return pbf(gzipSync(c.data[0],c.data[1]))},2,s)}browser.gzip=gzip;browser.compress=gzip;function gzipSync(u,n){n||(n={});var s=crc(),c=u.length;s.p(u);var f=dopt(u,n,gzhl(n),8),g=f.length;return gzh(f,n),wbytes(f,g-8,s.d()),wbytes(f,g-4,c),f}browser.gzipSync=gzipSync;browser.compressSync=gzipSync;var Gunzip=function(){function u(n,s){this.v=1,this.r=0,Inflate.call(this,n,s)}return u.prototype.push=function(n,s){if(Inflate.prototype.e.call(this,n),this.r+=n.length,this.v){var c=this.p.subarray(this.v-1),f=c.length>3?gzs(c):4;if(f>c.length){if(!s)return}else this.v>1&&this.onmember&&this.onmember(this.r-c.length);this.p=c.subarray(f),this.v=0}Inflate.prototype.c.call(this,s),this.s.f&&!this.s.l&&!s&&(this.v=shft(this.s.p)+9,this.s={i:0},this.o=new u8(0),this.push(new u8(0),s))},u}();browser.Gunzip=Gunzip;var AsyncGunzip=function(){function u(n,s){var c=this;astrmify([bInflt,guze,function(){return[astrm,Inflate,Gunzip]}],this,StrmOpt.call(this,n,s),function(f){var g=new Gunzip(f.data);g.onmember=function(A){return postMessage(A)},onmessage=astrm(g)},9,0,function(f){return c.onmember&&c.onmember(f)})}return u}();browser.AsyncGunzip=AsyncGunzip;function gunzip(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bInflt,guze,function(){return[gunzipSync]}],function(c){return pbf(gunzipSync(c.data[0],c.data[1]))},3,s)}browser.gunzip=gunzip;function gunzipSync(u,n){var s=gzs(u);return s+8>u.length&&err(6,"invalid gzip data"),inflt(u.subarray(s,-8),{i:2},n&&n.out||new u8(gzl(u)),n&&n.dictionary)}browser.gunzipSync=gunzipSync;var Zlib=function(){function u(n,s){this.c=adler(),this.v=1,Deflate.call(this,n,s)}return u.prototype.push=function(n,s){this.c.p(n),Deflate.prototype.push.call(this,n,s)},u.prototype.p=function(n,s){var c=dopt(n,this.o,this.v&&(this.o.dictionary?6:2),s&&4,this.s);this.v&&(zlh(c,this.o),this.v=0),s&&wbytes(c,c.length-4,this.c.d()),this.ondata(c,s)},u.prototype.flush=function(){Deflate.prototype.flush.call(this)},u}();browser.Zlib=Zlib;var AsyncZlib=function(){function u(n,s){astrmify([bDflt,zle,function(){return[astrm,Deflate,Zlib]}],this,StrmOpt.call(this,n,s),function(c){var f=new Zlib(c.data);onmessage=astrm(f)},10,1)}return u}();browser.AsyncZlib=AsyncZlib;function zlib(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bDflt,zle,function(){return[zlibSync]}],function(c){return pbf(zlibSync(c.data[0],c.data[1]))},4,s)}browser.zlib=zlib;function zlibSync(u,n){n||(n={});var s=adler();s.p(u);var c=dopt(u,n,n.dictionary?6:2,4);return zlh(c,n),wbytes(c,c.length-4,s.d()),c}browser.zlibSync=zlibSync;var Unzlib=function(){function u(n,s){Inflate.call(this,n,s),this.v=n&&n.dictionary?2:1}return u.prototype.push=function(n,s){if(Inflate.prototype.e.call(this,n),this.v){if(this.p.length<6&&!s)return;this.p=this.p.subarray(zls(this.p,this.v-1)),this.v=0}s&&(this.p.length<4&&err(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Inflate.prototype.c.call(this,s)},u}();browser.Unzlib=Unzlib;var AsyncUnzlib=function(){function u(n,s){astrmify([bInflt,zule,function(){return[astrm,Inflate,Unzlib]}],this,StrmOpt.call(this,n,s),function(c){var f=new Unzlib(c.data);onmessage=astrm(f)},11,0)}return u}();browser.AsyncUnzlib=AsyncUnzlib;function unzlib(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),cbify(u,n,[bInflt,zule,function(){return[unzlibSync]}],function(c){return pbf(unzlibSync(c.data[0],gopt(c.data[1])))},5,s)}browser.unzlib=unzlib;function unzlibSync(u,n){return inflt(u.subarray(zls(u,n&&n.dictionary),-4),{i:2},n&&n.out,n&&n.dictionary)}browser.unzlibSync=unzlibSync;var Decompress=function(){function u(n,s){this.o=StrmOpt.call(this,n,s)||{},this.G=Gunzip,this.I=Inflate,this.Z=Unzlib}return u.prototype.i=function(){var n=this;this.s.ondata=function(s,c){n.ondata(s,c)}},u.prototype.push=function(n,s){if(this.ondata||err(5),this.s)this.s.push(n,s);else{if(this.p&&this.p.length){var c=new u8(this.p.length+n.length);c.set(this.p),c.set(n,this.p.length)}else this.p=n;this.p.length>2&&(this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(this.o):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,s),this.p=null)}},u}();browser.Decompress=Decompress;var AsyncDecompress=function(){function u(n,s){Decompress.call(this,n,s),this.queuedSize=0,this.G=AsyncGunzip,this.I=AsyncInflate,this.Z=AsyncUnzlib}return u.prototype.i=function(){var n=this;this.s.ondata=function(s,c,f){n.ondata(s,c,f)},this.s.ondrain=function(s){n.queuedSize-=s,n.ondrain&&n.ondrain(s)}},u.prototype.push=function(n,s){this.queuedSize+=n.length,Decompress.prototype.push.call(this,n,s)},u}();browser.AsyncDecompress=AsyncDecompress;function decompress(u,n,s){return s||(s=n,n={}),typeof s!="function"&&err(7),u[0]==31&&u[1]==139&&u[2]==8?gunzip(u,n,s):(u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31?inflate$2(u,n,s):unzlib(u,n,s)}browser.decompress=decompress;function decompressSync(u,n){return u[0]==31&&u[1]==139&&u[2]==8?gunzipSync(u,n):(u[0]&15)!=8||u[0]>>4>7||(u[0]<<8|u[1])%31?inflateSync(u,n):unzlibSync(u,n)}browser.decompressSync=decompressSync;var fltn=function(u,n,s,c){for(var f in u){var g=u[f],A=n+f,v=c;Array.isArray(g)&&(v=mrg(c,g[1]),g=g[0]),g instanceof u8?s[A]=[g,v]:(s[A+="/"]=[new u8(0),v],fltn(g,A,s,c))}},te=typeof TextEncoder<"u"&&new TextEncoder,td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0}),tds=1}catch{}var dutf8=function(u){for(var n="",s=0;;){var c=u[s++],f=(c>127)+(c>223)+(c>239);if(s+f>u.length)return{s:n,r:slc(u,s-1)};f?f==3?(c=((c&15)<<18|(u[s++]&63)<<12|(u[s++]&63)<<6|u[s++]&63)-65536,n+=String.fromCharCode(55296|c>>10,56320|c&1023)):f&1?n+=String.fromCharCode((c&31)<<6|u[s++]&63):n+=String.fromCharCode((c&15)<<12|(u[s++]&63)<<6|u[s++]&63):n+=String.fromCharCode(c)}},DecodeUTF8=function(){function u(n){this.ondata=n,tds?this.t=new TextDecoder:this.p=et}return u.prototype.push=function(n,s){if(this.ondata||err(5),s=!!s,this.t){this.ondata(this.t.decode(n,{stream:!0}),s),s&&(this.t.decode().length&&err(8),this.t=null);return}this.p||err(4);var c=new u8(this.p.length+n.length);c.set(this.p),c.set(n,this.p.length);var f=dutf8(c),g=f.s,A=f.r;s?(A.length&&err(8),this.p=null):this.p=A,this.ondata(g,s)},u}();browser.DecodeUTF8=DecodeUTF8;var EncodeUTF8=function(){function u(n){this.ondata=n}return u.prototype.push=function(n,s){this.ondata||err(5),this.d&&err(4),this.ondata(strToU8(n),this.d=s||!1)},u}();browser.EncodeUTF8=EncodeUTF8;function strToU8(u,n){if(n){for(var s=new u8(u.length),c=0;c>1)),A=0,v=function(I){g[A++]=I},c=0;cg.length){var y=new u8(A+8+(f-c<<1));y.set(g),g=y}var T=u.charCodeAt(c);T<128||n?v(T):T<2048?(v(192|T>>6),v(128|T&63)):T>55295&&T<57344?(T=65536+(T&1047552)|u.charCodeAt(++c)&1023,v(240|T>>18),v(128|T>>12&63),v(128|T>>6&63),v(128|T&63)):(v(224|T>>12),v(128|T>>6&63),v(128|T&63))}return slc(g,0,A)}browser.strToU8=strToU8;function strFromU8(u,n){if(n){for(var s="",c=0;c65535&&err(9),n+=c+4}return n},wzh=function(u,n,s,c,f,g,A,v){var y=c.length,T=s.extra,I=v&&v.length,S=exfl(T);wbytes(u,n,A!=null?33639248:67324752),n+=4,A!=null&&(u[n++]=20,u[n++]=s.os),u[n]=20,n+=2,u[n++]=s.flag<<1|(g<0&&8),u[n++]=f&&8,u[n++]=s.compression&255,u[n++]=s.compression>>8;var k=new Date(s.mtime==null?Date.now():s.mtime),e=k.getFullYear()-1980;if((e<0||e>119)&&err(10),wbytes(u,n,e<<25|k.getMonth()+1<<21|k.getDate()<<16|k.getHours()<<11|k.getMinutes()<<5|k.getSeconds()>>1),n+=4,g!=-1&&(wbytes(u,n,s.crc),wbytes(u,n+4,g<0?-g-2:g),wbytes(u,n+8,s.size)),wbytes(u,n+12,y),wbytes(u,n+14,S),n+=16,A!=null&&(wbytes(u,n,I),wbytes(u,n+6,s.attrs),wbytes(u,n+10,A),n+=14),u.set(c,n),n+=y,S)for(var N in T){var M=T[N],O=M.length;wbytes(u,n,+N),wbytes(u,n+2,O),u.set(M,n+4),n+=4+O}return I&&(u.set(v,n),n+=I),n},wzf=function(u,n,s,c,f){wbytes(u,n,101010256),wbytes(u,n+8,s),wbytes(u,n+10,s),wbytes(u,n+12,c),wbytes(u,n+16,f)},ZipPassThrough=function(){function u(n){this.filename=n,this.c=crc(),this.size=0,this.compression=0}return u.prototype.process=function(n,s){this.ondata(null,n,s)},u.prototype.push=function(n,s){this.ondata||err(5),this.c.p(n),this.size+=n.length,s&&(this.crc=this.c.d()),this.process(n,s||!1)},u}();browser.ZipPassThrough=ZipPassThrough;var ZipDeflate=function(){function u(n,s){var c=this;s||(s={}),ZipPassThrough.call(this,n),this.d=new Deflate(s,function(f,g){c.ondata(null,f,g)}),this.compression=8,this.flag=dbf(s.level)}return u.prototype.process=function(n,s){try{this.d.push(n,s)}catch(c){this.ondata(c,null,s)}},u.prototype.push=function(n,s){ZipPassThrough.prototype.push.call(this,n,s)},u}();browser.ZipDeflate=ZipDeflate;var AsyncZipDeflate=function(){function u(n,s){var c=this;s||(s={}),ZipPassThrough.call(this,n),this.d=new AsyncDeflate(s,function(f,g,A){c.ondata(f,g,A)}),this.compression=8,this.flag=dbf(s.level),this.terminate=this.d.terminate}return u.prototype.process=function(n,s){this.d.push(n,s)},u.prototype.push=function(n,s){ZipPassThrough.prototype.push.call(this,n,s)},u}();browser.AsyncZipDeflate=AsyncZipDeflate;var Zip=function(){function u(n){this.ondata=n,this.u=[],this.d=1}return u.prototype.add=function(n){var s=this;if(this.ondata||err(5),this.d&2)this.ondata(err(4+(this.d&1)*8,0,1),null,!1);else{var c=strToU8(n.filename),f=c.length,g=n.comment,A=g&&strToU8(g),v=f!=n.filename.length||A&&g.length!=A.length,y=f+exfl(n.extra)+30;f>65535&&this.ondata(err(11,0,1),null,!1);var T=new u8(y);wzh(T,0,n,c,v,-1);var I=[T],S=function(){for(var O=0,U=I;O65535&&fe(err(11,0,1),null),!oe)fe(null,V);else if(q<16e4)try{fe(null,deflateSync(V,b))}catch(me){fe(me,null)}else I.push(deflate$2(V,b,fe))},M=0;M65535&&err(11);var U=I?deflateSync(y,T):y,B=U.length,V=crc();V.p(y),c.push(mrg(T,{size:y.length,crc:V.d(),c:U,f:S,m:N,u:k!=A.length||N&&e.length!=M,o:f,compression:I})),f+=30+k+O+B,g+=76+2*(k+O)+(M||0)+B}for(var b=new u8(g+22),W=f,q=g-f,Y=0;Y0){var f=Math.min(this.c,n.length),g=n.subarray(0,f);if(this.c-=f,this.d?this.d.push(g,!this.c):this.k[0].push(g),n=n.subarray(f),n.length)return this.push(n,s)}else{var A=0,v=0,y=void 0,T=void 0;this.p.length?n.length?(T=new u8(this.p.length+n.length),T.set(this.p),T.set(n,this.p.length)):T=this.p:T=n;for(var I=T.length,S=this.c,k=S&&this.d,e=function(){var U,B=b4(T,v);if(B==67324752){A=1,y=v,N.d=null,N.c=0;var V=b2(T,v+6),b=b2(T,v+8),W=V&2048,q=V&8,Y=b2(T,v+26),X=b2(T,v+28);if(I>v+30+Y+X){var Q=[];N.k.unshift(Q),A=2;var m=b4(T,v+18),Z=b4(T,v+22),ee=strFromU8(T.subarray(v+30,v+=30+Y),!W);m==4294967295?(U=q?[-2]:z64e(T,v),m=U[0],Z=U[1]):q&&(m=-1),v+=X,N.c=m;var oe,fe={name:ee,compression:b,start:function(){if(fe.ondata||err(5),!m)fe.ondata(null,et,!0);else{var me=c.o[b];me||fe.ondata(err(14,"unknown compression type "+b,1),null,!1),oe=m<0?new me(ee):new me(ee,m,Z),oe.ondata=function(we,Fe,De){fe.ondata(we,Fe,De)};for(var pe=0,Se=Q;pe=0&&(fe.size=m,fe.originalSize=Z),N.onfile(fe)}return"break"}else if(S){if(B==134695760)return y=v+=12+(S==-2&&8),A=3,N.c=0,"break";if(B==33639248)return y=v-=4,A=3,N.c=0,"break"}},N=this;v65558)return A(err(13,0,1),null),f;var y=b2(u,v+8);if(y){var T=y,I=b4(u,v+16),S=I==4294967295||T==65535;if(S){var k=b4(u,v-12);S=b4(u,k)==101075792,S&&(T=y=b4(u,k+32),I=b4(u,k+48))}for(var e=n&&n.filter,N=function(O){var U=zh(u,I,S),B=U[0],V=U[1],b=U[2],W=U[3],q=U[4],Y=U[5],X=slzh(u,Y);I=q;var Q=function(Z,ee){Z?(f(),A(Z,null)):(ee&&(g[W]=ee),--y||A(null,g))};if(!e||e({name:W,size:V,originalSize:b,compression:B}))if(!B)Q(null,slc(u,X,X+V));else if(B==8){var m=u.subarray(X,X+V);if(b<524288||V>.8*b)try{Q(null,inflateSync(m,{out:new u8(b)}))}catch(Z){Q(Z,null)}else c.push(inflate$2(m,{size:b},Q))}else Q(err(14,"unknown compression type "+B,1),null);else Q(null,null)},M=0;M65558)&&err(13);var f=b2(u,c+8);if(!f)return{};var g=b4(u,c+16),A=g==4294967295||f==65535;if(A){var v=b4(u,c-12);A=b4(u,v)==101075792,A&&(f=b4(u,v+32),g=b4(u,v+48))}for(var y=n&&n.filter,T=0;T=0;f--)A=A*256+g[f];return A}static getExtensionsAt(n,s,c,f){let g=[],A=s;for(;Af&&(v=!v,y=J0.getIntAt(n,A,v),y+A>f))throw new Error("This does not appear to be a valid NIFTI extension");if(y%16!=0)throw new Error("This does not appear to be a NIFTI extension");let T=J0.getIntAt(n,A+4,v),I=n.buffer.slice(A+8,A+y);console.log("extensionByteIndex: "+(A+8)+" esize: "+y),console.log(I);let S=new nifti_extension_1.NIFTIEXTENSION(y,T,I,v);g.push(S),A+=y}return g}static toArrayBuffer(n){var s,c,f;for(s=new ArrayBuffer(n.length),c=new Uint8Array(s),f=0;f>>1:n>>>1;s[c]=n}return s}static crc32(n){J0.crcTable||(J0.crcTable=J0.makeCRCTable());const s=J0.crcTable;let c=-1;for(var f=0;f>>8^s[(c^n.getUint8(f))&255];return(c^-1)>>>0}};ct(J0,"crcTable",null),ct(J0,"GUNZIP_MAGIC_COOKIE1",31),ct(J0,"GUNZIP_MAGIC_COOKIE2",139),ct(J0,"getByteAt",function(n,s){return n.getInt8(s)}),ct(J0,"getShortAt",function(n,s,c){return n.getInt16(s,c)});let Utils=J0;utilities$1.Utils=Utils;Object.defineProperty(nifti1,"__esModule",{value:!0});nifti1.NIFTI1=void 0;const utilities_1$1=utilities$1,Ht=class Ht{constructor(){ct(this,"littleEndian",!1);ct(this,"dim_info",0);ct(this,"dims",[]);ct(this,"intent_p1",0);ct(this,"intent_p2",0);ct(this,"intent_p3",0);ct(this,"intent_code",0);ct(this,"datatypeCode",0);ct(this,"numBitsPerVoxel",0);ct(this,"slice_start",0);ct(this,"slice_end",0);ct(this,"slice_code",0);ct(this,"pixDims",[]);ct(this,"vox_offset",0);ct(this,"scl_slope",1);ct(this,"scl_inter",0);ct(this,"xyzt_units",0);ct(this,"cal_max",0);ct(this,"cal_min",0);ct(this,"slice_duration",0);ct(this,"toffset",0);ct(this,"description","");ct(this,"aux_file","");ct(this,"intent_name","");ct(this,"qform_code",0);ct(this,"sform_code",0);ct(this,"quatern_a",0);ct(this,"quatern_b",0);ct(this,"quatern_c",0);ct(this,"quatern_d",0);ct(this,"qoffset_x",0);ct(this,"qoffset_y",0);ct(this,"qoffset_z",0);ct(this,"affine",[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);ct(this,"qfac",1);ct(this,"quatern_R");ct(this,"magic","0");ct(this,"isHDR",!1);ct(this,"extensionFlag",[0,0,0,0]);ct(this,"extensionSize",0);ct(this,"extensionCode",0);ct(this,"extensions",[]);ct(this,"getDatatypeCodeString",function(n){return n===Ht.TYPE_UINT8?"1-Byte Unsigned Integer":n===Ht.TYPE_INT16?"2-Byte Signed Integer":n===Ht.TYPE_INT32?"4-Byte Signed Integer":n===Ht.TYPE_FLOAT32?"4-Byte Float":n===Ht.TYPE_FLOAT64?"8-Byte Float":n===Ht.TYPE_RGB24?"RGB":n===Ht.TYPE_INT8?"1-Byte Signed Integer":n===Ht.TYPE_UINT16?"2-Byte Unsigned Integer":n===Ht.TYPE_UINT32?"4-Byte Unsigned Integer":n===Ht.TYPE_INT64?"8-Byte Signed Integer":n===Ht.TYPE_UINT64?"8-Byte Unsigned Integer":"Unknown"});ct(this,"getTransformCodeString",function(n){return n===Ht.XFORM_SCANNER_ANAT?"Scanner":n===Ht.XFORM_ALIGNED_ANAT?"Aligned":n===Ht.XFORM_TALAIRACH?"Talairach":n===Ht.XFORM_MNI_152?"MNI":"Unknown"});ct(this,"getUnitsCodeString",function(n){return n===Ht.UNITS_METER?"Meters":n===Ht.UNITS_MM?"Millimeters":n===Ht.UNITS_MICRON?"Microns":n===Ht.UNITS_SEC?"Seconds":n===Ht.UNITS_MSEC?"Milliseconds":n===Ht.UNITS_USEC?"Microseconds":n===Ht.UNITS_HZ?"Hz":n===Ht.UNITS_PPM?"PPM":n===Ht.UNITS_RADS?"Rads":"Unknown"});ct(this,"nifti_mat33_mul",function(n,s){var c=[[0,0,0],[0,0,0],[0,0,0]],f,g;for(f=0;f<3;f+=1)for(g=0;g<3;g+=1)c[f][g]=n[f][0]*s[0][g]+n[f][1]*s[1][g]+n[f][2]*s[2][g];return c});ct(this,"nifti_mat33_determ",function(n){var s,c,f,g,A,v,y,T,I;return s=n[0][0],c=n[0][1],f=n[0][2],g=n[1][0],A=n[1][1],v=n[1][2],y=n[2][0],T=n[2][1],I=n[2][2],s*A*I-s*T*v-g*c*I+g*T*f+y*c*v-y*A*f})}readHeader(n){var s=new DataView(n),c=utilities_1$1.Utils.getIntAt(s,0,this.littleEndian),f,g,A,v;if(c!==Ht.MAGIC_COOKIE&&(this.littleEndian=!0,c=utilities_1$1.Utils.getIntAt(s,0,this.littleEndian)),c!==Ht.MAGIC_COOKIE)throw new Error("This does not appear to be a NIFTI file!");for(this.dim_info=utilities_1$1.Utils.getByteAt(s,39),f=0;f<8;f+=1)v=40+f*2,this.dims[f]=utilities_1$1.Utils.getShortAt(s,v,this.littleEndian);for(this.intent_p1=utilities_1$1.Utils.getFloatAt(s,56,this.littleEndian),this.intent_p2=utilities_1$1.Utils.getFloatAt(s,60,this.littleEndian),this.intent_p3=utilities_1$1.Utils.getFloatAt(s,64,this.littleEndian),this.intent_code=utilities_1$1.Utils.getShortAt(s,68,this.littleEndian),this.datatypeCode=utilities_1$1.Utils.getShortAt(s,70,this.littleEndian),this.numBitsPerVoxel=utilities_1$1.Utils.getShortAt(s,72,this.littleEndian),this.slice_start=utilities_1$1.Utils.getShortAt(s,74,this.littleEndian),f=0;f<8;f+=1)v=76+f*4,this.pixDims[f]=utilities_1$1.Utils.getFloatAt(s,v,this.littleEndian);if(this.vox_offset=utilities_1$1.Utils.getFloatAt(s,108,this.littleEndian),this.scl_slope=utilities_1$1.Utils.getFloatAt(s,112,this.littleEndian),this.scl_inter=utilities_1$1.Utils.getFloatAt(s,116,this.littleEndian),this.slice_end=utilities_1$1.Utils.getShortAt(s,120,this.littleEndian),this.slice_code=utilities_1$1.Utils.getByteAt(s,122),this.xyzt_units=utilities_1$1.Utils.getByteAt(s,123),this.cal_max=utilities_1$1.Utils.getFloatAt(s,124,this.littleEndian),this.cal_min=utilities_1$1.Utils.getFloatAt(s,128,this.littleEndian),this.slice_duration=utilities_1$1.Utils.getFloatAt(s,132,this.littleEndian),this.toffset=utilities_1$1.Utils.getFloatAt(s,136,this.littleEndian),this.description=utilities_1$1.Utils.getStringAt(s,148,228),this.aux_file=utilities_1$1.Utils.getStringAt(s,228,252),this.qform_code=utilities_1$1.Utils.getShortAt(s,252,this.littleEndian),this.sform_code=utilities_1$1.Utils.getShortAt(s,254,this.littleEndian),this.quatern_b=utilities_1$1.Utils.getFloatAt(s,256,this.littleEndian),this.quatern_c=utilities_1$1.Utils.getFloatAt(s,260,this.littleEndian),this.quatern_d=utilities_1$1.Utils.getFloatAt(s,264,this.littleEndian),this.quatern_a=Math.sqrt(1-(Math.pow(this.quatern_b,2)+Math.pow(this.quatern_c,2)+Math.pow(this.quatern_d,2))),this.qoffset_x=utilities_1$1.Utils.getFloatAt(s,268,this.littleEndian),this.qoffset_y=utilities_1$1.Utils.getFloatAt(s,272,this.littleEndian),this.qoffset_z=utilities_1$1.Utils.getFloatAt(s,276,this.littleEndian),this.qform_code<1&&this.sform_code<1&&(this.affine[0][0]=this.pixDims[1],this.affine[1][1]=this.pixDims[2],this.affine[2][2]=this.pixDims[3]),this.qform_code>0&&this.sform_code0)for(g=0;g<3;g+=1)for(A=0;A<4;A+=1)v=280+(g*4+A)*4,this.affine[g][A]=utilities_1$1.Utils.getFloatAt(s,v,this.littleEndian);if(this.affine[3][0]=0,this.affine[3][1]=0,this.affine[3][2]=0,this.affine[3][3]=1,this.intent_name=utilities_1$1.Utils.getStringAt(s,328,344),this.magic=utilities_1$1.Utils.getStringAt(s,344,348),this.isHDR=this.magic===String.fromCharCode.apply(null,Ht.MAGIC_NUMBER2),s.byteLength>Ht.MAGIC_COOKIE){this.extensionFlag[0]=utilities_1$1.Utils.getByteAt(s,348),this.extensionFlag[1]=utilities_1$1.Utils.getByteAt(s,349),this.extensionFlag[2]=utilities_1$1.Utils.getByteAt(s,350),this.extensionFlag[3]=utilities_1$1.Utils.getByteAt(s,351);let y=!0;!this.isHDR&&this.vox_offset<=352&&(y=!1),s.byteLength<=368&&(y=!1),y&&this.extensionFlag[0]&&(this.extensions=utilities_1$1.Utils.getExtensionsAt(s,this.getExtensionLocation(),this.littleEndian,this.vox_offset),this.extensionSize=this.extensions[0].esize,this.extensionCode=this.extensions[0].ecode)}}toFormattedString(){var n=utilities_1$1.Utils.formatNumber,s="";return s+="Dim Info = "+this.dim_info+` `,s+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+this.dims[3]+", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+` `,s+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+` `,s+="Intent Code = "+this.intent_code+` @@ -25,7 +25,7 @@ var tA=Object.defineProperty;var iA=(u,n,s)=>n in u?tA(u,n,{enumerable:!0,config `,s+="S-Form Parameters Z: "+n(this.affine[2][0])+", "+n(this.affine[2][1])+", "+n(this.affine[2][2])+", "+n(this.affine[2][3])+` `,s+='Intent Name: "'+this.intent_name+`" `,this.extensionFlag[0]&&(s+="Extension: Size = "+this.extensionSize+" Code = "+this.extensionCode+` -`),s}getQformMat(){return this.convertNiftiQFormToNiftiSForm(this.quatern_b,this.quatern_c,this.quatern_d,this.qoffset_x,this.qoffset_y,this.qoffset_z,this.pixDims[1],this.pixDims[2],this.pixDims[3],this.pixDims[0])}convertNiftiQFormToNiftiSForm(n,s,c,f,g,A,v,y,T,I){var S=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],k,e=n,N=s,M=c,O,z,B;return S[3][0]=S[3][1]=S[3][2]=0,S[3][3]=1,k=1-(e*e+N*N+M*M),k<1e-7?(k=1/Math.sqrt(e*e+N*N+M*M),e*=k,N*=k,M*=k,k=0):k=Math.sqrt(k),O=v>0?v:1,z=y>0?y:1,B=T>0?T:1,I<0&&(B=-B),S[0][0]=(k*k+e*e-N*N-M*M)*O,S[0][1]=2*(e*N-k*M)*z,S[0][2]=2*(e*M+k*N)*B,S[1][0]=2*(e*N+k*M)*O,S[1][1]=(k*k+N*N-e*e-M*M)*z,S[1][2]=2*(N*M-k*e)*B,S[2][0]=2*(e*M-k*N)*O,S[2][1]=2*(N*M+k*e)*z,S[2][2]=(k*k+M*M-N*N-e*e)*B,S[0][3]=f,S[1][3]=g,S[2][3]=A,S}convertNiftiSFormToNEMA(n){var s,c,f,g,A,v,y,T,I,S,k,e,N,M,O,z,B,V,b,W,q,Y,X,Q,m,Z,ee,oe,fe,me,pe,Se,xe,we;if(O=0,ee=[[0,0,0],[0,0,0],[0,0,0]],oe=[[0,0,0],[0,0,0],[0,0,0]],s=n[0][0],c=n[0][1],f=n[0][2],g=n[1][0],A=n[1][1],v=n[1][2],y=n[2][0],T=n[2][1],I=n[2][2],S=Math.sqrt(s*s+g*g+y*y),S===0||(s/=S,g/=S,y/=S,S=Math.sqrt(c*c+A*A+T*T),S===0))return null;if(c/=S,A/=S,T/=S,S=s*c+g*A+y*T,Math.abs(S)>1e-4){if(c-=S*s,A-=S*g,T-=S*y,S=Math.sqrt(c*c+A*A+T*T),S===0)return null;c/=S,A/=S,T/=S}if(S=Math.sqrt(f*f+v*v+I*I),S===0?(f=g*T-y*A,v=y*c-T*s,I=s*A-g*c):(f/=S,v/=S,I/=S),S=s*f+g*v+y*I,Math.abs(S)>1e-4){if(f-=S*s,v-=S*g,I-=S*y,S=Math.sqrt(f*f+v*v+I*I),S===0)return null;f/=S,v/=S,I/=S}if(S=c*f+A*v+T*I,Math.abs(S)>1e-4){if(f-=S*c,v-=S*A,I-=S*T,S=Math.sqrt(f*f+v*v+I*I),S===0)return null;f/=S,v/=S,I/=S}if(ee[0][0]=s,ee[0][1]=c,ee[0][2]=f,ee[1][0]=g,ee[1][1]=A,ee[1][2]=v,ee[2][0]=y,ee[2][1]=T,ee[2][2]=I,k=this.nifti_mat33_determ(ee),k===0)return null;for(Z=-666,b=Y=X=Q=1,W=2,q=3,N=1;N<=3;N+=1)for(M=1;M<=3;M+=1)if(N!==M){for(O=1;O<=3;O+=1)if(!(N===O||M===O))for(oe[0][0]=oe[0][1]=oe[0][2]=oe[1][0]=oe[1][1]=oe[1][2]=oe[2][0]=oe[2][1]=oe[2][2]=0,z=-1;z<=1;z+=2)for(B=-1;B<=1;B+=2)for(V=-1;V<=1;V+=2)oe[0][N-1]=z,oe[1][M-1]=B,oe[2][O-1]=V,e=this.nifti_mat33_determ(oe),e*k>0&&(m=this.nifti_mat33_mul(oe,ee),S=m[0][0]+m[1][1]+m[2][2],S>Z&&(Z=S,b=N,W=M,q=O,Y=z,X=B,Q=V))}switch(fe=me=pe=Se=xe=we="",b*Y){case 1:fe="X",Se="+";break;case-1:fe="X",Se="-";break;case 2:fe="Y",Se="+";break;case-2:fe="Y",Se="-";break;case 3:fe="Z",Se="+";break;case-3:fe="Z",Se="-";break}switch(W*X){case 1:me="X",xe="+";break;case-1:me="X",xe="-";break;case 2:me="Y",xe="+";break;case-2:me="Y",xe="-";break;case 3:me="Z",xe="+";break;case-3:me="Z",xe="-";break}switch(q*Q){case 1:pe="X",we="+";break;case-1:pe="X",we="-";break;case 2:pe="Y",we="+";break;case-2:pe="Y",we="-";break;case 3:pe="Z",we="+";break;case-3:pe="Z",we="-";break}return fe+me+pe+Se+xe+we}getExtensionLocation(){return Ht.MAGIC_COOKIE+4}getExtensionSize(n){return utilities_1$1.Utils.getIntAt(n,this.getExtensionLocation(),this.littleEndian)}getExtensionCode(n){return utilities_1$1.Utils.getIntAt(n,this.getExtensionLocation()+4,this.littleEndian)}addExtension(n,s=-1){s==-1?this.extensions.push(n):this.extensions.splice(s,0,n),this.vox_offset+=n.esize}removeExtension(n){let s=this.extensions[n];s&&(this.vox_offset-=s.esize),this.extensions.splice(n,1)}toArrayBuffer(n=!1){let f=352;if(n)for(let y of this.extensions)f+=y.esize;let g=new Uint8Array(f),A=new DataView(g.buffer);A.setInt32(0,348,this.littleEndian),A.setUint8(39,this.dim_info);for(let y=0;y<8;y++)A.setUint16(40+2*y,this.dims[y],this.littleEndian);A.setFloat32(56,this.intent_p1,this.littleEndian),A.setFloat32(60,this.intent_p2,this.littleEndian),A.setFloat32(64,this.intent_p3,this.littleEndian),A.setInt16(68,this.intent_code,this.littleEndian),A.setInt16(70,this.datatypeCode,this.littleEndian),A.setInt16(72,this.numBitsPerVoxel,this.littleEndian),A.setInt16(74,this.slice_start,this.littleEndian);for(let y=0;y<8;y++)A.setFloat32(76+4*y,this.pixDims[y],this.littleEndian);A.setFloat32(108,this.vox_offset,this.littleEndian),A.setFloat32(112,this.scl_slope,this.littleEndian),A.setFloat32(116,this.scl_inter,this.littleEndian),A.setInt16(120,this.slice_end,this.littleEndian),A.setUint8(122,this.slice_code),A.setUint8(123,this.xyzt_units),A.setFloat32(124,this.cal_max,this.littleEndian),A.setFloat32(128,this.cal_min,this.littleEndian),A.setFloat32(132,this.slice_duration,this.littleEndian),A.setFloat32(136,this.toffset,this.littleEndian),g.set(Buffer.from(this.description),148),g.set(Buffer.from(this.aux_file),228),A.setInt16(252,this.qform_code,this.littleEndian),A.setInt16(254,this.sform_code,this.littleEndian),A.setFloat32(256,this.quatern_b,this.littleEndian),A.setFloat32(260,this.quatern_c,this.littleEndian),A.setFloat32(264,this.quatern_d,this.littleEndian),A.setFloat32(268,this.qoffset_x,this.littleEndian),A.setFloat32(272,this.qoffset_y,this.littleEndian),A.setFloat32(276,this.qoffset_z,this.littleEndian);const v=this.affine.flat();for(let y=0;y<12;y++)A.setFloat32(280+4*y,v[y],this.littleEndian);if(g.set(Buffer.from(this.intent_name),328),g.set(Buffer.from(this.magic),344),n){g.set(Uint8Array.from([1,0,0,0]),348);let y=this.getExtensionLocation();for(const T of this.extensions)A.setInt32(y,T.esize,T.littleEndian),A.setInt32(y+4,T.ecode,T.littleEndian),g.set(new Uint8Array(T.edata),y+8),y+=T.esize}else g.set(new Uint8Array(4).fill(0),348);return g.buffer}};ct(Ht,"TYPE_NONE",0),ct(Ht,"TYPE_BINARY",1),ct(Ht,"TYPE_UINT8",2),ct(Ht,"TYPE_INT16",4),ct(Ht,"TYPE_INT32",8),ct(Ht,"TYPE_FLOAT32",16),ct(Ht,"TYPE_COMPLEX64",32),ct(Ht,"TYPE_FLOAT64",64),ct(Ht,"TYPE_RGB24",128),ct(Ht,"TYPE_INT8",256),ct(Ht,"TYPE_UINT16",512),ct(Ht,"TYPE_UINT32",768),ct(Ht,"TYPE_INT64",1024),ct(Ht,"TYPE_UINT64",1280),ct(Ht,"TYPE_FLOAT128",1536),ct(Ht,"TYPE_COMPLEX128",1792),ct(Ht,"TYPE_COMPLEX256",2048),ct(Ht,"XFORM_UNKNOWN",0),ct(Ht,"XFORM_SCANNER_ANAT",1),ct(Ht,"XFORM_ALIGNED_ANAT",2),ct(Ht,"XFORM_TALAIRACH",3),ct(Ht,"XFORM_MNI_152",4),ct(Ht,"SPATIAL_UNITS_MASK",7),ct(Ht,"TEMPORAL_UNITS_MASK",56),ct(Ht,"UNITS_UNKNOWN",0),ct(Ht,"UNITS_METER",1),ct(Ht,"UNITS_MM",2),ct(Ht,"UNITS_MICRON",3),ct(Ht,"UNITS_SEC",8),ct(Ht,"UNITS_MSEC",16),ct(Ht,"UNITS_USEC",24),ct(Ht,"UNITS_HZ",32),ct(Ht,"UNITS_PPM",40),ct(Ht,"UNITS_RADS",48),ct(Ht,"MAGIC_COOKIE",348),ct(Ht,"STANDARD_HEADER_SIZE",348),ct(Ht,"MAGIC_NUMBER_LOCATION",344),ct(Ht,"MAGIC_NUMBER",[110,43,49]),ct(Ht,"MAGIC_NUMBER2",[110,105,49]),ct(Ht,"EXTENSION_HEADER_SIZE",8);let NIFTI1=Ht;nifti1.NIFTI1=NIFTI1;var nifti2={};Object.defineProperty(nifti2,"__esModule",{value:!0});nifti2.NIFTI2=void 0;const nifti1_1=nifti1,utilities_1=utilities$1,Ai=class Ai{constructor(){ct(this,"littleEndian",!1);ct(this,"dim_info",0);ct(this,"dims",[]);ct(this,"intent_p1",0);ct(this,"intent_p2",0);ct(this,"intent_p3",0);ct(this,"intent_code",0);ct(this,"datatypeCode",0);ct(this,"numBitsPerVoxel",0);ct(this,"slice_start",0);ct(this,"slice_end",0);ct(this,"slice_code",0);ct(this,"pixDims",[]);ct(this,"vox_offset",0);ct(this,"scl_slope",1);ct(this,"scl_inter",0);ct(this,"xyzt_units",0);ct(this,"cal_max",0);ct(this,"cal_min",0);ct(this,"slice_duration",0);ct(this,"toffset",0);ct(this,"description","");ct(this,"aux_file","");ct(this,"intent_name","");ct(this,"qform_code",0);ct(this,"sform_code",0);ct(this,"quatern_b",0);ct(this,"quatern_c",0);ct(this,"quatern_d",0);ct(this,"qoffset_x",0);ct(this,"qoffset_y",0);ct(this,"qoffset_z",0);ct(this,"affine",[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);ct(this,"magic","0");ct(this,"extensionFlag",[0,0,0,0]);ct(this,"extensions",[]);ct(this,"extensionSize",0);ct(this,"extensionCode",0);ct(this,"getExtensionLocation",function(){return Ai.MAGIC_COOKIE+4});ct(this,"getExtensionSize",nifti1_1.NIFTI1.prototype.getExtensionSize);ct(this,"getExtensionCode",nifti1_1.NIFTI1.prototype.getExtensionCode);ct(this,"addExtension",nifti1_1.NIFTI1.prototype.addExtension);ct(this,"removeExtension",nifti1_1.NIFTI1.prototype.removeExtension);ct(this,"getDatatypeCodeString",nifti1_1.NIFTI1.prototype.getDatatypeCodeString);ct(this,"getTransformCodeString",nifti1_1.NIFTI1.prototype.getTransformCodeString);ct(this,"getUnitsCodeString",nifti1_1.NIFTI1.prototype.getUnitsCodeString);ct(this,"getQformMat",nifti1_1.NIFTI1.prototype.getQformMat);ct(this,"convertNiftiQFormToNiftiSForm",nifti1_1.NIFTI1.prototype.convertNiftiQFormToNiftiSForm);ct(this,"convertNiftiSFormToNEMA",nifti1_1.NIFTI1.prototype.convertNiftiSFormToNEMA);ct(this,"nifti_mat33_mul",nifti1_1.NIFTI1.prototype.nifti_mat33_mul);ct(this,"nifti_mat33_determ",nifti1_1.NIFTI1.prototype.nifti_mat33_determ)}readHeader(n){var s=new DataView(n),c=utilities_1.Utils.getIntAt(s,0,this.littleEndian),f,g,A,v;if(c!==Ai.MAGIC_COOKIE&&(this.littleEndian=!0,c=utilities_1.Utils.getIntAt(s,0,this.littleEndian)),c!==Ai.MAGIC_COOKIE)throw new Error("This does not appear to be a NIFTI file!");for(this.magic=utilities_1.Utils.getStringAt(s,4,12),this.datatypeCode=utilities_1.Utils.getShortAt(s,12,this.littleEndian),this.numBitsPerVoxel=utilities_1.Utils.getShortAt(s,14,this.littleEndian),f=0;f<8;f+=1)v=16+f*8,this.dims[f]=utilities_1.Utils.getLongAt(s,v,this.littleEndian);for(this.intent_p1=utilities_1.Utils.getDoubleAt(s,80,this.littleEndian),this.intent_p2=utilities_1.Utils.getDoubleAt(s,88,this.littleEndian),this.intent_p3=utilities_1.Utils.getDoubleAt(s,96,this.littleEndian),f=0;f<8;f+=1)v=104+f*8,this.pixDims[f]=utilities_1.Utils.getDoubleAt(s,v,this.littleEndian);for(this.vox_offset=utilities_1.Utils.getLongAt(s,168,this.littleEndian),this.scl_slope=utilities_1.Utils.getDoubleAt(s,176,this.littleEndian),this.scl_inter=utilities_1.Utils.getDoubleAt(s,184,this.littleEndian),this.cal_max=utilities_1.Utils.getDoubleAt(s,192,this.littleEndian),this.cal_min=utilities_1.Utils.getDoubleAt(s,200,this.littleEndian),this.slice_duration=utilities_1.Utils.getDoubleAt(s,208,this.littleEndian),this.toffset=utilities_1.Utils.getDoubleAt(s,216,this.littleEndian),this.slice_start=utilities_1.Utils.getLongAt(s,224,this.littleEndian),this.slice_end=utilities_1.Utils.getLongAt(s,232,this.littleEndian),this.description=utilities_1.Utils.getStringAt(s,240,320),this.aux_file=utilities_1.Utils.getStringAt(s,320,344),this.qform_code=utilities_1.Utils.getIntAt(s,344,this.littleEndian),this.sform_code=utilities_1.Utils.getIntAt(s,348,this.littleEndian),this.quatern_b=utilities_1.Utils.getDoubleAt(s,352,this.littleEndian),this.quatern_c=utilities_1.Utils.getDoubleAt(s,360,this.littleEndian),this.quatern_d=utilities_1.Utils.getDoubleAt(s,368,this.littleEndian),this.qoffset_x=utilities_1.Utils.getDoubleAt(s,376,this.littleEndian),this.qoffset_y=utilities_1.Utils.getDoubleAt(s,384,this.littleEndian),this.qoffset_z=utilities_1.Utils.getDoubleAt(s,392,this.littleEndian),g=0;g<3;g+=1)for(A=0;A<4;A+=1)v=400+(g*4+A)*8,this.affine[g][A]=utilities_1.Utils.getDoubleAt(s,v,this.littleEndian);this.affine[3][0]=0,this.affine[3][1]=0,this.affine[3][2]=0,this.affine[3][3]=1,this.slice_code=utilities_1.Utils.getIntAt(s,496,this.littleEndian),this.xyzt_units=utilities_1.Utils.getIntAt(s,500,this.littleEndian),this.intent_code=utilities_1.Utils.getIntAt(s,504,this.littleEndian),this.intent_name=utilities_1.Utils.getStringAt(s,508,524),this.dim_info=utilities_1.Utils.getByteAt(s,524),s.byteLength>Ai.MAGIC_COOKIE&&(this.extensionFlag[0]=utilities_1.Utils.getByteAt(s,540),this.extensionFlag[1]=utilities_1.Utils.getByteAt(s,541),this.extensionFlag[2]=utilities_1.Utils.getByteAt(s,542),this.extensionFlag[3]=utilities_1.Utils.getByteAt(s,543),this.extensionFlag[0]&&(this.extensions=utilities_1.Utils.getExtensionsAt(s,this.getExtensionLocation(),this.littleEndian,this.vox_offset),this.extensionSize=this.extensions[0].esize,this.extensionCode=this.extensions[0].ecode))}toFormattedString(){var n=utilities_1.Utils.formatNumber,s="";return s+="Datatype = "+ +this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+`) +`),s}getQformMat(){return this.convertNiftiQFormToNiftiSForm(this.quatern_b,this.quatern_c,this.quatern_d,this.qoffset_x,this.qoffset_y,this.qoffset_z,this.pixDims[1],this.pixDims[2],this.pixDims[3],this.pixDims[0])}convertNiftiQFormToNiftiSForm(n,s,c,f,g,A,v,y,T,I){var S=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],k,e=n,N=s,M=c,O,U,B;return S[3][0]=S[3][1]=S[3][2]=0,S[3][3]=1,k=1-(e*e+N*N+M*M),k<1e-7?(k=1/Math.sqrt(e*e+N*N+M*M),e*=k,N*=k,M*=k,k=0):k=Math.sqrt(k),O=v>0?v:1,U=y>0?y:1,B=T>0?T:1,I<0&&(B=-B),S[0][0]=(k*k+e*e-N*N-M*M)*O,S[0][1]=2*(e*N-k*M)*U,S[0][2]=2*(e*M+k*N)*B,S[1][0]=2*(e*N+k*M)*O,S[1][1]=(k*k+N*N-e*e-M*M)*U,S[1][2]=2*(N*M-k*e)*B,S[2][0]=2*(e*M-k*N)*O,S[2][1]=2*(N*M+k*e)*U,S[2][2]=(k*k+M*M-N*N-e*e)*B,S[0][3]=f,S[1][3]=g,S[2][3]=A,S}convertNiftiSFormToNEMA(n){var s,c,f,g,A,v,y,T,I,S,k,e,N,M,O,U,B,V,b,W,q,Y,X,Q,m,Z,ee,oe,fe,me,pe,Se,xe,we;if(O=0,ee=[[0,0,0],[0,0,0],[0,0,0]],oe=[[0,0,0],[0,0,0],[0,0,0]],s=n[0][0],c=n[0][1],f=n[0][2],g=n[1][0],A=n[1][1],v=n[1][2],y=n[2][0],T=n[2][1],I=n[2][2],S=Math.sqrt(s*s+g*g+y*y),S===0||(s/=S,g/=S,y/=S,S=Math.sqrt(c*c+A*A+T*T),S===0))return null;if(c/=S,A/=S,T/=S,S=s*c+g*A+y*T,Math.abs(S)>1e-4){if(c-=S*s,A-=S*g,T-=S*y,S=Math.sqrt(c*c+A*A+T*T),S===0)return null;c/=S,A/=S,T/=S}if(S=Math.sqrt(f*f+v*v+I*I),S===0?(f=g*T-y*A,v=y*c-T*s,I=s*A-g*c):(f/=S,v/=S,I/=S),S=s*f+g*v+y*I,Math.abs(S)>1e-4){if(f-=S*s,v-=S*g,I-=S*y,S=Math.sqrt(f*f+v*v+I*I),S===0)return null;f/=S,v/=S,I/=S}if(S=c*f+A*v+T*I,Math.abs(S)>1e-4){if(f-=S*c,v-=S*A,I-=S*T,S=Math.sqrt(f*f+v*v+I*I),S===0)return null;f/=S,v/=S,I/=S}if(ee[0][0]=s,ee[0][1]=c,ee[0][2]=f,ee[1][0]=g,ee[1][1]=A,ee[1][2]=v,ee[2][0]=y,ee[2][1]=T,ee[2][2]=I,k=this.nifti_mat33_determ(ee),k===0)return null;for(Z=-666,b=Y=X=Q=1,W=2,q=3,N=1;N<=3;N+=1)for(M=1;M<=3;M+=1)if(N!==M){for(O=1;O<=3;O+=1)if(!(N===O||M===O))for(oe[0][0]=oe[0][1]=oe[0][2]=oe[1][0]=oe[1][1]=oe[1][2]=oe[2][0]=oe[2][1]=oe[2][2]=0,U=-1;U<=1;U+=2)for(B=-1;B<=1;B+=2)for(V=-1;V<=1;V+=2)oe[0][N-1]=U,oe[1][M-1]=B,oe[2][O-1]=V,e=this.nifti_mat33_determ(oe),e*k>0&&(m=this.nifti_mat33_mul(oe,ee),S=m[0][0]+m[1][1]+m[2][2],S>Z&&(Z=S,b=N,W=M,q=O,Y=U,X=B,Q=V))}switch(fe=me=pe=Se=xe=we="",b*Y){case 1:fe="X",Se="+";break;case-1:fe="X",Se="-";break;case 2:fe="Y",Se="+";break;case-2:fe="Y",Se="-";break;case 3:fe="Z",Se="+";break;case-3:fe="Z",Se="-";break}switch(W*X){case 1:me="X",xe="+";break;case-1:me="X",xe="-";break;case 2:me="Y",xe="+";break;case-2:me="Y",xe="-";break;case 3:me="Z",xe="+";break;case-3:me="Z",xe="-";break}switch(q*Q){case 1:pe="X",we="+";break;case-1:pe="X",we="-";break;case 2:pe="Y",we="+";break;case-2:pe="Y",we="-";break;case 3:pe="Z",we="+";break;case-3:pe="Z",we="-";break}return fe+me+pe+Se+xe+we}getExtensionLocation(){return Ht.MAGIC_COOKIE+4}getExtensionSize(n){return utilities_1$1.Utils.getIntAt(n,this.getExtensionLocation(),this.littleEndian)}getExtensionCode(n){return utilities_1$1.Utils.getIntAt(n,this.getExtensionLocation()+4,this.littleEndian)}addExtension(n,s=-1){s==-1?this.extensions.push(n):this.extensions.splice(s,0,n),this.vox_offset+=n.esize}removeExtension(n){let s=this.extensions[n];s&&(this.vox_offset-=s.esize),this.extensions.splice(n,1)}toArrayBuffer(n=!1){let f=352;if(n)for(let y of this.extensions)f+=y.esize;let g=new Uint8Array(f),A=new DataView(g.buffer);A.setInt32(0,348,this.littleEndian),A.setUint8(39,this.dim_info);for(let y=0;y<8;y++)A.setUint16(40+2*y,this.dims[y],this.littleEndian);A.setFloat32(56,this.intent_p1,this.littleEndian),A.setFloat32(60,this.intent_p2,this.littleEndian),A.setFloat32(64,this.intent_p3,this.littleEndian),A.setInt16(68,this.intent_code,this.littleEndian),A.setInt16(70,this.datatypeCode,this.littleEndian),A.setInt16(72,this.numBitsPerVoxel,this.littleEndian),A.setInt16(74,this.slice_start,this.littleEndian);for(let y=0;y<8;y++)A.setFloat32(76+4*y,this.pixDims[y],this.littleEndian);A.setFloat32(108,this.vox_offset,this.littleEndian),A.setFloat32(112,this.scl_slope,this.littleEndian),A.setFloat32(116,this.scl_inter,this.littleEndian),A.setInt16(120,this.slice_end,this.littleEndian),A.setUint8(122,this.slice_code),A.setUint8(123,this.xyzt_units),A.setFloat32(124,this.cal_max,this.littleEndian),A.setFloat32(128,this.cal_min,this.littleEndian),A.setFloat32(132,this.slice_duration,this.littleEndian),A.setFloat32(136,this.toffset,this.littleEndian),g.set(Buffer.from(this.description),148),g.set(Buffer.from(this.aux_file),228),A.setInt16(252,this.qform_code,this.littleEndian),A.setInt16(254,this.sform_code,this.littleEndian),A.setFloat32(256,this.quatern_b,this.littleEndian),A.setFloat32(260,this.quatern_c,this.littleEndian),A.setFloat32(264,this.quatern_d,this.littleEndian),A.setFloat32(268,this.qoffset_x,this.littleEndian),A.setFloat32(272,this.qoffset_y,this.littleEndian),A.setFloat32(276,this.qoffset_z,this.littleEndian);const v=this.affine.flat();for(let y=0;y<12;y++)A.setFloat32(280+4*y,v[y],this.littleEndian);if(g.set(Buffer.from(this.intent_name),328),g.set(Buffer.from(this.magic),344),n){g.set(Uint8Array.from([1,0,0,0]),348);let y=this.getExtensionLocation();for(const T of this.extensions)A.setInt32(y,T.esize,T.littleEndian),A.setInt32(y+4,T.ecode,T.littleEndian),g.set(new Uint8Array(T.edata),y+8),y+=T.esize}else g.set(new Uint8Array(4).fill(0),348);return g.buffer}};ct(Ht,"TYPE_NONE",0),ct(Ht,"TYPE_BINARY",1),ct(Ht,"TYPE_UINT8",2),ct(Ht,"TYPE_INT16",4),ct(Ht,"TYPE_INT32",8),ct(Ht,"TYPE_FLOAT32",16),ct(Ht,"TYPE_COMPLEX64",32),ct(Ht,"TYPE_FLOAT64",64),ct(Ht,"TYPE_RGB24",128),ct(Ht,"TYPE_INT8",256),ct(Ht,"TYPE_UINT16",512),ct(Ht,"TYPE_UINT32",768),ct(Ht,"TYPE_INT64",1024),ct(Ht,"TYPE_UINT64",1280),ct(Ht,"TYPE_FLOAT128",1536),ct(Ht,"TYPE_COMPLEX128",1792),ct(Ht,"TYPE_COMPLEX256",2048),ct(Ht,"XFORM_UNKNOWN",0),ct(Ht,"XFORM_SCANNER_ANAT",1),ct(Ht,"XFORM_ALIGNED_ANAT",2),ct(Ht,"XFORM_TALAIRACH",3),ct(Ht,"XFORM_MNI_152",4),ct(Ht,"SPATIAL_UNITS_MASK",7),ct(Ht,"TEMPORAL_UNITS_MASK",56),ct(Ht,"UNITS_UNKNOWN",0),ct(Ht,"UNITS_METER",1),ct(Ht,"UNITS_MM",2),ct(Ht,"UNITS_MICRON",3),ct(Ht,"UNITS_SEC",8),ct(Ht,"UNITS_MSEC",16),ct(Ht,"UNITS_USEC",24),ct(Ht,"UNITS_HZ",32),ct(Ht,"UNITS_PPM",40),ct(Ht,"UNITS_RADS",48),ct(Ht,"MAGIC_COOKIE",348),ct(Ht,"STANDARD_HEADER_SIZE",348),ct(Ht,"MAGIC_NUMBER_LOCATION",344),ct(Ht,"MAGIC_NUMBER",[110,43,49]),ct(Ht,"MAGIC_NUMBER2",[110,105,49]),ct(Ht,"EXTENSION_HEADER_SIZE",8);let NIFTI1=Ht;nifti1.NIFTI1=NIFTI1;var nifti2={};Object.defineProperty(nifti2,"__esModule",{value:!0});nifti2.NIFTI2=void 0;const nifti1_1=nifti1,utilities_1=utilities$1,Ai=class Ai{constructor(){ct(this,"littleEndian",!1);ct(this,"dim_info",0);ct(this,"dims",[]);ct(this,"intent_p1",0);ct(this,"intent_p2",0);ct(this,"intent_p3",0);ct(this,"intent_code",0);ct(this,"datatypeCode",0);ct(this,"numBitsPerVoxel",0);ct(this,"slice_start",0);ct(this,"slice_end",0);ct(this,"slice_code",0);ct(this,"pixDims",[]);ct(this,"vox_offset",0);ct(this,"scl_slope",1);ct(this,"scl_inter",0);ct(this,"xyzt_units",0);ct(this,"cal_max",0);ct(this,"cal_min",0);ct(this,"slice_duration",0);ct(this,"toffset",0);ct(this,"description","");ct(this,"aux_file","");ct(this,"intent_name","");ct(this,"qform_code",0);ct(this,"sform_code",0);ct(this,"quatern_b",0);ct(this,"quatern_c",0);ct(this,"quatern_d",0);ct(this,"qoffset_x",0);ct(this,"qoffset_y",0);ct(this,"qoffset_z",0);ct(this,"affine",[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);ct(this,"magic","0");ct(this,"extensionFlag",[0,0,0,0]);ct(this,"extensions",[]);ct(this,"extensionSize",0);ct(this,"extensionCode",0);ct(this,"getExtensionLocation",function(){return Ai.MAGIC_COOKIE+4});ct(this,"getExtensionSize",nifti1_1.NIFTI1.prototype.getExtensionSize);ct(this,"getExtensionCode",nifti1_1.NIFTI1.prototype.getExtensionCode);ct(this,"addExtension",nifti1_1.NIFTI1.prototype.addExtension);ct(this,"removeExtension",nifti1_1.NIFTI1.prototype.removeExtension);ct(this,"getDatatypeCodeString",nifti1_1.NIFTI1.prototype.getDatatypeCodeString);ct(this,"getTransformCodeString",nifti1_1.NIFTI1.prototype.getTransformCodeString);ct(this,"getUnitsCodeString",nifti1_1.NIFTI1.prototype.getUnitsCodeString);ct(this,"getQformMat",nifti1_1.NIFTI1.prototype.getQformMat);ct(this,"convertNiftiQFormToNiftiSForm",nifti1_1.NIFTI1.prototype.convertNiftiQFormToNiftiSForm);ct(this,"convertNiftiSFormToNEMA",nifti1_1.NIFTI1.prototype.convertNiftiSFormToNEMA);ct(this,"nifti_mat33_mul",nifti1_1.NIFTI1.prototype.nifti_mat33_mul);ct(this,"nifti_mat33_determ",nifti1_1.NIFTI1.prototype.nifti_mat33_determ)}readHeader(n){var s=new DataView(n),c=utilities_1.Utils.getIntAt(s,0,this.littleEndian),f,g,A,v;if(c!==Ai.MAGIC_COOKIE&&(this.littleEndian=!0,c=utilities_1.Utils.getIntAt(s,0,this.littleEndian)),c!==Ai.MAGIC_COOKIE)throw new Error("This does not appear to be a NIFTI file!");for(this.magic=utilities_1.Utils.getStringAt(s,4,12),this.datatypeCode=utilities_1.Utils.getShortAt(s,12,this.littleEndian),this.numBitsPerVoxel=utilities_1.Utils.getShortAt(s,14,this.littleEndian),f=0;f<8;f+=1)v=16+f*8,this.dims[f]=utilities_1.Utils.getLongAt(s,v,this.littleEndian);for(this.intent_p1=utilities_1.Utils.getDoubleAt(s,80,this.littleEndian),this.intent_p2=utilities_1.Utils.getDoubleAt(s,88,this.littleEndian),this.intent_p3=utilities_1.Utils.getDoubleAt(s,96,this.littleEndian),f=0;f<8;f+=1)v=104+f*8,this.pixDims[f]=utilities_1.Utils.getDoubleAt(s,v,this.littleEndian);for(this.vox_offset=utilities_1.Utils.getLongAt(s,168,this.littleEndian),this.scl_slope=utilities_1.Utils.getDoubleAt(s,176,this.littleEndian),this.scl_inter=utilities_1.Utils.getDoubleAt(s,184,this.littleEndian),this.cal_max=utilities_1.Utils.getDoubleAt(s,192,this.littleEndian),this.cal_min=utilities_1.Utils.getDoubleAt(s,200,this.littleEndian),this.slice_duration=utilities_1.Utils.getDoubleAt(s,208,this.littleEndian),this.toffset=utilities_1.Utils.getDoubleAt(s,216,this.littleEndian),this.slice_start=utilities_1.Utils.getLongAt(s,224,this.littleEndian),this.slice_end=utilities_1.Utils.getLongAt(s,232,this.littleEndian),this.description=utilities_1.Utils.getStringAt(s,240,320),this.aux_file=utilities_1.Utils.getStringAt(s,320,344),this.qform_code=utilities_1.Utils.getIntAt(s,344,this.littleEndian),this.sform_code=utilities_1.Utils.getIntAt(s,348,this.littleEndian),this.quatern_b=utilities_1.Utils.getDoubleAt(s,352,this.littleEndian),this.quatern_c=utilities_1.Utils.getDoubleAt(s,360,this.littleEndian),this.quatern_d=utilities_1.Utils.getDoubleAt(s,368,this.littleEndian),this.qoffset_x=utilities_1.Utils.getDoubleAt(s,376,this.littleEndian),this.qoffset_y=utilities_1.Utils.getDoubleAt(s,384,this.littleEndian),this.qoffset_z=utilities_1.Utils.getDoubleAt(s,392,this.littleEndian),g=0;g<3;g+=1)for(A=0;A<4;A+=1)v=400+(g*4+A)*8,this.affine[g][A]=utilities_1.Utils.getDoubleAt(s,v,this.littleEndian);this.affine[3][0]=0,this.affine[3][1]=0,this.affine[3][2]=0,this.affine[3][3]=1,this.slice_code=utilities_1.Utils.getIntAt(s,496,this.littleEndian),this.xyzt_units=utilities_1.Utils.getIntAt(s,500,this.littleEndian),this.intent_code=utilities_1.Utils.getIntAt(s,504,this.littleEndian),this.intent_name=utilities_1.Utils.getStringAt(s,508,524),this.dim_info=utilities_1.Utils.getByteAt(s,524),s.byteLength>Ai.MAGIC_COOKIE&&(this.extensionFlag[0]=utilities_1.Utils.getByteAt(s,540),this.extensionFlag[1]=utilities_1.Utils.getByteAt(s,541),this.extensionFlag[2]=utilities_1.Utils.getByteAt(s,542),this.extensionFlag[3]=utilities_1.Utils.getByteAt(s,543),this.extensionFlag[0]&&(this.extensions=utilities_1.Utils.getExtensionsAt(s,this.getExtensionLocation(),this.littleEndian,this.vox_offset),this.extensionSize=this.extensions[0].esize,this.extensionCode=this.extensions[0].ecode))}toFormattedString(){var n=utilities_1.Utils.formatNumber,s="";return s+="Datatype = "+ +this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+`) `,s+="Bits Per Voxel = = "+this.numBitsPerVoxel+` `,s+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+this.dims[3]+", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+` `,s+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+` @@ -51,11 +51,11 @@ var tA=Object.defineProperty;var iA=(u,n,s)=>n in u?tA(u,n,{enumerable:!0,config `,s+="Intent Code = "+this.intent_code+` `,s+='Intent Name: "'+this.intent_name+`" `,s+="Dim Info = "+this.dim_info+` -`,s}toArrayBuffer(n=!1){let f=544;if(n)for(let y of this.extensions)f+=y.esize;let g=new Uint8Array(f),A=new DataView(g.buffer);A.setInt32(0,540,this.littleEndian),g.set(Buffer.from(this.magic),4),A.setInt16(12,this.datatypeCode,this.littleEndian),A.setInt16(14,this.numBitsPerVoxel,this.littleEndian);for(let y=0;y<8;y++)A.setBigInt64(16+8*y,BigInt(this.dims[y]),this.littleEndian);A.setFloat64(80,this.intent_p1,this.littleEndian),A.setFloat64(88,this.intent_p2,this.littleEndian),A.setFloat64(96,this.intent_p3,this.littleEndian);for(let y=0;y<8;y++)A.setFloat64(104+8*y,this.pixDims[y],this.littleEndian);A.setBigInt64(168,BigInt(this.vox_offset),this.littleEndian),A.setFloat64(176,this.scl_slope,this.littleEndian),A.setFloat64(184,this.scl_inter,this.littleEndian),A.setFloat64(192,this.cal_max,this.littleEndian),A.setFloat64(200,this.cal_min,this.littleEndian),A.setFloat64(208,this.slice_duration,this.littleEndian),A.setFloat64(216,this.toffset,this.littleEndian),A.setBigInt64(224,BigInt(this.slice_start),this.littleEndian),A.setBigInt64(232,BigInt(this.slice_end),this.littleEndian),g.set(Buffer.from(this.description),240),g.set(Buffer.from(this.aux_file),320),A.setInt32(344,this.qform_code,this.littleEndian),A.setInt32(348,this.sform_code,this.littleEndian),A.setFloat64(352,this.quatern_b,this.littleEndian),A.setFloat64(360,this.quatern_c,this.littleEndian),A.setFloat64(368,this.quatern_d,this.littleEndian),A.setFloat64(376,this.qoffset_x,this.littleEndian),A.setFloat64(384,this.qoffset_y,this.littleEndian),A.setFloat64(392,this.qoffset_z,this.littleEndian);const v=this.affine.flat();for(let y=0;y<12;y++)A.setFloat64(400+8*y,v[y],this.littleEndian);if(A.setInt32(496,this.slice_code,this.littleEndian),A.setInt32(500,this.xyzt_units,this.littleEndian),A.setInt32(504,this.intent_code,this.littleEndian),g.set(Buffer.from(this.intent_name),508),A.setUint8(524,this.dim_info),n){g.set(Uint8Array.from([1,0,0,0]),540);let y=this.getExtensionLocation();for(const T of this.extensions)A.setInt32(y,T.esize,T.littleEndian),A.setInt32(y+4,T.ecode,T.littleEndian),g.set(new Uint8Array(T.edata),y+8),y+=T.esize}else g.set(new Uint8Array(4).fill(0),540);return g.buffer}};ct(Ai,"MAGIC_COOKIE",540),ct(Ai,"MAGIC_NUMBER_LOCATION",4),ct(Ai,"MAGIC_NUMBER",[110,43,50,0,13,10,26,10]),ct(Ai,"MAGIC_NUMBER2",[110,105,50,0,13,10,26,10]);let NIFTI2=Ai;nifti2.NIFTI2=NIFTI2;(function(u){var n=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(q,Y,X,Q){Q===void 0&&(Q=X);var m=Object.getOwnPropertyDescriptor(Y,X);(!m||("get"in m?!Y.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return Y[X]}}),Object.defineProperty(q,Q,m)}:function(q,Y,X,Q){Q===void 0&&(Q=X),q[Q]=Y[X]}),s=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(q,Y){Object.defineProperty(q,"default",{enumerable:!0,value:Y})}:function(q,Y){q.default=Y}),c=commonjsGlobal&&commonjsGlobal.__importStar||function(q){if(q&&q.__esModule)return q;var Y={};if(q!=null)for(var X in q)X!=="default"&&Object.prototype.hasOwnProperty.call(q,X)&&n(Y,q,X);return s(Y,q),Y};Object.defineProperty(u,"__esModule",{value:!0}),u.readExtensionData=u.readExtension=u.readImage=u.hasExtension=u.readHeader=u.decompress=u.isCompressed=u.isNIFTI=u.isNIFTI2=u.isNIFTI1=u.NIFTIEXTENSION=u.Utils=u.NIFTI2=u.NIFTI1=void 0;const f=c(browser),g=nifti1,A=nifti2,v=utilities$1;var y=nifti1;Object.defineProperty(u,"NIFTI1",{enumerable:!0,get:function(){return y.NIFTI1}});var T=nifti2;Object.defineProperty(u,"NIFTI2",{enumerable:!0,get:function(){return T.NIFTI2}});var I=utilities$1;Object.defineProperty(u,"Utils",{enumerable:!0,get:function(){return I.Utils}});var S=niftiExtension;Object.defineProperty(u,"NIFTIEXTENSION",{enumerable:!0,get:function(){return S.NIFTIEXTENSION}});function k(q,Y=!1){var X,Q,m,Z;return q.byteLength1)for(var g=Array.prototype.slice.call(arguments,1);f--;)c[s-1-f]=n.Utils.createArray.apply(this,g);return c},n.Utils.getStringAt=function(s,c,f,g,A){var v="",y,T;for(y=0;y0?parseInt(s,10):0},n.Utils.convertCamcelCaseToTitleCase=function(s){var c=s.replace(/([A-Z][a-z])/g," $1");return n.Utils.trim(c.charAt(0).toUpperCase()+c.slice(1))},n.Utils.safeParseFloat=function(s){return s=n.Utils.stripLeadingZeros(s),s.length>0?parseFloat(s):0},n.Utils.bytesToDouble=function(s){var c=(s[0]&128)>>7,f=(s[0]&127)<<4|(s[1]&240)>>4;if(f==0)return 0;if(f==2047)return c?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;var g=Math.pow(2,f-1023-52),A=s[7]+s[6]*Math.pow(2,8)+s[5]*Math.pow(2,8*2)+s[4]*Math.pow(2,8*3)+s[3]*Math.pow(2,8*4)+s[2]*Math.pow(2,8*5)+(s[1]&15)*Math.pow(2,8*6)+Math.pow(2,52);return Math.pow(-1,c)*A*g},n.Utils.concatArrayBuffers=function(s,c){var f=new Uint8Array(s.byteLength+c.byteLength);return f.set(new Uint8Array(s),0),f.set(new Uint8Array(c),s.byteLength),f.buffer},n.Utils.concatArrayBuffers2=function(s){var c=0,f=0,g;for(g=0;g>8&65280|s>>24&255},n.Utils.swap16=function(s){return((s&255)<<8|s>>8&255)<<16>>16},n.Utils.makeCRCTable=function(){for(var s,c=[],f=0;f<256;f++){s=f;for(var g=0;g<8;g++)s=s&1?3988292384^s>>>1:s>>>1;c[f]=s}return c},n.Utils.crc32=function(s){for(var c=n.Utils.crcTable||(n.Utils.crcTable=n.Utils.makeCRCTable()),f=-1,g=0;g>>8^c[(f^s.getUint8(g))&255];return(f^-1)>>>0},n.Utils.createBitMask=function(s,c,f){var g=4294967295;return g>>>=(4-s)*8+(s*8-c),f?s==1?g&=255:s==2?g&=65535:s==4?g&=4294967295:s==8&&(g=4294967295):g=4294967295,g},u.exports&&(u.exports=n.Utils)}(utilities)),utilities.exports}var hasRequiredDictionary;function requireDictionary(){return hasRequiredDictionary||(hasRequiredDictionary=1,function(u){var n=n||{};n.Dictionary=n.Dictionary||{},n.Utils=n.Utils||(typeof commonjsRequire<"u"?requireUtilities():null),n.Dictionary.dictPrivate={"0207":{"101F":["FE","ElscintDataScale"]}},n.Dictionary.dict={"0002":{"0001":["OB","FileMetaInformationVersion"],"0002":["UI","MediaStoredSOPClassUID"],"0003":["UI","MediaStoredSOPInstanceUID"],"0010":["UI","TransferSyntaxUID"],"0012":["UI","ImplementationClassUID"],"0013":["SH","ImplementationVersionName"],"0016":["AE","SourceApplicationEntityTitle"],"0100":["UI","PrivateInformationCreatorUID"],"0102":["OB","PrivateInformation"]},"0004":{1130:["CS","FilesetID"],1141:["CS","FilesetDescriptorFileFileID"],1142:["CS","FilesetDescriptorFileFormat"],1200:["UL","RootDirectoryEntitysFirstDirectoryRecordOffset"],1202:["UL","RootDirectoryEntitysLastDirectoryRecordOffset"],1212:["US","File-setConsistenceFlag"],1220:["SQ","DirectoryRecordSequence"],1400:["UL","NextDirectoryRecordOffset"],1410:["US","RecordInuseFlag"],1420:["UL","ReferencedLowerlevelDirectoryEntityOffset"],1430:["CS","DirectoryRecordType"],1432:["UI","PrivateRecordUID"],1500:["CS","ReferencedFileID"],1510:["UI","ReferencedSOPClassUIDInFile"],1511:["UI","ReferencedSOPInstanceUIDInFile"],1600:["UL","NumberOfReferences"]},"0008":{"0001":["UL","LengthToEnd"],"0005":["CS","SpecificCharacterSet"],"0006":["SQ","LanguageCodeSequence"],"0008":["CS","ImageType"],"0010":["SH","RecognitionCode"],"0012":["DA","InstanceCreationDate"],"0013":["TM","InstanceCreationTime"],"0014":["UI","InstanceCreatorUID"],"0016":["UI","SOPClassUID"],"0018":["UI","SOPInstanceUID"],"001A":["UI","RelatedGeneralSOPClassUID"],"001B":["UI","OriginalSpecializedSOPClassUID"],"0020":["DA","StudyDate"],"0021":["DA","SeriesDate"],"0022":["DA","AcquisitionDate"],"0023":["DA","ContentDate"],"0024":["DA","OverlayDate"],"0025":["DA","CurveDate"],"002A":["DT","AcquisitionDateTime"],"0030":["TM","StudyTime"],"0031":["TM","SeriesTime"],"0032":["TM","AcquisitionTime"],"0033":["TM","ContentTime"],"0034":["TM","OverlayTime"],"0035":["TM","CurveTime"],"0040":["US","DataSetType"],"0041":["LO","DataSetSubtype"],"0042":["CS","NuclearMedicineSeriesType"],"0050":["SH","AccessionNumber"],"0051":["SQ","IssuerOfAccessionNumberSequence"],"0052":["CS","QueryRetrieveLevel"],"0054":["AE","RetrieveAETitle"],"0056":["CS","InstanceAvailability"],"0058":["UI","FailedSOPInstanceUIDList"],"0060":["CS","Modality"],"0061":["CS","ModalitiesInStudy"],"0062":["UI","SOPClassesInStudy"],"0064":["CS","ConversionType"],"0068":["CS","PresentationIntentType"],"0070":["LO","Manufacturer"],"0080":["LO","InstitutionName"],"0081":["ST","InstitutionAddress"],"0082":["SQ","InstitutionCodeSequence"],"0090":["PN","ReferringPhysicianName"],"0092":["ST","ReferringPhysicianAddress"],"0094":["SH","ReferringPhysicianTelephoneNumbers"],"0096":["SQ","ReferringPhysicianIdentificationSequence"],"0100":["SH","CodeValue"],"0102":["SH","CodingSchemeDesignator"],"0103":["SH","CodingSchemeVersion"],"0104":["LO","CodeMeaning"],"0105":["CS","MappingResource"],"0106":["DT","ContextGroupVersion"],"0107":["DT","ContextGroupLocalVersion"],"010B":["CS","ContextGroupExtensionFlag"],"010C":["UI","CodingSchemeUID"],"010D":["UI","ContextGroupExtensionCreatorUID"],"010F":["CS","ContextIdentifier"],"0110":["SQ","CodingSchemeIdentificationSequence"],"0112":["LO","CodingSchemeRegistry"],"0114":["ST","CodingSchemeExternalID"],"0115":["ST","CodingSchemeName"],"0116":["ST","CodingSchemeResponsibleOrganization"],"0117":["UI","ContextUID"],"0201":["SH","TimezoneOffsetFromUTC"],1e3:["AE","NetworkID"],1010:["SH","StationName"],1030:["LO","StudyDescription"],1032:["SQ","ProcedureCodeSequence"],"103E":["LO","SeriesDescription"],"103F":["SQ","SeriesDescriptionCodeSequence"],1040:["LO","InstitutionalDepartmentName"],1048:["PN","PhysiciansOfRecord"],1049:["SQ","PhysiciansOfRecordIdentificationSequence"],1050:["PN","PerformingPhysicianName"],1052:["SQ","PerformingPhysicianIdentificationSequence"],1060:["PN","NameOfPhysiciansReadingStudy"],1062:["SQ","PhysiciansReadingStudyIdentificationSequence"],1070:["PN","OperatorsName"],1072:["SQ","OperatorIdentificationSequence"],1080:["LO","AdmittingDiagnosesDescription"],1084:["SQ","AdmittingDiagnosesCodeSequence"],1090:["LO","ManufacturerModelName"],1100:["SQ","ReferencedResultsSequence"],1110:["SQ","ReferencedStudySequence"],1111:["SQ","ReferencedPerformedProcedureStepSequence"],1115:["SQ","ReferencedSeriesSequence"],1120:["SQ","ReferencedPatientSequence"],1125:["SQ","ReferencedVisitSequence"],1130:["SQ","ReferencedOverlaySequence"],1134:["SQ","ReferencedStereometricInstanceSequence"],"113A":["SQ","ReferencedWaveformSequence"],1140:["SQ","ReferencedImageSequence"],1145:["SQ","ReferencedCurveSequence"],"114A":["SQ","ReferencedInstanceSequence"],"114B":["SQ","ReferencedRealWorldValueMappingInstanceSequence"],1150:["UI","ReferencedSOPClassUID"],1155:["UI","ReferencedSOPInstanceUID"],"115A":["UI","SOPClassesSupported"],1160:["IS","ReferencedFrameNumber"],1161:["UL","SimpleFrameList"],1162:["UL","CalculatedFrameList"],1163:["FD","TimeRange"],1164:["SQ","FrameExtractionSequence"],1167:["UI","MultiFrameSourceSOPInstanceUID"],1195:["UI","TransactionUID"],1197:["US","FailureReason"],1198:["SQ","FailedSOPSequence"],1199:["SQ","ReferencedSOPSequence"],1200:["SQ","StudiesContainingOtherReferencedInstancesSequence"],1250:["SQ","RelatedSeriesSequence"],2110:["CS","LossyImageCompressionRetired"],2111:["ST","DerivationDescription"],2112:["SQ","SourceImageSequence"],2120:["SH","StageName"],2122:["IS","StageNumber"],2124:["IS","NumberOfStages"],2127:["SH","ViewName"],2128:["IS","ViewNumber"],2129:["IS","NumberOfEventTimers"],"212A":["IS","NumberOfViewsInStage"],2130:["DS","EventElapsedTimes"],2132:["LO","EventTimerNames"],2133:["SQ","EventTimerSequence"],2134:["FD","EventTimeOffset"],2135:["SQ","EventCodeSequence"],2142:["IS","StartTrim"],2143:["IS","StopTrim"],2144:["IS","RecommendedDisplayFrameRate"],2200:["CS","TransducerPosition"],2204:["CS","TransducerOrientation"],2208:["CS","AnatomicStructure"],2218:["SQ","AnatomicRegionSequence"],2220:["SQ","AnatomicRegionModifierSequence"],2228:["SQ","PrimaryAnatomicStructureSequence"],2229:["SQ","AnatomicStructureSpaceOrRegionSequence"],2230:["SQ","PrimaryAnatomicStructureModifierSequence"],2240:["SQ","TransducerPositionSequence"],2242:["SQ","TransducerPositionModifierSequence"],2244:["SQ","TransducerOrientationSequence"],2246:["SQ","TransducerOrientationModifierSequence"],2251:["SQ","AnatomicStructureSpaceOrRegionCodeSequenceTrial"],2253:["SQ","AnatomicPortalOfEntranceCodeSequenceTrial"],2255:["SQ","AnatomicApproachDirectionCodeSequenceTrial"],2256:["ST","AnatomicPerspectiveDescriptionTrial"],2257:["SQ","AnatomicPerspectiveCodeSequenceTrial"],2258:["ST","AnatomicLocationOfExaminingInstrumentDescriptionTrial"],2259:["SQ","AnatomicLocationOfExaminingInstrumentCodeSequenceTrial"],"225A":["SQ","AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial"],"225C":["SQ","OnAxisBackgroundAnatomicStructureCodeSequenceTrial"],3001:["SQ","AlternateRepresentationSequence"],3010:["UI","IrradiationEventUID"],4e3:["LT","IdentifyingComments"],9007:["CS","FrameType"],9092:["SQ","ReferencedImageEvidenceSequence"],9121:["SQ","ReferencedRawDataSequence"],9123:["UI","CreatorVersionUID"],9124:["SQ","DerivationImageSequence"],9154:["SQ","SourceImageEvidenceSequence"],9205:["CS","PixelPresentation"],9206:["CS","VolumetricProperties"],9207:["CS","VolumeBasedCalculationTechnique"],9208:["CS","ComplexImageComponent"],9209:["CS","AcquisitionContrast"],9215:["SQ","DerivationCodeSequence"],9237:["SQ","ReferencedPresentationStateSequence"],9410:["SQ","ReferencedOtherPlaneSequence"],9458:["SQ","FrameDisplaySequence"],9459:["FL","RecommendedDisplayFrameRateInFloat"],9460:["CS","SkipFrameRangeFlag"]},"0010":{"0010":["PN","PatientName"],"0020":["LO","PatientID"],"0021":["LO","IssuerOfPatientID"],"0022":["CS","TypeOfPatientID"],"0024":["SQ","IssuerOfPatientIDQualifiersSequence"],"0030":["DA","PatientBirthDate"],"0032":["TM","PatientBirthTime"],"0040":["CS","PatientSex"],"0050":["SQ","PatientInsurancePlanCodeSequence"],"0101":["SQ","PatientPrimaryLanguageCodeSequence"],"0102":["SQ","PatientPrimaryLanguageModifierCodeSequence"],1e3:["LO","OtherPatientIDs"],1001:["PN","OtherPatientNames"],1002:["SQ","OtherPatientIDsSequence"],1005:["PN","PatientBirthName"],1010:["AS","PatientAge"],1020:["DS","PatientSize"],1021:["SQ","PatientSizeCodeSequence"],1030:["DS","PatientWeight"],1040:["LO","PatientAddress"],1050:["LO","InsurancePlanIdentification"],1060:["PN","PatientMotherBirthName"],1080:["LO","MilitaryRank"],1081:["LO","BranchOfService"],1090:["LO","MedicalRecordLocator"],2e3:["LO","MedicalAlerts"],2110:["LO","Allergies"],2150:["LO","CountryOfResidence"],2152:["LO","RegionOfResidence"],2154:["SH","PatientTelephoneNumbers"],2160:["SH","EthnicGroup"],2180:["SH","Occupation"],"21A0":["CS","SmokingStatus"],"21B0":["LT","AdditionalPatientHistory"],"21C0":["US","PregnancyStatus"],"21D0":["DA","LastMenstrualDate"],"21F0":["LO","PatientReligiousPreference"],2201:["LO","PatientSpeciesDescription"],2202:["SQ","PatientSpeciesCodeSequence"],2203:["CS","PatientSexNeutered"],2210:["CS","AnatomicalOrientationType"],2292:["LO","PatientBreedDescription"],2293:["SQ","PatientBreedCodeSequence"],2294:["SQ","BreedRegistrationSequence"],2295:["LO","BreedRegistrationNumber"],2296:["SQ","BreedRegistryCodeSequence"],2297:["PN","ResponsiblePerson"],2298:["CS","ResponsiblePersonRole"],2299:["LO","ResponsibleOrganization"],4e3:["LT","PatientComments"],9431:["FL","ExaminedBodyThickness"]},"0012":{"0010":["LO","ClinicalTrialSponsorName"],"0020":["LO","ClinicalTrialProtocolID"],"0021":["LO","ClinicalTrialProtocolName"],"0030":["LO","ClinicalTrialSiteID"],"0031":["LO","ClinicalTrialSiteName"],"0040":["LO","ClinicalTrialSubjectID"],"0042":["LO","ClinicalTrialSubjectReadingID"],"0050":["LO","ClinicalTrialTimePointID"],"0051":["ST","ClinicalTrialTimePointDescription"],"0060":["LO","ClinicalTrialCoordinatingCenterName"],"0062":["CS","PatientIdentityRemoved"],"0063":["LO","DeidentificationMethod"],"0064":["SQ","DeidentificationMethodCodeSequence"],"0071":["LO","ClinicalTrialSeriesID"],"0072":["LO","ClinicalTrialSeriesDescription"],"0081":["LO","ClinicalTrialProtocolEthicsCommitteeName"],"0082":["LO","ClinicalTrialProtocolEthicsCommitteeApprovalNumber"],"0083":["SQ","ConsentForClinicalTrialUseSequence"],"0084":["CS","DistributionType"],"0085":["CS","ConsentForDistributionFlag"]},"0014":{"0023":["ST","CADFileFormat"],"0024":["ST","ComponentReferenceSystem"],"0025":["ST","ComponentManufacturingProcedure"],"0028":["ST","ComponentManufacturer"],"0030":["DS","MaterialThickness"],"0032":["DS","MaterialPipeDiameter"],"0034":["DS","MaterialIsolationDiameter"],"0042":["ST","MaterialGrade"],"0044":["ST","MaterialPropertiesFileID"],"0045":["ST","MaterialPropertiesFileFormat"],"0046":["LT","MaterialNotes"],"0050":["CS","ComponentShape"],"0052":["CS","CurvatureType"],"0054":["DS","OuterDiameter"],"0056":["DS","InnerDiameter"],1010:["ST","ActualEnvironmentalConditions"],1020:["DA","ExpiryDate"],1040:["ST","EnvironmentalConditions"],2002:["SQ","EvaluatorSequence"],2004:["IS","EvaluatorNumber"],2006:["PN","EvaluatorName"],2008:["IS","EvaluationAttempt"],2012:["SQ","IndicationSequence"],2014:["IS","IndicationNumber "],2016:["SH","IndicationLabel"],2018:["ST","IndicationDescription"],"201A":["CS","IndicationType"],"201C":["CS","IndicationDisposition"],"201E":["SQ","IndicationROISequence"],2030:["SQ","IndicationPhysicalPropertySequence"],2032:["SH","PropertyLabel"],2202:["IS","CoordinateSystemNumberOfAxes "],2204:["SQ","CoordinateSystemAxesSequence"],2206:["ST","CoordinateSystemAxisDescription"],2208:["CS","CoordinateSystemDataSetMapping"],"220A":["IS","CoordinateSystemAxisNumber"],"220C":["CS","CoordinateSystemAxisType"],"220E":["CS","CoordinateSystemAxisUnits"],2210:["OB","CoordinateSystemAxisValues"],2220:["SQ","CoordinateSystemTransformSequence"],2222:["ST","TransformDescription"],2224:["IS","TransformNumberOfAxes"],2226:["IS","TransformOrderOfAxes"],2228:["CS","TransformedAxisUnits"],"222A":["DS","CoordinateSystemTransformRotationAndScaleMatrix"],"222C":["DS","CoordinateSystemTransformTranslationMatrix"],3011:["DS","InternalDetectorFrameTime"],3012:["DS","NumberOfFramesIntegrated"],3020:["SQ","DetectorTemperatureSequence"],3022:["DS","SensorName"],3024:["DS","HorizontalOffsetOfSensor"],3026:["DS","VerticalOffsetOfSensor"],3028:["DS","SensorTemperature"],3040:["SQ","DarkCurrentSequence"],3050:["OB","DarkCurrentCounts"],3060:["SQ","GainCorrectionReferenceSequence"],3070:["OB","AirCounts"],3071:["DS","KVUsedInGainCalibration"],3072:["DS","MAUsedInGainCalibration"],3073:["DS","NumberOfFramesUsedForIntegration"],3074:["LO","FilterMaterialUsedInGainCalibration"],3075:["DS","FilterThicknessUsedInGainCalibration"],3076:["DA","DateOfGainCalibration"],3077:["TM","TimeOfGainCalibration"],3080:["OB","BadPixelImage"],3099:["LT","CalibrationNotes"],4002:["SQ","PulserEquipmentSequence"],4004:["CS","PulserType"],4006:["LT","PulserNotes"],4008:["SQ","ReceiverEquipmentSequence"],"400A":["CS","AmplifierType"],"400C":["LT","ReceiverNotes"],"400E":["SQ","PreAmplifierEquipmentSequence"],"400F":["LT","PreAmplifierNotes"],4010:["SQ","TransmitTransducerSequence"],4011:["SQ","ReceiveTransducerSequence"],4012:["US","NumberOfElements"],4013:["CS","ElementShape"],4014:["DS","ElementDimensionA"],4015:["DS","ElementDimensionB"],4016:["DS","ElementPitch"],4017:["DS","MeasuredBeamDimensionA"],4018:["DS","MeasuredBeamDimensionB"],4019:["DS","LocationOfMeasuredBeamDiameter"],"401A":["DS","NominalFrequency"],"401B":["DS","MeasuredCenterFrequency"],"401C":["DS","MeasuredBandwidth"],4020:["SQ","PulserSettingsSequence"],4022:["DS","PulseWidth"],4024:["DS","ExcitationFrequency"],4026:["CS","ModulationType"],4028:["DS","Damping"],4030:["SQ","ReceiverSettingsSequence"],4031:["DS","AcquiredSoundpathLength"],4032:["CS","AcquisitionCompressionType"],4033:["IS","AcquisitionSampleSize"],4034:["DS","RectifierSmoothing"],4035:["SQ","DACSequence"],4036:["CS","DACType"],4038:["DS","DACGainPoints"],"403A":["DS","DACTimePoints"],"403C":["DS","DACAmplitude"],4040:["SQ","PreAmplifierSettingsSequence"],4050:["SQ","TransmitTransducerSettingsSequence"],4051:["SQ","ReceiveTransducerSettingsSequence"],4052:["DS","IncidentAngle"],4054:["ST","CouplingTechnique"],4056:["ST","CouplingMedium"],4057:["DS","CouplingVelocity"],4058:["DS","CrystalCenterLocationX"],4059:["DS","CrystalCenterLocationZ"],"405A":["DS","SoundPathLength"],"405C":["ST","DelayLawIdentifier"],4060:["SQ","GateSettingsSequence"],4062:["DS","GateThreshold"],4064:["DS","VelocityOfSound"],4070:["SQ","CalibrationSettingsSequence"],4072:["ST","CalibrationProcedure"],4074:["SH","ProcedureVersion"],4076:["DA","ProcedureCreationDate"],4078:["DA","ProcedureExpirationDate"],"407A":["DA","ProcedureLastModifiedDate"],"407C":["TM","CalibrationTime"],"407E":["DA","CalibrationDate"],5002:["IS","LINACEnergy"],5004:["IS","LINACOutput"]},"0018":{"0010":["LO","ContrastBolusAgent"],"0012":["SQ","ContrastBolusAgentSequence"],"0014":["SQ","ContrastBolusAdministrationRouteSequence"],"0015":["CS","BodyPartExamined"],"0020":["CS","ScanningSequence"],"0021":["CS","SequenceVariant"],"0022":["CS","ScanOptions"],"0023":["CS","MRAcquisitionType"],"0024":["SH","SequenceName"],"0025":["CS","AngioFlag"],"0026":["SQ","InterventionDrugInformationSequence"],"0027":["TM","InterventionDrugStopTime"],"0028":["DS","InterventionDrugDose"],"0029":["SQ","InterventionDrugCodeSequence"],"002A":["SQ","AdditionalDrugSequence"],"0030":["LO","Radionuclide"],"0031":["LO","Radiopharmaceutical"],"0032":["DS","EnergyWindowCenterline"],"0033":["DS","EnergyWindowTotalWidth"],"0034":["LO","InterventionDrugName"],"0035":["TM","InterventionDrugStartTime"],"0036":["SQ","InterventionSequence"],"0037":["CS","TherapyType"],"0038":["CS","InterventionStatus"],"0039":["CS","TherapyDescription"],"003A":["ST","InterventionDescription"],"0040":["IS","CineRate"],"0042":["CS","InitialCineRunState"],"0050":["DS","SliceThickness"],"0060":["DS","KVP"],"0070":["IS","CountsAccumulated"],"0071":["CS","AcquisitionTerminationCondition"],"0072":["DS","EffectiveDuration"],"0073":["CS","AcquisitionStartCondition"],"0074":["IS","AcquisitionStartConditionData"],"0075":["IS","AcquisitionTerminationConditionData"],"0080":["DS","RepetitionTime"],"0081":["DS","EchoTime"],"0082":["DS","InversionTime"],"0083":["DS","NumberOfAverages"],"0084":["DS","ImagingFrequency"],"0085":["SH","ImagedNucleus"],"0086":["IS","EchoNumbers"],"0087":["DS","MagneticFieldStrength"],"0088":["DS","SpacingBetweenSlices"],"0089":["IS","NumberOfPhaseEncodingSteps"],"0090":["DS","DataCollectionDiameter"],"0091":["IS","EchoTrainLength"],"0093":["DS","PercentSampling"],"0094":["DS","PercentPhaseFieldOfView"],"0095":["DS","PixelBandwidth"],1e3:["LO","DeviceSerialNumber"],1002:["UI","DeviceUID"],1003:["LO","DeviceID"],1004:["LO","PlateID"],1005:["LO","GeneratorID"],1006:["LO","GridID"],1007:["LO","CassetteID"],1008:["LO","GantryID"],1010:["LO","SecondaryCaptureDeviceID"],1011:["LO","HardcopyCreationDeviceID"],1012:["DA","DateOfSecondaryCapture"],1014:["TM","TimeOfSecondaryCapture"],1016:["LO","SecondaryCaptureDeviceManufacturer"],1017:["LO","HardcopyDeviceManufacturer"],1018:["LO","SecondaryCaptureDeviceManufacturerModelName"],1019:["LO","SecondaryCaptureDeviceSoftwareVersions"],"101A":["LO","HardcopyDeviceSoftwareVersion"],"101B":["LO","HardcopyDeviceManufacturerModelName"],1020:["LO","SoftwareVersions"],1022:["SH","VideoImageFormatAcquired"],1023:["LO","DigitalImageFormatAcquired"],1030:["LO","ProtocolName"],1040:["LO","ContrastBolusRoute"],1041:["DS","ContrastBolusVolume"],1042:["TM","ContrastBolusStartTime"],1043:["TM","ContrastBolusStopTime"],1044:["DS","ContrastBolusTotalDose"],1045:["IS","SyringeCounts"],1046:["DS","ContrastFlowRate"],1047:["DS","ContrastFlowDuration"],1048:["CS","ContrastBolusIngredient"],1049:["DS","ContrastBolusIngredientConcentration"],1050:["DS","SpatialResolution"],1060:["DS","TriggerTime"],1061:["LO","TriggerSourceOrType"],1062:["IS","NominalInterval"],1063:["DS","FrameTime"],1064:["LO","CardiacFramingType"],1065:["DS","FrameTimeVector"],1066:["DS","FrameDelay"],1067:["DS","ImageTriggerDelay"],1068:["DS","MultiplexGroupTimeOffset"],1069:["DS","TriggerTimeOffset"],"106A":["CS","SynchronizationTrigger"],"106C":["US","SynchronizationChannel"],"106E":["UL","TriggerSamplePosition"],1070:["LO","RadiopharmaceuticalRoute"],1071:["DS","RadiopharmaceuticalVolume"],1072:["TM","RadiopharmaceuticalStartTime"],1073:["TM","RadiopharmaceuticalStopTime"],1074:["DS","RadionuclideTotalDose"],1075:["DS","RadionuclideHalfLife"],1076:["DS","RadionuclidePositronFraction"],1077:["DS","RadiopharmaceuticalSpecificActivity"],1078:["DT","RadiopharmaceuticalStartDateTime"],1079:["DT","RadiopharmaceuticalStopDateTime"],1080:["CS","BeatRejectionFlag"],1081:["IS","LowRRValue"],1082:["IS","HighRRValue"],1083:["IS","IntervalsAcquired"],1084:["IS","IntervalsRejected"],1085:["LO","PVCRejection"],1086:["IS","SkipBeats"],1088:["IS","HeartRate"],1090:["IS","CardiacNumberOfImages"],1094:["IS","TriggerWindow"],1100:["DS","ReconstructionDiameter"],1110:["DS","DistanceSourceToDetector"],1111:["DS","DistanceSourceToPatient"],1114:["DS","EstimatedRadiographicMagnificationFactor"],1120:["DS","GantryDetectorTilt"],1121:["DS","GantryDetectorSlew"],1130:["DS","TableHeight"],1131:["DS","TableTraverse"],1134:["CS","TableMotion"],1135:["DS","TableVerticalIncrement"],1136:["DS","TableLateralIncrement"],1137:["DS","TableLongitudinalIncrement"],1138:["DS","TableAngle"],"113A":["CS","TableType"],1140:["CS","RotationDirection"],1141:["DS","AngularPosition"],1142:["DS","RadialPosition"],1143:["DS","ScanArc"],1144:["DS","AngularStep"],1145:["DS","CenterOfRotationOffset"],1146:["DS","RotationOffset"],1147:["CS","FieldOfViewShape"],1149:["IS","FieldOfViewDimensions"],1150:["IS","ExposureTime"],1151:["IS","XRayTubeCurrent"],1152:["IS","Exposure"],1153:["IS","ExposureInuAs"],1154:["DS","AveragePulseWidth"],1155:["CS","RadiationSetting"],1156:["CS","RectificationType"],"115A":["CS","RadiationMode"],"115E":["DS","ImageAndFluoroscopyAreaDoseProduct"],1160:["SH","FilterType"],1161:["LO","TypeOfFilters"],1162:["DS","IntensifierSize"],1164:["DS","ImagerPixelSpacing"],1166:["CS","Grid"],1170:["IS","GeneratorPower"],1180:["SH","CollimatorGridName"],1181:["CS","CollimatorType"],1182:["IS","FocalDistance"],1183:["DS","XFocusCenter"],1184:["DS","YFocusCenter"],1190:["DS","FocalSpots"],1191:["CS","AnodeTargetMaterial"],"11A0":["DS","BodyPartThickness"],"11A2":["DS","CompressionForce"],1200:["DA","DateOfLastCalibration"],1201:["TM","TimeOfLastCalibration"],1210:["SH","ConvolutionKernel"],1240:["IS","UpperLowerPixelValues"],1242:["IS","ActualFrameDuration"],1243:["IS","CountRate"],1244:["US","PreferredPlaybackSequencing"],1250:["SH","ReceiveCoilName"],1251:["SH","TransmitCoilName"],1260:["SH","PlateType"],1261:["LO","PhosphorType"],1300:["DS","ScanVelocity"],1301:["CS","WholeBodyTechnique"],1302:["IS","ScanLength"],1310:["US","AcquisitionMatrix"],1312:["CS","InPlanePhaseEncodingDirection"],1314:["DS","FlipAngle"],1315:["CS","VariableFlipAngleFlag"],1316:["DS","SAR"],1318:["DS","dBdt"],1400:["LO","AcquisitionDeviceProcessingDescription"],1401:["LO","AcquisitionDeviceProcessingCode"],1402:["CS","CassetteOrientation"],1403:["CS","CassetteSize"],1404:["US","ExposuresOnPlate"],1405:["IS","RelativeXRayExposure"],1411:["DS","ExposureIndex"],1412:["DS","TargetExposureIndex"],1413:["DS","DeviationIndex"],1450:["DS","ColumnAngulation"],1460:["DS","TomoLayerHeight"],1470:["DS","TomoAngle"],1480:["DS","TomoTime"],1490:["CS","TomoType"],1491:["CS","TomoClass"],1495:["IS","NumberOfTomosynthesisSourceImages"],1500:["CS","PositionerMotion"],1508:["CS","PositionerType"],1510:["DS","PositionerPrimaryAngle"],1511:["DS","PositionerSecondaryAngle"],1520:["DS","PositionerPrimaryAngleIncrement"],1521:["DS","PositionerSecondaryAngleIncrement"],1530:["DS","DetectorPrimaryAngle"],1531:["DS","DetectorSecondaryAngle"],1600:["CS","ShutterShape"],1602:["IS","ShutterLeftVerticalEdge"],1604:["IS","ShutterRightVerticalEdge"],1606:["IS","ShutterUpperHorizontalEdge"],1608:["IS","ShutterLowerHorizontalEdge"],1610:["IS","CenterOfCircularShutter"],1612:["IS","RadiusOfCircularShutter"],1620:["IS","VerticesOfThePolygonalShutter"],1622:["US","ShutterPresentationValue"],1623:["US","ShutterOverlayGroup"],1624:["US","ShutterPresentationColorCIELabValue"],1700:["CS","CollimatorShape"],1702:["IS","CollimatorLeftVerticalEdge"],1704:["IS","CollimatorRightVerticalEdge"],1706:["IS","CollimatorUpperHorizontalEdge"],1708:["IS","CollimatorLowerHorizontalEdge"],1710:["IS","CenterOfCircularCollimator"],1712:["IS","RadiusOfCircularCollimator"],1720:["IS","VerticesOfThePolygonalCollimator"],1800:["CS","AcquisitionTimeSynchronized"],1801:["SH","TimeSource"],1802:["CS","TimeDistributionProtocol"],1803:["LO","NTPSourceAddress"],2001:["IS","PageNumberVector"],2002:["SH","FrameLabelVector"],2003:["DS","FramePrimaryAngleVector"],2004:["DS","FrameSecondaryAngleVector"],2005:["DS","SliceLocationVector"],2006:["SH","DisplayWindowLabelVector"],2010:["DS","NominalScannedPixelSpacing"],2020:["CS","DigitizingDeviceTransportDirection"],2030:["DS","RotationOfScannedFilm"],3100:["CS","IVUSAcquisition"],3101:["DS","IVUSPullbackRate"],3102:["DS","IVUSGatedRate"],3103:["IS","IVUSPullbackStartFrameNumber"],3104:["IS","IVUSPullbackStopFrameNumber"],3105:["IS","LesionNumber"],4e3:["LT","AcquisitionComments"],5e3:["SH","OutputPower"],5010:["LO","TransducerData"],5012:["DS","FocusDepth"],5020:["LO","ProcessingFunction"],5021:["LO","PostprocessingFunction"],5022:["DS","MechanicalIndex"],5024:["DS","BoneThermalIndex"],5026:["DS","CranialThermalIndex"],5027:["DS","SoftTissueThermalIndex"],5028:["DS","SoftTissueFocusThermalIndex"],5029:["DS","SoftTissueSurfaceThermalIndex"],5030:["DS","DynamicRange"],5040:["DS","TotalGain"],5050:["IS","DepthOfScanField"],5100:["CS","PatientPosition"],5101:["CS","ViewPosition"],5104:["SQ","ProjectionEponymousNameCodeSequence"],5210:["DS","ImageTransformationMatrix"],5212:["DS","ImageTranslationVector"],6e3:["DS","Sensitivity"],6011:["SQ","SequenceOfUltrasoundRegions"],6012:["US","RegionSpatialFormat"],6014:["US","RegionDataType"],6016:["UL","RegionFlags"],6018:["UL","RegionLocationMinX0"],"601A":["UL","RegionLocationMinY0"],"601C":["UL","RegionLocationMaxX1"],"601E":["UL","RegionLocationMaxY1"],6020:["SL","ReferencePixelX0"],6022:["SL","ReferencePixelY0"],6024:["US","PhysicalUnitsXDirection"],6026:["US","PhysicalUnitsYDirection"],6028:["FD","ReferencePixelPhysicalValueX"],"602A":["FD","ReferencePixelPhysicalValueY"],"602C":["FD","PhysicalDeltaX"],"602E":["FD","PhysicalDeltaY"],6030:["UL","TransducerFrequency"],6031:["CS","TransducerType"],6032:["UL","PulseRepetitionFrequency"],6034:["FD","DopplerCorrectionAngle"],6036:["FD","SteeringAngle"],6038:["UL","DopplerSampleVolumeXPositionRetired"],6039:["SL","DopplerSampleVolumeXPosition"],"603A":["UL","DopplerSampleVolumeYPositionRetired"],"603B":["SL","DopplerSampleVolumeYPosition"],"603C":["UL","TMLinePositionX0Retired"],"603D":["SL","TMLinePositionX0"],"603E":["UL","TMLinePositionY0Retired"],"603F":["SL","TMLinePositionY0"],6040:["UL","TMLinePositionX1Retired"],6041:["SL","TMLinePositionX1"],6042:["UL","TMLinePositionY1Retired"],6043:["SL","TMLinePositionY1"],6044:["US","PixelComponentOrganization"],6046:["UL","PixelComponentMask"],6048:["UL","PixelComponentRangeStart"],"604A":["UL","PixelComponentRangeStop"],"604C":["US","PixelComponentPhysicalUnits"],"604E":["US","PixelComponentDataType"],6050:["UL","NumberOfTableBreakPoints"],6052:["UL","TableOfXBreakPoints"],6054:["FD","TableOfYBreakPoints"],6056:["UL","NumberOfTableEntries"],6058:["UL","TableOfPixelValues"],"605A":["FL","TableOfParameterValues"],6060:["FL","RWaveTimeVector"],7e3:["CS","DetectorConditionsNominalFlag"],7001:["DS","DetectorTemperature"],7004:["CS","DetectorType"],7005:["CS","DetectorConfiguration"],7006:["LT","DetectorDescription"],7008:["LT","DetectorMode"],"700A":["SH","DetectorID"],"700C":["DA","DateOfLastDetectorCalibration"],"700E":["TM","TimeOfLastDetectorCalibration"],7010:["IS","ExposuresOnDetectorSinceLastCalibration"],7011:["IS","ExposuresOnDetectorSinceManufactured"],7012:["DS","DetectorTimeSinceLastExposure"],7014:["DS","DetectorActiveTime"],7016:["DS","DetectorActivationOffsetFromExposure"],"701A":["DS","DetectorBinning"],7020:["DS","DetectorElementPhysicalSize"],7022:["DS","DetectorElementSpacing"],7024:["CS","DetectorActiveShape"],7026:["DS","DetectorActiveDimensions"],7028:["DS","DetectorActiveOrigin"],"702A":["LO","DetectorManufacturerName"],"702B":["LO","DetectorManufacturerModelName"],7030:["DS","FieldOfViewOrigin"],7032:["DS","FieldOfViewRotation"],7034:["CS","FieldOfViewHorizontalFlip"],7036:["FL","PixelDataAreaOriginRelativeToFOV"],7038:["FL","PixelDataAreaRotationAngleRelativeToFOV"],7040:["LT","GridAbsorbingMaterial"],7041:["LT","GridSpacingMaterial"],7042:["DS","GridThickness"],7044:["DS","GridPitch"],7046:["IS","GridAspectRatio"],7048:["DS","GridPeriod"],"704C":["DS","GridFocalDistance"],7050:["CS","FilterMaterial"],7052:["DS","FilterThicknessMinimum"],7054:["DS","FilterThicknessMaximum"],7056:["FL","FilterBeamPathLengthMinimum"],7058:["FL","FilterBeamPathLengthMaximum"],7060:["CS","ExposureControlMode"],7062:["LT","ExposureControlModeDescription"],7064:["CS","ExposureStatus"],7065:["DS","PhototimerSetting"],8150:["DS","ExposureTimeInuS"],8151:["DS","XRayTubeCurrentInuA"],9004:["CS","ContentQualification"],9005:["SH","PulseSequenceName"],9006:["SQ","MRImagingModifierSequence"],9008:["CS","EchoPulseSequence"],9009:["CS","InversionRecovery"],9010:["CS","FlowCompensation"],9011:["CS","MultipleSpinEcho"],9012:["CS","MultiPlanarExcitation"],9014:["CS","PhaseContrast"],9015:["CS","TimeOfFlightContrast"],9016:["CS","Spoiling"],9017:["CS","SteadyStatePulseSequence"],9018:["CS","EchoPlanarPulseSequence"],9019:["FD","TagAngleFirstAxis"],9020:["CS","MagnetizationTransfer"],9021:["CS","T2Preparation"],9022:["CS","BloodSignalNulling"],9024:["CS","SaturationRecovery"],9025:["CS","SpectrallySelectedSuppression"],9026:["CS","SpectrallySelectedExcitation"],9027:["CS","SpatialPresaturation"],9028:["CS","Tagging"],9029:["CS","OversamplingPhase"],9030:["FD","TagSpacingFirstDimension"],9032:["CS","GeometryOfKSpaceTraversal"],9033:["CS","SegmentedKSpaceTraversal"],9034:["CS","RectilinearPhaseEncodeReordering"],9035:["FD","TagThickness"],9036:["CS","PartialFourierDirection"],9037:["CS","CardiacSynchronizationTechnique"],9041:["LO","ReceiveCoilManufacturerName"],9042:["SQ","MRReceiveCoilSequence"],9043:["CS","ReceiveCoilType"],9044:["CS","QuadratureReceiveCoil"],9045:["SQ","MultiCoilDefinitionSequence"],9046:["LO","MultiCoilConfiguration"],9047:["SH","MultiCoilElementName"],9048:["CS","MultiCoilElementUsed"],9049:["SQ","MRTransmitCoilSequence"],9050:["LO","TransmitCoilManufacturerName"],9051:["CS","TransmitCoilType"],9052:["FD","SpectralWidth"],9053:["FD","ChemicalShiftReference"],9054:["CS","VolumeLocalizationTechnique"],9058:["US","MRAcquisitionFrequencyEncodingSteps"],9059:["CS","Decoupling"],9060:["CS","DecoupledNucleus"],9061:["FD","DecouplingFrequency"],9062:["CS","DecouplingMethod"],9063:["FD","DecouplingChemicalShiftReference"],9064:["CS","KSpaceFiltering"],9065:["CS","TimeDomainFiltering"],9066:["US","NumberOfZeroFills"],9067:["CS","BaselineCorrection"],9069:["FD","ParallelReductionFactorInPlane"],9070:["FD","CardiacRRIntervalSpecified"],9073:["FD","AcquisitionDuration"],9074:["DT","FrameAcquisitionDateTime"],9075:["CS","DiffusionDirectionality"],9076:["SQ","DiffusionGradientDirectionSequence"],9077:["CS","ParallelAcquisition"],9078:["CS","ParallelAcquisitionTechnique"],9079:["FD","InversionTimes"],9080:["ST","MetaboliteMapDescription"],9081:["CS","PartialFourier"],9082:["FD","EffectiveEchoTime"],9083:["SQ","MetaboliteMapCodeSequence"],9084:["SQ","ChemicalShiftSequence"],9085:["CS","CardiacSignalSource"],9087:["FD","DiffusionBValue"],9089:["FD","DiffusionGradientOrientation"],9090:["FD","VelocityEncodingDirection"],9091:["FD","VelocityEncodingMinimumValue"],9092:["SQ","VelocityEncodingAcquisitionSequence"],9093:["US","NumberOfKSpaceTrajectories"],9094:["CS","CoverageOfKSpace"],9095:["UL","SpectroscopyAcquisitionPhaseRows"],9096:["FD","ParallelReductionFactorInPlaneRetired"],9098:["FD","TransmitterFrequency"],9100:["CS","ResonantNucleus"],9101:["CS","FrequencyCorrection"],9103:["SQ","MRSpectroscopyFOVGeometrySequence"],9104:["FD","SlabThickness"],9105:["FD","SlabOrientation"],9106:["FD","MidSlabPosition"],9107:["SQ","MRSpatialSaturationSequence"],9112:["SQ","MRTimingAndRelatedParametersSequence"],9114:["SQ","MREchoSequence"],9115:["SQ","MRModifierSequence"],9117:["SQ","MRDiffusionSequence"],9118:["SQ","CardiacSynchronizationSequence"],9119:["SQ","MRAveragesSequence"],9125:["SQ","MRFOVGeometrySequence"],9126:["SQ","VolumeLocalizationSequence"],9127:["UL","SpectroscopyAcquisitionDataColumns"],9147:["CS","DiffusionAnisotropyType"],9151:["DT","FrameReferenceDateTime"],9152:["SQ","MRMetaboliteMapSequence"],9155:["FD","ParallelReductionFactorOutOfPlane"],9159:["UL","SpectroscopyAcquisitionOutOfPlanePhaseSteps"],9166:["CS","BulkMotionStatus"],9168:["FD","ParallelReductionFactorSecondInPlane"],9169:["CS","CardiacBeatRejectionTechnique"],9170:["CS","RespiratoryMotionCompensationTechnique"],9171:["CS","RespiratorySignalSource"],9172:["CS","BulkMotionCompensationTechnique"],9173:["CS","BulkMotionSignalSource"],9174:["CS","ApplicableSafetyStandardAgency"],9175:["LO","ApplicableSafetyStandardDescription"],9176:["SQ","OperatingModeSequence"],9177:["CS","OperatingModeType"],9178:["CS","OperatingMode"],9179:["CS","SpecificAbsorptionRateDefinition"],9180:["CS","GradientOutputType"],9181:["FD","SpecificAbsorptionRateValue"],9182:["FD","GradientOutput"],9183:["CS","FlowCompensationDirection"],9184:["FD","TaggingDelay"],9185:["ST","RespiratoryMotionCompensationTechniqueDescription"],9186:["SH","RespiratorySignalSourceID"],9195:["FD","ChemicalShiftMinimumIntegrationLimitInHz"],9196:["FD","ChemicalShiftMaximumIntegrationLimitInHz"],9197:["SQ","MRVelocityEncodingSequence"],9198:["CS","FirstOrderPhaseCorrection"],9199:["CS","WaterReferencedPhaseCorrection"],9200:["CS","MRSpectroscopyAcquisitionType"],9214:["CS","RespiratoryCyclePosition"],9217:["FD","VelocityEncodingMaximumValue"],9218:["FD","TagSpacingSecondDimension"],9219:["SS","TagAngleSecondAxis"],9220:["FD","FrameAcquisitionDuration"],9226:["SQ","MRImageFrameTypeSequence"],9227:["SQ","MRSpectroscopyFrameTypeSequence"],9231:["US","MRAcquisitionPhaseEncodingStepsInPlane"],9232:["US","MRAcquisitionPhaseEncodingStepsOutOfPlane"],9234:["UL","SpectroscopyAcquisitionPhaseColumns"],9236:["CS","CardiacCyclePosition"],9239:["SQ","SpecificAbsorptionRateSequence"],9240:["US","RFEchoTrainLength"],9241:["US","GradientEchoTrainLength"],9250:["CS","ArterialSpinLabelingContrast"],9251:["SQ","MRArterialSpinLabelingSequence"],9252:["LO","ASLTechniqueDescription"],9253:["US","ASLSlabNumber"],9254:["FD ","ASLSlabThickness"],9255:["FD ","ASLSlabOrientation"],9256:["FD ","ASLMidSlabPosition"],9257:["CS","ASLContext"],9258:["UL","ASLPulseTrainDuration"],9259:["CS","ASLCrusherFlag"],"925A":["FD","ASLCrusherFlow"],"925B":["LO","ASLCrusherDescription"],"925C":["CS","ASLBolusCutoffFlag"],"925D":["SQ","ASLBolusCutoffTimingSequence"],"925E":["LO","ASLBolusCutoffTechnique"],"925F":["UL","ASLBolusCutoffDelayTime"],9260:["SQ","ASLSlabSequence"],9295:["FD","ChemicalShiftMinimumIntegrationLimitInppm"],9296:["FD","ChemicalShiftMaximumIntegrationLimitInppm"],9301:["SQ","CTAcquisitionTypeSequence"],9302:["CS","AcquisitionType"],9303:["FD","TubeAngle"],9304:["SQ","CTAcquisitionDetailsSequence"],9305:["FD","RevolutionTime"],9306:["FD","SingleCollimationWidth"],9307:["FD","TotalCollimationWidth"],9308:["SQ","CTTableDynamicsSequence"],9309:["FD","TableSpeed"],9310:["FD","TableFeedPerRotation"],9311:["FD","SpiralPitchFactor"],9312:["SQ","CTGeometrySequence"],9313:["FD","DataCollectionCenterPatient"],9314:["SQ","CTReconstructionSequence"],9315:["CS","ReconstructionAlgorithm"],9316:["CS","ConvolutionKernelGroup"],9317:["FD","ReconstructionFieldOfView"],9318:["FD","ReconstructionTargetCenterPatient"],9319:["FD","ReconstructionAngle"],9320:["SH","ImageFilter"],9321:["SQ","CTExposureSequence"],9322:["FD","ReconstructionPixelSpacing"],9323:["CS","ExposureModulationType"],9324:["FD","EstimatedDoseSaving"],9325:["SQ","CTXRayDetailsSequence"],9326:["SQ","CTPositionSequence"],9327:["FD","TablePosition"],9328:["FD","ExposureTimeInms"],9329:["SQ","CTImageFrameTypeSequence"],9330:["FD","XRayTubeCurrentInmA"],9332:["FD","ExposureInmAs"],9333:["CS","ConstantVolumeFlag"],9334:["CS","FluoroscopyFlag"],9335:["FD","DistanceSourceToDataCollectionCenter"],9337:["US","ContrastBolusAgentNumber"],9338:["SQ","ContrastBolusIngredientCodeSequence"],9340:["SQ","ContrastAdministrationProfileSequence"],9341:["SQ","ContrastBolusUsageSequence"],9342:["CS","ContrastBolusAgentAdministered"],9343:["CS","ContrastBolusAgentDetected"],9344:["CS","ContrastBolusAgentPhase"],9345:["FD","CTDIvol"],9346:["SQ","CTDIPhantomTypeCodeSequence"],9351:["FL","CalciumScoringMassFactorPatient"],9352:["FL","CalciumScoringMassFactorDevice"],9353:["FL","EnergyWeightingFactor"],9360:["SQ","CTAdditionalXRaySourceSequence"],9401:["SQ","ProjectionPixelCalibrationSequence"],9402:["FL","DistanceSourceToIsocenter"],9403:["FL","DistanceObjectToTableTop"],9404:["FL","ObjectPixelSpacingInCenterOfBeam"],9405:["SQ","PositionerPositionSequence"],9406:["SQ","TablePositionSequence"],9407:["SQ","CollimatorShapeSequence"],9410:["CS","PlanesInAcquisition"],9412:["SQ","XAXRFFrameCharacteristicsSequence"],9417:["SQ","FrameAcquisitionSequence"],9420:["CS","XRayReceptorType"],9423:["LO","AcquisitionProtocolName"],9424:["LT","AcquisitionProtocolDescription"],9425:["CS","ContrastBolusIngredientOpaque"],9426:["FL","DistanceReceptorPlaneToDetectorHousing"],9427:["CS","IntensifierActiveShape"],9428:["FL","IntensifierActiveDimensions"],9429:["FL","PhysicalDetectorSize"],9430:["FL","PositionOfIsocenterProjection"],9432:["SQ","FieldOfViewSequence"],9433:["LO","FieldOfViewDescription"],9434:["SQ","ExposureControlSensingRegionsSequence"],9435:["CS","ExposureControlSensingRegionShape"],9436:["SS","ExposureControlSensingRegionLeftVerticalEdge"],9437:["SS","ExposureControlSensingRegionRightVerticalEdge"],9438:["SS","ExposureControlSensingRegionUpperHorizontalEdge"],9439:["SS","ExposureControlSensingRegionLowerHorizontalEdge"],9440:["SS","CenterOfCircularExposureControlSensingRegion"],9441:["US","RadiusOfCircularExposureControlSensingRegion"],9442:["SS","VerticesOfThePolygonalExposureControlSensingRegion"],9447:["FL","ColumnAngulationPatient"],9449:["FL","BeamAngle"],9451:["SQ","FrameDetectorParametersSequence"],9452:["FL","CalculatedAnatomyThickness"],9455:["SQ","CalibrationSequence"],9456:["SQ","ObjectThicknessSequence"],9457:["CS","PlaneIdentification"],9461:["FL","FieldOfViewDimensionsInFloat"],9462:["SQ","IsocenterReferenceSystemSequence"],9463:["FL","PositionerIsocenterPrimaryAngle"],9464:["FL","PositionerIsocenterSecondaryAngle"],9465:["FL","PositionerIsocenterDetectorRotationAngle"],9466:["FL","TableXPositionToIsocenter"],9467:["FL","TableYPositionToIsocenter"],9468:["FL","TableZPositionToIsocenter"],9469:["FL","TableHorizontalRotationAngle"],9470:["FL","TableHeadTiltAngle"],9471:["FL","TableCradleTiltAngle"],9472:["SQ","FrameDisplayShutterSequence"],9473:["FL","AcquiredImageAreaDoseProduct"],9474:["CS","CArmPositionerTabletopRelationship"],9476:["SQ","XRayGeometrySequence"],9477:["SQ","IrradiationEventIdentificationSequence"],9504:["SQ","XRay3DFrameTypeSequence"],9506:["SQ","ContributingSourcesSequence"],9507:["SQ","XRay3DAcquisitionSequence"],9508:["FL","PrimaryPositionerScanArc"],9509:["FL","SecondaryPositionerScanArc"],9510:["FL ","PrimaryPositionerScanStartAngle"],9511:["FL","SecondaryPositionerScanStartAngle"],9514:["FL","PrimaryPositionerIncrement"],9515:["FL","SecondaryPositionerIncrement"],9516:["DT","StartAcquisitionDateTime"],9517:["DT","EndAcquisitionDateTime"],9524:["LO","ApplicationName"],9525:["LO","ApplicationVersion"],9526:["LO","ApplicationManufacturer"],9527:["CS","AlgorithmType"],9528:["LO","AlgorithmDescription"],9530:["SQ","XRay3DReconstructionSequence"],9531:["LO","ReconstructionDescription"],9538:["SQ","PerProjectionAcquisitionSequence"],9601:["SQ","DiffusionBMatrixSequence"],9602:["FD","DiffusionBValueXX"],9603:["FD","DiffusionBValueXY"],9604:["FD","DiffusionBValueXZ"],9605:["FD","DiffusionBValueYY"],9606:["FD","DiffusionBValueYZ"],9607:["FD","DiffusionBValueZZ"],9701:["DT","DecayCorrectionDateTime"],9715:["FD","StartDensityThreshold"],9716:["FD","StartRelativeDensityDifferenceThreshold"],9717:["FD","StartCardiacTriggerCountThreshold"],9718:["FD","StartRespiratoryTriggerCountThreshold"],9719:["FD","TerminationCountsThreshold"],9720:["FD","TerminationDensityThreshold"],9721:["FD","TerminationRelativeDensityThreshold"],9722:["FD","TerminationTimeThreshold"],9723:["FD","TerminationCardiacTriggerCountThreshold"],9724:["FD","TerminationRespiratoryTriggerCountThreshold"],9725:["CS","DetectorGeometry"],9726:["FD","TransverseDetectorSeparation"],9727:["FD","AxialDetectorDimension"],9729:["US","RadiopharmaceuticalAgentNumber"],9732:["SQ","PETFrameAcquisitionSequence"],9733:["SQ","PETDetectorMotionDetailsSequence"],9734:["SQ","PETTableDynamicsSequence"],9735:["SQ","PETPositionSequence"],9736:["SQ","PETFrameCorrectionFactorsSequence"],9737:["SQ","RadiopharmaceuticalUsageSequence"],9738:["CS","AttenuationCorrectionSource"],9739:["US","NumberOfIterations"],9740:["US","NumberOfSubsets"],9749:["SQ","PETReconstructionSequence"],9751:["SQ","PETFrameTypeSequence"],9755:["CS","TimeOfFlightInformationUsed"],9756:["CS","ReconstructionType"],9758:["CS","DecayCorrected"],9759:["CS","AttenuationCorrected"],9760:["CS","ScatterCorrected"],9761:["CS","DeadTimeCorrected"],9762:["CS","GantryMotionCorrected"],9763:["CS","PatientMotionCorrected"],9764:["CS","CountLossNormalizationCorrected"],9765:["CS","RandomsCorrected"],9766:["CS","NonUniformRadialSamplingCorrected"],9767:["CS","SensitivityCalibrated"],9768:["CS","DetectorNormalizationCorrection"],9769:["CS","IterativeReconstructionMethod"],9770:["CS","AttenuationCorrectionTemporalRelationship"],9771:["SQ","PatientPhysiologicalStateSequence"],9772:["SQ","PatientPhysiologicalStateCodeSequence"],9801:["FD","DepthsOfFocus"],9803:["SQ","ExcludedIntervalsSequence"],9804:["DT","ExclusionStartDatetime"],9805:["FD","ExclusionDuration"],9806:["SQ","USImageDescriptionSequence"],9807:["SQ","ImageDataTypeSequence"],9808:["CS","DataType"],9809:["SQ","TransducerScanPatternCodeSequence"],"980B":["CS","AliasedDataType"],"980C":["CS","PositionMeasuringDeviceUsed"],"980D":["SQ","TransducerGeometryCodeSequence"],"980E":["SQ","TransducerBeamSteeringCodeSequence"],"980F":["SQ","TransducerApplicationCodeSequence"],A001:["SQ","ContributingEquipmentSequence"],A002:["DT","ContributionDateTime"],A003:["ST","ContributionDescription"]},"0020":{"000D":["UI","StudyInstanceUID"],"000E":["UI","SeriesInstanceUID"],"0010":["SH","StudyID"],"0011":["IS","SeriesNumber"],"0012":["IS","AcquisitionNumber"],"0013":["IS","InstanceNumber"],"0014":["IS","IsotopeNumber"],"0015":["IS","PhaseNumber"],"0016":["IS","IntervalNumber"],"0017":["IS","TimeSlotNumber"],"0018":["IS","AngleNumber"],"0019":["IS","ItemNumber"],"0020":["CS","PatientOrientation"],"0022":["IS","OverlayNumber"],"0024":["IS","CurveNumber"],"0026":["IS","LUTNumber"],"0030":["DS","ImagePosition"],"0032":["DS","ImagePositionPatient"],"0035":["DS","ImageOrientation"],"0037":["DS","ImageOrientationPatient"],"0050":["DS","Location"],"0052":["UI","FrameOfReferenceUID"],"0060":["CS","Laterality"],"0062":["CS","ImageLaterality"],"0070":["LO","ImageGeometryType"],"0080":["CS","MaskingImage"],"00AA":["IS","ReportNumber"],"0100":["IS","TemporalPositionIdentifier"],"0105":["IS","NumberOfTemporalPositions"],"0110":["DS","TemporalResolution"],"0200":["UI","SynchronizationFrameOfReferenceUID"],"0242":["UI","SOPInstanceUIDOfConcatenationSource"],1e3:["IS","SeriesInStudy"],1001:["IS","AcquisitionsInSeries"],1002:["IS","ImagesInAcquisition"],1003:["IS","ImagesInSeries"],1004:["IS","AcquisitionsInStudy"],1005:["IS","ImagesInStudy"],1020:["LO","Reference"],1040:["LO","PositionReferenceIndicator"],1041:["DS","SliceLocation"],1070:["IS","OtherStudyNumbers"],1200:["IS","NumberOfPatientRelatedStudies"],1202:["IS","NumberOfPatientRelatedSeries"],1204:["IS","NumberOfPatientRelatedInstances"],1206:["IS","NumberOfStudyRelatedSeries"],1208:["IS","NumberOfStudyRelatedInstances"],1209:["IS","NumberOfSeriesRelatedInstances"],3401:["CS","ModifyingDeviceID"],3402:["CS","ModifiedImageID"],3403:["DA","ModifiedImageDate"],3404:["LO","ModifyingDeviceManufacturer"],3405:["TM","ModifiedImageTime"],3406:["LO","ModifiedImageDescription"],4e3:["LT","ImageComments"],5e3:["AT","OriginalImageIdentification"],5002:["LO","OriginalImageIdentificationNomenclature"],9056:["SH","StackID"],9057:["UL","InStackPositionNumber"],9071:["SQ","FrameAnatomySequence"],9072:["CS","FrameLaterality"],9111:["SQ","FrameContentSequence"],9113:["SQ","PlanePositionSequence"],9116:["SQ","PlaneOrientationSequence"],9128:["UL","TemporalPositionIndex"],9153:["FD","NominalCardiacTriggerDelayTime"],9154:["FL","NominalCardiacTriggerTimePriorToRPeak"],9155:["FL","ActualCardiacTriggerTimePriorToRPeak"],9156:["US","FrameAcquisitionNumber"],9157:["UL","DimensionIndexValues"],9158:["LT","FrameComments"],9161:["UI","ConcatenationUID"],9162:["US","InConcatenationNumber"],9163:["US","InConcatenationTotalNumber"],9164:["UI","DimensionOrganizationUID"],9165:["AT","DimensionIndexPointer"],9167:["AT","FunctionalGroupPointer"],9213:["LO","DimensionIndexPrivateCreator"],9221:["SQ","DimensionOrganizationSequence"],9222:["SQ","DimensionIndexSequence"],9228:["UL","ConcatenationFrameOffsetNumber"],9238:["LO","FunctionalGroupPrivateCreator"],9241:["FL","NominalPercentageOfCardiacPhase"],9245:["FL","NominalPercentageOfRespiratoryPhase"],9246:["FL","StartingRespiratoryAmplitude"],9247:["CS","StartingRespiratoryPhase"],9248:["FL","EndingRespiratoryAmplitude"],9249:["CS","EndingRespiratoryPhase"],9250:["CS","RespiratoryTriggerType"],9251:["FD","RRIntervalTimeNominal"],9252:["FD","ActualCardiacTriggerDelayTime"],9253:["SQ","RespiratorySynchronizationSequence"],9254:["FD","RespiratoryIntervalTime"],9255:["FD","NominalRespiratoryTriggerDelayTime"],9256:["FD","RespiratoryTriggerDelayThreshold"],9257:["FD","ActualRespiratoryTriggerDelayTime"],9301:["FD","ImagePositionVolume"],9302:["FD","ImageOrientationVolume"],9307:["CS","UltrasoundAcquisitionGeometry"],9308:["FD","ApexPosition"],9309:["FD","VolumeToTransducerMappingMatrix"],"930A":["FD","VolumeToTableMappingMatrix"],"930C":["CS","PatientFrameOfReferenceSource"],"930D":["FD","TemporalPositionTimeOffset"],"930E":["SQ","PlanePositionVolumeSequence"],"930F":["SQ","PlaneOrientationVolumeSequence"],9310:["SQ","TemporalPositionSequence"],9311:["CS","DimensionOrganizationType"],9312:["UI","VolumeFrameOfReferenceUID"],9313:["UI","TableFrameOfReferenceUID"],9421:["LO","DimensionDescriptionLabel"],9450:["SQ","PatientOrientationInFrameSequence"],9453:["LO","FrameLabel"],9518:["US","AcquisitionIndex"],9529:["SQ","ContributingSOPInstancesReferenceSequence"],9536:["US","ReconstructionIndex"]},"0022":{"0001":["US","LightPathFilterPassThroughWavelength"],"0002":["US","LightPathFilterPassBand"],"0003":["US","ImagePathFilterPassThroughWavelength"],"0004":["US","ImagePathFilterPassBand"],"0005":["CS","PatientEyeMovementCommanded"],"0006":["SQ","PatientEyeMovementCommandCodeSequence"],"0007":["FL","SphericalLensPower"],"0008":["FL","CylinderLensPower"],"0009":["FL","CylinderAxis"],"000A":["FL","EmmetropicMagnification"],"000B":["FL","IntraOcularPressure"],"000C":["FL","HorizontalFieldOfView"],"000D":["CS","PupilDilated"],"000E":["FL","DegreeOfDilation"],"0010":["FL","StereoBaselineAngle"],"0011":["FL","StereoBaselineDisplacement"],"0012":["FL","StereoHorizontalPixelOffset"],"0013":["FL","StereoVerticalPixelOffset"],"0014":["FL","StereoRotation"],"0015":["SQ","AcquisitionDeviceTypeCodeSequence"],"0016":["SQ","IlluminationTypeCodeSequence"],"0017":["SQ","LightPathFilterTypeStackCodeSequence"],"0018":["SQ","ImagePathFilterTypeStackCodeSequence"],"0019":["SQ","LensesCodeSequence"],"001A":["SQ","ChannelDescriptionCodeSequence"],"001B":["SQ","RefractiveStateSequence"],"001C":["SQ","MydriaticAgentCodeSequence"],"001D":["SQ","RelativeImagePositionCodeSequence"],"001E":["FL","CameraAngleOfView"],"0020":["SQ","StereoPairsSequence"],"0021":["SQ","LeftImageSequence"],"0022":["SQ","RightImageSequence"],"0030":["FL","AxialLengthOfTheEye"],"0031":["SQ","OphthalmicFrameLocationSequence"],"0032":["FL","ReferenceCoordinates"],"0035":["FL","DepthSpatialResolution"],"0036":["FL","MaximumDepthDistortion"],"0037":["FL","AlongScanSpatialResolution"],"0038":["FL","MaximumAlongScanDistortion"],"0039":["CS","OphthalmicImageOrientation"],"0041":["FL","DepthOfTransverseImage"],"0042":["SQ","MydriaticAgentConcentrationUnitsSequence"],"0048":["FL","AcrossScanSpatialResolution"],"0049":["FL","MaximumAcrossScanDistortion"],"004E":["DS","MydriaticAgentConcentration"],"0055":["FL","IlluminationWaveLength"],"0056":["FL","IlluminationPower"],"0057":["FL","IlluminationBandwidth"],"0058":["SQ","MydriaticAgentSequence"],1007:["SQ","OphthalmicAxialMeasurementsRightEyeSequence"],1008:["SQ","OphthalmicAxialMeasurementsLeftEyeSequence"],1010:["CS","OphthalmicAxialLengthMeasurementsType"],1019:["FL","OphthalmicAxialLength"],1024:["SQ","LensStatusCodeSequence"],1025:["SQ","VitreousStatusCodeSequence"],1028:["SQ","IOLFormulaCodeSequence"],1029:["LO","IOLFormulaDetail"],1033:["FL","KeratometerIndex"],1035:["SQ","SourceOfOphthalmicAxialLengthCodeSequence"],1037:["FL","TargetRefraction"],1039:["CS","RefractiveProcedureOccurred"],1040:["SQ","RefractiveSurgeryTypeCodeSequence"],1044:["SQ","OphthalmicUltrasoundAxialMeasurementsTypeCodeSequence"],1050:["SQ","OphthalmicAxialLengthMeasurementsSequence"],1053:["FL","IOLPower"],1054:["FL","PredictedRefractiveError"],1059:["FL","OphthalmicAxialLengthVelocity"],1065:["LO","LensStatusDescription"],1066:["LO","VitreousStatusDescription"],1090:["SQ","IOLPowerSequence"],1092:["SQ","LensConstantSequence"],1093:["LO","IOLManufacturer"],1094:["LO","LensConstantDescription"],1096:["SQ","KeratometryMeasurementTypeCodeSequence"],1100:["SQ","ReferencedOphthalmicAxialMeasurementsSequence"],1101:["SQ","OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence"],1103:["SQ","RefractiveErrorBeforeRefractiveSurgeryCodeSequence"],1121:["FL","IOLPowerForExactEmmetropia"],1122:["FL","IOLPowerForExactTargetRefraction"],1125:["SQ","AnteriorChamberDepthDefinitionCodeSequence"],1130:["FL","LensThickness"],1131:["FL","AnteriorChamberDepth"],1132:["SQ","SourceOfLensThicknessDataCodeSequence"],1133:["SQ","SourceOfAnteriorChamberDepthDataCodeSequence"],1135:["SQ","SourceOfRefractiveErrorDataCodeSequence"],1140:["CS","OphthalmicAxialLengthMeasurementModified"],1150:["SQ","OphthalmicAxialLengthDataSourceCodeSequence"],1153:["SQ","OphthalmicAxialLengthAcquisitionMethodCodeSequence"],1155:["FL","SignalToNoiseRatio"],1159:["LO","OphthalmicAxialLengthDataSourceDescription"],1210:["SQ","OphthalmicAxialLengthMeasurementsTotalLengthSequence"],1211:["SQ","OphthalmicAxialLengthMeasurementsSegmentalLengthSequence"],1212:["SQ","OphthalmicAxialLengthMeasurementsLengthSummationSequence"],1220:["SQ","UltrasoundOphthalmicAxialLengthMeasurementsSequence"],1225:["SQ","OpticalOphthalmicAxialLengthMeasurementsSequence"],1230:["SQ","UltrasoundSelectedOphthalmicAxialLengthSequence"],1250:["SQ","OphthalmicAxialLengthSelectionMethodCodeSequence"],1255:["SQ","OpticalSelectedOphthalmicAxialLengthSequence"],1257:["SQ","SelectedSegmentalOphthalmicAxialLengthSequence"],1260:["SQ","SelectedTotalOphthalmicAxialLengthSequence"],1262:["SQ","OphthalmicAxialLengthQualityMetricSequence"],1273:["LO","OphthalmicAxialLengthQualityMetricTypeDescription"],1300:["SQ","IntraocularLensCalculationsRightEyeSequence"],1310:["SQ","IntraocularLensCalculationsLeftEyeSequence"],1330:["SQ","ReferencedOphthalmicAxialLengthMeasurementQCImageSequence"]},"0024":{"0010":["FL","VisualFieldHorizontalExtent"],"0011":["FL","VisualFieldVerticalExtent"],"0012":["CS","VisualFieldShape"],"0016":["SQ","ScreeningTestModeCodeSequence"],"0018":["FL","MaximumStimulusLuminance"],"0020":["FL","BackgroundLuminance"],"0021":["SQ","StimulusColorCodeSequence"],"0024":["SQ","BackgroundIlluminationColorCodeSequence"],"0025":["FL","StimulusArea"],"0028":["FL","StimulusPresentationTime"],"0032":["SQ","FixationSequence"],"0033":["SQ","FixationMonitoringCodeSequence"],"0034":["SQ","VisualFieldCatchTrialSequence"],"0035":["US","FixationCheckedQuantity"],"0036":["US","PatientNotProperlyFixatedQuantity"],"0037":["CS","PresentedVisualStimuliDataFlag"],"0038":["US","NumberOfVisualStimuli"],"0039":["CS","ExcessiveFixationLossesDataFlag"],"0040":["CS","ExcessiveFixationLosses"],"0042":["US","StimuliRetestingQuantity"],"0044":["LT","CommentsOnPatientPerformanceOfVisualField"],"0045":["CS","FalseNegativesEstimateFlag"],"0046":["FL","FalseNegativesEstimate"],"0048":["US","NegativeCatchTrialsQuantity"],"0050":["US","FalseNegativesQuantity"],"0051":["CS","ExcessiveFalseNegativesDataFlag"],"0052":["CS","ExcessiveFalseNegatives"],"0053":["CS","FalsePositivesEstimateFlag"],"0054":["FL","FalsePositivesEstimate"],"0055":["CS","CatchTrialsDataFlag"],"0056":["US","PositiveCatchTrialsQuantity"],"0057":["CS","TestPointNormalsDataFlag"],"0058":["SQ","TestPointNormalsSequence"],"0059":["CS","GlobalDeviationProbabilityNormalsFlag"],"0060":["US","FalsePositivesQuantity"],"0061":["CS","ExcessiveFalsePositivesDataFlag"],"0062":["CS","ExcessiveFalsePositives"],"0063":["CS","VisualFieldTestNormalsFlag"],"0064":["SQ","ResultsNormalsSequence"],"0065":["SQ","AgeCorrectedSensitivityDeviationAlgorithmSequence"],"0066":["FL","GlobalDeviationFromNormal"],"0067":["SQ","GeneralizedDefectSensitivityDeviationAlgorithmSequence"],"0068":["FL","LocalizedDeviationfromNormal"],"0069":["LO","PatientReliabilityIndicator"],"0070":["FL","VisualFieldMeanSensitivity"],"0071":["FL","GlobalDeviationProbability"],"0072":["CS","LocalDeviationProbabilityNormalsFlag"],"0073":["FL","LocalizedDeviationProbability"],"0074":["CS","ShortTermFluctuationCalculated"],"0075":["FL","ShortTermFluctuation"],"0076":["CS","ShortTermFluctuationProbabilityCalculated"],"0077":["FL","ShortTermFluctuationProbability"],"0078":["CS","CorrectedLocalizedDeviationFromNormalCalculated"],"0079":["FL","CorrectedLocalizedDeviationFromNormal"],"0080":["CS","CorrectedLocalizedDeviationFromNormalProbabilityCalculated"],"0081":["FL","CorrectedLocalizedDeviationFromNormalProbability"],"0083":["SQ","GlobalDeviationProbabilitySequence"],"0085":["SQ","LocalizedDeviationProbabilitySequence"],"0086":["CS","FovealSensitivityMeasured"],"0087":["FL","FovealSensitivity"],"0088":["FL","VisualFieldTestDuration"],"0089":["SQ","VisualFieldTestPointSequence"],"0090":["FL","VisualFieldTestPointXCoordinate"],"0091":["FL","VisualFieldTestPointYCoordinate"],"0092":["FL","AgeCorrectedSensitivityDeviationValue"],"0093":["CS","StimulusResults"],"0094":["FL","SensitivityValue"],"0095":["CS","RetestStimulusSeen"],"0096":["FL","RetestSensitivityValue"],"0097":["SQ","VisualFieldTestPointNormalsSequence"],"0098":["FL","QuantifiedDefect"],"0100":["FL","AgeCorrectedSensitivityDeviationProbabilityValue"],"0102":["CS","GeneralizedDefectCorrectedSensitivityDeviationFlag "],"0103":["FL","GeneralizedDefectCorrectedSensitivityDeviationValue "],"0104":["FL","GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue"],"0105":["FL ","MinimumSensitivityValue"],"0106":["CS","BlindSpotLocalized"],"0107":["FL","BlindSpotXCoordinate"],"0108":["FL","BlindSpotYCoordinate "],"0110":["SQ","VisualAcuityMeasurementSequence"],"0112":["SQ","RefractiveParametersUsedOnPatientSequence"],"0113":["CS","MeasurementLaterality"],"0114":["SQ","OphthalmicPatientClinicalInformationLeftEyeSequence"],"0115":["SQ","OphthalmicPatientClinicalInformationRightEyeSequence"],"0117":["CS","FovealPointNormativeDataFlag"],"0118":["FL","FovealPointProbabilityValue"],"0120":["CS","ScreeningBaselineMeasured"],"0122":["SQ","ScreeningBaselineMeasuredSequence"],"0124":["CS","ScreeningBaselineType"],"0126":["FL","ScreeningBaselineValue"],"0202":["LO","AlgorithmSource"],"0306":["LO","DataSetName"],"0307":["LO","DataSetVersion"],"0308":["LO","DataSetSource"],"0309":["LO","DataSetDescription"],"0317":["SQ","VisualFieldTestReliabilityGlobalIndexSequence"],"0320":["SQ","VisualFieldGlobalResultsIndexSequence"],"0325":["SQ","DataObservationSequence"],"0338":["CS","IndexNormalsFlag"],"0341":["FL","IndexProbability"],"0344":["SQ","IndexProbabilitySequence"]},"0028":{"0002":["US","SamplesPerPixel"],"0003":["US","SamplesPerPixelUsed"],"0004":["CS","PhotometricInterpretation"],"0005":["US","ImageDimensions"],"0006":["US","PlanarConfiguration"],"0008":["IS","NumberOfFrames"],"0009":["AT","FrameIncrementPointer"],"000A":["AT","FrameDimensionPointer"],"0010":["US","Rows"],"0011":["US","Columns"],"0012":["US","Planes"],"0014":["US","UltrasoundColorDataPresent"],"0030":["DS","PixelSpacing"],"0031":["DS","ZoomFactor"],"0032":["DS","ZoomCenter"],"0034":["IS","PixelAspectRatio"],"0040":["CS","ImageFormat"],"0050":["LO","ManipulatedImage"],"0051":["CS","CorrectedImage"],"005F":["LO","CompressionRecognitionCode"],"0060":["CS","CompressionCode"],"0061":["SH","CompressionOriginator"],"0062":["LO","CompressionLabel"],"0063":["SH","CompressionDescription"],"0065":["CS","CompressionSequence"],"0066":["AT","CompressionStepPointers"],"0068":["US","RepeatInterval"],"0069":["US","BitsGrouped"],"0070":["US","PerimeterTable"],"0071":["SS","PerimeterValue"],"0080":["US","PredictorRows"],"0081":["US","PredictorColumns"],"0082":["US","PredictorConstants"],"0090":["CS","BlockedPixels"],"0091":["US","BlockRows"],"0092":["US","BlockColumns"],"0093":["US","RowOverlap"],"0094":["US","ColumnOverlap"],"0100":["US","BitsAllocated"],"0101":["US","BitsStored"],"0102":["US","HighBit"],"0103":["US","PixelRepresentation"],"0104":["SS","SmallestValidPixelValue"],"0105":["SS","LargestValidPixelValue"],"0106":["SS","SmallestImagePixelValue"],"0107":["SS","LargestImagePixelValue"],"0108":["SS","SmallestPixelValueInSeries"],"0109":["SS","LargestPixelValueInSeries"],"0110":["SS","SmallestImagePixelValueInPlane"],"0111":["SS","LargestImagePixelValueInPlane"],"0120":["SS","PixelPaddingValue"],"0121":["SS","PixelPaddingRangeLimit"],"0200":["US","ImageLocation"],"0300":["CS","QualityControlImage"],"0301":["CS","BurnedInAnnotation"],"0302":["CS","RecognizableVisualFeatures"],"0303":["CS","LongitudinalTemporalInformationModified"],"0400":["LO","TransformLabel"],"0401":["LO","TransformVersionNumber"],"0402":["US","NumberOfTransformSteps"],"0403":["LO","SequenceOfCompressedData"],"0404":["AT","DetailsOfCoefficients"],"0700":["LO","DCTLabel"],"0701":["CS","DataBlockDescription"],"0702":["AT","DataBlock"],"0710":["US","NormalizationFactorFormat"],"0720":["US","ZonalMapNumberFormat"],"0721":["AT","ZonalMapLocation"],"0722":["US","ZonalMapFormat"],"0730":["US","AdaptiveMapFormat"],"0740":["US","CodeNumberFormat"],"0A02":["CS","PixelSpacingCalibrationType"],"0A04":["LO","PixelSpacingCalibrationDescription"],1040:["CS","PixelIntensityRelationship"],1041:["SS","PixelIntensityRelationshipSign"],1050:["DS","WindowCenter"],1051:["DS","WindowWidth"],1052:["DS","RescaleIntercept"],1053:["DS","RescaleSlope"],1054:["LO","RescaleType"],1055:["LO","WindowCenterWidthExplanation"],1056:["CS","VOILUTFunction"],1080:["CS","GrayScale"],1090:["CS","RecommendedViewingMode"],1100:["SS","GrayLookupTableDescriptor"],1101:["SS","RedPaletteColorLookupTableDescriptor"],1102:["SS","GreenPaletteColorLookupTableDescriptor"],1103:["SS","BluePaletteColorLookupTableDescriptor"],1104:["US","AlphaPaletteColorLookupTableDescriptor"],1111:["SS","LargeRedPaletteColorLookupTableDescriptor"],1112:["SS","LargeGreenPaletteColorLookupTableDescriptor"],1113:["SS","LargeBluePaletteColorLookupTableDescriptor"],1199:["UI","PaletteColorLookupTableUID"],1200:["OW","GrayLookupTableData"],1201:["OW","RedPaletteColorLookupTableData"],1202:["OW","GreenPaletteColorLookupTableData"],1203:["OW","BluePaletteColorLookupTableData"],1204:["OW","AlphaPaletteColorLookupTableData"],1211:["OW","LargeRedPaletteColorLookupTableData"],1212:["OW","LargeGreenPaletteColorLookupTableData"],1213:["OW","LargeBluePaletteColorLookupTableData"],1214:["UI","LargePaletteColorLookupTableUID"],1221:["OW","SegmentedRedPaletteColorLookupTableData"],1222:["OW","SegmentedGreenPaletteColorLookupTableData"],1223:["OW","SegmentedBluePaletteColorLookupTableData"],1300:["CS","BreastImplantPresent"],1350:["CS","PartialView"],1351:["ST","PartialViewDescription"],1352:["SQ","PartialViewCodeSequence"],"135A":["CS","SpatialLocationsPreserved"],1401:["SQ","DataFrameAssignmentSequence"],1402:["CS","DataPathAssignment"],1403:["US","BitsMappedToColorLookupTable"],1404:["SQ","BlendingLUT1Sequence"],1405:["CS","BlendingLUT1TransferFunction"],1406:["FD","BlendingWeightConstant"],1407:["US","BlendingLookupTableDescriptor"],1408:["OW","BlendingLookupTableData"],"140B":["SQ","EnhancedPaletteColorLookupTableSequence"],"140C":["SQ","BlendingLUT2Sequence"],"140D":["CS","BlendingLUT2TransferFunction"],"140E":["CS","DataPathID"],"140F":["CS","RGBLUTTransferFunction"],1410:["CS","AlphaLUTTransferFunction"],2e3:["OB","ICCProfile"],2110:["CS","LossyImageCompression"],2112:["DS","LossyImageCompressionRatio"],2114:["CS","LossyImageCompressionMethod"],3e3:["SQ","ModalityLUTSequence"],3002:["SS","LUTDescriptor"],3003:["LO","LUTExplanation"],3004:["LO","ModalityLUTType"],3006:["OW","LUTData"],3010:["SQ","VOILUTSequence"],3110:["SQ","SoftcopyVOILUTSequence"],4e3:["LT","ImagePresentationComments"],5e3:["SQ","BiPlaneAcquisitionSequence"],6010:["US","RepresentativeFrameNumber"],6020:["US","FrameNumbersOfInterest"],6022:["LO","FrameOfInterestDescription"],6023:["CS","FrameOfInterestType"],6030:["US","MaskPointers"],6040:["US","RWavePointer"],6100:["SQ","MaskSubtractionSequence"],6101:["CS","MaskOperation"],6102:["US","ApplicableFrameRange"],6110:["US","MaskFrameNumbers"],6112:["US","ContrastFrameAveraging"],6114:["FL","MaskSubPixelShift"],6120:["SS","TIDOffset"],6190:["ST","MaskOperationExplanation"],"7FE0":["UT","PixelDataProviderURL"],9001:["UL","DataPointRows"],9002:["UL","DataPointColumns"],9003:["CS","SignalDomainColumns"],9099:["US","LargestMonochromePixelValue"],9108:["CS","DataRepresentation"],9110:["SQ","PixelMeasuresSequence"],9132:["SQ","FrameVOILUTSequence"],9145:["SQ","PixelValueTransformationSequence"],9235:["CS","SignalDomainRows"],9411:["FL","DisplayFilterPercentage"],9415:["SQ","FramePixelShiftSequence"],9416:["US","SubtractionItemID"],9422:["SQ","PixelIntensityRelationshipLUTSequence"],9443:["SQ","FramePixelDataPropertiesSequence"],9444:["CS","GeometricalProperties"],9445:["FL","GeometricMaximumDistortion"],9446:["CS","ImageProcessingApplied"],9454:["CS","MaskSelectionMode"],9474:["CS","LUTFunction"],9478:["FL","MaskVisibilityPercentage"],9501:["SQ","PixelShiftSequence"],9502:["SQ","RegionPixelShiftSequence"],9503:["SS","VerticesOfTheRegion"],9505:["SQ","MultiFramePresentationSequence"],9506:["US","PixelShiftFrameRange"],9507:["US","LUTFrameRange"],9520:["DS","ImageToEquipmentMappingMatrix"],9537:["CS","EquipmentCoordinateSystemIdentification"]},"0032":{"000A":["CS","StudyStatusID"],"000C":["CS","StudyPriorityID"],"0012":["LO","StudyIDIssuer"],"0032":["DA","StudyVerifiedDate"],"0033":["TM","StudyVerifiedTime"],"0034":["DA","StudyReadDate"],"0035":["TM","StudyReadTime"],1e3:["DA","ScheduledStudyStartDate"],1001:["TM","ScheduledStudyStartTime"],1010:["DA","ScheduledStudyStopDate"],1011:["TM","ScheduledStudyStopTime"],1020:["LO","ScheduledStudyLocation"],1021:["AE","ScheduledStudyLocationAETitle"],1030:["LO","ReasonForStudy"],1031:["SQ","RequestingPhysicianIdentificationSequence"],1032:["PN","RequestingPhysician"],1033:["LO","RequestingService"],1034:["SQ","RequestingServiceCodeSequence"],1040:["DA","StudyArrivalDate"],1041:["TM","StudyArrivalTime"],1050:["DA","StudyCompletionDate"],1051:["TM","StudyCompletionTime"],1055:["CS","StudyComponentStatusID"],1060:["LO","RequestedProcedureDescription"],1064:["SQ","RequestedProcedureCodeSequence"],1070:["LO","RequestedContrastAgent"],4e3:["LT","StudyComments"]},"0038":{"0004":["SQ","ReferencedPatientAliasSequence"],"0008":["CS","VisitStatusID"],"0010":["LO","AdmissionID"],"0011":["LO","IssuerOfAdmissionID"],"0014":["SQ","IssuerOfAdmissionIDSequence"],"0016":["LO","RouteOfAdmissions"],"001A":["DA","ScheduledAdmissionDate"],"001B":["TM","ScheduledAdmissionTime"],"001C":["DA","ScheduledDischargeDate"],"001D":["TM","ScheduledDischargeTime"],"001E":["LO","ScheduledPatientInstitutionResidence"],"0020":["DA","AdmittingDate"],"0021":["TM","AdmittingTime"],"0030":["DA","DischargeDate"],"0032":["TM","DischargeTime"],"0040":["LO","DischargeDiagnosisDescription"],"0044":["SQ","DischargeDiagnosisCodeSequence"],"0050":["LO","SpecialNeeds"],"0060":["LO","ServiceEpisodeID"],"0061":["LO","IssuerOfServiceEpisodeID"],"0062":["LO","ServiceEpisodeDescription"],"0064":["SQ","IssuerOfServiceEpisodeIDSequence"],"0100":["SQ","PertinentDocumentsSequence"],"0300":["LO","CurrentPatientLocation"],"0400":["LO","PatientInstitutionResidence"],"0500":["LO","PatientState"],"0502":["SQ","PatientClinicalTrialParticipationSequence"],4e3:["LT","VisitComments"]},"003A":{"0004":["CS","WaveformOriginality"],"0005":["US","NumberOfWaveformChannels"],"0010":["UL","NumberOfWaveformSamples"],"001A":["DS","SamplingFrequency"],"0020":["SH","MultiplexGroupLabel"],"0200":["SQ","ChannelDefinitionSequence"],"0202":["IS","WaveformChannelNumber"],"0203":["SH","ChannelLabel"],"0205":["CS","ChannelStatus"],"0208":["SQ","ChannelSourceSequence"],"0209":["SQ","ChannelSourceModifiersSequence"],"020A":["SQ","SourceWaveformSequence"],"020C":["LO","ChannelDerivationDescription"],"0210":["DS","ChannelSensitivity"],"0211":["SQ","ChannelSensitivityUnitsSequence"],"0212":["DS","ChannelSensitivityCorrectionFactor"],"0213":["DS","ChannelBaseline"],"0214":["DS","ChannelTimeSkew"],"0215":["DS","ChannelSampleSkew"],"0218":["DS","ChannelOffset"],"021A":["US","WaveformBitsStored"],"0220":["DS","FilterLowFrequency"],"0221":["DS","FilterHighFrequency"],"0222":["DS","NotchFilterFrequency"],"0223":["DS","NotchFilterBandwidth"],"0230":["FL","WaveformDataDisplayScale"],"0231":["US","WaveformDisplayBackgroundCIELabValue"],"0240":["SQ","WaveformPresentationGroupSequence"],"0241":["US","PresentationGroupNumber"],"0242":["SQ","ChannelDisplaySequence"],"0244":["US","ChannelRecommendedDisplayCIELabValue"],"0245":["FL","ChannelPosition"],"0246":["CS","DisplayShadingFlag"],"0247":["FL","FractionalChannelDisplayScale"],"0248":["FL","AbsoluteChannelDisplayScale"],"0300":["SQ","MultiplexedAudioChannelsDescriptionCodeSequence"],"0301":["IS","ChannelIdentificationCode"],"0302":["CS","ChannelMode"]},"0040":{"0001":["AE","ScheduledStationAETitle"],"0002":["DA","ScheduledProcedureStepStartDate"],"0003":["TM","ScheduledProcedureStepStartTime"],"0004":["DA","ScheduledProcedureStepEndDate"],"0005":["TM","ScheduledProcedureStepEndTime"],"0006":["PN","ScheduledPerformingPhysicianName"],"0007":["LO","ScheduledProcedureStepDescription"],"0008":["SQ","ScheduledProtocolCodeSequence"],"0009":["SH","ScheduledProcedureStepID"],"000A":["SQ","StageCodeSequence"],"000B":["SQ","ScheduledPerformingPhysicianIdentificationSequence"],"0010":["SH","ScheduledStationName"],"0011":["SH","ScheduledProcedureStepLocation"],"0012":["LO","PreMedication"],"0020":["CS","ScheduledProcedureStepStatus"],"0026":["SQ","OrderPlacerIdentifierSequence"],"0027":["SQ","OrderFillerIdentifierSequence"],"0031":["UT","LocalNamespaceEntityID"],"0032":["UT","UniversalEntityID"],"0033":["CS","UniversalEntityIDType"],"0035":["CS","IdentifierTypeCode"],"0036":["SQ","AssigningFacilitySequence"],"0039":["SQ","AssigningJurisdictionCodeSequence"],"003A":["SQ","AssigningAgencyOrDepartmentCodeSequence"],"0100":["SQ","ScheduledProcedureStepSequence"],"0220":["SQ","ReferencedNonImageCompositeSOPInstanceSequence"],"0241":["AE","PerformedStationAETitle"],"0242":["SH","PerformedStationName"],"0243":["SH","PerformedLocation"],"0244":["DA","PerformedProcedureStepStartDate"],"0245":["TM","PerformedProcedureStepStartTime"],"0250":["DA","PerformedProcedureStepEndDate"],"0251":["TM","PerformedProcedureStepEndTime"],"0252":["CS","PerformedProcedureStepStatus"],"0253":["SH","PerformedProcedureStepID"],"0254":["LO","PerformedProcedureStepDescription"],"0255":["LO","PerformedProcedureTypeDescription"],"0260":["SQ","PerformedProtocolCodeSequence"],"0261":["CS","PerformedProtocolType"],"0270":["SQ","ScheduledStepAttributesSequence"],"0275":["SQ","RequestAttributesSequence"],"0280":["ST","CommentsOnThePerformedProcedureStep"],"0281":["SQ","PerformedProcedureStepDiscontinuationReasonCodeSequence"],"0293":["SQ","QuantitySequence"],"0294":["DS","Quantity"],"0295":["SQ","MeasuringUnitsSequence"],"0296":["SQ","BillingItemSequence"],"0300":["US","TotalTimeOfFluoroscopy"],"0301":["US","TotalNumberOfExposures"],"0302":["US","EntranceDose"],"0303":["US","ExposedArea"],"0306":["DS","DistanceSourceToEntrance"],"0307":["DS","DistanceSourceToSupport"],"030E":["SQ","ExposureDoseSequence"],"0310":["ST","CommentsOnRadiationDose"],"0312":["DS","XRayOutput"],"0314":["DS","HalfValueLayer"],"0316":["DS","OrganDose"],"0318":["CS","OrganExposed"],"0320":["SQ","BillingProcedureStepSequence"],"0321":["SQ","FilmConsumptionSequence"],"0324":["SQ","BillingSuppliesAndDevicesSequence"],"0330":["SQ","ReferencedProcedureStepSequence"],"0340":["SQ","PerformedSeriesSequence"],"0400":["LT","CommentsOnTheScheduledProcedureStep"],"0440":["SQ","ProtocolContextSequence"],"0441":["SQ","ContentItemModifierSequence"],"0500":["SQ","ScheduledSpecimenSequence"],"050A":["LO","SpecimenAccessionNumber"],"0512":["LO","ContainerIdentifier"],"0513":["SQ","IssuerOfTheContainerIdentifierSequence"],"0515":["SQ","AlternateContainerIdentifierSequence"],"0518":["SQ","ContainerTypeCodeSequence"],"051A":["LO","ContainerDescription"],"0520":["SQ","ContainerComponentSequence"],"0550":["SQ","SpecimenSequence"],"0551":["LO","SpecimenIdentifier"],"0552":["SQ","SpecimenDescriptionSequenceTrial"],"0553":["ST","SpecimenDescriptionTrial"],"0554":["UI","SpecimenUID"],"0555":["SQ","AcquisitionContextSequence"],"0556":["ST","AcquisitionContextDescription"],"059A":["SQ","SpecimenTypeCodeSequence"],"0560":["SQ","SpecimenDescriptionSequence"],"0562":["SQ","IssuerOfTheSpecimenIdentifierSequence"],"0600":["LO","SpecimenShortDescription"],"0602":["UT","SpecimenDetailedDescription"],"0610":["SQ","SpecimenPreparationSequence"],"0612":["SQ","SpecimenPreparationStepContentItemSequence"],"0620":["SQ","SpecimenLocalizationContentItemSequence"],"06FA":["LO","SlideIdentifier"],"071A":["SQ","ImageCenterPointCoordinatesSequence"],"072A":["DS","XOffsetInSlideCoordinateSystem"],"073A":["DS","YOffsetInSlideCoordinateSystem"],"074A":["DS","ZOffsetInSlideCoordinateSystem"],"08D8":["SQ","PixelSpacingSequence"],"08DA":["SQ","CoordinateSystemAxisCodeSequence"],"08EA":["SQ","MeasurementUnitsCodeSequence"],"09F8":["SQ","VitalStainCodeSequenceTrial"],1001:["SH","RequestedProcedureID"],1002:["LO","ReasonForTheRequestedProcedure"],1003:["SH","RequestedProcedurePriority"],1004:["LO","PatientTransportArrangements"],1005:["LO","RequestedProcedureLocation"],1006:["SH","PlacerOrderNumberProcedure"],1007:["SH","FillerOrderNumberProcedure"],1008:["LO","ConfidentialityCode"],1009:["SH","ReportingPriority"],"100A":["SQ","ReasonForRequestedProcedureCodeSequence"],1010:["PN","NamesOfIntendedRecipientsOfResults"],1011:["SQ","IntendedRecipientsOfResultsIdentificationSequence"],1012:["SQ","ReasonForPerformedProcedureCodeSequence"],1060:["LO","RequestedProcedureDescriptionTrial"],1101:["SQ","PersonIdentificationCodeSequence"],1102:["ST","PersonAddress"],1103:["LO","PersonTelephoneNumbers"],1400:["LT","RequestedProcedureComments"],2001:["LO","ReasonForTheImagingServiceRequest"],2004:["DA","IssueDateOfImagingServiceRequest"],2005:["TM","IssueTimeOfImagingServiceRequest"],2006:["SH","PlacerOrderNumberImagingServiceRequestRetired"],2007:["SH","FillerOrderNumberImagingServiceRequestRetired"],2008:["PN","OrderEnteredBy"],2009:["SH","OrderEntererLocation"],2010:["SH","OrderCallbackPhoneNumber"],2016:["LO","PlacerOrderNumberImagingServiceRequest"],2017:["LO","FillerOrderNumberImagingServiceRequest"],2400:["LT","ImagingServiceRequestComments"],3001:["LO","ConfidentialityConstraintOnPatientDataDescription"],4001:["CS","GeneralPurposeScheduledProcedureStepStatus"],4002:["CS","GeneralPurposePerformedProcedureStepStatus"],4003:["CS","GeneralPurposeScheduledProcedureStepPriority"],4004:["SQ","ScheduledProcessingApplicationsCodeSequence"],4005:["DT","ScheduledProcedureStepStartDateTime"],4006:["CS","MultipleCopiesFlag"],4007:["SQ","PerformedProcessingApplicationsCodeSequence"],4009:["SQ","HumanPerformerCodeSequence"],4010:["DT","ScheduledProcedureStepModificationDateTime"],4011:["DT","ExpectedCompletionDateTime"],4015:["SQ","ResultingGeneralPurposePerformedProcedureStepsSequence"],4016:["SQ","ReferencedGeneralPurposeScheduledProcedureStepSequence"],4018:["SQ","ScheduledWorkitemCodeSequence"],4019:["SQ","PerformedWorkitemCodeSequence"],4020:["CS","InputAvailabilityFlag"],4021:["SQ","InputInformationSequence"],4022:["SQ","RelevantInformationSequence"],4023:["UI","ReferencedGeneralPurposeScheduledProcedureStepTransactionUID"],4025:["SQ","ScheduledStationNameCodeSequence"],4026:["SQ","ScheduledStationClassCodeSequence"],4027:["SQ","ScheduledStationGeographicLocationCodeSequence"],4028:["SQ","PerformedStationNameCodeSequence"],4029:["SQ","PerformedStationClassCodeSequence"],4030:["SQ","PerformedStationGeographicLocationCodeSequence"],4031:["SQ","RequestedSubsequentWorkitemCodeSequence"],4032:["SQ","NonDICOMOutputCodeSequence"],4033:["SQ","OutputInformationSequence"],4034:["SQ","ScheduledHumanPerformersSequence"],4035:["SQ","ActualHumanPerformersSequence"],4036:["LO","HumanPerformerOrganization"],4037:["PN","HumanPerformerName"],4040:["CS","RawDataHandling"],4041:["CS","InputReadinessState"],4050:["DT","PerformedProcedureStepStartDateTime"],4051:["DT","PerformedProcedureStepEndDateTime"],4052:["DT","ProcedureStepCancellationDateTime"],8302:["DS","EntranceDoseInmGy"],9094:["SQ","ReferencedImageRealWorldValueMappingSequence"],9096:["SQ","RealWorldValueMappingSequence"],9098:["SQ","PixelValueMappingCodeSequence"],9210:["SH","LUTLabel"],9211:["SS","RealWorldValueLastValueMapped"],9212:["FD","RealWorldValueLUTData"],9216:["SS","RealWorldValueFirstValueMapped"],9224:["FD","RealWorldValueIntercept"],9225:["FD","RealWorldValueSlope"],A007:["CS","FindingsFlagTrial"],A010:["CS","RelationshipType"],A020:["SQ","FindingsSequenceTrial"],A021:["UI","FindingsGroupUIDTrial"],A022:["UI","ReferencedFindingsGroupUIDTrial"],A023:["DA","FindingsGroupRecordingDateTrial"],A024:["TM","FindingsGroupRecordingTimeTrial"],A026:["SQ","FindingsSourceCategoryCodeSequenceTrial"],A027:["LO","VerifyingOrganization"],A028:["SQ","DocumentingOrganizationIdentifierCodeSequenceTrial"],A030:["DT","VerificationDateTime"],A032:["DT","ObservationDateTime"],A040:["CS","ValueType"],A043:["SQ","ConceptNameCodeSequence"],A047:["LO","MeasurementPrecisionDescriptionTrial"],A050:["CS","ContinuityOfContent"],A057:["CS","UrgencyOrPriorityAlertsTrial"],A060:["LO","SequencingIndicatorTrial"],A066:["SQ","DocumentIdentifierCodeSequenceTrial"],A067:["PN","DocumentAuthorTrial"],A068:["SQ","DocumentAuthorIdentifierCodeSequenceTrial"],A070:["SQ","IdentifierCodeSequenceTrial"],A073:["SQ","VerifyingObserverSequence"],A074:["OB","ObjectBinaryIdentifierTrial"],A075:["PN","VerifyingObserverName"],A076:["SQ","DocumentingObserverIdentifierCodeSequenceTrial"],A078:["SQ","AuthorObserverSequence"],A07A:["SQ","ParticipantSequence"],A07C:["SQ","CustodialOrganizationSequence"],A080:["CS","ParticipationType"],A082:["DT","ParticipationDateTime"],A084:["CS","ObserverType"],A085:["SQ","ProcedureIdentifierCodeSequenceTrial"],A088:["SQ","VerifyingObserverIdentificationCodeSequence"],A089:["OB","ObjectDirectoryBinaryIdentifierTrial"],A090:["SQ","EquivalentCDADocumentSequence"],A0B0:["US","ReferencedWaveformChannels"],A110:["DA","DateOfDocumentOrVerbalTransactionTrial"],A112:["TM","TimeOfDocumentCreationOrVerbalTransactionTrial"],A120:["DT","DateTime"],A121:["DA","Date"],A122:["TM","Time"],A123:["PN","PersonName"],A124:["UI","UID"],A125:["CS","ReportStatusIDTrial"],A130:["CS","TemporalRangeType"],A132:["UL","ReferencedSamplePositions"],A136:["US","ReferencedFrameNumbers"],A138:["DS","ReferencedTimeOffsets"],A13A:["DT","ReferencedDateTime"],A160:["UT","TextValue"],A167:["SQ","ObservationCategoryCodeSequenceTrial"],A168:["SQ","ConceptCodeSequence"],A16A:["ST","BibliographicCitationTrial"],A170:["SQ","PurposeOfReferenceCodeSequence"],A171:["UI","ObservationUIDTrial"],A172:["UI","ReferencedObservationUIDTrial"],A173:["CS","ReferencedObservationClassTrial"],A174:["CS","ReferencedObjectObservationClassTrial"],A180:["US","AnnotationGroupNumber"],A192:["DA","ObservationDateTrial"],A193:["TM","ObservationTimeTrial"],A194:["CS","MeasurementAutomationTrial"],A195:["SQ","ModifierCodeSequence"],A224:["ST","IdentificationDescriptionTrial"],A290:["CS","CoordinatesSetGeometricTypeTrial"],A296:["SQ","AlgorithmCodeSequenceTrial"],A297:["ST","AlgorithmDescriptionTrial"],A29A:["SL","PixelCoordinatesSetTrial"],A300:["SQ","MeasuredValueSequence"],A301:["SQ","NumericValueQualifierCodeSequence"],A307:["PN","CurrentObserverTrial"],A30A:["DS","NumericValue"],A313:["SQ","ReferencedAccessionSequenceTrial"],A33A:["ST","ReportStatusCommentTrial"],A340:["SQ","ProcedureContextSequenceTrial"],A352:["PN","VerbalSourceTrial"],A353:["ST","AddressTrial"],A354:["LO","TelephoneNumberTrial"],A358:["SQ","VerbalSourceIdentifierCodeSequenceTrial"],A360:["SQ","PredecessorDocumentsSequence"],A370:["SQ","ReferencedRequestSequence"],A372:["SQ","PerformedProcedureCodeSequence"],A375:["SQ","CurrentRequestedProcedureEvidenceSequence"],A380:["SQ","ReportDetailSequenceTrial"],A385:["SQ","PertinentOtherEvidenceSequence"],A390:["SQ","HL7StructuredDocumentReferenceSequence"],A402:["UI","ObservationSubjectUIDTrial"],A403:["CS","ObservationSubjectClassTrial"],A404:["SQ","ObservationSubjectTypeCodeSequenceTrial"],A491:["CS","CompletionFlag"],A492:["LO","CompletionFlagDescription"],A493:["CS","VerificationFlag"],A494:["CS","ArchiveRequested"],A496:["CS","PreliminaryFlag"],A504:["SQ","ContentTemplateSequence"],A525:["SQ","IdenticalDocumentsSequence"],A600:["CS","ObservationSubjectContextFlagTrial"],A601:["CS","ObserverContextFlagTrial"],A603:["CS","ProcedureContextFlagTrial"],A730:["SQ","ContentSequence"],A731:["SQ","RelationshipSequenceTrial"],A732:["SQ","RelationshipTypeCodeSequenceTrial"],A744:["SQ","LanguageCodeSequenceTrial"],A992:["ST","UniformResourceLocatorTrial"],B020:["SQ","WaveformAnnotationSequence"],DB00:["CS","TemplateIdentifier"],DB06:["DT","TemplateVersion"],DB07:["DT","TemplateLocalVersion"],DB0B:["CS","TemplateExtensionFlag"],DB0C:["UI","TemplateExtensionOrganizationUID"],DB0D:["UI","TemplateExtensionCreatorUID"],DB73:["UL","ReferencedContentItemIdentifier"],E001:["ST","HL7InstanceIdentifier"],E004:["DT","HL7DocumentEffectiveTime"],E006:["SQ","HL7DocumentTypeCodeSequence"],E008:["SQ","DocumentClassCodeSequence"],E010:["UT","RetrieveURI"],E011:["UI","RetrieveLocationUID"],E020:["CS","TypeOfInstances"],E021:["SQ","DICOMRetrievalSequence"],E022:["SQ","DICOMMediaRetrievalSequence"],E023:["SQ","WADORetrievalSequence"],E024:["SQ","XDSRetrievalSequence"],E030:["UI","RepositoryUniqueID"],E031:["UI","HomeCommunityID"]},"0042":{"0010":["ST","DocumentTitle"],"0011":["OB","EncapsulatedDocument"],"0012":["LO","MIMETypeOfEncapsulatedDocument"],"0013":["SQ","SourceInstanceSequence"],"0014":["LO","ListOfMIMETypes"]},"0044":{"0001":["ST","ProductPackageIdentifier"],"0002":["CS","SubstanceAdministrationApproval"],"0003":["LT","ApprovalStatusFurtherDescription"],"0004":["DT","ApprovalStatusDateTime"],"0007":["SQ","ProductTypeCodeSequence"],"0008":["LO","ProductName"],"0009":["LT","ProductDescription"],"000A":["LO","ProductLotIdentifier"],"000B":["DT","ProductExpirationDateTime"],"0010":["DT","SubstanceAdministrationDateTime"],"0011":["LO","SubstanceAdministrationNotes"],"0012":["LO","SubstanceAdministrationDeviceID"],"0013":["SQ","ProductParameterSequence"],"0019":["SQ","SubstanceAdministrationParameterSequence"]},"0046":{"0012":["LO","LensDescription"],"0014":["SQ","RightLensSequence"],"0015":["SQ","LeftLensSequence"],"0016":["SQ","UnspecifiedLateralityLensSequence"],"0018":["SQ","CylinderSequence"],"0028":["SQ","PrismSequence"],"0030":["FD","HorizontalPrismPower"],"0032":["CS","HorizontalPrismBase"],"0034":["FD","VerticalPrismPower"],"0036":["CS","VerticalPrismBase"],"0038":["CS","LensSegmentType"],"0040":["FD","OpticalTransmittance"],"0042":["FD","ChannelWidth"],"0044":["FD","PupilSize"],"0046":["FD","CornealSize"],"0050":["SQ","AutorefractionRightEyeSequence"],"0052":["SQ","AutorefractionLeftEyeSequence"],"0060":["FD","DistancePupillaryDistance"],"0062":["FD","NearPupillaryDistance"],"0063":["FD","IntermediatePupillaryDistance"],"0064":["FD","OtherPupillaryDistance"],"0070":["SQ","KeratometryRightEyeSequence"],"0071":["SQ","KeratometryLeftEyeSequence"],"0074":["SQ","SteepKeratometricAxisSequence"],"0075":["FD","RadiusOfCurvature"],"0076":["FD","KeratometricPower"],"0077":["FD","KeratometricAxis"],"0080":["SQ","FlatKeratometricAxisSequence"],"0092":["CS","BackgroundColor"],"0094":["CS","Optotype"],"0095":["CS","OptotypePresentation"],"0097":["SQ","SubjectiveRefractionRightEyeSequence"],"0098":["SQ","SubjectiveRefractionLeftEyeSequence"],"0100":["SQ","AddNearSequence"],"0101":["SQ","AddIntermediateSequence"],"0102":["SQ","AddOtherSequence"],"0104":["FD","AddPower"],"0106":["FD","ViewingDistance"],"0121":["SQ","VisualAcuityTypeCodeSequence"],"0122":["SQ","VisualAcuityRightEyeSequence"],"0123":["SQ","VisualAcuityLeftEyeSequence"],"0124":["SQ","VisualAcuityBothEyesOpenSequence"],"0125":["CS","ViewingDistanceType"],"0135":["SS","VisualAcuityModifiers"],"0137":["FD","DecimalVisualAcuity"],"0139":["LO","OptotypeDetailedDefinition"],"0145":["SQ","ReferencedRefractiveMeasurementsSequence"],"0146":["FD","SpherePower"],"0147":["FD","CylinderPower"]},"0048":{"0001":["FL","ImagedVolumeWidth"],"0002":["FL","ImagedVolumeHeight"],"0003":["FL","ImagedVolumeDepth"],"0006":["UL","TotalPixelMatrixColumns"],"0007":["UL","TotalPixelMatrixRows"],"0008":["SQ","TotalPixelMatrixOriginSequence"],"0010":["CS","SpecimenLabelInImage"],"0011":["CS","FocusMethod"],"0012":["CS","ExtendedDepthOfField"],"0013":["US","NumberOfFocalPlanes"],"0014":["FL","DistanceBetweenFocalPlanes"],"0015":["US","RecommendedAbsentPixelCIELabValue"],"0100":["SQ","IlluminatorTypeCodeSequence"],"0102":["DS","ImageOrientationSlide"],"0105":["SQ","OpticalPathSequence"],"0106":["SH","OpticalPathIdentifier"],"0107":["ST","OpticalPathDescription"],"0108":["SQ","IlluminationColorCodeSequence"],"0110":["SQ","SpecimenReferenceSequence"],"0111":["DS","CondenserLensPower"],"0112":["DS","ObjectiveLensPower"],"0113":["DS","ObjectiveLensNumericalAperture"],"0120":["SQ","PaletteColorLookupTableSequence"],"0200":["SQ","ReferencedImageNavigationSequence"],"0201":["US","TopLeftHandCornerOfLocalizerArea"],"0202":["US","BottomRightHandCornerOfLocalizerArea"],"0207":["SQ","OpticalPathIdentificationSequence"],"021A":["SQ","PlanePositionSlideSequence"],"021E":["SL","RowPositionInTotalImagePixelMatrix"],"021F":["SL","ColumnPositionInTotalImagePixelMatrix"],"0301":["CS","PixelOriginInterpretation"]},"0050":{"0004":["CS","CalibrationImage"],"0010":["SQ","DeviceSequence"],"0012":["SQ","ContainerComponentTypeCodeSequence"],"0013":["FD","ContainerComponentThickness"],"0014":["DS","DeviceLength"],"0015":["FD","ContainerComponentWidth"],"0016":["DS","DeviceDiameter"],"0017":["CS","DeviceDiameterUnits"],"0018":["DS","DeviceVolume"],"0019":["DS","InterMarkerDistance"],"001A":["CS","ContainerComponentMaterial"],"001B":["LO","ContainerComponentID"],"001C":["FD","ContainerComponentLength"],"001D":["FD","ContainerComponentDiameter"],"001E":["LO","ContainerComponentDescription"],"0020":["LO","DeviceDescription"]},"0052":{"0001":["FL","ContrastBolusIngredientPercentByVolume"],"0002":["FD","OCTFocalDistance"],"0003":["FD","BeamSpotSize"],"0004":["FD","EffectiveRefractiveIndex"],"0006":["CS","OCTAcquisitionDomain"],"0007":["FD","OCTOpticalCenterWavelength"],"0008":["FD","AxialResolution"],"0009":["FD","RangingDepth"],"0011":["FD","ALineRate"],"0012":["US","ALinesPerFrame"],"0013":["FD","CatheterRotationalRate"],"0014":["FD","ALinePixelSpacing"],"0016":["SQ","ModeOfPercutaneousAccessSequence"],"0025":["SQ","IntravascularOCTFrameTypeSequence"],"0026":["CS","OCTZOffsetApplied"],"0027":["SQ","IntravascularFrameContentSequence"],"0028":["FD","IntravascularLongitudinalDistance"],"0029":["SQ","IntravascularOCTFrameContentSequence"],"0030":["SS","OCTZOffsetCorrection"],"0031":["CS","CatheterDirectionOfRotation"],"0033":["FD","SeamLineLocation"],"0034":["FD","FirstALineLocation"],"0036":["US","SeamLineIndex"],"0038":["US","NumberOfPaddedAlines"],"0039":["CS","InterpolationType"],"003A":["CS","RefractiveIndexApplied"]},"0054":{"0010":["US","EnergyWindowVector"],"0011":["US","NumberOfEnergyWindows"],"0012":["SQ","EnergyWindowInformationSequence"],"0013":["SQ","EnergyWindowRangeSequence"],"0014":["DS","EnergyWindowLowerLimit"],"0015":["DS","EnergyWindowUpperLimit"],"0016":["SQ","RadiopharmaceuticalInformationSequence"],"0017":["IS","ResidualSyringeCounts"],"0018":["SH","EnergyWindowName"],"0020":["US","DetectorVector"],"0021":["US","NumberOfDetectors"],"0022":["SQ","DetectorInformationSequence"],"0030":["US","PhaseVector"],"0031":["US","NumberOfPhases"],"0032":["SQ","PhaseInformationSequence"],"0033":["US","NumberOfFramesInPhase"],"0036":["IS","PhaseDelay"],"0038":["IS","PauseBetweenFrames"],"0039":["CS","PhaseDescription"],"0050":["US","RotationVector"],"0051":["US","NumberOfRotations"],"0052":["SQ","RotationInformationSequence"],"0053":["US","NumberOfFramesInRotation"],"0060":["US","RRIntervalVector"],"0061":["US","NumberOfRRIntervals"],"0062":["SQ","GatedInformationSequence"],"0063":["SQ","DataInformationSequence"],"0070":["US","TimeSlotVector"],"0071":["US","NumberOfTimeSlots"],"0072":["SQ","TimeSlotInformationSequence"],"0073":["DS","TimeSlotTime"],"0080":["US","SliceVector"],"0081":["US","NumberOfSlices"],"0090":["US","AngularViewVector"],"0100":["US","TimeSliceVector"],"0101":["US","NumberOfTimeSlices"],"0200":["DS","StartAngle"],"0202":["CS","TypeOfDetectorMotion"],"0210":["IS","TriggerVector"],"0211":["US","NumberOfTriggersInPhase"],"0220":["SQ","ViewCodeSequence"],"0222":["SQ","ViewModifierCodeSequence"],"0300":["SQ","RadionuclideCodeSequence"],"0302":["SQ","AdministrationRouteCodeSequence"],"0304":["SQ","RadiopharmaceuticalCodeSequence"],"0306":["SQ","CalibrationDataSequence"],"0308":["US","EnergyWindowNumber"],"0400":["SH","ImageID"],"0410":["SQ","PatientOrientationCodeSequence"],"0412":["SQ","PatientOrientationModifierCodeSequence"],"0414":["SQ","PatientGantryRelationshipCodeSequence"],"0500":["CS","SliceProgressionDirection"],1e3:["CS","SeriesType"],1001:["CS","Units"],1002:["CS","CountsSource"],1004:["CS","ReprojectionMethod"],1006:["CS","SUVType"],1100:["CS","RandomsCorrectionMethod"],1101:["LO","AttenuationCorrectionMethod"],1102:["CS","DecayCorrection"],1103:["LO","ReconstructionMethod"],1104:["LO","DetectorLinesOfResponseUsed"],1105:["LO","ScatterCorrectionMethod"],1200:["DS","AxialAcceptance"],1201:["IS","AxialMash"],1202:["IS","TransverseMash"],1203:["DS","DetectorElementSize"],1210:["DS","CoincidenceWindowWidth"],1220:["CS","SecondaryCountsType"],1300:["DS","FrameReferenceTime"],1310:["IS","PrimaryPromptsCountsAccumulated"],1311:["IS","SecondaryCountsAccumulated"],1320:["DS","SliceSensitivityFactor"],1321:["DS","DecayFactor"],1322:["DS","DoseCalibrationFactor"],1323:["DS","ScatterFractionFactor"],1324:["DS","DeadTimeFactor"],1330:["US","ImageIndex"],1400:["CS","CountsIncluded"],1401:["CS","DeadTimeCorrectionFlag"]},"0060":{3e3:["SQ","HistogramSequence"],3002:["US","HistogramNumberOfBins"],3004:["SS","HistogramFirstBinValue"],3006:["SS","HistogramLastBinValue"],3008:["US","HistogramBinWidth"],3010:["LO","HistogramExplanation"],3020:["UL","HistogramData"]},"0062":{"0001":["CS","SegmentationType"],"0002":["SQ","SegmentSequence"],"0003":["SQ","SegmentedPropertyCategoryCodeSequence"],"0004":["US","SegmentNumber"],"0005":["LO","SegmentLabel"],"0006":["ST","SegmentDescription"],"0008":["CS","SegmentAlgorithmType"],"0009":["LO","SegmentAlgorithmName"],"000A":["SQ","SegmentIdentificationSequence"],"000B":["US","ReferencedSegmentNumber"],"000C":["US","RecommendedDisplayGrayscaleValue"],"000D":["US","RecommendedDisplayCIELabValue"],"000E":["US","MaximumFractionalValue"],"000F":["SQ","SegmentedPropertyTypeCodeSequence"],"0010":["CS","SegmentationFractionalType"]},"0064":{"0002":["SQ","DeformableRegistrationSequence"],"0003":["UI","SourceFrameOfReferenceUID"],"0005":["SQ","DeformableRegistrationGridSequence"],"0007":["UL","GridDimensions"],"0008":["FD","GridResolution"],"0009":["OF","VectorGridData"],"000F":["SQ","PreDeformationMatrixRegistrationSequence"],"0010":["SQ","PostDeformationMatrixRegistrationSequence"]},"0066":{"0001":["UL","NumberOfSurfaces"],"0002":["SQ","SurfaceSequence"],"0003":["UL","SurfaceNumber"],"0004":["LT","SurfaceComments"],"0009":["CS","SurfaceProcessing"],"000A":["FL","SurfaceProcessingRatio"],"000B":["LO","SurfaceProcessingDescription"],"000C":["FL","RecommendedPresentationOpacity"],"000D":["CS","RecommendedPresentationType"],"000E":["CS","FiniteVolume"],"0010":["CS","Manifold"],"0011":["SQ","SurfacePointsSequence"],"0012":["SQ","SurfacePointsNormalsSequence"],"0013":["SQ","SurfaceMeshPrimitivesSequence"],"0015":["UL","NumberOfSurfacePoints"],"0016":["OF","PointCoordinatesData"],"0017":["FL","PointPositionAccuracy"],"0018":["FL","MeanPointDistance"],"0019":["FL","MaximumPointDistance"],"001A":["FL","PointsBoundingBoxCoordinates"],"001B":["FL","AxisOfRotation"],"001C":["FL","CenterOfRotation"],"001E":["UL","NumberOfVectors"],"001F":["US","VectorDimensionality"],"0020":["FL","VectorAccuracy"],"0021":["OF","VectorCoordinateData"],"0023":["OW","TrianglePointIndexList"],"0024":["OW","EdgePointIndexList"],"0025":["OW","VertexPointIndexList"],"0026":["SQ","TriangleStripSequence"],"0027":["SQ","TriangleFanSequence"],"0028":["SQ","LineSequence"],"0029":["OW","PrimitivePointIndexList"],"002A":["UL","SurfaceCount"],"002B":["SQ","ReferencedSurfaceSequence"],"002C":["UL","ReferencedSurfaceNumber"],"002D":["SQ","SegmentSurfaceGenerationAlgorithmIdentificationSequence"],"002E":["SQ","SegmentSurfaceSourceInstanceSequence"],"002F":["SQ","AlgorithmFamilyCodeSequence"],"0030":["SQ","AlgorithmNameCodeSequence"],"0031":["LO","AlgorithmVersion"],"0032":["LT","AlgorithmParameters"],"0034":["SQ","FacetSequence"],"0035":["SQ","SurfaceProcessingAlgorithmIdentificationSequence"],"0036":["LO","AlgorithmName"]},"0068":{6210:["LO","ImplantSize"],6221:["LO","ImplantTemplateVersion"],6222:["SQ","ReplacedImplantTemplateSequence"],6223:["CS","ImplantType"],6224:["SQ","DerivationImplantTemplateSequence"],6225:["SQ","OriginalImplantTemplateSequence"],6226:["DT","EffectiveDateTime"],6230:["SQ","ImplantTargetAnatomySequence"],6260:["SQ","InformationFromManufacturerSequence"],6265:["SQ","NotificationFromManufacturerSequence"],6270:["DT","InformationIssueDateTime"],6280:["ST","InformationSummary"],"62A0":["SQ","ImplantRegulatoryDisapprovalCodeSequence"],"62A5":["FD","OverallTemplateSpatialTolerance"],"62C0":["SQ","HPGLDocumentSequence"],"62D0":["US","HPGLDocumentID"],"62D5":["LO","HPGLDocumentLabel"],"62E0":["SQ","ViewOrientationCodeSequence"],"62F0":["FD","ViewOrientationModifier"],"62F2":["FD","HPGLDocumentScaling"],6300:["OB","HPGLDocument"],6310:["US","HPGLContourPenNumber"],6320:["SQ","HPGLPenSequence"],6330:["US","HPGLPenNumber"],6340:["LO","HPGLPenLabel"],6345:["ST","HPGLPenDescription"],6346:["FD","RecommendedRotationPoint"],6347:["FD","BoundingRectangle"],6350:["US","ImplantTemplate3DModelSurfaceNumber"],6360:["SQ","SurfaceModelDescriptionSequence"],6380:["LO","SurfaceModelLabel"],6390:["FD","SurfaceModelScalingFactor"],"63A0":["SQ","MaterialsCodeSequence"],"63A4":["SQ","CoatingMaterialsCodeSequence"],"63A8":["SQ","ImplantTypeCodeSequence"],"63AC":["SQ","FixationMethodCodeSequence"],"63B0":["SQ","MatingFeatureSetsSequence"],"63C0":["US","MatingFeatureSetID"],"63D0":["LO","MatingFeatureSetLabel"],"63E0":["SQ","MatingFeatureSequence"],"63F0":["US","MatingFeatureID"],6400:["SQ","MatingFeatureDegreeOfFreedomSequence"],6410:["US","DegreeOfFreedomID"],6420:["CS","DegreeOfFreedomType"],6430:["SQ","TwoDMatingFeatureCoordinatesSequence"],6440:["US","ReferencedHPGLDocumentID"],6450:["FD","TwoDMatingPoint"],6460:["FD","TwoDMatingAxes"],6470:["SQ","TwoDDegreeOfFreedomSequence"],6490:["FD","ThreeDDegreeOfFreedomAxis"],"64A0":["FD","RangeOfFreedom"],"64C0":["FD","ThreeDMatingPoint"],"64D0":["FD","ThreeDMatingAxes"],"64F0":["FD","TwoDDegreeOfFreedomAxis"],6500:["SQ","PlanningLandmarkPointSequence"],6510:["SQ","PlanningLandmarkLineSequence"],6520:["SQ","PlanningLandmarkPlaneSequence"],6530:["US","PlanningLandmarkID"],6540:["LO","PlanningLandmarkDescription"],6545:["SQ","PlanningLandmarkIdentificationCodeSequence"],6550:["SQ","TwoDPointCoordinatesSequence"],6560:["FD","TwoDPointCoordinates"],6590:["FD","ThreeDPointCoordinates"],"65A0":["SQ","TwoDLineCoordinatesSequence"],"65B0":["FD","TwoDLineCoordinates"],"65D0":["FD","ThreeDLineCoordinates"],"65E0":["SQ","TwoDPlaneCoordinatesSequence"],"65F0":["FD","TwoDPlaneIntersection"],6610:["FD","ThreeDPlaneOrigin"],6620:["FD","ThreeDPlaneNormal"]},"0070":{"0001":["SQ","GraphicAnnotationSequence"],"0002":["CS","GraphicLayer"],"0003":["CS","BoundingBoxAnnotationUnits"],"0004":["CS","AnchorPointAnnotationUnits"],"0005":["CS","GraphicAnnotationUnits"],"0006":["ST","UnformattedTextValue"],"0008":["SQ","TextObjectSequence"],"0009":["SQ","GraphicObjectSequence"],"0010":["FL","BoundingBoxTopLeftHandCorner"],"0011":["FL","BoundingBoxBottomRightHandCorner"],"0012":["CS","BoundingBoxTextHorizontalJustification"],"0014":["FL","AnchorPoint"],"0015":["CS","AnchorPointVisibility"],"0020":["US","GraphicDimensions"],"0021":["US","NumberOfGraphicPoints"],"0022":["FL","GraphicData"],"0023":["CS","GraphicType"],"0024":["CS","GraphicFilled"],"0040":["IS","ImageRotationRetired"],"0041":["CS","ImageHorizontalFlip"],"0042":["US","ImageRotation"],"0050":["US","DisplayedAreaTopLeftHandCornerTrial"],"0051":["US","DisplayedAreaBottomRightHandCornerTrial"],"0052":["SL","DisplayedAreaTopLeftHandCorner"],"0053":["SL","DisplayedAreaBottomRightHandCorner"],"005A":["SQ","DisplayedAreaSelectionSequence"],"0060":["SQ","GraphicLayerSequence"],"0062":["IS","GraphicLayerOrder"],"0066":["US","GraphicLayerRecommendedDisplayGrayscaleValue"],"0067":["US","GraphicLayerRecommendedDisplayRGBValue"],"0068":["LO","GraphicLayerDescription"],"0080":["CS","ContentLabel"],"0081":["LO","ContentDescription"],"0082":["DA","PresentationCreationDate"],"0083":["TM","PresentationCreationTime"],"0084":["PN","ContentCreatorName"],"0086":["SQ","ContentCreatorIdentificationCodeSequence"],"0087":["SQ","AlternateContentDescriptionSequence"],"0100":["CS","PresentationSizeMode"],"0101":["DS","PresentationPixelSpacing"],"0102":["IS","PresentationPixelAspectRatio"],"0103":["FL","PresentationPixelMagnificationRatio"],"0207":["LO","GraphicGroupLabel"],"0208":["ST","GraphicGroupDescription"],"0209":["SQ","CompoundGraphicSequence"],"0226":["UL","CompoundGraphicInstanceID"],"0227":["LO","FontName"],"0228":["CS","FontNameType"],"0229":["LO","CSSFontName"],"0230":["FD","RotationAngle"],"0231":["SQ","TextStyleSequence"],"0232":["SQ","LineStyleSequence"],"0233":["SQ","FillStyleSequence"],"0234":["SQ","GraphicGroupSequence"],"0241":["US","TextColorCIELabValue"],"0242":["CS","HorizontalAlignment"],"0243":["CS","VerticalAlignment"],"0244":["CS","ShadowStyle"],"0245":["FL","ShadowOffsetX"],"0246":["FL","ShadowOffsetY"],"0247":["US","ShadowColorCIELabValue"],"0248":["CS","Underlined"],"0249":["CS","Bold"],"0250":["CS","Italic"],"0251":["US","PatternOnColorCIELabValue"],"0252":["US","PatternOffColorCIELabValue"],"0253":["FL","LineThickness"],"0254":["CS","LineDashingStyle"],"0255":["UL","LinePattern"],"0256":["OB","FillPattern"],"0257":["CS","FillMode"],"0258":["FL","ShadowOpacity"],"0261":["FL","GapLength"],"0262":["FL","DiameterOfVisibility"],"0273":["FL","RotationPoint"],"0274":["CS","TickAlignment"],"0278":["CS","ShowTickLabel"],"0279":["CS","TickLabelAlignment"],"0282":["CS","CompoundGraphicUnits"],"0284":["FL","PatternOnOpacity"],"0285":["FL","PatternOffOpacity"],"0287":["SQ","MajorTicksSequence"],"0288":["FL","TickPosition"],"0289":["SH","TickLabel"],"0294":["CS","CompoundGraphicType"],"0295":["UL","GraphicGroupID"],"0306":["CS","ShapeType"],"0308":["SQ","RegistrationSequence"],"0309":["SQ","MatrixRegistrationSequence"],"030A":["SQ","MatrixSequence"],"030C":["CS","FrameOfReferenceTransformationMatrixType"],"030D":["SQ","RegistrationTypeCodeSequence"],"030F":["ST","FiducialDescription"],"0310":["SH","FiducialIdentifier"],"0311":["SQ","FiducialIdentifierCodeSequence"],"0312":["FD","ContourUncertaintyRadius"],"0314":["SQ","UsedFiducialsSequence"],"0318":["SQ","GraphicCoordinatesDataSequence"],"031A":["UI","FiducialUID"],"031C":["SQ","FiducialSetSequence"],"031E":["SQ","FiducialSequence"],"0401":["US","GraphicLayerRecommendedDisplayCIELabValue"],"0402":["SQ","BlendingSequence"],"0403":["FL","RelativeOpacity"],"0404":["SQ","ReferencedSpatialRegistrationSequence"],"0405":["CS","BlendingPosition"]},"0072":{"0002":["SH","HangingProtocolName"],"0004":["LO","HangingProtocolDescription"],"0006":["CS","HangingProtocolLevel"],"0008":["LO","HangingProtocolCreator"],"000A":["DT","HangingProtocolCreationDateTime"],"000C":["SQ","HangingProtocolDefinitionSequence"],"000E":["SQ","HangingProtocolUserIdentificationCodeSequence"],"0010":["LO","HangingProtocolUserGroupName"],"0012":["SQ","SourceHangingProtocolSequence"],"0014":["US","NumberOfPriorsReferenced"],"0020":["SQ","ImageSetsSequence"],"0022":["SQ","ImageSetSelectorSequence"],"0024":["CS","ImageSetSelectorUsageFlag"],"0026":["AT","SelectorAttribute"],"0028":["US","SelectorValueNumber"],"0030":["SQ","TimeBasedImageSetsSequence"],"0032":["US","ImageSetNumber"],"0034":["CS","ImageSetSelectorCategory"],"0038":["US","RelativeTime"],"003A":["CS","RelativeTimeUnits"],"003C":["SS","AbstractPriorValue"],"003E":["SQ","AbstractPriorCodeSequence"],"0040":["LO","ImageSetLabel"],"0050":["CS","SelectorAttributeVR"],"0052":["AT","SelectorSequencePointer"],"0054":["LO","SelectorSequencePointerPrivateCreator"],"0056":["LO","SelectorAttributePrivateCreator"],"0060":["AT","SelectorATValue"],"0062":["CS","SelectorCSValue"],"0064":["IS","SelectorISValue"],"0066":["LO","SelectorLOValue"],"0068":["LT","SelectorLTValue"],"006A":["PN","SelectorPNValue"],"006C":["SH","SelectorSHValue"],"006E":["ST","SelectorSTValue"],"0070":["UT","SelectorUTValue"],"0072":["DS","SelectorDSValue"],"0074":["FD","SelectorFDValue"],"0076":["FL","SelectorFLValue"],"0078":["UL","SelectorULValue"],"007A":["US","SelectorUSValue"],"007C":["SL","SelectorSLValue"],"007E":["SS","SelectorSSValue"],"0080":["SQ","SelectorCodeSequenceValue"],"0100":["US","NumberOfScreens"],"0102":["SQ","NominalScreenDefinitionSequence"],"0104":["US","NumberOfVerticalPixels"],"0106":["US","NumberOfHorizontalPixels"],"0108":["FD","DisplayEnvironmentSpatialPosition"],"010A":["US","ScreenMinimumGrayscaleBitDepth"],"010C":["US","ScreenMinimumColorBitDepth"],"010E":["US","ApplicationMaximumRepaintTime"],"0200":["SQ","DisplaySetsSequence"],"0202":["US","DisplaySetNumber"],"0203":["LO","DisplaySetLabel"],"0204":["US","DisplaySetPresentationGroup"],"0206":["LO","DisplaySetPresentationGroupDescription"],"0208":["CS","PartialDataDisplayHandling"],"0210":["SQ","SynchronizedScrollingSequence"],"0212":["US","DisplaySetScrollingGroup"],"0214":["SQ","NavigationIndicatorSequence"],"0216":["US","NavigationDisplaySet"],"0218":["US","ReferenceDisplaySets"],"0300":["SQ","ImageBoxesSequence"],"0302":["US","ImageBoxNumber"],"0304":["CS","ImageBoxLayoutType"],"0306":["US","ImageBoxTileHorizontalDimension"],"0308":["US","ImageBoxTileVerticalDimension"],"0310":["CS","ImageBoxScrollDirection"],"0312":["CS","ImageBoxSmallScrollType"],"0314":["US","ImageBoxSmallScrollAmount"],"0316":["CS","ImageBoxLargeScrollType"],"0318":["US","ImageBoxLargeScrollAmount"],"0320":["US","ImageBoxOverlapPriority"],"0330":["FD","CineRelativeToRealTime"],"0400":["SQ","FilterOperationsSequence"],"0402":["CS","FilterByCategory"],"0404":["CS","FilterByAttributePresence"],"0406":["CS","FilterByOperator"],"0420":["US","StructuredDisplayBackgroundCIELabValue"],"0421":["US","EmptyImageBoxCIELabValue"],"0422":["SQ","StructuredDisplayImageBoxSequence"],"0424":["SQ","StructuredDisplayTextBoxSequence"],"0427":["SQ","ReferencedFirstFrameSequence"],"0430":["SQ","ImageBoxSynchronizationSequence"],"0432":["US","SynchronizedImageBoxList"],"0434":["CS","TypeOfSynchronization"],"0500":["CS","BlendingOperationType"],"0510":["CS","ReformattingOperationType"],"0512":["FD","ReformattingThickness"],"0514":["FD","ReformattingInterval"],"0516":["CS","ReformattingOperationInitialViewDirection"],"0520":["CS","ThreeDRenderingType"],"0600":["SQ","SortingOperationsSequence"],"0602":["CS","SortByCategory"],"0604":["CS","SortingDirection"],"0700":["CS","DisplaySetPatientOrientation"],"0702":["CS","VOIType"],"0704":["CS","PseudoColorType"],"0705":["SQ","PseudoColorPaletteInstanceReferenceSequence"],"0706":["CS","ShowGrayscaleInverted"],"0710":["CS","ShowImageTrueSizeFlag"],"0712":["CS","ShowGraphicAnnotationFlag"],"0714":["CS","ShowPatientDemographicsFlag"],"0716":["CS","ShowAcquisitionTechniquesFlag"],"0717":["CS","DisplaySetHorizontalJustification"],"0718":["CS","DisplaySetVerticalJustification"]},"0074":{"0120":["FD","ContinuationStartMeterset"],"0121":["FD","ContinuationEndMeterset"],1e3:["CS","ProcedureStepState"],1002:["SQ","ProcedureStepProgressInformationSequence"],1004:["DS","ProcedureStepProgress"],1006:["ST","ProcedureStepProgressDescription"],1008:["SQ","ProcedureStepCommunicationsURISequence"],"100A":["ST","ContactURI"],"100C":["LO","ContactDisplayName"],"100E":["SQ","ProcedureStepDiscontinuationReasonCodeSequence"],1020:["SQ","BeamTaskSequence"],1022:["CS","BeamTaskType"],1024:["IS","BeamOrderIndexTrial"],1026:["FD","TableTopVerticalAdjustedPosition"],1027:["FD","TableTopLongitudinalAdjustedPosition"],1028:["FD","TableTopLateralAdjustedPosition"],"102A":["FD","PatientSupportAdjustedAngle"],"102B":["FD","TableTopEccentricAdjustedAngle"],"102C":["FD","TableTopPitchAdjustedAngle"],"102D":["FD","TableTopRollAdjustedAngle"],1030:["SQ","DeliveryVerificationImageSequence"],1032:["CS","VerificationImageTiming"],1034:["CS","DoubleExposureFlag"],1036:["CS","DoubleExposureOrdering"],1038:["DS","DoubleExposureMetersetTrial"],"103A":["DS","DoubleExposureFieldDeltaTrial"],1040:["SQ","RelatedReferenceRTImageSequence"],1042:["SQ","GeneralMachineVerificationSequence"],1044:["SQ","ConventionalMachineVerificationSequence"],1046:["SQ","IonMachineVerificationSequence"],1048:["SQ","FailedAttributesSequence"],"104A":["SQ","OverriddenAttributesSequence"],"104C":["SQ","ConventionalControlPointVerificationSequence"],"104E":["SQ","IonControlPointVerificationSequence"],1050:["SQ","AttributeOccurrenceSequence"],1052:["AT","AttributeOccurrencePointer"],1054:["UL","AttributeItemSelector"],1056:["LO","AttributeOccurrencePrivateCreator"],1057:["IS","SelectorSequencePointerItems"],1200:["CS","ScheduledProcedureStepPriority"],1202:["LO","WorklistLabel"],1204:["LO","ProcedureStepLabel"],1210:["SQ","ScheduledProcessingParametersSequence"],1212:["SQ","PerformedProcessingParametersSequence"],1216:["SQ","UnifiedProcedureStepPerformedProcedureSequence"],1220:["SQ","RelatedProcedureStepSequence"],1222:["LO","ProcedureStepRelationshipType"],1224:["SQ","ReplacedProcedureStepSequence"],1230:["LO","DeletionLock"],1234:["AE","ReceivingAE"],1236:["AE","RequestingAE"],1238:["LT","ReasonForCancellation"],1242:["CS","SCPStatus"],1244:["CS","SubscriptionListStatus"],1246:["CS","UnifiedProcedureStepListStatus"],1324:["UL","BeamOrderIndex"],1338:["FD","DoubleExposureMeterset"],"133A":["FD","DoubleExposureFieldDelta"]},"0076":{"0001":["LO","ImplantAssemblyTemplateName"],"0003":["LO","ImplantAssemblyTemplateIssuer"],"0006":["LO","ImplantAssemblyTemplateVersion"],"0008":["SQ","ReplacedImplantAssemblyTemplateSequence"],"000A":["CS","ImplantAssemblyTemplateType"],"000C":["SQ","OriginalImplantAssemblyTemplateSequence"],"000E":["SQ","DerivationImplantAssemblyTemplateSequence"],"0010":["SQ","ImplantAssemblyTemplateTargetAnatomySequence"],"0020":["SQ","ProcedureTypeCodeSequence"],"0030":["LO","SurgicalTechnique"],"0032":["SQ","ComponentTypesSequence"],"0034":["CS","ComponentTypeCodeSequence"],"0036":["CS","ExclusiveComponentType"],"0038":["CS","MandatoryComponentType"],"0040":["SQ","ComponentSequence"],"0055":["US","ComponentID"],"0060":["SQ","ComponentAssemblySequence"],"0070":["US","Component1ReferencedID"],"0080":["US","Component1ReferencedMatingFeatureSetID"],"0090":["US","Component1ReferencedMatingFeatureID"],"00A0":["US","Component2ReferencedID"],"00B0":["US","Component2ReferencedMatingFeatureSetID"],"00C0":["US","Component2ReferencedMatingFeatureID"]},"0078":{"0001":["LO","ImplantTemplateGroupName"],"0010":["ST","ImplantTemplateGroupDescription"],"0020":["LO","ImplantTemplateGroupIssuer"],"0024":["LO","ImplantTemplateGroupVersion"],"0026":["SQ","ReplacedImplantTemplateGroupSequence"],"0028":["SQ","ImplantTemplateGroupTargetAnatomySequence"],"002A":["SQ","ImplantTemplateGroupMembersSequence"],"002E":["US","ImplantTemplateGroupMemberID"],"0050":["FD","ThreeDImplantTemplateGroupMemberMatchingPoint"],"0060":["FD","ThreeDImplantTemplateGroupMemberMatchingAxes"],"0070":["SQ","ImplantTemplateGroupMemberMatching2DCoordinatesSequence"],"0090":["FD","TwoDImplantTemplateGroupMemberMatchingPoint"],"00A0":["FD","TwoDImplantTemplateGroupMemberMatchingAxes"],"00B0":["SQ","ImplantTemplateGroupVariationDimensionSequence"],"00B2":["LO","ImplantTemplateGroupVariationDimensionName"],"00B4":["SQ","ImplantTemplateGroupVariationDimensionRankSequence"],"00B6":["US","ReferencedImplantTemplateGroupMemberID"],"00B8":["US","ImplantTemplateGroupVariationDimensionRank"]},"0088":{"0130":["SH","StorageMediaFileSetID"],"0140":["UI","StorageMediaFileSetUID"],"0200":["SQ","IconImageSequence"],"0904":["LO","TopicTitle"],"0906":["ST","TopicSubject"],"0910":["LO","TopicAuthor"],"0912":["LO","TopicKeywords"]},"0100":{"0410":["CS","SOPInstanceStatus"],"0420":["DT","SOPAuthorizationDateTime"],"0424":["LT","SOPAuthorizationComment"],"0426":["LO","AuthorizationEquipmentCertificationNumber"]},"0400":{"0005":["US","MACIDNumber"],"0010":["UI","MACCalculationTransferSyntaxUID"],"0015":["CS","MACAlgorithm"],"0020":["AT","DataElementsSigned"],"0100":["UI","DigitalSignatureUID"],"0105":["DT","DigitalSignatureDateTime"],"0110":["CS","CertificateType"],"0115":["OB","CertificateOfSigner"],"0120":["OB","Signature"],"0305":["CS","CertifiedTimestampType"],"0310":["OB","CertifiedTimestamp"],"0401":["SQ","DigitalSignaturePurposeCodeSequence"],"0402":["SQ","ReferencedDigitalSignatureSequence"],"0403":["SQ","ReferencedSOPInstanceMACSequence"],"0404":["OB","MAC"],"0500":["SQ","EncryptedAttributesSequence"],"0510":["UI","EncryptedContentTransferSyntaxUID"],"0520":["OB","EncryptedContent"],"0550":["SQ","ModifiedAttributesSequence"],"0561":["SQ","OriginalAttributesSequence"],"0562":["DT","AttributeModificationDateTime"],"0563":["LO","ModifyingSystem"],"0564":["LO","SourceOfPreviousValues"],"0565":["CS","ReasonForTheAttributeModification"]},2e3:{"0010":["IS","NumberOfCopies"],"001E":["SQ","PrinterConfigurationSequence"],"0020":["CS","PrintPriority"],"0030":["CS","MediumType"],"0040":["CS","FilmDestination"],"0050":["LO","FilmSessionLabel"],"0060":["IS","MemoryAllocation"],"0061":["IS","MaximumMemoryAllocation"],"0062":["CS","ColorImagePrintingFlag"],"0063":["CS","CollationFlag"],"0065":["CS","AnnotationFlag"],"0067":["CS","ImageOverlayFlag"],"0069":["CS","PresentationLUTFlag"],"006A":["CS","ImageBoxPresentationLUTFlag"],"00A0":["US","MemoryBitDepth"],"00A1":["US","PrintingBitDepth"],"00A2":["SQ","MediaInstalledSequence"],"00A4":["SQ","OtherMediaAvailableSequence"],"00A8":["SQ","SupportedImageDisplayFormatsSequence"],"0500":["SQ","ReferencedFilmBoxSequence"],"0510":["SQ","ReferencedStoredPrintSequence"]},2010:{"0010":["ST","ImageDisplayFormat"],"0030":["CS","AnnotationDisplayFormatID"],"0040":["CS","FilmOrientation"],"0050":["CS","FilmSizeID"],"0052":["CS","PrinterResolutionID"],"0054":["CS","DefaultPrinterResolutionID"],"0060":["CS","MagnificationType"],"0080":["CS","SmoothingType"],"00A6":["CS","DefaultMagnificationType"],"00A7":["CS","OtherMagnificationTypesAvailable"],"00A8":["CS","DefaultSmoothingType"],"00A9":["CS","OtherSmoothingTypesAvailable"],"0100":["CS","BorderDensity"],"0110":["CS","EmptyImageDensity"],"0120":["US","MinDensity"],"0130":["US","MaxDensity"],"0140":["CS","Trim"],"0150":["ST","ConfigurationInformation"],"0152":["LT","ConfigurationInformationDescription"],"0154":["IS","MaximumCollatedFilms"],"015E":["US","Illumination"],"0160":["US","ReflectedAmbientLight"],"0376":["DS","PrinterPixelSpacing"],"0500":["SQ","ReferencedFilmSessionSequence"],"0510":["SQ","ReferencedImageBoxSequence"],"0520":["SQ","ReferencedBasicAnnotationBoxSequence"]},2020:{"0010":["US","ImageBoxPosition"],"0020":["CS","Polarity"],"0030":["DS","RequestedImageSize"],"0040":["CS","RequestedDecimateCropBehavior"],"0050":["CS","RequestedResolutionID"],"00A0":["CS","RequestedImageSizeFlag"],"00A2":["CS","DecimateCropResult"],"0110":["SQ","BasicGrayscaleImageSequence"],"0111":["SQ","BasicColorImageSequence"],"0130":["SQ","ReferencedImageOverlayBoxSequence"],"0140":["SQ","ReferencedVOILUTBoxSequence"]},2030:{"0010":["US","AnnotationPosition"],"0020":["LO","TextString"]},2040:{"0010":["SQ","ReferencedOverlayPlaneSequence"],"0011":["US","ReferencedOverlayPlaneGroups"],"0020":["SQ","OverlayPixelDataSequence"],"0060":["CS","OverlayMagnificationType"],"0070":["CS","OverlaySmoothingType"],"0072":["CS","OverlayOrImageMagnification"],"0074":["US","MagnifyToNumberOfColumns"],"0080":["CS","OverlayForegroundDensity"],"0082":["CS","OverlayBackgroundDensity"],"0090":["CS","OverlayMode"],"0100":["CS","ThresholdDensity"],"0500":["SQ","ReferencedImageBoxSequenceRetired"]},2050:{"0010":["SQ","PresentationLUTSequence"],"0020":["CS","PresentationLUTShape"],"0500":["SQ","ReferencedPresentationLUTSequence"]},2100:{"0010":["SH","PrintJobID"],"0020":["CS","ExecutionStatus"],"0030":["CS","ExecutionStatusInfo"],"0040":["DA","CreationDate"],"0050":["TM","CreationTime"],"0070":["AE","Originator"],"0140":["AE","DestinationAE"],"0160":["SH","OwnerID"],"0170":["IS","NumberOfFilms"],"0500":["SQ","ReferencedPrintJobSequencePullStoredPrint"]},2110:{"0010":["CS","PrinterStatus"],"0020":["CS","PrinterStatusInfo"],"0030":["LO","PrinterName"],"0099":["SH","PrintQueueID"]},2120:{"0010":["CS","QueueStatus"],"0050":["SQ","PrintJobDescriptionSequence"],"0070":["SQ","ReferencedPrintJobSequence"]},2130:{"0010":["SQ","PrintManagementCapabilitiesSequence"],"0015":["SQ","PrinterCharacteristicsSequence"],"0030":["SQ","FilmBoxContentSequence"],"0040":["SQ","ImageBoxContentSequence"],"0050":["SQ","AnnotationContentSequence"],"0060":["SQ","ImageOverlayBoxContentSequence"],"0080":["SQ","PresentationLUTContentSequence"],"00A0":["SQ","ProposedStudySequence"],"00C0":["SQ","OriginalImageSequence"]},2200:{"0001":["CS","LabelUsingInformationExtractedFromInstances"],"0002":["UT","LabelText"],"0003":["CS","LabelStyleSelection"],"0004":["LT","MediaDisposition"],"0005":["LT","BarcodeValue"],"0006":["CS","BarcodeSymbology"],"0007":["CS","AllowMediaSplitting"],"0008":["CS","IncludeNonDICOMObjects"],"0009":["CS","IncludeDisplayApplication"],"000A":["CS","PreserveCompositeInstancesAfterMediaCreation"],"000B":["US","TotalNumberOfPiecesOfMediaCreated"],"000C":["LO","RequestedMediaApplicationProfile"],"000D":["SQ","ReferencedStorageMediaSequence"],"000E":["AT","FailureAttributes"],"000F":["CS","AllowLossyCompression"],"0020":["CS","RequestPriority"]},3002:{"0002":["SH","RTImageLabel"],"0003":["LO","RTImageName"],"0004":["ST","RTImageDescription"],"000A":["CS","ReportedValuesOrigin"],"000C":["CS","RTImagePlane"],"000D":["DS","XRayImageReceptorTranslation"],"000E":["DS","XRayImageReceptorAngle"],"0010":["DS","RTImageOrientation"],"0011":["DS","ImagePlanePixelSpacing"],"0012":["DS","RTImagePosition"],"0020":["SH","RadiationMachineName"],"0022":["DS","RadiationMachineSAD"],"0024":["DS","RadiationMachineSSD"],"0026":["DS","RTImageSID"],"0028":["DS","SourceToReferenceObjectDistance"],"0029":["IS","FractionNumber"],"0030":["SQ","ExposureSequence"],"0032":["DS","MetersetExposure"],"0034":["DS","DiaphragmPosition"],"0040":["SQ","FluenceMapSequence"],"0041":["CS","FluenceDataSource"],"0042":["DS","FluenceDataScale"],"0050":["SQ","PrimaryFluenceModeSequence"],"0051":["CS","FluenceMode"],"0052":["SH","FluenceModeID"]},3004:{"0001":["CS","DVHType"],"0002":["CS","DoseUnits"],"0004":["CS","DoseType"],"0006":["LO","DoseComment"],"0008":["DS","NormalizationPoint"],"000A":["CS","DoseSummationType"],"000C":["DS","GridFrameOffsetVector"],"000E":["DS","DoseGridScaling"],"0010":["SQ","RTDoseROISequence"],"0012":["DS","DoseValue"],"0014":["CS","TissueHeterogeneityCorrection"],"0040":["DS","DVHNormalizationPoint"],"0042":["DS","DVHNormalizationDoseValue"],"0050":["SQ","DVHSequence"],"0052":["DS","DVHDoseScaling"],"0054":["CS","DVHVolumeUnits"],"0056":["IS","DVHNumberOfBins"],"0058":["DS","DVHData"],"0060":["SQ","DVHReferencedROISequence"],"0062":["CS","DVHROIContributionType"],"0070":["DS","DVHMinimumDose"],"0072":["DS","DVHMaximumDose"],"0074":["DS","DVHMeanDose"]},3006:{"0002":["SH","StructureSetLabel"],"0004":["LO","StructureSetName"],"0006":["ST","StructureSetDescription"],"0008":["DA","StructureSetDate"],"0009":["TM","StructureSetTime"],"0010":["SQ","ReferencedFrameOfReferenceSequence"],"0012":["SQ","RTReferencedStudySequence"],"0014":["SQ","RTReferencedSeriesSequence"],"0016":["SQ","ContourImageSequence"],"0020":["SQ","StructureSetROISequence"],"0022":["IS","ROINumber"],"0024":["UI","ReferencedFrameOfReferenceUID"],"0026":["LO","ROIName"],"0028":["ST","ROIDescription"],"002A":["IS","ROIDisplayColor"],"002C":["DS","ROIVolume"],"0030":["SQ","RTRelatedROISequence"],"0033":["CS","RTROIRelationship"],"0036":["CS","ROIGenerationAlgorithm"],"0038":["LO","ROIGenerationDescription"],"0039":["SQ","ROIContourSequence"],"0040":["SQ","ContourSequence"],"0042":["CS","ContourGeometricType"],"0044":["DS","ContourSlabThickness"],"0045":["DS","ContourOffsetVector"],"0046":["IS","NumberOfContourPoints"],"0048":["IS","ContourNumber"],"0049":["IS","AttachedContours"],"0050":["DS","ContourData"],"0080":["SQ","RTROIObservationsSequence"],"0082":["IS","ObservationNumber"],"0084":["IS","ReferencedROINumber"],"0085":["SH","ROIObservationLabel"],"0086":["SQ","RTROIIdentificationCodeSequence"],"0088":["ST","ROIObservationDescription"],"00A0":["SQ","RelatedRTROIObservationsSequence"],"00A4":["CS","RTROIInterpretedType"],"00A6":["PN","ROIInterpreter"],"00B0":["SQ","ROIPhysicalPropertiesSequence"],"00B2":["CS","ROIPhysicalProperty"],"00B4":["DS","ROIPhysicalPropertyValue"],"00B6":["SQ","ROIElementalCompositionSequence"],"00B7":["US","ROIElementalCompositionAtomicNumber"],"00B8":["FL","ROIElementalCompositionAtomicMassFraction"],"00C0":["SQ","FrameOfReferenceRelationshipSequence"],"00C2":["UI","RelatedFrameOfReferenceUID"],"00C4":["CS","FrameOfReferenceTransformationType"],"00C6":["DS","FrameOfReferenceTransformationMatrix"],"00C8":["LO","FrameOfReferenceTransformationComment"]},3008:{"0010":["SQ","MeasuredDoseReferenceSequence"],"0012":["ST","MeasuredDoseDescription"],"0014":["CS","MeasuredDoseType"],"0016":["DS","MeasuredDoseValue"],"0020":["SQ","TreatmentSessionBeamSequence"],"0021":["SQ","TreatmentSessionIonBeamSequence"],"0022":["IS","CurrentFractionNumber"],"0024":["DA","TreatmentControlPointDate"],"0025":["TM","TreatmentControlPointTime"],"002A":["CS","TreatmentTerminationStatus"],"002B":["SH","TreatmentTerminationCode"],"002C":["CS","TreatmentVerificationStatus"],"0030":["SQ","ReferencedTreatmentRecordSequence"],"0032":["DS","SpecifiedPrimaryMeterset"],"0033":["DS","SpecifiedSecondaryMeterset"],"0036":["DS","DeliveredPrimaryMeterset"],"0037":["DS","DeliveredSecondaryMeterset"],"003A":["DS","SpecifiedTreatmentTime"],"003B":["DS","DeliveredTreatmentTime"],"0040":["SQ","ControlPointDeliverySequence"],"0041":["SQ","IonControlPointDeliverySequence"],"0042":["DS","SpecifiedMeterset"],"0044":["DS","DeliveredMeterset"],"0045":["FL","MetersetRateSet"],"0046":["FL","MetersetRateDelivered"],"0047":["FL","ScanSpotMetersetsDelivered"],"0048":["DS","DoseRateDelivered"],"0050":["SQ","TreatmentSummaryCalculatedDoseReferenceSequence"],"0052":["DS","CumulativeDoseToDoseReference"],"0054":["DA","FirstTreatmentDate"],"0056":["DA","MostRecentTreatmentDate"],"005A":["IS","NumberOfFractionsDelivered"],"0060":["SQ","OverrideSequence"],"0061":["AT","ParameterSequencePointer"],"0062":["AT","OverrideParameterPointer"],"0063":["IS","ParameterItemIndex"],"0064":["IS","MeasuredDoseReferenceNumber"],"0065":["AT","ParameterPointer"],"0066":["ST","OverrideReason"],"0068":["SQ","CorrectedParameterSequence"],"006A":["FL","CorrectionValue"],"0070":["SQ","CalculatedDoseReferenceSequence"],"0072":["IS","CalculatedDoseReferenceNumber"],"0074":["ST","CalculatedDoseReferenceDescription"],"0076":["DS","CalculatedDoseReferenceDoseValue"],"0078":["DS","StartMeterset"],"007A":["DS","EndMeterset"],"0080":["SQ","ReferencedMeasuredDoseReferenceSequence"],"0082":["IS","ReferencedMeasuredDoseReferenceNumber"],"0090":["SQ","ReferencedCalculatedDoseReferenceSequence"],"0092":["IS","ReferencedCalculatedDoseReferenceNumber"],"00A0":["SQ","BeamLimitingDeviceLeafPairsSequence"],"00B0":["SQ","RecordedWedgeSequence"],"00C0":["SQ","RecordedCompensatorSequence"],"00D0":["SQ","RecordedBlockSequence"],"00E0":["SQ","TreatmentSummaryMeasuredDoseReferenceSequence"],"00F0":["SQ","RecordedSnoutSequence"],"00F2":["SQ","RecordedRangeShifterSequence"],"00F4":["SQ","RecordedLateralSpreadingDeviceSequence"],"00F6":["SQ","RecordedRangeModulatorSequence"],"0100":["SQ","RecordedSourceSequence"],"0105":["LO","SourceSerialNumber"],"0110":["SQ","TreatmentSessionApplicationSetupSequence"],"0116":["CS","ApplicationSetupCheck"],"0120":["SQ","RecordedBrachyAccessoryDeviceSequence"],"0122":["IS","ReferencedBrachyAccessoryDeviceNumber"],"0130":["SQ","RecordedChannelSequence"],"0132":["DS","SpecifiedChannelTotalTime"],"0134":["DS","DeliveredChannelTotalTime"],"0136":["IS","SpecifiedNumberOfPulses"],"0138":["IS","DeliveredNumberOfPulses"],"013A":["DS","SpecifiedPulseRepetitionInterval"],"013C":["DS","DeliveredPulseRepetitionInterval"],"0140":["SQ","RecordedSourceApplicatorSequence"],"0142":["IS","ReferencedSourceApplicatorNumber"],"0150":["SQ","RecordedChannelShieldSequence"],"0152":["IS","ReferencedChannelShieldNumber"],"0160":["SQ","BrachyControlPointDeliveredSequence"],"0162":["DA","SafePositionExitDate"],"0164":["TM","SafePositionExitTime"],"0166":["DA","SafePositionReturnDate"],"0168":["TM","SafePositionReturnTime"],"0200":["CS","CurrentTreatmentStatus"],"0202":["ST","TreatmentStatusComment"],"0220":["SQ","FractionGroupSummarySequence"],"0223":["IS","ReferencedFractionNumber"],"0224":["CS","FractionGroupType"],"0230":["CS","BeamStopperPosition"],"0240":["SQ","FractionStatusSummarySequence"],"0250":["DA","TreatmentDate"],"0251":["TM","TreatmentTime"]},"300A":{"0002":["SH","RTPlanLabel"],"0003":["LO","RTPlanName"],"0004":["ST","RTPlanDescription"],"0006":["DA","RTPlanDate"],"0007":["TM","RTPlanTime"],"0009":["LO","TreatmentProtocols"],"000A":["CS","PlanIntent"],"000B":["LO","TreatmentSites"],"000C":["CS","RTPlanGeometry"],"000E":["ST","PrescriptionDescription"],"0010":["SQ","DoseReferenceSequence"],"0012":["IS","DoseReferenceNumber"],"0013":["UI","DoseReferenceUID"],"0014":["CS","DoseReferenceStructureType"],"0015":["CS","NominalBeamEnergyUnit"],"0016":["LO","DoseReferenceDescription"],"0018":["DS","DoseReferencePointCoordinates"],"001A":["DS","NominalPriorDose"],"0020":["CS","DoseReferenceType"],"0021":["DS","ConstraintWeight"],"0022":["DS","DeliveryWarningDose"],"0023":["DS","DeliveryMaximumDose"],"0025":["DS","TargetMinimumDose"],"0026":["DS","TargetPrescriptionDose"],"0027":["DS","TargetMaximumDose"],"0028":["DS","TargetUnderdoseVolumeFraction"],"002A":["DS","OrganAtRiskFullVolumeDose"],"002B":["DS","OrganAtRiskLimitDose"],"002C":["DS","OrganAtRiskMaximumDose"],"002D":["DS","OrganAtRiskOverdoseVolumeFraction"],"0040":["SQ","ToleranceTableSequence"],"0042":["IS","ToleranceTableNumber"],"0043":["SH","ToleranceTableLabel"],"0044":["DS","GantryAngleTolerance"],"0046":["DS","BeamLimitingDeviceAngleTolerance"],"0048":["SQ","BeamLimitingDeviceToleranceSequence"],"004A":["DS","BeamLimitingDevicePositionTolerance"],"004B":["FL","SnoutPositionTolerance"],"004C":["DS","PatientSupportAngleTolerance"],"004E":["DS","TableTopEccentricAngleTolerance"],"004F":["FL","TableTopPitchAngleTolerance"],"0050":["FL","TableTopRollAngleTolerance"],"0051":["DS","TableTopVerticalPositionTolerance"],"0052":["DS","TableTopLongitudinalPositionTolerance"],"0053":["DS","TableTopLateralPositionTolerance"],"0055":["CS","RTPlanRelationship"],"0070":["SQ","FractionGroupSequence"],"0071":["IS","FractionGroupNumber"],"0072":["LO","FractionGroupDescription"],"0078":["IS","NumberOfFractionsPlanned"],"0079":["IS","NumberOfFractionPatternDigitsPerDay"],"007A":["IS","RepeatFractionCycleLength"],"007B":["LT","FractionPattern"],"0080":["IS","NumberOfBeams"],"0082":["DS","BeamDoseSpecificationPoint"],"0084":["DS","BeamDose"],"0086":["DS","BeamMeterset"],"0088":["FL","BeamDosePointDepth"],"0089":["FL","BeamDosePointEquivalentDepth"],"008A":["FL","BeamDosePointSSD"],"00A0":["IS","NumberOfBrachyApplicationSetups"],"00A2":["DS","BrachyApplicationSetupDoseSpecificationPoint"],"00A4":["DS","BrachyApplicationSetupDose"],"00B0":["SQ","BeamSequence"],"00B2":["SH","TreatmentMachineName"],"00B3":["CS","PrimaryDosimeterUnit"],"00B4":["DS","SourceAxisDistance"],"00B6":["SQ","BeamLimitingDeviceSequence"],"00B8":["CS","RTBeamLimitingDeviceType"],"00BA":["DS","SourceToBeamLimitingDeviceDistance"],"00BB":["FL","IsocenterToBeamLimitingDeviceDistance"],"00BC":["IS","NumberOfLeafJawPairs"],"00BE":["DS","LeafPositionBoundaries"],"00C0":["IS","BeamNumber"],"00C2":["LO","BeamName"],"00C3":["ST","BeamDescription"],"00C4":["CS","BeamType"],"00C6":["CS","RadiationType"],"00C7":["CS","HighDoseTechniqueType"],"00C8":["IS","ReferenceImageNumber"],"00CA":["SQ","PlannedVerificationImageSequence"],"00CC":["LO","ImagingDeviceSpecificAcquisitionParameters"],"00CE":["CS","TreatmentDeliveryType"],"00D0":["IS","NumberOfWedges"],"00D1":["SQ","WedgeSequence"],"00D2":["IS","WedgeNumber"],"00D3":["CS","WedgeType"],"00D4":["SH","WedgeID"],"00D5":["IS","WedgeAngle"],"00D6":["DS","WedgeFactor"],"00D7":["FL","TotalWedgeTrayWaterEquivalentThickness"],"00D8":["DS","WedgeOrientation"],"00D9":["FL","IsocenterToWedgeTrayDistance"],"00DA":["DS","SourceToWedgeTrayDistance"],"00DB":["FL","WedgeThinEdgePosition"],"00DC":["SH","BolusID"],"00DD":["ST","BolusDescription"],"00E0":["IS","NumberOfCompensators"],"00E1":["SH","MaterialID"],"00E2":["DS","TotalCompensatorTrayFactor"],"00E3":["SQ","CompensatorSequence"],"00E4":["IS","CompensatorNumber"],"00E5":["SH","CompensatorID"],"00E6":["DS","SourceToCompensatorTrayDistance"],"00E7":["IS","CompensatorRows"],"00E8":["IS","CompensatorColumns"],"00E9":["DS","CompensatorPixelSpacing"],"00EA":["DS","CompensatorPosition"],"00EB":["DS","CompensatorTransmissionData"],"00EC":["DS","CompensatorThicknessData"],"00ED":["IS","NumberOfBoli"],"00EE":["CS","CompensatorType"],"00F0":["IS","NumberOfBlocks"],"00F2":["DS","TotalBlockTrayFactor"],"00F3":["FL","TotalBlockTrayWaterEquivalentThickness"],"00F4":["SQ","BlockSequence"],"00F5":["SH","BlockTrayID"],"00F6":["DS","SourceToBlockTrayDistance"],"00F7":["FL","IsocenterToBlockTrayDistance"],"00F8":["CS","BlockType"],"00F9":["LO","AccessoryCode"],"00FA":["CS","BlockDivergence"],"00FB":["CS","BlockMountingPosition"],"00FC":["IS","BlockNumber"],"00FE":["LO","BlockName"],"0100":["DS","BlockThickness"],"0102":["DS","BlockTransmission"],"0104":["IS","BlockNumberOfPoints"],"0106":["DS","BlockData"],"0107":["SQ","ApplicatorSequence"],"0108":["SH","ApplicatorID"],"0109":["CS","ApplicatorType"],"010A":["LO","ApplicatorDescription"],"010C":["DS","CumulativeDoseReferenceCoefficient"],"010E":["DS","FinalCumulativeMetersetWeight"],"0110":["IS","NumberOfControlPoints"],"0111":["SQ","ControlPointSequence"],"0112":["IS","ControlPointIndex"],"0114":["DS","NominalBeamEnergy"],"0115":["DS","DoseRateSet"],"0116":["SQ","WedgePositionSequence"],"0118":["CS","WedgePosition"],"011A":["SQ","BeamLimitingDevicePositionSequence"],"011C":["DS","LeafJawPositions"],"011E":["DS","GantryAngle"],"011F":["CS","GantryRotationDirection"],"0120":["DS","BeamLimitingDeviceAngle"],"0121":["CS","BeamLimitingDeviceRotationDirection"],"0122":["DS","PatientSupportAngle"],"0123":["CS","PatientSupportRotationDirection"],"0124":["DS","TableTopEccentricAxisDistance"],"0125":["DS","TableTopEccentricAngle"],"0126":["CS","TableTopEccentricRotationDirection"],"0128":["DS","TableTopVerticalPosition"],"0129":["DS","TableTopLongitudinalPosition"],"012A":["DS","TableTopLateralPosition"],"012C":["DS","IsocenterPosition"],"012E":["DS","SurfaceEntryPoint"],"0130":["DS","SourceToSurfaceDistance"],"0134":["DS","CumulativeMetersetWeight"],"0140":["FL","TableTopPitchAngle"],"0142":["CS","TableTopPitchRotationDirection"],"0144":["FL","TableTopRollAngle"],"0146":["CS","TableTopRollRotationDirection"],"0148":["FL","HeadFixationAngle"],"014A":["FL","GantryPitchAngle"],"014C":["CS","GantryPitchRotationDirection"],"014E":["FL","GantryPitchAngleTolerance"],"0180":["SQ","PatientSetupSequence"],"0182":["IS","PatientSetupNumber"],"0183":["LO","PatientSetupLabel"],"0184":["LO","PatientAdditionalPosition"],"0190":["SQ","FixationDeviceSequence"],"0192":["CS","FixationDeviceType"],"0194":["SH","FixationDeviceLabel"],"0196":["ST","FixationDeviceDescription"],"0198":["SH","FixationDevicePosition"],"0199":["FL","FixationDevicePitchAngle"],"019A":["FL","FixationDeviceRollAngle"],"01A0":["SQ","ShieldingDeviceSequence"],"01A2":["CS","ShieldingDeviceType"],"01A4":["SH","ShieldingDeviceLabel"],"01A6":["ST","ShieldingDeviceDescription"],"01A8":["SH","ShieldingDevicePosition"],"01B0":["CS","SetupTechnique"],"01B2":["ST","SetupTechniqueDescription"],"01B4":["SQ","SetupDeviceSequence"],"01B6":["CS","SetupDeviceType"],"01B8":["SH","SetupDeviceLabel"],"01BA":["ST","SetupDeviceDescription"],"01BC":["DS","SetupDeviceParameter"],"01D0":["ST","SetupReferenceDescription"],"01D2":["DS","TableTopVerticalSetupDisplacement"],"01D4":["DS","TableTopLongitudinalSetupDisplacement"],"01D6":["DS","TableTopLateralSetupDisplacement"],"0200":["CS","BrachyTreatmentTechnique"],"0202":["CS","BrachyTreatmentType"],"0206":["SQ","TreatmentMachineSequence"],"0210":["SQ","SourceSequence"],"0212":["IS","SourceNumber"],"0214":["CS","SourceType"],"0216":["LO","SourceManufacturer"],"0218":["DS","ActiveSourceDiameter"],"021A":["DS","ActiveSourceLength"],"0222":["DS","SourceEncapsulationNominalThickness"],"0224":["DS","SourceEncapsulationNominalTransmission"],"0226":["LO","SourceIsotopeName"],"0228":["DS","SourceIsotopeHalfLife"],"0229":["CS","SourceStrengthUnits"],"022A":["DS","ReferenceAirKermaRate"],"022B":["DS","SourceStrength"],"022C":["DA","SourceStrengthReferenceDate"],"022E":["TM","SourceStrengthReferenceTime"],"0230":["SQ","ApplicationSetupSequence"],"0232":["CS","ApplicationSetupType"],"0234":["IS","ApplicationSetupNumber"],"0236":["LO","ApplicationSetupName"],"0238":["LO","ApplicationSetupManufacturer"],"0240":["IS","TemplateNumber"],"0242":["SH","TemplateType"],"0244":["LO","TemplateName"],"0250":["DS","TotalReferenceAirKerma"],"0260":["SQ","BrachyAccessoryDeviceSequence"],"0262":["IS","BrachyAccessoryDeviceNumber"],"0263":["SH","BrachyAccessoryDeviceID"],"0264":["CS","BrachyAccessoryDeviceType"],"0266":["LO","BrachyAccessoryDeviceName"],"026A":["DS","BrachyAccessoryDeviceNominalThickness"],"026C":["DS","BrachyAccessoryDeviceNominalTransmission"],"0280":["SQ","ChannelSequence"],"0282":["IS","ChannelNumber"],"0284":["DS","ChannelLength"],"0286":["DS","ChannelTotalTime"],"0288":["CS","SourceMovementType"],"028A":["IS","NumberOfPulses"],"028C":["DS","PulseRepetitionInterval"],"0290":["IS","SourceApplicatorNumber"],"0291":["SH","SourceApplicatorID"],"0292":["CS","SourceApplicatorType"],"0294":["LO","SourceApplicatorName"],"0296":["DS","SourceApplicatorLength"],"0298":["LO","SourceApplicatorManufacturer"],"029C":["DS","SourceApplicatorWallNominalThickness"],"029E":["DS","SourceApplicatorWallNominalTransmission"],"02A0":["DS","SourceApplicatorStepSize"],"02A2":["IS","TransferTubeNumber"],"02A4":["DS","TransferTubeLength"],"02B0":["SQ","ChannelShieldSequence"],"02B2":["IS","ChannelShieldNumber"],"02B3":["SH","ChannelShieldID"],"02B4":["LO","ChannelShieldName"],"02B8":["DS","ChannelShieldNominalThickness"],"02BA":["DS","ChannelShieldNominalTransmission"],"02C8":["DS","FinalCumulativeTimeWeight"],"02D0":["SQ","BrachyControlPointSequence"],"02D2":["DS","ControlPointRelativePosition"],"02D4":["DS","ControlPoint3DPosition"],"02D6":["DS","CumulativeTimeWeight"],"02E0":["CS","CompensatorDivergence"],"02E1":["CS","CompensatorMountingPosition"],"02E2":["DS","SourceToCompensatorDistance"],"02E3":["FL","TotalCompensatorTrayWaterEquivalentThickness"],"02E4":["FL","IsocenterToCompensatorTrayDistance"],"02E5":["FL","CompensatorColumnOffset"],"02E6":["FL","IsocenterToCompensatorDistances"],"02E7":["FL","CompensatorRelativeStoppingPowerRatio"],"02E8":["FL","CompensatorMillingToolDiameter"],"02EA":["SQ","IonRangeCompensatorSequence"],"02EB":["LT","CompensatorDescription"],"0302":["IS","RadiationMassNumber"],"0304":["IS","RadiationAtomicNumber"],"0306":["SS","RadiationChargeState"],"0308":["CS","ScanMode"],"030A":["FL","VirtualSourceAxisDistances"],"030C":["SQ","SnoutSequence"],"030D":["FL","SnoutPosition"],"030F":["SH","SnoutID"],"0312":["IS","NumberOfRangeShifters"],"0314":["SQ","RangeShifterSequence"],"0316":["IS","RangeShifterNumber"],"0318":["SH","RangeShifterID"],"0320":["CS","RangeShifterType"],"0322":["LO","RangeShifterDescription"],"0330":["IS","NumberOfLateralSpreadingDevices"],"0332":["SQ","LateralSpreadingDeviceSequence"],"0334":["IS","LateralSpreadingDeviceNumber"],"0336":["SH","LateralSpreadingDeviceID"],"0338":["CS","LateralSpreadingDeviceType"],"033A":["LO","LateralSpreadingDeviceDescription"],"033C":["FL","LateralSpreadingDeviceWaterEquivalentThickness"],"0340":["IS","NumberOfRangeModulators"],"0342":["SQ","RangeModulatorSequence"],"0344":["IS","RangeModulatorNumber"],"0346":["SH","RangeModulatorID"],"0348":["CS","RangeModulatorType"],"034A":["LO","RangeModulatorDescription"],"034C":["SH","BeamCurrentModulationID"],"0350":["CS","PatientSupportType"],"0352":["SH","PatientSupportID"],"0354":["LO","PatientSupportAccessoryCode"],"0356":["FL","FixationLightAzimuthalAngle"],"0358":["FL","FixationLightPolarAngle"],"035A":["FL","MetersetRate"],"0360":["SQ","RangeShifterSettingsSequence"],"0362":["LO","RangeShifterSetting"],"0364":["FL","IsocenterToRangeShifterDistance"],"0366":["FL","RangeShifterWaterEquivalentThickness"],"0370":["SQ","LateralSpreadingDeviceSettingsSequence"],"0372":["LO","LateralSpreadingDeviceSetting"],"0374":["FL","IsocenterToLateralSpreadingDeviceDistance"],"0380":["SQ","RangeModulatorSettingsSequence"],"0382":["FL","RangeModulatorGatingStartValue"],"0384":["FL","RangeModulatorGatingStopValue"],"0386":["FL","RangeModulatorGatingStartWaterEquivalentThickness"],"0388":["FL","RangeModulatorGatingStopWaterEquivalentThickness"],"038A":["FL","IsocenterToRangeModulatorDistance"],"0390":["SH","ScanSpotTuneID"],"0392":["IS","NumberOfScanSpotPositions"],"0394":["FL","ScanSpotPositionMap"],"0396":["FL","ScanSpotMetersetWeights"],"0398":["FL","ScanningSpotSize"],"039A":["IS","NumberOfPaintings"],"03A0":["SQ","IonToleranceTableSequence"],"03A2":["SQ","IonBeamSequence"],"03A4":["SQ","IonBeamLimitingDeviceSequence"],"03A6":["SQ","IonBlockSequence"],"03A8":["SQ","IonControlPointSequence"],"03AA":["SQ","IonWedgeSequence"],"03AC":["SQ","IonWedgePositionSequence"],"0401":["SQ","ReferencedSetupImageSequence"],"0402":["ST","SetupImageComment"],"0410":["SQ","MotionSynchronizationSequence"],"0412":["FL","ControlPointOrientation"],"0420":["SQ","GeneralAccessorySequence"],"0421":["SH","GeneralAccessoryID"],"0422":["ST","GeneralAccessoryDescription"],"0423":["CS","GeneralAccessoryType"],"0424":["IS","GeneralAccessoryNumber"],"0431":["SQ","ApplicatorGeometrySequence"],"0432":["CS","ApplicatorApertureShape"],"0433":["FL","ApplicatorOpening"],"0434":["FL","ApplicatorOpeningX"],"0435":["FL","ApplicatorOpeningY"],"0436":["FL","SourceToApplicatorMountingPositionDistance"]},"300C":{"0002":["SQ","ReferencedRTPlanSequence"],"0004":["SQ","ReferencedBeamSequence"],"0006":["IS","ReferencedBeamNumber"],"0007":["IS","ReferencedReferenceImageNumber"],"0008":["DS","StartCumulativeMetersetWeight"],"0009":["DS","EndCumulativeMetersetWeight"],"000A":["SQ","ReferencedBrachyApplicationSetupSequence"],"000C":["IS","ReferencedBrachyApplicationSetupNumber"],"000E":["IS","ReferencedSourceNumber"],"0020":["SQ","ReferencedFractionGroupSequence"],"0022":["IS","ReferencedFractionGroupNumber"],"0040":["SQ","ReferencedVerificationImageSequence"],"0042":["SQ","ReferencedReferenceImageSequence"],"0050":["SQ","ReferencedDoseReferenceSequence"],"0051":["IS","ReferencedDoseReferenceNumber"],"0055":["SQ","BrachyReferencedDoseReferenceSequence"],"0060":["SQ","ReferencedStructureSetSequence"],"006A":["IS","ReferencedPatientSetupNumber"],"0080":["SQ","ReferencedDoseSequence"],"00A0":["IS","ReferencedToleranceTableNumber"],"00B0":["SQ","ReferencedBolusSequence"],"00C0":["IS","ReferencedWedgeNumber"],"00D0":["IS","ReferencedCompensatorNumber"],"00E0":["IS","ReferencedBlockNumber"],"00F0":["IS","ReferencedControlPointIndex"],"00F2":["SQ","ReferencedControlPointSequence"],"00F4":["IS","ReferencedStartControlPointIndex"],"00F6":["IS","ReferencedStopControlPointIndex"],"0100":["IS","ReferencedRangeShifterNumber"],"0102":["IS","ReferencedLateralSpreadingDeviceNumber"],"0104":["IS","ReferencedRangeModulatorNumber"]},"300E":{"0002":["CS","ApprovalStatus"],"0004":["DA","ReviewDate"],"0005":["TM","ReviewTime"],"0008":["PN","ReviewerName"]},4e3:{"0010":["LT","Arbitrary"],4e3:["LT","TextComments"]},4008:{"0040":["SH","ResultsID"],"0042":["LO","ResultsIDIssuer"],"0050":["SQ","ReferencedInterpretationSequence"],"00FF":["CS","ReportProductionStatusTrial"],"0100":["DA","InterpretationRecordedDate"],"0101":["TM","InterpretationRecordedTime"],"0102":["PN","InterpretationRecorder"],"0103":["LO","ReferenceToRecordedSound"],"0108":["DA","InterpretationTranscriptionDate"],"0109":["TM","InterpretationTranscriptionTime"],"010A":["PN","InterpretationTranscriber"],"010B":["ST","InterpretationText"],"010C":["PN","InterpretationAuthor"],"0111":["SQ","InterpretationApproverSequence"],"0112":["DA","InterpretationApprovalDate"],"0113":["TM","InterpretationApprovalTime"],"0114":["PN","PhysicianApprovingInterpretation"],"0115":["LT","InterpretationDiagnosisDescription"],"0117":["SQ","InterpretationDiagnosisCodeSequence"],"0118":["SQ","ResultsDistributionListSequence"],"0119":["PN","DistributionName"],"011A":["LO","DistributionAddress"],"0200":["SH","InterpretationID"],"0202":["LO","InterpretationIDIssuer"],"0210":["CS","InterpretationTypeID"],"0212":["CS","InterpretationStatusID"],"0300":["ST","Impressions"],4e3:["ST","ResultsComments"]},4010:{"0001":["CS","LowEnergyDetectors"],"0002":["CS","HighEnergyDetectors"],"0004":["SQ","DetectorGeometrySequence"],1001:["SQ","ThreatROIVoxelSequence"],1004:["FL","ThreatROIBase"],1005:["FL","ThreatROIExtents"],1006:["OB","ThreatROIBitmap"],1007:["SH","RouteSegmentID"],1008:["CS","GantryType"],1009:["CS","OOIOwnerType"],"100A":["SQ","RouteSegmentSequence"],1010:["US","PotentialThreatObjectID"],1011:["SQ","ThreatSequence"],1012:["CS","ThreatCategory"],1013:["LT","ThreatCategoryDescription"],1014:["CS","ATDAbilityAssessment"],1015:["CS","ATDAssessmentFlag"],1016:["FL","ATDAssessmentProbability"],1017:["FL","Mass"],1018:["FL","Density"],1019:["FL","ZEffective"],"101A":["SH","BoardingPassID"],"101B":["FL","CenterOfMass"],"101C":["FL","CenterOfPTO"],"101D":["FL","BoundingPolygon"],"101E":["SH","RouteSegmentStartLocationID"],"101F":["SH","RouteSegmentEndLocationID"],1020:["CS","RouteSegmentLocationIDType"],1021:["CS","AbortReason"],1023:["FL","VolumeOfPTO"],1024:["CS","AbortFlag"],1025:["DT","RouteSegmentStartTime"],1026:["DT","RouteSegmentEndTime"],1027:["CS","TDRType"],1028:["CS","InternationalRouteSegment"],1029:["LO","ThreatDetectionAlgorithmandVersion"],"102A":["SH","AssignedLocation"],"102B":["DT","AlarmDecisionTime"],1031:["CS","AlarmDecision"],1033:["US","NumberOfTotalObjects"],1034:["US","NumberOfAlarmObjects"],1037:["SQ","PTORepresentationSequence"],1038:["SQ","ATDAssessmentSequence"],1039:["CS","TIPType"],"103A":["CS","DICOSVersion"],1041:["DT","OOIOwnerCreationTime"],1042:["CS","OOIType"],1043:["FL","OOISize"],1044:["CS","AcquisitionStatus"],1045:["SQ","BasisMaterialsCodeSequence"],1046:["CS","PhantomType"],1047:["SQ","OOIOwnerSequence"],1048:["CS","ScanType"],1051:["LO","ItineraryID"],1052:["SH","ItineraryIDType"],1053:["LO","ItineraryIDAssigningAuthority"],1054:["SH","RouteID"],1055:["SH","RouteIDAssigningAuthority"],1056:["CS","InboundArrivalType"],1058:["SH","CarrierID"],1059:["CS","CarrierIDAssigningAuthority"],1060:["FL","SourceOrientation"],1061:["FL","SourcePosition"],1062:["FL","BeltHeight"],1064:["SQ","AlgorithmRoutingCodeSequence"],1067:["CS","TransportClassification"],1068:["LT","OOITypeDescriptor"],1069:["FL","TotalProcessingTime"],"106C":["OB","DetectorCalibrationData"]}},n.Dictionary.getVR=function(s,c){var f,g,A;return A=n.Dictionary.dict[n.Utils.dec2hex(s)],A&&(g=A[n.Utils.dec2hex(c)],g?f=g[0]:c===0&&(f="UL")),f||(A=n.Dictionary.dictPrivate[n.Utils.dec2hex(s)],A&&(g=A[n.Utils.dec2hex(c)],g&&(f=g[0]))),f||(f="OB"),f},n.Dictionary.getDescription=function(s,c){var f,g,A;return A=n.Dictionary.dict[n.Utils.dec2hex(s)],A&&(g=A[n.Utils.dec2hex(c)],g?f=g[1]:c===0&&(f="Group "+n.Utils.dec2hex(s)+" Length")),f||(A=n.Dictionary.dictPrivate[n.Utils.dec2hex(s)],A&&(g=A[n.Utils.dec2hex(c)],g&&(f=g[1]))),f||(f="PrivateData"),f},u.exports&&(u.exports=n.Dictionary)}(dictionary)),dictionary.exports}var image$1={exports:{}},tag={exports:{}},lib$1={exports:{}},_default$1={},lib={exports:{}},_default={},hasRequired_default$1;function require_default$1(){if(hasRequired_default$1)return _default;hasRequired_default$1=1;function u(){var g={};return g["align-content"]=!1,g["align-items"]=!1,g["align-self"]=!1,g["alignment-adjust"]=!1,g["alignment-baseline"]=!1,g.all=!1,g["anchor-point"]=!1,g.animation=!1,g["animation-delay"]=!1,g["animation-direction"]=!1,g["animation-duration"]=!1,g["animation-fill-mode"]=!1,g["animation-iteration-count"]=!1,g["animation-name"]=!1,g["animation-play-state"]=!1,g["animation-timing-function"]=!1,g.azimuth=!1,g["backface-visibility"]=!1,g.background=!0,g["background-attachment"]=!0,g["background-clip"]=!0,g["background-color"]=!0,g["background-image"]=!0,g["background-origin"]=!0,g["background-position"]=!0,g["background-repeat"]=!0,g["background-size"]=!0,g["baseline-shift"]=!1,g.binding=!1,g.bleed=!1,g["bookmark-label"]=!1,g["bookmark-level"]=!1,g["bookmark-state"]=!1,g.border=!0,g["border-bottom"]=!0,g["border-bottom-color"]=!0,g["border-bottom-left-radius"]=!0,g["border-bottom-right-radius"]=!0,g["border-bottom-style"]=!0,g["border-bottom-width"]=!0,g["border-collapse"]=!0,g["border-color"]=!0,g["border-image"]=!0,g["border-image-outset"]=!0,g["border-image-repeat"]=!0,g["border-image-slice"]=!0,g["border-image-source"]=!0,g["border-image-width"]=!0,g["border-left"]=!0,g["border-left-color"]=!0,g["border-left-style"]=!0,g["border-left-width"]=!0,g["border-radius"]=!0,g["border-right"]=!0,g["border-right-color"]=!0,g["border-right-style"]=!0,g["border-right-width"]=!0,g["border-spacing"]=!0,g["border-style"]=!0,g["border-top"]=!0,g["border-top-color"]=!0,g["border-top-left-radius"]=!0,g["border-top-right-radius"]=!0,g["border-top-style"]=!0,g["border-top-width"]=!0,g["border-width"]=!0,g.bottom=!1,g["box-decoration-break"]=!0,g["box-shadow"]=!0,g["box-sizing"]=!0,g["box-snap"]=!0,g["box-suppress"]=!0,g["break-after"]=!0,g["break-before"]=!0,g["break-inside"]=!0,g["caption-side"]=!1,g.chains=!1,g.clear=!0,g.clip=!1,g["clip-path"]=!1,g["clip-rule"]=!1,g.color=!0,g["color-interpolation-filters"]=!0,g["column-count"]=!1,g["column-fill"]=!1,g["column-gap"]=!1,g["column-rule"]=!1,g["column-rule-color"]=!1,g["column-rule-style"]=!1,g["column-rule-width"]=!1,g["column-span"]=!1,g["column-width"]=!1,g.columns=!1,g.contain=!1,g.content=!1,g["counter-increment"]=!1,g["counter-reset"]=!1,g["counter-set"]=!1,g.crop=!1,g.cue=!1,g["cue-after"]=!1,g["cue-before"]=!1,g.cursor=!1,g.direction=!1,g.display=!0,g["display-inside"]=!0,g["display-list"]=!0,g["display-outside"]=!0,g["dominant-baseline"]=!1,g.elevation=!1,g["empty-cells"]=!1,g.filter=!1,g.flex=!1,g["flex-basis"]=!1,g["flex-direction"]=!1,g["flex-flow"]=!1,g["flex-grow"]=!1,g["flex-shrink"]=!1,g["flex-wrap"]=!1,g.float=!1,g["float-offset"]=!1,g["flood-color"]=!1,g["flood-opacity"]=!1,g["flow-from"]=!1,g["flow-into"]=!1,g.font=!0,g["font-family"]=!0,g["font-feature-settings"]=!0,g["font-kerning"]=!0,g["font-language-override"]=!0,g["font-size"]=!0,g["font-size-adjust"]=!0,g["font-stretch"]=!0,g["font-style"]=!0,g["font-synthesis"]=!0,g["font-variant"]=!0,g["font-variant-alternates"]=!0,g["font-variant-caps"]=!0,g["font-variant-east-asian"]=!0,g["font-variant-ligatures"]=!0,g["font-variant-numeric"]=!0,g["font-variant-position"]=!0,g["font-weight"]=!0,g.grid=!1,g["grid-area"]=!1,g["grid-auto-columns"]=!1,g["grid-auto-flow"]=!1,g["grid-auto-rows"]=!1,g["grid-column"]=!1,g["grid-column-end"]=!1,g["grid-column-start"]=!1,g["grid-row"]=!1,g["grid-row-end"]=!1,g["grid-row-start"]=!1,g["grid-template"]=!1,g["grid-template-areas"]=!1,g["grid-template-columns"]=!1,g["grid-template-rows"]=!1,g["hanging-punctuation"]=!1,g.height=!0,g.hyphens=!1,g.icon=!1,g["image-orientation"]=!1,g["image-resolution"]=!1,g["ime-mode"]=!1,g["initial-letters"]=!1,g["inline-box-align"]=!1,g["justify-content"]=!1,g["justify-items"]=!1,g["justify-self"]=!1,g.left=!1,g["letter-spacing"]=!0,g["lighting-color"]=!0,g["line-box-contain"]=!1,g["line-break"]=!1,g["line-grid"]=!1,g["line-height"]=!1,g["line-snap"]=!1,g["line-stacking"]=!1,g["line-stacking-ruby"]=!1,g["line-stacking-shift"]=!1,g["line-stacking-strategy"]=!1,g["list-style"]=!0,g["list-style-image"]=!0,g["list-style-position"]=!0,g["list-style-type"]=!0,g.margin=!0,g["margin-bottom"]=!0,g["margin-left"]=!0,g["margin-right"]=!0,g["margin-top"]=!0,g["marker-offset"]=!1,g["marker-side"]=!1,g.marks=!1,g.mask=!1,g["mask-box"]=!1,g["mask-box-outset"]=!1,g["mask-box-repeat"]=!1,g["mask-box-slice"]=!1,g["mask-box-source"]=!1,g["mask-box-width"]=!1,g["mask-clip"]=!1,g["mask-image"]=!1,g["mask-origin"]=!1,g["mask-position"]=!1,g["mask-repeat"]=!1,g["mask-size"]=!1,g["mask-source-type"]=!1,g["mask-type"]=!1,g["max-height"]=!0,g["max-lines"]=!1,g["max-width"]=!0,g["min-height"]=!0,g["min-width"]=!0,g["move-to"]=!1,g["nav-down"]=!1,g["nav-index"]=!1,g["nav-left"]=!1,g["nav-right"]=!1,g["nav-up"]=!1,g["object-fit"]=!1,g["object-position"]=!1,g.opacity=!1,g.order=!1,g.orphans=!1,g.outline=!1,g["outline-color"]=!1,g["outline-offset"]=!1,g["outline-style"]=!1,g["outline-width"]=!1,g.overflow=!1,g["overflow-wrap"]=!1,g["overflow-x"]=!1,g["overflow-y"]=!1,g.padding=!0,g["padding-bottom"]=!0,g["padding-left"]=!0,g["padding-right"]=!0,g["padding-top"]=!0,g.page=!1,g["page-break-after"]=!1,g["page-break-before"]=!1,g["page-break-inside"]=!1,g["page-policy"]=!1,g.pause=!1,g["pause-after"]=!1,g["pause-before"]=!1,g.perspective=!1,g["perspective-origin"]=!1,g.pitch=!1,g["pitch-range"]=!1,g["play-during"]=!1,g.position=!1,g["presentation-level"]=!1,g.quotes=!1,g["region-fragment"]=!1,g.resize=!1,g.rest=!1,g["rest-after"]=!1,g["rest-before"]=!1,g.richness=!1,g.right=!1,g.rotation=!1,g["rotation-point"]=!1,g["ruby-align"]=!1,g["ruby-merge"]=!1,g["ruby-position"]=!1,g["shape-image-threshold"]=!1,g["shape-outside"]=!1,g["shape-margin"]=!1,g.size=!1,g.speak=!1,g["speak-as"]=!1,g["speak-header"]=!1,g["speak-numeral"]=!1,g["speak-punctuation"]=!1,g["speech-rate"]=!1,g.stress=!1,g["string-set"]=!1,g["tab-size"]=!1,g["table-layout"]=!1,g["text-align"]=!0,g["text-align-last"]=!0,g["text-combine-upright"]=!0,g["text-decoration"]=!0,g["text-decoration-color"]=!0,g["text-decoration-line"]=!0,g["text-decoration-skip"]=!0,g["text-decoration-style"]=!0,g["text-emphasis"]=!0,g["text-emphasis-color"]=!0,g["text-emphasis-position"]=!0,g["text-emphasis-style"]=!0,g["text-height"]=!0,g["text-indent"]=!0,g["text-justify"]=!0,g["text-orientation"]=!0,g["text-overflow"]=!0,g["text-shadow"]=!0,g["text-space-collapse"]=!0,g["text-transform"]=!0,g["text-underline-position"]=!0,g["text-wrap"]=!0,g.top=!1,g.transform=!1,g["transform-origin"]=!1,g["transform-style"]=!1,g.transition=!1,g["transition-delay"]=!1,g["transition-duration"]=!1,g["transition-property"]=!1,g["transition-timing-function"]=!1,g["unicode-bidi"]=!1,g["vertical-align"]=!1,g.visibility=!1,g["voice-balance"]=!1,g["voice-duration"]=!1,g["voice-family"]=!1,g["voice-pitch"]=!1,g["voice-range"]=!1,g["voice-rate"]=!1,g["voice-stress"]=!1,g["voice-volume"]=!1,g.volume=!1,g["white-space"]=!1,g.widows=!1,g.width=!0,g["will-change"]=!1,g["word-break"]=!0,g["word-spacing"]=!0,g["word-wrap"]=!0,g["wrap-flow"]=!1,g["wrap-through"]=!1,g["writing-mode"]=!1,g["z-index"]=!1,g}function n(g,A,v){}function s(g,A,v){}var c=/javascript\s*\:/img;function f(g,A){return c.test(A)?"":A}return _default.whiteList=u(),_default.getDefaultWhiteList=u,_default.onAttr=n,_default.onIgnoreAttr=s,_default.safeAttrValue=f,_default}var util$1,hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,util$1={indexOf:function(u,n){var s,c;if(Array.prototype.indexOf)return u.indexOf(n);for(s=0,c=u.length;s/g,e=/"/g,N=/"/g,M=/&#([a-zA-Z0-9]*);?/gim,O=/:?/gim,z=/&newline;?/gim,B=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,V=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,b=/u\s*r\s*l\s*\(.*/gi;function W(pe){return pe.replace(e,""")}function q(pe){return pe.replace(N,'"')}function Y(pe){return pe.replace(M,function(xe,we){return we[0]==="x"||we[0]==="X"?String.fromCharCode(parseInt(we.substr(1),16)):String.fromCharCode(parseInt(we,10))})}function X(pe){return pe.replace(O,":").replace(z," ")}function Q(pe){for(var Se="",xe=0,we=pe.length;xe",we);if(Fe===-1)break;xe=Fe+3}return Se}function me(pe){var Se=pe.split("");return Se=Se.filter(function(xe){var we=xe.charCodeAt(0);return we===127?!1:we<=31?we===10||we===13:!0}),Se.join("")}return _default$1.whiteList=c(),_default$1.getDefaultWhiteList=c,_default$1.onTag=g,_default$1.onIgnoreTag=A,_default$1.onTagAttr=v,_default$1.onIgnoreTagAttr=y,_default$1.safeAttrValue=I,_default$1.escapeHtml=T,_default$1.escapeQuote=W,_default$1.unescapeQuote=q,_default$1.escapeHtmlEntities=Y,_default$1.escapeDangerHtml5Entities=X,_default$1.clearNonPrintableCharacter=Q,_default$1.friendlyAttrValue=m,_default$1.escapeAttrValue=Z,_default$1.onIgnoreTagStripAll=ee,_default$1.StripTagBody=oe,_default$1.stripCommentTag=fe,_default$1.stripBlankChar=me,_default$1.cssFilter=f,_default$1.getDefaultCSSWhiteList=n,_default$1}var parser$1={},hasRequiredParser$1;function requireParser$1(){if(hasRequiredParser$1)return parser$1;hasRequiredParser$1=1;var u=requireUtil();function n(S){var k=u.spaceIndex(S),e;return k===-1?e=S.slice(1,-1):e=S.slice(1,k+1),e=u.trim(e).toLowerCase(),e.slice(0,1)==="/"&&(e=e.slice(1)),e.slice(-1)==="/"&&(e=e.slice(0,-1)),e}function s(S){return S.slice(0,2)===""||B===V-1){N+=e(S.slice(M,O)),W=S.slice(O,B+1),b=n(W),N+=k(O,N.length,b,W,s(W)),M=B+1,O=!1;continue}if(q==='"'||q==="'")for(var Y=1,X=S.charAt(B-Y);X.trim()===""||X==="=";){if(X==="="){z=q;continue e}X=S.charAt(B-++Y)}}else if(q===z){z=!1;continue}}return M0;k--){var e=S[k];if(e!==" ")return e==="="?k:-1}}function T(S){return S[0]==='"'&&S[S.length-1]==='"'||S[0]==="'"&&S[S.length-1]==="'"}function I(S){return T(S)?S.substr(1,S.length-2):S}return parser$1.parseTag=c,parser$1.parseAttr=g,parser$1}var xss,hasRequiredXss;function requireXss(){if(hasRequiredXss)return xss;hasRequiredXss=1;var u=requireLib$1().FilterCSS,n=require_default(),s=requireParser$1(),c=s.parseTag,f=s.parseAttr,g=requireUtil();function A(S){return S==null}function v(S){var k=g.spaceIndex(S);if(k===-1)return{html:"",closing:S[S.length-2]==="/"};S=g.trim(S.slice(k+1,-1));var e=S[S.length-1]==="/";return e&&(S=g.trim(S.slice(0,-1))),{html:S,closing:e}}function y(S){var k={};for(var e in S)k[e]=S[e];return k}function T(S){var k={};for(var e in S)Array.isArray(S[e])?k[e.toLowerCase()]=S[e].map(function(N){return N.toLowerCase()}):k[e.toLowerCase()]=S[e];return k}function I(S){S=y(S||{}),S.stripIgnoreTag&&(S.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),S.onIgnoreTag=n.onIgnoreTagStripAll),S.whiteList||S.allowList?S.whiteList=T(S.whiteList||S.allowList):S.whiteList=n.whiteList,S.onTag=S.onTag||n.onTag,S.onTagAttr=S.onTagAttr||n.onTagAttr,S.onIgnoreTag=S.onIgnoreTag||n.onIgnoreTag,S.onIgnoreTagAttr=S.onIgnoreTagAttr||n.onIgnoreTagAttr,S.safeAttrValue=S.safeAttrValue||n.safeAttrValue,S.escapeHtml=S.escapeHtml||n.escapeHtml,this.options=S,S.css===!1?this.cssFilter=!1:(S.css=S.css||{},this.cssFilter=new u(S.css))}return I.prototype.process=function(S){if(S=S||"",S=S.toString(),!S)return"";var k=this,e=k.options,N=e.whiteList,M=e.onTag,O=e.onIgnoreTag,z=e.onTagAttr,B=e.onIgnoreTagAttr,V=e.safeAttrValue,b=e.escapeHtml,W=k.cssFilter;e.stripBlankChar&&(S=n.stripBlankChar(S)),e.allowCommentTag||(S=n.stripCommentTag(S));var q=!1;e.stripIgnoreTagBody&&(q=n.StripTagBody(e.stripIgnoreTagBody,O),O=q.onIgnoreTag);var Y=c(S,function(X,Q,m,Z,ee){var oe={sourcePosition:X,position:Q,isClosing:ee,isWhite:Object.prototype.hasOwnProperty.call(N,m)},fe=M(m,Z,oe);if(!A(fe))return fe;if(oe.isWhite){if(oe.isClosing)return"";var me=v(Z),pe=N[m],Se=f(me.html,function(xe,we){var Fe=g.indexOf(pe,xe)!==-1,De=z(m,xe,we,Fe);return A(De)?Fe?(we=V(m,xe,we,W),we?xe+'="'+we+'"':xe):(De=B(m,xe,we,Fe),A(De)?void 0:De):De});return Z="<"+m,Se&&(Z+=" "+Se),me.closing&&(Z+=" /"),Z+=">",Z}else return fe=O(m,Z,oe),A(fe)?b(Z):fe},b);return q&&(Y=q.remove(Y)),Y},xss=I,xss}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(u,n){var s=require_default(),c=requireParser$1(),f=requireXss();function g(v,y){var T=new f(y);return T.process(v)}n=u.exports=g,n.filterXSS=g,n.FilterXSS=f,function(){for(var v in s)n[v]=s[v];for(var y in c)n[y]=c[y]}(),typeof window<"u"&&(window.filterXSS=u.exports);function A(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}A()&&(self.filterXSS=u.exports)}(lib$1,lib$1.exports)),lib$1.exports}var siemens={exports:{}},hasRequiredSiemens;function requireSiemens(){return hasRequiredSiemens||(hasRequiredSiemens=1,function(u){var n=n||{};n.Utils=n.Utils||(typeof commonjsRequire<"u"?requireUtilities():null),n.Siemens=n.Siemens||function(s){this.output="",this.data=new DataView(s,0)},n.Siemens.CSA2_MAGIC_NUMBER=[83,86,49,48],n.Siemens.NAME_LENGTH=64,n.Siemens.ELEMENT_CSA1=4112,n.Siemens.ELEMENT_CSA2=4128,n.Siemens.GROUP_CSA=41,n.Siemens.prototype.readHeader=function(){var s,c;try{if(this.data.byteLength>n.Siemens.CSA2_MAGIC_NUMBER.length){for(c=!0,s=0;s1)for(var g=Array.prototype.slice.call(arguments,1);f--;)c[s-1-f]=n.Utils.createArray.apply(this,g);return c},n.Utils.getStringAt=function(s,c,f,g,A){var v="",y,T;for(y=0;y0?parseInt(s,10):0},n.Utils.convertCamcelCaseToTitleCase=function(s){var c=s.replace(/([A-Z][a-z])/g," $1");return n.Utils.trim(c.charAt(0).toUpperCase()+c.slice(1))},n.Utils.safeParseFloat=function(s){return s=n.Utils.stripLeadingZeros(s),s.length>0?parseFloat(s):0},n.Utils.bytesToDouble=function(s){var c=(s[0]&128)>>7,f=(s[0]&127)<<4|(s[1]&240)>>4;if(f==0)return 0;if(f==2047)return c?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;var g=Math.pow(2,f-1023-52),A=s[7]+s[6]*Math.pow(2,8)+s[5]*Math.pow(2,8*2)+s[4]*Math.pow(2,8*3)+s[3]*Math.pow(2,8*4)+s[2]*Math.pow(2,8*5)+(s[1]&15)*Math.pow(2,8*6)+Math.pow(2,52);return Math.pow(-1,c)*A*g},n.Utils.concatArrayBuffers=function(s,c){var f=new Uint8Array(s.byteLength+c.byteLength);return f.set(new Uint8Array(s),0),f.set(new Uint8Array(c),s.byteLength),f.buffer},n.Utils.concatArrayBuffers2=function(s){var c=0,f=0,g;for(g=0;g>8&65280|s>>24&255},n.Utils.swap16=function(s){return((s&255)<<8|s>>8&255)<<16>>16},n.Utils.makeCRCTable=function(){for(var s,c=[],f=0;f<256;f++){s=f;for(var g=0;g<8;g++)s=s&1?3988292384^s>>>1:s>>>1;c[f]=s}return c},n.Utils.crc32=function(s){for(var c=n.Utils.crcTable||(n.Utils.crcTable=n.Utils.makeCRCTable()),f=-1,g=0;g>>8^c[(f^s.getUint8(g))&255];return(f^-1)>>>0},n.Utils.createBitMask=function(s,c,f){var g=4294967295;return g>>>=(4-s)*8+(s*8-c),f?s==1?g&=255:s==2?g&=65535:s==4?g&=4294967295:s==8&&(g=4294967295):g=4294967295,g},u.exports&&(u.exports=n.Utils)}(utilities)),utilities.exports}var hasRequiredDictionary;function requireDictionary(){return hasRequiredDictionary||(hasRequiredDictionary=1,function(u){var n=n||{};n.Dictionary=n.Dictionary||{},n.Utils=n.Utils||(typeof commonjsRequire<"u"?requireUtilities():null),n.Dictionary.dictPrivate={"0207":{"101F":["FE","ElscintDataScale"]}},n.Dictionary.dict={"0002":{"0001":["OB","FileMetaInformationVersion"],"0002":["UI","MediaStoredSOPClassUID"],"0003":["UI","MediaStoredSOPInstanceUID"],"0010":["UI","TransferSyntaxUID"],"0012":["UI","ImplementationClassUID"],"0013":["SH","ImplementationVersionName"],"0016":["AE","SourceApplicationEntityTitle"],"0100":["UI","PrivateInformationCreatorUID"],"0102":["OB","PrivateInformation"]},"0004":{1130:["CS","FilesetID"],1141:["CS","FilesetDescriptorFileFileID"],1142:["CS","FilesetDescriptorFileFormat"],1200:["UL","RootDirectoryEntitysFirstDirectoryRecordOffset"],1202:["UL","RootDirectoryEntitysLastDirectoryRecordOffset"],1212:["US","File-setConsistenceFlag"],1220:["SQ","DirectoryRecordSequence"],1400:["UL","NextDirectoryRecordOffset"],1410:["US","RecordInuseFlag"],1420:["UL","ReferencedLowerlevelDirectoryEntityOffset"],1430:["CS","DirectoryRecordType"],1432:["UI","PrivateRecordUID"],1500:["CS","ReferencedFileID"],1510:["UI","ReferencedSOPClassUIDInFile"],1511:["UI","ReferencedSOPInstanceUIDInFile"],1600:["UL","NumberOfReferences"]},"0008":{"0001":["UL","LengthToEnd"],"0005":["CS","SpecificCharacterSet"],"0006":["SQ","LanguageCodeSequence"],"0008":["CS","ImageType"],"0010":["SH","RecognitionCode"],"0012":["DA","InstanceCreationDate"],"0013":["TM","InstanceCreationTime"],"0014":["UI","InstanceCreatorUID"],"0016":["UI","SOPClassUID"],"0018":["UI","SOPInstanceUID"],"001A":["UI","RelatedGeneralSOPClassUID"],"001B":["UI","OriginalSpecializedSOPClassUID"],"0020":["DA","StudyDate"],"0021":["DA","SeriesDate"],"0022":["DA","AcquisitionDate"],"0023":["DA","ContentDate"],"0024":["DA","OverlayDate"],"0025":["DA","CurveDate"],"002A":["DT","AcquisitionDateTime"],"0030":["TM","StudyTime"],"0031":["TM","SeriesTime"],"0032":["TM","AcquisitionTime"],"0033":["TM","ContentTime"],"0034":["TM","OverlayTime"],"0035":["TM","CurveTime"],"0040":["US","DataSetType"],"0041":["LO","DataSetSubtype"],"0042":["CS","NuclearMedicineSeriesType"],"0050":["SH","AccessionNumber"],"0051":["SQ","IssuerOfAccessionNumberSequence"],"0052":["CS","QueryRetrieveLevel"],"0054":["AE","RetrieveAETitle"],"0056":["CS","InstanceAvailability"],"0058":["UI","FailedSOPInstanceUIDList"],"0060":["CS","Modality"],"0061":["CS","ModalitiesInStudy"],"0062":["UI","SOPClassesInStudy"],"0064":["CS","ConversionType"],"0068":["CS","PresentationIntentType"],"0070":["LO","Manufacturer"],"0080":["LO","InstitutionName"],"0081":["ST","InstitutionAddress"],"0082":["SQ","InstitutionCodeSequence"],"0090":["PN","ReferringPhysicianName"],"0092":["ST","ReferringPhysicianAddress"],"0094":["SH","ReferringPhysicianTelephoneNumbers"],"0096":["SQ","ReferringPhysicianIdentificationSequence"],"0100":["SH","CodeValue"],"0102":["SH","CodingSchemeDesignator"],"0103":["SH","CodingSchemeVersion"],"0104":["LO","CodeMeaning"],"0105":["CS","MappingResource"],"0106":["DT","ContextGroupVersion"],"0107":["DT","ContextGroupLocalVersion"],"010B":["CS","ContextGroupExtensionFlag"],"010C":["UI","CodingSchemeUID"],"010D":["UI","ContextGroupExtensionCreatorUID"],"010F":["CS","ContextIdentifier"],"0110":["SQ","CodingSchemeIdentificationSequence"],"0112":["LO","CodingSchemeRegistry"],"0114":["ST","CodingSchemeExternalID"],"0115":["ST","CodingSchemeName"],"0116":["ST","CodingSchemeResponsibleOrganization"],"0117":["UI","ContextUID"],"0201":["SH","TimezoneOffsetFromUTC"],1e3:["AE","NetworkID"],1010:["SH","StationName"],1030:["LO","StudyDescription"],1032:["SQ","ProcedureCodeSequence"],"103E":["LO","SeriesDescription"],"103F":["SQ","SeriesDescriptionCodeSequence"],1040:["LO","InstitutionalDepartmentName"],1048:["PN","PhysiciansOfRecord"],1049:["SQ","PhysiciansOfRecordIdentificationSequence"],1050:["PN","PerformingPhysicianName"],1052:["SQ","PerformingPhysicianIdentificationSequence"],1060:["PN","NameOfPhysiciansReadingStudy"],1062:["SQ","PhysiciansReadingStudyIdentificationSequence"],1070:["PN","OperatorsName"],1072:["SQ","OperatorIdentificationSequence"],1080:["LO","AdmittingDiagnosesDescription"],1084:["SQ","AdmittingDiagnosesCodeSequence"],1090:["LO","ManufacturerModelName"],1100:["SQ","ReferencedResultsSequence"],1110:["SQ","ReferencedStudySequence"],1111:["SQ","ReferencedPerformedProcedureStepSequence"],1115:["SQ","ReferencedSeriesSequence"],1120:["SQ","ReferencedPatientSequence"],1125:["SQ","ReferencedVisitSequence"],1130:["SQ","ReferencedOverlaySequence"],1134:["SQ","ReferencedStereometricInstanceSequence"],"113A":["SQ","ReferencedWaveformSequence"],1140:["SQ","ReferencedImageSequence"],1145:["SQ","ReferencedCurveSequence"],"114A":["SQ","ReferencedInstanceSequence"],"114B":["SQ","ReferencedRealWorldValueMappingInstanceSequence"],1150:["UI","ReferencedSOPClassUID"],1155:["UI","ReferencedSOPInstanceUID"],"115A":["UI","SOPClassesSupported"],1160:["IS","ReferencedFrameNumber"],1161:["UL","SimpleFrameList"],1162:["UL","CalculatedFrameList"],1163:["FD","TimeRange"],1164:["SQ","FrameExtractionSequence"],1167:["UI","MultiFrameSourceSOPInstanceUID"],1195:["UI","TransactionUID"],1197:["US","FailureReason"],1198:["SQ","FailedSOPSequence"],1199:["SQ","ReferencedSOPSequence"],1200:["SQ","StudiesContainingOtherReferencedInstancesSequence"],1250:["SQ","RelatedSeriesSequence"],2110:["CS","LossyImageCompressionRetired"],2111:["ST","DerivationDescription"],2112:["SQ","SourceImageSequence"],2120:["SH","StageName"],2122:["IS","StageNumber"],2124:["IS","NumberOfStages"],2127:["SH","ViewName"],2128:["IS","ViewNumber"],2129:["IS","NumberOfEventTimers"],"212A":["IS","NumberOfViewsInStage"],2130:["DS","EventElapsedTimes"],2132:["LO","EventTimerNames"],2133:["SQ","EventTimerSequence"],2134:["FD","EventTimeOffset"],2135:["SQ","EventCodeSequence"],2142:["IS","StartTrim"],2143:["IS","StopTrim"],2144:["IS","RecommendedDisplayFrameRate"],2200:["CS","TransducerPosition"],2204:["CS","TransducerOrientation"],2208:["CS","AnatomicStructure"],2218:["SQ","AnatomicRegionSequence"],2220:["SQ","AnatomicRegionModifierSequence"],2228:["SQ","PrimaryAnatomicStructureSequence"],2229:["SQ","AnatomicStructureSpaceOrRegionSequence"],2230:["SQ","PrimaryAnatomicStructureModifierSequence"],2240:["SQ","TransducerPositionSequence"],2242:["SQ","TransducerPositionModifierSequence"],2244:["SQ","TransducerOrientationSequence"],2246:["SQ","TransducerOrientationModifierSequence"],2251:["SQ","AnatomicStructureSpaceOrRegionCodeSequenceTrial"],2253:["SQ","AnatomicPortalOfEntranceCodeSequenceTrial"],2255:["SQ","AnatomicApproachDirectionCodeSequenceTrial"],2256:["ST","AnatomicPerspectiveDescriptionTrial"],2257:["SQ","AnatomicPerspectiveCodeSequenceTrial"],2258:["ST","AnatomicLocationOfExaminingInstrumentDescriptionTrial"],2259:["SQ","AnatomicLocationOfExaminingInstrumentCodeSequenceTrial"],"225A":["SQ","AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial"],"225C":["SQ","OnAxisBackgroundAnatomicStructureCodeSequenceTrial"],3001:["SQ","AlternateRepresentationSequence"],3010:["UI","IrradiationEventUID"],4e3:["LT","IdentifyingComments"],9007:["CS","FrameType"],9092:["SQ","ReferencedImageEvidenceSequence"],9121:["SQ","ReferencedRawDataSequence"],9123:["UI","CreatorVersionUID"],9124:["SQ","DerivationImageSequence"],9154:["SQ","SourceImageEvidenceSequence"],9205:["CS","PixelPresentation"],9206:["CS","VolumetricProperties"],9207:["CS","VolumeBasedCalculationTechnique"],9208:["CS","ComplexImageComponent"],9209:["CS","AcquisitionContrast"],9215:["SQ","DerivationCodeSequence"],9237:["SQ","ReferencedPresentationStateSequence"],9410:["SQ","ReferencedOtherPlaneSequence"],9458:["SQ","FrameDisplaySequence"],9459:["FL","RecommendedDisplayFrameRateInFloat"],9460:["CS","SkipFrameRangeFlag"]},"0010":{"0010":["PN","PatientName"],"0020":["LO","PatientID"],"0021":["LO","IssuerOfPatientID"],"0022":["CS","TypeOfPatientID"],"0024":["SQ","IssuerOfPatientIDQualifiersSequence"],"0030":["DA","PatientBirthDate"],"0032":["TM","PatientBirthTime"],"0040":["CS","PatientSex"],"0050":["SQ","PatientInsurancePlanCodeSequence"],"0101":["SQ","PatientPrimaryLanguageCodeSequence"],"0102":["SQ","PatientPrimaryLanguageModifierCodeSequence"],1e3:["LO","OtherPatientIDs"],1001:["PN","OtherPatientNames"],1002:["SQ","OtherPatientIDsSequence"],1005:["PN","PatientBirthName"],1010:["AS","PatientAge"],1020:["DS","PatientSize"],1021:["SQ","PatientSizeCodeSequence"],1030:["DS","PatientWeight"],1040:["LO","PatientAddress"],1050:["LO","InsurancePlanIdentification"],1060:["PN","PatientMotherBirthName"],1080:["LO","MilitaryRank"],1081:["LO","BranchOfService"],1090:["LO","MedicalRecordLocator"],2e3:["LO","MedicalAlerts"],2110:["LO","Allergies"],2150:["LO","CountryOfResidence"],2152:["LO","RegionOfResidence"],2154:["SH","PatientTelephoneNumbers"],2160:["SH","EthnicGroup"],2180:["SH","Occupation"],"21A0":["CS","SmokingStatus"],"21B0":["LT","AdditionalPatientHistory"],"21C0":["US","PregnancyStatus"],"21D0":["DA","LastMenstrualDate"],"21F0":["LO","PatientReligiousPreference"],2201:["LO","PatientSpeciesDescription"],2202:["SQ","PatientSpeciesCodeSequence"],2203:["CS","PatientSexNeutered"],2210:["CS","AnatomicalOrientationType"],2292:["LO","PatientBreedDescription"],2293:["SQ","PatientBreedCodeSequence"],2294:["SQ","BreedRegistrationSequence"],2295:["LO","BreedRegistrationNumber"],2296:["SQ","BreedRegistryCodeSequence"],2297:["PN","ResponsiblePerson"],2298:["CS","ResponsiblePersonRole"],2299:["LO","ResponsibleOrganization"],4e3:["LT","PatientComments"],9431:["FL","ExaminedBodyThickness"]},"0012":{"0010":["LO","ClinicalTrialSponsorName"],"0020":["LO","ClinicalTrialProtocolID"],"0021":["LO","ClinicalTrialProtocolName"],"0030":["LO","ClinicalTrialSiteID"],"0031":["LO","ClinicalTrialSiteName"],"0040":["LO","ClinicalTrialSubjectID"],"0042":["LO","ClinicalTrialSubjectReadingID"],"0050":["LO","ClinicalTrialTimePointID"],"0051":["ST","ClinicalTrialTimePointDescription"],"0060":["LO","ClinicalTrialCoordinatingCenterName"],"0062":["CS","PatientIdentityRemoved"],"0063":["LO","DeidentificationMethod"],"0064":["SQ","DeidentificationMethodCodeSequence"],"0071":["LO","ClinicalTrialSeriesID"],"0072":["LO","ClinicalTrialSeriesDescription"],"0081":["LO","ClinicalTrialProtocolEthicsCommitteeName"],"0082":["LO","ClinicalTrialProtocolEthicsCommitteeApprovalNumber"],"0083":["SQ","ConsentForClinicalTrialUseSequence"],"0084":["CS","DistributionType"],"0085":["CS","ConsentForDistributionFlag"]},"0014":{"0023":["ST","CADFileFormat"],"0024":["ST","ComponentReferenceSystem"],"0025":["ST","ComponentManufacturingProcedure"],"0028":["ST","ComponentManufacturer"],"0030":["DS","MaterialThickness"],"0032":["DS","MaterialPipeDiameter"],"0034":["DS","MaterialIsolationDiameter"],"0042":["ST","MaterialGrade"],"0044":["ST","MaterialPropertiesFileID"],"0045":["ST","MaterialPropertiesFileFormat"],"0046":["LT","MaterialNotes"],"0050":["CS","ComponentShape"],"0052":["CS","CurvatureType"],"0054":["DS","OuterDiameter"],"0056":["DS","InnerDiameter"],1010:["ST","ActualEnvironmentalConditions"],1020:["DA","ExpiryDate"],1040:["ST","EnvironmentalConditions"],2002:["SQ","EvaluatorSequence"],2004:["IS","EvaluatorNumber"],2006:["PN","EvaluatorName"],2008:["IS","EvaluationAttempt"],2012:["SQ","IndicationSequence"],2014:["IS","IndicationNumber "],2016:["SH","IndicationLabel"],2018:["ST","IndicationDescription"],"201A":["CS","IndicationType"],"201C":["CS","IndicationDisposition"],"201E":["SQ","IndicationROISequence"],2030:["SQ","IndicationPhysicalPropertySequence"],2032:["SH","PropertyLabel"],2202:["IS","CoordinateSystemNumberOfAxes "],2204:["SQ","CoordinateSystemAxesSequence"],2206:["ST","CoordinateSystemAxisDescription"],2208:["CS","CoordinateSystemDataSetMapping"],"220A":["IS","CoordinateSystemAxisNumber"],"220C":["CS","CoordinateSystemAxisType"],"220E":["CS","CoordinateSystemAxisUnits"],2210:["OB","CoordinateSystemAxisValues"],2220:["SQ","CoordinateSystemTransformSequence"],2222:["ST","TransformDescription"],2224:["IS","TransformNumberOfAxes"],2226:["IS","TransformOrderOfAxes"],2228:["CS","TransformedAxisUnits"],"222A":["DS","CoordinateSystemTransformRotationAndScaleMatrix"],"222C":["DS","CoordinateSystemTransformTranslationMatrix"],3011:["DS","InternalDetectorFrameTime"],3012:["DS","NumberOfFramesIntegrated"],3020:["SQ","DetectorTemperatureSequence"],3022:["DS","SensorName"],3024:["DS","HorizontalOffsetOfSensor"],3026:["DS","VerticalOffsetOfSensor"],3028:["DS","SensorTemperature"],3040:["SQ","DarkCurrentSequence"],3050:["OB","DarkCurrentCounts"],3060:["SQ","GainCorrectionReferenceSequence"],3070:["OB","AirCounts"],3071:["DS","KVUsedInGainCalibration"],3072:["DS","MAUsedInGainCalibration"],3073:["DS","NumberOfFramesUsedForIntegration"],3074:["LO","FilterMaterialUsedInGainCalibration"],3075:["DS","FilterThicknessUsedInGainCalibration"],3076:["DA","DateOfGainCalibration"],3077:["TM","TimeOfGainCalibration"],3080:["OB","BadPixelImage"],3099:["LT","CalibrationNotes"],4002:["SQ","PulserEquipmentSequence"],4004:["CS","PulserType"],4006:["LT","PulserNotes"],4008:["SQ","ReceiverEquipmentSequence"],"400A":["CS","AmplifierType"],"400C":["LT","ReceiverNotes"],"400E":["SQ","PreAmplifierEquipmentSequence"],"400F":["LT","PreAmplifierNotes"],4010:["SQ","TransmitTransducerSequence"],4011:["SQ","ReceiveTransducerSequence"],4012:["US","NumberOfElements"],4013:["CS","ElementShape"],4014:["DS","ElementDimensionA"],4015:["DS","ElementDimensionB"],4016:["DS","ElementPitch"],4017:["DS","MeasuredBeamDimensionA"],4018:["DS","MeasuredBeamDimensionB"],4019:["DS","LocationOfMeasuredBeamDiameter"],"401A":["DS","NominalFrequency"],"401B":["DS","MeasuredCenterFrequency"],"401C":["DS","MeasuredBandwidth"],4020:["SQ","PulserSettingsSequence"],4022:["DS","PulseWidth"],4024:["DS","ExcitationFrequency"],4026:["CS","ModulationType"],4028:["DS","Damping"],4030:["SQ","ReceiverSettingsSequence"],4031:["DS","AcquiredSoundpathLength"],4032:["CS","AcquisitionCompressionType"],4033:["IS","AcquisitionSampleSize"],4034:["DS","RectifierSmoothing"],4035:["SQ","DACSequence"],4036:["CS","DACType"],4038:["DS","DACGainPoints"],"403A":["DS","DACTimePoints"],"403C":["DS","DACAmplitude"],4040:["SQ","PreAmplifierSettingsSequence"],4050:["SQ","TransmitTransducerSettingsSequence"],4051:["SQ","ReceiveTransducerSettingsSequence"],4052:["DS","IncidentAngle"],4054:["ST","CouplingTechnique"],4056:["ST","CouplingMedium"],4057:["DS","CouplingVelocity"],4058:["DS","CrystalCenterLocationX"],4059:["DS","CrystalCenterLocationZ"],"405A":["DS","SoundPathLength"],"405C":["ST","DelayLawIdentifier"],4060:["SQ","GateSettingsSequence"],4062:["DS","GateThreshold"],4064:["DS","VelocityOfSound"],4070:["SQ","CalibrationSettingsSequence"],4072:["ST","CalibrationProcedure"],4074:["SH","ProcedureVersion"],4076:["DA","ProcedureCreationDate"],4078:["DA","ProcedureExpirationDate"],"407A":["DA","ProcedureLastModifiedDate"],"407C":["TM","CalibrationTime"],"407E":["DA","CalibrationDate"],5002:["IS","LINACEnergy"],5004:["IS","LINACOutput"]},"0018":{"0010":["LO","ContrastBolusAgent"],"0012":["SQ","ContrastBolusAgentSequence"],"0014":["SQ","ContrastBolusAdministrationRouteSequence"],"0015":["CS","BodyPartExamined"],"0020":["CS","ScanningSequence"],"0021":["CS","SequenceVariant"],"0022":["CS","ScanOptions"],"0023":["CS","MRAcquisitionType"],"0024":["SH","SequenceName"],"0025":["CS","AngioFlag"],"0026":["SQ","InterventionDrugInformationSequence"],"0027":["TM","InterventionDrugStopTime"],"0028":["DS","InterventionDrugDose"],"0029":["SQ","InterventionDrugCodeSequence"],"002A":["SQ","AdditionalDrugSequence"],"0030":["LO","Radionuclide"],"0031":["LO","Radiopharmaceutical"],"0032":["DS","EnergyWindowCenterline"],"0033":["DS","EnergyWindowTotalWidth"],"0034":["LO","InterventionDrugName"],"0035":["TM","InterventionDrugStartTime"],"0036":["SQ","InterventionSequence"],"0037":["CS","TherapyType"],"0038":["CS","InterventionStatus"],"0039":["CS","TherapyDescription"],"003A":["ST","InterventionDescription"],"0040":["IS","CineRate"],"0042":["CS","InitialCineRunState"],"0050":["DS","SliceThickness"],"0060":["DS","KVP"],"0070":["IS","CountsAccumulated"],"0071":["CS","AcquisitionTerminationCondition"],"0072":["DS","EffectiveDuration"],"0073":["CS","AcquisitionStartCondition"],"0074":["IS","AcquisitionStartConditionData"],"0075":["IS","AcquisitionTerminationConditionData"],"0080":["DS","RepetitionTime"],"0081":["DS","EchoTime"],"0082":["DS","InversionTime"],"0083":["DS","NumberOfAverages"],"0084":["DS","ImagingFrequency"],"0085":["SH","ImagedNucleus"],"0086":["IS","EchoNumbers"],"0087":["DS","MagneticFieldStrength"],"0088":["DS","SpacingBetweenSlices"],"0089":["IS","NumberOfPhaseEncodingSteps"],"0090":["DS","DataCollectionDiameter"],"0091":["IS","EchoTrainLength"],"0093":["DS","PercentSampling"],"0094":["DS","PercentPhaseFieldOfView"],"0095":["DS","PixelBandwidth"],1e3:["LO","DeviceSerialNumber"],1002:["UI","DeviceUID"],1003:["LO","DeviceID"],1004:["LO","PlateID"],1005:["LO","GeneratorID"],1006:["LO","GridID"],1007:["LO","CassetteID"],1008:["LO","GantryID"],1010:["LO","SecondaryCaptureDeviceID"],1011:["LO","HardcopyCreationDeviceID"],1012:["DA","DateOfSecondaryCapture"],1014:["TM","TimeOfSecondaryCapture"],1016:["LO","SecondaryCaptureDeviceManufacturer"],1017:["LO","HardcopyDeviceManufacturer"],1018:["LO","SecondaryCaptureDeviceManufacturerModelName"],1019:["LO","SecondaryCaptureDeviceSoftwareVersions"],"101A":["LO","HardcopyDeviceSoftwareVersion"],"101B":["LO","HardcopyDeviceManufacturerModelName"],1020:["LO","SoftwareVersions"],1022:["SH","VideoImageFormatAcquired"],1023:["LO","DigitalImageFormatAcquired"],1030:["LO","ProtocolName"],1040:["LO","ContrastBolusRoute"],1041:["DS","ContrastBolusVolume"],1042:["TM","ContrastBolusStartTime"],1043:["TM","ContrastBolusStopTime"],1044:["DS","ContrastBolusTotalDose"],1045:["IS","SyringeCounts"],1046:["DS","ContrastFlowRate"],1047:["DS","ContrastFlowDuration"],1048:["CS","ContrastBolusIngredient"],1049:["DS","ContrastBolusIngredientConcentration"],1050:["DS","SpatialResolution"],1060:["DS","TriggerTime"],1061:["LO","TriggerSourceOrType"],1062:["IS","NominalInterval"],1063:["DS","FrameTime"],1064:["LO","CardiacFramingType"],1065:["DS","FrameTimeVector"],1066:["DS","FrameDelay"],1067:["DS","ImageTriggerDelay"],1068:["DS","MultiplexGroupTimeOffset"],1069:["DS","TriggerTimeOffset"],"106A":["CS","SynchronizationTrigger"],"106C":["US","SynchronizationChannel"],"106E":["UL","TriggerSamplePosition"],1070:["LO","RadiopharmaceuticalRoute"],1071:["DS","RadiopharmaceuticalVolume"],1072:["TM","RadiopharmaceuticalStartTime"],1073:["TM","RadiopharmaceuticalStopTime"],1074:["DS","RadionuclideTotalDose"],1075:["DS","RadionuclideHalfLife"],1076:["DS","RadionuclidePositronFraction"],1077:["DS","RadiopharmaceuticalSpecificActivity"],1078:["DT","RadiopharmaceuticalStartDateTime"],1079:["DT","RadiopharmaceuticalStopDateTime"],1080:["CS","BeatRejectionFlag"],1081:["IS","LowRRValue"],1082:["IS","HighRRValue"],1083:["IS","IntervalsAcquired"],1084:["IS","IntervalsRejected"],1085:["LO","PVCRejection"],1086:["IS","SkipBeats"],1088:["IS","HeartRate"],1090:["IS","CardiacNumberOfImages"],1094:["IS","TriggerWindow"],1100:["DS","ReconstructionDiameter"],1110:["DS","DistanceSourceToDetector"],1111:["DS","DistanceSourceToPatient"],1114:["DS","EstimatedRadiographicMagnificationFactor"],1120:["DS","GantryDetectorTilt"],1121:["DS","GantryDetectorSlew"],1130:["DS","TableHeight"],1131:["DS","TableTraverse"],1134:["CS","TableMotion"],1135:["DS","TableVerticalIncrement"],1136:["DS","TableLateralIncrement"],1137:["DS","TableLongitudinalIncrement"],1138:["DS","TableAngle"],"113A":["CS","TableType"],1140:["CS","RotationDirection"],1141:["DS","AngularPosition"],1142:["DS","RadialPosition"],1143:["DS","ScanArc"],1144:["DS","AngularStep"],1145:["DS","CenterOfRotationOffset"],1146:["DS","RotationOffset"],1147:["CS","FieldOfViewShape"],1149:["IS","FieldOfViewDimensions"],1150:["IS","ExposureTime"],1151:["IS","XRayTubeCurrent"],1152:["IS","Exposure"],1153:["IS","ExposureInuAs"],1154:["DS","AveragePulseWidth"],1155:["CS","RadiationSetting"],1156:["CS","RectificationType"],"115A":["CS","RadiationMode"],"115E":["DS","ImageAndFluoroscopyAreaDoseProduct"],1160:["SH","FilterType"],1161:["LO","TypeOfFilters"],1162:["DS","IntensifierSize"],1164:["DS","ImagerPixelSpacing"],1166:["CS","Grid"],1170:["IS","GeneratorPower"],1180:["SH","CollimatorGridName"],1181:["CS","CollimatorType"],1182:["IS","FocalDistance"],1183:["DS","XFocusCenter"],1184:["DS","YFocusCenter"],1190:["DS","FocalSpots"],1191:["CS","AnodeTargetMaterial"],"11A0":["DS","BodyPartThickness"],"11A2":["DS","CompressionForce"],1200:["DA","DateOfLastCalibration"],1201:["TM","TimeOfLastCalibration"],1210:["SH","ConvolutionKernel"],1240:["IS","UpperLowerPixelValues"],1242:["IS","ActualFrameDuration"],1243:["IS","CountRate"],1244:["US","PreferredPlaybackSequencing"],1250:["SH","ReceiveCoilName"],1251:["SH","TransmitCoilName"],1260:["SH","PlateType"],1261:["LO","PhosphorType"],1300:["DS","ScanVelocity"],1301:["CS","WholeBodyTechnique"],1302:["IS","ScanLength"],1310:["US","AcquisitionMatrix"],1312:["CS","InPlanePhaseEncodingDirection"],1314:["DS","FlipAngle"],1315:["CS","VariableFlipAngleFlag"],1316:["DS","SAR"],1318:["DS","dBdt"],1400:["LO","AcquisitionDeviceProcessingDescription"],1401:["LO","AcquisitionDeviceProcessingCode"],1402:["CS","CassetteOrientation"],1403:["CS","CassetteSize"],1404:["US","ExposuresOnPlate"],1405:["IS","RelativeXRayExposure"],1411:["DS","ExposureIndex"],1412:["DS","TargetExposureIndex"],1413:["DS","DeviationIndex"],1450:["DS","ColumnAngulation"],1460:["DS","TomoLayerHeight"],1470:["DS","TomoAngle"],1480:["DS","TomoTime"],1490:["CS","TomoType"],1491:["CS","TomoClass"],1495:["IS","NumberOfTomosynthesisSourceImages"],1500:["CS","PositionerMotion"],1508:["CS","PositionerType"],1510:["DS","PositionerPrimaryAngle"],1511:["DS","PositionerSecondaryAngle"],1520:["DS","PositionerPrimaryAngleIncrement"],1521:["DS","PositionerSecondaryAngleIncrement"],1530:["DS","DetectorPrimaryAngle"],1531:["DS","DetectorSecondaryAngle"],1600:["CS","ShutterShape"],1602:["IS","ShutterLeftVerticalEdge"],1604:["IS","ShutterRightVerticalEdge"],1606:["IS","ShutterUpperHorizontalEdge"],1608:["IS","ShutterLowerHorizontalEdge"],1610:["IS","CenterOfCircularShutter"],1612:["IS","RadiusOfCircularShutter"],1620:["IS","VerticesOfThePolygonalShutter"],1622:["US","ShutterPresentationValue"],1623:["US","ShutterOverlayGroup"],1624:["US","ShutterPresentationColorCIELabValue"],1700:["CS","CollimatorShape"],1702:["IS","CollimatorLeftVerticalEdge"],1704:["IS","CollimatorRightVerticalEdge"],1706:["IS","CollimatorUpperHorizontalEdge"],1708:["IS","CollimatorLowerHorizontalEdge"],1710:["IS","CenterOfCircularCollimator"],1712:["IS","RadiusOfCircularCollimator"],1720:["IS","VerticesOfThePolygonalCollimator"],1800:["CS","AcquisitionTimeSynchronized"],1801:["SH","TimeSource"],1802:["CS","TimeDistributionProtocol"],1803:["LO","NTPSourceAddress"],2001:["IS","PageNumberVector"],2002:["SH","FrameLabelVector"],2003:["DS","FramePrimaryAngleVector"],2004:["DS","FrameSecondaryAngleVector"],2005:["DS","SliceLocationVector"],2006:["SH","DisplayWindowLabelVector"],2010:["DS","NominalScannedPixelSpacing"],2020:["CS","DigitizingDeviceTransportDirection"],2030:["DS","RotationOfScannedFilm"],3100:["CS","IVUSAcquisition"],3101:["DS","IVUSPullbackRate"],3102:["DS","IVUSGatedRate"],3103:["IS","IVUSPullbackStartFrameNumber"],3104:["IS","IVUSPullbackStopFrameNumber"],3105:["IS","LesionNumber"],4e3:["LT","AcquisitionComments"],5e3:["SH","OutputPower"],5010:["LO","TransducerData"],5012:["DS","FocusDepth"],5020:["LO","ProcessingFunction"],5021:["LO","PostprocessingFunction"],5022:["DS","MechanicalIndex"],5024:["DS","BoneThermalIndex"],5026:["DS","CranialThermalIndex"],5027:["DS","SoftTissueThermalIndex"],5028:["DS","SoftTissueFocusThermalIndex"],5029:["DS","SoftTissueSurfaceThermalIndex"],5030:["DS","DynamicRange"],5040:["DS","TotalGain"],5050:["IS","DepthOfScanField"],5100:["CS","PatientPosition"],5101:["CS","ViewPosition"],5104:["SQ","ProjectionEponymousNameCodeSequence"],5210:["DS","ImageTransformationMatrix"],5212:["DS","ImageTranslationVector"],6e3:["DS","Sensitivity"],6011:["SQ","SequenceOfUltrasoundRegions"],6012:["US","RegionSpatialFormat"],6014:["US","RegionDataType"],6016:["UL","RegionFlags"],6018:["UL","RegionLocationMinX0"],"601A":["UL","RegionLocationMinY0"],"601C":["UL","RegionLocationMaxX1"],"601E":["UL","RegionLocationMaxY1"],6020:["SL","ReferencePixelX0"],6022:["SL","ReferencePixelY0"],6024:["US","PhysicalUnitsXDirection"],6026:["US","PhysicalUnitsYDirection"],6028:["FD","ReferencePixelPhysicalValueX"],"602A":["FD","ReferencePixelPhysicalValueY"],"602C":["FD","PhysicalDeltaX"],"602E":["FD","PhysicalDeltaY"],6030:["UL","TransducerFrequency"],6031:["CS","TransducerType"],6032:["UL","PulseRepetitionFrequency"],6034:["FD","DopplerCorrectionAngle"],6036:["FD","SteeringAngle"],6038:["UL","DopplerSampleVolumeXPositionRetired"],6039:["SL","DopplerSampleVolumeXPosition"],"603A":["UL","DopplerSampleVolumeYPositionRetired"],"603B":["SL","DopplerSampleVolumeYPosition"],"603C":["UL","TMLinePositionX0Retired"],"603D":["SL","TMLinePositionX0"],"603E":["UL","TMLinePositionY0Retired"],"603F":["SL","TMLinePositionY0"],6040:["UL","TMLinePositionX1Retired"],6041:["SL","TMLinePositionX1"],6042:["UL","TMLinePositionY1Retired"],6043:["SL","TMLinePositionY1"],6044:["US","PixelComponentOrganization"],6046:["UL","PixelComponentMask"],6048:["UL","PixelComponentRangeStart"],"604A":["UL","PixelComponentRangeStop"],"604C":["US","PixelComponentPhysicalUnits"],"604E":["US","PixelComponentDataType"],6050:["UL","NumberOfTableBreakPoints"],6052:["UL","TableOfXBreakPoints"],6054:["FD","TableOfYBreakPoints"],6056:["UL","NumberOfTableEntries"],6058:["UL","TableOfPixelValues"],"605A":["FL","TableOfParameterValues"],6060:["FL","RWaveTimeVector"],7e3:["CS","DetectorConditionsNominalFlag"],7001:["DS","DetectorTemperature"],7004:["CS","DetectorType"],7005:["CS","DetectorConfiguration"],7006:["LT","DetectorDescription"],7008:["LT","DetectorMode"],"700A":["SH","DetectorID"],"700C":["DA","DateOfLastDetectorCalibration"],"700E":["TM","TimeOfLastDetectorCalibration"],7010:["IS","ExposuresOnDetectorSinceLastCalibration"],7011:["IS","ExposuresOnDetectorSinceManufactured"],7012:["DS","DetectorTimeSinceLastExposure"],7014:["DS","DetectorActiveTime"],7016:["DS","DetectorActivationOffsetFromExposure"],"701A":["DS","DetectorBinning"],7020:["DS","DetectorElementPhysicalSize"],7022:["DS","DetectorElementSpacing"],7024:["CS","DetectorActiveShape"],7026:["DS","DetectorActiveDimensions"],7028:["DS","DetectorActiveOrigin"],"702A":["LO","DetectorManufacturerName"],"702B":["LO","DetectorManufacturerModelName"],7030:["DS","FieldOfViewOrigin"],7032:["DS","FieldOfViewRotation"],7034:["CS","FieldOfViewHorizontalFlip"],7036:["FL","PixelDataAreaOriginRelativeToFOV"],7038:["FL","PixelDataAreaRotationAngleRelativeToFOV"],7040:["LT","GridAbsorbingMaterial"],7041:["LT","GridSpacingMaterial"],7042:["DS","GridThickness"],7044:["DS","GridPitch"],7046:["IS","GridAspectRatio"],7048:["DS","GridPeriod"],"704C":["DS","GridFocalDistance"],7050:["CS","FilterMaterial"],7052:["DS","FilterThicknessMinimum"],7054:["DS","FilterThicknessMaximum"],7056:["FL","FilterBeamPathLengthMinimum"],7058:["FL","FilterBeamPathLengthMaximum"],7060:["CS","ExposureControlMode"],7062:["LT","ExposureControlModeDescription"],7064:["CS","ExposureStatus"],7065:["DS","PhototimerSetting"],8150:["DS","ExposureTimeInuS"],8151:["DS","XRayTubeCurrentInuA"],9004:["CS","ContentQualification"],9005:["SH","PulseSequenceName"],9006:["SQ","MRImagingModifierSequence"],9008:["CS","EchoPulseSequence"],9009:["CS","InversionRecovery"],9010:["CS","FlowCompensation"],9011:["CS","MultipleSpinEcho"],9012:["CS","MultiPlanarExcitation"],9014:["CS","PhaseContrast"],9015:["CS","TimeOfFlightContrast"],9016:["CS","Spoiling"],9017:["CS","SteadyStatePulseSequence"],9018:["CS","EchoPlanarPulseSequence"],9019:["FD","TagAngleFirstAxis"],9020:["CS","MagnetizationTransfer"],9021:["CS","T2Preparation"],9022:["CS","BloodSignalNulling"],9024:["CS","SaturationRecovery"],9025:["CS","SpectrallySelectedSuppression"],9026:["CS","SpectrallySelectedExcitation"],9027:["CS","SpatialPresaturation"],9028:["CS","Tagging"],9029:["CS","OversamplingPhase"],9030:["FD","TagSpacingFirstDimension"],9032:["CS","GeometryOfKSpaceTraversal"],9033:["CS","SegmentedKSpaceTraversal"],9034:["CS","RectilinearPhaseEncodeReordering"],9035:["FD","TagThickness"],9036:["CS","PartialFourierDirection"],9037:["CS","CardiacSynchronizationTechnique"],9041:["LO","ReceiveCoilManufacturerName"],9042:["SQ","MRReceiveCoilSequence"],9043:["CS","ReceiveCoilType"],9044:["CS","QuadratureReceiveCoil"],9045:["SQ","MultiCoilDefinitionSequence"],9046:["LO","MultiCoilConfiguration"],9047:["SH","MultiCoilElementName"],9048:["CS","MultiCoilElementUsed"],9049:["SQ","MRTransmitCoilSequence"],9050:["LO","TransmitCoilManufacturerName"],9051:["CS","TransmitCoilType"],9052:["FD","SpectralWidth"],9053:["FD","ChemicalShiftReference"],9054:["CS","VolumeLocalizationTechnique"],9058:["US","MRAcquisitionFrequencyEncodingSteps"],9059:["CS","Decoupling"],9060:["CS","DecoupledNucleus"],9061:["FD","DecouplingFrequency"],9062:["CS","DecouplingMethod"],9063:["FD","DecouplingChemicalShiftReference"],9064:["CS","KSpaceFiltering"],9065:["CS","TimeDomainFiltering"],9066:["US","NumberOfZeroFills"],9067:["CS","BaselineCorrection"],9069:["FD","ParallelReductionFactorInPlane"],9070:["FD","CardiacRRIntervalSpecified"],9073:["FD","AcquisitionDuration"],9074:["DT","FrameAcquisitionDateTime"],9075:["CS","DiffusionDirectionality"],9076:["SQ","DiffusionGradientDirectionSequence"],9077:["CS","ParallelAcquisition"],9078:["CS","ParallelAcquisitionTechnique"],9079:["FD","InversionTimes"],9080:["ST","MetaboliteMapDescription"],9081:["CS","PartialFourier"],9082:["FD","EffectiveEchoTime"],9083:["SQ","MetaboliteMapCodeSequence"],9084:["SQ","ChemicalShiftSequence"],9085:["CS","CardiacSignalSource"],9087:["FD","DiffusionBValue"],9089:["FD","DiffusionGradientOrientation"],9090:["FD","VelocityEncodingDirection"],9091:["FD","VelocityEncodingMinimumValue"],9092:["SQ","VelocityEncodingAcquisitionSequence"],9093:["US","NumberOfKSpaceTrajectories"],9094:["CS","CoverageOfKSpace"],9095:["UL","SpectroscopyAcquisitionPhaseRows"],9096:["FD","ParallelReductionFactorInPlaneRetired"],9098:["FD","TransmitterFrequency"],9100:["CS","ResonantNucleus"],9101:["CS","FrequencyCorrection"],9103:["SQ","MRSpectroscopyFOVGeometrySequence"],9104:["FD","SlabThickness"],9105:["FD","SlabOrientation"],9106:["FD","MidSlabPosition"],9107:["SQ","MRSpatialSaturationSequence"],9112:["SQ","MRTimingAndRelatedParametersSequence"],9114:["SQ","MREchoSequence"],9115:["SQ","MRModifierSequence"],9117:["SQ","MRDiffusionSequence"],9118:["SQ","CardiacSynchronizationSequence"],9119:["SQ","MRAveragesSequence"],9125:["SQ","MRFOVGeometrySequence"],9126:["SQ","VolumeLocalizationSequence"],9127:["UL","SpectroscopyAcquisitionDataColumns"],9147:["CS","DiffusionAnisotropyType"],9151:["DT","FrameReferenceDateTime"],9152:["SQ","MRMetaboliteMapSequence"],9155:["FD","ParallelReductionFactorOutOfPlane"],9159:["UL","SpectroscopyAcquisitionOutOfPlanePhaseSteps"],9166:["CS","BulkMotionStatus"],9168:["FD","ParallelReductionFactorSecondInPlane"],9169:["CS","CardiacBeatRejectionTechnique"],9170:["CS","RespiratoryMotionCompensationTechnique"],9171:["CS","RespiratorySignalSource"],9172:["CS","BulkMotionCompensationTechnique"],9173:["CS","BulkMotionSignalSource"],9174:["CS","ApplicableSafetyStandardAgency"],9175:["LO","ApplicableSafetyStandardDescription"],9176:["SQ","OperatingModeSequence"],9177:["CS","OperatingModeType"],9178:["CS","OperatingMode"],9179:["CS","SpecificAbsorptionRateDefinition"],9180:["CS","GradientOutputType"],9181:["FD","SpecificAbsorptionRateValue"],9182:["FD","GradientOutput"],9183:["CS","FlowCompensationDirection"],9184:["FD","TaggingDelay"],9185:["ST","RespiratoryMotionCompensationTechniqueDescription"],9186:["SH","RespiratorySignalSourceID"],9195:["FD","ChemicalShiftMinimumIntegrationLimitInHz"],9196:["FD","ChemicalShiftMaximumIntegrationLimitInHz"],9197:["SQ","MRVelocityEncodingSequence"],9198:["CS","FirstOrderPhaseCorrection"],9199:["CS","WaterReferencedPhaseCorrection"],9200:["CS","MRSpectroscopyAcquisitionType"],9214:["CS","RespiratoryCyclePosition"],9217:["FD","VelocityEncodingMaximumValue"],9218:["FD","TagSpacingSecondDimension"],9219:["SS","TagAngleSecondAxis"],9220:["FD","FrameAcquisitionDuration"],9226:["SQ","MRImageFrameTypeSequence"],9227:["SQ","MRSpectroscopyFrameTypeSequence"],9231:["US","MRAcquisitionPhaseEncodingStepsInPlane"],9232:["US","MRAcquisitionPhaseEncodingStepsOutOfPlane"],9234:["UL","SpectroscopyAcquisitionPhaseColumns"],9236:["CS","CardiacCyclePosition"],9239:["SQ","SpecificAbsorptionRateSequence"],9240:["US","RFEchoTrainLength"],9241:["US","GradientEchoTrainLength"],9250:["CS","ArterialSpinLabelingContrast"],9251:["SQ","MRArterialSpinLabelingSequence"],9252:["LO","ASLTechniqueDescription"],9253:["US","ASLSlabNumber"],9254:["FD ","ASLSlabThickness"],9255:["FD ","ASLSlabOrientation"],9256:["FD ","ASLMidSlabPosition"],9257:["CS","ASLContext"],9258:["UL","ASLPulseTrainDuration"],9259:["CS","ASLCrusherFlag"],"925A":["FD","ASLCrusherFlow"],"925B":["LO","ASLCrusherDescription"],"925C":["CS","ASLBolusCutoffFlag"],"925D":["SQ","ASLBolusCutoffTimingSequence"],"925E":["LO","ASLBolusCutoffTechnique"],"925F":["UL","ASLBolusCutoffDelayTime"],9260:["SQ","ASLSlabSequence"],9295:["FD","ChemicalShiftMinimumIntegrationLimitInppm"],9296:["FD","ChemicalShiftMaximumIntegrationLimitInppm"],9301:["SQ","CTAcquisitionTypeSequence"],9302:["CS","AcquisitionType"],9303:["FD","TubeAngle"],9304:["SQ","CTAcquisitionDetailsSequence"],9305:["FD","RevolutionTime"],9306:["FD","SingleCollimationWidth"],9307:["FD","TotalCollimationWidth"],9308:["SQ","CTTableDynamicsSequence"],9309:["FD","TableSpeed"],9310:["FD","TableFeedPerRotation"],9311:["FD","SpiralPitchFactor"],9312:["SQ","CTGeometrySequence"],9313:["FD","DataCollectionCenterPatient"],9314:["SQ","CTReconstructionSequence"],9315:["CS","ReconstructionAlgorithm"],9316:["CS","ConvolutionKernelGroup"],9317:["FD","ReconstructionFieldOfView"],9318:["FD","ReconstructionTargetCenterPatient"],9319:["FD","ReconstructionAngle"],9320:["SH","ImageFilter"],9321:["SQ","CTExposureSequence"],9322:["FD","ReconstructionPixelSpacing"],9323:["CS","ExposureModulationType"],9324:["FD","EstimatedDoseSaving"],9325:["SQ","CTXRayDetailsSequence"],9326:["SQ","CTPositionSequence"],9327:["FD","TablePosition"],9328:["FD","ExposureTimeInms"],9329:["SQ","CTImageFrameTypeSequence"],9330:["FD","XRayTubeCurrentInmA"],9332:["FD","ExposureInmAs"],9333:["CS","ConstantVolumeFlag"],9334:["CS","FluoroscopyFlag"],9335:["FD","DistanceSourceToDataCollectionCenter"],9337:["US","ContrastBolusAgentNumber"],9338:["SQ","ContrastBolusIngredientCodeSequence"],9340:["SQ","ContrastAdministrationProfileSequence"],9341:["SQ","ContrastBolusUsageSequence"],9342:["CS","ContrastBolusAgentAdministered"],9343:["CS","ContrastBolusAgentDetected"],9344:["CS","ContrastBolusAgentPhase"],9345:["FD","CTDIvol"],9346:["SQ","CTDIPhantomTypeCodeSequence"],9351:["FL","CalciumScoringMassFactorPatient"],9352:["FL","CalciumScoringMassFactorDevice"],9353:["FL","EnergyWeightingFactor"],9360:["SQ","CTAdditionalXRaySourceSequence"],9401:["SQ","ProjectionPixelCalibrationSequence"],9402:["FL","DistanceSourceToIsocenter"],9403:["FL","DistanceObjectToTableTop"],9404:["FL","ObjectPixelSpacingInCenterOfBeam"],9405:["SQ","PositionerPositionSequence"],9406:["SQ","TablePositionSequence"],9407:["SQ","CollimatorShapeSequence"],9410:["CS","PlanesInAcquisition"],9412:["SQ","XAXRFFrameCharacteristicsSequence"],9417:["SQ","FrameAcquisitionSequence"],9420:["CS","XRayReceptorType"],9423:["LO","AcquisitionProtocolName"],9424:["LT","AcquisitionProtocolDescription"],9425:["CS","ContrastBolusIngredientOpaque"],9426:["FL","DistanceReceptorPlaneToDetectorHousing"],9427:["CS","IntensifierActiveShape"],9428:["FL","IntensifierActiveDimensions"],9429:["FL","PhysicalDetectorSize"],9430:["FL","PositionOfIsocenterProjection"],9432:["SQ","FieldOfViewSequence"],9433:["LO","FieldOfViewDescription"],9434:["SQ","ExposureControlSensingRegionsSequence"],9435:["CS","ExposureControlSensingRegionShape"],9436:["SS","ExposureControlSensingRegionLeftVerticalEdge"],9437:["SS","ExposureControlSensingRegionRightVerticalEdge"],9438:["SS","ExposureControlSensingRegionUpperHorizontalEdge"],9439:["SS","ExposureControlSensingRegionLowerHorizontalEdge"],9440:["SS","CenterOfCircularExposureControlSensingRegion"],9441:["US","RadiusOfCircularExposureControlSensingRegion"],9442:["SS","VerticesOfThePolygonalExposureControlSensingRegion"],9447:["FL","ColumnAngulationPatient"],9449:["FL","BeamAngle"],9451:["SQ","FrameDetectorParametersSequence"],9452:["FL","CalculatedAnatomyThickness"],9455:["SQ","CalibrationSequence"],9456:["SQ","ObjectThicknessSequence"],9457:["CS","PlaneIdentification"],9461:["FL","FieldOfViewDimensionsInFloat"],9462:["SQ","IsocenterReferenceSystemSequence"],9463:["FL","PositionerIsocenterPrimaryAngle"],9464:["FL","PositionerIsocenterSecondaryAngle"],9465:["FL","PositionerIsocenterDetectorRotationAngle"],9466:["FL","TableXPositionToIsocenter"],9467:["FL","TableYPositionToIsocenter"],9468:["FL","TableZPositionToIsocenter"],9469:["FL","TableHorizontalRotationAngle"],9470:["FL","TableHeadTiltAngle"],9471:["FL","TableCradleTiltAngle"],9472:["SQ","FrameDisplayShutterSequence"],9473:["FL","AcquiredImageAreaDoseProduct"],9474:["CS","CArmPositionerTabletopRelationship"],9476:["SQ","XRayGeometrySequence"],9477:["SQ","IrradiationEventIdentificationSequence"],9504:["SQ","XRay3DFrameTypeSequence"],9506:["SQ","ContributingSourcesSequence"],9507:["SQ","XRay3DAcquisitionSequence"],9508:["FL","PrimaryPositionerScanArc"],9509:["FL","SecondaryPositionerScanArc"],9510:["FL ","PrimaryPositionerScanStartAngle"],9511:["FL","SecondaryPositionerScanStartAngle"],9514:["FL","PrimaryPositionerIncrement"],9515:["FL","SecondaryPositionerIncrement"],9516:["DT","StartAcquisitionDateTime"],9517:["DT","EndAcquisitionDateTime"],9524:["LO","ApplicationName"],9525:["LO","ApplicationVersion"],9526:["LO","ApplicationManufacturer"],9527:["CS","AlgorithmType"],9528:["LO","AlgorithmDescription"],9530:["SQ","XRay3DReconstructionSequence"],9531:["LO","ReconstructionDescription"],9538:["SQ","PerProjectionAcquisitionSequence"],9601:["SQ","DiffusionBMatrixSequence"],9602:["FD","DiffusionBValueXX"],9603:["FD","DiffusionBValueXY"],9604:["FD","DiffusionBValueXZ"],9605:["FD","DiffusionBValueYY"],9606:["FD","DiffusionBValueYZ"],9607:["FD","DiffusionBValueZZ"],9701:["DT","DecayCorrectionDateTime"],9715:["FD","StartDensityThreshold"],9716:["FD","StartRelativeDensityDifferenceThreshold"],9717:["FD","StartCardiacTriggerCountThreshold"],9718:["FD","StartRespiratoryTriggerCountThreshold"],9719:["FD","TerminationCountsThreshold"],9720:["FD","TerminationDensityThreshold"],9721:["FD","TerminationRelativeDensityThreshold"],9722:["FD","TerminationTimeThreshold"],9723:["FD","TerminationCardiacTriggerCountThreshold"],9724:["FD","TerminationRespiratoryTriggerCountThreshold"],9725:["CS","DetectorGeometry"],9726:["FD","TransverseDetectorSeparation"],9727:["FD","AxialDetectorDimension"],9729:["US","RadiopharmaceuticalAgentNumber"],9732:["SQ","PETFrameAcquisitionSequence"],9733:["SQ","PETDetectorMotionDetailsSequence"],9734:["SQ","PETTableDynamicsSequence"],9735:["SQ","PETPositionSequence"],9736:["SQ","PETFrameCorrectionFactorsSequence"],9737:["SQ","RadiopharmaceuticalUsageSequence"],9738:["CS","AttenuationCorrectionSource"],9739:["US","NumberOfIterations"],9740:["US","NumberOfSubsets"],9749:["SQ","PETReconstructionSequence"],9751:["SQ","PETFrameTypeSequence"],9755:["CS","TimeOfFlightInformationUsed"],9756:["CS","ReconstructionType"],9758:["CS","DecayCorrected"],9759:["CS","AttenuationCorrected"],9760:["CS","ScatterCorrected"],9761:["CS","DeadTimeCorrected"],9762:["CS","GantryMotionCorrected"],9763:["CS","PatientMotionCorrected"],9764:["CS","CountLossNormalizationCorrected"],9765:["CS","RandomsCorrected"],9766:["CS","NonUniformRadialSamplingCorrected"],9767:["CS","SensitivityCalibrated"],9768:["CS","DetectorNormalizationCorrection"],9769:["CS","IterativeReconstructionMethod"],9770:["CS","AttenuationCorrectionTemporalRelationship"],9771:["SQ","PatientPhysiologicalStateSequence"],9772:["SQ","PatientPhysiologicalStateCodeSequence"],9801:["FD","DepthsOfFocus"],9803:["SQ","ExcludedIntervalsSequence"],9804:["DT","ExclusionStartDatetime"],9805:["FD","ExclusionDuration"],9806:["SQ","USImageDescriptionSequence"],9807:["SQ","ImageDataTypeSequence"],9808:["CS","DataType"],9809:["SQ","TransducerScanPatternCodeSequence"],"980B":["CS","AliasedDataType"],"980C":["CS","PositionMeasuringDeviceUsed"],"980D":["SQ","TransducerGeometryCodeSequence"],"980E":["SQ","TransducerBeamSteeringCodeSequence"],"980F":["SQ","TransducerApplicationCodeSequence"],A001:["SQ","ContributingEquipmentSequence"],A002:["DT","ContributionDateTime"],A003:["ST","ContributionDescription"]},"0020":{"000D":["UI","StudyInstanceUID"],"000E":["UI","SeriesInstanceUID"],"0010":["SH","StudyID"],"0011":["IS","SeriesNumber"],"0012":["IS","AcquisitionNumber"],"0013":["IS","InstanceNumber"],"0014":["IS","IsotopeNumber"],"0015":["IS","PhaseNumber"],"0016":["IS","IntervalNumber"],"0017":["IS","TimeSlotNumber"],"0018":["IS","AngleNumber"],"0019":["IS","ItemNumber"],"0020":["CS","PatientOrientation"],"0022":["IS","OverlayNumber"],"0024":["IS","CurveNumber"],"0026":["IS","LUTNumber"],"0030":["DS","ImagePosition"],"0032":["DS","ImagePositionPatient"],"0035":["DS","ImageOrientation"],"0037":["DS","ImageOrientationPatient"],"0050":["DS","Location"],"0052":["UI","FrameOfReferenceUID"],"0060":["CS","Laterality"],"0062":["CS","ImageLaterality"],"0070":["LO","ImageGeometryType"],"0080":["CS","MaskingImage"],"00AA":["IS","ReportNumber"],"0100":["IS","TemporalPositionIdentifier"],"0105":["IS","NumberOfTemporalPositions"],"0110":["DS","TemporalResolution"],"0200":["UI","SynchronizationFrameOfReferenceUID"],"0242":["UI","SOPInstanceUIDOfConcatenationSource"],1e3:["IS","SeriesInStudy"],1001:["IS","AcquisitionsInSeries"],1002:["IS","ImagesInAcquisition"],1003:["IS","ImagesInSeries"],1004:["IS","AcquisitionsInStudy"],1005:["IS","ImagesInStudy"],1020:["LO","Reference"],1040:["LO","PositionReferenceIndicator"],1041:["DS","SliceLocation"],1070:["IS","OtherStudyNumbers"],1200:["IS","NumberOfPatientRelatedStudies"],1202:["IS","NumberOfPatientRelatedSeries"],1204:["IS","NumberOfPatientRelatedInstances"],1206:["IS","NumberOfStudyRelatedSeries"],1208:["IS","NumberOfStudyRelatedInstances"],1209:["IS","NumberOfSeriesRelatedInstances"],3401:["CS","ModifyingDeviceID"],3402:["CS","ModifiedImageID"],3403:["DA","ModifiedImageDate"],3404:["LO","ModifyingDeviceManufacturer"],3405:["TM","ModifiedImageTime"],3406:["LO","ModifiedImageDescription"],4e3:["LT","ImageComments"],5e3:["AT","OriginalImageIdentification"],5002:["LO","OriginalImageIdentificationNomenclature"],9056:["SH","StackID"],9057:["UL","InStackPositionNumber"],9071:["SQ","FrameAnatomySequence"],9072:["CS","FrameLaterality"],9111:["SQ","FrameContentSequence"],9113:["SQ","PlanePositionSequence"],9116:["SQ","PlaneOrientationSequence"],9128:["UL","TemporalPositionIndex"],9153:["FD","NominalCardiacTriggerDelayTime"],9154:["FL","NominalCardiacTriggerTimePriorToRPeak"],9155:["FL","ActualCardiacTriggerTimePriorToRPeak"],9156:["US","FrameAcquisitionNumber"],9157:["UL","DimensionIndexValues"],9158:["LT","FrameComments"],9161:["UI","ConcatenationUID"],9162:["US","InConcatenationNumber"],9163:["US","InConcatenationTotalNumber"],9164:["UI","DimensionOrganizationUID"],9165:["AT","DimensionIndexPointer"],9167:["AT","FunctionalGroupPointer"],9213:["LO","DimensionIndexPrivateCreator"],9221:["SQ","DimensionOrganizationSequence"],9222:["SQ","DimensionIndexSequence"],9228:["UL","ConcatenationFrameOffsetNumber"],9238:["LO","FunctionalGroupPrivateCreator"],9241:["FL","NominalPercentageOfCardiacPhase"],9245:["FL","NominalPercentageOfRespiratoryPhase"],9246:["FL","StartingRespiratoryAmplitude"],9247:["CS","StartingRespiratoryPhase"],9248:["FL","EndingRespiratoryAmplitude"],9249:["CS","EndingRespiratoryPhase"],9250:["CS","RespiratoryTriggerType"],9251:["FD","RRIntervalTimeNominal"],9252:["FD","ActualCardiacTriggerDelayTime"],9253:["SQ","RespiratorySynchronizationSequence"],9254:["FD","RespiratoryIntervalTime"],9255:["FD","NominalRespiratoryTriggerDelayTime"],9256:["FD","RespiratoryTriggerDelayThreshold"],9257:["FD","ActualRespiratoryTriggerDelayTime"],9301:["FD","ImagePositionVolume"],9302:["FD","ImageOrientationVolume"],9307:["CS","UltrasoundAcquisitionGeometry"],9308:["FD","ApexPosition"],9309:["FD","VolumeToTransducerMappingMatrix"],"930A":["FD","VolumeToTableMappingMatrix"],"930C":["CS","PatientFrameOfReferenceSource"],"930D":["FD","TemporalPositionTimeOffset"],"930E":["SQ","PlanePositionVolumeSequence"],"930F":["SQ","PlaneOrientationVolumeSequence"],9310:["SQ","TemporalPositionSequence"],9311:["CS","DimensionOrganizationType"],9312:["UI","VolumeFrameOfReferenceUID"],9313:["UI","TableFrameOfReferenceUID"],9421:["LO","DimensionDescriptionLabel"],9450:["SQ","PatientOrientationInFrameSequence"],9453:["LO","FrameLabel"],9518:["US","AcquisitionIndex"],9529:["SQ","ContributingSOPInstancesReferenceSequence"],9536:["US","ReconstructionIndex"]},"0022":{"0001":["US","LightPathFilterPassThroughWavelength"],"0002":["US","LightPathFilterPassBand"],"0003":["US","ImagePathFilterPassThroughWavelength"],"0004":["US","ImagePathFilterPassBand"],"0005":["CS","PatientEyeMovementCommanded"],"0006":["SQ","PatientEyeMovementCommandCodeSequence"],"0007":["FL","SphericalLensPower"],"0008":["FL","CylinderLensPower"],"0009":["FL","CylinderAxis"],"000A":["FL","EmmetropicMagnification"],"000B":["FL","IntraOcularPressure"],"000C":["FL","HorizontalFieldOfView"],"000D":["CS","PupilDilated"],"000E":["FL","DegreeOfDilation"],"0010":["FL","StereoBaselineAngle"],"0011":["FL","StereoBaselineDisplacement"],"0012":["FL","StereoHorizontalPixelOffset"],"0013":["FL","StereoVerticalPixelOffset"],"0014":["FL","StereoRotation"],"0015":["SQ","AcquisitionDeviceTypeCodeSequence"],"0016":["SQ","IlluminationTypeCodeSequence"],"0017":["SQ","LightPathFilterTypeStackCodeSequence"],"0018":["SQ","ImagePathFilterTypeStackCodeSequence"],"0019":["SQ","LensesCodeSequence"],"001A":["SQ","ChannelDescriptionCodeSequence"],"001B":["SQ","RefractiveStateSequence"],"001C":["SQ","MydriaticAgentCodeSequence"],"001D":["SQ","RelativeImagePositionCodeSequence"],"001E":["FL","CameraAngleOfView"],"0020":["SQ","StereoPairsSequence"],"0021":["SQ","LeftImageSequence"],"0022":["SQ","RightImageSequence"],"0030":["FL","AxialLengthOfTheEye"],"0031":["SQ","OphthalmicFrameLocationSequence"],"0032":["FL","ReferenceCoordinates"],"0035":["FL","DepthSpatialResolution"],"0036":["FL","MaximumDepthDistortion"],"0037":["FL","AlongScanSpatialResolution"],"0038":["FL","MaximumAlongScanDistortion"],"0039":["CS","OphthalmicImageOrientation"],"0041":["FL","DepthOfTransverseImage"],"0042":["SQ","MydriaticAgentConcentrationUnitsSequence"],"0048":["FL","AcrossScanSpatialResolution"],"0049":["FL","MaximumAcrossScanDistortion"],"004E":["DS","MydriaticAgentConcentration"],"0055":["FL","IlluminationWaveLength"],"0056":["FL","IlluminationPower"],"0057":["FL","IlluminationBandwidth"],"0058":["SQ","MydriaticAgentSequence"],1007:["SQ","OphthalmicAxialMeasurementsRightEyeSequence"],1008:["SQ","OphthalmicAxialMeasurementsLeftEyeSequence"],1010:["CS","OphthalmicAxialLengthMeasurementsType"],1019:["FL","OphthalmicAxialLength"],1024:["SQ","LensStatusCodeSequence"],1025:["SQ","VitreousStatusCodeSequence"],1028:["SQ","IOLFormulaCodeSequence"],1029:["LO","IOLFormulaDetail"],1033:["FL","KeratometerIndex"],1035:["SQ","SourceOfOphthalmicAxialLengthCodeSequence"],1037:["FL","TargetRefraction"],1039:["CS","RefractiveProcedureOccurred"],1040:["SQ","RefractiveSurgeryTypeCodeSequence"],1044:["SQ","OphthalmicUltrasoundAxialMeasurementsTypeCodeSequence"],1050:["SQ","OphthalmicAxialLengthMeasurementsSequence"],1053:["FL","IOLPower"],1054:["FL","PredictedRefractiveError"],1059:["FL","OphthalmicAxialLengthVelocity"],1065:["LO","LensStatusDescription"],1066:["LO","VitreousStatusDescription"],1090:["SQ","IOLPowerSequence"],1092:["SQ","LensConstantSequence"],1093:["LO","IOLManufacturer"],1094:["LO","LensConstantDescription"],1096:["SQ","KeratometryMeasurementTypeCodeSequence"],1100:["SQ","ReferencedOphthalmicAxialMeasurementsSequence"],1101:["SQ","OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence"],1103:["SQ","RefractiveErrorBeforeRefractiveSurgeryCodeSequence"],1121:["FL","IOLPowerForExactEmmetropia"],1122:["FL","IOLPowerForExactTargetRefraction"],1125:["SQ","AnteriorChamberDepthDefinitionCodeSequence"],1130:["FL","LensThickness"],1131:["FL","AnteriorChamberDepth"],1132:["SQ","SourceOfLensThicknessDataCodeSequence"],1133:["SQ","SourceOfAnteriorChamberDepthDataCodeSequence"],1135:["SQ","SourceOfRefractiveErrorDataCodeSequence"],1140:["CS","OphthalmicAxialLengthMeasurementModified"],1150:["SQ","OphthalmicAxialLengthDataSourceCodeSequence"],1153:["SQ","OphthalmicAxialLengthAcquisitionMethodCodeSequence"],1155:["FL","SignalToNoiseRatio"],1159:["LO","OphthalmicAxialLengthDataSourceDescription"],1210:["SQ","OphthalmicAxialLengthMeasurementsTotalLengthSequence"],1211:["SQ","OphthalmicAxialLengthMeasurementsSegmentalLengthSequence"],1212:["SQ","OphthalmicAxialLengthMeasurementsLengthSummationSequence"],1220:["SQ","UltrasoundOphthalmicAxialLengthMeasurementsSequence"],1225:["SQ","OpticalOphthalmicAxialLengthMeasurementsSequence"],1230:["SQ","UltrasoundSelectedOphthalmicAxialLengthSequence"],1250:["SQ","OphthalmicAxialLengthSelectionMethodCodeSequence"],1255:["SQ","OpticalSelectedOphthalmicAxialLengthSequence"],1257:["SQ","SelectedSegmentalOphthalmicAxialLengthSequence"],1260:["SQ","SelectedTotalOphthalmicAxialLengthSequence"],1262:["SQ","OphthalmicAxialLengthQualityMetricSequence"],1273:["LO","OphthalmicAxialLengthQualityMetricTypeDescription"],1300:["SQ","IntraocularLensCalculationsRightEyeSequence"],1310:["SQ","IntraocularLensCalculationsLeftEyeSequence"],1330:["SQ","ReferencedOphthalmicAxialLengthMeasurementQCImageSequence"]},"0024":{"0010":["FL","VisualFieldHorizontalExtent"],"0011":["FL","VisualFieldVerticalExtent"],"0012":["CS","VisualFieldShape"],"0016":["SQ","ScreeningTestModeCodeSequence"],"0018":["FL","MaximumStimulusLuminance"],"0020":["FL","BackgroundLuminance"],"0021":["SQ","StimulusColorCodeSequence"],"0024":["SQ","BackgroundIlluminationColorCodeSequence"],"0025":["FL","StimulusArea"],"0028":["FL","StimulusPresentationTime"],"0032":["SQ","FixationSequence"],"0033":["SQ","FixationMonitoringCodeSequence"],"0034":["SQ","VisualFieldCatchTrialSequence"],"0035":["US","FixationCheckedQuantity"],"0036":["US","PatientNotProperlyFixatedQuantity"],"0037":["CS","PresentedVisualStimuliDataFlag"],"0038":["US","NumberOfVisualStimuli"],"0039":["CS","ExcessiveFixationLossesDataFlag"],"0040":["CS","ExcessiveFixationLosses"],"0042":["US","StimuliRetestingQuantity"],"0044":["LT","CommentsOnPatientPerformanceOfVisualField"],"0045":["CS","FalseNegativesEstimateFlag"],"0046":["FL","FalseNegativesEstimate"],"0048":["US","NegativeCatchTrialsQuantity"],"0050":["US","FalseNegativesQuantity"],"0051":["CS","ExcessiveFalseNegativesDataFlag"],"0052":["CS","ExcessiveFalseNegatives"],"0053":["CS","FalsePositivesEstimateFlag"],"0054":["FL","FalsePositivesEstimate"],"0055":["CS","CatchTrialsDataFlag"],"0056":["US","PositiveCatchTrialsQuantity"],"0057":["CS","TestPointNormalsDataFlag"],"0058":["SQ","TestPointNormalsSequence"],"0059":["CS","GlobalDeviationProbabilityNormalsFlag"],"0060":["US","FalsePositivesQuantity"],"0061":["CS","ExcessiveFalsePositivesDataFlag"],"0062":["CS","ExcessiveFalsePositives"],"0063":["CS","VisualFieldTestNormalsFlag"],"0064":["SQ","ResultsNormalsSequence"],"0065":["SQ","AgeCorrectedSensitivityDeviationAlgorithmSequence"],"0066":["FL","GlobalDeviationFromNormal"],"0067":["SQ","GeneralizedDefectSensitivityDeviationAlgorithmSequence"],"0068":["FL","LocalizedDeviationfromNormal"],"0069":["LO","PatientReliabilityIndicator"],"0070":["FL","VisualFieldMeanSensitivity"],"0071":["FL","GlobalDeviationProbability"],"0072":["CS","LocalDeviationProbabilityNormalsFlag"],"0073":["FL","LocalizedDeviationProbability"],"0074":["CS","ShortTermFluctuationCalculated"],"0075":["FL","ShortTermFluctuation"],"0076":["CS","ShortTermFluctuationProbabilityCalculated"],"0077":["FL","ShortTermFluctuationProbability"],"0078":["CS","CorrectedLocalizedDeviationFromNormalCalculated"],"0079":["FL","CorrectedLocalizedDeviationFromNormal"],"0080":["CS","CorrectedLocalizedDeviationFromNormalProbabilityCalculated"],"0081":["FL","CorrectedLocalizedDeviationFromNormalProbability"],"0083":["SQ","GlobalDeviationProbabilitySequence"],"0085":["SQ","LocalizedDeviationProbabilitySequence"],"0086":["CS","FovealSensitivityMeasured"],"0087":["FL","FovealSensitivity"],"0088":["FL","VisualFieldTestDuration"],"0089":["SQ","VisualFieldTestPointSequence"],"0090":["FL","VisualFieldTestPointXCoordinate"],"0091":["FL","VisualFieldTestPointYCoordinate"],"0092":["FL","AgeCorrectedSensitivityDeviationValue"],"0093":["CS","StimulusResults"],"0094":["FL","SensitivityValue"],"0095":["CS","RetestStimulusSeen"],"0096":["FL","RetestSensitivityValue"],"0097":["SQ","VisualFieldTestPointNormalsSequence"],"0098":["FL","QuantifiedDefect"],"0100":["FL","AgeCorrectedSensitivityDeviationProbabilityValue"],"0102":["CS","GeneralizedDefectCorrectedSensitivityDeviationFlag "],"0103":["FL","GeneralizedDefectCorrectedSensitivityDeviationValue "],"0104":["FL","GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue"],"0105":["FL ","MinimumSensitivityValue"],"0106":["CS","BlindSpotLocalized"],"0107":["FL","BlindSpotXCoordinate"],"0108":["FL","BlindSpotYCoordinate "],"0110":["SQ","VisualAcuityMeasurementSequence"],"0112":["SQ","RefractiveParametersUsedOnPatientSequence"],"0113":["CS","MeasurementLaterality"],"0114":["SQ","OphthalmicPatientClinicalInformationLeftEyeSequence"],"0115":["SQ","OphthalmicPatientClinicalInformationRightEyeSequence"],"0117":["CS","FovealPointNormativeDataFlag"],"0118":["FL","FovealPointProbabilityValue"],"0120":["CS","ScreeningBaselineMeasured"],"0122":["SQ","ScreeningBaselineMeasuredSequence"],"0124":["CS","ScreeningBaselineType"],"0126":["FL","ScreeningBaselineValue"],"0202":["LO","AlgorithmSource"],"0306":["LO","DataSetName"],"0307":["LO","DataSetVersion"],"0308":["LO","DataSetSource"],"0309":["LO","DataSetDescription"],"0317":["SQ","VisualFieldTestReliabilityGlobalIndexSequence"],"0320":["SQ","VisualFieldGlobalResultsIndexSequence"],"0325":["SQ","DataObservationSequence"],"0338":["CS","IndexNormalsFlag"],"0341":["FL","IndexProbability"],"0344":["SQ","IndexProbabilitySequence"]},"0028":{"0002":["US","SamplesPerPixel"],"0003":["US","SamplesPerPixelUsed"],"0004":["CS","PhotometricInterpretation"],"0005":["US","ImageDimensions"],"0006":["US","PlanarConfiguration"],"0008":["IS","NumberOfFrames"],"0009":["AT","FrameIncrementPointer"],"000A":["AT","FrameDimensionPointer"],"0010":["US","Rows"],"0011":["US","Columns"],"0012":["US","Planes"],"0014":["US","UltrasoundColorDataPresent"],"0030":["DS","PixelSpacing"],"0031":["DS","ZoomFactor"],"0032":["DS","ZoomCenter"],"0034":["IS","PixelAspectRatio"],"0040":["CS","ImageFormat"],"0050":["LO","ManipulatedImage"],"0051":["CS","CorrectedImage"],"005F":["LO","CompressionRecognitionCode"],"0060":["CS","CompressionCode"],"0061":["SH","CompressionOriginator"],"0062":["LO","CompressionLabel"],"0063":["SH","CompressionDescription"],"0065":["CS","CompressionSequence"],"0066":["AT","CompressionStepPointers"],"0068":["US","RepeatInterval"],"0069":["US","BitsGrouped"],"0070":["US","PerimeterTable"],"0071":["SS","PerimeterValue"],"0080":["US","PredictorRows"],"0081":["US","PredictorColumns"],"0082":["US","PredictorConstants"],"0090":["CS","BlockedPixels"],"0091":["US","BlockRows"],"0092":["US","BlockColumns"],"0093":["US","RowOverlap"],"0094":["US","ColumnOverlap"],"0100":["US","BitsAllocated"],"0101":["US","BitsStored"],"0102":["US","HighBit"],"0103":["US","PixelRepresentation"],"0104":["SS","SmallestValidPixelValue"],"0105":["SS","LargestValidPixelValue"],"0106":["SS","SmallestImagePixelValue"],"0107":["SS","LargestImagePixelValue"],"0108":["SS","SmallestPixelValueInSeries"],"0109":["SS","LargestPixelValueInSeries"],"0110":["SS","SmallestImagePixelValueInPlane"],"0111":["SS","LargestImagePixelValueInPlane"],"0120":["SS","PixelPaddingValue"],"0121":["SS","PixelPaddingRangeLimit"],"0200":["US","ImageLocation"],"0300":["CS","QualityControlImage"],"0301":["CS","BurnedInAnnotation"],"0302":["CS","RecognizableVisualFeatures"],"0303":["CS","LongitudinalTemporalInformationModified"],"0400":["LO","TransformLabel"],"0401":["LO","TransformVersionNumber"],"0402":["US","NumberOfTransformSteps"],"0403":["LO","SequenceOfCompressedData"],"0404":["AT","DetailsOfCoefficients"],"0700":["LO","DCTLabel"],"0701":["CS","DataBlockDescription"],"0702":["AT","DataBlock"],"0710":["US","NormalizationFactorFormat"],"0720":["US","ZonalMapNumberFormat"],"0721":["AT","ZonalMapLocation"],"0722":["US","ZonalMapFormat"],"0730":["US","AdaptiveMapFormat"],"0740":["US","CodeNumberFormat"],"0A02":["CS","PixelSpacingCalibrationType"],"0A04":["LO","PixelSpacingCalibrationDescription"],1040:["CS","PixelIntensityRelationship"],1041:["SS","PixelIntensityRelationshipSign"],1050:["DS","WindowCenter"],1051:["DS","WindowWidth"],1052:["DS","RescaleIntercept"],1053:["DS","RescaleSlope"],1054:["LO","RescaleType"],1055:["LO","WindowCenterWidthExplanation"],1056:["CS","VOILUTFunction"],1080:["CS","GrayScale"],1090:["CS","RecommendedViewingMode"],1100:["SS","GrayLookupTableDescriptor"],1101:["SS","RedPaletteColorLookupTableDescriptor"],1102:["SS","GreenPaletteColorLookupTableDescriptor"],1103:["SS","BluePaletteColorLookupTableDescriptor"],1104:["US","AlphaPaletteColorLookupTableDescriptor"],1111:["SS","LargeRedPaletteColorLookupTableDescriptor"],1112:["SS","LargeGreenPaletteColorLookupTableDescriptor"],1113:["SS","LargeBluePaletteColorLookupTableDescriptor"],1199:["UI","PaletteColorLookupTableUID"],1200:["OW","GrayLookupTableData"],1201:["OW","RedPaletteColorLookupTableData"],1202:["OW","GreenPaletteColorLookupTableData"],1203:["OW","BluePaletteColorLookupTableData"],1204:["OW","AlphaPaletteColorLookupTableData"],1211:["OW","LargeRedPaletteColorLookupTableData"],1212:["OW","LargeGreenPaletteColorLookupTableData"],1213:["OW","LargeBluePaletteColorLookupTableData"],1214:["UI","LargePaletteColorLookupTableUID"],1221:["OW","SegmentedRedPaletteColorLookupTableData"],1222:["OW","SegmentedGreenPaletteColorLookupTableData"],1223:["OW","SegmentedBluePaletteColorLookupTableData"],1300:["CS","BreastImplantPresent"],1350:["CS","PartialView"],1351:["ST","PartialViewDescription"],1352:["SQ","PartialViewCodeSequence"],"135A":["CS","SpatialLocationsPreserved"],1401:["SQ","DataFrameAssignmentSequence"],1402:["CS","DataPathAssignment"],1403:["US","BitsMappedToColorLookupTable"],1404:["SQ","BlendingLUT1Sequence"],1405:["CS","BlendingLUT1TransferFunction"],1406:["FD","BlendingWeightConstant"],1407:["US","BlendingLookupTableDescriptor"],1408:["OW","BlendingLookupTableData"],"140B":["SQ","EnhancedPaletteColorLookupTableSequence"],"140C":["SQ","BlendingLUT2Sequence"],"140D":["CS","BlendingLUT2TransferFunction"],"140E":["CS","DataPathID"],"140F":["CS","RGBLUTTransferFunction"],1410:["CS","AlphaLUTTransferFunction"],2e3:["OB","ICCProfile"],2110:["CS","LossyImageCompression"],2112:["DS","LossyImageCompressionRatio"],2114:["CS","LossyImageCompressionMethod"],3e3:["SQ","ModalityLUTSequence"],3002:["SS","LUTDescriptor"],3003:["LO","LUTExplanation"],3004:["LO","ModalityLUTType"],3006:["OW","LUTData"],3010:["SQ","VOILUTSequence"],3110:["SQ","SoftcopyVOILUTSequence"],4e3:["LT","ImagePresentationComments"],5e3:["SQ","BiPlaneAcquisitionSequence"],6010:["US","RepresentativeFrameNumber"],6020:["US","FrameNumbersOfInterest"],6022:["LO","FrameOfInterestDescription"],6023:["CS","FrameOfInterestType"],6030:["US","MaskPointers"],6040:["US","RWavePointer"],6100:["SQ","MaskSubtractionSequence"],6101:["CS","MaskOperation"],6102:["US","ApplicableFrameRange"],6110:["US","MaskFrameNumbers"],6112:["US","ContrastFrameAveraging"],6114:["FL","MaskSubPixelShift"],6120:["SS","TIDOffset"],6190:["ST","MaskOperationExplanation"],"7FE0":["UT","PixelDataProviderURL"],9001:["UL","DataPointRows"],9002:["UL","DataPointColumns"],9003:["CS","SignalDomainColumns"],9099:["US","LargestMonochromePixelValue"],9108:["CS","DataRepresentation"],9110:["SQ","PixelMeasuresSequence"],9132:["SQ","FrameVOILUTSequence"],9145:["SQ","PixelValueTransformationSequence"],9235:["CS","SignalDomainRows"],9411:["FL","DisplayFilterPercentage"],9415:["SQ","FramePixelShiftSequence"],9416:["US","SubtractionItemID"],9422:["SQ","PixelIntensityRelationshipLUTSequence"],9443:["SQ","FramePixelDataPropertiesSequence"],9444:["CS","GeometricalProperties"],9445:["FL","GeometricMaximumDistortion"],9446:["CS","ImageProcessingApplied"],9454:["CS","MaskSelectionMode"],9474:["CS","LUTFunction"],9478:["FL","MaskVisibilityPercentage"],9501:["SQ","PixelShiftSequence"],9502:["SQ","RegionPixelShiftSequence"],9503:["SS","VerticesOfTheRegion"],9505:["SQ","MultiFramePresentationSequence"],9506:["US","PixelShiftFrameRange"],9507:["US","LUTFrameRange"],9520:["DS","ImageToEquipmentMappingMatrix"],9537:["CS","EquipmentCoordinateSystemIdentification"]},"0032":{"000A":["CS","StudyStatusID"],"000C":["CS","StudyPriorityID"],"0012":["LO","StudyIDIssuer"],"0032":["DA","StudyVerifiedDate"],"0033":["TM","StudyVerifiedTime"],"0034":["DA","StudyReadDate"],"0035":["TM","StudyReadTime"],1e3:["DA","ScheduledStudyStartDate"],1001:["TM","ScheduledStudyStartTime"],1010:["DA","ScheduledStudyStopDate"],1011:["TM","ScheduledStudyStopTime"],1020:["LO","ScheduledStudyLocation"],1021:["AE","ScheduledStudyLocationAETitle"],1030:["LO","ReasonForStudy"],1031:["SQ","RequestingPhysicianIdentificationSequence"],1032:["PN","RequestingPhysician"],1033:["LO","RequestingService"],1034:["SQ","RequestingServiceCodeSequence"],1040:["DA","StudyArrivalDate"],1041:["TM","StudyArrivalTime"],1050:["DA","StudyCompletionDate"],1051:["TM","StudyCompletionTime"],1055:["CS","StudyComponentStatusID"],1060:["LO","RequestedProcedureDescription"],1064:["SQ","RequestedProcedureCodeSequence"],1070:["LO","RequestedContrastAgent"],4e3:["LT","StudyComments"]},"0038":{"0004":["SQ","ReferencedPatientAliasSequence"],"0008":["CS","VisitStatusID"],"0010":["LO","AdmissionID"],"0011":["LO","IssuerOfAdmissionID"],"0014":["SQ","IssuerOfAdmissionIDSequence"],"0016":["LO","RouteOfAdmissions"],"001A":["DA","ScheduledAdmissionDate"],"001B":["TM","ScheduledAdmissionTime"],"001C":["DA","ScheduledDischargeDate"],"001D":["TM","ScheduledDischargeTime"],"001E":["LO","ScheduledPatientInstitutionResidence"],"0020":["DA","AdmittingDate"],"0021":["TM","AdmittingTime"],"0030":["DA","DischargeDate"],"0032":["TM","DischargeTime"],"0040":["LO","DischargeDiagnosisDescription"],"0044":["SQ","DischargeDiagnosisCodeSequence"],"0050":["LO","SpecialNeeds"],"0060":["LO","ServiceEpisodeID"],"0061":["LO","IssuerOfServiceEpisodeID"],"0062":["LO","ServiceEpisodeDescription"],"0064":["SQ","IssuerOfServiceEpisodeIDSequence"],"0100":["SQ","PertinentDocumentsSequence"],"0300":["LO","CurrentPatientLocation"],"0400":["LO","PatientInstitutionResidence"],"0500":["LO","PatientState"],"0502":["SQ","PatientClinicalTrialParticipationSequence"],4e3:["LT","VisitComments"]},"003A":{"0004":["CS","WaveformOriginality"],"0005":["US","NumberOfWaveformChannels"],"0010":["UL","NumberOfWaveformSamples"],"001A":["DS","SamplingFrequency"],"0020":["SH","MultiplexGroupLabel"],"0200":["SQ","ChannelDefinitionSequence"],"0202":["IS","WaveformChannelNumber"],"0203":["SH","ChannelLabel"],"0205":["CS","ChannelStatus"],"0208":["SQ","ChannelSourceSequence"],"0209":["SQ","ChannelSourceModifiersSequence"],"020A":["SQ","SourceWaveformSequence"],"020C":["LO","ChannelDerivationDescription"],"0210":["DS","ChannelSensitivity"],"0211":["SQ","ChannelSensitivityUnitsSequence"],"0212":["DS","ChannelSensitivityCorrectionFactor"],"0213":["DS","ChannelBaseline"],"0214":["DS","ChannelTimeSkew"],"0215":["DS","ChannelSampleSkew"],"0218":["DS","ChannelOffset"],"021A":["US","WaveformBitsStored"],"0220":["DS","FilterLowFrequency"],"0221":["DS","FilterHighFrequency"],"0222":["DS","NotchFilterFrequency"],"0223":["DS","NotchFilterBandwidth"],"0230":["FL","WaveformDataDisplayScale"],"0231":["US","WaveformDisplayBackgroundCIELabValue"],"0240":["SQ","WaveformPresentationGroupSequence"],"0241":["US","PresentationGroupNumber"],"0242":["SQ","ChannelDisplaySequence"],"0244":["US","ChannelRecommendedDisplayCIELabValue"],"0245":["FL","ChannelPosition"],"0246":["CS","DisplayShadingFlag"],"0247":["FL","FractionalChannelDisplayScale"],"0248":["FL","AbsoluteChannelDisplayScale"],"0300":["SQ","MultiplexedAudioChannelsDescriptionCodeSequence"],"0301":["IS","ChannelIdentificationCode"],"0302":["CS","ChannelMode"]},"0040":{"0001":["AE","ScheduledStationAETitle"],"0002":["DA","ScheduledProcedureStepStartDate"],"0003":["TM","ScheduledProcedureStepStartTime"],"0004":["DA","ScheduledProcedureStepEndDate"],"0005":["TM","ScheduledProcedureStepEndTime"],"0006":["PN","ScheduledPerformingPhysicianName"],"0007":["LO","ScheduledProcedureStepDescription"],"0008":["SQ","ScheduledProtocolCodeSequence"],"0009":["SH","ScheduledProcedureStepID"],"000A":["SQ","StageCodeSequence"],"000B":["SQ","ScheduledPerformingPhysicianIdentificationSequence"],"0010":["SH","ScheduledStationName"],"0011":["SH","ScheduledProcedureStepLocation"],"0012":["LO","PreMedication"],"0020":["CS","ScheduledProcedureStepStatus"],"0026":["SQ","OrderPlacerIdentifierSequence"],"0027":["SQ","OrderFillerIdentifierSequence"],"0031":["UT","LocalNamespaceEntityID"],"0032":["UT","UniversalEntityID"],"0033":["CS","UniversalEntityIDType"],"0035":["CS","IdentifierTypeCode"],"0036":["SQ","AssigningFacilitySequence"],"0039":["SQ","AssigningJurisdictionCodeSequence"],"003A":["SQ","AssigningAgencyOrDepartmentCodeSequence"],"0100":["SQ","ScheduledProcedureStepSequence"],"0220":["SQ","ReferencedNonImageCompositeSOPInstanceSequence"],"0241":["AE","PerformedStationAETitle"],"0242":["SH","PerformedStationName"],"0243":["SH","PerformedLocation"],"0244":["DA","PerformedProcedureStepStartDate"],"0245":["TM","PerformedProcedureStepStartTime"],"0250":["DA","PerformedProcedureStepEndDate"],"0251":["TM","PerformedProcedureStepEndTime"],"0252":["CS","PerformedProcedureStepStatus"],"0253":["SH","PerformedProcedureStepID"],"0254":["LO","PerformedProcedureStepDescription"],"0255":["LO","PerformedProcedureTypeDescription"],"0260":["SQ","PerformedProtocolCodeSequence"],"0261":["CS","PerformedProtocolType"],"0270":["SQ","ScheduledStepAttributesSequence"],"0275":["SQ","RequestAttributesSequence"],"0280":["ST","CommentsOnThePerformedProcedureStep"],"0281":["SQ","PerformedProcedureStepDiscontinuationReasonCodeSequence"],"0293":["SQ","QuantitySequence"],"0294":["DS","Quantity"],"0295":["SQ","MeasuringUnitsSequence"],"0296":["SQ","BillingItemSequence"],"0300":["US","TotalTimeOfFluoroscopy"],"0301":["US","TotalNumberOfExposures"],"0302":["US","EntranceDose"],"0303":["US","ExposedArea"],"0306":["DS","DistanceSourceToEntrance"],"0307":["DS","DistanceSourceToSupport"],"030E":["SQ","ExposureDoseSequence"],"0310":["ST","CommentsOnRadiationDose"],"0312":["DS","XRayOutput"],"0314":["DS","HalfValueLayer"],"0316":["DS","OrganDose"],"0318":["CS","OrganExposed"],"0320":["SQ","BillingProcedureStepSequence"],"0321":["SQ","FilmConsumptionSequence"],"0324":["SQ","BillingSuppliesAndDevicesSequence"],"0330":["SQ","ReferencedProcedureStepSequence"],"0340":["SQ","PerformedSeriesSequence"],"0400":["LT","CommentsOnTheScheduledProcedureStep"],"0440":["SQ","ProtocolContextSequence"],"0441":["SQ","ContentItemModifierSequence"],"0500":["SQ","ScheduledSpecimenSequence"],"050A":["LO","SpecimenAccessionNumber"],"0512":["LO","ContainerIdentifier"],"0513":["SQ","IssuerOfTheContainerIdentifierSequence"],"0515":["SQ","AlternateContainerIdentifierSequence"],"0518":["SQ","ContainerTypeCodeSequence"],"051A":["LO","ContainerDescription"],"0520":["SQ","ContainerComponentSequence"],"0550":["SQ","SpecimenSequence"],"0551":["LO","SpecimenIdentifier"],"0552":["SQ","SpecimenDescriptionSequenceTrial"],"0553":["ST","SpecimenDescriptionTrial"],"0554":["UI","SpecimenUID"],"0555":["SQ","AcquisitionContextSequence"],"0556":["ST","AcquisitionContextDescription"],"059A":["SQ","SpecimenTypeCodeSequence"],"0560":["SQ","SpecimenDescriptionSequence"],"0562":["SQ","IssuerOfTheSpecimenIdentifierSequence"],"0600":["LO","SpecimenShortDescription"],"0602":["UT","SpecimenDetailedDescription"],"0610":["SQ","SpecimenPreparationSequence"],"0612":["SQ","SpecimenPreparationStepContentItemSequence"],"0620":["SQ","SpecimenLocalizationContentItemSequence"],"06FA":["LO","SlideIdentifier"],"071A":["SQ","ImageCenterPointCoordinatesSequence"],"072A":["DS","XOffsetInSlideCoordinateSystem"],"073A":["DS","YOffsetInSlideCoordinateSystem"],"074A":["DS","ZOffsetInSlideCoordinateSystem"],"08D8":["SQ","PixelSpacingSequence"],"08DA":["SQ","CoordinateSystemAxisCodeSequence"],"08EA":["SQ","MeasurementUnitsCodeSequence"],"09F8":["SQ","VitalStainCodeSequenceTrial"],1001:["SH","RequestedProcedureID"],1002:["LO","ReasonForTheRequestedProcedure"],1003:["SH","RequestedProcedurePriority"],1004:["LO","PatientTransportArrangements"],1005:["LO","RequestedProcedureLocation"],1006:["SH","PlacerOrderNumberProcedure"],1007:["SH","FillerOrderNumberProcedure"],1008:["LO","ConfidentialityCode"],1009:["SH","ReportingPriority"],"100A":["SQ","ReasonForRequestedProcedureCodeSequence"],1010:["PN","NamesOfIntendedRecipientsOfResults"],1011:["SQ","IntendedRecipientsOfResultsIdentificationSequence"],1012:["SQ","ReasonForPerformedProcedureCodeSequence"],1060:["LO","RequestedProcedureDescriptionTrial"],1101:["SQ","PersonIdentificationCodeSequence"],1102:["ST","PersonAddress"],1103:["LO","PersonTelephoneNumbers"],1400:["LT","RequestedProcedureComments"],2001:["LO","ReasonForTheImagingServiceRequest"],2004:["DA","IssueDateOfImagingServiceRequest"],2005:["TM","IssueTimeOfImagingServiceRequest"],2006:["SH","PlacerOrderNumberImagingServiceRequestRetired"],2007:["SH","FillerOrderNumberImagingServiceRequestRetired"],2008:["PN","OrderEnteredBy"],2009:["SH","OrderEntererLocation"],2010:["SH","OrderCallbackPhoneNumber"],2016:["LO","PlacerOrderNumberImagingServiceRequest"],2017:["LO","FillerOrderNumberImagingServiceRequest"],2400:["LT","ImagingServiceRequestComments"],3001:["LO","ConfidentialityConstraintOnPatientDataDescription"],4001:["CS","GeneralPurposeScheduledProcedureStepStatus"],4002:["CS","GeneralPurposePerformedProcedureStepStatus"],4003:["CS","GeneralPurposeScheduledProcedureStepPriority"],4004:["SQ","ScheduledProcessingApplicationsCodeSequence"],4005:["DT","ScheduledProcedureStepStartDateTime"],4006:["CS","MultipleCopiesFlag"],4007:["SQ","PerformedProcessingApplicationsCodeSequence"],4009:["SQ","HumanPerformerCodeSequence"],4010:["DT","ScheduledProcedureStepModificationDateTime"],4011:["DT","ExpectedCompletionDateTime"],4015:["SQ","ResultingGeneralPurposePerformedProcedureStepsSequence"],4016:["SQ","ReferencedGeneralPurposeScheduledProcedureStepSequence"],4018:["SQ","ScheduledWorkitemCodeSequence"],4019:["SQ","PerformedWorkitemCodeSequence"],4020:["CS","InputAvailabilityFlag"],4021:["SQ","InputInformationSequence"],4022:["SQ","RelevantInformationSequence"],4023:["UI","ReferencedGeneralPurposeScheduledProcedureStepTransactionUID"],4025:["SQ","ScheduledStationNameCodeSequence"],4026:["SQ","ScheduledStationClassCodeSequence"],4027:["SQ","ScheduledStationGeographicLocationCodeSequence"],4028:["SQ","PerformedStationNameCodeSequence"],4029:["SQ","PerformedStationClassCodeSequence"],4030:["SQ","PerformedStationGeographicLocationCodeSequence"],4031:["SQ","RequestedSubsequentWorkitemCodeSequence"],4032:["SQ","NonDICOMOutputCodeSequence"],4033:["SQ","OutputInformationSequence"],4034:["SQ","ScheduledHumanPerformersSequence"],4035:["SQ","ActualHumanPerformersSequence"],4036:["LO","HumanPerformerOrganization"],4037:["PN","HumanPerformerName"],4040:["CS","RawDataHandling"],4041:["CS","InputReadinessState"],4050:["DT","PerformedProcedureStepStartDateTime"],4051:["DT","PerformedProcedureStepEndDateTime"],4052:["DT","ProcedureStepCancellationDateTime"],8302:["DS","EntranceDoseInmGy"],9094:["SQ","ReferencedImageRealWorldValueMappingSequence"],9096:["SQ","RealWorldValueMappingSequence"],9098:["SQ","PixelValueMappingCodeSequence"],9210:["SH","LUTLabel"],9211:["SS","RealWorldValueLastValueMapped"],9212:["FD","RealWorldValueLUTData"],9216:["SS","RealWorldValueFirstValueMapped"],9224:["FD","RealWorldValueIntercept"],9225:["FD","RealWorldValueSlope"],A007:["CS","FindingsFlagTrial"],A010:["CS","RelationshipType"],A020:["SQ","FindingsSequenceTrial"],A021:["UI","FindingsGroupUIDTrial"],A022:["UI","ReferencedFindingsGroupUIDTrial"],A023:["DA","FindingsGroupRecordingDateTrial"],A024:["TM","FindingsGroupRecordingTimeTrial"],A026:["SQ","FindingsSourceCategoryCodeSequenceTrial"],A027:["LO","VerifyingOrganization"],A028:["SQ","DocumentingOrganizationIdentifierCodeSequenceTrial"],A030:["DT","VerificationDateTime"],A032:["DT","ObservationDateTime"],A040:["CS","ValueType"],A043:["SQ","ConceptNameCodeSequence"],A047:["LO","MeasurementPrecisionDescriptionTrial"],A050:["CS","ContinuityOfContent"],A057:["CS","UrgencyOrPriorityAlertsTrial"],A060:["LO","SequencingIndicatorTrial"],A066:["SQ","DocumentIdentifierCodeSequenceTrial"],A067:["PN","DocumentAuthorTrial"],A068:["SQ","DocumentAuthorIdentifierCodeSequenceTrial"],A070:["SQ","IdentifierCodeSequenceTrial"],A073:["SQ","VerifyingObserverSequence"],A074:["OB","ObjectBinaryIdentifierTrial"],A075:["PN","VerifyingObserverName"],A076:["SQ","DocumentingObserverIdentifierCodeSequenceTrial"],A078:["SQ","AuthorObserverSequence"],A07A:["SQ","ParticipantSequence"],A07C:["SQ","CustodialOrganizationSequence"],A080:["CS","ParticipationType"],A082:["DT","ParticipationDateTime"],A084:["CS","ObserverType"],A085:["SQ","ProcedureIdentifierCodeSequenceTrial"],A088:["SQ","VerifyingObserverIdentificationCodeSequence"],A089:["OB","ObjectDirectoryBinaryIdentifierTrial"],A090:["SQ","EquivalentCDADocumentSequence"],A0B0:["US","ReferencedWaveformChannels"],A110:["DA","DateOfDocumentOrVerbalTransactionTrial"],A112:["TM","TimeOfDocumentCreationOrVerbalTransactionTrial"],A120:["DT","DateTime"],A121:["DA","Date"],A122:["TM","Time"],A123:["PN","PersonName"],A124:["UI","UID"],A125:["CS","ReportStatusIDTrial"],A130:["CS","TemporalRangeType"],A132:["UL","ReferencedSamplePositions"],A136:["US","ReferencedFrameNumbers"],A138:["DS","ReferencedTimeOffsets"],A13A:["DT","ReferencedDateTime"],A160:["UT","TextValue"],A167:["SQ","ObservationCategoryCodeSequenceTrial"],A168:["SQ","ConceptCodeSequence"],A16A:["ST","BibliographicCitationTrial"],A170:["SQ","PurposeOfReferenceCodeSequence"],A171:["UI","ObservationUIDTrial"],A172:["UI","ReferencedObservationUIDTrial"],A173:["CS","ReferencedObservationClassTrial"],A174:["CS","ReferencedObjectObservationClassTrial"],A180:["US","AnnotationGroupNumber"],A192:["DA","ObservationDateTrial"],A193:["TM","ObservationTimeTrial"],A194:["CS","MeasurementAutomationTrial"],A195:["SQ","ModifierCodeSequence"],A224:["ST","IdentificationDescriptionTrial"],A290:["CS","CoordinatesSetGeometricTypeTrial"],A296:["SQ","AlgorithmCodeSequenceTrial"],A297:["ST","AlgorithmDescriptionTrial"],A29A:["SL","PixelCoordinatesSetTrial"],A300:["SQ","MeasuredValueSequence"],A301:["SQ","NumericValueQualifierCodeSequence"],A307:["PN","CurrentObserverTrial"],A30A:["DS","NumericValue"],A313:["SQ","ReferencedAccessionSequenceTrial"],A33A:["ST","ReportStatusCommentTrial"],A340:["SQ","ProcedureContextSequenceTrial"],A352:["PN","VerbalSourceTrial"],A353:["ST","AddressTrial"],A354:["LO","TelephoneNumberTrial"],A358:["SQ","VerbalSourceIdentifierCodeSequenceTrial"],A360:["SQ","PredecessorDocumentsSequence"],A370:["SQ","ReferencedRequestSequence"],A372:["SQ","PerformedProcedureCodeSequence"],A375:["SQ","CurrentRequestedProcedureEvidenceSequence"],A380:["SQ","ReportDetailSequenceTrial"],A385:["SQ","PertinentOtherEvidenceSequence"],A390:["SQ","HL7StructuredDocumentReferenceSequence"],A402:["UI","ObservationSubjectUIDTrial"],A403:["CS","ObservationSubjectClassTrial"],A404:["SQ","ObservationSubjectTypeCodeSequenceTrial"],A491:["CS","CompletionFlag"],A492:["LO","CompletionFlagDescription"],A493:["CS","VerificationFlag"],A494:["CS","ArchiveRequested"],A496:["CS","PreliminaryFlag"],A504:["SQ","ContentTemplateSequence"],A525:["SQ","IdenticalDocumentsSequence"],A600:["CS","ObservationSubjectContextFlagTrial"],A601:["CS","ObserverContextFlagTrial"],A603:["CS","ProcedureContextFlagTrial"],A730:["SQ","ContentSequence"],A731:["SQ","RelationshipSequenceTrial"],A732:["SQ","RelationshipTypeCodeSequenceTrial"],A744:["SQ","LanguageCodeSequenceTrial"],A992:["ST","UniformResourceLocatorTrial"],B020:["SQ","WaveformAnnotationSequence"],DB00:["CS","TemplateIdentifier"],DB06:["DT","TemplateVersion"],DB07:["DT","TemplateLocalVersion"],DB0B:["CS","TemplateExtensionFlag"],DB0C:["UI","TemplateExtensionOrganizationUID"],DB0D:["UI","TemplateExtensionCreatorUID"],DB73:["UL","ReferencedContentItemIdentifier"],E001:["ST","HL7InstanceIdentifier"],E004:["DT","HL7DocumentEffectiveTime"],E006:["SQ","HL7DocumentTypeCodeSequence"],E008:["SQ","DocumentClassCodeSequence"],E010:["UT","RetrieveURI"],E011:["UI","RetrieveLocationUID"],E020:["CS","TypeOfInstances"],E021:["SQ","DICOMRetrievalSequence"],E022:["SQ","DICOMMediaRetrievalSequence"],E023:["SQ","WADORetrievalSequence"],E024:["SQ","XDSRetrievalSequence"],E030:["UI","RepositoryUniqueID"],E031:["UI","HomeCommunityID"]},"0042":{"0010":["ST","DocumentTitle"],"0011":["OB","EncapsulatedDocument"],"0012":["LO","MIMETypeOfEncapsulatedDocument"],"0013":["SQ","SourceInstanceSequence"],"0014":["LO","ListOfMIMETypes"]},"0044":{"0001":["ST","ProductPackageIdentifier"],"0002":["CS","SubstanceAdministrationApproval"],"0003":["LT","ApprovalStatusFurtherDescription"],"0004":["DT","ApprovalStatusDateTime"],"0007":["SQ","ProductTypeCodeSequence"],"0008":["LO","ProductName"],"0009":["LT","ProductDescription"],"000A":["LO","ProductLotIdentifier"],"000B":["DT","ProductExpirationDateTime"],"0010":["DT","SubstanceAdministrationDateTime"],"0011":["LO","SubstanceAdministrationNotes"],"0012":["LO","SubstanceAdministrationDeviceID"],"0013":["SQ","ProductParameterSequence"],"0019":["SQ","SubstanceAdministrationParameterSequence"]},"0046":{"0012":["LO","LensDescription"],"0014":["SQ","RightLensSequence"],"0015":["SQ","LeftLensSequence"],"0016":["SQ","UnspecifiedLateralityLensSequence"],"0018":["SQ","CylinderSequence"],"0028":["SQ","PrismSequence"],"0030":["FD","HorizontalPrismPower"],"0032":["CS","HorizontalPrismBase"],"0034":["FD","VerticalPrismPower"],"0036":["CS","VerticalPrismBase"],"0038":["CS","LensSegmentType"],"0040":["FD","OpticalTransmittance"],"0042":["FD","ChannelWidth"],"0044":["FD","PupilSize"],"0046":["FD","CornealSize"],"0050":["SQ","AutorefractionRightEyeSequence"],"0052":["SQ","AutorefractionLeftEyeSequence"],"0060":["FD","DistancePupillaryDistance"],"0062":["FD","NearPupillaryDistance"],"0063":["FD","IntermediatePupillaryDistance"],"0064":["FD","OtherPupillaryDistance"],"0070":["SQ","KeratometryRightEyeSequence"],"0071":["SQ","KeratometryLeftEyeSequence"],"0074":["SQ","SteepKeratometricAxisSequence"],"0075":["FD","RadiusOfCurvature"],"0076":["FD","KeratometricPower"],"0077":["FD","KeratometricAxis"],"0080":["SQ","FlatKeratometricAxisSequence"],"0092":["CS","BackgroundColor"],"0094":["CS","Optotype"],"0095":["CS","OptotypePresentation"],"0097":["SQ","SubjectiveRefractionRightEyeSequence"],"0098":["SQ","SubjectiveRefractionLeftEyeSequence"],"0100":["SQ","AddNearSequence"],"0101":["SQ","AddIntermediateSequence"],"0102":["SQ","AddOtherSequence"],"0104":["FD","AddPower"],"0106":["FD","ViewingDistance"],"0121":["SQ","VisualAcuityTypeCodeSequence"],"0122":["SQ","VisualAcuityRightEyeSequence"],"0123":["SQ","VisualAcuityLeftEyeSequence"],"0124":["SQ","VisualAcuityBothEyesOpenSequence"],"0125":["CS","ViewingDistanceType"],"0135":["SS","VisualAcuityModifiers"],"0137":["FD","DecimalVisualAcuity"],"0139":["LO","OptotypeDetailedDefinition"],"0145":["SQ","ReferencedRefractiveMeasurementsSequence"],"0146":["FD","SpherePower"],"0147":["FD","CylinderPower"]},"0048":{"0001":["FL","ImagedVolumeWidth"],"0002":["FL","ImagedVolumeHeight"],"0003":["FL","ImagedVolumeDepth"],"0006":["UL","TotalPixelMatrixColumns"],"0007":["UL","TotalPixelMatrixRows"],"0008":["SQ","TotalPixelMatrixOriginSequence"],"0010":["CS","SpecimenLabelInImage"],"0011":["CS","FocusMethod"],"0012":["CS","ExtendedDepthOfField"],"0013":["US","NumberOfFocalPlanes"],"0014":["FL","DistanceBetweenFocalPlanes"],"0015":["US","RecommendedAbsentPixelCIELabValue"],"0100":["SQ","IlluminatorTypeCodeSequence"],"0102":["DS","ImageOrientationSlide"],"0105":["SQ","OpticalPathSequence"],"0106":["SH","OpticalPathIdentifier"],"0107":["ST","OpticalPathDescription"],"0108":["SQ","IlluminationColorCodeSequence"],"0110":["SQ","SpecimenReferenceSequence"],"0111":["DS","CondenserLensPower"],"0112":["DS","ObjectiveLensPower"],"0113":["DS","ObjectiveLensNumericalAperture"],"0120":["SQ","PaletteColorLookupTableSequence"],"0200":["SQ","ReferencedImageNavigationSequence"],"0201":["US","TopLeftHandCornerOfLocalizerArea"],"0202":["US","BottomRightHandCornerOfLocalizerArea"],"0207":["SQ","OpticalPathIdentificationSequence"],"021A":["SQ","PlanePositionSlideSequence"],"021E":["SL","RowPositionInTotalImagePixelMatrix"],"021F":["SL","ColumnPositionInTotalImagePixelMatrix"],"0301":["CS","PixelOriginInterpretation"]},"0050":{"0004":["CS","CalibrationImage"],"0010":["SQ","DeviceSequence"],"0012":["SQ","ContainerComponentTypeCodeSequence"],"0013":["FD","ContainerComponentThickness"],"0014":["DS","DeviceLength"],"0015":["FD","ContainerComponentWidth"],"0016":["DS","DeviceDiameter"],"0017":["CS","DeviceDiameterUnits"],"0018":["DS","DeviceVolume"],"0019":["DS","InterMarkerDistance"],"001A":["CS","ContainerComponentMaterial"],"001B":["LO","ContainerComponentID"],"001C":["FD","ContainerComponentLength"],"001D":["FD","ContainerComponentDiameter"],"001E":["LO","ContainerComponentDescription"],"0020":["LO","DeviceDescription"]},"0052":{"0001":["FL","ContrastBolusIngredientPercentByVolume"],"0002":["FD","OCTFocalDistance"],"0003":["FD","BeamSpotSize"],"0004":["FD","EffectiveRefractiveIndex"],"0006":["CS","OCTAcquisitionDomain"],"0007":["FD","OCTOpticalCenterWavelength"],"0008":["FD","AxialResolution"],"0009":["FD","RangingDepth"],"0011":["FD","ALineRate"],"0012":["US","ALinesPerFrame"],"0013":["FD","CatheterRotationalRate"],"0014":["FD","ALinePixelSpacing"],"0016":["SQ","ModeOfPercutaneousAccessSequence"],"0025":["SQ","IntravascularOCTFrameTypeSequence"],"0026":["CS","OCTZOffsetApplied"],"0027":["SQ","IntravascularFrameContentSequence"],"0028":["FD","IntravascularLongitudinalDistance"],"0029":["SQ","IntravascularOCTFrameContentSequence"],"0030":["SS","OCTZOffsetCorrection"],"0031":["CS","CatheterDirectionOfRotation"],"0033":["FD","SeamLineLocation"],"0034":["FD","FirstALineLocation"],"0036":["US","SeamLineIndex"],"0038":["US","NumberOfPaddedAlines"],"0039":["CS","InterpolationType"],"003A":["CS","RefractiveIndexApplied"]},"0054":{"0010":["US","EnergyWindowVector"],"0011":["US","NumberOfEnergyWindows"],"0012":["SQ","EnergyWindowInformationSequence"],"0013":["SQ","EnergyWindowRangeSequence"],"0014":["DS","EnergyWindowLowerLimit"],"0015":["DS","EnergyWindowUpperLimit"],"0016":["SQ","RadiopharmaceuticalInformationSequence"],"0017":["IS","ResidualSyringeCounts"],"0018":["SH","EnergyWindowName"],"0020":["US","DetectorVector"],"0021":["US","NumberOfDetectors"],"0022":["SQ","DetectorInformationSequence"],"0030":["US","PhaseVector"],"0031":["US","NumberOfPhases"],"0032":["SQ","PhaseInformationSequence"],"0033":["US","NumberOfFramesInPhase"],"0036":["IS","PhaseDelay"],"0038":["IS","PauseBetweenFrames"],"0039":["CS","PhaseDescription"],"0050":["US","RotationVector"],"0051":["US","NumberOfRotations"],"0052":["SQ","RotationInformationSequence"],"0053":["US","NumberOfFramesInRotation"],"0060":["US","RRIntervalVector"],"0061":["US","NumberOfRRIntervals"],"0062":["SQ","GatedInformationSequence"],"0063":["SQ","DataInformationSequence"],"0070":["US","TimeSlotVector"],"0071":["US","NumberOfTimeSlots"],"0072":["SQ","TimeSlotInformationSequence"],"0073":["DS","TimeSlotTime"],"0080":["US","SliceVector"],"0081":["US","NumberOfSlices"],"0090":["US","AngularViewVector"],"0100":["US","TimeSliceVector"],"0101":["US","NumberOfTimeSlices"],"0200":["DS","StartAngle"],"0202":["CS","TypeOfDetectorMotion"],"0210":["IS","TriggerVector"],"0211":["US","NumberOfTriggersInPhase"],"0220":["SQ","ViewCodeSequence"],"0222":["SQ","ViewModifierCodeSequence"],"0300":["SQ","RadionuclideCodeSequence"],"0302":["SQ","AdministrationRouteCodeSequence"],"0304":["SQ","RadiopharmaceuticalCodeSequence"],"0306":["SQ","CalibrationDataSequence"],"0308":["US","EnergyWindowNumber"],"0400":["SH","ImageID"],"0410":["SQ","PatientOrientationCodeSequence"],"0412":["SQ","PatientOrientationModifierCodeSequence"],"0414":["SQ","PatientGantryRelationshipCodeSequence"],"0500":["CS","SliceProgressionDirection"],1e3:["CS","SeriesType"],1001:["CS","Units"],1002:["CS","CountsSource"],1004:["CS","ReprojectionMethod"],1006:["CS","SUVType"],1100:["CS","RandomsCorrectionMethod"],1101:["LO","AttenuationCorrectionMethod"],1102:["CS","DecayCorrection"],1103:["LO","ReconstructionMethod"],1104:["LO","DetectorLinesOfResponseUsed"],1105:["LO","ScatterCorrectionMethod"],1200:["DS","AxialAcceptance"],1201:["IS","AxialMash"],1202:["IS","TransverseMash"],1203:["DS","DetectorElementSize"],1210:["DS","CoincidenceWindowWidth"],1220:["CS","SecondaryCountsType"],1300:["DS","FrameReferenceTime"],1310:["IS","PrimaryPromptsCountsAccumulated"],1311:["IS","SecondaryCountsAccumulated"],1320:["DS","SliceSensitivityFactor"],1321:["DS","DecayFactor"],1322:["DS","DoseCalibrationFactor"],1323:["DS","ScatterFractionFactor"],1324:["DS","DeadTimeFactor"],1330:["US","ImageIndex"],1400:["CS","CountsIncluded"],1401:["CS","DeadTimeCorrectionFlag"]},"0060":{3e3:["SQ","HistogramSequence"],3002:["US","HistogramNumberOfBins"],3004:["SS","HistogramFirstBinValue"],3006:["SS","HistogramLastBinValue"],3008:["US","HistogramBinWidth"],3010:["LO","HistogramExplanation"],3020:["UL","HistogramData"]},"0062":{"0001":["CS","SegmentationType"],"0002":["SQ","SegmentSequence"],"0003":["SQ","SegmentedPropertyCategoryCodeSequence"],"0004":["US","SegmentNumber"],"0005":["LO","SegmentLabel"],"0006":["ST","SegmentDescription"],"0008":["CS","SegmentAlgorithmType"],"0009":["LO","SegmentAlgorithmName"],"000A":["SQ","SegmentIdentificationSequence"],"000B":["US","ReferencedSegmentNumber"],"000C":["US","RecommendedDisplayGrayscaleValue"],"000D":["US","RecommendedDisplayCIELabValue"],"000E":["US","MaximumFractionalValue"],"000F":["SQ","SegmentedPropertyTypeCodeSequence"],"0010":["CS","SegmentationFractionalType"]},"0064":{"0002":["SQ","DeformableRegistrationSequence"],"0003":["UI","SourceFrameOfReferenceUID"],"0005":["SQ","DeformableRegistrationGridSequence"],"0007":["UL","GridDimensions"],"0008":["FD","GridResolution"],"0009":["OF","VectorGridData"],"000F":["SQ","PreDeformationMatrixRegistrationSequence"],"0010":["SQ","PostDeformationMatrixRegistrationSequence"]},"0066":{"0001":["UL","NumberOfSurfaces"],"0002":["SQ","SurfaceSequence"],"0003":["UL","SurfaceNumber"],"0004":["LT","SurfaceComments"],"0009":["CS","SurfaceProcessing"],"000A":["FL","SurfaceProcessingRatio"],"000B":["LO","SurfaceProcessingDescription"],"000C":["FL","RecommendedPresentationOpacity"],"000D":["CS","RecommendedPresentationType"],"000E":["CS","FiniteVolume"],"0010":["CS","Manifold"],"0011":["SQ","SurfacePointsSequence"],"0012":["SQ","SurfacePointsNormalsSequence"],"0013":["SQ","SurfaceMeshPrimitivesSequence"],"0015":["UL","NumberOfSurfacePoints"],"0016":["OF","PointCoordinatesData"],"0017":["FL","PointPositionAccuracy"],"0018":["FL","MeanPointDistance"],"0019":["FL","MaximumPointDistance"],"001A":["FL","PointsBoundingBoxCoordinates"],"001B":["FL","AxisOfRotation"],"001C":["FL","CenterOfRotation"],"001E":["UL","NumberOfVectors"],"001F":["US","VectorDimensionality"],"0020":["FL","VectorAccuracy"],"0021":["OF","VectorCoordinateData"],"0023":["OW","TrianglePointIndexList"],"0024":["OW","EdgePointIndexList"],"0025":["OW","VertexPointIndexList"],"0026":["SQ","TriangleStripSequence"],"0027":["SQ","TriangleFanSequence"],"0028":["SQ","LineSequence"],"0029":["OW","PrimitivePointIndexList"],"002A":["UL","SurfaceCount"],"002B":["SQ","ReferencedSurfaceSequence"],"002C":["UL","ReferencedSurfaceNumber"],"002D":["SQ","SegmentSurfaceGenerationAlgorithmIdentificationSequence"],"002E":["SQ","SegmentSurfaceSourceInstanceSequence"],"002F":["SQ","AlgorithmFamilyCodeSequence"],"0030":["SQ","AlgorithmNameCodeSequence"],"0031":["LO","AlgorithmVersion"],"0032":["LT","AlgorithmParameters"],"0034":["SQ","FacetSequence"],"0035":["SQ","SurfaceProcessingAlgorithmIdentificationSequence"],"0036":["LO","AlgorithmName"]},"0068":{6210:["LO","ImplantSize"],6221:["LO","ImplantTemplateVersion"],6222:["SQ","ReplacedImplantTemplateSequence"],6223:["CS","ImplantType"],6224:["SQ","DerivationImplantTemplateSequence"],6225:["SQ","OriginalImplantTemplateSequence"],6226:["DT","EffectiveDateTime"],6230:["SQ","ImplantTargetAnatomySequence"],6260:["SQ","InformationFromManufacturerSequence"],6265:["SQ","NotificationFromManufacturerSequence"],6270:["DT","InformationIssueDateTime"],6280:["ST","InformationSummary"],"62A0":["SQ","ImplantRegulatoryDisapprovalCodeSequence"],"62A5":["FD","OverallTemplateSpatialTolerance"],"62C0":["SQ","HPGLDocumentSequence"],"62D0":["US","HPGLDocumentID"],"62D5":["LO","HPGLDocumentLabel"],"62E0":["SQ","ViewOrientationCodeSequence"],"62F0":["FD","ViewOrientationModifier"],"62F2":["FD","HPGLDocumentScaling"],6300:["OB","HPGLDocument"],6310:["US","HPGLContourPenNumber"],6320:["SQ","HPGLPenSequence"],6330:["US","HPGLPenNumber"],6340:["LO","HPGLPenLabel"],6345:["ST","HPGLPenDescription"],6346:["FD","RecommendedRotationPoint"],6347:["FD","BoundingRectangle"],6350:["US","ImplantTemplate3DModelSurfaceNumber"],6360:["SQ","SurfaceModelDescriptionSequence"],6380:["LO","SurfaceModelLabel"],6390:["FD","SurfaceModelScalingFactor"],"63A0":["SQ","MaterialsCodeSequence"],"63A4":["SQ","CoatingMaterialsCodeSequence"],"63A8":["SQ","ImplantTypeCodeSequence"],"63AC":["SQ","FixationMethodCodeSequence"],"63B0":["SQ","MatingFeatureSetsSequence"],"63C0":["US","MatingFeatureSetID"],"63D0":["LO","MatingFeatureSetLabel"],"63E0":["SQ","MatingFeatureSequence"],"63F0":["US","MatingFeatureID"],6400:["SQ","MatingFeatureDegreeOfFreedomSequence"],6410:["US","DegreeOfFreedomID"],6420:["CS","DegreeOfFreedomType"],6430:["SQ","TwoDMatingFeatureCoordinatesSequence"],6440:["US","ReferencedHPGLDocumentID"],6450:["FD","TwoDMatingPoint"],6460:["FD","TwoDMatingAxes"],6470:["SQ","TwoDDegreeOfFreedomSequence"],6490:["FD","ThreeDDegreeOfFreedomAxis"],"64A0":["FD","RangeOfFreedom"],"64C0":["FD","ThreeDMatingPoint"],"64D0":["FD","ThreeDMatingAxes"],"64F0":["FD","TwoDDegreeOfFreedomAxis"],6500:["SQ","PlanningLandmarkPointSequence"],6510:["SQ","PlanningLandmarkLineSequence"],6520:["SQ","PlanningLandmarkPlaneSequence"],6530:["US","PlanningLandmarkID"],6540:["LO","PlanningLandmarkDescription"],6545:["SQ","PlanningLandmarkIdentificationCodeSequence"],6550:["SQ","TwoDPointCoordinatesSequence"],6560:["FD","TwoDPointCoordinates"],6590:["FD","ThreeDPointCoordinates"],"65A0":["SQ","TwoDLineCoordinatesSequence"],"65B0":["FD","TwoDLineCoordinates"],"65D0":["FD","ThreeDLineCoordinates"],"65E0":["SQ","TwoDPlaneCoordinatesSequence"],"65F0":["FD","TwoDPlaneIntersection"],6610:["FD","ThreeDPlaneOrigin"],6620:["FD","ThreeDPlaneNormal"]},"0070":{"0001":["SQ","GraphicAnnotationSequence"],"0002":["CS","GraphicLayer"],"0003":["CS","BoundingBoxAnnotationUnits"],"0004":["CS","AnchorPointAnnotationUnits"],"0005":["CS","GraphicAnnotationUnits"],"0006":["ST","UnformattedTextValue"],"0008":["SQ","TextObjectSequence"],"0009":["SQ","GraphicObjectSequence"],"0010":["FL","BoundingBoxTopLeftHandCorner"],"0011":["FL","BoundingBoxBottomRightHandCorner"],"0012":["CS","BoundingBoxTextHorizontalJustification"],"0014":["FL","AnchorPoint"],"0015":["CS","AnchorPointVisibility"],"0020":["US","GraphicDimensions"],"0021":["US","NumberOfGraphicPoints"],"0022":["FL","GraphicData"],"0023":["CS","GraphicType"],"0024":["CS","GraphicFilled"],"0040":["IS","ImageRotationRetired"],"0041":["CS","ImageHorizontalFlip"],"0042":["US","ImageRotation"],"0050":["US","DisplayedAreaTopLeftHandCornerTrial"],"0051":["US","DisplayedAreaBottomRightHandCornerTrial"],"0052":["SL","DisplayedAreaTopLeftHandCorner"],"0053":["SL","DisplayedAreaBottomRightHandCorner"],"005A":["SQ","DisplayedAreaSelectionSequence"],"0060":["SQ","GraphicLayerSequence"],"0062":["IS","GraphicLayerOrder"],"0066":["US","GraphicLayerRecommendedDisplayGrayscaleValue"],"0067":["US","GraphicLayerRecommendedDisplayRGBValue"],"0068":["LO","GraphicLayerDescription"],"0080":["CS","ContentLabel"],"0081":["LO","ContentDescription"],"0082":["DA","PresentationCreationDate"],"0083":["TM","PresentationCreationTime"],"0084":["PN","ContentCreatorName"],"0086":["SQ","ContentCreatorIdentificationCodeSequence"],"0087":["SQ","AlternateContentDescriptionSequence"],"0100":["CS","PresentationSizeMode"],"0101":["DS","PresentationPixelSpacing"],"0102":["IS","PresentationPixelAspectRatio"],"0103":["FL","PresentationPixelMagnificationRatio"],"0207":["LO","GraphicGroupLabel"],"0208":["ST","GraphicGroupDescription"],"0209":["SQ","CompoundGraphicSequence"],"0226":["UL","CompoundGraphicInstanceID"],"0227":["LO","FontName"],"0228":["CS","FontNameType"],"0229":["LO","CSSFontName"],"0230":["FD","RotationAngle"],"0231":["SQ","TextStyleSequence"],"0232":["SQ","LineStyleSequence"],"0233":["SQ","FillStyleSequence"],"0234":["SQ","GraphicGroupSequence"],"0241":["US","TextColorCIELabValue"],"0242":["CS","HorizontalAlignment"],"0243":["CS","VerticalAlignment"],"0244":["CS","ShadowStyle"],"0245":["FL","ShadowOffsetX"],"0246":["FL","ShadowOffsetY"],"0247":["US","ShadowColorCIELabValue"],"0248":["CS","Underlined"],"0249":["CS","Bold"],"0250":["CS","Italic"],"0251":["US","PatternOnColorCIELabValue"],"0252":["US","PatternOffColorCIELabValue"],"0253":["FL","LineThickness"],"0254":["CS","LineDashingStyle"],"0255":["UL","LinePattern"],"0256":["OB","FillPattern"],"0257":["CS","FillMode"],"0258":["FL","ShadowOpacity"],"0261":["FL","GapLength"],"0262":["FL","DiameterOfVisibility"],"0273":["FL","RotationPoint"],"0274":["CS","TickAlignment"],"0278":["CS","ShowTickLabel"],"0279":["CS","TickLabelAlignment"],"0282":["CS","CompoundGraphicUnits"],"0284":["FL","PatternOnOpacity"],"0285":["FL","PatternOffOpacity"],"0287":["SQ","MajorTicksSequence"],"0288":["FL","TickPosition"],"0289":["SH","TickLabel"],"0294":["CS","CompoundGraphicType"],"0295":["UL","GraphicGroupID"],"0306":["CS","ShapeType"],"0308":["SQ","RegistrationSequence"],"0309":["SQ","MatrixRegistrationSequence"],"030A":["SQ","MatrixSequence"],"030C":["CS","FrameOfReferenceTransformationMatrixType"],"030D":["SQ","RegistrationTypeCodeSequence"],"030F":["ST","FiducialDescription"],"0310":["SH","FiducialIdentifier"],"0311":["SQ","FiducialIdentifierCodeSequence"],"0312":["FD","ContourUncertaintyRadius"],"0314":["SQ","UsedFiducialsSequence"],"0318":["SQ","GraphicCoordinatesDataSequence"],"031A":["UI","FiducialUID"],"031C":["SQ","FiducialSetSequence"],"031E":["SQ","FiducialSequence"],"0401":["US","GraphicLayerRecommendedDisplayCIELabValue"],"0402":["SQ","BlendingSequence"],"0403":["FL","RelativeOpacity"],"0404":["SQ","ReferencedSpatialRegistrationSequence"],"0405":["CS","BlendingPosition"]},"0072":{"0002":["SH","HangingProtocolName"],"0004":["LO","HangingProtocolDescription"],"0006":["CS","HangingProtocolLevel"],"0008":["LO","HangingProtocolCreator"],"000A":["DT","HangingProtocolCreationDateTime"],"000C":["SQ","HangingProtocolDefinitionSequence"],"000E":["SQ","HangingProtocolUserIdentificationCodeSequence"],"0010":["LO","HangingProtocolUserGroupName"],"0012":["SQ","SourceHangingProtocolSequence"],"0014":["US","NumberOfPriorsReferenced"],"0020":["SQ","ImageSetsSequence"],"0022":["SQ","ImageSetSelectorSequence"],"0024":["CS","ImageSetSelectorUsageFlag"],"0026":["AT","SelectorAttribute"],"0028":["US","SelectorValueNumber"],"0030":["SQ","TimeBasedImageSetsSequence"],"0032":["US","ImageSetNumber"],"0034":["CS","ImageSetSelectorCategory"],"0038":["US","RelativeTime"],"003A":["CS","RelativeTimeUnits"],"003C":["SS","AbstractPriorValue"],"003E":["SQ","AbstractPriorCodeSequence"],"0040":["LO","ImageSetLabel"],"0050":["CS","SelectorAttributeVR"],"0052":["AT","SelectorSequencePointer"],"0054":["LO","SelectorSequencePointerPrivateCreator"],"0056":["LO","SelectorAttributePrivateCreator"],"0060":["AT","SelectorATValue"],"0062":["CS","SelectorCSValue"],"0064":["IS","SelectorISValue"],"0066":["LO","SelectorLOValue"],"0068":["LT","SelectorLTValue"],"006A":["PN","SelectorPNValue"],"006C":["SH","SelectorSHValue"],"006E":["ST","SelectorSTValue"],"0070":["UT","SelectorUTValue"],"0072":["DS","SelectorDSValue"],"0074":["FD","SelectorFDValue"],"0076":["FL","SelectorFLValue"],"0078":["UL","SelectorULValue"],"007A":["US","SelectorUSValue"],"007C":["SL","SelectorSLValue"],"007E":["SS","SelectorSSValue"],"0080":["SQ","SelectorCodeSequenceValue"],"0100":["US","NumberOfScreens"],"0102":["SQ","NominalScreenDefinitionSequence"],"0104":["US","NumberOfVerticalPixels"],"0106":["US","NumberOfHorizontalPixels"],"0108":["FD","DisplayEnvironmentSpatialPosition"],"010A":["US","ScreenMinimumGrayscaleBitDepth"],"010C":["US","ScreenMinimumColorBitDepth"],"010E":["US","ApplicationMaximumRepaintTime"],"0200":["SQ","DisplaySetsSequence"],"0202":["US","DisplaySetNumber"],"0203":["LO","DisplaySetLabel"],"0204":["US","DisplaySetPresentationGroup"],"0206":["LO","DisplaySetPresentationGroupDescription"],"0208":["CS","PartialDataDisplayHandling"],"0210":["SQ","SynchronizedScrollingSequence"],"0212":["US","DisplaySetScrollingGroup"],"0214":["SQ","NavigationIndicatorSequence"],"0216":["US","NavigationDisplaySet"],"0218":["US","ReferenceDisplaySets"],"0300":["SQ","ImageBoxesSequence"],"0302":["US","ImageBoxNumber"],"0304":["CS","ImageBoxLayoutType"],"0306":["US","ImageBoxTileHorizontalDimension"],"0308":["US","ImageBoxTileVerticalDimension"],"0310":["CS","ImageBoxScrollDirection"],"0312":["CS","ImageBoxSmallScrollType"],"0314":["US","ImageBoxSmallScrollAmount"],"0316":["CS","ImageBoxLargeScrollType"],"0318":["US","ImageBoxLargeScrollAmount"],"0320":["US","ImageBoxOverlapPriority"],"0330":["FD","CineRelativeToRealTime"],"0400":["SQ","FilterOperationsSequence"],"0402":["CS","FilterByCategory"],"0404":["CS","FilterByAttributePresence"],"0406":["CS","FilterByOperator"],"0420":["US","StructuredDisplayBackgroundCIELabValue"],"0421":["US","EmptyImageBoxCIELabValue"],"0422":["SQ","StructuredDisplayImageBoxSequence"],"0424":["SQ","StructuredDisplayTextBoxSequence"],"0427":["SQ","ReferencedFirstFrameSequence"],"0430":["SQ","ImageBoxSynchronizationSequence"],"0432":["US","SynchronizedImageBoxList"],"0434":["CS","TypeOfSynchronization"],"0500":["CS","BlendingOperationType"],"0510":["CS","ReformattingOperationType"],"0512":["FD","ReformattingThickness"],"0514":["FD","ReformattingInterval"],"0516":["CS","ReformattingOperationInitialViewDirection"],"0520":["CS","ThreeDRenderingType"],"0600":["SQ","SortingOperationsSequence"],"0602":["CS","SortByCategory"],"0604":["CS","SortingDirection"],"0700":["CS","DisplaySetPatientOrientation"],"0702":["CS","VOIType"],"0704":["CS","PseudoColorType"],"0705":["SQ","PseudoColorPaletteInstanceReferenceSequence"],"0706":["CS","ShowGrayscaleInverted"],"0710":["CS","ShowImageTrueSizeFlag"],"0712":["CS","ShowGraphicAnnotationFlag"],"0714":["CS","ShowPatientDemographicsFlag"],"0716":["CS","ShowAcquisitionTechniquesFlag"],"0717":["CS","DisplaySetHorizontalJustification"],"0718":["CS","DisplaySetVerticalJustification"]},"0074":{"0120":["FD","ContinuationStartMeterset"],"0121":["FD","ContinuationEndMeterset"],1e3:["CS","ProcedureStepState"],1002:["SQ","ProcedureStepProgressInformationSequence"],1004:["DS","ProcedureStepProgress"],1006:["ST","ProcedureStepProgressDescription"],1008:["SQ","ProcedureStepCommunicationsURISequence"],"100A":["ST","ContactURI"],"100C":["LO","ContactDisplayName"],"100E":["SQ","ProcedureStepDiscontinuationReasonCodeSequence"],1020:["SQ","BeamTaskSequence"],1022:["CS","BeamTaskType"],1024:["IS","BeamOrderIndexTrial"],1026:["FD","TableTopVerticalAdjustedPosition"],1027:["FD","TableTopLongitudinalAdjustedPosition"],1028:["FD","TableTopLateralAdjustedPosition"],"102A":["FD","PatientSupportAdjustedAngle"],"102B":["FD","TableTopEccentricAdjustedAngle"],"102C":["FD","TableTopPitchAdjustedAngle"],"102D":["FD","TableTopRollAdjustedAngle"],1030:["SQ","DeliveryVerificationImageSequence"],1032:["CS","VerificationImageTiming"],1034:["CS","DoubleExposureFlag"],1036:["CS","DoubleExposureOrdering"],1038:["DS","DoubleExposureMetersetTrial"],"103A":["DS","DoubleExposureFieldDeltaTrial"],1040:["SQ","RelatedReferenceRTImageSequence"],1042:["SQ","GeneralMachineVerificationSequence"],1044:["SQ","ConventionalMachineVerificationSequence"],1046:["SQ","IonMachineVerificationSequence"],1048:["SQ","FailedAttributesSequence"],"104A":["SQ","OverriddenAttributesSequence"],"104C":["SQ","ConventionalControlPointVerificationSequence"],"104E":["SQ","IonControlPointVerificationSequence"],1050:["SQ","AttributeOccurrenceSequence"],1052:["AT","AttributeOccurrencePointer"],1054:["UL","AttributeItemSelector"],1056:["LO","AttributeOccurrencePrivateCreator"],1057:["IS","SelectorSequencePointerItems"],1200:["CS","ScheduledProcedureStepPriority"],1202:["LO","WorklistLabel"],1204:["LO","ProcedureStepLabel"],1210:["SQ","ScheduledProcessingParametersSequence"],1212:["SQ","PerformedProcessingParametersSequence"],1216:["SQ","UnifiedProcedureStepPerformedProcedureSequence"],1220:["SQ","RelatedProcedureStepSequence"],1222:["LO","ProcedureStepRelationshipType"],1224:["SQ","ReplacedProcedureStepSequence"],1230:["LO","DeletionLock"],1234:["AE","ReceivingAE"],1236:["AE","RequestingAE"],1238:["LT","ReasonForCancellation"],1242:["CS","SCPStatus"],1244:["CS","SubscriptionListStatus"],1246:["CS","UnifiedProcedureStepListStatus"],1324:["UL","BeamOrderIndex"],1338:["FD","DoubleExposureMeterset"],"133A":["FD","DoubleExposureFieldDelta"]},"0076":{"0001":["LO","ImplantAssemblyTemplateName"],"0003":["LO","ImplantAssemblyTemplateIssuer"],"0006":["LO","ImplantAssemblyTemplateVersion"],"0008":["SQ","ReplacedImplantAssemblyTemplateSequence"],"000A":["CS","ImplantAssemblyTemplateType"],"000C":["SQ","OriginalImplantAssemblyTemplateSequence"],"000E":["SQ","DerivationImplantAssemblyTemplateSequence"],"0010":["SQ","ImplantAssemblyTemplateTargetAnatomySequence"],"0020":["SQ","ProcedureTypeCodeSequence"],"0030":["LO","SurgicalTechnique"],"0032":["SQ","ComponentTypesSequence"],"0034":["CS","ComponentTypeCodeSequence"],"0036":["CS","ExclusiveComponentType"],"0038":["CS","MandatoryComponentType"],"0040":["SQ","ComponentSequence"],"0055":["US","ComponentID"],"0060":["SQ","ComponentAssemblySequence"],"0070":["US","Component1ReferencedID"],"0080":["US","Component1ReferencedMatingFeatureSetID"],"0090":["US","Component1ReferencedMatingFeatureID"],"00A0":["US","Component2ReferencedID"],"00B0":["US","Component2ReferencedMatingFeatureSetID"],"00C0":["US","Component2ReferencedMatingFeatureID"]},"0078":{"0001":["LO","ImplantTemplateGroupName"],"0010":["ST","ImplantTemplateGroupDescription"],"0020":["LO","ImplantTemplateGroupIssuer"],"0024":["LO","ImplantTemplateGroupVersion"],"0026":["SQ","ReplacedImplantTemplateGroupSequence"],"0028":["SQ","ImplantTemplateGroupTargetAnatomySequence"],"002A":["SQ","ImplantTemplateGroupMembersSequence"],"002E":["US","ImplantTemplateGroupMemberID"],"0050":["FD","ThreeDImplantTemplateGroupMemberMatchingPoint"],"0060":["FD","ThreeDImplantTemplateGroupMemberMatchingAxes"],"0070":["SQ","ImplantTemplateGroupMemberMatching2DCoordinatesSequence"],"0090":["FD","TwoDImplantTemplateGroupMemberMatchingPoint"],"00A0":["FD","TwoDImplantTemplateGroupMemberMatchingAxes"],"00B0":["SQ","ImplantTemplateGroupVariationDimensionSequence"],"00B2":["LO","ImplantTemplateGroupVariationDimensionName"],"00B4":["SQ","ImplantTemplateGroupVariationDimensionRankSequence"],"00B6":["US","ReferencedImplantTemplateGroupMemberID"],"00B8":["US","ImplantTemplateGroupVariationDimensionRank"]},"0088":{"0130":["SH","StorageMediaFileSetID"],"0140":["UI","StorageMediaFileSetUID"],"0200":["SQ","IconImageSequence"],"0904":["LO","TopicTitle"],"0906":["ST","TopicSubject"],"0910":["LO","TopicAuthor"],"0912":["LO","TopicKeywords"]},"0100":{"0410":["CS","SOPInstanceStatus"],"0420":["DT","SOPAuthorizationDateTime"],"0424":["LT","SOPAuthorizationComment"],"0426":["LO","AuthorizationEquipmentCertificationNumber"]},"0400":{"0005":["US","MACIDNumber"],"0010":["UI","MACCalculationTransferSyntaxUID"],"0015":["CS","MACAlgorithm"],"0020":["AT","DataElementsSigned"],"0100":["UI","DigitalSignatureUID"],"0105":["DT","DigitalSignatureDateTime"],"0110":["CS","CertificateType"],"0115":["OB","CertificateOfSigner"],"0120":["OB","Signature"],"0305":["CS","CertifiedTimestampType"],"0310":["OB","CertifiedTimestamp"],"0401":["SQ","DigitalSignaturePurposeCodeSequence"],"0402":["SQ","ReferencedDigitalSignatureSequence"],"0403":["SQ","ReferencedSOPInstanceMACSequence"],"0404":["OB","MAC"],"0500":["SQ","EncryptedAttributesSequence"],"0510":["UI","EncryptedContentTransferSyntaxUID"],"0520":["OB","EncryptedContent"],"0550":["SQ","ModifiedAttributesSequence"],"0561":["SQ","OriginalAttributesSequence"],"0562":["DT","AttributeModificationDateTime"],"0563":["LO","ModifyingSystem"],"0564":["LO","SourceOfPreviousValues"],"0565":["CS","ReasonForTheAttributeModification"]},2e3:{"0010":["IS","NumberOfCopies"],"001E":["SQ","PrinterConfigurationSequence"],"0020":["CS","PrintPriority"],"0030":["CS","MediumType"],"0040":["CS","FilmDestination"],"0050":["LO","FilmSessionLabel"],"0060":["IS","MemoryAllocation"],"0061":["IS","MaximumMemoryAllocation"],"0062":["CS","ColorImagePrintingFlag"],"0063":["CS","CollationFlag"],"0065":["CS","AnnotationFlag"],"0067":["CS","ImageOverlayFlag"],"0069":["CS","PresentationLUTFlag"],"006A":["CS","ImageBoxPresentationLUTFlag"],"00A0":["US","MemoryBitDepth"],"00A1":["US","PrintingBitDepth"],"00A2":["SQ","MediaInstalledSequence"],"00A4":["SQ","OtherMediaAvailableSequence"],"00A8":["SQ","SupportedImageDisplayFormatsSequence"],"0500":["SQ","ReferencedFilmBoxSequence"],"0510":["SQ","ReferencedStoredPrintSequence"]},2010:{"0010":["ST","ImageDisplayFormat"],"0030":["CS","AnnotationDisplayFormatID"],"0040":["CS","FilmOrientation"],"0050":["CS","FilmSizeID"],"0052":["CS","PrinterResolutionID"],"0054":["CS","DefaultPrinterResolutionID"],"0060":["CS","MagnificationType"],"0080":["CS","SmoothingType"],"00A6":["CS","DefaultMagnificationType"],"00A7":["CS","OtherMagnificationTypesAvailable"],"00A8":["CS","DefaultSmoothingType"],"00A9":["CS","OtherSmoothingTypesAvailable"],"0100":["CS","BorderDensity"],"0110":["CS","EmptyImageDensity"],"0120":["US","MinDensity"],"0130":["US","MaxDensity"],"0140":["CS","Trim"],"0150":["ST","ConfigurationInformation"],"0152":["LT","ConfigurationInformationDescription"],"0154":["IS","MaximumCollatedFilms"],"015E":["US","Illumination"],"0160":["US","ReflectedAmbientLight"],"0376":["DS","PrinterPixelSpacing"],"0500":["SQ","ReferencedFilmSessionSequence"],"0510":["SQ","ReferencedImageBoxSequence"],"0520":["SQ","ReferencedBasicAnnotationBoxSequence"]},2020:{"0010":["US","ImageBoxPosition"],"0020":["CS","Polarity"],"0030":["DS","RequestedImageSize"],"0040":["CS","RequestedDecimateCropBehavior"],"0050":["CS","RequestedResolutionID"],"00A0":["CS","RequestedImageSizeFlag"],"00A2":["CS","DecimateCropResult"],"0110":["SQ","BasicGrayscaleImageSequence"],"0111":["SQ","BasicColorImageSequence"],"0130":["SQ","ReferencedImageOverlayBoxSequence"],"0140":["SQ","ReferencedVOILUTBoxSequence"]},2030:{"0010":["US","AnnotationPosition"],"0020":["LO","TextString"]},2040:{"0010":["SQ","ReferencedOverlayPlaneSequence"],"0011":["US","ReferencedOverlayPlaneGroups"],"0020":["SQ","OverlayPixelDataSequence"],"0060":["CS","OverlayMagnificationType"],"0070":["CS","OverlaySmoothingType"],"0072":["CS","OverlayOrImageMagnification"],"0074":["US","MagnifyToNumberOfColumns"],"0080":["CS","OverlayForegroundDensity"],"0082":["CS","OverlayBackgroundDensity"],"0090":["CS","OverlayMode"],"0100":["CS","ThresholdDensity"],"0500":["SQ","ReferencedImageBoxSequenceRetired"]},2050:{"0010":["SQ","PresentationLUTSequence"],"0020":["CS","PresentationLUTShape"],"0500":["SQ","ReferencedPresentationLUTSequence"]},2100:{"0010":["SH","PrintJobID"],"0020":["CS","ExecutionStatus"],"0030":["CS","ExecutionStatusInfo"],"0040":["DA","CreationDate"],"0050":["TM","CreationTime"],"0070":["AE","Originator"],"0140":["AE","DestinationAE"],"0160":["SH","OwnerID"],"0170":["IS","NumberOfFilms"],"0500":["SQ","ReferencedPrintJobSequencePullStoredPrint"]},2110:{"0010":["CS","PrinterStatus"],"0020":["CS","PrinterStatusInfo"],"0030":["LO","PrinterName"],"0099":["SH","PrintQueueID"]},2120:{"0010":["CS","QueueStatus"],"0050":["SQ","PrintJobDescriptionSequence"],"0070":["SQ","ReferencedPrintJobSequence"]},2130:{"0010":["SQ","PrintManagementCapabilitiesSequence"],"0015":["SQ","PrinterCharacteristicsSequence"],"0030":["SQ","FilmBoxContentSequence"],"0040":["SQ","ImageBoxContentSequence"],"0050":["SQ","AnnotationContentSequence"],"0060":["SQ","ImageOverlayBoxContentSequence"],"0080":["SQ","PresentationLUTContentSequence"],"00A0":["SQ","ProposedStudySequence"],"00C0":["SQ","OriginalImageSequence"]},2200:{"0001":["CS","LabelUsingInformationExtractedFromInstances"],"0002":["UT","LabelText"],"0003":["CS","LabelStyleSelection"],"0004":["LT","MediaDisposition"],"0005":["LT","BarcodeValue"],"0006":["CS","BarcodeSymbology"],"0007":["CS","AllowMediaSplitting"],"0008":["CS","IncludeNonDICOMObjects"],"0009":["CS","IncludeDisplayApplication"],"000A":["CS","PreserveCompositeInstancesAfterMediaCreation"],"000B":["US","TotalNumberOfPiecesOfMediaCreated"],"000C":["LO","RequestedMediaApplicationProfile"],"000D":["SQ","ReferencedStorageMediaSequence"],"000E":["AT","FailureAttributes"],"000F":["CS","AllowLossyCompression"],"0020":["CS","RequestPriority"]},3002:{"0002":["SH","RTImageLabel"],"0003":["LO","RTImageName"],"0004":["ST","RTImageDescription"],"000A":["CS","ReportedValuesOrigin"],"000C":["CS","RTImagePlane"],"000D":["DS","XRayImageReceptorTranslation"],"000E":["DS","XRayImageReceptorAngle"],"0010":["DS","RTImageOrientation"],"0011":["DS","ImagePlanePixelSpacing"],"0012":["DS","RTImagePosition"],"0020":["SH","RadiationMachineName"],"0022":["DS","RadiationMachineSAD"],"0024":["DS","RadiationMachineSSD"],"0026":["DS","RTImageSID"],"0028":["DS","SourceToReferenceObjectDistance"],"0029":["IS","FractionNumber"],"0030":["SQ","ExposureSequence"],"0032":["DS","MetersetExposure"],"0034":["DS","DiaphragmPosition"],"0040":["SQ","FluenceMapSequence"],"0041":["CS","FluenceDataSource"],"0042":["DS","FluenceDataScale"],"0050":["SQ","PrimaryFluenceModeSequence"],"0051":["CS","FluenceMode"],"0052":["SH","FluenceModeID"]},3004:{"0001":["CS","DVHType"],"0002":["CS","DoseUnits"],"0004":["CS","DoseType"],"0006":["LO","DoseComment"],"0008":["DS","NormalizationPoint"],"000A":["CS","DoseSummationType"],"000C":["DS","GridFrameOffsetVector"],"000E":["DS","DoseGridScaling"],"0010":["SQ","RTDoseROISequence"],"0012":["DS","DoseValue"],"0014":["CS","TissueHeterogeneityCorrection"],"0040":["DS","DVHNormalizationPoint"],"0042":["DS","DVHNormalizationDoseValue"],"0050":["SQ","DVHSequence"],"0052":["DS","DVHDoseScaling"],"0054":["CS","DVHVolumeUnits"],"0056":["IS","DVHNumberOfBins"],"0058":["DS","DVHData"],"0060":["SQ","DVHReferencedROISequence"],"0062":["CS","DVHROIContributionType"],"0070":["DS","DVHMinimumDose"],"0072":["DS","DVHMaximumDose"],"0074":["DS","DVHMeanDose"]},3006:{"0002":["SH","StructureSetLabel"],"0004":["LO","StructureSetName"],"0006":["ST","StructureSetDescription"],"0008":["DA","StructureSetDate"],"0009":["TM","StructureSetTime"],"0010":["SQ","ReferencedFrameOfReferenceSequence"],"0012":["SQ","RTReferencedStudySequence"],"0014":["SQ","RTReferencedSeriesSequence"],"0016":["SQ","ContourImageSequence"],"0020":["SQ","StructureSetROISequence"],"0022":["IS","ROINumber"],"0024":["UI","ReferencedFrameOfReferenceUID"],"0026":["LO","ROIName"],"0028":["ST","ROIDescription"],"002A":["IS","ROIDisplayColor"],"002C":["DS","ROIVolume"],"0030":["SQ","RTRelatedROISequence"],"0033":["CS","RTROIRelationship"],"0036":["CS","ROIGenerationAlgorithm"],"0038":["LO","ROIGenerationDescription"],"0039":["SQ","ROIContourSequence"],"0040":["SQ","ContourSequence"],"0042":["CS","ContourGeometricType"],"0044":["DS","ContourSlabThickness"],"0045":["DS","ContourOffsetVector"],"0046":["IS","NumberOfContourPoints"],"0048":["IS","ContourNumber"],"0049":["IS","AttachedContours"],"0050":["DS","ContourData"],"0080":["SQ","RTROIObservationsSequence"],"0082":["IS","ObservationNumber"],"0084":["IS","ReferencedROINumber"],"0085":["SH","ROIObservationLabel"],"0086":["SQ","RTROIIdentificationCodeSequence"],"0088":["ST","ROIObservationDescription"],"00A0":["SQ","RelatedRTROIObservationsSequence"],"00A4":["CS","RTROIInterpretedType"],"00A6":["PN","ROIInterpreter"],"00B0":["SQ","ROIPhysicalPropertiesSequence"],"00B2":["CS","ROIPhysicalProperty"],"00B4":["DS","ROIPhysicalPropertyValue"],"00B6":["SQ","ROIElementalCompositionSequence"],"00B7":["US","ROIElementalCompositionAtomicNumber"],"00B8":["FL","ROIElementalCompositionAtomicMassFraction"],"00C0":["SQ","FrameOfReferenceRelationshipSequence"],"00C2":["UI","RelatedFrameOfReferenceUID"],"00C4":["CS","FrameOfReferenceTransformationType"],"00C6":["DS","FrameOfReferenceTransformationMatrix"],"00C8":["LO","FrameOfReferenceTransformationComment"]},3008:{"0010":["SQ","MeasuredDoseReferenceSequence"],"0012":["ST","MeasuredDoseDescription"],"0014":["CS","MeasuredDoseType"],"0016":["DS","MeasuredDoseValue"],"0020":["SQ","TreatmentSessionBeamSequence"],"0021":["SQ","TreatmentSessionIonBeamSequence"],"0022":["IS","CurrentFractionNumber"],"0024":["DA","TreatmentControlPointDate"],"0025":["TM","TreatmentControlPointTime"],"002A":["CS","TreatmentTerminationStatus"],"002B":["SH","TreatmentTerminationCode"],"002C":["CS","TreatmentVerificationStatus"],"0030":["SQ","ReferencedTreatmentRecordSequence"],"0032":["DS","SpecifiedPrimaryMeterset"],"0033":["DS","SpecifiedSecondaryMeterset"],"0036":["DS","DeliveredPrimaryMeterset"],"0037":["DS","DeliveredSecondaryMeterset"],"003A":["DS","SpecifiedTreatmentTime"],"003B":["DS","DeliveredTreatmentTime"],"0040":["SQ","ControlPointDeliverySequence"],"0041":["SQ","IonControlPointDeliverySequence"],"0042":["DS","SpecifiedMeterset"],"0044":["DS","DeliveredMeterset"],"0045":["FL","MetersetRateSet"],"0046":["FL","MetersetRateDelivered"],"0047":["FL","ScanSpotMetersetsDelivered"],"0048":["DS","DoseRateDelivered"],"0050":["SQ","TreatmentSummaryCalculatedDoseReferenceSequence"],"0052":["DS","CumulativeDoseToDoseReference"],"0054":["DA","FirstTreatmentDate"],"0056":["DA","MostRecentTreatmentDate"],"005A":["IS","NumberOfFractionsDelivered"],"0060":["SQ","OverrideSequence"],"0061":["AT","ParameterSequencePointer"],"0062":["AT","OverrideParameterPointer"],"0063":["IS","ParameterItemIndex"],"0064":["IS","MeasuredDoseReferenceNumber"],"0065":["AT","ParameterPointer"],"0066":["ST","OverrideReason"],"0068":["SQ","CorrectedParameterSequence"],"006A":["FL","CorrectionValue"],"0070":["SQ","CalculatedDoseReferenceSequence"],"0072":["IS","CalculatedDoseReferenceNumber"],"0074":["ST","CalculatedDoseReferenceDescription"],"0076":["DS","CalculatedDoseReferenceDoseValue"],"0078":["DS","StartMeterset"],"007A":["DS","EndMeterset"],"0080":["SQ","ReferencedMeasuredDoseReferenceSequence"],"0082":["IS","ReferencedMeasuredDoseReferenceNumber"],"0090":["SQ","ReferencedCalculatedDoseReferenceSequence"],"0092":["IS","ReferencedCalculatedDoseReferenceNumber"],"00A0":["SQ","BeamLimitingDeviceLeafPairsSequence"],"00B0":["SQ","RecordedWedgeSequence"],"00C0":["SQ","RecordedCompensatorSequence"],"00D0":["SQ","RecordedBlockSequence"],"00E0":["SQ","TreatmentSummaryMeasuredDoseReferenceSequence"],"00F0":["SQ","RecordedSnoutSequence"],"00F2":["SQ","RecordedRangeShifterSequence"],"00F4":["SQ","RecordedLateralSpreadingDeviceSequence"],"00F6":["SQ","RecordedRangeModulatorSequence"],"0100":["SQ","RecordedSourceSequence"],"0105":["LO","SourceSerialNumber"],"0110":["SQ","TreatmentSessionApplicationSetupSequence"],"0116":["CS","ApplicationSetupCheck"],"0120":["SQ","RecordedBrachyAccessoryDeviceSequence"],"0122":["IS","ReferencedBrachyAccessoryDeviceNumber"],"0130":["SQ","RecordedChannelSequence"],"0132":["DS","SpecifiedChannelTotalTime"],"0134":["DS","DeliveredChannelTotalTime"],"0136":["IS","SpecifiedNumberOfPulses"],"0138":["IS","DeliveredNumberOfPulses"],"013A":["DS","SpecifiedPulseRepetitionInterval"],"013C":["DS","DeliveredPulseRepetitionInterval"],"0140":["SQ","RecordedSourceApplicatorSequence"],"0142":["IS","ReferencedSourceApplicatorNumber"],"0150":["SQ","RecordedChannelShieldSequence"],"0152":["IS","ReferencedChannelShieldNumber"],"0160":["SQ","BrachyControlPointDeliveredSequence"],"0162":["DA","SafePositionExitDate"],"0164":["TM","SafePositionExitTime"],"0166":["DA","SafePositionReturnDate"],"0168":["TM","SafePositionReturnTime"],"0200":["CS","CurrentTreatmentStatus"],"0202":["ST","TreatmentStatusComment"],"0220":["SQ","FractionGroupSummarySequence"],"0223":["IS","ReferencedFractionNumber"],"0224":["CS","FractionGroupType"],"0230":["CS","BeamStopperPosition"],"0240":["SQ","FractionStatusSummarySequence"],"0250":["DA","TreatmentDate"],"0251":["TM","TreatmentTime"]},"300A":{"0002":["SH","RTPlanLabel"],"0003":["LO","RTPlanName"],"0004":["ST","RTPlanDescription"],"0006":["DA","RTPlanDate"],"0007":["TM","RTPlanTime"],"0009":["LO","TreatmentProtocols"],"000A":["CS","PlanIntent"],"000B":["LO","TreatmentSites"],"000C":["CS","RTPlanGeometry"],"000E":["ST","PrescriptionDescription"],"0010":["SQ","DoseReferenceSequence"],"0012":["IS","DoseReferenceNumber"],"0013":["UI","DoseReferenceUID"],"0014":["CS","DoseReferenceStructureType"],"0015":["CS","NominalBeamEnergyUnit"],"0016":["LO","DoseReferenceDescription"],"0018":["DS","DoseReferencePointCoordinates"],"001A":["DS","NominalPriorDose"],"0020":["CS","DoseReferenceType"],"0021":["DS","ConstraintWeight"],"0022":["DS","DeliveryWarningDose"],"0023":["DS","DeliveryMaximumDose"],"0025":["DS","TargetMinimumDose"],"0026":["DS","TargetPrescriptionDose"],"0027":["DS","TargetMaximumDose"],"0028":["DS","TargetUnderdoseVolumeFraction"],"002A":["DS","OrganAtRiskFullVolumeDose"],"002B":["DS","OrganAtRiskLimitDose"],"002C":["DS","OrganAtRiskMaximumDose"],"002D":["DS","OrganAtRiskOverdoseVolumeFraction"],"0040":["SQ","ToleranceTableSequence"],"0042":["IS","ToleranceTableNumber"],"0043":["SH","ToleranceTableLabel"],"0044":["DS","GantryAngleTolerance"],"0046":["DS","BeamLimitingDeviceAngleTolerance"],"0048":["SQ","BeamLimitingDeviceToleranceSequence"],"004A":["DS","BeamLimitingDevicePositionTolerance"],"004B":["FL","SnoutPositionTolerance"],"004C":["DS","PatientSupportAngleTolerance"],"004E":["DS","TableTopEccentricAngleTolerance"],"004F":["FL","TableTopPitchAngleTolerance"],"0050":["FL","TableTopRollAngleTolerance"],"0051":["DS","TableTopVerticalPositionTolerance"],"0052":["DS","TableTopLongitudinalPositionTolerance"],"0053":["DS","TableTopLateralPositionTolerance"],"0055":["CS","RTPlanRelationship"],"0070":["SQ","FractionGroupSequence"],"0071":["IS","FractionGroupNumber"],"0072":["LO","FractionGroupDescription"],"0078":["IS","NumberOfFractionsPlanned"],"0079":["IS","NumberOfFractionPatternDigitsPerDay"],"007A":["IS","RepeatFractionCycleLength"],"007B":["LT","FractionPattern"],"0080":["IS","NumberOfBeams"],"0082":["DS","BeamDoseSpecificationPoint"],"0084":["DS","BeamDose"],"0086":["DS","BeamMeterset"],"0088":["FL","BeamDosePointDepth"],"0089":["FL","BeamDosePointEquivalentDepth"],"008A":["FL","BeamDosePointSSD"],"00A0":["IS","NumberOfBrachyApplicationSetups"],"00A2":["DS","BrachyApplicationSetupDoseSpecificationPoint"],"00A4":["DS","BrachyApplicationSetupDose"],"00B0":["SQ","BeamSequence"],"00B2":["SH","TreatmentMachineName"],"00B3":["CS","PrimaryDosimeterUnit"],"00B4":["DS","SourceAxisDistance"],"00B6":["SQ","BeamLimitingDeviceSequence"],"00B8":["CS","RTBeamLimitingDeviceType"],"00BA":["DS","SourceToBeamLimitingDeviceDistance"],"00BB":["FL","IsocenterToBeamLimitingDeviceDistance"],"00BC":["IS","NumberOfLeafJawPairs"],"00BE":["DS","LeafPositionBoundaries"],"00C0":["IS","BeamNumber"],"00C2":["LO","BeamName"],"00C3":["ST","BeamDescription"],"00C4":["CS","BeamType"],"00C6":["CS","RadiationType"],"00C7":["CS","HighDoseTechniqueType"],"00C8":["IS","ReferenceImageNumber"],"00CA":["SQ","PlannedVerificationImageSequence"],"00CC":["LO","ImagingDeviceSpecificAcquisitionParameters"],"00CE":["CS","TreatmentDeliveryType"],"00D0":["IS","NumberOfWedges"],"00D1":["SQ","WedgeSequence"],"00D2":["IS","WedgeNumber"],"00D3":["CS","WedgeType"],"00D4":["SH","WedgeID"],"00D5":["IS","WedgeAngle"],"00D6":["DS","WedgeFactor"],"00D7":["FL","TotalWedgeTrayWaterEquivalentThickness"],"00D8":["DS","WedgeOrientation"],"00D9":["FL","IsocenterToWedgeTrayDistance"],"00DA":["DS","SourceToWedgeTrayDistance"],"00DB":["FL","WedgeThinEdgePosition"],"00DC":["SH","BolusID"],"00DD":["ST","BolusDescription"],"00E0":["IS","NumberOfCompensators"],"00E1":["SH","MaterialID"],"00E2":["DS","TotalCompensatorTrayFactor"],"00E3":["SQ","CompensatorSequence"],"00E4":["IS","CompensatorNumber"],"00E5":["SH","CompensatorID"],"00E6":["DS","SourceToCompensatorTrayDistance"],"00E7":["IS","CompensatorRows"],"00E8":["IS","CompensatorColumns"],"00E9":["DS","CompensatorPixelSpacing"],"00EA":["DS","CompensatorPosition"],"00EB":["DS","CompensatorTransmissionData"],"00EC":["DS","CompensatorThicknessData"],"00ED":["IS","NumberOfBoli"],"00EE":["CS","CompensatorType"],"00F0":["IS","NumberOfBlocks"],"00F2":["DS","TotalBlockTrayFactor"],"00F3":["FL","TotalBlockTrayWaterEquivalentThickness"],"00F4":["SQ","BlockSequence"],"00F5":["SH","BlockTrayID"],"00F6":["DS","SourceToBlockTrayDistance"],"00F7":["FL","IsocenterToBlockTrayDistance"],"00F8":["CS","BlockType"],"00F9":["LO","AccessoryCode"],"00FA":["CS","BlockDivergence"],"00FB":["CS","BlockMountingPosition"],"00FC":["IS","BlockNumber"],"00FE":["LO","BlockName"],"0100":["DS","BlockThickness"],"0102":["DS","BlockTransmission"],"0104":["IS","BlockNumberOfPoints"],"0106":["DS","BlockData"],"0107":["SQ","ApplicatorSequence"],"0108":["SH","ApplicatorID"],"0109":["CS","ApplicatorType"],"010A":["LO","ApplicatorDescription"],"010C":["DS","CumulativeDoseReferenceCoefficient"],"010E":["DS","FinalCumulativeMetersetWeight"],"0110":["IS","NumberOfControlPoints"],"0111":["SQ","ControlPointSequence"],"0112":["IS","ControlPointIndex"],"0114":["DS","NominalBeamEnergy"],"0115":["DS","DoseRateSet"],"0116":["SQ","WedgePositionSequence"],"0118":["CS","WedgePosition"],"011A":["SQ","BeamLimitingDevicePositionSequence"],"011C":["DS","LeafJawPositions"],"011E":["DS","GantryAngle"],"011F":["CS","GantryRotationDirection"],"0120":["DS","BeamLimitingDeviceAngle"],"0121":["CS","BeamLimitingDeviceRotationDirection"],"0122":["DS","PatientSupportAngle"],"0123":["CS","PatientSupportRotationDirection"],"0124":["DS","TableTopEccentricAxisDistance"],"0125":["DS","TableTopEccentricAngle"],"0126":["CS","TableTopEccentricRotationDirection"],"0128":["DS","TableTopVerticalPosition"],"0129":["DS","TableTopLongitudinalPosition"],"012A":["DS","TableTopLateralPosition"],"012C":["DS","IsocenterPosition"],"012E":["DS","SurfaceEntryPoint"],"0130":["DS","SourceToSurfaceDistance"],"0134":["DS","CumulativeMetersetWeight"],"0140":["FL","TableTopPitchAngle"],"0142":["CS","TableTopPitchRotationDirection"],"0144":["FL","TableTopRollAngle"],"0146":["CS","TableTopRollRotationDirection"],"0148":["FL","HeadFixationAngle"],"014A":["FL","GantryPitchAngle"],"014C":["CS","GantryPitchRotationDirection"],"014E":["FL","GantryPitchAngleTolerance"],"0180":["SQ","PatientSetupSequence"],"0182":["IS","PatientSetupNumber"],"0183":["LO","PatientSetupLabel"],"0184":["LO","PatientAdditionalPosition"],"0190":["SQ","FixationDeviceSequence"],"0192":["CS","FixationDeviceType"],"0194":["SH","FixationDeviceLabel"],"0196":["ST","FixationDeviceDescription"],"0198":["SH","FixationDevicePosition"],"0199":["FL","FixationDevicePitchAngle"],"019A":["FL","FixationDeviceRollAngle"],"01A0":["SQ","ShieldingDeviceSequence"],"01A2":["CS","ShieldingDeviceType"],"01A4":["SH","ShieldingDeviceLabel"],"01A6":["ST","ShieldingDeviceDescription"],"01A8":["SH","ShieldingDevicePosition"],"01B0":["CS","SetupTechnique"],"01B2":["ST","SetupTechniqueDescription"],"01B4":["SQ","SetupDeviceSequence"],"01B6":["CS","SetupDeviceType"],"01B8":["SH","SetupDeviceLabel"],"01BA":["ST","SetupDeviceDescription"],"01BC":["DS","SetupDeviceParameter"],"01D0":["ST","SetupReferenceDescription"],"01D2":["DS","TableTopVerticalSetupDisplacement"],"01D4":["DS","TableTopLongitudinalSetupDisplacement"],"01D6":["DS","TableTopLateralSetupDisplacement"],"0200":["CS","BrachyTreatmentTechnique"],"0202":["CS","BrachyTreatmentType"],"0206":["SQ","TreatmentMachineSequence"],"0210":["SQ","SourceSequence"],"0212":["IS","SourceNumber"],"0214":["CS","SourceType"],"0216":["LO","SourceManufacturer"],"0218":["DS","ActiveSourceDiameter"],"021A":["DS","ActiveSourceLength"],"0222":["DS","SourceEncapsulationNominalThickness"],"0224":["DS","SourceEncapsulationNominalTransmission"],"0226":["LO","SourceIsotopeName"],"0228":["DS","SourceIsotopeHalfLife"],"0229":["CS","SourceStrengthUnits"],"022A":["DS","ReferenceAirKermaRate"],"022B":["DS","SourceStrength"],"022C":["DA","SourceStrengthReferenceDate"],"022E":["TM","SourceStrengthReferenceTime"],"0230":["SQ","ApplicationSetupSequence"],"0232":["CS","ApplicationSetupType"],"0234":["IS","ApplicationSetupNumber"],"0236":["LO","ApplicationSetupName"],"0238":["LO","ApplicationSetupManufacturer"],"0240":["IS","TemplateNumber"],"0242":["SH","TemplateType"],"0244":["LO","TemplateName"],"0250":["DS","TotalReferenceAirKerma"],"0260":["SQ","BrachyAccessoryDeviceSequence"],"0262":["IS","BrachyAccessoryDeviceNumber"],"0263":["SH","BrachyAccessoryDeviceID"],"0264":["CS","BrachyAccessoryDeviceType"],"0266":["LO","BrachyAccessoryDeviceName"],"026A":["DS","BrachyAccessoryDeviceNominalThickness"],"026C":["DS","BrachyAccessoryDeviceNominalTransmission"],"0280":["SQ","ChannelSequence"],"0282":["IS","ChannelNumber"],"0284":["DS","ChannelLength"],"0286":["DS","ChannelTotalTime"],"0288":["CS","SourceMovementType"],"028A":["IS","NumberOfPulses"],"028C":["DS","PulseRepetitionInterval"],"0290":["IS","SourceApplicatorNumber"],"0291":["SH","SourceApplicatorID"],"0292":["CS","SourceApplicatorType"],"0294":["LO","SourceApplicatorName"],"0296":["DS","SourceApplicatorLength"],"0298":["LO","SourceApplicatorManufacturer"],"029C":["DS","SourceApplicatorWallNominalThickness"],"029E":["DS","SourceApplicatorWallNominalTransmission"],"02A0":["DS","SourceApplicatorStepSize"],"02A2":["IS","TransferTubeNumber"],"02A4":["DS","TransferTubeLength"],"02B0":["SQ","ChannelShieldSequence"],"02B2":["IS","ChannelShieldNumber"],"02B3":["SH","ChannelShieldID"],"02B4":["LO","ChannelShieldName"],"02B8":["DS","ChannelShieldNominalThickness"],"02BA":["DS","ChannelShieldNominalTransmission"],"02C8":["DS","FinalCumulativeTimeWeight"],"02D0":["SQ","BrachyControlPointSequence"],"02D2":["DS","ControlPointRelativePosition"],"02D4":["DS","ControlPoint3DPosition"],"02D6":["DS","CumulativeTimeWeight"],"02E0":["CS","CompensatorDivergence"],"02E1":["CS","CompensatorMountingPosition"],"02E2":["DS","SourceToCompensatorDistance"],"02E3":["FL","TotalCompensatorTrayWaterEquivalentThickness"],"02E4":["FL","IsocenterToCompensatorTrayDistance"],"02E5":["FL","CompensatorColumnOffset"],"02E6":["FL","IsocenterToCompensatorDistances"],"02E7":["FL","CompensatorRelativeStoppingPowerRatio"],"02E8":["FL","CompensatorMillingToolDiameter"],"02EA":["SQ","IonRangeCompensatorSequence"],"02EB":["LT","CompensatorDescription"],"0302":["IS","RadiationMassNumber"],"0304":["IS","RadiationAtomicNumber"],"0306":["SS","RadiationChargeState"],"0308":["CS","ScanMode"],"030A":["FL","VirtualSourceAxisDistances"],"030C":["SQ","SnoutSequence"],"030D":["FL","SnoutPosition"],"030F":["SH","SnoutID"],"0312":["IS","NumberOfRangeShifters"],"0314":["SQ","RangeShifterSequence"],"0316":["IS","RangeShifterNumber"],"0318":["SH","RangeShifterID"],"0320":["CS","RangeShifterType"],"0322":["LO","RangeShifterDescription"],"0330":["IS","NumberOfLateralSpreadingDevices"],"0332":["SQ","LateralSpreadingDeviceSequence"],"0334":["IS","LateralSpreadingDeviceNumber"],"0336":["SH","LateralSpreadingDeviceID"],"0338":["CS","LateralSpreadingDeviceType"],"033A":["LO","LateralSpreadingDeviceDescription"],"033C":["FL","LateralSpreadingDeviceWaterEquivalentThickness"],"0340":["IS","NumberOfRangeModulators"],"0342":["SQ","RangeModulatorSequence"],"0344":["IS","RangeModulatorNumber"],"0346":["SH","RangeModulatorID"],"0348":["CS","RangeModulatorType"],"034A":["LO","RangeModulatorDescription"],"034C":["SH","BeamCurrentModulationID"],"0350":["CS","PatientSupportType"],"0352":["SH","PatientSupportID"],"0354":["LO","PatientSupportAccessoryCode"],"0356":["FL","FixationLightAzimuthalAngle"],"0358":["FL","FixationLightPolarAngle"],"035A":["FL","MetersetRate"],"0360":["SQ","RangeShifterSettingsSequence"],"0362":["LO","RangeShifterSetting"],"0364":["FL","IsocenterToRangeShifterDistance"],"0366":["FL","RangeShifterWaterEquivalentThickness"],"0370":["SQ","LateralSpreadingDeviceSettingsSequence"],"0372":["LO","LateralSpreadingDeviceSetting"],"0374":["FL","IsocenterToLateralSpreadingDeviceDistance"],"0380":["SQ","RangeModulatorSettingsSequence"],"0382":["FL","RangeModulatorGatingStartValue"],"0384":["FL","RangeModulatorGatingStopValue"],"0386":["FL","RangeModulatorGatingStartWaterEquivalentThickness"],"0388":["FL","RangeModulatorGatingStopWaterEquivalentThickness"],"038A":["FL","IsocenterToRangeModulatorDistance"],"0390":["SH","ScanSpotTuneID"],"0392":["IS","NumberOfScanSpotPositions"],"0394":["FL","ScanSpotPositionMap"],"0396":["FL","ScanSpotMetersetWeights"],"0398":["FL","ScanningSpotSize"],"039A":["IS","NumberOfPaintings"],"03A0":["SQ","IonToleranceTableSequence"],"03A2":["SQ","IonBeamSequence"],"03A4":["SQ","IonBeamLimitingDeviceSequence"],"03A6":["SQ","IonBlockSequence"],"03A8":["SQ","IonControlPointSequence"],"03AA":["SQ","IonWedgeSequence"],"03AC":["SQ","IonWedgePositionSequence"],"0401":["SQ","ReferencedSetupImageSequence"],"0402":["ST","SetupImageComment"],"0410":["SQ","MotionSynchronizationSequence"],"0412":["FL","ControlPointOrientation"],"0420":["SQ","GeneralAccessorySequence"],"0421":["SH","GeneralAccessoryID"],"0422":["ST","GeneralAccessoryDescription"],"0423":["CS","GeneralAccessoryType"],"0424":["IS","GeneralAccessoryNumber"],"0431":["SQ","ApplicatorGeometrySequence"],"0432":["CS","ApplicatorApertureShape"],"0433":["FL","ApplicatorOpening"],"0434":["FL","ApplicatorOpeningX"],"0435":["FL","ApplicatorOpeningY"],"0436":["FL","SourceToApplicatorMountingPositionDistance"]},"300C":{"0002":["SQ","ReferencedRTPlanSequence"],"0004":["SQ","ReferencedBeamSequence"],"0006":["IS","ReferencedBeamNumber"],"0007":["IS","ReferencedReferenceImageNumber"],"0008":["DS","StartCumulativeMetersetWeight"],"0009":["DS","EndCumulativeMetersetWeight"],"000A":["SQ","ReferencedBrachyApplicationSetupSequence"],"000C":["IS","ReferencedBrachyApplicationSetupNumber"],"000E":["IS","ReferencedSourceNumber"],"0020":["SQ","ReferencedFractionGroupSequence"],"0022":["IS","ReferencedFractionGroupNumber"],"0040":["SQ","ReferencedVerificationImageSequence"],"0042":["SQ","ReferencedReferenceImageSequence"],"0050":["SQ","ReferencedDoseReferenceSequence"],"0051":["IS","ReferencedDoseReferenceNumber"],"0055":["SQ","BrachyReferencedDoseReferenceSequence"],"0060":["SQ","ReferencedStructureSetSequence"],"006A":["IS","ReferencedPatientSetupNumber"],"0080":["SQ","ReferencedDoseSequence"],"00A0":["IS","ReferencedToleranceTableNumber"],"00B0":["SQ","ReferencedBolusSequence"],"00C0":["IS","ReferencedWedgeNumber"],"00D0":["IS","ReferencedCompensatorNumber"],"00E0":["IS","ReferencedBlockNumber"],"00F0":["IS","ReferencedControlPointIndex"],"00F2":["SQ","ReferencedControlPointSequence"],"00F4":["IS","ReferencedStartControlPointIndex"],"00F6":["IS","ReferencedStopControlPointIndex"],"0100":["IS","ReferencedRangeShifterNumber"],"0102":["IS","ReferencedLateralSpreadingDeviceNumber"],"0104":["IS","ReferencedRangeModulatorNumber"]},"300E":{"0002":["CS","ApprovalStatus"],"0004":["DA","ReviewDate"],"0005":["TM","ReviewTime"],"0008":["PN","ReviewerName"]},4e3:{"0010":["LT","Arbitrary"],4e3:["LT","TextComments"]},4008:{"0040":["SH","ResultsID"],"0042":["LO","ResultsIDIssuer"],"0050":["SQ","ReferencedInterpretationSequence"],"00FF":["CS","ReportProductionStatusTrial"],"0100":["DA","InterpretationRecordedDate"],"0101":["TM","InterpretationRecordedTime"],"0102":["PN","InterpretationRecorder"],"0103":["LO","ReferenceToRecordedSound"],"0108":["DA","InterpretationTranscriptionDate"],"0109":["TM","InterpretationTranscriptionTime"],"010A":["PN","InterpretationTranscriber"],"010B":["ST","InterpretationText"],"010C":["PN","InterpretationAuthor"],"0111":["SQ","InterpretationApproverSequence"],"0112":["DA","InterpretationApprovalDate"],"0113":["TM","InterpretationApprovalTime"],"0114":["PN","PhysicianApprovingInterpretation"],"0115":["LT","InterpretationDiagnosisDescription"],"0117":["SQ","InterpretationDiagnosisCodeSequence"],"0118":["SQ","ResultsDistributionListSequence"],"0119":["PN","DistributionName"],"011A":["LO","DistributionAddress"],"0200":["SH","InterpretationID"],"0202":["LO","InterpretationIDIssuer"],"0210":["CS","InterpretationTypeID"],"0212":["CS","InterpretationStatusID"],"0300":["ST","Impressions"],4e3:["ST","ResultsComments"]},4010:{"0001":["CS","LowEnergyDetectors"],"0002":["CS","HighEnergyDetectors"],"0004":["SQ","DetectorGeometrySequence"],1001:["SQ","ThreatROIVoxelSequence"],1004:["FL","ThreatROIBase"],1005:["FL","ThreatROIExtents"],1006:["OB","ThreatROIBitmap"],1007:["SH","RouteSegmentID"],1008:["CS","GantryType"],1009:["CS","OOIOwnerType"],"100A":["SQ","RouteSegmentSequence"],1010:["US","PotentialThreatObjectID"],1011:["SQ","ThreatSequence"],1012:["CS","ThreatCategory"],1013:["LT","ThreatCategoryDescription"],1014:["CS","ATDAbilityAssessment"],1015:["CS","ATDAssessmentFlag"],1016:["FL","ATDAssessmentProbability"],1017:["FL","Mass"],1018:["FL","Density"],1019:["FL","ZEffective"],"101A":["SH","BoardingPassID"],"101B":["FL","CenterOfMass"],"101C":["FL","CenterOfPTO"],"101D":["FL","BoundingPolygon"],"101E":["SH","RouteSegmentStartLocationID"],"101F":["SH","RouteSegmentEndLocationID"],1020:["CS","RouteSegmentLocationIDType"],1021:["CS","AbortReason"],1023:["FL","VolumeOfPTO"],1024:["CS","AbortFlag"],1025:["DT","RouteSegmentStartTime"],1026:["DT","RouteSegmentEndTime"],1027:["CS","TDRType"],1028:["CS","InternationalRouteSegment"],1029:["LO","ThreatDetectionAlgorithmandVersion"],"102A":["SH","AssignedLocation"],"102B":["DT","AlarmDecisionTime"],1031:["CS","AlarmDecision"],1033:["US","NumberOfTotalObjects"],1034:["US","NumberOfAlarmObjects"],1037:["SQ","PTORepresentationSequence"],1038:["SQ","ATDAssessmentSequence"],1039:["CS","TIPType"],"103A":["CS","DICOSVersion"],1041:["DT","OOIOwnerCreationTime"],1042:["CS","OOIType"],1043:["FL","OOISize"],1044:["CS","AcquisitionStatus"],1045:["SQ","BasisMaterialsCodeSequence"],1046:["CS","PhantomType"],1047:["SQ","OOIOwnerSequence"],1048:["CS","ScanType"],1051:["LO","ItineraryID"],1052:["SH","ItineraryIDType"],1053:["LO","ItineraryIDAssigningAuthority"],1054:["SH","RouteID"],1055:["SH","RouteIDAssigningAuthority"],1056:["CS","InboundArrivalType"],1058:["SH","CarrierID"],1059:["CS","CarrierIDAssigningAuthority"],1060:["FL","SourceOrientation"],1061:["FL","SourcePosition"],1062:["FL","BeltHeight"],1064:["SQ","AlgorithmRoutingCodeSequence"],1067:["CS","TransportClassification"],1068:["LT","OOITypeDescriptor"],1069:["FL","TotalProcessingTime"],"106C":["OB","DetectorCalibrationData"]}},n.Dictionary.getVR=function(s,c){var f,g,A;return A=n.Dictionary.dict[n.Utils.dec2hex(s)],A&&(g=A[n.Utils.dec2hex(c)],g?f=g[0]:c===0&&(f="UL")),f||(A=n.Dictionary.dictPrivate[n.Utils.dec2hex(s)],A&&(g=A[n.Utils.dec2hex(c)],g&&(f=g[0]))),f||(f="OB"),f},n.Dictionary.getDescription=function(s,c){var f,g,A;return A=n.Dictionary.dict[n.Utils.dec2hex(s)],A&&(g=A[n.Utils.dec2hex(c)],g?f=g[1]:c===0&&(f="Group "+n.Utils.dec2hex(s)+" Length")),f||(A=n.Dictionary.dictPrivate[n.Utils.dec2hex(s)],A&&(g=A[n.Utils.dec2hex(c)],g&&(f=g[1]))),f||(f="PrivateData"),f},u.exports&&(u.exports=n.Dictionary)}(dictionary)),dictionary.exports}var image$1={exports:{}},tag={exports:{}},lib$1={exports:{}},_default$1={},lib={exports:{}},_default={},hasRequired_default$1;function require_default$1(){if(hasRequired_default$1)return _default;hasRequired_default$1=1;function u(){var g={};return g["align-content"]=!1,g["align-items"]=!1,g["align-self"]=!1,g["alignment-adjust"]=!1,g["alignment-baseline"]=!1,g.all=!1,g["anchor-point"]=!1,g.animation=!1,g["animation-delay"]=!1,g["animation-direction"]=!1,g["animation-duration"]=!1,g["animation-fill-mode"]=!1,g["animation-iteration-count"]=!1,g["animation-name"]=!1,g["animation-play-state"]=!1,g["animation-timing-function"]=!1,g.azimuth=!1,g["backface-visibility"]=!1,g.background=!0,g["background-attachment"]=!0,g["background-clip"]=!0,g["background-color"]=!0,g["background-image"]=!0,g["background-origin"]=!0,g["background-position"]=!0,g["background-repeat"]=!0,g["background-size"]=!0,g["baseline-shift"]=!1,g.binding=!1,g.bleed=!1,g["bookmark-label"]=!1,g["bookmark-level"]=!1,g["bookmark-state"]=!1,g.border=!0,g["border-bottom"]=!0,g["border-bottom-color"]=!0,g["border-bottom-left-radius"]=!0,g["border-bottom-right-radius"]=!0,g["border-bottom-style"]=!0,g["border-bottom-width"]=!0,g["border-collapse"]=!0,g["border-color"]=!0,g["border-image"]=!0,g["border-image-outset"]=!0,g["border-image-repeat"]=!0,g["border-image-slice"]=!0,g["border-image-source"]=!0,g["border-image-width"]=!0,g["border-left"]=!0,g["border-left-color"]=!0,g["border-left-style"]=!0,g["border-left-width"]=!0,g["border-radius"]=!0,g["border-right"]=!0,g["border-right-color"]=!0,g["border-right-style"]=!0,g["border-right-width"]=!0,g["border-spacing"]=!0,g["border-style"]=!0,g["border-top"]=!0,g["border-top-color"]=!0,g["border-top-left-radius"]=!0,g["border-top-right-radius"]=!0,g["border-top-style"]=!0,g["border-top-width"]=!0,g["border-width"]=!0,g.bottom=!1,g["box-decoration-break"]=!0,g["box-shadow"]=!0,g["box-sizing"]=!0,g["box-snap"]=!0,g["box-suppress"]=!0,g["break-after"]=!0,g["break-before"]=!0,g["break-inside"]=!0,g["caption-side"]=!1,g.chains=!1,g.clear=!0,g.clip=!1,g["clip-path"]=!1,g["clip-rule"]=!1,g.color=!0,g["color-interpolation-filters"]=!0,g["column-count"]=!1,g["column-fill"]=!1,g["column-gap"]=!1,g["column-rule"]=!1,g["column-rule-color"]=!1,g["column-rule-style"]=!1,g["column-rule-width"]=!1,g["column-span"]=!1,g["column-width"]=!1,g.columns=!1,g.contain=!1,g.content=!1,g["counter-increment"]=!1,g["counter-reset"]=!1,g["counter-set"]=!1,g.crop=!1,g.cue=!1,g["cue-after"]=!1,g["cue-before"]=!1,g.cursor=!1,g.direction=!1,g.display=!0,g["display-inside"]=!0,g["display-list"]=!0,g["display-outside"]=!0,g["dominant-baseline"]=!1,g.elevation=!1,g["empty-cells"]=!1,g.filter=!1,g.flex=!1,g["flex-basis"]=!1,g["flex-direction"]=!1,g["flex-flow"]=!1,g["flex-grow"]=!1,g["flex-shrink"]=!1,g["flex-wrap"]=!1,g.float=!1,g["float-offset"]=!1,g["flood-color"]=!1,g["flood-opacity"]=!1,g["flow-from"]=!1,g["flow-into"]=!1,g.font=!0,g["font-family"]=!0,g["font-feature-settings"]=!0,g["font-kerning"]=!0,g["font-language-override"]=!0,g["font-size"]=!0,g["font-size-adjust"]=!0,g["font-stretch"]=!0,g["font-style"]=!0,g["font-synthesis"]=!0,g["font-variant"]=!0,g["font-variant-alternates"]=!0,g["font-variant-caps"]=!0,g["font-variant-east-asian"]=!0,g["font-variant-ligatures"]=!0,g["font-variant-numeric"]=!0,g["font-variant-position"]=!0,g["font-weight"]=!0,g.grid=!1,g["grid-area"]=!1,g["grid-auto-columns"]=!1,g["grid-auto-flow"]=!1,g["grid-auto-rows"]=!1,g["grid-column"]=!1,g["grid-column-end"]=!1,g["grid-column-start"]=!1,g["grid-row"]=!1,g["grid-row-end"]=!1,g["grid-row-start"]=!1,g["grid-template"]=!1,g["grid-template-areas"]=!1,g["grid-template-columns"]=!1,g["grid-template-rows"]=!1,g["hanging-punctuation"]=!1,g.height=!0,g.hyphens=!1,g.icon=!1,g["image-orientation"]=!1,g["image-resolution"]=!1,g["ime-mode"]=!1,g["initial-letters"]=!1,g["inline-box-align"]=!1,g["justify-content"]=!1,g["justify-items"]=!1,g["justify-self"]=!1,g.left=!1,g["letter-spacing"]=!0,g["lighting-color"]=!0,g["line-box-contain"]=!1,g["line-break"]=!1,g["line-grid"]=!1,g["line-height"]=!1,g["line-snap"]=!1,g["line-stacking"]=!1,g["line-stacking-ruby"]=!1,g["line-stacking-shift"]=!1,g["line-stacking-strategy"]=!1,g["list-style"]=!0,g["list-style-image"]=!0,g["list-style-position"]=!0,g["list-style-type"]=!0,g.margin=!0,g["margin-bottom"]=!0,g["margin-left"]=!0,g["margin-right"]=!0,g["margin-top"]=!0,g["marker-offset"]=!1,g["marker-side"]=!1,g.marks=!1,g.mask=!1,g["mask-box"]=!1,g["mask-box-outset"]=!1,g["mask-box-repeat"]=!1,g["mask-box-slice"]=!1,g["mask-box-source"]=!1,g["mask-box-width"]=!1,g["mask-clip"]=!1,g["mask-image"]=!1,g["mask-origin"]=!1,g["mask-position"]=!1,g["mask-repeat"]=!1,g["mask-size"]=!1,g["mask-source-type"]=!1,g["mask-type"]=!1,g["max-height"]=!0,g["max-lines"]=!1,g["max-width"]=!0,g["min-height"]=!0,g["min-width"]=!0,g["move-to"]=!1,g["nav-down"]=!1,g["nav-index"]=!1,g["nav-left"]=!1,g["nav-right"]=!1,g["nav-up"]=!1,g["object-fit"]=!1,g["object-position"]=!1,g.opacity=!1,g.order=!1,g.orphans=!1,g.outline=!1,g["outline-color"]=!1,g["outline-offset"]=!1,g["outline-style"]=!1,g["outline-width"]=!1,g.overflow=!1,g["overflow-wrap"]=!1,g["overflow-x"]=!1,g["overflow-y"]=!1,g.padding=!0,g["padding-bottom"]=!0,g["padding-left"]=!0,g["padding-right"]=!0,g["padding-top"]=!0,g.page=!1,g["page-break-after"]=!1,g["page-break-before"]=!1,g["page-break-inside"]=!1,g["page-policy"]=!1,g.pause=!1,g["pause-after"]=!1,g["pause-before"]=!1,g.perspective=!1,g["perspective-origin"]=!1,g.pitch=!1,g["pitch-range"]=!1,g["play-during"]=!1,g.position=!1,g["presentation-level"]=!1,g.quotes=!1,g["region-fragment"]=!1,g.resize=!1,g.rest=!1,g["rest-after"]=!1,g["rest-before"]=!1,g.richness=!1,g.right=!1,g.rotation=!1,g["rotation-point"]=!1,g["ruby-align"]=!1,g["ruby-merge"]=!1,g["ruby-position"]=!1,g["shape-image-threshold"]=!1,g["shape-outside"]=!1,g["shape-margin"]=!1,g.size=!1,g.speak=!1,g["speak-as"]=!1,g["speak-header"]=!1,g["speak-numeral"]=!1,g["speak-punctuation"]=!1,g["speech-rate"]=!1,g.stress=!1,g["string-set"]=!1,g["tab-size"]=!1,g["table-layout"]=!1,g["text-align"]=!0,g["text-align-last"]=!0,g["text-combine-upright"]=!0,g["text-decoration"]=!0,g["text-decoration-color"]=!0,g["text-decoration-line"]=!0,g["text-decoration-skip"]=!0,g["text-decoration-style"]=!0,g["text-emphasis"]=!0,g["text-emphasis-color"]=!0,g["text-emphasis-position"]=!0,g["text-emphasis-style"]=!0,g["text-height"]=!0,g["text-indent"]=!0,g["text-justify"]=!0,g["text-orientation"]=!0,g["text-overflow"]=!0,g["text-shadow"]=!0,g["text-space-collapse"]=!0,g["text-transform"]=!0,g["text-underline-position"]=!0,g["text-wrap"]=!0,g.top=!1,g.transform=!1,g["transform-origin"]=!1,g["transform-style"]=!1,g.transition=!1,g["transition-delay"]=!1,g["transition-duration"]=!1,g["transition-property"]=!1,g["transition-timing-function"]=!1,g["unicode-bidi"]=!1,g["vertical-align"]=!1,g.visibility=!1,g["voice-balance"]=!1,g["voice-duration"]=!1,g["voice-family"]=!1,g["voice-pitch"]=!1,g["voice-range"]=!1,g["voice-rate"]=!1,g["voice-stress"]=!1,g["voice-volume"]=!1,g.volume=!1,g["white-space"]=!1,g.widows=!1,g.width=!0,g["will-change"]=!1,g["word-break"]=!0,g["word-spacing"]=!0,g["word-wrap"]=!0,g["wrap-flow"]=!1,g["wrap-through"]=!1,g["writing-mode"]=!1,g["z-index"]=!1,g}function n(g,A,v){}function s(g,A,v){}var c=/javascript\s*\:/img;function f(g,A){return c.test(A)?"":A}return _default.whiteList=u(),_default.getDefaultWhiteList=u,_default.onAttr=n,_default.onIgnoreAttr=s,_default.safeAttrValue=f,_default}var util$1,hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,util$1={indexOf:function(u,n){var s,c;if(Array.prototype.indexOf)return u.indexOf(n);for(s=0,c=u.length;s/g,e=/"/g,N=/"/g,M=/&#([a-zA-Z0-9]*);?/gim,O=/:?/gim,U=/&newline;?/gim,B=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,V=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,b=/u\s*r\s*l\s*\(.*/gi;function W(pe){return pe.replace(e,""")}function q(pe){return pe.replace(N,'"')}function Y(pe){return pe.replace(M,function(xe,we){return we[0]==="x"||we[0]==="X"?String.fromCharCode(parseInt(we.substr(1),16)):String.fromCharCode(parseInt(we,10))})}function X(pe){return pe.replace(O,":").replace(U," ")}function Q(pe){for(var Se="",xe=0,we=pe.length;xe",we);if(Fe===-1)break;xe=Fe+3}return Se}function me(pe){var Se=pe.split("");return Se=Se.filter(function(xe){var we=xe.charCodeAt(0);return we===127?!1:we<=31?we===10||we===13:!0}),Se.join("")}return _default$1.whiteList=c(),_default$1.getDefaultWhiteList=c,_default$1.onTag=g,_default$1.onIgnoreTag=A,_default$1.onTagAttr=v,_default$1.onIgnoreTagAttr=y,_default$1.safeAttrValue=I,_default$1.escapeHtml=T,_default$1.escapeQuote=W,_default$1.unescapeQuote=q,_default$1.escapeHtmlEntities=Y,_default$1.escapeDangerHtml5Entities=X,_default$1.clearNonPrintableCharacter=Q,_default$1.friendlyAttrValue=m,_default$1.escapeAttrValue=Z,_default$1.onIgnoreTagStripAll=ee,_default$1.StripTagBody=oe,_default$1.stripCommentTag=fe,_default$1.stripBlankChar=me,_default$1.cssFilter=f,_default$1.getDefaultCSSWhiteList=n,_default$1}var parser$1={},hasRequiredParser$1;function requireParser$1(){if(hasRequiredParser$1)return parser$1;hasRequiredParser$1=1;var u=requireUtil();function n(S){var k=u.spaceIndex(S),e;return k===-1?e=S.slice(1,-1):e=S.slice(1,k+1),e=u.trim(e).toLowerCase(),e.slice(0,1)==="/"&&(e=e.slice(1)),e.slice(-1)==="/"&&(e=e.slice(0,-1)),e}function s(S){return S.slice(0,2)===""||B===V-1){N+=e(S.slice(M,O)),W=S.slice(O,B+1),b=n(W),N+=k(O,N.length,b,W,s(W)),M=B+1,O=!1;continue}if(q==='"'||q==="'")for(var Y=1,X=S.charAt(B-Y);X.trim()===""||X==="=";){if(X==="="){U=q;continue e}X=S.charAt(B-++Y)}}else if(q===U){U=!1;continue}}return M0;k--){var e=S[k];if(e!==" ")return e==="="?k:-1}}function T(S){return S[0]==='"'&&S[S.length-1]==='"'||S[0]==="'"&&S[S.length-1]==="'"}function I(S){return T(S)?S.substr(1,S.length-2):S}return parser$1.parseTag=c,parser$1.parseAttr=g,parser$1}var xss,hasRequiredXss;function requireXss(){if(hasRequiredXss)return xss;hasRequiredXss=1;var u=requireLib$1().FilterCSS,n=require_default(),s=requireParser$1(),c=s.parseTag,f=s.parseAttr,g=requireUtil();function A(S){return S==null}function v(S){var k=g.spaceIndex(S);if(k===-1)return{html:"",closing:S[S.length-2]==="/"};S=g.trim(S.slice(k+1,-1));var e=S[S.length-1]==="/";return e&&(S=g.trim(S.slice(0,-1))),{html:S,closing:e}}function y(S){var k={};for(var e in S)k[e]=S[e];return k}function T(S){var k={};for(var e in S)Array.isArray(S[e])?k[e.toLowerCase()]=S[e].map(function(N){return N.toLowerCase()}):k[e.toLowerCase()]=S[e];return k}function I(S){S=y(S||{}),S.stripIgnoreTag&&(S.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),S.onIgnoreTag=n.onIgnoreTagStripAll),S.whiteList||S.allowList?S.whiteList=T(S.whiteList||S.allowList):S.whiteList=n.whiteList,S.onTag=S.onTag||n.onTag,S.onTagAttr=S.onTagAttr||n.onTagAttr,S.onIgnoreTag=S.onIgnoreTag||n.onIgnoreTag,S.onIgnoreTagAttr=S.onIgnoreTagAttr||n.onIgnoreTagAttr,S.safeAttrValue=S.safeAttrValue||n.safeAttrValue,S.escapeHtml=S.escapeHtml||n.escapeHtml,this.options=S,S.css===!1?this.cssFilter=!1:(S.css=S.css||{},this.cssFilter=new u(S.css))}return I.prototype.process=function(S){if(S=S||"",S=S.toString(),!S)return"";var k=this,e=k.options,N=e.whiteList,M=e.onTag,O=e.onIgnoreTag,U=e.onTagAttr,B=e.onIgnoreTagAttr,V=e.safeAttrValue,b=e.escapeHtml,W=k.cssFilter;e.stripBlankChar&&(S=n.stripBlankChar(S)),e.allowCommentTag||(S=n.stripCommentTag(S));var q=!1;e.stripIgnoreTagBody&&(q=n.StripTagBody(e.stripIgnoreTagBody,O),O=q.onIgnoreTag);var Y=c(S,function(X,Q,m,Z,ee){var oe={sourcePosition:X,position:Q,isClosing:ee,isWhite:Object.prototype.hasOwnProperty.call(N,m)},fe=M(m,Z,oe);if(!A(fe))return fe;if(oe.isWhite){if(oe.isClosing)return"";var me=v(Z),pe=N[m],Se=f(me.html,function(xe,we){var Fe=g.indexOf(pe,xe)!==-1,De=U(m,xe,we,Fe);return A(De)?Fe?(we=V(m,xe,we,W),we?xe+'="'+we+'"':xe):(De=B(m,xe,we,Fe),A(De)?void 0:De):De});return Z="<"+m,Se&&(Z+=" "+Se),me.closing&&(Z+=" /"),Z+=">",Z}else return fe=O(m,Z,oe),A(fe)?b(Z):fe},b);return q&&(Y=q.remove(Y)),Y},xss=I,xss}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(u,n){var s=require_default(),c=requireParser$1(),f=requireXss();function g(v,y){var T=new f(y);return T.process(v)}n=u.exports=g,n.filterXSS=g,n.FilterXSS=f,function(){for(var v in s)n[v]=s[v];for(var y in c)n[y]=c[y]}(),typeof window<"u"&&(window.filterXSS=u.exports);function A(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}A()&&(self.filterXSS=u.exports)}(lib$1,lib$1.exports)),lib$1.exports}var siemens={exports:{}},hasRequiredSiemens;function requireSiemens(){return hasRequiredSiemens||(hasRequiredSiemens=1,function(u){var n=n||{};n.Utils=n.Utils||(typeof commonjsRequire<"u"?requireUtilities():null),n.Siemens=n.Siemens||function(s){this.output="",this.data=new DataView(s,0)},n.Siemens.CSA2_MAGIC_NUMBER=[83,86,49,48],n.Siemens.NAME_LENGTH=64,n.Siemens.ELEMENT_CSA1=4112,n.Siemens.ELEMENT_CSA2=4128,n.Siemens.GROUP_CSA=41,n.Siemens.prototype.readHeader=function(){var s,c;try{if(this.data.byteLength>n.Siemens.CSA2_MAGIC_NUMBER.length){for(c=!0,s=0;s128)return this.output;for(s+=4,s+=4,f=0;fthis.data.buffer.length?-1:(s+=16,c>0&&(this.output+=this.readString(s,c)+" "),s+c)},n.Siemens.prototype.canRead=function(s,c){return s===n.Siemens.GROUP_CSA&&(c===n.Siemens.ELEMENT_CSA1||c===n.Siemens.ELEMENT_CSA2)},u.exports&&(u.exports=n.Siemens)}(siemens)),siemens.exports}var hasRequiredTag;function requireTag(){return hasRequiredTag||(hasRequiredTag=1,function(u){var n=requireLib(),s=s||{};s.Utils=s.Utils||(typeof commonjsRequire<"u"?requireUtilities():null),s.Dictionary=s.Dictionary||(typeof commonjsRequire<"u"?requireDictionary():null),s.Siemens=s.Siemens||(typeof commonjsRequire<"u"?requireSiemens():null),s.Tag=s.Tag||function(c,f,g,A,v,y,T,I,S){if(this.group=c,this.element=f,this.vr=g,this.offsetStart=v,this.offsetValue=y,this.offsetEnd=T,this.sublist=!1,this.preformatted=!1,this.id=s.Tag.createId(c,f),A instanceof Array)this.value=A,this.sublist=!0;else if(A!==null){var k=new DataView(A);this.value=s.Tag.convertValue(g,k,I,S),this.value===k&&this.isPrivateData()&&(this.value=s.Tag.convertPrivateValue(c,f,k),this.preformatted=this.value!==k)}else this.value=null},s.Tag.PRIVATE_DATA_READERS=[s.Siemens],s.Tag.VR_AE_MAX_LENGTH=16,s.Tag.VR_AS_MAX_LENGTH=4,s.Tag.VR_AT_MAX_LENGTH=4,s.Tag.VR_CS_MAX_LENGTH=16,s.Tag.VR_DA_MAX_LENGTH=8,s.Tag.VR_DS_MAX_LENGTH=16,s.Tag.VR_DT_MAX_LENGTH=26,s.Tag.VR_FL_MAX_LENGTH=4,s.Tag.VR_FD_MAX_LENGTH=8,s.Tag.VR_IS_MAX_LENGTH=12,s.Tag.VR_LO_MAX_LENGTH=64,s.Tag.VR_LT_MAX_LENGTH=10240,s.Tag.VR_OB_MAX_LENGTH=-1,s.Tag.VR_OD_MAX_LENGTH=-1,s.Tag.VR_OF_MAX_LENGTH=-1,s.Tag.VR_OW_MAX_LENGTH=-1,s.Tag.VR_PN_MAX_LENGTH=64*5,s.Tag.VR_SH_MAX_LENGTH=16,s.Tag.VR_SL_MAX_LENGTH=4,s.Tag.VR_SS_MAX_LENGTH=2,s.Tag.VR_ST_MAX_LENGTH=1024,s.Tag.VR_TM_MAX_LENGTH=16,s.Tag.VR_UI_MAX_LENGTH=64,s.Tag.VR_UL_MAX_LENGTH=4,s.Tag.VR_UN_MAX_LENGTH=-1,s.Tag.VR_US_MAX_LENGTH=2,s.Tag.VR_UT_MAX_LENGTH=-1,s.Tag.VR_UC_MAX_LENGTH=-1,s.Tag.TAG_TRANSFER_SYNTAX=[2,16],s.Tag.TAG_META_LENGTH=[2,0],s.Tag.TAG_SUBLIST_ITEM=[65534,57344],s.Tag.TAG_SUBLIST_ITEM_DELIM=[65534,57357],s.Tag.TAG_SUBLIST_SEQ_DELIM=[65534,57565],s.Tag.TAG_ROWS=[40,16],s.Tag.TAG_COLS=[40,17],s.Tag.TAG_ACQUISITION_MATRIX=[24,4880],s.Tag.TAG_NUMBER_OF_FRAMES=[40,8],s.Tag.TAG_NUMBER_TEMPORAL_POSITIONS=[32,261],s.Tag.TAG_PIXEL_SPACING=[40,48],s.Tag.TAG_SLICE_THICKNESS=[24,80],s.Tag.TAG_SLICE_GAP=[24,136],s.Tag.TAG_TR=[24,128],s.Tag.TAG_FRAME_TIME=[24,4195],s.Tag.TAG_BITS_ALLOCATED=[40,256],s.Tag.TAG_BITS_STORED=[40,257],s.Tag.TAG_PIXEL_REPRESENTATION=[40,259],s.Tag.TAG_HIGH_BIT=[40,258],s.Tag.TAG_PHOTOMETRIC_INTERPRETATION=[40,4],s.Tag.TAG_SAMPLES_PER_PIXEL=[40,2],s.Tag.TAG_PLANAR_CONFIG=[40,6],s.Tag.TAG_PALETTE_RED=[40,4609],s.Tag.TAG_PALETTE_GREEN=[40,4610],s.Tag.TAG_PALETTE_BLUE=[40,4611],s.Tag.TAG_DATA_SCALE_SLOPE=[40,4179],s.Tag.TAG_DATA_SCALE_INTERCEPT=[40,4178],s.Tag.TAG_DATA_SCALE_ELSCINT=[519,4127],s.Tag.TAG_PIXEL_BANDWIDTH=[24,149],s.Tag.TAG_IMAGE_MIN=[40,262],s.Tag.TAG_IMAGE_MAX=[40,263],s.Tag.TAG_WINDOW_CENTER=[40,4176],s.Tag.TAG_WINDOW_WIDTH=[40,4177],s.Tag.TAG_SPECIFIC_CHAR_SET=[8,5],s.Tag.TAG_PATIENT_NAME=[16,16],s.Tag.TAG_PATIENT_ID=[16,32],s.Tag.TAG_STUDY_DATE=[8,32],s.Tag.TAG_STUDY_TIME=[8,48],s.Tag.TAG_STUDY_DES=[8,4144],s.Tag.TAG_IMAGE_TYPE=[8,8],s.Tag.TAG_IMAGE_COMMENTS=[32,16384],s.Tag.TAG_SEQUENCE_NAME=[24,36],s.Tag.TAG_MODALITY=[8,96],s.Tag.TAG_FRAME_OF_REF_UID=[32,82],s.Tag.TAG_STUDY_UID=[32,13],s.Tag.TAG_SERIES_DESCRIPTION=[8,4158],s.Tag.TAG_SERIES_INSTANCE_UID=[32,14],s.Tag.TAG_SERIES_NUMBER=[32,17],s.Tag.TAG_ECHO_NUMBER=[24,134],s.Tag.TAG_TEMPORAL_POSITION=[32,256],s.Tag.TAG_IMAGE_NUM=[32,19],s.Tag.TAG_SLICE_LOCATION=[32,4161],s.Tag.TAG_IMAGE_ORIENTATION=[32,55],s.Tag.TAG_IMAGE_POSITION=[32,50],s.Tag.TAG_SLICE_LOCATION_VECTOR=[24,8197],s.Tag.TAG_LUT_SHAPE=[8272,32],s.Tag.TAG_PIXEL_DATA=[32736,16],s.Tag.createId=function(c,f){var g=s.Utils.dec2hex(c),A=s.Utils.dec2hex(f);return g+A},s.Tag.getUnsignedInteger16=function(c,f){var g,A,v;for(A=c.byteLength/2,g=[],v=0;v=4?(v=parseInt(f[A].substring(0,4),10),f[A].length>=6&&(y=s.Utils.safeParseInt(f[A].substring(4,6))-1),f[A].length>=8&&(T=s.Utils.safeParseInt(f[A].substring(6,8))),f[A].length>=10&&(I=s.Utils.safeParseInt(f[A].substring(8,10))),f[A].length>=12&&(S=s.Utils.safeParseInt(f[A].substring(10,12))),f[A].length>=14&&(k=s.Utils.safeParseInt(f[A].substring(12,14))),g[A]=new Date(v,y,T,I,S,k)):g[A]=Date.parse(f[A]),s.Utils.isValidDate(g[A])||(g[A]=f[A]);return g},s.Tag.getTimeStringValue=function(c,f){var g=s.Tag.getStringValue(c),A=[];if(f){var v=null,y,T=0,I=0,S=0;for(y=0;y1&&(I=s.Utils.safeParseInt(v[1])),v.length>2&&(S=s.Utils.safeParseFloat(v[2]))):(g[y].length>=2&&(T=s.Utils.safeParseInt(g[y].substring(0,2))),g[y].length>=4&&(I=s.Utils.safeParseInt(g[y].substring(2,4))),g[y].length>=6&&(S=s.Utils.safeParseFloat(g[y].substring(4)))),A[y]=Math.round(T*60*60*1e3+I*60*1e3+S*1e3);return A}return g},s.Tag.getDoubleStringValue=function(c){var f=s.Tag.getStringValue(c),g=[],A;for(A=0;A"+this.value+"]":g="["+this.value+"]":g="";return this.isSublistItem()?T="Sequence Item":this.isSublistItemDelim()?T="Sequence Item Delimiter":this.isSequenceDelim()?T="Sequence Delimiter":this.isPixelData()?T="Pixel Data":I=s.Utils.convertCamcelCaseToTitleCase(s.Dictionary.getDescription(this.group,this.element)),g=n(g),f?S+""+T+"   "+I+"   "+g:S+" "+T+" "+I+" "+g},s.Tag.prototype.toHTMLString=function(c){return this.toString(c,!0)},s.Tag.prototype.isTransformSyntax=function(){return this.group===s.Tag.TAG_TRANSFER_SYNTAX[0]&&this.element===s.Tag.TAG_TRANSFER_SYNTAX[1]},s.Tag.prototype.isCharset=function(){return this.group===s.Tag.TAG_SPECIFIC_CHAR_SET[0]&&this.element===s.Tag.TAG_SPECIFIC_CHAR_SET[1]},s.Tag.prototype.isPixelData=function(){return this.group===s.Tag.TAG_PIXEL_DATA[0]&&this.element===s.Tag.TAG_PIXEL_DATA[1]},s.Tag.prototype.isPrivateData=function(){return(this.group&1)===1},s.Tag.prototype.hasInterpretedPrivateData=function(){return this.isPrivateData()&&s.Utils.isString(this.value)},s.Tag.prototype.isSublistItem=function(){return this.group===s.Tag.TAG_SUBLIST_ITEM[0]&&this.element===s.Tag.TAG_SUBLIST_ITEM[1]},s.Tag.prototype.isSublistItemDelim=function(){return this.group===s.Tag.TAG_SUBLIST_ITEM_DELIM[0]&&this.element===s.Tag.TAG_SUBLIST_ITEM_DELIM[1]},s.Tag.prototype.isSequenceDelim=function(){return this.group===s.Tag.TAG_SUBLIST_SEQ_DELIM[0]&&this.element===s.Tag.TAG_SUBLIST_SEQ_DELIM[1]},s.Tag.prototype.isMetaLength=function(){return this.group===s.Tag.TAG_META_LENGTH[0]&&this.element===s.Tag.TAG_META_LENGTH[1]},u.exports&&(u.exports=s.Tag)}(tag)),tag.exports}var rle={exports:{}},hasRequiredRle;function requireRle(){return hasRequiredRle||(hasRequiredRle=1,function(u){var n=n||{};n.RLE=n.RLE||function(){this.rawData=null,this.bytesRead=0,this.bytesPut=0,this.segElemPut=0,this.numSegments=0,this.segmentOffsets=[],this.littleEndian=!0,this.segmentIndex=0,this.numElements=0,this.size=0,this.output=null},n.RLE.HEADER_SIZE=64,n.RLE.prototype.decode=function(s,c,f){var g;for(this.rawData=new DataView(s),this.littleEndian=c,this.numElements=f,this.readHeader(),this.output=new DataView(new ArrayBuffer(this.size)),g=0;g=0&&s<128?this.readLiteral(s):s<=-1&&s>-128?this.readEncoded(s):s===-128&&console.warn("RLE: unsupported code!");this.segmentIndex+=1},n.RLE.prototype.readLiteral=function(s){var c,f=s+1;if(this.hasValidInput())for(c=0;c1)for(var g=Array.prototype.slice.call(arguments,1);f--;)c[s-1-f]=n.lossless.Utils.createArray.apply(this,g);return c},n.lossless.Utils.makeCRCTable=function(){for(var s,c=[],f=0;f<256;f++){s=f;for(var g=0;g<8;g++)s=s&1?3988292384^s>>>1:s>>>1;c[f]=s}return c},n.lossless.Utils.crc32=function(s){for(var c=new Uint8Array(s.buffer),f=n.lossless.Utils.crcTable||(n.lossless.Utils.crcTable=n.lossless.Utils.makeCRCTable()),g=-1,A=0;A>>8^f[(g^c[A])&255];return(g^-1)>>>0},u.exports&&(u.exports=n.lossless.Utils)}(utils)),utils.exports}var hasRequiredHuffmanTable;function requireHuffmanTable(){return hasRequiredHuffmanTable||(hasRequiredHuffmanTable=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.Utils=n.lossless.Utils||(typeof commonjsRequire<"u"?requireUtils():null),n.lossless.HuffmanTable=n.lossless.HuffmanTable||function(){this.l=n.lossless.Utils.createArray(4,2,16),this.th=[],this.v=n.lossless.Utils.createArray(4,2,16,200),this.tc=n.lossless.Utils.createArray(4,2),this.tc[0][0]=0,this.tc[1][0]=0,this.tc[2][0]=0,this.tc[3][0]=0,this.tc[0][1]=0,this.tc[1][1]=0,this.tc[2][1]=0,this.tc[3][1]=0,this.th[0]=0,this.th[1]=0,this.th[2]=0,this.th[3]=0},n.lossless.HuffmanTable.MSB=2147483648,n.lossless.HuffmanTable.prototype.read=function(s,c){var f=0,g,A,v,y,T,I;for(g=s.get16(),f+=2;f3)throw new Error("ERROR: Huffman table ID > 3");if(y=A>>4,y>2)throw new Error("ERROR: Huffman table [Table class > 2 ]");for(this.th[v]=1,this.tc[v][y]=1,T=0;T<16;T+=1)this.l[v][y][T]=s.get8(),f+=1;for(T=0;T<16;T+=1)for(I=0;Ig)throw new Error("ERROR: Huffman table format error [count>Lh]");this.v[v][y][T][I]=s.get8(),f+=1}}if(f!==g)throw new Error("ERROR: Huffman table format error [count!=Lf]");for(T=0;T<4;T+=1)for(I=0;I<2;I+=1)this.tc[T][I]!==0&&this.buildHuffTable(c[T][I],this.l[T][I],this.v[T][I]);return 1},n.lossless.HuffmanTable.prototype.buildHuffTable=function(s,c,f){var g,A,v,y,T,I;for(A=256,v=0,y=0;y<8;y+=1)for(T=0;T>y+1;I+=1)s[v]=f[y][T]|y+1<<8,v+=1;for(y=1;v<256;y+=1,v+=1)s[v]=y|n.lossless.HuffmanTable.MSB;for(g=1,v=0,y=8;y<16;y+=1)for(T=0;T>y-7;I+=1)s[g*256+v]=f[y][T]|y+1<<8,v+=1;if(v>=256){if(v>256)throw new Error("ERROR: Huffman table error(1)!");v=0,g+=1}}},u.exports&&(u.exports=n.lossless.HuffmanTable)}(huffmanTable)),huffmanTable.exports}var quantizationTable={exports:{}},hasRequiredQuantizationTable;function requireQuantizationTable(){return hasRequiredQuantizationTable||(hasRequiredQuantizationTable=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.Utils=n.lossless.Utils||(typeof commonjsRequire<"u"?requireUtils():null),n.lossless.QuantizationTable=n.lossless.QuantizationTable||function(){this.precision=[],this.tq=[],this.quantTables=n.lossless.Utils.createArray(4,64),this.tq[0]=0,this.tq[1]=0,this.tq[2]=0,this.tq[3]=0},n.lossless.QuantizationTable.enhanceQuantizationTable=function(s,c){var f;for(f=0;f<8;f+=1)s[c[0*8+f]]*=90,s[c[4*8+f]]*=90,s[c[2*8+f]]*=118,s[c[6*8+f]]*=49,s[c[5*8+f]]*=71,s[c[1*8+f]]*=126,s[c[7*8+f]]*=25,s[c[3*8+f]]*=106;for(f=0;f<8;f+=1)s[c[0+8*f]]*=90,s[c[4+8*f]]*=90,s[c[2+8*f]]*=118,s[c[6+8*f]]*=49,s[c[5+8*f]]*=71,s[c[1+8*f]]*=126,s[c[7+8*f]]*=25,s[c[3+8*f]]*=106;for(f=0;f<64;f+=1)s[f]>>=6},n.lossless.QuantizationTable.prototype.read=function(s,c){var f=0,g,A,v,y;for(g=s.get16(),f+=2;f3)throw new Error("ERROR: Quantization table ID > 3");if(this.precision[v]=A>>4,this.precision[v]===0)this.precision[v]=8;else if(this.precision[v]===1)this.precision[v]=16;else throw new Error("ERROR: Quantization table precision error");if(this.tq[v]=1,this.precision[v]===8){for(y=0;y<64;y+=1){if(f>g)throw new Error("ERROR: Quantization table format error");this.quantTables[v][y]=s.get8(),f+=1}n.lossless.QuantizationTable.enhanceQuantizationTable(this.quantTables[v],c)}else{for(y=0;y<64;y+=1){if(f>g)throw new Error("ERROR: Quantization table format error");this.quantTables[v][y]=s.get16(),f+=2}n.lossless.QuantizationTable.enhanceQuantizationTable(this.quantTables[v],c)}}if(f!==g)throw new Error("ERROR: Quantization table error [count!=Lq]");return 1},u.exports&&(u.exports=n.lossless.QuantizationTable)}(quantizationTable)),quantizationTable.exports}var scanHeader={exports:{}},scanComponent={exports:{}},hasRequiredScanComponent;function requireScanComponent(){return hasRequiredScanComponent||(hasRequiredScanComponent=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.ScanComponent=n.lossless.ScanComponent||function(){this.acTabSel=0,this.dcTabSel=0,this.scanCompSel=0},u.exports&&(u.exports=n.lossless.ScanComponent)}(scanComponent)),scanComponent.exports}var hasRequiredScanHeader;function requireScanHeader(){return hasRequiredScanHeader||(hasRequiredScanHeader=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.ScanComponent=n.lossless.ScanComponent||(typeof commonjsRequire<"u"?requireScanComponent():null),n.lossless.ScanHeader=n.lossless.ScanHeader||function(){this.ah=0,this.al=0,this.numComp=0,this.selection=0,this.spectralEnd=0,this.components=[]},n.lossless.ScanHeader.prototype.read=function(s){var c=0,f,g,A;for(f=s.get16(),c+=2,this.numComp=s.get8(),c+=1,g=0;gf)throw new Error("ERROR: scan header format error");this.components[g].scanCompSel=s.get8(),c+=1,A=s.get8(),c+=1,this.components[g].dcTabSel=A>>4,this.components[g].acTabSel=A&15}if(this.selection=s.get8(),c+=1,this.spectralEnd=s.get8(),c+=1,A=s.get8(),this.ah=A>>4,this.al=A&15,c+=1,c!==f)throw new Error("ERROR: scan header format error [count!=Ns]");return 1},u.exports&&(u.exports=n.lossless.ScanHeader)}(scanHeader)),scanHeader.exports}var frameHeader={exports:{}},hasRequiredFrameHeader;function requireFrameHeader(){return hasRequiredFrameHeader||(hasRequiredFrameHeader=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.ComponentSpec=n.lossless.ComponentSpec||(typeof commonjsRequire<"u"?requireComponentSpec():null),n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.FrameHeader=n.lossless.FrameHeader||function(){this.components=[],this.dimX=0,this.dimY=0,this.numComp=0,this.precision=0},n.lossless.FrameHeader.prototype.read=function(s){var c=0,f,g,A,v;for(f=s.get16(),c+=2,this.precision=s.get8(),c+=1,this.dimY=s.get16(),c+=2,this.dimX=s.get16(),c+=2,this.numComp=s.get8(),c+=1,g=1;g<=this.numComp;g+=1){if(c>f)throw new Error("ERROR: frame format error");if(A=s.get8(),c+=1,c>=f)throw new Error("ERROR: frame format error [c>=Lf]");v=s.get8(),c+=1,this.components[A]||(this.components[A]=new n.lossless.ComponentSpec),this.components[A].hSamp=v>>4,this.components[A].vSamp=v&15,this.components[A].quantTableSel=s.get8(),c+=1}if(c!==f)throw new Error("ERROR: frame format error [Lf!=count]");return 1},u.exports&&(u.exports=n.lossless.FrameHeader)}(frameHeader)),frameHeader.exports}var hasRequiredDecoder;function requireDecoder(){return hasRequiredDecoder||(hasRequiredDecoder=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.HuffmanTable=n.lossless.HuffmanTable||(typeof commonjsRequire<"u"?requireHuffmanTable():null),n.lossless.QuantizationTable=n.lossless.QuantizationTable||(typeof commonjsRequire<"u"?requireQuantizationTable():null),n.lossless.ScanHeader=n.lossless.ScanHeader||(typeof commonjsRequire<"u"?requireScanHeader():null),n.lossless.FrameHeader=n.lossless.FrameHeader||(typeof commonjsRequire<"u"?requireFrameHeader():null),n.lossless.Utils=n.lossless.Utils||(typeof commonjsRequire<"u"?requireUtils():null),n.lossless.Decoder=n.lossless.Decoder||function(c,f){this.buffer=c,this.frame=new n.lossless.FrameHeader,this.huffTable=new n.lossless.HuffmanTable,this.quantTable=new n.lossless.QuantizationTable,this.scan=new n.lossless.ScanHeader,this.DU=n.lossless.Utils.createArray(10,4,64),this.HuffTab=n.lossless.Utils.createArray(4,2,50*256),this.IDCT_Source=[],this.nBlock=[],this.acTab=n.lossless.Utils.createArray(10,1),this.dcTab=n.lossless.Utils.createArray(10,1),this.qTab=n.lossless.Utils.createArray(10,1),this.marker=0,this.markerIndex=0,this.numComp=0,this.restartInterval=0,this.selection=0,this.xDim=0,this.yDim=0,this.xLoc=0,this.yLoc=0,this.numBytes=0,this.outputData=null,this.restarting=!1,this.mask=0,typeof f<"u"&&(this.numBytes=f)},n.lossless.Decoder.IDCT_P=[0,5,40,16,45,2,7,42,21,56,8,61,18,47,1,4,41,23,58,13,32,24,37,10,63,17,44,3,6,43,20,57,15,34,29,48,53,26,39,9,60,19,46,22,59,12,33,31,50,55,25,36,11,62,14,35,28,49,52,27,38,30,51,54],n.lossless.Decoder.TABLE=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],n.lossless.Decoder.MAX_HUFFMAN_SUBTREE=50,n.lossless.Decoder.MSB=2147483648,n.lossless.Decoder.RESTART_MARKER_BEGIN=65488,n.lossless.Decoder.RESTART_MARKER_END=65495,n.lossless.Decoder.prototype.decompress=function(c,f,g){return this.decode(c,f,g).buffer},n.lossless.Decoder.prototype.decode=function(c,f,g,A){var v,y=0,T=[],I,S,k=[],e=[],N;if(typeof c<"u"&&(this.buffer=c),typeof A<"u"&&(this.numBytes=A),this.stream=new n.lossless.DataStream(this.buffer,f,g),this.buffer=null,this.xLoc=0,this.yLoc=0,v=this.stream.get16(),v!==65496)throw new Error("Not a JPEG file");for(v=this.stream.get16();v>>4!==4092||v===65476;){switch(v){case 65476:this.huffTable.read(this.stream,this.HuffTab);break;case 65484:throw new Error("Program doesn't support arithmetic coding. (format throw new IOException)");case 65499:this.quantTable.read(this.stream,n.lossless.Decoder.TABLE);break;case 65501:this.restartInterval=this.readNumber();break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:this.readApp();break;case 65534:this.readComment();break;default:if(v>>8!==255)throw new Error("ERROR: format throw new IOException! (decode)")}v=this.stream.get16()}if(v<65472||v>65479)throw new Error("ERROR: could not handle arithmetic code!");this.frame.read(this.stream),v=this.stream.get16();do{for(;v!==65498;){switch(v){case 65476:this.huffTable.read(this.stream,this.HuffTab);break;case 65484:throw new Error("Program doesn't support arithmetic coding. (format throw new IOException)");case 65499:this.quantTable.read(this.stream,n.lossless.Decoder.TABLE);break;case 65501:this.restartInterval=this.readNumber();break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:this.readApp();break;case 65534:this.readComment();break;default:if(v>>8!==255)throw new Error("ERROR: format throw new IOException! (Parser.decode)")}v=this.stream.get16()}switch(this.precision=this.frame.precision,this.components=this.frame.components,this.numBytes||(this.numBytes=parseInt(Math.ceil(this.precision/8))),this.numBytes==1?this.mask=255:this.mask=65535,this.scan.read(this.stream),this.numComp=this.scan.numComp,this.selection=this.scan.selection,this.numBytes===1?this.numComp===3?(this.getter=this.getValueRGB,this.setter=this.setValueRGB,this.output=this.outputRGB):(this.getter=this.getValue8,this.setter=this.setValue8,this.output=this.outputSingle):(this.getter=this.getValue16,this.setter=this.setValue16,this.output=this.outputSingle),this.selection){case 2:this.selector=this.select2;break;case 3:this.selector=this.select3;break;case 4:this.selector=this.select4;break;case 5:this.selector=this.select5;break;case 6:this.selector=this.select6;break;case 7:this.selector=this.select7;break;default:this.selector=this.select1;break}for(this.scanComps=this.scan.components,this.quantTables=this.quantTable.quantTables,I=0;I=n.lossless.Decoder.RESTART_MARKER_BEGIN&&v<=n.lossless.Decoder.RESTART_MARKER_END))break}v===65500&&y===1&&(this.readNumber(),v=this.stream.get16())}while(v!==65497&&this.xLoc>1)},n.lossless.Decoder.prototype.select6=function(c){return this.getPreviousY(c)+(this.getPreviousX(c)-this.getPreviousXY(c)>>1)},n.lossless.Decoder.prototype.select7=function(c){return(this.getPreviousX(c)+this.getPreviousY(c))/2},n.lossless.Decoder.prototype.decodeRGB=function(c,f,g){var A,v,y,T,I,S,k,e;for(c[0]=this.selector(0),c[1]=this.selector(1),c[2]=this.selector(2),I=0;I=65280)return A;for(c[I]=this.IDCT_Source[0]=c[I]+this.getn(g,A,f,g),this.IDCT_Source[0]*=T[0],e=1;e<64;e+=1){if(A=this.getHuffmanValue(v,f,g),A>=65280)return A;if(e+=A>>4,A&15)this.IDCT_Source[n.lossless.Decoder.IDCT_P[e]]=this.getn(g,A&15,f,g)*T[e];else if(!(A>>4))break}}return 0},n.lossless.Decoder.prototype.decodeSingle=function(c,f,g){var A,v,y,T;for(this.restarting?(this.restarting=!1,c[0]=1<=65280)return A;if(y=this.getn(c,A,f,g),T=y>>8,T>=n.lossless.Decoder.RESTART_MARKER_BEGIN&&T<=n.lossless.Decoder.RESTART_MARKER_END)return T;c[0]+=y}return 0},n.lossless.Decoder.prototype.getHuffmanValue=function(c,f,g){var A,v,y;if(y=65535,g[0]<8?(f[0]<<=8,v=this.stream.get8(),v===255&&(this.marker=this.stream.get8(),this.marker!==0&&(this.markerIndex=9)),f[0]|=v):g[0]-=8,A=c[f[0]>>g[0]],A&n.lossless.Decoder.MSB){if(this.markerIndex!==0)return this.markerIndex=0,65280|this.marker;f[0]&=y>>16-g[0],f[0]<<=8,v=this.stream.get8(),v===255&&(this.marker=this.stream.get8(),this.marker!==0&&(this.markerIndex=9)),f[0]|=v,A=c[(A&255)*256+(f[0]>>g[0])],g[0]+=8}if(g[0]+=8-(A>>8),g[0]<0)throw new Error("index="+g[0]+" temp="+f[0]+" code="+A+" in HuffmanValue()");return g[0]>16-g[0],A&255)},n.lossless.Decoder.prototype.getn=function(c,f,g,A){var v,y,T,I,S;if(y=1,T=-1,I=65535,f===0)return 0;if(f===16)return c[0]>=0?-32768:32768;if(A[0]-=f,A[0]>=0){if(A[0]>A[0],g[0]&=I>>16-A[0]}else{if(g[0]<<=8,S=this.stream.get8(),S===255&&(this.marker=this.stream.get8(),this.marker!==0&&(this.markerIndex=9)),g[0]|=S,A[0]+=8,A[0]<0){if(this.markerIndex!==0)return this.markerIndex=0,(65280|this.marker)<<8;g[0]<<=8,S=this.stream.get8(),S===255&&(this.marker=this.stream.get8(),this.marker!==0&&(this.markerIndex=9)),g[0]|=S,A[0]+=8}if(A[0]<0)throw new Error("index="+A[0]+" in getn()");if(A[0]>A[0],g[0]&=I>>16-A[0]}return v0?this.getter(this.yLoc*this.xDim+this.xLoc-1,c):this.yLoc>0?this.getPreviousY(c):1<0&&this.yLoc>0?this.getter((this.yLoc-1)*this.xDim+this.xLoc-1,c):this.getPreviousY(c)},n.lossless.Decoder.prototype.getPreviousY=function(c){return this.yLoc>0?this.getter((this.yLoc-1)*this.xDim+this.xLoc,c):this.getPreviousX(c)},n.lossless.Decoder.prototype.isLastPixel=function(){return this.xLoc===this.xDim-1&&this.yLoc===this.yDim-1},n.lossless.Decoder.prototype.outputSingle=function(c){this.xLoc=this.xDim&&(this.yLoc+=1,this.xLoc=0))},n.lossless.Decoder.prototype.outputRGB=function(c){var f=this.yLoc*this.xDim+this.xLoc;this.xLoc=this.xDim&&(this.yLoc+=1,this.xLoc=0))},n.lossless.Decoder.prototype.setValue8=function(c,f){this.outputData[c]=f},n.lossless.Decoder.prototype.getValue8=function(c){return this.outputData[c]};var s=function(){var c=new ArrayBuffer(2);return new DataView(c).setInt16(0,256,!0),new Int16Array(c)[0]===256}();s?(n.lossless.Decoder.prototype.setValue16=n.lossless.Decoder.prototype.setValue8,n.lossless.Decoder.prototype.getValue16=n.lossless.Decoder.prototype.getValue8):(n.lossless.Decoder.prototype.setValue16=function(c,f){this.outputData[c]=(f&255)<<8|f>>8&255},n.lossless.Decoder.prototype.getValue16=function(c){var f=this.outputData[c];return(f&255)<<8|f>>8&255}),n.lossless.Decoder.prototype.setValueRGB=function(c,f,g){this.outputData[c*3+g]=f},n.lossless.Decoder.prototype.getValueRGB=function(c,f){return this.outputData[c*3+f]},n.lossless.Decoder.prototype.readApp=function(){var c=0,f=this.stream.get16();for(c+=2;c0&&!b[m-1];)m--;Y.push({children:[],index:0});var Z=Y[0],ee;for(X=0;X0;)Z=Y.pop();for(Z.index++,Y.push(Z);Y.length<=X;)Y.push(ee={children:[],index:0}),Z.children[Z.index]=ee.children,Z=ee;q++}X+10)return Se--,pe>>Se&1;if(pe=b[W++],pe==255){var We=b[W++];if(We)throw"unexpected marker: "+(pe<<8|We).toString(16)}return Se=7,pe>>>7}function we(We){for(var qe=We,xt;(xt=xe())!==null;){if(qe=qe[xt],typeof qe=="number")return qe;if(typeof qe!="object")throw"invalid huffman sequence"}return null}function Fe(We){for(var qe=0;We>0;){var xt=xe();if(xt===null)return;qe=qe<<1|xt,We--}return qe}function De(We){var qe=Fe(We);return qe>=1<>4;if(Be===0){if(st<15)break;rt+=16;continue}rt+=st;var Ye=f[rt];We.blockData[qe+Ye]=De(Be),rt++}}function nt(We,qe){var xt=we(We.huffmanTableDC),He=xt===0?0:De(xt)<0){ye--;return}for(var xt=Q,He=m;xt<=He;){var rt=we(We.huffmanTableAC),ie=rt&15,Be=rt>>4;if(ie===0){if(Be<15){ye=Fe(Be)+(1<>4,st===0)rt<15?(ye=Fe(rt)+(1<=65488&&Le<=65495)W+=2;else break}return W-me}function z(b,W,q){var Y=b.quantizationTable,X,Q,m,Z,ee,oe,fe,me,pe,Se;for(Se=0;Se<64;Se++)q[Se]=b.blockData[W+Se]*Y[Se];for(Se=0;Se<8;++Se){var xe=8*Se;if(q[1+xe]===0&&q[2+xe]===0&&q[3+xe]===0&&q[4+xe]===0&&q[5+xe]===0&&q[6+xe]===0&&q[7+xe]===0){pe=S*q[0+xe]+512>>10,q[0+xe]=pe,q[1+xe]=pe,q[2+xe]=pe,q[3+xe]=pe,q[4+xe]=pe,q[5+xe]=pe,q[6+xe]=pe,q[7+xe]=pe;continue}X=S*q[0+xe]+128>>8,Q=S*q[4+xe]+128>>8,m=q[2+xe],Z=q[6+xe],ee=k*(q[1+xe]-q[7+xe])+128>>8,me=k*(q[1+xe]+q[7+xe])+128>>8,oe=q[3+xe]<<4,fe=q[5+xe]<<4,pe=X-Q+1>>1,X=X+Q+1>>1,Q=pe,pe=m*I+Z*T+128>>8,m=m*T-Z*I+128>>8,Z=pe,pe=ee-fe+1>>1,ee=ee+fe+1>>1,fe=pe,pe=me+oe+1>>1,oe=me-oe+1>>1,me=pe,pe=X-Z+1>>1,X=X+Z+1>>1,Z=pe,pe=Q-m+1>>1,Q=Q+m+1>>1,m=pe,pe=ee*y+me*v+2048>>12,ee=ee*v-me*y+2048>>12,me=pe,pe=oe*A+fe*g+2048>>12,oe=oe*g-fe*A+2048>>12,fe=pe,q[0+xe]=X+me,q[7+xe]=X-me,q[1+xe]=Q+fe,q[6+xe]=Q-fe,q[2+xe]=m+oe,q[5+xe]=m-oe,q[3+xe]=Z+ee,q[4+xe]=Z-ee}for(Se=0;Se<8;++Se){var we=Se;if(q[1*8+we]===0&&q[2*8+we]===0&&q[3*8+we]===0&&q[4*8+we]===0&&q[5*8+we]===0&&q[6*8+we]===0&&q[7*8+we]===0){pe=S*q[Se+0]+8192>>14,q[0*8+we]=pe,q[1*8+we]=pe,q[2*8+we]=pe,q[3*8+we]=pe,q[4*8+we]=pe,q[5*8+we]=pe,q[6*8+we]=pe,q[7*8+we]=pe;continue}X=S*q[0*8+we]+2048>>12,Q=S*q[4*8+we]+2048>>12,m=q[2*8+we],Z=q[6*8+we],ee=k*(q[1*8+we]-q[7*8+we])+2048>>12,me=k*(q[1*8+we]+q[7*8+we])+2048>>12,oe=q[3*8+we],fe=q[5*8+we],pe=X-Q+1>>1,X=X+Q+1>>1,Q=pe,pe=m*I+Z*T+2048>>12,m=m*T-Z*I+2048>>12,Z=pe,pe=ee-fe+1>>1,ee=ee+fe+1>>1,fe=pe,pe=me+oe+1>>1,oe=me-oe+1>>1,me=pe,pe=X-Z+1>>1,X=X+Z+1>>1,Z=pe,pe=Q-m+1>>1,Q=Q+m+1>>1,m=pe,pe=ee*y+me*v+2048>>12,ee=ee*v-me*y+2048>>12,me=pe,pe=oe*A+fe*g+2048>>12,oe=oe*g-fe*A+2048>>12,fe=pe,q[0*8+we]=X+me,q[7*8+we]=X-me,q[1*8+we]=Q+fe,q[6*8+we]=Q-fe,q[2*8+we]=m+oe,q[5*8+we]=m-oe,q[3*8+we]=Z+ee,q[4*8+we]=Z-ee}for(Se=0;Se<64;++Se){var Fe=W+Se,De=q[Se];De=De<=-2056/b.bitConversion?0:De>=2024/b.bitConversion?255/b.bitConversion:De+2056/b.bitConversion>>4,b.blockData[Fe]=De}}function B(b,W){for(var q=W.blocksPerLine,Y=W.blocksPerColumn,X=new Int32Array(64),Q=0;Q=255?255:b|0}return e.prototype={load:function(W){var q=(function(ee){this.parse(ee),this.onload&&this.onload()}).bind(this);if(W.indexOf("data:")>-1){for(var Y=W.indexOf("base64,")+7,X=atob(W.substring(Y)),Q=new Uint8Array(X.length),m=X.length-1;m>=0;m--)Q[m]=X.charCodeAt(m);q(X)}else{var Z=new XMLHttpRequest;Z.open("GET",W,!0),Z.responseType="arraybuffer",Z.onload=(function(){var ee=new Uint8Array(Z.response);q(ee)}).bind(this),Z.send(null)}},parse:function(W){function q(){var ie=W[Q]<<8|W[Q+1];return Q+=2,ie}function Y(){var ie=q(),Be=W.subarray(Q,Q+ie-2);return Q+=Be.length,Be}function X(ie){for(var Be=Math.ceil(ie.samplesPerLine/8/ie.maxH),st=Math.ceil(ie.scanLines/8/ie.maxV),Ye=0;Ye>4)if(Ue>>4===1)for(we=0;we<64;we++){var ft=f[we];ye[ft]=q()}else throw"DQT: invalid table spec";else for(we=0;we<64;we++){var at=f[we];ye[at]=W[Q++]}fe[Ue&15]=ye}break;case 65472:case 65473:case 65474:if(ee)throw"Only single frame JPEGs supported";q(),ee={},ee.extended=Se===65473,ee.progressive=Se===65474,ee.precision=W[Q++],ee.scanLines=q(),ee.samplesPerLine=q(),ee.components=[],ee.componentIds={};var Tt=W[Q++],Lt,Ot=0,Ft=0;for(xe=0;xe>4,Ke=W[Q+1]&15;Ot>4?me:pe)[Ie&15]=N(be,ze)}break;case 65501:q(),oe=q();break;case 65498:q();var Le=W[Q++],Ge=[],_e;for(xe=0;xe>4],_e.huffmanTableAC=me[We&15],Ge.push(_e)}var qe=W[Q++],xt=W[Q++],He=W[Q++],rt=O(W,Q,ee,Ge,oe,qe,xt,He>>4,He&15);Q+=rt;break;default:if(W[Q-3]==255&&W[Q-2]>=192&&W[Q-2]<=254){Q-=3;break}throw"unknown JPEG marker "+Se.toString(16)}Se=q()}switch(this.width=ee.samplesPerLine,this.height=ee.scanLines,this.jfif=m,this.adobe=Z,this.components=[],ee.components.length){case 1:this.colorspace=n.Grayscale;break;case 3:this.adobe?this.colorspace=n.AdobeRGB:this.colorspace=n.RGB;break;case 4:this.colorspace=n.CYMK;break;default:this.colorspace=n.Unknown}for(var xe=0;xe>24&255,Le>>16&255,Le>>8&255,Le&255);A("Unsupported header type "+Le+" ("+qe+")");break}_e&&(Ie+=Ge)}},parseImageProperties:function(Re){for(var Qe=Re.getByte();Qe>=0;){var Ie=Qe;Qe=Re.getByte();var be=Ie<<8|Qe;if(be===65361){Re.skip(4);var lt=Re.getInt32()>>>0,ze=Re.getInt32()>>>0,Le=Re.getInt32()>>>0,Ge=Re.getInt32()>>>0;Re.skip(16);var _e=Re.getUint16();this.width=lt-Le,this.height=ze-Ge,this.componentsCount=_e,this.bitsPerComponent=8;return}}throw new Error("JPX Error: No size marker found in JPX stream")},parseCodestream:function(Re,Qe,Ie){var be={};try{for(var lt=!1,ze=Qe;ze+1>5,We=[];_e>3,vt.mu=0):(vt.epsilon=Re[_e]>>3,vt.mu=(Re[_e]&7)<<8|Re[_e+1],_e+=2),We.push(vt)}ht.SPqcds=We,be.mainHeader?be.QCD=ht:(be.currentTile.QCD=ht,be.currentTile.QCC=[]);break;case 65373:Ge=M(Re,ze);var Me={};_e=ze+2;var je;switch(be.SIZ.Csiz<257?je=Re[_e++]:(je=M(Re,_e),_e+=2),Je=Re[_e++],Je&31){case 0:qe=8,xt=!0;break;case 1:qe=16,xt=!1;break;case 2:qe=16,xt=!0;break;default:throw new Error("JPX Error: Invalid SQcd value "+Je)}for(Me.noQuantization=qe===8,Me.scalarExpounded=xt,Me.guardBits=Je>>5,We=[];_e>3,vt.mu=0):(vt.epsilon=Re[_e]>>3,vt.mu=(Re[_e]&7)<<8|Re[_e+1],_e+=2),We.push(vt);Me.SPqcds=We,be.mainHeader?be.QCC[je]=Me:be.currentTile.QCC[je]=Me;break;case 65362:Ge=M(Re,ze);var ue={};_e=ze+2;var Ae=Re[_e++];ue.entropyCoderWithCustomPrecincts=!!(Ae&1),ue.sopMarkerUsed=!!(Ae&2),ue.ephMarkerUsed=!!(Ae&4),ue.progressionOrder=Re[_e++],ue.layersCount=M(Re,_e),_e+=2,ue.multipleComponentTransform=Re[_e++],ue.decompositionLevelsCount=Re[_e++],ue.xcb=(Re[_e++]&15)+2,ue.ycb=(Re[_e++]&15)+2;var Vt=Re[_e++];if(ue.selectiveArithmeticCodingBypass=!!(Vt&1),ue.resetContextProbabilities=!!(Vt&2),ue.terminationOnEachCodingPass=!!(Vt&4),ue.verticalyStripe=!!(Vt&8),ue.predictableTermination=!!(Vt&16),ue.segmentationSymbolUsed=!!(Vt&32),ue.reversibleTransformation=Re[_e++],ue.entropyCoderWithCustomPrecincts){for(var ge=[];_e>4})}ue.precinctsSizes=ge}var Ve=[];if(ue.selectiveArithmeticCodingBypass&&Ve.push("selectiveArithmeticCodingBypass"),ue.resetContextProbabilities&&Ve.push("resetContextProbabilities"),ue.terminationOnEachCodingPass&&Ve.push("terminationOnEachCodingPass"),ue.verticalyStripe&&Ve.push("verticalyStripe"),ue.predictableTermination&&Ve.push("predictableTermination"),Ve.length>0)throw lt=!0,new Error("JPX Error: Unsupported COD options ("+Ve.join(", ")+")");be.mainHeader?be.COD=ue:(be.currentTile.COD=ue,be.currentTile.COC=[]);break;case 65424:Ge=M(Re,ze),He={},He.index=M(Re,ze+2),He.length=O(Re,ze+4),He.dataEnd=He.length+ze-2,He.partIndex=Re[ze+8],He.partsCount=Re[ze+9],be.mainHeader=!1,He.partIndex===0&&(He.COD=be.COD,He.COC=be.COC.slice(0),He.QCD=be.QCD,He.QCC=be.QCC.slice(0)),be.currentTile=He;break;case 65427:He=be.currentTile,He.partIndex===0&&(at(be,He.index),De(be)),Ge=He.dataEnd-ze,Ze(be,Re,ze,Ge);break;case 65365:case 65367:case 65368:case 65380:Ge=M(Re,ze);break;case 65363:throw new Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("JPX Error: Unknown codestream code: "+Le.toString(16))}ze+=Ge}}catch(Zt){if(lt||this.failOnCorruptedImage)throw Zt;A("Trying to recover from "+Zt.message)}this.tiles=ye(be),this.width=be.SIZ.Xsiz-be.SIZ.XOsiz,this.height=be.SIZ.Ysiz-be.SIZ.YOsiz,this.componentsCount=be.SIZ.Csiz}};function X(Ke,Re){Ke.x0=Math.ceil(Re.XOsiz/Ke.XRsiz),Ke.x1=Math.ceil(Re.Xsiz/Ke.XRsiz),Ke.y0=Math.ceil(Re.YOsiz/Ke.YRsiz),Ke.y1=Math.ceil(Re.Ysiz/Ke.YRsiz),Ke.width=Ke.x1-Ke.x0,Ke.height=Ke.y1-Ke.y0}function Q(Ke,Re){for(var Qe=Ke.SIZ,Ie,be=[],lt=Math.ceil((Qe.Xsiz-Qe.XTOsiz)/Qe.XTsiz),ze=Math.ceil((Qe.Ysiz-Qe.YTOsiz)/Qe.YTsiz),Le=0;Le0?Math.min(Ie.xcb,be.PPx-1):Math.min(Ie.xcb,be.PPx),be.ycb_=Qe>0?Math.min(Ie.ycb,be.PPy-1):Math.min(Ie.ycb,be.PPy),be}function Z(Ke,Re,Qe){var Ie=1<Re.trx0?Math.ceil(Re.trx1/Ie)-Math.floor(Re.trx0/Ie):0,_e=Re.try1>Re.try0?Math.ceil(Re.try1/be)-Math.floor(Re.try0/be):0,Je=Ge*_e;Re.precinctParameters={precinctWidth:Ie,precinctHeight:be,numprecinctswide:Ge,numprecinctshigh:_e,numprecincts:Je,precinctWidthInSubband:ze,precinctHeightInSubband:Le}}function ee(Ke,Re,Qe){var Ie=Qe.xcb_,be=Qe.ycb_,lt=1<>Ie,Ge=Re.tby0>>be,_e=Re.tbx1+lt-1>>Ie,Je=Re.tby1+ze-1>>be,We=Re.resolution.precinctParameters,qe=[],xt=[],He,rt,ie,Be;for(rt=Ge;rtht.cbxMax&&(ht.cbxMax=He),rtht.cbyMax&&(ht.cbyMax=rt)):xt[Be]=ht={cbxMin:He,cbyMin:rt,cbxMax:He,cbyMax:rt},ie.precinct=ht}}Re.codeblockParameters={codeblockWidth:Ie,codeblockHeight:be,numcodeblockwide:_e-Le+1,numcodeblockhigh:Je-Ge+1},Re.codeblocks=qe,Re.precincts=xt}function oe(Ke,Re,Qe){for(var Ie=[],be=Ke.subbands,lt=0,ze=be.length;ltxt.codingStyleParameters.decompositionLevelsCount)){for(var He=xt.resolutions[_e],rt=He.precinctParameters.numprecincts;Wext.codingStyleParameters.decompositionLevelsCount)){for(var He=xt.resolutions[Ge],rt=He.precinctParameters.numprecincts;Weie.codingStyleParameters.decompositionLevelsCount)){var Be=ie.resolutions[Le],st=Be.precinctParameters.numprecincts;if(!(_e>=st)){for(;ze=0;--ie){var Be=Ge.resolutions[ie],st=rt*Be.precinctParameters.precinctWidth,Ye=rt*Be.precinctParameters.precinctHeight;We=Math.min(We,st),qe=Math.min(qe,Ye),xt=Math.max(xt,Be.precinctParameters.numprecinctswide),He=Math.max(He,Be.precinctParameters.numprecinctshigh),Je[ie]={width:st,height:Ye},rt<<=1}Qe=Math.min(Qe,We),Ie=Math.min(Ie,qe),be=Math.max(be,xt),lt=Math.max(lt,He),ze[Le]={resolutions:Je,minWidth:We,minHeight:qe,maxNumWide:xt,maxNumHigh:He}}return{components:ze,minWidth:Qe,minHeight:Ie,maxNumWide:be,maxNumHigh:lt}}function De(Ke){for(var Re=Ke.SIZ,Qe=Ke.currentTile.index,Ie=Ke.tiles[Qe],be=Re.Csiz,lt=0;lt=Re.length)throw new Error("Unexpected EOF");var bt=Re[Qe+be];be++,Le?(lt=lt<<7|bt,ze+=7,Le=!1):(lt=lt<<8|bt,ze+=8),bt===255&&(Le=!0)}return ze-=ve,lt>>>ze&(1<=Re.length)return;if(Zt.isAboveThreshold())break;if(Zt.isKnown()){Zt.nextLevel();continue}if(Ge(1))if(Zt.setKnown(),Zt.isLeaf()){vt.included=!0,ge=Ut=!0;break}else Zt.nextLevel();else Zt.incrementValue()}}if(ge){if(Ut){for(ot=ue.zeroBitPlanesTree,ot.reset(Ae,Vt);;){if(be>=Re.length)return;if(Ge(1)){if(Ve=!ot.nextLevel(),Ve)break}else ot.incrementValue()}vt.zeroBitPlanes=ot.value}for(var Ne=qe();Ge(1);)vt.Lblock++;var se=N(Ne),ut=(Ne<1<0;){var Pe=ht.shift();vt=Pe.codeblock,vt.data===void 0&&(vt.data=[]),vt.data.push({data:Re,start:Qe+be,end:Qe+be+Pe.dataLength,codingpasses:Pe.codingpasses}),be+=Pe.dataLength}}catch{return}return be}function nt(Ke,Re,Qe,Ie,be,lt,ze,Le){for(var Ge=Ie.tbx0,_e=Ie.tby0,Je=Ie.tbx1-Ie.tbx0,We=Ie.codeblocks,qe=Ie.type.charAt(0)==="H"?1:0,xt=Ie.type.charAt(1)==="H"?Re:0,He=0,rt=We.length;He=lt?Ke[Wt]=Ce:Ke[Wt]=Ce*(1<0?1-ie:0));var Ae=Be.subbands[vt],Vt=q[Ae.type],ge=qe?1:Math.pow(2,We+Vt-ue)*(1+je/2048),Ut=_e+ue-1;nt(ht,st,Ye,Ae,ge,Ut,qe,Je)}He.push({width:st,height:Ye,items:ht})}var Ve=xt.calculate(He,Ie.tcx0,Ie.tcy0);return{left:Ie.tcx0,top:Ie.tcy0,width:Ve.width,height:Ve.height,items:Ve.items}}function ye(Ke){for(var Re=Ke.SIZ,Qe=Ke.components,Ie=Re.Csiz,be=[],lt=0,ze=Ke.tiles.length;lt>2),Ae=Vt+ue,ge=Vt+je,qe[Ye++]=Ae<=0?0:Ae>=ie?255:Ae>>He,qe[Ye++]=Vt<=0?0:Vt>=ie?255:Vt>>He,qe[Ye++]=ge<=0?0:ge>=ie?255:ge>>He;else for(ht=0;ht=ie?255:Ae>>He,qe[Ye++]=Vt<=0?0:Vt>=ie?255:Vt>>He,qe[Ye++]=ge<=0?0:ge>=ie?255:ge>>He;if(Zt)for(ht=0,Ye=3;ht=st?255:Ut+rt>>He}else for(_e=0;_e=ie?255:Ve+rt>>He,Ye+=Ie}else{var We=Qe[_e].isSigned,Ce=Ge[_e].items;if(We)for(Ye=_e,ht=0,vt=Ce.length;ht>=1,be>>=1,lt++}lt--,Le=this.levels[lt],Le.items[Le.index]=ze,this.currentLevel=lt,delete this.value},incrementValue:function(){var Ie=this.levels[this.currentLevel];Ie.items[Ie.index]++},nextLevel:function(){var Ie=this.currentLevel,be=this.levels[Ie],lt=be.items[be.index];return Ie--,Ie<0?(this.value=lt,!1):(this.currentLevel=Ie,be=this.levels[Ie],be.items[be.index]=lt,!0)}},Re}(),Tt=function(){function Re(Qe,Ie){var be=N(Math.max(Qe,Ie))+1;this.levels=[];for(var lt=0;lt>=1,be>>=1,ze++}this.currentLevel=this.levels.length-1,this.minValue=this.levels[this.currentLevel].items[0]},incrementValue:function(){var Ie=this.levels[this.currentLevel];Ie.items[Ie.index]=Ie.items[Ie.index]+1,Ie.items[Ie.index]>this.minValue&&(this.minValue=Ie.items[Ie.index])},nextLevel:function(){var Ie=this.currentLevel;if(Ie--,Ie<0)return!1;this.currentLevel=Ie;var be=this.levels[Ie];return be.items[be.index]this.minValue&&(this.minValue=be.items[be.index]),!0},isLeaf:function(){return this.currentLevel===0},isAboveThreshold:function(){var Ie=this.currentLevel,be=this.levels[Ie];return be.items[be.index]>this.currentStopValue},isKnown:function(){var Ie=this.currentLevel,be=this.levels[Ie];return be.status[be.index]>0},setKnown:function(){var Ie=this.currentLevel,be=this.levels[Ie];be.status[be.index]=1}},Re}(),Lt=function(){var Re=17,Qe=18,Ie=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),be=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),lt=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function ze(Le,Ge,_e,Je,We){this.width=Le,this.height=Ge,this.contextLabelTable=_e==="HH"?lt:_e==="HL"?be:Ie;var qe=Le*Ge;this.neighborsSignificance=new Uint8Array(qe),this.coefficentsSign=new Uint8Array(qe),this.coefficentsMagnitude=We>14?new Uint32Array(qe):We>6?new Uint16Array(qe):new Uint8Array(qe),this.processingFlags=new Uint8Array(qe);var xt=new Uint8Array(qe);if(Je!==0)for(var He=0;He0,rt=_e+10&&(ie=Je-qe,He&&(We[ie-1]+=16),rt&&(We[ie+1]+=16),We[ie]+=4),Ge+1=Je)break;if(He[je]&=st,!(We[je]||!xt[je])){var Vt=ie[xt[je]],ge=Ge.readBit(rt,Vt);if(ge){var Ut=this.decodeSignBit(Ae,Me,je);qe[je]=Ut,We[je]=1,this.setNeighborsSignificance(Ae,Me,je),He[je]|=ht}Be[je]++,He[je]|=Ye}}},decodeSignBit:function(Ge,_e,Je){var We=this.width,qe=this.height,xt=this.coefficentsMagnitude,He=this.coefficentsSign,rt,ie,Be,st,Ye,ht;st=_e>0&&xt[Je-1]!==0,_e+10&&xt[Je-We]!==0,Ge+1=0?(Ye=9+rt,ht=this.decoder.readBit(this.contexts,Ye)):(Ye=9-rt,ht=this.decoder.readBit(this.contexts,Ye)^1),ht},runMagnitudeRefinementPass:function(){for(var Ge=this.decoder,_e=this.width,Je=this.height,We=this.coefficentsMagnitude,qe=this.neighborsSignificance,xt=this.contexts,He=this.bitsDecoded,rt=this.processingFlags,ie=1,Be=2,st=_e*Je,Ye=_e*4,ht=0,vt;ht>1;be=be|0;var Le,Ge,_e,Je,We=-1.586134342059924,qe=-.052980118572961,xt=.882911075530934,He=.443506852043971,rt=1.230174104914001,ie=1/rt;for(Le=be-3,Ge=ze+4;Ge--;Le+=2)Ie[Le]*=ie;for(Le=be-2,_e=He*Ie[Le-1],Ge=ze+3;Ge--&&(Je=He*Ie[Le+1],Ie[Le]=rt*Ie[Le]-_e-Je,Ge--);Le+=2)Le+=2,_e=He*Ie[Le+1],Ie[Le]=rt*Ie[Le]-_e-Je;for(Le=be-1,_e=xt*Ie[Le-1],Ge=ze+2;Ge--&&(Je=xt*Ie[Le+1],Ie[Le]-=_e+Je,Ge--);Le+=2)Le+=2,_e=xt*Ie[Le+1],Ie[Le]-=_e+Je;for(Le=be,_e=qe*Ie[Le-1],Ge=ze+1;Ge--&&(Je=qe*Ie[Le+1],Ie[Le]-=_e+Je,Ge--);Le+=2)Le+=2,_e=qe*Ie[Le+1],Ie[Le]-=_e+Je;if(ze!==0)for(Le=be+1,_e=We*Ie[Le-1],Ge=ze;Ge--&&(Je=We*Ie[Le+1],Ie[Le]-=_e+Je,Ge--);Le+=2)Le+=2,_e=We*Ie[Le+1],Ie[Le]-=_e+Je},Re}(),Mt=function(){function Re(){Ot.call(this)}return Re.prototype=Object.create(Ot.prototype),Re.prototype.filter=function(Ie,be,lt){var ze=lt>>1;be=be|0;var Le,Ge;for(Le=be,Ge=ze+1;Ge--;Le+=2)Ie[Le]-=Ie[Le-1]+Ie[Le+1]+2>>2;for(Le=be+1,Ge=ze;Ge--;Le+=2)Ie[Le]+=Ie[Le-1]+Ie[Le+1]>>1},Re}();return Y}(),s=function(){var q=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];function Y(X,Q,m){this.data=X,this.bp=Q,this.dataEnd=m,this.chigh=X[Q],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}return Y.prototype={byteIn:function(){var Q=this.data,m=this.bp;if(Q[m]===255){var Z=Q[m+1];Z>143?(this.clow+=65280,this.ct=8):(m++,this.clow+=Q[m]<<9,this.ct=7,this.bp=m)}else m++,this.clow+=m65535&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(Q,m){var Z=Q[m]>>1,ee=Q[m]&1,oe=q[Z],fe=oe.qe,me,pe=this.a-fe;if(this.chigh>15&1,this.clow=this.clow<<1&65535,this.ct--;while(!(pe&32768));return this.a=pe,Q[m]=Z<<1|ee,me}},Y}(),c=typeof window>"u"?commonjsGlobal:window;c.PDFJS||(c.PDFJS={});var f=f||{};f.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5},f.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};function g(W){f.verbosity>=f.VERBOSITY_LEVELS.infos&&console.log("Info: "+W)}function A(W){f.verbosity>=f.VERBOSITY_LEVELS.warnings&&console.log("Warning: "+W)}f.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"},f.UnsupportedManager=function(){var q=[];return{listen:function(Y){q.push(Y)},notify:function(Y){A('Unsupported feature "'+Y+'"');for(var X=0,Q=q.length;Xq;)q<<=1,Y++;return Y}function M(W,q){return W[q]<<8|W[q+1]}function O(W,q){return(W[q]<<24|W[q+1]<<16|W[q+2]<<8|W[q+3])>>>0}function z(){var W=new Uint8Array(2);W[0]=1;var q=new Uint16Array(W.buffer);return q[0]===1}Object.defineProperty(f,"isLittleEndian",{configurable:!0,get:function(){return y(f,"isLittleEndian",z())}});function B(){var W=document.createElement("canvas");W.width=W.height=1;var q=W.getContext("2d"),Y=q.createImageData(1,1);return typeof Y.data.buffer<"u"}Object.defineProperty(f,"hasCanvasTypedArrays",{configurable:!0,get:function(){return y(f,"hasCanvasTypedArrays",B())}});var V=f.Util=function(){function q(){}var Y=["rgb(",0,",",0,",",0,")"];return q.makeCssRgb=function(Q,m,Z){return Y[1]=Q,Y[3]=m,Y[5]=Z,Y.join("")},q.transform=function(Q,m){return[Q[0]*m[0]+Q[2]*m[1],Q[1]*m[0]+Q[3]*m[1],Q[0]*m[2]+Q[2]*m[3],Q[1]*m[2]+Q[3]*m[3],Q[0]*m[4]+Q[2]*m[5]+Q[4],Q[1]*m[4]+Q[3]*m[5]+Q[5]]},q.applyTransform=function(Q,m){var Z=Q[0]*m[0]+Q[1]*m[2]+m[4],ee=Q[0]*m[1]+Q[1]*m[3]+m[5];return[Z,ee]},q.applyInverseTransform=function(Q,m){var Z=m[0]*m[3]-m[1]*m[2],ee=(Q[0]*m[3]-Q[1]*m[2]+m[2]*m[5]-m[4]*m[3])/Z,oe=(-Q[0]*m[1]+Q[1]*m[0]+m[4]*m[1]-m[5]*m[0])/Z;return[ee,oe]},q.getAxialAlignedBoundingBox=function(Q,m){var Z=q.applyTransform(Q,m),ee=q.applyTransform(Q.slice(2,4),m),oe=q.applyTransform([Q[0],Q[3]],m),fe=q.applyTransform([Q[2],Q[1]],m);return[Math.min(Z[0],ee[0],oe[0],fe[0]),Math.min(Z[1],ee[1],oe[1],fe[1]),Math.max(Z[0],ee[0],oe[0],fe[0]),Math.max(Z[1],ee[1],oe[1],fe[1])]},q.inverseTransform=function(Q){var m=Q[0]*Q[3]-Q[1]*Q[2];return[Q[3]/m,-Q[1]/m,-Q[2]/m,Q[0]/m,(Q[2]*Q[5]-Q[4]*Q[3])/m,(Q[4]*Q[1]-Q[5]*Q[0])/m]},q.apply3dTransform=function(Q,m){return[Q[0]*m[0]+Q[1]*m[1]+Q[2]*m[2],Q[3]*m[0]+Q[4]*m[1]+Q[5]*m[2],Q[6]*m[0]+Q[7]*m[1]+Q[8]*m[2]]},q.singularValueDecompose2dScale=function(Q){var m=[Q[0],Q[2],Q[1],Q[3]],Z=Q[0]*m[0]+Q[1]*m[2],ee=Q[0]*m[1]+Q[1]*m[3],oe=Q[2]*m[0]+Q[3]*m[2],fe=Q[2]*m[1]+Q[3]*m[3],me=(Z+fe)/2,pe=Math.sqrt((Z+fe)*(Z+fe)-4*(Z*fe-oe*ee))/2,Se=me+pe||1,xe=me-pe||1;return[Math.sqrt(Se),Math.sqrt(xe)]},q.normalizeRect=function(Q){var m=Q.slice(0);return Q[0]>Q[2]&&(m[0]=Q[2],m[2]=Q[0]),Q[1]>Q[3]&&(m[1]=Q[3],m[3]=Q[1]),m},q.intersect=function(Q,m){function Z(me,pe){return me-pe}var ee=[Q[0],Q[2],m[0],m[2]].sort(Z),oe=[Q[1],Q[3],m[1],m[3]].sort(Z),fe=[];if(Q=q.normalizeRect(Q),m=q.normalizeRect(m),ee[0]===Q[0]&&ee[1]===m[0]||ee[0]===m[0]&&ee[1]===Q[0])fe[0]=ee[1],fe[2]=ee[2];else return!1;if(oe[0]===Q[1]&&oe[1]===m[1]||oe[0]===m[1]&&oe[1]===Q[1])fe[1]=oe[1],fe[3]=oe[2];else return!1;return fe},q.sign=function(Q){return Q<0?-1:1},q.appendToArray=function(Q,m){Array.prototype.push.apply(Q,m)},q.prependToArray=function(Q,m){Array.prototype.unshift.apply(Q,m)},q.extendObj=function(Q,m){for(var Z in m)Q[Z]=m[Z]},q.getInheritableProperty=function(Q,m){for(;Q&&!Q.has(m);)Q=Q.get("Parent");return Q?Q.get(m):null},q.inherit=function(Q,m,Z){Q.prototype=Object.create(m.prototype),Q.prototype.constructor=Q;for(var ee in Z)Q.prototype[ee]=Z[ee]},q.loadScript=function(Q,m){var Z=document.createElement("script"),ee=!1;Z.setAttribute("src",Q),m&&(Z.onload=function(){ee||m(),ee=!0}),document.getElementsByTagName("head")[0].appendChild(Z)},q}();f.PageViewport=function(){function q(Y,X,Q,m,Z,ee){this.viewBox=Y,this.scale=X,this.rotation=Q,this.offsetX=m,this.offsetY=Z;var oe=(Y[2]+Y[0])/2,fe=(Y[3]+Y[1])/2,me,pe,Se,xe;switch(Q=Q%360,Q=Q<0?Q+360:Q,Q){case 180:me=-1,pe=0,Se=0,xe=1;break;case 90:me=0,pe=1,Se=1,xe=0;break;case 270:me=0,pe=-1,Se=-1,xe=0;break;default:me=1,pe=0,Se=0,xe=-1;break}ee&&(Se=-Se,xe=-xe);var we,Fe,De,Ze;me===0?(we=Math.abs(fe-Y[1])*X+m,Fe=Math.abs(oe-Y[0])*X+Z,De=Math.abs(Y[3]-Y[1])*X,Ze=Math.abs(Y[2]-Y[0])*X):(we=Math.abs(oe-Y[0])*X+m,Fe=Math.abs(fe-Y[1])*X+Z,De=Math.abs(Y[2]-Y[0])*X,Ze=Math.abs(Y[3]-Y[1])*X),this.transform=[me*X,pe*X,Se*X,xe*X,we-me*X*oe-Se*X*fe,Fe-pe*X*oe-xe*X*fe],this.width=De,this.height=Ze,this.fontScale=X}return q.prototype={clone:function(X){X=X||{};var Q="scale"in X?X.scale:this.scale,m="rotation"in X?X.rotation:this.rotation;return new q(this.viewBox.slice(),Q,m,this.offsetX,this.offsetY,X.dontFlip)},convertToViewportPoint:function(X,Q){return V.applyTransform([X,Q],this.transform)},convertToViewportRectangle:function(X){var Q=V.applyTransform([X[0],X[1]],this.transform),m=V.applyTransform([X[2],X[3]],this.transform);return[Q[0],Q[1],m[0],m[1]]},convertToPdfPoint:function(X,Q){return V.applyInverseTransform([X,Q],this.transform)}},q}();function b(){var W={};return W.promise=new Promise(function(q,Y){W.resolve=q,W.reject=Y}),W}f.createPromiseCapability=b,function(){if(c.Promise){typeof c.Promise.all!="function"&&(c.Promise.all=function(ee){var oe=0,fe=[],me,pe,Se=new c.Promise(function(xe,we){me=xe,pe=we});return ee.forEach(function(xe,we){oe++,xe.then(function(Fe){fe[we]=Fe,oe--,oe===0&&me(fe)},pe)}),oe===0&&me(fe),Se}),typeof c.Promise.resolve!="function"&&(c.Promise.resolve=function(ee){return new c.Promise(function(oe){oe(ee)})}),typeof c.Promise.reject!="function"&&(c.Promise.reject=function(ee){return new c.Promise(function(oe,fe){fe(ee)})}),typeof c.Promise.prototype.catch2!="function"&&(c.Promise.prototype.catch2=function(ee){return c.Promise.prototype.then(void 0,ee)});return}var q=0,Y=1,X=2,Q=500,m={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(oe){oe._status!==q&&(this.handlers=this.handlers.concat(oe._handlers),oe._handlers=[],!this.running&&(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var oe=1,fe=Date.now()+oe;this.handlers.length>0;){var me=this.handlers.shift(),pe=me.thisPromise._status,Se=me.thisPromise._value;try{pe===Y?typeof me.onResolve=="function"&&(Se=me.onResolve(Se)):typeof me.onReject=="function"&&(Se=me.onReject(Se),pe=Y,me.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(me.thisPromise))}catch(xe){pe=X,Se=xe}if(me.nextPromise._updateStatus(pe,Se),Date.now()>=fe)break}if(this.handlers.length>0){setTimeout(this.runHandlers.bind(this),0);return}this.running=!1},addUnhandledRejection:function(oe){this.unhandledRejections.push({promise:oe,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(oe){oe._unhandledRejection=!1;for(var fe=0;feQ){var pe=this.unhandledRejections[me].promise._value,Se="Unhandled rejection: "+pe;pe.stack&&(Se+=` +`+this.value[A].toString(c+1,f);else this.vr==="SQ"||this.isPixelData()?g="":this.value?f&&this.preformatted?g="[
"+this.value+"
]":g="["+this.value+"]":g="";return this.isSublistItem()?T="Sequence Item":this.isSublistItemDelim()?T="Sequence Item Delimiter":this.isSequenceDelim()?T="Sequence Delimiter":this.isPixelData()?T="Pixel Data":I=s.Utils.convertCamcelCaseToTitleCase(s.Dictionary.getDescription(this.group,this.element)),g=n(g),f?S+""+T+"   "+I+"   "+g:S+" "+T+" "+I+" "+g},s.Tag.prototype.toHTMLString=function(c){return this.toString(c,!0)},s.Tag.prototype.isTransformSyntax=function(){return this.group===s.Tag.TAG_TRANSFER_SYNTAX[0]&&this.element===s.Tag.TAG_TRANSFER_SYNTAX[1]},s.Tag.prototype.isCharset=function(){return this.group===s.Tag.TAG_SPECIFIC_CHAR_SET[0]&&this.element===s.Tag.TAG_SPECIFIC_CHAR_SET[1]},s.Tag.prototype.isPixelData=function(){return this.group===s.Tag.TAG_PIXEL_DATA[0]&&this.element===s.Tag.TAG_PIXEL_DATA[1]},s.Tag.prototype.isPrivateData=function(){return(this.group&1)===1},s.Tag.prototype.hasInterpretedPrivateData=function(){return this.isPrivateData()&&s.Utils.isString(this.value)},s.Tag.prototype.isSublistItem=function(){return this.group===s.Tag.TAG_SUBLIST_ITEM[0]&&this.element===s.Tag.TAG_SUBLIST_ITEM[1]},s.Tag.prototype.isSublistItemDelim=function(){return this.group===s.Tag.TAG_SUBLIST_ITEM_DELIM[0]&&this.element===s.Tag.TAG_SUBLIST_ITEM_DELIM[1]},s.Tag.prototype.isSequenceDelim=function(){return this.group===s.Tag.TAG_SUBLIST_SEQ_DELIM[0]&&this.element===s.Tag.TAG_SUBLIST_SEQ_DELIM[1]},s.Tag.prototype.isMetaLength=function(){return this.group===s.Tag.TAG_META_LENGTH[0]&&this.element===s.Tag.TAG_META_LENGTH[1]},u.exports&&(u.exports=s.Tag)}(tag)),tag.exports}var rle={exports:{}},hasRequiredRle;function requireRle(){return hasRequiredRle||(hasRequiredRle=1,function(u){var n=n||{};n.RLE=n.RLE||function(){this.rawData=null,this.bytesRead=0,this.bytesPut=0,this.segElemPut=0,this.numSegments=0,this.segmentOffsets=[],this.littleEndian=!0,this.segmentIndex=0,this.numElements=0,this.size=0,this.output=null},n.RLE.HEADER_SIZE=64,n.RLE.prototype.decode=function(s,c,f){var g;for(this.rawData=new DataView(s),this.littleEndian=c,this.numElements=f,this.readHeader(),this.output=new DataView(new ArrayBuffer(this.size)),g=0;g=0&&s<128?this.readLiteral(s):s<=-1&&s>-128?this.readEncoded(s):s===-128&&console.warn("RLE: unsupported code!");this.segmentIndex+=1},n.RLE.prototype.readLiteral=function(s){var c,f=s+1;if(this.hasValidInput())for(c=0;c1)for(var g=Array.prototype.slice.call(arguments,1);f--;)c[s-1-f]=n.lossless.Utils.createArray.apply(this,g);return c},n.lossless.Utils.makeCRCTable=function(){for(var s,c=[],f=0;f<256;f++){s=f;for(var g=0;g<8;g++)s=s&1?3988292384^s>>>1:s>>>1;c[f]=s}return c},n.lossless.Utils.crc32=function(s){for(var c=new Uint8Array(s.buffer),f=n.lossless.Utils.crcTable||(n.lossless.Utils.crcTable=n.lossless.Utils.makeCRCTable()),g=-1,A=0;A>>8^f[(g^c[A])&255];return(g^-1)>>>0},u.exports&&(u.exports=n.lossless.Utils)}(utils)),utils.exports}var hasRequiredHuffmanTable;function requireHuffmanTable(){return hasRequiredHuffmanTable||(hasRequiredHuffmanTable=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.Utils=n.lossless.Utils||(typeof commonjsRequire<"u"?requireUtils():null),n.lossless.HuffmanTable=n.lossless.HuffmanTable||function(){this.l=n.lossless.Utils.createArray(4,2,16),this.th=[],this.v=n.lossless.Utils.createArray(4,2,16,200),this.tc=n.lossless.Utils.createArray(4,2),this.tc[0][0]=0,this.tc[1][0]=0,this.tc[2][0]=0,this.tc[3][0]=0,this.tc[0][1]=0,this.tc[1][1]=0,this.tc[2][1]=0,this.tc[3][1]=0,this.th[0]=0,this.th[1]=0,this.th[2]=0,this.th[3]=0},n.lossless.HuffmanTable.MSB=2147483648,n.lossless.HuffmanTable.prototype.read=function(s,c){var f=0,g,A,v,y,T,I;for(g=s.get16(),f+=2;f3)throw new Error("ERROR: Huffman table ID > 3");if(y=A>>4,y>2)throw new Error("ERROR: Huffman table [Table class > 2 ]");for(this.th[v]=1,this.tc[v][y]=1,T=0;T<16;T+=1)this.l[v][y][T]=s.get8(),f+=1;for(T=0;T<16;T+=1)for(I=0;Ig)throw new Error("ERROR: Huffman table format error [count>Lh]");this.v[v][y][T][I]=s.get8(),f+=1}}if(f!==g)throw new Error("ERROR: Huffman table format error [count!=Lf]");for(T=0;T<4;T+=1)for(I=0;I<2;I+=1)this.tc[T][I]!==0&&this.buildHuffTable(c[T][I],this.l[T][I],this.v[T][I]);return 1},n.lossless.HuffmanTable.prototype.buildHuffTable=function(s,c,f){var g,A,v,y,T,I;for(A=256,v=0,y=0;y<8;y+=1)for(T=0;T>y+1;I+=1)s[v]=f[y][T]|y+1<<8,v+=1;for(y=1;v<256;y+=1,v+=1)s[v]=y|n.lossless.HuffmanTable.MSB;for(g=1,v=0,y=8;y<16;y+=1)for(T=0;T>y-7;I+=1)s[g*256+v]=f[y][T]|y+1<<8,v+=1;if(v>=256){if(v>256)throw new Error("ERROR: Huffman table error(1)!");v=0,g+=1}}},u.exports&&(u.exports=n.lossless.HuffmanTable)}(huffmanTable)),huffmanTable.exports}var quantizationTable={exports:{}},hasRequiredQuantizationTable;function requireQuantizationTable(){return hasRequiredQuantizationTable||(hasRequiredQuantizationTable=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.Utils=n.lossless.Utils||(typeof commonjsRequire<"u"?requireUtils():null),n.lossless.QuantizationTable=n.lossless.QuantizationTable||function(){this.precision=[],this.tq=[],this.quantTables=n.lossless.Utils.createArray(4,64),this.tq[0]=0,this.tq[1]=0,this.tq[2]=0,this.tq[3]=0},n.lossless.QuantizationTable.enhanceQuantizationTable=function(s,c){var f;for(f=0;f<8;f+=1)s[c[0*8+f]]*=90,s[c[4*8+f]]*=90,s[c[2*8+f]]*=118,s[c[6*8+f]]*=49,s[c[5*8+f]]*=71,s[c[1*8+f]]*=126,s[c[7*8+f]]*=25,s[c[3*8+f]]*=106;for(f=0;f<8;f+=1)s[c[0+8*f]]*=90,s[c[4+8*f]]*=90,s[c[2+8*f]]*=118,s[c[6+8*f]]*=49,s[c[5+8*f]]*=71,s[c[1+8*f]]*=126,s[c[7+8*f]]*=25,s[c[3+8*f]]*=106;for(f=0;f<64;f+=1)s[f]>>=6},n.lossless.QuantizationTable.prototype.read=function(s,c){var f=0,g,A,v,y;for(g=s.get16(),f+=2;f3)throw new Error("ERROR: Quantization table ID > 3");if(this.precision[v]=A>>4,this.precision[v]===0)this.precision[v]=8;else if(this.precision[v]===1)this.precision[v]=16;else throw new Error("ERROR: Quantization table precision error");if(this.tq[v]=1,this.precision[v]===8){for(y=0;y<64;y+=1){if(f>g)throw new Error("ERROR: Quantization table format error");this.quantTables[v][y]=s.get8(),f+=1}n.lossless.QuantizationTable.enhanceQuantizationTable(this.quantTables[v],c)}else{for(y=0;y<64;y+=1){if(f>g)throw new Error("ERROR: Quantization table format error");this.quantTables[v][y]=s.get16(),f+=2}n.lossless.QuantizationTable.enhanceQuantizationTable(this.quantTables[v],c)}}if(f!==g)throw new Error("ERROR: Quantization table error [count!=Lq]");return 1},u.exports&&(u.exports=n.lossless.QuantizationTable)}(quantizationTable)),quantizationTable.exports}var scanHeader={exports:{}},scanComponent={exports:{}},hasRequiredScanComponent;function requireScanComponent(){return hasRequiredScanComponent||(hasRequiredScanComponent=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.ScanComponent=n.lossless.ScanComponent||function(){this.acTabSel=0,this.dcTabSel=0,this.scanCompSel=0},u.exports&&(u.exports=n.lossless.ScanComponent)}(scanComponent)),scanComponent.exports}var hasRequiredScanHeader;function requireScanHeader(){return hasRequiredScanHeader||(hasRequiredScanHeader=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.ScanComponent=n.lossless.ScanComponent||(typeof commonjsRequire<"u"?requireScanComponent():null),n.lossless.ScanHeader=n.lossless.ScanHeader||function(){this.ah=0,this.al=0,this.numComp=0,this.selection=0,this.spectralEnd=0,this.components=[]},n.lossless.ScanHeader.prototype.read=function(s){var c=0,f,g,A;for(f=s.get16(),c+=2,this.numComp=s.get8(),c+=1,g=0;gf)throw new Error("ERROR: scan header format error");this.components[g].scanCompSel=s.get8(),c+=1,A=s.get8(),c+=1,this.components[g].dcTabSel=A>>4,this.components[g].acTabSel=A&15}if(this.selection=s.get8(),c+=1,this.spectralEnd=s.get8(),c+=1,A=s.get8(),this.ah=A>>4,this.al=A&15,c+=1,c!==f)throw new Error("ERROR: scan header format error [count!=Ns]");return 1},u.exports&&(u.exports=n.lossless.ScanHeader)}(scanHeader)),scanHeader.exports}var frameHeader={exports:{}},hasRequiredFrameHeader;function requireFrameHeader(){return hasRequiredFrameHeader||(hasRequiredFrameHeader=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.ComponentSpec=n.lossless.ComponentSpec||(typeof commonjsRequire<"u"?requireComponentSpec():null),n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.FrameHeader=n.lossless.FrameHeader||function(){this.components=[],this.dimX=0,this.dimY=0,this.numComp=0,this.precision=0},n.lossless.FrameHeader.prototype.read=function(s){var c=0,f,g,A,v;for(f=s.get16(),c+=2,this.precision=s.get8(),c+=1,this.dimY=s.get16(),c+=2,this.dimX=s.get16(),c+=2,this.numComp=s.get8(),c+=1,g=1;g<=this.numComp;g+=1){if(c>f)throw new Error("ERROR: frame format error");if(A=s.get8(),c+=1,c>=f)throw new Error("ERROR: frame format error [c>=Lf]");v=s.get8(),c+=1,this.components[A]||(this.components[A]=new n.lossless.ComponentSpec),this.components[A].hSamp=v>>4,this.components[A].vSamp=v&15,this.components[A].quantTableSel=s.get8(),c+=1}if(c!==f)throw new Error("ERROR: frame format error [Lf!=count]");return 1},u.exports&&(u.exports=n.lossless.FrameHeader)}(frameHeader)),frameHeader.exports}var hasRequiredDecoder;function requireDecoder(){return hasRequiredDecoder||(hasRequiredDecoder=1,function(u){var n=n||{};n.lossless=n.lossless||{},n.lossless.DataStream=n.lossless.DataStream||(typeof commonjsRequire<"u"?requireDataStream():null),n.lossless.HuffmanTable=n.lossless.HuffmanTable||(typeof commonjsRequire<"u"?requireHuffmanTable():null),n.lossless.QuantizationTable=n.lossless.QuantizationTable||(typeof commonjsRequire<"u"?requireQuantizationTable():null),n.lossless.ScanHeader=n.lossless.ScanHeader||(typeof commonjsRequire<"u"?requireScanHeader():null),n.lossless.FrameHeader=n.lossless.FrameHeader||(typeof commonjsRequire<"u"?requireFrameHeader():null),n.lossless.Utils=n.lossless.Utils||(typeof commonjsRequire<"u"?requireUtils():null),n.lossless.Decoder=n.lossless.Decoder||function(c,f){this.buffer=c,this.frame=new n.lossless.FrameHeader,this.huffTable=new n.lossless.HuffmanTable,this.quantTable=new n.lossless.QuantizationTable,this.scan=new n.lossless.ScanHeader,this.DU=n.lossless.Utils.createArray(10,4,64),this.HuffTab=n.lossless.Utils.createArray(4,2,50*256),this.IDCT_Source=[],this.nBlock=[],this.acTab=n.lossless.Utils.createArray(10,1),this.dcTab=n.lossless.Utils.createArray(10,1),this.qTab=n.lossless.Utils.createArray(10,1),this.marker=0,this.markerIndex=0,this.numComp=0,this.restartInterval=0,this.selection=0,this.xDim=0,this.yDim=0,this.xLoc=0,this.yLoc=0,this.numBytes=0,this.outputData=null,this.restarting=!1,this.mask=0,typeof f<"u"&&(this.numBytes=f)},n.lossless.Decoder.IDCT_P=[0,5,40,16,45,2,7,42,21,56,8,61,18,47,1,4,41,23,58,13,32,24,37,10,63,17,44,3,6,43,20,57,15,34,29,48,53,26,39,9,60,19,46,22,59,12,33,31,50,55,25,36,11,62,14,35,28,49,52,27,38,30,51,54],n.lossless.Decoder.TABLE=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],n.lossless.Decoder.MAX_HUFFMAN_SUBTREE=50,n.lossless.Decoder.MSB=2147483648,n.lossless.Decoder.RESTART_MARKER_BEGIN=65488,n.lossless.Decoder.RESTART_MARKER_END=65495,n.lossless.Decoder.prototype.decompress=function(c,f,g){return this.decode(c,f,g).buffer},n.lossless.Decoder.prototype.decode=function(c,f,g,A){var v,y=0,T=[],I,S,k=[],e=[],N;if(typeof c<"u"&&(this.buffer=c),typeof A<"u"&&(this.numBytes=A),this.stream=new n.lossless.DataStream(this.buffer,f,g),this.buffer=null,this.xLoc=0,this.yLoc=0,v=this.stream.get16(),v!==65496)throw new Error("Not a JPEG file");for(v=this.stream.get16();v>>4!==4092||v===65476;){switch(v){case 65476:this.huffTable.read(this.stream,this.HuffTab);break;case 65484:throw new Error("Program doesn't support arithmetic coding. (format throw new IOException)");case 65499:this.quantTable.read(this.stream,n.lossless.Decoder.TABLE);break;case 65501:this.restartInterval=this.readNumber();break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:this.readApp();break;case 65534:this.readComment();break;default:if(v>>8!==255)throw new Error("ERROR: format throw new IOException! (decode)")}v=this.stream.get16()}if(v<65472||v>65479)throw new Error("ERROR: could not handle arithmetic code!");this.frame.read(this.stream),v=this.stream.get16();do{for(;v!==65498;){switch(v){case 65476:this.huffTable.read(this.stream,this.HuffTab);break;case 65484:throw new Error("Program doesn't support arithmetic coding. (format throw new IOException)");case 65499:this.quantTable.read(this.stream,n.lossless.Decoder.TABLE);break;case 65501:this.restartInterval=this.readNumber();break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:this.readApp();break;case 65534:this.readComment();break;default:if(v>>8!==255)throw new Error("ERROR: format throw new IOException! (Parser.decode)")}v=this.stream.get16()}switch(this.precision=this.frame.precision,this.components=this.frame.components,this.numBytes||(this.numBytes=parseInt(Math.ceil(this.precision/8))),this.numBytes==1?this.mask=255:this.mask=65535,this.scan.read(this.stream),this.numComp=this.scan.numComp,this.selection=this.scan.selection,this.numBytes===1?this.numComp===3?(this.getter=this.getValueRGB,this.setter=this.setValueRGB,this.output=this.outputRGB):(this.getter=this.getValue8,this.setter=this.setValue8,this.output=this.outputSingle):(this.getter=this.getValue16,this.setter=this.setValue16,this.output=this.outputSingle),this.selection){case 2:this.selector=this.select2;break;case 3:this.selector=this.select3;break;case 4:this.selector=this.select4;break;case 5:this.selector=this.select5;break;case 6:this.selector=this.select6;break;case 7:this.selector=this.select7;break;default:this.selector=this.select1;break}for(this.scanComps=this.scan.components,this.quantTables=this.quantTable.quantTables,I=0;I=n.lossless.Decoder.RESTART_MARKER_BEGIN&&v<=n.lossless.Decoder.RESTART_MARKER_END))break}v===65500&&y===1&&(this.readNumber(),v=this.stream.get16())}while(v!==65497&&this.xLoc>1)},n.lossless.Decoder.prototype.select6=function(c){return this.getPreviousY(c)+(this.getPreviousX(c)-this.getPreviousXY(c)>>1)},n.lossless.Decoder.prototype.select7=function(c){return(this.getPreviousX(c)+this.getPreviousY(c))/2},n.lossless.Decoder.prototype.decodeRGB=function(c,f,g){var A,v,y,T,I,S,k,e;for(c[0]=this.selector(0),c[1]=this.selector(1),c[2]=this.selector(2),I=0;I=65280)return A;for(c[I]=this.IDCT_Source[0]=c[I]+this.getn(g,A,f,g),this.IDCT_Source[0]*=T[0],e=1;e<64;e+=1){if(A=this.getHuffmanValue(v,f,g),A>=65280)return A;if(e+=A>>4,A&15)this.IDCT_Source[n.lossless.Decoder.IDCT_P[e]]=this.getn(g,A&15,f,g)*T[e];else if(!(A>>4))break}}return 0},n.lossless.Decoder.prototype.decodeSingle=function(c,f,g){var A,v,y,T;for(this.restarting?(this.restarting=!1,c[0]=1<=65280)return A;if(y=this.getn(c,A,f,g),T=y>>8,T>=n.lossless.Decoder.RESTART_MARKER_BEGIN&&T<=n.lossless.Decoder.RESTART_MARKER_END)return T;c[0]+=y}return 0},n.lossless.Decoder.prototype.getHuffmanValue=function(c,f,g){var A,v,y;if(y=65535,g[0]<8?(f[0]<<=8,v=this.stream.get8(),v===255&&(this.marker=this.stream.get8(),this.marker!==0&&(this.markerIndex=9)),f[0]|=v):g[0]-=8,A=c[f[0]>>g[0]],A&n.lossless.Decoder.MSB){if(this.markerIndex!==0)return this.markerIndex=0,65280|this.marker;f[0]&=y>>16-g[0],f[0]<<=8,v=this.stream.get8(),v===255&&(this.marker=this.stream.get8(),this.marker!==0&&(this.markerIndex=9)),f[0]|=v,A=c[(A&255)*256+(f[0]>>g[0])],g[0]+=8}if(g[0]+=8-(A>>8),g[0]<0)throw new Error("index="+g[0]+" temp="+f[0]+" code="+A+" in HuffmanValue()");return g[0]>16-g[0],A&255)},n.lossless.Decoder.prototype.getn=function(c,f,g,A){var v,y,T,I,S;if(y=1,T=-1,I=65535,f===0)return 0;if(f===16)return c[0]>=0?-32768:32768;if(A[0]-=f,A[0]>=0){if(A[0]>A[0],g[0]&=I>>16-A[0]}else{if(g[0]<<=8,S=this.stream.get8(),S===255&&(this.marker=this.stream.get8(),this.marker!==0&&(this.markerIndex=9)),g[0]|=S,A[0]+=8,A[0]<0){if(this.markerIndex!==0)return this.markerIndex=0,(65280|this.marker)<<8;g[0]<<=8,S=this.stream.get8(),S===255&&(this.marker=this.stream.get8(),this.marker!==0&&(this.markerIndex=9)),g[0]|=S,A[0]+=8}if(A[0]<0)throw new Error("index="+A[0]+" in getn()");if(A[0]>A[0],g[0]&=I>>16-A[0]}return v0?this.getter(this.yLoc*this.xDim+this.xLoc-1,c):this.yLoc>0?this.getPreviousY(c):1<0&&this.yLoc>0?this.getter((this.yLoc-1)*this.xDim+this.xLoc-1,c):this.getPreviousY(c)},n.lossless.Decoder.prototype.getPreviousY=function(c){return this.yLoc>0?this.getter((this.yLoc-1)*this.xDim+this.xLoc,c):this.getPreviousX(c)},n.lossless.Decoder.prototype.isLastPixel=function(){return this.xLoc===this.xDim-1&&this.yLoc===this.yDim-1},n.lossless.Decoder.prototype.outputSingle=function(c){this.xLoc=this.xDim&&(this.yLoc+=1,this.xLoc=0))},n.lossless.Decoder.prototype.outputRGB=function(c){var f=this.yLoc*this.xDim+this.xLoc;this.xLoc=this.xDim&&(this.yLoc+=1,this.xLoc=0))},n.lossless.Decoder.prototype.setValue8=function(c,f){this.outputData[c]=f},n.lossless.Decoder.prototype.getValue8=function(c){return this.outputData[c]};var s=function(){var c=new ArrayBuffer(2);return new DataView(c).setInt16(0,256,!0),new Int16Array(c)[0]===256}();s?(n.lossless.Decoder.prototype.setValue16=n.lossless.Decoder.prototype.setValue8,n.lossless.Decoder.prototype.getValue16=n.lossless.Decoder.prototype.getValue8):(n.lossless.Decoder.prototype.setValue16=function(c,f){this.outputData[c]=(f&255)<<8|f>>8&255},n.lossless.Decoder.prototype.getValue16=function(c){var f=this.outputData[c];return(f&255)<<8|f>>8&255}),n.lossless.Decoder.prototype.setValueRGB=function(c,f,g){this.outputData[c*3+g]=f},n.lossless.Decoder.prototype.getValueRGB=function(c,f){return this.outputData[c*3+f]},n.lossless.Decoder.prototype.readApp=function(){var c=0,f=this.stream.get16();for(c+=2;c0&&!b[m-1];)m--;Y.push({children:[],index:0});var Z=Y[0],ee;for(X=0;X0;)Z=Y.pop();for(Z.index++,Y.push(Z);Y.length<=X;)Y.push(ee={children:[],index:0}),Z.children[Z.index]=ee.children,Z=ee;q++}X+10)return Se--,pe>>Se&1;if(pe=b[W++],pe==255){var We=b[W++];if(We)throw"unexpected marker: "+(pe<<8|We).toString(16)}return Se=7,pe>>>7}function we(We){for(var qe=We,xt;(xt=xe())!==null;){if(qe=qe[xt],typeof qe=="number")return qe;if(typeof qe!="object")throw"invalid huffman sequence"}return null}function Fe(We){for(var qe=0;We>0;){var xt=xe();if(xt===null)return;qe=qe<<1|xt,We--}return qe}function De(We){var qe=Fe(We);return qe>=1<>4;if(Be===0){if(st<15)break;rt+=16;continue}rt+=st;var Ye=f[rt];We.blockData[qe+Ye]=De(Be),rt++}}function nt(We,qe){var xt=we(We.huffmanTableDC),He=xt===0?0:De(xt)<0){ye--;return}for(var xt=Q,He=m;xt<=He;){var rt=we(We.huffmanTableAC),ie=rt&15,Be=rt>>4;if(ie===0){if(Be<15){ye=Fe(Be)+(1<>4,st===0)rt<15?(ye=Fe(rt)+(1<=65488&&Le<=65495)W+=2;else break}return W-me}function U(b,W,q){var Y=b.quantizationTable,X,Q,m,Z,ee,oe,fe,me,pe,Se;for(Se=0;Se<64;Se++)q[Se]=b.blockData[W+Se]*Y[Se];for(Se=0;Se<8;++Se){var xe=8*Se;if(q[1+xe]===0&&q[2+xe]===0&&q[3+xe]===0&&q[4+xe]===0&&q[5+xe]===0&&q[6+xe]===0&&q[7+xe]===0){pe=S*q[0+xe]+512>>10,q[0+xe]=pe,q[1+xe]=pe,q[2+xe]=pe,q[3+xe]=pe,q[4+xe]=pe,q[5+xe]=pe,q[6+xe]=pe,q[7+xe]=pe;continue}X=S*q[0+xe]+128>>8,Q=S*q[4+xe]+128>>8,m=q[2+xe],Z=q[6+xe],ee=k*(q[1+xe]-q[7+xe])+128>>8,me=k*(q[1+xe]+q[7+xe])+128>>8,oe=q[3+xe]<<4,fe=q[5+xe]<<4,pe=X-Q+1>>1,X=X+Q+1>>1,Q=pe,pe=m*I+Z*T+128>>8,m=m*T-Z*I+128>>8,Z=pe,pe=ee-fe+1>>1,ee=ee+fe+1>>1,fe=pe,pe=me+oe+1>>1,oe=me-oe+1>>1,me=pe,pe=X-Z+1>>1,X=X+Z+1>>1,Z=pe,pe=Q-m+1>>1,Q=Q+m+1>>1,m=pe,pe=ee*y+me*v+2048>>12,ee=ee*v-me*y+2048>>12,me=pe,pe=oe*A+fe*g+2048>>12,oe=oe*g-fe*A+2048>>12,fe=pe,q[0+xe]=X+me,q[7+xe]=X-me,q[1+xe]=Q+fe,q[6+xe]=Q-fe,q[2+xe]=m+oe,q[5+xe]=m-oe,q[3+xe]=Z+ee,q[4+xe]=Z-ee}for(Se=0;Se<8;++Se){var we=Se;if(q[1*8+we]===0&&q[2*8+we]===0&&q[3*8+we]===0&&q[4*8+we]===0&&q[5*8+we]===0&&q[6*8+we]===0&&q[7*8+we]===0){pe=S*q[Se+0]+8192>>14,q[0*8+we]=pe,q[1*8+we]=pe,q[2*8+we]=pe,q[3*8+we]=pe,q[4*8+we]=pe,q[5*8+we]=pe,q[6*8+we]=pe,q[7*8+we]=pe;continue}X=S*q[0*8+we]+2048>>12,Q=S*q[4*8+we]+2048>>12,m=q[2*8+we],Z=q[6*8+we],ee=k*(q[1*8+we]-q[7*8+we])+2048>>12,me=k*(q[1*8+we]+q[7*8+we])+2048>>12,oe=q[3*8+we],fe=q[5*8+we],pe=X-Q+1>>1,X=X+Q+1>>1,Q=pe,pe=m*I+Z*T+2048>>12,m=m*T-Z*I+2048>>12,Z=pe,pe=ee-fe+1>>1,ee=ee+fe+1>>1,fe=pe,pe=me+oe+1>>1,oe=me-oe+1>>1,me=pe,pe=X-Z+1>>1,X=X+Z+1>>1,Z=pe,pe=Q-m+1>>1,Q=Q+m+1>>1,m=pe,pe=ee*y+me*v+2048>>12,ee=ee*v-me*y+2048>>12,me=pe,pe=oe*A+fe*g+2048>>12,oe=oe*g-fe*A+2048>>12,fe=pe,q[0*8+we]=X+me,q[7*8+we]=X-me,q[1*8+we]=Q+fe,q[6*8+we]=Q-fe,q[2*8+we]=m+oe,q[5*8+we]=m-oe,q[3*8+we]=Z+ee,q[4*8+we]=Z-ee}for(Se=0;Se<64;++Se){var Fe=W+Se,De=q[Se];De=De<=-2056/b.bitConversion?0:De>=2024/b.bitConversion?255/b.bitConversion:De+2056/b.bitConversion>>4,b.blockData[Fe]=De}}function B(b,W){for(var q=W.blocksPerLine,Y=W.blocksPerColumn,X=new Int32Array(64),Q=0;Q=255?255:b|0}return e.prototype={load:function(W){var q=(function(ee){this.parse(ee),this.onload&&this.onload()}).bind(this);if(W.indexOf("data:")>-1){for(var Y=W.indexOf("base64,")+7,X=atob(W.substring(Y)),Q=new Uint8Array(X.length),m=X.length-1;m>=0;m--)Q[m]=X.charCodeAt(m);q(X)}else{var Z=new XMLHttpRequest;Z.open("GET",W,!0),Z.responseType="arraybuffer",Z.onload=(function(){var ee=new Uint8Array(Z.response);q(ee)}).bind(this),Z.send(null)}},parse:function(W){function q(){var ie=W[Q]<<8|W[Q+1];return Q+=2,ie}function Y(){var ie=q(),Be=W.subarray(Q,Q+ie-2);return Q+=Be.length,Be}function X(ie){for(var Be=Math.ceil(ie.samplesPerLine/8/ie.maxH),st=Math.ceil(ie.scanLines/8/ie.maxV),Ye=0;Ye>4)if(Ue>>4===1)for(we=0;we<64;we++){var ft=f[we];ye[ft]=q()}else throw"DQT: invalid table spec";else for(we=0;we<64;we++){var at=f[we];ye[at]=W[Q++]}fe[Ue&15]=ye}break;case 65472:case 65473:case 65474:if(ee)throw"Only single frame JPEGs supported";q(),ee={},ee.extended=Se===65473,ee.progressive=Se===65474,ee.precision=W[Q++],ee.scanLines=q(),ee.samplesPerLine=q(),ee.components=[],ee.componentIds={};var Tt=W[Q++],Lt,Ot=0,Ft=0;for(xe=0;xe>4,Ke=W[Q+1]&15;Ot>4?me:pe)[Ie&15]=N(be,ze)}break;case 65501:q(),oe=q();break;case 65498:q();var Le=W[Q++],Ge=[],_e;for(xe=0;xe>4],_e.huffmanTableAC=me[We&15],Ge.push(_e)}var qe=W[Q++],xt=W[Q++],He=W[Q++],rt=O(W,Q,ee,Ge,oe,qe,xt,He>>4,He&15);Q+=rt;break;default:if(W[Q-3]==255&&W[Q-2]>=192&&W[Q-2]<=254){Q-=3;break}throw"unknown JPEG marker "+Se.toString(16)}Se=q()}switch(this.width=ee.samplesPerLine,this.height=ee.scanLines,this.jfif=m,this.adobe=Z,this.components=[],ee.components.length){case 1:this.colorspace=n.Grayscale;break;case 3:this.adobe?this.colorspace=n.AdobeRGB:this.colorspace=n.RGB;break;case 4:this.colorspace=n.CYMK;break;default:this.colorspace=n.Unknown}for(var xe=0;xe>24&255,Le>>16&255,Le>>8&255,Le&255);A("Unsupported header type "+Le+" ("+qe+")");break}_e&&(Ie+=Ge)}},parseImageProperties:function(Re){for(var Qe=Re.getByte();Qe>=0;){var Ie=Qe;Qe=Re.getByte();var be=Ie<<8|Qe;if(be===65361){Re.skip(4);var lt=Re.getInt32()>>>0,ze=Re.getInt32()>>>0,Le=Re.getInt32()>>>0,Ge=Re.getInt32()>>>0;Re.skip(16);var _e=Re.getUint16();this.width=lt-Le,this.height=ze-Ge,this.componentsCount=_e,this.bitsPerComponent=8;return}}throw new Error("JPX Error: No size marker found in JPX stream")},parseCodestream:function(Re,Qe,Ie){var be={};try{for(var lt=!1,ze=Qe;ze+1>5,We=[];_e>3,vt.mu=0):(vt.epsilon=Re[_e]>>3,vt.mu=(Re[_e]&7)<<8|Re[_e+1],_e+=2),We.push(vt)}ht.SPqcds=We,be.mainHeader?be.QCD=ht:(be.currentTile.QCD=ht,be.currentTile.QCC=[]);break;case 65373:Ge=M(Re,ze);var Me={};_e=ze+2;var je;switch(be.SIZ.Csiz<257?je=Re[_e++]:(je=M(Re,_e),_e+=2),Je=Re[_e++],Je&31){case 0:qe=8,xt=!0;break;case 1:qe=16,xt=!1;break;case 2:qe=16,xt=!0;break;default:throw new Error("JPX Error: Invalid SQcd value "+Je)}for(Me.noQuantization=qe===8,Me.scalarExpounded=xt,Me.guardBits=Je>>5,We=[];_e>3,vt.mu=0):(vt.epsilon=Re[_e]>>3,vt.mu=(Re[_e]&7)<<8|Re[_e+1],_e+=2),We.push(vt);Me.SPqcds=We,be.mainHeader?be.QCC[je]=Me:be.currentTile.QCC[je]=Me;break;case 65362:Ge=M(Re,ze);var ue={};_e=ze+2;var Ae=Re[_e++];ue.entropyCoderWithCustomPrecincts=!!(Ae&1),ue.sopMarkerUsed=!!(Ae&2),ue.ephMarkerUsed=!!(Ae&4),ue.progressionOrder=Re[_e++],ue.layersCount=M(Re,_e),_e+=2,ue.multipleComponentTransform=Re[_e++],ue.decompositionLevelsCount=Re[_e++],ue.xcb=(Re[_e++]&15)+2,ue.ycb=(Re[_e++]&15)+2;var Vt=Re[_e++];if(ue.selectiveArithmeticCodingBypass=!!(Vt&1),ue.resetContextProbabilities=!!(Vt&2),ue.terminationOnEachCodingPass=!!(Vt&4),ue.verticalyStripe=!!(Vt&8),ue.predictableTermination=!!(Vt&16),ue.segmentationSymbolUsed=!!(Vt&32),ue.reversibleTransformation=Re[_e++],ue.entropyCoderWithCustomPrecincts){for(var ge=[];_e>4})}ue.precinctsSizes=ge}var Ve=[];if(ue.selectiveArithmeticCodingBypass&&Ve.push("selectiveArithmeticCodingBypass"),ue.resetContextProbabilities&&Ve.push("resetContextProbabilities"),ue.terminationOnEachCodingPass&&Ve.push("terminationOnEachCodingPass"),ue.verticalyStripe&&Ve.push("verticalyStripe"),ue.predictableTermination&&Ve.push("predictableTermination"),Ve.length>0)throw lt=!0,new Error("JPX Error: Unsupported COD options ("+Ve.join(", ")+")");be.mainHeader?be.COD=ue:(be.currentTile.COD=ue,be.currentTile.COC=[]);break;case 65424:Ge=M(Re,ze),He={},He.index=M(Re,ze+2),He.length=O(Re,ze+4),He.dataEnd=He.length+ze-2,He.partIndex=Re[ze+8],He.partsCount=Re[ze+9],be.mainHeader=!1,He.partIndex===0&&(He.COD=be.COD,He.COC=be.COC.slice(0),He.QCD=be.QCD,He.QCC=be.QCC.slice(0)),be.currentTile=He;break;case 65427:He=be.currentTile,He.partIndex===0&&(at(be,He.index),De(be)),Ge=He.dataEnd-ze,Ze(be,Re,ze,Ge);break;case 65365:case 65367:case 65368:case 65380:Ge=M(Re,ze);break;case 65363:throw new Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("JPX Error: Unknown codestream code: "+Le.toString(16))}ze+=Ge}}catch(Zt){if(lt||this.failOnCorruptedImage)throw Zt;A("Trying to recover from "+Zt.message)}this.tiles=ye(be),this.width=be.SIZ.Xsiz-be.SIZ.XOsiz,this.height=be.SIZ.Ysiz-be.SIZ.YOsiz,this.componentsCount=be.SIZ.Csiz}};function X(Ke,Re){Ke.x0=Math.ceil(Re.XOsiz/Ke.XRsiz),Ke.x1=Math.ceil(Re.Xsiz/Ke.XRsiz),Ke.y0=Math.ceil(Re.YOsiz/Ke.YRsiz),Ke.y1=Math.ceil(Re.Ysiz/Ke.YRsiz),Ke.width=Ke.x1-Ke.x0,Ke.height=Ke.y1-Ke.y0}function Q(Ke,Re){for(var Qe=Ke.SIZ,Ie,be=[],lt=Math.ceil((Qe.Xsiz-Qe.XTOsiz)/Qe.XTsiz),ze=Math.ceil((Qe.Ysiz-Qe.YTOsiz)/Qe.YTsiz),Le=0;Le0?Math.min(Ie.xcb,be.PPx-1):Math.min(Ie.xcb,be.PPx),be.ycb_=Qe>0?Math.min(Ie.ycb,be.PPy-1):Math.min(Ie.ycb,be.PPy),be}function Z(Ke,Re,Qe){var Ie=1<Re.trx0?Math.ceil(Re.trx1/Ie)-Math.floor(Re.trx0/Ie):0,_e=Re.try1>Re.try0?Math.ceil(Re.try1/be)-Math.floor(Re.try0/be):0,Je=Ge*_e;Re.precinctParameters={precinctWidth:Ie,precinctHeight:be,numprecinctswide:Ge,numprecinctshigh:_e,numprecincts:Je,precinctWidthInSubband:ze,precinctHeightInSubband:Le}}function ee(Ke,Re,Qe){var Ie=Qe.xcb_,be=Qe.ycb_,lt=1<>Ie,Ge=Re.tby0>>be,_e=Re.tbx1+lt-1>>Ie,Je=Re.tby1+ze-1>>be,We=Re.resolution.precinctParameters,qe=[],xt=[],He,rt,ie,Be;for(rt=Ge;rtht.cbxMax&&(ht.cbxMax=He),rtht.cbyMax&&(ht.cbyMax=rt)):xt[Be]=ht={cbxMin:He,cbyMin:rt,cbxMax:He,cbyMax:rt},ie.precinct=ht}}Re.codeblockParameters={codeblockWidth:Ie,codeblockHeight:be,numcodeblockwide:_e-Le+1,numcodeblockhigh:Je-Ge+1},Re.codeblocks=qe,Re.precincts=xt}function oe(Ke,Re,Qe){for(var Ie=[],be=Ke.subbands,lt=0,ze=be.length;ltxt.codingStyleParameters.decompositionLevelsCount)){for(var He=xt.resolutions[_e],rt=He.precinctParameters.numprecincts;Wext.codingStyleParameters.decompositionLevelsCount)){for(var He=xt.resolutions[Ge],rt=He.precinctParameters.numprecincts;Weie.codingStyleParameters.decompositionLevelsCount)){var Be=ie.resolutions[Le],st=Be.precinctParameters.numprecincts;if(!(_e>=st)){for(;ze=0;--ie){var Be=Ge.resolutions[ie],st=rt*Be.precinctParameters.precinctWidth,Ye=rt*Be.precinctParameters.precinctHeight;We=Math.min(We,st),qe=Math.min(qe,Ye),xt=Math.max(xt,Be.precinctParameters.numprecinctswide),He=Math.max(He,Be.precinctParameters.numprecinctshigh),Je[ie]={width:st,height:Ye},rt<<=1}Qe=Math.min(Qe,We),Ie=Math.min(Ie,qe),be=Math.max(be,xt),lt=Math.max(lt,He),ze[Le]={resolutions:Je,minWidth:We,minHeight:qe,maxNumWide:xt,maxNumHigh:He}}return{components:ze,minWidth:Qe,minHeight:Ie,maxNumWide:be,maxNumHigh:lt}}function De(Ke){for(var Re=Ke.SIZ,Qe=Ke.currentTile.index,Ie=Ke.tiles[Qe],be=Re.Csiz,lt=0;lt=Re.length)throw new Error("Unexpected EOF");var bt=Re[Qe+be];be++,Le?(lt=lt<<7|bt,ze+=7,Le=!1):(lt=lt<<8|bt,ze+=8),bt===255&&(Le=!0)}return ze-=ve,lt>>>ze&(1<=Re.length)return;if(Zt.isAboveThreshold())break;if(Zt.isKnown()){Zt.nextLevel();continue}if(Ge(1))if(Zt.setKnown(),Zt.isLeaf()){vt.included=!0,ge=Ut=!0;break}else Zt.nextLevel();else Zt.incrementValue()}}if(ge){if(Ut){for(ot=ue.zeroBitPlanesTree,ot.reset(Ae,Vt);;){if(be>=Re.length)return;if(Ge(1)){if(Ve=!ot.nextLevel(),Ve)break}else ot.incrementValue()}vt.zeroBitPlanes=ot.value}for(var Ne=qe();Ge(1);)vt.Lblock++;var se=N(Ne),ut=(Ne<1<0;){var Pe=ht.shift();vt=Pe.codeblock,vt.data===void 0&&(vt.data=[]),vt.data.push({data:Re,start:Qe+be,end:Qe+be+Pe.dataLength,codingpasses:Pe.codingpasses}),be+=Pe.dataLength}}catch{return}return be}function nt(Ke,Re,Qe,Ie,be,lt,ze,Le){for(var Ge=Ie.tbx0,_e=Ie.tby0,Je=Ie.tbx1-Ie.tbx0,We=Ie.codeblocks,qe=Ie.type.charAt(0)==="H"?1:0,xt=Ie.type.charAt(1)==="H"?Re:0,He=0,rt=We.length;He=lt?Ke[Wt]=Ce:Ke[Wt]=Ce*(1<0?1-ie:0));var Ae=Be.subbands[vt],Vt=q[Ae.type],ge=qe?1:Math.pow(2,We+Vt-ue)*(1+je/2048),Ut=_e+ue-1;nt(ht,st,Ye,Ae,ge,Ut,qe,Je)}He.push({width:st,height:Ye,items:ht})}var Ve=xt.calculate(He,Ie.tcx0,Ie.tcy0);return{left:Ie.tcx0,top:Ie.tcy0,width:Ve.width,height:Ve.height,items:Ve.items}}function ye(Ke){for(var Re=Ke.SIZ,Qe=Ke.components,Ie=Re.Csiz,be=[],lt=0,ze=Ke.tiles.length;lt>2),Ae=Vt+ue,ge=Vt+je,qe[Ye++]=Ae<=0?0:Ae>=ie?255:Ae>>He,qe[Ye++]=Vt<=0?0:Vt>=ie?255:Vt>>He,qe[Ye++]=ge<=0?0:ge>=ie?255:ge>>He;else for(ht=0;ht=ie?255:Ae>>He,qe[Ye++]=Vt<=0?0:Vt>=ie?255:Vt>>He,qe[Ye++]=ge<=0?0:ge>=ie?255:ge>>He;if(Zt)for(ht=0,Ye=3;ht=st?255:Ut+rt>>He}else for(_e=0;_e=ie?255:Ve+rt>>He,Ye+=Ie}else{var We=Qe[_e].isSigned,Ce=Ge[_e].items;if(We)for(Ye=_e,ht=0,vt=Ce.length;ht>=1,be>>=1,lt++}lt--,Le=this.levels[lt],Le.items[Le.index]=ze,this.currentLevel=lt,delete this.value},incrementValue:function(){var Ie=this.levels[this.currentLevel];Ie.items[Ie.index]++},nextLevel:function(){var Ie=this.currentLevel,be=this.levels[Ie],lt=be.items[be.index];return Ie--,Ie<0?(this.value=lt,!1):(this.currentLevel=Ie,be=this.levels[Ie],be.items[be.index]=lt,!0)}},Re}(),Tt=function(){function Re(Qe,Ie){var be=N(Math.max(Qe,Ie))+1;this.levels=[];for(var lt=0;lt>=1,be>>=1,ze++}this.currentLevel=this.levels.length-1,this.minValue=this.levels[this.currentLevel].items[0]},incrementValue:function(){var Ie=this.levels[this.currentLevel];Ie.items[Ie.index]=Ie.items[Ie.index]+1,Ie.items[Ie.index]>this.minValue&&(this.minValue=Ie.items[Ie.index])},nextLevel:function(){var Ie=this.currentLevel;if(Ie--,Ie<0)return!1;this.currentLevel=Ie;var be=this.levels[Ie];return be.items[be.index]this.minValue&&(this.minValue=be.items[be.index]),!0},isLeaf:function(){return this.currentLevel===0},isAboveThreshold:function(){var Ie=this.currentLevel,be=this.levels[Ie];return be.items[be.index]>this.currentStopValue},isKnown:function(){var Ie=this.currentLevel,be=this.levels[Ie];return be.status[be.index]>0},setKnown:function(){var Ie=this.currentLevel,be=this.levels[Ie];be.status[be.index]=1}},Re}(),Lt=function(){var Re=17,Qe=18,Ie=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),be=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),lt=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function ze(Le,Ge,_e,Je,We){this.width=Le,this.height=Ge,this.contextLabelTable=_e==="HH"?lt:_e==="HL"?be:Ie;var qe=Le*Ge;this.neighborsSignificance=new Uint8Array(qe),this.coefficentsSign=new Uint8Array(qe),this.coefficentsMagnitude=We>14?new Uint32Array(qe):We>6?new Uint16Array(qe):new Uint8Array(qe),this.processingFlags=new Uint8Array(qe);var xt=new Uint8Array(qe);if(Je!==0)for(var He=0;He0,rt=_e+10&&(ie=Je-qe,He&&(We[ie-1]+=16),rt&&(We[ie+1]+=16),We[ie]+=4),Ge+1=Je)break;if(He[je]&=st,!(We[je]||!xt[je])){var Vt=ie[xt[je]],ge=Ge.readBit(rt,Vt);if(ge){var Ut=this.decodeSignBit(Ae,Me,je);qe[je]=Ut,We[je]=1,this.setNeighborsSignificance(Ae,Me,je),He[je]|=ht}Be[je]++,He[je]|=Ye}}},decodeSignBit:function(Ge,_e,Je){var We=this.width,qe=this.height,xt=this.coefficentsMagnitude,He=this.coefficentsSign,rt,ie,Be,st,Ye,ht;st=_e>0&&xt[Je-1]!==0,_e+10&&xt[Je-We]!==0,Ge+1=0?(Ye=9+rt,ht=this.decoder.readBit(this.contexts,Ye)):(Ye=9-rt,ht=this.decoder.readBit(this.contexts,Ye)^1),ht},runMagnitudeRefinementPass:function(){for(var Ge=this.decoder,_e=this.width,Je=this.height,We=this.coefficentsMagnitude,qe=this.neighborsSignificance,xt=this.contexts,He=this.bitsDecoded,rt=this.processingFlags,ie=1,Be=2,st=_e*Je,Ye=_e*4,ht=0,vt;ht>1;be=be|0;var Le,Ge,_e,Je,We=-1.586134342059924,qe=-.052980118572961,xt=.882911075530934,He=.443506852043971,rt=1.230174104914001,ie=1/rt;for(Le=be-3,Ge=ze+4;Ge--;Le+=2)Ie[Le]*=ie;for(Le=be-2,_e=He*Ie[Le-1],Ge=ze+3;Ge--&&(Je=He*Ie[Le+1],Ie[Le]=rt*Ie[Le]-_e-Je,Ge--);Le+=2)Le+=2,_e=He*Ie[Le+1],Ie[Le]=rt*Ie[Le]-_e-Je;for(Le=be-1,_e=xt*Ie[Le-1],Ge=ze+2;Ge--&&(Je=xt*Ie[Le+1],Ie[Le]-=_e+Je,Ge--);Le+=2)Le+=2,_e=xt*Ie[Le+1],Ie[Le]-=_e+Je;for(Le=be,_e=qe*Ie[Le-1],Ge=ze+1;Ge--&&(Je=qe*Ie[Le+1],Ie[Le]-=_e+Je,Ge--);Le+=2)Le+=2,_e=qe*Ie[Le+1],Ie[Le]-=_e+Je;if(ze!==0)for(Le=be+1,_e=We*Ie[Le-1],Ge=ze;Ge--&&(Je=We*Ie[Le+1],Ie[Le]-=_e+Je,Ge--);Le+=2)Le+=2,_e=We*Ie[Le+1],Ie[Le]-=_e+Je},Re}(),Mt=function(){function Re(){Ot.call(this)}return Re.prototype=Object.create(Ot.prototype),Re.prototype.filter=function(Ie,be,lt){var ze=lt>>1;be=be|0;var Le,Ge;for(Le=be,Ge=ze+1;Ge--;Le+=2)Ie[Le]-=Ie[Le-1]+Ie[Le+1]+2>>2;for(Le=be+1,Ge=ze;Ge--;Le+=2)Ie[Le]+=Ie[Le-1]+Ie[Le+1]>>1},Re}();return Y}(),s=function(){var q=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];function Y(X,Q,m){this.data=X,this.bp=Q,this.dataEnd=m,this.chigh=X[Q],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}return Y.prototype={byteIn:function(){var Q=this.data,m=this.bp;if(Q[m]===255){var Z=Q[m+1];Z>143?(this.clow+=65280,this.ct=8):(m++,this.clow+=Q[m]<<9,this.ct=7,this.bp=m)}else m++,this.clow+=m65535&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(Q,m){var Z=Q[m]>>1,ee=Q[m]&1,oe=q[Z],fe=oe.qe,me,pe=this.a-fe;if(this.chigh>15&1,this.clow=this.clow<<1&65535,this.ct--;while(!(pe&32768));return this.a=pe,Q[m]=Z<<1|ee,me}},Y}(),c=typeof window>"u"?commonjsGlobal:window;c.PDFJS||(c.PDFJS={});var f=f||{};f.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5},f.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};function g(W){f.verbosity>=f.VERBOSITY_LEVELS.infos&&console.log("Info: "+W)}function A(W){f.verbosity>=f.VERBOSITY_LEVELS.warnings&&console.log("Warning: "+W)}f.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"},f.UnsupportedManager=function(){var q=[];return{listen:function(Y){q.push(Y)},notify:function(Y){A('Unsupported feature "'+Y+'"');for(var X=0,Q=q.length;Xq;)q<<=1,Y++;return Y}function M(W,q){return W[q]<<8|W[q+1]}function O(W,q){return(W[q]<<24|W[q+1]<<16|W[q+2]<<8|W[q+3])>>>0}function U(){var W=new Uint8Array(2);W[0]=1;var q=new Uint16Array(W.buffer);return q[0]===1}Object.defineProperty(f,"isLittleEndian",{configurable:!0,get:function(){return y(f,"isLittleEndian",U())}});function B(){var W=document.createElement("canvas");W.width=W.height=1;var q=W.getContext("2d"),Y=q.createImageData(1,1);return typeof Y.data.buffer<"u"}Object.defineProperty(f,"hasCanvasTypedArrays",{configurable:!0,get:function(){return y(f,"hasCanvasTypedArrays",B())}});var V=f.Util=function(){function q(){}var Y=["rgb(",0,",",0,",",0,")"];return q.makeCssRgb=function(Q,m,Z){return Y[1]=Q,Y[3]=m,Y[5]=Z,Y.join("")},q.transform=function(Q,m){return[Q[0]*m[0]+Q[2]*m[1],Q[1]*m[0]+Q[3]*m[1],Q[0]*m[2]+Q[2]*m[3],Q[1]*m[2]+Q[3]*m[3],Q[0]*m[4]+Q[2]*m[5]+Q[4],Q[1]*m[4]+Q[3]*m[5]+Q[5]]},q.applyTransform=function(Q,m){var Z=Q[0]*m[0]+Q[1]*m[2]+m[4],ee=Q[0]*m[1]+Q[1]*m[3]+m[5];return[Z,ee]},q.applyInverseTransform=function(Q,m){var Z=m[0]*m[3]-m[1]*m[2],ee=(Q[0]*m[3]-Q[1]*m[2]+m[2]*m[5]-m[4]*m[3])/Z,oe=(-Q[0]*m[1]+Q[1]*m[0]+m[4]*m[1]-m[5]*m[0])/Z;return[ee,oe]},q.getAxialAlignedBoundingBox=function(Q,m){var Z=q.applyTransform(Q,m),ee=q.applyTransform(Q.slice(2,4),m),oe=q.applyTransform([Q[0],Q[3]],m),fe=q.applyTransform([Q[2],Q[1]],m);return[Math.min(Z[0],ee[0],oe[0],fe[0]),Math.min(Z[1],ee[1],oe[1],fe[1]),Math.max(Z[0],ee[0],oe[0],fe[0]),Math.max(Z[1],ee[1],oe[1],fe[1])]},q.inverseTransform=function(Q){var m=Q[0]*Q[3]-Q[1]*Q[2];return[Q[3]/m,-Q[1]/m,-Q[2]/m,Q[0]/m,(Q[2]*Q[5]-Q[4]*Q[3])/m,(Q[4]*Q[1]-Q[5]*Q[0])/m]},q.apply3dTransform=function(Q,m){return[Q[0]*m[0]+Q[1]*m[1]+Q[2]*m[2],Q[3]*m[0]+Q[4]*m[1]+Q[5]*m[2],Q[6]*m[0]+Q[7]*m[1]+Q[8]*m[2]]},q.singularValueDecompose2dScale=function(Q){var m=[Q[0],Q[2],Q[1],Q[3]],Z=Q[0]*m[0]+Q[1]*m[2],ee=Q[0]*m[1]+Q[1]*m[3],oe=Q[2]*m[0]+Q[3]*m[2],fe=Q[2]*m[1]+Q[3]*m[3],me=(Z+fe)/2,pe=Math.sqrt((Z+fe)*(Z+fe)-4*(Z*fe-oe*ee))/2,Se=me+pe||1,xe=me-pe||1;return[Math.sqrt(Se),Math.sqrt(xe)]},q.normalizeRect=function(Q){var m=Q.slice(0);return Q[0]>Q[2]&&(m[0]=Q[2],m[2]=Q[0]),Q[1]>Q[3]&&(m[1]=Q[3],m[3]=Q[1]),m},q.intersect=function(Q,m){function Z(me,pe){return me-pe}var ee=[Q[0],Q[2],m[0],m[2]].sort(Z),oe=[Q[1],Q[3],m[1],m[3]].sort(Z),fe=[];if(Q=q.normalizeRect(Q),m=q.normalizeRect(m),ee[0]===Q[0]&&ee[1]===m[0]||ee[0]===m[0]&&ee[1]===Q[0])fe[0]=ee[1],fe[2]=ee[2];else return!1;if(oe[0]===Q[1]&&oe[1]===m[1]||oe[0]===m[1]&&oe[1]===Q[1])fe[1]=oe[1],fe[3]=oe[2];else return!1;return fe},q.sign=function(Q){return Q<0?-1:1},q.appendToArray=function(Q,m){Array.prototype.push.apply(Q,m)},q.prependToArray=function(Q,m){Array.prototype.unshift.apply(Q,m)},q.extendObj=function(Q,m){for(var Z in m)Q[Z]=m[Z]},q.getInheritableProperty=function(Q,m){for(;Q&&!Q.has(m);)Q=Q.get("Parent");return Q?Q.get(m):null},q.inherit=function(Q,m,Z){Q.prototype=Object.create(m.prototype),Q.prototype.constructor=Q;for(var ee in Z)Q.prototype[ee]=Z[ee]},q.loadScript=function(Q,m){var Z=document.createElement("script"),ee=!1;Z.setAttribute("src",Q),m&&(Z.onload=function(){ee||m(),ee=!0}),document.getElementsByTagName("head")[0].appendChild(Z)},q}();f.PageViewport=function(){function q(Y,X,Q,m,Z,ee){this.viewBox=Y,this.scale=X,this.rotation=Q,this.offsetX=m,this.offsetY=Z;var oe=(Y[2]+Y[0])/2,fe=(Y[3]+Y[1])/2,me,pe,Se,xe;switch(Q=Q%360,Q=Q<0?Q+360:Q,Q){case 180:me=-1,pe=0,Se=0,xe=1;break;case 90:me=0,pe=1,Se=1,xe=0;break;case 270:me=0,pe=-1,Se=-1,xe=0;break;default:me=1,pe=0,Se=0,xe=-1;break}ee&&(Se=-Se,xe=-xe);var we,Fe,De,Ze;me===0?(we=Math.abs(fe-Y[1])*X+m,Fe=Math.abs(oe-Y[0])*X+Z,De=Math.abs(Y[3]-Y[1])*X,Ze=Math.abs(Y[2]-Y[0])*X):(we=Math.abs(oe-Y[0])*X+m,Fe=Math.abs(fe-Y[1])*X+Z,De=Math.abs(Y[2]-Y[0])*X,Ze=Math.abs(Y[3]-Y[1])*X),this.transform=[me*X,pe*X,Se*X,xe*X,we-me*X*oe-Se*X*fe,Fe-pe*X*oe-xe*X*fe],this.width=De,this.height=Ze,this.fontScale=X}return q.prototype={clone:function(X){X=X||{};var Q="scale"in X?X.scale:this.scale,m="rotation"in X?X.rotation:this.rotation;return new q(this.viewBox.slice(),Q,m,this.offsetX,this.offsetY,X.dontFlip)},convertToViewportPoint:function(X,Q){return V.applyTransform([X,Q],this.transform)},convertToViewportRectangle:function(X){var Q=V.applyTransform([X[0],X[1]],this.transform),m=V.applyTransform([X[2],X[3]],this.transform);return[Q[0],Q[1],m[0],m[1]]},convertToPdfPoint:function(X,Q){return V.applyInverseTransform([X,Q],this.transform)}},q}();function b(){var W={};return W.promise=new Promise(function(q,Y){W.resolve=q,W.reject=Y}),W}f.createPromiseCapability=b,function(){if(c.Promise){typeof c.Promise.all!="function"&&(c.Promise.all=function(ee){var oe=0,fe=[],me,pe,Se=new c.Promise(function(xe,we){me=xe,pe=we});return ee.forEach(function(xe,we){oe++,xe.then(function(Fe){fe[we]=Fe,oe--,oe===0&&me(fe)},pe)}),oe===0&&me(fe),Se}),typeof c.Promise.resolve!="function"&&(c.Promise.resolve=function(ee){return new c.Promise(function(oe){oe(ee)})}),typeof c.Promise.reject!="function"&&(c.Promise.reject=function(ee){return new c.Promise(function(oe,fe){fe(ee)})}),typeof c.Promise.prototype.catch2!="function"&&(c.Promise.prototype.catch2=function(ee){return c.Promise.prototype.then(void 0,ee)});return}var q=0,Y=1,X=2,Q=500,m={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(oe){oe._status!==q&&(this.handlers=this.handlers.concat(oe._handlers),oe._handlers=[],!this.running&&(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var oe=1,fe=Date.now()+oe;this.handlers.length>0;){var me=this.handlers.shift(),pe=me.thisPromise._status,Se=me.thisPromise._value;try{pe===Y?typeof me.onResolve=="function"&&(Se=me.onResolve(Se)):typeof me.onReject=="function"&&(Se=me.onReject(Se),pe=Y,me.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(me.thisPromise))}catch(xe){pe=X,Se=xe}if(me.nextPromise._updateStatus(pe,Se),Date.now()>=fe)break}if(this.handlers.length>0){setTimeout(this.runHandlers.bind(this),0);return}this.running=!1},addUnhandledRejection:function(oe){this.unhandledRejections.push({promise:oe,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(oe){oe._unhandledRejection=!1;for(var fe=0;feQ){var pe=this.unhandledRejections[me].promise._value,Se="Unhandled rejection: "+pe;pe.stack&&(Se+=` `+pe.stack),A(Se),this.unhandledRejections.splice(me),me--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}).bind(this),Q))}};function Z(ee){this._status=q,this._handlers=[];try{ee.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(oe){this._reject(oe)}}Z.all=function(oe){var fe,me,pe=new Z(function(Ue,ye){fe=Ue,me=ye}),Se=oe.length,xe=[];if(Se===0)return fe(xe),pe;function we(Ue){pe._status!==X&&(xe=[],me(Ue))}for(var Fe=0,De=oe.length;Fe>2,xe=(fe&3)<<4|me>>4,we=ee+1>6:64,Fe=ee+2n in u?tA(u,n,{enumerable:!0,config SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */var CharLS=function(Module){Module=Module||{};var Module;Module||(Module=(typeof CharLS<"u"?CharLS:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof commonjsRequire=="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(n){process.stdout.write(n+` `)}),Module.printErr||(Module.printErr=function(n){process.stderr.write(n+` -`)});var nodeFS=require$$0,nodePath=require$$0;Module.read=function(n,s){n=nodePath.normalize(n);var c=nodeFS.readFileSync(n);return!c&&n!=nodePath.resolve(n)&&(n=path.join(__dirname,"..","src",n),c=nodeFS.readFileSync(n)),c&&!s&&(c=c.toString()),c},Module.readBinary=function(n){var s=Module.read(n,!0);return s.buffer||(s=new Uint8Array(s)),assert(s.buffer),s},Module.load=function(n){globalEval(read(n))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),module.exports=Module,process.on("uncaughtException",function(u){if(!(u instanceof ExitStatus))throw u}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),typeof printErr<"u"&&(Module.printErr=printErr),typeof read<"u"?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(n){if(typeof readbuffer=="function")return new Uint8Array(readbuffer(n));var s=read(n,"binary");return assert(typeof s=="object"),s},typeof scriptArgs<"u"?Module.arguments=scriptArgs:typeof arguments<"u"&&(Module.arguments=arguments);else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(Module.read=function(n){var s=new XMLHttpRequest;return s.open("GET",n,!1),s.send(null),s.responseText},typeof arguments<"u"&&(Module.arguments=arguments),typeof console<"u")Module.print||(Module.print=function(n){console.log(n)}),Module.printErr||(Module.printErr=function(n){console.log(n)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&typeof dump<"u"?function(u){dump(u)}:function(u){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),typeof Module.setWindowTitle>"u"&&(Module.setWindowTitle=function(u){document.title=u})}else throw"Unknown runtime environment. Where are we?";function globalEval(u){eval.call(null,u)}!Module.load&&Module.read&&(Module.load=function(n){globalEval(Module.read(n))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(u){tempRet0=u},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(u){STACKTOP=u},getNativeTypeSize:function(u){switch(u){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(u[u.length-1]==="*")return Runtime.QUANTUM_SIZE;if(u[0]==="i"){var n=parseInt(u.substr(1));return assert(n%8===0),n/8}else return 0}}},getNativeFieldSize:function(u){return Math.max(Runtime.getNativeTypeSize(u),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(u,n){return n==="double"||n==="i64"?u&7&&(assert((u&7)===4),u+=4):assert((u&3)===0),u},getAlignSize:function(u,n,s){return!s&&(u=="i64"||u=="double")?8:u?Math.min(n||(u?Runtime.getNativeFieldSize(u):0),Runtime.QUANTUM_SIZE):Math.min(n,8)},dynCall:function(u,n,s){return s&&s.length?(s.splice||(s=Array.prototype.slice.call(s)),s.splice(0,0,n),Module["dynCall_"+u].apply(null,s)):Module["dynCall_"+u].call(null,n)},functionPointers:[],addFunction:function(u){for(var n=0;n=TOTAL_MEMORY){var s=enlargeMemory();if(!s)return DYNAMICTOP=n,0}return n},alignMemory:function(u,n){var s=u=Math.ceil(u/(n||16))*(n||16);return s},makeBigInt:function(u,n,s){var c=s?+(u>>>0)+ +(n>>>0)*4294967296:+(u>>>0)+ +(n|0)*4294967296;return c},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=!1,tempDouble,tempI64,tempRet0;function assert(u,n){u||abort("Assertion failed: "+n)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(u){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}var cwrap,ccall;(function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(u){var n=Runtime.stackAlloc(u.length);return writeArrayToMemory(u,n),n},stringToC:function(u){var n=0;return u!=null&&u!==0&&(n=Runtime.stackAlloc((u.length<<2)+1),writeStringToMemory(u,n)),n}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(n,s,c,f,g){var A=getCFunc(n),v=[],y=0;if(f)for(var T=0;T>0]=n;break;case"i8":HEAP8[u>>0]=n;break;case"i16":HEAP16[u>>1]=n;break;case"i32":HEAP32[u>>2]=n;break;case"i64":tempI64=[n>>>0,(tempDouble=n,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[u>>2]=tempI64[0],HEAP32[u+4>>2]=tempI64[1];break;case"float":HEAPF32[u>>2]=n;break;case"double":HEAPF64[u>>3]=n;break;default:abort("invalid type for setValue: "+s)}}Module.setValue=setValue;function getValue(u,n,s){switch(n=n||"i8",n.charAt(n.length-1)==="*"&&(n="i32"),n){case"i1":return HEAP8[u>>0];case"i8":return HEAP8[u>>0];case"i16":return HEAP16[u>>1];case"i32":return HEAP32[u>>2];case"i64":return HEAP32[u>>2];case"float":return HEAPF32[u>>2];case"double":return HEAPF64[u>>3];default:abort("invalid type for setValue: "+n)}return null}Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE;function allocate(u,n,s,c){var f,g;typeof u=="number"?(f=!0,g=u):(f=!1,g=u.length);var A=typeof n=="string"?n:null,v;if(s==ALLOC_NONE?v=c:v=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][s===void 0?ALLOC_STATIC:s](Math.max(g,A?1:n.length)),f){var c=v,y;for(assert((v&3)==0),y=v+(g&-4);c>2]=0;for(y=v+g;c>0]=0;return v}if(A==="i8")return u.subarray||u.slice?HEAPU8.set(u,v):HEAPU8.set(new Uint8Array(u),v),v;for(var T=0,I,S,k;T>0],s|=c,!(c==0&&!n||(f++,n&&f==n)););n||(n=f);var g="";if(s<128){for(var A=1024,v;n>0;)v=String.fromCharCode.apply(String,HEAPU8.subarray(u,u+Math.min(n,A))),g=g?g+v:v,u+=A,n-=A;return g}return Module.UTF8ToString(u)}Module.Pointer_stringify=Pointer_stringify;function AsciiToString(u){for(var n="";;){var s=HEAP8[u++>>0];if(!s)return n;n+=String.fromCharCode(s)}}Module.AsciiToString=AsciiToString;function stringToAscii(u,n){return writeAsciiToMemory(u,n,!1)}Module.stringToAscii=stringToAscii;function UTF8ArrayToString(u,n){for(var s,c,f,g,A,v,y="";;){if(s=u[n++],!s)return y;if(!(s&128)){y+=String.fromCharCode(s);continue}if(c=u[n++]&63,(s&224)==192){y+=String.fromCharCode((s&31)<<6|c);continue}if(f=u[n++]&63,(s&240)==224?s=(s&15)<<12|c<<6|f:(g=u[n++]&63,(s&248)==240?s=(s&7)<<18|c<<12|f<<6|g:(A=u[n++]&63,(s&252)==248?s=(s&3)<<24|c<<18|f<<12|g<<6|A:(v=u[n++]&63,s=(s&1)<<30|c<<24|f<<18|g<<12|A<<6|v))),s<65536)y+=String.fromCharCode(s);else{var T=s-65536;y+=String.fromCharCode(55296|T>>10,56320|T&1023)}}}Module.UTF8ArrayToString=UTF8ArrayToString;function UTF8ToString(u){return UTF8ArrayToString(HEAPU8,u)}Module.UTF8ToString=UTF8ToString;function stringToUTF8Array(u,n,s,c){if(!(c>0))return 0;for(var f=s,g=s+c-1,A=0;A=55296&&v<=57343&&(v=65536+((v&1023)<<10)|u.charCodeAt(++A)&1023),v<=127){if(s>=g)break;n[s++]=v}else if(v<=2047){if(s+1>=g)break;n[s++]=192|v>>6,n[s++]=128|v&63}else if(v<=65535){if(s+2>=g)break;n[s++]=224|v>>12,n[s++]=128|v>>6&63,n[s++]=128|v&63}else if(v<=2097151){if(s+3>=g)break;n[s++]=240|v>>18,n[s++]=128|v>>12&63,n[s++]=128|v>>6&63,n[s++]=128|v&63}else if(v<=67108863){if(s+4>=g)break;n[s++]=248|v>>24,n[s++]=128|v>>18&63,n[s++]=128|v>>12&63,n[s++]=128|v>>6&63,n[s++]=128|v&63}else{if(s+5>=g)break;n[s++]=252|v>>30,n[s++]=128|v>>24&63,n[s++]=128|v>>18&63,n[s++]=128|v>>12&63,n[s++]=128|v>>6&63,n[s++]=128|v&63}}return n[s]=0,s-f}Module.stringToUTF8Array=stringToUTF8Array;function stringToUTF8(u,n,s){return stringToUTF8Array(u,HEAPU8,n,s)}Module.stringToUTF8=stringToUTF8;function lengthBytesUTF8(u){for(var n=0,s=0;s=55296&&c<=57343&&(c=65536+((c&1023)<<10)|u.charCodeAt(++s)&1023),c<=127?++n:c<=2047?n+=2:c<=65535?n+=3:c<=2097151?n+=4:c<=67108863?n+=5:n+=6}return n}Module.lengthBytesUTF8=lengthBytesUTF8;function UTF16ToString(u){for(var n=0,s="";;){var c=HEAP16[u+n*2>>1];if(c==0)return s;++n,s+=String.fromCharCode(c)}}Module.UTF16ToString=UTF16ToString;function stringToUTF16(u,n,s){if(s===void 0&&(s=2147483647),s<2)return 0;s-=2;for(var c=n,f=s>1]=A,n+=2}return HEAP16[n>>1]=0,n-c}Module.stringToUTF16=stringToUTF16;function lengthBytesUTF16(u){return u.length*2}Module.lengthBytesUTF16=lengthBytesUTF16;function UTF32ToString(u){for(var n=0,s="";;){var c=HEAP32[u+n*4>>2];if(c==0)return s;if(++n,c>=65536){var f=c-65536;s+=String.fromCharCode(55296|f>>10,56320|f&1023)}else s+=String.fromCharCode(c)}}Module.UTF32ToString=UTF32ToString;function stringToUTF32(u,n,s){if(s===void 0&&(s=2147483647),s<4)return 0;for(var c=n,f=c+s-4,g=0;g=55296&&A<=57343){var v=u.charCodeAt(++g);A=65536+((A&1023)<<10)|v&1023}if(HEAP32[n>>2]=A,n+=4,n+4>f)break}return HEAP32[n>>2]=0,n-c}Module.stringToUTF32=stringToUTF32;function lengthBytesUTF32(u){for(var n=0,s=0;s=55296&&c<=57343&&++s,n+=4}return n}Module.lengthBytesUTF32=lengthBytesUTF32;function demangle(u){var n=!!Module.___cxa_demangle;if(n)try{var s=_malloc(u.length);writeStringToMemory(u.substr(1),s);var c=_malloc(4),f=Module.___cxa_demangle(s,0,0,c);if(getValue(c,"i32")===0&&f)return Pointer_stringify(f)}catch{}finally{s&&_free(s),c&&_free(c),f&&_free(f)}var g=3,A={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},v=[],y=!0;function T(){g++,u[g]==="K"&&g++;for(var k=[];u[g]!=="E";){if(u[g]==="S"){g++;var e=u.indexOf("_",g),N=u.substring(g,e)||0;k.push(v[N]||"?"),g=e+1;continue}if(u[g]==="C"){k.push(k[k.length-1]),g+=2;continue}var M=parseInt(u.substr(g)),O=M.toString().length;if(!M||!O){g--;break}var z=u.substr(g+O,M);k.push(z),v.push(z),g+=O+M}return g++,k}function I(k,e,N){e=e||1/0;var M="",O=[];function z(){return"("+O.join(", ")+")"}var B;if(u[g]==="N"){if(B=T().join("::"),e--,e===0)return k?[B]:B}else{(u[g]==="K"||y&&u[g]==="L")&&g++;var V=parseInt(u.substr(g));if(V){var b=V.toString().length;B=u.substr(g+b,V),g+=b+V}}if(y=!1,u[g]==="I"){g++;var W=I(!0),q=I(!0,1,!0);M+=q[0]+" "+B+"<"+W.join(", ")+">"}else M=B;e:for(;g0;){var Y=u[g++];if(Y in A)O.push(A[Y]);else switch(Y){case"P":O.push(I(!0,1,!0)[0]+"*");break;case"R":O.push(I(!0,1,!0)[0]+"&");break;case"L":{g++;var X=u.indexOf("E",g),V=X-g;O.push(u.substr(g,V)),g+=V+2;break}case"A":{var V=parseInt(u.substr(g));if(g+=V.toString().length,u[g]!=="_")throw"?";g++,O.push(I(!0,1,!0)[0]+" ["+V+"]");break}case"E":break e;default:M+="?"+Y;break e}}return!N&&O.length===1&&O[0]==="void"&&(O=[]),k?(M&&O.push(M+"?"),O):M+z()}var S=u;try{if(u=="Object._main"||u=="_main")return"main()";if(typeof u=="number"&&(u=Pointer_stringify(u)),u[0]!=="_"||u[1]!=="_"||u[2]!=="Z")return u;switch(u[3]){case"n":return"operator new()";case"d":return"operator delete()"}S=I()}catch{S+="?"}return S.indexOf("?")>=0&&!n&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),S}function demangleAll(u){return u.replace(/__Z[\w\d_]+/g,function(n){var s=demangle(n);return n===s?n:n+" ["+s+"]"})}function jsStackTrace(){var u=new Error;if(!u.stack){try{throw new Error(0)}catch(n){u=n}if(!u.stack)return"(no stack trace available)"}return u.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}Module.stackTrace=stackTrace;var PAGE_SIZE=4096;function alignMemoryPage(u){return u%4096>0&&(u+=4096-u%4096),u}var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0;function enlargeMemory(){var u=Math.pow(2,31);if(DYNAMICTOP>=u)return!1;for(;TOTAL_MEMORY<=DYNAMICTOP;)if(TOTAL_MEMORY=u)return!1;try{if(ArrayBuffer.transfer)buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY);else{var s=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch{return!1}var c=_emscripten_replace_memory(buffer);return c?(Module.buffer=buffer,Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer),ArrayBuffer.transfer||HEAP8.set(s),!0):!1}var byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(u){byteLength=function(n){return n.byteLength}}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,totalMemory=64*1024;totalMemory0;){var n=u.shift();if(typeof n=="function"){n();continue}var s=n.func;typeof s=="number"?n.arg===void 0?Runtime.dynCall("v",s):Runtime.dynCall("vi",s,[n.arg]):s(n.arg===void 0?null:n.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(u){__ATPRERUN__.unshift(u)}Module.addOnPreRun=addOnPreRun;function addOnInit(u){__ATINIT__.unshift(u)}Module.addOnInit=addOnInit;function addOnPreMain(u){__ATMAIN__.unshift(u)}Module.addOnPreMain=addOnPreMain;function addOnExit(u){__ATEXIT__.unshift(u)}Module.addOnExit=addOnExit;function addOnPostRun(u){__ATPOSTRUN__.unshift(u)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(u,n,s){var c=s>0?s:lengthBytesUTF8(u)+1,f=new Array(c),g=stringToUTF8Array(u,f,0,f.length);return n&&(f.length=g),f}Module.intArrayFromString=intArrayFromString;function intArrayToString(u){for(var n=[],s=0;s255&&(c&=255),n.push(String.fromCharCode(c))}return n.join("")}Module.intArrayToString=intArrayToString;function writeStringToMemory(u,n,s){for(var c=intArrayFromString(u,s),f=0;f>0]=g,f=f+1}}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(u,n){for(var s=0;s>0]=u[s]}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(u,n,s){for(var c=0;c>0]=u.charCodeAt(c);s||(HEAP8[n>>0]=0)}Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function u(n,s){var c=n>>>16,f=n&65535,g=s>>>16,A=s&65535;return f*A+(c*A+f*g<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(u){u=u>>>0;for(var n=0;n<32;n++)if(u&1<<31-n)return n;return 32}),Math.clz32=Math.clz32;var Math_abs=Math.abs,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_min=Math.min,runDependencies=0,dependenciesFulfilled=null;function addRunDependency(u){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}Module.addRunDependency=addRunDependency;function removeRunDependency(u){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&dependenciesFulfilled){var n=dependenciesFulfilled;dependenciesFulfilled=null,n()}}Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={},STATIC_BASE=8,STATICTOP=STATIC_BASE+59744,__ATINIT__.push({func:function(){__GLOBAL__I_000101()}},{func:function(){__GLOBAL__sub_I_jpegls_cpp()}},{func:function(){}}),allocate([0,0,0,0,0,0,0,0,84,144,0,0,31,194,0,0,216,0,0,0,0,0,0,0,84,144,0,0,237,191,0,0,48,0,0,0,0,0,0,0,44,144,0,0,41,192,0,0,84,144,0,0,55,192,0,0,48,0,0,0,0,0,0,0,84,144,0,0,115,192,0,0,48,0,0,0,0,0,0,0,84,144,0,0,175,192,0,0,152,3,0,0,0,0,0,0,84,144,0,0,241,192,0,0,216,3,0,0,0,0,0,0,84,144,0,0,55,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,95,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,135,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,175,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,216,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,241,193,0,0,48,0,0,0,0,0,0,0,44,144,0,0,13,194,0,0,84,144,0,0,80,194,0,0,216,0,0,0,0,0,0,0,84,144,0,0,44,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,139,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,179,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,219,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,3,195,0,0,48,0,0,0,0,0,0,0,84,144,0,0,103,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,157,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,211,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,8,196,0,0,216,0,0,0,0,0,0,0,84,144,0,0,71,196,0,0,216,0,0,0,0,0,0,0,84,144,0,0,138,196,0,0,160,1,0,0,0,0,0,0,44,144,0,0,120,196,0,0,84,144,0,0,187,196,0,0,160,1,0,0,0,0,0,0,84,144,0,0,246,196,0,0,160,1,0,0,0,0,0,0,84,144,0,0,49,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,103,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,157,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,210,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,17,198,0,0,160,1,0,0,0,0,0,0,84,144,0,0,86,198,0,0,72,3,0,0,0,0,0,0,84,144,0,0,162,198,0,0,56,2,0,0,0,0,0,0,44,144,0,0,182,198,0,0,84,144,0,0,196,198,0,0,56,2,0,0,0,0,0,0,84,144,0,0,112,199,0,0,96,2,0,0,0,0,0,0,44,144,0,0,125,199,0,0,84,144,0,0,138,199,0,0,96,2,0,0,0,0,0,0,44,144,0,0,156,199,0,0,84,144,0,0,169,199,0,0,96,2,0,0,0,0,0,0,84,144,0,0,181,199,0,0,120,2,0,0,0,0,0,0,84,144,0,0,214,199,0,0,144,2,0,0,0,0,0,0,84,144,0,0,28,200,0,0,144,2,0,0,0,0,0,0,84,144,0,0,248,199,0,0,176,2,0,0,0,0,0,0,84,144,0,0,62,200,0,0,160,2,0,0,0,0,0,0,84,144,0,0,99,200,0,0,160,2,0,0,0,0,0,0,84,144,0,0,182,221,0,0,160,3,0,0,0,0,0,0,84,144,0,0,245,221,0,0,160,3,0,0,0,0,0,0,84,144,0,0,13,222,0,0,152,3,0,0,0,0,0,0,84,144,0,0,38,222,0,0,152,3,0,0,0,0,0,0,44,144,0,0,62,222,0,0,84,144,0,0,87,222,0,0,104,2,0,0,0,0,0,0,44,144,0,0,110,222,0,0,84,144,0,0,135,222,0,0,72,3,0,0,0,0,0,0,84,144,0,0,161,222,0,0,56,3,0,0,0,0,0,0,44,144,0,0,187,222,0,0,84,144,0,0,205,222,0,0,112,3,0,0,0,0,0,0,84,144,0,0,247,222,0,0,112,3,0,0,0,0,0,0,44,144,0,0,33,223,0,0,44,144,0,0,82,223,0,0,124,144,0,0,131,223,0,0,0,0,0,0,1,0,0,0,120,3,0,0,3,244,255,255,124,144,0,0,178,223,0,0,0,0,0,0,1,0,0,0,136,3,0,0,3,244,255,255,124,144,0,0,225,223,0,0,0,0,0,0,1,0,0,0,120,3,0,0,3,244,255,255,124,144,0,0,16,224,0,0,0,0,0,0,1,0,0,0,136,3,0,0,3,244,255,255,84,144,0,0,63,224,0,0,80,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,144,0,0,187,224,0,0,48,3,0,0,0,0,0,0,124,144,0,0,209,224,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,64,10,0,0,2,0,0,0,124,144,0,0,227,224,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,124,144,0,0,5,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,124,144,0,0,40,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,84,144,0,0,75,225,0,0,144,4,0,0,0,0,0,0,84,144,0,0,109,225,0,0,144,4,0,0,0,0,0,0,124,144,0,0,144,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,84,144,0,0,178,225,0,0,32,4,0,0,0,0,0,0,84,144,0,0,200,225,0,0,32,4,0,0,0,0,0,0,84,144,0,0,220,225,0,0,32,4,0,0,0,0,0,0,124,144,0,0,240,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,64,10,0,0,2,0,0,0,84,144,0,0,2,226,0,0,32,4,0,0,0,0,0,0,84,144,0,0,23,226,0,0,32,4,0,0,0,0,0,0,124,144,0,0,44,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,80,10,0,0,0,0,0,0,124,144,0,0,112,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,104,10,0,0,0,0,0,0,124,144,0,0,180,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,128,10,0,0,0,0,0,0,124,144,0,0,248,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,152,10,0,0,0,0,0,0,124,144,0,0,60,227,0,0,0,0,0,0,3,0,0,0,32,4,0,0,2,0,0,0,176,10,0,0,2,0,0,0,184,10,0,0,0,8,0,0,124,144,0,0,129,227,0,0,0,0,0,0,3,0,0,0,32,4,0,0,2,0,0,0,176,10,0,0,2,0,0,0,192,10,0,0,0,8,0,0,124,144,0,0,198,227,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,200,10,0,0,0,8,0,0,124,144,0,0,11,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,200,10,0,0,0,8,0,0,124,144,0,0,80,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,108,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,136,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,164,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,192,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,216,10,0,0,0,0,0,0,124,144,0,0,6,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,224,10,0,0,0,0,0,0,124,144,0,0,76,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,232,10,0,0,0,0,0,0,124,144,0,0,146,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,240,10,0,0,0,0,0,0,124,144,0,0,216,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,248,10,0,0,2,0,0,0,124,144,0,0,237,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,248,10,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,144,0,0,73,233,0,0,44,144,0,0,50,233,0,0,124,144,0,0,28,233,0,0,0,0,0,0,1,0,0,0,8,11,0,0,0,0,0,0,124,144,0,0,237,232,0,0,0,0,0,0,1,0,0,0,8,11,0,0,0,0,0,0,124,144,0,0,215,232,0,0,0,0,0,0,1,0,0,0,0,11,0,0,0,0,0,0,124,144,0,0,168,232,0,0,0,0,0,0,1,0,0,0,0,11,0,0,0,0,0,0,44,144,0,0,149,232,0,0,44,144,0,0,115,232,0,0,44,144,0,0,81,232,0,0,44,144,0,0,60,232,0,0,44,144,0,0,39,232,0,0,44,144,0,0,14,232,0,0,44,144,0,0,245,231,0,0,44,144,0,0,220,231,0,0,44,144,0,0,195,231,0,0,44,144,0,0,171,231,0,0,44,144,0,0,190,232,0,0,44,144,0,0,3,233],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE),allocate([156,143,0,0,0,0,0,0,8,2,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,248,1,0,0,3,0,0,0,4,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,232,1,0,0,5,0,0,0,6,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,216,1,0,0,7,0,0,0,8,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,200,1,0,0,9,0,0,0,10,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,0,0,0,0,184,1,0,0,11,0,0,0,12,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,0,0,0,0,168,1,0,0,13,0,0,0,14,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,144,1,0,0,15,0,0,0,16,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,128,1,0,0,17,0,0,0,18,0,0,0,9,0,0,0,1,0,0,0,9,0,0,0,0,0,0,0,112,1,0,0,19,0,0,0,20,0,0,0,10,0,0,0,2,0,0,0,10,0,0,0,0,0,0,0,96,1,0,0,21,0,0,0,22,0,0,0,11,0,0,0,3,0,0,0,11,0,0,0,0,0,0,0,80,1,0,0,23,0,0,0,24,0,0,0,12,0,0,0,4,0,0,0,12,0,0,0,0,0,0,0,64,1,0,0,25,0,0,0,26,0,0,0,13,0,0,0,5,0,0,0,13,0,0,0,0,0,0,0,240,0,0,0,27,0,0,0,28,0,0,0,14,0,0,0,6,0,0,0,14,0,0,0,0,0,0,0,224,0,0,0,29,0,0,0,30,0,0,0,15,0,0,0,7,0,0,0,15,0,0,0,0,0,0,0,16,0,0,0,31,0,0,0,32,0,0,0,16,0,0,0,8,0,0,0,16,0,0,0,0,0,0,0,200,0,0,0,33,0,0,0,34,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,184,0,0,0,33,0,0,0,35,0,0,0,3,0,0,0,4,0,0,0,56,0,0,0,0,0,0,0,216,3,0,0,36,0,0,0,37,0,0,0,200,255,255,255,200,255,255,255,216,3,0,0,38,0,0,0,39,0,0,0,56,0,0,0,0,0,0,0,104,0,0,0,40,0,0,0,41,0,0,0,200,255,255,255,200,255,255,255,104,0,0,0,42,0,0,0,43,0,0,0,0,0,0,0,88,0,0,0,44,0,0,0,45,0,0,0,17,0,0,0,1,0,0,0,1,0,0,0,5,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,17,0,0,0,3,0,0,0,18,0,0,0,104,141,0,0,64,141,0,0,84,141,0,0,124,141,0,0,0,0,0,0,32,0,0,0,46,0,0,0,47,0,0,0,6,0,0,0,7,0,0,0,0,0,0,0,56,0,0,0,48,0,0,0,49,0,0,0,8,0,0,0,9,0,0,0,0,0,0,0,72,0,0,0,50,0,0,0,51,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,120,0,0,0,52,0,0,0,53,0,0,0,12,0,0,0,13,0,0,0,0,0,0,0,136,0,0,0,54,0,0,0,55,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,152,0,0,0,56,0,0,0,57,0,0,0,16,0,0,0,17,0,0,0,0,0,0,0,168,0,0,0,58,0,0,0,59,0,0,0,18,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,216,0,0,0,60,0,0,0,61,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,62,0,0,0,63,0,0,0,20,0,0,0,21,0,0,0,0,0,0,0,16,1,0,0,64,0,0,0,65,0,0,0,22,0,0,0,23,0,0,0,0,0,0,0,32,1,0,0,66,0,0,0,67,0,0,0,24,0,0,0,25,0,0,0,0,0,0,0,48,1,0,0,68,0,0,0,69,0,0,0,26,0,0,0,27,0,0,0,0,0,0,0,160,1,0,0,70,0,0,0,71,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,24,2,0,0,72,0,0,0,73,0,0,0,5,0,0,0,1,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,0,0,0,0,40,2,0,0,74,0,0,0,75,0,0,0,18,0,0,0,0,0,0,0,64,2,0,0,76,0,0,0,77,0,0,0,19,0,0,0,2,0,0,0,0,0,0,0,80,2,0,0,78,0,0,0,79,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,104,2,0,0,80,0,0,0,81,0,0,0,7,0,0,0,0,0,0,0,128,2,0,0,82,0,0,0,83,0,0,0,8,0,0,0,0,0,0,0,160,2,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,2,0,0,0,9,0,0,0,28,0,0,0,0,0,0,0,208,2,0,0,84,0,0,0,88,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,3,0,0,0,10,0,0,0,29,0,0,0,0,0,0,0,224,2,0,0,84,0,0,0,89,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,4,0,0,0,11,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,1,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,88,146,0,0,200,146,0,0,56,147,0,0,56,147,0,0,120,187,0,0,168,155,0,0,168,149,0,0,0,0,0,0,10,0,0,0,100,0,0,0,232,3,0,0,16,39,0,0,160,134,1,0,64,66,15,0,128,150,152,0,0,225,245,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,9,0,0,0,159,219,0,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,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,9,0,0,0,151,215,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,9,0,0,0,143,211,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,48,0,0,0,49,0,0,0,50,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,57,0,0,0,58,0,0,0,59,0,0,0,60,0,0,0,61,0,0,0,62,0,0,0,63,0,0,0,64,0,0,0,65,0,0,0,66,0,0,0,67,0,0,0,68,0,0,0,69,0,0,0,70,0,0,0,71,0,0,0,72,0,0,0,73,0,0,0,74,0,0,0,75,0,0,0,76,0,0,0,77,0,0,0,78,0,0,0,79,0,0,0,80,0,0,0,81,0,0,0,82,0,0,0,83,0,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,88,0,0,0,89,0,0,0,90,0,0,0,91,0,0,0,92,0,0,0,93,0,0,0,94,0,0,0,95,0,0,0,96,0,0,0,65,0,0,0,66,0,0,0,67,0,0,0,68,0,0,0,69,0,0,0,70,0,0,0,71,0,0,0,72,0,0,0,73,0,0,0,74,0,0,0,75,0,0,0,76,0,0,0,77,0,0,0,78,0,0,0,79,0,0,0,80,0,0,0,81,0,0,0,82,0,0,0,83,0,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,88,0,0,0,89,0,0,0,90,0,0,0,123,0,0,0,124,0,0,0,125,0,0,0,126,0,0,0,127],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+35640),allocate([1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,48,0,0,0,49,0,0,0,50,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,57,0,0,0,58,0,0,0,59,0,0,0,60,0,0,0,61,0,0,0,62,0,0,0,63,0,0,0,64,0,0,0,97,0,0,0,98,0,0,0,99,0,0,0,100,0,0,0,101,0,0,0,102,0,0,0,103,0,0,0,104,0,0,0,105,0,0,0,106,0,0,0,107,0,0,0,108,0,0,0,109,0,0,0,110,0,0,0,111,0,0,0,112,0,0,0,113,0,0,0,114,0,0,0,115,0,0,0,116,0,0,0,117,0,0,0,118,0,0,0,119,0,0,0,120,0,0,0,121,0,0,0,122,0,0,0,91,0,0,0,92,0,0,0,93,0,0,0,94,0,0,0,95,0,0,0,96,0,0,0,97,0,0,0,98,0,0,0,99,0,0,0,100,0,0,0,101,0,0,0,102,0,0,0,103,0,0,0,104,0,0,0,105,0,0,0,106,0,0,0,107,0,0,0,108,0,0,0,109,0,0,0,110,0,0,0,111,0,0,0,112,0,0,0,113,0,0,0,114,0,0,0,115,0,0,0,116,0,0,0,117,0,0,0,118,0,0,0,119,0,0,0,120,0,0,0,121,0,0,0,122,0,0,0,123,0,0,0,124,0,0,0,125,0,0,0,126,0,0,0,127],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+39844),allocate([240,2,0,0,90,0,0,0,91,0,0,0,20,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,10,0,0,0,11,0,0,0,13,0,0,0,12,0,0,0,13,0,0,0,19,0,0,0,14,0,0,0,20,0,0,0,0,0,0,0,0,3,0,0,90,0,0,0,92,0,0,0,21,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,14,0,0,0,11,0,0,0,13,0,0,0,15,0,0,0,16,0,0,0,21,0,0,0,15,0,0,0,22,0,0,0,0,0,0,0,16,3,0,0,93,0,0,0,94,0,0,0,22,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,17,0,0,0,2,0,0,0,2,0,0,0,18,0,0,0,4,0,0,0,23,0,0,0,16,0,0,0,24,0,0,0,0,0,0,0,32,3,0,0,93,0,0,0,95,0,0,0,23,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,19,0,0,0,20,0,0,0,25,0,0,0,3,0,0,0,26,0,0,0,0,0,0,0,56,3,0,0,96,0,0,0,97,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,3,0,0,93,0,0,0,98,0,0,0,17,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,18,0,0,0,4,0,0,0,23,0,0,0,3,0,0,0,26,0,0,0,0,0,0,0,160,3,0,0,90,0,0,0,99,0,0,0,24,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,14,0,0,0,11,0,0,0,13,0,0,0,12,0,0,0,13,0,0,0,19,0,0,0,15,0,0,0,22,0,0,0,8,0,0,0,0,0,0,0,168,3,0,0,100,0,0,0,101,0,0,0,248,255,255,255,248,255,255,255,168,3,0,0,102,0,0,0,103,0,0,0,8,0,0,0,0,0,0,0,192,3,0,0,104,0,0,0,105,0,0,0,248,255,255,255,248,255,255,255,192,3,0,0,106,0,0,0,107,0,0,0,4,0,0,0,0,0,0,0,216,3,0,0,36,0,0,0,37,0,0,0,252,255,255,255,252,255,255,255,216,3,0,0,38,0,0,0,39,0,0,0,4,0,0,0,0,0,0,0,240,3,0,0,108,0,0,0,109,0,0,0,252,255,255,255,252,255,255,255,240,3,0,0,110,0,0,0,111,0,0,0,0,0,0,0,96,3,0,0,112,0,0,0,113,0,0,0,7,0,0,0,0,0,0,0,112,3,0,0,114,0,0,0,115,0,0,0,0,0,0,0,8,4,0,0,72,0,0,0,116,0,0,0,21,0,0,0,1,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,117,0,0,0,118,0,0,0,119,0,0,0,1,0,0,0,33,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,5,0,0,120,0,0,0,121,0,0,0,119,0,0,0,2,0,0,0,34,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,5,0,0,122,0,0,0,123,0,0,0,119,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,5,0,0,124,0,0,0,125,0,0,0,119,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,5,0,0,126,0,0,0,127,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,23,0,0,0,5,0,0,0,24,0,0,0,1,0,0,0,2,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,5,0,0,128,0,0,0,129,0,0,0,119,0,0,0,7,0,0,0,8,0,0,0,25,0,0,0,9,0,0,0,26,0,0,0,3,0,0,0,4,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,5,0,0,130,0,0,0,131,0,0,0,119,0,0,0,22,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,1,0,0,0,248,255,255,255,224,5,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,6,0,0,132,0,0,0,133,0,0,0,119,0,0,0,30,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,2,0,0,0,248,255,255,255,8,6,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,6,0,0,134,0,0,0,135,0,0,0,119,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,6,0,0,136,0,0,0,137,0,0,0,119,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,6,0,0,138,0,0,0,139,0,0,0,119,0,0,0,38,0,0,0,39,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,40,0,0,0,29,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,6,0,0,140,0,0,0,141,0,0,0,119,0,0,0,41,0,0,0,42,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,43,0,0,0,35,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,6,0,0,142,0,0,0,143,0,0,0,119,0,0,0,44,0,0,0,45,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,46,0,0,0,41,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,6,0,0,144,0,0,0,145,0,0,0,119,0,0,0,47,0,0,0,48,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,49,0,0,0,47,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,6,0,0,146,0,0,0,147,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,7,0,0,148,0,0,0,149,0,0,0,119,0,0,0,5,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,7,0,0,150,0,0,0,151,0,0,0,119,0,0,0,1,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,7,0,0,152,0,0,0,153,0,0,0,119,0,0,0,2,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,7,0,0,154,0,0,0,155,0,0,0,119,0,0,0,19,0,0,0,7,0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,7,0,0,156,0,0,0,157,0,0,0,119,0,0,0,20,0,0,0,8,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,4,0,0,158,0,0,0,159,0,0,0,119,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,5,0,0,160,0,0,0,161,0,0,0,119,0,0,0,27,0,0,0,21,0,0,0,28,0,0,0,22,0,0,0,29,0,0,0,9,0,0,0,23,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,4,0,0,162,0,0,0,163,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,12,0,0,0,50,0,0,0,51,0,0,0,13,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,5,0,0,164,0,0,0,165,0,0,0,119,0,0,0,53,0,0,0,54,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,0,0,0,0,80,5,0,0,166,0,0,0,167,0,0,0,119,0,0,0,55,0,0,0,56,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,0,0,0,0,32,4,0,0,168,0,0,0,169,0,0,0,119,0,0,0,0,0,0,0,48,4,0,0,168,0,0,0,170,0,0,0,119,0,0,0,24,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,30,0,0,0,25,0,0,0,31,0,0,0,26,0,0,0,32,0,0,0,13,0,0,0,27,0,0,0,14,0,0,0,0,0,0,0,80,4,0,0,168,0,0,0,171,0,0,0,119,0,0,0,5,0,0,0,6,0,0,0,15,0,0,0,57,0,0,0,58,0,0,0,16,0,0,0,59,0,0,0,0,0,0,0,112,4,0,0,168,0,0,0,172,0,0,0,119,0,0,0,7,0,0,0,8,0,0,0,17,0,0,0,60,0,0,0,61,0,0,0,18,0,0,0,62,0,0,0,0,0,0,0,144,4,0,0,168,0,0,0,173,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,176,4,0,0,168,0,0,0,174,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,192,4,0,0,168,0,0,0,175,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,37,0,0,0,89,0,0,0,45,0,0,0,37,0,0,0,109,0,0,0,45,0,0,0,37,0,0,0,100,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,0,0,0,114,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,102,0,0,0,97,0,0,0,108,0,0,0,115,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,110,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,114,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,117,0,0,0,114,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,114,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,99,0,0,0,104,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,105,0,0,0,108,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,101,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,121,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,117,0,0,0,115,0,0,0,116,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,116,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,111,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,77,0,0,0,0,0,0,0,80,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,97,0,0,0,32,0,0,0,37,0,0,0,98,0,0,0,32,0,0,0,37,0,0,0,100,0,0,0,32,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,3,32,2,32,2,32,2,32,2,32,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,1,96,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,4,192,4,192,4,192,4,192,4,192,4,192,4,192,8,213,8,213,8,213,8,213,8,213,8,213,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,4,192,4,192,4,192,4,192,4,192,4,192,8,214,8,214,8,214,8,214,8,214,8,214,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,4,192,4,192,4,192,4,192,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,97,119,83,116,114,101,97,109,32,111,114,32,114,97,119,68,97,116,97,32,110,101,101,100,115,32,116,111,32,114,101,102,101,114,101,110,99,101,32,116,111,32,115,111,109,101,116,104,105,110,103,0,119,105,100,116,104,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,54,53,53,51,53,93,0,104,101,105,103,104,116,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,54,53,53,51,53,93,0,98,105,116,115,112,101,114,115,97,109,112,108,101,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,50,44,32,49,54,93,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,110,101,101,100,115,32,116,111,32,98,101,32,115,101,116,32,116,111,32,97,32,118,97,108,117,101,32,111,102,32,123,78,111,110,101,44,32,83,97,109,112,108,101,44,32,76,105,110,101,125,0,99,111,109,112,111,110,101,110,116,115,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,50,53,53,93,0,117,110,99,111,109,112,114,101,115,115,101,100,32,115,105,122,101,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,119,105,116,104,32,116,104,101,32,111,116,104,101,114,32,112,97,114,97,109,101,116,101,114,115,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,99,97,110,110,111,116,32,98,101,32,115,101,116,32,116,111,32,83,97,109,112,108,101,32,105,110,32,99,111,109,98,105,110,97,116,105,111,110,32,119,105,116,104,32,99,111,109,112,111,110,101,110,116,115,32,61,32,52,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,99,97,110,32,111,110,108,121,32,98,101,32,115,101,116,32,116,111,32,78,111,110,101,32,105,110,32,99,111,109,98,105,110,97,116,105,111,110,32,119,105,116,104,32,99,111,109,112,111,110,101,110,116,115,32,61,32,49,0,67,111,108,111,114,32,116,114,97,110,115,102,111,114,109,97,116,105,111,110,32,0,78,111,32,109,111,114,101,32,98,121,116,101,115,32,97,118,97,105,108,97,98,108,101,32,105,110,32,105,110,112,117,116,32,98,117,102,102,101,114,44,32,115,116,105,108,108,32,110,101,101,100,101,100,105,110,103,32,0,65,110,32,111,100,100,32,110,117,109,98,101,114,32,111,102,32,98,121,116,101,115,32,40,0,41,32,99,97,110,110,111,116,32,98,101,32,115,119,97,112,112,101,100,46,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,116,69,69,69,0,49,49,80,114,111,99,101,115,115,76,105,110,101,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,116,69,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,116,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,105,110,103,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,78,83,95,57,97,108,108,111,99,97,116,111,114,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,57,98,97,115,105,99,95,111,115,116,114,105,110,103,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,78,83,95,57,97,108,108,111,99,97,116,111,114,73,99,69,69,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,51,84,114,97,110,115,102,111,114,109,78,111,110,101,73,116,69,69,0,50,50,80,111,115,116,80,114,111,99,101,115,83,105,110,103,108,101,83,116,114,101,97,109,0,50,53,80,111,115,116,80,114,111,99,101,115,83,105,110,103,108,101,67,111,109,112,111,110,101,110,116,0,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,116,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,55,84,114,105,112,108,101,116,73,116,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,51,84,114,97,110,115,102,111,114,109,78,111,110,101,73,104,69,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,55,84,114,105,112,108,101,116,73,104,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,54,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,50,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,104,76,105,56,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,55,84,114,105,112,108,101,116,73,104,69,76,105,56,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,104,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,116,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,55,84,114,105,112,108,101,116,73,116,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,55,84,114,105,112,108,101,116,73,104,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,54,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,50,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,104,76,105,56,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,55,84,114,105,112,108,101,116,73,104,69,76,105,56,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,104,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,67,104,97,114,76,83,32,101,114,114,111,114,0,99,104,97,114,108,115,0,49,53,99,104,97,114,108,115,95,99,97,116,101,103,111,114,121,0,112,97,114,97,109,115,46,88,116,104,117,109,98,110,97,105,108,32,105,115,32,62,32,48,32,98,117,116,32,112,97,114,97,109,115,46,116,104,117,109,98,110,97,105,108,32,61,61,32,110,117,108,108,95,112,116,114,0,49,55,74,112,101,103,77,97,114,107,101,114,83,101,103,109,101,110,116,0,49,49,74,112,101,103,83,101,103,109,101,110,116,0,50,48,74,112,101,103,73,109,97,103,101,68,97,116,97,83,101,103,109,101,110,116,0,69,120,112,101,99,116,101,100,32,74,80,69,71,32,77,97,114,107,101,114,32,115,116,97,114,116,32,98,121,116,101,32,48,120,70,70,32,98,117,116,32,116,104,101,32,98,121,116,101,32,118,97,108,117,101,32,119,97,115,32,48,120,0,74,80,69,71,32,101,110,99,111,100,105,110,103,32,119,105,116,104,32,109,97,114,107,101,114,32,0,32,105,115,32,110,111,116,32,115,117,112,112,111,114,116,101,100,46,0,85,110,107,110,111,119,110,32,74,80,69,71,32,109,97,114,107,101,114,32,0,32,101,110,99,111,117,110,116,101,114,101,100,46,0,109,114,102,120,0,83,116,57,98,97,100,95,97,108,108,111,99,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,49,51,114,117,110,116,105,109,101,95,101,114,114,111,114,0,83,116,57,116,121,112,101,95,105,110,102,111,0,83,116,56,98,97,100,95,99,97,115,116,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,49,95,95,118,109,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,33,34,98,97,115,105,99,95,115,116,114,105,110,103,32,108,101,110,103,116,104,95,101,114,114,111,114,34,0,47,85,115,101,114,115,47,99,104,97,102,101,121,47,101,109,115,100,107,95,112,111,114,116,97,98,108,101,47,101,109,115,99,114,105,112,116,101,110,47,49,46,51,53,46,48,47,115,121,115,116,101,109,47,105,110,99,108,117,100,101,47,108,105,98,99,120,120,47,115,116,114,105,110,103,0,95,95,116,104,114,111,119,95,108,101,110,103,116,104,95,101,114,114,111,114,0,33,34,118,101,99,116,111,114,32,108,101,110,103,116,104,95,101,114,114,111,114,34,0,47,85,115,101,114,115,47,99,104,97,102,101,121,47,101,109,115,100,107,95,112,111,114,116,97,98,108,101,47,101,109,115,99,114,105,112,116,101,110,47,49,46,51,53,46,48,47,115,121,115,116,101,109,47,105,110,99,108,117,100,101,47,108,105,98,99,120,120,47,118,101,99,116,111,114,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,115,116,100,58,58,98,97,100,95,97,108,108,111,99,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,116,104,114,101,119,32,97,110,32,101,120,99,101,112,116,105,111,110,0,115,116,100,58,58,98,97,100,95,99,97,115,116,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+42396),allocate([32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,105,110,102,105,110,105,116,121,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,255,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,4,7,3,6,5,0,80,79,83,73,88],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+52636),allocate([17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,119,69,69,0,117,110,115,117,112,112,111,114,116,101,100,32,108,111,99,97,108,101,32,102,111,114,32,115,116,97,110,100,97,114,100,32,105,110,112,117,116,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,99,69,69,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,99,69,69,0,78,83,116,51,95,95,49,49,52,95,95,115,104,97,114,101,100,95,99,111,117,110,116,69,0,78,83,116,51,95,95,49,49,50,115,121,115,116,101,109,95,101,114,114,111,114,69,0,78,83,116,51,95,95,49,49,52,101,114,114,111,114,95,99,97,116,101,103,111,114,121,69,0,78,83,116,51,95,95,49,49,50,95,95,100,111,95,109,101,115,115,97,103,101,69,0,58,32,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,55,102,97,105,108,117,114,101,69,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,57,95,95,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,69,0,105,111,115,95,98,97,115,101,58,58,99,108,101,97,114,0,105,111,115,116,114,101,97,109,0,117,110,115,112,101,99,105,102,105,101,100,32,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,32,101,114,114,111,114,0,48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102,65,66,67,68,69,70,120,88,43,45,112,80,105,73,110,78,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,102,97,99,101,116,69,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,119,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,99,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,115,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,105,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,49,54,95,95,110,97,114,114,111,119,95,116,111,95,117,116,102,56,73,76,106,51,50,69,69,69,0,78,83,116,51,95,95,49,49,55,95,95,119,105,100,101,110,95,102,114,111,109,95,117,116,102,56,73,76,106,51,50,69,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,119,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,95,95,105,109,112,69,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,99,69,69,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,119,69,69,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,99,69,69,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,99,69,69,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,119,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,48,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,49,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,48,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,49,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,99,69,69,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,119,69,69,0,37,112,0,67,0,37,0,0,0,0,0,108,0,108,108,0,0,76,0,37,112,0,0,0,0,37,72,58,37,77,58,37,83,37,109,47,37,100,47,37,121,37,89,45,37,109,45,37,100,37,73,58,37,77,58,37,83,32,37,112,37,72,58,37,77,37,72,58,37,77,58,37,83,108,111,99,97,108,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,48,49,50,51,52,53,54,55,56,57,0,37,76,102,0,109,111,110,101,121,95,103,101,116,32,101,114,114,111,114,0,48,49,50,51,52,53,54,55,56,57,0,37,46,48,76,102,0,116,114,117,101,0,102,97,108,115,101,0,83,117,110,100,97,121,0,77,111,110,100,97,121,0,84,117,101,115,100,97,121,0,87,101,100,110,101,115,100,97,121,0,84,104,117,114,115,100,97,121,0,70,114,105,100,97,121,0,83,97,116,117,114,100,97,121,0,83,117,110,0,77,111,110,0,84,117,101,0,87,101,100,0,84,104,117,0,70,114,105,0,83,97,116,0,74,97,110,117,97,114,121,0,70,101,98,114,117,97,114,121,0,77,97,114,99,104,0,65,112,114,105,108,0,77,97,121,0,74,117,110,101,0,74,117,108,121,0,65,117,103,117,115,116,0,83,101,112,116,101,109,98,101,114,0,79,99,116,111,98,101,114,0,78,111,118,101,109,98,101,114,0,68,101,99,101,109,98,101,114,0,74,97,110,0,70,101,98,0,77,97,114,0,65,112,114,0,74,117,110,0,74,117,108,0,65,117,103,0,83,101,112,0,79,99,116,0,78,111,118,0,68,101,99,0,65,77,0,80,77,0,37,109,47,37,100,47,37,121,0,37,72,58,37,77,58,37,83,0,37,97,32,37,98,32,37,100,32,37,72,58,37,77,58,37,83,32,37,89,0,37,73,58,37,77,58,37,83,32,37,112,0,78,83,116,51,95,95,49,49,51,109,101,115,115,97,103,101,115,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,99,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,99,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,48,95,95,116,105,109,101,95,112,117,116,69,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,119,69,69,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,99,69,69,0,78,83,116,51,95,95,49,57,116,105,109,101,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,119,69,69,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,112,117,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,99,69,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,119,69,69,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,103,101,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,99,69,69,0,78,83,116,51,95,95,49,49,50,99,111,100,101,99,118,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,48,99,116,121,112,101,95,98,97,115,101,69,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+56215);var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);function _atexit(u,n){__ATEXIT__.unshift({func:u,arg:n})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}Module._i64Subtract=_i64Subtract;function ___assert_fail(u,n,s,c){throw ABORT=!0,"Assertion failed: "+Pointer_stringify(u)+", at: "+[n?Pointer_stringify(n):"unknown filename",s,c?Pointer_stringify(c):"unknown function"]+" at "+stackTrace()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(u){if(!u||EXCEPTIONS.infos[u])return u;for(var n in EXCEPTIONS.infos){var s=EXCEPTIONS.infos[n];if(s.adjusted===u)return n}return u},addRef:function(u){if(u){var n=EXCEPTIONS.infos[u];n.refcount++}},decRef:function(u){if(u){var n=EXCEPTIONS.infos[u];assert(n.refcount>0),n.refcount--,n.refcount===0&&(n.destructor&&Runtime.dynCall("vi",n.destructor,[u]),delete EXCEPTIONS.infos[u],___cxa_free_exception(u))}},clearRef:function(u){if(u){var n=EXCEPTIONS.infos[u];n.refcount=0}}};function ___resumeException(u){throw EXCEPTIONS.last||(EXCEPTIONS.last=u),EXCEPTIONS.clearRef(EXCEPTIONS.deAdjust(u)),u}function ___cxa_find_matching_catch(){var u=EXCEPTIONS.last;if(!u)return asm.setTempRet0(0),0|0;var n=EXCEPTIONS.infos[u],s=n.type;if(!s)return asm.setTempRet0(0),u|0;var c=Array.prototype.slice.call(arguments);Module.___cxa_is_pointer_type(s),___cxa_find_matching_catch.buffer||(___cxa_find_matching_catch.buffer=_malloc(4)),HEAP32[___cxa_find_matching_catch.buffer>>2]=u,u=___cxa_find_matching_catch.buffer;for(var f=0;f>2],n.adjusted=u,asm.setTempRet0(c[f]),u|0;return u=HEAP32[u>>2],asm.setTempRet0(s),u|0}function ___cxa_throw(u,n,s){throw EXCEPTIONS.infos[u]={ptr:u,adjusted:u,type:n,destructor:s,refcount:0},EXCEPTIONS.last=u,"uncaught_exception"in __ZSt18uncaught_exceptionv?__ZSt18uncaught_exceptionv.uncaught_exception++:__ZSt18uncaught_exceptionv.uncaught_exception=1,u}Module._memset=_memset;function ___gxx_personality_v0(){}function __isLeapYear(u){return u%4===0&&(u%100!==0||u%400===0)}function __arraySum(u,n){for(var s=0,c=0;c<=n;s+=u[c++]);return s}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],__MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(u,n){for(var s=new Date(u.getTime());n>0;){var c=__isLeapYear(s.getFullYear()),f=s.getMonth(),g=(c?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[f];if(n>g-s.getDate())n-=g-s.getDate()+1,s.setDate(1),f<11?s.setMonth(f+1):(s.setMonth(0),s.setFullYear(s.getFullYear()+1));else return s.setDate(s.getDate()+n),s}return s}function _strftime(u,n,s,c){var f=HEAP32[c+40>>2],g={tm_sec:HEAP32[c>>2],tm_min:HEAP32[c+4>>2],tm_hour:HEAP32[c+8>>2],tm_mday:HEAP32[c+12>>2],tm_mon:HEAP32[c+16>>2],tm_year:HEAP32[c+20>>2],tm_wday:HEAP32[c+24>>2],tm_yday:HEAP32[c+28>>2],tm_isdst:HEAP32[c+32>>2],tm_gmtoff:HEAP32[c+36>>2],tm_zone:f?Pointer_stringify(f):""},A=Pointer_stringify(s),v={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S"};for(var y in v)A=A.replace(new RegExp(y,"g"),v[y]);var T=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],I=["January","February","March","April","May","June","July","August","September","October","November","December"];function S(B,V,b){for(var W=typeof B=="number"?B.toString():B||"";W.length0?1:0}var W;return(W=b(B.getFullYear()-V.getFullYear()))===0&&(W=b(B.getMonth()-V.getMonth()))===0&&(W=b(B.getDate()-V.getDate())),W}function N(B){switch(B.getDay()){case 0:return new Date(B.getFullYear()-1,11,29);case 1:return B;case 2:return new Date(B.getFullYear(),0,3);case 3:return new Date(B.getFullYear(),0,2);case 4:return new Date(B.getFullYear(),0,1);case 5:return new Date(B.getFullYear()-1,11,31);case 6:return new Date(B.getFullYear()-1,11,30)}}function M(B){var V=__addDays(new Date(B.tm_year+1900,0,1),B.tm_yday),b=new Date(V.getFullYear(),0,4),W=new Date(V.getFullYear()+1,0,4),q=N(b),Y=N(W);return e(q,V)<=0?e(Y,V)<=0?V.getFullYear()+1:V.getFullYear():V.getFullYear()-1}var O={"%a":function(B){return T[B.tm_wday].substring(0,3)},"%A":function(B){return T[B.tm_wday]},"%b":function(B){return I[B.tm_mon].substring(0,3)},"%B":function(B){return I[B.tm_mon]},"%C":function(B){var V=B.tm_year+1900;return k(V/100|0,2)},"%d":function(B){return k(B.tm_mday,2)},"%e":function(B){return S(B.tm_mday,2," ")},"%g":function(B){return M(B).toString().substring(2)},"%G":function(B){return M(B)},"%H":function(B){return k(B.tm_hour,2)},"%I":function(B){return k(B.tm_hour<13?B.tm_hour:B.tm_hour-12,2)},"%j":function(B){return k(B.tm_mday+__arraySum(__isLeapYear(B.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,B.tm_mon-1),3)},"%m":function(B){return k(B.tm_mon+1,2)},"%M":function(B){return k(B.tm_min,2)},"%n":function(){return` -`},"%p":function(B){return B.tm_hour>0&&B.tm_hour<13?"AM":"PM"},"%S":function(B){return k(B.tm_sec,2)},"%t":function(){return" "},"%u":function(B){var V=new Date(B.tm_year+1900,B.tm_mon+1,B.tm_mday,0,0,0,0);return V.getDay()||7},"%U":function(B){var V=new Date(B.tm_year+1900,0,1),b=V.getDay()===0?V:__addDays(V,7-V.getDay()),W=new Date(B.tm_year+1900,B.tm_mon,B.tm_mday);if(e(b,W)<0){var q=__arraySum(__isLeapYear(W.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,W.getMonth()-1)-31,Y=31-b.getDate(),X=Y+q+W.getDate();return k(Math.ceil(X/7),2)}return e(b,V)===0?"01":"00"},"%V":function(B){var V=new Date(B.tm_year+1900,0,4),b=new Date(B.tm_year+1901,0,4),W=N(V),q=N(b),Y=__addDays(new Date(B.tm_year+1900,0,1),B.tm_yday);if(e(Y,W)<0)return"53";if(e(q,Y)<=0)return"01";var X;return W.getFullYear()=0;return V=Math.abs(V)/60,V=V/60*100+V%60,(b?"+":"-")+("0000"+V).slice(-4)},"%Z":function(B){return B.tm_zone},"%%":function(){return"%"}};for(var y in O)A.indexOf(y)>=0&&(A=A.replace(new RegExp(y,"g"),O[y](g)));var z=intArrayFromString(A,!1);return z.length>n?0:(writeArrayToMemory(z,u),z.length-1)}function _strftime_l(u,n,s,c){return _strftime(u,n,s,c)}function _abort(){Module.abort()}function _free(){}Module._free=_free;function ___cxa_free_exception(u){try{return _free(u)}catch{}}function ___cxa_end_catch(){if(___cxa_end_catch.rethrown){___cxa_end_catch.rethrown=!1;return}asm.setThrew(0);var u=EXCEPTIONS.caught.pop();u&&(EXCEPTIONS.decRef(EXCEPTIONS.deAdjust(u)),EXCEPTIONS.last=0)}function _pthread_once(u,n){_pthread_once.seen||(_pthread_once.seen={}),!(u in _pthread_once.seen)&&(Runtime.dynCall("v",n),_pthread_once.seen[u]=1)}function ___lock(){}function ___unlock(){}var PTHREAD_SPECIFIC={};function _pthread_getspecific(u){return PTHREAD_SPECIFIC[u]||0}function ___setErrNo(u){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=u),u}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _sysconf(u){switch(u){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return ___setErrNo(ERRNO_CODES.EINVAL),-1}var _fabs=Math_abs,PTHREAD_SPECIFIC_NEXT_KEY=1;function _pthread_key_create(u,n){return u==0?ERRNO_CODES.EINVAL:(HEAP32[u>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function _emscripten_set_main_loop_timing(u,n){if(Browser.mainLoop.timingMode=u,Browser.mainLoop.timingValue=n,!Browser.mainLoop.func)return 1;if(u==0)Browser.mainLoop.scheduler=function(){setTimeout(Browser.mainLoop.runner,n)},Browser.mainLoop.method="timeout";else if(u==1)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(u==2){if(!window.setImmediate){let g=function(A){A.source===window&&A.data===c&&(A.stopPropagation(),s.shift()())};var f=g,s=[],c="__emcc";window.addEventListener("message",g,!0),window.setImmediate=function(v){s.push(v),window.postMessage(c,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(u,n,s,c,f){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=u,Browser.mainLoop.arg=c;var g=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var v=Date.now(),y=Browser.mainLoop.queue.shift();if(y.func(y.arg),Browser.mainLoop.remainingBlockers){var T=Browser.mainLoop.remainingBlockers,I=T%1==0?T-1:Math.floor(T);y.counted?Browser.mainLoop.remainingBlockers=I:(I=I+.5,Browser.mainLoop.remainingBlockers=(8*T+I)/9)}console.log('main loop blocker "'+y.name+'" took '+(Date.now()-v)+" ms"),Browser.mainLoop.updateStatus(),setTimeout(Browser.mainLoop.runner,0);return}if(!(g1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}Browser.mainLoop.method==="timeout"&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(function(){typeof c<"u"?Runtime.dynCall("vi",u,[c]):Runtime.dynCall("v",u)}),!(g0?_emscripten_set_main_loop_timing(0,1e3/n):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),s)throw"SimulateInfiniteLoop"}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var u=Browser.mainLoop.timingMode,n=Browser.mainLoop.timingValue,s=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(s,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(u,n),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var u=Module.statusMessage||"Please wait...",n=Browser.mainLoop.remainingBlockers,s=Browser.mainLoop.expectedBlockers;n?n"u"&&(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var u={};u.canHandle=function(g){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(g)},u.handle=function(g,A,v,y){var T=null;if(Browser.hasBlobConstructor)try{T=new Blob([g],{type:Browser.getMimetype(A)}),T.size!==g.length&&(T=new Blob([new Uint8Array(g).buffer],{type:Browser.getMimetype(A)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!T){var I=new Browser.BlobBuilder;I.append(new Uint8Array(g).buffer),T=I.getBlob()}var S=Browser.URLObject.createObjectURL(T),k=new Image;k.onload=function(){assert(k.complete,"Image "+A+" could not be decoded");var N=document.createElement("canvas");N.width=k.width,N.height=k.height;var M=N.getContext("2d");M.drawImage(k,0,0),Module.preloadedImages[A]=N,Browser.URLObject.revokeObjectURL(S),v&&v(g)},k.onerror=function(N){console.log("Image "+S+" could not be decoded"),y&&y()},k.src=S},Module.preloadPlugins.push(u);var n={};n.canHandle=function(g){return!Module.noAudioDecoding&&g.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},n.handle=function(g,A,v,y){var T=!1;function I(M){T||(T=!0,Module.preloadedAudios[A]=M,v&&v(g))}function S(){T||(T=!0,Module.preloadedAudios[A]=new Audio,y&&y())}if(Browser.hasBlobConstructor){try{var k=new Blob([g],{type:Browser.getMimetype(A)})}catch{return S()}var e=Browser.URLObject.createObjectURL(k),N=new Audio;N.addEventListener("canplaythrough",function(){I(N)},!1),N.onerror=function(O){if(T)return;console.log("warning: browser could not fully decode audio "+A+", trying slower base64 approach");function z(B){for(var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b="=",W="",q=0,Y=0,X=0;X=6;){var Q=q>>Y-6&63;Y-=6,W+=V[Q]}return Y==2?(W+=V[(q&3)<<4],W+=b+b):Y==4&&(W+=V[(q&15)<<2],W+=b),W}N.src="data:audio/x-"+A.substr(-3)+";base64,"+z(g),I(N)},N.src=e,Browser.safeSetTimeout(function(){I(N)},1e4)}else return S()},Module.preloadPlugins.push(n);var s=Module.canvas;function c(){Browser.pointerLock=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s||document.msPointerLockElement===s}s&&(s.requestPointerLock=s.requestPointerLock||s.mozRequestPointerLock||s.webkitRequestPointerLock||s.msRequestPointerLock||function(){},s.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},s.exitPointerLock=s.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",c,!1),document.addEventListener("mozpointerlockchange",c,!1),document.addEventListener("webkitpointerlockchange",c,!1),document.addEventListener("mspointerlockchange",c,!1),Module.elementPointerLock&&s.addEventListener("click",function(f){!Browser.pointerLock&&s.requestPointerLock&&(s.requestPointerLock(),f.preventDefault())},!1))},createContext:function(u,n,s,c){if(n&&Module.ctx&&u==Module.canvas)return Module.ctx;var f,g;if(n){var A={antialias:!1,alpha:!1};if(c)for(var v in c)A[v]=c[v];g=GL.createContext(u,A),g&&(f=GL.getContext(g).GLctx),u.style.backgroundColor="black"}else f=u.getContext("2d");return f?(s&&(n||assert(typeof GLctx>"u","cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=f,n&&GL.makeContextCurrent(g),Module.useWebGL=n,Browser.moduleContextCreatedCallbacks.forEach(function(y){y()}),Browser.init()),f):null},destroyContext:function(u,n,s){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(u,n,s){Browser.lockPointer=u,Browser.resizeCanvas=n,Browser.vrDevice=s,typeof Browser.lockPointer>"u"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas>"u"&&(Browser.resizeCanvas=!1),typeof Browser.vrDevice>"u"&&(Browser.vrDevice=null);var c=Module.canvas;function f(){Browser.isFullScreen=!1;var A=c.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===A?(c.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},c.cancelFullScreen=c.cancelFullScreen.bind(document),Browser.lockPointer&&c.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):(A.parentNode.insertBefore(c,A),A.parentNode.removeChild(A),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen),Browser.updateCanvasDimensions(c)}Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",f,!1),document.addEventListener("mozfullscreenchange",f,!1),document.addEventListener("webkitfullscreenchange",f,!1),document.addEventListener("MSFullscreenChange",f,!1));var g=document.createElement("div");c.parentNode.insertBefore(g,c),g.appendChild(c),g.requestFullScreen=g.requestFullScreen||g.mozRequestFullScreen||g.msRequestFullscreen||(g.webkitRequestFullScreen?function(){g.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),s?g.requestFullScreen({vrDisplay:s}):g.requestFullScreen()},nextRAF:0,fakeRequestAnimationFrame:function(u){var n=Date.now();if(Browser.nextRAF===0)Browser.nextRAF=n+1e3/60;else for(;n+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var s=Math.max(Browser.nextRAF-n,0);setTimeout(u,s)},requestAnimationFrame:function u(n){typeof window>"u"?Browser.fakeRequestAnimationFrame(n):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(n))},safeCallback:function(u){return function(){if(!ABORT)return u.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var u=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],u.forEach(function(n){n()})}},safeRequestAnimationFrame:function(u){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?u():Browser.queuedAsyncCallbacks.push(u))})},safeSetTimeout:function(u,n){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?u():Browser.queuedAsyncCallbacks.push(u))},n)},safeSetInterval:function(u,n){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&u()},n)},getMimetype:function(u){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[u.substr(u.lastIndexOf(".")+1)]},getUserMedia:function(u){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(u)},getMovementX:function(u){return u.movementX||u.mozMovementX||u.webkitMovementX||0},getMovementY:function(u){return u.movementY||u.mozMovementY||u.webkitMovementY||0},getMouseWheelDelta:function(u){var n=0;switch(u.type){case"DOMMouseScroll":n=u.detail;break;case"mousewheel":n=u.wheelDelta;break;case"wheel":n=u.deltaY;break;default:throw"unrecognized mouse wheel event: "+u.type}return n},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(u){if(Browser.pointerLock)u.type!="mousemove"&&"mozMovementX"in u?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(u),Browser.mouseMovementY=Browser.getMovementY(u)),typeof SDL<"u"?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var n=Module.canvas.getBoundingClientRect(),s=Module.canvas.width,c=Module.canvas.height,f=typeof window.scrollX<"u"?window.scrollX:window.pageXOffset,g=typeof window.scrollY<"u"?window.scrollY:window.pageYOffset;if(u.type==="touchstart"||u.type==="touchend"||u.type==="touchmove"){var A=u.touch;if(A===void 0)return;var v=A.pageX-(f+n.left),y=A.pageY-(g+n.top);v=v*(s/n.width),y=y*(c/n.height);var T={x:v,y};if(u.type==="touchstart")Browser.lastTouches[A.identifier]=T,Browser.touches[A.identifier]=T;else if(u.type==="touchend"||u.type==="touchmove"){var I=Browser.touches[A.identifier];I||(I=T),Browser.lastTouches[A.identifier]=I,Browser.touches[A.identifier]=T}return}var S=u.pageX-(f+n.left),k=u.pageY-(g+n.top);S=S*(s/n.width),k=k*(c/n.height),Browser.mouseMovementX=S-Browser.mouseX,Browser.mouseMovementY=k-Browser.mouseY,Browser.mouseX=S,Browser.mouseY=k}},xhrLoad:function(u,n,s){var c=new XMLHttpRequest;c.open("GET",u,!0),c.responseType="arraybuffer",c.onload=function(){c.status==200||c.status==0&&c.response?n(c.response):s()},c.onerror=s,c.send(null)},asyncLoad:function(u,n,s,c){Browser.xhrLoad(u,function(f){assert(f,'Loading data file "'+u+'" failed (no arrayBuffer).'),n(new Uint8Array(f)),c||removeRunDependency()},function(f){if(s)s();else throw'Loading data file "'+u+'" failed.'}),c||addRunDependency()},resizeListeners:[],updateResizeListeners:function(){var u=Module.canvas;Browser.resizeListeners.forEach(function(n){n(u.width,u.height)})},setCanvasSize:function(u,n,s){var c=Module.canvas;Browser.updateCanvasDimensions(c,u,n),s||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){if(typeof SDL<"u"){var u=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];u=u|8388608,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=u}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL<"u"){var u=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];u=u&-8388609,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=u}Browser.updateResizeListeners()},updateCanvasDimensions:function(u,n,s){n&&s?(u.widthNative=n,u.heightNative=s):(n=u.widthNative,s=u.heightNative);var c=n,f=s;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(c/f>2];return n},getStr:function(){var u=Pointer_stringify(SYSCALLS.get());return u},get64:function(){var u=SYSCALLS.get(),n=SYSCALLS.get();return u>=0?assert(n===0):assert(n===-1),u},getZero:function(){assert(SYSCALLS.get()===0)}};function ___syscall54(u,n){SYSCALLS.varargs=n;try{return 0}catch(s){return(typeof FS>"u"||!(s instanceof FS.ErrnoError))&&abort(s),-s.errno}}Module._i64Add=_i64Add,Module._bitshift64Lshr=_bitshift64Lshr;function ___cxa_pure_virtual(){throw ABORT=!0,"Pure virtual function called!"}function _pthread_cleanup_push(u,n){__ATEXIT__.push(function(){Runtime.dynCall("vi",u,[n])}),_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cond_broadcast(){return 0}function ___cxa_guard_acquire(u){return HEAP8[u>>0]?0:(HEAP8[u>>0]=1,1)}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!"),__ATEXIT__.pop(),_pthread_cleanup_push.level=__ATEXIT__.length}function ___cxa_guard_release(){}function ___cxa_begin_catch(u){return __ZSt18uncaught_exceptionv.uncaught_exception--,EXCEPTIONS.caught.push(u),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(u)),u}function _llvm_eh_typeid_for(u){return u}function _emscripten_memcpy_big(u,n,s){return HEAPU8.set(HEAPU8.subarray(n,n+s),u),u}Module._memcpy=_memcpy;function ___syscall6(u,n){SYSCALLS.varargs=n;try{var s=SYSCALLS.getStreamFromFD();return FS.close(s),0}catch(c){return(typeof FS>"u"||!(c instanceof FS.ErrnoError))&&abort(c),-c.errno}}function _pthread_mutex_lock(){}function _sbrk(u){var n=_sbrk;n.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),n.called=!0,assert(Runtime.dynamicAlloc),n.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var s=DYNAMICTOP;if(u!=0){var c=n.alloc(u);if(!c)return 4294967295}return s}Module._bitshift64Shl=_bitshift64Shl;function ___cxa_guard_abort(){}Module._memmove=_memmove;function _pthread_cond_wait(){return 0}function ___cxa_rethrow(){___cxa_end_catch.rethrown=!0;var u=EXCEPTIONS.caught.pop();throw EXCEPTIONS.last=u,u}function _pthread_mutex_unlock(){}function _time(u){var n=Date.now()/1e3|0;return u&&(HEAP32[u>>2]=n),n}function _pthread_self(){return 0}function ___syscall140(u,n){SYSCALLS.varargs=n;try{var s=SYSCALLS.getStreamFromFD(),c=SYSCALLS.get(),f=SYSCALLS.get(),g=SYSCALLS.get(),A=SYSCALLS.get(),v=f;return assert(c===0),FS.llseek(s,v,A),HEAP32[g>>2]=s.position,s.getdents&&v===0&&A===0&&(s.getdents=null),0}catch(y){return(typeof FS>"u"||!(y instanceof FS.ErrnoError))&&abort(y),-y.errno}}function ___syscall146(u,n){SYSCALLS.varargs=n;try{var s=SYSCALLS.get(),c=SYSCALLS.get(),f=SYSCALLS.get(),g=0;___syscall146.buffer||(___syscall146.buffer=[]);for(var A=___syscall146.buffer,v=0;v>2],T=HEAP32[c+(v*8+4)>>2],I=0;I"u"||!(k instanceof FS.ErrnoError))&&abort(k),-k.errno}}function ___syscall145(u,n){SYSCALLS.varargs=n;try{var s=SYSCALLS.getStreamFromFD(),c=SYSCALLS.get(),f=SYSCALLS.get();return SYSCALLS.doReadv(s,c,f)}catch(g){return(typeof FS>"u"||!(g instanceof FS.ErrnoError))&&abort(g),-g.errno}}var ___dso_handle=allocate(1,"i32*",ALLOC_STATIC);Module.requestFullScreen=function u(n,s,c){Browser.requestFullScreen(n,s,c)},Module.requestAnimationFrame=function u(n){Browser.requestAnimationFrame(n)},Module.setCanvasSize=function u(n,s,c){Browser.setCanvasSize(n,s,c)},Module.pauseMainLoop=function u(){Browser.mainLoop.pause()},Module.resumeMainLoop=function u(){Browser.mainLoop.resume()},Module.getUserMedia=function u(){Browser.getUserMedia()},Module.createContext=function u(n,s,c,f){return Browser.createContext(n,s,c,f)},STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE2147483648?!1:(S=new c(t),k=new f(t),e=new g(t),N=new A(t),M=new v(t),O=new y(t),z=new T(t),B=new I(t),s=t,!0)}function na(t){t=t|0;var r=0;return r=b,b=b+t|0,b=b+15&-16,r|0}function ra(){return b|0}function sa(t){t=t|0,b=t}function oa(t,r){t=t|0,r=r|0,b=t,W=r}function aa(t,r){t=t|0,r=r|0,m||(m=t,Z=r)}function hA(t){t=t|0,S[q>>0]=S[t>>0],S[q+1>>0]=S[t+1>>0],S[q+2>>0]=S[t+2>>0],S[q+3>>0]=S[t+3>>0]}function dA(t){t=t|0,S[q>>0]=S[t>>0],S[q+1>>0]=S[t+1>>0],S[q+2>>0]=S[t+2>>0],S[q+3>>0]=S[t+3>>0],S[q+4>>0]=S[t+4>>0],S[q+5>>0]=S[t+5>>0],S[q+6>>0]=S[t+6>>0],S[q+7>>0]=S[t+7>>0]}function la(t){t=t|0,ye=t}function ua(){return ye|0}function ca(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0;if($=b,b=b+128|0,F=$+44|0,U=$+8|0,C=$+4|0,E=$,R=o+4|0,_=o+8|0,m=0,$e(35,e[o>>2]|0,e[R>>2]|0,e[_>>2]|0,a|0),D=m,m=0,D&1)H=5;else{d=F,h=d+84|0;do e[d>>2]=e[a>>2],d=d+4|0,a=a+4|0;while((d|0)<(h|0));if(a=F+12|0,!(e[a>>2]|0)&&(w=ie(((e[F+8>>2]|0)+7|0)/8|0,e[F>>2]|0)|0,e[a>>2]=w,(e[F+24>>2]|0)!=0)&&(D=ie(e[F+16>>2]|0,w)|0,e[a>>2]=D),m=0,ue(176,U|0),D=m,m=0,D&1)H=5;else{a=F+56|0;do if(e[a>>2]|0)if(m=0,a=ge(66,a|0)|0,D=m,m=0,D&1)H=15;else{if(e[C>>2]=a,h=U+28|0,d=e[h>>2]|0,d>>>0<(e[U+32>>2]|0)>>>0){e[d>>2]=a,e[h>>2]=d+4,e[C>>2]=0,H=19;break}if(m=0,Ae(57,U+24|0,C|0),D=m,m=0,D&1){if(h=j(824,0)|0,a=ye,d=e[C>>2]|0,e[C>>2]=0,!d)break;Rt[e[(e[d>>2]|0)+4>>2]&255](d);break}else{if(a=e[C>>2]|0,e[C>>2]=0,!a){H=19;break}Rt[e[(e[a>>2]|0)+4>>2]&255](a),H=19;break}}else H=19;while(!1);e:do if((H|0)==19)if(d=F+4|0,w=F+8|0,C=F+16|0,m=0,a=Pe(14,e[F>>2]|0,e[d>>2]|0,e[w>>2]|0,e[C>>2]|0)|0,D=m,m=0,D&1)H=15;else{e[E>>2]=a,D=U+28|0,h=e[D>>2]|0;do if(h>>>0>=(e[U+32>>2]|0)>>>0)if(m=0,Ae(57,U+24|0,E|0),h=m,m=0,h&1){if(h=j(824,0)|0,a=ye,d=e[E>>2]|0,e[E>>2]=0,!d)break e;Rt[e[(e[d>>2]|0)+4>>2]&255](d);break e}else{if(a=e[E>>2]|0,e[E>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}else e[h>>2]=a,e[D>>2]=h+4,e[E>>2]=0;while(!1);if(a=e[F+28>>2]|0,a|0&&(m=0,Ae(58,U|0,a|0),H=m,m=0,H&1)){H=15;break}t:do if(e[F+24>>2]|0){if(m=0,ve(4,U|0,o|0,F|0),H=m,m=0,H&1){H=15;break e}}else if(a=ie(e[d>>2]|0,e[F>>2]|0)|0,a=ie(a,((e[w>>2]|0)+7|0)/8|0)|0,(e[C>>2]|0)>0){for(d=0;m=0,ve(4,U|0,o|0,F|0),H=m,m=0,!(H&1);)if(h=e[R>>2]|0,h&&(e[R>>2]=h+a,e[_>>2]=(e[_>>2]|0)-a),d=d+1|0,(d|0)>=(e[C>>2]|0))break t;h=j(824,0)|0,a=ye,H=16;break e}while(!1);if(m=0,Ne(33,U|0,t|0)|0,H=m,m=0,H&1)H=15;else{if(e[r>>2]=e[U+16>>2],l&&(S[l>>0]=0),d=U+24|0,a=e[d>>2]|0,a){if(h=e[D>>2]|0,(h|0)!=(a|0)){do l=h+-4|0,e[D>>2]=l,h=e[l>>2]|0,e[l>>2]=0,h&&Rt[e[(e[h>>2]|0)+4>>2]&255](h),h=e[D>>2]|0;while((h|0)!=(a|0));a=e[d>>2]|0}he(a)}return l=0,b=$,l|0}}while(!1);if((H|0)==15&&(h=j(824,0)|0,a=ye,H=16),D=U+24|0,d=e[D>>2]|0,d){if(C=U+28|0,w=e[C>>2]|0,(w|0)!=(d|0)){do U=w+-4|0,e[C>>2]=U,w=e[U>>2]|0,e[U>>2]=0,w&&Rt[e[(e[w>>2]|0)+4>>2]&255](w),w=e[C>>2]|0;while((w|0)!=(d|0));d=e[D>>2]|0}he(d)}}}if((H|0)==5&&(h=j(824,0)|0,a=ye),U=(a|0)==($n(824)|0),w=K0(h|0)|0,a=(l|0)==0,!U)return a||(S[l>>0]=0),ei(),l=14,b=$,l|0;d=w+12|0;do if(a)H=60;else if(a=e[d>>2]|0,m=0,h=Ce(1)|0,U=m,m=0,!(U&1))if((a|0)==(h|0)){Rr(l,Et[e[(e[w>>2]|0)+8>>2]&127](w)|0)|0,H=60;break}else{S[l>>0]=0,H=60;break}while(!1);return(H|0)==60&&(K=e[d>>2]|0,m=0,G=Ce(1)|0,l=m,m=0,!(l&1))?(l=(K|0)==(G|0)?e[w+8>>2]|0:13,ei(),b=$,l|0):(a=j()|0,m=0,bt(3),$=m,m=0,$&1?($=j(0)|0,$t($)):le(a|0),0)}function fa(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0;switch(D=b,b=b+112|0,h=D+96|0,C=D+84|0,E=D+72|0,F=D+60|0,R=D+48|0,_=D+36|0,U=D+24|0,H=D+12|0,K=D,w=(r|0)==0,(t|0)==0&w&&(l=Ct(16)|0,m=0,ve(5,h|0,48504,52),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,h|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(h),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),d=e[a>>2]|0,(d+-1|0)>>>0>65534&&(l=Ct(16)|0,m=0,ve(5,C|0,48557,41),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,C|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(C),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),h=e[a+4>>2]|0,(h+-1|0)>>>0>65534&&(l=Ct(16)|0,m=0,ve(5,E|0,48599,42),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,E|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(E),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),l=e[a+8>>2]|0,(l+-2|0)>>>0>14&&(l=Ct(16)|0,m=0,ve(5,F|0,48642,46),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,F|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(F),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),t=e[a+24>>2]|0,t>>>0>=3&&(l=Ct(16)|0,m=0,ve(5,R|0,48689,65),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,R|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(R),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),r=e[a+16>>2]|0,(r+-1|0)>>>0>254&&(l=Ct(16)|0,m=0,ve(5,_|0,48755,44),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,_|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(_),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),!w&&(_=ie(h,d)|0,(ie(ie(_,(l|0)>8?2:1)|0,r)|0)>>>0>o>>>0)&&(l=Ct(16)|0,m=0,ve(5,U|0,48800,58),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,U|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(U),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),r|0){case 4:{if((t|0)!=2){b=D;return}l=Ct(16)|0,m=0,ve(5,H|0,48859,73),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,H|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(H),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)}case 3:{b=D;return}default:{if(!t){b=D;return}l=Ct(16)|0,m=0,ve(5,K|0,48933,73),H=m,m=0,H&1?r=j()|0:(m=0,r=Ce(1)|0,H=m,m=0,!(H&1)&&(m=0,$e(36,l|0,1,r|0,K|0),H=m,m=0,!(H&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(K),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)}}}function $t(t){t=t|0,K0(t|0)|0,P6()}function ha(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+128|0,h=E+116|0,d=E,m=0,e[h>>2]=e[r>>2],e[h+4>>2]=e[r+4>>2],e[h+8>>2]=e[r+8>>2],Ae(59,d|0,h|0),l=m,m=0,!(l&1)){if(o){l=d+16|0,r=l+84|0;do e[l>>2]=e[o>>2],l=l+4|0,o=o+4|0;while((l|0)<(r|0))}if(m=0,e[h>>2]=e[t>>2],e[h+4>>2]=e[t+4>>2],e[h+8>>2]=e[t+8>>2],Ae(60,d|0,h|0),d=m,m=0,!(d&1))return a&&(S[a>>0]=0),D=0,b=E,D|0}if(t=j(824,0)|0,d=ye,d=(d|0)==($n(824)|0),t=K0(t|0)|0,r=(a|0)==0,!d)return r||(S[a>>0]=0),ei(),D=14,b=E,D|0;l=t+12|0;do if(r)D=10;else if(r=e[l>>2]|0,m=0,o=Ce(1)|0,d=m,m=0,!(d&1))if((r|0)==(o|0)){Rr(a,Et[e[(e[t>>2]|0)+8>>2]&127](t)|0)|0,D=10;break}else{S[a>>0]=0,D=10;break}while(!1);return(D|0)==10&&(w=e[l>>2]|0,m=0,C=Ce(1)|0,D=m,m=0,!(D&1))?(D=(w|0)==(C|0)?e[t+8>>2]|0:13,ei(),b=E,D|0):(r=j()|0,m=0,bt(3),E=m,m=0,E&1?(E=j(0)|0,$t(E)):le(r|0),0)}function da(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(C=b,b=b+128|0,l=C+116|0,a=C,m=0,e[l>>2]=e[t>>2],e[l+4>>2]=e[t+4>>2],e[l+8>>2]=e[t+8>>2],Ae(59,a|0,l|0),l=m,m=0,!(l&1)&&(m=0,ue(177,a|0),l=m,m=0,!(l&1))&&(m=0,Ae(61,a|0,1),l=m,m=0,!(l&1))){t=a+16|0,a=r+84|0;do e[r>>2]=e[t>>2],r=r+4|0,t=t+4|0;while((r|0)<(a|0));return o&&(S[o>>0]=0),o=0,b=C,o|0}if(l=j(824,0)|0,r=ye,r=(r|0)==($n(824)|0),l=K0(l|0)|0,t=(o|0)==0,!r)return t||(S[o>>0]=0),ei(),o=14,b=C,o|0;r=l+12|0;do if(t)w=13;else if(t=e[r>>2]|0,m=0,a=Ce(1)|0,D=m,m=0,!(D&1))if((t|0)==(a|0)){Rr(o,Et[e[(e[l>>2]|0)+8>>2]&127](l)|0)|0,w=13;break}else{S[o>>0]=0,w=13;break}while(!1);return(w|0)==13&&(h=e[r>>2]|0,m=0,d=Ce(1)|0,D=m,m=0,!(D&1))?(D=(h|0)==(d|0)?e[l+8>>2]|0:13,ei(),b=C,D|0):(t=j()|0,m=0,bt(3),D=m,m=0,D&1?(D=j(0)|0,$t(D)):le(t|0),0)}function pa(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0;return F=b,b=b+48|0,C=F+36|0,w=F+24|0,D=F+12|0,E=F,(t|0)!=0&(o|0)!=0&(a|0)!=0&(h|0)!=0?(e[D>>2]=0,e[D+4>>2]=t,e[D+8>>2]=r,e[E>>2]=0,e[E+4>>2]=a,e[E+8>>2]=l,e[w>>2]=e[D>>2],e[w+4>>2]=e[D+4>>2],e[w+8>>2]=e[D+8>>2],e[C>>2]=e[E>>2],e[C+4>>2]=e[E+4>>2],e[C+8>>2]=e[E+8>>2],l=ca(w,o,C,h,d)|0,b=F,l|0):(l=1,b=F,l|0)}function ma(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;return l=b,b=b+32|0,h=l+12|0,d=l,w=d,e[w>>2]=0,e[w+4>>2]=0,e[d+4>>2]=t,e[d+8>>2]=r,e[h>>2]=e[d>>2],e[h+4>>2]=e[d+4>>2],e[h+8>>2]=e[d+8>>2],o=da(h,o,a)|0,b=l,o|0}function ga(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+48|0,w=d+36|0,C=d+24|0,E=d+12|0,D=d,e[E>>2]=0,e[E+4>>2]=t,e[E+8>>2]=r,e[D>>2]=0,e[D+4>>2]=o,e[D+8>>2]=a,e[C>>2]=e[E>>2],e[C+4>>2]=e[E+4>>2],e[C+8>>2]=e[E+8>>2],e[w>>2]=e[D>>2],e[w+4>>2]=e[D+4>>2],e[w+8>>2]=e[D+8>>2],a=ha(C,w,l,h)|0,b=d,a|0}function Sa(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(D=t+4|0,o=e[t>>2]|0,l=((e[D>>2]|0)-o>>2)+1|0,l>>>0>1073741823&&(pi(t),o=e[t>>2]|0),E=t+8|0,a=(e[E>>2]|0)-o|0,a>>2>>>0<536870911?(a=a>>1,a=a>>>0>>0?l:a,o=(e[D>>2]|0)-o>>2,a?w=6:(h=0,d=0)):(a=1073741823,o=(e[D>>2]|0)-o>>2,w=6),(w|0)==6&&(h=a,d=Xe(a<<2)|0),l=d+(o<<2)|0,a=l,C=d+(h<<2)|0,w=e[r>>2]|0,e[r>>2]=0,e[l>>2]=w,w=d+(o+1<<2)|0,d=e[t>>2]|0,o=e[D>>2]|0,(o|0)==(d|0))l=t,h=D;else{do o=o+-4|0,r=e[o>>2]|0,e[o>>2]=0,e[l+-4>>2]=r,l=a+-4|0,a=l;while((o|0)!=(d|0));o=a,l=t,h=D,a=o,d=e[t>>2]|0,o=e[D>>2]|0}if(e[l>>2]=a,e[h>>2]=w,e[E>>2]=C,l=d,(o|0)!=(l|0))do o=o+-4|0,a=e[o>>2]|0,e[o>>2]=0,a&&Rt[e[(e[a>>2]|0)+4>>2]&255](a);while((o|0)!=(l|0));d&&he(d)}function Aa(){return S[8]|0||!(kt(8)|0)||(Nt(72,35648,Q|0)|0,Dt(8)),35648}function un(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;E=b,b=b+32|0,C=E,m0(C,(1<>2]|0,D=h+1|0,o=D<<1,e[t>>2]=0,d=t+4|0,e[d>>2]=0,e[t+8>>2]=0;e:do if(D){if((h|0)<-1&&(m=0,ue(178,t|0),w=m,m=0,w&1)||(a=4),(a|0)==4&&(m=0,l=ge(67,o|0)|0,w=m,m=0,!(w&1))){for(e[d>>2]=l,e[t>>2]=l,e[t+8>>2]=l+o,r=l;;)if(S[r>>0]=0,r=(e[d>>2]|0)+1|0,e[d>>2]=r,o=o+-1|0,!o)break e}o=j()|0,r=e[t>>2]|0,r||le(o|0),(e[d>>2]|0)!=(r|0)&&(e[d>>2]=r),he(r),le(o|0)}while(!1);if(r=~h,(h|0)<(r|0)){b=E;return}d=C+12|0,w=C+8|0,h=C+4|0,l=r;do r=e[d>>2]|0,(l|0)>(0-r|0)?(o=e[w>>2]|0,(l|0)>(0-o|0)?(a=e[h>>2]|0,(l|0)>(0-a|0)?(l|0)>=0?(l|0)>0?(a|0)<=(l|0)?(o|0)>(l|0)?r=2:r=(r|0)>(l|0)?3:4:r=1:r=0:r=-1:r=-2):r=-3):r=-4,S[(e[t>>2]|0)+(l+D)>>0]=r,l=l+1|0;while((l|0)<(D|0));b=E}function va(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;switch(R=e[o+16>>2]|0,R|0){case 64:case 0:{m=0,t=Ne(34,t|0,r|0)|0,r=m,m=0,r&1?_=16:a=t;break}default:{for(l=(1<>2])+-1|0,F=e[r+20>>2]|0,E=F<<1,E=((E+l|0)/(E|1|0)|0)+1|0,t=0;(1<>2]|0,m=0,a=ge(67,4624)|0,D=m,m=0,D&1)_=16;else{h=((d|0)<8?8:d)+d<<1,w=a+4|0,C=r,D=w+84|0;do e[w>>2]=e[C>>2],w=w+4|0,C=C+4|0;while((w|0)<(D|0));w=a+88|0,D=w+40|0;do e[w>>2]=0,w=w+4|0;while((w|0)<(D|0));e[a>>2]=35660,e[a+128>>2]=l,e[a+132>>2]=E,e[a+136>>2]=F,e[a+140>>2]=t,e[a+144>>2]=d,e[a+148>>2]=h,e[a+152>>2]=R,t=a+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+172>>2]=e[r>>2],e[a+176>>2]=0,e[a+180>>2]=0,e[a+184>>2]=0,t=a+4568|0,l=a+188|0;do e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,k[l+10>>1]=1,l=l+12|0;while((l|0)!=(t|0));e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1)}}}return(_|0)==16&&(_=j()|0,le(_|0)),!a||(m=0,Ae(e[(e[a>>2]|0)+12>>2]|0,a|0,o|0),_=m,m=0,!(_&1))?a|0:(t=j()|0,a||(_=t,le(_|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),_=t,le(_|0),0)}function xa(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(o=(e[r+24>>2]|0)==2,o&&(e[r+16>>2]|0)!=3)return r=0,r|0;E=e[r+20>>2]|0,t=e[r+8>>2]|0;e:do if(!E){if(o){if((t|0)!=8)break;a=Xe(4600)|0,d=a+4|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=a+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[a>>2]=35688,t=a+132|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+148>>2]=e[r>>2],e[a+152>>2]=0,e[a+156>>2]=0,e[a+160>>2]=0,t=a+4544|0,o=a+164|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4556|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4568|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1),r=a,r|0}switch(t|0){case 8:{a=Xe(4600)|0,d=a+4|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=a+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[a>>2]=35716,t=a+132|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+148>>2]=e[r>>2],e[a+152>>2]=0,e[a+156>>2]=0,e[a+160>>2]=0,t=a+4544|0,o=a+164|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4556|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4568|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1),r=a,r|0}case 12:{a=Xe(4600)|0,d=a+4|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=a+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[a>>2]=35744,t=a+132|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+148>>2]=e[r>>2],e[a+152>>2]=0,e[a+156>>2]=0,e[a+160>>2]=0,t=a+4544|0,o=a+164|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4556|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4568|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1),r=a,r|0}case 16:{a=Xe(4600)|0,d=a+4|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=a+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[a>>2]=35772,t=a+132|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+148>>2]=e[r>>2],e[a+152>>2]=0,e[a+156>>2]=0,e[a+160>>2]=0,t=a+4544|0,o=a+164|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4556|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4568|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1),r=a,r|0}default:break e}}while(!1);if(D=(1<>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=l+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[l>>2]=35800,e[l+128>>2]=D,e[l+132>>2]=h,e[l+136>>2]=E,e[l+140>>2]=t,e[l+144>>2]=o,e[l+148>>2]=a,e[l+152>>2]=64,t=l+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+172>>2]=e[r>>2],e[l+176>>2]=0,e[l+180>>2]=0,e[l+184>>2]=0,t=l+4568|0,o=l+188|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+28>>2]|0||(e[l+20>>2]=1),r=l,r|0}else{for(t=0;(1<>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=l+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[l>>2]=35660,e[l+128>>2]=D,e[l+132>>2]=h,e[l+136>>2]=E,e[l+140>>2]=t,e[l+144>>2]=o,e[l+148>>2]=a,e[l+152>>2]=64,t=l+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+172>>2]=e[r>>2],e[l+176>>2]=0,e[l+180>>2]=0,e[l+184>>2]=0,t=l+4568|0,o=l+188|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+28>>2]|0||(e[l+20>>2]=1),r=l,r|0}if((t|0)>=17)return r=0,r|0;if(h=E<<1,h=((h+D|0)/(h|1|0)|0)+1|0,o){for(t=0;(1<>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=l+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[l>>2]=35828,e[l+128>>2]=D,e[l+132>>2]=h,e[l+136>>2]=E,e[l+140>>2]=t,e[l+144>>2]=o,e[l+148>>2]=a,e[l+152>>2]=64,t=l+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+172>>2]=e[r>>2],e[l+176>>2]=0,e[l+180>>2]=0,e[l+184>>2]=0,t=l+4568|0,o=l+188|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+28>>2]|0||(e[l+20>>2]=1),r=l,r|0}else{for(t=0;(1<>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=l+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[l>>2]=35856,e[l+128>>2]=D,e[l+132>>2]=h,e[l+136>>2]=E,e[l+140>>2]=t,e[l+144>>2]=o,e[l+148>>2]=a,e[l+152>>2]=64,t=l+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+172>>2]=e[r>>2],e[l+176>>2]=0,e[l+180>>2]=0,e[l+184>>2]=0,t=l+4568|0,o=l+188|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+28>>2]|0||(e[l+20>>2]=1),r=l,r|0}return 0}function wa(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;switch(R=e[o+16>>2]|0,R|0){case 64:case 0:{m=0,t=Ne(35,t|0,r|0)|0,r=m,m=0,r&1?_=16:a=t;break}default:{for(l=(1<>2])+-1|0,F=e[r+20>>2]|0,E=F<<1,E=((E+l|0)/(E|1|0)|0)+1|0,t=0;(1<>2]|0,m=0,a=ge(67,4632)|0,D=m,m=0,D&1)_=16;else{h=((d|0)<8?8:d)+d<<1,e[a+4>>2]=0,w=a+8|0,C=r,D=w+84|0;do e[w>>2]=e[C>>2],w=w+4|0,C=C+4|0;while((w|0)<(D|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,D=a+116|0,e[D>>2]=0,e[D+4>>2]=0,e[D+8>>2]=0,e[D+12>>2]=0,e[D+16>>2]=0,e[a>>2]=35884,e[a+136>>2]=l,e[a+140>>2]=E,e[a+144>>2]=F,e[a+148>>2]=t,e[a+152>>2]=d,e[a+156>>2]=h,e[a+160>>2]=R,t=a+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+180>>2]=e[r>>2],e[a+184>>2]=0,e[a+188>>2]=0,e[a+192>>2]=0,t=a+4576|0,l=a+196|0;do e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,k[l+10>>1]=1,l=l+12|0;while((l|0)!=(t|0));e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1)}}}return(_|0)==16&&(_=j()|0,le(_|0)),!a||(m=0,Ae(e[(e[a>>2]|0)+8>>2]|0,a|0,o|0),_=m,m=0,!(_&1))?a|0:(t=j()|0,a||(_=t,le(_|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),_=t,le(_|0),0)}function ya(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(o=(e[r+24>>2]|0)==2,o&&(e[r+16>>2]|0)!=3)return r=0,r|0;E=e[r+20>>2]|0,t=e[r+8>>2]|0;e:do if(!E){if(o){if((t|0)!=8)break;a=Xe(4608)|0,e[a+4>>2]=0,d=a+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,t=a+116|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[a>>2]=35912,t=a+140|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+156>>2]=e[r>>2],e[a+160>>2]=0,e[a+164>>2]=0,e[a+168>>2]=0,t=a+4552|0,o=a+172|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4564|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4576|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1),r=a,r|0}switch(t|0){case 8:{a=Xe(4608)|0,e[a+4>>2]=0,d=a+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,t=a+116|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[a>>2]=35940,t=a+140|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+156>>2]=e[r>>2],e[a+160>>2]=0,e[a+164>>2]=0,e[a+168>>2]=0,t=a+4552|0,o=a+172|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4564|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4576|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1),r=a,r|0}case 12:{a=Xe(4608)|0,e[a+4>>2]=0,d=a+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,t=a+116|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[a>>2]=35968,t=a+140|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+156>>2]=e[r>>2],e[a+160>>2]=0,e[a+164>>2]=0,e[a+168>>2]=0,t=a+4552|0,o=a+172|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4564|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4576|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1),r=a,r|0}case 16:{a=Xe(4608)|0,e[a+4>>2]=0,d=a+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,t=a+116|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[a>>2]=35996,t=a+140|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+156>>2]=e[r>>2],e[a+160>>2]=0,e[a+164>>2]=0,e[a+168>>2]=0,t=a+4552|0,o=a+172|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4564|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4576|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1),r=a,r|0}default:break e}}while(!1);if(D=(1<>2]=0,d=l+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[l+92>>2]=0,e[l+96>>2]=0,e[l+100>>2]=32,e[l+104>>2]=0,e[l+108>>2]=0,S[l+112>>0]=0,C=l+116|0,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,e[C+12>>2]=0,e[C+16>>2]=0,e[l>>2]=36024,e[l+136>>2]=D,e[l+140>>2]=h,e[l+144>>2]=E,e[l+148>>2]=t,e[l+152>>2]=o,e[l+156>>2]=a,e[l+160>>2]=64,t=l+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+180>>2]=e[r>>2],e[l+184>>2]=0,e[l+188>>2]=0,e[l+192>>2]=0,t=l+4576|0,o=l+196|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+32>>2]|0||(e[l+24>>2]=1),r=l,r|0}else{for(t=0;(1<>2]=0,d=l+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[l+92>>2]=0,e[l+96>>2]=0,e[l+100>>2]=32,e[l+104>>2]=0,e[l+108>>2]=0,S[l+112>>0]=0,C=l+116|0,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,e[C+12>>2]=0,e[C+16>>2]=0,e[l>>2]=35884,e[l+136>>2]=D,e[l+140>>2]=h,e[l+144>>2]=E,e[l+148>>2]=t,e[l+152>>2]=o,e[l+156>>2]=a,e[l+160>>2]=64,t=l+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+180>>2]=e[r>>2],e[l+184>>2]=0,e[l+188>>2]=0,e[l+192>>2]=0,t=l+4576|0,o=l+196|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+32>>2]|0||(e[l+24>>2]=1),r=l,r|0}if((t|0)>=17)return r=0,r|0;if(h=E<<1,h=((h+D|0)/(h|1|0)|0)+1|0,o){for(t=0;(1<>2]=0,d=l+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[l+92>>2]=0,e[l+96>>2]=0,e[l+100>>2]=32,e[l+104>>2]=0,e[l+108>>2]=0,S[l+112>>0]=0,C=l+116|0,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,e[C+12>>2]=0,e[C+16>>2]=0,e[l>>2]=36052,e[l+136>>2]=D,e[l+140>>2]=h,e[l+144>>2]=E,e[l+148>>2]=t,e[l+152>>2]=o,e[l+156>>2]=a,e[l+160>>2]=64,t=l+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+180>>2]=e[r>>2],e[l+184>>2]=0,e[l+188>>2]=0,e[l+192>>2]=0,t=l+4576|0,o=l+196|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+32>>2]|0||(e[l+24>>2]=1),r=l,r|0}else{for(t=0;(1<>2]=0,d=l+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[l+92>>2]=0,e[l+96>>2]=0,e[l+100>>2]=32,e[l+104>>2]=0,e[l+108>>2]=0,S[l+112>>0]=0,C=l+116|0,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,e[C+12>>2]=0,e[C+16>>2]=0,e[l>>2]=36080,e[l+136>>2]=D,e[l+140>>2]=h,e[l+144>>2]=E,e[l+148>>2]=t,e[l+152>>2]=o,e[l+156>>2]=a,e[l+160>>2]=64,t=l+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+180>>2]=e[r>>2],e[l+184>>2]=0,e[l+188>>2]=0,e[l+192>>2]=0,t=l+4576|0,o=l+196|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+32>>2]|0||(e[l+24>>2]=1),r=l,r|0}return 0}function Ca(){var t=0,r=0,o=0,a=0,l=0,h=0,d=0;t=2832;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=4880);Jt(2832,0,2048)|0,t=0;do d=2832+(t+128<<3)|0,e[d>>2]=0,e[d+4>>2]=1,t=t+1|0;while((t|0)!=128);t=3088,e[t>>2]=1,e[t+4>>2]=3,t=3096,e[t>>2]=1,e[t+4>>2]=3,t=3104,e[t>>2]=1,e[t+4>>2]=3,t=3112,e[t>>2]=1,e[t+4>>2]=3,t=3120,e[t>>2]=1,e[t+4>>2]=3,t=3128,e[t>>2]=1,e[t+4>>2]=3,t=3136,e[t>>2]=1,e[t+4>>2]=3,t=3144,e[t>>2]=1,e[t+4>>2]=3,t=3152,e[t>>2]=1,e[t+4>>2]=3,t=3160,e[t>>2]=1,e[t+4>>2]=3,t=3168,e[t>>2]=1,e[t+4>>2]=3,t=3176,e[t>>2]=1,e[t+4>>2]=3,t=3184,e[t>>2]=1,e[t+4>>2]=3,t=3192,e[t>>2]=1,e[t+4>>2]=3,t=3200,e[t>>2]=1,e[t+4>>2]=3,t=3208,e[t>>2]=1,e[t+4>>2]=3,t=3216,e[t>>2]=1,e[t+4>>2]=3,t=3224,e[t>>2]=1,e[t+4>>2]=3,t=3232,e[t>>2]=1,e[t+4>>2]=3,t=3240,e[t>>2]=1,e[t+4>>2]=3,t=3248,e[t>>2]=1,e[t+4>>2]=3,t=3256,e[t>>2]=1,e[t+4>>2]=3,t=3264,e[t>>2]=1,e[t+4>>2]=3,t=3272,e[t>>2]=1,e[t+4>>2]=3,t=3280,e[t>>2]=1,e[t+4>>2]=3,t=3288,e[t>>2]=1,e[t+4>>2]=3,t=3296,e[t>>2]=1,e[t+4>>2]=3,t=3304,e[t>>2]=1,e[t+4>>2]=3,t=3312,e[t>>2]=1,e[t+4>>2]=3,t=3320,e[t>>2]=1,e[t+4>>2]=3,t=3328,e[t>>2]=1,e[t+4>>2]=3,t=3336,e[t>>2]=1,e[t+4>>2]=3,t=2896,e[t>>2]=2,e[t+4>>2]=5,t=2904,e[t>>2]=2,e[t+4>>2]=5,t=2912,e[t>>2]=2,e[t+4>>2]=5,t=2920,e[t>>2]=2,e[t+4>>2]=5,t=2928,e[t>>2]=2,e[t+4>>2]=5,t=2936,e[t>>2]=2,e[t+4>>2]=5,t=2944,e[t>>2]=2,e[t+4>>2]=5,t=2952,e[t>>2]=2,e[t+4>>2]=5,t=2848,e[t>>2]=3,e[t+4>>2]=7,t=2856,e[t>>2]=3,e[t+4>>2]=7,t=0;do d=2832+(t+64<<3)|0,e[d>>2]=-1,e[d+4>>2]=2,t=t+1|0;while((t|0)!=64);t=2960,e[t>>2]=-2,e[t+4>>2]=4,t=2968,e[t>>2]=-2,e[t+4>>2]=4,t=2976,e[t>>2]=-2,e[t+4>>2]=4,t=2984,e[t>>2]=-2,e[t+4>>2]=4,t=2992,e[t>>2]=-2,e[t+4>>2]=4,t=3e3,e[t>>2]=-2,e[t+4>>2]=4,t=3008,e[t>>2]=-2,e[t+4>>2]=4,t=3016,e[t>>2]=-2,e[t+4>>2]=4,t=3024,e[t>>2]=-2,e[t+4>>2]=4,t=3032,e[t>>2]=-2,e[t+4>>2]=4,t=3040,e[t>>2]=-2,e[t+4>>2]=4,t=3048,e[t>>2]=-2,e[t+4>>2]=4,t=3056,e[t>>2]=-2,e[t+4>>2]=4,t=3064,e[t>>2]=-2,e[t+4>>2]=4,t=3072,e[t>>2]=-2,e[t+4>>2]=4,t=3080,e[t>>2]=-2,e[t+4>>2]=4,t=2864,e[t>>2]=-3,e[t+4>>2]=6,t=2872,e[t>>2]=-3,e[t+4>>2]=6,t=2880,e[t>>2]=-3,e[t+4>>2]=6,t=2888,e[t>>2]=-3,e[t+4>>2]=6,t=2840,e[t>>2]=-4,e[t+4>>2]=8,t=4880;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=6928);for(Jt(4880,0,2048)|0,o=2,t=0,l=0,h=0;;){if(o=o<<16>>16,r=8-o|0,a=1<>2]=l,e[d+4>>2]=o,r=r+1|0;while((r|0)<(a|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==7){r=2,l=1,h=-1,d=-1;break}else o=(t>>1)+2|0,l=r>>16}for(;;){if(o=r<<16>>16,t=8-o|0,a=1<>2]=h,e[l+4>>2]=o,r=r+1|0;while((r|0)<(a|0))}if(t=(d<<16)+-65536|0,l=t>>31^t>>15,r=(l>>1)+2|0,(r|0)>8){t=6928;break}else h=t>>16,d=d+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=8976);for(Jt(6928,0,2048)|0,l=3,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==12){l=3,r=1,a=-1,h=-1;break}else l=(t>>2)+3|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>2)+3|0,(l|0)>8){t=8976;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=11024);for(Jt(8976,0,2048)|0,l=4,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==20){l=4,r=1,a=-1,h=-1;break}else l=(t>>3)+4|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>3)+4|0,(l|0)>8){t=11024;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=13072);for(Jt(11024,0,2048)|0,l=5,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==32){l=5,r=1,a=-1,h=-1;break}else l=(t>>4)+5|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>4)+5|0,(l|0)>8){t=13072;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=15120);for(Jt(13072,0,2048)|0,l=6,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==48){l=6,r=1,a=-1,h=-1;break}else l=(t>>5)+6|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>5)+6|0,(l|0)>8){t=15120;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=17168);for(Jt(15120,0,2048)|0,l=7,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==64){l=7,r=1,a=-1,h=-1;break}else l=(t>>6)+7|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>6)+7|0,(l|0)>8){t=17168;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=19216);for(Jt(17168,0,2048)|0,l=8,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==64){h=8,a=1,l=-1,d=-1;break}else l=(t>>7)+8|0,a=r>>16}for(;;){if(t=8-h|0,o=1<>2]=l,e[a+4>>2]=h,r=r+1|0;while((r|0)<(o|0))}if(r=(d<<16)+-65536|0,a=r>>31^r>>15,t=a>>7,(t|0)>0){t=19216;break}else h=t+8|0,l=r>>16,d=d+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=21264);Jt(19216,0,2048)|0,t=21264;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=23312);Jt(21264,0,2048)|0,t=23312;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=25360);Jt(23312,0,2048)|0,t=25360;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=27408);Jt(25360,0,2048)|0,t=27408;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=29456);Jt(27408,0,2048)|0,t=29456;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=31504);Jt(29456,0,2048)|0,t=31504;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=33552);Jt(31504,0,2048)|0,t=33552;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=35600);Jt(33552,0,2048)|0,un(35600,8),Nt(179,35600,Q|0)|0,un(35612,10),Nt(179,35612,Q|0)|0,un(35624,12),Nt(179,35624,Q|0)|0,un(35636,16),Nt(179,35636,Q|0)|0}function Ta(t){t=t|0;var r=0;r=e[t>>2]|0,r&&(t=t+4|0,(e[t>>2]|0)!=(r|0)&&(e[t>>2]=r),he(r))}function Ia(t){t=t|0;var r=0,o=0;e[t>>2]=36080,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function ka(t){t=t|0;var r=0,o=0;if(e[t>>2]=36080,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Ea(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+136>>2]|0,e[t+144>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+184>>2]=w|0?w:e[C+4>>2]|0,e[t+188>>2]=h,e[t+192>>2]=l,Wl(t),l=t+140|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+196+(h*12|0)>>2]=r,e[t+196+(h*12|0)+4>>2]=0,k[t+196+(h*12|0)+8>>1]=0,k[t+196+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4576>>2]=w,e[t+4580>>2]=0,S[t+4584>>0]=C,S[t+4585>>0]=1,S[t+4586>>0]=0,e[t+4588>>2]=w,e[t+4592>>2]=1,S[t+4596>>0]=C,S[t+4597>>0]=1,S[t+4598>>0]=0,e[t+4600>>2]=0,b=d}function Da(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4624)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35856,e[r+128>>2]=e[t+136>>2],e[r+132>>2]=e[t+140>>2],e[r+136>>2]=e[t+144>>2],e[r+140>>2]=e[t+148>>2],e[r+144>>2]=e[t+152>>2],e[r+148>>2]=e[t+156>>2],e[r+152>>2]=e[t+160>>2],l=r+156|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+172>>2]=e[a>>2],e[r+176>>2]=0,e[r+180>>2]=0,e[r+184>>2]=0,l=r+4568|0,a=r+188|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4580|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4592|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,es(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],es(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function ba(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function Fa(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;e[t>>2]=36460,e[t+4>>2]=o,F=t+8|0,h=e[o>>2]|0,D=o+16|0,a=e[D>>2]|0,d=ie(a,h)|0,e[F>>2]=0,R=t+12|0,e[R>>2]=0,e[t+16>>2]=0;do if(d){if((d|0)<0&&(m=0,ue(178,F|0),h=m,m=0,h&1)||(E=4),(E|0)==4&&(w=d<<1,m=0,C=ge(67,w|0)|0,h=m,m=0,!(h&1))){e[F>>2]=C,h=C+(d<<1)|0,e[t+16>>2]=h,Jt(C|0,0,w|0)|0,e[R>>2]=h,h=e[o>>2]|0,a=e[D>>2]|0;break}d=j()|0,l=e[F>>2]|0,a=l,l&&(h=e[R>>2]|0,(h|0)!=(l|0)&&(e[R>>2]=h+(~((h+-2-a|0)>>>1)<<1)),he(l)),R=d,le(R|0)}while(!1);if(d=t+20|0,a=ie(h<<1,a)|0,e[d>>2]=0,w=t+24|0,e[w>>2]=0,e[t+28>>2]=0,!a){R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(E=13),(E|0)==13&&(m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[w>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[w>>2]|0)+1|0,e[w>>2]=l,a=a+-1|0;while(a|0);R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}h=j()|0,l=e[d>>2]|0,l&&((e[w>>2]|0)!=(l|0)&&(e[w>>2]=l),he(l)),l=e[F>>2]|0,l||(R=h,le(R|0)),a=e[R>>2]|0,(a|0)!=(l|0)&&(e[R>>2]=a+(~((a+-2-l|0)>>>1)<<1)),he(l),R=h,le(R|0)}function Na(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;e[t>>2]=36436,e[t+4>>2]=o,F=t+8|0,h=e[o>>2]|0,D=o+16|0,a=e[D>>2]|0,d=ie(a,h)|0,e[F>>2]=0,R=t+12|0,e[R>>2]=0,e[t+16>>2]=0;do if(d){if((d|0)<0&&(m=0,ue(178,F|0),h=m,m=0,h&1)||(E=4),(E|0)==4&&(w=d<<1,m=0,C=ge(67,w|0)|0,h=m,m=0,!(h&1))){e[F>>2]=C,h=C+(d<<1)|0,e[t+16>>2]=h,Jt(C|0,0,w|0)|0,e[R>>2]=h,h=e[o>>2]|0,a=e[D>>2]|0;break}d=j()|0,l=e[F>>2]|0,a=l,l&&(h=e[R>>2]|0,(h|0)!=(l|0)&&(e[R>>2]=h+(~((h+-2-a|0)>>>1)<<1)),he(l)),R=d,le(R|0)}while(!1);if(d=t+20|0,a=ie(h<<1,a)|0,e[d>>2]=0,w=t+24|0,e[w>>2]=0,e[t+28>>2]=0,!a){R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(E=13),(E|0)==13&&(m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[w>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[w>>2]|0)+1|0,e[w>>2]=l,a=a+-1|0;while(a|0);R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}h=j()|0,l=e[d>>2]|0,l&&((e[w>>2]|0)!=(l|0)&&(e[w>>2]=l),he(l)),l=e[F>>2]|0,l||(R=h,le(R|0)),a=e[R>>2]|0,(a|0)!=(l|0)&&(e[R>>2]=a+(~((a+-2-l|0)>>>1)<<1)),he(l),R=h,le(R|0)}function Ra(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;e[t>>2]=36412,e[t+4>>2]=o,F=t+8|0,h=e[o>>2]|0,D=o+16|0,a=e[D>>2]|0,d=ie(a,h)|0,e[F>>2]=0,R=t+12|0,e[R>>2]=0,e[t+16>>2]=0;do if(d){if((d|0)<0&&(m=0,ue(178,F|0),h=m,m=0,h&1)||(E=4),(E|0)==4&&(w=d<<1,m=0,C=ge(67,w|0)|0,h=m,m=0,!(h&1))){e[F>>2]=C,h=C+(d<<1)|0,e[t+16>>2]=h,Jt(C|0,0,w|0)|0,e[R>>2]=h,h=e[o>>2]|0,a=e[D>>2]|0;break}d=j()|0,l=e[F>>2]|0,a=l,l&&(h=e[R>>2]|0,(h|0)!=(l|0)&&(e[R>>2]=h+(~((h+-2-a|0)>>>1)<<1)),he(l)),R=d,le(R|0)}while(!1);if(d=t+20|0,a=ie(h<<1,a)|0,e[d>>2]=0,w=t+24|0,e[w>>2]=0,e[t+28>>2]=0,!a){R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(E=13),(E|0)==13&&(m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[w>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[w>>2]|0)+1|0,e[w>>2]=l,a=a+-1|0;while(a|0);R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}h=j()|0,l=e[d>>2]|0,l&&((e[w>>2]|0)!=(l|0)&&(e[w>>2]=l),he(l)),l=e[F>>2]|0,l||(R=h,le(R|0)),a=e[R>>2]|0,(a|0)!=(l|0)&&(e[R>>2]=a+(~((a+-2-l|0)>>>1)<<1)),he(l),R=h,le(R|0)}function Ma(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;e[t>>2]=36388,e[t+4>>2]=o,F=t+8|0,h=e[o>>2]|0,D=o+16|0,a=e[D>>2]|0,d=ie(a,h)|0,e[F>>2]=0,R=t+12|0,e[R>>2]=0,e[t+16>>2]=0;do if(d){if((d|0)<0&&(m=0,ue(178,F|0),h=m,m=0,h&1)||(E=4),(E|0)==4&&(w=d<<1,m=0,C=ge(67,w|0)|0,h=m,m=0,!(h&1))){e[F>>2]=C,h=C+(d<<1)|0,e[t+16>>2]=h,Jt(C|0,0,w|0)|0,e[R>>2]=h,h=e[o>>2]|0,a=e[D>>2]|0;break}d=j()|0,l=e[F>>2]|0,a=l,l&&(h=e[R>>2]|0,(h|0)!=(l|0)&&(e[R>>2]=h+(~((h+-2-a|0)>>>1)<<1)),he(l)),R=d,le(R|0)}while(!1);if(d=t+20|0,a=ie(h<<1,a)|0,e[d>>2]=0,w=t+24|0,e[w>>2]=0,e[t+28>>2]=0,!a){R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(E=13),(E|0)==13&&(m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[w>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[w>>2]|0)+1|0,e[w>>2]=l,a=a+-1|0;while(a|0);R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}h=j()|0,l=e[d>>2]|0,l&&((e[w>>2]|0)!=(l|0)&&(e[w>>2]=l),he(l)),l=e[F>>2]|0,l||(R=h,le(R|0)),a=e[R>>2]|0,(a|0)!=(l|0)&&(e[R>>2]=a+(~((a+-2-l|0)>>>1)<<1)),he(l),R=h,le(R|0)}function Pa(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;d=t+32|0,Sp(d,r)|0,h=t+44|0,e[h>>2]=0,w=t+48|0,l=e[w>>2]|0,l&8&&(r=S[d>>0]|0,r&1?(r=(e[t+40>>2]|0)+(e[t+36>>2]|0)|0,e[h>>2]=r,a=e[t+40>>2]|0,o=a):(r=((r&255)>>>1)+(d+1)|0,e[h>>2]=r,o=d+1|0,a=d+1|0),e[t+8>>2]=o,e[t+12>>2]=a,e[t+16>>2]=r),l&16&&(r=S[d>>0]|0,r&1?(l=e[t+36>>2]|0,e[h>>2]=(e[t+40>>2]|0)+l,r=(e[d>>2]&-2)+-1|0,h=l):(l=(r&255)>>>1,e[h>>2]=d+1+l,r=10,h=l),zs(d,r,0),r=S[d>>0]|0,r&1?(o=e[t+40>>2]|0,l=o,a=e[t+36>>2]|0):(l=d+1|0,a=(r&255)>>>1,o=d+1|0),r=t+24|0,e[r>>2]=o,e[t+20>>2]=o,e[t+28>>2]=l+a,e[w>>2]&3&&(e[r>>2]=o+h))}function La(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;R=b,b=b+32|0,d=R+16|0,F=R+8|0,w=R,m=0,Ae(65,F|0,t|0),D=m,m=0;e:do if(D&1)o=j(0)|0,a=t,l=t;else{do if(S[F>>0]|0){a=e[(e[t>>2]|0)+-12>>2]|0,e[w>>2]=e[t+(a+24)>>2],C=t+a|0,D=e[t+(a+4)>>2]|0,l=r+o|0,a=t+(a+76)|0,o=e[a>>2]|0;do if((o|0)==-1)if(m=0,o=ge(68,C|0)|0,_=m,m=0,_&1)E=13;else{if(e[d>>2]=o,m=0,o=Ne(37,d|0,44220)|0,_=m,m=0,!(_&1)&&(m=0,h=Ne(e[(e[o>>2]|0)+28>>2]|0,o|0,32)|0,_=m,m=0,!(_&1))){_0(d),o=h<<24>>24,e[a>>2]=o,E=9;break}o=j(0)|0,_0(d)}else E=9;while(!1);if((E|0)==9)if(m=0,e[d>>2]=e[w>>2],o=Vt(39,d|0,r|0,((D&176|0)==32?l:r)|0,l|0,C|0,o&255|0)|0,_=m,m=0,_&1)E=13;else{if(o)break;if(_=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+_|0,e[t+(_+16)>>2]|5|0),_=m,m=0,_&1)E=13;else break}(E|0)==13&&(o=j(0)|0),ki(F),a=t,l=t;break e}while(!1);return ki(F),b=R,t|0}while(!1);return K0(o|0)|0,m=0,ue(181,a+(e[(e[l>>2]|0)+-12>>2]|0)|0),_=m,m=0,_&1?(o=j()|0,m=0,bt(3),_=m,m=0,_&1?(_=j(0)|0,$t(_)):le(o|0),0):(ei(),b=R,t|0)}function Oa(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;if(o=e[r+48>>2]|0,o&16){if(o=r+44|0,a=e[o>>2]|0,l=e[r+24>>2]|0,a>>>0>>0?e[o>>2]=l:l=a,a=e[r+20>>2]|0,h=l-a|0,h>>>0>4294967279&&si(t),h>>>0<11?(S[t>>0]=h<<1,o=t+1|0):(r=h+16&-16,o=Xe(r)|0,e[t+8>>2]=o,e[t>>2]=r|1,e[t+4>>2]=h),(a|0)!=(l|0)){for(r=o;S[r>>0]=S[a>>0]|0,a=a+1|0,(a|0)!=(l|0);)r=r+1|0;o=o+h|0}S[o>>0]=0;return}if(!(o&8)){e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0;return}if(a=e[r+8>>2]|0,r=e[r+16>>2]|0,h=r-a|0,h>>>0>4294967279&&si(t),h>>>0<11?(S[t>>0]=h<<1,o=t+1|0):(l=h+16&-16,o=Xe(l)|0,e[t+8>>2]=o,e[t>>2]=l|1,e[t+4>>2]=h),(a|0)!=(r|0)){for(l=o;S[l>>0]=S[a>>0]|0,a=a+1|0,(a|0)!=(r|0);)l=l+1|0;o=o+h|0}S[o>>0]=0}function $a(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;e[t>>2]=36364,e[t+4>>2]=o,R=t+8|0,d=e[o>>2]|0,E=o+16|0,h=e[E>>2]|0,D=ie(h,d)|0,e[R>>2]=0,_=t+12|0,e[_>>2]=0,e[t+16>>2]=0;do if(D){if((D|0)<0&&(m=0,ue(178,R|0),d=m,m=0,d&1)||(F=4),(F|0)==4&&(w=D<<1,m=0,C=ge(67,w|0)|0,d=m,m=0,!(d&1))){e[R>>2]=C,d=C+(D<<1)|0,e[t+16>>2]=d,Jt(C|0,0,w|0)|0,e[_>>2]=d,d=e[o>>2]|0,h=e[E>>2]|0;break}w=j()|0,l=e[R>>2]|0,h=l,l&&(d=e[_>>2]|0,(d|0)!=(l|0)&&(e[_>>2]=d+(~((d+-2-h|0)>>>1)<<1)),he(l)),_=w,le(_|0)}while(!1);if(w=t+20|0,h=ie(d<<1,h)|0,e[w>>2]=0,C=t+24|0,e[C>>2]=0,e[t+28>>2]=0,!h){_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}if((h|0)<0&&(m=0,ue(178,w|0),E=m,m=0,E&1)||(F=13),(F|0)==13&&(m=0,l=ge(67,h|0)|0,F=m,m=0,!(F&1))){e[C>>2]=l,e[w>>2]=l,e[t+28>>2]=l+h;do S[l>>0]=0,l=(e[C>>2]|0)+1|0,e[C>>2]=l,h=h+-1|0;while(h|0);_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}d=j()|0,l=e[w>>2]|0,l&&((e[C>>2]|0)!=(l|0)&&(e[C>>2]=l),he(l)),l=e[R>>2]|0,l||(_=d,le(_|0)),h=e[_>>2]|0,(h|0)!=(l|0)&&(e[_>>2]=h+(~((h+-2-l|0)>>>1)<<1)),he(l),_=d,le(_|0)}function Ba(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;e[t>>2]=36340,e[t+4>>2]=o,R=t+8|0,d=e[o>>2]|0,E=o+16|0,h=e[E>>2]|0,D=ie(h,d)|0,e[R>>2]=0,_=t+12|0,e[_>>2]=0,e[t+16>>2]=0;do if(D){if((D|0)<0&&(m=0,ue(178,R|0),d=m,m=0,d&1)||(F=4),(F|0)==4&&(w=D<<1,m=0,C=ge(67,w|0)|0,d=m,m=0,!(d&1))){e[R>>2]=C,d=C+(D<<1)|0,e[t+16>>2]=d,Jt(C|0,0,w|0)|0,e[_>>2]=d,d=e[o>>2]|0,h=e[E>>2]|0;break}w=j()|0,l=e[R>>2]|0,h=l,l&&(d=e[_>>2]|0,(d|0)!=(l|0)&&(e[_>>2]=d+(~((d+-2-h|0)>>>1)<<1)),he(l)),_=w,le(_|0)}while(!1);if(w=t+20|0,h=ie(d<<1,h)|0,e[w>>2]=0,C=t+24|0,e[C>>2]=0,e[t+28>>2]=0,!h){_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}if((h|0)<0&&(m=0,ue(178,w|0),E=m,m=0,E&1)||(F=13),(F|0)==13&&(m=0,l=ge(67,h|0)|0,F=m,m=0,!(F&1))){e[C>>2]=l,e[w>>2]=l,e[t+28>>2]=l+h;do S[l>>0]=0,l=(e[C>>2]|0)+1|0,e[C>>2]=l,h=h+-1|0;while(h|0);_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}d=j()|0,l=e[w>>2]|0,l&&((e[C>>2]|0)!=(l|0)&&(e[C>>2]=l),he(l)),l=e[R>>2]|0,l||(_=d,le(_|0)),h=e[_>>2]|0,(h|0)!=(l|0)&&(e[_>>2]=h+(~((h+-2-l|0)>>>1)<<1)),he(l),_=d,le(_|0)}function Va(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;e[t>>2]=36316,e[t+4>>2]=o,R=t+8|0,d=e[o>>2]|0,E=o+16|0,h=e[E>>2]|0,D=ie(h,d)|0,e[R>>2]=0,_=t+12|0,e[_>>2]=0,e[t+16>>2]=0;do if(D){if((D|0)<0&&(m=0,ue(178,R|0),d=m,m=0,d&1)||(F=4),(F|0)==4&&(w=D<<1,m=0,C=ge(67,w|0)|0,d=m,m=0,!(d&1))){e[R>>2]=C,d=C+(D<<1)|0,e[t+16>>2]=d,Jt(C|0,0,w|0)|0,e[_>>2]=d,d=e[o>>2]|0,h=e[E>>2]|0;break}w=j()|0,l=e[R>>2]|0,h=l,l&&(d=e[_>>2]|0,(d|0)!=(l|0)&&(e[_>>2]=d+(~((d+-2-h|0)>>>1)<<1)),he(l)),_=w,le(_|0)}while(!1);if(w=t+20|0,h=ie(d<<1,h)|0,e[w>>2]=0,C=t+24|0,e[C>>2]=0,e[t+28>>2]=0,!h){_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}if((h|0)<0&&(m=0,ue(178,w|0),E=m,m=0,E&1)||(F=13),(F|0)==13&&(m=0,l=ge(67,h|0)|0,F=m,m=0,!(F&1))){e[C>>2]=l,e[w>>2]=l,e[t+28>>2]=l+h;do S[l>>0]=0,l=(e[C>>2]|0)+1|0,e[C>>2]=l,h=h+-1|0;while(h|0);_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}d=j()|0,l=e[w>>2]|0,l&&((e[C>>2]|0)!=(l|0)&&(e[C>>2]=l),he(l)),l=e[R>>2]|0,l||(_=d,le(_|0)),h=e[_>>2]|0,(h|0)!=(l|0)&&(e[_>>2]=h+(~((h+-2-l|0)>>>1)<<1)),he(l),_=d,le(_|0)}function Ua(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36316,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function za(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36316,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Ga(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+48|0,!(e[l>>2]|0)){w=t+52|0,Qr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Qr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function qa(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+48>>2]|0,l){Wa(t,l,r,o,a);return}else{l=t+52|0,Bn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Bn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;C=t+4|0,h=e[C>>2]|0;do if(!(S[h+32>>0]|0))D=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*6|0)|0,h=e[C>>2]|0,w=e[h+16>>2]|0,(a|0)<=0){D=e[d>>2]|0;break}for(r=e[d>>2]|0,h=r,d=0;D=h+4|0,E=k[h>>1]|0,k[h>>1]=k[D>>1]|0,k[D>>1]=E,d=d+1|0,(d|0)!=(a|0);)h=h+(w<<1)|0;D=r,h=e[C>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:if((e[h+24>>2]|0)==2){if((a|0)<=0)return;h=t+32|0,r=0;do E=e[h>>2]|0,C=M[D+(r*6|0)+2>>1]<>1]<>1]<>1]=(C+49152+((t+l|0)>>>2)&65535)>>>E,k[o+(r*6|0)+2>>1]=t>>>E,k[o+(r*6|0)+4>>1]=l>>>E,r=r+1|0;while((r|0)!=(a|0));return}else{if(d=(l|0)<(a|0)?l:a,(d|0)<=0)return;w=l<<1,h=e[t+32>>2]|0,r=0;do a=M[D+(r*6|0)+2>>1]<>1]<>1]<>1]=(a+49152+((t+E|0)>>>2)&65535)>>>h,k[o+(r+l<<1)>>1]=t>>>h,k[o+(r+w<<1)>>1]=E>>>h,r=r+1|0;while((r|0)!=(d|0));return}case 4:{if((e[h+24>>2]|0)!=1||(d=(l|0)<(a|0)?l:a,(d|0)<=0))return;w=l<<1,C=l*3|0,h=e[t+32>>2]|0,r=0;do E=k[D+(r<<3)+6>>1]|0,F=M[D+(r<<3)+2>>1]<>1]<>1]<>1]=(F+49152+((a+t|0)>>>2)&65535)>>>h,k[o+(r+l<<1)>>1]=a>>>h,k[o+(r+w<<1)>>1]=t>>>h,k[o+(r+C<<1)>>1]=E,r=r+1|0;while((r|0)!=(d|0));return}default:return}}function Wa(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;F=b,b=b+176|0,R=F+152|0,U=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=U+56|0,C=U+4|0,e[U>>2]=36160,e[D>>2]=36180,m=0,Ae(62,U+56|0,C|0),F=m,m=0,F&1&&(U=j()|0,tt(D),le(U|0)),e[U+128>>2]=0,e[U+132>>2]=-1,e[U>>2]=36200,e[U+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=U+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[U+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,U|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);U=h,tt(D),le(U|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){U=e[d>>2]|0,Bn(t,U,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),U=e[d>>2]|0,Bn(t,U,o,a,l),b=F}function ti(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(l=b,b=b+176|0,o=l+152|0,C=l+16|0,d=l,!(r&1)){if(o=(r|0)/4|0,(r|0)>3){a=0;do C=t+(a<<2)|0,w=e[C>>2]|0,e[C>>2]=w>>>8&16711935|w<<8&-16711936,a=a+1|0;while((a|0)<(o|0))}if(!(r&3)){b=l;return}d=t+(r+-2)|0,C=t+(r+-1)|0,w=S[d>>0]|0,S[d>>0]=S[C>>0]|0,S[C>>0]=w,b=l;return}w=C+56|0,h=C+4|0,e[C>>2]=36160,e[w>>2]=36180,m=0,Ae(62,C+56|0,h|0),l=m,m=0,l&1&&(C=j()|0,tt(w),le(C|0)),e[C+128>>2]=0,e[C+132>>2]=-1,e[C>>2]=36200,e[C+56>>2]=36220,m=0,ue(180,h|0),l=m,m=0;do if(l&1)o=j()|0;else{if(e[h>>2]=36236,l=C+36|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[C+52>>2]=16,e[o>>2]=0,e[o+4>>2]=0,e[o+8>>2]=0,m=0,Ae(63,h|0,o|0),t=m,m=0,t&1){C=j()|0,de(o),de(l),wt(h),o=C;break}de(o),m=0,o=Ve(28,C|0,49087,24)|0,t=m,m=0,!(t&1)&&(m=0,a=Ne(36,o|0,r|0)|0,r=m,m=0,!(r&1))&&(m=0,Ve(28,a|0,49112,20)|0,r=m,m=0,!(r&1))&&(t=Ct(16)|0,m=0,Ae(64,d|0,h|0),r=m,m=0,r&1?o=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,t|0,1,35648,d|0),r=m,m=0,r&1?a=1:(m=0,ve(6,t|0,824,96),m=0,a=0),o=j()|0,de(d),a||(d=o,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0))),It(t|0),d=o,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0)),d=j()|0,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0)}while(!1);C=o,tt(w),le(C|0)}function Qr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;D=t+4|0,h=e[D>>2]|0;e:do switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)<=0)break e;h=t+40|0,t=0;do l=e[h>>2]|0,w=M[r+(t*6|0)+2>>1]<>1]<>1]<>2)+16384|0,k[o+(t*6|0)>>1]=(d+32768+C&65535)>>>l,k[o+(t*6|0)+2>>1]=(C&65535)>>>l,k[o+(t*6|0)+4>>1]=(w+32768+C&65535)>>>l,t=t+1|0;while((t|0)!=(a|0))}else{if(d=(a|0)<(l|0)?a:l,(d|0)<=0)break e;w=l<<1,h=t+40|0,t=0;do C=e[h>>2]|0,F=M[r+(t+l<<1)>>1]<>1]<>1]<>2)+16384|0,k[o+(t*6|0)>>1]=(R+32768+E&65535)>>>C,k[o+(t*6|0)+2>>1]=(E&65535)>>>C,k[o+(t*6|0)+4>>1]=(F+32768+E&65535)>>>C,t=t+1|0;while((t|0)!=(d|0))}break}case 4:{if((e[h+24>>2]|0)==1&&(C=(a|0)<(l|0)?a:l,(C|0)>0)){w=l<<1,h=t+40|0,t=l*3|0,d=0;do R=e[h>>2]|0,F=M[r+(d+l<<1)>>1]<>1]<>1]<>2)+16384|0,_=k[r+(d+t<<1)>>1]|0,H=v0((E&65535)>>>R&65535|0,0,16)|0,F=(F+32768+E&65535)>>>R|ye,_=v0(_&65535|0,0,48)|0,_=H|(U+32768+E&65535)>>>R&65535|_,F=F&65535|ye,R=o+(d<<3)|0,E=R,k[E>>1]=_,k[E+2>>1]=_>>>16,R=R+4|0,k[R>>1]=F,k[R+2>>1]=F>>>16,d=d+1|0;while((d|0)!=(C|0))}break}default:}while(!1);if(h=e[D>>2]|0,!!(S[h+32>>0]|0)&&(d=e[h+16>>2]|0,!((a|0)<=0)))for(h=o,t=0;H=h+4|0,U=k[h>>1]|0,k[h>>1]=k[H>>1]|0,k[H>>1]=U,t=t+1|0,(t|0)!=(a|0);)h=h+(d<<1)|0}function Ha(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36340,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function Qa(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36340,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Ka(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+48|0,!(e[l>>2]|0)){w=t+52|0,Kr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Kr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function Ya(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+48>>2]|0,l){ja(t,l,r,o,a);return}else{l=t+52|0,Vn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Vn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;C=t+4|0,h=e[C>>2]|0;do if(!(S[h+32>>0]|0))D=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*6|0)|0,h=e[C>>2]|0,w=e[h+16>>2]|0,(a|0)<=0){D=e[d>>2]|0;break}for(r=e[d>>2]|0,h=r,d=0;D=h+4|0,E=k[h>>1]|0,k[h>>1]=k[D>>1]|0,k[D>>1]=E,d=d+1|0,(d|0)!=(a|0);)h=h+(w<<1)|0;D=r,h=e[C>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:if((e[h+24>>2]|0)==2){if((a|0)<=0)return;h=t+32|0,r=0;do l=e[h>>2]|0,C=M[D+(r*6|0)>>1]<>1]<>1]<>>1)&65535)>>>l&65535,k[o+(r*6|0)>>1]=(C+32768-t&65535)>>>l,k[o+(r*6|0)+2>>1]=(t&65535)>>>l,k[o+(r*6|0)+4>>1]=E,r=r+1|0;while((r|0)!=(a|0));return}else{if(d=(l|0)<(a|0)?l:a,(d|0)<=0)return;w=l<<1,h=e[t+32>>2]|0,r=0;do a=M[D+(r*6|0)>>1]<>1]<>1]<>>1)&65535)>>>h&65535,k[o+(r<<1)>>1]=(a+32768-t&65535)>>>h,k[o+(r+l<<1)>>1]=(t&65535)>>>h,k[o+(r+w<<1)>>1]=E,r=r+1|0;while((r|0)!=(d|0));return}case 4:{if((e[h+24>>2]|0)!=1||(d=(l|0)<(a|0)?l:a,(d|0)<=0))return;w=l<<1,C=l*3|0,h=e[t+32>>2]|0,r=0;do E=k[D+(r<<3)+6>>1]|0,F=M[D+(r<<3)>>1]<>1]<>1]<>>1)&65535)>>>h&65535,k[o+(r<<1)>>1]=(F+32768-a&65535)>>>h,k[o+(r+l<<1)>>1]=(a&65535)>>>h,k[o+(r+w<<1)>>1]=t,k[o+(r+C<<1)>>1]=E,r=r+1|0;while((r|0)!=(d|0));return}default:return}}function ja(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;F=b,b=b+176|0,R=F+152|0,U=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=U+56|0,C=U+4|0,e[U>>2]=36160,e[D>>2]=36180,m=0,Ae(62,U+56|0,C|0),F=m,m=0,F&1&&(U=j()|0,tt(D),le(U|0)),e[U+128>>2]=0,e[U+132>>2]=-1,e[U>>2]=36200,e[U+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=U+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[U+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,U|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);U=h,tt(D),le(U|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){U=e[d>>2]|0,Vn(t,U,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),U=e[d>>2]|0,Vn(t,U,o,a,l),b=F}function Kr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;D=t+4|0,h=e[D>>2]|0;e:do switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)<=0)break e;h=t+40|0,t=0;do C=e[h>>2]|0,w=M[r+(t*6|0)+2>>1]<>1]<>1]<>>1)&65535)>>>C&65535,k[o+(t*6|0)>>1]=d>>>C,k[o+(t*6|0)+2>>1]=w>>>C,k[o+(t*6|0)+4>>1]=l,t=t+1|0;while((t|0)!=(a|0))}else{if(d=(a|0)<(l|0)?a:l,(d|0)<=0)break e;w=l<<1,h=t+40|0,t=0;do E=e[h>>2]|0,F=M[r+(t+l<<1)>>1]<>1]<>1]<>>1)&65535)>>>E&65535,k[o+(t*6|0)>>1]=R>>>E,k[o+(t*6|0)+2>>1]=F>>>E,k[o+(t*6|0)+4>>1]=C,t=t+1|0;while((t|0)!=(d|0))}break}case 4:{if((e[h+24>>2]|0)==1&&(C=(a|0)<(l|0)?a:l,(C|0)>0)){w=l<<1,h=t+40|0,t=l*3|0,d=0;do E=e[h>>2]|0,R=M[r+(d+l<<1)>>1]<>1]<>1]<>>1)&65535)>>>E,_=k[r+(d+t<<1)>>1]|0,R=v0(R>>>E&65535|0,0,16)|0,F=ye|F,_=v0(_&65535|0,0,48)|0,_=U>>>E&65535|R|_,F=F&65535|ye,R=o+(d<<3)|0,E=R,k[E>>1]=_,k[E+2>>1]=_>>>16,R=R+4|0,k[R>>1]=F,k[R+2>>1]=F>>>16,d=d+1|0;while((d|0)!=(C|0))}break}default:}while(!1);if(h=e[D>>2]|0,!!(S[h+32>>0]|0)&&(d=e[h+16>>2]|0,!((a|0)<=0)))for(h=o,t=0;U=h+4|0,_=k[h>>1]|0,k[h>>1]=k[U>>1]|0,k[U>>1]=_,t=t+1|0,(t|0)!=(a|0);)h=h+(d<<1)|0}function Xa(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36364,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function Za(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36364,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Ja(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+48|0,!(e[l>>2]|0)){w=t+52|0,Yr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Yr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function el(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+48>>2]|0,l){tl(t,l,r,o,a);return}else{l=t+52|0,Un(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Un(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;C=t+4|0,h=e[C>>2]|0;do if(!(S[h+32>>0]|0))D=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*6|0)|0,h=e[C>>2]|0,w=e[h+16>>2]|0,(a|0)<=0){D=e[d>>2]|0;break}for(r=e[d>>2]|0,h=r,d=0;D=h+4|0,E=k[h>>1]|0,k[h>>1]=k[D>>1]|0,k[D>>1]=E,d=d+1|0,(d|0)!=(a|0);)h=h+(w<<1)|0;D=r,h=e[C>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:if((e[h+24>>2]|0)==2){if((a|0)<=0)return;h=t+32|0,r=0;do l=e[h>>2]|0,t=M[D+(r*6|0)+2>>1]<>1]<>>l&65535,k[o+(r*6|0)>>1]=((M[D+(r*6|0)>>1]<>>l,k[o+(r*6|0)+2>>1]=(t&65535)>>>l,k[o+(r*6|0)+4>>1]=E,r=r+1|0;while((r|0)!=(a|0));return}else{if(d=(l|0)<(a|0)?l:a,(d|0)<=0)return;w=l<<1,h=e[t+32>>2]|0,r=0;do t=M[D+(r*6|0)+2>>1]<>1]<>>h&65535,k[o+(r<<1)>>1]=((M[D+(r*6|0)>>1]<>>h,k[o+(r+l<<1)>>1]=(t&65535)>>>h,k[o+(r+w<<1)>>1]=E,r=r+1|0;while((r|0)!=(d|0));return}case 4:{if((e[h+24>>2]|0)!=1||(w=(l|0)<(a|0)?l:a,(w|0)<=0))return;C=l<<1,d=l*3|0,h=e[t+32>>2]|0,r=0;do E=k[D+(r<<3)+6>>1]|0,a=M[D+(r<<3)+2>>1]<>1]<>>h&65535,k[o+(r<<1)>>1]=((M[D+(r<<3)>>1]<>>h,k[o+(r+l<<1)>>1]=(a&65535)>>>h,k[o+(r+C<<1)>>1]=t,k[o+(r+d<<1)>>1]=E,r=r+1|0;while((r|0)!=(w|0));return}default:return}}function tl(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;F=b,b=b+176|0,R=F+152|0,U=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=U+56|0,C=U+4|0,e[U>>2]=36160,e[D>>2]=36180,m=0,Ae(62,U+56|0,C|0),F=m,m=0,F&1&&(U=j()|0,tt(D),le(U|0)),e[U+128>>2]=0,e[U+132>>2]=-1,e[U>>2]=36200,e[U+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=U+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[U+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,U|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);U=h,tt(D),le(U|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){U=e[d>>2]|0,Un(t,U,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),U=e[d>>2]|0,Un(t,U,o,a,l),b=F}function Yr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;D=t+4|0,h=e[D>>2]|0;e:do switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)<=0)break e;h=t+40|0,t=0;do C=e[h>>2]|0,w=M[r+(t*6|0)+2>>1]<>1]<>>C&65535,k[o+(t*6|0)>>1]=((M[r+(t*6|0)>>1]<>>C,k[o+(t*6|0)+2>>1]=(w&65535)>>>C,k[o+(t*6|0)+4>>1]=l,t=t+1|0;while((t|0)!=(a|0))}else{if(d=(a|0)<(l|0)?a:l,(d|0)<=0)break e;w=l<<1,h=t+40|0,t=0;do E=e[h>>2]|0,F=M[r+(t+l<<1)>>1]<>1]<>>E&65535,k[o+(t*6|0)>>1]=((M[r+(t<<1)>>1]<>>E,k[o+(t*6|0)+2>>1]=(F&65535)>>>E,k[o+(t*6|0)+4>>1]=C,t=t+1|0;while((t|0)!=(d|0))}break}case 4:{if((e[h+24>>2]|0)==1&&(C=(a|0)<(l|0)?a:l,(C|0)>0)){w=l<<1,h=t+40|0,t=l*3|0,d=0;do R=e[h>>2]|0,U=M[r+(d+l<<1)>>1]<>1]<>>R,E=(U+32768+(M[r+(d+w<<1)>>1]<>>R,_=k[r+(d+t<<1)>>1]|0,R=v0((U&65535)>>>R&65535|0,0,16)|0,E=E|ye,_=v0(_&65535|0,0,48)|0,_=R|F&65535|_,E=E&65535|ye,F=o+(d<<3)|0,R=F,k[R>>1]=_,k[R+2>>1]=_>>>16,F=F+4|0,k[F>>1]=E,k[F+2>>1]=E>>>16,d=d+1|0;while((d|0)!=(C|0))}break}default:}while(!1);if(h=e[D>>2]|0,!!(S[h+32>>0]|0)&&(d=e[h+16>>2]|0,!((a|0)<=0)))for(h=o,t=0;U=h+4|0,_=k[h>>1]|0,k[h>>1]=k[U>>1]|0,k[U>>1]=_,t=t+1|0,(t|0)!=(a|0);)h=h+(d<<1)|0}function Ui(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0;if(F=b,b=b+16|0,D=F,E=e[t>>2]|0,!E)return t=0,b=F,t|0;if(R=r,w=a-R|0,C=l+12|0,d=e[C>>2]|0,w=(d|0)>(w|0)?d-w|0:0,d=o,l=d-R|0,(l|0)>0&&(Yt[e[(e[E>>2]|0)+48>>2]&63](E,r,l)|0)!=(l|0))return e[t>>2]=0,R=0,b=F,R|0;do if((w|0)>0){if(dr(D,w,h),m=0,l=Ve(e[(e[E>>2]|0)+48>>2]|0,E|0,(S[D>>0]&1?e[D+8>>2]|0:D+1|0)|0,w|0)|0,R=m,m=0,R&1&&(R=j()|0,de(D),le(R|0)),(l|0)==(w|0)){de(D);break}return e[t>>2]=0,de(D),R=0,b=F,R|0}while(!1);return a=a-d|0,(a|0)>0&&(Yt[e[(e[E>>2]|0)+48>>2]&63](E,o,a)|0)!=(a|0)?(e[t>>2]=0,R=0,b=F,R|0):(e[C>>2]=0,R=E,b=F,R|0)}function il(t){t=t|0,e[t>>2]=36236,de(t+32|0),wt(t)}function nl(t){t=t|0,e[t>>2]=36236,de(t+32|0),wt(t),he(t)}function rl(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(d=r+44|0,w=e[d>>2]|0,D=r+24|0,E=e[D>>2]|0,w>>>0>>0&&(e[d>>2]=E,w=E),C=w,d=h&24,!d){r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}if((l|0)==1&(d|0)==24){r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}e:do switch(l|0){case 0:{d=0,l=0;break}case 1:if(h&8){l=(e[r+12>>2]|0)-(e[r+8>>2]|0)|0,d=l,l=((l|0)<0)<<31>>31;break e}else{l=E-(e[r+20>>2]|0)|0,d=l,l=((l|0)<0)<<31>>31;break e}case 2:{d=r+32|0,S[d>>0]&1?d=e[r+40>>2]|0:d=d+1|0,l=w-d|0,d=l,l=((l|0)<0)<<31>>31;break}default:{r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}}while(!1);if(l=$0(d|0,l|0,o|0,a|0)|0,o=ye,(o|0)>=0&&(d=r+32|0,S[d>>0]&1?d=e[r+40>>2]|0:d=d+1|0,a=w-d|0,w=((a|0)<0)<<31>>31,!((w|0)<(o|0)|(w|0)==(o|0)&a>>>0>>0))){if(d=h&8,!((l|0)==0&(o|0)==0)){if(d|0&&!(e[r+12>>2]|0)){r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}if((h&16|0)!=0&(E|0)==0){r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}}d&&(e[r+12>>2]=(e[r+8>>2]|0)+l,e[r+16>>2]=C),h&16&&(e[D>>2]=(e[r+20>>2]|0)+l),r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=l,e[r+4>>2]=o;return}r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function sl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,o=o+8|0,Vi[e[(e[r>>2]|0)+16>>2]&15](t,r,e[o>>2]|0,e[o+4>>2]|0,0,a)}function ol(t){t=t|0;var r=0,o=0,a=0,l=0;return r=t+44|0,o=e[r>>2]|0,a=e[t+24>>2]|0,o>>>0>>0&&(e[r>>2]=a,o=a),!(e[t+48>>2]&8)||(l=t+16|0,r=e[l>>2]|0,a=t+12|0,r>>>0>>0?(a=e[a>>2]|0,e[l>>2]=o,r=o):a=e[a>>2]|0,a>>>0>=r>>>0)?(t=-1,t|0):(t=N[a>>0]|0,t|0)}function al(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(a=t+44|0,o=e[a>>2]|0,l=e[t+24>>2]|0,o>>>0>>0&&(e[a>>2]=l,o=l),w=t+8|0,a=e[w>>2]|0,C=t+12|0,h=e[C>>2]|0,d=a,a>>>0>=h>>>0)return t=-1,t|0;if((r|0)==-1)return e[w>>2]=a,e[C>>2]=h+-1,e[t+16>>2]=o,t=0,t|0;if(e[t+48>>2]&16)l=r&255,a=h+-1|0;else if(l=r&255,a=h+-1|0,l<<24>>24!=(S[a>>0]|0))return t=-1,t|0;return e[w>>2]=d,e[C>>2]=a,e[t+16>>2]=o,S[a>>0]=l,t=r,t|0}function ll(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0;if(H=b,b=b+16|0,E=H,(r|0)==-1)return t=0,b=H,t|0;F=t+12|0,R=t+8|0,_=(e[F>>2]|0)-(e[R>>2]|0)|0,U=t+24|0,o=e[U>>2]|0,D=t+28|0,a=e[D>>2]|0;do if((o|0)==(a|0)){if(w=t+48|0,!(e[w>>2]&16))return t=-1,b=H,t|0;if(C=t+20|0,d=e[C>>2]|0,l=o-d|0,h=t+44|0,d=(e[h>>2]|0)-d|0,a=t+32|0,m=0,Ae(67,a|0,0),o=m,m=0,!(o&1)&&(S[a>>0]&1?o=(e[a>>2]&-2)+-1|0:o=10,m=0,ve(8,a|0,o|0,0),o=m,m=0,!(o&1))){o=S[a>>0]|0,o&1?(a=e[t+40>>2]|0,o=e[t+36>>2]|0):(a=a+1|0,o=(o&255)>>>1),K=a+o|0,e[C>>2]=a,e[D>>2]=K,C=a+l|0,e[U>>2]=C,o=a+d|0,e[h>>2]=o,a=K;break}return K=j(0)|0,K0(K|0)|0,ei(),K=-1,b=H,K|0}else K=t+44|0,w=t+48|0,h=K,C=o,o=e[K>>2]|0;while(!1);return d=C+1|0,e[E>>2]=d,l=e[(d>>>0>>0?h:E)>>2]|0,e[h>>2]=l,e[w>>2]&8&&(o=t+32|0,S[o>>0]&1?o=e[t+40>>2]|0:o=o+1|0,e[R>>2]=o,e[F>>2]=o+_,e[t+16>>2]=l),(C|0)==(a|0)?(K=U0[e[(e[t>>2]|0)+52>>2]&63](t,r&255)|0,b=H,K|0):(e[U>>2]=d,S[C>>0]=r,K=r&255,b=H,K|0)}function ul(t){t=t|0;var r=0,o=0;e[t>>2]=36200,r=t+56|0,e[r>>2]=36220,o=t+4|0,e[o>>2]=36236,de(t+36|0),wt(o),tt(r)}function cl(t){t=t|0;var r=0,o=0;e[t>>2]=36200,r=t+56|0,e[r>>2]=36220,o=t+4|0,e[o>>2]=36236,de(t+36|0),wt(o),tt(r),he(t)}function hl(t){t=t|0;var r=0,o=0,a=0,l=0;l=e[(e[t>>2]|0)+-12>>2]|0,r=t+l|0,e[r>>2]=36200,o=t+(l+56)|0,e[o>>2]=36220,a=t+(l+4)|0,e[a>>2]=36236,de(t+(l+36)|0),wt(a),tt(o),he(r)}function dl(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36388,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function pl(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36388,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function ml(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+36|0,!(e[l>>2]|0)){w=t+40|0,jr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,jr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function gl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){Sl(t,l,r,o,a);return}else{l=t+40|0,zn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function zn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;w=t+4|0,h=e[w>>2]|0;do if(!(S[h+32>>0]|0))C=r;else{if(t=t+8|0,o0(e[t>>2]|0,r|0,a*6|0)|0,h=e[w>>2]|0,d=e[h+16>>2]|0,(a|0)<=0){C=e[t>>2]|0;break}for(t=e[t>>2]|0,h=t,r=0;C=h+4|0,D=k[h>>1]|0,k[h>>1]=k[C>>1]|0,k[C>>1]=D,r=r+1|0,(r|0)!=(a|0);)h=h+(d<<1)|0;C=t,h=e[w>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do w=M[C+(h*6|0)+2>>1]|0,l=32768-w+(M[C+(h*6|0)+4>>1]|0)|0,D=(M[C+(h*6|0)>>1]|0)-w+32768|0,k[o+(h*6|0)>>1]=w+49152+(((l&65535)+(D&65535)|0)>>>2),k[o+(h*6|0)+2>>1]=l,k[o+(h*6|0)+4>>1]=D,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do w=M[C+(r*6|0)+2>>1]|0,a=32768-w+(M[C+(r*6|0)+4>>1]|0)|0,D=(M[C+(r*6|0)>>1]|0)-w+32768|0,k[o+(r<<1)>>1]=w+49152+(((a&65535)+(D&65535)|0)>>>2),k[o+(r+l<<1)>>1]=a,k[o+(r+t<<1)>>1]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do D=k[C+(d<<3)+6>>1]|0,E=M[C+(d<<3)+2>>1]|0,w=32768-E+(M[C+(d<<3)+4>>1]|0)|0,a=(M[C+(d<<3)>>1]|0)-E+32768|0,k[o+(d<<1)>>1]=E+49152+(((w&65535)+(a&65535)|0)>>>2),k[o+(d+l<<1)>>1]=w,k[o+(d+t<<1)>>1]=a,k[o+(d+r<<1)>>1]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function Sl(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;F=b,b=b+176|0,R=F+152|0,U=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=U+56|0,C=U+4|0,e[U>>2]=36160,e[D>>2]=36180,m=0,Ae(62,U+56|0,C|0),F=m,m=0,F&1&&(U=j()|0,tt(D),le(U|0)),e[U+128>>2]=0,e[U+132>>2]=-1,e[U>>2]=36200,e[U+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=U+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[U+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,U|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);U=h,tt(D),le(U|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){U=e[d>>2]|0,zn(t,U,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),U=e[d>>2]|0,zn(t,U,o,a,l),b=F}function jr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(w=M[r+(t*6|0)+2>>1]|0,d=M[r+(t*6|0)+4>>1]|0,l=(M[r+(t*6|0)>>1]|0)-((d+w|0)>>>2)+16384|0,k[o+(t*6|0)>>1]=d+32768+l,k[o+(t*6|0)+2>>1]=l,k[o+(t*6|0)+4>>1]=w+32768+l,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do D=M[r+(d+l<<1)>>1]|0,E=M[r+(d+h<<1)>>1]|0,w=(M[r+(d<<1)>>1]|0)-((E+D|0)>>>2)+16384|0,k[o+(d*6|0)>>1]=E+32768+w,k[o+(d*6|0)+2>>1]=w,k[o+(d*6|0)+4>>1]=D+32768+w,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do D=M[r+(d+l<<1)>>1]|0,F=M[r+(d+t<<1)>>1]|0,E=(M[r+(d<<1)>>1]|0)-((F+D|0)>>>2)+16384|0,R=k[r+(d+h<<1)>>1]|0,_=v0(E&65535|0,0,16)|0,D=D+32768+E|ye,R=v0(R&65535|0,0,48)|0,R=_|F+32768+E&65535|R,D=D&65535|ye,E=o+(d<<3)|0,F=E,k[F>>1]=R,k[F+2>>1]=R>>>16,E=E+4|0,k[E>>1]=D,k[E+2>>1]=D>>>16,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)&&(d=e[t+16>>2]|0,!((a|0)<=0)))for(t=o,h=0;_=t+4|0,R=k[t>>1]|0,k[t>>1]=k[_>>1]|0,k[_>>1]=R,h=h+1|0,(h|0)!=(a|0);)t=t+(d<<1)|0}function Al(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36412,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function vl(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36412,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function xl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+36|0,!(e[l>>2]|0)){w=t+40|0,Xr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Xr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function wl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){yl(t,l,r,o,a);return}else{l=t+40|0,Gn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Gn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;w=t+4|0,h=e[w>>2]|0;do if(!(S[h+32>>0]|0))C=r;else{if(t=t+8|0,o0(e[t>>2]|0,r|0,a*6|0)|0,h=e[w>>2]|0,d=e[h+16>>2]|0,(a|0)<=0){C=e[t>>2]|0;break}for(t=e[t>>2]|0,h=t,r=0;C=h+4|0,D=k[h>>1]|0,k[h>>1]=k[C>>1]|0,k[C>>1]=D,r=r+1|0,(r|0)!=(a|0);)h=h+(d<<1)|0;C=t,h=e[w>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do d=M[C+(h*6|0)>>1]|0,l=k[C+(h*6|0)+2>>1]|0,w=l&65535,D=(M[C+(h*6|0)+4>>1]|0)+32768-((w+d|0)>>>1)&65535,k[o+(h*6|0)>>1]=d+32768-w,k[o+(h*6|0)+2>>1]=l,k[o+(h*6|0)+4>>1]=D,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do a=k[C+(r*6|0)+2>>1]|0,d=M[C+(r*6|0)>>1]|0,w=a&65535,D=(M[C+(r*6|0)+4>>1]|0)+32768-((w+d|0)>>>1)&65535,k[o+(r<<1)>>1]=d+32768-w,k[o+(r+l<<1)>>1]=a,k[o+(r+t<<1)>>1]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do w=k[C+(d<<3)+2>>1]|0,D=k[C+(d<<3)+6>>1]|0,F=M[C+(d<<3)>>1]|0,E=w&65535,a=(M[C+(d<<3)+4>>1]|0)+32768-((E+F|0)>>>1)&65535,k[o+(d<<1)>>1]=F+32768-E,k[o+(d+l<<1)>>1]=w,k[o+(d+t<<1)>>1]=a,k[o+(d+r<<1)>>1]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function yl(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;F=b,b=b+176|0,R=F+152|0,U=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=U+56|0,C=U+4|0,e[U>>2]=36160,e[D>>2]=36180,m=0,Ae(62,U+56|0,C|0),F=m,m=0,F&1&&(U=j()|0,tt(D),le(U|0)),e[U+128>>2]=0,e[U+132>>2]=-1,e[U>>2]=36200,e[U+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=U+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[U+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,U|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);U=h,tt(D),le(U|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){U=e[d>>2]|0,Gn(t,U,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),U=e[d>>2]|0,Gn(t,U,o,a,l),b=F}function Xr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(w=k[r+(t*6|0)+2>>1]|0,l=w&65535,d=(M[r+(t*6|0)>>1]|0)+32768+l|0,l=(M[r+(t*6|0)+4>>1]|0)+32768+(((d&65535)+l|0)>>>1)&65535,k[o+(t*6|0)>>1]=d,k[o+(t*6|0)+2>>1]=w,k[o+(t*6|0)+4>>1]=l,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do D=k[r+(d+l<<1)>>1]|0,w=D&65535,E=(M[r+(d<<1)>>1]|0)+32768+w|0,w=(M[r+(d+h<<1)>>1]|0)+32768+(((E&65535)+w|0)>>>1)&65535,k[o+(d*6|0)>>1]=E,k[o+(d*6|0)+2>>1]=D,k[o+(d*6|0)+4>>1]=w,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=k[r+(d+l<<1)>>1]|0,D=E&65535,F=(M[r+(d<<1)>>1]|0)+32768+D&65535,D=(M[r+(d+t<<1)>>1]|0)+32768+((F+D|0)>>>1)|0,R=k[r+(d+h<<1)>>1]|0,E=v0(E&65535|0,0,16)|0,D=ye|D,R=v0(R&65535|0,0,48)|0,R=F|E|R,D=D&65535|ye,E=o+(d<<3)|0,F=E,k[F>>1]=R,k[F+2>>1]=R>>>16,E=E+4|0,k[E>>1]=D,k[E+2>>1]=D>>>16,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)&&(d=e[t+16>>2]|0,!((a|0)<=0)))for(t=o,h=0;R=t+4|0,F=k[t>>1]|0,k[t>>1]=k[R>>1]|0,k[R>>1]=F,h=h+1|0,(h|0)!=(a|0);)t=t+(d<<1)|0}function Cl(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36436,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function Tl(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36436,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Il(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+36|0,!(e[l>>2]|0)){w=t+40|0,Zr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Zr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function kl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){El(t,l,r,o,a);return}else{l=t+40|0,qn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function qn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;w=t+4|0,h=e[w>>2]|0;do if(!(S[h+32>>0]|0))C=r;else{if(t=t+8|0,o0(e[t>>2]|0,r|0,a*6|0)|0,h=e[w>>2]|0,d=e[h+16>>2]|0,(a|0)<=0){C=e[t>>2]|0;break}for(t=e[t>>2]|0,h=t,r=0;C=h+4|0,D=k[h>>1]|0,k[h>>1]=k[C>>1]|0,k[C>>1]=D,r=r+1|0,(r|0)!=(a|0);)h=h+(d<<1)|0;C=t,h=e[w>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do l=k[C+(h*6|0)+2>>1]|0,w=l&65535,D=32768-w+(M[C+(h*6|0)+4>>1]|0)&65535,k[o+(h*6|0)>>1]=(M[C+(h*6|0)>>1]|0)+32768-w,k[o+(h*6|0)+2>>1]=l,k[o+(h*6|0)+4>>1]=D,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do a=k[C+(r*6|0)+2>>1]|0,w=a&65535,D=32768-w+(M[C+(r*6|0)+4>>1]|0)&65535,k[o+(r<<1)>>1]=(M[C+(r*6|0)>>1]|0)+32768-w,k[o+(r+l<<1)>>1]=a,k[o+(r+t<<1)>>1]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do w=k[C+(d<<3)+2>>1]|0,D=k[C+(d<<3)+6>>1]|0,E=w&65535,a=32768-E+(M[C+(d<<3)+4>>1]|0)&65535,k[o+(d<<1)>>1]=(M[C+(d<<3)>>1]|0)+32768-E,k[o+(d+l<<1)>>1]=w,k[o+(d+t<<1)>>1]=a,k[o+(d+r<<1)>>1]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function El(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;F=b,b=b+176|0,R=F+152|0,U=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=U+56|0,C=U+4|0,e[U>>2]=36160,e[D>>2]=36180,m=0,Ae(62,U+56|0,C|0),F=m,m=0,F&1&&(U=j()|0,tt(D),le(U|0)),e[U+128>>2]=0,e[U+132>>2]=-1,e[U>>2]=36200,e[U+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=U+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[U+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,U|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);U=h,tt(D),le(U|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){U=e[d>>2]|0,qn(t,U,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),U=e[d>>2]|0,qn(t,U,o,a,l),b=F}function Zr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(w=k[r+(t*6|0)+2>>1]|0,d=w&65535,l=d+32768+(M[r+(t*6|0)+4>>1]|0)&65535,k[o+(t*6|0)>>1]=(M[r+(t*6|0)>>1]|0)+32768+d,k[o+(t*6|0)+2>>1]=w,k[o+(t*6|0)+4>>1]=l,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do D=k[r+(d+l<<1)>>1]|0,E=D&65535,w=E+32768+(M[r+(d+h<<1)>>1]|0)&65535,k[o+(d*6|0)>>1]=(M[r+(d<<1)>>1]|0)+32768+E,k[o+(d*6|0)+2>>1]=D,k[o+(d*6|0)+4>>1]=w,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=k[r+(d+l<<1)>>1]|0,D=E&65535,F=(M[r+(d<<1)>>1]|0)+32768+D|0,D=D+32768+(M[r+(d+t<<1)>>1]|0)|0,R=k[r+(d+h<<1)>>1]|0,E=v0(E&65535|0,0,16)|0,D=ye|D,R=v0(R&65535|0,0,48)|0,R=F&65535|E|R,D=D&65535|ye,E=o+(d<<3)|0,F=E,k[F>>1]=R,k[F+2>>1]=R>>>16,E=E+4|0,k[E>>1]=D,k[E+2>>1]=D>>>16,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)&&(d=e[t+16>>2]|0,!((a|0)<=0)))for(t=o,h=0;R=t+4|0,F=k[t>>1]|0,k[t>>1]=k[R>>1]|0,k[R>>1]=F,h=h+1|0,(h|0)!=(a|0);)t=t+(d<<1)|0}function Dl(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36460,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function bl(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36460,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Fl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+36|0,!(e[l>>2]|0)){w=t+40|0,Jr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Jr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function Nl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){Rl(t,l,r,o,a);return}else{l=t+40|0,Wn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Wn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0;w=t+4|0,h=e[w>>2]|0;do if(!(S[h+32>>0]|0))C=r;else{if(t=t+8|0,o0(e[t>>2]|0,r|0,a*6|0)|0,h=e[w>>2]|0,d=e[h+16>>2]|0,(a|0)<=0){C=e[t>>2]|0;break}for(t=e[t>>2]|0,h=t,r=0;C=h+4|0,D=k[h>>1]|0,k[h>>1]=k[C>>1]|0,k[C>>1]=D,r=r+1|0,(r|0)!=(a|0);)h=h+(d<<1)|0;C=t,h=e[w>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do l=k[C+(h*6|0)+2>>1]|0,D=k[C+(h*6|0)+4>>1]|0,k[o+(h*6|0)>>1]=k[C+(h*6|0)>>1]|0,k[o+(h*6|0)+2>>1]=l,k[o+(h*6|0)+4>>1]=D,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do a=k[C+(r*6|0)+2>>1]|0,D=k[C+(r*6|0)+4>>1]|0,k[o+(r<<1)>>1]=k[C+(r*6|0)>>1]|0,k[o+(r+l<<1)>>1]=a,k[o+(r+t<<1)>>1]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do w=k[C+(d<<3)+2>>1]|0,a=k[C+(d<<3)+4>>1]|0,D=k[C+(d<<3)+6>>1]|0,k[o+(d<<1)>>1]=k[C+(d<<3)>>1]|0,k[o+(d+l<<1)>>1]=w,k[o+(d+t<<1)>>1]=a,k[o+(d+r<<1)>>1]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function Rl(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;F=b,b=b+176|0,R=F+152|0,U=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=U+56|0,C=U+4|0,e[U>>2]=36160,e[D>>2]=36180,m=0,Ae(62,U+56|0,C|0),F=m,m=0,F&1&&(U=j()|0,tt(D),le(U|0)),e[U+128>>2]=0,e[U+132>>2]=-1,e[U>>2]=36200,e[U+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=U+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[U+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,U|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[U>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);U=h,tt(D),le(U|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){U=e[d>>2]|0,Wn(t,U,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),U=e[d>>2]|0,Wn(t,U,o,a,l),b=F}function Jr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(w=k[r+(t*6|0)+2>>1]|0,l=k[r+(t*6|0)+4>>1]|0,k[o+(t*6|0)>>1]=k[r+(t*6|0)>>1]|0,k[o+(t*6|0)+2>>1]=w,k[o+(t*6|0)+4>>1]=l,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do D=k[r+(d+l<<1)>>1]|0,w=k[r+(d+h<<1)>>1]|0,k[o+(d*6|0)>>1]=k[r+(d<<1)>>1]|0,k[o+(d*6|0)+2>>1]=D,k[o+(d*6|0)+4>>1]=w,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do D=k[r+(d<<1)>>1]|0,R=k[r+(d+h<<1)>>1]|0,E=M[r+(d+t<<1)>>1]|0,F=v0(M[r+(d+l<<1)>>1]|0,0,16)|0,E=ye|E,R=v0(R&65535|0,0,48)|0,R=F|D&65535|R,E=E&65535|ye,D=o+(d<<3)|0,F=D,k[F>>1]=R,k[F+2>>1]=R>>>16,D=D+4|0,k[D>>1]=E,k[D+2>>1]=E>>>16,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)&&(d=e[t+16>>2]|0,!((a|0)<=0)))for(t=o,h=0;R=t+4|0,F=k[t>>1]|0,k[t>>1]=k[R>>1]|0,k[R>>1]=F,h=h+1|0,(h|0)!=(a|0);)t=t+(d<<1)|0}function Ml(t){t=t|0}function _l(t){t=t|0,he(t)}function Pl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,o=ie(e[t+8>>2]|0,o)|0,t=e[t+4>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,r,o)|0)!=(o|0)&&(a=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,a|0,3,35648),t=m,m=0,t&1?(t=j()|0,It(a|0),le(t|0)):Qt(a|0,824,96))}function Ll(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;E=b,b=b+16|0,D=E,C=t+8|0,l=e[C>>2]|0,a=ie(l,o)|0;do if(a){for(d=t+4|0,h=a;l=e[d>>2]|0,l=Yt[e[(e[l>>2]|0)+32>>2]&63](l,r,h)|0,!!l;)if(a=h-l|0,(h|0)==(l|0)){w=11;break}else h=a;if((w|0)==11){l=e[C>>2]|0,h=a;break}a=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,a|0,3,35648),t=m,m=0,t&1?(t=j()|0,It(a|0),le(t|0)):Qt(a|0,824,96)}else h=0;while(!1);if((l|0)==2&&(ti(r,o<<1),l=e[C>>2]|0),a=e[t+12>>2]|0,(a|0)<=(ie(l,o)|0)){b=E;return}t=e[t+4>>2]|0,Vi[e[(e[t>>2]|0)+16>>2]&15](D,t,a-h|0,0,1,24),b=E}function Ol(t){t=t|0,he(t)}function $l(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,a=t+4|0,o0(e[a>>2]|0,r|0,ie(e[t+8>>2]|0,o)|0)|0,e[a>>2]=(e[a>>2]|0)+(e[t+12>>2]|0)}function Bl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,a=t+4|0,o0(r|0,e[a>>2]|0,ie(e[t+8>>2]|0,o)|0)|0,e[a>>2]=(e[a>>2]|0)+(e[t+12>>2]|0)}function Y0(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;e[t+112>>2]=0,e[t+108>>2]=0,D=e[r>>2]|0,l=D;do if(D)if(d=t+92|0,D=t+96|0,w=e[D>>2]|0,C=e[d>>2]|0,o=C,a=w-o|0,a>>>0>=4e4?(a>>>0>4e4&&(h=C+4e4|0,(w|0)!=(h|0))&&(e[D>>2]=h),h=o):(vi(d,4e4-a|0),h=e[d>>2]|0,l=e[r>>2]|0),o=t+116|0,e[o>>2]=h,w=t+124|0,e[w>>2]=h,C=t+104|0,e[C>>2]=l,a=l,l){if((e[a+12>>2]|0)==(e[a+16>>2]|0)){if(r=(Et[e[(e[l>>2]|0)+36>>2]&127](a)|0)==-1,a=e[w>>2]|0,r)break;l=e[o>>2]|0}else a=h,l=h;if(d=a-l|0,d>>>0<=64){if(h=t+92|0,(a|0)==(l|0))a=l;else{a=l,l=0;do S[(e[h>>2]|0)+l>>0]=S[a+l>>0]|0,l=l+1|0,a=e[o>>2]|0;while(l>>>0>>0);l=e[w>>2]|0}h=e[h>>2]|0,r=h,E=r-a|0,e[o>>2]=h,a=l+E|0,e[w>>2]=a,h=t+120|0,e[h>>2]=(e[h>>2]|0)+E,C=e[C>>2]|0,a=Yt[e[(e[C>>2]|0)+32>>2]&63](C,a,(e[D>>2]|0)-(r+d)|0)|0,a=(e[w>>2]|0)+a|0,e[w>>2]=a}}else a=h;else e[t+104>>2]=0,a=e[r+4>>2]|0,o=t+116|0,e[o>>2]=a,a=a+(e[r+8>>2]|0)|0,e[t+124>>2]=a;while(!1);if(o=e[o>>2]|0,o>>>0>=a>>>0){D=o,E=t+120|0,e[E>>2]=D,P0(t);return}for(;;){if((S[o>>0]|0)==-1){a=20;break}if(o=o+1|0,o>>>0>=a>>>0){a=20;break}}if((a|0)==20){E=t+120|0,e[E>>2]=o,P0(t);return}}function vi(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(C=t+8|0,l=e[C>>2]|0,D=t+4|0,o=e[D>>2]|0,a=o,(l-a|0)>>>0>=r>>>0){do S[o>>0]=0,o=(e[D>>2]|0)+1|0,e[D>>2]=o,r=r+-1|0;while(r|0);return}o=e[t>>2]|0,h=a-o+r|0,(h|0)<0&&(pi(t),l=e[C>>2]|0,o=e[t>>2]|0),a=l-o|0,a>>>0<1073741823?(a=a<<1,a=a>>>0>>0?h:a,o=(e[D>>2]|0)-o|0,a?w=8:(l=0,d=0,h=o)):(a=2147483647,o=(e[D>>2]|0)-o|0,w=8),(w|0)==8&&(l=a,d=Xe(a)|0,h=o),o=d+h|0,l=d+l|0,a=o;do S[a>>0]=0,a=o+1|0,o=a,r=r+-1|0;while(r|0);r=e[t>>2]|0,a=(e[D>>2]|0)-r|0,w=d+(h-a)|0,o0(w|0,r|0,a|0)|0,e[t>>2]=w,e[D>>2]=o,e[C>>2]=l,r&&he(r)}function es(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;G=b,b=b+32|0,P=G+12|0,K=G,_=t+180|0,U=(e[_>>2]|0)+4|0,(e[t+32>>2]|0)==1?H=e[t+24>>2]|0:H=1,r=ie(H<<1,U)|0,e[P>>2]=0,L=P+4|0,e[L>>2]=0,e[P+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,P|0),$=m,m=0,$&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,$=m,m=0,!($&1))){e[P>>2]=a,$=a+(r<<1)|0,e[P+8>>2]=$,Jt(a|0,0,o|0)|0,e[L>>2]=$;break}a=j()|0,r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[K>>2]=0,$=K+4|0,e[$>>2]=0,e[K+8>>2]=0;do if(!H)d=18;else{if(H>>>0>1073741823&&(m=0,ue(178,K|0),R=m,m=0,R&1)||(d=16),(d|0)==16&&(l=H<<2,m=0,h=ge(67,l|0)|0,R=m,m=0,!(R&1))){e[K>>2]=h,d=h+(H<<2)|0,e[K+8>>2]=d,Jt(h|0,0,l|0)|0,e[$>>2]=d,d=18;break}a=j()|0,r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+12|0;e:do if((e[h>>2]|0)>0){d=t+4604|0,w=(ie(H,U)|0)+1|0,C=t+4608|0,D=t+92|0,E=(H|0)>0,F=t+4600|0,R=0;t:for(;;){if(o=e[P>>2]|0,r=o+2|0,e[d>>2]=r,o=o+(w<<1)|0,e[C>>2]=o,R&1?(e[d>>2]=o,e[C>>2]=r):r=o,l=e[D>>2]|0,m=0,$e(e[(e[l>>2]|0)+12>>2]|0,l|0,r|0,e[_>>2]|0,U|0),l=m,m=0,l&1){d=28;break}if(E){r=e[d>>2]|0,o=e[C>>2]|0,a=e[K>>2]|0,l=0;do{if(e[F>>2]=e[a+(l<<2)>>2],a=e[_>>2]|0,k[r+(a<<1)>>1]=k[r+(a+-1<<1)>>1]|0,k[o+-2>>1]=k[r>>1]|0,m=0,Ae(68,t|0,0),a=m,m=0,a&1){d=27;break t}a=e[K>>2]|0,e[a+(l<<2)>>2]=e[F>>2],r=(e[d>>2]|0)+(U<<1)|0,e[d>>2]=r,o=(e[C>>2]|0)+(U<<1)|0,e[C>>2]=o,l=l+1|0}while((l|0)<(H|0))}if(R=R+1|0,(R|0)>=(e[h>>2]|0)){d=40;break e}}if((d|0)==27){a=j()|0;break}else if((d|0)==28){a=j()|0;break}}else d=40;while(!1);do if((d|0)==40){if(m=0,ue(182,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[K>>2]|0,o=r,r&&(a=e[$>>2]|0,(a|0)!=(r|0)&&(e[$>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[P>>2]|0,!r){b=G;return}o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=G;return}while(!1);r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function Vl(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=t+4604|0,r=e[F>>2]|0,U=t+180|0,!((e[U>>2]|0)<=0))for(R=t+4608|0,_=t+4612|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=zl(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(Gl(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[U>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function Ul(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;l=t+104|0,(e[l>>2]|0)>>>0<4&&en(t),h=t+100|0,d=t+112|0,w=t+96|0,C=t+108|0,D=t+116|0,r=e[h>>2]|0,a=0;do{if(o=S[d>>0]|0,(r|0)>31)break;r=e[w>>2]|0,o<<24>>24?(S[e[C>>2]>>0]=r>>>25,e[w>>2]=e[w>>2]<<7,r=(e[h>>2]|0)+7|0):(S[e[C>>2]>>0]=r>>>24,e[w>>2]=e[w>>2]<<8,r=(e[h>>2]|0)+8|0),e[h>>2]=r,E=e[C>>2]|0,o=(S[E>>0]|0)==-1&1,S[d>>0]=o,e[C>>2]=E+1,e[l>>2]=(e[l>>2]|0)+-1,e[D>>2]=(e[D>>2]|0)+1,a=a+1|0}while((a|0)<4);o<<24>>24?_t(t,0,(r+-1|0)%8|0):_t(t,0,(r|0)%8|0),(e[l>>2]|0)>>>0<4&&en(t),r=e[h>>2]|0,o=0;do{if((r|0)>31)break;r=e[w>>2]|0,S[d>>0]|0?(S[e[C>>2]>>0]=r>>>25,e[w>>2]=e[w>>2]<<7,r=(e[h>>2]|0)+7|0):(S[e[C>>2]>>0]=r>>>24,e[w>>2]=e[w>>2]<<8,r=(e[h>>2]|0)+8|0),e[h>>2]=r,E=e[C>>2]|0,S[d>>0]=(S[E>>0]|0)==-1&1,e[C>>2]=E+1,e[l>>2]=(e[l>>2]|0)+-1,e[D>>2]=(e[D>>2]|0)+1,o=o+1|0}while((o|0)<4);e[t+132>>2]|0&&en(t)}function en(t){t=t|0;var r=0,o=0,a=0,l=0,h=0;if(r=e[t+132>>2]|0,r||(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,4,35648),t=m,m=0,t&1||Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)),o=t+108|0,a=t+120|0,h=e[a>>2]|0,l=(e[o>>2]|0)-h|0,(Yt[e[(e[r>>2]|0)+48>>2]&63](r,h,l)|0)==(l|0)){h=e[a>>2]|0,e[o>>2]=h,e[t+104>>2]=(e[t+124>>2]|0)-h;return}r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,4,35648),h=m,m=0,h&1||Qt(r|0,824,96),h=j()|0,It(r|0),le(h|0)}function _t(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(D=t+100|0,o=(e[D>>2]|0)-o|0,e[D>>2]=o,(o|0)>-1){E=t+96|0,e[E>>2]=e[E>>2]|r<>2]=e[E>>2]|r>>0-o,C=t+104|0,(e[C>>2]|0)>>>0<4&&(en(t),o=e[D>>2]|0),h=t+112|0,d=t+108|0,w=t+116|0,a=0;!((o|0)>31);)if(o=e[E>>2]|0,S[h>>0]|0?(S[e[d>>2]>>0]=o>>>25,e[E>>2]=e[E>>2]<<7,o=(e[D>>2]|0)+7|0):(S[e[d>>2]>>0]=o>>>24,e[E>>2]=e[E>>2]<<8,o=(e[D>>2]|0)+8|0),e[D>>2]=o,F=e[d>>2]|0,S[h>>0]=(S[F>>0]|0)==-1&1,e[d>>2]=F+1,e[C>>2]=(e[C>>2]|0)+-1,e[w>>2]=(e[w>>2]|0)+1,a=a+1|0,(a|0)>=4){l=11;break}e:do if((l|0)==11&&(o|0)<0){e[E>>2]=e[E>>2]|r>>0-o,(e[C>>2]|0)>>>0<4&&(en(t),o=e[D>>2]|0),a=0;do{if((o|0)>31)break e;o=e[E>>2]|0,S[h>>0]|0?(S[e[d>>2]>>0]=o>>>25,e[E>>2]=e[E>>2]<<7,o=(e[D>>2]|0)+7|0):(S[e[d>>2]>>0]=o>>>24,e[E>>2]=e[E>>2]<<8,o=(e[D>>2]|0)+8|0),e[D>>2]=o,F=e[d>>2]|0,S[h>>0]=(S[F>>0]|0)==-1&1,e[d>>2]=F+1,e[C>>2]=(e[C>>2]|0)+-1,e[w>>2]=(e[w>>2]|0)+1,a=a+1|0}while((a|0)<4)}while(!1);e[E>>2]=e[E>>2]|r<>31,h=(H^r)-H|0,_=t+196+(h*12|0)+10|0,d=k[_>>1]|0,R=t+196+(h*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(r=5;(d<>1]^H)-H+a|0,U=t+136|0,a=e[U>>2]|0,(l&a|0)==(l|0)?D=l:D=a&~(l>>31),l=(o-D^H)-H|0,C=t+144|0,a=e[C>>2]|0,(l|0)>0?l=(l+a|0)/(a<<1|1|0)|0:l=(l-a|0)/(a<<1|1|0)|0,F=t+140|0,w=e[F>>2]|0,o=((l|0)<0?w:0)+l|0,w=o-((o|0)<((w+1|0)/2|0|0)?0:w)|0,h=t+196+(h*12|0)+4|0,a|r?l=0:l=(e[h>>2]<<1)+-1+d>>31,a=l^w,is(t,r,a>>30^a<<1,e[t+156>>2]|0),a=e[t+160>>2]|0,r=(e[R>>2]|0)+((w|0)>-1?w:0-w|0)|0,l=(e[h>>2]|0)+(ie(e[C>>2]<<1|1,w)|0)|0,o=k[_>>1]|0,(o|0)==(a|0)&&(r=r>>1,l=l>>1,o=a>>1),e[R>>2]=r,a=o+1|0,k[_>>1]=a,r=a+l|0,(r|0)>=1?(l|0)>0&&(l=l-a|0,_=k[E>>1]|0,k[E>>1]=(_<<16>>16<127&1)+(_&65535),l=(l|0)>0?0:l):(l=k[E>>1]|0,k[E>>1]=(l&65535)-(l<<16>>16>-128&1),l=(r|0)>(~o|0)?r:0-o|0),e[h>>2]=l,a=e[C>>2]|0,o=a<<1|1,r=(ie(o,(w^H)-H|0)|0)+D|0,(r|0)>=(0-a|0)?(l=e[U>>2]|0,(l+a|0)<(r|0)&&(r=r-(ie(e[F>>2]|0,o)|0)|0)):(r=(ie(e[F>>2]|0,o)|0)+r|0,l=e[U>>2]|0),(r&l|0)==(r|0)?(H=r,H=H&65535,H|0):(H=l&~(r>>31),H=H&65535,H|0)}function Gl(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(C=(e[t+180>>2]|0)-r|0,D=e[t+4608>>2]|0,E=e[t+4604>>2]|0,l=k[D+(r+-1<<1)>>1]|0,w=l&65535,o=e[t+144>>2]|0,h=0;a=D+(h+r<<1)|0,d=(M[a>>1]|0)-w|0,!((((d|0)>-1?d:0-d|0)|0)>(o|0));)if(k[a>>1]=l,h=h+1|0,(h|0)==(C|0)){h=C;break}if(l=(h|0)==(C|0),d=t+4600|0,a=e[36476+(e[d>>2]<<2)>>2]|0,(1<(h|0))o=h;else{o=h;do _t(t,1,1),a=e[d>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[d>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>1]|0,w,M[E+(C<<1)>>1]|0)|0,k[r>>1]=t,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,t=h+1|0,t|0)}function ql(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;return w=o-a|0,C=t+136|0,d=t+144|0,l=e[d>>2]|0,(((w|0)>-1?w:0-w|0)|0)>(l|0)?(h=a-o>>31|1,r=ie(h,r-a|0)|0,(r|0)>0?r=(l+r|0)/(l<<1|1|0)|0:r=(r-l|0)/(l<<1|1|0)|0,w=t+140|0,l=e[w>>2]|0,o=((r|0)<0?l:0)+r|0,l=o-((o|0)<((l+1|0)/2|0|0)?0:l)|0,ts(t,t+4576|0,l),l=ie(l,h)|0,h=e[d>>2]|0,d=h<<1|1,l=(ie(l,d)|0)+a|0,(l|0)>=(0-h|0)?(r=e[C>>2]|0,(r+h|0)<(l|0)&&(l=l-(ie(e[w>>2]|0,d)|0)|0)):(l=(ie(e[w>>2]|0,d)|0)+l|0,r=e[C>>2]|0),(l&r|0)==(l|0)?(C=l,C=C&65535,C|0):(C=r&~(l>>31),C=C&65535,C|0)):(r=r-o|0,(r|0)>0?r=(l+r|0)/(l<<1|1|0)|0:r=(r-l|0)/(l<<1|1|0)|0,w=t+140|0,l=e[w>>2]|0,h=((r|0)<0?l:0)+r|0,l=h-((h|0)<((l+1|0)/2|0|0)?0:l)|0,ts(t,t+4588|0,l),h=e[d>>2]|0,d=h<<1|1,l=(ie(d,l)|0)+o|0,(l|0)>=(0-h|0)?(r=e[C>>2]|0,(r+h|0)<(l|0)&&(l=l-(ie(e[w>>2]|0,d)|0)|0)):(l=(ie(e[w>>2]|0,d)|0)+l|0,r=e[C>>2]|0),(l&r|0)==(l|0)?(C=l,C=C&65535,C|0):(C=r&~(l>>31),C=C&65535,C|0))}function ts(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,is(t,l,a,(e[t+156>>2]|0)+-1-(e[36476+(e[t+4600>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function is(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=o>>r,h=t+148|0,d=a-(e[h>>2]|0)|0,(l|0)<(d+-1|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-31-(e[h>>2]|0)|0)):_t(t,1,d),r=e[h>>2]|0,_t(t,(1<>2]|0,C=t+120|0,r>>>0<((e[C>>2]|0)+-3|0)>>>0){C=t+112|0,d=e[C>>2]|0,t=t+108|0,e[t>>2]=(N[r+1>>0]<<16|N[r>>0]<<24|N[r+2>>0]<<8|N[r+3>>0])>>>d|e[t>>2],t=32-d>>3,e[w>>2]=r+t,e[C>>2]=(t<<3)+d;return}d=t+104|0,o=e[d>>2]|0;do if(o){if((e[o+12>>2]|0)==(e[o+16>>2]|0)){if((Et[e[(e[o>>2]|0)+36>>2]&127](o)|0)==-1)break;r=e[w>>2]|0}if(l=t+124|0,o=e[l>>2]|0,h=o-r|0,h>>>0<=64){if(a=t+92|0,(o|0)==(r|0))o=r;else{o=0;do S[(e[a>>2]|0)+o>>0]=S[r+o>>0]|0,o=o+1|0,r=e[w>>2]|0;while(o>>>0>>0);o=r,r=e[l>>2]|0}E=e[a>>2]|0,a=E,D=a-o|0,e[w>>2]=E,o=r+D|0,e[l>>2]=o,e[C>>2]=(e[C>>2]|0)+D,d=e[d>>2]|0,d=Yt[e[(e[d>>2]|0)+32>>2]&63](d,o,(e[t+96>>2]|0)-(a+h)|0)|0,e[l>>2]=(e[l>>2]|0)+d}}while(!1);for(d=t+112|0,h=t+108|0,t=e[t+124>>2]|0,l=t+-1|0,r=e[w>>2]|0;;){if(r>>>0>=t>>>0){o=14;break}if(a=S[r>>0]|0,o=a&255,a=a<<24>>24==-1,a){if((r|0)==(l|0)){o=25;break}if(r=r+1|0,(S[r>>0]|0)<0){o=25;break}}else r=r+1|0;if(E=e[d>>2]|0,e[h>>2]=o<<24-E|e[h>>2],e[w>>2]=r,E=E+(a?7:8)|0,e[d>>2]=E,(E|0)>=24){o=33;break}}if((o|0)==14){if((e[d>>2]|0)>=1)return;r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,5,35648),E=m,m=0,E&1||Qt(r|0,824,96),E=j()|0,It(r|0),le(E|0)}else if((o|0)==25){if((e[d>>2]|0)>=1)return;r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,5,35648),E=m,m=0,E&1||Qt(r|0,824,96),E=j()|0,It(r|0),le(E|0)}else if((o|0)==33){e:do if(r>>>0>>0)do{if((S[r>>0]|0)==-1)break e;r=r+1|0}while(r>>>0>>0);while(!1);e[C>>2]=r;return}}function Wl(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+144|0;e:do if(e[F>>2]|0)r=t+152|0;else if(o=e[t+136>>2]|0,r=t+152|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+184>>2]|0))&&(e[a+8>>2]|0)==(e[t+188>>2]|0)&&(e[a+12>>2]|0)==(e[t+192>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4612>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4612>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4612>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4612>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4616|0,a=E<<1,l=t+4620|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4612|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+192|0,C=t+188|0,d=t+184|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function j0(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(C=t+8|0,l=e[C>>2]|0,D=t+4|0,o=e[D>>2]|0,a=o,(l-a|0)>>>0>=r>>>0){do S[o>>0]=0,o=(e[D>>2]|0)+1|0,e[D>>2]=o,r=r+-1|0;while(r|0);return}o=e[t>>2]|0,h=a-o+r|0,(h|0)<0&&(pi(t),l=e[C>>2]|0,o=e[t>>2]|0),a=l-o|0,a>>>0<1073741823?(a=a<<1,a=a>>>0>>0?h:a,o=(e[D>>2]|0)-o|0,a?w=8:(l=0,d=0,h=o)):(a=2147483647,o=(e[D>>2]|0)-o|0,w=8),(w|0)==8&&(l=a,d=Xe(a)|0,h=o),o=d+h|0,l=d+l|0,a=o;do S[a>>0]=0,a=o+1|0,o=a,r=r+-1|0;while(r|0);r=e[t>>2]|0,a=(e[D>>2]|0)-r|0,w=d+(h-a)|0,o0(w|0,r|0,a|0)|0,e[t>>2]=w,e[D>>2]=o,e[C>>2]=l,r&&he(r)}function Hl(t){t=t|0;var r=0,o=0;e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Ql(t){t=t|0;var r=0,o=0;if(e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Kl(t){t=t|0;var r=0,o=0;e[t>>2]=36052,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Yl(t){t=t|0;var r=0,o=0;if(e[t>>2]=36052,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function jl(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+136>>2]|0,e[t+144>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+184>>2]=w|0?w:e[C+4>>2]|0,e[t+188>>2]=h,e[t+192>>2]=l,i1(t),l=t+140|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+196+(h*12|0)>>2]=r,e[t+196+(h*12|0)+4>>2]=0,k[t+196+(h*12|0)+8>>1]=0,k[t+196+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4576>>2]=w,e[t+4580>>2]=0,S[t+4584>>0]=C,S[t+4585>>0]=1,S[t+4586>>0]=0,e[t+4588>>2]=w,e[t+4592>>2]=1,S[t+4596>>0]=C,S[t+4597>>0]=1,S[t+4598>>0]=0,e[t+4600>>2]=0,b=d}function Xl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4624)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35828,e[r+128>>2]=e[t+136>>2],e[r+132>>2]=e[t+140>>2],e[r+136>>2]=e[t+144>>2],e[r+140>>2]=e[t+148>>2],e[r+144>>2]=e[t+152>>2],e[r+148>>2]=e[t+156>>2],e[r+152>>2]=e[t+160>>2],l=r+156|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+172>>2]=e[a>>2],e[r+176>>2]=0,e[r+180>>2]=0,e[r+184>>2]=0,l=r+4568|0,a=r+188|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4580|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4592|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,ns(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],ns(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function Zl(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=6,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=6,e[a+12>>2]=t,L=a,b=G,L|0)}function ns(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;K=b,b=b+32|0,$=K+12|0,H=K,R=t+180|0,_=(e[R>>2]|0)+4|0,(e[t+32>>2]|0)==1?U=e[t+24>>2]|0:U=1,r=ie(U<<1,_)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;do if(r){if(r>>>0>715827882&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(d=6),(d|0)==6&&(m=0,o=ge(67,r*6|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,a=o+(r*6|0)|0,e[$+8>>2]=a;k[o>>1]=0,k[o+2>>1]=0,k[o+4>>1]=0,r=r+-1|0,r;)o=o+6|0;e[P>>2]=a;break}a=j()|0,r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),le(a|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!U)d=20;else{if(U>>>0>1073741823&&(m=0,ue(178,H|0),F=m,m=0,F&1)||(d=18),(d|0)==18&&(l=U<<2,m=0,h=ge(67,l|0)|0,F=m,m=0,!(F&1))){e[H>>2]=h,d=h+(U<<2)|0,e[H+8>>2]=d,Jt(h|0,0,l|0)|0,e[G>>2]=d,d=20;break}a=j()|0,r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==20){l=t+12|0;e:do if((e[l>>2]|0)>0){h=t+4604|0,d=(ie(U,_)|0)+1|0,w=t+4608|0,C=t+92|0,D=(U|0)>0,E=t+4600|0,F=0;t:for(;;){if(o=e[$>>2]|0,r=o+6|0,e[h>>2]=r,o=o+(d*6|0)|0,e[w>>2]=o,F&1?(e[h>>2]=o,e[w>>2]=r):r=o,a=e[C>>2]|0,m=0,$e(e[(e[a>>2]|0)+12>>2]|0,a|0,r|0,e[R>>2]|0,_|0),a=m,m=0,a&1){d=30;break}if(D){r=e[H>>2]|0,o=e[h>>2]|0,a=0;do{if(e[E>>2]=e[r+(a<<2)>>2],L=e[R>>2]|0,r=o+(L*6|0)|0,o=o+((L+-1|0)*6|0)|0,k[r>>1]=k[o>>1]|0,k[r+2>>1]=k[o+2>>1]|0,k[r+4>>1]=k[o+4>>1]|0,o=(e[w>>2]|0)+-6|0,r=e[h>>2]|0,k[o>>1]=k[r>>1]|0,k[o+2>>1]=k[r+2>>1]|0,k[o+4>>1]=k[r+4>>1]|0,m=0,Ae(69,t|0,0),o=m,m=0,o&1){d=29;break t}r=e[H>>2]|0,e[r+(a<<2)>>2]=e[E>>2],o=(e[h>>2]|0)+(_*6|0)|0,e[h>>2]=o,e[w>>2]=(e[w>>2]|0)+(_*6|0),a=a+1|0}while((a|0)<(U|0))}if(F=F+1|0,(F|0)>=(e[l>>2]|0)){d=42;break e}}if((d|0)==29){a=j()|0;break}else if((d|0)==30){a=j()|0;break}}else d=42;while(!1);do if((d|0)==42){if(m=0,ue(182,t|0),L=m,m=0,L&1){a=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),b=K;return}while(!1);r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),le(a|0)}function Jl(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0;if(ae=t+180|0,!((e[ae>>2]|0)<=0))for(re=t+4608|0,ce=t+4604|0,Ee=t+4612|0,ne=0;P=ne+-1|0,h=e[re>>2]|0,d=e[ce>>2]|0,r=ne+1|0,l=M[d+(ne*6|0)>>1]|0,J=e[Ee>>2]|0,w=M[d+(P*6|0)>>1]|0,C=l-w|0,D=M[h+(P*6|0)>>1]|0,E=w-D|0,F=((((S[J+((M[d+(r*6|0)>>1]|0)-l)>>0]|0)*9|0)+(S[J+C>>0]|0)|0)*9|0)+(S[J+E>>0]|0)|0,a=M[d+(ne*6|0)+2>>1]|0,R=M[d+(P*6|0)+2>>1]|0,_=a-R|0,U=M[h+(P*6|0)+2>>1]|0,H=R-U|0,K=((((S[J+((M[d+(r*6|0)+2>>1]|0)-a)>>0]|0)*9|0)+(S[J+_>>0]|0)|0)*9|0)+(S[J+H>>0]|0)|0,o=M[d+(ne*6|0)+4>>1]|0,G=M[d+(P*6|0)+4>>1]|0,$=o-G|0,P=M[h+(P*6|0)+4>>1]|0,L=G-P|0,J=((((S[J+((M[d+(r*6|0)+4>>1]|0)-o)>>0]|0)*9|0)+(S[J+$>>0]|0)|0)*9|0)+(S[J+L>>0]|0)|0,K|F|J?(d=M[h+(ne*6|0)>>1]|0,h=l-D>>31,(h^E|0)>=0&&((h^C|0)<0?l=D:l=D-w+l|0),d=Hn(t,F,d,l,0)|0,h=M[(e[re>>2]|0)+(ne*6|0)+2>>1]|0,l=a-U>>31,(l^H|0)>=0&&((l^_|0)<0?a=U:a=U-R+a|0),l=Hn(t,K,h,a,0)|0,h=M[(e[re>>2]|0)+(ne*6|0)+4>>1]|0,a=o-P>>31,(a^L|0)>=0&&((a^$|0)<0?o=P:o=P-G+o|0),L=Hn(t,J,h,o,0)|0,J=e[re>>2]|0,k[J+(ne*6|0)>>1]=d,k[J+(ne*6|0)+2>>1]=l,k[J+(ne*6|0)+4>>1]=L):r=(e1(t,ne,0)|0)+ne|0,(r|0)<(e[ae>>2]|0);)ne=r}function e1(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0;for(ae=b,b=b+48|0,_=ae+30|0,R=ae+24|0,F=ae+18|0,U=ae+12|0,P=ae+6|0,L=ae,J=(e[t+180>>2]|0)-r|0,ne=e[t+4608>>2]|0,H=e[t+4604>>2]|0,$=r+-1|0,K=k[ne+($*6|0)>>1]|0,G=k[ne+($*6|0)+2>>1]|0,$=k[ne+($*6|0)+4>>1]|0,o=K&65535,a=t+144|0,l=G&65535,h=$&65535,E=0;C=E+r|0,d=ne+(C*6|0)|0,w=ne+(C*6|0)+2|0,C=ne+(C*6|0)+4|0,re=(M[d>>1]|0)-o|0,D=e[a>>2]|0,!((((re|0)>-1?re:0-re|0)|0)>(D|0)||(re=(M[w>>1]|0)-l|0,(((re|0)>-1?re:0-re|0)|0)>(D|0))||(re=(M[C>>1]|0)-h|0,(((re|0)>-1?re:0-re|0)|0)>(D|0)));)if(k[d>>1]=K,k[w>>1]=G,k[C>>1]=$,E=E+1|0,(E|0)==(J|0)){E=J;break}if(l=(E|0)==(J|0),h=t+4600|0,a=e[36476+(e[h>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[h>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[h>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>1]=k[re>>1]|0,k[P+2>>1]=k[re+2>>1]|0,k[P+4>>1]=k[re+4>>1]|0,k[L>>1]=K,k[L+2>>1]=G,k[L+4>>1]=$,r=H+(r*6|0)|0,k[F>>1]=k[P>>1]|0,k[F+2>>1]=k[P+2>>1]|0,k[F+4>>1]=k[P+4>>1]|0,k[R>>1]=k[L>>1]|0,k[R+2>>1]=k[L+2>>1]|0,k[R+4>>1]=k[L+4>>1]|0,k[_>>1]=k[r>>1]|0,k[_+2>>1]=k[r+2>>1]|0,k[_+4>>1]=k[r+4>>1]|0,t1(U,t,F,R,_),k[re>>1]=k[U>>1]|0,k[re+2>>1]=k[U+2>>1]|0,k[re+4>>1]=k[U+4>>1]|0,re=e[h>>2]|0,e[h>>2]=(re|0)<1?0:re+-1|0,re=E+1|0,b=ae,re|0)}function Hn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(H=r>>31,h=(H^r)-H|0,_=t+196+(h*12|0)+10|0,d=k[_>>1]|0,R=t+196+(h*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(r=5;(d<>1]^H)-H+a|0,U=t+136|0,a=e[U>>2]|0,(l&a|0)==(l|0)?D=l:D=a&~(l>>31),l=(o-D^H)-H|0,C=t+144|0,a=e[C>>2]|0,(l|0)>0?l=(l+a|0)/(a<<1|1|0)|0:l=(l-a|0)/(a<<1|1|0)|0,F=t+140|0,w=e[F>>2]|0,o=((l|0)<0?w:0)+l|0,w=o-((o|0)<((w+1|0)/2|0|0)?0:w)|0,h=t+196+(h*12|0)+4|0,a|r?l=0:l=(e[h>>2]<<1)+-1+d>>31,a=l^w,rs(t,r,a>>30^a<<1,e[t+156>>2]|0),a=e[t+160>>2]|0,r=(e[R>>2]|0)+((w|0)>-1?w:0-w|0)|0,l=(e[h>>2]|0)+(ie(e[C>>2]<<1|1,w)|0)|0,o=k[_>>1]|0,(o|0)==(a|0)&&(r=r>>1,l=l>>1,o=a>>1),e[R>>2]=r,a=o+1|0,k[_>>1]=a,r=a+l|0,(r|0)>=1?(l|0)>0&&(l=l-a|0,_=k[E>>1]|0,k[E>>1]=(_<<16>>16<127&1)+(_&65535),l=(l|0)>0?0:l):(l=k[E>>1]|0,k[E>>1]=(l&65535)-(l<<16>>16>-128&1),l=(r|0)>(~o|0)?r:0-o|0),e[h>>2]=l,a=e[C>>2]|0,o=a<<1|1,r=(ie(o,(w^H)-H|0)|0)+D|0,(r|0)>=(0-a|0)?(l=e[U>>2]|0,(l+a|0)<(r|0)&&(r=r-(ie(e[F>>2]|0,o)|0)|0)):(r=(ie(e[F>>2]|0,o)|0)+r|0,l=e[U>>2]|0),(r&l|0)==(r|0)?(H=r,H=H&65535,H|0):(H=l&~(r>>31),H=H&65535,H|0)}function rs(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=o>>r,h=t+148|0,d=a-(e[h>>2]|0)|0,(l|0)<(d+-1|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-31-(e[h>>2]|0)|0)):_t(t,1,d),r=e[h>>2]|0,_t(t,(1<>1]|0,R=F-(M[a>>1]|0)>>31|1,h=ie(R,(M[o>>1]|0)-F|0)|0,D=r+144|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,P=r+140|0,C=e[P>>2]|0,w=((h|0)<0?C:0)+h|0,C=w-((w|0)<((C+1|0)/2|0|0)?0:C)|0,w=r+4576|0,Qn(r,w,C),K=M[l+2>>1]|0,G=K-(M[a+2>>1]|0)>>31|1,h=ie(G,(M[o+2>>1]|0)-K|0)|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,_=e[P>>2]|0,$=((h|0)<0?_:0)+h|0,_=$-(($|0)<((_+1|0)/2|0|0)?0:_)|0,Qn(r,w,_),$=M[l+4>>1]|0,H=$-(M[a+4>>1]|0)>>31|1,h=ie(H,(M[o+4>>1]|0)-$|0)|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,E=e[P>>2]|0,h=((h|0)<0?E:0)+h|0,E=h-((h|0)<((E+1|0)/2|0|0)?0:E)|0,Qn(r,w,E),w=e[D>>2]|0,D=w<<1|1,h=(ie(ie(D,C)|0,R)|0)+F|0,o=0-w|0,(h|0)>=(o|0)?(d=e[U>>2]|0,(d+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0),a=d):(h=(ie(e[P>>2]|0,D)|0)+h|0,a=e[U>>2]|0),(h&a|0)!=(h|0)&&(h=a&~(h>>31)),l=h&65535,h=(ie(ie(D,_)|0,G)|0)+K|0,(h|0)>=(o|0)?(a+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0):h=(ie(e[P>>2]|0,D)|0)+h|0,(h&a|0)!=(h|0)&&(h=a&~(h>>31)),d=h&65535,h=(ie(ie(D,E)|0,H)|0)+$|0,(h|0)>=(o|0)?(a+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0):h=(ie(e[P>>2]|0,D)|0)+h|0,(h&a|0)==(h|0)){P=h,P=P&65535,k[t>>1]=l,$=t+2|0,k[$>>1]=d,t=t+4|0,k[t>>1]=P;return}P=a&~(h>>31),P=P&65535,k[t>>1]=l,$=t+2|0,k[$>>1]=d,t=t+4|0,k[t>>1]=P}function Qn(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,rs(t,l,a,(e[t+156>>2]|0)+-1-(e[36476+(e[t+4600>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function i1(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+144|0;e:do if(e[F>>2]|0)r=t+152|0;else if(o=e[t+136>>2]|0,r=t+152|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+184>>2]|0))&&(e[a+8>>2]|0)==(e[t+188>>2]|0)&&(e[a+12>>2]|0)==(e[t+192>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4612>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4612>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4612>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4612>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4616|0,a=E<<1,l=t+4620|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4612|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+192|0,C=t+188|0,d=t+184|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function n1(t){t=t|0;var r=0,o=0;e[t>>2]=36024,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function r1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36024,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function s1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+136>>2]|0,e[t+144>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+184>>2]=w|0?w:e[C+4>>2]|0,e[t+188>>2]=h,e[t+192>>2]=l,O1(t),l=t+140|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+196+(h*12|0)>>2]=r,e[t+196+(h*12|0)+4>>2]=0,k[t+196+(h*12|0)+8>>1]=0,k[t+196+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4576>>2]=w,e[t+4580>>2]=0,S[t+4584>>0]=C,S[t+4585>>0]=1,S[t+4586>>0]=0,e[t+4588>>2]=w,e[t+4592>>2]=1,S[t+4596>>0]=C,S[t+4597>>0]=1,S[t+4598>>0]=0,e[t+4600>>2]=0,b=d}function o1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4624)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35800,e[r+128>>2]=e[t+136>>2],e[r+132>>2]=e[t+140>>2],e[r+136>>2]=e[t+144>>2],e[r+140>>2]=e[t+148>>2],e[r+144>>2]=e[t+152>>2],e[r+148>>2]=e[t+156>>2],e[r+152>>2]=e[t+160>>2],l=r+156|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+172>>2]=e[a>>2],e[r+176>>2]=0,e[r+180>>2]=0,e[r+184>>2]=0,l=r+4568|0,a=r+188|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4580|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4592|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,us(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],us(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function l1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0)}function u1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;e[t>>2]=36712,e[t+4>>2]=o,E=t+8|0,a=e[o>>2]|0,C=o+16|0,d=e[C>>2]|0,h=ie(d,a)|0,e[E>>2]=0,F=t+12|0,e[F>>2]=0,e[t+16>>2]=0;do if(!h)h=d;else{if((h|0)<0&&(m=0,ue(178,E|0),d=m,m=0,d&1)||(D=4),(D|0)==4&&(m=0,w=ge(67,h|0)|0,d=m,m=0,!(d&1))){e[F>>2]=w,e[E>>2]=w,e[t+16>>2]=w+h,a=w;do S[a>>0]=0,a=(e[F>>2]|0)+1|0,e[F>>2]=a,h=h+-1|0;while(h|0);h=e[C>>2]|0,a=e[o>>2]|0;break}a=j()|0,l=e[E>>2]|0,l&&((e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l)),F=a,le(F|0)}while(!1);if(d=t+20|0,a=ie(h,a)|0,e[d>>2]=0,h=t+24|0,e[h>>2]=0,e[t+28>>2]=0,!a){F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(D=15),(D|0)==15&&(m=0,l=ge(67,a|0)|0,D=m,m=0,!(D&1))){e[h>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[h>>2]|0)+1|0,e[h>>2]=l,a=a+-1|0;while(a|0);F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}a=j()|0,l=e[d>>2]|0,l&&((e[h>>2]|0)!=(l|0)&&(e[h>>2]=l),he(l)),l=e[E>>2]|0,l||(F=a,le(F|0)),(e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l),F=a,le(F|0)}function c1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;e[t>>2]=36688,e[t+4>>2]=o,E=t+8|0,a=e[o>>2]|0,C=o+16|0,d=e[C>>2]|0,h=ie(d,a)|0,e[E>>2]=0,F=t+12|0,e[F>>2]=0,e[t+16>>2]=0;do if(!h)h=d;else{if((h|0)<0&&(m=0,ue(178,E|0),d=m,m=0,d&1)||(D=4),(D|0)==4&&(m=0,w=ge(67,h|0)|0,d=m,m=0,!(d&1))){e[F>>2]=w,e[E>>2]=w,e[t+16>>2]=w+h,a=w;do S[a>>0]=0,a=(e[F>>2]|0)+1|0,e[F>>2]=a,h=h+-1|0;while(h|0);h=e[C>>2]|0,a=e[o>>2]|0;break}a=j()|0,l=e[E>>2]|0,l&&((e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l)),F=a,le(F|0)}while(!1);if(d=t+20|0,a=ie(h,a)|0,e[d>>2]=0,h=t+24|0,e[h>>2]=0,e[t+28>>2]=0,!a){F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(D=15),(D|0)==15&&(m=0,l=ge(67,a|0)|0,D=m,m=0,!(D&1))){e[h>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[h>>2]|0)+1|0,e[h>>2]=l,a=a+-1|0;while(a|0);F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}a=j()|0,l=e[d>>2]|0,l&&((e[h>>2]|0)!=(l|0)&&(e[h>>2]=l),he(l)),l=e[E>>2]|0,l||(F=a,le(F|0)),(e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l),F=a,le(F|0)}function f1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;e[t>>2]=36664,e[t+4>>2]=o,E=t+8|0,a=e[o>>2]|0,C=o+16|0,d=e[C>>2]|0,h=ie(d,a)|0,e[E>>2]=0,F=t+12|0,e[F>>2]=0,e[t+16>>2]=0;do if(!h)h=d;else{if((h|0)<0&&(m=0,ue(178,E|0),d=m,m=0,d&1)||(D=4),(D|0)==4&&(m=0,w=ge(67,h|0)|0,d=m,m=0,!(d&1))){e[F>>2]=w,e[E>>2]=w,e[t+16>>2]=w+h,a=w;do S[a>>0]=0,a=(e[F>>2]|0)+1|0,e[F>>2]=a,h=h+-1|0;while(h|0);h=e[C>>2]|0,a=e[o>>2]|0;break}a=j()|0,l=e[E>>2]|0,l&&((e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l)),F=a,le(F|0)}while(!1);if(d=t+20|0,a=ie(h,a)|0,e[d>>2]=0,h=t+24|0,e[h>>2]=0,e[t+28>>2]=0,!a){F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(D=15),(D|0)==15&&(m=0,l=ge(67,a|0)|0,D=m,m=0,!(D&1))){e[h>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[h>>2]|0)+1|0,e[h>>2]=l,a=a+-1|0;while(a|0);F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}a=j()|0,l=e[d>>2]|0,l&&((e[h>>2]|0)!=(l|0)&&(e[h>>2]=l),he(l)),l=e[E>>2]|0,l||(F=a,le(F|0)),(e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l),F=a,le(F|0)}function h1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;e[t>>2]=36640,e[t+4>>2]=o,E=t+8|0,a=e[o>>2]|0,C=o+16|0,d=e[C>>2]|0,h=ie(d,a)|0,e[E>>2]=0,F=t+12|0,e[F>>2]=0,e[t+16>>2]=0;do if(!h)h=d;else{if((h|0)<0&&(m=0,ue(178,E|0),d=m,m=0,d&1)||(D=4),(D|0)==4&&(m=0,w=ge(67,h|0)|0,d=m,m=0,!(d&1))){e[F>>2]=w,e[E>>2]=w,e[t+16>>2]=w+h,a=w;do S[a>>0]=0,a=(e[F>>2]|0)+1|0,e[F>>2]=a,h=h+-1|0;while(h|0);h=e[C>>2]|0,a=e[o>>2]|0;break}a=j()|0,l=e[E>>2]|0,l&&((e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l)),F=a,le(F|0)}while(!1);if(d=t+20|0,a=ie(h,a)|0,e[d>>2]=0,h=t+24|0,e[h>>2]=0,e[t+28>>2]=0,!a){F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(D=15),(D|0)==15&&(m=0,l=ge(67,a|0)|0,D=m,m=0,!(D&1))){e[h>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[h>>2]|0)+1|0,e[h>>2]=l,a=a+-1|0;while(a|0);F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}a=j()|0,l=e[d>>2]|0,l&&((e[h>>2]|0)!=(l|0)&&(e[h>>2]=l),he(l)),l=e[E>>2]|0,l||(F=a,le(F|0)),(e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l),F=a,le(F|0)}function d1(t){t=t|0;var r=0,o=0;e[t>>2]=36640,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=e[t+8>>2]|0,o&&(r=t+12|0,(e[r>>2]|0)!=(o|0)&&(e[r>>2]=o),he(o))}function p1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36640,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function m1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=t+36|0,!(e[l>>2]|0)){l=t+40|0,ss(t,r,e[l>>2]|0,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}h=ie(e[(e[t+4>>2]|0)+16>>2]|0,o)|0,d=t+20|0,ss(t,r,e[d>>2]|0,o,a),t=e[l>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,e[d>>2]|0,h)|0)!=(h|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,3,35648),d=m,m=0,d&1?(d=j()|0,It(l|0),le(d|0)):Qt(l|0,824,96))}function g1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){S1(t,l,r,o,a);return}else{l=t+40|0,Kn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Kn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;if(w=t+4|0,h=e[w>>2]|0,!(S[h+32>>0]|0))w=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*3|0)|0,h=e[w>>2]|0,r=e[h+16>>2]|0,(a|0)>0){for(h=e[d>>2]|0,t=0;C=h+2|0,D=S[h>>0]|0,S[h>>0]=S[C>>0]|0,S[C>>0]=D,t=t+1|0,(t|0)!=(a|0);)h=h+r|0;h=e[w>>2]|0}w=e[d>>2]|0}switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do d=N[w+(h*3|0)+1>>0]|0,l=128-d+(N[w+(h*3|0)+2>>0]|0)|0,C=(N[w+(h*3|0)>>0]|0)-d+128|0,D=o+(h*3|0)|0,S[D>>0]=d+192+(((l&255)+(C&255)|0)>>>2),S[D+1>>0]=l,S[D+2>>0]=C,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do a=N[w+(r*3|0)+1>>0]|0,C=128-a+(N[w+(r*3|0)+2>>0]|0)|0,D=(N[w+(r*3|0)>>0]|0)-a+128|0,S[o+r>>0]=a+192+(((C&255)+(D&255)|0)>>>2),S[o+(r+l)>>0]=C,S[o+(r+t)>>0]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do D=S[w+(d<<2)+3>>0]|0,E=N[w+(d<<2)+1>>0]|0,a=128-E+(N[w+(d<<2)+2>>0]|0)|0,C=(N[w+(d<<2)>>0]|0)-E+128|0,S[o+d>>0]=E+192+(((a&255)+(C&255)|0)>>>2),S[o+(d+l)>>0]=a,S[o+(d+t)>>0]=C,S[o+(d+r)>>0]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function S1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+176|0,F=E+152|0,_=E+16|0,R=E,d=ie(e[(e[t+4>>2]|0)+16>>2]|0,a)|0,C=t+20|0,h=e[C>>2]|0,!d){_=h,Kn(t,_,o,a,l),b=E;return}for(;w=Yt[e[(e[r>>2]|0)+32>>2]&63](r,h,d)|0,!!w;)if(h=e[C>>2]|0,(d|0)==(w|0)){D=26;break}else d=d-w|0;if((D|0)==26){Kn(t,h,o,a,l),b=E;return}o=_+56|0,C=_+4|0,e[_>>2]=36160,e[o>>2]=36180,m=0,Ae(62,_+56|0,C|0),E=m,m=0,E&1&&(_=j()|0,tt(o),le(_|0)),e[_+128>>2]=0,e[_+132>>2]=-1,e[_>>2]=36200,e[_+56>>2]=36220,m=0,ue(180,C|0),E=m,m=0;do if(E&1)h=j()|0;else{if(e[C>>2]=36236,r=_+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[_+52>>2]=16,e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,m=0,Ae(63,C|0,F|0),E=m,m=0,E&1){h=j()|0,de(F),de(r),wt(C);break}de(F),m=0,h=Ve(28,_|0,49029,57)|0,F=m,m=0,!(F&1)&&(m=0,Ne(36,h|0,0)|0,F=m,m=0,!(F&1))&&(w=Ct(16)|0,m=0,Ae(64,R|0,C|0),F=m,m=0,F&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,R|0),F=m,m=0,F&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(R),d||(R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0))),It(w|0),R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)),R=j()|0,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)}while(!1);_=h,tt(o),le(_|0)}function ss(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(d=N[r+(t*3|0)+1>>0]|0,h=N[r+(t*3|0)+2>>0]|0,w=(N[r+(t*3|0)>>0]|0)-((h+d|0)>>>2)+64|0,l=o+(t*3|0)|0,S[l>>0]=h+128+w,S[l+1>>0]=w,S[l+2>>0]=d+128+w,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do E=N[r+(d+l)>>0]|0,F=N[r+(d+h)>>0]|0,D=(N[r+d>>0]|0)-((F+E|0)>>>2)+64|0,w=o+(d*3|0)|0,S[w>>0]=F+128+D,S[w+1>>0]=D,S[w+2>>0]=E+128+D,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do D=N[r+(d+l)>>0]|0,R=N[r+(d+t)>>0]|0,E=(N[r+d>>0]|0)-((R+D|0)>>>2)+64|0,F=o+(d<<2)|0,E=E<<8&65280|N[r+(d+h)>>0]<<24|R+128+E&255|D+128+E<<16&16711680,S[F>>0]=E,S[F+1>>0]=E>>8,S[F+2>>0]=E>>16,S[F+3>>0]=E>>24,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)){if(d=e[t+16>>2]|0,(a|0)>0)t=o,h=0;else return;for(;R=t+2|0,F=S[t>>0]|0,S[t>>0]=S[R>>0]|0,S[R>>0]=F,h=h+1|0,(h|0)!=(a|0);)t=t+d|0}}function A1(t){t=t|0;var r=0,o=0;e[t>>2]=36664,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=e[t+8>>2]|0,o&&(r=t+12|0,(e[r>>2]|0)!=(o|0)&&(e[r>>2]=o),he(o))}function v1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36664,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function x1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=t+36|0,!(e[l>>2]|0)){l=t+40|0,os(t,r,e[l>>2]|0,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}h=ie(e[(e[t+4>>2]|0)+16>>2]|0,o)|0,d=t+20|0,os(t,r,e[d>>2]|0,o,a),t=e[l>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,e[d>>2]|0,h)|0)!=(h|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,3,35648),d=m,m=0,d&1?(d=j()|0,It(l|0),le(d|0)):Qt(l|0,824,96))}function w1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){y1(t,l,r,o,a);return}else{l=t+40|0,Yn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Yn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(w=t+4|0,h=e[w>>2]|0,!(S[h+32>>0]|0))w=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*3|0)|0,h=e[w>>2]|0,r=e[h+16>>2]|0,(a|0)>0){for(h=e[d>>2]|0,t=0;C=h+2|0,D=S[h>>0]|0,S[h>>0]=S[C>>0]|0,S[C>>0]=D,t=t+1|0,(t|0)!=(a|0);)h=h+r|0;h=e[w>>2]|0}w=e[d>>2]|0}switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do r=N[w+(h*3|0)>>0]|0,l=S[w+(h*3|0)+1>>0]|0,d=l&255,C=(N[w+(h*3|0)+2>>0]|0)+128-((d+r|0)>>>1)&255,D=o+(h*3|0)|0,S[D>>0]=r+128-d,S[D+1>>0]=l,S[D+2>>0]=C,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do C=S[w+(r*3|0)+1>>0]|0,d=N[w+(r*3|0)>>0]|0,a=C&255,D=(N[w+(r*3|0)+2>>0]|0)+128-((a+d|0)>>>1)&255,S[o+r>>0]=d+128-a,S[o+(r+l)>>0]=C,S[o+(r+t)>>0]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do a=S[w+(d<<2)+1>>0]|0,D=S[w+(d<<2)+3>>0]|0,F=N[w+(d<<2)>>0]|0,E=a&255,C=(N[w+(d<<2)+2>>0]|0)+128-((E+F|0)>>>1)&255,S[o+d>>0]=F+128-E,S[o+(d+l)>>0]=a,S[o+(d+t)>>0]=C,S[o+(d+r)>>0]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function y1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+176|0,F=E+152|0,_=E+16|0,R=E,d=ie(e[(e[t+4>>2]|0)+16>>2]|0,a)|0,C=t+20|0,h=e[C>>2]|0,!d){_=h,Yn(t,_,o,a,l),b=E;return}for(;w=Yt[e[(e[r>>2]|0)+32>>2]&63](r,h,d)|0,!!w;)if(h=e[C>>2]|0,(d|0)==(w|0)){D=26;break}else d=d-w|0;if((D|0)==26){Yn(t,h,o,a,l),b=E;return}o=_+56|0,C=_+4|0,e[_>>2]=36160,e[o>>2]=36180,m=0,Ae(62,_+56|0,C|0),E=m,m=0,E&1&&(_=j()|0,tt(o),le(_|0)),e[_+128>>2]=0,e[_+132>>2]=-1,e[_>>2]=36200,e[_+56>>2]=36220,m=0,ue(180,C|0),E=m,m=0;do if(E&1)h=j()|0;else{if(e[C>>2]=36236,r=_+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[_+52>>2]=16,e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,m=0,Ae(63,C|0,F|0),E=m,m=0,E&1){h=j()|0,de(F),de(r),wt(C);break}de(F),m=0,h=Ve(28,_|0,49029,57)|0,F=m,m=0,!(F&1)&&(m=0,Ne(36,h|0,0)|0,F=m,m=0,!(F&1))&&(w=Ct(16)|0,m=0,Ae(64,R|0,C|0),F=m,m=0,F&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,R|0),F=m,m=0,F&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(R),d||(R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0))),It(w|0),R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)),R=j()|0,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)}while(!1);_=h,tt(o),le(_|0)}function os(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(d=S[r+(t*3|0)+1>>0]|0,w=d&255,h=(N[r+(t*3|0)>>0]|0)+128+w|0,w=(N[r+(t*3|0)+2>>0]|0)+128+(((h&255)+w|0)>>>1)&255,l=o+(t*3|0)|0,S[l>>0]=h,S[l+1>>0]=d,S[l+2>>0]=w,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do E=S[r+(d+l)>>0]|0,D=E&255,F=(N[r+d>>0]|0)+128+D|0,D=(N[r+(d+h)>>0]|0)+128+(((F&255)+D|0)>>>1)&255,w=o+(d*3|0)|0,S[w>>0]=F,S[w+1>>0]=E,S[w+2>>0]=D,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=N[r+(d+l)>>0]|0,D=(N[r+d>>0]|0)+128+E&255,F=o+(d<<2)|0,E=D|E<<8|N[r+(d+h)>>0]<<24|(N[r+(d+t)>>0]|0)+128+((D+E|0)>>>1)<<16&16711680,S[F>>0]=E,S[F+1>>0]=E>>8,S[F+2>>0]=E>>16,S[F+3>>0]=E>>24,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)){if(d=e[t+16>>2]|0,(a|0)>0)t=o,h=0;else return;for(;F=t+2|0,E=S[t>>0]|0,S[t>>0]=S[F>>0]|0,S[F>>0]=E,h=h+1|0,(h|0)!=(a|0);)t=t+d|0}}function C1(t){t=t|0;var r=0,o=0;e[t>>2]=36688,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=e[t+8>>2]|0,o&&(r=t+12|0,(e[r>>2]|0)!=(o|0)&&(e[r>>2]=o),he(o))}function T1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36688,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function I1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=t+36|0,!(e[l>>2]|0)){l=t+40|0,as(t,r,e[l>>2]|0,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}h=ie(e[(e[t+4>>2]|0)+16>>2]|0,o)|0,d=t+20|0,as(t,r,e[d>>2]|0,o,a),t=e[l>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,e[d>>2]|0,h)|0)!=(h|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,3,35648),d=m,m=0,d&1?(d=j()|0,It(l|0),le(d|0)):Qt(l|0,824,96))}function E1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){D1(t,l,r,o,a);return}else{l=t+40|0,jn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function jn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;if(w=t+4|0,h=e[w>>2]|0,!(S[h+32>>0]|0))w=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*3|0)|0,h=e[w>>2]|0,r=e[h+16>>2]|0,(a|0)>0){for(h=e[d>>2]|0,t=0;C=h+2|0,D=S[h>>0]|0,S[h>>0]=S[C>>0]|0,S[C>>0]=D,t=t+1|0,(t|0)!=(a|0);)h=h+r|0;h=e[w>>2]|0}w=e[d>>2]|0}switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do l=S[w+(h*3|0)+1>>0]|0,d=l&255,C=128-d+(N[w+(h*3|0)+2>>0]|0)&255,D=o+(h*3|0)|0,S[D>>0]=(N[w+(h*3|0)>>0]|0)+128-d,S[D+1>>0]=l,S[D+2>>0]=C,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do C=S[w+(r*3|0)+1>>0]|0,a=C&255,D=128-a+(N[w+(r*3|0)+2>>0]|0)&255,S[o+r>>0]=(N[w+(r*3|0)>>0]|0)+128-a,S[o+(r+l)>>0]=C,S[o+(r+t)>>0]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do a=S[w+(d<<2)+1>>0]|0,D=S[w+(d<<2)+3>>0]|0,E=a&255,C=128-E+(N[w+(d<<2)+2>>0]|0)&255,S[o+d>>0]=(N[w+(d<<2)>>0]|0)+128-E,S[o+(d+l)>>0]=a,S[o+(d+t)>>0]=C,S[o+(d+r)>>0]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function D1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+176|0,F=E+152|0,_=E+16|0,R=E,d=ie(e[(e[t+4>>2]|0)+16>>2]|0,a)|0,C=t+20|0,h=e[C>>2]|0,!d){_=h,jn(t,_,o,a,l),b=E;return}for(;w=Yt[e[(e[r>>2]|0)+32>>2]&63](r,h,d)|0,!!w;)if(h=e[C>>2]|0,(d|0)==(w|0)){D=26;break}else d=d-w|0;if((D|0)==26){jn(t,h,o,a,l),b=E;return}o=_+56|0,C=_+4|0,e[_>>2]=36160,e[o>>2]=36180,m=0,Ae(62,_+56|0,C|0),E=m,m=0,E&1&&(_=j()|0,tt(o),le(_|0)),e[_+128>>2]=0,e[_+132>>2]=-1,e[_>>2]=36200,e[_+56>>2]=36220,m=0,ue(180,C|0),E=m,m=0;do if(E&1)h=j()|0;else{if(e[C>>2]=36236,r=_+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[_+52>>2]=16,e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,m=0,Ae(63,C|0,F|0),E=m,m=0,E&1){h=j()|0,de(F),de(r),wt(C);break}de(F),m=0,h=Ve(28,_|0,49029,57)|0,F=m,m=0,!(F&1)&&(m=0,Ne(36,h|0,0)|0,F=m,m=0,!(F&1))&&(w=Ct(16)|0,m=0,Ae(64,R|0,C|0),F=m,m=0,F&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,R|0),F=m,m=0,F&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(R),d||(R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0))),It(w|0),R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)),R=j()|0,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)}while(!1);_=h,tt(o),le(_|0)}function as(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(d=S[r+(t*3|0)+1>>0]|0,h=d&255,w=h+128+(N[r+(t*3|0)+2>>0]|0)&255,l=o+(t*3|0)|0,S[l>>0]=(N[r+(t*3|0)>>0]|0)+128+h,S[l+1>>0]=d,S[l+2>>0]=w,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do E=S[r+(d+l)>>0]|0,F=E&255,D=F+128+(N[r+(d+h)>>0]|0)&255,w=o+(d*3|0)|0,S[w>>0]=(N[r+d>>0]|0)+128+F,S[w+1>>0]=E,S[w+2>>0]=D,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=N[r+(d+l)>>0]|0,F=o+(d<<2)|0,E=(N[r+d>>0]|0)+128+E&255|E<<8|N[r+(d+h)>>0]<<24|E+128+(N[r+(d+t)>>0]|0)<<16&16711680,S[F>>0]=E,S[F+1>>0]=E>>8,S[F+2>>0]=E>>16,S[F+3>>0]=E>>24,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)){if(d=e[t+16>>2]|0,(a|0)>0)t=o,h=0;else return;for(;F=t+2|0,E=S[t>>0]|0,S[t>>0]=S[F>>0]|0,S[F>>0]=E,h=h+1|0,(h|0)!=(a|0);)t=t+d|0}}function b1(t){t=t|0;var r=0,o=0;e[t>>2]=36712,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=e[t+8>>2]|0,o&&(r=t+12|0,(e[r>>2]|0)!=(o|0)&&(e[r>>2]=o),he(o))}function F1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36712,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function N1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=t+36|0,!(e[l>>2]|0)){l=t+40|0,ls(t,r,e[l>>2]|0,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}h=ie(e[(e[t+4>>2]|0)+16>>2]|0,o)|0,d=t+20|0,ls(t,r,e[d>>2]|0,o,a),t=e[l>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,e[d>>2]|0,h)|0)!=(h|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,3,35648),d=m,m=0,d&1?(d=j()|0,It(l|0),le(d|0)):Qt(l|0,824,96))}function R1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){M1(t,l,r,o,a);return}else{l=t+40|0,Xn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Xn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0;if(w=t+4|0,h=e[w>>2]|0,!(S[h+32>>0]|0))w=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*3|0)|0,h=e[w>>2]|0,r=e[h+16>>2]|0,(a|0)>0){for(h=e[d>>2]|0,t=0;C=h+2|0,D=S[h>>0]|0,S[h>>0]=S[C>>0]|0,S[C>>0]=D,t=t+1|0,(t|0)!=(a|0);)h=h+r|0;h=e[w>>2]|0}w=e[d>>2]|0}switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do l=S[w+(h*3|0)+1>>0]|0,C=S[w+(h*3|0)+2>>0]|0,D=o+(h*3|0)|0,S[D>>0]=S[w+(h*3|0)>>0]|0,S[D+1>>0]=l,S[D+2>>0]=C,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do C=S[w+(r*3|0)+1>>0]|0,D=S[w+(r*3|0)+2>>0]|0,S[o+r>>0]=S[w+(r*3|0)>>0]|0,S[o+(r+l)>>0]=C,S[o+(r+t)>>0]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do a=S[w+(d<<2)+1>>0]|0,C=S[w+(d<<2)+2>>0]|0,D=S[w+(d<<2)+3>>0]|0,S[o+d>>0]=S[w+(d<<2)>>0]|0,S[o+(d+l)>>0]=a,S[o+(d+t)>>0]=C,S[o+(d+r)>>0]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function M1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+176|0,F=E+152|0,_=E+16|0,R=E,d=ie(e[(e[t+4>>2]|0)+16>>2]|0,a)|0,C=t+20|0,h=e[C>>2]|0,!d){_=h,Xn(t,_,o,a,l),b=E;return}for(;w=Yt[e[(e[r>>2]|0)+32>>2]&63](r,h,d)|0,!!w;)if(h=e[C>>2]|0,(d|0)==(w|0)){D=26;break}else d=d-w|0;if((D|0)==26){Xn(t,h,o,a,l),b=E;return}o=_+56|0,C=_+4|0,e[_>>2]=36160,e[o>>2]=36180,m=0,Ae(62,_+56|0,C|0),E=m,m=0,E&1&&(_=j()|0,tt(o),le(_|0)),e[_+128>>2]=0,e[_+132>>2]=-1,e[_>>2]=36200,e[_+56>>2]=36220,m=0,ue(180,C|0),E=m,m=0;do if(E&1)h=j()|0;else{if(e[C>>2]=36236,r=_+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[_+52>>2]=16,e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,m=0,Ae(63,C|0,F|0),E=m,m=0,E&1){h=j()|0,de(F),de(r),wt(C);break}de(F),m=0,h=Ve(28,_|0,49029,57)|0,F=m,m=0,!(F&1)&&(m=0,Ne(36,h|0,0)|0,F=m,m=0,!(F&1))&&(w=Ct(16)|0,m=0,Ae(64,R|0,C|0),F=m,m=0,F&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,R|0),F=m,m=0,F&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(R),d||(R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0))),It(w|0),R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)),R=j()|0,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)}while(!1);_=h,tt(o),le(_|0)}function ls(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(d=S[r+(t*3|0)+1>>0]|0,w=S[r+(t*3|0)+2>>0]|0,l=o+(t*3|0)|0,S[l>>0]=S[r+(t*3|0)>>0]|0,S[l+1>>0]=d,S[l+2>>0]=w,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do E=S[r+(d+l)>>0]|0,D=S[r+(d+h)>>0]|0,w=o+(d*3|0)|0,S[w>>0]=S[r+d>>0]|0,S[w+1>>0]=E,S[w+2>>0]=D,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=o+(d<<2)|0,D=N[r+(d+l)>>0]<<8|N[r+d>>0]|N[r+(d+t)>>0]<<16|N[r+(d+h)>>0]<<24,S[E>>0]=D,S[E+1>>0]=D>>8,S[E+2>>0]=D>>16,S[E+3>>0]=D>>24,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)){if(d=e[t+16>>2]|0,(a|0)>0)t=o,h=0;else return;for(;E=t+2|0,D=S[t>>0]|0,S[t>>0]=S[E>>0]|0,S[E>>0]=D,h=h+1|0,(h|0)!=(a|0);)t=t+d|0}}function us(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;K=b,b=b+32|0,$=K+12|0,H=K,R=t+180|0,_=(e[R>>2]|0)+4|0,(e[t+32>>2]|0)==1?U=e[t+24>>2]|0:U=1,r=ie(U<<1,_)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;e:do if(r){if(r>>>0>1431655765&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r*3|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,e[$+8>>2]=o+(r*3|0);;)if(S[o>>0]=0,S[o+1>>0]=0,S[o+2>>0]=0,o=(e[P>>2]|0)+3|0,e[P>>2]=o,r=r+-1|0,!r)break e}a=j()|0,r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!U)h=19;else{if(U>>>0>1073741823&&(m=0,ue(178,H|0),F=m,m=0,F&1)||(h=17),(h|0)==17&&(a=U<<2,m=0,l=ge(67,a|0)|0,F=m,m=0,!(F&1))){e[H>>2]=l,h=l+(U<<2)|0,e[H+8>>2]=h,Jt(l|0,0,a|0)|0,e[G>>2]=h,h=19;break}a=j()|0,r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){l=t+12|0;e:do if((e[l>>2]|0)>0){h=t+4604|0,d=(ie(U,_)|0)+1|0,w=t+4608|0,C=t+92|0,D=(U|0)>0,E=t+4600|0,F=0;t:for(;;){if(a=e[$>>2]|0,r=a+3|0,e[h>>2]=r,o=a+(d*3|0)|0,e[w>>2]=o,F&1?(e[h>>2]=o,e[w>>2]=r,r=1):r=d,o=e[C>>2]|0,m=0,$e(e[(e[o>>2]|0)+12>>2]|0,o|0,a+(r*3|0)|0,e[R>>2]|0,_|0),a=m,m=0,a&1){h=29;break}if(D){r=e[H>>2]|0,o=e[h>>2]|0,a=0;do{if(e[E>>2]=e[r+(a<<2)>>2],L=e[R>>2]|0,r=o+(L*3|0)|0,o=o+((L+-1|0)*3|0)|0,S[r>>0]=S[o>>0]|0,S[r+1>>0]=S[o+1>>0]|0,S[r+2>>0]=S[o+2>>0]|0,r=e[h>>2]|0,o=(e[w>>2]|0)+-3|0,S[o>>0]=S[r>>0]|0,S[o+1>>0]=S[r+1>>0]|0,S[o+2>>0]=S[r+2>>0]|0,m=0,Ae(70,t|0,0),o=m,m=0,o&1){h=28;break t}r=e[H>>2]|0,e[r+(a<<2)>>2]=e[E>>2],o=(e[h>>2]|0)+(_*3|0)|0,e[h>>2]=o,e[w>>2]=(e[w>>2]|0)+(_*3|0),a=a+1|0}while((a|0)<(U|0))}if(F=F+1|0,(F|0)>=(e[l>>2]|0)){h=41;break e}}if((h|0)==28){a=j()|0;break}else if((h|0)==29){a=j()|0;break}}else h=41;while(!1);do if((h|0)==41){if(m=0,ue(182,t|0),L=m,m=0,L&1){a=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),b=K;return}while(!1);r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}function _1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0;if(ae=t+180|0,!((e[ae>>2]|0)<=0))for(re=t+4608|0,ce=t+4604|0,Ee=t+4612|0,ne=0;P=ne+-1|0,h=e[re>>2]|0,d=e[ce>>2]|0,r=ne+1|0,l=N[d+(ne*3|0)>>0]|0,J=e[Ee>>2]|0,w=N[d+(P*3|0)>>0]|0,C=l-w|0,D=N[h+(P*3|0)>>0]|0,E=w-D|0,F=((((S[J+((N[d+(r*3|0)>>0]|0)-l)>>0]|0)*9|0)+(S[J+C>>0]|0)|0)*9|0)+(S[J+E>>0]|0)|0,a=N[d+(ne*3|0)+1>>0]|0,R=N[d+(P*3|0)+1>>0]|0,_=a-R|0,U=N[h+(P*3|0)+1>>0]|0,H=R-U|0,K=((((S[J+((N[d+(r*3|0)+1>>0]|0)-a)>>0]|0)*9|0)+(S[J+_>>0]|0)|0)*9|0)+(S[J+H>>0]|0)|0,o=N[d+(ne*3|0)+2>>0]|0,G=N[d+(P*3|0)+2>>0]|0,$=o-G|0,P=N[h+(P*3|0)+2>>0]|0,L=G-P|0,J=((((S[J+((N[d+(r*3|0)+2>>0]|0)-o)>>0]|0)*9|0)+(S[J+$>>0]|0)|0)*9|0)+(S[J+L>>0]|0)|0,K|F|J?(d=N[h+(ne*3|0)>>0]|0,h=l-D>>31,(h^E|0)>=0&&((h^C|0)<0?l=D:l=D-w+l|0),d=Zn(t,F,d,l,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+1>>0]|0,l=a-U>>31,(l^H|0)>=0&&((l^_|0)<0?a=U:a=U-R+a|0),l=Zn(t,K,h,a,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+2>>0]|0,a=o-P>>31,(a^L|0)>=0&&((a^$|0)<0?o=P:o=P-G+o|0),J=Zn(t,J,h,o,0)|0,ne=(e[re>>2]|0)+(ne*3|0)|0,S[ne>>0]=d,S[ne+1>>0]=l,S[ne+2>>0]=J):r=(P1(t,ne,0)|0)+ne|0,(r|0)<(e[ae>>2]|0);)ne=r}function P1(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0;for(ae=b,b=b+32|0,ne=ae+15|0,R=ae+12|0,F=ae+9|0,_=ae+6|0,$=ae+3|0,P=ae,L=(e[t+180>>2]|0)-r|0,J=e[t+4608>>2]|0,U=e[t+4604>>2]|0,G=J+((r+-1|0)*3|0)|0,H=S[G>>0]|0,K=S[G+1>>0]|0,G=S[G+2>>0]|0,o=H&255,a=t+144|0,l=K&255,h=G&255,E=0;d=J+((E+r|0)*3|0)|0,w=d+1|0,C=d+2|0,re=(N[d>>0]|0)-o|0,D=e[a>>2]|0,!((((re|0)>-1?re:0-re|0)|0)>(D|0)||(re=(N[w>>0]|0)-l|0,(((re|0)>-1?re:0-re|0)|0)>(D|0))||(re=(N[C>>0]|0)-h|0,(((re|0)>-1?re:0-re|0)|0)>(D|0)));)if(S[d>>0]=H,S[w>>0]=K,S[C>>0]=G,E=E+1|0,(E|0)==(L|0)){E=L;break}if(l=(E|0)==(L|0),h=t+4600|0,a=e[36476+(e[h>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[h>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[h>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>0]=S[re>>0]|0,S[$+1>>0]=S[re+1>>0]|0,S[$+2>>0]=S[re+2>>0]|0,S[P>>0]=H,S[P+1>>0]=K,S[P+2>>0]=G,r=U+(r*3|0)|0,S[F>>0]=S[$>>0]|0,S[F+1>>0]=S[$+1>>0]|0,S[F+2>>0]=S[$+2>>0]|0,S[R>>0]=S[P>>0]|0,S[R+1>>0]=S[P+1>>0]|0,S[R+2>>0]=S[P+2>>0]|0,S[ne>>0]=S[r>>0]|0,S[ne+1>>0]=S[r+1>>0]|0,S[ne+2>>0]=S[r+2>>0]|0,L1(_,t,F,R,ne),S[re>>0]=S[_>>0]|0,S[re+1>>0]=S[_+1>>0]|0,S[re+2>>0]=S[_+2>>0]|0,re=e[h>>2]|0,e[h>>2]=(re|0)<1?0:re+-1|0,re=E+1|0,b=ae,re|0)}function Zn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(H=r>>31,h=(H^r)-H|0,_=t+196+(h*12|0)+10|0,d=k[_>>1]|0,R=t+196+(h*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(r=5;(d<>1]^H)-H+a|0,U=t+136|0,a=e[U>>2]|0,(l&a|0)==(l|0)?D=l:D=a&~(l>>31),l=(o-D^H)-H|0,C=t+144|0,a=e[C>>2]|0,(l|0)>0?l=(l+a|0)/(a<<1|1|0)|0:l=(l-a|0)/(a<<1|1|0)|0,F=t+140|0,w=e[F>>2]|0,o=((l|0)<0?w:0)+l|0,w=o-((o|0)<((w+1|0)/2|0|0)?0:w)|0,h=t+196+(h*12|0)+4|0,a|r?l=0:l=(e[h>>2]<<1)+-1+d>>31,a=l^w,cs(t,r,a>>30^a<<1,e[t+156>>2]|0),a=e[t+160>>2]|0,r=(e[R>>2]|0)+((w|0)>-1?w:0-w|0)|0,l=(e[h>>2]|0)+(ie(e[C>>2]<<1|1,w)|0)|0,o=k[_>>1]|0,(o|0)==(a|0)&&(r=r>>1,l=l>>1,o=a>>1),e[R>>2]=r,a=o+1|0,k[_>>1]=a,r=a+l|0,(r|0)>=1?(l|0)>0&&(l=l-a|0,_=k[E>>1]|0,k[E>>1]=(_<<16>>16<127&1)+(_&65535),l=(l|0)>0?0:l):(l=k[E>>1]|0,k[E>>1]=(l&65535)-(l<<16>>16>-128&1),l=(r|0)>(~o|0)?r:0-o|0),e[h>>2]=l,a=e[C>>2]|0,o=a<<1|1,r=(ie(o,(w^H)-H|0)|0)+D|0,(r|0)>=(0-a|0)?(l=e[U>>2]|0,(l+a|0)<(r|0)&&(r=r-(ie(e[F>>2]|0,o)|0)|0)):(r=(ie(e[F>>2]|0,o)|0)+r|0,l=e[U>>2]|0),(r&l|0)==(r|0)?(H=r,H=H&255,H|0):(H=l&~(r>>31),H=H&255,H|0)}function cs(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=o>>r,h=t+148|0,d=a-(e[h>>2]|0)|0,(l|0)<(d+-1|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-31-(e[h>>2]|0)|0)):_t(t,1,d),r=e[h>>2]|0,_t(t,(1<>0]|0,R=F-(N[a>>0]|0)>>31|1,h=ie(R,(N[o>>0]|0)-F|0)|0,D=r+144|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,P=r+140|0,C=e[P>>2]|0,w=((h|0)<0?C:0)+h|0,C=w-((w|0)<((C+1|0)/2|0|0)?0:C)|0,w=r+4576|0,Jn(r,w,C),K=N[l+1>>0]|0,G=K-(N[a+1>>0]|0)>>31|1,h=ie(G,(N[o+1>>0]|0)-K|0)|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,_=e[P>>2]|0,$=((h|0)<0?_:0)+h|0,_=$-(($|0)<((_+1|0)/2|0|0)?0:_)|0,Jn(r,w,_),$=N[l+2>>0]|0,H=$-(N[a+2>>0]|0)>>31|1,h=ie(H,(N[o+2>>0]|0)-$|0)|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,E=e[P>>2]|0,h=((h|0)<0?E:0)+h|0,E=h-((h|0)<((E+1|0)/2|0|0)?0:E)|0,Jn(r,w,E),w=e[D>>2]|0,D=w<<1|1,h=(ie(ie(D,C)|0,R)|0)+F|0,o=0-w|0,(h|0)>=(o|0)?(d=e[U>>2]|0,(d+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0),a=d):(h=(ie(e[P>>2]|0,D)|0)+h|0,a=e[U>>2]|0),(h&a|0)!=(h|0)&&(h=a&~(h>>31)),l=h&255,h=(ie(ie(D,_)|0,G)|0)+K|0,(h|0)>=(o|0)?(a+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0):h=(ie(e[P>>2]|0,D)|0)+h|0,(h&a|0)!=(h|0)&&(h=a&~(h>>31)),d=h&255,h=(ie(ie(D,E)|0,H)|0)+$|0,(h|0)>=(o|0)?(a+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0):h=(ie(e[P>>2]|0,D)|0)+h|0,(h&a|0)==(h|0)){P=h,P=P&255,S[t>>0]=l,$=t+1|0,S[$>>0]=d,t=t+2|0,S[t>>0]=P;return}P=a&~(h>>31),P=P&255,S[t>>0]=l,$=t+1|0,S[$>>0]=d,t=t+2|0,S[t>>0]=P}function Jn(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,cs(t,l,a,(e[t+156>>2]|0)+-1-(e[36476+(e[t+4600>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function O1(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+144|0;e:do if(e[F>>2]|0)r=t+152|0;else if(o=e[t+136>>2]|0,r=t+152|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+184>>2]|0))&&(e[a+8>>2]|0)==(e[t+188>>2]|0)&&(e[a+12>>2]|0)==(e[t+192>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4612>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4612>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4612>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4612>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4616|0,a=E<<1,l=t+4620|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4612|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+192|0,C=t+188|0,d=t+184|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function $1(t){t=t|0;var r=0,o=0;e[t>>2]=35996,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function B1(t){t=t|0;var r=0,o=0;if(e[t>>2]=35996,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function V1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,65535,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+160>>2]=d|0?d:e[w+4>>2]|0,e[t+164>>2]=h,e[t+168>>2]=a,Q1(t),a=0;do e[t+172+(a*12|0)>>2]=1024,e[t+172+(a*12|0)+4>>2]=0,k[t+172+(a*12|0)+8>>1]=0,k[t+172+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4552>>2]=1024,e[t+4556>>2]=0,S[t+4560>>0]=w,S[t+4561>>0]=1,S[t+4562>>0]=0,e[t+4564>>2]=1024,e[t+4568>>2]=1,S[t+4572>>0]=w,S[t+4573>>0]=1,S[t+4574>>0]=0,e[t+4576>>2]=0,b=l}function U1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4600)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35772,l=r+132|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+148>>2]=e[a>>2],e[r+152>>2]=0,e[r+156>>2]=0,e[r+160>>2]=0,l=r+4544|0,a=r+164|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4556|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4568|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,fs(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],fs(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function z1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function fs(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;G=b,b=b+32|0,P=G+12|0,K=G,_=t+156|0,U=(e[_>>2]|0)+4|0,(e[t+32>>2]|0)==1?H=e[t+24>>2]|0:H=1,r=ie(H<<1,U)|0,e[P>>2]=0,L=P+4|0,e[L>>2]=0,e[P+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,P|0),$=m,m=0,$&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,$=m,m=0,!($&1))){e[P>>2]=a,$=a+(r<<1)|0,e[P+8>>2]=$,Jt(a|0,0,o|0)|0,e[L>>2]=$;break}a=j()|0,r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[K>>2]=0,$=K+4|0,e[$>>2]=0,e[K+8>>2]=0;do if(!H)d=18;else{if(H>>>0>1073741823&&(m=0,ue(178,K|0),R=m,m=0,R&1)||(d=16),(d|0)==16&&(l=H<<2,m=0,h=ge(67,l|0)|0,R=m,m=0,!(R&1))){e[K>>2]=h,d=h+(H<<2)|0,e[K+8>>2]=d,Jt(h|0,0,l|0)|0,e[$>>2]=d,d=18;break}a=j()|0,r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+12|0;e:do if((e[h>>2]|0)>0){d=t+4580|0,w=(ie(H,U)|0)+1|0,C=t+4584|0,D=t+92|0,E=(H|0)>0,F=t+4576|0,R=0;t:for(;;){if(o=e[P>>2]|0,r=o+2|0,e[d>>2]=r,o=o+(w<<1)|0,e[C>>2]=o,R&1?(e[d>>2]=o,e[C>>2]=r):r=o,l=e[D>>2]|0,m=0,$e(e[(e[l>>2]|0)+12>>2]|0,l|0,r|0,e[_>>2]|0,U|0),l=m,m=0,l&1){d=28;break}if(E){r=e[d>>2]|0,o=e[C>>2]|0,a=e[K>>2]|0,l=0;do{if(e[F>>2]=e[a+(l<<2)>>2],a=e[_>>2]|0,k[r+(a<<1)>>1]=k[r+(a+-1<<1)>>1]|0,k[o+-2>>1]=k[r>>1]|0,m=0,Ae(71,t|0,0),a=m,m=0,a&1){d=27;break t}a=e[K>>2]|0,e[a+(l<<2)>>2]=e[F>>2],r=(e[d>>2]|0)+(U<<1)|0,e[d>>2]=r,o=(e[C>>2]|0)+(U<<1)|0,e[C>>2]=o,l=l+1|0}while((l|0)<(H|0))}if(R=R+1|0,(R|0)>=(e[h>>2]|0)){d=40;break e}}if((d|0)==27){a=j()|0;break}else if((d|0)==28){a=j()|0;break}}else d=40;while(!1);do if((d|0)==40){if(m=0,ue(182,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[K>>2]|0,o=r,r&&(a=e[$>>2]|0,(a|0)!=(r|0)&&(e[$>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[P>>2]|0,!r){b=G;return}o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=G;return}while(!1);r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function G1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=t+4580|0,r=e[F>>2]|0,U=t+156|0,!((e[U>>2]|0)<=0))for(R=t+4584|0,_=t+4588|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=q1(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(W1(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[U>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function q1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(U=r>>31,C=(U^r)-U|0,_=t+172+(C*12|0)+10|0,d=k[_>>1]|0,R=t+172+(C*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(h=5;(d<>1]^U)-U+a|0,(l&65535|0)==(l|0)?E=l:E=l>>31&65535^65535,w=(o-E^U)-U<<16,D=w>>16,h?l=0:l=(e[t+172+(C*12|0)+4>>2]<<1)+-1+d>>31,a=l^D,a=a>>30^a<<1,l=a>>h,(l|0)<47?((l|0)>30&&(d=(l|0)/2|0,_t(t,0,d),l=l-d|0),_t(t,1,l+1|0),_t(t,a&(1<>1]|0,l=d<<16>>16==64,h=l&1,o=(e[a>>2]|0)+D>>h,d=l?32:d<<16>>16,e[R>>2]=(e[R>>2]|0)+((w|0)>-65536?D:0-D|0)>>h,h=d+1|0,k[_>>1]=h,l=h+o|0,(l|0)<1?(_=k[F>>1]|0,k[F>>1]=(_&65535)-(_<<16>>16>-128&1),_=(l|0)>(~d|0)?l:0-d|0,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&65535,r|0):(o|0)<=0?(_=o,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&65535,r|0):(_=o-h|0,R=k[F>>1]|0,k[F>>1]=(R<<16>>16<127&1)+(R&65535),_=(_|0)>0?0:_,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&65535,r|0)}function W1(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(d=(e[t+156>>2]|0)-r|0,w=e[t+4584>>2]|0,D=e[t+4580>>2]|0,l=k[w+(r+-1<<1)>>1]|0,a=0;;){if(o=w+(a+r<<1)|0,(k[o>>1]|0)!=l<<16>>16){E=a;break}if(k[o>>1]=l,a=a+1|0,(a|0)==(d|0)){E=d;break}}if(h=l&65535,l=(E|0)==(d|0),C=t+4576|0,a=e[36476+(e[C>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[C>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[C>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>1]|0,o=M[D+(o<<1)>>1]|0,D=h-o|0,(((D|0)>-1?D:0-D|0)|0)<1?(o=a-h<<16>>16,hs(t,t+4564|0,o),o=o+h|0):(D=o-h>>31|1,r=(ie(a-o<<16,D)|0)>>16,hs(t,t+4552|0,r),o=(ie(r,D)|0)+o|0),k[l>>1]=o,t=e[C>>2]|0,e[C>>2]=(t|0)<1?0:t+-1|0,t=E+1|0,t|0)}function hs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,H1(t,l,a,63-(e[36476+(e[t+4576>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function H1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=o>>r,h=a+-16|0,(l|0)<(a+-17|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-47|0)):_t(t,1,h),_t(t,o+65535&65535,16)}function Q1(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,65535,0),C=t+160|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+164>>2]|0)&&(e[w+12>>2]|0)==(e[t+168>>2]|0)){C=e[8909]|0,e[t+4588>>2]=C+(((e[8910]|0)-C|0)>>>1),b=D;return}for(o=t+4592|0,a=t+4596|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=131072?h>>>0>131072&&(d=r+131072|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,131072-h|0),r=e[o>>2]|0),w=t+4588|0,e[w>>2]=r+65536,d=t+168|0,l=t+164|0,h=-65536;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==65536)break}b=D}function K1(t){t=t|0;var r=0,o=0;e[t>>2]=35968,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Y1(t){t=t|0;var r=0,o=0;if(e[t>>2]=35968,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function j1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,4095,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+160>>2]=d|0?d:e[w+4>>2]|0,e[t+164>>2]=h,e[t+168>>2]=a,n2(t),a=0;do e[t+172+(a*12|0)>>2]=64,e[t+172+(a*12|0)+4>>2]=0,k[t+172+(a*12|0)+8>>1]=0,k[t+172+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4552>>2]=64,e[t+4556>>2]=0,S[t+4560>>0]=w,S[t+4561>>0]=1,S[t+4562>>0]=0,e[t+4564>>2]=64,e[t+4568>>2]=1,S[t+4572>>0]=w,S[t+4573>>0]=1,S[t+4574>>0]=0,e[t+4576>>2]=0,b=l}function X1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4600)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35744,l=r+132|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+148>>2]=e[a>>2],e[r+152>>2]=0,e[r+156>>2]=0,e[r+160>>2]=0,l=r+4544|0,a=r+164|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4556|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4568|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,ds(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],ds(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function Z1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function ds(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;G=b,b=b+32|0,P=G+12|0,K=G,_=t+156|0,U=(e[_>>2]|0)+4|0,(e[t+32>>2]|0)==1?H=e[t+24>>2]|0:H=1,r=ie(H<<1,U)|0,e[P>>2]=0,L=P+4|0,e[L>>2]=0,e[P+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,P|0),$=m,m=0,$&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,$=m,m=0,!($&1))){e[P>>2]=a,$=a+(r<<1)|0,e[P+8>>2]=$,Jt(a|0,0,o|0)|0,e[L>>2]=$;break}a=j()|0,r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[K>>2]=0,$=K+4|0,e[$>>2]=0,e[K+8>>2]=0;do if(!H)d=18;else{if(H>>>0>1073741823&&(m=0,ue(178,K|0),R=m,m=0,R&1)||(d=16),(d|0)==16&&(l=H<<2,m=0,h=ge(67,l|0)|0,R=m,m=0,!(R&1))){e[K>>2]=h,d=h+(H<<2)|0,e[K+8>>2]=d,Jt(h|0,0,l|0)|0,e[$>>2]=d,d=18;break}a=j()|0,r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+12|0;e:do if((e[h>>2]|0)>0){d=t+4580|0,w=(ie(H,U)|0)+1|0,C=t+4584|0,D=t+92|0,E=(H|0)>0,F=t+4576|0,R=0;t:for(;;){if(o=e[P>>2]|0,r=o+2|0,e[d>>2]=r,o=o+(w<<1)|0,e[C>>2]=o,R&1?(e[d>>2]=o,e[C>>2]=r):r=o,l=e[D>>2]|0,m=0,$e(e[(e[l>>2]|0)+12>>2]|0,l|0,r|0,e[_>>2]|0,U|0),l=m,m=0,l&1){d=28;break}if(E){r=e[d>>2]|0,o=e[C>>2]|0,a=e[K>>2]|0,l=0;do{if(e[F>>2]=e[a+(l<<2)>>2],a=e[_>>2]|0,k[r+(a<<1)>>1]=k[r+(a+-1<<1)>>1]|0,k[o+-2>>1]=k[r>>1]|0,m=0,Ae(72,t|0,0),a=m,m=0,a&1){d=27;break t}a=e[K>>2]|0,e[a+(l<<2)>>2]=e[F>>2],r=(e[d>>2]|0)+(U<<1)|0,e[d>>2]=r,o=(e[C>>2]|0)+(U<<1)|0,e[C>>2]=o,l=l+1|0}while((l|0)<(H|0))}if(R=R+1|0,(R|0)>=(e[h>>2]|0)){d=40;break e}}if((d|0)==27){a=j()|0;break}else if((d|0)==28){a=j()|0;break}}else d=40;while(!1);do if((d|0)==40){if(m=0,ue(182,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[K>>2]|0,o=r,r&&(a=e[$>>2]|0,(a|0)!=(r|0)&&(e[$>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[P>>2]|0,!r){b=G;return}o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=G;return}while(!1);r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function J1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=t+4580|0,r=e[F>>2]|0,U=t+156|0,!((e[U>>2]|0)<=0))for(R=t+4584|0,_=t+4588|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=e2(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(t2(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[U>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function e2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(U=r>>31,C=(U^r)-U|0,_=t+172+(C*12|0)+10|0,d=k[_>>1]|0,R=t+172+(C*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(h=5;(d<>1]^U)-U+a|0,(l&4095|0)==(l|0)?E=l:E=l>>31&4095^4095,w=(o-E^U)-U<<20,D=w>>20,h?l=0:l=(e[t+172+(C*12|0)+4>>2]<<1)+-1+d>>31,a=l^D,a=a>>30^a<<1,l=a>>h,(l|0)<35?((l|0)>30&&(d=(l|0)/2|0,_t(t,0,d),l=l-d|0),_t(t,1,l+1|0),_t(t,a&(1<>1]|0,l=d<<16>>16==64,h=l&1,o=(e[a>>2]|0)+D>>h,d=l?32:d<<16>>16,e[R>>2]=(e[R>>2]|0)+((w|0)>-1048576?D:0-D|0)>>h,h=d+1|0,k[_>>1]=h,l=h+o|0,(l|0)<1?(_=k[F>>1]|0,k[F>>1]=(_&65535)-(_<<16>>16>-128&1),_=(l|0)>(~d|0)?l:0-d|0,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&4095,r=r&65535,r|0):(o|0)<=0?(_=o,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&4095,r=r&65535,r|0):(_=o-h|0,R=k[F>>1]|0,k[F>>1]=(R<<16>>16<127&1)+(R&65535),_=(_|0)>0?0:_,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&4095,r=r&65535,r|0)}function t2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(d=(e[t+156>>2]|0)-r|0,w=e[t+4584>>2]|0,D=e[t+4580>>2]|0,l=k[w+(r+-1<<1)>>1]|0,a=0;;){if(o=w+(a+r<<1)|0,(k[o>>1]|0)!=l<<16>>16){E=a;break}if(k[o>>1]=l,a=a+1|0,(a|0)==(d|0)){E=d;break}}if(h=l&65535,l=(E|0)==(d|0),C=t+4576|0,a=e[36476+(e[C>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[C>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[C>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>1]|0,o=M[D+(o<<1)>>1]|0,D=h-o|0,(((D|0)>-1?D:0-D|0)|0)<1?(o=a-h<<20>>20,ps(t,t+4564|0,o),o=o+h|0):(D=o-h>>31|1,r=(ie(a-o<<20,D)|0)>>20,ps(t,t+4552|0,r),o=(ie(r,D)|0)+o|0),k[l>>1]=o&4095,t=e[C>>2]|0,e[C>>2]=(t|0)<1?0:t+-1|0,t=E+1|0,t|0)}function ps(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,i2(t,l,a,47-(e[36476+(e[t+4576>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function i2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=o>>r,h=a+-12|0,(l|0)<(a+-13|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-43|0)):_t(t,1,h),_t(t,o+4095&4095,12)}function n2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,4095,0),C=t+160|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+164>>2]|0)&&(e[w+12>>2]|0)==(e[t+168>>2]|0)){C=e[8906]|0,e[t+4588>>2]=C+(((e[8907]|0)-C|0)>>>1),b=D;return}for(o=t+4592|0,a=t+4596|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=8192?h>>>0>8192&&(d=r+8192|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,8192-h|0),r=e[o>>2]|0),w=t+4588|0,e[w>>2]=r+4096,d=t+168|0,l=t+164|0,h=-4096;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==4096)break}b=D}function r2(t){t=t|0;var r=0,o=0;e[t>>2]=35940,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function s2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35940,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function o2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,255,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+160>>2]=d|0?d:e[w+4>>2]|0,e[t+164>>2]=h,e[t+168>>2]=a,p2(t),a=0;do e[t+172+(a*12|0)>>2]=4,e[t+172+(a*12|0)+4>>2]=0,k[t+172+(a*12|0)+8>>1]=0,k[t+172+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4552>>2]=4,e[t+4556>>2]=0,S[t+4560>>0]=w,S[t+4561>>0]=1,S[t+4562>>0]=0,e[t+4564>>2]=4,e[t+4568>>2]=1,S[t+4572>>0]=w,S[t+4573>>0]=1,S[t+4574>>0]=0,e[t+4576>>2]=0,b=l}function l2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4600)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35716,l=r+132|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+148>>2]=e[a>>2],e[r+152>>2]=0,e[r+156>>2]=0,e[r+160>>2]=0,l=r+4544|0,a=r+164|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4556|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4568|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,ms(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],ms(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function u2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0)}function ms(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0;K=b,b=b+32|0,$=K+12|0,H=K,R=t+156|0,_=(e[R>>2]|0)+4|0,(e[t+32>>2]|0)==1?U=e[t+24>>2]|0:U=1,r=ie(U<<1,_)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;e:do if(r){if((r|0)<0&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,e[$+8>>2]=o+r;;)if(S[o>>0]=0,o=(e[P>>2]|0)+1|0,e[P>>2]=o,r=r+-1|0,!r)break e}o=j()|0,r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!U)h=19;else{if(U>>>0>1073741823&&(m=0,ue(178,H|0),F=m,m=0,F&1)||(h=17),(h|0)==17&&(a=U<<2,m=0,l=ge(67,a|0)|0,F=m,m=0,!(F&1))){e[H>>2]=l,h=l+(U<<2)|0,e[H+8>>2]=h,Jt(l|0,0,a|0)|0,e[G>>2]=h,h=19;break}o=j()|0,r=e[H>>2]|0,a=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){l=t+12|0;e:do if((e[l>>2]|0)>0){h=t+4580|0,d=(ie(U,_)|0)+1|0,w=t+4584|0,C=t+92|0,D=(U|0)>0,E=t+4576|0,F=0;t:for(;;){if(o=e[$>>2]|0,r=o+1|0,e[h>>2]=r,o=o+d|0,e[w>>2]=o,F&1?(e[h>>2]=o,e[w>>2]=r):r=o,a=e[C>>2]|0,m=0,$e(e[(e[a>>2]|0)+12>>2]|0,a|0,r|0,e[R>>2]|0,_|0),a=m,m=0,a&1){h=29;break}if(D){r=e[h>>2]|0,o=e[H>>2]|0,a=0;do{if(e[E>>2]=e[o+(a<<2)>>2],o=e[R>>2]|0,S[r+o>>0]=S[r+(o+-1)>>0]|0,S[(e[w>>2]|0)+-1>>0]=S[e[h>>2]>>0]|0,m=0,Ae(73,t|0,0),o=m,m=0,o&1){h=28;break t}o=e[H>>2]|0,e[o+(a<<2)>>2]=e[E>>2],r=(e[h>>2]|0)+_|0,e[h>>2]=r,e[w>>2]=(e[w>>2]|0)+_,a=a+1|0}while((a|0)<(U|0))}if(F=F+1|0,(F|0)>=(e[l>>2]|0)){h=41;break e}}if((h|0)==28){o=j()|0;break}else if((h|0)==29){o=j()|0;break}}else h=41;while(!1);do if((h|0)==41){if(m=0,ue(182,t|0),t=m,m=0,t&1){o=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),b=K;return}while(!1);r=e[H>>2]|0,a=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0)}function c2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=t+4580|0,r=e[F>>2]|0,U=t+156|0,!((e[U>>2]|0)<=0))for(R=t+4584|0,_=t+4588|0,l=r,h=N[r+-1>>0]|0,r=N[r>>0]|0,E=0;D=e[R>>2]|0,C=N[D+(E+-1)>>0]|0,a=E+1|0,o=N[l+a>>0]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=f2(t,w,N[D+E>>0]|0,l,0)|0,S[(e[R>>2]|0)+E>>0]=D):(a=(h2(t,E,0)|0)+E|0,o=e[F>>2]|0,r=N[o+(a+-1)>>0]|0,o=N[o+a>>0]|0),!((a|0)>=(e[U>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function f2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(U=r>>31,C=(U^r)-U|0,_=t+172+(C*12|0)+10|0,d=k[_>>1]|0,R=t+172+(C*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(h=5;(d<>1]^U)-U+a|0,(l&255|0)==(l|0)?E=l:E=l>>31&255^255,w=(o-E^U)-U<<24,D=w>>24,h?l=0:l=(e[t+172+(C*12|0)+4>>2]<<1)+-1+d>>31,l=l^D,l=l>>30^l<<1,a=l>>h,(a|0)<23?(_t(t,1,a+1|0),_t(t,l&(1<>1]|0,l=d<<16>>16==64,h=l&1,o=(e[a>>2]|0)+D>>h,d=l?32:d<<16>>16,e[R>>2]=(e[R>>2]|0)+((w|0)>-16777216?D:0-D|0)>>h,h=d+1|0,k[_>>1]=h,l=h+o|0,(l|0)<1?(_=k[F>>1]|0,k[F>>1]=(_&65535)-(_<<16>>16>-128&1),_=(l|0)>(~d|0)?l:0-d|0,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&255,r|0):(o|0)<=0?(_=o,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&255,r|0):(_=o-h|0,R=k[F>>1]|0,k[F>>1]=(R<<16>>16<127&1)+(R&65535),_=(_|0)>0?0:_,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&255,r|0)}function h2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(d=(e[t+156>>2]|0)-r|0,w=e[t+4584>>2]|0,D=e[t+4580>>2]|0,l=S[w+(r+-1)>>0]|0,a=0;;){if(o=w+(a+r)|0,(S[o>>0]|0)!=l<<24>>24){E=a;break}if(S[o>>0]=l,a=a+1|0,(a|0)==(d|0)){E=d;break}}if(h=l&255,l=(E|0)==(d|0),C=t+4576|0,a=e[36476+(e[C>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[C>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[C>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>0]|0,o=N[D+o>>0]|0,D=h-o|0,(((D|0)>-1?D:0-D|0)|0)<1?(o=a-h<<24>>24,gs(t,t+4564|0,o),o=o+h|0):(D=o-h>>31|1,r=(ie(a-o<<24,D)|0)>>24,gs(t,t+4552|0,r),o=(ie(r,D)|0)+o|0),S[l>>0]=o,t=e[C>>2]|0,e[C>>2]=(t|0)<1?0:t+-1|0,t=E+1|0,t|0)}function gs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,d2(t,l,a,31-(e[36476+(e[t+4576>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function d2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=o>>r,h=a+-8|0,(l|0)<(a+-9|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-39|0)):_t(t,1,h),_t(t,o+255&255,8)}function p2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,255,0),C=t+160|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+164>>2]|0)&&(e[w+12>>2]|0)==(e[t+168>>2]|0)){C=e[8900]|0,e[t+4588>>2]=C+(((e[8901]|0)-C|0)>>>1),b=D;return}for(o=t+4592|0,a=t+4596|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=512?h>>>0>512&&(d=r+512|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,512-h|0),r=e[o>>2]|0),w=t+4588|0,e[w>>2]=r+256,d=t+168|0,l=t+164|0,h=-256;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==256)break}b=D}function m2(t){t=t|0;var r=0,o=0;e[t>>2]=35912,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function g2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35912,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function S2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,255,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+160>>2]=d|0?d:e[w+4>>2]|0,e[t+164>>2]=h,e[t+168>>2]=a,C2(t),a=0;do e[t+172+(a*12|0)>>2]=4,e[t+172+(a*12|0)+4>>2]=0,k[t+172+(a*12|0)+8>>1]=0,k[t+172+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4552>>2]=4,e[t+4556>>2]=0,S[t+4560>>0]=w,S[t+4561>>0]=1,S[t+4562>>0]=0,e[t+4564>>2]=4,e[t+4568>>2]=1,S[t+4572>>0]=w,S[t+4573>>0]=1,S[t+4574>>0]=0,e[t+4576>>2]=0,b=l}function A2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4600)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35688,l=r+132|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+148>>2]=e[a>>2],e[r+152>>2]=0,e[r+156>>2]=0,e[r+160>>2]=0,l=r+4544|0,a=r+164|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4556|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4568|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,Ss(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],Ss(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function v2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0)}function Ss(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;K=b,b=b+32|0,$=K+12|0,H=K,R=t+156|0,_=(e[R>>2]|0)+4|0,(e[t+32>>2]|0)==1?U=e[t+24>>2]|0:U=1,r=ie(U<<1,_)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;e:do if(r){if(r>>>0>1431655765&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r*3|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,e[$+8>>2]=o+(r*3|0);;)if(S[o>>0]=0,S[o+1>>0]=0,S[o+2>>0]=0,o=(e[P>>2]|0)+3|0,e[P>>2]=o,r=r+-1|0,!r)break e}a=j()|0,r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!U)h=19;else{if(U>>>0>1073741823&&(m=0,ue(178,H|0),F=m,m=0,F&1)||(h=17),(h|0)==17&&(a=U<<2,m=0,l=ge(67,a|0)|0,F=m,m=0,!(F&1))){e[H>>2]=l,h=l+(U<<2)|0,e[H+8>>2]=h,Jt(l|0,0,a|0)|0,e[G>>2]=h,h=19;break}a=j()|0,r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){l=t+12|0;e:do if((e[l>>2]|0)>0){h=t+4580|0,d=(ie(U,_)|0)+1|0,w=t+4584|0,C=t+92|0,D=(U|0)>0,E=t+4576|0,F=0;t:for(;;){if(a=e[$>>2]|0,r=a+3|0,e[h>>2]=r,o=a+(d*3|0)|0,e[w>>2]=o,F&1?(e[h>>2]=o,e[w>>2]=r,r=1):r=d,o=e[C>>2]|0,m=0,$e(e[(e[o>>2]|0)+12>>2]|0,o|0,a+(r*3|0)|0,e[R>>2]|0,_|0),a=m,m=0,a&1){h=29;break}if(D){r=e[H>>2]|0,o=e[h>>2]|0,a=0;do{if(e[E>>2]=e[r+(a<<2)>>2],L=e[R>>2]|0,r=o+(L*3|0)|0,o=o+((L+-1|0)*3|0)|0,S[r>>0]=S[o>>0]|0,S[r+1>>0]=S[o+1>>0]|0,S[r+2>>0]=S[o+2>>0]|0,r=e[h>>2]|0,o=(e[w>>2]|0)+-3|0,S[o>>0]=S[r>>0]|0,S[o+1>>0]=S[r+1>>0]|0,S[o+2>>0]=S[r+2>>0]|0,m=0,Ae(74,t|0,0),o=m,m=0,o&1){h=28;break t}r=e[H>>2]|0,e[r+(a<<2)>>2]=e[E>>2],o=(e[h>>2]|0)+(_*3|0)|0,e[h>>2]=o,e[w>>2]=(e[w>>2]|0)+(_*3|0),a=a+1|0}while((a|0)<(U|0))}if(F=F+1|0,(F|0)>=(e[l>>2]|0)){h=41;break e}}if((h|0)==28){a=j()|0;break}else if((h|0)==29){a=j()|0;break}}else h=41;while(!1);do if((h|0)==41){if(m=0,ue(182,t|0),L=m,m=0,L&1){a=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),b=K;return}while(!1);r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}function x2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0;if(ae=t+156|0,!((e[ae>>2]|0)<=0))for(re=t+4584|0,ce=t+4580|0,Ee=t+4588|0,ne=0;P=ne+-1|0,h=e[re>>2]|0,d=e[ce>>2]|0,r=ne+1|0,l=N[d+(ne*3|0)>>0]|0,J=e[Ee>>2]|0,w=N[d+(P*3|0)>>0]|0,C=l-w|0,D=N[h+(P*3|0)>>0]|0,E=w-D|0,F=((((S[J+((N[d+(r*3|0)>>0]|0)-l)>>0]|0)*9|0)+(S[J+C>>0]|0)|0)*9|0)+(S[J+E>>0]|0)|0,a=N[d+(ne*3|0)+1>>0]|0,R=N[d+(P*3|0)+1>>0]|0,_=a-R|0,U=N[h+(P*3|0)+1>>0]|0,H=R-U|0,K=((((S[J+((N[d+(r*3|0)+1>>0]|0)-a)>>0]|0)*9|0)+(S[J+_>>0]|0)|0)*9|0)+(S[J+H>>0]|0)|0,o=N[d+(ne*3|0)+2>>0]|0,G=N[d+(P*3|0)+2>>0]|0,$=o-G|0,P=N[h+(P*3|0)+2>>0]|0,L=G-P|0,J=((((S[J+((N[d+(r*3|0)+2>>0]|0)-o)>>0]|0)*9|0)+(S[J+$>>0]|0)|0)*9|0)+(S[J+L>>0]|0)|0,K|F|J?(d=N[h+(ne*3|0)>>0]|0,h=l-D>>31,(h^E|0)>=0&&((h^C|0)<0?l=D:l=D-w+l|0),d=er(t,F,d,l,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+1>>0]|0,l=a-U>>31,(l^H|0)>=0&&((l^_|0)<0?a=U:a=U-R+a|0),l=er(t,K,h,a,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+2>>0]|0,a=o-P>>31,(a^L|0)>=0&&((a^$|0)<0?o=P:o=P-G+o|0),J=er(t,J,h,o,0)|0,ne=(e[re>>2]|0)+(ne*3|0)|0,S[ne>>0]=d,S[ne+1>>0]=l,S[ne+2>>0]=J):r=(w2(t,ne,0)|0)+ne|0,(r|0)<(e[ae>>2]|0);)ne=r}function w2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0;for(D=(e[t+156>>2]|0)-r|0,E=e[t+4584>>2]|0,F=e[t+4580>>2]|0,C=E+((r+-1|0)*3|0)|0,R=S[C>>0]|0,w=S[C+1>>0]|0,C=S[C+2>>0]|0,h=0;o=E+((h+r|0)*3|0)|0,a=o+1|0,l=o+2|0,!!(((S[o>>0]|0)==R<<24>>24?(S[a>>0]|0)==w<<24>>24:0)&(S[l>>0]|0)==C<<24>>24);)if(S[o>>0]=R,S[a>>0]=w,S[l>>0]=C,h=h+1|0,(h|0)==(D|0)){h=D;break}if(l=(h|0)==(D|0),d=t+4576|0,a=e[36476+(e[d>>2]<<2)>>2]|0,(1<(h|0))o=h;else{o=h;do _t(t,1,1),a=e[d>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[d>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>0]|0,r=D+2|0,l=S[r>>0]|0,F=F+(a*3|0)|0,a=S[F+1>>0]|0,K=S[F+2>>0]|0,F=N[F>>0]|0,_=F-(R&255)>>31|1,U=(ie((N[D>>0]|0)-F<<24,_)|0)>>24,H=t+4552|0,tr(t,H,U),R=a&255,a=R-(w&255)>>31|1,o=(ie((o&255)-R<<24,a)|0)>>24,tr(t,H,o),w=K&255,C=w-(C&255)>>31|1,l=(ie((l&255)-w<<24,C)|0)>>24,tr(t,H,l),F=(ie(U,_)|0)+F&255,R=(ie(o,a)|0)+R&255,t=(ie(l,C)|0)+w&255,S[D>>0]=F,S[E>>0]=R,S[r>>0]=t,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,t=h+1|0,t|0)}function er(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(U=r>>31,C=(U^r)-U|0,_=t+172+(C*12|0)+10|0,d=k[_>>1]|0,R=t+172+(C*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(h=5;(d<>1]^U)-U+a|0,(l&255|0)==(l|0)?E=l:E=l>>31&255^255,w=(o-E^U)-U<<24,D=w>>24,h?l=0:l=(e[t+172+(C*12|0)+4>>2]<<1)+-1+d>>31,l=l^D,l=l>>30^l<<1,a=l>>h,(a|0)<23?(_t(t,1,a+1|0),_t(t,l&(1<>1]|0,l=d<<16>>16==64,h=l&1,o=(e[a>>2]|0)+D>>h,d=l?32:d<<16>>16,e[R>>2]=(e[R>>2]|0)+((w|0)>-16777216?D:0-D|0)>>h,h=d+1|0,k[_>>1]=h,l=h+o|0,(l|0)<1?(_=k[F>>1]|0,k[F>>1]=(_&65535)-(_<<16>>16>-128&1),_=(l|0)>(~d|0)?l:0-d|0,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&255,r|0):(o|0)<=0?(_=o,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&255,r|0):(_=o-h|0,R=k[F>>1]|0,k[F>>1]=(R<<16>>16<127&1)+(R&65535),_=(_|0)>0?0:_,e[a>>2]=_,U=D^U,r=r>>>31,r=E+r|0,r=r+U|0,r=r&255,r|0)}function tr(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,y2(t,l,a,31-(e[36476+(e[t+4576>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function y2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=o>>r,h=a+-8|0,(l|0)<(a+-9|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-39|0)):_t(t,1,h),_t(t,o+255&255,8)}function C2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,255,0),C=t+160|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+164>>2]|0)&&(e[w+12>>2]|0)==(e[t+168>>2]|0)){C=e[8900]|0,e[t+4588>>2]=C+(((e[8901]|0)-C|0)>>>1),b=D;return}for(o=t+4592|0,a=t+4596|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=512?h>>>0>512&&(d=r+512|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,512-h|0),r=e[o>>2]|0),w=t+4588|0,e[w>>2]=r+256,d=t+168|0,l=t+164|0,h=-256;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==256)break}b=D}function T2(t){t=t|0;var r=0,o=0;e[t>>2]=35884,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function I2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35884,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function E2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+136>>2]|0,e[t+144>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+184>>2]=w|0?w:e[C+4>>2]|0,e[t+188>>2]=h,e[t+192>>2]=l,P2(t),l=t+140|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+196+(h*12|0)>>2]=r,e[t+196+(h*12|0)+4>>2]=0,k[t+196+(h*12|0)+8>>1]=0,k[t+196+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4576>>2]=w,e[t+4580>>2]=0,S[t+4584>>0]=C,S[t+4585>>0]=1,S[t+4586>>0]=0,e[t+4588>>2]=w,e[t+4592>>2]=1,S[t+4596>>0]=C,S[t+4597>>0]=1,S[t+4598>>0]=0,e[t+4600>>2]=0,b=d}function D2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4624)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35660,e[r+128>>2]=e[t+136>>2],e[r+132>>2]=e[t+140>>2],e[r+136>>2]=e[t+144>>2],e[r+140>>2]=e[t+148>>2],e[r+144>>2]=e[t+152>>2],e[r+148>>2]=e[t+156>>2],e[r+152>>2]=e[t+160>>2],l=r+156|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+172>>2]=e[a>>2],e[r+176>>2]=0,e[r+180>>2]=0,e[r+184>>2]=0,l=r+4568|0,a=r+188|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4580|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4592|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,As(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],As(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function F2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0)}function As(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0;K=b,b=b+32|0,$=K+12|0,H=K,_=t+180|0,U=(e[_>>2]|0)+4|0,(e[t+32>>2]|0)==1?F=e[t+24>>2]|0:F=1,r=ie(F<<1,U)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;e:do if(r){if((r|0)<0&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(R=6),(R|0)==6&&(m=0,o=ge(67,r|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,e[$+8>>2]=o+r;;)if(S[o>>0]=0,o=(e[P>>2]|0)+1|0,e[P>>2]=o,r=r+-1|0,!r)break e}o=j()|0,r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!F)R=19;else{if(F>>>0>1073741823&&(m=0,ue(178,H|0),E=m,m=0,E&1)||(R=17),(R|0)==17&&(a=F<<2,m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[H>>2]=l,R=l+(F<<2)|0,e[H+8>>2]=R,Jt(l|0,0,a|0)|0,e[G>>2]=R,R=19;break}o=j()|0,r=e[H>>2]|0,a=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}while(!1);if((R|0)==19){d=t+12|0;e:do if((e[d>>2]|0)>0){if(w=t+4604|0,C=(ie(F,U)|0)+1|0,D=t+4608|0,E=t+92|0,h=t+4600|0,(F|0)>0)l=0;else{for(a=0;o=e[$>>2]|0,r=o+1|0,e[w>>2]=r,o=o+C|0,e[D>>2]=o,a&1?(e[w>>2]=o,e[D>>2]=r):r=o,F=e[E>>2]|0,m=0,$e(e[(e[F>>2]|0)+12>>2]|0,F|0,r|0,e[_>>2]|0,U|0),F=m,m=0,!(F&1);)if(a=a+1|0,(a|0)>=(e[d>>2]|0)){R=45;break e}o=j()|0;break}t:for(;;){if(o=e[$>>2]|0,r=o+1|0,e[w>>2]=r,o=o+C|0,e[D>>2]=o,l&1?(e[w>>2]=o,e[D>>2]=r):r=o,R=e[E>>2]|0,m=0,$e(e[(e[R>>2]|0)+12>>2]|0,R|0,r|0,e[_>>2]|0,U|0),R=m,m=0,R&1){R=28;break}r=e[H>>2]|0,o=e[w>>2]|0,a=0;do{if(e[h>>2]=e[r+(a<<2)>>2],R=e[_>>2]|0,S[o+R>>0]=S[o+(R+-1)>>0]|0,S[(e[D>>2]|0)+-1>>0]=S[e[w>>2]>>0]|0,m=0,Ae(75,t|0,0),R=m,m=0,R&1){R=36;break t}r=e[H>>2]|0,e[r+(a<<2)>>2]=e[h>>2],o=(e[w>>2]|0)+U|0,e[w>>2]=o,e[D>>2]=(e[D>>2]|0)+U,a=a+1|0}while((a|0)<(F|0));if(l=l+1|0,(l|0)>=(e[d>>2]|0)){R=45;break e}}if((R|0)==28){o=j()|0;break}else if((R|0)==36){o=j()|0;break}}else R=45;while(!1);do if((R|0)==45){if(m=0,ue(182,t|0),t=m,m=0,t&1){o=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),b=K;return}while(!1);r=e[H>>2]|0,a=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0)}function N2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=t+4604|0,r=e[F>>2]|0,U=t+180|0,!((e[U>>2]|0)<=0))for(R=t+4608|0,_=t+4612|0,l=r,h=N[r+-1>>0]|0,r=N[r>>0]|0,E=0;D=e[R>>2]|0,C=N[D+(E+-1)>>0]|0,a=E+1|0,o=N[l+a>>0]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=R2(t,w,N[D+E>>0]|0,l,0)|0,S[(e[R>>2]|0)+E>>0]=D):(a=(M2(t,E,0)|0)+E|0,o=e[F>>2]|0,r=N[o+(a+-1)>>0]|0,o=N[o+a>>0]|0),!((a|0)>=(e[U>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function R2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(H=r>>31,h=(H^r)-H|0,_=t+196+(h*12|0)+10|0,d=k[_>>1]|0,R=t+196+(h*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(r=5;(d<>1]^H)-H+a|0,U=t+136|0,a=e[U>>2]|0,(l&a|0)==(l|0)?D=l:D=a&~(l>>31),l=(o-D^H)-H|0,C=t+144|0,a=e[C>>2]|0,(l|0)>0?l=(l+a|0)/(a<<1|1|0)|0:l=(l-a|0)/(a<<1|1|0)|0,F=t+140|0,w=e[F>>2]|0,o=((l|0)<0?w:0)+l|0,w=o-((o|0)<((w+1|0)/2|0|0)?0:w)|0,h=t+196+(h*12|0)+4|0,a|r?l=0:l=(e[h>>2]<<1)+-1+d>>31,a=l^w,xs(t,r,a>>30^a<<1,e[t+156>>2]|0),a=e[t+160>>2]|0,r=(e[R>>2]|0)+((w|0)>-1?w:0-w|0)|0,l=(e[h>>2]|0)+(ie(e[C>>2]<<1|1,w)|0)|0,o=k[_>>1]|0,(o|0)==(a|0)&&(r=r>>1,l=l>>1,o=a>>1),e[R>>2]=r,a=o+1|0,k[_>>1]=a,r=a+l|0,(r|0)>=1?(l|0)>0&&(l=l-a|0,_=k[E>>1]|0,k[E>>1]=(_<<16>>16<127&1)+(_&65535),l=(l|0)>0?0:l):(l=k[E>>1]|0,k[E>>1]=(l&65535)-(l<<16>>16>-128&1),l=(r|0)>(~o|0)?r:0-o|0),e[h>>2]=l,a=e[C>>2]|0,o=a<<1|1,r=(ie(o,(w^H)-H|0)|0)+D|0,(r|0)>=(0-a|0)?(l=e[U>>2]|0,(l+a|0)<(r|0)&&(r=r-(ie(e[F>>2]|0,o)|0)|0)):(r=(ie(e[F>>2]|0,o)|0)+r|0,l=e[U>>2]|0),(r&l|0)==(r|0)?(H=r,H=H&255,H|0):(H=l&~(r>>31),H=H&255,H|0)}function M2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(C=(e[t+180>>2]|0)-r|0,D=e[t+4608>>2]|0,E=e[t+4604>>2]|0,l=S[D+(r+-1)>>0]|0,w=l&255,o=t+144|0,h=0;a=D+(h+r)|0,d=(N[a>>0]|0)-w|0,!((((d|0)>-1?d:0-d|0)|0)>(e[o>>2]|0));)if(S[a>>0]=l,h=h+1|0,(h|0)==(C|0)){h=C;break}if(l=(h|0)==(C|0),d=t+4600|0,a=e[36476+(e[d>>2]<<2)>>2]|0,(1<(h|0))o=h;else{o=h;do _t(t,1,1),a=e[d>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[d>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>0]|0,w,N[E+C>>0]|0)|0,S[r>>0]=t,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,t=h+1|0,t|0)}function _2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;return w=o-a|0,C=t+136|0,d=t+144|0,l=e[d>>2]|0,(((w|0)>-1?w:0-w|0)|0)>(l|0)?(h=a-o>>31|1,r=ie(h,r-a|0)|0,(r|0)>0?r=(l+r|0)/(l<<1|1|0)|0:r=(r-l|0)/(l<<1|1|0)|0,w=t+140|0,l=e[w>>2]|0,o=((r|0)<0?l:0)+r|0,l=o-((o|0)<((l+1|0)/2|0|0)?0:l)|0,vs(t,t+4576|0,l),l=ie(l,h)|0,h=e[d>>2]|0,d=h<<1|1,l=(ie(l,d)|0)+a|0,(l|0)>=(0-h|0)?(r=e[C>>2]|0,(r+h|0)<(l|0)&&(l=l-(ie(e[w>>2]|0,d)|0)|0)):(l=(ie(e[w>>2]|0,d)|0)+l|0,r=e[C>>2]|0),(l&r|0)==(l|0)?(C=l,C=C&255,C|0):(C=r&~(l>>31),C=C&255,C|0)):(r=r-o|0,(r|0)>0?r=(l+r|0)/(l<<1|1|0)|0:r=(r-l|0)/(l<<1|1|0)|0,w=t+140|0,l=e[w>>2]|0,h=((r|0)<0?l:0)+r|0,l=h-((h|0)<((l+1|0)/2|0|0)?0:l)|0,vs(t,t+4588|0,l),h=e[d>>2]|0,d=h<<1|1,l=(ie(d,l)|0)+o|0,(l|0)>=(0-h|0)?(r=e[C>>2]|0,(r+h|0)<(l|0)&&(l=l-(ie(e[w>>2]|0,d)|0)|0)):(l=(ie(e[w>>2]|0,d)|0)+l|0,r=e[C>>2]|0),(l&r|0)==(l|0)?(C=l,C=C&255,C|0):(C=r&~(l>>31),C=C&255,C|0))}function vs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,xs(t,l,a,(e[t+156>>2]|0)+-1-(e[36476+(e[t+4600>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function xs(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=o>>r,h=t+148|0,d=a-(e[h>>2]|0)|0,(l|0)<(d+-1|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-31-(e[h>>2]|0)|0)):_t(t,1,d),r=e[h>>2]|0,_t(t,(1<>2]|0)r=t+152|0;else if(o=e[t+136>>2]|0,r=t+152|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+184>>2]|0))&&(e[a+8>>2]|0)==(e[t+188>>2]|0)&&(e[a+12>>2]|0)==(e[t+192>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4612>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4612>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4612>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4612>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4616|0,a=E<<1,l=t+4620|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4612|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+192|0,C=t+188|0,d=t+184|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function L2(t){t=t|0;var r=0,o=0;e[t>>2]=35856,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function O2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35856,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function $2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function B2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+128>>2]|0,e[t+136>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+176>>2]=w|0?w:e[C+4>>2]|0,e[t+180>>2]=h,e[t+184>>2]=l,Q2(t),l=t+132|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+188+(h*12|0)>>2]=r,e[t+188+(h*12|0)+4>>2]=0,k[t+188+(h*12|0)+8>>1]=0,k[t+188+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4568>>2]=w,e[t+4572>>2]=0,S[t+4576>>0]=C,S[t+4577>>0]=1,S[t+4578>>0]=0,e[t+4580>>2]=w,e[t+4584>>2]=1,S[t+4588>>0]=C,S[t+4589>>0]=1,S[t+4590>>0]=0,e[t+4592>>2]=0,b=d}function V2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4620>>0]=l&1,r=t+156|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),U2(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function U2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+172|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,ae=m,m=0,!(ae&1))){e[re>>2]=a,ae=a+(r<<1)|0,e[re+8>>2]=ae,Jt(a|0,0,o|0)|0,e[ce>>2]=ae;break}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)d=18;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(d=16),(d|0)==16&&(l=L<<2,m=0,h=ge(67,l|0)|0,G=m,m=0,!(G&1))){e[J>>2]=h,d=h+(L<<2)|0,e[J+8>>2]=d,Jt(h|0,0,l|0)|0,e[ae>>2]=d,d=18;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4596|0,w=ie(L,P)|0,C=w+1|0,D=t+4600|0,E=(L|0)>0,F=t+160|0,R=t+168|0,_=t+164|0,U=t+156|0,H=t+88|0,K=t+4592|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+2|0,e[d>>2]=o,a=a+(C<<1)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],l=e[$>>2]|0,k[o+(l<<1)>>1]=k[o+(l+-1<<1)>>1]|0,k[r+-2>>1]=k[o>>1]|0,m=0,Ae(76,t|0,0),l=m,m=0,l&1){d=29;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P<<1)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P<<1)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+((e[U>>2]|0)-w<<1)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){d=30;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){d=42;break e}}if((d|0)==29){a=j()|0;break}else if((d|0)==30){a=j()|0;break}}else d=42;while(!1);do if((d|0)==42){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function z2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0;if(R=t+4596|0,o=e[R>>2]|0,K=t+172|0,r=e[K>>2]|0,!((r|0)<=0))for(_=t+4600|0,U=t+4604|0,H=t+4592|0,w=o,h=M[o+-2>>1]|0,o=M[o>>1]|0,F=0;D=e[_>>2]|0,d=k[D+(F+-1<<1)>>1]|0,E=d&65535,l=F+1|0,a=M[w+(l<<1)>>1]|0,C=e[U>>2]|0,w=o-h|0,h=h-E|0,C=((((S[C+(a-o)>>0]|0)*9|0)+(S[C+w>>0]|0)|0)*9|0)+(S[C+h>>0]|0)|0,D=D+(F<<1)|0,C?(r=o-E>>31,(r^h|0)<0?r=o:r=E+((r^w|0)<0?0:w)|0,E=q2(t,C,M[D>>1]|0,r,0)|0,k[(e[_>>2]|0)+(F<<1)>>1]=E):(r=W2(t,d,D,r-F|0)|0,o=r+F|0,(o|0)!=(e[K>>2]|0)&&(E=H2(t,E,M[(e[R>>2]|0)+(o<<1)>>1]|0)|0,k[(e[_>>2]|0)+(o<<1)>>1]=E,E=e[H>>2]|0,e[H>>2]=(E|0)<1?0:E+-1|0,r=r+1|0),l=r+F|0,a=e[R>>2]|0,o=M[a+(l+-1<<1)>>1]|0,a=M[a+(l<<1)>>1]|0),r=e[K>>2]|0,!((r|0)<=(l|0));)w=e[R>>2]|0,h=o,o=a,F=l}function G2(t){t=t|0;var r=0,o=0,a=0,l=0;a=t+116|0,o=e[a>>2]|0,(S[o>>0]|0)!=-1?(l=t+112|0,r=e[l>>2]|0,(r|0)<1&&(P0(t),r=e[l>>2]|0,o=e[a>>2]|0),t=t+108|0,a=e[t>>2]|0,e[l>>2]=r+-1,r=a<<1,e[t>>2]=r,(S[o>>0]|0)!=-1&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,6,35648),t=m,m=0,t&1||Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0))):r=e[t+108>>2]|0,r&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,6,35648),t=m,m=0,t&1||Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0))}function q2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(U=r>>31,C=(U^r)-U|0,R=t+188+(C*12|0)+10|0,o=k[R>>1]|0,F=t+188+(C*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(r=5;(o<>1]^U)-U+a|0,_=t+128|0,l=e[_>>2]|0,(o&l|0)==(o|0)?D=o:D=l&~(o>>31),o=t+112|0,(e[o>>2]|0)<8&&P0(t),l=t+108|0,a=e[l>>2]|0,h=a>>>24,d=e[2832+(r<<11)+(h<<3)+4>>2]|0,d?(e[o>>2]=(e[o>>2]|0)-d,e[l>>2]=a<>2]|0):(w=e[t+148>>2]|0,l=e[t+140>>2]|0,o=X0(t)|0,(o|0)<(w+-1-l|0)?r&&(o=(l0(t,r)|0)+(o<>31^o>>1,(((o|0)>-1?o:0-o|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),w=t+136|0,a=e[w>>2]|0,r?d=o:(a?l=0:l=(e[t+188+(C*12|0)+4>>2]<<1)+-1+(k[R>>1]|0)>>31,d=l^o),r=e[t+152>>2]|0,l=(e[F>>2]|0)+((d|0)>-1?d:0-d|0)|0,h=t+188+(C*12|0)+4|0,o=(e[h>>2]|0)+(ie(a<<1|1,d)|0)|0,a=k[R>>1]|0,(a|0)==(r|0)&&(l=l>>1,o=o>>1,a=r>>1),e[F>>2]=l,r=a+1|0,k[R>>1]=r,l=r+o|0,(l|0)>=1?(o|0)>0&&(o=o-r|0,R=k[E>>1]|0,k[E>>1]=(R<<16>>16<127&1)+(R&65535),o=(o|0)>0?0:o):(o=k[E>>1]|0,k[E>>1]=(o&65535)-(o<<16>>16>-128&1),o=(l|0)>(~a|0)?l:0-a|0),e[h>>2]=o,r=e[w>>2]|0,a=r<<1|1,l=(ie(a,(d^U)-U|0)|0)+D|0,(l|0)>=(0-r|0)?(o=e[_>>2]|0,(o+r|0)<(l|0)&&(l=l-(ie(e[t+132>>2]|0,a)|0)|0)):(l=(ie(e[t+132>>2]|0,a)|0)+l|0,o=e[_>>2]|0),(l&o|0)==(l|0)?(t=l,t=t&65535,t|0):(t=o&~(l>>31),t=t&65535,t|0)}function W2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4592|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)>0)h=0;else return l|0;do k[o+(h<<1)>>1]=r,h=h+1|0;while((h|0)!=(l|0));return l|0}function H2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=r-o|0,d=t+128|0,a=t+136|0,(((h|0)>-1?h:0-h|0)|0)>(e[a>>2]|0)?(r=ie(ws(t,t+4568|0)|0,o-r>>31|1)|0,l=e[a>>2]|0,h=l<<1|1,r=(ie(r,h)|0)+o|0,(r|0)>=(0-l|0)?(a=e[d>>2]|0,(a+l|0)<(r|0)&&(r=r-(ie(e[t+132>>2]|0,h)|0)|0)):(r=(ie(e[t+132>>2]|0,h)|0)+r|0,a=e[d>>2]|0),(r&a|0)==(r|0)?(t=r,t=t&65535,t|0):(t=a&~(r>>31),t=t&65535,t|0)):(o=ws(t,t+4580|0)|0,h=e[a>>2]|0,l=h<<1|1,r=(ie(l,o)|0)+r|0,(r|0)>=(0-h|0)?(a=e[d>>2]|0,(a+h|0)<(r|0)&&(r=r-(ie(e[t+132>>2]|0,l)|0)|0)):(r=(ie(e[t+132>>2]|0,l)|0)+r|0,a=e[d>>2]|0),(r&a|0)==(r|0)?(t=r,t=t&65535,t|0):(t=a&~(r>>31),t=t&65535,t|0))}function ws(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=r+9|0,o=N[D>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;d=e[t+148>>2]|0,w=e[36476+(e[t+4592>>2]<<2)>>2]|0,o=e[t+140>>2]|0,l=X0(t)|0;do if((l|0)<(d+-2-w-o|0))if(a){w=(l0(t,a)|0)+(l<>2]|0,l=w+a|0,d=l&1,o=d,h=1,l=(d+l|0)/2|0;break}else{a=e[h>>2]|0,t=a+l|0,o=t&1,t=(o+t|0)/2|0,C=8;break}else l=(l0(t,o)|0)+1|0,d=e[h>>2]|0,t=l+d|0,o=t&1,t=(o+t|0)/2|0,a?(w=l,h=1,l=t,a=d):(a=d,C=8);while(!1);return(C|0)==8&&(w=l,h=N[r+10>>0]<<1>>>0>=(N[D>>0]|0)>>>0,l=t),l=(o|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(w+1-a>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[D>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(r=a,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[D>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=C,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0)}function X0(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;if(h=t+112|0,(e[h>>2]|0)<16&&P0(t),d=t+108|0,o=e[d>>2]|0,(o|0)>=0){if(o&1073741824)r=1;else if(o&536870912)r=2;else if(o&268435456)r=3;else if(o&134217728)r=4;else if(o&67108864)r=5;else if(o&33554432)r=6;else if(o&16777216)r=7;else if(o&8388608)r=8;else if(o&4194304)r=9;else if(o&2097152)r=10;else if(o&1048576)r=11;else if(o&524288)r=12;else if(o&262144)r=13;else if(o&131072)r=14;else if(l=o>>>12&16,r=l+-1|0,!l){for(r=(e[h>>2]|0)+-15|0,e[h>>2]=r,a=o<<15,e[d>>2]=a,o=r,r=15;(o|0)<1?(P0(t),l=e[d>>2]|0,o=e[h>>2]|0):l=a,o=o+-1|0,e[h>>2]=o,a=l<<1,e[d>>2]=a,!((l|0)<0);)r=r+1|0;return r|0}}else r=0;return t=r+1|0,e[h>>2]=(e[h>>2]|0)-t,e[d>>2]=o<>2]|0,(o|0)<(r|0)&&(P0(t),o=e[a>>2]|0,(o|0)<(r|0)&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),l=t+108|0,t=e[l>>2]|0,e[a>>2]=o-r,e[l>>2]=t<>>(32-r|0)|0}function Q2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+136|0;e:do if(e[F>>2]|0)r=t+144|0;else if(o=e[t+128>>2]|0,r=t+144|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+176>>2]|0))&&(e[a+8>>2]|0)==(e[t+180>>2]|0)&&(e[a+12>>2]|0)==(e[t+184>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4604>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4604>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4604>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4604>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4608|0,a=E<<1,l=t+4612|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4604|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+184|0,C=t+180|0,d=t+176|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function K2(t){t=t|0;var r=0,o=0;e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Y2(t){t=t|0;var r=0,o=0;if(e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function j2(t){t=t|0;var r=0,o=0;e[t>>2]=35828,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function X2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35828,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Z2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=6,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=6,e[a+12>>2]=t,L=a,b=G,L|0)}function J2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+128>>2]|0,e[t+136>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+176>>2]=w|0?w:e[C+4>>2]|0,e[t+180>>2]=h,e[t+184>>2]=l,su(t),l=t+132|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+188+(h*12|0)>>2]=r,e[t+188+(h*12|0)+4>>2]=0,k[t+188+(h*12|0)+8>>1]=0,k[t+188+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4568>>2]=w,e[t+4572>>2]=0,S[t+4576>>0]=C,S[t+4577>>0]=1,S[t+4578>>0]=0,e[t+4580>>2]=w,e[t+4584>>2]=1,S[t+4588>>0]=C,S[t+4589>>0]=1,S[t+4590>>0]=0,e[t+4592>>2]=0,b=d}function eu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4620>>0]=l&1,r=t+156|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),tu(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function tu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+172|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;do if(r){if(r>>>0>715827882&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(d=6),(d|0)==6&&(m=0,o=ge(67,r*6|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,a=o+(r*6|0)|0,e[re+8>>2]=a;k[o>>1]=0,k[o+2>>1]=0,k[o+4>>1]=0,r=r+-1|0,r;)o=o+6|0;e[ce>>2]=a;break}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)d=20;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(d=18),(d|0)==18&&(l=L<<2,m=0,h=ge(67,l|0)|0,G=m,m=0,!(G&1))){e[J>>2]=h,d=h+(L<<2)|0,e[J+8>>2]=d,Jt(h|0,0,l|0)|0,e[ae>>2]=d,d=20;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==20){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4596|0,w=ie(L,P)|0,C=w+1|0,D=t+4600|0,E=(L|0)>0,F=t+160|0,R=t+168|0,_=t+164|0,U=t+156|0,H=t+88|0,K=t+4592|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+6|0,e[d>>2]=o,a=a+(C*6|0)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],r=e[$>>2]|0,l=o+(r*6|0)|0,o=o+((r+-1|0)*6|0)|0,k[l>>1]=k[o>>1]|0,k[l+2>>1]=k[o+2>>1]|0,k[l+4>>1]=k[o+4>>1]|0,l=(e[D>>2]|0)+-6|0,o=e[d>>2]|0,k[l>>1]=k[o>>1]|0,k[l+2>>1]=k[o+2>>1]|0,k[l+4>>1]=k[o+4>>1]|0,m=0,Ae(77,t|0,0),l=m,m=0,l&1){d=31;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P*6|0)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P*6|0)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+(((e[U>>2]|0)-w|0)*6|0)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){d=32;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){d=44;break e}}if((d|0)==31){a=j()|0;break}else if((d|0)==32){a=j()|0;break}}else d=44;while(!1);do if((d|0)==44){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),le(a|0)}function iu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0;if(zt=b,b=b+32|0,re=zt+24|0,i0=zt+18|0,s0=zt+12|0,ce=zt+6|0,Ee=zt,ke=t+172|0,r=e[ke>>2]|0,(r|0)<=0){b=zt;return}for(Te=t+4600|0,it=t+4596|0,jt=t+4604|0,Gt=t+4592|0,ae=0;a=ae+-1|0,l=e[Te>>2]|0,gt=e[it>>2]|0,o=ae+1|0,h=M[gt+(ae*6|0)>>1]|0,ne=e[jt>>2]|0,d=M[gt+(a*6|0)>>1]|0,w=h-d|0,C=M[l+(a*6|0)>>1]|0,D=d-C|0,E=((((S[ne+((M[gt+(o*6|0)>>1]|0)-h)>>0]|0)*9|0)+(S[ne+w>>0]|0)|0)*9|0)+(S[ne+D>>0]|0)|0,F=M[gt+(ae*6|0)+2>>1]|0,R=M[gt+(a*6|0)+2>>1]|0,_=F-R|0,U=M[l+(a*6|0)+2>>1]|0,H=R-U|0,K=((((S[ne+((M[gt+(o*6|0)+2>>1]|0)-F)>>0]|0)*9|0)+(S[ne+_>>0]|0)|0)*9|0)+(S[ne+H>>0]|0)|0,G=M[gt+(ae*6|0)+4>>1]|0,$=M[gt+(a*6|0)+4>>1]|0,P=G-$|0,L=M[l+(a*6|0)+4>>1]|0,J=$-L|0,ne=((((S[ne+((M[gt+(o*6|0)+4>>1]|0)-G)>>0]|0)*9|0)+(S[ne+P>>0]|0)|0)*9|0)+(S[ne+J>>0]|0)|0,K|E|ne?(a=M[l+(ae*6|0)>>1]|0,r=h-C>>31,(r^D|0)>=0?(r^w|0)<0?r=C:r=C-d+h|0:r=h,h=ir(t,E,a,r,0)|0,a=M[(e[Te>>2]|0)+(ae*6|0)+2>>1]|0,r=F-U>>31,(r^H|0)>=0?(r^_|0)<0?r=U:r=U-R+F|0:r=F,a=ir(t,K,a,r,0)|0,l=M[(e[Te>>2]|0)+(ae*6|0)+4>>1]|0,r=G-L>>31,(r^J|0)>=0?(r^P|0)<0?r=L:r=L-$+G|0:r=G,ne=ir(t,ne,l,r,0)|0,gt=e[Te>>2]|0,k[gt+(ae*6|0)>>1]=h,k[gt+(ae*6|0)+2>>1]=a,k[gt+(ae*6|0)+4>>1]=ne):(o=l+(a*6|0)|0,k[s0>>1]=k[o>>1]|0,k[s0+2>>1]=k[o+2>>1]|0,k[s0+4>>1]=k[o+4>>1]|0,k[re>>1]=k[o>>1]|0,k[re+2>>1]=k[o+2>>1]|0,k[re+4>>1]=k[o+4>>1]|0,r=nu(t,re,l+(ae*6|0)|0,r-ae|0)|0,o=r+ae|0,(o|0)!=(e[ke>>2]|0)&&(gt=(e[it>>2]|0)+(o*6|0)|0,k[Ee>>1]=k[gt>>1]|0,k[Ee+2>>1]=k[gt+2>>1]|0,k[Ee+4>>1]=k[gt+4>>1]|0,gt=(e[Te>>2]|0)+(o*6|0)|0,k[i0>>1]=k[s0>>1]|0,k[i0+2>>1]=k[s0+2>>1]|0,k[i0+4>>1]=k[s0+4>>1]|0,k[re>>1]=k[Ee>>1]|0,k[re+2>>1]=k[Ee+2>>1]|0,k[re+4>>1]=k[Ee+4>>1]|0,ru(ce,t,i0,re),k[gt>>1]=k[ce>>1]|0,k[gt+2>>1]=k[ce+2>>1]|0,k[gt+4>>1]=k[ce+4>>1]|0,gt=e[Gt>>2]|0,e[Gt>>2]=(gt|0)<1?0:gt+-1|0,r=r+1|0),o=r+ae|0),r=e[ke>>2]|0,!((o|0)>=(r|0));)ae=o;b=zt}function nu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4592|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0)return l|0;h=0;do R=o+(h*6|0)|0,k[R>>1]=k[r>>1]|0,k[R+2>>1]=k[r+2>>1]|0,k[R+4>>1]=k[r+4>>1]|0,h=h+1|0;while((h|0)!=(l|0));return l|0}function ru(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(C=r+4568|0,F=nr(r,C)|0,d=nr(r,C)|0,C=nr(r,C)|0,h=r+128|0,l=M[a>>1]|0,D=e[r+136>>2]|0,E=D<<1|1,l=(ie(ie(E,F)|0,l-(M[o>>1]|0)>>31|1)|0)+l|0,F=0-D|0,(l|0)>=(F|0)?(h=e[h>>2]|0,(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0)):(l=(ie(e[r+132>>2]|0,E)|0)+l|0,h=e[h>>2]|0),(l&h|0)!=(l|0)&&(l=h&~(l>>31)),w=l&65535,l=M[a+2>>1]|0,l=(ie(ie(E,d)|0,l-(M[o+2>>1]|0)>>31|1)|0)+l|0,(l|0)>=(F|0)?(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0):l=(ie(e[r+132>>2]|0,E)|0)+l|0,(l&h|0)!=(l|0)&&(l=h&~(l>>31)),d=l&65535,l=M[a+4>>1]|0,l=(ie(ie(E,C)|0,l-(M[o+4>>1]|0)>>31|1)|0)+l|0,(l|0)>=(F|0)?(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0):l=(ie(e[r+132>>2]|0,E)|0)+l|0,(l&h|0)==(l|0)){r=l,r=r&65535,k[t>>1]=w,F=t+2|0,k[F>>1]=d,t=t+4|0,k[t>>1]=r;return}r=h&~(l>>31),r=r&65535,k[t>>1]=w,F=t+2|0,k[F>>1]=d,t=t+4|0,k[t>>1]=r}function ir(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(U=r>>31,C=(U^r)-U|0,R=t+188+(C*12|0)+10|0,o=k[R>>1]|0,F=t+188+(C*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(r=5;(o<>1]^U)-U+a|0,_=t+128|0,l=e[_>>2]|0,(o&l|0)==(o|0)?D=o:D=l&~(o>>31),o=t+112|0,(e[o>>2]|0)<8&&P0(t),l=t+108|0,a=e[l>>2]|0,h=a>>>24,d=e[2832+(r<<11)+(h<<3)+4>>2]|0,d?(e[o>>2]=(e[o>>2]|0)-d,e[l>>2]=a<>2]|0):(w=e[t+148>>2]|0,l=e[t+140>>2]|0,o=X0(t)|0,(o|0)<(w+-1-l|0)?r&&(o=(l0(t,r)|0)+(o<>31^o>>1,(((o|0)>-1?o:0-o|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),w=t+136|0,a=e[w>>2]|0,r?d=o:(a?l=0:l=(e[t+188+(C*12|0)+4>>2]<<1)+-1+(k[R>>1]|0)>>31,d=l^o),r=e[t+152>>2]|0,l=(e[F>>2]|0)+((d|0)>-1?d:0-d|0)|0,h=t+188+(C*12|0)+4|0,o=(e[h>>2]|0)+(ie(a<<1|1,d)|0)|0,a=k[R>>1]|0,(a|0)==(r|0)&&(l=l>>1,o=o>>1,a=r>>1),e[F>>2]=l,r=a+1|0,k[R>>1]=r,l=r+o|0,(l|0)>=1?(o|0)>0&&(o=o-r|0,R=k[E>>1]|0,k[E>>1]=(R<<16>>16<127&1)+(R&65535),o=(o|0)>0?0:o):(o=k[E>>1]|0,k[E>>1]=(o&65535)-(o<<16>>16>-128&1),o=(l|0)>(~a|0)?l:0-a|0),e[h>>2]=o,r=e[w>>2]|0,a=r<<1|1,l=(ie(a,(d^U)-U|0)|0)+D|0,(l|0)>=(0-r|0)?(o=e[_>>2]|0,(o+r|0)<(l|0)&&(l=l-(ie(e[t+132>>2]|0,a)|0)|0)):(l=(ie(e[t+132>>2]|0,a)|0)+l|0,o=e[_>>2]|0),(l&o|0)==(l|0)?(t=l,t=t&65535,t|0):(t=o&~(l>>31),t=t&65535,t|0)}function nr(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=r+9|0,o=N[D>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;d=e[t+148>>2]|0,w=e[36476+(e[t+4592>>2]<<2)>>2]|0,o=e[t+140>>2]|0,l=X0(t)|0;do if((l|0)<(d+-2-w-o|0))if(a){w=(l0(t,a)|0)+(l<>2]|0,l=w+a|0,d=l&1,o=d,h=1,l=(d+l|0)/2|0;break}else{a=e[h>>2]|0,t=a+l|0,o=t&1,t=(o+t|0)/2|0,C=8;break}else l=(l0(t,o)|0)+1|0,d=e[h>>2]|0,t=l+d|0,o=t&1,t=(o+t|0)/2|0,a?(w=l,h=1,l=t,a=d):(a=d,C=8);while(!1);return(C|0)==8&&(w=l,h=N[r+10>>0]<<1>>>0>=(N[D>>0]|0)>>>0,l=t),l=(o|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(w+1-a>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[D>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(r=a,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[D>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=C,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0)}function su(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+136|0;e:do if(e[F>>2]|0)r=t+144|0;else if(o=e[t+128>>2]|0,r=t+144|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+176>>2]|0))&&(e[a+8>>2]|0)==(e[t+180>>2]|0)&&(e[a+12>>2]|0)==(e[t+184>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4604>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4604>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4604>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4604>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4608|0,a=E<<1,l=t+4612|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4604|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+184|0,C=t+180|0,d=t+176|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function ou(t){t=t|0;var r=0,o=0;e[t>>2]=35800,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function au(t){t=t|0;var r=0,o=0;if(e[t>>2]=35800,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function lu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0)}function uu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+128>>2]|0,e[t+136>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+176>>2]=w|0?w:e[C+4>>2]|0,e[t+180>>2]=h,e[t+184>>2]=l,mu(t),l=t+132|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+188+(h*12|0)>>2]=r,e[t+188+(h*12|0)+4>>2]=0,k[t+188+(h*12|0)+8>>1]=0,k[t+188+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4568>>2]=w,e[t+4572>>2]=0,S[t+4576>>0]=C,S[t+4577>>0]=1,S[t+4578>>0]=0,e[t+4580>>2]=w,e[t+4584>>2]=1,S[t+4588>>0]=C,S[t+4589>>0]=1,S[t+4590>>0]=0,e[t+4592>>2]=0,b=d}function cu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4620>>0]=l&1,r=t+156|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),fu(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function fu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+172|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;e:do if(r){if(r>>>0>1431655765&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r*3|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,e[re+8>>2]=o+(r*3|0);;)if(S[o>>0]=0,S[o+1>>0]=0,S[o+2>>0]=0,o=(e[ce>>2]|0)+3|0,e[ce>>2]=o,r=r+-1|0,!r)break e}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)h=19;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(h=17),(h|0)==17&&(a=L<<2,m=0,l=ge(67,a|0)|0,G=m,m=0,!(G&1))){e[J>>2]=l,h=l+(L<<2)|0,e[J+8>>2]=h,Jt(l|0,0,a|0)|0,e[ae>>2]=h,h=19;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4596|0,w=ie(L,P)|0,C=w+1|0,D=t+4600|0,E=(L|0)>0,F=t+160|0,R=t+168|0,_=t+164|0,U=t+156|0,H=t+88|0,K=t+4592|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+3|0,e[d>>2]=o,a=a+(C*3|0)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],r=e[$>>2]|0,l=o+(r*3|0)|0,o=o+((r+-1|0)*3|0)|0,S[l>>0]=S[o>>0]|0,S[l+1>>0]=S[o+1>>0]|0,S[l+2>>0]=S[o+2>>0]|0,o=e[d>>2]|0,l=(e[D>>2]|0)+-3|0,S[l>>0]=S[o>>0]|0,S[l+1>>0]=S[o+1>>0]|0,S[l+2>>0]=S[o+2>>0]|0,m=0,Ae(78,t|0,0),l=m,m=0,l&1){h=30;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P*3|0)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P*3|0)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+(((e[U>>2]|0)-w|0)*3|0)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){h=31;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){h=43;break e}}if((h|0)==30){a=j()|0;break}else if((h|0)==31){a=j()|0;break}}else h=43;while(!1);do if((h|0)==43){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}function hu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0;if(zt=b,b=b+16|0,re=zt+12|0,i0=zt+9|0,s0=zt+6|0,ce=zt+3|0,Ee=zt,ke=t+172|0,r=e[ke>>2]|0,(r|0)<=0){b=zt;return}for(Te=t+4600|0,it=t+4596|0,jt=t+4604|0,Gt=t+4592|0,ae=0;L=ae+-1|0,a=e[Te>>2]|0,l=a+(L*3|0)|0,gt=e[it>>2]|0,o=ae+1|0,h=N[gt+(ae*3|0)>>0]|0,ne=e[jt>>2]|0,d=N[gt+(L*3|0)>>0]|0,w=h-d|0,C=N[l>>0]|0,D=d-C|0,E=((((S[ne+((N[gt+(o*3|0)>>0]|0)-h)>>0]|0)*9|0)+(S[ne+w>>0]|0)|0)*9|0)+(S[ne+D>>0]|0)|0,F=N[gt+(ae*3|0)+1>>0]|0,R=N[gt+(L*3|0)+1>>0]|0,_=F-R|0,U=N[a+(L*3|0)+1>>0]|0,H=R-U|0,K=((((S[ne+((N[gt+(o*3|0)+1>>0]|0)-F)>>0]|0)*9|0)+(S[ne+_>>0]|0)|0)*9|0)+(S[ne+H>>0]|0)|0,G=N[gt+(ae*3|0)+2>>0]|0,$=N[gt+(L*3|0)+2>>0]|0,P=G-$|0,L=N[a+(L*3|0)+2>>0]|0,J=$-L|0,ne=((((S[ne+((N[gt+(o*3|0)+2>>0]|0)-G)>>0]|0)*9|0)+(S[ne+P>>0]|0)|0)*9|0)+(S[ne+J>>0]|0)|0,K|E|ne?(a=N[a+(ae*3|0)>>0]|0,r=h-C>>31,(r^D|0)>=0?(r^w|0)<0?r=C:r=C-d+h|0:r=h,h=rr(t,E,a,r,0)|0,a=N[(e[Te>>2]|0)+(ae*3|0)+1>>0]|0,r=F-U>>31,(r^H|0)>=0?(r^_|0)<0?r=U:r=U-R+F|0:r=F,a=rr(t,K,a,r,0)|0,l=N[(e[Te>>2]|0)+(ae*3|0)+2>>0]|0,r=G-L>>31,(r^J|0)>=0?(r^P|0)<0?r=L:r=L-$+G|0:r=G,ne=rr(t,ne,l,r,0)|0,gt=(e[Te>>2]|0)+(ae*3|0)|0,S[gt>>0]=h,S[gt+1>>0]=a,S[gt+2>>0]=ne):(S[s0>>0]=S[l>>0]|0,S[s0+1>>0]=S[l+1>>0]|0,S[s0+2>>0]=S[l+2>>0]|0,S[re>>0]=S[l>>0]|0,S[re+1>>0]=S[l+1>>0]|0,S[re+2>>0]=S[l+2>>0]|0,r=du(t,re,a+(ae*3|0)|0,r-ae|0)|0,o=r+ae|0,(o|0)!=(e[ke>>2]|0)&&(gt=(e[it>>2]|0)+(o*3|0)|0,S[Ee>>0]=S[gt>>0]|0,S[Ee+1>>0]=S[gt+1>>0]|0,S[Ee+2>>0]=S[gt+2>>0]|0,gt=e[Te>>2]|0,S[i0>>0]=S[s0>>0]|0,S[i0+1>>0]=S[s0+1>>0]|0,S[i0+2>>0]=S[s0+2>>0]|0,S[re>>0]=S[Ee>>0]|0,S[re+1>>0]=S[Ee+1>>0]|0,S[re+2>>0]=S[Ee+2>>0]|0,pu(ce,t,i0,re),gt=gt+(o*3|0)|0,S[gt>>0]=S[ce>>0]|0,S[gt+1>>0]=S[ce+1>>0]|0,S[gt+2>>0]=S[ce+2>>0]|0,gt=e[Gt>>2]|0,e[Gt>>2]=(gt|0)<1?0:gt+-1|0,r=r+1|0),o=r+ae|0),r=e[ke>>2]|0,!((o|0)>=(r|0));)ae=o;b=zt}function du(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4592|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0)return l|0;h=0;do R=o+(h*3|0)|0,S[R>>0]=S[r>>0]|0,S[R+1>>0]=S[r+1>>0]|0,S[R+2>>0]=S[r+2>>0]|0,h=h+1|0;while((h|0)!=(l|0));return l|0}function pu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(C=r+4568|0,F=or(r,C)|0,d=or(r,C)|0,C=or(r,C)|0,h=r+128|0,l=N[a>>0]|0,D=e[r+136>>2]|0,E=D<<1|1,l=(ie(ie(E,F)|0,l-(N[o>>0]|0)>>31|1)|0)+l|0,F=0-D|0,(l|0)>=(F|0)?(h=e[h>>2]|0,(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0)):(l=(ie(e[r+132>>2]|0,E)|0)+l|0,h=e[h>>2]|0),(l&h|0)!=(l|0)&&(l=h&~(l>>31)),w=l&255,l=N[a+1>>0]|0,l=(ie(ie(E,d)|0,l-(N[o+1>>0]|0)>>31|1)|0)+l|0,(l|0)>=(F|0)?(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0):l=(ie(e[r+132>>2]|0,E)|0)+l|0,(l&h|0)!=(l|0)&&(l=h&~(l>>31)),d=l&255,l=N[a+2>>0]|0,l=(ie(ie(E,C)|0,l-(N[o+2>>0]|0)>>31|1)|0)+l|0,(l|0)>=(F|0)?(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0):l=(ie(e[r+132>>2]|0,E)|0)+l|0,(l&h|0)==(l|0)){r=l,r=r&255,S[t>>0]=w,F=t+1|0,S[F>>0]=d,t=t+2|0,S[t>>0]=r;return}r=h&~(l>>31),r=r&255,S[t>>0]=w,F=t+1|0,S[F>>0]=d,t=t+2|0,S[t>>0]=r}function rr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(U=r>>31,C=(U^r)-U|0,R=t+188+(C*12|0)+10|0,o=k[R>>1]|0,F=t+188+(C*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(r=5;(o<>1]^U)-U+a|0,_=t+128|0,l=e[_>>2]|0,(o&l|0)==(o|0)?D=o:D=l&~(o>>31),o=t+112|0,(e[o>>2]|0)<8&&P0(t),l=t+108|0,a=e[l>>2]|0,h=a>>>24,d=e[2832+(r<<11)+(h<<3)+4>>2]|0,d?(e[o>>2]=(e[o>>2]|0)-d,e[l>>2]=a<>2]|0):(w=e[t+148>>2]|0,l=e[t+140>>2]|0,o=X0(t)|0,(o|0)<(w+-1-l|0)?r&&(o=(l0(t,r)|0)+(o<>31^o>>1,(((o|0)>-1?o:0-o|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),w=t+136|0,a=e[w>>2]|0,r?d=o:(a?l=0:l=(e[t+188+(C*12|0)+4>>2]<<1)+-1+(k[R>>1]|0)>>31,d=l^o),r=e[t+152>>2]|0,l=(e[F>>2]|0)+((d|0)>-1?d:0-d|0)|0,h=t+188+(C*12|0)+4|0,o=(e[h>>2]|0)+(ie(a<<1|1,d)|0)|0,a=k[R>>1]|0,(a|0)==(r|0)&&(l=l>>1,o=o>>1,a=r>>1),e[F>>2]=l,r=a+1|0,k[R>>1]=r,l=r+o|0,(l|0)>=1?(o|0)>0&&(o=o-r|0,R=k[E>>1]|0,k[E>>1]=(R<<16>>16<127&1)+(R&65535),o=(o|0)>0?0:o):(o=k[E>>1]|0,k[E>>1]=(o&65535)-(o<<16>>16>-128&1),o=(l|0)>(~a|0)?l:0-a|0),e[h>>2]=o,r=e[w>>2]|0,a=r<<1|1,l=(ie(a,(d^U)-U|0)|0)+D|0,(l|0)>=(0-r|0)?(o=e[_>>2]|0,(o+r|0)<(l|0)&&(l=l-(ie(e[t+132>>2]|0,a)|0)|0)):(l=(ie(e[t+132>>2]|0,a)|0)+l|0,o=e[_>>2]|0),(l&o|0)==(l|0)?(t=l,t=t&255,t|0):(t=o&~(l>>31),t=t&255,t|0)}function or(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=r+9|0,o=N[D>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;d=e[t+148>>2]|0,w=e[36476+(e[t+4592>>2]<<2)>>2]|0,o=e[t+140>>2]|0,l=X0(t)|0;do if((l|0)<(d+-2-w-o|0))if(a){w=(l0(t,a)|0)+(l<>2]|0,l=w+a|0,d=l&1,o=d,h=1,l=(d+l|0)/2|0;break}else{a=e[h>>2]|0,t=a+l|0,o=t&1,t=(o+t|0)/2|0,C=8;break}else l=(l0(t,o)|0)+1|0,d=e[h>>2]|0,t=l+d|0,o=t&1,t=(o+t|0)/2|0,a?(w=l,h=1,l=t,a=d):(a=d,C=8);while(!1);return(C|0)==8&&(w=l,h=N[r+10>>0]<<1>>>0>=(N[D>>0]|0)>>>0,l=t),l=(o|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(w+1-a>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[D>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(r=a,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[D>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=C,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0)}function mu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+136|0;e:do if(e[F>>2]|0)r=t+144|0;else if(o=e[t+128>>2]|0,r=t+144|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+176>>2]|0))&&(e[a+8>>2]|0)==(e[t+180>>2]|0)&&(e[a+12>>2]|0)==(e[t+184>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4604>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4604>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4604>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4604>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4608|0,a=E<<1,l=t+4612|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4604|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+184|0,C=t+180|0,d=t+176|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function gu(t){t=t|0;var r=0,o=0;e[t>>2]=35772,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Su(t){t=t|0;var r=0,o=0;if(e[t>>2]=35772,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Au(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function vu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,65535,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+152>>2]=d|0?d:e[w+4>>2]|0,e[t+156>>2]=h,e[t+160>>2]=a,ku(t),a=0;do e[t+164+(a*12|0)>>2]=1024,e[t+164+(a*12|0)+4>>2]=0,k[t+164+(a*12|0)+8>>1]=0,k[t+164+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4544>>2]=1024,e[t+4548>>2]=0,S[t+4552>>0]=w,S[t+4553>>0]=1,S[t+4554>>0]=0,e[t+4556>>2]=1024,e[t+4560>>2]=1,S[t+4564>>0]=w,S[t+4565>>0]=1,S[t+4566>>0]=0,e[t+4568>>2]=0,b=l}function xu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4596>>0]=l&1,r=t+132|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),wu(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function wu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+148|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,ae=m,m=0,!(ae&1))){e[re>>2]=a,ae=a+(r<<1)|0,e[re+8>>2]=ae,Jt(a|0,0,o|0)|0,e[ce>>2]=ae;break}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)d=18;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(d=16),(d|0)==16&&(l=L<<2,m=0,h=ge(67,l|0)|0,G=m,m=0,!(G&1))){e[J>>2]=h,d=h+(L<<2)|0,e[J+8>>2]=d,Jt(h|0,0,l|0)|0,e[ae>>2]=d,d=18;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4572|0,w=ie(L,P)|0,C=w+1|0,D=t+4576|0,E=(L|0)>0,F=t+136|0,R=t+144|0,_=t+140|0,U=t+132|0,H=t+88|0,K=t+4568|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+2|0,e[d>>2]=o,a=a+(C<<1)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],l=e[$>>2]|0,k[o+(l<<1)>>1]=k[o+(l+-1<<1)>>1]|0,k[r+-2>>1]=k[o>>1]|0,m=0,Ae(79,t|0,0),l=m,m=0,l&1){d=29;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P<<1)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P<<1)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+((e[U>>2]|0)-w<<1)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){d=30;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){d=42;break e}}if((d|0)==29){a=j()|0;break}else if((d|0)==30){a=j()|0;break}}else d=42;while(!1);do if((d|0)==42){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function yu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=t+4572|0,r=e[F>>2]|0,U=t+148|0,!((e[U>>2]|0)<=0))for(R=t+4576|0,_=t+4580|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=Cu(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(Tu(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[U>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function Cu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(_=r>>31,D=(_^r)-_|0,R=t+164+(D*12|0)+10|0,o=k[R>>1]|0,F=t+164+(D*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(h=5;(o<>1]^_)-_+a|0,(o&65535|0)!=(o|0)&&(o=o>>31&65535^65535),l=t+112|0,(e[l>>2]|0)<8&&P0(t),a=t+108|0,d=e[a>>2]|0,w=d>>>24,C=e[2832+(h<<11)+(w<<3)+4>>2]|0,C?(e[l>>2]=(e[l>>2]|0)-C,e[a>>2]=d<>2]|0):(l=X0(t)|0,(l|0)<47?h&&(l=(l0(t,h)|0)+(l<>31^l>>1,(((l|0)>-1?l:0-l|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96))),C=t+164+(D*12|0)+4|0,a=e[C>>2]|0,h?h=k[R>>1]|0:(t=k[R>>1]|0,h=t,l=(a<<1)+-1+(t<<16>>16)>>31^l),d=h<<16>>16==64,t=d&1,w=a+l>>t,d=d?32:h<<16>>16,e[F>>2]=((l|0)>-1?l:0-l|0)+(e[F>>2]|0)>>t,a=d+1|0,k[R>>1]=a,h=a+w|0,(h|0)<1?(R=k[E>>1]|0,k[E>>1]=(R&65535)-(R<<16>>16>-128&1),R=(h|0)>(~d|0)?h:0-d|0,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&65535,r|0):(w|0)<=0?(R=w,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&65535,r|0):(R=w-a|0,F=k[E>>1]|0,k[E>>1]=(F<<16>>16<127&1)+(F&65535),R=(R|0)>0?0:R,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&65535,r|0)}function Tu(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=t+4576|0,l=e[h>>2]|0,o=k[l+(r+-1<<1)>>1]|0,d=t+148|0,l=Iu(t,o,l+(r<<1)|0,(e[d>>2]|0)-r|0)|0,a=l+r|0,(a|0)==(e[d>>2]|0)?(d=l,d|0):(o=o&65535,r=M[(e[t+4572>>2]|0)+(a<<1)>>1]|0,d=o-r|0,(((d|0)>-1?d:0-d|0)|0)<1?o=(ys(t,t+4556|0)|0)+o|0:o=(ie(ys(t,t+4544|0)|0,r-o>>31|1)|0)+r|0,k[(e[h>>2]|0)+(a<<1)>>1]=o,d=t+4568|0,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,d=l+1|0,d|0)}function Iu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4568|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)>0)h=0;else return l|0;do k[o+(h<<1)>>1]=r,h=h+1|0;while((h|0)!=(l|0));return l|0}function ys(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(w=r+9|0,o=N[w>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;l=e[36476+(e[t+4568>>2]<<2)>>2]|0,o=X0(t)|0;do if((o|0)<(46-l|0))if(a){o=(l0(t,a)|0)+(o<>2]|0,l=o+t|0,C=l&1,a=C,h=1,l=(C+l|0)/2|0;break}else{t=e[h>>2]|0,l=t+o|0,a=l&1,l=(a+l|0)/2|0,d=8;break}else o=(l0(t,16)|0)+1|0,t=e[h>>2]|0,l=o+t|0,h=l&1,l=(h+l|0)/2|0,a?(a=h,h=1):(a=h,d=8);while(!1);return(d|0)==8&&(h=N[r+10>>0]<<1>>>0>=(N[w>>0]|0)>>>0),l=(a|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(o+1-t>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[w>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(C=a,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[w>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0)}function ku(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,65535,0),C=t+152|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+156>>2]|0)&&(e[w+12>>2]|0)==(e[t+160>>2]|0)){C=e[8909]|0,e[t+4580>>2]=C+(((e[8910]|0)-C|0)>>>1),b=D;return}for(o=t+4584|0,a=t+4588|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=131072?h>>>0>131072&&(d=r+131072|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,131072-h|0),r=e[o>>2]|0),w=t+4580|0,e[w>>2]=r+65536,d=t+160|0,l=t+156|0,h=-65536;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==65536)break}b=D}function Eu(t){t=t|0;var r=0,o=0;e[t>>2]=35744,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Du(t){t=t|0;var r=0,o=0;if(e[t>>2]=35744,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function bu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function Fu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,4095,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+152>>2]=d|0?d:e[w+4>>2]|0,e[t+156>>2]=h,e[t+160>>2]=a,Ou(t),a=0;do e[t+164+(a*12|0)>>2]=64,e[t+164+(a*12|0)+4>>2]=0,k[t+164+(a*12|0)+8>>1]=0,k[t+164+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4544>>2]=64,e[t+4548>>2]=0,S[t+4552>>0]=w,S[t+4553>>0]=1,S[t+4554>>0]=0,e[t+4556>>2]=64,e[t+4560>>2]=1,S[t+4564>>0]=w,S[t+4565>>0]=1,S[t+4566>>0]=0,e[t+4568>>2]=0,b=l}function Nu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4596>>0]=l&1,r=t+132|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),Ru(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function Ru(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+148|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,ae=m,m=0,!(ae&1))){e[re>>2]=a,ae=a+(r<<1)|0,e[re+8>>2]=ae,Jt(a|0,0,o|0)|0,e[ce>>2]=ae;break}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)d=18;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(d=16),(d|0)==16&&(l=L<<2,m=0,h=ge(67,l|0)|0,G=m,m=0,!(G&1))){e[J>>2]=h,d=h+(L<<2)|0,e[J+8>>2]=d,Jt(h|0,0,l|0)|0,e[ae>>2]=d,d=18;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4572|0,w=ie(L,P)|0,C=w+1|0,D=t+4576|0,E=(L|0)>0,F=t+136|0,R=t+144|0,_=t+140|0,U=t+132|0,H=t+88|0,K=t+4568|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+2|0,e[d>>2]=o,a=a+(C<<1)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],l=e[$>>2]|0,k[o+(l<<1)>>1]=k[o+(l+-1<<1)>>1]|0,k[r+-2>>1]=k[o>>1]|0,m=0,Ae(80,t|0,0),l=m,m=0,l&1){d=29;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P<<1)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P<<1)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+((e[U>>2]|0)-w<<1)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){d=30;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){d=42;break e}}if((d|0)==29){a=j()|0;break}else if((d|0)==30){a=j()|0;break}}else d=42;while(!1);do if((d|0)==42){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function Mu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=t+4572|0,r=e[F>>2]|0,U=t+148|0,!((e[U>>2]|0)<=0))for(R=t+4576|0,_=t+4580|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=_u(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(Pu(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[U>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function _u(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(_=r>>31,D=(_^r)-_|0,R=t+164+(D*12|0)+10|0,o=k[R>>1]|0,F=t+164+(D*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(h=5;(o<>1]^_)-_+a|0,(o&4095|0)!=(o|0)&&(o=o>>31&4095^4095),l=t+112|0,(e[l>>2]|0)<8&&P0(t),a=t+108|0,d=e[a>>2]|0,w=d>>>24,C=e[2832+(h<<11)+(w<<3)+4>>2]|0,C?(e[l>>2]=(e[l>>2]|0)-C,e[a>>2]=d<>2]|0):(l=X0(t)|0,(l|0)<35?h&&(l=(l0(t,h)|0)+(l<>31^l>>1,(((l|0)>-1?l:0-l|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96))),C=t+164+(D*12|0)+4|0,a=e[C>>2]|0,h?h=k[R>>1]|0:(t=k[R>>1]|0,h=t,l=(a<<1)+-1+(t<<16>>16)>>31^l),d=h<<16>>16==64,t=d&1,w=a+l>>t,d=d?32:h<<16>>16,e[F>>2]=((l|0)>-1?l:0-l|0)+(e[F>>2]|0)>>t,a=d+1|0,k[R>>1]=a,h=a+w|0,(h|0)<1?(R=k[E>>1]|0,k[E>>1]=(R&65535)-(R<<16>>16>-128&1),R=(h|0)>(~d|0)?h:0-d|0,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&4095,r=r&65535,r|0):(w|0)<=0?(R=w,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&4095,r=r&65535,r|0):(R=w-a|0,F=k[E>>1]|0,k[E>>1]=(F<<16>>16<127&1)+(F&65535),R=(R|0)>0?0:R,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&4095,r=r&65535,r|0)}function Pu(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=t+4576|0,l=e[h>>2]|0,o=k[l+(r+-1<<1)>>1]|0,d=t+148|0,l=Lu(t,o,l+(r<<1)|0,(e[d>>2]|0)-r|0)|0,a=l+r|0,(a|0)==(e[d>>2]|0)?(d=l,d|0):(o=o&65535,r=M[(e[t+4572>>2]|0)+(a<<1)>>1]|0,d=o-r|0,(((d|0)>-1?d:0-d|0)|0)<1?o=(Cs(t,t+4556|0)|0)+o|0:o=(ie(Cs(t,t+4544|0)|0,r-o>>31|1)|0)+r|0,k[(e[h>>2]|0)+(a<<1)>>1]=o&4095,d=t+4568|0,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,d=l+1|0,d|0)}function Lu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4568|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)>0)h=0;else return l|0;do k[o+(h<<1)>>1]=r,h=h+1|0;while((h|0)!=(l|0));return l|0}function Cs(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(w=r+9|0,o=N[w>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;l=e[36476+(e[t+4568>>2]<<2)>>2]|0,o=X0(t)|0;do if((o|0)<(34-l|0))if(a){o=(l0(t,a)|0)+(o<>2]|0,l=o+t|0,C=l&1,a=C,h=1,l=(C+l|0)/2|0;break}else{t=e[h>>2]|0,l=t+o|0,a=l&1,l=(a+l|0)/2|0,d=8;break}else o=(l0(t,12)|0)+1|0,t=e[h>>2]|0,l=o+t|0,h=l&1,l=(h+l|0)/2|0,a?(a=h,h=1):(a=h,d=8);while(!1);return(d|0)==8&&(h=N[r+10>>0]<<1>>>0>=(N[w>>0]|0)>>>0),l=(a|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(o+1-t>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[w>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(C=a,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[w>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0)}function Ou(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,4095,0),C=t+152|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+156>>2]|0)&&(e[w+12>>2]|0)==(e[t+160>>2]|0)){C=e[8906]|0,e[t+4580>>2]=C+(((e[8907]|0)-C|0)>>>1),b=D;return}for(o=t+4584|0,a=t+4588|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=8192?h>>>0>8192&&(d=r+8192|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,8192-h|0),r=e[o>>2]|0),w=t+4580|0,e[w>>2]=r+4096,d=t+160|0,l=t+156|0,h=-4096;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==4096)break}b=D}function $u(t){t=t|0;var r=0,o=0;e[t>>2]=35716,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Bu(t){t=t|0;var r=0,o=0;if(e[t>>2]=35716,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Vu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0)}function Uu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,255,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+152>>2]=d|0?d:e[w+4>>2]|0,e[t+156>>2]=h,e[t+160>>2]=a,Ku(t),a=0;do e[t+164+(a*12|0)>>2]=4,e[t+164+(a*12|0)+4>>2]=0,k[t+164+(a*12|0)+8>>1]=0,k[t+164+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4544>>2]=4,e[t+4548>>2]=0,S[t+4552>>0]=w,S[t+4553>>0]=1,S[t+4554>>0]=0,e[t+4556>>2]=4,e[t+4560>>2]=1,S[t+4564>>0]=w,S[t+4565>>0]=1,S[t+4566>>0]=0,e[t+4568>>2]=0,b=l}function zu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4596>>0]=l&1,r=t+132|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),Gu(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function Gu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+148|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;e:do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,e[re+8>>2]=o+r;;)if(S[o>>0]=0,o=(e[ce>>2]|0)+1|0,e[ce>>2]=o,r=r+-1|0,!r)break e}o=j()|0,r=e[re>>2]|0,r||le(o|0),(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),le(o|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)h=19;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(h=17),(h|0)==17&&(a=L<<2,m=0,l=ge(67,a|0)|0,G=m,m=0,!(G&1))){e[J>>2]=l,h=l+(L<<2)|0,e[J+8>>2]=h,Jt(l|0,0,a|0)|0,e[ae>>2]=h,h=19;break}o=j()|0,r=e[J>>2]|0,a=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4572|0,w=ie(L,P)|0,C=w+1|0,D=t+4576|0,E=(L|0)>0,F=t+136|0,R=t+144|0,_=t+140|0,U=t+132|0,H=t+88|0,K=t+4568|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+1|0,e[d>>2]=o,a=a+C|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],l=e[$>>2]|0,S[o+l>>0]=S[o+(l+-1)>>0]|0,S[(e[D>>2]|0)+-1>>0]=S[e[d>>2]>>0]|0,m=0,Ae(81,t|0,0),l=m,m=0,l&1){h=30;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+P|0,e[d>>2]=o,r=(e[D>>2]|0)+P|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+((e[U>>2]|0)-w)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){h=31;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){h=43;break e}}if((h|0)==30){o=j()|0;break}else if((h|0)==31){o=j()|0;break}}else h=43;while(!1);do if((h|0)==43){if(m=0,ue(183,t|0),t=m,m=0,t&1){o=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),b=ne;return}while(!1);r=e[J>>2]|0,a=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(o|0),(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),le(o|0)}function qu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=t+4572|0,r=e[F>>2]|0,U=t+148|0,!((e[U>>2]|0)<=0))for(R=t+4576|0,_=t+4580|0,l=r,h=N[r+-1>>0]|0,r=N[r>>0]|0,E=0;D=e[R>>2]|0,C=N[D+(E+-1)>>0]|0,a=E+1|0,o=N[l+a>>0]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=Wu(t,w,N[D+E>>0]|0,l,0)|0,S[(e[R>>2]|0)+E>>0]=D):(a=(Hu(t,E,0)|0)+E|0,o=e[F>>2]|0,r=N[o+(a+-1)>>0]|0,o=N[o+a>>0]|0),!((a|0)>=(e[U>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function Wu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(_=r>>31,D=(_^r)-_|0,R=t+164+(D*12|0)+10|0,o=k[R>>1]|0,F=t+164+(D*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(h=5;(o<>1]^_)-_+a|0,(o&255|0)!=(o|0)&&(o=o>>31&255^255),l=t+112|0,(e[l>>2]|0)<8&&P0(t),a=t+108|0,d=e[a>>2]|0,w=d>>>24,C=e[2832+(h<<11)+(w<<3)+4>>2]|0,C?(e[l>>2]=(e[l>>2]|0)-C,e[a>>2]=d<>2]|0):(l=X0(t)|0,(l|0)<23?h&&(l=(l0(t,h)|0)+(l<>31^l>>1,(((l|0)>-1?l:0-l|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96))),C=t+164+(D*12|0)+4|0,a=e[C>>2]|0,h?h=k[R>>1]|0:(t=k[R>>1]|0,h=t,l=(a<<1)+-1+(t<<16>>16)>>31^l),d=h<<16>>16==64,t=d&1,w=a+l>>t,d=d?32:h<<16>>16,e[F>>2]=((l|0)>-1?l:0-l|0)+(e[F>>2]|0)>>t,a=d+1|0,k[R>>1]=a,h=a+w|0,(h|0)<1?(R=k[E>>1]|0,k[E>>1]=(R&65535)-(R<<16>>16>-128&1),R=(h|0)>(~d|0)?h:0-d|0,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0):(w|0)<=0?(R=w,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0):(R=w-a|0,F=k[E>>1]|0,k[E>>1]=(F<<16>>16<127&1)+(F&65535),R=(R|0)>0?0:R,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0)}function Hu(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=t+4576|0,l=e[h>>2]|0,o=S[l+(r+-1)>>0]|0,d=t+148|0,l=Qu(t,o,l+r|0,(e[d>>2]|0)-r|0)|0,a=l+r|0,(a|0)==(e[d>>2]|0)?(d=l,d|0):(o=o&255,r=N[(e[t+4572>>2]|0)+a>>0]|0,d=o-r|0,(((d|0)>-1?d:0-d|0)|0)<1?o=(Ts(t,t+4556|0)|0)+o|0:o=(ie(Ts(t,t+4544|0)|0,r-o>>31|1)|0)+r|0,S[(e[h>>2]|0)+a>>0]=o,d=t+4568|0,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,d=l+1|0,d|0)}function Qu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4568|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}return(E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0||Jt(o|0,r|0,l|0)|0,l|0}function Ts(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(w=r+9|0,o=N[w>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;l=e[36476+(e[t+4568>>2]<<2)>>2]|0,o=X0(t)|0;do if((o|0)<(22-l|0))if(a){o=(l0(t,a)|0)+(o<>2]|0,l=o+t|0,C=l&1,a=C,h=1,l=(C+l|0)/2|0;break}else{t=e[h>>2]|0,l=t+o|0,a=l&1,l=(a+l|0)/2|0,d=8;break}else o=(l0(t,8)|0)+1|0,t=e[h>>2]|0,l=o+t|0,h=l&1,l=(h+l|0)/2|0,a?(a=h,h=1):(a=h,d=8);while(!1);return(d|0)==8&&(h=N[r+10>>0]<<1>>>0>=(N[w>>0]|0)>>>0),l=(a|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(o+1-t>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[w>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(C=a,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[w>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0)}function Ku(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,255,0),C=t+152|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+156>>2]|0)&&(e[w+12>>2]|0)==(e[t+160>>2]|0)){C=e[8900]|0,e[t+4580>>2]=C+(((e[8901]|0)-C|0)>>>1),b=D;return}for(o=t+4584|0,a=t+4588|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=512?h>>>0>512&&(d=r+512|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,512-h|0),r=e[o>>2]|0),w=t+4580|0,e[w>>2]=r+256,d=t+160|0,l=t+156|0,h=-256;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==256)break}b=D}function Yu(t){t=t|0;var r=0,o=0;e[t>>2]=35688,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function ju(t){t=t|0;var r=0,o=0;if(e[t>>2]=35688,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Xu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0)}function Zu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,255,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+152>>2]=d|0?d:e[w+4>>2]|0,e[t+156>>2]=h,e[t+160>>2]=a,q5(t),a=0;do e[t+164+(a*12|0)>>2]=4,e[t+164+(a*12|0)+4>>2]=0,k[t+164+(a*12|0)+8>>1]=0,k[t+164+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4544>>2]=4,e[t+4548>>2]=0,S[t+4552>>0]=w,S[t+4553>>0]=1,S[t+4554>>0]=0,e[t+4556>>2]=4,e[t+4560>>2]=1,S[t+4564>>0]=w,S[t+4565>>0]=1,S[t+4566>>0]=0,e[t+4568>>2]=0,b=l}function Ju(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4596>>0]=l&1,r=t+132|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),tc(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function tc(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+148|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;e:do if(r){if(r>>>0>1431655765&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r*3|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,e[re+8>>2]=o+(r*3|0);;)if(S[o>>0]=0,S[o+1>>0]=0,S[o+2>>0]=0,o=(e[ce>>2]|0)+3|0,e[ce>>2]=o,r=r+-1|0,!r)break e}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)h=19;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(h=17),(h|0)==17&&(a=L<<2,m=0,l=ge(67,a|0)|0,G=m,m=0,!(G&1))){e[J>>2]=l,h=l+(L<<2)|0,e[J+8>>2]=h,Jt(l|0,0,a|0)|0,e[ae>>2]=h,h=19;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4572|0,w=ie(L,P)|0,C=w+1|0,D=t+4576|0,E=(L|0)>0,F=t+136|0,R=t+144|0,_=t+140|0,U=t+132|0,H=t+88|0,K=t+4568|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+3|0,e[d>>2]=o,a=a+(C*3|0)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],r=e[$>>2]|0,l=o+(r*3|0)|0,o=o+((r+-1|0)*3|0)|0,S[l>>0]=S[o>>0]|0,S[l+1>>0]=S[o+1>>0]|0,S[l+2>>0]=S[o+2>>0]|0,o=e[d>>2]|0,l=(e[D>>2]|0)+-3|0,S[l>>0]=S[o>>0]|0,S[l+1>>0]=S[o+1>>0]|0,S[l+2>>0]=S[o+2>>0]|0,m=0,Ae(82,t|0,0),l=m,m=0,l&1){h=30;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P*3|0)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P*3|0)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+(((e[U>>2]|0)-w|0)*3|0)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){h=31;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){h=43;break e}}if((h|0)==30){a=j()|0;break}else if((h|0)==31){a=j()|0;break}}else h=43;while(!1);do if((h|0)==43){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}function ic(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0;if(ae=t+148|0,!((e[ae>>2]|0)<=0))for(re=t+4576|0,ce=t+4572|0,Ee=t+4580|0,ne=0;P=ne+-1|0,h=e[re>>2]|0,d=e[ce>>2]|0,r=ne+1|0,l=N[d+(ne*3|0)>>0]|0,J=e[Ee>>2]|0,w=N[d+(P*3|0)>>0]|0,C=l-w|0,D=N[h+(P*3|0)>>0]|0,E=w-D|0,F=((((S[J+((N[d+(r*3|0)>>0]|0)-l)>>0]|0)*9|0)+(S[J+C>>0]|0)|0)*9|0)+(S[J+E>>0]|0)|0,a=N[d+(ne*3|0)+1>>0]|0,R=N[d+(P*3|0)+1>>0]|0,_=a-R|0,U=N[h+(P*3|0)+1>>0]|0,H=R-U|0,K=((((S[J+((N[d+(r*3|0)+1>>0]|0)-a)>>0]|0)*9|0)+(S[J+_>>0]|0)|0)*9|0)+(S[J+H>>0]|0)|0,o=N[d+(ne*3|0)+2>>0]|0,G=N[d+(P*3|0)+2>>0]|0,$=o-G|0,P=N[h+(P*3|0)+2>>0]|0,L=G-P|0,J=((((S[J+((N[d+(r*3|0)+2>>0]|0)-o)>>0]|0)*9|0)+(S[J+$>>0]|0)|0)*9|0)+(S[J+L>>0]|0)|0,K|F|J?(d=N[h+(ne*3|0)>>0]|0,h=l-D>>31,(h^E|0)>=0&&((h^C|0)<0?l=D:l=D-w+l|0),d=ar(t,F,d,l,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+1>>0]|0,l=a-U>>31,(l^H|0)>=0&&((l^_|0)<0?a=U:a=U-R+a|0),l=ar(t,K,h,a,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+2>>0]|0,a=o-P>>31,(a^L|0)>=0&&((a^$|0)<0?o=P:o=P-G+o|0),J=ar(t,J,h,o,0)|0,ne=(e[re>>2]|0)+(ne*3|0)|0,S[ne>>0]=d,S[ne+1>>0]=l,S[ne+2>>0]=J):r=(nc(t,ne,0)|0)+ne|0,(r|0)<(e[ae>>2]|0);)ne=r}function nc(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;return C=b,b=b+16|0,E=C+3|0,F=C,h=t+4576|0,o=e[h>>2]|0,a=o+((r+-1|0)*3|0)|0,d=S[a>>0]|0,w=S[a+1>>0]|0,a=S[a+2>>0]|0,S[F>>0]=d,S[F+1>>0]=w,S[F+2>>0]=a,D=t+148|0,l=(e[D>>2]|0)-r|0,S[E>>0]=S[F>>0]|0,S[E+1>>0]=S[F+1>>0]|0,S[E+2>>0]=S[F+2>>0]|0,l=rc(t,E,o+(r*3|0)|0,l)|0,o=l+r|0,(o|0)==(e[D>>2]|0)?(F=l,b=C,F|0):(E=(e[t+4572>>2]|0)+(o*3|0)|0,r=S[E>>0]|0,D=S[E+1>>0]|0,E=S[E+2>>0]|0,F=e[h>>2]|0,h=t+4544|0,_=lr(t,h)|0,R=lr(t,h)|0,r=r&255,r=(ie(r-(d&255)>>31|1,_)|0)+r&255,D=D&255,D=(ie(D-(w&255)>>31|1,R)|0)+D&255,E=E&255,E=(ie(E-(a&255)>>31|1,lr(t,h)|0)|0)+E&255,F=F+(o*3|0)|0,S[F>>0]=r,S[F+1>>0]=D,S[F+2>>0]=E,F=t+4568|0,E=e[F>>2]|0,e[F>>2]=(E|0)<1?0:E+-1|0,F=l+1|0,b=C,F|0)}function ar(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(_=r>>31,D=(_^r)-_|0,R=t+164+(D*12|0)+10|0,o=k[R>>1]|0,F=t+164+(D*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(h=5;(o<>1]^_)-_+a|0,(o&255|0)!=(o|0)&&(o=o>>31&255^255),l=t+112|0,(e[l>>2]|0)<8&&P0(t),a=t+108|0,d=e[a>>2]|0,w=d>>>24,C=e[2832+(h<<11)+(w<<3)+4>>2]|0,C?(e[l>>2]=(e[l>>2]|0)-C,e[a>>2]=d<>2]|0):(l=X0(t)|0,(l|0)<23?h&&(l=(l0(t,h)|0)+(l<>31^l>>1,(((l|0)>-1?l:0-l|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96))),C=t+164+(D*12|0)+4|0,a=e[C>>2]|0,h?h=k[R>>1]|0:(t=k[R>>1]|0,h=t,l=(a<<1)+-1+(t<<16>>16)>>31^l),d=h<<16>>16==64,t=d&1,w=a+l>>t,d=d?32:h<<16>>16,e[F>>2]=((l|0)>-1?l:0-l|0)+(e[F>>2]|0)>>t,a=d+1|0,k[R>>1]=a,h=a+w|0,(h|0)<1?(R=k[E>>1]|0,k[E>>1]=(R&65535)-(R<<16>>16>-128&1),R=(h|0)>(~d|0)?h:0-d|0,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0):(w|0)<=0?(R=w,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0):(R=w-a|0,F=k[E>>1]|0,k[E>>1]=(F<<16>>16<127&1)+(F&65535),R=(R|0)>0?0:R,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0)}function rc(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4568|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0)return l|0;h=0;do R=o+(h*3|0)|0,S[R>>0]=S[r>>0]|0,S[R+1>>0]=S[r+1>>0]|0,S[R+2>>0]=S[r+2>>0]|0,h=h+1|0;while((h|0)!=(l|0));return l|0}function lr(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(w=r+9|0,o=N[w>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;l=e[36476+(e[t+4568>>2]<<2)>>2]|0,o=X0(t)|0;do if((o|0)<(22-l|0))if(a){o=(l0(t,a)|0)+(o<>2]|0,l=o+t|0,C=l&1,a=C,h=1,l=(C+l|0)/2|0;break}else{t=e[h>>2]|0,l=t+o|0,a=l&1,l=(a+l|0)/2|0,d=8;break}else o=(l0(t,8)|0)+1|0,t=e[h>>2]|0,l=o+t|0,h=l&1,l=(h+l|0)/2|0,a?(a=h,h=1):(a=h,d=8);while(!1);return(d|0)==8&&(h=N[r+10>>0]<<1>>>0>=(N[w>>0]|0)>>>0),l=(a|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(o+1-t>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[w>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(C=a,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[w>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0)}function sc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+128|0,h=E,R=E+116|0,_=E+104|0,w=E+20|0,D=E+16|0,C=E+12|0,F=E+8|0,d=E+4|0,S[R>>0]=S[58887]|0,S[R+1>>0]=S[58888]|0,S[R+2>>0]=S[58889]|0,S[R+3>>0]=S[58890]|0,S[R+4>>0]=S[58891]|0,S[R+5>>0]=S[58892]|0,Ei(R+1|0,58893,0,e[o+4>>2]|0),t=b0()|0,e[h>>2]=l,l=_+(q0(_,12,t,R,h)|0)|0,R=ri(_,l,o)|0,t=f0(o)|0,e[F>>2]=t,m=0,dt(3,_|0,R|0,l|0,w|0,D|0,C|0,F|0),l=m,m=0,l&1)_=j()|0,Bt(t)|0,le(_|0);else return Bt(t)|0,e[d>>2]=e[r>>2],R=e[D>>2]|0,_=e[C>>2]|0,e[h>>2]=e[d>>2],_=Hi(h,w,R,_,o,a)|0,b=E,_|0;return 0}function oc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(F=b,b=b+240|0,d=F+8|0,t=F,_=F+204|0,C=F+32|0,E=F+28|0,D=F+24|0,R=F+20|0,w=F+16|0,U=t,e[U>>2]=37,e[U+4>>2]=0,Ei(t+1|0,58895,0,e[o+4>>2]|0),U=b0()|0,H=d,e[H>>2]=l,e[H+4>>2]=h,h=_+(q0(_,23,U,t,d)|0)|0,l=ri(_,h,o)|0,t=f0(o)|0,e[R>>2]=t,m=0,dt(3,_|0,l|0,h|0,C|0,E|0,D|0,R|0),h=m,m=0,h&1)H=j()|0,Bt(t)|0,le(H|0);else return Bt(t)|0,e[w>>2]=e[r>>2],U=e[E>>2]|0,H=e[D>>2]|0,e[d>>2]=e[w>>2],H=Hi(d,C,U,H,o,a)|0,b=F,H|0;return 0}function ac(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=+l;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;J=b,b=b+352|0,K=J+312|0,R=J+48|0,F=J+32|0,C=J+24|0,h=J+8|0,E=J,U=J+316|0,H=J+80|0,w=J+84|0,L=J+76|0,P=J+72|0,G=J+68|0,$=J+64|0,D=E,e[D>>2]=37,e[D+4>>2]=0,D=gn(E+1|0,58898,e[o+4>>2]|0)|0,e[H>>2]=U,t=b0()|0,D?(e[h>>2]=e[o+8>>2],B[h+8>>3]=l,h=q0(U,30,t,E,h)|0):(B[C>>3]=l,h=q0(U,30,t,E,C)|0);e:do if((h|0)>29){m=0,t=Ce(3)|0,h=m,m=0,h=h&1,D?!h&&(m=0,e[F>>2]=e[o+8>>2],B[F+8>>3]=l,d=Pe(17,H|0,t|0,E|0,F|0)|0,_=m,m=0,!(_&1))&&(ne=12):!h&&(m=0,e[R>>2]=e[o+8>>2],B[R+8>>3]=l,_=Pe(17,H|0,t|0,E|0,R|0)|0,R=m,m=0,!(R&1))&&(d=_,ne=12);do if((ne|0)==12){if(t=e[H>>2]|0,t)h=t;else{if(m=0,bt(6),_=m,m=0,_&1)break;h=e[H>>2]|0}t=h,E=h,ne=16;break e}while(!1);t=j()|0}else t=e[H>>2]|0,E=0,d=h,ne=16;while(!1);if((ne|0)==16){C=t+d|0,D=ri(t,C,o)|0;do if((t|0)==(U|0))t=U,h=0,ne=22;else{if(d=E0(d<<3)|0,!d){if(m=0,bt(6),ne=m,m=0,ne&1){h=0,ne=20;break}t=e[H>>2]|0}h=d,w=d,ne=22}while(!1);do if((ne|0)==22)if(m=0,d=ge(68,o|0)|0,H=m,m=0,H&1)ne=20;else{if(e[G>>2]=d,m=0,dt(4,t|0,D|0,C|0,w|0,L|0,P|0,G|0),G=m,m=0,G&1){t=j()|0,Bt(d)|0;break}if(Bt(d)|0,e[$>>2]=e[r>>2],ne=e[L>>2]|0,t=e[P>>2]|0,m=0,e[K>>2]=e[$>>2],t=Vt(40,K|0,w|0,ne|0,t|0,o|0,a|0)|0,ne=m,m=0,ne&1)ne=20;else return e[r>>2]=t,h&&n0(h),E&&n0(E),b=J,t|0}while(!1);(ne|0)==20&&(t=j()|0),h&&n0(h),E&&n0(E)}return le(t|0),0}function uc(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;switch(L=b,b=b+16|0,J=L,P=O0(d,44212)|0,G=O0(d,44368)|0,t0[e[(e[G>>2]|0)+20>>2]&127](J,G),e[h>>2]=a,d=S[t>>0]|0,d<<24>>24){case 43:case 45:{m=0,d=Ne(e[(e[P>>2]|0)+44>>2]|0,P|0,d|0)|0,$=m,m=0,$&1?K=8:(D=e[h>>2]|0,e[h>>2]=D+4,e[D>>2]=d,D=t+1|0,K=10);break}default:D=t,K=10}e:do if((K|0)==10){$=o;t:do if(($-D|0)>1&&(S[D>>0]|0)==48){switch(w=D+1|0,S[w>>0]|0){case 88:case 120:break;default:{K=11;break t}}if(m=0,d=Ne(e[(e[P>>2]|0)+44>>2]|0,P|0,48)|0,H=m,m=0,H&1){K=8;break e}if(H=e[h>>2]|0,e[h>>2]=H+4,e[H>>2]=d,D=D+2|0,m=0,d=Ne(e[(e[P>>2]|0)+44>>2]|0,P|0,S[w>>0]|0)|0,H=m,m=0,H&1){K=8;break e}if(H=e[h>>2]|0,e[h>>2]=H+4,e[H>>2]=d,D>>>0>>0){for(d=D;w=S[d>>0]|0,m=0,C=Ce(3)|0,H=m,m=0,!(H&1||(m=0,w=Ne(39,w<<24>>24|0,C|0)|0,H=m,m=0,H&1));){if(!w){H=D;break t}if(d=d+1|0,d>>>0>=o>>>0){H=D;break t}}d=j()|0;break e}else H=D,d=D}else K=11;while(!1);t:do if((K|0)==11)if(D>>>0>>0){for(d=D;w=S[d>>0]|0,m=0,C=Ce(3)|0,H=m,m=0,!(H&1||(m=0,w=Ne(40,w<<24>>24|0,C|0)|0,H=m,m=0,H&1));){if(!w){H=D;break t}if(d=d+1|0,d>>>0>=o>>>0){H=D;break t}}d=j()|0;break e}else H=D,d=D;while(!1);if(_=S[J>>0]|0,U=J+4|0,(_&1?e[U>>2]|0:(_&255)>>>1)|0){if((H|0)!=(d|0)&&(E=d+-1|0,H>>>0>>0)){C=H,w=E;do _=S[C>>0]|0,S[C>>0]=S[w>>0]|0,S[w>>0]=_,C=C+1|0,w=w+-1|0;while(C>>>0>>0)}if(m=0,E=ge(e[(e[G>>2]|0)+16>>2]|0,G|0)|0,_=m,m=0,_&1){K=8;break}F=J+8|0,R=J+1|0;t:do if(H>>>0>>0){for(w=0,C=0,_=H;D=S[(S[J>>0]&1?e[F>>2]|0:R)+C>>0]|0,D<<24>>24>0&(w|0)==(D<<24>>24|0)?(w=e[h>>2]|0,e[h>>2]=w+4,e[w>>2]=E,w=S[J>>0]|0,D=0,C=(C>>>0<((w&1?e[U>>2]|0:(w&255)>>>1)+-1|0)>>>0&1)+C|0):D=w,m=0,w=Ne(e[(e[P>>2]|0)+44>>2]|0,P|0,S[_>>0]|0)|0,ne=m,m=0,!(ne&1);){if(ne=e[h>>2]|0,e[h>>2]=ne+4,e[ne>>2]=w,_=_+1|0,_>>>0>=d>>>0)break t;w=D+1|0}d=j()|0;break e}while(!1);if(w=a+(H-t<<2)|0,D=e[h>>2]|0,(w|0)!=(D|0))if(C=D+-4|0,w>>>0>>0){do ne=e[w>>2]|0,e[w>>2]=e[C>>2],e[C>>2]=ne,w=w+4|0,C=C+-4|0;while(w>>>0>>0);E=P,w=D}else E=P,w=D;else E=P}else{if(m=0,Pe(e[(e[P>>2]|0)+48>>2]|0,P|0,H|0,d|0,e[h>>2]|0)|0,ne=m,m=0,ne&1){K=8;break}w=(e[h>>2]|0)+(d-H<<2)|0,e[h>>2]=w,E=P}t:do if(d>>>0>>0){for(;;){if(w=S[d>>0]|0,w<<24>>24==46){C=d;break}if(m=0,C=Ne(e[(e[E>>2]|0)+44>>2]|0,P|0,w|0)|0,ne=m,m=0,ne&1){K=4;break}if(ne=e[h>>2]|0,w=ne+4|0,e[h>>2]=w,e[ne>>2]=C,d=d+1|0,d>>>0>=o>>>0)break t}if((K|0)==4){d=j()|0;break e}if(m=0,d=ge(e[(e[G>>2]|0)+12>>2]|0,G|0)|0,ne=m,m=0,ne&1){K=8;break e}ne=e[h>>2]|0,w=ne+4|0,e[h>>2]=w,e[ne>>2]=d,d=C+1|0}while(!1);if(m=0,Pe(e[(e[P>>2]|0)+48>>2]|0,P|0,d|0,o|0,w|0)|0,ne=m,m=0,ne&1)K=8;else{ne=(e[h>>2]|0)+($-d<<2)|0,e[h>>2]=ne,e[l>>2]=(r|0)==(o|0)?ne:a+(r-t<<2)|0,de(J),b=L;return}}while(!1);(K|0)==8&&(d=j()|0),de(J),le(d|0)}function cc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=+l;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;J=b,b=b+352|0,K=J+304|0,R=J+48|0,F=J+32|0,C=J+24|0,h=J+8|0,E=J,U=J+308|0,H=J+72|0,w=J+76|0,L=J+68|0,P=J+64|0,G=J+60|0,$=J+56|0,D=E,e[D>>2]=37,e[D+4>>2]=0,D=gn(E+1|0,58899,e[o+4>>2]|0)|0,e[H>>2]=U,t=b0()|0,D?(e[h>>2]=e[o+8>>2],B[h+8>>3]=l,h=q0(U,30,t,E,h)|0):(B[C>>3]=l,h=q0(U,30,t,E,C)|0);e:do if((h|0)>29){m=0,t=Ce(3)|0,h=m,m=0,h=h&1,D?!h&&(m=0,e[F>>2]=e[o+8>>2],B[F+8>>3]=l,d=Pe(17,H|0,t|0,E|0,F|0)|0,_=m,m=0,!(_&1))&&(ne=12):!h&&(m=0,B[R>>3]=l,_=Pe(17,H|0,t|0,E|0,R|0)|0,R=m,m=0,!(R&1))&&(d=_,ne=12);do if((ne|0)==12){if(t=e[H>>2]|0,t)h=t;else{if(m=0,bt(6),_=m,m=0,_&1)break;h=e[H>>2]|0}t=h,E=h,ne=16;break e}while(!1);t=j()|0}else t=e[H>>2]|0,E=0,d=h,ne=16;while(!1);if((ne|0)==16){C=t+d|0,D=ri(t,C,o)|0;do if((t|0)==(U|0))t=U,h=0,ne=22;else{if(d=E0(d<<3)|0,!d){if(m=0,bt(6),ne=m,m=0,ne&1){h=0,ne=20;break}t=e[H>>2]|0}h=d,w=d,ne=22}while(!1);do if((ne|0)==22)if(m=0,d=ge(68,o|0)|0,H=m,m=0,H&1)ne=20;else{if(e[G>>2]=d,m=0,dt(4,t|0,D|0,C|0,w|0,L|0,P|0,G|0),G=m,m=0,G&1){t=j()|0,Bt(d)|0;break}if(Bt(d)|0,e[$>>2]=e[r>>2],ne=e[L>>2]|0,t=e[P>>2]|0,m=0,e[K>>2]=e[$>>2],t=Vt(40,K|0,w|0,ne|0,t|0,o|0,a|0)|0,ne=m,m=0,ne&1)ne=20;else return e[r>>2]=t,h&&n0(h),E&&n0(E),b=J,t|0}while(!1);(ne|0)==20&&(t=j()|0),h&&n0(h),E&&n0(E)}return le(t|0),0}function fc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(R=b,b=b+192|0,C=R,t=R+180|0,E=R+160|0,F=R+12|0,w=R+8|0,D=R+4|0,S[t>>0]=S[58901]|0,S[t+1>>0]=S[58902]|0,S[t+2>>0]=S[58903]|0,S[t+3>>0]=S[58904]|0,S[t+4>>0]=S[58905]|0,S[t+5>>0]=S[58906]|0,h=b0()|0,e[C>>2]=l,t=q0(E,20,h,t,C)|0,l=E+t|0,h=ri(E,l,o)|0,d=f0(o)|0,e[w>>2]=d,m=0,w=Ne(37,w|0,44212)|0,_=m,m=0,_&1)_=j()|0,Bt(d)|0,le(_|0);else return Bt(d)|0,_r[e[(e[w>>2]|0)+48>>2]&31](w,E,l,F)|0,_=F+(t<<2)|0,e[D>>2]=e[r>>2],e[C>>2]=e[D>>2],_=Hi(C,F,(h|0)==(l|0)?_:F+(h-E<<2)|0,_,o,a)|0,b=R,_|0;return 0}function xi(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;ne=b,b=b+32|0,K=ne+16|0,H=ne+12|0,P=ne+8|0,G=ne+4|0,$=ne,C=f0(a)|0,e[P>>2]=C,m=0,P=Ne(37,P|0,44220)|0,U=m,m=0,U&1&&(ne=j()|0,Bt(C)|0,le(ne|0)),Bt(C)|0,e[l>>2]=0,U=P+8|0,C=e[r>>2]|0;e:do if((d|0)!=(w|0)){t:for(;;){D=C,C?(e[C+12>>2]|0)==(e[C+16>>2]|0)&&(Et[e[(e[C>>2]|0)+36>>2]&127](C)|0)==-1&&(e[r>>2]=0,C=0,D=0):C=0,R=(C|0)==0,F=e[o>>2]|0,E=F;do if(F){if((e[F+12>>2]|0)==(e[F+16>>2]|0)&&(Et[e[(e[F>>2]|0)+36>>2]&127](F)|0)==-1){e[o>>2]=0,E=0,J=12;break}if(!R){J=13;break t}}else J=12;while(!1);if((J|0)==12)if(J=0,R){J=13;break}else F=0;i:do if((Yt[e[(e[P>>2]|0)+36>>2]&63](P,S[d>>0]|0,0)|0)<<24>>24==37){if(F=d+1|0,(F|0)==(w|0)){J=17;break t}switch(_=Yt[e[(e[P>>2]|0)+36>>2]&63](P,S[F>>0]|0,0)|0,_<<24>>24){case 48:case 69:{if(R=d+2|0,(R|0)==(w|0)){J=20;break t}d=F,F=Yt[e[(e[P>>2]|0)+36>>2]&63](P,S[R>>0]|0,0)|0,C=_;break}default:F=_,C=0}_=e[(e[t>>2]|0)+36>>2]|0,e[G>>2]=D,e[$>>2]=E,e[H>>2]=e[G>>2],e[K>>2]=e[$>>2],_=Ci[_&15](t,H,K,a,l,h,F,C)|0,e[r>>2]=_,d=d+2|0}else{if(D=S[d>>0]|0,D<<24>>24>-1&&(L=e[U>>2]|0,(k[L+(D<<24>>24<<1)>>1]&8192)!=0)){do{if(d=d+1|0,(d|0)==(w|0)){d=w;break}if(D=S[d>>0]|0,D<<24>>24<=-1)break}while(k[L+(D<<24>>24<<1)>>1]&8192);for(D=F;;){C?(e[C+12>>2]|0)==(e[C+16>>2]|0)&&(Et[e[(e[C>>2]|0)+36>>2]&127](C)|0)==-1&&(e[r>>2]=0,C=0):C=0,E=(C|0)==0;do if(F){if((e[F+12>>2]|0)!=(e[F+16>>2]|0))if(E){_=D;break}else break i;if((Et[e[(e[F>>2]|0)+36>>2]&127](F)|0)!=-1)if(E^(D|0)==0){_=D,F=D;break}else break i;else{e[o>>2]=0,D=0,J=39;break}}else J=39;while(!1);if((J|0)==39){if(J=0,E)break i;_=D,F=0}if(E=C+12|0,D=e[E>>2]|0,R=C+16|0,(D|0)==(e[R>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=N[D>>0]|0,(D&255)<<24>>24<=-1||!(k[(e[U>>2]|0)+(D<<24>>24<<1)>>1]&8192))break i;if(D=e[E>>2]|0,(D|0)==(e[R>>2]|0)){Et[e[(e[C>>2]|0)+40>>2]&127](C)|0,D=_;continue}else{e[E>>2]=D+1,D=_;continue}}}if(E=C+12|0,D=e[E>>2]|0,F=C+16|0,(D|0)==(e[F>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=N[D>>0]|0,_=U0[e[(e[P>>2]|0)+12>>2]&63](P,D&255)|0,_<<24>>24!=(U0[e[(e[P>>2]|0)+12>>2]&63](P,S[d>>0]|0)|0)<<24>>24){J=57;break t}D=e[E>>2]|0,(D|0)==(e[F>>2]|0)?Et[e[(e[C>>2]|0)+40>>2]&127](C)|0:e[E>>2]=D+1,d=d+1|0}while(!1);if(C=e[r>>2]|0,!((d|0)!=(w|0)&(e[l>>2]|0)==0))break e}if((J|0)==13){e[l>>2]=4;break}else if((J|0)==17){e[l>>2]=4;break}else if((J|0)==20){e[l>>2]=4;break}else if((J|0)==57){e[l>>2]=4,C=e[r>>2]|0;break}}while(!1);C?(e[C+12>>2]|0)==(e[C+16>>2]|0)&&(Et[e[(e[C>>2]|0)+36>>2]&127](C)|0)==-1&&(e[r>>2]=0,C=0):C=0,d=(C|0)==0,D=e[o>>2]|0;do if(D){if((e[D+12>>2]|0)==(e[D+16>>2]|0)&&(Et[e[(e[D>>2]|0)+36>>2]&127](D)|0)==-1){e[o>>2]=0,J=67;break}d||(J=68)}else J=67;while(!1);return(J|0)==67&&d&&(J=68),(J|0)==68&&(e[l>>2]=e[l>>2]|2),b=ne,C|0}function hc(t){t=t|0}function dc(t){t=t|0,he(t)}function pc(t){return t=t|0,2}function mc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=xi(t,C,w,a,l,h,58907,58915)|0,b=d,t|0}function gc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,F=t+8|0,F=Et[e[(e[F>>2]|0)+20>>2]&127](F)|0,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],o=S[F>>0]|0,R=(o&1)==0,r=R?F+1|0:e[F+8>>2]|0,o=r+(R?(o&255)>>>1:e[F+4>>2]|0)|0,e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=xi(t,C,w,a,l,h,r,o)|0,b=d,t|0}function Sc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44220)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],Is(t,h+24|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function Is(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0;d=b,b=b+16|0,w=d+4|0,C=d,t=t+8|0,t=Et[e[e[t>>2]>>2]&127](t)|0,e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],o=(Sn(o,w,t,t+168|0,h,l,0)|0)-t|0,(o|0)<168&&(e[r>>2]=((o|0)/12|0|0)%7|0),b=d}function Ac(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44220)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],ks(t,h+16|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function ks(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0;d=b,b=b+16|0,w=d+4|0,C=d,t=t+8|0,t=Et[e[(e[t>>2]|0)+4>>2]&127](t)|0,e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],o=(Sn(o,w,t,t+288|0,h,l,0)|0)-t|0,(o|0)<288&&(e[r>>2]=((o|0)/12|0|0)%12|0),b=d}function vc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44220)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],Es(t,h+20|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function Es(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,4)|0,e[l>>2]&4||((t|0)<69?t=t+2e3|0:t=(t+-69|0)>>>0<31?t+1900|0:t,e[r>>2]=t+-1900),b=d}function xc(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0;Oe=b,b=b+144|0,C=Oe+132|0,w=Oe+116|0,gt=Oe+128|0,P=Oe+124|0,jt=Oe+120|0,Kt=Oe+112|0,pt=Oe+108|0,At=Oe+104|0,y0=Oe+100|0,T0=Oe+96|0,g0=Oe+92|0,D=Oe+88|0,E=Oe+84|0,F=Oe+80|0,R=Oe+76|0,_=Oe+72|0,U=Oe+68|0,H=Oe+64|0,K=Oe+60|0,G=Oe+56|0,$=Oe+52|0,L=Oe+48|0,J=Oe+44|0,ne=Oe+40|0,ae=Oe+36|0,re=Oe+32|0,ce=Oe+28|0,Ee=Oe+24|0,ke=Oe+20|0,Te=Oe+16|0,it=Oe+12|0,Gt=Oe+8|0,s0=Oe+4|0,i0=Oe,e[l>>2]=0,zt=f0(a)|0,e[gt>>2]=zt,m=0,gt=Ne(37,gt|0,44220)|0,qt=m,m=0,qt&1&&(qt=j()|0,Bt(zt)|0,le(qt|0)),Bt(zt)|0;do switch(d<<24>>24|0){case 65:case 97:{e[P>>2]=e[o>>2],e[C>>2]=e[P>>2],Is(t,h+24|0,r,C,l,gt),yt=28;break}case 104:case 66:case 98:{e[jt>>2]=e[o>>2],e[C>>2]=e[jt>>2],ks(t,h+16|0,r,C,l,gt),yt=28;break}case 99:{yt=t+8|0,yt=Et[e[(e[yt>>2]|0)+12>>2]&127](yt)|0,e[Kt>>2]=e[r>>2],e[pt>>2]=e[o>>2],d=S[yt>>0]|0,o=(d&1)==0,qt=o?yt+1|0:e[yt+8>>2]|0,yt=qt+(o?(d&255)>>>1:e[yt+4>>2]|0)|0,e[w>>2]=e[Kt>>2],e[C>>2]=e[pt>>2],yt=xi(t,w,C,a,l,h,qt,yt)|0,e[r>>2]=yt,yt=28;break}case 101:case 100:{e[At>>2]=e[o>>2],e[C>>2]=e[At>>2],wc(t,h+12|0,r,C,l,gt),yt=28;break}case 68:{e[y0>>2]=e[r>>2],e[T0>>2]=e[o>>2],e[w>>2]=e[y0>>2],e[C>>2]=e[T0>>2],yt=xi(t,w,C,a,l,h,58915,58923)|0,e[r>>2]=yt,yt=28;break}case 70:{e[g0>>2]=e[r>>2],e[D>>2]=e[o>>2],e[w>>2]=e[g0>>2],e[C>>2]=e[D>>2],yt=xi(t,w,C,a,l,h,58923,58931)|0,e[r>>2]=yt,yt=28;break}case 72:{e[E>>2]=e[o>>2],e[C>>2]=e[E>>2],yc(t,h+8|0,r,C,l,gt),yt=28;break}case 73:{e[F>>2]=e[o>>2],e[C>>2]=e[F>>2],Cc(t,h+8|0,r,C,l,gt),yt=28;break}case 106:{e[R>>2]=e[o>>2],e[C>>2]=e[R>>2],Tc(t,h+28|0,r,C,l,gt),yt=28;break}case 109:{e[_>>2]=e[o>>2],e[C>>2]=e[_>>2],Ic(t,h+16|0,r,C,l,gt),yt=28;break}case 77:{e[U>>2]=e[o>>2],e[C>>2]=e[U>>2],kc(t,h+4|0,r,C,l,gt),yt=28;break}case 116:case 110:{e[H>>2]=e[o>>2],e[C>>2]=e[H>>2],Ec(t,r,C,l,gt),yt=28;break}case 112:{e[K>>2]=e[o>>2],e[C>>2]=e[K>>2],Dc(t,h+8|0,r,C,l,gt),yt=28;break}case 114:{e[G>>2]=e[r>>2],e[$>>2]=e[o>>2],e[w>>2]=e[G>>2],e[C>>2]=e[$>>2],yt=xi(t,w,C,a,l,h,58931,58942)|0,e[r>>2]=yt,yt=28;break}case 82:{e[L>>2]=e[r>>2],e[J>>2]=e[o>>2],e[w>>2]=e[L>>2],e[C>>2]=e[J>>2],yt=xi(t,w,C,a,l,h,58942,58947)|0,e[r>>2]=yt,yt=28;break}case 83:{e[ne>>2]=e[o>>2],e[C>>2]=e[ne>>2],bc(t,h,r,C,l,gt),yt=28;break}case 84:{e[ae>>2]=e[r>>2],e[re>>2]=e[o>>2],e[w>>2]=e[ae>>2],e[C>>2]=e[re>>2],yt=xi(t,w,C,a,l,h,58947,58955)|0,e[r>>2]=yt,yt=28;break}case 119:{e[ce>>2]=e[o>>2],e[C>>2]=e[ce>>2],Fc(t,h+24|0,r,C,l,gt),yt=28;break}case 120:{qt=e[(e[t>>2]|0)+20>>2]|0,e[Ee>>2]=e[r>>2],e[ke>>2]=e[o>>2],e[w>>2]=e[Ee>>2],e[C>>2]=e[ke>>2],w=on[qt&63](t,w,C,a,l,h)|0;break}case 88:{yt=t+8|0,yt=Et[e[(e[yt>>2]|0)+24>>2]&127](yt)|0,e[Te>>2]=e[r>>2],e[it>>2]=e[o>>2],d=S[yt>>0]|0,o=(d&1)==0,qt=o?yt+1|0:e[yt+8>>2]|0,yt=qt+(o?(d&255)>>>1:e[yt+4>>2]|0)|0,e[w>>2]=e[Te>>2],e[C>>2]=e[it>>2],yt=xi(t,w,C,a,l,h,qt,yt)|0,e[r>>2]=yt,yt=28;break}case 121:{e[Gt>>2]=e[o>>2],e[C>>2]=e[Gt>>2],Es(t,h+20|0,r,C,l,gt),yt=28;break}case 89:{e[s0>>2]=e[o>>2],e[C>>2]=e[s0>>2],Nc(t,h+20|0,r,C,l,gt),yt=28;break}case 37:{e[i0>>2]=e[o>>2],e[C>>2]=e[i0>>2],Rc(t,r,C,l,gt),yt=28;break}default:e[l>>2]=e[l>>2]|4,yt=28}while(!1);return(yt|0)==28&&(w=e[r>>2]|0),b=Oe,w|0}function wc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t+-1|0)>>>0<31&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function yc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<24&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Cc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t+-1|0)>>>0<12&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Tc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,3)|0,o=e[l>>2]|0,(t|0)<366&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Ic(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<13&(o&4|0)==0?e[r>>2]=t+-1:e[l>>2]=o|4,b=d}function kc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<60&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Ec(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0;d=l+8|0;e:for(;;){l=e[r>>2]|0;do if(l){if((e[l+12>>2]|0)==(e[l+16>>2]|0))if((Et[e[(e[l>>2]|0)+36>>2]&127](l)|0)==-1){e[r>>2]=0,l=0;break}else{l=e[r>>2]|0;break}}else l=0;while(!1);l=(l|0)==0,t=e[o>>2]|0;do if(t){if((e[t+12>>2]|0)!=(e[t+16>>2]|0)){if(l)break;break e}if((Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)!=-1){if(l)break;break e}else{e[o>>2]=0,w=12;break}}else w=12;while(!1);if((w|0)==12)if(w=0,l){t=0;break}else t=0;if(l=e[r>>2]|0,h=e[l+12>>2]|0,(h|0)==(e[l+16>>2]|0)?l=Et[e[(e[l>>2]|0)+36>>2]&127](l)|0:l=N[h>>0]|0,(l&255)<<24>>24<=-1||!(k[(e[d>>2]|0)+(l<<24>>24<<1)>>1]&8192))break;if(l=e[r>>2]|0,t=l+12|0,h=e[t>>2]|0,(h|0)==(e[l+16>>2]|0)){Et[e[(e[l>>2]|0)+40>>2]&127](l)|0;continue}else{e[t>>2]=h+1;continue}}l=e[r>>2]|0;do if(l){if((e[l+12>>2]|0)==(e[l+16>>2]|0))if((Et[e[(e[l>>2]|0)+36>>2]&127](l)|0)==-1){e[r>>2]=0,l=0;break}else{l=e[r>>2]|0;break}}else l=0;while(!1);l=(l|0)==0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)&&(Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1){e[o>>2]=0,w=32;break}l||(w=33)}else w=32;while(!1);(w|0)==32&&l&&(w=33),(w|0)==33&&(e[a>>2]=e[a>>2]|2)}function Dc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;E=b,b=b+16|0,w=E+4|0,C=E,D=t+8|0,D=Et[e[(e[D>>2]|0)+8>>2]&127](D)|0,t=S[D>>0]|0,t&1?d=e[D+4>>2]|0:d=(t&255)>>>1,t=S[D+12>>0]|0,t&1?t=e[D+16>>2]|0:t=(t&255)>>>1;do if((d|0)!=(0-t|0)){if(e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],t=Sn(o,w,D,D+24|0,h,l,0)|0,d=e[r>>2]|0,(t|0)==(D|0)&(d|0)==12){e[r>>2]=0;break}(d|0)<12&(t-D|0)==12&&(e[r>>2]=d+12)}else e[l>>2]=e[l>>2]|4;while(!1);b=E}function bc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<61&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Fc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,1)|0,o=e[l>>2]|0,(t|0)<7&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Nc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,4)|0,e[l>>2]&4||(e[r>>2]=t+-1900),b=d}function Rc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0;t=e[r>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0))if((Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1){e[r>>2]=0,t=0;break}else{t=e[r>>2]|0;break}}else t=0;while(!1);h=(t|0)==0,t=e[o>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)&&(Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1){e[o>>2]=0,w=11;break}h?(d=t,w=13):w=12}else w=11;while(!1);(w|0)==11&&(h?w=12:(d=0,w=13));e:do if((w|0)==12)e[a>>2]=e[a>>2]|6;else if((w|0)==13){if(t=e[r>>2]|0,h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=N[h>>0]|0,(Yt[e[(e[l>>2]|0)+36>>2]&63](l,t&255,0)|0)<<24>>24!=37){e[a>>2]=e[a>>2]|4;break}t=e[r>>2]|0,h=t+12|0,l=e[h>>2]|0,(l|0)==(e[t+16>>2]|0)?(Et[e[(e[t>>2]|0)+40>>2]&127](t)|0,t=e[r>>2]|0,t?w=21:t=0):(e[h>>2]=l+1,w=21);do if((w|0)==21&&(e[t+12>>2]|0)==(e[t+16>>2]|0))if((Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1){e[r>>2]=0,t=0;break}else{t=e[r>>2]|0;break}while(!1);t=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)&&(Et[e[(e[d>>2]|0)+36>>2]&127](d)|0)==-1){e[o>>2]=0,w=30;break}if(t)break e}else w=30;while(!1);if((w|0)==30&&!t)break;e[a>>2]=e[a>>2]|2}while(!1)}function wi(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;L=b,b=b+32|0,H=L+16|0,U=L+12|0,$=L+8|0,K=L+4|0,G=L,C=f0(a)|0,e[$>>2]=C,m=0,$=Ne(37,$|0,44212)|0,_=m,m=0,_&1&&(L=j()|0,Bt(C)|0,le(L|0)),Bt(C)|0,e[l>>2]=0,C=e[r>>2]|0;e:do if((d|0)!=(w|0)){t:for(;;){E=C,C?(D=e[C+12>>2]|0,(D|0)==(e[C+16>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=e[D>>2]|0,(D|0)==-1?(e[r>>2]=0,C=0,R=1,_=0):(R=0,_=E)):(C=0,R=1,_=E),F=e[o>>2]|0,D=F;do if(F)if(E=e[F+12>>2]|0,(E|0)==(e[F+16>>2]|0)?E=Et[e[(e[F>>2]|0)+36>>2]&127](F)|0:E=e[E>>2]|0,(E|0)!=-1){if(R)break;P=17;break t}else{e[o>>2]=0,D=0,P=15;break}else P=15;while(!1);if((P|0)==15)if(P=0,R){P=17;break}else F=0;i:do if((Yt[e[(e[$>>2]|0)+52>>2]&63]($,e[d>>2]|0,0)|0)<<24>>24==37){if(E=d+4|0,(E|0)==(w|0)){P=21;break t}switch(R=Yt[e[(e[$>>2]|0)+52>>2]&63]($,e[E>>2]|0,0)|0,R<<24>>24){case 48:case 69:{if(F=d+8|0,(F|0)==(w|0)){P=24;break t}d=E,E=Yt[e[(e[$>>2]|0)+52>>2]&63]($,e[F>>2]|0,0)|0,C=R;break}default:E=R,C=0}R=e[(e[t>>2]|0)+36>>2]|0,e[K>>2]=_,e[G>>2]=D,e[U>>2]=e[K>>2],e[H>>2]=e[G>>2],_=Ci[R&15](t,U,H,a,l,h,E,C)|0,e[r>>2]=_,d=d+8|0}else{if(!(Yt[e[(e[$>>2]|0)+12>>2]&63]($,8192,e[d>>2]|0)|0)){if(E=C+12|0,D=e[E>>2]|0,F=C+16|0,(D|0)==(e[F>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=e[D>>2]|0,_=U0[e[(e[$>>2]|0)+28>>2]&63]($,D)|0,(_|0)!=(U0[e[(e[$>>2]|0)+28>>2]&63]($,e[d>>2]|0)|0)){P=61;break t}D=e[E>>2]|0,(D|0)==(e[F>>2]|0)?Et[e[(e[C>>2]|0)+40>>2]&127](C)|0:e[E>>2]=D+4,d=d+4|0;break}do if(d=d+4|0,(d|0)==(w|0)){d=w;break}while(Yt[e[(e[$>>2]|0)+12>>2]&63]($,8192,e[d>>2]|0)|0);for(D=F,R=F;;){C?(E=e[C+12>>2]|0,(E|0)==(e[C+16>>2]|0)?E=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:E=e[E>>2]|0,(E|0)==-1?(e[r>>2]=0,F=1,C=0):F=0):(F=1,C=0);do if(R)if(E=e[R+12>>2]|0,(E|0)==(e[R+16>>2]|0)?E=Et[e[(e[R>>2]|0)+36>>2]&127](R)|0:E=e[E>>2]|0,(E|0)!=-1)if(F^(D|0)==0){_=D,R=D;break}else break i;else{e[o>>2]=0,D=0,P=44;break}else P=44;while(!1);if((P|0)==44){if(P=0,F)break i;_=D,R=0}if(E=C+12|0,D=e[E>>2]|0,F=C+16|0,(D|0)==(e[F>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=e[D>>2]|0,!(Yt[e[(e[$>>2]|0)+12>>2]&63]($,8192,D)|0))break i;if(D=e[E>>2]|0,(D|0)==(e[F>>2]|0)){Et[e[(e[C>>2]|0)+40>>2]&127](C)|0,D=_;continue}else{e[E>>2]=D+4,D=_;continue}}}while(!1);if(C=e[r>>2]|0,!((d|0)!=(w|0)&(e[l>>2]|0)==0))break e}if((P|0)==17){e[l>>2]=4;break}else if((P|0)==21){e[l>>2]=4;break}else if((P|0)==24){e[l>>2]=4;break}else if((P|0)==61){e[l>>2]=4,C=e[r>>2]|0;break}}while(!1);C?(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)?d=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:d=e[d>>2]|0,(d|0)==-1?(e[r>>2]=0,C=0,E=1):E=0):(C=0,E=1),d=e[o>>2]|0;do if(d)if(D=e[d+12>>2]|0,(D|0)==(e[d+16>>2]|0)?d=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:d=e[D>>2]|0,(d|0)!=-1){if(E)break;P=76;break}else{e[o>>2]=0,P=74;break}else P=74;while(!1);return(P|0)==74&&E&&(P=76),(P|0)==76&&(e[l>>2]=e[l>>2]|2),b=L,C|0}function Mc(t){t=t|0}function _c(t){t=t|0,he(t)}function Pc(t){return t=t|0,2}function Lc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=wi(t,C,w,a,l,h,44788,44820)|0,b=d,t|0}function Oc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,_=t+8|0,_=Et[e[(e[_>>2]|0)+20>>2]&127](_)|0,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],F=S[_>>0]|0,R=(F&1)==0,o=_+4|0,r=R?o:e[_+8>>2]|0,o=r+((R?(F&255)>>>1:e[o>>2]|0)<<2)|0,e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=wi(t,C,w,a,l,h,r,o)|0,b=d,t|0}function $c(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44212)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],Ds(t,h+24|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function Ds(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0;d=b,b=b+16|0,w=d+4|0,C=d,t=t+8|0,t=Et[e[e[t>>2]>>2]&127](t)|0,e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],o=(An(o,w,t,t+168|0,h,l,0)|0)-t|0,(o|0)<168&&(e[r>>2]=((o|0)/12|0|0)%7|0),b=d}function Bc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44212)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],bs(t,h+16|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function bs(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0;d=b,b=b+16|0,w=d+4|0,C=d,t=t+8|0,t=Et[e[(e[t>>2]|0)+4>>2]&127](t)|0,e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],o=(An(o,w,t,t+288|0,h,l,0)|0)-t|0,(o|0)<288&&(e[r>>2]=((o|0)/12|0|0)%12|0),b=d}function Vc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44212)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],Fs(t,h+20|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function Fs(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,4)|0,e[l>>2]&4||((t|0)<69?t=t+2e3|0:t=(t+-69|0)>>>0<31?t+1900|0:t,e[r>>2]=t+-1900),b=d}function Uc(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0;Oe=b,b=b+144|0,C=Oe+132|0,w=Oe+116|0,gt=Oe+128|0,P=Oe+124|0,jt=Oe+120|0,Kt=Oe+112|0,pt=Oe+108|0,At=Oe+104|0,y0=Oe+100|0,T0=Oe+96|0,g0=Oe+92|0,D=Oe+88|0,E=Oe+84|0,F=Oe+80|0,R=Oe+76|0,_=Oe+72|0,U=Oe+68|0,H=Oe+64|0,K=Oe+60|0,G=Oe+56|0,$=Oe+52|0,L=Oe+48|0,J=Oe+44|0,ne=Oe+40|0,ae=Oe+36|0,re=Oe+32|0,ce=Oe+28|0,Ee=Oe+24|0,ke=Oe+20|0,Te=Oe+16|0,it=Oe+12|0,Gt=Oe+8|0,s0=Oe+4|0,i0=Oe,e[l>>2]=0,zt=f0(a)|0,e[gt>>2]=zt,m=0,gt=Ne(37,gt|0,44212)|0,qt=m,m=0,qt&1&&(qt=j()|0,Bt(zt)|0,le(qt|0)),Bt(zt)|0;do switch(d<<24>>24|0){case 65:case 97:{e[P>>2]=e[o>>2],e[C>>2]=e[P>>2],Ds(t,h+24|0,r,C,l,gt),yt=28;break}case 104:case 66:case 98:{e[jt>>2]=e[o>>2],e[C>>2]=e[jt>>2],bs(t,h+16|0,r,C,l,gt),yt=28;break}case 99:{qt=t+8|0,qt=Et[e[(e[qt>>2]|0)+12>>2]&127](qt)|0,e[Kt>>2]=e[r>>2],e[pt>>2]=e[o>>2],d=S[qt>>0]|0,o=(d&1)==0,yt=qt+4|0,qt=o?yt:e[qt+8>>2]|0,yt=qt+((o?(d&255)>>>1:e[yt>>2]|0)<<2)|0,e[w>>2]=e[Kt>>2],e[C>>2]=e[pt>>2],yt=wi(t,w,C,a,l,h,qt,yt)|0,e[r>>2]=yt,yt=28;break}case 101:case 100:{e[At>>2]=e[o>>2],e[C>>2]=e[At>>2],zc(t,h+12|0,r,C,l,gt),yt=28;break}case 68:{e[y0>>2]=e[r>>2],e[T0>>2]=e[o>>2],e[w>>2]=e[y0>>2],e[C>>2]=e[T0>>2],yt=wi(t,w,C,a,l,h,44820,44852)|0,e[r>>2]=yt,yt=28;break}case 70:{e[g0>>2]=e[r>>2],e[D>>2]=e[o>>2],e[w>>2]=e[g0>>2],e[C>>2]=e[D>>2],yt=wi(t,w,C,a,l,h,44852,44884)|0,e[r>>2]=yt,yt=28;break}case 72:{e[E>>2]=e[o>>2],e[C>>2]=e[E>>2],Gc(t,h+8|0,r,C,l,gt),yt=28;break}case 73:{e[F>>2]=e[o>>2],e[C>>2]=e[F>>2],qc(t,h+8|0,r,C,l,gt),yt=28;break}case 106:{e[R>>2]=e[o>>2],e[C>>2]=e[R>>2],Wc(t,h+28|0,r,C,l,gt),yt=28;break}case 109:{e[_>>2]=e[o>>2],e[C>>2]=e[_>>2],Hc(t,h+16|0,r,C,l,gt),yt=28;break}case 77:{e[U>>2]=e[o>>2],e[C>>2]=e[U>>2],Qc(t,h+4|0,r,C,l,gt),yt=28;break}case 116:case 110:{e[H>>2]=e[o>>2],e[C>>2]=e[H>>2],Kc(t,r,C,l,gt),yt=28;break}case 112:{e[K>>2]=e[o>>2],e[C>>2]=e[K>>2],Yc(t,h+8|0,r,C,l,gt),yt=28;break}case 114:{e[G>>2]=e[r>>2],e[$>>2]=e[o>>2],e[w>>2]=e[G>>2],e[C>>2]=e[$>>2],yt=wi(t,w,C,a,l,h,44884,44928)|0,e[r>>2]=yt,yt=28;break}case 82:{e[L>>2]=e[r>>2],e[J>>2]=e[o>>2],e[w>>2]=e[L>>2],e[C>>2]=e[J>>2],yt=wi(t,w,C,a,l,h,44928,44948)|0,e[r>>2]=yt,yt=28;break}case 83:{e[ne>>2]=e[o>>2],e[C>>2]=e[ne>>2],jc(t,h,r,C,l,gt),yt=28;break}case 84:{e[ae>>2]=e[r>>2],e[re>>2]=e[o>>2],e[w>>2]=e[ae>>2],e[C>>2]=e[re>>2],yt=wi(t,w,C,a,l,h,44948,44980)|0,e[r>>2]=yt,yt=28;break}case 119:{e[ce>>2]=e[o>>2],e[C>>2]=e[ce>>2],Xc(t,h+24|0,r,C,l,gt),yt=28;break}case 120:{qt=e[(e[t>>2]|0)+20>>2]|0,e[Ee>>2]=e[r>>2],e[ke>>2]=e[o>>2],e[w>>2]=e[Ee>>2],e[C>>2]=e[ke>>2],w=on[qt&63](t,w,C,a,l,h)|0;break}case 88:{qt=t+8|0,qt=Et[e[(e[qt>>2]|0)+24>>2]&127](qt)|0,e[Te>>2]=e[r>>2],e[it>>2]=e[o>>2],d=S[qt>>0]|0,o=(d&1)==0,yt=qt+4|0,qt=o?yt:e[qt+8>>2]|0,yt=qt+((o?(d&255)>>>1:e[yt>>2]|0)<<2)|0,e[w>>2]=e[Te>>2],e[C>>2]=e[it>>2],yt=wi(t,w,C,a,l,h,qt,yt)|0,e[r>>2]=yt,yt=28;break}case 121:{e[Gt>>2]=e[o>>2],e[C>>2]=e[Gt>>2],Fs(t,h+20|0,r,C,l,gt),yt=28;break}case 89:{e[s0>>2]=e[o>>2],e[C>>2]=e[s0>>2],Zc(t,h+20|0,r,C,l,gt),yt=28;break}case 37:{e[i0>>2]=e[o>>2],e[C>>2]=e[i0>>2],Jc(t,r,C,l,gt),yt=28;break}default:e[l>>2]=e[l>>2]|4,yt=28}while(!1);return(yt|0)==28&&(w=e[r>>2]|0),b=Oe,w|0}function zc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t+-1|0)>>>0<31&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Gc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<24&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function qc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t+-1|0)>>>0<12&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Wc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,3)|0,o=e[l>>2]|0,(t|0)<366&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Hc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<13&(o&4|0)==0?e[r>>2]=t+-1:e[l>>2]=o|4,b=d}function Qc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<60&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Kc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0;e:for(;;){t=e[r>>2]|0;do if(t)if(h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(t|0)==-1){e[r>>2]=0,d=1;break}else{d=(e[r>>2]|0)==0;break}else d=1;while(!1);h=e[o>>2]|0;do if(h)if(t=e[h+12>>2]|0,(t|0)==(e[h+16>>2]|0)?t=Et[e[(e[h>>2]|0)+36>>2]&127](h)|0:t=e[t>>2]|0,(t|0)!=-1)if(d){d=h;break}else{d=h;break e}else{e[o>>2]=0,w=15;break}else w=15;while(!1);if((w|0)==15)if(w=0,d){d=0;break}else d=0;if(t=e[r>>2]|0,h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,!(Yt[e[(e[l>>2]|0)+12>>2]&63](l,8192,t)|0))break;if(t=e[r>>2]|0,h=t+12|0,d=e[h>>2]|0,(d|0)==(e[t+16>>2]|0)){Et[e[(e[t>>2]|0)+40>>2]&127](t)|0;continue}else{e[h>>2]=d+4;continue}}t=e[r>>2]|0;do if(t)if(h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(t|0)==-1){e[r>>2]=0,h=1;break}else{h=(e[r>>2]|0)==0;break}else h=1;while(!1);do if(d)if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)?t=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:t=e[t>>2]|0,(t|0)!=-1){if(h)break;w=39;break}else{e[o>>2]=0,w=37;break}else w=37;while(!1);(w|0)==37&&h&&(w=39),(w|0)==39&&(e[a>>2]=e[a>>2]|2)}function Yc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;E=b,b=b+16|0,w=E+4|0,C=E,D=t+8|0,D=Et[e[(e[D>>2]|0)+8>>2]&127](D)|0,t=S[D>>0]|0,t&1?d=e[D+4>>2]|0:d=(t&255)>>>1,t=S[D+12>>0]|0,t&1?t=e[D+16>>2]|0:t=(t&255)>>>1;do if((d|0)!=(0-t|0)){if(e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],t=An(o,w,D,D+24|0,h,l,0)|0,d=e[r>>2]|0,(t|0)==(D|0)&(d|0)==12){e[r>>2]=0;break}(d|0)<12&(t-D|0)==12&&(e[r>>2]=d+12)}else e[l>>2]=e[l>>2]|4;while(!1);b=E}function jc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<61&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Xc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,1)|0,o=e[l>>2]|0,(t|0)<7&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Zc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,4)|0,e[l>>2]&4||(e[r>>2]=t+-1900),b=d}function Jc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0;t=e[r>>2]|0;do if(t)if(h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(t|0)==-1){e[r>>2]=0,d=1;break}else{d=(e[r>>2]|0)==0;break}else d=1;while(!1);h=e[o>>2]|0;do if(h)if(t=e[h+12>>2]|0,(t|0)==(e[h+16>>2]|0)?t=Et[e[(e[h>>2]|0)+36>>2]&127](h)|0:t=e[t>>2]|0,(t|0)!=-1)if(d){w=h,C=17;break}else{C=16;break}else{e[o>>2]=0,C=14;break}else C=14;while(!1);(C|0)==14&&(d?C=16:(w=0,C=17));e:do if((C|0)==16)e[a>>2]=e[a>>2]|6;else if((C|0)==17){if(t=e[r>>2]|0,h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(Yt[e[(e[l>>2]|0)+52>>2]&63](l,t,0)|0)<<24>>24!=37){e[a>>2]=e[a>>2]|4;break}t=e[r>>2]|0,h=t+12|0,d=e[h>>2]|0,(d|0)==(e[t+16>>2]|0)?(Et[e[(e[t>>2]|0)+40>>2]&127](t)|0,t=e[r>>2]|0,t?C=25:h=1):(e[h>>2]=d+4,C=25);do if((C|0)==25)if(h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(t|0)==-1){e[r>>2]=0,h=1;break}else{h=(e[r>>2]|0)==0;break}while(!1);do if(w)if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)?t=Et[e[(e[w>>2]|0)+36>>2]&127](w)|0:t=e[t>>2]|0,(t|0)!=-1){if(h)break e;break}else{e[o>>2]=0,C=37;break}else C=37;while(!1);if((C|0)==37&&!h)break;e[a>>2]=e[a>>2]|2}while(!1)}function ef(t){t=t|0,cn(t+8|0)}function cn(t){t=t|0;var r=0,o=0,a=0;r=e[t>>2]|0,m=0,o=Ce(3)|0,a=m,m=0;do if(!(a&1)){if((r|0)!=(o|0)&&(m=0,ue(188,e[t>>2]|0),a=m,m=0,a&1))break;return}while(!1);a=j(0)|0,$t(a)}function tf(t){t=t|0,cn(t+8|0),he(t)}function nf(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0;if(C=b,b=b+112|0,w=C+4|0,o=C,e[o>>2]=w+100,Ns(t+8|0,w,o,l,h,d),l=e[o>>2]|0,o=e[r>>2]|0,(w|0)!=(l|0))do{d=S[w>>0]|0;do if(o)if(a=o+24|0,h=e[a>>2]|0,(h|0)==(e[o+28>>2]|0)){r=(U0[e[(e[o>>2]|0)+52>>2]&63](o,d&255)|0)==-1,o=r?0:o;break}else{e[a>>2]=h+1,S[h>>0]=d;break}else o=0;while(!1);w=w+1|0}while((w|0)!=(l|0));return b=C,o|0}function Ns(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0;D=b,b=b+16|0,C=D,S[C>>0]=37,d=C+1|0,S[d>>0]=l,w=C+2|0,S[w>>0]=h,S[C+3>>0]=0,h<<24>>24&&(S[d>>0]=h,S[w>>0]=l),t=r+(Go(r|0,(e[o>>2]|0)-r|0,C|0,a|0,e[t>>2]|0)|0)|0,e[o>>2]=t,b=D}function rf(t){t=t|0,cn(t+8|0)}function sf(t){t=t|0,cn(t+8|0),he(t)}function of(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0;if(w=b,b=b+416|0,a=w+8|0,o=w,e[o>>2]=a+400,af(t+8|0,a,o,l,h,d),t=e[o>>2]|0,o=e[r>>2]|0,(a|0)!=(t|0)){l=a;do a=e[l>>2]|0,o?(h=o+24|0,d=e[h>>2]|0,(d|0)==(e[o+28>>2]|0)?a=U0[e[(e[o>>2]|0)+52>>2]&63](o,a)|0:(e[h>>2]=d+4,e[d>>2]=a),o=(a|0)==-1?0:o):o=0,l=l+4|0;while((l|0)!=(t|0))}return b=w,o|0}function af(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(d=b,b=b+128|0,D=d+16|0,E=d+12|0,w=d,C=d+8|0,e[E>>2]=D+100,Ns(t,D,E,a,l,h),l=w,e[l>>2]=0,e[l+4>>2]=0,e[C>>2]=D,l=(e[o>>2]|0)-r>>2,h=ai(e[t>>2]|0)|0,m=0,l=Pe(18,r|0,C|0,l|0,w|0)|0,t=m,m=0,t&1&&(l=j()|0,h|0&&(m=0,ge(75,h|0)|0,E=m,m=0,E&1)&&(E=j(0)|0,$t(E)),le(l|0)),h|0&&(m=0,ge(75,h|0)|0,E=m,m=0,E&1)&&(E=j(0)|0,$t(E)),(l|0)==-1)fn(58955);else{e[o>>2]=r+(l<<2),b=d;return}}function lf(t){t=t|0}function uf(t){t=t|0,he(t)}function cf(t){return t=t|0,127}function ff(t){return t=t|0,127}function hf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function df(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function pf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function mf(t,r){t=t|0,r=r|0,dr(t,1,45)}function gf(t){return t=t|0,0}function Sf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Af(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function vf(t){t=t|0}function xf(t){t=t|0,he(t)}function wf(t){return t=t|0,127}function yf(t){return t=t|0,127}function Cf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Tf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function If(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function kf(t,r){t=t|0,r=r|0,dr(t,1,45)}function Ef(t){return t=t|0,0}function Df(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function bf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Ff(t){t=t|0}function Nf(t){t=t|0,he(t)}function Rf(t){return t=t|0,2147483647}function Mf(t){return t=t|0,2147483647}function _f(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Pf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Lf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Of(t,r){t=t|0,r=r|0,gr(t,1,45)}function $f(t){return t=t|0,0}function Bf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Vf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Uf(t){t=t|0}function zf(t){t=t|0,he(t)}function Gf(t){return t=t|0,2147483647}function qf(t){return t=t|0,2147483647}function Wf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Hf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Qf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Kf(t,r){t=t|0,r=r|0,gr(t,1,45)}function Yf(t){return t=t|0,0}function jf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Xf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Zf(t){t=t|0}function Jf(t){t=t|0,he(t)}function eh(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;if(ae=b,b=b+240|0,J=ae+24|0,ne=ae,t=ae+136|0,ce=ae+16|0,L=ae+12|0,re=ae+8|0,F=ae+134|0,C=ae+4|0,P=ae+124|0,e[ce>>2]=t,Ee=ce+4|0,e[Ee>>2]=189,D=t+100|0,m=0,w=ge(68,l|0)|0,$=m,m=0,$&1)C=j()|0,e[ce>>2]=0,w=189,Te=45;else{e[re>>2]=w,m=0,t=Ne(37,re|0,44220)|0,$=m,m=0;e:do if(!($&1)&&(S[F>>0]=0,e[C>>2]=e[o>>2],E=e[l+4>>2]|0,m=0,e[J>>2]=e[C>>2],E=Ut(1,r|0,J|0,a|0,re|0,E|0,h|0,F|0,t|0,ce|0,L|0,D|0)|0,$=m,m=0,!($&1))){t:do if(E){if(m=0,Pe(e[(e[t>>2]|0)+32>>2]|0,t|0,58976,58986,P|0)|0,$=m,m=0,$&1){Te=10;break e}C=e[L>>2]|0,D=e[ce>>2]|0,t=C-D|0,(t|0)>98?(t=E0(t+2|0)|0,w=t,t?Te=13:(m=0,bt(6),$=m,m=0,$&1||(t=0,Te=13))):(w=0,t=J,Te=13);do if((Te|0)==13){if(S[F>>0]|0&&(S[t>>0]=45,t=t+1|0),G=P+10|0,$=P,D>>>0>>0){E=P+1|0,a=E+1|0,l=a+1|0,F=l+1|0,R=F+1|0,_=R+1|0,U=_+1|0,H=U+1|0,K=H+1|0;do{C=S[D>>0]|0;do if((S[P>>0]|0)!=C<<24>>24)if((S[E>>0]|0)!=C<<24>>24)if((S[a>>0]|0)!=C<<24>>24)if((S[l>>0]|0)!=C<<24>>24)if((S[F>>0]|0)==C<<24>>24)C=F;else{if((S[R>>0]|0)==C<<24>>24){C=R;break}if((S[_>>0]|0)==C<<24>>24){C=_;break}if((S[U>>0]|0)==C<<24>>24){C=U;break}if((S[H>>0]|0)==C<<24>>24){C=H;break}C=(S[K>>0]|0)==C<<24>>24?K:G}else C=l;else C=a;else C=E;else C=P;while(!1);S[t>>0]=S[58976+(C-$)>>0]|0,D=D+1|0,t=t+1|0}while(D>>>0<(e[L>>2]|0)>>>0)}if(S[t>>0]=0,e[ne>>2]=d,(_o(J,58987,ne)|0)!=1&&(m=0,ue(190,58991),d=m,m=0,d&1))break;w&&n0(w);break t}while(!1);if(t=j()|0,!w){C=t,w=ce;break e}n0(w),C=t,w=ce;break e}while(!1);t=e[r>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1){Te=10;break e}if((t|0)==-1){e[r>>2]=0,t=0;break}else{t=e[r>>2]|0;break}}}else t=0;while(!1);w=(t|0)==0,t=e[o>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1){Te=10;break e}if((t|0)==-1){e[o>>2]=0,Te=37;break}}w||(Te=38)}else Te=37;while(!1);return(Te|0)==37&&w&&(Te=38),(Te|0)==38&&(e[h>>2]=e[h>>2]|2),w=e[r>>2]|0,Bt(e[re>>2]|0)|0,t=e[ce>>2]|0,e[ce>>2]=0,t|0&&(m=0,ue(e[Ee>>2]|0,t|0),Te=m,m=0,Te&1)&&(Te=j(0)|0,$t(Te)),b=ae,w|0}else Te=10;while(!1);(Te|0)==10&&(C=j()|0,w=ce),Bt(e[re>>2]|0)|0,t=e[w>>2]|0,e[w>>2]=0,t?(w=e[Ee>>2]|0,Te=45):ke=C}return(Te|0)==45&&(m=0,ue(w|0,t|0),Te=m,m=0,Te&1?(Te=j(0)|0,$t(Te)):ke=C),le(ke|0),0}function th(t){t=t|0}function ih(t,r,o,a,l,h,d,w,C,D,E){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0;var F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0,c0=0,a0=0,h0=0,D0=0,A0=0,Ti=0,N0=0;A0=b,b=b+512|0,gt=A0+88|0,U=A0+96|0,N0=A0+80|0,y0=A0+72|0,At=A0+68|0,T0=A0+500|0,Kt=A0+497|0,g0=A0+496|0,qt=A0+56|0,D0=A0+44|0,a0=A0+32|0,c0=A0+20|0,h0=A0+8|0,pt=A0+4|0,yt=A0,e[gt>>2]=E,e[N0>>2]=U,Ti=N0+4|0,e[Ti>>2]=189,e[y0>>2]=U,e[At>>2]=U+400,e[qt>>2]=0,e[qt+4>>2]=0,e[qt+8>>2]=0,e[D0>>2]=0,e[D0+4>>2]=0,e[D0+8>>2]=0,e[a0>>2]=0,e[a0+4>>2]=0,e[a0+8>>2]=0,e[c0>>2]=0,e[c0+4>>2]=0,e[c0+8>>2]=0,e[h0>>2]=0,e[h0+4>>2]=0,e[h0+8>>2]=0,m=0,I0(1,o|0,a|0,T0|0,Kt|0,g0|0,qt|0,D0|0,a0|0,c0|0,pt|0),zt=m,m=0;e:do if(zt&1)w=j()|0;else{e[D>>2]=e[C>>2],Te=w+8|0,it=a0+4|0,jt=c0+4|0,Gt=c0+8|0,s0=c0+1|0,i0=a0+8|0,zt=a0+1|0,P=(l&512|0)!=0,L=D0+8|0,J=D0+1|0,ne=D0+4|0,ae=h0+4|0,re=h0+8|0,ce=h0+1|0,Ee=T0+3|0,ke=qt+4|0,$=0,_=0;t:for(;;){E=e[t>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}if((E|0)==-1){e[t>>2]=0,E=0;break}else{E=e[t>>2]|0;break}}}else E=0;while(!1);E=(E|0)==0,w=e[r>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0))if(E){G=w;break}else{Oe=235;break t}if(m=0,o=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=24;break t}if((o|0)!=-1)if(E){G=w;break}else{Oe=235;break t}else{e[r>>2]=0,Oe=15;break}}else Oe=15;while(!1);if((Oe|0)==15)if(Oe=0,E){Oe=235;break}else G=0;i:do switch(S[T0+$>>0]|0){case 1:{if(($|0)!=3){if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,Oe=m,m=0,Oe&1){Oe=24;break t}}else E=N[w>>0]|0;if((E&255)<<24>>24<=-1){Oe=40;break t}if(!(k[(e[Te>>2]|0)+(E<<24>>24<<1)>>1]&8192)){Oe=40;break t}if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,Oe=m,m=0,Oe&1){Oe=24;break t}}else e[w>>2]=o+1,E=N[o>>0]|0;if(m=0,Ae(67,h0|0,E&255|0),Oe=m,m=0,Oe&1){Oe=24;break t}else E=G,a=G,Oe=42}break}case 0:{($|0)!=3&&(E=G,a=G,Oe=42);break}case 3:{if(w=S[a0>>0]|0,E=w&1?e[it>>2]|0:(w&255)>>>1,o=S[c0>>0]|0,a=o&1?e[jt>>2]|0:(o&255)>>>1,(E|0)!=(0-a|0)){if(!E){if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}w=S[c0>>0]|0}else E=N[w>>0]|0,w=o;if((E&255)<<24>>24!=(S[(w&1?e[Gt>>2]|0:s0)>>0]|0))break i;if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[w>>2]=o+1;S[d>>0]=1,G=S[c0>>0]|0,_=(G&1?e[jt>>2]|0:(G&255)>>>1)>>>0>1?c0:_;break i}if(l=e[t>>2]|0,F=e[l+12>>2]|0,o=e[l+16>>2]|0,E=(F|0)==(o|0),!a){if(E){if(m=0,E=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=24;break t}w=S[a0>>0]|0}else E=N[F>>0]|0;if((E&255)<<24>>24!=(S[(w&1?e[i0>>2]|0:zt)>>0]|0)){S[d>>0]=1;break i}if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[w>>2]=o+1;G=S[a0>>0]|0,_=(G&1?e[it>>2]|0:(G&255)>>>1)>>>0>1?a0:_;break i}if(E){if(m=0,E=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=24;break t}o=e[t>>2]|0,w=S[a0>>0]|0,l=o,F=e[o+12>>2]|0,o=e[o+16>>2]|0}else E=N[F>>0]|0;if(a=l+12|0,o=(F|0)==(o|0),(E&255)<<24>>24==(S[(w&1?e[i0>>2]|0:zt)>>0]|0)){if(o){if(m=0,ge(e[(e[l>>2]|0)+40>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[a>>2]=F+1;G=S[a0>>0]|0,_=(G&1?e[it>>2]|0:(G&255)>>>1)>>>0>1?a0:_;break i}if(o){if(m=0,E=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=24;break t}}else E=N[F>>0]|0;if((E&255)<<24>>24!=(S[(S[c0>>0]&1?e[Gt>>2]|0:s0)>>0]|0)){Oe=104;break t}if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[w>>2]=o+1;S[d>>0]=1,G=S[c0>>0]|0,_=(G&1?e[jt>>2]|0:(G&255)>>>1)>>>0>1?c0:_}break}case 2:{if(!($>>>0<2|(_|0)!=0)&&!(P|($|0)==2&(S[Ee>>0]|0)!=0)){_=0;break i}H=S[D0>>0]|0,E=(H&1)==0,K=e[L>>2]|0,o=E?J:K,R=o;n:do if($|0&&(N[T0+($+-1)>>0]|0)<2){F=E?(H&255)>>>1:e[ne>>2]|0,a=o+F|0,l=e[Te>>2]|0;r:do if(!F)w=R;else{F=o,w=R;do{if(E=S[F>>0]|0,E<<24>>24<=-1||!(k[l+(E<<24>>24<<1)>>1]&8192))break r;F=F+1|0,w=F}while((F|0)!=(a|0))}while(!1);if(a=w-R|0,l=S[h0>>0]|0,E=(l&1)==0,l=E?(l&255)>>>1:e[ae>>2]|0,l>>>0>=a>>>0){if(E=E?ce:e[re>>2]|0,F=E+l|0,(w|0)!=(R|0))for(E=E+(l-a)|0;;){if((S[E>>0]|0)!=(S[o>>0]|0)){w=R;break n}if(E=E+1|0,(E|0)==(F|0))break;o=o+1|0}}else w=R}else w=R;while(!1);E=(H&1)==0,E=(E?J:K)+(E?(H&255)>>>1:e[ne>>2]|0)|0;n:do if((w|0)!=(E|0))for(l=G,a=G,E=w;;){w=e[t>>2]|0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=21;break t}if((w|0)==-1){e[t>>2]=0,w=0;break}else{w=e[t>>2]|0;break}}}else w=0;while(!1);o=(w|0)==0;do if(a){if((e[a+12>>2]|0)!=(e[a+16>>2]|0))if(o){w=l,F=a;break}else break n;if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,G=m,m=0,G&1){Oe=21;break t}if((w|0)!=-1)if(o^(l|0)==0){w=l,F=l;break}else break n;else{e[r>>2]=0,w=0,Oe=131;break}}else w=l,Oe=131;while(!1);if((Oe|0)==131){if(Oe=0,o)break n;F=0}if(o=e[t>>2]|0,a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=21;break t}}else o=N[a>>0]|0;if((o&255)<<24>>24!=(S[E>>0]|0))break n;if(o=e[t>>2]|0,a=o+12|0,l=e[a>>2]|0,(l|0)==(e[o+16>>2]|0)){if(m=0,ge(e[(e[o>>2]|0)+40>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=21;break t}}else e[a>>2]=l+1;if(E=E+1|0,o=S[D0>>0]|0,G=(o&1)==0,o=(G?J:e[L>>2]|0)+(G?(o&255)>>>1:e[ne>>2]|0)|0,(E|0)==(o|0)){E=o;break}else l=w,a=F}while(!1);if(P&&(G=S[D0>>0]|0,K=(G&1)==0,(E|0)!=((K?J:e[L>>2]|0)+(K?(G&255)>>>1:e[ne>>2]|0)|0))){Oe=143;break t}break}case 4:{R=S[g0>>0]|0,w=G,l=G,E=0;n:for(;;){o=e[t>>2]|0;do if(o){if((e[o+12>>2]|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=23;break t}if((o|0)==-1){e[t>>2]=0,o=0;break}else{o=e[t>>2]|0;break}}}else o=0;while(!1);a=(o|0)==0;do if(l){if((e[l+12>>2]|0)!=(e[l+16>>2]|0))if(a){F=w;break}else{a=w;break n}if(m=0,o=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=23;break t}if((o|0)!=-1)if(a^(w|0)==0){F=w,l=w;break}else{a=w;break n}else{e[r>>2]=0,w=0,Oe=156;break}}else Oe=156;while(!1);if((Oe|0)==156)if(Oe=0,a){a=w;break}else F=w,l=0;if(w=e[t>>2]|0,o=e[w+12>>2]|0,(o|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=23;break t}}else w=N[o>>0]|0;if(o=w&255,o<<24>>24>-1&&k[(e[Te>>2]|0)+(w<<24>>24<<1)>>1]&2048){if(w=e[D>>2]|0,(w|0)==(e[gt>>2]|0)){if(m=0,ve(12,C|0,D|0,gt|0),G=m,m=0,G&1){Oe=23;break t}w=e[D>>2]|0}e[D>>2]=w+1,S[w>>0]=o,E=E+1|0}else{if(G=S[qt>>0]|0,!(o<<24>>24==R<<24>>24&(E|0?((G&1?e[ke>>2]|0:(G&255)>>>1)|0)!=0:0))){a=F;break}if((U|0)==(e[At>>2]|0)){if(m=0,ve(13,N0|0,y0|0,At|0),G=m,m=0,G&1){Oe=23;break t}U=e[y0>>2]|0}G=U+4|0,e[y0>>2]=G,e[U>>2]=E,U=G,E=0}if(w=e[t>>2]|0,o=w+12|0,a=e[o>>2]|0,(a|0)==(e[w+16>>2]|0))if(m=0,ge(e[(e[w>>2]|0)+40>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=23;break t}else{w=F;continue}else{e[o>>2]=a+1,w=F;continue}}if(E|0&&(e[N0>>2]|0)!=(U|0)){if((U|0)==(e[At>>2]|0)){if(m=0,ve(13,N0|0,y0|0,At|0),G=m,m=0,G&1){Oe=24;break t}U=e[y0>>2]|0}G=U+4|0,e[y0>>2]=G,e[U>>2]=E,U=G}if(F=e[pt>>2]|0,(F|0)>0){E=e[t>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}if((E|0)==-1){e[t>>2]=0,E=0;break}else{E=e[t>>2]|0;break}}}else E=0;while(!1);E=(E|0)==0;do if(a){if((e[a+12>>2]|0)==(e[a+16>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,G=m,m=0,G&1){Oe=24;break t}if((w|0)==-1){e[r>>2]=0,Oe=193;break}}if(!E){Oe=198;break t}}else Oe=193;while(!1);if((Oe|0)==193)if(Oe=0,E){Oe=198;break t}else a=0;if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else E=N[w>>0]|0;if((E&255)<<24>>24!=(S[Kt>>0]|0)){Oe=198;break t}if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[w>>2]=o+1;if((F|0)>0)for(l=a,o=a,R=F;;){E=e[t>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=22;break t}if((E|0)==-1){e[t>>2]=0,E=0;break}else{E=e[t>>2]|0;break}}}else E=0;while(!1);w=(E|0)==0;do if(o){if((e[o+12>>2]|0)!=(e[o+16>>2]|0))if(w){E=l,F=o;break}else{Oe=222;break t}if(m=0,E=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=22;break t}if((E|0)!=-1)if(w^(l|0)==0){E=l,F=l;break}else{Oe=222;break t}else{e[r>>2]=0,E=0,Oe=215;break}}else E=l,Oe=215;while(!1);if((Oe|0)==215)if(Oe=0,w){Oe=222;break t}else F=0;if(w=e[t>>2]|0,o=e[w+12>>2]|0,(o|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=22;break t}}else w=N[o>>0]|0;if((w&255)<<24>>24<=-1){Oe=222;break t}if(!(k[(e[Te>>2]|0)+(w<<24>>24<<1)>>1]&2048)){Oe=222;break t}if((e[D>>2]|0)==(e[gt>>2]|0)&&(m=0,ve(12,C|0,D|0,gt|0),G=m,m=0,G&1)){Oe=22;break t}if(w=e[t>>2]|0,o=e[w+12>>2]|0,(o|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=22;break t}}else w=N[o>>0]|0;if(o=e[D>>2]|0,e[D>>2]=o+1,S[o>>0]=w,w=R,R=R+-1|0,e[pt>>2]=R,o=e[t>>2]|0,a=o+12|0,l=e[a>>2]|0,(l|0)==(e[o+16>>2]|0)){if(m=0,ge(e[(e[o>>2]|0)+40>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=22;break t}}else e[a>>2]=l+1;if((w|0)<=1)break;l=E,o=F}}if((e[D>>2]|0)==(e[C>>2]|0)){Oe=233;break t}break}default:}while(!1);i:do if((Oe|0)==42)for(;;){Oe=0,w=e[t>>2]|0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=20;break t}if((w|0)==-1){e[t>>2]=0,w=0;break}else{w=e[t>>2]|0;break}}}else w=0;while(!1);o=(w|0)==0;do if(a){if((e[a+12>>2]|0)!=(e[a+16>>2]|0))if(o){l=E;break}else break i;if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,G=m,m=0,G&1){Oe=20;break t}if((w|0)!=-1)if(o^(E|0)==0){l=E,a=E;break}else break i;else{e[r>>2]=0,E=0,Oe=54;break}}else Oe=54;while(!1);if((Oe|0)==54){if(Oe=0,o)break i;l=E,a=0}if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=20;break t}}else E=N[w>>0]|0;if((E&255)<<24>>24<=-1||!(k[(e[Te>>2]|0)+(E<<24>>24<<1)>>1]&8192))break i;if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,Oe=m,m=0,Oe&1){Oe=20;break t}}else e[w>>2]=o+1,E=N[o>>0]|0;if(m=0,Ae(67,h0|0,E&255|0),Oe=m,m=0,Oe&1){Oe=20;break t}else E=l,Oe=42}while(!1);if($=$+1|0,$>>>0>=4){Oe=235;break}}t:switch(Oe|0){case 20:{w=j()|0;break e}case 21:{w=j()|0;break e}case 22:{w=j()|0;break e}case 23:{w=j()|0;break e}case 24:{w=j()|0;break e}case 40:{e[h>>2]=e[h>>2]|4,w=0;break}case 104:{e[h>>2]=e[h>>2]|4,w=0;break}case 143:{e[h>>2]=e[h>>2]|4,w=0;break}case 198:{e[h>>2]=e[h>>2]|4,w=0;break}case 222:{e[h>>2]=e[h>>2]|4,w=0;break}case 233:{e[h>>2]=e[h>>2]|4,w=0;break}case 235:{i:do if(_){l=_+1|0,F=_+8|0,R=_+4|0,o=1;n:for(;;){if(E=S[_>>0]|0,E&1?E=e[R>>2]|0:E=(E&255)>>>1,o>>>0>=E>>>0)break i;E=e[t>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){Oe=19;break n}if((E|0)==-1){e[t>>2]=0,E=0;break}else{E=e[t>>2]|0;break}}}else E=0;while(!1);w=(E|0)==0,E=e[r>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){Oe=19;break n}if((E|0)==-1){e[r>>2]=0,Oe=253;break}}if(!w){Oe=260;break n}}else Oe=253;while(!1);if((Oe|0)==253&&(Oe=0,w)){Oe=260;break}if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){Oe=19;break}}else E=N[w>>0]|0;if(S[_>>0]&1?w=e[F>>2]|0:w=l,(E&255)<<24>>24!=(S[w+o>>0]|0)){Oe=260;break}if(E=o+1|0,w=e[t>>2]|0,o=w+12|0,a=e[o>>2]|0,(a|0)==(e[w+16>>2]|0))if(m=0,ge(e[(e[w>>2]|0)+40>>2]|0,w|0)|0,D=m,m=0,D&1){Oe=19;break}else{o=E;continue}else{e[o>>2]=a+1,o=E;continue}}if((Oe|0)==19){w=j()|0;break e}else if((Oe|0)==260){e[h>>2]=e[h>>2]|4,w=0;break t}}while(!1);E=e[N0>>2]|0,(E|0)!=(U|0)&&(e[yt>>2]=0,V0(qt,E,U,yt),(e[yt>>2]|0)!=0)?(e[h>>2]=e[h>>2]|4,w=0):w=1;break}}return de(h0),de(c0),de(a0),de(D0),de(qt),E=e[N0>>2]|0,e[N0>>2]=0,E|0&&(m=0,ue(e[Ti>>2]|0,E|0),N0=m,m=0,N0&1)&&(N0=j(0)|0,$t(N0)),b=A0,w|0}while(!1);return de(h0),de(c0),de(a0),de(D0),de(qt),E=e[N0>>2]|0,e[N0>>2]=0,E|0&&(m=0,ue(e[Ti>>2]|0,E|0),N0=m,m=0,N0&1)&&(N0=j(0)|0,$t(N0)),le(w|0),0}function fn(t){t=t|0;var r=0;r=Ct(8)|0,m=0,Ae(90,r|0,t|0),t=m,m=0,t&1?(t=j()|0,It(r|0),le(t|0)):Qt(r|0,616,80)}function nh(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;if($=b,b=b+144|0,w=$+24|0,t=$+32|0,P=$+16|0,U=$+8|0,F=$+4|0,R=$+28|0,C=$,e[P>>2]=t,ne=P+4|0,e[ne>>2]=189,D=t+100|0,m=0,G=ge(68,l|0)|0,E=m,m=0,E&1)w=j()|0,e[P>>2]=0,J=36;else{e[F>>2]=G,m=0,E=Ne(37,F|0,44220)|0,t=m,m=0;e:do if(!(t&1)&&(S[R>>0]=0,H=e[o>>2]|0,e[C>>2]=H,_=e[l+4>>2]|0,K=H,m=0,e[w>>2]=e[C>>2],_=Ut(1,r|0,w|0,a|0,F|0,_|0,h|0,R|0,E|0,P|0,U|0,D|0)|0,l=m,m=0,!(l&1))){if(_){if(S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),S[R>>0]|0&&(m=0,t=Ne(e[(e[E>>2]|0)+28>>2]|0,E|0,45)|0,l=m,m=0,l&1||(m=0,Ae(67,d|0,t|0),l=m,m=0,l&1))||(m=0,C=Ne(e[(e[E>>2]|0)+28>>2]|0,E|0,48)|0,l=m,m=0,l&1))break;t=e[P>>2]|0,D=e[U>>2]|0,w=D+-1|0;t:do if(t>>>0>>0)do{if((S[t>>0]|0)!=C<<24>>24)break t;t=t+1|0}while(t>>>0>>0);while(!1);if(m=0,Ve(32,d|0,t|0,D|0)|0,d=m,m=0,d&1)break}t=e[r>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1)break e;if((t|0)==-1){e[r>>2]=0,t=0;break}else{t=e[r>>2]|0;break}}}else t=0;while(!1);w=(t|0)==0;do if(H){if((e[K+12>>2]|0)==(e[K+16>>2]|0)){if(m=0,t=ge(e[(e[H>>2]|0)+36>>2]|0,K|0)|0,K=m,m=0,K&1)break e;if((t|0)==-1){e[o>>2]=0,J=29;break}}w||(J=30)}else J=29;while(!1);return(J|0)==29&&w&&(J=30),(J|0)==30&&(e[h>>2]=e[h>>2]|2),w=e[r>>2]|0,Bt(G)|0,t=e[P>>2]|0,e[P>>2]=0,t|0&&(m=0,ue(e[ne>>2]|0,t|0),ne=m,m=0,ne&1)&&(ne=j(0)|0,$t(ne)),b=$,w|0}while(!1);w=j()|0,Bt(G)|0,t=e[P>>2]|0,e[P>>2]=0,t?J=36:L=w}return(J|0)==36&&(m=0,ue(e[ne>>2]|0,t|0),ne=m,m=0,ne&1?(ne=j(0)|0,$t(ne)):L=w),le(L|0),0}function rh(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0;J=b,b=b+112|0,E=J+100|0,F=J+88|0,R=J+76|0,_=J+64|0,U=J+52|0,H=J+48|0,K=J+36|0,G=J+24|0,$=J+12|0,P=J;do if(t)if(t=O0(r,43828)|0,t0[e[(e[t>>2]|0)+44>>2]&127](E,t),P=e[E>>2]|0,S[o>>0]=P,S[o+1>>0]=P>>8,S[o+2>>0]=P>>16,S[o+3>>0]=P>>24,t0[e[(e[t>>2]|0)+32>>2]&127](F,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[C>>2]=e[F>>2],e[C+4>>2]=e[F+4>>2],e[C+8>>2]=e[F+8>>2],e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,de(F),t0[e[(e[t>>2]|0)+28>>2]&127](R,t),S[w>>0]&1?(S[e[w+8>>2]>>0]=0,e[w+4>>2]=0):(S[w+1>>0]=0,S[w>>0]=0),m=0,Ae(91,w|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[w>>2]=e[R>>2],e[w+4>>2]=e[R+4>>2],e[w+8>>2]=e[R+8>>2],e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,de(R),w=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,S[a>>0]=w,w=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,S[l>>0]=w,t0[e[(e[t>>2]|0)+20>>2]&127](_,t),S[h>>0]&1?(S[e[h+8>>2]>>0]=0,e[h+4>>2]=0):(S[h+1>>0]=0,S[h>>0]=0),m=0,Ae(91,h|0,0),l=m,m=0,l&1&&(l=j(0)|0,$t(l)),e[h>>2]=e[_>>2],e[h+4>>2]=e[_+4>>2],e[h+8>>2]=e[_+8>>2],e[_>>2]=0,e[_+4>>2]=0,e[_+8>>2]=0,de(_),t0[e[(e[t>>2]|0)+24>>2]&127](U,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),l=m,m=0,l&1)l=j(0)|0,$t(l);else{e[d>>2]=e[U>>2],e[d+4>>2]=e[U+4>>2],e[d+8>>2]=e[U+8>>2],e[U>>2]=0,e[U+4>>2]=0,e[U+8>>2]=0,de(U),L=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}else if(t=O0(r,43764)|0,t0[e[(e[t>>2]|0)+44>>2]&127](H,t),H=e[H>>2]|0,S[o>>0]=H,S[o+1>>0]=H>>8,S[o+2>>0]=H>>16,S[o+3>>0]=H>>24,t0[e[(e[t>>2]|0)+32>>2]&127](K,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[C>>2]=e[K>>2],e[C+4>>2]=e[K+4>>2],e[C+8>>2]=e[K+8>>2],e[K>>2]=0,e[K+4>>2]=0,e[K+8>>2]=0,de(K),t0[e[(e[t>>2]|0)+28>>2]&127](G,t),S[w>>0]&1?(S[e[w+8>>2]>>0]=0,e[w+4>>2]=0):(S[w+1>>0]=0,S[w>>0]=0),m=0,Ae(91,w|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[w>>2]=e[G>>2],e[w+4>>2]=e[G+4>>2],e[w+8>>2]=e[G+8>>2],e[G>>2]=0,e[G+4>>2]=0,e[G+8>>2]=0,de(G),w=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,S[a>>0]=w,w=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,S[l>>0]=w,t0[e[(e[t>>2]|0)+20>>2]&127]($,t),S[h>>0]&1?(S[e[h+8>>2]>>0]=0,e[h+4>>2]=0):(S[h+1>>0]=0,S[h>>0]=0),m=0,Ae(91,h|0,0),l=m,m=0,l&1&&(l=j(0)|0,$t(l)),e[h>>2]=e[$>>2],e[h+4>>2]=e[$+4>>2],e[h+8>>2]=e[$+8>>2],e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,de($),t0[e[(e[t>>2]|0)+24>>2]&127](P,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),l=m,m=0,l&1)l=j(0)|0,$t(l);else{e[d>>2]=e[P>>2],e[d+4>>2]=e[P+4>>2],e[d+8>>2]=e[P+8>>2],e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,de(P),L=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}while(!1);e[D>>2]=L,b=J}function V0(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;l=S[t>>0]|0,d=t+4|0,h=e[d>>2]|0;e:do if((l&1?h:(l&255)>>>1)|0){if((r|0)!=(o|0)){if(l=o+-4|0,l>>>0>r>>>0){h=r;do w=e[h>>2]|0,e[h>>2]=e[l>>2],e[l>>2]=w,h=h+4|0,l=l+-4|0;while(h>>>0>>0)}l=S[t>>0]|0,h=e[d>>2]|0}w=(l&1)==0,d=w?t+1|0:e[t+8>>2]|0,o=o+-4|0,t=d+(w?(l&255)>>>1:h)|0,h=S[d>>0]|0,l=h<<24>>24<1|h<<24>>24==127;t:do if(o>>>0>r>>>0){for(;!(!l&&(h<<24>>24|0)!=(e[r>>2]|0));)if(d=(t-d|0)>1?d+1|0:d,r=r+4|0,h=S[d>>0]|0,l=h<<24>>24<1|h<<24>>24==127,r>>>0>=o>>>0)break t;e[a>>2]=4;break e}while(!1);!l&&((e[o>>2]|0)+-1|0)>>>0>=h<<24>>24>>>0&&(e[a>>2]=4)}while(!1)}function sh(t){t=t|0}function oh(t){t=t|0,he(t)}function ah(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;if(ae=b,b=b+576|0,P=ae+424|0,ne=ae,t=ae+24|0,ce=ae+16|0,L=ae+12|0,re=ae+8|0,F=ae+464|0,C=ae+4|0,J=ae+468|0,e[ce>>2]=t,ke=ce+4|0,e[ke>>2]=189,D=t+400|0,m=0,w=ge(68,l|0)|0,$=m,m=0,$&1)C=j()|0,e[ce>>2]=0,w=189,Te=47;else{e[re>>2]=w,m=0,t=Ne(37,re|0,44212)|0,$=m,m=0;e:do if(!($&1)&&(S[F>>0]=0,e[C>>2]=e[o>>2],E=e[l+4>>2]|0,m=0,e[P>>2]=e[C>>2],E=Ut(2,r|0,P|0,a|0,re|0,E|0,h|0,F|0,t|0,ce|0,L|0,D|0)|0,$=m,m=0,!($&1))){t:do if(E){if(m=0,Pe(e[(e[t>>2]|0)+48>>2]|0,t|0,59007,59017,P|0)|0,$=m,m=0,$&1){Te=10;break e}C=e[L>>2]|0,D=e[ce>>2]|0,t=C-D|0,(t|0)>392?(t=E0((t>>2)+2|0)|0,w=t,t?Te=13:(m=0,bt(6),$=m,m=0,$&1||(t=0,Te=13))):(w=0,t=J,Te=13);do if((Te|0)==13){if(S[F>>0]|0&&(S[t>>0]=45,t=t+1|0),G=P+40|0,$=P,D>>>0>>0){E=P+4|0,a=E+4|0,l=a+4|0,F=l+4|0,R=F+4|0,_=R+4|0,U=_+4|0,H=U+4|0,K=H+4|0;do{C=e[D>>2]|0;do if((e[P>>2]|0)!=(C|0))if((e[E>>2]|0)!=(C|0))if((e[a>>2]|0)!=(C|0))if((e[l>>2]|0)!=(C|0))if((e[F>>2]|0)==(C|0))C=F;else{if((e[R>>2]|0)==(C|0)){C=R;break}if((e[_>>2]|0)==(C|0)){C=_;break}if((e[U>>2]|0)==(C|0)){C=U;break}if((e[H>>2]|0)==(C|0)){C=H;break}C=(e[K>>2]|0)==(C|0)?K:G}else C=l;else C=a;else C=E;else C=P;while(!1);S[t>>0]=S[59007+(C-$>>2)>>0]|0,D=D+4|0,t=t+1|0}while(D>>>0<(e[L>>2]|0)>>>0)}if(S[t>>0]=0,e[ne>>2]=d,(_o(J,58987,ne)|0)!=1&&(m=0,ue(190,58991),d=m,m=0,d&1))break;w&&n0(w);break t}while(!1);if(t=j()|0,!w){C=t,w=ce;break e}n0(w),C=t,w=ce;break e}while(!1);t=e[r>>2]|0;do if(t){if(w=e[t+12>>2]|0,(w|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1){Te=10;break e}}else t=e[w>>2]|0;if((t|0)==-1){e[r>>2]=0,C=1;break}else{C=(e[r>>2]|0)==0;break}}else C=1;while(!1);t=e[o>>2]|0;do if(t){if(w=e[t+12>>2]|0,(w|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1){Te=10;break e}}else t=e[w>>2]|0;if((t|0)!=-1){if(C)break;Te=40;break}else{e[o>>2]=0,Te=38;break}}else Te=38;while(!1);return(Te|0)==38&&C&&(Te=40),(Te|0)==40&&(e[h>>2]=e[h>>2]|2),w=e[r>>2]|0,Bt(e[re>>2]|0)|0,t=e[ce>>2]|0,e[ce>>2]=0,t|0&&(m=0,ue(e[ke>>2]|0,t|0),Te=m,m=0,Te&1)&&(Te=j(0)|0,$t(Te)),b=ae,w|0}else Te=10;while(!1);(Te|0)==10&&(C=j()|0,w=ce),Bt(e[re>>2]|0)|0,t=e[w>>2]|0,e[w>>2]=0,t?(w=e[ke>>2]|0,Te=47):Ee=C}return(Te|0)==47&&(m=0,ue(w|0,t|0),Te=m,m=0,Te&1?(Te=j(0)|0,$t(Te)):Ee=C),le(Ee|0),0}function lh(t,r,o,a,l,h,d,w,C,D,E){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0;var F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0,c0=0,a0=0,h0=0;c0=b,b=b+512|0,Gt=c0+96|0,F=c0+104|0,h0=c0+88|0,gt=c0+80|0,zt=c0+76|0,Kt=c0+504|0,s0=c0+72|0,pt=c0+68|0,T0=c0+56|0,qt=c0+44|0,Oe=c0+32|0,g0=c0+20|0,yt=c0+8|0,i0=c0+4|0,y0=c0,e[Gt>>2]=E,e[h0>>2]=F,a0=h0+4|0,e[a0>>2]=189,e[gt>>2]=F,e[zt>>2]=F+400,e[T0>>2]=0,e[T0+4>>2]=0,e[T0+8>>2]=0,e[qt>>2]=0,e[qt+4>>2]=0,e[qt+8>>2]=0,e[Oe>>2]=0,e[Oe+4>>2]=0,e[Oe+8>>2]=0,e[g0>>2]=0,e[g0+4>>2]=0,e[g0+8>>2]=0,e[yt>>2]=0,e[yt+4>>2]=0,e[yt+8>>2]=0,m=0,I0(2,o|0,a|0,Kt|0,s0|0,pt|0,T0|0,qt|0,Oe|0,g0|0,i0|0),jt=m,m=0;e:do if(jt&1)o=j()|0;else{e[D>>2]=e[C>>2],ke=Oe+4|0,Te=g0+4|0,it=g0+8|0,jt=Oe+8|0,L=(l&512|0)!=0,J=qt+8|0,ne=qt+4|0,ae=yt+4|0,re=yt+8|0,ce=Kt+3|0,Ee=T0+4|0,P=0,_=0;t:for(;;){E=e[t>>2]|0;do if(E){if(o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}}else E=e[o>>2]|0;if((E|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);o=e[r>>2]|0;do if(o){if(E=e[o+12>>2]|0,(E|0)==(e[o+16>>2]|0)){if(m=0,E=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=26;break t}}else E=e[E>>2]|0;if((E|0)!=-1)if(a){$=o;break}else{U=F,At=244;break t}else{e[r>>2]=0,At=16;break}}else At=16;while(!1);if((At|0)==16)if(At=0,a){U=F,At=244;break}else $=0;i:do switch(S[Kt+P>>0]|0){case 1:{if((P|0)!=3){if(E=e[t>>2]|0,o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,At=m,m=0,At&1){At=26;break t}}else E=e[o>>2]|0;if(m=0,E=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,8192,E|0)|0,At=m,m=0,At&1){At=26;break t}if(!E){At=42;break t}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,At=m,m=0,At&1){At=26;break t}}else e[o>>2]=a+4,E=e[a>>2]|0;if(m=0,Ae(92,yt|0,E|0),At=m,m=0,At&1){At=26;break t}else E=$,l=$,At=44}else E=F;break}case 0:{(P|0)==3?E=F:(E=$,l=$,At=44);break}case 3:{if(o=S[Oe>>0]|0,E=o&1?e[ke>>2]|0:(o&255)>>>1,a=S[g0>>0]|0,l=a&1?e[Te>>2]|0:(a&255)>>>1,(E|0)==(0-l|0))E=F;else{if(!E){if(E=e[t>>2]|0,o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}o=S[g0>>0]|0}else E=e[o>>2]|0,o=a;if((E|0)!=(e[(o&1?e[it>>2]|0:Te)>>2]|0)){E=F;break i}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}}else e[o>>2]=a+4;S[d>>0]=1,$=S[g0>>0]|0,E=F,_=($&1?e[Te>>2]|0:($&255)>>>1)>>>0>1?g0:_;break i}if(R=e[t>>2]|0,U=e[R+12>>2]|0,a=e[R+16>>2]|0,E=(U|0)==(a|0),!l){if(E){if(m=0,E=ge(e[(e[R>>2]|0)+36>>2]|0,R|0)|0,$=m,m=0,$&1){At=26;break t}o=S[Oe>>0]|0}else E=e[U>>2]|0;if((E|0)!=(e[(o&1?e[jt>>2]|0:ke)>>2]|0)){S[d>>0]=1,E=F;break i}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}}else e[o>>2]=a+4;$=S[Oe>>0]|0,E=F,_=($&1?e[ke>>2]|0:($&255)>>>1)>>>0>1?Oe:_;break i}if(E){if(m=0,E=ge(e[(e[R>>2]|0)+36>>2]|0,R|0)|0,$=m,m=0,$&1){At=26;break t}a=e[t>>2]|0,o=S[Oe>>0]|0,R=a,U=e[a+12>>2]|0,a=e[a+16>>2]|0}else E=e[U>>2]|0;if(l=R+12|0,a=(U|0)==(a|0),(E|0)==(e[(o&1?e[jt>>2]|0:ke)>>2]|0)){if(a){if(m=0,ge(e[(e[R>>2]|0)+40>>2]|0,R|0)|0,$=m,m=0,$&1){At=26;break t}}else e[l>>2]=U+4;$=S[Oe>>0]|0,E=F,_=($&1?e[ke>>2]|0:($&255)>>>1)>>>0>1?Oe:_;break i}if(a){if(m=0,E=ge(e[(e[R>>2]|0)+36>>2]|0,R|0)|0,$=m,m=0,$&1){At=26;break t}}else E=e[U>>2]|0;if((E|0)!=(e[(S[g0>>0]&1?e[it>>2]|0:Te)>>2]|0)){At=107;break t}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}}else e[o>>2]=a+4;S[d>>0]=1,$=S[g0>>0]|0,E=F,_=($&1?e[Te>>2]|0:($&255)>>>1)>>>0>1?g0:_}break}case 2:{if(!(P>>>0<2|(_|0)!=0)&&!(L|(P|0)==2&(S[ce>>0]|0)!=0)){E=F,_=0;break i}l=S[qt>>0]|0,a=e[J>>2]|0,o=l&1?a:ne,E=o;n:do if(P|0&&(N[Kt+(P+-1)>>0]|0)<2){G=(l&1)==0;r:do if((o|0)!=((G?ne:a)+((G?(l&255)>>>1:e[ne>>2]|0)<<2)|0)){for(l=o;;){if(m=0,o=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,8192,e[l>>2]|0)|0,G=m,m=0,G&1){At=23;break t}if(!o)break;if(l=l+4|0,E=l,o=S[qt>>0]|0,a=e[J>>2]|0,G=(o&1)==0,(l|0)==((G?ne:a)+((G?(o&255)>>>1:e[ne>>2]|0)<<2)|0)){l=o;break r}}l=S[qt>>0]|0,a=e[J>>2]|0}while(!1);if(U=l&1?a:ne,o=U,H=E-o>>2,K=S[yt>>0]|0,R=(K&1)==0,K=R?(K&255)>>>1:e[ae>>2]|0,K>>>0>=H>>>0)if(R=R?ae:e[re>>2]|0,G=R+(K<<2)|0,!H)o=E;else for(R=R+(K-H<<2)|0;;){if((e[R>>2]|0)!=(e[U>>2]|0))break n;if(R=R+4|0,(R|0)==(G|0)){o=E;break}else U=U+4|0}}else o=E;while(!1);E=(l&1)==0,E=(E?ne:a)+((E?(l&255)>>>1:e[ne>>2]|0)<<2)|0;n:do if((o|0)!=(E|0))for(R=$,l=$,E=o;;){o=e[t>>2]|0;do if(o){if(a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=22;break t}}else o=e[a>>2]|0;if((o|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);do if(l){if(o=e[l+12>>2]|0,(o|0)==(e[l+16>>2]|0)){if(m=0,o=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,$=m,m=0,$&1){At=22;break t}}else o=e[o>>2]|0;if((o|0)!=-1)if(a^(R|0)==0){o=R,U=R;break}else break n;else{e[r>>2]=0,o=0,At=136;break}}else o=R,At=136;while(!1);if((At|0)==136){if(At=0,a)break n;U=0}if(a=e[t>>2]|0,l=e[a+12>>2]|0,(l|0)==(e[a+16>>2]|0)){if(m=0,a=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,$=m,m=0,$&1){At=22;break t}}else a=e[l>>2]|0;if((a|0)!=(e[E>>2]|0))break n;if(a=e[t>>2]|0,l=a+12|0,R=e[l>>2]|0,(R|0)==(e[a+16>>2]|0)){if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,$=m,m=0,$&1){At=22;break t}}else e[l>>2]=R+4;if(E=E+4|0,a=S[qt>>0]|0,$=(a&1)==0,a=($?ne:e[J>>2]|0)+(($?(a&255)>>>1:e[ne>>2]|0)<<2)|0,(E|0)==(a|0)){E=a;break}else R=o,l=U}while(!1);if(L&&($=S[qt>>0]|0,G=($&1)==0,(E|0)!=((G?ne:e[J>>2]|0)+((G?($&255)>>>1:e[ne>>2]|0)<<2)|0))){At=148;break t}else E=F;break}case 4:{K=e[pt>>2]|0,H=$,R=$,E=F,o=0;n:for(;;){a=e[t>>2]|0;do if(a){if(l=e[a+12>>2]|0,(l|0)==(e[a+16>>2]|0)){if(m=0,a=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,$=m,m=0,$&1){At=25;break t}}else a=e[l>>2]|0;if((a|0)==-1){e[t>>2]=0,l=1;break}else{l=(e[t>>2]|0)==0;break}}else l=1;while(!1);do if(R){if(a=e[R+12>>2]|0,(a|0)==(e[R+16>>2]|0)){if(m=0,a=ge(e[(e[R>>2]|0)+36>>2]|0,R|0)|0,$=m,m=0,$&1){At=25;break t}}else a=e[a>>2]|0;if((a|0)!=-1)if(l^(H|0)==0){a=H,U=H;break}else{F=H;break n}else{e[r>>2]=0,a=0,At=162;break}}else a=H,At=162;while(!1);if((At|0)==162)if(At=0,l){F=a;break}else U=0;if(l=e[t>>2]|0,F=e[l+12>>2]|0,(F|0)==(e[l+16>>2]|0)){if(m=0,l=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,$=m,m=0,$&1){At=25;break t}}else l=e[F>>2]|0;if(m=0,F=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,2048,l|0)|0,$=m,m=0,$&1){At=25;break t}if(F){if(F=e[D>>2]|0,(F|0)==(e[Gt>>2]|0)){if(m=0,ve(14,C|0,D|0,Gt|0),$=m,m=0,$&1){At=25;break t}F=e[D>>2]|0}e[D>>2]=F+4,e[F>>2]=l,o=o+1|0}else{if($=S[T0>>0]|0,!((l|0)==(K|0)&(o|0?(($&1?e[Ee>>2]|0:($&255)>>>1)|0)!=0:0))){F=a;break}if((E|0)==(e[zt>>2]|0)){if(m=0,ve(13,h0|0,gt|0,zt|0),$=m,m=0,$&1){At=25;break t}E=e[gt>>2]|0}$=E+4|0,e[gt>>2]=$,e[E>>2]=o,E=$,o=0}if(l=e[t>>2]|0,F=l+12|0,R=e[F>>2]|0,(R|0)==(e[l+16>>2]|0))if(m=0,ge(e[(e[l>>2]|0)+40>>2]|0,l|0)|0,$=m,m=0,$&1){At=25;break t}else{H=a,R=U;continue}else{e[F>>2]=R+4,H=a,R=U;continue}}if(o|0&&(e[h0>>2]|0)!=(E|0)){if((E|0)==(e[zt>>2]|0)){if(m=0,ve(13,h0|0,gt|0,zt|0),$=m,m=0,$&1){At=26;break t}E=e[gt>>2]|0}$=E+4|0,e[gt>>2]=$,e[E>>2]=o,E=$}if(U=e[i0>>2]|0,(U|0)>0){o=e[t>>2]|0;do if(o){if(a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=26;break t}}else o=e[a>>2]|0;if((o|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);do if(F){if(o=e[F+12>>2]|0,(o|0)==(e[F+16>>2]|0)){if(m=0,o=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,$=m,m=0,$&1){At=26;break t}}else o=e[o>>2]|0;if((o|0)!=-1){if(a)break;At=206;break t}else{e[r>>2]=0,At=200;break}}else At=200;while(!1);if((At|0)==200)if(At=0,a){At=206;break t}else F=0;if(o=e[t>>2]|0,a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=26;break t}}else o=e[a>>2]|0;if((o|0)!=(e[s0>>2]|0)){At=206;break t}if(o=e[t>>2]|0,a=o+12|0,l=e[a>>2]|0,(l|0)==(e[o+16>>2]|0)){if(m=0,ge(e[(e[o>>2]|0)+40>>2]|0,o|0)|0,$=m,m=0,$&1){At=26;break t}}else e[a>>2]=l+4;if((U|0)>0)for(R=F,l=F,H=U;;){o=e[t>>2]|0;do if(o){if(a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=24;break t}}else o=e[a>>2]|0;if((o|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);do if(l){if(o=e[l+12>>2]|0,(o|0)==(e[l+16>>2]|0)){if(m=0,o=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,$=m,m=0,$&1){At=24;break t}}else o=e[o>>2]|0;if((o|0)!=-1)if(a^(R|0)==0){o=R,U=R;break}else{At=231;break t}else{e[r>>2]=0,o=0,At=224;break}}else o=R,At=224;while(!1);if((At|0)==224)if(At=0,a){At=231;break t}else U=0;if(a=e[t>>2]|0,l=e[a+12>>2]|0,(l|0)==(e[a+16>>2]|0)){if(m=0,a=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,$=m,m=0,$&1){At=24;break t}}else a=e[l>>2]|0;if(m=0,a=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,2048,a|0)|0,$=m,m=0,$&1){At=24;break t}if(!a){At=231;break t}if((e[D>>2]|0)==(e[Gt>>2]|0)&&(m=0,ve(14,C|0,D|0,Gt|0),$=m,m=0,$&1)){At=24;break t}if(a=e[t>>2]|0,l=e[a+12>>2]|0,(l|0)==(e[a+16>>2]|0)){if(m=0,a=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,$=m,m=0,$&1){At=24;break t}}else a=e[l>>2]|0;if(l=e[D>>2]|0,e[D>>2]=l+4,e[l>>2]=a,a=H,H=H+-1|0,e[i0>>2]=H,l=e[t>>2]|0,F=l+12|0,R=e[F>>2]|0,(R|0)==(e[l+16>>2]|0)){if(m=0,ge(e[(e[l>>2]|0)+40>>2]|0,l|0)|0,$=m,m=0,$&1){At=24;break t}}else e[F>>2]=R+4;if((a|0)<=1)break;R=o,l=U}}if((e[D>>2]|0)==(e[C>>2]|0)){At=242;break t}break}default:E=F}while(!1);i:do if((At|0)==44)for(;;){At=0,o=e[t>>2]|0;do if(o){if(a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=21;break t}}else o=e[a>>2]|0;if((o|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);do if(l){if(o=e[l+12>>2]|0,(o|0)==(e[l+16>>2]|0)){if(m=0,o=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,$=m,m=0,$&1){At=21;break t}}else o=e[o>>2]|0;if((o|0)!=-1)if(a^(E|0)==0){R=E,l=E;break}else{E=F;break i}else{e[r>>2]=0,E=0,At=57;break}}else At=57;while(!1);if((At|0)==57)if(At=0,a){E=F;break i}else R=E,l=0;if(E=e[t>>2]|0,o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,$=m,m=0,$&1){At=21;break t}}else E=e[o>>2]|0;if(m=0,E=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,8192,E|0)|0,$=m,m=0,$&1){At=21;break t}if(!E){E=F;break i}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,At=m,m=0,At&1){At=21;break t}}else e[o>>2]=a+4,E=e[a>>2]|0;if(m=0,Ae(92,yt|0,E|0),At=m,m=0,At&1){At=21;break t}else E=R,At=44}while(!1);if(P=P+1|0,P>>>0>=4){U=E,At=244;break}else F=E}t:switch(At|0){case 21:{o=j()|0;break e}case 22:{o=j()|0;break e}case 23:{o=j()|0;break e}case 24:{o=j()|0;break e}case 25:{o=j()|0;break e}case 26:{o=j()|0;break e}case 42:{e[h>>2]=e[h>>2]|4,o=0;break}case 107:{e[h>>2]=e[h>>2]|4,o=0;break}case 148:{e[h>>2]=e[h>>2]|4,o=0;break}case 206:{e[h>>2]=e[h>>2]|4,o=0;break}case 231:{e[h>>2]=e[h>>2]|4,o=0;break}case 242:{e[h>>2]=e[h>>2]|4,o=0;break}case 244:{i:do if(_){F=_+4|0,R=_+8|0,l=1;n:for(;;){if(E=S[_>>0]|0,E&1?E=e[F>>2]|0:E=(E&255)>>>1,l>>>0>=E>>>0)break i;E=e[t>>2]|0;do if(E){if(o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){At=20;break n}}else E=e[o>>2]|0;if((E|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);E=e[r>>2]|0;do if(E){if(o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){At=20;break n}}else E=e[o>>2]|0;if((E|0)!=-1){if(a)break;At=271;break n}else{e[r>>2]=0,At=263;break}}else At=263;while(!1);if((At|0)==263&&(At=0,a)){At=271;break}if(E=e[t>>2]|0,o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){At=20;break}}else E=e[o>>2]|0;if(S[_>>0]&1?o=e[R>>2]|0:o=F,(E|0)!=(e[o+(l<<2)>>2]|0)){At=271;break}if(E=l+1|0,o=e[t>>2]|0,a=o+12|0,l=e[a>>2]|0,(l|0)==(e[o+16>>2]|0))if(m=0,ge(e[(e[o>>2]|0)+40>>2]|0,o|0)|0,D=m,m=0,D&1){At=20;break}else{l=E;continue}else{e[a>>2]=l+4,l=E;continue}}if((At|0)==20){o=j()|0;break e}else if((At|0)==271){e[h>>2]=e[h>>2]|4,o=0;break t}}while(!1);E=e[h0>>2]|0,(E|0)!=(U|0)&&(e[y0>>2]=0,V0(T0,E,U,y0),(e[y0>>2]|0)!=0)?(e[h>>2]=e[h>>2]|4,o=0):o=1;break}}return Pt(yt),Pt(g0),Pt(Oe),Pt(qt),de(T0),E=e[h0>>2]|0,e[h0>>2]=0,E|0&&(m=0,ue(e[a0>>2]|0,E|0),h0=m,m=0,h0&1)&&(h0=j(0)|0,$t(h0)),b=c0,o|0}while(!1);return Pt(yt),Pt(g0),Pt(Oe),Pt(qt),de(T0),E=e[h0>>2]|0,e[h0>>2]=0,E|0&&(m=0,ue(e[a0>>2]|0,E|0),h0=m,m=0,h0&1)&&(h0=j(0)|0,$t(h0)),le(o|0),0}function uh(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;if($=b,b=b+432|0,w=$+424|0,t=$+24|0,L=$+16|0,U=$+8|0,F=$+4|0,R=$+428|0,C=$,e[L>>2]=t,ne=L+4|0,e[ne>>2]=189,D=t+400|0,m=0,G=ge(68,l|0)|0,E=m,m=0,E&1)w=j()|0,e[L>>2]=0,J=38;else{e[F>>2]=G,m=0,E=Ne(37,F|0,44212)|0,t=m,m=0;e:do if(!(t&1)&&(S[R>>0]=0,H=e[o>>2]|0,e[C>>2]=H,_=e[l+4>>2]|0,K=H,m=0,e[w>>2]=e[C>>2],_=Ut(2,r|0,w|0,a|0,F|0,_|0,h|0,R|0,E|0,L|0,U|0,D|0)|0,l=m,m=0,!(l&1))){if(_){if(S[d>>0]&1?e[e[d+8>>2]>>2]=0:S[d>>0]=0,e[d+4>>2]=0,S[R>>0]|0&&(m=0,t=Ne(e[(e[E>>2]|0)+44>>2]|0,E|0,45)|0,l=m,m=0,l&1||(m=0,Ae(92,d|0,t|0),l=m,m=0,l&1))||(m=0,C=Ne(e[(e[E>>2]|0)+44>>2]|0,E|0,48)|0,l=m,m=0,l&1))break;t=e[L>>2]|0,D=e[U>>2]|0,w=D+-4|0;t:do if(t>>>0>>0)do{if((e[t>>2]|0)!=(C|0))break t;t=t+4|0}while(t>>>0>>0);while(!1);if(m=0,Ve(33,d|0,t|0,D|0)|0,d=m,m=0,d&1)break}t=e[r>>2]|0;do if(t){if(w=e[t+12>>2]|0,(w|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1)break e}else t=e[w>>2]|0;if((t|0)==-1){e[r>>2]=0,w=1;break}else{w=(e[r>>2]|0)==0;break}}else w=1;while(!1);do if(H){if(t=e[K+12>>2]|0,(t|0)==(e[K+16>>2]|0)){if(m=0,t=ge(e[(e[H>>2]|0)+36>>2]|0,K|0)|0,K=m,m=0,K&1)break e}else t=e[t>>2]|0;if((t|0)!=-1){if(w)break;J=32;break}else{e[o>>2]=0,J=30;break}}else J=30;while(!1);return(J|0)==30&&w&&(J=32),(J|0)==32&&(e[h>>2]=e[h>>2]|2),w=e[r>>2]|0,Bt(G)|0,t=e[L>>2]|0,e[L>>2]=0,t|0&&(m=0,ue(e[ne>>2]|0,t|0),ne=m,m=0,ne&1)&&(ne=j(0)|0,$t(ne)),b=$,w|0}while(!1);w=j()|0,Bt(G)|0,t=e[L>>2]|0,e[L>>2]=0,t?J=38:P=w}return(J|0)==38&&(m=0,ue(e[ne>>2]|0,t|0),ne=m,m=0,ne&1?(ne=j(0)|0,$t(ne)):P=w),le(P|0),0}function fh(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0;J=b,b=b+112|0,E=J+100|0,F=J+88|0,R=J+76|0,_=J+64|0,U=J+52|0,H=J+48|0,K=J+36|0,G=J+24|0,$=J+12|0,P=J;do if(t)if(t=O0(r,43956)|0,t0[e[(e[t>>2]|0)+44>>2]&127](E,t),P=e[E>>2]|0,S[o>>0]=P,S[o+1>>0]=P>>8,S[o+2>>0]=P>>16,S[o+3>>0]=P>>24,t0[e[(e[t>>2]|0)+32>>2]&127](F,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[C>>2]=e[F>>2],e[C+4>>2]=e[F+4>>2],e[C+8>>2]=e[F+8>>2],e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,Pt(F),t0[e[(e[t>>2]|0)+28>>2]&127](R,t),S[w>>0]&1?e[e[w+8>>2]>>2]=0:S[w>>0]=0,e[w+4>>2]=0,m=0,Ae(93,w|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[w>>2]=e[R>>2],e[w+4>>2]=e[R+4>>2],e[w+8>>2]=e[R+8>>2],e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,Pt(R),w=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,e[a>>2]=w,w=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,e[l>>2]=w,t0[e[(e[t>>2]|0)+20>>2]&127](_,t),S[h>>0]&1?(S[e[h+8>>2]>>0]=0,e[h+4>>2]=0):(S[h+1>>0]=0,S[h>>0]=0),m=0,Ae(91,h|0,0),l=m,m=0,l&1&&(l=j(0)|0,$t(l)),e[h>>2]=e[_>>2],e[h+4>>2]=e[_+4>>2],e[h+8>>2]=e[_+8>>2],e[_>>2]=0,e[_+4>>2]=0,e[_+8>>2]=0,de(_),t0[e[(e[t>>2]|0)+24>>2]&127](U,t),S[d>>0]&1?e[e[d+8>>2]>>2]=0:S[d>>0]=0,e[d+4>>2]=0,m=0,Ae(93,d|0,0),l=m,m=0,l&1)l=j(0)|0,$t(l);else{e[d>>2]=e[U>>2],e[d+4>>2]=e[U+4>>2],e[d+8>>2]=e[U+8>>2],e[U>>2]=0,e[U+4>>2]=0,e[U+8>>2]=0,Pt(U),L=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}else if(t=O0(r,43892)|0,t0[e[(e[t>>2]|0)+44>>2]&127](H,t),H=e[H>>2]|0,S[o>>0]=H,S[o+1>>0]=H>>8,S[o+2>>0]=H>>16,S[o+3>>0]=H>>24,t0[e[(e[t>>2]|0)+32>>2]&127](K,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[C>>2]=e[K>>2],e[C+4>>2]=e[K+4>>2],e[C+8>>2]=e[K+8>>2],e[K>>2]=0,e[K+4>>2]=0,e[K+8>>2]=0,Pt(K),t0[e[(e[t>>2]|0)+28>>2]&127](G,t),S[w>>0]&1?e[e[w+8>>2]>>2]=0:S[w>>0]=0,e[w+4>>2]=0,m=0,Ae(93,w|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[w>>2]=e[G>>2],e[w+4>>2]=e[G+4>>2],e[w+8>>2]=e[G+8>>2],e[G>>2]=0,e[G+4>>2]=0,e[G+8>>2]=0,Pt(G),w=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,e[a>>2]=w,w=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,e[l>>2]=w,t0[e[(e[t>>2]|0)+20>>2]&127]($,t),S[h>>0]&1?(S[e[h+8>>2]>>0]=0,e[h+4>>2]=0):(S[h+1>>0]=0,S[h>>0]=0),m=0,Ae(91,h|0,0),l=m,m=0,l&1&&(l=j(0)|0,$t(l)),e[h>>2]=e[$>>2],e[h+4>>2]=e[$+4>>2],e[h+8>>2]=e[$+8>>2],e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,de($),t0[e[(e[t>>2]|0)+24>>2]&127](P,t),S[d>>0]&1?e[e[d+8>>2]>>2]=0:S[d>>0]=0,e[d+4>>2]=0,m=0,Ae(93,d|0,0),l=m,m=0,l&1)l=j(0)|0,$t(l);else{e[d>>2]=e[P>>2],e[d+4>>2]=e[P+4>>2],e[d+8>>2]=e[P+8>>2],e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,Pt(P),L=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}while(!1);e[D>>2]=L,b=J}function hh(t){t=t|0}function dh(t){t=t|0,he(t)}function ph(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=+h;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0;re=b,b=b+384|0,K=re+8|0,d=re,C=re+284|0,D=re+72|0,w=re+184|0,Ee=re+68|0,J=re+80|0,$=re+77|0,ne=re+76|0,ke=re+56|0,it=re+44|0,Te=re+32|0,E=re+28|0,H=re+84|0,L=re+24|0,P=re+20|0,G=re+16|0,e[D>>2]=C,B[K>>3]=h,C=Mo(C,100,59018,K)|0;do if(C>>>0>99)if(m=0,t=Ce(3)|0,ae=m,m=0,!(ae&1)&&(m=0,B[d>>3]=h,_=Pe(17,D|0,t|0,59018,d|0)|0,ae=m,m=0,!(ae&1))){if(t=e[D>>2]|0,!t){if(m=0,bt(6),ae=m,m=0,ae&1){t=0,d=0,ae=7;break}t=e[D>>2]|0}w=E0(_)|0,d=w,w?(U=w,ae=10):(m=0,bt(6),ae=m,m=0,ae&1?ae=7:(U=0,ae=10))}else t=0,d=0,ae=7;else d=0,t=0,U=w,_=C,ae=10;while(!1);if((ae|0)==10)if(m=0,w=ge(68,a|0)|0,R=m,m=0,R&1)ae=7;else{if(e[Ee>>2]=w,m=0,R=Ne(37,Ee|0,44220)|0,F=m,m=0,!(F&1)&&(F=e[D>>2]|0,m=0,Pe(e[(e[R>>2]|0)+32>>2]|0,R|0,F|0,F+_|0,U|0)|0,F=m,m=0,!(F&1))){if(_?F=(S[e[D>>2]>>0]|0)==45:F=0,e[ke>>2]=0,e[ke+4>>2]=0,e[ke+8>>2]=0,e[it>>2]=0,e[it+4>>2]=0,e[it+8>>2]=0,e[Te>>2]=0,e[Te+4>>2]=0,e[Te+8>>2]=0,m=0,I0(3,o|0,F|0,Ee|0,J|0,$|0,ne|0,ke|0,it|0,Te|0,E|0),o=m,m=0,o&1)C=j()|0;else{if(E=e[E>>2]|0,(_|0)>(E|0)?(o=S[Te>>0]|0,C=S[it>>0]|0,C=(_-E<<1|1)+E+(o&1?e[Te+4>>2]|0:(o&255)>>>1)+(C&1?e[it+4>>2]|0:(C&255)>>>1)|0):(o=S[Te>>0]|0,C=S[it>>0]|0,C=E+2+(o&1?e[Te+4>>2]|0:(o&255)>>>1)+(C&1?e[it+4>>2]|0:(C&255)>>>1)|0),C>>>0>100?(C=E0(C)|0,D=C,C?ae=26:(m=0,bt(6),H=m,m=0,H&1||(C=0,ae=26))):(D=0,C=H,ae=26),(ae|0)==26&&(m=0,Zt(1,C|0,L|0,P|0,e[a+4>>2]|0,U|0,U+_|0,R|0,F|0,J|0,S[$>>0]|0,S[ne>>0]|0,ke|0,it|0,Te|0,E|0),ne=m,m=0,!(ne&1)&&(e[G>>2]=e[r>>2],r=e[L>>2]|0,ce=e[P>>2]|0,m=0,e[K>>2]=e[G>>2],ce=Vt(39,K|0,C|0,r|0,ce|0,a|0,l|0)|0,r=m,m=0,!(r&1))))return D&&(n0(D),w=e[Ee>>2]|0),de(Te),de(it),de(ke),Bt(w)|0,d&&n0(d),t&&n0(t),b=re,ce|0;C=j()|0,D&&(n0(D),w=e[Ee>>2]|0)}de(Te),de(it),de(ke)}else C=j()|0;Bt(w)|0}return(ae|0)==7&&(C=j()|0),d&&n0(d),t&&n0(t),le(C|0),0}function mh(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ce=b,b=b+112|0,R=ce+108|0,_=ce+96|0,K=ce+92|0,G=ce+80|0,$=ce+68|0,P=ce+56|0,L=ce+52|0,J=ce+40|0,ne=ce+36|0,ae=ce+24|0,U=ce+12|0,H=ce;do if(t){t=O0(o,43828)|0,o=e[t>>2]|0;do if(r)if(t0[e[o+44>>2]&127](R,t),r=e[R>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+32>>2]&127](_,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[_>>2],e[C+4>>2]=e[_+4>>2],e[C+8>>2]=e[_+8>>2],e[_>>2]=0,e[_+4>>2]=0,e[_+8>>2]=0,de(_),F=t;break}else if(t0[e[o+40>>2]&127](K,t),r=e[K>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+28>>2]&127](G,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[G>>2],e[C+4>>2]=e[G+4>>2],e[C+8>>2]=e[G+8>>2],e[G>>2]=0,e[G+4>>2]=0,e[G+8>>2]=0,de(G),F=t;break}while(!1);if(C=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,S[l>>0]=C,C=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,S[h>>0]=C,t0[e[(e[F>>2]|0)+20>>2]&127]($,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),h=m,m=0,h&1&&(h=j(0)|0,$t(h)),e[d>>2]=e[$>>2],e[d+4>>2]=e[$+4>>2],e[d+8>>2]=e[$+8>>2],e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,de($),t0[e[(e[F>>2]|0)+24>>2]&127](P,t),S[w>>0]&1?(S[e[w+8>>2]>>0]=0,e[w+4>>2]=0):(S[w+1>>0]=0,S[w>>0]=0),m=0,Ae(91,w|0,0),h=m,m=0,h&1)h=j(0)|0,$t(h);else{e[w>>2]=e[P>>2],e[w+4>>2]=e[P+4>>2],e[w+8>>2]=e[P+8>>2],e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,de(P),re=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}}else{t=O0(o,43764)|0,o=e[t>>2]|0;do if(r)if(t0[e[o+44>>2]&127](L,t),r=e[L>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+32>>2]&127](J,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[J>>2],e[C+4>>2]=e[J+4>>2],e[C+8>>2]=e[J+8>>2],e[J>>2]=0,e[J+4>>2]=0,e[J+8>>2]=0,de(J),E=t;break}else if(t0[e[o+40>>2]&127](ne,t),r=e[ne>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+28>>2]&127](ae,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[ae>>2],e[C+4>>2]=e[ae+4>>2],e[C+8>>2]=e[ae+8>>2],e[ae>>2]=0,e[ae+4>>2]=0,e[ae+8>>2]=0,de(ae),E=t;break}while(!1);if(C=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,S[l>>0]=C,C=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,S[h>>0]=C,t0[e[(e[E>>2]|0)+20>>2]&127](U,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),h=m,m=0,h&1&&(h=j(0)|0,$t(h)),e[d>>2]=e[U>>2],e[d+4>>2]=e[U+4>>2],e[d+8>>2]=e[U+8>>2],e[U>>2]=0,e[U+4>>2]=0,e[U+8>>2]=0,de(U),t0[e[(e[E>>2]|0)+24>>2]&127](H,t),S[w>>0]&1?(S[e[w+8>>2]>>0]=0,e[w+4>>2]=0):(S[w+1>>0]=0,S[w>>0]=0),m=0,Ae(91,w|0,0),h=m,m=0,h&1)h=j(0)|0,$t(h);else{e[w>>2]=e[H>>2],e[w+4>>2]=e[H+4>>2],e[w+8>>2]=e[H+8>>2],e[H>>2]=0,e[H+4>>2]=0,e[H+8>>2]=0,de(H),re=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}}while(!1);e[D>>2]=re,b=ce}function gh(t,r,o,a,l,h,d,w,C,D,E,F,R,_,U){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,R=R|0,_=_|0,U=U|0;var H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0;e[o>>2]=t,Kt=_+4|0,pt=_+8|0,At=_+1|0,jt=R+4|0,Gt=(a&512|0)==0,s0=R+8|0,i0=R+1|0,zt=d+8|0,gt=(U|0)>0,ae=F+4|0,re=F+8|0,ce=F+1|0,Ee=U+1|0,Te=-2-U-((U|0)<0?~U:-1)|0,it=(U|0)>0,ne=0;do{switch(S[C+ne>>0]|0){case 0:{e[r>>2]=e[o>>2];break}case 1:{e[r>>2]=e[o>>2],L=U0[e[(e[d>>2]|0)+28>>2]&63](d,32)|0,J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=L;break}case 3:{J=S[_>>0]|0,H=(J&1)==0,(H?(J&255)>>>1:e[Kt>>2]|0)|0&&(L=S[(H?At:e[pt>>2]|0)>>0]|0,J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=L);break}case 2:{if(G=S[R>>0]|0,H=(G&1)==0,G=H?(G&255)>>>1:e[jt>>2]|0,!(Gt|(G|0)==0)){if(K=H?i0:e[s0>>2]|0,$=K+G|0,H=e[o>>2]|0,G)do S[H>>0]=S[K>>0]|0,K=K+1|0,H=H+1|0;while((K|0)!=($|0));e[o>>2]=H}break}case 4:{H=e[o>>2]|0,l=w?l+1|0:l,P=l,$=e[zt>>2]|0;e:do if(l>>>0>>0){K=l;do{if(G=S[K>>0]|0,G<<24>>24<=-1||!(k[$+(G<<24>>24<<1)>>1]&2048))break e;K=K+1|0}while(K>>>0>>0)}else K=l;while(!1);if(G=K,gt){if(L=-2-G-~(G>>>0>P>>>0?P:G)|0,L=Te>>>0>L>>>0?Te:L,K>>>0>l>>>0&it)for(G=K,P=U;G=G+-1|0,J=S[G>>0]|0,$=e[o>>2]|0,e[o>>2]=$+1,S[$>>0]=J,$=(P|0)>1,G>>>0>l>>>0&$;)P=P+-1|0;else $=it;if(J=Ee+L|0,G=K+(L+1)|0,$?P=U0[e[(e[d>>2]|0)+28>>2]&63](d,48)|0:P=0,K=e[o>>2]|0,e[o>>2]=K+1,(J|0)>0)for($=J;S[K>>0]=P,K=e[o>>2]|0,e[o>>2]=K+1,($|0)>1;)$=$+-1|0;S[K>>0]=D}else G=K;if((G|0)!=(l|0)){if(J=S[F>>0]|0,K=(J&1)==0,(K?(J&255)>>>1:e[ae>>2]|0)|0?K=S[(K?ce:e[re>>2]|0)>>0]|0:K=-1,(G|0)!=(l|0))for($=0,P=0;(P|0)==(K|0)&&(J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=E,$=$+1|0,J=S[F>>0]|0,K=(J&1)==0,$>>>0<(K?(J&255)>>>1:e[ae>>2]|0)>>>0?(K=S[(K?ce:e[re>>2]|0)+$>>0]|0,K=K<<24>>24==127?-1:K<<24>>24,P=0):(K=P,P=0)),G=G+-1|0,L=S[G>>0]|0,J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=L,(G|0)!=(l|0);)P=P+1|0}else L=U0[e[(e[d>>2]|0)+28>>2]&63](d,48)|0,J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=L;if(K=e[o>>2]|0,(H|0)!=(K|0)&&(ke=K+-1|0,H>>>0>>0)){K=ke;do J=S[H>>0]|0,S[H>>0]=S[K>>0]|0,S[K>>0]=J,H=H+1|0,K=K+-1|0;while(H>>>0>>0)}break}default:}ne=ne+1|0}while((ne|0)!=4);if(K=S[_>>0]|0,l=(K&1)==0,K=l?(K&255)>>>1:e[Kt>>2]|0,K>>>0>1){if(H=l?At:e[pt>>2]|0,G=H+K|0,l=e[o>>2]|0,(K|0)!=1){H=H+1|0;do S[l>>0]=S[H>>0]|0,l=l+1|0,H=H+1|0;while((H|0)!=(G|0))}e[o>>2]=l}switch(a&176|0){case 32:{e[r>>2]=e[o>>2];break}case 16:break;default:e[r>>2]=t}}function Sh(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;J=b,b=b+176|0,_=J+56|0,ae=J+52|0,P=J+64|0,K=J+61|0,L=J+60|0,re=J+40|0,Ee=J+28|0,ce=J+16|0,D=J+12|0,R=J+68|0,$=J+8|0,G=J+4|0,U=J,t=f0(a)|0,e[ae>>2]=t,m=0,H=Ne(37,ae|0,44220)|0,F=m,m=0;do if(F&1)ke=13;else{if(E=S[h>>0]|0,d=(E&1)==0,F=h+4|0,!((d?(E&255)>>>1:e[F>>2]|0)|0))E=0;else{if(d=S[(d?h+1|0:e[h+8>>2]|0)>>0]|0,m=0,w=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,45)|0,E=m,m=0,E&1){ke=13;break}E=d<<24>>24==w<<24>>24}if(e[re>>2]=0,e[re+4>>2]=0,e[re+8>>2]=0,e[Ee>>2]=0,e[Ee+4>>2]=0,e[Ee+8>>2]=0,e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,m=0,I0(3,o|0,E|0,ae|0,P|0,K|0,L|0,re|0,Ee|0,ce|0,D|0),C=m,m=0,C&1)d=j()|0;else{if(C=S[h>>0]|0,o=e[F>>2]|0,d=C&1?o:(C&255)>>>1,D=e[D>>2]|0,(d|0)>(D|0)?(Te=S[ce>>0]|0,w=S[Ee>>0]|0,d=(d-D<<1|1)+D+(Te&1?e[ce+4>>2]|0:(Te&255)>>>1)+(w&1?e[Ee+4>>2]|0:(w&255)>>>1)|0):(Te=S[ce>>0]|0,d=S[Ee>>0]|0,d=D+2+(Te&1?e[ce+4>>2]|0:(Te&255)>>>1)+(d&1?e[Ee+4>>2]|0:(d&255)>>>1)|0),d>>>0>100?(d=E0(d)|0,w=d,d?ke=17:(m=0,bt(6),Te=m,m=0,Te&1||(C=S[h>>0]|0,o=e[F>>2]|0,d=0,ke=17))):(w=0,d=R,ke=17),(ke|0)==17&&(Te=(C&1)==0,h=Te?h+1|0:e[h+8>>2]|0,m=0,Zt(1,d|0,$|0,G|0,e[a+4>>2]|0,h|0,h+(Te?(C&255)>>>1:o)|0,H|0,E|0,P|0,S[K>>0]|0,S[L>>0]|0,re|0,Ee|0,ce|0,D|0),Te=m,m=0,!(Te&1)&&(e[U>>2]=e[r>>2],Te=e[$>>2]|0,ne=e[G>>2]|0,m=0,e[_>>2]=e[U>>2],ne=Vt(39,_|0,d|0,Te|0,ne|0,a|0,l|0)|0,Te=m,m=0,!(Te&1))))return w&&(n0(w),t=e[ae>>2]|0),de(ce),de(Ee),de(re),Bt(t)|0,b=J,ne|0;d=j()|0,w&&(n0(w),t=e[ae>>2]|0)}de(ce),de(Ee),de(re)}while(!1);return(ke|0)==13&&(d=j()|0),Bt(t)|0,le(d|0),0}function Ah(t){t=t|0}function vh(t){t=t|0,he(t)}function xh(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=+h;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0;re=b,b=b+992|0,K=re+8|0,d=re,C=re+888|0,D=re+880|0,w=re+480|0,Ee=re+76|0,J=re+884|0,$=re+72|0,ne=re+68|0,ke=re+56|0,it=re+44|0,Te=re+32|0,E=re+28|0,H=re+80|0,L=re+24|0,P=re+20|0,G=re+16|0,e[D>>2]=C,B[K>>3]=h,C=Mo(C,100,59018,K)|0;do if(C>>>0>99)if(m=0,t=Ce(3)|0,ae=m,m=0,!(ae&1)&&(m=0,B[d>>3]=h,_=Pe(17,D|0,t|0,59018,d|0)|0,ae=m,m=0,!(ae&1))){if(t=e[D>>2]|0,!t){if(m=0,bt(6),ae=m,m=0,ae&1){t=0,d=0,ae=7;break}t=e[D>>2]|0}w=E0(_<<2)|0,d=w,w?(U=w,ae=10):(m=0,bt(6),ae=m,m=0,ae&1?ae=7:(U=0,ae=10))}else t=0,d=0,ae=7;else d=0,t=0,U=w,_=C,ae=10;while(!1);if((ae|0)==10)if(m=0,w=ge(68,a|0)|0,R=m,m=0,R&1)ae=7;else{if(e[Ee>>2]=w,m=0,R=Ne(37,Ee|0,44212)|0,F=m,m=0,!(F&1)&&(F=e[D>>2]|0,m=0,Pe(e[(e[R>>2]|0)+48>>2]|0,R|0,F|0,F+_|0,U|0)|0,F=m,m=0,!(F&1))){if(_?F=(S[e[D>>2]>>0]|0)==45:F=0,e[ke>>2]=0,e[ke+4>>2]=0,e[ke+8>>2]=0,e[it>>2]=0,e[it+4>>2]=0,e[it+8>>2]=0,e[Te>>2]=0,e[Te+4>>2]=0,e[Te+8>>2]=0,m=0,I0(4,o|0,F|0,Ee|0,J|0,$|0,ne|0,ke|0,it|0,Te|0,E|0),o=m,m=0,o&1)C=j()|0;else{if(E=e[E>>2]|0,(_|0)>(E|0)?(o=S[Te>>0]|0,C=S[it>>0]|0,C=(_-E<<1|1)+E+(o&1?e[Te+4>>2]|0:(o&255)>>>1)+(C&1?e[it+4>>2]|0:(C&255)>>>1)|0):(o=S[Te>>0]|0,C=S[it>>0]|0,C=E+2+(o&1?e[Te+4>>2]|0:(o&255)>>>1)+(C&1?e[it+4>>2]|0:(C&255)>>>1)|0),C>>>0>100?(C=E0(C<<2)|0,D=C,C?ae=26:(m=0,bt(6),H=m,m=0,H&1||(C=0,ae=26))):(D=0,C=H,ae=26),(ae|0)==26&&(m=0,Zt(2,C|0,L|0,P|0,e[a+4>>2]|0,U|0,U+(_<<2)|0,R|0,F|0,J|0,e[$>>2]|0,e[ne>>2]|0,ke|0,it|0,Te|0,E|0),ne=m,m=0,!(ne&1)&&(e[G>>2]=e[r>>2],r=e[L>>2]|0,ce=e[P>>2]|0,m=0,e[K>>2]=e[G>>2],ce=Vt(40,K|0,C|0,r|0,ce|0,a|0,l|0)|0,r=m,m=0,!(r&1))))return D&&(n0(D),w=e[Ee>>2]|0),Pt(Te),Pt(it),de(ke),Bt(w)|0,d&&n0(d),t&&n0(t),b=re,ce|0;C=j()|0,D&&(n0(D),w=e[Ee>>2]|0)}Pt(Te),Pt(it),de(ke)}else C=j()|0;Bt(w)|0}return(ae|0)==7&&(C=j()|0),d&&n0(d),t&&n0(t),le(C|0),0}function wh(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0;ae=b,b=b+112|0,E=ae+108|0,F=ae+96|0,U=ae+92|0,H=ae+80|0,K=ae+68|0,G=ae+56|0,$=ae+52|0,P=ae+40|0,L=ae+36|0,J=ae+24|0,R=ae+12|0,_=ae;do if(t){t=O0(o,43956)|0,o=e[t>>2]|0;do if(r)if(t0[e[o+44>>2]&127](E,t),r=e[E>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+32>>2]&127](F,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[F>>2],e[C+4>>2]=e[F+4>>2],e[C+8>>2]=e[F+8>>2],e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,Pt(F);break}else if(t0[e[o+40>>2]&127](U,t),r=e[U>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+28>>2]&127](H,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[H>>2],e[C+4>>2]=e[H+4>>2],e[C+8>>2]=e[H+8>>2],e[H>>2]=0,e[H+4>>2]=0,e[H+8>>2]=0,Pt(H);break}while(!1);if(C=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,e[l>>2]=C,C=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,e[h>>2]=C,t0[e[(e[t>>2]|0)+20>>2]&127](K,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),h=m,m=0,h&1&&(h=j(0)|0,$t(h)),e[d>>2]=e[K>>2],e[d+4>>2]=e[K+4>>2],e[d+8>>2]=e[K+8>>2],e[K>>2]=0,e[K+4>>2]=0,e[K+8>>2]=0,de(K),t0[e[(e[t>>2]|0)+24>>2]&127](G,t),S[w>>0]&1?e[e[w+8>>2]>>2]=0:S[w>>0]=0,e[w+4>>2]=0,m=0,Ae(93,w|0,0),h=m,m=0,h&1)h=j(0)|0,$t(h);else{e[w>>2]=e[G>>2],e[w+4>>2]=e[G+4>>2],e[w+8>>2]=e[G+8>>2],e[G>>2]=0,e[G+4>>2]=0,e[G+8>>2]=0,Pt(G),ne=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}}else{t=O0(o,43892)|0,o=e[t>>2]|0;do if(r)if(t0[e[o+44>>2]&127]($,t),r=e[$>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+32>>2]&127](P,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[P>>2],e[C+4>>2]=e[P+4>>2],e[C+8>>2]=e[P+8>>2],e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,Pt(P);break}else if(t0[e[o+40>>2]&127](L,t),r=e[L>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+28>>2]&127](J,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[J>>2],e[C+4>>2]=e[J+4>>2],e[C+8>>2]=e[J+8>>2],e[J>>2]=0,e[J+4>>2]=0,e[J+8>>2]=0,Pt(J);break}while(!1);if(C=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,e[l>>2]=C,C=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,e[h>>2]=C,t0[e[(e[t>>2]|0)+20>>2]&127](R,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),h=m,m=0,h&1&&(h=j(0)|0,$t(h)),e[d>>2]=e[R>>2],e[d+4>>2]=e[R+4>>2],e[d+8>>2]=e[R+8>>2],e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,de(R),t0[e[(e[t>>2]|0)+24>>2]&127](_,t),S[w>>0]&1?e[e[w+8>>2]>>2]=0:S[w>>0]=0,e[w+4>>2]=0,m=0,Ae(93,w|0,0),h=m,m=0,h&1)h=j(0)|0,$t(h);else{e[w>>2]=e[_>>2],e[w+4>>2]=e[_+4>>2],e[w+8>>2]=e[_+8>>2],e[_>>2]=0,e[_+4>>2]=0,e[_+8>>2]=0,Pt(_),ne=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}}while(!1);e[D>>2]=ne,b=ae}function yh(t,r,o,a,l,h,d,w,C,D,E,F,R,_,U){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,R=R|0,_=_|0,U=U|0;var H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0;e[o>>2]=t,i0=_+4|0,zt=_+8|0,Ee=R+4|0,ke=(a&512|0)==0,Te=R+8|0,it=(U|0)>0,jt=F+4|0,Gt=F+8|0,s0=F+1|0,re=(U|0)>0,ae=0;do{switch(S[C+ae>>0]|0){case 0:{e[r>>2]=e[o>>2];break}case 1:{e[r>>2]=e[o>>2],J=U0[e[(e[d>>2]|0)+44>>2]&63](d,32)|0,ne=e[o>>2]|0,e[o>>2]=ne+4,e[ne>>2]=J;break}case 3:{ne=S[_>>0]|0,H=(ne&1)==0,(H?(ne&255)>>>1:e[i0>>2]|0)|0&&(J=e[(H?i0:e[zt>>2]|0)>>2]|0,ne=e[o>>2]|0,e[o>>2]=ne+4,e[ne>>2]=J);break}case 2:{if(P=S[R>>0]|0,H=(P&1)==0,P=H?(P&255)>>>1:e[Ee>>2]|0,!(ke|(P|0)==0)){if(H=H?Ee:e[Te>>2]|0,G=H+(P<<2)|0,$=e[o>>2]|0,P)for(K=$;e[K>>2]=e[H>>2],H=H+4|0,(H|0)!=(G|0);)K=K+4|0;e[o>>2]=$+(P<<2)}break}case 4:{H=e[o>>2]|0,l=w?l+4|0:l;e:do if(l>>>0>>0){K=l;do{if(!(Yt[e[(e[d>>2]|0)+12>>2]&63](d,2048,e[K>>2]|0)|0))break e;K=K+4|0}while(K>>>0>>0)}else K=l;while(!1);if(it){if(K>>>0>l>>>0&re){for(P=e[o>>2]|0,$=U;;)if(K=K+-4|0,G=P+4|0,e[P>>2]=e[K>>2],L=$+-1|0,$=($|0)>1,K>>>0>l>>>0&$)P=G,$=L;else{P=L;break}e[o>>2]=G,G=P}else $=re,G=U;if($?L=U0[e[(e[d>>2]|0)+44>>2]&63](d,48)|0:L=0,J=e[o>>2]|0,$=G+((G|0)<0?~G:-1)|0,(G|0)>0)for(P=J;e[P>>2]=L,(G|0)>1;)P=P+4|0,G=G+-1|0;e[o>>2]=J+($+2<<2),e[J+($+1<<2)>>2]=D}if((K|0)==(l|0))J=U0[e[(e[d>>2]|0)+44>>2]&63](d,48)|0,ne=e[o>>2]|0,K=ne+4|0,e[o>>2]=K,e[ne>>2]=J;else{if(J=S[F>>0]|0,G=(J&1)==0,ne=e[jt>>2]|0,(G?(J&255)>>>1:ne)|0?G=S[(G?s0:e[Gt>>2]|0)>>0]|0:G=-1,(K|0)!=(l|0))for(L=0,J=0;$=e[o>>2]|0,(J|0)==(G|0)?(P=$+4|0,e[o>>2]=P,e[$>>2]=E,L=L+1|0,$=S[F>>0]|0,G=($&1)==0,L>>>0<(G?($&255)>>>1:ne)>>>0?(G=S[(G?s0:e[Gt>>2]|0)+L>>0]|0,$=P,G=G<<24>>24==127?-1:G<<24>>24,P=0):($=P,G=J,P=0)):P=J,K=K+-4|0,J=e[K>>2]|0,e[o>>2]=$+4,e[$>>2]=J,(K|0)!=(l|0);)J=P+1|0;K=e[o>>2]|0}if((H|0)!=(K|0)&&(ce=K+-4|0,H>>>0>>0)){K=ce;do ne=e[H>>2]|0,e[H>>2]=e[K>>2],e[K>>2]=ne,H=H+4|0,K=K+-4|0;while(H>>>0>>0)}break}default:}ae=ae+1|0}while((ae|0)!=4);if(H=S[_>>0]|0,l=(H&1)==0,H=l?(H&255)>>>1:e[i0>>2]|0,H>>>0>1){if(K=l?i0:e[zt>>2]|0,l=K+4|0,K=K+(H<<2)|0,G=e[o>>2]|0,$=K-l|0,(H|0)!=1)for(H=G;e[H>>2]=e[l>>2],l=l+4|0,(l|0)!=(K|0);)H=H+4|0;e[o>>2]=G+($>>>2<<2)}switch(a&176|0){case 32:{e[r>>2]=e[o>>2];break}case 16:break;default:e[r>>2]=t}}function Ch(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;J=b,b=b+480|0,R=J+468|0,ae=J+464|0,P=J+472|0,K=J+56|0,L=J+52|0,re=J+40|0,Ee=J+28|0,ce=J+16|0,D=J+12|0,F=J+64|0,$=J+8|0,G=J+4|0,_=J,t=f0(a)|0,e[ae>>2]=t,m=0,U=Ne(37,ae|0,44212)|0,H=m,m=0;do if(H&1)ke=13;else{if(E=S[h>>0]|0,d=(E&1)==0,H=h+4|0,!((d?(E&255)>>>1:e[H>>2]|0)|0))E=0;else{if(d=e[(d?H:e[h+8>>2]|0)>>2]|0,m=0,w=Ne(e[(e[U>>2]|0)+44>>2]|0,U|0,45)|0,E=m,m=0,E&1){ke=13;break}E=(d|0)==(w|0)}if(e[re>>2]=0,e[re+4>>2]=0,e[re+8>>2]=0,e[Ee>>2]=0,e[Ee+4>>2]=0,e[Ee+8>>2]=0,e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,m=0,I0(4,o|0,E|0,ae|0,P|0,K|0,L|0,re|0,Ee|0,ce|0,D|0),C=m,m=0,C&1)d=j()|0;else{if(C=S[h>>0]|0,o=e[H>>2]|0,d=C&1?o:(C&255)>>>1,D=e[D>>2]|0,(d|0)>(D|0)?(Te=S[ce>>0]|0,w=S[Ee>>0]|0,d=(d-D<<1|1)+D+(Te&1?e[ce+4>>2]|0:(Te&255)>>>1)+(w&1?e[Ee+4>>2]|0:(w&255)>>>1)|0):(Te=S[ce>>0]|0,d=S[Ee>>0]|0,d=D+2+(Te&1?e[ce+4>>2]|0:(Te&255)>>>1)+(d&1?e[Ee+4>>2]|0:(d&255)>>>1)|0),d>>>0>100?(d=E0(d<<2)|0,w=d,d?ke=17:(m=0,bt(6),Te=m,m=0,Te&1||(C=S[h>>0]|0,o=e[H>>2]|0,d=0,ke=17))):(w=0,d=F,ke=17),(ke|0)==17&&(Te=(C&1)==0,h=Te?H:e[h+8>>2]|0,m=0,Zt(2,d|0,$|0,G|0,e[a+4>>2]|0,h|0,h+((Te?(C&255)>>>1:o)<<2)|0,U|0,E|0,P|0,e[K>>2]|0,e[L>>2]|0,re|0,Ee|0,ce|0,D|0),Te=m,m=0,!(Te&1)&&(e[_>>2]=e[r>>2],Te=e[$>>2]|0,ne=e[G>>2]|0,m=0,e[R>>2]=e[_>>2],ne=Vt(40,R|0,d|0,Te|0,ne|0,a|0,l|0)|0,Te=m,m=0,!(Te&1))))return w&&(n0(w),t=e[ae>>2]|0),Pt(ce),Pt(Ee),de(re),Bt(t)|0,b=J,ne|0;d=j()|0,w&&(n0(w),t=e[ae>>2]|0)}Pt(ce),Pt(Ee),de(re)}while(!1);return(ke|0)==13&&(d=j()|0),Bt(t)|0,le(d|0),0}function Th(t){t=t|0}function Ih(t){t=t|0,he(t)}function kh(t,r,o){return t=t|0,r=r|0,o=o|0,t=yo(S[r>>0]&1?e[r+8>>2]|0:r+1|0,1)|0,t>>>((t|0)!=-1&1)|0}function Eh(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0;w=b,b=b+16|0,C=w,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,d=S[h>>0]|0,D=(d&1)==0,r=D?h+1|0:e[h+8>>2]|0,d=D?(d&255)>>>1:e[h+4>>2]|0,h=r+d|0;e:do if((d|0)>0){for(;m=0,Ae(67,C|0,S[r>>0]|0),D=m,m=0,!(D&1);)if(r=r+1|0,r>>>0>=h>>>0){d=4;break e}r=j()|0,d=7}else d=4;while(!1);e:do if((d|0)==4){if(m=0,r=Pe(19,((o|0)==-1?-1:o<<1)|0,a|0,l|0,(S[C>>0]&1?e[C+8>>2]|0:C+1|0)|0)|0,D=m,m=0,D&1){r=j()|0,d=7;break}e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,D=$i(r)|0,h=r+D|0;t:do if((D|0)>0){for(;m=0,Ae(67,t|0,S[r>>0]|0),D=m,m=0,!(D&1);)if(r=r+1|0,r>>>0>=h>>>0)break t;r=j()|0,de(t);break e}while(!1);de(C),b=w;return}while(!1);de(C),le(r|0)}function Dh(t,r){t=t|0,r=r|0}function bh(t){t=t|0}function Fh(t){t=t|0,he(t)}function Nh(t,r,o){return t=t|0,r=r|0,o=o|0,t=yo(S[r>>0]&1?e[r+8>>2]|0:r+1|0,1)|0,t>>>((t|0)!=-1&1)|0}function Rh(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;$=b,b=b+224|0,F=$+184|0,E=$+192|0,D=$+180|0,R=$+176|0,K=$+168|0,H=$+40|0,U=$+32|0,G=$+28|0,P=$+16|0,C=$+8|0,_=$,e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,e[C+4>>2]=0,e[C>>2]=44696,w=S[h>>0]|0,L=(w&1)==0,d=h+4|0,r=L?d:e[h+8>>2]|0,h=L?(w&255)>>>1:e[d>>2]|0,d=r+(h<<2)|0,w=E+32|0;e:do if((h|0)>0){t:for(;;){if(e[R>>2]=r,m=0,h=Xt(e[(e[C>>2]|0)+12>>2]|0,C|0,F|0,r|0,d|0,R|0,E|0,w|0,D|0)|0,L=m,m=0,L&1){h=12;break}if((h|0)==2||(e[R>>2]|0)==(r|0)){h=5;break}if(E>>>0<(e[D>>2]|0)>>>0){r=E;do{if(m=0,Ae(67,P|0,S[r>>0]|0),L=m,m=0,L&1){h=11;break t}r=r+1|0}while(r>>>0<(e[D>>2]|0)>>>0)}if(r=e[R>>2]|0,!((h|0)!=2&r>>>0>>0)){h=9;break e}}(h|0)==5?(m=0,ue(190,58955),m=0,r=j()|0):((h|0)==11||(h|0)==12)&&(r=j()|0)}else h=9;while(!1);e:do if((h|0)==9){if(m=0,r=Pe(19,((o|0)==-1?-1:o<<1)|0,a|0,l|0,(S[P>>0]&1?e[P+8>>2]|0:P+1|0)|0)|0,L=m,m=0,L&1){r=j()|0;break}e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[_+4>>2]=0,e[_>>2]=44744,L=$i(r)|0,d=r+L|0,w=d,C=H+128|0;t:do if((L|0)>0){i:for(;;){if(e[G>>2]=r,m=0,h=Xt(e[(e[_>>2]|0)+16>>2]|0,_|0,K|0,r|0,((w-r|0)>32?r+32|0:d)|0,G|0,H|0,C|0,U|0)|0,L=m,m=0,L&1){h=24;break}if((h|0)==2||(e[G>>2]|0)==(r|0)){h=18;break}if(H>>>0<(e[U>>2]|0)>>>0){r=H;do{if(m=0,Ae(92,t|0,e[r>>2]|0),L=m,m=0,L&1){h=23;break i}r=r+4|0}while(r>>>0<(e[U>>2]|0)>>>0)}if(r=e[G>>2]|0,!((h|0)!=2&r>>>0>>0))break t}(h|0)==18?(m=0,ue(190,58955),m=0,r=j()|0):((h|0)==23||(h|0)==24)&&(r=j()|0),Pt(t);break e}while(!1);de(P),b=$;return}while(!1);de(P),le(r|0)}function Mh(t,r){t=t|0,r=r|0}function _h(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0;if(e[t+4>>2]=r+-1,e[t>>2]=44196,h=t+8|0,m=0,Ae(94,h|0,28),l=m,m=0,l&1)r=j()|0;else{if(l=t+144|0,m=0,ve(5,l|0,58885,1),a=m,m=0,a&1)r=j()|0;else{if(o=e[h>>2]|0,a=t+12|0,r=e[a>>2]|0,(r|0)!=(o|0)){do r=r+-4|0;while((r|0)!=(o|0));e[a>>2]=r}e[495]=0,e[494]=43124,m=0,Ae(95,t|0,1976),a=m,m=0;do if(!(a&1)&&(e[497]=0,e[496]=43164,m=0,Ae(96,t|0,1984),a=m,m=0,!(a&1))&&(e[499]=0,e[498]=44236,e[500]=0,S[2004]=0,a=nn()|0,e[500]=a,m=0,Ae(97,t|0,1992),a=m,m=0,!(a&1))&&(e[503]=0,e[502]=44484,m=0,Ae(98,t|0,2008),a=m,m=0,!(a&1))&&(e[505]=0,e[504]=44552,m=0,Ae(99,t|0,2016),a=m,m=0,!(a&1))&&(m=0,Ae(100,2024,1),a=m,m=0,!(a&1))&&(m=0,Ae(101,t|0,2024),a=m,m=0,!(a&1))&&(e[511]=0,e[510]=44600,m=0,Ae(102,t|0,2040),a=m,m=0,!(a&1))&&(e[513]=0,e[512]=44648,m=0,Ae(103,t|0,2048),a=m,m=0,!(a&1))&&(i4(2056,1),m=0,Ae(104,t|0,2056),a=m,m=0,!(a&1))&&(n4(2080,1),m=0,Ae(105,t|0,2080),a=m,m=0,!(a&1))&&(e[529]=0,e[528]=43204,m=0,Ae(106,t|0,2112),a=m,m=0,!(a&1))&&(e[531]=0,e[530]=43276,m=0,Ae(107,t|0,2120),a=m,m=0,!(a&1))&&(e[533]=0,e[532]=43348,m=0,Ae(108,t|0,2128),a=m,m=0,!(a&1))){if(e[535]=0,e[534]=43408,m=0,Ae(109,t|0,2136),a=m,m=0,a&1){d=42;break}if(e[537]=0,e[536]=43716,m=0,Ae(110,t|0,2144),a=m,m=0,a&1){d=42;break}if(e[539]=0,e[538]=43780,m=0,Ae(111,t|0,2152),a=m,m=0,a&1){d=42;break}if(e[541]=0,e[540]=43844,m=0,Ae(112,t|0,2160),a=m,m=0,a&1){d=42;break}if(e[543]=0,e[542]=43908,m=0,Ae(113,t|0,2168),a=m,m=0,a&1){d=42;break}if(e[545]=0,e[544]=43972,m=0,Ae(114,t|0,2176),a=m,m=0,a&1){d=42;break}if(e[547]=0,e[546]=44008,m=0,Ae(115,t|0,2184),a=m,m=0,a&1){d=42;break}if(e[549]=0,e[548]=44044,m=0,Ae(116,t|0,2192),a=m,m=0,a&1){d=42;break}if(e[551]=0,e[550]=44080,m=0,Ae(117,t|0,2200),a=m,m=0,a&1){d=42;break}if(e[553]=0,e[552]=43468,e[554]=43516,m=0,Ae(118,t|0,2208),a=m,m=0,a&1){d=42;break}if(e[557]=0,e[556]=43560,e[558]=43608,m=0,Ae(119,t|0,2224),a=m,m=0,a&1){d=42;break}if(e[561]=0,e[560]=44464,m=0,r=Ce(3)|0,a=m,m=0,a&1){r=j()|0;break}if(e[562]=r,e[560]=43652,m=0,Ae(120,t|0,2240),a=m,m=0,a&1){d=42;break}if(e[565]=0,e[564]=44464,m=0,r=Ce(3)|0,a=m,m=0,a&1){r=j()|0;break}if(e[566]=r,e[564]=43684,m=0,Ae(121,t|0,2256),d=m,m=0,d&1){d=42;break}if(e[569]=0,e[568]=44116,m=0,Ae(122,t|0,2272),d=m,m=0,d&1){d=42;break}if(e[571]=0,e[570]=44156,m=0,Ae(123,t|0,2280),d=m,m=0,d&1){d=42;break}return}else d=42;while(!1);(d|0)==42&&(r=j()|0),de(l)}yr(h)}le(r|0)}function Ph(){var t=0;do if(!(S[2288]|0)&&kt(2288)|0)if(m=0,Ce(4)|0,t=m,m=0,t&1)t=j()|0,W0(2288),le(t|0);else{e[11246]=44980,Dt(2288);break}while(!1);return e[11246]|0}function w0(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;pn(r),l=t+8|0,a=e[l>>2]|0;do if((e[t+12>>2]|0)-a>>2>>>0<=o>>>0){if(m=0,Ae(124,l|0,o+1|0),t=m,m=0,!(t&1)){a=e[l>>2]|0;break}a=j()|0,r&&Bt(r)|0,le(a|0)}while(!1);t=e[a+(o<<2)>>2]|0,t&&(Bt(t)|0,a=e[l>>2]|0),e[a+(o<<2)>>2]=r}function Rs(t){t=t|0;var r=0,o=0,a=0,l=0;if(e[t>>2]=44196,a=t+8|0,l=t+12|0,r=e[a>>2]|0,(e[l>>2]|0)!=(r|0)){o=0;do r=e[r+(o<<2)>>2]|0,r&&Bt(r)|0,o=o+1|0,r=e[a>>2]|0;while(o>>>0<(e[l>>2]|0)-r>>2>>>0)}de(t+144|0),yr(a)}function Lh(t){t=t|0,Rs(t),he(t)}function Oh(t,r){return t=t|0,r=r|0,P3(t,r)|0?e[(e[t+8>>2]|0)+(r<<2)>>2]|0:(t=Ct(4)|0,B6(t),Qt(t|0,640,82),0)}function $h(){return _h(2296,1),e[11245]=2296,44980}function Bh(){var t=0;return t=Ph()|0,t=e[t>>2]|0,e[11247]=t,pn(t),44988}function Vh(){var t=0;do if(!(S[2456]|0)&&kt(2456)|0)if(m=0,Ce(5)|0,t=m,m=0,t&1)t=j()|0,W0(2456),le(t|0);else{e[11248]=44988,Dt(2456);break}while(!1);return e[11248]|0}function ur(t){t=t|0;var r=0,o=0;if(m=0,r=Ce(6)|0,o=m,m=0,o&1)o=j(0)|0,$t(o);else{o=e[r>>2]|0,e[t>>2]=o,pn(o);return}}function tn(t,r){t=t|0,r=r|0,r=e[r>>2]|0,e[t>>2]=r,pn(r)}function _0(t){t=t|0,Bt(e[t>>2]|0)|0}function x0(t){t=t|0;var r=0,o=0;return o=b,b=b+16|0,r=o,(e[t>>2]|0)!=-1&&(e[r>>2]=t,e[r+4>>2]=191,e[r+8>>2]=0,gp(t,r,192)),b=o,(e[t+4>>2]|0)+-1|0}function O0(t,r){return t=t|0,r=r|0,t=e[t>>2]|0,Oh(t,x0(r)|0)|0}function Uh(t){t=t|0,he(t)}function Gh(t){t=t|0,t&&Rt[e[(e[t>>2]|0)+4>>2]&255](t)}function qh(t){t=t|0;var r=0;r=e[11052]|0,e[11052]=r+1,e[t+4>>2]=r+1}function Wh(t){t=t|0,he(t)}function Hh(t,r,o){return t=t|0,r=r|0,o=o|0,o>>>0<128?(o=(nn()|0)+(o<<1)|0,o=(k[o>>1]&r)<<16>>16!=0):o=0,o|0}function nn(){var t=0,r=0;if(m=0,t=Ce(7)|0,r=m,m=0,r&1)r=j(0)|0,$t(r);else return e[t>>2]|0;return 0}function Qh(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(h=(o-r|0)>>>2,(r|0)!=(o|0))for(l=r;t=e[l>>2]|0,t>>>0<128?(t=(nn()|0)+(t<<1)|0,t=M[t>>1]|0):t=0,k[a>>1]=t,l=l+4|0,(l|0)!=(o|0);)a=a+2|0;return r+(h<<2)|0}function Kh(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;e:do if((o|0)==(a|0))o=a;else for(;;){if(t=e[o>>2]|0,t>>>0<128&&(t=(nn()|0)+(t<<1)|0,(k[t>>1]&r)<<16>>16!=0))break e;if(o=o+4|0,(o|0)==(a|0)){o=a;break}}while(!1);return o|0}function Yh(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;e:do if((o|0)==(a|0))o=a;else for(;;){if(t=e[o>>2]|0,t>>>0>=128||(t=(nn()|0)+(t<<1)|0,!((k[t>>1]&r)<<16>>16)))break e;if(o=o+4|0,(o|0)==(a|0)){o=a;break}}while(!1);return o|0}function jh(t,r){return t=t|0,r=r|0,r>>>0<128&&(r=(hn()|0)+(r<<2)|0,r=e[r>>2]|0),r|0}function hn(){var t=0,r=0;if(m=0,t=Ce(8)|0,r=m,m=0,r&1)r=j(0)|0,$t(r);else return e[t>>2]|0;return 0}function Xh(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;if(l=(o-r|0)>>>2,(r|0)!=(o|0)){a=r;do t=e[a>>2]|0,t>>>0<128&&(t=(hn()|0)+(t<<2)|0,t=e[t>>2]|0),e[a>>2]=t,a=a+4|0;while((a|0)!=(o|0))}return r+(l<<2)|0}function Zh(t,r){return t=t|0,r=r|0,r>>>0<128&&(r=(dn()|0)+(r<<2)|0,r=e[r>>2]|0),r|0}function dn(){var t=0,r=0;if(m=0,t=Ce(9)|0,r=m,m=0,r&1)r=j(0)|0,$t(r);else return e[t>>2]|0;return 0}function Jh(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;if(l=(o-r|0)>>>2,(r|0)!=(o|0)){a=r;do t=e[a>>2]|0,t>>>0<128&&(t=(dn()|0)+(t<<2)|0,t=e[t>>2]|0),e[a>>2]=t,a=a+4|0;while((a|0)!=(o|0))}return r+(l<<2)|0}function ed(t,r){return t=t|0,r=r|0,r<<24>>24|0}function id(t,r,o,a){if(t=t|0,r=r|0,o=o|0,a=a|0,(r|0)!=(o|0))for(;e[a>>2]=S[r>>0],r=r+1|0,(r|0)!=(o|0);)a=a+4|0;return o|0}function nd(t,r,o){return t=t|0,r=r|0,o=o|0,(r>>>0<128?r&255:o)|0}function rd(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;if(d=(o-r|0)>>>2,(r|0)!=(o|0))for(h=r,t=l;l=e[h>>2]|0,S[t>>0]=l>>>0<128?l&255:a,h=h+4|0,(h|0)!=(o|0);)t=t+1|0;return r+(d<<2)|0}function Ms(t){t=t|0;var r=0;e[t>>2]=44236,r=e[t+8>>2]|0,r|0&&S[t+12>>0]|0&&F6(r)}function sd(t){t=t|0,Ms(t),he(t)}function od(t,r){return t=t|0,r=r|0,r<<24>>24>-1&&(r=(hn()|0)+((r&255)<<2)|0,r=e[r>>2]&255),r|0}function ad(t,r,o){if(t=t|0,r=r|0,o=o|0,(r|0)!=(o|0)){t=r;do r=S[t>>0]|0,r<<24>>24>-1&&(r=(hn()|0)+(r<<24>>24<<2)|0,r=e[r>>2]&255),S[t>>0]=r,t=t+1|0;while((t|0)!=(o|0))}return o|0}function ld(t,r){return t=t|0,r=r|0,r<<24>>24>-1&&(r=(dn()|0)+(r<<24>>24<<2)|0,r=e[r>>2]&255),r|0}function ud(t,r,o){if(t=t|0,r=r|0,o=o|0,(r|0)!=(o|0)){t=r;do r=S[t>>0]|0,r<<24>>24>-1&&(r=(dn()|0)+(r<<24>>24<<2)|0,r=e[r>>2]&255),S[t>>0]=r,t=t+1|0;while((t|0)!=(o|0))}return o|0}function cd(t,r){return t=t|0,r=r|0,r|0}function hd(t,r,o,a){if(t=t|0,r=r|0,o=o|0,a=a|0,(r|0)!=(o|0))for(;S[a>>0]=S[r>>0]|0,r=r+1|0,(r|0)!=(o|0);)a=a+1|0;return o|0}function dd(t,r,o){return t=t|0,r=r|0,o=o|0,(r<<24>>24>-1?r:o)|0}function pd(t,r,o,a,l){if(t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,(r|0)!=(o|0))for(;t=S[r>>0]|0,S[l>>0]=t<<24>>24>-1?t:a,r=r+1|0,(r|0)!=(o|0);)l=l+1|0;return o|0}function md(t){t=t|0,he(t)}function gd(t,r,o,a,l,h,d,w){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,e[l>>2]=o,e[w>>2]=h,3}function Sd(t,r,o,a,l,h,d,w){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,e[l>>2]=o,e[w>>2]=h,3}function Ad(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,e[l>>2]=o,3}function vd(t){return t=t|0,1}function xd(t){return t=t|0,1}function wd(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,t=a-o|0,(t>>>0>>0?t:l)|0}function yd(t){return t=t|0,1}function Cd(t,r){t=t|0,r=r|0;var o=0;if(e[t+4>>2]=r+-1,e[t>>2]=44304,m=0,r=Ce(3)|0,o=m,m=0,o&1)o=j()|0,le(o|0);else{e[t+8>>2]=r;return}}function Td(t){t=t|0,io(t),he(t)}function cr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0,c0=0,a0=0,h0=0,D0=0,A0=0,Ti=0,N0=0,Si=0;Si=b,b=b+624|0,h0=Si+24|0,A0=Si+16|0,D0=Si+588|0,Oe=Si+576|0,a0=Si,y0=Si+536|0,N0=Si+8|0,Ti=Si+528|0,jt=(t|0)!=0,Gt=y0+40|0,At=Gt,y0=y0+39|0,T0=N0+4|0,g0=Oe+12|0,Oe=Oe+11|0,yt=D0,qt=g0,c0=qt-yt|0,s0=-2-yt|0,i0=qt+2|0,zt=h0+288|0,gt=D0+9|0,Kt=gt,pt=D0+8|0,h=0,H=r,d=0,r=0;e:for(;;){do if((h|0)>-1)if((d|0)>(2147483647-h|0)){h=S0()|0,e[h>>2]=75,h=-1;break}else{h=d+h|0;break}while(!1);if(d=S[H>>0]|0,d<<24>>24)w=H;else{it=245;break}t:for(;;){switch(d<<24>>24){case 37:{d=w,it=9;break t}case 0:{d=w;break t}default:}Te=w+1|0,d=S[Te>>0]|0,w=Te}t:do if((it|0)==9)for(;;){if(it=0,(S[d+1>>0]|0)!=37)break t;if(w=w+1|0,d=d+2|0,(S[d>>0]|0)==37)it=9;else break}while(!1);if(G=w-H|0,jt&&!(e[t>>2]&32|0)&&B0(H,G,t)|0,(w|0)!=(H|0)){H=d,d=G;continue}E=d+1|0,w=S[E>>0]|0,C=(w<<24>>24)+-48|0,C>>>0<10?(Te=(S[d+2>>0]|0)==36,E=Te?d+3|0:E,w=S[E>>0]|0,_=Te?C:-1,r=Te?1:r):_=-1,d=w<<24>>24;t:do if((d&-32|0)==32)for(C=0;;){if(!(1<>24)+-32|C,E=E+1|0,w=S[E>>0]|0,d=w<<24>>24,(d&-32|0)!=32){F=C,d=E;break}}else F=0,d=E;while(!1);do if(w<<24>>24==42){if(C=d+1|0,w=(S[C>>0]|0)+-48|0,w>>>0<10&&(S[d+2>>0]|0)==36)e[l+(w<<2)>>2]=10,r=1,d=d+3|0,w=e[a+((S[C>>0]|0)+-48<<3)>>2]|0;else{if(r){h=-1;break e}if(!jt){K=F,d=C,r=0,Te=0;break}r=(e[o>>2]|0)+3&-4,w=e[r>>2]|0,e[o>>2]=r+4,r=0,d=C}(w|0)<0?(K=F|8192,Te=0-w|0):(K=F,Te=w)}else if(C=(w<<24>>24)+-48|0,C>>>0<10){w=0;do w=(w*10|0)+C|0,d=d+1|0,C=(S[d>>0]|0)+-48|0;while(C>>>0<10);if((w|0)<0){h=-1;break e}else K=F,Te=w}else K=F,Te=0;while(!1);t:do if((S[d>>0]|0)==46){if(C=d+1|0,w=S[C>>0]|0,w<<24>>24!=42){if(E=(w<<24>>24)+-48|0,E>>>0<10)d=C,w=0;else{d=C,E=0;break}for(;;)if(w=(w*10|0)+E|0,d=d+1|0,E=(S[d>>0]|0)+-48|0,E>>>0>=10){E=w;break t}}if(C=d+2|0,w=(S[C>>0]|0)+-48|0,w>>>0<10&&(S[d+3>>0]|0)==36){e[l+(w<<2)>>2]=10,d=d+4|0,E=e[a+((S[C>>0]|0)+-48<<3)>>2]|0;break}if(r){h=-1;break e}jt?(d=(e[o>>2]|0)+3&-4,E=e[d>>2]|0,e[o>>2]=d+4,d=C):(d=C,E=0)}else E=-1;while(!1);for(R=0;;){if(w=(S[d>>0]|0)+-65|0,w>>>0>57){h=-1;break e}if(C=d+1|0,w=S[56223+(R*58|0)+w>>0]|0,F=w&255,(F+-1|0)>>>0<8)d=C,R=F;else{ke=C;break}}if(!(w<<24>>24)){h=-1;break}C=(_|0)>-1;do if(w<<24>>24==19)if(C){h=-1;break e}else it=52;else{if(C){e[l+(_<<2)>>2]=F,ce=a+(_<<3)|0,Ee=e[ce+4>>2]|0,it=a0,e[it>>2]=e[ce>>2],e[it+4>>2]=Ee,it=52;break}if(!jt){h=0;break e}Ps(a0,F,o)}while(!1);if((it|0)==52&&(it=0,!jt)){H=ke,d=G;continue}_=S[d>>0]|0,_=(R|0)!=0&(_&15|0)==3?_&-33:_,C=K&-65537,Ee=K&8192|0?C:K;t:do switch(_|0){case 110:switch(R|0){case 0:{e[e[a0>>2]>>2]=h,H=ke,d=G;continue e}case 1:{e[e[a0>>2]>>2]=h,H=ke,d=G;continue e}case 2:{H=e[a0>>2]|0,e[H>>2]=h,e[H+4>>2]=((h|0)<0)<<31>>31,H=ke,d=G;continue e}case 3:{k[e[a0>>2]>>1]=h,H=ke,d=G;continue e}case 4:{S[e[a0>>2]>>0]=h,H=ke,d=G;continue e}case 6:{e[e[a0>>2]>>2]=h,H=ke,d=G;continue e}case 7:{H=e[a0>>2]|0,e[H>>2]=h,e[H+4>>2]=((h|0)<0)<<31>>31,H=ke,d=G;continue e}default:{H=ke,d=G;continue e}}case 112:{R=Ee|8,E=E>>>0>8?E:8,_=120,it=64;break}case 88:case 120:{R=Ee,it=64;break}case 111:{if(C=a0,w=e[C>>2]|0,C=e[C+4>>2]|0,(w|0)==0&(C|0)==0)d=Gt;else{d=Gt;do d=d+-1|0,S[d>>0]=w&7|48,w=Di(w|0,C|0,3)|0,C=ye;while(!((w|0)==0&(C|0)==0))}Ee&8?(R=At-d+1|0,w=Ee,E=(E|0)<(R|0)?R:E,R=0,F=56703,it=77):(w=Ee,R=0,F=56703,it=77);break}case 105:case 100:{if(w=a0,d=e[w>>2]|0,w=e[w+4>>2]|0,(w|0)<0){d=ii(0,0,d|0,w|0)|0,w=ye,C=a0,e[C>>2]=d,e[C+4>>2]=w,C=1,F=56703,it=76;break t}Ee&2048?(C=1,F=56704,it=76):(F=Ee&1,C=F,F=F|0?56705:56703,it=76);break}case 117:{w=a0,d=e[w>>2]|0,w=e[w+4>>2]|0,C=0,F=56703,it=76;break}case 99:{S[y0>>0]=e[a0>>2],H=y0,w=1,R=0,_=56703,d=Gt;break}case 109:{d=S0()|0,d=vo(e[d>>2]|0)|0,it=82;break}case 115:{d=e[a0>>2]|0,d=d|0?d:56713,it=82;break}case 67:{e[N0>>2]=e[a0>>2],e[T0>>2]=0,e[a0>>2]=N0,E=-1,it=86;break}case 83:{E?it=86:(z0(t,32,Te,0,Ee),d=0,it=98);break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{D=+B[a0>>3],e[A0>>2]=0,B[q>>3]=D,(e[q+4>>2]|0)>=0?Ee&2048?(re=1,ce=56723):(ce=Ee&1,re=ce,ce=ce|0?56726:56721):(D=-D,re=1,ce=56720),B[q>>3]=D,ae=e[q+4>>2]&2146435072;do if(ae>>>0<2146435072|(ae|0)==2146435072&!1){if(U=+yS(D,A0)*2,w=U!=0,w&&(e[A0>>2]=(e[A0>>2]|0)+-1),J=_|32,(J|0)==97){H=_&32,G=H|0?ce+9|0:ce,K=re|2,d=12-E|0;do if(E>>>0>11|(d|0)==0)D=U;else{D=8;do d=d+-1|0,D=D*16;while(d|0);if((S[G>>0]|0)==45){D=-(D+(-U-D));break}else{D=U+D-D;break}}while(!1);for(w=e[A0>>2]|0,d=(w|0)<0?0-w|0:w,d=zi(d,((d|0)<0)<<31>>31,g0)|0,(d|0)==(g0|0)&&(S[Oe>>0]=48,d=Oe),S[d+-1>>0]=(w>>31&2)+43,R=d+-2|0,S[R>>0]=_+15,F=(E|0)<1,C=(Ee&8|0)==0,w=D0;;){ce=~~D,d=w+1|0,S[w>>0]=N[56687+ce>>0]|H,D=(D-+(ce|0))*16;do if((d-yt|0)==1){if(C&(F&D==0))break;S[d>>0]=46,d=w+2|0}while(!1);if(D==0)break;w=d}E=(E|0)!=0&(s0+d|0)<(E|0)?i0+E-R|0:c0-R+d|0,C=E+K|0,z0(t,32,Te,C,Ee),e[t>>2]&32||B0(G,K,t)|0,z0(t,48,Te,C,Ee^65536),d=d-yt|0,e[t>>2]&32||B0(D0,d,t)|0,w=qt-R|0,z0(t,48,E-(d+w)|0,0,0),e[t>>2]&32||B0(R,w,t)|0,z0(t,32,Te,C,Ee^8192),d=(C|0)<(Te|0)?Te:C;break}d=(E|0)<0?6:E,w?(w=(e[A0>>2]|0)+-28|0,e[A0>>2]=w,D=U*268435456):(D=U,w=e[A0>>2]|0),ae=(w|0)<0?h0:zt,ne=ae,w=ae;do L=~~D>>>0,e[w>>2]=L,w=w+4|0,D=(D-+(L>>>0))*1e9;while(D!=0);if(C=w,w=e[A0>>2]|0,(w|0)>0)for(F=ae;;){R=(w|0)>29?29:w,E=C+-4|0;do if(E>>>0>>0)E=F;else{w=0;do L=v0(e[E>>2]|0,0,R|0)|0,L=$0(L|0,ye|0,w|0,0)|0,w=ye,P=Cr(L|0,w|0,1e9,0)|0,e[E>>2]=P,w=xn(L|0,w|0,1e9,0)|0,E=E+-4|0;while(E>>>0>=F>>>0);if(!w){E=F;break}E=F+-4|0,e[E>>2]=w}while(!1);for(;!(C>>>0<=E>>>0);)if(w=C+-4|0,!(e[w>>2]|0))C=w;else break;if(w=(e[A0>>2]|0)-R|0,e[A0>>2]=w,(w|0)>0)F=E;else break}else E=ae;if((w|0)<0)for(G=((d+25|0)/9|0)+1|0,$=(J|0)==102,H=E;;){K=0-w|0,K=(K|0)>9?9:K;do if(H>>>0>>0){w=(1<>>K,E=0,R=H;do L=e[R>>2]|0,e[R>>2]=(L>>>K)+E,E=ie(L&w,F)|0,R=R+4|0;while(R>>>0>>0);if(w=e[H>>2]|0?H:H+4|0,!E){E=w;break}e[C>>2]=E,E=w,C=C+4|0}else E=e[H>>2]|0?H:H+4|0;while(!1);if(w=$?ae:E,C=(C-w>>2|0)>(G|0)?w+(G<<2)|0:C,w=(e[A0>>2]|0)+K|0,e[A0>>2]=w,(w|0)>=0){H=E;break}else H=E}else H=E;do if(H>>>0>>0){if(w=(ne-H>>2)*9|0,F=e[H>>2]|0,F>>>0<10)break;E=10;do E=E*10|0,w=w+1|0;while(F>>>0>=E>>>0)}else w=0;while(!1);if(P=(J|0)==103,L=(d|0)!=0,E=d-((J|0)!=102?w:0)+((L&P)<<31>>31)|0,(E|0)<(((C-ne>>2)*9|0)+-9|0)){if(R=E+9216|0,$=(R|0)/9|0,E=ae+($+-1023<<2)|0,R=((R|0)%9|0)+1|0,(R|0)<9){F=10;do F=F*10|0,R=R+1|0;while((R|0)!=9)}else F=10;K=e[E>>2]|0,G=(K>>>0)%(F>>>0)|0,!(G|0)&&(ae+($+-1022<<2)|0)==(C|0)?F=H:it=163;do if((it|0)==163){it=0,U=((K>>>0)/(F>>>0)|0)&1|0?9007199254740994:9007199254740992,R=(F|0)/2|0;do if(G>>>0>>0)D=.5;else{if((G|0)==(R|0)&&(ae+($+-1022<<2)|0)==(C|0)){D=1;break}D=1.5}while(!1);do if(re){if((S[ce>>0]|0)!=45)break;U=-U,D=-D}while(!1);if(R=K-G|0,e[E>>2]=R,U+D==U){F=H;break}if(J=R+F|0,e[E>>2]=J,J>>>0>999999999)for(w=H;;)if(F=E+-4|0,e[E>>2]=0,F>>>0>>0&&(w=w+-4|0,e[w>>2]=0),J=(e[F>>2]|0)+1|0,e[F>>2]=J,J>>>0>999999999)E=F;else{H=w,E=F;break}if(w=(ne-H>>2)*9|0,R=e[H>>2]|0,R>>>0<10){F=H;break}else F=10;do F=F*10|0,w=w+1|0;while(R>>>0>=F>>>0);F=H}while(!1);J=E+4|0,H=F,C=C>>>0>J>>>0?J:C}for(G=0-w|0;;){if(C>>>0<=H>>>0){$=0,J=C;break}if(E=C+-4|0,!(e[E>>2]|0))C=E;else{$=1,J=C;break}}do if(P){if(d=(L&1^1)+d|0,(d|0)>(w|0)&(w|0)>-5?(_=_+-1|0,d=d+-1-w|0):(_=_+-2|0,d=d+-1|0),C=Ee&8,C)break;do if($){if(C=e[J+-4>>2]|0,!C){E=9;break}if(!((C>>>0)%10|0))F=10,E=0;else{E=0;break}do F=F*10|0,E=E+1|0;while(!((C>>>0)%(F>>>0)|0|0))}else E=9;while(!1);if(C=((J-ne>>2)*9|0)+-9|0,(_|32|0)==102){C=C-E|0,C=(C|0)<0?0:C,d=(d|0)<(C|0)?d:C,C=0;break}else{C=C+w-E|0,C=(C|0)<0?0:C,d=(d|0)<(C|0)?d:C,C=0;break}}else C=Ee&8;while(!1);if(K=d|C,F=(K|0)!=0&1,R=(_|32|0)==102,R)w=(w|0)>0?w:0,_=0;else{if(E=(w|0)<0?G:w,E=zi(E,((E|0)<0)<<31>>31,g0)|0,(qt-E|0)<2)do E=E+-1|0,S[E>>0]=48;while((qt-E|0)<2);S[E+-1>>0]=(w>>31&2)+43,ne=E+-2|0,S[ne>>0]=_,w=qt-ne|0,_=ne}G=re+1+d+F+w|0,z0(t,32,Te,G,Ee),e[t>>2]&32||B0(ce,re,t)|0,z0(t,48,Te,G,Ee^65536);do if(R){E=H>>>0>ae>>>0?ae:H,w=E;do{C=zi(e[w>>2]|0,0,gt)|0;do if((w|0)==(E|0)){if((C|0)!=(gt|0))break;S[pt>>0]=48,C=pt}else{if(C>>>0<=D0>>>0)break;do C=C+-1|0,S[C>>0]=48;while(C>>>0>D0>>>0)}while(!1);e[t>>2]&32||B0(C,Kt-C|0,t)|0,w=w+4|0}while(w>>>0<=ae>>>0);do if(K){if(e[t>>2]&32)break;B0(56755,1,t)|0}while(!1);if((d|0)>0&w>>>0>>0)for(C=w;;){if(w=zi(e[C>>2]|0,0,gt)|0,w>>>0>D0>>>0)do w=w+-1|0,S[w>>0]=48;while(w>>>0>D0>>>0);if(e[t>>2]&32||B0(w,(d|0)>9?9:d,t)|0,C=C+4|0,w=d+-9|0,(d|0)>9&C>>>0>>0)d=w;else{d=w;break}}z0(t,48,d+9|0,9,0)}else{if(R=$?J:H+4|0,(d|0)>-1){F=(C|0)==0,E=H;do{w=zi(e[E>>2]|0,0,gt)|0,(w|0)==(gt|0)&&(S[pt>>0]=48,w=pt);do if((E|0)==(H|0)){if(C=w+1|0,e[t>>2]&32||B0(w,1,t)|0,F&(d|0)<1){w=C;break}if(e[t>>2]&32){w=C;break}B0(56755,1,t)|0,w=C}else{if(w>>>0<=D0>>>0)break;do w=w+-1|0,S[w>>0]=48;while(w>>>0>D0>>>0)}while(!1);C=Kt-w|0,e[t>>2]&32||B0(w,(d|0)>(C|0)?C:d,t)|0,d=d-C|0,E=E+4|0}while(E>>>0>>0&(d|0)>-1)}if(z0(t,48,d+18|0,18,0),e[t>>2]&32)break;B0(_,qt-_|0,t)|0}while(!1);z0(t,32,Te,G,Ee^8192),d=(G|0)<(Te|0)?Te:G}else R=(_&32|0)!=0,F=D!=D|!1,w=F?0:re,E=w+3|0,z0(t,32,Te,E,C),d=e[t>>2]|0,d&32||(B0(ce,w,t)|0,d=e[t>>2]|0),d&32||B0(F?R?56747:56751:R?56739:56743,3,t)|0,z0(t,32,Te,E,Ee^8192),d=(E|0)<(Te|0)?Te:E;while(!1);H=ke;continue e}default:C=Ee,w=E,R=0,_=56703,d=Gt}while(!1);t:do if((it|0)==64)if(C=a0,w=e[C>>2]|0,C=e[C+4>>2]|0,F=_&32,(w|0)==0&(C|0)==0)d=Gt,w=R,R=0,F=56703,it=77;else{d=Gt;do d=d+-1|0,S[d>>0]=N[56687+(w&15)>>0]|F,w=Di(w|0,C|0,4)|0,C=ye;while(!((w|0)==0&(C|0)==0));it=a0,(R&8|0)==0|(e[it>>2]|0)==0&(e[it+4>>2]|0)==0?(w=R,R=0,F=56703,it=77):(w=R,R=2,F=56703+(_>>4)|0,it=77)}else if((it|0)==76)d=zi(d,w,Gt)|0,w=Ee,R=C,it=77;else if((it|0)==82)it=0,Ee=Oo(d,0,E)|0,ce=(Ee|0)==0,H=d,w=ce?E:Ee-d|0,R=0,_=56703,d=ce?d+E|0:Ee;else if((it|0)==86){for(it=0,w=0,d=0,F=e[a0>>2]|0;C=e[F>>2]|0,!(!C||(d=Do(Ti,C)|0,(d|0)<0|d>>>0>(E-w|0)>>>0));)if(w=d+w|0,E>>>0>w>>>0)F=F+4|0;else break;if((d|0)<0){h=-1;break e}if(z0(t,32,Te,w,Ee),!w)d=0,it=98;else for(C=0,E=e[a0>>2]|0;;){if(d=e[E>>2]|0,!d){d=w,it=98;break t}if(d=Do(Ti,d)|0,C=d+C|0,(C|0)>(w|0)){d=w,it=98;break t}if(e[t>>2]&32||B0(Ti,d,t)|0,C>>>0>=w>>>0){d=w,it=98;break}else E=E+4|0}}while(!1);if((it|0)==98){it=0,z0(t,32,Te,d,Ee^8192),H=ke,d=(Te|0)>(d|0)?Te:d;continue}(it|0)==77&&(it=0,C=(E|0)>-1?w&-65537:w,w=a0,w=(e[w>>2]|0)!=0|(e[w+4>>2]|0)!=0,(E|0)!=0|w?(w=(w&1^1)+(At-d)|0,H=d,w=(E|0)>(w|0)?E:w,_=F,d=Gt):(H=Gt,w=0,_=F,d=Gt)),F=d-H|0,w=(w|0)<(F|0)?F:w,E=R+w|0,d=(Te|0)<(E|0)?E:Te,z0(t,32,d,E,C),e[t>>2]&32||B0(_,R,t)|0,z0(t,48,d,E,C^65536),z0(t,48,w,F,0),e[t>>2]&32||B0(H,F,t)|0,z0(t,32,d,E,C^8192),H=ke}e:do if((it|0)==245&&!t)if(r){for(h=1;r=e[l+(h<<2)>>2]|0,!!r;)if(Ps(a+(h<<3)|0,r,o),h=h+1|0,(h|0)>=10){h=1;break e}if((h|0)<10)for(;;){if(e[l+(h<<2)>>2]|0){h=-1;break e}if(h=h+1|0,(h|0)>=10){h=1;break}}else h=1}else h=0;while(!1);return b=Si,h|0}function Id(t,r,o){return t=t|0,r=r|0,o=o|0,_S(t,r,o)|0}function kd(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+112|0,d=w,l=d,h=l+112|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(h|0));return l=d+4|0,e[l>>2]=t,h=d+8|0,e[h>>2]=-1,e[d+44>>2]=t,e[d+76>>2]=-1,oi(d,0),a=+xo(d,o,1),o=(e[l>>2]|0)-(e[h>>2]|0)+(e[d+108>>2]|0)|0,r&&(e[r>>2]=o|0?t+o|0:t),b=w,+a}function _s(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0;return C=b,b=b+112|0,w=C,e[w>>2]=0,h=w+4|0,e[h>>2]=t,e[w+44>>2]=t,d=w+8|0,e[d>>2]=(t|0)<0?-1:t+2147483647|0,e[w+76>>2]=-1,oi(w,0),a=wo(w,o,1,a,l)|0,r&&(e[r>>2]=t+((e[h>>2]|0)+(e[w+108>>2]|0)-(e[d>>2]|0))),b=C,a|0}function Ed(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return a=t+20|0,l=e[a>>2]|0,t=(e[t+16>>2]|0)-l|0,t=t>>>0>o>>>0?o:t,o0(l|0,r|0,t|0)|0,e[a>>2]=(e[a>>2]|0)+t,o|0}function Ps(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;e:do if(r>>>0<=20)do switch(r|0){case 9:{a=(e[o>>2]|0)+3&-4,r=e[a>>2]|0,e[o>>2]=a+4,e[t>>2]=r;break e}case 10:{a=(e[o>>2]|0)+3&-4,r=e[a>>2]|0,e[o>>2]=a+4,a=t,e[a>>2]=r,e[a+4>>2]=((r|0)<0)<<31>>31;break e}case 11:{a=(e[o>>2]|0)+3&-4,r=e[a>>2]|0,e[o>>2]=a+4,a=t,e[a>>2]=r,e[a+4>>2]=0;break e}case 12:{a=(e[o>>2]|0)+7&-8,r=a,l=e[r>>2]|0,r=e[r+4>>2]|0,e[o>>2]=a+8,a=t,e[a>>2]=l,e[a+4>>2]=r;break e}case 13:{l=(e[o>>2]|0)+3&-4,a=e[l>>2]|0,e[o>>2]=l+4,a=(a&65535)<<16>>16,l=t,e[l>>2]=a,e[l+4>>2]=((a|0)<0)<<31>>31;break e}case 14:{l=(e[o>>2]|0)+3&-4,a=e[l>>2]|0,e[o>>2]=l+4,l=t,e[l>>2]=a&65535,e[l+4>>2]=0;break e}case 15:{l=(e[o>>2]|0)+3&-4,a=e[l>>2]|0,e[o>>2]=l+4,a=(a&255)<<24>>24,l=t,e[l>>2]=a,e[l+4>>2]=((a|0)<0)<<31>>31;break e}case 16:{l=(e[o>>2]|0)+3&-4,a=e[l>>2]|0,e[o>>2]=l+4,l=t,e[l>>2]=a&255,e[l+4>>2]=0;break e}case 17:{l=(e[o>>2]|0)+7&-8,h=+B[l>>3],e[o>>2]=l+8,B[t>>3]=h;break e}case 18:{l=(e[o>>2]|0)+7&-8,h=+B[l>>3],e[o>>2]=l+8,B[t>>3]=h;break e}default:break e}while(!1);while(!1)}function zi(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(r>>>0>0|(r|0)==0&t>>>0>4294967295)for(;;)if(a=Cr(t|0,r|0,10,0)|0,o=o+-1|0,S[o>>0]=a|48,a=xn(t|0,r|0,10,0)|0,r>>>0>9|(r|0)==9&t>>>0>4294967295)t=a,r=ye;else{t=a;break}if(t)for(;o=o+-1|0,S[o>>0]=(t>>>0)%10|0|48,!(t>>>0<10);)t=(t>>>0)/10|0;return o|0}function z0(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0;w=b,b=b+256|0,d=w;do if((o|0)>(a|0)&(l&73728|0)==0){if(l=o-a|0,Jt(d|0,r|0,(l>>>0>256?256:l)|0)|0,r=e[t>>2]|0,h=(r&32|0)==0,l>>>0>255){a=o-a|0;do h&&(B0(d,256,t)|0,r=e[t>>2]|0),l=l+-256|0,h=(r&32|0)==0;while(l>>>0>255);if(h)l=a&255;else break}else if(!h)break;B0(d,l,t)|0}while(!1);b=w}function E0(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0;do if(t>>>0<245){if(_=t>>>0<11?16:t+11&-8,t=_>>>3,w=e[10218]|0,o=w>>>t,o&3){t=(o&1^1)+t|0,a=t<<1,o=40912+(a<<2)|0,a=40912+(a+2<<2)|0,l=e[a>>2]|0,h=l+8|0,d=e[h>>2]|0;do if((o|0)!=(d|0))if(d>>>0<(e[10222]|0)>>>0&&St(),r=d+12|0,(e[r>>2]|0)==(l|0)){e[r>>2]=o,e[a>>2]=d;break}else St();else e[10218]=w&~(1<>2]=pt|3,pt=l+(pt|4)|0,e[pt>>2]=e[pt>>2]|1,pt=h,pt|0}if(d=e[10220]|0,_>>>0>d>>>0){if(o){a=2<>>12&16,a=a>>>C,l=a>>>5&8,a=a>>>l,h=a>>>2&4,a=a>>>h,o=a>>>1&2,a=a>>>o,t=a>>>1&1,t=(l|C|h|o|t)+(a>>>t)|0,a=t<<1,o=40912+(a<<2)|0,a=40912+(a+2<<2)|0,h=e[a>>2]|0,C=h+8|0,l=e[C>>2]|0;do if((o|0)!=(l|0))if(l>>>0<(e[10222]|0)>>>0&&St(),r=l+12|0,(e[r>>2]|0)==(h|0)){e[r>>2]=o,e[a>>2]=l,D=e[10220]|0;break}else St();else e[10218]=w&~(1<>2]=_|3,w=h+_|0,e[h+(_|4)>>2]=d|1,e[h+pt>>2]=d,D&&(l=e[10223]|0,o=D>>>3,r=o<<1,a=40912+(r<<2)|0,t=e[10218]|0,o=1<>2]|0,r>>>0<(e[10222]|0)>>>0?St():(E=t,F=r)):(e[10218]=t|o,E=40912+(r+2<<2)|0,F=a),e[E>>2]=l,e[F+12>>2]=l,e[l+8>>2]=F,e[l+12>>2]=a),e[10220]=d,e[10223]=w,pt=C,pt|0}if(t=e[10219]|0,t){for(o=(t&0-t)+-1|0,Kt=o>>>12&16,o=o>>>Kt,gt=o>>>5&8,o=o>>>gt,pt=o>>>2&4,o=o>>>pt,t=o>>>1&2,o=o>>>t,a=o>>>1&1,a=e[41176+((gt|Kt|pt|t|a)+(o>>>a)<<2)>>2]|0,o=(e[a+4>>2]&-8)-_|0,t=a;;){if(r=e[t+16>>2]|0,!r&&(r=e[t+20>>2]|0,!r)){C=o;break}t=(e[r+4>>2]&-8)-_|0,pt=t>>>0>>0,o=pt?t:o,t=r,a=pt?r:a}h=e[10222]|0,a>>>0>>0&&St(),w=a+_|0,a>>>0>=w>>>0&&St(),d=e[a+24>>2]|0,o=e[a+12>>2]|0;do if((o|0)==(a|0)){if(t=a+20|0,r=e[t>>2]|0,!r&&(t=a+16|0,r=e[t>>2]|0,!r)){R=0;break}for(;;){if(o=r+20|0,l=e[o>>2]|0,l){r=l,t=o;continue}if(o=r+16|0,l=e[o>>2]|0,l)r=l,t=o;else break}if(t>>>0>>0)St();else{e[t>>2]=0,R=r;break}}else if(l=e[a+8>>2]|0,l>>>0>>0&&St(),r=l+12|0,(e[r>>2]|0)!=(a|0)&&St(),t=o+8|0,(e[t>>2]|0)==(a|0)){e[r>>2]=o,e[t>>2]=l,R=o;break}else St();while(!1);do if(d){if(r=e[a+28>>2]|0,t=41176+(r<<2)|0,(a|0)==(e[t>>2]|0)){if(e[t>>2]=R,!R){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=d+16|0,(e[r>>2]|0)==(a|0)?e[r>>2]=R:e[d+20>>2]=R,!R)break;t=e[10222]|0,R>>>0>>0&&St(),e[R+24>>2]=d,r=e[a+16>>2]|0;do if(r)if(r>>>0>>0)St();else{e[R+16>>2]=r,e[r+24>>2]=R;break}while(!1);if(r=e[a+20>>2]|0,r)if(r>>>0<(e[10222]|0)>>>0)St();else{e[R+20>>2]=r,e[r+24>>2]=R;break}}while(!1);return C>>>0<16?(pt=C+_|0,e[a+4>>2]=pt|3,pt=a+(pt+4)|0,e[pt>>2]=e[pt>>2]|1):(e[a+4>>2]=_|3,e[a+(_|4)>>2]=C|1,e[a+(C+_)>>2]=C,r=e[10220]|0,r&&(h=e[10223]|0,o=r>>>3,r=o<<1,l=40912+(r<<2)|0,t=e[10218]|0,o=1<>2]|0,t>>>0<(e[10222]|0)>>>0?St():(U=r,H=t)):(e[10218]=t|o,U=40912+(r+2<<2)|0,H=l),e[U>>2]=h,e[H+12>>2]=h,e[h+8>>2]=H,e[h+12>>2]=l),e[10220]=C,e[10223]=w),pt=a+8|0,pt|0}else H=_}else H=_}else if(t>>>0<=4294967231)if(t=t+11|0,F=t&-8,E=e[10219]|0,E){o=0-F|0,t=t>>>8,t?F>>>0>16777215?D=31:(H=(t+1048320|0)>>>16&8,L=t<>>16&4,L=L<>>16&2,D=14-(U|H|D)+(L<>>15)|0,D=F>>>(D+7|0)&1|D<<1):D=0,t=e[41176+(D<<2)>>2]|0;e:do if(!t)l=0,t=0,L=86;else for(d=o,l=0,w=F<<((D|0)==31?0:25-(D>>>1)|0),C=t,t=0;;){if(h=e[C+4>>2]&-8,o=h-F|0,o>>>0>>0)if((h|0)==(F|0)){h=C,t=C,L=90;break e}else t=C;else o=d;if(L=e[C+20>>2]|0,C=e[C+16+(w>>>31<<2)>>2]|0,l=(L|0)==0|(L|0)==(C|0)?l:L,C)d=o,w=w<<1;else{L=86;break}}while(!1);if((L|0)==86){if((l|0)==0&(t|0)==0){if(t=2<>>12&16,t=t>>>R,E=t>>>5&8,t=t>>>E,U=t>>>2&4,t=t>>>U,H=t>>>1&2,t=t>>>H,l=t>>>1&1,l=e[41176+((E|R|U|H|l)+(t>>>l)<<2)>>2]|0,t=0}l?(h=l,L=90):(w=o,C=t)}if((L|0)==90)for(;;){if(L=0,H=(e[h+4>>2]&-8)-F|0,l=H>>>0>>0,o=l?H:o,t=l?h:t,l=e[h+16>>2]|0,l){h=l,L=90;continue}if(h=e[h+20>>2]|0,h)L=90;else{w=o,C=t;break}}if(C|0&&w>>>0<((e[10220]|0)-F|0)>>>0){l=e[10222]|0,C>>>0>>0&&St(),d=C+F|0,C>>>0>=d>>>0&&St(),h=e[C+24>>2]|0,o=e[C+12>>2]|0;do if((o|0)==(C|0)){if(t=C+20|0,r=e[t>>2]|0,!r&&(t=C+16|0,r=e[t>>2]|0,!r)){_=0;break}for(;;){if(o=r+20|0,a=e[o>>2]|0,a){r=a,t=o;continue}if(o=r+16|0,a=e[o>>2]|0,a)r=a,t=o;else break}if(t>>>0>>0)St();else{e[t>>2]=0,_=r;break}}else if(a=e[C+8>>2]|0,a>>>0>>0&&St(),r=a+12|0,(e[r>>2]|0)!=(C|0)&&St(),t=o+8|0,(e[t>>2]|0)==(C|0)){e[r>>2]=o,e[t>>2]=a,_=o;break}else St();while(!1);do if(h){if(r=e[C+28>>2]|0,t=41176+(r<<2)|0,(C|0)==(e[t>>2]|0)){if(e[t>>2]=_,!_){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=h+16|0,(e[r>>2]|0)==(C|0)?e[r>>2]=_:e[h+20>>2]=_,!_)break;t=e[10222]|0,_>>>0>>0&&St(),e[_+24>>2]=h,r=e[C+16>>2]|0;do if(r)if(r>>>0>>0)St();else{e[_+16>>2]=r,e[r+24>>2]=_;break}while(!1);if(r=e[C+20>>2]|0,r)if(r>>>0<(e[10222]|0)>>>0)St();else{e[_+20>>2]=r,e[r+24>>2]=_;break}}while(!1);e:do if(w>>>0>=16){if(e[C+4>>2]=F|3,e[C+(F|4)>>2]=w|1,e[C+(w+F)>>2]=w,r=w>>>3,w>>>0<256){t=r<<1,a=40912+(t<<2)|0,o=e[10218]|0,r=1<>2]|0,t>>>0<(e[10222]|0)>>>0?St():(G=r,$=t)):(e[10218]=o|r,G=40912+(t+2<<2)|0,$=a),e[G>>2]=d,e[$+12>>2]=d,e[C+(F+8)>>2]=$,e[C+(F+12)>>2]=a;break}if(r=w>>>8,r?w>>>0>16777215?a=31:(Kt=(r+1048320|0)>>>16&8,pt=r<>>16&4,pt=pt<>>16&2,a=14-(gt|Kt|a)+(pt<>>15)|0,a=w>>>(a+7|0)&1|a<<1):a=0,r=41176+(a<<2)|0,e[C+(F+28)>>2]=a,e[C+(F+20)>>2]=0,e[C+(F+16)>>2]=0,t=e[10219]|0,o=1<>2]=d,e[C+(F+24)>>2]=r,e[C+(F+12)>>2]=d,e[C+(F+8)>>2]=d;break}r=e[r>>2]|0;t:do if((e[r+4>>2]&-8|0)!=(w|0)){for(a=w<<((a|0)==31?0:25-(a>>>1)|0);t=r+16+(a>>>31<<2)|0,o=e[t>>2]|0,!!o;)if((e[o+4>>2]&-8|0)==(w|0)){ae=o;break t}else a=a<<1,r=o;if(t>>>0<(e[10222]|0)>>>0)St();else{e[t>>2]=d,e[C+(F+24)>>2]=r,e[C+(F+12)>>2]=d,e[C+(F+8)>>2]=d;break e}}else ae=r;while(!1);if(r=ae+8|0,t=e[r>>2]|0,pt=e[10222]|0,t>>>0>=pt>>>0&ae>>>0>=pt>>>0){e[t+12>>2]=d,e[r>>2]=d,e[C+(F+8)>>2]=t,e[C+(F+12)>>2]=ae,e[C+(F+24)>>2]=0;break}else St()}else pt=w+F|0,e[C+4>>2]=pt|3,pt=C+(pt+4)|0,e[pt>>2]=e[pt>>2]|1;while(!1);return pt=C+8|0,pt|0}else H=F}else H=F;else H=-1;while(!1);if(o=e[10220]|0,o>>>0>=H>>>0)return r=o-H|0,t=e[10223]|0,r>>>0>15?(e[10223]=t+H,e[10220]=r,e[t+(H+4)>>2]=r|1,e[t+o>>2]=r,e[t+4>>2]=H|3):(e[10220]=0,e[10223]=0,e[t+4>>2]=o|3,pt=t+(o+4)|0,e[pt>>2]=e[pt>>2]|1),pt=t+8|0,pt|0;if(t=e[10221]|0,t>>>0>H>>>0)return Kt=t-H|0,e[10221]=Kt,pt=e[10224]|0,e[10224]=pt+H,e[pt+(H+4)>>2]=Kt|1,e[pt+4>>2]=H|3,pt=pt+8|0,pt|0;do if(!(e[10336]|0))if(t=Wo(30)|0,t+-1&t)St();else{e[10338]=t,e[10337]=t,e[10339]=-1,e[10340]=-1,e[10341]=0,e[10329]=0,ae=(ea(0)|0)&-16^1431655768,e[10336]=ae;break}while(!1);if(C=H+48|0,w=e[10338]|0,D=H+47|0,d=w+D|0,w=0-w|0,E=d&w,E>>>0<=H>>>0||(t=e[10328]|0,t|0&&($=e[10326]|0,ae=$+E|0,ae>>>0<=$>>>0|ae>>>0>t>>>0)))return pt=0,pt|0;e:do if(e[10329]&4)t=0,L=191;else{t=e[10224]|0;t:do if(t){for(l=41320;;){if(o=e[l>>2]|0,o>>>0<=t>>>0&&(K=l+4|0,(o+(e[K>>2]|0)|0)>>>0>t>>>0)){h=l,t=K;break}if(l=e[l+8>>2]|0,!l){L=174;break t}}if(o=d-(e[10221]|0)&w,o>>>0<2147483647)if(l=Mi(o|0)|0,ae=(l|0)==((e[h>>2]|0)+(e[t>>2]|0)|0),t=ae?o:0,ae){if((l|0)!=-1){J=l,U=t,L=194;break e}}else L=184;else t=0}else L=174;while(!1);do if((L|0)==174)if(h=Mi(0)|0,(h|0)!=-1)if(t=h,o=e[10337]|0,l=o+-1|0,l&t?o=E-t+(l+t&0-o)|0:o=E,t=e[10326]|0,l=t+o|0,o>>>0>H>>>0&o>>>0<2147483647){if(ae=e[10328]|0,ae|0&&l>>>0<=t>>>0|l>>>0>ae>>>0){t=0;break}if(l=Mi(o|0)|0,ae=(l|0)==(h|0),t=ae?o:0,ae){J=h,U=t,L=194;break e}else L=184}else t=0;else t=0;while(!1);t:do if((L|0)==184){h=0-o|0;do if(C>>>0>o>>>0&(o>>>0<2147483647&(l|0)!=-1)&&(P=e[10338]|0,P=D-o+P&0-P,P>>>0<2147483647))if((Mi(P|0)|0)==-1){Mi(h|0)|0;break t}else{o=P+o|0;break}while(!1);if((l|0)!=-1){J=l,U=o,L=194;break e}}while(!1);e[10329]=e[10329]|4,L=191}while(!1);if((L|0)==191&&E>>>0<2147483647&&(J=Mi(E|0)|0,ne=Mi(0)|0,J>>>0>>0&((J|0)!=-1&(ne|0)!=-1))&&(re=ne-J|0,ce=re>>>0>(H+40|0)>>>0,ce)&&(U=ce?re:t,L=194),(L|0)==194){t=(e[10326]|0)+U|0,e[10326]=t,t>>>0>(e[10327]|0)>>>0&&(e[10327]=t),d=e[10224]|0;e:do if(d){h=41320;do{if(t=e[h>>2]|0,o=h+4|0,l=e[o>>2]|0,(J|0)==(t+l|0)){Ee=t,ke=o,Te=l,it=h,L=204;break}h=e[h+8>>2]|0}while(h|0);if((L|0)==204&&!(e[it+12>>2]&8|0)&&d>>>0>>0&d>>>0>=Ee>>>0){e[ke>>2]=Te+U,pt=(e[10221]|0)+U|0,Kt=d+8|0,Kt=Kt&7|0?0-Kt&7:0,gt=pt-Kt|0,e[10224]=d+Kt,e[10221]=gt,e[d+(Kt+4)>>2]=gt|1,e[d+(pt+4)>>2]=40,e[10225]=e[10340];break}for(t=e[10222]|0,J>>>0>>0&&(e[10222]=J,t=J),o=J+U|0,h=41320;;){if((e[h>>2]|0)==(o|0)){l=h,o=h,L=212;break}if(h=e[h+8>>2]|0,!h){o=41320;break}}if((L|0)==212)if(e[o+12>>2]&8)o=41320;else{e[l>>2]=J,R=o+4|0,e[R>>2]=(e[R>>2]|0)+U,R=J+8|0,R=R&7|0?0-R&7:0,D=J+(U+8)|0,D=D&7|0?0-D&7:0,r=J+(D+U)|0,F=R+H|0,_=J+F|0,E=r-(J+R)-H|0,e[J+(R+4)>>2]=H|3;t:do if((r|0)!=(d|0)){if((r|0)==(e[10223]|0)){pt=(e[10220]|0)+E|0,e[10220]=pt,e[10223]=_,e[J+(F+4)>>2]=pt|1,e[J+(pt+F)>>2]=pt;break}if(w=U+4|0,o=e[J+(w+D)>>2]|0,(o&3|0)==1){C=o&-8,h=o>>>3;i:do if(o>>>0>=256){d=e[J+((D|24)+U)>>2]|0,a=e[J+(U+12+D)>>2]|0;do if((a|0)==(r|0)){if(l=D|16,a=J+(w+l)|0,o=e[a>>2]|0,!o&&(a=J+(l+U)|0,o=e[a>>2]|0,!o)){zt=0;break}for(;;){if(l=o+20|0,h=e[l>>2]|0,h){o=h,a=l;continue}if(l=o+16|0,h=e[l>>2]|0,h)o=h,a=l;else break}if(a>>>0>>0)St();else{e[a>>2]=0,zt=o;break}}else if(l=e[J+((D|8)+U)>>2]|0,l>>>0>>0&&St(),t=l+12|0,(e[t>>2]|0)!=(r|0)&&St(),o=a+8|0,(e[o>>2]|0)==(r|0)){e[t>>2]=a,e[o>>2]=l,zt=a;break}else St();while(!1);if(!d)break;t=e[J+(U+28+D)>>2]|0,o=41176+(t<<2)|0;do if((r|0)!=(e[o>>2]|0)){if(d>>>0<(e[10222]|0)>>>0&&St(),t=d+16|0,(e[t>>2]|0)==(r|0)?e[t>>2]=zt:e[d+20>>2]=zt,!zt)break i}else{if(e[o>>2]=zt,zt)break;e[10219]=e[10219]&~(1<>>0>>0&&St(),e[zt+24>>2]=d,r=D|16,t=e[J+(r+U)>>2]|0;do if(t)if(t>>>0>>0)St();else{e[zt+16>>2]=t,e[t+24>>2]=zt;break}while(!1);if(r=e[J+(w+r)>>2]|0,!r)break;if(r>>>0<(e[10222]|0)>>>0)St();else{e[zt+20>>2]=r,e[r+24>>2]=zt;break}}else{a=e[J+((D|8)+U)>>2]|0,l=e[J+(U+12+D)>>2]|0,o=40912+(h<<1<<2)|0;do if((a|0)!=(o|0)){if(a>>>0>>0&&St(),(e[a+12>>2]|0)==(r|0))break;St()}while(!1);if((l|0)==(a|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),t=l+8|0,(e[t>>2]|0)==(r|0)){jt=t;break}St()}while(!1);e[a+12>>2]=l,e[jt>>2]=a}while(!1);r=J+((C|D)+U)|0,l=C+E|0}else l=E;if(r=r+4|0,e[r>>2]=e[r>>2]&-2,e[J+(F+4)>>2]=l|1,e[J+(l+F)>>2]=l,r=l>>>3,l>>>0<256){t=r<<1,a=40912+(t<<2)|0,o=e[10218]|0,r=1<>2]|0,t>>>0>=(e[10222]|0)>>>0){gt=r,Kt=t;break}St()}while(!1);e[gt>>2]=_,e[Kt+12>>2]=_,e[J+(F+8)>>2]=Kt,e[J+(F+12)>>2]=a;break}r=l>>>8;do if(!r)a=0;else{if(l>>>0>16777215){a=31;break}gt=(r+1048320|0)>>>16&8,Kt=r<>>16&4,Kt=Kt<>>16&2,a=14-(zt|gt|a)+(Kt<>>15)|0,a=l>>>(a+7|0)&1|a<<1}while(!1);if(r=41176+(a<<2)|0,e[J+(F+28)>>2]=a,e[J+(F+20)>>2]=0,e[J+(F+16)>>2]=0,t=e[10219]|0,o=1<>2]=_,e[J+(F+24)>>2]=r,e[J+(F+12)>>2]=_,e[J+(F+8)>>2]=_;break}r=e[r>>2]|0;i:do if((e[r+4>>2]&-8|0)!=(l|0)){for(a=l<<((a|0)==31?0:25-(a>>>1)|0);t=r+16+(a>>>31<<2)|0,o=e[t>>2]|0,!!o;)if((e[o+4>>2]&-8|0)==(l|0)){pt=o;break i}else a=a<<1,r=o;if(t>>>0<(e[10222]|0)>>>0)St();else{e[t>>2]=_,e[J+(F+24)>>2]=r,e[J+(F+12)>>2]=_,e[J+(F+8)>>2]=_;break t}}else pt=r;while(!1);if(r=pt+8|0,t=e[r>>2]|0,Kt=e[10222]|0,t>>>0>=Kt>>>0&pt>>>0>=Kt>>>0){e[t+12>>2]=_,e[r>>2]=_,e[J+(F+8)>>2]=t,e[J+(F+12)>>2]=pt,e[J+(F+24)>>2]=0;break}else St()}else pt=(e[10221]|0)+E|0,e[10221]=pt,e[10224]=_,e[J+(F+4)>>2]=pt|1;while(!1);return pt=J+(R|8)|0,pt|0}for(;t=e[o>>2]|0,!(t>>>0<=d>>>0&&(r=e[o+4>>2]|0,a=t+r|0,a>>>0>d>>>0));)o=e[o+8>>2]|0;if(l=t+(r+-39)|0,t=t+(r+-47+(l&7|0?0-l&7:0))|0,l=d+16|0,t=t>>>0>>0?d:t,r=t+8|0,o=J+8|0,o=o&7|0?0-o&7:0,pt=U+-40-o|0,e[10224]=J+o,e[10221]=pt,e[J+(o+4)>>2]=pt|1,e[J+(U+-36)>>2]=40,e[10225]=e[10340],o=t+4|0,e[o>>2]=27,e[r>>2]=e[10330],e[r+4>>2]=e[10331],e[r+8>>2]=e[10332],e[r+12>>2]=e[10333],e[10330]=J,e[10331]=U,e[10333]=0,e[10332]=r,r=t+28|0,e[r>>2]=7,(t+32|0)>>>0>>0)do pt=r,r=r+4|0,e[r>>2]=7;while((pt+8|0)>>>0>>0);if((t|0)!=(d|0)){if(h=t-d|0,e[o>>2]=e[o>>2]&-2,e[d+4>>2]=h|1,e[t>>2]=h,r=h>>>3,h>>>0<256){t=r<<1,a=40912+(t<<2)|0,o=e[10218]|0,r=1<>2]|0,t>>>0<(e[10222]|0)>>>0?St():(Gt=r,s0=t)):(e[10218]=o|r,Gt=40912+(t+2<<2)|0,s0=a),e[Gt>>2]=d,e[s0+12>>2]=d,e[d+8>>2]=s0,e[d+12>>2]=a;break}if(r=h>>>8,r?h>>>0>16777215?a=31:(Kt=(r+1048320|0)>>>16&8,pt=r<>>16&4,pt=pt<>>16&2,a=14-(gt|Kt|a)+(pt<>>15)|0,a=h>>>(a+7|0)&1|a<<1):a=0,o=41176+(a<<2)|0,e[d+28>>2]=a,e[d+20>>2]=0,e[l>>2]=0,r=e[10219]|0,t=1<>2]=d,e[d+24>>2]=o,e[d+12>>2]=d,e[d+8>>2]=d;break}r=e[o>>2]|0;t:do if((e[r+4>>2]&-8|0)!=(h|0)){for(a=h<<((a|0)==31?0:25-(a>>>1)|0);t=r+16+(a>>>31<<2)|0,o=e[t>>2]|0,!!o;)if((e[o+4>>2]&-8|0)==(h|0)){i0=o;break t}else a=a<<1,r=o;if(t>>>0<(e[10222]|0)>>>0)St();else{e[t>>2]=d,e[d+24>>2]=r,e[d+12>>2]=d,e[d+8>>2]=d;break e}}else i0=r;while(!1);if(r=i0+8|0,t=e[r>>2]|0,pt=e[10222]|0,t>>>0>=pt>>>0&i0>>>0>=pt>>>0){e[t+12>>2]=d,e[r>>2]=d,e[d+8>>2]=t,e[d+12>>2]=i0,e[d+24>>2]=0;break}else St()}}else{pt=e[10222]|0,(pt|0)==0|J>>>0>>0&&(e[10222]=J),e[10330]=J,e[10331]=U,e[10333]=0,e[10227]=e[10336],e[10226]=-1,r=0;do pt=r<<1,Kt=40912+(pt<<2)|0,e[40912+(pt+3<<2)>>2]=Kt,e[40912+(pt+2<<2)>>2]=Kt,r=r+1|0;while((r|0)!=32);pt=J+8|0,pt=pt&7|0?0-pt&7:0,Kt=U+-40-pt|0,e[10224]=J+pt,e[10221]=Kt,e[J+(pt+4)>>2]=Kt|1,e[J+(U+-36)>>2]=40,e[10225]=e[10340]}while(!1);if(r=e[10221]|0,r>>>0>H>>>0)return Kt=r-H|0,e[10221]=Kt,pt=e[10224]|0,e[10224]=pt+H,e[pt+(H+4)>>2]=Kt|1,e[pt+4>>2]=H|3,pt=pt+8|0,pt|0}return pt=S0()|0,e[pt>>2]=12,pt=0,pt|0}function n0(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0;if(t){r=t+-8|0,w=e[10222]|0,r>>>0>>0&&St(),o=e[t+-4>>2]|0,a=o&3,(a|0)==1&&St(),_=o&-8,H=t+(_+-8)|0;do if(o&1)P=r,h=_;else{if(r=e[r>>2]|0,!a)return;if(C=-8-r|0,E=t+C|0,F=r+_|0,E>>>0>>0&&St(),(E|0)==(e[10223]|0)){if(r=t+(_+-4)|0,o=e[r>>2]|0,(o&3|0)!=3){P=E,h=F;break}e[10220]=F,e[r>>2]=o&-2,e[t+(C+4)>>2]=F|1,e[H>>2]=F;return}if(l=r>>>3,r>>>0<256){if(a=e[t+(C+8)>>2]|0,o=e[t+(C+12)>>2]|0,r=40912+(l<<1<<2)|0,(a|0)!=(r|0)&&(a>>>0>>0&&St(),(e[a+12>>2]|0)!=(E|0)&&St()),(o|0)==(a|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),r=o+8|0,(e[r>>2]|0)==(E|0)?d=r:St()):d=o+8|0,e[a+12>>2]=o,e[d>>2]=a,P=E,h=F;break}d=e[t+(C+24)>>2]|0,a=e[t+(C+12)>>2]|0;do if((a|0)==(E|0)){if(o=t+(C+20)|0,r=e[o>>2]|0,!r&&(o=t+(C+16)|0,r=e[o>>2]|0,!r)){D=0;break}for(;;){if(a=r+20|0,l=e[a>>2]|0,l){r=l,o=a;continue}if(a=r+16|0,l=e[a>>2]|0,l)r=l,o=a;else break}if(o>>>0>>0)St();else{e[o>>2]=0,D=r;break}}else if(l=e[t+(C+8)>>2]|0,l>>>0>>0&&St(),r=l+12|0,(e[r>>2]|0)!=(E|0)&&St(),o=a+8|0,(e[o>>2]|0)==(E|0)){e[r>>2]=a,e[o>>2]=l,D=a;break}else St();while(!1);if(d){if(r=e[t+(C+28)>>2]|0,o=41176+(r<<2)|0,(E|0)==(e[o>>2]|0)){if(e[o>>2]=D,!D){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=d+16|0,(e[r>>2]|0)==(E|0)?e[r>>2]=D:e[d+20>>2]=D,!D){P=E,h=F;break}o=e[10222]|0,D>>>0>>0&&St(),e[D+24>>2]=d,r=e[t+(C+16)>>2]|0;do if(r)if(r>>>0>>0)St();else{e[D+16>>2]=r,e[r+24>>2]=D;break}while(!1);if(r=e[t+(C+20)>>2]|0,r)if(r>>>0<(e[10222]|0)>>>0)St();else{e[D+20>>2]=r,e[r+24>>2]=D,P=E,h=F;break}else P=E,h=F}else P=E,h=F}while(!1);if(P>>>0>=H>>>0&&St(),r=t+(_+-4)|0,o=e[r>>2]|0,o&1||St(),o&2)e[r>>2]=o&-2,e[P+4>>2]=h|1,e[P+h>>2]=h;else{if((H|0)==(e[10224]|0)){if($=(e[10221]|0)+h|0,e[10221]=$,e[10224]=P,e[P+4>>2]=$|1,(P|0)!=(e[10223]|0))return;e[10223]=0,e[10220]=0;return}if((H|0)==(e[10223]|0)){$=(e[10220]|0)+h|0,e[10220]=$,e[10223]=P,e[P+4>>2]=$|1,e[P+$>>2]=$;return}h=(o&-8)+h|0,l=o>>>3;do if(o>>>0>=256){d=e[t+(_+16)>>2]|0,r=e[t+(_|4)>>2]|0;do if((r|0)==(H|0)){if(o=t+(_+12)|0,r=e[o>>2]|0,!r&&(o=t+(_+8)|0,r=e[o>>2]|0,!r)){U=0;break}for(;;){if(a=r+20|0,l=e[a>>2]|0,l){r=l,o=a;continue}if(a=r+16|0,l=e[a>>2]|0,l)r=l,o=a;else break}if(o>>>0<(e[10222]|0)>>>0)St();else{e[o>>2]=0,U=r;break}}else if(o=e[t+_>>2]|0,o>>>0<(e[10222]|0)>>>0&&St(),a=o+12|0,(e[a>>2]|0)!=(H|0)&&St(),l=r+8|0,(e[l>>2]|0)==(H|0)){e[a>>2]=r,e[l>>2]=o,U=r;break}else St();while(!1);if(d){if(r=e[t+(_+20)>>2]|0,o=41176+(r<<2)|0,(H|0)==(e[o>>2]|0)){if(e[o>>2]=U,!U){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=d+16|0,(e[r>>2]|0)==(H|0)?e[r>>2]=U:e[d+20>>2]=U,!U)break;o=e[10222]|0,U>>>0>>0&&St(),e[U+24>>2]=d,r=e[t+(_+8)>>2]|0;do if(r)if(r>>>0>>0)St();else{e[U+16>>2]=r,e[r+24>>2]=U;break}while(!1);if(r=e[t+(_+12)>>2]|0,r)if(r>>>0<(e[10222]|0)>>>0)St();else{e[U+20>>2]=r,e[r+24>>2]=U;break}}}else{if(a=e[t+_>>2]|0,o=e[t+(_|4)>>2]|0,r=40912+(l<<1<<2)|0,(a|0)!=(r|0)&&(a>>>0<(e[10222]|0)>>>0&&St(),(e[a+12>>2]|0)!=(H|0)&&St()),(o|0)==(a|0)){e[10218]=e[10218]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=o+8|0,(e[r>>2]|0)==(H|0)?R=r:St()):R=o+8|0,e[a+12>>2]=o,e[R>>2]=a}while(!1);if(e[P+4>>2]=h|1,e[P+h>>2]=h,(P|0)==(e[10223]|0)){e[10220]=h;return}}if(r=h>>>3,h>>>0<256){o=r<<1,l=40912+(o<<2)|0,a=e[10218]|0,r=1<>2]|0,o>>>0<(e[10222]|0)>>>0?St():(K=r,G=o)):(e[10218]=a|r,K=40912+(o+2<<2)|0,G=l),e[K>>2]=P,e[G+12>>2]=P,e[P+8>>2]=G,e[P+12>>2]=l;return}r=h>>>8,r?h>>>0>16777215?l=31:(K=(r+1048320|0)>>>16&8,G=r<>>16&4,G=G<>>16&2,l=14-(H|K|l)+(G<>>15)|0,l=h>>>(l+7|0)&1|l<<1):l=0,r=41176+(l<<2)|0,e[P+28>>2]=l,e[P+20>>2]=0,e[P+16>>2]=0,o=e[10219]|0,a=1<>2]|0;t:do if((e[r+4>>2]&-8|0)!=(h|0)){for(l=h<<((l|0)==31?0:25-(l>>>1)|0);o=r+16+(l>>>31<<2)|0,a=e[o>>2]|0,!!a;)if((e[a+4>>2]&-8|0)==(h|0)){$=a;break t}else l=l<<1,r=a;if(o>>>0<(e[10222]|0)>>>0)St();else{e[o>>2]=P,e[P+24>>2]=r,e[P+12>>2]=P,e[P+8>>2]=P;break e}}else $=r;while(!1);if(r=$+8|0,o=e[r>>2]|0,G=e[10222]|0,o>>>0>=G>>>0&$>>>0>=G>>>0){e[o+12>>2]=P,e[r>>2]=P,e[P+8>>2]=o,e[P+12>>2]=$,e[P+24>>2]=0;break}else St()}else e[10219]=o|a,e[r>>2]=P,e[P+24>>2]=r,e[P+12>>2]=P,e[P+8>>2]=P;while(!1);if(P=(e[10226]|0)+-1|0,e[10226]=P,!P)r=41328;else return;for(;r=e[r>>2]|0,r;)r=r+8|0;e[10226]=-1}}function Dd(t,r){t=t|0,r=r|0;var o=0;return t?(o=ie(r,t)|0,(r|t)>>>0>65535&&(o=((o>>>0)/(t>>>0)|0|0)==(r|0)?o:-1)):o=0,r=E0(o)|0,!r||!(e[r+-4>>2]&3)||Jt(r|0,0,o|0)|0,r|0}function Gi(t,r){t=t|0,r=r|0;var o=0,a=0;return t?r>>>0>4294967231?(t=S0()|0,e[t>>2]=12,t=0,t|0):(o=bd(t+-8|0,r>>>0<11?16:r+11&-8)|0,o?(t=o+8|0,t|0):(o=E0(r)|0,o?(a=e[t+-4>>2]|0,a=(a&-8)-(a&3|0?4:8)|0,o0(o|0,t|0,(a>>>0>>0?a:r)|0)|0,n0(t),t=o,t|0):(t=0,t|0))):(t=E0(r)|0,t|0)}function bd(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(_=t+4|0,U=e[_>>2]|0,C=U&-8,E=t+C|0,w=e[10222]|0,o=U&3,(o|0)!=1&t>>>0>=w>>>0&t>>>0>>0||St(),a=t+(C|4)|0,l=e[a>>2]|0,l&1||St(),!o)return r>>>0<256?(t=0,t|0):(C>>>0>=(r+4|0)>>>0&&(C-r|0)>>>0<=e[10338]<<1>>>0||(t=0),t|0);if(C>>>0>=r>>>0)return o=C-r|0,o>>>0<=15||(e[_>>2]=U&1|r|2,e[t+(r+4)>>2]=o|3,e[a>>2]=e[a>>2]|1,Ls(t+r|0,o)),t|0;if((E|0)==(e[10224]|0))return o=(e[10221]|0)+C|0,o>>>0<=r>>>0?(t=0,t|0):(R=o-r|0,e[_>>2]=U&1|r|2,e[t+(r+4)>>2]=R|1,e[10224]=t+r,e[10221]=R,t|0);if((E|0)==(e[10223]|0))return a=(e[10220]|0)+C|0,a>>>0>>0?(t=0,t|0):(o=a-r|0,o>>>0>15?(e[_>>2]=U&1|r|2,e[t+(r+4)>>2]=o|1,e[t+a>>2]=o,a=t+(a+4)|0,e[a>>2]=e[a>>2]&-2,a=t+r|0):(e[_>>2]=U&1|a|2,a=t+(a+4)|0,e[a>>2]=e[a>>2]|1,a=0,o=0),e[10220]=o,e[10223]=a,t|0);if(l&2||(F=(l&-8)+C|0,F>>>0>>0))return t=0,t|0;R=F-r|0,h=l>>>3;do if(l>>>0>=256){d=e[t+(C+24)>>2]|0,h=e[t+(C+12)>>2]|0;do if((h|0)==(E|0)){if(a=t+(C+20)|0,o=e[a>>2]|0,!o&&(a=t+(C+16)|0,o=e[a>>2]|0,!o)){D=0;break}for(;;){if(l=o+20|0,h=e[l>>2]|0,h){o=h,a=l;continue}if(l=o+16|0,h=e[l>>2]|0,h)o=h,a=l;else break}if(a>>>0>>0)St();else{e[a>>2]=0,D=o;break}}else if(l=e[t+(C+8)>>2]|0,l>>>0>>0&&St(),o=l+12|0,(e[o>>2]|0)!=(E|0)&&St(),a=h+8|0,(e[a>>2]|0)==(E|0)){e[o>>2]=h,e[a>>2]=l,D=h;break}else St();while(!1);if(d){if(o=e[t+(C+28)>>2]|0,a=41176+(o<<2)|0,(E|0)==(e[a>>2]|0)){if(e[a>>2]=D,!D){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),o=d+16|0,(e[o>>2]|0)==(E|0)?e[o>>2]=D:e[d+20>>2]=D,!D)break;a=e[10222]|0,D>>>0>>0&&St(),e[D+24>>2]=d,o=e[t+(C+16)>>2]|0;do if(o)if(o>>>0>>0)St();else{e[D+16>>2]=o,e[o+24>>2]=D;break}while(!1);if(o=e[t+(C+20)>>2]|0,o)if(o>>>0<(e[10222]|0)>>>0)St();else{e[D+20>>2]=o,e[o+24>>2]=D;break}}}else{if(l=e[t+(C+8)>>2]|0,a=e[t+(C+12)>>2]|0,o=40912+(h<<1<<2)|0,(l|0)!=(o|0)&&(l>>>0>>0&&St(),(e[l+12>>2]|0)!=(E|0)&&St()),(a|0)==(l|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),o=a+8|0,(e[o>>2]|0)==(E|0)?d=o:St()):d=a+8|0,e[l+12>>2]=a,e[d>>2]=l}while(!1);return R>>>0<16?(e[_>>2]=F|U&1|2,r=t+(F|4)|0,e[r>>2]=e[r>>2]|1,t|0):(e[_>>2]=U&1|r|2,e[t+(r+4)>>2]=R|3,U=t+(F|4)|0,e[U>>2]=e[U>>2]|1,Ls(t+r|0,R),t|0)}function Ls(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0;H=t+r|0,o=e[t+4>>2]|0;do if(o&1)$=t,d=r;else{if(D=e[t>>2]|0,!(o&3))return;if(R=t+(0-D)|0,F=D+r|0,C=e[10222]|0,R>>>0>>0&&St(),(R|0)==(e[10223]|0)){if(a=t+(r+4)|0,o=e[a>>2]|0,(o&3|0)!=3){$=R,d=F;break}e[10220]=F,e[a>>2]=o&-2,e[t+(4-D)>>2]=F|1,e[H>>2]=F;return}if(h=D>>>3,D>>>0<256){if(l=e[t+(8-D)>>2]|0,a=e[t+(12-D)>>2]|0,o=40912+(h<<1<<2)|0,(l|0)!=(o|0)&&(l>>>0>>0&&St(),(e[l+12>>2]|0)!=(R|0)&&St()),(a|0)==(l|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),o=a+8|0,(e[o>>2]|0)==(R|0)?w=o:St()):w=a+8|0,e[l+12>>2]=a,e[w>>2]=l,$=R,d=F;break}w=e[t+(24-D)>>2]|0,l=e[t+(12-D)>>2]|0;do if((l|0)==(R|0)){if(l=16-D|0,a=t+(l+4)|0,o=e[a>>2]|0,!o&&(a=t+l|0,o=e[a>>2]|0,!o)){E=0;break}for(;;){if(l=o+20|0,h=e[l>>2]|0,h){o=h,a=l;continue}if(l=o+16|0,h=e[l>>2]|0,h)o=h,a=l;else break}if(a>>>0>>0)St();else{e[a>>2]=0,E=o;break}}else if(h=e[t+(8-D)>>2]|0,h>>>0>>0&&St(),o=h+12|0,(e[o>>2]|0)!=(R|0)&&St(),a=l+8|0,(e[a>>2]|0)==(R|0)){e[o>>2]=l,e[a>>2]=h,E=l;break}else St();while(!1);if(w){if(o=e[t+(28-D)>>2]|0,a=41176+(o<<2)|0,(R|0)==(e[a>>2]|0)){if(e[a>>2]=E,!E){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),o=w+16|0,(e[o>>2]|0)==(R|0)?e[o>>2]=E:e[w+20>>2]=E,!E){$=R,d=F;break}l=e[10222]|0,E>>>0>>0&&St(),e[E+24>>2]=w,o=16-D|0,a=e[t+o>>2]|0;do if(a)if(a>>>0>>0)St();else{e[E+16>>2]=a,e[a+24>>2]=E;break}while(!1);if(o=e[t+(o+4)>>2]|0,o)if(o>>>0<(e[10222]|0)>>>0)St();else{e[E+20>>2]=o,e[o+24>>2]=E,$=R,d=F;break}else $=R,d=F}else $=R,d=F}while(!1);if(C=e[10222]|0,H>>>0>>0&&St(),o=t+(r+4)|0,a=e[o>>2]|0,a&2)e[o>>2]=a&-2,e[$+4>>2]=d|1,e[$+d>>2]=d;else{if((H|0)==(e[10224]|0)){if(G=(e[10221]|0)+d|0,e[10221]=G,e[10224]=$,e[$+4>>2]=G|1,($|0)!=(e[10223]|0))return;e[10223]=0,e[10220]=0;return}if((H|0)==(e[10223]|0)){G=(e[10220]|0)+d|0,e[10220]=G,e[10223]=$,e[$+4>>2]=G|1,e[$+G>>2]=G;return}d=(a&-8)+d|0,h=a>>>3;do if(a>>>0>=256){w=e[t+(r+24)>>2]|0,l=e[t+(r+12)>>2]|0;do if((l|0)==(H|0)){if(a=t+(r+20)|0,o=e[a>>2]|0,!o&&(a=t+(r+16)|0,o=e[a>>2]|0,!o)){U=0;break}for(;;){if(l=o+20|0,h=e[l>>2]|0,h){o=h,a=l;continue}if(l=o+16|0,h=e[l>>2]|0,h)o=h,a=l;else break}if(a>>>0>>0)St();else{e[a>>2]=0,U=o;break}}else if(h=e[t+(r+8)>>2]|0,h>>>0>>0&&St(),o=h+12|0,(e[o>>2]|0)!=(H|0)&&St(),a=l+8|0,(e[a>>2]|0)==(H|0)){e[o>>2]=l,e[a>>2]=h,U=l;break}else St();while(!1);if(w){if(o=e[t+(r+28)>>2]|0,a=41176+(o<<2)|0,(H|0)==(e[a>>2]|0)){if(e[a>>2]=U,!U){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),o=w+16|0,(e[o>>2]|0)==(H|0)?e[o>>2]=U:e[w+20>>2]=U,!U)break;a=e[10222]|0,U>>>0>>0&&St(),e[U+24>>2]=w,o=e[t+(r+16)>>2]|0;do if(o)if(o>>>0>>0)St();else{e[U+16>>2]=o,e[o+24>>2]=U;break}while(!1);if(o=e[t+(r+20)>>2]|0,o)if(o>>>0<(e[10222]|0)>>>0)St();else{e[U+20>>2]=o,e[o+24>>2]=U;break}}}else{if(l=e[t+(r+8)>>2]|0,a=e[t+(r+12)>>2]|0,o=40912+(h<<1<<2)|0,(l|0)!=(o|0)&&(l>>>0>>0&&St(),(e[l+12>>2]|0)!=(H|0)&&St()),(a|0)==(l|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),o=a+8|0,(e[o>>2]|0)==(H|0)?_=o:St()):_=a+8|0,e[l+12>>2]=a,e[_>>2]=l}while(!1);if(e[$+4>>2]=d|1,e[$+d>>2]=d,($|0)==(e[10223]|0)){e[10220]=d;return}}if(o=d>>>3,d>>>0<256){a=o<<1,h=40912+(a<<2)|0,l=e[10218]|0,o=1<>2]|0,a>>>0<(e[10222]|0)>>>0?St():(K=o,G=a)):(e[10218]=l|o,K=40912+(a+2<<2)|0,G=h),e[K>>2]=$,e[G+12>>2]=$,e[$+8>>2]=G,e[$+12>>2]=h;return}if(o=d>>>8,o?d>>>0>16777215?h=31:(K=(o+1048320|0)>>>16&8,G=o<>>16&4,G=G<>>16&2,h=14-(H|K|h)+(G<>>15)|0,h=d>>>(h+7|0)&1|h<<1):h=0,o=41176+(h<<2)|0,e[$+28>>2]=h,e[$+20>>2]=0,e[$+16>>2]=0,a=e[10219]|0,l=1<>2]=$,e[$+24>>2]=o,e[$+12>>2]=$,e[$+8>>2]=$;return}o=e[o>>2]|0;e:do if((e[o+4>>2]&-8|0)!=(d|0)){for(h=d<<((h|0)==31?0:25-(h>>>1)|0);a=o+16+(h>>>31<<2)|0,l=e[a>>2]|0,!!l;)if((e[l+4>>2]&-8|0)==(d|0)){o=l;break e}else h=h<<1,o=l;a>>>0<(e[10222]|0)>>>0&&St(),e[a>>2]=$,e[$+24>>2]=o,e[$+12>>2]=$,e[$+8>>2]=$;return}while(!1);a=o+8|0,l=e[a>>2]|0,G=e[10222]|0,l>>>0>=G>>>0&o>>>0>=G>>>0||St(),e[l+12>>2]=$,e[a>>2]=$,e[$+8>>2]=l,e[$+12>>2]=o,e[$+24>>2]=0}function Fd(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;if(a=e[9321]|0,_d(42048,a,42104),e[10342]=42892,e[10344]=42912,e[10343]=0,t=e[10720]|0,m=0,Ae(62,41368+t|0,42048),h=m,m=0,h&1&&(h=j()|0,tt(41376),le(h|0)),e[41368+(t+72)>>2]=0,e[41368+(t+76)>>2]=-1,l=e[9322]|0,Os(42152,l,42112),e[10364]=42972,e[10365]=42992,o=e[10740]|0,m=0,Ae(62,41456+o|0,42152),h=m,m=0,h&1&&(h=j()|0,tt(41460),le(h|0)),t=o+72|0,e[41456+t>>2]=0,r=o+76|0,e[41456+r>>2]=-1,h=e[9320]|0,Os(42200,h,42120),e[10385]=42972,e[10386]=42992,m=0,Ae(62,41540+o|0,42200),d=m,m=0,d&1&&(d=j()|0,tt(41544),le(d|0)),e[41540+t>>2]=0,e[41540+r>>2]=-1,d=e[41540+((e[(e[10385]|0)+-12>>2]|0)+24)>>2]|0,e[10406]=42972,e[10407]=42992,m=0,Ae(62,41624+o|0,d|0),d=m,m=0,d&1&&(d=j()|0,tt(41628),le(d|0)),e[41624+t>>2]=0,e[41624+r>>2]=-1,e[41368+((e[(e[10342]|0)+-12>>2]|0)+72)>>2]=41456,t=41540+((e[(e[10385]|0)+-12>>2]|0)+4)|0,e[t>>2]=e[t>>2]|8192,e[41540+((e[(e[10385]|0)+-12>>2]|0)+72)>>2]=41456,Pd(42248,a,42128),e[10427]=42932,e[10429]=42952,e[10428]=0,t=e[10730]|0,m=0,Ae(62,41708+t|0,42248),d=m,m=0,d&1&&(d=j()|0,mn(41716),le(d|0)),e[41708+(t+72)>>2]=0,e[41708+(t+76)>>2]=-1,$s(42304,l,42136),e[10449]=43012,e[10450]=43032,o=e[10750]|0,m=0,Ae(62,41796+o|0,42304),d=m,m=0,d&1&&(d=j()|0,mn(41800),le(d|0)),t=o+72|0,e[41796+t>>2]=0,r=o+76|0,e[41796+r>>2]=-1,$s(42352,h,42144),e[10470]=43012,e[10471]=43032,m=0,Ae(62,41880+o|0,42352),d=m,m=0,d&1&&(d=j()|0,mn(41884),le(d|0)),e[41880+t>>2]=0,e[41880+r>>2]=-1,d=e[41880+((e[(e[10470]|0)+-12>>2]|0)+24)>>2]|0,e[10491]=43012,e[10492]=43032,m=0,Ae(62,41964+o|0,d|0),d=m,m=0,d&1)d=j()|0,mn(41968),le(d|0);else{e[41964+t>>2]=0,e[41964+r>>2]=-1,e[41708+((e[(e[10427]|0)+-12>>2]|0)+72)>>2]=41796,d=41880+((e[(e[10470]|0)+-12>>2]|0)+4)|0,e[d>>2]=e[d>>2]|8192,e[41880+((e[(e[10470]|0)+-12>>2]|0)+72)>>2]=41796;return}}function Nd(t){t=t|0,m=0,ge(70,41456)|0,t=m,m=0,!(!(t&1)&&(m=0,ge(70,41624)|0,t=m,m=0,!(t&1))&&(m=0,ge(71,41796)|0,t=m,m=0,!(t&1))&&(m=0,ge(71,41964)|0,t=m,m=0,!(t&1)))&&(t=j(0)|0,$t(t))}function Rd(){Fd(0),Nt(187,56757,Q|0)|0}function Md(){}function _d(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;if(l=b,b=b+16|0,h=l+4|0,a=l,Sr(t),e[t>>2]=42600,e[t+32>>2]=r,e[t+40>>2]=o,e[t+48>>2]=-1,S[t+52>>0]=0,tn(h,t+4|0),e[a>>2]=e[h>>2],m=0,Ae(23,t|0,a|0),o=m,m=0,o&1)h=j()|0,_0(a),wt(t),le(h|0);else{_0(a),b=l;return}}function Os(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;if(l=b,b=b+16|0,h=l+4|0,a=l,Sr(t),e[t>>2]=42536,e[t+32>>2]=r,tn(h,t+4|0),e[a>>2]=e[h>>2],m=0,r=Ne(37,a|0,44280)|0,h=m,m=0,h&1)h=j()|0,_0(a),wt(t),le(h|0);else{_0(a),e[t+36>>2]=r,e[t+40>>2]=o,h=(Et[e[(e[r>>2]|0)+28>>2]&127](r)|0)&1,S[t+44>>0]=h,b=l;return}}function Pd(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;if(l=b,b=b+16|0,h=l+4|0,a=l,Hs(t),e[t>>2]=42472,e[t+32>>2]=r,e[t+40>>2]=o,e[t+48>>2]=-1,S[t+52>>0]=0,tn(h,t+4|0),e[a>>2]=e[h>>2],m=0,Ae(21,t|0,a|0),o=m,m=0,o&1)h=j()|0,_0(a),rn(t),le(h|0);else{_0(a),b=l;return}}function $s(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;if(l=b,b=b+16|0,h=l+4|0,a=l,Hs(t),e[t>>2]=42408,e[t+32>>2]=r,tn(h,t+4|0),e[a>>2]=e[h>>2],m=0,r=Ne(37,a|0,44288)|0,h=m,m=0,h&1)h=j()|0,_0(a),rn(t),le(h|0);else{_0(a),e[t+36>>2]=r,e[t+40>>2]=o,h=(Et[e[(e[r>>2]|0)+28>>2]&127](r)|0)&1,S[t+44>>0]=h,b=l;return}}function Ld(t){t=t|0,rn(t),he(t)}function Od(t,r){t=t|0,r=r|0,Et[e[(e[t>>2]|0)+24>>2]&127](t)|0,r=O0(r,44288)|0,e[t+36>>2]=r,r=(Et[e[(e[r>>2]|0)+28>>2]&127](r)|0)&1,S[t+44>>0]=r}function $d(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;D=b,b=b+16|0,w=D+8|0,d=D,o=t+36|0,a=t+40|0,l=w+8|0,h=w,r=t+32|0;e:for(;;){if(t=e[o>>2]|0,t=an[e[(e[t>>2]|0)+20>>2]&31](t,e[a>>2]|0,w,l,d)|0,E=(e[d>>2]|0)-h|0,(gi(w,1,E,e[r>>2]|0)|0)!=(E|0)){t=-1;break}switch(t|0){case 1:break;case 2:{t=-1;break e}default:{C=4;break e}}}return(C|0)==4&&(t=((Fr(e[r>>2]|0)|0)!=0)<<31>>31),b=D,t|0}function Bd(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;e:do if(S[t+44>>0]|0)r=gi(r,4,o,e[t+32>>2]|0)|0;else if((o|0)>0)for(a=r,r=0;;){if((U0[e[(e[t>>2]|0)+52>>2]&63](t,e[a>>2]|0)|0)==-1)break e;if(r=r+1|0,(r|0)<(o|0))a=a+4|0;else break}else r=0;while(!1);return r|0}function Vd(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;H=b,b=b+32|0,R=H+16|0,o=H+8|0,F=H+4|0,E=H,_=(r|0)==-1;e:do if(_)U=11;else{if(e[o>>2]=r,S[t+44>>0]|0)if((gi(o,4,1,e[t+32>>2]|0)|0)==1){U=11;break}else{o=-1;break}for(e[F>>2]=R,C=o+4|0,D=t+36|0,l=t+40|0,h=R+8|0,d=R,w=t+32|0;;){if(t=e[D>>2]|0,t=Ci[e[(e[t>>2]|0)+12>>2]&15](t,e[l>>2]|0,o,C,E,R,h,F)|0,(e[E>>2]|0)==(o|0)){o=-1;break e}if((t|0)==3)break;if(a=(t|0)==1,t>>>0>=2){o=-1;break e}if(t=(e[F>>2]|0)-d|0,(gi(R,1,t,e[w>>2]|0)|0)!=(t|0)){o=-1;break e}if(a)o=a?e[E>>2]|0:o;else{U=11;break e}}(gi(o,1,1,e[w>>2]|0)|0)!=1?o=-1:U=11}while(!1);return(U|0)==11&&(o=_?0:r),b=H,o|0}function Ud(t,r){t=t|0,r=r|0;var o=0,a=0;a=O0(r,44288)|0,o=t+36|0,e[o>>2]=a,a=Et[e[(e[a>>2]|0)+24>>2]&127](a)|0,r=t+44|0,e[r>>2]=a,o=e[o>>2]|0,o=(Et[e[(e[o>>2]|0)+28>>2]&127](o)|0)&1,S[t+53>>0]=o,(e[r>>2]|0)>8&&fn(56783)}function zd(t){t=t|0,rn(t),he(t)}function Gd(t){return t=t|0,Bs(t,0)|0}function qd(t){return t=t|0,Bs(t,1)|0}function Wd(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;D=b,b=b+32|0,C=D+16|0,w=D+8|0,a=D+4|0,l=D,h=t+52|0,o=(S[h>>0]|0)!=0;e:do if((r|0)==-1)o?r=-1:(r=e[t+48>>2]|0,S[h>>0]=(r|0)!=-1&1);else{d=t+48|0;t:do if(o){switch(e[a>>2]=e[d>>2],o=e[t+36>>2]|0,Ci[e[(e[o>>2]|0)+12>>2]&15](o,e[t+40>>2]|0,a,a+4|0,l,C,C+8|0,w)|0){case 1:case 2:{r=-1;break e}case 3:{S[C>>0]=e[d>>2],e[w>>2]=C+1;break}default:}for(o=t+32|0;;){if(a=e[w>>2]|0,a>>>0<=C>>>0)break t;if(t=a+-1|0,e[w>>2]=t,(Rn(S[t>>0]|0,e[o>>2]|0)|0)==-1){r=-1;break e}}}while(!1);e[d>>2]=r,S[h>>0]=1}while(!1);return b=D,r|0}function Bs(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0;U=b,b=b+32|0,_=U+16|0,R=U+8|0,D=U+4|0,E=U,l=t+52|0;e:do if(S[l>>0]|0)a=t+48|0,o=e[a>>2]|0,r&&(e[a>>2]=-1,S[l>>0]=0);else{if(o=e[t+44>>2]|0,o=(o|0)>1?o:1,F=t+32|0,(o|0)>0){l=0;do{if(a=Nn(e[F>>2]|0)|0,(a|0)==-1){o=-1;break e}S[_+l>>0]=a,l=l+1|0}while((l|0)<(o|0))}t:do if(S[t+53>>0]|0)e[R>>2]=S[_>>0];else{d=t+40|0,w=t+36|0,C=R+4|0;i:for(;;){switch(H=e[d>>2]|0,l=H,a=e[l>>2]|0,l=e[l+4>>2]|0,K=e[w>>2]|0,h=_+o|0,Ci[e[(e[K>>2]|0)+16>>2]&15](K,H,_,h,D,R,C,E)|0){case 2:{o=-1;break e}case 3:break i;case 1:break;default:break t}if(K=e[d>>2]|0,e[K>>2]=a,e[K+4>>2]=l,(o|0)==8){o=-1;break e}if(a=Nn(e[F>>2]|0)|0,(a|0)==-1){o=-1;break e}S[h>>0]=a,o=o+1|0}e[R>>2]=S[_>>0]}while(!1);if(r){o=e[R>>2]|0,e[t+48>>2]=o;break}for(;!((o|0)<=0);)if(o=o+-1|0,(Rn(S[_+o>>0]|0,e[F>>2]|0)|0)==-1){o=-1;break e}o=e[R>>2]|0}while(!1);return b=U,o|0}function Hd(t){t=t|0,wt(t),he(t)}function Qd(t,r){t=t|0,r=r|0,Et[e[(e[t>>2]|0)+24>>2]&127](t)|0,r=O0(r,44280)|0,e[t+36>>2]=r,r=(Et[e[(e[r>>2]|0)+28>>2]&127](r)|0)&1,S[t+44>>0]=r}function Kd(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;D=b,b=b+16|0,w=D+8|0,d=D,o=t+36|0,a=t+40|0,l=w+8|0,h=w,r=t+32|0;e:for(;;){if(t=e[o>>2]|0,t=an[e[(e[t>>2]|0)+20>>2]&31](t,e[a>>2]|0,w,l,d)|0,E=(e[d>>2]|0)-h|0,(gi(w,1,E,e[r>>2]|0)|0)!=(E|0)){t=-1;break}switch(t|0){case 1:break;case 2:{t=-1;break e}default:{C=4;break e}}}return(C|0)==4&&(t=((Fr(e[r>>2]|0)|0)!=0)<<31>>31),b=D,t|0}function Yd(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;e:do if(S[t+44>>0]|0)r=gi(r,1,o,e[t+32>>2]|0)|0;else if((o|0)>0)for(a=r,r=0;;){if((U0[e[(e[t>>2]|0)+52>>2]&63](t,N[a>>0]|0)|0)==-1)break e;if(r=r+1|0,(r|0)<(o|0))a=a+1|0;else break}else r=0;while(!1);return r|0}function jd(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;H=b,b=b+32|0,R=H+16|0,o=H+8|0,F=H+4|0,E=H,_=(r|0)==-1;e:do if(_)U=11;else{if(S[o>>0]=r,S[t+44>>0]|0)if((gi(o,1,1,e[t+32>>2]|0)|0)==1){U=11;break}else{o=-1;break}for(e[F>>2]=R,D=o+1|0,l=t+36|0,h=t+40|0,d=R+8|0,w=R,C=t+32|0;;){if(t=e[l>>2]|0,t=Ci[e[(e[t>>2]|0)+12>>2]&15](t,e[h>>2]|0,o,D,E,R,d,F)|0,(e[E>>2]|0)==(o|0)){o=-1;break e}if((t|0)==3)break;if(a=(t|0)==1,t>>>0>=2){o=-1;break e}if(t=(e[F>>2]|0)-w|0,(gi(R,1,t,e[C>>2]|0)|0)!=(t|0)){o=-1;break e}if(a)o=a?e[E>>2]|0:o;else{U=11;break e}}(gi(o,1,1,e[C>>2]|0)|0)!=1?o=-1:U=11}while(!1);return(U|0)==11&&(o=_?0:r),b=H,o|0}function Xd(t,r){t=t|0,r=r|0;var o=0,a=0;a=O0(r,44280)|0,o=t+36|0,e[o>>2]=a,a=Et[e[(e[a>>2]|0)+24>>2]&127](a)|0,r=t+44|0,e[r>>2]=a,o=e[o>>2]|0,o=(Et[e[(e[o>>2]|0)+28>>2]&127](o)|0)&1,S[t+53>>0]=o,(e[r>>2]|0)>8&&fn(56783)}function Zd(t){t=t|0,wt(t),he(t)}function Jd(t){return t=t|0,Vs(t,0)|0}function ep(t){return t=t|0,Vs(t,1)|0}function tp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;D=b,b=b+32|0,C=D+16|0,w=D+4|0,a=D+8|0,l=D,h=t+52|0,o=(S[h>>0]|0)!=0;e:do if((r|0)==-1)o?r=-1:(r=e[t+48>>2]|0,S[h>>0]=(r|0)!=-1&1);else{d=t+48|0;t:do if(o){switch(S[a>>0]=e[d>>2],o=e[t+36>>2]|0,Ci[e[(e[o>>2]|0)+12>>2]&15](o,e[t+40>>2]|0,a,a+1|0,l,C,C+8|0,w)|0){case 1:case 2:{r=-1;break e}case 3:{S[C>>0]=e[d>>2],e[w>>2]=C+1;break}default:}for(o=t+32|0;;){if(a=e[w>>2]|0,a>>>0<=C>>>0)break t;if(t=a+-1|0,e[w>>2]=t,(Rn(S[t>>0]|0,e[o>>2]|0)|0)==-1){r=-1;break e}}}while(!1);e[d>>2]=r,S[h>>0]=1}while(!1);return b=D,r|0}function Vs(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0;U=b,b=b+32|0,_=U+16|0,R=U+8|0,D=U+4|0,E=U,l=t+52|0;e:do if(S[l>>0]|0)a=t+48|0,o=e[a>>2]|0,r&&(e[a>>2]=-1,S[l>>0]=0);else{if(o=e[t+44>>2]|0,o=(o|0)>1?o:1,F=t+32|0,(o|0)>0){l=0;do{if(a=Nn(e[F>>2]|0)|0,(a|0)==-1){o=-1;break e}S[_+l>>0]=a,l=l+1|0}while((l|0)<(o|0))}t:do if(S[t+53>>0]|0)S[R>>0]=S[_>>0]|0;else{d=t+40|0,w=t+36|0,C=R+1|0;i:for(;;){switch(H=e[d>>2]|0,l=H,a=e[l>>2]|0,l=e[l+4>>2]|0,K=e[w>>2]|0,h=_+o|0,Ci[e[(e[K>>2]|0)+16>>2]&15](K,H,_,h,D,R,C,E)|0){case 2:{o=-1;break e}case 3:break i;case 1:break;default:break t}if(K=e[d>>2]|0,e[K>>2]=a,e[K+4>>2]=l,(o|0)==8){o=-1;break e}if(a=Nn(e[F>>2]|0)|0,(a|0)==-1){o=-1;break e}S[h>>0]=a,o=o+1|0}S[R>>0]=S[_>>0]|0}while(!1);if(r)o=S[R>>0]|0,e[t+48>>2]=o&255;else{for(;!((o|0)<=0);)if(o=o+-1|0,(Rn(N[_+o>>0]|0,e[F>>2]|0)|0)==-1){o=-1;break e}o=S[R>>0]|0}o=o&255}while(!1);return b=U,o|0}function pA(t){t=t|0}function pn(t){t=t|0,t=t+4|0,e[t>>2]=(e[t>>2]|0)+1}function Bt(t){t=t|0;var r=0,o=0;return o=t+4|0,r=e[o>>2]|0,e[o>>2]=r+-1,r?t=0:(Rt[e[(e[t>>2]|0)+8>>2]&255](t),t=1),t|0}function ip(t,r){if(t=t|0,r=r|0,e[t>>2]=36868,m=0,Ae(86,t+4|0,(S[r>>0]&1?e[r+8>>2]|0:r+1|0)|0),t=m,m=0,t&1)t=j()|0,le(t|0);else return}function np(t,r){if(t=t|0,r=r|0,e[t>>2]=36868,m=0,Ae(86,t+4|0,r|0),t=m,m=0,t&1)t=j()|0,le(t|0);else return}function rp(t,r){t=t|0,r=r|0;var o=0,a=0;a=$i(r)|0,o=Xe(a+13|0)|0,e[o>>2]=a,e[o+4>>2]=a,e[o+8>>2]=0,o=o+12|0,o0(o|0,r|0,a+1|0)|0,e[t>>2]=o}function sp(t,r,o){t=t|0,r=r|0,o=o|0,e[t>>2]=o,e[t+4>>2]=r}function ap(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return l=b,b=b+16|0,a=l,Ln[e[(e[t>>2]|0)+12>>2]&15](a,t,r),(e[a+4>>2]|0)==(e[o+4>>2]|0)?a=(e[a>>2]|0)==(e[o>>2]|0):a=0,b=l,a|0}function lp(t,r,o){return t=t|0,r=r|0,o=o|0,((e[r>>2]|0)==(o|0)?(e[r+4>>2]|0)==(t|0):0)|0}function up(t,r,o){t=t|0,r=r|0,o=o|0,r=vo(o)|0,yi(t,r,$i(r)|0)}function cp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;d=b,b=b+16|0,h=d,a=e[r>>2]|0;do if(a)if(l=S[o>>0]|0,l&1?l=e[o+4>>2]|0:l=(l&255)>>>1,l&&(wp(o,56990)|0,a=e[r>>2]|0),r=e[r+4>>2]|0,Ln[e[(e[r>>2]|0)+24>>2]&15](h,r,a),r=S[h>>0]|0,l=(r&1)==0,m=0,Ve(30,o|0,(l?h+1|0:e[h+8>>2]|0)|0,(l?(r&255)>>>1:e[h+4>>2]|0)|0)|0,r=m,m=0,r&1)d=j()|0,de(h),le(d|0);else{de(h);break}while(!1);e[t>>2]=e[o>>2],e[t+4>>2]=e[o+4>>2],e[t+8>>2]=e[o+8>>2],e[o>>2]=0,e[o+4>>2]=0,e[o+8>>2]=0,b=d}function fp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;l=b,b=b+32|0,a=l+12|0,h=l,yi(h,o,$i(o)|0),m=0,ve(10,a|0,r|0,h|0),o=m,m=0;do if(o&1)a=j()|0;else if(m=0,Ae(87,t|0,a|0),o=m,m=0,o&1){l=j()|0,de(a),a=l;break}else{de(a),de(h),e[t>>2]=42664,o=e[r+4>>2]|0,h=t+8|0,e[h>>2]=e[r>>2],e[h+4>>2]=o,b=l;return}while(!1);de(h),le(a|0)}function hp(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;h=b,b=b+48|0,l=h+24|0,w=h+16|0,d=h,e[w>>2]=r,e[w+4>>2]=o,hr(d,a),m=0,ve(10,l|0,w|0,d|0),a=m,m=0;do if(a&1)l=j()|0;else if(m=0,Ae(87,t|0,l|0),w=m,m=0,w&1){w=j()|0,de(l),l=w;break}else{de(l),de(d),e[t>>2]=42664,e[t+8>>2]=r,e[t+12>>2]=o,b=h;return}while(!1);de(d),le(l|0)}function dp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;l=b,b=b+48|0,a=l+24|0,d=l+16|0,h=l,e[d>>2]=r,e[d+4>>2]=o,yi(h,58898,0),m=0,ve(10,a|0,d|0,h|0),d=m,m=0;do if(d&1)a=j()|0;else if(m=0,Ae(87,t|0,a|0),d=m,m=0,d&1){d=j()|0,de(a),a=d;break}else{de(a),de(h),e[t>>2]=42664,e[t+8>>2]=r,e[t+12>>2]=o,b=l;return}while(!1);de(h),le(a|0)}function fr(t){t=t|0,In(t)}function pp(t){t=t|0,In(t),he(t)}function mp(t){t=t|0}function gp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(Gr(42676)|0,(e[t>>2]|0)==1)do Q0(42704,42676)|0;while((e[t>>2]|0)==1);do if(e[t>>2]|0)Br(42676)|0;else{if(e[t>>2]=1,m=0,ge(72,42676)|0,a=m,m=0,!(a&1)&&(m=0,ue(o|0,r|0),a=m,m=0,!(a&1))&&(m=0,ge(73,42676)|0,a=m,m=0,!(a&1))&&(e[t>>2]=-1,m=0,ge(72,42676)|0,a=m,m=0,!(a&1))&&(m=0,ge(74,42704)|0,a=m,m=0,!(a&1)))break;a=j(0)|0,K0(a|0)|0,m=0,ge(73,42676)|0,a=m,m=0,!(a&1)&&(e[t>>2]=0,m=0,ge(72,42676)|0,a=m,m=0,!(a&1))&&(m=0,ge(74,42704)|0,a=m,m=0,!(a&1))&&(m=0,bt(5),m=0),r=j()|0,m=0,bt(3),a=m,m=0,a&1?(a=j(0)|0,$t(a)):le(r|0)}while(!1)}function hr(t,r){t=t|0,r=r|0,S[r>>0]&1?yi(t,e[r+8>>2]|0,e[r+4>>2]|0):(e[t>>2]=e[r>>2],e[t+4>>2]=e[r+4>>2],e[t+8>>2]=e[r+8>>2])}function yi(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;o>>>0>4294967279&&si(t),o>>>0<11?(S[t>>0]=o<<1,t=t+1|0):(l=o+16&-16,a=Xe(l)|0,e[t+8>>2]=a,e[t>>2]=l|1,e[t+4>>2]=o,t=a),o0(t|0,r|0,o|0)|0,S[t+o>>0]=0}function dr(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;r>>>0>4294967279&&si(t),r>>>0<11?(S[t>>0]=r<<1,t=t+1|0):(l=r+16&-16,a=Xe(l)|0,e[t+8>>2]=a,e[t>>2]=l|1,e[t+4>>2]=r,t=a),Jt(t|0,o|0,r|0)|0,S[t+r>>0]=0}function de(t){t=t|0,S[t>>0]&1&&he(e[t+8>>2]|0)}function Sp(t,r){t=t|0,r=r|0;var o=0,a=0;return(t|0)!=(r|0)&&(o=S[r>>0]|0,a=(o&1)==0,Us(t,a?r+1|0:e[r+8>>2]|0,a?(o&255)>>>1:e[r+4>>2]|0)|0),t|0}function Ap(t,r){return t=t|0,r=r|0,Us(t,r,$i(r)|0)|0}function Us(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;a=S[t>>0]|0,a&1?(a=e[t>>2]|0,h=(a&-2)+-1|0,a=a&255):h=10,l=(a&1)==0;do if(h>>>0>=o>>>0)if(l?a=t+1|0:a=e[t+8>>2]|0,vn(a|0,r|0,o|0)|0,S[a+o>>0]=0,S[t>>0]&1){e[t+4>>2]=o;break}else{S[t>>0]=o<<1;break}else l?a=(a&255)>>>1:a=e[t+4>>2]|0,qs(t,h,o-h|0,a,0,a,o,r);while(!1);return t|0}function zs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;a=S[t>>0]|0,l=(a&1)==0,l?a=(a&255)>>>1:a=e[t+4>>2]|0;do if(a>>>0>=r>>>0)if(l){S[t+1+r>>0]=0,S[t>>0]=r<<1;break}else{S[(e[t+8>>2]|0)+r>>0]=0,e[t+4>>2]=r;break}else vp(t,r-a|0,o)|0;while(!1)}function vp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;return r&&(a=S[t>>0]|0,a&1?(a=e[t>>2]|0,l=(a&-2)+-1|0,a=a&255):l=10,a&1?h=e[t+4>>2]|0:h=(a&255)>>>1,(l-h|0)>>>0>>0&&(pr(t,l,r-l+h|0,h,h,0,0),a=S[t>>0]|0),a&1?l=e[t+8>>2]|0:l=t+1|0,Jt(l+h|0,o|0,r|0)|0,a=h+r|0,S[t>>0]&1?e[t+4>>2]=a:S[t>>0]=a<<1,S[l+a>>0]=0),t|0}function xp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;r>>>0>4294967279&&si(t),o=S[t>>0]|0,o&1?(o=e[t>>2]|0,a=(o&-2)+-1|0,o=o&255):a=10,o&1?w=e[t+4>>2]|0:w=(o&255)>>>1,r=w>>>0>r>>>0?w:r,r>>>0<11?d=10:d=(r+16&-16)+-1|0;e:do if((d|0)!=(a|0)){do if((d|0)!=10){if(r=d+1|0,d>>>0<=a>>>0){if(m=0,r=ge(67,r|0)|0,h=m,m=0,h&1){t=j(0)|0,K0(t|0)|0,ei();break e}}else r=Xe(r)|0;if(o&1){a=1,l=e[t+8>>2]|0,h=1;break}else{a=1,l=t+1|0,h=0;break}}else r=t+1|0,a=0,l=e[t+8>>2]|0,h=1;while(!1);if(o&1?o=e[t+4>>2]|0:o=(o&255)>>>1,o0(r|0,l|0,o+1|0)|0,h&&he(l),a){e[t>>2]=d+1|1,e[t+4>>2]=w,e[t+8>>2]=r;break}else{S[t>>0]=w<<1;break}}while(!1)}function wp(t,r){return t=t|0,r=r|0,Gs(t,r,$i(r)|0)|0}function yp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;o=S[t>>0]|0,a=(o&1)!=0,a?(l=(e[t>>2]&-2)+-1|0,h=e[t+4>>2]|0):(l=10,h=(o&255)>>>1),(h|0)==(l|0)?(pr(t,l,1,l,l,0,0),S[t>>0]&1?l=8:l=7):a?l=8:l=7,(l|0)==7?(S[t>>0]=(h<<1)+2,o=t+1|0,a=h+1|0):(l|0)==8&&(o=e[t+8>>2]|0,a=h+1|0,e[t+4>>2]=a),S[o+h>>0]=r,S[o+a>>0]=0}function Gs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;return a=S[t>>0]|0,a&1?(a=e[t>>2]|0,l=(a&-2)+-1|0,a=a&255):l=10,a&1?h=e[t+4>>2]|0:h=(a&255)>>>1,(l-h|0)>>>0>=o>>>0?o&&(a&1?l=e[t+8>>2]|0:l=t+1|0,o0(l+h|0,r|0,o|0)|0,a=h+o|0,S[t>>0]&1?e[t+4>>2]=a:S[t>>0]=a<<1,S[l+a>>0]=0):qs(t,l,o-l+h|0,h,h,0,o,r),t|0}function qs(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0;(-18-r|0)>>>0>>0&&si(t),S[t>>0]&1?E=e[t+8>>2]|0:E=t+1|0,r>>>0<2147483623?(C=o+r|0,D=r<<1,C=C>>>0>>0?D:C,C=C>>>0<11?11:C+16&-16):C=-17,D=Xe(C)|0,l&&o0(D|0,E|0,l|0)|0,d&&o0(D+l|0,w|0,d|0)|0,o=a-h|0,(o|0)!=(l|0)&&o0(D+(d+l)|0,E+(h+l)|0,o-l|0)|0,(r|0)!=10&&he(E),e[t+8>>2]=D,e[t>>2]=C|1,r=o+d|0,e[t+4>>2]=r,S[D+r>>0]=0}function pr(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0;(-17-r|0)>>>0>>0&&si(t),S[t>>0]&1?D=e[t+8>>2]|0:D=t+1|0,r>>>0<2147483623?(w=o+r|0,C=r<<1,w=w>>>0>>0?C:w,w=w>>>0<11?11:w+16&-16):w=-17,C=Xe(w)|0,l&&o0(C|0,D|0,l|0)|0,o=a-h|0,(o|0)!=(l|0)&&o0(C+(d+l)|0,D+(h+l)|0,o-l|0)|0,(r|0)!=10&&he(D),e[t+8>>2]=C,e[t>>2]=w|1}function mr(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;o>>>0>1073741807&&si(t),o>>>0<2?(S[t>>0]=o<<1,t=t+4|0):(l=o+4&-4,a=Xe(l<<2)|0,e[t+8>>2]=a,e[t>>2]=l|1,e[t+4>>2]=o,t=a),Bi(t,r,o)|0,e[t+(o<<2)>>2]=0}function gr(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;r>>>0>1073741807&&si(t),r>>>0<2?(S[t>>0]=r<<1,t=t+4|0):(l=r+4&-4,a=Xe(l<<2)|0,e[t+8>>2]=a,e[t>>2]=l|1,e[t+4>>2]=r,t=a),GS(t,o,r)|0,e[t+(r<<2)>>2]=0}function Pt(t){t=t|0,S[t>>0]&1&&he(e[t+8>>2]|0)}function Cp(t,r){return t=t|0,r=r|0,Tp(t,r,_n(r)|0)|0}function Tp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;a=S[t>>0]|0,a&1?(a=e[t>>2]|0,h=(a&-2)+-1|0,a=a&255):h=1,l=(a&1)==0;do if(h>>>0>=o>>>0)if(l?a=t+4|0:a=e[t+8>>2]|0,zS(a,r,o)|0,e[a+(o<<2)>>2]=0,S[t>>0]&1){e[t+4>>2]=o;break}else{S[t>>0]=o<<1;break}else l?a=(a&255)>>>1:a=e[t+4>>2]|0,Ep(t,h,o-h|0,a,0,a,o,r);while(!1);return t|0}function Ip(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;r>>>0>1073741807&&si(t),o=S[t>>0]|0,o&1?(o=e[t>>2]|0,a=(o&-2)+-1|0,o=o&255):a=1,o&1?w=e[t+4>>2]|0:w=(o&255)>>>1,r=w>>>0>r>>>0?w:r,r>>>0<2?d=1:d=(r+4&-4)+-1|0;e:do if((d|0)!=(a|0)){do if((d|0)!=1){if(r=(d<<2)+4|0,d>>>0<=a>>>0){if(m=0,r=ge(67,r|0)|0,h=m,m=0,h&1){t=j(0)|0,K0(t|0)|0,ei();break e}}else r=Xe(r)|0;if(o&1){a=1,l=e[t+8>>2]|0,h=1;break}else{a=1,l=t+4|0,h=0;break}}else r=t+4|0,a=0,l=e[t+8>>2]|0,h=1;while(!1);if(o&1?o=e[t+4>>2]|0:o=(o&255)>>>1,Bi(r,l,o+1|0)|0,h&&he(l),a){e[t>>2]=d+1|1,e[t+4>>2]=w,e[t+8>>2]=r;break}else{S[t>>0]=w<<1;break}}while(!1)}function kp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;o=S[t>>0]|0,a=(o&1)!=0,a?(l=(e[t>>2]&-2)+-1|0,h=e[t+4>>2]|0):(l=1,h=(o&255)>>>1),(h|0)==(l|0)?(Ws(t,l,1,l,l,0,0),S[t>>0]&1?l=8:l=7):a?l=8:l=7,(l|0)==7?(S[t>>0]=(h<<1)+2,o=t+4|0,a=h+1|0):(l|0)==8&&(o=e[t+8>>2]|0,a=h+1|0,e[t+4>>2]=a),e[o+(h<<2)>>2]=r,e[o+(a<<2)>>2]=0}function Ep(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0;(1073741806-r|0)>>>0>>0&&si(t),S[t>>0]&1?E=e[t+8>>2]|0:E=t+4|0,r>>>0<536870887?(C=o+r|0,D=r<<1,C=C>>>0>>0?D:C,C=C>>>0<2?2:C+4&-4):C=1073741807,D=Xe(C<<2)|0,l&&Bi(D,E,l)|0,d&&Bi(D+(l<<2)|0,w,d)|0,o=a-h|0,(o|0)!=(l|0)&&Bi(D+(d+l<<2)|0,E+(h+l<<2)|0,o-l|0)|0,(r|0)!=1&&he(E),e[t+8>>2]=D,e[t>>2]=C|1,r=o+d|0,e[t+4>>2]=r,e[D+(r<<2)>>2]=0}function Ws(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0;(1073741807-r|0)>>>0>>0&&si(t),S[t>>0]&1?D=e[t+8>>2]|0:D=t+4|0,r>>>0<536870887?(w=o+r|0,C=r<<1,w=w>>>0>>0?C:w,w=w>>>0<2?2:w+4&-4):w=1073741807,C=Xe(w<<2)|0,l&&Bi(C,D,l)|0,o=a-h|0,(o|0)!=(l|0)&&Bi(C+(d+l<<2)|0,D+(h+l<<2)|0,o-l|0)|0,(r|0)!=1&&he(D),e[t+8>>2]=C,e[t>>2]=w|1}function Dp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;if(l=r,a=o-l|0,a>>>0>4294967279&&si(t),a>>>0<11?(S[t>>0]=a<<1,h=t+1|0):(d=a+16&-16,h=Xe(d)|0,e[t+8>>2]=h,e[t>>2]=d|1,e[t+4>>2]=a),t=o-l|0,(r|0)!=(o|0))for(a=h;S[a>>0]=S[r>>0]|0,r=r+1|0,(r|0)!=(o|0);)a=a+1|0;S[h+t>>0]=0}function bp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;if(h=r,a=o-h|0,l=a>>2,l>>>0>1073741807&&si(t),l>>>0<2?(S[t>>0]=a>>>1,t=t+4|0):(d=l+4&-4,a=Xe(d<<2)|0,e[t+8>>2]=a,e[t>>2]=d|1,e[t+4>>2]=l,t=a),l=(o-h|0)>>>2,(r|0)!=(o|0))for(a=t;e[a>>2]=e[r>>2],r=r+4|0,(r|0)!=(o|0);)a=a+4|0;e[t+(l<<2)>>2]=0}function Fp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;if(o=b,b=b+16|0,a=o,l=(e[t+24>>2]|0)==0,e[t+16>>2]=l&1|r,!((l&1|r)&e[t+20>>2])){b=o;return}r=Ct(16)|0,Tm()|0,e[a>>2]=1,e[a+4>>2]=43112,m=0,ve(11,r|0,57437,a|0),l=m,m=0,l&1?(l=j()|0,It(r|0),le(l|0)):Qt(r|0,864,112)}function G0(t){t=t|0;var r=0;if(e[t>>2]=43068,m=0,Ae(88,t|0,0),r=m,m=0,r&1)r=j(0)|0,$t(r);else{_0(t+28|0),n0(e[t+32>>2]|0),n0(e[t+36>>2]|0),n0(e[t+48>>2]|0),n0(e[t+60>>2]|0);return}}function tt(t){t=t|0,G0(t)}function mA(t){t=t|0,G0(t),he(t)}function Np(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;if(o=e[t+40>>2]|0,a=t+32|0,l=t+36|0,o)do o=o+-1|0,Ln[e[(e[a>>2]|0)+(o<<2)>>2]&15](r,t,e[(e[l>>2]|0)+(o<<2)>>2]|0);while(o|0)}function f0(t){t=t|0;var r=0,o=0;return o=b,b=b+16|0,r=o,tn(r,t+28|0),b=o,e[r>>2]|0}function Rp(t,r){t=t|0,r=r|0;var o=0;e[t+24>>2]=r,e[t+16>>2]=(r|0)==0&1,e[t+20>>2]=0,e[t+4>>2]=4098,e[t+12>>2]=0,e[t+8>>2]=6,o=t+28|0,r=t+32|0,t=r+40|0;do e[r>>2]=0,r=r+4|0;while((r|0)<(t|0));ur(o)}function mn(t){t=t|0,G0(t)}function gA(t){t=t|0,G0(t),he(t)}function wt(t){t=t|0,e[t>>2]=42760,_0(t+4|0)}function Mp(t){t=t|0,e[t>>2]=42760,_0(t+4|0),he(t)}function Sr(t){t=t|0,e[t>>2]=42760,ur(t+4|0),t=t+8|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[t+20>>2]=0}function _p(t,r){t=t|0,r=r|0}function Pp(t,r,o){return t=t|0,r=r|0,o=o|0,t|0}function Lp(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function Op(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function $p(t){return t=t|0,0}function Bp(t){return t=t|0,0}function Vp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;h=t+12|0,d=t+16|0;e:do if((o|0)>0)for(l=r,r=0;;){if(a=e[h>>2]|0,a>>>0<(e[d>>2]|0)>>>0)e[h>>2]=a+1,a=S[a>>0]|0;else{if(a=Et[e[(e[t>>2]|0)+40>>2]&127](t)|0,(a|0)==-1)break e;a=a&255}if(S[l>>0]=a,r=r+1|0,(r|0)<(o|0))l=l+1|0;else break}else r=0;while(!1);return r|0}function Up(t){return t=t|0,-1}function zp(t){t=t|0;var r=0;return(Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1?t=-1:(r=t+12|0,t=e[r>>2]|0,e[r>>2]=t+1,t=N[t>>0]|0),t|0}function Gp(t,r){return t=t|0,r=r|0,-1}function qp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;h=t+24|0,d=t+28|0;e:do if((o|0)>0)for(l=r,r=0;;){if(a=e[h>>2]|0,a>>>0>=(e[d>>2]|0)>>>0){if((U0[e[(e[t>>2]|0)+52>>2]&63](t,N[l>>0]|0)|0)==-1)break e}else w=S[l>>0]|0,e[h>>2]=a+1,S[a>>0]=w;if(r=r+1|0,(r|0)<(o|0))l=l+1|0;else break}else r=0;while(!1);return r|0}function Wp(t,r){return t=t|0,r=r|0,-1}function rn(t){t=t|0,e[t>>2]=42824,_0(t+4|0)}function Hp(t){t=t|0,e[t>>2]=42824,_0(t+4|0),he(t)}function Hs(t){t=t|0,e[t>>2]=42824,ur(t+4|0),t=t+8|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[t+20>>2]=0}function Qp(t,r){t=t|0,r=r|0}function Kp(t,r,o){return t=t|0,r=r|0,o=o|0,t|0}function Yp(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function jp(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function Xp(t){return t=t|0,0}function Zp(t){return t=t|0,0}function Jp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;h=t+12|0,d=t+16|0;e:do if((o|0)>0)for(l=r,r=0;;){if(a=e[h>>2]|0,a>>>0>=(e[d>>2]|0)>>>0){if(a=Et[e[(e[t>>2]|0)+40>>2]&127](t)|0,(a|0)==-1)break e}else e[h>>2]=a+4,a=e[a>>2]|0;if(e[l>>2]=a,r=r+1|0,(r|0)<(o|0))l=l+4|0;else break}else r=0;while(!1);return r|0}function em(t){return t=t|0,-1}function tm(t){t=t|0;var r=0;return(Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1?t=-1:(r=t+12|0,t=e[r>>2]|0,e[r>>2]=t+4,t=e[t>>2]|0),t|0}function im(t,r){return t=t|0,r=r|0,-1}function nm(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;h=t+24|0,d=t+28|0;e:do if((o|0)>0)for(l=r,r=0;;){if(a=e[h>>2]|0,a>>>0>=(e[d>>2]|0)>>>0){if((U0[e[(e[t>>2]|0)+52>>2]&63](t,e[l>>2]|0)|0)==-1)break e}else w=e[l>>2]|0,e[h>>2]=a+4,e[a>>2]=w;if(r=r+1|0,(r|0)<(o|0))l=l+4|0;else break}else r=0;while(!1);return r|0}function rm(t,r){return t=t|0,r=r|0,-1}function sm(t){t=t|0,G0(t+8|0)}function om(t){t=t|0,G0(t+((e[(e[t>>2]|0)+-12>>2]|0)+8)|0)}function Qs(t){t=t|0,G0(t+8|0),he(t)}function am(t){t=t|0,Qs(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)}function Ks(t){t=t|0;var r=0,o=0,a=0,l=0;a=b,b=b+16|0,o=a;e:do if(e[t+((e[(e[t>>2]|0)+-12>>2]|0)+24)>>2]|0){m=0,Ae(65,o|0,t|0),r=m,m=0;t:do if(r&1)r=j(0)|0;else{do if(S[o>>0]|0){if(r=e[t+((e[(e[t>>2]|0)+-12>>2]|0)+24)>>2]|0,m=0,r=ge(e[(e[r>>2]|0)+24>>2]|0,r|0)|0,l=m,m=0,!(l&1)&&((r|0)!=-1||(l=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+l|0,e[t+(l+16)>>2]|1|0),l=m,m=0,!(l&1))))break;r=j(0)|0,ki(o);break t}while(!1);ki(o);break e}while(!1);if(K0(r|0)|0,m=0,ue(181,t+(e[(e[t>>2]|0)+-12>>2]|0)|0),l=m,m=0,!(l&1)){ei();break}r=j()|0,m=0,bt(3),l=m,m=0,l&1?(l=j(0)|0,$t(l)):le(r|0)}while(!1);return b=a,t|0}function lm(t){t=t|0;var r=0;if(r=t+16|0,e[r>>2]=e[r>>2]|1,e[t+20>>2]&1)Ur();else return}function um(t){t=t|0,G0(t+8|0)}function cm(t){t=t|0,G0(t+((e[(e[t>>2]|0)+-12>>2]|0)+8)|0)}function Ys(t){t=t|0,G0(t+8|0),he(t)}function fm(t){t=t|0,Ys(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)}function js(t){t=t|0;var r=0,o=0,a=0,l=0;a=b,b=b+16|0,o=a;e:do if(e[t+((e[(e[t>>2]|0)+-12>>2]|0)+24)>>2]|0){m=0,Ae(89,o|0,t|0),r=m,m=0;t:do if(r&1)r=j(0)|0;else{do if(S[o>>0]|0){if(r=e[t+((e[(e[t>>2]|0)+-12>>2]|0)+24)>>2]|0,m=0,r=ge(e[(e[r>>2]|0)+24>>2]|0,r|0)|0,l=m,m=0,!(l&1)&&((r|0)!=-1||(l=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+l|0,e[t+(l+16)>>2]|1|0),l=m,m=0,!(l&1))))break;r=j(0)|0,Js(o);break t}while(!1);Js(o);break e}while(!1);if(K0(r|0)|0,m=0,ue(181,t+(e[(e[t>>2]|0)+-12>>2]|0)|0),l=m,m=0,!(l&1)){ei();break}r=j()|0,m=0,bt(3),l=m,m=0,l&1?(l=j(0)|0,$t(l)):le(r|0)}while(!1);return b=a,t|0}function SA(t,r){t=t|0,r=r|0}function hm(t){t=t|0,G0(t+4|0)}function dm(t){t=t|0,G0(t+((e[(e[t>>2]|0)+-12>>2]|0)+4)|0)}function Xs(t){t=t|0,G0(t+4|0),he(t)}function pm(t){t=t|0,Xs(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)}function mm(t,r){t=t|0,r=r|0;var o=0;S[t>>0]=0,e[t+4>>2]=r,o=e[(e[r>>2]|0)+-12>>2]|0,e[r+(o+16)>>2]|0||(o=e[r+(o+72)>>2]|0,o&&Ks(o)|0,S[t>>0]=1)}function ki(t){t=t|0;var r=0,o=0;t=t+4|0,o=e[t>>2]|0,r=e[(e[o>>2]|0)+-12>>2]|0;do if(e[o+(r+24)>>2]|0&&!(e[o+(r+16)>>2]|0)&&e[o+(r+4)>>2]&8192|0&&!(Or()|0)){if(r=e[t>>2]|0,r=e[r+((e[(e[r>>2]|0)+-12>>2]|0)+24)>>2]|0,m=0,r=ge(e[(e[r>>2]|0)+24>>2]|0,r|0)|0,o=m,m=0,!(o&1)&&((r|0)!=-1||(r=e[t>>2]|0,o=e[(e[r>>2]|0)+-12>>2]|0,m=0,Ae(66,r+o|0,e[r+(o+16)>>2]|1|0),o=m,m=0,!(o&1))))break;o=j(0)|0,K0(o|0)|0,m=0,bt(3),o=m,m=0,o&1&&(o=j(0)|0,$t(o))}while(!1)}function gm(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;R=b,b=b+32|0,w=R+20|0,C=R+16|0,E=R+8|0,o=R,m=0,Ae(65,E|0,t|0),D=m,m=0;e:do if(D&1)o=j(0)|0,a=t,l=t,F=19;else{do if(S[E>>0]|0){if(D=f0(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)|0,e[o>>2]=D,m=0,D=Ne(37,o|0,43392)|0,d=m,m=0,d&1)F=j(0)|0,_0(o),o=F;else{_0(o),l=e[(e[t>>2]|0)+-12>>2]|0,d=e[t+(l+24)>>2]|0,a=t+l|0,l=t+(l+76)|0,o=e[l>>2]|0;do if((o|0)==-1){if(o=f0(a)|0,e[w>>2]=o,m=0,o=Ne(37,w|0,44220)|0,_=m,m=0,!(_&1)&&(m=0,h=Ne(e[(e[o>>2]|0)+28>>2]|0,o|0,32)|0,_=m,m=0,!(_&1))){_0(w),o=h<<24>>24,e[l>>2]=o,F=10;break}o=j(0)|0,_0(w)}else F=10;while(!1);if((F|0)==10){if(_=e[(e[D>>2]|0)+16>>2]|0,e[C>>2]=d,m=0,e[w>>2]=e[C>>2],o=se(_|0,D|0,w|0,a|0,o&255|0,r|0)|0,_=m,m=0,!(_&1)&&(o||(_=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+_|0,e[t+(_+16)>>2]|5|0),_=m,m=0,!(_&1))))break;o=j(0)|0}}ki(E),a=t,l=t,F=19;break e}while(!1);ki(E)}while(!1);do if((F|0)==19){if(K0(o|0)|0,m=0,ue(181,a+(e[(e[l>>2]|0)+-12>>2]|0)|0),_=m,m=0,!(_&1)){ei();break}o=j()|0,m=0,bt(3),_=m,m=0,_&1?(_=j(0)|0,$t(_)):le(o|0)}while(!1);return b=R,t|0}function Sm(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;R=b,b=b+32|0,w=R+20|0,C=R+16|0,E=R+8|0,o=R,m=0,Ae(65,E|0,t|0),D=m,m=0;e:do if(D&1)o=j(0)|0,a=t,l=t,F=19;else{do if(S[E>>0]|0){if(D=f0(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)|0,e[o>>2]=D,m=0,D=Ne(37,o|0,43392)|0,d=m,m=0,d&1)F=j(0)|0,_0(o),o=F;else{_0(o),l=e[(e[t>>2]|0)+-12>>2]|0,d=e[t+(l+24)>>2]|0,a=t+l|0,l=t+(l+76)|0,o=e[l>>2]|0;do if((o|0)==-1){if(o=f0(a)|0,e[w>>2]=o,m=0,o=Ne(37,w|0,44220)|0,_=m,m=0,!(_&1)&&(m=0,h=Ne(e[(e[o>>2]|0)+28>>2]|0,o|0,32)|0,_=m,m=0,!(_&1))){_0(w),o=h<<24>>24,e[l>>2]=o,F=10;break}o=j(0)|0,_0(w)}else F=10;while(!1);if((F|0)==10){if(_=e[(e[D>>2]|0)+24>>2]|0,e[C>>2]=d,m=0,e[w>>2]=e[C>>2],o=se(_|0,D|0,w|0,a|0,o&255|0,r|0)|0,_=m,m=0,!(_&1)&&(o||(_=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+_|0,e[t+(_+16)>>2]|5|0),_=m,m=0,!(_&1))))break;o=j(0)|0}}ki(E),a=t,l=t,F=19;break e}while(!1);ki(E)}while(!1);do if((F|0)==19){if(K0(o|0)|0,m=0,ue(181,a+(e[(e[l>>2]|0)+-12>>2]|0)|0),_=m,m=0,!(_&1)){ei();break}o=j()|0,m=0,bt(3),_=m,m=0,_&1?(_=j(0)|0,$t(_)):le(o|0)}while(!1);return b=R,t|0}function Am(t){t=t|0,G0(t+4|0)}function vm(t){t=t|0,G0(t+((e[(e[t>>2]|0)+-12>>2]|0)+4)|0)}function Zs(t){t=t|0,G0(t+4|0),he(t)}function xm(t){t=t|0,Zs(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)}function wm(t,r){t=t|0,r=r|0;var o=0;S[t>>0]=0,e[t+4>>2]=r,o=e[(e[r>>2]|0)+-12>>2]|0,e[r+(o+16)>>2]|0||(o=e[r+(o+72)>>2]|0,o&&js(o)|0,S[t>>0]=1)}function Js(t){t=t|0;var r=0,o=0;t=t+4|0,o=e[t>>2]|0,r=e[(e[o>>2]|0)+-12>>2]|0;do if(e[o+(r+24)>>2]|0&&!(e[o+(r+16)>>2]|0)&&e[o+(r+4)>>2]&8192|0&&!(Or()|0)){if(r=e[t>>2]|0,r=e[r+((e[(e[r>>2]|0)+-12>>2]|0)+24)>>2]|0,m=0,r=ge(e[(e[r>>2]|0)+24>>2]|0,r|0)|0,o=m,m=0,!(o&1)&&((r|0)!=-1||(r=e[t>>2]|0,o=e[(e[r>>2]|0)+-12>>2]|0,m=0,Ae(66,r+o|0,e[r+(o+16)>>2]|1|0),o=m,m=0,!(o&1))))break;o=j(0)|0,K0(o|0)|0,m=0,bt(3),o=m,m=0,o&1&&(o=j(0)|0,$t(o))}while(!1)}function ym(t){return t=t|0,57453}function Cm(t,r,o){t=t|0,r=r|0,o=o|0,(o|0)!=1&(o|0)<257?up(t,r,o):yi(t,57462,35)}function Tm(){return!(S[1048]|0)&&kt(1048)|0&&(e[10778]=43084,Nt(72,43112,Q|0)|0,Dt(1048)),43112}function Im(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;a=b,b=b+16|0,l=a+8|0,h=a,w=o,d=e[w+4>>2]|0,o=h,e[o>>2]=e[w>>2],e[o+4>>2]=d,e[l>>2]=e[h>>2],e[l+4>>2]=e[h+4>>2],fp(t,l,r),e[t>>2]=43048,b=a}function km(t){t=t|0,fr(t)}function Em(t){t=t|0,fr(t),he(t)}function Dm(t){t=t|0,G0(t),he(t)}function bm(t){t=t|0,he(t)}function Fm(t){t=t|0}function Nm(t){t=t|0}function Rm(t){t=t|0,he(t)}function Mm(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;e:do if((a|0)==(l|0))d=6;else for(;;){if((r|0)==(o|0)){r=-1;break e}if(t=S[r>>0]|0,h=S[a>>0]|0,t<<24>>24>24){r=-1;break e}if(h<<24>>24>24){r=1;break e}if(r=r+1|0,a=a+1|0,(a|0)==(l|0)){d=6;break}}while(!1);return(d|0)==6&&(r=(r|0)!=(o|0)&1),r|0}function _m(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,Dp(t,o,a)}function Pm(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if((r|0)==(o|0))t=0;else{t=0;do t=(S[r>>0]|0)+(t<<4)|0,a=t&-268435456,t=(a>>>24|a)^t,r=r+1|0;while((r|0)!=(o|0))}return t|0}function Lm(t){t=t|0}function Om(t){t=t|0,he(t)}function $m(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;e:do if((a|0)==(l|0))d=6;else for(;;){if((r|0)==(o|0)){r=-1;break e}if(t=e[r>>2]|0,h=e[a>>2]|0,(t|0)<(h|0)){r=-1;break e}if((h|0)<(t|0)){r=1;break e}if(r=r+4|0,a=a+4|0,(a|0)==(l|0)){d=6;break}}while(!1);return(d|0)==6&&(r=(r|0)!=(o|0)&1),r|0}function Bm(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,bp(t,o,a)}function Vm(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if((r|0)==(o|0))t=0;else{t=0;do t=(e[r>>2]|0)+(t<<4)|0,a=t&-268435456,t=(a>>>24|a)^t,r=r+4|0;while((r|0)!=(o|0))}return t|0}function Um(t){t=t|0}function zm(t){t=t|0,he(t)}function Gm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;U=b,b=b+64|0,R=U+56|0,d=U+52|0,E=U+48|0,w=U+44|0,C=U+40|0,D=U+36|0,F=U+32|0,H=U+8|0,_=U;e:do if(e[a+4>>2]&1){d=f0(a)|0,e[D>>2]=d,m=0,t=Ne(37,D|0,44220)|0,E=m,m=0;do if(E&1)H=j()|0,Bt(d)|0,d=H;else{if(Bt(d)|0,d=f0(a)|0,e[F>>2]=d,m=0,C=Ne(37,F|0,44360)|0,F=m,m=0,F&1){H=j()|0,Bt(d)|0,d=H;break}if(Bt(d)|0,m=0,Ae(e[(e[C>>2]|0)+24>>2]|0,H|0,C|0),F=m,m=0,F&1)w=H;else if(w=H+12|0,m=0,Ae(e[(e[C>>2]|0)+28>>2]|0,w|0,C|0),F=m,m=0,!(F&1))if(e[_>>2]=e[o>>2],m=0,e[R>>2]=e[_>>2],d=vt(7,r|0,R|0,H|0,H+24|0,t|0,l|0,1)|0,l=m,m=0,l&1){d=j()|0,de(H+12|0),de(H);break}else{S[h>>0]=(d|0)==(H|0)&1,d=e[r>>2]|0,de(H+12|0),de(H);break e}if(d=j()|0,C=ye,(H|0)!=(w|0))do w=w+-12|0,de(w);while((w|0)!=(H|0))}while(!1);le(d|0)}else switch(e[E>>2]=-1,H=e[(e[t>>2]|0)+16>>2]|0,e[w>>2]=e[r>>2],e[C>>2]=e[o>>2],e[d>>2]=e[w>>2],e[R>>2]=e[C>>2],d=on[H&63](t,d,R,a,l,E)|0,e[r>>2]=d,e[E>>2]|0){case 0:{S[h>>0]=0;break e}case 1:{S[h>>0]=1;break e}default:{S[h>>0]=1,e[l>>2]=4;break e}}while(!1);return b=U,d|0}function qm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=M4(t,C,w,a,l,h)|0,b=d,t|0}function Wm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=_4(t,C,w,a,l,h)|0,b=d,t|0}function Hm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=P4(t,C,w,a,l,h)|0,b=d,t|0}function Qm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=L4(t,C,w,a,l,h)|0,b=d,t|0}function Km(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=O4(t,C,w,a,l,h)|0,b=d,t|0}function Ym(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=$4(t,C,w,a,l,h)|0,b=d,t|0}function jm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=B4(t,C,w,a,l,h)|0,b=d,t|0}function Xm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=V4(t,C,w,a,l,h)|0,b=d,t|0}function Zm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=U4(t,C,w,a,l,h)|0,b=d,t|0}function Jm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0;ae=b,b=b+240|0,$=ae,_=ae+208|0,ce=ae+32|0,t=ae+28|0,re=ae+16|0,G=ae+12|0,H=ae+48|0,K=ae+8|0,U=ae+4|0,e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,m=0,a=ge(68,a|0)|0,R=m,m=0;do if(R&1)t=j()|0;else{if(e[t>>2]=a,m=0,t=Ne(37,t|0,44220)|0,R=m,m=0,!(R&1)&&(m=0,Pe(e[(e[t>>2]|0)+32>>2]|0,t|0,57498,57524,_|0)|0,R=m,m=0,!(R&1))){Bt(a)|0,e[re>>2]=0,e[re+4>>2]=0,e[re+8>>2]=0,S[re>>0]&1?t=(e[re>>2]&-2)+-1|0:t=10,m=0,ve(8,re|0,t|0,0),R=m,m=0;e:do if(R&1)Ee=30;else{F=re+8|0,R=re+1|0,a=S[re>>0]&1?e[F>>2]|0:R,e[G>>2]=a,e[K>>2]=H,e[U>>2]=0,E=re+4|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){Ee=29;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){Ee=29;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,Ee=19;break}}else Ee=19;while(!1);if((Ee|0)==19)if(Ee=0,w){d=0;break}else d=0;if(w=S[re>>0]|0,w=w&1?e[E>>2]|0:(w&255)>>>1,(e[G>>2]|0)==(a+w|0)){if(m=0,ve(8,re|0,w<<1|0,0),D=m,m=0,D&1){Ee=29;break}if(S[re>>0]&1?a=(e[re>>2]&-2)+-1|0:a=10,m=0,ve(8,re|0,a|0,0),D=m,m=0,D&1){Ee=29;break}a=S[re>>0]&1?e[F>>2]|0:R,e[G>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ke=m,m=0,ke&1){Ee=29;break}}else w=N[w>>0]|0;if(_i(w&255,16,a,G,U,0,ce,H,K,_)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ke=m,m=0,ke&1){Ee=29;break}else continue;else{e[C>>2]=d+1;continue}}if((Ee|0)==29){t=j()|0;break}if(m=0,ve(8,re|0,(e[G>>2]|0)-a|0,0),ke=m,m=0,!(ke&1)&&(P=S[re>>0]|0,L=e[F>>2]|0,m=0,J=Ce(3)|0,ke=m,m=0,!(ke&1))&&(m=0,e[$>>2]=h,ne=Pe(16,(P&1?L:R)|0,J|0,58882,$|0)|0,ke=m,m=0,!(ke&1))){if((ne|0)!=1&&(e[l>>2]=4),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ke=m,m=0,ke&1){Ee=30;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ke=m,m=0,ke&1){Ee=30;break e}if((t|0)==-1){e[o>>2]=0,Ee=55;break}}a||(Ee=56)}else Ee=55;while(!1);return(Ee|0)==55&&a&&(Ee=56),(Ee|0)==56&&(e[l>>2]=e[l>>2]|2),ke=e[r>>2]|0,de(re),de(ce),b=ae,ke|0}else Ee=30}while(!1);(Ee|0)==30&&(t=j()|0),de(re);break}t=j()|0,Bt(a)|0}while(!1);return de(ce),le(t|0),0}function _i(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0;R=e[a>>2]|0,_=(R|0)==(o|0);do if(_){if(E=(S[D+24>>0]|0)==t<<24>>24,!E&&(S[D+25>>0]|0)!=t<<24>>24){F=5;break}e[a>>2]=o+1,S[o>>0]=E?43:45,e[l>>2]=0,E=0}else F=5;while(!1);e:do if((F|0)==5){if(F=S[d>>0]|0,t<<24>>24==h<<24>>24&&(F&1?e[d+4>>2]|0:(F&255)>>>1)|0){if(E=e[C>>2]|0,(E-w|0)>=160){E=0;break}r=e[l>>2]|0,e[C>>2]=E+4,e[E>>2]=r,e[l>>2]=0,E=0;break}for(d=D+26|0,E=D;(S[E>>0]|0)!=t<<24>>24;)if(E=E+1|0,(E|0)==(d|0)){E=d;break}if(E=E-D|0,(E|0)>23)E=-1;else{switch(r|0){case 10:case 8:{if((E|0)>=(r|0)){E=-1;break e}break}case 16:{if((E|0)>=22){if(_){E=-1;break e}if((R-o|0)>=3){E=-1;break e}if((S[R+-1>>0]|0)!=48){E=-1;break e}e[l>>2]=0,E=S[57498+E>>0]|0,e[a>>2]=R+1,S[R>>0]=E,E=0;break e}break}default:}E=S[57498+E>>0]|0,e[a>>2]=R+1,S[R>>0]=E,e[l>>2]=(e[l>>2]|0)+1,E=0}}while(!1);return E|0}function b0(){var t=0,r=0;do if(!(S[1968]|0)&&kt(1968)|0)if(m=0,t=Ve(31,2147483647,58885,0)|0,r=m,m=0,r&1)r=j()|0,W0(1968),le(r|0);else{e[11196]=t,Dt(1968);break}while(!1);return e[11196]|0}function eg(t){t=t|0}function tg(t){t=t|0,he(t)}function ig(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;U=b,b=b+64|0,R=U+56|0,d=U+52|0,E=U+48|0,w=U+44|0,C=U+40|0,D=U+36|0,F=U+32|0,H=U+8|0,_=U;e:do if(e[a+4>>2]&1){d=f0(a)|0,e[D>>2]=d,m=0,t=Ne(37,D|0,44212)|0,E=m,m=0;do if(E&1)H=j()|0,Bt(d)|0,d=H;else{if(Bt(d)|0,d=f0(a)|0,e[F>>2]=d,m=0,C=Ne(37,F|0,44368)|0,F=m,m=0,F&1){H=j()|0,Bt(d)|0,d=H;break}if(Bt(d)|0,m=0,Ae(e[(e[C>>2]|0)+24>>2]|0,H|0,C|0),F=m,m=0,F&1)w=H;else if(w=H+12|0,m=0,Ae(e[(e[C>>2]|0)+28>>2]|0,w|0,C|0),F=m,m=0,!(F&1))if(e[_>>2]=e[o>>2],m=0,e[R>>2]=e[_>>2],d=vt(8,r|0,R|0,H|0,H+24|0,t|0,l|0,1)|0,l=m,m=0,l&1){d=j()|0,Pt(H+12|0),Pt(H);break}else{S[h>>0]=(d|0)==(H|0)&1,d=e[r>>2]|0,Pt(H+12|0),Pt(H);break e}if(d=j()|0,C=ye,(H|0)!=(w|0))do w=w+-12|0,Pt(w);while((w|0)!=(H|0))}while(!1);le(d|0)}else switch(e[E>>2]=-1,H=e[(e[t>>2]|0)+16>>2]|0,e[w>>2]=e[r>>2],e[C>>2]=e[o>>2],e[d>>2]=e[w>>2],e[R>>2]=e[C>>2],d=on[H&63](t,d,R,a,l,E)|0,e[r>>2]=d,e[E>>2]|0){case 0:{S[h>>0]=0;break e}case 1:{S[h>>0]=1;break e}default:{S[h>>0]=1,e[l>>2]=4;break e}}while(!1);return b=U,d|0}function ng(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=G4(t,C,w,a,l,h)|0,b=d,t|0}function rg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=q4(t,C,w,a,l,h)|0,b=d,t|0}function sg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=W4(t,C,w,a,l,h)|0,b=d,t|0}function og(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=H4(t,C,w,a,l,h)|0,b=d,t|0}function ag(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=Q4(t,C,w,a,l,h)|0,b=d,t|0}function lg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=K4(t,C,w,a,l,h)|0,b=d,t|0}function ug(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=Y4(t,C,w,a,l,h)|0,b=d,t|0}function cg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=j4(t,C,w,a,l,h)|0,b=d,t|0}function fg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=X4(t,C,w,a,l,h)|0,b=d,t|0}function hg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0;ae=b,b=b+320|0,$=ae,_=ae+208|0,ce=ae+32|0,t=ae+28|0,re=ae+16|0,G=ae+12|0,H=ae+48|0,K=ae+8|0,U=ae+4|0,e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,m=0,a=ge(68,a|0)|0,R=m,m=0;do if(R&1)t=j()|0;else{if(e[t>>2]=a,m=0,t=Ne(37,t|0,44212)|0,R=m,m=0,!(R&1)&&(m=0,Pe(e[(e[t>>2]|0)+48>>2]|0,t|0,57498,57524,_|0)|0,R=m,m=0,!(R&1))){Bt(a)|0,e[re>>2]=0,e[re+4>>2]=0,e[re+8>>2]=0,S[re>>0]&1?t=(e[re>>2]&-2)+-1|0:t=10,m=0,ve(8,re|0,t|0,0),R=m,m=0;e:do if(R&1)Ee=31;else{F=re+8|0,R=re+1|0,t=S[re>>0]&1?e[F>>2]|0:R,e[G>>2]=t,e[K>>2]=H,e[U>>2]=0,E=re+4|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){Ee=30;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){Ee=30;break t}}else d=e[d>>2]|0;if((d|0)!=-1)if(w){d=C;break}else{d=C;break t}else{e[o>>2]=0,Ee=20;break}}else Ee=20;while(!1);if((Ee|0)==20)if(Ee=0,w){d=0;break}else d=0;if(w=S[re>>0]|0,w=w&1?e[E>>2]|0:(w&255)>>>1,(e[G>>2]|0)==(t+w|0)){if(m=0,ve(8,re|0,w<<1|0,0),D=m,m=0,D&1){Ee=30;break}if(S[re>>0]&1?t=(e[re>>2]&-2)+-1|0:t=10,m=0,ve(8,re|0,t|0,0),D=m,m=0,D&1){Ee=30;break}t=S[re>>0]&1?e[F>>2]|0:R,e[G>>2]=t+w}if(C=a+12|0,w=e[C>>2]|0,D=a+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ke=m,m=0,ke&1){Ee=30;break}}else w=e[w>>2]|0;if(Pi(w,16,t,G,U,0,ce,H,K,_)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ke=m,m=0,ke&1){Ee=30;break}else{d=a;continue}else{e[C>>2]=d+4,d=a;continue}}if((Ee|0)==30){t=j()|0;break}if(m=0,ve(8,re|0,(e[G>>2]|0)-t|0,0),ke=m,m=0,!(ke&1)&&(P=S[re>>0]|0,L=e[F>>2]|0,m=0,J=Ce(3)|0,ke=m,m=0,!(ke&1))&&(m=0,e[$>>2]=h,ne=Pe(16,(P&1?L:R)|0,J|0,58882,$|0)|0,ke=m,m=0,!(ke&1))){if((ne|0)!=1&&(e[l>>2]=4),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ke=m,m=0,ke&1){Ee=31;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ke=m,m=0,ke&1){Ee=31;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;Ee=59;break}else{e[o>>2]=0,Ee=57;break}}else Ee=57;while(!1);return(Ee|0)==57&&a&&(Ee=59),(Ee|0)==59&&(e[l>>2]=e[l>>2]|2),ke=e[r>>2]|0,de(re),de(ce),b=ae,ke|0}else Ee=31}while(!1);(Ee|0)==31&&(t=j()|0),de(re);break}t=j()|0,Bt(a)|0}while(!1);return de(ce),le(t|0),0}function Pi(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0;R=e[a>>2]|0,_=(R|0)==(o|0);do if(_){if(E=(e[D+96>>2]|0)==(t|0),!E&&(e[D+100>>2]|0)!=(t|0)){F=5;break}e[a>>2]=o+1,S[o>>0]=E?43:45,e[l>>2]=0,E=0}else F=5;while(!1);e:do if((F|0)==5){if(F=S[d>>0]|0,(t|0)==(h|0)&&(F&1?e[d+4>>2]|0:(F&255)>>>1)|0){if(E=e[C>>2]|0,(E-w|0)>=160){E=0;break}r=e[l>>2]|0,e[C>>2]=E+4,e[E>>2]=r,e[l>>2]=0,E=0;break}for(d=D+104|0,E=D;(e[E>>2]|0)!=(t|0);)if(E=E+4|0,(E|0)==(d|0)){E=d;break}if(E=E-D|0,d=E>>2,(E|0)>92)E=-1;else{switch(r|0){case 10:case 8:{if((d|0)>=(r|0)){E=-1;break e}break}case 16:{if((E|0)>=88){if(_){E=-1;break e}if((R-o|0)>=3){E=-1;break e}if((S[R+-1>>0]|0)!=48){E=-1;break e}e[l>>2]=0,E=S[57498+d>>0]|0,e[a>>2]=R+1,S[R>>0]=E,E=0;break e}break}default:}E=S[57498+d>>0]|0,e[a>>2]=R+1,S[R>>0]=E,e[l>>2]=(e[l>>2]|0)+1,E=0}}while(!1);return E|0}function qi(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;if(C=b,b=b+16|0,w=C,r=f0(r)|0,e[w>>2]=r,m=0,l=Ne(37,w|0,44220)|0,D=m,m=0,!(D&1)&&(m=0,Pe(e[(e[l>>2]|0)+32>>2]|0,l|0,57498,57524,o|0)|0,D=m,m=0,!(D&1))&&(m=0,d=Ne(37,w|0,44360)|0,D=m,m=0,!(D&1))&&(m=0,h=ge(e[(e[d>>2]|0)+16>>2]|0,d|0)|0,D=m,m=0,!(D&1))&&(S[a>>0]=h,m=0,Ae(e[(e[d>>2]|0)+20>>2]|0,t|0,d|0),D=m,m=0,!(D&1))){Bt(r)|0,b=C;return}D=j()|0,Bt(r)|0,le(D|0)}function Ar(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(E=b,b=b+16|0,D=E,r=f0(r)|0,e[D>>2]=r,m=0,h=Ne(37,D|0,44220)|0,F=m,m=0,!(F&1)&&(m=0,Pe(e[(e[h>>2]|0)+32>>2]|0,h|0,57498,57530,o|0)|0,F=m,m=0,!(F&1))&&(m=0,C=Ne(37,D|0,44360)|0,F=m,m=0,!(F&1))&&(m=0,d=ge(e[(e[C>>2]|0)+12>>2]|0,C|0)|0,F=m,m=0,!(F&1))&&(S[a>>0]=d,m=0,w=ge(e[(e[C>>2]|0)+16>>2]|0,C|0)|0,F=m,m=0,!(F&1))&&(S[l>>0]=w,m=0,Ae(e[(e[C>>2]|0)+20>>2]|0,t|0,C|0),F=m,m=0,!(F&1))){Bt(r)|0,b=E;return}F=j()|0,Bt(r)|0,le(F|0)}function vr(t,r,o,a,l,h,d,w,C,D,E,F){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0;var R=0,_=0;e:do if(t<<24>>24==h<<24>>24)S[r>>0]|0?(S[r>>0]=0,o=e[l>>2]|0,e[l>>2]=o+1,S[o>>0]=46,o=S[w>>0]|0,(o&1?e[w+4>>2]|0:(o&255)>>>1)|0&&(R=e[D>>2]|0,(R-C|0)<160)&&(C=e[E>>2]|0,e[D>>2]=R+4,e[R>>2]=C),R=0):R=-1;else{if(t<<24>>24==d<<24>>24&&(d=S[w>>0]|0,((d&1?e[w+4>>2]|0:(d&255)>>>1)|0)!=0)){if(!(S[r>>0]|0)){R=-1;break}if(R=e[D>>2]|0,(R-C|0)>=160){R=0;break}C=e[E>>2]|0,e[D>>2]=R+4,e[R>>2]=C,e[E>>2]=0,R=0;break}for(h=F+32|0,R=F;(S[R>>0]|0)!=t<<24>>24;)if(R=R+1|0,(R|0)==(h|0)){R=h;break}if(h=R-F|0,(h|0)>31)R=-1;else switch(d=S[57498+h>>0]|0,h|0){case 24:case 25:{if(R=e[l>>2]|0,(R|0)!=(a|0)&&(N[R+-1>>0]&95|0)!=(N[o>>0]&127|0)){R=-1;break e}e[l>>2]=R+1,S[R>>0]=d,R=0;break e}case 23:case 22:{S[o>>0]=80,R=e[l>>2]|0,e[l>>2]=R+1,S[R>>0]=d,R=0;break e}default:{if(R=d&95,(R|0)==(S[o>>0]|0)&&(S[o>>0]=R|128,(S[r>>0]|0)!=0)&&(S[r>>0]=0,o=S[w>>0]|0,((o&1?e[w+4>>2]|0:(o&255)>>>1)|0)!=0)&&(_=e[D>>2]|0,(_-C|0)<160)&&(C=e[E>>2]|0,e[D>>2]=_+4,e[_>>2]=C),D=e[l>>2]|0,e[l>>2]=D+1,S[D>>0]=d,(h|0)>21){R=0;break e}e[E>>2]=(e[E>>2]|0)+1,R=0;break e}}}while(!1);return R|0}function Wi(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;if(C=b,b=b+16|0,w=C,r=f0(r)|0,e[w>>2]=r,m=0,l=Ne(37,w|0,44212)|0,D=m,m=0,!(D&1)&&(m=0,Pe(e[(e[l>>2]|0)+48>>2]|0,l|0,57498,57524,o|0)|0,D=m,m=0,!(D&1))&&(m=0,d=Ne(37,w|0,44368)|0,D=m,m=0,!(D&1))&&(m=0,h=ge(e[(e[d>>2]|0)+16>>2]|0,d|0)|0,D=m,m=0,!(D&1))&&(e[a>>2]=h,m=0,Ae(e[(e[d>>2]|0)+20>>2]|0,t|0,d|0),D=m,m=0,!(D&1))){Bt(r)|0,b=C;return}D=j()|0,Bt(r)|0,le(D|0)}function xr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(E=b,b=b+16|0,D=E,r=f0(r)|0,e[D>>2]=r,m=0,h=Ne(37,D|0,44212)|0,F=m,m=0,!(F&1)&&(m=0,Pe(e[(e[h>>2]|0)+48>>2]|0,h|0,57498,57530,o|0)|0,F=m,m=0,!(F&1))&&(m=0,C=Ne(37,D|0,44368)|0,F=m,m=0,!(F&1))&&(m=0,d=ge(e[(e[C>>2]|0)+12>>2]|0,C|0)|0,F=m,m=0,!(F&1))&&(e[a>>2]=d,m=0,w=ge(e[(e[C>>2]|0)+16>>2]|0,C|0)|0,F=m,m=0,!(F&1))&&(e[l>>2]=w,m=0,Ae(e[(e[C>>2]|0)+20>>2]|0,t|0,C|0),F=m,m=0,!(F&1))){Bt(r)|0,b=E;return}F=j()|0,Bt(r)|0,le(F|0)}function wr(t,r,o,a,l,h,d,w,C,D,E,F){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0;var R=0,_=0;e:do if((t|0)==(h|0))S[r>>0]|0?(S[r>>0]=0,o=e[l>>2]|0,e[l>>2]=o+1,S[o>>0]=46,o=S[w>>0]|0,(o&1?e[w+4>>2]|0:(o&255)>>>1)|0&&(R=e[D>>2]|0,(R-C|0)<160)&&(C=e[E>>2]|0,e[D>>2]=R+4,e[R>>2]=C),R=0):R=-1;else{if((t|0)==(d|0)&&(d=S[w>>0]|0,((d&1?e[w+4>>2]|0:(d&255)>>>1)|0)!=0)){if(!(S[r>>0]|0)){R=-1;break}if(R=e[D>>2]|0,(R-C|0)>=160){R=0;break}C=e[E>>2]|0,e[D>>2]=R+4,e[R>>2]=C,e[E>>2]=0,R=0;break}for(h=F+128|0,R=F;(e[R>>2]|0)!=(t|0);)if(R=R+4|0,(R|0)==(h|0)){R=h;break}if(h=R-F|0,R=h>>2,(h|0)<=124){switch(d=S[57498+R>>0]|0,R|0){case 24:case 25:{if(R=e[l>>2]|0,(R|0)!=(a|0)&&(N[R+-1>>0]&95|0)!=(N[o>>0]&127|0)){R=-1;break e}e[l>>2]=R+1,S[R>>0]=d,R=0;break e}case 23:case 22:{S[o>>0]=80;break}default:R=d&95,(R|0)==(S[o>>0]|0)&&(S[o>>0]=R|128,(S[r>>0]|0)!=0)&&(S[r>>0]=0,o=S[w>>0]|0,((o&1?e[w+4>>2]|0:(o&255)>>>1)|0)!=0)&&(_=e[D>>2]|0,(_-C|0)<160)&&(C=e[E>>2]|0,e[D>>2]=_+4,e[_>>2]=C)}D=e[l>>2]|0,e[l>>2]=D+1,S[D>>0]=d,(h|0)>84||(e[E>>2]=(e[E>>2]|0)+1),R=0}else R=-1}while(!1);return R|0}function dg(t){t=t|0}function pg(t){t=t|0,he(t)}function mg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;E=b,b=b+32|0,h=E+20|0,d=E+16|0,w=E+12|0,D=E;e:do if(!(e[o+4>>2]&1))D=e[(e[t>>2]|0)+24>>2]|0,e[d>>2]=e[r>>2],e[h>>2]=e[d>>2],h=an[D&31](t,h,o,a,l&1)|0;else{h=f0(o)|0,e[w>>2]=h,m=0,d=Ne(37,w|0,44360)|0,C=m,m=0;t:do if(C&1)E=j()|0,Bt(h)|0,h=E;else{Bt(h)|0,h=e[d>>2]|0,l?t0[e[h+24>>2]&127](D,d):t0[e[h+28>>2]&127](D,d),t=S[D>>0]|0,C=(t&1)==0,h=D+1|0,l=D+8|0,w=C?h:D+1|0,h=C?h:e[D+8>>2]|0,C=D+4|0,o=(t&1)==0;i:do if((h|0)!=((o?w:e[l>>2]|0)+(o?(t&255)>>>1:e[C>>2]|0)|0)){n:for(;;){d=S[h>>0]|0,a=e[r>>2]|0;do if(a){if(o=a+24|0,t=e[o>>2]|0,(t|0)!=(e[a+28>>2]|0)){e[o>>2]=t+1,S[t>>0]=d;break}if(m=0,d=Ne(e[(e[a>>2]|0)+52>>2]|0,a|0,d&255|0)|0,t=m,m=0,t&1)break n;(d|0)==-1&&(e[r>>2]=0)}while(!1);if(h=h+1|0,t=S[D>>0]|0,o=(t&1)==0,(h|0)==((o?w:e[l>>2]|0)+(o?(t&255)>>>1:e[C>>2]|0)|0))break i}h=j()|0,de(D);break t}while(!1);h=e[r>>2]|0,de(D);break e}while(!1);le(h|0)}while(!1);return b=E,h|0}function gg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+64|0,h=E,R=E+56|0,_=E+44|0,w=E+20|0,D=E+16|0,C=E+12|0,F=E+8|0,d=E+4|0,S[R>>0]=S[58887]|0,S[R+1>>0]=S[58888]|0,S[R+2>>0]=S[58889]|0,S[R+3>>0]=S[58890]|0,S[R+4>>0]=S[58891]|0,S[R+5>>0]=S[58892]|0,Ei(R+1|0,58893,1,e[o+4>>2]|0),t=b0()|0,e[h>>2]=l,l=_+(q0(_,12,t,R,h)|0)|0,R=ri(_,l,o)|0,t=f0(o)|0,e[F>>2]=t,m=0,dt(1,_|0,R|0,l|0,w|0,D|0,C|0,F|0),l=m,m=0,l&1)_=j()|0,Bt(t)|0,le(_|0);else return Bt(t)|0,e[d>>2]=e[r>>2],R=e[D>>2]|0,_=e[C>>2]|0,e[h>>2]=e[d>>2],_=Ui(h,w,R,_,o,a)|0,b=E,_|0;return 0}function Ei(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(a&2048&&(S[t>>0]=43,t=t+1|0),a&512&&(S[t>>0]=35,t=t+1|0),l=S[r>>0]|0,l<<24>>24)for(h=r;;)if(h=h+1|0,r=t+1|0,S[t>>0]=l,l=S[h>>0]|0,l<<24>>24)t=r;else{t=r;break}e:do switch(a&74|0){case 64:{S[t>>0]=111;break}case 8:if(a&16384){S[t>>0]=88;break e}else{S[t>>0]=120;break e}default:if(o){S[t>>0]=100;break e}else{S[t>>0]=117;break e}}while(!1)}function ri(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;e:do switch(e[o+4>>2]&176|0){case 16:{switch(o=S[t>>0]|0,o<<24>>24){case 43:case 45:{t=t+1|0;break e}default:}if((r-t|0)>1&o<<24>>24==48){switch(S[t+1>>0]|0){case 88:case 120:break;default:{a=7;break e}}t=t+2|0}else a=7;break}case 32:{t=r;break}default:a=7}while(!1);return t|0}function Sg(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0;G=b,b=b+16|0,$=G,H=O0(d,44220)|0,D=O0(d,44360)|0,t0[e[(e[D>>2]|0)+20>>2]&127]($,D),_=S[$>>0]|0,U=$+4|0;e:do if(!((_&1?e[U>>2]|0:(_&255)>>>1)|0))m=0,Pe(e[(e[H>>2]|0)+32>>2]|0,H|0,t|0,o|0,a|0)|0,K=m,m=0,K&1?K=5:(d=a+(o-t)|0,e[h>>2]=d,K=29);else{switch(e[h>>2]=a,d=S[t>>0]|0,d<<24>>24){case 43:case 45:{if(m=0,d=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,d|0)|0,_=m,m=0,_&1){K=5;break e}C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=d,C=t+1|0;break}default:C=t}t:do if((o-C|0)>1&&(S[C>>0]|0)==48){switch(d=C+1|0,S[d>>0]|0){case 88:case 120:break;default:break t}if(m=0,w=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,48)|0,_=m,m=0,_&1){K=5;break e}if(_=e[h>>2]|0,e[h>>2]=_+1,S[_>>0]=w,m=0,d=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,S[d>>0]|0)|0,_=m,m=0,_&1){K=5;break e}_=e[h>>2]|0,e[h>>2]=_+1,S[_>>0]=d,C=C+2|0}while(!1);if((C|0)!=(o|0)&&(E=o+-1|0,C>>>0>>0)){w=C,d=E;do _=S[w>>0]|0,S[w>>0]=S[d>>0]|0,S[d>>0]=_,w=w+1|0,d=d+-1|0;while(w>>>0>>0)}if(m=0,E=ge(e[(e[D>>2]|0)+16>>2]|0,D|0)|0,_=m,m=0,_&1)K=5;else{F=$+8|0,R=$+1|0;t:do if(C>>>0>>0){for(d=0,w=0,_=C;D=S[(S[$>>0]&1?e[F>>2]|0:R)+w>>0]|0,D<<24>>24!=0&(d|0)==(D<<24>>24|0)?(d=e[h>>2]|0,e[h>>2]=d+1,S[d>>0]=E,d=S[$>>0]|0,D=0,w=(w>>>0<((d&1?e[U>>2]|0:(d&255)>>>1)+-1|0)>>>0&1)+w|0):D=d,m=0,d=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,S[_>>0]|0)|0,P=m,m=0,!(P&1);){if(P=e[h>>2]|0,e[h>>2]=P+1,S[P>>0]=d,_=_+1|0,_>>>0>=o>>>0)break t;d=D+1|0}d=j()|0;break e}while(!1);if(w=t,d=a+(C-w)|0,t=e[h>>2]|0,(d|0)==(t|0))t=w,K=29;else{if(t=t+-1|0,d>>>0>>0)do P=S[d>>0]|0,S[d>>0]=S[t>>0]|0,S[t>>0]=P,d=d+1|0,t=t+-1|0;while(d>>>0>>0);t=w,d=e[h>>2]|0,K=29}}}while(!1);if((K|0)==5)d=j()|0;else if((K|0)==29){e[l>>2]=(r|0)==(o|0)?d:a+(r-t)|0,de($),b=G;return}de($),le(d|0)}function Ag(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(F=b,b=b+96|0,d=F+8|0,t=F,_=F+74|0,C=F+32|0,E=F+28|0,D=F+24|0,R=F+20|0,w=F+16|0,U=t,e[U>>2]=37,e[U+4>>2]=0,Ei(t+1|0,58895,1,e[o+4>>2]|0),U=b0()|0,H=d,e[H>>2]=l,e[H+4>>2]=h,h=_+(q0(_,22,U,t,d)|0)|0,l=ri(_,h,o)|0,t=f0(o)|0,e[R>>2]=t,m=0,dt(1,_|0,l|0,h|0,C|0,E|0,D|0,R|0),h=m,m=0,h&1)H=j()|0,Bt(t)|0,le(H|0);else return Bt(t)|0,e[w>>2]=e[r>>2],U=e[E>>2]|0,H=e[D>>2]|0,e[d>>2]=e[w>>2],H=Ui(d,C,U,H,o,a)|0,b=F,H|0;return 0}function vg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+64|0,h=E,R=E+56|0,_=E+44|0,w=E+20|0,D=E+16|0,C=E+12|0,F=E+8|0,d=E+4|0,S[R>>0]=S[58887]|0,S[R+1>>0]=S[58888]|0,S[R+2>>0]=S[58889]|0,S[R+3>>0]=S[58890]|0,S[R+4>>0]=S[58891]|0,S[R+5>>0]=S[58892]|0,Ei(R+1|0,58893,0,e[o+4>>2]|0),t=b0()|0,e[h>>2]=l,l=_+(q0(_,12,t,R,h)|0)|0,R=ri(_,l,o)|0,t=f0(o)|0,e[F>>2]=t,m=0,dt(1,_|0,R|0,l|0,w|0,D|0,C|0,F|0),l=m,m=0,l&1)_=j()|0,Bt(t)|0,le(_|0);else return Bt(t)|0,e[d>>2]=e[r>>2],R=e[D>>2]|0,_=e[C>>2]|0,e[h>>2]=e[d>>2],_=Ui(h,w,R,_,o,a)|0,b=E,_|0;return 0}function xg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(F=b,b=b+112|0,d=F+8|0,t=F,_=F+75|0,C=F+32|0,E=F+28|0,D=F+24|0,R=F+20|0,w=F+16|0,U=t,e[U>>2]=37,e[U+4>>2]=0,Ei(t+1|0,58895,0,e[o+4>>2]|0),U=b0()|0,H=d,e[H>>2]=l,e[H+4>>2]=h,h=_+(q0(_,23,U,t,d)|0)|0,l=ri(_,h,o)|0,t=f0(o)|0,e[R>>2]=t,m=0,dt(1,_|0,l|0,h|0,C|0,E|0,D|0,R|0),h=m,m=0,h&1)H=j()|0,Bt(t)|0,le(H|0);else return Bt(t)|0,e[w>>2]=e[r>>2],U=e[E>>2]|0,H=e[D>>2]|0,e[d>>2]=e[w>>2],H=Ui(d,C,U,H,o,a)|0,b=F,H|0;return 0}function wg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=+l;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;J=b,b=b+176|0,K=J+84|0,R=J+48|0,F=J+32|0,C=J+24|0,h=J+8|0,E=J,U=J+88|0,H=J+80|0,w=J+118|0,L=J+76|0,P=J+72|0,G=J+68|0,$=J+64|0,D=E,e[D>>2]=37,e[D+4>>2]=0,D=gn(E+1|0,58898,e[o+4>>2]|0)|0,e[H>>2]=U,t=b0()|0,D?(e[h>>2]=e[o+8>>2],B[h+8>>3]=l,h=q0(U,30,t,E,h)|0):(B[C>>3]=l,h=q0(U,30,t,E,C)|0);e:do if((h|0)>29){m=0,t=Ce(3)|0,h=m,m=0,h=h&1,D?!h&&(m=0,e[F>>2]=e[o+8>>2],B[F+8>>3]=l,d=Pe(17,H|0,t|0,E|0,F|0)|0,_=m,m=0,!(_&1))&&(ne=12):!h&&(m=0,e[R>>2]=e[o+8>>2],B[R+8>>3]=l,_=Pe(17,H|0,t|0,E|0,R|0)|0,R=m,m=0,!(R&1))&&(d=_,ne=12);do if((ne|0)==12){if(t=e[H>>2]|0,t)h=t;else{if(m=0,bt(6),_=m,m=0,_&1)break;h=e[H>>2]|0}t=h,E=h,ne=16;break e}while(!1);t=j()|0}else t=e[H>>2]|0,E=0,d=h,ne=16;while(!1);if((ne|0)==16){C=t+d|0,D=ri(t,C,o)|0;do if((t|0)==(U|0))t=U,h=0,ne=22;else{if(d=E0(d<<1)|0,!d){if(m=0,bt(6),ne=m,m=0,ne&1){h=0,ne=20;break}t=e[H>>2]|0}h=d,w=d,ne=22}while(!1);do if((ne|0)==22)if(m=0,d=ge(68,o|0)|0,H=m,m=0,H&1)ne=20;else{if(e[G>>2]=d,m=0,dt(2,t|0,D|0,C|0,w|0,L|0,P|0,G|0),G=m,m=0,G&1){t=j()|0,Bt(d)|0;break}if(Bt(d)|0,e[$>>2]=e[r>>2],ne=e[L>>2]|0,t=e[P>>2]|0,m=0,e[K>>2]=e[$>>2],t=Vt(39,K|0,w|0,ne|0,t|0,o|0,a|0)|0,ne=m,m=0,ne&1)ne=20;else return e[r>>2]=t,h&&n0(h),E&&n0(E),b=J,t|0}while(!1);(ne|0)==20&&(t=j()|0),h&&n0(h),E&&n0(E)}return le(t|0),0}function gn(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;if(o&2048&&(S[t>>0]=43,t=t+1|0),o&1024&&(S[t>>0]=35,t=t+1|0),d=o&260,l=o>>>14,w=(d|0)==260,w?h=0:(S[t>>0]=46,S[t+1>>0]=42,t=t+2|0,h=1),o=S[r>>0]|0,o<<24>>24)for(a=t;r=r+1|0,t=a+1|0,S[a>>0]=o,o=S[r>>0]|0,o<<24>>24;)a=t;e:do switch(d|0){case 4:if(l&1){S[t>>0]=70;break e}else{S[t>>0]=102;break e}case 256:if(l&1){S[t>>0]=69;break e}else{S[t>>0]=101;break e}default:if(o=(l&1|0)!=0,w)if(o){S[t>>0]=65;break e}else{S[t>>0]=97;break e}else if(o){S[t>>0]=71;break e}else{S[t>>0]=103;break e}}while(!1);return h|0}function yg(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0;switch(J=b,b=b+16|0,ne=J,L=O0(d,44220)|0,$=O0(d,44360)|0,t0[e[(e[$>>2]|0)+20>>2]&127](ne,$),e[h>>2]=a,d=S[t>>0]|0,d<<24>>24){case 43:case 45:{m=0,d=Ne(e[(e[L>>2]|0)+28>>2]|0,L|0,d|0)|0,P=m,m=0,P&1?G=8:(E=e[h>>2]|0,e[h>>2]=E+1,S[E>>0]=d,E=t+1|0,G=10);break}default:E=t,G=10}e:do if((G|0)==10){P=o;t:do if((P-E|0)>1&&(S[E>>0]|0)==48){switch(C=E+1|0,S[C>>0]|0){case 88:case 120:break;default:{G=11;break t}}if(m=0,d=Ne(e[(e[L>>2]|0)+28>>2]|0,L|0,48)|0,K=m,m=0,K&1){G=8;break e}if(K=e[h>>2]|0,e[h>>2]=K+1,S[K>>0]=d,E=E+2|0,m=0,d=Ne(e[(e[L>>2]|0)+28>>2]|0,L|0,S[C>>0]|0)|0,K=m,m=0,K&1){G=8;break e}if(K=e[h>>2]|0,e[h>>2]=K+1,S[K>>0]=d,E>>>0>>0){for(d=E;C=S[d>>0]|0,m=0,D=Ce(3)|0,K=m,m=0,!(K&1||(m=0,C=Ne(39,C<<24>>24|0,D|0)|0,K=m,m=0,K&1));){if(!C){K=E;break t}if(d=d+1|0,d>>>0>=o>>>0){K=E;break t}}d=j()|0;break e}else K=E,d=E}else G=11;while(!1);t:do if((G|0)==11)if(E>>>0>>0){for(d=E;C=S[d>>0]|0,m=0,D=Ce(3)|0,K=m,m=0,!(K&1||(m=0,C=Ne(40,C<<24>>24|0,D|0)|0,K=m,m=0,K&1));){if(!C){K=E;break t}if(d=d+1|0,d>>>0>=o>>>0){K=E;break t}}d=j()|0;break e}else K=E,d=E;while(!1);if(U=S[ne>>0]|0,H=ne+4|0,(U&1?e[H>>2]|0:(U&255)>>>1)|0){if((K|0)!=(d|0)&&(F=d+-1|0,K>>>0>>0)){D=K,C=F;do U=S[D>>0]|0,S[D>>0]=S[C>>0]|0,S[C>>0]=U,D=D+1|0,C=C+-1|0;while(D>>>0>>0)}if(m=0,F=ge(e[(e[$>>2]|0)+16>>2]|0,$|0)|0,U=m,m=0,U&1){G=8;break}R=ne+8|0,_=ne+1|0;t:do if(K>>>0>>0){for(C=0,D=0,U=K;E=S[(S[ne>>0]&1?e[R>>2]|0:_)+D>>0]|0,E<<24>>24>0&(C|0)==(E<<24>>24|0)?(C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=F,C=S[ne>>0]|0,E=0,D=(D>>>0<((C&1?e[H>>2]|0:(C&255)>>>1)+-1|0)>>>0&1)+D|0):E=C,m=0,C=Ne(e[(e[L>>2]|0)+28>>2]|0,L|0,S[U>>0]|0)|0,ae=m,m=0,!(ae&1);){if(ae=e[h>>2]|0,e[h>>2]=ae+1,S[ae>>0]=C,U=U+1|0,U>>>0>=d>>>0)break t;C=E+1|0}d=j()|0;break e}while(!1);if(C=a+(K-t)|0,D=e[h>>2]|0,(C|0)!=(D|0)&&(w=D+-1|0,C>>>0>>0)){do ae=S[C>>0]|0,S[C>>0]=S[w>>0]|0,S[w>>0]=ae,C=C+1|0,w=w+-1|0;while(C>>>0>>0);C=L}else C=L}else{if(m=0,Pe(e[(e[L>>2]|0)+32>>2]|0,L|0,K|0,d|0,e[h>>2]|0)|0,ae=m,m=0,ae&1){G=8;break}e[h>>2]=(e[h>>2]|0)+(d-K),C=L}t:do if(d>>>0>>0){for(;w=S[d>>0]|0,w<<24>>24!=46;){if(m=0,w=Ne(e[(e[C>>2]|0)+28>>2]|0,L|0,w|0)|0,ae=m,m=0,ae&1){G=4;break}if(ae=e[h>>2]|0,e[h>>2]=ae+1,S[ae>>0]=w,d=d+1|0,d>>>0>=o>>>0)break t}if((G|0)==4){d=j()|0;break e}if(m=0,w=ge(e[(e[$>>2]|0)+12>>2]|0,$|0)|0,ae=m,m=0,ae&1){G=8;break e}ae=e[h>>2]|0,e[h>>2]=ae+1,S[ae>>0]=w,d=d+1|0}while(!1);if(m=0,Pe(e[(e[L>>2]|0)+32>>2]|0,L|0,d|0,o|0,e[h>>2]|0)|0,ae=m,m=0,ae&1)G=8;else{ae=(e[h>>2]|0)+(P-d)|0,e[h>>2]=ae,e[l>>2]=(r|0)==(o|0)?ae:a+(r-t)|0,de(ne),b=J;return}}while(!1);(G|0)==8&&(d=j()|0),de(ne),le(d|0)}function Cg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=+l;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;J=b,b=b+176|0,K=J+76|0,R=J+48|0,F=J+32|0,C=J+24|0,h=J+8|0,E=J,U=J+80|0,H=J+72|0,w=J+110|0,L=J+68|0,P=J+64|0,G=J+60|0,$=J+56|0,D=E,e[D>>2]=37,e[D+4>>2]=0,D=gn(E+1|0,58899,e[o+4>>2]|0)|0,e[H>>2]=U,t=b0()|0,D?(e[h>>2]=e[o+8>>2],B[h+8>>3]=l,h=q0(U,30,t,E,h)|0):(B[C>>3]=l,h=q0(U,30,t,E,C)|0);e:do if((h|0)>29){m=0,t=Ce(3)|0,h=m,m=0,h=h&1,D?!h&&(m=0,e[F>>2]=e[o+8>>2],B[F+8>>3]=l,d=Pe(17,H|0,t|0,E|0,F|0)|0,_=m,m=0,!(_&1))&&(ne=12):!h&&(m=0,B[R>>3]=l,_=Pe(17,H|0,t|0,E|0,R|0)|0,R=m,m=0,!(R&1))&&(d=_,ne=12);do if((ne|0)==12){if(t=e[H>>2]|0,t)h=t;else{if(m=0,bt(6),_=m,m=0,_&1)break;h=e[H>>2]|0}t=h,E=h,ne=16;break e}while(!1);t=j()|0}else t=e[H>>2]|0,E=0,d=h,ne=16;while(!1);if((ne|0)==16){C=t+d|0,D=ri(t,C,o)|0;do if((t|0)==(U|0))t=U,h=0,ne=22;else{if(d=E0(d<<1)|0,!d){if(m=0,bt(6),ne=m,m=0,ne&1){h=0,ne=20;break}t=e[H>>2]|0}h=d,w=d,ne=22}while(!1);do if((ne|0)==22)if(m=0,d=ge(68,o|0)|0,H=m,m=0,H&1)ne=20;else{if(e[G>>2]=d,m=0,dt(2,t|0,D|0,C|0,w|0,L|0,P|0,G|0),G=m,m=0,G&1){t=j()|0,Bt(d)|0;break}if(Bt(d)|0,e[$>>2]=e[r>>2],ne=e[L>>2]|0,t=e[P>>2]|0,m=0,e[K>>2]=e[$>>2],t=Vt(39,K|0,w|0,ne|0,t|0,o|0,a|0)|0,ne=m,m=0,ne&1)ne=20;else return e[r>>2]=t,h&&n0(h),E&&n0(E),b=J,t|0}while(!1);(ne|0)==20&&(t=j()|0),h&&n0(h),E&&n0(E)}return le(t|0),0}function Tg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(R=b,b=b+80|0,C=R,t=R+70|0,E=R+12|0,F=R+32|0,w=R+8|0,D=R+4|0,S[t>>0]=S[58901]|0,S[t+1>>0]=S[58902]|0,S[t+2>>0]=S[58903]|0,S[t+3>>0]=S[58904]|0,S[t+4>>0]=S[58905]|0,S[t+5>>0]=S[58906]|0,h=b0()|0,e[C>>2]=l,t=q0(E,20,h,t,C)|0,l=E+t|0,h=ri(E,l,o)|0,d=f0(o)|0,e[w>>2]=d,m=0,w=Ne(37,w|0,44220)|0,_=m,m=0,_&1)_=j()|0,Bt(d)|0,le(_|0);else return Bt(d)|0,_r[e[(e[w>>2]|0)+32>>2]&31](w,E,l,F)|0,_=F+t|0,e[D>>2]=e[r>>2],e[C>>2]=e[D>>2],_=Ui(C,F,(h|0)==(l|0)?_:F+(h-E)|0,_,o,a)|0,b=R,_|0;return 0}function Ig(t){t=t|0}function kg(t){t=t|0,he(t)}function Eg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0;D=b,b=b+32|0,h=D+20|0,d=D+16|0,w=D+12|0,C=D;e:do if(!(e[o+4>>2]&1))C=e[(e[t>>2]|0)+24>>2]|0,e[d>>2]=e[r>>2],e[h>>2]=e[d>>2],h=an[C&31](t,h,o,a,l&1)|0;else{h=f0(o)|0,e[w>>2]=h,m=0,d=Ne(37,w|0,44368)|0,w=m,m=0;t:do if(w&1)D=j()|0,Bt(h)|0,h=D;else{Bt(h)|0,h=e[d>>2]|0,l?t0[e[h+24>>2]&127](C,d):t0[e[h+28>>2]&127](C,d),t=S[C>>0]|0,o=(t&1)==0,h=C+4|0,l=C+8|0,w=o?h:C+4|0,h=o?h:e[C+8>>2]|0,o=(t&1)==0;i:do if((h|0)!=((o?w:e[l>>2]|0)+((o?(t&255)>>>1:e[w>>2]|0)<<2)|0)){for(;;){if(d=e[h>>2]|0,a=e[r>>2]|0,a){if(o=a+24|0,t=e[o>>2]|0,(t|0)==(e[a+28>>2]|0)){if(m=0,d=Ne(e[(e[a>>2]|0)+52>>2]|0,a|0,d|0)|0,t=m,m=0,t&1)break}else e[o>>2]=t+4,e[t>>2]=d;(d|0)==-1&&(e[r>>2]=0)}if(h=h+4|0,t=S[C>>0]|0,o=(t&1)==0,(h|0)==((o?w:e[l>>2]|0)+((o?(t&255)>>>1:e[w>>2]|0)<<2)|0))break i}h=j()|0,Pt(C);break t}while(!1);h=e[r>>2]|0,Pt(C);break e}while(!1);le(h|0)}while(!1);return b=D,h|0}function Dg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+128|0,h=E,R=E+116|0,_=E+104|0,w=E+20|0,D=E+16|0,C=E+12|0,F=E+8|0,d=E+4|0,S[R>>0]=S[58887]|0,S[R+1>>0]=S[58888]|0,S[R+2>>0]=S[58889]|0,S[R+3>>0]=S[58890]|0,S[R+4>>0]=S[58891]|0,S[R+5>>0]=S[58892]|0,Ei(R+1|0,58893,1,e[o+4>>2]|0),t=b0()|0,e[h>>2]=l,l=_+(q0(_,12,t,R,h)|0)|0,R=ri(_,l,o)|0,t=f0(o)|0,e[F>>2]=t,m=0,dt(3,_|0,R|0,l|0,w|0,D|0,C|0,F|0),l=m,m=0,l&1)_=j()|0,Bt(t)|0,le(_|0);else return Bt(t)|0,e[d>>2]=e[r>>2],R=e[D>>2]|0,_=e[C>>2]|0,e[h>>2]=e[d>>2],_=Hi(h,w,R,_,o,a)|0,b=E,_|0;return 0}function bg(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0;G=b,b=b+16|0,$=G,H=O0(d,44212)|0,D=O0(d,44368)|0,t0[e[(e[D>>2]|0)+20>>2]&127]($,D),_=S[$>>0]|0,U=$+4|0;e:do if(!((_&1?e[U>>2]|0:(_&255)>>>1)|0))m=0,Pe(e[(e[H>>2]|0)+48>>2]|0,H|0,t|0,o|0,a|0)|0,K=m,m=0,K&1?K=5:(d=a+(o-t<<2)|0,e[h>>2]=d,K=28);else{switch(e[h>>2]=a,d=S[t>>0]|0,d<<24>>24){case 43:case 45:{if(m=0,d=Ne(e[(e[H>>2]|0)+44>>2]|0,H|0,d|0)|0,_=m,m=0,_&1){K=5;break e}C=e[h>>2]|0,e[h>>2]=C+4,e[C>>2]=d,C=t+1|0;break}default:C=t}t:do if((o-C|0)>1&&(S[C>>0]|0)==48){switch(d=C+1|0,S[d>>0]|0){case 88:case 120:break;default:{_=C;break t}}if(m=0,w=Ne(e[(e[H>>2]|0)+44>>2]|0,H|0,48)|0,_=m,m=0,_&1){K=5;break e}if(_=e[h>>2]|0,e[h>>2]=_+4,e[_>>2]=w,m=0,d=Ne(e[(e[H>>2]|0)+44>>2]|0,H|0,S[d>>0]|0)|0,_=m,m=0,_&1){K=5;break e}_=e[h>>2]|0,e[h>>2]=_+4,e[_>>2]=d,_=C+2|0}else _=C;while(!1);if((_|0)!=(o|0)&&(E=o+-1|0,_>>>0>>0)){w=_,d=E;do R=S[w>>0]|0,S[w>>0]=S[d>>0]|0,S[d>>0]=R,w=w+1|0,d=d+-1|0;while(w>>>0>>0)}if(m=0,D=ge(e[(e[D>>2]|0)+16>>2]|0,D|0)|0,R=m,m=0,R&1)K=5;else{E=$+8|0,F=$+1|0;t:do if(_>>>0>>0){for(d=0,w=0,R=_;C=S[(S[$>>0]&1?e[E>>2]|0:F)+w>>0]|0,C<<24>>24!=0&(d|0)==(C<<24>>24|0)?(d=e[h>>2]|0,e[h>>2]=d+4,e[d>>2]=D,d=S[$>>0]|0,C=0,w=(w>>>0<((d&1?e[U>>2]|0:(d&255)>>>1)+-1|0)>>>0&1)+w|0):C=d,m=0,d=Ne(e[(e[H>>2]|0)+44>>2]|0,H|0,S[R>>0]|0)|0,P=m,m=0,!(P&1);){if(P=e[h>>2]|0,e[h>>2]=P+4,e[P>>2]=d,R=R+1|0,R>>>0>=o>>>0)break t;d=C+1|0}d=j()|0;break e}while(!1);if(C=t,d=a+(_-C<<2)|0,w=e[h>>2]|0,(d|0)!=(w|0))if(t=w+-4|0,d>>>0>>0){do P=e[d>>2]|0,e[d>>2]=e[t>>2],e[t>>2]=P,d=d+4|0,t=t+-4|0;while(d>>>0>>0);t=C,d=w,K=28}else t=C,d=w,K=28;else t=C,K=28}}while(!1);if((K|0)==5)d=j()|0;else if((K|0)==28){e[l>>2]=(r|0)==(o|0)?d:a+(r-t<<2)|0,de($),b=G;return}de($),le(d|0)}function Fg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(F=b,b=b+224|0,d=F+8|0,t=F,_=F+196|0,C=F+32|0,E=F+28|0,D=F+24|0,R=F+20|0,w=F+16|0,U=t,e[U>>2]=37,e[U+4>>2]=0,Ei(t+1|0,58895,1,e[o+4>>2]|0),U=b0()|0,H=d,e[H>>2]=l,e[H+4>>2]=h,h=_+(q0(_,22,U,t,d)|0)|0,l=ri(_,h,o)|0,t=f0(o)|0,e[R>>2]=t,m=0,dt(3,_|0,l|0,h|0,C|0,E|0,D|0,R|0),h=m,m=0,h&1)H=j()|0,Bt(t)|0,le(H|0);else return Bt(t)|0,e[w>>2]=e[r>>2],U=e[E>>2]|0,H=e[D>>2]|0,e[d>>2]=e[w>>2],H=Hi(d,C,U,H,o,a)|0,b=F,H|0;return 0}function Ng(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0;K=b,b=b+16|0,U=K,R=K+8|0;e:do if((o|0)==(a|0))C=a;else for(C=o;;){if(!(e[C>>2]|0))break e;if(C=C+4|0,(C|0)==(a|0)){C=a;break}}while(!1);e[w>>2]=h,e[l>>2]=o,E=d,_=t+8|0;e:do if((h|0)==(d|0)|(o|0)==(a|0))G=47;else{t=h,D=C;t:for(;;){if($=r,h=e[$+4>>2]|0,C=U,e[C>>2]=e[$>>2],e[C+4>>2]=h,C=ai(e[_>>2]|0)|0,m=0,h=se(21,t|0,l|0,D-o>>2|0,E-t|0,r|0)|0,$=m,m=0,$&1){G=9;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=8;break}switch(h|0){case 0:{F=1;break e}case-1:{C=t,G=14;break t}default:}if(C=(e[w>>2]|0)+h|0,e[w>>2]=C,(C|0)==(d|0)){G=27;break}if((D|0)==(a|0))o=e[l>>2]|0,t=C,C=a;else{if(C=ai(e[_>>2]|0)|0,m=0,o=Ve(34,R|0,0,r|0)|0,$=m,m=0,$&1){G=35;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=34;break}if((o|0)==-1){F=2;break e}if(o>>>0>(E-(e[w>>2]|0)|0)>>>0){F=1;break e}if(o)for(C=R;D=S[C>>0]|0,$=e[w>>2]|0,e[w>>2]=$+1,S[$>>0]=D,o=o+-1|0,o;)C=C+1|0;o=(e[l>>2]|0)+4|0,e[l>>2]=o;i:do if((o|0)==(a|0))C=a;else for(C=o;;){if(!(e[C>>2]|0))break i;if(C=C+4|0,(C|0)==(a|0)){C=a;break}}while(!1);t=e[w>>2]|0}if((t|0)==(d|0)|(o|0)==(a|0)){G=47;break e}else D=C}if((G|0)==8)$=j(0)|0,$t($);else if((G|0)==9)o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0);else if((G|0)==14){e[w>>2]=C;t:do if((o|0)!=(e[l>>2]|0)){for(;;){if($=e[o>>2]|0,t=ai(e[_>>2]|0)|0,m=0,C=Ve(34,C|0,$|0,U|0)|0,$=m,m=0,$&1){H=t;break}if(t|0&&(m=0,ge(75,t|0)|0,$=m,m=0,$&1)){G=18;break}if((C|0)==-1||(C=(e[w>>2]|0)+C|0,e[w>>2]=C,o=o+4|0,(o|0)==(e[l>>2]|0)))break t}(G|0)==18&&($=j(0)|0,$t($)),o=j()|0,H|0&&(m=0,ge(75,H|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0)}while(!1);e[l>>2]=o,F=2;break}else if((G|0)==27){o=e[l>>2]|0,G=47;break}else(G|0)==34?($=j(0)|0,$t($)):(G|0)==35&&(o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0))}while(!1);return(G|0)==47&&(F=(o|0)!=(a|0)&1),b=K,F|0}function Rg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0;K=b,b=b+16|0,H=K;e:do if((o|0)==(a|0))C=a;else for(C=o;;){if(!(S[C>>0]|0))break e;if(C=C+1|0,(C|0)==(a|0)){C=a;break}}while(!1);e[w>>2]=h,e[l>>2]=o,F=d,_=t+8|0;e:do if((h|0)==(d|0)|(o|0)==(a|0))G=47;else{t=h,E=C;t:for(;;){if(D=r,C=e[D+4>>2]|0,h=H,e[h>>2]=e[D>>2],e[h+4>>2]=C,h=E,C=ai(e[_>>2]|0)|0,m=0,D=se(22,t|0,l|0,h-o|0,F-t>>2|0,r|0)|0,$=m,m=0,$&1){G=9;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=8;break}switch(D|0){case 0:{R=2;break e}case-1:{C=t,G=14;break t}default:}if(t=(e[w>>2]|0)+(D<<2)|0,e[w>>2]=t,(t|0)==(d|0)){G=31;break}if(o=e[l>>2]|0,(E|0)==(a|0))C=a;else{if(C=ai(e[_>>2]|0)|0,m=0,o=Pe(20,t|0,o|0,1,r|0)|0,$=m,m=0,$&1){G=38;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=37;break}if(o){R=2;break e}e[w>>2]=(e[w>>2]|0)+4,o=(e[l>>2]|0)+1|0,e[l>>2]=o;i:do if((o|0)==(a|0))C=a;else for(C=o;;){if(!(S[C>>0]|0))break i;if(C=C+1|0,(C|0)==(a|0)){C=a;break}}while(!1);t=e[w>>2]|0}if((t|0)==(d|0)|(o|0)==(a|0)){G=47;break e}else E=C}if((G|0)==8)$=j(0)|0,$t($);else if((G|0)==9)o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0);else if((G|0)==14){e[w>>2]=C;t:do if((o|0)!=(e[l>>2]|0)){t=C;i:for(;;){if(C=ai(e[_>>2]|0)|0,m=0,t=Pe(20,t|0,o|0,h-o|0,H|0)|0,$=m,m=0,$&1){G=19;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=18;break}switch(t|0){case-1:{G=25;break i}case-2:{G=26;break i}case 0:{o=o+1|0;break}default:o=o+t|0}if(t=(e[w>>2]|0)+4|0,e[w>>2]=t,(o|0)==(e[l>>2]|0)){U=o;break t}}if((G|0)==18)$=j(0)|0,$t($);else if((G|0)==19)o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0);else if((G|0)==25){e[l>>2]=o,R=2;break e}else if((G|0)==26){e[l>>2]=o,R=1;break e}}else U=o;while(!1);e[l>>2]=U,R=(U|0)!=(a|0)&1;break}else if((G|0)==31){o=e[l>>2]|0,G=47;break}else(G|0)==37?($=j(0)|0,$t($)):(G|0)==38&&(o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0))}while(!1);return(G|0)==47&&(R=(o|0)!=(a|0)&1),b=K,R|0}function Mg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;switch(d=b,b=b+16|0,h=d,e[l>>2]=o,o=ai(e[t+8>>2]|0)|0,m=0,t=Ve(34,h|0,0,r|0)|0,r=m,m=0,r&1&&(h=j()|0,o|0&&(m=0,ge(75,o|0)|0,d=m,m=0,d&1)&&(d=j(0)|0,$t(d)),le(h|0)),o|0&&(m=0,ge(75,o|0)|0,r=m,m=0,r&1)&&(r=j(0)|0,$t(r)),t|0){case 0:case-1:{h=2;break}default:if(t=t+-1|0,t>>>0<=(a-(e[l>>2]|0)|0)>>>0)if(!t)h=0;else for(;;)if(r=S[h>>0]|0,a=e[l>>2]|0,e[l>>2]=a+1,S[a>>0]=r,t=t+-1|0,t)h=h+1|0;else{h=0;break}else h=1}return b=d,h|0}function _g(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;r=t+8|0,m=0,o=ge(75,e[r>>2]|0)|0,a=m,m=0;do if(a&1)l=16;else{if(m=0,a=Ve(35,0,0,4)|0,t=m,m=0,t&1){if(t=j(0)|0,!o||(m=0,ge(75,o|0)|0,d=m,m=0,!(d&1)))break;d=j(0)|0,$t(d)}if(o|0&&(m=0,ge(75,o|0)|0,d=m,m=0,d&1)&&(d=j(0)|0,$t(d)),a)h=-1;else if(t=e[r>>2]|0,t){if(m=0,t=ge(75,t|0)|0,d=m,m=0,d&1){l=16;break}t|0&&(m=0,ge(75,t|0)|0,d=m,m=0,d&1)?(d=j(0)|0,$t(d)):h=0}else h=1;return h|0}while(!1);return(l|0)==16&&(t=j(0)|0),$t(t),0}function Pg(t){return t=t|0,0}function Lg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;D=a,C=t+8|0;e:do if((o|0)==(a|0)|(l|0)==0)t=0;else{for(t=0,w=0;;){if(d=ai(e[C>>2]|0)|0,m=0,h=Ve(36,o|0,D-o|0,r|0)|0,R=m,m=0,R&1){F=d;break}if(d|0&&(m=0,ge(75,d|0)|0,R=m,m=0,R&1)){E=5;break}switch(h|0){case-2:case-1:break e;case 0:{o=o+1|0,h=1;break}default:o=o+h|0}if(t=h+t|0,w=w+1|0,(o|0)==(a|0)|w>>>0>=l>>>0)break e}(E|0)==5&&(R=j(0)|0,$t(R)),t=j()|0,F|0&&(m=0,ge(75,F|0)|0,R=m,m=0,R&1)&&(R=j(0)|0,$t(R)),le(t|0)}while(!1);return t|0}function Og(t){t=t|0;var r=0,o=0;return t=e[t+8>>2]|0,t?(m=0,t=ge(75,t|0)|0,o=m,m=0,o&1&&(o=j(0)|0,$t(o)),t|0&&(m=0,ge(75,t|0)|0,o=m,m=0,o&1)?(o=j(0)|0,$t(o)):r=4):r=1,r|0}function $g(t){t=t|0,he(t)}function Bg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0;return t=b,b=b+16|0,C=t+4|0,r=t,e[C>>2]=o,e[r>>2]=h,d=O3(o,a,C,h,d,r,1114111,0)|0,e[l>>2]=e[C>>2],e[w>>2]=e[r>>2],b=t,d|0}function Vg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0;return t=b,b=b+16|0,C=t+4|0,r=t,e[C>>2]=o,e[r>>2]=h,d=$3(o,a,C,h,d,r,1114111,0)|0,e[l>>2]=e[C>>2],e[w>>2]=e[r>>2],b=t,d|0}function Ug(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,e[l>>2]=o,3}function zg(t){return t=t|0,0}function Gg(t){return t=t|0,0}function qg(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,B3(o,a,l,1114111,0)|0}function Wg(t){return t=t|0,4}function Hg(t){t=t|0,he(t)}function Qg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0;return t=b,b=b+16|0,C=t+4|0,r=t,e[C>>2]=o,e[r>>2]=h,d=V3(o,a,C,h,d,r,1114111,0)|0,e[l>>2]=e[C>>2],e[w>>2]=e[r>>2],b=t,d|0}function Kg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0;return t=b,b=b+16|0,C=t+4|0,r=t,e[C>>2]=o,e[r>>2]=h,d=U3(o,a,C,h,d,r,1114111,0)|0,e[l>>2]=e[C>>2],e[w>>2]=e[r>>2],b=t,d|0}function Yg(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,e[l>>2]=o,3}function jg(t){return t=t|0,0}function Xg(t){return t=t|0,0}function Zg(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,z3(o,a,l,1114111,0)|0}function Jg(t){return t=t|0,4}function e4(t){t=t|0,he(t)}function t4(t){t=t|0,he(t)}function i4(t,r){t=t|0,r=r|0,e[t+4>>2]=r+-1,e[t>>2]=44384,S[t+8>>0]=46,S[t+9>>0]=44,t=t+12|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function n4(t,r){t=t|0,r=r|0,e[t+4>>2]=r+-1,e[t>>2]=44424,e[t+8>>2]=46,e[t+12>>2]=44,t=t+16|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function eo(t){t=t|0,e[t>>2]=44384,de(t+12|0)}function r4(t){t=t|0,eo(t),he(t)}function to(t){t=t|0,e[t>>2]=44424,de(t+16|0)}function s4(t){t=t|0,to(t),he(t)}function o4(t){return t=t|0,S[t+8>>0]|0}function l4(t){return t=t|0,e[t+8>>2]|0}function u4(t){return t=t|0,S[t+9>>0]|0}function c4(t){return t=t|0,e[t+12>>2]|0}function f4(t,r){t=t|0,r=r|0,hr(t,r+12|0)}function h4(t,r){t=t|0,r=r|0,hr(t,r+16|0)}function d4(t,r){t=t|0,r=r|0,yi(t,59024,4)}function p4(t,r){t=t|0,r=r|0,mr(t,44996,_n(44996)|0)}function m4(t,r){t=t|0,r=r|0,yi(t,59029,5)}function g4(t,r){t=t|0,r=r|0,mr(t,45016,_n(45016)|0)}function li(t){switch(t=t|0,e[t+4>>2]&74|0){case 64:{t=8;break}case 8:{t=16;break}case 0:{t=0;break}default:t=10}return t|0}function S4(t){t=t|0;do if(!(S[2464]|0)&&kt(2464)|0){if(!(S[2472]|0)&&kt(2472)|0){t=45040;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=45208);Nt(193,0,Q|0)|0,Dt(2472)}if(m=0,Ne(41,45040,59035)|0,t=m,m=0,!(t&1)&&(m=0,Ne(41,45052,59042)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45064,59049)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45076,59057)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45088,59067)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45100,59076)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45112,59083)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45124,59092)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45136,59096)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45148,59100)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45160,59104)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45172,59108)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45184,59112)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45196,59116)|0,t=m,m=0,!(t&1))){e[11302]=45040,Dt(2464);break}t=j()|0,W0(2464),le(t|0)}while(!1);return e[11302]|0}function A4(t){t=t|0;do if(!(S[2480]|0)&&kt(2480)|0){if(!(S[2488]|0)&&kt(2488)|0){t=45212;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=45380);Nt(194,0,Q|0)|0,Dt(2488)}if(m=0,Ne(42,45212,45380)|0,t=m,m=0,!(t&1)&&(m=0,Ne(42,45224,45408)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45236,45436)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45248,45468)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45260,45508)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45272,45544)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45284,45572)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45296,45608)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45308,45624)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45320,45640)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45332,45656)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45344,45672)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45356,45688)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45368,45704)|0,t=m,m=0,!(t&1))){e[11430]=45212,Dt(2480);break}t=j()|0,W0(2480),le(t|0)}while(!1);return e[11430]|0}function x4(t){t=t|0;e:do if(!(S[2496]|0)&&kt(2496)|0){if(!(S[2504]|0)&&kt(2504)|0){t=45724;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=46012);Nt(195,0,Q|0)|0,Dt(2504)}m=0,Ne(41,45724,59120)|0,t=m,m=0;do if(!(t&1)&&(m=0,Ne(41,45736,59128)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45748,59137)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45760,59143)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45772,59149)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45784,59153)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45796,59158)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45808,59163)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45820,59170)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45832,59180)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45844,59188)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45856,59197)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45868,59206)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45880,59210)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45892,59214)|0,t=m,m=0,!(t&1))){if(m=0,Ne(41,45904,59218)|0,t=m,m=0,t&1||(m=0,Ne(41,45916,59149)|0,t=m,m=0,t&1)||(m=0,Ne(41,45928,59222)|0,t=m,m=0,t&1)||(m=0,Ne(41,45940,59226)|0,t=m,m=0,t&1)||(m=0,Ne(41,45952,59230)|0,t=m,m=0,t&1)||(m=0,Ne(41,45964,59234)|0,t=m,m=0,t&1)||(m=0,Ne(41,45976,59238)|0,t=m,m=0,t&1)||(m=0,Ne(41,45988,59242)|0,t=m,m=0,t&1)||(m=0,Ne(41,46e3,59246)|0,t=m,m=0,t&1))break;e[11503]=45724,Dt(2496);break e}while(!1);t=j()|0,W0(2496),le(t|0)}while(!1);return e[11503]|0}function w4(t){t=t|0;e:do if(!(S[2512]|0)&&kt(2512)|0){if(!(S[2520]|0)&&kt(2520)|0){t=46016;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=46304);Nt(196,0,Q|0)|0,Dt(2520)}m=0,Ne(42,46016,46304)|0,t=m,m=0;do if(!(t&1)&&(m=0,Ne(42,46028,46336)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46040,46372)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46052,46396)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46064,46420)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46076,46436)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46088,46456)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46100,46476)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46112,46504)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46124,46544)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46136,46576)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46148,46612)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46160,46648)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46172,46664)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46184,46680)|0,t=m,m=0,!(t&1))){if(m=0,Ne(42,46196,46696)|0,t=m,m=0,t&1||(m=0,Ne(42,46208,46420)|0,t=m,m=0,t&1)||(m=0,Ne(42,46220,46712)|0,t=m,m=0,t&1)||(m=0,Ne(42,46232,46728)|0,t=m,m=0,t&1)||(m=0,Ne(42,46244,46744)|0,t=m,m=0,t&1)||(m=0,Ne(42,46256,46760)|0,t=m,m=0,t&1)||(m=0,Ne(42,46268,46776)|0,t=m,m=0,t&1)||(m=0,Ne(42,46280,46792)|0,t=m,m=0,t&1)||(m=0,Ne(42,46292,46808)|0,t=m,m=0,t&1))break;e[11706]=46016,Dt(2512);break e}while(!1);t=j()|0,W0(2512),le(t|0)}while(!1);return e[11706]|0}function y4(t){t=t|0;do if(!(S[2528]|0)&&kt(2528)|0){if(!(S[2536]|0)&&kt(2536)|0){t=46828;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=47116);Nt(197,0,Q|0)|0,Dt(2536)}if(m=0,Ne(41,46828,59250)|0,t=m,m=0,!(t&1)&&(m=0,Ne(41,46840,59253)|0,t=m,m=0,!(t&1))){e[11779]=46828,Dt(2528);break}t=j()|0,W0(2528),le(t|0)}while(!1);return e[11779]|0}function C4(t){t=t|0;do if(!(S[2544]|0)&&kt(2544)|0){if(!(S[2552]|0)&&kt(2552)|0){t=47120;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=47408);Nt(198,0,Q|0)|0,Dt(2552)}if(m=0,Ne(42,47120,47408)|0,t=m,m=0,!(t&1)&&(m=0,Ne(42,47132,47420)|0,t=m,m=0,!(t&1))){e[11858]=47120,Dt(2544);break}t=j()|0,W0(2544),le(t|0)}while(!1);return e[11858]|0}function T4(t){t=t|0;do if(!(S[2560]|0)&&kt(2560)|0)if(m=0,ve(5,47436,59256,8),t=m,m=0,t&1)t=j()|0,W0(2560),le(t|0);else{Nt(199,47436,Q|0)|0,Dt(2560);break}while(!1);return 47436}function I4(t){t=t|0;var r=0;do if(!(S[2568]|0)&&kt(2568)|0){if(m=0,t=ge(76,47448)|0,r=m,m=0,!(r&1)&&(m=0,ve(15,47484,47448,t|0),r=m,m=0,!(r&1))){Nt(200,47484,Q|0)|0,Dt(2568);break}r=j()|0,W0(2568),le(r|0)}while(!1);return 47484}function k4(t){t=t|0;do if(!(S[2576]|0)&&kt(2576)|0)if(m=0,ve(5,47496,59265,8),t=m,m=0,t&1)t=j()|0,W0(2576),le(t|0);else{Nt(199,47496,Q|0)|0,Dt(2576);break}while(!1);return 47496}function E4(t){t=t|0;var r=0;do if(!(S[2584]|0)&&kt(2584)|0){if(m=0,t=ge(76,47508)|0,r=m,m=0,!(r&1)&&(m=0,ve(15,47544,47508,t|0),r=m,m=0,!(r&1))){Nt(200,47544,Q|0)|0,Dt(2584);break}r=j()|0,W0(2584),le(r|0)}while(!1);return 47544}function D4(t){t=t|0;do if(!(S[2592]|0)&&kt(2592)|0)if(m=0,ve(5,47556,59274,20),t=m,m=0,t&1)t=j()|0,W0(2592),le(t|0);else{Nt(199,47556,Q|0)|0,Dt(2592);break}while(!1);return 47556}function F4(t){t=t|0;var r=0;do if(!(S[2600]|0)&&kt(2600)|0){if(m=0,t=ge(76,47568)|0,r=m,m=0,!(r&1)&&(m=0,ve(15,47652,47568,t|0),r=m,m=0,!(r&1))){Nt(200,47652,Q|0)|0,Dt(2600);break}r=j()|0,W0(2600),le(r|0)}while(!1);return 47652}function N4(t){t=t|0;do if(!(S[2608]|0)&&kt(2608)|0)if(m=0,ve(5,47664,59295,11),t=m,m=0,t&1)t=j()|0,W0(2608),le(t|0);else{Nt(199,47664,Q|0)|0,Dt(2608);break}while(!1);return 47664}function R4(t){t=t|0;var r=0;do if(!(S[2616]|0)&&kt(2616)|0){if(m=0,t=ge(76,47676)|0,r=m,m=0,!(r&1)&&(m=0,ve(15,47724,47676,t|0),r=m,m=0,!(r&1))){Nt(200,47724,Q|0)|0,Dt(2616);break}r=j()|0,W0(2616),le(r|0)}while(!1);return 47724}function io(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=44304,t=t+8|0,r=e[t>>2]|0,m=0,o=Ce(3)|0,a=m,m=0;do if(!(a&1)){if((r|0)!=(o|0)&&(m=0,ue(188,e[t>>2]|0),a=m,m=0,a&1))break;return}while(!1);a=j(0)|0,$t(a)}function Sn(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0;L=b,b=b+112|0,C=L,E=(a-o|0)/12|0;do if(E>>>0>100){if(C=E0(E)|0,!(C|0)&&(m=0,bt(6),P=m,m=0,P&1)){w=0,_=6;break}w=C,_=11}else w=0,_=11;while(!1);e:do if((_|0)==11){if((o|0)==(a|0))D=0;else for(_=o,F=0,R=C;D=S[_>>0]|0,D&1?D=e[_+4>>2]|0:D=(D&255)>>>1,D?(S[R>>0]=1,D=F):(S[R>>0]=2,D=F+1|0,E=E+-1|0),_=_+12|0,(_|0)!=(a|0);)F=D,R=R+1|0;$=(o|0)==(a|0),P=(o|0)==(a|0),G=0,U=D;t:for(;;){D=e[t>>2]|0;do if(D){if((e[D+12>>2]|0)==(e[D+16>>2]|0)){if(m=0,D=ge(e[(e[D>>2]|0)+36>>2]|0,D|0)|0,K=m,m=0,K&1){_=5;break t}if((D|0)==-1){e[t>>2]=0,D=0;break}else{D=e[t>>2]|0;break}}}else D=0;while(!1);if(_=(D|0)==0,F=e[r>>2]|0,F){if((e[F+12>>2]|0)==(e[F+16>>2]|0)){if(m=0,D=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,K=m,m=0,K&1){_=5;break}(D|0)==-1&&(e[r>>2]=0,F=0)}}else F=0;if(R=(F|0)==0,D=e[t>>2]|0,!((E|0)!=0&(_^R))){_=64;break}if(F=e[D+12>>2]|0,(F|0)==(e[D+16>>2]|0)){if(m=0,D=ge(e[(e[D>>2]|0)+36>>2]|0,D|0)|0,K=m,m=0,K&1){_=5;break}}else D=N[F>>0]|0;if(D=D&255,!d&&(m=0,D=Ne(e[(e[l>>2]|0)+12>>2]|0,l|0,D|0)|0,K=m,m=0,K&1)){_=5;break}if(K=G+1|0,$)D=0,_=U;else for(R=0,H=o,_=U,U=C;;){do if((S[U>>0]|0)==1){if(S[H>>0]&1?F=e[H+8>>2]|0:F=H+1|0,F=S[F+G>>0]|0,!d&&(m=0,F=Ne(e[(e[l>>2]|0)+12>>2]|0,l|0,F|0)|0,J=m,m=0,J&1)){_=4;break t}if(D<<24>>24!=F<<24>>24){S[U>>0]=0,F=R,E=E+-1|0;break}F=S[H>>0]|0,F&1?F=e[H+4>>2]|0:F=(F&255)>>>1,(F|0)==(K|0)?(S[U>>0]=2,F=1,_=_+1|0,E=E+-1|0):F=1}else F=R;while(!1);if(H=H+12|0,(H|0)==(a|0)){D=F;break}else R=F,U=U+1|0}if(!D){G=K,U=_;continue}if(D=e[t>>2]|0,F=D+12|0,R=e[F>>2]|0,(R|0)==(e[D+16>>2]|0)){if(m=0,ge(e[(e[D>>2]|0)+40>>2]|0,D|0)|0,J=m,m=0,J&1){_=5;break}}else e[F>>2]=R+1;if((_+E|0)>>>0<2|P){G=K,U=_;continue}else D=o,R=_,_=C;for(;;)if((S[_>>0]|0)==2&&(F=S[D>>0]|0,F&1?F=e[D+4>>2]|0:F=(F&255)>>>1,(F|0)!=(K|0)&&(S[_>>0]=0,R=R+-1|0)),D=D+12|0,(D|0)==(a|0)){G=K,U=R;continue t}else _=_+1|0}if((_|0)==4){o=j()|0;break}else if((_|0)==5){o=j()|0;break}else if((_|0)==64){do if(D){if((e[D+12>>2]|0)==(e[D+16>>2]|0)){if(m=0,D=ge(e[(e[D>>2]|0)+36>>2]|0,D|0)|0,J=m,m=0,J&1){_=6;break e}if((D|0)==-1){e[t>>2]=0,D=0;break}else{D=e[t>>2]|0;break}}}else D=0;while(!1);E=(D|0)==0;do if(R)_=76;else{if((e[F+12>>2]|0)==(e[F+16>>2]|0)){if(m=0,D=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,J=m,m=0,J&1){_=6;break e}if((D|0)==-1){e[r>>2]=0,_=76;break}}E||(_=77)}while(!1);(_|0)==76&&E&&(_=77),(_|0)==77&&(e[h>>2]=e[h>>2]|2);t:do if((o|0)==(a|0))_=81;else for(;;){if((S[C>>0]|0)==2)break t;if(o=o+12|0,(o|0)==(a|0)){_=81;break}else C=C+1|0}while(!1);return(_|0)==81&&(e[h>>2]=e[h>>2]|4,o=a),w&&n0(w),b=L,o|0}}while(!1);return(_|0)==6&&(o=j()|0),w&&n0(w),le(o|0),0}function M4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,U=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,w){d=0;break}else d=0;if(w=S[ne>>0]|0,w=w&1?e[_>>2]|0:(w&255)>>>1,(e[K>>2]|0)==(a+w|0)){if(m=0,ve(8,ne|0,w<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else w=N[w>>0]|0;if(_i(w&255,H,a,K,G,E,ae,P,L,U)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(21,a|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=25;else{if(e[h>>2]=a,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function _4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,U=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;d=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(d)break;break t}if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(d)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,d){w=0;break}else w=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(a+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+d}if(C=t+12|0,d=e[C>>2]|0,D=t+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else d=N[d>>0]|0;if(_i(d&255,H,a,K,G,E,ae,P,L,U)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(22,a|0,e[K>>2]|0,l|0,H|0)|0,d=ye,ce=m,m=0,ce&1)re=25;else{if(ce=h,e[ce>>2]=a,e[ce+4>>2]=d,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function P4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,U=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,w){d=0;break}else d=0;if(w=S[ne>>0]|0,w=w&1?e[_>>2]|0:(w&255)>>>1,(e[K>>2]|0)==(a+w|0)){if(m=0,ve(8,ne|0,w<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else w=N[w>>0]|0;if(_i(w&255,H,a,K,G,E,ae,P,L,U)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(23,a|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=25;else{if(k[h>>1]=a,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function L4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,U=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,w){d=0;break}else d=0;if(w=S[ne>>0]|0,w=w&1?e[_>>2]|0:(w&255)>>>1,(e[K>>2]|0)==(a+w|0)){if(m=0,ve(8,ne|0,w<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else w=N[w>>0]|0;if(_i(w&255,H,a,K,G,E,ae,P,L,U)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(24,a|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=25;else{if(e[h>>2]=a,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function O4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,U=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,w){d=0;break}else d=0;if(w=S[ne>>0]|0,w=w&1?e[_>>2]|0:(w&255)>>>1,(e[K>>2]|0)==(a+w|0)){if(m=0,ve(8,ne|0,w<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else w=N[w>>0]|0;if(_i(w&255,H,a,K,G,E,ae,P,L,U)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(25,a|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=25;else{if(e[h>>2]=a,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function $4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,U=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;d=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(d)break;break t}if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(d)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,d){w=0;break}else w=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(a+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+d}if(C=t+12|0,d=e[C>>2]|0,D=t+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else d=N[d>>0]|0;if(_i(d&255,H,a,K,G,E,ae,P,L,U)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(26,a|0,e[K>>2]|0,l|0,H|0)|0,d=ye,ce=m,m=0,ce&1)re=25;else{if(ce=h,e[ce>>2]=a,e[ce+4>>2]=d,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function B4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+240|0,K=re+208|0,w=re+203|0,C=re+202|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+40|0,ae=re+4|0,P=re,L=re+201|0,G=re+200|0,Ar(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=25;else{_=ce+8|0,U=ce+1|0,a=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=a,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=S[w>>0]|0,F=S[C>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,E=m,m=0,E&1){ke=24;break}(w|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;C=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(C)break;break t}if(m=0,D=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=24;break t}if((D|0)!=-1){if(C)break;break t}else{e[o>>2]=0,ke=16;break}}else ke=16;while(!1);if((ke|0)==16)if(ke=0,C){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(a+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=24;break}if(S[ce>>0]&1?a=(e[ce>>2]&-2)+-1|0:a=10,m=0,ve(8,ce|0,a|0,0),E=m,m=0,E&1){ke=24;break}a=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=a+C}if(D=t+12|0,C=e[D>>2]|0,E=t+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}}else C=N[C>>0]|0;if(vr(C&255,L,G,a,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}else continue;else{e[D>>2]=w+1;continue}}if((ke|0)==24){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(1,a|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=25;else{if(z[h>>2]=d,V0(Ee,ne,e[ae>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=25;break e}if((t|0)==-1){e[o>>2]=0,ke=49;break}}a||(ke=50)}else ke=49;while(!1);return(ke|0)==49&&a&&(ke=50),(ke|0)==50&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==25&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function V4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+240|0,K=re+208|0,w=re+203|0,C=re+202|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+40|0,ae=re+4|0,P=re,L=re+201|0,G=re+200|0,Ar(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=25;else{_=ce+8|0,U=ce+1|0,a=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=a,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=S[w>>0]|0,F=S[C>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,E=m,m=0,E&1){ke=24;break}(w|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;C=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(C)break;break t}if(m=0,D=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=24;break t}if((D|0)!=-1){if(C)break;break t}else{e[o>>2]=0,ke=16;break}}else ke=16;while(!1);if((ke|0)==16)if(ke=0,C){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(a+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=24;break}if(S[ce>>0]&1?a=(e[ce>>2]&-2)+-1|0:a=10,m=0,ve(8,ce|0,a|0,0),E=m,m=0,E&1){ke=24;break}a=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=a+C}if(D=t+12|0,C=e[D>>2]|0,E=t+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}}else C=N[C>>0]|0;if(vr(C&255,L,G,a,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}else continue;else{e[D>>2]=w+1;continue}}if((ke|0)==24){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(2,a|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=25;else{if(B[h>>3]=d,V0(Ee,ne,e[ae>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=25;break e}if((t|0)==-1){e[o>>2]=0,ke=49;break}}a||(ke=50)}else ke=49;while(!1);return(ke|0)==49&&a&&(ke=50),(ke|0)==50&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==25&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function U4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+240|0,K=re+208|0,w=re+203|0,C=re+202|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+40|0,ae=re+4|0,P=re,L=re+201|0,G=re+200|0,Ar(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=25;else{_=ce+8|0,U=ce+1|0,a=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=a,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=S[w>>0]|0,F=S[C>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,E=m,m=0,E&1){ke=24;break}(w|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;C=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(C)break;break t}if(m=0,D=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=24;break t}if((D|0)!=-1){if(C)break;break t}else{e[o>>2]=0,ke=16;break}}else ke=16;while(!1);if((ke|0)==16)if(ke=0,C){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(a+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=24;break}if(S[ce>>0]&1?a=(e[ce>>2]&-2)+-1|0:a=10,m=0,ve(8,ce|0,a|0,0),E=m,m=0,E&1){ke=24;break}a=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=a+C}if(D=t+12|0,C=e[D>>2]|0,E=t+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}}else C=N[C>>0]|0;if(vr(C&255,L,G,a,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}else continue;else{e[D>>2]=w+1;continue}}if((ke|0)==24){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(3,a|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=25;else{if(B[h>>3]=d,V0(Ee,ne,e[ae>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=25;break e}if((t|0)==-1){e[o>>2]=0,ke=49;break}}a||(ke=50)}else ke=49;while(!1);return(ke|0)==49&&a&&(ke=50),(ke|0)==50&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==25&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function z4(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return l=b,b=b+16|0,h=l,e[h>>2]=a,a=ai(r)|0,r=Lo(t,o,h)|0,a|0&&(m=0,ge(75,a|0)|0,h=m,m=0,h&1)&&(h=j(0)|0,$t(h)),b=l,r|0}function An(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0;L=b,b=b+112|0,C=L,E=(a-o|0)/12|0;do if(E>>>0>100){if(C=E0(E)|0,!(C|0)&&(m=0,bt(6),P=m,m=0,P&1)){w=0,R=6;break}w=C,R=11}else w=0,R=11;while(!1);e:do if((R|0)==11){if((o|0)==(a|0))D=0;else for(_=o,F=0,R=C;D=S[_>>0]|0,D&1?D=e[_+4>>2]|0:D=(D&255)>>>1,D?(S[R>>0]=1,D=F):(S[R>>0]=2,D=F+1|0,E=E+-1|0),_=_+12|0,(_|0)!=(a|0);)F=D,R=R+1|0;$=(o|0)==(a|0),P=(o|0)==(a|0),G=0,U=E;t:for(;;){E=e[t>>2]|0;do if(E){if(F=e[E+12>>2]|0,(F|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,K=m,m=0,K&1){R=5;break t}}else E=e[F>>2]|0;if((E|0)==-1){e[t>>2]=0,_=1;break}else{_=(e[t>>2]|0)==0;break}}else _=1;while(!1);if(F=e[r>>2]|0,F){if(E=e[F+12>>2]|0,(E|0)==(e[F+16>>2]|0)){if(m=0,E=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,K=m,m=0,K&1){R=5;break}}else E=e[E>>2]|0;(E|0)==-1?(e[r>>2]=0,F=0,R=1):R=0}else F=0,R=1;if(E=e[t>>2]|0,!((U|0)!=0&(_^R))){R=66;break}if(F=e[E+12>>2]|0,(F|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,K=m,m=0,K&1){R=5;break}}else E=e[F>>2]|0;if(!d&&(m=0,E=Ne(e[(e[l>>2]|0)+28>>2]|0,l|0,E|0)|0,K=m,m=0,K&1)){R=5;break}if(K=G+1|0,$)E=0,_=U;else for(_=0,H=o,R=U,U=C;;){do if((S[U>>0]|0)==1){if(S[H>>0]&1?F=e[H+8>>2]|0:F=H+4|0,F=e[F+(G<<2)>>2]|0,!d&&(m=0,F=Ne(e[(e[l>>2]|0)+28>>2]|0,l|0,F|0)|0,J=m,m=0,J&1)){R=4;break t}if((E|0)!=(F|0)){S[U>>0]=0,F=_,R=R+-1|0;break}F=S[H>>0]|0,F&1?F=e[H+4>>2]|0:F=(F&255)>>>1,(F|0)==(K|0)?(S[U>>0]=2,F=1,D=D+1|0,R=R+-1|0):F=1}else F=_;while(!1);if(H=H+12|0,(H|0)==(a|0)){E=F,_=R;break}else _=F,U=U+1|0}if(!E){G=K,U=_;continue}if(E=e[t>>2]|0,F=E+12|0,R=e[F>>2]|0,(R|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,J=m,m=0,J&1){R=5;break}}else e[F>>2]=R+4;if((D+_|0)>>>0<2|P){G=K,U=_;continue}else E=o,R=C;for(;;)if((S[R>>0]|0)==2&&(F=S[E>>0]|0,F&1?F=e[E+4>>2]|0:F=(F&255)>>>1,(F|0)!=(K|0)&&(S[R>>0]=0,D=D+-1|0)),E=E+12|0,(E|0)==(a|0)){G=K,U=_;continue t}else R=R+1|0}if((R|0)==4){o=j()|0;break}else if((R|0)==5){o=j()|0;break}else if((R|0)==66){do if(E){if(D=e[E+12>>2]|0,(D|0)==(e[E+16>>2]|0)){if(m=0,D=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,J=m,m=0,J&1){R=6;break e}}else D=e[D>>2]|0;if((D|0)==-1){e[t>>2]=0,E=1;break}else{E=(e[t>>2]|0)==0;break}}else E=1;while(!1);do if(F){if(D=e[F+12>>2]|0,(D|0)==(e[F+16>>2]|0)){if(m=0,D=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,J=m,m=0,J&1){R=6;break e}}else D=e[D>>2]|0;if((D|0)!=-1){if(E)break;R=81;break}else{e[r>>2]=0,R=79;break}}else R=79;while(!1);(R|0)==79&&E&&(R=81),(R|0)==81&&(e[h>>2]=e[h>>2]|2);t:do if((o|0)==(a|0))R=85;else for(;;){if((S[C>>0]|0)==2)break t;if(o=o+12|0,(o|0)==(a|0)){R=85;break}else C=C+1|0}while(!1);return(R|0)==85&&(e[h>>2]=e[h>>2]|4,o=a),w&&n0(w),b=L,o|0}}while(!1);return(R|0)==6&&(o=j()|0),w&&n0(w),le(o|0),0}function G4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,U=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){re=25;break t}}else d=e[d>>2]|0;if((d|0)!=-1){if(w)break;d=C;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,w){d=0;break}else C=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(t+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+d}if(w=a+12|0,d=e[w>>2]|0,D=a+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}}else d=e[d>>2]|0;if(Pi(d,H,t,K,G,E,ae,P,L,U)|0){d=C;break}if(d=e[w>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}else{d=a;continue}else{e[w>>2]=d+4,d=a;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(21,t|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=26;else{if(e[h>>2]=t,V0(ae,P,e[L>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function q4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,U=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,d=0,C=1):C=0}else d=0,C=1;w=e[o>>2]|0;do if(w){if(a=e[w+12>>2]|0,(a|0)==(e[w+16>>2]|0)){if(m=0,a=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,D=m,m=0,D&1){re=25;break t}}else a=e[a>>2]|0;if((a|0)!=-1){if(C)break;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,C){w=0;break}else w=0;if(a=S[ne>>0]|0,a=a&1?e[_>>2]|0:(a&255)>>>1,(e[K>>2]|0)==(t+a|0)){if(m=0,ve(8,ne|0,a<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+a}if(C=d+12|0,a=e[C>>2]|0,D=d+16|0,(a|0)==(e[D>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break}}else a=e[a>>2]|0;if(Pi(a,H,t,K,G,E,ae,P,L,U)|0)break;if(a=e[C>>2]|0,(a|0)==(e[D>>2]|0))if(m=0,ge(e[(e[d>>2]|0)+40>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break}else continue;else{e[C>>2]=a+4;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(22,t|0,e[K>>2]|0,l|0,H|0)|0,a=ye,ce=m,m=0,ce&1)re=26;else{if(ce=h,e[ce>>2]=t,e[ce+4>>2]=a,V0(ae,P,e[L>>2]|0,l),d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function W4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,U=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){re=25;break t}}else d=e[d>>2]|0;if((d|0)!=-1){if(w)break;d=C;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,w){d=0;break}else C=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(t+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+d}if(w=a+12|0,d=e[w>>2]|0,D=a+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}}else d=e[d>>2]|0;if(Pi(d,H,t,K,G,E,ae,P,L,U)|0){d=C;break}if(d=e[w>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}else{d=a;continue}else{e[w>>2]=d+4,d=a;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(23,t|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=26;else{if(k[h>>1]=t,V0(ae,P,e[L>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function H4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,U=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){re=25;break t}}else d=e[d>>2]|0;if((d|0)!=-1){if(w)break;d=C;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,w){d=0;break}else C=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(t+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+d}if(w=a+12|0,d=e[w>>2]|0,D=a+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}}else d=e[d>>2]|0;if(Pi(d,H,t,K,G,E,ae,P,L,U)|0){d=C;break}if(d=e[w>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}else{d=a;continue}else{e[w>>2]=d+4,d=a;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(24,t|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=26;else{if(e[h>>2]=t,V0(ae,P,e[L>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function Q4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,U=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){re=25;break t}}else d=e[d>>2]|0;if((d|0)!=-1){if(w)break;d=C;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,w){d=0;break}else C=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(t+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+d}if(w=a+12|0,d=e[w>>2]|0,D=a+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}}else d=e[d>>2]|0;if(Pi(d,H,t,K,G,E,ae,P,L,U)|0){d=C;break}if(d=e[w>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}else{d=a;continue}else{e[w>>2]=d+4,d=a;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(25,t|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=26;else{if(e[h>>2]=t,V0(ae,P,e[L>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function K4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,U=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,U,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,d=0,C=1):C=0}else d=0,C=1;w=e[o>>2]|0;do if(w){if(a=e[w+12>>2]|0,(a|0)==(e[w+16>>2]|0)){if(m=0,a=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,D=m,m=0,D&1){re=25;break t}}else a=e[a>>2]|0;if((a|0)!=-1){if(C)break;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,C){w=0;break}else w=0;if(a=S[ne>>0]|0,a=a&1?e[_>>2]|0:(a&255)>>>1,(e[K>>2]|0)==(t+a|0)){if(m=0,ve(8,ne|0,a<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+a}if(C=d+12|0,a=e[C>>2]|0,D=d+16|0,(a|0)==(e[D>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break}}else a=e[a>>2]|0;if(Pi(a,H,t,K,G,E,ae,P,L,U)|0)break;if(a=e[C>>2]|0,(a|0)==(e[D>>2]|0))if(m=0,ge(e[(e[d>>2]|0)+40>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break}else continue;else{e[C>>2]=a+4;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(26,t|0,e[K>>2]|0,l|0,H|0)|0,a=ye,ce=m,m=0,ce&1)re=26;else{if(ce=h,e[ce>>2]=t,e[ce+4>>2]=a,V0(ae,P,e[L>>2]|0,l),d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function Y4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+352|0,K=re+208|0,w=re+40|0,C=re+36|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+48|0,ae=re+4|0,P=re,L=re+337|0,G=re+336|0,xr(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=26;else{_=ce+8|0,U=ce+1|0,t=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=t,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=e[w>>2]|0,F=e[C>>2]|0,a=e[r>>2]|0;t:for(;;){if(a){if(w=e[a+12>>2]|0,(w|0)==(e[a+16>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,E=m,m=0,E&1){ke=25;break}}else w=e[w>>2]|0;(w|0)==-1?(e[r>>2]=0,a=0,D=1):D=0}else a=0,D=1;w=e[o>>2]|0;do if(w){if(C=e[w+12>>2]|0,(C|0)==(e[w+16>>2]|0)){if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=25;break t}}else C=e[C>>2]|0;if((C|0)!=-1){if(D)break;break t}else{e[o>>2]=0,ke=17;break}}else ke=17;while(!1);if((ke|0)==17)if(ke=0,D){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(t+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=25;break}if(S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),E=m,m=0,E&1){ke=25;break}t=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=t+C}if(D=a+12|0,C=e[D>>2]|0,E=a+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}}else C=e[C>>2]|0;if(wr(C,L,G,t,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}else continue;else{e[D>>2]=w+4;continue}}if((ke|0)==25){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(1,t|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=26;else{if(z[h>>2]=d,V0(Ee,ne,e[ae>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;ke=53;break}else{e[o>>2]=0,ke=51;break}}else ke=51;while(!1);return(ke|0)==51&&a&&(ke=53),(ke|0)==53&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==26&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function j4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+352|0,K=re+208|0,w=re+40|0,C=re+36|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+48|0,ae=re+4|0,P=re,L=re+337|0,G=re+336|0,xr(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=26;else{_=ce+8|0,U=ce+1|0,t=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=t,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=e[w>>2]|0,F=e[C>>2]|0,a=e[r>>2]|0;t:for(;;){if(a){if(w=e[a+12>>2]|0,(w|0)==(e[a+16>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,E=m,m=0,E&1){ke=25;break}}else w=e[w>>2]|0;(w|0)==-1?(e[r>>2]=0,a=0,D=1):D=0}else a=0,D=1;w=e[o>>2]|0;do if(w){if(C=e[w+12>>2]|0,(C|0)==(e[w+16>>2]|0)){if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=25;break t}}else C=e[C>>2]|0;if((C|0)!=-1){if(D)break;break t}else{e[o>>2]=0,ke=17;break}}else ke=17;while(!1);if((ke|0)==17)if(ke=0,D){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(t+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=25;break}if(S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),E=m,m=0,E&1){ke=25;break}t=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=t+C}if(D=a+12|0,C=e[D>>2]|0,E=a+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}}else C=e[C>>2]|0;if(wr(C,L,G,t,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}else continue;else{e[D>>2]=w+4;continue}}if((ke|0)==25){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(2,t|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=26;else{if(B[h>>3]=d,V0(Ee,ne,e[ae>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;ke=53;break}else{e[o>>2]=0,ke=51;break}}else ke=51;while(!1);return(ke|0)==51&&a&&(ke=53),(ke|0)==53&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==26&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function X4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+352|0,K=re+208|0,w=re+40|0,C=re+36|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+48|0,ae=re+4|0,P=re,L=re+337|0,G=re+336|0,xr(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=26;else{_=ce+8|0,U=ce+1|0,t=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=t,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=e[w>>2]|0,F=e[C>>2]|0,a=e[r>>2]|0;t:for(;;){if(a){if(w=e[a+12>>2]|0,(w|0)==(e[a+16>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,E=m,m=0,E&1){ke=25;break}}else w=e[w>>2]|0;(w|0)==-1?(e[r>>2]=0,a=0,D=1):D=0}else a=0,D=1;w=e[o>>2]|0;do if(w){if(C=e[w+12>>2]|0,(C|0)==(e[w+16>>2]|0)){if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=25;break t}}else C=e[C>>2]|0;if((C|0)!=-1){if(D)break;break t}else{e[o>>2]=0,ke=17;break}}else ke=17;while(!1);if((ke|0)==17)if(ke=0,D){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(t+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=25;break}if(S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),E=m,m=0,E&1){ke=25;break}t=S[ce>>0]&1?e[_>>2]|0:U,e[$>>2]=t+C}if(D=a+12|0,C=e[D>>2]|0,E=a+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}}else C=e[C>>2]|0;if(wr(C,L,G,t,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}else continue;else{e[D>>2]=w+4;continue}}if((ke|0)==25){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(3,t|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=26;else{if(B[h>>3]=d,V0(Ee,ne,e[ae>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;ke=53;break}else{e[o>>2]=0,ke=51;break}}else ke=51;while(!1);return(ke|0)==51&&a&&(ke=53),(ke|0)==53&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==26&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function q0(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;return h=b,b=b+16|0,d=h,e[d>>2]=l,l=ai(o)|0,o=Mn(t,r,a,d)|0,l|0&&(m=0,ge(75,l|0)|0,d=m,m=0,d&1)&&(d=j(0)|0,$t(d)),b=h,o|0}function Z4(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=b,b=b+16|0,h=l,e[h>>2]=a,a=ai(r)|0,m=0,r=Ve(37,t|0,o|0,h|0)|0,t=m,m=0,t&1)r=j()|0,a|0&&(m=0,ge(75,a|0)|0,h=m,m=0,h&1)&&(h=j(0)|0,$t(h)),le(r|0);else return a|0&&(m=0,ge(75,a|0)|0,h=m,m=0,h&1)&&(h=j(0)|0,$t(h)),b=l,r|0;return 0}function Hi(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0;F=b,b=b+16|0,E=F,d=e[t>>2]|0;e:do if(!d)d=0;else{if(R=r,C=a-R>>2,D=l+12|0,w=e[D>>2]|0,C=(w|0)>(C|0)?w-C|0:0,w=o,R=w-R|0,l=R>>2,(R|0)>0&&(Yt[e[(e[d>>2]|0)+48>>2]&63](d,r,l)|0)!=(l|0)){e[t>>2]=0,d=0;break}do if((C|0)>0)if(gr(E,C,h),m=0,l=Ve(e[(e[d>>2]|0)+48>>2]|0,d|0,(S[E>>0]&1?e[E+8>>2]|0:E+4|0)|0,C|0)|0,R=m,m=0,R&1&&(R=j()|0,Pt(E),le(R|0)),(l|0)==(C|0)){Pt(E);break}else{e[t>>2]=0,Pt(E),d=0;break e}while(!1);if(R=a-w|0,a=R>>2,(R|0)>0&&(Yt[e[(e[d>>2]|0)+48>>2]&63](d,o,a)|0)!=(a|0)){e[t>>2]=0,d=0;break}e[D>>2]=0}while(!1);return b=F,d|0}function fi(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;h=e[t>>2]|0;do if(h){if((e[h+12>>2]|0)==(e[h+16>>2]|0))if((Et[e[(e[h>>2]|0)+36>>2]&127](h)|0)==-1){e[t>>2]=0,h=0;break}else{h=e[t>>2]|0;break}}else h=0;while(!1);d=(h|0)==0,h=e[r>>2]|0;do if(h){if((e[h+12>>2]|0)==(e[h+16>>2]|0)&&(Et[e[(e[h>>2]|0)+36>>2]&127](h)|0)==-1){e[r>>2]=0,U=11;break}d?U=13:U=12}else U=11;while(!1);(U|0)==11&&(d?U=12:(h=0,U=13));e:do if((U|0)==12)e[o>>2]=e[o>>2]|6,h=0;else if((U|0)==13){if(d=e[t>>2]|0,w=e[d+12>>2]|0,(w|0)==(e[d+16>>2]|0)?d=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:d=N[w>>0]|0,w=d&255,w<<24>>24>-1&&(_=a+8|0,(k[(e[_>>2]|0)+(d<<24>>24<<1)>>1]&2048)!=0)){for(D=(Yt[e[(e[a>>2]|0)+36>>2]&63](a,w,0)|0)<<24>>24,d=e[t>>2]|0,w=d+12|0,C=e[w>>2]|0,(C|0)==(e[d+16>>2]|0)?(Et[e[(e[d>>2]|0)+40>>2]&127](d)|0,F=l,E=h,l=h,h=D):(e[w>>2]=C+1,F=l,E=h,l=h,h=D);;){h=h+-48|0,R=F+-1|0,d=e[t>>2]|0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0))if((Et[e[(e[d>>2]|0)+36>>2]&127](d)|0)==-1){e[t>>2]=0,d=0;break}else{d=e[t>>2]|0;break}}else d=0;while(!1);if(C=(d|0)==0,l?(e[l+12>>2]|0)==(e[l+16>>2]|0)?(Et[e[(e[l>>2]|0)+36>>2]&127](l)|0)==-1?(e[r>>2]=0,w=0,l=0):(w=E,l=E):w=E:(w=E,l=0),d=e[t>>2]|0,!((F|0)>1&(C^(l|0)==0)))break;if(C=e[d+12>>2]|0,(C|0)==(e[d+16>>2]|0)?d=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:d=N[C>>0]|0,C=d&255,C<<24>>24<=-1||!(k[(e[_>>2]|0)+(d<<24>>24<<1)>>1]&2048))break e;if(h=((Yt[e[(e[a>>2]|0)+36>>2]&63](a,C,0)|0)<<24>>24)+(h*10|0)|0,d=e[t>>2]|0,C=d+12|0,D=e[C>>2]|0,(D|0)==(e[d+16>>2]|0)){Et[e[(e[d>>2]|0)+40>>2]&127](d)|0,F=R,E=w;continue}else{e[C>>2]=D+1,F=R,E=w;continue}}do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0))if((Et[e[(e[d>>2]|0)+36>>2]&127](d)|0)==-1){e[t>>2]=0,d=0;break}else{d=e[t>>2]|0;break}}else d=0;while(!1);d=(d|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)&&(Et[e[(e[w>>2]|0)+36>>2]&127](w)|0)==-1){e[r>>2]=0,U=50;break}if(d)break e}else U=50;while(!1);if((U|0)==50&&!d)break;e[o>>2]=e[o>>2]|2;break}e[o>>2]=e[o>>2]|4,h=0}while(!1);return h|0}function hi(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;h=e[t>>2]|0;do if(h)if(d=e[h+12>>2]|0,(d|0)==(e[h+16>>2]|0)?h=Et[e[(e[h>>2]|0)+36>>2]&127](h)|0:h=e[d>>2]|0,(h|0)==-1){e[t>>2]=0,w=1;break}else{w=(e[t>>2]|0)==0;break}else w=1;while(!1);d=e[r>>2]|0;do if(d)if(h=e[d+12>>2]|0,(h|0)==(e[d+16>>2]|0)?h=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:h=e[h>>2]|0,(h|0)!=-1)if(w){_=17;break}else{_=16;break}else{e[r>>2]=0,_=14;break}else _=14;while(!1);(_|0)==14&&(w?_=16:(d=0,_=17));e:do if((_|0)==16)e[o>>2]=e[o>>2]|6,h=0;else if((_|0)==17){if(h=e[t>>2]|0,w=e[h+12>>2]|0,(w|0)==(e[h+16>>2]|0)?h=Et[e[(e[h>>2]|0)+36>>2]&127](h)|0:h=e[w>>2]|0,!(Yt[e[(e[a>>2]|0)+12>>2]&63](a,2048,h)|0)){e[o>>2]=e[o>>2]|4,h=0;break}for(h=(Yt[e[(e[a>>2]|0)+52>>2]&63](a,h,0)|0)<<24>>24,w=e[t>>2]|0,C=w+12|0,D=e[C>>2]|0,(D|0)==(e[w+16>>2]|0)?(Et[e[(e[w>>2]|0)+40>>2]&127](w)|0,F=l,E=d,C=d):(e[C>>2]=D+4,F=l,E=d,C=d);;){h=h+-48|0,R=F+-1|0,d=e[t>>2]|0;do if(d)if(w=e[d+12>>2]|0,(w|0)==(e[d+16>>2]|0)?d=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:d=e[w>>2]|0,(d|0)==-1){e[t>>2]=0,D=1;break}else{D=(e[t>>2]|0)==0;break}else D=1;while(!1);do if(C)if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)?d=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:d=e[d>>2]|0,(d|0)==-1){e[r>>2]=0,C=0,l=0,d=1;break}else{C=E,l=E,d=(E|0)==0;break}else C=E,l=0,d=1;while(!1);if(w=e[t>>2]|0,!((F|0)>1&(D^d)))break;if(d=e[w+12>>2]|0,(d|0)==(e[w+16>>2]|0)?d=Et[e[(e[w>>2]|0)+36>>2]&127](w)|0:d=e[d>>2]|0,!(Yt[e[(e[a>>2]|0)+12>>2]&63](a,2048,d)|0))break e;if(h=((Yt[e[(e[a>>2]|0)+52>>2]&63](a,d,0)|0)<<24>>24)+(h*10|0)|0,d=e[t>>2]|0,w=d+12|0,D=e[w>>2]|0,(D|0)==(e[d+16>>2]|0)){Et[e[(e[d>>2]|0)+40>>2]&127](d)|0,F=R,E=C,C=l;continue}else{e[w>>2]=D+4,F=R,E=C,C=l;continue}}do if(w)if(d=e[w+12>>2]|0,(d|0)==(e[w+16>>2]|0)?d=Et[e[(e[w>>2]|0)+36>>2]&127](w)|0:d=e[d>>2]|0,(d|0)==-1){e[t>>2]=0,w=1;break}else{w=(e[t>>2]|0)==0;break}else w=1;while(!1);do if(C)if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)?d=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:d=e[d>>2]|0,(d|0)!=-1){if(w)break e;break}else{e[r>>2]=0,_=60;break}else _=60;while(!1);if((_|0)==60&&!w)break;e[o>>2]=e[o>>2]|2}while(!1);return h|0}function J4(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=t+4|0,a=(e[h>>2]|0)!=189,w=e[t>>2]|0,d=w,l=(e[o>>2]|0)-d|0,l=l>>>0<2147483647?l<<1:-1,d=(e[r>>2]|0)-d|0,w=Gi(a?w:0,l)|0,w||En();do if(a)e[t>>2]=w,C=w;else if(a=e[t>>2]|0,e[t>>2]=w,a)if(m=0,ue(e[h>>2]|0,a|0),w=m,m=0,w&1)w=j(0)|0,$t(w);else{C=e[t>>2]|0;break}else C=w;while(!1);e[h>>2]=201,e[r>>2]=C+d,e[o>>2]=(e[t>>2]|0)+l}function e3(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=t+4|0,a=(e[h>>2]|0)!=189,w=e[t>>2]|0,d=w,l=(e[o>>2]|0)-d|0,l=l>>>0<2147483647?l<<1:-1,d=(e[r>>2]|0)-d>>2,w=Gi(a?w:0,l)|0,w||En();do if(a)e[t>>2]=w,C=w;else if(a=e[t>>2]|0,e[t>>2]=w,a)if(m=0,ue(e[h>>2]|0,a|0),w=m,m=0,w&1)w=j(0)|0,$t(w);else{C=e[t>>2]|0;break}else C=w;while(!1);e[h>>2]=201,e[r>>2]=C+(d<<2),e[o>>2]=(e[t>>2]|0)+(l>>>2<<2)}function t3(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=r,a=S[t>>0]|0,a&1?(a=e[t>>2]|0,l=(a&-2)+-1|0,C=e[t+4>>2]|0,a=a&255):(l=10,C=(a&255)>>>1),w=o-h|0;do if((o|0)!=(r|0)){if((l-C|0)>>>0>>0&&(pr(t,l,C+w-l|0,C,C,0,0),a=S[t>>0]|0),a&1?d=e[t+8>>2]|0:d=t+1|0,h=o+(C-h)|0,(r|0)!=(o|0))for(a=r,l=d+C|0;S[l>>0]=S[a>>0]|0,a=a+1|0,(a|0)!=(o|0);)l=l+1|0;if(S[d+h>>0]=0,a=C+w|0,S[t>>0]&1){e[t+4>>2]=a;break}else{S[t>>0]=a<<1;break}}while(!1);return t|0}function i3(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=t+4|0,a=(e[h>>2]|0)!=189,w=e[t>>2]|0,d=w,l=(e[o>>2]|0)-d|0,l=l>>>0<2147483647?l<<1:-1,d=(e[r>>2]|0)-d>>2,w=Gi(a?w:0,l)|0,w||En();do if(a)e[t>>2]=w,C=w;else if(a=e[t>>2]|0,e[t>>2]=w,a)if(m=0,ue(e[h>>2]|0,a|0),w=m,m=0,w&1)w=j(0)|0,$t(w);else{C=e[t>>2]|0;break}else C=w;while(!1);e[h>>2]=201,e[r>>2]=C+(d<<2),e[o>>2]=(e[t>>2]|0)+(l>>>2<<2)}function n3(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=r,a=S[t>>0]|0,a&1?(a=e[t>>2]|0,l=(a&-2)+-1|0,C=e[t+4>>2]|0,a=a&255):(l=1,C=(a&255)>>>1),w=o-h>>2;do if(w){if((l-C|0)>>>0>>0&&(Ws(t,l,C+w-l|0,C,C,0,0),a=S[t>>0]|0),a&1?d=e[t+8>>2]|0:d=t+4|0,h=C+((o-h|0)>>>2)|0,(r|0)!=(o|0))for(a=r,l=d+(C<<2)|0;e[l>>2]=e[a>>2],a=a+4|0,(a|0)!=(o|0);)l=l+4|0;if(e[d+(h<<2)>>2]=0,a=C+w|0,S[t>>0]&1){e[t+4>>2]=a;break}else{S[t>>0]=a<<1;break}}while(!1);return t|0}function r3(t,r){t=t|0,r=r|0;var o=0;e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,S[t+128>>0]=0;do if(r)if(m=0,Ae(125,t|0,r|0),o=m,m=0,o&1)o=j()|0,yr(t),le(o|0);else{no(t,r);break}while(!1)}function s3(t,r){t=t|0,r=r|0,w0(t,r,x0(43148)|0)}function o3(t,r){t=t|0,r=r|0,w0(t,r,x0(43188)|0)}function l3(t,r){t=t|0,r=r|0,w0(t,r,x0(44220)|0)}function u3(t,r){t=t|0,r=r|0,w0(t,r,x0(44212)|0)}function c3(t,r){t=t|0,r=r|0,w0(t,r,x0(44280)|0)}function f3(t,r){t=t|0,r=r|0,w0(t,r,x0(44288)|0)}function h3(t,r){t=t|0,r=r|0,w0(t,r,x0(44344)|0)}function d3(t,r){t=t|0,r=r|0,w0(t,r,x0(44352)|0)}function p3(t,r){t=t|0,r=r|0,w0(t,r,x0(44360)|0)}function m3(t,r){t=t|0,r=r|0,w0(t,r,x0(44368)|0)}function g3(t,r){t=t|0,r=r|0,w0(t,r,x0(43260)|0)}function S3(t,r){t=t|0,r=r|0,w0(t,r,x0(43332)|0)}function A3(t,r){t=t|0,r=r|0,w0(t,r,x0(43392)|0)}function v3(t,r){t=t|0,r=r|0,w0(t,r,x0(43452)|0)}function x3(t,r){t=t|0,r=r|0,w0(t,r,x0(43764)|0)}function w3(t,r){t=t|0,r=r|0,w0(t,r,x0(43828)|0)}function y3(t,r){t=t|0,r=r|0,w0(t,r,x0(43892)|0)}function C3(t,r){t=t|0,r=r|0,w0(t,r,x0(43956)|0)}function T3(t,r){t=t|0,r=r|0,w0(t,r,x0(43992)|0)}function I3(t,r){t=t|0,r=r|0,w0(t,r,x0(44028)|0)}function k3(t,r){t=t|0,r=r|0,w0(t,r,x0(44064)|0)}function E3(t,r){t=t|0,r=r|0,w0(t,r,x0(44100)|0)}function D3(t,r){t=t|0,r=r|0,w0(t,r,x0(43544)|0)}function b3(t,r){t=t|0,r=r|0,w0(t,r,x0(43636)|0)}function F3(t,r){t=t|0,r=r|0,w0(t,r,x0(43668)|0)}function N3(t,r){t=t|0,r=r|0,w0(t,r,x0(43700)|0)}function R3(t,r){t=t|0,r=r|0,w0(t,r,x0(44140)|0)}function M3(t,r){t=t|0,r=r|0,w0(t,r,x0(44180)|0)}function yr(t){t=t|0;var r=0,o=0,a=0;o=e[t>>2]|0;do if(o){if(a=t+4|0,r=e[a>>2]|0,(r|0)!=(o|0)){do r=r+-4|0;while((r|0)!=(o|0));e[a>>2]=r}if((t+16|0)==(o|0)){S[t+128>>0]=0;break}else{he(o);break}}while(!1)}function _3(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0;if(d=t+4|0,o=e[d>>2]|0,a=e[t>>2]|0,l=o-a>>2,l>>>0>=r>>>0){if(l>>>0>r>>>0&&(h=a+(r<<2)|0,(o|0)!=(h|0))){do o=o+-4|0;while((o|0)!=(h|0));e[d>>2]=o}}else Y3(t,r-l|0)}function P3(t,r){t=t|0,r=r|0;var o=0;return o=e[t+8>>2]|0,(e[t+12>>2]|0)-o>>2>>>0>r>>>0?o=(e[o+(r<<2)>>2]|0)!=0:o=0,o|0}function L3(t){t=t|0;var r=0,o=0;o=t+4|0,r=e[o>>2]|0,o=e[o+4>>2]|0,t=(e[t>>2]|0)+(o>>1)|0,o&1&&(r=e[(e[t>>2]|0)+r>>2]|0),Rt[r&255](t)}function O3(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0;e[o>>2]=t,e[h>>2]=a,w&2?(l-a|0)<3?t=1:(e[h>>2]=a+1,S[a>>0]=-17,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=-69,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=-65,C=4):C=4;e:do if((C|0)==4)if(D=r,t=e[o>>2]|0,t>>>0>>0)for(;;){if(w=k[t>>1]|0,C=w&65535,C>>>0>d>>>0){t=2;break e}do if((w&65535)<128){if(t=e[h>>2]|0,(l-t|0)<1){t=1;break e}e[h>>2]=t+1,S[t>>0]=w}else{if((w&65535)<2048){if(t=e[h>>2]|0,(l-t|0)<2){t=1;break e}e[h>>2]=t+1,S[t>>0]=C>>>6|192,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C&63|128;break}if((w&65535)<55296){if(t=e[h>>2]|0,(l-t|0)<3){t=1;break e}e[h>>2]=t+1,S[t>>0]=C>>>12|224,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C>>>6&63|128,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C&63|128;break}if((w&65535)>=56320){if((w&65535)<57344){t=2;break e}if(t=e[h>>2]|0,(l-t|0)<3){t=1;break e}e[h>>2]=t+1,S[t>>0]=C>>>12|224,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C>>>6&63|128,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C&63|128;break}if((D-t|0)<4){t=1;break e}if(t=t+2|0,w=M[t>>1]|0,(w&64512|0)!=56320){t=2;break e}if((l-(e[h>>2]|0)|0)<4){t=1;break e}if(a=C&960,((a<<10)+65536|C<<10&64512|w&1023)>>>0>d>>>0){t=2;break e}e[o>>2]=t,t=(a>>>6)+1|0,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=t>>>2|240,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C>>>2&15|t<<4&48|128,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C<<4&48|w>>>6&15|128,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w&63|128}while(!1);if(t=(e[o>>2]|0)+2|0,e[o>>2]=t,t>>>0>=r>>>0){t=0;break}}else t=0;while(!1);return t|0}function $3(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0;e[o>>2]=t,e[h>>2]=a,w&4?(t=e[o>>2]|0,w=r,(w-t|0)>2&&(S[t>>0]|0)==-17&&(S[t+1>>0]|0)==-69&&(S[t+2>>0]|0)==-65?(e[o>>2]=t+3,C=e[h>>2]|0):C=a):(C=a,w=r),R=l,a=e[o>>2]|0,t=a>>>0>>0;e:do if(t&C>>>0>>0)for(;;){if(t=S[a>>0]|0,E=t&255,E>>>0>d>>>0){t=2;break e}do if(t<<24>>24>-1)k[C>>1]=t&255,e[o>>2]=a+1;else{if((t&255)<194){t=2;break e}if((t&255)<224){if((w-a|0)<2){t=1;break e}if(t=N[a+1>>0]|0,(t&192|0)!=128){t=2;break e}if(t=t&63|E<<6&1984,t>>>0>d>>>0){t=2;break e}k[C>>1]=t,e[o>>2]=a+2;break}if((t&255)<240){if((w-a|0)<3){t=1;break e}switch(D=S[a+1>>0]|0,t=S[a+2>>0]|0,E|0){case 224:{if((D&-32)<<24>>24!=-96){t=2;break e}break}case 237:{if((D&-32)<<24>>24!=-128){t=2;break e}break}default:if((D&-64)<<24>>24!=-128){t=2;break e}}if(t=t&255,(t&192|0)!=128){t=2;break e}if(t=(D&255)<<6&4032|E<<12|t&63,(t&65535)>>>0>d>>>0){t=2;break e}k[C>>1]=t,e[o>>2]=a+3;break}if((t&255)>=245){t=2;break e}if((w-a|0)<4){t=1;break e}switch(D=S[a+1>>0]|0,t=S[a+2>>0]|0,a=S[a+3>>0]|0,E|0){case 240:{if((D+112&255)>=48){t=2;break e}break}case 244:{if((D&-16)<<24>>24!=-128){t=2;break e}break}default:if((D&-64)<<24>>24!=-128){t=2;break e}}if(F=t&255,(F&192|0)!=128){t=2;break e}if(t=a&255,(t&192|0)!=128){t=2;break e}if((R-C|0)<4){t=1;break e}if(E=E&7,a=D&255,D=F<<6,t=t&63,(a<<12&258048|E<<18|D&4032|t)>>>0>d>>>0){t=2;break e}k[C>>1]=a<<2&60|F>>>4&3|((a>>>4&3|E<<2)<<6)+16320|55296,F=C+2|0,e[h>>2]=F,k[F>>1]=t|D&960|56320,e[o>>2]=(e[o>>2]|0)+4}while(!1);if(C=(e[h>>2]|0)+2|0,e[h>>2]=C,a=e[o>>2]|0,t=a>>>0>>0,!(t&C>>>0>>0)){_=39;break}}else _=39;while(!1);return(_|0)==39&&(t=t&1),t|0}function B3(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;F=r,l&4|0&&(F-t|0)>2&&(S[t>>0]|0)==-17&&(S[t+1>>0]|0)==-69?l=(S[t+2>>0]|0)==-65?t+3|0:t:l=t;e:do if((o|0)!=0&l>>>0>>0){E=l,h=0;t:for(;;){if(l=S[E>>0]|0,D=l&255,D>>>0>a>>>0){l=E,h=42;break e}do if(l<<24>>24>-1)l=E+1|0;else{if((l&255)<194){l=E,h=42;break e}if((l&255)<224){if((F-E|0)<2){l=E,h=42;break e}if(l=N[E+1>>0]|0,(l&192|0)!=128){l=E,h=42;break e}if((l&63|D<<6&1984)>>>0>a>>>0){l=E,h=42;break e}l=E+2|0;break}if((l&255)<240){if(l=E,(F-l|0)<3){l=E,h=42;break e}switch(w=S[E+1>>0]|0,d=S[E+2>>0]|0,D|0){case 224:{if((w&-32)<<24>>24!=-96){h=20;break t}break}case 237:{if((w&-32)<<24>>24!=-128){h=22;break t}break}default:if((w&-64)<<24>>24!=-128){h=24;break t}}if(l=d&255,(l&192|0)!=128){l=E,h=42;break e}if(((w&255)<<6&4032|D<<12&61440|l&63)>>>0>a>>>0){l=E,h=42;break e}l=E+3|0;break}if((l&255)>=245){l=E,h=42;break e}if(l=E,(o-h|0)>>>0<2|(F-l|0)<4){l=E,h=42;break e}switch(C=S[E+1>>0]|0,d=S[E+2>>0]|0,w=S[E+3>>0]|0,D|0){case 240:{if((C+112&255)>=48){h=32;break t}break}case 244:{if((C&-16)<<24>>24!=-128){h=34;break t}break}default:if((C&-64)<<24>>24!=-128){h=36;break t}}if(d=d&255,(d&192|0)!=128){l=E,h=42;break e}if(l=w&255,(l&192|0)!=128){l=E,h=42;break e}if(((C&255)<<12&258048|D<<18&1835008|d<<6&4032|l&63)>>>0>a>>>0){l=E,h=42;break e}l=E+4|0,h=h+1|0}while(!1);if(h=h+1|0,h>>>0>>0&l>>>0>>0)E=l;else{h=42;break e}}if((h|0)==20){l=l-t|0;break}else if((h|0)==22){l=l-t|0;break}else if((h|0)==24){l=l-t|0;break}else if((h|0)==32){l=l-t|0;break}else if((h|0)==34){l=l-t|0;break}else if((h|0)==36){l=l-t|0;break}}else h=42;while(!1);return(h|0)==42&&(l=l-t|0),l|0}function V3(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0;e[o>>2]=t,e[h>>2]=a,D=l,w&2?(D-a|0)<3?t=1:(e[h>>2]=a+1,S[a>>0]=-17,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=-69,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=-65,C=4):C=4;e:do if((C|0)==4)if(t=e[o>>2]|0,t>>>0>>0)for(;;){if(w=e[t>>2]|0,w>>>0>d>>>0|(w&-2048|0)==55296){t=2;break e}do if(w>>>0>=128){if(w>>>0<2048){if(t=e[h>>2]|0,(D-t|0)<2){t=1;break e}e[h>>2]=t+1,S[t>>0]=w>>>6|192,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w&63|128;break}if(t=e[h>>2]|0,l=D-t|0,w>>>0<65536){if((l|0)<3){t=1;break e}e[h>>2]=t+1,S[t>>0]=w>>>12|224,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w>>>6&63|128,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w&63|128;break}else{if((l|0)<4){t=1;break e}e[h>>2]=t+1,S[t>>0]=w>>>18|240,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w>>>12&63|128,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w>>>6&63|128,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w&63|128;break}}else{if(t=e[h>>2]|0,(D-t|0)<1){t=1;break e}e[h>>2]=t+1,S[t>>0]=w}while(!1);if(t=(e[o>>2]|0)+4|0,e[o>>2]=t,t>>>0>=r>>>0){t=0;break}}else t=0;while(!1);return t|0}function U3(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0;e[o>>2]=t,e[h>>2]=a,w&4?(t=e[o>>2]|0,w=r,(w-t|0)>2&&(S[t>>0]|0)==-17&&(S[t+1>>0]|0)==-69&&(S[t+2>>0]|0)==-65&&(e[o>>2]=t+3,a=e[h>>2]|0),R=w):R=r,w=e[o>>2]|0,t=w>>>0>>0;e:do if(t&a>>>0>>0)for(;;){t=S[w>>0]|0,F=t&255;do if(t<<24>>24>-1){if(F>>>0>d>>>0){t=2;break e}e[a>>2]=F,e[o>>2]=w+1}else{if((t&255)<194){t=2;break e}if((t&255)<224){if((R-w|0)<2){t=1;break e}if(t=N[w+1>>0]|0,(t&192|0)!=128){t=2;break e}if(t=t&63|F<<6&1984,t>>>0>d>>>0){t=2;break e}e[a>>2]=t,e[o>>2]=w+2;break}if((t&255)<240){if((R-w|0)<3){t=1;break e}switch(C=S[w+1>>0]|0,t=S[w+2>>0]|0,F|0){case 224:{if((C&-32)<<24>>24!=-96){t=2;break e}break}case 237:{if((C&-32)<<24>>24!=-128){t=2;break e}break}default:if((C&-64)<<24>>24!=-128){t=2;break e}}if(t=t&255,(t&192|0)!=128){t=2;break e}if(t=(C&255)<<6&4032|F<<12&61440|t&63,t>>>0>d>>>0){t=2;break e}e[a>>2]=t,e[o>>2]=w+3;break}if((t&255)>=245){t=2;break e}if((R-w|0)<4){t=1;break e}switch(E=S[w+1>>0]|0,t=S[w+2>>0]|0,C=S[w+3>>0]|0,F|0){case 240:{if((E+112&255)>=48){t=2;break e}break}case 244:{if((E&-16)<<24>>24!=-128){t=2;break e}break}default:if((E&-64)<<24>>24!=-128){t=2;break e}}if(D=t&255,(D&192|0)!=128){t=2;break e}if(t=C&255,(t&192|0)!=128){t=2;break e}if(t=(E&255)<<12&258048|F<<18&1835008|D<<6&4032|t&63,t>>>0>d>>>0){t=2;break e}e[a>>2]=t,e[o>>2]=w+4}while(!1);if(a=(e[h>>2]|0)+4|0,e[h>>2]=a,w=e[o>>2]|0,t=w>>>0>>0,!(t&a>>>0>>0)){_=38;break}}else _=38;while(!1);return(_|0)==38&&(t=t&1),t|0}function z3(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;F=r,l&4|0&&(F-t|0)>2&&(S[t>>0]|0)==-17&&(S[t+1>>0]|0)==-69?l=(S[t+2>>0]|0)==-65?t+3|0:t:l=t;e:do if((o|0)!=0&l>>>0>>0){D=l,E=0;t:for(;;){l=S[D>>0]|0,C=l&255;do if(l<<24>>24>-1){if(C>>>0>a>>>0){l=D,h=42;break e}l=D+1|0}else{if((l&255)<194){l=D,h=42;break e}if((l&255)<224){if((F-D|0)<2){l=D,h=42;break e}if(l=N[D+1>>0]|0,(l&192|0)!=128){l=D,h=42;break e}if((l&63|C<<6&1984)>>>0>a>>>0){l=D,h=42;break e}l=D+2|0;break}if((l&255)<240){if(l=D,(F-l|0)<3){l=D,h=42;break e}switch(d=S[D+1>>0]|0,h=S[D+2>>0]|0,C|0){case 224:{if((d&-32)<<24>>24!=-96){h=20;break t}break}case 237:{if((d&-32)<<24>>24!=-128){h=22;break t}break}default:if((d&-64)<<24>>24!=-128){h=24;break t}}if(l=h&255,(l&192|0)!=128){l=D,h=42;break e}if(((d&255)<<6&4032|C<<12&61440|l&63)>>>0>a>>>0){l=D,h=42;break e}l=D+3|0;break}if((l&255)>=245){l=D,h=42;break e}if(l=D,(F-l|0)<4){l=D,h=42;break e}switch(w=S[D+1>>0]|0,h=S[D+2>>0]|0,d=S[D+3>>0]|0,C|0){case 240:{if((w+112&255)>=48){h=32;break t}break}case 244:{if((w&-16)<<24>>24!=-128){h=34;break t}break}default:if((w&-64)<<24>>24!=-128){h=36;break t}}if(h=h&255,(h&192|0)!=128){l=D,h=42;break e}if(l=d&255,(l&192|0)!=128){l=D,h=42;break e}if(((w&255)<<12&258048|C<<18&1835008|h<<6&4032|l&63)>>>0>a>>>0){l=D,h=42;break e}l=D+4|0}while(!1);if(E=E+1|0,E>>>0>>0&l>>>0>>0)D=l;else{h=42;break e}}if((h|0)==20){l=l-t|0;break}else if((h|0)==22){l=l-t|0;break}else if((h|0)==24){l=l-t|0;break}else if((h|0)==32){l=l-t|0;break}else if((h|0)==34){l=l-t|0;break}else if((h|0)==36){l=l-t|0;break}}else h=42;while(!1);return(h|0)==42&&(l=l-t|0),l|0}function G3(t){t=t|0,de(45196),de(45184),de(45172),de(45160),de(45148),de(45136),de(45124),de(45112),de(45100),de(45088),de(45076),de(45064),de(45052),de(45040)}function q3(t){t=t|0,Pt(45368),Pt(45356),Pt(45344),Pt(45332),Pt(45320),Pt(45308),Pt(45296),Pt(45284),Pt(45272),Pt(45260),Pt(45248),Pt(45236),Pt(45224),Pt(45212)}function W3(t){t=t|0,de(46e3),de(45988),de(45976),de(45964),de(45952),de(45940),de(45928),de(45916),de(45904),de(45892),de(45880),de(45868),de(45856),de(45844),de(45832),de(45820),de(45808),de(45796),de(45784),de(45772),de(45760),de(45748),de(45736),de(45724)}function H3(t){t=t|0,Pt(46292),Pt(46280),Pt(46268),Pt(46256),Pt(46244),Pt(46232),Pt(46220),Pt(46208),Pt(46196),Pt(46184),Pt(46172),Pt(46160),Pt(46148),Pt(46136),Pt(46124),Pt(46112),Pt(46100),Pt(46088),Pt(46076),Pt(46064),Pt(46052),Pt(46040),Pt(46028),Pt(46016)}function Q3(t){t=t|0,de(47104),de(47092),de(47080),de(47068),de(47056),de(47044),de(47032),de(47020),de(47008),de(46996),de(46984),de(46972),de(46960),de(46948),de(46936),de(46924),de(46912),de(46900),de(46888),de(46876),de(46864),de(46852),de(46840),de(46828)}function K3(t){t=t|0,Pt(47396),Pt(47384),Pt(47372),Pt(47360),Pt(47348),Pt(47336),Pt(47324),Pt(47312),Pt(47300),Pt(47288),Pt(47276),Pt(47264),Pt(47252),Pt(47240),Pt(47228),Pt(47216),Pt(47204),Pt(47192),Pt(47180),Pt(47168),Pt(47156),Pt(47144),Pt(47132),Pt(47120)}function Y3(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;C=b,b=b+32|0,w=C,h=e[t+8>>2]|0,o=e[t+4>>2]|0,h-o>>2>>>0>>0?(a=e[t>>2]|0,d=o-a>>2,l=d+r|0,l>>>0>1073741823&&pi(t),o=h-a|0,o>>2>>>0<536870911?(o=o>>1,o=o>>>0>>0?l:o):o=1073741823,j3(w,o,d,t+16|0),d=w+8|0,h=e[d>>2]|0,Jt(h|0,0,r<<2|0)|0,e[d>>2]=h+(r<<2),X3(t,w),Z3(w)):no(t,r),b=C}function no(t,r){t=t|0,r=r|0;var o=0;o=t+4|0,t=r,r=e[o>>2]|0;do e[r>>2]=0,r=(e[o>>2]|0)+4|0,e[o>>2]=r,t=t+-1|0;while(t|0)}function j3(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;e[t+12>>2]=0,e[t+16>>2]=a;do if(r)if(l=a+112|0,r>>>0<29&(S[l>>0]|0)==0){S[l>>0]=1;break}else{a=Xe(r<<2)|0;break}else a=0;while(!1);e[t>>2]=a,o=a+(o<<2)|0,e[t+8>>2]=o,e[t+4>>2]=o,e[t+12>>2]=a+(r<<2)}function X3(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0;a=e[t>>2]|0,h=t+4|0,o=r+4|0,l=(e[h>>2]|0)-a|0,d=(e[o>>2]|0)+(0-(l>>2)<<2)|0,e[o>>2]=d,o0(d|0,a|0,l|0)|0,l=e[t>>2]|0,e[t>>2]=e[o>>2],e[o>>2]=l,l=r+8|0,a=e[h>>2]|0,e[h>>2]=e[l>>2],e[l>>2]=a,l=t+8|0,t=r+12|0,a=e[l>>2]|0,e[l>>2]=e[t>>2],e[t>>2]=a,e[r>>2]=e[o>>2]}function Z3(t){t=t|0;var r=0,o=0,a=0;if(o=e[t+4>>2]|0,a=t+8|0,r=e[a>>2]|0,(r|0)!=(o|0)){do r=r+-4|0;while((r|0)!=(o|0));e[a>>2]=r}o=e[t>>2]|0;do if(o)if(r=e[t+16>>2]|0,(r|0)==(o|0)){S[r+112>>0]=0;break}else{he(o);break}while(!1)}function J3(t,r){t=t|0,r=r|0;var o=0;r>>>0>1073741823&&pi(t),o=t+128|0,r>>>0<29&(S[o>>0]|0)==0?(S[o>>0]=1,o=t+16|0):o=Xe(r<<2)|0,e[t+4>>2]=o,e[t>>2]=o,e[t+8>>2]=o+(r<<2)}function e5(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;do if((t|0)!=(r|0)){if(l=S0()|0,h=e[l>>2]|0,e[l>>2]=0,a=+Nr(t,d,b0()|0),t=e[l>>2]|0,t||(e[l>>2]=h),(e[d>>2]|0)!=(r|0)){e[o>>2]=4,a=0;break}(t|0)==34&&(e[o>>2]=4)}else e[o>>2]=4,a=0;while(!1);return b=w,+a}function t5(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;do if((t|0)!=(r|0)){if(l=S0()|0,h=e[l>>2]|0,e[l>>2]=0,a=+Nr(t,d,b0()|0),t=e[l>>2]|0,t||(e[l>>2]=h),(e[d>>2]|0)!=(r|0)){e[o>>2]=4,a=0;break}(t|0)==34&&(e[o>>2]=4)}else e[o>>2]=4,a=0;while(!1);return b=w,+a}function i5(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;do if((t|0)==(r|0))e[o>>2]=4,a=0;else{if(l=S0()|0,h=e[l>>2]|0,e[l>>2]=0,a=+Nr(t,d,b0()|0),t=e[l>>2]|0,t||(e[l>>2]=h),(e[d>>2]|0)!=(r|0)){e[o>>2]=4,a=0;break}(t|0)==34&&(e[o>>2]=4)}while(!1);return b=w,+a}function n5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;do if((t|0)!=(r|0)){if((S[t>>0]|0)==45){e[o>>2]=4,a=0,t=0;break}if(l=S0()|0,h=e[l>>2]|0,e[l>>2]=0,t=Dn(t,d,a,b0()|0)|0,a=e[l>>2]|0,a||(e[l>>2]=h),(e[d>>2]|0)!=(r|0)){e[o>>2]=4,a=0,t=0;break}(a|0)==34?(e[o>>2]=4,a=-1,t=-1):a=ye}else e[o>>2]=4,a=0,t=0;while(!1);return ye=a,b=w,t|0}function r5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;do if((t|0)!=(r|0)){if((S[t>>0]|0)==45){e[o>>2]=4,t=0;break}if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Dn(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,t=0;break}if(a>>>0>0|(a|0)==0&t>>>0>4294967295|(l|0)==34){e[o>>2]=4,t=-1;break}else break}else e[o>>2]=4,t=0;while(!1);return b=C,t|0}function s5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;do if((t|0)!=(r|0)){if((S[t>>0]|0)==45){e[o>>2]=4,t=0;break}if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Dn(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,t=0;break}if(a>>>0>0|(a|0)==0&t>>>0>4294967295|(l|0)==34){e[o>>2]=4,t=-1;break}else break}else e[o>>2]=4,t=0;while(!1);return b=C,t|0}function o5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;do if((t|0)!=(r|0)){if((S[t>>0]|0)==45){e[o>>2]=4,t=0;break}if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Dn(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,t=0;break}if(a>>>0>0|(a|0)==0&t>>>0>65535|(l|0)==34){e[o>>2]=4,t=-1;break}else{t=t&65535;break}}else e[o>>2]=4,t=0;while(!1);return b=C,t|0}function l5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;do if((t|0)!=(r|0)){if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Ao(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,a=0,t=0;break}if((l|0)==34)return e[o>>2]=4,w=(a|0)>0|(a|0)==0&t>>>0>0,ye=w?2147483647:-2147483648,b=C,(w?-1:0)|0}else e[o>>2]=4,a=0,t=0;while(!1);return ye=a,b=C,t|0}function u5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;e:do if((t|0)==(r|0))e[o>>2]=4,t=0;else{if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Ao(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,t=0;break}do if((l|0)==34){if(e[o>>2]=4,(a|0)>0|(a|0)==0&t>>>0>0){t=2147483647;break e}}else{if((a|0)<-1|(a|0)==-1&t>>>0<2147483648){e[o>>2]=4;break}if((a|0)>0|(a|0)==0&t>>>0>2147483647){e[o>>2]=4,t=2147483647;break e}else break e}while(!1);t=-2147483648}while(!1);return b=C,t|0}function c5(){}function ii(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,a=r-a-(o>>>0>t>>>0|0)>>>0,ye=a,t-o>>>0|0|0}function Jt(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;if(a=t+o|0,(o|0)>=20){if(r=r&255,h=t&3,d=r|r<<8|r<<16|r<<24,l=a&-4,h)for(h=t+4-h|0;(t|0)<(h|0);)S[t>>0]=r,t=t+1|0;for(;(t|0)<(l|0);)e[t>>2]=d,t=t+4|0}for(;(t|0)<(a|0);)S[t>>0]=r,t=t+1|0;return t-o|0}function $0(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,o=t+o>>>0,ye=r+a+(o>>>0>>0|0)>>>0,o|0|0}function Di(t,r,o){return t=t|0,r=r|0,o=o|0,(o|0)<32?(ye=r>>>o,t>>>o|(r&(1<>>o-32|0)}function o0(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if((o|0)>=4096)return qo(t|0,r|0,o|0)|0;if(a=t|0,(t&3)==(r&3)){for(;t&3;){if(!o)return a|0;S[t>>0]=S[r>>0]|0,t=t+1|0,r=r+1|0,o=o-1|0}for(;(o|0)>=4;)e[t>>2]=e[r>>2],t=t+4|0,r=r+4|0,o=o-4|0}for(;(o|0)>0;)S[t>>0]=S[r>>0]|0,t=t+1|0,r=r+1|0,o=o-1|0;return a|0}function v0(t,r,o){return t=t|0,r=r|0,o=o|0,(o|0)<32?(ye=r<>>32-o,t<0;)t=t-1|0,r=r-1|0,o=o-1|0,S[t>>0]=S[r>>0]|0;t=a}else o0(t,r,o)|0;return t|0}function AA(t,r,o){return t=t|0,r=r|0,o=o|0,(o|0)<32?(ye=r>>o,t>>>o|(r&(1<>o-32|0)}function ro(t){t=t|0;var r=0;return r=S[X+(t&255)>>0]|0,(r|0)<8?r|0:(r=S[X+(t>>8&255)>>0]|0,(r|0)<8?r+8|0:(r=S[X+(t>>16&255)>>0]|0,(r|0)<8?r+16|0:(S[X+(t>>>24)>>0]|0)+24|0))}function f5(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;return h=t&65535,l=r&65535,o=ie(l,h)|0,a=t>>>16,t=(o>>>16)+(ie(l,a)|0)|0,l=r>>>16,r=ie(l,h)|0,ye=(t>>>16)+(ie(l,a)|0)+(((t&65535)+r|0)>>>16)|0,t+r<<16|o&65535|0|0}function vA(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;return D=r>>31|((r|0)<0?-1:0)<<1,C=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1,h=a>>31|((a|0)<0?-1:0)<<1,l=((a|0)<0?-1:0)>>31|((a|0)<0?-1:0)<<1,w=ii(D^t,C^r,D,C)|0,d=ye,t=h^D,r=l^C,ii((wn(w,d,ii(h^o,l^a,h,l)|0,ye,0)|0)^t,ye^r,t,r)|0}function xA(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;return l=b,b=b+16|0,w=l|0,d=r>>31|((r|0)<0?-1:0)<<1,h=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1,D=a>>31|((a|0)<0?-1:0)<<1,C=((a|0)<0?-1:0)>>31|((a|0)<0?-1:0)<<1,t=ii(d^t,h^r,d,h)|0,r=ye,wn(t,r,ii(D^o,C^a,D,C)|0,ye,w)|0,a=ii(e[w>>2]^d,e[w+4>>2]^h,d,h)|0,o=ye,b=l,ye=o,a|0}function Qi(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return l=t,h=o,o=f5(l,h)|0,t=ye,ye=(ie(r,h)|0)+(ie(a,l)|0)+t|t&0,o|0|0|0}function xn(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,wn(t,r,o,a,0)|0}function Cr(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return h=b,b=b+16|0,l=h|0,wn(t,r,o,a,l)|0,b=h,ye=e[l+4>>2]|0,e[l>>2]|0|0}function wn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(E=t,C=r,D=C,d=o,R=a,w=R,!D)return h=(l|0)!=0,w?h?(e[l>>2]=t|0,e[l+4>>2]=r&0,R=0,l=0,ye=R,l|0):(R=0,l=0,ye=R,l|0):(h&&(e[l>>2]=(E>>>0)%(d>>>0),e[l+4>>2]=0),R=0,l=(E>>>0)/(d>>>0)>>>0,ye=R,l|0);h=(w|0)==0;do if(d){if(!h){if(h=(st(w|0)|0)-(st(D|0)|0)|0,h>>>0<=31){F=h+1|0,w=31-h|0,r=h-31>>31,d=F,t=E>>>(F>>>0)&r|D<>>(F>>>0)&r,h=0,w=E<>2]=t|0,e[l+4>>2]=C|r&0,R=0,l=0,ye=R,l|0):(R=0,l=0,ye=R,l|0)}if(h=d-1|0,h&d){w=(st(d|0)|0)+33-(st(D|0)|0)|0,U=64-w|0,F=32-w|0,C=F>>31,_=w-32|0,r=_>>31,d=w,t=F-1>>31&D>>>(_>>>0)|(D<>>(w>>>0))&r,r=r&D>>>(w>>>0),h=E<>>(_>>>0))&C|E<>31;break}return l&&(e[l>>2]=h&E,e[l+4>>2]=0),(d|0)==1?(_=C|r&0,U=t|0|0,ye=_,U|0):(U=ro(d|0)|0,_=D>>>(U>>>0)|0,U=D<<32-U|E>>>(U>>>0)|0,ye=_,U|0)}else{if(h)return l&&(e[l>>2]=(D>>>0)%(d>>>0),e[l+4>>2]=0),_=0,U=(D>>>0)/(d>>>0)>>>0,ye=_,U|0;if(!E)return l&&(e[l>>2]=0,e[l+4>>2]=(D>>>0)%(w>>>0)),_=0,U=(D>>>0)/(w>>>0)>>>0,ye=_,U|0;if(h=w-1|0,!(h&w))return l&&(e[l>>2]=t|0,e[l+4>>2]=h&D|r&0),_=0,U=D>>>((ro(w|0)|0)>>>0),ye=_,U|0;if(h=(st(w|0)|0)-(st(D|0)|0)|0,h>>>0<=30){r=h+1|0,w=31-h|0,d=r,t=D<>>(r>>>0),r=D>>>(r>>>0),h=0,w=E<>2]=t|0,e[l+4>>2]=C|r&0,_=0,U=0,ye=_,U|0):(_=0,U=0,ye=_,U|0)}while(!1);if(!d)D=w,C=0,w=0;else{F=o|0|0,E=R|a&0,D=$0(F|0,E|0,-1,-1)|0,o=ye,C=w,w=0;do a=C,C=h>>>31|C<<1,h=w|h<<1,a=t<<1|a>>>31|0,R=t>>>31|r<<1|0,ii(D,o,a,R)|0,U=ye,_=U>>31|((U|0)<0?-1:0)<<1,w=_&1,t=ii(a,R,_&F,(((U|0)<0?-1:0)>>31|((U|0)<0?-1:0)<<1)&E)|0,r=ye,d=d-1|0;while(d|0);D=C,C=0}return d=0,l&&(e[l>>2]=t,e[l+4>>2]=r),_=(h|0)>>>31|(D|d)<<1|(d<<1|h>>>31)&0|C,U=(h<<1|0)&-2|w,ye=_,U|0}function h5(t,r,o,a,l,h,d,w){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,HS[t&15](r|0,o|0,a|0,l|0,h|0,d|0,w|0)|0}function d5(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,Pn[t&15](r|0,o|0,a|0,l|0,h|0)}function p5(t,r,o,a,l,h,d){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=+d,QS[t&3](r|0,o|0,a|0,l|0,h|0,+d)|0}function m5(t,r){t=t|0,r=r|0,Rt[t&255](r|0)}function g5(t,r,o){t=t|0,r=r|0,o=o|0,t0[t&127](r|0,o|0)}function S5(t,r,o,a,l,h,d){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,on[t&63](r|0,o|0,a|0,l|0,h|0,d|0)|0}function A5(t,r){return t=t|0,r=r|0,Et[t&127](r|0)|0}function v5(t,r,o,a,l,h,d,w,C,D,E,F){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,KS[t&3](r|0,o|0,a|0,l|0,h|0,d|0,w|0,C|0,D|0,E|0,F|0)|0}function x5(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,Yt[t&63](r|0,o|0,a|0)|0}function w5(t,r,o,a,l,h,d,w,C,D,E,F,R,_,U,H){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,R=R|0,_=_|0,U=U|0,H=H|0,YS[t&3](r|0,o|0,a|0,l|0,h|0,d|0,w|0,C|0,D|0,E|0,F|0,R|0,_|0,U|0,H|0)}function y5(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,Vi[t&15](r|0,o|0,a|0,l|0,h|0,d|0)}function C5(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,jS[t&7](r|0,o|0,a|0,l|0,h|0,d|0,w|0)}function T5(t,r,o,a,l,h,d,w,C,D,E){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,XS[t&7](r|0,o|0,a|0,l|0,h|0,d|0,w|0,C|0,D|0,E|0)}function I5(t,r,o){return t=t|0,r=r|0,o=o|0,U0[t&63](r|0,o|0)|0}function k5(t,r,o,a,l,h){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,an[t&31](r|0,o|0,a|0,l|0,h|0)|0}function E5(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,+ZS[t&3](r|0,o|0,a|0)}function D5(t){return t=t|0,JS[t&15]()|0}function b5(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,_r[t&31](r|0,o|0,a|0,l|0)|0}function F5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,Ln[t&15](r|0,o|0,a|0)}function N5(t){t=t|0,Vo[t&7]()}function R5(t,r,o,a,l,h,d,w,C){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,Ci[t&15](r|0,o|0,a|0,l|0,h|0,d|0,w|0,C|0)|0}function M5(t,r,o,a,l,h){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=+h,eA[t&7](r|0,o|0,a|0,l|0,+h)|0}function _5(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,On[t&63](r|0,o|0,a|0,l|0)}function bi(t,r,o,a,l,h,d){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,Ye(0),0}function sn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,Ye(1)}function so(t,r,o,a,l,h){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=+h,Ye(2),0}function e0(t){t=t|0,Ye(3)}function Tr(t,r){t=t|0,r=r|0,Ye(4)}function F0(t,r,o,a,l,h){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,Ye(5),0}function r0(t){return t=t|0,Ye(6),0}function P5(t){return t=t|0,Br(t|0)|0}function L5(t){return t=t|0,Gr(t|0)|0}function O5(t){return t=t|0,jo(t|0)|0}function oo(t,r,o,a,l,h,d,w,C,D,E){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,Ye(7),0}function C0(t,r,o){return t=t|0,r=r|0,o=o|0,Ye(8),0}function ao(t,r,o,a,l,h,d,w,C,D,E,F,R,_,U){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,R=R|0,_=_|0,U=U|0,Ye(9)}function Fi(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,Ye(10)}function yn(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,Ye(11)}function Cn(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,Ye(12)}function L0(t,r){return t=t|0,r=r|0,Ye(13),0}function di(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,Ye(14),0}function $5(t,r,o){return t=t|0,r=r|0,o=o|0,Ye(15),0}function Li(){return Ye(16),0}function Ki(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,Ye(17),0}function B5(t,r,o){t=t|0,r=r|0,o=o|0,Ye(18)}function V5(t,r,o){t=t|0,r=r|0,o=o|0,Qt(t|0,r|0,o|0)}function lo(){Ye(19)}function U5(){Jo()}function z5(){ei()}function G5(){Ur()}function Yi(t,r,o,a,l,h,d,w){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,Ye(20),0}function Tn(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=+l,Ye(21),0}function H0(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,Ye(22)}function q5(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,255,0),C=t+152|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+156>>2]|0)&&(e[w+12>>2]|0)==(e[t+160>>2]|0)){C=e[8900]|0,e[t+4580>>2]=C+(((e[8901]|0)-C|0)>>>1),b=D;return}for(o=t+4584|0,a=t+4588|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=512?h>>>0>512&&(d=r+512|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,512-h|0),r=e[o>>2]|0),w=t+4580|0,e[w>>2]=r+256,d=t+160|0,l=t+156|0,h=-256;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==256)break}b=D}function W5(t){t=t|0;var r=0,o=0;e[t>>2]=35660,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function H5(t){t=t|0;var r=0,o=0;if(e[t>>2]=35660,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Q5(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,U=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,U|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,U|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(U),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0)}function K5(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+128>>2]|0,e[t+136>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+176>>2]=w|0?w:e[C+4>>2]|0,e[t+180>>2]=h,e[t+184>>2]=l,t6(t),l=t+132|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+188+(h*12|0)>>2]=r,e[t+188+(h*12|0)+4>>2]=0,k[t+188+(h*12|0)+8>>1]=0,k[t+188+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4568>>2]=w,e[t+4572>>2]=0,S[t+4576>>0]=C,S[t+4577>>0]=1,S[t+4578>>0]=0,e[t+4580>>2]=w,e[t+4584>>2]=1,S[t+4588>>0]=C,S[t+4589>>0]=1,S[t+4590>>0]=0,e[t+4592>>2]=0,b=d}function Y5(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4620>>0]=l&1,r=t+156|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),j5(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function j5(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,w=t+172|0,L=(e[w>>2]|0)+4|0,(e[t+28>>2]|0)==1?C=e[t+20>>2]|0:C=1,r=ie(C<<1,L)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;e:do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(P=6),(P|0)==6&&(m=0,o=ge(67,r|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,e[re+8>>2]=o+r;;)if(S[o>>0]=0,o=(e[ce>>2]|0)+1|0,e[ce>>2]=o,r=r+-1|0,!r)break e}o=j()|0,r=e[re>>2]|0,r||le(o|0),(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),le(o|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!C)P=19;else{if(C>>>0>1073741823&&(m=0,ue(178,J|0),$=m,m=0,$&1)||(P=17),(P|0)==17&&(a=C<<2,m=0,l=ge(67,a|0)|0,$=m,m=0,!($&1))){e[J>>2]=l,P=l+(C<<2)|0,e[J+8>>2]=P,Jt(l|0,0,a|0)|0,e[ae>>2]=P,P=19;break}o=j()|0,r=e[J>>2]|0,a=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}while(!1);if((P|0)==19){D=t+8|0,r=e[D>>2]|0;e:do if((r|0)>0){if(E=t+4596|0,F=ie(C,L)|0,R=F+1|0,_=t+4600|0,U=t+160|0,H=t+168|0,K=t+164|0,G=t+156|0,$=t+88|0,d=t+4592|0,(C|0)>0)h=0;else{for(h=0;;){if(l=e[re>>2]|0,o=l+1|0,e[E>>2]=o,a=l+R|0,e[_>>2]=a,h&1?(e[E>>2]=a,e[_>>2]=o,o=1):o=R,C=e[U>>2]|0,(C|0)<=(h|0)&&(h|0)<((e[H>>2]|0)+C|0)){if(C=e[$>>2]|0,m=0,$e(e[(e[C>>2]|0)+8>>2]|0,C|0,l+(o+((e[G>>2]|0)-F))|0,e[K>>2]|0,L|0),C=m,m=0,C&1)break;r=e[D>>2]|0}if(h=h+1|0,(h|0)>=(r|0)){P=50;break e}}o=j()|0;break}t:for(;;){o=e[re>>2]|0,r=o+1|0,e[E>>2]=r,o=o+R|0,e[_>>2]=o,h&1&&(e[E>>2]=o,e[_>>2]=r,r=o),l=e[J>>2]|0,o=r,a=0;do{if(e[d>>2]=e[l+(a<<2)>>2],P=e[w>>2]|0,S[o+P>>0]=S[o+(P+-1)>>0]|0,S[(e[_>>2]|0)+-1>>0]=S[e[E>>2]>>0]|0,m=0,Ae(83,t|0,0),P=m,m=0,P&1){P=38;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[d>>2],o=(e[E>>2]|0)+L|0,e[E>>2]=o,r=e[_>>2]|0,e[_>>2]=r+L,a=a+1|0}while((a|0)<(C|0));if(P=e[U>>2]|0,(P|0)<=(h|0)&&(h|0)<((e[H>>2]|0)+P|0)&&(P=e[$>>2]|0,m=0,$e(e[(e[P>>2]|0)+8>>2]|0,P|0,r+(L+((e[G>>2]|0)-F))|0,e[K>>2]|0,L|0),P=m,m=0,P&1)){P=30;break}if(h=h+1|0,(h|0)>=(e[D>>2]|0)){P=50;break e}}if((P|0)==30){o=j()|0;break}else if((P|0)==38){o=j()|0;break}}else P=50;while(!1);do if((P|0)==50){if(m=0,ue(183,t|0),t=m,m=0,t&1){o=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),b=ne;return}while(!1);r=e[J>>2]|0,a=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(o|0),(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),le(o|0)}function X5(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0;if(R=t+4596|0,o=e[R>>2]|0,K=t+172|0,r=e[K>>2]|0,!((r|0)<=0))for(_=t+4600|0,U=t+4604|0,H=t+4592|0,w=o,h=N[o+-1>>0]|0,o=N[o>>0]|0,F=0;D=e[_>>2]|0,d=S[D+(F+-1)>>0]|0,E=d&255,l=F+1|0,a=N[w+l>>0]|0,C=e[U>>2]|0,w=o-h|0,h=h-E|0,C=((((S[C+(a-o)>>0]|0)*9|0)+(S[C+w>>0]|0)|0)*9|0)+(S[C+h>>0]|0)|0,D=D+F|0,C?(r=o-E>>31,(r^h|0)<0?r=o:r=E+((r^w|0)<0?0:w)|0,E=Z5(t,C,N[D>>0]|0,r,0)|0,S[(e[_>>2]|0)+F>>0]=E):(r=J5(t,d,D,r-F|0)|0,o=r+F|0,(o|0)!=(e[K>>2]|0)&&(E=e6(t,E,N[(e[R>>2]|0)+o>>0]|0)|0,S[(e[_>>2]|0)+o>>0]=E,E=e[H>>2]|0,e[H>>2]=(E|0)<1?0:E+-1|0,r=r+1|0),l=r+F|0,a=e[R>>2]|0,o=N[a+(l+-1)>>0]|0,a=N[a+l>>0]|0),r=e[K>>2]|0,!((r|0)<=(l|0));)w=e[R>>2]|0,h=o,o=a,F=l}function Z5(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(U=r>>31,C=(U^r)-U|0,R=t+188+(C*12|0)+10|0,o=k[R>>1]|0,F=t+188+(C*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(r=5;(o<>1]^U)-U+a|0,_=t+128|0,l=e[_>>2]|0,(o&l|0)==(o|0)?D=o:D=l&~(o>>31),o=t+112|0,(e[o>>2]|0)<8&&P0(t),l=t+108|0,a=e[l>>2]|0,h=a>>>24,d=e[2832+(r<<11)+(h<<3)+4>>2]|0,d?(e[o>>2]=(e[o>>2]|0)-d,e[l>>2]=a<>2]|0):(w=e[t+148>>2]|0,l=e[t+140>>2]|0,o=X0(t)|0,(o|0)<(w+-1-l|0)?r&&(o=(l0(t,r)|0)+(o<>31^o>>1,(((o|0)>-1?o:0-o|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),w=t+136|0,a=e[w>>2]|0,r?d=o:(a?l=0:l=(e[t+188+(C*12|0)+4>>2]<<1)+-1+(k[R>>1]|0)>>31,d=l^o),r=e[t+152>>2]|0,l=(e[F>>2]|0)+((d|0)>-1?d:0-d|0)|0,h=t+188+(C*12|0)+4|0,o=(e[h>>2]|0)+(ie(a<<1|1,d)|0)|0,a=k[R>>1]|0,(a|0)==(r|0)&&(l=l>>1,o=o>>1,a=r>>1),e[F>>2]=l,r=a+1|0,k[R>>1]=r,l=r+o|0,(l|0)>=1?(o|0)>0&&(o=o-r|0,R=k[E>>1]|0,k[E>>1]=(R<<16>>16<127&1)+(R&65535),o=(o|0)>0?0:o):(o=k[E>>1]|0,k[E>>1]=(o&65535)-(o<<16>>16>-128&1),o=(l|0)>(~a|0)?l:0-a|0),e[h>>2]=o,r=e[w>>2]|0,a=r<<1|1,l=(ie(a,(d^U)-U|0)|0)+D|0,(l|0)>=(0-r|0)?(o=e[_>>2]|0,(o+r|0)<(l|0)&&(l=l-(ie(e[t+132>>2]|0,a)|0)|0)):(l=(ie(e[t+132>>2]|0,a)|0)+l|0,o=e[_>>2]|0),(l&o|0)==(l|0)?(t=l,t=t&255,t|0):(t=o&~(l>>31),t=t&255,t|0)}function J5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4592|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}return(E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0||Jt(o|0,r|0,l|0)|0,l|0}function e6(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=r-o|0,d=t+128|0,a=t+136|0,(((h|0)>-1?h:0-h|0)|0)>(e[a>>2]|0)?(r=ie(uo(t,t+4568|0)|0,o-r>>31|1)|0,l=e[a>>2]|0,h=l<<1|1,r=(ie(r,h)|0)+o|0,(r|0)>=(0-l|0)?(a=e[d>>2]|0,(a+l|0)<(r|0)&&(r=r-(ie(e[t+132>>2]|0,h)|0)|0)):(r=(ie(e[t+132>>2]|0,h)|0)+r|0,a=e[d>>2]|0),(r&a|0)==(r|0)?(t=r,t=t&255,t|0):(t=a&~(r>>31),t=t&255,t|0)):(o=uo(t,t+4580|0)|0,h=e[a>>2]|0,l=h<<1|1,r=(ie(l,o)|0)+r|0,(r|0)>=(0-h|0)?(a=e[d>>2]|0,(a+h|0)<(r|0)&&(r=r-(ie(e[t+132>>2]|0,l)|0)|0)):(r=(ie(e[t+132>>2]|0,l)|0)+r|0,a=e[d>>2]|0),(r&a|0)==(r|0)?(t=r,t=t&255,t|0):(t=a&~(r>>31),t=t&255,t|0))}function uo(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=r+9|0,o=N[D>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;d=e[t+148>>2]|0,w=e[36476+(e[t+4592>>2]<<2)>>2]|0,o=e[t+140>>2]|0,l=X0(t)|0;do if((l|0)<(d+-2-w-o|0))if(a){w=(l0(t,a)|0)+(l<>2]|0,l=w+a|0,d=l&1,o=d,h=1,l=(d+l|0)/2|0;break}else{a=e[h>>2]|0,t=a+l|0,o=t&1,t=(o+t|0)/2|0,C=8;break}else l=(l0(t,o)|0)+1|0,d=e[h>>2]|0,t=l+d|0,o=t&1,t=(o+t|0)/2|0,a?(w=l,h=1,l=t,a=d):(a=d,C=8);while(!1);return(C|0)==8&&(w=l,h=N[r+10>>0]<<1>>>0>=(N[D>>0]|0)>>>0,l=t),l=(o|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(w+1-a>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[D>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(r=a,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[D>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=C,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0)}function t6(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+136|0;e:do if(e[F>>2]|0)r=t+144|0;else if(o=e[t+128>>2]|0,r=t+144|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+176>>2]|0))&&(e[a+8>>2]|0)==(e[t+180>>2]|0)&&(e[a+12>>2]|0)==(e[t+184>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4604>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4604>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4604>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4604>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4608|0,a=E<<1,l=t+4612|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4604|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+184|0,C=t+180|0,d=t+176|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function i6(t){t=t|0,he(t)}function n6(t){return t=t|0,50767}function r6(t,r,o){t=t|0,r=r|0,o=o|0,yi(t,50754,12)}function s6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0;U=b,b=b+16|0,H=U,e[H>>2]=0,K=H+4|0,e[K>>2]=0,e[H+8>>2]=0,R=H+8|0,m=0,l=ge(67,1)|0,F=m,m=0;e:do if(!(F&1)&&(F=l+1|0,S[l>>0]=o,e[H>>2]=l,e[K>>2]=F,e[R>>2]=F,m=0,Ae(84,H|0,r&65535|0),F=m,m=0,!(F&1))&&(m=0,Ae(84,H|0,t&65535|0),F=m,m=0,!(F&1))){if(D=a&255,l=e[K>>2]|0,o=e[R>>2]|0,l>>>0>=o>>>0){if(r=e[H>>2]|0,t=r,d=l-t+1|0,(d|0)<0){if(m=0,ue(178,H|0),F=m,m=0,F&1){_=52;break}t=e[H>>2]|0,o=e[R>>2]|0,r=t}if(C=r,l=o-C|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,o=e[K>>2]|0,w=o-C|0,l?_=12:(l=0,d=0)):(w=e[K>>2]|0,l=2147483647,o=w,w=w-C|0,_=12),(_|0)==12&&(m=0,d=ge(67,l|0)|0,F=m,m=0,F&1)){_=52;break}S[d+w>>0]=D,E=o-C|0,F=d+(w-E)|0,o0(F|0,r|0,E|0)|0,e[H>>2]=F,e[K>>2]=d+(w+1),e[R>>2]=d+l,t&&he(t)}else S[l>>0]=D,e[K>>2]=(e[K>>2]|0)+1;t:do if((a|0)>0){for(F=0;;){if(F=F+1|0,E=F&255,l=e[K>>2]|0,r=e[R>>2]|0,l>>>0>=r>>>0){if(t=e[H>>2]|0,o=t,d=l-o+1|0,(d|0)<0){if(m=0,ue(178,H|0),D=m,m=0,D&1)break;t=e[H>>2]|0,o=t,r=e[R>>2]|0}if(D=t,l=r-D|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,r=e[K>>2]|0,w=r-D|0,l?_=25:(C=0,d=0)):(w=e[K>>2]|0,l=2147483647,r=w,w=w-D|0,_=25),(_|0)==25){if(_=0,m=0,d=ge(67,l|0)|0,C=m,m=0,C&1)break;C=l}S[d+w>>0]=E,l=d+(w+1)|0,D=r-D|0,E=d+(w-D)|0,o0(E|0,t|0,D|0)|0,e[H>>2]=E,e[K>>2]=l,e[R>>2]=d+C,o&&(he(o),l=e[K>>2]|0)}else S[l>>0]=E,l=(e[K>>2]|0)+1|0,e[K>>2]=l;if(o=e[R>>2]|0,l>>>0>=o>>>0){if(r=e[H>>2]|0,t=r,d=l-t+1|0,(d|0)<0){if(m=0,ue(178,H|0),E=m,m=0,E&1)break;t=e[H>>2]|0,o=e[R>>2]|0,r=t}if(D=r,l=o-D|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,d=e[K>>2]|0,w=d-D|0,l?_=36:(C=0,o=0)):(w=e[K>>2]|0,l=2147483647,d=w,w=w-D|0,_=36),(_|0)==36){if(_=0,m=0,o=ge(67,l|0)|0,E=m,m=0,E&1)break;C=l}S[o+w>>0]=17,l=o+(w+1)|0,D=d-D|0,E=o+(w-D)|0,o0(E|0,r|0,D|0)|0,e[H>>2]=E,e[K>>2]=l,e[R>>2]=o+C,t&&(he(t),l=e[K>>2]|0)}else S[l>>0]=17,l=(e[K>>2]|0)+1|0,e[K>>2]=l;if(o=e[R>>2]|0,l>>>0>=o>>>0){if(r=e[H>>2]|0,t=r,d=l-t+1|0,(d|0)<0){if(m=0,ue(178,H|0),E=m,m=0,E&1)break;t=e[H>>2]|0,o=e[R>>2]|0,r=t}if(C=r,l=o-C|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,o=e[K>>2]|0,w=o-C|0,l?_=48:(l=0,d=0)):(w=e[K>>2]|0,l=2147483647,o=w,w=w-C|0,_=48),(_|0)==48&&(_=0,m=0,d=ge(67,l|0)|0,E=m,m=0,E&1))break;S[d+w>>0]=0,D=o-C|0,E=d+(w-D)|0,o0(E|0,r|0,D|0)|0,e[H>>2]=E,e[K>>2]=d+(w+1),e[R>>2]=d+l,t&&he(t)}else S[l>>0]=0,e[K>>2]=(e[K>>2]|0)+1;if((F|0)>=(a|0))break t}h=j()|0;break e}while(!1);if(m=0,w=ge(67,20)|0,a=m,m=0,a&1)_=52;else{e[w>>2]=36800,S[w+4>>0]=-9,t=w+8|0,e[t>>2]=0,d=w+12|0,e[d>>2]=0,o=w+16|0,e[o>>2]=0,l=e[K>>2]|0,a=e[H>>2]|0,r=l-a|0;do if((l|0)!=(a|0)){if((r|0)<0&&(m=0,ue(178,t|0),a=m,m=0,a&1)||(_=62),(_|0)==62&&(m=0,h=ge(67,r|0)|0,a=m,m=0,!(a&1))){if(e[d>>2]=h,e[t>>2]=h,e[o>>2]=h+r,l=e[H>>2]|0,o=e[K>>2]|0,(l|0)==(o|0))break;do S[h>>0]=S[l>>0]|0,h=(e[d>>2]|0)+1|0,e[d>>2]=h,l=l+1|0;while((l|0)!=(o|0));l=e[H>>2]|0;break}h=j()|0,l=e[t>>2]|0,l&&((e[d>>2]|0)!=(l|0)&&(e[d>>2]=l),he(l)),he(w);break e}while(!1);return l?((e[K>>2]|0)!=(l|0)&&(e[K>>2]=l),he(l),b=U,w|0):(b=U,w|0)}}else _=52;while(!1);return(_|0)==52&&(h=j()|0),l=e[H>>2]|0,l||le(h|0),(e[K>>2]|0)!=(l|0)&&(e[K>>2]=l),he(l),le(h|0),0}function o6(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0;K=b,b=b+32|0,_=K+28|0,$=K+16|0,H=K+4|0,U=K,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0,F=Xe(5)|0,e[$>>2]=F,R=$+8|0,e[R>>2]=F+5,S[F>>0]=74,S[F+1>>0]=70,S[F+2>>0]=73,S[F+3>>0]=70,S[F+4>>0]=0,e[P>>2]=F+5,m=0,Ae(84,$|0,e[t>>2]&65535|0),F=m,m=0;e:do if(F&1)G=43;else{if(D=e[t+4>>2]&255,r=e[P>>2]|0,a=e[R>>2]|0,r>>>0>=a>>>0){if(l=e[$>>2]|0,h=l,d=r-h+1|0,(d|0)<0){if(m=0,ue(178,$|0),F=m,m=0,F&1){G=43;break}h=e[$>>2]|0,a=e[R>>2]|0,l=h}if(C=l,r=a-C|0,r>>>0<1073741823?(r=r<<1,r=r>>>0>>0?d:r,a=e[P>>2]|0,w=a-C|0,r?G=10:(r=0,d=0)):(w=e[P>>2]|0,r=2147483647,a=w,w=w-C|0,G=10),(G|0)==10&&(m=0,d=ge(67,r|0)|0,F=m,m=0,F&1)){G=43;break}S[d+w>>0]=D,E=a-C|0,F=d+(w-E)|0,o0(F|0,l|0,E|0)|0,e[$>>2]=F,e[P>>2]=d+(w+1),e[R>>2]=d+r,h&&he(h)}else S[r>>0]=D,e[P>>2]=(e[P>>2]|0)+1;if(m=0,Ae(84,$|0,e[t+8>>2]&65535|0),F=m,m=0,!(F&1)&&(m=0,Ae(84,$|0,e[t+12>>2]&65535|0),F=m,m=0,!(F&1))){if(F=t+16|0,E=e[F>>2]&255,r=e[P>>2]|0,l=e[R>>2]|0,r>>>0>=l>>>0){if(h=e[$>>2]|0,a=h,d=r-a+1|0,(d|0)<0){if(m=0,ue(178,$|0),D=m,m=0,D&1){G=43;break}h=e[$>>2]|0,a=h,l=e[R>>2]|0}if(D=h,r=l-D|0,r>>>0<1073741823?(r=r<<1,r=r>>>0>>0?d:r,d=e[P>>2]|0,w=d-D|0,r?G=23:(C=0,l=0)):(w=e[P>>2]|0,r=2147483647,d=w,w=w-D|0,G=23),(G|0)==23)if(m=0,l=ge(67,r|0)|0,C=m,m=0,C&1){G=43;break}else C=r;S[l+w>>0]=E,r=l+(w+1)|0,D=d-D|0,E=l+(w-D)|0,o0(E|0,h|0,D|0)|0,e[$>>2]=E,e[P>>2]=r,e[R>>2]=l+C,a&&(he(a),r=e[P>>2]|0)}else S[r>>0]=E,r=(e[P>>2]|0)+1|0,e[P>>2]=r;if(E=t+20|0,D=e[E>>2]&255,a=e[R>>2]|0,r>>>0>=a>>>0){if(l=e[$>>2]|0,h=l,d=r-h+1|0,(d|0)<0){if(m=0,ue(178,$|0),C=m,m=0,C&1){G=43;break}h=e[$>>2]|0,a=e[R>>2]|0,l=h}if(C=l,r=a-C|0,r>>>0<1073741823?(r=r<<1,r=r>>>0>>0?d:r,a=e[P>>2]|0,w=a-C|0,r?G=34:(r=0,d=0)):(w=e[P>>2]|0,r=2147483647,a=w,w=w-C|0,G=34),(G|0)==34&&(m=0,d=ge(67,r|0)|0,L=m,m=0,L&1)){G=43;break}S[d+w>>0]=D,D=a-C|0,L=d+(w-D)|0,o0(L|0,l|0,D|0)|0,e[$>>2]=L,e[P>>2]=d+(w+1),e[R>>2]=d+r,h&&he(h)}else S[r>>0]=D,e[P>>2]=(e[P>>2]|0)+1;r=e[F>>2]|0;do if((r|0)>0){if(!(e[t+24>>2]|0))if(e[U>>2]=e[P>>2],L=0+(ie(r*3|0,e[E>>2]|0)|0)|0,m=0,e[_>>2]=e[U>>2],Pe(15,$|0,_|0,0,L|0)|0,L=m,m=0,L&1){G=43;break e}else break;if(a=Ct(16)|0,m=0,ve(5,H|0,50792,57),L=m,m=0,L&1)r=j()|0;else if(m=0,r=Ce(1)|0,L=m,m=0,!(L&1)&&(m=0,$e(36,a|0,1,r|0,H|0),L=m,m=0,!(L&1))?(m=0,ve(6,a|0,824,96),m=0,o=0):o=1,r=j()|0,de(H),!o){o=r;break e}It(a|0),o=r;break e}while(!1);if(m=0,w=ge(67,20)|0,L=m,m=0,L&1)G=43;else{e[w>>2]=36800,S[w+4>>0]=-32,h=w+8|0,e[h>>2]=0,d=w+12|0,e[d>>2]=0,a=w+16|0,e[a>>2]=0,r=e[P>>2]|0,L=e[$>>2]|0,l=r-L|0;do if((r|0)!=(L|0)){if((l|0)<0&&(m=0,ue(178,h|0),L=m,m=0,L&1)||(G=53),(G|0)==53&&(m=0,o=ge(67,l|0)|0,L=m,m=0,!(L&1))){if(e[d>>2]=o,e[h>>2]=o,e[a>>2]=o+l,r=e[$>>2]|0,a=e[P>>2]|0,(r|0)==(a|0))break;do S[o>>0]=S[r>>0]|0,o=(e[d>>2]|0)+1|0,e[d>>2]=o,r=r+1|0;while((r|0)!=(a|0));r=e[$>>2]|0;break}r=j()|0,o=e[h>>2]|0,o&&((e[d>>2]|0)!=(o|0)&&(e[d>>2]=o),he(o)),he(w),G=44;break e}while(!1);return r?((e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),b=K,w|0):(b=K,w|0)}}else G=43}while(!1);return(G|0)==43&&(r=j()|0,G=44),(G|0)==44&&(o=r),r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0),0}function co(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;w=b,b=b+16|0,D=w,e[D>>2]=0,E=D+4|0,e[E>>2]=0,e[D+8>>2]=0,m=0,r=ge(67,1)|0,d=m,m=0;e:do if(!(d&1)&&(d=r+1|0,S[r>>0]=1,e[D>>2]=r,e[E>>2]=d,e[D+8>>2]=d,m=0,Ae(84,D|0,e[t>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,Ae(84,D|0,e[t+4>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,Ae(84,D|0,e[t+8>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,Ae(84,D|0,e[t+12>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,Ae(84,D|0,e[t+16>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,C=ge(67,20)|0,d=m,m=0,!(d&1))){e[C>>2]=36800,S[C+4>>0]=-8,l=C+8|0,e[l>>2]=0,d=C+12|0,e[d>>2]=0,t=C+16|0,e[t>>2]=0,r=e[E>>2]|0,F=e[D>>2]|0,a=r-F|0;do if((r|0)!=(F|0)){if((a|0)<0&&(m=0,ue(178,l|0),F=m,m=0,F&1)||(h=11),(h|0)==11&&(m=0,o=ge(67,a|0)|0,F=m,m=0,!(F&1))){if(e[d>>2]=o,e[l>>2]=o,e[t>>2]=o+a,r=e[D>>2]|0,t=e[E>>2]|0,(r|0)==(t|0))break;do S[o>>0]=S[r>>0]|0,o=(e[d>>2]|0)+1|0,e[d>>2]=o,r=r+1|0;while((r|0)!=(t|0));r=e[D>>2]|0;break}o=j()|0,r=e[l>>2]|0,r&&((e[d>>2]|0)!=(r|0)&&(e[d>>2]=r),he(r)),he(C);break e}while(!1);return r?((e[E>>2]|0)!=(r|0)&&(e[E>>2]=r),he(r),b=w,C|0):(b=w,C|0)}else h=25;while(!1);return(h|0)==25&&(o=j()|0),r=e[D>>2]|0,r||le(o|0),(e[E>>2]|0)!=(r|0)&&(e[E>>2]=r),he(r),le(o|0),0}function a6(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;return h=Xe(5)|0,S[h>>0]=109,S[h+1>>0]=114,S[h+2>>0]=102,S[h+3>>0]=120,S[h+4>>0]=t,m=0,l=ge(67,20)|0,a=m,m=0,a&1&&(l=j()|0,he(h),le(l|0)),e[l>>2]=36800,S[l+4>>0]=-24,t=l+8|0,e[t>>2]=0,r=l+12|0,e[r>>2]=0,o=l+16|0,e[o>>2]=0,m=0,a=ge(67,5)|0,d=m,m=0,d&1?(d=j()|0,he(l),he(h),le(d|0),0):(e[r>>2]=a,e[t>>2]=a,e[o>>2]=a+5,S[a>>0]=109,d=(e[r>>2]|0)+1|0,e[r>>2]=d,a=h+1|0,S[d>>0]=S[a>>0]|0,d=(e[r>>2]|0)+1|0,e[r>>2]=d,a=a+1|0,S[d>>0]=S[a>>0]|0,d=(e[r>>2]|0)+1|0,e[r>>2]=d,a=a+1|0,S[d>>0]=S[a>>0]|0,d=(e[r>>2]|0)+1|0,e[r>>2]=d,S[d>>0]=S[a+1>>0]|0,e[r>>2]=(e[r>>2]|0)+1,he(h),l|0)}function l6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0;G=b,b=b+16|0,$=G,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0,H=$+8|0,m=0,l=ge(67,1)|0,U=m,m=0;e:do if(U&1)K=29;else{if(w=l+1|0,U=w,S[l>>0]=r,e[$>>2]=l,e[P>>2]=U,e[H>>2]=U,(r|0)>0){d=w,U=0;do{if(_=U+t&255,d>>>0>=w>>>0){if(l=e[$>>2]|0,C=l,d=d-C+1|0,(d|0)<0){if(m=0,ue(178,$|0),R=m,m=0,R&1){K=28;break}C=e[$>>2]|0,w=e[H>>2]|0,R=C}else R=l;if(F=R,l=w-F|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,w=e[P>>2]|0,D=w-F|0,l?K=13:(E=0,d=0)):(D=e[P>>2]|0,l=2147483647,w=D,D=D-F|0,K=13),(K|0)==13)if(K=0,m=0,d=ge(67,l|0)|0,E=m,m=0,E&1){K=28;break}else E=l;S[d+D>>0]=_,l=d+(D+1)|0,F=w-F|0,_=d+(D-F)|0,o0(_|0,R|0,F|0)|0,e[$>>2]=_,e[P>>2]=l,e[H>>2]=d+E,C&&(he(C),l=e[P>>2]|0)}else S[d>>0]=_,l=(e[P>>2]|0)+1|0,e[P>>2]=l;if(w=e[H>>2]|0,l>>>0>=w>>>0){if(C=e[$>>2]|0,d=C,D=l-d+1|0,(D|0)<0){if(m=0,ue(178,$|0),_=m,m=0,_&1){K=28;break}C=e[$>>2]|0,d=C,w=e[H>>2]|0}if(F=C,l=w-F|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?D:l,D=e[P>>2]|0,w=D-F|0,l?K=24:(l=0,E=0)):(w=e[P>>2]|0,l=2147483647,D=w,w=w-F|0,K=24),(K|0)==24&&(K=0,m=0,E=ge(67,l|0)|0,_=m,m=0,_&1)){K=28;break}S[E+w>>0]=0,R=D-F|0,_=E+(w-R)|0,o0(_|0,C|0,R|0)|0,e[$>>2]=_,e[P>>2]=E+(w+1),e[H>>2]=E+l,d&&he(d)}else S[l>>0]=0,e[P>>2]=(e[P>>2]|0)+1;U=U+1|0,d=e[P>>2]|0,w=e[H>>2]|0}while((U|0)<(r|0));if((K|0)==28){h=j()|0;break}l=o&255,d>>>0>>0?(S[d>>0]=l,d=(e[P>>2]|0)+1|0,e[P>>2]=d):K=37}else d=w,l=o&255,K=37;if((K|0)==37){if(C=e[$>>2]|0,D=C,E=d-D+1|0,(E|0)<0){if(m=0,ue(178,$|0),o=m,m=0,o&1){K=29;break}D=e[$>>2]|0,w=e[H>>2]|0,C=D}if(_=C,d=w-_|0,d>>>0<1073741823?(d=d<<1,d=d>>>0>>0?E:d,E=e[P>>2]|0,F=E-_|0,d?K=43:(R=0,w=0)):(F=e[P>>2]|0,d=2147483647,E=F,F=F-_|0,K=43),(K|0)==43)if(m=0,w=ge(67,d|0)|0,o=m,m=0,o&1){K=29;break}else R=d;S[w+F>>0]=l,d=w+(F+1)|0,t=E-_|0,o=w+(F-t)|0,o0(o|0,C|0,t|0)|0,e[$>>2]=o,e[P>>2]=d,e[H>>2]=w+R,D&&(he(D),d=e[P>>2]|0)}if(_=a&255,l=e[H>>2]|0,d>>>0>=l>>>0){if(w=e[$>>2]|0,C=w,d=d-C+1|0,(d|0)<0){if(m=0,ue(178,$|0),a=m,m=0,a&1){K=29;break}C=e[$>>2]|0,l=e[H>>2]|0,w=C}if(R=w,l=l-R|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,D=e[P>>2]|0,E=D-R|0,l?K=54:(F=0,d=0)):(E=e[P>>2]|0,l=2147483647,D=E,E=E-R|0,K=54),(K|0)==54)if(m=0,d=ge(67,l|0)|0,a=m,m=0,a&1){K=29;break}else F=l;S[d+E>>0]=_,l=d+(E+1)|0,o=D-R|0,a=d+(E-o)|0,o0(a|0,w|0,o|0)|0,e[$>>2]=a,e[P>>2]=l,e[H>>2]=d+F,C&&(he(C),l=e[P>>2]|0)}else S[d>>0]=_,l=(e[P>>2]|0)+1|0,e[P>>2]=l;if(d=e[H>>2]|0,l>>>0>=d>>>0){if(w=e[$>>2]|0,C=w,D=l-C+1|0,(D|0)<0){if(m=0,ue(178,$|0),a=m,m=0,a&1){K=29;break}C=e[$>>2]|0,d=e[H>>2]|0,w=C}if(F=w,l=d-F|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?D:l,d=e[P>>2]|0,E=d-F|0,l?K=65:(l=0,D=0)):(E=e[P>>2]|0,l=2147483647,d=E,E=E-F|0,K=65),(K|0)==65&&(m=0,D=ge(67,l|0)|0,a=m,m=0,a&1)){K=29;break}S[D+E>>0]=0,o=d-F|0,a=D+(E-o)|0,o0(a|0,w|0,o|0)|0,e[$>>2]=a,e[P>>2]=D+(E+1),e[H>>2]=D+l,C&&he(C)}else S[l>>0]=0,e[P>>2]=(e[P>>2]|0)+1;if(m=0,E=ge(67,20)|0,H=m,m=0,H&1)K=29;else{e[E>>2]=36800,S[E+4>>0]=-38,C=E+8|0,e[C>>2]=0,D=E+12|0,e[D>>2]=0,d=E+16|0,e[d>>2]=0,l=e[P>>2]|0,H=e[$>>2]|0,w=l-H|0;do if((l|0)!=(H|0)){if((w|0)<0&&(m=0,ue(178,C|0),H=m,m=0,H&1)||(K=72),(K|0)==72&&(m=0,h=ge(67,w|0)|0,H=m,m=0,!(H&1))){if(e[D>>2]=h,e[C>>2]=h,e[d>>2]=h+w,l=e[$>>2]|0,d=e[P>>2]|0,(l|0)==(d|0))break;do S[h>>0]=S[l>>0]|0,h=(e[D>>2]|0)+1|0,e[D>>2]=h,l=l+1|0;while((l|0)!=(d|0));l=e[$>>2]|0;break}h=j()|0,l=e[C>>2]|0,l&&((e[D>>2]|0)!=(l|0)&&(e[D>>2]=l),he(l)),he(E);break e}while(!1);return l?((e[P>>2]|0)!=(l|0)&&(e[P>>2]=l),he(l),b=G,E|0):(b=G,E|0)}}while(!1);return(K|0)==29&&(h=j()|0),l=e[$>>2]|0,l||le(h|0),(e[P>>2]|0)!=(l|0)&&(e[P>>2]=l),he(l),le(h|0),0}function u6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;if(F=(r&65535)>>>8&255,R=t+4|0,o=e[R>>2]|0,_=t+8|0,a=e[_>>2]|0,o>>>0>=a>>>0?(l=e[t>>2]|0,h=l,d=o-h+1|0,(d|0)<0&&(pi(t),h=e[t>>2]|0,a=e[_>>2]|0,l=h),E=l,o=a-E|0,o>>>0<1073741823?(o=o<<1,o=o>>>0>>0?d:o,d=e[R>>2]|0,a=d-E|0,o?U=8:(D=0,C=0,w=a,o=d)):(a=e[R>>2]|0,o=2147483647,d=a,a=a-E|0,U=8),(U|0)==8&&(D=o,C=Xe(o)|0,w=a,o=d),S[C+w>>0]=F,a=C+(w+1)|0,E=o-E|0,F=C+(w-E)|0,o0(F|0,l|0,E|0)|0,e[t>>2]=F,e[R>>2]=a,e[_>>2]=C+D,h&&(he(h),a=e[R>>2]|0)):(S[o>>0]=F,a=(e[R>>2]|0)+1|0,e[R>>2]=a),E=r&255,o=e[_>>2]|0,a>>>0>>0){S[a>>0]=E,e[R>>2]=(e[R>>2]|0)+1;return}l=e[t>>2]|0,h=l,a=a-h+1|0,(a|0)<0&&(pi(t),h=e[t>>2]|0,o=e[_>>2]|0,l=h),D=l,o=o-D|0,o>>>0<1073741823?(o=o<<1,o=o>>>0>>0?a:o,d=e[R>>2]|0,a=d-D|0,o?U=18:(C=0,w=0,o=d)):(a=e[R>>2]|0,o=2147483647,d=a,a=a-D|0,U=18),(U|0)==18&&(C=o,w=Xe(o)|0,o=d),S[w+a>>0]=E,r=o-D|0,U=w+(a-r)|0,o0(U|0,l|0,r|0)|0,e[t>>2]=U,e[R>>2]=w+(a+1),e[_>>2]=w+C,h&&he(h)}function c6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(l=e[t>>2]|0,U=e[r>>2]|0,_=U,C=l,F=o,D=a-F|0,(D|0)<=0)return H=U,H|0;if(R=t+8|0,r=e[R>>2]|0,H=t+4|0,E=e[H>>2]|0,h=E,(D|0)<=(r-h|0)){if(w=h-_|0,(D|0)>(w|0)){if(d=o+w|0,(d|0)==(a|0))r=E;else{h=d,r=E;do S[r>>0]=S[h>>0]|0,r=(e[H>>2]|0)+1|0,e[H>>2]=r,h=h+1|0;while((h|0)!=(a|0))}if((w|0)>0)w=r;else return H=U,H|0}else w=E,d=a;if(l=w-(l+(D-C+_))|0,r=U+l|0,r>>>0>>0){h=w;do S[h>>0]=S[r>>0]|0,r=r+1|0,h=(e[H>>2]|0)+1|0,e[H>>2]=h;while((r|0)!=(E|0))}return vn(w+(0-l)|0,U|0,l|0)|0,vn(U|0,o|0,d-F|0)|0,H=U,H|0}if(h=h-C+D|0,(h|0)<0&&(pi(t),r=e[R>>2]|0,l=e[t>>2]|0),d=l,r=r-d|0,r>>>0<1073741823?(r=r<<1,r=r>>>0>>0?h:r,h=_-d|0,r?w=15:(d=0,D=0)):(r=2147483647,h=_-d|0,w=15),(w|0)==15&&(d=r,D=Xe(r)|0),C=D+h|0,r=C,w=D+d|0,(o|0)!=(a|0)){l=o,d=C;do S[d>>0]=S[l>>0]|0,d=r+1|0,r=d,l=l+1|0;while((l|0)!=(a|0));l=e[t>>2]|0}return o=_-l|0,a=D+(h-o)|0,o0(a|0,l|0,o|0)|0,_=(e[H>>2]|0)-_|0,o=r,o0(o|0,U|0,_|0)|0,r=e[t>>2]|0,e[t>>2]=a,e[H>>2]=o+_,e[R>>2]=w,r?(he(r),H=C,H|0):(H=C,H|0)}function f6(t){t=t|0;var r=0;e[t>>2]=36800,r=e[t+8>>2]|0,r&&(t=t+12|0,(e[t>>2]|0)!=(r|0)&&(e[t>>2]=r),he(r))}function h6(t){t=t|0;var r=0,o=0;if(e[t>>2]=36800,r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function d6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;if(ui(r,-1),ui(r,S[t+4>>0]|0),l=t+12|0,a=t+8|0,t=(e[l>>2]|0)-(e[a>>2]|0)+2|0,ui(r,(t&65535)>>>8&255),ui(r,t&255),t=e[a>>2]|0,(e[l>>2]|0)!=(t|0)){o=0;do ui(r,S[t+o>>0]|0),o=o+1|0,t=e[a>>2]|0;while(o>>>0<((e[l>>2]|0)-t|0)>>>0)}}function ui(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;if(l=e[t+4>>2]|0,l)if(o=l+24|0,a=e[o>>2]|0,(a|0)==(e[l+28>>2]|0)){U0[e[(e[l>>2]|0)+52>>2]&63](l,r&255)|0;return}else{e[o>>2]=a+1,S[a>>0]=r;return}if(o=t+16|0,a=e[o>>2]|0,a>>>0<(e[t+12>>2]|0)>>>0){e[o>>2]=a+1,S[(e[t+8>>2]|0)+a>>0]=r;return}o=Ct(16)|0,m=0,a=Ce(1)|0,r=m,m=0,r&1&&(r=j()|0,It(o|0),le(r|0)),m=0,ve(7,o|0,4,a|0),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96)}function m0(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,l=(r|0)<4095?(r+128|0)/256|0:16,h=(o*3|0)+2+l|0,a=o+1|0,h=(h|0)<(a|0)|(h|0)>(r|0)?a:h,e[t+4>>2]=h,a=(l<<2|3)+(o*5|0)|0,a=(a|0)>(r|0)|(a|0)<(h|0)?h:a,e[t+8>>2]=a,o=(o*7|0)+4+(l*17|0)|0,e[t+12>>2]=(o|0)>(r|0)|(o|0)<(a|0)?a:o,e[t>>2]=r,e[t+16>>2]=64}function p6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;D=b,b=b+128|0,w=D+100|0,a=D+16|0,o=D+112|0,C=D+4|0,E=D,l=a,h=t+20|0,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));e[a+16>>2]=e[t+4>>2],h=wa(o,a,t+56|0)|0,o=e[(e[h>>2]|0)+16>>2]|0,t=t+8|0,m=0,e[w>>2]=e[t>>2],e[w+4>>2]=e[t+4>>2],e[w+8>>2]=e[t+8>>2],o=Ne(o|0,h|0,w|0)|0,t=m,m=0;do if(t&1)o=j()|0;else{if(l=r+4|0,e[C>>2]=e[l>>2],e[C+4>>2]=e[l+4>>2],e[C+8>>2]=e[l+8>>2],l=r+16|0,t=e[l>>2]|0,w=C+8|0,e[w>>2]=(e[w>>2]|0)-t,w=C+4|0,e[w>>2]=(e[w>>2]|0)+t,w=e[(e[h>>2]|0)+12>>2]|0,e[E>>2]=o,m=0,o=Pe(w|0,h|0,E|0,C|0,(S[r>>0]|0?(e[r+8>>2]|0)+t|0:0)|0)|0,C=m,m=0,C&1){if(o=j()|0,a=e[E>>2]|0,e[E>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}if(a=e[E>>2]|0,e[E>>2]=0,a&&Rt[e[(e[a>>2]|0)+4>>2]&255](a),e[r+4>>2]|0||(e[l>>2]=(e[l>>2]|0)+o),!h){b=D;return}Rt[e[(e[h>>2]|0)+4>>2]&255](h),b=D;return}while(!1);h||le(o|0),Rt[e[(e[h>>2]|0)+4>>2]&255](h),le(o|0)}function m6(t,r){t=t|0,r=r|0,e[t>>2]=e[r>>2],e[t+4>>2]=e[r+4>>2],e[t+8>>2]=e[r+8>>2],S[t+12>>0]=0,r=t+16|0,t=r+100|0;do e[r>>2]=0,r=r+4|0;while((r|0)<(t|0))}function g6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0;G=b,b=b+32|0,K=G+4|0,R=G+16|0,$=G,fo(t),_=t+16|0,l=e[t+24>>2]|0;e:do if((l+-2|0)>>>0<=14)if(U=t+40|0,o=e[U>>2]|0,o>>>0>2)o=5;else{switch(H=t+32|0,h=e[H>>2]|0,h|0){case 0:{o=1;break e}case 4:{if((o|0)==2){o=2;break e}break}case 3:break;default:if(o){o=2;break e}}if(F=t+100|0,o=t+108|0,a=e[o>>2]|0,(a|0)<1?(a=e[_>>2]|0,e[o>>2]=a,o=e[t+20>>2]|0,e[t+112>>2]=o):o=e[t+112>>2]|0,C=Qi(o|0,((o|0)<0)<<31>>31|0,a|0,((a|0)<0)<<31>>31|0)|0,w=(l+7|0)/8|0,w=Qi(C|0,ye|0,w|0,((w|0)<0)<<31>>31|0)|0,C=r+4|0,o=e[C>>2]|0,d=r+8|0,o|0&&(D=e[d>>2]|0,E=Qi(h|0,((h|0)<0)<<31>>31|0,w|0,ye|0)|0,l=ye,0<(l|0)|(l|0)==0&D>>>0>>0)&&(o=Ct(16)|0,m=0,a=Ce(1)|0,$=m,m=0,!($&1)&&(m=0,ve(7,o|0,3,a|0),$=m,m=0,!($&1))&&Qt(o|0,824,96),$=j()|0,It(o|0),le($|0)),D=t+52|0,E=t+12|0,(h|0)>0)h=0;else{b=G;return}for(;;){if(ho(t,(h|0)==0),a=va(R,_,D)|0,l=e[(e[a>>2]|0)+8>>2]|0,m=0,e[K>>2]=e[r>>2],e[K+4>>2]=e[r+4>>2],e[K+8>>2]=e[r+8>>2],l=Ne(l|0,a|0,K|0)|0,P=m,m=0,P&1){l=32;break}if(P=e[(e[a>>2]|0)+16>>2]|0,e[$>>2]=l,m=0,Me(P|0,a|0,$|0,F|0,t|0,(S[E>>0]|0)!=0|0),P=m,m=0,P&1){l=30;break}if(l=e[$>>2]|0,e[$>>2]=0,l&&Rt[e[(e[l>>2]|0)+4>>2]&255](l),o?(o=o+w|0,e[C>>2]=o,e[d>>2]=(e[d>>2]|0)-w):o=0,l=(e[U>>2]|0)==0,h=(l&1)+h|0,a&&Rt[e[(e[a>>2]|0)+4>>2]&255](a),!l){l=34;break}if((h|0)>=(e[H>>2]|0)){l=34;break}}if((l|0)==30)o=j()|0,l=e[$>>2]|0,e[$>>2]=0,l&&Rt[e[(e[l>>2]|0)+4>>2]&255](l);else if((l|0)==32)o=j()|0,a||(P=o,le(P|0));else if((l|0)==34){b=G;return}Rt[e[(e[a>>2]|0)+4>>2]&255](a),P=o,le(P|0)}else o=2;while(!1);a=Ct(16)|0,m=0,l=Ce(1)|0,P=m,m=0,!(P&1)&&(m=0,ve(7,a|0,o|0,l|0),P=m,m=0,!(P&1))&&Qt(a|0,824,96),P=j()|0,It(a|0),le(P|0)}function fo(t){t=t|0;var r=0,o=0,a=0,l=0;if((Ir(t)|0)<<24>>24!=-40&&(r=Ct(16)|0,m=0,o=Ce(1)|0,l=m,m=0,!(l&1)&&(m=0,ve(7,r|0,5,o|0),l=m,m=0,!(l&1))&&Qt(r|0,824,96),l=j()|0,It(r|0),le(l|0)),r=Ir(t)|0,r<<24>>24!=-38){for(;a=((d0(t)|0)&255)<<8,a=a|(d0(t)|0)&255,r=A6(t,r)|0,o=-2-r+a|0,!((o|0)<0);){if((o|0)>0){r=a+-2-r|0,o=0;do d0(t)|0,o=o+1|0;while((o|0)!=(r|0))}if(r=Ir(t)|0,r<<24>>24==-38){l=8;break}}(l|0)!=8&&(r=Ct(16)|0,m=0,o=Ce(1)|0,l=m,m=0,!(l&1)&&(m=0,ve(7,r|0,5,o|0),l=m,m=0,!(l&1))&&Qt(r|0,824,96),l=j()|0,It(r|0),le(l|0))}}function ho(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;r||((d0(t)|0)<<24>>24!=-1&&(r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,12,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)),(d0(t)|0)<<24>>24!=-38&&(r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,5,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0))),d0(t)|0,d0(t)|0,o=d0(t)|0,a=o&255;do if(o<<24>>24==1)d0(t)|0,o=0,l=20;else{if((a|0)==(e[t+32>>2]|0))if(r=d0(t)|0,o<<24>>24){o=0,l=20;break}else break;r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,2,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)}while(!1);if((l|0)==20)for(;d0(t)|0,o=o+1|0,r=d0(t)|0,(o|0)!=(a|0);)l=20;e[t+36>>2]=r&255,l=d0(t)|0,o=t+40|0,e[o>>2]=l&255,(l&255)>=3&&(r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,5,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)),(d0(t)|0)<<24>>24&&(r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,5,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)),a=t+28|0,!(e[a>>2]|0)&&(r=e[t+108>>2]|0,r||(r=e[t+16>>2]|0),e[o>>2]|0?o=e[t+32>>2]|0:o=1,l=ie(o,r)|0,t=ie(l,((e[t+24>>2]|0)+7|0)/8|0)|0,e[a>>2]=t)}function S6(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;if(!((o|0)<=0)){F=r+4|0,R=r+8|0,U=0;do _=d0(t)|0,a=e[F>>2]|0,l=e[R>>2]|0,a>>>0>=l>>>0?(h=e[r>>2]|0,d=h,w=a-d+1|0,(w|0)<0&&(pi(r),d=e[r>>2]|0,l=e[R>>2]|0,h=d),E=h,a=l-E|0,a>>>0<1073741823?(a=a<<1,a=a>>>0>>0?w:a,w=e[F>>2]|0,l=w-E|0,a?H=10:(D=0,C=0,a=w)):(l=e[F>>2]|0,a=2147483647,w=l,l=l-E|0,H=10),(H|0)==10&&(H=0,D=a,C=Xe(a)|0,a=w),S[C+l>>0]=_,E=a-E|0,_=C+(l-E)|0,o0(_|0,h|0,E|0)|0,e[r>>2]=_,e[F>>2]=C+(l+1),e[R>>2]=C+D,d&&he(d)):(S[a>>0]=_,e[F>>2]=(e[F>>2]|0)+1),U=U+1|0;while((U|0)!=(o|0))}}function d0(t){t=t|0;var r=0,o=0,a=0,l=0;return o=e[t>>2]|0,o?(t=o+12|0,r=e[t>>2]|0,(r|0)==(e[o+16>>2]|0)?t=Et[e[(e[o>>2]|0)+40>>2]&127](o)|0:(e[t>>2]=r+1,t=N[r>>0]|0),l=t&255,l|0):(a=t+8|0,l=e[a>>2]|0,l?(t=t+4|0,r=e[t>>2]|0,o=S[r>>0]|0,r?(e[t>>2]=r+1,e[a>>2]=l+-1,l=o,l|0):(l=o,l|0)):(t=Ct(16)|0,m=0,r=Ce(1)|0,l=m,m=0,l&1&&(l=j()|0,It(t|0),le(l|0)),m=0,ve(7,t|0,4,r|0),l=m,m=0,l&1?(l=j()|0,It(t|0),le(l|0)):Qt(t|0,824,96),0))}function Ir(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(o=b,b=b+176|0,r=o+152|0,C=o+16|0,d=o,w=d0(t)|0,a=w&255,w<<24>>24==-1){do r=d0(t)|0;while(r<<24>>24==-1);return b=o,r|0}w=C+56|0,h=C+4|0,e[C>>2]=36160,e[w>>2]=36180,m=0,Ae(62,C+56|0,h|0),l=m,m=0,l&1&&(C=j()|0,tt(w),le(C|0)),e[C+128>>2]=0,e[C+132>>2]=-1,e[C>>2]=36200,e[C+56>>2]=36220,m=0,ue(180,h|0),l=m,m=0;do if(l&1)r=j()|0;else{if(e[h>>2]=36236,l=C+36|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[C+52>>2]=16,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,m=0,Ae(63,h|0,r|0),o=m,m=0,o&1){C=j()|0,de(r),de(l),wt(h),r=C;break}de(r),e[C+((e[(e[C>>2]|0)+-12>>2]|0)+76)>>2]=48,m=0,r=Ve(28,C|0,50907,62)|0,o=m,m=0,!(o&1)&&(o=r+((e[(e[r>>2]|0)+-12>>2]|0)+4)|0,e[o>>2]=e[o>>2]&-75|8,o=r+((e[(e[r>>2]|0)+-12>>2]|0)+4)|0,e[o>>2]=e[o>>2]|16384,e[r+((e[(e[r>>2]|0)+-12>>2]|0)+12)>>2]=2,m=0,Ne(38,r|0,a|0)|0,a=m,m=0,!(a&1))&&(o=Ct(16)|0,m=0,Ae(64,d|0,h|0),a=m,m=0,a&1?r=j()|0:(m=0,r=Ce(1)|0,a=m,m=0,!(a&1)&&(m=0,$e(36,o|0,12,r|0,d|0),a=m,m=0,!(a&1))?(m=0,ve(6,o|0,824,96),m=0,t=0):t=1,r=j()|0,de(d),t||(d=r,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0))),It(o|0),d=r,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0)),d=j()|0,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0)}while(!1);return C=r,tt(w),le(C|0),0}function A6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;switch(o=b,b=b+320|0,w=o+300|0,E=o+152|0,C=o+288|0,F=o+16|0,D=o,r<<24>>24){case-9:return R=(d0(t)|0)&255,e[t+24>>2]=R,R=((d0(t)|0)&255)<<8|(d0(t)|0)&255,F=((d0(t)|0)&255)<<8|(d0(t)|0)&255,e[t+16>>2]=F,e[t+20>>2]=R,R=(d0(t)|0)&255,e[t+32>>2]=R,R=6,b=o,R|0;case-8:return R=v6(t)|0,b=o,R|0;case-24:return R=x6(t)|0,b=o,R|0;case-53:case-54:case-55:case-57:case-58:case-59:case-61:case-62:case-63:case-64:{d=E+56|0,l=E+4|0,e[E>>2]=36160,e[d>>2]=36180,m=0,Ae(62,E+56|0,l|0),F=m,m=0,F&1&&(R=j()|0,tt(d),le(R|0)),e[E+128>>2]=0,e[E+132>>2]=-1,e[E>>2]=36200,e[E+56>>2]=36220,m=0,ue(180,l|0),F=m,m=0;do if(F&1)t=j()|0;else{if(e[l>>2]=36236,h=E+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[E+52>>2]=16,e[w>>2]=0,e[w+4>>2]=0,e[w+8>>2]=0,m=0,Ae(63,l|0,w|0),F=m,m=0,F&1){t=j()|0,de(w),de(h),wt(l);break}de(w),m=0,t=Ve(28,E|0,50970,26)|0,F=m,m=0;do if(!(F&1)&&(m=0,a=Ne(38,t|0,r&255|0)|0,F=m,m=0,!(F&1))&&(m=0,Ve(28,a|0,50997,18)|0,F=m,m=0,!(F&1))){if(a=Ct(16)|0,m=0,Ae(64,C|0,l|0),F=m,m=0,F&1)t=j()|0;else if(m=0,t=Ce(1)|0,F=m,m=0,!(F&1)&&(m=0,$e(36,a|0,10,t|0,C|0),F=m,m=0,!(F&1))?(m=0,ve(6,a|0,824,96),m=0,o=0):o=1,t=j()|0,de(C),!o)break;It(a|0)}else R=20;while(!1);(R|0)==20&&(t=j()|0),e[E>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),R=t,le(R|0)}while(!1);R=t,tt(d),le(R|0)}case-25:case-32:case-2:return R=0,b=o,R|0;default:{C=F+56|0,h=F+4|0,e[F>>2]=36160,e[C>>2]=36180,m=0,Ae(62,F+56|0,h|0),E=m,m=0,E&1&&(R=j()|0,tt(C),le(R|0)),e[F+128>>2]=0,e[F+132>>2]=-1,e[F>>2]=36200,e[F+56>>2]=36220,m=0,ue(180,h|0),E=m,m=0;do if(E&1)t=j()|0;else{if(e[h>>2]=36236,d=F+36|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[F+52>>2]=16,e[w>>2]=0,e[w+4>>2]=0,e[w+8>>2]=0,m=0,Ae(63,h|0,w|0),E=m,m=0,E&1){t=j()|0,de(w),de(d),wt(h);break}de(w),m=0,t=Ve(28,F|0,51016,20)|0,E=m,m=0;do if(!(E&1)&&(m=0,l=Ne(38,t|0,r&255|0)|0,E=m,m=0,!(E&1))&&(m=0,Ve(28,l|0,51037,13)|0,E=m,m=0,!(E&1))){if(a=Ct(16)|0,m=0,Ae(64,D|0,h|0),E=m,m=0,E&1)t=j()|0;else if(m=0,t=Ce(1)|0,E=m,m=0,!(E&1)&&(m=0,$e(36,a|0,11,t|0,D|0),E=m,m=0,!(E&1))?(m=0,ve(6,a|0,824,96),m=0,o=0):o=1,t=j()|0,de(D),!o)break;It(a|0)}else R=40;while(!1);(R|0)==40&&(t=j()|0),e[F>>2]=36200,e[C>>2]=36220,e[h>>2]=36236,de(d),wt(h),tt(C),R=t,le(R|0)}while(!1);R=t,tt(C),le(R|0)}}return 0}function v6(t){t=t|0;var r=0;return(d0(t)|0)<<24>>24!=1?(t=1,t|0):(r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+52>>2]=r,r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+56>>2]=r,r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+60>>2]=r,r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+64>>2]=r,r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+68>>2]=r,t=11,t|0)}function x6(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;o=b,b=b+16|0,l=o,e[l>>2]=0,h=l+4|0,e[h>>2]=0,e[l+8>>2]=0,m=0,ve(9,t|0,l|0,4),r=m,m=0;e:do if(r&1)a=3;else{r=e[l>>2]|0;t:do if(US(r,51051,4)|0)t=4;else{if(m=0,r=ge(69,t|0)|0,d=m,m=0,d&1){a=3;break e}switch(r=r&255,r|0){case 3:case 2:case 1:case 0:{e[t+44>>2]=r,t=5,r=e[l>>2]|0;break t}case 5:case 4:{if(r=Ct(16)|0,m=0,t=Ce(1)|0,d=m,m=0,!(d&1)&&(m=0,ve(7,r|0,7,t|0),d=m,m=0,!(d&1))){m=0,ve(6,r|0,824,96),m=0,a=3;break e}t=j()|0,It(r|0);break e}default:{if(r=Ct(16)|0,m=0,t=Ce(1)|0,d=m,m=0,!(d&1)&&(m=0,ve(7,r|0,5,t|0),d=m,m=0,!(d&1))){m=0,ve(6,r|0,824,96),m=0,a=3;break e}t=j()|0,It(r|0);break e}}}while(!1);return r?((e[h>>2]|0)!=(r|0)&&(e[h>>2]=r),he(r),b=o,t|0):(b=o,t|0)}while(!1);return(a|0)==3&&(t=j()|0),r=e[l>>2]|0,r||le(t|0),(e[h>>2]|0)!=(r|0)&&(e[h>>2]=r),he(r),le(t|0),0}function w6(t){t=t|0;var r=0,o=0,a=0;a=e[(e[t>>2]|0)+-12>>2]|0,e[t+a>>2]=36200,r=t+(a+56)|0,e[r>>2]=36220,o=t+(a+4)|0,e[o>>2]=36236,de(t+(a+36)|0),wt(o),tt(r)}function y6(t){t=t|0}function C6(t){t=t|0,he(t)}function T6(t){t=t|0,S[t>>0]=0,t=t+4|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[t+20>>2]=0,e[t+24>>2]=0,e[t+28>>2]=0}function I6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;if(l=b,b=b+16|0,h=l,r=a6(r)|0,e[h>>2]=r,o=t+28|0,a=e[o>>2]|0,a>>>0<(e[t+32>>2]|0)>>>0){e[a>>2]=r,e[o>>2]=a+4,e[h>>2]=0,b=l;return}if(m=0,Ae(57,t+24|0,h|0),t=m,m=0,t&1)r=j()|0,o=e[h>>2]|0,e[h>>2]=0,o||le(r|0),Rt[e[(e[o>>2]|0)+4>>2]&255](o),le(r|0);else{if(r=e[h>>2]|0,e[h>>2]=0,!r){b=l;return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),b=l;return}}function k6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;if(a=t+4|0,e[a>>2]=e[r>>2],e[a+4>>2]=e[r+4>>2],e[a+8>>2]=e[r+8>>2],ui(t,-1),ui(t,-40),a=t+28|0,l=t+24|0,r=e[l>>2]|0,(e[a>>2]|0)==(r|0))return ui(t,-1),ui(t,-39),t=t+16|0,t=e[t>>2]|0,t|0;o=0;do h=e[r+(o<<2)>>2]|0,t0[e[(e[h>>2]|0)+8>>2]&127](h,t),o=o+1|0,r=e[l>>2]|0;while(o>>>0<(e[a>>2]|0)-r>>2>>>0);return ui(t,-1),ui(t,-39),h=t+16|0,h=e[h>>2]|0,h|0}function E6(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;F=b,b=b+48|0,w=F+32|0,l=F+12|0,C=F+8|0,E=F+4|0,R=F,a=o+36|0;do if(!(e[a>>2]|0)&&!(e[o+40>>2]|0)&&!(e[o+44>>2]|0)&&!(e[o+48>>2]|0)&&!(e[o+52>>2]|0)){if(a=e[o+8>>2]|0,(a|0)<=12){h=t+28|0,d=t+32|0;break}if(m0(l,(1<>2]|0),a=co(l)|0,e[C>>2]=a,h=t+28|0,l=e[h>>2]|0,d=t+32|0,l>>>0<(e[d>>2]|0)>>>0){e[l>>2]=a,e[h>>2]=l+4,e[C>>2]=0;break}if(m=0,Ae(57,t+24|0,C|0),w=m,m=0,!(w&1)){if(a=e[C>>2]|0,e[C>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}o=j()|0,a=e[C>>2]|0,e[C>>2]=0,a||(R=o,le(R|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),R=o,le(R|0)}else D=6;while(!1);do if((D|0)==6){if(a=co(a)|0,e[w>>2]=a,h=t+28|0,l=e[h>>2]|0,d=t+32|0,l>>>0<(e[d>>2]|0)>>>0){e[l>>2]=a,e[h>>2]=l+4,e[w>>2]=0;break}if(m=0,Ae(57,t+24|0,w|0),D=m,m=0,!(D&1)){if(a=e[w>>2]|0,e[w>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}o=j()|0,a=e[w>>2]|0,e[w>>2]=0,a||(R=o,le(R|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),R=o,le(R|0)}while(!1);a=t+20|0,l=(e[a>>2]|0)+1|0,e[a>>2]=l,a=e[o+24>>2]|0,w=a|0?e[o+16>>2]|0:1,a=l6(l,w,e[o+20>>2]|0,a)|0,e[E>>2]=a,l=e[h>>2]|0;do if(l>>>0<(e[d>>2]|0)>>>0)e[l>>2]=a,e[h>>2]=l+4,e[E>>2]=0;else{if(m=0,Ae(57,t+24|0,E|0),D=m,m=0,!(D&1)){if(a=e[E>>2]|0,e[E>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}o=j()|0,a=e[E>>2]|0,e[E>>2]=0,a||(R=o,le(R|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),R=o,le(R|0)}while(!1);C=Xe(104)|0,e[C>>2]=36820,e[C+4>>2]=w,l=C+8|0,e[l>>2]=e[r>>2],e[l+4>>2]=e[r+4>>2],e[l+8>>2]=e[r+8>>2],l=C+20|0,a=l+84|0;do e[l>>2]=e[o>>2],l=l+4|0,o=o+4|0;while((l|0)<(a|0));if(e[R>>2]=C,o=e[h>>2]|0,o>>>0<(e[d>>2]|0)>>>0){e[o>>2]=C,e[h>>2]=o+4,e[R>>2]=0,b=F;return}if(m=0,Ae(57,t+24|0,R|0),t=m,m=0,t&1)o=j()|0,a=e[R>>2]|0,e[R>>2]=0,a||(R=o,le(R|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),R=o,le(R|0);else{if(o=e[R>>2]|0,e[R>>2]=0,!o){b=F;return}Rt[e[(e[o>>2]|0)+4>>2]&255](o),b=F;return}}function D6(t,r,o,a,l,h,d,w,C,D,E){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0;var F=0,R=0,_=0,U=0,H=0,K=0,G=0;return _=b,b=b+96|0,R=_,F=ma(t,r,R,0)|0,F?(l=F,b=_,l|0):(S[R+32>>0]=0,H=e[R+8>>2]|0,G=e[R>>2]|0,K=e[R+4>>2]|0,F=ie(K,G)|0,U=e[R+16>>2]|0,F=ie(ie(F,(H|0)<9?1:2)|0,U)|0,e[a>>2]=F,F=E0(F)|0,e[o>>2]=F,e[l>>2]=G,e[h>>2]=K,e[d>>2]=H,e[w>>2]=e[R+12>>2],e[C>>2]=U,e[D>>2]=e[R+20>>2],e[E>>2]=e[R+24>>2],l=ga(F,e[a>>2]|0,t,r,0,0)|0,b=_,l|0)}function b6(t,r,o,a,l,h,d,w,C){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0;var D=0,E=0,F=0,R=0;F=b,b=b+96|0,D=F+4|0,d=F,E=D,R=E+84|0;do e[E>>2]=0,E=E+4|0;while((E|0)<(R|0));return e[D+16>>2]=h,e[D+8>>2]=l,e[D>>2]=o,e[D+4>>2]=a,o=E0(r)|0,e[w>>2]=o,e[d>>2]=0,o=pa(w,r,d,t,r,D,0)|0,e[C>>2]=e[d>>2],b=F,o|0}function Ni(t,r){t=t|0,r=r|0;var o=0;o=b,b=b+16|0,e[o>>2]=r,r=e[9320]|0,Po(r,t,o)|0,PS(10,r)|0,St()}function si(t){t=t|0,Lr(51337,51366,1164,51442)}function pi(t){t=t|0,Lr(51463,51486,303,51442)}function po(){var t=0,r=0;if(t=b,b=b+16|0,Qo(37024,4)|0)Ni(51562,t);else return r=Ho(e[9255]|0)|0,b=t,r|0;return 0}function Xe(t){t=t|0;var r=0;r=t|0?t:1,t=E0(r)|0;e:do if(!t){for(;t=L6()|0,!!t;)if(Vo[t&7](),t=E0(r)|0,t)break e;r=Ct(4)|0,e[r>>2]=36844,Qt(r|0,592,78)}while(!1);return t|0}function he(t){t=t|0,n0(t)}function F6(t){t=t|0,he(t)}function N6(t){t=t|0,e[t>>2]=36844}function R6(t){t=t|0}function M6(t){t=t|0,he(t)}function _6(t){return t=t|0,51611}function mo(t){t=t|0;var r=0;r=b,b=b+16|0,m=0,bt(t|0),t=m,m=0,t&1||(m=0,Ae(85,51626,r|0),m=0),t=j(0)|0,K0(t|0)|0,m=0,Ae(85,51666,r+8|0),m=0,t=j(0)|0,m=0,bt(3),r=m,m=0,r&1?(r=j(0)|0,$t(r)):$t(t)}function P6(){var t=0,r=0,o=0;m=0,t=Ce(2)|0,o=m,m=0,o&1&&(o=j(0)|0,$t(o)),t|0&&(r=e[t>>2]|0,(r|0)!=0)&&(o=r+48|0,(e[o>>2]&-256|0)==1126902528?(e[o+4>>2]|0)==1129074247:0)&&mo(e[r+12>>2]|0),o=e[9208]|0,e[9208]=o+0,mo(o)}function L6(){var t=0;return t=e[9214]|0,e[9214]=t+0,t|0}function wA(t){t=t|0}function In(t){t=t|0,e[t>>2]=36868,uS(t+4|0)}function O6(t){t=t|0,In(t),he(t)}function $6(t){return t=t|0,e[t+4>>2]|0}function yA(t){t=t|0}function B6(t){t=t|0,e[t>>2]=36888}function V6(t){t=t|0}function U6(t){t=t|0,he(t)}function z6(t){return t=t|0,51716}function G6(t){t=t|0}function q6(t){t=t|0}function W6(t){t=t|0}function H6(t){t=t|0,he(t)}function Q6(t){t=t|0,he(t)}function K6(t){t=t|0,he(t)}function Y6(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;if(d=b,b=b+64|0,h=d,(t|0)!=(r|0))if(r|0&&(l=So(r,656,672,0)|0,(l|0)!=0)){r=h,a=r+56|0;do e[r>>2]=0,r=r+4|0;while((r|0)<(a|0));e[h>>2]=l,e[h+8>>2]=t,e[h+12>>2]=-1,e[h+48>>2]=1,On[e[(e[l>>2]|0)+28>>2]&63](l,h,e[o>>2]|0,1),(e[h+24>>2]|0)==1?(e[o>>2]=e[h+16>>2],r=1):r=0}else r=0;else r=1;return b=d,r|0}function kr(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;t=r+16|0,l=e[t>>2]|0;do if(l){if((l|0)!=(o|0)){a=r+36|0,e[a>>2]=(e[a>>2]|0)+1,e[r+24>>2]=2,S[r+54>>0]=1;break}t=r+24|0,(e[t>>2]|0)==2&&(e[t>>2]=a)}else e[t>>2]=o,e[r+24>>2]=a,e[r+36>>2]=1;while(!1)}function j6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,(t|0)==(e[r+8>>2]|0)&&kr(0,r,o,a)}function X6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,(t|0)==(e[r+8>>2]|0)?kr(0,r,o,a):(t=e[t+8>>2]|0,On[e[(e[t>>2]|0)+28>>2]&63](t,r,o,a))}function go(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;h=e[t+4>>2]|0,l=h>>8,h&1&&(l=e[(e[o>>2]|0)+l>>2]|0),t=e[t>>2]|0,On[e[(e[t>>2]|0)+28>>2]&63](t,r,o+l|0,h&2|0?a:2)}function Z6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;e:do if((t|0)!=(e[r+8>>2]|0)){if(h=e[t+12>>2]|0,l=t+16+(h<<3)|0,go(t+16|0,r,o,a),(h|0)>1){h=r+54|0,t=t+24|0;do{if(go(t,r,o,a),S[h>>0]|0)break e;t=t+8|0}while(t>>>0>>0)}}else kr(0,r,o,a);while(!1)}function So(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;_=b,b=b+64|0,R=_,F=e[t>>2]|0,E=t+(e[F+-8>>2]|0)|0,F=e[F+-4>>2]|0,e[R>>2]=o,e[R+4>>2]=t,e[R+8>>2]=r,e[R+12>>2]=a,a=R+16|0,t=R+20|0,r=R+24|0,l=R+28|0,h=R+32|0,d=R+40|0,w=(F|0)==(o|0),C=a,D=C+36|0;do e[C>>2]=0,C=C+4|0;while((C|0)<(D|0));k[a+36>>1]=0,S[a+38>>0]=0;e:do if(w)e[R+48>>2]=1,Vi[e[(e[o>>2]|0)+20>>2]&15](o,R,E,E,1,0),a=(e[r>>2]|0)==1?E:0;else{switch(Pn[e[(e[F>>2]|0)+24>>2]&15](F,R,E,1,0),e[R+36>>2]|0){case 0:{a=(e[d>>2]|0)==1&(e[l>>2]|0)==1&(e[h>>2]|0)==1?e[t>>2]|0:0;break e}case 1:break;default:{a=0;break e}}if((e[r>>2]|0)!=1&&!((e[d>>2]|0)==0&(e[l>>2]|0)==1&(e[h>>2]|0)==1)){a=0;break}a=e[a>>2]|0}while(!1);return b=_,a|0}function Er(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,S[r+53>>0]=1;do if((e[r+4>>2]|0)==(a|0)){if(S[r+52>>0]=1,a=r+16|0,t=e[a>>2]|0,!t){if(e[a>>2]=o,e[r+24>>2]=l,e[r+36>>2]=1,!((l|0)==1&&(e[r+48>>2]|0)==1))break;S[r+54>>0]=1;break}if((t|0)!=(o|0)){l=r+36|0,e[l>>2]=(e[l>>2]|0)+1,S[r+54>>0]=1;break}t=r+24|0,a=e[t>>2]|0,(a|0)==2&&(e[t>>2]=l,a=l),(a|0)==1&&(e[r+48>>2]|0)==1&&(S[r+54>>0]=1)}while(!1)}function J6(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;e:do if((t|0)==(e[r+8>>2]|0))(e[r+4>>2]|0)==(o|0)&&(h=r+28|0,(e[h>>2]|0)!=1)&&(e[h>>2]=a);else{if((t|0)!=(e[r>>2]|0)){if(U=e[t+12>>2]|0,w=t+16+(U<<3)|0,kn(t+16|0,r,o,a,l),h=t+24|0,(U|0)<=1)break;if(d=e[t+8>>2]|0,!(d&2|0)&&(C=r+36|0,(e[C>>2]|0)!=1)){if(!(d&1)){for(d=r+54|0;;)if(S[d>>0]|0||(e[C>>2]|0)==1||(kn(h,r,o,a,l),h=h+8|0,h>>>0>=w>>>0))break e}for(d=r+24|0,t=r+54|0;;)if(S[t>>0]|0||(e[C>>2]|0)==1&&(e[d>>2]|0)==1||(kn(h,r,o,a,l),h=h+8|0,h>>>0>=w>>>0))break e}for(d=r+54|0;;)if(S[d>>0]|0||(kn(h,r,o,a,l),h=h+8|0,h>>>0>=w>>>0))break e}if((e[r+16>>2]|0)!=(o|0)&&(_=r+20|0,(e[_>>2]|0)!=(o|0))){if(e[r+32>>2]=a,E=r+44|0,(e[E>>2]|0)==4)break;d=e[t+12>>2]|0,w=t+16+(d<<3)|0,C=r+52|0,a=r+53|0,F=r+54|0,D=t+8|0,R=r+24|0;t:do if((d|0)>0)for(d=0,h=0,t=t+16|0;;){if(S[C>>0]=0,S[a>>0]=0,Dr(t,r,o,o,1,l),S[F>>0]|0){U=20;break t}do if(S[a>>0]|0){if(!(S[C>>0]|0))if(e[D>>2]&1){h=1;break}else{h=1,U=20;break t}if((e[R>>2]|0)==1)break t;if(e[D>>2]&2)d=1,h=1;else break t}while(!1);if(t=t+8|0,t>>>0>=w>>>0){U=20;break}}else d=0,h=0,U=20;while(!1);do if((U|0)==20){if(!d&&(e[_>>2]=o,o=r+40|0,e[o>>2]=(e[o>>2]|0)+1,(e[r+36>>2]|0)==1)&&(e[R>>2]|0)==2){if(S[F>>0]=1,h)break}else U=24;if((U|0)==24&&h)break;e[E>>2]=4;break e}while(!1);e[E>>2]=3;break}(a|0)==1&&(e[r+32>>2]=1)}while(!1)}function Dr(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;w=e[t+4>>2]|0,d=w>>8,w&1&&(d=e[(e[a>>2]|0)+d>>2]|0),t=e[t>>2]|0,Vi[e[(e[t>>2]|0)+20>>2]&15](t,r,o,a+d|0,w&2|0?l:2,h)}function kn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;d=e[t+4>>2]|0,h=d>>8,d&1&&(h=e[(e[o>>2]|0)+h>>2]|0),t=e[t>>2]|0,Pn[e[(e[t>>2]|0)+24>>2]&15](t,r,o+h|0,d&2|0?a:2,l)}function eS(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0;e:do if((t|0)==(e[r+8>>2]|0))(e[r+4>>2]|0)==(o|0)&&(h=r+28|0,(e[h>>2]|0)!=1)&&(e[h>>2]=a);else{if((t|0)!=(e[r>>2]|0)){w=e[t+8>>2]|0,Pn[e[(e[w>>2]|0)+24>>2]&15](w,r,o,a,l);break}if((e[r+16>>2]|0)!=(o|0)&&(d=r+20|0,(e[d>>2]|0)!=(o|0))){if(e[r+32>>2]=a,a=r+44|0,(e[a>>2]|0)==4)break;h=r+52|0,S[h>>0]=0,C=r+53|0,S[C>>0]=0,t=e[t+8>>2]|0,Vi[e[(e[t>>2]|0)+20>>2]&15](t,r,o,o,1,l),S[C>>0]|0?S[h>>0]|0||(h=1,w=13):(h=0,w=13);do if((w|0)==13){if(e[d>>2]=o,C=r+40|0,e[C>>2]=(e[C>>2]|0)+1,(e[r+36>>2]|0)==1&&(e[r+24>>2]|0)==2){if(S[r+54>>0]=1,h)break}else w=16;if((w|0)==16&&h)break;e[a>>2]=4;break e}while(!1);e[a>>2]=3;break}(a|0)==1&&(e[r+32>>2]=1)}while(!1)}function tS(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;do if((t|0)==(e[r+8>>2]|0))(e[r+4>>2]|0)==(o|0)&&(d=r+28|0,(e[d>>2]|0)!=1)&&(e[d>>2]=a);else if((t|0)==(e[r>>2]|0)){if((e[r+16>>2]|0)!=(o|0)&&(h=r+20|0,(e[h>>2]|0)!=(o|0))){e[r+32>>2]=a,e[h>>2]=o,l=r+40|0,e[l>>2]=(e[l>>2]|0)+1,(e[r+36>>2]|0)==1&&(e[r+24>>2]|0)==2&&(S[r+54>>0]=1),e[r+44>>2]=4;break}(a|0)==1&&(e[r+32>>2]=1)}while(!1)}function iS(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if((t|0)==(e[r+8>>2]|0))Er(0,r,o,a,l);else{E=r+52|0,F=S[E>>0]|0,R=r+53|0,_=S[R>>0]|0,D=e[t+12>>2]|0,d=t+16+(D<<3)|0,S[E>>0]=0,S[R>>0]=0,Dr(t+16|0,r,o,a,l,h);e:do if((D|0)>1){w=r+24|0,C=t+8|0,D=r+54|0,t=t+24|0;do{if(S[D>>0]|0)break e;if(S[E>>0]|0){if((e[w>>2]|0)==1||!(e[C>>2]&2))break e}else if(S[R>>0]|0&&!(e[C>>2]&1|0))break e;S[E>>0]=0,S[R>>0]=0,Dr(t,r,o,a,l,h),t=t+8|0}while(t>>>0>>0)}while(!1);S[E>>0]=F,S[R>>0]=_}}function nS(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,(t|0)==(e[r+8>>2]|0)?Er(0,r,o,a,l):(t=e[t+8>>2]|0,Vi[e[(e[t>>2]|0)+20>>2]&15](t,r,o,a,l,h))}function rS(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,(t|0)==(e[r+8>>2]|0)&&Er(0,r,o,a,l)}function sS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return l=b,b=b+16|0,a=l,e[a>>2]=e[o>>2],t=Yt[e[(e[t>>2]|0)+16>>2]&63](t,r,a)|0,t&&(e[o>>2]=e[a>>2]),b=l,t&1|0}function oS(t){return t=t|0,t?t=(So(t,656,704,0)|0)!=0:t=0,t&1|0}function En(){var t=0;t=Ct(4)|0,N6(t),Qt(t|0,592,78)}function aS(){var t=0,r=0,o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+48|0,d=l+32|0,o=l+24|0,w=l+16|0,h=l,l=l+36|0,t=po()|0,t|0&&(a=e[t>>2]|0,(a|0)!=0)&&(t=a+48|0,r=e[t>>2]|0,t=e[t+4>>2]|0,(r&-256|0)==1126902528&(t|0)==1129074247||(e[o>>2]=e[9257],Ni(51919,o)),(r|0)==1126902529&(t|0)==1129074247?t=e[a+44>>2]|0:t=a+80|0,e[l>>2]=t,a=e[a>>2]|0,t=e[a+4>>2]|0,Yt[e[(e[152]|0)+16>>2]&63](608,a,l)|0?(w=e[l>>2]|0,l=e[9257]|0,w=Et[e[(e[w>>2]|0)+8>>2]&127](w)|0,e[h>>2]=l,e[h+4>>2]=t,e[h+8>>2]=w,Ni(51833,h)):(e[w>>2]=e[9257],e[w+4>>2]=t,Ni(51878,w))),Ni(51957,d)}function lS(){var t=0;if(t=b,b=b+16|0,ni(37020,184)|0)Ni(51730,t);else{b=t;return}}function uS(t){t=t|0;var r=0,o=0;o=(e[t>>2]|0)+-4|0,r=e[o>>2]|0,e[o>>2]=r+-1,(r+-1|0)<0&&he((e[t>>2]|0)+-12|0)}function cS(t){t=t|0;var r=0;if(r=b,b=b+16|0,n0(t),Xo(e[9255]|0,0)|0)Ni(51780,r);else{b=r;return}}function Dn(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,t=$S(t,r,o)|0,t|0}function Ao(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,t=BS(t,r,o)|0,t|0}function fS(){return 37296}function hS(){return 37300}function dS(){return 37304}function ji(t){return t=t|0,((t|0)==32|(t+-9|0)>>>0<5)&1|0}function pS(t){return t=t|0,(t+-48|0)>>>0<10?t=1:t=((t|32)+-97|0)>>>0<6,t&1|0}function S0(){var t=0;return e[9258]|0?(t=($r()|0)+60|0,t=e[t>>2]|0):t=37308,t|0}function vo(t){t=t|0;var r=0,o=0;for(r=0;;){if((N[51978+r>>0]|0)==(t|0)){o=2;break}if(r=r+1|0,(r|0)==87){r=87,t=52066,o=5;break}}if((o|0)==2&&(r?(t=52066,o=5):t=52066),(o|0)==5)for(;;){for(o=t;t=o+1|0,S[o>>0]|0;)o=t;if(r=r+-1|0,r)o=5;else break}return t|0}function xo(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0;switch(jt=b,b=b+512|0,Ee=jt,r|0){case 0:{it=24,Te=-149,L=4;break}case 1:{it=53,Te=-1074,L=4;break}case 2:{it=53,Te=-1074,L=4;break}default:a=0}e:do if((L|0)==4){ae=t+4|0,ne=t+100|0;do r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0;while(ji(r)|0);t:do switch(r|0){case 43:case 45:if(l=1-(((r|0)==45&1)<<1)|0,r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=r+1,r=N[r>>0]|0,ke=l;break t}else{r=u0(t)|0,ke=l;break t}default:ke=1}while(!1);l=r,r=0;do{if((l|32|0)!=(S[53870+r>>0]|0))break;do if(r>>>0<7)if(l=e[ae>>2]|0,l>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=l+1,l=N[l>>0]|0;break}else{l=u0(t)|0;break}while(!1);r=r+1|0}while(r>>>0<8);t:do switch(r|0){case 8:break;case 3:{L=23;break}default:{if(d=(o|0)!=0,d&r>>>0>3){if((r|0)==8)break t;L=23;break t}i:do if(!r){r=0;do{if((l|32|0)!=(S[56747+r>>0]|0))break i;do if(r>>>0<2)if(l=e[ae>>2]|0,l>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=l+1,l=N[l>>0]|0;break}else{l=u0(t)|0;break}while(!1);r=r+1|0}while(r>>>0<3)}while(!1);switch(r|0){case 3:{if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|0)==40)r=1;else{if(!(e[ne>>2]|0)){a=fe;break e}e[ae>>2]=(e[ae>>2]|0)+-1,a=fe;break e}for(;l=e[ae>>2]|0,l>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=l+1,l=N[l>>0]|0):l=u0(t)|0,!(!((l+-48|0)>>>0<10|(l+-65|0)>>>0<26)&&!((l|0)==95|(l+-97|0)>>>0<26));)r=r+1|0;if((l|0)==41){a=fe;break e}if(l=(e[ne>>2]|0)==0,l||(e[ae>>2]=(e[ae>>2]|0)+-1),!d){it=S0()|0,e[it>>2]=22,oi(t,0),a=0;break e}if(!r){a=fe;break e}for(;;)if(r=r+-1|0,l||(e[ae>>2]=(e[ae>>2]|0)+-1),!r){a=fe;break e}}case 0:{do if((l|0)==48){if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|32|0)!=120){if(!(e[ne>>2]|0)){r=48;break}e[ae>>2]=(e[ae>>2]|0)+-1,r=48;break}r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0,d=0):(r=u0(t)|0,d=0);i:for(;;){switch(r|0){case 46:{L=74;break i}case 48:break;default:{$=0,w=0,G=0,l=0,D=d,E=0,K=0,C=1,d=0,a=0;break i}}if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=r+1,r=N[r>>0]|0,d=1;continue}else{r=u0(t)|0,d=1;continue}}if((L|0)==74)if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|0)==48){d=0,l=0;do r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,d=$0(d|0,l|0,-1,-1)|0,l=ye;while((r|0)==48);$=0,w=0,G=d,D=1,E=1,K=0,C=1,d=0,a=0}else $=0,w=0,G=0,l=0,D=d,E=1,K=0,C=1,d=0,a=0;for(;;){if(U=r+-48|0,F=r|32,U>>>0>=10){if(H=(r|0)==46,!(H|(F+-97|0)>>>0<6)){F=G,U=$;break}if(H)if(!E)H=w,l=$,U=$,E=1,F=K,h=C;else{F=G,U=$,r=46;break}else L=86}else L=86;if((L|0)==86){L=0,r=(r|0)>57?F+-87|0:U;do if(($|0)<0|($|0)==0&w>>>0<8)F=K,h=C,d=r+(d<<4)|0;else{if(($|0)<0|($|0)==0&w>>>0<14){_=C*.0625,F=K,h=_,a=a+_*+(r|0);break}(K|0)!=0|(r|0)==0?(F=K,h=C):(F=1,h=C,a=a+C*.5)}while(!1);w=$0(w|0,$|0,1,0)|0,H=G,U=ye,D=1}if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=r+1,$=U,G=H,r=N[r>>0]|0,K=F,C=h;continue}else{$=U,G=H,r=u0(t)|0,K=F,C=h;continue}}if(!D){r=(e[ne>>2]|0)==0,r||(e[ae>>2]=(e[ae>>2]|0)+-1),o?!r&&(P=e[ae>>2]|0,e[ae>>2]=P+-1,(E|0)!=0)&&(e[ae>>2]=P+-2):oi(t,0),a=+(ke|0)*0;break e}if(D=(E|0)==0,E=D?w:F,D=D?U:l,(U|0)<0|(U|0)==0&w>>>0<8){l=U;do d=d<<4,w=$0(w|0,l|0,1,0)|0,l=ye;while((l|0)<0|(l|0)==0&w>>>0<8)}if((r|32|0)==112){if(l=Bo(t,o)|0,r=ye,(l|0)==0&(r|0)==-2147483648){if(!o){oi(t,0),a=0;break e}e[ne>>2]|0?(e[ae>>2]=(e[ae>>2]|0)+-1,l=0,r=0):(l=0,r=0)}}else e[ne>>2]|0?(e[ae>>2]=(e[ae>>2]|0)+-1,l=0,r=0):(l=0,r=0);if(Ee=v0(E|0,D|0,2)|0,Ee=$0(Ee|0,ye|0,-32,-1)|0,r=$0(Ee|0,ye|0,l|0,r|0)|0,l=ye,!d){a=+(ke|0)*0;break e}if((l|0)>0|(l|0)==0&r>>>0>(0-Te|0)>>>0){it=S0()|0,e[it>>2]=34,a=+(ke|0)*17976931348623157e292*17976931348623157e292;break e}if(Ee=Te+-106|0,ce=((Ee|0)<0)<<31>>31,(l|0)<(ce|0)|(l|0)==(ce|0)&r>>>0>>0){it=S0()|0,e[it>>2]=34,a=+(ke|0)*22250738585072014e-324*22250738585072014e-324;break e}if((d|0)>-1){do ce=!(a>=.5),Ee=ce&1|d<<1,d=Ee^1,a=a+(ce?a:a+-1),r=$0(r|0,l|0,-1,-1)|0,l=ye;while((Ee|0)>-1);w=r,C=a}else w=r,C=a;r=ii(32,0,Te|0,((Te|0)<0)<<31>>31|0)|0,r=$0(w|0,l|0,r|0,ye|0)|0,Te=ye,0>(Te|0)|(Te|0)==0&it>>>0>r>>>0?(r|0)<0?(r=0,L=127):L=125:(r=it,L=125),(L|0)==125&&((r|0)<53?L=127:(l=r,h=+(ke|0),a=0)),(L|0)==127&&(a=+(ke|0),l=r,h=a,a=+Co(+bn(1,84-r|0),a)),it=(d&1|0)==0&(C!=0&(l|0)<32),a=h*(it?0:C)+(a+h*+(((it&1)+d|0)>>>0))-a,a==0&&(it=S0()|0,e[it>>2]=34),a=+ko(a,w);break e}else r=l;while(!1);re=Te+it|0,ce=0-re|0,d=0;i:for(;;){switch(r|0){case 46:{L=138;break i}case 48:break;default:{l=0,F=0,E=0;break i}}if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=r+1,r=N[r>>0]|0,d=1;continue}else{r=u0(t)|0,d=1;continue}}if((L|0)==138)if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|0)==48)for(l=0,r=0;;)if(l=$0(l|0,r|0,-1,-1)|0,d=ye,r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|0)==48)r=d;else{F=d,d=1,E=1;break}else l=0,F=0,E=1;e[Ee>>2]=0,D=r+-48|0,w=(r|0)==46;i:do if(w|D>>>0<10){J=Ee+496|0,$=0,H=0,K=w,L=F,U=d,P=E,d=0,w=0,E=0;n:for(;;){do if(K)if(!P)l=$,F=H,P=1;else{F=L,r=$,D=H;break n}else{if(K=$0($|0,H|0,1,0)|0,H=ye,G=(r|0)!=48,(w|0)>=125){if(!G){F=L,$=K;break}e[J>>2]=e[J>>2]|1,F=L,$=K;break}F=Ee+(w<<2)|0,d&&(D=r+-48+((e[F>>2]|0)*10|0)|0),e[F>>2]=D,d=d+1|0,D=(d|0)==9,F=L,$=K,U=1,d=D?0:d,w=(D&1)+w|0,E=G?K:E}while(!1);if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,D=r+-48|0,K=(r|0)==46,K|D>>>0<10)L=F;else{D=P,L=161;break i}}U=(U|0)!=0,L=169}else $=0,H=0,U=d,D=E,d=0,w=0,E=0,L=161;while(!1);do if((L|0)==161){if(J=(D|0)==0,l=J?$:l,F=J?H:F,U=(U|0)!=0,!((r|32|0)==101&U))if((r|0)>-1){r=$,D=H,L=169;break}else{r=$,D=H,L=171;break}if(D=Bo(t,o)|0,r=ye,(D|0)==0&(r|0)==-2147483648){if(!o){oi(t,0),a=0;break}e[ne>>2]|0?(e[ae>>2]=(e[ae>>2]|0)+-1,D=0,r=0):(D=0,r=0)}l=$0(D|0,r|0,l|0,F|0)|0,U=$,F=ye,D=H,L=173}while(!1);(L|0)==169&&(e[ne>>2]|0?(e[ae>>2]=(e[ae>>2]|0)+-1,U?(U=r,L=173):L=172):L=171),(L|0)==171&&(U?(U=r,L=173):L=172);do if((L|0)==172)it=S0()|0,e[it>>2]=22,oi(t,0),a=0;else if((L|0)==173){if(r=e[Ee>>2]|0,!r){a=+(ke|0)*0;break}if(((D|0)<0|(D|0)==0&U>>>0<10)&((l|0)==(U|0)&(F|0)==(D|0))&&it>>>0>30|(r>>>it|0)==0){a=+(ke|0)*+(r>>>0);break}if(t=(Te|0)/-2|0,ae=((t|0)<0)<<31>>31,(F|0)>(ae|0)|(F|0)==(ae|0)&l>>>0>t>>>0){it=S0()|0,e[it>>2]=34,a=+(ke|0)*17976931348623157e292*17976931348623157e292;break}if(t=Te+-106|0,ae=((t|0)<0)<<31>>31,(F|0)<(ae|0)|(F|0)==(ae|0)&l>>>0>>0){it=S0()|0,e[it>>2]=34,a=+(ke|0)*22250738585072014e-324*22250738585072014e-324;break}if(d){if((d|0)<9){D=Ee+(w<<2)|0,r=e[D>>2]|0;do r=r*10|0,d=d+1|0;while((d|0)!=9);e[D>>2]=r}w=w+1|0}if((E|0)<9&&(E|0)<=(l|0)&(l|0)<18){if((l|0)==9){a=+(ke|0)*+((e[Ee>>2]|0)>>>0);break}if((l|0)<9){a=+(ke|0)*+((e[Ee>>2]|0)>>>0)/+(e[37312+(8-l<<2)>>2]|0);break}if(t=it+27+(ie(l,-3)|0)|0,r=e[Ee>>2]|0,(t|0)>30|(r>>>t|0)==0){a=+(ke|0)*+(r>>>0)*+(e[37312+(l+-10<<2)>>2]|0);break}}if(r=(l|0)%9|0,!r)d=0,r=0;else{if(U=(l|0)>-1?r:r+9|0,D=e[37312+(8-U<<2)>>2]|0,w){E=1e9/(D|0)|0,d=0,r=0,F=0;do ne=Ee+(F<<2)|0,ae=e[ne>>2]|0,t=((ae>>>0)/(D>>>0)|0)+r|0,e[ne>>2]=t,r=ie((ae>>>0)%(D>>>0)|0,E)|0,t=(F|0)==(d|0)&(t|0)==0,F=F+1|0,l=t?l+-9|0:l,d=t?F&127:d;while((F|0)!=(w|0));r&&(e[Ee+(w<<2)>>2]=r,w=w+1|0)}else d=0,w=0;r=0,l=9-U+l|0}i:for(;;){H=(l|0)<18,K=(l|0)==18,G=Ee+(d<<2)|0;do{if(!H){if(!K)break i;if((e[G>>2]|0)>>>0>=9007199){l=18;break i}}for(D=0,E=w+127|0;U=E&127,F=Ee+(U<<2)|0,E=v0(e[F>>2]|0,0,29)|0,E=$0(E|0,ye|0,D|0,0)|0,D=ye,D>>>0>0|(D|0)==0&E>>>0>1e9?(t=xn(E|0,D|0,1e9,0)|0,E=Cr(E|0,D|0,1e9,0)|0,D=t):D=0,e[F>>2]=E,t=(U|0)==(d|0),w=(U|0)!=(w+127&127|0)|t||E|0?w:U,!t;)E=U+-1|0;r=r+-29|0}while(!(D|0));d=d+127&127,(d|0)==(w|0)&&(t=w+127&127,w=Ee+((w+126&127)<<2)|0,e[w>>2]=e[w>>2]|e[Ee+(t<<2)>>2],w=t),e[Ee+(d<<2)>>2]=D,l=l+9|0}i:for(;;){for($=w+1&127,G=Ee+((w+127&127)<<2)|0;;){for(H=(l|0)==18,K=(l|0)>27?9:1,U=H^1;;){E=d&127,F=(E|0)==(w|0);do if(F)L=219;else{if(D=e[Ee+(E<<2)>>2]|0,D>>>0<9007199){L=219;break}if(D>>>0>9007199)break;if(D=d+1&127,(D|0)==(w|0)){L=219;break}if(D=e[Ee+(D<<2)>>2]|0,D>>>0<254740991){L=219;break}if(!(D>>>0>254740991|U)){l=E;break i}}while(!1);if((L|0)==219&&(L=0,H)){L=220;break i}if(r=r+K|0,(d|0)==(w|0))d=w;else break}for(U=(1<>>K,E=d,D=0,F=d;ae=Ee+(F<<2)|0,t=e[ae>>2]|0,d=(t>>>K)+D|0,e[ae>>2]=d,D=ie(t&U,H)|0,d=(F|0)==(E|0)&(d|0)==0,F=F+1&127,l=d?l+-9|0:l,d=d?F:E,(F|0)!=(w|0);)E=d;if(D){if(($|0)!=(d|0))break;e[G>>2]=e[G>>2]|1}}e[Ee+(w<<2)>>2]=D,w=$}(L|0)==220&&(F?(e[Ee+($+-1<<2)>>2]=0,l=w,w=$):l=E),a=+((e[Ee+(l<<2)>>2]|0)>>>0),l=d+1&127,(l|0)==(w|0)&&(w=d+2&127,e[Ee+(w+-1<<2)>>2]=0),_=+(ke|0),h=_*(a*1e9+ +((e[Ee+(l<<2)>>2]|0)>>>0)),H=r+53|0,F=H-Te|0,U=(F|0)<(it|0),l=U&1,E=U?(F|0)<0?0:F:it,(E|0)<53?(Gt=+Co(+bn(1,105-E|0),h),C=+To(h,+bn(1,53-E|0)),R=Gt,a=C,C=Gt+(h-C)):(R=0,a=0,C=h),D=d+2&127;do if((D|0)==(w|0))h=a;else{D=e[Ee+(D<<2)>>2]|0;do if(D>>>0>=5e8){if(D>>>0>5e8){a=_*.75+a;break}if((d+3&127|0)==(w|0)){a=_*.5+a;break}else{a=_*.75+a;break}}else{if(!(D|0)&&(d+3&127|0)==(w|0))break;a=_*.25+a}while(!1);if((53-E|0)<=1){h=a;break}if(+To(a,1)!=0){h=a;break}h=a+1}while(!1);a=C+h-R;do if((H&2147483647|0)>(-2-re|0)){if(+Ie(+a)>=9007199254740992&&(l=U&(E|0)==(F|0)?0:l,r=r+1|0,a=a*.5),(r+50|0)<=(ce|0)&&!(h!=0&(l|0)!=0))break;it=S0()|0,e[it>>2]=34}while(!1);a=+ko(a,r)}while(!1);break e}default:{e[ne>>2]|0&&(e[ae>>2]=(e[ae>>2]|0)+-1),it=S0()|0,e[it>>2]=22,oi(t,0),a=0;break e}}}}while(!1);if((L|0)==23&&(l=(e[ne>>2]|0)==0,l||(e[ae>>2]=(e[ae>>2]|0)+-1),(o|0)!=0&r>>>0>3))do l||(e[ae>>2]=(e[ae>>2]|0)+-1),r=r+-1|0;while(r>>>0>3);a=+(ke|0)*me}while(!1);return b=jt,+a}function wo(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;e:do if(r>>>0>36)l=S0()|0,e[l>>2]=22,l=0,a=0;else{U=t+4|0,_=t+100|0;do h=e[U>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0;while(ji(h)|0);t:do switch(h|0){case 43:case 45:if(d=((h|0)==45)<<31>>31,h=e[U>>2]|0,h>>>0<(e[_>>2]|0)>>>0){e[U>>2]=h+1,h=N[h>>0]|0,R=d;break t}else{h=u0(t)|0,R=d;break t}default:R=0}while(!1);d=(r|0)==0;do if((r&-17|0)==0&(h|0)==48){if(h=e[U>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,(h|32|0)!=120)if(d){r=8,E=46;break}else{E=32;break}if(r=e[U>>2]|0,r>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=r+1,h=N[r>>0]|0):h=u0(t)|0,(N[53879+(h+1)>>0]|0)>15){if(a=(e[_>>2]|0)==0,a||(e[U>>2]=(e[U>>2]|0)+-1),!o){oi(t,0),l=0,a=0;break e}if(a){l=0,a=0;break e}e[U>>2]=(e[U>>2]|0)+-1,l=0,a=0;break e}else r=16,E=46}else if(r=d?10:r,(N[53879+(h+1)>>0]|0)>>>0>>0)E=32;else{e[_>>2]|0&&(e[U>>2]=(e[U>>2]|0)+-1),oi(t,0),l=S0()|0,e[l>>2]=22,l=0,a=0;break e}while(!1);if((E|0)==32)if((r|0)==10){if(r=h+-48|0,r>>>0<10){for(h=0;;)if(d=(h*10|0)+r|0,r=e[U>>2]|0,r>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=r+1,h=N[r>>0]|0):h=u0(t)|0,r=h+-48|0,r>>>0<10&d>>>0<429496729)h=d;else{r=d;break}d=0}else r=0,d=0;if(o=h+-48|0,o>>>0<10){for(;;){if(w=Qi(r|0,d|0,10,0)|0,C=ye,D=((o|0)<0)<<31>>31,F=~D,C>>>0>F>>>0|(C|0)==(F|0)&w>>>0>~o>>>0){w=r;break}if(r=$0(w|0,C|0,o|0,D|0)|0,d=ye,h=e[U>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,o=h+-48|0,!(o>>>0<10&(d>>>0<429496729|(d|0)==429496729&r>>>0<2576980378))){w=r;break}}o>>>0>9?(h=w,r=R):(r=10,E=72)}else h=r,r=R}else E=46;t:do if((E|0)==46){if(!(r+-1&r)){if(E=S[54136+((r*23|0)>>>5&7)>>0]|0,d=S[53879+(h+1)>>0]|0,o=d&255,o>>>0>>0){for(h=0;w=o|h<>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,d=S[53879+(h+1)>>0]|0,o=d&255,w>>>0<134217728&o>>>0>>0;)h=w;o=0}else o=0,w=0;if(C=Di(-1,-1,E|0)|0,D=ye,(d&255)>>>0>=r>>>0|(o>>>0>D>>>0|(o|0)==(D|0)&w>>>0>C>>>0)){d=o,E=72;break}else h=o;for(;;)if(w=v0(w|0,h|0,E|0)|0,o=ye,w=d&255|w,h=e[U>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,d=S[53879+(h+1)>>0]|0,(d&255)>>>0>=r>>>0|(o>>>0>D>>>0|(o|0)==(D|0)&w>>>0>C>>>0)){d=o,E=72;break t}else h=o}if(d=S[53879+(h+1)>>0]|0,o=d&255,o>>>0>>0){for(h=0;w=o+(ie(h,r)|0)|0,h=e[U>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,d=S[53879+(h+1)>>0]|0,o=d&255,w>>>0<119304647&o>>>0>>0;)h=w;o=0}else w=0,o=0;if((d&255)>>>0>>0)for(E=xn(-1,-1,r|0,0)|0,F=ye,D=o;;){if(D>>>0>F>>>0|(D|0)==(F|0)&w>>>0>E>>>0){d=D,E=72;break t}if(o=Qi(w|0,D|0,r|0,0)|0,C=ye,d=d&255,C>>>0>4294967295|(C|0)==-1&o>>>0>~d>>>0){d=D,E=72;break t}if(w=$0(d|0,0,o|0,C|0)|0,o=ye,h=e[U>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,d=S[53879+(h+1)>>0]|0,(d&255)>>>0>=r>>>0){d=o,E=72;break}else D=o}else d=o,E=72}while(!1);if((E|0)==72)if((N[53879+(h+1)>>0]|0)>>>0>>0){do h=e[U>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[U>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0;while((N[53879+(h+1)>>0]|0)>>>0>>0);d=S0()|0,e[d>>2]=34,d=l,h=a,r=(a&1|0)==0&!0?R:0}else h=w,r=R;if(e[_>>2]|0&&(e[U>>2]=(e[U>>2]|0)+-1),!(d>>>0>>0|(d|0)==(l|0)&h>>>0>>0)){if(!((a&1|0)!=0|!1|(r|0)!=0)){U=S0()|0,e[U>>2]=34,a=$0(a|0,l|0,-1,-1)|0,l=ye;break}if(d>>>0>l>>>0|(d|0)==(l|0)&h>>>0>a>>>0){U=S0()|0,e[U>>2]=34;break}}a=((r|0)<0)<<31>>31,a=ii(h^r|0,d^a|0,r|0,a|0)|0,l=ye}while(!1);return ye=l,a|0}function oi(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;e[t+104>>2]=r,o=e[t+4>>2]|0,a=e[t+8>>2]|0,l=a-o|0,e[t+108>>2]=l,(r|0)!=0&(l|0)>(r|0)?e[t+100>>2]=o+r:e[t+100>>2]=a}function u0(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;return o=t+104|0,h=e[o>>2]|0,h|0&&(e[t+108>>2]|0)>=(h|0)?d=4:(r=br(t)|0,(r|0)>=0?(l=e[o>>2]|0,o=t+8|0,l?(a=e[o>>2]|0,h=e[t+4>>2]|0,o=a,l=l-(e[t+108>>2]|0)+-1|0,(o-h|0)>(l|0)?e[t+100>>2]=h+l:d=9):(a=e[o>>2]|0,o=a,d=9),(d|0)==9&&(e[t+100>>2]=o),o=e[t+4>>2]|0,a&&(t=t+108|0,e[t>>2]=a+1-o+(e[t>>2]|0)),o=o+-1|0,(N[o>>0]|0|0)!=(r|0)&&(S[o>>0]=r)):d=4),(d|0)==4&&(e[t+100>>2]=0,r=-1),r|0}function Xi(t){t=t|0;var r=0;return t>>>0>4294963200&&(r=S0()|0,e[r>>2]=0-t,t=-1),t|0}function CA(t){return t=t|0,0}function mS(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,a|0}function yo(t,r){return t=t|0,r=r|0,-1}function gS(t){t=t|0,n0(t)}function SS(t,r){return t=t|0,r=r|0,(t+-48|0)>>>0<10|0}function AS(t,r){return t=t|0,r=r|0,pS(t)|0}function vS(t,r,o){return t=t|0,r=r|0,o=o|0,S[r>>0]|0&&$o(r,58885)|0&&$o(r,54145)|0?o=0:o||(o=Dd(1,4)|0),o|0}function ai(t){t=t|0;var r=0,o=0;return r=($r()|0)+176|0,o=e[r>>2]|0,t&&(e[r>>2]=t),o|0}function xS(t,r){t=+t,r=+r;var o=0,a=0;return B[q>>3]=t,a=e[q>>2]|0,o=e[q+4>>2]|0,B[q>>3]=r,o=e[q+4>>2]&-2147483648|o&2147483647,e[q>>2]=a,e[q+4>>2]=o,+ +B[q>>3]}function Co(t,r){return t=+t,r=+r,+ +xS(t,r)}function wS(t,r){t=+t,r=+r;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;B[q>>3]=t,o=e[q>>2]|0,D=e[q+4>>2]|0,B[q>>3]=r,E=e[q>>2]|0,F=e[q+4>>2]|0,a=Di(o|0,D|0,52)|0,a=a&2047,w=Di(E|0,F|0,52)|0,w=w&2047,R=D&-2147483648,d=v0(E|0,F|0,1)|0,C=ye;e:do if(!((d|0)==0&(C|0)==0)&&(h=F&2147483647,!(h>>>0>2146435072|(h|0)==2146435072&E>>>0>0|(a|0)==2047))){if(l=v0(o|0,D|0,1)|0,h=ye,!(h>>>0>C>>>0|(h|0)==(C|0)&l>>>0>d>>>0))return+((l|0)==(d|0)&(h|0)==(C|0)?t*0:t);if(a)l=D&1048575|1048576;else{if(a=v0(o|0,D|0,12)|0,l=ye,(l|0)>-1|(l|0)==-1&a>>>0>4294967295){h=a,a=0;do a=a+-1|0,h=v0(h|0,l|0,1)|0,l=ye;while((l|0)>-1|(l|0)==-1&h>>>0>4294967295)}else a=0;o=v0(o|0,D|0,1-a|0)|0,l=ye}if(w)D=F&1048575|1048576;else{if(h=v0(E|0,F|0,12)|0,d=ye,(d|0)>-1|(d|0)==-1&h>>>0>4294967295){w=0;do w=w+-1|0,h=v0(h|0,d|0,1)|0,d=ye;while((d|0)>-1|(d|0)==-1&h>>>0>4294967295)}else w=0;E=v0(E|0,F|0,1-w|0)|0,D=ye}C=ii(o|0,l|0,E|0,D|0)|0,d=ye,h=(d|0)>-1|(d|0)==-1&C>>>0>4294967295;t:do if((a|0)>(w|0)){for(;;){if(h){if((o|0)==(E|0)&(l|0)==(D|0))break;o=C,l=d}if(o=v0(o|0,l|0,1)|0,l=ye,a=a+-1|0,C=ii(o|0,l|0,E|0,D|0)|0,d=ye,h=(d|0)>-1|(d|0)==-1&C>>>0>4294967295,(a|0)<=(w|0))break t}r=t*0;break e}while(!1);if(h)if((o|0)==(E|0)&(l|0)==(D|0)){r=t*0;break}else l=d,o=C;if(l>>>0<1048576|(l|0)==1048576&o>>>0<0)do o=v0(o|0,l|0,1)|0,l=ye,a=a+-1|0;while(l>>>0<1048576|(l|0)==1048576&o>>>0<0);(a|0)>0?(F=$0(o|0,l|0,0,-1048576)|0,o=ye,a=v0(a|0,0,52)|0,o=o|ye,a=F|a):(a=Di(o|0,l|0,1-a|0)|0,o=ye),e[q>>2]=a,e[q+4>>2]=o|R,r=+B[q>>3]}else _=3;while(!1);return(_|0)==3&&(r=t*r,r=r/r),+r}function To(t,r){return t=+t,r=+r,+ +wS(t,r)}function Io(t,r){t=+t,r=r|0;var o=0,a=0,l=0;switch(B[q>>3]=t,o=e[q>>2]|0,a=e[q+4>>2]|0,l=Di(o|0,a|0,52)|0,l=l&2047,l|0){case 0:{t!=0?(t=+Io(t*18446744073709552e3,r),o=(e[r>>2]|0)+-64|0):o=0,e[r>>2]=o;break}case 2047:break;default:e[r>>2]=l+-1022,e[q>>2]=o,e[q+4>>2]=a&-2146435073|1071644672,t=+B[q>>3]}return+t}function yS(t,r){return t=+t,r=r|0,+ +Io(t,r)}function bn(t,r){t=+t,r=r|0;var o=0;return(r|0)>1023?(t=t*898846567431158e293,o=r+-1023|0,(o|0)>1023&&(o=r+-2046|0,o=(o|0)>1023?1023:o,t=t*898846567431158e293)):(r|0)<-1022?(t=t*22250738585072014e-324,o=r+1022|0,(o|0)<-1022&&(o=r+2044|0,o=(o|0)<-1022?-1022:o,t=t*22250738585072014e-324)):o=r,o=v0(o+1023|0,0,52)|0,r=ye,e[q>>2]=o,e[q+4>>2]=r,+(t*+B[q>>3])}function ko(t,r){return t=+t,r=r|0,+ +bn(t,r)}function CS(t,r,o){return t=t|0,r=r|0,o=o|0,Fn(0,t,r,o|0?o:37344)|0}function Fn(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;C=b,b=b+16|0,l=C,d=a|0?a:37348,a=e[d>>2]|0;e:do if(!r)a?w=15:a=0;else if(h=t|0?t:l,!o)a=-2;else{if(a)l=o,w=9;else{if(a=S[r>>0]|0,l=a&255,a<<24>>24>-1){e[h>>2]=l,a=a<<24>>24!=0&1;break}if(a=l+-194|0,a>>>0>50){w=15;break}a=e[37076+(a<<2)>>2]|0,l=o+-1|0,l&&(r=r+1|0,w=9)}t:do if((w|0)==9){if(t=S[r>>0]|0,D=(t&255)>>>3,(D+-16|D+(a>>26))>>>0>7){w=15;break e}for(;r=r+1|0,a=(t&255)+-128|a<<6,l=l+-1|0,!((a|0)>=0);){if(!l)break t;if(t=S[r>>0]|0,(t&-64)<<24>>24!=-128){w=15;break e}}e[d>>2]=0,e[h>>2]=a,a=o-l|0;break e}while(!1);e[d>>2]=a,a=-2}while(!1);return(w|0)==15&&(e[d>>2]=0,a=S0()|0,e[a>>2]=84,a=-1),b=C,a|0}function TS(t){return t=t|0,t?t=(e[t>>2]|0)==0:t=1,t&1|0}function IS(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;R=b,b=b+1040|0,D=R+8|0,F=R,C=e[r>>2]|0,e[F>>2]=C,E=(t|0)!=0,a=E?a:256,t=E?t:D,h=C;e:do if((a|0)!=0&(C|0)!=0){for(w=a,C=h,a=0;;){if(h=o>>>2,d=h>>>0>=w>>>0,!(o>>>0>131|d)){h=C;break e}if(h=d?w:h,o=o-h|0,h=Eo(t,F,h,l)|0,(h|0)==-1){a=o;break}if(_=(t|0)==(D|0),C=_?0:h,d=w-C|0,t=_?t:t+(h<<2)|0,a=h+a|0,h=e[F>>2]|0,(w|0)!=(C|0)&(h|0)!=0)w=d,C=h;else{w=d;break e}}o=a,w=0,h=e[F>>2]|0,a=-1}else w=a,a=0;while(!1);e:do if(h|0&&(w|0)!=0&(o|0)!=0){for(d=h,h=t;t=Fn(h,d,o,l)|0,!((t+2|0)>>>0<3);)if(d=(e[F>>2]|0)+t|0,e[F>>2]=d,w=w+-1|0,a=a+1|0,(w|0)!=0&(o|0)!=(t|0))o=o-t|0,h=h+4|0;else break e;switch(t|0){case-1:{a=-1;break e}case 0:{e[F>>2]=0;break e}default:{e[l>>2]=0;break e}}}while(!1);return E&&(e[r>>2]=e[F>>2]),b=R,a|0}function Eo(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;l=e[r>>2]|0,a|0&&(h=e[a>>2]|0,(h|0)!=0)?t?(e[a>>2]=0,C=t,a=o,w=h,D=37):(a=o,d=l,D=16):t?(h=t,a=o,D=6):(a=o,D=7);e:for(;;)if((D|0)==6){if(a)t=h;else{D=26;break}for(;;){h=S[l>>0]|0;do if(((h&255)+-1|0)>>>0<127&&a>>>0>4&(l&3|0)==0){for(d=l;;){if(l=e[d>>2]|0,(l+-16843009|l)&-2139062144){h=l,l=d,D=32;break}if(e[t>>2]=l&255,e[t+4>>2]=N[d+1>>0],e[t+8>>2]=N[d+2>>0],l=d+4|0,h=t+16|0,e[t+12>>2]=N[d+3>>0],a=a+-4|0,a>>>0>4)t=h,d=l;else{D=31;break}}if((D|0)==31){t=h,h=S[l>>0]|0;break}else if((D|0)==32){h=h&255;break}}while(!1);if(h=h&255,(h+-1|0)>>>0>=127)break;if(l=l+1|0,e[t>>2]=h,a=a+-1|0,a)t=t+4|0;else{D=26;break e}}if(h=h+-194|0,h>>>0>50){D=48;break}C=t,w=e[37076+(h<<2)>>2]|0,l=l+1|0,D=37;continue}else if((D|0)==7){if(h=S[l>>0]|0,((h&255)+-1|0)>>>0<127&&!(l&3|0)){if(h=e[l>>2]|0,!((h+-16843009|h)&-2139062144))do l=l+4|0,a=a+-4|0,h=e[l>>2]|0;while(!((h+-16843009|h)&-2139062144|0));h=h&255}if(h=h&255,(h+-1|0)>>>0<127){a=a+-1|0,l=l+1|0,D=7;continue}if(h=h+-194|0,h>>>0>50){D=48;break}h=e[37076+(h<<2)>>2]|0,d=l+1|0,D=16;continue}else if((D|0)==16){if(D=(N[d>>0]|0)>>>3,(D+-16|D+(h>>26))>>>0>7){D=17;break}if(l=d+1|0,h&33554432){if((S[l>>0]&-64)<<24>>24!=-128){D=20;break}if(l=d+2|0,h&524288){if((S[l>>0]&-64)<<24>>24!=-128){D=23;break}l=d+3|0}}a=a+-1|0,D=7;continue}else if((D|0)==37){if(h=N[l>>0]|0,D=h>>>3,(D+-16|D+(w>>26))>>>0>7){D=38;break}if(d=l+1|0,t=h+-128|w<<6,(t|0)<0){if(h=N[d>>0]|0,(h&192|0)!=128){D=41;break}if(d=l+2|0,t=h+-128|t<<6,(t|0)<0){if(h=N[d>>0]|0,(h&192|0)!=128){D=44;break}t=h+-128|t<<6,l=l+3|0}else l=d}else l=d;e[C>>2]=t,h=C+4|0,a=a+-1|0,D=6;continue}return(D|0)==17||(D|0)==20||(D|0)==23?(l=d+-1|0,D=47):(D|0)==26?e[r>>2]=l:(D|0)==38?(t=C,h=w,l=l+-1|0,D=47):((D|0)==41||(D|0)==44)&&(a=C,o=l+-1|0,D=52),(D|0)==47&&(h?(a=t,o=l,D=52):D=48),(D|0)==48&&(S[l>>0]|0?(a=t,o=l,D=52):(t&&(e[t>>2]=0,e[r>>2]=0),o=o-a|0)),(D|0)==52&&(D=S0()|0,e[D>>2]=84,a&&(e[r>>2]=o),o=-1),o|0}function kS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;d=b,b=b+16|0,a=d;e:do if(!r)a=0;else{do if(o){if(h=t|0?t:a,a=S[r>>0]|0,t=a&255,a<<24>>24>-1){e[h>>2]=t,a=a<<24>>24!=0&1;break e}if(a=t+-194|0,a>>>0<=50){if(t=r+1|0,l=e[37076+(a<<2)>>2]|0,o>>>0<4&&l&-2147483648>>>((o*6|0)+-6|0)|0)break;if(a=N[t>>0]|0,o=a>>>3,(o+-16|o+(l>>26))>>>0<=7){if(a=a+-128|l<<6,(a|0)>=0){e[h>>2]=a,a=2;break e}if(t=N[r+2>>0]|0,(t&192|0)==128){if(t=t+-128|a<<6,(t|0)>=0){e[h>>2]=t,a=3;break e}if(a=N[r+3>>0]|0,(a&192|0)==128){e[h>>2]=a+-128|t<<6,a=4;break e}}}}}while(!1);a=S0()|0,e[a>>2]=84,a=-1}while(!1);return b=d,a|0}function Oi(t,r,o){t=t|0,r=r|0,o=o|0;do if(t){if(r>>>0<128){S[t>>0]=r,t=1;break}if(r>>>0<2048){S[t>>0]=r>>>6|192,S[t+1>>0]=r&63|128,t=2;break}if(r>>>0<55296|(r&-8192|0)==57344){S[t>>0]=r>>>12|224,S[t+1>>0]=r>>>6&63|128,S[t+2>>0]=r&63|128,t=3;break}if((r+-65536|0)>>>0<1048576){S[t>>0]=r>>>18|240,S[t+1>>0]=r>>>12&63|128,S[t+2>>0]=r>>>6&63|128,S[t+3>>0]=r&63|128,t=4;break}else{t=S0()|0,e[t>>2]=84,t=-1;break}}else t=1;while(!1);return t|0}function ES(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;E=b,b=b+272|0,w=E+8|0,D=E,d=e[r>>2]|0,e[D>>2]=d,C=(t|0)!=0,l=C?a:256,a=C?t:w,t=d;e:do if((l|0)!=0&(d|0)!=0){for(d=l,h=t,l=0;;){if(t=o>>>0>=d>>>0,!(t|o>>>0>32)){t=h;break e}if(t=t?d:o,o=o-t|0,t=DS(a,D,t,0)|0,(t|0)==-1){l=o;break}if(R=(a|0)==(w|0),F=R?0:t,h=d-F|0,a=R?a:a+t|0,l=t+l|0,t=e[D>>2]|0,(d|0)!=(F|0)&(t|0)!=0)d=h,h=t;else{d=h;break e}}o=l,d=0,t=e[D>>2]|0,l=-1}else d=l,l=0;while(!1);e:do if(t|0&&(d|0)!=0&(o|0)!=0){for(h=t,t=a;a=Oi(t,e[h>>2]|0,0)|0,!((a+1|0)>>>0<2);)if(h=(e[D>>2]|0)+4|0,e[D>>2]=h,o=o+-1|0,l=l+1|0,(d|0)!=(a|0)&(o|0)!=0)d=d-a|0,t=t+a|0;else break e;a?l=-1:e[D>>2]=0}while(!1);return C&&(e[r>>2]=e[D>>2]),b=E,l|0}function DS(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;e:do if(t){t:do if(o>>>0>3){for(a=o,l=e[r>>2]|0;;){if(h=e[l>>2]|0,(h+-1|0)>>>0>126){if(!h)break;if(h=Oi(t,h,0)|0,(h|0)==-1){o=-1;break e}t=t+h|0,a=a-h|0}else S[t>>0]=h,t=t+1|0,a=a+-1|0,l=e[r>>2]|0;if(l=l+4|0,e[r>>2]=l,a>>>0<=3)break t}S[t>>0]=0,e[r>>2]=0,o=o-a|0;break e}else a=o;while(!1);if(a){for(l=e[r>>2]|0;;){if(h=e[l>>2]|0,(h+-1|0)>>>0>126){if(!h){l=19;break}if(h=Oi(d,h,0)|0,(h|0)==-1){o=-1;break e}if(a>>>0>>0){l=22;break}Oi(t,e[l>>2]|0,0)|0,t=t+h|0,a=a-h|0}else S[t>>0]=h,t=t+1|0,a=a+-1|0,l=e[r>>2]|0;if(l=l+4|0,e[r>>2]=l,!a)break e}if((l|0)==19){S[t>>0]=0,e[r>>2]=0,o=o-a|0;break}else if((l|0)==22){o=o-a|0;break}}}else if(t=e[r>>2]|0,a=e[t>>2]|0,!a)o=0;else{o=0;do{if(a>>>0>127){if(a=Oi(d,a,0)|0,(a|0)==-1){o=-1;break e}}else a=1;o=a+o|0,t=t+4|0,a=e[t>>2]|0}while(a|0)}while(!1);return b=w,o|0}function Do(t,r){return t=t|0,r=r|0,t?t=Oi(t,r,0)|0:t=0,t|0}function Ri(t){return t=t|0,0}function mi(t){t=t|0}function bo(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C,d=r&255,S[w>>0]=d,a=t+16|0,l=e[a>>2]|0,l?h=4:Ro(t)|0?o=-1:(l=e[a>>2]|0,h=4);do if((h|0)==4){if(a=t+20|0,h=e[a>>2]|0,h>>>0>>0&&(o=r&255,(o|0)!=(S[t+75>>0]|0))){e[a>>2]=h+1,S[h>>0]=d;break}(Yt[e[t+36>>2]&63](t,w,1)|0)==1?o=N[w>>0]|0:o=-1}while(!1);return b=C,o|0}function bS(t){t=t|0;var r=0,o=0;return r=b,b=b+16|0,o=r,e[o>>2]=e[t+60>>2],t=Xi(Zo(6,o|0)|0)|0,b=r,t|0}function NS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;return D=b,b=b+48|0,h=D+16|0,l=D,a=D+32|0,e[a>>2]=r,d=a+4|0,C=t+48|0,E=e[C>>2]|0,e[d>>2]=o-((E|0)!=0&1),w=t+44|0,e[a+8>>2]=e[w>>2],e[a+12>>2]=E,e[9258]|0?(zr(185,t|0),e[l>>2]=e[t+60>>2],e[l+4>>2]=a,e[l+8>>2]=2,a=Xi(Wr(145,l|0)|0)|0,Vr(0)):(e[h>>2]=e[t+60>>2],e[h+4>>2]=a,e[h+8>>2]=2,a=Xi(Wr(145,h|0)|0)|0),(a|0)>=1?(d=e[d>>2]|0,a>>>0>d>>>0&&(h=e[w>>2]|0,l=t+4|0,e[l>>2]=h,e[t+8>>2]=h+(a-d),e[C>>2]|0&&(e[l>>2]=h+1,S[r+(o+-1)>>0]=S[h>>0]|0),a=o)):(e[t>>2]=e[t>>2]|a&48^16,e[t+8>>2]=0,e[t+4>>2]=0),b=D,a|0}function RS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;return l=b,b=b+32|0,h=l,a=l+20|0,e[h>>2]=e[t+60>>2],e[h+4>>2]=0,e[h+8>>2]=r,e[h+12>>2]=a,e[h+16>>2]=o,(Xi(ta(140,h|0)|0)|0)<0?(e[a>>2]=-1,t=-1):t=e[a>>2]|0,b=l,t|0}function Fo(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0;for(U=b,b=b+48|0,F=U+16|0,E=U,a=U+32|0,R=t+28|0,l=e[R>>2]|0,e[a>>2]=l,_=t+20|0,l=(e[_>>2]|0)-l|0,e[a+4>>2]=l,e[a+8>>2]=r,e[a+12>>2]=o,C=t+60|0,D=t+44|0,r=2,l=l+o|0;;){if(e[9258]|0?(zr(186,t|0),e[E>>2]=e[C>>2],e[E+4>>2]=a,e[E+8>>2]=r,d=Xi(Hr(146,E|0)|0)|0,Vr(0)):(e[F>>2]=e[C>>2],e[F+4>>2]=a,e[F+8>>2]=r,d=Xi(Hr(146,F|0)|0)|0),(l|0)==(d|0)){l=6;break}if((d|0)<0){l=8;break}l=l-d|0,h=e[a+4>>2]|0,d>>>0<=h>>>0?(r|0)==2?(e[R>>2]=(e[R>>2]|0)+d,w=h,r=2):w=h:(w=e[D>>2]|0,e[R>>2]=w,e[_>>2]=w,w=e[a+12>>2]|0,d=d-h|0,a=a+8|0,r=r+-1|0),e[a>>2]=(e[a>>2]|0)+d,e[a+4>>2]=w-d}return(l|0)==6?(F=e[D>>2]|0,e[t+16>>2]=F+(e[t+48>>2]|0),t=F,e[R>>2]=t,e[_>>2]=t):(l|0)==8&&(e[t+16>>2]=0,e[R>>2]=0,e[_>>2]=0,e[t>>2]=e[t>>2]|32,(r|0)==2?o=0:o=o-(e[a+4>>2]|0)|0),b=U,o|0}function MS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return l=b,b=b+80|0,a=l,e[t+36>>2]=8,!(e[t>>2]&64|0)&&(e[a>>2]=e[t+60>>2],e[a+4>>2]=21505,e[a+8>>2]=l+12,(Ko(54,a|0)|0)!=0)&&(S[t+75>>0]=-1),a=Fo(t,r,o)|0,b=l,a|0}function _S(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return a=t+84|0,h=e[a>>2]|0,d=o+256|0,l=Oo(h,0,d)|0,l=l|0?l-h|0:d,o=l>>>0>>0?l:o,o0(r|0,h|0,o|0)|0,e[t+4>>2]=h+o,r=h+l|0,e[t+8>>2]=r,e[a>>2]=r,o|0}function No(t){t=t|0;var r=0,o=0;return r=t+74|0,o=S[r>>0]|0,S[r>>0]=o+255|o,r=t+20|0,o=t+44|0,(e[r>>2]|0)>>>0>(e[o>>2]|0)>>>0&&Yt[e[t+36>>2]&63](t,0,0)|0,e[t+16>>2]=0,e[t+28>>2]=0,e[r>>2]=0,r=e[t>>2]|0,r&20?(r&4&&(e[t>>2]=r|32),r=-1):(r=e[o>>2]|0,e[t+8>>2]=r,e[t+4>>2]=r,r=0),r|0}function Ro(t){t=t|0;var r=0,o=0;return r=t+74|0,o=S[r>>0]|0,S[r>>0]=o+255|o,r=e[t>>2]|0,r&8?(e[t>>2]=r|32,r=-1):(e[t+8>>2]=0,e[t+4>>2]=0,r=e[t+44>>2]|0,e[t+28>>2]=r,e[t+20>>2]=r,e[t+16>>2]=r+(e[t+48>>2]|0),r=0),r|0}function br(t){t=t|0;var r=0,o=0;return o=b,b=b+16|0,r=o,!(e[t+8>>2]|0)&&No(t)|0?r=-1:(Yt[e[t+32>>2]&63](t,r,1)|0)==1?r=N[r>>0]|0:r=-1,b=o,r|0}function Fr(t){t=t|0;var r=0,o=0;do if(t){if((e[t+76>>2]|0)<=-1){r=Mr(t)|0;break}o=(Ri(t)|0)==0,r=Mr(t)|0,o||mi(t)}else{if(e[9323]|0?r=Fr(e[9323]|0)|0:r=0,M0(37060),t=e[9264]|0,t)do(e[t+76>>2]|0)>-1?o=Ri(t)|0:o=0,(e[t+20>>2]|0)>>>0>(e[t+28>>2]|0)>>>0&&(r=Mr(t)|0|r),o&&mi(t),t=e[t+56>>2]|0;while(t|0);Yo(37060)}while(!1);return r|0}function PS(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0;(e[r+76>>2]|0)>=0&&Ri(r)|0?((S[r+75>>0]|0)!=(t|0)&&(a=r+20|0,l=e[a>>2]|0,l>>>0<(e[r+16>>2]|0)>>>0)?(e[a>>2]=l+1,S[l>>0]=t,o=t&255):o=bo(r,t)|0,mi(r)):d=3;do if((d|0)==3){if((S[r+75>>0]|0)!=(t|0)&&(h=r+20|0,o=e[h>>2]|0,o>>>0<(e[r+16>>2]|0)>>>0)){e[h>>2]=o+1,S[o>>0]=t,o=t&255;break}o=bo(r,t)|0}while(!1);return o|0}function B0(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;a=o+16|0,l=e[a>>2]|0,l?h=4:Ro(o)|0?a=0:(l=e[a>>2]|0,h=4);e:do if((h|0)==4){if(d=o+20|0,h=e[d>>2]|0,(l-h|0)>>>0>>0){a=Yt[e[o+36>>2]&63](o,t,r)|0;break}t:do if((S[o+75>>0]|0)>-1){for(a=r;;){if(!a){l=h,a=0;break t}if(l=a+-1|0,(S[t+l>>0]|0)==10)break;a=l}if((Yt[e[o+36>>2]&63](o,t,a)|0)>>>0>>0)break e;r=r-a|0,t=t+a|0,l=e[d>>2]|0}else l=h,a=0;while(!1);o0(l|0,t|0,r|0)|0,e[d>>2]=(e[d>>2]|0)+r,a=a+r|0}while(!1);return a|0}function gi(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return l=ie(o,r)|0,(e[a+76>>2]|0)>-1?(h=(Ri(a)|0)==0,t=B0(t,l,a)|0,h||mi(a)):t=B0(t,l,a)|0,(t|0)!=(l|0)&&(o=(t>>>0)/(r>>>0)|0),o|0}function Nn(t){t=t|0;var r=0,o=0,a=0;(e[t+76>>2]|0)>=0&&Ri(t)|0?(r=t+4|0,o=e[r>>2]|0,o>>>0<(e[t+8>>2]|0)>>>0?(e[r>>2]=o+1,r=N[o>>0]|0):r=br(t)|0):a=3;do if((a|0)==3)if(r=t+4|0,o=e[r>>2]|0,o>>>0<(e[t+8>>2]|0)>>>0){e[r>>2]=o+1,r=N[o>>0]|0;break}else{r=br(t)|0;break}while(!1);return r|0}function Mo(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return l=b,b=b+16|0,h=l,e[h>>2]=a,a=Mn(t,r,o,h)|0,b=l,a|0}function _o(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return a=b,b=b+16|0,l=a,e[l>>2]=o,o=Lo(t,r,l)|0,b=a,o|0}function Rn(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;do if((t|0)!=-1){if((e[r+76>>2]|0)>-1?l=Ri(r)|0:l=0,!(e[r+8>>2]|0)&&No(r)|0||(h=6),(h|0)==6&&(o=r+4|0,a=e[o>>2]|0,a>>>0>((e[r+44>>2]|0)+-8|0)>>>0)){if(h=a+-1|0,e[o>>2]=h,S[h>>0]=t,e[r>>2]=e[r>>2]&-17,!l)break;mi(r);break}l&&mi(r),t=-1}else t=-1;while(!1);return t|0}function LS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+16|0,a=w,l=E0(240)|0;do if(l){if(e[a>>2]=e[o>>2],a=Mn(l,240,r,a)|0,a>>>0<240){r=Gi(l,a+1|0)|0,e[t>>2]=r|0?r:l;break}n0(l),(a|0)>=0&&(d=a+1|0,h=E0(d)|0,e[t>>2]=h,(h|0)!=0)?a=Mn(h,d,r,o)|0:a=-1}else a=-1;while(!1);return b=w,a|0}function Po(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0;H=b,b=b+224|0,F=H+80|0,U=H+96|0,_=H,R=H+136|0,a=U,l=a+40|0;do e[a>>2]=0,a=a+4|0;while((a|0)<(l|0));return e[F>>2]=e[o>>2],(cr(0,r,F,_,U)|0)<0?o=-1:((e[t+76>>2]|0)>-1?D=Ri(t)|0:D=0,o=e[t>>2]|0,E=o&32,(S[t+74>>0]|0)<1&&(e[t>>2]=o&-33),o=t+48|0,e[o>>2]|0?a=cr(t,r,F,_,U)|0:(l=t+44|0,h=e[l>>2]|0,e[l>>2]=R,d=t+28|0,e[d>>2]=R,w=t+20|0,e[w>>2]=R,e[o>>2]=80,C=t+16|0,e[C>>2]=R+80,a=cr(t,r,F,_,U)|0,h&&(Yt[e[t+36>>2]&63](t,0,0)|0,a=e[w>>2]|0?a:-1,e[l>>2]=h,e[o>>2]=0,e[C>>2]=0,e[d>>2]=0,e[w>>2]=0)),o=e[t>>2]|0,e[t>>2]=o|E,D&&mi(t),o=o&32|0?-1:a),b=H,o|0}function OS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,U=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0;i0=b,b=b+304|0,ce=i0+16|0,ke=i0+8|0,Ee=i0+33|0,Te=i0,G=i0+32|0,(e[t+76>>2]|0)>-1?s0=Ri(t)|0:s0=0,a=S[r>>0]|0;e:do if(a<<24>>24){it=t+4|0,jt=t+100|0,re=t+108|0,$=t+8|0,P=Ee+10|0,L=Ee+33|0,J=ke+4|0,ne=Ee+46|0,ae=Ee+94|0,h=a,a=0,d=r,F=0,l=0,r=0;t:for(;;){i:do if(ji(h&255)|0){for(;h=d+1|0,ji(N[h>>0]|0)|0;)d=h;oi(t,0);do h=e[it>>2]|0,h>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0;while(ji(h)|0);h=e[it>>2]|0,e[jt>>2]|0&&(h=h+-1|0,e[it>>2]=h),w=(e[re>>2]|0)+F+h-(e[$>>2]|0)|0}else{h=(S[d>>0]|0)==37;n:do if(h){D=d+1|0,w=S[D>>0]|0;r:do switch(w<<24>>24){case 37:break n;case 42:{K=0,w=d+2|0;break}default:{if(w=(w&255)+-48|0,w>>>0<10&&(S[d+2>>0]|0)==36){for(e[ce>>2]=e[o>>2];K=(e[ce>>2]|0)+3&-4,h=e[K>>2]|0,e[ce>>2]=K+4,w>>>0>1;)w=w+-1|0;K=h,w=d+3|0;break r}w=(e[o>>2]|0)+3&-4,K=e[w>>2]|0,e[o>>2]=w+4,w=D}}while(!1);if(h=S[w>>0]|0,d=h&255,(d+-48|0)>>>0<10)for(h=0;D=(h*10|0)+-48+d|0,w=w+1|0,h=S[w>>0]|0,d=h&255,!((d+-48|0)>>>0>=10);)h=D;else D=0;switch(h<<24>>24==109?(w=w+1|0,E=S[w>>0]|0,h=(K|0)!=0&1,l=0,r=0):(E=h,h=0),d=w+1|0,E&255|0){case 104:{H=(S[d>>0]|0)==104,d=H?w+2|0:d,w=H?-2:-1;break}case 108:{H=(S[d>>0]|0)==108,d=H?w+2|0:d,w=H?3:1;break}case 106:{w=3;break}case 116:case 122:{w=1;break}case 76:{w=2;break}case 110:case 112:case 67:case 83:case 91:case 99:case 115:case 88:case 71:case 70:case 69:case 65:case 103:case 102:case 101:case 97:case 120:case 117:case 111:case 105:case 100:{d=w,w=0;break}default:{Gt=152;break t}}switch(E=N[d>>0]|0,R=(E&47|0)==3,E=R?E|32:E,R=R?1:w,E|0){case 99:{H=F,U=(D|0)<1?1:D;break}case 91:{H=F,U=D;break}case 110:{if(!K){w=F;break i}switch(R|0){case-2:{S[K>>0]=F,w=F;break i}case-1:{k[K>>1]=F,w=F;break i}case 0:{e[K>>2]=F,w=F;break i}case 1:{e[K>>2]=F,w=F;break i}case 3:{w=K,e[w>>2]=F,e[w+4>>2]=((F|0)<0)<<31>>31,w=F;break i}default:{w=F;break i}}}default:{oi(t,0);do w=e[it>>2]|0,w>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=w+1,w=N[w>>0]|0):w=u0(t)|0;while(ji(w)|0);w=e[it>>2]|0,e[jt>>2]|0&&(w=w+-1|0,e[it>>2]=w),H=(e[re>>2]|0)+F+w-(e[$>>2]|0)|0,U=D}}if(oi(t,U),w=e[it>>2]|0,D=e[jt>>2]|0,w>>>0>>0)e[it>>2]=w+1;else{if((u0(t)|0)<0){Gt=152;break t}D=e[jt>>2]|0}D&&(e[it>>2]=(e[it>>2]|0)+-1);r:do switch(E|0){case 91:case 99:case 115:{_=(E|0)==99;s:do if((E&239|0)==99)Jt(Ee|0,-1,257)|0,S[Ee>>0]=0,(E|0)==115&&(S[L>>0]=0,S[P>>0]=0,S[P+1>>0]=0,S[P+2>>0]=0,S[P+3>>0]=0,S[P+4>>0]=0);else{switch(zt=d+1|0,F=(S[zt>>0]|0)==94,w=F&1,E=F?zt:d,d=F?d+2|0:zt,Jt(Ee|0,F&1|0,257)|0,S[Ee>>0]=0,S[d>>0]|0){case 45:{F=(w^1)&255,S[ne>>0]=F,d=E+2|0;break}case 93:{F=(w^1)&255,S[ae>>0]=F,d=E+2|0;break}default:F=(w^1)&255}for(;;){w=S[d>>0]|0;o:do switch(w<<24>>24){case 0:{Gt=152;break t}case 93:break s;case 45:{switch(E=d+1|0,w=S[E>>0]|0,w<<24>>24){case 93:case 0:{w=45;break o}default:}if(d=S[d+-1>>0]|0,(d&255)<(w&255)){d=d&255;do d=d+1|0,S[Ee+d>>0]=F,w=S[E>>0]|0;while((d|0)<(w&255|0));d=E}else d=E;break}default:}while(!1);S[Ee+((w&255)+1)>>0]=F,d=d+1|0}}while(!1);E=_?U+1|0:31,F=(R|0)==1,R=(h|0)!=0;s:do if(F){if(R){if(r=E0(E<<2)|0,!r){l=0,Gt=152;break t}}else r=K;e[ke>>2]=0,e[J>>2]=0,l=0;o:for(;;){D=(r|0)==0;do{a:for(;;){if(w=e[it>>2]|0,w>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=w+1,w=N[w>>0]|0):w=u0(t)|0,!(S[Ee+(w+1)>>0]|0))break o;switch(S[G>>0]=w,Fn(Te,G,1,ke)|0){case-1:{l=0,Gt=152;break t}case-2:break;default:break a}}D||(e[r+(l<<2)>>2]=e[Te>>2],l=l+1|0)}while(!(R&(l|0)==(E|0)));if(l=E<<1|1,w=Gi(r,l<<2)|0,!w){l=0,Gt=152;break t}zt=E,E=l,r=w,l=zt}if(TS(ke)|0)D=l,l=0;else{l=0,Gt=152;break t}}else{if(R){if(l=E0(E)|0,l)w=0;else{l=0,r=0,Gt=152;break t}for(;;){do{if(r=e[it>>2]|0,r>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,!(S[Ee+(r+1)>>0]|0)){D=w,r=0;break s}S[l+w>>0]=r,w=w+1|0}while((w|0)!=(E|0));if(r=E<<1|1,w=Gi(l,r)|0,w)zt=E,E=r,l=w,w=zt;else{r=0,Gt=152;break t}}}if(K)for(l=0;;){if(r=e[it>>2]|0,r>>>0>>0?(e[it>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,!(S[Ee+(r+1)>>0]|0)){D=l,l=K,r=0;break s}S[K+l>>0]=r,D=e[jt>>2]|0,l=l+1|0}else for(l=D;;){if(r=e[it>>2]|0,r>>>0>>0?(e[it>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,!(S[Ee+(r+1)>>0]|0)){D=0,l=0,r=0;break s}l=e[jt>>2]|0}}while(!1);if(w=e[it>>2]|0,e[jt>>2]|0&&(w=w+-1|0,e[it>>2]=w),w=w-(e[$>>2]|0)+(e[re>>2]|0)|0,!w||!((w|0)==(U|0)|_^1))break t;do if(R)if(F){e[K>>2]=r;break}else{e[K>>2]=l;break}while(!1);if(!_){if(r&&(e[r+(D<<2)>>2]=0),!l){l=0;break r}S[l+D>>0]=0}break}case 120:case 88:case 112:{w=16,Gt=134;break}case 111:{w=8,Gt=134;break}case 117:case 100:{w=10,Gt=134;break}case 105:{w=0,Gt=134;break}case 71:case 103:case 70:case 102:case 69:case 101:case 65:case 97:{if(C=+xo(t,R,0),(e[re>>2]|0)==((e[$>>2]|0)-(e[it>>2]|0)|0))break t;if(K)switch(R|0){case 0:{z[K>>2]=C;break r}case 1:{B[K>>3]=C;break r}case 2:{B[K>>3]=C;break r}default:break r}break}default:}while(!1);r:do if((Gt|0)==134){if(Gt=0,w=wo(t,w,0,-1,-1)|0,(e[re>>2]|0)==((e[$>>2]|0)-(e[it>>2]|0)|0))break t;if((K|0)!=0&(E|0)==112){e[K>>2]=w;break}if(K)switch(R|0){case-2:{S[K>>0]=w;break r}case-1:{k[K>>1]=w;break r}case 0:{e[K>>2]=w;break r}case 1:{e[K>>2]=w;break r}case 3:{zt=K,e[zt>>2]=w,e[zt+4>>2]=ye;break r}default:break r}}while(!1);a=((K|0)!=0&1)+a|0,w=(e[re>>2]|0)+H+(e[it>>2]|0)-(e[$>>2]|0)|0;break i}while(!1);if(d=d+(h&1)|0,oi(t,0),h=e[it>>2]|0,h>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,(h|0)!=(N[d>>0]|0)){Gt=21;break t}w=F+1|0}while(!1);if(d=d+1|0,h=S[d>>0]|0,h<<24>>24)F=w;else break e}if((Gt|0)==21){if(e[jt>>2]|0&&(e[it>>2]=(e[it>>2]|0)+-1),(a|0)!=0|(h|0)>-1)break;a=0,Gt=153}else(Gt|0)==152&&(a||(a=h,Gt=153));(Gt|0)==153&&(h=a,a=-1),h&&(n0(l),n0(r))}else a=0;while(!1);return s0&&mi(t),b=i0,a|0}function Mn(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;E=b,b=b+128|0,l=E+112|0,D=E,h=D,d=37352,w=h+112|0;do e[h>>2]=e[d>>2],h=h+4|0,d=d+4|0;while((h|0)<(w|0));return(r+-1|0)>>>0>2147483646?r?(r=S0()|0,e[r>>2]=75,r=-1):(r=1,C=4):(l=t,C=4),(C|0)==4&&(C=-2-l|0,C=r>>>0>C>>>0?C:r,e[D+48>>2]=C,t=D+20|0,e[t>>2]=l,e[D+44>>2]=l,r=l+C|0,l=D+16|0,e[l>>2]=r,e[D+28>>2]=r,r=Po(D,o,a)|0,C&&(o=e[t>>2]|0,S[o+(((o|0)==(e[l>>2]|0))<<31>>31)>>0]=0)),b=E,r|0}function Lo(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;h=b,b=b+112|0,a=h,l=a,d=l+112|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));return e[a+32>>2]=29,e[a+44>>2]=t,e[a+76>>2]=-1,e[a+84>>2]=t,d=OS(a,r,o)|0,b=h,d|0}function Nr(t,r,o){return t=t|0,r=r|0,o=o|0,+ +kd(t,r,2)}function $S(t,r,o){return t=t|0,r=r|0,o=o|0,t=_s(t,r,o,-1,-1)|0,t|0}function BS(t,r,o){return t=t|0,r=r|0,o=o|0,t=_s(t,r,o,0,-2147483648)|0,t|0}function Oo(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;h=r&255,a=(o|0)!=0;e:do if(a&(t&3|0)!=0)for(l=r&255;;){if((S[t>>0]|0)==l<<24>>24){d=6;break e}if(t=t+1|0,o=o+-1|0,a=(o|0)!=0,!(a&(t&3|0)!=0)){d=5;break}}else d=5;while(!1);(d|0)==5&&(a?d=6:o=0);e:do if((d|0)==6&&(l=r&255,(S[t>>0]|0)!=l<<24>>24)){a=ie(h,16843009)|0;t:do if(o>>>0>3){for(;h=e[t>>2]^a,!((h&-2139062144^-2139062144)&h+-16843009);)if(t=t+4|0,o=o+-4|0,o>>>0<=3){d=11;break t}}else d=11;while(!1);if((d|0)==11&&!o){o=0;break}for(;;){if((S[t>>0]|0)==l<<24>>24)break e;if(t=t+1|0,o=o+-1|0,!o){o=0;break}}}while(!1);return(o|0?t:0)|0}function VS(t,r){t=t|0,r=r|0;var o=0,a=0;o=r;e:do if((o^t)&3)a=8;else{if(o&3)do{if(o=S[r>>0]|0,S[t>>0]=o,!(o<<24>>24))break e;r=r+1|0,t=t+1|0}while(r&3|0);if(o=e[r>>2]|0,!((o&-2139062144^-2139062144)&o+-16843009))for(a=t;r=r+4|0,t=a+4|0,e[a>>2]=o,o=e[r>>2]|0,!((o&-2139062144^-2139062144)&o+-16843009);)a=t;a=8}while(!1);if((a|0)==8&&(a=S[r>>0]|0,S[t>>0]=a,a<<24>>24))do r=r+1|0,t=t+1|0,a=S[r>>0]|0,S[t>>0]=a;while(a<<24>>24);return t|0}function $o(t,r){t=t|0,r=r|0;var o=0,a=0;if(a=S[t>>0]|0,o=S[r>>0]|0,!(a<<24>>24)||a<<24>>24!=o<<24>>24)r=a;else{do t=t+1|0,r=r+1|0,a=S[t>>0]|0,o=S[r>>0]|0;while(!(!(a<<24>>24)||a<<24>>24!=o<<24>>24));r=a}return(r&255)-(o&255)|0}function Rr(t,r){return t=t|0,r=r|0,VS(t,r)|0,t|0}function $i(t){t=t|0;var r=0,o=0,a=0;a=t;e:do if(!(a&3))o=4;else for(r=t,t=a;;){if(!(S[r>>0]|0))break e;if(r=r+1|0,t=r,!(t&3)){t=r,o=4;break}}while(!1);if((o|0)==4){for(;r=e[t>>2]|0,!((r&-2139062144^-2139062144)&r+-16843009);)t=t+4|0;if((r&255)<<24>>24)do t=t+1|0;while(S[t>>0]|0)}return t-a|0}function US(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;if(!o)r=0;else{a=S[t>>0]|0;e:do if(!(a<<24>>24))a=0;else for(;;){if(o=o+-1|0,l=S[r>>0]|0,!(a<<24>>24==l<<24>>24&((o|0)!=0&l<<24>>24!=0)))break e;if(t=t+1|0,r=r+1|0,a=S[t>>0]|0,!(a<<24>>24)){a=0;break}}while(!1);r=(a&255)-(N[r>>0]|0)|0}return r|0}function _n(t){t=t|0;var r=0;for(r=t;e[r>>2]|0;)r=r+4|0;return r-t>>2|0}function Bi(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(o)for(a=t;o=o+-1|0,e[a>>2]=e[r>>2],o;)r=r+4|0,a=a+4|0;return t|0}function zS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(a=(o|0)==0,t-r>>2>>>0>>0){if(!a)do o=o+-1|0,e[t+(o<<2)>>2]=e[r+(o<<2)>>2];while(o|0)}else if(!a)for(a=r,r=t;o=o+-1|0,e[r>>2]=e[a>>2],o;)a=a+4|0,r=r+4|0;return t|0}function GS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(o)for(a=t;o=o+-1|0,e[a>>2]=r,o;)a=a+4|0;return t|0}function Bo(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;switch(d=t+4|0,o=e[d>>2]|0,w=t+100|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0,o|0){case 43:case 45:{a=(o|0)==45&1,o=e[d>>2]|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0,(r|0)!=0&(o+-48|0)>>>0>9&&e[w>>2]|0&&(e[d>>2]=(e[d>>2]|0)+-1),h=a;break}default:h=0}if((o+-48|0)>>>0>9)e[w>>2]|0?(e[d>>2]=(e[d>>2]|0)+-1,a=-2147483648,o=0):(a=-2147483648,o=0);else{a=0;do a=o+-48+(a*10|0)|0,o=e[d>>2]|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0;while((o+-48|0)>>>0<10&(a|0)<214748364);if(r=((a|0)<0)<<31>>31,(o+-48|0)>>>0<10){do r=Qi(a|0,r|0,10,0)|0,a=ye,o=$0(o|0,((o|0)<0)<<31>>31|0,-48,-1)|0,a=$0(o|0,ye|0,r|0,a|0)|0,r=ye,o=e[d>>2]|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0;while((o+-48|0)>>>0<10&((r|0)<21474836|(r|0)==21474836&a>>>0<2061584302));l=a}else l=a;if((o+-48|0)>>>0<10)do o=e[d>>2]|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0;while((o+-48|0)>>>0<10);e[w>>2]|0&&(e[d>>2]=(e[d>>2]|0)+-1),t=(h|0)!=0,o=ii(0,0,l|0,r|0)|0,a=t?ye:r,o=t?o:l}return ye=a,o|0}function qS(t){t=t|0,e[t+68>>2]|0||mi(t)}function WS(t){t=t|0,e[t+68>>2]|0||mi(t)}function Mr(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;return r=t+20|0,h=t+28|0,(e[r>>2]|0)>>>0>(e[h>>2]|0)>>>0&&(Yt[e[t+36>>2]&63](t,0,0)|0,(e[r>>2]|0)==0)?r=-1:(d=t+4|0,o=e[d>>2]|0,a=t+8|0,l=e[a>>2]|0,o>>>0>>0&&Yt[e[t+40>>2]&63](t,o-l|0,1)|0,e[t+16>>2]=0,e[h>>2]=0,e[r>>2]=0,e[a>>2]=0,e[d>>2]=0,r=0),r|0}var HS=[bi,nf,of,eh,nh,ah,uh,Sn,An,bi,bi,bi,bi,bi,bi,bi],Pn=[sn,Y5,Ju,zu,Nu,xu,cu,eu,V2,tS,eS,J6,sn,sn,sn,sn],QS=[so,ph,xh,so],Rt=[e0,W5,H5,Yu,ju,$u,Bu,Eu,Du,gu,Su,ou,au,j2,X2,L2,O2,T2,I2,m2,g2,r2,s2,K1,Y1,$1,B1,n1,r1,Kl,Yl,Ia,ka,Ml,Ol,_l,hm,Xs,dm,pm,ul,cl,w6,hl,il,nl,Ua,za,Ha,Qa,Xa,Za,dl,pl,Al,vl,Cl,Tl,Dl,bl,Hl,Ql,d1,p1,A1,v1,C1,T1,b1,F1,K2,Y2,mp,i6,f6,h6,y6,C6,R6,M6,In,O6,V6,U6,G6,H6,q6,W6,Q6,K6,rn,Ld,zd,wt,Hd,Zd,fr,pp,Mp,Hp,sm,Qs,om,am,um,Ys,cm,fm,Am,Zs,vm,xm,km,Em,G0,Dm,bm,Fm,Rm,Gh,Lm,Om,Um,zm,eg,tg,dg,pg,Ig,kg,hc,dc,Mc,_c,ef,tf,rf,sf,lf,uf,vf,xf,Ff,Nf,Uf,zf,Zf,Jf,sh,oh,hh,dh,Ah,vh,Th,Ih,bh,Fh,Rs,Lh,Ms,sd,io,Td,eo,r4,to,s4,Nm,Uh,Wh,md,$g,Hg,e4,t4,T6,fo,pi,Ta,Sr,lm,Ul,G2,cS,qS,WS,Nd,gS,th,fn,qh,L3,G3,q3,W3,H3,Q3,K3,de,Pt,n0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0],t0=[Tr,K5,Zu,Uu,Fu,vu,uu,J2,B2,E2,S2,o2,j1,V1,s1,jl,Ea,_p,d6,p6,Od,Ud,Qd,Xd,Qp,hf,df,pf,mf,Sf,Af,Cf,Tf,If,kf,Df,bf,_f,Pf,Lf,Of,Bf,Vf,Wf,Hf,Qf,Kf,jf,Xf,Dh,Mh,f4,d4,m4,h4,p4,g4,Sa,I6,m6,g6,ho,Rp,Pa,Oa,mm,Fp,yp,Vl,Jl,_1,G1,J1,c2,x2,N2,z2,iu,hu,yu,Mu,qu,ic,X5,u6,Ni,rp,ip,Np,wm,np,xp,kp,Ip,r3,s3,o3,l3,u3,c3,Cd,f3,h3,d3,p3,m3,g3,S3,A3,v3,x3,w3,y3,C3,T3,I3,k3,E3,D3,b3,F3,N3,R3,M3,_3,J3,Tr,Tr],on=[F0,Gm,qm,Wm,Hm,Qm,Km,Ym,jm,Xm,Zm,Jm,ig,ng,rg,sg,og,ag,lg,ug,cg,fg,hg,Ag,xg,Fg,oc,mc,gc,Sc,Ac,vc,Lc,Oc,$c,Bc,Vc,Sh,Ch,Ui,Hi,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0],Et=[r0,$p,Bp,ol,zp,n6,_6,$6,z6,bS,$d,Zp,em,tm,Xp,Gd,qd,Kd,Up,Jd,ep,ym,pc,S4,x4,y4,D4,N4,T4,k4,Pc,A4,w4,C4,F4,R4,I4,E4,cf,ff,gf,wf,yf,Ef,Rf,Mf,$f,Gf,qf,Yf,_g,Pg,Og,o4,u4,l4,c4,vd,xd,yd,zg,Gg,Wg,jg,Xg,Jg,o6,Xe,f0,d0,Ks,js,P5,L5,O5,ai,_n,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0],KS=[oo,ih,lh,oo],Yt=[C0,Pp,Vp,qp,ap,lp,Y6,Ed,Fo,RS,NS,MS,Kp,Jp,Bd,nm,Yd,Pm,Vm,kh,Nh,ad,ud,dd,Hh,Xh,Jh,nd,La,Id,Gs,vS,t3,n3,Oi,kS,CS,LS,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0],YS=[ao,gh,yh,ao],Vi=[Fi,rl,rS,nS,iS,Yp,Lp,Eh,Rh,Fi,Fi,Fi,Fi,Fi,Fi,Fi],jS=[yn,Sg,yg,bg,uc,yn,yn,yn],XS=[Cn,rh,fh,mh,wh,Cn,Cn,Cn],U0=[L0,Q5,Xu,Vu,bu,Au,lu,Z2,$2,F2,v2,u2,Z1,z1,l1,Zl,ba,al,ll,im,Vd,Wd,rm,Gp,jd,tp,Wp,od,ld,cd,jh,Zh,ed,k6,xa,ya,gm,O0,Sm,AS,SS,Ap,Cp,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0],an=[di,Mm,$m,mg,gg,vg,Tg,Eg,Dg,sc,fc,pd,Mg,Lg,rd,Ad,wd,Ug,qg,Yg,Zg,ES,IS,di,di,di,di,di,di,di,di,di],ZS=[$5,i5,t5,e5],JS=[Li,Aa,po,b0,$h,Bh,Vh,fS,dS,hS,Li,Li,Li,Li,Li,Li],_r=[Ki,D2,A2,l2,X1,U1,o1,Xl,Da,hd,Qh,Kh,Yh,id,s6,c6,z4,Z4,Eo,mS,Fn,u5,l5,o5,s5,r5,n5,Ki,Ki,Ki,Ki,Ki],Ln=[B5,sp,r6,Cm,E6,yi,V5,dp,zs,S6,cp,Im,J4,e3,i3,mr],Vo=[lo,U5,aS,z5,lS,G5,En,lo],Ci=[Yi,xc,Uc,Ng,Rg,gd,Sd,Bg,Vg,Qg,Kg,Yi,Yi,Yi,Yi,Yi],eA=[Tn,wg,Cg,ac,cc,Tn,Tn,Tn],On=[H0,$l,Bl,Pl,Ll,sl,Ga,qa,Ka,Ya,Ja,el,ml,gl,xl,wl,Il,kl,Fl,Nl,m1,g1,x1,w1,I1,E1,N1,R1,j6,X6,Z6,jp,Op,_m,Bm,fa,hp,Fa,Na,Ra,Ma,$a,Ba,Va,u1,c1,f1,h1,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0];return{_jpegls_encode:b6,___cxa_can_catch:sS,_free:n0,_jpegls_decode:D6,___cxa_is_pointer_type:oS,_i64Add:$0,_memmove:vn,_i64Subtract:ii,_memset:Jt,_malloc:E0,_memcpy:o0,_bitshift64Lshr:Di,_bitshift64Shl:v0,__GLOBAL__I_000101:Rd,__GLOBAL__sub_I_jpegls_cpp:Ca,__GLOBAL__sub_I_iostream_cpp:Md,runPostSets:c5,_emscripten_replace_memory:ia,stackAlloc:na,stackSave:ra,stackRestore:sa,establishStackSpace:oa,setThrew:aa,setTempRet0:la,getTempRet0:ua,dynCall_iiiiiiii:h5,dynCall_viiiii:d5,dynCall_iiiiiid:p5,dynCall_vi:m5,dynCall_vii:g5,dynCall_iiiiiii:S5,dynCall_ii:A5,dynCall_iiiiiiiiiiii:v5,dynCall_iiii:x5,dynCall_viiiiiiiiiiiiiii:w5,dynCall_viiiiii:y5,dynCall_viiiiiii:C5,dynCall_viiiiiiiiii:T5,dynCall_iii:I5,dynCall_iiiiii:k5,dynCall_diii:E5,dynCall_i:D5,dynCall_iiiii:b5,dynCall_viii:F5,dynCall_v:N5,dynCall_iiiiiiiii:R5,dynCall_iiiiid:M5,dynCall_viiii:_5}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module._jpegls_encode=asm._jpegls_encode,Module.___cxa_can_catch=asm.___cxa_can_catch;var _free=Module._free=asm._free;Module._jpegls_decode=asm._jpegls_decode,Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type;var _i64Add=Module._i64Add=asm._i64Add,_memmove=Module._memmove=asm._memmove,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_memset=Module._memset=asm._memset,_malloc=Module._malloc=asm._malloc,_memcpy=Module._memcpy=asm._memcpy,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory;Module.runPostSets=asm.runPostSets,Module.__GLOBAL__sub_I_iostream_cpp=asm.__GLOBAL__sub_I_iostream_cpp;var _bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,__GLOBAL__sub_I_jpegls_cpp=Module.__GLOBAL__sub_I_jpegls_cpp=asm.__GLOBAL__sub_I_jpegls_cpp,__GLOBAL__I_000101=Module.__GLOBAL__I_000101=asm.__GLOBAL__I_000101,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl;Module.dynCall_iiiiiiii=asm.dynCall_iiiiiiii,Module.dynCall_viiiii=asm.dynCall_viiiii,Module.dynCall_iiiiiid=asm.dynCall_iiiiiid,Module.dynCall_vi=asm.dynCall_vi,Module.dynCall_vii=asm.dynCall_vii,Module.dynCall_iiiiiii=asm.dynCall_iiiiiii,Module.dynCall_ii=asm.dynCall_ii,Module.dynCall_iiiiiiiiiiii=asm.dynCall_iiiiiiiiiiii,Module.dynCall_iiii=asm.dynCall_iiii,Module.dynCall_viiiiiiiiiiiiiii=asm.dynCall_viiiiiiiiiiiiiii,Module.dynCall_viiiiii=asm.dynCall_viiiiii,Module.dynCall_viiiiiii=asm.dynCall_viiiiiii,Module.dynCall_viiiiiiiiii=asm.dynCall_viiiiiiiiii,Module.dynCall_iii=asm.dynCall_iii,Module.dynCall_iiiiii=asm.dynCall_iiiiii,Module.dynCall_diii=asm.dynCall_diii,Module.dynCall_i=asm.dynCall_i,Module.dynCall_iiiii=asm.dynCall_iiiii,Module.dynCall_viii=asm.dynCall_viii,Module.dynCall_v=asm.dynCall_v,Module.dynCall_iiiiiiiii=asm.dynCall_iiiiiiiii,Module.dynCall_iiiiid=asm.dynCall_iiiiid,Module.dynCall_viiii=asm.dynCall_viiii,Runtime.stackAlloc=asm.stackAlloc,Runtime.stackSave=asm.stackSave,Runtime.stackRestore=asm.stackRestore,Runtime.establishStackSpace=asm.establishStackSpace,Runtime.setTempRet0=asm.setTempRet0,Runtime.getTempRet0=asm.getTempRet0;function ExitStatus(u){this.name="ExitStatus",this.message="Program terminated with exit("+u+")",this.status=u}ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;dependenciesFulfilled=function u(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=u)},Module.callMain=Module.callMain=function u(n){assert(runDependencies==0,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called"),n=n||[],ensureInitRuntime();var s=n.length+1;function c(){for(var v=0;v<3;v++)f.push(0)}var f=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];c();for(var g=0;g0||(preRun(),runDependencies>0)||Module.calledRun)return;function n(){Module.calledRun||(Module.calledRun=!0,!ABORT&&(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(u),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),n()},1)):n()}Module.run=Module.run=run;function exit(u,n){if(!(n&&Module.noExitRuntime))throw Module.noExitRuntime||(ABORT=!0,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(u)),ENVIRONMENT_IS_NODE?(process.stdout.once("drain",function(){process.exit(u)}),console.log(" "),setTimeout(function(){process.exit(u)},500)):ENVIRONMENT_IS_SHELL&&typeof quit=="function"&&quit(u),new ExitStatus(u)}Module.exit=Module.exit=exit;var abortDecorators=[];function abort(u){u!==void 0?(Module.print(u),Module.printErr(u),u=JSON.stringify(u)):u="",ABORT=!0;var n=` -If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,s="abort("+u+") at "+stackTrace()+n;throw abortDecorators&&abortDecorators.forEach(function(c){s=c(s,u)}),s}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),run(),Module};module.exports&&(module.exports=CharLS)}(charLSDynamicMemoryBrowser)),charLSDynamicMemoryBrowser.exports}var hasRequiredJpegLs;function requireJpegLs(){return hasRequiredJpegLs||(hasRequiredJpegLs=1,function(u){var n=n||(typeof commonjsRequire<"u"?requireCharLSDynamicMemoryBrowser():null),s=function(){var c;function f(){}f.prototype={decodeJPEGLS:function(y,T){return v(y,T)}};function g(y,T){var I=c._malloc(y.length);c.writeArrayToMemory(y,I);var S=c._malloc(4),k=c._malloc(4),e=c._malloc(4),N=c._malloc(4),M=c._malloc(4),O=c._malloc(4),z=c._malloc(4),B=c._malloc(4),V=c._malloc(4),b=c.ccall("jpegls_decode","number",["number","number","number","number","number","number","number","number","number","number","number"],[I,y.length,S,k,e,N,M,O,B,z,V]),W={result:b,width:c.getValue(e,"i32"),height:c.getValue(N,"i32"),bitsPerSample:c.getValue(M,"i32"),stride:c.getValue(O,"i32"),components:c.getValue(B,"i32"),allowedLossyError:c.getValue(z,"i32"),interleaveMode:c.getValue(V,"i32"),pixelData:void 0},q=c.getValue(S,"*");return W.bitsPerSample<=8?(W.pixelData=new Uint8Array(W.width*W.height*W.components),W.pixelData.set(new Uint8Array(c.HEAP8.buffer,q,W.pixelData.length))):T?(W.pixelData=new Int16Array(W.width*W.height*W.components),W.pixelData.set(new Int16Array(c.HEAP16.buffer,q,W.pixelData.length))):(W.pixelData=new Uint16Array(W.width*W.height*W.components),W.pixelData.set(new Uint16Array(c.HEAP16.buffer,q,W.pixelData.length))),c._free(I),c._free(q),c._free(S),c._free(k),c._free(e),c._free(N),c._free(M),c._free(O),c._free(B),c._free(V),W}function A(){if(typeof n>"u")throw"No JPEG-LS decoder loaded";if(!c&&(c=n(),!c||!c._jpegls_decode))throw"JPEG-LS failed to initialize"}function v(y,T){A();var I=g(y,T);if(I.result!==0&&I.result!==6)throw"JPEG-LS decoder failed to decode frame (error code "+I.result+")";var S={};return S.columns=I.width,S.rows=I.height,S.pixelData=I.pixelData,S}return f}();u.exports&&(u.exports=s)}(jpegLs)),jpegLs.exports}var parser={exports:{}},pako={},deflate$1={},deflate={},trees={},hasRequiredTrees;function requireTrees(){if(hasRequiredTrees)return trees;hasRequiredTrees=1;const u=4,n=0,s=1,c=2;function f(ie){let Be=ie.length;for(;--Be>=0;)ie[Be]=0}const g=0,A=1,v=2,y=3,T=258,I=29,S=256,k=S+1+I,e=30,N=19,M=2*k+1,O=15,z=16,B=7,V=256,b=16,W=17,q=18,Y=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),X=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Q=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),m=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z=512,ee=new Array((k+2)*2);f(ee);const oe=new Array(e*2);f(oe);const fe=new Array(Z);f(fe);const me=new Array(T-y+1);f(me);const pe=new Array(I);f(pe);const Se=new Array(e);f(Se);function xe(ie,Be,st,Ye,ht){this.static_tree=ie,this.extra_bits=Be,this.extra_base=st,this.elems=Ye,this.max_length=ht,this.has_stree=ie&&ie.length}let we,Fe,De;function Ze(ie,Be){this.dyn_tree=ie,this.max_code=0,this.stat_desc=Be}const nt=ie=>ie<256?fe[ie]:fe[256+(ie>>>7)],Ue=(ie,Be)=>{ie.pending_buf[ie.pending++]=Be&255,ie.pending_buf[ie.pending++]=Be>>>8&255},ye=(ie,Be,st)=>{ie.bi_valid>z-st?(ie.bi_buf|=Be<>z-ie.bi_valid,ie.bi_valid+=st-z):(ie.bi_buf|=Be<{ye(ie,st[Be*2],st[Be*2+1])},ft=(ie,Be)=>{let st=0;do st|=ie&1,ie>>>=1,st<<=1;while(--Be>0);return st>>>1},Tt=ie=>{ie.bi_valid===16?(Ue(ie,ie.bi_buf),ie.bi_buf=0,ie.bi_valid=0):ie.bi_valid>=8&&(ie.pending_buf[ie.pending++]=ie.bi_buf&255,ie.bi_buf>>=8,ie.bi_valid-=8)},Lt=(ie,Be)=>{const st=Be.dyn_tree,Ye=Be.max_code,ht=Be.stat_desc.static_tree,vt=Be.stat_desc.has_stree,Me=Be.stat_desc.extra_bits,je=Be.stat_desc.extra_base,ue=Be.stat_desc.max_length;let Ae,Vt,ge,Ut,Ve,Zt,ot=0;for(Ut=0;Ut<=O;Ut++)ie.bl_count[Ut]=0;for(st[ie.heap[ie.heap_max]*2+1]=0,Ae=ie.heap_max+1;Aeue&&(Ut=ue,ot++),st[Vt*2+1]=Ut,!(Vt>Ye)&&(ie.bl_count[Ut]++,Ve=0,Vt>=je&&(Ve=Me[Vt-je]),Zt=st[Vt*2],ie.opt_len+=Zt*(Ut+Ve),vt&&(ie.static_len+=Zt*(ht[Vt*2+1]+Ve)));if(ot!==0){do{for(Ut=ue-1;ie.bl_count[Ut]===0;)Ut--;ie.bl_count[Ut]--,ie.bl_count[Ut+1]+=2,ie.bl_count[ue]--,ot-=2}while(ot>0);for(Ut=ue;Ut!==0;Ut--)for(Vt=ie.bl_count[Ut];Vt!==0;)ge=ie.heap[--Ae],!(ge>Ye)&&(st[ge*2+1]!==Ut&&(ie.opt_len+=(Ut-st[ge*2+1])*st[ge*2],st[ge*2+1]=Ut),Vt--)}},Ot=(ie,Be,st)=>{const Ye=new Array(O+1);let ht=0,vt,Me;for(vt=1;vt<=O;vt++)ht=ht+st[vt-1]<<1,Ye[vt]=ht;for(Me=0;Me<=Be;Me++){let je=ie[Me*2+1];je!==0&&(ie[Me*2]=ft(Ye[je]++,je))}},Ft=()=>{let ie,Be,st,Ye,ht;const vt=new Array(O+1);for(st=0,Ye=0;Ye>=7;Ye{let Be;for(Be=0;Be{ie.bi_valid>8?Ue(ie,ie.bi_buf):ie.bi_valid>0&&(ie.pending_buf[ie.pending++]=ie.bi_buf),ie.bi_buf=0,ie.bi_valid=0},Re=(ie,Be,st,Ye)=>{const ht=Be*2,vt=st*2;return ie[ht]{const Ye=ie.heap[st];let ht=st<<1;for(;ht<=ie.heap_len&&(ht{let Ye,ht,vt=0,Me,je;if(ie.sym_next!==0)do Ye=ie.pending_buf[ie.sym_buf+vt++]&255,Ye+=(ie.pending_buf[ie.sym_buf+vt++]&255)<<8,ht=ie.pending_buf[ie.sym_buf+vt++],Ye===0?at(ie,ht,Be):(Me=me[ht],at(ie,Me+S+1,Be),je=Y[Me],je!==0&&(ht-=pe[Me],ye(ie,ht,je)),Ye--,Me=nt(Ye),at(ie,Me,st),je=X[Me],je!==0&&(Ye-=Se[Me],ye(ie,Ye,je)));while(vt{const st=Be.dyn_tree,Ye=Be.stat_desc.static_tree,ht=Be.stat_desc.has_stree,vt=Be.stat_desc.elems;let Me,je,ue=-1,Ae;for(ie.heap_len=0,ie.heap_max=M,Me=0;Me>1;Me>=1;Me--)Qe(ie,st,Me);Ae=vt;do Me=ie.heap[1],ie.heap[1]=ie.heap[ie.heap_len--],Qe(ie,st,1),je=ie.heap[1],ie.heap[--ie.heap_max]=Me,ie.heap[--ie.heap_max]=je,st[Ae*2]=st[Me*2]+st[je*2],ie.depth[Ae]=(ie.depth[Me]>=ie.depth[je]?ie.depth[Me]:ie.depth[je])+1,st[Me*2+1]=st[je*2+1]=Ae,ie.heap[1]=Ae++,Qe(ie,st,1);while(ie.heap_len>=2);ie.heap[--ie.heap_max]=ie.heap[1],Lt(ie,Be),Ot(st,ue,ie.bl_count)},lt=(ie,Be,st)=>{let Ye,ht=-1,vt,Me=Be[0*2+1],je=0,ue=7,Ae=4;for(Me===0&&(ue=138,Ae=3),Be[(st+1)*2+1]=65535,Ye=0;Ye<=st;Ye++)vt=Me,Me=Be[(Ye+1)*2+1],!(++je{let Ye,ht=-1,vt,Me=Be[0*2+1],je=0,ue=7,Ae=4;for(Me===0&&(ue=138,Ae=3),Ye=0;Ye<=st;Ye++)if(vt=Me,Me=Be[(Ye+1)*2+1],!(++je{let Be;for(lt(ie,ie.dyn_ltree,ie.l_desc.max_code),lt(ie,ie.dyn_dtree,ie.d_desc.max_code),be(ie,ie.bl_desc),Be=N-1;Be>=3&&ie.bl_tree[m[Be]*2+1]===0;Be--);return ie.opt_len+=3*(Be+1)+5+5+4,Be},Ge=(ie,Be,st,Ye)=>{let ht;for(ye(ie,Be-257,5),ye(ie,st-1,5),ye(ie,Ye-4,4),ht=0;ht{let Be=4093624447,st;for(st=0;st<=31;st++,Be>>>=1)if(Be&1&&ie.dyn_ltree[st*2]!==0)return n;if(ie.dyn_ltree[9*2]!==0||ie.dyn_ltree[10*2]!==0||ie.dyn_ltree[13*2]!==0)return s;for(st=32;st{Je||(Ft(),Je=!0),ie.l_desc=new Ze(ie.dyn_ltree,we),ie.d_desc=new Ze(ie.dyn_dtree,Fe),ie.bl_desc=new Ze(ie.bl_tree,De),ie.bi_buf=0,ie.bi_valid=0,Mt(ie)},qe=(ie,Be,st,Ye)=>{ye(ie,(g<<1)+(Ye?1:0),3),Ke(ie),Ue(ie,st),Ue(ie,~st),st&&ie.pending_buf.set(ie.window.subarray(Be,Be+st),ie.pending),ie.pending+=st},xt=ie=>{ye(ie,A<<1,3),at(ie,V,ee),Tt(ie)},He=(ie,Be,st,Ye)=>{let ht,vt,Me=0;ie.level>0?(ie.strm.data_type===c&&(ie.strm.data_type=_e(ie)),be(ie,ie.l_desc),be(ie,ie.d_desc),Me=Le(ie),ht=ie.opt_len+3+7>>>3,vt=ie.static_len+3+7>>>3,vt<=ht&&(ht=vt)):ht=vt=st+5,st+4<=ht&&Be!==-1?qe(ie,Be,st,Ye):ie.strategy===u||vt===ht?(ye(ie,(A<<1)+(Ye?1:0),3),Ie(ie,ee,oe)):(ye(ie,(v<<1)+(Ye?1:0),3),Ge(ie,ie.l_desc.max_code+1,ie.d_desc.max_code+1,Me+1),Ie(ie,ie.dyn_ltree,ie.dyn_dtree)),Mt(ie),Ye&&Ke(ie)},rt=(ie,Be,st)=>(ie.pending_buf[ie.sym_buf+ie.sym_next++]=Be,ie.pending_buf[ie.sym_buf+ie.sym_next++]=Be>>8,ie.pending_buf[ie.sym_buf+ie.sym_next++]=st,Be===0?ie.dyn_ltree[st*2]++:(ie.matches++,Be--,ie.dyn_ltree[(me[st]+S+1)*2]++,ie.dyn_dtree[nt(Be)*2]++),ie.sym_next===ie.sym_end);return trees._tr_init=We,trees._tr_stored_block=qe,trees._tr_flush_block=He,trees._tr_tally=rt,trees._tr_align=xt,trees}var adler32_1,hasRequiredAdler32;function requireAdler32(){return hasRequiredAdler32||(hasRequiredAdler32=1,adler32_1=(n,s,c,f)=>{let g=n&65535|0,A=n>>>16&65535|0,v=0;for(;c!==0;){v=c>2e3?2e3:c,c-=v;do g=g+s[f++]|0,A=A+g|0;while(--v);g%=65521,A%=65521}return g|A<<16|0}),adler32_1}var crc32_1,hasRequiredCrc32;function requireCrc32(){if(hasRequiredCrc32)return crc32_1;hasRequiredCrc32=1;const u=()=>{let c,f=[];for(var g=0;g<256;g++){c=g;for(var A=0;A<8;A++)c=c&1?3988292384^c>>>1:c>>>1;f[g]=c}return f},n=new Uint32Array(u());return crc32_1=(c,f,g,A)=>{const v=n,y=A+g;c^=-1;for(let T=A;T>>8^v[(c^f[T])&255];return c^-1},crc32_1}var messages,hasRequiredMessages;function requireMessages(){return hasRequiredMessages||(hasRequiredMessages=1,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),messages}var constants,hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,constants={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),constants}var hasRequiredDeflate$1;function requireDeflate$1(){if(hasRequiredDeflate$1)return deflate;hasRequiredDeflate$1=1;const{_tr_init:u,_tr_stored_block:n,_tr_flush_block:s,_tr_tally:c,_tr_align:f}=requireTrees(),g=requireAdler32(),A=requireCrc32(),v=requireMessages(),{Z_NO_FLUSH:y,Z_PARTIAL_FLUSH:T,Z_FULL_FLUSH:I,Z_FINISH:S,Z_BLOCK:k,Z_OK:e,Z_STREAM_END:N,Z_STREAM_ERROR:M,Z_DATA_ERROR:O,Z_BUF_ERROR:z,Z_DEFAULT_COMPRESSION:B,Z_FILTERED:V,Z_HUFFMAN_ONLY:b,Z_RLE:W,Z_FIXED:q,Z_DEFAULT_STRATEGY:Y,Z_UNKNOWN:X,Z_DEFLATED:Q}=requireConstants(),m=9,Z=15,ee=8,me=256+1+29,pe=30,Se=19,xe=2*me+1,we=15,Fe=3,De=258,Ze=De+Fe+1,nt=32,Ue=42,ye=57,at=69,ft=73,Tt=91,Lt=103,Ot=113,Ft=666,Mt=1,Ke=2,Re=3,Qe=4,Ie=3,be=(se,ut)=>(se.msg=v[ut],ut),lt=se=>se*2-(se>4?9:0),ze=se=>{let ut=se.length;for(;--ut>=0;)se[ut]=0},Le=se=>{let ut,Ce,Pe,ve=se.w_size;ut=se.hash_size,Pe=ut;do Ce=se.head[--Pe],se.head[Pe]=Ce>=ve?Ce-ve:0;while(--ut);ut=ve,Pe=ut;do Ce=se.prev[--Pe],se.prev[Pe]=Ce>=ve?Ce-ve:0;while(--ut)};let _e=(se,ut,Ce)=>(ut<{const ut=se.state;let Ce=ut.pending;Ce>se.avail_out&&(Ce=se.avail_out),Ce!==0&&(se.output.set(ut.pending_buf.subarray(ut.pending_out,ut.pending_out+Ce),se.next_out),se.next_out+=Ce,ut.pending_out+=Ce,se.total_out+=Ce,se.avail_out-=Ce,ut.pending-=Ce,ut.pending===0&&(ut.pending_out=0))},We=(se,ut)=>{s(se,se.block_start>=0?se.block_start:-1,se.strstart-se.block_start,ut),se.block_start=se.strstart,Je(se.strm)},qe=(se,ut)=>{se.pending_buf[se.pending++]=ut},xt=(se,ut)=>{se.pending_buf[se.pending++]=ut>>>8&255,se.pending_buf[se.pending++]=ut&255},He=(se,ut,Ce,Pe)=>{let ve=se.avail_in;return ve>Pe&&(ve=Pe),ve===0?0:(se.avail_in-=ve,ut.set(se.input.subarray(se.next_in,se.next_in+ve),Ce),se.state.wrap===1?se.adler=g(se.adler,ut,ve,Ce):se.state.wrap===2&&(se.adler=A(se.adler,ut,ve,Ce)),se.next_in+=ve,se.total_in+=ve,ve)},rt=(se,ut)=>{let Ce=se.max_chain_length,Pe=se.strstart,ve,bt,Xt=se.prev_length,Wt=se.nice_match;const $e=se.strstart>se.w_size-Ze?se.strstart-(se.w_size-Ze):0,p0=se.window,R0=se.w_mask,Q0=se.prev,M0=se.strstart+De;let ni=p0[Pe+Xt-1],St=p0[Pe+Xt];se.prev_length>=se.good_match&&(Ce>>=2),Wt>se.lookahead&&(Wt=se.lookahead);do if(ve=ut,!(p0[ve+Xt]!==St||p0[ve+Xt-1]!==ni||p0[ve]!==p0[Pe]||p0[++ve]!==p0[Pe+1])){Pe+=2,ve++;do;while(p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&PeXt){if(se.match_start=ut,Xt=bt,bt>=Wt)break;ni=p0[Pe+Xt-1],St=p0[Pe+Xt]}}while((ut=Q0[ut&R0])>$e&&--Ce!==0);return Xt<=se.lookahead?Xt:se.lookahead},ie=se=>{const ut=se.w_size;let Ce,Pe,ve;do{if(Pe=se.window_size-se.lookahead-se.strstart,se.strstart>=ut+(ut-Ze)&&(se.window.set(se.window.subarray(ut,ut+ut-Pe),0),se.match_start-=ut,se.strstart-=ut,se.block_start-=ut,se.insert>se.strstart&&(se.insert=se.strstart),Le(se),Pe+=ut),se.strm.avail_in===0)break;if(Ce=He(se.strm,se.window,se.strstart+se.lookahead,Pe),se.lookahead+=Ce,se.lookahead+se.insert>=Fe)for(ve=se.strstart-se.insert,se.ins_h=se.window[ve],se.ins_h=_e(se,se.ins_h,se.window[ve+1]);se.insert&&(se.ins_h=_e(se,se.ins_h,se.window[ve+Fe-1]),se.prev[ve&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=ve,ve++,se.insert--,!(se.lookahead+se.insert{let Ce=se.pending_buf_size-5>se.w_size?se.w_size:se.pending_buf_size-5,Pe,ve,bt,Xt=0,Wt=se.strm.avail_in;do{if(Pe=65535,bt=se.bi_valid+42>>3,se.strm.avail_outve+se.strm.avail_in&&(Pe=ve+se.strm.avail_in),Pe>bt&&(Pe=bt),Pe>8,se.pending_buf[se.pending-2]=~Pe,se.pending_buf[se.pending-1]=~Pe>>8,Je(se.strm),ve&&(ve>Pe&&(ve=Pe),se.strm.output.set(se.window.subarray(se.block_start,se.block_start+ve),se.strm.next_out),se.strm.next_out+=ve,se.strm.avail_out-=ve,se.strm.total_out+=ve,se.block_start+=ve,Pe-=ve),Pe&&(He(se.strm,se.strm.output,se.strm.next_out,Pe),se.strm.next_out+=Pe,se.strm.avail_out-=Pe,se.strm.total_out+=Pe)}while(Xt===0);return Wt-=se.strm.avail_in,Wt&&(Wt>=se.w_size?(se.matches=2,se.window.set(se.strm.input.subarray(se.strm.next_in-se.w_size,se.strm.next_in),0),se.strstart=se.w_size,se.insert=se.strstart):(se.window_size-se.strstart<=Wt&&(se.strstart-=se.w_size,se.window.set(se.window.subarray(se.w_size,se.w_size+se.strstart),0),se.matches<2&&se.matches++,se.insert>se.strstart&&(se.insert=se.strstart)),se.window.set(se.strm.input.subarray(se.strm.next_in-Wt,se.strm.next_in),se.strstart),se.strstart+=Wt,se.insert+=Wt>se.w_size-se.insert?se.w_size-se.insert:Wt),se.block_start=se.strstart),se.high_waterbt&&se.block_start>=se.w_size&&(se.block_start-=se.w_size,se.strstart-=se.w_size,se.window.set(se.window.subarray(se.w_size,se.w_size+se.strstart),0),se.matches<2&&se.matches++,bt+=se.w_size,se.insert>se.strstart&&(se.insert=se.strstart)),bt>se.strm.avail_in&&(bt=se.strm.avail_in),bt&&(He(se.strm,se.window,se.strstart,bt),se.strstart+=bt,se.insert+=bt>se.w_size-se.insert?se.w_size-se.insert:bt),se.high_water>3,bt=se.pending_buf_size-bt>65535?65535:se.pending_buf_size-bt,Ce=bt>se.w_size?se.w_size:bt,ve=se.strstart-se.block_start,(ve>=Ce||(ve||ut===S)&&ut!==y&&se.strm.avail_in===0&&ve<=bt)&&(Pe=ve>bt?bt:ve,Xt=ut===S&&se.strm.avail_in===0&&Pe===ve?1:0,n(se,se.block_start,Pe,Xt),se.block_start+=Pe,Je(se.strm)),Xt?Re:Mt)},st=(se,ut)=>{let Ce,Pe;for(;;){if(se.lookahead=Fe&&(se.ins_h=_e(se,se.ins_h,se.window[se.strstart+Fe-1]),Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ce!==0&&se.strstart-Ce<=se.w_size-Ze&&(se.match_length=rt(se,Ce)),se.match_length>=Fe)if(Pe=c(se,se.strstart-se.match_start,se.match_length-Fe),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=Fe){se.match_length--;do se.strstart++,se.ins_h=_e(se,se.ins_h,se.window[se.strstart+Fe-1]),Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart;while(--se.match_length!==0);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=_e(se,se.ins_h,se.window[se.strstart+1]);else Pe=c(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(Pe&&(We(se,!1),se.strm.avail_out===0))return Mt}return se.insert=se.strstart{let Ce,Pe,ve;for(;;){if(se.lookahead=Fe&&(se.ins_h=_e(se,se.ins_h,se.window[se.strstart+Fe-1]),Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=Fe-1,Ce!==0&&se.prev_length4096)&&(se.match_length=Fe-1)),se.prev_length>=Fe&&se.match_length<=se.prev_length){ve=se.strstart+se.lookahead-Fe,Pe=c(se,se.strstart-1-se.prev_match,se.prev_length-Fe),se.lookahead-=se.prev_length-1,se.prev_length-=2;do++se.strstart<=ve&&(se.ins_h=_e(se,se.ins_h,se.window[se.strstart+Fe-1]),Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart);while(--se.prev_length!==0);if(se.match_available=0,se.match_length=Fe-1,se.strstart++,Pe&&(We(se,!1),se.strm.avail_out===0))return Mt}else if(se.match_available){if(Pe=c(se,0,se.window[se.strstart-1]),Pe&&We(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return Mt}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(Pe=c(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart{let Ce,Pe,ve,bt;const Xt=se.window;for(;;){if(se.lookahead<=De){if(ie(se),se.lookahead<=De&&ut===y)return Mt;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=Fe&&se.strstart>0&&(ve=se.strstart-1,Pe=Xt[ve],Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve])){bt=se.strstart+De;do;while(Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&vese.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=Fe?(Ce=c(se,1,se.match_length-Fe),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(Ce=c(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),Ce&&(We(se,!1),se.strm.avail_out===0))return Mt}return se.insert=0,ut===S?(We(se,!0),se.strm.avail_out===0?Re:Qe):se.sym_next&&(We(se,!1),se.strm.avail_out===0)?Mt:Ke},vt=(se,ut)=>{let Ce;for(;;){if(se.lookahead===0&&(ie(se),se.lookahead===0)){if(ut===y)return Mt;break}if(se.match_length=0,Ce=c(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,Ce&&(We(se,!1),se.strm.avail_out===0))return Mt}return se.insert=0,ut===S?(We(se,!0),se.strm.avail_out===0?Re:Qe):se.sym_next&&(We(se,!1),se.strm.avail_out===0)?Mt:Ke};function Me(se,ut,Ce,Pe,ve){this.good_length=se,this.max_lazy=ut,this.nice_length=Ce,this.max_chain=Pe,this.func=ve}const je=[new Me(0,0,0,0,Be),new Me(4,4,8,4,st),new Me(4,5,16,8,st),new Me(4,6,32,32,st),new Me(4,4,16,16,Ye),new Me(8,16,32,32,Ye),new Me(8,16,128,128,Ye),new Me(8,32,128,256,Ye),new Me(32,128,258,1024,Ye),new Me(32,258,258,4096,Ye)],ue=se=>{se.window_size=2*se.w_size,ze(se.head),se.max_lazy_match=je[se.level].max_lazy,se.good_match=je[se.level].good_length,se.nice_match=je[se.level].nice_length,se.max_chain_length=je[se.level].max_chain,se.strstart=0,se.block_start=0,se.lookahead=0,se.insert=0,se.match_length=se.prev_length=Fe-1,se.match_available=0,se.ins_h=0};function Ae(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Q,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(xe*2),this.dyn_dtree=new Uint16Array((2*pe+1)*2),this.bl_tree=new Uint16Array((2*Se+1)*2),ze(this.dyn_ltree),ze(this.dyn_dtree),ze(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(we+1),this.heap=new Uint16Array(2*me+1),ze(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*me+1),ze(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Vt=se=>{if(!se)return 1;const ut=se.state;return!ut||ut.strm!==se||ut.status!==Ue&&ut.status!==ye&&ut.status!==at&&ut.status!==ft&&ut.status!==Tt&&ut.status!==Lt&&ut.status!==Ot&&ut.status!==Ft?1:0},ge=se=>{if(Vt(se))return be(se,M);se.total_in=se.total_out=0,se.data_type=X;const ut=se.state;return ut.pending=0,ut.pending_out=0,ut.wrap<0&&(ut.wrap=-ut.wrap),ut.status=ut.wrap===2?ye:ut.wrap?Ue:Ot,se.adler=ut.wrap===2?0:1,ut.last_flush=-2,u(ut),e},Ut=se=>{const ut=ge(se);return ut===e&&ue(se.state),ut},Ve=(se,ut)=>Vt(se)||se.state.wrap!==2?M:(se.state.gzhead=ut,e),Zt=(se,ut,Ce,Pe,ve,bt)=>{if(!se)return M;let Xt=1;if(ut===B&&(ut=6),Pe<0?(Xt=0,Pe=-Pe):Pe>15&&(Xt=2,Pe-=16),ve<1||ve>m||Ce!==Q||Pe<8||Pe>15||ut<0||ut>9||bt<0||bt>q||Pe===8&&Xt!==1)return be(se,M);Pe===8&&(Pe=9);const Wt=new Ae;return se.state=Wt,Wt.strm=se,Wt.status=Ue,Wt.wrap=Xt,Wt.gzhead=null,Wt.w_bits=Pe,Wt.w_size=1<Zt(se,ut,Q,Z,ee,Y),dt=(se,ut)=>{if(Vt(se)||ut>k||ut<0)return se?be(se,M):M;const Ce=se.state;if(!se.output||se.avail_in!==0&&!se.input||Ce.status===Ft&&ut!==S)return be(se,se.avail_out===0?z:M);const Pe=Ce.last_flush;if(Ce.last_flush=ut,Ce.pending!==0){if(Je(se),se.avail_out===0)return Ce.last_flush=-1,e}else if(se.avail_in===0&<(ut)<=lt(Pe)&&ut!==S)return be(se,z);if(Ce.status===Ft&&se.avail_in!==0)return be(se,z);if(Ce.status===Ue&&Ce.wrap===0&&(Ce.status=Ot),Ce.status===Ue){let ve=Q+(Ce.w_bits-8<<4)<<8,bt=-1;if(Ce.strategy>=b||Ce.level<2?bt=0:Ce.level<6?bt=1:Ce.level===6?bt=2:bt=3,ve|=bt<<6,Ce.strstart!==0&&(ve|=nt),ve+=31-ve%31,xt(Ce,ve),Ce.strstart!==0&&(xt(Ce,se.adler>>>16),xt(Ce,se.adler&65535)),se.adler=1,Ce.status=Ot,Je(se),Ce.pending!==0)return Ce.last_flush=-1,e}if(Ce.status===ye){if(se.adler=0,qe(Ce,31),qe(Ce,139),qe(Ce,8),Ce.gzhead)qe(Ce,(Ce.gzhead.text?1:0)+(Ce.gzhead.hcrc?2:0)+(Ce.gzhead.extra?4:0)+(Ce.gzhead.name?8:0)+(Ce.gzhead.comment?16:0)),qe(Ce,Ce.gzhead.time&255),qe(Ce,Ce.gzhead.time>>8&255),qe(Ce,Ce.gzhead.time>>16&255),qe(Ce,Ce.gzhead.time>>24&255),qe(Ce,Ce.level===9?2:Ce.strategy>=b||Ce.level<2?4:0),qe(Ce,Ce.gzhead.os&255),Ce.gzhead.extra&&Ce.gzhead.extra.length&&(qe(Ce,Ce.gzhead.extra.length&255),qe(Ce,Ce.gzhead.extra.length>>8&255)),Ce.gzhead.hcrc&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending,0)),Ce.gzindex=0,Ce.status=at;else if(qe(Ce,0),qe(Ce,0),qe(Ce,0),qe(Ce,0),qe(Ce,0),qe(Ce,Ce.level===9?2:Ce.strategy>=b||Ce.level<2?4:0),qe(Ce,Ie),Ce.status=Ot,Je(se),Ce.pending!==0)return Ce.last_flush=-1,e}if(Ce.status===at){if(Ce.gzhead.extra){let ve=Ce.pending,bt=(Ce.gzhead.extra.length&65535)-Ce.gzindex;for(;Ce.pending+bt>Ce.pending_buf_size;){let Wt=Ce.pending_buf_size-Ce.pending;if(Ce.pending_buf.set(Ce.gzhead.extra.subarray(Ce.gzindex,Ce.gzindex+Wt),Ce.pending),Ce.pending=Ce.pending_buf_size,Ce.gzhead.hcrc&&Ce.pending>ve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Ce.gzindex+=Wt,Je(se),Ce.pending!==0)return Ce.last_flush=-1,e;ve=0,bt-=Wt}let Xt=new Uint8Array(Ce.gzhead.extra);Ce.pending_buf.set(Xt.subarray(Ce.gzindex,Ce.gzindex+bt),Ce.pending),Ce.pending+=bt,Ce.gzhead.hcrc&&Ce.pending>ve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Ce.gzindex=0}Ce.status=ft}if(Ce.status===ft){if(Ce.gzhead.name){let ve=Ce.pending,bt;do{if(Ce.pending===Ce.pending_buf_size){if(Ce.gzhead.hcrc&&Ce.pending>ve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Je(se),Ce.pending!==0)return Ce.last_flush=-1,e;ve=0}Ce.gzindexve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Ce.gzindex=0}Ce.status=Tt}if(Ce.status===Tt){if(Ce.gzhead.comment){let ve=Ce.pending,bt;do{if(Ce.pending===Ce.pending_buf_size){if(Ce.gzhead.hcrc&&Ce.pending>ve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Je(se),Ce.pending!==0)return Ce.last_flush=-1,e;ve=0}Ce.gzindexve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve))}Ce.status=Lt}if(Ce.status===Lt){if(Ce.gzhead.hcrc){if(Ce.pending+2>Ce.pending_buf_size&&(Je(se),Ce.pending!==0))return Ce.last_flush=-1,e;qe(Ce,se.adler&255),qe(Ce,se.adler>>8&255),se.adler=0}if(Ce.status=Ot,Je(se),Ce.pending!==0)return Ce.last_flush=-1,e}if(se.avail_in!==0||Ce.lookahead!==0||ut!==y&&Ce.status!==Ft){let ve=Ce.level===0?Be(Ce,ut):Ce.strategy===b?vt(Ce,ut):Ce.strategy===W?ht(Ce,ut):je[Ce.level].func(Ce,ut);if((ve===Re||ve===Qe)&&(Ce.status=Ft),ve===Mt||ve===Re)return se.avail_out===0&&(Ce.last_flush=-1),e;if(ve===Ke&&(ut===T?f(Ce):ut!==k&&(n(Ce,0,0,!1),ut===I&&(ze(Ce.head),Ce.lookahead===0&&(Ce.strstart=0,Ce.block_start=0,Ce.insert=0))),Je(se),se.avail_out===0))return Ce.last_flush=-1,e}return ut!==S?e:Ce.wrap<=0?N:(Ce.wrap===2?(qe(Ce,se.adler&255),qe(Ce,se.adler>>8&255),qe(Ce,se.adler>>16&255),qe(Ce,se.adler>>24&255),qe(Ce,se.total_in&255),qe(Ce,se.total_in>>8&255),qe(Ce,se.total_in>>16&255),qe(Ce,se.total_in>>24&255)):(xt(Ce,se.adler>>>16),xt(Ce,se.adler&65535)),Je(se),Ce.wrap>0&&(Ce.wrap=-Ce.wrap),Ce.pending!==0?e:N)},I0=se=>{if(Vt(se))return M;const ut=se.state.status;return se.state=null,ut===Ot?be(se,O):e},Ne=(se,ut)=>{let Ce=ut.length;if(Vt(se))return M;const Pe=se.state,ve=Pe.wrap;if(ve===2||ve===1&&Pe.status!==Ue||Pe.lookahead)return M;if(ve===1&&(se.adler=g(se.adler,ut,Ce,0)),Pe.wrap=0,Ce>=Pe.w_size){ve===0&&(ze(Pe.head),Pe.strstart=0,Pe.block_start=0,Pe.insert=0);let $e=new Uint8Array(Pe.w_size);$e.set(ut.subarray(Ce-Pe.w_size,Ce),0),ut=$e,Ce=Pe.w_size}const bt=se.avail_in,Xt=se.next_in,Wt=se.input;for(se.avail_in=Ce,se.next_in=0,se.input=ut,ie(Pe);Pe.lookahead>=Fe;){let $e=Pe.strstart,p0=Pe.lookahead-(Fe-1);do Pe.ins_h=_e(Pe,Pe.ins_h,Pe.window[$e+Fe-1]),Pe.prev[$e&Pe.w_mask]=Pe.head[Pe.ins_h],Pe.head[Pe.ins_h]=$e,$e++;while(--p0);Pe.strstart=$e,Pe.lookahead=Fe-1,ie(Pe)}return Pe.strstart+=Pe.lookahead,Pe.block_start=Pe.strstart,Pe.insert=Pe.lookahead,Pe.lookahead=0,Pe.match_length=Pe.prev_length=Fe-1,Pe.match_available=0,se.next_in=Xt,se.input=Wt,se.avail_in=bt,Pe.wrap=ve,e};return deflate.deflateInit=ot,deflate.deflateInit2=Zt,deflate.deflateReset=Ut,deflate.deflateResetKeep=ge,deflate.deflateSetHeader=Ve,deflate.deflate=dt,deflate.deflateEnd=I0,deflate.deflateSetDictionary=Ne,deflate.deflateInfo="pako deflate (from Nodeca project)",deflate}var common={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;const u=(n,s)=>Object.prototype.hasOwnProperty.call(n,s);return common.assign=function(n){const s=Array.prototype.slice.call(arguments,1);for(;s.length;){const c=s.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(const f in c)u(c,f)&&(n[f]=c[f])}}return n},common.flattenChunks=n=>{let s=0;for(let f=0,g=n.length;f=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;n[254]=n[254]=1,strings.string2buf=c=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(c);let f,g,A,v,y,T=c.length,I=0;for(v=0;v>>6,f[y++]=128|g&63):g<65536?(f[y++]=224|g>>>12,f[y++]=128|g>>>6&63,f[y++]=128|g&63):(f[y++]=240|g>>>18,f[y++]=128|g>>>12&63,f[y++]=128|g>>>6&63,f[y++]=128|g&63);return f};const s=(c,f)=>{if(f<65534&&c.subarray&&u)return String.fromCharCode.apply(null,c.length===f?c:c.subarray(0,f));let g="";for(let A=0;A{const g=f||c.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(c.subarray(0,f));let A,v;const y=new Array(g*2);for(v=0,A=0;A4){y[v++]=65533,A+=I-1;continue}for(T&=I===2?31:I===3?15:7;I>1&&A1){y[v++]=65533;continue}T<65536?y[v++]=T:(T-=65536,y[v++]=55296|T>>10&1023,y[v++]=56320|T&1023)}return s(y,v)},strings.utf8border=(c,f)=>{f=f||c.length,f>c.length&&(f=c.length);let g=f-1;for(;g>=0&&(c[g]&192)===128;)g--;return g<0||g===0?f:g+n[c[g]]>f?g:f},strings}var zstream,hasRequiredZstream;function requireZstream(){if(hasRequiredZstream)return zstream;hasRequiredZstream=1;function u(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return zstream=u,zstream}var hasRequiredDeflate;function requireDeflate(){if(hasRequiredDeflate)return deflate$1;hasRequiredDeflate=1;const u=requireDeflate$1(),n=requireCommon(),s=requireStrings(),c=requireMessages(),f=requireZstream(),g=Object.prototype.toString,{Z_NO_FLUSH:A,Z_SYNC_FLUSH:v,Z_FULL_FLUSH:y,Z_FINISH:T,Z_OK:I,Z_STREAM_END:S,Z_DEFAULT_COMPRESSION:k,Z_DEFAULT_STRATEGY:e,Z_DEFLATED:N}=requireConstants();function M(V){this.options=n.assign({level:k,method:N,chunkSize:16384,windowBits:15,memLevel:8,strategy:e},V||{});let b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;let W=u.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(W!==I)throw new Error(c[W]);if(b.header&&u.deflateSetHeader(this.strm,b.header),b.dictionary){let q;if(typeof b.dictionary=="string"?q=s.string2buf(b.dictionary):g.call(b.dictionary)==="[object ArrayBuffer]"?q=new Uint8Array(b.dictionary):q=b.dictionary,W=u.deflateSetDictionary(this.strm,q),W!==I)throw new Error(c[W]);this._dict_set=!0}}M.prototype.push=function(V,b){const W=this.strm,q=this.options.chunkSize;let Y,X;if(this.ended)return!1;for(b===~~b?X=b:X=b===!0?T:A,typeof V=="string"?W.input=s.string2buf(V):g.call(V)==="[object ArrayBuffer]"?W.input=new Uint8Array(V):W.input=V,W.next_in=0,W.avail_in=W.input.length;;){if(W.avail_out===0&&(W.output=new Uint8Array(q),W.next_out=0,W.avail_out=q),(X===v||X===y)&&W.avail_out<=6){this.onData(W.output.subarray(0,W.next_out)),W.avail_out=0;continue}if(Y=u.deflate(W,X),Y===S)return W.next_out>0&&this.onData(W.output.subarray(0,W.next_out)),Y=u.deflateEnd(this.strm),this.onEnd(Y),this.ended=!0,Y===I;if(W.avail_out===0){this.onData(W.output);continue}if(X>0&&W.next_out>0){this.onData(W.output.subarray(0,W.next_out)),W.avail_out=0;continue}if(W.avail_in===0)break}return!0},M.prototype.onData=function(V){this.chunks.push(V)},M.prototype.onEnd=function(V){V===I&&(this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=V,this.msg=this.strm.msg};function O(V,b){const W=new M(b);if(W.push(V,!0),W.err)throw W.msg||c[W.err];return W.result}function z(V,b){return b=b||{},b.raw=!0,O(V,b)}function B(V,b){return b=b||{},b.gzip=!0,O(V,b)}return deflate$1.Deflate=M,deflate$1.deflate=O,deflate$1.deflateRaw=z,deflate$1.gzip=B,deflate$1.constants=requireConstants(),deflate$1}var inflate$1={},inflate={},inffast,hasRequiredInffast;function requireInffast(){if(hasRequiredInffast)return inffast;hasRequiredInffast=1;const u=16209,n=16191;return inffast=function(c,f){let g,A,v,y,T,I,S,k,e,N,M,O,z,B,V,b,W,q,Y,X,Q,m,Z,ee;const oe=c.state;g=c.next_in,Z=c.input,A=g+(c.avail_in-5),v=c.next_out,ee=c.output,y=v-(f-c.avail_out),T=v+(c.avail_out-257),I=oe.dmax,S=oe.wsize,k=oe.whave,e=oe.wnext,N=oe.window,M=oe.hold,O=oe.bits,z=oe.lencode,B=oe.distcode,V=(1<>>24,M>>>=q,O-=q,q=W>>>16&255,q===0)ee[v++]=W&65535;else if(q&16){Y=W&65535,q&=15,q&&(O>>=q,O-=q),O<15&&(M+=Z[g++]<>>24,M>>>=q,O-=q,q=W>>>16&255,q&16){if(X=W&65535,q&=15,OI){c.msg="invalid distance too far back",oe.mode=u;break e}if(M>>>=q,O-=q,q=v-y,X>q){if(q=X-q,q>k&&oe.sane){c.msg="invalid distance too far back",oe.mode=u;break e}if(Q=0,m=N,e===0){if(Q+=S-q,q2;)ee[v++]=m[Q++],ee[v++]=m[Q++],ee[v++]=m[Q++],Y-=3;Y&&(ee[v++]=m[Q++],Y>1&&(ee[v++]=m[Q++]))}else{Q=v-X;do ee[v++]=ee[Q++],ee[v++]=ee[Q++],ee[v++]=ee[Q++],Y-=3;while(Y>2);Y&&(ee[v++]=ee[Q++],Y>1&&(ee[v++]=ee[Q++]))}}else if(q&64){c.msg="invalid distance code",oe.mode=u;break e}else{W=B[(W&65535)+(M&(1<>3,g-=Y,O-=Y<<3,M&=(1<{const V=B.bits;let b=0,W=0,q=0,Y=0,X=0,Q=0,m=0,Z=0,ee=0,oe=0,fe,me,pe,Se,xe,we=null,Fe;const De=new Uint16Array(u+1),Ze=new Uint16Array(u+1);let nt=null,Ue,ye,at;for(b=0;b<=u;b++)De[b]=0;for(W=0;W=1&&De[Y]===0;Y--);if(X>Y&&(X=Y),Y===0)return M[O++]=1<<24|64<<16|0,M[O++]=1<<24|64<<16|0,B.bits=1,0;for(q=1;q0&&(S===c||Y!==1))return-1;for(Ze[1]=0,b=1;bn||S===g&&ee>s)return 1;for(;;){Ue=b-m,z[W]+1=Fe?(ye=nt[z[W]-Fe],at=we[z[W]-Fe]):(ye=96,at=0),fe=1<>m)+me]=Ue<<24|ye<<16|at|0;while(me!==0);for(fe=1<>=1;if(fe!==0?(oe&=fe-1,oe+=fe):oe=0,W++,--De[b]===0){if(b===Y)break;b=k[e+z[W]]}if(b>X&&(oe&Se)!==pe){for(m===0&&(m=X),xe+=q,Q=b-m,Z=1<n||S===g&&ee>s)return 1;pe=oe&Se,M[pe]=X<<24|Q<<16|xe-O|0}}return oe!==0&&(M[xe+oe]=b-m<<24|64<<16|0),B.bits=X,0},inftrees}var hasRequiredInflate$1;function requireInflate$1(){if(hasRequiredInflate$1)return inflate;hasRequiredInflate$1=1;const u=requireAdler32(),n=requireCrc32(),s=requireInffast(),c=requireInftrees(),f=0,g=1,A=2,{Z_FINISH:v,Z_BLOCK:y,Z_TREES:T,Z_OK:I,Z_STREAM_END:S,Z_NEED_DICT:k,Z_STREAM_ERROR:e,Z_DATA_ERROR:N,Z_MEM_ERROR:M,Z_BUF_ERROR:O,Z_DEFLATED:z}=requireConstants(),B=16180,V=16181,b=16182,W=16183,q=16184,Y=16185,X=16186,Q=16187,m=16188,Z=16189,ee=16190,oe=16191,fe=16192,me=16193,pe=16194,Se=16195,xe=16196,we=16197,Fe=16198,De=16199,Ze=16200,nt=16201,Ue=16202,ye=16203,at=16204,ft=16205,Tt=16206,Lt=16207,Ot=16208,Ft=16209,Mt=16210,Ke=16211,Re=852,Qe=592,be=15,lt=Me=>(Me>>>24&255)+(Me>>>8&65280)+((Me&65280)<<8)+((Me&255)<<24);function ze(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Le=Me=>{if(!Me)return 1;const je=Me.state;return!je||je.strm!==Me||je.modeKe?1:0},Ge=Me=>{if(Le(Me))return e;const je=Me.state;return Me.total_in=Me.total_out=je.total=0,Me.msg="",je.wrap&&(Me.adler=je.wrap&1),je.mode=B,je.last=0,je.havedict=0,je.flags=-1,je.dmax=32768,je.head=null,je.hold=0,je.bits=0,je.lencode=je.lendyn=new Int32Array(Re),je.distcode=je.distdyn=new Int32Array(Qe),je.sane=1,je.back=-1,I},_e=Me=>{if(Le(Me))return e;const je=Me.state;return je.wsize=0,je.whave=0,je.wnext=0,Ge(Me)},Je=(Me,je)=>{let ue;if(Le(Me))return e;const Ae=Me.state;return je<0?(ue=0,je=-je):(ue=(je>>4)+5,je<48&&(je&=15)),je&&(je<8||je>15)?e:(Ae.window!==null&&Ae.wbits!==je&&(Ae.window=null),Ae.wrap=ue,Ae.wbits=je,_e(Me))},We=(Me,je)=>{if(!Me)return e;const ue=new ze;Me.state=ue,ue.strm=Me,ue.window=null,ue.mode=B;const Ae=Je(Me,je);return Ae!==I&&(Me.state=null),Ae},qe=Me=>We(Me,be);let xt=!0,He,rt;const ie=Me=>{if(xt){He=new Int32Array(512),rt=new Int32Array(32);let je=0;for(;je<144;)Me.lens[je++]=8;for(;je<256;)Me.lens[je++]=9;for(;je<280;)Me.lens[je++]=7;for(;je<288;)Me.lens[je++]=8;for(c(g,Me.lens,0,288,He,0,Me.work,{bits:9}),je=0;je<32;)Me.lens[je++]=5;c(A,Me.lens,0,32,rt,0,Me.work,{bits:5}),xt=!1}Me.lencode=He,Me.lenbits=9,Me.distcode=rt,Me.distbits=5},Be=(Me,je,ue,Ae)=>{let Vt;const ge=Me.state;return ge.window===null&&(ge.wsize=1<=ge.wsize?(ge.window.set(je.subarray(ue-ge.wsize,ue),0),ge.wnext=0,ge.whave=ge.wsize):(Vt=ge.wsize-ge.wnext,Vt>Ae&&(Vt=Ae),ge.window.set(je.subarray(ue-Ae,ue-Ae+Vt),ge.wnext),Ae-=Vt,Ae?(ge.window.set(je.subarray(ue-Ae,ue),0),ge.wnext=Ae,ge.whave=ge.wsize):(ge.wnext+=Vt,ge.wnext===ge.wsize&&(ge.wnext=0),ge.whave{let ue,Ae,Vt,ge,Ut,Ve,Zt,ot,dt,I0,Ne,se,ut,Ce,Pe=0,ve,bt,Xt,Wt,$e,p0,R0,Q0;const M0=new Uint8Array(4);let ni,St;const kt=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Le(Me)||!Me.output||!Me.input&&Me.avail_in!==0)return e;ue=Me.state,ue.mode===oe&&(ue.mode=fe),Ut=Me.next_out,Vt=Me.output,Zt=Me.avail_out,ge=Me.next_in,Ae=Me.input,Ve=Me.avail_in,ot=ue.hold,dt=ue.bits,I0=Ve,Ne=Zt,Q0=I;e:for(;;)switch(ue.mode){case B:if(ue.wrap===0){ue.mode=fe;break}for(;dt<16;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>8&255,ue.check=n(ue.check,M0,2,0),ot=0,dt=0,ue.mode=V;break}if(ue.head&&(ue.head.done=!1),!(ue.wrap&1)||(((ot&255)<<8)+(ot>>8))%31){Me.msg="incorrect header check",ue.mode=Ft;break}if((ot&15)!==z){Me.msg="unknown compression method",ue.mode=Ft;break}if(ot>>>=4,dt-=4,R0=(ot&15)+8,ue.wbits===0&&(ue.wbits=R0),R0>15||R0>ue.wbits){Me.msg="invalid window size",ue.mode=Ft;break}ue.dmax=1<>8&1),ue.flags&512&&ue.wrap&4&&(M0[0]=ot&255,M0[1]=ot>>>8&255,ue.check=n(ue.check,M0,2,0)),ot=0,dt=0,ue.mode=b;case b:for(;dt<32;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>8&255,M0[2]=ot>>>16&255,M0[3]=ot>>>24&255,ue.check=n(ue.check,M0,4,0)),ot=0,dt=0,ue.mode=W;case W:for(;dt<16;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>8),ue.flags&512&&ue.wrap&4&&(M0[0]=ot&255,M0[1]=ot>>>8&255,ue.check=n(ue.check,M0,2,0)),ot=0,dt=0,ue.mode=q;case q:if(ue.flags&1024){for(;dt<16;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>8&255,ue.check=n(ue.check,M0,2,0)),ot=0,dt=0}else ue.head&&(ue.head.extra=null);ue.mode=Y;case Y:if(ue.flags&1024&&(se=ue.length,se>Ve&&(se=Ve),se&&(ue.head&&(R0=ue.head.extra_len-ue.length,ue.head.extra||(ue.head.extra=new Uint8Array(ue.head.extra_len)),ue.head.extra.set(Ae.subarray(ge,ge+se),R0)),ue.flags&512&&ue.wrap&4&&(ue.check=n(ue.check,Ae,se,ge)),Ve-=se,ge+=se,ue.length-=se),ue.length))break e;ue.length=0,ue.mode=X;case X:if(ue.flags&2048){if(Ve===0)break e;se=0;do R0=Ae[ge+se++],ue.head&&R0&&ue.length<65536&&(ue.head.name+=String.fromCharCode(R0));while(R0&&se>9&1,ue.head.done=!0),Me.adler=ue.check=0,ue.mode=oe;break;case Z:for(;dt<32;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=dt&7,dt-=dt&7,ue.mode=Tt;break}for(;dt<3;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=1,dt-=1,ot&3){case 0:ue.mode=me;break;case 1:if(ie(ue),ue.mode=De,je===T){ot>>>=2,dt-=2;break e}break;case 2:ue.mode=xe;break;case 3:Me.msg="invalid block type",ue.mode=Ft}ot>>>=2,dt-=2;break;case me:for(ot>>>=dt&7,dt-=dt&7;dt<32;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>16^65535)){Me.msg="invalid stored block lengths",ue.mode=Ft;break}if(ue.length=ot&65535,ot=0,dt=0,ue.mode=pe,je===T)break e;case pe:ue.mode=Se;case Se:if(se=ue.length,se){if(se>Ve&&(se=Ve),se>Zt&&(se=Zt),se===0)break e;Vt.set(Ae.subarray(ge,ge+se),Ut),Ve-=se,ge+=se,Zt-=se,Ut+=se,ue.length-=se;break}ue.mode=oe;break;case xe:for(;dt<14;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=5,dt-=5,ue.ndist=(ot&31)+1,ot>>>=5,dt-=5,ue.ncode=(ot&15)+4,ot>>>=4,dt-=4,ue.nlen>286||ue.ndist>30){Me.msg="too many length or distance symbols",ue.mode=Ft;break}ue.have=0,ue.mode=we;case we:for(;ue.have>>=3,dt-=3}for(;ue.have<19;)ue.lens[kt[ue.have++]]=0;if(ue.lencode=ue.lendyn,ue.lenbits=7,ni={bits:ue.lenbits},Q0=c(f,ue.lens,0,19,ue.lencode,0,ue.work,ni),ue.lenbits=ni.bits,Q0){Me.msg="invalid code lengths set",ue.mode=Ft;break}ue.have=0,ue.mode=Fe;case Fe:for(;ue.have>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=ve,dt-=ve,ue.lens[ue.have++]=Xt;else{if(Xt===16){for(St=ve+2;dt>>=ve,dt-=ve,ue.have===0){Me.msg="invalid bit length repeat",ue.mode=Ft;break}R0=ue.lens[ue.have-1],se=3+(ot&3),ot>>>=2,dt-=2}else if(Xt===17){for(St=ve+3;dt>>=ve,dt-=ve,R0=0,se=3+(ot&7),ot>>>=3,dt-=3}else{for(St=ve+7;dt>>=ve,dt-=ve,R0=0,se=11+(ot&127),ot>>>=7,dt-=7}if(ue.have+se>ue.nlen+ue.ndist){Me.msg="invalid bit length repeat",ue.mode=Ft;break}for(;se--;)ue.lens[ue.have++]=R0}}if(ue.mode===Ft)break;if(ue.lens[256]===0){Me.msg="invalid code -- missing end-of-block",ue.mode=Ft;break}if(ue.lenbits=9,ni={bits:ue.lenbits},Q0=c(g,ue.lens,0,ue.nlen,ue.lencode,0,ue.work,ni),ue.lenbits=ni.bits,Q0){Me.msg="invalid literal/lengths set",ue.mode=Ft;break}if(ue.distbits=6,ue.distcode=ue.distdyn,ni={bits:ue.distbits},Q0=c(A,ue.lens,ue.nlen,ue.ndist,ue.distcode,0,ue.work,ni),ue.distbits=ni.bits,Q0){Me.msg="invalid distances set",ue.mode=Ft;break}if(ue.mode=De,je===T)break e;case De:ue.mode=Ze;case Ze:if(Ve>=6&&Zt>=258){Me.next_out=Ut,Me.avail_out=Zt,Me.next_in=ge,Me.avail_in=Ve,ue.hold=ot,ue.bits=dt,s(Me,Ne),Ut=Me.next_out,Vt=Me.output,Zt=Me.avail_out,ge=Me.next_in,Ae=Me.input,Ve=Me.avail_in,ot=ue.hold,dt=ue.bits,ue.mode===oe&&(ue.back=-1);break}for(ue.back=0;Pe=ue.lencode[ot&(1<>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>Wt)],ve=Pe>>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(Wt+ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=Wt,dt-=Wt,ue.back+=Wt}if(ot>>>=ve,dt-=ve,ue.back+=ve,ue.length=Xt,bt===0){ue.mode=ft;break}if(bt&32){ue.back=-1,ue.mode=oe;break}if(bt&64){Me.msg="invalid literal/length code",ue.mode=Ft;break}ue.extra=bt&15,ue.mode=nt;case nt:if(ue.extra){for(St=ue.extra;dt>>=ue.extra,dt-=ue.extra,ue.back+=ue.extra}ue.was=ue.length,ue.mode=Ue;case Ue:for(;Pe=ue.distcode[ot&(1<>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>Wt)],ve=Pe>>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(Wt+ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=Wt,dt-=Wt,ue.back+=Wt}if(ot>>>=ve,dt-=ve,ue.back+=ve,bt&64){Me.msg="invalid distance code",ue.mode=Ft;break}ue.offset=Xt,ue.extra=bt&15,ue.mode=ye;case ye:if(ue.extra){for(St=ue.extra;dt>>=ue.extra,dt-=ue.extra,ue.back+=ue.extra}if(ue.offset>ue.dmax){Me.msg="invalid distance too far back",ue.mode=Ft;break}ue.mode=at;case at:if(Zt===0)break e;if(se=Ne-Zt,ue.offset>se){if(se=ue.offset-se,se>ue.whave&&ue.sane){Me.msg="invalid distance too far back",ue.mode=Ft;break}se>ue.wnext?(se-=ue.wnext,ut=ue.wsize-se):ut=ue.wnext-se,se>ue.length&&(se=ue.length),Ce=ue.window}else Ce=Vt,ut=Ut-ue.offset,se=ue.length;se>Zt&&(se=Zt),Zt-=se,ue.length-=se;do Vt[Ut++]=Ce[ut++];while(--se);ue.length===0&&(ue.mode=Ze);break;case ft:if(Zt===0)break e;Vt[Ut++]=ue.length,Zt--,ue.mode=Ze;break;case Tt:if(ue.wrap){for(;dt<32;){if(Ve===0)break e;Ve--,ot|=Ae[ge++]<{if(Le(Me))return e;let je=Me.state;return je.window&&(je.window=null),Me.state=null,I},ht=(Me,je)=>{if(Le(Me))return e;const ue=Me.state;return ue.wrap&2?(ue.head=je,je.done=!1,I):e},vt=(Me,je)=>{const ue=je.length;let Ae,Vt,ge;return Le(Me)||(Ae=Me.state,Ae.wrap!==0&&Ae.mode!==ee)?e:Ae.mode===ee&&(Vt=1,Vt=u(Vt,je,ue,0),Vt!==Ae.check)?N:(ge=Be(Me,je,ue,ue),ge?(Ae.mode=Mt,M):(Ae.havedict=1,I))};return inflate.inflateReset=_e,inflate.inflateReset2=Je,inflate.inflateResetKeep=Ge,inflate.inflateInit=qe,inflate.inflateInit2=We,inflate.inflate=st,inflate.inflateEnd=Ye,inflate.inflateGetHeader=ht,inflate.inflateSetDictionary=vt,inflate.inflateInfo="pako inflate (from Nodeca project)",inflate}var gzheader,hasRequiredGzheader;function requireGzheader(){if(hasRequiredGzheader)return gzheader;hasRequiredGzheader=1;function u(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return gzheader=u,gzheader}var hasRequiredInflate;function requireInflate(){if(hasRequiredInflate)return inflate$1;hasRequiredInflate=1;const u=requireInflate$1(),n=requireCommon(),s=requireStrings(),c=requireMessages(),f=requireZstream(),g=requireGzheader(),A=Object.prototype.toString,{Z_NO_FLUSH:v,Z_FINISH:y,Z_OK:T,Z_STREAM_END:I,Z_NEED_DICT:S,Z_STREAM_ERROR:k,Z_DATA_ERROR:e,Z_MEM_ERROR:N}=requireConstants();function M(B){this.options=n.assign({chunkSize:1024*64,windowBits:15,to:""},B||{});const V=this.options;V.raw&&V.windowBits>=0&&V.windowBits<16&&(V.windowBits=-V.windowBits,V.windowBits===0&&(V.windowBits=-15)),V.windowBits>=0&&V.windowBits<16&&!(B&&B.windowBits)&&(V.windowBits+=32),V.windowBits>15&&V.windowBits<48&&(V.windowBits&15||(V.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;let b=u.inflateInit2(this.strm,V.windowBits);if(b!==T)throw new Error(c[b]);if(this.header=new g,u.inflateGetHeader(this.strm,this.header),V.dictionary&&(typeof V.dictionary=="string"?V.dictionary=s.string2buf(V.dictionary):A.call(V.dictionary)==="[object ArrayBuffer]"&&(V.dictionary=new Uint8Array(V.dictionary)),V.raw&&(b=u.inflateSetDictionary(this.strm,V.dictionary),b!==T)))throw new Error(c[b])}M.prototype.push=function(B,V){const b=this.strm,W=this.options.chunkSize,q=this.options.dictionary;let Y,X,Q;if(this.ended)return!1;for(V===~~V?X=V:X=V===!0?y:v,A.call(B)==="[object ArrayBuffer]"?b.input=new Uint8Array(B):b.input=B,b.next_in=0,b.avail_in=b.input.length;;){for(b.avail_out===0&&(b.output=new Uint8Array(W),b.next_out=0,b.avail_out=W),Y=u.inflate(b,X),Y===S&&q&&(Y=u.inflateSetDictionary(b,q),Y===T?Y=u.inflate(b,X):Y===e&&(Y=S));b.avail_in>0&&Y===I&&b.state.wrap>0&&B[b.next_in]!==0;)u.inflateReset(b),Y=u.inflate(b,X);switch(Y){case k:case e:case S:case N:return this.onEnd(Y),this.ended=!0,!1}if(Q=b.avail_out,b.next_out&&(b.avail_out===0||Y===I))if(this.options.to==="string"){let m=s.utf8border(b.output,b.next_out),Z=b.next_out-m,ee=s.buf2string(b.output,m);b.next_out=Z,b.avail_out=W-Z,Z&&b.output.set(b.output.subarray(m,m+Z),0),this.onData(ee)}else this.onData(b.output.length===b.next_out?b.output:b.output.subarray(0,b.next_out));if(!(Y===T&&Q===0)){if(Y===I)return Y=u.inflateEnd(this.strm),this.onEnd(Y),this.ended=!0,!0;if(b.avail_in===0)break}}return!0},M.prototype.onData=function(B){this.chunks.push(B)},M.prototype.onEnd=function(B){B===T&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=B,this.msg=this.strm.msg};function O(B,V){const b=new M(V);if(b.push(B),b.err)throw b.msg||c[b.err];return b.result}function z(B,V){return V=V||{},V.raw=!0,O(B,V)}return inflate$1.Inflate=M,inflate$1.inflate=O,inflate$1.inflateRaw=z,inflate$1.ungzip=O,inflate$1.constants=requireConstants(),inflate$1}var hasRequiredPako;function requirePako(){if(hasRequiredPako)return pako;hasRequiredPako=1;const{Deflate:u,deflate:n,deflateRaw:s,gzip:c}=requireDeflate(),{Inflate:f,inflate:g,inflateRaw:A,ungzip:v}=requireInflate(),y=requireConstants();return pako.Deflate=u,pako.deflate=n,pako.deflateRaw=s,pako.gzip=c,pako.Inflate=f,pako.inflate=g,pako.inflateRaw=A,pako.ungzip=v,pako.constants=y,pako}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(u){var n=n||{};n.Tag=n.Tag||(typeof commonjsRequire<"u"?requireTag():null),n.Utils=n.Utils||(typeof commonjsRequire<"u"?requireUtilities():null),n.Dictionary=n.Dictionary||(typeof commonjsRequire<"u"?requireDictionary():null),n.Image=n.Image||(typeof commonjsRequire<"u"?requireImage():null);var s=s||(typeof commonjsRequire<"u"?requirePako():null);n.Parser=n.Parser||function(){this.littleEndian=!0,this.explicit=!0,this.metaFound=!1,this.metaFinished=!1,this.metaFinishedOffset=-1,this.needsDeflate=!1,this.inflated=null,this.encapsulation=!1,this.level=0,this.error=null},n.Parser.verbose=!1,n.Parser.MAGIC_COOKIE_OFFSET=128,n.Parser.MAGIC_COOKIE=[68,73,67,77],n.Parser.VRS=["AE","AS","AT","CS","DA","DS","DT","FL","FD","IS","LO","LT","OB","OD","OF","OW","PN","SH","SL","SS","ST","TM","UI","UL","UN","US","UT","UC"],n.Parser.DATA_VRS=["OB","OW","OF","SQ","UT","UN","UC"],n.Parser.RAW_DATA_VRS=["OB","OD","OF","OW","UN"],n.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE="1.2.840.10008.1.2",n.Parser.TRANSFER_SYNTAX_EXPLICIT_LITTLE="1.2.840.10008.1.2.1",n.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG="1.2.840.10008.1.2.2",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG="1.2.840.10008.1.2.4",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS="1.2.840.10008.1.2.4.57",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1="1.2.840.10008.1.2.4.70",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT="1.2.840.10008.1.2.4.50",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT="1.2.840.10008.1.2.4.51",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS_LOSSLESS="1.2.840.10008.1.2.4.80",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS="1.2.840.10008.1.2.4.81",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS="1.2.840.10008.1.2.4.90",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000="1.2.840.10008.1.2.4.91",n.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE="1.2.840.10008.1.2.5",n.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE="1.2.840.10008.1.2.1.99",n.Parser.UNDEFINED_LENGTH=4294967295,n.Parser.isMagicCookieFound=function(c){var f=n.Parser.MAGIC_COOKIE_OFFSET,g=n.Parser.MAGIC_COOKIE.length,A;for(A=0;A=this.metaFinishedOffset&&(this.needsDeflate=!1,v=c.buffer.slice(0,A.offsetEnd),y=c.buffer.slice(A.offsetEnd),this.inflated=n.Utils.concatArrayBuffers(v,s.inflateRaw(y)),c=new DataView(this.inflated)),A=this.getNextTag(c,A.offsetEnd)}catch(T){this.error=T}return f!==null&&(f.littleEndian=this.littleEndian),f},n.Parser.prototype.parseEncapsulated=function(c){var f=0,g,A=[];this.encapsulation=!0;try{for(g=this.getNextTag(c,f);g!==null;)g.isSublistItem()&&A.push(g),n.Parser.verbose&&console.log(g.toString()),g=this.getNextTag(c,g.offsetEnd)}catch(v){this.error=v}return A},n.Parser.prototype.testForValidTag=function(c){var f,g=null;try{f=this.findFirstTagOffset(c),g=this.getNextTag(c,f,!1)}catch(A){this.error=A}return g},n.Parser.prototype.getNextTag=function(c,f,g){var A=0,v,y=null,T=f,I,S=0,k=!0,e=null,N;if(f>=c.byteLength)return null;this.metaFinished?(k=this.littleEndian,A=c.getUint16(f,k)):(A=c.getUint16(f,!0),this.metaFinishedOffset!==-1&&f>=this.metaFinishedOffset||A!==2?(this.metaFinished=!0,k=this.littleEndian,A=c.getUint16(f,k)):k=!0),!this.metaFound&&A===2&&(this.metaFound=!0),f+=2,v=c.getUint16(f,k),f+=2,this.explicit||!this.metaFinished?(e=n.Utils.getStringAt(c,f,2),!this.metaFound&&this.metaFinished&&n.Parser.VRS.indexOf(e)===-1?(e=n.Dictionary.getVR(A,v),S=c.getUint32(f,k),f+=4,this.explicit=!1):(f+=2,n.Parser.DATA_VRS.indexOf(e)!==-1?(f+=2,S=c.getUint32(f,k),f+=4):(S=c.getUint16(f,k),f+=2))):(e=n.Dictionary.getVR(A,v),S=c.getUint32(f,k),S===n.Parser.UNDEFINED_LENGTH&&(e="SQ"),f+=4),I=f;var M=A===n.Tag.TAG_PIXEL_DATA[0]&&v===n.Tag.TAG_PIXEL_DATA[1],O=A===40&&v>=4609&&v<4864;if(e==="SQ"||!O&&!M&&!this.encapsulation&&n.Parser.DATA_VRS.indexOf(e)!==-1&&e!=="UC"?(y=this.parseSublist(c,f,S,e!=="SQ"),S===n.Parser.UNDEFINED_LENGTH&&(S=y[y.length-1].offsetEnd-f)):S>0&&!g&&(S===n.Parser.UNDEFINED_LENGTH&&M&&(S=c.byteLength-f),y=c.buffer.slice(f,f+S)),f+=S,N=new n.Tag(A,v,e,y,T,I,f,this.littleEndian,this.charset),N.value){if(N.isTransformSyntax())this.transformSyntaxAlreadyExist=!0,N.value[0]===n.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE?(this.explicit=!1,this.littleEndian=!0):N.value[0]===n.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG?(this.explicit=!0,this.littleEndian=!1):N.value[0]===n.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE?(this.needsDeflate=!0,this.explicit=!0,this.littleEndian=!0):(this.explicit=!0,this.littleEndian=!0);else if(N.isMetaLength())this.metaFinishedOffset=N.value[0]+f;else if(N.isCharset()){var z=N.value;z.length==2?z=(z[0]||"ISO 2022 IR 6")+"\\"+z[1]:z.length==1&&(z=z[0]),this.charset=z}}return N},n.Parser.prototype.parseSublist=function(c,f,g,A){var v,y=f+g,T=[];if(this.level++,g===n.Parser.UNDEFINED_LENGTH){for(v=this.parseSublistItem(c,f,A);!v.isSequenceDelim();)T.push(v),f=v.offsetEnd,v=this.parseSublistItem(c,f,A);T.push(v)}else for(;fn.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&e>N&&e>M?T=I:N>n.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&N>e&&N>M?T=S:M>n.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&M>e&&M>N?T=k:T=null,T},n.Image.prototype.getCols=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_COLS[0],n.Tag.TAG_COLS[1]),0)},n.Image.prototype.getRows=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_ROWS[0],n.Tag.TAG_ROWS[1]),0)},n.Image.prototype.getSeriesDescription=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SERIES_DESCRIPTION[0],n.Tag.TAG_SERIES_DESCRIPTION[1]),0)},n.Image.prototype.getSeriesInstanceUID=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SERIES_INSTANCE_UID[0],n.Tag.TAG_SERIES_INSTANCE_UID[1]),0)},n.Image.prototype.getSeriesNumber=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SERIES_NUMBER[0],n.Tag.TAG_SERIES_NUMBER[1]),0)},n.Image.prototype.getEchoNumber=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_ECHO_NUMBER[0],n.Tag.TAG_ECHO_NUMBER[1]),0)},n.Image.prototype.getImagePosition=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_IMAGE_POSITION[0],n.Tag.TAG_IMAGE_POSITION[1]))},n.Image.prototype.getImageDirections=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_IMAGE_ORIENTATION[0],n.Tag.TAG_IMAGE_ORIENTATION[1]))},n.Image.prototype.getImagePositionSliceDir=function(A){var v=n.Image.getValueSafely(this.getTag(n.Tag.TAG_IMAGE_POSITION[0],n.Tag.TAG_IMAGE_POSITION[1]));return v&&A>=0?v[A]:0},n.Image.prototype.getModality=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_MODALITY[0],n.Tag.TAG_MODALITY[1]),0)},n.Image.prototype.getSliceLocation=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SLICE_LOCATION[0],n.Tag.TAG_SLICE_LOCATION[1]),0)},n.Image.prototype.getSliceLocationVector=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_SLICE_LOCATION_VECTOR[0],n.Tag.TAG_SLICE_LOCATION_VECTOR[1]))},n.Image.prototype.getImageNumber=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_IMAGE_NUM[0],n.Tag.TAG_IMAGE_NUM[1]),0)},n.Image.prototype.getTemporalPosition=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_TEMPORAL_POSITION[0],n.Tag.TAG_TEMPORAL_POSITION[1]),0)},n.Image.prototype.getTemporalNumber=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[0],n.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[1]),0)},n.Image.prototype.getSliceGap=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SLICE_GAP[0],n.Tag.TAG_SLICE_GAP[1]),0)},n.Image.prototype.getSliceThickness=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SLICE_THICKNESS[0],n.Tag.TAG_SLICE_THICKNESS[1]),0)},n.Image.prototype.getImageMax=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_IMAGE_MAX[0],n.Tag.TAG_IMAGE_MAX[1]),0)},n.Image.prototype.getImageMin=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_IMAGE_MIN[0],n.Tag.TAG_IMAGE_MIN[1]),0)},n.Image.prototype.getDataScaleSlope=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_DATA_SCALE_SLOPE[0],n.Tag.TAG_DATA_SCALE_SLOPE[1]),0)},n.Image.prototype.getDataScaleIntercept=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_DATA_SCALE_INTERCEPT[0],n.Tag.TAG_DATA_SCALE_INTERCEPT[1]),0)},n.Image.prototype.getDataScaleElscint=function(){var A=n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_DATA_SCALE_ELSCINT[0],n.Tag.TAG_DATA_SCALE_ELSCINT[1]),0);A||(A=1);var v=this.getPixelBandwidth();return A=Math.sqrt(v)/(10*A),A<=0&&(A=1),A},n.Image.prototype.getWindowWidth=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_WINDOW_WIDTH[0],n.Tag.TAG_WINDOW_WIDTH[1]),0)},n.Image.prototype.getWindowCenter=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_WINDOW_CENTER[0],n.Tag.TAG_WINDOW_CENTER[1]),0)},n.Image.prototype.getPixelBandwidth=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_PIXEL_BANDWIDTH[0],n.Tag.TAG_PIXEL_BANDWIDTH[1]),0)},n.Image.prototype.getSeriesId=function(){var A=this.getSeriesDescription(),v=this.getSeriesInstanceUID(),y=this.getSeriesNumber(),T=this.getEchoNumber(),I=this.getOrientation(),S=this.getCols(),k=this.getRows(),e="";return A!==null&&(e+=" "+A),v!==null&&(e+=" "+v),y!==null&&(e+=" "+y),T!==null&&(e+=" "+T),I!==null&&(e+=" "+I),e+=" ("+S+" x "+k+")",e},n.Image.prototype.getPixelSpacing=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_PIXEL_SPACING[0],n.Tag.TAG_PIXEL_SPACING[1]))},n.Image.prototype.getImageType=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_IMAGE_TYPE[0],n.Tag.TAG_IMAGE_TYPE[1]))},n.Image.prototype.getBitsStored=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_BITS_STORED[0],n.Tag.TAG_BITS_STORED[1]),0)},n.Image.prototype.getBitsAllocated=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_BITS_ALLOCATED[0],n.Tag.TAG_BITS_ALLOCATED[1]),0)},n.Image.prototype.getFrameTime=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_FRAME_TIME[0],n.Tag.TAG_FRAME_TIME[1]),0)},n.Image.prototype.getAcquisitionMatrix=function(){var A,v,y,T,I;return A=[0,0],A[0]=n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_ACQUISITION_MATRIX[0],n.Tag.TAG_ACQUISITION_MATRIX[1]),0),this.privateDataAll===null&&(this.privateDataAll=this.getAllInterpretedPrivateData()),this.privateDataAll!==null&&this.privateDataAll.length>0&&(y=this.privateDataAll.indexOf("AcquisitionMatrixText"),y!==-1&&(T=this.privateDataAll.indexOf(` -`,y),T!==-1&&(I=this.privateDataAll.substring(y,T),v=I.match(/\d+/g),v!==null&&v.length===2?(A[0]=v[0],A[1]=v[1]):v!==null&&v.length===1&&(A[0]=v[0])))),A[1]===0&&(A[1]=A[0]),A},n.Image.prototype.getTR=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_TR,n.Tag.TAG_TR[1]),0)},n.Image.prototype.putTag=function(A){this.tags[A.id]&&this.tags[A.id].value[0]!==A.value[0]||(this.tags[A.id]=A,this.putFlattenedTag(this.tagsFlat,A))},n.Image.prototype.putFlattenedTag=function(A,v){var y;if(v.sublist)for(y=0;yV&&(V=b,q=fe);return v?{data:e,min:B,minIndex:W,max:V,maxIndex:q,numCols:this.getCols(),numRows:this.getRows()}:e},n.Image.prototype.convertPalette=function(){var A,v,y,T,I,S,k,e,N,M,O,z;if(A=this.tags[n.Tag.createId(n.Tag.TAG_PIXEL_DATA[0],n.Tag.TAG_PIXEL_DATA[1])].value,v=this.getPalleteValues(n.Tag.TAG_PALETTE_RED),y=this.getPalleteValues(n.Tag.TAG_PALETTE_GREEN),T=this.getPalleteValues(n.Tag.TAG_PALETTE_BLUE),v!==null&&v.length>0&&y!==null&&y.length>0&&T!==null&&T.length>0&&!this.convertedPalette){if(I=new DataView(new ArrayBuffer(this.getRows()*this.getCols()*this.getNumberOfFrames()*3)),S=parseInt(Math.ceil(this.getBitsAllocated()/8)),k=A.byteLength/S,S===1)for(e=0;eN&&(N=Math.abs(v[y]),k=y);for(N=0;y<6;y+=1)Math.abs(v[y])>N&&(N=Math.abs(v[y]),e=y);switch(k){case 0:M+="X",e===4?M+="YZ":M+="ZY";break;case 1:M+="Y",e===3?M+="XZ":M+="ZX";break;case 2:M+="Z",e===3?M+="XY":M+="YX";break}switch(k){case 0:v[k]>0?M+="-":M+="+",e===4?v[e]>0?M+="-":M+="+":v[e]>0?M+="+":M+="-";break;case 1:v[k]>0?M+="-":M+="+",e===3?v[e]>0?M+="-":M+="+":v[e]>0?M+="+":M+="-";break;case 2:v[k]>0?M+="+":M+="-",v[e]>0?M+="-":M+="+";break}if(I===0)M+="+",A=M;else{if(S)switch(M.charAt(2)){case"X":I>0?M+="-":M+="+";break;case"Y":case"Z":I>0?M+="+":M+="-";break}else switch(M.charAt(2)){case"X":I>0?M+="+":M+="-";break;case"Y":case"Z":I>0?M+="-":M+="+";break}A=M}return A},n.Image.prototype.isMosaic=function(){var A,v=!1,y,T,I;if(A=this.getImageType(),A!==null){for(T=0;T0&&(I[0]1?S[y]=n.Utils.concatArrayBuffers2(I[y]):S[y]=I[y][0],I[y]=null;return S},n.Image.prototype.getRLE=function(){var A,v,y,T=[];if(A=this.getEncapsulatedData(),A)for(v=A.length,y=1;y");return T=T.replace(/\n\s*\n/g,` -`),T=T.replace(/(?:\r\n|\r|\n)/g,"
"),T},n.Image.prototype.getPalleteValues=function(A){var v,y,T,I,S,k,e,N,M,O,z;if(v=null,y=null,T=n.Image.getValueSafely(this.getTag(A[0],A[1])),T!==null){for(I=T.buffer.byteLength/2,v=[],y=[],S=0;S255||v<0)for(I=255/(y-v),S=v,T=0;T1&&s[0].getTemporalPosition()!==null,T=c>1&&s[0].getTemporalNumber()!==null&&s[0].getTemporalNumber()===c,y&&T)for(I=0;I1||this.isMosaic&&this.images[0].length>1,this.isMultiFrameVolume=!1,this.isMultiFrameTimeseries=!1,this.isImplicitTimeseries=!1,this.isMultiFrame&&(s=this.images[0].getFrameTime()>0,this.isMosaic?this.isMultiFrameTimeseries=!0:s?this.isMultiFrameTimeseries=!0:this.numberOfFramesInFile>1?(this.isMultiFrameTimeseries=!0,this.numberOfFrames=this.images.length):this.isMultiFrameVolume=!0),!this.isMosaic&&this.numberOfFrames<=1){for(S=this.images[0].getImagePosition()||[],f=S.toString(),this.numberOfFrames=0,c=0;c1&&(this.isImplicitTimeseries=!0)}this.sliceDir=this.images[0].getAcquiredSliceDirection(),n.Series.useExplicitOrdering?g=this.images.slice():g=n.Series.orderDicoms(this.images,this.numberOfFrames,this.sliceDir),A=g[0].getImagePositionSliceDir(this.sliceDir),v=g[g.length-1].getImagePositionSliceDir(this.sliceDir),y=v-A,n.Series.useExplicitOrdering?this.sliceSense=!1:this.isMosaic?this.sliceSense=!0:this.isMultiFrame?(T=g[0].getSliceLocationVector(),T!==null?(I=g[0].getOrientation(),I.charAt(2)==="Z"?this.sliceSense=T[0]-T[T.length-1]<0:this.sliceSense=T[0]-T[T.length-1]>0):this.sliceSense=!(A<0)):this.sliceDir===n.Image.SLICE_DIRECTION_SAGITTAL||this.sliceDir===n.Image.SLICE_DIRECTION_CORONAL?y>0?this.sliceSense=!1:this.sliceSense=!0:y>0?this.sliceSense=!0:this.sliceSense=!1,this.imagesOriginalOrder=this.images,this.images=g},n.Series.prototype.concatenateImageData=function(s,c){var f,g,A;this.isMosaic?g=this.getMosaicData(this.images[0],this.images[0].getPixelDataBytes()):g=this.images[0].getPixelDataBytes(),A=this.validatePixelDataLength(this.images[0]),this.images[0].clearPixelData(),f=new Uint8Array(new ArrayBuffer(A*this.images.length)),f.set(new Uint8Array(g,0,A),0),setTimeout(n.Utils.bind(this,function(){this.concatenateNextImageData(f,A,s,1,c)}),0)},n.Series.prototype.concatenateNextImageData=function(s,c,f,g,A){var v,y;g>=this.images.length?(f&&f.drawProgress(1,"Reading DICOM Images"),A(s.buffer)):(f&&f.drawProgress(g/this.images.length,"Reading DICOM Images"),this.isMosaic?v=this.getMosaicData(this.images[g],this.images[g].getPixelDataBytes()):v=this.images[g].getPixelDataBytes(),y=this.validatePixelDataLength(this.images[g]),this.images[g].clearPixelData(),s.set(new Uint8Array(v,0,y),c*g),setTimeout(n.Utils.bind(this,function(){this.concatenateNextImageData(s,c,f,g+1,A)}),0))},n.Series.prototype.validatePixelDataLength=function(s){var c=s.getPixelDataBytes().byteLength,f=s.getCols()*s.getRows();return c%f===0?c:f*s.getNumberOfFrames()*s.getNumberOfSamplesPerPixel()*(s.getBitsAllocated()/8)},n.Series.prototype.getMosaicData=function(s,c){var f,g,A,v,y,T,I,S,k,e,N,M,O,z,B,V,b,W=0;for(I=parseInt(this.images[0].getBitsAllocated()/8),N=this.images[0].getMosaicCols()*this.images[0].getMosaicRows(),M=parseInt(this.images[0].getRows()/this.images[0].getMosaicRows()),O=parseInt(this.images[0].getCols()/this.images[0].getMosaicCols()),f=this.images[0].getCols(),g=this.images[0].getRows(),A=this.images[0].getMosaicRows(),v=this.images[0].getMosaicCols(),y=parseInt(g/A),T=parseInt(f/v),z=new Uint8Array(new ArrayBuffer(N*M*O*I)),B=new Uint8Array(c),S=0;Sn in u?__defProp(u,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[n]=s,__export=(u,n)=>{for(var s in n)__defProp(u,s,{get:n[s],enumerable:!0})},__publicField=(u,n,s)=>(__defNormalProp(u,typeof n!="symbol"?n+"":n,s),s),version$1="0.42.0",_Log=class ci{constructor({name:n="niivue",level:s="info"}={}){__publicField(this,"level"),__publicField(this,"name"),this.name=`${n}`,this.level=s}debug(...n){ci.levels[this.level]>ci.levels.debug||console.debug(`${this.name}-debug`,...n)}info(...n){ci.levels[this.level]>ci.levels.info||console.info(`${this.name}-info`,...n)}warn(...n){ci.levels[this.level]>ci.levels.warn||console.warn(`${this.name}-warn`,...n)}error(...n){ci.levels[this.level]>ci.levels.error||console.error(`${this.name}-error`,...n)}fatal(...n){ci.levels[this.level]>ci.levels.fatal||console.error(`${this.name}-fatal`,...n)}setLogLevel(n){this.level=n}setName(n){this.name=n}};__publicField(_Log,"levels",{debug:0,info:1,warn:2,error:3,fatal:4,silent:1/0});var Log$1=_Log,log$4=new Log$1({name:"niivue",level:"info"}),compileShader=function(u,n,s){const c=u.createShader(u.VERTEX_SHADER);if(c===null)throw new Error("could not create vertex shader");if(u.shaderSource(c,n),u.compileShader(c),!u.getShaderParameter(c,u.COMPILE_STATUS))throw log$4.error(u.getShaderInfoLog(c)),new Error("Vertex shader failed to compile, see console for log");const f=u.createShader(u.FRAGMENT_SHADER);if(f===null)throw new Error("could not create fragment shader");if(u.shaderSource(f,s),u.compileShader(f),!u.getShaderParameter(f,u.COMPILE_STATUS))throw log$4.error(u.getShaderInfoLog(f)),new Error("Fragment shader failed to compile, see console for log");const g=u.createProgram();if(g===null)throw new Error("could not create GL program");if(u.attachShader(g,c),u.attachShader(g,f),u.linkProgram(g),!u.getProgramParameter(g,u.LINK_STATUS))throw log$4.error(u.getProgramInfoLog(g)),new Error("Shader failed to link, see console for log");return g},Shader=class{constructor(u,n,s){__publicField(this,"program"),__publicField(this,"uniforms",{}),__publicField(this,"isMatcap"),this.program=compileShader(u,n,s);const c=/uniform[^;]+[ ](\w+);/g,f=/uniform[^;]+[ ](\w+);/,g=n.match(c),A=s.match(c);g&&g.forEach(v=>{const y=v.match(f);this.uniforms[y[1]]=-1}),A&&A.forEach(v=>{const y=v.match(f);this.uniforms[y[1]]=-1});for(const v in this.uniforms)this.uniforms[v]=u.getUniformLocation(this.program,v)}use(u){u.useProgram(this.program)}},vertRenderShader=`#version 300 es +`)});var nodeFS=require$$0,nodePath=require$$0;Module.read=function(n,s){n=nodePath.normalize(n);var c=nodeFS.readFileSync(n);return!c&&n!=nodePath.resolve(n)&&(n=path.join(__dirname,"..","src",n),c=nodeFS.readFileSync(n)),c&&!s&&(c=c.toString()),c},Module.readBinary=function(n){var s=Module.read(n,!0);return s.buffer||(s=new Uint8Array(s)),assert(s.buffer),s},Module.load=function(n){globalEval(read(n))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),module.exports=Module,process.on("uncaughtException",function(u){if(!(u instanceof ExitStatus))throw u}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),typeof printErr<"u"&&(Module.printErr=printErr),typeof read<"u"?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(n){if(typeof readbuffer=="function")return new Uint8Array(readbuffer(n));var s=read(n,"binary");return assert(typeof s=="object"),s},typeof scriptArgs<"u"?Module.arguments=scriptArgs:typeof arguments<"u"&&(Module.arguments=arguments);else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(Module.read=function(n){var s=new XMLHttpRequest;return s.open("GET",n,!1),s.send(null),s.responseText},typeof arguments<"u"&&(Module.arguments=arguments),typeof console<"u")Module.print||(Module.print=function(n){console.log(n)}),Module.printErr||(Module.printErr=function(n){console.log(n)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&typeof dump<"u"?function(u){dump(u)}:function(u){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),typeof Module.setWindowTitle>"u"&&(Module.setWindowTitle=function(u){document.title=u})}else throw"Unknown runtime environment. Where are we?";function globalEval(u){eval.call(null,u)}!Module.load&&Module.read&&(Module.load=function(n){globalEval(Module.read(n))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(u){tempRet0=u},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(u){STACKTOP=u},getNativeTypeSize:function(u){switch(u){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(u[u.length-1]==="*")return Runtime.QUANTUM_SIZE;if(u[0]==="i"){var n=parseInt(u.substr(1));return assert(n%8===0),n/8}else return 0}}},getNativeFieldSize:function(u){return Math.max(Runtime.getNativeTypeSize(u),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(u,n){return n==="double"||n==="i64"?u&7&&(assert((u&7)===4),u+=4):assert((u&3)===0),u},getAlignSize:function(u,n,s){return!s&&(u=="i64"||u=="double")?8:u?Math.min(n||(u?Runtime.getNativeFieldSize(u):0),Runtime.QUANTUM_SIZE):Math.min(n,8)},dynCall:function(u,n,s){return s&&s.length?(s.splice||(s=Array.prototype.slice.call(s)),s.splice(0,0,n),Module["dynCall_"+u].apply(null,s)):Module["dynCall_"+u].call(null,n)},functionPointers:[],addFunction:function(u){for(var n=0;n=TOTAL_MEMORY){var s=enlargeMemory();if(!s)return DYNAMICTOP=n,0}return n},alignMemory:function(u,n){var s=u=Math.ceil(u/(n||16))*(n||16);return s},makeBigInt:function(u,n,s){var c=s?+(u>>>0)+ +(n>>>0)*4294967296:+(u>>>0)+ +(n|0)*4294967296;return c},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=!1,tempDouble,tempI64,tempRet0;function assert(u,n){u||abort("Assertion failed: "+n)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(u){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}var cwrap,ccall;(function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(u){var n=Runtime.stackAlloc(u.length);return writeArrayToMemory(u,n),n},stringToC:function(u){var n=0;return u!=null&&u!==0&&(n=Runtime.stackAlloc((u.length<<2)+1),writeStringToMemory(u,n)),n}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(n,s,c,f,g){var A=getCFunc(n),v=[],y=0;if(f)for(var T=0;T>0]=n;break;case"i8":HEAP8[u>>0]=n;break;case"i16":HEAP16[u>>1]=n;break;case"i32":HEAP32[u>>2]=n;break;case"i64":tempI64=[n>>>0,(tempDouble=n,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[u>>2]=tempI64[0],HEAP32[u+4>>2]=tempI64[1];break;case"float":HEAPF32[u>>2]=n;break;case"double":HEAPF64[u>>3]=n;break;default:abort("invalid type for setValue: "+s)}}Module.setValue=setValue;function getValue(u,n,s){switch(n=n||"i8",n.charAt(n.length-1)==="*"&&(n="i32"),n){case"i1":return HEAP8[u>>0];case"i8":return HEAP8[u>>0];case"i16":return HEAP16[u>>1];case"i32":return HEAP32[u>>2];case"i64":return HEAP32[u>>2];case"float":return HEAPF32[u>>2];case"double":return HEAPF64[u>>3];default:abort("invalid type for setValue: "+n)}return null}Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE;function allocate(u,n,s,c){var f,g;typeof u=="number"?(f=!0,g=u):(f=!1,g=u.length);var A=typeof n=="string"?n:null,v;if(s==ALLOC_NONE?v=c:v=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][s===void 0?ALLOC_STATIC:s](Math.max(g,A?1:n.length)),f){var c=v,y;for(assert((v&3)==0),y=v+(g&-4);c>2]=0;for(y=v+g;c>0]=0;return v}if(A==="i8")return u.subarray||u.slice?HEAPU8.set(u,v):HEAPU8.set(new Uint8Array(u),v),v;for(var T=0,I,S,k;T>0],s|=c,!(c==0&&!n||(f++,n&&f==n)););n||(n=f);var g="";if(s<128){for(var A=1024,v;n>0;)v=String.fromCharCode.apply(String,HEAPU8.subarray(u,u+Math.min(n,A))),g=g?g+v:v,u+=A,n-=A;return g}return Module.UTF8ToString(u)}Module.Pointer_stringify=Pointer_stringify;function AsciiToString(u){for(var n="";;){var s=HEAP8[u++>>0];if(!s)return n;n+=String.fromCharCode(s)}}Module.AsciiToString=AsciiToString;function stringToAscii(u,n){return writeAsciiToMemory(u,n,!1)}Module.stringToAscii=stringToAscii;function UTF8ArrayToString(u,n){for(var s,c,f,g,A,v,y="";;){if(s=u[n++],!s)return y;if(!(s&128)){y+=String.fromCharCode(s);continue}if(c=u[n++]&63,(s&224)==192){y+=String.fromCharCode((s&31)<<6|c);continue}if(f=u[n++]&63,(s&240)==224?s=(s&15)<<12|c<<6|f:(g=u[n++]&63,(s&248)==240?s=(s&7)<<18|c<<12|f<<6|g:(A=u[n++]&63,(s&252)==248?s=(s&3)<<24|c<<18|f<<12|g<<6|A:(v=u[n++]&63,s=(s&1)<<30|c<<24|f<<18|g<<12|A<<6|v))),s<65536)y+=String.fromCharCode(s);else{var T=s-65536;y+=String.fromCharCode(55296|T>>10,56320|T&1023)}}}Module.UTF8ArrayToString=UTF8ArrayToString;function UTF8ToString(u){return UTF8ArrayToString(HEAPU8,u)}Module.UTF8ToString=UTF8ToString;function stringToUTF8Array(u,n,s,c){if(!(c>0))return 0;for(var f=s,g=s+c-1,A=0;A=55296&&v<=57343&&(v=65536+((v&1023)<<10)|u.charCodeAt(++A)&1023),v<=127){if(s>=g)break;n[s++]=v}else if(v<=2047){if(s+1>=g)break;n[s++]=192|v>>6,n[s++]=128|v&63}else if(v<=65535){if(s+2>=g)break;n[s++]=224|v>>12,n[s++]=128|v>>6&63,n[s++]=128|v&63}else if(v<=2097151){if(s+3>=g)break;n[s++]=240|v>>18,n[s++]=128|v>>12&63,n[s++]=128|v>>6&63,n[s++]=128|v&63}else if(v<=67108863){if(s+4>=g)break;n[s++]=248|v>>24,n[s++]=128|v>>18&63,n[s++]=128|v>>12&63,n[s++]=128|v>>6&63,n[s++]=128|v&63}else{if(s+5>=g)break;n[s++]=252|v>>30,n[s++]=128|v>>24&63,n[s++]=128|v>>18&63,n[s++]=128|v>>12&63,n[s++]=128|v>>6&63,n[s++]=128|v&63}}return n[s]=0,s-f}Module.stringToUTF8Array=stringToUTF8Array;function stringToUTF8(u,n,s){return stringToUTF8Array(u,HEAPU8,n,s)}Module.stringToUTF8=stringToUTF8;function lengthBytesUTF8(u){for(var n=0,s=0;s=55296&&c<=57343&&(c=65536+((c&1023)<<10)|u.charCodeAt(++s)&1023),c<=127?++n:c<=2047?n+=2:c<=65535?n+=3:c<=2097151?n+=4:c<=67108863?n+=5:n+=6}return n}Module.lengthBytesUTF8=lengthBytesUTF8;function UTF16ToString(u){for(var n=0,s="";;){var c=HEAP16[u+n*2>>1];if(c==0)return s;++n,s+=String.fromCharCode(c)}}Module.UTF16ToString=UTF16ToString;function stringToUTF16(u,n,s){if(s===void 0&&(s=2147483647),s<2)return 0;s-=2;for(var c=n,f=s>1]=A,n+=2}return HEAP16[n>>1]=0,n-c}Module.stringToUTF16=stringToUTF16;function lengthBytesUTF16(u){return u.length*2}Module.lengthBytesUTF16=lengthBytesUTF16;function UTF32ToString(u){for(var n=0,s="";;){var c=HEAP32[u+n*4>>2];if(c==0)return s;if(++n,c>=65536){var f=c-65536;s+=String.fromCharCode(55296|f>>10,56320|f&1023)}else s+=String.fromCharCode(c)}}Module.UTF32ToString=UTF32ToString;function stringToUTF32(u,n,s){if(s===void 0&&(s=2147483647),s<4)return 0;for(var c=n,f=c+s-4,g=0;g=55296&&A<=57343){var v=u.charCodeAt(++g);A=65536+((A&1023)<<10)|v&1023}if(HEAP32[n>>2]=A,n+=4,n+4>f)break}return HEAP32[n>>2]=0,n-c}Module.stringToUTF32=stringToUTF32;function lengthBytesUTF32(u){for(var n=0,s=0;s=55296&&c<=57343&&++s,n+=4}return n}Module.lengthBytesUTF32=lengthBytesUTF32;function demangle(u){var n=!!Module.___cxa_demangle;if(n)try{var s=_malloc(u.length);writeStringToMemory(u.substr(1),s);var c=_malloc(4),f=Module.___cxa_demangle(s,0,0,c);if(getValue(c,"i32")===0&&f)return Pointer_stringify(f)}catch{}finally{s&&_free(s),c&&_free(c),f&&_free(f)}var g=3,A={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},v=[],y=!0;function T(){g++,u[g]==="K"&&g++;for(var k=[];u[g]!=="E";){if(u[g]==="S"){g++;var e=u.indexOf("_",g),N=u.substring(g,e)||0;k.push(v[N]||"?"),g=e+1;continue}if(u[g]==="C"){k.push(k[k.length-1]),g+=2;continue}var M=parseInt(u.substr(g)),O=M.toString().length;if(!M||!O){g--;break}var U=u.substr(g+O,M);k.push(U),v.push(U),g+=O+M}return g++,k}function I(k,e,N){e=e||1/0;var M="",O=[];function U(){return"("+O.join(", ")+")"}var B;if(u[g]==="N"){if(B=T().join("::"),e--,e===0)return k?[B]:B}else{(u[g]==="K"||y&&u[g]==="L")&&g++;var V=parseInt(u.substr(g));if(V){var b=V.toString().length;B=u.substr(g+b,V),g+=b+V}}if(y=!1,u[g]==="I"){g++;var W=I(!0),q=I(!0,1,!0);M+=q[0]+" "+B+"<"+W.join(", ")+">"}else M=B;e:for(;g0;){var Y=u[g++];if(Y in A)O.push(A[Y]);else switch(Y){case"P":O.push(I(!0,1,!0)[0]+"*");break;case"R":O.push(I(!0,1,!0)[0]+"&");break;case"L":{g++;var X=u.indexOf("E",g),V=X-g;O.push(u.substr(g,V)),g+=V+2;break}case"A":{var V=parseInt(u.substr(g));if(g+=V.toString().length,u[g]!=="_")throw"?";g++,O.push(I(!0,1,!0)[0]+" ["+V+"]");break}case"E":break e;default:M+="?"+Y;break e}}return!N&&O.length===1&&O[0]==="void"&&(O=[]),k?(M&&O.push(M+"?"),O):M+U()}var S=u;try{if(u=="Object._main"||u=="_main")return"main()";if(typeof u=="number"&&(u=Pointer_stringify(u)),u[0]!=="_"||u[1]!=="_"||u[2]!=="Z")return u;switch(u[3]){case"n":return"operator new()";case"d":return"operator delete()"}S=I()}catch{S+="?"}return S.indexOf("?")>=0&&!n&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),S}function demangleAll(u){return u.replace(/__Z[\w\d_]+/g,function(n){var s=demangle(n);return n===s?n:n+" ["+s+"]"})}function jsStackTrace(){var u=new Error;if(!u.stack){try{throw new Error(0)}catch(n){u=n}if(!u.stack)return"(no stack trace available)"}return u.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}Module.stackTrace=stackTrace;var PAGE_SIZE=4096;function alignMemoryPage(u){return u%4096>0&&(u+=4096-u%4096),u}var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0;function enlargeMemory(){var u=Math.pow(2,31);if(DYNAMICTOP>=u)return!1;for(;TOTAL_MEMORY<=DYNAMICTOP;)if(TOTAL_MEMORY=u)return!1;try{if(ArrayBuffer.transfer)buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY);else{var s=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch{return!1}var c=_emscripten_replace_memory(buffer);return c?(Module.buffer=buffer,Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer),ArrayBuffer.transfer||HEAP8.set(s),!0):!1}var byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(u){byteLength=function(n){return n.byteLength}}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,totalMemory=64*1024;totalMemory0;){var n=u.shift();if(typeof n=="function"){n();continue}var s=n.func;typeof s=="number"?n.arg===void 0?Runtime.dynCall("v",s):Runtime.dynCall("vi",s,[n.arg]):s(n.arg===void 0?null:n.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(u){__ATPRERUN__.unshift(u)}Module.addOnPreRun=addOnPreRun;function addOnInit(u){__ATINIT__.unshift(u)}Module.addOnInit=addOnInit;function addOnPreMain(u){__ATMAIN__.unshift(u)}Module.addOnPreMain=addOnPreMain;function addOnExit(u){__ATEXIT__.unshift(u)}Module.addOnExit=addOnExit;function addOnPostRun(u){__ATPOSTRUN__.unshift(u)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(u,n,s){var c=s>0?s:lengthBytesUTF8(u)+1,f=new Array(c),g=stringToUTF8Array(u,f,0,f.length);return n&&(f.length=g),f}Module.intArrayFromString=intArrayFromString;function intArrayToString(u){for(var n=[],s=0;s255&&(c&=255),n.push(String.fromCharCode(c))}return n.join("")}Module.intArrayToString=intArrayToString;function writeStringToMemory(u,n,s){for(var c=intArrayFromString(u,s),f=0;f>0]=g,f=f+1}}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(u,n){for(var s=0;s>0]=u[s]}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(u,n,s){for(var c=0;c>0]=u.charCodeAt(c);s||(HEAP8[n>>0]=0)}Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function u(n,s){var c=n>>>16,f=n&65535,g=s>>>16,A=s&65535;return f*A+(c*A+f*g<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(u){u=u>>>0;for(var n=0;n<32;n++)if(u&1<<31-n)return n;return 32}),Math.clz32=Math.clz32;var Math_abs=Math.abs,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_min=Math.min,runDependencies=0,dependenciesFulfilled=null;function addRunDependency(u){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}Module.addRunDependency=addRunDependency;function removeRunDependency(u){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&dependenciesFulfilled){var n=dependenciesFulfilled;dependenciesFulfilled=null,n()}}Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={},STATIC_BASE=8,STATICTOP=STATIC_BASE+59744,__ATINIT__.push({func:function(){__GLOBAL__I_000101()}},{func:function(){__GLOBAL__sub_I_jpegls_cpp()}},{func:function(){}}),allocate([0,0,0,0,0,0,0,0,84,144,0,0,31,194,0,0,216,0,0,0,0,0,0,0,84,144,0,0,237,191,0,0,48,0,0,0,0,0,0,0,44,144,0,0,41,192,0,0,84,144,0,0,55,192,0,0,48,0,0,0,0,0,0,0,84,144,0,0,115,192,0,0,48,0,0,0,0,0,0,0,84,144,0,0,175,192,0,0,152,3,0,0,0,0,0,0,84,144,0,0,241,192,0,0,216,3,0,0,0,0,0,0,84,144,0,0,55,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,95,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,135,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,175,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,216,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,241,193,0,0,48,0,0,0,0,0,0,0,44,144,0,0,13,194,0,0,84,144,0,0,80,194,0,0,216,0,0,0,0,0,0,0,84,144,0,0,44,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,139,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,179,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,219,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,3,195,0,0,48,0,0,0,0,0,0,0,84,144,0,0,103,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,157,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,211,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,8,196,0,0,216,0,0,0,0,0,0,0,84,144,0,0,71,196,0,0,216,0,0,0,0,0,0,0,84,144,0,0,138,196,0,0,160,1,0,0,0,0,0,0,44,144,0,0,120,196,0,0,84,144,0,0,187,196,0,0,160,1,0,0,0,0,0,0,84,144,0,0,246,196,0,0,160,1,0,0,0,0,0,0,84,144,0,0,49,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,103,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,157,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,210,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,17,198,0,0,160,1,0,0,0,0,0,0,84,144,0,0,86,198,0,0,72,3,0,0,0,0,0,0,84,144,0,0,162,198,0,0,56,2,0,0,0,0,0,0,44,144,0,0,182,198,0,0,84,144,0,0,196,198,0,0,56,2,0,0,0,0,0,0,84,144,0,0,112,199,0,0,96,2,0,0,0,0,0,0,44,144,0,0,125,199,0,0,84,144,0,0,138,199,0,0,96,2,0,0,0,0,0,0,44,144,0,0,156,199,0,0,84,144,0,0,169,199,0,0,96,2,0,0,0,0,0,0,84,144,0,0,181,199,0,0,120,2,0,0,0,0,0,0,84,144,0,0,214,199,0,0,144,2,0,0,0,0,0,0,84,144,0,0,28,200,0,0,144,2,0,0,0,0,0,0,84,144,0,0,248,199,0,0,176,2,0,0,0,0,0,0,84,144,0,0,62,200,0,0,160,2,0,0,0,0,0,0,84,144,0,0,99,200,0,0,160,2,0,0,0,0,0,0,84,144,0,0,182,221,0,0,160,3,0,0,0,0,0,0,84,144,0,0,245,221,0,0,160,3,0,0,0,0,0,0,84,144,0,0,13,222,0,0,152,3,0,0,0,0,0,0,84,144,0,0,38,222,0,0,152,3,0,0,0,0,0,0,44,144,0,0,62,222,0,0,84,144,0,0,87,222,0,0,104,2,0,0,0,0,0,0,44,144,0,0,110,222,0,0,84,144,0,0,135,222,0,0,72,3,0,0,0,0,0,0,84,144,0,0,161,222,0,0,56,3,0,0,0,0,0,0,44,144,0,0,187,222,0,0,84,144,0,0,205,222,0,0,112,3,0,0,0,0,0,0,84,144,0,0,247,222,0,0,112,3,0,0,0,0,0,0,44,144,0,0,33,223,0,0,44,144,0,0,82,223,0,0,124,144,0,0,131,223,0,0,0,0,0,0,1,0,0,0,120,3,0,0,3,244,255,255,124,144,0,0,178,223,0,0,0,0,0,0,1,0,0,0,136,3,0,0,3,244,255,255,124,144,0,0,225,223,0,0,0,0,0,0,1,0,0,0,120,3,0,0,3,244,255,255,124,144,0,0,16,224,0,0,0,0,0,0,1,0,0,0,136,3,0,0,3,244,255,255,84,144,0,0,63,224,0,0,80,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,144,0,0,187,224,0,0,48,3,0,0,0,0,0,0,124,144,0,0,209,224,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,64,10,0,0,2,0,0,0,124,144,0,0,227,224,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,124,144,0,0,5,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,124,144,0,0,40,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,84,144,0,0,75,225,0,0,144,4,0,0,0,0,0,0,84,144,0,0,109,225,0,0,144,4,0,0,0,0,0,0,124,144,0,0,144,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,84,144,0,0,178,225,0,0,32,4,0,0,0,0,0,0,84,144,0,0,200,225,0,0,32,4,0,0,0,0,0,0,84,144,0,0,220,225,0,0,32,4,0,0,0,0,0,0,124,144,0,0,240,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,64,10,0,0,2,0,0,0,84,144,0,0,2,226,0,0,32,4,0,0,0,0,0,0,84,144,0,0,23,226,0,0,32,4,0,0,0,0,0,0,124,144,0,0,44,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,80,10,0,0,0,0,0,0,124,144,0,0,112,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,104,10,0,0,0,0,0,0,124,144,0,0,180,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,128,10,0,0,0,0,0,0,124,144,0,0,248,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,152,10,0,0,0,0,0,0,124,144,0,0,60,227,0,0,0,0,0,0,3,0,0,0,32,4,0,0,2,0,0,0,176,10,0,0,2,0,0,0,184,10,0,0,0,8,0,0,124,144,0,0,129,227,0,0,0,0,0,0,3,0,0,0,32,4,0,0,2,0,0,0,176,10,0,0,2,0,0,0,192,10,0,0,0,8,0,0,124,144,0,0,198,227,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,200,10,0,0,0,8,0,0,124,144,0,0,11,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,200,10,0,0,0,8,0,0,124,144,0,0,80,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,108,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,136,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,164,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,192,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,216,10,0,0,0,0,0,0,124,144,0,0,6,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,224,10,0,0,0,0,0,0,124,144,0,0,76,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,232,10,0,0,0,0,0,0,124,144,0,0,146,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,240,10,0,0,0,0,0,0,124,144,0,0,216,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,248,10,0,0,2,0,0,0,124,144,0,0,237,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,248,10,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,144,0,0,73,233,0,0,44,144,0,0,50,233,0,0,124,144,0,0,28,233,0,0,0,0,0,0,1,0,0,0,8,11,0,0,0,0,0,0,124,144,0,0,237,232,0,0,0,0,0,0,1,0,0,0,8,11,0,0,0,0,0,0,124,144,0,0,215,232,0,0,0,0,0,0,1,0,0,0,0,11,0,0,0,0,0,0,124,144,0,0,168,232,0,0,0,0,0,0,1,0,0,0,0,11,0,0,0,0,0,0,44,144,0,0,149,232,0,0,44,144,0,0,115,232,0,0,44,144,0,0,81,232,0,0,44,144,0,0,60,232,0,0,44,144,0,0,39,232,0,0,44,144,0,0,14,232,0,0,44,144,0,0,245,231,0,0,44,144,0,0,220,231,0,0,44,144,0,0,195,231,0,0,44,144,0,0,171,231,0,0,44,144,0,0,190,232,0,0,44,144,0,0,3,233],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE),allocate([156,143,0,0,0,0,0,0,8,2,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,248,1,0,0,3,0,0,0,4,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,232,1,0,0,5,0,0,0,6,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,216,1,0,0,7,0,0,0,8,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,200,1,0,0,9,0,0,0,10,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,0,0,0,0,184,1,0,0,11,0,0,0,12,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,0,0,0,0,168,1,0,0,13,0,0,0,14,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,144,1,0,0,15,0,0,0,16,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,128,1,0,0,17,0,0,0,18,0,0,0,9,0,0,0,1,0,0,0,9,0,0,0,0,0,0,0,112,1,0,0,19,0,0,0,20,0,0,0,10,0,0,0,2,0,0,0,10,0,0,0,0,0,0,0,96,1,0,0,21,0,0,0,22,0,0,0,11,0,0,0,3,0,0,0,11,0,0,0,0,0,0,0,80,1,0,0,23,0,0,0,24,0,0,0,12,0,0,0,4,0,0,0,12,0,0,0,0,0,0,0,64,1,0,0,25,0,0,0,26,0,0,0,13,0,0,0,5,0,0,0,13,0,0,0,0,0,0,0,240,0,0,0,27,0,0,0,28,0,0,0,14,0,0,0,6,0,0,0,14,0,0,0,0,0,0,0,224,0,0,0,29,0,0,0,30,0,0,0,15,0,0,0,7,0,0,0,15,0,0,0,0,0,0,0,16,0,0,0,31,0,0,0,32,0,0,0,16,0,0,0,8,0,0,0,16,0,0,0,0,0,0,0,200,0,0,0,33,0,0,0,34,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,184,0,0,0,33,0,0,0,35,0,0,0,3,0,0,0,4,0,0,0,56,0,0,0,0,0,0,0,216,3,0,0,36,0,0,0,37,0,0,0,200,255,255,255,200,255,255,255,216,3,0,0,38,0,0,0,39,0,0,0,56,0,0,0,0,0,0,0,104,0,0,0,40,0,0,0,41,0,0,0,200,255,255,255,200,255,255,255,104,0,0,0,42,0,0,0,43,0,0,0,0,0,0,0,88,0,0,0,44,0,0,0,45,0,0,0,17,0,0,0,1,0,0,0,1,0,0,0,5,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,17,0,0,0,3,0,0,0,18,0,0,0,104,141,0,0,64,141,0,0,84,141,0,0,124,141,0,0,0,0,0,0,32,0,0,0,46,0,0,0,47,0,0,0,6,0,0,0,7,0,0,0,0,0,0,0,56,0,0,0,48,0,0,0,49,0,0,0,8,0,0,0,9,0,0,0,0,0,0,0,72,0,0,0,50,0,0,0,51,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,120,0,0,0,52,0,0,0,53,0,0,0,12,0,0,0,13,0,0,0,0,0,0,0,136,0,0,0,54,0,0,0,55,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,152,0,0,0,56,0,0,0,57,0,0,0,16,0,0,0,17,0,0,0,0,0,0,0,168,0,0,0,58,0,0,0,59,0,0,0,18,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,216,0,0,0,60,0,0,0,61,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,62,0,0,0,63,0,0,0,20,0,0,0,21,0,0,0,0,0,0,0,16,1,0,0,64,0,0,0,65,0,0,0,22,0,0,0,23,0,0,0,0,0,0,0,32,1,0,0,66,0,0,0,67,0,0,0,24,0,0,0,25,0,0,0,0,0,0,0,48,1,0,0,68,0,0,0,69,0,0,0,26,0,0,0,27,0,0,0,0,0,0,0,160,1,0,0,70,0,0,0,71,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,24,2,0,0,72,0,0,0,73,0,0,0,5,0,0,0,1,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,0,0,0,0,40,2,0,0,74,0,0,0,75,0,0,0,18,0,0,0,0,0,0,0,64,2,0,0,76,0,0,0,77,0,0,0,19,0,0,0,2,0,0,0,0,0,0,0,80,2,0,0,78,0,0,0,79,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,104,2,0,0,80,0,0,0,81,0,0,0,7,0,0,0,0,0,0,0,128,2,0,0,82,0,0,0,83,0,0,0,8,0,0,0,0,0,0,0,160,2,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,2,0,0,0,9,0,0,0,28,0,0,0,0,0,0,0,208,2,0,0,84,0,0,0,88,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,3,0,0,0,10,0,0,0,29,0,0,0,0,0,0,0,224,2,0,0,84,0,0,0,89,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,4,0,0,0,11,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,1,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,88,146,0,0,200,146,0,0,56,147,0,0,56,147,0,0,120,187,0,0,168,155,0,0,168,149,0,0,0,0,0,0,10,0,0,0,100,0,0,0,232,3,0,0,16,39,0,0,160,134,1,0,64,66,15,0,128,150,152,0,0,225,245,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,9,0,0,0,159,219,0,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,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,9,0,0,0,151,215,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,9,0,0,0,143,211,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,48,0,0,0,49,0,0,0,50,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,57,0,0,0,58,0,0,0,59,0,0,0,60,0,0,0,61,0,0,0,62,0,0,0,63,0,0,0,64,0,0,0,65,0,0,0,66,0,0,0,67,0,0,0,68,0,0,0,69,0,0,0,70,0,0,0,71,0,0,0,72,0,0,0,73,0,0,0,74,0,0,0,75,0,0,0,76,0,0,0,77,0,0,0,78,0,0,0,79,0,0,0,80,0,0,0,81,0,0,0,82,0,0,0,83,0,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,88,0,0,0,89,0,0,0,90,0,0,0,91,0,0,0,92,0,0,0,93,0,0,0,94,0,0,0,95,0,0,0,96,0,0,0,65,0,0,0,66,0,0,0,67,0,0,0,68,0,0,0,69,0,0,0,70,0,0,0,71,0,0,0,72,0,0,0,73,0,0,0,74,0,0,0,75,0,0,0,76,0,0,0,77,0,0,0,78,0,0,0,79,0,0,0,80,0,0,0,81,0,0,0,82,0,0,0,83,0,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,88,0,0,0,89,0,0,0,90,0,0,0,123,0,0,0,124,0,0,0,125,0,0,0,126,0,0,0,127],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+35640),allocate([1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,48,0,0,0,49,0,0,0,50,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,57,0,0,0,58,0,0,0,59,0,0,0,60,0,0,0,61,0,0,0,62,0,0,0,63,0,0,0,64,0,0,0,97,0,0,0,98,0,0,0,99,0,0,0,100,0,0,0,101,0,0,0,102,0,0,0,103,0,0,0,104,0,0,0,105,0,0,0,106,0,0,0,107,0,0,0,108,0,0,0,109,0,0,0,110,0,0,0,111,0,0,0,112,0,0,0,113,0,0,0,114,0,0,0,115,0,0,0,116,0,0,0,117,0,0,0,118,0,0,0,119,0,0,0,120,0,0,0,121,0,0,0,122,0,0,0,91,0,0,0,92,0,0,0,93,0,0,0,94,0,0,0,95,0,0,0,96,0,0,0,97,0,0,0,98,0,0,0,99,0,0,0,100,0,0,0,101,0,0,0,102,0,0,0,103,0,0,0,104,0,0,0,105,0,0,0,106,0,0,0,107,0,0,0,108,0,0,0,109,0,0,0,110,0,0,0,111,0,0,0,112,0,0,0,113,0,0,0,114,0,0,0,115,0,0,0,116,0,0,0,117,0,0,0,118,0,0,0,119,0,0,0,120,0,0,0,121,0,0,0,122,0,0,0,123,0,0,0,124,0,0,0,125,0,0,0,126,0,0,0,127],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+39844),allocate([240,2,0,0,90,0,0,0,91,0,0,0,20,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,10,0,0,0,11,0,0,0,13,0,0,0,12,0,0,0,13,0,0,0,19,0,0,0,14,0,0,0,20,0,0,0,0,0,0,0,0,3,0,0,90,0,0,0,92,0,0,0,21,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,14,0,0,0,11,0,0,0,13,0,0,0,15,0,0,0,16,0,0,0,21,0,0,0,15,0,0,0,22,0,0,0,0,0,0,0,16,3,0,0,93,0,0,0,94,0,0,0,22,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,17,0,0,0,2,0,0,0,2,0,0,0,18,0,0,0,4,0,0,0,23,0,0,0,16,0,0,0,24,0,0,0,0,0,0,0,32,3,0,0,93,0,0,0,95,0,0,0,23,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,19,0,0,0,20,0,0,0,25,0,0,0,3,0,0,0,26,0,0,0,0,0,0,0,56,3,0,0,96,0,0,0,97,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,3,0,0,93,0,0,0,98,0,0,0,17,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,18,0,0,0,4,0,0,0,23,0,0,0,3,0,0,0,26,0,0,0,0,0,0,0,160,3,0,0,90,0,0,0,99,0,0,0,24,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,14,0,0,0,11,0,0,0,13,0,0,0,12,0,0,0,13,0,0,0,19,0,0,0,15,0,0,0,22,0,0,0,8,0,0,0,0,0,0,0,168,3,0,0,100,0,0,0,101,0,0,0,248,255,255,255,248,255,255,255,168,3,0,0,102,0,0,0,103,0,0,0,8,0,0,0,0,0,0,0,192,3,0,0,104,0,0,0,105,0,0,0,248,255,255,255,248,255,255,255,192,3,0,0,106,0,0,0,107,0,0,0,4,0,0,0,0,0,0,0,216,3,0,0,36,0,0,0,37,0,0,0,252,255,255,255,252,255,255,255,216,3,0,0,38,0,0,0,39,0,0,0,4,0,0,0,0,0,0,0,240,3,0,0,108,0,0,0,109,0,0,0,252,255,255,255,252,255,255,255,240,3,0,0,110,0,0,0,111,0,0,0,0,0,0,0,96,3,0,0,112,0,0,0,113,0,0,0,7,0,0,0,0,0,0,0,112,3,0,0,114,0,0,0,115,0,0,0,0,0,0,0,8,4,0,0,72,0,0,0,116,0,0,0,21,0,0,0,1,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,117,0,0,0,118,0,0,0,119,0,0,0,1,0,0,0,33,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,5,0,0,120,0,0,0,121,0,0,0,119,0,0,0,2,0,0,0,34,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,5,0,0,122,0,0,0,123,0,0,0,119,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,5,0,0,124,0,0,0,125,0,0,0,119,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,5,0,0,126,0,0,0,127,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,23,0,0,0,5,0,0,0,24,0,0,0,1,0,0,0,2,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,5,0,0,128,0,0,0,129,0,0,0,119,0,0,0,7,0,0,0,8,0,0,0,25,0,0,0,9,0,0,0,26,0,0,0,3,0,0,0,4,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,5,0,0,130,0,0,0,131,0,0,0,119,0,0,0,22,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,1,0,0,0,248,255,255,255,224,5,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,6,0,0,132,0,0,0,133,0,0,0,119,0,0,0,30,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,2,0,0,0,248,255,255,255,8,6,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,6,0,0,134,0,0,0,135,0,0,0,119,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,6,0,0,136,0,0,0,137,0,0,0,119,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,6,0,0,138,0,0,0,139,0,0,0,119,0,0,0,38,0,0,0,39,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,40,0,0,0,29,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,6,0,0,140,0,0,0,141,0,0,0,119,0,0,0,41,0,0,0,42,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,43,0,0,0,35,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,6,0,0,142,0,0,0,143,0,0,0,119,0,0,0,44,0,0,0,45,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,46,0,0,0,41,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,6,0,0,144,0,0,0,145,0,0,0,119,0,0,0,47,0,0,0,48,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,49,0,0,0,47,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,6,0,0,146,0,0,0,147,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,7,0,0,148,0,0,0,149,0,0,0,119,0,0,0,5,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,7,0,0,150,0,0,0,151,0,0,0,119,0,0,0,1,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,7,0,0,152,0,0,0,153,0,0,0,119,0,0,0,2,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,7,0,0,154,0,0,0,155,0,0,0,119,0,0,0,19,0,0,0,7,0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,7,0,0,156,0,0,0,157,0,0,0,119,0,0,0,20,0,0,0,8,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,4,0,0,158,0,0,0,159,0,0,0,119,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,5,0,0,160,0,0,0,161,0,0,0,119,0,0,0,27,0,0,0,21,0,0,0,28,0,0,0,22,0,0,0,29,0,0,0,9,0,0,0,23,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,4,0,0,162,0,0,0,163,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,12,0,0,0,50,0,0,0,51,0,0,0,13,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,5,0,0,164,0,0,0,165,0,0,0,119,0,0,0,53,0,0,0,54,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,0,0,0,0,80,5,0,0,166,0,0,0,167,0,0,0,119,0,0,0,55,0,0,0,56,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,0,0,0,0,32,4,0,0,168,0,0,0,169,0,0,0,119,0,0,0,0,0,0,0,48,4,0,0,168,0,0,0,170,0,0,0,119,0,0,0,24,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,30,0,0,0,25,0,0,0,31,0,0,0,26,0,0,0,32,0,0,0,13,0,0,0,27,0,0,0,14,0,0,0,0,0,0,0,80,4,0,0,168,0,0,0,171,0,0,0,119,0,0,0,5,0,0,0,6,0,0,0,15,0,0,0,57,0,0,0,58,0,0,0,16,0,0,0,59,0,0,0,0,0,0,0,112,4,0,0,168,0,0,0,172,0,0,0,119,0,0,0,7,0,0,0,8,0,0,0,17,0,0,0,60,0,0,0,61,0,0,0,18,0,0,0,62,0,0,0,0,0,0,0,144,4,0,0,168,0,0,0,173,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,176,4,0,0,168,0,0,0,174,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,192,4,0,0,168,0,0,0,175,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,37,0,0,0,89,0,0,0,45,0,0,0,37,0,0,0,109,0,0,0,45,0,0,0,37,0,0,0,100,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,0,0,0,114,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,102,0,0,0,97,0,0,0,108,0,0,0,115,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,110,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,114,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,117,0,0,0,114,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,114,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,99,0,0,0,104,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,105,0,0,0,108,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,101,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,121,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,117,0,0,0,115,0,0,0,116,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,116,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,111,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,77,0,0,0,0,0,0,0,80,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,97,0,0,0,32,0,0,0,37,0,0,0,98,0,0,0,32,0,0,0,37,0,0,0,100,0,0,0,32,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,3,32,2,32,2,32,2,32,2,32,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,1,96,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,4,192,4,192,4,192,4,192,4,192,4,192,4,192,8,213,8,213,8,213,8,213,8,213,8,213,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,4,192,4,192,4,192,4,192,4,192,4,192,8,214,8,214,8,214,8,214,8,214,8,214,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,4,192,4,192,4,192,4,192,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,97,119,83,116,114,101,97,109,32,111,114,32,114,97,119,68,97,116,97,32,110,101,101,100,115,32,116,111,32,114,101,102,101,114,101,110,99,101,32,116,111,32,115,111,109,101,116,104,105,110,103,0,119,105,100,116,104,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,54,53,53,51,53,93,0,104,101,105,103,104,116,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,54,53,53,51,53,93,0,98,105,116,115,112,101,114,115,97,109,112,108,101,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,50,44,32,49,54,93,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,110,101,101,100,115,32,116,111,32,98,101,32,115,101,116,32,116,111,32,97,32,118,97,108,117,101,32,111,102,32,123,78,111,110,101,44,32,83,97,109,112,108,101,44,32,76,105,110,101,125,0,99,111,109,112,111,110,101,110,116,115,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,50,53,53,93,0,117,110,99,111,109,112,114,101,115,115,101,100,32,115,105,122,101,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,119,105,116,104,32,116,104,101,32,111,116,104,101,114,32,112,97,114,97,109,101,116,101,114,115,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,99,97,110,110,111,116,32,98,101,32,115,101,116,32,116,111,32,83,97,109,112,108,101,32,105,110,32,99,111,109,98,105,110,97,116,105,111,110,32,119,105,116,104,32,99,111,109,112,111,110,101,110,116,115,32,61,32,52,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,99,97,110,32,111,110,108,121,32,98,101,32,115,101,116,32,116,111,32,78,111,110,101,32,105,110,32,99,111,109,98,105,110,97,116,105,111,110,32,119,105,116,104,32,99,111,109,112,111,110,101,110,116,115,32,61,32,49,0,67,111,108,111,114,32,116,114,97,110,115,102,111,114,109,97,116,105,111,110,32,0,78,111,32,109,111,114,101,32,98,121,116,101,115,32,97,118,97,105,108,97,98,108,101,32,105,110,32,105,110,112,117,116,32,98,117,102,102,101,114,44,32,115,116,105,108,108,32,110,101,101,100,101,100,105,110,103,32,0,65,110,32,111,100,100,32,110,117,109,98,101,114,32,111,102,32,98,121,116,101,115,32,40,0,41,32,99,97,110,110,111,116,32,98,101,32,115,119,97,112,112,101,100,46,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,116,69,69,69,0,49,49,80,114,111,99,101,115,115,76,105,110,101,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,116,69,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,116,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,105,110,103,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,78,83,95,57,97,108,108,111,99,97,116,111,114,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,57,98,97,115,105,99,95,111,115,116,114,105,110,103,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,78,83,95,57,97,108,108,111,99,97,116,111,114,73,99,69,69,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,51,84,114,97,110,115,102,111,114,109,78,111,110,101,73,116,69,69,0,50,50,80,111,115,116,80,114,111,99,101,115,83,105,110,103,108,101,83,116,114,101,97,109,0,50,53,80,111,115,116,80,114,111,99,101,115,83,105,110,103,108,101,67,111,109,112,111,110,101,110,116,0,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,116,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,55,84,114,105,112,108,101,116,73,116,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,51,84,114,97,110,115,102,111,114,109,78,111,110,101,73,104,69,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,55,84,114,105,112,108,101,116,73,104,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,54,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,50,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,104,76,105,56,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,55,84,114,105,112,108,101,116,73,104,69,76,105,56,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,104,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,116,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,55,84,114,105,112,108,101,116,73,116,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,55,84,114,105,112,108,101,116,73,104,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,54,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,50,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,104,76,105,56,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,55,84,114,105,112,108,101,116,73,104,69,76,105,56,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,104,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,67,104,97,114,76,83,32,101,114,114,111,114,0,99,104,97,114,108,115,0,49,53,99,104,97,114,108,115,95,99,97,116,101,103,111,114,121,0,112,97,114,97,109,115,46,88,116,104,117,109,98,110,97,105,108,32,105,115,32,62,32,48,32,98,117,116,32,112,97,114,97,109,115,46,116,104,117,109,98,110,97,105,108,32,61,61,32,110,117,108,108,95,112,116,114,0,49,55,74,112,101,103,77,97,114,107,101,114,83,101,103,109,101,110,116,0,49,49,74,112,101,103,83,101,103,109,101,110,116,0,50,48,74,112,101,103,73,109,97,103,101,68,97,116,97,83,101,103,109,101,110,116,0,69,120,112,101,99,116,101,100,32,74,80,69,71,32,77,97,114,107,101,114,32,115,116,97,114,116,32,98,121,116,101,32,48,120,70,70,32,98,117,116,32,116,104,101,32,98,121,116,101,32,118,97,108,117,101,32,119,97,115,32,48,120,0,74,80,69,71,32,101,110,99,111,100,105,110,103,32,119,105,116,104,32,109,97,114,107,101,114,32,0,32,105,115,32,110,111,116,32,115,117,112,112,111,114,116,101,100,46,0,85,110,107,110,111,119,110,32,74,80,69,71,32,109,97,114,107,101,114,32,0,32,101,110,99,111,117,110,116,101,114,101,100,46,0,109,114,102,120,0,83,116,57,98,97,100,95,97,108,108,111,99,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,49,51,114,117,110,116,105,109,101,95,101,114,114,111,114,0,83,116,57,116,121,112,101,95,105,110,102,111,0,83,116,56,98,97,100,95,99,97,115,116,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,49,95,95,118,109,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,33,34,98,97,115,105,99,95,115,116,114,105,110,103,32,108,101,110,103,116,104,95,101,114,114,111,114,34,0,47,85,115,101,114,115,47,99,104,97,102,101,121,47,101,109,115,100,107,95,112,111,114,116,97,98,108,101,47,101,109,115,99,114,105,112,116,101,110,47,49,46,51,53,46,48,47,115,121,115,116,101,109,47,105,110,99,108,117,100,101,47,108,105,98,99,120,120,47,115,116,114,105,110,103,0,95,95,116,104,114,111,119,95,108,101,110,103,116,104,95,101,114,114,111,114,0,33,34,118,101,99,116,111,114,32,108,101,110,103,116,104,95,101,114,114,111,114,34,0,47,85,115,101,114,115,47,99,104,97,102,101,121,47,101,109,115,100,107,95,112,111,114,116,97,98,108,101,47,101,109,115,99,114,105,112,116,101,110,47,49,46,51,53,46,48,47,115,121,115,116,101,109,47,105,110,99,108,117,100,101,47,108,105,98,99,120,120,47,118,101,99,116,111,114,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,115,116,100,58,58,98,97,100,95,97,108,108,111,99,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,116,104,114,101,119,32,97,110,32,101,120,99,101,112,116,105,111,110,0,115,116,100,58,58,98,97,100,95,99,97,115,116,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+42396),allocate([32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,105,110,102,105,110,105,116,121,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,255,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,4,7,3,6,5,0,80,79,83,73,88],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+52636),allocate([17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,119,69,69,0,117,110,115,117,112,112,111,114,116,101,100,32,108,111,99,97,108,101,32,102,111,114,32,115,116,97,110,100,97,114,100,32,105,110,112,117,116,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,99,69,69,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,99,69,69,0,78,83,116,51,95,95,49,49,52,95,95,115,104,97,114,101,100,95,99,111,117,110,116,69,0,78,83,116,51,95,95,49,49,50,115,121,115,116,101,109,95,101,114,114,111,114,69,0,78,83,116,51,95,95,49,49,52,101,114,114,111,114,95,99,97,116,101,103,111,114,121,69,0,78,83,116,51,95,95,49,49,50,95,95,100,111,95,109,101,115,115,97,103,101,69,0,58,32,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,55,102,97,105,108,117,114,101,69,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,57,95,95,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,69,0,105,111,115,95,98,97,115,101,58,58,99,108,101,97,114,0,105,111,115,116,114,101,97,109,0,117,110,115,112,101,99,105,102,105,101,100,32,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,32,101,114,114,111,114,0,48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102,65,66,67,68,69,70,120,88,43,45,112,80,105,73,110,78,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,102,97,99,101,116,69,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,119,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,99,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,115,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,105,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,49,54,95,95,110,97,114,114,111,119,95,116,111,95,117,116,102,56,73,76,106,51,50,69,69,69,0,78,83,116,51,95,95,49,49,55,95,95,119,105,100,101,110,95,102,114,111,109,95,117,116,102,56,73,76,106,51,50,69,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,119,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,95,95,105,109,112,69,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,99,69,69,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,119,69,69,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,99,69,69,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,99,69,69,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,119,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,48,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,49,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,48,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,49,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,99,69,69,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,119,69,69,0,37,112,0,67,0,37,0,0,0,0,0,108,0,108,108,0,0,76,0,37,112,0,0,0,0,37,72,58,37,77,58,37,83,37,109,47,37,100,47,37,121,37,89,45,37,109,45,37,100,37,73,58,37,77,58,37,83,32,37,112,37,72,58,37,77,37,72,58,37,77,58,37,83,108,111,99,97,108,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,48,49,50,51,52,53,54,55,56,57,0,37,76,102,0,109,111,110,101,121,95,103,101,116,32,101,114,114,111,114,0,48,49,50,51,52,53,54,55,56,57,0,37,46,48,76,102,0,116,114,117,101,0,102,97,108,115,101,0,83,117,110,100,97,121,0,77,111,110,100,97,121,0,84,117,101,115,100,97,121,0,87,101,100,110,101,115,100,97,121,0,84,104,117,114,115,100,97,121,0,70,114,105,100,97,121,0,83,97,116,117,114,100,97,121,0,83,117,110,0,77,111,110,0,84,117,101,0,87,101,100,0,84,104,117,0,70,114,105,0,83,97,116,0,74,97,110,117,97,114,121,0,70,101,98,114,117,97,114,121,0,77,97,114,99,104,0,65,112,114,105,108,0,77,97,121,0,74,117,110,101,0,74,117,108,121,0,65,117,103,117,115,116,0,83,101,112,116,101,109,98,101,114,0,79,99,116,111,98,101,114,0,78,111,118,101,109,98,101,114,0,68,101,99,101,109,98,101,114,0,74,97,110,0,70,101,98,0,77,97,114,0,65,112,114,0,74,117,110,0,74,117,108,0,65,117,103,0,83,101,112,0,79,99,116,0,78,111,118,0,68,101,99,0,65,77,0,80,77,0,37,109,47,37,100,47,37,121,0,37,72,58,37,77,58,37,83,0,37,97,32,37,98,32,37,100,32,37,72,58,37,77,58,37,83,32,37,89,0,37,73,58,37,77,58,37,83,32,37,112,0,78,83,116,51,95,95,49,49,51,109,101,115,115,97,103,101,115,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,99,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,99,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,48,95,95,116,105,109,101,95,112,117,116,69,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,119,69,69,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,99,69,69,0,78,83,116,51,95,95,49,57,116,105,109,101,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,119,69,69,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,112,117,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,99,69,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,119,69,69,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,103,101,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,99,69,69,0,78,83,116,51,95,95,49,49,50,99,111,100,101,99,118,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,48,99,116,121,112,101,95,98,97,115,101,69,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+56215);var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);function _atexit(u,n){__ATEXIT__.unshift({func:u,arg:n})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}Module._i64Subtract=_i64Subtract;function ___assert_fail(u,n,s,c){throw ABORT=!0,"Assertion failed: "+Pointer_stringify(u)+", at: "+[n?Pointer_stringify(n):"unknown filename",s,c?Pointer_stringify(c):"unknown function"]+" at "+stackTrace()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(u){if(!u||EXCEPTIONS.infos[u])return u;for(var n in EXCEPTIONS.infos){var s=EXCEPTIONS.infos[n];if(s.adjusted===u)return n}return u},addRef:function(u){if(u){var n=EXCEPTIONS.infos[u];n.refcount++}},decRef:function(u){if(u){var n=EXCEPTIONS.infos[u];assert(n.refcount>0),n.refcount--,n.refcount===0&&(n.destructor&&Runtime.dynCall("vi",n.destructor,[u]),delete EXCEPTIONS.infos[u],___cxa_free_exception(u))}},clearRef:function(u){if(u){var n=EXCEPTIONS.infos[u];n.refcount=0}}};function ___resumeException(u){throw EXCEPTIONS.last||(EXCEPTIONS.last=u),EXCEPTIONS.clearRef(EXCEPTIONS.deAdjust(u)),u}function ___cxa_find_matching_catch(){var u=EXCEPTIONS.last;if(!u)return asm.setTempRet0(0),0|0;var n=EXCEPTIONS.infos[u],s=n.type;if(!s)return asm.setTempRet0(0),u|0;var c=Array.prototype.slice.call(arguments);Module.___cxa_is_pointer_type(s),___cxa_find_matching_catch.buffer||(___cxa_find_matching_catch.buffer=_malloc(4)),HEAP32[___cxa_find_matching_catch.buffer>>2]=u,u=___cxa_find_matching_catch.buffer;for(var f=0;f>2],n.adjusted=u,asm.setTempRet0(c[f]),u|0;return u=HEAP32[u>>2],asm.setTempRet0(s),u|0}function ___cxa_throw(u,n,s){throw EXCEPTIONS.infos[u]={ptr:u,adjusted:u,type:n,destructor:s,refcount:0},EXCEPTIONS.last=u,"uncaught_exception"in __ZSt18uncaught_exceptionv?__ZSt18uncaught_exceptionv.uncaught_exception++:__ZSt18uncaught_exceptionv.uncaught_exception=1,u}Module._memset=_memset;function ___gxx_personality_v0(){}function __isLeapYear(u){return u%4===0&&(u%100!==0||u%400===0)}function __arraySum(u,n){for(var s=0,c=0;c<=n;s+=u[c++]);return s}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],__MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(u,n){for(var s=new Date(u.getTime());n>0;){var c=__isLeapYear(s.getFullYear()),f=s.getMonth(),g=(c?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[f];if(n>g-s.getDate())n-=g-s.getDate()+1,s.setDate(1),f<11?s.setMonth(f+1):(s.setMonth(0),s.setFullYear(s.getFullYear()+1));else return s.setDate(s.getDate()+n),s}return s}function _strftime(u,n,s,c){var f=HEAP32[c+40>>2],g={tm_sec:HEAP32[c>>2],tm_min:HEAP32[c+4>>2],tm_hour:HEAP32[c+8>>2],tm_mday:HEAP32[c+12>>2],tm_mon:HEAP32[c+16>>2],tm_year:HEAP32[c+20>>2],tm_wday:HEAP32[c+24>>2],tm_yday:HEAP32[c+28>>2],tm_isdst:HEAP32[c+32>>2],tm_gmtoff:HEAP32[c+36>>2],tm_zone:f?Pointer_stringify(f):""},A=Pointer_stringify(s),v={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S"};for(var y in v)A=A.replace(new RegExp(y,"g"),v[y]);var T=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],I=["January","February","March","April","May","June","July","August","September","October","November","December"];function S(B,V,b){for(var W=typeof B=="number"?B.toString():B||"";W.length0?1:0}var W;return(W=b(B.getFullYear()-V.getFullYear()))===0&&(W=b(B.getMonth()-V.getMonth()))===0&&(W=b(B.getDate()-V.getDate())),W}function N(B){switch(B.getDay()){case 0:return new Date(B.getFullYear()-1,11,29);case 1:return B;case 2:return new Date(B.getFullYear(),0,3);case 3:return new Date(B.getFullYear(),0,2);case 4:return new Date(B.getFullYear(),0,1);case 5:return new Date(B.getFullYear()-1,11,31);case 6:return new Date(B.getFullYear()-1,11,30)}}function M(B){var V=__addDays(new Date(B.tm_year+1900,0,1),B.tm_yday),b=new Date(V.getFullYear(),0,4),W=new Date(V.getFullYear()+1,0,4),q=N(b),Y=N(W);return e(q,V)<=0?e(Y,V)<=0?V.getFullYear()+1:V.getFullYear():V.getFullYear()-1}var O={"%a":function(B){return T[B.tm_wday].substring(0,3)},"%A":function(B){return T[B.tm_wday]},"%b":function(B){return I[B.tm_mon].substring(0,3)},"%B":function(B){return I[B.tm_mon]},"%C":function(B){var V=B.tm_year+1900;return k(V/100|0,2)},"%d":function(B){return k(B.tm_mday,2)},"%e":function(B){return S(B.tm_mday,2," ")},"%g":function(B){return M(B).toString().substring(2)},"%G":function(B){return M(B)},"%H":function(B){return k(B.tm_hour,2)},"%I":function(B){return k(B.tm_hour<13?B.tm_hour:B.tm_hour-12,2)},"%j":function(B){return k(B.tm_mday+__arraySum(__isLeapYear(B.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,B.tm_mon-1),3)},"%m":function(B){return k(B.tm_mon+1,2)},"%M":function(B){return k(B.tm_min,2)},"%n":function(){return` +`},"%p":function(B){return B.tm_hour>0&&B.tm_hour<13?"AM":"PM"},"%S":function(B){return k(B.tm_sec,2)},"%t":function(){return" "},"%u":function(B){var V=new Date(B.tm_year+1900,B.tm_mon+1,B.tm_mday,0,0,0,0);return V.getDay()||7},"%U":function(B){var V=new Date(B.tm_year+1900,0,1),b=V.getDay()===0?V:__addDays(V,7-V.getDay()),W=new Date(B.tm_year+1900,B.tm_mon,B.tm_mday);if(e(b,W)<0){var q=__arraySum(__isLeapYear(W.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,W.getMonth()-1)-31,Y=31-b.getDate(),X=Y+q+W.getDate();return k(Math.ceil(X/7),2)}return e(b,V)===0?"01":"00"},"%V":function(B){var V=new Date(B.tm_year+1900,0,4),b=new Date(B.tm_year+1901,0,4),W=N(V),q=N(b),Y=__addDays(new Date(B.tm_year+1900,0,1),B.tm_yday);if(e(Y,W)<0)return"53";if(e(q,Y)<=0)return"01";var X;return W.getFullYear()=0;return V=Math.abs(V)/60,V=V/60*100+V%60,(b?"+":"-")+("0000"+V).slice(-4)},"%Z":function(B){return B.tm_zone},"%%":function(){return"%"}};for(var y in O)A.indexOf(y)>=0&&(A=A.replace(new RegExp(y,"g"),O[y](g)));var U=intArrayFromString(A,!1);return U.length>n?0:(writeArrayToMemory(U,u),U.length-1)}function _strftime_l(u,n,s,c){return _strftime(u,n,s,c)}function _abort(){Module.abort()}function _free(){}Module._free=_free;function ___cxa_free_exception(u){try{return _free(u)}catch{}}function ___cxa_end_catch(){if(___cxa_end_catch.rethrown){___cxa_end_catch.rethrown=!1;return}asm.setThrew(0);var u=EXCEPTIONS.caught.pop();u&&(EXCEPTIONS.decRef(EXCEPTIONS.deAdjust(u)),EXCEPTIONS.last=0)}function _pthread_once(u,n){_pthread_once.seen||(_pthread_once.seen={}),!(u in _pthread_once.seen)&&(Runtime.dynCall("v",n),_pthread_once.seen[u]=1)}function ___lock(){}function ___unlock(){}var PTHREAD_SPECIFIC={};function _pthread_getspecific(u){return PTHREAD_SPECIFIC[u]||0}function ___setErrNo(u){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=u),u}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _sysconf(u){switch(u){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return typeof navigator=="object"&&navigator.hardwareConcurrency||1}return ___setErrNo(ERRNO_CODES.EINVAL),-1}var _fabs=Math_abs,PTHREAD_SPECIFIC_NEXT_KEY=1;function _pthread_key_create(u,n){return u==0?ERRNO_CODES.EINVAL:(HEAP32[u>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function _emscripten_set_main_loop_timing(u,n){if(Browser.mainLoop.timingMode=u,Browser.mainLoop.timingValue=n,!Browser.mainLoop.func)return 1;if(u==0)Browser.mainLoop.scheduler=function(){setTimeout(Browser.mainLoop.runner,n)},Browser.mainLoop.method="timeout";else if(u==1)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(u==2){if(!window.setImmediate){let g=function(A){A.source===window&&A.data===c&&(A.stopPropagation(),s.shift()())};var f=g,s=[],c="__emcc";window.addEventListener("message",g,!0),window.setImmediate=function(v){s.push(v),window.postMessage(c,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(u,n,s,c,f){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=u,Browser.mainLoop.arg=c;var g=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var v=Date.now(),y=Browser.mainLoop.queue.shift();if(y.func(y.arg),Browser.mainLoop.remainingBlockers){var T=Browser.mainLoop.remainingBlockers,I=T%1==0?T-1:Math.floor(T);y.counted?Browser.mainLoop.remainingBlockers=I:(I=I+.5,Browser.mainLoop.remainingBlockers=(8*T+I)/9)}console.log('main loop blocker "'+y.name+'" took '+(Date.now()-v)+" ms"),Browser.mainLoop.updateStatus(),setTimeout(Browser.mainLoop.runner,0);return}if(!(g1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}Browser.mainLoop.method==="timeout"&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(function(){typeof c<"u"?Runtime.dynCall("vi",u,[c]):Runtime.dynCall("v",u)}),!(g0?_emscripten_set_main_loop_timing(0,1e3/n):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),s)throw"SimulateInfiniteLoop"}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var u=Browser.mainLoop.timingMode,n=Browser.mainLoop.timingValue,s=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(s,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(u,n),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var u=Module.statusMessage||"Please wait...",n=Browser.mainLoop.remainingBlockers,s=Browser.mainLoop.expectedBlockers;n?n"u"&&(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var u={};u.canHandle=function(g){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(g)},u.handle=function(g,A,v,y){var T=null;if(Browser.hasBlobConstructor)try{T=new Blob([g],{type:Browser.getMimetype(A)}),T.size!==g.length&&(T=new Blob([new Uint8Array(g).buffer],{type:Browser.getMimetype(A)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!T){var I=new Browser.BlobBuilder;I.append(new Uint8Array(g).buffer),T=I.getBlob()}var S=Browser.URLObject.createObjectURL(T),k=new Image;k.onload=function(){assert(k.complete,"Image "+A+" could not be decoded");var N=document.createElement("canvas");N.width=k.width,N.height=k.height;var M=N.getContext("2d");M.drawImage(k,0,0),Module.preloadedImages[A]=N,Browser.URLObject.revokeObjectURL(S),v&&v(g)},k.onerror=function(N){console.log("Image "+S+" could not be decoded"),y&&y()},k.src=S},Module.preloadPlugins.push(u);var n={};n.canHandle=function(g){return!Module.noAudioDecoding&&g.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},n.handle=function(g,A,v,y){var T=!1;function I(M){T||(T=!0,Module.preloadedAudios[A]=M,v&&v(g))}function S(){T||(T=!0,Module.preloadedAudios[A]=new Audio,y&&y())}if(Browser.hasBlobConstructor){try{var k=new Blob([g],{type:Browser.getMimetype(A)})}catch{return S()}var e=Browser.URLObject.createObjectURL(k),N=new Audio;N.addEventListener("canplaythrough",function(){I(N)},!1),N.onerror=function(O){if(T)return;console.log("warning: browser could not fully decode audio "+A+", trying slower base64 approach");function U(B){for(var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b="=",W="",q=0,Y=0,X=0;X=6;){var Q=q>>Y-6&63;Y-=6,W+=V[Q]}return Y==2?(W+=V[(q&3)<<4],W+=b+b):Y==4&&(W+=V[(q&15)<<2],W+=b),W}N.src="data:audio/x-"+A.substr(-3)+";base64,"+U(g),I(N)},N.src=e,Browser.safeSetTimeout(function(){I(N)},1e4)}else return S()},Module.preloadPlugins.push(n);var s=Module.canvas;function c(){Browser.pointerLock=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s||document.msPointerLockElement===s}s&&(s.requestPointerLock=s.requestPointerLock||s.mozRequestPointerLock||s.webkitRequestPointerLock||s.msRequestPointerLock||function(){},s.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},s.exitPointerLock=s.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",c,!1),document.addEventListener("mozpointerlockchange",c,!1),document.addEventListener("webkitpointerlockchange",c,!1),document.addEventListener("mspointerlockchange",c,!1),Module.elementPointerLock&&s.addEventListener("click",function(f){!Browser.pointerLock&&s.requestPointerLock&&(s.requestPointerLock(),f.preventDefault())},!1))},createContext:function(u,n,s,c){if(n&&Module.ctx&&u==Module.canvas)return Module.ctx;var f,g;if(n){var A={antialias:!1,alpha:!1};if(c)for(var v in c)A[v]=c[v];g=GL.createContext(u,A),g&&(f=GL.getContext(g).GLctx),u.style.backgroundColor="black"}else f=u.getContext("2d");return f?(s&&(n||assert(typeof GLctx>"u","cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=f,n&&GL.makeContextCurrent(g),Module.useWebGL=n,Browser.moduleContextCreatedCallbacks.forEach(function(y){y()}),Browser.init()),f):null},destroyContext:function(u,n,s){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(u,n,s){Browser.lockPointer=u,Browser.resizeCanvas=n,Browser.vrDevice=s,typeof Browser.lockPointer>"u"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas>"u"&&(Browser.resizeCanvas=!1),typeof Browser.vrDevice>"u"&&(Browser.vrDevice=null);var c=Module.canvas;function f(){Browser.isFullScreen=!1;var A=c.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===A?(c.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},c.cancelFullScreen=c.cancelFullScreen.bind(document),Browser.lockPointer&&c.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):(A.parentNode.insertBefore(c,A),A.parentNode.removeChild(A),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen),Browser.updateCanvasDimensions(c)}Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",f,!1),document.addEventListener("mozfullscreenchange",f,!1),document.addEventListener("webkitfullscreenchange",f,!1),document.addEventListener("MSFullscreenChange",f,!1));var g=document.createElement("div");c.parentNode.insertBefore(g,c),g.appendChild(c),g.requestFullScreen=g.requestFullScreen||g.mozRequestFullScreen||g.msRequestFullscreen||(g.webkitRequestFullScreen?function(){g.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),s?g.requestFullScreen({vrDisplay:s}):g.requestFullScreen()},nextRAF:0,fakeRequestAnimationFrame:function(u){var n=Date.now();if(Browser.nextRAF===0)Browser.nextRAF=n+1e3/60;else for(;n+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var s=Math.max(Browser.nextRAF-n,0);setTimeout(u,s)},requestAnimationFrame:function u(n){typeof window>"u"?Browser.fakeRequestAnimationFrame(n):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(n))},safeCallback:function(u){return function(){if(!ABORT)return u.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var u=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],u.forEach(function(n){n()})}},safeRequestAnimationFrame:function(u){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?u():Browser.queuedAsyncCallbacks.push(u))})},safeSetTimeout:function(u,n){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?u():Browser.queuedAsyncCallbacks.push(u))},n)},safeSetInterval:function(u,n){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&u()},n)},getMimetype:function(u){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[u.substr(u.lastIndexOf(".")+1)]},getUserMedia:function(u){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(u)},getMovementX:function(u){return u.movementX||u.mozMovementX||u.webkitMovementX||0},getMovementY:function(u){return u.movementY||u.mozMovementY||u.webkitMovementY||0},getMouseWheelDelta:function(u){var n=0;switch(u.type){case"DOMMouseScroll":n=u.detail;break;case"mousewheel":n=u.wheelDelta;break;case"wheel":n=u.deltaY;break;default:throw"unrecognized mouse wheel event: "+u.type}return n},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(u){if(Browser.pointerLock)u.type!="mousemove"&&"mozMovementX"in u?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(u),Browser.mouseMovementY=Browser.getMovementY(u)),typeof SDL<"u"?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var n=Module.canvas.getBoundingClientRect(),s=Module.canvas.width,c=Module.canvas.height,f=typeof window.scrollX<"u"?window.scrollX:window.pageXOffset,g=typeof window.scrollY<"u"?window.scrollY:window.pageYOffset;if(u.type==="touchstart"||u.type==="touchend"||u.type==="touchmove"){var A=u.touch;if(A===void 0)return;var v=A.pageX-(f+n.left),y=A.pageY-(g+n.top);v=v*(s/n.width),y=y*(c/n.height);var T={x:v,y};if(u.type==="touchstart")Browser.lastTouches[A.identifier]=T,Browser.touches[A.identifier]=T;else if(u.type==="touchend"||u.type==="touchmove"){var I=Browser.touches[A.identifier];I||(I=T),Browser.lastTouches[A.identifier]=I,Browser.touches[A.identifier]=T}return}var S=u.pageX-(f+n.left),k=u.pageY-(g+n.top);S=S*(s/n.width),k=k*(c/n.height),Browser.mouseMovementX=S-Browser.mouseX,Browser.mouseMovementY=k-Browser.mouseY,Browser.mouseX=S,Browser.mouseY=k}},xhrLoad:function(u,n,s){var c=new XMLHttpRequest;c.open("GET",u,!0),c.responseType="arraybuffer",c.onload=function(){c.status==200||c.status==0&&c.response?n(c.response):s()},c.onerror=s,c.send(null)},asyncLoad:function(u,n,s,c){Browser.xhrLoad(u,function(f){assert(f,'Loading data file "'+u+'" failed (no arrayBuffer).'),n(new Uint8Array(f)),c||removeRunDependency()},function(f){if(s)s();else throw'Loading data file "'+u+'" failed.'}),c||addRunDependency()},resizeListeners:[],updateResizeListeners:function(){var u=Module.canvas;Browser.resizeListeners.forEach(function(n){n(u.width,u.height)})},setCanvasSize:function(u,n,s){var c=Module.canvas;Browser.updateCanvasDimensions(c,u,n),s||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){if(typeof SDL<"u"){var u=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];u=u|8388608,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=u}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL<"u"){var u=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];u=u&-8388609,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=u}Browser.updateResizeListeners()},updateCanvasDimensions:function(u,n,s){n&&s?(u.widthNative=n,u.heightNative=s):(n=u.widthNative,s=u.heightNative);var c=n,f=s;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(c/f>2];return n},getStr:function(){var u=Pointer_stringify(SYSCALLS.get());return u},get64:function(){var u=SYSCALLS.get(),n=SYSCALLS.get();return u>=0?assert(n===0):assert(n===-1),u},getZero:function(){assert(SYSCALLS.get()===0)}};function ___syscall54(u,n){SYSCALLS.varargs=n;try{return 0}catch(s){return(typeof FS>"u"||!(s instanceof FS.ErrnoError))&&abort(s),-s.errno}}Module._i64Add=_i64Add,Module._bitshift64Lshr=_bitshift64Lshr;function ___cxa_pure_virtual(){throw ABORT=!0,"Pure virtual function called!"}function _pthread_cleanup_push(u,n){__ATEXIT__.push(function(){Runtime.dynCall("vi",u,[n])}),_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cond_broadcast(){return 0}function ___cxa_guard_acquire(u){return HEAP8[u>>0]?0:(HEAP8[u>>0]=1,1)}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!"),__ATEXIT__.pop(),_pthread_cleanup_push.level=__ATEXIT__.length}function ___cxa_guard_release(){}function ___cxa_begin_catch(u){return __ZSt18uncaught_exceptionv.uncaught_exception--,EXCEPTIONS.caught.push(u),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(u)),u}function _llvm_eh_typeid_for(u){return u}function _emscripten_memcpy_big(u,n,s){return HEAPU8.set(HEAPU8.subarray(n,n+s),u),u}Module._memcpy=_memcpy;function ___syscall6(u,n){SYSCALLS.varargs=n;try{var s=SYSCALLS.getStreamFromFD();return FS.close(s),0}catch(c){return(typeof FS>"u"||!(c instanceof FS.ErrnoError))&&abort(c),-c.errno}}function _pthread_mutex_lock(){}function _sbrk(u){var n=_sbrk;n.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),n.called=!0,assert(Runtime.dynamicAlloc),n.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var s=DYNAMICTOP;if(u!=0){var c=n.alloc(u);if(!c)return 4294967295}return s}Module._bitshift64Shl=_bitshift64Shl;function ___cxa_guard_abort(){}Module._memmove=_memmove;function _pthread_cond_wait(){return 0}function ___cxa_rethrow(){___cxa_end_catch.rethrown=!0;var u=EXCEPTIONS.caught.pop();throw EXCEPTIONS.last=u,u}function _pthread_mutex_unlock(){}function _time(u){var n=Date.now()/1e3|0;return u&&(HEAP32[u>>2]=n),n}function _pthread_self(){return 0}function ___syscall140(u,n){SYSCALLS.varargs=n;try{var s=SYSCALLS.getStreamFromFD(),c=SYSCALLS.get(),f=SYSCALLS.get(),g=SYSCALLS.get(),A=SYSCALLS.get(),v=f;return assert(c===0),FS.llseek(s,v,A),HEAP32[g>>2]=s.position,s.getdents&&v===0&&A===0&&(s.getdents=null),0}catch(y){return(typeof FS>"u"||!(y instanceof FS.ErrnoError))&&abort(y),-y.errno}}function ___syscall146(u,n){SYSCALLS.varargs=n;try{var s=SYSCALLS.get(),c=SYSCALLS.get(),f=SYSCALLS.get(),g=0;___syscall146.buffer||(___syscall146.buffer=[]);for(var A=___syscall146.buffer,v=0;v>2],T=HEAP32[c+(v*8+4)>>2],I=0;I"u"||!(k instanceof FS.ErrnoError))&&abort(k),-k.errno}}function ___syscall145(u,n){SYSCALLS.varargs=n;try{var s=SYSCALLS.getStreamFromFD(),c=SYSCALLS.get(),f=SYSCALLS.get();return SYSCALLS.doReadv(s,c,f)}catch(g){return(typeof FS>"u"||!(g instanceof FS.ErrnoError))&&abort(g),-g.errno}}var ___dso_handle=allocate(1,"i32*",ALLOC_STATIC);Module.requestFullScreen=function u(n,s,c){Browser.requestFullScreen(n,s,c)},Module.requestAnimationFrame=function u(n){Browser.requestAnimationFrame(n)},Module.setCanvasSize=function u(n,s,c){Browser.setCanvasSize(n,s,c)},Module.pauseMainLoop=function u(){Browser.mainLoop.pause()},Module.resumeMainLoop=function u(){Browser.mainLoop.resume()},Module.getUserMedia=function u(){Browser.getUserMedia()},Module.createContext=function u(n,s,c,f){return Browser.createContext(n,s,c,f)},STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE2147483648?!1:(S=new c(t),k=new f(t),e=new g(t),N=new A(t),M=new v(t),O=new y(t),U=new T(t),B=new I(t),s=t,!0)}function na(t){t=t|0;var r=0;return r=b,b=b+t|0,b=b+15&-16,r|0}function ra(){return b|0}function sa(t){t=t|0,b=t}function oa(t,r){t=t|0,r=r|0,b=t,W=r}function aa(t,r){t=t|0,r=r|0,m||(m=t,Z=r)}function hA(t){t=t|0,S[q>>0]=S[t>>0],S[q+1>>0]=S[t+1>>0],S[q+2>>0]=S[t+2>>0],S[q+3>>0]=S[t+3>>0]}function dA(t){t=t|0,S[q>>0]=S[t>>0],S[q+1>>0]=S[t+1>>0],S[q+2>>0]=S[t+2>>0],S[q+3>>0]=S[t+3>>0],S[q+4>>0]=S[t+4>>0],S[q+5>>0]=S[t+5>>0],S[q+6>>0]=S[t+6>>0],S[q+7>>0]=S[t+7>>0]}function la(t){t=t|0,ye=t}function ua(){return ye|0}function ca(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0;if($=b,b=b+128|0,F=$+44|0,z=$+8|0,C=$+4|0,E=$,R=o+4|0,_=o+8|0,m=0,$e(35,e[o>>2]|0,e[R>>2]|0,e[_>>2]|0,a|0),D=m,m=0,D&1)H=5;else{d=F,h=d+84|0;do e[d>>2]=e[a>>2],d=d+4|0,a=a+4|0;while((d|0)<(h|0));if(a=F+12|0,!(e[a>>2]|0)&&(w=ie(((e[F+8>>2]|0)+7|0)/8|0,e[F>>2]|0)|0,e[a>>2]=w,(e[F+24>>2]|0)!=0)&&(D=ie(e[F+16>>2]|0,w)|0,e[a>>2]=D),m=0,ue(176,z|0),D=m,m=0,D&1)H=5;else{a=F+56|0;do if(e[a>>2]|0)if(m=0,a=ge(66,a|0)|0,D=m,m=0,D&1)H=15;else{if(e[C>>2]=a,h=z+28|0,d=e[h>>2]|0,d>>>0<(e[z+32>>2]|0)>>>0){e[d>>2]=a,e[h>>2]=d+4,e[C>>2]=0,H=19;break}if(m=0,Ae(57,z+24|0,C|0),D=m,m=0,D&1){if(h=j(824,0)|0,a=ye,d=e[C>>2]|0,e[C>>2]=0,!d)break;Rt[e[(e[d>>2]|0)+4>>2]&255](d);break}else{if(a=e[C>>2]|0,e[C>>2]=0,!a){H=19;break}Rt[e[(e[a>>2]|0)+4>>2]&255](a),H=19;break}}else H=19;while(!1);e:do if((H|0)==19)if(d=F+4|0,w=F+8|0,C=F+16|0,m=0,a=Pe(14,e[F>>2]|0,e[d>>2]|0,e[w>>2]|0,e[C>>2]|0)|0,D=m,m=0,D&1)H=15;else{e[E>>2]=a,D=z+28|0,h=e[D>>2]|0;do if(h>>>0>=(e[z+32>>2]|0)>>>0)if(m=0,Ae(57,z+24|0,E|0),h=m,m=0,h&1){if(h=j(824,0)|0,a=ye,d=e[E>>2]|0,e[E>>2]=0,!d)break e;Rt[e[(e[d>>2]|0)+4>>2]&255](d);break e}else{if(a=e[E>>2]|0,e[E>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}else e[h>>2]=a,e[D>>2]=h+4,e[E>>2]=0;while(!1);if(a=e[F+28>>2]|0,a|0&&(m=0,Ae(58,z|0,a|0),H=m,m=0,H&1)){H=15;break}t:do if(e[F+24>>2]|0){if(m=0,ve(4,z|0,o|0,F|0),H=m,m=0,H&1){H=15;break e}}else if(a=ie(e[d>>2]|0,e[F>>2]|0)|0,a=ie(a,((e[w>>2]|0)+7|0)/8|0)|0,(e[C>>2]|0)>0){for(d=0;m=0,ve(4,z|0,o|0,F|0),H=m,m=0,!(H&1);)if(h=e[R>>2]|0,h&&(e[R>>2]=h+a,e[_>>2]=(e[_>>2]|0)-a),d=d+1|0,(d|0)>=(e[C>>2]|0))break t;h=j(824,0)|0,a=ye,H=16;break e}while(!1);if(m=0,Ne(33,z|0,t|0)|0,H=m,m=0,H&1)H=15;else{if(e[r>>2]=e[z+16>>2],l&&(S[l>>0]=0),d=z+24|0,a=e[d>>2]|0,a){if(h=e[D>>2]|0,(h|0)!=(a|0)){do l=h+-4|0,e[D>>2]=l,h=e[l>>2]|0,e[l>>2]=0,h&&Rt[e[(e[h>>2]|0)+4>>2]&255](h),h=e[D>>2]|0;while((h|0)!=(a|0));a=e[d>>2]|0}he(a)}return l=0,b=$,l|0}}while(!1);if((H|0)==15&&(h=j(824,0)|0,a=ye,H=16),D=z+24|0,d=e[D>>2]|0,d){if(C=z+28|0,w=e[C>>2]|0,(w|0)!=(d|0)){do z=w+-4|0,e[C>>2]=z,w=e[z>>2]|0,e[z>>2]=0,w&&Rt[e[(e[w>>2]|0)+4>>2]&255](w),w=e[C>>2]|0;while((w|0)!=(d|0));d=e[D>>2]|0}he(d)}}}if((H|0)==5&&(h=j(824,0)|0,a=ye),z=(a|0)==($n(824)|0),w=K0(h|0)|0,a=(l|0)==0,!z)return a||(S[l>>0]=0),ei(),l=14,b=$,l|0;d=w+12|0;do if(a)H=60;else if(a=e[d>>2]|0,m=0,h=Ce(1)|0,z=m,m=0,!(z&1))if((a|0)==(h|0)){Rr(l,Et[e[(e[w>>2]|0)+8>>2]&127](w)|0)|0,H=60;break}else{S[l>>0]=0,H=60;break}while(!1);return(H|0)==60&&(K=e[d>>2]|0,m=0,G=Ce(1)|0,l=m,m=0,!(l&1))?(l=(K|0)==(G|0)?e[w+8>>2]|0:13,ei(),b=$,l|0):(a=j()|0,m=0,bt(3),$=m,m=0,$&1?($=j(0)|0,$t($)):le(a|0),0)}function fa(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0;switch(D=b,b=b+112|0,h=D+96|0,C=D+84|0,E=D+72|0,F=D+60|0,R=D+48|0,_=D+36|0,z=D+24|0,H=D+12|0,K=D,w=(r|0)==0,(t|0)==0&w&&(l=Ct(16)|0,m=0,ve(5,h|0,48504,52),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,h|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(h),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),d=e[a>>2]|0,(d+-1|0)>>>0>65534&&(l=Ct(16)|0,m=0,ve(5,C|0,48557,41),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,C|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(C),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),h=e[a+4>>2]|0,(h+-1|0)>>>0>65534&&(l=Ct(16)|0,m=0,ve(5,E|0,48599,42),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,E|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(E),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),l=e[a+8>>2]|0,(l+-2|0)>>>0>14&&(l=Ct(16)|0,m=0,ve(5,F|0,48642,46),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,F|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(F),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),t=e[a+24>>2]|0,t>>>0>=3&&(l=Ct(16)|0,m=0,ve(5,R|0,48689,65),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,R|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(R),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),r=e[a+16>>2]|0,(r+-1|0)>>>0>254&&(l=Ct(16)|0,m=0,ve(5,_|0,48755,44),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,_|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(_),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),!w&&(_=ie(h,d)|0,(ie(ie(_,(l|0)>8?2:1)|0,r)|0)>>>0>o>>>0)&&(l=Ct(16)|0,m=0,ve(5,z|0,48800,58),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,z|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(z),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)),r|0){case 4:{if((t|0)!=2){b=D;return}l=Ct(16)|0,m=0,ve(5,H|0,48859,73),K=m,m=0,K&1?r=j()|0:(m=0,r=Ce(1)|0,K=m,m=0,!(K&1)&&(m=0,$e(36,l|0,1,r|0,H|0),K=m,m=0,!(K&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(H),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)}case 3:{b=D;return}default:{if(!t){b=D;return}l=Ct(16)|0,m=0,ve(5,K|0,48933,73),H=m,m=0,H&1?r=j()|0:(m=0,r=Ce(1)|0,H=m,m=0,!(H&1)&&(m=0,$e(36,l|0,1,r|0,K|0),H=m,m=0,!(H&1))?(m=0,ve(6,l|0,824,96),m=0,t=0):t=1,r=j()|0,de(K),t||(K=r,le(K|0))),It(l|0),K=r,le(K|0)}}}function $t(t){t=t|0,K0(t|0)|0,P6()}function ha(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+128|0,h=E+116|0,d=E,m=0,e[h>>2]=e[r>>2],e[h+4>>2]=e[r+4>>2],e[h+8>>2]=e[r+8>>2],Ae(59,d|0,h|0),l=m,m=0,!(l&1)){if(o){l=d+16|0,r=l+84|0;do e[l>>2]=e[o>>2],l=l+4|0,o=o+4|0;while((l|0)<(r|0))}if(m=0,e[h>>2]=e[t>>2],e[h+4>>2]=e[t+4>>2],e[h+8>>2]=e[t+8>>2],Ae(60,d|0,h|0),d=m,m=0,!(d&1))return a&&(S[a>>0]=0),D=0,b=E,D|0}if(t=j(824,0)|0,d=ye,d=(d|0)==($n(824)|0),t=K0(t|0)|0,r=(a|0)==0,!d)return r||(S[a>>0]=0),ei(),D=14,b=E,D|0;l=t+12|0;do if(r)D=10;else if(r=e[l>>2]|0,m=0,o=Ce(1)|0,d=m,m=0,!(d&1))if((r|0)==(o|0)){Rr(a,Et[e[(e[t>>2]|0)+8>>2]&127](t)|0)|0,D=10;break}else{S[a>>0]=0,D=10;break}while(!1);return(D|0)==10&&(w=e[l>>2]|0,m=0,C=Ce(1)|0,D=m,m=0,!(D&1))?(D=(w|0)==(C|0)?e[t+8>>2]|0:13,ei(),b=E,D|0):(r=j()|0,m=0,bt(3),E=m,m=0,E&1?(E=j(0)|0,$t(E)):le(r|0),0)}function da(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(C=b,b=b+128|0,l=C+116|0,a=C,m=0,e[l>>2]=e[t>>2],e[l+4>>2]=e[t+4>>2],e[l+8>>2]=e[t+8>>2],Ae(59,a|0,l|0),l=m,m=0,!(l&1)&&(m=0,ue(177,a|0),l=m,m=0,!(l&1))&&(m=0,Ae(61,a|0,1),l=m,m=0,!(l&1))){t=a+16|0,a=r+84|0;do e[r>>2]=e[t>>2],r=r+4|0,t=t+4|0;while((r|0)<(a|0));return o&&(S[o>>0]=0),o=0,b=C,o|0}if(l=j(824,0)|0,r=ye,r=(r|0)==($n(824)|0),l=K0(l|0)|0,t=(o|0)==0,!r)return t||(S[o>>0]=0),ei(),o=14,b=C,o|0;r=l+12|0;do if(t)w=13;else if(t=e[r>>2]|0,m=0,a=Ce(1)|0,D=m,m=0,!(D&1))if((t|0)==(a|0)){Rr(o,Et[e[(e[l>>2]|0)+8>>2]&127](l)|0)|0,w=13;break}else{S[o>>0]=0,w=13;break}while(!1);return(w|0)==13&&(h=e[r>>2]|0,m=0,d=Ce(1)|0,D=m,m=0,!(D&1))?(D=(h|0)==(d|0)?e[l+8>>2]|0:13,ei(),b=C,D|0):(t=j()|0,m=0,bt(3),D=m,m=0,D&1?(D=j(0)|0,$t(D)):le(t|0),0)}function pa(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0;return F=b,b=b+48|0,C=F+36|0,w=F+24|0,D=F+12|0,E=F,(t|0)!=0&(o|0)!=0&(a|0)!=0&(h|0)!=0?(e[D>>2]=0,e[D+4>>2]=t,e[D+8>>2]=r,e[E>>2]=0,e[E+4>>2]=a,e[E+8>>2]=l,e[w>>2]=e[D>>2],e[w+4>>2]=e[D+4>>2],e[w+8>>2]=e[D+8>>2],e[C>>2]=e[E>>2],e[C+4>>2]=e[E+4>>2],e[C+8>>2]=e[E+8>>2],l=ca(w,o,C,h,d)|0,b=F,l|0):(l=1,b=F,l|0)}function ma(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;return l=b,b=b+32|0,h=l+12|0,d=l,w=d,e[w>>2]=0,e[w+4>>2]=0,e[d+4>>2]=t,e[d+8>>2]=r,e[h>>2]=e[d>>2],e[h+4>>2]=e[d+4>>2],e[h+8>>2]=e[d+8>>2],o=da(h,o,a)|0,b=l,o|0}function ga(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+48|0,w=d+36|0,C=d+24|0,E=d+12|0,D=d,e[E>>2]=0,e[E+4>>2]=t,e[E+8>>2]=r,e[D>>2]=0,e[D+4>>2]=o,e[D+8>>2]=a,e[C>>2]=e[E>>2],e[C+4>>2]=e[E+4>>2],e[C+8>>2]=e[E+8>>2],e[w>>2]=e[D>>2],e[w+4>>2]=e[D+4>>2],e[w+8>>2]=e[D+8>>2],a=ha(C,w,l,h)|0,b=d,a|0}function Sa(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(D=t+4|0,o=e[t>>2]|0,l=((e[D>>2]|0)-o>>2)+1|0,l>>>0>1073741823&&(pi(t),o=e[t>>2]|0),E=t+8|0,a=(e[E>>2]|0)-o|0,a>>2>>>0<536870911?(a=a>>1,a=a>>>0>>0?l:a,o=(e[D>>2]|0)-o>>2,a?w=6:(h=0,d=0)):(a=1073741823,o=(e[D>>2]|0)-o>>2,w=6),(w|0)==6&&(h=a,d=Xe(a<<2)|0),l=d+(o<<2)|0,a=l,C=d+(h<<2)|0,w=e[r>>2]|0,e[r>>2]=0,e[l>>2]=w,w=d+(o+1<<2)|0,d=e[t>>2]|0,o=e[D>>2]|0,(o|0)==(d|0))l=t,h=D;else{do o=o+-4|0,r=e[o>>2]|0,e[o>>2]=0,e[l+-4>>2]=r,l=a+-4|0,a=l;while((o|0)!=(d|0));o=a,l=t,h=D,a=o,d=e[t>>2]|0,o=e[D>>2]|0}if(e[l>>2]=a,e[h>>2]=w,e[E>>2]=C,l=d,(o|0)!=(l|0))do o=o+-4|0,a=e[o>>2]|0,e[o>>2]=0,a&&Rt[e[(e[a>>2]|0)+4>>2]&255](a);while((o|0)!=(l|0));d&&he(d)}function Aa(){return S[8]|0||!(kt(8)|0)||(Nt(72,35648,Q|0)|0,Dt(8)),35648}function un(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;E=b,b=b+32|0,C=E,m0(C,(1<>2]|0,D=h+1|0,o=D<<1,e[t>>2]=0,d=t+4|0,e[d>>2]=0,e[t+8>>2]=0;e:do if(D){if((h|0)<-1&&(m=0,ue(178,t|0),w=m,m=0,w&1)||(a=4),(a|0)==4&&(m=0,l=ge(67,o|0)|0,w=m,m=0,!(w&1))){for(e[d>>2]=l,e[t>>2]=l,e[t+8>>2]=l+o,r=l;;)if(S[r>>0]=0,r=(e[d>>2]|0)+1|0,e[d>>2]=r,o=o+-1|0,!o)break e}o=j()|0,r=e[t>>2]|0,r||le(o|0),(e[d>>2]|0)!=(r|0)&&(e[d>>2]=r),he(r),le(o|0)}while(!1);if(r=~h,(h|0)<(r|0)){b=E;return}d=C+12|0,w=C+8|0,h=C+4|0,l=r;do r=e[d>>2]|0,(l|0)>(0-r|0)?(o=e[w>>2]|0,(l|0)>(0-o|0)?(a=e[h>>2]|0,(l|0)>(0-a|0)?(l|0)>=0?(l|0)>0?(a|0)<=(l|0)?(o|0)>(l|0)?r=2:r=(r|0)>(l|0)?3:4:r=1:r=0:r=-1:r=-2):r=-3):r=-4,S[(e[t>>2]|0)+(l+D)>>0]=r,l=l+1|0;while((l|0)<(D|0));b=E}function va(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;switch(R=e[o+16>>2]|0,R|0){case 64:case 0:{m=0,t=Ne(34,t|0,r|0)|0,r=m,m=0,r&1?_=16:a=t;break}default:{for(l=(1<>2])+-1|0,F=e[r+20>>2]|0,E=F<<1,E=((E+l|0)/(E|1|0)|0)+1|0,t=0;(1<>2]|0,m=0,a=ge(67,4624)|0,D=m,m=0,D&1)_=16;else{h=((d|0)<8?8:d)+d<<1,w=a+4|0,C=r,D=w+84|0;do e[w>>2]=e[C>>2],w=w+4|0,C=C+4|0;while((w|0)<(D|0));w=a+88|0,D=w+40|0;do e[w>>2]=0,w=w+4|0;while((w|0)<(D|0));e[a>>2]=35660,e[a+128>>2]=l,e[a+132>>2]=E,e[a+136>>2]=F,e[a+140>>2]=t,e[a+144>>2]=d,e[a+148>>2]=h,e[a+152>>2]=R,t=a+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+172>>2]=e[r>>2],e[a+176>>2]=0,e[a+180>>2]=0,e[a+184>>2]=0,t=a+4568|0,l=a+188|0;do e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,k[l+10>>1]=1,l=l+12|0;while((l|0)!=(t|0));e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1)}}}return(_|0)==16&&(_=j()|0,le(_|0)),!a||(m=0,Ae(e[(e[a>>2]|0)+12>>2]|0,a|0,o|0),_=m,m=0,!(_&1))?a|0:(t=j()|0,a||(_=t,le(_|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),_=t,le(_|0),0)}function xa(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(o=(e[r+24>>2]|0)==2,o&&(e[r+16>>2]|0)!=3)return r=0,r|0;E=e[r+20>>2]|0,t=e[r+8>>2]|0;e:do if(!E){if(o){if((t|0)!=8)break;a=Xe(4600)|0,d=a+4|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=a+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[a>>2]=35688,t=a+132|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+148>>2]=e[r>>2],e[a+152>>2]=0,e[a+156>>2]=0,e[a+160>>2]=0,t=a+4544|0,o=a+164|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4556|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4568|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1),r=a,r|0}switch(t|0){case 8:{a=Xe(4600)|0,d=a+4|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=a+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[a>>2]=35716,t=a+132|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+148>>2]=e[r>>2],e[a+152>>2]=0,e[a+156>>2]=0,e[a+160>>2]=0,t=a+4544|0,o=a+164|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4556|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4568|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1),r=a,r|0}case 12:{a=Xe(4600)|0,d=a+4|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=a+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[a>>2]=35744,t=a+132|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+148>>2]=e[r>>2],e[a+152>>2]=0,e[a+156>>2]=0,e[a+160>>2]=0,t=a+4544|0,o=a+164|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4556|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4568|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1),r=a,r|0}case 16:{a=Xe(4600)|0,d=a+4|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=a+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[a>>2]=35772,t=a+132|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+148>>2]=e[r>>2],e[a+152>>2]=0,e[a+156>>2]=0,e[a+160>>2]=0,t=a+4544|0,o=a+164|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4556|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4568|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+28>>2]|0||(e[a+20>>2]=1),r=a,r|0}default:break e}}while(!1);if(D=(1<>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=l+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[l>>2]=35800,e[l+128>>2]=D,e[l+132>>2]=h,e[l+136>>2]=E,e[l+140>>2]=t,e[l+144>>2]=o,e[l+148>>2]=a,e[l+152>>2]=64,t=l+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+172>>2]=e[r>>2],e[l+176>>2]=0,e[l+180>>2]=0,e[l+184>>2]=0,t=l+4568|0,o=l+188|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+28>>2]|0||(e[l+20>>2]=1),r=l,r|0}else{for(t=0;(1<>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=l+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[l>>2]=35660,e[l+128>>2]=D,e[l+132>>2]=h,e[l+136>>2]=E,e[l+140>>2]=t,e[l+144>>2]=o,e[l+148>>2]=a,e[l+152>>2]=64,t=l+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+172>>2]=e[r>>2],e[l+176>>2]=0,e[l+180>>2]=0,e[l+184>>2]=0,t=l+4568|0,o=l+188|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+28>>2]|0||(e[l+20>>2]=1),r=l,r|0}if((t|0)>=17)return r=0,r|0;if(h=E<<1,h=((h+D|0)/(h|1|0)|0)+1|0,o){for(t=0;(1<>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=l+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[l>>2]=35828,e[l+128>>2]=D,e[l+132>>2]=h,e[l+136>>2]=E,e[l+140>>2]=t,e[l+144>>2]=o,e[l+148>>2]=a,e[l+152>>2]=64,t=l+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+172>>2]=e[r>>2],e[l+176>>2]=0,e[l+180>>2]=0,e[l+184>>2]=0,t=l+4568|0,o=l+188|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+28>>2]|0||(e[l+20>>2]=1),r=l,r|0}else{for(t=0;(1<>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));d=l+88|0,C=d+40|0;do e[d>>2]=0,d=d+4|0;while((d|0)<(C|0));e[l>>2]=35856,e[l+128>>2]=D,e[l+132>>2]=h,e[l+136>>2]=E,e[l+140>>2]=t,e[l+144>>2]=o,e[l+148>>2]=a,e[l+152>>2]=64,t=l+156|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+172>>2]=e[r>>2],e[l+176>>2]=0,e[l+180>>2]=0,e[l+184>>2]=0,t=l+4568|0,o=l+188|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4580|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4592|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+28>>2]|0||(e[l+20>>2]=1),r=l,r|0}return 0}function wa(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;switch(R=e[o+16>>2]|0,R|0){case 64:case 0:{m=0,t=Ne(35,t|0,r|0)|0,r=m,m=0,r&1?_=16:a=t;break}default:{for(l=(1<>2])+-1|0,F=e[r+20>>2]|0,E=F<<1,E=((E+l|0)/(E|1|0)|0)+1|0,t=0;(1<>2]|0,m=0,a=ge(67,4632)|0,D=m,m=0,D&1)_=16;else{h=((d|0)<8?8:d)+d<<1,e[a+4>>2]=0,w=a+8|0,C=r,D=w+84|0;do e[w>>2]=e[C>>2],w=w+4|0,C=C+4|0;while((w|0)<(D|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,D=a+116|0,e[D>>2]=0,e[D+4>>2]=0,e[D+8>>2]=0,e[D+12>>2]=0,e[D+16>>2]=0,e[a>>2]=35884,e[a+136>>2]=l,e[a+140>>2]=E,e[a+144>>2]=F,e[a+148>>2]=t,e[a+152>>2]=d,e[a+156>>2]=h,e[a+160>>2]=R,t=a+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+180>>2]=e[r>>2],e[a+184>>2]=0,e[a+188>>2]=0,e[a+192>>2]=0,t=a+4576|0,l=a+196|0;do e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,k[l+10>>1]=1,l=l+12|0;while((l|0)!=(t|0));e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1)}}}return(_|0)==16&&(_=j()|0,le(_|0)),!a||(m=0,Ae(e[(e[a>>2]|0)+8>>2]|0,a|0,o|0),_=m,m=0,!(_&1))?a|0:(t=j()|0,a||(_=t,le(_|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),_=t,le(_|0),0)}function ya(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(o=(e[r+24>>2]|0)==2,o&&(e[r+16>>2]|0)!=3)return r=0,r|0;E=e[r+20>>2]|0,t=e[r+8>>2]|0;e:do if(!E){if(o){if((t|0)!=8)break;a=Xe(4608)|0,e[a+4>>2]=0,d=a+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,t=a+116|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[a>>2]=35912,t=a+140|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+156>>2]=e[r>>2],e[a+160>>2]=0,e[a+164>>2]=0,e[a+168>>2]=0,t=a+4552|0,o=a+172|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4564|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4576|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1),r=a,r|0}switch(t|0){case 8:{a=Xe(4608)|0,e[a+4>>2]=0,d=a+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,t=a+116|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[a>>2]=35940,t=a+140|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+156>>2]=e[r>>2],e[a+160>>2]=0,e[a+164>>2]=0,e[a+168>>2]=0,t=a+4552|0,o=a+172|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4564|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4576|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1),r=a,r|0}case 12:{a=Xe(4608)|0,e[a+4>>2]=0,d=a+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,t=a+116|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[a>>2]=35968,t=a+140|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+156>>2]=e[r>>2],e[a+160>>2]=0,e[a+164>>2]=0,e[a+168>>2]=0,t=a+4552|0,o=a+172|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4564|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4576|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1),r=a,r|0}case 16:{a=Xe(4608)|0,e[a+4>>2]=0,d=a+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[a+92>>2]=0,e[a+96>>2]=0,e[a+100>>2]=32,e[a+104>>2]=0,e[a+108>>2]=0,S[a+112>>0]=0,t=a+116|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[a>>2]=35996,t=a+140|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[a+156>>2]=e[r>>2],e[a+160>>2]=0,e[a+164>>2]=0,e[a+168>>2]=0,t=a+4552|0,o=a+172|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=a+4564|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=a+4576|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[a+32>>2]|0||(e[a+24>>2]=1),r=a,r|0}default:break e}}while(!1);if(D=(1<>2]=0,d=l+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[l+92>>2]=0,e[l+96>>2]=0,e[l+100>>2]=32,e[l+104>>2]=0,e[l+108>>2]=0,S[l+112>>0]=0,C=l+116|0,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,e[C+12>>2]=0,e[C+16>>2]=0,e[l>>2]=36024,e[l+136>>2]=D,e[l+140>>2]=h,e[l+144>>2]=E,e[l+148>>2]=t,e[l+152>>2]=o,e[l+156>>2]=a,e[l+160>>2]=64,t=l+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+180>>2]=e[r>>2],e[l+184>>2]=0,e[l+188>>2]=0,e[l+192>>2]=0,t=l+4576|0,o=l+196|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+32>>2]|0||(e[l+24>>2]=1),r=l,r|0}else{for(t=0;(1<>2]=0,d=l+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[l+92>>2]=0,e[l+96>>2]=0,e[l+100>>2]=32,e[l+104>>2]=0,e[l+108>>2]=0,S[l+112>>0]=0,C=l+116|0,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,e[C+12>>2]=0,e[C+16>>2]=0,e[l>>2]=35884,e[l+136>>2]=D,e[l+140>>2]=h,e[l+144>>2]=E,e[l+148>>2]=t,e[l+152>>2]=o,e[l+156>>2]=a,e[l+160>>2]=64,t=l+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+180>>2]=e[r>>2],e[l+184>>2]=0,e[l+188>>2]=0,e[l+192>>2]=0,t=l+4576|0,o=l+196|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+32>>2]|0||(e[l+24>>2]=1),r=l,r|0}if((t|0)>=17)return r=0,r|0;if(h=E<<1,h=((h+D|0)/(h|1|0)|0)+1|0,o){for(t=0;(1<>2]=0,d=l+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[l+92>>2]=0,e[l+96>>2]=0,e[l+100>>2]=32,e[l+104>>2]=0,e[l+108>>2]=0,S[l+112>>0]=0,C=l+116|0,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,e[C+12>>2]=0,e[C+16>>2]=0,e[l>>2]=36052,e[l+136>>2]=D,e[l+140>>2]=h,e[l+144>>2]=E,e[l+148>>2]=t,e[l+152>>2]=o,e[l+156>>2]=a,e[l+160>>2]=64,t=l+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+180>>2]=e[r>>2],e[l+184>>2]=0,e[l+188>>2]=0,e[l+192>>2]=0,t=l+4576|0,o=l+196|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+32>>2]|0||(e[l+24>>2]=1),r=l,r|0}else{for(t=0;(1<>2]=0,d=l+8|0,w=r,C=d+84|0;do e[d>>2]=e[w>>2],d=d+4|0,w=w+4|0;while((d|0)<(C|0));e[l+92>>2]=0,e[l+96>>2]=0,e[l+100>>2]=32,e[l+104>>2]=0,e[l+108>>2]=0,S[l+112>>0]=0,C=l+116|0,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,e[C+12>>2]=0,e[C+16>>2]=0,e[l>>2]=36080,e[l+136>>2]=D,e[l+140>>2]=h,e[l+144>>2]=E,e[l+148>>2]=t,e[l+152>>2]=o,e[l+156>>2]=a,e[l+160>>2]=64,t=l+164|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[l+180>>2]=e[r>>2],e[l+184>>2]=0,e[l+188>>2]=0,e[l+192>>2]=0,t=l+4576|0,o=l+196|0;do e[o>>2]=0,e[o+4>>2]=0,k[o+8>>1]=0,k[o+10>>1]=1,o=o+12|0;while((o|0)!=(t|0));return e[t>>2]=0,e[t+4>>2]=0,k[t+8>>1]=0,S[t+10>>0]=0,r=l+4588|0,e[r>>2]=0,e[r+4>>2]=0,k[r+8>>1]=0,S[r+10>>0]=0,r=l+4600|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[r+16>>2]=0,e[r+20>>2]=0,e[r+24>>2]=0,S[r+28>>0]=0,e[l+32>>2]|0||(e[l+24>>2]=1),r=l,r|0}return 0}function Ca(){var t=0,r=0,o=0,a=0,l=0,h=0,d=0;t=2832;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=4880);Jt(2832,0,2048)|0,t=0;do d=2832+(t+128<<3)|0,e[d>>2]=0,e[d+4>>2]=1,t=t+1|0;while((t|0)!=128);t=3088,e[t>>2]=1,e[t+4>>2]=3,t=3096,e[t>>2]=1,e[t+4>>2]=3,t=3104,e[t>>2]=1,e[t+4>>2]=3,t=3112,e[t>>2]=1,e[t+4>>2]=3,t=3120,e[t>>2]=1,e[t+4>>2]=3,t=3128,e[t>>2]=1,e[t+4>>2]=3,t=3136,e[t>>2]=1,e[t+4>>2]=3,t=3144,e[t>>2]=1,e[t+4>>2]=3,t=3152,e[t>>2]=1,e[t+4>>2]=3,t=3160,e[t>>2]=1,e[t+4>>2]=3,t=3168,e[t>>2]=1,e[t+4>>2]=3,t=3176,e[t>>2]=1,e[t+4>>2]=3,t=3184,e[t>>2]=1,e[t+4>>2]=3,t=3192,e[t>>2]=1,e[t+4>>2]=3,t=3200,e[t>>2]=1,e[t+4>>2]=3,t=3208,e[t>>2]=1,e[t+4>>2]=3,t=3216,e[t>>2]=1,e[t+4>>2]=3,t=3224,e[t>>2]=1,e[t+4>>2]=3,t=3232,e[t>>2]=1,e[t+4>>2]=3,t=3240,e[t>>2]=1,e[t+4>>2]=3,t=3248,e[t>>2]=1,e[t+4>>2]=3,t=3256,e[t>>2]=1,e[t+4>>2]=3,t=3264,e[t>>2]=1,e[t+4>>2]=3,t=3272,e[t>>2]=1,e[t+4>>2]=3,t=3280,e[t>>2]=1,e[t+4>>2]=3,t=3288,e[t>>2]=1,e[t+4>>2]=3,t=3296,e[t>>2]=1,e[t+4>>2]=3,t=3304,e[t>>2]=1,e[t+4>>2]=3,t=3312,e[t>>2]=1,e[t+4>>2]=3,t=3320,e[t>>2]=1,e[t+4>>2]=3,t=3328,e[t>>2]=1,e[t+4>>2]=3,t=3336,e[t>>2]=1,e[t+4>>2]=3,t=2896,e[t>>2]=2,e[t+4>>2]=5,t=2904,e[t>>2]=2,e[t+4>>2]=5,t=2912,e[t>>2]=2,e[t+4>>2]=5,t=2920,e[t>>2]=2,e[t+4>>2]=5,t=2928,e[t>>2]=2,e[t+4>>2]=5,t=2936,e[t>>2]=2,e[t+4>>2]=5,t=2944,e[t>>2]=2,e[t+4>>2]=5,t=2952,e[t>>2]=2,e[t+4>>2]=5,t=2848,e[t>>2]=3,e[t+4>>2]=7,t=2856,e[t>>2]=3,e[t+4>>2]=7,t=0;do d=2832+(t+64<<3)|0,e[d>>2]=-1,e[d+4>>2]=2,t=t+1|0;while((t|0)!=64);t=2960,e[t>>2]=-2,e[t+4>>2]=4,t=2968,e[t>>2]=-2,e[t+4>>2]=4,t=2976,e[t>>2]=-2,e[t+4>>2]=4,t=2984,e[t>>2]=-2,e[t+4>>2]=4,t=2992,e[t>>2]=-2,e[t+4>>2]=4,t=3e3,e[t>>2]=-2,e[t+4>>2]=4,t=3008,e[t>>2]=-2,e[t+4>>2]=4,t=3016,e[t>>2]=-2,e[t+4>>2]=4,t=3024,e[t>>2]=-2,e[t+4>>2]=4,t=3032,e[t>>2]=-2,e[t+4>>2]=4,t=3040,e[t>>2]=-2,e[t+4>>2]=4,t=3048,e[t>>2]=-2,e[t+4>>2]=4,t=3056,e[t>>2]=-2,e[t+4>>2]=4,t=3064,e[t>>2]=-2,e[t+4>>2]=4,t=3072,e[t>>2]=-2,e[t+4>>2]=4,t=3080,e[t>>2]=-2,e[t+4>>2]=4,t=2864,e[t>>2]=-3,e[t+4>>2]=6,t=2872,e[t>>2]=-3,e[t+4>>2]=6,t=2880,e[t>>2]=-3,e[t+4>>2]=6,t=2888,e[t>>2]=-3,e[t+4>>2]=6,t=2840,e[t>>2]=-4,e[t+4>>2]=8,t=4880;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=6928);for(Jt(4880,0,2048)|0,o=2,t=0,l=0,h=0;;){if(o=o<<16>>16,r=8-o|0,a=1<>2]=l,e[d+4>>2]=o,r=r+1|0;while((r|0)<(a|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==7){r=2,l=1,h=-1,d=-1;break}else o=(t>>1)+2|0,l=r>>16}for(;;){if(o=r<<16>>16,t=8-o|0,a=1<>2]=h,e[l+4>>2]=o,r=r+1|0;while((r|0)<(a|0))}if(t=(d<<16)+-65536|0,l=t>>31^t>>15,r=(l>>1)+2|0,(r|0)>8){t=6928;break}else h=t>>16,d=d+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=8976);for(Jt(6928,0,2048)|0,l=3,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==12){l=3,r=1,a=-1,h=-1;break}else l=(t>>2)+3|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>2)+3|0,(l|0)>8){t=8976;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=11024);for(Jt(8976,0,2048)|0,l=4,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==20){l=4,r=1,a=-1,h=-1;break}else l=(t>>3)+4|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>3)+4|0,(l|0)>8){t=11024;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=13072);for(Jt(11024,0,2048)|0,l=5,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==32){l=5,r=1,a=-1,h=-1;break}else l=(t>>4)+5|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>4)+5|0,(l|0)>8){t=13072;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=15120);for(Jt(13072,0,2048)|0,l=6,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==48){l=6,r=1,a=-1,h=-1;break}else l=(t>>5)+6|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>5)+6|0,(l|0)>8){t=15120;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=17168);for(Jt(15120,0,2048)|0,l=7,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==64){l=7,r=1,a=-1,h=-1;break}else l=(t>>6)+7|0,a=r>>16}for(;;){if(t=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(t=(h<<16)+-65536|0,r=t>>31^t>>15,l=(r>>6)+7|0,(l|0)>8){t=17168;break}else a=t>>16,h=h+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=19216);for(Jt(17168,0,2048)|0,l=8,t=0,a=0,h=0;;){if(r=8-l|0,o=1<>2]=a,e[d+4>>2]=l,r=r+1|0;while((r|0)<(o|0))}if(r=(h<<16)+65536|0,t=r>>31^r>>15,h=h+1|0,(h|0)==64){h=8,a=1,l=-1,d=-1;break}else l=(t>>7)+8|0,a=r>>16}for(;;){if(t=8-h|0,o=1<>2]=l,e[a+4>>2]=h,r=r+1|0;while((r|0)<(o|0))}if(r=(d<<16)+-65536|0,a=r>>31^r>>15,t=a>>7,(t|0)>0){t=19216;break}else h=t+8|0,l=r>>16,d=d+-1|0}do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=21264);Jt(19216,0,2048)|0,t=21264;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=23312);Jt(21264,0,2048)|0,t=23312;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=25360);Jt(23312,0,2048)|0,t=25360;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=27408);Jt(25360,0,2048)|0,t=27408;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=29456);Jt(27408,0,2048)|0,t=29456;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=31504);Jt(29456,0,2048)|0,t=31504;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=33552);Jt(31504,0,2048)|0,t=33552;do e[t>>2]=0,e[t+4>>2]=0,t=t+8|0;while((t|0)!=35600);Jt(33552,0,2048)|0,un(35600,8),Nt(179,35600,Q|0)|0,un(35612,10),Nt(179,35612,Q|0)|0,un(35624,12),Nt(179,35624,Q|0)|0,un(35636,16),Nt(179,35636,Q|0)|0}function Ta(t){t=t|0;var r=0;r=e[t>>2]|0,r&&(t=t+4|0,(e[t>>2]|0)!=(r|0)&&(e[t>>2]=r),he(r))}function Ia(t){t=t|0;var r=0,o=0;e[t>>2]=36080,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function ka(t){t=t|0;var r=0,o=0;if(e[t>>2]=36080,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Ea(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+136>>2]|0,e[t+144>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+184>>2]=w|0?w:e[C+4>>2]|0,e[t+188>>2]=h,e[t+192>>2]=l,Wl(t),l=t+140|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+196+(h*12|0)>>2]=r,e[t+196+(h*12|0)+4>>2]=0,k[t+196+(h*12|0)+8>>1]=0,k[t+196+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4576>>2]=w,e[t+4580>>2]=0,S[t+4584>>0]=C,S[t+4585>>0]=1,S[t+4586>>0]=0,e[t+4588>>2]=w,e[t+4592>>2]=1,S[t+4596>>0]=C,S[t+4597>>0]=1,S[t+4598>>0]=0,e[t+4600>>2]=0,b=d}function Da(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4624)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35856,e[r+128>>2]=e[t+136>>2],e[r+132>>2]=e[t+140>>2],e[r+136>>2]=e[t+144>>2],e[r+140>>2]=e[t+148>>2],e[r+144>>2]=e[t+152>>2],e[r+148>>2]=e[t+156>>2],e[r+152>>2]=e[t+160>>2],l=r+156|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+172>>2]=e[a>>2],e[r+176>>2]=0,e[r+180>>2]=0,e[r+184>>2]=0,l=r+4568|0,a=r+188|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4580|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4592|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,es(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],es(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function ba(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function Fa(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;e[t>>2]=36460,e[t+4>>2]=o,F=t+8|0,h=e[o>>2]|0,D=o+16|0,a=e[D>>2]|0,d=ie(a,h)|0,e[F>>2]=0,R=t+12|0,e[R>>2]=0,e[t+16>>2]=0;do if(d){if((d|0)<0&&(m=0,ue(178,F|0),h=m,m=0,h&1)||(E=4),(E|0)==4&&(w=d<<1,m=0,C=ge(67,w|0)|0,h=m,m=0,!(h&1))){e[F>>2]=C,h=C+(d<<1)|0,e[t+16>>2]=h,Jt(C|0,0,w|0)|0,e[R>>2]=h,h=e[o>>2]|0,a=e[D>>2]|0;break}d=j()|0,l=e[F>>2]|0,a=l,l&&(h=e[R>>2]|0,(h|0)!=(l|0)&&(e[R>>2]=h+(~((h+-2-a|0)>>>1)<<1)),he(l)),R=d,le(R|0)}while(!1);if(d=t+20|0,a=ie(h<<1,a)|0,e[d>>2]=0,w=t+24|0,e[w>>2]=0,e[t+28>>2]=0,!a){R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(E=13),(E|0)==13&&(m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[w>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[w>>2]|0)+1|0,e[w>>2]=l,a=a+-1|0;while(a|0);R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}h=j()|0,l=e[d>>2]|0,l&&((e[w>>2]|0)!=(l|0)&&(e[w>>2]=l),he(l)),l=e[F>>2]|0,l||(R=h,le(R|0)),a=e[R>>2]|0,(a|0)!=(l|0)&&(e[R>>2]=a+(~((a+-2-l|0)>>>1)<<1)),he(l),R=h,le(R|0)}function Na(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;e[t>>2]=36436,e[t+4>>2]=o,F=t+8|0,h=e[o>>2]|0,D=o+16|0,a=e[D>>2]|0,d=ie(a,h)|0,e[F>>2]=0,R=t+12|0,e[R>>2]=0,e[t+16>>2]=0;do if(d){if((d|0)<0&&(m=0,ue(178,F|0),h=m,m=0,h&1)||(E=4),(E|0)==4&&(w=d<<1,m=0,C=ge(67,w|0)|0,h=m,m=0,!(h&1))){e[F>>2]=C,h=C+(d<<1)|0,e[t+16>>2]=h,Jt(C|0,0,w|0)|0,e[R>>2]=h,h=e[o>>2]|0,a=e[D>>2]|0;break}d=j()|0,l=e[F>>2]|0,a=l,l&&(h=e[R>>2]|0,(h|0)!=(l|0)&&(e[R>>2]=h+(~((h+-2-a|0)>>>1)<<1)),he(l)),R=d,le(R|0)}while(!1);if(d=t+20|0,a=ie(h<<1,a)|0,e[d>>2]=0,w=t+24|0,e[w>>2]=0,e[t+28>>2]=0,!a){R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(E=13),(E|0)==13&&(m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[w>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[w>>2]|0)+1|0,e[w>>2]=l,a=a+-1|0;while(a|0);R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}h=j()|0,l=e[d>>2]|0,l&&((e[w>>2]|0)!=(l|0)&&(e[w>>2]=l),he(l)),l=e[F>>2]|0,l||(R=h,le(R|0)),a=e[R>>2]|0,(a|0)!=(l|0)&&(e[R>>2]=a+(~((a+-2-l|0)>>>1)<<1)),he(l),R=h,le(R|0)}function Ra(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;e[t>>2]=36412,e[t+4>>2]=o,F=t+8|0,h=e[o>>2]|0,D=o+16|0,a=e[D>>2]|0,d=ie(a,h)|0,e[F>>2]=0,R=t+12|0,e[R>>2]=0,e[t+16>>2]=0;do if(d){if((d|0)<0&&(m=0,ue(178,F|0),h=m,m=0,h&1)||(E=4),(E|0)==4&&(w=d<<1,m=0,C=ge(67,w|0)|0,h=m,m=0,!(h&1))){e[F>>2]=C,h=C+(d<<1)|0,e[t+16>>2]=h,Jt(C|0,0,w|0)|0,e[R>>2]=h,h=e[o>>2]|0,a=e[D>>2]|0;break}d=j()|0,l=e[F>>2]|0,a=l,l&&(h=e[R>>2]|0,(h|0)!=(l|0)&&(e[R>>2]=h+(~((h+-2-a|0)>>>1)<<1)),he(l)),R=d,le(R|0)}while(!1);if(d=t+20|0,a=ie(h<<1,a)|0,e[d>>2]=0,w=t+24|0,e[w>>2]=0,e[t+28>>2]=0,!a){R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(E=13),(E|0)==13&&(m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[w>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[w>>2]|0)+1|0,e[w>>2]=l,a=a+-1|0;while(a|0);R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}h=j()|0,l=e[d>>2]|0,l&&((e[w>>2]|0)!=(l|0)&&(e[w>>2]=l),he(l)),l=e[F>>2]|0,l||(R=h,le(R|0)),a=e[R>>2]|0,(a|0)!=(l|0)&&(e[R>>2]=a+(~((a+-2-l|0)>>>1)<<1)),he(l),R=h,le(R|0)}function Ma(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;e[t>>2]=36388,e[t+4>>2]=o,F=t+8|0,h=e[o>>2]|0,D=o+16|0,a=e[D>>2]|0,d=ie(a,h)|0,e[F>>2]=0,R=t+12|0,e[R>>2]=0,e[t+16>>2]=0;do if(d){if((d|0)<0&&(m=0,ue(178,F|0),h=m,m=0,h&1)||(E=4),(E|0)==4&&(w=d<<1,m=0,C=ge(67,w|0)|0,h=m,m=0,!(h&1))){e[F>>2]=C,h=C+(d<<1)|0,e[t+16>>2]=h,Jt(C|0,0,w|0)|0,e[R>>2]=h,h=e[o>>2]|0,a=e[D>>2]|0;break}d=j()|0,l=e[F>>2]|0,a=l,l&&(h=e[R>>2]|0,(h|0)!=(l|0)&&(e[R>>2]=h+(~((h+-2-a|0)>>>1)<<1)),he(l)),R=d,le(R|0)}while(!1);if(d=t+20|0,a=ie(h<<1,a)|0,e[d>>2]=0,w=t+24|0,e[w>>2]=0,e[t+28>>2]=0,!a){R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(E=13),(E|0)==13&&(m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[w>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[w>>2]|0)+1|0,e[w>>2]=l,a=a+-1|0;while(a|0);R=t+36|0,e[R>>2]=e[r>>2],e[R+4>>2]=e[r+4>>2],e[R+8>>2]=e[r+8>>2];return}h=j()|0,l=e[d>>2]|0,l&&((e[w>>2]|0)!=(l|0)&&(e[w>>2]=l),he(l)),l=e[F>>2]|0,l||(R=h,le(R|0)),a=e[R>>2]|0,(a|0)!=(l|0)&&(e[R>>2]=a+(~((a+-2-l|0)>>>1)<<1)),he(l),R=h,le(R|0)}function Pa(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;d=t+32|0,Sp(d,r)|0,h=t+44|0,e[h>>2]=0,w=t+48|0,l=e[w>>2]|0,l&8&&(r=S[d>>0]|0,r&1?(r=(e[t+40>>2]|0)+(e[t+36>>2]|0)|0,e[h>>2]=r,a=e[t+40>>2]|0,o=a):(r=((r&255)>>>1)+(d+1)|0,e[h>>2]=r,o=d+1|0,a=d+1|0),e[t+8>>2]=o,e[t+12>>2]=a,e[t+16>>2]=r),l&16&&(r=S[d>>0]|0,r&1?(l=e[t+36>>2]|0,e[h>>2]=(e[t+40>>2]|0)+l,r=(e[d>>2]&-2)+-1|0,h=l):(l=(r&255)>>>1,e[h>>2]=d+1+l,r=10,h=l),zs(d,r,0),r=S[d>>0]|0,r&1?(o=e[t+40>>2]|0,l=o,a=e[t+36>>2]|0):(l=d+1|0,a=(r&255)>>>1,o=d+1|0),r=t+24|0,e[r>>2]=o,e[t+20>>2]=o,e[t+28>>2]=l+a,e[w>>2]&3&&(e[r>>2]=o+h))}function La(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;R=b,b=b+32|0,d=R+16|0,F=R+8|0,w=R,m=0,Ae(65,F|0,t|0),D=m,m=0;e:do if(D&1)o=j(0)|0,a=t,l=t;else{do if(S[F>>0]|0){a=e[(e[t>>2]|0)+-12>>2]|0,e[w>>2]=e[t+(a+24)>>2],C=t+a|0,D=e[t+(a+4)>>2]|0,l=r+o|0,a=t+(a+76)|0,o=e[a>>2]|0;do if((o|0)==-1)if(m=0,o=ge(68,C|0)|0,_=m,m=0,_&1)E=13;else{if(e[d>>2]=o,m=0,o=Ne(37,d|0,44220)|0,_=m,m=0,!(_&1)&&(m=0,h=Ne(e[(e[o>>2]|0)+28>>2]|0,o|0,32)|0,_=m,m=0,!(_&1))){_0(d),o=h<<24>>24,e[a>>2]=o,E=9;break}o=j(0)|0,_0(d)}else E=9;while(!1);if((E|0)==9)if(m=0,e[d>>2]=e[w>>2],o=Vt(39,d|0,r|0,((D&176|0)==32?l:r)|0,l|0,C|0,o&255|0)|0,_=m,m=0,_&1)E=13;else{if(o)break;if(_=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+_|0,e[t+(_+16)>>2]|5|0),_=m,m=0,_&1)E=13;else break}(E|0)==13&&(o=j(0)|0),ki(F),a=t,l=t;break e}while(!1);return ki(F),b=R,t|0}while(!1);return K0(o|0)|0,m=0,ue(181,a+(e[(e[l>>2]|0)+-12>>2]|0)|0),_=m,m=0,_&1?(o=j()|0,m=0,bt(3),_=m,m=0,_&1?(_=j(0)|0,$t(_)):le(o|0),0):(ei(),b=R,t|0)}function Oa(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;if(o=e[r+48>>2]|0,o&16){if(o=r+44|0,a=e[o>>2]|0,l=e[r+24>>2]|0,a>>>0>>0?e[o>>2]=l:l=a,a=e[r+20>>2]|0,h=l-a|0,h>>>0>4294967279&&si(t),h>>>0<11?(S[t>>0]=h<<1,o=t+1|0):(r=h+16&-16,o=Xe(r)|0,e[t+8>>2]=o,e[t>>2]=r|1,e[t+4>>2]=h),(a|0)!=(l|0)){for(r=o;S[r>>0]=S[a>>0]|0,a=a+1|0,(a|0)!=(l|0);)r=r+1|0;o=o+h|0}S[o>>0]=0;return}if(!(o&8)){e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0;return}if(a=e[r+8>>2]|0,r=e[r+16>>2]|0,h=r-a|0,h>>>0>4294967279&&si(t),h>>>0<11?(S[t>>0]=h<<1,o=t+1|0):(l=h+16&-16,o=Xe(l)|0,e[t+8>>2]=o,e[t>>2]=l|1,e[t+4>>2]=h),(a|0)!=(r|0)){for(l=o;S[l>>0]=S[a>>0]|0,a=a+1|0,(a|0)!=(r|0);)l=l+1|0;o=o+h|0}S[o>>0]=0}function $a(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;e[t>>2]=36364,e[t+4>>2]=o,R=t+8|0,d=e[o>>2]|0,E=o+16|0,h=e[E>>2]|0,D=ie(h,d)|0,e[R>>2]=0,_=t+12|0,e[_>>2]=0,e[t+16>>2]=0;do if(D){if((D|0)<0&&(m=0,ue(178,R|0),d=m,m=0,d&1)||(F=4),(F|0)==4&&(w=D<<1,m=0,C=ge(67,w|0)|0,d=m,m=0,!(d&1))){e[R>>2]=C,d=C+(D<<1)|0,e[t+16>>2]=d,Jt(C|0,0,w|0)|0,e[_>>2]=d,d=e[o>>2]|0,h=e[E>>2]|0;break}w=j()|0,l=e[R>>2]|0,h=l,l&&(d=e[_>>2]|0,(d|0)!=(l|0)&&(e[_>>2]=d+(~((d+-2-h|0)>>>1)<<1)),he(l)),_=w,le(_|0)}while(!1);if(w=t+20|0,h=ie(d<<1,h)|0,e[w>>2]=0,C=t+24|0,e[C>>2]=0,e[t+28>>2]=0,!h){_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}if((h|0)<0&&(m=0,ue(178,w|0),E=m,m=0,E&1)||(F=13),(F|0)==13&&(m=0,l=ge(67,h|0)|0,F=m,m=0,!(F&1))){e[C>>2]=l,e[w>>2]=l,e[t+28>>2]=l+h;do S[l>>0]=0,l=(e[C>>2]|0)+1|0,e[C>>2]=l,h=h+-1|0;while(h|0);_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}d=j()|0,l=e[w>>2]|0,l&&((e[C>>2]|0)!=(l|0)&&(e[C>>2]=l),he(l)),l=e[R>>2]|0,l||(_=d,le(_|0)),h=e[_>>2]|0,(h|0)!=(l|0)&&(e[_>>2]=h+(~((h+-2-l|0)>>>1)<<1)),he(l),_=d,le(_|0)}function Ba(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;e[t>>2]=36340,e[t+4>>2]=o,R=t+8|0,d=e[o>>2]|0,E=o+16|0,h=e[E>>2]|0,D=ie(h,d)|0,e[R>>2]=0,_=t+12|0,e[_>>2]=0,e[t+16>>2]=0;do if(D){if((D|0)<0&&(m=0,ue(178,R|0),d=m,m=0,d&1)||(F=4),(F|0)==4&&(w=D<<1,m=0,C=ge(67,w|0)|0,d=m,m=0,!(d&1))){e[R>>2]=C,d=C+(D<<1)|0,e[t+16>>2]=d,Jt(C|0,0,w|0)|0,e[_>>2]=d,d=e[o>>2]|0,h=e[E>>2]|0;break}w=j()|0,l=e[R>>2]|0,h=l,l&&(d=e[_>>2]|0,(d|0)!=(l|0)&&(e[_>>2]=d+(~((d+-2-h|0)>>>1)<<1)),he(l)),_=w,le(_|0)}while(!1);if(w=t+20|0,h=ie(d<<1,h)|0,e[w>>2]=0,C=t+24|0,e[C>>2]=0,e[t+28>>2]=0,!h){_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}if((h|0)<0&&(m=0,ue(178,w|0),E=m,m=0,E&1)||(F=13),(F|0)==13&&(m=0,l=ge(67,h|0)|0,F=m,m=0,!(F&1))){e[C>>2]=l,e[w>>2]=l,e[t+28>>2]=l+h;do S[l>>0]=0,l=(e[C>>2]|0)+1|0,e[C>>2]=l,h=h+-1|0;while(h|0);_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}d=j()|0,l=e[w>>2]|0,l&&((e[C>>2]|0)!=(l|0)&&(e[C>>2]=l),he(l)),l=e[R>>2]|0,l||(_=d,le(_|0)),h=e[_>>2]|0,(h|0)!=(l|0)&&(e[_>>2]=h+(~((h+-2-l|0)>>>1)<<1)),he(l),_=d,le(_|0)}function Va(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;e[t>>2]=36316,e[t+4>>2]=o,R=t+8|0,d=e[o>>2]|0,E=o+16|0,h=e[E>>2]|0,D=ie(h,d)|0,e[R>>2]=0,_=t+12|0,e[_>>2]=0,e[t+16>>2]=0;do if(D){if((D|0)<0&&(m=0,ue(178,R|0),d=m,m=0,d&1)||(F=4),(F|0)==4&&(w=D<<1,m=0,C=ge(67,w|0)|0,d=m,m=0,!(d&1))){e[R>>2]=C,d=C+(D<<1)|0,e[t+16>>2]=d,Jt(C|0,0,w|0)|0,e[_>>2]=d,d=e[o>>2]|0,h=e[E>>2]|0;break}w=j()|0,l=e[R>>2]|0,h=l,l&&(d=e[_>>2]|0,(d|0)!=(l|0)&&(e[_>>2]=d+(~((d+-2-h|0)>>>1)<<1)),he(l)),_=w,le(_|0)}while(!1);if(w=t+20|0,h=ie(d<<1,h)|0,e[w>>2]=0,C=t+24|0,e[C>>2]=0,e[t+28>>2]=0,!h){_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}if((h|0)<0&&(m=0,ue(178,w|0),E=m,m=0,E&1)||(F=13),(F|0)==13&&(m=0,l=ge(67,h|0)|0,F=m,m=0,!(F&1))){e[C>>2]=l,e[w>>2]=l,e[t+28>>2]=l+h;do S[l>>0]=0,l=(e[C>>2]|0)+1|0,e[C>>2]=l,h=h+-1|0;while(h|0);_=t+32|0,R=a,R=e[R>>2]|0,a=a+4|0,a=e[a>>2]|0,F=_,e[F>>2]=R,_=_+4|0,e[_>>2]=a,_=t+40|0,e[_>>2]=R,_=t+48|0,e[_>>2]=e[r>>2],e[_+4>>2]=e[r+4>>2],e[_+8>>2]=e[r+8>>2];return}d=j()|0,l=e[w>>2]|0,l&&((e[C>>2]|0)!=(l|0)&&(e[C>>2]=l),he(l)),l=e[R>>2]|0,l||(_=d,le(_|0)),h=e[_>>2]|0,(h|0)!=(l|0)&&(e[_>>2]=h+(~((h+-2-l|0)>>>1)<<1)),he(l),_=d,le(_|0)}function Ua(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36316,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function za(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36316,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Ga(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+48|0,!(e[l>>2]|0)){w=t+52|0,Qr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Qr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function qa(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+48>>2]|0,l){Wa(t,l,r,o,a);return}else{l=t+52|0,Bn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Bn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;C=t+4|0,h=e[C>>2]|0;do if(!(S[h+32>>0]|0))D=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*6|0)|0,h=e[C>>2]|0,w=e[h+16>>2]|0,(a|0)<=0){D=e[d>>2]|0;break}for(r=e[d>>2]|0,h=r,d=0;D=h+4|0,E=k[h>>1]|0,k[h>>1]=k[D>>1]|0,k[D>>1]=E,d=d+1|0,(d|0)!=(a|0);)h=h+(w<<1)|0;D=r,h=e[C>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:if((e[h+24>>2]|0)==2){if((a|0)<=0)return;h=t+32|0,r=0;do E=e[h>>2]|0,C=M[D+(r*6|0)+2>>1]<>1]<>1]<>1]=(C+49152+((t+l|0)>>>2)&65535)>>>E,k[o+(r*6|0)+2>>1]=t>>>E,k[o+(r*6|0)+4>>1]=l>>>E,r=r+1|0;while((r|0)!=(a|0));return}else{if(d=(l|0)<(a|0)?l:a,(d|0)<=0)return;w=l<<1,h=e[t+32>>2]|0,r=0;do a=M[D+(r*6|0)+2>>1]<>1]<>1]<>1]=(a+49152+((t+E|0)>>>2)&65535)>>>h,k[o+(r+l<<1)>>1]=t>>>h,k[o+(r+w<<1)>>1]=E>>>h,r=r+1|0;while((r|0)!=(d|0));return}case 4:{if((e[h+24>>2]|0)!=1||(d=(l|0)<(a|0)?l:a,(d|0)<=0))return;w=l<<1,C=l*3|0,h=e[t+32>>2]|0,r=0;do E=k[D+(r<<3)+6>>1]|0,F=M[D+(r<<3)+2>>1]<>1]<>1]<>1]=(F+49152+((a+t|0)>>>2)&65535)>>>h,k[o+(r+l<<1)>>1]=a>>>h,k[o+(r+w<<1)>>1]=t>>>h,k[o+(r+C<<1)>>1]=E,r=r+1|0;while((r|0)!=(d|0));return}default:return}}function Wa(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;F=b,b=b+176|0,R=F+152|0,z=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=z+56|0,C=z+4|0,e[z>>2]=36160,e[D>>2]=36180,m=0,Ae(62,z+56|0,C|0),F=m,m=0,F&1&&(z=j()|0,tt(D),le(z|0)),e[z+128>>2]=0,e[z+132>>2]=-1,e[z>>2]=36200,e[z+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=z+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[z+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,z|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);z=h,tt(D),le(z|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){z=e[d>>2]|0,Bn(t,z,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),z=e[d>>2]|0,Bn(t,z,o,a,l),b=F}function ti(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(l=b,b=b+176|0,o=l+152|0,C=l+16|0,d=l,!(r&1)){if(o=(r|0)/4|0,(r|0)>3){a=0;do C=t+(a<<2)|0,w=e[C>>2]|0,e[C>>2]=w>>>8&16711935|w<<8&-16711936,a=a+1|0;while((a|0)<(o|0))}if(!(r&3)){b=l;return}d=t+(r+-2)|0,C=t+(r+-1)|0,w=S[d>>0]|0,S[d>>0]=S[C>>0]|0,S[C>>0]=w,b=l;return}w=C+56|0,h=C+4|0,e[C>>2]=36160,e[w>>2]=36180,m=0,Ae(62,C+56|0,h|0),l=m,m=0,l&1&&(C=j()|0,tt(w),le(C|0)),e[C+128>>2]=0,e[C+132>>2]=-1,e[C>>2]=36200,e[C+56>>2]=36220,m=0,ue(180,h|0),l=m,m=0;do if(l&1)o=j()|0;else{if(e[h>>2]=36236,l=C+36|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[C+52>>2]=16,e[o>>2]=0,e[o+4>>2]=0,e[o+8>>2]=0,m=0,Ae(63,h|0,o|0),t=m,m=0,t&1){C=j()|0,de(o),de(l),wt(h),o=C;break}de(o),m=0,o=Ve(28,C|0,49087,24)|0,t=m,m=0,!(t&1)&&(m=0,a=Ne(36,o|0,r|0)|0,r=m,m=0,!(r&1))&&(m=0,Ve(28,a|0,49112,20)|0,r=m,m=0,!(r&1))&&(t=Ct(16)|0,m=0,Ae(64,d|0,h|0),r=m,m=0,r&1?o=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,t|0,1,35648,d|0),r=m,m=0,r&1?a=1:(m=0,ve(6,t|0,824,96),m=0,a=0),o=j()|0,de(d),a||(d=o,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0))),It(t|0),d=o,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0)),d=j()|0,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0)}while(!1);C=o,tt(w),le(C|0)}function Qr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;D=t+4|0,h=e[D>>2]|0;e:do switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)<=0)break e;h=t+40|0,t=0;do l=e[h>>2]|0,w=M[r+(t*6|0)+2>>1]<>1]<>1]<>2)+16384|0,k[o+(t*6|0)>>1]=(d+32768+C&65535)>>>l,k[o+(t*6|0)+2>>1]=(C&65535)>>>l,k[o+(t*6|0)+4>>1]=(w+32768+C&65535)>>>l,t=t+1|0;while((t|0)!=(a|0))}else{if(d=(a|0)<(l|0)?a:l,(d|0)<=0)break e;w=l<<1,h=t+40|0,t=0;do C=e[h>>2]|0,F=M[r+(t+l<<1)>>1]<>1]<>1]<>2)+16384|0,k[o+(t*6|0)>>1]=(R+32768+E&65535)>>>C,k[o+(t*6|0)+2>>1]=(E&65535)>>>C,k[o+(t*6|0)+4>>1]=(F+32768+E&65535)>>>C,t=t+1|0;while((t|0)!=(d|0))}break}case 4:{if((e[h+24>>2]|0)==1&&(C=(a|0)<(l|0)?a:l,(C|0)>0)){w=l<<1,h=t+40|0,t=l*3|0,d=0;do R=e[h>>2]|0,F=M[r+(d+l<<1)>>1]<>1]<>1]<>2)+16384|0,_=k[r+(d+t<<1)>>1]|0,H=v0((E&65535)>>>R&65535|0,0,16)|0,F=(F+32768+E&65535)>>>R|ye,_=v0(_&65535|0,0,48)|0,_=H|(z+32768+E&65535)>>>R&65535|_,F=F&65535|ye,R=o+(d<<3)|0,E=R,k[E>>1]=_,k[E+2>>1]=_>>>16,R=R+4|0,k[R>>1]=F,k[R+2>>1]=F>>>16,d=d+1|0;while((d|0)!=(C|0))}break}default:}while(!1);if(h=e[D>>2]|0,!!(S[h+32>>0]|0)&&(d=e[h+16>>2]|0,!((a|0)<=0)))for(h=o,t=0;H=h+4|0,z=k[h>>1]|0,k[h>>1]=k[H>>1]|0,k[H>>1]=z,t=t+1|0,(t|0)!=(a|0);)h=h+(d<<1)|0}function Ha(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36340,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function Qa(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36340,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Ka(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+48|0,!(e[l>>2]|0)){w=t+52|0,Kr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Kr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function Ya(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+48>>2]|0,l){ja(t,l,r,o,a);return}else{l=t+52|0,Vn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Vn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;C=t+4|0,h=e[C>>2]|0;do if(!(S[h+32>>0]|0))D=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*6|0)|0,h=e[C>>2]|0,w=e[h+16>>2]|0,(a|0)<=0){D=e[d>>2]|0;break}for(r=e[d>>2]|0,h=r,d=0;D=h+4|0,E=k[h>>1]|0,k[h>>1]=k[D>>1]|0,k[D>>1]=E,d=d+1|0,(d|0)!=(a|0);)h=h+(w<<1)|0;D=r,h=e[C>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:if((e[h+24>>2]|0)==2){if((a|0)<=0)return;h=t+32|0,r=0;do l=e[h>>2]|0,C=M[D+(r*6|0)>>1]<>1]<>1]<>>1)&65535)>>>l&65535,k[o+(r*6|0)>>1]=(C+32768-t&65535)>>>l,k[o+(r*6|0)+2>>1]=(t&65535)>>>l,k[o+(r*6|0)+4>>1]=E,r=r+1|0;while((r|0)!=(a|0));return}else{if(d=(l|0)<(a|0)?l:a,(d|0)<=0)return;w=l<<1,h=e[t+32>>2]|0,r=0;do a=M[D+(r*6|0)>>1]<>1]<>1]<>>1)&65535)>>>h&65535,k[o+(r<<1)>>1]=(a+32768-t&65535)>>>h,k[o+(r+l<<1)>>1]=(t&65535)>>>h,k[o+(r+w<<1)>>1]=E,r=r+1|0;while((r|0)!=(d|0));return}case 4:{if((e[h+24>>2]|0)!=1||(d=(l|0)<(a|0)?l:a,(d|0)<=0))return;w=l<<1,C=l*3|0,h=e[t+32>>2]|0,r=0;do E=k[D+(r<<3)+6>>1]|0,F=M[D+(r<<3)>>1]<>1]<>1]<>>1)&65535)>>>h&65535,k[o+(r<<1)>>1]=(F+32768-a&65535)>>>h,k[o+(r+l<<1)>>1]=(a&65535)>>>h,k[o+(r+w<<1)>>1]=t,k[o+(r+C<<1)>>1]=E,r=r+1|0;while((r|0)!=(d|0));return}default:return}}function ja(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;F=b,b=b+176|0,R=F+152|0,z=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=z+56|0,C=z+4|0,e[z>>2]=36160,e[D>>2]=36180,m=0,Ae(62,z+56|0,C|0),F=m,m=0,F&1&&(z=j()|0,tt(D),le(z|0)),e[z+128>>2]=0,e[z+132>>2]=-1,e[z>>2]=36200,e[z+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=z+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[z+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,z|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);z=h,tt(D),le(z|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){z=e[d>>2]|0,Vn(t,z,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),z=e[d>>2]|0,Vn(t,z,o,a,l),b=F}function Kr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;D=t+4|0,h=e[D>>2]|0;e:do switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)<=0)break e;h=t+40|0,t=0;do C=e[h>>2]|0,w=M[r+(t*6|0)+2>>1]<>1]<>1]<>>1)&65535)>>>C&65535,k[o+(t*6|0)>>1]=d>>>C,k[o+(t*6|0)+2>>1]=w>>>C,k[o+(t*6|0)+4>>1]=l,t=t+1|0;while((t|0)!=(a|0))}else{if(d=(a|0)<(l|0)?a:l,(d|0)<=0)break e;w=l<<1,h=t+40|0,t=0;do E=e[h>>2]|0,F=M[r+(t+l<<1)>>1]<>1]<>1]<>>1)&65535)>>>E&65535,k[o+(t*6|0)>>1]=R>>>E,k[o+(t*6|0)+2>>1]=F>>>E,k[o+(t*6|0)+4>>1]=C,t=t+1|0;while((t|0)!=(d|0))}break}case 4:{if((e[h+24>>2]|0)==1&&(C=(a|0)<(l|0)?a:l,(C|0)>0)){w=l<<1,h=t+40|0,t=l*3|0,d=0;do E=e[h>>2]|0,R=M[r+(d+l<<1)>>1]<>1]<>1]<>>1)&65535)>>>E,_=k[r+(d+t<<1)>>1]|0,R=v0(R>>>E&65535|0,0,16)|0,F=ye|F,_=v0(_&65535|0,0,48)|0,_=z>>>E&65535|R|_,F=F&65535|ye,R=o+(d<<3)|0,E=R,k[E>>1]=_,k[E+2>>1]=_>>>16,R=R+4|0,k[R>>1]=F,k[R+2>>1]=F>>>16,d=d+1|0;while((d|0)!=(C|0))}break}default:}while(!1);if(h=e[D>>2]|0,!!(S[h+32>>0]|0)&&(d=e[h+16>>2]|0,!((a|0)<=0)))for(h=o,t=0;z=h+4|0,_=k[h>>1]|0,k[h>>1]=k[z>>1]|0,k[z>>1]=_,t=t+1|0,(t|0)!=(a|0);)h=h+(d<<1)|0}function Xa(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36364,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function Za(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36364,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Ja(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+48|0,!(e[l>>2]|0)){w=t+52|0,Yr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Yr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function el(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+48>>2]|0,l){tl(t,l,r,o,a);return}else{l=t+52|0,Un(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Un(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;C=t+4|0,h=e[C>>2]|0;do if(!(S[h+32>>0]|0))D=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*6|0)|0,h=e[C>>2]|0,w=e[h+16>>2]|0,(a|0)<=0){D=e[d>>2]|0;break}for(r=e[d>>2]|0,h=r,d=0;D=h+4|0,E=k[h>>1]|0,k[h>>1]=k[D>>1]|0,k[D>>1]=E,d=d+1|0,(d|0)!=(a|0);)h=h+(w<<1)|0;D=r,h=e[C>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:if((e[h+24>>2]|0)==2){if((a|0)<=0)return;h=t+32|0,r=0;do l=e[h>>2]|0,t=M[D+(r*6|0)+2>>1]<>1]<>>l&65535,k[o+(r*6|0)>>1]=((M[D+(r*6|0)>>1]<>>l,k[o+(r*6|0)+2>>1]=(t&65535)>>>l,k[o+(r*6|0)+4>>1]=E,r=r+1|0;while((r|0)!=(a|0));return}else{if(d=(l|0)<(a|0)?l:a,(d|0)<=0)return;w=l<<1,h=e[t+32>>2]|0,r=0;do t=M[D+(r*6|0)+2>>1]<>1]<>>h&65535,k[o+(r<<1)>>1]=((M[D+(r*6|0)>>1]<>>h,k[o+(r+l<<1)>>1]=(t&65535)>>>h,k[o+(r+w<<1)>>1]=E,r=r+1|0;while((r|0)!=(d|0));return}case 4:{if((e[h+24>>2]|0)!=1||(w=(l|0)<(a|0)?l:a,(w|0)<=0))return;C=l<<1,d=l*3|0,h=e[t+32>>2]|0,r=0;do E=k[D+(r<<3)+6>>1]|0,a=M[D+(r<<3)+2>>1]<>1]<>>h&65535,k[o+(r<<1)>>1]=((M[D+(r<<3)>>1]<>>h,k[o+(r+l<<1)>>1]=(a&65535)>>>h,k[o+(r+C<<1)>>1]=t,k[o+(r+d<<1)>>1]=E,r=r+1|0;while((r|0)!=(w|0));return}default:return}}function tl(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;F=b,b=b+176|0,R=F+152|0,z=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=z+56|0,C=z+4|0,e[z>>2]=36160,e[D>>2]=36180,m=0,Ae(62,z+56|0,C|0),F=m,m=0,F&1&&(z=j()|0,tt(D),le(z|0)),e[z+128>>2]=0,e[z+132>>2]=-1,e[z>>2]=36200,e[z+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=z+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[z+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,z|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);z=h,tt(D),le(z|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){z=e[d>>2]|0,Un(t,z,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),z=e[d>>2]|0,Un(t,z,o,a,l),b=F}function Yr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;D=t+4|0,h=e[D>>2]|0;e:do switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)<=0)break e;h=t+40|0,t=0;do C=e[h>>2]|0,w=M[r+(t*6|0)+2>>1]<>1]<>>C&65535,k[o+(t*6|0)>>1]=((M[r+(t*6|0)>>1]<>>C,k[o+(t*6|0)+2>>1]=(w&65535)>>>C,k[o+(t*6|0)+4>>1]=l,t=t+1|0;while((t|0)!=(a|0))}else{if(d=(a|0)<(l|0)?a:l,(d|0)<=0)break e;w=l<<1,h=t+40|0,t=0;do E=e[h>>2]|0,F=M[r+(t+l<<1)>>1]<>1]<>>E&65535,k[o+(t*6|0)>>1]=((M[r+(t<<1)>>1]<>>E,k[o+(t*6|0)+2>>1]=(F&65535)>>>E,k[o+(t*6|0)+4>>1]=C,t=t+1|0;while((t|0)!=(d|0))}break}case 4:{if((e[h+24>>2]|0)==1&&(C=(a|0)<(l|0)?a:l,(C|0)>0)){w=l<<1,h=t+40|0,t=l*3|0,d=0;do R=e[h>>2]|0,z=M[r+(d+l<<1)>>1]<>1]<>>R,E=(z+32768+(M[r+(d+w<<1)>>1]<>>R,_=k[r+(d+t<<1)>>1]|0,R=v0((z&65535)>>>R&65535|0,0,16)|0,E=E|ye,_=v0(_&65535|0,0,48)|0,_=R|F&65535|_,E=E&65535|ye,F=o+(d<<3)|0,R=F,k[R>>1]=_,k[R+2>>1]=_>>>16,F=F+4|0,k[F>>1]=E,k[F+2>>1]=E>>>16,d=d+1|0;while((d|0)!=(C|0))}break}default:}while(!1);if(h=e[D>>2]|0,!!(S[h+32>>0]|0)&&(d=e[h+16>>2]|0,!((a|0)<=0)))for(h=o,t=0;z=h+4|0,_=k[h>>1]|0,k[h>>1]=k[z>>1]|0,k[z>>1]=_,t=t+1|0,(t|0)!=(a|0);)h=h+(d<<1)|0}function Ui(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0;if(F=b,b=b+16|0,D=F,E=e[t>>2]|0,!E)return t=0,b=F,t|0;if(R=r,w=a-R|0,C=l+12|0,d=e[C>>2]|0,w=(d|0)>(w|0)?d-w|0:0,d=o,l=d-R|0,(l|0)>0&&(Yt[e[(e[E>>2]|0)+48>>2]&63](E,r,l)|0)!=(l|0))return e[t>>2]=0,R=0,b=F,R|0;do if((w|0)>0){if(dr(D,w,h),m=0,l=Ve(e[(e[E>>2]|0)+48>>2]|0,E|0,(S[D>>0]&1?e[D+8>>2]|0:D+1|0)|0,w|0)|0,R=m,m=0,R&1&&(R=j()|0,de(D),le(R|0)),(l|0)==(w|0)){de(D);break}return e[t>>2]=0,de(D),R=0,b=F,R|0}while(!1);return a=a-d|0,(a|0)>0&&(Yt[e[(e[E>>2]|0)+48>>2]&63](E,o,a)|0)!=(a|0)?(e[t>>2]=0,R=0,b=F,R|0):(e[C>>2]=0,R=E,b=F,R|0)}function il(t){t=t|0,e[t>>2]=36236,de(t+32|0),wt(t)}function nl(t){t=t|0,e[t>>2]=36236,de(t+32|0),wt(t),he(t)}function rl(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(d=r+44|0,w=e[d>>2]|0,D=r+24|0,E=e[D>>2]|0,w>>>0>>0&&(e[d>>2]=E,w=E),C=w,d=h&24,!d){r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}if((l|0)==1&(d|0)==24){r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}e:do switch(l|0){case 0:{d=0,l=0;break}case 1:if(h&8){l=(e[r+12>>2]|0)-(e[r+8>>2]|0)|0,d=l,l=((l|0)<0)<<31>>31;break e}else{l=E-(e[r+20>>2]|0)|0,d=l,l=((l|0)<0)<<31>>31;break e}case 2:{d=r+32|0,S[d>>0]&1?d=e[r+40>>2]|0:d=d+1|0,l=w-d|0,d=l,l=((l|0)<0)<<31>>31;break}default:{r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}}while(!1);if(l=$0(d|0,l|0,o|0,a|0)|0,o=ye,(o|0)>=0&&(d=r+32|0,S[d>>0]&1?d=e[r+40>>2]|0:d=d+1|0,a=w-d|0,w=((a|0)<0)<<31>>31,!((w|0)<(o|0)|(w|0)==(o|0)&a>>>0>>0))){if(d=h&8,!((l|0)==0&(o|0)==0)){if(d|0&&!(e[r+12>>2]|0)){r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}if((h&16|0)!=0&(E|0)==0){r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1;return}}d&&(e[r+12>>2]=(e[r+8>>2]|0)+l,e[r+16>>2]=C),h&16&&(e[D>>2]=(e[r+20>>2]|0)+l),r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=l,e[r+4>>2]=o;return}r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function sl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,o=o+8|0,Vi[e[(e[r>>2]|0)+16>>2]&15](t,r,e[o>>2]|0,e[o+4>>2]|0,0,a)}function ol(t){t=t|0;var r=0,o=0,a=0,l=0;return r=t+44|0,o=e[r>>2]|0,a=e[t+24>>2]|0,o>>>0
>>0&&(e[r>>2]=a,o=a),!(e[t+48>>2]&8)||(l=t+16|0,r=e[l>>2]|0,a=t+12|0,r>>>0>>0?(a=e[a>>2]|0,e[l>>2]=o,r=o):a=e[a>>2]|0,a>>>0>=r>>>0)?(t=-1,t|0):(t=N[a>>0]|0,t|0)}function al(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(a=t+44|0,o=e[a>>2]|0,l=e[t+24>>2]|0,o>>>0>>0&&(e[a>>2]=l,o=l),w=t+8|0,a=e[w>>2]|0,C=t+12|0,h=e[C>>2]|0,d=a,a>>>0>=h>>>0)return t=-1,t|0;if((r|0)==-1)return e[w>>2]=a,e[C>>2]=h+-1,e[t+16>>2]=o,t=0,t|0;if(e[t+48>>2]&16)l=r&255,a=h+-1|0;else if(l=r&255,a=h+-1|0,l<<24>>24!=(S[a>>0]|0))return t=-1,t|0;return e[w>>2]=d,e[C>>2]=a,e[t+16>>2]=o,S[a>>0]=l,t=r,t|0}function ll(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0;if(H=b,b=b+16|0,E=H,(r|0)==-1)return t=0,b=H,t|0;F=t+12|0,R=t+8|0,_=(e[F>>2]|0)-(e[R>>2]|0)|0,z=t+24|0,o=e[z>>2]|0,D=t+28|0,a=e[D>>2]|0;do if((o|0)==(a|0)){if(w=t+48|0,!(e[w>>2]&16))return t=-1,b=H,t|0;if(C=t+20|0,d=e[C>>2]|0,l=o-d|0,h=t+44|0,d=(e[h>>2]|0)-d|0,a=t+32|0,m=0,Ae(67,a|0,0),o=m,m=0,!(o&1)&&(S[a>>0]&1?o=(e[a>>2]&-2)+-1|0:o=10,m=0,ve(8,a|0,o|0,0),o=m,m=0,!(o&1))){o=S[a>>0]|0,o&1?(a=e[t+40>>2]|0,o=e[t+36>>2]|0):(a=a+1|0,o=(o&255)>>>1),K=a+o|0,e[C>>2]=a,e[D>>2]=K,C=a+l|0,e[z>>2]=C,o=a+d|0,e[h>>2]=o,a=K;break}return K=j(0)|0,K0(K|0)|0,ei(),K=-1,b=H,K|0}else K=t+44|0,w=t+48|0,h=K,C=o,o=e[K>>2]|0;while(!1);return d=C+1|0,e[E>>2]=d,l=e[(d>>>0>>0?h:E)>>2]|0,e[h>>2]=l,e[w>>2]&8&&(o=t+32|0,S[o>>0]&1?o=e[t+40>>2]|0:o=o+1|0,e[R>>2]=o,e[F>>2]=o+_,e[t+16>>2]=l),(C|0)==(a|0)?(K=U0[e[(e[t>>2]|0)+52>>2]&63](t,r&255)|0,b=H,K|0):(e[z>>2]=d,S[C>>0]=r,K=r&255,b=H,K|0)}function ul(t){t=t|0;var r=0,o=0;e[t>>2]=36200,r=t+56|0,e[r>>2]=36220,o=t+4|0,e[o>>2]=36236,de(t+36|0),wt(o),tt(r)}function cl(t){t=t|0;var r=0,o=0;e[t>>2]=36200,r=t+56|0,e[r>>2]=36220,o=t+4|0,e[o>>2]=36236,de(t+36|0),wt(o),tt(r),he(t)}function hl(t){t=t|0;var r=0,o=0,a=0,l=0;l=e[(e[t>>2]|0)+-12>>2]|0,r=t+l|0,e[r>>2]=36200,o=t+(l+56)|0,e[o>>2]=36220,a=t+(l+4)|0,e[a>>2]=36236,de(t+(l+36)|0),wt(a),tt(o),he(r)}function dl(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36388,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function pl(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36388,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function ml(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+36|0,!(e[l>>2]|0)){w=t+40|0,jr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,jr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function gl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){Sl(t,l,r,o,a);return}else{l=t+40|0,zn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function zn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;w=t+4|0,h=e[w>>2]|0;do if(!(S[h+32>>0]|0))C=r;else{if(t=t+8|0,o0(e[t>>2]|0,r|0,a*6|0)|0,h=e[w>>2]|0,d=e[h+16>>2]|0,(a|0)<=0){C=e[t>>2]|0;break}for(t=e[t>>2]|0,h=t,r=0;C=h+4|0,D=k[h>>1]|0,k[h>>1]=k[C>>1]|0,k[C>>1]=D,r=r+1|0,(r|0)!=(a|0);)h=h+(d<<1)|0;C=t,h=e[w>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do w=M[C+(h*6|0)+2>>1]|0,l=32768-w+(M[C+(h*6|0)+4>>1]|0)|0,D=(M[C+(h*6|0)>>1]|0)-w+32768|0,k[o+(h*6|0)>>1]=w+49152+(((l&65535)+(D&65535)|0)>>>2),k[o+(h*6|0)+2>>1]=l,k[o+(h*6|0)+4>>1]=D,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do w=M[C+(r*6|0)+2>>1]|0,a=32768-w+(M[C+(r*6|0)+4>>1]|0)|0,D=(M[C+(r*6|0)>>1]|0)-w+32768|0,k[o+(r<<1)>>1]=w+49152+(((a&65535)+(D&65535)|0)>>>2),k[o+(r+l<<1)>>1]=a,k[o+(r+t<<1)>>1]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do D=k[C+(d<<3)+6>>1]|0,E=M[C+(d<<3)+2>>1]|0,w=32768-E+(M[C+(d<<3)+4>>1]|0)|0,a=(M[C+(d<<3)>>1]|0)-E+32768|0,k[o+(d<<1)>>1]=E+49152+(((w&65535)+(a&65535)|0)>>>2),k[o+(d+l<<1)>>1]=w,k[o+(d+t<<1)>>1]=a,k[o+(d+r<<1)>>1]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function Sl(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;F=b,b=b+176|0,R=F+152|0,z=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=z+56|0,C=z+4|0,e[z>>2]=36160,e[D>>2]=36180,m=0,Ae(62,z+56|0,C|0),F=m,m=0,F&1&&(z=j()|0,tt(D),le(z|0)),e[z+128>>2]=0,e[z+132>>2]=-1,e[z>>2]=36200,e[z+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=z+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[z+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,z|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);z=h,tt(D),le(z|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){z=e[d>>2]|0,zn(t,z,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),z=e[d>>2]|0,zn(t,z,o,a,l),b=F}function jr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(w=M[r+(t*6|0)+2>>1]|0,d=M[r+(t*6|0)+4>>1]|0,l=(M[r+(t*6|0)>>1]|0)-((d+w|0)>>>2)+16384|0,k[o+(t*6|0)>>1]=d+32768+l,k[o+(t*6|0)+2>>1]=l,k[o+(t*6|0)+4>>1]=w+32768+l,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do D=M[r+(d+l<<1)>>1]|0,E=M[r+(d+h<<1)>>1]|0,w=(M[r+(d<<1)>>1]|0)-((E+D|0)>>>2)+16384|0,k[o+(d*6|0)>>1]=E+32768+w,k[o+(d*6|0)+2>>1]=w,k[o+(d*6|0)+4>>1]=D+32768+w,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do D=M[r+(d+l<<1)>>1]|0,F=M[r+(d+t<<1)>>1]|0,E=(M[r+(d<<1)>>1]|0)-((F+D|0)>>>2)+16384|0,R=k[r+(d+h<<1)>>1]|0,_=v0(E&65535|0,0,16)|0,D=D+32768+E|ye,R=v0(R&65535|0,0,48)|0,R=_|F+32768+E&65535|R,D=D&65535|ye,E=o+(d<<3)|0,F=E,k[F>>1]=R,k[F+2>>1]=R>>>16,E=E+4|0,k[E>>1]=D,k[E+2>>1]=D>>>16,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)&&(d=e[t+16>>2]|0,!((a|0)<=0)))for(t=o,h=0;_=t+4|0,R=k[t>>1]|0,k[t>>1]=k[_>>1]|0,k[_>>1]=R,h=h+1|0,(h|0)!=(a|0);)t=t+(d<<1)|0}function Al(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36412,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function vl(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36412,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function xl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+36|0,!(e[l>>2]|0)){w=t+40|0,Xr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Xr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function wl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){yl(t,l,r,o,a);return}else{l=t+40|0,Gn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Gn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;w=t+4|0,h=e[w>>2]|0;do if(!(S[h+32>>0]|0))C=r;else{if(t=t+8|0,o0(e[t>>2]|0,r|0,a*6|0)|0,h=e[w>>2]|0,d=e[h+16>>2]|0,(a|0)<=0){C=e[t>>2]|0;break}for(t=e[t>>2]|0,h=t,r=0;C=h+4|0,D=k[h>>1]|0,k[h>>1]=k[C>>1]|0,k[C>>1]=D,r=r+1|0,(r|0)!=(a|0);)h=h+(d<<1)|0;C=t,h=e[w>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do d=M[C+(h*6|0)>>1]|0,l=k[C+(h*6|0)+2>>1]|0,w=l&65535,D=(M[C+(h*6|0)+4>>1]|0)+32768-((w+d|0)>>>1)&65535,k[o+(h*6|0)>>1]=d+32768-w,k[o+(h*6|0)+2>>1]=l,k[o+(h*6|0)+4>>1]=D,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do a=k[C+(r*6|0)+2>>1]|0,d=M[C+(r*6|0)>>1]|0,w=a&65535,D=(M[C+(r*6|0)+4>>1]|0)+32768-((w+d|0)>>>1)&65535,k[o+(r<<1)>>1]=d+32768-w,k[o+(r+l<<1)>>1]=a,k[o+(r+t<<1)>>1]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do w=k[C+(d<<3)+2>>1]|0,D=k[C+(d<<3)+6>>1]|0,F=M[C+(d<<3)>>1]|0,E=w&65535,a=(M[C+(d<<3)+4>>1]|0)+32768-((E+F|0)>>>1)&65535,k[o+(d<<1)>>1]=F+32768-E,k[o+(d+l<<1)>>1]=w,k[o+(d+t<<1)>>1]=a,k[o+(d+r<<1)>>1]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function yl(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;F=b,b=b+176|0,R=F+152|0,z=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=z+56|0,C=z+4|0,e[z>>2]=36160,e[D>>2]=36180,m=0,Ae(62,z+56|0,C|0),F=m,m=0,F&1&&(z=j()|0,tt(D),le(z|0)),e[z+128>>2]=0,e[z+132>>2]=-1,e[z>>2]=36200,e[z+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=z+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[z+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,z|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);z=h,tt(D),le(z|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){z=e[d>>2]|0,Gn(t,z,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),z=e[d>>2]|0,Gn(t,z,o,a,l),b=F}function Xr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(w=k[r+(t*6|0)+2>>1]|0,l=w&65535,d=(M[r+(t*6|0)>>1]|0)+32768+l|0,l=(M[r+(t*6|0)+4>>1]|0)+32768+(((d&65535)+l|0)>>>1)&65535,k[o+(t*6|0)>>1]=d,k[o+(t*6|0)+2>>1]=w,k[o+(t*6|0)+4>>1]=l,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do D=k[r+(d+l<<1)>>1]|0,w=D&65535,E=(M[r+(d<<1)>>1]|0)+32768+w|0,w=(M[r+(d+h<<1)>>1]|0)+32768+(((E&65535)+w|0)>>>1)&65535,k[o+(d*6|0)>>1]=E,k[o+(d*6|0)+2>>1]=D,k[o+(d*6|0)+4>>1]=w,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=k[r+(d+l<<1)>>1]|0,D=E&65535,F=(M[r+(d<<1)>>1]|0)+32768+D&65535,D=(M[r+(d+t<<1)>>1]|0)+32768+((F+D|0)>>>1)|0,R=k[r+(d+h<<1)>>1]|0,E=v0(E&65535|0,0,16)|0,D=ye|D,R=v0(R&65535|0,0,48)|0,R=F|E|R,D=D&65535|ye,E=o+(d<<3)|0,F=E,k[F>>1]=R,k[F+2>>1]=R>>>16,E=E+4|0,k[E>>1]=D,k[E+2>>1]=D>>>16,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)&&(d=e[t+16>>2]|0,!((a|0)<=0)))for(t=o,h=0;R=t+4|0,F=k[t>>1]|0,k[t>>1]=k[R>>1]|0,k[R>>1]=F,h=h+1|0,(h|0)!=(a|0);)t=t+(d<<1)|0}function Cl(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36436,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function Tl(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36436,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Il(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+36|0,!(e[l>>2]|0)){w=t+40|0,Zr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Zr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function kl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){El(t,l,r,o,a);return}else{l=t+40|0,qn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function qn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;w=t+4|0,h=e[w>>2]|0;do if(!(S[h+32>>0]|0))C=r;else{if(t=t+8|0,o0(e[t>>2]|0,r|0,a*6|0)|0,h=e[w>>2]|0,d=e[h+16>>2]|0,(a|0)<=0){C=e[t>>2]|0;break}for(t=e[t>>2]|0,h=t,r=0;C=h+4|0,D=k[h>>1]|0,k[h>>1]=k[C>>1]|0,k[C>>1]=D,r=r+1|0,(r|0)!=(a|0);)h=h+(d<<1)|0;C=t,h=e[w>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do l=k[C+(h*6|0)+2>>1]|0,w=l&65535,D=32768-w+(M[C+(h*6|0)+4>>1]|0)&65535,k[o+(h*6|0)>>1]=(M[C+(h*6|0)>>1]|0)+32768-w,k[o+(h*6|0)+2>>1]=l,k[o+(h*6|0)+4>>1]=D,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do a=k[C+(r*6|0)+2>>1]|0,w=a&65535,D=32768-w+(M[C+(r*6|0)+4>>1]|0)&65535,k[o+(r<<1)>>1]=(M[C+(r*6|0)>>1]|0)+32768-w,k[o+(r+l<<1)>>1]=a,k[o+(r+t<<1)>>1]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do w=k[C+(d<<3)+2>>1]|0,D=k[C+(d<<3)+6>>1]|0,E=w&65535,a=32768-E+(M[C+(d<<3)+4>>1]|0)&65535,k[o+(d<<1)>>1]=(M[C+(d<<3)>>1]|0)+32768-E,k[o+(d+l<<1)>>1]=w,k[o+(d+t<<1)>>1]=a,k[o+(d+r<<1)>>1]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function El(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;F=b,b=b+176|0,R=F+152|0,z=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=z+56|0,C=z+4|0,e[z>>2]=36160,e[D>>2]=36180,m=0,Ae(62,z+56|0,C|0),F=m,m=0,F&1&&(z=j()|0,tt(D),le(z|0)),e[z+128>>2]=0,e[z+132>>2]=-1,e[z>>2]=36200,e[z+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=z+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[z+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,z|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);z=h,tt(D),le(z|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){z=e[d>>2]|0,qn(t,z,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),z=e[d>>2]|0,qn(t,z,o,a,l),b=F}function Zr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(w=k[r+(t*6|0)+2>>1]|0,d=w&65535,l=d+32768+(M[r+(t*6|0)+4>>1]|0)&65535,k[o+(t*6|0)>>1]=(M[r+(t*6|0)>>1]|0)+32768+d,k[o+(t*6|0)+2>>1]=w,k[o+(t*6|0)+4>>1]=l,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do D=k[r+(d+l<<1)>>1]|0,E=D&65535,w=E+32768+(M[r+(d+h<<1)>>1]|0)&65535,k[o+(d*6|0)>>1]=(M[r+(d<<1)>>1]|0)+32768+E,k[o+(d*6|0)+2>>1]=D,k[o+(d*6|0)+4>>1]=w,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=k[r+(d+l<<1)>>1]|0,D=E&65535,F=(M[r+(d<<1)>>1]|0)+32768+D|0,D=D+32768+(M[r+(d+t<<1)>>1]|0)|0,R=k[r+(d+h<<1)>>1]|0,E=v0(E&65535|0,0,16)|0,D=ye|D,R=v0(R&65535|0,0,48)|0,R=F&65535|E|R,D=D&65535|ye,E=o+(d<<3)|0,F=E,k[F>>1]=R,k[F+2>>1]=R>>>16,E=E+4|0,k[E>>1]=D,k[E+2>>1]=D>>>16,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)&&(d=e[t+16>>2]|0,!((a|0)<=0)))for(t=o,h=0;R=t+4|0,F=k[t>>1]|0,k[t>>1]=k[R>>1]|0,k[R>>1]=F,h=h+1|0,(h|0)!=(a|0);)t=t+(d<<1)|0}function Dl(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=36460,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,a&&(r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a))}function bl(t){t=t|0;var r=0,o=0,a=0;if(e[t>>2]=36460,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),a=e[t+8>>2]|0,!a){he(t);return}r=t+12|0,o=e[r>>2]|0,(o|0)!=(a|0)&&(e[r>>2]=o+(~((o+-2-a|0)>>>1)<<1)),he(a),he(t)}function Fl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;if(l=t+36|0,!(e[l>>2]|0)){w=t+40|0,Jr(t,r,e[w>>2]|0,o,a),e[w>>2]=(e[w>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}C=t+4|0,h=o<<1,d=ie(h,e[(e[C>>2]|0)+16>>2]|0)|0,w=t+20|0,Jr(t,r,e[w>>2]|0,o,a),r=e[C>>2]|0,(e[r+28>>2]|0)==536870912&&ti(e[w>>2]|0,ie(h,e[r+16>>2]|0)|0),C=e[l>>2]|0,(Yt[e[(e[C>>2]|0)+48>>2]&63](C,e[w>>2]|0,d)|0)!=(d|0)&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,3,35648),C=m,m=0,C&1?(C=j()|0,It(r|0),le(C|0)):Qt(r|0,824,96))}function Nl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){Rl(t,l,r,o,a);return}else{l=t+40|0,Wn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Wn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0;w=t+4|0,h=e[w>>2]|0;do if(!(S[h+32>>0]|0))C=r;else{if(t=t+8|0,o0(e[t>>2]|0,r|0,a*6|0)|0,h=e[w>>2]|0,d=e[h+16>>2]|0,(a|0)<=0){C=e[t>>2]|0;break}for(t=e[t>>2]|0,h=t,r=0;C=h+4|0,D=k[h>>1]|0,k[h>>1]=k[C>>1]|0,k[C>>1]=D,r=r+1|0,(r|0)!=(a|0);)h=h+(d<<1)|0;C=t,h=e[w>>2]|0}while(!1);switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do l=k[C+(h*6|0)+2>>1]|0,D=k[C+(h*6|0)+4>>1]|0,k[o+(h*6|0)>>1]=k[C+(h*6|0)>>1]|0,k[o+(h*6|0)+2>>1]=l,k[o+(h*6|0)+4>>1]=D,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do a=k[C+(r*6|0)+2>>1]|0,D=k[C+(r*6|0)+4>>1]|0,k[o+(r<<1)>>1]=k[C+(r*6|0)>>1]|0,k[o+(r+l<<1)>>1]=a,k[o+(r+t<<1)>>1]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do w=k[C+(d<<3)+2>>1]|0,a=k[C+(d<<3)+4>>1]|0,D=k[C+(d<<3)+6>>1]|0,k[o+(d<<1)>>1]=k[C+(d<<3)>>1]|0,k[o+(d+l<<1)>>1]=w,k[o+(d+t<<1)>>1]=a,k[o+(d+r<<1)>>1]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function Rl(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;F=b,b=b+176|0,R=F+152|0,z=F+16|0,_=F,C=t+4|0,h=e[C>>2]|0,E=a<<1,d=ie(E,e[h+16>>2]|0)|0;do if(d){for(w=t+20|0;h=Yt[e[(e[r>>2]|0)+32>>2]&63](r,e[w>>2]|0,d)|0,!!h;)if((d|0)==(h|0)){D=26;break}else d=d-h|0;if((D|0)==26){h=e[C>>2]|0;break}D=z+56|0,C=z+4|0,e[z>>2]=36160,e[D>>2]=36180,m=0,Ae(62,z+56|0,C|0),F=m,m=0,F&1&&(z=j()|0,tt(D),le(z|0)),e[z+128>>2]=0,e[z+132>>2]=-1,e[z>>2]=36200,e[z+56>>2]=36220,m=0,ue(180,C|0),F=m,m=0;do if(F&1)h=j()|0;else{if(e[C>>2]=36236,r=z+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[z+52>>2]=16,e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,m=0,Ae(63,C|0,R|0),F=m,m=0,F&1){h=j()|0,de(R),de(r),wt(C);break}de(R),m=0,h=Ve(28,z|0,49029,57)|0,R=m,m=0,!(R&1)&&(m=0,Ne(36,h|0,0)|0,R=m,m=0,!(R&1))&&(w=Ct(16)|0,m=0,Ae(64,_|0,C|0),R=m,m=0,R&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,_|0),R=m,m=0,R&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(_),d||(_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0))),It(w|0),_=h,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)),_=j()|0,e[z>>2]=36200,e[D>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(D),le(_|0)}while(!1);z=h,tt(D),le(z|0)}while(!1);if(d=t+20|0,(e[h+28>>2]|0)!=536870912){z=e[d>>2]|0,Wn(t,z,o,a,l),b=F;return}ti(e[d>>2]|0,ie(E,e[h+16>>2]|0)|0),z=e[d>>2]|0,Wn(t,z,o,a,l),b=F}function Jr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(w=k[r+(t*6|0)+2>>1]|0,l=k[r+(t*6|0)+4>>1]|0,k[o+(t*6|0)>>1]=k[r+(t*6|0)>>1]|0,k[o+(t*6|0)+2>>1]=w,k[o+(t*6|0)+4>>1]=l,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do D=k[r+(d+l<<1)>>1]|0,w=k[r+(d+h<<1)>>1]|0,k[o+(d*6|0)>>1]=k[r+(d<<1)>>1]|0,k[o+(d*6|0)+2>>1]=D,k[o+(d*6|0)+4>>1]=w,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do D=k[r+(d<<1)>>1]|0,R=k[r+(d+h<<1)>>1]|0,E=M[r+(d+t<<1)>>1]|0,F=v0(M[r+(d+l<<1)>>1]|0,0,16)|0,E=ye|E,R=v0(R&65535|0,0,48)|0,R=F|D&65535|R,E=E&65535|ye,D=o+(d<<3)|0,F=D,k[F>>1]=R,k[F+2>>1]=R>>>16,D=D+4|0,k[D>>1]=E,k[D+2>>1]=E>>>16,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)&&(d=e[t+16>>2]|0,!((a|0)<=0)))for(t=o,h=0;R=t+4|0,F=k[t>>1]|0,k[t>>1]=k[R>>1]|0,k[R>>1]=F,h=h+1|0,(h|0)!=(a|0);)t=t+(d<<1)|0}function Ml(t){t=t|0}function _l(t){t=t|0,he(t)}function Pl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,o=ie(e[t+8>>2]|0,o)|0,t=e[t+4>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,r,o)|0)!=(o|0)&&(a=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,a|0,3,35648),t=m,m=0,t&1?(t=j()|0,It(a|0),le(t|0)):Qt(a|0,824,96))}function Ll(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;E=b,b=b+16|0,D=E,C=t+8|0,l=e[C>>2]|0,a=ie(l,o)|0;do if(a){for(d=t+4|0,h=a;l=e[d>>2]|0,l=Yt[e[(e[l>>2]|0)+32>>2]&63](l,r,h)|0,!!l;)if(a=h-l|0,(h|0)==(l|0)){w=11;break}else h=a;if((w|0)==11){l=e[C>>2]|0,h=a;break}a=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,a|0,3,35648),t=m,m=0,t&1?(t=j()|0,It(a|0),le(t|0)):Qt(a|0,824,96)}else h=0;while(!1);if((l|0)==2&&(ti(r,o<<1),l=e[C>>2]|0),a=e[t+12>>2]|0,(a|0)<=(ie(l,o)|0)){b=E;return}t=e[t+4>>2]|0,Vi[e[(e[t>>2]|0)+16>>2]&15](D,t,a-h|0,0,1,24),b=E}function Ol(t){t=t|0,he(t)}function $l(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,a=t+4|0,o0(e[a>>2]|0,r|0,ie(e[t+8>>2]|0,o)|0)|0,e[a>>2]=(e[a>>2]|0)+(e[t+12>>2]|0)}function Bl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,a=t+4|0,o0(r|0,e[a>>2]|0,ie(e[t+8>>2]|0,o)|0)|0,e[a>>2]=(e[a>>2]|0)+(e[t+12>>2]|0)}function Y0(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;e[t+112>>2]=0,e[t+108>>2]=0,D=e[r>>2]|0,l=D;do if(D)if(d=t+92|0,D=t+96|0,w=e[D>>2]|0,C=e[d>>2]|0,o=C,a=w-o|0,a>>>0>=4e4?(a>>>0>4e4&&(h=C+4e4|0,(w|0)!=(h|0))&&(e[D>>2]=h),h=o):(vi(d,4e4-a|0),h=e[d>>2]|0,l=e[r>>2]|0),o=t+116|0,e[o>>2]=h,w=t+124|0,e[w>>2]=h,C=t+104|0,e[C>>2]=l,a=l,l){if((e[a+12>>2]|0)==(e[a+16>>2]|0)){if(r=(Et[e[(e[l>>2]|0)+36>>2]&127](a)|0)==-1,a=e[w>>2]|0,r)break;l=e[o>>2]|0}else a=h,l=h;if(d=a-l|0,d>>>0<=64){if(h=t+92|0,(a|0)==(l|0))a=l;else{a=l,l=0;do S[(e[h>>2]|0)+l>>0]=S[a+l>>0]|0,l=l+1|0,a=e[o>>2]|0;while(l>>>0>>0);l=e[w>>2]|0}h=e[h>>2]|0,r=h,E=r-a|0,e[o>>2]=h,a=l+E|0,e[w>>2]=a,h=t+120|0,e[h>>2]=(e[h>>2]|0)+E,C=e[C>>2]|0,a=Yt[e[(e[C>>2]|0)+32>>2]&63](C,a,(e[D>>2]|0)-(r+d)|0)|0,a=(e[w>>2]|0)+a|0,e[w>>2]=a}}else a=h;else e[t+104>>2]=0,a=e[r+4>>2]|0,o=t+116|0,e[o>>2]=a,a=a+(e[r+8>>2]|0)|0,e[t+124>>2]=a;while(!1);if(o=e[o>>2]|0,o>>>0>=a>>>0){D=o,E=t+120|0,e[E>>2]=D,P0(t);return}for(;;){if((S[o>>0]|0)==-1){a=20;break}if(o=o+1|0,o>>>0>=a>>>0){a=20;break}}if((a|0)==20){E=t+120|0,e[E>>2]=o,P0(t);return}}function vi(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(C=t+8|0,l=e[C>>2]|0,D=t+4|0,o=e[D>>2]|0,a=o,(l-a|0)>>>0>=r>>>0){do S[o>>0]=0,o=(e[D>>2]|0)+1|0,e[D>>2]=o,r=r+-1|0;while(r|0);return}o=e[t>>2]|0,h=a-o+r|0,(h|0)<0&&(pi(t),l=e[C>>2]|0,o=e[t>>2]|0),a=l-o|0,a>>>0<1073741823?(a=a<<1,a=a>>>0>>0?h:a,o=(e[D>>2]|0)-o|0,a?w=8:(l=0,d=0,h=o)):(a=2147483647,o=(e[D>>2]|0)-o|0,w=8),(w|0)==8&&(l=a,d=Xe(a)|0,h=o),o=d+h|0,l=d+l|0,a=o;do S[a>>0]=0,a=o+1|0,o=a,r=r+-1|0;while(r|0);r=e[t>>2]|0,a=(e[D>>2]|0)-r|0,w=d+(h-a)|0,o0(w|0,r|0,a|0)|0,e[t>>2]=w,e[D>>2]=o,e[C>>2]=l,r&&he(r)}function es(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;G=b,b=b+32|0,P=G+12|0,K=G,_=t+180|0,z=(e[_>>2]|0)+4|0,(e[t+32>>2]|0)==1?H=e[t+24>>2]|0:H=1,r=ie(H<<1,z)|0,e[P>>2]=0,L=P+4|0,e[L>>2]=0,e[P+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,P|0),$=m,m=0,$&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,$=m,m=0,!($&1))){e[P>>2]=a,$=a+(r<<1)|0,e[P+8>>2]=$,Jt(a|0,0,o|0)|0,e[L>>2]=$;break}a=j()|0,r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[K>>2]=0,$=K+4|0,e[$>>2]=0,e[K+8>>2]=0;do if(!H)d=18;else{if(H>>>0>1073741823&&(m=0,ue(178,K|0),R=m,m=0,R&1)||(d=16),(d|0)==16&&(l=H<<2,m=0,h=ge(67,l|0)|0,R=m,m=0,!(R&1))){e[K>>2]=h,d=h+(H<<2)|0,e[K+8>>2]=d,Jt(h|0,0,l|0)|0,e[$>>2]=d,d=18;break}a=j()|0,r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+12|0;e:do if((e[h>>2]|0)>0){d=t+4604|0,w=(ie(H,z)|0)+1|0,C=t+4608|0,D=t+92|0,E=(H|0)>0,F=t+4600|0,R=0;t:for(;;){if(o=e[P>>2]|0,r=o+2|0,e[d>>2]=r,o=o+(w<<1)|0,e[C>>2]=o,R&1?(e[d>>2]=o,e[C>>2]=r):r=o,l=e[D>>2]|0,m=0,$e(e[(e[l>>2]|0)+12>>2]|0,l|0,r|0,e[_>>2]|0,z|0),l=m,m=0,l&1){d=28;break}if(E){r=e[d>>2]|0,o=e[C>>2]|0,a=e[K>>2]|0,l=0;do{if(e[F>>2]=e[a+(l<<2)>>2],a=e[_>>2]|0,k[r+(a<<1)>>1]=k[r+(a+-1<<1)>>1]|0,k[o+-2>>1]=k[r>>1]|0,m=0,Ae(68,t|0,0),a=m,m=0,a&1){d=27;break t}a=e[K>>2]|0,e[a+(l<<2)>>2]=e[F>>2],r=(e[d>>2]|0)+(z<<1)|0,e[d>>2]=r,o=(e[C>>2]|0)+(z<<1)|0,e[C>>2]=o,l=l+1|0}while((l|0)<(H|0))}if(R=R+1|0,(R|0)>=(e[h>>2]|0)){d=40;break e}}if((d|0)==27){a=j()|0;break}else if((d|0)==28){a=j()|0;break}}else d=40;while(!1);do if((d|0)==40){if(m=0,ue(182,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[K>>2]|0,o=r,r&&(a=e[$>>2]|0,(a|0)!=(r|0)&&(e[$>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[P>>2]|0,!r){b=G;return}o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=G;return}while(!1);r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function Vl(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=t+4604|0,r=e[F>>2]|0,z=t+180|0,!((e[z>>2]|0)<=0))for(R=t+4608|0,_=t+4612|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=zl(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(Gl(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[z>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function Ul(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;l=t+104|0,(e[l>>2]|0)>>>0<4&&en(t),h=t+100|0,d=t+112|0,w=t+96|0,C=t+108|0,D=t+116|0,r=e[h>>2]|0,a=0;do{if(o=S[d>>0]|0,(r|0)>31)break;r=e[w>>2]|0,o<<24>>24?(S[e[C>>2]>>0]=r>>>25,e[w>>2]=e[w>>2]<<7,r=(e[h>>2]|0)+7|0):(S[e[C>>2]>>0]=r>>>24,e[w>>2]=e[w>>2]<<8,r=(e[h>>2]|0)+8|0),e[h>>2]=r,E=e[C>>2]|0,o=(S[E>>0]|0)==-1&1,S[d>>0]=o,e[C>>2]=E+1,e[l>>2]=(e[l>>2]|0)+-1,e[D>>2]=(e[D>>2]|0)+1,a=a+1|0}while((a|0)<4);o<<24>>24?_t(t,0,(r+-1|0)%8|0):_t(t,0,(r|0)%8|0),(e[l>>2]|0)>>>0<4&&en(t),r=e[h>>2]|0,o=0;do{if((r|0)>31)break;r=e[w>>2]|0,S[d>>0]|0?(S[e[C>>2]>>0]=r>>>25,e[w>>2]=e[w>>2]<<7,r=(e[h>>2]|0)+7|0):(S[e[C>>2]>>0]=r>>>24,e[w>>2]=e[w>>2]<<8,r=(e[h>>2]|0)+8|0),e[h>>2]=r,E=e[C>>2]|0,S[d>>0]=(S[E>>0]|0)==-1&1,e[C>>2]=E+1,e[l>>2]=(e[l>>2]|0)+-1,e[D>>2]=(e[D>>2]|0)+1,o=o+1|0}while((o|0)<4);e[t+132>>2]|0&&en(t)}function en(t){t=t|0;var r=0,o=0,a=0,l=0,h=0;if(r=e[t+132>>2]|0,r||(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,4,35648),t=m,m=0,t&1||Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)),o=t+108|0,a=t+120|0,h=e[a>>2]|0,l=(e[o>>2]|0)-h|0,(Yt[e[(e[r>>2]|0)+48>>2]&63](r,h,l)|0)==(l|0)){h=e[a>>2]|0,e[o>>2]=h,e[t+104>>2]=(e[t+124>>2]|0)-h;return}r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,4,35648),h=m,m=0,h&1||Qt(r|0,824,96),h=j()|0,It(r|0),le(h|0)}function _t(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(D=t+100|0,o=(e[D>>2]|0)-o|0,e[D>>2]=o,(o|0)>-1){E=t+96|0,e[E>>2]=e[E>>2]|r<>2]=e[E>>2]|r>>0-o,C=t+104|0,(e[C>>2]|0)>>>0<4&&(en(t),o=e[D>>2]|0),h=t+112|0,d=t+108|0,w=t+116|0,a=0;!((o|0)>31);)if(o=e[E>>2]|0,S[h>>0]|0?(S[e[d>>2]>>0]=o>>>25,e[E>>2]=e[E>>2]<<7,o=(e[D>>2]|0)+7|0):(S[e[d>>2]>>0]=o>>>24,e[E>>2]=e[E>>2]<<8,o=(e[D>>2]|0)+8|0),e[D>>2]=o,F=e[d>>2]|0,S[h>>0]=(S[F>>0]|0)==-1&1,e[d>>2]=F+1,e[C>>2]=(e[C>>2]|0)+-1,e[w>>2]=(e[w>>2]|0)+1,a=a+1|0,(a|0)>=4){l=11;break}e:do if((l|0)==11&&(o|0)<0){e[E>>2]=e[E>>2]|r>>0-o,(e[C>>2]|0)>>>0<4&&(en(t),o=e[D>>2]|0),a=0;do{if((o|0)>31)break e;o=e[E>>2]|0,S[h>>0]|0?(S[e[d>>2]>>0]=o>>>25,e[E>>2]=e[E>>2]<<7,o=(e[D>>2]|0)+7|0):(S[e[d>>2]>>0]=o>>>24,e[E>>2]=e[E>>2]<<8,o=(e[D>>2]|0)+8|0),e[D>>2]=o,F=e[d>>2]|0,S[h>>0]=(S[F>>0]|0)==-1&1,e[d>>2]=F+1,e[C>>2]=(e[C>>2]|0)+-1,e[w>>2]=(e[w>>2]|0)+1,a=a+1|0}while((a|0)<4)}while(!1);e[E>>2]=e[E>>2]|r<>31,h=(H^r)-H|0,_=t+196+(h*12|0)+10|0,d=k[_>>1]|0,R=t+196+(h*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(r=5;(d<>1]^H)-H+a|0,z=t+136|0,a=e[z>>2]|0,(l&a|0)==(l|0)?D=l:D=a&~(l>>31),l=(o-D^H)-H|0,C=t+144|0,a=e[C>>2]|0,(l|0)>0?l=(l+a|0)/(a<<1|1|0)|0:l=(l-a|0)/(a<<1|1|0)|0,F=t+140|0,w=e[F>>2]|0,o=((l|0)<0?w:0)+l|0,w=o-((o|0)<((w+1|0)/2|0|0)?0:w)|0,h=t+196+(h*12|0)+4|0,a|r?l=0:l=(e[h>>2]<<1)+-1+d>>31,a=l^w,is(t,r,a>>30^a<<1,e[t+156>>2]|0),a=e[t+160>>2]|0,r=(e[R>>2]|0)+((w|0)>-1?w:0-w|0)|0,l=(e[h>>2]|0)+(ie(e[C>>2]<<1|1,w)|0)|0,o=k[_>>1]|0,(o|0)==(a|0)&&(r=r>>1,l=l>>1,o=a>>1),e[R>>2]=r,a=o+1|0,k[_>>1]=a,r=a+l|0,(r|0)>=1?(l|0)>0&&(l=l-a|0,_=k[E>>1]|0,k[E>>1]=(_<<16>>16<127&1)+(_&65535),l=(l|0)>0?0:l):(l=k[E>>1]|0,k[E>>1]=(l&65535)-(l<<16>>16>-128&1),l=(r|0)>(~o|0)?r:0-o|0),e[h>>2]=l,a=e[C>>2]|0,o=a<<1|1,r=(ie(o,(w^H)-H|0)|0)+D|0,(r|0)>=(0-a|0)?(l=e[z>>2]|0,(l+a|0)<(r|0)&&(r=r-(ie(e[F>>2]|0,o)|0)|0)):(r=(ie(e[F>>2]|0,o)|0)+r|0,l=e[z>>2]|0),(r&l|0)==(r|0)?(H=r,H=H&65535,H|0):(H=l&~(r>>31),H=H&65535,H|0)}function Gl(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(C=(e[t+180>>2]|0)-r|0,D=e[t+4608>>2]|0,E=e[t+4604>>2]|0,l=k[D+(r+-1<<1)>>1]|0,w=l&65535,o=e[t+144>>2]|0,h=0;a=D+(h+r<<1)|0,d=(M[a>>1]|0)-w|0,!((((d|0)>-1?d:0-d|0)|0)>(o|0));)if(k[a>>1]=l,h=h+1|0,(h|0)==(C|0)){h=C;break}if(l=(h|0)==(C|0),d=t+4600|0,a=e[36476+(e[d>>2]<<2)>>2]|0,(1<(h|0))o=h;else{o=h;do _t(t,1,1),a=e[d>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[d>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>1]|0,w,M[E+(C<<1)>>1]|0)|0,k[r>>1]=t,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,t=h+1|0,t|0)}function ql(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;return w=o-a|0,C=t+136|0,d=t+144|0,l=e[d>>2]|0,(((w|0)>-1?w:0-w|0)|0)>(l|0)?(h=a-o>>31|1,r=ie(h,r-a|0)|0,(r|0)>0?r=(l+r|0)/(l<<1|1|0)|0:r=(r-l|0)/(l<<1|1|0)|0,w=t+140|0,l=e[w>>2]|0,o=((r|0)<0?l:0)+r|0,l=o-((o|0)<((l+1|0)/2|0|0)?0:l)|0,ts(t,t+4576|0,l),l=ie(l,h)|0,h=e[d>>2]|0,d=h<<1|1,l=(ie(l,d)|0)+a|0,(l|0)>=(0-h|0)?(r=e[C>>2]|0,(r+h|0)<(l|0)&&(l=l-(ie(e[w>>2]|0,d)|0)|0)):(l=(ie(e[w>>2]|0,d)|0)+l|0,r=e[C>>2]|0),(l&r|0)==(l|0)?(C=l,C=C&65535,C|0):(C=r&~(l>>31),C=C&65535,C|0)):(r=r-o|0,(r|0)>0?r=(l+r|0)/(l<<1|1|0)|0:r=(r-l|0)/(l<<1|1|0)|0,w=t+140|0,l=e[w>>2]|0,h=((r|0)<0?l:0)+r|0,l=h-((h|0)<((l+1|0)/2|0|0)?0:l)|0,ts(t,t+4588|0,l),h=e[d>>2]|0,d=h<<1|1,l=(ie(d,l)|0)+o|0,(l|0)>=(0-h|0)?(r=e[C>>2]|0,(r+h|0)<(l|0)&&(l=l-(ie(e[w>>2]|0,d)|0)|0)):(l=(ie(e[w>>2]|0,d)|0)+l|0,r=e[C>>2]|0),(l&r|0)==(l|0)?(C=l,C=C&65535,C|0):(C=r&~(l>>31),C=C&65535,C|0))}function ts(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,is(t,l,a,(e[t+156>>2]|0)+-1-(e[36476+(e[t+4600>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function is(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=o>>r,h=t+148|0,d=a-(e[h>>2]|0)|0,(l|0)<(d+-1|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-31-(e[h>>2]|0)|0)):_t(t,1,d),r=e[h>>2]|0,_t(t,(1<>2]|0,C=t+120|0,r>>>0<((e[C>>2]|0)+-3|0)>>>0){C=t+112|0,d=e[C>>2]|0,t=t+108|0,e[t>>2]=(N[r+1>>0]<<16|N[r>>0]<<24|N[r+2>>0]<<8|N[r+3>>0])>>>d|e[t>>2],t=32-d>>3,e[w>>2]=r+t,e[C>>2]=(t<<3)+d;return}d=t+104|0,o=e[d>>2]|0;do if(o){if((e[o+12>>2]|0)==(e[o+16>>2]|0)){if((Et[e[(e[o>>2]|0)+36>>2]&127](o)|0)==-1)break;r=e[w>>2]|0}if(l=t+124|0,o=e[l>>2]|0,h=o-r|0,h>>>0<=64){if(a=t+92|0,(o|0)==(r|0))o=r;else{o=0;do S[(e[a>>2]|0)+o>>0]=S[r+o>>0]|0,o=o+1|0,r=e[w>>2]|0;while(o>>>0>>0);o=r,r=e[l>>2]|0}E=e[a>>2]|0,a=E,D=a-o|0,e[w>>2]=E,o=r+D|0,e[l>>2]=o,e[C>>2]=(e[C>>2]|0)+D,d=e[d>>2]|0,d=Yt[e[(e[d>>2]|0)+32>>2]&63](d,o,(e[t+96>>2]|0)-(a+h)|0)|0,e[l>>2]=(e[l>>2]|0)+d}}while(!1);for(d=t+112|0,h=t+108|0,t=e[t+124>>2]|0,l=t+-1|0,r=e[w>>2]|0;;){if(r>>>0>=t>>>0){o=14;break}if(a=S[r>>0]|0,o=a&255,a=a<<24>>24==-1,a){if((r|0)==(l|0)){o=25;break}if(r=r+1|0,(S[r>>0]|0)<0){o=25;break}}else r=r+1|0;if(E=e[d>>2]|0,e[h>>2]=o<<24-E|e[h>>2],e[w>>2]=r,E=E+(a?7:8)|0,e[d>>2]=E,(E|0)>=24){o=33;break}}if((o|0)==14){if((e[d>>2]|0)>=1)return;r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,5,35648),E=m,m=0,E&1||Qt(r|0,824,96),E=j()|0,It(r|0),le(E|0)}else if((o|0)==25){if((e[d>>2]|0)>=1)return;r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,5,35648),E=m,m=0,E&1||Qt(r|0,824,96),E=j()|0,It(r|0),le(E|0)}else if((o|0)==33){e:do if(r>>>0>>0)do{if((S[r>>0]|0)==-1)break e;r=r+1|0}while(r>>>0>>0);while(!1);e[C>>2]=r;return}}function Wl(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+144|0;e:do if(e[F>>2]|0)r=t+152|0;else if(o=e[t+136>>2]|0,r=t+152|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+184>>2]|0))&&(e[a+8>>2]|0)==(e[t+188>>2]|0)&&(e[a+12>>2]|0)==(e[t+192>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4612>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4612>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4612>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4612>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4616|0,a=E<<1,l=t+4620|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4612|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+192|0,C=t+188|0,d=t+184|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function j0(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(C=t+8|0,l=e[C>>2]|0,D=t+4|0,o=e[D>>2]|0,a=o,(l-a|0)>>>0>=r>>>0){do S[o>>0]=0,o=(e[D>>2]|0)+1|0,e[D>>2]=o,r=r+-1|0;while(r|0);return}o=e[t>>2]|0,h=a-o+r|0,(h|0)<0&&(pi(t),l=e[C>>2]|0,o=e[t>>2]|0),a=l-o|0,a>>>0<1073741823?(a=a<<1,a=a>>>0>>0?h:a,o=(e[D>>2]|0)-o|0,a?w=8:(l=0,d=0,h=o)):(a=2147483647,o=(e[D>>2]|0)-o|0,w=8),(w|0)==8&&(l=a,d=Xe(a)|0,h=o),o=d+h|0,l=d+l|0,a=o;do S[a>>0]=0,a=o+1|0,o=a,r=r+-1|0;while(r|0);r=e[t>>2]|0,a=(e[D>>2]|0)-r|0,w=d+(h-a)|0,o0(w|0,r|0,a|0)|0,e[t>>2]=w,e[D>>2]=o,e[C>>2]=l,r&&he(r)}function Hl(t){t=t|0;var r=0,o=0;e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Ql(t){t=t|0;var r=0,o=0;if(e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Kl(t){t=t|0;var r=0,o=0;e[t>>2]=36052,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Yl(t){t=t|0;var r=0,o=0;if(e[t>>2]=36052,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function jl(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+136>>2]|0,e[t+144>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+184>>2]=w|0?w:e[C+4>>2]|0,e[t+188>>2]=h,e[t+192>>2]=l,i1(t),l=t+140|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+196+(h*12|0)>>2]=r,e[t+196+(h*12|0)+4>>2]=0,k[t+196+(h*12|0)+8>>1]=0,k[t+196+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4576>>2]=w,e[t+4580>>2]=0,S[t+4584>>0]=C,S[t+4585>>0]=1,S[t+4586>>0]=0,e[t+4588>>2]=w,e[t+4592>>2]=1,S[t+4596>>0]=C,S[t+4597>>0]=1,S[t+4598>>0]=0,e[t+4600>>2]=0,b=d}function Xl(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4624)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35828,e[r+128>>2]=e[t+136>>2],e[r+132>>2]=e[t+140>>2],e[r+136>>2]=e[t+144>>2],e[r+140>>2]=e[t+148>>2],e[r+144>>2]=e[t+152>>2],e[r+148>>2]=e[t+156>>2],e[r+152>>2]=e[t+160>>2],l=r+156|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+172>>2]=e[a>>2],e[r+176>>2]=0,e[r+180>>2]=0,e[r+184>>2]=0,l=r+4568|0,a=r+188|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4580|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4592|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,ns(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],ns(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function Zl(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=6,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=6,e[a+12>>2]=t,L=a,b=G,L|0)}function ns(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;K=b,b=b+32|0,$=K+12|0,H=K,R=t+180|0,_=(e[R>>2]|0)+4|0,(e[t+32>>2]|0)==1?z=e[t+24>>2]|0:z=1,r=ie(z<<1,_)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;do if(r){if(r>>>0>715827882&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(d=6),(d|0)==6&&(m=0,o=ge(67,r*6|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,a=o+(r*6|0)|0,e[$+8>>2]=a;k[o>>1]=0,k[o+2>>1]=0,k[o+4>>1]=0,r=r+-1|0,r;)o=o+6|0;e[P>>2]=a;break}a=j()|0,r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),le(a|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!z)d=20;else{if(z>>>0>1073741823&&(m=0,ue(178,H|0),F=m,m=0,F&1)||(d=18),(d|0)==18&&(l=z<<2,m=0,h=ge(67,l|0)|0,F=m,m=0,!(F&1))){e[H>>2]=h,d=h+(z<<2)|0,e[H+8>>2]=d,Jt(h|0,0,l|0)|0,e[G>>2]=d,d=20;break}a=j()|0,r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==20){l=t+12|0;e:do if((e[l>>2]|0)>0){h=t+4604|0,d=(ie(z,_)|0)+1|0,w=t+4608|0,C=t+92|0,D=(z|0)>0,E=t+4600|0,F=0;t:for(;;){if(o=e[$>>2]|0,r=o+6|0,e[h>>2]=r,o=o+(d*6|0)|0,e[w>>2]=o,F&1?(e[h>>2]=o,e[w>>2]=r):r=o,a=e[C>>2]|0,m=0,$e(e[(e[a>>2]|0)+12>>2]|0,a|0,r|0,e[R>>2]|0,_|0),a=m,m=0,a&1){d=30;break}if(D){r=e[H>>2]|0,o=e[h>>2]|0,a=0;do{if(e[E>>2]=e[r+(a<<2)>>2],L=e[R>>2]|0,r=o+(L*6|0)|0,o=o+((L+-1|0)*6|0)|0,k[r>>1]=k[o>>1]|0,k[r+2>>1]=k[o+2>>1]|0,k[r+4>>1]=k[o+4>>1]|0,o=(e[w>>2]|0)+-6|0,r=e[h>>2]|0,k[o>>1]=k[r>>1]|0,k[o+2>>1]=k[r+2>>1]|0,k[o+4>>1]=k[r+4>>1]|0,m=0,Ae(69,t|0,0),o=m,m=0,o&1){d=29;break t}r=e[H>>2]|0,e[r+(a<<2)>>2]=e[E>>2],o=(e[h>>2]|0)+(_*6|0)|0,e[h>>2]=o,e[w>>2]=(e[w>>2]|0)+(_*6|0),a=a+1|0}while((a|0)<(z|0))}if(F=F+1|0,(F|0)>=(e[l>>2]|0)){d=42;break e}}if((d|0)==29){a=j()|0;break}else if((d|0)==30){a=j()|0;break}}else d=42;while(!1);do if((d|0)==42){if(m=0,ue(182,t|0),L=m,m=0,L&1){a=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),b=K;return}while(!1);r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),le(a|0)}function Jl(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0;if(ae=t+180|0,!((e[ae>>2]|0)<=0))for(re=t+4608|0,ce=t+4604|0,Ee=t+4612|0,ne=0;P=ne+-1|0,h=e[re>>2]|0,d=e[ce>>2]|0,r=ne+1|0,l=M[d+(ne*6|0)>>1]|0,J=e[Ee>>2]|0,w=M[d+(P*6|0)>>1]|0,C=l-w|0,D=M[h+(P*6|0)>>1]|0,E=w-D|0,F=((((S[J+((M[d+(r*6|0)>>1]|0)-l)>>0]|0)*9|0)+(S[J+C>>0]|0)|0)*9|0)+(S[J+E>>0]|0)|0,a=M[d+(ne*6|0)+2>>1]|0,R=M[d+(P*6|0)+2>>1]|0,_=a-R|0,z=M[h+(P*6|0)+2>>1]|0,H=R-z|0,K=((((S[J+((M[d+(r*6|0)+2>>1]|0)-a)>>0]|0)*9|0)+(S[J+_>>0]|0)|0)*9|0)+(S[J+H>>0]|0)|0,o=M[d+(ne*6|0)+4>>1]|0,G=M[d+(P*6|0)+4>>1]|0,$=o-G|0,P=M[h+(P*6|0)+4>>1]|0,L=G-P|0,J=((((S[J+((M[d+(r*6|0)+4>>1]|0)-o)>>0]|0)*9|0)+(S[J+$>>0]|0)|0)*9|0)+(S[J+L>>0]|0)|0,K|F|J?(d=M[h+(ne*6|0)>>1]|0,h=l-D>>31,(h^E|0)>=0&&((h^C|0)<0?l=D:l=D-w+l|0),d=Hn(t,F,d,l,0)|0,h=M[(e[re>>2]|0)+(ne*6|0)+2>>1]|0,l=a-z>>31,(l^H|0)>=0&&((l^_|0)<0?a=z:a=z-R+a|0),l=Hn(t,K,h,a,0)|0,h=M[(e[re>>2]|0)+(ne*6|0)+4>>1]|0,a=o-P>>31,(a^L|0)>=0&&((a^$|0)<0?o=P:o=P-G+o|0),L=Hn(t,J,h,o,0)|0,J=e[re>>2]|0,k[J+(ne*6|0)>>1]=d,k[J+(ne*6|0)+2>>1]=l,k[J+(ne*6|0)+4>>1]=L):r=(e1(t,ne,0)|0)+ne|0,(r|0)<(e[ae>>2]|0);)ne=r}function e1(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0;for(ae=b,b=b+48|0,_=ae+30|0,R=ae+24|0,F=ae+18|0,z=ae+12|0,P=ae+6|0,L=ae,J=(e[t+180>>2]|0)-r|0,ne=e[t+4608>>2]|0,H=e[t+4604>>2]|0,$=r+-1|0,K=k[ne+($*6|0)>>1]|0,G=k[ne+($*6|0)+2>>1]|0,$=k[ne+($*6|0)+4>>1]|0,o=K&65535,a=t+144|0,l=G&65535,h=$&65535,E=0;C=E+r|0,d=ne+(C*6|0)|0,w=ne+(C*6|0)+2|0,C=ne+(C*6|0)+4|0,re=(M[d>>1]|0)-o|0,D=e[a>>2]|0,!((((re|0)>-1?re:0-re|0)|0)>(D|0)||(re=(M[w>>1]|0)-l|0,(((re|0)>-1?re:0-re|0)|0)>(D|0))||(re=(M[C>>1]|0)-h|0,(((re|0)>-1?re:0-re|0)|0)>(D|0)));)if(k[d>>1]=K,k[w>>1]=G,k[C>>1]=$,E=E+1|0,(E|0)==(J|0)){E=J;break}if(l=(E|0)==(J|0),h=t+4600|0,a=e[36476+(e[h>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[h>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[h>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>1]=k[re>>1]|0,k[P+2>>1]=k[re+2>>1]|0,k[P+4>>1]=k[re+4>>1]|0,k[L>>1]=K,k[L+2>>1]=G,k[L+4>>1]=$,r=H+(r*6|0)|0,k[F>>1]=k[P>>1]|0,k[F+2>>1]=k[P+2>>1]|0,k[F+4>>1]=k[P+4>>1]|0,k[R>>1]=k[L>>1]|0,k[R+2>>1]=k[L+2>>1]|0,k[R+4>>1]=k[L+4>>1]|0,k[_>>1]=k[r>>1]|0,k[_+2>>1]=k[r+2>>1]|0,k[_+4>>1]=k[r+4>>1]|0,t1(z,t,F,R,_),k[re>>1]=k[z>>1]|0,k[re+2>>1]=k[z+2>>1]|0,k[re+4>>1]=k[z+4>>1]|0,re=e[h>>2]|0,e[h>>2]=(re|0)<1?0:re+-1|0,re=E+1|0,b=ae,re|0)}function Hn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(H=r>>31,h=(H^r)-H|0,_=t+196+(h*12|0)+10|0,d=k[_>>1]|0,R=t+196+(h*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(r=5;(d<>1]^H)-H+a|0,z=t+136|0,a=e[z>>2]|0,(l&a|0)==(l|0)?D=l:D=a&~(l>>31),l=(o-D^H)-H|0,C=t+144|0,a=e[C>>2]|0,(l|0)>0?l=(l+a|0)/(a<<1|1|0)|0:l=(l-a|0)/(a<<1|1|0)|0,F=t+140|0,w=e[F>>2]|0,o=((l|0)<0?w:0)+l|0,w=o-((o|0)<((w+1|0)/2|0|0)?0:w)|0,h=t+196+(h*12|0)+4|0,a|r?l=0:l=(e[h>>2]<<1)+-1+d>>31,a=l^w,rs(t,r,a>>30^a<<1,e[t+156>>2]|0),a=e[t+160>>2]|0,r=(e[R>>2]|0)+((w|0)>-1?w:0-w|0)|0,l=(e[h>>2]|0)+(ie(e[C>>2]<<1|1,w)|0)|0,o=k[_>>1]|0,(o|0)==(a|0)&&(r=r>>1,l=l>>1,o=a>>1),e[R>>2]=r,a=o+1|0,k[_>>1]=a,r=a+l|0,(r|0)>=1?(l|0)>0&&(l=l-a|0,_=k[E>>1]|0,k[E>>1]=(_<<16>>16<127&1)+(_&65535),l=(l|0)>0?0:l):(l=k[E>>1]|0,k[E>>1]=(l&65535)-(l<<16>>16>-128&1),l=(r|0)>(~o|0)?r:0-o|0),e[h>>2]=l,a=e[C>>2]|0,o=a<<1|1,r=(ie(o,(w^H)-H|0)|0)+D|0,(r|0)>=(0-a|0)?(l=e[z>>2]|0,(l+a|0)<(r|0)&&(r=r-(ie(e[F>>2]|0,o)|0)|0)):(r=(ie(e[F>>2]|0,o)|0)+r|0,l=e[z>>2]|0),(r&l|0)==(r|0)?(H=r,H=H&65535,H|0):(H=l&~(r>>31),H=H&65535,H|0)}function rs(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=o>>r,h=t+148|0,d=a-(e[h>>2]|0)|0,(l|0)<(d+-1|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-31-(e[h>>2]|0)|0)):_t(t,1,d),r=e[h>>2]|0,_t(t,(1<>1]|0,R=F-(M[a>>1]|0)>>31|1,h=ie(R,(M[o>>1]|0)-F|0)|0,D=r+144|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,P=r+140|0,C=e[P>>2]|0,w=((h|0)<0?C:0)+h|0,C=w-((w|0)<((C+1|0)/2|0|0)?0:C)|0,w=r+4576|0,Qn(r,w,C),K=M[l+2>>1]|0,G=K-(M[a+2>>1]|0)>>31|1,h=ie(G,(M[o+2>>1]|0)-K|0)|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,_=e[P>>2]|0,$=((h|0)<0?_:0)+h|0,_=$-(($|0)<((_+1|0)/2|0|0)?0:_)|0,Qn(r,w,_),$=M[l+4>>1]|0,H=$-(M[a+4>>1]|0)>>31|1,h=ie(H,(M[o+4>>1]|0)-$|0)|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,E=e[P>>2]|0,h=((h|0)<0?E:0)+h|0,E=h-((h|0)<((E+1|0)/2|0|0)?0:E)|0,Qn(r,w,E),w=e[D>>2]|0,D=w<<1|1,h=(ie(ie(D,C)|0,R)|0)+F|0,o=0-w|0,(h|0)>=(o|0)?(d=e[z>>2]|0,(d+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0),a=d):(h=(ie(e[P>>2]|0,D)|0)+h|0,a=e[z>>2]|0),(h&a|0)!=(h|0)&&(h=a&~(h>>31)),l=h&65535,h=(ie(ie(D,_)|0,G)|0)+K|0,(h|0)>=(o|0)?(a+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0):h=(ie(e[P>>2]|0,D)|0)+h|0,(h&a|0)!=(h|0)&&(h=a&~(h>>31)),d=h&65535,h=(ie(ie(D,E)|0,H)|0)+$|0,(h|0)>=(o|0)?(a+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0):h=(ie(e[P>>2]|0,D)|0)+h|0,(h&a|0)==(h|0)){P=h,P=P&65535,k[t>>1]=l,$=t+2|0,k[$>>1]=d,t=t+4|0,k[t>>1]=P;return}P=a&~(h>>31),P=P&65535,k[t>>1]=l,$=t+2|0,k[$>>1]=d,t=t+4|0,k[t>>1]=P}function Qn(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,rs(t,l,a,(e[t+156>>2]|0)+-1-(e[36476+(e[t+4600>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function i1(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+144|0;e:do if(e[F>>2]|0)r=t+152|0;else if(o=e[t+136>>2]|0,r=t+152|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+184>>2]|0))&&(e[a+8>>2]|0)==(e[t+188>>2]|0)&&(e[a+12>>2]|0)==(e[t+192>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4612>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4612>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4612>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4612>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4616|0,a=E<<1,l=t+4620|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4612|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+192|0,C=t+188|0,d=t+184|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function n1(t){t=t|0;var r=0,o=0;e[t>>2]=36024,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function r1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36024,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function s1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+136>>2]|0,e[t+144>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+184>>2]=w|0?w:e[C+4>>2]|0,e[t+188>>2]=h,e[t+192>>2]=l,O1(t),l=t+140|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+196+(h*12|0)>>2]=r,e[t+196+(h*12|0)+4>>2]=0,k[t+196+(h*12|0)+8>>1]=0,k[t+196+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4576>>2]=w,e[t+4580>>2]=0,S[t+4584>>0]=C,S[t+4585>>0]=1,S[t+4586>>0]=0,e[t+4588>>2]=w,e[t+4592>>2]=1,S[t+4596>>0]=C,S[t+4597>>0]=1,S[t+4598>>0]=0,e[t+4600>>2]=0,b=d}function o1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4624)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35800,e[r+128>>2]=e[t+136>>2],e[r+132>>2]=e[t+140>>2],e[r+136>>2]=e[t+144>>2],e[r+140>>2]=e[t+148>>2],e[r+144>>2]=e[t+152>>2],e[r+148>>2]=e[t+156>>2],e[r+152>>2]=e[t+160>>2],l=r+156|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+172>>2]=e[a>>2],e[r+176>>2]=0,e[r+180>>2]=0,e[r+184>>2]=0,l=r+4568|0,a=r+188|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4580|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4592|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,us(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],us(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function l1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0)}function u1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;e[t>>2]=36712,e[t+4>>2]=o,E=t+8|0,a=e[o>>2]|0,C=o+16|0,d=e[C>>2]|0,h=ie(d,a)|0,e[E>>2]=0,F=t+12|0,e[F>>2]=0,e[t+16>>2]=0;do if(!h)h=d;else{if((h|0)<0&&(m=0,ue(178,E|0),d=m,m=0,d&1)||(D=4),(D|0)==4&&(m=0,w=ge(67,h|0)|0,d=m,m=0,!(d&1))){e[F>>2]=w,e[E>>2]=w,e[t+16>>2]=w+h,a=w;do S[a>>0]=0,a=(e[F>>2]|0)+1|0,e[F>>2]=a,h=h+-1|0;while(h|0);h=e[C>>2]|0,a=e[o>>2]|0;break}a=j()|0,l=e[E>>2]|0,l&&((e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l)),F=a,le(F|0)}while(!1);if(d=t+20|0,a=ie(h,a)|0,e[d>>2]=0,h=t+24|0,e[h>>2]=0,e[t+28>>2]=0,!a){F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(D=15),(D|0)==15&&(m=0,l=ge(67,a|0)|0,D=m,m=0,!(D&1))){e[h>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[h>>2]|0)+1|0,e[h>>2]=l,a=a+-1|0;while(a|0);F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}a=j()|0,l=e[d>>2]|0,l&&((e[h>>2]|0)!=(l|0)&&(e[h>>2]=l),he(l)),l=e[E>>2]|0,l||(F=a,le(F|0)),(e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l),F=a,le(F|0)}function c1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;e[t>>2]=36688,e[t+4>>2]=o,E=t+8|0,a=e[o>>2]|0,C=o+16|0,d=e[C>>2]|0,h=ie(d,a)|0,e[E>>2]=0,F=t+12|0,e[F>>2]=0,e[t+16>>2]=0;do if(!h)h=d;else{if((h|0)<0&&(m=0,ue(178,E|0),d=m,m=0,d&1)||(D=4),(D|0)==4&&(m=0,w=ge(67,h|0)|0,d=m,m=0,!(d&1))){e[F>>2]=w,e[E>>2]=w,e[t+16>>2]=w+h,a=w;do S[a>>0]=0,a=(e[F>>2]|0)+1|0,e[F>>2]=a,h=h+-1|0;while(h|0);h=e[C>>2]|0,a=e[o>>2]|0;break}a=j()|0,l=e[E>>2]|0,l&&((e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l)),F=a,le(F|0)}while(!1);if(d=t+20|0,a=ie(h,a)|0,e[d>>2]=0,h=t+24|0,e[h>>2]=0,e[t+28>>2]=0,!a){F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(D=15),(D|0)==15&&(m=0,l=ge(67,a|0)|0,D=m,m=0,!(D&1))){e[h>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[h>>2]|0)+1|0,e[h>>2]=l,a=a+-1|0;while(a|0);F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}a=j()|0,l=e[d>>2]|0,l&&((e[h>>2]|0)!=(l|0)&&(e[h>>2]=l),he(l)),l=e[E>>2]|0,l||(F=a,le(F|0)),(e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l),F=a,le(F|0)}function f1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;e[t>>2]=36664,e[t+4>>2]=o,E=t+8|0,a=e[o>>2]|0,C=o+16|0,d=e[C>>2]|0,h=ie(d,a)|0,e[E>>2]=0,F=t+12|0,e[F>>2]=0,e[t+16>>2]=0;do if(!h)h=d;else{if((h|0)<0&&(m=0,ue(178,E|0),d=m,m=0,d&1)||(D=4),(D|0)==4&&(m=0,w=ge(67,h|0)|0,d=m,m=0,!(d&1))){e[F>>2]=w,e[E>>2]=w,e[t+16>>2]=w+h,a=w;do S[a>>0]=0,a=(e[F>>2]|0)+1|0,e[F>>2]=a,h=h+-1|0;while(h|0);h=e[C>>2]|0,a=e[o>>2]|0;break}a=j()|0,l=e[E>>2]|0,l&&((e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l)),F=a,le(F|0)}while(!1);if(d=t+20|0,a=ie(h,a)|0,e[d>>2]=0,h=t+24|0,e[h>>2]=0,e[t+28>>2]=0,!a){F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(D=15),(D|0)==15&&(m=0,l=ge(67,a|0)|0,D=m,m=0,!(D&1))){e[h>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[h>>2]|0)+1|0,e[h>>2]=l,a=a+-1|0;while(a|0);F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}a=j()|0,l=e[d>>2]|0,l&&((e[h>>2]|0)!=(l|0)&&(e[h>>2]=l),he(l)),l=e[E>>2]|0,l||(F=a,le(F|0)),(e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l),F=a,le(F|0)}function h1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;e[t>>2]=36640,e[t+4>>2]=o,E=t+8|0,a=e[o>>2]|0,C=o+16|0,d=e[C>>2]|0,h=ie(d,a)|0,e[E>>2]=0,F=t+12|0,e[F>>2]=0,e[t+16>>2]=0;do if(!h)h=d;else{if((h|0)<0&&(m=0,ue(178,E|0),d=m,m=0,d&1)||(D=4),(D|0)==4&&(m=0,w=ge(67,h|0)|0,d=m,m=0,!(d&1))){e[F>>2]=w,e[E>>2]=w,e[t+16>>2]=w+h,a=w;do S[a>>0]=0,a=(e[F>>2]|0)+1|0,e[F>>2]=a,h=h+-1|0;while(h|0);h=e[C>>2]|0,a=e[o>>2]|0;break}a=j()|0,l=e[E>>2]|0,l&&((e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l)),F=a,le(F|0)}while(!1);if(d=t+20|0,a=ie(h,a)|0,e[d>>2]=0,h=t+24|0,e[h>>2]=0,e[t+28>>2]=0,!a){F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}if((a|0)<0&&(m=0,ue(178,d|0),o=m,m=0,o&1)||(D=15),(D|0)==15&&(m=0,l=ge(67,a|0)|0,D=m,m=0,!(D&1))){e[h>>2]=l,e[d>>2]=l,e[t+28>>2]=l+a;do S[l>>0]=0,l=(e[h>>2]|0)+1|0,e[h>>2]=l,a=a+-1|0;while(a|0);F=t+36|0,e[F>>2]=e[r>>2],e[F+4>>2]=e[r+4>>2],e[F+8>>2]=e[r+8>>2];return}a=j()|0,l=e[d>>2]|0,l&&((e[h>>2]|0)!=(l|0)&&(e[h>>2]=l),he(l)),l=e[E>>2]|0,l||(F=a,le(F|0)),(e[F>>2]|0)!=(l|0)&&(e[F>>2]=l),he(l),F=a,le(F|0)}function d1(t){t=t|0;var r=0,o=0;e[t>>2]=36640,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=e[t+8>>2]|0,o&&(r=t+12|0,(e[r>>2]|0)!=(o|0)&&(e[r>>2]=o),he(o))}function p1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36640,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function m1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=t+36|0,!(e[l>>2]|0)){l=t+40|0,ss(t,r,e[l>>2]|0,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}h=ie(e[(e[t+4>>2]|0)+16>>2]|0,o)|0,d=t+20|0,ss(t,r,e[d>>2]|0,o,a),t=e[l>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,e[d>>2]|0,h)|0)!=(h|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,3,35648),d=m,m=0,d&1?(d=j()|0,It(l|0),le(d|0)):Qt(l|0,824,96))}function g1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){S1(t,l,r,o,a);return}else{l=t+40|0,Kn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Kn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;if(w=t+4|0,h=e[w>>2]|0,!(S[h+32>>0]|0))w=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*3|0)|0,h=e[w>>2]|0,r=e[h+16>>2]|0,(a|0)>0){for(h=e[d>>2]|0,t=0;C=h+2|0,D=S[h>>0]|0,S[h>>0]=S[C>>0]|0,S[C>>0]=D,t=t+1|0,(t|0)!=(a|0);)h=h+r|0;h=e[w>>2]|0}w=e[d>>2]|0}switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do d=N[w+(h*3|0)+1>>0]|0,l=128-d+(N[w+(h*3|0)+2>>0]|0)|0,C=(N[w+(h*3|0)>>0]|0)-d+128|0,D=o+(h*3|0)|0,S[D>>0]=d+192+(((l&255)+(C&255)|0)>>>2),S[D+1>>0]=l,S[D+2>>0]=C,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do a=N[w+(r*3|0)+1>>0]|0,C=128-a+(N[w+(r*3|0)+2>>0]|0)|0,D=(N[w+(r*3|0)>>0]|0)-a+128|0,S[o+r>>0]=a+192+(((C&255)+(D&255)|0)>>>2),S[o+(r+l)>>0]=C,S[o+(r+t)>>0]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do D=S[w+(d<<2)+3>>0]|0,E=N[w+(d<<2)+1>>0]|0,a=128-E+(N[w+(d<<2)+2>>0]|0)|0,C=(N[w+(d<<2)>>0]|0)-E+128|0,S[o+d>>0]=E+192+(((a&255)+(C&255)|0)>>>2),S[o+(d+l)>>0]=a,S[o+(d+t)>>0]=C,S[o+(d+r)>>0]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function S1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+176|0,F=E+152|0,_=E+16|0,R=E,d=ie(e[(e[t+4>>2]|0)+16>>2]|0,a)|0,C=t+20|0,h=e[C>>2]|0,!d){_=h,Kn(t,_,o,a,l),b=E;return}for(;w=Yt[e[(e[r>>2]|0)+32>>2]&63](r,h,d)|0,!!w;)if(h=e[C>>2]|0,(d|0)==(w|0)){D=26;break}else d=d-w|0;if((D|0)==26){Kn(t,h,o,a,l),b=E;return}o=_+56|0,C=_+4|0,e[_>>2]=36160,e[o>>2]=36180,m=0,Ae(62,_+56|0,C|0),E=m,m=0,E&1&&(_=j()|0,tt(o),le(_|0)),e[_+128>>2]=0,e[_+132>>2]=-1,e[_>>2]=36200,e[_+56>>2]=36220,m=0,ue(180,C|0),E=m,m=0;do if(E&1)h=j()|0;else{if(e[C>>2]=36236,r=_+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[_+52>>2]=16,e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,m=0,Ae(63,C|0,F|0),E=m,m=0,E&1){h=j()|0,de(F),de(r),wt(C);break}de(F),m=0,h=Ve(28,_|0,49029,57)|0,F=m,m=0,!(F&1)&&(m=0,Ne(36,h|0,0)|0,F=m,m=0,!(F&1))&&(w=Ct(16)|0,m=0,Ae(64,R|0,C|0),F=m,m=0,F&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,R|0),F=m,m=0,F&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(R),d||(R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0))),It(w|0),R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)),R=j()|0,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)}while(!1);_=h,tt(o),le(_|0)}function ss(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(d=N[r+(t*3|0)+1>>0]|0,h=N[r+(t*3|0)+2>>0]|0,w=(N[r+(t*3|0)>>0]|0)-((h+d|0)>>>2)+64|0,l=o+(t*3|0)|0,S[l>>0]=h+128+w,S[l+1>>0]=w,S[l+2>>0]=d+128+w,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do E=N[r+(d+l)>>0]|0,F=N[r+(d+h)>>0]|0,D=(N[r+d>>0]|0)-((F+E|0)>>>2)+64|0,w=o+(d*3|0)|0,S[w>>0]=F+128+D,S[w+1>>0]=D,S[w+2>>0]=E+128+D,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do D=N[r+(d+l)>>0]|0,R=N[r+(d+t)>>0]|0,E=(N[r+d>>0]|0)-((R+D|0)>>>2)+64|0,F=o+(d<<2)|0,E=E<<8&65280|N[r+(d+h)>>0]<<24|R+128+E&255|D+128+E<<16&16711680,S[F>>0]=E,S[F+1>>0]=E>>8,S[F+2>>0]=E>>16,S[F+3>>0]=E>>24,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)){if(d=e[t+16>>2]|0,(a|0)>0)t=o,h=0;else return;for(;R=t+2|0,F=S[t>>0]|0,S[t>>0]=S[R>>0]|0,S[R>>0]=F,h=h+1|0,(h|0)!=(a|0);)t=t+d|0}}function A1(t){t=t|0;var r=0,o=0;e[t>>2]=36664,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=e[t+8>>2]|0,o&&(r=t+12|0,(e[r>>2]|0)!=(o|0)&&(e[r>>2]=o),he(o))}function v1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36664,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function x1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=t+36|0,!(e[l>>2]|0)){l=t+40|0,os(t,r,e[l>>2]|0,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}h=ie(e[(e[t+4>>2]|0)+16>>2]|0,o)|0,d=t+20|0,os(t,r,e[d>>2]|0,o,a),t=e[l>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,e[d>>2]|0,h)|0)!=(h|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,3,35648),d=m,m=0,d&1?(d=j()|0,It(l|0),le(d|0)):Qt(l|0,824,96))}function w1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){y1(t,l,r,o,a);return}else{l=t+40|0,Yn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Yn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(w=t+4|0,h=e[w>>2]|0,!(S[h+32>>0]|0))w=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*3|0)|0,h=e[w>>2]|0,r=e[h+16>>2]|0,(a|0)>0){for(h=e[d>>2]|0,t=0;C=h+2|0,D=S[h>>0]|0,S[h>>0]=S[C>>0]|0,S[C>>0]=D,t=t+1|0,(t|0)!=(a|0);)h=h+r|0;h=e[w>>2]|0}w=e[d>>2]|0}switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do r=N[w+(h*3|0)>>0]|0,l=S[w+(h*3|0)+1>>0]|0,d=l&255,C=(N[w+(h*3|0)+2>>0]|0)+128-((d+r|0)>>>1)&255,D=o+(h*3|0)|0,S[D>>0]=r+128-d,S[D+1>>0]=l,S[D+2>>0]=C,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do C=S[w+(r*3|0)+1>>0]|0,d=N[w+(r*3|0)>>0]|0,a=C&255,D=(N[w+(r*3|0)+2>>0]|0)+128-((a+d|0)>>>1)&255,S[o+r>>0]=d+128-a,S[o+(r+l)>>0]=C,S[o+(r+t)>>0]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do a=S[w+(d<<2)+1>>0]|0,D=S[w+(d<<2)+3>>0]|0,F=N[w+(d<<2)>>0]|0,E=a&255,C=(N[w+(d<<2)+2>>0]|0)+128-((E+F|0)>>>1)&255,S[o+d>>0]=F+128-E,S[o+(d+l)>>0]=a,S[o+(d+t)>>0]=C,S[o+(d+r)>>0]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function y1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+176|0,F=E+152|0,_=E+16|0,R=E,d=ie(e[(e[t+4>>2]|0)+16>>2]|0,a)|0,C=t+20|0,h=e[C>>2]|0,!d){_=h,Yn(t,_,o,a,l),b=E;return}for(;w=Yt[e[(e[r>>2]|0)+32>>2]&63](r,h,d)|0,!!w;)if(h=e[C>>2]|0,(d|0)==(w|0)){D=26;break}else d=d-w|0;if((D|0)==26){Yn(t,h,o,a,l),b=E;return}o=_+56|0,C=_+4|0,e[_>>2]=36160,e[o>>2]=36180,m=0,Ae(62,_+56|0,C|0),E=m,m=0,E&1&&(_=j()|0,tt(o),le(_|0)),e[_+128>>2]=0,e[_+132>>2]=-1,e[_>>2]=36200,e[_+56>>2]=36220,m=0,ue(180,C|0),E=m,m=0;do if(E&1)h=j()|0;else{if(e[C>>2]=36236,r=_+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[_+52>>2]=16,e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,m=0,Ae(63,C|0,F|0),E=m,m=0,E&1){h=j()|0,de(F),de(r),wt(C);break}de(F),m=0,h=Ve(28,_|0,49029,57)|0,F=m,m=0,!(F&1)&&(m=0,Ne(36,h|0,0)|0,F=m,m=0,!(F&1))&&(w=Ct(16)|0,m=0,Ae(64,R|0,C|0),F=m,m=0,F&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,R|0),F=m,m=0,F&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(R),d||(R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0))),It(w|0),R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)),R=j()|0,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)}while(!1);_=h,tt(o),le(_|0)}function os(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(d=S[r+(t*3|0)+1>>0]|0,w=d&255,h=(N[r+(t*3|0)>>0]|0)+128+w|0,w=(N[r+(t*3|0)+2>>0]|0)+128+(((h&255)+w|0)>>>1)&255,l=o+(t*3|0)|0,S[l>>0]=h,S[l+1>>0]=d,S[l+2>>0]=w,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do E=S[r+(d+l)>>0]|0,D=E&255,F=(N[r+d>>0]|0)+128+D|0,D=(N[r+(d+h)>>0]|0)+128+(((F&255)+D|0)>>>1)&255,w=o+(d*3|0)|0,S[w>>0]=F,S[w+1>>0]=E,S[w+2>>0]=D,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=N[r+(d+l)>>0]|0,D=(N[r+d>>0]|0)+128+E&255,F=o+(d<<2)|0,E=D|E<<8|N[r+(d+h)>>0]<<24|(N[r+(d+t)>>0]|0)+128+((D+E|0)>>>1)<<16&16711680,S[F>>0]=E,S[F+1>>0]=E>>8,S[F+2>>0]=E>>16,S[F+3>>0]=E>>24,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)){if(d=e[t+16>>2]|0,(a|0)>0)t=o,h=0;else return;for(;F=t+2|0,E=S[t>>0]|0,S[t>>0]=S[F>>0]|0,S[F>>0]=E,h=h+1|0,(h|0)!=(a|0);)t=t+d|0}}function C1(t){t=t|0;var r=0,o=0;e[t>>2]=36688,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=e[t+8>>2]|0,o&&(r=t+12|0,(e[r>>2]|0)!=(o|0)&&(e[r>>2]=o),he(o))}function T1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36688,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function I1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=t+36|0,!(e[l>>2]|0)){l=t+40|0,as(t,r,e[l>>2]|0,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}h=ie(e[(e[t+4>>2]|0)+16>>2]|0,o)|0,d=t+20|0,as(t,r,e[d>>2]|0,o,a),t=e[l>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,e[d>>2]|0,h)|0)!=(h|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,3,35648),d=m,m=0,d&1?(d=j()|0,It(l|0),le(d|0)):Qt(l|0,824,96))}function E1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){D1(t,l,r,o,a);return}else{l=t+40|0,jn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function jn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;if(w=t+4|0,h=e[w>>2]|0,!(S[h+32>>0]|0))w=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*3|0)|0,h=e[w>>2]|0,r=e[h+16>>2]|0,(a|0)>0){for(h=e[d>>2]|0,t=0;C=h+2|0,D=S[h>>0]|0,S[h>>0]=S[C>>0]|0,S[C>>0]=D,t=t+1|0,(t|0)!=(a|0);)h=h+r|0;h=e[w>>2]|0}w=e[d>>2]|0}switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do l=S[w+(h*3|0)+1>>0]|0,d=l&255,C=128-d+(N[w+(h*3|0)+2>>0]|0)&255,D=o+(h*3|0)|0,S[D>>0]=(N[w+(h*3|0)>>0]|0)+128-d,S[D+1>>0]=l,S[D+2>>0]=C,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do C=S[w+(r*3|0)+1>>0]|0,a=C&255,D=128-a+(N[w+(r*3|0)+2>>0]|0)&255,S[o+r>>0]=(N[w+(r*3|0)>>0]|0)+128-a,S[o+(r+l)>>0]=C,S[o+(r+t)>>0]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do a=S[w+(d<<2)+1>>0]|0,D=S[w+(d<<2)+3>>0]|0,E=a&255,C=128-E+(N[w+(d<<2)+2>>0]|0)&255,S[o+d>>0]=(N[w+(d<<2)>>0]|0)+128-E,S[o+(d+l)>>0]=a,S[o+(d+t)>>0]=C,S[o+(d+r)>>0]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function D1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+176|0,F=E+152|0,_=E+16|0,R=E,d=ie(e[(e[t+4>>2]|0)+16>>2]|0,a)|0,C=t+20|0,h=e[C>>2]|0,!d){_=h,jn(t,_,o,a,l),b=E;return}for(;w=Yt[e[(e[r>>2]|0)+32>>2]&63](r,h,d)|0,!!w;)if(h=e[C>>2]|0,(d|0)==(w|0)){D=26;break}else d=d-w|0;if((D|0)==26){jn(t,h,o,a,l),b=E;return}o=_+56|0,C=_+4|0,e[_>>2]=36160,e[o>>2]=36180,m=0,Ae(62,_+56|0,C|0),E=m,m=0,E&1&&(_=j()|0,tt(o),le(_|0)),e[_+128>>2]=0,e[_+132>>2]=-1,e[_>>2]=36200,e[_+56>>2]=36220,m=0,ue(180,C|0),E=m,m=0;do if(E&1)h=j()|0;else{if(e[C>>2]=36236,r=_+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[_+52>>2]=16,e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,m=0,Ae(63,C|0,F|0),E=m,m=0,E&1){h=j()|0,de(F),de(r),wt(C);break}de(F),m=0,h=Ve(28,_|0,49029,57)|0,F=m,m=0,!(F&1)&&(m=0,Ne(36,h|0,0)|0,F=m,m=0,!(F&1))&&(w=Ct(16)|0,m=0,Ae(64,R|0,C|0),F=m,m=0,F&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,R|0),F=m,m=0,F&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(R),d||(R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0))),It(w|0),R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)),R=j()|0,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)}while(!1);_=h,tt(o),le(_|0)}function as(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(d=S[r+(t*3|0)+1>>0]|0,h=d&255,w=h+128+(N[r+(t*3|0)+2>>0]|0)&255,l=o+(t*3|0)|0,S[l>>0]=(N[r+(t*3|0)>>0]|0)+128+h,S[l+1>>0]=d,S[l+2>>0]=w,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do E=S[r+(d+l)>>0]|0,F=E&255,D=F+128+(N[r+(d+h)>>0]|0)&255,w=o+(d*3|0)|0,S[w>>0]=(N[r+d>>0]|0)+128+F,S[w+1>>0]=E,S[w+2>>0]=D,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=N[r+(d+l)>>0]|0,F=o+(d<<2)|0,E=(N[r+d>>0]|0)+128+E&255|E<<8|N[r+(d+h)>>0]<<24|E+128+(N[r+(d+t)>>0]|0)<<16&16711680,S[F>>0]=E,S[F+1>>0]=E>>8,S[F+2>>0]=E>>16,S[F+3>>0]=E>>24,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)){if(d=e[t+16>>2]|0,(a|0)>0)t=o,h=0;else return;for(;F=t+2|0,E=S[t>>0]|0,S[t>>0]=S[F>>0]|0,S[F>>0]=E,h=h+1|0,(h|0)!=(a|0);)t=t+d|0}}function b1(t){t=t|0;var r=0,o=0;e[t>>2]=36712,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=e[t+8>>2]|0,o&&(r=t+12|0,(e[r>>2]|0)!=(o|0)&&(e[r>>2]=o),he(o))}function F1(t){t=t|0;var r=0,o=0;if(e[t>>2]=36712,r=e[t+20>>2]|0,r&&(o=t+24|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function N1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=t+36|0,!(e[l>>2]|0)){l=t+40|0,ls(t,r,e[l>>2]|0,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}h=ie(e[(e[t+4>>2]|0)+16>>2]|0,o)|0,d=t+20|0,ls(t,r,e[d>>2]|0,o,a),t=e[l>>2]|0,(Yt[e[(e[t>>2]|0)+48>>2]&63](t,e[d>>2]|0,h)|0)!=(h|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,3,35648),d=m,m=0,d&1?(d=j()|0,It(l|0),le(d|0)):Qt(l|0,824,96))}function R1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;if(l=e[t+36>>2]|0,l){M1(t,l,r,o,a);return}else{l=t+40|0,Xn(t,e[l>>2]|0,r,o,a),e[l>>2]=(e[l>>2]|0)+(e[(e[t+4>>2]|0)+12>>2]|0);return}}function Xn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0;if(w=t+4|0,h=e[w>>2]|0,!(S[h+32>>0]|0))w=r;else{if(d=t+8|0,o0(e[d>>2]|0,r|0,a*3|0)|0,h=e[w>>2]|0,r=e[h+16>>2]|0,(a|0)>0){for(h=e[d>>2]|0,t=0;C=h+2|0,D=S[h>>0]|0,S[h>>0]=S[C>>0]|0,S[C>>0]=D,t=t+1|0,(t|0)!=(a|0);)h=h+r|0;h=e[w>>2]|0}w=e[d>>2]|0}switch(e[h+16>>2]|0){case 3:{if((e[h+24>>2]|0)==2){if((a|0)>0)h=0;else return;do l=S[w+(h*3|0)+1>>0]|0,C=S[w+(h*3|0)+2>>0]|0,D=o+(h*3|0)|0,S[D>>0]=S[w+(h*3|0)>>0]|0,S[D+1>>0]=l,S[D+2>>0]=C,h=h+1|0;while((h|0)!=(a|0));return}if(h=(l|0)<(a|0)?l:a,(h|0)<=0)return;t=l<<1,r=0;do C=S[w+(r*3|0)+1>>0]|0,D=S[w+(r*3|0)+2>>0]|0,S[o+r>>0]=S[w+(r*3|0)>>0]|0,S[o+(r+l)>>0]=C,S[o+(r+t)>>0]=D,r=r+1|0;while((r|0)!=(h|0));return}case 4:{if((e[h+24>>2]|0)!=1||(h=(l|0)<(a|0)?l:a,(h|0)<=0))return;t=l<<1,r=l*3|0,d=0;do a=S[w+(d<<2)+1>>0]|0,C=S[w+(d<<2)+2>>0]|0,D=S[w+(d<<2)+3>>0]|0,S[o+d>>0]=S[w+(d<<2)>>0]|0,S[o+(d+l)>>0]=a,S[o+(d+t)>>0]=C,S[o+(d+r)>>0]=D,d=d+1|0;while((d|0)!=(h|0));return}default:return}}function M1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+176|0,F=E+152|0,_=E+16|0,R=E,d=ie(e[(e[t+4>>2]|0)+16>>2]|0,a)|0,C=t+20|0,h=e[C>>2]|0,!d){_=h,Xn(t,_,o,a,l),b=E;return}for(;w=Yt[e[(e[r>>2]|0)+32>>2]&63](r,h,d)|0,!!w;)if(h=e[C>>2]|0,(d|0)==(w|0)){D=26;break}else d=d-w|0;if((D|0)==26){Xn(t,h,o,a,l),b=E;return}o=_+56|0,C=_+4|0,e[_>>2]=36160,e[o>>2]=36180,m=0,Ae(62,_+56|0,C|0),E=m,m=0,E&1&&(_=j()|0,tt(o),le(_|0)),e[_+128>>2]=0,e[_+132>>2]=-1,e[_>>2]=36200,e[_+56>>2]=36220,m=0,ue(180,C|0),E=m,m=0;do if(E&1)h=j()|0;else{if(e[C>>2]=36236,r=_+36|0,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,e[r+12>>2]=0,e[_+52>>2]=16,e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,m=0,Ae(63,C|0,F|0),E=m,m=0,E&1){h=j()|0,de(F),de(r),wt(C);break}de(F),m=0,h=Ve(28,_|0,49029,57)|0,F=m,m=0,!(F&1)&&(m=0,Ne(36,h|0,0)|0,F=m,m=0,!(F&1))&&(w=Ct(16)|0,m=0,Ae(64,R|0,C|0),F=m,m=0,F&1?h=j()|0:(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,w|0,3,35648,R|0),F=m,m=0,F&1?d=1:(m=0,ve(6,w|0,824,96),m=0,d=0),h=j()|0,de(R),d||(R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0))),It(w|0),R=h,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)),R=j()|0,e[_>>2]=36200,e[o>>2]=36220,e[C>>2]=36236,de(r),wt(C),tt(o),le(R|0)}while(!1);_=h,tt(o),le(_|0)}function ls(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;C=t+4|0,t=e[C>>2]|0;e:do switch(e[t+16>>2]|0){case 3:{if((e[t+24>>2]|0)==2){if((a|0)>0)t=0;else break e;for(;;)if(d=S[r+(t*3|0)+1>>0]|0,w=S[r+(t*3|0)+2>>0]|0,l=o+(t*3|0)|0,S[l>>0]=S[r+(t*3|0)>>0]|0,S[l+1>>0]=d,S[l+2>>0]=w,t=t+1|0,(t|0)==(a|0))break e}if(t=(a|0)<(l|0)?a:l,(t|0)>0){h=l<<1,d=0;do E=S[r+(d+l)>>0]|0,D=S[r+(d+h)>>0]|0,w=o+(d*3|0)|0,S[w>>0]=S[r+d>>0]|0,S[w+1>>0]=E,S[w+2>>0]=D,d=d+1|0;while((d|0)!=(t|0))}break}case 4:{if((e[t+24>>2]|0)==1&&(w=(a|0)<(l|0)?a:l,(w|0)>0)){t=l<<1,h=l*3|0,d=0;do E=o+(d<<2)|0,D=N[r+(d+l)>>0]<<8|N[r+d>>0]|N[r+(d+t)>>0]<<16|N[r+(d+h)>>0]<<24,S[E>>0]=D,S[E+1>>0]=D>>8,S[E+2>>0]=D>>16,S[E+3>>0]=D>>24,d=d+1|0;while((d|0)!=(w|0))}break}default:}while(!1);if(t=e[C>>2]|0,!!(S[t+32>>0]|0)){if(d=e[t+16>>2]|0,(a|0)>0)t=o,h=0;else return;for(;E=t+2|0,D=S[t>>0]|0,S[t>>0]=S[E>>0]|0,S[E>>0]=D,h=h+1|0,(h|0)!=(a|0);)t=t+d|0}}function us(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;K=b,b=b+32|0,$=K+12|0,H=K,R=t+180|0,_=(e[R>>2]|0)+4|0,(e[t+32>>2]|0)==1?z=e[t+24>>2]|0:z=1,r=ie(z<<1,_)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;e:do if(r){if(r>>>0>1431655765&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r*3|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,e[$+8>>2]=o+(r*3|0);;)if(S[o>>0]=0,S[o+1>>0]=0,S[o+2>>0]=0,o=(e[P>>2]|0)+3|0,e[P>>2]=o,r=r+-1|0,!r)break e}a=j()|0,r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!z)h=19;else{if(z>>>0>1073741823&&(m=0,ue(178,H|0),F=m,m=0,F&1)||(h=17),(h|0)==17&&(a=z<<2,m=0,l=ge(67,a|0)|0,F=m,m=0,!(F&1))){e[H>>2]=l,h=l+(z<<2)|0,e[H+8>>2]=h,Jt(l|0,0,a|0)|0,e[G>>2]=h,h=19;break}a=j()|0,r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){l=t+12|0;e:do if((e[l>>2]|0)>0){h=t+4604|0,d=(ie(z,_)|0)+1|0,w=t+4608|0,C=t+92|0,D=(z|0)>0,E=t+4600|0,F=0;t:for(;;){if(a=e[$>>2]|0,r=a+3|0,e[h>>2]=r,o=a+(d*3|0)|0,e[w>>2]=o,F&1?(e[h>>2]=o,e[w>>2]=r,r=1):r=d,o=e[C>>2]|0,m=0,$e(e[(e[o>>2]|0)+12>>2]|0,o|0,a+(r*3|0)|0,e[R>>2]|0,_|0),a=m,m=0,a&1){h=29;break}if(D){r=e[H>>2]|0,o=e[h>>2]|0,a=0;do{if(e[E>>2]=e[r+(a<<2)>>2],L=e[R>>2]|0,r=o+(L*3|0)|0,o=o+((L+-1|0)*3|0)|0,S[r>>0]=S[o>>0]|0,S[r+1>>0]=S[o+1>>0]|0,S[r+2>>0]=S[o+2>>0]|0,r=e[h>>2]|0,o=(e[w>>2]|0)+-3|0,S[o>>0]=S[r>>0]|0,S[o+1>>0]=S[r+1>>0]|0,S[o+2>>0]=S[r+2>>0]|0,m=0,Ae(70,t|0,0),o=m,m=0,o&1){h=28;break t}r=e[H>>2]|0,e[r+(a<<2)>>2]=e[E>>2],o=(e[h>>2]|0)+(_*3|0)|0,e[h>>2]=o,e[w>>2]=(e[w>>2]|0)+(_*3|0),a=a+1|0}while((a|0)<(z|0))}if(F=F+1|0,(F|0)>=(e[l>>2]|0)){h=41;break e}}if((h|0)==28){a=j()|0;break}else if((h|0)==29){a=j()|0;break}}else h=41;while(!1);do if((h|0)==41){if(m=0,ue(182,t|0),L=m,m=0,L&1){a=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),b=K;return}while(!1);r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}function _1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0;if(ae=t+180|0,!((e[ae>>2]|0)<=0))for(re=t+4608|0,ce=t+4604|0,Ee=t+4612|0,ne=0;P=ne+-1|0,h=e[re>>2]|0,d=e[ce>>2]|0,r=ne+1|0,l=N[d+(ne*3|0)>>0]|0,J=e[Ee>>2]|0,w=N[d+(P*3|0)>>0]|0,C=l-w|0,D=N[h+(P*3|0)>>0]|0,E=w-D|0,F=((((S[J+((N[d+(r*3|0)>>0]|0)-l)>>0]|0)*9|0)+(S[J+C>>0]|0)|0)*9|0)+(S[J+E>>0]|0)|0,a=N[d+(ne*3|0)+1>>0]|0,R=N[d+(P*3|0)+1>>0]|0,_=a-R|0,z=N[h+(P*3|0)+1>>0]|0,H=R-z|0,K=((((S[J+((N[d+(r*3|0)+1>>0]|0)-a)>>0]|0)*9|0)+(S[J+_>>0]|0)|0)*9|0)+(S[J+H>>0]|0)|0,o=N[d+(ne*3|0)+2>>0]|0,G=N[d+(P*3|0)+2>>0]|0,$=o-G|0,P=N[h+(P*3|0)+2>>0]|0,L=G-P|0,J=((((S[J+((N[d+(r*3|0)+2>>0]|0)-o)>>0]|0)*9|0)+(S[J+$>>0]|0)|0)*9|0)+(S[J+L>>0]|0)|0,K|F|J?(d=N[h+(ne*3|0)>>0]|0,h=l-D>>31,(h^E|0)>=0&&((h^C|0)<0?l=D:l=D-w+l|0),d=Zn(t,F,d,l,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+1>>0]|0,l=a-z>>31,(l^H|0)>=0&&((l^_|0)<0?a=z:a=z-R+a|0),l=Zn(t,K,h,a,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+2>>0]|0,a=o-P>>31,(a^L|0)>=0&&((a^$|0)<0?o=P:o=P-G+o|0),J=Zn(t,J,h,o,0)|0,ne=(e[re>>2]|0)+(ne*3|0)|0,S[ne>>0]=d,S[ne+1>>0]=l,S[ne+2>>0]=J):r=(P1(t,ne,0)|0)+ne|0,(r|0)<(e[ae>>2]|0);)ne=r}function P1(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0;for(ae=b,b=b+32|0,ne=ae+15|0,R=ae+12|0,F=ae+9|0,_=ae+6|0,$=ae+3|0,P=ae,L=(e[t+180>>2]|0)-r|0,J=e[t+4608>>2]|0,z=e[t+4604>>2]|0,G=J+((r+-1|0)*3|0)|0,H=S[G>>0]|0,K=S[G+1>>0]|0,G=S[G+2>>0]|0,o=H&255,a=t+144|0,l=K&255,h=G&255,E=0;d=J+((E+r|0)*3|0)|0,w=d+1|0,C=d+2|0,re=(N[d>>0]|0)-o|0,D=e[a>>2]|0,!((((re|0)>-1?re:0-re|0)|0)>(D|0)||(re=(N[w>>0]|0)-l|0,(((re|0)>-1?re:0-re|0)|0)>(D|0))||(re=(N[C>>0]|0)-h|0,(((re|0)>-1?re:0-re|0)|0)>(D|0)));)if(S[d>>0]=H,S[w>>0]=K,S[C>>0]=G,E=E+1|0,(E|0)==(L|0)){E=L;break}if(l=(E|0)==(L|0),h=t+4600|0,a=e[36476+(e[h>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[h>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[h>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>0]=S[re>>0]|0,S[$+1>>0]=S[re+1>>0]|0,S[$+2>>0]=S[re+2>>0]|0,S[P>>0]=H,S[P+1>>0]=K,S[P+2>>0]=G,r=z+(r*3|0)|0,S[F>>0]=S[$>>0]|0,S[F+1>>0]=S[$+1>>0]|0,S[F+2>>0]=S[$+2>>0]|0,S[R>>0]=S[P>>0]|0,S[R+1>>0]=S[P+1>>0]|0,S[R+2>>0]=S[P+2>>0]|0,S[ne>>0]=S[r>>0]|0,S[ne+1>>0]=S[r+1>>0]|0,S[ne+2>>0]=S[r+2>>0]|0,L1(_,t,F,R,ne),S[re>>0]=S[_>>0]|0,S[re+1>>0]=S[_+1>>0]|0,S[re+2>>0]=S[_+2>>0]|0,re=e[h>>2]|0,e[h>>2]=(re|0)<1?0:re+-1|0,re=E+1|0,b=ae,re|0)}function Zn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(H=r>>31,h=(H^r)-H|0,_=t+196+(h*12|0)+10|0,d=k[_>>1]|0,R=t+196+(h*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(r=5;(d<>1]^H)-H+a|0,z=t+136|0,a=e[z>>2]|0,(l&a|0)==(l|0)?D=l:D=a&~(l>>31),l=(o-D^H)-H|0,C=t+144|0,a=e[C>>2]|0,(l|0)>0?l=(l+a|0)/(a<<1|1|0)|0:l=(l-a|0)/(a<<1|1|0)|0,F=t+140|0,w=e[F>>2]|0,o=((l|0)<0?w:0)+l|0,w=o-((o|0)<((w+1|0)/2|0|0)?0:w)|0,h=t+196+(h*12|0)+4|0,a|r?l=0:l=(e[h>>2]<<1)+-1+d>>31,a=l^w,cs(t,r,a>>30^a<<1,e[t+156>>2]|0),a=e[t+160>>2]|0,r=(e[R>>2]|0)+((w|0)>-1?w:0-w|0)|0,l=(e[h>>2]|0)+(ie(e[C>>2]<<1|1,w)|0)|0,o=k[_>>1]|0,(o|0)==(a|0)&&(r=r>>1,l=l>>1,o=a>>1),e[R>>2]=r,a=o+1|0,k[_>>1]=a,r=a+l|0,(r|0)>=1?(l|0)>0&&(l=l-a|0,_=k[E>>1]|0,k[E>>1]=(_<<16>>16<127&1)+(_&65535),l=(l|0)>0?0:l):(l=k[E>>1]|0,k[E>>1]=(l&65535)-(l<<16>>16>-128&1),l=(r|0)>(~o|0)?r:0-o|0),e[h>>2]=l,a=e[C>>2]|0,o=a<<1|1,r=(ie(o,(w^H)-H|0)|0)+D|0,(r|0)>=(0-a|0)?(l=e[z>>2]|0,(l+a|0)<(r|0)&&(r=r-(ie(e[F>>2]|0,o)|0)|0)):(r=(ie(e[F>>2]|0,o)|0)+r|0,l=e[z>>2]|0),(r&l|0)==(r|0)?(H=r,H=H&255,H|0):(H=l&~(r>>31),H=H&255,H|0)}function cs(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=o>>r,h=t+148|0,d=a-(e[h>>2]|0)|0,(l|0)<(d+-1|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-31-(e[h>>2]|0)|0)):_t(t,1,d),r=e[h>>2]|0,_t(t,(1<>0]|0,R=F-(N[a>>0]|0)>>31|1,h=ie(R,(N[o>>0]|0)-F|0)|0,D=r+144|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,P=r+140|0,C=e[P>>2]|0,w=((h|0)<0?C:0)+h|0,C=w-((w|0)<((C+1|0)/2|0|0)?0:C)|0,w=r+4576|0,Jn(r,w,C),K=N[l+1>>0]|0,G=K-(N[a+1>>0]|0)>>31|1,h=ie(G,(N[o+1>>0]|0)-K|0)|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,_=e[P>>2]|0,$=((h|0)<0?_:0)+h|0,_=$-(($|0)<((_+1|0)/2|0|0)?0:_)|0,Jn(r,w,_),$=N[l+2>>0]|0,H=$-(N[a+2>>0]|0)>>31|1,h=ie(H,(N[o+2>>0]|0)-$|0)|0,d=e[D>>2]|0,(h|0)>0?h=(h+d|0)/(d<<1|1|0)|0:h=(h-d|0)/(d<<1|1|0)|0,E=e[P>>2]|0,h=((h|0)<0?E:0)+h|0,E=h-((h|0)<((E+1|0)/2|0|0)?0:E)|0,Jn(r,w,E),w=e[D>>2]|0,D=w<<1|1,h=(ie(ie(D,C)|0,R)|0)+F|0,o=0-w|0,(h|0)>=(o|0)?(d=e[z>>2]|0,(d+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0),a=d):(h=(ie(e[P>>2]|0,D)|0)+h|0,a=e[z>>2]|0),(h&a|0)!=(h|0)&&(h=a&~(h>>31)),l=h&255,h=(ie(ie(D,_)|0,G)|0)+K|0,(h|0)>=(o|0)?(a+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0):h=(ie(e[P>>2]|0,D)|0)+h|0,(h&a|0)!=(h|0)&&(h=a&~(h>>31)),d=h&255,h=(ie(ie(D,E)|0,H)|0)+$|0,(h|0)>=(o|0)?(a+w|0)<(h|0)&&(h=h-(ie(e[P>>2]|0,D)|0)|0):h=(ie(e[P>>2]|0,D)|0)+h|0,(h&a|0)==(h|0)){P=h,P=P&255,S[t>>0]=l,$=t+1|0,S[$>>0]=d,t=t+2|0,S[t>>0]=P;return}P=a&~(h>>31),P=P&255,S[t>>0]=l,$=t+1|0,S[$>>0]=d,t=t+2|0,S[t>>0]=P}function Jn(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,cs(t,l,a,(e[t+156>>2]|0)+-1-(e[36476+(e[t+4600>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function O1(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+144|0;e:do if(e[F>>2]|0)r=t+152|0;else if(o=e[t+136>>2]|0,r=t+152|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+184>>2]|0))&&(e[a+8>>2]|0)==(e[t+188>>2]|0)&&(e[a+12>>2]|0)==(e[t+192>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4612>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4612>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4612>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4612>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4616|0,a=E<<1,l=t+4620|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4612|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+192|0,C=t+188|0,d=t+184|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function $1(t){t=t|0;var r=0,o=0;e[t>>2]=35996,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function B1(t){t=t|0;var r=0,o=0;if(e[t>>2]=35996,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function V1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,65535,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+160>>2]=d|0?d:e[w+4>>2]|0,e[t+164>>2]=h,e[t+168>>2]=a,Q1(t),a=0;do e[t+172+(a*12|0)>>2]=1024,e[t+172+(a*12|0)+4>>2]=0,k[t+172+(a*12|0)+8>>1]=0,k[t+172+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4552>>2]=1024,e[t+4556>>2]=0,S[t+4560>>0]=w,S[t+4561>>0]=1,S[t+4562>>0]=0,e[t+4564>>2]=1024,e[t+4568>>2]=1,S[t+4572>>0]=w,S[t+4573>>0]=1,S[t+4574>>0]=0,e[t+4576>>2]=0,b=l}function U1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4600)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35772,l=r+132|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+148>>2]=e[a>>2],e[r+152>>2]=0,e[r+156>>2]=0,e[r+160>>2]=0,l=r+4544|0,a=r+164|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4556|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4568|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,fs(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],fs(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function z1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function fs(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;G=b,b=b+32|0,P=G+12|0,K=G,_=t+156|0,z=(e[_>>2]|0)+4|0,(e[t+32>>2]|0)==1?H=e[t+24>>2]|0:H=1,r=ie(H<<1,z)|0,e[P>>2]=0,L=P+4|0,e[L>>2]=0,e[P+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,P|0),$=m,m=0,$&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,$=m,m=0,!($&1))){e[P>>2]=a,$=a+(r<<1)|0,e[P+8>>2]=$,Jt(a|0,0,o|0)|0,e[L>>2]=$;break}a=j()|0,r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[K>>2]=0,$=K+4|0,e[$>>2]=0,e[K+8>>2]=0;do if(!H)d=18;else{if(H>>>0>1073741823&&(m=0,ue(178,K|0),R=m,m=0,R&1)||(d=16),(d|0)==16&&(l=H<<2,m=0,h=ge(67,l|0)|0,R=m,m=0,!(R&1))){e[K>>2]=h,d=h+(H<<2)|0,e[K+8>>2]=d,Jt(h|0,0,l|0)|0,e[$>>2]=d,d=18;break}a=j()|0,r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+12|0;e:do if((e[h>>2]|0)>0){d=t+4580|0,w=(ie(H,z)|0)+1|0,C=t+4584|0,D=t+92|0,E=(H|0)>0,F=t+4576|0,R=0;t:for(;;){if(o=e[P>>2]|0,r=o+2|0,e[d>>2]=r,o=o+(w<<1)|0,e[C>>2]=o,R&1?(e[d>>2]=o,e[C>>2]=r):r=o,l=e[D>>2]|0,m=0,$e(e[(e[l>>2]|0)+12>>2]|0,l|0,r|0,e[_>>2]|0,z|0),l=m,m=0,l&1){d=28;break}if(E){r=e[d>>2]|0,o=e[C>>2]|0,a=e[K>>2]|0,l=0;do{if(e[F>>2]=e[a+(l<<2)>>2],a=e[_>>2]|0,k[r+(a<<1)>>1]=k[r+(a+-1<<1)>>1]|0,k[o+-2>>1]=k[r>>1]|0,m=0,Ae(71,t|0,0),a=m,m=0,a&1){d=27;break t}a=e[K>>2]|0,e[a+(l<<2)>>2]=e[F>>2],r=(e[d>>2]|0)+(z<<1)|0,e[d>>2]=r,o=(e[C>>2]|0)+(z<<1)|0,e[C>>2]=o,l=l+1|0}while((l|0)<(H|0))}if(R=R+1|0,(R|0)>=(e[h>>2]|0)){d=40;break e}}if((d|0)==27){a=j()|0;break}else if((d|0)==28){a=j()|0;break}}else d=40;while(!1);do if((d|0)==40){if(m=0,ue(182,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[K>>2]|0,o=r,r&&(a=e[$>>2]|0,(a|0)!=(r|0)&&(e[$>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[P>>2]|0,!r){b=G;return}o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=G;return}while(!1);r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function G1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=t+4580|0,r=e[F>>2]|0,z=t+156|0,!((e[z>>2]|0)<=0))for(R=t+4584|0,_=t+4588|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=q1(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(W1(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[z>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function q1(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(z=r>>31,C=(z^r)-z|0,_=t+172+(C*12|0)+10|0,d=k[_>>1]|0,R=t+172+(C*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(h=5;(d<>1]^z)-z+a|0,(l&65535|0)==(l|0)?E=l:E=l>>31&65535^65535,w=(o-E^z)-z<<16,D=w>>16,h?l=0:l=(e[t+172+(C*12|0)+4>>2]<<1)+-1+d>>31,a=l^D,a=a>>30^a<<1,l=a>>h,(l|0)<47?((l|0)>30&&(d=(l|0)/2|0,_t(t,0,d),l=l-d|0),_t(t,1,l+1|0),_t(t,a&(1<>1]|0,l=d<<16>>16==64,h=l&1,o=(e[a>>2]|0)+D>>h,d=l?32:d<<16>>16,e[R>>2]=(e[R>>2]|0)+((w|0)>-65536?D:0-D|0)>>h,h=d+1|0,k[_>>1]=h,l=h+o|0,(l|0)<1?(_=k[F>>1]|0,k[F>>1]=(_&65535)-(_<<16>>16>-128&1),_=(l|0)>(~d|0)?l:0-d|0,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&65535,r|0):(o|0)<=0?(_=o,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&65535,r|0):(_=o-h|0,R=k[F>>1]|0,k[F>>1]=(R<<16>>16<127&1)+(R&65535),_=(_|0)>0?0:_,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&65535,r|0)}function W1(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(d=(e[t+156>>2]|0)-r|0,w=e[t+4584>>2]|0,D=e[t+4580>>2]|0,l=k[w+(r+-1<<1)>>1]|0,a=0;;){if(o=w+(a+r<<1)|0,(k[o>>1]|0)!=l<<16>>16){E=a;break}if(k[o>>1]=l,a=a+1|0,(a|0)==(d|0)){E=d;break}}if(h=l&65535,l=(E|0)==(d|0),C=t+4576|0,a=e[36476+(e[C>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[C>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[C>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>1]|0,o=M[D+(o<<1)>>1]|0,D=h-o|0,(((D|0)>-1?D:0-D|0)|0)<1?(o=a-h<<16>>16,hs(t,t+4564|0,o),o=o+h|0):(D=o-h>>31|1,r=(ie(a-o<<16,D)|0)>>16,hs(t,t+4552|0,r),o=(ie(r,D)|0)+o|0),k[l>>1]=o,t=e[C>>2]|0,e[C>>2]=(t|0)<1?0:t+-1|0,t=E+1|0,t|0)}function hs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,H1(t,l,a,63-(e[36476+(e[t+4576>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function H1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=o>>r,h=a+-16|0,(l|0)<(a+-17|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-47|0)):_t(t,1,h),_t(t,o+65535&65535,16)}function Q1(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,65535,0),C=t+160|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+164>>2]|0)&&(e[w+12>>2]|0)==(e[t+168>>2]|0)){C=e[8909]|0,e[t+4588>>2]=C+(((e[8910]|0)-C|0)>>>1),b=D;return}for(o=t+4592|0,a=t+4596|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=131072?h>>>0>131072&&(d=r+131072|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,131072-h|0),r=e[o>>2]|0),w=t+4588|0,e[w>>2]=r+65536,d=t+168|0,l=t+164|0,h=-65536;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==65536)break}b=D}function K1(t){t=t|0;var r=0,o=0;e[t>>2]=35968,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Y1(t){t=t|0;var r=0,o=0;if(e[t>>2]=35968,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function j1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,4095,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+160>>2]=d|0?d:e[w+4>>2]|0,e[t+164>>2]=h,e[t+168>>2]=a,n2(t),a=0;do e[t+172+(a*12|0)>>2]=64,e[t+172+(a*12|0)+4>>2]=0,k[t+172+(a*12|0)+8>>1]=0,k[t+172+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4552>>2]=64,e[t+4556>>2]=0,S[t+4560>>0]=w,S[t+4561>>0]=1,S[t+4562>>0]=0,e[t+4564>>2]=64,e[t+4568>>2]=1,S[t+4572>>0]=w,S[t+4573>>0]=1,S[t+4574>>0]=0,e[t+4576>>2]=0,b=l}function X1(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4600)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35744,l=r+132|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+148>>2]=e[a>>2],e[r+152>>2]=0,e[r+156>>2]=0,e[r+160>>2]=0,l=r+4544|0,a=r+164|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4556|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4568|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,ds(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],ds(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function Z1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function ds(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;G=b,b=b+32|0,P=G+12|0,K=G,_=t+156|0,z=(e[_>>2]|0)+4|0,(e[t+32>>2]|0)==1?H=e[t+24>>2]|0:H=1,r=ie(H<<1,z)|0,e[P>>2]=0,L=P+4|0,e[L>>2]=0,e[P+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,P|0),$=m,m=0,$&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,$=m,m=0,!($&1))){e[P>>2]=a,$=a+(r<<1)|0,e[P+8>>2]=$,Jt(a|0,0,o|0)|0,e[L>>2]=$;break}a=j()|0,r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[K>>2]=0,$=K+4|0,e[$>>2]=0,e[K+8>>2]=0;do if(!H)d=18;else{if(H>>>0>1073741823&&(m=0,ue(178,K|0),R=m,m=0,R&1)||(d=16),(d|0)==16&&(l=H<<2,m=0,h=ge(67,l|0)|0,R=m,m=0,!(R&1))){e[K>>2]=h,d=h+(H<<2)|0,e[K+8>>2]=d,Jt(h|0,0,l|0)|0,e[$>>2]=d,d=18;break}a=j()|0,r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+12|0;e:do if((e[h>>2]|0)>0){d=t+4580|0,w=(ie(H,z)|0)+1|0,C=t+4584|0,D=t+92|0,E=(H|0)>0,F=t+4576|0,R=0;t:for(;;){if(o=e[P>>2]|0,r=o+2|0,e[d>>2]=r,o=o+(w<<1)|0,e[C>>2]=o,R&1?(e[d>>2]=o,e[C>>2]=r):r=o,l=e[D>>2]|0,m=0,$e(e[(e[l>>2]|0)+12>>2]|0,l|0,r|0,e[_>>2]|0,z|0),l=m,m=0,l&1){d=28;break}if(E){r=e[d>>2]|0,o=e[C>>2]|0,a=e[K>>2]|0,l=0;do{if(e[F>>2]=e[a+(l<<2)>>2],a=e[_>>2]|0,k[r+(a<<1)>>1]=k[r+(a+-1<<1)>>1]|0,k[o+-2>>1]=k[r>>1]|0,m=0,Ae(72,t|0,0),a=m,m=0,a&1){d=27;break t}a=e[K>>2]|0,e[a+(l<<2)>>2]=e[F>>2],r=(e[d>>2]|0)+(z<<1)|0,e[d>>2]=r,o=(e[C>>2]|0)+(z<<1)|0,e[C>>2]=o,l=l+1|0}while((l|0)<(H|0))}if(R=R+1|0,(R|0)>=(e[h>>2]|0)){d=40;break e}}if((d|0)==27){a=j()|0;break}else if((d|0)==28){a=j()|0;break}}else d=40;while(!1);do if((d|0)==40){if(m=0,ue(182,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[K>>2]|0,o=r,r&&(a=e[$>>2]|0,(a|0)!=(r|0)&&(e[$>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[P>>2]|0,!r){b=G;return}o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=G;return}while(!1);r=e[K>>2]|0,o=r,r&&(l=e[$>>2]|0,(l|0)!=(r|0)&&(e[$>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[P>>2]|0,r||le(a|0),o=e[L>>2]|0,(o|0)!=(r|0)&&(e[L>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function J1(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=t+4580|0,r=e[F>>2]|0,z=t+156|0,!((e[z>>2]|0)<=0))for(R=t+4584|0,_=t+4588|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=e2(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(t2(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[z>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function e2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(z=r>>31,C=(z^r)-z|0,_=t+172+(C*12|0)+10|0,d=k[_>>1]|0,R=t+172+(C*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(h=5;(d<>1]^z)-z+a|0,(l&4095|0)==(l|0)?E=l:E=l>>31&4095^4095,w=(o-E^z)-z<<20,D=w>>20,h?l=0:l=(e[t+172+(C*12|0)+4>>2]<<1)+-1+d>>31,a=l^D,a=a>>30^a<<1,l=a>>h,(l|0)<35?((l|0)>30&&(d=(l|0)/2|0,_t(t,0,d),l=l-d|0),_t(t,1,l+1|0),_t(t,a&(1<>1]|0,l=d<<16>>16==64,h=l&1,o=(e[a>>2]|0)+D>>h,d=l?32:d<<16>>16,e[R>>2]=(e[R>>2]|0)+((w|0)>-1048576?D:0-D|0)>>h,h=d+1|0,k[_>>1]=h,l=h+o|0,(l|0)<1?(_=k[F>>1]|0,k[F>>1]=(_&65535)-(_<<16>>16>-128&1),_=(l|0)>(~d|0)?l:0-d|0,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&4095,r=r&65535,r|0):(o|0)<=0?(_=o,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&4095,r=r&65535,r|0):(_=o-h|0,R=k[F>>1]|0,k[F>>1]=(R<<16>>16<127&1)+(R&65535),_=(_|0)>0?0:_,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&4095,r=r&65535,r|0)}function t2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(d=(e[t+156>>2]|0)-r|0,w=e[t+4584>>2]|0,D=e[t+4580>>2]|0,l=k[w+(r+-1<<1)>>1]|0,a=0;;){if(o=w+(a+r<<1)|0,(k[o>>1]|0)!=l<<16>>16){E=a;break}if(k[o>>1]=l,a=a+1|0,(a|0)==(d|0)){E=d;break}}if(h=l&65535,l=(E|0)==(d|0),C=t+4576|0,a=e[36476+(e[C>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[C>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[C>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>1]|0,o=M[D+(o<<1)>>1]|0,D=h-o|0,(((D|0)>-1?D:0-D|0)|0)<1?(o=a-h<<20>>20,ps(t,t+4564|0,o),o=o+h|0):(D=o-h>>31|1,r=(ie(a-o<<20,D)|0)>>20,ps(t,t+4552|0,r),o=(ie(r,D)|0)+o|0),k[l>>1]=o&4095,t=e[C>>2]|0,e[C>>2]=(t|0)<1?0:t+-1|0,t=E+1|0,t|0)}function ps(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,i2(t,l,a,47-(e[36476+(e[t+4576>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function i2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=o>>r,h=a+-12|0,(l|0)<(a+-13|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-43|0)):_t(t,1,h),_t(t,o+4095&4095,12)}function n2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,4095,0),C=t+160|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+164>>2]|0)&&(e[w+12>>2]|0)==(e[t+168>>2]|0)){C=e[8906]|0,e[t+4588>>2]=C+(((e[8907]|0)-C|0)>>>1),b=D;return}for(o=t+4592|0,a=t+4596|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=8192?h>>>0>8192&&(d=r+8192|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,8192-h|0),r=e[o>>2]|0),w=t+4588|0,e[w>>2]=r+4096,d=t+168|0,l=t+164|0,h=-4096;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==4096)break}b=D}function r2(t){t=t|0;var r=0,o=0;e[t>>2]=35940,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function s2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35940,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function o2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,255,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+160>>2]=d|0?d:e[w+4>>2]|0,e[t+164>>2]=h,e[t+168>>2]=a,p2(t),a=0;do e[t+172+(a*12|0)>>2]=4,e[t+172+(a*12|0)+4>>2]=0,k[t+172+(a*12|0)+8>>1]=0,k[t+172+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4552>>2]=4,e[t+4556>>2]=0,S[t+4560>>0]=w,S[t+4561>>0]=1,S[t+4562>>0]=0,e[t+4564>>2]=4,e[t+4568>>2]=1,S[t+4572>>0]=w,S[t+4573>>0]=1,S[t+4574>>0]=0,e[t+4576>>2]=0,b=l}function l2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4600)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35716,l=r+132|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+148>>2]=e[a>>2],e[r+152>>2]=0,e[r+156>>2]=0,e[r+160>>2]=0,l=r+4544|0,a=r+164|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4556|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4568|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,ms(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],ms(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function u2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0)}function ms(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0;K=b,b=b+32|0,$=K+12|0,H=K,R=t+156|0,_=(e[R>>2]|0)+4|0,(e[t+32>>2]|0)==1?z=e[t+24>>2]|0:z=1,r=ie(z<<1,_)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;e:do if(r){if((r|0)<0&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,e[$+8>>2]=o+r;;)if(S[o>>0]=0,o=(e[P>>2]|0)+1|0,e[P>>2]=o,r=r+-1|0,!r)break e}o=j()|0,r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!z)h=19;else{if(z>>>0>1073741823&&(m=0,ue(178,H|0),F=m,m=0,F&1)||(h=17),(h|0)==17&&(a=z<<2,m=0,l=ge(67,a|0)|0,F=m,m=0,!(F&1))){e[H>>2]=l,h=l+(z<<2)|0,e[H+8>>2]=h,Jt(l|0,0,a|0)|0,e[G>>2]=h,h=19;break}o=j()|0,r=e[H>>2]|0,a=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){l=t+12|0;e:do if((e[l>>2]|0)>0){h=t+4580|0,d=(ie(z,_)|0)+1|0,w=t+4584|0,C=t+92|0,D=(z|0)>0,E=t+4576|0,F=0;t:for(;;){if(o=e[$>>2]|0,r=o+1|0,e[h>>2]=r,o=o+d|0,e[w>>2]=o,F&1?(e[h>>2]=o,e[w>>2]=r):r=o,a=e[C>>2]|0,m=0,$e(e[(e[a>>2]|0)+12>>2]|0,a|0,r|0,e[R>>2]|0,_|0),a=m,m=0,a&1){h=29;break}if(D){r=e[h>>2]|0,o=e[H>>2]|0,a=0;do{if(e[E>>2]=e[o+(a<<2)>>2],o=e[R>>2]|0,S[r+o>>0]=S[r+(o+-1)>>0]|0,S[(e[w>>2]|0)+-1>>0]=S[e[h>>2]>>0]|0,m=0,Ae(73,t|0,0),o=m,m=0,o&1){h=28;break t}o=e[H>>2]|0,e[o+(a<<2)>>2]=e[E>>2],r=(e[h>>2]|0)+_|0,e[h>>2]=r,e[w>>2]=(e[w>>2]|0)+_,a=a+1|0}while((a|0)<(z|0))}if(F=F+1|0,(F|0)>=(e[l>>2]|0)){h=41;break e}}if((h|0)==28){o=j()|0;break}else if((h|0)==29){o=j()|0;break}}else h=41;while(!1);do if((h|0)==41){if(m=0,ue(182,t|0),t=m,m=0,t&1){o=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),b=K;return}while(!1);r=e[H>>2]|0,a=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0)}function c2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=t+4580|0,r=e[F>>2]|0,z=t+156|0,!((e[z>>2]|0)<=0))for(R=t+4584|0,_=t+4588|0,l=r,h=N[r+-1>>0]|0,r=N[r>>0]|0,E=0;D=e[R>>2]|0,C=N[D+(E+-1)>>0]|0,a=E+1|0,o=N[l+a>>0]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=f2(t,w,N[D+E>>0]|0,l,0)|0,S[(e[R>>2]|0)+E>>0]=D):(a=(h2(t,E,0)|0)+E|0,o=e[F>>2]|0,r=N[o+(a+-1)>>0]|0,o=N[o+a>>0]|0),!((a|0)>=(e[z>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function f2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(z=r>>31,C=(z^r)-z|0,_=t+172+(C*12|0)+10|0,d=k[_>>1]|0,R=t+172+(C*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(h=5;(d<>1]^z)-z+a|0,(l&255|0)==(l|0)?E=l:E=l>>31&255^255,w=(o-E^z)-z<<24,D=w>>24,h?l=0:l=(e[t+172+(C*12|0)+4>>2]<<1)+-1+d>>31,l=l^D,l=l>>30^l<<1,a=l>>h,(a|0)<23?(_t(t,1,a+1|0),_t(t,l&(1<>1]|0,l=d<<16>>16==64,h=l&1,o=(e[a>>2]|0)+D>>h,d=l?32:d<<16>>16,e[R>>2]=(e[R>>2]|0)+((w|0)>-16777216?D:0-D|0)>>h,h=d+1|0,k[_>>1]=h,l=h+o|0,(l|0)<1?(_=k[F>>1]|0,k[F>>1]=(_&65535)-(_<<16>>16>-128&1),_=(l|0)>(~d|0)?l:0-d|0,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&255,r|0):(o|0)<=0?(_=o,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&255,r|0):(_=o-h|0,R=k[F>>1]|0,k[F>>1]=(R<<16>>16<127&1)+(R&65535),_=(_|0)>0?0:_,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&255,r|0)}function h2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(d=(e[t+156>>2]|0)-r|0,w=e[t+4584>>2]|0,D=e[t+4580>>2]|0,l=S[w+(r+-1)>>0]|0,a=0;;){if(o=w+(a+r)|0,(S[o>>0]|0)!=l<<24>>24){E=a;break}if(S[o>>0]=l,a=a+1|0,(a|0)==(d|0)){E=d;break}}if(h=l&255,l=(E|0)==(d|0),C=t+4576|0,a=e[36476+(e[C>>2]<<2)>>2]|0,(1<(E|0))o=E;else{o=E;do _t(t,1,1),a=e[C>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[C>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>0]|0,o=N[D+o>>0]|0,D=h-o|0,(((D|0)>-1?D:0-D|0)|0)<1?(o=a-h<<24>>24,gs(t,t+4564|0,o),o=o+h|0):(D=o-h>>31|1,r=(ie(a-o<<24,D)|0)>>24,gs(t,t+4552|0,r),o=(ie(r,D)|0)+o|0),S[l>>0]=o,t=e[C>>2]|0,e[C>>2]=(t|0)<1?0:t+-1|0,t=E+1|0,t|0)}function gs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,d2(t,l,a,31-(e[36476+(e[t+4576>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function d2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=o>>r,h=a+-8|0,(l|0)<(a+-9|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-39|0)):_t(t,1,h),_t(t,o+255&255,8)}function p2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,255,0),C=t+160|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+164>>2]|0)&&(e[w+12>>2]|0)==(e[t+168>>2]|0)){C=e[8900]|0,e[t+4588>>2]=C+(((e[8901]|0)-C|0)>>>1),b=D;return}for(o=t+4592|0,a=t+4596|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=512?h>>>0>512&&(d=r+512|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,512-h|0),r=e[o>>2]|0),w=t+4588|0,e[w>>2]=r+256,d=t+168|0,l=t+164|0,h=-256;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==256)break}b=D}function m2(t){t=t|0;var r=0,o=0;e[t>>2]=35912,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function g2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35912,r=e[t+4592>>2]|0,r&&(o=t+4596|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function S2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,255,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+160>>2]=d|0?d:e[w+4>>2]|0,e[t+164>>2]=h,e[t+168>>2]=a,C2(t),a=0;do e[t+172+(a*12|0)>>2]=4,e[t+172+(a*12|0)+4>>2]=0,k[t+172+(a*12|0)+8>>1]=0,k[t+172+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4552>>2]=4,e[t+4556>>2]=0,S[t+4560>>0]=w,S[t+4561>>0]=1,S[t+4562>>0]=0,e[t+4564>>2]=4,e[t+4568>>2]=1,S[t+4572>>0]=w,S[t+4573>>0]=1,S[t+4574>>0]=0,e[t+4576>>2]=0,b=l}function A2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4600)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35688,l=r+132|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+148>>2]=e[a>>2],e[r+152>>2]=0,e[r+156>>2]=0,e[r+160>>2]=0,l=r+4544|0,a=r+164|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4556|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4568|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,Ss(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],Ss(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function v2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0)}function Ss(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;K=b,b=b+32|0,$=K+12|0,H=K,R=t+156|0,_=(e[R>>2]|0)+4|0,(e[t+32>>2]|0)==1?z=e[t+24>>2]|0:z=1,r=ie(z<<1,_)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;e:do if(r){if(r>>>0>1431655765&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r*3|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,e[$+8>>2]=o+(r*3|0);;)if(S[o>>0]=0,S[o+1>>0]=0,S[o+2>>0]=0,o=(e[P>>2]|0)+3|0,e[P>>2]=o,r=r+-1|0,!r)break e}a=j()|0,r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!z)h=19;else{if(z>>>0>1073741823&&(m=0,ue(178,H|0),F=m,m=0,F&1)||(h=17),(h|0)==17&&(a=z<<2,m=0,l=ge(67,a|0)|0,F=m,m=0,!(F&1))){e[H>>2]=l,h=l+(z<<2)|0,e[H+8>>2]=h,Jt(l|0,0,a|0)|0,e[G>>2]=h,h=19;break}a=j()|0,r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){l=t+12|0;e:do if((e[l>>2]|0)>0){h=t+4580|0,d=(ie(z,_)|0)+1|0,w=t+4584|0,C=t+92|0,D=(z|0)>0,E=t+4576|0,F=0;t:for(;;){if(a=e[$>>2]|0,r=a+3|0,e[h>>2]=r,o=a+(d*3|0)|0,e[w>>2]=o,F&1?(e[h>>2]=o,e[w>>2]=r,r=1):r=d,o=e[C>>2]|0,m=0,$e(e[(e[o>>2]|0)+12>>2]|0,o|0,a+(r*3|0)|0,e[R>>2]|0,_|0),a=m,m=0,a&1){h=29;break}if(D){r=e[H>>2]|0,o=e[h>>2]|0,a=0;do{if(e[E>>2]=e[r+(a<<2)>>2],L=e[R>>2]|0,r=o+(L*3|0)|0,o=o+((L+-1|0)*3|0)|0,S[r>>0]=S[o>>0]|0,S[r+1>>0]=S[o+1>>0]|0,S[r+2>>0]=S[o+2>>0]|0,r=e[h>>2]|0,o=(e[w>>2]|0)+-3|0,S[o>>0]=S[r>>0]|0,S[o+1>>0]=S[r+1>>0]|0,S[o+2>>0]=S[r+2>>0]|0,m=0,Ae(74,t|0,0),o=m,m=0,o&1){h=28;break t}r=e[H>>2]|0,e[r+(a<<2)>>2]=e[E>>2],o=(e[h>>2]|0)+(_*3|0)|0,e[h>>2]=o,e[w>>2]=(e[w>>2]|0)+(_*3|0),a=a+1|0}while((a|0)<(z|0))}if(F=F+1|0,(F|0)>=(e[l>>2]|0)){h=41;break e}}if((h|0)==28){a=j()|0;break}else if((h|0)==29){a=j()|0;break}}else h=41;while(!1);do if((h|0)==41){if(m=0,ue(182,t|0),L=m,m=0,L&1){a=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),b=K;return}while(!1);r=e[H>>2]|0,o=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(a|0),o=e[P>>2]|0,(o|0)!=(r|0)&&(e[P>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}function x2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0;if(ae=t+156|0,!((e[ae>>2]|0)<=0))for(re=t+4584|0,ce=t+4580|0,Ee=t+4588|0,ne=0;P=ne+-1|0,h=e[re>>2]|0,d=e[ce>>2]|0,r=ne+1|0,l=N[d+(ne*3|0)>>0]|0,J=e[Ee>>2]|0,w=N[d+(P*3|0)>>0]|0,C=l-w|0,D=N[h+(P*3|0)>>0]|0,E=w-D|0,F=((((S[J+((N[d+(r*3|0)>>0]|0)-l)>>0]|0)*9|0)+(S[J+C>>0]|0)|0)*9|0)+(S[J+E>>0]|0)|0,a=N[d+(ne*3|0)+1>>0]|0,R=N[d+(P*3|0)+1>>0]|0,_=a-R|0,z=N[h+(P*3|0)+1>>0]|0,H=R-z|0,K=((((S[J+((N[d+(r*3|0)+1>>0]|0)-a)>>0]|0)*9|0)+(S[J+_>>0]|0)|0)*9|0)+(S[J+H>>0]|0)|0,o=N[d+(ne*3|0)+2>>0]|0,G=N[d+(P*3|0)+2>>0]|0,$=o-G|0,P=N[h+(P*3|0)+2>>0]|0,L=G-P|0,J=((((S[J+((N[d+(r*3|0)+2>>0]|0)-o)>>0]|0)*9|0)+(S[J+$>>0]|0)|0)*9|0)+(S[J+L>>0]|0)|0,K|F|J?(d=N[h+(ne*3|0)>>0]|0,h=l-D>>31,(h^E|0)>=0&&((h^C|0)<0?l=D:l=D-w+l|0),d=er(t,F,d,l,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+1>>0]|0,l=a-z>>31,(l^H|0)>=0&&((l^_|0)<0?a=z:a=z-R+a|0),l=er(t,K,h,a,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+2>>0]|0,a=o-P>>31,(a^L|0)>=0&&((a^$|0)<0?o=P:o=P-G+o|0),J=er(t,J,h,o,0)|0,ne=(e[re>>2]|0)+(ne*3|0)|0,S[ne>>0]=d,S[ne+1>>0]=l,S[ne+2>>0]=J):r=(w2(t,ne,0)|0)+ne|0,(r|0)<(e[ae>>2]|0);)ne=r}function w2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0;for(D=(e[t+156>>2]|0)-r|0,E=e[t+4584>>2]|0,F=e[t+4580>>2]|0,C=E+((r+-1|0)*3|0)|0,R=S[C>>0]|0,w=S[C+1>>0]|0,C=S[C+2>>0]|0,h=0;o=E+((h+r|0)*3|0)|0,a=o+1|0,l=o+2|0,!!(((S[o>>0]|0)==R<<24>>24?(S[a>>0]|0)==w<<24>>24:0)&(S[l>>0]|0)==C<<24>>24);)if(S[o>>0]=R,S[a>>0]=w,S[l>>0]=C,h=h+1|0,(h|0)==(D|0)){h=D;break}if(l=(h|0)==(D|0),d=t+4576|0,a=e[36476+(e[d>>2]<<2)>>2]|0,(1<(h|0))o=h;else{o=h;do _t(t,1,1),a=e[d>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[d>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>0]|0,r=D+2|0,l=S[r>>0]|0,F=F+(a*3|0)|0,a=S[F+1>>0]|0,K=S[F+2>>0]|0,F=N[F>>0]|0,_=F-(R&255)>>31|1,z=(ie((N[D>>0]|0)-F<<24,_)|0)>>24,H=t+4552|0,tr(t,H,z),R=a&255,a=R-(w&255)>>31|1,o=(ie((o&255)-R<<24,a)|0)>>24,tr(t,H,o),w=K&255,C=w-(C&255)>>31|1,l=(ie((l&255)-w<<24,C)|0)>>24,tr(t,H,l),F=(ie(z,_)|0)+F&255,R=(ie(o,a)|0)+R&255,t=(ie(l,C)|0)+w&255,S[D>>0]=F,S[E>>0]=R,S[r>>0]=t,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,t=h+1|0,t|0)}function er(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(z=r>>31,C=(z^r)-z|0,_=t+172+(C*12|0)+10|0,d=k[_>>1]|0,R=t+172+(C*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(h=5;(d<>1]^z)-z+a|0,(l&255|0)==(l|0)?E=l:E=l>>31&255^255,w=(o-E^z)-z<<24,D=w>>24,h?l=0:l=(e[t+172+(C*12|0)+4>>2]<<1)+-1+d>>31,l=l^D,l=l>>30^l<<1,a=l>>h,(a|0)<23?(_t(t,1,a+1|0),_t(t,l&(1<>1]|0,l=d<<16>>16==64,h=l&1,o=(e[a>>2]|0)+D>>h,d=l?32:d<<16>>16,e[R>>2]=(e[R>>2]|0)+((w|0)>-16777216?D:0-D|0)>>h,h=d+1|0,k[_>>1]=h,l=h+o|0,(l|0)<1?(_=k[F>>1]|0,k[F>>1]=(_&65535)-(_<<16>>16>-128&1),_=(l|0)>(~d|0)?l:0-d|0,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&255,r|0):(o|0)<=0?(_=o,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&255,r|0):(_=o-h|0,R=k[F>>1]|0,k[F>>1]=(R<<16>>16<127&1)+(R&65535),_=(_|0)>0?0:_,e[a>>2]=_,z=D^z,r=r>>>31,r=E+r|0,r=r+z|0,r=r&255,r|0)}function tr(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,y2(t,l,a,31-(e[36476+(e[t+4576>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function y2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=o>>r,h=a+-8|0,(l|0)<(a+-9|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-39|0)):_t(t,1,h),_t(t,o+255&255,8)}function C2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,255,0),C=t+160|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+164>>2]|0)&&(e[w+12>>2]|0)==(e[t+168>>2]|0)){C=e[8900]|0,e[t+4588>>2]=C+(((e[8901]|0)-C|0)>>>1),b=D;return}for(o=t+4592|0,a=t+4596|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=512?h>>>0>512&&(d=r+512|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,512-h|0),r=e[o>>2]|0),w=t+4588|0,e[w>>2]=r+256,d=t+168|0,l=t+164|0,h=-256;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==256)break}b=D}function T2(t){t=t|0;var r=0,o=0;e[t>>2]=35884,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),t=t+4|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function I2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35884,r=e[t+4616>>2]|0,r&&(o=t+4620|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36612,r=e[t+120>>2]|0,r&&(o=t+124|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+92|0,r=e[o>>2]|0,e[o>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),o=t+4|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function E2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+136>>2]|0,e[t+144>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+184>>2]=w|0?w:e[C+4>>2]|0,e[t+188>>2]=h,e[t+192>>2]=l,P2(t),l=t+140|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+196+(h*12|0)>>2]=r,e[t+196+(h*12|0)+4>>2]=0,k[t+196+(h*12|0)+8>>1]=0,k[t+196+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4576>>2]=w,e[t+4580>>2]=0,S[t+4584>>0]=C,S[t+4585>>0]=1,S[t+4586>>0]=0,e[t+4588>>2]=w,e[t+4592>>2]=1,S[t+4596>>0]=C,S[t+4597>>0]=1,S[t+4598>>0]=0,e[t+4600>>2]=0,b=d}function D2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=b,b=b+16|0,C=E,w=t+92|0,d=e[r>>2]|0,e[r>>2]=0,r=e[w>>2]|0,e[w>>2]=d,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),e[C>>2]=0,e[C+4>>2]=a,w=o+8|0,e[C+8>>2]=e[w>>2],a){r=Xe(4624)|0,a=t+8|0,l=r+4|0,h=a,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));l=r+88|0,d=l+40|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));e[r>>2]=35660,e[r+128>>2]=e[t+136>>2],e[r+132>>2]=e[t+140>>2],e[r+136>>2]=e[t+144>>2],e[r+140>>2]=e[t+148>>2],e[r+144>>2]=e[t+152>>2],e[r+148>>2]=e[t+156>>2],e[r+152>>2]=e[t+160>>2],l=r+156|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[r+172>>2]=e[a>>2],e[r+176>>2]=0,e[r+180>>2]=0,e[r+184>>2]=0,l=r+4568|0,a=r+188|0;do e[a>>2]=0,e[a+4>>2]=0,k[a+8>>1]=0,k[a+10>>1]=1,a=a+12|0;while((a|0)!=(l|0));h=t+4|0,e[l>>2]=0,e[l+4>>2]=0,k[l+8>>1]=0,S[l+10>>0]=0,d=r+4580|0,e[d>>2]=0,e[d+4>>2]=0,k[d+8>>1]=0,S[d+10>>0]=0,d=r+4592|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[d+16>>2]=0,e[d+20>>2]=0,e[d+24>>2]=0,S[d+28>>0]=0,e[r+28>>2]|0||(e[r+20>>2]=1),a=e[h>>2]|0,e[h>>2]=r,a&&(Rt[e[(e[a>>2]|0)+4>>2]&255](a),r=e[h>>2]|0),Y0(r,C)}return C=t+100|0,e[C>>2]=32,e[t+96>>2]=0,r=e[o>>2]|0,r?(e[t+132>>2]=r,l=t+120|0,w=t+124|0,a=e[w>>2]|0,r=e[l>>2]|0,h=r,d=a-h|0,d>>>0>=4e3?d>>>0>4e3&&(D=r+4e3|0,(a|0)!=(D|0))&&(e[w>>2]=D,a=D):(vi(l,4e3-d|0),r=e[l>>2]|0,h=r,a=e[w>>2]|0),e[t+108>>2]=h,e[t+104>>2]=a-r,As(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0):(e[t+108>>2]=e[o+4>>2],e[t+104>>2]=e[w>>2],As(t),D=t+116|0,D=e[D>>2]|0,t=e[C>>2]|0,t=t+-32|0,t=(t|0)/8|0,t=D-t|0,b=E,t|0)}function F2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+32>>2]|0&&(e[t+24>>2]|0)!=1){if(_=t+8|0,H=t+36|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+16>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+20>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0)}function As(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0;K=b,b=b+32|0,$=K+12|0,H=K,_=t+180|0,z=(e[_>>2]|0)+4|0,(e[t+32>>2]|0)==1?F=e[t+24>>2]|0:F=1,r=ie(F<<1,z)|0,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0;e:do if(r){if((r|0)<0&&(m=0,ue(178,$|0),G=m,m=0,G&1)||(R=6),(R|0)==6&&(m=0,o=ge(67,r|0)|0,G=m,m=0,!(G&1))){for(e[P>>2]=o,e[$>>2]=o,e[$+8>>2]=o+r;;)if(S[o>>0]=0,o=(e[P>>2]|0)+1|0,e[P>>2]=o,r=r+-1|0,!r)break e}o=j()|0,r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0)}while(!1);e[H>>2]=0,G=H+4|0,e[G>>2]=0,e[H+8>>2]=0;do if(!F)R=19;else{if(F>>>0>1073741823&&(m=0,ue(178,H|0),E=m,m=0,E&1)||(R=17),(R|0)==17&&(a=F<<2,m=0,l=ge(67,a|0)|0,E=m,m=0,!(E&1))){e[H>>2]=l,R=l+(F<<2)|0,e[H+8>>2]=R,Jt(l|0,0,a|0)|0,e[G>>2]=R,R=19;break}o=j()|0,r=e[H>>2]|0,a=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}while(!1);if((R|0)==19){d=t+12|0;e:do if((e[d>>2]|0)>0){if(w=t+4604|0,C=(ie(F,z)|0)+1|0,D=t+4608|0,E=t+92|0,h=t+4600|0,(F|0)>0)l=0;else{for(a=0;o=e[$>>2]|0,r=o+1|0,e[w>>2]=r,o=o+C|0,e[D>>2]=o,a&1?(e[w>>2]=o,e[D>>2]=r):r=o,F=e[E>>2]|0,m=0,$e(e[(e[F>>2]|0)+12>>2]|0,F|0,r|0,e[_>>2]|0,z|0),F=m,m=0,!(F&1);)if(a=a+1|0,(a|0)>=(e[d>>2]|0)){R=45;break e}o=j()|0;break}t:for(;;){if(o=e[$>>2]|0,r=o+1|0,e[w>>2]=r,o=o+C|0,e[D>>2]=o,l&1?(e[w>>2]=o,e[D>>2]=r):r=o,R=e[E>>2]|0,m=0,$e(e[(e[R>>2]|0)+12>>2]|0,R|0,r|0,e[_>>2]|0,z|0),R=m,m=0,R&1){R=28;break}r=e[H>>2]|0,o=e[w>>2]|0,a=0;do{if(e[h>>2]=e[r+(a<<2)>>2],R=e[_>>2]|0,S[o+R>>0]=S[o+(R+-1)>>0]|0,S[(e[D>>2]|0)+-1>>0]=S[e[w>>2]>>0]|0,m=0,Ae(75,t|0,0),R=m,m=0,R&1){R=36;break t}r=e[H>>2]|0,e[r+(a<<2)>>2]=e[h>>2],o=(e[w>>2]|0)+z|0,e[w>>2]=o,e[D>>2]=(e[D>>2]|0)+z,a=a+1|0}while((a|0)<(F|0));if(l=l+1|0,(l|0)>=(e[d>>2]|0)){R=45;break e}}if((R|0)==28){o=j()|0;break}else if((R|0)==36){o=j()|0;break}}else R=45;while(!1);do if((R|0)==45){if(m=0,ue(182,t|0),t=m,m=0,t&1){o=j()|0;break}if(r=e[H>>2]|0,o=r,r&&(a=e[G>>2]|0,(a|0)!=(r|0)&&(e[G>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[$>>2]|0,!r){b=K;return}(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),b=K;return}while(!1);r=e[H>>2]|0,a=r,r&&(l=e[G>>2]|0,(l|0)!=(r|0)&&(e[G>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0)}function N2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=t+4604|0,r=e[F>>2]|0,z=t+180|0,!((e[z>>2]|0)<=0))for(R=t+4608|0,_=t+4612|0,l=r,h=N[r+-1>>0]|0,r=N[r>>0]|0,E=0;D=e[R>>2]|0,C=N[D+(E+-1)>>0]|0,a=E+1|0,o=N[l+a>>0]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=R2(t,w,N[D+E>>0]|0,l,0)|0,S[(e[R>>2]|0)+E>>0]=D):(a=(M2(t,E,0)|0)+E|0,o=e[F>>2]|0,r=N[o+(a+-1)>>0]|0,o=N[o+a>>0]|0),!((a|0)>=(e[z>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function R2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(H=r>>31,h=(H^r)-H|0,_=t+196+(h*12|0)+10|0,d=k[_>>1]|0,R=t+196+(h*12|0)|0,l=e[R>>2]|0,(d|0)<(l|0))if((d<<1|0)<(l|0))if((d<<2|0)<(l|0))if((d<<3|0)<(l|0))if((d<<4|0)<(l|0))for(r=5;(d<>1]^H)-H+a|0,z=t+136|0,a=e[z>>2]|0,(l&a|0)==(l|0)?D=l:D=a&~(l>>31),l=(o-D^H)-H|0,C=t+144|0,a=e[C>>2]|0,(l|0)>0?l=(l+a|0)/(a<<1|1|0)|0:l=(l-a|0)/(a<<1|1|0)|0,F=t+140|0,w=e[F>>2]|0,o=((l|0)<0?w:0)+l|0,w=o-((o|0)<((w+1|0)/2|0|0)?0:w)|0,h=t+196+(h*12|0)+4|0,a|r?l=0:l=(e[h>>2]<<1)+-1+d>>31,a=l^w,xs(t,r,a>>30^a<<1,e[t+156>>2]|0),a=e[t+160>>2]|0,r=(e[R>>2]|0)+((w|0)>-1?w:0-w|0)|0,l=(e[h>>2]|0)+(ie(e[C>>2]<<1|1,w)|0)|0,o=k[_>>1]|0,(o|0)==(a|0)&&(r=r>>1,l=l>>1,o=a>>1),e[R>>2]=r,a=o+1|0,k[_>>1]=a,r=a+l|0,(r|0)>=1?(l|0)>0&&(l=l-a|0,_=k[E>>1]|0,k[E>>1]=(_<<16>>16<127&1)+(_&65535),l=(l|0)>0?0:l):(l=k[E>>1]|0,k[E>>1]=(l&65535)-(l<<16>>16>-128&1),l=(r|0)>(~o|0)?r:0-o|0),e[h>>2]=l,a=e[C>>2]|0,o=a<<1|1,r=(ie(o,(w^H)-H|0)|0)+D|0,(r|0)>=(0-a|0)?(l=e[z>>2]|0,(l+a|0)<(r|0)&&(r=r-(ie(e[F>>2]|0,o)|0)|0)):(r=(ie(e[F>>2]|0,o)|0)+r|0,l=e[z>>2]|0),(r&l|0)==(r|0)?(H=r,H=H&255,H|0):(H=l&~(r>>31),H=H&255,H|0)}function M2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;for(C=(e[t+180>>2]|0)-r|0,D=e[t+4608>>2]|0,E=e[t+4604>>2]|0,l=S[D+(r+-1)>>0]|0,w=l&255,o=t+144|0,h=0;a=D+(h+r)|0,d=(N[a>>0]|0)-w|0,!((((d|0)>-1?d:0-d|0)|0)>(e[o>>2]|0));)if(S[a>>0]=l,h=h+1|0,(h|0)==(C|0)){h=C;break}if(l=(h|0)==(C|0),d=t+4600|0,a=e[36476+(e[d>>2]<<2)>>2]|0,(1<(h|0))o=h;else{o=h;do _t(t,1,1),a=e[d>>2]|0,o=o-(1<>2])|0,a=(a|0)>30?31:a+1|0,e[d>>2]=a,a=e[36476+(a<<2)>>2]|0;while((o|0)>=(1<>0]|0,w,N[E+C>>0]|0)|0,S[r>>0]=t,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,t=h+1|0,t|0)}function _2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;return w=o-a|0,C=t+136|0,d=t+144|0,l=e[d>>2]|0,(((w|0)>-1?w:0-w|0)|0)>(l|0)?(h=a-o>>31|1,r=ie(h,r-a|0)|0,(r|0)>0?r=(l+r|0)/(l<<1|1|0)|0:r=(r-l|0)/(l<<1|1|0)|0,w=t+140|0,l=e[w>>2]|0,o=((r|0)<0?l:0)+r|0,l=o-((o|0)<((l+1|0)/2|0|0)?0:l)|0,vs(t,t+4576|0,l),l=ie(l,h)|0,h=e[d>>2]|0,d=h<<1|1,l=(ie(l,d)|0)+a|0,(l|0)>=(0-h|0)?(r=e[C>>2]|0,(r+h|0)<(l|0)&&(l=l-(ie(e[w>>2]|0,d)|0)|0)):(l=(ie(e[w>>2]|0,d)|0)+l|0,r=e[C>>2]|0),(l&r|0)==(l|0)?(C=l,C=C&255,C|0):(C=r&~(l>>31),C=C&255,C|0)):(r=r-o|0,(r|0)>0?r=(l+r|0)/(l<<1|1|0)|0:r=(r-l|0)/(l<<1|1|0)|0,w=t+140|0,l=e[w>>2]|0,h=((r|0)<0?l:0)+r|0,l=h-((h|0)<((l+1|0)/2|0|0)?0:l)|0,vs(t,t+4588|0,l),h=e[d>>2]|0,d=h<<1|1,l=(ie(d,l)|0)+o|0,(l|0)>=(0-h|0)?(r=e[C>>2]|0,(r+h|0)<(l|0)&&(l=l-(ie(e[w>>2]|0,d)|0)|0)):(l=(ie(e[w>>2]|0,d)|0)+l|0,r=e[C>>2]|0),(l&r|0)==(l|0)?(C=l,C=C&255,C|0):(C=r&~(l>>31),C=C&255,C|0))}function vs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;if(E=r+9|0,d=N[E>>0]|0,D=r+4|0,C=e[D>>2]|0,l=(ie(d>>>1,C)|0)+(e[r>>2]|0)|0,(d|0)<(l|0)){h=d,a=0;do h=h<<1,a=a+1|0;while((h|0)<(l|0));l=a}else l=0;(o|0)>0&(l|0)==0&&N[r+10>>0]<<1>>>0>>0?a=1:w=5;do if((w|0)==5){if(a=(o|0)<0,a&&N[r+10>>0]<<1>>>0>=d>>>0){a=1;break}a=a&(l|0)!=0}while(!1);if(a=(((o|0)>-1?o:0-o|0)<<1)-C+(a<<31>>31)|0,xs(t,l,a,(e[t+156>>2]|0)+-1-(e[36476+(e[t+4600>>2]<<2)>>2]|0)|0),(o|0)<0&&(t=r+10|0,S[t>>0]=(N[t>>0]|0)+1),a=(a+1-(e[D>>2]|0)>>1)+(e[r>>2]|0)|0,e[r>>2]=a,l=S[E>>0]|0,l<<24>>24!=(S[r+8>>0]|0)){r=l,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r;return}e[r>>2]=a>>1,t=(l&255)>>>1,S[E>>0]=t,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=t,r=r&255,r=r+1|0,r=r&255,S[E>>0]=r}function xs(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0;if(l=o>>r,h=t+148|0,d=a-(e[h>>2]|0)|0,(l|0)<(d+-1|0)){(l|0)>30&&(a=(l|0)/2|0,_t(t,0,a),l=l-a|0),_t(t,1,l+1|0),_t(t,(1<31?(_t(t,0,31),_t(t,1,a+-31-(e[h>>2]|0)|0)):_t(t,1,d),r=e[h>>2]|0,_t(t,(1<>2]|0)r=t+152|0;else if(o=e[t+136>>2]|0,r=t+152|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+184>>2]|0))&&(e[a+8>>2]|0)==(e[t+188>>2]|0)&&(e[a+12>>2]|0)==(e[t+192>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4612>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4612>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4612>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4612>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4616|0,a=E<<1,l=t+4620|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4612|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+192|0,C=t+188|0,d=t+184|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function L2(t){t=t|0;var r=0,o=0;e[t>>2]=35856,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function O2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35856,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function $2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function B2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+128>>2]|0,e[t+136>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+176>>2]=w|0?w:e[C+4>>2]|0,e[t+180>>2]=h,e[t+184>>2]=l,Q2(t),l=t+132|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+188+(h*12|0)>>2]=r,e[t+188+(h*12|0)+4>>2]=0,k[t+188+(h*12|0)+8>>1]=0,k[t+188+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4568>>2]=w,e[t+4572>>2]=0,S[t+4576>>0]=C,S[t+4577>>0]=1,S[t+4578>>0]=0,e[t+4580>>2]=w,e[t+4584>>2]=1,S[t+4588>>0]=C,S[t+4589>>0]=1,S[t+4590>>0]=0,e[t+4592>>2]=0,b=d}function V2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4620>>0]=l&1,r=t+156|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),U2(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function U2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+172|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,ae=m,m=0,!(ae&1))){e[re>>2]=a,ae=a+(r<<1)|0,e[re+8>>2]=ae,Jt(a|0,0,o|0)|0,e[ce>>2]=ae;break}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)d=18;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(d=16),(d|0)==16&&(l=L<<2,m=0,h=ge(67,l|0)|0,G=m,m=0,!(G&1))){e[J>>2]=h,d=h+(L<<2)|0,e[J+8>>2]=d,Jt(h|0,0,l|0)|0,e[ae>>2]=d,d=18;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4596|0,w=ie(L,P)|0,C=w+1|0,D=t+4600|0,E=(L|0)>0,F=t+160|0,R=t+168|0,_=t+164|0,z=t+156|0,H=t+88|0,K=t+4592|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+2|0,e[d>>2]=o,a=a+(C<<1)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],l=e[$>>2]|0,k[o+(l<<1)>>1]=k[o+(l+-1<<1)>>1]|0,k[r+-2>>1]=k[o>>1]|0,m=0,Ae(76,t|0,0),l=m,m=0,l&1){d=29;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P<<1)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P<<1)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+((e[z>>2]|0)-w<<1)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){d=30;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){d=42;break e}}if((d|0)==29){a=j()|0;break}else if((d|0)==30){a=j()|0;break}}else d=42;while(!1);do if((d|0)==42){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function z2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0;if(R=t+4596|0,o=e[R>>2]|0,K=t+172|0,r=e[K>>2]|0,!((r|0)<=0))for(_=t+4600|0,z=t+4604|0,H=t+4592|0,w=o,h=M[o+-2>>1]|0,o=M[o>>1]|0,F=0;D=e[_>>2]|0,d=k[D+(F+-1<<1)>>1]|0,E=d&65535,l=F+1|0,a=M[w+(l<<1)>>1]|0,C=e[z>>2]|0,w=o-h|0,h=h-E|0,C=((((S[C+(a-o)>>0]|0)*9|0)+(S[C+w>>0]|0)|0)*9|0)+(S[C+h>>0]|0)|0,D=D+(F<<1)|0,C?(r=o-E>>31,(r^h|0)<0?r=o:r=E+((r^w|0)<0?0:w)|0,E=q2(t,C,M[D>>1]|0,r,0)|0,k[(e[_>>2]|0)+(F<<1)>>1]=E):(r=W2(t,d,D,r-F|0)|0,o=r+F|0,(o|0)!=(e[K>>2]|0)&&(E=H2(t,E,M[(e[R>>2]|0)+(o<<1)>>1]|0)|0,k[(e[_>>2]|0)+(o<<1)>>1]=E,E=e[H>>2]|0,e[H>>2]=(E|0)<1?0:E+-1|0,r=r+1|0),l=r+F|0,a=e[R>>2]|0,o=M[a+(l+-1<<1)>>1]|0,a=M[a+(l<<1)>>1]|0),r=e[K>>2]|0,!((r|0)<=(l|0));)w=e[R>>2]|0,h=o,o=a,F=l}function G2(t){t=t|0;var r=0,o=0,a=0,l=0;a=t+116|0,o=e[a>>2]|0,(S[o>>0]|0)!=-1?(l=t+112|0,r=e[l>>2]|0,(r|0)<1&&(P0(t),r=e[l>>2]|0,o=e[a>>2]|0),t=t+108|0,a=e[t>>2]|0,e[l>>2]=r+-1,r=a<<1,e[t>>2]=r,(S[o>>0]|0)!=-1&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,6,35648),t=m,m=0,t&1||Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0))):r=e[t+108>>2]|0,r&&(r=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,r|0,6,35648),t=m,m=0,t&1||Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0))}function q2(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(z=r>>31,C=(z^r)-z|0,R=t+188+(C*12|0)+10|0,o=k[R>>1]|0,F=t+188+(C*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(r=5;(o<>1]^z)-z+a|0,_=t+128|0,l=e[_>>2]|0,(o&l|0)==(o|0)?D=o:D=l&~(o>>31),o=t+112|0,(e[o>>2]|0)<8&&P0(t),l=t+108|0,a=e[l>>2]|0,h=a>>>24,d=e[2832+(r<<11)+(h<<3)+4>>2]|0,d?(e[o>>2]=(e[o>>2]|0)-d,e[l>>2]=a<>2]|0):(w=e[t+148>>2]|0,l=e[t+140>>2]|0,o=X0(t)|0,(o|0)<(w+-1-l|0)?r&&(o=(l0(t,r)|0)+(o<>31^o>>1,(((o|0)>-1?o:0-o|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),w=t+136|0,a=e[w>>2]|0,r?d=o:(a?l=0:l=(e[t+188+(C*12|0)+4>>2]<<1)+-1+(k[R>>1]|0)>>31,d=l^o),r=e[t+152>>2]|0,l=(e[F>>2]|0)+((d|0)>-1?d:0-d|0)|0,h=t+188+(C*12|0)+4|0,o=(e[h>>2]|0)+(ie(a<<1|1,d)|0)|0,a=k[R>>1]|0,(a|0)==(r|0)&&(l=l>>1,o=o>>1,a=r>>1),e[F>>2]=l,r=a+1|0,k[R>>1]=r,l=r+o|0,(l|0)>=1?(o|0)>0&&(o=o-r|0,R=k[E>>1]|0,k[E>>1]=(R<<16>>16<127&1)+(R&65535),o=(o|0)>0?0:o):(o=k[E>>1]|0,k[E>>1]=(o&65535)-(o<<16>>16>-128&1),o=(l|0)>(~a|0)?l:0-a|0),e[h>>2]=o,r=e[w>>2]|0,a=r<<1|1,l=(ie(a,(d^z)-z|0)|0)+D|0,(l|0)>=(0-r|0)?(o=e[_>>2]|0,(o+r|0)<(l|0)&&(l=l-(ie(e[t+132>>2]|0,a)|0)|0)):(l=(ie(e[t+132>>2]|0,a)|0)+l|0,o=e[_>>2]|0),(l&o|0)==(l|0)?(t=l,t=t&65535,t|0):(t=o&~(l>>31),t=t&65535,t|0)}function W2(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4592|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)>0)h=0;else return l|0;do k[o+(h<<1)>>1]=r,h=h+1|0;while((h|0)!=(l|0));return l|0}function H2(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=r-o|0,d=t+128|0,a=t+136|0,(((h|0)>-1?h:0-h|0)|0)>(e[a>>2]|0)?(r=ie(ws(t,t+4568|0)|0,o-r>>31|1)|0,l=e[a>>2]|0,h=l<<1|1,r=(ie(r,h)|0)+o|0,(r|0)>=(0-l|0)?(a=e[d>>2]|0,(a+l|0)<(r|0)&&(r=r-(ie(e[t+132>>2]|0,h)|0)|0)):(r=(ie(e[t+132>>2]|0,h)|0)+r|0,a=e[d>>2]|0),(r&a|0)==(r|0)?(t=r,t=t&65535,t|0):(t=a&~(r>>31),t=t&65535,t|0)):(o=ws(t,t+4580|0)|0,h=e[a>>2]|0,l=h<<1|1,r=(ie(l,o)|0)+r|0,(r|0)>=(0-h|0)?(a=e[d>>2]|0,(a+h|0)<(r|0)&&(r=r-(ie(e[t+132>>2]|0,l)|0)|0)):(r=(ie(e[t+132>>2]|0,l)|0)+r|0,a=e[d>>2]|0),(r&a|0)==(r|0)?(t=r,t=t&65535,t|0):(t=a&~(r>>31),t=t&65535,t|0))}function ws(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=r+9|0,o=N[D>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;d=e[t+148>>2]|0,w=e[36476+(e[t+4592>>2]<<2)>>2]|0,o=e[t+140>>2]|0,l=X0(t)|0;do if((l|0)<(d+-2-w-o|0))if(a){w=(l0(t,a)|0)+(l<>2]|0,l=w+a|0,d=l&1,o=d,h=1,l=(d+l|0)/2|0;break}else{a=e[h>>2]|0,t=a+l|0,o=t&1,t=(o+t|0)/2|0,C=8;break}else l=(l0(t,o)|0)+1|0,d=e[h>>2]|0,t=l+d|0,o=t&1,t=(o+t|0)/2|0,a?(w=l,h=1,l=t,a=d):(a=d,C=8);while(!1);return(C|0)==8&&(w=l,h=N[r+10>>0]<<1>>>0>=(N[D>>0]|0)>>>0,l=t),l=(o|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(w+1-a>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[D>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(r=a,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[D>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=C,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0)}function X0(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;if(h=t+112|0,(e[h>>2]|0)<16&&P0(t),d=t+108|0,o=e[d>>2]|0,(o|0)>=0){if(o&1073741824)r=1;else if(o&536870912)r=2;else if(o&268435456)r=3;else if(o&134217728)r=4;else if(o&67108864)r=5;else if(o&33554432)r=6;else if(o&16777216)r=7;else if(o&8388608)r=8;else if(o&4194304)r=9;else if(o&2097152)r=10;else if(o&1048576)r=11;else if(o&524288)r=12;else if(o&262144)r=13;else if(o&131072)r=14;else if(l=o>>>12&16,r=l+-1|0,!l){for(r=(e[h>>2]|0)+-15|0,e[h>>2]=r,a=o<<15,e[d>>2]=a,o=r,r=15;(o|0)<1?(P0(t),l=e[d>>2]|0,o=e[h>>2]|0):l=a,o=o+-1|0,e[h>>2]=o,a=l<<1,e[d>>2]=a,!((l|0)<0);)r=r+1|0;return r|0}}else r=0;return t=r+1|0,e[h>>2]=(e[h>>2]|0)-t,e[d>>2]=o<>2]|0,(o|0)<(r|0)&&(P0(t),o=e[a>>2]|0,(o|0)<(r|0)&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),l=t+108|0,t=e[l>>2]|0,e[a>>2]=o-r,e[l>>2]=t<>>(32-r|0)|0}function Q2(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+136|0;e:do if(e[F>>2]|0)r=t+144|0;else if(o=e[t+128>>2]|0,r=t+144|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+176>>2]|0))&&(e[a+8>>2]|0)==(e[t+180>>2]|0)&&(e[a+12>>2]|0)==(e[t+184>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4604>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4604>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4604>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4604>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4608|0,a=E<<1,l=t+4612|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4604|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+184|0,C=t+180|0,d=t+176|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function K2(t){t=t|0;var r=0,o=0;e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Y2(t){t=t|0;var r=0,o=0;if(e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function j2(t){t=t|0;var r=0,o=0;e[t>>2]=35828,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function X2(t){t=t|0;var r=0,o=0;if(e[t>>2]=35828,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Z2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=6,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=6,e[a+12>>2]=t,L=a,b=G,L|0)}function J2(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+128>>2]|0,e[t+136>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+176>>2]=w|0?w:e[C+4>>2]|0,e[t+180>>2]=h,e[t+184>>2]=l,su(t),l=t+132|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+188+(h*12|0)>>2]=r,e[t+188+(h*12|0)+4>>2]=0,k[t+188+(h*12|0)+8>>1]=0,k[t+188+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4568>>2]=w,e[t+4572>>2]=0,S[t+4576>>0]=C,S[t+4577>>0]=1,S[t+4578>>0]=0,e[t+4580>>2]=w,e[t+4584>>2]=1,S[t+4588>>0]=C,S[t+4589>>0]=1,S[t+4590>>0]=0,e[t+4592>>2]=0,b=d}function eu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4620>>0]=l&1,r=t+156|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),tu(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function tu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+172|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;do if(r){if(r>>>0>715827882&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(d=6),(d|0)==6&&(m=0,o=ge(67,r*6|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,a=o+(r*6|0)|0,e[re+8>>2]=a;k[o>>1]=0,k[o+2>>1]=0,k[o+4>>1]=0,r=r+-1|0,r;)o=o+6|0;e[ce>>2]=a;break}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)d=20;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(d=18),(d|0)==18&&(l=L<<2,m=0,h=ge(67,l|0)|0,G=m,m=0,!(G&1))){e[J>>2]=h,d=h+(L<<2)|0,e[J+8>>2]=d,Jt(h|0,0,l|0)|0,e[ae>>2]=d,d=20;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==20){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4596|0,w=ie(L,P)|0,C=w+1|0,D=t+4600|0,E=(L|0)>0,F=t+160|0,R=t+168|0,_=t+164|0,z=t+156|0,H=t+88|0,K=t+4592|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+6|0,e[d>>2]=o,a=a+(C*6|0)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],r=e[$>>2]|0,l=o+(r*6|0)|0,o=o+((r+-1|0)*6|0)|0,k[l>>1]=k[o>>1]|0,k[l+2>>1]=k[o+2>>1]|0,k[l+4>>1]=k[o+4>>1]|0,l=(e[D>>2]|0)+-6|0,o=e[d>>2]|0,k[l>>1]=k[o>>1]|0,k[l+2>>1]=k[o+2>>1]|0,k[l+4>>1]=k[o+4>>1]|0,m=0,Ae(77,t|0,0),l=m,m=0,l&1){d=31;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P*6|0)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P*6|0)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+(((e[z>>2]|0)-w|0)*6|0)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){d=32;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){d=44;break e}}if((d|0)==31){a=j()|0;break}else if((d|0)==32){a=j()|0;break}}else d=44;while(!1);do if((d|0)==44){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-6-r|0)>>>0)/6|0)*6|0)),he(r),le(a|0)}function iu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0;if(zt=b,b=b+32|0,re=zt+24|0,i0=zt+18|0,s0=zt+12|0,ce=zt+6|0,Ee=zt,ke=t+172|0,r=e[ke>>2]|0,(r|0)<=0){b=zt;return}for(Te=t+4600|0,it=t+4596|0,jt=t+4604|0,Gt=t+4592|0,ae=0;a=ae+-1|0,l=e[Te>>2]|0,gt=e[it>>2]|0,o=ae+1|0,h=M[gt+(ae*6|0)>>1]|0,ne=e[jt>>2]|0,d=M[gt+(a*6|0)>>1]|0,w=h-d|0,C=M[l+(a*6|0)>>1]|0,D=d-C|0,E=((((S[ne+((M[gt+(o*6|0)>>1]|0)-h)>>0]|0)*9|0)+(S[ne+w>>0]|0)|0)*9|0)+(S[ne+D>>0]|0)|0,F=M[gt+(ae*6|0)+2>>1]|0,R=M[gt+(a*6|0)+2>>1]|0,_=F-R|0,z=M[l+(a*6|0)+2>>1]|0,H=R-z|0,K=((((S[ne+((M[gt+(o*6|0)+2>>1]|0)-F)>>0]|0)*9|0)+(S[ne+_>>0]|0)|0)*9|0)+(S[ne+H>>0]|0)|0,G=M[gt+(ae*6|0)+4>>1]|0,$=M[gt+(a*6|0)+4>>1]|0,P=G-$|0,L=M[l+(a*6|0)+4>>1]|0,J=$-L|0,ne=((((S[ne+((M[gt+(o*6|0)+4>>1]|0)-G)>>0]|0)*9|0)+(S[ne+P>>0]|0)|0)*9|0)+(S[ne+J>>0]|0)|0,K|E|ne?(a=M[l+(ae*6|0)>>1]|0,r=h-C>>31,(r^D|0)>=0?(r^w|0)<0?r=C:r=C-d+h|0:r=h,h=ir(t,E,a,r,0)|0,a=M[(e[Te>>2]|0)+(ae*6|0)+2>>1]|0,r=F-z>>31,(r^H|0)>=0?(r^_|0)<0?r=z:r=z-R+F|0:r=F,a=ir(t,K,a,r,0)|0,l=M[(e[Te>>2]|0)+(ae*6|0)+4>>1]|0,r=G-L>>31,(r^J|0)>=0?(r^P|0)<0?r=L:r=L-$+G|0:r=G,ne=ir(t,ne,l,r,0)|0,gt=e[Te>>2]|0,k[gt+(ae*6|0)>>1]=h,k[gt+(ae*6|0)+2>>1]=a,k[gt+(ae*6|0)+4>>1]=ne):(o=l+(a*6|0)|0,k[s0>>1]=k[o>>1]|0,k[s0+2>>1]=k[o+2>>1]|0,k[s0+4>>1]=k[o+4>>1]|0,k[re>>1]=k[o>>1]|0,k[re+2>>1]=k[o+2>>1]|0,k[re+4>>1]=k[o+4>>1]|0,r=nu(t,re,l+(ae*6|0)|0,r-ae|0)|0,o=r+ae|0,(o|0)!=(e[ke>>2]|0)&&(gt=(e[it>>2]|0)+(o*6|0)|0,k[Ee>>1]=k[gt>>1]|0,k[Ee+2>>1]=k[gt+2>>1]|0,k[Ee+4>>1]=k[gt+4>>1]|0,gt=(e[Te>>2]|0)+(o*6|0)|0,k[i0>>1]=k[s0>>1]|0,k[i0+2>>1]=k[s0+2>>1]|0,k[i0+4>>1]=k[s0+4>>1]|0,k[re>>1]=k[Ee>>1]|0,k[re+2>>1]=k[Ee+2>>1]|0,k[re+4>>1]=k[Ee+4>>1]|0,ru(ce,t,i0,re),k[gt>>1]=k[ce>>1]|0,k[gt+2>>1]=k[ce+2>>1]|0,k[gt+4>>1]=k[ce+4>>1]|0,gt=e[Gt>>2]|0,e[Gt>>2]=(gt|0)<1?0:gt+-1|0,r=r+1|0),o=r+ae|0),r=e[ke>>2]|0,!((o|0)>=(r|0));)ae=o;b=zt}function nu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4592|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0)return l|0;h=0;do R=o+(h*6|0)|0,k[R>>1]=k[r>>1]|0,k[R+2>>1]=k[r+2>>1]|0,k[R+4>>1]=k[r+4>>1]|0,h=h+1|0;while((h|0)!=(l|0));return l|0}function ru(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(C=r+4568|0,F=nr(r,C)|0,d=nr(r,C)|0,C=nr(r,C)|0,h=r+128|0,l=M[a>>1]|0,D=e[r+136>>2]|0,E=D<<1|1,l=(ie(ie(E,F)|0,l-(M[o>>1]|0)>>31|1)|0)+l|0,F=0-D|0,(l|0)>=(F|0)?(h=e[h>>2]|0,(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0)):(l=(ie(e[r+132>>2]|0,E)|0)+l|0,h=e[h>>2]|0),(l&h|0)!=(l|0)&&(l=h&~(l>>31)),w=l&65535,l=M[a+2>>1]|0,l=(ie(ie(E,d)|0,l-(M[o+2>>1]|0)>>31|1)|0)+l|0,(l|0)>=(F|0)?(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0):l=(ie(e[r+132>>2]|0,E)|0)+l|0,(l&h|0)!=(l|0)&&(l=h&~(l>>31)),d=l&65535,l=M[a+4>>1]|0,l=(ie(ie(E,C)|0,l-(M[o+4>>1]|0)>>31|1)|0)+l|0,(l|0)>=(F|0)?(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0):l=(ie(e[r+132>>2]|0,E)|0)+l|0,(l&h|0)==(l|0)){r=l,r=r&65535,k[t>>1]=w,F=t+2|0,k[F>>1]=d,t=t+4|0,k[t>>1]=r;return}r=h&~(l>>31),r=r&65535,k[t>>1]=w,F=t+2|0,k[F>>1]=d,t=t+4|0,k[t>>1]=r}function ir(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(z=r>>31,C=(z^r)-z|0,R=t+188+(C*12|0)+10|0,o=k[R>>1]|0,F=t+188+(C*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(r=5;(o<>1]^z)-z+a|0,_=t+128|0,l=e[_>>2]|0,(o&l|0)==(o|0)?D=o:D=l&~(o>>31),o=t+112|0,(e[o>>2]|0)<8&&P0(t),l=t+108|0,a=e[l>>2]|0,h=a>>>24,d=e[2832+(r<<11)+(h<<3)+4>>2]|0,d?(e[o>>2]=(e[o>>2]|0)-d,e[l>>2]=a<>2]|0):(w=e[t+148>>2]|0,l=e[t+140>>2]|0,o=X0(t)|0,(o|0)<(w+-1-l|0)?r&&(o=(l0(t,r)|0)+(o<>31^o>>1,(((o|0)>-1?o:0-o|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),w=t+136|0,a=e[w>>2]|0,r?d=o:(a?l=0:l=(e[t+188+(C*12|0)+4>>2]<<1)+-1+(k[R>>1]|0)>>31,d=l^o),r=e[t+152>>2]|0,l=(e[F>>2]|0)+((d|0)>-1?d:0-d|0)|0,h=t+188+(C*12|0)+4|0,o=(e[h>>2]|0)+(ie(a<<1|1,d)|0)|0,a=k[R>>1]|0,(a|0)==(r|0)&&(l=l>>1,o=o>>1,a=r>>1),e[F>>2]=l,r=a+1|0,k[R>>1]=r,l=r+o|0,(l|0)>=1?(o|0)>0&&(o=o-r|0,R=k[E>>1]|0,k[E>>1]=(R<<16>>16<127&1)+(R&65535),o=(o|0)>0?0:o):(o=k[E>>1]|0,k[E>>1]=(o&65535)-(o<<16>>16>-128&1),o=(l|0)>(~a|0)?l:0-a|0),e[h>>2]=o,r=e[w>>2]|0,a=r<<1|1,l=(ie(a,(d^z)-z|0)|0)+D|0,(l|0)>=(0-r|0)?(o=e[_>>2]|0,(o+r|0)<(l|0)&&(l=l-(ie(e[t+132>>2]|0,a)|0)|0)):(l=(ie(e[t+132>>2]|0,a)|0)+l|0,o=e[_>>2]|0),(l&o|0)==(l|0)?(t=l,t=t&65535,t|0):(t=o&~(l>>31),t=t&65535,t|0)}function nr(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=r+9|0,o=N[D>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;d=e[t+148>>2]|0,w=e[36476+(e[t+4592>>2]<<2)>>2]|0,o=e[t+140>>2]|0,l=X0(t)|0;do if((l|0)<(d+-2-w-o|0))if(a){w=(l0(t,a)|0)+(l<>2]|0,l=w+a|0,d=l&1,o=d,h=1,l=(d+l|0)/2|0;break}else{a=e[h>>2]|0,t=a+l|0,o=t&1,t=(o+t|0)/2|0,C=8;break}else l=(l0(t,o)|0)+1|0,d=e[h>>2]|0,t=l+d|0,o=t&1,t=(o+t|0)/2|0,a?(w=l,h=1,l=t,a=d):(a=d,C=8);while(!1);return(C|0)==8&&(w=l,h=N[r+10>>0]<<1>>>0>=(N[D>>0]|0)>>>0,l=t),l=(o|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(w+1-a>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[D>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(r=a,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[D>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=C,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0)}function su(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+136|0;e:do if(e[F>>2]|0)r=t+144|0;else if(o=e[t+128>>2]|0,r=t+144|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+176>>2]|0))&&(e[a+8>>2]|0)==(e[t+180>>2]|0)&&(e[a+12>>2]|0)==(e[t+184>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4604>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4604>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4604>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4604>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4608|0,a=E<<1,l=t+4612|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4604|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+184|0,C=t+180|0,d=t+176|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function ou(t){t=t|0;var r=0,o=0;e[t>>2]=35800,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function au(t){t=t|0;var r=0,o=0;if(e[t>>2]=35800,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function lu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0)}function uu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+128>>2]|0,e[t+136>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+176>>2]=w|0?w:e[C+4>>2]|0,e[t+180>>2]=h,e[t+184>>2]=l,mu(t),l=t+132|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+188+(h*12|0)>>2]=r,e[t+188+(h*12|0)+4>>2]=0,k[t+188+(h*12|0)+8>>1]=0,k[t+188+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4568>>2]=w,e[t+4572>>2]=0,S[t+4576>>0]=C,S[t+4577>>0]=1,S[t+4578>>0]=0,e[t+4580>>2]=w,e[t+4584>>2]=1,S[t+4588>>0]=C,S[t+4589>>0]=1,S[t+4590>>0]=0,e[t+4592>>2]=0,b=d}function cu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4620>>0]=l&1,r=t+156|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),fu(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function fu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+172|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;e:do if(r){if(r>>>0>1431655765&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r*3|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,e[re+8>>2]=o+(r*3|0);;)if(S[o>>0]=0,S[o+1>>0]=0,S[o+2>>0]=0,o=(e[ce>>2]|0)+3|0,e[ce>>2]=o,r=r+-1|0,!r)break e}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)h=19;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(h=17),(h|0)==17&&(a=L<<2,m=0,l=ge(67,a|0)|0,G=m,m=0,!(G&1))){e[J>>2]=l,h=l+(L<<2)|0,e[J+8>>2]=h,Jt(l|0,0,a|0)|0,e[ae>>2]=h,h=19;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4596|0,w=ie(L,P)|0,C=w+1|0,D=t+4600|0,E=(L|0)>0,F=t+160|0,R=t+168|0,_=t+164|0,z=t+156|0,H=t+88|0,K=t+4592|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+3|0,e[d>>2]=o,a=a+(C*3|0)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],r=e[$>>2]|0,l=o+(r*3|0)|0,o=o+((r+-1|0)*3|0)|0,S[l>>0]=S[o>>0]|0,S[l+1>>0]=S[o+1>>0]|0,S[l+2>>0]=S[o+2>>0]|0,o=e[d>>2]|0,l=(e[D>>2]|0)+-3|0,S[l>>0]=S[o>>0]|0,S[l+1>>0]=S[o+1>>0]|0,S[l+2>>0]=S[o+2>>0]|0,m=0,Ae(78,t|0,0),l=m,m=0,l&1){h=30;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P*3|0)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P*3|0)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+(((e[z>>2]|0)-w|0)*3|0)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){h=31;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){h=43;break e}}if((h|0)==30){a=j()|0;break}else if((h|0)==31){a=j()|0;break}}else h=43;while(!1);do if((h|0)==43){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}function hu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0;if(zt=b,b=b+16|0,re=zt+12|0,i0=zt+9|0,s0=zt+6|0,ce=zt+3|0,Ee=zt,ke=t+172|0,r=e[ke>>2]|0,(r|0)<=0){b=zt;return}for(Te=t+4600|0,it=t+4596|0,jt=t+4604|0,Gt=t+4592|0,ae=0;L=ae+-1|0,a=e[Te>>2]|0,l=a+(L*3|0)|0,gt=e[it>>2]|0,o=ae+1|0,h=N[gt+(ae*3|0)>>0]|0,ne=e[jt>>2]|0,d=N[gt+(L*3|0)>>0]|0,w=h-d|0,C=N[l>>0]|0,D=d-C|0,E=((((S[ne+((N[gt+(o*3|0)>>0]|0)-h)>>0]|0)*9|0)+(S[ne+w>>0]|0)|0)*9|0)+(S[ne+D>>0]|0)|0,F=N[gt+(ae*3|0)+1>>0]|0,R=N[gt+(L*3|0)+1>>0]|0,_=F-R|0,z=N[a+(L*3|0)+1>>0]|0,H=R-z|0,K=((((S[ne+((N[gt+(o*3|0)+1>>0]|0)-F)>>0]|0)*9|0)+(S[ne+_>>0]|0)|0)*9|0)+(S[ne+H>>0]|0)|0,G=N[gt+(ae*3|0)+2>>0]|0,$=N[gt+(L*3|0)+2>>0]|0,P=G-$|0,L=N[a+(L*3|0)+2>>0]|0,J=$-L|0,ne=((((S[ne+((N[gt+(o*3|0)+2>>0]|0)-G)>>0]|0)*9|0)+(S[ne+P>>0]|0)|0)*9|0)+(S[ne+J>>0]|0)|0,K|E|ne?(a=N[a+(ae*3|0)>>0]|0,r=h-C>>31,(r^D|0)>=0?(r^w|0)<0?r=C:r=C-d+h|0:r=h,h=rr(t,E,a,r,0)|0,a=N[(e[Te>>2]|0)+(ae*3|0)+1>>0]|0,r=F-z>>31,(r^H|0)>=0?(r^_|0)<0?r=z:r=z-R+F|0:r=F,a=rr(t,K,a,r,0)|0,l=N[(e[Te>>2]|0)+(ae*3|0)+2>>0]|0,r=G-L>>31,(r^J|0)>=0?(r^P|0)<0?r=L:r=L-$+G|0:r=G,ne=rr(t,ne,l,r,0)|0,gt=(e[Te>>2]|0)+(ae*3|0)|0,S[gt>>0]=h,S[gt+1>>0]=a,S[gt+2>>0]=ne):(S[s0>>0]=S[l>>0]|0,S[s0+1>>0]=S[l+1>>0]|0,S[s0+2>>0]=S[l+2>>0]|0,S[re>>0]=S[l>>0]|0,S[re+1>>0]=S[l+1>>0]|0,S[re+2>>0]=S[l+2>>0]|0,r=du(t,re,a+(ae*3|0)|0,r-ae|0)|0,o=r+ae|0,(o|0)!=(e[ke>>2]|0)&&(gt=(e[it>>2]|0)+(o*3|0)|0,S[Ee>>0]=S[gt>>0]|0,S[Ee+1>>0]=S[gt+1>>0]|0,S[Ee+2>>0]=S[gt+2>>0]|0,gt=e[Te>>2]|0,S[i0>>0]=S[s0>>0]|0,S[i0+1>>0]=S[s0+1>>0]|0,S[i0+2>>0]=S[s0+2>>0]|0,S[re>>0]=S[Ee>>0]|0,S[re+1>>0]=S[Ee+1>>0]|0,S[re+2>>0]=S[Ee+2>>0]|0,pu(ce,t,i0,re),gt=gt+(o*3|0)|0,S[gt>>0]=S[ce>>0]|0,S[gt+1>>0]=S[ce+1>>0]|0,S[gt+2>>0]=S[ce+2>>0]|0,gt=e[Gt>>2]|0,e[Gt>>2]=(gt|0)<1?0:gt+-1|0,r=r+1|0),o=r+ae|0),r=e[ke>>2]|0,!((o|0)>=(r|0));)ae=o;b=zt}function du(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4592|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0)return l|0;h=0;do R=o+(h*3|0)|0,S[R>>0]=S[r>>0]|0,S[R+1>>0]=S[r+1>>0]|0,S[R+2>>0]=S[r+2>>0]|0,h=h+1|0;while((h|0)!=(l|0));return l|0}function pu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(C=r+4568|0,F=or(r,C)|0,d=or(r,C)|0,C=or(r,C)|0,h=r+128|0,l=N[a>>0]|0,D=e[r+136>>2]|0,E=D<<1|1,l=(ie(ie(E,F)|0,l-(N[o>>0]|0)>>31|1)|0)+l|0,F=0-D|0,(l|0)>=(F|0)?(h=e[h>>2]|0,(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0)):(l=(ie(e[r+132>>2]|0,E)|0)+l|0,h=e[h>>2]|0),(l&h|0)!=(l|0)&&(l=h&~(l>>31)),w=l&255,l=N[a+1>>0]|0,l=(ie(ie(E,d)|0,l-(N[o+1>>0]|0)>>31|1)|0)+l|0,(l|0)>=(F|0)?(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0):l=(ie(e[r+132>>2]|0,E)|0)+l|0,(l&h|0)!=(l|0)&&(l=h&~(l>>31)),d=l&255,l=N[a+2>>0]|0,l=(ie(ie(E,C)|0,l-(N[o+2>>0]|0)>>31|1)|0)+l|0,(l|0)>=(F|0)?(h+D|0)<(l|0)&&(l=l-(ie(e[r+132>>2]|0,E)|0)|0):l=(ie(e[r+132>>2]|0,E)|0)+l|0,(l&h|0)==(l|0)){r=l,r=r&255,S[t>>0]=w,F=t+1|0,S[F>>0]=d,t=t+2|0,S[t>>0]=r;return}r=h&~(l>>31),r=r&255,S[t>>0]=w,F=t+1|0,S[F>>0]=d,t=t+2|0,S[t>>0]=r}function rr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(z=r>>31,C=(z^r)-z|0,R=t+188+(C*12|0)+10|0,o=k[R>>1]|0,F=t+188+(C*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(r=5;(o<>1]^z)-z+a|0,_=t+128|0,l=e[_>>2]|0,(o&l|0)==(o|0)?D=o:D=l&~(o>>31),o=t+112|0,(e[o>>2]|0)<8&&P0(t),l=t+108|0,a=e[l>>2]|0,h=a>>>24,d=e[2832+(r<<11)+(h<<3)+4>>2]|0,d?(e[o>>2]=(e[o>>2]|0)-d,e[l>>2]=a<>2]|0):(w=e[t+148>>2]|0,l=e[t+140>>2]|0,o=X0(t)|0,(o|0)<(w+-1-l|0)?r&&(o=(l0(t,r)|0)+(o<>31^o>>1,(((o|0)>-1?o:0-o|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),w=t+136|0,a=e[w>>2]|0,r?d=o:(a?l=0:l=(e[t+188+(C*12|0)+4>>2]<<1)+-1+(k[R>>1]|0)>>31,d=l^o),r=e[t+152>>2]|0,l=(e[F>>2]|0)+((d|0)>-1?d:0-d|0)|0,h=t+188+(C*12|0)+4|0,o=(e[h>>2]|0)+(ie(a<<1|1,d)|0)|0,a=k[R>>1]|0,(a|0)==(r|0)&&(l=l>>1,o=o>>1,a=r>>1),e[F>>2]=l,r=a+1|0,k[R>>1]=r,l=r+o|0,(l|0)>=1?(o|0)>0&&(o=o-r|0,R=k[E>>1]|0,k[E>>1]=(R<<16>>16<127&1)+(R&65535),o=(o|0)>0?0:o):(o=k[E>>1]|0,k[E>>1]=(o&65535)-(o<<16>>16>-128&1),o=(l|0)>(~a|0)?l:0-a|0),e[h>>2]=o,r=e[w>>2]|0,a=r<<1|1,l=(ie(a,(d^z)-z|0)|0)+D|0,(l|0)>=(0-r|0)?(o=e[_>>2]|0,(o+r|0)<(l|0)&&(l=l-(ie(e[t+132>>2]|0,a)|0)|0)):(l=(ie(e[t+132>>2]|0,a)|0)+l|0,o=e[_>>2]|0),(l&o|0)==(l|0)?(t=l,t=t&255,t|0):(t=o&~(l>>31),t=t&255,t|0)}function or(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=r+9|0,o=N[D>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;d=e[t+148>>2]|0,w=e[36476+(e[t+4592>>2]<<2)>>2]|0,o=e[t+140>>2]|0,l=X0(t)|0;do if((l|0)<(d+-2-w-o|0))if(a){w=(l0(t,a)|0)+(l<>2]|0,l=w+a|0,d=l&1,o=d,h=1,l=(d+l|0)/2|0;break}else{a=e[h>>2]|0,t=a+l|0,o=t&1,t=(o+t|0)/2|0,C=8;break}else l=(l0(t,o)|0)+1|0,d=e[h>>2]|0,t=l+d|0,o=t&1,t=(o+t|0)/2|0,a?(w=l,h=1,l=t,a=d):(a=d,C=8);while(!1);return(C|0)==8&&(w=l,h=N[r+10>>0]<<1>>>0>=(N[D>>0]|0)>>>0,l=t),l=(o|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(w+1-a>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[D>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(r=a,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[D>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=C,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0)}function mu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+136|0;e:do if(e[F>>2]|0)r=t+144|0;else if(o=e[t+128>>2]|0,r=t+144|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+176>>2]|0))&&(e[a+8>>2]|0)==(e[t+180>>2]|0)&&(e[a+12>>2]|0)==(e[t+184>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4604>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4604>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4604>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4604>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4608|0,a=E<<1,l=t+4612|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4604|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+184|0,C=t+180|0,d=t+176|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function gu(t){t=t|0;var r=0,o=0;e[t>>2]=35772,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Su(t){t=t|0;var r=0,o=0;if(e[t>>2]=35772,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Au(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function vu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,65535,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+152>>2]=d|0?d:e[w+4>>2]|0,e[t+156>>2]=h,e[t+160>>2]=a,ku(t),a=0;do e[t+164+(a*12|0)>>2]=1024,e[t+164+(a*12|0)+4>>2]=0,k[t+164+(a*12|0)+8>>1]=0,k[t+164+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4544>>2]=1024,e[t+4548>>2]=0,S[t+4552>>0]=w,S[t+4553>>0]=1,S[t+4554>>0]=0,e[t+4556>>2]=1024,e[t+4560>>2]=1,S[t+4564>>0]=w,S[t+4565>>0]=1,S[t+4566>>0]=0,e[t+4568>>2]=0,b=l}function xu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4596>>0]=l&1,r=t+132|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),wu(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function wu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+148|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,ae=m,m=0,!(ae&1))){e[re>>2]=a,ae=a+(r<<1)|0,e[re+8>>2]=ae,Jt(a|0,0,o|0)|0,e[ce>>2]=ae;break}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)d=18;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(d=16),(d|0)==16&&(l=L<<2,m=0,h=ge(67,l|0)|0,G=m,m=0,!(G&1))){e[J>>2]=h,d=h+(L<<2)|0,e[J+8>>2]=d,Jt(h|0,0,l|0)|0,e[ae>>2]=d,d=18;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4572|0,w=ie(L,P)|0,C=w+1|0,D=t+4576|0,E=(L|0)>0,F=t+136|0,R=t+144|0,_=t+140|0,z=t+132|0,H=t+88|0,K=t+4568|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+2|0,e[d>>2]=o,a=a+(C<<1)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],l=e[$>>2]|0,k[o+(l<<1)>>1]=k[o+(l+-1<<1)>>1]|0,k[r+-2>>1]=k[o>>1]|0,m=0,Ae(79,t|0,0),l=m,m=0,l&1){d=29;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P<<1)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P<<1)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+((e[z>>2]|0)-w<<1)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){d=30;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){d=42;break e}}if((d|0)==29){a=j()|0;break}else if((d|0)==30){a=j()|0;break}}else d=42;while(!1);do if((d|0)==42){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function yu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=t+4572|0,r=e[F>>2]|0,z=t+148|0,!((e[z>>2]|0)<=0))for(R=t+4576|0,_=t+4580|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=Cu(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(Tu(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[z>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function Cu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(_=r>>31,D=(_^r)-_|0,R=t+164+(D*12|0)+10|0,o=k[R>>1]|0,F=t+164+(D*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(h=5;(o<>1]^_)-_+a|0,(o&65535|0)!=(o|0)&&(o=o>>31&65535^65535),l=t+112|0,(e[l>>2]|0)<8&&P0(t),a=t+108|0,d=e[a>>2]|0,w=d>>>24,C=e[2832+(h<<11)+(w<<3)+4>>2]|0,C?(e[l>>2]=(e[l>>2]|0)-C,e[a>>2]=d<>2]|0):(l=X0(t)|0,(l|0)<47?h&&(l=(l0(t,h)|0)+(l<>31^l>>1,(((l|0)>-1?l:0-l|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96))),C=t+164+(D*12|0)+4|0,a=e[C>>2]|0,h?h=k[R>>1]|0:(t=k[R>>1]|0,h=t,l=(a<<1)+-1+(t<<16>>16)>>31^l),d=h<<16>>16==64,t=d&1,w=a+l>>t,d=d?32:h<<16>>16,e[F>>2]=((l|0)>-1?l:0-l|0)+(e[F>>2]|0)>>t,a=d+1|0,k[R>>1]=a,h=a+w|0,(h|0)<1?(R=k[E>>1]|0,k[E>>1]=(R&65535)-(R<<16>>16>-128&1),R=(h|0)>(~d|0)?h:0-d|0,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&65535,r|0):(w|0)<=0?(R=w,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&65535,r|0):(R=w-a|0,F=k[E>>1]|0,k[E>>1]=(F<<16>>16<127&1)+(F&65535),R=(R|0)>0?0:R,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&65535,r|0)}function Tu(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=t+4576|0,l=e[h>>2]|0,o=k[l+(r+-1<<1)>>1]|0,d=t+148|0,l=Iu(t,o,l+(r<<1)|0,(e[d>>2]|0)-r|0)|0,a=l+r|0,(a|0)==(e[d>>2]|0)?(d=l,d|0):(o=o&65535,r=M[(e[t+4572>>2]|0)+(a<<1)>>1]|0,d=o-r|0,(((d|0)>-1?d:0-d|0)|0)<1?o=(ys(t,t+4556|0)|0)+o|0:o=(ie(ys(t,t+4544|0)|0,r-o>>31|1)|0)+r|0,k[(e[h>>2]|0)+(a<<1)>>1]=o,d=t+4568|0,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,d=l+1|0,d|0)}function Iu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4568|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)>0)h=0;else return l|0;do k[o+(h<<1)>>1]=r,h=h+1|0;while((h|0)!=(l|0));return l|0}function ys(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(w=r+9|0,o=N[w>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;l=e[36476+(e[t+4568>>2]<<2)>>2]|0,o=X0(t)|0;do if((o|0)<(46-l|0))if(a){o=(l0(t,a)|0)+(o<>2]|0,l=o+t|0,C=l&1,a=C,h=1,l=(C+l|0)/2|0;break}else{t=e[h>>2]|0,l=t+o|0,a=l&1,l=(a+l|0)/2|0,d=8;break}else o=(l0(t,16)|0)+1|0,t=e[h>>2]|0,l=o+t|0,h=l&1,l=(h+l|0)/2|0,a?(a=h,h=1):(a=h,d=8);while(!1);return(d|0)==8&&(h=N[r+10>>0]<<1>>>0>=(N[w>>0]|0)>>>0),l=(a|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(o+1-t>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[w>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(C=a,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[w>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0)}function ku(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,65535,0),C=t+152|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+156>>2]|0)&&(e[w+12>>2]|0)==(e[t+160>>2]|0)){C=e[8909]|0,e[t+4580>>2]=C+(((e[8910]|0)-C|0)>>>1),b=D;return}for(o=t+4584|0,a=t+4588|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=131072?h>>>0>131072&&(d=r+131072|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,131072-h|0),r=e[o>>2]|0),w=t+4580|0,e[w>>2]=r+65536,d=t+160|0,l=t+156|0,h=-65536;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==65536)break}b=D}function Eu(t){t=t|0;var r=0,o=0;e[t>>2]=35744,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Du(t){t=t|0;var r=0,o=0;if(e[t>>2]=35744,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function bu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(37,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==16)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(38,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(39,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(40,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=2,e[a+12>>2]=t,L=a,b=G,L|0)}function Fu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,4095,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+152>>2]=d|0?d:e[w+4>>2]|0,e[t+156>>2]=h,e[t+160>>2]=a,Ou(t),a=0;do e[t+164+(a*12|0)>>2]=64,e[t+164+(a*12|0)+4>>2]=0,k[t+164+(a*12|0)+8>>1]=0,k[t+164+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4544>>2]=64,e[t+4548>>2]=0,S[t+4552>>0]=w,S[t+4553>>0]=1,S[t+4554>>0]=0,e[t+4556>>2]=64,e[t+4560>>2]=1,S[t+4564>>0]=w,S[t+4565>>0]=1,S[t+4566>>0]=0,e[t+4568>>2]=0,b=l}function Nu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4596>>0]=l&1,r=t+132|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),Ru(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function Ru(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+148|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(d=6),(d|0)==6&&(o=r<<1,m=0,a=ge(67,o|0)|0,ae=m,m=0,!(ae&1))){e[re>>2]=a,ae=a+(r<<1)|0,e[re+8>>2]=ae,Jt(a|0,0,o|0)|0,e[ce>>2]=ae;break}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)d=18;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(d=16),(d|0)==16&&(l=L<<2,m=0,h=ge(67,l|0)|0,G=m,m=0,!(G&1))){e[J>>2]=h,d=h+(L<<2)|0,e[J+8>>2]=d,Jt(h|0,0,l|0)|0,e[ae>>2]=d,d=18;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((d|0)==18){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4572|0,w=ie(L,P)|0,C=w+1|0,D=t+4576|0,E=(L|0)>0,F=t+136|0,R=t+144|0,_=t+140|0,z=t+132|0,H=t+88|0,K=t+4568|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+2|0,e[d>>2]=o,a=a+(C<<1)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],l=e[$>>2]|0,k[o+(l<<1)>>1]=k[o+(l+-1<<1)>>1]|0,k[r+-2>>1]=k[o>>1]|0,m=0,Ae(80,t|0,0),l=m,m=0,l&1){d=29;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P<<1)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P<<1)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+((e[z>>2]|0)-w<<1)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){d=30;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){d=42;break e}}if((d|0)==29){a=j()|0;break}else if((d|0)==30){a=j()|0;break}}else d=42;while(!1);do if((d|0)==42){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~((o+-2-r|0)>>>1)<<1)),he(r),le(a|0)}function Mu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=t+4572|0,r=e[F>>2]|0,z=t+148|0,!((e[z>>2]|0)<=0))for(R=t+4576|0,_=t+4580|0,l=r,h=M[r+-2>>1]|0,r=M[r>>1]|0,E=0;D=e[R>>2]|0,C=M[D+(E+-1<<1)>>1]|0,a=E+1|0,o=M[l+(a<<1)>>1]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=_u(t,w,M[D+(E<<1)>>1]|0,l,0)|0,k[(e[R>>2]|0)+(E<<1)>>1]=D):(a=(Pu(t,E,0)|0)+E|0,o=e[F>>2]|0,r=M[o+(a+-1<<1)>>1]|0,o=M[o+(a<<1)>>1]|0),!((a|0)>=(e[z>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function _u(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(_=r>>31,D=(_^r)-_|0,R=t+164+(D*12|0)+10|0,o=k[R>>1]|0,F=t+164+(D*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(h=5;(o<>1]^_)-_+a|0,(o&4095|0)!=(o|0)&&(o=o>>31&4095^4095),l=t+112|0,(e[l>>2]|0)<8&&P0(t),a=t+108|0,d=e[a>>2]|0,w=d>>>24,C=e[2832+(h<<11)+(w<<3)+4>>2]|0,C?(e[l>>2]=(e[l>>2]|0)-C,e[a>>2]=d<>2]|0):(l=X0(t)|0,(l|0)<35?h&&(l=(l0(t,h)|0)+(l<>31^l>>1,(((l|0)>-1?l:0-l|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96))),C=t+164+(D*12|0)+4|0,a=e[C>>2]|0,h?h=k[R>>1]|0:(t=k[R>>1]|0,h=t,l=(a<<1)+-1+(t<<16>>16)>>31^l),d=h<<16>>16==64,t=d&1,w=a+l>>t,d=d?32:h<<16>>16,e[F>>2]=((l|0)>-1?l:0-l|0)+(e[F>>2]|0)>>t,a=d+1|0,k[R>>1]=a,h=a+w|0,(h|0)<1?(R=k[E>>1]|0,k[E>>1]=(R&65535)-(R<<16>>16>-128&1),R=(h|0)>(~d|0)?h:0-d|0,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&4095,r=r&65535,r|0):(w|0)<=0?(R=w,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&4095,r=r&65535,r|0):(R=w-a|0,F=k[E>>1]|0,k[E>>1]=(F<<16>>16<127&1)+(F&65535),R=(R|0)>0?0:R,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&4095,r=r&65535,r|0)}function Pu(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=t+4576|0,l=e[h>>2]|0,o=k[l+(r+-1<<1)>>1]|0,d=t+148|0,l=Lu(t,o,l+(r<<1)|0,(e[d>>2]|0)-r|0)|0,a=l+r|0,(a|0)==(e[d>>2]|0)?(d=l,d|0):(o=o&65535,r=M[(e[t+4572>>2]|0)+(a<<1)>>1]|0,d=o-r|0,(((d|0)>-1?d:0-d|0)|0)<1?o=(Cs(t,t+4556|0)|0)+o|0:o=(ie(Cs(t,t+4544|0)|0,r-o>>31|1)|0)+r|0,k[(e[h>>2]|0)+(a<<1)>>1]=o&4095,d=t+4568|0,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,d=l+1|0,d|0)}function Lu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4568|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)>0)h=0;else return l|0;do k[o+(h<<1)>>1]=r,h=h+1|0;while((h|0)!=(l|0));return l|0}function Cs(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(w=r+9|0,o=N[w>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;l=e[36476+(e[t+4568>>2]<<2)>>2]|0,o=X0(t)|0;do if((o|0)<(34-l|0))if(a){o=(l0(t,a)|0)+(o<>2]|0,l=o+t|0,C=l&1,a=C,h=1,l=(C+l|0)/2|0;break}else{t=e[h>>2]|0,l=t+o|0,a=l&1,l=(a+l|0)/2|0,d=8;break}else o=(l0(t,12)|0)+1|0,t=e[h>>2]|0,l=o+t|0,h=l&1,l=(h+l|0)/2|0,a?(a=h,h=1):(a=h,d=8);while(!1);return(d|0)==8&&(h=N[r+10>>0]<<1>>>0>=(N[w>>0]|0)>>>0),l=(a|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(o+1-t>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[w>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(C=a,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[w>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0)}function Ou(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,4095,0),C=t+152|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+156>>2]|0)&&(e[w+12>>2]|0)==(e[t+160>>2]|0)){C=e[8906]|0,e[t+4580>>2]=C+(((e[8907]|0)-C|0)>>>1),b=D;return}for(o=t+4584|0,a=t+4588|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=8192?h>>>0>8192&&(d=r+8192|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,8192-h|0),r=e[o>>2]|0),w=t+4580|0,e[w>>2]=r+4096,d=t+160|0,l=t+156|0,h=-4096;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==4096)break}b=D}function $u(t){t=t|0;var r=0,o=0;e[t>>2]=35716,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function Bu(t){t=t|0;var r=0,o=0;if(e[t>>2]=35716,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Vu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0)}function Uu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,255,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+152>>2]=d|0?d:e[w+4>>2]|0,e[t+156>>2]=h,e[t+160>>2]=a,Ku(t),a=0;do e[t+164+(a*12|0)>>2]=4,e[t+164+(a*12|0)+4>>2]=0,k[t+164+(a*12|0)+8>>1]=0,k[t+164+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4544>>2]=4,e[t+4548>>2]=0,S[t+4552>>0]=w,S[t+4553>>0]=1,S[t+4554>>0]=0,e[t+4556>>2]=4,e[t+4560>>2]=1,S[t+4564>>0]=w,S[t+4565>>0]=1,S[t+4566>>0]=0,e[t+4568>>2]=0,b=l}function zu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4596>>0]=l&1,r=t+132|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),Gu(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function Gu(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+148|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;e:do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,e[re+8>>2]=o+r;;)if(S[o>>0]=0,o=(e[ce>>2]|0)+1|0,e[ce>>2]=o,r=r+-1|0,!r)break e}o=j()|0,r=e[re>>2]|0,r||le(o|0),(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),le(o|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)h=19;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(h=17),(h|0)==17&&(a=L<<2,m=0,l=ge(67,a|0)|0,G=m,m=0,!(G&1))){e[J>>2]=l,h=l+(L<<2)|0,e[J+8>>2]=h,Jt(l|0,0,a|0)|0,e[ae>>2]=h,h=19;break}o=j()|0,r=e[J>>2]|0,a=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4572|0,w=ie(L,P)|0,C=w+1|0,D=t+4576|0,E=(L|0)>0,F=t+136|0,R=t+144|0,_=t+140|0,z=t+132|0,H=t+88|0,K=t+4568|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+1|0,e[d>>2]=o,a=a+C|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],l=e[$>>2]|0,S[o+l>>0]=S[o+(l+-1)>>0]|0,S[(e[D>>2]|0)+-1>>0]=S[e[d>>2]>>0]|0,m=0,Ae(81,t|0,0),l=m,m=0,l&1){h=30;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+P|0,e[d>>2]=o,r=(e[D>>2]|0)+P|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+((e[z>>2]|0)-w)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){h=31;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){h=43;break e}}if((h|0)==30){o=j()|0;break}else if((h|0)==31){o=j()|0;break}}else h=43;while(!1);do if((h|0)==43){if(m=0,ue(183,t|0),t=m,m=0,t&1){o=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),b=ne;return}while(!1);r=e[J>>2]|0,a=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(o|0),(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),le(o|0)}function qu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=t+4572|0,r=e[F>>2]|0,z=t+148|0,!((e[z>>2]|0)<=0))for(R=t+4576|0,_=t+4580|0,l=r,h=N[r+-1>>0]|0,r=N[r>>0]|0,E=0;D=e[R>>2]|0,C=N[D+(E+-1)>>0]|0,a=E+1|0,o=N[l+a>>0]|0,w=e[_>>2]|0,d=r-h|0,l=h-C|0,w=((((S[w+(o-r)>>0]|0)*9|0)+(S[w+d>>0]|0)|0)*9|0)+(S[w+l>>0]|0)|0,w?(h=r-C>>31,(h^l|0)<0?l=r:l=C+((h^d|0)<0?0:d)|0,D=Wu(t,w,N[D+E>>0]|0,l,0)|0,S[(e[R>>2]|0)+E>>0]=D):(a=(Hu(t,E,0)|0)+E|0,o=e[F>>2]|0,r=N[o+(a+-1)>>0]|0,o=N[o+a>>0]|0),!((a|0)>=(e[z>>2]|0));)l=e[F>>2]|0,h=r,r=o,E=a}function Wu(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(_=r>>31,D=(_^r)-_|0,R=t+164+(D*12|0)+10|0,o=k[R>>1]|0,F=t+164+(D*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(h=5;(o<>1]^_)-_+a|0,(o&255|0)!=(o|0)&&(o=o>>31&255^255),l=t+112|0,(e[l>>2]|0)<8&&P0(t),a=t+108|0,d=e[a>>2]|0,w=d>>>24,C=e[2832+(h<<11)+(w<<3)+4>>2]|0,C?(e[l>>2]=(e[l>>2]|0)-C,e[a>>2]=d<>2]|0):(l=X0(t)|0,(l|0)<23?h&&(l=(l0(t,h)|0)+(l<>31^l>>1,(((l|0)>-1?l:0-l|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96))),C=t+164+(D*12|0)+4|0,a=e[C>>2]|0,h?h=k[R>>1]|0:(t=k[R>>1]|0,h=t,l=(a<<1)+-1+(t<<16>>16)>>31^l),d=h<<16>>16==64,t=d&1,w=a+l>>t,d=d?32:h<<16>>16,e[F>>2]=((l|0)>-1?l:0-l|0)+(e[F>>2]|0)>>t,a=d+1|0,k[R>>1]=a,h=a+w|0,(h|0)<1?(R=k[E>>1]|0,k[E>>1]=(R&65535)-(R<<16>>16>-128&1),R=(h|0)>(~d|0)?h:0-d|0,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0):(w|0)<=0?(R=w,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0):(R=w-a|0,F=k[E>>1]|0,k[E>>1]=(F<<16>>16<127&1)+(F&65535),R=(R|0)>0?0:R,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0)}function Hu(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=t+4576|0,l=e[h>>2]|0,o=S[l+(r+-1)>>0]|0,d=t+148|0,l=Qu(t,o,l+r|0,(e[d>>2]|0)-r|0)|0,a=l+r|0,(a|0)==(e[d>>2]|0)?(d=l,d|0):(o=o&255,r=N[(e[t+4572>>2]|0)+a>>0]|0,d=o-r|0,(((d|0)>-1?d:0-d|0)|0)<1?o=(Ts(t,t+4556|0)|0)+o|0:o=(ie(Ts(t,t+4544|0)|0,r-o>>31|1)|0)+r|0,S[(e[h>>2]|0)+a>>0]=o,d=t+4568|0,t=e[d>>2]|0,e[d>>2]=(t|0)<1?0:t+-1|0,d=l+1|0,d|0)}function Qu(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4568|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}return(E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0||Jt(o|0,r|0,l|0)|0,l|0}function Ts(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(w=r+9|0,o=N[w>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;l=e[36476+(e[t+4568>>2]<<2)>>2]|0,o=X0(t)|0;do if((o|0)<(22-l|0))if(a){o=(l0(t,a)|0)+(o<>2]|0,l=o+t|0,C=l&1,a=C,h=1,l=(C+l|0)/2|0;break}else{t=e[h>>2]|0,l=t+o|0,a=l&1,l=(a+l|0)/2|0,d=8;break}else o=(l0(t,8)|0)+1|0,t=e[h>>2]|0,l=o+t|0,h=l&1,l=(h+l|0)/2|0,a?(a=h,h=1):(a=h,d=8);while(!1);return(d|0)==8&&(h=N[r+10>>0]<<1>>>0>=(N[w>>0]|0)>>>0),l=(a|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(o+1-t>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[w>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(C=a,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[w>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0)}function Ku(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,255,0),C=t+152|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+156>>2]|0)&&(e[w+12>>2]|0)==(e[t+160>>2]|0)){C=e[8900]|0,e[t+4580>>2]=C+(((e[8901]|0)-C|0)>>>1),b=D;return}for(o=t+4584|0,a=t+4588|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=512?h>>>0>512&&(d=r+512|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,512-h|0),r=e[o>>2]|0),w=t+4580|0,e[w>>2]=r+256,d=t+160|0,l=t+156|0,h=-256;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==256)break}b=D}function Yu(t){t=t|0;var r=0,o=0;e[t>>2]=35688,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function ju(t){t=t|0;var r=0,o=0;if(e[t>>2]=35688,r=e[t+4584>>2]|0,r&&(o=t+4588|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Xu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=3,e[a+12>>2]=t,L=a,b=G,L|0)}function Zu(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+32|0,w=l,m0(w,255,0),d=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[w+8>>2]|0,a=e[r+12>>2]|0,a=a|0?a:e[w+12>>2]|0,r=e[r+16>>2]|0,o=e[w+16>>2]|0,e[t+152>>2]=d|0?d:e[w+4>>2]|0,e[t+156>>2]=h,e[t+160>>2]=a,q5(t),a=0;do e[t+164+(a*12|0)>>2]=4,e[t+164+(a*12|0)+4>>2]=0,k[t+164+(a*12|0)+8>>1]=0,k[t+164+(a*12|0)+10>>1]=1,a=a+1|0;while((a|0)!=365);w=(r|0?r:o)&255,e[t+4544>>2]=4,e[t+4548>>2]=0,S[t+4552>>0]=w,S[t+4553>>0]=1,S[t+4554>>0]=0,e[t+4556>>2]=4,e[t+4560>>2]=1,S[t+4564>>0]=w,S[t+4565>>0]=1,S[t+4566>>0]=0,e[t+4568>>2]=0,b=l}function Ju(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4596>>0]=l&1,r=t+132|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),tc(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function tc(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,$=t+148|0,P=(e[$>>2]|0)+4|0,(e[t+28>>2]|0)==1?L=e[t+20>>2]|0:L=1,r=ie(L<<1,P)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;e:do if(r){if(r>>>0>1431655765&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(h=6),(h|0)==6&&(m=0,o=ge(67,r*3|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,e[re+8>>2]=o+(r*3|0);;)if(S[o>>0]=0,S[o+1>>0]=0,S[o+2>>0]=0,o=(e[ce>>2]|0)+3|0,e[ce>>2]=o,r=r+-1|0,!r)break e}a=j()|0,r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!L)h=19;else{if(L>>>0>1073741823&&(m=0,ue(178,J|0),G=m,m=0,G&1)||(h=17),(h|0)==17&&(a=L<<2,m=0,l=ge(67,a|0)|0,G=m,m=0,!(G&1))){e[J>>2]=l,h=l+(L<<2)|0,e[J+8>>2]=h,Jt(l|0,0,a|0)|0,e[ae>>2]=h,h=19;break}a=j()|0,r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}while(!1);if((h|0)==19){h=t+8|0;e:do if((e[h>>2]|0)>0){d=t+4572|0,w=ie(L,P)|0,C=w+1|0,D=t+4576|0,E=(L|0)>0,F=t+136|0,R=t+144|0,_=t+140|0,z=t+132|0,H=t+88|0,K=t+4568|0,G=0;t:for(;;){if(a=e[re>>2]|0,o=a+3|0,e[d>>2]=o,a=a+(C*3|0)|0,e[D>>2]=a,G&1?(e[d>>2]=a,e[D>>2]=o,r=o,o=a):r=a,E){l=e[J>>2]|0,a=0;do{if(e[K>>2]=e[l+(a<<2)>>2],r=e[$>>2]|0,l=o+(r*3|0)|0,o=o+((r+-1|0)*3|0)|0,S[l>>0]=S[o>>0]|0,S[l+1>>0]=S[o+1>>0]|0,S[l+2>>0]=S[o+2>>0]|0,o=e[d>>2]|0,l=(e[D>>2]|0)+-3|0,S[l>>0]=S[o>>0]|0,S[l+1>>0]=S[o+1>>0]|0,S[l+2>>0]=S[o+2>>0]|0,m=0,Ae(82,t|0,0),l=m,m=0,l&1){h=30;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[K>>2],o=(e[d>>2]|0)+(P*3|0)|0,e[d>>2]=o,r=(e[D>>2]|0)+(P*3|0)|0,e[D>>2]=r,a=a+1|0}while((a|0)<(L|0))}if(l=e[F>>2]|0,(l|0)<=(G|0)&&(G|0)<((e[R>>2]|0)+l|0)&&(l=e[H>>2]|0,m=0,$e(e[(e[l>>2]|0)+8>>2]|0,l|0,r+(((e[z>>2]|0)-w|0)*3|0)|0,e[_>>2]|0,P|0),l=m,m=0,l&1)){h=31;break}if(G=G+1|0,(G|0)>=(e[h>>2]|0)){h=43;break e}}if((h|0)==30){a=j()|0;break}else if((h|0)==31){a=j()|0;break}}else h=43;while(!1);do if((h|0)==43){if(m=0,ue(183,t|0),t=m,m=0,t&1){a=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),b=ne;return}while(!1);r=e[J>>2]|0,o=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-o|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(a|0),o=e[ce>>2]|0,(o|0)!=(r|0)&&(e[ce>>2]=o+(~(((o+-3-r|0)>>>0)/3|0)*3|0)),he(r),le(a|0)}function ic(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0;if(ae=t+148|0,!((e[ae>>2]|0)<=0))for(re=t+4576|0,ce=t+4572|0,Ee=t+4580|0,ne=0;P=ne+-1|0,h=e[re>>2]|0,d=e[ce>>2]|0,r=ne+1|0,l=N[d+(ne*3|0)>>0]|0,J=e[Ee>>2]|0,w=N[d+(P*3|0)>>0]|0,C=l-w|0,D=N[h+(P*3|0)>>0]|0,E=w-D|0,F=((((S[J+((N[d+(r*3|0)>>0]|0)-l)>>0]|0)*9|0)+(S[J+C>>0]|0)|0)*9|0)+(S[J+E>>0]|0)|0,a=N[d+(ne*3|0)+1>>0]|0,R=N[d+(P*3|0)+1>>0]|0,_=a-R|0,z=N[h+(P*3|0)+1>>0]|0,H=R-z|0,K=((((S[J+((N[d+(r*3|0)+1>>0]|0)-a)>>0]|0)*9|0)+(S[J+_>>0]|0)|0)*9|0)+(S[J+H>>0]|0)|0,o=N[d+(ne*3|0)+2>>0]|0,G=N[d+(P*3|0)+2>>0]|0,$=o-G|0,P=N[h+(P*3|0)+2>>0]|0,L=G-P|0,J=((((S[J+((N[d+(r*3|0)+2>>0]|0)-o)>>0]|0)*9|0)+(S[J+$>>0]|0)|0)*9|0)+(S[J+L>>0]|0)|0,K|F|J?(d=N[h+(ne*3|0)>>0]|0,h=l-D>>31,(h^E|0)>=0&&((h^C|0)<0?l=D:l=D-w+l|0),d=ar(t,F,d,l,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+1>>0]|0,l=a-z>>31,(l^H|0)>=0&&((l^_|0)<0?a=z:a=z-R+a|0),l=ar(t,K,h,a,0)|0,h=N[(e[re>>2]|0)+(ne*3|0)+2>>0]|0,a=o-P>>31,(a^L|0)>=0&&((a^$|0)<0?o=P:o=P-G+o|0),J=ar(t,J,h,o,0)|0,ne=(e[re>>2]|0)+(ne*3|0)|0,S[ne>>0]=d,S[ne+1>>0]=l,S[ne+2>>0]=J):r=(nc(t,ne,0)|0)+ne|0,(r|0)<(e[ae>>2]|0);)ne=r}function nc(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;return C=b,b=b+16|0,E=C+3|0,F=C,h=t+4576|0,o=e[h>>2]|0,a=o+((r+-1|0)*3|0)|0,d=S[a>>0]|0,w=S[a+1>>0]|0,a=S[a+2>>0]|0,S[F>>0]=d,S[F+1>>0]=w,S[F+2>>0]=a,D=t+148|0,l=(e[D>>2]|0)-r|0,S[E>>0]=S[F>>0]|0,S[E+1>>0]=S[F+1>>0]|0,S[E+2>>0]=S[F+2>>0]|0,l=rc(t,E,o+(r*3|0)|0,l)|0,o=l+r|0,(o|0)==(e[D>>2]|0)?(F=l,b=C,F|0):(E=(e[t+4572>>2]|0)+(o*3|0)|0,r=S[E>>0]|0,D=S[E+1>>0]|0,E=S[E+2>>0]|0,F=e[h>>2]|0,h=t+4544|0,_=lr(t,h)|0,R=lr(t,h)|0,r=r&255,r=(ie(r-(d&255)>>31|1,_)|0)+r&255,D=D&255,D=(ie(D-(w&255)>>31|1,R)|0)+D&255,E=E&255,E=(ie(E-(a&255)>>31|1,lr(t,h)|0)|0)+E&255,F=F+(o*3|0)|0,S[F>>0]=r,S[F+1>>0]=D,S[F+2>>0]=E,F=t+4568|0,E=e[F>>2]|0,e[F>>2]=(E|0)<1?0:E+-1|0,F=l+1|0,b=C,F|0)}function ar(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(_=r>>31,D=(_^r)-_|0,R=t+164+(D*12|0)+10|0,o=k[R>>1]|0,F=t+164+(D*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(h=5;(o<>1]^_)-_+a|0,(o&255|0)!=(o|0)&&(o=o>>31&255^255),l=t+112|0,(e[l>>2]|0)<8&&P0(t),a=t+108|0,d=e[a>>2]|0,w=d>>>24,C=e[2832+(h<<11)+(w<<3)+4>>2]|0,C?(e[l>>2]=(e[l>>2]|0)-C,e[a>>2]=d<>2]|0):(l=X0(t)|0,(l|0)<23?h&&(l=(l0(t,h)|0)+(l<>31^l>>1,(((l|0)>-1?l:0-l|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96))),C=t+164+(D*12|0)+4|0,a=e[C>>2]|0,h?h=k[R>>1]|0:(t=k[R>>1]|0,h=t,l=(a<<1)+-1+(t<<16>>16)>>31^l),d=h<<16>>16==64,t=d&1,w=a+l>>t,d=d?32:h<<16>>16,e[F>>2]=((l|0)>-1?l:0-l|0)+(e[F>>2]|0)>>t,a=d+1|0,k[R>>1]=a,h=a+w|0,(h|0)<1?(R=k[E>>1]|0,k[E>>1]=(R&65535)-(R<<16>>16>-128&1),R=(h|0)>(~d|0)?h:0-d|0,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0):(w|0)<=0?(R=w,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0):(R=w-a|0,F=k[E>>1]|0,k[E>>1]=(F<<16>>16<127&1)+(F&65535),R=(R|0)>0?0:R,e[C>>2]=R,_=l^_,r=r>>>31,r=o+r|0,r=r+_|0,r=r&255,r|0)}function rc(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4568|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}if((E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0)return l|0;h=0;do R=o+(h*3|0)|0,S[R>>0]=S[r>>0]|0,S[R+1>>0]=S[r+1>>0]|0,S[R+2>>0]=S[r+2>>0]|0,h=h+1|0;while((h|0)!=(l|0));return l|0}function lr(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(w=r+9|0,o=N[w>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;l=e[36476+(e[t+4568>>2]<<2)>>2]|0,o=X0(t)|0;do if((o|0)<(22-l|0))if(a){o=(l0(t,a)|0)+(o<>2]|0,l=o+t|0,C=l&1,a=C,h=1,l=(C+l|0)/2|0;break}else{t=e[h>>2]|0,l=t+o|0,a=l&1,l=(a+l|0)/2|0,d=8;break}else o=(l0(t,8)|0)+1|0,t=e[h>>2]|0,l=o+t|0,h=l&1,l=(h+l|0)/2|0,a?(a=h,h=1):(a=h,d=8);while(!1);return(d|0)==8&&(h=N[r+10>>0]<<1>>>0>=(N[w>>0]|0)>>>0),l=(a|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(o+1-t>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[w>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(C=a,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[w>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,C=C&255,C=C+1|0,C=C&255,S[w>>0]=C,l|0)}function sc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+128|0,h=E,R=E+116|0,_=E+104|0,w=E+20|0,D=E+16|0,C=E+12|0,F=E+8|0,d=E+4|0,S[R>>0]=S[58887]|0,S[R+1>>0]=S[58888]|0,S[R+2>>0]=S[58889]|0,S[R+3>>0]=S[58890]|0,S[R+4>>0]=S[58891]|0,S[R+5>>0]=S[58892]|0,Ei(R+1|0,58893,0,e[o+4>>2]|0),t=b0()|0,e[h>>2]=l,l=_+(q0(_,12,t,R,h)|0)|0,R=ri(_,l,o)|0,t=f0(o)|0,e[F>>2]=t,m=0,dt(3,_|0,R|0,l|0,w|0,D|0,C|0,F|0),l=m,m=0,l&1)_=j()|0,Bt(t)|0,le(_|0);else return Bt(t)|0,e[d>>2]=e[r>>2],R=e[D>>2]|0,_=e[C>>2]|0,e[h>>2]=e[d>>2],_=Hi(h,w,R,_,o,a)|0,b=E,_|0;return 0}function oc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(F=b,b=b+240|0,d=F+8|0,t=F,_=F+204|0,C=F+32|0,E=F+28|0,D=F+24|0,R=F+20|0,w=F+16|0,z=t,e[z>>2]=37,e[z+4>>2]=0,Ei(t+1|0,58895,0,e[o+4>>2]|0),z=b0()|0,H=d,e[H>>2]=l,e[H+4>>2]=h,h=_+(q0(_,23,z,t,d)|0)|0,l=ri(_,h,o)|0,t=f0(o)|0,e[R>>2]=t,m=0,dt(3,_|0,l|0,h|0,C|0,E|0,D|0,R|0),h=m,m=0,h&1)H=j()|0,Bt(t)|0,le(H|0);else return Bt(t)|0,e[w>>2]=e[r>>2],z=e[E>>2]|0,H=e[D>>2]|0,e[d>>2]=e[w>>2],H=Hi(d,C,z,H,o,a)|0,b=F,H|0;return 0}function ac(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=+l;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;J=b,b=b+352|0,K=J+312|0,R=J+48|0,F=J+32|0,C=J+24|0,h=J+8|0,E=J,z=J+316|0,H=J+80|0,w=J+84|0,L=J+76|0,P=J+72|0,G=J+68|0,$=J+64|0,D=E,e[D>>2]=37,e[D+4>>2]=0,D=gn(E+1|0,58898,e[o+4>>2]|0)|0,e[H>>2]=z,t=b0()|0,D?(e[h>>2]=e[o+8>>2],B[h+8>>3]=l,h=q0(z,30,t,E,h)|0):(B[C>>3]=l,h=q0(z,30,t,E,C)|0);e:do if((h|0)>29){m=0,t=Ce(3)|0,h=m,m=0,h=h&1,D?!h&&(m=0,e[F>>2]=e[o+8>>2],B[F+8>>3]=l,d=Pe(17,H|0,t|0,E|0,F|0)|0,_=m,m=0,!(_&1))&&(ne=12):!h&&(m=0,e[R>>2]=e[o+8>>2],B[R+8>>3]=l,_=Pe(17,H|0,t|0,E|0,R|0)|0,R=m,m=0,!(R&1))&&(d=_,ne=12);do if((ne|0)==12){if(t=e[H>>2]|0,t)h=t;else{if(m=0,bt(6),_=m,m=0,_&1)break;h=e[H>>2]|0}t=h,E=h,ne=16;break e}while(!1);t=j()|0}else t=e[H>>2]|0,E=0,d=h,ne=16;while(!1);if((ne|0)==16){C=t+d|0,D=ri(t,C,o)|0;do if((t|0)==(z|0))t=z,h=0,ne=22;else{if(d=E0(d<<3)|0,!d){if(m=0,bt(6),ne=m,m=0,ne&1){h=0,ne=20;break}t=e[H>>2]|0}h=d,w=d,ne=22}while(!1);do if((ne|0)==22)if(m=0,d=ge(68,o|0)|0,H=m,m=0,H&1)ne=20;else{if(e[G>>2]=d,m=0,dt(4,t|0,D|0,C|0,w|0,L|0,P|0,G|0),G=m,m=0,G&1){t=j()|0,Bt(d)|0;break}if(Bt(d)|0,e[$>>2]=e[r>>2],ne=e[L>>2]|0,t=e[P>>2]|0,m=0,e[K>>2]=e[$>>2],t=Vt(40,K|0,w|0,ne|0,t|0,o|0,a|0)|0,ne=m,m=0,ne&1)ne=20;else return e[r>>2]=t,h&&n0(h),E&&n0(E),b=J,t|0}while(!1);(ne|0)==20&&(t=j()|0),h&&n0(h),E&&n0(E)}return le(t|0),0}function uc(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;switch(L=b,b=b+16|0,J=L,P=O0(d,44212)|0,G=O0(d,44368)|0,t0[e[(e[G>>2]|0)+20>>2]&127](J,G),e[h>>2]=a,d=S[t>>0]|0,d<<24>>24){case 43:case 45:{m=0,d=Ne(e[(e[P>>2]|0)+44>>2]|0,P|0,d|0)|0,$=m,m=0,$&1?K=8:(D=e[h>>2]|0,e[h>>2]=D+4,e[D>>2]=d,D=t+1|0,K=10);break}default:D=t,K=10}e:do if((K|0)==10){$=o;t:do if(($-D|0)>1&&(S[D>>0]|0)==48){switch(w=D+1|0,S[w>>0]|0){case 88:case 120:break;default:{K=11;break t}}if(m=0,d=Ne(e[(e[P>>2]|0)+44>>2]|0,P|0,48)|0,H=m,m=0,H&1){K=8;break e}if(H=e[h>>2]|0,e[h>>2]=H+4,e[H>>2]=d,D=D+2|0,m=0,d=Ne(e[(e[P>>2]|0)+44>>2]|0,P|0,S[w>>0]|0)|0,H=m,m=0,H&1){K=8;break e}if(H=e[h>>2]|0,e[h>>2]=H+4,e[H>>2]=d,D>>>0>>0){for(d=D;w=S[d>>0]|0,m=0,C=Ce(3)|0,H=m,m=0,!(H&1||(m=0,w=Ne(39,w<<24>>24|0,C|0)|0,H=m,m=0,H&1));){if(!w){H=D;break t}if(d=d+1|0,d>>>0>=o>>>0){H=D;break t}}d=j()|0;break e}else H=D,d=D}else K=11;while(!1);t:do if((K|0)==11)if(D>>>0>>0){for(d=D;w=S[d>>0]|0,m=0,C=Ce(3)|0,H=m,m=0,!(H&1||(m=0,w=Ne(40,w<<24>>24|0,C|0)|0,H=m,m=0,H&1));){if(!w){H=D;break t}if(d=d+1|0,d>>>0>=o>>>0){H=D;break t}}d=j()|0;break e}else H=D,d=D;while(!1);if(_=S[J>>0]|0,z=J+4|0,(_&1?e[z>>2]|0:(_&255)>>>1)|0){if((H|0)!=(d|0)&&(E=d+-1|0,H>>>0>>0)){C=H,w=E;do _=S[C>>0]|0,S[C>>0]=S[w>>0]|0,S[w>>0]=_,C=C+1|0,w=w+-1|0;while(C>>>0>>0)}if(m=0,E=ge(e[(e[G>>2]|0)+16>>2]|0,G|0)|0,_=m,m=0,_&1){K=8;break}F=J+8|0,R=J+1|0;t:do if(H>>>0>>0){for(w=0,C=0,_=H;D=S[(S[J>>0]&1?e[F>>2]|0:R)+C>>0]|0,D<<24>>24>0&(w|0)==(D<<24>>24|0)?(w=e[h>>2]|0,e[h>>2]=w+4,e[w>>2]=E,w=S[J>>0]|0,D=0,C=(C>>>0<((w&1?e[z>>2]|0:(w&255)>>>1)+-1|0)>>>0&1)+C|0):D=w,m=0,w=Ne(e[(e[P>>2]|0)+44>>2]|0,P|0,S[_>>0]|0)|0,ne=m,m=0,!(ne&1);){if(ne=e[h>>2]|0,e[h>>2]=ne+4,e[ne>>2]=w,_=_+1|0,_>>>0>=d>>>0)break t;w=D+1|0}d=j()|0;break e}while(!1);if(w=a+(H-t<<2)|0,D=e[h>>2]|0,(w|0)!=(D|0))if(C=D+-4|0,w>>>0>>0){do ne=e[w>>2]|0,e[w>>2]=e[C>>2],e[C>>2]=ne,w=w+4|0,C=C+-4|0;while(w>>>0>>0);E=P,w=D}else E=P,w=D;else E=P}else{if(m=0,Pe(e[(e[P>>2]|0)+48>>2]|0,P|0,H|0,d|0,e[h>>2]|0)|0,ne=m,m=0,ne&1){K=8;break}w=(e[h>>2]|0)+(d-H<<2)|0,e[h>>2]=w,E=P}t:do if(d>>>0>>0){for(;;){if(w=S[d>>0]|0,w<<24>>24==46){C=d;break}if(m=0,C=Ne(e[(e[E>>2]|0)+44>>2]|0,P|0,w|0)|0,ne=m,m=0,ne&1){K=4;break}if(ne=e[h>>2]|0,w=ne+4|0,e[h>>2]=w,e[ne>>2]=C,d=d+1|0,d>>>0>=o>>>0)break t}if((K|0)==4){d=j()|0;break e}if(m=0,d=ge(e[(e[G>>2]|0)+12>>2]|0,G|0)|0,ne=m,m=0,ne&1){K=8;break e}ne=e[h>>2]|0,w=ne+4|0,e[h>>2]=w,e[ne>>2]=d,d=C+1|0}while(!1);if(m=0,Pe(e[(e[P>>2]|0)+48>>2]|0,P|0,d|0,o|0,w|0)|0,ne=m,m=0,ne&1)K=8;else{ne=(e[h>>2]|0)+($-d<<2)|0,e[h>>2]=ne,e[l>>2]=(r|0)==(o|0)?ne:a+(r-t<<2)|0,de(J),b=L;return}}while(!1);(K|0)==8&&(d=j()|0),de(J),le(d|0)}function cc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=+l;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;J=b,b=b+352|0,K=J+304|0,R=J+48|0,F=J+32|0,C=J+24|0,h=J+8|0,E=J,z=J+308|0,H=J+72|0,w=J+76|0,L=J+68|0,P=J+64|0,G=J+60|0,$=J+56|0,D=E,e[D>>2]=37,e[D+4>>2]=0,D=gn(E+1|0,58899,e[o+4>>2]|0)|0,e[H>>2]=z,t=b0()|0,D?(e[h>>2]=e[o+8>>2],B[h+8>>3]=l,h=q0(z,30,t,E,h)|0):(B[C>>3]=l,h=q0(z,30,t,E,C)|0);e:do if((h|0)>29){m=0,t=Ce(3)|0,h=m,m=0,h=h&1,D?!h&&(m=0,e[F>>2]=e[o+8>>2],B[F+8>>3]=l,d=Pe(17,H|0,t|0,E|0,F|0)|0,_=m,m=0,!(_&1))&&(ne=12):!h&&(m=0,B[R>>3]=l,_=Pe(17,H|0,t|0,E|0,R|0)|0,R=m,m=0,!(R&1))&&(d=_,ne=12);do if((ne|0)==12){if(t=e[H>>2]|0,t)h=t;else{if(m=0,bt(6),_=m,m=0,_&1)break;h=e[H>>2]|0}t=h,E=h,ne=16;break e}while(!1);t=j()|0}else t=e[H>>2]|0,E=0,d=h,ne=16;while(!1);if((ne|0)==16){C=t+d|0,D=ri(t,C,o)|0;do if((t|0)==(z|0))t=z,h=0,ne=22;else{if(d=E0(d<<3)|0,!d){if(m=0,bt(6),ne=m,m=0,ne&1){h=0,ne=20;break}t=e[H>>2]|0}h=d,w=d,ne=22}while(!1);do if((ne|0)==22)if(m=0,d=ge(68,o|0)|0,H=m,m=0,H&1)ne=20;else{if(e[G>>2]=d,m=0,dt(4,t|0,D|0,C|0,w|0,L|0,P|0,G|0),G=m,m=0,G&1){t=j()|0,Bt(d)|0;break}if(Bt(d)|0,e[$>>2]=e[r>>2],ne=e[L>>2]|0,t=e[P>>2]|0,m=0,e[K>>2]=e[$>>2],t=Vt(40,K|0,w|0,ne|0,t|0,o|0,a|0)|0,ne=m,m=0,ne&1)ne=20;else return e[r>>2]=t,h&&n0(h),E&&n0(E),b=J,t|0}while(!1);(ne|0)==20&&(t=j()|0),h&&n0(h),E&&n0(E)}return le(t|0),0}function fc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(R=b,b=b+192|0,C=R,t=R+180|0,E=R+160|0,F=R+12|0,w=R+8|0,D=R+4|0,S[t>>0]=S[58901]|0,S[t+1>>0]=S[58902]|0,S[t+2>>0]=S[58903]|0,S[t+3>>0]=S[58904]|0,S[t+4>>0]=S[58905]|0,S[t+5>>0]=S[58906]|0,h=b0()|0,e[C>>2]=l,t=q0(E,20,h,t,C)|0,l=E+t|0,h=ri(E,l,o)|0,d=f0(o)|0,e[w>>2]=d,m=0,w=Ne(37,w|0,44212)|0,_=m,m=0,_&1)_=j()|0,Bt(d)|0,le(_|0);else return Bt(d)|0,_r[e[(e[w>>2]|0)+48>>2]&31](w,E,l,F)|0,_=F+(t<<2)|0,e[D>>2]=e[r>>2],e[C>>2]=e[D>>2],_=Hi(C,F,(h|0)==(l|0)?_:F+(h-E<<2)|0,_,o,a)|0,b=R,_|0;return 0}function xi(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;ne=b,b=b+32|0,K=ne+16|0,H=ne+12|0,P=ne+8|0,G=ne+4|0,$=ne,C=f0(a)|0,e[P>>2]=C,m=0,P=Ne(37,P|0,44220)|0,z=m,m=0,z&1&&(ne=j()|0,Bt(C)|0,le(ne|0)),Bt(C)|0,e[l>>2]=0,z=P+8|0,C=e[r>>2]|0;e:do if((d|0)!=(w|0)){t:for(;;){D=C,C?(e[C+12>>2]|0)==(e[C+16>>2]|0)&&(Et[e[(e[C>>2]|0)+36>>2]&127](C)|0)==-1&&(e[r>>2]=0,C=0,D=0):C=0,R=(C|0)==0,F=e[o>>2]|0,E=F;do if(F){if((e[F+12>>2]|0)==(e[F+16>>2]|0)&&(Et[e[(e[F>>2]|0)+36>>2]&127](F)|0)==-1){e[o>>2]=0,E=0,J=12;break}if(!R){J=13;break t}}else J=12;while(!1);if((J|0)==12)if(J=0,R){J=13;break}else F=0;i:do if((Yt[e[(e[P>>2]|0)+36>>2]&63](P,S[d>>0]|0,0)|0)<<24>>24==37){if(F=d+1|0,(F|0)==(w|0)){J=17;break t}switch(_=Yt[e[(e[P>>2]|0)+36>>2]&63](P,S[F>>0]|0,0)|0,_<<24>>24){case 48:case 69:{if(R=d+2|0,(R|0)==(w|0)){J=20;break t}d=F,F=Yt[e[(e[P>>2]|0)+36>>2]&63](P,S[R>>0]|0,0)|0,C=_;break}default:F=_,C=0}_=e[(e[t>>2]|0)+36>>2]|0,e[G>>2]=D,e[$>>2]=E,e[H>>2]=e[G>>2],e[K>>2]=e[$>>2],_=Ci[_&15](t,H,K,a,l,h,F,C)|0,e[r>>2]=_,d=d+2|0}else{if(D=S[d>>0]|0,D<<24>>24>-1&&(L=e[z>>2]|0,(k[L+(D<<24>>24<<1)>>1]&8192)!=0)){do{if(d=d+1|0,(d|0)==(w|0)){d=w;break}if(D=S[d>>0]|0,D<<24>>24<=-1)break}while(k[L+(D<<24>>24<<1)>>1]&8192);for(D=F;;){C?(e[C+12>>2]|0)==(e[C+16>>2]|0)&&(Et[e[(e[C>>2]|0)+36>>2]&127](C)|0)==-1&&(e[r>>2]=0,C=0):C=0,E=(C|0)==0;do if(F){if((e[F+12>>2]|0)!=(e[F+16>>2]|0))if(E){_=D;break}else break i;if((Et[e[(e[F>>2]|0)+36>>2]&127](F)|0)!=-1)if(E^(D|0)==0){_=D,F=D;break}else break i;else{e[o>>2]=0,D=0,J=39;break}}else J=39;while(!1);if((J|0)==39){if(J=0,E)break i;_=D,F=0}if(E=C+12|0,D=e[E>>2]|0,R=C+16|0,(D|0)==(e[R>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=N[D>>0]|0,(D&255)<<24>>24<=-1||!(k[(e[z>>2]|0)+(D<<24>>24<<1)>>1]&8192))break i;if(D=e[E>>2]|0,(D|0)==(e[R>>2]|0)){Et[e[(e[C>>2]|0)+40>>2]&127](C)|0,D=_;continue}else{e[E>>2]=D+1,D=_;continue}}}if(E=C+12|0,D=e[E>>2]|0,F=C+16|0,(D|0)==(e[F>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=N[D>>0]|0,_=U0[e[(e[P>>2]|0)+12>>2]&63](P,D&255)|0,_<<24>>24!=(U0[e[(e[P>>2]|0)+12>>2]&63](P,S[d>>0]|0)|0)<<24>>24){J=57;break t}D=e[E>>2]|0,(D|0)==(e[F>>2]|0)?Et[e[(e[C>>2]|0)+40>>2]&127](C)|0:e[E>>2]=D+1,d=d+1|0}while(!1);if(C=e[r>>2]|0,!((d|0)!=(w|0)&(e[l>>2]|0)==0))break e}if((J|0)==13){e[l>>2]=4;break}else if((J|0)==17){e[l>>2]=4;break}else if((J|0)==20){e[l>>2]=4;break}else if((J|0)==57){e[l>>2]=4,C=e[r>>2]|0;break}}while(!1);C?(e[C+12>>2]|0)==(e[C+16>>2]|0)&&(Et[e[(e[C>>2]|0)+36>>2]&127](C)|0)==-1&&(e[r>>2]=0,C=0):C=0,d=(C|0)==0,D=e[o>>2]|0;do if(D){if((e[D+12>>2]|0)==(e[D+16>>2]|0)&&(Et[e[(e[D>>2]|0)+36>>2]&127](D)|0)==-1){e[o>>2]=0,J=67;break}d||(J=68)}else J=67;while(!1);return(J|0)==67&&d&&(J=68),(J|0)==68&&(e[l>>2]=e[l>>2]|2),b=ne,C|0}function hc(t){t=t|0}function dc(t){t=t|0,he(t)}function pc(t){return t=t|0,2}function mc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=xi(t,C,w,a,l,h,58907,58915)|0,b=d,t|0}function gc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,F=t+8|0,F=Et[e[(e[F>>2]|0)+20>>2]&127](F)|0,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],o=S[F>>0]|0,R=(o&1)==0,r=R?F+1|0:e[F+8>>2]|0,o=r+(R?(o&255)>>>1:e[F+4>>2]|0)|0,e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=xi(t,C,w,a,l,h,r,o)|0,b=d,t|0}function Sc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44220)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],Is(t,h+24|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function Is(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0;d=b,b=b+16|0,w=d+4|0,C=d,t=t+8|0,t=Et[e[e[t>>2]>>2]&127](t)|0,e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],o=(Sn(o,w,t,t+168|0,h,l,0)|0)-t|0,(o|0)<168&&(e[r>>2]=((o|0)/12|0|0)%7|0),b=d}function Ac(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44220)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],ks(t,h+16|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function ks(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0;d=b,b=b+16|0,w=d+4|0,C=d,t=t+8|0,t=Et[e[(e[t>>2]|0)+4>>2]&127](t)|0,e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],o=(Sn(o,w,t,t+288|0,h,l,0)|0)-t|0,(o|0)<288&&(e[r>>2]=((o|0)/12|0|0)%12|0),b=d}function vc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44220)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],Es(t,h+20|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function Es(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,4)|0,e[l>>2]&4||((t|0)<69?t=t+2e3|0:t=(t+-69|0)>>>0<31?t+1900|0:t,e[r>>2]=t+-1900),b=d}function xc(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0;Oe=b,b=b+144|0,C=Oe+132|0,w=Oe+116|0,gt=Oe+128|0,P=Oe+124|0,jt=Oe+120|0,Kt=Oe+112|0,pt=Oe+108|0,At=Oe+104|0,y0=Oe+100|0,T0=Oe+96|0,g0=Oe+92|0,D=Oe+88|0,E=Oe+84|0,F=Oe+80|0,R=Oe+76|0,_=Oe+72|0,z=Oe+68|0,H=Oe+64|0,K=Oe+60|0,G=Oe+56|0,$=Oe+52|0,L=Oe+48|0,J=Oe+44|0,ne=Oe+40|0,ae=Oe+36|0,re=Oe+32|0,ce=Oe+28|0,Ee=Oe+24|0,ke=Oe+20|0,Te=Oe+16|0,it=Oe+12|0,Gt=Oe+8|0,s0=Oe+4|0,i0=Oe,e[l>>2]=0,zt=f0(a)|0,e[gt>>2]=zt,m=0,gt=Ne(37,gt|0,44220)|0,qt=m,m=0,qt&1&&(qt=j()|0,Bt(zt)|0,le(qt|0)),Bt(zt)|0;do switch(d<<24>>24|0){case 65:case 97:{e[P>>2]=e[o>>2],e[C>>2]=e[P>>2],Is(t,h+24|0,r,C,l,gt),yt=28;break}case 104:case 66:case 98:{e[jt>>2]=e[o>>2],e[C>>2]=e[jt>>2],ks(t,h+16|0,r,C,l,gt),yt=28;break}case 99:{yt=t+8|0,yt=Et[e[(e[yt>>2]|0)+12>>2]&127](yt)|0,e[Kt>>2]=e[r>>2],e[pt>>2]=e[o>>2],d=S[yt>>0]|0,o=(d&1)==0,qt=o?yt+1|0:e[yt+8>>2]|0,yt=qt+(o?(d&255)>>>1:e[yt+4>>2]|0)|0,e[w>>2]=e[Kt>>2],e[C>>2]=e[pt>>2],yt=xi(t,w,C,a,l,h,qt,yt)|0,e[r>>2]=yt,yt=28;break}case 101:case 100:{e[At>>2]=e[o>>2],e[C>>2]=e[At>>2],wc(t,h+12|0,r,C,l,gt),yt=28;break}case 68:{e[y0>>2]=e[r>>2],e[T0>>2]=e[o>>2],e[w>>2]=e[y0>>2],e[C>>2]=e[T0>>2],yt=xi(t,w,C,a,l,h,58915,58923)|0,e[r>>2]=yt,yt=28;break}case 70:{e[g0>>2]=e[r>>2],e[D>>2]=e[o>>2],e[w>>2]=e[g0>>2],e[C>>2]=e[D>>2],yt=xi(t,w,C,a,l,h,58923,58931)|0,e[r>>2]=yt,yt=28;break}case 72:{e[E>>2]=e[o>>2],e[C>>2]=e[E>>2],yc(t,h+8|0,r,C,l,gt),yt=28;break}case 73:{e[F>>2]=e[o>>2],e[C>>2]=e[F>>2],Cc(t,h+8|0,r,C,l,gt),yt=28;break}case 106:{e[R>>2]=e[o>>2],e[C>>2]=e[R>>2],Tc(t,h+28|0,r,C,l,gt),yt=28;break}case 109:{e[_>>2]=e[o>>2],e[C>>2]=e[_>>2],Ic(t,h+16|0,r,C,l,gt),yt=28;break}case 77:{e[z>>2]=e[o>>2],e[C>>2]=e[z>>2],kc(t,h+4|0,r,C,l,gt),yt=28;break}case 116:case 110:{e[H>>2]=e[o>>2],e[C>>2]=e[H>>2],Ec(t,r,C,l,gt),yt=28;break}case 112:{e[K>>2]=e[o>>2],e[C>>2]=e[K>>2],Dc(t,h+8|0,r,C,l,gt),yt=28;break}case 114:{e[G>>2]=e[r>>2],e[$>>2]=e[o>>2],e[w>>2]=e[G>>2],e[C>>2]=e[$>>2],yt=xi(t,w,C,a,l,h,58931,58942)|0,e[r>>2]=yt,yt=28;break}case 82:{e[L>>2]=e[r>>2],e[J>>2]=e[o>>2],e[w>>2]=e[L>>2],e[C>>2]=e[J>>2],yt=xi(t,w,C,a,l,h,58942,58947)|0,e[r>>2]=yt,yt=28;break}case 83:{e[ne>>2]=e[o>>2],e[C>>2]=e[ne>>2],bc(t,h,r,C,l,gt),yt=28;break}case 84:{e[ae>>2]=e[r>>2],e[re>>2]=e[o>>2],e[w>>2]=e[ae>>2],e[C>>2]=e[re>>2],yt=xi(t,w,C,a,l,h,58947,58955)|0,e[r>>2]=yt,yt=28;break}case 119:{e[ce>>2]=e[o>>2],e[C>>2]=e[ce>>2],Fc(t,h+24|0,r,C,l,gt),yt=28;break}case 120:{qt=e[(e[t>>2]|0)+20>>2]|0,e[Ee>>2]=e[r>>2],e[ke>>2]=e[o>>2],e[w>>2]=e[Ee>>2],e[C>>2]=e[ke>>2],w=on[qt&63](t,w,C,a,l,h)|0;break}case 88:{yt=t+8|0,yt=Et[e[(e[yt>>2]|0)+24>>2]&127](yt)|0,e[Te>>2]=e[r>>2],e[it>>2]=e[o>>2],d=S[yt>>0]|0,o=(d&1)==0,qt=o?yt+1|0:e[yt+8>>2]|0,yt=qt+(o?(d&255)>>>1:e[yt+4>>2]|0)|0,e[w>>2]=e[Te>>2],e[C>>2]=e[it>>2],yt=xi(t,w,C,a,l,h,qt,yt)|0,e[r>>2]=yt,yt=28;break}case 121:{e[Gt>>2]=e[o>>2],e[C>>2]=e[Gt>>2],Es(t,h+20|0,r,C,l,gt),yt=28;break}case 89:{e[s0>>2]=e[o>>2],e[C>>2]=e[s0>>2],Nc(t,h+20|0,r,C,l,gt),yt=28;break}case 37:{e[i0>>2]=e[o>>2],e[C>>2]=e[i0>>2],Rc(t,r,C,l,gt),yt=28;break}default:e[l>>2]=e[l>>2]|4,yt=28}while(!1);return(yt|0)==28&&(w=e[r>>2]|0),b=Oe,w|0}function wc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t+-1|0)>>>0<31&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function yc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<24&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Cc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t+-1|0)>>>0<12&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Tc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,3)|0,o=e[l>>2]|0,(t|0)<366&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Ic(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<13&(o&4|0)==0?e[r>>2]=t+-1:e[l>>2]=o|4,b=d}function kc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<60&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Ec(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0;d=l+8|0;e:for(;;){l=e[r>>2]|0;do if(l){if((e[l+12>>2]|0)==(e[l+16>>2]|0))if((Et[e[(e[l>>2]|0)+36>>2]&127](l)|0)==-1){e[r>>2]=0,l=0;break}else{l=e[r>>2]|0;break}}else l=0;while(!1);l=(l|0)==0,t=e[o>>2]|0;do if(t){if((e[t+12>>2]|0)!=(e[t+16>>2]|0)){if(l)break;break e}if((Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)!=-1){if(l)break;break e}else{e[o>>2]=0,w=12;break}}else w=12;while(!1);if((w|0)==12)if(w=0,l){t=0;break}else t=0;if(l=e[r>>2]|0,h=e[l+12>>2]|0,(h|0)==(e[l+16>>2]|0)?l=Et[e[(e[l>>2]|0)+36>>2]&127](l)|0:l=N[h>>0]|0,(l&255)<<24>>24<=-1||!(k[(e[d>>2]|0)+(l<<24>>24<<1)>>1]&8192))break;if(l=e[r>>2]|0,t=l+12|0,h=e[t>>2]|0,(h|0)==(e[l+16>>2]|0)){Et[e[(e[l>>2]|0)+40>>2]&127](l)|0;continue}else{e[t>>2]=h+1;continue}}l=e[r>>2]|0;do if(l){if((e[l+12>>2]|0)==(e[l+16>>2]|0))if((Et[e[(e[l>>2]|0)+36>>2]&127](l)|0)==-1){e[r>>2]=0,l=0;break}else{l=e[r>>2]|0;break}}else l=0;while(!1);l=(l|0)==0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)&&(Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1){e[o>>2]=0,w=32;break}l||(w=33)}else w=32;while(!1);(w|0)==32&&l&&(w=33),(w|0)==33&&(e[a>>2]=e[a>>2]|2)}function Dc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;E=b,b=b+16|0,w=E+4|0,C=E,D=t+8|0,D=Et[e[(e[D>>2]|0)+8>>2]&127](D)|0,t=S[D>>0]|0,t&1?d=e[D+4>>2]|0:d=(t&255)>>>1,t=S[D+12>>0]|0,t&1?t=e[D+16>>2]|0:t=(t&255)>>>1;do if((d|0)!=(0-t|0)){if(e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],t=Sn(o,w,D,D+24|0,h,l,0)|0,d=e[r>>2]|0,(t|0)==(D|0)&(d|0)==12){e[r>>2]=0;break}(d|0)<12&(t-D|0)==12&&(e[r>>2]=d+12)}else e[l>>2]=e[l>>2]|4;while(!1);b=E}function bc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<61&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Fc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,1)|0,o=e[l>>2]|0,(t|0)<7&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Nc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=fi(o,t,l,h,4)|0,e[l>>2]&4||(e[r>>2]=t+-1900),b=d}function Rc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0;t=e[r>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0))if((Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1){e[r>>2]=0,t=0;break}else{t=e[r>>2]|0;break}}else t=0;while(!1);h=(t|0)==0,t=e[o>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)&&(Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1){e[o>>2]=0,w=11;break}h?(d=t,w=13):w=12}else w=11;while(!1);(w|0)==11&&(h?w=12:(d=0,w=13));e:do if((w|0)==12)e[a>>2]=e[a>>2]|6;else if((w|0)==13){if(t=e[r>>2]|0,h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=N[h>>0]|0,(Yt[e[(e[l>>2]|0)+36>>2]&63](l,t&255,0)|0)<<24>>24!=37){e[a>>2]=e[a>>2]|4;break}t=e[r>>2]|0,h=t+12|0,l=e[h>>2]|0,(l|0)==(e[t+16>>2]|0)?(Et[e[(e[t>>2]|0)+40>>2]&127](t)|0,t=e[r>>2]|0,t?w=21:t=0):(e[h>>2]=l+1,w=21);do if((w|0)==21&&(e[t+12>>2]|0)==(e[t+16>>2]|0))if((Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1){e[r>>2]=0,t=0;break}else{t=e[r>>2]|0;break}while(!1);t=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)&&(Et[e[(e[d>>2]|0)+36>>2]&127](d)|0)==-1){e[o>>2]=0,w=30;break}if(t)break e}else w=30;while(!1);if((w|0)==30&&!t)break;e[a>>2]=e[a>>2]|2}while(!1)}function wi(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;L=b,b=b+32|0,H=L+16|0,z=L+12|0,$=L+8|0,K=L+4|0,G=L,C=f0(a)|0,e[$>>2]=C,m=0,$=Ne(37,$|0,44212)|0,_=m,m=0,_&1&&(L=j()|0,Bt(C)|0,le(L|0)),Bt(C)|0,e[l>>2]=0,C=e[r>>2]|0;e:do if((d|0)!=(w|0)){t:for(;;){E=C,C?(D=e[C+12>>2]|0,(D|0)==(e[C+16>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=e[D>>2]|0,(D|0)==-1?(e[r>>2]=0,C=0,R=1,_=0):(R=0,_=E)):(C=0,R=1,_=E),F=e[o>>2]|0,D=F;do if(F)if(E=e[F+12>>2]|0,(E|0)==(e[F+16>>2]|0)?E=Et[e[(e[F>>2]|0)+36>>2]&127](F)|0:E=e[E>>2]|0,(E|0)!=-1){if(R)break;P=17;break t}else{e[o>>2]=0,D=0,P=15;break}else P=15;while(!1);if((P|0)==15)if(P=0,R){P=17;break}else F=0;i:do if((Yt[e[(e[$>>2]|0)+52>>2]&63]($,e[d>>2]|0,0)|0)<<24>>24==37){if(E=d+4|0,(E|0)==(w|0)){P=21;break t}switch(R=Yt[e[(e[$>>2]|0)+52>>2]&63]($,e[E>>2]|0,0)|0,R<<24>>24){case 48:case 69:{if(F=d+8|0,(F|0)==(w|0)){P=24;break t}d=E,E=Yt[e[(e[$>>2]|0)+52>>2]&63]($,e[F>>2]|0,0)|0,C=R;break}default:E=R,C=0}R=e[(e[t>>2]|0)+36>>2]|0,e[K>>2]=_,e[G>>2]=D,e[z>>2]=e[K>>2],e[H>>2]=e[G>>2],_=Ci[R&15](t,z,H,a,l,h,E,C)|0,e[r>>2]=_,d=d+8|0}else{if(!(Yt[e[(e[$>>2]|0)+12>>2]&63]($,8192,e[d>>2]|0)|0)){if(E=C+12|0,D=e[E>>2]|0,F=C+16|0,(D|0)==(e[F>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=e[D>>2]|0,_=U0[e[(e[$>>2]|0)+28>>2]&63]($,D)|0,(_|0)!=(U0[e[(e[$>>2]|0)+28>>2]&63]($,e[d>>2]|0)|0)){P=61;break t}D=e[E>>2]|0,(D|0)==(e[F>>2]|0)?Et[e[(e[C>>2]|0)+40>>2]&127](C)|0:e[E>>2]=D+4,d=d+4|0;break}do if(d=d+4|0,(d|0)==(w|0)){d=w;break}while(Yt[e[(e[$>>2]|0)+12>>2]&63]($,8192,e[d>>2]|0)|0);for(D=F,R=F;;){C?(E=e[C+12>>2]|0,(E|0)==(e[C+16>>2]|0)?E=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:E=e[E>>2]|0,(E|0)==-1?(e[r>>2]=0,F=1,C=0):F=0):(F=1,C=0);do if(R)if(E=e[R+12>>2]|0,(E|0)==(e[R+16>>2]|0)?E=Et[e[(e[R>>2]|0)+36>>2]&127](R)|0:E=e[E>>2]|0,(E|0)!=-1)if(F^(D|0)==0){_=D,R=D;break}else break i;else{e[o>>2]=0,D=0,P=44;break}else P=44;while(!1);if((P|0)==44){if(P=0,F)break i;_=D,R=0}if(E=C+12|0,D=e[E>>2]|0,F=C+16|0,(D|0)==(e[F>>2]|0)?D=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:D=e[D>>2]|0,!(Yt[e[(e[$>>2]|0)+12>>2]&63]($,8192,D)|0))break i;if(D=e[E>>2]|0,(D|0)==(e[F>>2]|0)){Et[e[(e[C>>2]|0)+40>>2]&127](C)|0,D=_;continue}else{e[E>>2]=D+4,D=_;continue}}}while(!1);if(C=e[r>>2]|0,!((d|0)!=(w|0)&(e[l>>2]|0)==0))break e}if((P|0)==17){e[l>>2]=4;break}else if((P|0)==21){e[l>>2]=4;break}else if((P|0)==24){e[l>>2]=4;break}else if((P|0)==61){e[l>>2]=4,C=e[r>>2]|0;break}}while(!1);C?(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)?d=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:d=e[d>>2]|0,(d|0)==-1?(e[r>>2]=0,C=0,E=1):E=0):(C=0,E=1),d=e[o>>2]|0;do if(d)if(D=e[d+12>>2]|0,(D|0)==(e[d+16>>2]|0)?d=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:d=e[D>>2]|0,(d|0)!=-1){if(E)break;P=76;break}else{e[o>>2]=0,P=74;break}else P=74;while(!1);return(P|0)==74&&E&&(P=76),(P|0)==76&&(e[l>>2]=e[l>>2]|2),b=L,C|0}function Mc(t){t=t|0}function _c(t){t=t|0,he(t)}function Pc(t){return t=t|0,2}function Lc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=wi(t,C,w,a,l,h,44788,44820)|0,b=d,t|0}function Oc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,_=t+8|0,_=Et[e[(e[_>>2]|0)+20>>2]&127](_)|0,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],F=S[_>>0]|0,R=(F&1)==0,o=_+4|0,r=R?o:e[_+8>>2]|0,o=r+((R?(F&255)>>>1:e[o>>2]|0)<<2)|0,e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=wi(t,C,w,a,l,h,r,o)|0,b=d,t|0}function $c(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44212)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],Ds(t,h+24|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function Ds(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0;d=b,b=b+16|0,w=d+4|0,C=d,t=t+8|0,t=Et[e[e[t>>2]>>2]&127](t)|0,e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],o=(An(o,w,t,t+168|0,h,l,0)|0)-t|0,(o|0)<168&&(e[r>>2]=((o|0)/12|0|0)%7|0),b=d}function Bc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44212)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],bs(t,h+16|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function bs(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0;d=b,b=b+16|0,w=d+4|0,C=d,t=t+8|0,t=Et[e[(e[t>>2]|0)+4>>2]&127](t)|0,e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],o=(An(o,w,t,t+288|0,h,l,0)|0)-t|0,(o|0)<288&&(e[r>>2]=((o|0)/12|0|0)%12|0),b=d}function Vc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(D=b,b=b+16|0,w=D+8|0,d=D+4|0,C=D,a=f0(a)|0,e[d>>2]=a,m=0,d=Ne(37,d|0,44212)|0,E=m,m=0,E&1)E=j()|0,Bt(a)|0,le(E|0);else return Bt(a)|0,e[C>>2]=e[o>>2],e[w>>2]=e[C>>2],Fs(t,h+20|0,r,w,l,d),b=D,e[r>>2]|0;return 0}function Fs(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,4)|0,e[l>>2]&4||((t|0)<69?t=t+2e3|0:t=(t+-69|0)>>>0<31?t+1900|0:t,e[r>>2]=t+-1900),b=d}function Uc(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0;Oe=b,b=b+144|0,C=Oe+132|0,w=Oe+116|0,gt=Oe+128|0,P=Oe+124|0,jt=Oe+120|0,Kt=Oe+112|0,pt=Oe+108|0,At=Oe+104|0,y0=Oe+100|0,T0=Oe+96|0,g0=Oe+92|0,D=Oe+88|0,E=Oe+84|0,F=Oe+80|0,R=Oe+76|0,_=Oe+72|0,z=Oe+68|0,H=Oe+64|0,K=Oe+60|0,G=Oe+56|0,$=Oe+52|0,L=Oe+48|0,J=Oe+44|0,ne=Oe+40|0,ae=Oe+36|0,re=Oe+32|0,ce=Oe+28|0,Ee=Oe+24|0,ke=Oe+20|0,Te=Oe+16|0,it=Oe+12|0,Gt=Oe+8|0,s0=Oe+4|0,i0=Oe,e[l>>2]=0,zt=f0(a)|0,e[gt>>2]=zt,m=0,gt=Ne(37,gt|0,44212)|0,qt=m,m=0,qt&1&&(qt=j()|0,Bt(zt)|0,le(qt|0)),Bt(zt)|0;do switch(d<<24>>24|0){case 65:case 97:{e[P>>2]=e[o>>2],e[C>>2]=e[P>>2],Ds(t,h+24|0,r,C,l,gt),yt=28;break}case 104:case 66:case 98:{e[jt>>2]=e[o>>2],e[C>>2]=e[jt>>2],bs(t,h+16|0,r,C,l,gt),yt=28;break}case 99:{qt=t+8|0,qt=Et[e[(e[qt>>2]|0)+12>>2]&127](qt)|0,e[Kt>>2]=e[r>>2],e[pt>>2]=e[o>>2],d=S[qt>>0]|0,o=(d&1)==0,yt=qt+4|0,qt=o?yt:e[qt+8>>2]|0,yt=qt+((o?(d&255)>>>1:e[yt>>2]|0)<<2)|0,e[w>>2]=e[Kt>>2],e[C>>2]=e[pt>>2],yt=wi(t,w,C,a,l,h,qt,yt)|0,e[r>>2]=yt,yt=28;break}case 101:case 100:{e[At>>2]=e[o>>2],e[C>>2]=e[At>>2],zc(t,h+12|0,r,C,l,gt),yt=28;break}case 68:{e[y0>>2]=e[r>>2],e[T0>>2]=e[o>>2],e[w>>2]=e[y0>>2],e[C>>2]=e[T0>>2],yt=wi(t,w,C,a,l,h,44820,44852)|0,e[r>>2]=yt,yt=28;break}case 70:{e[g0>>2]=e[r>>2],e[D>>2]=e[o>>2],e[w>>2]=e[g0>>2],e[C>>2]=e[D>>2],yt=wi(t,w,C,a,l,h,44852,44884)|0,e[r>>2]=yt,yt=28;break}case 72:{e[E>>2]=e[o>>2],e[C>>2]=e[E>>2],Gc(t,h+8|0,r,C,l,gt),yt=28;break}case 73:{e[F>>2]=e[o>>2],e[C>>2]=e[F>>2],qc(t,h+8|0,r,C,l,gt),yt=28;break}case 106:{e[R>>2]=e[o>>2],e[C>>2]=e[R>>2],Wc(t,h+28|0,r,C,l,gt),yt=28;break}case 109:{e[_>>2]=e[o>>2],e[C>>2]=e[_>>2],Hc(t,h+16|0,r,C,l,gt),yt=28;break}case 77:{e[z>>2]=e[o>>2],e[C>>2]=e[z>>2],Qc(t,h+4|0,r,C,l,gt),yt=28;break}case 116:case 110:{e[H>>2]=e[o>>2],e[C>>2]=e[H>>2],Kc(t,r,C,l,gt),yt=28;break}case 112:{e[K>>2]=e[o>>2],e[C>>2]=e[K>>2],Yc(t,h+8|0,r,C,l,gt),yt=28;break}case 114:{e[G>>2]=e[r>>2],e[$>>2]=e[o>>2],e[w>>2]=e[G>>2],e[C>>2]=e[$>>2],yt=wi(t,w,C,a,l,h,44884,44928)|0,e[r>>2]=yt,yt=28;break}case 82:{e[L>>2]=e[r>>2],e[J>>2]=e[o>>2],e[w>>2]=e[L>>2],e[C>>2]=e[J>>2],yt=wi(t,w,C,a,l,h,44928,44948)|0,e[r>>2]=yt,yt=28;break}case 83:{e[ne>>2]=e[o>>2],e[C>>2]=e[ne>>2],jc(t,h,r,C,l,gt),yt=28;break}case 84:{e[ae>>2]=e[r>>2],e[re>>2]=e[o>>2],e[w>>2]=e[ae>>2],e[C>>2]=e[re>>2],yt=wi(t,w,C,a,l,h,44948,44980)|0,e[r>>2]=yt,yt=28;break}case 119:{e[ce>>2]=e[o>>2],e[C>>2]=e[ce>>2],Xc(t,h+24|0,r,C,l,gt),yt=28;break}case 120:{qt=e[(e[t>>2]|0)+20>>2]|0,e[Ee>>2]=e[r>>2],e[ke>>2]=e[o>>2],e[w>>2]=e[Ee>>2],e[C>>2]=e[ke>>2],w=on[qt&63](t,w,C,a,l,h)|0;break}case 88:{qt=t+8|0,qt=Et[e[(e[qt>>2]|0)+24>>2]&127](qt)|0,e[Te>>2]=e[r>>2],e[it>>2]=e[o>>2],d=S[qt>>0]|0,o=(d&1)==0,yt=qt+4|0,qt=o?yt:e[qt+8>>2]|0,yt=qt+((o?(d&255)>>>1:e[yt>>2]|0)<<2)|0,e[w>>2]=e[Te>>2],e[C>>2]=e[it>>2],yt=wi(t,w,C,a,l,h,qt,yt)|0,e[r>>2]=yt,yt=28;break}case 121:{e[Gt>>2]=e[o>>2],e[C>>2]=e[Gt>>2],Fs(t,h+20|0,r,C,l,gt),yt=28;break}case 89:{e[s0>>2]=e[o>>2],e[C>>2]=e[s0>>2],Zc(t,h+20|0,r,C,l,gt),yt=28;break}case 37:{e[i0>>2]=e[o>>2],e[C>>2]=e[i0>>2],Jc(t,r,C,l,gt),yt=28;break}default:e[l>>2]=e[l>>2]|4,yt=28}while(!1);return(yt|0)==28&&(w=e[r>>2]|0),b=Oe,w|0}function zc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t+-1|0)>>>0<31&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Gc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<24&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function qc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t+-1|0)>>>0<12&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Wc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,3)|0,o=e[l>>2]|0,(t|0)<366&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Hc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<13&(o&4|0)==0?e[r>>2]=t+-1:e[l>>2]=o|4,b=d}function Qc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<60&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Kc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0;e:for(;;){t=e[r>>2]|0;do if(t)if(h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(t|0)==-1){e[r>>2]=0,d=1;break}else{d=(e[r>>2]|0)==0;break}else d=1;while(!1);h=e[o>>2]|0;do if(h)if(t=e[h+12>>2]|0,(t|0)==(e[h+16>>2]|0)?t=Et[e[(e[h>>2]|0)+36>>2]&127](h)|0:t=e[t>>2]|0,(t|0)!=-1)if(d){d=h;break}else{d=h;break e}else{e[o>>2]=0,w=15;break}else w=15;while(!1);if((w|0)==15)if(w=0,d){d=0;break}else d=0;if(t=e[r>>2]|0,h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,!(Yt[e[(e[l>>2]|0)+12>>2]&63](l,8192,t)|0))break;if(t=e[r>>2]|0,h=t+12|0,d=e[h>>2]|0,(d|0)==(e[t+16>>2]|0)){Et[e[(e[t>>2]|0)+40>>2]&127](t)|0;continue}else{e[h>>2]=d+4;continue}}t=e[r>>2]|0;do if(t)if(h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(t|0)==-1){e[r>>2]=0,h=1;break}else{h=(e[r>>2]|0)==0;break}else h=1;while(!1);do if(d)if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)?t=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:t=e[t>>2]|0,(t|0)!=-1){if(h)break;w=39;break}else{e[o>>2]=0,w=37;break}else w=37;while(!1);(w|0)==37&&h&&(w=39),(w|0)==39&&(e[a>>2]=e[a>>2]|2)}function Yc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;E=b,b=b+16|0,w=E+4|0,C=E,D=t+8|0,D=Et[e[(e[D>>2]|0)+8>>2]&127](D)|0,t=S[D>>0]|0,t&1?d=e[D+4>>2]|0:d=(t&255)>>>1,t=S[D+12>>0]|0,t&1?t=e[D+16>>2]|0:t=(t&255)>>>1;do if((d|0)!=(0-t|0)){if(e[C>>2]=e[a>>2],e[w>>2]=e[C>>2],t=An(o,w,D,D+24|0,h,l,0)|0,d=e[r>>2]|0,(t|0)==(D|0)&(d|0)==12){e[r>>2]=0;break}(d|0)<12&(t-D|0)==12&&(e[r>>2]=d+12)}else e[l>>2]=e[l>>2]|4;while(!1);b=E}function jc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,2)|0,o=e[l>>2]|0,(t|0)<61&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Xc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,1)|0,o=e[l>>2]|0,(t|0)<7&(o&4|0)==0?e[r>>2]=t:e[l>>2]=o|4,b=d}function Zc(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;d=b,b=b+16|0,t=d+4|0,w=d,e[w>>2]=e[a>>2],e[t>>2]=e[w>>2],t=hi(o,t,l,h,4)|0,e[l>>2]&4||(e[r>>2]=t+-1900),b=d}function Jc(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0;t=e[r>>2]|0;do if(t)if(h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(t|0)==-1){e[r>>2]=0,d=1;break}else{d=(e[r>>2]|0)==0;break}else d=1;while(!1);h=e[o>>2]|0;do if(h)if(t=e[h+12>>2]|0,(t|0)==(e[h+16>>2]|0)?t=Et[e[(e[h>>2]|0)+36>>2]&127](h)|0:t=e[t>>2]|0,(t|0)!=-1)if(d){w=h,C=17;break}else{C=16;break}else{e[o>>2]=0,C=14;break}else C=14;while(!1);(C|0)==14&&(d?C=16:(w=0,C=17));e:do if((C|0)==16)e[a>>2]=e[a>>2]|6;else if((C|0)==17){if(t=e[r>>2]|0,h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(Yt[e[(e[l>>2]|0)+52>>2]&63](l,t,0)|0)<<24>>24!=37){e[a>>2]=e[a>>2]|4;break}t=e[r>>2]|0,h=t+12|0,d=e[h>>2]|0,(d|0)==(e[t+16>>2]|0)?(Et[e[(e[t>>2]|0)+40>>2]&127](t)|0,t=e[r>>2]|0,t?C=25:h=1):(e[h>>2]=d+4,C=25);do if((C|0)==25)if(h=e[t+12>>2]|0,(h|0)==(e[t+16>>2]|0)?t=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0:t=e[h>>2]|0,(t|0)==-1){e[r>>2]=0,h=1;break}else{h=(e[r>>2]|0)==0;break}while(!1);do if(w)if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)?t=Et[e[(e[w>>2]|0)+36>>2]&127](w)|0:t=e[t>>2]|0,(t|0)!=-1){if(h)break e;break}else{e[o>>2]=0,C=37;break}else C=37;while(!1);if((C|0)==37&&!h)break;e[a>>2]=e[a>>2]|2}while(!1)}function ef(t){t=t|0,cn(t+8|0)}function cn(t){t=t|0;var r=0,o=0,a=0;r=e[t>>2]|0,m=0,o=Ce(3)|0,a=m,m=0;do if(!(a&1)){if((r|0)!=(o|0)&&(m=0,ue(188,e[t>>2]|0),a=m,m=0,a&1))break;return}while(!1);a=j(0)|0,$t(a)}function tf(t){t=t|0,cn(t+8|0),he(t)}function nf(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0;if(C=b,b=b+112|0,w=C+4|0,o=C,e[o>>2]=w+100,Ns(t+8|0,w,o,l,h,d),l=e[o>>2]|0,o=e[r>>2]|0,(w|0)!=(l|0))do{d=S[w>>0]|0;do if(o)if(a=o+24|0,h=e[a>>2]|0,(h|0)==(e[o+28>>2]|0)){r=(U0[e[(e[o>>2]|0)+52>>2]&63](o,d&255)|0)==-1,o=r?0:o;break}else{e[a>>2]=h+1,S[h>>0]=d;break}else o=0;while(!1);w=w+1|0}while((w|0)!=(l|0));return b=C,o|0}function Ns(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0;D=b,b=b+16|0,C=D,S[C>>0]=37,d=C+1|0,S[d>>0]=l,w=C+2|0,S[w>>0]=h,S[C+3>>0]=0,h<<24>>24&&(S[d>>0]=h,S[w>>0]=l),t=r+(Go(r|0,(e[o>>2]|0)-r|0,C|0,a|0,e[t>>2]|0)|0)|0,e[o>>2]=t,b=D}function rf(t){t=t|0,cn(t+8|0)}function sf(t){t=t|0,cn(t+8|0),he(t)}function of(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0;if(w=b,b=b+416|0,a=w+8|0,o=w,e[o>>2]=a+400,af(t+8|0,a,o,l,h,d),t=e[o>>2]|0,o=e[r>>2]|0,(a|0)!=(t|0)){l=a;do a=e[l>>2]|0,o?(h=o+24|0,d=e[h>>2]|0,(d|0)==(e[o+28>>2]|0)?a=U0[e[(e[o>>2]|0)+52>>2]&63](o,a)|0:(e[h>>2]=d+4,e[d>>2]=a),o=(a|0)==-1?0:o):o=0,l=l+4|0;while((l|0)!=(t|0))}return b=w,o|0}function af(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;if(d=b,b=b+128|0,D=d+16|0,E=d+12|0,w=d,C=d+8|0,e[E>>2]=D+100,Ns(t,D,E,a,l,h),l=w,e[l>>2]=0,e[l+4>>2]=0,e[C>>2]=D,l=(e[o>>2]|0)-r>>2,h=ai(e[t>>2]|0)|0,m=0,l=Pe(18,r|0,C|0,l|0,w|0)|0,t=m,m=0,t&1&&(l=j()|0,h|0&&(m=0,ge(75,h|0)|0,E=m,m=0,E&1)&&(E=j(0)|0,$t(E)),le(l|0)),h|0&&(m=0,ge(75,h|0)|0,E=m,m=0,E&1)&&(E=j(0)|0,$t(E)),(l|0)==-1)fn(58955);else{e[o>>2]=r+(l<<2),b=d;return}}function lf(t){t=t|0}function uf(t){t=t|0,he(t)}function cf(t){return t=t|0,127}function ff(t){return t=t|0,127}function hf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function df(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function pf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function mf(t,r){t=t|0,r=r|0,dr(t,1,45)}function gf(t){return t=t|0,0}function Sf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Af(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function vf(t){t=t|0}function xf(t){t=t|0,he(t)}function wf(t){return t=t|0,127}function yf(t){return t=t|0,127}function Cf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Tf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function If(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function kf(t,r){t=t|0,r=r|0,dr(t,1,45)}function Ef(t){return t=t|0,0}function Df(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function bf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Ff(t){t=t|0}function Nf(t){t=t|0,he(t)}function Rf(t){return t=t|0,2147483647}function Mf(t){return t=t|0,2147483647}function _f(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Pf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Lf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Of(t,r){t=t|0,r=r|0,gr(t,1,45)}function $f(t){return t=t|0,0}function Bf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Vf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Uf(t){t=t|0}function zf(t){t=t|0,he(t)}function Gf(t){return t=t|0,2147483647}function qf(t){return t=t|0,2147483647}function Wf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Hf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Qf(t,r){t=t|0,r=r|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function Kf(t,r){t=t|0,r=r|0,gr(t,1,45)}function Yf(t){return t=t|0,0}function jf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Xf(t,r){t=t|0,r=r|0,S[t>>0]=2,S[t+1>>0]=3,S[t+2>>0]=0,S[t+3>>0]=4}function Zf(t){t=t|0}function Jf(t){t=t|0,he(t)}function eh(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;if(ae=b,b=b+240|0,J=ae+24|0,ne=ae,t=ae+136|0,ce=ae+16|0,L=ae+12|0,re=ae+8|0,F=ae+134|0,C=ae+4|0,P=ae+124|0,e[ce>>2]=t,Ee=ce+4|0,e[Ee>>2]=189,D=t+100|0,m=0,w=ge(68,l|0)|0,$=m,m=0,$&1)C=j()|0,e[ce>>2]=0,w=189,Te=45;else{e[re>>2]=w,m=0,t=Ne(37,re|0,44220)|0,$=m,m=0;e:do if(!($&1)&&(S[F>>0]=0,e[C>>2]=e[o>>2],E=e[l+4>>2]|0,m=0,e[J>>2]=e[C>>2],E=Ut(1,r|0,J|0,a|0,re|0,E|0,h|0,F|0,t|0,ce|0,L|0,D|0)|0,$=m,m=0,!($&1))){t:do if(E){if(m=0,Pe(e[(e[t>>2]|0)+32>>2]|0,t|0,58976,58986,P|0)|0,$=m,m=0,$&1){Te=10;break e}C=e[L>>2]|0,D=e[ce>>2]|0,t=C-D|0,(t|0)>98?(t=E0(t+2|0)|0,w=t,t?Te=13:(m=0,bt(6),$=m,m=0,$&1||(t=0,Te=13))):(w=0,t=J,Te=13);do if((Te|0)==13){if(S[F>>0]|0&&(S[t>>0]=45,t=t+1|0),G=P+10|0,$=P,D>>>0>>0){E=P+1|0,a=E+1|0,l=a+1|0,F=l+1|0,R=F+1|0,_=R+1|0,z=_+1|0,H=z+1|0,K=H+1|0;do{C=S[D>>0]|0;do if((S[P>>0]|0)!=C<<24>>24)if((S[E>>0]|0)!=C<<24>>24)if((S[a>>0]|0)!=C<<24>>24)if((S[l>>0]|0)!=C<<24>>24)if((S[F>>0]|0)==C<<24>>24)C=F;else{if((S[R>>0]|0)==C<<24>>24){C=R;break}if((S[_>>0]|0)==C<<24>>24){C=_;break}if((S[z>>0]|0)==C<<24>>24){C=z;break}if((S[H>>0]|0)==C<<24>>24){C=H;break}C=(S[K>>0]|0)==C<<24>>24?K:G}else C=l;else C=a;else C=E;else C=P;while(!1);S[t>>0]=S[58976+(C-$)>>0]|0,D=D+1|0,t=t+1|0}while(D>>>0<(e[L>>2]|0)>>>0)}if(S[t>>0]=0,e[ne>>2]=d,(_o(J,58987,ne)|0)!=1&&(m=0,ue(190,58991),d=m,m=0,d&1))break;w&&n0(w);break t}while(!1);if(t=j()|0,!w){C=t,w=ce;break e}n0(w),C=t,w=ce;break e}while(!1);t=e[r>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1){Te=10;break e}if((t|0)==-1){e[r>>2]=0,t=0;break}else{t=e[r>>2]|0;break}}}else t=0;while(!1);w=(t|0)==0,t=e[o>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1){Te=10;break e}if((t|0)==-1){e[o>>2]=0,Te=37;break}}w||(Te=38)}else Te=37;while(!1);return(Te|0)==37&&w&&(Te=38),(Te|0)==38&&(e[h>>2]=e[h>>2]|2),w=e[r>>2]|0,Bt(e[re>>2]|0)|0,t=e[ce>>2]|0,e[ce>>2]=0,t|0&&(m=0,ue(e[Ee>>2]|0,t|0),Te=m,m=0,Te&1)&&(Te=j(0)|0,$t(Te)),b=ae,w|0}else Te=10;while(!1);(Te|0)==10&&(C=j()|0,w=ce),Bt(e[re>>2]|0)|0,t=e[w>>2]|0,e[w>>2]=0,t?(w=e[Ee>>2]|0,Te=45):ke=C}return(Te|0)==45&&(m=0,ue(w|0,t|0),Te=m,m=0,Te&1?(Te=j(0)|0,$t(Te)):ke=C),le(ke|0),0}function th(t){t=t|0}function ih(t,r,o,a,l,h,d,w,C,D,E){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0;var F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0,c0=0,a0=0,h0=0,D0=0,A0=0,Ti=0,N0=0;A0=b,b=b+512|0,gt=A0+88|0,z=A0+96|0,N0=A0+80|0,y0=A0+72|0,At=A0+68|0,T0=A0+500|0,Kt=A0+497|0,g0=A0+496|0,qt=A0+56|0,D0=A0+44|0,a0=A0+32|0,c0=A0+20|0,h0=A0+8|0,pt=A0+4|0,yt=A0,e[gt>>2]=E,e[N0>>2]=z,Ti=N0+4|0,e[Ti>>2]=189,e[y0>>2]=z,e[At>>2]=z+400,e[qt>>2]=0,e[qt+4>>2]=0,e[qt+8>>2]=0,e[D0>>2]=0,e[D0+4>>2]=0,e[D0+8>>2]=0,e[a0>>2]=0,e[a0+4>>2]=0,e[a0+8>>2]=0,e[c0>>2]=0,e[c0+4>>2]=0,e[c0+8>>2]=0,e[h0>>2]=0,e[h0+4>>2]=0,e[h0+8>>2]=0,m=0,I0(1,o|0,a|0,T0|0,Kt|0,g0|0,qt|0,D0|0,a0|0,c0|0,pt|0),zt=m,m=0;e:do if(zt&1)w=j()|0;else{e[D>>2]=e[C>>2],Te=w+8|0,it=a0+4|0,jt=c0+4|0,Gt=c0+8|0,s0=c0+1|0,i0=a0+8|0,zt=a0+1|0,P=(l&512|0)!=0,L=D0+8|0,J=D0+1|0,ne=D0+4|0,ae=h0+4|0,re=h0+8|0,ce=h0+1|0,Ee=T0+3|0,ke=qt+4|0,$=0,_=0;t:for(;;){E=e[t>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}if((E|0)==-1){e[t>>2]=0,E=0;break}else{E=e[t>>2]|0;break}}}else E=0;while(!1);E=(E|0)==0,w=e[r>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0))if(E){G=w;break}else{Oe=235;break t}if(m=0,o=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=24;break t}if((o|0)!=-1)if(E){G=w;break}else{Oe=235;break t}else{e[r>>2]=0,Oe=15;break}}else Oe=15;while(!1);if((Oe|0)==15)if(Oe=0,E){Oe=235;break}else G=0;i:do switch(S[T0+$>>0]|0){case 1:{if(($|0)!=3){if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,Oe=m,m=0,Oe&1){Oe=24;break t}}else E=N[w>>0]|0;if((E&255)<<24>>24<=-1){Oe=40;break t}if(!(k[(e[Te>>2]|0)+(E<<24>>24<<1)>>1]&8192)){Oe=40;break t}if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,Oe=m,m=0,Oe&1){Oe=24;break t}}else e[w>>2]=o+1,E=N[o>>0]|0;if(m=0,Ae(67,h0|0,E&255|0),Oe=m,m=0,Oe&1){Oe=24;break t}else E=G,a=G,Oe=42}break}case 0:{($|0)!=3&&(E=G,a=G,Oe=42);break}case 3:{if(w=S[a0>>0]|0,E=w&1?e[it>>2]|0:(w&255)>>>1,o=S[c0>>0]|0,a=o&1?e[jt>>2]|0:(o&255)>>>1,(E|0)!=(0-a|0)){if(!E){if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}w=S[c0>>0]|0}else E=N[w>>0]|0,w=o;if((E&255)<<24>>24!=(S[(w&1?e[Gt>>2]|0:s0)>>0]|0))break i;if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[w>>2]=o+1;S[d>>0]=1,G=S[c0>>0]|0,_=(G&1?e[jt>>2]|0:(G&255)>>>1)>>>0>1?c0:_;break i}if(l=e[t>>2]|0,F=e[l+12>>2]|0,o=e[l+16>>2]|0,E=(F|0)==(o|0),!a){if(E){if(m=0,E=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=24;break t}w=S[a0>>0]|0}else E=N[F>>0]|0;if((E&255)<<24>>24!=(S[(w&1?e[i0>>2]|0:zt)>>0]|0)){S[d>>0]=1;break i}if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[w>>2]=o+1;G=S[a0>>0]|0,_=(G&1?e[it>>2]|0:(G&255)>>>1)>>>0>1?a0:_;break i}if(E){if(m=0,E=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=24;break t}o=e[t>>2]|0,w=S[a0>>0]|0,l=o,F=e[o+12>>2]|0,o=e[o+16>>2]|0}else E=N[F>>0]|0;if(a=l+12|0,o=(F|0)==(o|0),(E&255)<<24>>24==(S[(w&1?e[i0>>2]|0:zt)>>0]|0)){if(o){if(m=0,ge(e[(e[l>>2]|0)+40>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[a>>2]=F+1;G=S[a0>>0]|0,_=(G&1?e[it>>2]|0:(G&255)>>>1)>>>0>1?a0:_;break i}if(o){if(m=0,E=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=24;break t}}else E=N[F>>0]|0;if((E&255)<<24>>24!=(S[(S[c0>>0]&1?e[Gt>>2]|0:s0)>>0]|0)){Oe=104;break t}if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[w>>2]=o+1;S[d>>0]=1,G=S[c0>>0]|0,_=(G&1?e[jt>>2]|0:(G&255)>>>1)>>>0>1?c0:_}break}case 2:{if(!($>>>0<2|(_|0)!=0)&&!(P|($|0)==2&(S[Ee>>0]|0)!=0)){_=0;break i}H=S[D0>>0]|0,E=(H&1)==0,K=e[L>>2]|0,o=E?J:K,R=o;n:do if($|0&&(N[T0+($+-1)>>0]|0)<2){F=E?(H&255)>>>1:e[ne>>2]|0,a=o+F|0,l=e[Te>>2]|0;r:do if(!F)w=R;else{F=o,w=R;do{if(E=S[F>>0]|0,E<<24>>24<=-1||!(k[l+(E<<24>>24<<1)>>1]&8192))break r;F=F+1|0,w=F}while((F|0)!=(a|0))}while(!1);if(a=w-R|0,l=S[h0>>0]|0,E=(l&1)==0,l=E?(l&255)>>>1:e[ae>>2]|0,l>>>0>=a>>>0){if(E=E?ce:e[re>>2]|0,F=E+l|0,(w|0)!=(R|0))for(E=E+(l-a)|0;;){if((S[E>>0]|0)!=(S[o>>0]|0)){w=R;break n}if(E=E+1|0,(E|0)==(F|0))break;o=o+1|0}}else w=R}else w=R;while(!1);E=(H&1)==0,E=(E?J:K)+(E?(H&255)>>>1:e[ne>>2]|0)|0;n:do if((w|0)!=(E|0))for(l=G,a=G,E=w;;){w=e[t>>2]|0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=21;break t}if((w|0)==-1){e[t>>2]=0,w=0;break}else{w=e[t>>2]|0;break}}}else w=0;while(!1);o=(w|0)==0;do if(a){if((e[a+12>>2]|0)!=(e[a+16>>2]|0))if(o){w=l,F=a;break}else break n;if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,G=m,m=0,G&1){Oe=21;break t}if((w|0)!=-1)if(o^(l|0)==0){w=l,F=l;break}else break n;else{e[r>>2]=0,w=0,Oe=131;break}}else w=l,Oe=131;while(!1);if((Oe|0)==131){if(Oe=0,o)break n;F=0}if(o=e[t>>2]|0,a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=21;break t}}else o=N[a>>0]|0;if((o&255)<<24>>24!=(S[E>>0]|0))break n;if(o=e[t>>2]|0,a=o+12|0,l=e[a>>2]|0,(l|0)==(e[o+16>>2]|0)){if(m=0,ge(e[(e[o>>2]|0)+40>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=21;break t}}else e[a>>2]=l+1;if(E=E+1|0,o=S[D0>>0]|0,G=(o&1)==0,o=(G?J:e[L>>2]|0)+(G?(o&255)>>>1:e[ne>>2]|0)|0,(E|0)==(o|0)){E=o;break}else l=w,a=F}while(!1);if(P&&(G=S[D0>>0]|0,K=(G&1)==0,(E|0)!=((K?J:e[L>>2]|0)+(K?(G&255)>>>1:e[ne>>2]|0)|0))){Oe=143;break t}break}case 4:{R=S[g0>>0]|0,w=G,l=G,E=0;n:for(;;){o=e[t>>2]|0;do if(o){if((e[o+12>>2]|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=23;break t}if((o|0)==-1){e[t>>2]=0,o=0;break}else{o=e[t>>2]|0;break}}}else o=0;while(!1);a=(o|0)==0;do if(l){if((e[l+12>>2]|0)!=(e[l+16>>2]|0))if(a){F=w;break}else{a=w;break n}if(m=0,o=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,G=m,m=0,G&1){Oe=23;break t}if((o|0)!=-1)if(a^(w|0)==0){F=w,l=w;break}else{a=w;break n}else{e[r>>2]=0,w=0,Oe=156;break}}else Oe=156;while(!1);if((Oe|0)==156)if(Oe=0,a){a=w;break}else F=w,l=0;if(w=e[t>>2]|0,o=e[w+12>>2]|0,(o|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=23;break t}}else w=N[o>>0]|0;if(o=w&255,o<<24>>24>-1&&k[(e[Te>>2]|0)+(w<<24>>24<<1)>>1]&2048){if(w=e[D>>2]|0,(w|0)==(e[gt>>2]|0)){if(m=0,ve(12,C|0,D|0,gt|0),G=m,m=0,G&1){Oe=23;break t}w=e[D>>2]|0}e[D>>2]=w+1,S[w>>0]=o,E=E+1|0}else{if(G=S[qt>>0]|0,!(o<<24>>24==R<<24>>24&(E|0?((G&1?e[ke>>2]|0:(G&255)>>>1)|0)!=0:0))){a=F;break}if((z|0)==(e[At>>2]|0)){if(m=0,ve(13,N0|0,y0|0,At|0),G=m,m=0,G&1){Oe=23;break t}z=e[y0>>2]|0}G=z+4|0,e[y0>>2]=G,e[z>>2]=E,z=G,E=0}if(w=e[t>>2]|0,o=w+12|0,a=e[o>>2]|0,(a|0)==(e[w+16>>2]|0))if(m=0,ge(e[(e[w>>2]|0)+40>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=23;break t}else{w=F;continue}else{e[o>>2]=a+1,w=F;continue}}if(E|0&&(e[N0>>2]|0)!=(z|0)){if((z|0)==(e[At>>2]|0)){if(m=0,ve(13,N0|0,y0|0,At|0),G=m,m=0,G&1){Oe=24;break t}z=e[y0>>2]|0}G=z+4|0,e[y0>>2]=G,e[z>>2]=E,z=G}if(F=e[pt>>2]|0,(F|0)>0){E=e[t>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}if((E|0)==-1){e[t>>2]=0,E=0;break}else{E=e[t>>2]|0;break}}}else E=0;while(!1);E=(E|0)==0;do if(a){if((e[a+12>>2]|0)==(e[a+16>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,G=m,m=0,G&1){Oe=24;break t}if((w|0)==-1){e[r>>2]=0,Oe=193;break}}if(!E){Oe=198;break t}}else Oe=193;while(!1);if((Oe|0)==193)if(Oe=0,E){Oe=198;break t}else a=0;if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else E=N[w>>0]|0;if((E&255)<<24>>24!=(S[Kt>>0]|0)){Oe=198;break t}if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=24;break t}}else e[w>>2]=o+1;if((F|0)>0)for(l=a,o=a,R=F;;){E=e[t>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=22;break t}if((E|0)==-1){e[t>>2]=0,E=0;break}else{E=e[t>>2]|0;break}}}else E=0;while(!1);w=(E|0)==0;do if(o){if((e[o+12>>2]|0)!=(e[o+16>>2]|0))if(w){E=l,F=o;break}else{Oe=222;break t}if(m=0,E=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=22;break t}if((E|0)!=-1)if(w^(l|0)==0){E=l,F=l;break}else{Oe=222;break t}else{e[r>>2]=0,E=0,Oe=215;break}}else E=l,Oe=215;while(!1);if((Oe|0)==215)if(Oe=0,w){Oe=222;break t}else F=0;if(w=e[t>>2]|0,o=e[w+12>>2]|0,(o|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=22;break t}}else w=N[o>>0]|0;if((w&255)<<24>>24<=-1){Oe=222;break t}if(!(k[(e[Te>>2]|0)+(w<<24>>24<<1)>>1]&2048)){Oe=222;break t}if((e[D>>2]|0)==(e[gt>>2]|0)&&(m=0,ve(12,C|0,D|0,gt|0),G=m,m=0,G&1)){Oe=22;break t}if(w=e[t>>2]|0,o=e[w+12>>2]|0,(o|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=22;break t}}else w=N[o>>0]|0;if(o=e[D>>2]|0,e[D>>2]=o+1,S[o>>0]=w,w=R,R=R+-1|0,e[pt>>2]=R,o=e[t>>2]|0,a=o+12|0,l=e[a>>2]|0,(l|0)==(e[o+16>>2]|0)){if(m=0,ge(e[(e[o>>2]|0)+40>>2]|0,o|0)|0,G=m,m=0,G&1){Oe=22;break t}}else e[a>>2]=l+1;if((w|0)<=1)break;l=E,o=F}}if((e[D>>2]|0)==(e[C>>2]|0)){Oe=233;break t}break}default:}while(!1);i:do if((Oe|0)==42)for(;;){Oe=0,w=e[t>>2]|0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,w=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,G=m,m=0,G&1){Oe=20;break t}if((w|0)==-1){e[t>>2]=0,w=0;break}else{w=e[t>>2]|0;break}}}else w=0;while(!1);o=(w|0)==0;do if(a){if((e[a+12>>2]|0)!=(e[a+16>>2]|0))if(o){l=E;break}else break i;if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,G=m,m=0,G&1){Oe=20;break t}if((w|0)!=-1)if(o^(E|0)==0){l=E,a=E;break}else break i;else{e[r>>2]=0,E=0,Oe=54;break}}else Oe=54;while(!1);if((Oe|0)==54){if(Oe=0,o)break i;l=E,a=0}if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,G=m,m=0,G&1){Oe=20;break t}}else E=N[w>>0]|0;if((E&255)<<24>>24<=-1||!(k[(e[Te>>2]|0)+(E<<24>>24<<1)>>1]&8192))break i;if(E=e[t>>2]|0,w=E+12|0,o=e[w>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,Oe=m,m=0,Oe&1){Oe=20;break t}}else e[w>>2]=o+1,E=N[o>>0]|0;if(m=0,Ae(67,h0|0,E&255|0),Oe=m,m=0,Oe&1){Oe=20;break t}else E=l,Oe=42}while(!1);if($=$+1|0,$>>>0>=4){Oe=235;break}}t:switch(Oe|0){case 20:{w=j()|0;break e}case 21:{w=j()|0;break e}case 22:{w=j()|0;break e}case 23:{w=j()|0;break e}case 24:{w=j()|0;break e}case 40:{e[h>>2]=e[h>>2]|4,w=0;break}case 104:{e[h>>2]=e[h>>2]|4,w=0;break}case 143:{e[h>>2]=e[h>>2]|4,w=0;break}case 198:{e[h>>2]=e[h>>2]|4,w=0;break}case 222:{e[h>>2]=e[h>>2]|4,w=0;break}case 233:{e[h>>2]=e[h>>2]|4,w=0;break}case 235:{i:do if(_){l=_+1|0,F=_+8|0,R=_+4|0,o=1;n:for(;;){if(E=S[_>>0]|0,E&1?E=e[R>>2]|0:E=(E&255)>>>1,o>>>0>=E>>>0)break i;E=e[t>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){Oe=19;break n}if((E|0)==-1){e[t>>2]=0,E=0;break}else{E=e[t>>2]|0;break}}}else E=0;while(!1);w=(E|0)==0,E=e[r>>2]|0;do if(E){if((e[E+12>>2]|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){Oe=19;break n}if((E|0)==-1){e[r>>2]=0,Oe=253;break}}if(!w){Oe=260;break n}}else Oe=253;while(!1);if((Oe|0)==253&&(Oe=0,w)){Oe=260;break}if(E=e[t>>2]|0,w=e[E+12>>2]|0,(w|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){Oe=19;break}}else E=N[w>>0]|0;if(S[_>>0]&1?w=e[F>>2]|0:w=l,(E&255)<<24>>24!=(S[w+o>>0]|0)){Oe=260;break}if(E=o+1|0,w=e[t>>2]|0,o=w+12|0,a=e[o>>2]|0,(a|0)==(e[w+16>>2]|0))if(m=0,ge(e[(e[w>>2]|0)+40>>2]|0,w|0)|0,D=m,m=0,D&1){Oe=19;break}else{o=E;continue}else{e[o>>2]=a+1,o=E;continue}}if((Oe|0)==19){w=j()|0;break e}else if((Oe|0)==260){e[h>>2]=e[h>>2]|4,w=0;break t}}while(!1);E=e[N0>>2]|0,(E|0)!=(z|0)&&(e[yt>>2]=0,V0(qt,E,z,yt),(e[yt>>2]|0)!=0)?(e[h>>2]=e[h>>2]|4,w=0):w=1;break}}return de(h0),de(c0),de(a0),de(D0),de(qt),E=e[N0>>2]|0,e[N0>>2]=0,E|0&&(m=0,ue(e[Ti>>2]|0,E|0),N0=m,m=0,N0&1)&&(N0=j(0)|0,$t(N0)),b=A0,w|0}while(!1);return de(h0),de(c0),de(a0),de(D0),de(qt),E=e[N0>>2]|0,e[N0>>2]=0,E|0&&(m=0,ue(e[Ti>>2]|0,E|0),N0=m,m=0,N0&1)&&(N0=j(0)|0,$t(N0)),le(w|0),0}function fn(t){t=t|0;var r=0;r=Ct(8)|0,m=0,Ae(90,r|0,t|0),t=m,m=0,t&1?(t=j()|0,It(r|0),le(t|0)):Qt(r|0,616,80)}function nh(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;if($=b,b=b+144|0,w=$+24|0,t=$+32|0,P=$+16|0,z=$+8|0,F=$+4|0,R=$+28|0,C=$,e[P>>2]=t,ne=P+4|0,e[ne>>2]=189,D=t+100|0,m=0,G=ge(68,l|0)|0,E=m,m=0,E&1)w=j()|0,e[P>>2]=0,J=36;else{e[F>>2]=G,m=0,E=Ne(37,F|0,44220)|0,t=m,m=0;e:do if(!(t&1)&&(S[R>>0]=0,H=e[o>>2]|0,e[C>>2]=H,_=e[l+4>>2]|0,K=H,m=0,e[w>>2]=e[C>>2],_=Ut(1,r|0,w|0,a|0,F|0,_|0,h|0,R|0,E|0,P|0,z|0,D|0)|0,l=m,m=0,!(l&1))){if(_){if(S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),S[R>>0]|0&&(m=0,t=Ne(e[(e[E>>2]|0)+28>>2]|0,E|0,45)|0,l=m,m=0,l&1||(m=0,Ae(67,d|0,t|0),l=m,m=0,l&1))||(m=0,C=Ne(e[(e[E>>2]|0)+28>>2]|0,E|0,48)|0,l=m,m=0,l&1))break;t=e[P>>2]|0,D=e[z>>2]|0,w=D+-1|0;t:do if(t>>>0>>0)do{if((S[t>>0]|0)!=C<<24>>24)break t;t=t+1|0}while(t>>>0>>0);while(!1);if(m=0,Ve(32,d|0,t|0,D|0)|0,d=m,m=0,d&1)break}t=e[r>>2]|0;do if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1)break e;if((t|0)==-1){e[r>>2]=0,t=0;break}else{t=e[r>>2]|0;break}}}else t=0;while(!1);w=(t|0)==0;do if(H){if((e[K+12>>2]|0)==(e[K+16>>2]|0)){if(m=0,t=ge(e[(e[H>>2]|0)+36>>2]|0,K|0)|0,K=m,m=0,K&1)break e;if((t|0)==-1){e[o>>2]=0,J=29;break}}w||(J=30)}else J=29;while(!1);return(J|0)==29&&w&&(J=30),(J|0)==30&&(e[h>>2]=e[h>>2]|2),w=e[r>>2]|0,Bt(G)|0,t=e[P>>2]|0,e[P>>2]=0,t|0&&(m=0,ue(e[ne>>2]|0,t|0),ne=m,m=0,ne&1)&&(ne=j(0)|0,$t(ne)),b=$,w|0}while(!1);w=j()|0,Bt(G)|0,t=e[P>>2]|0,e[P>>2]=0,t?J=36:L=w}return(J|0)==36&&(m=0,ue(e[ne>>2]|0,t|0),ne=m,m=0,ne&1?(ne=j(0)|0,$t(ne)):L=w),le(L|0),0}function rh(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0;J=b,b=b+112|0,E=J+100|0,F=J+88|0,R=J+76|0,_=J+64|0,z=J+52|0,H=J+48|0,K=J+36|0,G=J+24|0,$=J+12|0,P=J;do if(t)if(t=O0(r,43828)|0,t0[e[(e[t>>2]|0)+44>>2]&127](E,t),P=e[E>>2]|0,S[o>>0]=P,S[o+1>>0]=P>>8,S[o+2>>0]=P>>16,S[o+3>>0]=P>>24,t0[e[(e[t>>2]|0)+32>>2]&127](F,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[C>>2]=e[F>>2],e[C+4>>2]=e[F+4>>2],e[C+8>>2]=e[F+8>>2],e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,de(F),t0[e[(e[t>>2]|0)+28>>2]&127](R,t),S[w>>0]&1?(S[e[w+8>>2]>>0]=0,e[w+4>>2]=0):(S[w+1>>0]=0,S[w>>0]=0),m=0,Ae(91,w|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[w>>2]=e[R>>2],e[w+4>>2]=e[R+4>>2],e[w+8>>2]=e[R+8>>2],e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,de(R),w=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,S[a>>0]=w,w=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,S[l>>0]=w,t0[e[(e[t>>2]|0)+20>>2]&127](_,t),S[h>>0]&1?(S[e[h+8>>2]>>0]=0,e[h+4>>2]=0):(S[h+1>>0]=0,S[h>>0]=0),m=0,Ae(91,h|0,0),l=m,m=0,l&1&&(l=j(0)|0,$t(l)),e[h>>2]=e[_>>2],e[h+4>>2]=e[_+4>>2],e[h+8>>2]=e[_+8>>2],e[_>>2]=0,e[_+4>>2]=0,e[_+8>>2]=0,de(_),t0[e[(e[t>>2]|0)+24>>2]&127](z,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),l=m,m=0,l&1)l=j(0)|0,$t(l);else{e[d>>2]=e[z>>2],e[d+4>>2]=e[z+4>>2],e[d+8>>2]=e[z+8>>2],e[z>>2]=0,e[z+4>>2]=0,e[z+8>>2]=0,de(z),L=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}else if(t=O0(r,43764)|0,t0[e[(e[t>>2]|0)+44>>2]&127](H,t),H=e[H>>2]|0,S[o>>0]=H,S[o+1>>0]=H>>8,S[o+2>>0]=H>>16,S[o+3>>0]=H>>24,t0[e[(e[t>>2]|0)+32>>2]&127](K,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[C>>2]=e[K>>2],e[C+4>>2]=e[K+4>>2],e[C+8>>2]=e[K+8>>2],e[K>>2]=0,e[K+4>>2]=0,e[K+8>>2]=0,de(K),t0[e[(e[t>>2]|0)+28>>2]&127](G,t),S[w>>0]&1?(S[e[w+8>>2]>>0]=0,e[w+4>>2]=0):(S[w+1>>0]=0,S[w>>0]=0),m=0,Ae(91,w|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[w>>2]=e[G>>2],e[w+4>>2]=e[G+4>>2],e[w+8>>2]=e[G+8>>2],e[G>>2]=0,e[G+4>>2]=0,e[G+8>>2]=0,de(G),w=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,S[a>>0]=w,w=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,S[l>>0]=w,t0[e[(e[t>>2]|0)+20>>2]&127]($,t),S[h>>0]&1?(S[e[h+8>>2]>>0]=0,e[h+4>>2]=0):(S[h+1>>0]=0,S[h>>0]=0),m=0,Ae(91,h|0,0),l=m,m=0,l&1&&(l=j(0)|0,$t(l)),e[h>>2]=e[$>>2],e[h+4>>2]=e[$+4>>2],e[h+8>>2]=e[$+8>>2],e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,de($),t0[e[(e[t>>2]|0)+24>>2]&127](P,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),l=m,m=0,l&1)l=j(0)|0,$t(l);else{e[d>>2]=e[P>>2],e[d+4>>2]=e[P+4>>2],e[d+8>>2]=e[P+8>>2],e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,de(P),L=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}while(!1);e[D>>2]=L,b=J}function V0(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;l=S[t>>0]|0,d=t+4|0,h=e[d>>2]|0;e:do if((l&1?h:(l&255)>>>1)|0){if((r|0)!=(o|0)){if(l=o+-4|0,l>>>0>r>>>0){h=r;do w=e[h>>2]|0,e[h>>2]=e[l>>2],e[l>>2]=w,h=h+4|0,l=l+-4|0;while(h>>>0>>0)}l=S[t>>0]|0,h=e[d>>2]|0}w=(l&1)==0,d=w?t+1|0:e[t+8>>2]|0,o=o+-4|0,t=d+(w?(l&255)>>>1:h)|0,h=S[d>>0]|0,l=h<<24>>24<1|h<<24>>24==127;t:do if(o>>>0>r>>>0){for(;!(!l&&(h<<24>>24|0)!=(e[r>>2]|0));)if(d=(t-d|0)>1?d+1|0:d,r=r+4|0,h=S[d>>0]|0,l=h<<24>>24<1|h<<24>>24==127,r>>>0>=o>>>0)break t;e[a>>2]=4;break e}while(!1);!l&&((e[o>>2]|0)+-1|0)>>>0>=h<<24>>24>>>0&&(e[a>>2]=4)}while(!1)}function sh(t){t=t|0}function oh(t){t=t|0,he(t)}function ah(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;if(ae=b,b=b+576|0,P=ae+424|0,ne=ae,t=ae+24|0,ce=ae+16|0,L=ae+12|0,re=ae+8|0,F=ae+464|0,C=ae+4|0,J=ae+468|0,e[ce>>2]=t,ke=ce+4|0,e[ke>>2]=189,D=t+400|0,m=0,w=ge(68,l|0)|0,$=m,m=0,$&1)C=j()|0,e[ce>>2]=0,w=189,Te=47;else{e[re>>2]=w,m=0,t=Ne(37,re|0,44212)|0,$=m,m=0;e:do if(!($&1)&&(S[F>>0]=0,e[C>>2]=e[o>>2],E=e[l+4>>2]|0,m=0,e[P>>2]=e[C>>2],E=Ut(2,r|0,P|0,a|0,re|0,E|0,h|0,F|0,t|0,ce|0,L|0,D|0)|0,$=m,m=0,!($&1))){t:do if(E){if(m=0,Pe(e[(e[t>>2]|0)+48>>2]|0,t|0,59007,59017,P|0)|0,$=m,m=0,$&1){Te=10;break e}C=e[L>>2]|0,D=e[ce>>2]|0,t=C-D|0,(t|0)>392?(t=E0((t>>2)+2|0)|0,w=t,t?Te=13:(m=0,bt(6),$=m,m=0,$&1||(t=0,Te=13))):(w=0,t=J,Te=13);do if((Te|0)==13){if(S[F>>0]|0&&(S[t>>0]=45,t=t+1|0),G=P+40|0,$=P,D>>>0>>0){E=P+4|0,a=E+4|0,l=a+4|0,F=l+4|0,R=F+4|0,_=R+4|0,z=_+4|0,H=z+4|0,K=H+4|0;do{C=e[D>>2]|0;do if((e[P>>2]|0)!=(C|0))if((e[E>>2]|0)!=(C|0))if((e[a>>2]|0)!=(C|0))if((e[l>>2]|0)!=(C|0))if((e[F>>2]|0)==(C|0))C=F;else{if((e[R>>2]|0)==(C|0)){C=R;break}if((e[_>>2]|0)==(C|0)){C=_;break}if((e[z>>2]|0)==(C|0)){C=z;break}if((e[H>>2]|0)==(C|0)){C=H;break}C=(e[K>>2]|0)==(C|0)?K:G}else C=l;else C=a;else C=E;else C=P;while(!1);S[t>>0]=S[59007+(C-$>>2)>>0]|0,D=D+4|0,t=t+1|0}while(D>>>0<(e[L>>2]|0)>>>0)}if(S[t>>0]=0,e[ne>>2]=d,(_o(J,58987,ne)|0)!=1&&(m=0,ue(190,58991),d=m,m=0,d&1))break;w&&n0(w);break t}while(!1);if(t=j()|0,!w){C=t,w=ce;break e}n0(w),C=t,w=ce;break e}while(!1);t=e[r>>2]|0;do if(t){if(w=e[t+12>>2]|0,(w|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1){Te=10;break e}}else t=e[w>>2]|0;if((t|0)==-1){e[r>>2]=0,C=1;break}else{C=(e[r>>2]|0)==0;break}}else C=1;while(!1);t=e[o>>2]|0;do if(t){if(w=e[t+12>>2]|0,(w|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1){Te=10;break e}}else t=e[w>>2]|0;if((t|0)!=-1){if(C)break;Te=40;break}else{e[o>>2]=0,Te=38;break}}else Te=38;while(!1);return(Te|0)==38&&C&&(Te=40),(Te|0)==40&&(e[h>>2]=e[h>>2]|2),w=e[r>>2]|0,Bt(e[re>>2]|0)|0,t=e[ce>>2]|0,e[ce>>2]=0,t|0&&(m=0,ue(e[ke>>2]|0,t|0),Te=m,m=0,Te&1)&&(Te=j(0)|0,$t(Te)),b=ae,w|0}else Te=10;while(!1);(Te|0)==10&&(C=j()|0,w=ce),Bt(e[re>>2]|0)|0,t=e[w>>2]|0,e[w>>2]=0,t?(w=e[ke>>2]|0,Te=47):Ee=C}return(Te|0)==47&&(m=0,ue(w|0,t|0),Te=m,m=0,Te&1?(Te=j(0)|0,$t(Te)):Ee=C),le(Ee|0),0}function lh(t,r,o,a,l,h,d,w,C,D,E){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0;var F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0,c0=0,a0=0,h0=0;c0=b,b=b+512|0,Gt=c0+96|0,F=c0+104|0,h0=c0+88|0,gt=c0+80|0,zt=c0+76|0,Kt=c0+504|0,s0=c0+72|0,pt=c0+68|0,T0=c0+56|0,qt=c0+44|0,Oe=c0+32|0,g0=c0+20|0,yt=c0+8|0,i0=c0+4|0,y0=c0,e[Gt>>2]=E,e[h0>>2]=F,a0=h0+4|0,e[a0>>2]=189,e[gt>>2]=F,e[zt>>2]=F+400,e[T0>>2]=0,e[T0+4>>2]=0,e[T0+8>>2]=0,e[qt>>2]=0,e[qt+4>>2]=0,e[qt+8>>2]=0,e[Oe>>2]=0,e[Oe+4>>2]=0,e[Oe+8>>2]=0,e[g0>>2]=0,e[g0+4>>2]=0,e[g0+8>>2]=0,e[yt>>2]=0,e[yt+4>>2]=0,e[yt+8>>2]=0,m=0,I0(2,o|0,a|0,Kt|0,s0|0,pt|0,T0|0,qt|0,Oe|0,g0|0,i0|0),jt=m,m=0;e:do if(jt&1)o=j()|0;else{e[D>>2]=e[C>>2],ke=Oe+4|0,Te=g0+4|0,it=g0+8|0,jt=Oe+8|0,L=(l&512|0)!=0,J=qt+8|0,ne=qt+4|0,ae=yt+4|0,re=yt+8|0,ce=Kt+3|0,Ee=T0+4|0,P=0,_=0;t:for(;;){E=e[t>>2]|0;do if(E){if(o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}}else E=e[o>>2]|0;if((E|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);o=e[r>>2]|0;do if(o){if(E=e[o+12>>2]|0,(E|0)==(e[o+16>>2]|0)){if(m=0,E=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=26;break t}}else E=e[E>>2]|0;if((E|0)!=-1)if(a){$=o;break}else{z=F,At=244;break t}else{e[r>>2]=0,At=16;break}}else At=16;while(!1);if((At|0)==16)if(At=0,a){z=F,At=244;break}else $=0;i:do switch(S[Kt+P>>0]|0){case 1:{if((P|0)!=3){if(E=e[t>>2]|0,o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,At=m,m=0,At&1){At=26;break t}}else E=e[o>>2]|0;if(m=0,E=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,8192,E|0)|0,At=m,m=0,At&1){At=26;break t}if(!E){At=42;break t}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,At=m,m=0,At&1){At=26;break t}}else e[o>>2]=a+4,E=e[a>>2]|0;if(m=0,Ae(92,yt|0,E|0),At=m,m=0,At&1){At=26;break t}else E=$,l=$,At=44}else E=F;break}case 0:{(P|0)==3?E=F:(E=$,l=$,At=44);break}case 3:{if(o=S[Oe>>0]|0,E=o&1?e[ke>>2]|0:(o&255)>>>1,a=S[g0>>0]|0,l=a&1?e[Te>>2]|0:(a&255)>>>1,(E|0)==(0-l|0))E=F;else{if(!E){if(E=e[t>>2]|0,o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}o=S[g0>>0]|0}else E=e[o>>2]|0,o=a;if((E|0)!=(e[(o&1?e[it>>2]|0:Te)>>2]|0)){E=F;break i}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}}else e[o>>2]=a+4;S[d>>0]=1,$=S[g0>>0]|0,E=F,_=($&1?e[Te>>2]|0:($&255)>>>1)>>>0>1?g0:_;break i}if(R=e[t>>2]|0,z=e[R+12>>2]|0,a=e[R+16>>2]|0,E=(z|0)==(a|0),!l){if(E){if(m=0,E=ge(e[(e[R>>2]|0)+36>>2]|0,R|0)|0,$=m,m=0,$&1){At=26;break t}o=S[Oe>>0]|0}else E=e[z>>2]|0;if((E|0)!=(e[(o&1?e[jt>>2]|0:ke)>>2]|0)){S[d>>0]=1,E=F;break i}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}}else e[o>>2]=a+4;$=S[Oe>>0]|0,E=F,_=($&1?e[ke>>2]|0:($&255)>>>1)>>>0>1?Oe:_;break i}if(E){if(m=0,E=ge(e[(e[R>>2]|0)+36>>2]|0,R|0)|0,$=m,m=0,$&1){At=26;break t}a=e[t>>2]|0,o=S[Oe>>0]|0,R=a,z=e[a+12>>2]|0,a=e[a+16>>2]|0}else E=e[z>>2]|0;if(l=R+12|0,a=(z|0)==(a|0),(E|0)==(e[(o&1?e[jt>>2]|0:ke)>>2]|0)){if(a){if(m=0,ge(e[(e[R>>2]|0)+40>>2]|0,R|0)|0,$=m,m=0,$&1){At=26;break t}}else e[l>>2]=z+4;$=S[Oe>>0]|0,E=F,_=($&1?e[ke>>2]|0:($&255)>>>1)>>>0>1?Oe:_;break i}if(a){if(m=0,E=ge(e[(e[R>>2]|0)+36>>2]|0,R|0)|0,$=m,m=0,$&1){At=26;break t}}else E=e[z>>2]|0;if((E|0)!=(e[(S[g0>>0]&1?e[it>>2]|0:Te)>>2]|0)){At=107;break t}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,$=m,m=0,$&1){At=26;break t}}else e[o>>2]=a+4;S[d>>0]=1,$=S[g0>>0]|0,E=F,_=($&1?e[Te>>2]|0:($&255)>>>1)>>>0>1?g0:_}break}case 2:{if(!(P>>>0<2|(_|0)!=0)&&!(L|(P|0)==2&(S[ce>>0]|0)!=0)){E=F,_=0;break i}l=S[qt>>0]|0,a=e[J>>2]|0,o=l&1?a:ne,E=o;n:do if(P|0&&(N[Kt+(P+-1)>>0]|0)<2){G=(l&1)==0;r:do if((o|0)!=((G?ne:a)+((G?(l&255)>>>1:e[ne>>2]|0)<<2)|0)){for(l=o;;){if(m=0,o=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,8192,e[l>>2]|0)|0,G=m,m=0,G&1){At=23;break t}if(!o)break;if(l=l+4|0,E=l,o=S[qt>>0]|0,a=e[J>>2]|0,G=(o&1)==0,(l|0)==((G?ne:a)+((G?(o&255)>>>1:e[ne>>2]|0)<<2)|0)){l=o;break r}}l=S[qt>>0]|0,a=e[J>>2]|0}while(!1);if(z=l&1?a:ne,o=z,H=E-o>>2,K=S[yt>>0]|0,R=(K&1)==0,K=R?(K&255)>>>1:e[ae>>2]|0,K>>>0>=H>>>0)if(R=R?ae:e[re>>2]|0,G=R+(K<<2)|0,!H)o=E;else for(R=R+(K-H<<2)|0;;){if((e[R>>2]|0)!=(e[z>>2]|0))break n;if(R=R+4|0,(R|0)==(G|0)){o=E;break}else z=z+4|0}}else o=E;while(!1);E=(l&1)==0,E=(E?ne:a)+((E?(l&255)>>>1:e[ne>>2]|0)<<2)|0;n:do if((o|0)!=(E|0))for(R=$,l=$,E=o;;){o=e[t>>2]|0;do if(o){if(a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=22;break t}}else o=e[a>>2]|0;if((o|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);do if(l){if(o=e[l+12>>2]|0,(o|0)==(e[l+16>>2]|0)){if(m=0,o=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,$=m,m=0,$&1){At=22;break t}}else o=e[o>>2]|0;if((o|0)!=-1)if(a^(R|0)==0){o=R,z=R;break}else break n;else{e[r>>2]=0,o=0,At=136;break}}else o=R,At=136;while(!1);if((At|0)==136){if(At=0,a)break n;z=0}if(a=e[t>>2]|0,l=e[a+12>>2]|0,(l|0)==(e[a+16>>2]|0)){if(m=0,a=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,$=m,m=0,$&1){At=22;break t}}else a=e[l>>2]|0;if((a|0)!=(e[E>>2]|0))break n;if(a=e[t>>2]|0,l=a+12|0,R=e[l>>2]|0,(R|0)==(e[a+16>>2]|0)){if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,$=m,m=0,$&1){At=22;break t}}else e[l>>2]=R+4;if(E=E+4|0,a=S[qt>>0]|0,$=(a&1)==0,a=($?ne:e[J>>2]|0)+(($?(a&255)>>>1:e[ne>>2]|0)<<2)|0,(E|0)==(a|0)){E=a;break}else R=o,l=z}while(!1);if(L&&($=S[qt>>0]|0,G=($&1)==0,(E|0)!=((G?ne:e[J>>2]|0)+((G?($&255)>>>1:e[ne>>2]|0)<<2)|0))){At=148;break t}else E=F;break}case 4:{K=e[pt>>2]|0,H=$,R=$,E=F,o=0;n:for(;;){a=e[t>>2]|0;do if(a){if(l=e[a+12>>2]|0,(l|0)==(e[a+16>>2]|0)){if(m=0,a=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,$=m,m=0,$&1){At=25;break t}}else a=e[l>>2]|0;if((a|0)==-1){e[t>>2]=0,l=1;break}else{l=(e[t>>2]|0)==0;break}}else l=1;while(!1);do if(R){if(a=e[R+12>>2]|0,(a|0)==(e[R+16>>2]|0)){if(m=0,a=ge(e[(e[R>>2]|0)+36>>2]|0,R|0)|0,$=m,m=0,$&1){At=25;break t}}else a=e[a>>2]|0;if((a|0)!=-1)if(l^(H|0)==0){a=H,z=H;break}else{F=H;break n}else{e[r>>2]=0,a=0,At=162;break}}else a=H,At=162;while(!1);if((At|0)==162)if(At=0,l){F=a;break}else z=0;if(l=e[t>>2]|0,F=e[l+12>>2]|0,(F|0)==(e[l+16>>2]|0)){if(m=0,l=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,$=m,m=0,$&1){At=25;break t}}else l=e[F>>2]|0;if(m=0,F=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,2048,l|0)|0,$=m,m=0,$&1){At=25;break t}if(F){if(F=e[D>>2]|0,(F|0)==(e[Gt>>2]|0)){if(m=0,ve(14,C|0,D|0,Gt|0),$=m,m=0,$&1){At=25;break t}F=e[D>>2]|0}e[D>>2]=F+4,e[F>>2]=l,o=o+1|0}else{if($=S[T0>>0]|0,!((l|0)==(K|0)&(o|0?(($&1?e[Ee>>2]|0:($&255)>>>1)|0)!=0:0))){F=a;break}if((E|0)==(e[zt>>2]|0)){if(m=0,ve(13,h0|0,gt|0,zt|0),$=m,m=0,$&1){At=25;break t}E=e[gt>>2]|0}$=E+4|0,e[gt>>2]=$,e[E>>2]=o,E=$,o=0}if(l=e[t>>2]|0,F=l+12|0,R=e[F>>2]|0,(R|0)==(e[l+16>>2]|0))if(m=0,ge(e[(e[l>>2]|0)+40>>2]|0,l|0)|0,$=m,m=0,$&1){At=25;break t}else{H=a,R=z;continue}else{e[F>>2]=R+4,H=a,R=z;continue}}if(o|0&&(e[h0>>2]|0)!=(E|0)){if((E|0)==(e[zt>>2]|0)){if(m=0,ve(13,h0|0,gt|0,zt|0),$=m,m=0,$&1){At=26;break t}E=e[gt>>2]|0}$=E+4|0,e[gt>>2]=$,e[E>>2]=o,E=$}if(z=e[i0>>2]|0,(z|0)>0){o=e[t>>2]|0;do if(o){if(a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=26;break t}}else o=e[a>>2]|0;if((o|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);do if(F){if(o=e[F+12>>2]|0,(o|0)==(e[F+16>>2]|0)){if(m=0,o=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,$=m,m=0,$&1){At=26;break t}}else o=e[o>>2]|0;if((o|0)!=-1){if(a)break;At=206;break t}else{e[r>>2]=0,At=200;break}}else At=200;while(!1);if((At|0)==200)if(At=0,a){At=206;break t}else F=0;if(o=e[t>>2]|0,a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=26;break t}}else o=e[a>>2]|0;if((o|0)!=(e[s0>>2]|0)){At=206;break t}if(o=e[t>>2]|0,a=o+12|0,l=e[a>>2]|0,(l|0)==(e[o+16>>2]|0)){if(m=0,ge(e[(e[o>>2]|0)+40>>2]|0,o|0)|0,$=m,m=0,$&1){At=26;break t}}else e[a>>2]=l+4;if((z|0)>0)for(R=F,l=F,H=z;;){o=e[t>>2]|0;do if(o){if(a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=24;break t}}else o=e[a>>2]|0;if((o|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);do if(l){if(o=e[l+12>>2]|0,(o|0)==(e[l+16>>2]|0)){if(m=0,o=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,$=m,m=0,$&1){At=24;break t}}else o=e[o>>2]|0;if((o|0)!=-1)if(a^(R|0)==0){o=R,z=R;break}else{At=231;break t}else{e[r>>2]=0,o=0,At=224;break}}else o=R,At=224;while(!1);if((At|0)==224)if(At=0,a){At=231;break t}else z=0;if(a=e[t>>2]|0,l=e[a+12>>2]|0,(l|0)==(e[a+16>>2]|0)){if(m=0,a=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,$=m,m=0,$&1){At=24;break t}}else a=e[l>>2]|0;if(m=0,a=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,2048,a|0)|0,$=m,m=0,$&1){At=24;break t}if(!a){At=231;break t}if((e[D>>2]|0)==(e[Gt>>2]|0)&&(m=0,ve(14,C|0,D|0,Gt|0),$=m,m=0,$&1)){At=24;break t}if(a=e[t>>2]|0,l=e[a+12>>2]|0,(l|0)==(e[a+16>>2]|0)){if(m=0,a=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,$=m,m=0,$&1){At=24;break t}}else a=e[l>>2]|0;if(l=e[D>>2]|0,e[D>>2]=l+4,e[l>>2]=a,a=H,H=H+-1|0,e[i0>>2]=H,l=e[t>>2]|0,F=l+12|0,R=e[F>>2]|0,(R|0)==(e[l+16>>2]|0)){if(m=0,ge(e[(e[l>>2]|0)+40>>2]|0,l|0)|0,$=m,m=0,$&1){At=24;break t}}else e[F>>2]=R+4;if((a|0)<=1)break;R=o,l=z}}if((e[D>>2]|0)==(e[C>>2]|0)){At=242;break t}break}default:E=F}while(!1);i:do if((At|0)==44)for(;;){At=0,o=e[t>>2]|0;do if(o){if(a=e[o+12>>2]|0,(a|0)==(e[o+16>>2]|0)){if(m=0,o=ge(e[(e[o>>2]|0)+36>>2]|0,o|0)|0,$=m,m=0,$&1){At=21;break t}}else o=e[a>>2]|0;if((o|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);do if(l){if(o=e[l+12>>2]|0,(o|0)==(e[l+16>>2]|0)){if(m=0,o=ge(e[(e[l>>2]|0)+36>>2]|0,l|0)|0,$=m,m=0,$&1){At=21;break t}}else o=e[o>>2]|0;if((o|0)!=-1)if(a^(E|0)==0){R=E,l=E;break}else{E=F;break i}else{e[r>>2]=0,E=0,At=57;break}}else At=57;while(!1);if((At|0)==57)if(At=0,a){E=F;break i}else R=E,l=0;if(E=e[t>>2]|0,o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,$=m,m=0,$&1){At=21;break t}}else E=e[o>>2]|0;if(m=0,E=Ve(e[(e[w>>2]|0)+12>>2]|0,w|0,8192,E|0)|0,$=m,m=0,$&1){At=21;break t}if(!E){E=F;break i}if(E=e[t>>2]|0,o=E+12|0,a=e[o>>2]|0,(a|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,At=m,m=0,At&1){At=21;break t}}else e[o>>2]=a+4,E=e[a>>2]|0;if(m=0,Ae(92,yt|0,E|0),At=m,m=0,At&1){At=21;break t}else E=R,At=44}while(!1);if(P=P+1|0,P>>>0>=4){z=E,At=244;break}else F=E}t:switch(At|0){case 21:{o=j()|0;break e}case 22:{o=j()|0;break e}case 23:{o=j()|0;break e}case 24:{o=j()|0;break e}case 25:{o=j()|0;break e}case 26:{o=j()|0;break e}case 42:{e[h>>2]=e[h>>2]|4,o=0;break}case 107:{e[h>>2]=e[h>>2]|4,o=0;break}case 148:{e[h>>2]=e[h>>2]|4,o=0;break}case 206:{e[h>>2]=e[h>>2]|4,o=0;break}case 231:{e[h>>2]=e[h>>2]|4,o=0;break}case 242:{e[h>>2]=e[h>>2]|4,o=0;break}case 244:{i:do if(_){F=_+4|0,R=_+8|0,l=1;n:for(;;){if(E=S[_>>0]|0,E&1?E=e[F>>2]|0:E=(E&255)>>>1,l>>>0>=E>>>0)break i;E=e[t>>2]|0;do if(E){if(o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){At=20;break n}}else E=e[o>>2]|0;if((E|0)==-1){e[t>>2]=0,a=1;break}else{a=(e[t>>2]|0)==0;break}}else a=1;while(!1);E=e[r>>2]|0;do if(E){if(o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){At=20;break n}}else E=e[o>>2]|0;if((E|0)!=-1){if(a)break;At=271;break n}else{e[r>>2]=0,At=263;break}}else At=263;while(!1);if((At|0)==263&&(At=0,a)){At=271;break}if(E=e[t>>2]|0,o=e[E+12>>2]|0,(o|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,D=m,m=0,D&1){At=20;break}}else E=e[o>>2]|0;if(S[_>>0]&1?o=e[R>>2]|0:o=F,(E|0)!=(e[o+(l<<2)>>2]|0)){At=271;break}if(E=l+1|0,o=e[t>>2]|0,a=o+12|0,l=e[a>>2]|0,(l|0)==(e[o+16>>2]|0))if(m=0,ge(e[(e[o>>2]|0)+40>>2]|0,o|0)|0,D=m,m=0,D&1){At=20;break}else{l=E;continue}else{e[a>>2]=l+4,l=E;continue}}if((At|0)==20){o=j()|0;break e}else if((At|0)==271){e[h>>2]=e[h>>2]|4,o=0;break t}}while(!1);E=e[h0>>2]|0,(E|0)!=(z|0)&&(e[y0>>2]=0,V0(T0,E,z,y0),(e[y0>>2]|0)!=0)?(e[h>>2]=e[h>>2]|4,o=0):o=1;break}}return Pt(yt),Pt(g0),Pt(Oe),Pt(qt),de(T0),E=e[h0>>2]|0,e[h0>>2]=0,E|0&&(m=0,ue(e[a0>>2]|0,E|0),h0=m,m=0,h0&1)&&(h0=j(0)|0,$t(h0)),b=c0,o|0}while(!1);return Pt(yt),Pt(g0),Pt(Oe),Pt(qt),de(T0),E=e[h0>>2]|0,e[h0>>2]=0,E|0&&(m=0,ue(e[a0>>2]|0,E|0),h0=m,m=0,h0&1)&&(h0=j(0)|0,$t(h0)),le(o|0),0}function uh(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;if($=b,b=b+432|0,w=$+424|0,t=$+24|0,L=$+16|0,z=$+8|0,F=$+4|0,R=$+428|0,C=$,e[L>>2]=t,ne=L+4|0,e[ne>>2]=189,D=t+400|0,m=0,G=ge(68,l|0)|0,E=m,m=0,E&1)w=j()|0,e[L>>2]=0,J=38;else{e[F>>2]=G,m=0,E=Ne(37,F|0,44212)|0,t=m,m=0;e:do if(!(t&1)&&(S[R>>0]=0,H=e[o>>2]|0,e[C>>2]=H,_=e[l+4>>2]|0,K=H,m=0,e[w>>2]=e[C>>2],_=Ut(2,r|0,w|0,a|0,F|0,_|0,h|0,R|0,E|0,L|0,z|0,D|0)|0,l=m,m=0,!(l&1))){if(_){if(S[d>>0]&1?e[e[d+8>>2]>>2]=0:S[d>>0]=0,e[d+4>>2]=0,S[R>>0]|0&&(m=0,t=Ne(e[(e[E>>2]|0)+44>>2]|0,E|0,45)|0,l=m,m=0,l&1||(m=0,Ae(92,d|0,t|0),l=m,m=0,l&1))||(m=0,C=Ne(e[(e[E>>2]|0)+44>>2]|0,E|0,48)|0,l=m,m=0,l&1))break;t=e[L>>2]|0,D=e[z>>2]|0,w=D+-4|0;t:do if(t>>>0>>0)do{if((e[t>>2]|0)!=(C|0))break t;t=t+4|0}while(t>>>0>>0);while(!1);if(m=0,Ve(33,d|0,t|0,D|0)|0,d=m,m=0,d&1)break}t=e[r>>2]|0;do if(t){if(w=e[t+12>>2]|0,(w|0)==(e[t+16>>2]|0)){if(m=0,t=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,d=m,m=0,d&1)break e}else t=e[w>>2]|0;if((t|0)==-1){e[r>>2]=0,w=1;break}else{w=(e[r>>2]|0)==0;break}}else w=1;while(!1);do if(H){if(t=e[K+12>>2]|0,(t|0)==(e[K+16>>2]|0)){if(m=0,t=ge(e[(e[H>>2]|0)+36>>2]|0,K|0)|0,K=m,m=0,K&1)break e}else t=e[t>>2]|0;if((t|0)!=-1){if(w)break;J=32;break}else{e[o>>2]=0,J=30;break}}else J=30;while(!1);return(J|0)==30&&w&&(J=32),(J|0)==32&&(e[h>>2]=e[h>>2]|2),w=e[r>>2]|0,Bt(G)|0,t=e[L>>2]|0,e[L>>2]=0,t|0&&(m=0,ue(e[ne>>2]|0,t|0),ne=m,m=0,ne&1)&&(ne=j(0)|0,$t(ne)),b=$,w|0}while(!1);w=j()|0,Bt(G)|0,t=e[L>>2]|0,e[L>>2]=0,t?J=38:P=w}return(J|0)==38&&(m=0,ue(e[ne>>2]|0,t|0),ne=m,m=0,ne&1?(ne=j(0)|0,$t(ne)):P=w),le(P|0),0}function fh(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0;J=b,b=b+112|0,E=J+100|0,F=J+88|0,R=J+76|0,_=J+64|0,z=J+52|0,H=J+48|0,K=J+36|0,G=J+24|0,$=J+12|0,P=J;do if(t)if(t=O0(r,43956)|0,t0[e[(e[t>>2]|0)+44>>2]&127](E,t),P=e[E>>2]|0,S[o>>0]=P,S[o+1>>0]=P>>8,S[o+2>>0]=P>>16,S[o+3>>0]=P>>24,t0[e[(e[t>>2]|0)+32>>2]&127](F,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[C>>2]=e[F>>2],e[C+4>>2]=e[F+4>>2],e[C+8>>2]=e[F+8>>2],e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,Pt(F),t0[e[(e[t>>2]|0)+28>>2]&127](R,t),S[w>>0]&1?e[e[w+8>>2]>>2]=0:S[w>>0]=0,e[w+4>>2]=0,m=0,Ae(93,w|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[w>>2]=e[R>>2],e[w+4>>2]=e[R+4>>2],e[w+8>>2]=e[R+8>>2],e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,Pt(R),w=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,e[a>>2]=w,w=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,e[l>>2]=w,t0[e[(e[t>>2]|0)+20>>2]&127](_,t),S[h>>0]&1?(S[e[h+8>>2]>>0]=0,e[h+4>>2]=0):(S[h+1>>0]=0,S[h>>0]=0),m=0,Ae(91,h|0,0),l=m,m=0,l&1&&(l=j(0)|0,$t(l)),e[h>>2]=e[_>>2],e[h+4>>2]=e[_+4>>2],e[h+8>>2]=e[_+8>>2],e[_>>2]=0,e[_+4>>2]=0,e[_+8>>2]=0,de(_),t0[e[(e[t>>2]|0)+24>>2]&127](z,t),S[d>>0]&1?e[e[d+8>>2]>>2]=0:S[d>>0]=0,e[d+4>>2]=0,m=0,Ae(93,d|0,0),l=m,m=0,l&1)l=j(0)|0,$t(l);else{e[d>>2]=e[z>>2],e[d+4>>2]=e[z+4>>2],e[d+8>>2]=e[z+8>>2],e[z>>2]=0,e[z+4>>2]=0,e[z+8>>2]=0,Pt(z),L=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}else if(t=O0(r,43892)|0,t0[e[(e[t>>2]|0)+44>>2]&127](H,t),H=e[H>>2]|0,S[o>>0]=H,S[o+1>>0]=H>>8,S[o+2>>0]=H>>16,S[o+3>>0]=H>>24,t0[e[(e[t>>2]|0)+32>>2]&127](K,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[C>>2]=e[K>>2],e[C+4>>2]=e[K+4>>2],e[C+8>>2]=e[K+8>>2],e[K>>2]=0,e[K+4>>2]=0,e[K+8>>2]=0,Pt(K),t0[e[(e[t>>2]|0)+28>>2]&127](G,t),S[w>>0]&1?e[e[w+8>>2]>>2]=0:S[w>>0]=0,e[w+4>>2]=0,m=0,Ae(93,w|0,0),o=m,m=0,o&1&&(o=j(0)|0,$t(o)),e[w>>2]=e[G>>2],e[w+4>>2]=e[G+4>>2],e[w+8>>2]=e[G+8>>2],e[G>>2]=0,e[G+4>>2]=0,e[G+8>>2]=0,Pt(G),w=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,e[a>>2]=w,w=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,e[l>>2]=w,t0[e[(e[t>>2]|0)+20>>2]&127]($,t),S[h>>0]&1?(S[e[h+8>>2]>>0]=0,e[h+4>>2]=0):(S[h+1>>0]=0,S[h>>0]=0),m=0,Ae(91,h|0,0),l=m,m=0,l&1&&(l=j(0)|0,$t(l)),e[h>>2]=e[$>>2],e[h+4>>2]=e[$+4>>2],e[h+8>>2]=e[$+8>>2],e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,de($),t0[e[(e[t>>2]|0)+24>>2]&127](P,t),S[d>>0]&1?e[e[d+8>>2]>>2]=0:S[d>>0]=0,e[d+4>>2]=0,m=0,Ae(93,d|0,0),l=m,m=0,l&1)l=j(0)|0,$t(l);else{e[d>>2]=e[P>>2],e[d+4>>2]=e[P+4>>2],e[d+8>>2]=e[P+8>>2],e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,Pt(P),L=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}while(!1);e[D>>2]=L,b=J}function hh(t){t=t|0}function dh(t){t=t|0,he(t)}function ph(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=+h;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0;re=b,b=b+384|0,K=re+8|0,d=re,C=re+284|0,D=re+72|0,w=re+184|0,Ee=re+68|0,J=re+80|0,$=re+77|0,ne=re+76|0,ke=re+56|0,it=re+44|0,Te=re+32|0,E=re+28|0,H=re+84|0,L=re+24|0,P=re+20|0,G=re+16|0,e[D>>2]=C,B[K>>3]=h,C=Mo(C,100,59018,K)|0;do if(C>>>0>99)if(m=0,t=Ce(3)|0,ae=m,m=0,!(ae&1)&&(m=0,B[d>>3]=h,_=Pe(17,D|0,t|0,59018,d|0)|0,ae=m,m=0,!(ae&1))){if(t=e[D>>2]|0,!t){if(m=0,bt(6),ae=m,m=0,ae&1){t=0,d=0,ae=7;break}t=e[D>>2]|0}w=E0(_)|0,d=w,w?(z=w,ae=10):(m=0,bt(6),ae=m,m=0,ae&1?ae=7:(z=0,ae=10))}else t=0,d=0,ae=7;else d=0,t=0,z=w,_=C,ae=10;while(!1);if((ae|0)==10)if(m=0,w=ge(68,a|0)|0,R=m,m=0,R&1)ae=7;else{if(e[Ee>>2]=w,m=0,R=Ne(37,Ee|0,44220)|0,F=m,m=0,!(F&1)&&(F=e[D>>2]|0,m=0,Pe(e[(e[R>>2]|0)+32>>2]|0,R|0,F|0,F+_|0,z|0)|0,F=m,m=0,!(F&1))){if(_?F=(S[e[D>>2]>>0]|0)==45:F=0,e[ke>>2]=0,e[ke+4>>2]=0,e[ke+8>>2]=0,e[it>>2]=0,e[it+4>>2]=0,e[it+8>>2]=0,e[Te>>2]=0,e[Te+4>>2]=0,e[Te+8>>2]=0,m=0,I0(3,o|0,F|0,Ee|0,J|0,$|0,ne|0,ke|0,it|0,Te|0,E|0),o=m,m=0,o&1)C=j()|0;else{if(E=e[E>>2]|0,(_|0)>(E|0)?(o=S[Te>>0]|0,C=S[it>>0]|0,C=(_-E<<1|1)+E+(o&1?e[Te+4>>2]|0:(o&255)>>>1)+(C&1?e[it+4>>2]|0:(C&255)>>>1)|0):(o=S[Te>>0]|0,C=S[it>>0]|0,C=E+2+(o&1?e[Te+4>>2]|0:(o&255)>>>1)+(C&1?e[it+4>>2]|0:(C&255)>>>1)|0),C>>>0>100?(C=E0(C)|0,D=C,C?ae=26:(m=0,bt(6),H=m,m=0,H&1||(C=0,ae=26))):(D=0,C=H,ae=26),(ae|0)==26&&(m=0,Zt(1,C|0,L|0,P|0,e[a+4>>2]|0,z|0,z+_|0,R|0,F|0,J|0,S[$>>0]|0,S[ne>>0]|0,ke|0,it|0,Te|0,E|0),ne=m,m=0,!(ne&1)&&(e[G>>2]=e[r>>2],r=e[L>>2]|0,ce=e[P>>2]|0,m=0,e[K>>2]=e[G>>2],ce=Vt(39,K|0,C|0,r|0,ce|0,a|0,l|0)|0,r=m,m=0,!(r&1))))return D&&(n0(D),w=e[Ee>>2]|0),de(Te),de(it),de(ke),Bt(w)|0,d&&n0(d),t&&n0(t),b=re,ce|0;C=j()|0,D&&(n0(D),w=e[Ee>>2]|0)}de(Te),de(it),de(ke)}else C=j()|0;Bt(w)|0}return(ae|0)==7&&(C=j()|0),d&&n0(d),t&&n0(t),le(C|0),0}function mh(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ce=b,b=b+112|0,R=ce+108|0,_=ce+96|0,K=ce+92|0,G=ce+80|0,$=ce+68|0,P=ce+56|0,L=ce+52|0,J=ce+40|0,ne=ce+36|0,ae=ce+24|0,z=ce+12|0,H=ce;do if(t){t=O0(o,43828)|0,o=e[t>>2]|0;do if(r)if(t0[e[o+44>>2]&127](R,t),r=e[R>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+32>>2]&127](_,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[_>>2],e[C+4>>2]=e[_+4>>2],e[C+8>>2]=e[_+8>>2],e[_>>2]=0,e[_+4>>2]=0,e[_+8>>2]=0,de(_),F=t;break}else if(t0[e[o+40>>2]&127](K,t),r=e[K>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+28>>2]&127](G,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[G>>2],e[C+4>>2]=e[G+4>>2],e[C+8>>2]=e[G+8>>2],e[G>>2]=0,e[G+4>>2]=0,e[G+8>>2]=0,de(G),F=t;break}while(!1);if(C=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,S[l>>0]=C,C=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,S[h>>0]=C,t0[e[(e[F>>2]|0)+20>>2]&127]($,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),h=m,m=0,h&1&&(h=j(0)|0,$t(h)),e[d>>2]=e[$>>2],e[d+4>>2]=e[$+4>>2],e[d+8>>2]=e[$+8>>2],e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,de($),t0[e[(e[F>>2]|0)+24>>2]&127](P,t),S[w>>0]&1?(S[e[w+8>>2]>>0]=0,e[w+4>>2]=0):(S[w+1>>0]=0,S[w>>0]=0),m=0,Ae(91,w|0,0),h=m,m=0,h&1)h=j(0)|0,$t(h);else{e[w>>2]=e[P>>2],e[w+4>>2]=e[P+4>>2],e[w+8>>2]=e[P+8>>2],e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,de(P),re=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}}else{t=O0(o,43764)|0,o=e[t>>2]|0;do if(r)if(t0[e[o+44>>2]&127](L,t),r=e[L>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+32>>2]&127](J,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[J>>2],e[C+4>>2]=e[J+4>>2],e[C+8>>2]=e[J+8>>2],e[J>>2]=0,e[J+4>>2]=0,e[J+8>>2]=0,de(J),E=t;break}else if(t0[e[o+40>>2]&127](ne,t),r=e[ne>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+28>>2]&127](ae,t),S[C>>0]&1?(S[e[C+8>>2]>>0]=0,e[C+4>>2]=0):(S[C+1>>0]=0,S[C>>0]=0),m=0,Ae(91,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[ae>>2],e[C+4>>2]=e[ae+4>>2],e[C+8>>2]=e[ae+8>>2],e[ae>>2]=0,e[ae+4>>2]=0,e[ae+8>>2]=0,de(ae),E=t;break}while(!1);if(C=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,S[l>>0]=C,C=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,S[h>>0]=C,t0[e[(e[E>>2]|0)+20>>2]&127](z,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),h=m,m=0,h&1&&(h=j(0)|0,$t(h)),e[d>>2]=e[z>>2],e[d+4>>2]=e[z+4>>2],e[d+8>>2]=e[z+8>>2],e[z>>2]=0,e[z+4>>2]=0,e[z+8>>2]=0,de(z),t0[e[(e[E>>2]|0)+24>>2]&127](H,t),S[w>>0]&1?(S[e[w+8>>2]>>0]=0,e[w+4>>2]=0):(S[w+1>>0]=0,S[w>>0]=0),m=0,Ae(91,w|0,0),h=m,m=0,h&1)h=j(0)|0,$t(h);else{e[w>>2]=e[H>>2],e[w+4>>2]=e[H+4>>2],e[w+8>>2]=e[H+8>>2],e[H>>2]=0,e[H+4>>2]=0,e[H+8>>2]=0,de(H),re=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}}while(!1);e[D>>2]=re,b=ce}function gh(t,r,o,a,l,h,d,w,C,D,E,F,R,_,z){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,R=R|0,_=_|0,z=z|0;var H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0;e[o>>2]=t,Kt=_+4|0,pt=_+8|0,At=_+1|0,jt=R+4|0,Gt=(a&512|0)==0,s0=R+8|0,i0=R+1|0,zt=d+8|0,gt=(z|0)>0,ae=F+4|0,re=F+8|0,ce=F+1|0,Ee=z+1|0,Te=-2-z-((z|0)<0?~z:-1)|0,it=(z|0)>0,ne=0;do{switch(S[C+ne>>0]|0){case 0:{e[r>>2]=e[o>>2];break}case 1:{e[r>>2]=e[o>>2],L=U0[e[(e[d>>2]|0)+28>>2]&63](d,32)|0,J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=L;break}case 3:{J=S[_>>0]|0,H=(J&1)==0,(H?(J&255)>>>1:e[Kt>>2]|0)|0&&(L=S[(H?At:e[pt>>2]|0)>>0]|0,J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=L);break}case 2:{if(G=S[R>>0]|0,H=(G&1)==0,G=H?(G&255)>>>1:e[jt>>2]|0,!(Gt|(G|0)==0)){if(K=H?i0:e[s0>>2]|0,$=K+G|0,H=e[o>>2]|0,G)do S[H>>0]=S[K>>0]|0,K=K+1|0,H=H+1|0;while((K|0)!=($|0));e[o>>2]=H}break}case 4:{H=e[o>>2]|0,l=w?l+1|0:l,P=l,$=e[zt>>2]|0;e:do if(l>>>0>>0){K=l;do{if(G=S[K>>0]|0,G<<24>>24<=-1||!(k[$+(G<<24>>24<<1)>>1]&2048))break e;K=K+1|0}while(K>>>0>>0)}else K=l;while(!1);if(G=K,gt){if(L=-2-G-~(G>>>0>P>>>0?P:G)|0,L=Te>>>0>L>>>0?Te:L,K>>>0>l>>>0&it)for(G=K,P=z;G=G+-1|0,J=S[G>>0]|0,$=e[o>>2]|0,e[o>>2]=$+1,S[$>>0]=J,$=(P|0)>1,G>>>0>l>>>0&$;)P=P+-1|0;else $=it;if(J=Ee+L|0,G=K+(L+1)|0,$?P=U0[e[(e[d>>2]|0)+28>>2]&63](d,48)|0:P=0,K=e[o>>2]|0,e[o>>2]=K+1,(J|0)>0)for($=J;S[K>>0]=P,K=e[o>>2]|0,e[o>>2]=K+1,($|0)>1;)$=$+-1|0;S[K>>0]=D}else G=K;if((G|0)!=(l|0)){if(J=S[F>>0]|0,K=(J&1)==0,(K?(J&255)>>>1:e[ae>>2]|0)|0?K=S[(K?ce:e[re>>2]|0)>>0]|0:K=-1,(G|0)!=(l|0))for($=0,P=0;(P|0)==(K|0)&&(J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=E,$=$+1|0,J=S[F>>0]|0,K=(J&1)==0,$>>>0<(K?(J&255)>>>1:e[ae>>2]|0)>>>0?(K=S[(K?ce:e[re>>2]|0)+$>>0]|0,K=K<<24>>24==127?-1:K<<24>>24,P=0):(K=P,P=0)),G=G+-1|0,L=S[G>>0]|0,J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=L,(G|0)!=(l|0);)P=P+1|0}else L=U0[e[(e[d>>2]|0)+28>>2]&63](d,48)|0,J=e[o>>2]|0,e[o>>2]=J+1,S[J>>0]=L;if(K=e[o>>2]|0,(H|0)!=(K|0)&&(ke=K+-1|0,H>>>0>>0)){K=ke;do J=S[H>>0]|0,S[H>>0]=S[K>>0]|0,S[K>>0]=J,H=H+1|0,K=K+-1|0;while(H>>>0>>0)}break}default:}ne=ne+1|0}while((ne|0)!=4);if(K=S[_>>0]|0,l=(K&1)==0,K=l?(K&255)>>>1:e[Kt>>2]|0,K>>>0>1){if(H=l?At:e[pt>>2]|0,G=H+K|0,l=e[o>>2]|0,(K|0)!=1){H=H+1|0;do S[l>>0]=S[H>>0]|0,l=l+1|0,H=H+1|0;while((H|0)!=(G|0))}e[o>>2]=l}switch(a&176|0){case 32:{e[r>>2]=e[o>>2];break}case 16:break;default:e[r>>2]=t}}function Sh(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;J=b,b=b+176|0,_=J+56|0,ae=J+52|0,P=J+64|0,K=J+61|0,L=J+60|0,re=J+40|0,Ee=J+28|0,ce=J+16|0,D=J+12|0,R=J+68|0,$=J+8|0,G=J+4|0,z=J,t=f0(a)|0,e[ae>>2]=t,m=0,H=Ne(37,ae|0,44220)|0,F=m,m=0;do if(F&1)ke=13;else{if(E=S[h>>0]|0,d=(E&1)==0,F=h+4|0,!((d?(E&255)>>>1:e[F>>2]|0)|0))E=0;else{if(d=S[(d?h+1|0:e[h+8>>2]|0)>>0]|0,m=0,w=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,45)|0,E=m,m=0,E&1){ke=13;break}E=d<<24>>24==w<<24>>24}if(e[re>>2]=0,e[re+4>>2]=0,e[re+8>>2]=0,e[Ee>>2]=0,e[Ee+4>>2]=0,e[Ee+8>>2]=0,e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,m=0,I0(3,o|0,E|0,ae|0,P|0,K|0,L|0,re|0,Ee|0,ce|0,D|0),C=m,m=0,C&1)d=j()|0;else{if(C=S[h>>0]|0,o=e[F>>2]|0,d=C&1?o:(C&255)>>>1,D=e[D>>2]|0,(d|0)>(D|0)?(Te=S[ce>>0]|0,w=S[Ee>>0]|0,d=(d-D<<1|1)+D+(Te&1?e[ce+4>>2]|0:(Te&255)>>>1)+(w&1?e[Ee+4>>2]|0:(w&255)>>>1)|0):(Te=S[ce>>0]|0,d=S[Ee>>0]|0,d=D+2+(Te&1?e[ce+4>>2]|0:(Te&255)>>>1)+(d&1?e[Ee+4>>2]|0:(d&255)>>>1)|0),d>>>0>100?(d=E0(d)|0,w=d,d?ke=17:(m=0,bt(6),Te=m,m=0,Te&1||(C=S[h>>0]|0,o=e[F>>2]|0,d=0,ke=17))):(w=0,d=R,ke=17),(ke|0)==17&&(Te=(C&1)==0,h=Te?h+1|0:e[h+8>>2]|0,m=0,Zt(1,d|0,$|0,G|0,e[a+4>>2]|0,h|0,h+(Te?(C&255)>>>1:o)|0,H|0,E|0,P|0,S[K>>0]|0,S[L>>0]|0,re|0,Ee|0,ce|0,D|0),Te=m,m=0,!(Te&1)&&(e[z>>2]=e[r>>2],Te=e[$>>2]|0,ne=e[G>>2]|0,m=0,e[_>>2]=e[z>>2],ne=Vt(39,_|0,d|0,Te|0,ne|0,a|0,l|0)|0,Te=m,m=0,!(Te&1))))return w&&(n0(w),t=e[ae>>2]|0),de(ce),de(Ee),de(re),Bt(t)|0,b=J,ne|0;d=j()|0,w&&(n0(w),t=e[ae>>2]|0)}de(ce),de(Ee),de(re)}while(!1);return(ke|0)==13&&(d=j()|0),Bt(t)|0,le(d|0),0}function Ah(t){t=t|0}function vh(t){t=t|0,he(t)}function xh(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=+h;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0;re=b,b=b+992|0,K=re+8|0,d=re,C=re+888|0,D=re+880|0,w=re+480|0,Ee=re+76|0,J=re+884|0,$=re+72|0,ne=re+68|0,ke=re+56|0,it=re+44|0,Te=re+32|0,E=re+28|0,H=re+80|0,L=re+24|0,P=re+20|0,G=re+16|0,e[D>>2]=C,B[K>>3]=h,C=Mo(C,100,59018,K)|0;do if(C>>>0>99)if(m=0,t=Ce(3)|0,ae=m,m=0,!(ae&1)&&(m=0,B[d>>3]=h,_=Pe(17,D|0,t|0,59018,d|0)|0,ae=m,m=0,!(ae&1))){if(t=e[D>>2]|0,!t){if(m=0,bt(6),ae=m,m=0,ae&1){t=0,d=0,ae=7;break}t=e[D>>2]|0}w=E0(_<<2)|0,d=w,w?(z=w,ae=10):(m=0,bt(6),ae=m,m=0,ae&1?ae=7:(z=0,ae=10))}else t=0,d=0,ae=7;else d=0,t=0,z=w,_=C,ae=10;while(!1);if((ae|0)==10)if(m=0,w=ge(68,a|0)|0,R=m,m=0,R&1)ae=7;else{if(e[Ee>>2]=w,m=0,R=Ne(37,Ee|0,44212)|0,F=m,m=0,!(F&1)&&(F=e[D>>2]|0,m=0,Pe(e[(e[R>>2]|0)+48>>2]|0,R|0,F|0,F+_|0,z|0)|0,F=m,m=0,!(F&1))){if(_?F=(S[e[D>>2]>>0]|0)==45:F=0,e[ke>>2]=0,e[ke+4>>2]=0,e[ke+8>>2]=0,e[it>>2]=0,e[it+4>>2]=0,e[it+8>>2]=0,e[Te>>2]=0,e[Te+4>>2]=0,e[Te+8>>2]=0,m=0,I0(4,o|0,F|0,Ee|0,J|0,$|0,ne|0,ke|0,it|0,Te|0,E|0),o=m,m=0,o&1)C=j()|0;else{if(E=e[E>>2]|0,(_|0)>(E|0)?(o=S[Te>>0]|0,C=S[it>>0]|0,C=(_-E<<1|1)+E+(o&1?e[Te+4>>2]|0:(o&255)>>>1)+(C&1?e[it+4>>2]|0:(C&255)>>>1)|0):(o=S[Te>>0]|0,C=S[it>>0]|0,C=E+2+(o&1?e[Te+4>>2]|0:(o&255)>>>1)+(C&1?e[it+4>>2]|0:(C&255)>>>1)|0),C>>>0>100?(C=E0(C<<2)|0,D=C,C?ae=26:(m=0,bt(6),H=m,m=0,H&1||(C=0,ae=26))):(D=0,C=H,ae=26),(ae|0)==26&&(m=0,Zt(2,C|0,L|0,P|0,e[a+4>>2]|0,z|0,z+(_<<2)|0,R|0,F|0,J|0,e[$>>2]|0,e[ne>>2]|0,ke|0,it|0,Te|0,E|0),ne=m,m=0,!(ne&1)&&(e[G>>2]=e[r>>2],r=e[L>>2]|0,ce=e[P>>2]|0,m=0,e[K>>2]=e[G>>2],ce=Vt(40,K|0,C|0,r|0,ce|0,a|0,l|0)|0,r=m,m=0,!(r&1))))return D&&(n0(D),w=e[Ee>>2]|0),Pt(Te),Pt(it),de(ke),Bt(w)|0,d&&n0(d),t&&n0(t),b=re,ce|0;C=j()|0,D&&(n0(D),w=e[Ee>>2]|0)}Pt(Te),Pt(it),de(ke)}else C=j()|0;Bt(w)|0}return(ae|0)==7&&(C=j()|0),d&&n0(d),t&&n0(t),le(C|0),0}function wh(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0;ae=b,b=b+112|0,E=ae+108|0,F=ae+96|0,z=ae+92|0,H=ae+80|0,K=ae+68|0,G=ae+56|0,$=ae+52|0,P=ae+40|0,L=ae+36|0,J=ae+24|0,R=ae+12|0,_=ae;do if(t){t=O0(o,43956)|0,o=e[t>>2]|0;do if(r)if(t0[e[o+44>>2]&127](E,t),r=e[E>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+32>>2]&127](F,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[F>>2],e[C+4>>2]=e[F+4>>2],e[C+8>>2]=e[F+8>>2],e[F>>2]=0,e[F+4>>2]=0,e[F+8>>2]=0,Pt(F);break}else if(t0[e[o+40>>2]&127](z,t),r=e[z>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+28>>2]&127](H,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[H>>2],e[C+4>>2]=e[H+4>>2],e[C+8>>2]=e[H+8>>2],e[H>>2]=0,e[H+4>>2]=0,e[H+8>>2]=0,Pt(H);break}while(!1);if(C=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,e[l>>2]=C,C=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,e[h>>2]=C,t0[e[(e[t>>2]|0)+20>>2]&127](K,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),h=m,m=0,h&1&&(h=j(0)|0,$t(h)),e[d>>2]=e[K>>2],e[d+4>>2]=e[K+4>>2],e[d+8>>2]=e[K+8>>2],e[K>>2]=0,e[K+4>>2]=0,e[K+8>>2]=0,de(K),t0[e[(e[t>>2]|0)+24>>2]&127](G,t),S[w>>0]&1?e[e[w+8>>2]>>2]=0:S[w>>0]=0,e[w+4>>2]=0,m=0,Ae(93,w|0,0),h=m,m=0,h&1)h=j(0)|0,$t(h);else{e[w>>2]=e[G>>2],e[w+4>>2]=e[G+4>>2],e[w+8>>2]=e[G+8>>2],e[G>>2]=0,e[G+4>>2]=0,e[G+8>>2]=0,Pt(G),ne=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}}else{t=O0(o,43892)|0,o=e[t>>2]|0;do if(r)if(t0[e[o+44>>2]&127]($,t),r=e[$>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+32>>2]&127](P,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[P>>2],e[C+4>>2]=e[P+4>>2],e[C+8>>2]=e[P+8>>2],e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,Pt(P);break}else if(t0[e[o+40>>2]&127](L,t),r=e[L>>2]|0,S[a>>0]=r,S[a+1>>0]=r>>8,S[a+2>>0]=r>>16,S[a+3>>0]=r>>24,t0[e[(e[t>>2]|0)+28>>2]&127](J,t),S[C>>0]&1?e[e[C+8>>2]>>2]=0:S[C>>0]=0,e[C+4>>2]=0,m=0,Ae(93,C|0,0),a=m,m=0,a&1)C=j(0)|0,$t(C);else{e[C>>2]=e[J>>2],e[C+4>>2]=e[J+4>>2],e[C+8>>2]=e[J+8>>2],e[J>>2]=0,e[J+4>>2]=0,e[J+8>>2]=0,Pt(J);break}while(!1);if(C=Et[e[(e[t>>2]|0)+12>>2]&127](t)|0,e[l>>2]=C,C=Et[e[(e[t>>2]|0)+16>>2]&127](t)|0,e[h>>2]=C,t0[e[(e[t>>2]|0)+20>>2]&127](R,t),S[d>>0]&1?(S[e[d+8>>2]>>0]=0,e[d+4>>2]=0):(S[d+1>>0]=0,S[d>>0]=0),m=0,Ae(91,d|0,0),h=m,m=0,h&1&&(h=j(0)|0,$t(h)),e[d>>2]=e[R>>2],e[d+4>>2]=e[R+4>>2],e[d+8>>2]=e[R+8>>2],e[R>>2]=0,e[R+4>>2]=0,e[R+8>>2]=0,de(R),t0[e[(e[t>>2]|0)+24>>2]&127](_,t),S[w>>0]&1?e[e[w+8>>2]>>2]=0:S[w>>0]=0,e[w+4>>2]=0,m=0,Ae(93,w|0,0),h=m,m=0,h&1)h=j(0)|0,$t(h);else{e[w>>2]=e[_>>2],e[w+4>>2]=e[_+4>>2],e[w+8>>2]=e[_+8>>2],e[_>>2]=0,e[_+4>>2]=0,e[_+8>>2]=0,Pt(_),ne=Et[e[(e[t>>2]|0)+36>>2]&127](t)|0;break}}while(!1);e[D>>2]=ne,b=ae}function yh(t,r,o,a,l,h,d,w,C,D,E,F,R,_,z){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,R=R|0,_=_|0,z=z|0;var H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0;e[o>>2]=t,i0=_+4|0,zt=_+8|0,Ee=R+4|0,ke=(a&512|0)==0,Te=R+8|0,it=(z|0)>0,jt=F+4|0,Gt=F+8|0,s0=F+1|0,re=(z|0)>0,ae=0;do{switch(S[C+ae>>0]|0){case 0:{e[r>>2]=e[o>>2];break}case 1:{e[r>>2]=e[o>>2],J=U0[e[(e[d>>2]|0)+44>>2]&63](d,32)|0,ne=e[o>>2]|0,e[o>>2]=ne+4,e[ne>>2]=J;break}case 3:{ne=S[_>>0]|0,H=(ne&1)==0,(H?(ne&255)>>>1:e[i0>>2]|0)|0&&(J=e[(H?i0:e[zt>>2]|0)>>2]|0,ne=e[o>>2]|0,e[o>>2]=ne+4,e[ne>>2]=J);break}case 2:{if(P=S[R>>0]|0,H=(P&1)==0,P=H?(P&255)>>>1:e[Ee>>2]|0,!(ke|(P|0)==0)){if(H=H?Ee:e[Te>>2]|0,G=H+(P<<2)|0,$=e[o>>2]|0,P)for(K=$;e[K>>2]=e[H>>2],H=H+4|0,(H|0)!=(G|0);)K=K+4|0;e[o>>2]=$+(P<<2)}break}case 4:{H=e[o>>2]|0,l=w?l+4|0:l;e:do if(l>>>0>>0){K=l;do{if(!(Yt[e[(e[d>>2]|0)+12>>2]&63](d,2048,e[K>>2]|0)|0))break e;K=K+4|0}while(K>>>0>>0)}else K=l;while(!1);if(it){if(K>>>0>l>>>0&re){for(P=e[o>>2]|0,$=z;;)if(K=K+-4|0,G=P+4|0,e[P>>2]=e[K>>2],L=$+-1|0,$=($|0)>1,K>>>0>l>>>0&$)P=G,$=L;else{P=L;break}e[o>>2]=G,G=P}else $=re,G=z;if($?L=U0[e[(e[d>>2]|0)+44>>2]&63](d,48)|0:L=0,J=e[o>>2]|0,$=G+((G|0)<0?~G:-1)|0,(G|0)>0)for(P=J;e[P>>2]=L,(G|0)>1;)P=P+4|0,G=G+-1|0;e[o>>2]=J+($+2<<2),e[J+($+1<<2)>>2]=D}if((K|0)==(l|0))J=U0[e[(e[d>>2]|0)+44>>2]&63](d,48)|0,ne=e[o>>2]|0,K=ne+4|0,e[o>>2]=K,e[ne>>2]=J;else{if(J=S[F>>0]|0,G=(J&1)==0,ne=e[jt>>2]|0,(G?(J&255)>>>1:ne)|0?G=S[(G?s0:e[Gt>>2]|0)>>0]|0:G=-1,(K|0)!=(l|0))for(L=0,J=0;$=e[o>>2]|0,(J|0)==(G|0)?(P=$+4|0,e[o>>2]=P,e[$>>2]=E,L=L+1|0,$=S[F>>0]|0,G=($&1)==0,L>>>0<(G?($&255)>>>1:ne)>>>0?(G=S[(G?s0:e[Gt>>2]|0)+L>>0]|0,$=P,G=G<<24>>24==127?-1:G<<24>>24,P=0):($=P,G=J,P=0)):P=J,K=K+-4|0,J=e[K>>2]|0,e[o>>2]=$+4,e[$>>2]=J,(K|0)!=(l|0);)J=P+1|0;K=e[o>>2]|0}if((H|0)!=(K|0)&&(ce=K+-4|0,H>>>0>>0)){K=ce;do ne=e[H>>2]|0,e[H>>2]=e[K>>2],e[K>>2]=ne,H=H+4|0,K=K+-4|0;while(H>>>0>>0)}break}default:}ae=ae+1|0}while((ae|0)!=4);if(H=S[_>>0]|0,l=(H&1)==0,H=l?(H&255)>>>1:e[i0>>2]|0,H>>>0>1){if(K=l?i0:e[zt>>2]|0,l=K+4|0,K=K+(H<<2)|0,G=e[o>>2]|0,$=K-l|0,(H|0)!=1)for(H=G;e[H>>2]=e[l>>2],l=l+4|0,(l|0)!=(K|0);)H=H+4|0;e[o>>2]=G+($>>>2<<2)}switch(a&176|0){case 32:{e[r>>2]=e[o>>2];break}case 16:break;default:e[r>>2]=t}}function Ch(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;J=b,b=b+480|0,R=J+468|0,ae=J+464|0,P=J+472|0,K=J+56|0,L=J+52|0,re=J+40|0,Ee=J+28|0,ce=J+16|0,D=J+12|0,F=J+64|0,$=J+8|0,G=J+4|0,_=J,t=f0(a)|0,e[ae>>2]=t,m=0,z=Ne(37,ae|0,44212)|0,H=m,m=0;do if(H&1)ke=13;else{if(E=S[h>>0]|0,d=(E&1)==0,H=h+4|0,!((d?(E&255)>>>1:e[H>>2]|0)|0))E=0;else{if(d=e[(d?H:e[h+8>>2]|0)>>2]|0,m=0,w=Ne(e[(e[z>>2]|0)+44>>2]|0,z|0,45)|0,E=m,m=0,E&1){ke=13;break}E=(d|0)==(w|0)}if(e[re>>2]=0,e[re+4>>2]=0,e[re+8>>2]=0,e[Ee>>2]=0,e[Ee+4>>2]=0,e[Ee+8>>2]=0,e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,m=0,I0(4,o|0,E|0,ae|0,P|0,K|0,L|0,re|0,Ee|0,ce|0,D|0),C=m,m=0,C&1)d=j()|0;else{if(C=S[h>>0]|0,o=e[H>>2]|0,d=C&1?o:(C&255)>>>1,D=e[D>>2]|0,(d|0)>(D|0)?(Te=S[ce>>0]|0,w=S[Ee>>0]|0,d=(d-D<<1|1)+D+(Te&1?e[ce+4>>2]|0:(Te&255)>>>1)+(w&1?e[Ee+4>>2]|0:(w&255)>>>1)|0):(Te=S[ce>>0]|0,d=S[Ee>>0]|0,d=D+2+(Te&1?e[ce+4>>2]|0:(Te&255)>>>1)+(d&1?e[Ee+4>>2]|0:(d&255)>>>1)|0),d>>>0>100?(d=E0(d<<2)|0,w=d,d?ke=17:(m=0,bt(6),Te=m,m=0,Te&1||(C=S[h>>0]|0,o=e[H>>2]|0,d=0,ke=17))):(w=0,d=F,ke=17),(ke|0)==17&&(Te=(C&1)==0,h=Te?H:e[h+8>>2]|0,m=0,Zt(2,d|0,$|0,G|0,e[a+4>>2]|0,h|0,h+((Te?(C&255)>>>1:o)<<2)|0,z|0,E|0,P|0,e[K>>2]|0,e[L>>2]|0,re|0,Ee|0,ce|0,D|0),Te=m,m=0,!(Te&1)&&(e[_>>2]=e[r>>2],Te=e[$>>2]|0,ne=e[G>>2]|0,m=0,e[R>>2]=e[_>>2],ne=Vt(40,R|0,d|0,Te|0,ne|0,a|0,l|0)|0,Te=m,m=0,!(Te&1))))return w&&(n0(w),t=e[ae>>2]|0),Pt(ce),Pt(Ee),de(re),Bt(t)|0,b=J,ne|0;d=j()|0,w&&(n0(w),t=e[ae>>2]|0)}Pt(ce),Pt(Ee),de(re)}while(!1);return(ke|0)==13&&(d=j()|0),Bt(t)|0,le(d|0),0}function Th(t){t=t|0}function Ih(t){t=t|0,he(t)}function kh(t,r,o){return t=t|0,r=r|0,o=o|0,t=yo(S[r>>0]&1?e[r+8>>2]|0:r+1|0,1)|0,t>>>((t|0)!=-1&1)|0}function Eh(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0;w=b,b=b+16|0,C=w,e[C>>2]=0,e[C+4>>2]=0,e[C+8>>2]=0,d=S[h>>0]|0,D=(d&1)==0,r=D?h+1|0:e[h+8>>2]|0,d=D?(d&255)>>>1:e[h+4>>2]|0,h=r+d|0;e:do if((d|0)>0){for(;m=0,Ae(67,C|0,S[r>>0]|0),D=m,m=0,!(D&1);)if(r=r+1|0,r>>>0>=h>>>0){d=4;break e}r=j()|0,d=7}else d=4;while(!1);e:do if((d|0)==4){if(m=0,r=Pe(19,((o|0)==-1?-1:o<<1)|0,a|0,l|0,(S[C>>0]&1?e[C+8>>2]|0:C+1|0)|0)|0,D=m,m=0,D&1){r=j()|0,d=7;break}e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,D=$i(r)|0,h=r+D|0;t:do if((D|0)>0){for(;m=0,Ae(67,t|0,S[r>>0]|0),D=m,m=0,!(D&1);)if(r=r+1|0,r>>>0>=h>>>0)break t;r=j()|0,de(t);break e}while(!1);de(C),b=w;return}while(!1);de(C),le(r|0)}function Dh(t,r){t=t|0,r=r|0}function bh(t){t=t|0}function Fh(t){t=t|0,he(t)}function Nh(t,r,o){return t=t|0,r=r|0,o=o|0,t=yo(S[r>>0]&1?e[r+8>>2]|0:r+1|0,1)|0,t>>>((t|0)!=-1&1)|0}function Rh(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;$=b,b=b+224|0,F=$+184|0,E=$+192|0,D=$+180|0,R=$+176|0,K=$+168|0,H=$+40|0,z=$+32|0,G=$+28|0,P=$+16|0,C=$+8|0,_=$,e[P>>2]=0,e[P+4>>2]=0,e[P+8>>2]=0,e[C+4>>2]=0,e[C>>2]=44696,w=S[h>>0]|0,L=(w&1)==0,d=h+4|0,r=L?d:e[h+8>>2]|0,h=L?(w&255)>>>1:e[d>>2]|0,d=r+(h<<2)|0,w=E+32|0;e:do if((h|0)>0){t:for(;;){if(e[R>>2]=r,m=0,h=Xt(e[(e[C>>2]|0)+12>>2]|0,C|0,F|0,r|0,d|0,R|0,E|0,w|0,D|0)|0,L=m,m=0,L&1){h=12;break}if((h|0)==2||(e[R>>2]|0)==(r|0)){h=5;break}if(E>>>0<(e[D>>2]|0)>>>0){r=E;do{if(m=0,Ae(67,P|0,S[r>>0]|0),L=m,m=0,L&1){h=11;break t}r=r+1|0}while(r>>>0<(e[D>>2]|0)>>>0)}if(r=e[R>>2]|0,!((h|0)!=2&r>>>0>>0)){h=9;break e}}(h|0)==5?(m=0,ue(190,58955),m=0,r=j()|0):((h|0)==11||(h|0)==12)&&(r=j()|0)}else h=9;while(!1);e:do if((h|0)==9){if(m=0,r=Pe(19,((o|0)==-1?-1:o<<1)|0,a|0,l|0,(S[P>>0]&1?e[P+8>>2]|0:P+1|0)|0)|0,L=m,m=0,L&1){r=j()|0;break}e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[_+4>>2]=0,e[_>>2]=44744,L=$i(r)|0,d=r+L|0,w=d,C=H+128|0;t:do if((L|0)>0){i:for(;;){if(e[G>>2]=r,m=0,h=Xt(e[(e[_>>2]|0)+16>>2]|0,_|0,K|0,r|0,((w-r|0)>32?r+32|0:d)|0,G|0,H|0,C|0,z|0)|0,L=m,m=0,L&1){h=24;break}if((h|0)==2||(e[G>>2]|0)==(r|0)){h=18;break}if(H>>>0<(e[z>>2]|0)>>>0){r=H;do{if(m=0,Ae(92,t|0,e[r>>2]|0),L=m,m=0,L&1){h=23;break i}r=r+4|0}while(r>>>0<(e[z>>2]|0)>>>0)}if(r=e[G>>2]|0,!((h|0)!=2&r>>>0>>0))break t}(h|0)==18?(m=0,ue(190,58955),m=0,r=j()|0):((h|0)==23||(h|0)==24)&&(r=j()|0),Pt(t);break e}while(!1);de(P),b=$;return}while(!1);de(P),le(r|0)}function Mh(t,r){t=t|0,r=r|0}function _h(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0;if(e[t+4>>2]=r+-1,e[t>>2]=44196,h=t+8|0,m=0,Ae(94,h|0,28),l=m,m=0,l&1)r=j()|0;else{if(l=t+144|0,m=0,ve(5,l|0,58885,1),a=m,m=0,a&1)r=j()|0;else{if(o=e[h>>2]|0,a=t+12|0,r=e[a>>2]|0,(r|0)!=(o|0)){do r=r+-4|0;while((r|0)!=(o|0));e[a>>2]=r}e[495]=0,e[494]=43124,m=0,Ae(95,t|0,1976),a=m,m=0;do if(!(a&1)&&(e[497]=0,e[496]=43164,m=0,Ae(96,t|0,1984),a=m,m=0,!(a&1))&&(e[499]=0,e[498]=44236,e[500]=0,S[2004]=0,a=nn()|0,e[500]=a,m=0,Ae(97,t|0,1992),a=m,m=0,!(a&1))&&(e[503]=0,e[502]=44484,m=0,Ae(98,t|0,2008),a=m,m=0,!(a&1))&&(e[505]=0,e[504]=44552,m=0,Ae(99,t|0,2016),a=m,m=0,!(a&1))&&(m=0,Ae(100,2024,1),a=m,m=0,!(a&1))&&(m=0,Ae(101,t|0,2024),a=m,m=0,!(a&1))&&(e[511]=0,e[510]=44600,m=0,Ae(102,t|0,2040),a=m,m=0,!(a&1))&&(e[513]=0,e[512]=44648,m=0,Ae(103,t|0,2048),a=m,m=0,!(a&1))&&(i4(2056,1),m=0,Ae(104,t|0,2056),a=m,m=0,!(a&1))&&(n4(2080,1),m=0,Ae(105,t|0,2080),a=m,m=0,!(a&1))&&(e[529]=0,e[528]=43204,m=0,Ae(106,t|0,2112),a=m,m=0,!(a&1))&&(e[531]=0,e[530]=43276,m=0,Ae(107,t|0,2120),a=m,m=0,!(a&1))&&(e[533]=0,e[532]=43348,m=0,Ae(108,t|0,2128),a=m,m=0,!(a&1))){if(e[535]=0,e[534]=43408,m=0,Ae(109,t|0,2136),a=m,m=0,a&1){d=42;break}if(e[537]=0,e[536]=43716,m=0,Ae(110,t|0,2144),a=m,m=0,a&1){d=42;break}if(e[539]=0,e[538]=43780,m=0,Ae(111,t|0,2152),a=m,m=0,a&1){d=42;break}if(e[541]=0,e[540]=43844,m=0,Ae(112,t|0,2160),a=m,m=0,a&1){d=42;break}if(e[543]=0,e[542]=43908,m=0,Ae(113,t|0,2168),a=m,m=0,a&1){d=42;break}if(e[545]=0,e[544]=43972,m=0,Ae(114,t|0,2176),a=m,m=0,a&1){d=42;break}if(e[547]=0,e[546]=44008,m=0,Ae(115,t|0,2184),a=m,m=0,a&1){d=42;break}if(e[549]=0,e[548]=44044,m=0,Ae(116,t|0,2192),a=m,m=0,a&1){d=42;break}if(e[551]=0,e[550]=44080,m=0,Ae(117,t|0,2200),a=m,m=0,a&1){d=42;break}if(e[553]=0,e[552]=43468,e[554]=43516,m=0,Ae(118,t|0,2208),a=m,m=0,a&1){d=42;break}if(e[557]=0,e[556]=43560,e[558]=43608,m=0,Ae(119,t|0,2224),a=m,m=0,a&1){d=42;break}if(e[561]=0,e[560]=44464,m=0,r=Ce(3)|0,a=m,m=0,a&1){r=j()|0;break}if(e[562]=r,e[560]=43652,m=0,Ae(120,t|0,2240),a=m,m=0,a&1){d=42;break}if(e[565]=0,e[564]=44464,m=0,r=Ce(3)|0,a=m,m=0,a&1){r=j()|0;break}if(e[566]=r,e[564]=43684,m=0,Ae(121,t|0,2256),d=m,m=0,d&1){d=42;break}if(e[569]=0,e[568]=44116,m=0,Ae(122,t|0,2272),d=m,m=0,d&1){d=42;break}if(e[571]=0,e[570]=44156,m=0,Ae(123,t|0,2280),d=m,m=0,d&1){d=42;break}return}else d=42;while(!1);(d|0)==42&&(r=j()|0),de(l)}yr(h)}le(r|0)}function Ph(){var t=0;do if(!(S[2288]|0)&&kt(2288)|0)if(m=0,Ce(4)|0,t=m,m=0,t&1)t=j()|0,W0(2288),le(t|0);else{e[11246]=44980,Dt(2288);break}while(!1);return e[11246]|0}function w0(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;pn(r),l=t+8|0,a=e[l>>2]|0;do if((e[t+12>>2]|0)-a>>2>>>0<=o>>>0){if(m=0,Ae(124,l|0,o+1|0),t=m,m=0,!(t&1)){a=e[l>>2]|0;break}a=j()|0,r&&Bt(r)|0,le(a|0)}while(!1);t=e[a+(o<<2)>>2]|0,t&&(Bt(t)|0,a=e[l>>2]|0),e[a+(o<<2)>>2]=r}function Rs(t){t=t|0;var r=0,o=0,a=0,l=0;if(e[t>>2]=44196,a=t+8|0,l=t+12|0,r=e[a>>2]|0,(e[l>>2]|0)!=(r|0)){o=0;do r=e[r+(o<<2)>>2]|0,r&&Bt(r)|0,o=o+1|0,r=e[a>>2]|0;while(o>>>0<(e[l>>2]|0)-r>>2>>>0)}de(t+144|0),yr(a)}function Lh(t){t=t|0,Rs(t),he(t)}function Oh(t,r){return t=t|0,r=r|0,P3(t,r)|0?e[(e[t+8>>2]|0)+(r<<2)>>2]|0:(t=Ct(4)|0,B6(t),Qt(t|0,640,82),0)}function $h(){return _h(2296,1),e[11245]=2296,44980}function Bh(){var t=0;return t=Ph()|0,t=e[t>>2]|0,e[11247]=t,pn(t),44988}function Vh(){var t=0;do if(!(S[2456]|0)&&kt(2456)|0)if(m=0,Ce(5)|0,t=m,m=0,t&1)t=j()|0,W0(2456),le(t|0);else{e[11248]=44988,Dt(2456);break}while(!1);return e[11248]|0}function ur(t){t=t|0;var r=0,o=0;if(m=0,r=Ce(6)|0,o=m,m=0,o&1)o=j(0)|0,$t(o);else{o=e[r>>2]|0,e[t>>2]=o,pn(o);return}}function tn(t,r){t=t|0,r=r|0,r=e[r>>2]|0,e[t>>2]=r,pn(r)}function _0(t){t=t|0,Bt(e[t>>2]|0)|0}function x0(t){t=t|0;var r=0,o=0;return o=b,b=b+16|0,r=o,(e[t>>2]|0)!=-1&&(e[r>>2]=t,e[r+4>>2]=191,e[r+8>>2]=0,gp(t,r,192)),b=o,(e[t+4>>2]|0)+-1|0}function O0(t,r){return t=t|0,r=r|0,t=e[t>>2]|0,Oh(t,x0(r)|0)|0}function Uh(t){t=t|0,he(t)}function Gh(t){t=t|0,t&&Rt[e[(e[t>>2]|0)+4>>2]&255](t)}function qh(t){t=t|0;var r=0;r=e[11052]|0,e[11052]=r+1,e[t+4>>2]=r+1}function Wh(t){t=t|0,he(t)}function Hh(t,r,o){return t=t|0,r=r|0,o=o|0,o>>>0<128?(o=(nn()|0)+(o<<1)|0,o=(k[o>>1]&r)<<16>>16!=0):o=0,o|0}function nn(){var t=0,r=0;if(m=0,t=Ce(7)|0,r=m,m=0,r&1)r=j(0)|0,$t(r);else return e[t>>2]|0;return 0}function Qh(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(h=(o-r|0)>>>2,(r|0)!=(o|0))for(l=r;t=e[l>>2]|0,t>>>0<128?(t=(nn()|0)+(t<<1)|0,t=M[t>>1]|0):t=0,k[a>>1]=t,l=l+4|0,(l|0)!=(o|0);)a=a+2|0;return r+(h<<2)|0}function Kh(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;e:do if((o|0)==(a|0))o=a;else for(;;){if(t=e[o>>2]|0,t>>>0<128&&(t=(nn()|0)+(t<<1)|0,(k[t>>1]&r)<<16>>16!=0))break e;if(o=o+4|0,(o|0)==(a|0)){o=a;break}}while(!1);return o|0}function Yh(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;e:do if((o|0)==(a|0))o=a;else for(;;){if(t=e[o>>2]|0,t>>>0>=128||(t=(nn()|0)+(t<<1)|0,!((k[t>>1]&r)<<16>>16)))break e;if(o=o+4|0,(o|0)==(a|0)){o=a;break}}while(!1);return o|0}function jh(t,r){return t=t|0,r=r|0,r>>>0<128&&(r=(hn()|0)+(r<<2)|0,r=e[r>>2]|0),r|0}function hn(){var t=0,r=0;if(m=0,t=Ce(8)|0,r=m,m=0,r&1)r=j(0)|0,$t(r);else return e[t>>2]|0;return 0}function Xh(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;if(l=(o-r|0)>>>2,(r|0)!=(o|0)){a=r;do t=e[a>>2]|0,t>>>0<128&&(t=(hn()|0)+(t<<2)|0,t=e[t>>2]|0),e[a>>2]=t,a=a+4|0;while((a|0)!=(o|0))}return r+(l<<2)|0}function Zh(t,r){return t=t|0,r=r|0,r>>>0<128&&(r=(dn()|0)+(r<<2)|0,r=e[r>>2]|0),r|0}function dn(){var t=0,r=0;if(m=0,t=Ce(9)|0,r=m,m=0,r&1)r=j(0)|0,$t(r);else return e[t>>2]|0;return 0}function Jh(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;if(l=(o-r|0)>>>2,(r|0)!=(o|0)){a=r;do t=e[a>>2]|0,t>>>0<128&&(t=(dn()|0)+(t<<2)|0,t=e[t>>2]|0),e[a>>2]=t,a=a+4|0;while((a|0)!=(o|0))}return r+(l<<2)|0}function ed(t,r){return t=t|0,r=r|0,r<<24>>24|0}function id(t,r,o,a){if(t=t|0,r=r|0,o=o|0,a=a|0,(r|0)!=(o|0))for(;e[a>>2]=S[r>>0],r=r+1|0,(r|0)!=(o|0);)a=a+4|0;return o|0}function nd(t,r,o){return t=t|0,r=r|0,o=o|0,(r>>>0<128?r&255:o)|0}function rd(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;if(d=(o-r|0)>>>2,(r|0)!=(o|0))for(h=r,t=l;l=e[h>>2]|0,S[t>>0]=l>>>0<128?l&255:a,h=h+4|0,(h|0)!=(o|0);)t=t+1|0;return r+(d<<2)|0}function Ms(t){t=t|0;var r=0;e[t>>2]=44236,r=e[t+8>>2]|0,r|0&&S[t+12>>0]|0&&F6(r)}function sd(t){t=t|0,Ms(t),he(t)}function od(t,r){return t=t|0,r=r|0,r<<24>>24>-1&&(r=(hn()|0)+((r&255)<<2)|0,r=e[r>>2]&255),r|0}function ad(t,r,o){if(t=t|0,r=r|0,o=o|0,(r|0)!=(o|0)){t=r;do r=S[t>>0]|0,r<<24>>24>-1&&(r=(hn()|0)+(r<<24>>24<<2)|0,r=e[r>>2]&255),S[t>>0]=r,t=t+1|0;while((t|0)!=(o|0))}return o|0}function ld(t,r){return t=t|0,r=r|0,r<<24>>24>-1&&(r=(dn()|0)+(r<<24>>24<<2)|0,r=e[r>>2]&255),r|0}function ud(t,r,o){if(t=t|0,r=r|0,o=o|0,(r|0)!=(o|0)){t=r;do r=S[t>>0]|0,r<<24>>24>-1&&(r=(dn()|0)+(r<<24>>24<<2)|0,r=e[r>>2]&255),S[t>>0]=r,t=t+1|0;while((t|0)!=(o|0))}return o|0}function cd(t,r){return t=t|0,r=r|0,r|0}function hd(t,r,o,a){if(t=t|0,r=r|0,o=o|0,a=a|0,(r|0)!=(o|0))for(;S[a>>0]=S[r>>0]|0,r=r+1|0,(r|0)!=(o|0);)a=a+1|0;return o|0}function dd(t,r,o){return t=t|0,r=r|0,o=o|0,(r<<24>>24>-1?r:o)|0}function pd(t,r,o,a,l){if(t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,(r|0)!=(o|0))for(;t=S[r>>0]|0,S[l>>0]=t<<24>>24>-1?t:a,r=r+1|0,(r|0)!=(o|0);)l=l+1|0;return o|0}function md(t){t=t|0,he(t)}function gd(t,r,o,a,l,h,d,w){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,e[l>>2]=o,e[w>>2]=h,3}function Sd(t,r,o,a,l,h,d,w){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,e[l>>2]=o,e[w>>2]=h,3}function Ad(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,e[l>>2]=o,3}function vd(t){return t=t|0,1}function xd(t){return t=t|0,1}function wd(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,t=a-o|0,(t>>>0>>0?t:l)|0}function yd(t){return t=t|0,1}function Cd(t,r){t=t|0,r=r|0;var o=0;if(e[t+4>>2]=r+-1,e[t>>2]=44304,m=0,r=Ce(3)|0,o=m,m=0,o&1)o=j()|0,le(o|0);else{e[t+8>>2]=r;return}}function Td(t){t=t|0,io(t),he(t)}function cr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0,At=0,y0=0,T0=0,g0=0,Oe=0,yt=0,qt=0,c0=0,a0=0,h0=0,D0=0,A0=0,Ti=0,N0=0,Si=0;Si=b,b=b+624|0,h0=Si+24|0,A0=Si+16|0,D0=Si+588|0,Oe=Si+576|0,a0=Si,y0=Si+536|0,N0=Si+8|0,Ti=Si+528|0,jt=(t|0)!=0,Gt=y0+40|0,At=Gt,y0=y0+39|0,T0=N0+4|0,g0=Oe+12|0,Oe=Oe+11|0,yt=D0,qt=g0,c0=qt-yt|0,s0=-2-yt|0,i0=qt+2|0,zt=h0+288|0,gt=D0+9|0,Kt=gt,pt=D0+8|0,h=0,H=r,d=0,r=0;e:for(;;){do if((h|0)>-1)if((d|0)>(2147483647-h|0)){h=S0()|0,e[h>>2]=75,h=-1;break}else{h=d+h|0;break}while(!1);if(d=S[H>>0]|0,d<<24>>24)w=H;else{it=245;break}t:for(;;){switch(d<<24>>24){case 37:{d=w,it=9;break t}case 0:{d=w;break t}default:}Te=w+1|0,d=S[Te>>0]|0,w=Te}t:do if((it|0)==9)for(;;){if(it=0,(S[d+1>>0]|0)!=37)break t;if(w=w+1|0,d=d+2|0,(S[d>>0]|0)==37)it=9;else break}while(!1);if(G=w-H|0,jt&&!(e[t>>2]&32|0)&&B0(H,G,t)|0,(w|0)!=(H|0)){H=d,d=G;continue}E=d+1|0,w=S[E>>0]|0,C=(w<<24>>24)+-48|0,C>>>0<10?(Te=(S[d+2>>0]|0)==36,E=Te?d+3|0:E,w=S[E>>0]|0,_=Te?C:-1,r=Te?1:r):_=-1,d=w<<24>>24;t:do if((d&-32|0)==32)for(C=0;;){if(!(1<>24)+-32|C,E=E+1|0,w=S[E>>0]|0,d=w<<24>>24,(d&-32|0)!=32){F=C,d=E;break}}else F=0,d=E;while(!1);do if(w<<24>>24==42){if(C=d+1|0,w=(S[C>>0]|0)+-48|0,w>>>0<10&&(S[d+2>>0]|0)==36)e[l+(w<<2)>>2]=10,r=1,d=d+3|0,w=e[a+((S[C>>0]|0)+-48<<3)>>2]|0;else{if(r){h=-1;break e}if(!jt){K=F,d=C,r=0,Te=0;break}r=(e[o>>2]|0)+3&-4,w=e[r>>2]|0,e[o>>2]=r+4,r=0,d=C}(w|0)<0?(K=F|8192,Te=0-w|0):(K=F,Te=w)}else if(C=(w<<24>>24)+-48|0,C>>>0<10){w=0;do w=(w*10|0)+C|0,d=d+1|0,C=(S[d>>0]|0)+-48|0;while(C>>>0<10);if((w|0)<0){h=-1;break e}else K=F,Te=w}else K=F,Te=0;while(!1);t:do if((S[d>>0]|0)==46){if(C=d+1|0,w=S[C>>0]|0,w<<24>>24!=42){if(E=(w<<24>>24)+-48|0,E>>>0<10)d=C,w=0;else{d=C,E=0;break}for(;;)if(w=(w*10|0)+E|0,d=d+1|0,E=(S[d>>0]|0)+-48|0,E>>>0>=10){E=w;break t}}if(C=d+2|0,w=(S[C>>0]|0)+-48|0,w>>>0<10&&(S[d+3>>0]|0)==36){e[l+(w<<2)>>2]=10,d=d+4|0,E=e[a+((S[C>>0]|0)+-48<<3)>>2]|0;break}if(r){h=-1;break e}jt?(d=(e[o>>2]|0)+3&-4,E=e[d>>2]|0,e[o>>2]=d+4,d=C):(d=C,E=0)}else E=-1;while(!1);for(R=0;;){if(w=(S[d>>0]|0)+-65|0,w>>>0>57){h=-1;break e}if(C=d+1|0,w=S[56223+(R*58|0)+w>>0]|0,F=w&255,(F+-1|0)>>>0<8)d=C,R=F;else{ke=C;break}}if(!(w<<24>>24)){h=-1;break}C=(_|0)>-1;do if(w<<24>>24==19)if(C){h=-1;break e}else it=52;else{if(C){e[l+(_<<2)>>2]=F,ce=a+(_<<3)|0,Ee=e[ce+4>>2]|0,it=a0,e[it>>2]=e[ce>>2],e[it+4>>2]=Ee,it=52;break}if(!jt){h=0;break e}Ps(a0,F,o)}while(!1);if((it|0)==52&&(it=0,!jt)){H=ke,d=G;continue}_=S[d>>0]|0,_=(R|0)!=0&(_&15|0)==3?_&-33:_,C=K&-65537,Ee=K&8192|0?C:K;t:do switch(_|0){case 110:switch(R|0){case 0:{e[e[a0>>2]>>2]=h,H=ke,d=G;continue e}case 1:{e[e[a0>>2]>>2]=h,H=ke,d=G;continue e}case 2:{H=e[a0>>2]|0,e[H>>2]=h,e[H+4>>2]=((h|0)<0)<<31>>31,H=ke,d=G;continue e}case 3:{k[e[a0>>2]>>1]=h,H=ke,d=G;continue e}case 4:{S[e[a0>>2]>>0]=h,H=ke,d=G;continue e}case 6:{e[e[a0>>2]>>2]=h,H=ke,d=G;continue e}case 7:{H=e[a0>>2]|0,e[H>>2]=h,e[H+4>>2]=((h|0)<0)<<31>>31,H=ke,d=G;continue e}default:{H=ke,d=G;continue e}}case 112:{R=Ee|8,E=E>>>0>8?E:8,_=120,it=64;break}case 88:case 120:{R=Ee,it=64;break}case 111:{if(C=a0,w=e[C>>2]|0,C=e[C+4>>2]|0,(w|0)==0&(C|0)==0)d=Gt;else{d=Gt;do d=d+-1|0,S[d>>0]=w&7|48,w=Di(w|0,C|0,3)|0,C=ye;while(!((w|0)==0&(C|0)==0))}Ee&8?(R=At-d+1|0,w=Ee,E=(E|0)<(R|0)?R:E,R=0,F=56703,it=77):(w=Ee,R=0,F=56703,it=77);break}case 105:case 100:{if(w=a0,d=e[w>>2]|0,w=e[w+4>>2]|0,(w|0)<0){d=ii(0,0,d|0,w|0)|0,w=ye,C=a0,e[C>>2]=d,e[C+4>>2]=w,C=1,F=56703,it=76;break t}Ee&2048?(C=1,F=56704,it=76):(F=Ee&1,C=F,F=F|0?56705:56703,it=76);break}case 117:{w=a0,d=e[w>>2]|0,w=e[w+4>>2]|0,C=0,F=56703,it=76;break}case 99:{S[y0>>0]=e[a0>>2],H=y0,w=1,R=0,_=56703,d=Gt;break}case 109:{d=S0()|0,d=vo(e[d>>2]|0)|0,it=82;break}case 115:{d=e[a0>>2]|0,d=d|0?d:56713,it=82;break}case 67:{e[N0>>2]=e[a0>>2],e[T0>>2]=0,e[a0>>2]=N0,E=-1,it=86;break}case 83:{E?it=86:(z0(t,32,Te,0,Ee),d=0,it=98);break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{D=+B[a0>>3],e[A0>>2]=0,B[q>>3]=D,(e[q+4>>2]|0)>=0?Ee&2048?(re=1,ce=56723):(ce=Ee&1,re=ce,ce=ce|0?56726:56721):(D=-D,re=1,ce=56720),B[q>>3]=D,ae=e[q+4>>2]&2146435072;do if(ae>>>0<2146435072|(ae|0)==2146435072&!1){if(z=+yS(D,A0)*2,w=z!=0,w&&(e[A0>>2]=(e[A0>>2]|0)+-1),J=_|32,(J|0)==97){H=_&32,G=H|0?ce+9|0:ce,K=re|2,d=12-E|0;do if(E>>>0>11|(d|0)==0)D=z;else{D=8;do d=d+-1|0,D=D*16;while(d|0);if((S[G>>0]|0)==45){D=-(D+(-z-D));break}else{D=z+D-D;break}}while(!1);for(w=e[A0>>2]|0,d=(w|0)<0?0-w|0:w,d=zi(d,((d|0)<0)<<31>>31,g0)|0,(d|0)==(g0|0)&&(S[Oe>>0]=48,d=Oe),S[d+-1>>0]=(w>>31&2)+43,R=d+-2|0,S[R>>0]=_+15,F=(E|0)<1,C=(Ee&8|0)==0,w=D0;;){ce=~~D,d=w+1|0,S[w>>0]=N[56687+ce>>0]|H,D=(D-+(ce|0))*16;do if((d-yt|0)==1){if(C&(F&D==0))break;S[d>>0]=46,d=w+2|0}while(!1);if(D==0)break;w=d}E=(E|0)!=0&(s0+d|0)<(E|0)?i0+E-R|0:c0-R+d|0,C=E+K|0,z0(t,32,Te,C,Ee),e[t>>2]&32||B0(G,K,t)|0,z0(t,48,Te,C,Ee^65536),d=d-yt|0,e[t>>2]&32||B0(D0,d,t)|0,w=qt-R|0,z0(t,48,E-(d+w)|0,0,0),e[t>>2]&32||B0(R,w,t)|0,z0(t,32,Te,C,Ee^8192),d=(C|0)<(Te|0)?Te:C;break}d=(E|0)<0?6:E,w?(w=(e[A0>>2]|0)+-28|0,e[A0>>2]=w,D=z*268435456):(D=z,w=e[A0>>2]|0),ae=(w|0)<0?h0:zt,ne=ae,w=ae;do L=~~D>>>0,e[w>>2]=L,w=w+4|0,D=(D-+(L>>>0))*1e9;while(D!=0);if(C=w,w=e[A0>>2]|0,(w|0)>0)for(F=ae;;){R=(w|0)>29?29:w,E=C+-4|0;do if(E>>>0>>0)E=F;else{w=0;do L=v0(e[E>>2]|0,0,R|0)|0,L=$0(L|0,ye|0,w|0,0)|0,w=ye,P=Cr(L|0,w|0,1e9,0)|0,e[E>>2]=P,w=xn(L|0,w|0,1e9,0)|0,E=E+-4|0;while(E>>>0>=F>>>0);if(!w){E=F;break}E=F+-4|0,e[E>>2]=w}while(!1);for(;!(C>>>0<=E>>>0);)if(w=C+-4|0,!(e[w>>2]|0))C=w;else break;if(w=(e[A0>>2]|0)-R|0,e[A0>>2]=w,(w|0)>0)F=E;else break}else E=ae;if((w|0)<0)for(G=((d+25|0)/9|0)+1|0,$=(J|0)==102,H=E;;){K=0-w|0,K=(K|0)>9?9:K;do if(H>>>0>>0){w=(1<>>K,E=0,R=H;do L=e[R>>2]|0,e[R>>2]=(L>>>K)+E,E=ie(L&w,F)|0,R=R+4|0;while(R>>>0>>0);if(w=e[H>>2]|0?H:H+4|0,!E){E=w;break}e[C>>2]=E,E=w,C=C+4|0}else E=e[H>>2]|0?H:H+4|0;while(!1);if(w=$?ae:E,C=(C-w>>2|0)>(G|0)?w+(G<<2)|0:C,w=(e[A0>>2]|0)+K|0,e[A0>>2]=w,(w|0)>=0){H=E;break}else H=E}else H=E;do if(H>>>0>>0){if(w=(ne-H>>2)*9|0,F=e[H>>2]|0,F>>>0<10)break;E=10;do E=E*10|0,w=w+1|0;while(F>>>0>=E>>>0)}else w=0;while(!1);if(P=(J|0)==103,L=(d|0)!=0,E=d-((J|0)!=102?w:0)+((L&P)<<31>>31)|0,(E|0)<(((C-ne>>2)*9|0)+-9|0)){if(R=E+9216|0,$=(R|0)/9|0,E=ae+($+-1023<<2)|0,R=((R|0)%9|0)+1|0,(R|0)<9){F=10;do F=F*10|0,R=R+1|0;while((R|0)!=9)}else F=10;K=e[E>>2]|0,G=(K>>>0)%(F>>>0)|0,!(G|0)&&(ae+($+-1022<<2)|0)==(C|0)?F=H:it=163;do if((it|0)==163){it=0,z=((K>>>0)/(F>>>0)|0)&1|0?9007199254740994:9007199254740992,R=(F|0)/2|0;do if(G>>>0>>0)D=.5;else{if((G|0)==(R|0)&&(ae+($+-1022<<2)|0)==(C|0)){D=1;break}D=1.5}while(!1);do if(re){if((S[ce>>0]|0)!=45)break;z=-z,D=-D}while(!1);if(R=K-G|0,e[E>>2]=R,z+D==z){F=H;break}if(J=R+F|0,e[E>>2]=J,J>>>0>999999999)for(w=H;;)if(F=E+-4|0,e[E>>2]=0,F>>>0>>0&&(w=w+-4|0,e[w>>2]=0),J=(e[F>>2]|0)+1|0,e[F>>2]=J,J>>>0>999999999)E=F;else{H=w,E=F;break}if(w=(ne-H>>2)*9|0,R=e[H>>2]|0,R>>>0<10){F=H;break}else F=10;do F=F*10|0,w=w+1|0;while(R>>>0>=F>>>0);F=H}while(!1);J=E+4|0,H=F,C=C>>>0>J>>>0?J:C}for(G=0-w|0;;){if(C>>>0<=H>>>0){$=0,J=C;break}if(E=C+-4|0,!(e[E>>2]|0))C=E;else{$=1,J=C;break}}do if(P){if(d=(L&1^1)+d|0,(d|0)>(w|0)&(w|0)>-5?(_=_+-1|0,d=d+-1-w|0):(_=_+-2|0,d=d+-1|0),C=Ee&8,C)break;do if($){if(C=e[J+-4>>2]|0,!C){E=9;break}if(!((C>>>0)%10|0))F=10,E=0;else{E=0;break}do F=F*10|0,E=E+1|0;while(!((C>>>0)%(F>>>0)|0|0))}else E=9;while(!1);if(C=((J-ne>>2)*9|0)+-9|0,(_|32|0)==102){C=C-E|0,C=(C|0)<0?0:C,d=(d|0)<(C|0)?d:C,C=0;break}else{C=C+w-E|0,C=(C|0)<0?0:C,d=(d|0)<(C|0)?d:C,C=0;break}}else C=Ee&8;while(!1);if(K=d|C,F=(K|0)!=0&1,R=(_|32|0)==102,R)w=(w|0)>0?w:0,_=0;else{if(E=(w|0)<0?G:w,E=zi(E,((E|0)<0)<<31>>31,g0)|0,(qt-E|0)<2)do E=E+-1|0,S[E>>0]=48;while((qt-E|0)<2);S[E+-1>>0]=(w>>31&2)+43,ne=E+-2|0,S[ne>>0]=_,w=qt-ne|0,_=ne}G=re+1+d+F+w|0,z0(t,32,Te,G,Ee),e[t>>2]&32||B0(ce,re,t)|0,z0(t,48,Te,G,Ee^65536);do if(R){E=H>>>0>ae>>>0?ae:H,w=E;do{C=zi(e[w>>2]|0,0,gt)|0;do if((w|0)==(E|0)){if((C|0)!=(gt|0))break;S[pt>>0]=48,C=pt}else{if(C>>>0<=D0>>>0)break;do C=C+-1|0,S[C>>0]=48;while(C>>>0>D0>>>0)}while(!1);e[t>>2]&32||B0(C,Kt-C|0,t)|0,w=w+4|0}while(w>>>0<=ae>>>0);do if(K){if(e[t>>2]&32)break;B0(56755,1,t)|0}while(!1);if((d|0)>0&w>>>0>>0)for(C=w;;){if(w=zi(e[C>>2]|0,0,gt)|0,w>>>0>D0>>>0)do w=w+-1|0,S[w>>0]=48;while(w>>>0>D0>>>0);if(e[t>>2]&32||B0(w,(d|0)>9?9:d,t)|0,C=C+4|0,w=d+-9|0,(d|0)>9&C>>>0>>0)d=w;else{d=w;break}}z0(t,48,d+9|0,9,0)}else{if(R=$?J:H+4|0,(d|0)>-1){F=(C|0)==0,E=H;do{w=zi(e[E>>2]|0,0,gt)|0,(w|0)==(gt|0)&&(S[pt>>0]=48,w=pt);do if((E|0)==(H|0)){if(C=w+1|0,e[t>>2]&32||B0(w,1,t)|0,F&(d|0)<1){w=C;break}if(e[t>>2]&32){w=C;break}B0(56755,1,t)|0,w=C}else{if(w>>>0<=D0>>>0)break;do w=w+-1|0,S[w>>0]=48;while(w>>>0>D0>>>0)}while(!1);C=Kt-w|0,e[t>>2]&32||B0(w,(d|0)>(C|0)?C:d,t)|0,d=d-C|0,E=E+4|0}while(E>>>0>>0&(d|0)>-1)}if(z0(t,48,d+18|0,18,0),e[t>>2]&32)break;B0(_,qt-_|0,t)|0}while(!1);z0(t,32,Te,G,Ee^8192),d=(G|0)<(Te|0)?Te:G}else R=(_&32|0)!=0,F=D!=D|!1,w=F?0:re,E=w+3|0,z0(t,32,Te,E,C),d=e[t>>2]|0,d&32||(B0(ce,w,t)|0,d=e[t>>2]|0),d&32||B0(F?R?56747:56751:R?56739:56743,3,t)|0,z0(t,32,Te,E,Ee^8192),d=(E|0)<(Te|0)?Te:E;while(!1);H=ke;continue e}default:C=Ee,w=E,R=0,_=56703,d=Gt}while(!1);t:do if((it|0)==64)if(C=a0,w=e[C>>2]|0,C=e[C+4>>2]|0,F=_&32,(w|0)==0&(C|0)==0)d=Gt,w=R,R=0,F=56703,it=77;else{d=Gt;do d=d+-1|0,S[d>>0]=N[56687+(w&15)>>0]|F,w=Di(w|0,C|0,4)|0,C=ye;while(!((w|0)==0&(C|0)==0));it=a0,(R&8|0)==0|(e[it>>2]|0)==0&(e[it+4>>2]|0)==0?(w=R,R=0,F=56703,it=77):(w=R,R=2,F=56703+(_>>4)|0,it=77)}else if((it|0)==76)d=zi(d,w,Gt)|0,w=Ee,R=C,it=77;else if((it|0)==82)it=0,Ee=Oo(d,0,E)|0,ce=(Ee|0)==0,H=d,w=ce?E:Ee-d|0,R=0,_=56703,d=ce?d+E|0:Ee;else if((it|0)==86){for(it=0,w=0,d=0,F=e[a0>>2]|0;C=e[F>>2]|0,!(!C||(d=Do(Ti,C)|0,(d|0)<0|d>>>0>(E-w|0)>>>0));)if(w=d+w|0,E>>>0>w>>>0)F=F+4|0;else break;if((d|0)<0){h=-1;break e}if(z0(t,32,Te,w,Ee),!w)d=0,it=98;else for(C=0,E=e[a0>>2]|0;;){if(d=e[E>>2]|0,!d){d=w,it=98;break t}if(d=Do(Ti,d)|0,C=d+C|0,(C|0)>(w|0)){d=w,it=98;break t}if(e[t>>2]&32||B0(Ti,d,t)|0,C>>>0>=w>>>0){d=w,it=98;break}else E=E+4|0}}while(!1);if((it|0)==98){it=0,z0(t,32,Te,d,Ee^8192),H=ke,d=(Te|0)>(d|0)?Te:d;continue}(it|0)==77&&(it=0,C=(E|0)>-1?w&-65537:w,w=a0,w=(e[w>>2]|0)!=0|(e[w+4>>2]|0)!=0,(E|0)!=0|w?(w=(w&1^1)+(At-d)|0,H=d,w=(E|0)>(w|0)?E:w,_=F,d=Gt):(H=Gt,w=0,_=F,d=Gt)),F=d-H|0,w=(w|0)<(F|0)?F:w,E=R+w|0,d=(Te|0)<(E|0)?E:Te,z0(t,32,d,E,C),e[t>>2]&32||B0(_,R,t)|0,z0(t,48,d,E,C^65536),z0(t,48,w,F,0),e[t>>2]&32||B0(H,F,t)|0,z0(t,32,d,E,C^8192),H=ke}e:do if((it|0)==245&&!t)if(r){for(h=1;r=e[l+(h<<2)>>2]|0,!!r;)if(Ps(a+(h<<3)|0,r,o),h=h+1|0,(h|0)>=10){h=1;break e}if((h|0)<10)for(;;){if(e[l+(h<<2)>>2]|0){h=-1;break e}if(h=h+1|0,(h|0)>=10){h=1;break}}else h=1}else h=0;while(!1);return b=Si,h|0}function Id(t,r,o){return t=t|0,r=r|0,o=o|0,_S(t,r,o)|0}function kd(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+112|0,d=w,l=d,h=l+112|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(h|0));return l=d+4|0,e[l>>2]=t,h=d+8|0,e[h>>2]=-1,e[d+44>>2]=t,e[d+76>>2]=-1,oi(d,0),a=+xo(d,o,1),o=(e[l>>2]|0)-(e[h>>2]|0)+(e[d+108>>2]|0)|0,r&&(e[r>>2]=o|0?t+o|0:t),b=w,+a}function _s(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0;return C=b,b=b+112|0,w=C,e[w>>2]=0,h=w+4|0,e[h>>2]=t,e[w+44>>2]=t,d=w+8|0,e[d>>2]=(t|0)<0?-1:t+2147483647|0,e[w+76>>2]=-1,oi(w,0),a=wo(w,o,1,a,l)|0,r&&(e[r>>2]=t+((e[h>>2]|0)+(e[w+108>>2]|0)-(e[d>>2]|0))),b=C,a|0}function Ed(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return a=t+20|0,l=e[a>>2]|0,t=(e[t+16>>2]|0)-l|0,t=t>>>0>o>>>0?o:t,o0(l|0,r|0,t|0)|0,e[a>>2]=(e[a>>2]|0)+t,o|0}function Ps(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;e:do if(r>>>0<=20)do switch(r|0){case 9:{a=(e[o>>2]|0)+3&-4,r=e[a>>2]|0,e[o>>2]=a+4,e[t>>2]=r;break e}case 10:{a=(e[o>>2]|0)+3&-4,r=e[a>>2]|0,e[o>>2]=a+4,a=t,e[a>>2]=r,e[a+4>>2]=((r|0)<0)<<31>>31;break e}case 11:{a=(e[o>>2]|0)+3&-4,r=e[a>>2]|0,e[o>>2]=a+4,a=t,e[a>>2]=r,e[a+4>>2]=0;break e}case 12:{a=(e[o>>2]|0)+7&-8,r=a,l=e[r>>2]|0,r=e[r+4>>2]|0,e[o>>2]=a+8,a=t,e[a>>2]=l,e[a+4>>2]=r;break e}case 13:{l=(e[o>>2]|0)+3&-4,a=e[l>>2]|0,e[o>>2]=l+4,a=(a&65535)<<16>>16,l=t,e[l>>2]=a,e[l+4>>2]=((a|0)<0)<<31>>31;break e}case 14:{l=(e[o>>2]|0)+3&-4,a=e[l>>2]|0,e[o>>2]=l+4,l=t,e[l>>2]=a&65535,e[l+4>>2]=0;break e}case 15:{l=(e[o>>2]|0)+3&-4,a=e[l>>2]|0,e[o>>2]=l+4,a=(a&255)<<24>>24,l=t,e[l>>2]=a,e[l+4>>2]=((a|0)<0)<<31>>31;break e}case 16:{l=(e[o>>2]|0)+3&-4,a=e[l>>2]|0,e[o>>2]=l+4,l=t,e[l>>2]=a&255,e[l+4>>2]=0;break e}case 17:{l=(e[o>>2]|0)+7&-8,h=+B[l>>3],e[o>>2]=l+8,B[t>>3]=h;break e}case 18:{l=(e[o>>2]|0)+7&-8,h=+B[l>>3],e[o>>2]=l+8,B[t>>3]=h;break e}default:break e}while(!1);while(!1)}function zi(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(r>>>0>0|(r|0)==0&t>>>0>4294967295)for(;;)if(a=Cr(t|0,r|0,10,0)|0,o=o+-1|0,S[o>>0]=a|48,a=xn(t|0,r|0,10,0)|0,r>>>0>9|(r|0)==9&t>>>0>4294967295)t=a,r=ye;else{t=a;break}if(t)for(;o=o+-1|0,S[o>>0]=(t>>>0)%10|0|48,!(t>>>0<10);)t=(t>>>0)/10|0;return o|0}function z0(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0;w=b,b=b+256|0,d=w;do if((o|0)>(a|0)&(l&73728|0)==0){if(l=o-a|0,Jt(d|0,r|0,(l>>>0>256?256:l)|0)|0,r=e[t>>2]|0,h=(r&32|0)==0,l>>>0>255){a=o-a|0;do h&&(B0(d,256,t)|0,r=e[t>>2]|0),l=l+-256|0,h=(r&32|0)==0;while(l>>>0>255);if(h)l=a&255;else break}else if(!h)break;B0(d,l,t)|0}while(!1);b=w}function E0(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0,gt=0,Kt=0,pt=0;do if(t>>>0<245){if(_=t>>>0<11?16:t+11&-8,t=_>>>3,w=e[10218]|0,o=w>>>t,o&3){t=(o&1^1)+t|0,a=t<<1,o=40912+(a<<2)|0,a=40912+(a+2<<2)|0,l=e[a>>2]|0,h=l+8|0,d=e[h>>2]|0;do if((o|0)!=(d|0))if(d>>>0<(e[10222]|0)>>>0&&St(),r=d+12|0,(e[r>>2]|0)==(l|0)){e[r>>2]=o,e[a>>2]=d;break}else St();else e[10218]=w&~(1<>2]=pt|3,pt=l+(pt|4)|0,e[pt>>2]=e[pt>>2]|1,pt=h,pt|0}if(d=e[10220]|0,_>>>0>d>>>0){if(o){a=2<>>12&16,a=a>>>C,l=a>>>5&8,a=a>>>l,h=a>>>2&4,a=a>>>h,o=a>>>1&2,a=a>>>o,t=a>>>1&1,t=(l|C|h|o|t)+(a>>>t)|0,a=t<<1,o=40912+(a<<2)|0,a=40912+(a+2<<2)|0,h=e[a>>2]|0,C=h+8|0,l=e[C>>2]|0;do if((o|0)!=(l|0))if(l>>>0<(e[10222]|0)>>>0&&St(),r=l+12|0,(e[r>>2]|0)==(h|0)){e[r>>2]=o,e[a>>2]=l,D=e[10220]|0;break}else St();else e[10218]=w&~(1<>2]=_|3,w=h+_|0,e[h+(_|4)>>2]=d|1,e[h+pt>>2]=d,D&&(l=e[10223]|0,o=D>>>3,r=o<<1,a=40912+(r<<2)|0,t=e[10218]|0,o=1<>2]|0,r>>>0<(e[10222]|0)>>>0?St():(E=t,F=r)):(e[10218]=t|o,E=40912+(r+2<<2)|0,F=a),e[E>>2]=l,e[F+12>>2]=l,e[l+8>>2]=F,e[l+12>>2]=a),e[10220]=d,e[10223]=w,pt=C,pt|0}if(t=e[10219]|0,t){for(o=(t&0-t)+-1|0,Kt=o>>>12&16,o=o>>>Kt,gt=o>>>5&8,o=o>>>gt,pt=o>>>2&4,o=o>>>pt,t=o>>>1&2,o=o>>>t,a=o>>>1&1,a=e[41176+((gt|Kt|pt|t|a)+(o>>>a)<<2)>>2]|0,o=(e[a+4>>2]&-8)-_|0,t=a;;){if(r=e[t+16>>2]|0,!r&&(r=e[t+20>>2]|0,!r)){C=o;break}t=(e[r+4>>2]&-8)-_|0,pt=t>>>0>>0,o=pt?t:o,t=r,a=pt?r:a}h=e[10222]|0,a>>>0>>0&&St(),w=a+_|0,a>>>0>=w>>>0&&St(),d=e[a+24>>2]|0,o=e[a+12>>2]|0;do if((o|0)==(a|0)){if(t=a+20|0,r=e[t>>2]|0,!r&&(t=a+16|0,r=e[t>>2]|0,!r)){R=0;break}for(;;){if(o=r+20|0,l=e[o>>2]|0,l){r=l,t=o;continue}if(o=r+16|0,l=e[o>>2]|0,l)r=l,t=o;else break}if(t>>>0>>0)St();else{e[t>>2]=0,R=r;break}}else if(l=e[a+8>>2]|0,l>>>0>>0&&St(),r=l+12|0,(e[r>>2]|0)!=(a|0)&&St(),t=o+8|0,(e[t>>2]|0)==(a|0)){e[r>>2]=o,e[t>>2]=l,R=o;break}else St();while(!1);do if(d){if(r=e[a+28>>2]|0,t=41176+(r<<2)|0,(a|0)==(e[t>>2]|0)){if(e[t>>2]=R,!R){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=d+16|0,(e[r>>2]|0)==(a|0)?e[r>>2]=R:e[d+20>>2]=R,!R)break;t=e[10222]|0,R>>>0>>0&&St(),e[R+24>>2]=d,r=e[a+16>>2]|0;do if(r)if(r>>>0>>0)St();else{e[R+16>>2]=r,e[r+24>>2]=R;break}while(!1);if(r=e[a+20>>2]|0,r)if(r>>>0<(e[10222]|0)>>>0)St();else{e[R+20>>2]=r,e[r+24>>2]=R;break}}while(!1);return C>>>0<16?(pt=C+_|0,e[a+4>>2]=pt|3,pt=a+(pt+4)|0,e[pt>>2]=e[pt>>2]|1):(e[a+4>>2]=_|3,e[a+(_|4)>>2]=C|1,e[a+(C+_)>>2]=C,r=e[10220]|0,r&&(h=e[10223]|0,o=r>>>3,r=o<<1,l=40912+(r<<2)|0,t=e[10218]|0,o=1<>2]|0,t>>>0<(e[10222]|0)>>>0?St():(z=r,H=t)):(e[10218]=t|o,z=40912+(r+2<<2)|0,H=l),e[z>>2]=h,e[H+12>>2]=h,e[h+8>>2]=H,e[h+12>>2]=l),e[10220]=C,e[10223]=w),pt=a+8|0,pt|0}else H=_}else H=_}else if(t>>>0<=4294967231)if(t=t+11|0,F=t&-8,E=e[10219]|0,E){o=0-F|0,t=t>>>8,t?F>>>0>16777215?D=31:(H=(t+1048320|0)>>>16&8,L=t<>>16&4,L=L<>>16&2,D=14-(z|H|D)+(L<>>15)|0,D=F>>>(D+7|0)&1|D<<1):D=0,t=e[41176+(D<<2)>>2]|0;e:do if(!t)l=0,t=0,L=86;else for(d=o,l=0,w=F<<((D|0)==31?0:25-(D>>>1)|0),C=t,t=0;;){if(h=e[C+4>>2]&-8,o=h-F|0,o>>>0>>0)if((h|0)==(F|0)){h=C,t=C,L=90;break e}else t=C;else o=d;if(L=e[C+20>>2]|0,C=e[C+16+(w>>>31<<2)>>2]|0,l=(L|0)==0|(L|0)==(C|0)?l:L,C)d=o,w=w<<1;else{L=86;break}}while(!1);if((L|0)==86){if((l|0)==0&(t|0)==0){if(t=2<>>12&16,t=t>>>R,E=t>>>5&8,t=t>>>E,z=t>>>2&4,t=t>>>z,H=t>>>1&2,t=t>>>H,l=t>>>1&1,l=e[41176+((E|R|z|H|l)+(t>>>l)<<2)>>2]|0,t=0}l?(h=l,L=90):(w=o,C=t)}if((L|0)==90)for(;;){if(L=0,H=(e[h+4>>2]&-8)-F|0,l=H>>>0>>0,o=l?H:o,t=l?h:t,l=e[h+16>>2]|0,l){h=l,L=90;continue}if(h=e[h+20>>2]|0,h)L=90;else{w=o,C=t;break}}if(C|0&&w>>>0<((e[10220]|0)-F|0)>>>0){l=e[10222]|0,C>>>0>>0&&St(),d=C+F|0,C>>>0>=d>>>0&&St(),h=e[C+24>>2]|0,o=e[C+12>>2]|0;do if((o|0)==(C|0)){if(t=C+20|0,r=e[t>>2]|0,!r&&(t=C+16|0,r=e[t>>2]|0,!r)){_=0;break}for(;;){if(o=r+20|0,a=e[o>>2]|0,a){r=a,t=o;continue}if(o=r+16|0,a=e[o>>2]|0,a)r=a,t=o;else break}if(t>>>0>>0)St();else{e[t>>2]=0,_=r;break}}else if(a=e[C+8>>2]|0,a>>>0>>0&&St(),r=a+12|0,(e[r>>2]|0)!=(C|0)&&St(),t=o+8|0,(e[t>>2]|0)==(C|0)){e[r>>2]=o,e[t>>2]=a,_=o;break}else St();while(!1);do if(h){if(r=e[C+28>>2]|0,t=41176+(r<<2)|0,(C|0)==(e[t>>2]|0)){if(e[t>>2]=_,!_){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=h+16|0,(e[r>>2]|0)==(C|0)?e[r>>2]=_:e[h+20>>2]=_,!_)break;t=e[10222]|0,_>>>0>>0&&St(),e[_+24>>2]=h,r=e[C+16>>2]|0;do if(r)if(r>>>0>>0)St();else{e[_+16>>2]=r,e[r+24>>2]=_;break}while(!1);if(r=e[C+20>>2]|0,r)if(r>>>0<(e[10222]|0)>>>0)St();else{e[_+20>>2]=r,e[r+24>>2]=_;break}}while(!1);e:do if(w>>>0>=16){if(e[C+4>>2]=F|3,e[C+(F|4)>>2]=w|1,e[C+(w+F)>>2]=w,r=w>>>3,w>>>0<256){t=r<<1,a=40912+(t<<2)|0,o=e[10218]|0,r=1<>2]|0,t>>>0<(e[10222]|0)>>>0?St():(G=r,$=t)):(e[10218]=o|r,G=40912+(t+2<<2)|0,$=a),e[G>>2]=d,e[$+12>>2]=d,e[C+(F+8)>>2]=$,e[C+(F+12)>>2]=a;break}if(r=w>>>8,r?w>>>0>16777215?a=31:(Kt=(r+1048320|0)>>>16&8,pt=r<>>16&4,pt=pt<>>16&2,a=14-(gt|Kt|a)+(pt<>>15)|0,a=w>>>(a+7|0)&1|a<<1):a=0,r=41176+(a<<2)|0,e[C+(F+28)>>2]=a,e[C+(F+20)>>2]=0,e[C+(F+16)>>2]=0,t=e[10219]|0,o=1<>2]=d,e[C+(F+24)>>2]=r,e[C+(F+12)>>2]=d,e[C+(F+8)>>2]=d;break}r=e[r>>2]|0;t:do if((e[r+4>>2]&-8|0)!=(w|0)){for(a=w<<((a|0)==31?0:25-(a>>>1)|0);t=r+16+(a>>>31<<2)|0,o=e[t>>2]|0,!!o;)if((e[o+4>>2]&-8|0)==(w|0)){ae=o;break t}else a=a<<1,r=o;if(t>>>0<(e[10222]|0)>>>0)St();else{e[t>>2]=d,e[C+(F+24)>>2]=r,e[C+(F+12)>>2]=d,e[C+(F+8)>>2]=d;break e}}else ae=r;while(!1);if(r=ae+8|0,t=e[r>>2]|0,pt=e[10222]|0,t>>>0>=pt>>>0&ae>>>0>=pt>>>0){e[t+12>>2]=d,e[r>>2]=d,e[C+(F+8)>>2]=t,e[C+(F+12)>>2]=ae,e[C+(F+24)>>2]=0;break}else St()}else pt=w+F|0,e[C+4>>2]=pt|3,pt=C+(pt+4)|0,e[pt>>2]=e[pt>>2]|1;while(!1);return pt=C+8|0,pt|0}else H=F}else H=F;else H=-1;while(!1);if(o=e[10220]|0,o>>>0>=H>>>0)return r=o-H|0,t=e[10223]|0,r>>>0>15?(e[10223]=t+H,e[10220]=r,e[t+(H+4)>>2]=r|1,e[t+o>>2]=r,e[t+4>>2]=H|3):(e[10220]=0,e[10223]=0,e[t+4>>2]=o|3,pt=t+(o+4)|0,e[pt>>2]=e[pt>>2]|1),pt=t+8|0,pt|0;if(t=e[10221]|0,t>>>0>H>>>0)return Kt=t-H|0,e[10221]=Kt,pt=e[10224]|0,e[10224]=pt+H,e[pt+(H+4)>>2]=Kt|1,e[pt+4>>2]=H|3,pt=pt+8|0,pt|0;do if(!(e[10336]|0))if(t=Wo(30)|0,t+-1&t)St();else{e[10338]=t,e[10337]=t,e[10339]=-1,e[10340]=-1,e[10341]=0,e[10329]=0,ae=(ea(0)|0)&-16^1431655768,e[10336]=ae;break}while(!1);if(C=H+48|0,w=e[10338]|0,D=H+47|0,d=w+D|0,w=0-w|0,E=d&w,E>>>0<=H>>>0||(t=e[10328]|0,t|0&&($=e[10326]|0,ae=$+E|0,ae>>>0<=$>>>0|ae>>>0>t>>>0)))return pt=0,pt|0;e:do if(e[10329]&4)t=0,L=191;else{t=e[10224]|0;t:do if(t){for(l=41320;;){if(o=e[l>>2]|0,o>>>0<=t>>>0&&(K=l+4|0,(o+(e[K>>2]|0)|0)>>>0>t>>>0)){h=l,t=K;break}if(l=e[l+8>>2]|0,!l){L=174;break t}}if(o=d-(e[10221]|0)&w,o>>>0<2147483647)if(l=Mi(o|0)|0,ae=(l|0)==((e[h>>2]|0)+(e[t>>2]|0)|0),t=ae?o:0,ae){if((l|0)!=-1){J=l,z=t,L=194;break e}}else L=184;else t=0}else L=174;while(!1);do if((L|0)==174)if(h=Mi(0)|0,(h|0)!=-1)if(t=h,o=e[10337]|0,l=o+-1|0,l&t?o=E-t+(l+t&0-o)|0:o=E,t=e[10326]|0,l=t+o|0,o>>>0>H>>>0&o>>>0<2147483647){if(ae=e[10328]|0,ae|0&&l>>>0<=t>>>0|l>>>0>ae>>>0){t=0;break}if(l=Mi(o|0)|0,ae=(l|0)==(h|0),t=ae?o:0,ae){J=h,z=t,L=194;break e}else L=184}else t=0;else t=0;while(!1);t:do if((L|0)==184){h=0-o|0;do if(C>>>0>o>>>0&(o>>>0<2147483647&(l|0)!=-1)&&(P=e[10338]|0,P=D-o+P&0-P,P>>>0<2147483647))if((Mi(P|0)|0)==-1){Mi(h|0)|0;break t}else{o=P+o|0;break}while(!1);if((l|0)!=-1){J=l,z=o,L=194;break e}}while(!1);e[10329]=e[10329]|4,L=191}while(!1);if((L|0)==191&&E>>>0<2147483647&&(J=Mi(E|0)|0,ne=Mi(0)|0,J>>>0>>0&((J|0)!=-1&(ne|0)!=-1))&&(re=ne-J|0,ce=re>>>0>(H+40|0)>>>0,ce)&&(z=ce?re:t,L=194),(L|0)==194){t=(e[10326]|0)+z|0,e[10326]=t,t>>>0>(e[10327]|0)>>>0&&(e[10327]=t),d=e[10224]|0;e:do if(d){h=41320;do{if(t=e[h>>2]|0,o=h+4|0,l=e[o>>2]|0,(J|0)==(t+l|0)){Ee=t,ke=o,Te=l,it=h,L=204;break}h=e[h+8>>2]|0}while(h|0);if((L|0)==204&&!(e[it+12>>2]&8|0)&&d>>>0>>0&d>>>0>=Ee>>>0){e[ke>>2]=Te+z,pt=(e[10221]|0)+z|0,Kt=d+8|0,Kt=Kt&7|0?0-Kt&7:0,gt=pt-Kt|0,e[10224]=d+Kt,e[10221]=gt,e[d+(Kt+4)>>2]=gt|1,e[d+(pt+4)>>2]=40,e[10225]=e[10340];break}for(t=e[10222]|0,J>>>0>>0&&(e[10222]=J,t=J),o=J+z|0,h=41320;;){if((e[h>>2]|0)==(o|0)){l=h,o=h,L=212;break}if(h=e[h+8>>2]|0,!h){o=41320;break}}if((L|0)==212)if(e[o+12>>2]&8)o=41320;else{e[l>>2]=J,R=o+4|0,e[R>>2]=(e[R>>2]|0)+z,R=J+8|0,R=R&7|0?0-R&7:0,D=J+(z+8)|0,D=D&7|0?0-D&7:0,r=J+(D+z)|0,F=R+H|0,_=J+F|0,E=r-(J+R)-H|0,e[J+(R+4)>>2]=H|3;t:do if((r|0)!=(d|0)){if((r|0)==(e[10223]|0)){pt=(e[10220]|0)+E|0,e[10220]=pt,e[10223]=_,e[J+(F+4)>>2]=pt|1,e[J+(pt+F)>>2]=pt;break}if(w=z+4|0,o=e[J+(w+D)>>2]|0,(o&3|0)==1){C=o&-8,h=o>>>3;i:do if(o>>>0>=256){d=e[J+((D|24)+z)>>2]|0,a=e[J+(z+12+D)>>2]|0;do if((a|0)==(r|0)){if(l=D|16,a=J+(w+l)|0,o=e[a>>2]|0,!o&&(a=J+(l+z)|0,o=e[a>>2]|0,!o)){zt=0;break}for(;;){if(l=o+20|0,h=e[l>>2]|0,h){o=h,a=l;continue}if(l=o+16|0,h=e[l>>2]|0,h)o=h,a=l;else break}if(a>>>0>>0)St();else{e[a>>2]=0,zt=o;break}}else if(l=e[J+((D|8)+z)>>2]|0,l>>>0>>0&&St(),t=l+12|0,(e[t>>2]|0)!=(r|0)&&St(),o=a+8|0,(e[o>>2]|0)==(r|0)){e[t>>2]=a,e[o>>2]=l,zt=a;break}else St();while(!1);if(!d)break;t=e[J+(z+28+D)>>2]|0,o=41176+(t<<2)|0;do if((r|0)!=(e[o>>2]|0)){if(d>>>0<(e[10222]|0)>>>0&&St(),t=d+16|0,(e[t>>2]|0)==(r|0)?e[t>>2]=zt:e[d+20>>2]=zt,!zt)break i}else{if(e[o>>2]=zt,zt)break;e[10219]=e[10219]&~(1<>>0>>0&&St(),e[zt+24>>2]=d,r=D|16,t=e[J+(r+z)>>2]|0;do if(t)if(t>>>0>>0)St();else{e[zt+16>>2]=t,e[t+24>>2]=zt;break}while(!1);if(r=e[J+(w+r)>>2]|0,!r)break;if(r>>>0<(e[10222]|0)>>>0)St();else{e[zt+20>>2]=r,e[r+24>>2]=zt;break}}else{a=e[J+((D|8)+z)>>2]|0,l=e[J+(z+12+D)>>2]|0,o=40912+(h<<1<<2)|0;do if((a|0)!=(o|0)){if(a>>>0>>0&&St(),(e[a+12>>2]|0)==(r|0))break;St()}while(!1);if((l|0)==(a|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),t=l+8|0,(e[t>>2]|0)==(r|0)){jt=t;break}St()}while(!1);e[a+12>>2]=l,e[jt>>2]=a}while(!1);r=J+((C|D)+z)|0,l=C+E|0}else l=E;if(r=r+4|0,e[r>>2]=e[r>>2]&-2,e[J+(F+4)>>2]=l|1,e[J+(l+F)>>2]=l,r=l>>>3,l>>>0<256){t=r<<1,a=40912+(t<<2)|0,o=e[10218]|0,r=1<>2]|0,t>>>0>=(e[10222]|0)>>>0){gt=r,Kt=t;break}St()}while(!1);e[gt>>2]=_,e[Kt+12>>2]=_,e[J+(F+8)>>2]=Kt,e[J+(F+12)>>2]=a;break}r=l>>>8;do if(!r)a=0;else{if(l>>>0>16777215){a=31;break}gt=(r+1048320|0)>>>16&8,Kt=r<>>16&4,Kt=Kt<>>16&2,a=14-(zt|gt|a)+(Kt<>>15)|0,a=l>>>(a+7|0)&1|a<<1}while(!1);if(r=41176+(a<<2)|0,e[J+(F+28)>>2]=a,e[J+(F+20)>>2]=0,e[J+(F+16)>>2]=0,t=e[10219]|0,o=1<>2]=_,e[J+(F+24)>>2]=r,e[J+(F+12)>>2]=_,e[J+(F+8)>>2]=_;break}r=e[r>>2]|0;i:do if((e[r+4>>2]&-8|0)!=(l|0)){for(a=l<<((a|0)==31?0:25-(a>>>1)|0);t=r+16+(a>>>31<<2)|0,o=e[t>>2]|0,!!o;)if((e[o+4>>2]&-8|0)==(l|0)){pt=o;break i}else a=a<<1,r=o;if(t>>>0<(e[10222]|0)>>>0)St();else{e[t>>2]=_,e[J+(F+24)>>2]=r,e[J+(F+12)>>2]=_,e[J+(F+8)>>2]=_;break t}}else pt=r;while(!1);if(r=pt+8|0,t=e[r>>2]|0,Kt=e[10222]|0,t>>>0>=Kt>>>0&pt>>>0>=Kt>>>0){e[t+12>>2]=_,e[r>>2]=_,e[J+(F+8)>>2]=t,e[J+(F+12)>>2]=pt,e[J+(F+24)>>2]=0;break}else St()}else pt=(e[10221]|0)+E|0,e[10221]=pt,e[10224]=_,e[J+(F+4)>>2]=pt|1;while(!1);return pt=J+(R|8)|0,pt|0}for(;t=e[o>>2]|0,!(t>>>0<=d>>>0&&(r=e[o+4>>2]|0,a=t+r|0,a>>>0>d>>>0));)o=e[o+8>>2]|0;if(l=t+(r+-39)|0,t=t+(r+-47+(l&7|0?0-l&7:0))|0,l=d+16|0,t=t>>>0>>0?d:t,r=t+8|0,o=J+8|0,o=o&7|0?0-o&7:0,pt=z+-40-o|0,e[10224]=J+o,e[10221]=pt,e[J+(o+4)>>2]=pt|1,e[J+(z+-36)>>2]=40,e[10225]=e[10340],o=t+4|0,e[o>>2]=27,e[r>>2]=e[10330],e[r+4>>2]=e[10331],e[r+8>>2]=e[10332],e[r+12>>2]=e[10333],e[10330]=J,e[10331]=z,e[10333]=0,e[10332]=r,r=t+28|0,e[r>>2]=7,(t+32|0)>>>0>>0)do pt=r,r=r+4|0,e[r>>2]=7;while((pt+8|0)>>>0>>0);if((t|0)!=(d|0)){if(h=t-d|0,e[o>>2]=e[o>>2]&-2,e[d+4>>2]=h|1,e[t>>2]=h,r=h>>>3,h>>>0<256){t=r<<1,a=40912+(t<<2)|0,o=e[10218]|0,r=1<>2]|0,t>>>0<(e[10222]|0)>>>0?St():(Gt=r,s0=t)):(e[10218]=o|r,Gt=40912+(t+2<<2)|0,s0=a),e[Gt>>2]=d,e[s0+12>>2]=d,e[d+8>>2]=s0,e[d+12>>2]=a;break}if(r=h>>>8,r?h>>>0>16777215?a=31:(Kt=(r+1048320|0)>>>16&8,pt=r<>>16&4,pt=pt<>>16&2,a=14-(gt|Kt|a)+(pt<>>15)|0,a=h>>>(a+7|0)&1|a<<1):a=0,o=41176+(a<<2)|0,e[d+28>>2]=a,e[d+20>>2]=0,e[l>>2]=0,r=e[10219]|0,t=1<>2]=d,e[d+24>>2]=o,e[d+12>>2]=d,e[d+8>>2]=d;break}r=e[o>>2]|0;t:do if((e[r+4>>2]&-8|0)!=(h|0)){for(a=h<<((a|0)==31?0:25-(a>>>1)|0);t=r+16+(a>>>31<<2)|0,o=e[t>>2]|0,!!o;)if((e[o+4>>2]&-8|0)==(h|0)){i0=o;break t}else a=a<<1,r=o;if(t>>>0<(e[10222]|0)>>>0)St();else{e[t>>2]=d,e[d+24>>2]=r,e[d+12>>2]=d,e[d+8>>2]=d;break e}}else i0=r;while(!1);if(r=i0+8|0,t=e[r>>2]|0,pt=e[10222]|0,t>>>0>=pt>>>0&i0>>>0>=pt>>>0){e[t+12>>2]=d,e[r>>2]=d,e[d+8>>2]=t,e[d+12>>2]=i0,e[d+24>>2]=0;break}else St()}}else{pt=e[10222]|0,(pt|0)==0|J>>>0>>0&&(e[10222]=J),e[10330]=J,e[10331]=z,e[10333]=0,e[10227]=e[10336],e[10226]=-1,r=0;do pt=r<<1,Kt=40912+(pt<<2)|0,e[40912+(pt+3<<2)>>2]=Kt,e[40912+(pt+2<<2)>>2]=Kt,r=r+1|0;while((r|0)!=32);pt=J+8|0,pt=pt&7|0?0-pt&7:0,Kt=z+-40-pt|0,e[10224]=J+pt,e[10221]=Kt,e[J+(pt+4)>>2]=Kt|1,e[J+(z+-36)>>2]=40,e[10225]=e[10340]}while(!1);if(r=e[10221]|0,r>>>0>H>>>0)return Kt=r-H|0,e[10221]=Kt,pt=e[10224]|0,e[10224]=pt+H,e[pt+(H+4)>>2]=Kt|1,e[pt+4>>2]=H|3,pt=pt+8|0,pt|0}return pt=S0()|0,e[pt>>2]=12,pt=0,pt|0}function n0(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0;if(t){r=t+-8|0,w=e[10222]|0,r>>>0>>0&&St(),o=e[t+-4>>2]|0,a=o&3,(a|0)==1&&St(),_=o&-8,H=t+(_+-8)|0;do if(o&1)P=r,h=_;else{if(r=e[r>>2]|0,!a)return;if(C=-8-r|0,E=t+C|0,F=r+_|0,E>>>0>>0&&St(),(E|0)==(e[10223]|0)){if(r=t+(_+-4)|0,o=e[r>>2]|0,(o&3|0)!=3){P=E,h=F;break}e[10220]=F,e[r>>2]=o&-2,e[t+(C+4)>>2]=F|1,e[H>>2]=F;return}if(l=r>>>3,r>>>0<256){if(a=e[t+(C+8)>>2]|0,o=e[t+(C+12)>>2]|0,r=40912+(l<<1<<2)|0,(a|0)!=(r|0)&&(a>>>0>>0&&St(),(e[a+12>>2]|0)!=(E|0)&&St()),(o|0)==(a|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),r=o+8|0,(e[r>>2]|0)==(E|0)?d=r:St()):d=o+8|0,e[a+12>>2]=o,e[d>>2]=a,P=E,h=F;break}d=e[t+(C+24)>>2]|0,a=e[t+(C+12)>>2]|0;do if((a|0)==(E|0)){if(o=t+(C+20)|0,r=e[o>>2]|0,!r&&(o=t+(C+16)|0,r=e[o>>2]|0,!r)){D=0;break}for(;;){if(a=r+20|0,l=e[a>>2]|0,l){r=l,o=a;continue}if(a=r+16|0,l=e[a>>2]|0,l)r=l,o=a;else break}if(o>>>0>>0)St();else{e[o>>2]=0,D=r;break}}else if(l=e[t+(C+8)>>2]|0,l>>>0>>0&&St(),r=l+12|0,(e[r>>2]|0)!=(E|0)&&St(),o=a+8|0,(e[o>>2]|0)==(E|0)){e[r>>2]=a,e[o>>2]=l,D=a;break}else St();while(!1);if(d){if(r=e[t+(C+28)>>2]|0,o=41176+(r<<2)|0,(E|0)==(e[o>>2]|0)){if(e[o>>2]=D,!D){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=d+16|0,(e[r>>2]|0)==(E|0)?e[r>>2]=D:e[d+20>>2]=D,!D){P=E,h=F;break}o=e[10222]|0,D>>>0>>0&&St(),e[D+24>>2]=d,r=e[t+(C+16)>>2]|0;do if(r)if(r>>>0>>0)St();else{e[D+16>>2]=r,e[r+24>>2]=D;break}while(!1);if(r=e[t+(C+20)>>2]|0,r)if(r>>>0<(e[10222]|0)>>>0)St();else{e[D+20>>2]=r,e[r+24>>2]=D,P=E,h=F;break}else P=E,h=F}else P=E,h=F}while(!1);if(P>>>0>=H>>>0&&St(),r=t+(_+-4)|0,o=e[r>>2]|0,o&1||St(),o&2)e[r>>2]=o&-2,e[P+4>>2]=h|1,e[P+h>>2]=h;else{if((H|0)==(e[10224]|0)){if($=(e[10221]|0)+h|0,e[10221]=$,e[10224]=P,e[P+4>>2]=$|1,(P|0)!=(e[10223]|0))return;e[10223]=0,e[10220]=0;return}if((H|0)==(e[10223]|0)){$=(e[10220]|0)+h|0,e[10220]=$,e[10223]=P,e[P+4>>2]=$|1,e[P+$>>2]=$;return}h=(o&-8)+h|0,l=o>>>3;do if(o>>>0>=256){d=e[t+(_+16)>>2]|0,r=e[t+(_|4)>>2]|0;do if((r|0)==(H|0)){if(o=t+(_+12)|0,r=e[o>>2]|0,!r&&(o=t+(_+8)|0,r=e[o>>2]|0,!r)){z=0;break}for(;;){if(a=r+20|0,l=e[a>>2]|0,l){r=l,o=a;continue}if(a=r+16|0,l=e[a>>2]|0,l)r=l,o=a;else break}if(o>>>0<(e[10222]|0)>>>0)St();else{e[o>>2]=0,z=r;break}}else if(o=e[t+_>>2]|0,o>>>0<(e[10222]|0)>>>0&&St(),a=o+12|0,(e[a>>2]|0)!=(H|0)&&St(),l=r+8|0,(e[l>>2]|0)==(H|0)){e[a>>2]=r,e[l>>2]=o,z=r;break}else St();while(!1);if(d){if(r=e[t+(_+20)>>2]|0,o=41176+(r<<2)|0,(H|0)==(e[o>>2]|0)){if(e[o>>2]=z,!z){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=d+16|0,(e[r>>2]|0)==(H|0)?e[r>>2]=z:e[d+20>>2]=z,!z)break;o=e[10222]|0,z>>>0>>0&&St(),e[z+24>>2]=d,r=e[t+(_+8)>>2]|0;do if(r)if(r>>>0>>0)St();else{e[z+16>>2]=r,e[r+24>>2]=z;break}while(!1);if(r=e[t+(_+12)>>2]|0,r)if(r>>>0<(e[10222]|0)>>>0)St();else{e[z+20>>2]=r,e[r+24>>2]=z;break}}}else{if(a=e[t+_>>2]|0,o=e[t+(_|4)>>2]|0,r=40912+(l<<1<<2)|0,(a|0)!=(r|0)&&(a>>>0<(e[10222]|0)>>>0&&St(),(e[a+12>>2]|0)!=(H|0)&&St()),(o|0)==(a|0)){e[10218]=e[10218]&~(1<>>0<(e[10222]|0)>>>0&&St(),r=o+8|0,(e[r>>2]|0)==(H|0)?R=r:St()):R=o+8|0,e[a+12>>2]=o,e[R>>2]=a}while(!1);if(e[P+4>>2]=h|1,e[P+h>>2]=h,(P|0)==(e[10223]|0)){e[10220]=h;return}}if(r=h>>>3,h>>>0<256){o=r<<1,l=40912+(o<<2)|0,a=e[10218]|0,r=1<>2]|0,o>>>0<(e[10222]|0)>>>0?St():(K=r,G=o)):(e[10218]=a|r,K=40912+(o+2<<2)|0,G=l),e[K>>2]=P,e[G+12>>2]=P,e[P+8>>2]=G,e[P+12>>2]=l;return}r=h>>>8,r?h>>>0>16777215?l=31:(K=(r+1048320|0)>>>16&8,G=r<>>16&4,G=G<>>16&2,l=14-(H|K|l)+(G<>>15)|0,l=h>>>(l+7|0)&1|l<<1):l=0,r=41176+(l<<2)|0,e[P+28>>2]=l,e[P+20>>2]=0,e[P+16>>2]=0,o=e[10219]|0,a=1<>2]|0;t:do if((e[r+4>>2]&-8|0)!=(h|0)){for(l=h<<((l|0)==31?0:25-(l>>>1)|0);o=r+16+(l>>>31<<2)|0,a=e[o>>2]|0,!!a;)if((e[a+4>>2]&-8|0)==(h|0)){$=a;break t}else l=l<<1,r=a;if(o>>>0<(e[10222]|0)>>>0)St();else{e[o>>2]=P,e[P+24>>2]=r,e[P+12>>2]=P,e[P+8>>2]=P;break e}}else $=r;while(!1);if(r=$+8|0,o=e[r>>2]|0,G=e[10222]|0,o>>>0>=G>>>0&$>>>0>=G>>>0){e[o+12>>2]=P,e[r>>2]=P,e[P+8>>2]=o,e[P+12>>2]=$,e[P+24>>2]=0;break}else St()}else e[10219]=o|a,e[r>>2]=P,e[P+24>>2]=r,e[P+12>>2]=P,e[P+8>>2]=P;while(!1);if(P=(e[10226]|0)+-1|0,e[10226]=P,!P)r=41328;else return;for(;r=e[r>>2]|0,r;)r=r+8|0;e[10226]=-1}}function Dd(t,r){t=t|0,r=r|0;var o=0;return t?(o=ie(r,t)|0,(r|t)>>>0>65535&&(o=((o>>>0)/(t>>>0)|0|0)==(r|0)?o:-1)):o=0,r=E0(o)|0,!r||!(e[r+-4>>2]&3)||Jt(r|0,0,o|0)|0,r|0}function Gi(t,r){t=t|0,r=r|0;var o=0,a=0;return t?r>>>0>4294967231?(t=S0()|0,e[t>>2]=12,t=0,t|0):(o=bd(t+-8|0,r>>>0<11?16:r+11&-8)|0,o?(t=o+8|0,t|0):(o=E0(r)|0,o?(a=e[t+-4>>2]|0,a=(a&-8)-(a&3|0?4:8)|0,o0(o|0,t|0,(a>>>0>>0?a:r)|0)|0,n0(t),t=o,t|0):(t=0,t|0))):(t=E0(r)|0,t|0)}function bd(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(_=t+4|0,z=e[_>>2]|0,C=z&-8,E=t+C|0,w=e[10222]|0,o=z&3,(o|0)!=1&t>>>0>=w>>>0&t>>>0>>0||St(),a=t+(C|4)|0,l=e[a>>2]|0,l&1||St(),!o)return r>>>0<256?(t=0,t|0):(C>>>0>=(r+4|0)>>>0&&(C-r|0)>>>0<=e[10338]<<1>>>0||(t=0),t|0);if(C>>>0>=r>>>0)return o=C-r|0,o>>>0<=15||(e[_>>2]=z&1|r|2,e[t+(r+4)>>2]=o|3,e[a>>2]=e[a>>2]|1,Ls(t+r|0,o)),t|0;if((E|0)==(e[10224]|0))return o=(e[10221]|0)+C|0,o>>>0<=r>>>0?(t=0,t|0):(R=o-r|0,e[_>>2]=z&1|r|2,e[t+(r+4)>>2]=R|1,e[10224]=t+r,e[10221]=R,t|0);if((E|0)==(e[10223]|0))return a=(e[10220]|0)+C|0,a>>>0>>0?(t=0,t|0):(o=a-r|0,o>>>0>15?(e[_>>2]=z&1|r|2,e[t+(r+4)>>2]=o|1,e[t+a>>2]=o,a=t+(a+4)|0,e[a>>2]=e[a>>2]&-2,a=t+r|0):(e[_>>2]=z&1|a|2,a=t+(a+4)|0,e[a>>2]=e[a>>2]|1,a=0,o=0),e[10220]=o,e[10223]=a,t|0);if(l&2||(F=(l&-8)+C|0,F>>>0>>0))return t=0,t|0;R=F-r|0,h=l>>>3;do if(l>>>0>=256){d=e[t+(C+24)>>2]|0,h=e[t+(C+12)>>2]|0;do if((h|0)==(E|0)){if(a=t+(C+20)|0,o=e[a>>2]|0,!o&&(a=t+(C+16)|0,o=e[a>>2]|0,!o)){D=0;break}for(;;){if(l=o+20|0,h=e[l>>2]|0,h){o=h,a=l;continue}if(l=o+16|0,h=e[l>>2]|0,h)o=h,a=l;else break}if(a>>>0>>0)St();else{e[a>>2]=0,D=o;break}}else if(l=e[t+(C+8)>>2]|0,l>>>0>>0&&St(),o=l+12|0,(e[o>>2]|0)!=(E|0)&&St(),a=h+8|0,(e[a>>2]|0)==(E|0)){e[o>>2]=h,e[a>>2]=l,D=h;break}else St();while(!1);if(d){if(o=e[t+(C+28)>>2]|0,a=41176+(o<<2)|0,(E|0)==(e[a>>2]|0)){if(e[a>>2]=D,!D){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),o=d+16|0,(e[o>>2]|0)==(E|0)?e[o>>2]=D:e[d+20>>2]=D,!D)break;a=e[10222]|0,D>>>0>>0&&St(),e[D+24>>2]=d,o=e[t+(C+16)>>2]|0;do if(o)if(o>>>0>>0)St();else{e[D+16>>2]=o,e[o+24>>2]=D;break}while(!1);if(o=e[t+(C+20)>>2]|0,o)if(o>>>0<(e[10222]|0)>>>0)St();else{e[D+20>>2]=o,e[o+24>>2]=D;break}}}else{if(l=e[t+(C+8)>>2]|0,a=e[t+(C+12)>>2]|0,o=40912+(h<<1<<2)|0,(l|0)!=(o|0)&&(l>>>0>>0&&St(),(e[l+12>>2]|0)!=(E|0)&&St()),(a|0)==(l|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),o=a+8|0,(e[o>>2]|0)==(E|0)?d=o:St()):d=a+8|0,e[l+12>>2]=a,e[d>>2]=l}while(!1);return R>>>0<16?(e[_>>2]=F|z&1|2,r=t+(F|4)|0,e[r>>2]=e[r>>2]|1,t|0):(e[_>>2]=z&1|r|2,e[t+(r+4)>>2]=R|3,z=t+(F|4)|0,e[z>>2]=e[z>>2]|1,Ls(t+r|0,R),t|0)}function Ls(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0;H=t+r|0,o=e[t+4>>2]|0;do if(o&1)$=t,d=r;else{if(D=e[t>>2]|0,!(o&3))return;if(R=t+(0-D)|0,F=D+r|0,C=e[10222]|0,R>>>0>>0&&St(),(R|0)==(e[10223]|0)){if(a=t+(r+4)|0,o=e[a>>2]|0,(o&3|0)!=3){$=R,d=F;break}e[10220]=F,e[a>>2]=o&-2,e[t+(4-D)>>2]=F|1,e[H>>2]=F;return}if(h=D>>>3,D>>>0<256){if(l=e[t+(8-D)>>2]|0,a=e[t+(12-D)>>2]|0,o=40912+(h<<1<<2)|0,(l|0)!=(o|0)&&(l>>>0>>0&&St(),(e[l+12>>2]|0)!=(R|0)&&St()),(a|0)==(l|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),o=a+8|0,(e[o>>2]|0)==(R|0)?w=o:St()):w=a+8|0,e[l+12>>2]=a,e[w>>2]=l,$=R,d=F;break}w=e[t+(24-D)>>2]|0,l=e[t+(12-D)>>2]|0;do if((l|0)==(R|0)){if(l=16-D|0,a=t+(l+4)|0,o=e[a>>2]|0,!o&&(a=t+l|0,o=e[a>>2]|0,!o)){E=0;break}for(;;){if(l=o+20|0,h=e[l>>2]|0,h){o=h,a=l;continue}if(l=o+16|0,h=e[l>>2]|0,h)o=h,a=l;else break}if(a>>>0>>0)St();else{e[a>>2]=0,E=o;break}}else if(h=e[t+(8-D)>>2]|0,h>>>0>>0&&St(),o=h+12|0,(e[o>>2]|0)!=(R|0)&&St(),a=l+8|0,(e[a>>2]|0)==(R|0)){e[o>>2]=l,e[a>>2]=h,E=l;break}else St();while(!1);if(w){if(o=e[t+(28-D)>>2]|0,a=41176+(o<<2)|0,(R|0)==(e[a>>2]|0)){if(e[a>>2]=E,!E){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),o=w+16|0,(e[o>>2]|0)==(R|0)?e[o>>2]=E:e[w+20>>2]=E,!E){$=R,d=F;break}l=e[10222]|0,E>>>0>>0&&St(),e[E+24>>2]=w,o=16-D|0,a=e[t+o>>2]|0;do if(a)if(a>>>0>>0)St();else{e[E+16>>2]=a,e[a+24>>2]=E;break}while(!1);if(o=e[t+(o+4)>>2]|0,o)if(o>>>0<(e[10222]|0)>>>0)St();else{e[E+20>>2]=o,e[o+24>>2]=E,$=R,d=F;break}else $=R,d=F}else $=R,d=F}while(!1);if(C=e[10222]|0,H>>>0>>0&&St(),o=t+(r+4)|0,a=e[o>>2]|0,a&2)e[o>>2]=a&-2,e[$+4>>2]=d|1,e[$+d>>2]=d;else{if((H|0)==(e[10224]|0)){if(G=(e[10221]|0)+d|0,e[10221]=G,e[10224]=$,e[$+4>>2]=G|1,($|0)!=(e[10223]|0))return;e[10223]=0,e[10220]=0;return}if((H|0)==(e[10223]|0)){G=(e[10220]|0)+d|0,e[10220]=G,e[10223]=$,e[$+4>>2]=G|1,e[$+G>>2]=G;return}d=(a&-8)+d|0,h=a>>>3;do if(a>>>0>=256){w=e[t+(r+24)>>2]|0,l=e[t+(r+12)>>2]|0;do if((l|0)==(H|0)){if(a=t+(r+20)|0,o=e[a>>2]|0,!o&&(a=t+(r+16)|0,o=e[a>>2]|0,!o)){z=0;break}for(;;){if(l=o+20|0,h=e[l>>2]|0,h){o=h,a=l;continue}if(l=o+16|0,h=e[l>>2]|0,h)o=h,a=l;else break}if(a>>>0>>0)St();else{e[a>>2]=0,z=o;break}}else if(h=e[t+(r+8)>>2]|0,h>>>0>>0&&St(),o=h+12|0,(e[o>>2]|0)!=(H|0)&&St(),a=l+8|0,(e[a>>2]|0)==(H|0)){e[o>>2]=l,e[a>>2]=h,z=l;break}else St();while(!1);if(w){if(o=e[t+(r+28)>>2]|0,a=41176+(o<<2)|0,(H|0)==(e[a>>2]|0)){if(e[a>>2]=z,!z){e[10219]=e[10219]&~(1<>>0<(e[10222]|0)>>>0&&St(),o=w+16|0,(e[o>>2]|0)==(H|0)?e[o>>2]=z:e[w+20>>2]=z,!z)break;a=e[10222]|0,z>>>0>>0&&St(),e[z+24>>2]=w,o=e[t+(r+16)>>2]|0;do if(o)if(o>>>0>>0)St();else{e[z+16>>2]=o,e[o+24>>2]=z;break}while(!1);if(o=e[t+(r+20)>>2]|0,o)if(o>>>0<(e[10222]|0)>>>0)St();else{e[z+20>>2]=o,e[o+24>>2]=z;break}}}else{if(l=e[t+(r+8)>>2]|0,a=e[t+(r+12)>>2]|0,o=40912+(h<<1<<2)|0,(l|0)!=(o|0)&&(l>>>0>>0&&St(),(e[l+12>>2]|0)!=(H|0)&&St()),(a|0)==(l|0)){e[10218]=e[10218]&~(1<>>0>>0&&St(),o=a+8|0,(e[o>>2]|0)==(H|0)?_=o:St()):_=a+8|0,e[l+12>>2]=a,e[_>>2]=l}while(!1);if(e[$+4>>2]=d|1,e[$+d>>2]=d,($|0)==(e[10223]|0)){e[10220]=d;return}}if(o=d>>>3,d>>>0<256){a=o<<1,h=40912+(a<<2)|0,l=e[10218]|0,o=1<>2]|0,a>>>0<(e[10222]|0)>>>0?St():(K=o,G=a)):(e[10218]=l|o,K=40912+(a+2<<2)|0,G=h),e[K>>2]=$,e[G+12>>2]=$,e[$+8>>2]=G,e[$+12>>2]=h;return}if(o=d>>>8,o?d>>>0>16777215?h=31:(K=(o+1048320|0)>>>16&8,G=o<>>16&4,G=G<>>16&2,h=14-(H|K|h)+(G<>>15)|0,h=d>>>(h+7|0)&1|h<<1):h=0,o=41176+(h<<2)|0,e[$+28>>2]=h,e[$+20>>2]=0,e[$+16>>2]=0,a=e[10219]|0,l=1<>2]=$,e[$+24>>2]=o,e[$+12>>2]=$,e[$+8>>2]=$;return}o=e[o>>2]|0;e:do if((e[o+4>>2]&-8|0)!=(d|0)){for(h=d<<((h|0)==31?0:25-(h>>>1)|0);a=o+16+(h>>>31<<2)|0,l=e[a>>2]|0,!!l;)if((e[l+4>>2]&-8|0)==(d|0)){o=l;break e}else h=h<<1,o=l;a>>>0<(e[10222]|0)>>>0&&St(),e[a>>2]=$,e[$+24>>2]=o,e[$+12>>2]=$,e[$+8>>2]=$;return}while(!1);a=o+8|0,l=e[a>>2]|0,G=e[10222]|0,l>>>0>=G>>>0&o>>>0>=G>>>0||St(),e[l+12>>2]=$,e[a>>2]=$,e[$+8>>2]=l,e[$+12>>2]=o,e[$+24>>2]=0}function Fd(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;if(a=e[9321]|0,_d(42048,a,42104),e[10342]=42892,e[10344]=42912,e[10343]=0,t=e[10720]|0,m=0,Ae(62,41368+t|0,42048),h=m,m=0,h&1&&(h=j()|0,tt(41376),le(h|0)),e[41368+(t+72)>>2]=0,e[41368+(t+76)>>2]=-1,l=e[9322]|0,Os(42152,l,42112),e[10364]=42972,e[10365]=42992,o=e[10740]|0,m=0,Ae(62,41456+o|0,42152),h=m,m=0,h&1&&(h=j()|0,tt(41460),le(h|0)),t=o+72|0,e[41456+t>>2]=0,r=o+76|0,e[41456+r>>2]=-1,h=e[9320]|0,Os(42200,h,42120),e[10385]=42972,e[10386]=42992,m=0,Ae(62,41540+o|0,42200),d=m,m=0,d&1&&(d=j()|0,tt(41544),le(d|0)),e[41540+t>>2]=0,e[41540+r>>2]=-1,d=e[41540+((e[(e[10385]|0)+-12>>2]|0)+24)>>2]|0,e[10406]=42972,e[10407]=42992,m=0,Ae(62,41624+o|0,d|0),d=m,m=0,d&1&&(d=j()|0,tt(41628),le(d|0)),e[41624+t>>2]=0,e[41624+r>>2]=-1,e[41368+((e[(e[10342]|0)+-12>>2]|0)+72)>>2]=41456,t=41540+((e[(e[10385]|0)+-12>>2]|0)+4)|0,e[t>>2]=e[t>>2]|8192,e[41540+((e[(e[10385]|0)+-12>>2]|0)+72)>>2]=41456,Pd(42248,a,42128),e[10427]=42932,e[10429]=42952,e[10428]=0,t=e[10730]|0,m=0,Ae(62,41708+t|0,42248),d=m,m=0,d&1&&(d=j()|0,mn(41716),le(d|0)),e[41708+(t+72)>>2]=0,e[41708+(t+76)>>2]=-1,$s(42304,l,42136),e[10449]=43012,e[10450]=43032,o=e[10750]|0,m=0,Ae(62,41796+o|0,42304),d=m,m=0,d&1&&(d=j()|0,mn(41800),le(d|0)),t=o+72|0,e[41796+t>>2]=0,r=o+76|0,e[41796+r>>2]=-1,$s(42352,h,42144),e[10470]=43012,e[10471]=43032,m=0,Ae(62,41880+o|0,42352),d=m,m=0,d&1&&(d=j()|0,mn(41884),le(d|0)),e[41880+t>>2]=0,e[41880+r>>2]=-1,d=e[41880+((e[(e[10470]|0)+-12>>2]|0)+24)>>2]|0,e[10491]=43012,e[10492]=43032,m=0,Ae(62,41964+o|0,d|0),d=m,m=0,d&1)d=j()|0,mn(41968),le(d|0);else{e[41964+t>>2]=0,e[41964+r>>2]=-1,e[41708+((e[(e[10427]|0)+-12>>2]|0)+72)>>2]=41796,d=41880+((e[(e[10470]|0)+-12>>2]|0)+4)|0,e[d>>2]=e[d>>2]|8192,e[41880+((e[(e[10470]|0)+-12>>2]|0)+72)>>2]=41796;return}}function Nd(t){t=t|0,m=0,ge(70,41456)|0,t=m,m=0,!(!(t&1)&&(m=0,ge(70,41624)|0,t=m,m=0,!(t&1))&&(m=0,ge(71,41796)|0,t=m,m=0,!(t&1))&&(m=0,ge(71,41964)|0,t=m,m=0,!(t&1)))&&(t=j(0)|0,$t(t))}function Rd(){Fd(0),Nt(187,56757,Q|0)|0}function Md(){}function _d(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;if(l=b,b=b+16|0,h=l+4|0,a=l,Sr(t),e[t>>2]=42600,e[t+32>>2]=r,e[t+40>>2]=o,e[t+48>>2]=-1,S[t+52>>0]=0,tn(h,t+4|0),e[a>>2]=e[h>>2],m=0,Ae(23,t|0,a|0),o=m,m=0,o&1)h=j()|0,_0(a),wt(t),le(h|0);else{_0(a),b=l;return}}function Os(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;if(l=b,b=b+16|0,h=l+4|0,a=l,Sr(t),e[t>>2]=42536,e[t+32>>2]=r,tn(h,t+4|0),e[a>>2]=e[h>>2],m=0,r=Ne(37,a|0,44280)|0,h=m,m=0,h&1)h=j()|0,_0(a),wt(t),le(h|0);else{_0(a),e[t+36>>2]=r,e[t+40>>2]=o,h=(Et[e[(e[r>>2]|0)+28>>2]&127](r)|0)&1,S[t+44>>0]=h,b=l;return}}function Pd(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;if(l=b,b=b+16|0,h=l+4|0,a=l,Hs(t),e[t>>2]=42472,e[t+32>>2]=r,e[t+40>>2]=o,e[t+48>>2]=-1,S[t+52>>0]=0,tn(h,t+4|0),e[a>>2]=e[h>>2],m=0,Ae(21,t|0,a|0),o=m,m=0,o&1)h=j()|0,_0(a),rn(t),le(h|0);else{_0(a),b=l;return}}function $s(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;if(l=b,b=b+16|0,h=l+4|0,a=l,Hs(t),e[t>>2]=42408,e[t+32>>2]=r,tn(h,t+4|0),e[a>>2]=e[h>>2],m=0,r=Ne(37,a|0,44288)|0,h=m,m=0,h&1)h=j()|0,_0(a),rn(t),le(h|0);else{_0(a),e[t+36>>2]=r,e[t+40>>2]=o,h=(Et[e[(e[r>>2]|0)+28>>2]&127](r)|0)&1,S[t+44>>0]=h,b=l;return}}function Ld(t){t=t|0,rn(t),he(t)}function Od(t,r){t=t|0,r=r|0,Et[e[(e[t>>2]|0)+24>>2]&127](t)|0,r=O0(r,44288)|0,e[t+36>>2]=r,r=(Et[e[(e[r>>2]|0)+28>>2]&127](r)|0)&1,S[t+44>>0]=r}function $d(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;D=b,b=b+16|0,w=D+8|0,d=D,o=t+36|0,a=t+40|0,l=w+8|0,h=w,r=t+32|0;e:for(;;){if(t=e[o>>2]|0,t=an[e[(e[t>>2]|0)+20>>2]&31](t,e[a>>2]|0,w,l,d)|0,E=(e[d>>2]|0)-h|0,(gi(w,1,E,e[r>>2]|0)|0)!=(E|0)){t=-1;break}switch(t|0){case 1:break;case 2:{t=-1;break e}default:{C=4;break e}}}return(C|0)==4&&(t=((Fr(e[r>>2]|0)|0)!=0)<<31>>31),b=D,t|0}function Bd(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;e:do if(S[t+44>>0]|0)r=gi(r,4,o,e[t+32>>2]|0)|0;else if((o|0)>0)for(a=r,r=0;;){if((U0[e[(e[t>>2]|0)+52>>2]&63](t,e[a>>2]|0)|0)==-1)break e;if(r=r+1|0,(r|0)<(o|0))a=a+4|0;else break}else r=0;while(!1);return r|0}function Vd(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;H=b,b=b+32|0,R=H+16|0,o=H+8|0,F=H+4|0,E=H,_=(r|0)==-1;e:do if(_)z=11;else{if(e[o>>2]=r,S[t+44>>0]|0)if((gi(o,4,1,e[t+32>>2]|0)|0)==1){z=11;break}else{o=-1;break}for(e[F>>2]=R,C=o+4|0,D=t+36|0,l=t+40|0,h=R+8|0,d=R,w=t+32|0;;){if(t=e[D>>2]|0,t=Ci[e[(e[t>>2]|0)+12>>2]&15](t,e[l>>2]|0,o,C,E,R,h,F)|0,(e[E>>2]|0)==(o|0)){o=-1;break e}if((t|0)==3)break;if(a=(t|0)==1,t>>>0>=2){o=-1;break e}if(t=(e[F>>2]|0)-d|0,(gi(R,1,t,e[w>>2]|0)|0)!=(t|0)){o=-1;break e}if(a)o=a?e[E>>2]|0:o;else{z=11;break e}}(gi(o,1,1,e[w>>2]|0)|0)!=1?o=-1:z=11}while(!1);return(z|0)==11&&(o=_?0:r),b=H,o|0}function Ud(t,r){t=t|0,r=r|0;var o=0,a=0;a=O0(r,44288)|0,o=t+36|0,e[o>>2]=a,a=Et[e[(e[a>>2]|0)+24>>2]&127](a)|0,r=t+44|0,e[r>>2]=a,o=e[o>>2]|0,o=(Et[e[(e[o>>2]|0)+28>>2]&127](o)|0)&1,S[t+53>>0]=o,(e[r>>2]|0)>8&&fn(56783)}function zd(t){t=t|0,rn(t),he(t)}function Gd(t){return t=t|0,Bs(t,0)|0}function qd(t){return t=t|0,Bs(t,1)|0}function Wd(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;D=b,b=b+32|0,C=D+16|0,w=D+8|0,a=D+4|0,l=D,h=t+52|0,o=(S[h>>0]|0)!=0;e:do if((r|0)==-1)o?r=-1:(r=e[t+48>>2]|0,S[h>>0]=(r|0)!=-1&1);else{d=t+48|0;t:do if(o){switch(e[a>>2]=e[d>>2],o=e[t+36>>2]|0,Ci[e[(e[o>>2]|0)+12>>2]&15](o,e[t+40>>2]|0,a,a+4|0,l,C,C+8|0,w)|0){case 1:case 2:{r=-1;break e}case 3:{S[C>>0]=e[d>>2],e[w>>2]=C+1;break}default:}for(o=t+32|0;;){if(a=e[w>>2]|0,a>>>0<=C>>>0)break t;if(t=a+-1|0,e[w>>2]=t,(Rn(S[t>>0]|0,e[o>>2]|0)|0)==-1){r=-1;break e}}}while(!1);e[d>>2]=r,S[h>>0]=1}while(!1);return b=D,r|0}function Bs(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0;z=b,b=b+32|0,_=z+16|0,R=z+8|0,D=z+4|0,E=z,l=t+52|0;e:do if(S[l>>0]|0)a=t+48|0,o=e[a>>2]|0,r&&(e[a>>2]=-1,S[l>>0]=0);else{if(o=e[t+44>>2]|0,o=(o|0)>1?o:1,F=t+32|0,(o|0)>0){l=0;do{if(a=Nn(e[F>>2]|0)|0,(a|0)==-1){o=-1;break e}S[_+l>>0]=a,l=l+1|0}while((l|0)<(o|0))}t:do if(S[t+53>>0]|0)e[R>>2]=S[_>>0];else{d=t+40|0,w=t+36|0,C=R+4|0;i:for(;;){switch(H=e[d>>2]|0,l=H,a=e[l>>2]|0,l=e[l+4>>2]|0,K=e[w>>2]|0,h=_+o|0,Ci[e[(e[K>>2]|0)+16>>2]&15](K,H,_,h,D,R,C,E)|0){case 2:{o=-1;break e}case 3:break i;case 1:break;default:break t}if(K=e[d>>2]|0,e[K>>2]=a,e[K+4>>2]=l,(o|0)==8){o=-1;break e}if(a=Nn(e[F>>2]|0)|0,(a|0)==-1){o=-1;break e}S[h>>0]=a,o=o+1|0}e[R>>2]=S[_>>0]}while(!1);if(r){o=e[R>>2]|0,e[t+48>>2]=o;break}for(;!((o|0)<=0);)if(o=o+-1|0,(Rn(S[_+o>>0]|0,e[F>>2]|0)|0)==-1){o=-1;break e}o=e[R>>2]|0}while(!1);return b=z,o|0}function Hd(t){t=t|0,wt(t),he(t)}function Qd(t,r){t=t|0,r=r|0,Et[e[(e[t>>2]|0)+24>>2]&127](t)|0,r=O0(r,44280)|0,e[t+36>>2]=r,r=(Et[e[(e[r>>2]|0)+28>>2]&127](r)|0)&1,S[t+44>>0]=r}function Kd(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;D=b,b=b+16|0,w=D+8|0,d=D,o=t+36|0,a=t+40|0,l=w+8|0,h=w,r=t+32|0;e:for(;;){if(t=e[o>>2]|0,t=an[e[(e[t>>2]|0)+20>>2]&31](t,e[a>>2]|0,w,l,d)|0,E=(e[d>>2]|0)-h|0,(gi(w,1,E,e[r>>2]|0)|0)!=(E|0)){t=-1;break}switch(t|0){case 1:break;case 2:{t=-1;break e}default:{C=4;break e}}}return(C|0)==4&&(t=((Fr(e[r>>2]|0)|0)!=0)<<31>>31),b=D,t|0}function Yd(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;e:do if(S[t+44>>0]|0)r=gi(r,1,o,e[t+32>>2]|0)|0;else if((o|0)>0)for(a=r,r=0;;){if((U0[e[(e[t>>2]|0)+52>>2]&63](t,N[a>>0]|0)|0)==-1)break e;if(r=r+1|0,(r|0)<(o|0))a=a+1|0;else break}else r=0;while(!1);return r|0}function jd(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;H=b,b=b+32|0,R=H+16|0,o=H+8|0,F=H+4|0,E=H,_=(r|0)==-1;e:do if(_)z=11;else{if(S[o>>0]=r,S[t+44>>0]|0)if((gi(o,1,1,e[t+32>>2]|0)|0)==1){z=11;break}else{o=-1;break}for(e[F>>2]=R,D=o+1|0,l=t+36|0,h=t+40|0,d=R+8|0,w=R,C=t+32|0;;){if(t=e[l>>2]|0,t=Ci[e[(e[t>>2]|0)+12>>2]&15](t,e[h>>2]|0,o,D,E,R,d,F)|0,(e[E>>2]|0)==(o|0)){o=-1;break e}if((t|0)==3)break;if(a=(t|0)==1,t>>>0>=2){o=-1;break e}if(t=(e[F>>2]|0)-w|0,(gi(R,1,t,e[C>>2]|0)|0)!=(t|0)){o=-1;break e}if(a)o=a?e[E>>2]|0:o;else{z=11;break e}}(gi(o,1,1,e[C>>2]|0)|0)!=1?o=-1:z=11}while(!1);return(z|0)==11&&(o=_?0:r),b=H,o|0}function Xd(t,r){t=t|0,r=r|0;var o=0,a=0;a=O0(r,44280)|0,o=t+36|0,e[o>>2]=a,a=Et[e[(e[a>>2]|0)+24>>2]&127](a)|0,r=t+44|0,e[r>>2]=a,o=e[o>>2]|0,o=(Et[e[(e[o>>2]|0)+28>>2]&127](o)|0)&1,S[t+53>>0]=o,(e[r>>2]|0)>8&&fn(56783)}function Zd(t){t=t|0,wt(t),he(t)}function Jd(t){return t=t|0,Vs(t,0)|0}function ep(t){return t=t|0,Vs(t,1)|0}function tp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;D=b,b=b+32|0,C=D+16|0,w=D+4|0,a=D+8|0,l=D,h=t+52|0,o=(S[h>>0]|0)!=0;e:do if((r|0)==-1)o?r=-1:(r=e[t+48>>2]|0,S[h>>0]=(r|0)!=-1&1);else{d=t+48|0;t:do if(o){switch(S[a>>0]=e[d>>2],o=e[t+36>>2]|0,Ci[e[(e[o>>2]|0)+12>>2]&15](o,e[t+40>>2]|0,a,a+1|0,l,C,C+8|0,w)|0){case 1:case 2:{r=-1;break e}case 3:{S[C>>0]=e[d>>2],e[w>>2]=C+1;break}default:}for(o=t+32|0;;){if(a=e[w>>2]|0,a>>>0<=C>>>0)break t;if(t=a+-1|0,e[w>>2]=t,(Rn(S[t>>0]|0,e[o>>2]|0)|0)==-1){r=-1;break e}}}while(!1);e[d>>2]=r,S[h>>0]=1}while(!1);return b=D,r|0}function Vs(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0;z=b,b=b+32|0,_=z+16|0,R=z+8|0,D=z+4|0,E=z,l=t+52|0;e:do if(S[l>>0]|0)a=t+48|0,o=e[a>>2]|0,r&&(e[a>>2]=-1,S[l>>0]=0);else{if(o=e[t+44>>2]|0,o=(o|0)>1?o:1,F=t+32|0,(o|0)>0){l=0;do{if(a=Nn(e[F>>2]|0)|0,(a|0)==-1){o=-1;break e}S[_+l>>0]=a,l=l+1|0}while((l|0)<(o|0))}t:do if(S[t+53>>0]|0)S[R>>0]=S[_>>0]|0;else{d=t+40|0,w=t+36|0,C=R+1|0;i:for(;;){switch(H=e[d>>2]|0,l=H,a=e[l>>2]|0,l=e[l+4>>2]|0,K=e[w>>2]|0,h=_+o|0,Ci[e[(e[K>>2]|0)+16>>2]&15](K,H,_,h,D,R,C,E)|0){case 2:{o=-1;break e}case 3:break i;case 1:break;default:break t}if(K=e[d>>2]|0,e[K>>2]=a,e[K+4>>2]=l,(o|0)==8){o=-1;break e}if(a=Nn(e[F>>2]|0)|0,(a|0)==-1){o=-1;break e}S[h>>0]=a,o=o+1|0}S[R>>0]=S[_>>0]|0}while(!1);if(r)o=S[R>>0]|0,e[t+48>>2]=o&255;else{for(;!((o|0)<=0);)if(o=o+-1|0,(Rn(N[_+o>>0]|0,e[F>>2]|0)|0)==-1){o=-1;break e}o=S[R>>0]|0}o=o&255}while(!1);return b=z,o|0}function pA(t){t=t|0}function pn(t){t=t|0,t=t+4|0,e[t>>2]=(e[t>>2]|0)+1}function Bt(t){t=t|0;var r=0,o=0;return o=t+4|0,r=e[o>>2]|0,e[o>>2]=r+-1,r?t=0:(Rt[e[(e[t>>2]|0)+8>>2]&255](t),t=1),t|0}function ip(t,r){if(t=t|0,r=r|0,e[t>>2]=36868,m=0,Ae(86,t+4|0,(S[r>>0]&1?e[r+8>>2]|0:r+1|0)|0),t=m,m=0,t&1)t=j()|0,le(t|0);else return}function np(t,r){if(t=t|0,r=r|0,e[t>>2]=36868,m=0,Ae(86,t+4|0,r|0),t=m,m=0,t&1)t=j()|0,le(t|0);else return}function rp(t,r){t=t|0,r=r|0;var o=0,a=0;a=$i(r)|0,o=Xe(a+13|0)|0,e[o>>2]=a,e[o+4>>2]=a,e[o+8>>2]=0,o=o+12|0,o0(o|0,r|0,a+1|0)|0,e[t>>2]=o}function sp(t,r,o){t=t|0,r=r|0,o=o|0,e[t>>2]=o,e[t+4>>2]=r}function ap(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return l=b,b=b+16|0,a=l,Ln[e[(e[t>>2]|0)+12>>2]&15](a,t,r),(e[a+4>>2]|0)==(e[o+4>>2]|0)?a=(e[a>>2]|0)==(e[o>>2]|0):a=0,b=l,a|0}function lp(t,r,o){return t=t|0,r=r|0,o=o|0,((e[r>>2]|0)==(o|0)?(e[r+4>>2]|0)==(t|0):0)|0}function up(t,r,o){t=t|0,r=r|0,o=o|0,r=vo(o)|0,yi(t,r,$i(r)|0)}function cp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;d=b,b=b+16|0,h=d,a=e[r>>2]|0;do if(a)if(l=S[o>>0]|0,l&1?l=e[o+4>>2]|0:l=(l&255)>>>1,l&&(wp(o,56990)|0,a=e[r>>2]|0),r=e[r+4>>2]|0,Ln[e[(e[r>>2]|0)+24>>2]&15](h,r,a),r=S[h>>0]|0,l=(r&1)==0,m=0,Ve(30,o|0,(l?h+1|0:e[h+8>>2]|0)|0,(l?(r&255)>>>1:e[h+4>>2]|0)|0)|0,r=m,m=0,r&1)d=j()|0,de(h),le(d|0);else{de(h);break}while(!1);e[t>>2]=e[o>>2],e[t+4>>2]=e[o+4>>2],e[t+8>>2]=e[o+8>>2],e[o>>2]=0,e[o+4>>2]=0,e[o+8>>2]=0,b=d}function fp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;l=b,b=b+32|0,a=l+12|0,h=l,yi(h,o,$i(o)|0),m=0,ve(10,a|0,r|0,h|0),o=m,m=0;do if(o&1)a=j()|0;else if(m=0,Ae(87,t|0,a|0),o=m,m=0,o&1){l=j()|0,de(a),a=l;break}else{de(a),de(h),e[t>>2]=42664,o=e[r+4>>2]|0,h=t+8|0,e[h>>2]=e[r>>2],e[h+4>>2]=o,b=l;return}while(!1);de(h),le(a|0)}function hp(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;h=b,b=b+48|0,l=h+24|0,w=h+16|0,d=h,e[w>>2]=r,e[w+4>>2]=o,hr(d,a),m=0,ve(10,l|0,w|0,d|0),a=m,m=0;do if(a&1)l=j()|0;else if(m=0,Ae(87,t|0,l|0),w=m,m=0,w&1){w=j()|0,de(l),l=w;break}else{de(l),de(d),e[t>>2]=42664,e[t+8>>2]=r,e[t+12>>2]=o,b=h;return}while(!1);de(d),le(l|0)}function dp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;l=b,b=b+48|0,a=l+24|0,d=l+16|0,h=l,e[d>>2]=r,e[d+4>>2]=o,yi(h,58898,0),m=0,ve(10,a|0,d|0,h|0),d=m,m=0;do if(d&1)a=j()|0;else if(m=0,Ae(87,t|0,a|0),d=m,m=0,d&1){d=j()|0,de(a),a=d;break}else{de(a),de(h),e[t>>2]=42664,e[t+8>>2]=r,e[t+12>>2]=o,b=l;return}while(!1);de(h),le(a|0)}function fr(t){t=t|0,In(t)}function pp(t){t=t|0,In(t),he(t)}function mp(t){t=t|0}function gp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(Gr(42676)|0,(e[t>>2]|0)==1)do Q0(42704,42676)|0;while((e[t>>2]|0)==1);do if(e[t>>2]|0)Br(42676)|0;else{if(e[t>>2]=1,m=0,ge(72,42676)|0,a=m,m=0,!(a&1)&&(m=0,ue(o|0,r|0),a=m,m=0,!(a&1))&&(m=0,ge(73,42676)|0,a=m,m=0,!(a&1))&&(e[t>>2]=-1,m=0,ge(72,42676)|0,a=m,m=0,!(a&1))&&(m=0,ge(74,42704)|0,a=m,m=0,!(a&1)))break;a=j(0)|0,K0(a|0)|0,m=0,ge(73,42676)|0,a=m,m=0,!(a&1)&&(e[t>>2]=0,m=0,ge(72,42676)|0,a=m,m=0,!(a&1))&&(m=0,ge(74,42704)|0,a=m,m=0,!(a&1))&&(m=0,bt(5),m=0),r=j()|0,m=0,bt(3),a=m,m=0,a&1?(a=j(0)|0,$t(a)):le(r|0)}while(!1)}function hr(t,r){t=t|0,r=r|0,S[r>>0]&1?yi(t,e[r+8>>2]|0,e[r+4>>2]|0):(e[t>>2]=e[r>>2],e[t+4>>2]=e[r+4>>2],e[t+8>>2]=e[r+8>>2])}function yi(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;o>>>0>4294967279&&si(t),o>>>0<11?(S[t>>0]=o<<1,t=t+1|0):(l=o+16&-16,a=Xe(l)|0,e[t+8>>2]=a,e[t>>2]=l|1,e[t+4>>2]=o,t=a),o0(t|0,r|0,o|0)|0,S[t+o>>0]=0}function dr(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;r>>>0>4294967279&&si(t),r>>>0<11?(S[t>>0]=r<<1,t=t+1|0):(l=r+16&-16,a=Xe(l)|0,e[t+8>>2]=a,e[t>>2]=l|1,e[t+4>>2]=r,t=a),Jt(t|0,o|0,r|0)|0,S[t+r>>0]=0}function de(t){t=t|0,S[t>>0]&1&&he(e[t+8>>2]|0)}function Sp(t,r){t=t|0,r=r|0;var o=0,a=0;return(t|0)!=(r|0)&&(o=S[r>>0]|0,a=(o&1)==0,Us(t,a?r+1|0:e[r+8>>2]|0,a?(o&255)>>>1:e[r+4>>2]|0)|0),t|0}function Ap(t,r){return t=t|0,r=r|0,Us(t,r,$i(r)|0)|0}function Us(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;a=S[t>>0]|0,a&1?(a=e[t>>2]|0,h=(a&-2)+-1|0,a=a&255):h=10,l=(a&1)==0;do if(h>>>0>=o>>>0)if(l?a=t+1|0:a=e[t+8>>2]|0,vn(a|0,r|0,o|0)|0,S[a+o>>0]=0,S[t>>0]&1){e[t+4>>2]=o;break}else{S[t>>0]=o<<1;break}else l?a=(a&255)>>>1:a=e[t+4>>2]|0,qs(t,h,o-h|0,a,0,a,o,r);while(!1);return t|0}function zs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;a=S[t>>0]|0,l=(a&1)==0,l?a=(a&255)>>>1:a=e[t+4>>2]|0;do if(a>>>0>=r>>>0)if(l){S[t+1+r>>0]=0,S[t>>0]=r<<1;break}else{S[(e[t+8>>2]|0)+r>>0]=0,e[t+4>>2]=r;break}else vp(t,r-a|0,o)|0;while(!1)}function vp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;return r&&(a=S[t>>0]|0,a&1?(a=e[t>>2]|0,l=(a&-2)+-1|0,a=a&255):l=10,a&1?h=e[t+4>>2]|0:h=(a&255)>>>1,(l-h|0)>>>0>>0&&(pr(t,l,r-l+h|0,h,h,0,0),a=S[t>>0]|0),a&1?l=e[t+8>>2]|0:l=t+1|0,Jt(l+h|0,o|0,r|0)|0,a=h+r|0,S[t>>0]&1?e[t+4>>2]=a:S[t>>0]=a<<1,S[l+a>>0]=0),t|0}function xp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;r>>>0>4294967279&&si(t),o=S[t>>0]|0,o&1?(o=e[t>>2]|0,a=(o&-2)+-1|0,o=o&255):a=10,o&1?w=e[t+4>>2]|0:w=(o&255)>>>1,r=w>>>0>r>>>0?w:r,r>>>0<11?d=10:d=(r+16&-16)+-1|0;e:do if((d|0)!=(a|0)){do if((d|0)!=10){if(r=d+1|0,d>>>0<=a>>>0){if(m=0,r=ge(67,r|0)|0,h=m,m=0,h&1){t=j(0)|0,K0(t|0)|0,ei();break e}}else r=Xe(r)|0;if(o&1){a=1,l=e[t+8>>2]|0,h=1;break}else{a=1,l=t+1|0,h=0;break}}else r=t+1|0,a=0,l=e[t+8>>2]|0,h=1;while(!1);if(o&1?o=e[t+4>>2]|0:o=(o&255)>>>1,o0(r|0,l|0,o+1|0)|0,h&&he(l),a){e[t>>2]=d+1|1,e[t+4>>2]=w,e[t+8>>2]=r;break}else{S[t>>0]=w<<1;break}}while(!1)}function wp(t,r){return t=t|0,r=r|0,Gs(t,r,$i(r)|0)|0}function yp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;o=S[t>>0]|0,a=(o&1)!=0,a?(l=(e[t>>2]&-2)+-1|0,h=e[t+4>>2]|0):(l=10,h=(o&255)>>>1),(h|0)==(l|0)?(pr(t,l,1,l,l,0,0),S[t>>0]&1?l=8:l=7):a?l=8:l=7,(l|0)==7?(S[t>>0]=(h<<1)+2,o=t+1|0,a=h+1|0):(l|0)==8&&(o=e[t+8>>2]|0,a=h+1|0,e[t+4>>2]=a),S[o+h>>0]=r,S[o+a>>0]=0}function Gs(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;return a=S[t>>0]|0,a&1?(a=e[t>>2]|0,l=(a&-2)+-1|0,a=a&255):l=10,a&1?h=e[t+4>>2]|0:h=(a&255)>>>1,(l-h|0)>>>0>=o>>>0?o&&(a&1?l=e[t+8>>2]|0:l=t+1|0,o0(l+h|0,r|0,o|0)|0,a=h+o|0,S[t>>0]&1?e[t+4>>2]=a:S[t>>0]=a<<1,S[l+a>>0]=0):qs(t,l,o-l+h|0,h,h,0,o,r),t|0}function qs(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0;(-18-r|0)>>>0>>0&&si(t),S[t>>0]&1?E=e[t+8>>2]|0:E=t+1|0,r>>>0<2147483623?(C=o+r|0,D=r<<1,C=C>>>0>>0?D:C,C=C>>>0<11?11:C+16&-16):C=-17,D=Xe(C)|0,l&&o0(D|0,E|0,l|0)|0,d&&o0(D+l|0,w|0,d|0)|0,o=a-h|0,(o|0)!=(l|0)&&o0(D+(d+l)|0,E+(h+l)|0,o-l|0)|0,(r|0)!=10&&he(E),e[t+8>>2]=D,e[t>>2]=C|1,r=o+d|0,e[t+4>>2]=r,S[D+r>>0]=0}function pr(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0;(-17-r|0)>>>0>>0&&si(t),S[t>>0]&1?D=e[t+8>>2]|0:D=t+1|0,r>>>0<2147483623?(w=o+r|0,C=r<<1,w=w>>>0>>0?C:w,w=w>>>0<11?11:w+16&-16):w=-17,C=Xe(w)|0,l&&o0(C|0,D|0,l|0)|0,o=a-h|0,(o|0)!=(l|0)&&o0(C+(d+l)|0,D+(h+l)|0,o-l|0)|0,(r|0)!=10&&he(D),e[t+8>>2]=C,e[t>>2]=w|1}function mr(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;o>>>0>1073741807&&si(t),o>>>0<2?(S[t>>0]=o<<1,t=t+4|0):(l=o+4&-4,a=Xe(l<<2)|0,e[t+8>>2]=a,e[t>>2]=l|1,e[t+4>>2]=o,t=a),Bi(t,r,o)|0,e[t+(o<<2)>>2]=0}function gr(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;r>>>0>1073741807&&si(t),r>>>0<2?(S[t>>0]=r<<1,t=t+4|0):(l=r+4&-4,a=Xe(l<<2)|0,e[t+8>>2]=a,e[t>>2]=l|1,e[t+4>>2]=r,t=a),GS(t,o,r)|0,e[t+(r<<2)>>2]=0}function Pt(t){t=t|0,S[t>>0]&1&&he(e[t+8>>2]|0)}function Cp(t,r){return t=t|0,r=r|0,Tp(t,r,_n(r)|0)|0}function Tp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;a=S[t>>0]|0,a&1?(a=e[t>>2]|0,h=(a&-2)+-1|0,a=a&255):h=1,l=(a&1)==0;do if(h>>>0>=o>>>0)if(l?a=t+4|0:a=e[t+8>>2]|0,zS(a,r,o)|0,e[a+(o<<2)>>2]=0,S[t>>0]&1){e[t+4>>2]=o;break}else{S[t>>0]=o<<1;break}else l?a=(a&255)>>>1:a=e[t+4>>2]|0,Ep(t,h,o-h|0,a,0,a,o,r);while(!1);return t|0}function Ip(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;r>>>0>1073741807&&si(t),o=S[t>>0]|0,o&1?(o=e[t>>2]|0,a=(o&-2)+-1|0,o=o&255):a=1,o&1?w=e[t+4>>2]|0:w=(o&255)>>>1,r=w>>>0>r>>>0?w:r,r>>>0<2?d=1:d=(r+4&-4)+-1|0;e:do if((d|0)!=(a|0)){do if((d|0)!=1){if(r=(d<<2)+4|0,d>>>0<=a>>>0){if(m=0,r=ge(67,r|0)|0,h=m,m=0,h&1){t=j(0)|0,K0(t|0)|0,ei();break e}}else r=Xe(r)|0;if(o&1){a=1,l=e[t+8>>2]|0,h=1;break}else{a=1,l=t+4|0,h=0;break}}else r=t+4|0,a=0,l=e[t+8>>2]|0,h=1;while(!1);if(o&1?o=e[t+4>>2]|0:o=(o&255)>>>1,Bi(r,l,o+1|0)|0,h&&he(l),a){e[t>>2]=d+1|1,e[t+4>>2]=w,e[t+8>>2]=r;break}else{S[t>>0]=w<<1;break}}while(!1)}function kp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;o=S[t>>0]|0,a=(o&1)!=0,a?(l=(e[t>>2]&-2)+-1|0,h=e[t+4>>2]|0):(l=1,h=(o&255)>>>1),(h|0)==(l|0)?(Ws(t,l,1,l,l,0,0),S[t>>0]&1?l=8:l=7):a?l=8:l=7,(l|0)==7?(S[t>>0]=(h<<1)+2,o=t+4|0,a=h+1|0):(l|0)==8&&(o=e[t+8>>2]|0,a=h+1|0,e[t+4>>2]=a),e[o+(h<<2)>>2]=r,e[o+(a<<2)>>2]=0}function Ep(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0;(1073741806-r|0)>>>0>>0&&si(t),S[t>>0]&1?E=e[t+8>>2]|0:E=t+4|0,r>>>0<536870887?(C=o+r|0,D=r<<1,C=C>>>0>>0?D:C,C=C>>>0<2?2:C+4&-4):C=1073741807,D=Xe(C<<2)|0,l&&Bi(D,E,l)|0,d&&Bi(D+(l<<2)|0,w,d)|0,o=a-h|0,(o|0)!=(l|0)&&Bi(D+(d+l<<2)|0,E+(h+l<<2)|0,o-l|0)|0,(r|0)!=1&&he(E),e[t+8>>2]=D,e[t>>2]=C|1,r=o+d|0,e[t+4>>2]=r,e[D+(r<<2)>>2]=0}function Ws(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0;(1073741807-r|0)>>>0>>0&&si(t),S[t>>0]&1?D=e[t+8>>2]|0:D=t+4|0,r>>>0<536870887?(w=o+r|0,C=r<<1,w=w>>>0>>0?C:w,w=w>>>0<2?2:w+4&-4):w=1073741807,C=Xe(w<<2)|0,l&&Bi(C,D,l)|0,o=a-h|0,(o|0)!=(l|0)&&Bi(C+(d+l<<2)|0,D+(h+l<<2)|0,o-l|0)|0,(r|0)!=1&&he(D),e[t+8>>2]=C,e[t>>2]=w|1}function Dp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;if(l=r,a=o-l|0,a>>>0>4294967279&&si(t),a>>>0<11?(S[t>>0]=a<<1,h=t+1|0):(d=a+16&-16,h=Xe(d)|0,e[t+8>>2]=h,e[t>>2]=d|1,e[t+4>>2]=a),t=o-l|0,(r|0)!=(o|0))for(a=h;S[a>>0]=S[r>>0]|0,r=r+1|0,(r|0)!=(o|0);)a=a+1|0;S[h+t>>0]=0}function bp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;if(h=r,a=o-h|0,l=a>>2,l>>>0>1073741807&&si(t),l>>>0<2?(S[t>>0]=a>>>1,t=t+4|0):(d=l+4&-4,a=Xe(d<<2)|0,e[t+8>>2]=a,e[t>>2]=d|1,e[t+4>>2]=l,t=a),l=(o-h|0)>>>2,(r|0)!=(o|0))for(a=t;e[a>>2]=e[r>>2],r=r+4|0,(r|0)!=(o|0);)a=a+4|0;e[t+(l<<2)>>2]=0}function Fp(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;if(o=b,b=b+16|0,a=o,l=(e[t+24>>2]|0)==0,e[t+16>>2]=l&1|r,!((l&1|r)&e[t+20>>2])){b=o;return}r=Ct(16)|0,Tm()|0,e[a>>2]=1,e[a+4>>2]=43112,m=0,ve(11,r|0,57437,a|0),l=m,m=0,l&1?(l=j()|0,It(r|0),le(l|0)):Qt(r|0,864,112)}function G0(t){t=t|0;var r=0;if(e[t>>2]=43068,m=0,Ae(88,t|0,0),r=m,m=0,r&1)r=j(0)|0,$t(r);else{_0(t+28|0),n0(e[t+32>>2]|0),n0(e[t+36>>2]|0),n0(e[t+48>>2]|0),n0(e[t+60>>2]|0);return}}function tt(t){t=t|0,G0(t)}function mA(t){t=t|0,G0(t),he(t)}function Np(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;if(o=e[t+40>>2]|0,a=t+32|0,l=t+36|0,o)do o=o+-1|0,Ln[e[(e[a>>2]|0)+(o<<2)>>2]&15](r,t,e[(e[l>>2]|0)+(o<<2)>>2]|0);while(o|0)}function f0(t){t=t|0;var r=0,o=0;return o=b,b=b+16|0,r=o,tn(r,t+28|0),b=o,e[r>>2]|0}function Rp(t,r){t=t|0,r=r|0;var o=0;e[t+24>>2]=r,e[t+16>>2]=(r|0)==0&1,e[t+20>>2]=0,e[t+4>>2]=4098,e[t+12>>2]=0,e[t+8>>2]=6,o=t+28|0,r=t+32|0,t=r+40|0;do e[r>>2]=0,r=r+4|0;while((r|0)<(t|0));ur(o)}function mn(t){t=t|0,G0(t)}function gA(t){t=t|0,G0(t),he(t)}function wt(t){t=t|0,e[t>>2]=42760,_0(t+4|0)}function Mp(t){t=t|0,e[t>>2]=42760,_0(t+4|0),he(t)}function Sr(t){t=t|0,e[t>>2]=42760,ur(t+4|0),t=t+8|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[t+20>>2]=0}function _p(t,r){t=t|0,r=r|0}function Pp(t,r,o){return t=t|0,r=r|0,o=o|0,t|0}function Lp(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function Op(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function $p(t){return t=t|0,0}function Bp(t){return t=t|0,0}function Vp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;h=t+12|0,d=t+16|0;e:do if((o|0)>0)for(l=r,r=0;;){if(a=e[h>>2]|0,a>>>0<(e[d>>2]|0)>>>0)e[h>>2]=a+1,a=S[a>>0]|0;else{if(a=Et[e[(e[t>>2]|0)+40>>2]&127](t)|0,(a|0)==-1)break e;a=a&255}if(S[l>>0]=a,r=r+1|0,(r|0)<(o|0))l=l+1|0;else break}else r=0;while(!1);return r|0}function Up(t){return t=t|0,-1}function zp(t){t=t|0;var r=0;return(Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1?t=-1:(r=t+12|0,t=e[r>>2]|0,e[r>>2]=t+1,t=N[t>>0]|0),t|0}function Gp(t,r){return t=t|0,r=r|0,-1}function qp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;h=t+24|0,d=t+28|0;e:do if((o|0)>0)for(l=r,r=0;;){if(a=e[h>>2]|0,a>>>0>=(e[d>>2]|0)>>>0){if((U0[e[(e[t>>2]|0)+52>>2]&63](t,N[l>>0]|0)|0)==-1)break e}else w=S[l>>0]|0,e[h>>2]=a+1,S[a>>0]=w;if(r=r+1|0,(r|0)<(o|0))l=l+1|0;else break}else r=0;while(!1);return r|0}function Wp(t,r){return t=t|0,r=r|0,-1}function rn(t){t=t|0,e[t>>2]=42824,_0(t+4|0)}function Hp(t){t=t|0,e[t>>2]=42824,_0(t+4|0),he(t)}function Hs(t){t=t|0,e[t>>2]=42824,ur(t+4|0),t=t+8|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[t+20>>2]=0}function Qp(t,r){t=t|0,r=r|0}function Kp(t,r,o){return t=t|0,r=r|0,o=o|0,t|0}function Yp(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function jp(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,r=t,e[r>>2]=0,e[r+4>>2]=0,r=t+8|0,e[r>>2]=-1,e[r+4>>2]=-1}function Xp(t){return t=t|0,0}function Zp(t){return t=t|0,0}function Jp(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;h=t+12|0,d=t+16|0;e:do if((o|0)>0)for(l=r,r=0;;){if(a=e[h>>2]|0,a>>>0>=(e[d>>2]|0)>>>0){if(a=Et[e[(e[t>>2]|0)+40>>2]&127](t)|0,(a|0)==-1)break e}else e[h>>2]=a+4,a=e[a>>2]|0;if(e[l>>2]=a,r=r+1|0,(r|0)<(o|0))l=l+4|0;else break}else r=0;while(!1);return r|0}function em(t){return t=t|0,-1}function tm(t){t=t|0;var r=0;return(Et[e[(e[t>>2]|0)+36>>2]&127](t)|0)==-1?t=-1:(r=t+12|0,t=e[r>>2]|0,e[r>>2]=t+4,t=e[t>>2]|0),t|0}function im(t,r){return t=t|0,r=r|0,-1}function nm(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;h=t+24|0,d=t+28|0;e:do if((o|0)>0)for(l=r,r=0;;){if(a=e[h>>2]|0,a>>>0>=(e[d>>2]|0)>>>0){if((U0[e[(e[t>>2]|0)+52>>2]&63](t,e[l>>2]|0)|0)==-1)break e}else w=e[l>>2]|0,e[h>>2]=a+4,e[a>>2]=w;if(r=r+1|0,(r|0)<(o|0))l=l+4|0;else break}else r=0;while(!1);return r|0}function rm(t,r){return t=t|0,r=r|0,-1}function sm(t){t=t|0,G0(t+8|0)}function om(t){t=t|0,G0(t+((e[(e[t>>2]|0)+-12>>2]|0)+8)|0)}function Qs(t){t=t|0,G0(t+8|0),he(t)}function am(t){t=t|0,Qs(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)}function Ks(t){t=t|0;var r=0,o=0,a=0,l=0;a=b,b=b+16|0,o=a;e:do if(e[t+((e[(e[t>>2]|0)+-12>>2]|0)+24)>>2]|0){m=0,Ae(65,o|0,t|0),r=m,m=0;t:do if(r&1)r=j(0)|0;else{do if(S[o>>0]|0){if(r=e[t+((e[(e[t>>2]|0)+-12>>2]|0)+24)>>2]|0,m=0,r=ge(e[(e[r>>2]|0)+24>>2]|0,r|0)|0,l=m,m=0,!(l&1)&&((r|0)!=-1||(l=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+l|0,e[t+(l+16)>>2]|1|0),l=m,m=0,!(l&1))))break;r=j(0)|0,ki(o);break t}while(!1);ki(o);break e}while(!1);if(K0(r|0)|0,m=0,ue(181,t+(e[(e[t>>2]|0)+-12>>2]|0)|0),l=m,m=0,!(l&1)){ei();break}r=j()|0,m=0,bt(3),l=m,m=0,l&1?(l=j(0)|0,$t(l)):le(r|0)}while(!1);return b=a,t|0}function lm(t){t=t|0;var r=0;if(r=t+16|0,e[r>>2]=e[r>>2]|1,e[t+20>>2]&1)Ur();else return}function um(t){t=t|0,G0(t+8|0)}function cm(t){t=t|0,G0(t+((e[(e[t>>2]|0)+-12>>2]|0)+8)|0)}function Ys(t){t=t|0,G0(t+8|0),he(t)}function fm(t){t=t|0,Ys(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)}function js(t){t=t|0;var r=0,o=0,a=0,l=0;a=b,b=b+16|0,o=a;e:do if(e[t+((e[(e[t>>2]|0)+-12>>2]|0)+24)>>2]|0){m=0,Ae(89,o|0,t|0),r=m,m=0;t:do if(r&1)r=j(0)|0;else{do if(S[o>>0]|0){if(r=e[t+((e[(e[t>>2]|0)+-12>>2]|0)+24)>>2]|0,m=0,r=ge(e[(e[r>>2]|0)+24>>2]|0,r|0)|0,l=m,m=0,!(l&1)&&((r|0)!=-1||(l=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+l|0,e[t+(l+16)>>2]|1|0),l=m,m=0,!(l&1))))break;r=j(0)|0,Js(o);break t}while(!1);Js(o);break e}while(!1);if(K0(r|0)|0,m=0,ue(181,t+(e[(e[t>>2]|0)+-12>>2]|0)|0),l=m,m=0,!(l&1)){ei();break}r=j()|0,m=0,bt(3),l=m,m=0,l&1?(l=j(0)|0,$t(l)):le(r|0)}while(!1);return b=a,t|0}function SA(t,r){t=t|0,r=r|0}function hm(t){t=t|0,G0(t+4|0)}function dm(t){t=t|0,G0(t+((e[(e[t>>2]|0)+-12>>2]|0)+4)|0)}function Xs(t){t=t|0,G0(t+4|0),he(t)}function pm(t){t=t|0,Xs(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)}function mm(t,r){t=t|0,r=r|0;var o=0;S[t>>0]=0,e[t+4>>2]=r,o=e[(e[r>>2]|0)+-12>>2]|0,e[r+(o+16)>>2]|0||(o=e[r+(o+72)>>2]|0,o&&Ks(o)|0,S[t>>0]=1)}function ki(t){t=t|0;var r=0,o=0;t=t+4|0,o=e[t>>2]|0,r=e[(e[o>>2]|0)+-12>>2]|0;do if(e[o+(r+24)>>2]|0&&!(e[o+(r+16)>>2]|0)&&e[o+(r+4)>>2]&8192|0&&!(Or()|0)){if(r=e[t>>2]|0,r=e[r+((e[(e[r>>2]|0)+-12>>2]|0)+24)>>2]|0,m=0,r=ge(e[(e[r>>2]|0)+24>>2]|0,r|0)|0,o=m,m=0,!(o&1)&&((r|0)!=-1||(r=e[t>>2]|0,o=e[(e[r>>2]|0)+-12>>2]|0,m=0,Ae(66,r+o|0,e[r+(o+16)>>2]|1|0),o=m,m=0,!(o&1))))break;o=j(0)|0,K0(o|0)|0,m=0,bt(3),o=m,m=0,o&1&&(o=j(0)|0,$t(o))}while(!1)}function gm(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;R=b,b=b+32|0,w=R+20|0,C=R+16|0,E=R+8|0,o=R,m=0,Ae(65,E|0,t|0),D=m,m=0;e:do if(D&1)o=j(0)|0,a=t,l=t,F=19;else{do if(S[E>>0]|0){if(D=f0(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)|0,e[o>>2]=D,m=0,D=Ne(37,o|0,43392)|0,d=m,m=0,d&1)F=j(0)|0,_0(o),o=F;else{_0(o),l=e[(e[t>>2]|0)+-12>>2]|0,d=e[t+(l+24)>>2]|0,a=t+l|0,l=t+(l+76)|0,o=e[l>>2]|0;do if((o|0)==-1){if(o=f0(a)|0,e[w>>2]=o,m=0,o=Ne(37,w|0,44220)|0,_=m,m=0,!(_&1)&&(m=0,h=Ne(e[(e[o>>2]|0)+28>>2]|0,o|0,32)|0,_=m,m=0,!(_&1))){_0(w),o=h<<24>>24,e[l>>2]=o,F=10;break}o=j(0)|0,_0(w)}else F=10;while(!1);if((F|0)==10){if(_=e[(e[D>>2]|0)+16>>2]|0,e[C>>2]=d,m=0,e[w>>2]=e[C>>2],o=se(_|0,D|0,w|0,a|0,o&255|0,r|0)|0,_=m,m=0,!(_&1)&&(o||(_=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+_|0,e[t+(_+16)>>2]|5|0),_=m,m=0,!(_&1))))break;o=j(0)|0}}ki(E),a=t,l=t,F=19;break e}while(!1);ki(E)}while(!1);do if((F|0)==19){if(K0(o|0)|0,m=0,ue(181,a+(e[(e[l>>2]|0)+-12>>2]|0)|0),_=m,m=0,!(_&1)){ei();break}o=j()|0,m=0,bt(3),_=m,m=0,_&1?(_=j(0)|0,$t(_)):le(o|0)}while(!1);return b=R,t|0}function Sm(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;R=b,b=b+32|0,w=R+20|0,C=R+16|0,E=R+8|0,o=R,m=0,Ae(65,E|0,t|0),D=m,m=0;e:do if(D&1)o=j(0)|0,a=t,l=t,F=19;else{do if(S[E>>0]|0){if(D=f0(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)|0,e[o>>2]=D,m=0,D=Ne(37,o|0,43392)|0,d=m,m=0,d&1)F=j(0)|0,_0(o),o=F;else{_0(o),l=e[(e[t>>2]|0)+-12>>2]|0,d=e[t+(l+24)>>2]|0,a=t+l|0,l=t+(l+76)|0,o=e[l>>2]|0;do if((o|0)==-1){if(o=f0(a)|0,e[w>>2]=o,m=0,o=Ne(37,w|0,44220)|0,_=m,m=0,!(_&1)&&(m=0,h=Ne(e[(e[o>>2]|0)+28>>2]|0,o|0,32)|0,_=m,m=0,!(_&1))){_0(w),o=h<<24>>24,e[l>>2]=o,F=10;break}o=j(0)|0,_0(w)}else F=10;while(!1);if((F|0)==10){if(_=e[(e[D>>2]|0)+24>>2]|0,e[C>>2]=d,m=0,e[w>>2]=e[C>>2],o=se(_|0,D|0,w|0,a|0,o&255|0,r|0)|0,_=m,m=0,!(_&1)&&(o||(_=e[(e[t>>2]|0)+-12>>2]|0,m=0,Ae(66,t+_|0,e[t+(_+16)>>2]|5|0),_=m,m=0,!(_&1))))break;o=j(0)|0}}ki(E),a=t,l=t,F=19;break e}while(!1);ki(E)}while(!1);do if((F|0)==19){if(K0(o|0)|0,m=0,ue(181,a+(e[(e[l>>2]|0)+-12>>2]|0)|0),_=m,m=0,!(_&1)){ei();break}o=j()|0,m=0,bt(3),_=m,m=0,_&1?(_=j(0)|0,$t(_)):le(o|0)}while(!1);return b=R,t|0}function Am(t){t=t|0,G0(t+4|0)}function vm(t){t=t|0,G0(t+((e[(e[t>>2]|0)+-12>>2]|0)+4)|0)}function Zs(t){t=t|0,G0(t+4|0),he(t)}function xm(t){t=t|0,Zs(t+(e[(e[t>>2]|0)+-12>>2]|0)|0)}function wm(t,r){t=t|0,r=r|0;var o=0;S[t>>0]=0,e[t+4>>2]=r,o=e[(e[r>>2]|0)+-12>>2]|0,e[r+(o+16)>>2]|0||(o=e[r+(o+72)>>2]|0,o&&js(o)|0,S[t>>0]=1)}function Js(t){t=t|0;var r=0,o=0;t=t+4|0,o=e[t>>2]|0,r=e[(e[o>>2]|0)+-12>>2]|0;do if(e[o+(r+24)>>2]|0&&!(e[o+(r+16)>>2]|0)&&e[o+(r+4)>>2]&8192|0&&!(Or()|0)){if(r=e[t>>2]|0,r=e[r+((e[(e[r>>2]|0)+-12>>2]|0)+24)>>2]|0,m=0,r=ge(e[(e[r>>2]|0)+24>>2]|0,r|0)|0,o=m,m=0,!(o&1)&&((r|0)!=-1||(r=e[t>>2]|0,o=e[(e[r>>2]|0)+-12>>2]|0,m=0,Ae(66,r+o|0,e[r+(o+16)>>2]|1|0),o=m,m=0,!(o&1))))break;o=j(0)|0,K0(o|0)|0,m=0,bt(3),o=m,m=0,o&1&&(o=j(0)|0,$t(o))}while(!1)}function ym(t){return t=t|0,57453}function Cm(t,r,o){t=t|0,r=r|0,o=o|0,(o|0)!=1&(o|0)<257?up(t,r,o):yi(t,57462,35)}function Tm(){return!(S[1048]|0)&&kt(1048)|0&&(e[10778]=43084,Nt(72,43112,Q|0)|0,Dt(1048)),43112}function Im(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;a=b,b=b+16|0,l=a+8|0,h=a,w=o,d=e[w+4>>2]|0,o=h,e[o>>2]=e[w>>2],e[o+4>>2]=d,e[l>>2]=e[h>>2],e[l+4>>2]=e[h+4>>2],fp(t,l,r),e[t>>2]=43048,b=a}function km(t){t=t|0,fr(t)}function Em(t){t=t|0,fr(t),he(t)}function Dm(t){t=t|0,G0(t),he(t)}function bm(t){t=t|0,he(t)}function Fm(t){t=t|0}function Nm(t){t=t|0}function Rm(t){t=t|0,he(t)}function Mm(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;e:do if((a|0)==(l|0))d=6;else for(;;){if((r|0)==(o|0)){r=-1;break e}if(t=S[r>>0]|0,h=S[a>>0]|0,t<<24>>24>24){r=-1;break e}if(h<<24>>24>24){r=1;break e}if(r=r+1|0,a=a+1|0,(a|0)==(l|0)){d=6;break}}while(!1);return(d|0)==6&&(r=(r|0)!=(o|0)&1),r|0}function _m(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,Dp(t,o,a)}function Pm(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if((r|0)==(o|0))t=0;else{t=0;do t=(S[r>>0]|0)+(t<<4)|0,a=t&-268435456,t=(a>>>24|a)^t,r=r+1|0;while((r|0)!=(o|0))}return t|0}function Lm(t){t=t|0}function Om(t){t=t|0,he(t)}function $m(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;e:do if((a|0)==(l|0))d=6;else for(;;){if((r|0)==(o|0)){r=-1;break e}if(t=e[r>>2]|0,h=e[a>>2]|0,(t|0)<(h|0)){r=-1;break e}if((h|0)<(t|0)){r=1;break e}if(r=r+4|0,a=a+4|0,(a|0)==(l|0)){d=6;break}}while(!1);return(d|0)==6&&(r=(r|0)!=(o|0)&1),r|0}function Bm(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,bp(t,o,a)}function Vm(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if((r|0)==(o|0))t=0;else{t=0;do t=(e[r>>2]|0)+(t<<4)|0,a=t&-268435456,t=(a>>>24|a)^t,r=r+4|0;while((r|0)!=(o|0))}return t|0}function Um(t){t=t|0}function zm(t){t=t|0,he(t)}function Gm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;z=b,b=b+64|0,R=z+56|0,d=z+52|0,E=z+48|0,w=z+44|0,C=z+40|0,D=z+36|0,F=z+32|0,H=z+8|0,_=z;e:do if(e[a+4>>2]&1){d=f0(a)|0,e[D>>2]=d,m=0,t=Ne(37,D|0,44220)|0,E=m,m=0;do if(E&1)H=j()|0,Bt(d)|0,d=H;else{if(Bt(d)|0,d=f0(a)|0,e[F>>2]=d,m=0,C=Ne(37,F|0,44360)|0,F=m,m=0,F&1){H=j()|0,Bt(d)|0,d=H;break}if(Bt(d)|0,m=0,Ae(e[(e[C>>2]|0)+24>>2]|0,H|0,C|0),F=m,m=0,F&1)w=H;else if(w=H+12|0,m=0,Ae(e[(e[C>>2]|0)+28>>2]|0,w|0,C|0),F=m,m=0,!(F&1))if(e[_>>2]=e[o>>2],m=0,e[R>>2]=e[_>>2],d=vt(7,r|0,R|0,H|0,H+24|0,t|0,l|0,1)|0,l=m,m=0,l&1){d=j()|0,de(H+12|0),de(H);break}else{S[h>>0]=(d|0)==(H|0)&1,d=e[r>>2]|0,de(H+12|0),de(H);break e}if(d=j()|0,C=ye,(H|0)!=(w|0))do w=w+-12|0,de(w);while((w|0)!=(H|0))}while(!1);le(d|0)}else switch(e[E>>2]=-1,H=e[(e[t>>2]|0)+16>>2]|0,e[w>>2]=e[r>>2],e[C>>2]=e[o>>2],e[d>>2]=e[w>>2],e[R>>2]=e[C>>2],d=on[H&63](t,d,R,a,l,E)|0,e[r>>2]=d,e[E>>2]|0){case 0:{S[h>>0]=0;break e}case 1:{S[h>>0]=1;break e}default:{S[h>>0]=1,e[l>>2]=4;break e}}while(!1);return b=z,d|0}function qm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=M4(t,C,w,a,l,h)|0,b=d,t|0}function Wm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=_4(t,C,w,a,l,h)|0,b=d,t|0}function Hm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=P4(t,C,w,a,l,h)|0,b=d,t|0}function Qm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=L4(t,C,w,a,l,h)|0,b=d,t|0}function Km(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=O4(t,C,w,a,l,h)|0,b=d,t|0}function Ym(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=$4(t,C,w,a,l,h)|0,b=d,t|0}function jm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=B4(t,C,w,a,l,h)|0,b=d,t|0}function Xm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=V4(t,C,w,a,l,h)|0,b=d,t|0}function Zm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=U4(t,C,w,a,l,h)|0,b=d,t|0}function Jm(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0;ae=b,b=b+240|0,$=ae,_=ae+208|0,ce=ae+32|0,t=ae+28|0,re=ae+16|0,G=ae+12|0,H=ae+48|0,K=ae+8|0,z=ae+4|0,e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,m=0,a=ge(68,a|0)|0,R=m,m=0;do if(R&1)t=j()|0;else{if(e[t>>2]=a,m=0,t=Ne(37,t|0,44220)|0,R=m,m=0,!(R&1)&&(m=0,Pe(e[(e[t>>2]|0)+32>>2]|0,t|0,57498,57524,_|0)|0,R=m,m=0,!(R&1))){Bt(a)|0,e[re>>2]=0,e[re+4>>2]=0,e[re+8>>2]=0,S[re>>0]&1?t=(e[re>>2]&-2)+-1|0:t=10,m=0,ve(8,re|0,t|0,0),R=m,m=0;e:do if(R&1)Ee=30;else{F=re+8|0,R=re+1|0,a=S[re>>0]&1?e[F>>2]|0:R,e[G>>2]=a,e[K>>2]=H,e[z>>2]=0,E=re+4|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){Ee=29;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){Ee=29;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,Ee=19;break}}else Ee=19;while(!1);if((Ee|0)==19)if(Ee=0,w){d=0;break}else d=0;if(w=S[re>>0]|0,w=w&1?e[E>>2]|0:(w&255)>>>1,(e[G>>2]|0)==(a+w|0)){if(m=0,ve(8,re|0,w<<1|0,0),D=m,m=0,D&1){Ee=29;break}if(S[re>>0]&1?a=(e[re>>2]&-2)+-1|0:a=10,m=0,ve(8,re|0,a|0,0),D=m,m=0,D&1){Ee=29;break}a=S[re>>0]&1?e[F>>2]|0:R,e[G>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ke=m,m=0,ke&1){Ee=29;break}}else w=N[w>>0]|0;if(_i(w&255,16,a,G,z,0,ce,H,K,_)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ke=m,m=0,ke&1){Ee=29;break}else continue;else{e[C>>2]=d+1;continue}}if((Ee|0)==29){t=j()|0;break}if(m=0,ve(8,re|0,(e[G>>2]|0)-a|0,0),ke=m,m=0,!(ke&1)&&(P=S[re>>0]|0,L=e[F>>2]|0,m=0,J=Ce(3)|0,ke=m,m=0,!(ke&1))&&(m=0,e[$>>2]=h,ne=Pe(16,(P&1?L:R)|0,J|0,58882,$|0)|0,ke=m,m=0,!(ke&1))){if((ne|0)!=1&&(e[l>>2]=4),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ke=m,m=0,ke&1){Ee=30;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ke=m,m=0,ke&1){Ee=30;break e}if((t|0)==-1){e[o>>2]=0,Ee=55;break}}a||(Ee=56)}else Ee=55;while(!1);return(Ee|0)==55&&a&&(Ee=56),(Ee|0)==56&&(e[l>>2]=e[l>>2]|2),ke=e[r>>2]|0,de(re),de(ce),b=ae,ke|0}else Ee=30}while(!1);(Ee|0)==30&&(t=j()|0),de(re);break}t=j()|0,Bt(a)|0}while(!1);return de(ce),le(t|0),0}function _i(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0;R=e[a>>2]|0,_=(R|0)==(o|0);do if(_){if(E=(S[D+24>>0]|0)==t<<24>>24,!E&&(S[D+25>>0]|0)!=t<<24>>24){F=5;break}e[a>>2]=o+1,S[o>>0]=E?43:45,e[l>>2]=0,E=0}else F=5;while(!1);e:do if((F|0)==5){if(F=S[d>>0]|0,t<<24>>24==h<<24>>24&&(F&1?e[d+4>>2]|0:(F&255)>>>1)|0){if(E=e[C>>2]|0,(E-w|0)>=160){E=0;break}r=e[l>>2]|0,e[C>>2]=E+4,e[E>>2]=r,e[l>>2]=0,E=0;break}for(d=D+26|0,E=D;(S[E>>0]|0)!=t<<24>>24;)if(E=E+1|0,(E|0)==(d|0)){E=d;break}if(E=E-D|0,(E|0)>23)E=-1;else{switch(r|0){case 10:case 8:{if((E|0)>=(r|0)){E=-1;break e}break}case 16:{if((E|0)>=22){if(_){E=-1;break e}if((R-o|0)>=3){E=-1;break e}if((S[R+-1>>0]|0)!=48){E=-1;break e}e[l>>2]=0,E=S[57498+E>>0]|0,e[a>>2]=R+1,S[R>>0]=E,E=0;break e}break}default:}E=S[57498+E>>0]|0,e[a>>2]=R+1,S[R>>0]=E,e[l>>2]=(e[l>>2]|0)+1,E=0}}while(!1);return E|0}function b0(){var t=0,r=0;do if(!(S[1968]|0)&&kt(1968)|0)if(m=0,t=Ve(31,2147483647,58885,0)|0,r=m,m=0,r&1)r=j()|0,W0(1968),le(r|0);else{e[11196]=t,Dt(1968);break}while(!1);return e[11196]|0}function eg(t){t=t|0}function tg(t){t=t|0,he(t)}function ig(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;z=b,b=b+64|0,R=z+56|0,d=z+52|0,E=z+48|0,w=z+44|0,C=z+40|0,D=z+36|0,F=z+32|0,H=z+8|0,_=z;e:do if(e[a+4>>2]&1){d=f0(a)|0,e[D>>2]=d,m=0,t=Ne(37,D|0,44212)|0,E=m,m=0;do if(E&1)H=j()|0,Bt(d)|0,d=H;else{if(Bt(d)|0,d=f0(a)|0,e[F>>2]=d,m=0,C=Ne(37,F|0,44368)|0,F=m,m=0,F&1){H=j()|0,Bt(d)|0,d=H;break}if(Bt(d)|0,m=0,Ae(e[(e[C>>2]|0)+24>>2]|0,H|0,C|0),F=m,m=0,F&1)w=H;else if(w=H+12|0,m=0,Ae(e[(e[C>>2]|0)+28>>2]|0,w|0,C|0),F=m,m=0,!(F&1))if(e[_>>2]=e[o>>2],m=0,e[R>>2]=e[_>>2],d=vt(8,r|0,R|0,H|0,H+24|0,t|0,l|0,1)|0,l=m,m=0,l&1){d=j()|0,Pt(H+12|0),Pt(H);break}else{S[h>>0]=(d|0)==(H|0)&1,d=e[r>>2]|0,Pt(H+12|0),Pt(H);break e}if(d=j()|0,C=ye,(H|0)!=(w|0))do w=w+-12|0,Pt(w);while((w|0)!=(H|0))}while(!1);le(d|0)}else switch(e[E>>2]=-1,H=e[(e[t>>2]|0)+16>>2]|0,e[w>>2]=e[r>>2],e[C>>2]=e[o>>2],e[d>>2]=e[w>>2],e[R>>2]=e[C>>2],d=on[H&63](t,d,R,a,l,E)|0,e[r>>2]=d,e[E>>2]|0){case 0:{S[h>>0]=0;break e}case 1:{S[h>>0]=1;break e}default:{S[h>>0]=1,e[l>>2]=4;break e}}while(!1);return b=z,d|0}function ng(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=G4(t,C,w,a,l,h)|0,b=d,t|0}function rg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=q4(t,C,w,a,l,h)|0,b=d,t|0}function sg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=W4(t,C,w,a,l,h)|0,b=d,t|0}function og(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=H4(t,C,w,a,l,h)|0,b=d,t|0}function ag(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=Q4(t,C,w,a,l,h)|0,b=d,t|0}function lg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=K4(t,C,w,a,l,h)|0,b=d,t|0}function ug(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=Y4(t,C,w,a,l,h)|0,b=d,t|0}function cg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=j4(t,C,w,a,l,h)|0,b=d,t|0}function fg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0;return d=b,b=b+16|0,w=d+12|0,C=d+8|0,E=d+4|0,D=d,e[E>>2]=e[r>>2],e[D>>2]=e[o>>2],e[C>>2]=e[E>>2],e[w>>2]=e[D>>2],t=X4(t,C,w,a,l,h)|0,b=d,t|0}function hg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0;ae=b,b=b+320|0,$=ae,_=ae+208|0,ce=ae+32|0,t=ae+28|0,re=ae+16|0,G=ae+12|0,H=ae+48|0,K=ae+8|0,z=ae+4|0,e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,m=0,a=ge(68,a|0)|0,R=m,m=0;do if(R&1)t=j()|0;else{if(e[t>>2]=a,m=0,t=Ne(37,t|0,44212)|0,R=m,m=0,!(R&1)&&(m=0,Pe(e[(e[t>>2]|0)+48>>2]|0,t|0,57498,57524,_|0)|0,R=m,m=0,!(R&1))){Bt(a)|0,e[re>>2]=0,e[re+4>>2]=0,e[re+8>>2]=0,S[re>>0]&1?t=(e[re>>2]&-2)+-1|0:t=10,m=0,ve(8,re|0,t|0,0),R=m,m=0;e:do if(R&1)Ee=31;else{F=re+8|0,R=re+1|0,t=S[re>>0]&1?e[F>>2]|0:R,e[G>>2]=t,e[K>>2]=H,e[z>>2]=0,E=re+4|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){Ee=30;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){Ee=30;break t}}else d=e[d>>2]|0;if((d|0)!=-1)if(w){d=C;break}else{d=C;break t}else{e[o>>2]=0,Ee=20;break}}else Ee=20;while(!1);if((Ee|0)==20)if(Ee=0,w){d=0;break}else d=0;if(w=S[re>>0]|0,w=w&1?e[E>>2]|0:(w&255)>>>1,(e[G>>2]|0)==(t+w|0)){if(m=0,ve(8,re|0,w<<1|0,0),D=m,m=0,D&1){Ee=30;break}if(S[re>>0]&1?t=(e[re>>2]&-2)+-1|0:t=10,m=0,ve(8,re|0,t|0,0),D=m,m=0,D&1){Ee=30;break}t=S[re>>0]&1?e[F>>2]|0:R,e[G>>2]=t+w}if(C=a+12|0,w=e[C>>2]|0,D=a+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ke=m,m=0,ke&1){Ee=30;break}}else w=e[w>>2]|0;if(Pi(w,16,t,G,z,0,ce,H,K,_)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ke=m,m=0,ke&1){Ee=30;break}else{d=a;continue}else{e[C>>2]=d+4,d=a;continue}}if((Ee|0)==30){t=j()|0;break}if(m=0,ve(8,re|0,(e[G>>2]|0)-t|0,0),ke=m,m=0,!(ke&1)&&(P=S[re>>0]|0,L=e[F>>2]|0,m=0,J=Ce(3)|0,ke=m,m=0,!(ke&1))&&(m=0,e[$>>2]=h,ne=Pe(16,(P&1?L:R)|0,J|0,58882,$|0)|0,ke=m,m=0,!(ke&1))){if((ne|0)!=1&&(e[l>>2]=4),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ke=m,m=0,ke&1){Ee=31;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ke=m,m=0,ke&1){Ee=31;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;Ee=59;break}else{e[o>>2]=0,Ee=57;break}}else Ee=57;while(!1);return(Ee|0)==57&&a&&(Ee=59),(Ee|0)==59&&(e[l>>2]=e[l>>2]|2),ke=e[r>>2]|0,de(re),de(ce),b=ae,ke|0}else Ee=31}while(!1);(Ee|0)==31&&(t=j()|0),de(re);break}t=j()|0,Bt(a)|0}while(!1);return de(ce),le(t|0),0}function Pi(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0;var E=0,F=0,R=0,_=0;R=e[a>>2]|0,_=(R|0)==(o|0);do if(_){if(E=(e[D+96>>2]|0)==(t|0),!E&&(e[D+100>>2]|0)!=(t|0)){F=5;break}e[a>>2]=o+1,S[o>>0]=E?43:45,e[l>>2]=0,E=0}else F=5;while(!1);e:do if((F|0)==5){if(F=S[d>>0]|0,(t|0)==(h|0)&&(F&1?e[d+4>>2]|0:(F&255)>>>1)|0){if(E=e[C>>2]|0,(E-w|0)>=160){E=0;break}r=e[l>>2]|0,e[C>>2]=E+4,e[E>>2]=r,e[l>>2]=0,E=0;break}for(d=D+104|0,E=D;(e[E>>2]|0)!=(t|0);)if(E=E+4|0,(E|0)==(d|0)){E=d;break}if(E=E-D|0,d=E>>2,(E|0)>92)E=-1;else{switch(r|0){case 10:case 8:{if((d|0)>=(r|0)){E=-1;break e}break}case 16:{if((E|0)>=88){if(_){E=-1;break e}if((R-o|0)>=3){E=-1;break e}if((S[R+-1>>0]|0)!=48){E=-1;break e}e[l>>2]=0,E=S[57498+d>>0]|0,e[a>>2]=R+1,S[R>>0]=E,E=0;break e}break}default:}E=S[57498+d>>0]|0,e[a>>2]=R+1,S[R>>0]=E,e[l>>2]=(e[l>>2]|0)+1,E=0}}while(!1);return E|0}function qi(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;if(C=b,b=b+16|0,w=C,r=f0(r)|0,e[w>>2]=r,m=0,l=Ne(37,w|0,44220)|0,D=m,m=0,!(D&1)&&(m=0,Pe(e[(e[l>>2]|0)+32>>2]|0,l|0,57498,57524,o|0)|0,D=m,m=0,!(D&1))&&(m=0,d=Ne(37,w|0,44360)|0,D=m,m=0,!(D&1))&&(m=0,h=ge(e[(e[d>>2]|0)+16>>2]|0,d|0)|0,D=m,m=0,!(D&1))&&(S[a>>0]=h,m=0,Ae(e[(e[d>>2]|0)+20>>2]|0,t|0,d|0),D=m,m=0,!(D&1))){Bt(r)|0,b=C;return}D=j()|0,Bt(r)|0,le(D|0)}function Ar(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(E=b,b=b+16|0,D=E,r=f0(r)|0,e[D>>2]=r,m=0,h=Ne(37,D|0,44220)|0,F=m,m=0,!(F&1)&&(m=0,Pe(e[(e[h>>2]|0)+32>>2]|0,h|0,57498,57530,o|0)|0,F=m,m=0,!(F&1))&&(m=0,C=Ne(37,D|0,44360)|0,F=m,m=0,!(F&1))&&(m=0,d=ge(e[(e[C>>2]|0)+12>>2]|0,C|0)|0,F=m,m=0,!(F&1))&&(S[a>>0]=d,m=0,w=ge(e[(e[C>>2]|0)+16>>2]|0,C|0)|0,F=m,m=0,!(F&1))&&(S[l>>0]=w,m=0,Ae(e[(e[C>>2]|0)+20>>2]|0,t|0,C|0),F=m,m=0,!(F&1))){Bt(r)|0,b=E;return}F=j()|0,Bt(r)|0,le(F|0)}function vr(t,r,o,a,l,h,d,w,C,D,E,F){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0;var R=0,_=0;e:do if(t<<24>>24==h<<24>>24)S[r>>0]|0?(S[r>>0]=0,o=e[l>>2]|0,e[l>>2]=o+1,S[o>>0]=46,o=S[w>>0]|0,(o&1?e[w+4>>2]|0:(o&255)>>>1)|0&&(R=e[D>>2]|0,(R-C|0)<160)&&(C=e[E>>2]|0,e[D>>2]=R+4,e[R>>2]=C),R=0):R=-1;else{if(t<<24>>24==d<<24>>24&&(d=S[w>>0]|0,((d&1?e[w+4>>2]|0:(d&255)>>>1)|0)!=0)){if(!(S[r>>0]|0)){R=-1;break}if(R=e[D>>2]|0,(R-C|0)>=160){R=0;break}C=e[E>>2]|0,e[D>>2]=R+4,e[R>>2]=C,e[E>>2]=0,R=0;break}for(h=F+32|0,R=F;(S[R>>0]|0)!=t<<24>>24;)if(R=R+1|0,(R|0)==(h|0)){R=h;break}if(h=R-F|0,(h|0)>31)R=-1;else switch(d=S[57498+h>>0]|0,h|0){case 24:case 25:{if(R=e[l>>2]|0,(R|0)!=(a|0)&&(N[R+-1>>0]&95|0)!=(N[o>>0]&127|0)){R=-1;break e}e[l>>2]=R+1,S[R>>0]=d,R=0;break e}case 23:case 22:{S[o>>0]=80,R=e[l>>2]|0,e[l>>2]=R+1,S[R>>0]=d,R=0;break e}default:{if(R=d&95,(R|0)==(S[o>>0]|0)&&(S[o>>0]=R|128,(S[r>>0]|0)!=0)&&(S[r>>0]=0,o=S[w>>0]|0,((o&1?e[w+4>>2]|0:(o&255)>>>1)|0)!=0)&&(_=e[D>>2]|0,(_-C|0)<160)&&(C=e[E>>2]|0,e[D>>2]=_+4,e[_>>2]=C),D=e[l>>2]|0,e[l>>2]=D+1,S[D>>0]=d,(h|0)>21){R=0;break e}e[E>>2]=(e[E>>2]|0)+1,R=0;break e}}}while(!1);return R|0}function Wi(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;if(C=b,b=b+16|0,w=C,r=f0(r)|0,e[w>>2]=r,m=0,l=Ne(37,w|0,44212)|0,D=m,m=0,!(D&1)&&(m=0,Pe(e[(e[l>>2]|0)+48>>2]|0,l|0,57498,57524,o|0)|0,D=m,m=0,!(D&1))&&(m=0,d=Ne(37,w|0,44368)|0,D=m,m=0,!(D&1))&&(m=0,h=ge(e[(e[d>>2]|0)+16>>2]|0,d|0)|0,D=m,m=0,!(D&1))&&(e[a>>2]=h,m=0,Ae(e[(e[d>>2]|0)+20>>2]|0,t|0,d|0),D=m,m=0,!(D&1))){Bt(r)|0,b=C;return}D=j()|0,Bt(r)|0,le(D|0)}function xr(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;if(E=b,b=b+16|0,D=E,r=f0(r)|0,e[D>>2]=r,m=0,h=Ne(37,D|0,44212)|0,F=m,m=0,!(F&1)&&(m=0,Pe(e[(e[h>>2]|0)+48>>2]|0,h|0,57498,57530,o|0)|0,F=m,m=0,!(F&1))&&(m=0,C=Ne(37,D|0,44368)|0,F=m,m=0,!(F&1))&&(m=0,d=ge(e[(e[C>>2]|0)+12>>2]|0,C|0)|0,F=m,m=0,!(F&1))&&(e[a>>2]=d,m=0,w=ge(e[(e[C>>2]|0)+16>>2]|0,C|0)|0,F=m,m=0,!(F&1))&&(e[l>>2]=w,m=0,Ae(e[(e[C>>2]|0)+20>>2]|0,t|0,C|0),F=m,m=0,!(F&1))){Bt(r)|0,b=E;return}F=j()|0,Bt(r)|0,le(F|0)}function wr(t,r,o,a,l,h,d,w,C,D,E,F){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0;var R=0,_=0;e:do if((t|0)==(h|0))S[r>>0]|0?(S[r>>0]=0,o=e[l>>2]|0,e[l>>2]=o+1,S[o>>0]=46,o=S[w>>0]|0,(o&1?e[w+4>>2]|0:(o&255)>>>1)|0&&(R=e[D>>2]|0,(R-C|0)<160)&&(C=e[E>>2]|0,e[D>>2]=R+4,e[R>>2]=C),R=0):R=-1;else{if((t|0)==(d|0)&&(d=S[w>>0]|0,((d&1?e[w+4>>2]|0:(d&255)>>>1)|0)!=0)){if(!(S[r>>0]|0)){R=-1;break}if(R=e[D>>2]|0,(R-C|0)>=160){R=0;break}C=e[E>>2]|0,e[D>>2]=R+4,e[R>>2]=C,e[E>>2]=0,R=0;break}for(h=F+128|0,R=F;(e[R>>2]|0)!=(t|0);)if(R=R+4|0,(R|0)==(h|0)){R=h;break}if(h=R-F|0,R=h>>2,(h|0)<=124){switch(d=S[57498+R>>0]|0,R|0){case 24:case 25:{if(R=e[l>>2]|0,(R|0)!=(a|0)&&(N[R+-1>>0]&95|0)!=(N[o>>0]&127|0)){R=-1;break e}e[l>>2]=R+1,S[R>>0]=d,R=0;break e}case 23:case 22:{S[o>>0]=80;break}default:R=d&95,(R|0)==(S[o>>0]|0)&&(S[o>>0]=R|128,(S[r>>0]|0)!=0)&&(S[r>>0]=0,o=S[w>>0]|0,((o&1?e[w+4>>2]|0:(o&255)>>>1)|0)!=0)&&(_=e[D>>2]|0,(_-C|0)<160)&&(C=e[E>>2]|0,e[D>>2]=_+4,e[_>>2]=C)}D=e[l>>2]|0,e[l>>2]=D+1,S[D>>0]=d,(h|0)>84||(e[E>>2]=(e[E>>2]|0)+1),R=0}else R=-1}while(!1);return R|0}function dg(t){t=t|0}function pg(t){t=t|0,he(t)}function mg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0;E=b,b=b+32|0,h=E+20|0,d=E+16|0,w=E+12|0,D=E;e:do if(!(e[o+4>>2]&1))D=e[(e[t>>2]|0)+24>>2]|0,e[d>>2]=e[r>>2],e[h>>2]=e[d>>2],h=an[D&31](t,h,o,a,l&1)|0;else{h=f0(o)|0,e[w>>2]=h,m=0,d=Ne(37,w|0,44360)|0,C=m,m=0;t:do if(C&1)E=j()|0,Bt(h)|0,h=E;else{Bt(h)|0,h=e[d>>2]|0,l?t0[e[h+24>>2]&127](D,d):t0[e[h+28>>2]&127](D,d),t=S[D>>0]|0,C=(t&1)==0,h=D+1|0,l=D+8|0,w=C?h:D+1|0,h=C?h:e[D+8>>2]|0,C=D+4|0,o=(t&1)==0;i:do if((h|0)!=((o?w:e[l>>2]|0)+(o?(t&255)>>>1:e[C>>2]|0)|0)){n:for(;;){d=S[h>>0]|0,a=e[r>>2]|0;do if(a){if(o=a+24|0,t=e[o>>2]|0,(t|0)!=(e[a+28>>2]|0)){e[o>>2]=t+1,S[t>>0]=d;break}if(m=0,d=Ne(e[(e[a>>2]|0)+52>>2]|0,a|0,d&255|0)|0,t=m,m=0,t&1)break n;(d|0)==-1&&(e[r>>2]=0)}while(!1);if(h=h+1|0,t=S[D>>0]|0,o=(t&1)==0,(h|0)==((o?w:e[l>>2]|0)+(o?(t&255)>>>1:e[C>>2]|0)|0))break i}h=j()|0,de(D);break t}while(!1);h=e[r>>2]|0,de(D);break e}while(!1);le(h|0)}while(!1);return b=E,h|0}function gg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+64|0,h=E,R=E+56|0,_=E+44|0,w=E+20|0,D=E+16|0,C=E+12|0,F=E+8|0,d=E+4|0,S[R>>0]=S[58887]|0,S[R+1>>0]=S[58888]|0,S[R+2>>0]=S[58889]|0,S[R+3>>0]=S[58890]|0,S[R+4>>0]=S[58891]|0,S[R+5>>0]=S[58892]|0,Ei(R+1|0,58893,1,e[o+4>>2]|0),t=b0()|0,e[h>>2]=l,l=_+(q0(_,12,t,R,h)|0)|0,R=ri(_,l,o)|0,t=f0(o)|0,e[F>>2]=t,m=0,dt(1,_|0,R|0,l|0,w|0,D|0,C|0,F|0),l=m,m=0,l&1)_=j()|0,Bt(t)|0,le(_|0);else return Bt(t)|0,e[d>>2]=e[r>>2],R=e[D>>2]|0,_=e[C>>2]|0,e[h>>2]=e[d>>2],_=Ui(h,w,R,_,o,a)|0,b=E,_|0;return 0}function Ei(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(a&2048&&(S[t>>0]=43,t=t+1|0),a&512&&(S[t>>0]=35,t=t+1|0),l=S[r>>0]|0,l<<24>>24)for(h=r;;)if(h=h+1|0,r=t+1|0,S[t>>0]=l,l=S[h>>0]|0,l<<24>>24)t=r;else{t=r;break}e:do switch(a&74|0){case 64:{S[t>>0]=111;break}case 8:if(a&16384){S[t>>0]=88;break e}else{S[t>>0]=120;break e}default:if(o){S[t>>0]=100;break e}else{S[t>>0]=117;break e}}while(!1)}function ri(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;e:do switch(e[o+4>>2]&176|0){case 16:{switch(o=S[t>>0]|0,o<<24>>24){case 43:case 45:{t=t+1|0;break e}default:}if((r-t|0)>1&o<<24>>24==48){switch(S[t+1>>0]|0){case 88:case 120:break;default:{a=7;break e}}t=t+2|0}else a=7;break}case 32:{t=r;break}default:a=7}while(!1);return t|0}function Sg(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0;G=b,b=b+16|0,$=G,H=O0(d,44220)|0,D=O0(d,44360)|0,t0[e[(e[D>>2]|0)+20>>2]&127]($,D),_=S[$>>0]|0,z=$+4|0;e:do if(!((_&1?e[z>>2]|0:(_&255)>>>1)|0))m=0,Pe(e[(e[H>>2]|0)+32>>2]|0,H|0,t|0,o|0,a|0)|0,K=m,m=0,K&1?K=5:(d=a+(o-t)|0,e[h>>2]=d,K=29);else{switch(e[h>>2]=a,d=S[t>>0]|0,d<<24>>24){case 43:case 45:{if(m=0,d=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,d|0)|0,_=m,m=0,_&1){K=5;break e}C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=d,C=t+1|0;break}default:C=t}t:do if((o-C|0)>1&&(S[C>>0]|0)==48){switch(d=C+1|0,S[d>>0]|0){case 88:case 120:break;default:break t}if(m=0,w=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,48)|0,_=m,m=0,_&1){K=5;break e}if(_=e[h>>2]|0,e[h>>2]=_+1,S[_>>0]=w,m=0,d=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,S[d>>0]|0)|0,_=m,m=0,_&1){K=5;break e}_=e[h>>2]|0,e[h>>2]=_+1,S[_>>0]=d,C=C+2|0}while(!1);if((C|0)!=(o|0)&&(E=o+-1|0,C>>>0>>0)){w=C,d=E;do _=S[w>>0]|0,S[w>>0]=S[d>>0]|0,S[d>>0]=_,w=w+1|0,d=d+-1|0;while(w>>>0>>0)}if(m=0,E=ge(e[(e[D>>2]|0)+16>>2]|0,D|0)|0,_=m,m=0,_&1)K=5;else{F=$+8|0,R=$+1|0;t:do if(C>>>0>>0){for(d=0,w=0,_=C;D=S[(S[$>>0]&1?e[F>>2]|0:R)+w>>0]|0,D<<24>>24!=0&(d|0)==(D<<24>>24|0)?(d=e[h>>2]|0,e[h>>2]=d+1,S[d>>0]=E,d=S[$>>0]|0,D=0,w=(w>>>0<((d&1?e[z>>2]|0:(d&255)>>>1)+-1|0)>>>0&1)+w|0):D=d,m=0,d=Ne(e[(e[H>>2]|0)+28>>2]|0,H|0,S[_>>0]|0)|0,P=m,m=0,!(P&1);){if(P=e[h>>2]|0,e[h>>2]=P+1,S[P>>0]=d,_=_+1|0,_>>>0>=o>>>0)break t;d=D+1|0}d=j()|0;break e}while(!1);if(w=t,d=a+(C-w)|0,t=e[h>>2]|0,(d|0)==(t|0))t=w,K=29;else{if(t=t+-1|0,d>>>0>>0)do P=S[d>>0]|0,S[d>>0]=S[t>>0]|0,S[t>>0]=P,d=d+1|0,t=t+-1|0;while(d>>>0>>0);t=w,d=e[h>>2]|0,K=29}}}while(!1);if((K|0)==5)d=j()|0;else if((K|0)==29){e[l>>2]=(r|0)==(o|0)?d:a+(r-t)|0,de($),b=G;return}de($),le(d|0)}function Ag(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(F=b,b=b+96|0,d=F+8|0,t=F,_=F+74|0,C=F+32|0,E=F+28|0,D=F+24|0,R=F+20|0,w=F+16|0,z=t,e[z>>2]=37,e[z+4>>2]=0,Ei(t+1|0,58895,1,e[o+4>>2]|0),z=b0()|0,H=d,e[H>>2]=l,e[H+4>>2]=h,h=_+(q0(_,22,z,t,d)|0)|0,l=ri(_,h,o)|0,t=f0(o)|0,e[R>>2]=t,m=0,dt(1,_|0,l|0,h|0,C|0,E|0,D|0,R|0),h=m,m=0,h&1)H=j()|0,Bt(t)|0,le(H|0);else return Bt(t)|0,e[w>>2]=e[r>>2],z=e[E>>2]|0,H=e[D>>2]|0,e[d>>2]=e[w>>2],H=Ui(d,C,z,H,o,a)|0,b=F,H|0;return 0}function vg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+64|0,h=E,R=E+56|0,_=E+44|0,w=E+20|0,D=E+16|0,C=E+12|0,F=E+8|0,d=E+4|0,S[R>>0]=S[58887]|0,S[R+1>>0]=S[58888]|0,S[R+2>>0]=S[58889]|0,S[R+3>>0]=S[58890]|0,S[R+4>>0]=S[58891]|0,S[R+5>>0]=S[58892]|0,Ei(R+1|0,58893,0,e[o+4>>2]|0),t=b0()|0,e[h>>2]=l,l=_+(q0(_,12,t,R,h)|0)|0,R=ri(_,l,o)|0,t=f0(o)|0,e[F>>2]=t,m=0,dt(1,_|0,R|0,l|0,w|0,D|0,C|0,F|0),l=m,m=0,l&1)_=j()|0,Bt(t)|0,le(_|0);else return Bt(t)|0,e[d>>2]=e[r>>2],R=e[D>>2]|0,_=e[C>>2]|0,e[h>>2]=e[d>>2],_=Ui(h,w,R,_,o,a)|0,b=E,_|0;return 0}function xg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(F=b,b=b+112|0,d=F+8|0,t=F,_=F+75|0,C=F+32|0,E=F+28|0,D=F+24|0,R=F+20|0,w=F+16|0,z=t,e[z>>2]=37,e[z+4>>2]=0,Ei(t+1|0,58895,0,e[o+4>>2]|0),z=b0()|0,H=d,e[H>>2]=l,e[H+4>>2]=h,h=_+(q0(_,23,z,t,d)|0)|0,l=ri(_,h,o)|0,t=f0(o)|0,e[R>>2]=t,m=0,dt(1,_|0,l|0,h|0,C|0,E|0,D|0,R|0),h=m,m=0,h&1)H=j()|0,Bt(t)|0,le(H|0);else return Bt(t)|0,e[w>>2]=e[r>>2],z=e[E>>2]|0,H=e[D>>2]|0,e[d>>2]=e[w>>2],H=Ui(d,C,z,H,o,a)|0,b=F,H|0;return 0}function wg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=+l;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;J=b,b=b+176|0,K=J+84|0,R=J+48|0,F=J+32|0,C=J+24|0,h=J+8|0,E=J,z=J+88|0,H=J+80|0,w=J+118|0,L=J+76|0,P=J+72|0,G=J+68|0,$=J+64|0,D=E,e[D>>2]=37,e[D+4>>2]=0,D=gn(E+1|0,58898,e[o+4>>2]|0)|0,e[H>>2]=z,t=b0()|0,D?(e[h>>2]=e[o+8>>2],B[h+8>>3]=l,h=q0(z,30,t,E,h)|0):(B[C>>3]=l,h=q0(z,30,t,E,C)|0);e:do if((h|0)>29){m=0,t=Ce(3)|0,h=m,m=0,h=h&1,D?!h&&(m=0,e[F>>2]=e[o+8>>2],B[F+8>>3]=l,d=Pe(17,H|0,t|0,E|0,F|0)|0,_=m,m=0,!(_&1))&&(ne=12):!h&&(m=0,e[R>>2]=e[o+8>>2],B[R+8>>3]=l,_=Pe(17,H|0,t|0,E|0,R|0)|0,R=m,m=0,!(R&1))&&(d=_,ne=12);do if((ne|0)==12){if(t=e[H>>2]|0,t)h=t;else{if(m=0,bt(6),_=m,m=0,_&1)break;h=e[H>>2]|0}t=h,E=h,ne=16;break e}while(!1);t=j()|0}else t=e[H>>2]|0,E=0,d=h,ne=16;while(!1);if((ne|0)==16){C=t+d|0,D=ri(t,C,o)|0;do if((t|0)==(z|0))t=z,h=0,ne=22;else{if(d=E0(d<<1)|0,!d){if(m=0,bt(6),ne=m,m=0,ne&1){h=0,ne=20;break}t=e[H>>2]|0}h=d,w=d,ne=22}while(!1);do if((ne|0)==22)if(m=0,d=ge(68,o|0)|0,H=m,m=0,H&1)ne=20;else{if(e[G>>2]=d,m=0,dt(2,t|0,D|0,C|0,w|0,L|0,P|0,G|0),G=m,m=0,G&1){t=j()|0,Bt(d)|0;break}if(Bt(d)|0,e[$>>2]=e[r>>2],ne=e[L>>2]|0,t=e[P>>2]|0,m=0,e[K>>2]=e[$>>2],t=Vt(39,K|0,w|0,ne|0,t|0,o|0,a|0)|0,ne=m,m=0,ne&1)ne=20;else return e[r>>2]=t,h&&n0(h),E&&n0(E),b=J,t|0}while(!1);(ne|0)==20&&(t=j()|0),h&&n0(h),E&&n0(E)}return le(t|0),0}function gn(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;if(o&2048&&(S[t>>0]=43,t=t+1|0),o&1024&&(S[t>>0]=35,t=t+1|0),d=o&260,l=o>>>14,w=(d|0)==260,w?h=0:(S[t>>0]=46,S[t+1>>0]=42,t=t+2|0,h=1),o=S[r>>0]|0,o<<24>>24)for(a=t;r=r+1|0,t=a+1|0,S[a>>0]=o,o=S[r>>0]|0,o<<24>>24;)a=t;e:do switch(d|0){case 4:if(l&1){S[t>>0]=70;break e}else{S[t>>0]=102;break e}case 256:if(l&1){S[t>>0]=69;break e}else{S[t>>0]=101;break e}default:if(o=(l&1|0)!=0,w)if(o){S[t>>0]=65;break e}else{S[t>>0]=97;break e}else if(o){S[t>>0]=71;break e}else{S[t>>0]=103;break e}}while(!1);return h|0}function yg(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0;switch(J=b,b=b+16|0,ne=J,L=O0(d,44220)|0,$=O0(d,44360)|0,t0[e[(e[$>>2]|0)+20>>2]&127](ne,$),e[h>>2]=a,d=S[t>>0]|0,d<<24>>24){case 43:case 45:{m=0,d=Ne(e[(e[L>>2]|0)+28>>2]|0,L|0,d|0)|0,P=m,m=0,P&1?G=8:(E=e[h>>2]|0,e[h>>2]=E+1,S[E>>0]=d,E=t+1|0,G=10);break}default:E=t,G=10}e:do if((G|0)==10){P=o;t:do if((P-E|0)>1&&(S[E>>0]|0)==48){switch(C=E+1|0,S[C>>0]|0){case 88:case 120:break;default:{G=11;break t}}if(m=0,d=Ne(e[(e[L>>2]|0)+28>>2]|0,L|0,48)|0,K=m,m=0,K&1){G=8;break e}if(K=e[h>>2]|0,e[h>>2]=K+1,S[K>>0]=d,E=E+2|0,m=0,d=Ne(e[(e[L>>2]|0)+28>>2]|0,L|0,S[C>>0]|0)|0,K=m,m=0,K&1){G=8;break e}if(K=e[h>>2]|0,e[h>>2]=K+1,S[K>>0]=d,E>>>0>>0){for(d=E;C=S[d>>0]|0,m=0,D=Ce(3)|0,K=m,m=0,!(K&1||(m=0,C=Ne(39,C<<24>>24|0,D|0)|0,K=m,m=0,K&1));){if(!C){K=E;break t}if(d=d+1|0,d>>>0>=o>>>0){K=E;break t}}d=j()|0;break e}else K=E,d=E}else G=11;while(!1);t:do if((G|0)==11)if(E>>>0>>0){for(d=E;C=S[d>>0]|0,m=0,D=Ce(3)|0,K=m,m=0,!(K&1||(m=0,C=Ne(40,C<<24>>24|0,D|0)|0,K=m,m=0,K&1));){if(!C){K=E;break t}if(d=d+1|0,d>>>0>=o>>>0){K=E;break t}}d=j()|0;break e}else K=E,d=E;while(!1);if(z=S[ne>>0]|0,H=ne+4|0,(z&1?e[H>>2]|0:(z&255)>>>1)|0){if((K|0)!=(d|0)&&(F=d+-1|0,K>>>0>>0)){D=K,C=F;do z=S[D>>0]|0,S[D>>0]=S[C>>0]|0,S[C>>0]=z,D=D+1|0,C=C+-1|0;while(D>>>0>>0)}if(m=0,F=ge(e[(e[$>>2]|0)+16>>2]|0,$|0)|0,z=m,m=0,z&1){G=8;break}R=ne+8|0,_=ne+1|0;t:do if(K>>>0>>0){for(C=0,D=0,z=K;E=S[(S[ne>>0]&1?e[R>>2]|0:_)+D>>0]|0,E<<24>>24>0&(C|0)==(E<<24>>24|0)?(C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=F,C=S[ne>>0]|0,E=0,D=(D>>>0<((C&1?e[H>>2]|0:(C&255)>>>1)+-1|0)>>>0&1)+D|0):E=C,m=0,C=Ne(e[(e[L>>2]|0)+28>>2]|0,L|0,S[z>>0]|0)|0,ae=m,m=0,!(ae&1);){if(ae=e[h>>2]|0,e[h>>2]=ae+1,S[ae>>0]=C,z=z+1|0,z>>>0>=d>>>0)break t;C=E+1|0}d=j()|0;break e}while(!1);if(C=a+(K-t)|0,D=e[h>>2]|0,(C|0)!=(D|0)&&(w=D+-1|0,C>>>0>>0)){do ae=S[C>>0]|0,S[C>>0]=S[w>>0]|0,S[w>>0]=ae,C=C+1|0,w=w+-1|0;while(C>>>0>>0);C=L}else C=L}else{if(m=0,Pe(e[(e[L>>2]|0)+32>>2]|0,L|0,K|0,d|0,e[h>>2]|0)|0,ae=m,m=0,ae&1){G=8;break}e[h>>2]=(e[h>>2]|0)+(d-K),C=L}t:do if(d>>>0>>0){for(;w=S[d>>0]|0,w<<24>>24!=46;){if(m=0,w=Ne(e[(e[C>>2]|0)+28>>2]|0,L|0,w|0)|0,ae=m,m=0,ae&1){G=4;break}if(ae=e[h>>2]|0,e[h>>2]=ae+1,S[ae>>0]=w,d=d+1|0,d>>>0>=o>>>0)break t}if((G|0)==4){d=j()|0;break e}if(m=0,w=ge(e[(e[$>>2]|0)+12>>2]|0,$|0)|0,ae=m,m=0,ae&1){G=8;break e}ae=e[h>>2]|0,e[h>>2]=ae+1,S[ae>>0]=w,d=d+1|0}while(!1);if(m=0,Pe(e[(e[L>>2]|0)+32>>2]|0,L|0,d|0,o|0,e[h>>2]|0)|0,ae=m,m=0,ae&1)G=8;else{ae=(e[h>>2]|0)+(P-d)|0,e[h>>2]=ae,e[l>>2]=(r|0)==(o|0)?ae:a+(r-t)|0,de(ne),b=J;return}}while(!1);(G|0)==8&&(d=j()|0),de(ne),le(d|0)}function Cg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=+l;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0;J=b,b=b+176|0,K=J+76|0,R=J+48|0,F=J+32|0,C=J+24|0,h=J+8|0,E=J,z=J+80|0,H=J+72|0,w=J+110|0,L=J+68|0,P=J+64|0,G=J+60|0,$=J+56|0,D=E,e[D>>2]=37,e[D+4>>2]=0,D=gn(E+1|0,58899,e[o+4>>2]|0)|0,e[H>>2]=z,t=b0()|0,D?(e[h>>2]=e[o+8>>2],B[h+8>>3]=l,h=q0(z,30,t,E,h)|0):(B[C>>3]=l,h=q0(z,30,t,E,C)|0);e:do if((h|0)>29){m=0,t=Ce(3)|0,h=m,m=0,h=h&1,D?!h&&(m=0,e[F>>2]=e[o+8>>2],B[F+8>>3]=l,d=Pe(17,H|0,t|0,E|0,F|0)|0,_=m,m=0,!(_&1))&&(ne=12):!h&&(m=0,B[R>>3]=l,_=Pe(17,H|0,t|0,E|0,R|0)|0,R=m,m=0,!(R&1))&&(d=_,ne=12);do if((ne|0)==12){if(t=e[H>>2]|0,t)h=t;else{if(m=0,bt(6),_=m,m=0,_&1)break;h=e[H>>2]|0}t=h,E=h,ne=16;break e}while(!1);t=j()|0}else t=e[H>>2]|0,E=0,d=h,ne=16;while(!1);if((ne|0)==16){C=t+d|0,D=ri(t,C,o)|0;do if((t|0)==(z|0))t=z,h=0,ne=22;else{if(d=E0(d<<1)|0,!d){if(m=0,bt(6),ne=m,m=0,ne&1){h=0,ne=20;break}t=e[H>>2]|0}h=d,w=d,ne=22}while(!1);do if((ne|0)==22)if(m=0,d=ge(68,o|0)|0,H=m,m=0,H&1)ne=20;else{if(e[G>>2]=d,m=0,dt(2,t|0,D|0,C|0,w|0,L|0,P|0,G|0),G=m,m=0,G&1){t=j()|0,Bt(d)|0;break}if(Bt(d)|0,e[$>>2]=e[r>>2],ne=e[L>>2]|0,t=e[P>>2]|0,m=0,e[K>>2]=e[$>>2],t=Vt(39,K|0,w|0,ne|0,t|0,o|0,a|0)|0,ne=m,m=0,ne&1)ne=20;else return e[r>>2]=t,h&&n0(h),E&&n0(E),b=J,t|0}while(!1);(ne|0)==20&&(t=j()|0),h&&n0(h),E&&n0(E)}return le(t|0),0}function Tg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(R=b,b=b+80|0,C=R,t=R+70|0,E=R+12|0,F=R+32|0,w=R+8|0,D=R+4|0,S[t>>0]=S[58901]|0,S[t+1>>0]=S[58902]|0,S[t+2>>0]=S[58903]|0,S[t+3>>0]=S[58904]|0,S[t+4>>0]=S[58905]|0,S[t+5>>0]=S[58906]|0,h=b0()|0,e[C>>2]=l,t=q0(E,20,h,t,C)|0,l=E+t|0,h=ri(E,l,o)|0,d=f0(o)|0,e[w>>2]=d,m=0,w=Ne(37,w|0,44220)|0,_=m,m=0,_&1)_=j()|0,Bt(d)|0,le(_|0);else return Bt(d)|0,_r[e[(e[w>>2]|0)+32>>2]&31](w,E,l,F)|0,_=F+t|0,e[D>>2]=e[r>>2],e[C>>2]=e[D>>2],_=Ui(C,F,(h|0)==(l|0)?_:F+(h-E)|0,_,o,a)|0,b=R,_|0;return 0}function Ig(t){t=t|0}function kg(t){t=t|0,he(t)}function Eg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0;D=b,b=b+32|0,h=D+20|0,d=D+16|0,w=D+12|0,C=D;e:do if(!(e[o+4>>2]&1))C=e[(e[t>>2]|0)+24>>2]|0,e[d>>2]=e[r>>2],e[h>>2]=e[d>>2],h=an[C&31](t,h,o,a,l&1)|0;else{h=f0(o)|0,e[w>>2]=h,m=0,d=Ne(37,w|0,44368)|0,w=m,m=0;t:do if(w&1)D=j()|0,Bt(h)|0,h=D;else{Bt(h)|0,h=e[d>>2]|0,l?t0[e[h+24>>2]&127](C,d):t0[e[h+28>>2]&127](C,d),t=S[C>>0]|0,o=(t&1)==0,h=C+4|0,l=C+8|0,w=o?h:C+4|0,h=o?h:e[C+8>>2]|0,o=(t&1)==0;i:do if((h|0)!=((o?w:e[l>>2]|0)+((o?(t&255)>>>1:e[w>>2]|0)<<2)|0)){for(;;){if(d=e[h>>2]|0,a=e[r>>2]|0,a){if(o=a+24|0,t=e[o>>2]|0,(t|0)==(e[a+28>>2]|0)){if(m=0,d=Ne(e[(e[a>>2]|0)+52>>2]|0,a|0,d|0)|0,t=m,m=0,t&1)break}else e[o>>2]=t+4,e[t>>2]=d;(d|0)==-1&&(e[r>>2]=0)}if(h=h+4|0,t=S[C>>0]|0,o=(t&1)==0,(h|0)==((o?w:e[l>>2]|0)+((o?(t&255)>>>1:e[w>>2]|0)<<2)|0))break i}h=j()|0,Pt(C);break t}while(!1);h=e[r>>2]|0,Pt(C);break e}while(!1);le(h|0)}while(!1);return b=D,h|0}function Dg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if(E=b,b=b+128|0,h=E,R=E+116|0,_=E+104|0,w=E+20|0,D=E+16|0,C=E+12|0,F=E+8|0,d=E+4|0,S[R>>0]=S[58887]|0,S[R+1>>0]=S[58888]|0,S[R+2>>0]=S[58889]|0,S[R+3>>0]=S[58890]|0,S[R+4>>0]=S[58891]|0,S[R+5>>0]=S[58892]|0,Ei(R+1|0,58893,1,e[o+4>>2]|0),t=b0()|0,e[h>>2]=l,l=_+(q0(_,12,t,R,h)|0)|0,R=ri(_,l,o)|0,t=f0(o)|0,e[F>>2]=t,m=0,dt(3,_|0,R|0,l|0,w|0,D|0,C|0,F|0),l=m,m=0,l&1)_=j()|0,Bt(t)|0,le(_|0);else return Bt(t)|0,e[d>>2]=e[r>>2],R=e[D>>2]|0,_=e[C>>2]|0,e[h>>2]=e[d>>2],_=Hi(h,w,R,_,o,a)|0,b=E,_|0;return 0}function bg(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0;G=b,b=b+16|0,$=G,H=O0(d,44212)|0,D=O0(d,44368)|0,t0[e[(e[D>>2]|0)+20>>2]&127]($,D),_=S[$>>0]|0,z=$+4|0;e:do if(!((_&1?e[z>>2]|0:(_&255)>>>1)|0))m=0,Pe(e[(e[H>>2]|0)+48>>2]|0,H|0,t|0,o|0,a|0)|0,K=m,m=0,K&1?K=5:(d=a+(o-t<<2)|0,e[h>>2]=d,K=28);else{switch(e[h>>2]=a,d=S[t>>0]|0,d<<24>>24){case 43:case 45:{if(m=0,d=Ne(e[(e[H>>2]|0)+44>>2]|0,H|0,d|0)|0,_=m,m=0,_&1){K=5;break e}C=e[h>>2]|0,e[h>>2]=C+4,e[C>>2]=d,C=t+1|0;break}default:C=t}t:do if((o-C|0)>1&&(S[C>>0]|0)==48){switch(d=C+1|0,S[d>>0]|0){case 88:case 120:break;default:{_=C;break t}}if(m=0,w=Ne(e[(e[H>>2]|0)+44>>2]|0,H|0,48)|0,_=m,m=0,_&1){K=5;break e}if(_=e[h>>2]|0,e[h>>2]=_+4,e[_>>2]=w,m=0,d=Ne(e[(e[H>>2]|0)+44>>2]|0,H|0,S[d>>0]|0)|0,_=m,m=0,_&1){K=5;break e}_=e[h>>2]|0,e[h>>2]=_+4,e[_>>2]=d,_=C+2|0}else _=C;while(!1);if((_|0)!=(o|0)&&(E=o+-1|0,_>>>0>>0)){w=_,d=E;do R=S[w>>0]|0,S[w>>0]=S[d>>0]|0,S[d>>0]=R,w=w+1|0,d=d+-1|0;while(w>>>0>>0)}if(m=0,D=ge(e[(e[D>>2]|0)+16>>2]|0,D|0)|0,R=m,m=0,R&1)K=5;else{E=$+8|0,F=$+1|0;t:do if(_>>>0>>0){for(d=0,w=0,R=_;C=S[(S[$>>0]&1?e[E>>2]|0:F)+w>>0]|0,C<<24>>24!=0&(d|0)==(C<<24>>24|0)?(d=e[h>>2]|0,e[h>>2]=d+4,e[d>>2]=D,d=S[$>>0]|0,C=0,w=(w>>>0<((d&1?e[z>>2]|0:(d&255)>>>1)+-1|0)>>>0&1)+w|0):C=d,m=0,d=Ne(e[(e[H>>2]|0)+44>>2]|0,H|0,S[R>>0]|0)|0,P=m,m=0,!(P&1);){if(P=e[h>>2]|0,e[h>>2]=P+4,e[P>>2]=d,R=R+1|0,R>>>0>=o>>>0)break t;d=C+1|0}d=j()|0;break e}while(!1);if(C=t,d=a+(_-C<<2)|0,w=e[h>>2]|0,(d|0)!=(w|0))if(t=w+-4|0,d>>>0>>0){do P=e[d>>2]|0,e[d>>2]=e[t>>2],e[t>>2]=P,d=d+4|0,t=t+-4|0;while(d>>>0>>0);t=C,d=w,K=28}else t=C,d=w,K=28;else t=C,K=28}}while(!1);if((K|0)==5)d=j()|0;else if((K|0)==28){e[l>>2]=(r|0)==(o|0)?d:a+(r-t<<2)|0,de($),b=G;return}de($),le(d|0)}function Fg(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(F=b,b=b+224|0,d=F+8|0,t=F,_=F+196|0,C=F+32|0,E=F+28|0,D=F+24|0,R=F+20|0,w=F+16|0,z=t,e[z>>2]=37,e[z+4>>2]=0,Ei(t+1|0,58895,1,e[o+4>>2]|0),z=b0()|0,H=d,e[H>>2]=l,e[H+4>>2]=h,h=_+(q0(_,22,z,t,d)|0)|0,l=ri(_,h,o)|0,t=f0(o)|0,e[R>>2]=t,m=0,dt(3,_|0,l|0,h|0,C|0,E|0,D|0,R|0),h=m,m=0,h&1)H=j()|0,Bt(t)|0,le(H|0);else return Bt(t)|0,e[w>>2]=e[r>>2],z=e[E>>2]|0,H=e[D>>2]|0,e[d>>2]=e[w>>2],H=Hi(d,C,z,H,o,a)|0,b=F,H|0;return 0}function Ng(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0;K=b,b=b+16|0,z=K,R=K+8|0;e:do if((o|0)==(a|0))C=a;else for(C=o;;){if(!(e[C>>2]|0))break e;if(C=C+4|0,(C|0)==(a|0)){C=a;break}}while(!1);e[w>>2]=h,e[l>>2]=o,E=d,_=t+8|0;e:do if((h|0)==(d|0)|(o|0)==(a|0))G=47;else{t=h,D=C;t:for(;;){if($=r,h=e[$+4>>2]|0,C=z,e[C>>2]=e[$>>2],e[C+4>>2]=h,C=ai(e[_>>2]|0)|0,m=0,h=se(21,t|0,l|0,D-o>>2|0,E-t|0,r|0)|0,$=m,m=0,$&1){G=9;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=8;break}switch(h|0){case 0:{F=1;break e}case-1:{C=t,G=14;break t}default:}if(C=(e[w>>2]|0)+h|0,e[w>>2]=C,(C|0)==(d|0)){G=27;break}if((D|0)==(a|0))o=e[l>>2]|0,t=C,C=a;else{if(C=ai(e[_>>2]|0)|0,m=0,o=Ve(34,R|0,0,r|0)|0,$=m,m=0,$&1){G=35;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=34;break}if((o|0)==-1){F=2;break e}if(o>>>0>(E-(e[w>>2]|0)|0)>>>0){F=1;break e}if(o)for(C=R;D=S[C>>0]|0,$=e[w>>2]|0,e[w>>2]=$+1,S[$>>0]=D,o=o+-1|0,o;)C=C+1|0;o=(e[l>>2]|0)+4|0,e[l>>2]=o;i:do if((o|0)==(a|0))C=a;else for(C=o;;){if(!(e[C>>2]|0))break i;if(C=C+4|0,(C|0)==(a|0)){C=a;break}}while(!1);t=e[w>>2]|0}if((t|0)==(d|0)|(o|0)==(a|0)){G=47;break e}else D=C}if((G|0)==8)$=j(0)|0,$t($);else if((G|0)==9)o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0);else if((G|0)==14){e[w>>2]=C;t:do if((o|0)!=(e[l>>2]|0)){for(;;){if($=e[o>>2]|0,t=ai(e[_>>2]|0)|0,m=0,C=Ve(34,C|0,$|0,z|0)|0,$=m,m=0,$&1){H=t;break}if(t|0&&(m=0,ge(75,t|0)|0,$=m,m=0,$&1)){G=18;break}if((C|0)==-1||(C=(e[w>>2]|0)+C|0,e[w>>2]=C,o=o+4|0,(o|0)==(e[l>>2]|0)))break t}(G|0)==18&&($=j(0)|0,$t($)),o=j()|0,H|0&&(m=0,ge(75,H|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0)}while(!1);e[l>>2]=o,F=2;break}else if((G|0)==27){o=e[l>>2]|0,G=47;break}else(G|0)==34?($=j(0)|0,$t($)):(G|0)==35&&(o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0))}while(!1);return(G|0)==47&&(F=(o|0)!=(a|0)&1),b=K,F|0}function Rg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0;K=b,b=b+16|0,H=K;e:do if((o|0)==(a|0))C=a;else for(C=o;;){if(!(S[C>>0]|0))break e;if(C=C+1|0,(C|0)==(a|0)){C=a;break}}while(!1);e[w>>2]=h,e[l>>2]=o,F=d,_=t+8|0;e:do if((h|0)==(d|0)|(o|0)==(a|0))G=47;else{t=h,E=C;t:for(;;){if(D=r,C=e[D+4>>2]|0,h=H,e[h>>2]=e[D>>2],e[h+4>>2]=C,h=E,C=ai(e[_>>2]|0)|0,m=0,D=se(22,t|0,l|0,h-o|0,F-t>>2|0,r|0)|0,$=m,m=0,$&1){G=9;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=8;break}switch(D|0){case 0:{R=2;break e}case-1:{C=t,G=14;break t}default:}if(t=(e[w>>2]|0)+(D<<2)|0,e[w>>2]=t,(t|0)==(d|0)){G=31;break}if(o=e[l>>2]|0,(E|0)==(a|0))C=a;else{if(C=ai(e[_>>2]|0)|0,m=0,o=Pe(20,t|0,o|0,1,r|0)|0,$=m,m=0,$&1){G=38;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=37;break}if(o){R=2;break e}e[w>>2]=(e[w>>2]|0)+4,o=(e[l>>2]|0)+1|0,e[l>>2]=o;i:do if((o|0)==(a|0))C=a;else for(C=o;;){if(!(S[C>>0]|0))break i;if(C=C+1|0,(C|0)==(a|0)){C=a;break}}while(!1);t=e[w>>2]|0}if((t|0)==(d|0)|(o|0)==(a|0)){G=47;break e}else E=C}if((G|0)==8)$=j(0)|0,$t($);else if((G|0)==9)o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0);else if((G|0)==14){e[w>>2]=C;t:do if((o|0)!=(e[l>>2]|0)){t=C;i:for(;;){if(C=ai(e[_>>2]|0)|0,m=0,t=Pe(20,t|0,o|0,h-o|0,H|0)|0,$=m,m=0,$&1){G=19;break}if(C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)){G=18;break}switch(t|0){case-1:{G=25;break i}case-2:{G=26;break i}case 0:{o=o+1|0;break}default:o=o+t|0}if(t=(e[w>>2]|0)+4|0,e[w>>2]=t,(o|0)==(e[l>>2]|0)){z=o;break t}}if((G|0)==18)$=j(0)|0,$t($);else if((G|0)==19)o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0);else if((G|0)==25){e[l>>2]=o,R=2;break e}else if((G|0)==26){e[l>>2]=o,R=1;break e}}else z=o;while(!1);e[l>>2]=z,R=(z|0)!=(a|0)&1;break}else if((G|0)==31){o=e[l>>2]|0,G=47;break}else(G|0)==37?($=j(0)|0,$t($)):(G|0)==38&&(o=j()|0,C|0&&(m=0,ge(75,C|0)|0,$=m,m=0,$&1)&&($=j(0)|0,$t($)),le(o|0))}while(!1);return(G|0)==47&&(R=(o|0)!=(a|0)&1),b=K,R|0}function Mg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;switch(d=b,b=b+16|0,h=d,e[l>>2]=o,o=ai(e[t+8>>2]|0)|0,m=0,t=Ve(34,h|0,0,r|0)|0,r=m,m=0,r&1&&(h=j()|0,o|0&&(m=0,ge(75,o|0)|0,d=m,m=0,d&1)&&(d=j(0)|0,$t(d)),le(h|0)),o|0&&(m=0,ge(75,o|0)|0,r=m,m=0,r&1)&&(r=j(0)|0,$t(r)),t|0){case 0:case-1:{h=2;break}default:if(t=t+-1|0,t>>>0<=(a-(e[l>>2]|0)|0)>>>0)if(!t)h=0;else for(;;)if(r=S[h>>0]|0,a=e[l>>2]|0,e[l>>2]=a+1,S[a>>0]=r,t=t+-1|0,t)h=h+1|0;else{h=0;break}else h=1}return b=d,h|0}function _g(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;r=t+8|0,m=0,o=ge(75,e[r>>2]|0)|0,a=m,m=0;do if(a&1)l=16;else{if(m=0,a=Ve(35,0,0,4)|0,t=m,m=0,t&1){if(t=j(0)|0,!o||(m=0,ge(75,o|0)|0,d=m,m=0,!(d&1)))break;d=j(0)|0,$t(d)}if(o|0&&(m=0,ge(75,o|0)|0,d=m,m=0,d&1)&&(d=j(0)|0,$t(d)),a)h=-1;else if(t=e[r>>2]|0,t){if(m=0,t=ge(75,t|0)|0,d=m,m=0,d&1){l=16;break}t|0&&(m=0,ge(75,t|0)|0,d=m,m=0,d&1)?(d=j(0)|0,$t(d)):h=0}else h=1;return h|0}while(!1);return(l|0)==16&&(t=j(0)|0),$t(t),0}function Pg(t){return t=t|0,0}function Lg(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;D=a,C=t+8|0;e:do if((o|0)==(a|0)|(l|0)==0)t=0;else{for(t=0,w=0;;){if(d=ai(e[C>>2]|0)|0,m=0,h=Ve(36,o|0,D-o|0,r|0)|0,R=m,m=0,R&1){F=d;break}if(d|0&&(m=0,ge(75,d|0)|0,R=m,m=0,R&1)){E=5;break}switch(h|0){case-2:case-1:break e;case 0:{o=o+1|0,h=1;break}default:o=o+h|0}if(t=h+t|0,w=w+1|0,(o|0)==(a|0)|w>>>0>=l>>>0)break e}(E|0)==5&&(R=j(0)|0,$t(R)),t=j()|0,F|0&&(m=0,ge(75,F|0)|0,R=m,m=0,R&1)&&(R=j(0)|0,$t(R)),le(t|0)}while(!1);return t|0}function Og(t){t=t|0;var r=0,o=0;return t=e[t+8>>2]|0,t?(m=0,t=ge(75,t|0)|0,o=m,m=0,o&1&&(o=j(0)|0,$t(o)),t|0&&(m=0,ge(75,t|0)|0,o=m,m=0,o&1)?(o=j(0)|0,$t(o)):r=4):r=1,r|0}function $g(t){t=t|0,he(t)}function Bg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0;return t=b,b=b+16|0,C=t+4|0,r=t,e[C>>2]=o,e[r>>2]=h,d=O3(o,a,C,h,d,r,1114111,0)|0,e[l>>2]=e[C>>2],e[w>>2]=e[r>>2],b=t,d|0}function Vg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0;return t=b,b=b+16|0,C=t+4|0,r=t,e[C>>2]=o,e[r>>2]=h,d=$3(o,a,C,h,d,r,1114111,0)|0,e[l>>2]=e[C>>2],e[w>>2]=e[r>>2],b=t,d|0}function Ug(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,e[l>>2]=o,3}function zg(t){return t=t|0,0}function Gg(t){return t=t|0,0}function qg(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,B3(o,a,l,1114111,0)|0}function Wg(t){return t=t|0,4}function Hg(t){t=t|0,he(t)}function Qg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0;return t=b,b=b+16|0,C=t+4|0,r=t,e[C>>2]=o,e[r>>2]=h,d=V3(o,a,C,h,d,r,1114111,0)|0,e[l>>2]=e[C>>2],e[w>>2]=e[r>>2],b=t,d|0}function Kg(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0;return t=b,b=b+16|0,C=t+4|0,r=t,e[C>>2]=o,e[r>>2]=h,d=U3(o,a,C,h,d,r,1114111,0)|0,e[l>>2]=e[C>>2],e[w>>2]=e[r>>2],b=t,d|0}function Yg(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,e[l>>2]=o,3}function jg(t){return t=t|0,0}function Xg(t){return t=t|0,0}function Zg(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,z3(o,a,l,1114111,0)|0}function Jg(t){return t=t|0,4}function e4(t){t=t|0,he(t)}function t4(t){t=t|0,he(t)}function i4(t,r){t=t|0,r=r|0,e[t+4>>2]=r+-1,e[t>>2]=44384,S[t+8>>0]=46,S[t+9>>0]=44,t=t+12|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function n4(t,r){t=t|0,r=r|0,e[t+4>>2]=r+-1,e[t>>2]=44424,e[t+8>>2]=46,e[t+12>>2]=44,t=t+16|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0}function eo(t){t=t|0,e[t>>2]=44384,de(t+12|0)}function r4(t){t=t|0,eo(t),he(t)}function to(t){t=t|0,e[t>>2]=44424,de(t+16|0)}function s4(t){t=t|0,to(t),he(t)}function o4(t){return t=t|0,S[t+8>>0]|0}function l4(t){return t=t|0,e[t+8>>2]|0}function u4(t){return t=t|0,S[t+9>>0]|0}function c4(t){return t=t|0,e[t+12>>2]|0}function f4(t,r){t=t|0,r=r|0,hr(t,r+12|0)}function h4(t,r){t=t|0,r=r|0,hr(t,r+16|0)}function d4(t,r){t=t|0,r=r|0,yi(t,59024,4)}function p4(t,r){t=t|0,r=r|0,mr(t,44996,_n(44996)|0)}function m4(t,r){t=t|0,r=r|0,yi(t,59029,5)}function g4(t,r){t=t|0,r=r|0,mr(t,45016,_n(45016)|0)}function li(t){switch(t=t|0,e[t+4>>2]&74|0){case 64:{t=8;break}case 8:{t=16;break}case 0:{t=0;break}default:t=10}return t|0}function S4(t){t=t|0;do if(!(S[2464]|0)&&kt(2464)|0){if(!(S[2472]|0)&&kt(2472)|0){t=45040;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=45208);Nt(193,0,Q|0)|0,Dt(2472)}if(m=0,Ne(41,45040,59035)|0,t=m,m=0,!(t&1)&&(m=0,Ne(41,45052,59042)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45064,59049)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45076,59057)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45088,59067)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45100,59076)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45112,59083)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45124,59092)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45136,59096)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45148,59100)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45160,59104)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45172,59108)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45184,59112)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45196,59116)|0,t=m,m=0,!(t&1))){e[11302]=45040,Dt(2464);break}t=j()|0,W0(2464),le(t|0)}while(!1);return e[11302]|0}function A4(t){t=t|0;do if(!(S[2480]|0)&&kt(2480)|0){if(!(S[2488]|0)&&kt(2488)|0){t=45212;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=45380);Nt(194,0,Q|0)|0,Dt(2488)}if(m=0,Ne(42,45212,45380)|0,t=m,m=0,!(t&1)&&(m=0,Ne(42,45224,45408)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45236,45436)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45248,45468)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45260,45508)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45272,45544)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45284,45572)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45296,45608)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45308,45624)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45320,45640)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45332,45656)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45344,45672)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45356,45688)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,45368,45704)|0,t=m,m=0,!(t&1))){e[11430]=45212,Dt(2480);break}t=j()|0,W0(2480),le(t|0)}while(!1);return e[11430]|0}function x4(t){t=t|0;e:do if(!(S[2496]|0)&&kt(2496)|0){if(!(S[2504]|0)&&kt(2504)|0){t=45724;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=46012);Nt(195,0,Q|0)|0,Dt(2504)}m=0,Ne(41,45724,59120)|0,t=m,m=0;do if(!(t&1)&&(m=0,Ne(41,45736,59128)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45748,59137)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45760,59143)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45772,59149)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45784,59153)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45796,59158)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45808,59163)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45820,59170)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45832,59180)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45844,59188)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45856,59197)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45868,59206)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45880,59210)|0,t=m,m=0,!(t&1))&&(m=0,Ne(41,45892,59214)|0,t=m,m=0,!(t&1))){if(m=0,Ne(41,45904,59218)|0,t=m,m=0,t&1||(m=0,Ne(41,45916,59149)|0,t=m,m=0,t&1)||(m=0,Ne(41,45928,59222)|0,t=m,m=0,t&1)||(m=0,Ne(41,45940,59226)|0,t=m,m=0,t&1)||(m=0,Ne(41,45952,59230)|0,t=m,m=0,t&1)||(m=0,Ne(41,45964,59234)|0,t=m,m=0,t&1)||(m=0,Ne(41,45976,59238)|0,t=m,m=0,t&1)||(m=0,Ne(41,45988,59242)|0,t=m,m=0,t&1)||(m=0,Ne(41,46e3,59246)|0,t=m,m=0,t&1))break;e[11503]=45724,Dt(2496);break e}while(!1);t=j()|0,W0(2496),le(t|0)}while(!1);return e[11503]|0}function w4(t){t=t|0;e:do if(!(S[2512]|0)&&kt(2512)|0){if(!(S[2520]|0)&&kt(2520)|0){t=46016;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=46304);Nt(196,0,Q|0)|0,Dt(2520)}m=0,Ne(42,46016,46304)|0,t=m,m=0;do if(!(t&1)&&(m=0,Ne(42,46028,46336)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46040,46372)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46052,46396)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46064,46420)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46076,46436)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46088,46456)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46100,46476)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46112,46504)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46124,46544)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46136,46576)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46148,46612)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46160,46648)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46172,46664)|0,t=m,m=0,!(t&1))&&(m=0,Ne(42,46184,46680)|0,t=m,m=0,!(t&1))){if(m=0,Ne(42,46196,46696)|0,t=m,m=0,t&1||(m=0,Ne(42,46208,46420)|0,t=m,m=0,t&1)||(m=0,Ne(42,46220,46712)|0,t=m,m=0,t&1)||(m=0,Ne(42,46232,46728)|0,t=m,m=0,t&1)||(m=0,Ne(42,46244,46744)|0,t=m,m=0,t&1)||(m=0,Ne(42,46256,46760)|0,t=m,m=0,t&1)||(m=0,Ne(42,46268,46776)|0,t=m,m=0,t&1)||(m=0,Ne(42,46280,46792)|0,t=m,m=0,t&1)||(m=0,Ne(42,46292,46808)|0,t=m,m=0,t&1))break;e[11706]=46016,Dt(2512);break e}while(!1);t=j()|0,W0(2512),le(t|0)}while(!1);return e[11706]|0}function y4(t){t=t|0;do if(!(S[2528]|0)&&kt(2528)|0){if(!(S[2536]|0)&&kt(2536)|0){t=46828;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=47116);Nt(197,0,Q|0)|0,Dt(2536)}if(m=0,Ne(41,46828,59250)|0,t=m,m=0,!(t&1)&&(m=0,Ne(41,46840,59253)|0,t=m,m=0,!(t&1))){e[11779]=46828,Dt(2528);break}t=j()|0,W0(2528),le(t|0)}while(!1);return e[11779]|0}function C4(t){t=t|0;do if(!(S[2544]|0)&&kt(2544)|0){if(!(S[2552]|0)&&kt(2552)|0){t=47120;do e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,t=t+12|0;while((t|0)!=47408);Nt(198,0,Q|0)|0,Dt(2552)}if(m=0,Ne(42,47120,47408)|0,t=m,m=0,!(t&1)&&(m=0,Ne(42,47132,47420)|0,t=m,m=0,!(t&1))){e[11858]=47120,Dt(2544);break}t=j()|0,W0(2544),le(t|0)}while(!1);return e[11858]|0}function T4(t){t=t|0;do if(!(S[2560]|0)&&kt(2560)|0)if(m=0,ve(5,47436,59256,8),t=m,m=0,t&1)t=j()|0,W0(2560),le(t|0);else{Nt(199,47436,Q|0)|0,Dt(2560);break}while(!1);return 47436}function I4(t){t=t|0;var r=0;do if(!(S[2568]|0)&&kt(2568)|0){if(m=0,t=ge(76,47448)|0,r=m,m=0,!(r&1)&&(m=0,ve(15,47484,47448,t|0),r=m,m=0,!(r&1))){Nt(200,47484,Q|0)|0,Dt(2568);break}r=j()|0,W0(2568),le(r|0)}while(!1);return 47484}function k4(t){t=t|0;do if(!(S[2576]|0)&&kt(2576)|0)if(m=0,ve(5,47496,59265,8),t=m,m=0,t&1)t=j()|0,W0(2576),le(t|0);else{Nt(199,47496,Q|0)|0,Dt(2576);break}while(!1);return 47496}function E4(t){t=t|0;var r=0;do if(!(S[2584]|0)&&kt(2584)|0){if(m=0,t=ge(76,47508)|0,r=m,m=0,!(r&1)&&(m=0,ve(15,47544,47508,t|0),r=m,m=0,!(r&1))){Nt(200,47544,Q|0)|0,Dt(2584);break}r=j()|0,W0(2584),le(r|0)}while(!1);return 47544}function D4(t){t=t|0;do if(!(S[2592]|0)&&kt(2592)|0)if(m=0,ve(5,47556,59274,20),t=m,m=0,t&1)t=j()|0,W0(2592),le(t|0);else{Nt(199,47556,Q|0)|0,Dt(2592);break}while(!1);return 47556}function F4(t){t=t|0;var r=0;do if(!(S[2600]|0)&&kt(2600)|0){if(m=0,t=ge(76,47568)|0,r=m,m=0,!(r&1)&&(m=0,ve(15,47652,47568,t|0),r=m,m=0,!(r&1))){Nt(200,47652,Q|0)|0,Dt(2600);break}r=j()|0,W0(2600),le(r|0)}while(!1);return 47652}function N4(t){t=t|0;do if(!(S[2608]|0)&&kt(2608)|0)if(m=0,ve(5,47664,59295,11),t=m,m=0,t&1)t=j()|0,W0(2608),le(t|0);else{Nt(199,47664,Q|0)|0,Dt(2608);break}while(!1);return 47664}function R4(t){t=t|0;var r=0;do if(!(S[2616]|0)&&kt(2616)|0){if(m=0,t=ge(76,47676)|0,r=m,m=0,!(r&1)&&(m=0,ve(15,47724,47676,t|0),r=m,m=0,!(r&1))){Nt(200,47724,Q|0)|0,Dt(2616);break}r=j()|0,W0(2616),le(r|0)}while(!1);return 47724}function io(t){t=t|0;var r=0,o=0,a=0;e[t>>2]=44304,t=t+8|0,r=e[t>>2]|0,m=0,o=Ce(3)|0,a=m,m=0;do if(!(a&1)){if((r|0)!=(o|0)&&(m=0,ue(188,e[t>>2]|0),a=m,m=0,a&1))break;return}while(!1);a=j(0)|0,$t(a)}function Sn(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0;L=b,b=b+112|0,C=L,E=(a-o|0)/12|0;do if(E>>>0>100){if(C=E0(E)|0,!(C|0)&&(m=0,bt(6),P=m,m=0,P&1)){w=0,_=6;break}w=C,_=11}else w=0,_=11;while(!1);e:do if((_|0)==11){if((o|0)==(a|0))D=0;else for(_=o,F=0,R=C;D=S[_>>0]|0,D&1?D=e[_+4>>2]|0:D=(D&255)>>>1,D?(S[R>>0]=1,D=F):(S[R>>0]=2,D=F+1|0,E=E+-1|0),_=_+12|0,(_|0)!=(a|0);)F=D,R=R+1|0;$=(o|0)==(a|0),P=(o|0)==(a|0),G=0,z=D;t:for(;;){D=e[t>>2]|0;do if(D){if((e[D+12>>2]|0)==(e[D+16>>2]|0)){if(m=0,D=ge(e[(e[D>>2]|0)+36>>2]|0,D|0)|0,K=m,m=0,K&1){_=5;break t}if((D|0)==-1){e[t>>2]=0,D=0;break}else{D=e[t>>2]|0;break}}}else D=0;while(!1);if(_=(D|0)==0,F=e[r>>2]|0,F){if((e[F+12>>2]|0)==(e[F+16>>2]|0)){if(m=0,D=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,K=m,m=0,K&1){_=5;break}(D|0)==-1&&(e[r>>2]=0,F=0)}}else F=0;if(R=(F|0)==0,D=e[t>>2]|0,!((E|0)!=0&(_^R))){_=64;break}if(F=e[D+12>>2]|0,(F|0)==(e[D+16>>2]|0)){if(m=0,D=ge(e[(e[D>>2]|0)+36>>2]|0,D|0)|0,K=m,m=0,K&1){_=5;break}}else D=N[F>>0]|0;if(D=D&255,!d&&(m=0,D=Ne(e[(e[l>>2]|0)+12>>2]|0,l|0,D|0)|0,K=m,m=0,K&1)){_=5;break}if(K=G+1|0,$)D=0,_=z;else for(R=0,H=o,_=z,z=C;;){do if((S[z>>0]|0)==1){if(S[H>>0]&1?F=e[H+8>>2]|0:F=H+1|0,F=S[F+G>>0]|0,!d&&(m=0,F=Ne(e[(e[l>>2]|0)+12>>2]|0,l|0,F|0)|0,J=m,m=0,J&1)){_=4;break t}if(D<<24>>24!=F<<24>>24){S[z>>0]=0,F=R,E=E+-1|0;break}F=S[H>>0]|0,F&1?F=e[H+4>>2]|0:F=(F&255)>>>1,(F|0)==(K|0)?(S[z>>0]=2,F=1,_=_+1|0,E=E+-1|0):F=1}else F=R;while(!1);if(H=H+12|0,(H|0)==(a|0)){D=F;break}else R=F,z=z+1|0}if(!D){G=K,z=_;continue}if(D=e[t>>2]|0,F=D+12|0,R=e[F>>2]|0,(R|0)==(e[D+16>>2]|0)){if(m=0,ge(e[(e[D>>2]|0)+40>>2]|0,D|0)|0,J=m,m=0,J&1){_=5;break}}else e[F>>2]=R+1;if((_+E|0)>>>0<2|P){G=K,z=_;continue}else D=o,R=_,_=C;for(;;)if((S[_>>0]|0)==2&&(F=S[D>>0]|0,F&1?F=e[D+4>>2]|0:F=(F&255)>>>1,(F|0)!=(K|0)&&(S[_>>0]=0,R=R+-1|0)),D=D+12|0,(D|0)==(a|0)){G=K,z=R;continue t}else _=_+1|0}if((_|0)==4){o=j()|0;break}else if((_|0)==5){o=j()|0;break}else if((_|0)==64){do if(D){if((e[D+12>>2]|0)==(e[D+16>>2]|0)){if(m=0,D=ge(e[(e[D>>2]|0)+36>>2]|0,D|0)|0,J=m,m=0,J&1){_=6;break e}if((D|0)==-1){e[t>>2]=0,D=0;break}else{D=e[t>>2]|0;break}}}else D=0;while(!1);E=(D|0)==0;do if(R)_=76;else{if((e[F+12>>2]|0)==(e[F+16>>2]|0)){if(m=0,D=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,J=m,m=0,J&1){_=6;break e}if((D|0)==-1){e[r>>2]=0,_=76;break}}E||(_=77)}while(!1);(_|0)==76&&E&&(_=77),(_|0)==77&&(e[h>>2]=e[h>>2]|2);t:do if((o|0)==(a|0))_=81;else for(;;){if((S[C>>0]|0)==2)break t;if(o=o+12|0,(o|0)==(a|0)){_=81;break}else C=C+1|0}while(!1);return(_|0)==81&&(e[h>>2]=e[h>>2]|4,o=a),w&&n0(w),b=L,o|0}}while(!1);return(_|0)==6&&(o=j()|0),w&&n0(w),le(o|0),0}function M4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,z=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,w){d=0;break}else d=0;if(w=S[ne>>0]|0,w=w&1?e[_>>2]|0:(w&255)>>>1,(e[K>>2]|0)==(a+w|0)){if(m=0,ve(8,ne|0,w<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else w=N[w>>0]|0;if(_i(w&255,H,a,K,G,E,ae,P,L,z)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(21,a|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=25;else{if(e[h>>2]=a,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function _4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,z=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;d=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(d)break;break t}if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(d)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,d){w=0;break}else w=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(a+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+d}if(C=t+12|0,d=e[C>>2]|0,D=t+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else d=N[d>>0]|0;if(_i(d&255,H,a,K,G,E,ae,P,L,z)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(22,a|0,e[K>>2]|0,l|0,H|0)|0,d=ye,ce=m,m=0,ce&1)re=25;else{if(ce=h,e[ce>>2]=a,e[ce+4>>2]=d,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function P4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,z=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,w){d=0;break}else d=0;if(w=S[ne>>0]|0,w=w&1?e[_>>2]|0:(w&255)>>>1,(e[K>>2]|0)==(a+w|0)){if(m=0,ve(8,ne|0,w<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else w=N[w>>0]|0;if(_i(w&255,H,a,K,G,E,ae,P,L,z)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(23,a|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=25;else{if(k[h>>1]=a,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function L4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,z=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,w){d=0;break}else d=0;if(w=S[ne>>0]|0,w=w&1?e[_>>2]|0:(w&255)>>>1,(e[K>>2]|0)==(a+w|0)){if(m=0,ve(8,ne|0,w<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else w=N[w>>0]|0;if(_i(w&255,H,a,K,G,E,ae,P,L,z)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(24,a|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=25;else{if(e[h>>2]=a,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function O4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,z=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;w=(t|0)==0,d=e[o>>2]|0;do if(d){if((e[d+12>>2]|0)!=(e[d+16>>2]|0)){if(w)break;break t}if(m=0,C=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(w)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,w){d=0;break}else d=0;if(w=S[ne>>0]|0,w=w&1?e[_>>2]|0:(w&255)>>>1,(e[K>>2]|0)==(a+w|0)){if(m=0,ve(8,ne|0,w<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+w}if(C=t+12|0,w=e[C>>2]|0,D=t+16|0,(w|0)==(e[D>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else w=N[w>>0]|0;if(_i(w&255,H,a,K,G,E,ae,P,L,z)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(25,a|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=25;else{if(e[h>>2]=a,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function $4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+240|0,z=J+202|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,qi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=25;else{F=ne+8|0,R=ne+1|0,a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=S[d>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,D=m,m=0,D&1){re=24;break}(d|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;d=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(d)break;break t}if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,D=m,m=0,D&1){re=24;break t}if((C|0)!=-1){if(d)break;break t}else{e[o>>2]=0,re=16;break}}else re=16;while(!1);if((re|0)==16)if(re=0,d){w=0;break}else w=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(a+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=24;break}if(S[ne>>0]&1?a=(e[ne>>2]&-2)+-1|0:a=10,m=0,ve(8,ne|0,a|0,0),D=m,m=0,D&1){re=24;break}a=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=a+d}if(C=t+12|0,d=e[C>>2]|0,D=t+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}}else d=N[d>>0]|0;if(_i(d&255,H,a,K,G,E,ae,P,L,z)|0)break;if(d=e[C>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=24;break}else continue;else{e[C>>2]=d+1;continue}}if((re|0)==24){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,a=Pe(26,a|0,e[K>>2]|0,l|0,H|0)|0,d=ye,ce=m,m=0,ce&1)re=25;else{if(ce=h,e[ce>>2]=a,e[ce+4>>2]=d,V0(ae,P,e[L>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,ce=m,m=0,ce&1){re=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,ce=m,m=0,ce&1){re=25;break e}if((t|0)==-1){e[o>>2]=0,re=49;break}}a||(re=50)}else re=49;while(!1);return(re|0)==49&&a&&(re=50),(re|0)==50&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==25&&(t=j()|0),de(ne),de(ae),le(t|0),0}function B4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+240|0,K=re+208|0,w=re+203|0,C=re+202|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+40|0,ae=re+4|0,P=re,L=re+201|0,G=re+200|0,Ar(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=25;else{_=ce+8|0,z=ce+1|0,a=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=a,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=S[w>>0]|0,F=S[C>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,E=m,m=0,E&1){ke=24;break}(w|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;C=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(C)break;break t}if(m=0,D=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=24;break t}if((D|0)!=-1){if(C)break;break t}else{e[o>>2]=0,ke=16;break}}else ke=16;while(!1);if((ke|0)==16)if(ke=0,C){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(a+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=24;break}if(S[ce>>0]&1?a=(e[ce>>2]&-2)+-1|0:a=10,m=0,ve(8,ce|0,a|0,0),E=m,m=0,E&1){ke=24;break}a=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=a+C}if(D=t+12|0,C=e[D>>2]|0,E=t+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}}else C=N[C>>0]|0;if(vr(C&255,L,G,a,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}else continue;else{e[D>>2]=w+1;continue}}if((ke|0)==24){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(1,a|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=25;else{if(U[h>>2]=d,V0(Ee,ne,e[ae>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=25;break e}if((t|0)==-1){e[o>>2]=0,ke=49;break}}a||(ke=50)}else ke=49;while(!1);return(ke|0)==49&&a&&(ke=50),(ke|0)==50&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==25&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function V4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+240|0,K=re+208|0,w=re+203|0,C=re+202|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+40|0,ae=re+4|0,P=re,L=re+201|0,G=re+200|0,Ar(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=25;else{_=ce+8|0,z=ce+1|0,a=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=a,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=S[w>>0]|0,F=S[C>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,E=m,m=0,E&1){ke=24;break}(w|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;C=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(C)break;break t}if(m=0,D=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=24;break t}if((D|0)!=-1){if(C)break;break t}else{e[o>>2]=0,ke=16;break}}else ke=16;while(!1);if((ke|0)==16)if(ke=0,C){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(a+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=24;break}if(S[ce>>0]&1?a=(e[ce>>2]&-2)+-1|0:a=10,m=0,ve(8,ce|0,a|0,0),E=m,m=0,E&1){ke=24;break}a=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=a+C}if(D=t+12|0,C=e[D>>2]|0,E=t+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}}else C=N[C>>0]|0;if(vr(C&255,L,G,a,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}else continue;else{e[D>>2]=w+1;continue}}if((ke|0)==24){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(2,a|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=25;else{if(B[h>>3]=d,V0(Ee,ne,e[ae>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=25;break e}if((t|0)==-1){e[o>>2]=0,ke=49;break}}a||(ke=50)}else ke=49;while(!1);return(ke|0)==49&&a&&(ke=50),(ke|0)==50&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==25&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function U4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+240|0,K=re+208|0,w=re+203|0,C=re+202|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+40|0,ae=re+4|0,P=re,L=re+201|0,G=re+200|0,Ar(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=25;else{_=ce+8|0,z=ce+1|0,a=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=a,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=S[w>>0]|0,F=S[C>>0]|0,t=e[r>>2]|0;t:for(;;){if(t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,w=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,E=m,m=0,E&1){ke=24;break}(w|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;C=(t|0)==0,w=e[o>>2]|0;do if(w){if((e[w+12>>2]|0)!=(e[w+16>>2]|0)){if(C)break;break t}if(m=0,D=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=24;break t}if((D|0)!=-1){if(C)break;break t}else{e[o>>2]=0,ke=16;break}}else ke=16;while(!1);if((ke|0)==16)if(ke=0,C){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(a+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=24;break}if(S[ce>>0]&1?a=(e[ce>>2]&-2)+-1|0:a=10,m=0,ve(8,ce|0,a|0,0),E=m,m=0,E&1){ke=24;break}a=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=a+C}if(D=t+12|0,C=e[D>>2]|0,E=t+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}}else C=N[C>>0]|0;if(vr(C&255,L,G,a,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[t>>2]|0)+40>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=24;break}else continue;else{e[D>>2]=w+1;continue}}if((ke|0)==24){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(3,a|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=25;else{if(B[h>>3]=d,V0(Ee,ne,e[ae>>2]|0,l),t){if((e[t+12>>2]|0)==(e[t+16>>2]|0)){if(m=0,a=ge(e[(e[t>>2]|0)+36>>2]|0,t|0)|0,Te=m,m=0,Te&1){ke=25;break}(a|0)==-1&&(e[r>>2]=0,t=0)}}else t=0;a=(t|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=25;break e}if((t|0)==-1){e[o>>2]=0,ke=49;break}}a||(ke=50)}else ke=49;while(!1);return(ke|0)==49&&a&&(ke=50),(ke|0)==50&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==25&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function z4(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return l=b,b=b+16|0,h=l,e[h>>2]=a,a=ai(r)|0,r=Lo(t,o,h)|0,a|0&&(m=0,ge(75,a|0)|0,h=m,m=0,h&1)&&(h=j(0)|0,$t(h)),b=l,r|0}function An(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0;var w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0;L=b,b=b+112|0,C=L,E=(a-o|0)/12|0;do if(E>>>0>100){if(C=E0(E)|0,!(C|0)&&(m=0,bt(6),P=m,m=0,P&1)){w=0,R=6;break}w=C,R=11}else w=0,R=11;while(!1);e:do if((R|0)==11){if((o|0)==(a|0))D=0;else for(_=o,F=0,R=C;D=S[_>>0]|0,D&1?D=e[_+4>>2]|0:D=(D&255)>>>1,D?(S[R>>0]=1,D=F):(S[R>>0]=2,D=F+1|0,E=E+-1|0),_=_+12|0,(_|0)!=(a|0);)F=D,R=R+1|0;$=(o|0)==(a|0),P=(o|0)==(a|0),G=0,z=E;t:for(;;){E=e[t>>2]|0;do if(E){if(F=e[E+12>>2]|0,(F|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,K=m,m=0,K&1){R=5;break t}}else E=e[F>>2]|0;if((E|0)==-1){e[t>>2]=0,_=1;break}else{_=(e[t>>2]|0)==0;break}}else _=1;while(!1);if(F=e[r>>2]|0,F){if(E=e[F+12>>2]|0,(E|0)==(e[F+16>>2]|0)){if(m=0,E=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,K=m,m=0,K&1){R=5;break}}else E=e[E>>2]|0;(E|0)==-1?(e[r>>2]=0,F=0,R=1):R=0}else F=0,R=1;if(E=e[t>>2]|0,!((z|0)!=0&(_^R))){R=66;break}if(F=e[E+12>>2]|0,(F|0)==(e[E+16>>2]|0)){if(m=0,E=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,K=m,m=0,K&1){R=5;break}}else E=e[F>>2]|0;if(!d&&(m=0,E=Ne(e[(e[l>>2]|0)+28>>2]|0,l|0,E|0)|0,K=m,m=0,K&1)){R=5;break}if(K=G+1|0,$)E=0,_=z;else for(_=0,H=o,R=z,z=C;;){do if((S[z>>0]|0)==1){if(S[H>>0]&1?F=e[H+8>>2]|0:F=H+4|0,F=e[F+(G<<2)>>2]|0,!d&&(m=0,F=Ne(e[(e[l>>2]|0)+28>>2]|0,l|0,F|0)|0,J=m,m=0,J&1)){R=4;break t}if((E|0)!=(F|0)){S[z>>0]=0,F=_,R=R+-1|0;break}F=S[H>>0]|0,F&1?F=e[H+4>>2]|0:F=(F&255)>>>1,(F|0)==(K|0)?(S[z>>0]=2,F=1,D=D+1|0,R=R+-1|0):F=1}else F=_;while(!1);if(H=H+12|0,(H|0)==(a|0)){E=F,_=R;break}else _=F,z=z+1|0}if(!E){G=K,z=_;continue}if(E=e[t>>2]|0,F=E+12|0,R=e[F>>2]|0,(R|0)==(e[E+16>>2]|0)){if(m=0,ge(e[(e[E>>2]|0)+40>>2]|0,E|0)|0,J=m,m=0,J&1){R=5;break}}else e[F>>2]=R+4;if((D+_|0)>>>0<2|P){G=K,z=_;continue}else E=o,R=C;for(;;)if((S[R>>0]|0)==2&&(F=S[E>>0]|0,F&1?F=e[E+4>>2]|0:F=(F&255)>>>1,(F|0)!=(K|0)&&(S[R>>0]=0,D=D+-1|0)),E=E+12|0,(E|0)==(a|0)){G=K,z=_;continue t}else R=R+1|0}if((R|0)==4){o=j()|0;break}else if((R|0)==5){o=j()|0;break}else if((R|0)==66){do if(E){if(D=e[E+12>>2]|0,(D|0)==(e[E+16>>2]|0)){if(m=0,D=ge(e[(e[E>>2]|0)+36>>2]|0,E|0)|0,J=m,m=0,J&1){R=6;break e}}else D=e[D>>2]|0;if((D|0)==-1){e[t>>2]=0,E=1;break}else{E=(e[t>>2]|0)==0;break}}else E=1;while(!1);do if(F){if(D=e[F+12>>2]|0,(D|0)==(e[F+16>>2]|0)){if(m=0,D=ge(e[(e[F>>2]|0)+36>>2]|0,F|0)|0,J=m,m=0,J&1){R=6;break e}}else D=e[D>>2]|0;if((D|0)!=-1){if(E)break;R=81;break}else{e[r>>2]=0,R=79;break}}else R=79;while(!1);(R|0)==79&&E&&(R=81),(R|0)==81&&(e[h>>2]=e[h>>2]|2);t:do if((o|0)==(a|0))R=85;else for(;;){if((S[C>>0]|0)==2)break t;if(o=o+12|0,(o|0)==(a|0)){R=85;break}else C=C+1|0}while(!1);return(R|0)==85&&(e[h>>2]=e[h>>2]|4,o=a),w&&n0(w),b=L,o|0}}while(!1);return(R|0)==6&&(o=j()|0),w&&n0(w),le(o|0),0}function G4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,z=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){re=25;break t}}else d=e[d>>2]|0;if((d|0)!=-1){if(w)break;d=C;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,w){d=0;break}else C=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(t+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+d}if(w=a+12|0,d=e[w>>2]|0,D=a+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}}else d=e[d>>2]|0;if(Pi(d,H,t,K,G,E,ae,P,L,z)|0){d=C;break}if(d=e[w>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}else{d=a;continue}else{e[w>>2]=d+4,d=a;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(21,t|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=26;else{if(e[h>>2]=t,V0(ae,P,e[L>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function q4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,z=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,d=0,C=1):C=0}else d=0,C=1;w=e[o>>2]|0;do if(w){if(a=e[w+12>>2]|0,(a|0)==(e[w+16>>2]|0)){if(m=0,a=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,D=m,m=0,D&1){re=25;break t}}else a=e[a>>2]|0;if((a|0)!=-1){if(C)break;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,C){w=0;break}else w=0;if(a=S[ne>>0]|0,a=a&1?e[_>>2]|0:(a&255)>>>1,(e[K>>2]|0)==(t+a|0)){if(m=0,ve(8,ne|0,a<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+a}if(C=d+12|0,a=e[C>>2]|0,D=d+16|0,(a|0)==(e[D>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break}}else a=e[a>>2]|0;if(Pi(a,H,t,K,G,E,ae,P,L,z)|0)break;if(a=e[C>>2]|0,(a|0)==(e[D>>2]|0))if(m=0,ge(e[(e[d>>2]|0)+40>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break}else continue;else{e[C>>2]=a+4;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(22,t|0,e[K>>2]|0,l|0,H|0)|0,a=ye,ce=m,m=0,ce&1)re=26;else{if(ce=h,e[ce>>2]=t,e[ce+4>>2]=a,V0(ae,P,e[L>>2]|0,l),d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function W4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,z=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){re=25;break t}}else d=e[d>>2]|0;if((d|0)!=-1){if(w)break;d=C;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,w){d=0;break}else C=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(t+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+d}if(w=a+12|0,d=e[w>>2]|0,D=a+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}}else d=e[d>>2]|0;if(Pi(d,H,t,K,G,E,ae,P,L,z)|0){d=C;break}if(d=e[w>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}else{d=a;continue}else{e[w>>2]=d+4,d=a;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(23,t|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=26;else{if(k[h>>1]=t,V0(ae,P,e[L>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function H4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,z=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){re=25;break t}}else d=e[d>>2]|0;if((d|0)!=-1){if(w)break;d=C;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,w){d=0;break}else C=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(t+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+d}if(w=a+12|0,d=e[w>>2]|0,D=a+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}}else d=e[d>>2]|0;if(Pi(d,H,t,K,G,E,ae,P,L,z)|0){d=C;break}if(d=e[w>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}else{d=a;continue}else{e[w>>2]=d+4,d=a;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(24,t|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=26;else{if(e[h>>2]=t,V0(ae,P,e[L>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function Q4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,z=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,a=0,w=1):(a=d,w=0)}else a=0,w=1;C=e[o>>2]|0;do if(C){if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)){if(m=0,d=ge(e[(e[C>>2]|0)+36>>2]|0,C|0)|0,D=m,m=0,D&1){re=25;break t}}else d=e[d>>2]|0;if((d|0)!=-1){if(w)break;d=C;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,w){d=0;break}else C=0;if(d=S[ne>>0]|0,d=d&1?e[_>>2]|0:(d&255)>>>1,(e[K>>2]|0)==(t+d|0)){if(m=0,ve(8,ne|0,d<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+d}if(w=a+12|0,d=e[w>>2]|0,D=a+16|0,(d|0)==(e[D>>2]|0)){if(m=0,d=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}}else d=e[d>>2]|0;if(Pi(d,H,t,K,G,E,ae,P,L,z)|0){d=C;break}if(d=e[w>>2]|0,(d|0)==(e[D>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=25;break}else{d=a;continue}else{e[w>>2]=d+4,d=a;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(25,t|0,e[K>>2]|0,l|0,H|0)|0,ce=m,m=0,ce&1)re=26;else{if(e[h>>2]=t,V0(ae,P,e[L>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function K4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;J=b,b=b+320|0,z=J+208|0,d=J+200|0,ae=J+24|0,ne=J+12|0,K=J+8|0,P=J+40|0,L=J+4|0,G=J,H=li(a)|0,Wi(ae,a,z,d),e[ne>>2]=0,e[ne+4>>2]=0,e[ne+8>>2]=0,S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),_=m,m=0;e:do if(_&1)re=26;else{F=ne+8|0,R=ne+1|0,t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t,e[L>>2]=P,e[G>>2]=0,_=ne+4|0,E=e[d>>2]|0,d=e[r>>2]|0;t:for(;;){if(d){if(a=e[d+12>>2]|0,(a|0)==(e[d+16>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,D=m,m=0,D&1){re=25;break}}else a=e[a>>2]|0;(a|0)==-1?(e[r>>2]=0,d=0,C=1):C=0}else d=0,C=1;w=e[o>>2]|0;do if(w){if(a=e[w+12>>2]|0,(a|0)==(e[w+16>>2]|0)){if(m=0,a=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,D=m,m=0,D&1){re=25;break t}}else a=e[a>>2]|0;if((a|0)!=-1){if(C)break;break t}else{e[o>>2]=0,re=17;break}}else re=17;while(!1);if((re|0)==17)if(re=0,C){w=0;break}else w=0;if(a=S[ne>>0]|0,a=a&1?e[_>>2]|0:(a&255)>>>1,(e[K>>2]|0)==(t+a|0)){if(m=0,ve(8,ne|0,a<<1|0,0),D=m,m=0,D&1){re=25;break}if(S[ne>>0]&1?t=(e[ne>>2]&-2)+-1|0:t=10,m=0,ve(8,ne|0,t|0,0),D=m,m=0,D&1){re=25;break}t=S[ne>>0]&1?e[F>>2]|0:R,e[K>>2]=t+a}if(C=d+12|0,a=e[C>>2]|0,D=d+16|0,(a|0)==(e[D>>2]|0)){if(m=0,a=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break}}else a=e[a>>2]|0;if(Pi(a,H,t,K,G,E,ae,P,L,z)|0)break;if(a=e[C>>2]|0,(a|0)==(e[D>>2]|0))if(m=0,ge(e[(e[d>>2]|0)+40>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=25;break}else continue;else{e[C>>2]=a+4;continue}}if((re|0)==25){t=j()|0;break}if(ce=S[ae>>0]|0,(ce&1?e[ae+4>>2]|0:(ce&255)>>>1)|0&&($=e[L>>2]|0,($-P|0)<160)&&(ce=e[G>>2]|0,e[L>>2]=$+4,e[$>>2]=ce),m=0,t=Pe(26,t|0,e[K>>2]|0,l|0,H|0)|0,a=ye,ce=m,m=0,ce&1)re=26;else{if(ce=h,e[ce>>2]=t,e[ce+4>>2]=a,V0(ae,P,e[L>>2]|0,l),d){if(t=e[d+12>>2]|0,(t|0)==(e[d+16>>2]|0)){if(m=0,t=ge(e[(e[d>>2]|0)+36>>2]|0,d|0)|0,ce=m,m=0,ce&1){re=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,ce=m,m=0,ce&1){re=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;re=53;break}else{e[o>>2]=0,re=51;break}}else re=51;while(!1);return(re|0)==51&&a&&(re=53),(re|0)==53&&(e[l>>2]=e[l>>2]|2),ce=e[r>>2]|0,de(ne),de(ae),b=J,ce|0}}while(!1);return(re|0)==26&&(t=j()|0),de(ne),de(ae),le(t|0),0}function Y4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+352|0,K=re+208|0,w=re+40|0,C=re+36|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+48|0,ae=re+4|0,P=re,L=re+337|0,G=re+336|0,xr(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=26;else{_=ce+8|0,z=ce+1|0,t=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=t,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=e[w>>2]|0,F=e[C>>2]|0,a=e[r>>2]|0;t:for(;;){if(a){if(w=e[a+12>>2]|0,(w|0)==(e[a+16>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,E=m,m=0,E&1){ke=25;break}}else w=e[w>>2]|0;(w|0)==-1?(e[r>>2]=0,a=0,D=1):D=0}else a=0,D=1;w=e[o>>2]|0;do if(w){if(C=e[w+12>>2]|0,(C|0)==(e[w+16>>2]|0)){if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=25;break t}}else C=e[C>>2]|0;if((C|0)!=-1){if(D)break;break t}else{e[o>>2]=0,ke=17;break}}else ke=17;while(!1);if((ke|0)==17)if(ke=0,D){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(t+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=25;break}if(S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),E=m,m=0,E&1){ke=25;break}t=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=t+C}if(D=a+12|0,C=e[D>>2]|0,E=a+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}}else C=e[C>>2]|0;if(wr(C,L,G,t,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}else continue;else{e[D>>2]=w+4;continue}}if((ke|0)==25){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(1,t|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=26;else{if(U[h>>2]=d,V0(Ee,ne,e[ae>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;ke=53;break}else{e[o>>2]=0,ke=51;break}}else ke=51;while(!1);return(ke|0)==51&&a&&(ke=53),(ke|0)==53&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==26&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function j4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+352|0,K=re+208|0,w=re+40|0,C=re+36|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+48|0,ae=re+4|0,P=re,L=re+337|0,G=re+336|0,xr(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=26;else{_=ce+8|0,z=ce+1|0,t=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=t,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=e[w>>2]|0,F=e[C>>2]|0,a=e[r>>2]|0;t:for(;;){if(a){if(w=e[a+12>>2]|0,(w|0)==(e[a+16>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,E=m,m=0,E&1){ke=25;break}}else w=e[w>>2]|0;(w|0)==-1?(e[r>>2]=0,a=0,D=1):D=0}else a=0,D=1;w=e[o>>2]|0;do if(w){if(C=e[w+12>>2]|0,(C|0)==(e[w+16>>2]|0)){if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=25;break t}}else C=e[C>>2]|0;if((C|0)!=-1){if(D)break;break t}else{e[o>>2]=0,ke=17;break}}else ke=17;while(!1);if((ke|0)==17)if(ke=0,D){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(t+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=25;break}if(S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),E=m,m=0,E&1){ke=25;break}t=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=t+C}if(D=a+12|0,C=e[D>>2]|0,E=a+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}}else C=e[C>>2]|0;if(wr(C,L,G,t,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}else continue;else{e[D>>2]=w+4;continue}}if((ke|0)==25){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(2,t|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=26;else{if(B[h>>3]=d,V0(Ee,ne,e[ae>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;ke=53;break}else{e[o>>2]=0,ke=51;break}}else ke=51;while(!1);return(ke|0)==51&&a&&(ke=53),(ke|0)==53&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==26&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function X4(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0;re=b,b=b+352|0,K=re+208|0,w=re+40|0,C=re+36|0,Ee=re+24|0,ce=re+12|0,$=re+8|0,ne=re+48|0,ae=re+4|0,P=re,L=re+337|0,G=re+336|0,xr(Ee,a,K,w,C),e[ce>>2]=0,e[ce+4>>2]=0,e[ce+8>>2]=0,S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),H=m,m=0;e:do if(H&1)ke=26;else{_=ce+8|0,z=ce+1|0,t=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=t,e[ae>>2]=ne,e[P>>2]=0,S[L>>0]=1,S[G>>0]=69,H=ce+4|0,R=e[w>>2]|0,F=e[C>>2]|0,a=e[r>>2]|0;t:for(;;){if(a){if(w=e[a+12>>2]|0,(w|0)==(e[a+16>>2]|0)){if(m=0,w=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,E=m,m=0,E&1){ke=25;break}}else w=e[w>>2]|0;(w|0)==-1?(e[r>>2]=0,a=0,D=1):D=0}else a=0,D=1;w=e[o>>2]|0;do if(w){if(C=e[w+12>>2]|0,(C|0)==(e[w+16>>2]|0)){if(m=0,C=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,E=m,m=0,E&1){ke=25;break t}}else C=e[C>>2]|0;if((C|0)!=-1){if(D)break;break t}else{e[o>>2]=0,ke=17;break}}else ke=17;while(!1);if((ke|0)==17)if(ke=0,D){w=0;break}else w=0;if(C=S[ce>>0]|0,C=C&1?e[H>>2]|0:(C&255)>>>1,(e[$>>2]|0)==(t+C|0)){if(m=0,ve(8,ce|0,C<<1|0,0),E=m,m=0,E&1){ke=25;break}if(S[ce>>0]&1?t=(e[ce>>2]&-2)+-1|0:t=10,m=0,ve(8,ce|0,t|0,0),E=m,m=0,E&1){ke=25;break}t=S[ce>>0]&1?e[_>>2]|0:z,e[$>>2]=t+C}if(D=a+12|0,C=e[D>>2]|0,E=a+16|0,(C|0)==(e[E>>2]|0)){if(m=0,C=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}}else C=e[C>>2]|0;if(wr(C,L,G,t,$,R,F,Ee,ne,ae,P,K)|0)break;if(w=e[D>>2]|0,(w|0)==(e[E>>2]|0))if(m=0,ge(e[(e[a>>2]|0)+40>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=25;break}else continue;else{e[D>>2]=w+4;continue}}if((ke|0)==25){t=j()|0;break}if(Te=S[Ee>>0]|0,!(!(S[L>>0]|0)||!((Te&1?e[Ee+4>>2]|0:(Te&255)>>>1)|0))&&(J=e[ae>>2]|0,(J-ne|0)<160)&&(Te=e[P>>2]|0,e[ae>>2]=J+4,e[J>>2]=Te),m=0,d=+ut(3,t|0,e[$>>2]|0,l|0),Te=m,m=0,Te&1)ke=26;else{if(B[h>>3]=d,V0(Ee,ne,e[ae>>2]|0,l),a){if(t=e[a+12>>2]|0,(t|0)==(e[a+16>>2]|0)){if(m=0,t=ge(e[(e[a>>2]|0)+36>>2]|0,a|0)|0,Te=m,m=0,Te&1){ke=26;break}}else t=e[t>>2]|0;(t|0)==-1?(e[r>>2]=0,a=1):a=0}else a=1;do if(w){if(t=e[w+12>>2]|0,(t|0)==(e[w+16>>2]|0)){if(m=0,t=ge(e[(e[w>>2]|0)+36>>2]|0,w|0)|0,Te=m,m=0,Te&1){ke=26;break e}}else t=e[t>>2]|0;if((t|0)!=-1){if(a)break;ke=53;break}else{e[o>>2]=0,ke=51;break}}else ke=51;while(!1);return(ke|0)==51&&a&&(ke=53),(ke|0)==53&&(e[l>>2]=e[l>>2]|2),Te=e[r>>2]|0,de(ce),de(Ee),b=re,Te|0}}while(!1);return(ke|0)==26&&(t=j()|0),de(ce),de(Ee),le(t|0),0}function q0(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;return h=b,b=b+16|0,d=h,e[d>>2]=l,l=ai(o)|0,o=Mn(t,r,a,d)|0,l|0&&(m=0,ge(75,l|0)|0,d=m,m=0,d&1)&&(d=j(0)|0,$t(d)),b=h,o|0}function Z4(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;if(l=b,b=b+16|0,h=l,e[h>>2]=a,a=ai(r)|0,m=0,r=Ve(37,t|0,o|0,h|0)|0,t=m,m=0,t&1)r=j()|0,a|0&&(m=0,ge(75,a|0)|0,h=m,m=0,h&1)&&(h=j(0)|0,$t(h)),le(r|0);else return a|0&&(m=0,ge(75,a|0)|0,h=m,m=0,h&1)&&(h=j(0)|0,$t(h)),b=l,r|0;return 0}function Hi(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0;F=b,b=b+16|0,E=F,d=e[t>>2]|0;e:do if(!d)d=0;else{if(R=r,C=a-R>>2,D=l+12|0,w=e[D>>2]|0,C=(w|0)>(C|0)?w-C|0:0,w=o,R=w-R|0,l=R>>2,(R|0)>0&&(Yt[e[(e[d>>2]|0)+48>>2]&63](d,r,l)|0)!=(l|0)){e[t>>2]=0,d=0;break}do if((C|0)>0)if(gr(E,C,h),m=0,l=Ve(e[(e[d>>2]|0)+48>>2]|0,d|0,(S[E>>0]&1?e[E+8>>2]|0:E+4|0)|0,C|0)|0,R=m,m=0,R&1&&(R=j()|0,Pt(E),le(R|0)),(l|0)==(C|0)){Pt(E);break}else{e[t>>2]=0,Pt(E),d=0;break e}while(!1);if(R=a-w|0,a=R>>2,(R|0)>0&&(Yt[e[(e[d>>2]|0)+48>>2]&63](d,o,a)|0)!=(a|0)){e[t>>2]=0,d=0;break}e[D>>2]=0}while(!1);return b=F,d|0}function fi(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;h=e[t>>2]|0;do if(h){if((e[h+12>>2]|0)==(e[h+16>>2]|0))if((Et[e[(e[h>>2]|0)+36>>2]&127](h)|0)==-1){e[t>>2]=0,h=0;break}else{h=e[t>>2]|0;break}}else h=0;while(!1);d=(h|0)==0,h=e[r>>2]|0;do if(h){if((e[h+12>>2]|0)==(e[h+16>>2]|0)&&(Et[e[(e[h>>2]|0)+36>>2]&127](h)|0)==-1){e[r>>2]=0,z=11;break}d?z=13:z=12}else z=11;while(!1);(z|0)==11&&(d?z=12:(h=0,z=13));e:do if((z|0)==12)e[o>>2]=e[o>>2]|6,h=0;else if((z|0)==13){if(d=e[t>>2]|0,w=e[d+12>>2]|0,(w|0)==(e[d+16>>2]|0)?d=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:d=N[w>>0]|0,w=d&255,w<<24>>24>-1&&(_=a+8|0,(k[(e[_>>2]|0)+(d<<24>>24<<1)>>1]&2048)!=0)){for(D=(Yt[e[(e[a>>2]|0)+36>>2]&63](a,w,0)|0)<<24>>24,d=e[t>>2]|0,w=d+12|0,C=e[w>>2]|0,(C|0)==(e[d+16>>2]|0)?(Et[e[(e[d>>2]|0)+40>>2]&127](d)|0,F=l,E=h,l=h,h=D):(e[w>>2]=C+1,F=l,E=h,l=h,h=D);;){h=h+-48|0,R=F+-1|0,d=e[t>>2]|0;do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0))if((Et[e[(e[d>>2]|0)+36>>2]&127](d)|0)==-1){e[t>>2]=0,d=0;break}else{d=e[t>>2]|0;break}}else d=0;while(!1);if(C=(d|0)==0,l?(e[l+12>>2]|0)==(e[l+16>>2]|0)?(Et[e[(e[l>>2]|0)+36>>2]&127](l)|0)==-1?(e[r>>2]=0,w=0,l=0):(w=E,l=E):w=E:(w=E,l=0),d=e[t>>2]|0,!((F|0)>1&(C^(l|0)==0)))break;if(C=e[d+12>>2]|0,(C|0)==(e[d+16>>2]|0)?d=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:d=N[C>>0]|0,C=d&255,C<<24>>24<=-1||!(k[(e[_>>2]|0)+(d<<24>>24<<1)>>1]&2048))break e;if(h=((Yt[e[(e[a>>2]|0)+36>>2]&63](a,C,0)|0)<<24>>24)+(h*10|0)|0,d=e[t>>2]|0,C=d+12|0,D=e[C>>2]|0,(D|0)==(e[d+16>>2]|0)){Et[e[(e[d>>2]|0)+40>>2]&127](d)|0,F=R,E=w;continue}else{e[C>>2]=D+1,F=R,E=w;continue}}do if(d){if((e[d+12>>2]|0)==(e[d+16>>2]|0))if((Et[e[(e[d>>2]|0)+36>>2]&127](d)|0)==-1){e[t>>2]=0,d=0;break}else{d=e[t>>2]|0;break}}else d=0;while(!1);d=(d|0)==0;do if(w){if((e[w+12>>2]|0)==(e[w+16>>2]|0)&&(Et[e[(e[w>>2]|0)+36>>2]&127](w)|0)==-1){e[r>>2]=0,z=50;break}if(d)break e}else z=50;while(!1);if((z|0)==50&&!d)break;e[o>>2]=e[o>>2]|2;break}e[o>>2]=e[o>>2]|4,h=0}while(!1);return h|0}function hi(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;h=e[t>>2]|0;do if(h)if(d=e[h+12>>2]|0,(d|0)==(e[h+16>>2]|0)?h=Et[e[(e[h>>2]|0)+36>>2]&127](h)|0:h=e[d>>2]|0,(h|0)==-1){e[t>>2]=0,w=1;break}else{w=(e[t>>2]|0)==0;break}else w=1;while(!1);d=e[r>>2]|0;do if(d)if(h=e[d+12>>2]|0,(h|0)==(e[d+16>>2]|0)?h=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:h=e[h>>2]|0,(h|0)!=-1)if(w){_=17;break}else{_=16;break}else{e[r>>2]=0,_=14;break}else _=14;while(!1);(_|0)==14&&(w?_=16:(d=0,_=17));e:do if((_|0)==16)e[o>>2]=e[o>>2]|6,h=0;else if((_|0)==17){if(h=e[t>>2]|0,w=e[h+12>>2]|0,(w|0)==(e[h+16>>2]|0)?h=Et[e[(e[h>>2]|0)+36>>2]&127](h)|0:h=e[w>>2]|0,!(Yt[e[(e[a>>2]|0)+12>>2]&63](a,2048,h)|0)){e[o>>2]=e[o>>2]|4,h=0;break}for(h=(Yt[e[(e[a>>2]|0)+52>>2]&63](a,h,0)|0)<<24>>24,w=e[t>>2]|0,C=w+12|0,D=e[C>>2]|0,(D|0)==(e[w+16>>2]|0)?(Et[e[(e[w>>2]|0)+40>>2]&127](w)|0,F=l,E=d,C=d):(e[C>>2]=D+4,F=l,E=d,C=d);;){h=h+-48|0,R=F+-1|0,d=e[t>>2]|0;do if(d)if(w=e[d+12>>2]|0,(w|0)==(e[d+16>>2]|0)?d=Et[e[(e[d>>2]|0)+36>>2]&127](d)|0:d=e[w>>2]|0,(d|0)==-1){e[t>>2]=0,D=1;break}else{D=(e[t>>2]|0)==0;break}else D=1;while(!1);do if(C)if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)?d=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:d=e[d>>2]|0,(d|0)==-1){e[r>>2]=0,C=0,l=0,d=1;break}else{C=E,l=E,d=(E|0)==0;break}else C=E,l=0,d=1;while(!1);if(w=e[t>>2]|0,!((F|0)>1&(D^d)))break;if(d=e[w+12>>2]|0,(d|0)==(e[w+16>>2]|0)?d=Et[e[(e[w>>2]|0)+36>>2]&127](w)|0:d=e[d>>2]|0,!(Yt[e[(e[a>>2]|0)+12>>2]&63](a,2048,d)|0))break e;if(h=((Yt[e[(e[a>>2]|0)+52>>2]&63](a,d,0)|0)<<24>>24)+(h*10|0)|0,d=e[t>>2]|0,w=d+12|0,D=e[w>>2]|0,(D|0)==(e[d+16>>2]|0)){Et[e[(e[d>>2]|0)+40>>2]&127](d)|0,F=R,E=C,C=l;continue}else{e[w>>2]=D+4,F=R,E=C,C=l;continue}}do if(w)if(d=e[w+12>>2]|0,(d|0)==(e[w+16>>2]|0)?d=Et[e[(e[w>>2]|0)+36>>2]&127](w)|0:d=e[d>>2]|0,(d|0)==-1){e[t>>2]=0,w=1;break}else{w=(e[t>>2]|0)==0;break}else w=1;while(!1);do if(C)if(d=e[C+12>>2]|0,(d|0)==(e[C+16>>2]|0)?d=Et[e[(e[C>>2]|0)+36>>2]&127](C)|0:d=e[d>>2]|0,(d|0)!=-1){if(w)break e;break}else{e[r>>2]=0,_=60;break}else _=60;while(!1);if((_|0)==60&&!w)break;e[o>>2]=e[o>>2]|2}while(!1);return h|0}function J4(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=t+4|0,a=(e[h>>2]|0)!=189,w=e[t>>2]|0,d=w,l=(e[o>>2]|0)-d|0,l=l>>>0<2147483647?l<<1:-1,d=(e[r>>2]|0)-d|0,w=Gi(a?w:0,l)|0,w||En();do if(a)e[t>>2]=w,C=w;else if(a=e[t>>2]|0,e[t>>2]=w,a)if(m=0,ue(e[h>>2]|0,a|0),w=m,m=0,w&1)w=j(0)|0,$t(w);else{C=e[t>>2]|0;break}else C=w;while(!1);e[h>>2]=201,e[r>>2]=C+d,e[o>>2]=(e[t>>2]|0)+l}function e3(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=t+4|0,a=(e[h>>2]|0)!=189,w=e[t>>2]|0,d=w,l=(e[o>>2]|0)-d|0,l=l>>>0<2147483647?l<<1:-1,d=(e[r>>2]|0)-d>>2,w=Gi(a?w:0,l)|0,w||En();do if(a)e[t>>2]=w,C=w;else if(a=e[t>>2]|0,e[t>>2]=w,a)if(m=0,ue(e[h>>2]|0,a|0),w=m,m=0,w&1)w=j(0)|0,$t(w);else{C=e[t>>2]|0;break}else C=w;while(!1);e[h>>2]=201,e[r>>2]=C+(d<<2),e[o>>2]=(e[t>>2]|0)+(l>>>2<<2)}function t3(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=r,a=S[t>>0]|0,a&1?(a=e[t>>2]|0,l=(a&-2)+-1|0,C=e[t+4>>2]|0,a=a&255):(l=10,C=(a&255)>>>1),w=o-h|0;do if((o|0)!=(r|0)){if((l-C|0)>>>0>>0&&(pr(t,l,C+w-l|0,C,C,0,0),a=S[t>>0]|0),a&1?d=e[t+8>>2]|0:d=t+1|0,h=o+(C-h)|0,(r|0)!=(o|0))for(a=r,l=d+C|0;S[l>>0]=S[a>>0]|0,a=a+1|0,(a|0)!=(o|0);)l=l+1|0;if(S[d+h>>0]=0,a=C+w|0,S[t>>0]&1){e[t+4>>2]=a;break}else{S[t>>0]=a<<1;break}}while(!1);return t|0}function i3(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=t+4|0,a=(e[h>>2]|0)!=189,w=e[t>>2]|0,d=w,l=(e[o>>2]|0)-d|0,l=l>>>0<2147483647?l<<1:-1,d=(e[r>>2]|0)-d>>2,w=Gi(a?w:0,l)|0,w||En();do if(a)e[t>>2]=w,C=w;else if(a=e[t>>2]|0,e[t>>2]=w,a)if(m=0,ue(e[h>>2]|0,a|0),w=m,m=0,w&1)w=j(0)|0,$t(w);else{C=e[t>>2]|0;break}else C=w;while(!1);e[h>>2]=201,e[r>>2]=C+(d<<2),e[o>>2]=(e[t>>2]|0)+(l>>>2<<2)}function n3(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0;h=r,a=S[t>>0]|0,a&1?(a=e[t>>2]|0,l=(a&-2)+-1|0,C=e[t+4>>2]|0,a=a&255):(l=1,C=(a&255)>>>1),w=o-h>>2;do if(w){if((l-C|0)>>>0>>0&&(Ws(t,l,C+w-l|0,C,C,0,0),a=S[t>>0]|0),a&1?d=e[t+8>>2]|0:d=t+4|0,h=C+((o-h|0)>>>2)|0,(r|0)!=(o|0))for(a=r,l=d+(C<<2)|0;e[l>>2]=e[a>>2],a=a+4|0,(a|0)!=(o|0);)l=l+4|0;if(e[d+(h<<2)>>2]=0,a=C+w|0,S[t>>0]&1){e[t+4>>2]=a;break}else{S[t>>0]=a<<1;break}}while(!1);return t|0}function r3(t,r){t=t|0,r=r|0;var o=0;e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,S[t+128>>0]=0;do if(r)if(m=0,Ae(125,t|0,r|0),o=m,m=0,o&1)o=j()|0,yr(t),le(o|0);else{no(t,r);break}while(!1)}function s3(t,r){t=t|0,r=r|0,w0(t,r,x0(43148)|0)}function o3(t,r){t=t|0,r=r|0,w0(t,r,x0(43188)|0)}function l3(t,r){t=t|0,r=r|0,w0(t,r,x0(44220)|0)}function u3(t,r){t=t|0,r=r|0,w0(t,r,x0(44212)|0)}function c3(t,r){t=t|0,r=r|0,w0(t,r,x0(44280)|0)}function f3(t,r){t=t|0,r=r|0,w0(t,r,x0(44288)|0)}function h3(t,r){t=t|0,r=r|0,w0(t,r,x0(44344)|0)}function d3(t,r){t=t|0,r=r|0,w0(t,r,x0(44352)|0)}function p3(t,r){t=t|0,r=r|0,w0(t,r,x0(44360)|0)}function m3(t,r){t=t|0,r=r|0,w0(t,r,x0(44368)|0)}function g3(t,r){t=t|0,r=r|0,w0(t,r,x0(43260)|0)}function S3(t,r){t=t|0,r=r|0,w0(t,r,x0(43332)|0)}function A3(t,r){t=t|0,r=r|0,w0(t,r,x0(43392)|0)}function v3(t,r){t=t|0,r=r|0,w0(t,r,x0(43452)|0)}function x3(t,r){t=t|0,r=r|0,w0(t,r,x0(43764)|0)}function w3(t,r){t=t|0,r=r|0,w0(t,r,x0(43828)|0)}function y3(t,r){t=t|0,r=r|0,w0(t,r,x0(43892)|0)}function C3(t,r){t=t|0,r=r|0,w0(t,r,x0(43956)|0)}function T3(t,r){t=t|0,r=r|0,w0(t,r,x0(43992)|0)}function I3(t,r){t=t|0,r=r|0,w0(t,r,x0(44028)|0)}function k3(t,r){t=t|0,r=r|0,w0(t,r,x0(44064)|0)}function E3(t,r){t=t|0,r=r|0,w0(t,r,x0(44100)|0)}function D3(t,r){t=t|0,r=r|0,w0(t,r,x0(43544)|0)}function b3(t,r){t=t|0,r=r|0,w0(t,r,x0(43636)|0)}function F3(t,r){t=t|0,r=r|0,w0(t,r,x0(43668)|0)}function N3(t,r){t=t|0,r=r|0,w0(t,r,x0(43700)|0)}function R3(t,r){t=t|0,r=r|0,w0(t,r,x0(44140)|0)}function M3(t,r){t=t|0,r=r|0,w0(t,r,x0(44180)|0)}function yr(t){t=t|0;var r=0,o=0,a=0;o=e[t>>2]|0;do if(o){if(a=t+4|0,r=e[a>>2]|0,(r|0)!=(o|0)){do r=r+-4|0;while((r|0)!=(o|0));e[a>>2]=r}if((t+16|0)==(o|0)){S[t+128>>0]=0;break}else{he(o);break}}while(!1)}function _3(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0;if(d=t+4|0,o=e[d>>2]|0,a=e[t>>2]|0,l=o-a>>2,l>>>0>=r>>>0){if(l>>>0>r>>>0&&(h=a+(r<<2)|0,(o|0)!=(h|0))){do o=o+-4|0;while((o|0)!=(h|0));e[d>>2]=o}}else Y3(t,r-l|0)}function P3(t,r){t=t|0,r=r|0;var o=0;return o=e[t+8>>2]|0,(e[t+12>>2]|0)-o>>2>>>0>r>>>0?o=(e[o+(r<<2)>>2]|0)!=0:o=0,o|0}function L3(t){t=t|0;var r=0,o=0;o=t+4|0,r=e[o>>2]|0,o=e[o+4>>2]|0,t=(e[t>>2]|0)+(o>>1)|0,o&1&&(r=e[(e[t>>2]|0)+r>>2]|0),Rt[r&255](t)}function O3(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0;e[o>>2]=t,e[h>>2]=a,w&2?(l-a|0)<3?t=1:(e[h>>2]=a+1,S[a>>0]=-17,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=-69,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=-65,C=4):C=4;e:do if((C|0)==4)if(D=r,t=e[o>>2]|0,t>>>0>>0)for(;;){if(w=k[t>>1]|0,C=w&65535,C>>>0>d>>>0){t=2;break e}do if((w&65535)<128){if(t=e[h>>2]|0,(l-t|0)<1){t=1;break e}e[h>>2]=t+1,S[t>>0]=w}else{if((w&65535)<2048){if(t=e[h>>2]|0,(l-t|0)<2){t=1;break e}e[h>>2]=t+1,S[t>>0]=C>>>6|192,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C&63|128;break}if((w&65535)<55296){if(t=e[h>>2]|0,(l-t|0)<3){t=1;break e}e[h>>2]=t+1,S[t>>0]=C>>>12|224,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C>>>6&63|128,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C&63|128;break}if((w&65535)>=56320){if((w&65535)<57344){t=2;break e}if(t=e[h>>2]|0,(l-t|0)<3){t=1;break e}e[h>>2]=t+1,S[t>>0]=C>>>12|224,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C>>>6&63|128,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C&63|128;break}if((D-t|0)<4){t=1;break e}if(t=t+2|0,w=M[t>>1]|0,(w&64512|0)!=56320){t=2;break e}if((l-(e[h>>2]|0)|0)<4){t=1;break e}if(a=C&960,((a<<10)+65536|C<<10&64512|w&1023)>>>0>d>>>0){t=2;break e}e[o>>2]=t,t=(a>>>6)+1|0,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=t>>>2|240,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C>>>2&15|t<<4&48|128,a=e[h>>2]|0,e[h>>2]=a+1,S[a>>0]=C<<4&48|w>>>6&15|128,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w&63|128}while(!1);if(t=(e[o>>2]|0)+2|0,e[o>>2]=t,t>>>0>=r>>>0){t=0;break}}else t=0;while(!1);return t|0}function $3(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0;e[o>>2]=t,e[h>>2]=a,w&4?(t=e[o>>2]|0,w=r,(w-t|0)>2&&(S[t>>0]|0)==-17&&(S[t+1>>0]|0)==-69&&(S[t+2>>0]|0)==-65?(e[o>>2]=t+3,C=e[h>>2]|0):C=a):(C=a,w=r),R=l,a=e[o>>2]|0,t=a>>>0>>0;e:do if(t&C>>>0>>0)for(;;){if(t=S[a>>0]|0,E=t&255,E>>>0>d>>>0){t=2;break e}do if(t<<24>>24>-1)k[C>>1]=t&255,e[o>>2]=a+1;else{if((t&255)<194){t=2;break e}if((t&255)<224){if((w-a|0)<2){t=1;break e}if(t=N[a+1>>0]|0,(t&192|0)!=128){t=2;break e}if(t=t&63|E<<6&1984,t>>>0>d>>>0){t=2;break e}k[C>>1]=t,e[o>>2]=a+2;break}if((t&255)<240){if((w-a|0)<3){t=1;break e}switch(D=S[a+1>>0]|0,t=S[a+2>>0]|0,E|0){case 224:{if((D&-32)<<24>>24!=-96){t=2;break e}break}case 237:{if((D&-32)<<24>>24!=-128){t=2;break e}break}default:if((D&-64)<<24>>24!=-128){t=2;break e}}if(t=t&255,(t&192|0)!=128){t=2;break e}if(t=(D&255)<<6&4032|E<<12|t&63,(t&65535)>>>0>d>>>0){t=2;break e}k[C>>1]=t,e[o>>2]=a+3;break}if((t&255)>=245){t=2;break e}if((w-a|0)<4){t=1;break e}switch(D=S[a+1>>0]|0,t=S[a+2>>0]|0,a=S[a+3>>0]|0,E|0){case 240:{if((D+112&255)>=48){t=2;break e}break}case 244:{if((D&-16)<<24>>24!=-128){t=2;break e}break}default:if((D&-64)<<24>>24!=-128){t=2;break e}}if(F=t&255,(F&192|0)!=128){t=2;break e}if(t=a&255,(t&192|0)!=128){t=2;break e}if((R-C|0)<4){t=1;break e}if(E=E&7,a=D&255,D=F<<6,t=t&63,(a<<12&258048|E<<18|D&4032|t)>>>0>d>>>0){t=2;break e}k[C>>1]=a<<2&60|F>>>4&3|((a>>>4&3|E<<2)<<6)+16320|55296,F=C+2|0,e[h>>2]=F,k[F>>1]=t|D&960|56320,e[o>>2]=(e[o>>2]|0)+4}while(!1);if(C=(e[h>>2]|0)+2|0,e[h>>2]=C,a=e[o>>2]|0,t=a>>>0>>0,!(t&C>>>0>>0)){_=39;break}}else _=39;while(!1);return(_|0)==39&&(t=t&1),t|0}function B3(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;F=r,l&4|0&&(F-t|0)>2&&(S[t>>0]|0)==-17&&(S[t+1>>0]|0)==-69?l=(S[t+2>>0]|0)==-65?t+3|0:t:l=t;e:do if((o|0)!=0&l>>>0>>0){E=l,h=0;t:for(;;){if(l=S[E>>0]|0,D=l&255,D>>>0>a>>>0){l=E,h=42;break e}do if(l<<24>>24>-1)l=E+1|0;else{if((l&255)<194){l=E,h=42;break e}if((l&255)<224){if((F-E|0)<2){l=E,h=42;break e}if(l=N[E+1>>0]|0,(l&192|0)!=128){l=E,h=42;break e}if((l&63|D<<6&1984)>>>0>a>>>0){l=E,h=42;break e}l=E+2|0;break}if((l&255)<240){if(l=E,(F-l|0)<3){l=E,h=42;break e}switch(w=S[E+1>>0]|0,d=S[E+2>>0]|0,D|0){case 224:{if((w&-32)<<24>>24!=-96){h=20;break t}break}case 237:{if((w&-32)<<24>>24!=-128){h=22;break t}break}default:if((w&-64)<<24>>24!=-128){h=24;break t}}if(l=d&255,(l&192|0)!=128){l=E,h=42;break e}if(((w&255)<<6&4032|D<<12&61440|l&63)>>>0>a>>>0){l=E,h=42;break e}l=E+3|0;break}if((l&255)>=245){l=E,h=42;break e}if(l=E,(o-h|0)>>>0<2|(F-l|0)<4){l=E,h=42;break e}switch(C=S[E+1>>0]|0,d=S[E+2>>0]|0,w=S[E+3>>0]|0,D|0){case 240:{if((C+112&255)>=48){h=32;break t}break}case 244:{if((C&-16)<<24>>24!=-128){h=34;break t}break}default:if((C&-64)<<24>>24!=-128){h=36;break t}}if(d=d&255,(d&192|0)!=128){l=E,h=42;break e}if(l=w&255,(l&192|0)!=128){l=E,h=42;break e}if(((C&255)<<12&258048|D<<18&1835008|d<<6&4032|l&63)>>>0>a>>>0){l=E,h=42;break e}l=E+4|0,h=h+1|0}while(!1);if(h=h+1|0,h>>>0>>0&l>>>0>>0)E=l;else{h=42;break e}}if((h|0)==20){l=l-t|0;break}else if((h|0)==22){l=l-t|0;break}else if((h|0)==24){l=l-t|0;break}else if((h|0)==32){l=l-t|0;break}else if((h|0)==34){l=l-t|0;break}else if((h|0)==36){l=l-t|0;break}}else h=42;while(!1);return(h|0)==42&&(l=l-t|0),l|0}function V3(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0;e[o>>2]=t,e[h>>2]=a,D=l,w&2?(D-a|0)<3?t=1:(e[h>>2]=a+1,S[a>>0]=-17,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=-69,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=-65,C=4):C=4;e:do if((C|0)==4)if(t=e[o>>2]|0,t>>>0>>0)for(;;){if(w=e[t>>2]|0,w>>>0>d>>>0|(w&-2048|0)==55296){t=2;break e}do if(w>>>0>=128){if(w>>>0<2048){if(t=e[h>>2]|0,(D-t|0)<2){t=1;break e}e[h>>2]=t+1,S[t>>0]=w>>>6|192,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w&63|128;break}if(t=e[h>>2]|0,l=D-t|0,w>>>0<65536){if((l|0)<3){t=1;break e}e[h>>2]=t+1,S[t>>0]=w>>>12|224,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w>>>6&63|128,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w&63|128;break}else{if((l|0)<4){t=1;break e}e[h>>2]=t+1,S[t>>0]=w>>>18|240,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w>>>12&63|128,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w>>>6&63|128,C=e[h>>2]|0,e[h>>2]=C+1,S[C>>0]=w&63|128;break}}else{if(t=e[h>>2]|0,(D-t|0)<1){t=1;break e}e[h>>2]=t+1,S[t>>0]=w}while(!1);if(t=(e[o>>2]|0)+4|0,e[o>>2]=t,t>>>0>=r>>>0){t=0;break}}else t=0;while(!1);return t|0}function U3(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0;var C=0,D=0,E=0,F=0,R=0,_=0;e[o>>2]=t,e[h>>2]=a,w&4?(t=e[o>>2]|0,w=r,(w-t|0)>2&&(S[t>>0]|0)==-17&&(S[t+1>>0]|0)==-69&&(S[t+2>>0]|0)==-65&&(e[o>>2]=t+3,a=e[h>>2]|0),R=w):R=r,w=e[o>>2]|0,t=w>>>0>>0;e:do if(t&a>>>0>>0)for(;;){t=S[w>>0]|0,F=t&255;do if(t<<24>>24>-1){if(F>>>0>d>>>0){t=2;break e}e[a>>2]=F,e[o>>2]=w+1}else{if((t&255)<194){t=2;break e}if((t&255)<224){if((R-w|0)<2){t=1;break e}if(t=N[w+1>>0]|0,(t&192|0)!=128){t=2;break e}if(t=t&63|F<<6&1984,t>>>0>d>>>0){t=2;break e}e[a>>2]=t,e[o>>2]=w+2;break}if((t&255)<240){if((R-w|0)<3){t=1;break e}switch(C=S[w+1>>0]|0,t=S[w+2>>0]|0,F|0){case 224:{if((C&-32)<<24>>24!=-96){t=2;break e}break}case 237:{if((C&-32)<<24>>24!=-128){t=2;break e}break}default:if((C&-64)<<24>>24!=-128){t=2;break e}}if(t=t&255,(t&192|0)!=128){t=2;break e}if(t=(C&255)<<6&4032|F<<12&61440|t&63,t>>>0>d>>>0){t=2;break e}e[a>>2]=t,e[o>>2]=w+3;break}if((t&255)>=245){t=2;break e}if((R-w|0)<4){t=1;break e}switch(E=S[w+1>>0]|0,t=S[w+2>>0]|0,C=S[w+3>>0]|0,F|0){case 240:{if((E+112&255)>=48){t=2;break e}break}case 244:{if((E&-16)<<24>>24!=-128){t=2;break e}break}default:if((E&-64)<<24>>24!=-128){t=2;break e}}if(D=t&255,(D&192|0)!=128){t=2;break e}if(t=C&255,(t&192|0)!=128){t=2;break e}if(t=(E&255)<<12&258048|F<<18&1835008|D<<6&4032|t&63,t>>>0>d>>>0){t=2;break e}e[a>>2]=t,e[o>>2]=w+4}while(!1);if(a=(e[h>>2]|0)+4|0,e[h>>2]=a,w=e[o>>2]|0,t=w>>>0>>0,!(t&a>>>0>>0)){_=38;break}}else _=38;while(!1);return(_|0)==38&&(t=t&1),t|0}function z3(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0;F=r,l&4|0&&(F-t|0)>2&&(S[t>>0]|0)==-17&&(S[t+1>>0]|0)==-69?l=(S[t+2>>0]|0)==-65?t+3|0:t:l=t;e:do if((o|0)!=0&l>>>0>>0){D=l,E=0;t:for(;;){l=S[D>>0]|0,C=l&255;do if(l<<24>>24>-1){if(C>>>0>a>>>0){l=D,h=42;break e}l=D+1|0}else{if((l&255)<194){l=D,h=42;break e}if((l&255)<224){if((F-D|0)<2){l=D,h=42;break e}if(l=N[D+1>>0]|0,(l&192|0)!=128){l=D,h=42;break e}if((l&63|C<<6&1984)>>>0>a>>>0){l=D,h=42;break e}l=D+2|0;break}if((l&255)<240){if(l=D,(F-l|0)<3){l=D,h=42;break e}switch(d=S[D+1>>0]|0,h=S[D+2>>0]|0,C|0){case 224:{if((d&-32)<<24>>24!=-96){h=20;break t}break}case 237:{if((d&-32)<<24>>24!=-128){h=22;break t}break}default:if((d&-64)<<24>>24!=-128){h=24;break t}}if(l=h&255,(l&192|0)!=128){l=D,h=42;break e}if(((d&255)<<6&4032|C<<12&61440|l&63)>>>0>a>>>0){l=D,h=42;break e}l=D+3|0;break}if((l&255)>=245){l=D,h=42;break e}if(l=D,(F-l|0)<4){l=D,h=42;break e}switch(w=S[D+1>>0]|0,h=S[D+2>>0]|0,d=S[D+3>>0]|0,C|0){case 240:{if((w+112&255)>=48){h=32;break t}break}case 244:{if((w&-16)<<24>>24!=-128){h=34;break t}break}default:if((w&-64)<<24>>24!=-128){h=36;break t}}if(h=h&255,(h&192|0)!=128){l=D,h=42;break e}if(l=d&255,(l&192|0)!=128){l=D,h=42;break e}if(((w&255)<<12&258048|C<<18&1835008|h<<6&4032|l&63)>>>0>a>>>0){l=D,h=42;break e}l=D+4|0}while(!1);if(E=E+1|0,E>>>0>>0&l>>>0>>0)D=l;else{h=42;break e}}if((h|0)==20){l=l-t|0;break}else if((h|0)==22){l=l-t|0;break}else if((h|0)==24){l=l-t|0;break}else if((h|0)==32){l=l-t|0;break}else if((h|0)==34){l=l-t|0;break}else if((h|0)==36){l=l-t|0;break}}else h=42;while(!1);return(h|0)==42&&(l=l-t|0),l|0}function G3(t){t=t|0,de(45196),de(45184),de(45172),de(45160),de(45148),de(45136),de(45124),de(45112),de(45100),de(45088),de(45076),de(45064),de(45052),de(45040)}function q3(t){t=t|0,Pt(45368),Pt(45356),Pt(45344),Pt(45332),Pt(45320),Pt(45308),Pt(45296),Pt(45284),Pt(45272),Pt(45260),Pt(45248),Pt(45236),Pt(45224),Pt(45212)}function W3(t){t=t|0,de(46e3),de(45988),de(45976),de(45964),de(45952),de(45940),de(45928),de(45916),de(45904),de(45892),de(45880),de(45868),de(45856),de(45844),de(45832),de(45820),de(45808),de(45796),de(45784),de(45772),de(45760),de(45748),de(45736),de(45724)}function H3(t){t=t|0,Pt(46292),Pt(46280),Pt(46268),Pt(46256),Pt(46244),Pt(46232),Pt(46220),Pt(46208),Pt(46196),Pt(46184),Pt(46172),Pt(46160),Pt(46148),Pt(46136),Pt(46124),Pt(46112),Pt(46100),Pt(46088),Pt(46076),Pt(46064),Pt(46052),Pt(46040),Pt(46028),Pt(46016)}function Q3(t){t=t|0,de(47104),de(47092),de(47080),de(47068),de(47056),de(47044),de(47032),de(47020),de(47008),de(46996),de(46984),de(46972),de(46960),de(46948),de(46936),de(46924),de(46912),de(46900),de(46888),de(46876),de(46864),de(46852),de(46840),de(46828)}function K3(t){t=t|0,Pt(47396),Pt(47384),Pt(47372),Pt(47360),Pt(47348),Pt(47336),Pt(47324),Pt(47312),Pt(47300),Pt(47288),Pt(47276),Pt(47264),Pt(47252),Pt(47240),Pt(47228),Pt(47216),Pt(47204),Pt(47192),Pt(47180),Pt(47168),Pt(47156),Pt(47144),Pt(47132),Pt(47120)}function Y3(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;C=b,b=b+32|0,w=C,h=e[t+8>>2]|0,o=e[t+4>>2]|0,h-o>>2>>>0>>0?(a=e[t>>2]|0,d=o-a>>2,l=d+r|0,l>>>0>1073741823&&pi(t),o=h-a|0,o>>2>>>0<536870911?(o=o>>1,o=o>>>0>>0?l:o):o=1073741823,j3(w,o,d,t+16|0),d=w+8|0,h=e[d>>2]|0,Jt(h|0,0,r<<2|0)|0,e[d>>2]=h+(r<<2),X3(t,w),Z3(w)):no(t,r),b=C}function no(t,r){t=t|0,r=r|0;var o=0;o=t+4|0,t=r,r=e[o>>2]|0;do e[r>>2]=0,r=(e[o>>2]|0)+4|0,e[o>>2]=r,t=t+-1|0;while(t|0)}function j3(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;e[t+12>>2]=0,e[t+16>>2]=a;do if(r)if(l=a+112|0,r>>>0<29&(S[l>>0]|0)==0){S[l>>0]=1;break}else{a=Xe(r<<2)|0;break}else a=0;while(!1);e[t>>2]=a,o=a+(o<<2)|0,e[t+8>>2]=o,e[t+4>>2]=o,e[t+12>>2]=a+(r<<2)}function X3(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0;a=e[t>>2]|0,h=t+4|0,o=r+4|0,l=(e[h>>2]|0)-a|0,d=(e[o>>2]|0)+(0-(l>>2)<<2)|0,e[o>>2]=d,o0(d|0,a|0,l|0)|0,l=e[t>>2]|0,e[t>>2]=e[o>>2],e[o>>2]=l,l=r+8|0,a=e[h>>2]|0,e[h>>2]=e[l>>2],e[l>>2]=a,l=t+8|0,t=r+12|0,a=e[l>>2]|0,e[l>>2]=e[t>>2],e[t>>2]=a,e[r>>2]=e[o>>2]}function Z3(t){t=t|0;var r=0,o=0,a=0;if(o=e[t+4>>2]|0,a=t+8|0,r=e[a>>2]|0,(r|0)!=(o|0)){do r=r+-4|0;while((r|0)!=(o|0));e[a>>2]=r}o=e[t>>2]|0;do if(o)if(r=e[t+16>>2]|0,(r|0)==(o|0)){S[r+112>>0]=0;break}else{he(o);break}while(!1)}function J3(t,r){t=t|0,r=r|0;var o=0;r>>>0>1073741823&&pi(t),o=t+128|0,r>>>0<29&(S[o>>0]|0)==0?(S[o>>0]=1,o=t+16|0):o=Xe(r<<2)|0,e[t+4>>2]=o,e[t>>2]=o,e[t+8>>2]=o+(r<<2)}function e5(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;do if((t|0)!=(r|0)){if(l=S0()|0,h=e[l>>2]|0,e[l>>2]=0,a=+Nr(t,d,b0()|0),t=e[l>>2]|0,t||(e[l>>2]=h),(e[d>>2]|0)!=(r|0)){e[o>>2]=4,a=0;break}(t|0)==34&&(e[o>>2]=4)}else e[o>>2]=4,a=0;while(!1);return b=w,+a}function t5(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;do if((t|0)!=(r|0)){if(l=S0()|0,h=e[l>>2]|0,e[l>>2]=0,a=+Nr(t,d,b0()|0),t=e[l>>2]|0,t||(e[l>>2]=h),(e[d>>2]|0)!=(r|0)){e[o>>2]=4,a=0;break}(t|0)==34&&(e[o>>2]=4)}else e[o>>2]=4,a=0;while(!1);return b=w,+a}function i5(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;do if((t|0)==(r|0))e[o>>2]=4,a=0;else{if(l=S0()|0,h=e[l>>2]|0,e[l>>2]=0,a=+Nr(t,d,b0()|0),t=e[l>>2]|0,t||(e[l>>2]=h),(e[d>>2]|0)!=(r|0)){e[o>>2]=4,a=0;break}(t|0)==34&&(e[o>>2]=4)}while(!1);return b=w,+a}function n5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;do if((t|0)!=(r|0)){if((S[t>>0]|0)==45){e[o>>2]=4,a=0,t=0;break}if(l=S0()|0,h=e[l>>2]|0,e[l>>2]=0,t=Dn(t,d,a,b0()|0)|0,a=e[l>>2]|0,a||(e[l>>2]=h),(e[d>>2]|0)!=(r|0)){e[o>>2]=4,a=0,t=0;break}(a|0)==34?(e[o>>2]=4,a=-1,t=-1):a=ye}else e[o>>2]=4,a=0,t=0;while(!1);return ye=a,b=w,t|0}function r5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;do if((t|0)!=(r|0)){if((S[t>>0]|0)==45){e[o>>2]=4,t=0;break}if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Dn(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,t=0;break}if(a>>>0>0|(a|0)==0&t>>>0>4294967295|(l|0)==34){e[o>>2]=4,t=-1;break}else break}else e[o>>2]=4,t=0;while(!1);return b=C,t|0}function s5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;do if((t|0)!=(r|0)){if((S[t>>0]|0)==45){e[o>>2]=4,t=0;break}if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Dn(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,t=0;break}if(a>>>0>0|(a|0)==0&t>>>0>4294967295|(l|0)==34){e[o>>2]=4,t=-1;break}else break}else e[o>>2]=4,t=0;while(!1);return b=C,t|0}function o5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;do if((t|0)!=(r|0)){if((S[t>>0]|0)==45){e[o>>2]=4,t=0;break}if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Dn(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,t=0;break}if(a>>>0>0|(a|0)==0&t>>>0>65535|(l|0)==34){e[o>>2]=4,t=-1;break}else{t=t&65535;break}}else e[o>>2]=4,t=0;while(!1);return b=C,t|0}function l5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;do if((t|0)!=(r|0)){if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Ao(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,a=0,t=0;break}if((l|0)==34)return e[o>>2]=4,w=(a|0)>0|(a|0)==0&t>>>0>0,ye=w?2147483647:-2147483648,b=C,(w?-1:0)|0}else e[o>>2]=4,a=0,t=0;while(!1);return ye=a,b=C,t|0}function u5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C;e:do if((t|0)==(r|0))e[o>>2]=4,t=0;else{if(h=S0()|0,d=e[h>>2]|0,e[h>>2]=0,t=Ao(t,w,a,b0()|0)|0,a=ye,l=e[h>>2]|0,l||(e[h>>2]=d),(e[w>>2]|0)!=(r|0)){e[o>>2]=4,t=0;break}do if((l|0)==34){if(e[o>>2]=4,(a|0)>0|(a|0)==0&t>>>0>0){t=2147483647;break e}}else{if((a|0)<-1|(a|0)==-1&t>>>0<2147483648){e[o>>2]=4;break}if((a|0)>0|(a|0)==0&t>>>0>2147483647){e[o>>2]=4,t=2147483647;break e}else break e}while(!1);t=-2147483648}while(!1);return b=C,t|0}function c5(){}function ii(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,a=r-a-(o>>>0>t>>>0|0)>>>0,ye=a,t-o>>>0|0|0}function Jt(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;if(a=t+o|0,(o|0)>=20){if(r=r&255,h=t&3,d=r|r<<8|r<<16|r<<24,l=a&-4,h)for(h=t+4-h|0;(t|0)<(h|0);)S[t>>0]=r,t=t+1|0;for(;(t|0)<(l|0);)e[t>>2]=d,t=t+4|0}for(;(t|0)<(a|0);)S[t>>0]=r,t=t+1|0;return t-o|0}function $0(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,o=t+o>>>0,ye=r+a+(o>>>0>>0|0)>>>0,o|0|0}function Di(t,r,o){return t=t|0,r=r|0,o=o|0,(o|0)<32?(ye=r>>>o,t>>>o|(r&(1<>>o-32|0)}function o0(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if((o|0)>=4096)return qo(t|0,r|0,o|0)|0;if(a=t|0,(t&3)==(r&3)){for(;t&3;){if(!o)return a|0;S[t>>0]=S[r>>0]|0,t=t+1|0,r=r+1|0,o=o-1|0}for(;(o|0)>=4;)e[t>>2]=e[r>>2],t=t+4|0,r=r+4|0,o=o-4|0}for(;(o|0)>0;)S[t>>0]=S[r>>0]|0,t=t+1|0,r=r+1|0,o=o-1|0;return a|0}function v0(t,r,o){return t=t|0,r=r|0,o=o|0,(o|0)<32?(ye=r<>>32-o,t<0;)t=t-1|0,r=r-1|0,o=o-1|0,S[t>>0]=S[r>>0]|0;t=a}else o0(t,r,o)|0;return t|0}function AA(t,r,o){return t=t|0,r=r|0,o=o|0,(o|0)<32?(ye=r>>o,t>>>o|(r&(1<>o-32|0)}function ro(t){t=t|0;var r=0;return r=S[X+(t&255)>>0]|0,(r|0)<8?r|0:(r=S[X+(t>>8&255)>>0]|0,(r|0)<8?r+8|0:(r=S[X+(t>>16&255)>>0]|0,(r|0)<8?r+16|0:(S[X+(t>>>24)>>0]|0)+24|0))}function f5(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;return h=t&65535,l=r&65535,o=ie(l,h)|0,a=t>>>16,t=(o>>>16)+(ie(l,a)|0)|0,l=r>>>16,r=ie(l,h)|0,ye=(t>>>16)+(ie(l,a)|0)+(((t&65535)+r|0)>>>16)|0,t+r<<16|o&65535|0|0}function vA(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;return D=r>>31|((r|0)<0?-1:0)<<1,C=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1,h=a>>31|((a|0)<0?-1:0)<<1,l=((a|0)<0?-1:0)>>31|((a|0)<0?-1:0)<<1,w=ii(D^t,C^r,D,C)|0,d=ye,t=h^D,r=l^C,ii((wn(w,d,ii(h^o,l^a,h,l)|0,ye,0)|0)^t,ye^r,t,r)|0}function xA(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;return l=b,b=b+16|0,w=l|0,d=r>>31|((r|0)<0?-1:0)<<1,h=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1,D=a>>31|((a|0)<0?-1:0)<<1,C=((a|0)<0?-1:0)>>31|((a|0)<0?-1:0)<<1,t=ii(d^t,h^r,d,h)|0,r=ye,wn(t,r,ii(D^o,C^a,D,C)|0,ye,w)|0,a=ii(e[w>>2]^d,e[w+4>>2]^h,d,h)|0,o=ye,b=l,ye=o,a|0}function Qi(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return l=t,h=o,o=f5(l,h)|0,t=ye,ye=(ie(r,h)|0)+(ie(a,l)|0)+t|t&0,o|0|0|0}function xn(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,wn(t,r,o,a,0)|0}function Cr(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return h=b,b=b+16|0,l=h|0,wn(t,r,o,a,l)|0,b=h,ye=e[l+4>>2]|0,e[l>>2]|0|0}function wn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(E=t,C=r,D=C,d=o,R=a,w=R,!D)return h=(l|0)!=0,w?h?(e[l>>2]=t|0,e[l+4>>2]=r&0,R=0,l=0,ye=R,l|0):(R=0,l=0,ye=R,l|0):(h&&(e[l>>2]=(E>>>0)%(d>>>0),e[l+4>>2]=0),R=0,l=(E>>>0)/(d>>>0)>>>0,ye=R,l|0);h=(w|0)==0;do if(d){if(!h){if(h=(st(w|0)|0)-(st(D|0)|0)|0,h>>>0<=31){F=h+1|0,w=31-h|0,r=h-31>>31,d=F,t=E>>>(F>>>0)&r|D<>>(F>>>0)&r,h=0,w=E<>2]=t|0,e[l+4>>2]=C|r&0,R=0,l=0,ye=R,l|0):(R=0,l=0,ye=R,l|0)}if(h=d-1|0,h&d){w=(st(d|0)|0)+33-(st(D|0)|0)|0,z=64-w|0,F=32-w|0,C=F>>31,_=w-32|0,r=_>>31,d=w,t=F-1>>31&D>>>(_>>>0)|(D<>>(w>>>0))&r,r=r&D>>>(w>>>0),h=E<>>(_>>>0))&C|E<>31;break}return l&&(e[l>>2]=h&E,e[l+4>>2]=0),(d|0)==1?(_=C|r&0,z=t|0|0,ye=_,z|0):(z=ro(d|0)|0,_=D>>>(z>>>0)|0,z=D<<32-z|E>>>(z>>>0)|0,ye=_,z|0)}else{if(h)return l&&(e[l>>2]=(D>>>0)%(d>>>0),e[l+4>>2]=0),_=0,z=(D>>>0)/(d>>>0)>>>0,ye=_,z|0;if(!E)return l&&(e[l>>2]=0,e[l+4>>2]=(D>>>0)%(w>>>0)),_=0,z=(D>>>0)/(w>>>0)>>>0,ye=_,z|0;if(h=w-1|0,!(h&w))return l&&(e[l>>2]=t|0,e[l+4>>2]=h&D|r&0),_=0,z=D>>>((ro(w|0)|0)>>>0),ye=_,z|0;if(h=(st(w|0)|0)-(st(D|0)|0)|0,h>>>0<=30){r=h+1|0,w=31-h|0,d=r,t=D<>>(r>>>0),r=D>>>(r>>>0),h=0,w=E<>2]=t|0,e[l+4>>2]=C|r&0,_=0,z=0,ye=_,z|0):(_=0,z=0,ye=_,z|0)}while(!1);if(!d)D=w,C=0,w=0;else{F=o|0|0,E=R|a&0,D=$0(F|0,E|0,-1,-1)|0,o=ye,C=w,w=0;do a=C,C=h>>>31|C<<1,h=w|h<<1,a=t<<1|a>>>31|0,R=t>>>31|r<<1|0,ii(D,o,a,R)|0,z=ye,_=z>>31|((z|0)<0?-1:0)<<1,w=_&1,t=ii(a,R,_&F,(((z|0)<0?-1:0)>>31|((z|0)<0?-1:0)<<1)&E)|0,r=ye,d=d-1|0;while(d|0);D=C,C=0}return d=0,l&&(e[l>>2]=t,e[l+4>>2]=r),_=(h|0)>>>31|(D|d)<<1|(d<<1|h>>>31)&0|C,z=(h<<1|0)&-2|w,ye=_,z|0}function h5(t,r,o,a,l,h,d,w){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,HS[t&15](r|0,o|0,a|0,l|0,h|0,d|0,w|0)|0}function d5(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,Pn[t&15](r|0,o|0,a|0,l|0,h|0)}function p5(t,r,o,a,l,h,d){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=+d,QS[t&3](r|0,o|0,a|0,l|0,h|0,+d)|0}function m5(t,r){t=t|0,r=r|0,Rt[t&255](r|0)}function g5(t,r,o){t=t|0,r=r|0,o=o|0,t0[t&127](r|0,o|0)}function S5(t,r,o,a,l,h,d){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,on[t&63](r|0,o|0,a|0,l|0,h|0,d|0)|0}function A5(t,r){return t=t|0,r=r|0,Et[t&127](r|0)|0}function v5(t,r,o,a,l,h,d,w,C,D,E,F){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,KS[t&3](r|0,o|0,a|0,l|0,h|0,d|0,w|0,C|0,D|0,E|0,F|0)|0}function x5(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,Yt[t&63](r|0,o|0,a|0)|0}function w5(t,r,o,a,l,h,d,w,C,D,E,F,R,_,z,H){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,R=R|0,_=_|0,z=z|0,H=H|0,YS[t&3](r|0,o|0,a|0,l|0,h|0,d|0,w|0,C|0,D|0,E|0,F|0,R|0,_|0,z|0,H|0)}function y5(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,Vi[t&15](r|0,o|0,a|0,l|0,h|0,d|0)}function C5(t,r,o,a,l,h,d,w){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,jS[t&7](r|0,o|0,a|0,l|0,h|0,d|0,w|0)}function T5(t,r,o,a,l,h,d,w,C,D,E){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,XS[t&7](r|0,o|0,a|0,l|0,h|0,d|0,w|0,C|0,D|0,E|0)}function I5(t,r,o){return t=t|0,r=r|0,o=o|0,U0[t&63](r|0,o|0)|0}function k5(t,r,o,a,l,h){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,an[t&31](r|0,o|0,a|0,l|0,h|0)|0}function E5(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,+ZS[t&3](r|0,o|0,a|0)}function D5(t){return t=t|0,JS[t&15]()|0}function b5(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,_r[t&31](r|0,o|0,a|0,l|0)|0}function F5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,Ln[t&15](r|0,o|0,a|0)}function N5(t){t=t|0,Vo[t&7]()}function R5(t,r,o,a,l,h,d,w,C){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,Ci[t&15](r|0,o|0,a|0,l|0,h|0,d|0,w|0,C|0)|0}function M5(t,r,o,a,l,h){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=+h,eA[t&7](r|0,o|0,a|0,l|0,+h)|0}function _5(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,On[t&63](r|0,o|0,a|0,l|0)}function bi(t,r,o,a,l,h,d){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,Ye(0),0}function sn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,Ye(1)}function so(t,r,o,a,l,h){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=+h,Ye(2),0}function e0(t){t=t|0,Ye(3)}function Tr(t,r){t=t|0,r=r|0,Ye(4)}function F0(t,r,o,a,l,h){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,Ye(5),0}function r0(t){return t=t|0,Ye(6),0}function P5(t){return t=t|0,Br(t|0)|0}function L5(t){return t=t|0,Gr(t|0)|0}function O5(t){return t=t|0,jo(t|0)|0}function oo(t,r,o,a,l,h,d,w,C,D,E){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,Ye(7),0}function C0(t,r,o){return t=t|0,r=r|0,o=o|0,Ye(8),0}function ao(t,r,o,a,l,h,d,w,C,D,E,F,R,_,z){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0,F=F|0,R=R|0,_=_|0,z=z|0,Ye(9)}function Fi(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,Ye(10)}function yn(t,r,o,a,l,h,d){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,Ye(11)}function Cn(t,r,o,a,l,h,d,w,C,D){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,Ye(12)}function L0(t,r){return t=t|0,r=r|0,Ye(13),0}function di(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,Ye(14),0}function $5(t,r,o){return t=t|0,r=r|0,o=o|0,Ye(15),0}function Li(){return Ye(16),0}function Ki(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,Ye(17),0}function B5(t,r,o){t=t|0,r=r|0,o=o|0,Ye(18)}function V5(t,r,o){t=t|0,r=r|0,o=o|0,Qt(t|0,r|0,o|0)}function lo(){Ye(19)}function U5(){Jo()}function z5(){ei()}function G5(){Ur()}function Yi(t,r,o,a,l,h,d,w){return t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,Ye(20),0}function Tn(t,r,o,a,l){return t=t|0,r=r|0,o=o|0,a=a|0,l=+l,Ye(21),0}function H0(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,Ye(22)}function q5(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=b,b=b+32|0,w=D,m0(w,255,0),C=t+152|0,(e[w+4>>2]|0)==(e[C>>2]|0)&&(e[w+8>>2]|0)==(e[t+156>>2]|0)&&(e[w+12>>2]|0)==(e[t+160>>2]|0)){C=e[8900]|0,e[t+4580>>2]=C+(((e[8901]|0)-C|0)>>>1),b=D;return}for(o=t+4584|0,a=t+4588|0,l=e[a>>2]|0,r=e[o>>2]|0,h=l-r|0,h>>>0>=512?h>>>0>512&&(d=r+512|0,(l|0)!=(d|0))&&(e[a>>2]=d):(j0(o,512-h|0),r=e[o>>2]|0),w=t+4580|0,e[w>>2]=r+256,d=t+160|0,l=t+156|0,h=-256;;){if(r=e[d>>2]|0,(h|0)>(0-r|0))if(o=e[l>>2]|0,(h|0)>(0-o|0))if(a=e[C>>2]|0,(h|0)>(0-a|0))if((h|0)>=0){if((h|0)<1){S[(e[w>>2]|0)+h>>0]=0,h=1;continue}(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1}else r=-1;else r=-2;else r=-3;else r=-4;if(S[(e[w>>2]|0)+h>>0]=r,h=h+1|0,(h|0)==256)break}b=D}function W5(t){t=t|0;var r=0,o=0;e[t>>2]=35660,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),t=t+88|0,r=e[t>>2]|0,e[t>>2]=0,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r)}function H5(t){t=t|0;var r=0,o=0;if(e[t>>2]=35660,r=e[t+4608>>2]|0,r&&(o=t+4612|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),e[t>>2]=36736,r=e[t+92>>2]|0,r&&(o=t+96|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r)),o=t+88|0,r=e[o>>2]|0,e[o>>2]=0,!r){he(t);return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),he(t)}function Q5(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;if(G=b,b=b+352|0,$=G+328|0,P=G+192|0,o=G+343|0,a=G+342|0,l=G+341|0,h=G+340|0,R=G+176|0,w=G+168|0,C=G+160|0,D=G+152|0,K=G,z=G+136|0,e[t+28>>2]|0&&(e[t+20>>2]|0)!=1){if(_=t+4|0,H=t+32|0,d=e[H>>2]|0,!d){if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[o>>0]|0,$e(44,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}if(t=e[t+12>>2]|0,(t|0)==8)switch(d|0){case 1:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[a>>0]|0,$e(45,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[l>>0]|0,$e(46,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(48)|0,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],S[$>>0]=S[h>>0]|0,$e(47,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=P+56|0,l=P+4|0,e[P>>2]=36160,e[d>>2]=36180,m=0,Ae(62,P+56|0,l|0),G=m,m=0,G&1&&(L=j()|0,tt(d),le(L|0)),e[P+128>>2]=0,e[P+132>>2]=-1,e[P>>2]=36200,e[P+56>>2]=36220,m=0,ue(180,l|0),G=m,m=0;do if(G&1)t=j()|0;else{if(e[l>>2]=36236,h=P+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[P+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),G=m,m=0,G&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,P|0,49007,21)|0,$=m,m=0;do if(!($&1)&&(m=0,E=Ne(36,t|0,e[H>>2]|0)|0,$=m,m=0,!($&1))&&(m=0,Ve(28,E|0,50997,18)|0,$=m,m=0,!($&1))){if(a=Ct(16)|0,m=0,Ae(64,R|0,l|0),$=m,m=0,$&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,R|0),$=m,m=0,$&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(R),!o)break;It(a|0)}else L=34;while(!1);(L|0)==34&&(t=j()|0),e[P>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}switch((t|0)<=8&&(t=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,t|0,8,35648),L=m,m=0,L&1||Qt(t|0,824,96),L=j()|0,It(t|0),le(L|0)),o=16-t|0,d|0){case 1:{if(t=Xe(60)|0,e[w>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[w>>2],e[$+4>>2]=e[w+4>>2],$e(41,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 2:{if(t=Xe(60)|0,e[C>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[C>>2],e[$+4>>2]=e[C+4>>2],$e(42,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}case 3:{if(t=Xe(60)|0,e[D>>2]=o,m=0,e[P>>2]=e[r>>2],e[P+4>>2]=e[r+4>>2],e[P+8>>2]=e[r+8>>2],e[$>>2]=e[D>>2],e[$+4>>2]=e[D+4>>2],$e(43,t|0,P|0,_|0,$|0),L=m,m=0,!(L&1))return L=t,b=G,L|0;L=j()|0,he(t),le(L|0)}default:{d=K+56|0,l=K+4|0,e[K>>2]=36160,e[d>>2]=36180,m=0,Ae(62,K+56|0,l|0),P=m,m=0,P&1&&(L=j()|0,tt(d),le(L|0)),e[K+128>>2]=0,e[K+132>>2]=-1,e[K>>2]=36200,e[K+56>>2]=36220,m=0,ue(180,l|0),P=m,m=0;do if(P&1)t=j()|0;else{if(e[l>>2]=36236,h=K+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[K+52>>2]=16,e[$>>2]=0,e[$+4>>2]=0,e[$+8>>2]=0,m=0,Ae(63,l|0,$|0),P=m,m=0,P&1){t=j()|0,de($),de(h),wt(l);break}de($),m=0,t=Ve(28,K|0,49007,21)|0,P=m,m=0;do if(!(P&1)&&(m=0,F=Ne(36,t|0,e[H>>2]|0)|0,P=m,m=0,!(P&1))&&(m=0,Ve(28,F|0,50997,18)|0,P=m,m=0,!(P&1))){if(a=Ct(16)|0,m=0,Ae(64,z|0,l|0),P=m,m=0,P&1)t=j()|0;else if(!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,$e(36,a|0,9,35648,z|0),P=m,m=0,P&1?o=1:(m=0,ve(6,a|0,824,96),m=0,o=0),t=j()|0,de(z),!o)break;It(a|0)}else L=64;while(!1);(L|0)==64&&(t=j()|0),e[K>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),L=t,le(L|0)}while(!1);L=t,tt(d),le(L|0)}}}return o=e[r+4>>2]|0,a=Xe(16)|0,t=e[t+16>>2]|0,o?(e[a>>2]=36108,e[a+4>>2]=o,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0):(L=e[r>>2]|0,e[a>>2]=36132,e[a+4>>2]=L,e[a+8>>2]=1,e[a+12>>2]=t,L=a,b=G,L|0)}function K5(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;d=b,b=b+32|0,C=d,m0(C,e[t+128>>2]|0,e[t+136>>2]|0),w=e[r+4>>2]|0,h=e[r+8>>2]|0,h=h|0?h:e[C+8>>2]|0,l=e[r+12>>2]|0,l=l|0?l:e[C+12>>2]|0,o=e[r+16>>2]|0,a=e[C+16>>2]|0,e[t+176>>2]=w|0?w:e[C+4>>2]|0,e[t+180>>2]=h,e[t+184>>2]=l,t6(t),l=t+132|0,r=(e[l>>2]|0)+32|0,r=(r|0)<128?2:(r|0)/64|0,h=0;do e[t+188+(h*12|0)>>2]=r,e[t+188+(h*12|0)+4>>2]=0,k[t+188+(h*12|0)+8>>1]=0,k[t+188+(h*12|0)+10>>1]=1,h=h+1|0;while((h|0)!=365);w=(e[l>>2]|0)+32|0,w=(w|0)<128?2:(w|0)/64|0,C=(o|0?o:a)&255,e[t+4568>>2]=w,e[t+4572>>2]=0,S[t+4576>>0]=C,S[t+4577>>0]=1,S[t+4578>>0]=0,e[t+4580>>2]=w,e[t+4584>>2]=1,S[t+4588>>0]=C,S[t+4589>>0]=1,S[t+4590>>0]=0,e[t+4592>>2]=0,b=d}function Y5(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;for(d=t+88|0,h=e[r>>2]|0,e[r>>2]=0,r=e[d>>2]|0,e[d>>2]=h,r&&Rt[e[(e[r>>2]|0)+4>>2]&255](r),d=a+4|0,h=e[d>>2]|0,S[t+4620>>0]=l&1,r=t+156|0,e[r>>2]=e[o>>2],e[r+4>>2]=e[o+4>>2],e[r+8>>2]=e[o+8>>2],e[r+12>>2]=e[o+12>>2],Y0(t,a),j5(t),r=e[t+116>>2]|0,t=e[t+112>>2]|0;l=r+-1|0,o=(S[l>>0]|0)==-1?7:8,!((t|0)<(o|0));)r=l,t=t-o|0;r=r-h|0,l=e[d>>2]|0,l&&(e[d>>2]=l+r,a=a+8|0,e[a>>2]=(e[a>>2]|0)-r)}function j5(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0;ne=b,b=b+32|0,re=ne+12|0,J=ne,w=t+172|0,L=(e[w>>2]|0)+4|0,(e[t+28>>2]|0)==1?C=e[t+20>>2]|0:C=1,r=ie(C<<1,L)|0,e[re>>2]=0,ce=re+4|0,e[ce>>2]=0,e[re+8>>2]=0;e:do if(r){if((r|0)<0&&(m=0,ue(178,re|0),ae=m,m=0,ae&1)||(P=6),(P|0)==6&&(m=0,o=ge(67,r|0)|0,ae=m,m=0,!(ae&1))){for(e[ce>>2]=o,e[re>>2]=o,e[re+8>>2]=o+r;;)if(S[o>>0]=0,o=(e[ce>>2]|0)+1|0,e[ce>>2]=o,r=r+-1|0,!r)break e}o=j()|0,r=e[re>>2]|0,r||le(o|0),(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),le(o|0)}while(!1);e[J>>2]=0,ae=J+4|0,e[ae>>2]=0,e[J+8>>2]=0;do if(!C)P=19;else{if(C>>>0>1073741823&&(m=0,ue(178,J|0),$=m,m=0,$&1)||(P=17),(P|0)==17&&(a=C<<2,m=0,l=ge(67,a|0)|0,$=m,m=0,!($&1))){e[J>>2]=l,P=l+(C<<2)|0,e[J+8>>2]=P,Jt(l|0,0,a|0)|0,e[ae>>2]=P,P=19;break}o=j()|0,r=e[J>>2]|0,a=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}while(!1);if((P|0)==19){D=t+8|0,r=e[D>>2]|0;e:do if((r|0)>0){if(E=t+4596|0,F=ie(C,L)|0,R=F+1|0,_=t+4600|0,z=t+160|0,H=t+168|0,K=t+164|0,G=t+156|0,$=t+88|0,d=t+4592|0,(C|0)>0)h=0;else{for(h=0;;){if(l=e[re>>2]|0,o=l+1|0,e[E>>2]=o,a=l+R|0,e[_>>2]=a,h&1?(e[E>>2]=a,e[_>>2]=o,o=1):o=R,C=e[z>>2]|0,(C|0)<=(h|0)&&(h|0)<((e[H>>2]|0)+C|0)){if(C=e[$>>2]|0,m=0,$e(e[(e[C>>2]|0)+8>>2]|0,C|0,l+(o+((e[G>>2]|0)-F))|0,e[K>>2]|0,L|0),C=m,m=0,C&1)break;r=e[D>>2]|0}if(h=h+1|0,(h|0)>=(r|0)){P=50;break e}}o=j()|0;break}t:for(;;){o=e[re>>2]|0,r=o+1|0,e[E>>2]=r,o=o+R|0,e[_>>2]=o,h&1&&(e[E>>2]=o,e[_>>2]=r,r=o),l=e[J>>2]|0,o=r,a=0;do{if(e[d>>2]=e[l+(a<<2)>>2],P=e[w>>2]|0,S[o+P>>0]=S[o+(P+-1)>>0]|0,S[(e[_>>2]|0)+-1>>0]=S[e[E>>2]>>0]|0,m=0,Ae(83,t|0,0),P=m,m=0,P&1){P=38;break t}l=e[J>>2]|0,e[l+(a<<2)>>2]=e[d>>2],o=(e[E>>2]|0)+L|0,e[E>>2]=o,r=e[_>>2]|0,e[_>>2]=r+L,a=a+1|0}while((a|0)<(C|0));if(P=e[z>>2]|0,(P|0)<=(h|0)&&(h|0)<((e[H>>2]|0)+P|0)&&(P=e[$>>2]|0,m=0,$e(e[(e[P>>2]|0)+8>>2]|0,P|0,r+(L+((e[G>>2]|0)-F))|0,e[K>>2]|0,L|0),P=m,m=0,P&1)){P=30;break}if(h=h+1|0,(h|0)>=(e[D>>2]|0)){P=50;break e}}if((P|0)==30){o=j()|0;break}else if((P|0)==38){o=j()|0;break}}else P=50;while(!1);do if((P|0)==50){if(m=0,ue(183,t|0),t=m,m=0,t&1){o=j()|0;break}if(r=e[J>>2]|0,o=r,r&&(a=e[ae>>2]|0,(a|0)!=(r|0)&&(e[ae>>2]=a+(~((a+-4-o|0)>>>2)<<2)),he(r)),r=e[re>>2]|0,!r){b=ne;return}(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),b=ne;return}while(!1);r=e[J>>2]|0,a=r,r&&(l=e[ae>>2]|0,(l|0)!=(r|0)&&(e[ae>>2]=l+(~((l+-4-a|0)>>>2)<<2)),he(r))}r=e[re>>2]|0,r||le(o|0),(e[ce>>2]|0)!=(r|0)&&(e[ce>>2]=r),he(r),le(o|0)}function X5(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0;if(R=t+4596|0,o=e[R>>2]|0,K=t+172|0,r=e[K>>2]|0,!((r|0)<=0))for(_=t+4600|0,z=t+4604|0,H=t+4592|0,w=o,h=N[o+-1>>0]|0,o=N[o>>0]|0,F=0;D=e[_>>2]|0,d=S[D+(F+-1)>>0]|0,E=d&255,l=F+1|0,a=N[w+l>>0]|0,C=e[z>>2]|0,w=o-h|0,h=h-E|0,C=((((S[C+(a-o)>>0]|0)*9|0)+(S[C+w>>0]|0)|0)*9|0)+(S[C+h>>0]|0)|0,D=D+F|0,C?(r=o-E>>31,(r^h|0)<0?r=o:r=E+((r^w|0)<0?0:w)|0,E=Z5(t,C,N[D>>0]|0,r,0)|0,S[(e[_>>2]|0)+F>>0]=E):(r=J5(t,d,D,r-F|0)|0,o=r+F|0,(o|0)!=(e[K>>2]|0)&&(E=e6(t,E,N[(e[R>>2]|0)+o>>0]|0)|0,S[(e[_>>2]|0)+o>>0]=E,E=e[H>>2]|0,e[H>>2]=(E|0)<1?0:E+-1|0,r=r+1|0),l=r+F|0,a=e[R>>2]|0,o=N[a+(l+-1)>>0]|0,a=N[a+l>>0]|0),r=e[K>>2]|0,!((r|0)<=(l|0));)w=e[R>>2]|0,h=o,o=a,F=l}function Z5(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(z=r>>31,C=(z^r)-z|0,R=t+188+(C*12|0)+10|0,o=k[R>>1]|0,F=t+188+(C*12|0)|0,l=e[F>>2]|0,(o|0)<(l|0))if((o<<1|0)<(l|0))if((o<<2|0)<(l|0))if((o<<3|0)<(l|0))if((o<<4|0)<(l|0))for(r=5;(o<>1]^z)-z+a|0,_=t+128|0,l=e[_>>2]|0,(o&l|0)==(o|0)?D=o:D=l&~(o>>31),o=t+112|0,(e[o>>2]|0)<8&&P0(t),l=t+108|0,a=e[l>>2]|0,h=a>>>24,d=e[2832+(r<<11)+(h<<3)+4>>2]|0,d?(e[o>>2]=(e[o>>2]|0)-d,e[l>>2]=a<>2]|0):(w=e[t+148>>2]|0,l=e[t+140>>2]|0,o=X0(t)|0,(o|0)<(w+-1-l|0)?r&&(o=(l0(t,r)|0)+(o<>31^o>>1,(((o|0)>-1?o:0-o|0)|0)>65535&&(o=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,o|0,5,35648),t=m,m=0,t&1?(t=j()|0,It(o|0),le(t|0)):Qt(o|0,824,96))),w=t+136|0,a=e[w>>2]|0,r?d=o:(a?l=0:l=(e[t+188+(C*12|0)+4>>2]<<1)+-1+(k[R>>1]|0)>>31,d=l^o),r=e[t+152>>2]|0,l=(e[F>>2]|0)+((d|0)>-1?d:0-d|0)|0,h=t+188+(C*12|0)+4|0,o=(e[h>>2]|0)+(ie(a<<1|1,d)|0)|0,a=k[R>>1]|0,(a|0)==(r|0)&&(l=l>>1,o=o>>1,a=r>>1),e[F>>2]=l,r=a+1|0,k[R>>1]=r,l=r+o|0,(l|0)>=1?(o|0)>0&&(o=o-r|0,R=k[E>>1]|0,k[E>>1]=(R<<16>>16<127&1)+(R&65535),o=(o|0)>0?0:o):(o=k[E>>1]|0,k[E>>1]=(o&65535)-(o<<16>>16>-128&1),o=(l|0)>(~a|0)?l:0-a|0),e[h>>2]=o,r=e[w>>2]|0,a=r<<1|1,l=(ie(a,(d^z)-z|0)|0)+D|0,(l|0)>=(0-r|0)?(o=e[_>>2]|0,(o+r|0)<(l|0)&&(l=l-(ie(e[t+132>>2]|0,a)|0)|0)):(l=(ie(e[t+132>>2]|0,a)|0)+l|0,o=e[_>>2]|0),(l&o|0)==(l|0)?(t=l,t=t&255,t|0):(t=o&~(l>>31),t=t&255,t|0)}function J5(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;for(w=t+112|0,C=t+108|0,D=t+4592|0,l=e[w>>2]|0,h=0;;){if((l|0)<1&&(P0(t),l=e[w>>2]|0),d=e[C>>2]|0,l=l+-1|0,e[w>>2]=l,e[C>>2]=d<<1,(d|0)>=0){E=8;break}if(d=e[D>>2]|0,F=1<>2],R=a-h|0,R=(F|0)<(R|0)?F:R,h=R+h|0,(R|0)==(F|0)&&(e[D>>2]=(d|0)>30?31:d+1|0),(h|0)==(a|0)){l=a;break}}return(E|0)==8&&((h|0)!=(a|0)?(l=e[D>>2]|0,(l+-4|0)>>>0<28?l=l0(t,e[36476+(l<<2)>>2]|0)|0:l=0,l=l+h|0,(l|0)>(a|0)&&(l=Ct(16)|0,!(S[8]|0)&&kt(8)|0&&(Nt(72,35648,Q|0)|0,Dt(8)),m=0,ve(7,l|0,5,35648),R=m,m=0,R&1?(R=j()|0,It(l|0),le(R|0)):Qt(l|0,824,96))):l=a),(l|0)<=0||Jt(o|0,r|0,l|0)|0,l|0}function e6(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return h=r-o|0,d=t+128|0,a=t+136|0,(((h|0)>-1?h:0-h|0)|0)>(e[a>>2]|0)?(r=ie(uo(t,t+4568|0)|0,o-r>>31|1)|0,l=e[a>>2]|0,h=l<<1|1,r=(ie(r,h)|0)+o|0,(r|0)>=(0-l|0)?(a=e[d>>2]|0,(a+l|0)<(r|0)&&(r=r-(ie(e[t+132>>2]|0,h)|0)|0)):(r=(ie(e[t+132>>2]|0,h)|0)+r|0,a=e[d>>2]|0),(r&a|0)==(r|0)?(t=r,t=t&255,t|0):(t=a&~(r>>31),t=t&255,t|0)):(o=uo(t,t+4580|0)|0,h=e[a>>2]|0,l=h<<1|1,r=(ie(l,o)|0)+r|0,(r|0)>=(0-h|0)?(a=e[d>>2]|0,(a+h|0)<(r|0)&&(r=r-(ie(e[t+132>>2]|0,l)|0)|0)):(r=(ie(e[t+132>>2]|0,l)|0)+r|0,a=e[d>>2]|0),(r&a|0)==(r|0)?(t=r,t=t&255,t|0):(t=a&~(r>>31),t=t&255,t|0))}function uo(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0;if(D=r+9|0,o=N[D>>0]|0,h=r+4|0,l=(ie(o>>>1,e[h>>2]|0)|0)+(e[r>>2]|0)|0,(o|0)<(l|0)){a=0;do o=o<<1,a=a+1|0;while((o|0)<(l|0))}else a=0;d=e[t+148>>2]|0,w=e[36476+(e[t+4592>>2]<<2)>>2]|0,o=e[t+140>>2]|0,l=X0(t)|0;do if((l|0)<(d+-2-w-o|0))if(a){w=(l0(t,a)|0)+(l<>2]|0,l=w+a|0,d=l&1,o=d,h=1,l=(d+l|0)/2|0;break}else{a=e[h>>2]|0,t=a+l|0,o=t&1,t=(o+t|0)/2|0,C=8;break}else l=(l0(t,o)|0)+1|0,d=e[h>>2]|0,t=l+d|0,o=t&1,t=(o+t|0)/2|0,a?(w=l,h=1,l=t,a=d):(a=d,C=8);while(!1);return(C|0)==8&&(w=l,h=N[r+10>>0]<<1>>>0>=(N[D>>0]|0)>>>0,l=t),l=(o|0)!=0^h?l:0-l|0,(l|0)<0&&(C=r+10|0,S[C>>0]=(N[C>>0]|0)+1),o=(w+1-a>>1)+(e[r>>2]|0)|0,e[r>>2]=o,a=S[D>>0]|0,a<<24>>24!=(S[r+8>>0]|0)?(r=a,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0):(e[r>>2]=o>>1,C=(a&255)>>>1,S[D>>0]=C,r=r+10|0,S[r>>0]=(N[r>>0]|0)>>>1,r=C,r=r&255,r=r+1|0,r=r&255,S[D>>0]=r,l|0)}function t6(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;R=b,b=b+32|0,a=R,F=t+136|0;e:do if(e[F>>2]|0)r=t+144|0;else if(o=e[t+128>>2]|0,r=t+144|0,(o|0)==((1<>2])+-1|0)&&(m0(a,o,0),(e[a+4>>2]|0)==(e[t+176>>2]|0))&&(e[a+8>>2]|0)==(e[t+180>>2]|0)&&(e[a+12>>2]|0)==(e[t+184>>2]|0))switch(e[r>>2]|0){case 8:{F=e[8900]|0,e[t+4604>>2]=F+(((e[8901]|0)-F|0)>>>1),b=R;return}case 10:{F=e[8903]|0,e[t+4604>>2]=F+(((e[8904]|0)-F|0)>>>1),b=R;return}case 12:{F=e[8906]|0,e[t+4604>>2]=F+(((e[8907]|0)-F|0)>>>1),b=R;return}case 16:{F=e[8909]|0,e[t+4604>>2]=F+(((e[8910]|0)-F|0)>>>1),b=R;return}default:break e}while(!1);if(E=1<>2],o=t+4608|0,a=E<<1,l=t+4612|0,h=e[l>>2]|0,r=e[o>>2]|0,d=h-r|0,a>>>0<=d>>>0?a>>>0>>0&&(w=r+a|0,(h|0)!=(w|0))&&(e[l>>2]=w):(j0(o,a-d|0),r=e[o>>2]|0),D=t+4604|0,e[D>>2]=r+E,r=0-E|0,(E|0)<=(r|0)){b=R;return}w=t+184|0,C=t+180|0,d=t+176|0,h=r;do r=e[w>>2]|0,(h|0)>(0-r|0)?(o=e[C>>2]|0,(h|0)>(0-o|0)?(a=e[d>>2]|0,(h|0)>(0-a|0)?(l=e[F>>2]|0,(h|0)>=(0-l|0)?(l|0)<(h|0)?(a|0)<=(h|0)?(o|0)>(h|0)?r=2:r=(r|0)>(h|0)?3:4:r=1:r=0:r=-1):r=-2):r=-3):r=-4,S[(e[D>>2]|0)+h>>0]=r,h=h+1|0;while((h|0)!=(E|0));b=R}function i6(t){t=t|0,he(t)}function n6(t){return t=t|0,50767}function r6(t,r,o){t=t|0,r=r|0,o=o|0,yi(t,50754,12)}function s6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0;z=b,b=b+16|0,H=z,e[H>>2]=0,K=H+4|0,e[K>>2]=0,e[H+8>>2]=0,R=H+8|0,m=0,l=ge(67,1)|0,F=m,m=0;e:do if(!(F&1)&&(F=l+1|0,S[l>>0]=o,e[H>>2]=l,e[K>>2]=F,e[R>>2]=F,m=0,Ae(84,H|0,r&65535|0),F=m,m=0,!(F&1))&&(m=0,Ae(84,H|0,t&65535|0),F=m,m=0,!(F&1))){if(D=a&255,l=e[K>>2]|0,o=e[R>>2]|0,l>>>0>=o>>>0){if(r=e[H>>2]|0,t=r,d=l-t+1|0,(d|0)<0){if(m=0,ue(178,H|0),F=m,m=0,F&1){_=52;break}t=e[H>>2]|0,o=e[R>>2]|0,r=t}if(C=r,l=o-C|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,o=e[K>>2]|0,w=o-C|0,l?_=12:(l=0,d=0)):(w=e[K>>2]|0,l=2147483647,o=w,w=w-C|0,_=12),(_|0)==12&&(m=0,d=ge(67,l|0)|0,F=m,m=0,F&1)){_=52;break}S[d+w>>0]=D,E=o-C|0,F=d+(w-E)|0,o0(F|0,r|0,E|0)|0,e[H>>2]=F,e[K>>2]=d+(w+1),e[R>>2]=d+l,t&&he(t)}else S[l>>0]=D,e[K>>2]=(e[K>>2]|0)+1;t:do if((a|0)>0){for(F=0;;){if(F=F+1|0,E=F&255,l=e[K>>2]|0,r=e[R>>2]|0,l>>>0>=r>>>0){if(t=e[H>>2]|0,o=t,d=l-o+1|0,(d|0)<0){if(m=0,ue(178,H|0),D=m,m=0,D&1)break;t=e[H>>2]|0,o=t,r=e[R>>2]|0}if(D=t,l=r-D|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,r=e[K>>2]|0,w=r-D|0,l?_=25:(C=0,d=0)):(w=e[K>>2]|0,l=2147483647,r=w,w=w-D|0,_=25),(_|0)==25){if(_=0,m=0,d=ge(67,l|0)|0,C=m,m=0,C&1)break;C=l}S[d+w>>0]=E,l=d+(w+1)|0,D=r-D|0,E=d+(w-D)|0,o0(E|0,t|0,D|0)|0,e[H>>2]=E,e[K>>2]=l,e[R>>2]=d+C,o&&(he(o),l=e[K>>2]|0)}else S[l>>0]=E,l=(e[K>>2]|0)+1|0,e[K>>2]=l;if(o=e[R>>2]|0,l>>>0>=o>>>0){if(r=e[H>>2]|0,t=r,d=l-t+1|0,(d|0)<0){if(m=0,ue(178,H|0),E=m,m=0,E&1)break;t=e[H>>2]|0,o=e[R>>2]|0,r=t}if(D=r,l=o-D|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,d=e[K>>2]|0,w=d-D|0,l?_=36:(C=0,o=0)):(w=e[K>>2]|0,l=2147483647,d=w,w=w-D|0,_=36),(_|0)==36){if(_=0,m=0,o=ge(67,l|0)|0,E=m,m=0,E&1)break;C=l}S[o+w>>0]=17,l=o+(w+1)|0,D=d-D|0,E=o+(w-D)|0,o0(E|0,r|0,D|0)|0,e[H>>2]=E,e[K>>2]=l,e[R>>2]=o+C,t&&(he(t),l=e[K>>2]|0)}else S[l>>0]=17,l=(e[K>>2]|0)+1|0,e[K>>2]=l;if(o=e[R>>2]|0,l>>>0>=o>>>0){if(r=e[H>>2]|0,t=r,d=l-t+1|0,(d|0)<0){if(m=0,ue(178,H|0),E=m,m=0,E&1)break;t=e[H>>2]|0,o=e[R>>2]|0,r=t}if(C=r,l=o-C|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,o=e[K>>2]|0,w=o-C|0,l?_=48:(l=0,d=0)):(w=e[K>>2]|0,l=2147483647,o=w,w=w-C|0,_=48),(_|0)==48&&(_=0,m=0,d=ge(67,l|0)|0,E=m,m=0,E&1))break;S[d+w>>0]=0,D=o-C|0,E=d+(w-D)|0,o0(E|0,r|0,D|0)|0,e[H>>2]=E,e[K>>2]=d+(w+1),e[R>>2]=d+l,t&&he(t)}else S[l>>0]=0,e[K>>2]=(e[K>>2]|0)+1;if((F|0)>=(a|0))break t}h=j()|0;break e}while(!1);if(m=0,w=ge(67,20)|0,a=m,m=0,a&1)_=52;else{e[w>>2]=36800,S[w+4>>0]=-9,t=w+8|0,e[t>>2]=0,d=w+12|0,e[d>>2]=0,o=w+16|0,e[o>>2]=0,l=e[K>>2]|0,a=e[H>>2]|0,r=l-a|0;do if((l|0)!=(a|0)){if((r|0)<0&&(m=0,ue(178,t|0),a=m,m=0,a&1)||(_=62),(_|0)==62&&(m=0,h=ge(67,r|0)|0,a=m,m=0,!(a&1))){if(e[d>>2]=h,e[t>>2]=h,e[o>>2]=h+r,l=e[H>>2]|0,o=e[K>>2]|0,(l|0)==(o|0))break;do S[h>>0]=S[l>>0]|0,h=(e[d>>2]|0)+1|0,e[d>>2]=h,l=l+1|0;while((l|0)!=(o|0));l=e[H>>2]|0;break}h=j()|0,l=e[t>>2]|0,l&&((e[d>>2]|0)!=(l|0)&&(e[d>>2]=l),he(l)),he(w);break e}while(!1);return l?((e[K>>2]|0)!=(l|0)&&(e[K>>2]=l),he(l),b=z,w|0):(b=z,w|0)}}else _=52;while(!1);return(_|0)==52&&(h=j()|0),l=e[H>>2]|0,l||le(h|0),(e[K>>2]|0)!=(l|0)&&(e[K>>2]=l),he(l),le(h|0),0}function o6(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0;K=b,b=b+32|0,_=K+28|0,$=K+16|0,H=K+4|0,z=K,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0,F=Xe(5)|0,e[$>>2]=F,R=$+8|0,e[R>>2]=F+5,S[F>>0]=74,S[F+1>>0]=70,S[F+2>>0]=73,S[F+3>>0]=70,S[F+4>>0]=0,e[P>>2]=F+5,m=0,Ae(84,$|0,e[t>>2]&65535|0),F=m,m=0;e:do if(F&1)G=43;else{if(D=e[t+4>>2]&255,r=e[P>>2]|0,a=e[R>>2]|0,r>>>0>=a>>>0){if(l=e[$>>2]|0,h=l,d=r-h+1|0,(d|0)<0){if(m=0,ue(178,$|0),F=m,m=0,F&1){G=43;break}h=e[$>>2]|0,a=e[R>>2]|0,l=h}if(C=l,r=a-C|0,r>>>0<1073741823?(r=r<<1,r=r>>>0>>0?d:r,a=e[P>>2]|0,w=a-C|0,r?G=10:(r=0,d=0)):(w=e[P>>2]|0,r=2147483647,a=w,w=w-C|0,G=10),(G|0)==10&&(m=0,d=ge(67,r|0)|0,F=m,m=0,F&1)){G=43;break}S[d+w>>0]=D,E=a-C|0,F=d+(w-E)|0,o0(F|0,l|0,E|0)|0,e[$>>2]=F,e[P>>2]=d+(w+1),e[R>>2]=d+r,h&&he(h)}else S[r>>0]=D,e[P>>2]=(e[P>>2]|0)+1;if(m=0,Ae(84,$|0,e[t+8>>2]&65535|0),F=m,m=0,!(F&1)&&(m=0,Ae(84,$|0,e[t+12>>2]&65535|0),F=m,m=0,!(F&1))){if(F=t+16|0,E=e[F>>2]&255,r=e[P>>2]|0,l=e[R>>2]|0,r>>>0>=l>>>0){if(h=e[$>>2]|0,a=h,d=r-a+1|0,(d|0)<0){if(m=0,ue(178,$|0),D=m,m=0,D&1){G=43;break}h=e[$>>2]|0,a=h,l=e[R>>2]|0}if(D=h,r=l-D|0,r>>>0<1073741823?(r=r<<1,r=r>>>0>>0?d:r,d=e[P>>2]|0,w=d-D|0,r?G=23:(C=0,l=0)):(w=e[P>>2]|0,r=2147483647,d=w,w=w-D|0,G=23),(G|0)==23)if(m=0,l=ge(67,r|0)|0,C=m,m=0,C&1){G=43;break}else C=r;S[l+w>>0]=E,r=l+(w+1)|0,D=d-D|0,E=l+(w-D)|0,o0(E|0,h|0,D|0)|0,e[$>>2]=E,e[P>>2]=r,e[R>>2]=l+C,a&&(he(a),r=e[P>>2]|0)}else S[r>>0]=E,r=(e[P>>2]|0)+1|0,e[P>>2]=r;if(E=t+20|0,D=e[E>>2]&255,a=e[R>>2]|0,r>>>0>=a>>>0){if(l=e[$>>2]|0,h=l,d=r-h+1|0,(d|0)<0){if(m=0,ue(178,$|0),C=m,m=0,C&1){G=43;break}h=e[$>>2]|0,a=e[R>>2]|0,l=h}if(C=l,r=a-C|0,r>>>0<1073741823?(r=r<<1,r=r>>>0>>0?d:r,a=e[P>>2]|0,w=a-C|0,r?G=34:(r=0,d=0)):(w=e[P>>2]|0,r=2147483647,a=w,w=w-C|0,G=34),(G|0)==34&&(m=0,d=ge(67,r|0)|0,L=m,m=0,L&1)){G=43;break}S[d+w>>0]=D,D=a-C|0,L=d+(w-D)|0,o0(L|0,l|0,D|0)|0,e[$>>2]=L,e[P>>2]=d+(w+1),e[R>>2]=d+r,h&&he(h)}else S[r>>0]=D,e[P>>2]=(e[P>>2]|0)+1;r=e[F>>2]|0;do if((r|0)>0){if(!(e[t+24>>2]|0))if(e[z>>2]=e[P>>2],L=0+(ie(r*3|0,e[E>>2]|0)|0)|0,m=0,e[_>>2]=e[z>>2],Pe(15,$|0,_|0,0,L|0)|0,L=m,m=0,L&1){G=43;break e}else break;if(a=Ct(16)|0,m=0,ve(5,H|0,50792,57),L=m,m=0,L&1)r=j()|0;else if(m=0,r=Ce(1)|0,L=m,m=0,!(L&1)&&(m=0,$e(36,a|0,1,r|0,H|0),L=m,m=0,!(L&1))?(m=0,ve(6,a|0,824,96),m=0,o=0):o=1,r=j()|0,de(H),!o){o=r;break e}It(a|0),o=r;break e}while(!1);if(m=0,w=ge(67,20)|0,L=m,m=0,L&1)G=43;else{e[w>>2]=36800,S[w+4>>0]=-32,h=w+8|0,e[h>>2]=0,d=w+12|0,e[d>>2]=0,a=w+16|0,e[a>>2]=0,r=e[P>>2]|0,L=e[$>>2]|0,l=r-L|0;do if((r|0)!=(L|0)){if((l|0)<0&&(m=0,ue(178,h|0),L=m,m=0,L&1)||(G=53),(G|0)==53&&(m=0,o=ge(67,l|0)|0,L=m,m=0,!(L&1))){if(e[d>>2]=o,e[h>>2]=o,e[a>>2]=o+l,r=e[$>>2]|0,a=e[P>>2]|0,(r|0)==(a|0))break;do S[o>>0]=S[r>>0]|0,o=(e[d>>2]|0)+1|0,e[d>>2]=o,r=r+1|0;while((r|0)!=(a|0));r=e[$>>2]|0;break}r=j()|0,o=e[h>>2]|0,o&&((e[d>>2]|0)!=(o|0)&&(e[d>>2]=o),he(o)),he(w),G=44;break e}while(!1);return r?((e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),b=K,w|0):(b=K,w|0)}}else G=43}while(!1);return(G|0)==43&&(r=j()|0,G=44),(G|0)==44&&(o=r),r=e[$>>2]|0,r||le(o|0),(e[P>>2]|0)!=(r|0)&&(e[P>>2]=r),he(r),le(o|0),0}function co(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0;w=b,b=b+16|0,D=w,e[D>>2]=0,E=D+4|0,e[E>>2]=0,e[D+8>>2]=0,m=0,r=ge(67,1)|0,d=m,m=0;e:do if(!(d&1)&&(d=r+1|0,S[r>>0]=1,e[D>>2]=r,e[E>>2]=d,e[D+8>>2]=d,m=0,Ae(84,D|0,e[t>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,Ae(84,D|0,e[t+4>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,Ae(84,D|0,e[t+8>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,Ae(84,D|0,e[t+12>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,Ae(84,D|0,e[t+16>>2]&65535|0),d=m,m=0,!(d&1))&&(m=0,C=ge(67,20)|0,d=m,m=0,!(d&1))){e[C>>2]=36800,S[C+4>>0]=-8,l=C+8|0,e[l>>2]=0,d=C+12|0,e[d>>2]=0,t=C+16|0,e[t>>2]=0,r=e[E>>2]|0,F=e[D>>2]|0,a=r-F|0;do if((r|0)!=(F|0)){if((a|0)<0&&(m=0,ue(178,l|0),F=m,m=0,F&1)||(h=11),(h|0)==11&&(m=0,o=ge(67,a|0)|0,F=m,m=0,!(F&1))){if(e[d>>2]=o,e[l>>2]=o,e[t>>2]=o+a,r=e[D>>2]|0,t=e[E>>2]|0,(r|0)==(t|0))break;do S[o>>0]=S[r>>0]|0,o=(e[d>>2]|0)+1|0,e[d>>2]=o,r=r+1|0;while((r|0)!=(t|0));r=e[D>>2]|0;break}o=j()|0,r=e[l>>2]|0,r&&((e[d>>2]|0)!=(r|0)&&(e[d>>2]=r),he(r)),he(C);break e}while(!1);return r?((e[E>>2]|0)!=(r|0)&&(e[E>>2]=r),he(r),b=w,C|0):(b=w,C|0)}else h=25;while(!1);return(h|0)==25&&(o=j()|0),r=e[D>>2]|0,r||le(o|0),(e[E>>2]|0)!=(r|0)&&(e[E>>2]=r),he(r),le(o|0),0}function a6(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;return h=Xe(5)|0,S[h>>0]=109,S[h+1>>0]=114,S[h+2>>0]=102,S[h+3>>0]=120,S[h+4>>0]=t,m=0,l=ge(67,20)|0,a=m,m=0,a&1&&(l=j()|0,he(h),le(l|0)),e[l>>2]=36800,S[l+4>>0]=-24,t=l+8|0,e[t>>2]=0,r=l+12|0,e[r>>2]=0,o=l+16|0,e[o>>2]=0,m=0,a=ge(67,5)|0,d=m,m=0,d&1?(d=j()|0,he(l),he(h),le(d|0),0):(e[r>>2]=a,e[t>>2]=a,e[o>>2]=a+5,S[a>>0]=109,d=(e[r>>2]|0)+1|0,e[r>>2]=d,a=h+1|0,S[d>>0]=S[a>>0]|0,d=(e[r>>2]|0)+1|0,e[r>>2]=d,a=a+1|0,S[d>>0]=S[a>>0]|0,d=(e[r>>2]|0)+1|0,e[r>>2]=d,a=a+1|0,S[d>>0]=S[a>>0]|0,d=(e[r>>2]|0)+1|0,e[r>>2]=d,S[d>>0]=S[a+1>>0]|0,e[r>>2]=(e[r>>2]|0)+1,he(h),l|0)}function l6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0;G=b,b=b+16|0,$=G,e[$>>2]=0,P=$+4|0,e[P>>2]=0,e[$+8>>2]=0,H=$+8|0,m=0,l=ge(67,1)|0,z=m,m=0;e:do if(z&1)K=29;else{if(w=l+1|0,z=w,S[l>>0]=r,e[$>>2]=l,e[P>>2]=z,e[H>>2]=z,(r|0)>0){d=w,z=0;do{if(_=z+t&255,d>>>0>=w>>>0){if(l=e[$>>2]|0,C=l,d=d-C+1|0,(d|0)<0){if(m=0,ue(178,$|0),R=m,m=0,R&1){K=28;break}C=e[$>>2]|0,w=e[H>>2]|0,R=C}else R=l;if(F=R,l=w-F|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,w=e[P>>2]|0,D=w-F|0,l?K=13:(E=0,d=0)):(D=e[P>>2]|0,l=2147483647,w=D,D=D-F|0,K=13),(K|0)==13)if(K=0,m=0,d=ge(67,l|0)|0,E=m,m=0,E&1){K=28;break}else E=l;S[d+D>>0]=_,l=d+(D+1)|0,F=w-F|0,_=d+(D-F)|0,o0(_|0,R|0,F|0)|0,e[$>>2]=_,e[P>>2]=l,e[H>>2]=d+E,C&&(he(C),l=e[P>>2]|0)}else S[d>>0]=_,l=(e[P>>2]|0)+1|0,e[P>>2]=l;if(w=e[H>>2]|0,l>>>0>=w>>>0){if(C=e[$>>2]|0,d=C,D=l-d+1|0,(D|0)<0){if(m=0,ue(178,$|0),_=m,m=0,_&1){K=28;break}C=e[$>>2]|0,d=C,w=e[H>>2]|0}if(F=C,l=w-F|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?D:l,D=e[P>>2]|0,w=D-F|0,l?K=24:(l=0,E=0)):(w=e[P>>2]|0,l=2147483647,D=w,w=w-F|0,K=24),(K|0)==24&&(K=0,m=0,E=ge(67,l|0)|0,_=m,m=0,_&1)){K=28;break}S[E+w>>0]=0,R=D-F|0,_=E+(w-R)|0,o0(_|0,C|0,R|0)|0,e[$>>2]=_,e[P>>2]=E+(w+1),e[H>>2]=E+l,d&&he(d)}else S[l>>0]=0,e[P>>2]=(e[P>>2]|0)+1;z=z+1|0,d=e[P>>2]|0,w=e[H>>2]|0}while((z|0)<(r|0));if((K|0)==28){h=j()|0;break}l=o&255,d>>>0>>0?(S[d>>0]=l,d=(e[P>>2]|0)+1|0,e[P>>2]=d):K=37}else d=w,l=o&255,K=37;if((K|0)==37){if(C=e[$>>2]|0,D=C,E=d-D+1|0,(E|0)<0){if(m=0,ue(178,$|0),o=m,m=0,o&1){K=29;break}D=e[$>>2]|0,w=e[H>>2]|0,C=D}if(_=C,d=w-_|0,d>>>0<1073741823?(d=d<<1,d=d>>>0>>0?E:d,E=e[P>>2]|0,F=E-_|0,d?K=43:(R=0,w=0)):(F=e[P>>2]|0,d=2147483647,E=F,F=F-_|0,K=43),(K|0)==43)if(m=0,w=ge(67,d|0)|0,o=m,m=0,o&1){K=29;break}else R=d;S[w+F>>0]=l,d=w+(F+1)|0,t=E-_|0,o=w+(F-t)|0,o0(o|0,C|0,t|0)|0,e[$>>2]=o,e[P>>2]=d,e[H>>2]=w+R,D&&(he(D),d=e[P>>2]|0)}if(_=a&255,l=e[H>>2]|0,d>>>0>=l>>>0){if(w=e[$>>2]|0,C=w,d=d-C+1|0,(d|0)<0){if(m=0,ue(178,$|0),a=m,m=0,a&1){K=29;break}C=e[$>>2]|0,l=e[H>>2]|0,w=C}if(R=w,l=l-R|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?d:l,D=e[P>>2]|0,E=D-R|0,l?K=54:(F=0,d=0)):(E=e[P>>2]|0,l=2147483647,D=E,E=E-R|0,K=54),(K|0)==54)if(m=0,d=ge(67,l|0)|0,a=m,m=0,a&1){K=29;break}else F=l;S[d+E>>0]=_,l=d+(E+1)|0,o=D-R|0,a=d+(E-o)|0,o0(a|0,w|0,o|0)|0,e[$>>2]=a,e[P>>2]=l,e[H>>2]=d+F,C&&(he(C),l=e[P>>2]|0)}else S[d>>0]=_,l=(e[P>>2]|0)+1|0,e[P>>2]=l;if(d=e[H>>2]|0,l>>>0>=d>>>0){if(w=e[$>>2]|0,C=w,D=l-C+1|0,(D|0)<0){if(m=0,ue(178,$|0),a=m,m=0,a&1){K=29;break}C=e[$>>2]|0,d=e[H>>2]|0,w=C}if(F=w,l=d-F|0,l>>>0<1073741823?(l=l<<1,l=l>>>0>>0?D:l,d=e[P>>2]|0,E=d-F|0,l?K=65:(l=0,D=0)):(E=e[P>>2]|0,l=2147483647,d=E,E=E-F|0,K=65),(K|0)==65&&(m=0,D=ge(67,l|0)|0,a=m,m=0,a&1)){K=29;break}S[D+E>>0]=0,o=d-F|0,a=D+(E-o)|0,o0(a|0,w|0,o|0)|0,e[$>>2]=a,e[P>>2]=D+(E+1),e[H>>2]=D+l,C&&he(C)}else S[l>>0]=0,e[P>>2]=(e[P>>2]|0)+1;if(m=0,E=ge(67,20)|0,H=m,m=0,H&1)K=29;else{e[E>>2]=36800,S[E+4>>0]=-38,C=E+8|0,e[C>>2]=0,D=E+12|0,e[D>>2]=0,d=E+16|0,e[d>>2]=0,l=e[P>>2]|0,H=e[$>>2]|0,w=l-H|0;do if((l|0)!=(H|0)){if((w|0)<0&&(m=0,ue(178,C|0),H=m,m=0,H&1)||(K=72),(K|0)==72&&(m=0,h=ge(67,w|0)|0,H=m,m=0,!(H&1))){if(e[D>>2]=h,e[C>>2]=h,e[d>>2]=h+w,l=e[$>>2]|0,d=e[P>>2]|0,(l|0)==(d|0))break;do S[h>>0]=S[l>>0]|0,h=(e[D>>2]|0)+1|0,e[D>>2]=h,l=l+1|0;while((l|0)!=(d|0));l=e[$>>2]|0;break}h=j()|0,l=e[C>>2]|0,l&&((e[D>>2]|0)!=(l|0)&&(e[D>>2]=l),he(l)),he(E);break e}while(!1);return l?((e[P>>2]|0)!=(l|0)&&(e[P>>2]=l),he(l),b=G,E|0):(b=G,E|0)}}while(!1);return(K|0)==29&&(h=j()|0),l=e[$>>2]|0,l||le(h|0),(e[P>>2]|0)!=(l|0)&&(e[P>>2]=l),he(l),le(h|0),0}function u6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;if(F=(r&65535)>>>8&255,R=t+4|0,o=e[R>>2]|0,_=t+8|0,a=e[_>>2]|0,o>>>0>=a>>>0?(l=e[t>>2]|0,h=l,d=o-h+1|0,(d|0)<0&&(pi(t),h=e[t>>2]|0,a=e[_>>2]|0,l=h),E=l,o=a-E|0,o>>>0<1073741823?(o=o<<1,o=o>>>0>>0?d:o,d=e[R>>2]|0,a=d-E|0,o?z=8:(D=0,C=0,w=a,o=d)):(a=e[R>>2]|0,o=2147483647,d=a,a=a-E|0,z=8),(z|0)==8&&(D=o,C=Xe(o)|0,w=a,o=d),S[C+w>>0]=F,a=C+(w+1)|0,E=o-E|0,F=C+(w-E)|0,o0(F|0,l|0,E|0)|0,e[t>>2]=F,e[R>>2]=a,e[_>>2]=C+D,h&&(he(h),a=e[R>>2]|0)):(S[o>>0]=F,a=(e[R>>2]|0)+1|0,e[R>>2]=a),E=r&255,o=e[_>>2]|0,a>>>0>>0){S[a>>0]=E,e[R>>2]=(e[R>>2]|0)+1;return}l=e[t>>2]|0,h=l,a=a-h+1|0,(a|0)<0&&(pi(t),h=e[t>>2]|0,o=e[_>>2]|0,l=h),D=l,o=o-D|0,o>>>0<1073741823?(o=o<<1,o=o>>>0>>0?a:o,d=e[R>>2]|0,a=d-D|0,o?z=18:(C=0,w=0,o=d)):(a=e[R>>2]|0,o=2147483647,d=a,a=a-D|0,z=18),(z|0)==18&&(C=o,w=Xe(o)|0,o=d),S[w+a>>0]=E,r=o-D|0,z=w+(a-r)|0,o0(z|0,l|0,r|0)|0,e[t>>2]=z,e[R>>2]=w+(a+1),e[_>>2]=w+C,h&&he(h)}function c6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(l=e[t>>2]|0,z=e[r>>2]|0,_=z,C=l,F=o,D=a-F|0,(D|0)<=0)return H=z,H|0;if(R=t+8|0,r=e[R>>2]|0,H=t+4|0,E=e[H>>2]|0,h=E,(D|0)<=(r-h|0)){if(w=h-_|0,(D|0)>(w|0)){if(d=o+w|0,(d|0)==(a|0))r=E;else{h=d,r=E;do S[r>>0]=S[h>>0]|0,r=(e[H>>2]|0)+1|0,e[H>>2]=r,h=h+1|0;while((h|0)!=(a|0))}if((w|0)>0)w=r;else return H=z,H|0}else w=E,d=a;if(l=w-(l+(D-C+_))|0,r=z+l|0,r>>>0>>0){h=w;do S[h>>0]=S[r>>0]|0,r=r+1|0,h=(e[H>>2]|0)+1|0,e[H>>2]=h;while((r|0)!=(E|0))}return vn(w+(0-l)|0,z|0,l|0)|0,vn(z|0,o|0,d-F|0)|0,H=z,H|0}if(h=h-C+D|0,(h|0)<0&&(pi(t),r=e[R>>2]|0,l=e[t>>2]|0),d=l,r=r-d|0,r>>>0<1073741823?(r=r<<1,r=r>>>0>>0?h:r,h=_-d|0,r?w=15:(d=0,D=0)):(r=2147483647,h=_-d|0,w=15),(w|0)==15&&(d=r,D=Xe(r)|0),C=D+h|0,r=C,w=D+d|0,(o|0)!=(a|0)){l=o,d=C;do S[d>>0]=S[l>>0]|0,d=r+1|0,r=d,l=l+1|0;while((l|0)!=(a|0));l=e[t>>2]|0}return o=_-l|0,a=D+(h-o)|0,o0(a|0,l|0,o|0)|0,_=(e[H>>2]|0)-_|0,o=r,o0(o|0,z|0,_|0)|0,r=e[t>>2]|0,e[t>>2]=a,e[H>>2]=o+_,e[R>>2]=w,r?(he(r),H=C,H|0):(H=C,H|0)}function f6(t){t=t|0;var r=0;e[t>>2]=36800,r=e[t+8>>2]|0,r&&(t=t+12|0,(e[t>>2]|0)!=(r|0)&&(e[t>>2]=r),he(r))}function h6(t){t=t|0;var r=0,o=0;if(e[t>>2]=36800,r=e[t+8>>2]|0,!r){he(t);return}o=t+12|0,(e[o>>2]|0)!=(r|0)&&(e[o>>2]=r),he(r),he(t)}function d6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;if(ui(r,-1),ui(r,S[t+4>>0]|0),l=t+12|0,a=t+8|0,t=(e[l>>2]|0)-(e[a>>2]|0)+2|0,ui(r,(t&65535)>>>8&255),ui(r,t&255),t=e[a>>2]|0,(e[l>>2]|0)!=(t|0)){o=0;do ui(r,S[t+o>>0]|0),o=o+1|0,t=e[a>>2]|0;while(o>>>0<((e[l>>2]|0)-t|0)>>>0)}}function ui(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;if(l=e[t+4>>2]|0,l)if(o=l+24|0,a=e[o>>2]|0,(a|0)==(e[l+28>>2]|0)){U0[e[(e[l>>2]|0)+52>>2]&63](l,r&255)|0;return}else{e[o>>2]=a+1,S[a>>0]=r;return}if(o=t+16|0,a=e[o>>2]|0,a>>>0<(e[t+12>>2]|0)>>>0){e[o>>2]=a+1,S[(e[t+8>>2]|0)+a>>0]=r;return}o=Ct(16)|0,m=0,a=Ce(1)|0,r=m,m=0,r&1&&(r=j()|0,It(o|0),le(r|0)),m=0,ve(7,o|0,4,a|0),r=m,m=0,r&1?(r=j()|0,It(o|0),le(r|0)):Qt(o|0,824,96)}function m0(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,l=(r|0)<4095?(r+128|0)/256|0:16,h=(o*3|0)+2+l|0,a=o+1|0,h=(h|0)<(a|0)|(h|0)>(r|0)?a:h,e[t+4>>2]=h,a=(l<<2|3)+(o*5|0)|0,a=(a|0)>(r|0)|(a|0)<(h|0)?h:a,e[t+8>>2]=a,o=(o*7|0)+4+(l*17|0)|0,e[t+12>>2]=(o|0)>(r|0)|(o|0)<(a|0)?a:o,e[t>>2]=r,e[t+16>>2]=64}function p6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;D=b,b=b+128|0,w=D+100|0,a=D+16|0,o=D+112|0,C=D+4|0,E=D,l=a,h=t+20|0,d=l+84|0;do e[l>>2]=e[h>>2],l=l+4|0,h=h+4|0;while((l|0)<(d|0));e[a+16>>2]=e[t+4>>2],h=wa(o,a,t+56|0)|0,o=e[(e[h>>2]|0)+16>>2]|0,t=t+8|0,m=0,e[w>>2]=e[t>>2],e[w+4>>2]=e[t+4>>2],e[w+8>>2]=e[t+8>>2],o=Ne(o|0,h|0,w|0)|0,t=m,m=0;do if(t&1)o=j()|0;else{if(l=r+4|0,e[C>>2]=e[l>>2],e[C+4>>2]=e[l+4>>2],e[C+8>>2]=e[l+8>>2],l=r+16|0,t=e[l>>2]|0,w=C+8|0,e[w>>2]=(e[w>>2]|0)-t,w=C+4|0,e[w>>2]=(e[w>>2]|0)+t,w=e[(e[h>>2]|0)+12>>2]|0,e[E>>2]=o,m=0,o=Pe(w|0,h|0,E|0,C|0,(S[r>>0]|0?(e[r+8>>2]|0)+t|0:0)|0)|0,C=m,m=0,C&1){if(o=j()|0,a=e[E>>2]|0,e[E>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}if(a=e[E>>2]|0,e[E>>2]=0,a&&Rt[e[(e[a>>2]|0)+4>>2]&255](a),e[r+4>>2]|0||(e[l>>2]=(e[l>>2]|0)+o),!h){b=D;return}Rt[e[(e[h>>2]|0)+4>>2]&255](h),b=D;return}while(!1);h||le(o|0),Rt[e[(e[h>>2]|0)+4>>2]&255](h),le(o|0)}function m6(t,r){t=t|0,r=r|0,e[t>>2]=e[r>>2],e[t+4>>2]=e[r+4>>2],e[t+8>>2]=e[r+8>>2],S[t+12>>0]=0,r=t+16|0,t=r+100|0;do e[r>>2]=0,r=r+4|0;while((r|0)<(t|0))}function g6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0;G=b,b=b+32|0,K=G+4|0,R=G+16|0,$=G,fo(t),_=t+16|0,l=e[t+24>>2]|0;e:do if((l+-2|0)>>>0<=14)if(z=t+40|0,o=e[z>>2]|0,o>>>0>2)o=5;else{switch(H=t+32|0,h=e[H>>2]|0,h|0){case 0:{o=1;break e}case 4:{if((o|0)==2){o=2;break e}break}case 3:break;default:if(o){o=2;break e}}if(F=t+100|0,o=t+108|0,a=e[o>>2]|0,(a|0)<1?(a=e[_>>2]|0,e[o>>2]=a,o=e[t+20>>2]|0,e[t+112>>2]=o):o=e[t+112>>2]|0,C=Qi(o|0,((o|0)<0)<<31>>31|0,a|0,((a|0)<0)<<31>>31|0)|0,w=(l+7|0)/8|0,w=Qi(C|0,ye|0,w|0,((w|0)<0)<<31>>31|0)|0,C=r+4|0,o=e[C>>2]|0,d=r+8|0,o|0&&(D=e[d>>2]|0,E=Qi(h|0,((h|0)<0)<<31>>31|0,w|0,ye|0)|0,l=ye,0<(l|0)|(l|0)==0&D>>>0>>0)&&(o=Ct(16)|0,m=0,a=Ce(1)|0,$=m,m=0,!($&1)&&(m=0,ve(7,o|0,3,a|0),$=m,m=0,!($&1))&&Qt(o|0,824,96),$=j()|0,It(o|0),le($|0)),D=t+52|0,E=t+12|0,(h|0)>0)h=0;else{b=G;return}for(;;){if(ho(t,(h|0)==0),a=va(R,_,D)|0,l=e[(e[a>>2]|0)+8>>2]|0,m=0,e[K>>2]=e[r>>2],e[K+4>>2]=e[r+4>>2],e[K+8>>2]=e[r+8>>2],l=Ne(l|0,a|0,K|0)|0,P=m,m=0,P&1){l=32;break}if(P=e[(e[a>>2]|0)+16>>2]|0,e[$>>2]=l,m=0,Me(P|0,a|0,$|0,F|0,t|0,(S[E>>0]|0)!=0|0),P=m,m=0,P&1){l=30;break}if(l=e[$>>2]|0,e[$>>2]=0,l&&Rt[e[(e[l>>2]|0)+4>>2]&255](l),o?(o=o+w|0,e[C>>2]=o,e[d>>2]=(e[d>>2]|0)-w):o=0,l=(e[z>>2]|0)==0,h=(l&1)+h|0,a&&Rt[e[(e[a>>2]|0)+4>>2]&255](a),!l){l=34;break}if((h|0)>=(e[H>>2]|0)){l=34;break}}if((l|0)==30)o=j()|0,l=e[$>>2]|0,e[$>>2]=0,l&&Rt[e[(e[l>>2]|0)+4>>2]&255](l);else if((l|0)==32)o=j()|0,a||(P=o,le(P|0));else if((l|0)==34){b=G;return}Rt[e[(e[a>>2]|0)+4>>2]&255](a),P=o,le(P|0)}else o=2;while(!1);a=Ct(16)|0,m=0,l=Ce(1)|0,P=m,m=0,!(P&1)&&(m=0,ve(7,a|0,o|0,l|0),P=m,m=0,!(P&1))&&Qt(a|0,824,96),P=j()|0,It(a|0),le(P|0)}function fo(t){t=t|0;var r=0,o=0,a=0,l=0;if((Ir(t)|0)<<24>>24!=-40&&(r=Ct(16)|0,m=0,o=Ce(1)|0,l=m,m=0,!(l&1)&&(m=0,ve(7,r|0,5,o|0),l=m,m=0,!(l&1))&&Qt(r|0,824,96),l=j()|0,It(r|0),le(l|0)),r=Ir(t)|0,r<<24>>24!=-38){for(;a=((d0(t)|0)&255)<<8,a=a|(d0(t)|0)&255,r=A6(t,r)|0,o=-2-r+a|0,!((o|0)<0);){if((o|0)>0){r=a+-2-r|0,o=0;do d0(t)|0,o=o+1|0;while((o|0)!=(r|0))}if(r=Ir(t)|0,r<<24>>24==-38){l=8;break}}(l|0)!=8&&(r=Ct(16)|0,m=0,o=Ce(1)|0,l=m,m=0,!(l&1)&&(m=0,ve(7,r|0,5,o|0),l=m,m=0,!(l&1))&&Qt(r|0,824,96),l=j()|0,It(r|0),le(l|0))}}function ho(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;r||((d0(t)|0)<<24>>24!=-1&&(r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,12,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)),(d0(t)|0)<<24>>24!=-38&&(r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,5,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0))),d0(t)|0,d0(t)|0,o=d0(t)|0,a=o&255;do if(o<<24>>24==1)d0(t)|0,o=0,l=20;else{if((a|0)==(e[t+32>>2]|0))if(r=d0(t)|0,o<<24>>24){o=0,l=20;break}else break;r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,2,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)}while(!1);if((l|0)==20)for(;d0(t)|0,o=o+1|0,r=d0(t)|0,(o|0)!=(a|0);)l=20;e[t+36>>2]=r&255,l=d0(t)|0,o=t+40|0,e[o>>2]=l&255,(l&255)>=3&&(r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,5,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)),(d0(t)|0)<<24>>24&&(r=Ct(16)|0,m=0,o=Ce(1)|0,t=m,m=0,!(t&1)&&(m=0,ve(7,r|0,5,o|0),t=m,m=0,!(t&1))&&Qt(r|0,824,96),t=j()|0,It(r|0),le(t|0)),a=t+28|0,!(e[a>>2]|0)&&(r=e[t+108>>2]|0,r||(r=e[t+16>>2]|0),e[o>>2]|0?o=e[t+32>>2]|0:o=1,l=ie(o,r)|0,t=ie(l,((e[t+24>>2]|0)+7|0)/8|0)|0,e[a>>2]=t)}function S6(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;if(!((o|0)<=0)){F=r+4|0,R=r+8|0,z=0;do _=d0(t)|0,a=e[F>>2]|0,l=e[R>>2]|0,a>>>0>=l>>>0?(h=e[r>>2]|0,d=h,w=a-d+1|0,(w|0)<0&&(pi(r),d=e[r>>2]|0,l=e[R>>2]|0,h=d),E=h,a=l-E|0,a>>>0<1073741823?(a=a<<1,a=a>>>0>>0?w:a,w=e[F>>2]|0,l=w-E|0,a?H=10:(D=0,C=0,a=w)):(l=e[F>>2]|0,a=2147483647,w=l,l=l-E|0,H=10),(H|0)==10&&(H=0,D=a,C=Xe(a)|0,a=w),S[C+l>>0]=_,E=a-E|0,_=C+(l-E)|0,o0(_|0,h|0,E|0)|0,e[r>>2]=_,e[F>>2]=C+(l+1),e[R>>2]=C+D,d&&he(d)):(S[a>>0]=_,e[F>>2]=(e[F>>2]|0)+1),z=z+1|0;while((z|0)!=(o|0))}}function d0(t){t=t|0;var r=0,o=0,a=0,l=0;return o=e[t>>2]|0,o?(t=o+12|0,r=e[t>>2]|0,(r|0)==(e[o+16>>2]|0)?t=Et[e[(e[o>>2]|0)+40>>2]&127](o)|0:(e[t>>2]=r+1,t=N[r>>0]|0),l=t&255,l|0):(a=t+8|0,l=e[a>>2]|0,l?(t=t+4|0,r=e[t>>2]|0,o=S[r>>0]|0,r?(e[t>>2]=r+1,e[a>>2]=l+-1,l=o,l|0):(l=o,l|0)):(t=Ct(16)|0,m=0,r=Ce(1)|0,l=m,m=0,l&1&&(l=j()|0,It(t|0),le(l|0)),m=0,ve(7,t|0,4,r|0),l=m,m=0,l&1?(l=j()|0,It(t|0),le(l|0)):Qt(t|0,824,96),0))}function Ir(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0,w=0,C=0;if(o=b,b=b+176|0,r=o+152|0,C=o+16|0,d=o,w=d0(t)|0,a=w&255,w<<24>>24==-1){do r=d0(t)|0;while(r<<24>>24==-1);return b=o,r|0}w=C+56|0,h=C+4|0,e[C>>2]=36160,e[w>>2]=36180,m=0,Ae(62,C+56|0,h|0),l=m,m=0,l&1&&(C=j()|0,tt(w),le(C|0)),e[C+128>>2]=0,e[C+132>>2]=-1,e[C>>2]=36200,e[C+56>>2]=36220,m=0,ue(180,h|0),l=m,m=0;do if(l&1)r=j()|0;else{if(e[h>>2]=36236,l=C+36|0,e[l>>2]=0,e[l+4>>2]=0,e[l+8>>2]=0,e[l+12>>2]=0,e[C+52>>2]=16,e[r>>2]=0,e[r+4>>2]=0,e[r+8>>2]=0,m=0,Ae(63,h|0,r|0),o=m,m=0,o&1){C=j()|0,de(r),de(l),wt(h),r=C;break}de(r),e[C+((e[(e[C>>2]|0)+-12>>2]|0)+76)>>2]=48,m=0,r=Ve(28,C|0,50907,62)|0,o=m,m=0,!(o&1)&&(o=r+((e[(e[r>>2]|0)+-12>>2]|0)+4)|0,e[o>>2]=e[o>>2]&-75|8,o=r+((e[(e[r>>2]|0)+-12>>2]|0)+4)|0,e[o>>2]=e[o>>2]|16384,e[r+((e[(e[r>>2]|0)+-12>>2]|0)+12)>>2]=2,m=0,Ne(38,r|0,a|0)|0,a=m,m=0,!(a&1))&&(o=Ct(16)|0,m=0,Ae(64,d|0,h|0),a=m,m=0,a&1?r=j()|0:(m=0,r=Ce(1)|0,a=m,m=0,!(a&1)&&(m=0,$e(36,o|0,12,r|0,d|0),a=m,m=0,!(a&1))?(m=0,ve(6,o|0,824,96),m=0,t=0):t=1,r=j()|0,de(d),t||(d=r,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0))),It(o|0),d=r,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0)),d=j()|0,e[C>>2]=36200,e[w>>2]=36220,e[h>>2]=36236,de(l),wt(h),tt(w),le(d|0)}while(!1);return C=r,tt(w),le(C|0),0}function A6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;switch(o=b,b=b+320|0,w=o+300|0,E=o+152|0,C=o+288|0,F=o+16|0,D=o,r<<24>>24){case-9:return R=(d0(t)|0)&255,e[t+24>>2]=R,R=((d0(t)|0)&255)<<8|(d0(t)|0)&255,F=((d0(t)|0)&255)<<8|(d0(t)|0)&255,e[t+16>>2]=F,e[t+20>>2]=R,R=(d0(t)|0)&255,e[t+32>>2]=R,R=6,b=o,R|0;case-8:return R=v6(t)|0,b=o,R|0;case-24:return R=x6(t)|0,b=o,R|0;case-53:case-54:case-55:case-57:case-58:case-59:case-61:case-62:case-63:case-64:{d=E+56|0,l=E+4|0,e[E>>2]=36160,e[d>>2]=36180,m=0,Ae(62,E+56|0,l|0),F=m,m=0,F&1&&(R=j()|0,tt(d),le(R|0)),e[E+128>>2]=0,e[E+132>>2]=-1,e[E>>2]=36200,e[E+56>>2]=36220,m=0,ue(180,l|0),F=m,m=0;do if(F&1)t=j()|0;else{if(e[l>>2]=36236,h=E+36|0,e[h>>2]=0,e[h+4>>2]=0,e[h+8>>2]=0,e[h+12>>2]=0,e[E+52>>2]=16,e[w>>2]=0,e[w+4>>2]=0,e[w+8>>2]=0,m=0,Ae(63,l|0,w|0),F=m,m=0,F&1){t=j()|0,de(w),de(h),wt(l);break}de(w),m=0,t=Ve(28,E|0,50970,26)|0,F=m,m=0;do if(!(F&1)&&(m=0,a=Ne(38,t|0,r&255|0)|0,F=m,m=0,!(F&1))&&(m=0,Ve(28,a|0,50997,18)|0,F=m,m=0,!(F&1))){if(a=Ct(16)|0,m=0,Ae(64,C|0,l|0),F=m,m=0,F&1)t=j()|0;else if(m=0,t=Ce(1)|0,F=m,m=0,!(F&1)&&(m=0,$e(36,a|0,10,t|0,C|0),F=m,m=0,!(F&1))?(m=0,ve(6,a|0,824,96),m=0,o=0):o=1,t=j()|0,de(C),!o)break;It(a|0)}else R=20;while(!1);(R|0)==20&&(t=j()|0),e[E>>2]=36200,e[d>>2]=36220,e[l>>2]=36236,de(h),wt(l),tt(d),R=t,le(R|0)}while(!1);R=t,tt(d),le(R|0)}case-25:case-32:case-2:return R=0,b=o,R|0;default:{C=F+56|0,h=F+4|0,e[F>>2]=36160,e[C>>2]=36180,m=0,Ae(62,F+56|0,h|0),E=m,m=0,E&1&&(R=j()|0,tt(C),le(R|0)),e[F+128>>2]=0,e[F+132>>2]=-1,e[F>>2]=36200,e[F+56>>2]=36220,m=0,ue(180,h|0),E=m,m=0;do if(E&1)t=j()|0;else{if(e[h>>2]=36236,d=F+36|0,e[d>>2]=0,e[d+4>>2]=0,e[d+8>>2]=0,e[d+12>>2]=0,e[F+52>>2]=16,e[w>>2]=0,e[w+4>>2]=0,e[w+8>>2]=0,m=0,Ae(63,h|0,w|0),E=m,m=0,E&1){t=j()|0,de(w),de(d),wt(h);break}de(w),m=0,t=Ve(28,F|0,51016,20)|0,E=m,m=0;do if(!(E&1)&&(m=0,l=Ne(38,t|0,r&255|0)|0,E=m,m=0,!(E&1))&&(m=0,Ve(28,l|0,51037,13)|0,E=m,m=0,!(E&1))){if(a=Ct(16)|0,m=0,Ae(64,D|0,h|0),E=m,m=0,E&1)t=j()|0;else if(m=0,t=Ce(1)|0,E=m,m=0,!(E&1)&&(m=0,$e(36,a|0,11,t|0,D|0),E=m,m=0,!(E&1))?(m=0,ve(6,a|0,824,96),m=0,o=0):o=1,t=j()|0,de(D),!o)break;It(a|0)}else R=40;while(!1);(R|0)==40&&(t=j()|0),e[F>>2]=36200,e[C>>2]=36220,e[h>>2]=36236,de(d),wt(h),tt(C),R=t,le(R|0)}while(!1);R=t,tt(C),le(R|0)}}return 0}function v6(t){t=t|0;var r=0;return(d0(t)|0)<<24>>24!=1?(t=1,t|0):(r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+52>>2]=r,r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+56>>2]=r,r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+60>>2]=r,r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+64>>2]=r,r=((d0(t)|0)&255)<<8,r=r|(d0(t)|0)&255,e[t+68>>2]=r,t=11,t|0)}function x6(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;o=b,b=b+16|0,l=o,e[l>>2]=0,h=l+4|0,e[h>>2]=0,e[l+8>>2]=0,m=0,ve(9,t|0,l|0,4),r=m,m=0;e:do if(r&1)a=3;else{r=e[l>>2]|0;t:do if(US(r,51051,4)|0)t=4;else{if(m=0,r=ge(69,t|0)|0,d=m,m=0,d&1){a=3;break e}switch(r=r&255,r|0){case 3:case 2:case 1:case 0:{e[t+44>>2]=r,t=5,r=e[l>>2]|0;break t}case 5:case 4:{if(r=Ct(16)|0,m=0,t=Ce(1)|0,d=m,m=0,!(d&1)&&(m=0,ve(7,r|0,7,t|0),d=m,m=0,!(d&1))){m=0,ve(6,r|0,824,96),m=0,a=3;break e}t=j()|0,It(r|0);break e}default:{if(r=Ct(16)|0,m=0,t=Ce(1)|0,d=m,m=0,!(d&1)&&(m=0,ve(7,r|0,5,t|0),d=m,m=0,!(d&1))){m=0,ve(6,r|0,824,96),m=0,a=3;break e}t=j()|0,It(r|0);break e}}}while(!1);return r?((e[h>>2]|0)!=(r|0)&&(e[h>>2]=r),he(r),b=o,t|0):(b=o,t|0)}while(!1);return(a|0)==3&&(t=j()|0),r=e[l>>2]|0,r||le(t|0),(e[h>>2]|0)!=(r|0)&&(e[h>>2]=r),he(r),le(t|0),0}function w6(t){t=t|0;var r=0,o=0,a=0;a=e[(e[t>>2]|0)+-12>>2]|0,e[t+a>>2]=36200,r=t+(a+56)|0,e[r>>2]=36220,o=t+(a+4)|0,e[o>>2]=36236,de(t+(a+36)|0),wt(o),tt(r)}function y6(t){t=t|0}function C6(t){t=t|0,he(t)}function T6(t){t=t|0,S[t>>0]=0,t=t+4|0,e[t>>2]=0,e[t+4>>2]=0,e[t+8>>2]=0,e[t+12>>2]=0,e[t+16>>2]=0,e[t+20>>2]=0,e[t+24>>2]=0,e[t+28>>2]=0}function I6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;if(l=b,b=b+16|0,h=l,r=a6(r)|0,e[h>>2]=r,o=t+28|0,a=e[o>>2]|0,a>>>0<(e[t+32>>2]|0)>>>0){e[a>>2]=r,e[o>>2]=a+4,e[h>>2]=0,b=l;return}if(m=0,Ae(57,t+24|0,h|0),t=m,m=0,t&1)r=j()|0,o=e[h>>2]|0,e[h>>2]=0,o||le(r|0),Rt[e[(e[o>>2]|0)+4>>2]&255](o),le(r|0);else{if(r=e[h>>2]|0,e[h>>2]=0,!r){b=l;return}Rt[e[(e[r>>2]|0)+4>>2]&255](r),b=l;return}}function k6(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;if(a=t+4|0,e[a>>2]=e[r>>2],e[a+4>>2]=e[r+4>>2],e[a+8>>2]=e[r+8>>2],ui(t,-1),ui(t,-40),a=t+28|0,l=t+24|0,r=e[l>>2]|0,(e[a>>2]|0)==(r|0))return ui(t,-1),ui(t,-39),t=t+16|0,t=e[t>>2]|0,t|0;o=0;do h=e[r+(o<<2)>>2]|0,t0[e[(e[h>>2]|0)+8>>2]&127](h,t),o=o+1|0,r=e[l>>2]|0;while(o>>>0<(e[a>>2]|0)-r>>2>>>0);return ui(t,-1),ui(t,-39),h=t+16|0,h=e[h>>2]|0,h|0}function E6(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;F=b,b=b+48|0,w=F+32|0,l=F+12|0,C=F+8|0,E=F+4|0,R=F,a=o+36|0;do if(!(e[a>>2]|0)&&!(e[o+40>>2]|0)&&!(e[o+44>>2]|0)&&!(e[o+48>>2]|0)&&!(e[o+52>>2]|0)){if(a=e[o+8>>2]|0,(a|0)<=12){h=t+28|0,d=t+32|0;break}if(m0(l,(1<>2]|0),a=co(l)|0,e[C>>2]=a,h=t+28|0,l=e[h>>2]|0,d=t+32|0,l>>>0<(e[d>>2]|0)>>>0){e[l>>2]=a,e[h>>2]=l+4,e[C>>2]=0;break}if(m=0,Ae(57,t+24|0,C|0),w=m,m=0,!(w&1)){if(a=e[C>>2]|0,e[C>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}o=j()|0,a=e[C>>2]|0,e[C>>2]=0,a||(R=o,le(R|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),R=o,le(R|0)}else D=6;while(!1);do if((D|0)==6){if(a=co(a)|0,e[w>>2]=a,h=t+28|0,l=e[h>>2]|0,d=t+32|0,l>>>0<(e[d>>2]|0)>>>0){e[l>>2]=a,e[h>>2]=l+4,e[w>>2]=0;break}if(m=0,Ae(57,t+24|0,w|0),D=m,m=0,!(D&1)){if(a=e[w>>2]|0,e[w>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}o=j()|0,a=e[w>>2]|0,e[w>>2]=0,a||(R=o,le(R|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),R=o,le(R|0)}while(!1);a=t+20|0,l=(e[a>>2]|0)+1|0,e[a>>2]=l,a=e[o+24>>2]|0,w=a|0?e[o+16>>2]|0:1,a=l6(l,w,e[o+20>>2]|0,a)|0,e[E>>2]=a,l=e[h>>2]|0;do if(l>>>0<(e[d>>2]|0)>>>0)e[l>>2]=a,e[h>>2]=l+4,e[E>>2]=0;else{if(m=0,Ae(57,t+24|0,E|0),D=m,m=0,!(D&1)){if(a=e[E>>2]|0,e[E>>2]=0,!a)break;Rt[e[(e[a>>2]|0)+4>>2]&255](a);break}o=j()|0,a=e[E>>2]|0,e[E>>2]=0,a||(R=o,le(R|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),R=o,le(R|0)}while(!1);C=Xe(104)|0,e[C>>2]=36820,e[C+4>>2]=w,l=C+8|0,e[l>>2]=e[r>>2],e[l+4>>2]=e[r+4>>2],e[l+8>>2]=e[r+8>>2],l=C+20|0,a=l+84|0;do e[l>>2]=e[o>>2],l=l+4|0,o=o+4|0;while((l|0)<(a|0));if(e[R>>2]=C,o=e[h>>2]|0,o>>>0<(e[d>>2]|0)>>>0){e[o>>2]=C,e[h>>2]=o+4,e[R>>2]=0,b=F;return}if(m=0,Ae(57,t+24|0,R|0),t=m,m=0,t&1)o=j()|0,a=e[R>>2]|0,e[R>>2]=0,a||(R=o,le(R|0)),Rt[e[(e[a>>2]|0)+4>>2]&255](a),R=o,le(R|0);else{if(o=e[R>>2]|0,e[R>>2]=0,!o){b=F;return}Rt[e[(e[o>>2]|0)+4>>2]&255](o),b=F;return}}function D6(t,r,o,a,l,h,d,w,C,D,E){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0,D=D|0,E=E|0;var F=0,R=0,_=0,z=0,H=0,K=0,G=0;return _=b,b=b+96|0,R=_,F=ma(t,r,R,0)|0,F?(l=F,b=_,l|0):(S[R+32>>0]=0,H=e[R+8>>2]|0,G=e[R>>2]|0,K=e[R+4>>2]|0,F=ie(K,G)|0,z=e[R+16>>2]|0,F=ie(ie(F,(H|0)<9?1:2)|0,z)|0,e[a>>2]=F,F=E0(F)|0,e[o>>2]=F,e[l>>2]=G,e[h>>2]=K,e[d>>2]=H,e[w>>2]=e[R+12>>2],e[C>>2]=z,e[D>>2]=e[R+20>>2],e[E>>2]=e[R+24>>2],l=ga(F,e[a>>2]|0,t,r,0,0)|0,b=_,l|0)}function b6(t,r,o,a,l,h,d,w,C){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,d=d|0,w=w|0,C=C|0;var D=0,E=0,F=0,R=0;F=b,b=b+96|0,D=F+4|0,d=F,E=D,R=E+84|0;do e[E>>2]=0,E=E+4|0;while((E|0)<(R|0));return e[D+16>>2]=h,e[D+8>>2]=l,e[D>>2]=o,e[D+4>>2]=a,o=E0(r)|0,e[w>>2]=o,e[d>>2]=0,o=pa(w,r,d,t,r,D,0)|0,e[C>>2]=e[d>>2],b=F,o|0}function Ni(t,r){t=t|0,r=r|0;var o=0;o=b,b=b+16|0,e[o>>2]=r,r=e[9320]|0,Po(r,t,o)|0,PS(10,r)|0,St()}function si(t){t=t|0,Lr(51337,51366,1164,51442)}function pi(t){t=t|0,Lr(51463,51486,303,51442)}function po(){var t=0,r=0;if(t=b,b=b+16|0,Qo(37024,4)|0)Ni(51562,t);else return r=Ho(e[9255]|0)|0,b=t,r|0;return 0}function Xe(t){t=t|0;var r=0;r=t|0?t:1,t=E0(r)|0;e:do if(!t){for(;t=L6()|0,!!t;)if(Vo[t&7](),t=E0(r)|0,t)break e;r=Ct(4)|0,e[r>>2]=36844,Qt(r|0,592,78)}while(!1);return t|0}function he(t){t=t|0,n0(t)}function F6(t){t=t|0,he(t)}function N6(t){t=t|0,e[t>>2]=36844}function R6(t){t=t|0}function M6(t){t=t|0,he(t)}function _6(t){return t=t|0,51611}function mo(t){t=t|0;var r=0;r=b,b=b+16|0,m=0,bt(t|0),t=m,m=0,t&1||(m=0,Ae(85,51626,r|0),m=0),t=j(0)|0,K0(t|0)|0,m=0,Ae(85,51666,r+8|0),m=0,t=j(0)|0,m=0,bt(3),r=m,m=0,r&1?(r=j(0)|0,$t(r)):$t(t)}function P6(){var t=0,r=0,o=0;m=0,t=Ce(2)|0,o=m,m=0,o&1&&(o=j(0)|0,$t(o)),t|0&&(r=e[t>>2]|0,(r|0)!=0)&&(o=r+48|0,(e[o>>2]&-256|0)==1126902528?(e[o+4>>2]|0)==1129074247:0)&&mo(e[r+12>>2]|0),o=e[9208]|0,e[9208]=o+0,mo(o)}function L6(){var t=0;return t=e[9214]|0,e[9214]=t+0,t|0}function wA(t){t=t|0}function In(t){t=t|0,e[t>>2]=36868,uS(t+4|0)}function O6(t){t=t|0,In(t),he(t)}function $6(t){return t=t|0,e[t+4>>2]|0}function yA(t){t=t|0}function B6(t){t=t|0,e[t>>2]=36888}function V6(t){t=t|0}function U6(t){t=t|0,he(t)}function z6(t){return t=t|0,51716}function G6(t){t=t|0}function q6(t){t=t|0}function W6(t){t=t|0}function H6(t){t=t|0,he(t)}function Q6(t){t=t|0,he(t)}function K6(t){t=t|0,he(t)}function Y6(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;if(d=b,b=b+64|0,h=d,(t|0)!=(r|0))if(r|0&&(l=So(r,656,672,0)|0,(l|0)!=0)){r=h,a=r+56|0;do e[r>>2]=0,r=r+4|0;while((r|0)<(a|0));e[h>>2]=l,e[h+8>>2]=t,e[h+12>>2]=-1,e[h+48>>2]=1,On[e[(e[l>>2]|0)+28>>2]&63](l,h,e[o>>2]|0,1),(e[h+24>>2]|0)==1?(e[o>>2]=e[h+16>>2],r=1):r=0}else r=0;else r=1;return b=d,r|0}function kr(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0;t=r+16|0,l=e[t>>2]|0;do if(l){if((l|0)!=(o|0)){a=r+36|0,e[a>>2]=(e[a>>2]|0)+1,e[r+24>>2]=2,S[r+54>>0]=1;break}t=r+24|0,(e[t>>2]|0)==2&&(e[t>>2]=a)}else e[t>>2]=o,e[r+24>>2]=a,e[r+36>>2]=1;while(!1)}function j6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,(t|0)==(e[r+8>>2]|0)&&kr(0,r,o,a)}function X6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0,(t|0)==(e[r+8>>2]|0)?kr(0,r,o,a):(t=e[t+8>>2]|0,On[e[(e[t>>2]|0)+28>>2]&63](t,r,o,a))}function go(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;h=e[t+4>>2]|0,l=h>>8,h&1&&(l=e[(e[o>>2]|0)+l>>2]|0),t=e[t>>2]|0,On[e[(e[t>>2]|0)+28>>2]&63](t,r,o+l|0,h&2|0?a:2)}function Z6(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;e:do if((t|0)!=(e[r+8>>2]|0)){if(h=e[t+12>>2]|0,l=t+16+(h<<3)|0,go(t+16|0,r,o,a),(h|0)>1){h=r+54|0,t=t+24|0;do{if(go(t,r,o,a),S[h>>0]|0)break e;t=t+8|0}while(t>>>0>>0)}}else kr(0,r,o,a);while(!1)}function So(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;_=b,b=b+64|0,R=_,F=e[t>>2]|0,E=t+(e[F+-8>>2]|0)|0,F=e[F+-4>>2]|0,e[R>>2]=o,e[R+4>>2]=t,e[R+8>>2]=r,e[R+12>>2]=a,a=R+16|0,t=R+20|0,r=R+24|0,l=R+28|0,h=R+32|0,d=R+40|0,w=(F|0)==(o|0),C=a,D=C+36|0;do e[C>>2]=0,C=C+4|0;while((C|0)<(D|0));k[a+36>>1]=0,S[a+38>>0]=0;e:do if(w)e[R+48>>2]=1,Vi[e[(e[o>>2]|0)+20>>2]&15](o,R,E,E,1,0),a=(e[r>>2]|0)==1?E:0;else{switch(Pn[e[(e[F>>2]|0)+24>>2]&15](F,R,E,1,0),e[R+36>>2]|0){case 0:{a=(e[d>>2]|0)==1&(e[l>>2]|0)==1&(e[h>>2]|0)==1?e[t>>2]|0:0;break e}case 1:break;default:{a=0;break e}}if((e[r>>2]|0)!=1&&!((e[d>>2]|0)==0&(e[l>>2]|0)==1&(e[h>>2]|0)==1)){a=0;break}a=e[a>>2]|0}while(!1);return b=_,a|0}function Er(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,S[r+53>>0]=1;do if((e[r+4>>2]|0)==(a|0)){if(S[r+52>>0]=1,a=r+16|0,t=e[a>>2]|0,!t){if(e[a>>2]=o,e[r+24>>2]=l,e[r+36>>2]=1,!((l|0)==1&&(e[r+48>>2]|0)==1))break;S[r+54>>0]=1;break}if((t|0)!=(o|0)){l=r+36|0,e[l>>2]=(e[l>>2]|0)+1,S[r+54>>0]=1;break}t=r+24|0,a=e[t>>2]|0,(a|0)==2&&(e[t>>2]=l,a=l),(a|0)==1&&(e[r+48>>2]|0)==1&&(S[r+54>>0]=1)}while(!1)}function J6(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;e:do if((t|0)==(e[r+8>>2]|0))(e[r+4>>2]|0)==(o|0)&&(h=r+28|0,(e[h>>2]|0)!=1)&&(e[h>>2]=a);else{if((t|0)!=(e[r>>2]|0)){if(z=e[t+12>>2]|0,w=t+16+(z<<3)|0,kn(t+16|0,r,o,a,l),h=t+24|0,(z|0)<=1)break;if(d=e[t+8>>2]|0,!(d&2|0)&&(C=r+36|0,(e[C>>2]|0)!=1)){if(!(d&1)){for(d=r+54|0;;)if(S[d>>0]|0||(e[C>>2]|0)==1||(kn(h,r,o,a,l),h=h+8|0,h>>>0>=w>>>0))break e}for(d=r+24|0,t=r+54|0;;)if(S[t>>0]|0||(e[C>>2]|0)==1&&(e[d>>2]|0)==1||(kn(h,r,o,a,l),h=h+8|0,h>>>0>=w>>>0))break e}for(d=r+54|0;;)if(S[d>>0]|0||(kn(h,r,o,a,l),h=h+8|0,h>>>0>=w>>>0))break e}if((e[r+16>>2]|0)!=(o|0)&&(_=r+20|0,(e[_>>2]|0)!=(o|0))){if(e[r+32>>2]=a,E=r+44|0,(e[E>>2]|0)==4)break;d=e[t+12>>2]|0,w=t+16+(d<<3)|0,C=r+52|0,a=r+53|0,F=r+54|0,D=t+8|0,R=r+24|0;t:do if((d|0)>0)for(d=0,h=0,t=t+16|0;;){if(S[C>>0]=0,S[a>>0]=0,Dr(t,r,o,o,1,l),S[F>>0]|0){z=20;break t}do if(S[a>>0]|0){if(!(S[C>>0]|0))if(e[D>>2]&1){h=1;break}else{h=1,z=20;break t}if((e[R>>2]|0)==1)break t;if(e[D>>2]&2)d=1,h=1;else break t}while(!1);if(t=t+8|0,t>>>0>=w>>>0){z=20;break}}else d=0,h=0,z=20;while(!1);do if((z|0)==20){if(!d&&(e[_>>2]=o,o=r+40|0,e[o>>2]=(e[o>>2]|0)+1,(e[r+36>>2]|0)==1)&&(e[R>>2]|0)==2){if(S[F>>0]=1,h)break}else z=24;if((z|0)==24&&h)break;e[E>>2]=4;break e}while(!1);e[E>>2]=3;break}(a|0)==1&&(e[r+32>>2]=1)}while(!1)}function Dr(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0;w=e[t+4>>2]|0,d=w>>8,w&1&&(d=e[(e[a>>2]|0)+d>>2]|0),t=e[t>>2]|0,Vi[e[(e[t>>2]|0)+20>>2]&15](t,r,o,a+d|0,w&2|0?l:2,h)}function kn(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;d=e[t+4>>2]|0,h=d>>8,d&1&&(h=e[(e[o>>2]|0)+h>>2]|0),t=e[t>>2]|0,Pn[e[(e[t>>2]|0)+24>>2]&15](t,r,o+h|0,d&2|0?a:2,l)}function eS(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0;e:do if((t|0)==(e[r+8>>2]|0))(e[r+4>>2]|0)==(o|0)&&(h=r+28|0,(e[h>>2]|0)!=1)&&(e[h>>2]=a);else{if((t|0)!=(e[r>>2]|0)){w=e[t+8>>2]|0,Pn[e[(e[w>>2]|0)+24>>2]&15](w,r,o,a,l);break}if((e[r+16>>2]|0)!=(o|0)&&(d=r+20|0,(e[d>>2]|0)!=(o|0))){if(e[r+32>>2]=a,a=r+44|0,(e[a>>2]|0)==4)break;h=r+52|0,S[h>>0]=0,C=r+53|0,S[C>>0]=0,t=e[t+8>>2]|0,Vi[e[(e[t>>2]|0)+20>>2]&15](t,r,o,o,1,l),S[C>>0]|0?S[h>>0]|0||(h=1,w=13):(h=0,w=13);do if((w|0)==13){if(e[d>>2]=o,C=r+40|0,e[C>>2]=(e[C>>2]|0)+1,(e[r+36>>2]|0)==1&&(e[r+24>>2]|0)==2){if(S[r+54>>0]=1,h)break}else w=16;if((w|0)==16&&h)break;e[a>>2]=4;break e}while(!1);e[a>>2]=3;break}(a|0)==1&&(e[r+32>>2]=1)}while(!1)}function tS(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0;do if((t|0)==(e[r+8>>2]|0))(e[r+4>>2]|0)==(o|0)&&(d=r+28|0,(e[d>>2]|0)!=1)&&(e[d>>2]=a);else if((t|0)==(e[r>>2]|0)){if((e[r+16>>2]|0)!=(o|0)&&(h=r+20|0,(e[h>>2]|0)!=(o|0))){e[r+32>>2]=a,e[h>>2]=o,l=r+40|0,e[l>>2]=(e[l>>2]|0)+1,(e[r+36>>2]|0)==1&&(e[r+24>>2]|0)==2&&(S[r+54>>0]=1),e[r+44>>2]=4;break}(a|0)==1&&(e[r+32>>2]=1)}while(!1)}function iS(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0;var d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;if((t|0)==(e[r+8>>2]|0))Er(0,r,o,a,l);else{E=r+52|0,F=S[E>>0]|0,R=r+53|0,_=S[R>>0]|0,D=e[t+12>>2]|0,d=t+16+(D<<3)|0,S[E>>0]=0,S[R>>0]=0,Dr(t+16|0,r,o,a,l,h);e:do if((D|0)>1){w=r+24|0,C=t+8|0,D=r+54|0,t=t+24|0;do{if(S[D>>0]|0)break e;if(S[E>>0]|0){if((e[w>>2]|0)==1||!(e[C>>2]&2))break e}else if(S[R>>0]|0&&!(e[C>>2]&1|0))break e;S[E>>0]=0,S[R>>0]=0,Dr(t,r,o,a,l,h),t=t+8|0}while(t>>>0>>0)}while(!1);S[E>>0]=F,S[R>>0]=_}}function nS(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,(t|0)==(e[r+8>>2]|0)?Er(0,r,o,a,l):(t=e[t+8>>2]|0,Vi[e[(e[t>>2]|0)+20>>2]&15](t,r,o,a,l,h))}function rS(t,r,o,a,l,h){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0,h=h|0,(t|0)==(e[r+8>>2]|0)&&Er(0,r,o,a,l)}function sS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return l=b,b=b+16|0,a=l,e[a>>2]=e[o>>2],t=Yt[e[(e[t>>2]|0)+16>>2]&63](t,r,a)|0,t&&(e[o>>2]=e[a>>2]),b=l,t&1|0}function oS(t){return t=t|0,t?t=(So(t,656,704,0)|0)!=0:t=0,t&1|0}function En(){var t=0;t=Ct(4)|0,N6(t),Qt(t|0,592,78)}function aS(){var t=0,r=0,o=0,a=0,l=0,h=0,d=0,w=0;l=b,b=b+48|0,d=l+32|0,o=l+24|0,w=l+16|0,h=l,l=l+36|0,t=po()|0,t|0&&(a=e[t>>2]|0,(a|0)!=0)&&(t=a+48|0,r=e[t>>2]|0,t=e[t+4>>2]|0,(r&-256|0)==1126902528&(t|0)==1129074247||(e[o>>2]=e[9257],Ni(51919,o)),(r|0)==1126902529&(t|0)==1129074247?t=e[a+44>>2]|0:t=a+80|0,e[l>>2]=t,a=e[a>>2]|0,t=e[a+4>>2]|0,Yt[e[(e[152]|0)+16>>2]&63](608,a,l)|0?(w=e[l>>2]|0,l=e[9257]|0,w=Et[e[(e[w>>2]|0)+8>>2]&127](w)|0,e[h>>2]=l,e[h+4>>2]=t,e[h+8>>2]=w,Ni(51833,h)):(e[w>>2]=e[9257],e[w+4>>2]=t,Ni(51878,w))),Ni(51957,d)}function lS(){var t=0;if(t=b,b=b+16|0,ni(37020,184)|0)Ni(51730,t);else{b=t;return}}function uS(t){t=t|0;var r=0,o=0;o=(e[t>>2]|0)+-4|0,r=e[o>>2]|0,e[o>>2]=r+-1,(r+-1|0)<0&&he((e[t>>2]|0)+-12|0)}function cS(t){t=t|0;var r=0;if(r=b,b=b+16|0,n0(t),Xo(e[9255]|0,0)|0)Ni(51780,r);else{b=r;return}}function Dn(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,t=$S(t,r,o)|0,t|0}function Ao(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,t=BS(t,r,o)|0,t|0}function fS(){return 37296}function hS(){return 37300}function dS(){return 37304}function ji(t){return t=t|0,((t|0)==32|(t+-9|0)>>>0<5)&1|0}function pS(t){return t=t|0,(t+-48|0)>>>0<10?t=1:t=((t|32)+-97|0)>>>0<6,t&1|0}function S0(){var t=0;return e[9258]|0?(t=($r()|0)+60|0,t=e[t>>2]|0):t=37308,t|0}function vo(t){t=t|0;var r=0,o=0;for(r=0;;){if((N[51978+r>>0]|0)==(t|0)){o=2;break}if(r=r+1|0,(r|0)==87){r=87,t=52066,o=5;break}}if((o|0)==2&&(r?(t=52066,o=5):t=52066),(o|0)==5)for(;;){for(o=t;t=o+1|0,S[o>>0]|0;)o=t;if(r=r+-1|0,r)o=5;else break}return t|0}function xo(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0;switch(jt=b,b=b+512|0,Ee=jt,r|0){case 0:{it=24,Te=-149,L=4;break}case 1:{it=53,Te=-1074,L=4;break}case 2:{it=53,Te=-1074,L=4;break}default:a=0}e:do if((L|0)==4){ae=t+4|0,ne=t+100|0;do r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0;while(ji(r)|0);t:do switch(r|0){case 43:case 45:if(l=1-(((r|0)==45&1)<<1)|0,r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=r+1,r=N[r>>0]|0,ke=l;break t}else{r=u0(t)|0,ke=l;break t}default:ke=1}while(!1);l=r,r=0;do{if((l|32|0)!=(S[53870+r>>0]|0))break;do if(r>>>0<7)if(l=e[ae>>2]|0,l>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=l+1,l=N[l>>0]|0;break}else{l=u0(t)|0;break}while(!1);r=r+1|0}while(r>>>0<8);t:do switch(r|0){case 8:break;case 3:{L=23;break}default:{if(d=(o|0)!=0,d&r>>>0>3){if((r|0)==8)break t;L=23;break t}i:do if(!r){r=0;do{if((l|32|0)!=(S[56747+r>>0]|0))break i;do if(r>>>0<2)if(l=e[ae>>2]|0,l>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=l+1,l=N[l>>0]|0;break}else{l=u0(t)|0;break}while(!1);r=r+1|0}while(r>>>0<3)}while(!1);switch(r|0){case 3:{if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|0)==40)r=1;else{if(!(e[ne>>2]|0)){a=fe;break e}e[ae>>2]=(e[ae>>2]|0)+-1,a=fe;break e}for(;l=e[ae>>2]|0,l>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=l+1,l=N[l>>0]|0):l=u0(t)|0,!(!((l+-48|0)>>>0<10|(l+-65|0)>>>0<26)&&!((l|0)==95|(l+-97|0)>>>0<26));)r=r+1|0;if((l|0)==41){a=fe;break e}if(l=(e[ne>>2]|0)==0,l||(e[ae>>2]=(e[ae>>2]|0)+-1),!d){it=S0()|0,e[it>>2]=22,oi(t,0),a=0;break e}if(!r){a=fe;break e}for(;;)if(r=r+-1|0,l||(e[ae>>2]=(e[ae>>2]|0)+-1),!r){a=fe;break e}}case 0:{do if((l|0)==48){if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|32|0)!=120){if(!(e[ne>>2]|0)){r=48;break}e[ae>>2]=(e[ae>>2]|0)+-1,r=48;break}r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0,d=0):(r=u0(t)|0,d=0);i:for(;;){switch(r|0){case 46:{L=74;break i}case 48:break;default:{$=0,w=0,G=0,l=0,D=d,E=0,K=0,C=1,d=0,a=0;break i}}if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=r+1,r=N[r>>0]|0,d=1;continue}else{r=u0(t)|0,d=1;continue}}if((L|0)==74)if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|0)==48){d=0,l=0;do r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,d=$0(d|0,l|0,-1,-1)|0,l=ye;while((r|0)==48);$=0,w=0,G=d,D=1,E=1,K=0,C=1,d=0,a=0}else $=0,w=0,G=0,l=0,D=d,E=1,K=0,C=1,d=0,a=0;for(;;){if(z=r+-48|0,F=r|32,z>>>0>=10){if(H=(r|0)==46,!(H|(F+-97|0)>>>0<6)){F=G,z=$;break}if(H)if(!E)H=w,l=$,z=$,E=1,F=K,h=C;else{F=G,z=$,r=46;break}else L=86}else L=86;if((L|0)==86){L=0,r=(r|0)>57?F+-87|0:z;do if(($|0)<0|($|0)==0&w>>>0<8)F=K,h=C,d=r+(d<<4)|0;else{if(($|0)<0|($|0)==0&w>>>0<14){_=C*.0625,F=K,h=_,a=a+_*+(r|0);break}(K|0)!=0|(r|0)==0?(F=K,h=C):(F=1,h=C,a=a+C*.5)}while(!1);w=$0(w|0,$|0,1,0)|0,H=G,z=ye,D=1}if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=r+1,$=z,G=H,r=N[r>>0]|0,K=F,C=h;continue}else{$=z,G=H,r=u0(t)|0,K=F,C=h;continue}}if(!D){r=(e[ne>>2]|0)==0,r||(e[ae>>2]=(e[ae>>2]|0)+-1),o?!r&&(P=e[ae>>2]|0,e[ae>>2]=P+-1,(E|0)!=0)&&(e[ae>>2]=P+-2):oi(t,0),a=+(ke|0)*0;break e}if(D=(E|0)==0,E=D?w:F,D=D?z:l,(z|0)<0|(z|0)==0&w>>>0<8){l=z;do d=d<<4,w=$0(w|0,l|0,1,0)|0,l=ye;while((l|0)<0|(l|0)==0&w>>>0<8)}if((r|32|0)==112){if(l=Bo(t,o)|0,r=ye,(l|0)==0&(r|0)==-2147483648){if(!o){oi(t,0),a=0;break e}e[ne>>2]|0?(e[ae>>2]=(e[ae>>2]|0)+-1,l=0,r=0):(l=0,r=0)}}else e[ne>>2]|0?(e[ae>>2]=(e[ae>>2]|0)+-1,l=0,r=0):(l=0,r=0);if(Ee=v0(E|0,D|0,2)|0,Ee=$0(Ee|0,ye|0,-32,-1)|0,r=$0(Ee|0,ye|0,l|0,r|0)|0,l=ye,!d){a=+(ke|0)*0;break e}if((l|0)>0|(l|0)==0&r>>>0>(0-Te|0)>>>0){it=S0()|0,e[it>>2]=34,a=+(ke|0)*17976931348623157e292*17976931348623157e292;break e}if(Ee=Te+-106|0,ce=((Ee|0)<0)<<31>>31,(l|0)<(ce|0)|(l|0)==(ce|0)&r>>>0>>0){it=S0()|0,e[it>>2]=34,a=+(ke|0)*22250738585072014e-324*22250738585072014e-324;break e}if((d|0)>-1){do ce=!(a>=.5),Ee=ce&1|d<<1,d=Ee^1,a=a+(ce?a:a+-1),r=$0(r|0,l|0,-1,-1)|0,l=ye;while((Ee|0)>-1);w=r,C=a}else w=r,C=a;r=ii(32,0,Te|0,((Te|0)<0)<<31>>31|0)|0,r=$0(w|0,l|0,r|0,ye|0)|0,Te=ye,0>(Te|0)|(Te|0)==0&it>>>0>r>>>0?(r|0)<0?(r=0,L=127):L=125:(r=it,L=125),(L|0)==125&&((r|0)<53?L=127:(l=r,h=+(ke|0),a=0)),(L|0)==127&&(a=+(ke|0),l=r,h=a,a=+Co(+bn(1,84-r|0),a)),it=(d&1|0)==0&(C!=0&(l|0)<32),a=h*(it?0:C)+(a+h*+(((it&1)+d|0)>>>0))-a,a==0&&(it=S0()|0,e[it>>2]=34),a=+ko(a,w);break e}else r=l;while(!1);re=Te+it|0,ce=0-re|0,d=0;i:for(;;){switch(r|0){case 46:{L=138;break i}case 48:break;default:{l=0,F=0,E=0;break i}}if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0){e[ae>>2]=r+1,r=N[r>>0]|0,d=1;continue}else{r=u0(t)|0,d=1;continue}}if((L|0)==138)if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|0)==48)for(l=0,r=0;;)if(l=$0(l|0,r|0,-1,-1)|0,d=ye,r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,(r|0)==48)r=d;else{F=d,d=1,E=1;break}else l=0,F=0,E=1;e[Ee>>2]=0,D=r+-48|0,w=(r|0)==46;i:do if(w|D>>>0<10){J=Ee+496|0,$=0,H=0,K=w,L=F,z=d,P=E,d=0,w=0,E=0;n:for(;;){do if(K)if(!P)l=$,F=H,P=1;else{F=L,r=$,D=H;break n}else{if(K=$0($|0,H|0,1,0)|0,H=ye,G=(r|0)!=48,(w|0)>=125){if(!G){F=L,$=K;break}e[J>>2]=e[J>>2]|1,F=L,$=K;break}F=Ee+(w<<2)|0,d&&(D=r+-48+((e[F>>2]|0)*10|0)|0),e[F>>2]=D,d=d+1|0,D=(d|0)==9,F=L,$=K,z=1,d=D?0:d,w=(D&1)+w|0,E=G?K:E}while(!1);if(r=e[ae>>2]|0,r>>>0<(e[ne>>2]|0)>>>0?(e[ae>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,D=r+-48|0,K=(r|0)==46,K|D>>>0<10)L=F;else{D=P,L=161;break i}}z=(z|0)!=0,L=169}else $=0,H=0,z=d,D=E,d=0,w=0,E=0,L=161;while(!1);do if((L|0)==161){if(J=(D|0)==0,l=J?$:l,F=J?H:F,z=(z|0)!=0,!((r|32|0)==101&z))if((r|0)>-1){r=$,D=H,L=169;break}else{r=$,D=H,L=171;break}if(D=Bo(t,o)|0,r=ye,(D|0)==0&(r|0)==-2147483648){if(!o){oi(t,0),a=0;break}e[ne>>2]|0?(e[ae>>2]=(e[ae>>2]|0)+-1,D=0,r=0):(D=0,r=0)}l=$0(D|0,r|0,l|0,F|0)|0,z=$,F=ye,D=H,L=173}while(!1);(L|0)==169&&(e[ne>>2]|0?(e[ae>>2]=(e[ae>>2]|0)+-1,z?(z=r,L=173):L=172):L=171),(L|0)==171&&(z?(z=r,L=173):L=172);do if((L|0)==172)it=S0()|0,e[it>>2]=22,oi(t,0),a=0;else if((L|0)==173){if(r=e[Ee>>2]|0,!r){a=+(ke|0)*0;break}if(((D|0)<0|(D|0)==0&z>>>0<10)&((l|0)==(z|0)&(F|0)==(D|0))&&it>>>0>30|(r>>>it|0)==0){a=+(ke|0)*+(r>>>0);break}if(t=(Te|0)/-2|0,ae=((t|0)<0)<<31>>31,(F|0)>(ae|0)|(F|0)==(ae|0)&l>>>0>t>>>0){it=S0()|0,e[it>>2]=34,a=+(ke|0)*17976931348623157e292*17976931348623157e292;break}if(t=Te+-106|0,ae=((t|0)<0)<<31>>31,(F|0)<(ae|0)|(F|0)==(ae|0)&l>>>0>>0){it=S0()|0,e[it>>2]=34,a=+(ke|0)*22250738585072014e-324*22250738585072014e-324;break}if(d){if((d|0)<9){D=Ee+(w<<2)|0,r=e[D>>2]|0;do r=r*10|0,d=d+1|0;while((d|0)!=9);e[D>>2]=r}w=w+1|0}if((E|0)<9&&(E|0)<=(l|0)&(l|0)<18){if((l|0)==9){a=+(ke|0)*+((e[Ee>>2]|0)>>>0);break}if((l|0)<9){a=+(ke|0)*+((e[Ee>>2]|0)>>>0)/+(e[37312+(8-l<<2)>>2]|0);break}if(t=it+27+(ie(l,-3)|0)|0,r=e[Ee>>2]|0,(t|0)>30|(r>>>t|0)==0){a=+(ke|0)*+(r>>>0)*+(e[37312+(l+-10<<2)>>2]|0);break}}if(r=(l|0)%9|0,!r)d=0,r=0;else{if(z=(l|0)>-1?r:r+9|0,D=e[37312+(8-z<<2)>>2]|0,w){E=1e9/(D|0)|0,d=0,r=0,F=0;do ne=Ee+(F<<2)|0,ae=e[ne>>2]|0,t=((ae>>>0)/(D>>>0)|0)+r|0,e[ne>>2]=t,r=ie((ae>>>0)%(D>>>0)|0,E)|0,t=(F|0)==(d|0)&(t|0)==0,F=F+1|0,l=t?l+-9|0:l,d=t?F&127:d;while((F|0)!=(w|0));r&&(e[Ee+(w<<2)>>2]=r,w=w+1|0)}else d=0,w=0;r=0,l=9-z+l|0}i:for(;;){H=(l|0)<18,K=(l|0)==18,G=Ee+(d<<2)|0;do{if(!H){if(!K)break i;if((e[G>>2]|0)>>>0>=9007199){l=18;break i}}for(D=0,E=w+127|0;z=E&127,F=Ee+(z<<2)|0,E=v0(e[F>>2]|0,0,29)|0,E=$0(E|0,ye|0,D|0,0)|0,D=ye,D>>>0>0|(D|0)==0&E>>>0>1e9?(t=xn(E|0,D|0,1e9,0)|0,E=Cr(E|0,D|0,1e9,0)|0,D=t):D=0,e[F>>2]=E,t=(z|0)==(d|0),w=(z|0)!=(w+127&127|0)|t||E|0?w:z,!t;)E=z+-1|0;r=r+-29|0}while(!(D|0));d=d+127&127,(d|0)==(w|0)&&(t=w+127&127,w=Ee+((w+126&127)<<2)|0,e[w>>2]=e[w>>2]|e[Ee+(t<<2)>>2],w=t),e[Ee+(d<<2)>>2]=D,l=l+9|0}i:for(;;){for($=w+1&127,G=Ee+((w+127&127)<<2)|0;;){for(H=(l|0)==18,K=(l|0)>27?9:1,z=H^1;;){E=d&127,F=(E|0)==(w|0);do if(F)L=219;else{if(D=e[Ee+(E<<2)>>2]|0,D>>>0<9007199){L=219;break}if(D>>>0>9007199)break;if(D=d+1&127,(D|0)==(w|0)){L=219;break}if(D=e[Ee+(D<<2)>>2]|0,D>>>0<254740991){L=219;break}if(!(D>>>0>254740991|z)){l=E;break i}}while(!1);if((L|0)==219&&(L=0,H)){L=220;break i}if(r=r+K|0,(d|0)==(w|0))d=w;else break}for(z=(1<>>K,E=d,D=0,F=d;ae=Ee+(F<<2)|0,t=e[ae>>2]|0,d=(t>>>K)+D|0,e[ae>>2]=d,D=ie(t&z,H)|0,d=(F|0)==(E|0)&(d|0)==0,F=F+1&127,l=d?l+-9|0:l,d=d?F:E,(F|0)!=(w|0);)E=d;if(D){if(($|0)!=(d|0))break;e[G>>2]=e[G>>2]|1}}e[Ee+(w<<2)>>2]=D,w=$}(L|0)==220&&(F?(e[Ee+($+-1<<2)>>2]=0,l=w,w=$):l=E),a=+((e[Ee+(l<<2)>>2]|0)>>>0),l=d+1&127,(l|0)==(w|0)&&(w=d+2&127,e[Ee+(w+-1<<2)>>2]=0),_=+(ke|0),h=_*(a*1e9+ +((e[Ee+(l<<2)>>2]|0)>>>0)),H=r+53|0,F=H-Te|0,z=(F|0)<(it|0),l=z&1,E=z?(F|0)<0?0:F:it,(E|0)<53?(Gt=+Co(+bn(1,105-E|0),h),C=+To(h,+bn(1,53-E|0)),R=Gt,a=C,C=Gt+(h-C)):(R=0,a=0,C=h),D=d+2&127;do if((D|0)==(w|0))h=a;else{D=e[Ee+(D<<2)>>2]|0;do if(D>>>0>=5e8){if(D>>>0>5e8){a=_*.75+a;break}if((d+3&127|0)==(w|0)){a=_*.5+a;break}else{a=_*.75+a;break}}else{if(!(D|0)&&(d+3&127|0)==(w|0))break;a=_*.25+a}while(!1);if((53-E|0)<=1){h=a;break}if(+To(a,1)!=0){h=a;break}h=a+1}while(!1);a=C+h-R;do if((H&2147483647|0)>(-2-re|0)){if(+Ie(+a)>=9007199254740992&&(l=z&(E|0)==(F|0)?0:l,r=r+1|0,a=a*.5),(r+50|0)<=(ce|0)&&!(h!=0&(l|0)!=0))break;it=S0()|0,e[it>>2]=34}while(!1);a=+ko(a,r)}while(!1);break e}default:{e[ne>>2]|0&&(e[ae>>2]=(e[ae>>2]|0)+-1),it=S0()|0,e[it>>2]=22,oi(t,0),a=0;break e}}}}while(!1);if((L|0)==23&&(l=(e[ne>>2]|0)==0,l||(e[ae>>2]=(e[ae>>2]|0)+-1),(o|0)!=0&r>>>0>3))do l||(e[ae>>2]=(e[ae>>2]|0)+-1),r=r+-1|0;while(r>>>0>3);a=+(ke|0)*me}while(!1);return b=jt,+a}function wo(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;e:do if(r>>>0>36)l=S0()|0,e[l>>2]=22,l=0,a=0;else{z=t+4|0,_=t+100|0;do h=e[z>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0;while(ji(h)|0);t:do switch(h|0){case 43:case 45:if(d=((h|0)==45)<<31>>31,h=e[z>>2]|0,h>>>0<(e[_>>2]|0)>>>0){e[z>>2]=h+1,h=N[h>>0]|0,R=d;break t}else{h=u0(t)|0,R=d;break t}default:R=0}while(!1);d=(r|0)==0;do if((r&-17|0)==0&(h|0)==48){if(h=e[z>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,(h|32|0)!=120)if(d){r=8,E=46;break}else{E=32;break}if(r=e[z>>2]|0,r>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=r+1,h=N[r>>0]|0):h=u0(t)|0,(N[53879+(h+1)>>0]|0)>15){if(a=(e[_>>2]|0)==0,a||(e[z>>2]=(e[z>>2]|0)+-1),!o){oi(t,0),l=0,a=0;break e}if(a){l=0,a=0;break e}e[z>>2]=(e[z>>2]|0)+-1,l=0,a=0;break e}else r=16,E=46}else if(r=d?10:r,(N[53879+(h+1)>>0]|0)>>>0>>0)E=32;else{e[_>>2]|0&&(e[z>>2]=(e[z>>2]|0)+-1),oi(t,0),l=S0()|0,e[l>>2]=22,l=0,a=0;break e}while(!1);if((E|0)==32)if((r|0)==10){if(r=h+-48|0,r>>>0<10){for(h=0;;)if(d=(h*10|0)+r|0,r=e[z>>2]|0,r>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=r+1,h=N[r>>0]|0):h=u0(t)|0,r=h+-48|0,r>>>0<10&d>>>0<429496729)h=d;else{r=d;break}d=0}else r=0,d=0;if(o=h+-48|0,o>>>0<10){for(;;){if(w=Qi(r|0,d|0,10,0)|0,C=ye,D=((o|0)<0)<<31>>31,F=~D,C>>>0>F>>>0|(C|0)==(F|0)&w>>>0>~o>>>0){w=r;break}if(r=$0(w|0,C|0,o|0,D|0)|0,d=ye,h=e[z>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,o=h+-48|0,!(o>>>0<10&(d>>>0<429496729|(d|0)==429496729&r>>>0<2576980378))){w=r;break}}o>>>0>9?(h=w,r=R):(r=10,E=72)}else h=r,r=R}else E=46;t:do if((E|0)==46){if(!(r+-1&r)){if(E=S[54136+((r*23|0)>>>5&7)>>0]|0,d=S[53879+(h+1)>>0]|0,o=d&255,o>>>0>>0){for(h=0;w=o|h<>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,d=S[53879+(h+1)>>0]|0,o=d&255,w>>>0<134217728&o>>>0>>0;)h=w;o=0}else o=0,w=0;if(C=Di(-1,-1,E|0)|0,D=ye,(d&255)>>>0>=r>>>0|(o>>>0>D>>>0|(o|0)==(D|0)&w>>>0>C>>>0)){d=o,E=72;break}else h=o;for(;;)if(w=v0(w|0,h|0,E|0)|0,o=ye,w=d&255|w,h=e[z>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,d=S[53879+(h+1)>>0]|0,(d&255)>>>0>=r>>>0|(o>>>0>D>>>0|(o|0)==(D|0)&w>>>0>C>>>0)){d=o,E=72;break t}else h=o}if(d=S[53879+(h+1)>>0]|0,o=d&255,o>>>0>>0){for(h=0;w=o+(ie(h,r)|0)|0,h=e[z>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,d=S[53879+(h+1)>>0]|0,o=d&255,w>>>0<119304647&o>>>0>>0;)h=w;o=0}else w=0,o=0;if((d&255)>>>0>>0)for(E=xn(-1,-1,r|0,0)|0,F=ye,D=o;;){if(D>>>0>F>>>0|(D|0)==(F|0)&w>>>0>E>>>0){d=D,E=72;break t}if(o=Qi(w|0,D|0,r|0,0)|0,C=ye,d=d&255,C>>>0>4294967295|(C|0)==-1&o>>>0>~d>>>0){d=D,E=72;break t}if(w=$0(d|0,0,o|0,C|0)|0,o=ye,h=e[z>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,d=S[53879+(h+1)>>0]|0,(d&255)>>>0>=r>>>0){d=o,E=72;break}else D=o}else d=o,E=72}while(!1);if((E|0)==72)if((N[53879+(h+1)>>0]|0)>>>0>>0){do h=e[z>>2]|0,h>>>0<(e[_>>2]|0)>>>0?(e[z>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0;while((N[53879+(h+1)>>0]|0)>>>0>>0);d=S0()|0,e[d>>2]=34,d=l,h=a,r=(a&1|0)==0&!0?R:0}else h=w,r=R;if(e[_>>2]|0&&(e[z>>2]=(e[z>>2]|0)+-1),!(d>>>0>>0|(d|0)==(l|0)&h>>>0>>0)){if(!((a&1|0)!=0|!1|(r|0)!=0)){z=S0()|0,e[z>>2]=34,a=$0(a|0,l|0,-1,-1)|0,l=ye;break}if(d>>>0>l>>>0|(d|0)==(l|0)&h>>>0>a>>>0){z=S0()|0,e[z>>2]=34;break}}a=((r|0)<0)<<31>>31,a=ii(h^r|0,d^a|0,r|0,a|0)|0,l=ye}while(!1);return ye=l,a|0}function oi(t,r){t=t|0,r=r|0;var o=0,a=0,l=0;e[t+104>>2]=r,o=e[t+4>>2]|0,a=e[t+8>>2]|0,l=a-o|0,e[t+108>>2]=l,(r|0)!=0&(l|0)>(r|0)?e[t+100>>2]=o+r:e[t+100>>2]=a}function u0(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;return o=t+104|0,h=e[o>>2]|0,h|0&&(e[t+108>>2]|0)>=(h|0)?d=4:(r=br(t)|0,(r|0)>=0?(l=e[o>>2]|0,o=t+8|0,l?(a=e[o>>2]|0,h=e[t+4>>2]|0,o=a,l=l-(e[t+108>>2]|0)+-1|0,(o-h|0)>(l|0)?e[t+100>>2]=h+l:d=9):(a=e[o>>2]|0,o=a,d=9),(d|0)==9&&(e[t+100>>2]=o),o=e[t+4>>2]|0,a&&(t=t+108|0,e[t>>2]=a+1-o+(e[t>>2]|0)),o=o+-1|0,(N[o>>0]|0|0)!=(r|0)&&(S[o>>0]=r)):d=4),(d|0)==4&&(e[t+100>>2]=0,r=-1),r|0}function Xi(t){t=t|0;var r=0;return t>>>0>4294963200&&(r=S0()|0,e[r>>2]=0-t,t=-1),t|0}function CA(t){return t=t|0,0}function mS(t,r,o,a){return t=t|0,r=r|0,o=o|0,a=a|0,a|0}function yo(t,r){return t=t|0,r=r|0,-1}function gS(t){t=t|0,n0(t)}function SS(t,r){return t=t|0,r=r|0,(t+-48|0)>>>0<10|0}function AS(t,r){return t=t|0,r=r|0,pS(t)|0}function vS(t,r,o){return t=t|0,r=r|0,o=o|0,S[r>>0]|0&&$o(r,58885)|0&&$o(r,54145)|0?o=0:o||(o=Dd(1,4)|0),o|0}function ai(t){t=t|0;var r=0,o=0;return r=($r()|0)+176|0,o=e[r>>2]|0,t&&(e[r>>2]=t),o|0}function xS(t,r){t=+t,r=+r;var o=0,a=0;return B[q>>3]=t,a=e[q>>2]|0,o=e[q+4>>2]|0,B[q>>3]=r,o=e[q+4>>2]&-2147483648|o&2147483647,e[q>>2]=a,e[q+4>>2]=o,+ +B[q>>3]}function Co(t,r){return t=+t,r=+r,+ +xS(t,r)}function wS(t,r){t=+t,r=+r;var o=0,a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;B[q>>3]=t,o=e[q>>2]|0,D=e[q+4>>2]|0,B[q>>3]=r,E=e[q>>2]|0,F=e[q+4>>2]|0,a=Di(o|0,D|0,52)|0,a=a&2047,w=Di(E|0,F|0,52)|0,w=w&2047,R=D&-2147483648,d=v0(E|0,F|0,1)|0,C=ye;e:do if(!((d|0)==0&(C|0)==0)&&(h=F&2147483647,!(h>>>0>2146435072|(h|0)==2146435072&E>>>0>0|(a|0)==2047))){if(l=v0(o|0,D|0,1)|0,h=ye,!(h>>>0>C>>>0|(h|0)==(C|0)&l>>>0>d>>>0))return+((l|0)==(d|0)&(h|0)==(C|0)?t*0:t);if(a)l=D&1048575|1048576;else{if(a=v0(o|0,D|0,12)|0,l=ye,(l|0)>-1|(l|0)==-1&a>>>0>4294967295){h=a,a=0;do a=a+-1|0,h=v0(h|0,l|0,1)|0,l=ye;while((l|0)>-1|(l|0)==-1&h>>>0>4294967295)}else a=0;o=v0(o|0,D|0,1-a|0)|0,l=ye}if(w)D=F&1048575|1048576;else{if(h=v0(E|0,F|0,12)|0,d=ye,(d|0)>-1|(d|0)==-1&h>>>0>4294967295){w=0;do w=w+-1|0,h=v0(h|0,d|0,1)|0,d=ye;while((d|0)>-1|(d|0)==-1&h>>>0>4294967295)}else w=0;E=v0(E|0,F|0,1-w|0)|0,D=ye}C=ii(o|0,l|0,E|0,D|0)|0,d=ye,h=(d|0)>-1|(d|0)==-1&C>>>0>4294967295;t:do if((a|0)>(w|0)){for(;;){if(h){if((o|0)==(E|0)&(l|0)==(D|0))break;o=C,l=d}if(o=v0(o|0,l|0,1)|0,l=ye,a=a+-1|0,C=ii(o|0,l|0,E|0,D|0)|0,d=ye,h=(d|0)>-1|(d|0)==-1&C>>>0>4294967295,(a|0)<=(w|0))break t}r=t*0;break e}while(!1);if(h)if((o|0)==(E|0)&(l|0)==(D|0)){r=t*0;break}else l=d,o=C;if(l>>>0<1048576|(l|0)==1048576&o>>>0<0)do o=v0(o|0,l|0,1)|0,l=ye,a=a+-1|0;while(l>>>0<1048576|(l|0)==1048576&o>>>0<0);(a|0)>0?(F=$0(o|0,l|0,0,-1048576)|0,o=ye,a=v0(a|0,0,52)|0,o=o|ye,a=F|a):(a=Di(o|0,l|0,1-a|0)|0,o=ye),e[q>>2]=a,e[q+4>>2]=o|R,r=+B[q>>3]}else _=3;while(!1);return(_|0)==3&&(r=t*r,r=r/r),+r}function To(t,r){return t=+t,r=+r,+ +wS(t,r)}function Io(t,r){t=+t,r=r|0;var o=0,a=0,l=0;switch(B[q>>3]=t,o=e[q>>2]|0,a=e[q+4>>2]|0,l=Di(o|0,a|0,52)|0,l=l&2047,l|0){case 0:{t!=0?(t=+Io(t*18446744073709552e3,r),o=(e[r>>2]|0)+-64|0):o=0,e[r>>2]=o;break}case 2047:break;default:e[r>>2]=l+-1022,e[q>>2]=o,e[q+4>>2]=a&-2146435073|1071644672,t=+B[q>>3]}return+t}function yS(t,r){return t=+t,r=r|0,+ +Io(t,r)}function bn(t,r){t=+t,r=r|0;var o=0;return(r|0)>1023?(t=t*898846567431158e293,o=r+-1023|0,(o|0)>1023&&(o=r+-2046|0,o=(o|0)>1023?1023:o,t=t*898846567431158e293)):(r|0)<-1022?(t=t*22250738585072014e-324,o=r+1022|0,(o|0)<-1022&&(o=r+2044|0,o=(o|0)<-1022?-1022:o,t=t*22250738585072014e-324)):o=r,o=v0(o+1023|0,0,52)|0,r=ye,e[q>>2]=o,e[q+4>>2]=r,+(t*+B[q>>3])}function ko(t,r){return t=+t,r=r|0,+ +bn(t,r)}function CS(t,r,o){return t=t|0,r=r|0,o=o|0,Fn(0,t,r,o|0?o:37344)|0}function Fn(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;C=b,b=b+16|0,l=C,d=a|0?a:37348,a=e[d>>2]|0;e:do if(!r)a?w=15:a=0;else if(h=t|0?t:l,!o)a=-2;else{if(a)l=o,w=9;else{if(a=S[r>>0]|0,l=a&255,a<<24>>24>-1){e[h>>2]=l,a=a<<24>>24!=0&1;break}if(a=l+-194|0,a>>>0>50){w=15;break}a=e[37076+(a<<2)>>2]|0,l=o+-1|0,l&&(r=r+1|0,w=9)}t:do if((w|0)==9){if(t=S[r>>0]|0,D=(t&255)>>>3,(D+-16|D+(a>>26))>>>0>7){w=15;break e}for(;r=r+1|0,a=(t&255)+-128|a<<6,l=l+-1|0,!((a|0)>=0);){if(!l)break t;if(t=S[r>>0]|0,(t&-64)<<24>>24!=-128){w=15;break e}}e[d>>2]=0,e[h>>2]=a,a=o-l|0;break e}while(!1);e[d>>2]=a,a=-2}while(!1);return(w|0)==15&&(e[d>>2]=0,a=S0()|0,e[a>>2]=84,a=-1),b=C,a|0}function TS(t){return t=t|0,t?t=(e[t>>2]|0)==0:t=1,t&1|0}function IS(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0;R=b,b=b+1040|0,D=R+8|0,F=R,C=e[r>>2]|0,e[F>>2]=C,E=(t|0)!=0,a=E?a:256,t=E?t:D,h=C;e:do if((a|0)!=0&(C|0)!=0){for(w=a,C=h,a=0;;){if(h=o>>>2,d=h>>>0>=w>>>0,!(o>>>0>131|d)){h=C;break e}if(h=d?w:h,o=o-h|0,h=Eo(t,F,h,l)|0,(h|0)==-1){a=o;break}if(_=(t|0)==(D|0),C=_?0:h,d=w-C|0,t=_?t:t+(h<<2)|0,a=h+a|0,h=e[F>>2]|0,(w|0)!=(C|0)&(h|0)!=0)w=d,C=h;else{w=d;break e}}o=a,w=0,h=e[F>>2]|0,a=-1}else w=a,a=0;while(!1);e:do if(h|0&&(w|0)!=0&(o|0)!=0){for(d=h,h=t;t=Fn(h,d,o,l)|0,!((t+2|0)>>>0<3);)if(d=(e[F>>2]|0)+t|0,e[F>>2]=d,w=w+-1|0,a=a+1|0,(w|0)!=0&(o|0)!=(t|0))o=o-t|0,h=h+4|0;else break e;switch(t|0){case-1:{a=-1;break e}case 0:{e[F>>2]=0;break e}default:{e[l>>2]=0;break e}}}while(!1);return E&&(e[r>>2]=e[F>>2]),b=R,a|0}function Eo(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0;l=e[r>>2]|0,a|0&&(h=e[a>>2]|0,(h|0)!=0)?t?(e[a>>2]=0,C=t,a=o,w=h,D=37):(a=o,d=l,D=16):t?(h=t,a=o,D=6):(a=o,D=7);e:for(;;)if((D|0)==6){if(a)t=h;else{D=26;break}for(;;){h=S[l>>0]|0;do if(((h&255)+-1|0)>>>0<127&&a>>>0>4&(l&3|0)==0){for(d=l;;){if(l=e[d>>2]|0,(l+-16843009|l)&-2139062144){h=l,l=d,D=32;break}if(e[t>>2]=l&255,e[t+4>>2]=N[d+1>>0],e[t+8>>2]=N[d+2>>0],l=d+4|0,h=t+16|0,e[t+12>>2]=N[d+3>>0],a=a+-4|0,a>>>0>4)t=h,d=l;else{D=31;break}}if((D|0)==31){t=h,h=S[l>>0]|0;break}else if((D|0)==32){h=h&255;break}}while(!1);if(h=h&255,(h+-1|0)>>>0>=127)break;if(l=l+1|0,e[t>>2]=h,a=a+-1|0,a)t=t+4|0;else{D=26;break e}}if(h=h+-194|0,h>>>0>50){D=48;break}C=t,w=e[37076+(h<<2)>>2]|0,l=l+1|0,D=37;continue}else if((D|0)==7){if(h=S[l>>0]|0,((h&255)+-1|0)>>>0<127&&!(l&3|0)){if(h=e[l>>2]|0,!((h+-16843009|h)&-2139062144))do l=l+4|0,a=a+-4|0,h=e[l>>2]|0;while(!((h+-16843009|h)&-2139062144|0));h=h&255}if(h=h&255,(h+-1|0)>>>0<127){a=a+-1|0,l=l+1|0,D=7;continue}if(h=h+-194|0,h>>>0>50){D=48;break}h=e[37076+(h<<2)>>2]|0,d=l+1|0,D=16;continue}else if((D|0)==16){if(D=(N[d>>0]|0)>>>3,(D+-16|D+(h>>26))>>>0>7){D=17;break}if(l=d+1|0,h&33554432){if((S[l>>0]&-64)<<24>>24!=-128){D=20;break}if(l=d+2|0,h&524288){if((S[l>>0]&-64)<<24>>24!=-128){D=23;break}l=d+3|0}}a=a+-1|0,D=7;continue}else if((D|0)==37){if(h=N[l>>0]|0,D=h>>>3,(D+-16|D+(w>>26))>>>0>7){D=38;break}if(d=l+1|0,t=h+-128|w<<6,(t|0)<0){if(h=N[d>>0]|0,(h&192|0)!=128){D=41;break}if(d=l+2|0,t=h+-128|t<<6,(t|0)<0){if(h=N[d>>0]|0,(h&192|0)!=128){D=44;break}t=h+-128|t<<6,l=l+3|0}else l=d}else l=d;e[C>>2]=t,h=C+4|0,a=a+-1|0,D=6;continue}return(D|0)==17||(D|0)==20||(D|0)==23?(l=d+-1|0,D=47):(D|0)==26?e[r>>2]=l:(D|0)==38?(t=C,h=w,l=l+-1|0,D=47):((D|0)==41||(D|0)==44)&&(a=C,o=l+-1|0,D=52),(D|0)==47&&(h?(a=t,o=l,D=52):D=48),(D|0)==48&&(S[l>>0]|0?(a=t,o=l,D=52):(t&&(e[t>>2]=0,e[r>>2]=0),o=o-a|0)),(D|0)==52&&(D=S0()|0,e[D>>2]=84,a&&(e[r>>2]=o),o=-1),o|0}function kS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;d=b,b=b+16|0,a=d;e:do if(!r)a=0;else{do if(o){if(h=t|0?t:a,a=S[r>>0]|0,t=a&255,a<<24>>24>-1){e[h>>2]=t,a=a<<24>>24!=0&1;break e}if(a=t+-194|0,a>>>0<=50){if(t=r+1|0,l=e[37076+(a<<2)>>2]|0,o>>>0<4&&l&-2147483648>>>((o*6|0)+-6|0)|0)break;if(a=N[t>>0]|0,o=a>>>3,(o+-16|o+(l>>26))>>>0<=7){if(a=a+-128|l<<6,(a|0)>=0){e[h>>2]=a,a=2;break e}if(t=N[r+2>>0]|0,(t&192|0)==128){if(t=t+-128|a<<6,(t|0)>=0){e[h>>2]=t,a=3;break e}if(a=N[r+3>>0]|0,(a&192|0)==128){e[h>>2]=a+-128|t<<6,a=4;break e}}}}}while(!1);a=S0()|0,e[a>>2]=84,a=-1}while(!1);return b=d,a|0}function Oi(t,r,o){t=t|0,r=r|0,o=o|0;do if(t){if(r>>>0<128){S[t>>0]=r,t=1;break}if(r>>>0<2048){S[t>>0]=r>>>6|192,S[t+1>>0]=r&63|128,t=2;break}if(r>>>0<55296|(r&-8192|0)==57344){S[t>>0]=r>>>12|224,S[t+1>>0]=r>>>6&63|128,S[t+2>>0]=r&63|128,t=3;break}if((r+-65536|0)>>>0<1048576){S[t>>0]=r>>>18|240,S[t+1>>0]=r>>>12&63|128,S[t+2>>0]=r>>>6&63|128,S[t+3>>0]=r&63|128,t=4;break}else{t=S0()|0,e[t>>2]=84,t=-1;break}}else t=1;while(!1);return t|0}function ES(t,r,o,a,l){t=t|0,r=r|0,o=o|0,a=a|0,l=l|0;var h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0;E=b,b=b+272|0,w=E+8|0,D=E,d=e[r>>2]|0,e[D>>2]=d,C=(t|0)!=0,l=C?a:256,a=C?t:w,t=d;e:do if((l|0)!=0&(d|0)!=0){for(d=l,h=t,l=0;;){if(t=o>>>0>=d>>>0,!(t|o>>>0>32)){t=h;break e}if(t=t?d:o,o=o-t|0,t=DS(a,D,t,0)|0,(t|0)==-1){l=o;break}if(R=(a|0)==(w|0),F=R?0:t,h=d-F|0,a=R?a:a+t|0,l=t+l|0,t=e[D>>2]|0,(d|0)!=(F|0)&(t|0)!=0)d=h,h=t;else{d=h;break e}}o=l,d=0,t=e[D>>2]|0,l=-1}else d=l,l=0;while(!1);e:do if(t|0&&(d|0)!=0&(o|0)!=0){for(h=t,t=a;a=Oi(t,e[h>>2]|0,0)|0,!((a+1|0)>>>0<2);)if(h=(e[D>>2]|0)+4|0,e[D>>2]=h,o=o+-1|0,l=l+1|0,(d|0)!=(a|0)&(o|0)!=0)d=d-a|0,t=t+a|0;else break e;a?l=-1:e[D>>2]=0}while(!1);return C&&(e[r>>2]=e[D>>2]),b=E,l|0}function DS(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0;w=b,b=b+16|0,d=w;e:do if(t){t:do if(o>>>0>3){for(a=o,l=e[r>>2]|0;;){if(h=e[l>>2]|0,(h+-1|0)>>>0>126){if(!h)break;if(h=Oi(t,h,0)|0,(h|0)==-1){o=-1;break e}t=t+h|0,a=a-h|0}else S[t>>0]=h,t=t+1|0,a=a+-1|0,l=e[r>>2]|0;if(l=l+4|0,e[r>>2]=l,a>>>0<=3)break t}S[t>>0]=0,e[r>>2]=0,o=o-a|0;break e}else a=o;while(!1);if(a){for(l=e[r>>2]|0;;){if(h=e[l>>2]|0,(h+-1|0)>>>0>126){if(!h){l=19;break}if(h=Oi(d,h,0)|0,(h|0)==-1){o=-1;break e}if(a>>>0>>0){l=22;break}Oi(t,e[l>>2]|0,0)|0,t=t+h|0,a=a-h|0}else S[t>>0]=h,t=t+1|0,a=a+-1|0,l=e[r>>2]|0;if(l=l+4|0,e[r>>2]=l,!a)break e}if((l|0)==19){S[t>>0]=0,e[r>>2]=0,o=o-a|0;break}else if((l|0)==22){o=o-a|0;break}}}else if(t=e[r>>2]|0,a=e[t>>2]|0,!a)o=0;else{o=0;do{if(a>>>0>127){if(a=Oi(d,a,0)|0,(a|0)==-1){o=-1;break e}}else a=1;o=a+o|0,t=t+4|0,a=e[t>>2]|0}while(a|0)}while(!1);return b=w,o|0}function Do(t,r){return t=t|0,r=r|0,t?t=Oi(t,r,0)|0:t=0,t|0}function Ri(t){return t=t|0,0}function mi(t){t=t|0}function bo(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0,C=0;C=b,b=b+16|0,w=C,d=r&255,S[w>>0]=d,a=t+16|0,l=e[a>>2]|0,l?h=4:Ro(t)|0?o=-1:(l=e[a>>2]|0,h=4);do if((h|0)==4){if(a=t+20|0,h=e[a>>2]|0,h>>>0>>0&&(o=r&255,(o|0)!=(S[t+75>>0]|0))){e[a>>2]=h+1,S[h>>0]=d;break}(Yt[e[t+36>>2]&63](t,w,1)|0)==1?o=N[w>>0]|0:o=-1}while(!1);return b=C,o|0}function bS(t){t=t|0;var r=0,o=0;return r=b,b=b+16|0,o=r,e[o>>2]=e[t+60>>2],t=Xi(Zo(6,o|0)|0)|0,b=r,t|0}function NS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0;return D=b,b=b+48|0,h=D+16|0,l=D,a=D+32|0,e[a>>2]=r,d=a+4|0,C=t+48|0,E=e[C>>2]|0,e[d>>2]=o-((E|0)!=0&1),w=t+44|0,e[a+8>>2]=e[w>>2],e[a+12>>2]=E,e[9258]|0?(zr(185,t|0),e[l>>2]=e[t+60>>2],e[l+4>>2]=a,e[l+8>>2]=2,a=Xi(Wr(145,l|0)|0)|0,Vr(0)):(e[h>>2]=e[t+60>>2],e[h+4>>2]=a,e[h+8>>2]=2,a=Xi(Wr(145,h|0)|0)|0),(a|0)>=1?(d=e[d>>2]|0,a>>>0>d>>>0&&(h=e[w>>2]|0,l=t+4|0,e[l>>2]=h,e[t+8>>2]=h+(a-d),e[C>>2]|0&&(e[l>>2]=h+1,S[r+(o+-1)>>0]=S[h>>0]|0),a=o)):(e[t>>2]=e[t>>2]|a&48^16,e[t+8>>2]=0,e[t+4>>2]=0),b=D,a|0}function RS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0;return l=b,b=b+32|0,h=l,a=l+20|0,e[h>>2]=e[t+60>>2],e[h+4>>2]=0,e[h+8>>2]=r,e[h+12>>2]=a,e[h+16>>2]=o,(Xi(ta(140,h|0)|0)|0)<0?(e[a>>2]=-1,t=-1):t=e[a>>2]|0,b=l,t|0}function Fo(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0;for(z=b,b=b+48|0,F=z+16|0,E=z,a=z+32|0,R=t+28|0,l=e[R>>2]|0,e[a>>2]=l,_=t+20|0,l=(e[_>>2]|0)-l|0,e[a+4>>2]=l,e[a+8>>2]=r,e[a+12>>2]=o,C=t+60|0,D=t+44|0,r=2,l=l+o|0;;){if(e[9258]|0?(zr(186,t|0),e[E>>2]=e[C>>2],e[E+4>>2]=a,e[E+8>>2]=r,d=Xi(Hr(146,E|0)|0)|0,Vr(0)):(e[F>>2]=e[C>>2],e[F+4>>2]=a,e[F+8>>2]=r,d=Xi(Hr(146,F|0)|0)|0),(l|0)==(d|0)){l=6;break}if((d|0)<0){l=8;break}l=l-d|0,h=e[a+4>>2]|0,d>>>0<=h>>>0?(r|0)==2?(e[R>>2]=(e[R>>2]|0)+d,w=h,r=2):w=h:(w=e[D>>2]|0,e[R>>2]=w,e[_>>2]=w,w=e[a+12>>2]|0,d=d-h|0,a=a+8|0,r=r+-1|0),e[a>>2]=(e[a>>2]|0)+d,e[a+4>>2]=w-d}return(l|0)==6?(F=e[D>>2]|0,e[t+16>>2]=F+(e[t+48>>2]|0),t=F,e[R>>2]=t,e[_>>2]=t):(l|0)==8&&(e[t+16>>2]=0,e[R>>2]=0,e[_>>2]=0,e[t>>2]=e[t>>2]|32,(r|0)==2?o=0:o=o-(e[a+4>>2]|0)|0),b=z,o|0}function MS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return l=b,b=b+80|0,a=l,e[t+36>>2]=8,!(e[t>>2]&64|0)&&(e[a>>2]=e[t+60>>2],e[a+4>>2]=21505,e[a+8>>2]=l+12,(Ko(54,a|0)|0)!=0)&&(S[t+75>>0]=-1),a=Fo(t,r,o)|0,b=l,a|0}function _S(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;return a=t+84|0,h=e[a>>2]|0,d=o+256|0,l=Oo(h,0,d)|0,l=l|0?l-h|0:d,o=l>>>0>>0?l:o,o0(r|0,h|0,o|0)|0,e[t+4>>2]=h+o,r=h+l|0,e[t+8>>2]=r,e[a>>2]=r,o|0}function No(t){t=t|0;var r=0,o=0;return r=t+74|0,o=S[r>>0]|0,S[r>>0]=o+255|o,r=t+20|0,o=t+44|0,(e[r>>2]|0)>>>0>(e[o>>2]|0)>>>0&&Yt[e[t+36>>2]&63](t,0,0)|0,e[t+16>>2]=0,e[t+28>>2]=0,e[r>>2]=0,r=e[t>>2]|0,r&20?(r&4&&(e[t>>2]=r|32),r=-1):(r=e[o>>2]|0,e[t+8>>2]=r,e[t+4>>2]=r,r=0),r|0}function Ro(t){t=t|0;var r=0,o=0;return r=t+74|0,o=S[r>>0]|0,S[r>>0]=o+255|o,r=e[t>>2]|0,r&8?(e[t>>2]=r|32,r=-1):(e[t+8>>2]=0,e[t+4>>2]=0,r=e[t+44>>2]|0,e[t+28>>2]=r,e[t+20>>2]=r,e[t+16>>2]=r+(e[t+48>>2]|0),r=0),r|0}function br(t){t=t|0;var r=0,o=0;return o=b,b=b+16|0,r=o,!(e[t+8>>2]|0)&&No(t)|0?r=-1:(Yt[e[t+32>>2]&63](t,r,1)|0)==1?r=N[r>>0]|0:r=-1,b=o,r|0}function Fr(t){t=t|0;var r=0,o=0;do if(t){if((e[t+76>>2]|0)<=-1){r=Mr(t)|0;break}o=(Ri(t)|0)==0,r=Mr(t)|0,o||mi(t)}else{if(e[9323]|0?r=Fr(e[9323]|0)|0:r=0,M0(37060),t=e[9264]|0,t)do(e[t+76>>2]|0)>-1?o=Ri(t)|0:o=0,(e[t+20>>2]|0)>>>0>(e[t+28>>2]|0)>>>0&&(r=Mr(t)|0|r),o&&mi(t),t=e[t+56>>2]|0;while(t|0);Yo(37060)}while(!1);return r|0}function PS(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0;(e[r+76>>2]|0)>=0&&Ri(r)|0?((S[r+75>>0]|0)!=(t|0)&&(a=r+20|0,l=e[a>>2]|0,l>>>0<(e[r+16>>2]|0)>>>0)?(e[a>>2]=l+1,S[l>>0]=t,o=t&255):o=bo(r,t)|0,mi(r)):d=3;do if((d|0)==3){if((S[r+75>>0]|0)!=(t|0)&&(h=r+20|0,o=e[h>>2]|0,o>>>0<(e[r+16>>2]|0)>>>0)){e[h>>2]=o+1,S[o>>0]=t,o=t&255;break}o=bo(r,t)|0}while(!1);return o|0}function B0(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;a=o+16|0,l=e[a>>2]|0,l?h=4:Ro(o)|0?a=0:(l=e[a>>2]|0,h=4);e:do if((h|0)==4){if(d=o+20|0,h=e[d>>2]|0,(l-h|0)>>>0>>0){a=Yt[e[o+36>>2]&63](o,t,r)|0;break}t:do if((S[o+75>>0]|0)>-1){for(a=r;;){if(!a){l=h,a=0;break t}if(l=a+-1|0,(S[t+l>>0]|0)==10)break;a=l}if((Yt[e[o+36>>2]&63](o,t,a)|0)>>>0>>0)break e;r=r-a|0,t=t+a|0,l=e[d>>2]|0}else l=h,a=0;while(!1);o0(l|0,t|0,r|0)|0,e[d>>2]=(e[d>>2]|0)+r,a=a+r|0}while(!1);return a|0}function gi(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return l=ie(o,r)|0,(e[a+76>>2]|0)>-1?(h=(Ri(a)|0)==0,t=B0(t,l,a)|0,h||mi(a)):t=B0(t,l,a)|0,(t|0)!=(l|0)&&(o=(t>>>0)/(r>>>0)|0),o|0}function Nn(t){t=t|0;var r=0,o=0,a=0;(e[t+76>>2]|0)>=0&&Ri(t)|0?(r=t+4|0,o=e[r>>2]|0,o>>>0<(e[t+8>>2]|0)>>>0?(e[r>>2]=o+1,r=N[o>>0]|0):r=br(t)|0):a=3;do if((a|0)==3)if(r=t+4|0,o=e[r>>2]|0,o>>>0<(e[t+8>>2]|0)>>>0){e[r>>2]=o+1,r=N[o>>0]|0;break}else{r=br(t)|0;break}while(!1);return r|0}function Mo(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0;return l=b,b=b+16|0,h=l,e[h>>2]=a,a=Mn(t,r,o,h)|0,b=l,a|0}function _o(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;return a=b,b=b+16|0,l=a,e[l>>2]=o,o=Lo(t,r,l)|0,b=a,o|0}function Rn(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0;do if((t|0)!=-1){if((e[r+76>>2]|0)>-1?l=Ri(r)|0:l=0,!(e[r+8>>2]|0)&&No(r)|0||(h=6),(h|0)==6&&(o=r+4|0,a=e[o>>2]|0,a>>>0>((e[r+44>>2]|0)+-8|0)>>>0)){if(h=a+-1|0,e[o>>2]=h,S[h>>0]=t,e[r>>2]=e[r>>2]&-17,!l)break;mi(r);break}l&&mi(r),t=-1}else t=-1;while(!1);return t|0}function LS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0;w=b,b=b+16|0,a=w,l=E0(240)|0;do if(l){if(e[a>>2]=e[o>>2],a=Mn(l,240,r,a)|0,a>>>0<240){r=Gi(l,a+1|0)|0,e[t>>2]=r|0?r:l;break}n0(l),(a|0)>=0&&(d=a+1|0,h=E0(d)|0,e[t>>2]=h,(h|0)!=0)?a=Mn(h,d,r,o)|0:a=-1}else a=-1;while(!1);return b=w,a|0}function Po(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0;H=b,b=b+224|0,F=H+80|0,z=H+96|0,_=H,R=H+136|0,a=z,l=a+40|0;do e[a>>2]=0,a=a+4|0;while((a|0)<(l|0));return e[F>>2]=e[o>>2],(cr(0,r,F,_,z)|0)<0?o=-1:((e[t+76>>2]|0)>-1?D=Ri(t)|0:D=0,o=e[t>>2]|0,E=o&32,(S[t+74>>0]|0)<1&&(e[t>>2]=o&-33),o=t+48|0,e[o>>2]|0?a=cr(t,r,F,_,z)|0:(l=t+44|0,h=e[l>>2]|0,e[l>>2]=R,d=t+28|0,e[d>>2]=R,w=t+20|0,e[w>>2]=R,e[o>>2]=80,C=t+16|0,e[C>>2]=R+80,a=cr(t,r,F,_,z)|0,h&&(Yt[e[t+36>>2]&63](t,0,0)|0,a=e[w>>2]|0?a:-1,e[l>>2]=h,e[o>>2]=0,e[C>>2]=0,e[d>>2]=0,e[w>>2]=0)),o=e[t>>2]|0,e[t>>2]=o|E,D&&mi(t),o=o&32|0?-1:a),b=H,o|0}function OS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0,w=0,C=0,D=0,E=0,F=0,R=0,_=0,z=0,H=0,K=0,G=0,$=0,P=0,L=0,J=0,ne=0,ae=0,re=0,ce=0,Ee=0,ke=0,Te=0,it=0,jt=0,Gt=0,s0=0,i0=0,zt=0;i0=b,b=b+304|0,ce=i0+16|0,ke=i0+8|0,Ee=i0+33|0,Te=i0,G=i0+32|0,(e[t+76>>2]|0)>-1?s0=Ri(t)|0:s0=0,a=S[r>>0]|0;e:do if(a<<24>>24){it=t+4|0,jt=t+100|0,re=t+108|0,$=t+8|0,P=Ee+10|0,L=Ee+33|0,J=ke+4|0,ne=Ee+46|0,ae=Ee+94|0,h=a,a=0,d=r,F=0,l=0,r=0;t:for(;;){i:do if(ji(h&255)|0){for(;h=d+1|0,ji(N[h>>0]|0)|0;)d=h;oi(t,0);do h=e[it>>2]|0,h>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0;while(ji(h)|0);h=e[it>>2]|0,e[jt>>2]|0&&(h=h+-1|0,e[it>>2]=h),w=(e[re>>2]|0)+F+h-(e[$>>2]|0)|0}else{h=(S[d>>0]|0)==37;n:do if(h){D=d+1|0,w=S[D>>0]|0;r:do switch(w<<24>>24){case 37:break n;case 42:{K=0,w=d+2|0;break}default:{if(w=(w&255)+-48|0,w>>>0<10&&(S[d+2>>0]|0)==36){for(e[ce>>2]=e[o>>2];K=(e[ce>>2]|0)+3&-4,h=e[K>>2]|0,e[ce>>2]=K+4,w>>>0>1;)w=w+-1|0;K=h,w=d+3|0;break r}w=(e[o>>2]|0)+3&-4,K=e[w>>2]|0,e[o>>2]=w+4,w=D}}while(!1);if(h=S[w>>0]|0,d=h&255,(d+-48|0)>>>0<10)for(h=0;D=(h*10|0)+-48+d|0,w=w+1|0,h=S[w>>0]|0,d=h&255,!((d+-48|0)>>>0>=10);)h=D;else D=0;switch(h<<24>>24==109?(w=w+1|0,E=S[w>>0]|0,h=(K|0)!=0&1,l=0,r=0):(E=h,h=0),d=w+1|0,E&255|0){case 104:{H=(S[d>>0]|0)==104,d=H?w+2|0:d,w=H?-2:-1;break}case 108:{H=(S[d>>0]|0)==108,d=H?w+2|0:d,w=H?3:1;break}case 106:{w=3;break}case 116:case 122:{w=1;break}case 76:{w=2;break}case 110:case 112:case 67:case 83:case 91:case 99:case 115:case 88:case 71:case 70:case 69:case 65:case 103:case 102:case 101:case 97:case 120:case 117:case 111:case 105:case 100:{d=w,w=0;break}default:{Gt=152;break t}}switch(E=N[d>>0]|0,R=(E&47|0)==3,E=R?E|32:E,R=R?1:w,E|0){case 99:{H=F,z=(D|0)<1?1:D;break}case 91:{H=F,z=D;break}case 110:{if(!K){w=F;break i}switch(R|0){case-2:{S[K>>0]=F,w=F;break i}case-1:{k[K>>1]=F,w=F;break i}case 0:{e[K>>2]=F,w=F;break i}case 1:{e[K>>2]=F,w=F;break i}case 3:{w=K,e[w>>2]=F,e[w+4>>2]=((F|0)<0)<<31>>31,w=F;break i}default:{w=F;break i}}}default:{oi(t,0);do w=e[it>>2]|0,w>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=w+1,w=N[w>>0]|0):w=u0(t)|0;while(ji(w)|0);w=e[it>>2]|0,e[jt>>2]|0&&(w=w+-1|0,e[it>>2]=w),H=(e[re>>2]|0)+F+w-(e[$>>2]|0)|0,z=D}}if(oi(t,z),w=e[it>>2]|0,D=e[jt>>2]|0,w>>>0>>0)e[it>>2]=w+1;else{if((u0(t)|0)<0){Gt=152;break t}D=e[jt>>2]|0}D&&(e[it>>2]=(e[it>>2]|0)+-1);r:do switch(E|0){case 91:case 99:case 115:{_=(E|0)==99;s:do if((E&239|0)==99)Jt(Ee|0,-1,257)|0,S[Ee>>0]=0,(E|0)==115&&(S[L>>0]=0,S[P>>0]=0,S[P+1>>0]=0,S[P+2>>0]=0,S[P+3>>0]=0,S[P+4>>0]=0);else{switch(zt=d+1|0,F=(S[zt>>0]|0)==94,w=F&1,E=F?zt:d,d=F?d+2|0:zt,Jt(Ee|0,F&1|0,257)|0,S[Ee>>0]=0,S[d>>0]|0){case 45:{F=(w^1)&255,S[ne>>0]=F,d=E+2|0;break}case 93:{F=(w^1)&255,S[ae>>0]=F,d=E+2|0;break}default:F=(w^1)&255}for(;;){w=S[d>>0]|0;o:do switch(w<<24>>24){case 0:{Gt=152;break t}case 93:break s;case 45:{switch(E=d+1|0,w=S[E>>0]|0,w<<24>>24){case 93:case 0:{w=45;break o}default:}if(d=S[d+-1>>0]|0,(d&255)<(w&255)){d=d&255;do d=d+1|0,S[Ee+d>>0]=F,w=S[E>>0]|0;while((d|0)<(w&255|0));d=E}else d=E;break}default:}while(!1);S[Ee+((w&255)+1)>>0]=F,d=d+1|0}}while(!1);E=_?z+1|0:31,F=(R|0)==1,R=(h|0)!=0;s:do if(F){if(R){if(r=E0(E<<2)|0,!r){l=0,Gt=152;break t}}else r=K;e[ke>>2]=0,e[J>>2]=0,l=0;o:for(;;){D=(r|0)==0;do{a:for(;;){if(w=e[it>>2]|0,w>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=w+1,w=N[w>>0]|0):w=u0(t)|0,!(S[Ee+(w+1)>>0]|0))break o;switch(S[G>>0]=w,Fn(Te,G,1,ke)|0){case-1:{l=0,Gt=152;break t}case-2:break;default:break a}}D||(e[r+(l<<2)>>2]=e[Te>>2],l=l+1|0)}while(!(R&(l|0)==(E|0)));if(l=E<<1|1,w=Gi(r,l<<2)|0,!w){l=0,Gt=152;break t}zt=E,E=l,r=w,l=zt}if(TS(ke)|0)D=l,l=0;else{l=0,Gt=152;break t}}else{if(R){if(l=E0(E)|0,l)w=0;else{l=0,r=0,Gt=152;break t}for(;;){do{if(r=e[it>>2]|0,r>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,!(S[Ee+(r+1)>>0]|0)){D=w,r=0;break s}S[l+w>>0]=r,w=w+1|0}while((w|0)!=(E|0));if(r=E<<1|1,w=Gi(l,r)|0,w)zt=E,E=r,l=w,w=zt;else{r=0,Gt=152;break t}}}if(K)for(l=0;;){if(r=e[it>>2]|0,r>>>0>>0?(e[it>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,!(S[Ee+(r+1)>>0]|0)){D=l,l=K,r=0;break s}S[K+l>>0]=r,D=e[jt>>2]|0,l=l+1|0}else for(l=D;;){if(r=e[it>>2]|0,r>>>0>>0?(e[it>>2]=r+1,r=N[r>>0]|0):r=u0(t)|0,!(S[Ee+(r+1)>>0]|0)){D=0,l=0,r=0;break s}l=e[jt>>2]|0}}while(!1);if(w=e[it>>2]|0,e[jt>>2]|0&&(w=w+-1|0,e[it>>2]=w),w=w-(e[$>>2]|0)+(e[re>>2]|0)|0,!w||!((w|0)==(z|0)|_^1))break t;do if(R)if(F){e[K>>2]=r;break}else{e[K>>2]=l;break}while(!1);if(!_){if(r&&(e[r+(D<<2)>>2]=0),!l){l=0;break r}S[l+D>>0]=0}break}case 120:case 88:case 112:{w=16,Gt=134;break}case 111:{w=8,Gt=134;break}case 117:case 100:{w=10,Gt=134;break}case 105:{w=0,Gt=134;break}case 71:case 103:case 70:case 102:case 69:case 101:case 65:case 97:{if(C=+xo(t,R,0),(e[re>>2]|0)==((e[$>>2]|0)-(e[it>>2]|0)|0))break t;if(K)switch(R|0){case 0:{U[K>>2]=C;break r}case 1:{B[K>>3]=C;break r}case 2:{B[K>>3]=C;break r}default:break r}break}default:}while(!1);r:do if((Gt|0)==134){if(Gt=0,w=wo(t,w,0,-1,-1)|0,(e[re>>2]|0)==((e[$>>2]|0)-(e[it>>2]|0)|0))break t;if((K|0)!=0&(E|0)==112){e[K>>2]=w;break}if(K)switch(R|0){case-2:{S[K>>0]=w;break r}case-1:{k[K>>1]=w;break r}case 0:{e[K>>2]=w;break r}case 1:{e[K>>2]=w;break r}case 3:{zt=K,e[zt>>2]=w,e[zt+4>>2]=ye;break r}default:break r}}while(!1);a=((K|0)!=0&1)+a|0,w=(e[re>>2]|0)+H+(e[it>>2]|0)-(e[$>>2]|0)|0;break i}while(!1);if(d=d+(h&1)|0,oi(t,0),h=e[it>>2]|0,h>>>0<(e[jt>>2]|0)>>>0?(e[it>>2]=h+1,h=N[h>>0]|0):h=u0(t)|0,(h|0)!=(N[d>>0]|0)){Gt=21;break t}w=F+1|0}while(!1);if(d=d+1|0,h=S[d>>0]|0,h<<24>>24)F=w;else break e}if((Gt|0)==21){if(e[jt>>2]|0&&(e[it>>2]=(e[it>>2]|0)+-1),(a|0)!=0|(h|0)>-1)break;a=0,Gt=153}else(Gt|0)==152&&(a||(a=h,Gt=153));(Gt|0)==153&&(h=a,a=-1),h&&(n0(l),n0(r))}else a=0;while(!1);return s0&&mi(t),b=i0,a|0}function Mn(t,r,o,a){t=t|0,r=r|0,o=o|0,a=a|0;var l=0,h=0,d=0,w=0,C=0,D=0,E=0;E=b,b=b+128|0,l=E+112|0,D=E,h=D,d=37352,w=h+112|0;do e[h>>2]=e[d>>2],h=h+4|0,d=d+4|0;while((h|0)<(w|0));return(r+-1|0)>>>0>2147483646?r?(r=S0()|0,e[r>>2]=75,r=-1):(r=1,C=4):(l=t,C=4),(C|0)==4&&(C=-2-l|0,C=r>>>0>C>>>0?C:r,e[D+48>>2]=C,t=D+20|0,e[t>>2]=l,e[D+44>>2]=l,r=l+C|0,l=D+16|0,e[l>>2]=r,e[D+28>>2]=r,r=Po(D,o,a)|0,C&&(o=e[t>>2]|0,S[o+(((o|0)==(e[l>>2]|0))<<31>>31)>>0]=0)),b=E,r|0}function Lo(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;h=b,b=b+112|0,a=h,l=a,d=l+112|0;do e[l>>2]=0,l=l+4|0;while((l|0)<(d|0));return e[a+32>>2]=29,e[a+44>>2]=t,e[a+76>>2]=-1,e[a+84>>2]=t,d=OS(a,r,o)|0,b=h,d|0}function Nr(t,r,o){return t=t|0,r=r|0,o=o|0,+ +kd(t,r,2)}function $S(t,r,o){return t=t|0,r=r|0,o=o|0,t=_s(t,r,o,-1,-1)|0,t|0}function BS(t,r,o){return t=t|0,r=r|0,o=o|0,t=_s(t,r,o,0,-2147483648)|0,t|0}function Oo(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0,h=0,d=0;h=r&255,a=(o|0)!=0;e:do if(a&(t&3|0)!=0)for(l=r&255;;){if((S[t>>0]|0)==l<<24>>24){d=6;break e}if(t=t+1|0,o=o+-1|0,a=(o|0)!=0,!(a&(t&3|0)!=0)){d=5;break}}else d=5;while(!1);(d|0)==5&&(a?d=6:o=0);e:do if((d|0)==6&&(l=r&255,(S[t>>0]|0)!=l<<24>>24)){a=ie(h,16843009)|0;t:do if(o>>>0>3){for(;h=e[t>>2]^a,!((h&-2139062144^-2139062144)&h+-16843009);)if(t=t+4|0,o=o+-4|0,o>>>0<=3){d=11;break t}}else d=11;while(!1);if((d|0)==11&&!o){o=0;break}for(;;){if((S[t>>0]|0)==l<<24>>24)break e;if(t=t+1|0,o=o+-1|0,!o){o=0;break}}}while(!1);return(o|0?t:0)|0}function VS(t,r){t=t|0,r=r|0;var o=0,a=0;o=r;e:do if((o^t)&3)a=8;else{if(o&3)do{if(o=S[r>>0]|0,S[t>>0]=o,!(o<<24>>24))break e;r=r+1|0,t=t+1|0}while(r&3|0);if(o=e[r>>2]|0,!((o&-2139062144^-2139062144)&o+-16843009))for(a=t;r=r+4|0,t=a+4|0,e[a>>2]=o,o=e[r>>2]|0,!((o&-2139062144^-2139062144)&o+-16843009);)a=t;a=8}while(!1);if((a|0)==8&&(a=S[r>>0]|0,S[t>>0]=a,a<<24>>24))do r=r+1|0,t=t+1|0,a=S[r>>0]|0,S[t>>0]=a;while(a<<24>>24);return t|0}function $o(t,r){t=t|0,r=r|0;var o=0,a=0;if(a=S[t>>0]|0,o=S[r>>0]|0,!(a<<24>>24)||a<<24>>24!=o<<24>>24)r=a;else{do t=t+1|0,r=r+1|0,a=S[t>>0]|0,o=S[r>>0]|0;while(!(!(a<<24>>24)||a<<24>>24!=o<<24>>24));r=a}return(r&255)-(o&255)|0}function Rr(t,r){return t=t|0,r=r|0,VS(t,r)|0,t|0}function $i(t){t=t|0;var r=0,o=0,a=0;a=t;e:do if(!(a&3))o=4;else for(r=t,t=a;;){if(!(S[r>>0]|0))break e;if(r=r+1|0,t=r,!(t&3)){t=r,o=4;break}}while(!1);if((o|0)==4){for(;r=e[t>>2]|0,!((r&-2139062144^-2139062144)&r+-16843009);)t=t+4|0;if((r&255)<<24>>24)do t=t+1|0;while(S[t>>0]|0)}return t-a|0}function US(t,r,o){t=t|0,r=r|0,o=o|0;var a=0,l=0;if(!o)r=0;else{a=S[t>>0]|0;e:do if(!(a<<24>>24))a=0;else for(;;){if(o=o+-1|0,l=S[r>>0]|0,!(a<<24>>24==l<<24>>24&((o|0)!=0&l<<24>>24!=0)))break e;if(t=t+1|0,r=r+1|0,a=S[t>>0]|0,!(a<<24>>24)){a=0;break}}while(!1);r=(a&255)-(N[r>>0]|0)|0}return r|0}function _n(t){t=t|0;var r=0;for(r=t;e[r>>2]|0;)r=r+4|0;return r-t>>2|0}function Bi(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(o)for(a=t;o=o+-1|0,e[a>>2]=e[r>>2],o;)r=r+4|0,a=a+4|0;return t|0}function zS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(a=(o|0)==0,t-r>>2>>>0>>0){if(!a)do o=o+-1|0,e[t+(o<<2)>>2]=e[r+(o<<2)>>2];while(o|0)}else if(!a)for(a=r,r=t;o=o+-1|0,e[r>>2]=e[a>>2],o;)a=a+4|0,r=r+4|0;return t|0}function GS(t,r,o){t=t|0,r=r|0,o=o|0;var a=0;if(o)for(a=t;o=o+-1|0,e[a>>2]=r,o;)a=a+4|0;return t|0}function Bo(t,r){t=t|0,r=r|0;var o=0,a=0,l=0,h=0,d=0,w=0;switch(d=t+4|0,o=e[d>>2]|0,w=t+100|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0,o|0){case 43:case 45:{a=(o|0)==45&1,o=e[d>>2]|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0,(r|0)!=0&(o+-48|0)>>>0>9&&e[w>>2]|0&&(e[d>>2]=(e[d>>2]|0)+-1),h=a;break}default:h=0}if((o+-48|0)>>>0>9)e[w>>2]|0?(e[d>>2]=(e[d>>2]|0)+-1,a=-2147483648,o=0):(a=-2147483648,o=0);else{a=0;do a=o+-48+(a*10|0)|0,o=e[d>>2]|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0;while((o+-48|0)>>>0<10&(a|0)<214748364);if(r=((a|0)<0)<<31>>31,(o+-48|0)>>>0<10){do r=Qi(a|0,r|0,10,0)|0,a=ye,o=$0(o|0,((o|0)<0)<<31>>31|0,-48,-1)|0,a=$0(o|0,ye|0,r|0,a|0)|0,r=ye,o=e[d>>2]|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0;while((o+-48|0)>>>0<10&((r|0)<21474836|(r|0)==21474836&a>>>0<2061584302));l=a}else l=a;if((o+-48|0)>>>0<10)do o=e[d>>2]|0,o>>>0<(e[w>>2]|0)>>>0?(e[d>>2]=o+1,o=N[o>>0]|0):o=u0(t)|0;while((o+-48|0)>>>0<10);e[w>>2]|0&&(e[d>>2]=(e[d>>2]|0)+-1),t=(h|0)!=0,o=ii(0,0,l|0,r|0)|0,a=t?ye:r,o=t?o:l}return ye=a,o|0}function qS(t){t=t|0,e[t+68>>2]|0||mi(t)}function WS(t){t=t|0,e[t+68>>2]|0||mi(t)}function Mr(t){t=t|0;var r=0,o=0,a=0,l=0,h=0,d=0;return r=t+20|0,h=t+28|0,(e[r>>2]|0)>>>0>(e[h>>2]|0)>>>0&&(Yt[e[t+36>>2]&63](t,0,0)|0,(e[r>>2]|0)==0)?r=-1:(d=t+4|0,o=e[d>>2]|0,a=t+8|0,l=e[a>>2]|0,o>>>0>>0&&Yt[e[t+40>>2]&63](t,o-l|0,1)|0,e[t+16>>2]=0,e[h>>2]=0,e[r>>2]=0,e[a>>2]=0,e[d>>2]=0,r=0),r|0}var HS=[bi,nf,of,eh,nh,ah,uh,Sn,An,bi,bi,bi,bi,bi,bi,bi],Pn=[sn,Y5,Ju,zu,Nu,xu,cu,eu,V2,tS,eS,J6,sn,sn,sn,sn],QS=[so,ph,xh,so],Rt=[e0,W5,H5,Yu,ju,$u,Bu,Eu,Du,gu,Su,ou,au,j2,X2,L2,O2,T2,I2,m2,g2,r2,s2,K1,Y1,$1,B1,n1,r1,Kl,Yl,Ia,ka,Ml,Ol,_l,hm,Xs,dm,pm,ul,cl,w6,hl,il,nl,Ua,za,Ha,Qa,Xa,Za,dl,pl,Al,vl,Cl,Tl,Dl,bl,Hl,Ql,d1,p1,A1,v1,C1,T1,b1,F1,K2,Y2,mp,i6,f6,h6,y6,C6,R6,M6,In,O6,V6,U6,G6,H6,q6,W6,Q6,K6,rn,Ld,zd,wt,Hd,Zd,fr,pp,Mp,Hp,sm,Qs,om,am,um,Ys,cm,fm,Am,Zs,vm,xm,km,Em,G0,Dm,bm,Fm,Rm,Gh,Lm,Om,Um,zm,eg,tg,dg,pg,Ig,kg,hc,dc,Mc,_c,ef,tf,rf,sf,lf,uf,vf,xf,Ff,Nf,Uf,zf,Zf,Jf,sh,oh,hh,dh,Ah,vh,Th,Ih,bh,Fh,Rs,Lh,Ms,sd,io,Td,eo,r4,to,s4,Nm,Uh,Wh,md,$g,Hg,e4,t4,T6,fo,pi,Ta,Sr,lm,Ul,G2,cS,qS,WS,Nd,gS,th,fn,qh,L3,G3,q3,W3,H3,Q3,K3,de,Pt,n0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0,e0],t0=[Tr,K5,Zu,Uu,Fu,vu,uu,J2,B2,E2,S2,o2,j1,V1,s1,jl,Ea,_p,d6,p6,Od,Ud,Qd,Xd,Qp,hf,df,pf,mf,Sf,Af,Cf,Tf,If,kf,Df,bf,_f,Pf,Lf,Of,Bf,Vf,Wf,Hf,Qf,Kf,jf,Xf,Dh,Mh,f4,d4,m4,h4,p4,g4,Sa,I6,m6,g6,ho,Rp,Pa,Oa,mm,Fp,yp,Vl,Jl,_1,G1,J1,c2,x2,N2,z2,iu,hu,yu,Mu,qu,ic,X5,u6,Ni,rp,ip,Np,wm,np,xp,kp,Ip,r3,s3,o3,l3,u3,c3,Cd,f3,h3,d3,p3,m3,g3,S3,A3,v3,x3,w3,y3,C3,T3,I3,k3,E3,D3,b3,F3,N3,R3,M3,_3,J3,Tr,Tr],on=[F0,Gm,qm,Wm,Hm,Qm,Km,Ym,jm,Xm,Zm,Jm,ig,ng,rg,sg,og,ag,lg,ug,cg,fg,hg,Ag,xg,Fg,oc,mc,gc,Sc,Ac,vc,Lc,Oc,$c,Bc,Vc,Sh,Ch,Ui,Hi,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0,F0],Et=[r0,$p,Bp,ol,zp,n6,_6,$6,z6,bS,$d,Zp,em,tm,Xp,Gd,qd,Kd,Up,Jd,ep,ym,pc,S4,x4,y4,D4,N4,T4,k4,Pc,A4,w4,C4,F4,R4,I4,E4,cf,ff,gf,wf,yf,Ef,Rf,Mf,$f,Gf,qf,Yf,_g,Pg,Og,o4,u4,l4,c4,vd,xd,yd,zg,Gg,Wg,jg,Xg,Jg,o6,Xe,f0,d0,Ks,js,P5,L5,O5,ai,_n,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r0],KS=[oo,ih,lh,oo],Yt=[C0,Pp,Vp,qp,ap,lp,Y6,Ed,Fo,RS,NS,MS,Kp,Jp,Bd,nm,Yd,Pm,Vm,kh,Nh,ad,ud,dd,Hh,Xh,Jh,nd,La,Id,Gs,vS,t3,n3,Oi,kS,CS,LS,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0],YS=[ao,gh,yh,ao],Vi=[Fi,rl,rS,nS,iS,Yp,Lp,Eh,Rh,Fi,Fi,Fi,Fi,Fi,Fi,Fi],jS=[yn,Sg,yg,bg,uc,yn,yn,yn],XS=[Cn,rh,fh,mh,wh,Cn,Cn,Cn],U0=[L0,Q5,Xu,Vu,bu,Au,lu,Z2,$2,F2,v2,u2,Z1,z1,l1,Zl,ba,al,ll,im,Vd,Wd,rm,Gp,jd,tp,Wp,od,ld,cd,jh,Zh,ed,k6,xa,ya,gm,O0,Sm,AS,SS,Ap,Cp,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0,L0],an=[di,Mm,$m,mg,gg,vg,Tg,Eg,Dg,sc,fc,pd,Mg,Lg,rd,Ad,wd,Ug,qg,Yg,Zg,ES,IS,di,di,di,di,di,di,di,di,di],ZS=[$5,i5,t5,e5],JS=[Li,Aa,po,b0,$h,Bh,Vh,fS,dS,hS,Li,Li,Li,Li,Li,Li],_r=[Ki,D2,A2,l2,X1,U1,o1,Xl,Da,hd,Qh,Kh,Yh,id,s6,c6,z4,Z4,Eo,mS,Fn,u5,l5,o5,s5,r5,n5,Ki,Ki,Ki,Ki,Ki],Ln=[B5,sp,r6,Cm,E6,yi,V5,dp,zs,S6,cp,Im,J4,e3,i3,mr],Vo=[lo,U5,aS,z5,lS,G5,En,lo],Ci=[Yi,xc,Uc,Ng,Rg,gd,Sd,Bg,Vg,Qg,Kg,Yi,Yi,Yi,Yi,Yi],eA=[Tn,wg,Cg,ac,cc,Tn,Tn,Tn],On=[H0,$l,Bl,Pl,Ll,sl,Ga,qa,Ka,Ya,Ja,el,ml,gl,xl,wl,Il,kl,Fl,Nl,m1,g1,x1,w1,I1,E1,N1,R1,j6,X6,Z6,jp,Op,_m,Bm,fa,hp,Fa,Na,Ra,Ma,$a,Ba,Va,u1,c1,f1,h1,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0,H0];return{_jpegls_encode:b6,___cxa_can_catch:sS,_free:n0,_jpegls_decode:D6,___cxa_is_pointer_type:oS,_i64Add:$0,_memmove:vn,_i64Subtract:ii,_memset:Jt,_malloc:E0,_memcpy:o0,_bitshift64Lshr:Di,_bitshift64Shl:v0,__GLOBAL__I_000101:Rd,__GLOBAL__sub_I_jpegls_cpp:Ca,__GLOBAL__sub_I_iostream_cpp:Md,runPostSets:c5,_emscripten_replace_memory:ia,stackAlloc:na,stackSave:ra,stackRestore:sa,establishStackSpace:oa,setThrew:aa,setTempRet0:la,getTempRet0:ua,dynCall_iiiiiiii:h5,dynCall_viiiii:d5,dynCall_iiiiiid:p5,dynCall_vi:m5,dynCall_vii:g5,dynCall_iiiiiii:S5,dynCall_ii:A5,dynCall_iiiiiiiiiiii:v5,dynCall_iiii:x5,dynCall_viiiiiiiiiiiiiii:w5,dynCall_viiiiii:y5,dynCall_viiiiiii:C5,dynCall_viiiiiiiiii:T5,dynCall_iii:I5,dynCall_iiiiii:k5,dynCall_diii:E5,dynCall_i:D5,dynCall_iiiii:b5,dynCall_viii:F5,dynCall_v:N5,dynCall_iiiiiiiii:R5,dynCall_iiiiid:M5,dynCall_viiii:_5}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module._jpegls_encode=asm._jpegls_encode,Module.___cxa_can_catch=asm.___cxa_can_catch;var _free=Module._free=asm._free;Module._jpegls_decode=asm._jpegls_decode,Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type;var _i64Add=Module._i64Add=asm._i64Add,_memmove=Module._memmove=asm._memmove,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_memset=Module._memset=asm._memset,_malloc=Module._malloc=asm._malloc,_memcpy=Module._memcpy=asm._memcpy,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory;Module.runPostSets=asm.runPostSets,Module.__GLOBAL__sub_I_iostream_cpp=asm.__GLOBAL__sub_I_iostream_cpp;var _bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,__GLOBAL__sub_I_jpegls_cpp=Module.__GLOBAL__sub_I_jpegls_cpp=asm.__GLOBAL__sub_I_jpegls_cpp,__GLOBAL__I_000101=Module.__GLOBAL__I_000101=asm.__GLOBAL__I_000101,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl;Module.dynCall_iiiiiiii=asm.dynCall_iiiiiiii,Module.dynCall_viiiii=asm.dynCall_viiiii,Module.dynCall_iiiiiid=asm.dynCall_iiiiiid,Module.dynCall_vi=asm.dynCall_vi,Module.dynCall_vii=asm.dynCall_vii,Module.dynCall_iiiiiii=asm.dynCall_iiiiiii,Module.dynCall_ii=asm.dynCall_ii,Module.dynCall_iiiiiiiiiiii=asm.dynCall_iiiiiiiiiiii,Module.dynCall_iiii=asm.dynCall_iiii,Module.dynCall_viiiiiiiiiiiiiii=asm.dynCall_viiiiiiiiiiiiiii,Module.dynCall_viiiiii=asm.dynCall_viiiiii,Module.dynCall_viiiiiii=asm.dynCall_viiiiiii,Module.dynCall_viiiiiiiiii=asm.dynCall_viiiiiiiiii,Module.dynCall_iii=asm.dynCall_iii,Module.dynCall_iiiiii=asm.dynCall_iiiiii,Module.dynCall_diii=asm.dynCall_diii,Module.dynCall_i=asm.dynCall_i,Module.dynCall_iiiii=asm.dynCall_iiiii,Module.dynCall_viii=asm.dynCall_viii,Module.dynCall_v=asm.dynCall_v,Module.dynCall_iiiiiiiii=asm.dynCall_iiiiiiiii,Module.dynCall_iiiiid=asm.dynCall_iiiiid,Module.dynCall_viiii=asm.dynCall_viiii,Runtime.stackAlloc=asm.stackAlloc,Runtime.stackSave=asm.stackSave,Runtime.stackRestore=asm.stackRestore,Runtime.establishStackSpace=asm.establishStackSpace,Runtime.setTempRet0=asm.setTempRet0,Runtime.getTempRet0=asm.getTempRet0;function ExitStatus(u){this.name="ExitStatus",this.message="Program terminated with exit("+u+")",this.status=u}ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;dependenciesFulfilled=function u(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=u)},Module.callMain=Module.callMain=function u(n){assert(runDependencies==0,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called"),n=n||[],ensureInitRuntime();var s=n.length+1;function c(){for(var v=0;v<3;v++)f.push(0)}var f=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];c();for(var g=0;g0||(preRun(),runDependencies>0)||Module.calledRun)return;function n(){Module.calledRun||(Module.calledRun=!0,!ABORT&&(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(u),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),n()},1)):n()}Module.run=Module.run=run;function exit(u,n){if(!(n&&Module.noExitRuntime))throw Module.noExitRuntime||(ABORT=!0,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(u)),ENVIRONMENT_IS_NODE?(process.stdout.once("drain",function(){process.exit(u)}),console.log(" "),setTimeout(function(){process.exit(u)},500)):ENVIRONMENT_IS_SHELL&&typeof quit=="function"&&quit(u),new ExitStatus(u)}Module.exit=Module.exit=exit;var abortDecorators=[];function abort(u){u!==void 0?(Module.print(u),Module.printErr(u),u=JSON.stringify(u)):u="",ABORT=!0;var n=` +If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,s="abort("+u+") at "+stackTrace()+n;throw abortDecorators&&abortDecorators.forEach(function(c){s=c(s,u)}),s}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),run(),Module};module.exports&&(module.exports=CharLS)}(charLSDynamicMemoryBrowser)),charLSDynamicMemoryBrowser.exports}var hasRequiredJpegLs;function requireJpegLs(){return hasRequiredJpegLs||(hasRequiredJpegLs=1,function(u){var n=n||(typeof commonjsRequire<"u"?requireCharLSDynamicMemoryBrowser():null),s=function(){var c;function f(){}f.prototype={decodeJPEGLS:function(y,T){return v(y,T)}};function g(y,T){var I=c._malloc(y.length);c.writeArrayToMemory(y,I);var S=c._malloc(4),k=c._malloc(4),e=c._malloc(4),N=c._malloc(4),M=c._malloc(4),O=c._malloc(4),U=c._malloc(4),B=c._malloc(4),V=c._malloc(4),b=c.ccall("jpegls_decode","number",["number","number","number","number","number","number","number","number","number","number","number"],[I,y.length,S,k,e,N,M,O,B,U,V]),W={result:b,width:c.getValue(e,"i32"),height:c.getValue(N,"i32"),bitsPerSample:c.getValue(M,"i32"),stride:c.getValue(O,"i32"),components:c.getValue(B,"i32"),allowedLossyError:c.getValue(U,"i32"),interleaveMode:c.getValue(V,"i32"),pixelData:void 0},q=c.getValue(S,"*");return W.bitsPerSample<=8?(W.pixelData=new Uint8Array(W.width*W.height*W.components),W.pixelData.set(new Uint8Array(c.HEAP8.buffer,q,W.pixelData.length))):T?(W.pixelData=new Int16Array(W.width*W.height*W.components),W.pixelData.set(new Int16Array(c.HEAP16.buffer,q,W.pixelData.length))):(W.pixelData=new Uint16Array(W.width*W.height*W.components),W.pixelData.set(new Uint16Array(c.HEAP16.buffer,q,W.pixelData.length))),c._free(I),c._free(q),c._free(S),c._free(k),c._free(e),c._free(N),c._free(M),c._free(O),c._free(B),c._free(V),W}function A(){if(typeof n>"u")throw"No JPEG-LS decoder loaded";if(!c&&(c=n(),!c||!c._jpegls_decode))throw"JPEG-LS failed to initialize"}function v(y,T){A();var I=g(y,T);if(I.result!==0&&I.result!==6)throw"JPEG-LS decoder failed to decode frame (error code "+I.result+")";var S={};return S.columns=I.width,S.rows=I.height,S.pixelData=I.pixelData,S}return f}();u.exports&&(u.exports=s)}(jpegLs)),jpegLs.exports}var parser={exports:{}},pako={},deflate$1={},deflate={},trees={},hasRequiredTrees;function requireTrees(){if(hasRequiredTrees)return trees;hasRequiredTrees=1;const u=4,n=0,s=1,c=2;function f(ie){let Be=ie.length;for(;--Be>=0;)ie[Be]=0}const g=0,A=1,v=2,y=3,T=258,I=29,S=256,k=S+1+I,e=30,N=19,M=2*k+1,O=15,U=16,B=7,V=256,b=16,W=17,q=18,Y=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),X=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Q=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),m=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z=512,ee=new Array((k+2)*2);f(ee);const oe=new Array(e*2);f(oe);const fe=new Array(Z);f(fe);const me=new Array(T-y+1);f(me);const pe=new Array(I);f(pe);const Se=new Array(e);f(Se);function xe(ie,Be,st,Ye,ht){this.static_tree=ie,this.extra_bits=Be,this.extra_base=st,this.elems=Ye,this.max_length=ht,this.has_stree=ie&&ie.length}let we,Fe,De;function Ze(ie,Be){this.dyn_tree=ie,this.max_code=0,this.stat_desc=Be}const nt=ie=>ie<256?fe[ie]:fe[256+(ie>>>7)],Ue=(ie,Be)=>{ie.pending_buf[ie.pending++]=Be&255,ie.pending_buf[ie.pending++]=Be>>>8&255},ye=(ie,Be,st)=>{ie.bi_valid>U-st?(ie.bi_buf|=Be<>U-ie.bi_valid,ie.bi_valid+=st-U):(ie.bi_buf|=Be<{ye(ie,st[Be*2],st[Be*2+1])},ft=(ie,Be)=>{let st=0;do st|=ie&1,ie>>>=1,st<<=1;while(--Be>0);return st>>>1},Tt=ie=>{ie.bi_valid===16?(Ue(ie,ie.bi_buf),ie.bi_buf=0,ie.bi_valid=0):ie.bi_valid>=8&&(ie.pending_buf[ie.pending++]=ie.bi_buf&255,ie.bi_buf>>=8,ie.bi_valid-=8)},Lt=(ie,Be)=>{const st=Be.dyn_tree,Ye=Be.max_code,ht=Be.stat_desc.static_tree,vt=Be.stat_desc.has_stree,Me=Be.stat_desc.extra_bits,je=Be.stat_desc.extra_base,ue=Be.stat_desc.max_length;let Ae,Vt,ge,Ut,Ve,Zt,ot=0;for(Ut=0;Ut<=O;Ut++)ie.bl_count[Ut]=0;for(st[ie.heap[ie.heap_max]*2+1]=0,Ae=ie.heap_max+1;Aeue&&(Ut=ue,ot++),st[Vt*2+1]=Ut,!(Vt>Ye)&&(ie.bl_count[Ut]++,Ve=0,Vt>=je&&(Ve=Me[Vt-je]),Zt=st[Vt*2],ie.opt_len+=Zt*(Ut+Ve),vt&&(ie.static_len+=Zt*(ht[Vt*2+1]+Ve)));if(ot!==0){do{for(Ut=ue-1;ie.bl_count[Ut]===0;)Ut--;ie.bl_count[Ut]--,ie.bl_count[Ut+1]+=2,ie.bl_count[ue]--,ot-=2}while(ot>0);for(Ut=ue;Ut!==0;Ut--)for(Vt=ie.bl_count[Ut];Vt!==0;)ge=ie.heap[--Ae],!(ge>Ye)&&(st[ge*2+1]!==Ut&&(ie.opt_len+=(Ut-st[ge*2+1])*st[ge*2],st[ge*2+1]=Ut),Vt--)}},Ot=(ie,Be,st)=>{const Ye=new Array(O+1);let ht=0,vt,Me;for(vt=1;vt<=O;vt++)ht=ht+st[vt-1]<<1,Ye[vt]=ht;for(Me=0;Me<=Be;Me++){let je=ie[Me*2+1];je!==0&&(ie[Me*2]=ft(Ye[je]++,je))}},Ft=()=>{let ie,Be,st,Ye,ht;const vt=new Array(O+1);for(st=0,Ye=0;Ye>=7;Ye{let Be;for(Be=0;Be{ie.bi_valid>8?Ue(ie,ie.bi_buf):ie.bi_valid>0&&(ie.pending_buf[ie.pending++]=ie.bi_buf),ie.bi_buf=0,ie.bi_valid=0},Re=(ie,Be,st,Ye)=>{const ht=Be*2,vt=st*2;return ie[ht]{const Ye=ie.heap[st];let ht=st<<1;for(;ht<=ie.heap_len&&(ht{let Ye,ht,vt=0,Me,je;if(ie.sym_next!==0)do Ye=ie.pending_buf[ie.sym_buf+vt++]&255,Ye+=(ie.pending_buf[ie.sym_buf+vt++]&255)<<8,ht=ie.pending_buf[ie.sym_buf+vt++],Ye===0?at(ie,ht,Be):(Me=me[ht],at(ie,Me+S+1,Be),je=Y[Me],je!==0&&(ht-=pe[Me],ye(ie,ht,je)),Ye--,Me=nt(Ye),at(ie,Me,st),je=X[Me],je!==0&&(Ye-=Se[Me],ye(ie,Ye,je)));while(vt{const st=Be.dyn_tree,Ye=Be.stat_desc.static_tree,ht=Be.stat_desc.has_stree,vt=Be.stat_desc.elems;let Me,je,ue=-1,Ae;for(ie.heap_len=0,ie.heap_max=M,Me=0;Me>1;Me>=1;Me--)Qe(ie,st,Me);Ae=vt;do Me=ie.heap[1],ie.heap[1]=ie.heap[ie.heap_len--],Qe(ie,st,1),je=ie.heap[1],ie.heap[--ie.heap_max]=Me,ie.heap[--ie.heap_max]=je,st[Ae*2]=st[Me*2]+st[je*2],ie.depth[Ae]=(ie.depth[Me]>=ie.depth[je]?ie.depth[Me]:ie.depth[je])+1,st[Me*2+1]=st[je*2+1]=Ae,ie.heap[1]=Ae++,Qe(ie,st,1);while(ie.heap_len>=2);ie.heap[--ie.heap_max]=ie.heap[1],Lt(ie,Be),Ot(st,ue,ie.bl_count)},lt=(ie,Be,st)=>{let Ye,ht=-1,vt,Me=Be[0*2+1],je=0,ue=7,Ae=4;for(Me===0&&(ue=138,Ae=3),Be[(st+1)*2+1]=65535,Ye=0;Ye<=st;Ye++)vt=Me,Me=Be[(Ye+1)*2+1],!(++je{let Ye,ht=-1,vt,Me=Be[0*2+1],je=0,ue=7,Ae=4;for(Me===0&&(ue=138,Ae=3),Ye=0;Ye<=st;Ye++)if(vt=Me,Me=Be[(Ye+1)*2+1],!(++je{let Be;for(lt(ie,ie.dyn_ltree,ie.l_desc.max_code),lt(ie,ie.dyn_dtree,ie.d_desc.max_code),be(ie,ie.bl_desc),Be=N-1;Be>=3&&ie.bl_tree[m[Be]*2+1]===0;Be--);return ie.opt_len+=3*(Be+1)+5+5+4,Be},Ge=(ie,Be,st,Ye)=>{let ht;for(ye(ie,Be-257,5),ye(ie,st-1,5),ye(ie,Ye-4,4),ht=0;ht{let Be=4093624447,st;for(st=0;st<=31;st++,Be>>>=1)if(Be&1&&ie.dyn_ltree[st*2]!==0)return n;if(ie.dyn_ltree[9*2]!==0||ie.dyn_ltree[10*2]!==0||ie.dyn_ltree[13*2]!==0)return s;for(st=32;st{Je||(Ft(),Je=!0),ie.l_desc=new Ze(ie.dyn_ltree,we),ie.d_desc=new Ze(ie.dyn_dtree,Fe),ie.bl_desc=new Ze(ie.bl_tree,De),ie.bi_buf=0,ie.bi_valid=0,Mt(ie)},qe=(ie,Be,st,Ye)=>{ye(ie,(g<<1)+(Ye?1:0),3),Ke(ie),Ue(ie,st),Ue(ie,~st),st&&ie.pending_buf.set(ie.window.subarray(Be,Be+st),ie.pending),ie.pending+=st},xt=ie=>{ye(ie,A<<1,3),at(ie,V,ee),Tt(ie)},He=(ie,Be,st,Ye)=>{let ht,vt,Me=0;ie.level>0?(ie.strm.data_type===c&&(ie.strm.data_type=_e(ie)),be(ie,ie.l_desc),be(ie,ie.d_desc),Me=Le(ie),ht=ie.opt_len+3+7>>>3,vt=ie.static_len+3+7>>>3,vt<=ht&&(ht=vt)):ht=vt=st+5,st+4<=ht&&Be!==-1?qe(ie,Be,st,Ye):ie.strategy===u||vt===ht?(ye(ie,(A<<1)+(Ye?1:0),3),Ie(ie,ee,oe)):(ye(ie,(v<<1)+(Ye?1:0),3),Ge(ie,ie.l_desc.max_code+1,ie.d_desc.max_code+1,Me+1),Ie(ie,ie.dyn_ltree,ie.dyn_dtree)),Mt(ie),Ye&&Ke(ie)},rt=(ie,Be,st)=>(ie.pending_buf[ie.sym_buf+ie.sym_next++]=Be,ie.pending_buf[ie.sym_buf+ie.sym_next++]=Be>>8,ie.pending_buf[ie.sym_buf+ie.sym_next++]=st,Be===0?ie.dyn_ltree[st*2]++:(ie.matches++,Be--,ie.dyn_ltree[(me[st]+S+1)*2]++,ie.dyn_dtree[nt(Be)*2]++),ie.sym_next===ie.sym_end);return trees._tr_init=We,trees._tr_stored_block=qe,trees._tr_flush_block=He,trees._tr_tally=rt,trees._tr_align=xt,trees}var adler32_1,hasRequiredAdler32;function requireAdler32(){return hasRequiredAdler32||(hasRequiredAdler32=1,adler32_1=(n,s,c,f)=>{let g=n&65535|0,A=n>>>16&65535|0,v=0;for(;c!==0;){v=c>2e3?2e3:c,c-=v;do g=g+s[f++]|0,A=A+g|0;while(--v);g%=65521,A%=65521}return g|A<<16|0}),adler32_1}var crc32_1,hasRequiredCrc32;function requireCrc32(){if(hasRequiredCrc32)return crc32_1;hasRequiredCrc32=1;const u=()=>{let c,f=[];for(var g=0;g<256;g++){c=g;for(var A=0;A<8;A++)c=c&1?3988292384^c>>>1:c>>>1;f[g]=c}return f},n=new Uint32Array(u());return crc32_1=(c,f,g,A)=>{const v=n,y=A+g;c^=-1;for(let T=A;T>>8^v[(c^f[T])&255];return c^-1},crc32_1}var messages,hasRequiredMessages;function requireMessages(){return hasRequiredMessages||(hasRequiredMessages=1,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),messages}var constants,hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,constants={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),constants}var hasRequiredDeflate$1;function requireDeflate$1(){if(hasRequiredDeflate$1)return deflate;hasRequiredDeflate$1=1;const{_tr_init:u,_tr_stored_block:n,_tr_flush_block:s,_tr_tally:c,_tr_align:f}=requireTrees(),g=requireAdler32(),A=requireCrc32(),v=requireMessages(),{Z_NO_FLUSH:y,Z_PARTIAL_FLUSH:T,Z_FULL_FLUSH:I,Z_FINISH:S,Z_BLOCK:k,Z_OK:e,Z_STREAM_END:N,Z_STREAM_ERROR:M,Z_DATA_ERROR:O,Z_BUF_ERROR:U,Z_DEFAULT_COMPRESSION:B,Z_FILTERED:V,Z_HUFFMAN_ONLY:b,Z_RLE:W,Z_FIXED:q,Z_DEFAULT_STRATEGY:Y,Z_UNKNOWN:X,Z_DEFLATED:Q}=requireConstants(),m=9,Z=15,ee=8,me=256+1+29,pe=30,Se=19,xe=2*me+1,we=15,Fe=3,De=258,Ze=De+Fe+1,nt=32,Ue=42,ye=57,at=69,ft=73,Tt=91,Lt=103,Ot=113,Ft=666,Mt=1,Ke=2,Re=3,Qe=4,Ie=3,be=(se,ut)=>(se.msg=v[ut],ut),lt=se=>se*2-(se>4?9:0),ze=se=>{let ut=se.length;for(;--ut>=0;)se[ut]=0},Le=se=>{let ut,Ce,Pe,ve=se.w_size;ut=se.hash_size,Pe=ut;do Ce=se.head[--Pe],se.head[Pe]=Ce>=ve?Ce-ve:0;while(--ut);ut=ve,Pe=ut;do Ce=se.prev[--Pe],se.prev[Pe]=Ce>=ve?Ce-ve:0;while(--ut)};let _e=(se,ut,Ce)=>(ut<{const ut=se.state;let Ce=ut.pending;Ce>se.avail_out&&(Ce=se.avail_out),Ce!==0&&(se.output.set(ut.pending_buf.subarray(ut.pending_out,ut.pending_out+Ce),se.next_out),se.next_out+=Ce,ut.pending_out+=Ce,se.total_out+=Ce,se.avail_out-=Ce,ut.pending-=Ce,ut.pending===0&&(ut.pending_out=0))},We=(se,ut)=>{s(se,se.block_start>=0?se.block_start:-1,se.strstart-se.block_start,ut),se.block_start=se.strstart,Je(se.strm)},qe=(se,ut)=>{se.pending_buf[se.pending++]=ut},xt=(se,ut)=>{se.pending_buf[se.pending++]=ut>>>8&255,se.pending_buf[se.pending++]=ut&255},He=(se,ut,Ce,Pe)=>{let ve=se.avail_in;return ve>Pe&&(ve=Pe),ve===0?0:(se.avail_in-=ve,ut.set(se.input.subarray(se.next_in,se.next_in+ve),Ce),se.state.wrap===1?se.adler=g(se.adler,ut,ve,Ce):se.state.wrap===2&&(se.adler=A(se.adler,ut,ve,Ce)),se.next_in+=ve,se.total_in+=ve,ve)},rt=(se,ut)=>{let Ce=se.max_chain_length,Pe=se.strstart,ve,bt,Xt=se.prev_length,Wt=se.nice_match;const $e=se.strstart>se.w_size-Ze?se.strstart-(se.w_size-Ze):0,p0=se.window,R0=se.w_mask,Q0=se.prev,M0=se.strstart+De;let ni=p0[Pe+Xt-1],St=p0[Pe+Xt];se.prev_length>=se.good_match&&(Ce>>=2),Wt>se.lookahead&&(Wt=se.lookahead);do if(ve=ut,!(p0[ve+Xt]!==St||p0[ve+Xt-1]!==ni||p0[ve]!==p0[Pe]||p0[++ve]!==p0[Pe+1])){Pe+=2,ve++;do;while(p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&p0[++Pe]===p0[++ve]&&PeXt){if(se.match_start=ut,Xt=bt,bt>=Wt)break;ni=p0[Pe+Xt-1],St=p0[Pe+Xt]}}while((ut=Q0[ut&R0])>$e&&--Ce!==0);return Xt<=se.lookahead?Xt:se.lookahead},ie=se=>{const ut=se.w_size;let Ce,Pe,ve;do{if(Pe=se.window_size-se.lookahead-se.strstart,se.strstart>=ut+(ut-Ze)&&(se.window.set(se.window.subarray(ut,ut+ut-Pe),0),se.match_start-=ut,se.strstart-=ut,se.block_start-=ut,se.insert>se.strstart&&(se.insert=se.strstart),Le(se),Pe+=ut),se.strm.avail_in===0)break;if(Ce=He(se.strm,se.window,se.strstart+se.lookahead,Pe),se.lookahead+=Ce,se.lookahead+se.insert>=Fe)for(ve=se.strstart-se.insert,se.ins_h=se.window[ve],se.ins_h=_e(se,se.ins_h,se.window[ve+1]);se.insert&&(se.ins_h=_e(se,se.ins_h,se.window[ve+Fe-1]),se.prev[ve&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=ve,ve++,se.insert--,!(se.lookahead+se.insert{let Ce=se.pending_buf_size-5>se.w_size?se.w_size:se.pending_buf_size-5,Pe,ve,bt,Xt=0,Wt=se.strm.avail_in;do{if(Pe=65535,bt=se.bi_valid+42>>3,se.strm.avail_outve+se.strm.avail_in&&(Pe=ve+se.strm.avail_in),Pe>bt&&(Pe=bt),Pe>8,se.pending_buf[se.pending-2]=~Pe,se.pending_buf[se.pending-1]=~Pe>>8,Je(se.strm),ve&&(ve>Pe&&(ve=Pe),se.strm.output.set(se.window.subarray(se.block_start,se.block_start+ve),se.strm.next_out),se.strm.next_out+=ve,se.strm.avail_out-=ve,se.strm.total_out+=ve,se.block_start+=ve,Pe-=ve),Pe&&(He(se.strm,se.strm.output,se.strm.next_out,Pe),se.strm.next_out+=Pe,se.strm.avail_out-=Pe,se.strm.total_out+=Pe)}while(Xt===0);return Wt-=se.strm.avail_in,Wt&&(Wt>=se.w_size?(se.matches=2,se.window.set(se.strm.input.subarray(se.strm.next_in-se.w_size,se.strm.next_in),0),se.strstart=se.w_size,se.insert=se.strstart):(se.window_size-se.strstart<=Wt&&(se.strstart-=se.w_size,se.window.set(se.window.subarray(se.w_size,se.w_size+se.strstart),0),se.matches<2&&se.matches++,se.insert>se.strstart&&(se.insert=se.strstart)),se.window.set(se.strm.input.subarray(se.strm.next_in-Wt,se.strm.next_in),se.strstart),se.strstart+=Wt,se.insert+=Wt>se.w_size-se.insert?se.w_size-se.insert:Wt),se.block_start=se.strstart),se.high_waterbt&&se.block_start>=se.w_size&&(se.block_start-=se.w_size,se.strstart-=se.w_size,se.window.set(se.window.subarray(se.w_size,se.w_size+se.strstart),0),se.matches<2&&se.matches++,bt+=se.w_size,se.insert>se.strstart&&(se.insert=se.strstart)),bt>se.strm.avail_in&&(bt=se.strm.avail_in),bt&&(He(se.strm,se.window,se.strstart,bt),se.strstart+=bt,se.insert+=bt>se.w_size-se.insert?se.w_size-se.insert:bt),se.high_water>3,bt=se.pending_buf_size-bt>65535?65535:se.pending_buf_size-bt,Ce=bt>se.w_size?se.w_size:bt,ve=se.strstart-se.block_start,(ve>=Ce||(ve||ut===S)&&ut!==y&&se.strm.avail_in===0&&ve<=bt)&&(Pe=ve>bt?bt:ve,Xt=ut===S&&se.strm.avail_in===0&&Pe===ve?1:0,n(se,se.block_start,Pe,Xt),se.block_start+=Pe,Je(se.strm)),Xt?Re:Mt)},st=(se,ut)=>{let Ce,Pe;for(;;){if(se.lookahead=Fe&&(se.ins_h=_e(se,se.ins_h,se.window[se.strstart+Fe-1]),Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ce!==0&&se.strstart-Ce<=se.w_size-Ze&&(se.match_length=rt(se,Ce)),se.match_length>=Fe)if(Pe=c(se,se.strstart-se.match_start,se.match_length-Fe),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=Fe){se.match_length--;do se.strstart++,se.ins_h=_e(se,se.ins_h,se.window[se.strstart+Fe-1]),Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart;while(--se.match_length!==0);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=_e(se,se.ins_h,se.window[se.strstart+1]);else Pe=c(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(Pe&&(We(se,!1),se.strm.avail_out===0))return Mt}return se.insert=se.strstart{let Ce,Pe,ve;for(;;){if(se.lookahead=Fe&&(se.ins_h=_e(se,se.ins_h,se.window[se.strstart+Fe-1]),Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=Fe-1,Ce!==0&&se.prev_length4096)&&(se.match_length=Fe-1)),se.prev_length>=Fe&&se.match_length<=se.prev_length){ve=se.strstart+se.lookahead-Fe,Pe=c(se,se.strstart-1-se.prev_match,se.prev_length-Fe),se.lookahead-=se.prev_length-1,se.prev_length-=2;do++se.strstart<=ve&&(se.ins_h=_e(se,se.ins_h,se.window[se.strstart+Fe-1]),Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart);while(--se.prev_length!==0);if(se.match_available=0,se.match_length=Fe-1,se.strstart++,Pe&&(We(se,!1),se.strm.avail_out===0))return Mt}else if(se.match_available){if(Pe=c(se,0,se.window[se.strstart-1]),Pe&&We(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return Mt}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(Pe=c(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart{let Ce,Pe,ve,bt;const Xt=se.window;for(;;){if(se.lookahead<=De){if(ie(se),se.lookahead<=De&&ut===y)return Mt;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=Fe&&se.strstart>0&&(ve=se.strstart-1,Pe=Xt[ve],Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve])){bt=se.strstart+De;do;while(Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&Pe===Xt[++ve]&&vese.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=Fe?(Ce=c(se,1,se.match_length-Fe),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(Ce=c(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),Ce&&(We(se,!1),se.strm.avail_out===0))return Mt}return se.insert=0,ut===S?(We(se,!0),se.strm.avail_out===0?Re:Qe):se.sym_next&&(We(se,!1),se.strm.avail_out===0)?Mt:Ke},vt=(se,ut)=>{let Ce;for(;;){if(se.lookahead===0&&(ie(se),se.lookahead===0)){if(ut===y)return Mt;break}if(se.match_length=0,Ce=c(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,Ce&&(We(se,!1),se.strm.avail_out===0))return Mt}return se.insert=0,ut===S?(We(se,!0),se.strm.avail_out===0?Re:Qe):se.sym_next&&(We(se,!1),se.strm.avail_out===0)?Mt:Ke};function Me(se,ut,Ce,Pe,ve){this.good_length=se,this.max_lazy=ut,this.nice_length=Ce,this.max_chain=Pe,this.func=ve}const je=[new Me(0,0,0,0,Be),new Me(4,4,8,4,st),new Me(4,5,16,8,st),new Me(4,6,32,32,st),new Me(4,4,16,16,Ye),new Me(8,16,32,32,Ye),new Me(8,16,128,128,Ye),new Me(8,32,128,256,Ye),new Me(32,128,258,1024,Ye),new Me(32,258,258,4096,Ye)],ue=se=>{se.window_size=2*se.w_size,ze(se.head),se.max_lazy_match=je[se.level].max_lazy,se.good_match=je[se.level].good_length,se.nice_match=je[se.level].nice_length,se.max_chain_length=je[se.level].max_chain,se.strstart=0,se.block_start=0,se.lookahead=0,se.insert=0,se.match_length=se.prev_length=Fe-1,se.match_available=0,se.ins_h=0};function Ae(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Q,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(xe*2),this.dyn_dtree=new Uint16Array((2*pe+1)*2),this.bl_tree=new Uint16Array((2*Se+1)*2),ze(this.dyn_ltree),ze(this.dyn_dtree),ze(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(we+1),this.heap=new Uint16Array(2*me+1),ze(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*me+1),ze(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Vt=se=>{if(!se)return 1;const ut=se.state;return!ut||ut.strm!==se||ut.status!==Ue&&ut.status!==ye&&ut.status!==at&&ut.status!==ft&&ut.status!==Tt&&ut.status!==Lt&&ut.status!==Ot&&ut.status!==Ft?1:0},ge=se=>{if(Vt(se))return be(se,M);se.total_in=se.total_out=0,se.data_type=X;const ut=se.state;return ut.pending=0,ut.pending_out=0,ut.wrap<0&&(ut.wrap=-ut.wrap),ut.status=ut.wrap===2?ye:ut.wrap?Ue:Ot,se.adler=ut.wrap===2?0:1,ut.last_flush=-2,u(ut),e},Ut=se=>{const ut=ge(se);return ut===e&&ue(se.state),ut},Ve=(se,ut)=>Vt(se)||se.state.wrap!==2?M:(se.state.gzhead=ut,e),Zt=(se,ut,Ce,Pe,ve,bt)=>{if(!se)return M;let Xt=1;if(ut===B&&(ut=6),Pe<0?(Xt=0,Pe=-Pe):Pe>15&&(Xt=2,Pe-=16),ve<1||ve>m||Ce!==Q||Pe<8||Pe>15||ut<0||ut>9||bt<0||bt>q||Pe===8&&Xt!==1)return be(se,M);Pe===8&&(Pe=9);const Wt=new Ae;return se.state=Wt,Wt.strm=se,Wt.status=Ue,Wt.wrap=Xt,Wt.gzhead=null,Wt.w_bits=Pe,Wt.w_size=1<Zt(se,ut,Q,Z,ee,Y),dt=(se,ut)=>{if(Vt(se)||ut>k||ut<0)return se?be(se,M):M;const Ce=se.state;if(!se.output||se.avail_in!==0&&!se.input||Ce.status===Ft&&ut!==S)return be(se,se.avail_out===0?U:M);const Pe=Ce.last_flush;if(Ce.last_flush=ut,Ce.pending!==0){if(Je(se),se.avail_out===0)return Ce.last_flush=-1,e}else if(se.avail_in===0&<(ut)<=lt(Pe)&&ut!==S)return be(se,U);if(Ce.status===Ft&&se.avail_in!==0)return be(se,U);if(Ce.status===Ue&&Ce.wrap===0&&(Ce.status=Ot),Ce.status===Ue){let ve=Q+(Ce.w_bits-8<<4)<<8,bt=-1;if(Ce.strategy>=b||Ce.level<2?bt=0:Ce.level<6?bt=1:Ce.level===6?bt=2:bt=3,ve|=bt<<6,Ce.strstart!==0&&(ve|=nt),ve+=31-ve%31,xt(Ce,ve),Ce.strstart!==0&&(xt(Ce,se.adler>>>16),xt(Ce,se.adler&65535)),se.adler=1,Ce.status=Ot,Je(se),Ce.pending!==0)return Ce.last_flush=-1,e}if(Ce.status===ye){if(se.adler=0,qe(Ce,31),qe(Ce,139),qe(Ce,8),Ce.gzhead)qe(Ce,(Ce.gzhead.text?1:0)+(Ce.gzhead.hcrc?2:0)+(Ce.gzhead.extra?4:0)+(Ce.gzhead.name?8:0)+(Ce.gzhead.comment?16:0)),qe(Ce,Ce.gzhead.time&255),qe(Ce,Ce.gzhead.time>>8&255),qe(Ce,Ce.gzhead.time>>16&255),qe(Ce,Ce.gzhead.time>>24&255),qe(Ce,Ce.level===9?2:Ce.strategy>=b||Ce.level<2?4:0),qe(Ce,Ce.gzhead.os&255),Ce.gzhead.extra&&Ce.gzhead.extra.length&&(qe(Ce,Ce.gzhead.extra.length&255),qe(Ce,Ce.gzhead.extra.length>>8&255)),Ce.gzhead.hcrc&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending,0)),Ce.gzindex=0,Ce.status=at;else if(qe(Ce,0),qe(Ce,0),qe(Ce,0),qe(Ce,0),qe(Ce,0),qe(Ce,Ce.level===9?2:Ce.strategy>=b||Ce.level<2?4:0),qe(Ce,Ie),Ce.status=Ot,Je(se),Ce.pending!==0)return Ce.last_flush=-1,e}if(Ce.status===at){if(Ce.gzhead.extra){let ve=Ce.pending,bt=(Ce.gzhead.extra.length&65535)-Ce.gzindex;for(;Ce.pending+bt>Ce.pending_buf_size;){let Wt=Ce.pending_buf_size-Ce.pending;if(Ce.pending_buf.set(Ce.gzhead.extra.subarray(Ce.gzindex,Ce.gzindex+Wt),Ce.pending),Ce.pending=Ce.pending_buf_size,Ce.gzhead.hcrc&&Ce.pending>ve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Ce.gzindex+=Wt,Je(se),Ce.pending!==0)return Ce.last_flush=-1,e;ve=0,bt-=Wt}let Xt=new Uint8Array(Ce.gzhead.extra);Ce.pending_buf.set(Xt.subarray(Ce.gzindex,Ce.gzindex+bt),Ce.pending),Ce.pending+=bt,Ce.gzhead.hcrc&&Ce.pending>ve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Ce.gzindex=0}Ce.status=ft}if(Ce.status===ft){if(Ce.gzhead.name){let ve=Ce.pending,bt;do{if(Ce.pending===Ce.pending_buf_size){if(Ce.gzhead.hcrc&&Ce.pending>ve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Je(se),Ce.pending!==0)return Ce.last_flush=-1,e;ve=0}Ce.gzindexve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Ce.gzindex=0}Ce.status=Tt}if(Ce.status===Tt){if(Ce.gzhead.comment){let ve=Ce.pending,bt;do{if(Ce.pending===Ce.pending_buf_size){if(Ce.gzhead.hcrc&&Ce.pending>ve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve)),Je(se),Ce.pending!==0)return Ce.last_flush=-1,e;ve=0}Ce.gzindexve&&(se.adler=A(se.adler,Ce.pending_buf,Ce.pending-ve,ve))}Ce.status=Lt}if(Ce.status===Lt){if(Ce.gzhead.hcrc){if(Ce.pending+2>Ce.pending_buf_size&&(Je(se),Ce.pending!==0))return Ce.last_flush=-1,e;qe(Ce,se.adler&255),qe(Ce,se.adler>>8&255),se.adler=0}if(Ce.status=Ot,Je(se),Ce.pending!==0)return Ce.last_flush=-1,e}if(se.avail_in!==0||Ce.lookahead!==0||ut!==y&&Ce.status!==Ft){let ve=Ce.level===0?Be(Ce,ut):Ce.strategy===b?vt(Ce,ut):Ce.strategy===W?ht(Ce,ut):je[Ce.level].func(Ce,ut);if((ve===Re||ve===Qe)&&(Ce.status=Ft),ve===Mt||ve===Re)return se.avail_out===0&&(Ce.last_flush=-1),e;if(ve===Ke&&(ut===T?f(Ce):ut!==k&&(n(Ce,0,0,!1),ut===I&&(ze(Ce.head),Ce.lookahead===0&&(Ce.strstart=0,Ce.block_start=0,Ce.insert=0))),Je(se),se.avail_out===0))return Ce.last_flush=-1,e}return ut!==S?e:Ce.wrap<=0?N:(Ce.wrap===2?(qe(Ce,se.adler&255),qe(Ce,se.adler>>8&255),qe(Ce,se.adler>>16&255),qe(Ce,se.adler>>24&255),qe(Ce,se.total_in&255),qe(Ce,se.total_in>>8&255),qe(Ce,se.total_in>>16&255),qe(Ce,se.total_in>>24&255)):(xt(Ce,se.adler>>>16),xt(Ce,se.adler&65535)),Je(se),Ce.wrap>0&&(Ce.wrap=-Ce.wrap),Ce.pending!==0?e:N)},I0=se=>{if(Vt(se))return M;const ut=se.state.status;return se.state=null,ut===Ot?be(se,O):e},Ne=(se,ut)=>{let Ce=ut.length;if(Vt(se))return M;const Pe=se.state,ve=Pe.wrap;if(ve===2||ve===1&&Pe.status!==Ue||Pe.lookahead)return M;if(ve===1&&(se.adler=g(se.adler,ut,Ce,0)),Pe.wrap=0,Ce>=Pe.w_size){ve===0&&(ze(Pe.head),Pe.strstart=0,Pe.block_start=0,Pe.insert=0);let $e=new Uint8Array(Pe.w_size);$e.set(ut.subarray(Ce-Pe.w_size,Ce),0),ut=$e,Ce=Pe.w_size}const bt=se.avail_in,Xt=se.next_in,Wt=se.input;for(se.avail_in=Ce,se.next_in=0,se.input=ut,ie(Pe);Pe.lookahead>=Fe;){let $e=Pe.strstart,p0=Pe.lookahead-(Fe-1);do Pe.ins_h=_e(Pe,Pe.ins_h,Pe.window[$e+Fe-1]),Pe.prev[$e&Pe.w_mask]=Pe.head[Pe.ins_h],Pe.head[Pe.ins_h]=$e,$e++;while(--p0);Pe.strstart=$e,Pe.lookahead=Fe-1,ie(Pe)}return Pe.strstart+=Pe.lookahead,Pe.block_start=Pe.strstart,Pe.insert=Pe.lookahead,Pe.lookahead=0,Pe.match_length=Pe.prev_length=Fe-1,Pe.match_available=0,se.next_in=Xt,se.input=Wt,se.avail_in=bt,Pe.wrap=ve,e};return deflate.deflateInit=ot,deflate.deflateInit2=Zt,deflate.deflateReset=Ut,deflate.deflateResetKeep=ge,deflate.deflateSetHeader=Ve,deflate.deflate=dt,deflate.deflateEnd=I0,deflate.deflateSetDictionary=Ne,deflate.deflateInfo="pako deflate (from Nodeca project)",deflate}var common={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;const u=(n,s)=>Object.prototype.hasOwnProperty.call(n,s);return common.assign=function(n){const s=Array.prototype.slice.call(arguments,1);for(;s.length;){const c=s.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(const f in c)u(c,f)&&(n[f]=c[f])}}return n},common.flattenChunks=n=>{let s=0;for(let f=0,g=n.length;f=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;n[254]=n[254]=1,strings.string2buf=c=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(c);let f,g,A,v,y,T=c.length,I=0;for(v=0;v>>6,f[y++]=128|g&63):g<65536?(f[y++]=224|g>>>12,f[y++]=128|g>>>6&63,f[y++]=128|g&63):(f[y++]=240|g>>>18,f[y++]=128|g>>>12&63,f[y++]=128|g>>>6&63,f[y++]=128|g&63);return f};const s=(c,f)=>{if(f<65534&&c.subarray&&u)return String.fromCharCode.apply(null,c.length===f?c:c.subarray(0,f));let g="";for(let A=0;A{const g=f||c.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(c.subarray(0,f));let A,v;const y=new Array(g*2);for(v=0,A=0;A4){y[v++]=65533,A+=I-1;continue}for(T&=I===2?31:I===3?15:7;I>1&&A1){y[v++]=65533;continue}T<65536?y[v++]=T:(T-=65536,y[v++]=55296|T>>10&1023,y[v++]=56320|T&1023)}return s(y,v)},strings.utf8border=(c,f)=>{f=f||c.length,f>c.length&&(f=c.length);let g=f-1;for(;g>=0&&(c[g]&192)===128;)g--;return g<0||g===0?f:g+n[c[g]]>f?g:f},strings}var zstream,hasRequiredZstream;function requireZstream(){if(hasRequiredZstream)return zstream;hasRequiredZstream=1;function u(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return zstream=u,zstream}var hasRequiredDeflate;function requireDeflate(){if(hasRequiredDeflate)return deflate$1;hasRequiredDeflate=1;const u=requireDeflate$1(),n=requireCommon(),s=requireStrings(),c=requireMessages(),f=requireZstream(),g=Object.prototype.toString,{Z_NO_FLUSH:A,Z_SYNC_FLUSH:v,Z_FULL_FLUSH:y,Z_FINISH:T,Z_OK:I,Z_STREAM_END:S,Z_DEFAULT_COMPRESSION:k,Z_DEFAULT_STRATEGY:e,Z_DEFLATED:N}=requireConstants();function M(V){this.options=n.assign({level:k,method:N,chunkSize:16384,windowBits:15,memLevel:8,strategy:e},V||{});let b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;let W=u.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(W!==I)throw new Error(c[W]);if(b.header&&u.deflateSetHeader(this.strm,b.header),b.dictionary){let q;if(typeof b.dictionary=="string"?q=s.string2buf(b.dictionary):g.call(b.dictionary)==="[object ArrayBuffer]"?q=new Uint8Array(b.dictionary):q=b.dictionary,W=u.deflateSetDictionary(this.strm,q),W!==I)throw new Error(c[W]);this._dict_set=!0}}M.prototype.push=function(V,b){const W=this.strm,q=this.options.chunkSize;let Y,X;if(this.ended)return!1;for(b===~~b?X=b:X=b===!0?T:A,typeof V=="string"?W.input=s.string2buf(V):g.call(V)==="[object ArrayBuffer]"?W.input=new Uint8Array(V):W.input=V,W.next_in=0,W.avail_in=W.input.length;;){if(W.avail_out===0&&(W.output=new Uint8Array(q),W.next_out=0,W.avail_out=q),(X===v||X===y)&&W.avail_out<=6){this.onData(W.output.subarray(0,W.next_out)),W.avail_out=0;continue}if(Y=u.deflate(W,X),Y===S)return W.next_out>0&&this.onData(W.output.subarray(0,W.next_out)),Y=u.deflateEnd(this.strm),this.onEnd(Y),this.ended=!0,Y===I;if(W.avail_out===0){this.onData(W.output);continue}if(X>0&&W.next_out>0){this.onData(W.output.subarray(0,W.next_out)),W.avail_out=0;continue}if(W.avail_in===0)break}return!0},M.prototype.onData=function(V){this.chunks.push(V)},M.prototype.onEnd=function(V){V===I&&(this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=V,this.msg=this.strm.msg};function O(V,b){const W=new M(b);if(W.push(V,!0),W.err)throw W.msg||c[W.err];return W.result}function U(V,b){return b=b||{},b.raw=!0,O(V,b)}function B(V,b){return b=b||{},b.gzip=!0,O(V,b)}return deflate$1.Deflate=M,deflate$1.deflate=O,deflate$1.deflateRaw=U,deflate$1.gzip=B,deflate$1.constants=requireConstants(),deflate$1}var inflate$1={},inflate={},inffast,hasRequiredInffast;function requireInffast(){if(hasRequiredInffast)return inffast;hasRequiredInffast=1;const u=16209,n=16191;return inffast=function(c,f){let g,A,v,y,T,I,S,k,e,N,M,O,U,B,V,b,W,q,Y,X,Q,m,Z,ee;const oe=c.state;g=c.next_in,Z=c.input,A=g+(c.avail_in-5),v=c.next_out,ee=c.output,y=v-(f-c.avail_out),T=v+(c.avail_out-257),I=oe.dmax,S=oe.wsize,k=oe.whave,e=oe.wnext,N=oe.window,M=oe.hold,O=oe.bits,U=oe.lencode,B=oe.distcode,V=(1<>>24,M>>>=q,O-=q,q=W>>>16&255,q===0)ee[v++]=W&65535;else if(q&16){Y=W&65535,q&=15,q&&(O>>=q,O-=q),O<15&&(M+=Z[g++]<>>24,M>>>=q,O-=q,q=W>>>16&255,q&16){if(X=W&65535,q&=15,OI){c.msg="invalid distance too far back",oe.mode=u;break e}if(M>>>=q,O-=q,q=v-y,X>q){if(q=X-q,q>k&&oe.sane){c.msg="invalid distance too far back",oe.mode=u;break e}if(Q=0,m=N,e===0){if(Q+=S-q,q2;)ee[v++]=m[Q++],ee[v++]=m[Q++],ee[v++]=m[Q++],Y-=3;Y&&(ee[v++]=m[Q++],Y>1&&(ee[v++]=m[Q++]))}else{Q=v-X;do ee[v++]=ee[Q++],ee[v++]=ee[Q++],ee[v++]=ee[Q++],Y-=3;while(Y>2);Y&&(ee[v++]=ee[Q++],Y>1&&(ee[v++]=ee[Q++]))}}else if(q&64){c.msg="invalid distance code",oe.mode=u;break e}else{W=B[(W&65535)+(M&(1<>3,g-=Y,O-=Y<<3,M&=(1<{const V=B.bits;let b=0,W=0,q=0,Y=0,X=0,Q=0,m=0,Z=0,ee=0,oe=0,fe,me,pe,Se,xe,we=null,Fe;const De=new Uint16Array(u+1),Ze=new Uint16Array(u+1);let nt=null,Ue,ye,at;for(b=0;b<=u;b++)De[b]=0;for(W=0;W=1&&De[Y]===0;Y--);if(X>Y&&(X=Y),Y===0)return M[O++]=1<<24|64<<16|0,M[O++]=1<<24|64<<16|0,B.bits=1,0;for(q=1;q0&&(S===c||Y!==1))return-1;for(Ze[1]=0,b=1;bn||S===g&&ee>s)return 1;for(;;){Ue=b-m,U[W]+1=Fe?(ye=nt[U[W]-Fe],at=we[U[W]-Fe]):(ye=96,at=0),fe=1<>m)+me]=Ue<<24|ye<<16|at|0;while(me!==0);for(fe=1<>=1;if(fe!==0?(oe&=fe-1,oe+=fe):oe=0,W++,--De[b]===0){if(b===Y)break;b=k[e+U[W]]}if(b>X&&(oe&Se)!==pe){for(m===0&&(m=X),xe+=q,Q=b-m,Z=1<n||S===g&&ee>s)return 1;pe=oe&Se,M[pe]=X<<24|Q<<16|xe-O|0}}return oe!==0&&(M[xe+oe]=b-m<<24|64<<16|0),B.bits=X,0},inftrees}var hasRequiredInflate$1;function requireInflate$1(){if(hasRequiredInflate$1)return inflate;hasRequiredInflate$1=1;const u=requireAdler32(),n=requireCrc32(),s=requireInffast(),c=requireInftrees(),f=0,g=1,A=2,{Z_FINISH:v,Z_BLOCK:y,Z_TREES:T,Z_OK:I,Z_STREAM_END:S,Z_NEED_DICT:k,Z_STREAM_ERROR:e,Z_DATA_ERROR:N,Z_MEM_ERROR:M,Z_BUF_ERROR:O,Z_DEFLATED:U}=requireConstants(),B=16180,V=16181,b=16182,W=16183,q=16184,Y=16185,X=16186,Q=16187,m=16188,Z=16189,ee=16190,oe=16191,fe=16192,me=16193,pe=16194,Se=16195,xe=16196,we=16197,Fe=16198,De=16199,Ze=16200,nt=16201,Ue=16202,ye=16203,at=16204,ft=16205,Tt=16206,Lt=16207,Ot=16208,Ft=16209,Mt=16210,Ke=16211,Re=852,Qe=592,be=15,lt=Me=>(Me>>>24&255)+(Me>>>8&65280)+((Me&65280)<<8)+((Me&255)<<24);function ze(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Le=Me=>{if(!Me)return 1;const je=Me.state;return!je||je.strm!==Me||je.modeKe?1:0},Ge=Me=>{if(Le(Me))return e;const je=Me.state;return Me.total_in=Me.total_out=je.total=0,Me.msg="",je.wrap&&(Me.adler=je.wrap&1),je.mode=B,je.last=0,je.havedict=0,je.flags=-1,je.dmax=32768,je.head=null,je.hold=0,je.bits=0,je.lencode=je.lendyn=new Int32Array(Re),je.distcode=je.distdyn=new Int32Array(Qe),je.sane=1,je.back=-1,I},_e=Me=>{if(Le(Me))return e;const je=Me.state;return je.wsize=0,je.whave=0,je.wnext=0,Ge(Me)},Je=(Me,je)=>{let ue;if(Le(Me))return e;const Ae=Me.state;return je<0?(ue=0,je=-je):(ue=(je>>4)+5,je<48&&(je&=15)),je&&(je<8||je>15)?e:(Ae.window!==null&&Ae.wbits!==je&&(Ae.window=null),Ae.wrap=ue,Ae.wbits=je,_e(Me))},We=(Me,je)=>{if(!Me)return e;const ue=new ze;Me.state=ue,ue.strm=Me,ue.window=null,ue.mode=B;const Ae=Je(Me,je);return Ae!==I&&(Me.state=null),Ae},qe=Me=>We(Me,be);let xt=!0,He,rt;const ie=Me=>{if(xt){He=new Int32Array(512),rt=new Int32Array(32);let je=0;for(;je<144;)Me.lens[je++]=8;for(;je<256;)Me.lens[je++]=9;for(;je<280;)Me.lens[je++]=7;for(;je<288;)Me.lens[je++]=8;for(c(g,Me.lens,0,288,He,0,Me.work,{bits:9}),je=0;je<32;)Me.lens[je++]=5;c(A,Me.lens,0,32,rt,0,Me.work,{bits:5}),xt=!1}Me.lencode=He,Me.lenbits=9,Me.distcode=rt,Me.distbits=5},Be=(Me,je,ue,Ae)=>{let Vt;const ge=Me.state;return ge.window===null&&(ge.wsize=1<=ge.wsize?(ge.window.set(je.subarray(ue-ge.wsize,ue),0),ge.wnext=0,ge.whave=ge.wsize):(Vt=ge.wsize-ge.wnext,Vt>Ae&&(Vt=Ae),ge.window.set(je.subarray(ue-Ae,ue-Ae+Vt),ge.wnext),Ae-=Vt,Ae?(ge.window.set(je.subarray(ue-Ae,ue),0),ge.wnext=Ae,ge.whave=ge.wsize):(ge.wnext+=Vt,ge.wnext===ge.wsize&&(ge.wnext=0),ge.whave{let ue,Ae,Vt,ge,Ut,Ve,Zt,ot,dt,I0,Ne,se,ut,Ce,Pe=0,ve,bt,Xt,Wt,$e,p0,R0,Q0;const M0=new Uint8Array(4);let ni,St;const kt=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Le(Me)||!Me.output||!Me.input&&Me.avail_in!==0)return e;ue=Me.state,ue.mode===oe&&(ue.mode=fe),Ut=Me.next_out,Vt=Me.output,Zt=Me.avail_out,ge=Me.next_in,Ae=Me.input,Ve=Me.avail_in,ot=ue.hold,dt=ue.bits,I0=Ve,Ne=Zt,Q0=I;e:for(;;)switch(ue.mode){case B:if(ue.wrap===0){ue.mode=fe;break}for(;dt<16;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>8&255,ue.check=n(ue.check,M0,2,0),ot=0,dt=0,ue.mode=V;break}if(ue.head&&(ue.head.done=!1),!(ue.wrap&1)||(((ot&255)<<8)+(ot>>8))%31){Me.msg="incorrect header check",ue.mode=Ft;break}if((ot&15)!==U){Me.msg="unknown compression method",ue.mode=Ft;break}if(ot>>>=4,dt-=4,R0=(ot&15)+8,ue.wbits===0&&(ue.wbits=R0),R0>15||R0>ue.wbits){Me.msg="invalid window size",ue.mode=Ft;break}ue.dmax=1<>8&1),ue.flags&512&&ue.wrap&4&&(M0[0]=ot&255,M0[1]=ot>>>8&255,ue.check=n(ue.check,M0,2,0)),ot=0,dt=0,ue.mode=b;case b:for(;dt<32;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>8&255,M0[2]=ot>>>16&255,M0[3]=ot>>>24&255,ue.check=n(ue.check,M0,4,0)),ot=0,dt=0,ue.mode=W;case W:for(;dt<16;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>8),ue.flags&512&&ue.wrap&4&&(M0[0]=ot&255,M0[1]=ot>>>8&255,ue.check=n(ue.check,M0,2,0)),ot=0,dt=0,ue.mode=q;case q:if(ue.flags&1024){for(;dt<16;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>8&255,ue.check=n(ue.check,M0,2,0)),ot=0,dt=0}else ue.head&&(ue.head.extra=null);ue.mode=Y;case Y:if(ue.flags&1024&&(se=ue.length,se>Ve&&(se=Ve),se&&(ue.head&&(R0=ue.head.extra_len-ue.length,ue.head.extra||(ue.head.extra=new Uint8Array(ue.head.extra_len)),ue.head.extra.set(Ae.subarray(ge,ge+se),R0)),ue.flags&512&&ue.wrap&4&&(ue.check=n(ue.check,Ae,se,ge)),Ve-=se,ge+=se,ue.length-=se),ue.length))break e;ue.length=0,ue.mode=X;case X:if(ue.flags&2048){if(Ve===0)break e;se=0;do R0=Ae[ge+se++],ue.head&&R0&&ue.length<65536&&(ue.head.name+=String.fromCharCode(R0));while(R0&&se>9&1,ue.head.done=!0),Me.adler=ue.check=0,ue.mode=oe;break;case Z:for(;dt<32;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=dt&7,dt-=dt&7,ue.mode=Tt;break}for(;dt<3;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=1,dt-=1,ot&3){case 0:ue.mode=me;break;case 1:if(ie(ue),ue.mode=De,je===T){ot>>>=2,dt-=2;break e}break;case 2:ue.mode=xe;break;case 3:Me.msg="invalid block type",ue.mode=Ft}ot>>>=2,dt-=2;break;case me:for(ot>>>=dt&7,dt-=dt&7;dt<32;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>16^65535)){Me.msg="invalid stored block lengths",ue.mode=Ft;break}if(ue.length=ot&65535,ot=0,dt=0,ue.mode=pe,je===T)break e;case pe:ue.mode=Se;case Se:if(se=ue.length,se){if(se>Ve&&(se=Ve),se>Zt&&(se=Zt),se===0)break e;Vt.set(Ae.subarray(ge,ge+se),Ut),Ve-=se,ge+=se,Zt-=se,Ut+=se,ue.length-=se;break}ue.mode=oe;break;case xe:for(;dt<14;){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=5,dt-=5,ue.ndist=(ot&31)+1,ot>>>=5,dt-=5,ue.ncode=(ot&15)+4,ot>>>=4,dt-=4,ue.nlen>286||ue.ndist>30){Me.msg="too many length or distance symbols",ue.mode=Ft;break}ue.have=0,ue.mode=we;case we:for(;ue.have>>=3,dt-=3}for(;ue.have<19;)ue.lens[kt[ue.have++]]=0;if(ue.lencode=ue.lendyn,ue.lenbits=7,ni={bits:ue.lenbits},Q0=c(f,ue.lens,0,19,ue.lencode,0,ue.work,ni),ue.lenbits=ni.bits,Q0){Me.msg="invalid code lengths set",ue.mode=Ft;break}ue.have=0,ue.mode=Fe;case Fe:for(;ue.have>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=ve,dt-=ve,ue.lens[ue.have++]=Xt;else{if(Xt===16){for(St=ve+2;dt>>=ve,dt-=ve,ue.have===0){Me.msg="invalid bit length repeat",ue.mode=Ft;break}R0=ue.lens[ue.have-1],se=3+(ot&3),ot>>>=2,dt-=2}else if(Xt===17){for(St=ve+3;dt>>=ve,dt-=ve,R0=0,se=3+(ot&7),ot>>>=3,dt-=3}else{for(St=ve+7;dt>>=ve,dt-=ve,R0=0,se=11+(ot&127),ot>>>=7,dt-=7}if(ue.have+se>ue.nlen+ue.ndist){Me.msg="invalid bit length repeat",ue.mode=Ft;break}for(;se--;)ue.lens[ue.have++]=R0}}if(ue.mode===Ft)break;if(ue.lens[256]===0){Me.msg="invalid code -- missing end-of-block",ue.mode=Ft;break}if(ue.lenbits=9,ni={bits:ue.lenbits},Q0=c(g,ue.lens,0,ue.nlen,ue.lencode,0,ue.work,ni),ue.lenbits=ni.bits,Q0){Me.msg="invalid literal/lengths set",ue.mode=Ft;break}if(ue.distbits=6,ue.distcode=ue.distdyn,ni={bits:ue.distbits},Q0=c(A,ue.lens,ue.nlen,ue.ndist,ue.distcode,0,ue.work,ni),ue.distbits=ni.bits,Q0){Me.msg="invalid distances set",ue.mode=Ft;break}if(ue.mode=De,je===T)break e;case De:ue.mode=Ze;case Ze:if(Ve>=6&&Zt>=258){Me.next_out=Ut,Me.avail_out=Zt,Me.next_in=ge,Me.avail_in=Ve,ue.hold=ot,ue.bits=dt,s(Me,Ne),Ut=Me.next_out,Vt=Me.output,Zt=Me.avail_out,ge=Me.next_in,Ae=Me.input,Ve=Me.avail_in,ot=ue.hold,dt=ue.bits,ue.mode===oe&&(ue.back=-1);break}for(ue.back=0;Pe=ue.lencode[ot&(1<>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>Wt)],ve=Pe>>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(Wt+ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=Wt,dt-=Wt,ue.back+=Wt}if(ot>>>=ve,dt-=ve,ue.back+=ve,ue.length=Xt,bt===0){ue.mode=ft;break}if(bt&32){ue.back=-1,ue.mode=oe;break}if(bt&64){Me.msg="invalid literal/length code",ue.mode=Ft;break}ue.extra=bt&15,ue.mode=nt;case nt:if(ue.extra){for(St=ue.extra;dt>>=ue.extra,dt-=ue.extra,ue.back+=ue.extra}ue.was=ue.length,ue.mode=Ue;case Ue:for(;Pe=ue.distcode[ot&(1<>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>Wt)],ve=Pe>>>24,bt=Pe>>>16&255,Xt=Pe&65535,!(Wt+ve<=dt);){if(Ve===0)break e;Ve--,ot+=Ae[ge++]<>>=Wt,dt-=Wt,ue.back+=Wt}if(ot>>>=ve,dt-=ve,ue.back+=ve,bt&64){Me.msg="invalid distance code",ue.mode=Ft;break}ue.offset=Xt,ue.extra=bt&15,ue.mode=ye;case ye:if(ue.extra){for(St=ue.extra;dt>>=ue.extra,dt-=ue.extra,ue.back+=ue.extra}if(ue.offset>ue.dmax){Me.msg="invalid distance too far back",ue.mode=Ft;break}ue.mode=at;case at:if(Zt===0)break e;if(se=Ne-Zt,ue.offset>se){if(se=ue.offset-se,se>ue.whave&&ue.sane){Me.msg="invalid distance too far back",ue.mode=Ft;break}se>ue.wnext?(se-=ue.wnext,ut=ue.wsize-se):ut=ue.wnext-se,se>ue.length&&(se=ue.length),Ce=ue.window}else Ce=Vt,ut=Ut-ue.offset,se=ue.length;se>Zt&&(se=Zt),Zt-=se,ue.length-=se;do Vt[Ut++]=Ce[ut++];while(--se);ue.length===0&&(ue.mode=Ze);break;case ft:if(Zt===0)break e;Vt[Ut++]=ue.length,Zt--,ue.mode=Ze;break;case Tt:if(ue.wrap){for(;dt<32;){if(Ve===0)break e;Ve--,ot|=Ae[ge++]<{if(Le(Me))return e;let je=Me.state;return je.window&&(je.window=null),Me.state=null,I},ht=(Me,je)=>{if(Le(Me))return e;const ue=Me.state;return ue.wrap&2?(ue.head=je,je.done=!1,I):e},vt=(Me,je)=>{const ue=je.length;let Ae,Vt,ge;return Le(Me)||(Ae=Me.state,Ae.wrap!==0&&Ae.mode!==ee)?e:Ae.mode===ee&&(Vt=1,Vt=u(Vt,je,ue,0),Vt!==Ae.check)?N:(ge=Be(Me,je,ue,ue),ge?(Ae.mode=Mt,M):(Ae.havedict=1,I))};return inflate.inflateReset=_e,inflate.inflateReset2=Je,inflate.inflateResetKeep=Ge,inflate.inflateInit=qe,inflate.inflateInit2=We,inflate.inflate=st,inflate.inflateEnd=Ye,inflate.inflateGetHeader=ht,inflate.inflateSetDictionary=vt,inflate.inflateInfo="pako inflate (from Nodeca project)",inflate}var gzheader,hasRequiredGzheader;function requireGzheader(){if(hasRequiredGzheader)return gzheader;hasRequiredGzheader=1;function u(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return gzheader=u,gzheader}var hasRequiredInflate;function requireInflate(){if(hasRequiredInflate)return inflate$1;hasRequiredInflate=1;const u=requireInflate$1(),n=requireCommon(),s=requireStrings(),c=requireMessages(),f=requireZstream(),g=requireGzheader(),A=Object.prototype.toString,{Z_NO_FLUSH:v,Z_FINISH:y,Z_OK:T,Z_STREAM_END:I,Z_NEED_DICT:S,Z_STREAM_ERROR:k,Z_DATA_ERROR:e,Z_MEM_ERROR:N}=requireConstants();function M(B){this.options=n.assign({chunkSize:1024*64,windowBits:15,to:""},B||{});const V=this.options;V.raw&&V.windowBits>=0&&V.windowBits<16&&(V.windowBits=-V.windowBits,V.windowBits===0&&(V.windowBits=-15)),V.windowBits>=0&&V.windowBits<16&&!(B&&B.windowBits)&&(V.windowBits+=32),V.windowBits>15&&V.windowBits<48&&(V.windowBits&15||(V.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;let b=u.inflateInit2(this.strm,V.windowBits);if(b!==T)throw new Error(c[b]);if(this.header=new g,u.inflateGetHeader(this.strm,this.header),V.dictionary&&(typeof V.dictionary=="string"?V.dictionary=s.string2buf(V.dictionary):A.call(V.dictionary)==="[object ArrayBuffer]"&&(V.dictionary=new Uint8Array(V.dictionary)),V.raw&&(b=u.inflateSetDictionary(this.strm,V.dictionary),b!==T)))throw new Error(c[b])}M.prototype.push=function(B,V){const b=this.strm,W=this.options.chunkSize,q=this.options.dictionary;let Y,X,Q;if(this.ended)return!1;for(V===~~V?X=V:X=V===!0?y:v,A.call(B)==="[object ArrayBuffer]"?b.input=new Uint8Array(B):b.input=B,b.next_in=0,b.avail_in=b.input.length;;){for(b.avail_out===0&&(b.output=new Uint8Array(W),b.next_out=0,b.avail_out=W),Y=u.inflate(b,X),Y===S&&q&&(Y=u.inflateSetDictionary(b,q),Y===T?Y=u.inflate(b,X):Y===e&&(Y=S));b.avail_in>0&&Y===I&&b.state.wrap>0&&B[b.next_in]!==0;)u.inflateReset(b),Y=u.inflate(b,X);switch(Y){case k:case e:case S:case N:return this.onEnd(Y),this.ended=!0,!1}if(Q=b.avail_out,b.next_out&&(b.avail_out===0||Y===I))if(this.options.to==="string"){let m=s.utf8border(b.output,b.next_out),Z=b.next_out-m,ee=s.buf2string(b.output,m);b.next_out=Z,b.avail_out=W-Z,Z&&b.output.set(b.output.subarray(m,m+Z),0),this.onData(ee)}else this.onData(b.output.length===b.next_out?b.output:b.output.subarray(0,b.next_out));if(!(Y===T&&Q===0)){if(Y===I)return Y=u.inflateEnd(this.strm),this.onEnd(Y),this.ended=!0,!0;if(b.avail_in===0)break}}return!0},M.prototype.onData=function(B){this.chunks.push(B)},M.prototype.onEnd=function(B){B===T&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=B,this.msg=this.strm.msg};function O(B,V){const b=new M(V);if(b.push(B),b.err)throw b.msg||c[b.err];return b.result}function U(B,V){return V=V||{},V.raw=!0,O(B,V)}return inflate$1.Inflate=M,inflate$1.inflate=O,inflate$1.inflateRaw=U,inflate$1.ungzip=O,inflate$1.constants=requireConstants(),inflate$1}var hasRequiredPako;function requirePako(){if(hasRequiredPako)return pako;hasRequiredPako=1;const{Deflate:u,deflate:n,deflateRaw:s,gzip:c}=requireDeflate(),{Inflate:f,inflate:g,inflateRaw:A,ungzip:v}=requireInflate(),y=requireConstants();return pako.Deflate=u,pako.deflate=n,pako.deflateRaw=s,pako.gzip=c,pako.Inflate=f,pako.inflate=g,pako.inflateRaw=A,pako.ungzip=v,pako.constants=y,pako}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(u){var n=n||{};n.Tag=n.Tag||(typeof commonjsRequire<"u"?requireTag():null),n.Utils=n.Utils||(typeof commonjsRequire<"u"?requireUtilities():null),n.Dictionary=n.Dictionary||(typeof commonjsRequire<"u"?requireDictionary():null),n.Image=n.Image||(typeof commonjsRequire<"u"?requireImage():null);var s=s||(typeof commonjsRequire<"u"?requirePako():null);n.Parser=n.Parser||function(){this.littleEndian=!0,this.explicit=!0,this.metaFound=!1,this.metaFinished=!1,this.metaFinishedOffset=-1,this.needsDeflate=!1,this.inflated=null,this.encapsulation=!1,this.level=0,this.error=null},n.Parser.verbose=!1,n.Parser.MAGIC_COOKIE_OFFSET=128,n.Parser.MAGIC_COOKIE=[68,73,67,77],n.Parser.VRS=["AE","AS","AT","CS","DA","DS","DT","FL","FD","IS","LO","LT","OB","OD","OF","OW","PN","SH","SL","SS","ST","TM","UI","UL","UN","US","UT","UC"],n.Parser.DATA_VRS=["OB","OW","OF","SQ","UT","UN","UC"],n.Parser.RAW_DATA_VRS=["OB","OD","OF","OW","UN"],n.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE="1.2.840.10008.1.2",n.Parser.TRANSFER_SYNTAX_EXPLICIT_LITTLE="1.2.840.10008.1.2.1",n.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG="1.2.840.10008.1.2.2",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG="1.2.840.10008.1.2.4",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS="1.2.840.10008.1.2.4.57",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1="1.2.840.10008.1.2.4.70",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT="1.2.840.10008.1.2.4.50",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT="1.2.840.10008.1.2.4.51",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS_LOSSLESS="1.2.840.10008.1.2.4.80",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS="1.2.840.10008.1.2.4.81",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS="1.2.840.10008.1.2.4.90",n.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000="1.2.840.10008.1.2.4.91",n.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE="1.2.840.10008.1.2.5",n.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE="1.2.840.10008.1.2.1.99",n.Parser.UNDEFINED_LENGTH=4294967295,n.Parser.isMagicCookieFound=function(c){var f=n.Parser.MAGIC_COOKIE_OFFSET,g=n.Parser.MAGIC_COOKIE.length,A;for(A=0;A=this.metaFinishedOffset&&(this.needsDeflate=!1,v=c.buffer.slice(0,A.offsetEnd),y=c.buffer.slice(A.offsetEnd),this.inflated=n.Utils.concatArrayBuffers(v,s.inflateRaw(y)),c=new DataView(this.inflated)),A=this.getNextTag(c,A.offsetEnd)}catch(T){this.error=T}return f!==null&&(f.littleEndian=this.littleEndian),f},n.Parser.prototype.parseEncapsulated=function(c){var f=0,g,A=[];this.encapsulation=!0;try{for(g=this.getNextTag(c,f);g!==null;)g.isSublistItem()&&A.push(g),n.Parser.verbose&&console.log(g.toString()),g=this.getNextTag(c,g.offsetEnd)}catch(v){this.error=v}return A},n.Parser.prototype.testForValidTag=function(c){var f,g=null;try{f=this.findFirstTagOffset(c),g=this.getNextTag(c,f,!1)}catch(A){this.error=A}return g},n.Parser.prototype.getNextTag=function(c,f,g){var A=0,v,y=null,T=f,I,S=0,k=!0,e=null,N;if(f>=c.byteLength)return null;this.metaFinished?(k=this.littleEndian,A=c.getUint16(f,k)):(A=c.getUint16(f,!0),this.metaFinishedOffset!==-1&&f>=this.metaFinishedOffset||A!==2?(this.metaFinished=!0,k=this.littleEndian,A=c.getUint16(f,k)):k=!0),!this.metaFound&&A===2&&(this.metaFound=!0),f+=2,v=c.getUint16(f,k),f+=2,this.explicit||!this.metaFinished?(e=n.Utils.getStringAt(c,f,2),!this.metaFound&&this.metaFinished&&n.Parser.VRS.indexOf(e)===-1?(e=n.Dictionary.getVR(A,v),S=c.getUint32(f,k),f+=4,this.explicit=!1):(f+=2,n.Parser.DATA_VRS.indexOf(e)!==-1?(f+=2,S=c.getUint32(f,k),f+=4):(S=c.getUint16(f,k),f+=2))):(e=n.Dictionary.getVR(A,v),S=c.getUint32(f,k),S===n.Parser.UNDEFINED_LENGTH&&(e="SQ"),f+=4),I=f;var M=A===n.Tag.TAG_PIXEL_DATA[0]&&v===n.Tag.TAG_PIXEL_DATA[1],O=A===40&&v>=4609&&v<4864;if(e==="SQ"||!O&&!M&&!this.encapsulation&&n.Parser.DATA_VRS.indexOf(e)!==-1&&e!=="UC"?(y=this.parseSublist(c,f,S,e!=="SQ"),S===n.Parser.UNDEFINED_LENGTH&&(S=y[y.length-1].offsetEnd-f)):S>0&&!g&&(S===n.Parser.UNDEFINED_LENGTH&&M&&(S=c.byteLength-f),y=c.buffer.slice(f,f+S)),f+=S,N=new n.Tag(A,v,e,y,T,I,f,this.littleEndian,this.charset),N.value){if(N.isTransformSyntax())this.transformSyntaxAlreadyExist=!0,N.value[0]===n.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE?(this.explicit=!1,this.littleEndian=!0):N.value[0]===n.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG?(this.explicit=!0,this.littleEndian=!1):N.value[0]===n.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE?(this.needsDeflate=!0,this.explicit=!0,this.littleEndian=!0):(this.explicit=!0,this.littleEndian=!0);else if(N.isMetaLength())this.metaFinishedOffset=N.value[0]+f;else if(N.isCharset()){var U=N.value;U.length==2?U=(U[0]||"ISO 2022 IR 6")+"\\"+U[1]:U.length==1&&(U=U[0]),this.charset=U}}return N},n.Parser.prototype.parseSublist=function(c,f,g,A){var v,y=f+g,T=[];if(this.level++,g===n.Parser.UNDEFINED_LENGTH){for(v=this.parseSublistItem(c,f,A);!v.isSequenceDelim();)T.push(v),f=v.offsetEnd,v=this.parseSublistItem(c,f,A);T.push(v)}else for(;fn.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&e>N&&e>M?T=I:N>n.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&N>e&&N>M?T=S:M>n.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&M>e&&M>N?T=k:T=null,T},n.Image.prototype.getCols=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_COLS[0],n.Tag.TAG_COLS[1]),0)},n.Image.prototype.getRows=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_ROWS[0],n.Tag.TAG_ROWS[1]),0)},n.Image.prototype.getSeriesDescription=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SERIES_DESCRIPTION[0],n.Tag.TAG_SERIES_DESCRIPTION[1]),0)},n.Image.prototype.getSeriesInstanceUID=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SERIES_INSTANCE_UID[0],n.Tag.TAG_SERIES_INSTANCE_UID[1]),0)},n.Image.prototype.getSeriesNumber=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SERIES_NUMBER[0],n.Tag.TAG_SERIES_NUMBER[1]),0)},n.Image.prototype.getEchoNumber=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_ECHO_NUMBER[0],n.Tag.TAG_ECHO_NUMBER[1]),0)},n.Image.prototype.getImagePosition=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_IMAGE_POSITION[0],n.Tag.TAG_IMAGE_POSITION[1]))},n.Image.prototype.getImageDirections=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_IMAGE_ORIENTATION[0],n.Tag.TAG_IMAGE_ORIENTATION[1]))},n.Image.prototype.getImagePositionSliceDir=function(A){var v=n.Image.getValueSafely(this.getTag(n.Tag.TAG_IMAGE_POSITION[0],n.Tag.TAG_IMAGE_POSITION[1]));return v&&A>=0?v[A]:0},n.Image.prototype.getModality=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_MODALITY[0],n.Tag.TAG_MODALITY[1]),0)},n.Image.prototype.getSliceLocation=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SLICE_LOCATION[0],n.Tag.TAG_SLICE_LOCATION[1]),0)},n.Image.prototype.getSliceLocationVector=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_SLICE_LOCATION_VECTOR[0],n.Tag.TAG_SLICE_LOCATION_VECTOR[1]))},n.Image.prototype.getImageNumber=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_IMAGE_NUM[0],n.Tag.TAG_IMAGE_NUM[1]),0)},n.Image.prototype.getTemporalPosition=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_TEMPORAL_POSITION[0],n.Tag.TAG_TEMPORAL_POSITION[1]),0)},n.Image.prototype.getTemporalNumber=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[0],n.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[1]),0)},n.Image.prototype.getSliceGap=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SLICE_GAP[0],n.Tag.TAG_SLICE_GAP[1]),0)},n.Image.prototype.getSliceThickness=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_SLICE_THICKNESS[0],n.Tag.TAG_SLICE_THICKNESS[1]),0)},n.Image.prototype.getImageMax=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_IMAGE_MAX[0],n.Tag.TAG_IMAGE_MAX[1]),0)},n.Image.prototype.getImageMin=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_IMAGE_MIN[0],n.Tag.TAG_IMAGE_MIN[1]),0)},n.Image.prototype.getDataScaleSlope=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_DATA_SCALE_SLOPE[0],n.Tag.TAG_DATA_SCALE_SLOPE[1]),0)},n.Image.prototype.getDataScaleIntercept=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_DATA_SCALE_INTERCEPT[0],n.Tag.TAG_DATA_SCALE_INTERCEPT[1]),0)},n.Image.prototype.getDataScaleElscint=function(){var A=n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_DATA_SCALE_ELSCINT[0],n.Tag.TAG_DATA_SCALE_ELSCINT[1]),0);A||(A=1);var v=this.getPixelBandwidth();return A=Math.sqrt(v)/(10*A),A<=0&&(A=1),A},n.Image.prototype.getWindowWidth=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_WINDOW_WIDTH[0],n.Tag.TAG_WINDOW_WIDTH[1]),0)},n.Image.prototype.getWindowCenter=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_WINDOW_CENTER[0],n.Tag.TAG_WINDOW_CENTER[1]),0)},n.Image.prototype.getPixelBandwidth=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_PIXEL_BANDWIDTH[0],n.Tag.TAG_PIXEL_BANDWIDTH[1]),0)},n.Image.prototype.getSeriesId=function(){var A=this.getSeriesDescription(),v=this.getSeriesInstanceUID(),y=this.getSeriesNumber(),T=this.getEchoNumber(),I=this.getOrientation(),S=this.getCols(),k=this.getRows(),e="";return A!==null&&(e+=" "+A),v!==null&&(e+=" "+v),y!==null&&(e+=" "+y),T!==null&&(e+=" "+T),I!==null&&(e+=" "+I),e+=" ("+S+" x "+k+")",e},n.Image.prototype.getPixelSpacing=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_PIXEL_SPACING[0],n.Tag.TAG_PIXEL_SPACING[1]))},n.Image.prototype.getImageType=function(){return n.Image.getValueSafely(this.getTag(n.Tag.TAG_IMAGE_TYPE[0],n.Tag.TAG_IMAGE_TYPE[1]))},n.Image.prototype.getBitsStored=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_BITS_STORED[0],n.Tag.TAG_BITS_STORED[1]),0)},n.Image.prototype.getBitsAllocated=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_BITS_ALLOCATED[0],n.Tag.TAG_BITS_ALLOCATED[1]),0)},n.Image.prototype.getFrameTime=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_FRAME_TIME[0],n.Tag.TAG_FRAME_TIME[1]),0)},n.Image.prototype.getAcquisitionMatrix=function(){var A,v,y,T,I;return A=[0,0],A[0]=n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_ACQUISITION_MATRIX[0],n.Tag.TAG_ACQUISITION_MATRIX[1]),0),this.privateDataAll===null&&(this.privateDataAll=this.getAllInterpretedPrivateData()),this.privateDataAll!==null&&this.privateDataAll.length>0&&(y=this.privateDataAll.indexOf("AcquisitionMatrixText"),y!==-1&&(T=this.privateDataAll.indexOf(` +`,y),T!==-1&&(I=this.privateDataAll.substring(y,T),v=I.match(/\d+/g),v!==null&&v.length===2?(A[0]=v[0],A[1]=v[1]):v!==null&&v.length===1&&(A[0]=v[0])))),A[1]===0&&(A[1]=A[0]),A},n.Image.prototype.getTR=function(){return n.Image.getSingleValueSafely(this.getTag(n.Tag.TAG_TR,n.Tag.TAG_TR[1]),0)},n.Image.prototype.putTag=function(A){this.tags[A.id]&&this.tags[A.id].value[0]!==A.value[0]||(this.tags[A.id]=A,this.putFlattenedTag(this.tagsFlat,A))},n.Image.prototype.putFlattenedTag=function(A,v){var y;if(v.sublist)for(y=0;yV&&(V=b,q=fe);return v?{data:e,min:B,minIndex:W,max:V,maxIndex:q,numCols:this.getCols(),numRows:this.getRows()}:e},n.Image.prototype.convertPalette=function(){var A,v,y,T,I,S,k,e,N,M,O,U;if(A=this.tags[n.Tag.createId(n.Tag.TAG_PIXEL_DATA[0],n.Tag.TAG_PIXEL_DATA[1])].value,v=this.getPalleteValues(n.Tag.TAG_PALETTE_RED),y=this.getPalleteValues(n.Tag.TAG_PALETTE_GREEN),T=this.getPalleteValues(n.Tag.TAG_PALETTE_BLUE),v!==null&&v.length>0&&y!==null&&y.length>0&&T!==null&&T.length>0&&!this.convertedPalette){if(I=new DataView(new ArrayBuffer(this.getRows()*this.getCols()*this.getNumberOfFrames()*3)),S=parseInt(Math.ceil(this.getBitsAllocated()/8)),k=A.byteLength/S,S===1)for(e=0;eN&&(N=Math.abs(v[y]),k=y);for(N=0;y<6;y+=1)Math.abs(v[y])>N&&(N=Math.abs(v[y]),e=y);switch(k){case 0:M+="X",e===4?M+="YZ":M+="ZY";break;case 1:M+="Y",e===3?M+="XZ":M+="ZX";break;case 2:M+="Z",e===3?M+="XY":M+="YX";break}switch(k){case 0:v[k]>0?M+="-":M+="+",e===4?v[e]>0?M+="-":M+="+":v[e]>0?M+="+":M+="-";break;case 1:v[k]>0?M+="-":M+="+",e===3?v[e]>0?M+="-":M+="+":v[e]>0?M+="+":M+="-";break;case 2:v[k]>0?M+="+":M+="-",v[e]>0?M+="-":M+="+";break}if(I===0)M+="+",A=M;else{if(S)switch(M.charAt(2)){case"X":I>0?M+="-":M+="+";break;case"Y":case"Z":I>0?M+="+":M+="-";break}else switch(M.charAt(2)){case"X":I>0?M+="+":M+="-";break;case"Y":case"Z":I>0?M+="-":M+="+";break}A=M}return A},n.Image.prototype.isMosaic=function(){var A,v=!1,y,T,I;if(A=this.getImageType(),A!==null){for(T=0;T0&&(I[0]1?S[y]=n.Utils.concatArrayBuffers2(I[y]):S[y]=I[y][0],I[y]=null;return S},n.Image.prototype.getRLE=function(){var A,v,y,T=[];if(A=this.getEncapsulatedData(),A)for(v=A.length,y=1;y");return T=T.replace(/\n\s*\n/g,` +`),T=T.replace(/(?:\r\n|\r|\n)/g,"
"),T},n.Image.prototype.getPalleteValues=function(A){var v,y,T,I,S,k,e,N,M,O,U;if(v=null,y=null,T=n.Image.getValueSafely(this.getTag(A[0],A[1])),T!==null){for(I=T.buffer.byteLength/2,v=[],y=[],S=0;S255||v<0)for(I=255/(y-v),S=v,T=0;T1&&s[0].getTemporalPosition()!==null,T=c>1&&s[0].getTemporalNumber()!==null&&s[0].getTemporalNumber()===c,y&&T)for(I=0;I1||this.isMosaic&&this.images[0].length>1,this.isMultiFrameVolume=!1,this.isMultiFrameTimeseries=!1,this.isImplicitTimeseries=!1,this.isMultiFrame&&(s=this.images[0].getFrameTime()>0,this.isMosaic?this.isMultiFrameTimeseries=!0:s?this.isMultiFrameTimeseries=!0:this.numberOfFramesInFile>1?(this.isMultiFrameTimeseries=!0,this.numberOfFrames=this.images.length):this.isMultiFrameVolume=!0),!this.isMosaic&&this.numberOfFrames<=1){for(S=this.images[0].getImagePosition()||[],f=S.toString(),this.numberOfFrames=0,c=0;c1&&(this.isImplicitTimeseries=!0)}this.sliceDir=this.images[0].getAcquiredSliceDirection(),n.Series.useExplicitOrdering?g=this.images.slice():g=n.Series.orderDicoms(this.images,this.numberOfFrames,this.sliceDir),A=g[0].getImagePositionSliceDir(this.sliceDir),v=g[g.length-1].getImagePositionSliceDir(this.sliceDir),y=v-A,n.Series.useExplicitOrdering?this.sliceSense=!1:this.isMosaic?this.sliceSense=!0:this.isMultiFrame?(T=g[0].getSliceLocationVector(),T!==null?(I=g[0].getOrientation(),I.charAt(2)==="Z"?this.sliceSense=T[0]-T[T.length-1]<0:this.sliceSense=T[0]-T[T.length-1]>0):this.sliceSense=!(A<0)):this.sliceDir===n.Image.SLICE_DIRECTION_SAGITTAL||this.sliceDir===n.Image.SLICE_DIRECTION_CORONAL?y>0?this.sliceSense=!1:this.sliceSense=!0:y>0?this.sliceSense=!0:this.sliceSense=!1,this.imagesOriginalOrder=this.images,this.images=g},n.Series.prototype.concatenateImageData=function(s,c){var f,g,A;this.isMosaic?g=this.getMosaicData(this.images[0],this.images[0].getPixelDataBytes()):g=this.images[0].getPixelDataBytes(),A=this.validatePixelDataLength(this.images[0]),this.images[0].clearPixelData(),f=new Uint8Array(new ArrayBuffer(A*this.images.length)),f.set(new Uint8Array(g,0,A),0),setTimeout(n.Utils.bind(this,function(){this.concatenateNextImageData(f,A,s,1,c)}),0)},n.Series.prototype.concatenateNextImageData=function(s,c,f,g,A){var v,y;g>=this.images.length?(f&&f.drawProgress(1,"Reading DICOM Images"),A(s.buffer)):(f&&f.drawProgress(g/this.images.length,"Reading DICOM Images"),this.isMosaic?v=this.getMosaicData(this.images[g],this.images[g].getPixelDataBytes()):v=this.images[g].getPixelDataBytes(),y=this.validatePixelDataLength(this.images[g]),this.images[g].clearPixelData(),s.set(new Uint8Array(v,0,y),c*g),setTimeout(n.Utils.bind(this,function(){this.concatenateNextImageData(s,c,f,g+1,A)}),0))},n.Series.prototype.validatePixelDataLength=function(s){var c=s.getPixelDataBytes().byteLength,f=s.getCols()*s.getRows();return c%f===0?c:f*s.getNumberOfFrames()*s.getNumberOfSamplesPerPixel()*(s.getBitsAllocated()/8)},n.Series.prototype.getMosaicData=function(s,c){var f,g,A,v,y,T,I,S,k,e,N,M,O,U,B,V,b,W=0;for(I=parseInt(this.images[0].getBitsAllocated()/8),N=this.images[0].getMosaicCols()*this.images[0].getMosaicRows(),M=parseInt(this.images[0].getRows()/this.images[0].getMosaicRows()),O=parseInt(this.images[0].getCols()/this.images[0].getMosaicCols()),f=this.images[0].getCols(),g=this.images[0].getRows(),A=this.images[0].getMosaicRows(),v=this.images[0].getMosaicCols(),y=parseInt(g/A),T=parseInt(f/v),U=new Uint8Array(new ArrayBuffer(N*M*O*I)),B=new Uint8Array(c),S=0;Sn in u?__defProp(u,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[n]=s,__export=(u,n)=>{for(var s in n)__defProp(u,s,{get:n[s],enumerable:!0})},__publicField=(u,n,s)=>(__defNormalProp(u,typeof n!="symbol"?n+"":n,s),s),version$1="0.42.0",_Log=class ci{constructor({name:n="niivue",level:s="info"}={}){__publicField(this,"level"),__publicField(this,"name"),this.name=`${n}`,this.level=s}debug(...n){ci.levels[this.level]>ci.levels.debug||console.debug(`${this.name}-debug`,...n)}info(...n){ci.levels[this.level]>ci.levels.info||console.info(`${this.name}-info`,...n)}warn(...n){ci.levels[this.level]>ci.levels.warn||console.warn(`${this.name}-warn`,...n)}error(...n){ci.levels[this.level]>ci.levels.error||console.error(`${this.name}-error`,...n)}fatal(...n){ci.levels[this.level]>ci.levels.fatal||console.error(`${this.name}-fatal`,...n)}setLogLevel(n){this.level=n}setName(n){this.name=n}};__publicField(_Log,"levels",{debug:0,info:1,warn:2,error:3,fatal:4,silent:1/0});var Log$1=_Log,log$4=new Log$1({name:"niivue",level:"info"}),compileShader=function(u,n,s){const c=u.createShader(u.VERTEX_SHADER);if(c===null)throw new Error("could not create vertex shader");if(u.shaderSource(c,n),u.compileShader(c),!u.getShaderParameter(c,u.COMPILE_STATUS))throw log$4.error(u.getShaderInfoLog(c)),new Error("Vertex shader failed to compile, see console for log");const f=u.createShader(u.FRAGMENT_SHADER);if(f===null)throw new Error("could not create fragment shader");if(u.shaderSource(f,s),u.compileShader(f),!u.getShaderParameter(f,u.COMPILE_STATUS))throw log$4.error(u.getShaderInfoLog(f)),new Error("Fragment shader failed to compile, see console for log");const g=u.createProgram();if(g===null)throw new Error("could not create GL program");if(u.attachShader(g,c),u.attachShader(g,f),u.linkProgram(g),!u.getProgramParameter(g,u.LINK_STATUS))throw log$4.error(u.getProgramInfoLog(g)),new Error("Shader failed to link, see console for log");return g},Shader=class{constructor(u,n,s){__publicField(this,"program"),__publicField(this,"uniforms",{}),__publicField(this,"isMatcap"),this.program=compileShader(u,n,s);const c=/uniform[^;]+[ ](\w+);/g,f=/uniform[^;]+[ ](\w+);/,g=n.match(c),A=s.match(c);g&&g.forEach(v=>{const y=v.match(f);this.uniforms[y[1]]=-1}),A&&A.forEach(v=>{const y=v.match(f);this.uniforms[y[1]]=-1});for(const v in this.uniforms)this.uniforms[v]=u.getUniformLocation(this.program,v)}use(u){u.useProgram(this.program)}},vertRenderShader=`#version 300 es #line 4 layout(location=0) in vec3 pos; layout(location=1) in vec3 texCoords; @@ -1601,17 +1601,17 @@ void main(void) { gradientSample.rgb = normalize(gradientSample.rgb); gradientSample.rgb = (gradientSample.rgb * 0.5)+0.5; FragColor = gradientSample; -}`,orientCube=new Float32Array([-1,-1,-1,.28,.28,.28,-1,-1,-1,.28,.28,.28,-1,1,-1,.28,.28,.28,1,-1,-1,.28,.28,.28,1,1,-1,.28,.28,.28,1,1,-1,.28,.28,.28,-1,-1,1,.8,.8,.8,-1,-1,1,.8,.8,.8,1,-1,1,.8,.8,.8,-1,1,1,.8,.8,.8,1,1,1,.8,.8,.8,1,1,1,.8,.8,.8,-1,1,-1,0,0,.74,-1,1,-1,0,0,.74,-1,1,1,0,0,.74,1,1,-1,0,0,.74,1,1,1,0,0,.74,1,1,1,0,0,.74,-1,-1,-1,.42,0,.42,-1,-1,-1,.42,0,.42,1,-1,-1,.42,0,.42,-1,-1,1,.42,0,.42,1,-1,1,.42,0,.42,1,-1,1,.42,0,.42,-1,-1,-1,.64,0,0,-1,-1,-1,.64,0,0,-1,-1,1,.64,0,0,-1,1,-1,.64,0,0,-1,1,1,.64,0,0,-1,1,1,.64,0,0,1,-1,-1,0,.5,0,1,-1,-1,0,.5,0,1,1,-1,0,.5,0,1,-1,1,0,.5,0,1,1,1,0,.5,0,1,1,1,0,.5,0,-.45,1,-.8,0,0,0,-.45,1,-.8,0,0,0,-.45,1,.8,0,0,0,-.25,1,-.8,0,0,0,-.25,1,.8,0,0,0,-.25,1,.8,0,0,0,-.25,1,.6,0,0,0,-.25,1,.6,0,0,0,-.25,1,.8,0,0,0,.45,1,.6,0,0,0,.25,1,.8,0,0,0,.25,1,.8,0,0,0,.25,1,.1,0,0,0,.25,1,.1,0,0,0,.25,1,.6,0,0,0,.45,1,.1,0,0,0,.45,1,.6,0,0,0,.45,1,.6,0,0,0,-.25,1,-.1,0,0,0,-.25,1,-.1,0,0,0,-.25,1,.1,0,0,0,.25,1,-.1,0,0,0,.45,1,.1,0,0,0,.45,1,.1,0,0,0,.45,-1,-.8,0,0,0,.45,-1,-.8,0,0,0,.05,-1,.8,0,0,0,.25,-1,-.8,0,0,0,-.15,-1,.8,0,0,0,-.15,-1,.8,0,0,0,-.25,-1,-.8,0,0,0,-.25,-1,-.8,0,0,0,.05,-1,.8,0,0,0,-.45,-1,-.8,0,0,0,-.15,-1,.8,0,0,0,-.15,-1,.8,0,0,0,.13,-1,-.3,0,0,0,.13,-1,-.3,0,0,0,.07,-1,-.1,0,0,0,-.33,-1,-.3,0,0,0,-.27,-1,-.1,0,0,0,-.27,-1,-.1,0,0,0,-.45,.6,1,0,0,0,-.45,.6,1,0,0,0,-.45,.4,1,0,0,0,-.25,.8,1,0,0,0,-.25,.4,1,0,0,0,-.25,.4,1,0,0,0,-.25,.8,1,0,0,0,-.25,.8,1,0,0,0,-.25,.6,1,0,0,0,.25,.8,1,0,0,0,.45,.6,1,0,0,0,.45,.6,1,0,0,0,.25,.8,1,0,0,0,.25,.8,1,0,0,0,.25,-.1,1,0,0,0,.45,.6,1,0,0,0,.45,.1,1,0,0,0,.45,.1,1,0,0,0,-.25,.1,1,0,0,0,-.25,.1,1,0,0,0,-.45,-.1,1,0,0,0,.25,.1,1,0,0,0,.25,-.1,1,0,0,0,.25,-.1,1,0,0,0,-.45,-.1,1,0,0,0,-.45,-.1,1,0,0,0,-.45,-.6,1,0,0,0,-.25,-.1,1,0,0,0,-.25,-.8,1,0,0,0,-.25,-.8,1,0,0,0,-.25,-.6,1,0,0,0,-.25,-.6,1,0,0,0,-.25,-.8,1,0,0,0,.45,-.6,1,0,0,0,.25,-.8,1,0,0,0,.25,-.8,1,0,0,0,.25,-.4,1,0,0,0,.25,-.4,1,0,0,0,.25,-.6,1,0,0,0,.45,-.4,1,0,0,0,.45,-.6,1,0,0,0,.45,-.6,1,0,0,0,-.1,-.8,-1,0,0,0,-.1,-.8,-1,0,0,0,-.1,.8,-1,0,0,0,.1,-.8,-1,0,0,0,.1,.8,-1,0,0,0,.1,.8,-1,0,0,0,-1,-.45,-.8,0,0,0,-1,-.45,-.8,0,0,0,-1,-.45,.8,0,0,0,-1,-.25,-.8,0,0,0,-1,-.25,.8,0,0,0,-1,-.25,.8,0,0,0,-1,-.25,-.8,0,0,0,-1,-.25,-.8,0,0,0,-1,-.25,-.6,0,0,0,-1,.45,-.8,0,0,0,-1,.45,-.6,0,0,0,-1,.45,-.6,0,0,0,1,.45,-.8,0,0,0,1,.45,-.8,0,0,0,1,.45,.8,0,0,0,1,.25,-.8,0,0,0,1,.25,.8,0,0,0,1,.25,.8,0,0,0,1,.25,.6,0,0,0,1,.25,.6,0,0,0,1,.25,.8,0,0,0,1,-.45,.6,0,0,0,1,-.25,.8,0,0,0,1,-.25,.8,0,0,0,1,-.25,.1,0,0,0,1,-.25,.1,0,0,0,1,-.25,.6,0,0,0,1,-.45,.1,0,0,0,1,-.45,.6,0,0,0,1,-.45,.6,0,0,0,1,.25,-.1,0,0,0,1,.25,-.1,0,0,0,1,.25,.1,0,0,0,1,-.25,-.1,0,0,0,1,-.45,.1,0,0,0,1,-.45,.1,0,0,0,1,-.25,-.8,0,0,0,1,-.25,-.8,0,0,0,1,-.05,-.1,0,0,0,1,-.45,-.8,0,0,0,1,-.25,-.1,0,0,0,1,-.25,-.1,0,0,0]),_NiivueObject3D=class{constructor(n,s,c,f,g=null,A=null){__publicField(this,"sphereIdx",[]),__publicField(this,"sphereVtx",[]),__publicField(this,"renderShaders",[]),__publicField(this,"isVisible",!0),__publicField(this,"isPickable",!0),__publicField(this,"vertexBuffer"),__publicField(this,"indexCount"),__publicField(this,"indexBuffer"),__publicField(this,"vao"),__publicField(this,"mode"),__publicField(this,"glFlags",0),__publicField(this,"id"),__publicField(this,"colorId"),__publicField(this,"modelMatrix",create$3()),__publicField(this,"scale",[1,1,1]),__publicField(this,"position",[0,0,0]),__publicField(this,"rotation",[0,0,0]),__publicField(this,"rotationRadians",0),__publicField(this,"extentsMin",[]),__publicField(this,"extentsMax",[]),__publicField(this,"furthestVertexFromOrigin"),__publicField(this,"originNegate"),__publicField(this,"fieldOfViewDeObliqueMM"),__publicField(this,"mm"),this.vertexBuffer=s,this.indexCount=f,this.indexBuffer=g,this.vao=A,this.mode=c,this.id=n,this.colorId=[(n>>0&255)/255,(n>>8&255)/255,(n>>16&255)/255,(n>>24&255)/255]}};__publicField(_NiivueObject3D,"BLEND",1);__publicField(_NiivueObject3D,"CULL_FACE",2);__publicField(_NiivueObject3D,"CULL_FRONT",4);__publicField(_NiivueObject3D,"CULL_BACK",8);__publicField(_NiivueObject3D,"ENABLE_DEPTH_TEST",16);__publicField(_NiivueObject3D,"generateCrosshairs",function(u,n,s,c,f,g,A=20,v=0){const y=_NiivueObject3D.generateCrosshairsGeometry(u,s,c,f,g,A,v);return new _NiivueObject3D(n,y.vertexBuffer,u.TRIANGLES,y.indexCount,y.indexBuffer,y.vao)});__publicField(_NiivueObject3D,"generateCrosshairsGeometry",function(u,n,s,c,f,g=20,A=0){const v=[],y=[],T=f*A;if(T<=0){let e=fromValues$2(s[0],n[1],n[2]),N=fromValues$2(c[0],n[1],n[2]);_NiivueObject3D.makeCylinder(v,y,e,N,f,g),e=fromValues$2(n[0],s[1],n[2]),N=fromValues$2(n[0],c[1],n[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g),e=fromValues$2(n[0],n[1],s[2]),N=fromValues$2(n[0],n[1],c[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g)}else{let e=fromValues$2(s[0],n[1],n[2]),N=fromValues$2(n[0]-T,n[1],n[2]);_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0]+T,n[1],n[2]),N=fromValues$2(c[0],n[1],n[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0],s[1],n[2]),N=fromValues$2(n[0],n[1]-T,n[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0],n[1]+T,n[2]),N=fromValues$2(n[0],c[1],n[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0],n[1],s[2]),N=fromValues$2(n[0],n[1],n[2]-T),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0],n[1],n[2]+T),N=fromValues$2(n[0],n[1],c[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1)}const I=u.createBuffer();if(I===null)throw new Error("could not instantiate vertex buffer");u.bindBuffer(u.ARRAY_BUFFER,I),u.bufferData(u.ARRAY_BUFFER,new Float32Array(v),u.STATIC_DRAW);const S=u.createBuffer();if(S===null)throw new Error("could not instantiate index buffer");u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,S),u.bufferData(u.ELEMENT_ARRAY_BUFFER,new Uint32Array(y),u.STATIC_DRAW);const k=u.createVertexArray();return u.bindVertexArray(k),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,S),u.bindBuffer(u.ARRAY_BUFFER,I),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,3,u.FLOAT,!1,0,0),u.bindVertexArray(null),{vertexBuffer:I,indexBuffer:S,indexCount:y.length,vao:k}});__publicField(_NiivueObject3D,"getFirstPerpVector",function(u){const n=fromValues$2(0,0,0);return u[0]===0?n[0]=1:u[1]===0?n[1]=1:u[2]===0?n[2]=1:(n[0]=u[2],n[1]=u[2],n[2]=-(u[0]+u[1]),normalize$1(n,n)),n});__publicField(_NiivueObject3D,"subdivide",function(u,n){let s=u.length/3,c=n.length/3;const f=c,g=create$2(),A=create$2();for(let v=0;vitksnap_default,$slicer3d:()=>slicer3d_default,actc:()=>actc_default,afni_blues_inv:()=>afni_blues_inv_default,afni_reds_inv:()=>afni_reds_inv_default,bcgwhw:()=>bcgwhw_default,bcgwhw_dark:()=>bcgwhw_dark_default,blue:()=>blue_default,blue2cyan:()=>blue2cyan_default,blue2magenta:()=>blue2magenta_default,blue2red:()=>blue2red_default,bluegrn:()=>bluegrn_default,bone:()=>bone_default,bronze:()=>bronze_default,cet_l17:()=>cet_l17_default,cividis:()=>cividis_default,cool:()=>cool_default,copper:()=>copper_default,copper2:()=>copper2_default,ct_airways:()=>ct_airways_default,ct_artery:()=>ct_artery_default,ct_bones:()=>ct_bones_default,ct_brain:()=>ct_brain_default,ct_brain_gray:()=>ct_brain_gray_default,ct_cardiac:()=>ct_cardiac_default,ct_head:()=>ct_head_default,ct_kidneys:()=>ct_kidneys_default,ct_liver:()=>ct_liver_default,ct_muscles:()=>ct_muscles_default,ct_scalp:()=>ct_scalp_default,ct_skull:()=>ct_skull_default,ct_soft:()=>ct_soft_default,ct_soft_tissue:()=>ct_soft_tissue_default,ct_surface:()=>ct_surface_default,ct_vessels:()=>ct_vessels_default,ct_w_contrast:()=>ct_w_contrast_default,cubehelix:()=>cubehelix_default,electric_blue:()=>electric_blue_default,freesurfer:()=>freesurfer_default,ge_color:()=>ge_color_default,gold:()=>gold_default,gray:()=>gray_default,green:()=>green_default,green2cyan:()=>green2cyan_default,green2orange:()=>green2orange_default,hot:()=>hot_default,hotiron:()=>hotiron_default,hsv:()=>hsv_default,inferno:()=>inferno_default,jet:()=>jet_default,linspecer:()=>linspecer_default,magma:()=>magma_default,mako:()=>mako_default,nih:()=>nih_default,plasma:()=>plasma_default,random:()=>random_default,red:()=>red_default,redyell:()=>redyell_default,rocket:()=>rocket_default,roi_i256:()=>roi_i256_default,surface:()=>surface_default,turbo:()=>turbo_default,violet:()=>violet_default,viridis:()=>viridis_default,warm:()=>warm_default,winter:()=>winter_default,x_rain:()=>x_rain_default});var itksnap_default={R:[0,255,0,0,255,0,255,255,0,205,210,102,0,0,46,255,106,221,233,165,255,147,218,75,255,60,255,255,218,0,188,255,255,222,127,139,124,255,70,0,238,238,240,245,184,32,255,25,112,34,248,245,255,144,173,65,255,250,128,50,244,255,123,255,173,255,127,255,143,220,253,255,0,0,128,255,250,148,178,255,135,100,240,250,255,107,135,0,139,245,186,255,255,0,210,255,47,72,175,128,176,255,139,240,255,216,119,219,72,255,199,154,189,240,230,0,85,64,153,205,250,95,0,255,224,176,138,30,240,152,160],G:[0,0,255,0,255,255,0,239,0,133,180,205,0,139,139,228,90,160,150,42,250,112,112,0,182,179,235,228,165,128,143,105,218,184,255,69,252,255,130,100,130,232,255,222,134,178,20,25,128,139,248,255,160,238,255,105,99,240,0,205,164,255,104,165,216,192,255,140,188,20,245,250,206,255,0,250,128,0,34,127,206,149,230,235,245,142,206,0,0,245,85,228,222,191,105,248,79,61,238,128,224,240,0,255,215,191,136,112,209,0,21,205,183,248,230,250,107,224,50,92,250,158,128,69,255,196,43,144,128,251,82],B:[0,0,0,255,0,255,255,213,205,63,140,170,128,139,87,225,205,221,122,42,250,219,214,130,193,113,205,196,32,128,143,180,185,135,0,19,0,224,180,0,238,170,240,179,11,170,147,112,144,34,255,250,122,144,47,225,71,230,0,50,96,240,238,0,230,203,212,0,143,60,230,240,209,127,128,205,114,211,34,80,235,237,140,215,238,35,250,139,139,220,211,181,173,255,30,220,79,139,238,0,230,245,0,255,0,216,153,147,204,255,133,50,107,255,250,154,47,208,204,92,210,160,0,0,255,222,226,255,128,152,45],A:[0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130]},slicer3d_default={labels:["background","tissue","bone","skin","connective tissue","blood","organ","mass","muscle","foreign object","waste","teeth","fat","gray matter","white matter","nerve","vein","artery","capillary","ligament","tendon","cartilage","meniscus","lymph node","lymphatic vessel","cerebro-spinal fluid","bile","urine","feces","gas","fluid","edema","bleeding","necrosis","clot","embolism","head","central nervous system","brain","gray matter of brain","telencephalon","cerebral cortex","right frontal lobe","left frontal lobe","right temporal lobe","left temporal lobe","right parietal lobe","left parietal lobe","right occipital lobe","left occipital lobe","right insular lobe","left insular lobe","right limbic lobe","left limbic lobe","right striatum","left striatum","right caudate nucleus","left caudate nucleus","right putamen","left putamen","right pallidum","left pallidum","right amygdaloid complex","left amygdaloid complex","diencephalon","thalamus","right thalamus","left thalamus","pineal gland","midbrain","substantia nigra","right substantia nigra","left substantia nigra","cerebral white matter","right superior longitudinal fasciculus","left superior longitudinal fasciculus","right inferior longitudinal fasciculus","left inferior longitudinal fasciculus","right arcuate fasciculus","left arcuate fasciculus","right uncinate fasciculus","left uncinate fasciculus","right cingulum bundle","left cingulum bundle","projection fibers","right corticospinal tract","left corticospinal tract","right optic radiation","left optic radiation","right medial lemniscus","left medial lemniscus","right superior cerebellar peduncle","left superior cerebellar peduncle","right middle cerebellar peduncle","left middle cerebellar peduncle","right inferior cerebellar peduncle","left inferior cerebellar peduncle","optic chiasm","right optic tract","left optic tract","right fornix","left fornix","commissural fibers","corpus callosum","posterior commissure","cerebellar white matter","CSF space","ventricles of brain","right lateral ventricle","left lateral ventricle","right third ventricle","left third ventricle","cerebral aqueduct","fourth ventricle","subarachnoid space","spinal cord","gray matter of spinal cord","white matter of spinal cord","endocrine system of brain","pituitary gland","adenohypophysis","neurohypophysis","meninges","dura mater","arachnoid","pia mater","muscles of head","salivary glands","lips","nose","tongue","soft palate","right inner ear","left inner ear","right external ear","left external ear","right middle ear","left middle ear","right eyeball","left eyeball","skull","right frontal bone","left frontal bone","right parietal bone","left parietal bone","right temporal bone","left temporal bone","right sphenoid bone","left sphenoid bone","right ethmoid bone","left ethmoid bone","occipital bone","maxilla","right zygomatic bone","right lacrimal bone","vomer bone","right palatine bone","left palatine bone","mandible","neck","muscles of neck","pharynx","larynx","thyroid gland","right parathyroid glands","left parathyroid glands","skeleton of neck","hyoid bone","cervical vertebral column","thorax","trachea","bronchi","right lung","left lung","superior lobe of right lung","superior lobe of left lung","middle lobe of right lung","inferior lobe of right lung","inferior lobe of left lung","pleura","heart","right atrium","left atrium","atrial septum","ventricular septum","right ventricle of heart","left ventricle of heart","mitral valve","tricuspid valve","aortic valve","pulmonary valve","aorta","pericardium","pericardial cavity","esophagus","thymus","mediastinum","skin of thoracic wall","muscles of thoracic wall","skeleton of thorax","thoracic vertebral column","ribs","sternum","right clavicle","left clavicle","abdominal cavity","abdomen","peritoneum","omentum","peritoneal cavity","retroperitoneal space","stomach","duodenum","small bowel","colon","anus","liver","biliary tree","gallbladder","pancreas","spleen","urinary system","right kidney","left kidney","right ureter","left ureter","urinary bladder","urethra","right adrenal gland","left adrenal gland","female internal genitalia","uterus","right fallopian tube","left fallopian tube","right ovary","left ovary","vagina","male internal genitalia","prostate","right seminal vesicle","left seminal vesicle","right deferent duct","left deferent duct","skin of abdominal wall","muscles of abdominal wall","skeleton of abdomen","lumbar vertebral column","female external genitalia","male external genitalia","skeleton of upper limb","muscles of upper limb","right upper limb","left upper limb","right shoulder","left shoulder","right arm"],R:[0,128,241,177,111,216,221,144,192,220,78,255,230,200,250,244,0,216,183,183,152,111,178,68,111,85,0,214,78,218,170,140,188,216,145,150,177,244,250,200,68,128,83,83,162,162,141,141,182,182,188,188,154,154,177,177,30,30,210,210,48,48,98,98,69,166,122,122,253,145,46,0,0,250,127,127,159,159,125,125,106,106,154,154,126,201,201,78,78,174,174,139,139,148,148,186,186,99,156,156,64,64,138,97,126,194,85,88,88,88,88,88,88,88,88,244,200,250,82,57,60,92,255,255,255,255,201,70,188,177,166,182,229,229,174,174,201,201,194,194,241,203,203,229,229,255,255,209,209,248,248,255,196,255,255,255,242,242,222,177,213,184,150,62,62,62,242,250,255,177,182,175,197,197,172,172,202,224,224,255,206,210,203,233,195,181,152,159,166,218,225,224,255,184,211,47,255,173,188,255,226,253,244,205,205,186,177,255,234,204,180,216,255,205,204,255,221,0,139,249,157,203,185,185,247,247,222,124,249,249,244,255,255,227,213,213,193,216,230,245,245,241,241,177,171,217,212,185,185,198,194,177,177,177,177,177],G:[0,174,214,122,184,101,130,238,104,245,63,250,220,200,250,214,151,101,156,214,189,184,212,172,197,188,145,230,63,255,250,224,65,191,60,98,122,214,250,200,131,174,146,146,115,115,93,93,166,166,135,135,150,150,140,140,111,111,157,157,129,129,153,153,110,113,101,101,135,92,101,108,108,250,150,150,116,116,102,102,174,174,146,146,126,160,160,152,152,140,140,126,126,120,120,135,135,106,171,171,123,123,95,113,161,195,188,106,106,106,106,106,106,106,106,214,200,250,174,157,143,162,244,244,244,244,121,163,91,122,84,105,147,147,122,122,112,112,142,142,213,179,179,204,204,243,243,185,185,223,223,230,172,255,250,237,217,217,198,122,124,105,208,162,162,162,206,210,255,122,228,216,165,165,138,138,164,186,186,245,110,115,108,138,100,85,55,63,70,123,130,97,244,122,171,150,244,121,95,239,202,232,217,179,179,124,122,255,234,142,119,132,253,167,168,224,130,145,150,180,108,136,102,102,182,182,154,186,186,186,170,181,190,153,141,141,123,146,158,172,172,172,172,124,85,198,188,135,135,175,98,122,122,122,122,122],B:[0,128,145,101,210,79,101,144,88,20,0,220,70,235,210,49,206,79,220,211,207,210,242,100,131,255,30,130,0,255,250,228,28,216,66,83,101,49,225,215,98,128,164,164,105,105,137,137,110,110,166,166,201,201,190,190,85,85,166,166,126,126,112,112,53,137,38,38,192,109,131,112,112,225,88,88,163,163,154,154,155,155,83,83,55,133,133,141,141,103,103,177,177,72,72,135,135,24,108,108,147,147,74,158,197,164,255,215,215,215,215,215,215,215,215,49,215,225,128,110,83,109,209,209,209,209,77,117,95,101,94,107,118,118,90,90,73,73,0,0,144,77,77,109,109,152,152,85,85,131,131,138,68,167,160,145,123,123,101,101,109,108,243,114,114,114,142,139,207,101,255,244,145,145,115,115,140,162,162,217,84,89,81,112,73,57,13,27,38,97,104,76,209,154,143,103,209,88,76,172,134,158,154,108,108,161,101,220,194,178,153,105,229,142,143,199,101,30,98,111,162,116,83,83,164,164,132,223,150,150,147,158,165,130,113,113,103,127,140,147,147,151,151,92,68,131,102,134,134,125,79,101,101,101,101,101],A:[0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},actc_default={R:[0,0,24,248,255],G:[0,0,177,254,0],B:[0,136,0,0,0],A:[0,32,64,78,128],I:[0,64,128,156,255]},bcgwhw_dark_default={R:[0,248,242,235,229,222,212,202,193,183,173,145,117,78,39,0,0,0,0,0,0,64,128,191,255,255,255,255,255,238,221,204,214,224,235,245,255,249,242,236,229,223,217,210,204,197,191,184,176,169,161,154,146,139,132,124,117,109,102,0],G:[0,251,247,243,239,235,235,235,235,235,235,216,197,174,150,127,153,178,204,229,255,255,255,255,255,220,185,150,115,77,38,0,31,61,92,122,153,138,122,107,92,77,61,46,31,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0],B:[0,254,253,252,251,250,251,252,253,254,255,226,198,132,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,80,120,160,200,199,198,197,196,196,195,194,193,192,191,184,176,169,161,154,146,139,132,124,117,109,102,0],A:[256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256],I:[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,255]},bcgwhw_default={R:[255,248,242,235,229,222,212,202,193,183,173,145,117,78,39,0,0,0,0,0,0,64,128,191,255,255,255,255,255,238,221,204,214,224,235,245,255,249,242,236,229,223,217,210,204,197,191,184,176,169,161,154,146,139,132,124,117,109,102,0],G:[255,251,247,243,239,235,235,235,235,235,235,216,197,174,150,127,153,178,204,229,255,255,255,255,255,220,185,150,115,77,38,0,31,61,92,122,153,138,122,107,92,77,61,46,31,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0],B:[255,254,253,252,251,250,251,252,253,254,255,226,198,132,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,80,120,160,200,199,198,197,196,196,195,194,193,192,191,184,176,169,161,154,146,139,132,124,117,109,102,0],A:[256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256],I:[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,255]},blue2red_default={R:[0,0,0,0,196,255],G:[0,32,128,128,128,32],B:[0,255,196,0,0,0],A:[0,128,64,64,64,128],I:[0,1,64,128,192,255]},blue2magenta_default={R:[0,255],G:[0,0],B:[255,255],A:[0,128],I:[0,255]},blue2cyan_default={R:[0,0],G:[0,255],B:[255,255],A:[0,128],I:[0,255]},bluegrn_default={R:[0,0,0,0],G:[0,1,128,255],B:[0,222,127,32],A:[0,0,64,128],I:[0,1,128,255]},blue_default={R:[0,0,0],G:[0,0,0],B:[0,128,255],A:[0,64,128],I:[0,128,255]},bone_default={R:[0,103,255],G:[0,126,255],B:[0,165,255],A:[0,76,128],I:[0,153,255]},bronze_default={R:[0,43,103,199,216,255],G:[0,0,37,155,213,255],B:[0,0,20,97,201,255],A:[0,44,48,54,56,56],I:[0,64,128,196,240,255]},cet_l17_default={R:[0,9,24,33,40,46,52,57,62,66,70,74,78,81,85,88,91,94,98,101,103,106,109,112,114,117,119,121,124,126,128,130,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,169,171,172,174,175,177,178,180,181,183,184,186,187,189,190,191,193,194,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,222,223,224,224,225,226,226,227,228,228,229,229,230,231,231,232,233,233,234,234,235,235,236,236,236,237,237,237,238,238,238,239,239,239,240,240,240,241,241,241,242,242,242,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,243,243,243,243,243,243,243,243,243,243,243,243,242,242,242,242,242,242,242,242,241,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,243,243,244,244,245,246,246,247,247,248,249,249,250,250,251,251,252,252,253,253,254,254,254],G:[42,41,41,41,40,40,40,39,39,39,38,38,37,37,36,36,35,35,34,34,33,32,32,31,30,30,30,30,29,29,29,29,28,28,28,27,27,27,26,26,26,25,25,25,24,24,24,24,24,25,25,26,27,27,28,28,29,30,30,31,31,32,33,33,34,34,35,36,36,37,38,39,40,42,43,44,45,47,48,49,50,51,53,54,55,56,57,58,59,60,62,63,64,65,66,68,69,71,72,73,75,76,77,79,80,81,83,84,85,87,88,89,90,92,93,94,95,97,98,100,101,102,104,105,107,108,109,111,112,113,115,116,117,119,120,121,122,124,125,126,128,129,130,132,133,134,136,137,138,140,141,142,144,145,146,147,149,150,151,153,154,155,156,158,159,160,161,163,164,165,167,168,169,170,172,173,174,175,176,178,179,180,181,183,184,185,186,187,189,190,191,192,193,194,196,197,198,199,200,201,203,204,205,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,228,229,230,231,232,233,234,235,236,237,238,238,239,240,241,241,242,243,244,244,245,246,247,248,248,249,250,251,251,252,253,254,255],B:[167,167,166,166,166,165,165,165,164,164,164,163,163,162,162,162,161,161,161,160,160,160,159,159,158,158,157,157,156,155,155,154,154,153,153,152,151,151,150,150,149,149,148,147,147,146,146,145,144,144,143,143,142,141,141,140,139,139,138,137,137,136,135,135,134,133,133,132,131,131,130,130,129,128,128,127,127,126,125,125,124,124,123,123,122,121,121,120,119,119,118,118,117,116,116,116,115,115,114,114,113,113,113,112,112,111,111,110,110,109,109,109,108,108,107,107,106,106,106,106,106,105,105,105,105,105,105,105,104,104,104,104,104,103,103,103,103,103,102,102,102,103,103,103,103,104,104,104,104,104,105,105,105,105,106,106,106,106,106,107,107,107,107,108,108,109,110,111,111,112,113,113,114,115,115,116,117,117,118,119,120,120,121,122,122,123,124,125,126,128,129,130,131,132,134,135,136,137,138,140,141,142,143,144,146,147,148,149,150,152,153,155,157,158,160,162,163,165,167,168,170,172,173,175,177,178,180,182,183,185,187,188,190,193,196,199,201,204,207,210,212,215,218,221,224,226,229,232,235,238,240,243,246,249,252,255],A:[0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},cividis_default={R:[0,86,166,255],G:[32,92,156,233],B:[76,108,117,69],A:[0,56,80,88],I:[0,64,192,255]},cool_default={R:[0,0,0],G:[127,196,254],B:[255,255,255],A:[0,64,128],I:[0,128,255]},copper2_default={R:[0,61,122,183,244,255],G:[0,41,81,122,163,255],B:[0,25,51,76,102,255],A:[0,25,51,71,102,128],I:[0,51,102,153,204,255]},copper_default={R:[0,61,122,183,244,255],G:[0,41,81,122,163,203],B:[0,25,51,76,102,127],A:[0,25,51,71,102,128],I:[0,51,102,153,204,255]},ct_airways_default={min:-643,max:-235,R:[0,0,0],G:[154,154,154],B:[179,179,101],A:[0,32,0],I:[0,163,255]},ct_artery_default={min:114,max:800,R:[0,255,255,255],G:[0,0,129,255],B:[0,0,0,255],A:[0,64,88,228],I:[0,80,160,255]},ct_bones_default={min:180,max:600,R:[0,0,113,255],G:[0,0,109,250],B:[0,0,101,245],A:[0,0,100,160],I:[0,1,128,255]},ct_brain_gray_default={min:-10,max:110,R:[0,127,255],G:[0,127,255],B:[0,127,255],A:[0,48,128],I:[0,124,255]},ct_brain_default={min:-10,max:110,R:[0,199,255],G:[0,127,255],B:[0,127,255],A:[0,48,128],I:[0,124,255]},ct_cardiac_default={min:-80,max:1e3,R:[0,189,150,150,150,150,255],G:[0,169,54,54,54,54,240],B:[0,153,52,52,52,52,242],A:[0,32,64,0,0,64,64],I:[0,1,82,92,234,242,255]},ct_head_default={min:-590,max:600,R:[0,241,241,248,248,178,178,232,255,255,255],G:[0,156,156,222,222,36,36,51,255,255,255],B:[0,130,130,169,169,24,24,37,255,255,255],A:[0,8,0,0,0,64,64,0,0,222,222],I:[0,2,3,64,122,142,172,182,252,253,255]},ct_kidneys_default={min:114,max:302,R:[0,255,255],G:[0,129,255],B:[0,0,255],A:[0,88,228],I:[0,103,255]},ct_liver_default={min:-23,max:246,R:[0,44,255,255,255],G:[0,128,90,255,255],B:[0,0,70,0,255],A:[0,0,82,184,228],I:[0,64,131,196,255]},ct_muscles_default={min:-100,max:246,R:[0,128,159,255,255,255,255],G:[0,0,56,90,0,255,255],B:[0,0,41,70,0,0,255],A:[0,63,105,135,167,184,228],I:[0,100,128,155,180,209,255]},ct_scalp_default={min:-590,max:600,R:[0,241,241,248,248,178,232,255,255],G:[0,156,156,222,222,36,51,255,255],B:[0,130,130,169,169,24,37,255,255],A:[0,63,105,135,167,184,228,228,228],I:[0,1,52,127,137,162,172,252,255]},ct_skull_default={min:140,max:1024,R:[0,2,113,255],G:[0,1,109,250],B:[0,1,101,245],A:[0,1,96,168],I:[0,1,128,255]},ct_soft_default={min:-923,max:679,R:[0,0,0,0,0,255,255,255],G:[154,154,154,154,0,0,254,255],B:[179,179,179,179,0,0,0,255],A:[0,3,8,0,0,10,15,20],I:[0,30,62,88,170,200,232,255]},ct_soft_tissue_default={min:-10,max:110,R:[0,199,255],G:[0,127,255],B:[0,127,255],A:[0,48,128],I:[0,124,255]},ct_surface_default={min:-600,max:100,R:[0,134,255],G:[0,109,250],B:[0,101,245],A:[0,60,148],I:[0,128,255]},ct_vessels_default={min:114,max:246,R:[0,255,255],G:[0,128,255],B:[0,128,255],A:[0,64,96],I:[0,87,255]},ct_w_contrast_default={min:50,max:1e3,R:[98,210,169,128,255],G:[94,26,77,128,255],B:[45,21,74,128,255],A:[0,25,0,4,168],I:[0,41,87,154,255]},cubehelix_default={R:[0,13,21,26,27,25,22,21,22,28,39,54,75,98,124,148,171,189,202,210,213,211,206,200,195,193,195,201,211,225,240,255],G:[0,5,11,20,31,44,58,72,86,99,109,116,120,122,122,122,121,121,124,129,137,147,161,175,190,205,218,229,238,245,251,255],B:[0,14,30,46,61,71,77,78,75,68,60,52,48,47,53,65,83,105,131,157,183,205,222,235,241,243,242,240,239,240,245,255],A:[0,4,8,12,17,21,25,29,33,37,41,45,50,54,58,62,66,70,74,78,83,87,91,95,99,103,107,111,116,120,124,128],I:[0,8,16,25,33,41,49,58,66,74,82,90,99,107,115,123,132,140,148,156,165,173,181,189,197,206,214,222,230,239,247,255]},electric_blue_default={R:[0,10,136,255],G:[0,39,220,255],B:[0,223,253,255],A:[0,48,64,70],I:[0,92,192,255]},freesurfer_default={R:[0,245,205,120,196,220,230,0,122,236,12,204,42,119,220,103,60,255,165,160,0,245,205,120,196,220,230,0,122,236,13,220,103,255,165,160,0,120,200,255,255,164,164,164,234,0,0,0,0,0],G:[0,245,62,18,58,248,148,118,186,13,48,182,204,159,216,255,60,165,42,32,200,245,62,18,58,248,148,118,186,13,48,216,255,165,42,32,200,190,70,148,148,108,108,108,169,0,0,0,0,0],B:[0,245,78,134,250,164,34,14,220,176,255,142,164,176,20,255,60,0,42,240,200,245,78,134,250,164,34,14,220,176,255,20,255,0,42,240,221,150,255,10,10,226,226,226,30,64,112,160,208,255],A:[0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64],I:[0,2,3,4,5,7,8,10,11,12,13,14,15,16,17,18,24,26,28,30,31,41,42,43,44,46,47,49,50,51,52,53,54,58,60,62,63,72,77,78,79,80,81,82,85,251,252,253,254,255]},ge_color_default={R:[0,0,128,255,255],G:[0,128,0,128,255],B:[0,125,255,0,255],A:[0,32,64,96,128],I:[0,63,128,192,255]},gold_default={R:[0,142,227,255],G:[0,85,170,255],B:[0,14,76,255],A:[0,42,84,128],I:[0,85,170,255]},gray_default={R:[0,255],G:[0,255],B:[0,255],A:[0,128],I:[0,255]},green_default={R:[0,0,0],G:[0,128,255],B:[0,0,0],A:[0,64,128],I:[0,128,255]},green2cyan_default={R:[0,0,0],G:[72,72,255],B:[0,255,255],A:[0,64,128],I:[0,88,255]},green2orange_default={R:[0,255,255],G:[72,88,255],B:[0,0,0],A:[0,64,128],I:[0,88,255]},hotiron_default={R:[0,255,255,255],G:[0,0,126,255],B:[0,0,0,255],A:[0,64,96,128],I:[0,128,191,255]},hot_default={R:[3,255,255,255],G:[0,0,255,255],B:[0,0,0,255],A:[0,48,96,128],I:[0,95,191,255]},hsv_default={R:[255,255,0,0,0,255,255],G:[0,255,255,255,0,0,0],B:[0,0,0,255,255,255,0],A:[0,14,28,43,57,71,85],I:[0,43,85,128,170,213,255]},inferno_default={R:[0,120,237,240],G:[0,28,105,249],B:[4,109,37,33],A:[0,56,80,88],I:[0,64,192,255]},jet_default={R:[0,0,127,255,127],G:[0,127,255,127,0],B:[127,255,127,0,0],A:[0,32,64,96,128],I:[0,63,128,192,255]},linspecer_default={R:[94,50,90,152,215,238,249,254,252,241,209,158],G:[79,131,186,214,240,244,237,210,157,100,57,1],B:[162,189,167,164,155,169,168,123,86,68,79,66],A:[0,12,23,35,47,58,70,81,93,105,116,128],I:[0,23,46,70,93,116,139,162,185,209,232,255]},magma_default={R:[0,148,183,223,247,252],G:[0,44,55,74,112,253],B:[4,128,121,104,92,191],A:[0,44,53,64,75,107],I:[0,107,128,154,179,255]},mako_default={R:[11,59,55,222],G:[4,45,165,245],B:[5,91,172,229],A:[0,23,70,107],I:[0,56,167,255]},nih_default={R:[0,85,0,0,0,0,0,0,85,255,255,255,172],G:[0,0,0,0,85,170,255,255,255,255,85,0,0],B:[0,170,85,255,255,170,170,0,85,0,0,0,0],A:[0,5,10,21,26,32,37,42,48,53,64,72,85],I:[0,15,31,63,79,95,111,127,143,159,191,217,255]},plasma_default={R:[13,156,237,240],G:[8,23,121,249],B:[135,158,83,33],A:[0,56,80,88],I:[0,64,192,255]},random_default={R:[208,71,33,192,32,195,208,173,233,202,25,210,145,89,87,245,246,38,3,25,57,167,245,86,227,208,81,64,90,199,140,48,212,180,70,120,9,192,245,177,65,157,9,193,100,181,125,145,62,8,108,36,140,237,242,248,161,189,41,114,65,121,97,50,238,149,44,214,124,167,40,167,127,178,231,30,173,244,193,203,204,238,139,135,71,234,234,217,66,14,129,19,97,165,112,244,35,73,192,12,149,71,33,192,32,195,208,173,233,202,25,210,145,89,87,245,246,38,3,25,57,167,245,86,227,208,81,64,90,199,140,48,212,180,70,120,9,192,245,177,65,157,9,193,100,181,125,145,62,8,108,36,140,237,242,248,161,189,41,114,65,121,97,50,238,149,44,214,124,167,40,167,127,178,231,30,173,244,193,203,204,238,139,135,71,234,234,217,66,14,129,19,97,165,112,244,35,73,192,12,149,71,33,192,32,195,208,173,233,202,25,210,145,89,87,245,246,38,3,25,57,167,245,86,227,208,81,64,90,199,140,48,212,180,70,120,9,192,245,177,65,157,9,193,100,181,125,145,62,8,108,36,140,237,242,248],G:[182,46,78,199,79,89,41,208,135,20,154,35,21,43,230,113,191,147,208,37,28,27,86,203,25,209,148,187,139,111,48,102,76,110,106,130,37,160,34,222,90,165,245,222,102,47,19,130,4,232,137,211,240,11,140,21,42,22,241,61,99,115,199,166,114,190,204,60,233,66,115,230,125,103,203,125,13,176,94,131,39,198,167,124,67,175,254,1,15,198,62,237,159,31,218,58,244,47,61,67,94,46,78,199,79,89,41,208,135,20,154,35,21,43,230,113,191,147,208,37,28,27,86,203,25,209,148,187,139,111,48,102,76,110,106,130,37,160,34,222,90,165,245,222,102,47,19,130,4,232,137,211,240,11,140,21,42,22,241,61,99,115,199,166,114,190,204,60,233,66,115,230,125,103,203,125,13,176,94,131,39,198,167,124,67,175,254,1,15,198,62,237,159,31,218,58,244,47,61,67,94,46,78,199,79,89,41,208,135,20,154,35,21,43,230,113,191,147,208,37,28,27,86,203,25,209,148,187,139,111,48,102,76,110,106,130,37,160,34,222,90,165,245,222,102,47,19,130,4,232,137,211,240,11,140,21],B:[191,154,43,10,207,204,164,231,136,58,239,30,147,230,101,111,150,35,128,57,252,79,173,120,25,126,81,85,8,7,122,237,190,152,246,182,130,219,67,76,167,178,235,250,28,61,186,250,199,67,58,50,86,182,108,77,89,112,59,125,226,50,205,227,125,128,104,27,59,66,53,133,159,203,97,125,139,159,158,7,215,47,140,226,223,231,44,110,184,61,233,47,67,148,22,120,173,156,117,181,94,154,43,10,207,204,164,231,136,58,239,30,147,230,101,111,150,35,128,57,252,79,173,120,25,126,81,85,8,7,122,237,190,152,246,182,130,219,67,76,167,178,235,250,28,61,186,250,199,67,58,50,86,182,108,77,89,112,59,125,226,50,205,227,125,128,104,27,59,66,53,133,159,203,97,125,139,159,158,7,215,47,140,226,223,231,44,110,184,61,233,47,67,148,22,120,173,156,117,181,94,154,43,10,207,204,164,231,136,58,239,30,147,230,101,111,150,35,128,57,252,79,173,120,25,126,81,85,8,7,122,237,190,152,246,182,130,219,67,76,167,178,235,250,28,61,186,250,199,67,58,50,86,182,108,77],A:[0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},red_default={R:[0,128,255],G:[0,0,0],B:[0,0,0],A:[0,64,128],I:[0,128,255]},redyell_default={R:[192,224,255],G:[1,128,255],B:[0,0,0],A:[0,64,128],I:[0,128,255]},rocket_default={R:[3,112,144,188,236,246,255],G:[5,31,29,22,76,158,250],B:[26,87,91,86,62,117,235],A:[0,30,38,49,67,85,107],I:[0,73,92,118,160,205,255]},surface_default={R:[1,240,255],G:[1,128,255],B:[1,128,255],A:[0,76,128],I:[0,153,255]},turbo_default={R:[48,48,64,70,65,25,132,195,244,254,218,122],G:[18,18,64,107,150,226,255,241,199,158,57,4],B:[59,59,162,227,255,187,81,52,58,47,7,3],A:[0,22,26,30,34,43,52,57,63,67,77,86],I:[0,1,16,32,49,83,118,140,164,181,219,255]},violet_default={R:[0,128,255],G:[0,0,0],B:[0,128,255],A:[0,64,128],I:[0,128,255]},viridis_default={R:[68,49,53,253],G:[1,104,183,231],B:[84,142,121,37],A:[0,56,80,88],I:[0,64,192,255]},warm_default={R:[255,255,255],G:[127,196,254],B:[0,0,0],A:[0,64,128],I:[0,128,255]},winter_default={R:[0,0,0],G:[0,128,255],B:[255,196,128],A:[0,64,128],I:[0,128,255]},x_rain_default={R:[3,64,0,0,255,255,255],G:[0,0,0,255,255,192,3],B:[0,32,48,56,64,96,128],A:[0,8,16,24,32,52,80],I:[0,32,64,96,160,192,255]},afni_blues_inv_default={min:0,max:0,R:[0,37],G:[242,0],B:[255,255],A:[0,64],I:[0,255]},afni_reds_inv_default={R:[255,255],G:[255,11],B:[0,0],A:[0,64],I:[0,255]},roi_i256_default={min:0,max:0,R:[65,10,223,120,216,207,251,93,252,217,21,253,131,165,173,143,144,217,86,89,63,254,172,1,142,107,42,78,221,8,222,71,127,126,167,33,104,2,208,216,0,251,7,105,2,101,248,190,253,62,255,224,166,37,110,138,45,34,6,37,69,201,43,122,199,37,173,194,103,211,75,159,96,4,239,98,110,193,253,166,40,255,48,130,140,243,101,9,177,220,133,32,4,81,48,48,210,109,60,132,1,119,1,159,247,33,212,187,253,144,196,254,168,79,64,196,39,97,73,173,104,216,217,43,101,119,254,5,237,103,203,122,57,87,251,164,19,75,200,2,252,150,66,0,255,157,23,254,55,16,240,161,69,253,207,195,5,60,255,251,200,217,134,123,253,180,27,246,130,136,250,232,4,125,140,22,253,255,13,180,123,61,254,111,10,185,76,192,255,223,186,61,198,5,172,13,83,172,171,6,23,73,134,133,109,61,213,55,57,132,36,209,2,144,1,253,68,155,3,160,2,77,121,70,67,176,223,131,4,162,232,255,150,94,235,191,207,10,246,0,225,4,209,116,57,112,172,253,1,6,92,227,73,62,135,223],G:[162,50,112,245,4,124,176,243,56,125,183,139,182,68,189,4,225,10,20,223,7,46,31,193,225,250,219,41,2,100,83,181,34,150,72,223,168,248,80,253,7,117,214,2,248,10,3,59,179,160,90,244,146,4,207,4,125,255,96,100,1,208,130,51,116,181,236,53,244,5,165,28,181,86,96,42,254,1,134,194,214,92,41,204,137,86,207,3,143,3,100,239,164,94,65,251,131,244,173,57,143,107,217,53,210,0,148,250,45,198,81,40,61,218,252,88,171,0,248,24,248,4,41,100,187,46,208,145,43,168,121,46,175,250,125,107,233,112,207,231,174,215,53,9,43,153,52,124,128,65,210,147,255,147,63,200,148,254,0,179,241,42,239,2,230,8,82,135,87,16,3,87,86,151,254,8,255,86,53,19,7,192,171,201,253,247,197,103,251,126,0,149,54,183,61,126,79,113,10,103,184,75,11,195,222,136,149,131,8,99,240,177,252,255,198,16,7,68,178,66,191,150,73,26,211,109,78,209,240,254,1,166,247,131,2,0,167,127,133,10,43,99,235,3,214,142,176,82,132,38,10,249,255,215,44,81],B:[176,182,248,37,117,35,96,69,32,152,108,20,237,250,2,89,141,216,111,251,211,149,10,44,214,103,31,251,3,32,252,246,97,1,219,167,197,4,36,116,206,118,106,43,205,204,114,69,127,205,87,80,41,251,145,204,253,161,247,1,149,9,43,253,97,72,136,161,171,181,26,255,108,80,218,214,231,255,84,31,109,4,218,3,217,36,68,85,241,39,221,2,240,2,173,42,206,5,110,46,103,27,212,184,2,207,246,45,116,72,110,253,38,105,248,159,243,81,192,93,141,145,24,157,234,131,57,178,62,75,65,176,148,40,253,66,76,240,51,154,17,251,139,253,207,9,114,49,200,254,96,73,138,118,204,102,137,89,145,161,4,112,66,234,147,178,212,205,185,11,203,131,2,250,118,169,1,185,154,53,171,197,61,175,249,96,15,254,95,5,222,75,246,194,2,61,180,25,133,165,15,233,59,35,221,140,109,7,114,255,198,0,115,168,252,23,242,80,75,142,137,255,12,182,68,201,4,111,37,228,83,248,24,192,249,5,54,223,160,122,160,114,145,119,252,31,253,250,10,214,8,47,0,142,222,70],A:[0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},ColorTables=class{constructor(){__publicField(this,"gamma",1),__publicField(this,"version",.1),__publicField(this,"cluts",{});const n=Object.keys(cmaps_exports).filter(s=>!s.startsWith("$")).sort(new Intl.Collator("en").compare);for(const s of n)this.cluts[s]=cmaps_exports[s]}addColormap(u,n){this.cluts[u]=n}colormaps(){return Object.keys(this.cluts)}colorMaps(){return this.colormaps()}colormapFromKey(u){let n=this.cluts[u];return n!==void 0||(n=this.cluts[u.toLowerCase()],n!==void 0)?n:(u.length>0&&log$4.warn("No color map named "+u),{min:0,max:0,R:[0,255],G:[0,255],B:[0,255],A:[0,255],I:[0,255]})}colormap(u="",n=!1){const s=this.colormapFromKey(u);return this.makeLut(s.R,s.G,s.B,s.A,s.I,n)}makeLabelLut(u,n=255){if(u.R===void 0||u.G===void 0||u.B===void 0)throw new Error(`Invalid colormap table: ${u}`);const s=u.R.length,c=u.I??[...Array(s).keys()];if(s!==u.G.length||s!==u.B.length||s!==c.length)throw new Error(`colormap does not make sense: ${u}`);let f=new Uint8ClampedArray(s).fill(n);f[0]=0,u.A!==void 0&&(f=Uint8ClampedArray.from(u.A));const g=Math.min(...c),A=Math.max(...c),v=A-g+1,y=new Uint8ClampedArray(v*4).fill(0);for(let I=0;I0)for(let A=0;A"u"){S=new Uint8ClampedArray(A).fill(0);for(let e=0;e"u"&&(I=new Uint8ClampedArray(A).fill(64),I[0]=0);for(let e=0;e0&&(c[A]=!0);const f=n.length/3;let g=0;for(let A=0;A0&&(O=1/Math.sqrt(O),s[0]*=O,s[1]*=O,s[2]*=O),N[c]=s[0],N[c+1]=s[1],N[c+2]=s[2]}return N}},utiltiesLogger=log$4,NVMeshLoaders=class Z0{static readTRACT(n){const s=n.byteLength;if(s<20)throw new Error("File too small to be niml.tract: bytes = "+s);const c=new DataView(n),f=new Uint8Array(n);let g=0;function A(){for(;g=1&&oe<=2)fe=4;else if(oe>=3&&oe<=4)fe=2;else if(oe===5)fe=1;else if(oe!==0)throw new Error("impossible Matlab v4 datatype");if(O+=Q,W>50)throw new Error("Does not appear to be little-endian V4 Matlab file");const me=O+m*fe;z[ee]=V(oe,O,me),O=me}for(;O+20>10,O=N&1023;return(N>>15?-1:1)*(M?M===31?O?NaN:1/0:Math.pow(2,M-15)*(1+O/1024):6103515625e-14*(O/1024))}let c=0,f=0,g=new Float32Array([]);const A=[],v=[],y=[],T=[];let I=[],S=!1;const k=unzipSync$1(new Uint8Array(n),{filter(N){return N.originalSize>0}}),e=Object.keys(k);for(let N=0,M=e.length;N2||g!==1e3||c!==1128354388)throw new Error("Not a valid TRK file");const A=s.getInt16(36,!0),v=[];for(let Z=0;Z0)for(let pe=0;pe0)for(let ee=0;ee=T);O++)I[S]=parseFloat(M[O]),S++}const k=[];for(A++;f[A].length<1;)A++;if(v=f[A].trim().split(/\s+/),A++,v[0].includes("LINES")){const N=parseInt(v[1]);if(N<1)throw new Error("Corrupted VTK ASCII");let M=f[A].trim();const O=[];let z=[];if(M.startsWith("OFFSETS")){A++;let B=0;for(;B=N));b++);}z=Array.from(I)}else{let B=function(){M=f[A].trim();const q=M.trim().split(/\s+/);b=[];for(let Y=0;Y=b.length&&B();const Y=b[W++];V+=Y,O[q+1]=V;for(let X=0;X=b.length&&B();const Q=b[W++]*3;z.push(I[Q+0]),z.push(I[Q+1]),z.push(I[Q+2])}}}return{pts:Float32Array.from(z),offsetPt0:Uint32Array.from(O)}}else if(v[0].includes("TRIANGLE_STRIPS")){const N=parseInt(v[1]);for(let M=0;M1&&B.pop()&&(V=V.split(".").slice(0,-1).join("."));const b=Z0.readTSF(s,z);c.dpv||(c.dpv=[]);const W=b.reduce((Y,X)=>Math.min(Y,X)),q=b.reduce((Y,X)=>Math.max(Y,X));c.dpv.push({id:V,vals:Float32Array.from(b.slice()),global_min:W,global_max:q,cal_min:W,cal_max:q});return}if(N<3)return;if(e==="MZ3")S.values=Z0.readMZ3(s,N);else if(e==="ANNOT"){const z=Z0.readANNOT(s,N,!0);z instanceof Uint32Array?S.values=z:(S.values=z.scalars,S.colormapLabel=z.colormapLabel)}else if(e==="CRV"||e==="CURV")S.values=Z0.readCURV(s,N),S.isTransparentBelowCalMin=!1;else if(e==="GII"){const z=Z0.readGII(s,N);S.values=z.scalars,S.colormapLabel=z.colormapLabel}else if(e==="MGH"||e==="MGZ"){const z=Z0.readMGH(s,N,!0);"scalars"in z?(S.values=z.scalars,S.colormapLabel=z.colormapLabel):S.values=z}else if(e==="NII")S.values=Z0.readNII(s,N,c.anatomicalStructurePrimary);else if(e==="SMP")S.values=Z0.readSMP(s,N);else if(e==="STC")S.values=Z0.readSTC(s,N);else{log$4.warn("Unknown layer overlay format "+n);return}if(!S.values)return;S.nFrame4D=S.values.length/N,S.frame4D=0,S.outlineBorder=I;let M=S.values[0],O=S.values[0];for(let z=0;z5){const S=decompressSync$1(new Uint8Array(n));f=new DataView(S.buffer),g=f.getUint16(0,!0),n=S.buffer}g>5&&log$4.error("Unsupported or invalid BrainVoyager SMP version "+g);const A=f.getUint32(2,!0);A!==s&&log$4.error("SMP file has "+A+" vertices, background mesh has "+s);const v=f.getUint16(6,!0),y=new Float32Array(A*v);let T=9;function I(){const S=T;for(;T=3&&k.mapType===3&&(k.nLags=f.getUint32(T,!0),T+=4,k.mnLag=f.getUint32(T,!0),T+=4,k.mxLag=f.getUint32(T,!0),T+=4,k.ccOverlay=f.getUint32(T,!0),T+=4),k.clusterSize=f.getUint32(T,!0),T+=4,k.clusterCheck=f.getUint8(T),T+=1,k.critThresh=f.getFloat32(T,!0),T+=4,k.maxThresh=f.getFloat32(T,!0),T+=4,g>=4&&(k.includeValuesGreaterThreshMax=f.getUint32(T,!0),T+=4),k.df1=f.getUint32(T,!0),T+=4,k.df2=f.getUint32(T,!0),T+=4,g>=5?(k.posNegFlag=f.getUint32(T,!0),T+=4):k.posNegFlag=3,k.cortexBonferroni=f.getUint32(T,!0),T+=4,k.posMinRGB=[0,0,0],k.posMaxRGB=[0,0,0],k.negMinRGB=[0,0,0],k.negMaxRGB=[0,0,0],g>=2&&(k.posMinRGB[0]=f.getUint8(T),T++,k.posMinRGB[1]=f.getUint8(T),T++,k.posMinRGB[2]=f.getUint8(T),T++,k.posMaxRGB[0]=f.getUint8(T),T++,k.posMaxRGB[1]=f.getUint8(T),T++,k.posMaxRGB[2]=f.getUint8(T),T++,g>=4&&(k.negMinRGB[0]=f.getUint8(T),T++,k.negMinRGB[1]=f.getUint8(T),T++,k.negMinRGB[2]=f.getUint8(T),T++,k.negMaxRGB[0]=f.getUint8(T),T++,k.negMaxRGB[1]=f.getUint8(T),T++,k.negMaxRGB[2]=f.getUint8(T),T++),k.enableSMPColor=f.getUint8(T),T++,g>=4&&(k.lut=I()),k.colorAlpha=f.getFloat32(T,!0),T+=4),k.name=I();const e=new Float32Array(n,T,A);y.set(e,S*A),T+=A*4}return y}static readSTC(n,s){const c=new DataView(n),f=c.getInt32(8,!1);if(f!==s)throw new Error("Overlay has "+f+" vertices, expected "+s);let g=12+f*4;const A=c.getUint32(g,!1);g+=4;const v=new Float32Array(A*f);for(let y=0;y0)return v;const S=f.getInt32(A+=4,!1),k=f.getInt32(A+=4,!1);A+=k;const e=f.getInt32(A+=4,!1);if(e<1)return v;const N={R:Array(S).fill(0),G:Array(S).fill(0),B:Array(S).fill(0),A:Array(S).fill(0),I:Array(S).fill(0),labels:Array(S).fill("")};for(let B=0;B=S){log$4.warn("annot entry out of range");continue}N.R[V]=q,N.G[V]=Y,N.B[V]=X,N.A[V]=Q,N.I[V]=(Q<<24)+(X<<16)+(Y<<8)+q,N.labels[V]=W}const M=new Float32Array(g);M.fill(-1);let O=0;for(let B=0;B0&&log$4.error(`annot vertex colors do not match ${O} of ${g} vertices.`);for(let B=0;B=v*3)break;S[T+2]=parseInt(e[0])-1,S[T+1]=parseInt(e[1])-1,S[T+0]=parseInt(e[2])-1,T+=3}return{positions:I,indices:S}}static readASC(n){const s=n.byteLength,c=new Uint8Array(n);let f=0;function g(){for(;f65535)throw new Error("Invalid VTK binary polygons using little-endian data (MRtrix)");f+=4;const B=k.getInt32(f,!1);f+=4;let V=k.getInt32(f,!1);f+=4;for(let b=0;b=0&&(k=new Float32Array(n,y,v*3)),{positions:S,indices:I,colors:k}}static readMZ3(n,s=0){if(n.byteLength<20)throw new Error("File too small to be mz3: bytes = "+n.byteLength);let c=new DataView(n),f=c.getUint16(0,!0),g=n;if(f===35615||f===8075){const q=decompressSync$1(new Uint8Array(n));c=new DataView(q.buffer),f=c.getUint16(0,!0),g=q.buffer}const A=c.getUint16(2,!0),v=c.getUint32(4,!0);let y=c.getUint32(8,!0);const T=c.getUint32(12,!0);if(utiltiesLogger.debug("MZ3 magic %d attr %d face %d vert %d skip %d",f,A,v,y,T),f!==23117)throw new Error("Invalid MZ3 file");const I=(A&1)!==0,S=(A&2)!==0,k=(A&4)!==0;let e=(A&8)!==0;const N=(A&16)!==0;if(A>63)throw new Error("Unsupported future version of MZ3 file");let M=4;N&&(M=8);let O=0;if(s>0&&!I&&v<1&&!k&&(e=!0),e){let q=s;s===0&&(q=y);const Y=16+T+(I?1:0)*v*12+(S?1:0)*q*12+(k?1:0)*q*4,X=Math.floor((g.byteLength-Y)/M);y!==s&&X%s===0&&(log$4.warn("Issue 729: mz3 mismatch scalar NVERT does not match mesh NVERT"),y=s),O=Math.floor(X/y),O<1&&(log$4.warn("Corrupt MZ3: file reports NSCALAR but not enough bytes"),e=!1)}if(y<3&&s<3)throw new Error("Not a mesh MZ3 file (maybe scalar)");s>0&&s!==y&&log$4.warn("Layer has "+y+"vertices, but background mesh has "+s);let z=16+T,B=null;I&&(B=new Uint32Array(g,z,v*3),z+=v*3*4);let V=null;S&&(V=new Float32Array(g,z,y*3),z+=y*3*4);let b=null;if(k){b=new Float32Array(y*3);const q=new Uint8Array(g,z,y*4);z+=y*4;let Y=0,X=0;for(let Q=0;Q0){if(N){const q=new Float64Array(g,z,O*y);W=Float32Array.from(q)}else W=new Float32Array(g,z,O*y);z+=M*O*y}return s>0?W:{positions:V,indices:B,scalars:W,colors:b}}static readPLY(n){const s=n.byteLength,c=new Uint8Array(n);let f=0;function g(){for(;fm.length){const Se=new Uint32Array(m.length+m.length);Se.set(m),m=Se.slice()}const me=parseInt(oe[z+1]);let pe=parseInt(oe[z+2]);for(let Se=0;Se>0&255)/255,(n>>8&255)/255,(n>>16&255)/255,(n>>24&255)/255]}};__publicField(_NiivueObject3D,"BLEND",1);__publicField(_NiivueObject3D,"CULL_FACE",2);__publicField(_NiivueObject3D,"CULL_FRONT",4);__publicField(_NiivueObject3D,"CULL_BACK",8);__publicField(_NiivueObject3D,"ENABLE_DEPTH_TEST",16);__publicField(_NiivueObject3D,"generateCrosshairs",function(u,n,s,c,f,g,A=20,v=0){const y=_NiivueObject3D.generateCrosshairsGeometry(u,s,c,f,g,A,v);return new _NiivueObject3D(n,y.vertexBuffer,u.TRIANGLES,y.indexCount,y.indexBuffer,y.vao)});__publicField(_NiivueObject3D,"generateCrosshairsGeometry",function(u,n,s,c,f,g=20,A=0){const v=[],y=[],T=f*A;if(T<=0){let e=fromValues$2(s[0],n[1],n[2]),N=fromValues$2(c[0],n[1],n[2]);_NiivueObject3D.makeCylinder(v,y,e,N,f,g),e=fromValues$2(n[0],s[1],n[2]),N=fromValues$2(n[0],c[1],n[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g),e=fromValues$2(n[0],n[1],s[2]),N=fromValues$2(n[0],n[1],c[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g)}else{let e=fromValues$2(s[0],n[1],n[2]),N=fromValues$2(n[0]-T,n[1],n[2]);_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0]+T,n[1],n[2]),N=fromValues$2(c[0],n[1],n[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0],s[1],n[2]),N=fromValues$2(n[0],n[1]-T,n[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0],n[1]+T,n[2]),N=fromValues$2(n[0],c[1],n[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0],n[1],s[2]),N=fromValues$2(n[0],n[1],n[2]-T),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1),e=fromValues$2(n[0],n[1],n[2]+T),N=fromValues$2(n[0],n[1],c[2]),_NiivueObject3D.makeCylinder(v,y,e,N,f,g,!1)}const I=u.createBuffer();if(I===null)throw new Error("could not instantiate vertex buffer");u.bindBuffer(u.ARRAY_BUFFER,I),u.bufferData(u.ARRAY_BUFFER,new Float32Array(v),u.STATIC_DRAW);const S=u.createBuffer();if(S===null)throw new Error("could not instantiate index buffer");u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,S),u.bufferData(u.ELEMENT_ARRAY_BUFFER,new Uint32Array(y),u.STATIC_DRAW);const k=u.createVertexArray();return u.bindVertexArray(k),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,S),u.bindBuffer(u.ARRAY_BUFFER,I),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,3,u.FLOAT,!1,0,0),u.bindVertexArray(null),{vertexBuffer:I,indexBuffer:S,indexCount:y.length,vao:k}});__publicField(_NiivueObject3D,"getFirstPerpVector",function(u){const n=fromValues$2(0,0,0);return u[0]===0?n[0]=1:u[1]===0?n[1]=1:u[2]===0?n[2]=1:(n[0]=u[2],n[1]=u[2],n[2]=-(u[0]+u[1]),normalize$1(n,n)),n});__publicField(_NiivueObject3D,"subdivide",function(u,n){let s=u.length/3,c=n.length/3;const f=c,g=create$2(),A=create$2();for(let v=0;vitksnap_default,$slicer3d:()=>slicer3d_default,actc:()=>actc_default,afni_blues_inv:()=>afni_blues_inv_default,afni_reds_inv:()=>afni_reds_inv_default,bcgwhw:()=>bcgwhw_default,bcgwhw_dark:()=>bcgwhw_dark_default,blue:()=>blue_default,blue2cyan:()=>blue2cyan_default,blue2magenta:()=>blue2magenta_default,blue2red:()=>blue2red_default,bluegrn:()=>bluegrn_default,bone:()=>bone_default,bronze:()=>bronze_default,cet_l17:()=>cet_l17_default,cividis:()=>cividis_default,cool:()=>cool_default,copper:()=>copper_default,copper2:()=>copper2_default,ct_airways:()=>ct_airways_default,ct_artery:()=>ct_artery_default,ct_bones:()=>ct_bones_default,ct_brain:()=>ct_brain_default,ct_brain_gray:()=>ct_brain_gray_default,ct_cardiac:()=>ct_cardiac_default,ct_head:()=>ct_head_default,ct_kidneys:()=>ct_kidneys_default,ct_liver:()=>ct_liver_default,ct_muscles:()=>ct_muscles_default,ct_scalp:()=>ct_scalp_default,ct_skull:()=>ct_skull_default,ct_soft:()=>ct_soft_default,ct_soft_tissue:()=>ct_soft_tissue_default,ct_surface:()=>ct_surface_default,ct_vessels:()=>ct_vessels_default,ct_w_contrast:()=>ct_w_contrast_default,cubehelix:()=>cubehelix_default,electric_blue:()=>electric_blue_default,freesurfer:()=>freesurfer_default,ge_color:()=>ge_color_default,gold:()=>gold_default,gray:()=>gray_default,green:()=>green_default,green2cyan:()=>green2cyan_default,green2orange:()=>green2orange_default,hot:()=>hot_default,hotiron:()=>hotiron_default,hsv:()=>hsv_default,inferno:()=>inferno_default,jet:()=>jet_default,linspecer:()=>linspecer_default,magma:()=>magma_default,mako:()=>mako_default,nih:()=>nih_default,plasma:()=>plasma_default,random:()=>random_default,red:()=>red_default,redyell:()=>redyell_default,rocket:()=>rocket_default,roi_i256:()=>roi_i256_default,surface:()=>surface_default,turbo:()=>turbo_default,violet:()=>violet_default,viridis:()=>viridis_default,warm:()=>warm_default,winter:()=>winter_default,x_rain:()=>x_rain_default});var itksnap_default={R:[0,255,0,0,255,0,255,255,0,205,210,102,0,0,46,255,106,221,233,165,255,147,218,75,255,60,255,255,218,0,188,255,255,222,127,139,124,255,70,0,238,238,240,245,184,32,255,25,112,34,248,245,255,144,173,65,255,250,128,50,244,255,123,255,173,255,127,255,143,220,253,255,0,0,128,255,250,148,178,255,135,100,240,250,255,107,135,0,139,245,186,255,255,0,210,255,47,72,175,128,176,255,139,240,255,216,119,219,72,255,199,154,189,240,230,0,85,64,153,205,250,95,0,255,224,176,138,30,240,152,160],G:[0,0,255,0,255,255,0,239,0,133,180,205,0,139,139,228,90,160,150,42,250,112,112,0,182,179,235,228,165,128,143,105,218,184,255,69,252,255,130,100,130,232,255,222,134,178,20,25,128,139,248,255,160,238,255,105,99,240,0,205,164,255,104,165,216,192,255,140,188,20,245,250,206,255,0,250,128,0,34,127,206,149,230,235,245,142,206,0,0,245,85,228,222,191,105,248,79,61,238,128,224,240,0,255,215,191,136,112,209,0,21,205,183,248,230,250,107,224,50,92,250,158,128,69,255,196,43,144,128,251,82],B:[0,0,0,255,0,255,255,213,205,63,140,170,128,139,87,225,205,221,122,42,250,219,214,130,193,113,205,196,32,128,143,180,185,135,0,19,0,224,180,0,238,170,240,179,11,170,147,112,144,34,255,250,122,144,47,225,71,230,0,50,96,240,238,0,230,203,212,0,143,60,230,240,209,127,128,205,114,211,34,80,235,237,140,215,238,35,250,139,139,220,211,181,173,255,30,220,79,139,238,0,230,245,0,255,0,216,153,147,204,255,133,50,107,255,250,154,47,208,204,92,210,160,0,0,255,222,226,255,128,152,45],A:[0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130]},slicer3d_default={labels:["background","tissue","bone","skin","connective tissue","blood","organ","mass","muscle","foreign object","waste","teeth","fat","gray matter","white matter","nerve","vein","artery","capillary","ligament","tendon","cartilage","meniscus","lymph node","lymphatic vessel","cerebro-spinal fluid","bile","urine","feces","gas","fluid","edema","bleeding","necrosis","clot","embolism","head","central nervous system","brain","gray matter of brain","telencephalon","cerebral cortex","right frontal lobe","left frontal lobe","right temporal lobe","left temporal lobe","right parietal lobe","left parietal lobe","right occipital lobe","left occipital lobe","right insular lobe","left insular lobe","right limbic lobe","left limbic lobe","right striatum","left striatum","right caudate nucleus","left caudate nucleus","right putamen","left putamen","right pallidum","left pallidum","right amygdaloid complex","left amygdaloid complex","diencephalon","thalamus","right thalamus","left thalamus","pineal gland","midbrain","substantia nigra","right substantia nigra","left substantia nigra","cerebral white matter","right superior longitudinal fasciculus","left superior longitudinal fasciculus","right inferior longitudinal fasciculus","left inferior longitudinal fasciculus","right arcuate fasciculus","left arcuate fasciculus","right uncinate fasciculus","left uncinate fasciculus","right cingulum bundle","left cingulum bundle","projection fibers","right corticospinal tract","left corticospinal tract","right optic radiation","left optic radiation","right medial lemniscus","left medial lemniscus","right superior cerebellar peduncle","left superior cerebellar peduncle","right middle cerebellar peduncle","left middle cerebellar peduncle","right inferior cerebellar peduncle","left inferior cerebellar peduncle","optic chiasm","right optic tract","left optic tract","right fornix","left fornix","commissural fibers","corpus callosum","posterior commissure","cerebellar white matter","CSF space","ventricles of brain","right lateral ventricle","left lateral ventricle","right third ventricle","left third ventricle","cerebral aqueduct","fourth ventricle","subarachnoid space","spinal cord","gray matter of spinal cord","white matter of spinal cord","endocrine system of brain","pituitary gland","adenohypophysis","neurohypophysis","meninges","dura mater","arachnoid","pia mater","muscles of head","salivary glands","lips","nose","tongue","soft palate","right inner ear","left inner ear","right external ear","left external ear","right middle ear","left middle ear","right eyeball","left eyeball","skull","right frontal bone","left frontal bone","right parietal bone","left parietal bone","right temporal bone","left temporal bone","right sphenoid bone","left sphenoid bone","right ethmoid bone","left ethmoid bone","occipital bone","maxilla","right zygomatic bone","right lacrimal bone","vomer bone","right palatine bone","left palatine bone","mandible","neck","muscles of neck","pharynx","larynx","thyroid gland","right parathyroid glands","left parathyroid glands","skeleton of neck","hyoid bone","cervical vertebral column","thorax","trachea","bronchi","right lung","left lung","superior lobe of right lung","superior lobe of left lung","middle lobe of right lung","inferior lobe of right lung","inferior lobe of left lung","pleura","heart","right atrium","left atrium","atrial septum","ventricular septum","right ventricle of heart","left ventricle of heart","mitral valve","tricuspid valve","aortic valve","pulmonary valve","aorta","pericardium","pericardial cavity","esophagus","thymus","mediastinum","skin of thoracic wall","muscles of thoracic wall","skeleton of thorax","thoracic vertebral column","ribs","sternum","right clavicle","left clavicle","abdominal cavity","abdomen","peritoneum","omentum","peritoneal cavity","retroperitoneal space","stomach","duodenum","small bowel","colon","anus","liver","biliary tree","gallbladder","pancreas","spleen","urinary system","right kidney","left kidney","right ureter","left ureter","urinary bladder","urethra","right adrenal gland","left adrenal gland","female internal genitalia","uterus","right fallopian tube","left fallopian tube","right ovary","left ovary","vagina","male internal genitalia","prostate","right seminal vesicle","left seminal vesicle","right deferent duct","left deferent duct","skin of abdominal wall","muscles of abdominal wall","skeleton of abdomen","lumbar vertebral column","female external genitalia","male external genitalia","skeleton of upper limb","muscles of upper limb","right upper limb","left upper limb","right shoulder","left shoulder","right arm"],R:[0,128,241,177,111,216,221,144,192,220,78,255,230,200,250,244,0,216,183,183,152,111,178,68,111,85,0,214,78,218,170,140,188,216,145,150,177,244,250,200,68,128,83,83,162,162,141,141,182,182,188,188,154,154,177,177,30,30,210,210,48,48,98,98,69,166,122,122,253,145,46,0,0,250,127,127,159,159,125,125,106,106,154,154,126,201,201,78,78,174,174,139,139,148,148,186,186,99,156,156,64,64,138,97,126,194,85,88,88,88,88,88,88,88,88,244,200,250,82,57,60,92,255,255,255,255,201,70,188,177,166,182,229,229,174,174,201,201,194,194,241,203,203,229,229,255,255,209,209,248,248,255,196,255,255,255,242,242,222,177,213,184,150,62,62,62,242,250,255,177,182,175,197,197,172,172,202,224,224,255,206,210,203,233,195,181,152,159,166,218,225,224,255,184,211,47,255,173,188,255,226,253,244,205,205,186,177,255,234,204,180,216,255,205,204,255,221,0,139,249,157,203,185,185,247,247,222,124,249,249,244,255,255,227,213,213,193,216,230,245,245,241,241,177,171,217,212,185,185,198,194,177,177,177,177,177],G:[0,174,214,122,184,101,130,238,104,245,63,250,220,200,250,214,151,101,156,214,189,184,212,172,197,188,145,230,63,255,250,224,65,191,60,98,122,214,250,200,131,174,146,146,115,115,93,93,166,166,135,135,150,150,140,140,111,111,157,157,129,129,153,153,110,113,101,101,135,92,101,108,108,250,150,150,116,116,102,102,174,174,146,146,126,160,160,152,152,140,140,126,126,120,120,135,135,106,171,171,123,123,95,113,161,195,188,106,106,106,106,106,106,106,106,214,200,250,174,157,143,162,244,244,244,244,121,163,91,122,84,105,147,147,122,122,112,112,142,142,213,179,179,204,204,243,243,185,185,223,223,230,172,255,250,237,217,217,198,122,124,105,208,162,162,162,206,210,255,122,228,216,165,165,138,138,164,186,186,245,110,115,108,138,100,85,55,63,70,123,130,97,244,122,171,150,244,121,95,239,202,232,217,179,179,124,122,255,234,142,119,132,253,167,168,224,130,145,150,180,108,136,102,102,182,182,154,186,186,186,170,181,190,153,141,141,123,146,158,172,172,172,172,124,85,198,188,135,135,175,98,122,122,122,122,122],B:[0,128,145,101,210,79,101,144,88,20,0,220,70,235,210,49,206,79,220,211,207,210,242,100,131,255,30,130,0,255,250,228,28,216,66,83,101,49,225,215,98,128,164,164,105,105,137,137,110,110,166,166,201,201,190,190,85,85,166,166,126,126,112,112,53,137,38,38,192,109,131,112,112,225,88,88,163,163,154,154,155,155,83,83,55,133,133,141,141,103,103,177,177,72,72,135,135,24,108,108,147,147,74,158,197,164,255,215,215,215,215,215,215,215,215,49,215,225,128,110,83,109,209,209,209,209,77,117,95,101,94,107,118,118,90,90,73,73,0,0,144,77,77,109,109,152,152,85,85,131,131,138,68,167,160,145,123,123,101,101,109,108,243,114,114,114,142,139,207,101,255,244,145,145,115,115,140,162,162,217,84,89,81,112,73,57,13,27,38,97,104,76,209,154,143,103,209,88,76,172,134,158,154,108,108,161,101,220,194,178,153,105,229,142,143,199,101,30,98,111,162,116,83,83,164,164,132,223,150,150,147,158,165,130,113,113,103,127,140,147,147,151,151,92,68,131,102,134,134,125,79,101,101,101,101,101],A:[0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},actc_default={R:[0,0,24,248,255],G:[0,0,177,254,0],B:[0,136,0,0,0],A:[0,32,64,78,128],I:[0,64,128,156,255]},bcgwhw_dark_default={R:[0,248,242,235,229,222,212,202,193,183,173,145,117,78,39,0,0,0,0,0,0,64,128,191,255,255,255,255,255,238,221,204,214,224,235,245,255,249,242,236,229,223,217,210,204,197,191,184,176,169,161,154,146,139,132,124,117,109,102,0],G:[0,251,247,243,239,235,235,235,235,235,235,216,197,174,150,127,153,178,204,229,255,255,255,255,255,220,185,150,115,77,38,0,31,61,92,122,153,138,122,107,92,77,61,46,31,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0],B:[0,254,253,252,251,250,251,252,253,254,255,226,198,132,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,80,120,160,200,199,198,197,196,196,195,194,193,192,191,184,176,169,161,154,146,139,132,124,117,109,102,0],A:[256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256],I:[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,255]},bcgwhw_default={R:[255,248,242,235,229,222,212,202,193,183,173,145,117,78,39,0,0,0,0,0,0,64,128,191,255,255,255,255,255,238,221,204,214,224,235,245,255,249,242,236,229,223,217,210,204,197,191,184,176,169,161,154,146,139,132,124,117,109,102,0],G:[255,251,247,243,239,235,235,235,235,235,235,216,197,174,150,127,153,178,204,229,255,255,255,255,255,220,185,150,115,77,38,0,31,61,92,122,153,138,122,107,92,77,61,46,31,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0],B:[255,254,253,252,251,250,251,252,253,254,255,226,198,132,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,80,120,160,200,199,198,197,196,196,195,194,193,192,191,184,176,169,161,154,146,139,132,124,117,109,102,0],A:[256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256],I:[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,255]},blue2red_default={R:[0,0,0,0,196,255],G:[0,32,128,128,128,32],B:[0,255,196,0,0,0],A:[0,128,64,64,64,128],I:[0,1,64,128,192,255]},blue2magenta_default={R:[0,255],G:[0,0],B:[255,255],A:[0,128],I:[0,255]},blue2cyan_default={R:[0,0],G:[0,255],B:[255,255],A:[0,128],I:[0,255]},bluegrn_default={R:[0,0,0,0],G:[0,1,128,255],B:[0,222,127,32],A:[0,0,64,128],I:[0,1,128,255]},blue_default={R:[0,0,0],G:[0,0,0],B:[0,128,255],A:[0,64,128],I:[0,128,255]},bone_default={R:[0,103,255],G:[0,126,255],B:[0,165,255],A:[0,76,128],I:[0,153,255]},bronze_default={R:[0,43,103,199,216,255],G:[0,0,37,155,213,255],B:[0,0,20,97,201,255],A:[0,44,48,54,56,56],I:[0,64,128,196,240,255]},cet_l17_default={R:[0,9,24,33,40,46,52,57,62,66,70,74,78,81,85,88,91,94,98,101,103,106,109,112,114,117,119,121,124,126,128,130,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,169,171,172,174,175,177,178,180,181,183,184,186,187,189,190,191,193,194,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,222,223,224,224,225,226,226,227,228,228,229,229,230,231,231,232,233,233,234,234,235,235,236,236,236,237,237,237,238,238,238,239,239,239,240,240,240,241,241,241,242,242,242,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,243,243,243,243,243,243,243,243,243,243,243,243,242,242,242,242,242,242,242,242,241,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,243,243,244,244,245,246,246,247,247,248,249,249,250,250,251,251,252,252,253,253,254,254,254],G:[42,41,41,41,40,40,40,39,39,39,38,38,37,37,36,36,35,35,34,34,33,32,32,31,30,30,30,30,29,29,29,29,28,28,28,27,27,27,26,26,26,25,25,25,24,24,24,24,24,25,25,26,27,27,28,28,29,30,30,31,31,32,33,33,34,34,35,36,36,37,38,39,40,42,43,44,45,47,48,49,50,51,53,54,55,56,57,58,59,60,62,63,64,65,66,68,69,71,72,73,75,76,77,79,80,81,83,84,85,87,88,89,90,92,93,94,95,97,98,100,101,102,104,105,107,108,109,111,112,113,115,116,117,119,120,121,122,124,125,126,128,129,130,132,133,134,136,137,138,140,141,142,144,145,146,147,149,150,151,153,154,155,156,158,159,160,161,163,164,165,167,168,169,170,172,173,174,175,176,178,179,180,181,183,184,185,186,187,189,190,191,192,193,194,196,197,198,199,200,201,203,204,205,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,228,229,230,231,232,233,234,235,236,237,238,238,239,240,241,241,242,243,244,244,245,246,247,248,248,249,250,251,251,252,253,254,255],B:[167,167,166,166,166,165,165,165,164,164,164,163,163,162,162,162,161,161,161,160,160,160,159,159,158,158,157,157,156,155,155,154,154,153,153,152,151,151,150,150,149,149,148,147,147,146,146,145,144,144,143,143,142,141,141,140,139,139,138,137,137,136,135,135,134,133,133,132,131,131,130,130,129,128,128,127,127,126,125,125,124,124,123,123,122,121,121,120,119,119,118,118,117,116,116,116,115,115,114,114,113,113,113,112,112,111,111,110,110,109,109,109,108,108,107,107,106,106,106,106,106,105,105,105,105,105,105,105,104,104,104,104,104,103,103,103,103,103,102,102,102,103,103,103,103,104,104,104,104,104,105,105,105,105,106,106,106,106,106,107,107,107,107,108,108,109,110,111,111,112,113,113,114,115,115,116,117,117,118,119,120,120,121,122,122,123,124,125,126,128,129,130,131,132,134,135,136,137,138,140,141,142,143,144,146,147,148,149,150,152,153,155,157,158,160,162,163,165,167,168,170,172,173,175,177,178,180,182,183,185,187,188,190,193,196,199,201,204,207,210,212,215,218,221,224,226,229,232,235,238,240,243,246,249,252,255],A:[0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},cividis_default={R:[0,86,166,255],G:[32,92,156,233],B:[76,108,117,69],A:[0,56,80,88],I:[0,64,192,255]},cool_default={R:[0,0,0],G:[127,196,254],B:[255,255,255],A:[0,64,128],I:[0,128,255]},copper2_default={R:[0,61,122,183,244,255],G:[0,41,81,122,163,255],B:[0,25,51,76,102,255],A:[0,25,51,71,102,128],I:[0,51,102,153,204,255]},copper_default={R:[0,61,122,183,244,255],G:[0,41,81,122,163,203],B:[0,25,51,76,102,127],A:[0,25,51,71,102,128],I:[0,51,102,153,204,255]},ct_airways_default={min:-643,max:-235,R:[0,0,0],G:[154,154,154],B:[179,179,101],A:[0,32,0],I:[0,163,255]},ct_artery_default={min:114,max:800,R:[0,255,255,255],G:[0,0,129,255],B:[0,0,0,255],A:[0,64,88,228],I:[0,80,160,255]},ct_bones_default={min:180,max:600,R:[0,0,113,255],G:[0,0,109,250],B:[0,0,101,245],A:[0,0,100,160],I:[0,1,128,255]},ct_brain_gray_default={min:-10,max:110,R:[0,127,255],G:[0,127,255],B:[0,127,255],A:[0,48,128],I:[0,124,255]},ct_brain_default={min:-10,max:110,R:[0,199,255],G:[0,127,255],B:[0,127,255],A:[0,48,128],I:[0,124,255]},ct_cardiac_default={min:-80,max:1e3,R:[0,189,150,150,150,150,255],G:[0,169,54,54,54,54,240],B:[0,153,52,52,52,52,242],A:[0,32,64,0,0,64,64],I:[0,1,82,92,234,242,255]},ct_head_default={min:-590,max:600,R:[0,241,241,248,248,178,178,232,255,255,255],G:[0,156,156,222,222,36,36,51,255,255,255],B:[0,130,130,169,169,24,24,37,255,255,255],A:[0,8,0,0,0,64,64,0,0,222,222],I:[0,2,3,64,122,142,172,182,252,253,255]},ct_kidneys_default={min:114,max:302,R:[0,255,255],G:[0,129,255],B:[0,0,255],A:[0,88,228],I:[0,103,255]},ct_liver_default={min:-23,max:246,R:[0,44,255,255,255],G:[0,128,90,255,255],B:[0,0,70,0,255],A:[0,0,82,184,228],I:[0,64,131,196,255]},ct_muscles_default={min:-100,max:246,R:[0,128,159,255,255,255,255],G:[0,0,56,90,0,255,255],B:[0,0,41,70,0,0,255],A:[0,63,105,135,167,184,228],I:[0,100,128,155,180,209,255]},ct_scalp_default={min:-590,max:600,R:[0,241,241,248,248,178,232,255,255],G:[0,156,156,222,222,36,51,255,255],B:[0,130,130,169,169,24,37,255,255],A:[0,63,105,135,167,184,228,228,228],I:[0,1,52,127,137,162,172,252,255]},ct_skull_default={min:140,max:1024,R:[0,2,113,255],G:[0,1,109,250],B:[0,1,101,245],A:[0,1,96,168],I:[0,1,128,255]},ct_soft_default={min:-923,max:679,R:[0,0,0,0,0,255,255,255],G:[154,154,154,154,0,0,254,255],B:[179,179,179,179,0,0,0,255],A:[0,3,8,0,0,10,15,20],I:[0,30,62,88,170,200,232,255]},ct_soft_tissue_default={min:-10,max:110,R:[0,199,255],G:[0,127,255],B:[0,127,255],A:[0,48,128],I:[0,124,255]},ct_surface_default={min:-600,max:100,R:[0,134,255],G:[0,109,250],B:[0,101,245],A:[0,60,148],I:[0,128,255]},ct_vessels_default={min:114,max:246,R:[0,255,255],G:[0,128,255],B:[0,128,255],A:[0,64,96],I:[0,87,255]},ct_w_contrast_default={min:50,max:1e3,R:[98,210,169,128,255],G:[94,26,77,128,255],B:[45,21,74,128,255],A:[0,25,0,4,168],I:[0,41,87,154,255]},cubehelix_default={R:[0,13,21,26,27,25,22,21,22,28,39,54,75,98,124,148,171,189,202,210,213,211,206,200,195,193,195,201,211,225,240,255],G:[0,5,11,20,31,44,58,72,86,99,109,116,120,122,122,122,121,121,124,129,137,147,161,175,190,205,218,229,238,245,251,255],B:[0,14,30,46,61,71,77,78,75,68,60,52,48,47,53,65,83,105,131,157,183,205,222,235,241,243,242,240,239,240,245,255],A:[0,4,8,12,17,21,25,29,33,37,41,45,50,54,58,62,66,70,74,78,83,87,91,95,99,103,107,111,116,120,124,128],I:[0,8,16,25,33,41,49,58,66,74,82,90,99,107,115,123,132,140,148,156,165,173,181,189,197,206,214,222,230,239,247,255]},electric_blue_default={R:[0,10,136,255],G:[0,39,220,255],B:[0,223,253,255],A:[0,48,64,70],I:[0,92,192,255]},freesurfer_default={R:[0,245,205,120,196,220,230,0,122,236,12,204,42,119,220,103,60,255,165,160,0,245,205,120,196,220,230,0,122,236,13,220,103,255,165,160,0,120,200,255,255,164,164,164,234,0,0,0,0,0],G:[0,245,62,18,58,248,148,118,186,13,48,182,204,159,216,255,60,165,42,32,200,245,62,18,58,248,148,118,186,13,48,216,255,165,42,32,200,190,70,148,148,108,108,108,169,0,0,0,0,0],B:[0,245,78,134,250,164,34,14,220,176,255,142,164,176,20,255,60,0,42,240,200,245,78,134,250,164,34,14,220,176,255,20,255,0,42,240,221,150,255,10,10,226,226,226,30,64,112,160,208,255],A:[0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64],I:[0,2,3,4,5,7,8,10,11,12,13,14,15,16,17,18,24,26,28,30,31,41,42,43,44,46,47,49,50,51,52,53,54,58,60,62,63,72,77,78,79,80,81,82,85,251,252,253,254,255]},ge_color_default={R:[0,0,128,255,255],G:[0,128,0,128,255],B:[0,125,255,0,255],A:[0,32,64,96,128],I:[0,63,128,192,255]},gold_default={R:[0,142,227,255],G:[0,85,170,255],B:[0,14,76,255],A:[0,42,84,128],I:[0,85,170,255]},gray_default={R:[0,255],G:[0,255],B:[0,255],A:[0,128],I:[0,255]},green_default={R:[0,0,0],G:[0,128,255],B:[0,0,0],A:[0,64,128],I:[0,128,255]},green2cyan_default={R:[0,0,0],G:[72,72,255],B:[0,255,255],A:[0,64,128],I:[0,88,255]},green2orange_default={R:[0,255,255],G:[72,88,255],B:[0,0,0],A:[0,64,128],I:[0,88,255]},hotiron_default={R:[0,255,255,255],G:[0,0,126,255],B:[0,0,0,255],A:[0,64,96,128],I:[0,128,191,255]},hot_default={R:[3,255,255,255],G:[0,0,255,255],B:[0,0,0,255],A:[0,48,96,128],I:[0,95,191,255]},hsv_default={R:[255,255,0,0,0,255,255],G:[0,255,255,255,0,0,0],B:[0,0,0,255,255,255,0],A:[0,14,28,43,57,71,85],I:[0,43,85,128,170,213,255]},inferno_default={R:[0,120,237,240],G:[0,28,105,249],B:[4,109,37,33],A:[0,56,80,88],I:[0,64,192,255]},jet_default={R:[0,0,127,255,127],G:[0,127,255,127,0],B:[127,255,127,0,0],A:[0,32,64,96,128],I:[0,63,128,192,255]},linspecer_default={R:[94,50,90,152,215,238,249,254,252,241,209,158],G:[79,131,186,214,240,244,237,210,157,100,57,1],B:[162,189,167,164,155,169,168,123,86,68,79,66],A:[0,12,23,35,47,58,70,81,93,105,116,128],I:[0,23,46,70,93,116,139,162,185,209,232,255]},magma_default={R:[0,148,183,223,247,252],G:[0,44,55,74,112,253],B:[4,128,121,104,92,191],A:[0,44,53,64,75,107],I:[0,107,128,154,179,255]},mako_default={R:[11,59,55,222],G:[4,45,165,245],B:[5,91,172,229],A:[0,23,70,107],I:[0,56,167,255]},nih_default={R:[0,85,0,0,0,0,0,0,85,255,255,255,172],G:[0,0,0,0,85,170,255,255,255,255,85,0,0],B:[0,170,85,255,255,170,170,0,85,0,0,0,0],A:[0,5,10,21,26,32,37,42,48,53,64,72,85],I:[0,15,31,63,79,95,111,127,143,159,191,217,255]},plasma_default={R:[13,156,237,240],G:[8,23,121,249],B:[135,158,83,33],A:[0,56,80,88],I:[0,64,192,255]},random_default={R:[208,71,33,192,32,195,208,173,233,202,25,210,145,89,87,245,246,38,3,25,57,167,245,86,227,208,81,64,90,199,140,48,212,180,70,120,9,192,245,177,65,157,9,193,100,181,125,145,62,8,108,36,140,237,242,248,161,189,41,114,65,121,97,50,238,149,44,214,124,167,40,167,127,178,231,30,173,244,193,203,204,238,139,135,71,234,234,217,66,14,129,19,97,165,112,244,35,73,192,12,149,71,33,192,32,195,208,173,233,202,25,210,145,89,87,245,246,38,3,25,57,167,245,86,227,208,81,64,90,199,140,48,212,180,70,120,9,192,245,177,65,157,9,193,100,181,125,145,62,8,108,36,140,237,242,248,161,189,41,114,65,121,97,50,238,149,44,214,124,167,40,167,127,178,231,30,173,244,193,203,204,238,139,135,71,234,234,217,66,14,129,19,97,165,112,244,35,73,192,12,149,71,33,192,32,195,208,173,233,202,25,210,145,89,87,245,246,38,3,25,57,167,245,86,227,208,81,64,90,199,140,48,212,180,70,120,9,192,245,177,65,157,9,193,100,181,125,145,62,8,108,36,140,237,242,248],G:[182,46,78,199,79,89,41,208,135,20,154,35,21,43,230,113,191,147,208,37,28,27,86,203,25,209,148,187,139,111,48,102,76,110,106,130,37,160,34,222,90,165,245,222,102,47,19,130,4,232,137,211,240,11,140,21,42,22,241,61,99,115,199,166,114,190,204,60,233,66,115,230,125,103,203,125,13,176,94,131,39,198,167,124,67,175,254,1,15,198,62,237,159,31,218,58,244,47,61,67,94,46,78,199,79,89,41,208,135,20,154,35,21,43,230,113,191,147,208,37,28,27,86,203,25,209,148,187,139,111,48,102,76,110,106,130,37,160,34,222,90,165,245,222,102,47,19,130,4,232,137,211,240,11,140,21,42,22,241,61,99,115,199,166,114,190,204,60,233,66,115,230,125,103,203,125,13,176,94,131,39,198,167,124,67,175,254,1,15,198,62,237,159,31,218,58,244,47,61,67,94,46,78,199,79,89,41,208,135,20,154,35,21,43,230,113,191,147,208,37,28,27,86,203,25,209,148,187,139,111,48,102,76,110,106,130,37,160,34,222,90,165,245,222,102,47,19,130,4,232,137,211,240,11,140,21],B:[191,154,43,10,207,204,164,231,136,58,239,30,147,230,101,111,150,35,128,57,252,79,173,120,25,126,81,85,8,7,122,237,190,152,246,182,130,219,67,76,167,178,235,250,28,61,186,250,199,67,58,50,86,182,108,77,89,112,59,125,226,50,205,227,125,128,104,27,59,66,53,133,159,203,97,125,139,159,158,7,215,47,140,226,223,231,44,110,184,61,233,47,67,148,22,120,173,156,117,181,94,154,43,10,207,204,164,231,136,58,239,30,147,230,101,111,150,35,128,57,252,79,173,120,25,126,81,85,8,7,122,237,190,152,246,182,130,219,67,76,167,178,235,250,28,61,186,250,199,67,58,50,86,182,108,77,89,112,59,125,226,50,205,227,125,128,104,27,59,66,53,133,159,203,97,125,139,159,158,7,215,47,140,226,223,231,44,110,184,61,233,47,67,148,22,120,173,156,117,181,94,154,43,10,207,204,164,231,136,58,239,30,147,230,101,111,150,35,128,57,252,79,173,120,25,126,81,85,8,7,122,237,190,152,246,182,130,219,67,76,167,178,235,250,28,61,186,250,199,67,58,50,86,182,108,77],A:[0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},red_default={R:[0,128,255],G:[0,0,0],B:[0,0,0],A:[0,64,128],I:[0,128,255]},redyell_default={R:[192,224,255],G:[1,128,255],B:[0,0,0],A:[0,64,128],I:[0,128,255]},rocket_default={R:[3,112,144,188,236,246,255],G:[5,31,29,22,76,158,250],B:[26,87,91,86,62,117,235],A:[0,30,38,49,67,85,107],I:[0,73,92,118,160,205,255]},surface_default={R:[1,240,255],G:[1,128,255],B:[1,128,255],A:[0,76,128],I:[0,153,255]},turbo_default={R:[48,48,64,70,65,25,132,195,244,254,218,122],G:[18,18,64,107,150,226,255,241,199,158,57,4],B:[59,59,162,227,255,187,81,52,58,47,7,3],A:[0,22,26,30,34,43,52,57,63,67,77,86],I:[0,1,16,32,49,83,118,140,164,181,219,255]},violet_default={R:[0,128,255],G:[0,0,0],B:[0,128,255],A:[0,64,128],I:[0,128,255]},viridis_default={R:[68,49,53,253],G:[1,104,183,231],B:[84,142,121,37],A:[0,56,80,88],I:[0,64,192,255]},warm_default={R:[255,255,255],G:[127,196,254],B:[0,0,0],A:[0,64,128],I:[0,128,255]},winter_default={R:[0,0,0],G:[0,128,255],B:[255,196,128],A:[0,64,128],I:[0,128,255]},x_rain_default={R:[3,64,0,0,255,255,255],G:[0,0,0,255,255,192,3],B:[0,32,48,56,64,96,128],A:[0,8,16,24,32,52,80],I:[0,32,64,96,160,192,255]},afni_blues_inv_default={min:0,max:0,R:[0,37],G:[242,0],B:[255,255],A:[0,64],I:[0,255]},afni_reds_inv_default={R:[255,255],G:[255,11],B:[0,0],A:[0,64],I:[0,255]},roi_i256_default={min:0,max:0,R:[65,10,223,120,216,207,251,93,252,217,21,253,131,165,173,143,144,217,86,89,63,254,172,1,142,107,42,78,221,8,222,71,127,126,167,33,104,2,208,216,0,251,7,105,2,101,248,190,253,62,255,224,166,37,110,138,45,34,6,37,69,201,43,122,199,37,173,194,103,211,75,159,96,4,239,98,110,193,253,166,40,255,48,130,140,243,101,9,177,220,133,32,4,81,48,48,210,109,60,132,1,119,1,159,247,33,212,187,253,144,196,254,168,79,64,196,39,97,73,173,104,216,217,43,101,119,254,5,237,103,203,122,57,87,251,164,19,75,200,2,252,150,66,0,255,157,23,254,55,16,240,161,69,253,207,195,5,60,255,251,200,217,134,123,253,180,27,246,130,136,250,232,4,125,140,22,253,255,13,180,123,61,254,111,10,185,76,192,255,223,186,61,198,5,172,13,83,172,171,6,23,73,134,133,109,61,213,55,57,132,36,209,2,144,1,253,68,155,3,160,2,77,121,70,67,176,223,131,4,162,232,255,150,94,235,191,207,10,246,0,225,4,209,116,57,112,172,253,1,6,92,227,73,62,135,223],G:[162,50,112,245,4,124,176,243,56,125,183,139,182,68,189,4,225,10,20,223,7,46,31,193,225,250,219,41,2,100,83,181,34,150,72,223,168,248,80,253,7,117,214,2,248,10,3,59,179,160,90,244,146,4,207,4,125,255,96,100,1,208,130,51,116,181,236,53,244,5,165,28,181,86,96,42,254,1,134,194,214,92,41,204,137,86,207,3,143,3,100,239,164,94,65,251,131,244,173,57,143,107,217,53,210,0,148,250,45,198,81,40,61,218,252,88,171,0,248,24,248,4,41,100,187,46,208,145,43,168,121,46,175,250,125,107,233,112,207,231,174,215,53,9,43,153,52,124,128,65,210,147,255,147,63,200,148,254,0,179,241,42,239,2,230,8,82,135,87,16,3,87,86,151,254,8,255,86,53,19,7,192,171,201,253,247,197,103,251,126,0,149,54,183,61,126,79,113,10,103,184,75,11,195,222,136,149,131,8,99,240,177,252,255,198,16,7,68,178,66,191,150,73,26,211,109,78,209,240,254,1,166,247,131,2,0,167,127,133,10,43,99,235,3,214,142,176,82,132,38,10,249,255,215,44,81],B:[176,182,248,37,117,35,96,69,32,152,108,20,237,250,2,89,141,216,111,251,211,149,10,44,214,103,31,251,3,32,252,246,97,1,219,167,197,4,36,116,206,118,106,43,205,204,114,69,127,205,87,80,41,251,145,204,253,161,247,1,149,9,43,253,97,72,136,161,171,181,26,255,108,80,218,214,231,255,84,31,109,4,218,3,217,36,68,85,241,39,221,2,240,2,173,42,206,5,110,46,103,27,212,184,2,207,246,45,116,72,110,253,38,105,248,159,243,81,192,93,141,145,24,157,234,131,57,178,62,75,65,176,148,40,253,66,76,240,51,154,17,251,139,253,207,9,114,49,200,254,96,73,138,118,204,102,137,89,145,161,4,112,66,234,147,178,212,205,185,11,203,131,2,250,118,169,1,185,154,53,171,197,61,175,249,96,15,254,95,5,222,75,246,194,2,61,180,25,133,165,15,233,59,35,221,140,109,7,114,255,198,0,115,168,252,23,242,80,75,142,137,255,12,182,68,201,4,111,37,228,83,248,24,192,249,5,54,223,160,122,160,114,145,119,252,31,253,250,10,214,8,47,0,142,222,70],A:[0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64],I:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},ColorTables=class{constructor(){__publicField(this,"gamma",1),__publicField(this,"version",.1),__publicField(this,"cluts",{});const n=Object.keys(cmaps_exports).filter(s=>!s.startsWith("$")).sort(new Intl.Collator("en").compare);for(const s of n)this.cluts[s]=cmaps_exports[s]}addColormap(u,n){this.cluts[u]=n}colormaps(){return Object.keys(this.cluts)}colorMaps(){return this.colormaps()}colormapFromKey(u){let n=this.cluts[u];return n!==void 0||(n=this.cluts[u.toLowerCase()],n!==void 0)?n:(u.length>0&&log$4.warn("No color map named "+u),{min:0,max:0,R:[0,255],G:[0,255],B:[0,255],A:[0,255],I:[0,255]})}colormap(u="",n=!1){const s=this.colormapFromKey(u);return this.makeLut(s.R,s.G,s.B,s.A,s.I,n)}makeLabelLut(u,n=255){if(u.R===void 0||u.G===void 0||u.B===void 0)throw new Error(`Invalid colormap table: ${u}`);const s=u.R.length,c=u.I??[...Array(s).keys()];if(s!==u.G.length||s!==u.B.length||s!==c.length)throw new Error(`colormap does not make sense: ${u}`);let f=new Uint8ClampedArray(s).fill(n);f[0]=0,u.A!==void 0&&(f=Uint8ClampedArray.from(u.A));const g=Math.min(...c),A=Math.max(...c),v=A-g+1,y=new Uint8ClampedArray(v*4).fill(0);for(let I=0;I0)for(let A=0;A"u"){S=new Uint8ClampedArray(A).fill(0);for(let e=0;e"u"&&(I=new Uint8ClampedArray(A).fill(64),I[0]=0);for(let e=0;e0&&(c[A]=!0);const f=n.length/3;let g=0;for(let A=0;A0&&(O=1/Math.sqrt(O),s[0]*=O,s[1]*=O,s[2]*=O),N[c]=s[0],N[c+1]=s[1],N[c+2]=s[2]}return N}},utiltiesLogger=log$4,NVMeshLoaders=class Z0{static readTRACT(n){const s=n.byteLength;if(s<20)throw new Error("File too small to be niml.tract: bytes = "+s);const c=new DataView(n),f=new Uint8Array(n);let g=0;function A(){for(;g=1&&oe<=2)fe=4;else if(oe>=3&&oe<=4)fe=2;else if(oe===5)fe=1;else if(oe!==0)throw new Error("impossible Matlab v4 datatype");if(O+=Q,W>50)throw new Error("Does not appear to be little-endian V4 Matlab file");const me=O+m*fe;U[ee]=V(oe,O,me),O=me}for(;O+20>10,O=N&1023;return(N>>15?-1:1)*(M?M===31?O?NaN:1/0:Math.pow(2,M-15)*(1+O/1024):6103515625e-14*(O/1024))}let c=0,f=0,g=new Float32Array([]);const A=[],v=[],y=[],T=[];let I=[],S=!1;const k=unzipSync$1(new Uint8Array(n),{filter(N){return N.originalSize>0}}),e=Object.keys(k);for(let N=0,M=e.length;N2||g!==1e3||c!==1128354388)throw new Error("Not a valid TRK file");const A=s.getInt16(36,!0),v=[];for(let Z=0;Z0)for(let pe=0;pe0)for(let ee=0;ee=T);O++)I[S]=parseFloat(M[O]),S++}const k=[];for(A++;f[A].length<1;)A++;if(v=f[A].trim().split(/\s+/),A++,v[0].includes("LINES")){const N=parseInt(v[1]);if(N<1)throw new Error("Corrupted VTK ASCII");let M=f[A].trim();const O=[];let U=[];if(M.startsWith("OFFSETS")){A++;let B=0;for(;B=N));b++);}U=Array.from(I)}else{let B=function(){M=f[A].trim();const q=M.trim().split(/\s+/);b=[];for(let Y=0;Y=b.length&&B();const Y=b[W++];V+=Y,O[q+1]=V;for(let X=0;X=b.length&&B();const Q=b[W++]*3;U.push(I[Q+0]),U.push(I[Q+1]),U.push(I[Q+2])}}}return{pts:Float32Array.from(U),offsetPt0:Uint32Array.from(O)}}else if(v[0].includes("TRIANGLE_STRIPS")){const N=parseInt(v[1]);for(let M=0;M1&&B.pop()&&(V=V.split(".").slice(0,-1).join("."));const b=Z0.readTSF(s,U);c.dpv||(c.dpv=[]);const W=b.reduce((Y,X)=>Math.min(Y,X)),q=b.reduce((Y,X)=>Math.max(Y,X));c.dpv.push({id:V,vals:Float32Array.from(b.slice()),global_min:W,global_max:q,cal_min:W,cal_max:q});return}if(N<3)return;if(e==="MZ3")S.values=Z0.readMZ3(s,N);else if(e==="ANNOT"){const U=Z0.readANNOT(s,N,!0);U instanceof Uint32Array?S.values=U:(S.values=U.scalars,S.colormapLabel=U.colormapLabel)}else if(e==="CRV"||e==="CURV")S.values=Z0.readCURV(s,N),S.isTransparentBelowCalMin=!1;else if(e==="GII"){const U=Z0.readGII(s,N);S.values=U.scalars,S.colormapLabel=U.colormapLabel}else if(e==="MGH"||e==="MGZ"){const U=Z0.readMGH(s,N,!0);"scalars"in U?(S.values=U.scalars,S.colormapLabel=U.colormapLabel):S.values=U}else if(e==="NII")S.values=Z0.readNII(s,N,c.anatomicalStructurePrimary);else if(e==="SMP")S.values=Z0.readSMP(s,N);else if(e==="STC")S.values=Z0.readSTC(s,N);else{log$4.warn("Unknown layer overlay format "+n);return}if(!S.values)return;S.nFrame4D=S.values.length/N,S.frame4D=0,S.outlineBorder=I;let M=S.values[0],O=S.values[0];for(let U=0;U5){const S=decompressSync$1(new Uint8Array(n));f=new DataView(S.buffer),g=f.getUint16(0,!0),n=S.buffer}g>5&&log$4.error("Unsupported or invalid BrainVoyager SMP version "+g);const A=f.getUint32(2,!0);A!==s&&log$4.error("SMP file has "+A+" vertices, background mesh has "+s);const v=f.getUint16(6,!0),y=new Float32Array(A*v);let T=9;function I(){const S=T;for(;T=3&&k.mapType===3&&(k.nLags=f.getUint32(T,!0),T+=4,k.mnLag=f.getUint32(T,!0),T+=4,k.mxLag=f.getUint32(T,!0),T+=4,k.ccOverlay=f.getUint32(T,!0),T+=4),k.clusterSize=f.getUint32(T,!0),T+=4,k.clusterCheck=f.getUint8(T),T+=1,k.critThresh=f.getFloat32(T,!0),T+=4,k.maxThresh=f.getFloat32(T,!0),T+=4,g>=4&&(k.includeValuesGreaterThreshMax=f.getUint32(T,!0),T+=4),k.df1=f.getUint32(T,!0),T+=4,k.df2=f.getUint32(T,!0),T+=4,g>=5?(k.posNegFlag=f.getUint32(T,!0),T+=4):k.posNegFlag=3,k.cortexBonferroni=f.getUint32(T,!0),T+=4,k.posMinRGB=[0,0,0],k.posMaxRGB=[0,0,0],k.negMinRGB=[0,0,0],k.negMaxRGB=[0,0,0],g>=2&&(k.posMinRGB[0]=f.getUint8(T),T++,k.posMinRGB[1]=f.getUint8(T),T++,k.posMinRGB[2]=f.getUint8(T),T++,k.posMaxRGB[0]=f.getUint8(T),T++,k.posMaxRGB[1]=f.getUint8(T),T++,k.posMaxRGB[2]=f.getUint8(T),T++,g>=4&&(k.negMinRGB[0]=f.getUint8(T),T++,k.negMinRGB[1]=f.getUint8(T),T++,k.negMinRGB[2]=f.getUint8(T),T++,k.negMaxRGB[0]=f.getUint8(T),T++,k.negMaxRGB[1]=f.getUint8(T),T++,k.negMaxRGB[2]=f.getUint8(T),T++),k.enableSMPColor=f.getUint8(T),T++,g>=4&&(k.lut=I()),k.colorAlpha=f.getFloat32(T,!0),T+=4),k.name=I();const e=new Float32Array(n,T,A);y.set(e,S*A),T+=A*4}return y}static readSTC(n,s){const c=new DataView(n),f=c.getInt32(8,!1);if(f!==s)throw new Error("Overlay has "+f+" vertices, expected "+s);let g=12+f*4;const A=c.getUint32(g,!1);g+=4;const v=new Float32Array(A*f);for(let y=0;y0)return v;const S=f.getInt32(A+=4,!1),k=f.getInt32(A+=4,!1);A+=k;const e=f.getInt32(A+=4,!1);if(e<1)return v;const N={R:Array(S).fill(0),G:Array(S).fill(0),B:Array(S).fill(0),A:Array(S).fill(0),I:Array(S).fill(0),labels:Array(S).fill("")};for(let B=0;B=S){log$4.warn("annot entry out of range");continue}N.R[V]=q,N.G[V]=Y,N.B[V]=X,N.A[V]=Q,N.I[V]=(Q<<24)+(X<<16)+(Y<<8)+q,N.labels[V]=W}const M=new Float32Array(g);M.fill(-1);let O=0;for(let B=0;B0&&log$4.error(`annot vertex colors do not match ${O} of ${g} vertices.`);for(let B=0;B=v*3)break;S[T+2]=parseInt(e[0])-1,S[T+1]=parseInt(e[1])-1,S[T+0]=parseInt(e[2])-1,T+=3}return{positions:I,indices:S}}static readASC(n){const s=n.byteLength,c=new Uint8Array(n);let f=0;function g(){for(;f65535)throw new Error("Invalid VTK binary polygons using little-endian data (MRtrix)");f+=4;const B=k.getInt32(f,!1);f+=4;let V=k.getInt32(f,!1);f+=4;for(let b=0;b=0&&(k=new Float32Array(n,y,v*3)),{positions:S,indices:I,colors:k}}static readMZ3(n,s=0){if(n.byteLength<20)throw new Error("File too small to be mz3: bytes = "+n.byteLength);let c=new DataView(n),f=c.getUint16(0,!0),g=n;if(f===35615||f===8075){const q=decompressSync$1(new Uint8Array(n));c=new DataView(q.buffer),f=c.getUint16(0,!0),g=q.buffer}const A=c.getUint16(2,!0),v=c.getUint32(4,!0);let y=c.getUint32(8,!0);const T=c.getUint32(12,!0);if(utiltiesLogger.debug("MZ3 magic %d attr %d face %d vert %d skip %d",f,A,v,y,T),f!==23117)throw new Error("Invalid MZ3 file");const I=(A&1)!==0,S=(A&2)!==0,k=(A&4)!==0;let e=(A&8)!==0;const N=(A&16)!==0;if(A>63)throw new Error("Unsupported future version of MZ3 file");let M=4;N&&(M=8);let O=0;if(s>0&&!I&&v<1&&!k&&(e=!0),e){let q=s;s===0&&(q=y);const Y=16+T+(I?1:0)*v*12+(S?1:0)*q*12+(k?1:0)*q*4,X=Math.floor((g.byteLength-Y)/M);y!==s&&X%s===0&&(log$4.warn("Issue 729: mz3 mismatch scalar NVERT does not match mesh NVERT"),y=s),O=Math.floor(X/y),O<1&&(log$4.warn("Corrupt MZ3: file reports NSCALAR but not enough bytes"),e=!1)}if(y<3&&s<3)throw new Error("Not a mesh MZ3 file (maybe scalar)");s>0&&s!==y&&log$4.warn("Layer has "+y+"vertices, but background mesh has "+s);let U=16+T,B=null;I&&(B=new Uint32Array(g,U,v*3),U+=v*3*4);let V=null;S&&(V=new Float32Array(g,U,y*3),U+=y*3*4);let b=null;if(k){b=new Float32Array(y*3);const q=new Uint8Array(g,U,y*4);U+=y*4;let Y=0,X=0;for(let Q=0;Q0){if(N){const q=new Float64Array(g,U,O*y);W=Float32Array.from(q)}else W=new Float32Array(g,U,O*y);U+=M*O*y}return s>0?W:{positions:V,indices:B,scalars:W,colors:b}}static readPLY(n){const s=n.byteLength,c=new Uint8Array(n);let f=0;function g(){for(;fm.length){const Se=new Uint32Array(m.length+m.length);Se.set(m),m=Se.slice()}const me=parseInt(oe[U+1]);let pe=parseInt(oe[U+2]);for(let Se=0;Se1&&log$4.warn("This is not a valid FreeSurfer ICO/TRI mesh.");const A=parseInt(g[0]),v=new Float32Array(A*3);let y=1;for(let S=0;S=A){log$4.error("ICO vertices corrupted");break}e*=3,v[e]=N,v[e+1]=M,v[e+2]=O}g=f[y].trim().split(/\s+/),y++;const T=parseInt(g[0]),I=new Uint32Array(T*3);for(let S=0;S=T){log$4.error("ICO indices corrupted");break}e*=3,I[e]=N,I[e+1]=M,I[e+2]=O}for(let S=0;S1||I!==T*3)&&log$4.warn("Multi-part BYU/GEO header or not a triangular mesh.");const S=[];y*=3;let k=0,e=2;for(;k=y));V++);}const N=[];T*=3;let M=0;for(;M=T));V++);}if(s)for(let B=0;B1||I!==T*3)&&log$4.warn("Multi-part BYU/GEO header or not a triangular mesh.");const S=[];y*=3;let k=0,e=2;for(;k=y));V++);}const N=[];T*=3;let M=0;for(;M=T));V++);}if(s)for(let B=0;B2)&&log$4.warn("This is not a valid MNI OBJ mesh.");let S=1;I===1?S=T:I===1&&(S=A),g+=S*4,g+=T;const k=T*3,e=new Uint32Array(k);for(let N=0;N1056964608&&(V[k+0]=(Y>>16&255)/255,V[k+1]=(Y>>8&255)/255,V[k+2]=(Y&255)/255),Y===0&&(V[k+0]=e,V[k+1]=N,V[k+2]=M),Y===1&&(V[k+0]=O,V[k+1]=z,V[k+2]=B),k+=3}S+=g*4;for(let q=0;q=3e3&&k<=3099&&T>580){let O=function(){for(;Q"))return pe;for(;Q");)pe+=O();return pe},B=function(pe,Se=!1){const xe=m.indexOf(pe);if(xe<0)return 1;const we=m.indexOf('"',xe)+1,Fe=m.indexOf('"',we),De=m.slice(we,Fe);return Se?De:parseInt(De)},V=0,b=0,W=0,q="",Y=new Uint32Array;const X=new Uint8Array(n);let Q=552,m;const Z=M[5],ee=new Float32Array(s*Z);for(;Q"));)if(m.includes("")||(m=z()),!m.startsWith("")||!m.endsWith(""))return log$4.warn("Unable to find CIfTI "),ee;m=m.slice(15,-16);const we=m.trim().split(/\s+/);we.length4)&&log$4.warn("Not a valid MGH file");const N=v*y*T*I;let M=[];if(N%s!==0)return log$4.warn("Vertices in NIfTI ("+N+") is not a multiple of number of vertices ("+s+")"),M;if(S===3){M=new Float32Array(N);for(let Y=0;Y0)return log$4.warn("unsupported CTABreadFromBinaryV1"),M;if(Q=-Q,Q!==2)return log$4.warn("CTABreadFromBinary: unknown version"),M;const m=f.getInt32(k+=4,e);if(m<0)return log$4.warn("CTABreadFromBinaryV2: nentries was ",m),M;const Z=f.getInt32(k+=4,e);k+=Z;const ee=f.getInt32(k+=4,e);if(ee<0)return M;const oe={R:[],G:[],B:[],A:[],I:[],labels:[]};for(let fe=0;fe"))if(A.startsWith(""))for(;f");)A+=g();else for(;f");)A+=g();const V=v("USE");if(V.length>1){V in z?M=z[V]:log$4.warn("Unable to find DEF for "+V);return}const b=y("diffuseColor");if(b.length<3)return;M[0]=Math.round(b[0]*255),M[1]=Math.round(b[1]*255),M[2]=Math.round(b[2]*255);const W=v("DEF");W.length<1||(z[W]=M)}for(;f=0?(I.push(W[Z]+Y),I.push(W[X-1]+Y),I.push(W[X-0]+Y),X+=1):(X+=3,Z=X-2)}else for(;X=0?(I.push(W[X-2]+Y),I.push(W[X-1]+Y),I.push(W[X-0]+Y),X+=1):X+=3;T=[...T,...q];const Q=Math.floor(q.length/3),m=Array(Q).fill(M).flat();if(k.length===Q*3){let Z=0,ee=0;for(let oe=0;oe";)g++;if(ee=f[g-1]==="/",oe+1=c)break}const fe=new TextDecoder().decode(n.slice(oe+1,g)).trim(),me=fe.split(" ")[0].trim(),pe=g;let Se=g,xe=g;if(f[oe+1]!=="?"&&f[oe+1]!=="!"){const we="";Se=f.indexOf(we,pe),xe=Se+we.length-1}return{name:fe,startPos:oe,contentStartPos:pe,contentEndPos:Se,endPos:xe}}let v=A();if(!v.name.startsWith("?xml"))throw new Error("readGII: Invalid XML file");for(;!v.name.startsWith("GIFTI")&&v.endPos1;){if(v=A(),v.name.startsWith("Label Key")&&(Y=v.name,m.I.push(X("Key=")),m.R.push(Math.round(255*X("Red=",!0))),m.G.push(Math.round(255*X("Green=",!0))),m.B.push(Math.round(255*X("Blue=",!0))),m.A.push(Math.round(255*X("Alpha",!0))),Y=new TextDecoder().decode(n.slice(v.contentStartPos+1,v.contentEndPos)).trim(),m.labels.push(Q(""u"){let oe=function(fe){const me=atob(fe),pe=me.length,Se=new Uint8Array(pe);for(let xe=0;xe1&&(Z=cmapper.makeLabelLut(m)),s>0)return{scalars:I,colormapLabel:Z,anatomicalStructurePrimary:S};if(y.length>2&&!q&&(z[0]!==0||z[1]!==0||z[2]!==0)){W=Math.floor(y.length/3);let ee=0;for(let oe=0;oe1?1:g,this.visible=A,this.meshShaderIndex=0,this.indexBuffer=v.createBuffer(),this.vertexBuffer=v.createBuffer(),this.vao=v.createVertexArray(),v.bindVertexArray(this.vao),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,this.indexBuffer),v.bindBuffer(v.ARRAY_BUFFER,this.vertexBuffer),v.enableVertexAttribArray(0),v.enableVertexAttribArray(1),this.f32PerVertex!==7?(v.vertexAttribPointer(0,3,v.FLOAT,!1,20,0),v.vertexAttribPointer(1,4,v.BYTE,!0,20,12),v.enableVertexAttribArray(2),v.vertexAttribPointer(2,4,v.UNSIGNED_BYTE,!0,20,16)):(v.vertexAttribPointer(0,3,v.FLOAT,!1,28,0),v.vertexAttribPointer(1,3,v.FLOAT,!1,28,12),v.enableVertexAttribArray(2),v.vertexAttribPointer(2,4,v.UNSIGNED_BYTE,!0,28,24)),v.bindVertexArray(null),this.vaoFiber=v.createVertexArray(),this.offsetPt0=null,this.hasConnectome=!1,this.colormapInvert=!1,this.fiberGroupColormap=null,this.pts=n,this.layers=[],this.type="mesh",f[3]<1){this.rgba255=f,this.fiberLength=2,this.fiberDither=.1,this.fiberColor="Global",this.fiberDecimationStride=1,this.fiberMask=[],this.colormap=y,this.dpg=T,this.dps=I,this.dpv=S,T&&this.initValuesArray(T),I&&this.initValuesArray(I),S&&this.initValuesArray(S),this.offsetPt0=s,this.updateFibers(v),v.bindVertexArray(this.vaoFiber),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,this.indexBuffer),v.bindBuffer(v.ARRAY_BUFFER,this.vertexBuffer),v.enableVertexAttribArray(0),v.vertexAttribPointer(0,3,v.FLOAT,!1,16,0),v.enableVertexAttribArray(1),v.vertexAttribPointer(1,4,v.UNSIGNED_BYTE,!0,16,12),v.bindVertexArray(null);return}if(y){this.connectome=y,this.hasConnectome=!0;const O=Object.keys(y);for(let z=0,B=O.length;zMath.min(g,A)),f=n[s].vals.reduce((g,A)=>Math.max(g,A));n[s].global_min=c,n[s].global_max=f,n[s].cal_min=c,n[s].cal_max=f}return n}linesToCylinders(n,s,c){function f(Q){return fromValues$2(Q[0],Q[1],Q[2])}const g=Math.pow(2,32)-1,A=c.length;let v=0,y=0;for(let Q=0;Q 1 requires f32PerVertex == 5");const k=new Float32Array(I*S),e=new Uint8Array(k.buffer);let N=0,M=create$1(),O=create$1(),z=create$1();const B=create$2();let V=create$2(),b=0;const W=this.fiberRadius;for(let Q=0;Q0){const q=parseInt(N.substring(3));q0){const q=parseInt(N.substring(3));q=this.dpg.length||X.A[Q]<1||(Y[m]=!0,m*=4,q[m]=X.R[Q],q[m+1]=X.G[Q],q[m+2]=X.B[Q],q[m+3]=255)}z.fill(-1);for(let Q=0;Q2&&this.fiberRadius>0?this.linesToCylinders(n,A,b):(this.indexCount=b.length,n.bindBuffer(n.ARRAY_BUFFER,this.vertexBuffer),n.bufferData(n.ARRAY_BUFFER,Uint32Array.from(v),n.STATIC_DRAW),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.indexBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,Uint32Array.from(b),n.STATIC_DRAW))}indexNearestXYZmm(n,s,c){const f=this.pts,g=this.pts.length/3;let A=0,v=1/0,y=0;for(let T=0;T0)for(let T=0;TI.cal_max)continue;if(I.outlineBorder===void 0&&(I.outlineBorder=0),I.isAdditiveBlend===void 0&&(I.isAdditiveBlend=!1),I.colormapLabel&&I.colormapLabel.R&&!I.colormapLabel.lut&&(I.colormapLabel=cmapper.makeLabelLut(I.colormapLabel)),I.colormapLabel&&I.colormapLabel.lut){const V=I.colormapLabel.lut,b=Math.floor(V.length/4),W=Math.min(Math.max(I.frame4D,0),I.nFrame4D-1),q=g*W,Y=new Uint8Array(g*4);let X=0;for(let m=0;m0&&(Q=NVMeshUtilities.getClusterBoundary(Y,this.tris)),X=0;for(let m=0;m0&&(V=NVMeshUtilities.getClusterBoundary(B,this.tris));let b=0;for(let W=0;W0)for(let T=0;T"u"){const O=new Float32Array([0,0,0,0,0,0]),z=new Uint32Array([0]);I={pts:O,offsetPt0:z},log$4.error("Creating empty tracts")}return g[3]=0,new Ii(I.pts,I.offsetPt0,s,g,f,A,c,"inferno",I.dpg||null,I.dps||null,I.dpv||null)}if(k==="GII")I=NVMeshLoaders.readGII(n);else if(k==="MZ3")I=NVMeshLoaders.readMZ3(n),(I instanceof Float32Array||I.positions===null)&&log$4.warn("MZ3 does not have positions (statistical overlay?)");else if(k==="ASC")I=NVMeshLoaders.readASC(n);else if(k==="DFS")I=NVMeshLoaders.readDFS(n);else if(k==="BYU"||k==="G")I=NVMeshLoaders.readGEO(n);else if(k==="GEO")I=NVMeshLoaders.readGEO(n,!0);else if(k==="ICO"||k==="TRI")I=NVMeshLoaders.readICO(n);else if(k==="OFF")I=NVMeshLoaders.readOFF(n);else if(k==="NV")I=NVMeshLoaders.readNV(n);else if(k==="OBJ")I=NVMeshLoaders.readOBJ(n);else if(k==="PLY")I=NVMeshLoaders.readPLY(n);else if(k==="X3D")I=NVMeshLoaders.readX3D(n);else if(k==="FIB"||k==="VTK"){if(I=NVMeshLoaders.readVTK(n),"offsetPt0"in I)return g[3]=0,new Ii(I.pts,I.offsetPt0,s,g,f,A,c,"inferno")}else k==="SRF"?I=NVMeshLoaders.readSRF(n):k==="STL"?I=NVMeshLoaders.readSTL(n):I=NVMeshLoaders.readFreeSurfer(n);if(I.anatomicalStructurePrimary&&(T=I.anatomicalStructurePrimary),I instanceof Float32Array)throw new Error("fatal: unknown mesh type loaded");if(!I.positions)throw new Error("positions not loaded");if(!I.indices)throw new Error("indices not loaded");if(y=I.positions,v=I.indices,"rgba255"in I&&I.rgba255.length>0&&(g=I.rgba255),"colors"in I&&I.colors&&I.colors.length===y.length){const O=y.length/3;g=new Uint8Array(O*4);let z=0,B=0;for(let V=0;V0&&(NVMeshLoaders.readLayer(s,n,M,f,"gray"),M.updateMesh(c)),M}static async loadLayer(n,s){let c;function f(e){const N=window.atob(e),M=N.length,O=new Uint8Array(M);for(let z=0;z-1&&(g=g.slice(0,g.indexOf("?")));let v=.5;"opacity"in n&&(v=n.opacity);let y="warm";"colormap"in n&&(y=n.colormap);let T="winter";"colormapNegative"in n&&(T=n.colormapNegative);let I=!1;"useNegativeCmap"in n&&(I=n.useNegativeCmap);let S=null;"cal_min"in n&&(S=n.cal_min);let k=null;"cal_max"in n&&(k=n.cal_max),NVMeshLoaders.readLayer(g,c,s,v,y,T,I,S,k)}static async loadFromUrl({url:n="",headers:s={},gl:c,name:f="",opacity:g=1,rgba255:A=[255,255,255,255],visible:v=!0,layers:y=[]}={}){let T=n.split("/");if(f===""){try{T=new URL(n).pathname.split("/")}catch{T=n.split("/")}f=T.slice(-1)[0],f.indexOf("?")>-1&&(f=f.slice(0,f.indexOf("?")))}if(n==="")throw Error("url must not be empty");if(!c)throw Error("gl context is null");const I=await fetch(n,{headers:s});if(!I.ok)throw Error(I.statusText);const S=await I.arrayBuffer(),k=await this.readMesh(S,f,c,g,new Uint8Array(A),v);if(!y||y.length<1)return k;for(let e=0;e{const f=new FileReader;f.onload=()=>{s(f.result)},f.onerror=c,f.readAsArrayBuffer(n)})}static async loadFromFile({file:n,gl:s,name:c="",opacity:f=1,rgba255:g=[255,255,255,255],visible:A=!0,layers:v=[]}={}){if(!n)throw new Error("file must be set");if(!s)throw new Error("rendering context must be set");const y=await Ii.readFileAsync(n),T=Ii.readMesh(y,c,s,f,new Uint8Array(g),A);if(!v||v.length<1)return T;for(let I=0;I>18,y=(S&258048)>>12,T=(S&4032)>>6,I=S&63,s+=c[v]+c[y]+c[T]+c[I];return g===1?(S=n[A],v=(S&252)>>2,y=(S&3)<<4,s+=c[v]+c[y]+"=="):g===2&&(S=n[A]<<8|n[A+1],v=(S&64512)>>10,y=(S&1008)>>4,T=(S&15)<<2,s+=c[v]+c[y]+c[T]+"="),s}static download(n,s,c){const f=document.createElement("a"),g=new Blob([n],{type:c});f.href=URL.createObjectURL(g),f.download=s,f.click()}static readFileAsync(n){return new Promise((s,c)=>{const f=new FileReader;f.onload=()=>{s(f.result)},f.onerror=c,f.readAsArrayBuffer(n)})}static blobToBase64(n){return new Promise(s=>{const c=new FileReader;c.onloadend=()=>s(c.result),c.readAsDataURL(n)})}static decompressBase64String(n){const s=atob(n),c=new ArrayBuffer(s.length),f=new Uint8Array(c);for(let v=0;vn+g*c)}static sph2cartDeg(n,s){const c=-s*(Math.PI/180),f=(n-90)%360*(Math.PI/180),g=[Math.cos(c)*Math.cos(f),Math.cos(c)*Math.sin(f),Math.sin(c)],A=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]);return A<=0||(g[0]/=A,g[1]/=A,g[2]/=A),g}static vox2mm(n,s){const c=clone$3(s);transpose$3(c,c);const f=fromValues$1(n[0],n[1],n[2],1);return transformMat4(f,f,c),fromValues$2(f[0],f[1],f[2])}},isPlatformLittleEndian=()=>{const u=new ArrayBuffer(2);return new DataView(u).setInt16(0,256,!0),new Int16Array(u)[0]===256},ImageType=(u=>(u[u.UNKNOWN=0]="UNKNOWN",u[u.NII=1]="NII",u[u.DCM=2]="DCM",u[u.DCM_MANIFEST=3]="DCM_MANIFEST",u[u.MIH=4]="MIH",u[u.MIF=5]="MIF",u[u.NHDR=6]="NHDR",u[u.NRRD=7]="NRRD",u[u.MHD=8]="MHD",u[u.MHA=9]="MHA",u[u.MGH=10]="MGH",u[u.MGZ=11]="MGZ",u[u.V=12]="V",u[u.V16=13]="V16",u[u.VMR=14]="VMR",u[u.HEAD=15]="HEAD",u[u.DCM_FOLDER=16]="DCM_FOLDER",u))(ImageType||{}),NVIMAGE_TYPE=Object.freeze({...ImageType,parse:u=>{let n=0;switch(u.toUpperCase()){case"":case"DCM":n=2;break;case"TXT":n=3;break;case"NII":n=1;break;case"MIH":n=4;break;case"MIF":n=5;break;case"NHDR":n=6;break;case"NRRD":n=7;break;case"MHD":n=8;break;case"MHA":n=9;break;case"MGH":n=10;break;case"MGZ":n=11;break;case"V":n=12;break;case"V16":n=13;break;case"VMR":n=14;break;case"HEAD":n=15;break}return n}}),NVImageFromUrlOptions=(u,n="",s="",c="gray",f=1,g=NaN,A=NaN,v=!0,y=.02,T=!1,I=!1,S="",k=0,e=NVIMAGE_TYPE.UNKNOWN,N=NaN,M=NaN,O=!0,z=!1,B=[])=>({url:u,urlImageData:n,name:s,colormap:c,colorMap:c,opacity:f,cal_min:g,cal_max:A,trustCalMinMax:v,percentileFrac:y,ignoreZeroVoxels:T,useQFormNotSForm:I,colormapNegative:S,imageType:e,cal_minNeg:N,cal_maxNeg:M,colorbarVisible:O,frame4D:k,alphaThreshold:z,colormapLabel:B});function getBestTransform(u,n,s){const c=u;let f=null;if(c){const g={colSize:n[0],rowSize:n[1],sliceSize:n[2]},A=s,v=[c[0],c[1],c[2]],y=[c[3],c[4],c[5]],T=[v[1]*y[2]-v[2]*y[1],v[2]*y[0]-v[0]*y[2],v[0]*y[1]-v[1]*y[0]];f=[[v[0]*g.colSize*-1,y[0]*g.rowSize*-1,T[0]*g.sliceSize*-1,-1*A[0]],[v[1]*g.colSize*-1,y[1]*g.rowSize*-1,T[1]*g.sliceSize*-1,-1*A[1]],[v[2]*g.colSize,y[2]*g.rowSize,T[2]*g.sliceSize,A[2]],[0,0,0,1]]}return f}function str2Buffer(u){const n=[];for(let s=0;s=v)break;let k=!0;for(let e=0;e<3;++e)f[e]>c[e]&&(k=!1),g[e]{}),__publicField(this,"onOpacityChange",()=>{}),__publicField(this,"mm000"),__publicField(this,"mm100"),__publicField(this,"mm010"),__publicField(this,"mm001"),__publicField(this,"cal_min"),__publicField(this,"cal_max"),__publicField(this,"robust_min"),__publicField(this,"robust_max"),__publicField(this,"global_min"),__publicField(this,"global_max"),__publicField(this,"urlImgData"),__publicField(this,"isManifest"),__publicField(this,"limitFrames4D"),this.name=s,this.id=v4(),this._colormap=c,this._opacity=f>1?1:f,this.percentileFrac=T,this.ignoreZeroVoxels=I,this.trustCalMinMax=y,this.colormapNegative=k,this.colormapLabel=B,this.frame4D=e,this.cal_minNeg=M,this.cal_maxNeg=O,this.colorbarVisible=z,this.useQFormNotSForm=S,!n)return;const V=/(?:\.([^.]+))?$/;let b=V.exec(s)[1]||"";b=b.toUpperCase(),b==="GZ"&&(b=V.exec(s.slice(0,-3))[1],b=b.toUpperCase());let W=null;switch(N===NVIMAGE_TYPE.UNKNOWN&&(N=NVIMAGE_TYPE.parse(b)),this.imageType=N,N){case NVIMAGE_TYPE.DCM_FOLDER:case NVIMAGE_TYPE.DCM_MANIFEST:case NVIMAGE_TYPE.DCM:W=this.readDICOM(n);break;case NVIMAGE_TYPE.MIH:case NVIMAGE_TYPE.MIF:W=this.readMIF(n,g);break;case NVIMAGE_TYPE.NHDR:case NVIMAGE_TYPE.NRRD:W=this.readNRRD(n,g);break;case NVIMAGE_TYPE.MHD:case NVIMAGE_TYPE.MHA:W=this.readMHA(n,g);break;case NVIMAGE_TYPE.MGH:case NVIMAGE_TYPE.MGZ:W=this.readMGH(n);break;case NVIMAGE_TYPE.V:W=this.readECAT(n);break;case NVIMAGE_TYPE.V16:W=this.readV16(n);break;case NVIMAGE_TYPE.VMR:W=this.readVMR(n);break;case NVIMAGE_TYPE.HEAD:W=this.readHEAD(n,g);break;case NVIMAGE_TYPE.NII:this.hdr=nifti.readHeader(n),this.hdr!==null&&(this.hdr.cal_min===0&&this.hdr.cal_max===255&&(this.hdr.cal_max=0),nifti.isCompressed(n)?W=nifti.readImage(this.hdr,nifti.decompress(n)):W=nifti.readImage(this.hdr,n));break;default:throw new Error("Image type not supported")}if(this.hdr&&typeof this.hdr.magic=="number"&&(this.hdr.magic="n+1"),this.nFrame4D=1,this.hdr)for(let Q=4;Q<7;Q++)this.hdr.dims[Q]>1&&(this.nFrame4D*=this.hdr.dims[Q]);if(this.frame4D=Math.min(this.frame4D,this.nFrame4D-1),this.nTotalFrame4D=this.nFrame4D,!this.hdr||!W)return;this.nVox3D=this.hdr.dims[1]*this.hdr.dims[2]*this.hdr.dims[3];const q=this.nVox3D*(this.hdr.numBitsPerVoxel/8),Y=W.byteLength/q;if(Y!==this.nFrame4D&&(Y>0&&Y*q===W.byteLength?log$4.debug("Loading the first "+Y+" of "+this.nFrame4D+" volumes"):log$4.warn("This header does not match voxel data",this.hdr,W.byteLength),this.nFrame4D=Y),(this.hdr.intent_code===1007||this.hdr.intent_code===2003)&&this.nFrame4D===3&&this.hdr.datatypeCode===16){const m=new Float32Array(W).slice();this.hdr.datatypeCode=2304,this.nFrame4D=1;for(let me=4;me<7;me++)this.hdr.dims[me]=1;this.hdr.dims[0]=3,W=new Uint8Array(this.nVox3D*4);let Z=1;for(let me=0;me0)*1,Fe=+(Se>0)*2,De=+(xe>0)*4;let Ze=248+we+Fe+De;Math.abs(pe)+Math.abs(Se)+Math.abs(xe)<.1&&(Ze=0),W[fe+3]=Ze,fe+=4}}(this.hdr.pixDims[1]===0||this.hdr.pixDims[2]===0||this.hdr.pixDims[3]===0)&&log$4.error("pixDims not plausible",this.hdr),(isNaN(this.hdr.scl_slope)||this.hdr.scl_slope===0)&&(this.hdr.scl_slope=1),isNaN(this.hdr.scl_inter)&&(this.hdr.scl_inter=0);let X=isAffineOK(this.hdr.affine);if(S||!X||this.hdr.qform_code>this.hdr.sform_code){log$4.debug("spatial transform based on QForm");const Q=this.hdr.quatern_b,m=this.hdr.quatern_c,Z=this.hdr.quatern_d,ee=Math.sqrt(1-(Math.pow(Q,2)+Math.pow(m,2)+Math.pow(Z,2))),oe=this.hdr.pixDims[0]===0?1:this.hdr.pixDims[0],fe=[[ee*ee+Q*Q-m*m-Z*Z,2*Q*m-2*ee*Z,2*Q*Z+2*ee*m],[2*Q*m+2*ee*Z,ee*ee+m*m-Q*Q-Z*Z,2*m*Z-2*ee*Q],[2*Q*Z-2*ee*m,2*m*Z+2*ee*Q,ee*ee+Z*Z-m*m-Q*Q]],me=this.hdr.affine;for(let pe=0;pe<3;pe+=1)for(let Se=0;Se<3;Se+=1)me[pe][Se]=fe[pe][Se]*this.hdr.pixDims[Se+1],Se===2&&(me[pe][Se]*=oe);me[0][3]=this.hdr.qoffset_x,me[1][3]=this.hdr.qoffset_y,me[2][3]=this.hdr.qoffset_z,this.hdr.affine=me}if(X=isAffineOK(this.hdr.affine),!X){log$4.debug("Defective NIfTI: spatial transform does not make sense");let Q=this.hdr.pixDims[1],m=this.hdr.pixDims[2],Z=this.hdr.pixDims[3];(isNaN(Q)||Q===0)&&(Q=1),(isNaN(m)||m===0)&&(m=1),(isNaN(Z)||Z===0)&&(Z=1),this.hdr.pixDims[1]=Q,this.hdr.pixDims[2]=m,this.hdr.pixDims[3]=Z;const ee=[[Q,0,0,0],[0,m,0,0],[0,0,Z,0],[0,0,0,1]];this.hdr.affine=ee}if(this.hdr.datatypeCode!==128&&this.hdr.datatypeCode!==2304&&this.hdr.littleEndian!==isPlatformLittleEndian()&&this.hdr.numBitsPerVoxel>8){if(this.hdr.numBitsPerVoxel===16){const Q=new Uint16Array(W);for(let m=0;m>8&255)<<16>>16}}else if(this.hdr.numBitsPerVoxel===32){const Q=new Uint32Array(W);for(let m=0;m>8&65280|Z>>24&255}}else if(this.hdr.numBitsPerVoxel===64){const Q=this.hdr.numBitsPerVoxel/8,m=new Uint8Array(W);for(let Z=0;Z.01?log$4.warn("Warning voxels not aligned with world space: "+I+` degrees from plumb. -`):I=0,I}calculateOblique(){if(!this.matRAS)throw new Error("matRAS not defined");if(this.pixDimsRAS===void 0)throw new Error("pixDimsRAS not defined");if(!this.dimsRAS)throw new Error("dimsRAS not defined");this.oblique_angle=this.computeObliqueAngle(this.matRAS);const n=this.vox2mm([0,0,0],this.matRAS),s=this.vox2mm([1/this.pixDimsRAS[1],0,0],this.matRAS),c=this.vox2mm([0,1/this.pixDimsRAS[2],0],this.matRAS),f=this.vox2mm([0,0,1/this.pixDimsRAS[3]],this.matRAS);subtract$1(s,s,n),subtract$1(c,c,n),subtract$1(f,f,n);const g=fromValues$3(s[0],s[1],s[2],0,c[0],c[1],c[2],0,f[0],f[1],f[2],0,0,0,0,1);this.obliqueRAS=clone$3(g);const A=Math.abs(90-angle(s,c)*(180/Math.PI)),v=Math.abs(90-angle(s,f)*(180/Math.PI)),y=Math.abs(90-angle(c,f)*(180/Math.PI));this.maxShearDeg=Math.max(Math.max(A,v),y),this.maxShearDeg>.1&&log$4.warn("Warning: voxels are rhomboidal, maximum shear is %f degrees.",this.maxShearDeg);const T=fromValues$1(this.dimsRAS[1],this.dimsRAS[2],this.dimsRAS[3],1),I=clone$3(this.matRAS);transpose$3(I,I);const S=fromValues$1(-.5,-.5,-.5,0);translate(I,I,fromValues$2(S[0],S[1],S[2])),I[0]*=T[0],I[1]*=T[0],I[2]*=T[0],I[4]*=T[1],I[5]*=T[1],I[6]*=T[1],I[8]*=T[2],I[9]*=T[2],I[10]*=T[2],this.frac2mm=clone$3(I);const k=this.pixDimsRAS[1],e=this.pixDimsRAS[2],N=this.pixDimsRAS[3],M=clone$3(I);M[0]=k*T[0],M[1]=0,M[2]=0,M[4]=0,M[5]=e*T[1],M[6]=0,M[8]=0,M[9]=0,M[10]=N*T[2];const O=this.mm2vox([0,0,0],!0);M[12]=(-O[0]-.5)*k,M[13]=(-O[1]-.5)*e,M[14]=(-O[2]-.5)*N,this.frac2mmOrtho=clone$3(M),this.extentsMinOrtho=[M[12],M[13],M[14]],this.extentsMaxOrtho=[M[0]+M[12],M[5]+M[13],M[10]+M[14]],this.mm2ortho=create$3(),invert(this.mm2ortho,g)}THD_daxes_to_NIFTI(n,s,c){const f=this.hdr;if(f===null)throw new Error("HDR is not set");f.sform_code=2;const g="xxyyzzg";let A=-1,v=-1,y=-1;const T=["x","y","z"];T[0]=g[c[0]],T[1]=g[c[1]],T[2]=g[c[2]];const I=n.slice(0,3),S=s.slice(0,3);for(let k=0;k<3;k++)T[k]==="x"?A=k:T[k]==="y"?v=k:y=k;A<0||v<0||y<0||A===v||A===y||v===y||(f.pixDims[1]=Math.abs(I[0]),f.pixDims[2]=Math.abs(I[1]),f.pixDims[3]=Math.abs(I[2]),f.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],f.affine[0][A]=-I[A],f.affine[1][v]=-I[v],f.affine[2][y]=I[y],f.affine[0][3]=-S[A],f.affine[1][3]=-S[v],f.affine[2][3]=S[y])}SetPixDimFromSForm(){if(!this.hdr)throw new Error("hdr not defined");const n=this.hdr.affine,s=fromValues$3(n[0][0],n[0][1],n[0][2],n[0][3],n[1][0],n[1][1],n[1][2],n[1][3],n[2][0],n[2][1],n[2][2],n[2][3],n[3][0],n[3][1],n[3][2],n[3][3]),c=this.vox2mm([0,0,0],s),f=this.vox2mm([1,0,0],s);subtract$1(f,f,c);const g=this.vox2mm([0,1,0],s);subtract$1(g,g,c);const A=this.vox2mm([0,0,1],s);subtract$1(A,A,c),this.hdr.pixDims[1]=length$1(f),this.hdr.pixDims[2]=length$1(g),this.hdr.pixDims[3]=length$1(A)}readDICOM(n){if(this.series=new daikon.Series,Array.isArray(n))for(let S=0;S1&&(s.dims[3]>1&&log$4.debug("To Do: multiple slices per file and multiple files (XA30 DWI)"),s.dims[3]=this.series.images.length);const c=this.series.images[0].getPixelSpacing();if(s.pixDims[1]=c[0],s.pixDims[2]=c[1],this.series.images.length>1){const S=fromValues$2(...this.series.images[0].getImagePosition()),k=fromValues$2(...this.series.images[1].getImagePosition()),e=fromValues$2(0,0,0);subtract$1(e,S,k),s.pixDims[3]=length$1(e)}else s.pixDims[3]=this.series.images[0].getSliceThickness();s.pixDims[4]=this.series.images[0].getTR()/1e3;const f=this.series.images[0].getDataType(),g=this.series.images[0].getBitsAllocated();s.numBitsPerVoxel=g,this.hdr.littleEndian=this.series.images[0].littleEndian,g===8&&f===2?s.datatypeCode=256:g===8&&f===3?s.datatypeCode=2:g===16&&f===2?s.datatypeCode=4:g===16&&f===3?s.datatypeCode=512:g===32&&f===2?s.datatypeCode=8:g===32&&f===3?s.datatypeCode=768:g===32&&f===4?s.datatypeCode=16:g===64&&f===4?s.datatypeCode=64:g===1?s.datatypeCode=1:log$4.warn("Unsupported DICOM format: "+f+" "+g);const A=s.pixDims.slice(1,4),v=getBestTransform(this.series.images[0].getImageDirections(),A,this.series.images[0].getImagePosition());v&&(s.sform_code=1,s.affine=[[v[0][0],v[0][1],v[0][2],v[0][3]],[v[1][0],v[1][1],v[1][2],v[1][3]],[v[2][0],v[2][1],v[2][2],v[2][3]],[0,0,0,1]]);let y,T=this.series.validatePixelDataLength(this.series.images[0]);const I=new Uint8Array(new ArrayBuffer(T*this.series.images.length));for(let S=0;S14)throw new Error("Not a valid ECAT file");let A=512,v=0;const y=[];let T=new Float32Array;for(;;){const I=c.getInt32(A,!1),S=c.getInt32(A+12,!1);if(I+S!==31)break;let k=A+20,e=0,N=0;for(;e<31&&(N=c.getInt32(k,!1),k+=16,N!==0);){e++;let M=N*512;const O=M-512,z=c.getUint16(O,!1);s.dims[1]=c.getUint16(O+4,!1),s.dims[2]=c.getUint16(O+6,!1),s.dims[3]=c.getUint16(O+8,!1);const B=c.getFloat32(O+26,!1);s.pixDims[1]=c.getFloat32(O+34,!1)*10,s.pixDims[2]=c.getFloat32(O+38,!1)*10,s.pixDims[3]=c.getFloat32(O+42,!1)*10,s.pixDims[4]=c.getUint32(O+46,!1)/1e3,y.push(s.pixDims[4]);const V=s.dims[1]*s.dims[2]*s.dims[3],b=new Float32Array(V);if(z===1)for(let q=0;q1){s.dims[0]=4;let I=!1;for(let S=0;S=4){let A=8+g;const v=c.getUint32(A+88,!0);if(A=A+92,v>0){const y=n.byteLength;for(let T=0;T4)&&log$4.warn("Not a valid MGH file"),I===0?(s.numBitsPerVoxel=8,s.datatypeCode=2):I===4?(s.numBitsPerVoxel=16,s.datatypeCode=4):I===1?(s.numBitsPerVoxel=32,s.datatypeCode=8):I===3&&(s.numBitsPerVoxel=32,s.datatypeCode=16),s.dims[1]=A,s.dims[2]=v,s.dims[3]=y,s.dims[4]=T,T>1&&(s.dims[0]=4),s.pixDims[1]=S,s.pixDims[2]=k,s.pixDims[3]=e,s.vox_offset=284,s.sform_code=1;const m=fromValues$3(N*s.pixDims[1],z*s.pixDims[2],b*s.pixDims[3],0,M*s.pixDims[1],B*s.pixDims[2],W*s.pixDims[3],0,O*s.pixDims[1],V*s.pixDims[2],q*s.pixDims[3],0,0,0,0,1),Z=[s.dims[1]/2,s.dims[2]/2,s.dims[3]/2,1],ee=[0,0,0,0];for(let fe=0;fe<3;fe++){ee[fe]=0;for(let me=0;me<3;me++)ee[fe]=ee[fe]+m[me+fe*4]*Z[me]}s.affine=[[m[0],m[1],m[2],Y-ee[0]],[m[4],m[5],m[6],X-ee[1]],[m[8],m[9],m[10],Q-ee[2]],[0,0,0,1]];const oe=s.dims[1]*s.dims[2]*s.dims[3]*s.dims[4]*(s.numBitsPerVoxel/8);return c.slice(s.vox_offset,s.vox_offset+oe)}readHEAD(n,s){this.hdr=new nifti.NIFTI1;const c=this.hdr;c.dims[0]=3,c.pixDims=[1,1,1,1,1,0,0,0];let f=[0,0,0],g=[0,0,0],A=[1,1,1];const y=new TextDecoder().decode(n).split(/\r?\n/),T=(n.byteLength+8)%16,I=n.byteLength+(16-T);log$4.debug(n.byteLength,"len",I);const S=new Uint8Array(I);S.fill(0),S.set(new Uint8Array(n));const k=new nifti.NIFTIEXTENSION(I+8,42,S,!0);c.addExtension(k),c.extensionCode=42,c.extensionFlag[0]=1,c.extensionSize=I+8;const e=y.length;let N=0,M=!1;for(;N2&&(M=M.slice(2)),y.startsWith("BinaryDataByteOrderMSB")&&M[0].includes("False")&&(T.littleEndian=!0),y.startsWith("BinaryDataByteOrderMSB")&&M[0].includes("True")&&(T.littleEndian=!1),y.startsWith("CompressedData")&&M[0].includes("True")&&(I=!0),y.startsWith("TransformMatrix"))for(let O=0;O<9;O++)k[O]=parseFloat(M[O]);if(y.startsWith("Offset"))for(let O=0;O2||Z.length!==4)break;c.affine[I][0]=parseFloat(Z[0]),c.affine[I][1]=parseFloat(Z[1]),c.affine[I][2]=parseFloat(Z[2]),c.affine[I][3]=parseFloat(Z[3]),I++;break;case"RepetitionTime":S=parseFloat(Z[0]);break;case"file":k=!Z[0].startsWith(". "),k||(Z=Z[0].split(" "),c.vox_offset=parseInt(Z[1]));break}}const e=c.dims[0];e>5&&log$4.warn("reader only designed for a maximum of 5 dimensions (XYZTD)");let N=1;for(let Z=0;Z0&&(c.pixDims[4]=S),k&&!s&&log$4.warn("MIH header provided without paired image data");let M;s&&k?M=s.slice(0):M=n.slice(c.vox_offset,c.vox_offset+N*(c.numBitsPerVoxel/8)),T.length!==c.dims[0]&&log$4.warn("dims does not match layout");let O=1;const z=[1,1,1,1,1],B=[!1,!1,!1,!1,!1];for(let Z=0;Zc[0]&&(f[0]=2),c[6]>c[0]&&c[6]>c[3]&&(f[0]=3),f[1]=1,f[0]===1?c[4]>c[7]?f[1]=2:f[1]=3:f[0]===2?c[1]>c[7]?f[1]=1:f[1]=3:c[1]>c[4]?f[1]=1:f[1]=2,f[2]=6-f[1]-f[0];let g=[1,2,3];g[f[0]-1]=1,g[f[1]-1]=2,g[f[2]-1]=3;let A=fromValues$3(n[0][0],n[0][1],n[0][2],n[0][3],n[1][0],n[1][1],n[1][2],n[1][3],n[2][0],n[2][1],n[2][2],n[2][3],0,0,0,1);this.mm000=this.vox2mm([-.5,-.5,-.5],A),this.mm100=this.vox2mm([s.dims[1]-.5,-.5,-.5],A),this.mm010=this.vox2mm([-.5,s.dims[2]-.5,-.5],A),this.mm001=this.vox2mm([-.5,-.5,s.dims[3]-.5],A);const v=create$3();copy$1(v,A);for(let O=0;O<3;O++)for(let z=0;z<3;z++)v[O*4+z]=A[O*4+g[z]-1];const y=[0,0,0];v[0]<0&&(y[0]=1),v[5]<0&&(y[1]=1),v[10]<0&&(y[2]=1),this.dimsRAS=[s.dims[0],s.dims[g[0]],s.dims[g[1]],s.dims[g[2]]],this.pixDimsRAS=[s.pixDims[0],s.pixDims[g[0]],s.pixDims[g[1]],s.pixDims[g[2]]],this.permRAS=g.slice();for(let O=0;O<3;O++)y[O]===1&&(this.permRAS[O]=-this.permRAS[O]);if(this.arrayEquals(g,[1,2,3])&&this.arrayEquals(y,[0,0,0])){this.toRAS=create$3(),this.matRAS=clone$3(A),this.calculateOblique(),this.img2RASstep=[1,this.dimsRAS[1],this.dimsRAS[1]*this.dimsRAS[2]],this.img2RASstart=[0,0,0];return}identity$2(A),A[0+0*4]=1-y[0]*2,A[1+1*4]=1-y[1]*2,A[2+2*4]=1-y[2]*2,A[3+0*4]=(s.dims[g[0]]-1)*y[0],A[3+1*4]=(s.dims[g[1]]-1)*y[1],A[3+2*4]=(s.dims[g[2]]-1)*y[2];const T=create$3();invert(T,A),multiply$2(T,T,v),this.matRAS=clone$3(T),A=fromValues$3(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1),A[g[0]-1+0*4]=-y[0]*2+1,A[g[1]-1+1*4]=-y[1]*2+1,A[g[2]-1+2*4]=-y[2]*2+1,A[3+0*4]=y[0],A[3+1*4]=y[1],A[3+2*4]=y[2],this.toRAS=clone$3(A),A[3]=0,A[7]=0,A[11]=0,A[12]=0,(this.permRAS[0]===-1||this.permRAS[1]===-1||this.permRAS[2]===-1)&&(A[12]=s.dims[1]-1),A[13]=0,(this.permRAS[0]===-2||this.permRAS[1]===-2||this.permRAS[2]===-2)&&(A[13]=s.dims[2]-1),A[14]=0,(this.permRAS[0]===-3||this.permRAS[1]===-3||this.permRAS[2]===-3)&&(A[14]=s.dims[3]-1),this.toRASvox=clone$3(A),log$4.debug(this.hdr.dims),log$4.debug(this.dimsRAS);const I=this.hdr;g=this.permRAS;const S=[Math.abs(g[0]),Math.abs(g[1]),Math.abs(g[2])],k=[I.dims[S[0]],I.dims[S[1]],I.dims[S[2]]],e=[1,I.dims[1],I.dims[1]*I.dims[2]],N=[e[S[0]-1],e[S[1]-1],e[S[2]-1]],M=[0,0,0];for(let O=0;O<3;O++)g[O]<0&&(M[O]=N[O]*(k[O]-1),N[O]=-N[O]);this.img2RASstep=N,this.img2RASstart=M,this.calculateOblique()}img2RAS(){if(!this.permRAS)throw new Error("permRAS undefined");if(!this.img)throw new Error("img undefined");if(!this.hdr)throw new Error("hdr undefined");const n=this.permRAS.slice();if(n[0]===1&&n[1]===2&&n[2]===3)return this.img;const s=this.hdr,c=this.img.slice(0,s.dims[1]*s.dims[1]*s.dims[2]*s.dims[3]),f=[Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])],g=[s.dims[f[0]],s.dims[f[1]],s.dims[f[2]]],A=[1,s.dims[1],s.dims[1]*s.dims[2]],v=[A[f[0]-1],A[f[1]-1],A[f[2]-1]],y=[0,0,0];for(let I=0;I<3;I++)n[I]<0&&(y[I]=v[I]*(g[I]-1),v[I]=-v[I]);let T=0;for(let I=0;Ic===s[f])}setColormap(n){this._colormap=n,this.calMinMax(),this.onColormapChange&&this.onColormapChange(this)}setColormapLabel(n){this.colormapLabel=cmapper.makeLabelLut(n)}async setColormapLabelFromUrl(n){this.colormapLabel=await cmapper.makeLabelLutFromUrl(n)}get colormap(){return this._colormap}get colorMap(){return this._colormap}set colormap(n){this.setColormap(n)}set colorMap(n){this.setColormap(n)}get opacity(){return this._opacity}set opacity(n){this._opacity=n,this.onOpacityChange&&this.onOpacityChange(this)}calMinMax(){if(!this.hdr)throw new Error("hdr undefined");if(!this.img)throw new Error("img undefined");let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,c=0,f=0;const g=this.img.length,A=this.img.constructor!==Float64Array&&this.img.constructor!==Float32Array&&this.ignoreZeroVoxels;if(A)for(let Y=0;Ythis.hdr.cal_min)return this.cal_min=this.hdr.cal_min,this.cal_max=this.hdr.cal_max,this.robust_min=this.cal_min,this.robust_max=this.cal_max,this.global_min=v,this.global_max=y,[this.hdr.cal_min,this.hdr.cal_max,this.hdr.cal_min,this.hdr.cal_max];if(I!==S)return this.cal_min=I,this.cal_max=S,this.robust_min=this.cal_min,this.robust_max=this.cal_max,[I,S,I,S];const k=100*c/g;let e=!1;k>60&&!this.ignoreZeroVoxels&&(log$4.warn(`${Math.round(k)}% of voxels are zero: ignoring zeros for cal_max`),e=!0,this.ignoreZeroVoxels=!0),this.ignoreZeroVoxels||(c=0),c+=f;const N=Math.round((g-c)*this.percentileFrac);if(N<1||n===s)return log$4.debug("no variability in image intensity?"),this.cal_min=v,this.cal_max=y,this.robust_min=this.cal_min,this.robust_max=this.cal_max,this.global_min=v,this.global_max=y,[v,y,v,y];const M=1001,O=(M-1)/(s-n),z=new Array(M);for(let Y=0;Y0&&(V--,z[V]>0&&(Y=0)),Y!==0&&b0&&(Y=0)),V===0&&b===M-1&&(Y=0)}let W=this.intensityRaw2Scaled(V/O+n),q=this.intensityRaw2Scaled(b/O+n);return this.hdr.cal_min=v&&this.hdr.cal_max<=y&&(W=this.hdr.cal_min,q=this.hdr.cal_max),e&&(W=Math.min(W,0)),this.cal_min=W,this.cal_max=q,this.robust_min=this.cal_min,this.robust_max=this.cal_max,this.global_min=v,this.global_max=y,[W,q,v,y]}intensityRaw2Scaled(n){if(!this.hdr)throw new Error("hdr undefined");return this.hdr.scl_slope===0&&(this.hdr.scl_slope=1),n*this.hdr.scl_slope+this.hdr.scl_inter}intensityScaled2Raw(n){if(!this.hdr)throw new Error("hdr undefined");return this.hdr.scl_slope===0&&(this.hdr.scl_slope=1),(n-this.hdr.scl_inter)/this.hdr.scl_slope}saveToUint8Array(n,s=null){if(!this.hdr)throw new Error("hdr undefined");if(!this.img)throw new Error("img undefined");const c=s!==null,f=hdrToArrayBuffer(this.hdr,c),g=new Uint8Array(4);let A=new Uint8Array(this.img.buffer);c&&(A=new Uint8Array(s.buffer));const v=new Uint8Array(f.length+g.length+A.length);v.set(f),v.set(g,f.length),v.set(A,f.length+g.length);let y=null;return n.endsWith(".gz")?y=gzipSync$1(v,{filename:n,mtime:Date.now(),level:6}):y=v,y}saveToDisk(n="",s=null){const c=this.saveToUint8Array(n,s);if(n==="")return log$4.debug("saveToDisk: empty file name, returning data as Uint8Array rather than triggering download"),c;const f=new Blob([c.buffer],{type:"application/octet-stream"}),g=URL.createObjectURL(f),A=document.createElement("a");return A.setAttribute("href",g),A.setAttribute("download",n),A.style.visibility="hidden",document.body.appendChild(A),A.click(),document.body.removeChild(A),c}static async fetchDicomData(n,s={}){if(n==="")throw Error("url must not be empty");let f=/^(?:[a-z+]+:)?\/\//i.test(n)?n:new URL(n,window.location.href);/(?:.([^.]+))?$/.exec(f.pathname)||(f=new URL("niivue-manifest.txt",n));let v=await fetch(f,{headers:s});if(!v.ok)throw Error(v.statusText);const T=(await v.text()).split(` -`),S=/(.*\/).*/.exec(f)[0],k=[];for(const e of T){const N=new URL(e,S);if(v=await fetch(N,{headers:s}),!v.ok)throw Error(v.statusText);const M=await v.arrayBuffer();k.push(M)}return k}static async fetchPartial(n,s,c={}){try{return await fetch(n,{headers:{range:`bytes=0-'${s}`,stream:"true",...c}})}catch(f){return log$4.error(f),log$4.error("fetchPartial failed, trying again without range header"),await fetch(n,{headers:c})}}static async loadFromUrl({url:n="",urlImgData:s="",headers:c={},name:f="",colormap:g="gray",opacity:A=1,cal_min:v=NaN,cal_max:y=NaN,trustCalMinMax:T=!0,percentileFrac:I=.02,ignoreZeroVoxels:S=!1,useQFormNotSForm:k=!1,colormapNegative:e="",frame4D:N=0,isManifest:M=!1,limitFrames4D:O=NaN,imageType:z=NVIMAGE_TYPE.UNKNOWN,colorbarVisible:B=!0}={}){if(n==="")throw Error("url must not be empty");let V=null,b=null;if(n instanceof Uint8Array&&(n=n.buffer),n instanceof ArrayBuffer){b=n,n="array.nii";const Q=new Uint8Array(b);Q[0]===31&&Q[1]===139&&(n="array.nii.gz")}if(!isNaN(O)){let Q=await this.fetchPartial(n,512,c);b=await Q.arrayBuffer();let m=new Uint8Array(b),Z=!1;m[0]===31&&m[1]===139&&(Z=!0,new Decompress$1(fe=>{m=fe}).push(m),b=m.buffer);let ee=m[0]===92&&m[1]===1;if(ee||(ee=m[1]===92&&m[0]===1),!ee)b=null;else{const oe=nifti.readHeader(b);if(oe===null)throw new Error("could not read nifti header");const fe=oe.numBitsPerVoxel/8;let me=1;for(let we=1;we<4;we++)oe.dims[we]>1&&(me*=oe.dims[we]);let pe=1;for(let we=4;we<7;we++)oe.dims[we]>1&&(pe*=oe.dims[we]);const Se=Math.max(Math.min(O,pe),1),xe=oe.vox_offset+Se*me*fe;if(b.byteLength{we=De}).push(we),b=we.buffer}b.byteLength-1&&(f=f.slice(0,f.indexOf("?")))}let X=null;if(s.length>0){let Q=await fetch(s,{headers:c});Q.status===404&&s.lastIndexOf("BRIK")!==-1&&(Q=await fetch(s+".gz",{headers:c})),X=await Q.arrayBuffer()}if(!b)throw new Error("Unable to load buffer properly from volume");return V=new Zi(b,f,g,A,X,v,y,T,I,S,k,e,N,z),V.url=n,V.colorbarVisible=B,V}static readFileAsync(n,s=NaN){return new Promise((c,f)=>{const g=new FileReader;g.onload=()=>{n.name.lastIndexOf("gz")!==-1&&isNaN(s)?c(nifti.decompress(g.result)):c(g.result)},g.onerror=f,isNaN(s)?g.readAsArrayBuffer(n):g.readAsArrayBuffer(n.slice(0,s))})}static async loadFromFile({file:n,name:s="",colormap:c="gray",opacity:f=1,urlImgData:g=null,cal_min:A=NaN,cal_max:v=NaN,trustCalMinMax:y=!0,percentileFrac:T=.02,ignoreZeroVoxels:I=!1,useQFormNotSForm:S=!1,colormapNegative:k="",frame4D:e=0,limitFrames4D:N=NaN,imageType:M=NVIMAGE_TYPE.UNKNOWN}){let O=null,z=[];try{if(Array.isArray(n))for(let V=0;V{V=Y}).push(V),z=V.buffer);let W=V[0]===92&&V[1]===1;if(W||(W=V[1]===92&&V[0]===1),!W)z=await this.readFileAsync(n);else{const q=nifti.readHeader(z);if(!q)throw new Error("could not read nifti header");const Y=q.numBitsPerVoxel/8;let X=1;for(let ee=1;ee<4;ee++)q.dims[ee]>1&&(X*=q.dims[ee]);let Q=1;for(let ee=4;ee<7;ee++)q.dims[ee]>1&&(Q*=q.dims[ee]);const m=Math.max(Math.min(N,Q),1),Z=q.vox_offset+m*X*Y;if(z.byteLength{ee=fe}).push(ee),z=ee.buffer}if(z.byteLength"u")return g;if(!s){const v=clone$3(this.frac2mmOrtho);return invert(v,v),transformMat4(c,c,v),g[0]=c[0],g[1]=c[1],g[2]=c[2],g}if(f[1]<1||f[2]<1||f[3]<1)return g;const A=clone$3(this.matRAS);return invert(A,A),transpose$3(A,A),transformMat4(c,c,A),g[0]=(c[0]+.5)/f[1],g[1]=(c[1]+.5)/f[2],g[2]=(c[2]+.5)/f[3],g}},DRAG_MODE=(u=>(u[u.none=0]="none",u[u.contrast=1]="contrast",u[u.measurement=2]="measurement",u[u.pan=3]="pan",u[u.slicer3D=4]="slicer3D",u[u.callbackOnly=5]="callbackOnly",u))(DRAG_MODE||{}),DEFAULT_OPTIONS={textHeight:.06,colorbarHeight:.05,crosshairWidth:1,crosshairGap:0,rulerWidth:4,show3Dcrosshair:!1,backColor:[0,0,0,1],crosshairColor:[1,0,0,1],fontColor:[.5,.5,.5,1],selectionBoxColor:[1,1,1,.5],clipPlaneColor:[.7,0,.7,.5],rulerColor:[1,0,0,.8],colorbarMargin:.05,trustCalMinMax:!0,clipPlaneHotKey:"KeyC",viewModeHotKey:"KeyV",doubleTouchTimeout:500,longTouchTimeout:1e3,keyDebounceTime:50,isNearestInterpolation:!1,isResizeCanvas:!0,atlasOutline:0,isRuler:!1,isColorbar:!1,isOrientCube:!1,multiplanarPadPixels:0,multiplanarForceRender:!1,isRadiologicalConvention:!1,meshThicknessOn2D:1/0,dragMode:1,yoke3Dto2DZoom:!1,isDepthPickMesh:!1,isCornerOrientationText:!1,sagittalNoseLeft:!1,isSliceMM:!1,isV1SliceShader:!1,isHighResolutionCapable:!0,logLevel:"info",loadingText:"waiting for images...",isForceMouseClickToVoxelCenters:!1,dragAndDropEnabled:!0,drawingEnabled:!1,penValue:1,floodFillNeighbors:6,isFilledPen:!1,thumbnail:"",maxDrawUndoBitmaps:8,sliceType:3,meshXRay:0,isAntiAlias:null,limitFrames4D:NaN,isAdditiveBlend:!1,showLegend:!0,legendBackgroundColor:[.3,.3,.3,.5],legendTextColor:[1,1,1,1],multiplanarLayout:0,renderOverlayBlend:1},NVDocument=class Ji{constructor(){__publicField(this,"data",{title:"Untitled document",imageOptionsArray:[],meshOptionsArray:[],opts:{...DEFAULT_OPTIONS},previewImageDataURL:"",labels:[],encodedImageBlobs:[],encodedDrawingBlob:""}),__publicField(this,"scene"),__publicField(this,"volumes",[]),__publicField(this,"meshDataObjects"),__publicField(this,"meshes",[]),__publicField(this,"drawBitmap",null),__publicField(this,"imageOptionsMap",new Map),__publicField(this,"meshOptionsMap",new Map),this.scene={onAzimuthElevationChange:()=>{},onZoom3DChange:()=>{},sceneData:{azimuth:110,elevation:10,crosshairPos:[.5,.5,.5],clipPlane:[0,0,0,0],clipPlaneDepthAziElev:[2,0,0],volScaleMultiplier:1,pan2Dxyzmm:[0,0,0,1]},get renderAzimuth(){return this.sceneData.azimuth},set renderAzimuth(n){this.sceneData.azimuth=n,this.onAzimuthElevationChange&&this.onAzimuthElevationChange(this.sceneData.azimuth,this.sceneData.elevation)},get renderElevation(){return this.sceneData.elevation},set renderElevation(n){this.sceneData.elevation=n,this.onAzimuthElevationChange&&this.onAzimuthElevationChange(this.sceneData.azimuth,this.sceneData.elevation)},get volScaleMultiplier(){return this.sceneData.volScaleMultiplier},set volScaleMultiplier(n){this.sceneData.volScaleMultiplier=n,this.onZoom3DChange(n)},get crosshairPos(){return this.sceneData.crosshairPos},set crosshairPos(n){this.sceneData.crosshairPos=n},get clipPlane(){return this.sceneData.clipPlane},set clipPlane(n){this.sceneData.clipPlane=n},get clipPlaneDepthAziElev(){return this.sceneData.clipPlaneDepthAziElev},set clipPlaneDepthAziElev(n){this.sceneData.clipPlaneDepthAziElev=n},get pan2Dxyzmm(){return this.sceneData.pan2Dxyzmm},set pan2Dxyzmm(n){this.sceneData.pan2Dxyzmm=n}}}get title(){return this.data.title}get previewImageDataURL(){return this.data.previewImageDataURL}set previewImageDataURL(n){this.data.previewImageDataURL=n}set title(n){this.data.title=n}get imageOptionsArray(){return this.data.imageOptionsArray}get encodedImageBlobs(){return this.data.encodedImageBlobs}get encodedDrawingBlob(){return this.data.encodedDrawingBlob}get opts(){return this.data.opts}set opts(n){this.data.opts={...n}}get labels(){return this.data.labels}set labels(n){this.data.labels=n}hasImage(n){return this.volumes.find(s=>s.id===n.id)!==void 0}hasImageFromUrl(n){return this.data.imageOptionsArray.find(s=>s.url===n)!==void 0}addImageOptions(n,s){if(!this.hasImage(n)&&!s.name)if(s.url){const f=/^(?:[a-z+]+:)?\/\//i.test(s.url)?new URL(s.url):new URL(s.url,window.location.href);s.name=f.pathname.split("/").pop(),s.name.toLowerCase().endsWith(".gz")&&(s.name=s.name.slice(0,-3)),s.name.toLowerCase().endsWith(".nii")||(s.name+=".nii")}else s.name="untitled.nii";s.imageType=NVIMAGE_TYPE.NII,this.data.imageOptionsArray.push(s),this.imageOptionsMap.set(n.id,this.data.imageOptionsArray.length-1)}removeImage(n){if(this.imageOptionsMap.has(n.id)){const s=this.imageOptionsMap.get(n.id);this.data.imageOptionsArray.length>s&&this.data.imageOptionsArray.splice(s,1),this.imageOptionsMap.delete(n.id)}this.volumes=this.volumes.filter(s=>s.id!==n.id)}getImageOptions(n){return this.imageOptionsMap.has(n.id)?this.data.imageOptionsArray[this.imageOptionsMap.get(n.id)]:null}json(){const n={encodedImageBlobs:[],previewImageDataURL:this.data.previewImageDataURL,imageOptionsMap:new Map},s=[];if(n.sceneData={...this.scene.sceneData},n.opts={...this.opts},this.opts.meshThicknessOn2D===1/0&&(n.opts.meshThicknessOn2D="infinity"),n.labels=[...this.data.labels],this.volumes.length){let f=this.imageOptionsArray[0];if(f||(log$4.debug("no image options for base image"),f={name:"",colormap:"gray",opacity:1,pairedImgData:null,cal_min:NaN,cal_max:NaN,trustCalMinMax:!0,percentileFrac:.02,ignoreZeroVoxels:!1,useQFormNotSForm:!1,colormapNegative:"",colormapLabel:[],imageType:NVIMAGE_TYPE.NII,frame4D:0,limitFrames4D:NaN,url:"",urlImageData:"",alphaThreshold:!1,cal_minNeg:NaN,cal_maxNeg:NaN,colorbarVisible:!0}),f.colormap=this.volumes[0].colormap,f.opacity=this.volumes[0].opacity,f.cal_max=this.volumes[0].cal_max||NaN,f.cal_min=this.volumes[0].cal_min||NaN,f){s.push(f);const g=NVUtilities.uint8tob64(this.volumes[0].toUint8Array());n.encodedImageBlobs.push(g),this.drawBitmap&&(n.encodedDrawingBlob=NVUtilities.uint8tob64(this.volumes[0].toUint8Array(this.drawBitmap))),n.imageOptionsMap.set(this.volumes[0].id,0)}else throw new Error("image options for base layer not found");for(let g=1;g({values:A.values,nFrame4D:A.nFrame4D,frame4D:0,outlineBorder:A.outlineBorder,global_min:A.global_min,global_max:A.global_max,cal_min:A.cal_min,cal_max:A.cal_max,opacity:A.opacity,colormap:A.colormap,colormapNegative:A.colormapNegative,colormapLabel:A.colormapLabel,useNegativeCmap:A.useNegativeCmap})),hasConnectome:f.hasConnectome,edgeColormap:f.edgeColormap,edgeColormapNegative:f.edgeColormapNegative,edgeMax:f.edgeMax,edgeMin:f.edgeMin,edges:f.edges&&Array.isArray(f.edges)?[...f.edges]:[],extentsMax:f.extentsMax,extentsMin:f.extentsMin,fiberGroupColormap:f.fiberGroupColormap,furthestVertexFromOrigin:f.furthestVertexFromOrigin,nodeColormap:f.nodeColormap,nodeColormapNegative:f.nodeColormapNegative,nodeMaxColor:f.nodeMaxColor,nodeMinColor:f.nodeMinColor,nodeScale:f.nodeScale,legendLineThickness:f.legendLineThickness,offsetPt0:f.offsetPt0,nodes:f.nodes};c.push(g)}return n.meshesString=JSON.stringify(serialize(c)),n}download(n){const s=this.json();NVUtilities.download(JSON.stringify(s),n,"application/json")}static deserializeMeshDataObjects(n){if(n.data.meshesString){n.meshDataObjects=deserialize$1(JSON.parse(n.data.meshesString));for(const s of n.meshDataObjects)for(const c of s.layers)"colorMap"in c&&(c.colormap=c.colorMap,delete c.colorMap),"colorMapNegative"in c&&(c.colormapNegative=c.colorMapNegative,delete c.colorMapNegative)}}static async loadFromUrl(n){const c=await(await fetch(n)).json();return Ji.loadFromJSON(c)}static async loadFromFile(n){const s=await NVUtilities.readFileAsync(n),c=new Ji,g=new TextDecoder().decode(s);return c.data=JSON.parse(g),Ji.deserializeMeshDataObjects(c),c}static loadFromJSON(n){const s=new Ji;return s.data=n,s.data.opts.meshThicknessOn2D==="infinity"&&(s.data.opts.meshThicknessOn2D=1/0),s.scene.sceneData=n.sceneData,Ji.deserializeMeshDataObjects(s),s}},NVLabel3D=class{constructor(u,n,s){__publicField(this,"text"),__publicField(this,"style"),__publicField(this,"points"),this.text=u,this.style=n,this.points=s}},defaultOptions={name:"untitled connectome",nodeColormap:"warm",nodeColormapNegative:"winter",nodeMinColor:0,nodeMaxColor:4,nodeScale:3,edgeColormap:"warm",edgeColormapNegative:"winter",edgeMin:2,edgeMax:6,edgeScale:1,legendLineThickness:0},NVConnectome=class Uo extends NVMesh{constructor(n,s){super(new Float32Array([]),new Uint32Array([]),s.name,new Uint8Array([]),1,!0,n,s),__publicField(this,"gl"),__publicField(this,"nodesChanged"),this.gl=n,this.type="connectome",this.nodes&&this.updateLabels(),this.nodesChanged=new EventTarget}static convertLegacyConnectome(n){const s={nodes:[],edges:[],...defaultOptions};for(const f in n)if(f in defaultOptions){const g=f;s[g]=n[g]}const c=n.nodes;for(let f=0;f({name:Array.isArray(A.comments)&&A.comments.length>0&&"text"in A.comments[0]?A.comments[0].text:"",x:A.coordinates.x,y:A.coordinates.y,z:A.coordinates.z,colorValue:1,sizeValue:1,metadata:A.comments}));return{...defaultOptions,nodeColormap:s,edgeColormap:s,nodes:f,edges:[]}}updateLabels(){const n=this.nodes;if(n&&n.length>0){const s=n.reduce((T,I)=>T.sizeValue>I.sizeValue?T:I).sizeValue,c=this.nodeMinColor?this.nodeMinColor:n.reduce((T,I)=>T.colorValueT.colorValue>I.colorValue?T:I).colorValue,g=cmapper.colormap(this.nodeColormap,this.colormapInvert),A=cmapper.colormap(this.nodeColormapNegative,this.colormapInvert),v="nodeColormapNegative"in this,y=this.legendLineThickness?this.legendLineThickness:0;for(let T=0;Te/255),log$4.debug("adding label for ",n[T]),n[T].label=new NVLabel3D(n[T].name,{textColor:k,bulletScale:n[T].sizeValue/s,bulletColor:k,lineWidth:y,lineColor:k,textScale:1,textAlignment:"left",lineTerminator:"none"},[n[T].x,n[T].y,n[T].z]),log$4.debug("label for node:",n[T].label)}}}addConnectomeNode(n){if(log$4.debug("adding node",n),!this.nodes)throw new Error("nodes not defined");this.nodes.push(n),this.updateLabels(),this.nodesChanged.dispatchEvent(new CustomEvent("nodeAdded",{detail:{node:n}}))}deleteConnectomeNode(n){const s=this.nodes.indexOf(n),c=this.edges;c&&(this.edges=c.filter(f=>f.first!==s&&f.second!==s)),this.nodes=this.nodes.filter(f=>f!==n),this.updateLabels(),this.updateConnectome(this.gl),this.nodesChanged.dispatchEvent(new CustomEvent("nodeDeleted",{detail:{node:n}}))}updateConnectomeNodeByIndex(n,s){this.nodes[n]=s,this.updateLabels(),this.updateConnectome(this.gl),this.nodesChanged.dispatchEvent(new CustomEvent("nodeChanged",{detail:{node:s}}))}updateConnectomeNodeByPoint(n,s){const c=this.nodes;if(!c)throw new Error("Node to update does not exist");const f=c.find(A=>NVUtilities.arraysAreEqual([A.x,A.y,A.z],n));if(!f)throw new Error(`Node with point ${n} to update does not exist`);const g=c.findIndex(A=>A===f);this.updateConnectomeNodeByIndex(g,s)}addConnectomeEdge(n,s,c){const f=this.edges;let g=f.find(A=>(A.first===n||A.second===n)&&A.first+A.second===n+s);return g||(g={first:n,second:s,colorValue:c},f.push(g),this.updateConnectome(this.gl),g)}deleteConnectomeEdge(n,s){const c=this.edges,f=c.find(g=>(g.first===n||g.first===s)&&g.first+g.second===n+s);if(f)this.edges=c.filter(g=>g!==f);else throw new Error(`edge between ${n} and ${s} not found`);return this.updateConnectome(this.gl),f}findClosestConnectomeNode(n,s){const c=this.nodes;if(!c||c.length===0)return null;const f=c.map((g,A)=>({node:g,distance:Math.sqrt(Math.pow(g.x-n[0],2)+Math.pow(g.y-n[1],2)+Math.pow(g.z-n[2],2)),index:A})).filter(g=>g.distanceg.distance-A.distance);return f.length>0?f[0].node:null}updateConnectome(n){const s=[],c=[],f=[];let g=cmapper.colormap(this.nodeColormap,this.colormapInvert),A=cmapper.colormap(this.nodeColormapNegative,this.colormapInvert),v="nodeColormapNegative"in this;if(this.nodeMinColor===void 0||this.nodeMaxColor===void 0)throw new Error("nodeMinColor or nodeMaxColor is undefined");if(this.edgeMin===void 0||this.edgeMax===void 0)throw new Error("edgeMin or edgeMax undefined");let y=this.nodeMinColor,T=this.nodeMaxColor;const I=this.nodes,S=I.length;for(let z=0;zg&&([f,g]=[g,f]),[f,g]}function swizzleVec3(u,n=[0,1,2]){const s=create$2();return s[0]=u[n[0]],s[1]=u[n[1]],s[2]=u[n[2]],s}function isRadiological(u){const n=fromValues$1(1,0,0,0),s=create$1();return transformMat4(s,n,u),s[0]}function unProject(u,n,s,c){const f=fromValues$1(u,n,s,1),g=clone$3(c);invert(g,g),f[0]=f[0]*2-1,f[1]=f[1]*2-1,f[2]=f[2]*2-1;const A=create$1();return transformMat4(A,f,g),A[3]===0||(A[0]/=A[3],A[1]/=A[3],A[2]/=A[3]),A}function unpackFloatFromVec4i(u){const n=[5960464477539063e-23,152587890625e-16,.00390625,1];return(u[0]*n[0]+u[1]*n[1]+u[2]*n[2]+u[3]*n[3])/255}function clamp$1(u,n,s){return Math.min(Math.max(u,n),s)}function encodeRLE(u){const n=u.length;let s=0;const c=new Uint8Array(n+Math.ceil(.01*n)),f=new Int8Array(c.buffer);let g=0;for(;s1){f[g]=-v+1,g++,c[g]=A,g++;continue}for(;s127||s+2 "+g+" bytes (x"+n/g+")"),c.slice(0,g)}function decodeRLE(u,n){const s=new Uint8Array(u.buffer),c=new Int8Array(s.buffer);let f=0;const g=new Uint8Array(n);let A=0;for(;f{}),__publicField(this,"onMouseUp",()=>{}),__publicField(this,"onLocationChange",()=>{}),__publicField(this,"onIntensityChange",()=>{}),__publicField(this,"onImageLoaded",()=>{}),__publicField(this,"onMeshLoaded",()=>{}),__publicField(this,"onFrameChange",()=>{}),__publicField(this,"onError",()=>{}),__publicField(this,"onColormapChange",()=>{}),__publicField(this,"onInfo",()=>{}),__publicField(this,"onWarn",()=>{}),__publicField(this,"onDebug",()=>{}),__publicField(this,"onVolumeAddedFromUrl",()=>{}),__publicField(this,"onVolumeWithUrlRemoved",()=>{}),__publicField(this,"onVolumeUpdated",()=>{}),__publicField(this,"onMeshAddedFromUrl",()=>{}),__publicField(this,"onMeshAdded",()=>{}),__publicField(this,"onMeshWithUrlRemoved",()=>{}),__publicField(this,"onZoom3DChange",()=>{}),__publicField(this,"onAzimuthElevationChange",()=>{}),__publicField(this,"onClipPlaneChange",()=>{}),__publicField(this,"onCustomMeshShaderAdded",()=>{}),__publicField(this,"onMeshShaderChanged",()=>{}),__publicField(this,"onMeshPropertyChanged",()=>{}),__publicField(this,"onDocumentLoaded",()=>{}),__publicField(this,"document",new NVDocument),__publicField(this,"opts",{...DEFAULT_OPTIONS}),__publicField(this,"scene",{...this.document.scene}),__publicField(this,"mediaUrlMap",new Map),__publicField(this,"initialized",!1),__publicField(this,"currentDrawUndoBitmap"),__publicField(this,"loadingText");for(const s in n)typeof n[s]=="function"?this[s]=n[s]:this.opts[s]=DEFAULT_OPTIONS[s]===void 0?DEFAULT_OPTIONS[s]:n[s];this.opts.isHighResolutionCapable?this.uiData.dpr=window.devicePixelRatio||1:this.uiData.dpr=1,this.currentDrawUndoBitmap=this.opts.maxDrawUndoBitmaps,this.opts.drawingEnabled&&this.createEmptyDrawing(),this.opts.thumbnail.length>0&&(this.thumbnailVisible=!0),this.loadingText=this.opts.loadingText,log$4.setLogLevel(this.opts.logLevel)}get volumes(){return this.document.volumes}set volumes(n){this.document.volumes=n}get meshes(){return this.document.meshes}set meshes(n){this.document.meshes=n}get drawBitmap(){return this.document.drawBitmap}set drawBitmap(n){this.document.drawBitmap=n}get volScaleMultiplier(){return this.scene.volScaleMultiplier}set volScaleMultiplier(n){this.setScale(n)}async saveScene(n="niivue.png"){function s(f,g){const A=document.createElement("a");document.body.appendChild(A),A.style.display="none";const v=window.URL.createObjectURL(f);A.href=v,A.download=g,A.click(),A.remove()}const c=this.canvas;if(!c)throw new Error("canvas not defined");this.drawScene(),c.toBlob(f=>{f&&(n===""&&(n=`niivue-screenshot-${new Date().toString()}.png`,n=n.replace(/\s/g,"_")),s(f,n))})}async attachTo(n,s=null){return await this.attachToCanvas(document.getElementById(n),s),log$4.debug("attached to element with id: ",n),this}async attachToCanvas(n,s=null){return this.canvas=n,s===null&&(s=navigator.hardwareConcurrency>6,log$4.debug("AntiAlias ",s," Threads ",navigator.hardwareConcurrency)),this.gl=this.canvas.getContext("webgl2",{alpha:!0,antialias:s}),log$4.info("NIIVUE VERSION ",version$1),this.canvas.parentElement.style.backgroundColor="black",this.opts.isResizeCanvas&&(this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,window.addEventListener("resize",this.resizeListener.bind(this)),this.resizeObserver=new ResizeObserver(this.resizeListener.bind(this)),this.resizeObserver.observe(this.canvas.parentElement)),this.registerInteractions(),await this.init(),this.drawScene(),this}syncWith(n,s={"2d":!0,"3d":!0}){this.otherNV=n,this.syncOpts=s}broadcastTo(n,s={"2d":!0,"3d":!0}){this.otherNV=n,this.syncOpts=s}sync(){if(!this.gl||!this.otherNV||typeof this.otherNV>"u"||!this.gl.canvas.matches(":focus"))return;const n=this.frac2mm(this.scene.crosshairPos);if(this.otherNV instanceof zo)this.syncOpts["2d"]&&(this.otherNV.scene.crosshairPos=this.otherNV.mm2frac(n)),this.syncOpts["3d"]&&(this.otherNV.scene.renderAzimuth=this.scene.renderAzimuth,this.otherNV.scene.renderElevation=this.scene.renderElevation),this.otherNV.drawScene(),this.otherNV.createOnLocationChange();else if(Array.isArray(this.otherNV))for(let s=0;sc===s[f])}resizeListener(){if(!(!this.canvas||!this.gl)){if(!this.opts.isResizeCanvas){this.opts.isHighResolutionCapable&&(log$4.warn("isHighResolutionCapable requires isResizeCanvas"),this.opts.isHighResolutionCapable=!1),this.uiData.dpr=1,this.drawScene();return}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.opts.isHighResolutionCapable?(this.uiData.dpr=window.devicePixelRatio||1,log$4.debug("devicePixelRatio: "+this.uiData.dpr)):this.uiData.dpr=1,"width"in this.canvas.parentElement?(this.canvas.width=this.canvas.parentElement.width*this.uiData.dpr,this.canvas.height=this.canvas.parentElement.height*this.uiData.dpr):(this.canvas.width=this.canvas.offsetWidth*this.uiData.dpr,this.canvas.height=this.canvas.offsetHeight*this.uiData.dpr),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.drawScene()}}getRelativeMousePosition(n,s){if(s=s||n.target,!s)return;const c=s.getBoundingClientRect();return{x:n.clientX-c.left,y:n.clientY-c.top}}getNoPaddingNoBorderCanvasRelativeMousePosition(n,s){return s=s||n.target,this.getRelativeMousePosition(n,s)}mouseContextMenuListener(n){n.preventDefault()}mouseDownListener(n){n.preventDefault(),this.drawPenLocation=[NaN,NaN,NaN],this.drawPenAxCorSag=-1,this.uiData.mousedown=!0,log$4.debug("mouse down"),log$4.debug(n);const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);if(!s)return;const[c,f]=[s.x*this.uiData.dpr,s.y*this.uiData.dpr],g=this.getLabelAtPoint([c,f]);if(g){for(const A of this.meshes)if(A.type==="connectome")for(const v of A.nodes)v.label===g&&(this.scene.crosshairPos=this.mm2frac([v.x,v.y,v.z]),this.updateGLVolume(),this.drawScene())}this.uiData.clickedTile=this.tileIndex(c,f),n.button===LEFT_MOUSE_BUTTON&&n.shiftKey?(this.uiData.mouseButtonCenterDown=!0,this.mouseCenterButtonHandler(n)):n.button===LEFT_MOUSE_BUTTON?(this.uiData.mouseButtonLeftDown=!0,this.mouseLeftButtonHandler(n)):n.button===RIGHT_MOUSE_BUTTON?(this.uiData.mouseButtonRightDown=!0,this.mouseRightButtonHandler(n)):n.button===CENTER_MOUSE_BUTTON&&(this.uiData.mouseButtonCenterDown=!0,this.mouseCenterButtonHandler(n))}mouseLeftButtonHandler(n){const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);this.mouseDown(s.x,s.y),this.mouseClick(s.x,s.y)}mouseCenterButtonHandler(n){const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);this.mousePos=[s.x*this.uiData.dpr,s.y*this.uiData.dpr],this.opts.dragMode!==0&&(this.setDragStart(s.x,s.y),this.uiData.isDragging||(this.uiData.pan2DxyzmmAtMouseDown=clone$1(this.scene.pan2Dxyzmm)),this.uiData.isDragging=!0,this.uiData.dragClipPlaneStartDepthAziElev=this.scene.clipPlaneDepthAziElev)}mouseRightButtonHandler(n){const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);this.mousePos=[s.x*this.uiData.dpr,s.y*this.uiData.dpr],this.opts.dragMode!==0&&(this.setDragStart(s.x,s.y),this.uiData.isDragging||(this.uiData.pan2DxyzmmAtMouseDown=clone$1(this.scene.pan2Dxyzmm)),this.uiData.isDragging=!0,this.uiData.dragClipPlaneStartDepthAziElev=this.scene.clipPlaneDepthAziElev)}calculateMinMaxVoxIdx(n){if(n.length>2)throw new Error("array must not contain more than two values");return[Math.floor(Math.min(n[0],n[1])),Math.floor(Math.max(n[0],n[1]))]}calculateNewRange({volIdx:n=0}={}){if(this.opts.sliceType===4&&this.sliceMosaicString.length<1||this.uiData.dragStart[0]===this.uiData.dragEnd[0]&&this.uiData.dragStart[1]===this.uiData.dragEnd[1])return;let s=this.canvasPos2frac([this.uiData.dragStart[0],this.uiData.dragStart[1]]);if(s[0]<0)return;const c=this.frac2vox(s,n);if(s=this.canvasPos2frac([this.uiData.dragEnd[0],this.uiData.dragEnd[1]]),s[0]<0)return;const f=this.frac2vox(s,n);let g=-Number.MAX_VALUE,A=Number.MAX_VALUE;const v=this.calculateMinMaxVoxIdx([c[0],f[0]]),y=this.calculateMinMaxVoxIdx([c[1],f[1]]),T=this.calculateMinMaxVoxIdx([c[2],f[2]]);c[0]-f[0]===0?v[1]=c[0]+1:c[1]-f[1]===0?y[1]=c[1]+1:c[2]-f[2]===0&&(T[1]=c[2]+1);const I=this.volumes[n].hdr,S=this.volumes[n].img;if(!I||!S)return;const k=I.dims[1],e=I.dims[2];for(let O=T[0];OS[W]&&(A=S[W]),g=g)return;const N=intensityRaw2Scaled(I,A),M=intensityRaw2Scaled(I,g);this.volumes[n].cal_min=N,this.volumes[n].cal_max=M,this.onIntensityChange(this.volumes[n])}generateMouseUpCallback(n,s){const c=this.tileIndex(this.uiData.dragStart[0],this.uiData.dragStart[1]),f=this.tileIndex(this.uiData.dragEnd[0],this.uiData.dragEnd[1]);let g=-1;c===f&&(g=f);let A=-1;g>=0&&(A=this.screenSlices[g].axCorSag);const v=this.frac2mm(n),y=this.frac2mm(s),T=create$2();sub$4(T,fromValues$2(v[0],v[1],v[2]),fromValues$2(y[0],y[1],y[2]));const I=len(T),S=this.frac2vox(n),k=this.frac2vox(s);this.onDragRelease({fracStart:n,fracEnd:s,voxStart:S,voxEnd:k,mmStart:v,mmEnd:y,mmLength:I,tileIdx:g,axCorSag:A})}mouseUpListener(){function n(f){return Object.prototype.toString.call(f).indexOf("Function")>-1}const s={mouseButtonRightDown:this.uiData.mouseButtonRightDown,mouseButtonCenterDown:this.uiData.mouseButtonCenterDown,isDragging:this.uiData.isDragging,mousePos:this.mousePos,fracPos:this.canvasPos2frac(this.mousePos)};this.uiData.mousedown=!1,this.uiData.mouseButtonRightDown=!1;const c=this.uiData.mouseButtonCenterDown;if(this.uiData.mouseButtonCenterDown=!1,this.uiData.mouseButtonLeftDown=!1,this.drawPenFillPts.length>0?this.drawPenFilled():this.drawPenAxCorSag>=0&&this.drawAddUndoBitmap(),this.drawPenLocation=[NaN,NaN,NaN],this.drawPenAxCorSag=-1,n(this.onMouseUp)&&this.onMouseUp(s),this.uiData.isDragging){this.uiData.isDragging=!1,this.opts.dragMode===5&&this.drawScene();const f=this.canvasPos2frac([this.uiData.dragStart[0],this.uiData.dragStart[1]]),g=this.canvasPos2frac([this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);if(this.generateMouseUpCallback(f,g),this.opts.dragMode!==1||c||this.uiData.dragStart[0]===this.uiData.dragEnd[0]&&this.uiData.dragStart[1]===this.uiData.dragEnd[1])return;this.calculateNewRange({volIdx:0}),this.refreshLayers(this.volumes[0],0)}this.drawScene()}checkMultitouch(n){if(this.uiData.touchdown&&!this.uiData.multiTouchGesture){const s=this.canvas.getBoundingClientRect();this.mouseDown(n.touches[0].clientX-s.left,n.touches[0].clientY-s.top),this.mouseClick(n.touches[0].clientX-s.left,n.touches[0].clientY-s.top)}}touchStartListener(n){n.preventDefault(),this.uiData.touchTimer||(this.uiData.touchTimer=setTimeout(()=>{this.resetBriCon(n)},this.opts.longTouchTimeout)),this.uiData.touchdown=!0,this.uiData.currentTouchTime=new Date().getTime();const s=this.uiData.currentTouchTime-this.uiData.lastTouchTime;if(s0){this.uiData.doubleTouch=!0,this.setDragStart(n.targetTouches[0].clientX-n.target.getBoundingClientRect().left,n.targetTouches[0].clientY-n.target.getBoundingClientRect().top),this.resetBriCon(n),this.uiData.lastTouchTime=this.uiData.currentTouchTime;return}else this.uiData.doubleTouch=!1,this.setDragStart(0,0),this.setDragEnd(0,0),this.uiData.lastTouchTime=this.uiData.currentTouchTime;this.uiData.touchdown&&n.touches.length<2?this.uiData.multiTouchGesture=!1:this.uiData.multiTouchGesture=!0,setTimeout(this.checkMultitouch.bind(this),1,n)}touchEndListener(n){if(n.preventDefault(),this.uiData.touchdown=!1,this.uiData.lastTwoTouchDistance=0,this.uiData.multiTouchGesture=!1,this.uiData.touchTimer&&(clearTimeout(this.uiData.touchTimer),this.uiData.touchTimer=null),this.uiData.isDragging){this.uiData.isDragging=!1,this.opts.dragMode===1&&(this.calculateNewRange(),this.refreshLayers(this.volumes[0],0));const s=this.canvasPos2frac([this.uiData.dragStart[0],this.uiData.dragStart[1]]),c=this.canvasPos2frac([this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);this.generateMouseUpCallback(s,c)}this.mouseUpListener()}mouseMoveListener(n){if(this.uiData.mousedown){const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);if(!s)return;const c=s.x*this.uiData.dpr,f=s.y*this.uiData.dpr;if(this.tileIndex(c,f)!==this.uiData.clickedTile)return;this.uiData.mouseButtonLeftDown?(this.mouseMove(s.x,s.y),this.mouseClick(s.x,s.y)):(this.uiData.mouseButtonRightDown||this.uiData.mouseButtonCenterDown)&&this.setDragEnd(s.x,s.y),this.drawScene(),this.uiData.prevX=this.uiData.currX,this.uiData.prevY=this.uiData.currY}}resetBriCon(n=null){if(this.uiData.isDragging)return;let s=!1;this.opts.sliceType===4&&(s=!0);let c=0,f=0;if(n!==null&&("targetTouches"in n?(c=n.targetTouches[0].clientX-n.target.getBoundingClientRect().left,f=n.targetTouches[0].clientY-n.target.getBoundingClientRect().top):(c=n.offsetX,f=n.offsetY),c*=this.uiData.dpr,f*=this.uiData.dpr,this.inRenderTile(c,f)>=0&&(s=!0)),s){this.uiData.mouseDepthPicker=!0,this.drawScene(),this.drawScene();return}this.opts.dragMode!==4&&(this.volumes.length<1||this.uiData.doubleTouch||(this.volumes[0].cal_min=this.volumes[0].robust_min,this.volumes[0].cal_max=this.volumes[0].robust_max,this.onIntensityChange(this.volumes[0]),this.refreshLayers(this.volumes[0],0),this.drawScene()))}setDragStart(n,s){n*=this.uiData.dpr,s*=this.uiData.dpr,this.uiData.dragStart[0]=n,this.uiData.dragStart[1]=s}setDragEnd(n,s){n*=this.uiData.dpr,s*=this.uiData.dpr,this.uiData.dragEnd[0]=n,this.uiData.dragEnd[1]=s}touchMoveListener(n){if(this.uiData.touchdown&&n.touches.length<2){const s=this.canvas.getBoundingClientRect();if(this.uiData.isDragging||(this.uiData.pan2DxyzmmAtMouseDown=clone$1(this.scene.pan2Dxyzmm)),this.uiData.isDragging=!0,this.uiData.doubleTouch&&this.uiData.isDragging){this.setDragEnd(n.targetTouches[0].clientX-n.target.getBoundingClientRect().left,n.targetTouches[0].clientY-n.target.getBoundingClientRect().top),this.drawScene();return}this.mouseClick(n.touches[0].clientX-s.left,n.touches[0].clientY-s.top),this.mouseMove(n.touches[0].clientX-s.left,n.touches[0].clientY-s.top)}else this.handlePinchZoom(n)}handlePinchZoom(n){if(n.targetTouches.length===2&&n.changedTouches.length===2){const s=Math.hypot(n.touches[0].pageX-n.touches[1].pageX,n.touches[0].pageY-n.touches[1].pageY),c=this.canvas.getBoundingClientRect();this.mousePos=[n.touches[0].clientX-c.left,n.touches[0].clientY-c.top],sthis.opts.keyDebounceTime){switch(this.currentClipPlaneIndex=(this.currentClipPlaneIndex+1)%7,this.currentClipPlaneIndex){case 0:this.scene.clipPlaneDepthAziElev=[2,0,0];break;case 1:this.scene.clipPlaneDepthAziElev=[0,270,0];break;case 2:this.scene.clipPlaneDepthAziElev=[0,90,0];break;case 3:this.scene.clipPlaneDepthAziElev=[0,0,0];break;case 4:this.scene.clipPlaneDepthAziElev=[0,180,0];break;case 5:this.scene.clipPlaneDepthAziElev=[0,0,-90];break;case 6:this.scene.clipPlaneDepthAziElev=[0,0,90];break}this.setClipPlane(this.scene.clipPlaneDepthAziElev)}this.lastCalled=s}else if(n.code===this.opts.viewModeHotKey){const s=new Date().getTime();s-this.lastCalled>this.opts.keyDebounceTime&&(this.setSliceType((this.opts.sliceType+1)%5),this.lastCalled=s)}}keyDownListener(n){n.code==="KeyH"&&this.opts.sliceType===4?this.setRenderAzimuthElevation(this.scene.renderAzimuth-1,this.scene.renderElevation):n.code==="KeyL"&&this.opts.sliceType===4?this.setRenderAzimuthElevation(this.scene.renderAzimuth+1,this.scene.renderElevation):n.code==="KeyJ"&&this.opts.sliceType===4?this.setRenderAzimuthElevation(this.scene.renderAzimuth,this.scene.renderElevation+1):n.code==="KeyK"&&this.opts.sliceType===4?this.setRenderAzimuthElevation(this.scene.renderAzimuth,this.scene.renderElevation-1):n.code==="KeyH"&&this.opts.sliceType!==4?this.moveCrosshairInVox(-1,0,0):n.code==="KeyL"&&this.opts.sliceType!==4?this.moveCrosshairInVox(1,0,0):n.code==="KeyU"&&this.opts.sliceType!==4&&n.ctrlKey?this.moveCrosshairInVox(0,0,1):n.code==="KeyD"&&this.opts.sliceType!==4&&n.ctrlKey?this.moveCrosshairInVox(0,0,-1):n.code==="KeyJ"&&this.opts.sliceType!==4?this.moveCrosshairInVox(0,-1,0):n.code==="KeyK"&&this.opts.sliceType!==4?this.moveCrosshairInVox(0,1,0):n.code==="KeyM"&&this.opts.sliceType!==4?(this.opts.dragMode++,this.opts.dragMode>=4&&(this.opts.dragMode=0),log$4.info("drag mode changed to ",DRAG_MODE[this.opts.dragMode])):n.code==="ArrowLeft"?this.setFrame4D(this.volumes[0].id,this.volumes[0].frame4D-1):n.code==="ArrowRight"?this.setFrame4D(this.volumes[0].id,this.volumes[0].frame4D+1):n.code==="Slash"&&n.shiftKey&&alert(`NIIVUE VERSION: ${version$1}`)}wheelListener(n){if(n.preventDefault(),n.stopPropagation(),this.thumbnailVisible)return;const s=this.canvas.getBoundingClientRect();n.deltaY<0?this.sliceScroll2D(-.01,n.clientX-s.left,n.clientY-s.top):this.sliceScroll2D(.01,n.clientX-s.left,n.clientY-s.top)}registerInteractions(){if(!this.canvas)throw new Error("canvas undefined");this.canvas.addEventListener("mousedown",this.mouseDownListener.bind(this)),this.canvas.addEventListener("mouseup",this.mouseUpListener.bind(this)),this.canvas.addEventListener("mousemove",this.mouseMoveListener.bind(this)),this.canvas.addEventListener("touchstart",this.touchStartListener.bind(this)),this.canvas.addEventListener("touchend",this.touchEndListener.bind(this)),this.canvas.addEventListener("touchmove",this.touchMoveListener.bind(this)),this.canvas.addEventListener("wheel",this.wheelListener.bind(this)),this.canvas.addEventListener("contextmenu",this.mouseContextMenuListener.bind(this)),this.canvas.addEventListener("dblclick",this.resetBriCon.bind(this)),this.canvas.addEventListener("dragenter",this.dragEnterListener.bind(this),!1),this.canvas.addEventListener("dragover",this.dragOverListener.bind(this),!1),this.canvas.addEventListener("drop",this.dropListener.bind(this),!1),this.canvas.setAttribute("tabindex","0"),this.canvas.addEventListener("keyup",this.keyUpListener.bind(this),!1),this.canvas.addEventListener("keydown",this.keyDownListener.bind(this),!1)}dragEnterListener(n){n.stopPropagation(),n.preventDefault()}dragOverListener(n){n.stopPropagation(),n.preventDefault()}getFileExt(n,s=!0){log$4.debug("fullname: ",n);const c=/(?:\.([^.]+))?$/;let f=c.exec(n)[1];return f=f.toUpperCase(),f==="GZ"&&(f=c.exec(n.slice(0,-3))[1],f=f.toUpperCase()),s?f:f.toLowerCase()}async addVolumeFromUrl(n){const s=await NVImage.loadFromUrl(n);return this.document.addImageOptions(s,n),s.onColormapChange=this.onColormapChange,this.mediaUrlMap.set(s,n.url),this.onVolumeAddedFromUrl&&this.onVolumeAddedFromUrl(n,s),this.addVolume(s),s}getMediaByUrl(n){return[...this.mediaUrlMap.entries()].filter(s=>s[1]===n).map(s=>s[0]).pop()}removeVolumeByUrl(n){const s=this.getMediaByUrl(n);if(s)this.removeVolume(s);else throw new Error("No volume with URL present")}readDirectory(n){const s=n.createReader();let c=[];const f=async A=>{const v=[],y=async T=>new Promise((I,S)=>T.file(I,S));for(let T=0;T{s.readEntries(A=>{A.length?(c=c.concat(A),g()):f(c).then(v=>{NVImage.loadFromFile({file:v,name:n.name,urlImgData:null,imageType:NVIMAGE_TYPE.DCM_FOLDER}).then(y=>this.addVolume(y)).catch(y=>{throw y})}).catch(v=>{throw v})})};return g(),c}isMeshExt(n){const s=this.getFileExt(n);return log$4.debug("dropped ext"),log$4.debug(s),MESH_EXTENSIONS.includes(s)}dropListener(n){if(n.stopPropagation(),n.preventDefault(),!this.opts.dragAndDropEnabled)return;const s=n.dataTransfer;if(!s)return;const c=s.getData("text/uri-list");if(c){const f=NVImageFromUrlOptions(c),g=this.getFileExt(c);log$4.debug("dropped ext"),log$4.debug(g),MESH_EXTENSIONS.includes(g)?this.addMeshFromUrl({url:c}).catch(A=>{throw A}):g==="NVD"?this.loadDocumentFromUrl(c).catch(A=>{throw A}):this.addVolumeFromUrl(f).catch(A=>{throw A})}else{const f=s.items;if(f.length>0){!n.shiftKey&&!n.altKey&&(this.volumes=[],this.overlays=[],this.meshes=[]),this.closeDrawing();for(const g of Array.from(f)){const A=g.webkitGetAsEntry();if(log$4.debug(A),!A)throw new Error("could not get entry from file");if(A.isFile){const v=this.getFileExt(A.name);if(v==="PNG"){A.file(T=>{this.loadBmpTexture(T).catch(I=>{throw I})});continue}let y;if(A.name.lastIndexOf("HEAD")!==-1)for(const T of Array.from(f)){const I=T.webkitGetAsEntry();if(!I)throw new Error("could not get paired entry");const S=A.name.substring(0,A.name.lastIndexOf("HEAD")),k=I.name.substring(0,I.name.lastIndexOf("BRIK"));S===k&&(y=I)}if(A.name.lastIndexOf("BRIK")!==-1)continue;if(MESH_EXTENSIONS.includes(v)){A.file(T=>{NVMesh.loadFromFile({file:T,gl:this.gl,name:T.name}).then(I=>{this.addMesh(I)}).catch(I=>{throw I})});continue}else if(v==="NVD"){A.file(T=>{NVDocument.loadFromFile(T).then(I=>{this.loadDocument(I),log$4.debug("loaded document")}).catch(I=>{throw I})});break}A.file(T=>{y?y.file(I=>{NVImage.loadFromFile({file:T,urlImgData:I,limitFrames4D:this.opts.limitFrames4D}).then(S=>{this.addVolume(S)}).catch(S=>{throw S})}):NVImage.loadFromFile({file:T,urlImgData:y,limitFrames4D:this.opts.limitFrames4D}).then(I=>{n.altKey?(log$4.debug("alt key detected: assuming this is a drawing overlay"),this.drawClearAllUndoBitmaps(),this.loadDrawing(I)):this.addVolume(I)}).catch(I=>{throw I})})}else A.isDirectory&&this.readDirectory(A)}}}this.drawScene()}setMultiplanarPadPixels(n){this.opts.multiplanarPadPixels=n,this.drawScene()}setMultiplanarLayout(n){typeof n=="string"&&(n=parseInt(n)),this.opts.multiplanarLayout=n,this.drawScene()}setCornerOrientationText(n){this.opts.isCornerOrientationText=n,this.updateGLVolume()}setRadiologicalConvention(n){this.opts.isRadiologicalConvention=n,this.updateGLVolume()}setDefaults(n={},s=!1){this.opts={...DEFAULT_OPTIONS},this.scene={...this.document.scene};for(const c in n)typeof n[c]=="function"?this[c]=n[c]:this.opts[c]=DEFAULT_OPTIONS[c]===void 0?DEFAULT_OPTIONS[c]:n[c];if(this.scene.pan2Dxyzmm=[0,0,0,1],s&&this.volumes&&this.volumes.length>0)for(let c=0;c=this.opts.maxDrawUndoBitmaps&&(this.currentDrawUndoBitmap=0),this.drawUndoBitmaps[this.currentDrawUndoBitmap]=encodeRLE(this.drawBitmap)}drawClearAllUndoBitmaps(){if(this.currentDrawUndoBitmap=this.opts.maxDrawUndoBitmaps,!(!this.drawUndoBitmaps||this.drawUndoBitmaps.length<1))for(let n=this.drawUndoBitmaps.length-1;n>=0;n--)this.drawUndoBitmaps[n]=new Uint8Array}drawUndo(){if(this.drawUndoBitmaps.length<1){log$4.debug("undo bitmaps not loaded");return}if(this.currentDrawUndoBitmap--,this.currentDrawUndoBitmap<0&&(this.currentDrawUndoBitmap=this.drawUndoBitmaps.length-1),this.currentDrawUndoBitmap>=this.drawUndoBitmaps.length&&(this.currentDrawUndoBitmap=0),this.drawUndoBitmaps[this.currentDrawUndoBitmap].length<2){log$4.debug("drawUndo is misbehaving");return}this.drawBitmap=decodeRLE(this.drawUndoBitmaps[this.currentDrawUndoBitmap],this.drawBitmap.length),this.refreshDrawing(!0)}loadDrawing(n){if(this.drawBitmap&&log$4.debug("Overwriting open drawing!"),!this.back)throw new Error("back undefined");this.drawClearAllUndoBitmaps();const s=n.hdr.dims;if(s[1]!==this.back.hdr.dims[1]||s[2]!==this.back.hdr.dims[2]||s[3]!==this.back.hdr.dims[3])return log$4.debug("drawing dimensions do not match background image"),!1;n.img.constructor!==Uint8Array&&log$4.debug("Drawings should be UINT8");const c=n.permRAS,f=s[1]*s[2]*s[3];this.drawBitmap=new Uint8Array(f),this.drawTexture=this.r8Tex(this.drawTexture,TEXTURE7_DRAW,this.back.dims,!0);const g=[0,0,0];for(let M=0;M<3;M++)for(let O=0;O<3;O++)Math.abs(c[M])-1===O&&(g[O]=M*Math.sign(c[M]));let A=1;const v=[1,1,1],y=[!1,!1,!1];for(let M=0;MArray(f).fill(0)),M=Array(f).fill(0).map(()=>Array(f).fill(0));for(let B=1;B3)for(let B=0;BO&&(z[0]=B,z[1]=V,z[2]=b,O=W)}else if(n===3)for(let B=0;BO&&(z[0]=B,z[1]=V,O=b)}else for(let B=0;BO&&(z[0]=B,O=V)}return[I(z[0]),I(z[1]),I(z[2])]}drawOtsu(n=2){if(this.volumes.length===0)return;const s=this.volumes[0].img.length,c=this.findOtsu(n);if(c.length<3)return;this.drawBitmap||this.createEmptyDrawing();const f=this.drawBitmap,g=this.volumes[0].img;for(let A=0;Ac[0]&&(f[A]=1),v>c[1]&&(f[A]=2),v>c[2]&&(f[A]=3)}this.drawAddUndoBitmap(),this.refreshDrawing(!0)}removeHaze(n=5,s=0){const c=this.volumes[s].img,f=this.volumes[s].hdr,g=c.length;let A=2;(n===5||n===1)&&(A=4),(n===4||n===2)&&(A=3);const v=this.findOtsu(A);if(v.length<3)return;let y=v[0];n===1&&(y=v[2]),n===2&&(y=v[1]);const T=f.scl_inter,I=f.scl_slope,S=this.volumes[s].global_min;for(let k=0;k=this.meshes.length?-1:n;const s=this.meshes.length;for(let c=0;cc)return;const f=this.getVolumeIndexByID(n.id);s===0?(this.volumes.splice(f,1),this.volumes.unshift(n),this.back=this.volumes[0],this.overlays=this.volumes.slice(1)):s<0?(this.volumes.splice(this.getVolumeIndexByID(n.id),1),this.back=this.volumes[0],this.volumes.length>1?this.overlays=this.volumes.slice(1):this.overlays=[]):(this.volumes.splice(f,1),this.volumes.splice(s,0,n),this.overlays=this.volumes.slice(1),this.back=this.volumes[0]),this.updateGLVolume()}setMesh(n,s=0){this.meshes.forEach(g=>{log$4.debug("MESH: ",g.name)});const c=this.meshes.length;if(s>c)return;const f=this.getMeshIndexByID(n.id);s===0?(this.meshes.splice(f,1),this.meshes.unshift(n)):s<0?this.meshes.splice(this.getMeshIndexByID(n.id),1):(this.meshes.splice(f,1),this.meshes.splice(s,0,n)),this.updateGLVolume(),this.meshes.forEach(g=>{log$4.debug(g.name)})}removeVolume(n){if(this.setVolume(n,-1),this.mediaUrlMap.has(n)){const s=this.mediaUrlMap.get(n);this.onVolumeWithUrlRemoved(s),this.mediaUrlMap.delete(n)}this.drawScene()}removeVolumeByIndex(n){if(n>=this.volumes.length)throw new Error("Index of volume out of bounds");this.removeVolume(this.volumes[n])}removeMesh(n){if(this.setMesh(n,-1),this.mediaUrlMap.has(n)){const s=this.mediaUrlMap.get(n);this.onMeshWithUrlRemoved(s),this.mediaUrlMap.delete(n)}}removeMeshByUrl(n){const s=this.getMediaByUrl(n);s&&(this.removeMesh(s),this.mediaUrlMap.delete(s),this.onMeshWithUrlRemoved(n))}moveVolumeToBottom(n){this.setVolume(n,0)}moveVolumeUp(n){const s=this.getVolumeIndexByID(n.id);this.setVolume(n,s+1)}moveVolumeDown(n){const s=this.getVolumeIndexByID(n.id);this.setVolume(n,s-1)}moveVolumeToTop(n){this.setVolume(n,this.volumes.length-1)}mouseDown(n,s){n*=this.uiData.dpr,s*=this.uiData.dpr,this.mousePos=[n,s]}mouseMove(n,s){n*=this.uiData.dpr,s*=this.uiData.dpr;const c=(n-this.mousePos[0])/this.uiData.dpr,f=(s-this.mousePos[1])/this.uiData.dpr;this.mousePos=[n,s],!(this.inRenderTile(n,s)<0)&&(Math.abs(c)<1&&Math.abs(f)<1||(this.scene.renderAzimuth+=c,this.scene.renderElevation+=f,this.drawScene()))}sph2cartDeg(n,s){const c=-s*(Math.PI/180),f=(n-90)%360*(Math.PI/180),g=[Math.cos(c)*Math.cos(f),Math.cos(c)*Math.sin(f),Math.sin(c)],A=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]);return A<=0||(g[0]/=A,g[1]/=A,g[2]/=A),g}setClipPlane(n){const s=this.sph2cartDeg(n[1]+180,n[2]);this.scene.clipPlane=[s[0],s[1],s[2],n[0]],this.scene.clipPlaneDepthAziElev=n,this.onClipPlaneChange(this.scene.clipPlane),this.drawScene()}setCrosshairColor(n){this.opts.crosshairColor=n,this.drawScene()}setCrosshairWidth(n){this.opts.crosshairWidth=n,this.crosshairs3D&&(this.crosshairs3D.mm[0]=NaN),this.drawScene()}setDrawColormap(n){this.drawLut=cmapper.makeDrawLut(n),this.updateGLVolume()}setDrawingEnabled(n){this.opts.drawingEnabled=n,this.opts.drawingEnabled&&(this.drawBitmap||this.createEmptyDrawing()),this.drawScene()}setPenValue(n,s=!1){this.opts.penValue=n,this.opts.isFilledPen=s,this.drawScene()}setDrawOpacity(n){this.drawOpacity=n,this.drawScene()}setSelectionBoxColor(n){this.opts.selectionBoxColor=n}sliceScroll2D(n,s,c,f=!0){if(this.inGraphTile(s,c)){let g=this.volumes[0].frame4D;n>0&&g++,n<0&&g--,this.setFrame4D(this.volumes[0].id,g);return}if(n!==0&&this.opts.dragMode===3&&this.inRenderTile(this.uiData.dpr*s,this.uiData.dpr*c)===-1){let g=this.scene.pan2Dxyzmm[3]*(1+10*n);g=Math.round(g*10)/10;const A=this.scene.pan2Dxyzmm[3]-g;this.opts.yoke3Dto2DZoom&&(this.scene.volScaleMultiplier=g),this.scene.pan2Dxyzmm[3]=g;const v=this.frac2mm(this.scene.crosshairPos);this.scene.pan2Dxyzmm[0]+=A*v[0],this.scene.pan2Dxyzmm[1]+=A*v[1],this.scene.pan2Dxyzmm[2]+=A*v[2],this.drawScene();return}this.mouseClick(s,c,n,f)}setSliceType(n){return this.opts.sliceType=n,this.drawScene(),this}setOpacity(n,s){if(this.volumes[n].opacity=s,n===0){this.drawScene();return}this.updateGLVolume()}setScale(n){this.scene.volScaleMultiplier=n,this.drawScene()}setClipPlaneColor(n){this.opts.clipPlaneColor=n,this.renderShader.use(this.gl),this.gl.uniform4fv(this.renderShader.uniforms.clipPlaneColor,this.opts.clipPlaneColor),this.drawScene()}async setVolumeRenderIllumination(n=0){this.renderShader=this.renderVolumeShader,n>0&&(this.renderShader=this.renderGradientShader),n<0&&(this.renderShader=this.renderSliceShader),this.initRenderShader(this.renderShader,n),this.renderShader.use(this.gl),this.setClipPlaneColor(this.opts.clipPlaneColor),this.gradientTextureAmount=n,this.refreshLayers(this.volumes[0],0),this.drawScene()}overlayRGBA(n){const s=n.hdr,c=s.dims[1]*s.dims[2]*s.dims[3],f=new Uint8ClampedArray(c*4),g=.2*Math.min(Math.min(s.dims[1],s.dims[2]),s.dims[3]),A=.5*s.dims[1],v=.5*s.dims[2],y=.5*s.dims[3];let T=0;for(let I=0;I0&&(this.back=this.volumes[0]);const c=n.encodedDrawingBlob;if(c){const f=n.imageOptionsArray[0],g=NVImage.loadFromBase64({base64:c,...f});g&&this.loadDrawing(g)}for(const f of n.meshDataObjects??[]){const g={gl:this.gl,...f};log$4.debug(g);const A=new NVMesh(g.pts,g.tris,g.name,g.rgba255,g.opacity,g.visible,this.gl,g.connectome,g.dpg,g.dps,g.dpv);A.meshShaderIndex=g.meshShaderIndex,A.layers=g.layers,A.updateMesh(this.gl),log$4.debug(A),this.addMesh(A)}if(n.data.connectomes)for(const f of n.data.connectomes){const g=JSON.parse(f);this.loadConnectome(g)}return this.scene={...this.scene,...n.scene.sceneData},this.opts={...this.opts,...n.opts},this.updateGLVolume(),this.drawScene(),this.onDocumentLoaded(n),this}generateLoadDocumentJavaScript(n,s){const c=this.json(),f=NVUtilities.compressToBase64String(JSON.stringify(c));return` +`),g=f.length,A=[],v=[];for(let I=0;I1056964608&&(V[k+0]=(Y>>16&255)/255,V[k+1]=(Y>>8&255)/255,V[k+2]=(Y&255)/255),Y===0&&(V[k+0]=e,V[k+1]=N,V[k+2]=M),Y===1&&(V[k+0]=O,V[k+1]=U,V[k+2]=B),k+=3}S+=g*4;for(let q=0;q=3e3&&k<=3099&&T>580){let O=function(){for(;Q"))return pe;for(;Q");)pe+=O();return pe},B=function(pe,Se=!1){const xe=m.indexOf(pe);if(xe<0)return 1;const we=m.indexOf('"',xe)+1,Fe=m.indexOf('"',we),De=m.slice(we,Fe);return Se?De:parseInt(De)},V=0,b=0,W=0,q="",Y=new Uint32Array;const X=new Uint8Array(n);let Q=552,m;const Z=M[5],ee=new Float32Array(s*Z);for(;Q"));)if(m.includes("")||(m=U()),!m.startsWith("")||!m.endsWith(""))return log$4.warn("Unable to find CIfTI "),ee;m=m.slice(15,-16);const we=m.trim().split(/\s+/);we.length4)&&log$4.warn("Not a valid MGH file");const N=v*y*T*I;let M=[];if(N%s!==0)return log$4.warn("Vertices in NIfTI ("+N+") is not a multiple of number of vertices ("+s+")"),M;if(S===3){M=new Float32Array(N);for(let Y=0;Y0)return log$4.warn("unsupported CTABreadFromBinaryV1"),M;if(Q=-Q,Q!==2)return log$4.warn("CTABreadFromBinary: unknown version"),M;const m=f.getInt32(k+=4,e);if(m<0)return log$4.warn("CTABreadFromBinaryV2: nentries was ",m),M;const Z=f.getInt32(k+=4,e);k+=Z;const ee=f.getInt32(k+=4,e);if(ee<0)return M;const oe={R:[],G:[],B:[],A:[],I:[],labels:[]};for(let fe=0;fe"))if(A.startsWith(""))for(;f");)A+=g();else for(;f");)A+=g();const V=v("USE");if(V.length>1){V in U?M=U[V]:log$4.warn("Unable to find DEF for "+V);return}const b=y("diffuseColor");if(b.length<3)return;M[0]=Math.round(b[0]*255),M[1]=Math.round(b[1]*255),M[2]=Math.round(b[2]*255);const W=v("DEF");W.length<1||(U[W]=M)}for(;f=0?(I.push(W[Z]+Y),I.push(W[X-1]+Y),I.push(W[X-0]+Y),X+=1):(X+=3,Z=X-2)}else for(;X=0?(I.push(W[X-2]+Y),I.push(W[X-1]+Y),I.push(W[X-0]+Y),X+=1):X+=3;T=[...T,...q];const Q=Math.floor(q.length/3),m=Array(Q).fill(M).flat();if(k.length===Q*3){let Z=0,ee=0;for(let oe=0;oe";)g++;if(ee=f[g-1]==="/",oe+1=c)break}const fe=new TextDecoder().decode(n.slice(oe+1,g)).trim(),me=fe.split(" ")[0].trim(),pe=g;let Se=g,xe=g;if(f[oe+1]!=="?"&&f[oe+1]!=="!"){const we="";Se=f.indexOf(we,pe),xe=Se+we.length-1}return{name:fe,startPos:oe,contentStartPos:pe,contentEndPos:Se,endPos:xe}}let v=A();if(!v.name.startsWith("?xml"))throw new Error("readGII: Invalid XML file");for(;!v.name.startsWith("GIFTI")&&v.endPos1;){if(v=A(),v.name.startsWith("Label Key")&&(Y=v.name,m.I.push(X("Key=")),m.R.push(Math.round(255*X("Red=",!0))),m.G.push(Math.round(255*X("Green=",!0))),m.B.push(Math.round(255*X("Blue=",!0))),m.A.push(Math.round(255*X("Alpha",!0))),Y=new TextDecoder().decode(n.slice(v.contentStartPos+1,v.contentEndPos)).trim(),m.labels.push(Q(""u"){let oe=function(fe){const me=atob(fe),pe=me.length,Se=new Uint8Array(pe);for(let xe=0;xe1&&(Z=cmapper.makeLabelLut(m)),s>0)return{scalars:I,colormapLabel:Z,anatomicalStructurePrimary:S};if(y.length>2&&!q&&(U[0]!==0||U[1]!==0||U[2]!==0)){W=Math.floor(y.length/3);let ee=0;for(let oe=0;oe1?1:g,this.visible=A,this.meshShaderIndex=0,this.indexBuffer=v.createBuffer(),this.vertexBuffer=v.createBuffer(),this.vao=v.createVertexArray(),v.bindVertexArray(this.vao),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,this.indexBuffer),v.bindBuffer(v.ARRAY_BUFFER,this.vertexBuffer),v.enableVertexAttribArray(0),v.enableVertexAttribArray(1),this.f32PerVertex!==7?(v.vertexAttribPointer(0,3,v.FLOAT,!1,20,0),v.vertexAttribPointer(1,4,v.BYTE,!0,20,12),v.enableVertexAttribArray(2),v.vertexAttribPointer(2,4,v.UNSIGNED_BYTE,!0,20,16)):(v.vertexAttribPointer(0,3,v.FLOAT,!1,28,0),v.vertexAttribPointer(1,3,v.FLOAT,!1,28,12),v.enableVertexAttribArray(2),v.vertexAttribPointer(2,4,v.UNSIGNED_BYTE,!0,28,24)),v.bindVertexArray(null),this.vaoFiber=v.createVertexArray(),this.offsetPt0=null,this.hasConnectome=!1,this.colormapInvert=!1,this.fiberGroupColormap=null,this.pts=n,this.layers=[],this.type="mesh",f[3]<1){this.rgba255=f,this.fiberLength=2,this.fiberDither=.1,this.fiberColor="Global",this.fiberDecimationStride=1,this.fiberMask=[],this.colormap=y,this.dpg=T,this.dps=I,this.dpv=S,T&&this.initValuesArray(T),I&&this.initValuesArray(I),S&&this.initValuesArray(S),this.offsetPt0=s,this.updateFibers(v),v.bindVertexArray(this.vaoFiber),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,this.indexBuffer),v.bindBuffer(v.ARRAY_BUFFER,this.vertexBuffer),v.enableVertexAttribArray(0),v.vertexAttribPointer(0,3,v.FLOAT,!1,16,0),v.enableVertexAttribArray(1),v.vertexAttribPointer(1,4,v.UNSIGNED_BYTE,!0,16,12),v.bindVertexArray(null);return}if(y){this.connectome=y,this.hasConnectome=!0;const O=Object.keys(y);for(let U=0,B=O.length;UMath.min(g,A)),f=n[s].vals.reduce((g,A)=>Math.max(g,A));n[s].global_min=c,n[s].global_max=f,n[s].cal_min=c,n[s].cal_max=f}return n}linesToCylinders(n,s,c){function f(Q){return fromValues$2(Q[0],Q[1],Q[2])}const g=Math.pow(2,32)-1,A=c.length;let v=0,y=0;for(let Q=0;Q 1 requires f32PerVertex == 5");const k=new Float32Array(I*S),e=new Uint8Array(k.buffer);let N=0,M=create$1(),O=create$1(),U=create$1();const B=create$2();let V=create$2(),b=0;const W=this.fiberRadius;for(let Q=0;Q0){const q=parseInt(N.substring(3));q0){const q=parseInt(N.substring(3));q=this.dpg.length||X.A[Q]<1||(Y[m]=!0,m*=4,q[m]=X.R[Q],q[m+1]=X.G[Q],q[m+2]=X.B[Q],q[m+3]=255)}U.fill(-1);for(let Q=0;Q2&&this.fiberRadius>0?this.linesToCylinders(n,A,b):(this.indexCount=b.length,n.bindBuffer(n.ARRAY_BUFFER,this.vertexBuffer),n.bufferData(n.ARRAY_BUFFER,Uint32Array.from(v),n.STATIC_DRAW),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.indexBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,Uint32Array.from(b),n.STATIC_DRAW))}indexNearestXYZmm(n,s,c){const f=this.pts,g=this.pts.length/3;let A=0,v=1/0,y=0;for(let T=0;T0)for(let T=0;TI.cal_max)continue;if(I.outlineBorder===void 0&&(I.outlineBorder=0),I.isAdditiveBlend===void 0&&(I.isAdditiveBlend=!1),I.colormapLabel&&I.colormapLabel.R&&!I.colormapLabel.lut&&(I.colormapLabel=cmapper.makeLabelLut(I.colormapLabel)),I.colormapLabel&&I.colormapLabel.lut){const V=I.colormapLabel.lut,b=Math.floor(V.length/4),W=Math.min(Math.max(I.frame4D,0),I.nFrame4D-1),q=g*W,Y=new Uint8Array(g*4);let X=0;for(let m=0;m0&&(Q=NVMeshUtilities.getClusterBoundary(Y,this.tris)),X=0;for(let m=0;m0&&(V=NVMeshUtilities.getClusterBoundary(B,this.tris));let b=0;for(let W=0;W0)for(let T=0;T"u"){const O=new Float32Array([0,0,0,0,0,0]),U=new Uint32Array([0]);I={pts:O,offsetPt0:U},log$4.error("Creating empty tracts")}return g[3]=0,new Ii(I.pts,I.offsetPt0,s,g,f,A,c,"inferno",I.dpg||null,I.dps||null,I.dpv||null)}if(k==="GII")I=NVMeshLoaders.readGII(n);else if(k==="MZ3")I=NVMeshLoaders.readMZ3(n),(I instanceof Float32Array||I.positions===null)&&log$4.warn("MZ3 does not have positions (statistical overlay?)");else if(k==="ASC")I=NVMeshLoaders.readASC(n);else if(k==="DFS")I=NVMeshLoaders.readDFS(n);else if(k==="BYU"||k==="G")I=NVMeshLoaders.readGEO(n);else if(k==="GEO")I=NVMeshLoaders.readGEO(n,!0);else if(k==="ICO"||k==="TRI")I=NVMeshLoaders.readICO(n);else if(k==="OFF")I=NVMeshLoaders.readOFF(n);else if(k==="NV")I=NVMeshLoaders.readNV(n);else if(k==="OBJ")I=NVMeshLoaders.readOBJ(n);else if(k==="PLY")I=NVMeshLoaders.readPLY(n);else if(k==="X3D")I=NVMeshLoaders.readX3D(n);else if(k==="FIB"||k==="VTK"){if(I=NVMeshLoaders.readVTK(n),"offsetPt0"in I)return g[3]=0,new Ii(I.pts,I.offsetPt0,s,g,f,A,c,"inferno")}else k==="SRF"?I=NVMeshLoaders.readSRF(n):k==="STL"?I=NVMeshLoaders.readSTL(n):I=NVMeshLoaders.readFreeSurfer(n);if(I.anatomicalStructurePrimary&&(T=I.anatomicalStructurePrimary),I instanceof Float32Array)throw new Error("fatal: unknown mesh type loaded");if(!I.positions)throw new Error("positions not loaded");if(!I.indices)throw new Error("indices not loaded");if(y=I.positions,v=I.indices,"rgba255"in I&&I.rgba255.length>0&&(g=I.rgba255),"colors"in I&&I.colors&&I.colors.length===y.length){const O=y.length/3;g=new Uint8Array(O*4);let U=0,B=0;for(let V=0;V0&&(NVMeshLoaders.readLayer(s,n,M,f,"gray"),M.updateMesh(c)),M}static async loadLayer(n,s){let c;function f(e){const N=window.atob(e),M=N.length,O=new Uint8Array(M);for(let U=0;U-1&&(g=g.slice(0,g.indexOf("?")));let v=.5;"opacity"in n&&(v=n.opacity);let y="warm";"colormap"in n&&(y=n.colormap);let T="winter";"colormapNegative"in n&&(T=n.colormapNegative);let I=!1;"useNegativeCmap"in n&&(I=n.useNegativeCmap);let S=null;"cal_min"in n&&(S=n.cal_min);let k=null;"cal_max"in n&&(k=n.cal_max),NVMeshLoaders.readLayer(g,c,s,v,y,T,I,S,k)}static async loadFromUrl({url:n="",headers:s={},gl:c,name:f="",opacity:g=1,rgba255:A=[255,255,255,255],visible:v=!0,layers:y=[]}={}){let T=n.split("/");if(f===""){try{T=new URL(n).pathname.split("/")}catch{T=n.split("/")}f=T.slice(-1)[0],f.indexOf("?")>-1&&(f=f.slice(0,f.indexOf("?")))}if(n==="")throw Error("url must not be empty");if(!c)throw Error("gl context is null");const I=await fetch(n,{headers:s});if(!I.ok)throw Error(I.statusText);const S=await I.arrayBuffer(),k=await this.readMesh(S,f,c,g,new Uint8Array(A),v);if(!y||y.length<1)return k;for(let e=0;e{const f=new FileReader;f.onload=()=>{s(f.result)},f.onerror=c,f.readAsArrayBuffer(n)})}static async loadFromFile({file:n,gl:s,name:c="",opacity:f=1,rgba255:g=[255,255,255,255],visible:A=!0,layers:v=[]}={}){if(!n)throw new Error("file must be set");if(!s)throw new Error("rendering context must be set");const y=await Ii.readFileAsync(n),T=Ii.readMesh(y,c,s,f,new Uint8Array(g),A);if(!v||v.length<1)return T;for(let I=0;I>18,y=(S&258048)>>12,T=(S&4032)>>6,I=S&63,s+=c[v]+c[y]+c[T]+c[I];return g===1?(S=n[A],v=(S&252)>>2,y=(S&3)<<4,s+=c[v]+c[y]+"=="):g===2&&(S=n[A]<<8|n[A+1],v=(S&64512)>>10,y=(S&1008)>>4,T=(S&15)<<2,s+=c[v]+c[y]+c[T]+"="),s}static download(n,s,c){const f=document.createElement("a"),g=new Blob([n],{type:c});f.href=URL.createObjectURL(g),f.download=s,f.click()}static readFileAsync(n){return new Promise((s,c)=>{const f=new FileReader;f.onload=()=>{s(f.result)},f.onerror=c,f.readAsArrayBuffer(n)})}static blobToBase64(n){return new Promise(s=>{const c=new FileReader;c.onloadend=()=>s(c.result),c.readAsDataURL(n)})}static decompressBase64String(n){const s=atob(n),c=new ArrayBuffer(s.length),f=new Uint8Array(c);for(let v=0;vn+g*c)}static sph2cartDeg(n,s){const c=-s*(Math.PI/180),f=(n-90)%360*(Math.PI/180),g=[Math.cos(c)*Math.cos(f),Math.cos(c)*Math.sin(f),Math.sin(c)],A=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]);return A<=0||(g[0]/=A,g[1]/=A,g[2]/=A),g}static vox2mm(n,s){const c=clone$3(s);transpose$3(c,c);const f=fromValues$1(n[0],n[1],n[2],1);return transformMat4(f,f,c),fromValues$2(f[0],f[1],f[2])}},isPlatformLittleEndian=()=>{const u=new ArrayBuffer(2);return new DataView(u).setInt16(0,256,!0),new Int16Array(u)[0]===256},ImageType=(u=>(u[u.UNKNOWN=0]="UNKNOWN",u[u.NII=1]="NII",u[u.DCM=2]="DCM",u[u.DCM_MANIFEST=3]="DCM_MANIFEST",u[u.MIH=4]="MIH",u[u.MIF=5]="MIF",u[u.NHDR=6]="NHDR",u[u.NRRD=7]="NRRD",u[u.MHD=8]="MHD",u[u.MHA=9]="MHA",u[u.MGH=10]="MGH",u[u.MGZ=11]="MGZ",u[u.V=12]="V",u[u.V16=13]="V16",u[u.VMR=14]="VMR",u[u.HEAD=15]="HEAD",u[u.DCM_FOLDER=16]="DCM_FOLDER",u))(ImageType||{}),NVIMAGE_TYPE=Object.freeze({...ImageType,parse:u=>{let n=0;switch(u.toUpperCase()){case"":case"DCM":n=2;break;case"TXT":n=3;break;case"NII":n=1;break;case"MIH":n=4;break;case"MIF":n=5;break;case"NHDR":n=6;break;case"NRRD":n=7;break;case"MHD":n=8;break;case"MHA":n=9;break;case"MGH":n=10;break;case"MGZ":n=11;break;case"V":n=12;break;case"V16":n=13;break;case"VMR":n=14;break;case"HEAD":n=15;break}return n}}),NVImageFromUrlOptions=(u,n="",s="",c="gray",f=1,g=NaN,A=NaN,v=!0,y=.02,T=!1,I=!1,S="",k=0,e=NVIMAGE_TYPE.UNKNOWN,N=NaN,M=NaN,O=!0,U=!1,B=[])=>({url:u,urlImageData:n,name:s,colormap:c,colorMap:c,opacity:f,cal_min:g,cal_max:A,trustCalMinMax:v,percentileFrac:y,ignoreZeroVoxels:T,useQFormNotSForm:I,colormapNegative:S,imageType:e,cal_minNeg:N,cal_maxNeg:M,colorbarVisible:O,frame4D:k,alphaThreshold:U,colormapLabel:B});function getBestTransform(u,n,s){const c=u;let f=null;if(c){const g={colSize:n[0],rowSize:n[1],sliceSize:n[2]},A=s,v=[c[0],c[1],c[2]],y=[c[3],c[4],c[5]],T=[v[1]*y[2]-v[2]*y[1],v[2]*y[0]-v[0]*y[2],v[0]*y[1]-v[1]*y[0]];f=[[v[0]*g.colSize*-1,y[0]*g.rowSize*-1,T[0]*g.sliceSize*-1,-1*A[0]],[v[1]*g.colSize*-1,y[1]*g.rowSize*-1,T[1]*g.sliceSize*-1,-1*A[1]],[v[2]*g.colSize,y[2]*g.rowSize,T[2]*g.sliceSize,A[2]],[0,0,0,1]]}return f}function str2Buffer(u){const n=[];for(let s=0;s=v)break;let k=!0;for(let e=0;e<3;++e)f[e]>c[e]&&(k=!1),g[e]{}),__publicField(this,"onOpacityChange",()=>{}),__publicField(this,"mm000"),__publicField(this,"mm100"),__publicField(this,"mm010"),__publicField(this,"mm001"),__publicField(this,"cal_min"),__publicField(this,"cal_max"),__publicField(this,"robust_min"),__publicField(this,"robust_max"),__publicField(this,"global_min"),__publicField(this,"global_max"),__publicField(this,"urlImgData"),__publicField(this,"isManifest"),__publicField(this,"limitFrames4D"),this.name=s,this.id=v4(),this._colormap=c,this._opacity=f>1?1:f,this.percentileFrac=T,this.ignoreZeroVoxels=I,this.trustCalMinMax=y,this.colormapNegative=k,this.colormapLabel=B,this.frame4D=e,this.cal_minNeg=M,this.cal_maxNeg=O,this.colorbarVisible=U,this.useQFormNotSForm=S,!n)return;const V=/(?:\.([^.]+))?$/;let b=V.exec(s)[1]||"";b=b.toUpperCase(),b==="GZ"&&(b=V.exec(s.slice(0,-3))[1],b=b.toUpperCase());let W=null;switch(N===NVIMAGE_TYPE.UNKNOWN&&(N=NVIMAGE_TYPE.parse(b)),this.imageType=N,N){case NVIMAGE_TYPE.DCM_FOLDER:case NVIMAGE_TYPE.DCM_MANIFEST:case NVIMAGE_TYPE.DCM:W=this.readDICOM(n);break;case NVIMAGE_TYPE.MIH:case NVIMAGE_TYPE.MIF:W=this.readMIF(n,g);break;case NVIMAGE_TYPE.NHDR:case NVIMAGE_TYPE.NRRD:W=this.readNRRD(n,g);break;case NVIMAGE_TYPE.MHD:case NVIMAGE_TYPE.MHA:W=this.readMHA(n,g);break;case NVIMAGE_TYPE.MGH:case NVIMAGE_TYPE.MGZ:W=this.readMGH(n);break;case NVIMAGE_TYPE.V:W=this.readECAT(n);break;case NVIMAGE_TYPE.V16:W=this.readV16(n);break;case NVIMAGE_TYPE.VMR:W=this.readVMR(n);break;case NVIMAGE_TYPE.HEAD:W=this.readHEAD(n,g);break;case NVIMAGE_TYPE.NII:this.hdr=nifti.readHeader(n),this.hdr!==null&&(this.hdr.cal_min===0&&this.hdr.cal_max===255&&(this.hdr.cal_max=0),nifti.isCompressed(n)?W=nifti.readImage(this.hdr,nifti.decompress(n)):W=nifti.readImage(this.hdr,n));break;default:throw new Error("Image type not supported")}if(this.hdr&&typeof this.hdr.magic=="number"&&(this.hdr.magic="n+1"),this.nFrame4D=1,this.hdr)for(let Q=4;Q<7;Q++)this.hdr.dims[Q]>1&&(this.nFrame4D*=this.hdr.dims[Q]);if(this.frame4D=Math.min(this.frame4D,this.nFrame4D-1),this.nTotalFrame4D=this.nFrame4D,!this.hdr||!W)return;this.nVox3D=this.hdr.dims[1]*this.hdr.dims[2]*this.hdr.dims[3];const q=this.nVox3D*(this.hdr.numBitsPerVoxel/8),Y=W.byteLength/q;if(Y!==this.nFrame4D&&(Y>0&&Y*q===W.byteLength?log$4.debug("Loading the first "+Y+" of "+this.nFrame4D+" volumes"):log$4.warn("This header does not match voxel data",this.hdr,W.byteLength),this.nFrame4D=Y),(this.hdr.intent_code===1007||this.hdr.intent_code===2003)&&this.nFrame4D===3&&this.hdr.datatypeCode===16){const m=new Float32Array(W).slice();this.hdr.datatypeCode=2304,this.nFrame4D=1;for(let me=4;me<7;me++)this.hdr.dims[me]=1;this.hdr.dims[0]=3,W=new Uint8Array(this.nVox3D*4);let Z=1;for(let me=0;me0)*1,Fe=+(Se>0)*2,De=+(xe>0)*4;let Ze=248+we+Fe+De;Math.abs(pe)+Math.abs(Se)+Math.abs(xe)<.1&&(Ze=0),W[fe+3]=Ze,fe+=4}}(this.hdr.pixDims[1]===0||this.hdr.pixDims[2]===0||this.hdr.pixDims[3]===0)&&log$4.error("pixDims not plausible",this.hdr),(isNaN(this.hdr.scl_slope)||this.hdr.scl_slope===0)&&(this.hdr.scl_slope=1),isNaN(this.hdr.scl_inter)&&(this.hdr.scl_inter=0);let X=isAffineOK(this.hdr.affine);if(S||!X||this.hdr.qform_code>this.hdr.sform_code){log$4.debug("spatial transform based on QForm");const Q=this.hdr.quatern_b,m=this.hdr.quatern_c,Z=this.hdr.quatern_d,ee=Math.sqrt(1-(Math.pow(Q,2)+Math.pow(m,2)+Math.pow(Z,2))),oe=this.hdr.pixDims[0]===0?1:this.hdr.pixDims[0],fe=[[ee*ee+Q*Q-m*m-Z*Z,2*Q*m-2*ee*Z,2*Q*Z+2*ee*m],[2*Q*m+2*ee*Z,ee*ee+m*m-Q*Q-Z*Z,2*m*Z-2*ee*Q],[2*Q*Z-2*ee*m,2*m*Z+2*ee*Q,ee*ee+Z*Z-m*m-Q*Q]],me=this.hdr.affine;for(let pe=0;pe<3;pe+=1)for(let Se=0;Se<3;Se+=1)me[pe][Se]=fe[pe][Se]*this.hdr.pixDims[Se+1],Se===2&&(me[pe][Se]*=oe);me[0][3]=this.hdr.qoffset_x,me[1][3]=this.hdr.qoffset_y,me[2][3]=this.hdr.qoffset_z,this.hdr.affine=me}if(X=isAffineOK(this.hdr.affine),!X){log$4.debug("Defective NIfTI: spatial transform does not make sense");let Q=this.hdr.pixDims[1],m=this.hdr.pixDims[2],Z=this.hdr.pixDims[3];(isNaN(Q)||Q===0)&&(Q=1),(isNaN(m)||m===0)&&(m=1),(isNaN(Z)||Z===0)&&(Z=1),this.hdr.pixDims[1]=Q,this.hdr.pixDims[2]=m,this.hdr.pixDims[3]=Z;const ee=[[Q,0,0,0],[0,m,0,0],[0,0,Z,0],[0,0,0,1]];this.hdr.affine=ee}if(this.hdr.datatypeCode!==128&&this.hdr.datatypeCode!==2304&&this.hdr.littleEndian!==isPlatformLittleEndian()&&this.hdr.numBitsPerVoxel>8){if(this.hdr.numBitsPerVoxel===16){const Q=new Uint16Array(W);for(let m=0;m>8&255)<<16>>16}}else if(this.hdr.numBitsPerVoxel===32){const Q=new Uint32Array(W);for(let m=0;m>8&65280|Z>>24&255}}else if(this.hdr.numBitsPerVoxel===64){const Q=this.hdr.numBitsPerVoxel/8,m=new Uint8Array(W);for(let Z=0;Z.01?log$4.warn("Warning voxels not aligned with world space: "+I+` degrees from plumb. +`):I=0,I}calculateOblique(){if(!this.matRAS)throw new Error("matRAS not defined");if(this.pixDimsRAS===void 0)throw new Error("pixDimsRAS not defined");if(!this.dimsRAS)throw new Error("dimsRAS not defined");this.oblique_angle=this.computeObliqueAngle(this.matRAS);const n=this.vox2mm([0,0,0],this.matRAS),s=this.vox2mm([1/this.pixDimsRAS[1],0,0],this.matRAS),c=this.vox2mm([0,1/this.pixDimsRAS[2],0],this.matRAS),f=this.vox2mm([0,0,1/this.pixDimsRAS[3]],this.matRAS);subtract$1(s,s,n),subtract$1(c,c,n),subtract$1(f,f,n);const g=fromValues$3(s[0],s[1],s[2],0,c[0],c[1],c[2],0,f[0],f[1],f[2],0,0,0,0,1);this.obliqueRAS=clone$3(g);const A=Math.abs(90-angle(s,c)*(180/Math.PI)),v=Math.abs(90-angle(s,f)*(180/Math.PI)),y=Math.abs(90-angle(c,f)*(180/Math.PI));this.maxShearDeg=Math.max(Math.max(A,v),y),this.maxShearDeg>.1&&log$4.warn("Warning: voxels are rhomboidal, maximum shear is %f degrees.",this.maxShearDeg);const T=fromValues$1(this.dimsRAS[1],this.dimsRAS[2],this.dimsRAS[3],1),I=clone$3(this.matRAS);transpose$3(I,I);const S=fromValues$1(-.5,-.5,-.5,0);translate(I,I,fromValues$2(S[0],S[1],S[2])),I[0]*=T[0],I[1]*=T[0],I[2]*=T[0],I[4]*=T[1],I[5]*=T[1],I[6]*=T[1],I[8]*=T[2],I[9]*=T[2],I[10]*=T[2],this.frac2mm=clone$3(I);const k=this.pixDimsRAS[1],e=this.pixDimsRAS[2],N=this.pixDimsRAS[3],M=clone$3(I);M[0]=k*T[0],M[1]=0,M[2]=0,M[4]=0,M[5]=e*T[1],M[6]=0,M[8]=0,M[9]=0,M[10]=N*T[2];const O=this.mm2vox([0,0,0],!0);M[12]=(-O[0]-.5)*k,M[13]=(-O[1]-.5)*e,M[14]=(-O[2]-.5)*N,this.frac2mmOrtho=clone$3(M),this.extentsMinOrtho=[M[12],M[13],M[14]],this.extentsMaxOrtho=[M[0]+M[12],M[5]+M[13],M[10]+M[14]],this.mm2ortho=create$3(),invert(this.mm2ortho,g)}THD_daxes_to_NIFTI(n,s,c){const f=this.hdr;if(f===null)throw new Error("HDR is not set");f.sform_code=2;const g="xxyyzzg";let A=-1,v=-1,y=-1;const T=["x","y","z"];T[0]=g[c[0]],T[1]=g[c[1]],T[2]=g[c[2]];const I=n.slice(0,3),S=s.slice(0,3);for(let k=0;k<3;k++)T[k]==="x"?A=k:T[k]==="y"?v=k:y=k;A<0||v<0||y<0||A===v||A===y||v===y||(f.pixDims[1]=Math.abs(I[0]),f.pixDims[2]=Math.abs(I[1]),f.pixDims[3]=Math.abs(I[2]),f.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],f.affine[0][A]=-I[A],f.affine[1][v]=-I[v],f.affine[2][y]=I[y],f.affine[0][3]=-S[A],f.affine[1][3]=-S[v],f.affine[2][3]=S[y])}SetPixDimFromSForm(){if(!this.hdr)throw new Error("hdr not defined");const n=this.hdr.affine,s=fromValues$3(n[0][0],n[0][1],n[0][2],n[0][3],n[1][0],n[1][1],n[1][2],n[1][3],n[2][0],n[2][1],n[2][2],n[2][3],n[3][0],n[3][1],n[3][2],n[3][3]),c=this.vox2mm([0,0,0],s),f=this.vox2mm([1,0,0],s);subtract$1(f,f,c);const g=this.vox2mm([0,1,0],s);subtract$1(g,g,c);const A=this.vox2mm([0,0,1],s);subtract$1(A,A,c),this.hdr.pixDims[1]=length$1(f),this.hdr.pixDims[2]=length$1(g),this.hdr.pixDims[3]=length$1(A)}readDICOM(n){if(this.series=new daikon.Series,Array.isArray(n))for(let S=0;S1&&(s.dims[3]>1&&log$4.debug("To Do: multiple slices per file and multiple files (XA30 DWI)"),s.dims[3]=this.series.images.length);const c=this.series.images[0].getPixelSpacing();if(s.pixDims[1]=c[0],s.pixDims[2]=c[1],this.series.images.length>1){const S=fromValues$2(...this.series.images[0].getImagePosition()),k=fromValues$2(...this.series.images[1].getImagePosition()),e=fromValues$2(0,0,0);subtract$1(e,S,k),s.pixDims[3]=length$1(e)}else s.pixDims[3]=this.series.images[0].getSliceThickness();s.pixDims[4]=this.series.images[0].getTR()/1e3;const f=this.series.images[0].getDataType(),g=this.series.images[0].getBitsAllocated();s.numBitsPerVoxel=g,this.hdr.littleEndian=this.series.images[0].littleEndian,g===8&&f===2?s.datatypeCode=256:g===8&&f===3?s.datatypeCode=2:g===16&&f===2?s.datatypeCode=4:g===16&&f===3?s.datatypeCode=512:g===32&&f===2?s.datatypeCode=8:g===32&&f===3?s.datatypeCode=768:g===32&&f===4?s.datatypeCode=16:g===64&&f===4?s.datatypeCode=64:g===1?s.datatypeCode=1:log$4.warn("Unsupported DICOM format: "+f+" "+g);const A=s.pixDims.slice(1,4),v=getBestTransform(this.series.images[0].getImageDirections(),A,this.series.images[0].getImagePosition());v&&(s.sform_code=1,s.affine=[[v[0][0],v[0][1],v[0][2],v[0][3]],[v[1][0],v[1][1],v[1][2],v[1][3]],[v[2][0],v[2][1],v[2][2],v[2][3]],[0,0,0,1]]);let y,T=this.series.validatePixelDataLength(this.series.images[0]);const I=new Uint8Array(new ArrayBuffer(T*this.series.images.length));for(let S=0;S14)throw new Error("Not a valid ECAT file");let A=512,v=0;const y=[];let T=new Float32Array;for(;;){const I=c.getInt32(A,!1),S=c.getInt32(A+12,!1);if(I+S!==31)break;let k=A+20,e=0,N=0;for(;e<31&&(N=c.getInt32(k,!1),k+=16,N!==0);){e++;let M=N*512;const O=M-512,U=c.getUint16(O,!1);s.dims[1]=c.getUint16(O+4,!1),s.dims[2]=c.getUint16(O+6,!1),s.dims[3]=c.getUint16(O+8,!1);const B=c.getFloat32(O+26,!1);s.pixDims[1]=c.getFloat32(O+34,!1)*10,s.pixDims[2]=c.getFloat32(O+38,!1)*10,s.pixDims[3]=c.getFloat32(O+42,!1)*10,s.pixDims[4]=c.getUint32(O+46,!1)/1e3,y.push(s.pixDims[4]);const V=s.dims[1]*s.dims[2]*s.dims[3],b=new Float32Array(V);if(U===1)for(let q=0;q1){s.dims[0]=4;let I=!1;for(let S=0;S=4){let A=8+g;const v=c.getUint32(A+88,!0);if(A=A+92,v>0){const y=n.byteLength;for(let T=0;T4)&&log$4.warn("Not a valid MGH file"),I===0?(s.numBitsPerVoxel=8,s.datatypeCode=2):I===4?(s.numBitsPerVoxel=16,s.datatypeCode=4):I===1?(s.numBitsPerVoxel=32,s.datatypeCode=8):I===3&&(s.numBitsPerVoxel=32,s.datatypeCode=16),s.dims[1]=A,s.dims[2]=v,s.dims[3]=y,s.dims[4]=T,T>1&&(s.dims[0]=4),s.pixDims[1]=S,s.pixDims[2]=k,s.pixDims[3]=e,s.vox_offset=284,s.sform_code=1;const m=fromValues$3(N*s.pixDims[1],U*s.pixDims[2],b*s.pixDims[3],0,M*s.pixDims[1],B*s.pixDims[2],W*s.pixDims[3],0,O*s.pixDims[1],V*s.pixDims[2],q*s.pixDims[3],0,0,0,0,1),Z=[s.dims[1]/2,s.dims[2]/2,s.dims[3]/2,1],ee=[0,0,0,0];for(let fe=0;fe<3;fe++){ee[fe]=0;for(let me=0;me<3;me++)ee[fe]=ee[fe]+m[me+fe*4]*Z[me]}s.affine=[[m[0],m[1],m[2],Y-ee[0]],[m[4],m[5],m[6],X-ee[1]],[m[8],m[9],m[10],Q-ee[2]],[0,0,0,1]];const oe=s.dims[1]*s.dims[2]*s.dims[3]*s.dims[4]*(s.numBitsPerVoxel/8);return c.slice(s.vox_offset,s.vox_offset+oe)}readHEAD(n,s){this.hdr=new nifti.NIFTI1;const c=this.hdr;c.dims[0]=3,c.pixDims=[1,1,1,1,1,0,0,0];let f=[0,0,0],g=[0,0,0],A=[1,1,1];const y=new TextDecoder().decode(n).split(/\r?\n/),T=(n.byteLength+8)%16,I=n.byteLength+(16-T);log$4.debug(n.byteLength,"len",I);const S=new Uint8Array(I);S.fill(0),S.set(new Uint8Array(n));const k=new nifti.NIFTIEXTENSION(I+8,42,S,!0);c.addExtension(k),c.extensionCode=42,c.extensionFlag[0]=1,c.extensionSize=I+8;const e=y.length;let N=0,M=!1;for(;N2&&(M=M.slice(2)),y.startsWith("BinaryDataByteOrderMSB")&&M[0].includes("False")&&(T.littleEndian=!0),y.startsWith("BinaryDataByteOrderMSB")&&M[0].includes("True")&&(T.littleEndian=!1),y.startsWith("CompressedData")&&M[0].includes("True")&&(I=!0),y.startsWith("TransformMatrix"))for(let O=0;O<9;O++)k[O]=parseFloat(M[O]);if(y.startsWith("Offset"))for(let O=0;O2||Z.length!==4)break;c.affine[I][0]=parseFloat(Z[0]),c.affine[I][1]=parseFloat(Z[1]),c.affine[I][2]=parseFloat(Z[2]),c.affine[I][3]=parseFloat(Z[3]),I++;break;case"RepetitionTime":S=parseFloat(Z[0]);break;case"file":k=!Z[0].startsWith(". "),k||(Z=Z[0].split(" "),c.vox_offset=parseInt(Z[1]));break}}const e=c.dims[0];e>5&&log$4.warn("reader only designed for a maximum of 5 dimensions (XYZTD)");let N=1;for(let Z=0;Z0&&(c.pixDims[4]=S),k&&!s&&log$4.warn("MIH header provided without paired image data");let M;s&&k?M=s.slice(0):M=n.slice(c.vox_offset,c.vox_offset+N*(c.numBitsPerVoxel/8)),T.length!==c.dims[0]&&log$4.warn("dims does not match layout");let O=1;const U=[1,1,1,1,1],B=[!1,!1,!1,!1,!1];for(let Z=0;Zc[0]&&(f[0]=2),c[6]>c[0]&&c[6]>c[3]&&(f[0]=3),f[1]=1,f[0]===1?c[4]>c[7]?f[1]=2:f[1]=3:f[0]===2?c[1]>c[7]?f[1]=1:f[1]=3:c[1]>c[4]?f[1]=1:f[1]=2,f[2]=6-f[1]-f[0];let g=[1,2,3];g[f[0]-1]=1,g[f[1]-1]=2,g[f[2]-1]=3;let A=fromValues$3(n[0][0],n[0][1],n[0][2],n[0][3],n[1][0],n[1][1],n[1][2],n[1][3],n[2][0],n[2][1],n[2][2],n[2][3],0,0,0,1);this.mm000=this.vox2mm([-.5,-.5,-.5],A),this.mm100=this.vox2mm([s.dims[1]-.5,-.5,-.5],A),this.mm010=this.vox2mm([-.5,s.dims[2]-.5,-.5],A),this.mm001=this.vox2mm([-.5,-.5,s.dims[3]-.5],A);const v=create$3();copy$1(v,A);for(let O=0;O<3;O++)for(let U=0;U<3;U++)v[O*4+U]=A[O*4+g[U]-1];const y=[0,0,0];v[0]<0&&(y[0]=1),v[5]<0&&(y[1]=1),v[10]<0&&(y[2]=1),this.dimsRAS=[s.dims[0],s.dims[g[0]],s.dims[g[1]],s.dims[g[2]]],this.pixDimsRAS=[s.pixDims[0],s.pixDims[g[0]],s.pixDims[g[1]],s.pixDims[g[2]]],this.permRAS=g.slice();for(let O=0;O<3;O++)y[O]===1&&(this.permRAS[O]=-this.permRAS[O]);if(this.arrayEquals(g,[1,2,3])&&this.arrayEquals(y,[0,0,0])){this.toRAS=create$3(),this.matRAS=clone$3(A),this.calculateOblique(),this.img2RASstep=[1,this.dimsRAS[1],this.dimsRAS[1]*this.dimsRAS[2]],this.img2RASstart=[0,0,0];return}identity$2(A),A[0+0*4]=1-y[0]*2,A[1+1*4]=1-y[1]*2,A[2+2*4]=1-y[2]*2,A[3+0*4]=(s.dims[g[0]]-1)*y[0],A[3+1*4]=(s.dims[g[1]]-1)*y[1],A[3+2*4]=(s.dims[g[2]]-1)*y[2];const T=create$3();invert(T,A),multiply$2(T,T,v),this.matRAS=clone$3(T),A=fromValues$3(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1),A[g[0]-1+0*4]=-y[0]*2+1,A[g[1]-1+1*4]=-y[1]*2+1,A[g[2]-1+2*4]=-y[2]*2+1,A[3+0*4]=y[0],A[3+1*4]=y[1],A[3+2*4]=y[2],this.toRAS=clone$3(A),A[3]=0,A[7]=0,A[11]=0,A[12]=0,(this.permRAS[0]===-1||this.permRAS[1]===-1||this.permRAS[2]===-1)&&(A[12]=s.dims[1]-1),A[13]=0,(this.permRAS[0]===-2||this.permRAS[1]===-2||this.permRAS[2]===-2)&&(A[13]=s.dims[2]-1),A[14]=0,(this.permRAS[0]===-3||this.permRAS[1]===-3||this.permRAS[2]===-3)&&(A[14]=s.dims[3]-1),this.toRASvox=clone$3(A),log$4.debug(this.hdr.dims),log$4.debug(this.dimsRAS);const I=this.hdr;g=this.permRAS;const S=[Math.abs(g[0]),Math.abs(g[1]),Math.abs(g[2])],k=[I.dims[S[0]],I.dims[S[1]],I.dims[S[2]]],e=[1,I.dims[1],I.dims[1]*I.dims[2]],N=[e[S[0]-1],e[S[1]-1],e[S[2]-1]],M=[0,0,0];for(let O=0;O<3;O++)g[O]<0&&(M[O]=N[O]*(k[O]-1),N[O]=-N[O]);this.img2RASstep=N,this.img2RASstart=M,this.calculateOblique()}img2RAS(){if(!this.permRAS)throw new Error("permRAS undefined");if(!this.img)throw new Error("img undefined");if(!this.hdr)throw new Error("hdr undefined");const n=this.permRAS.slice();if(n[0]===1&&n[1]===2&&n[2]===3)return this.img;const s=this.hdr,c=this.img.slice(0,s.dims[1]*s.dims[1]*s.dims[2]*s.dims[3]),f=[Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])],g=[s.dims[f[0]],s.dims[f[1]],s.dims[f[2]]],A=[1,s.dims[1],s.dims[1]*s.dims[2]],v=[A[f[0]-1],A[f[1]-1],A[f[2]-1]],y=[0,0,0];for(let I=0;I<3;I++)n[I]<0&&(y[I]=v[I]*(g[I]-1),v[I]=-v[I]);let T=0;for(let I=0;Ic===s[f])}setColormap(n){this._colormap=n,this.calMinMax(),this.onColormapChange&&this.onColormapChange(this)}setColormapLabel(n){this.colormapLabel=cmapper.makeLabelLut(n)}async setColormapLabelFromUrl(n){this.colormapLabel=await cmapper.makeLabelLutFromUrl(n)}get colormap(){return this._colormap}get colorMap(){return this._colormap}set colormap(n){this.setColormap(n)}set colorMap(n){this.setColormap(n)}get opacity(){return this._opacity}set opacity(n){this._opacity=n,this.onOpacityChange&&this.onOpacityChange(this)}calMinMax(){if(!this.hdr)throw new Error("hdr undefined");if(!this.img)throw new Error("img undefined");let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,c=0,f=0;const g=this.img.length,A=this.img.constructor!==Float64Array&&this.img.constructor!==Float32Array&&this.ignoreZeroVoxels;if(A)for(let Y=0;Ythis.hdr.cal_min)return this.cal_min=this.hdr.cal_min,this.cal_max=this.hdr.cal_max,this.robust_min=this.cal_min,this.robust_max=this.cal_max,this.global_min=v,this.global_max=y,[this.hdr.cal_min,this.hdr.cal_max,this.hdr.cal_min,this.hdr.cal_max];if(I!==S)return this.cal_min=I,this.cal_max=S,this.robust_min=this.cal_min,this.robust_max=this.cal_max,[I,S,I,S];const k=100*c/g;let e=!1;k>60&&!this.ignoreZeroVoxels&&(log$4.warn(`${Math.round(k)}% of voxels are zero: ignoring zeros for cal_max`),e=!0,this.ignoreZeroVoxels=!0),this.ignoreZeroVoxels||(c=0),c+=f;const N=Math.round((g-c)*this.percentileFrac);if(N<1||n===s)return log$4.debug("no variability in image intensity?"),this.cal_min=v,this.cal_max=y,this.robust_min=this.cal_min,this.robust_max=this.cal_max,this.global_min=v,this.global_max=y,[v,y,v,y];const M=1001,O=(M-1)/(s-n),U=new Array(M);for(let Y=0;Y0&&(V--,U[V]>0&&(Y=0)),Y!==0&&b0&&(Y=0)),V===0&&b===M-1&&(Y=0)}let W=this.intensityRaw2Scaled(V/O+n),q=this.intensityRaw2Scaled(b/O+n);return this.hdr.cal_min=v&&this.hdr.cal_max<=y&&(W=this.hdr.cal_min,q=this.hdr.cal_max),e&&(W=Math.min(W,0)),this.cal_min=W,this.cal_max=q,this.robust_min=this.cal_min,this.robust_max=this.cal_max,this.global_min=v,this.global_max=y,[W,q,v,y]}intensityRaw2Scaled(n){if(!this.hdr)throw new Error("hdr undefined");return this.hdr.scl_slope===0&&(this.hdr.scl_slope=1),n*this.hdr.scl_slope+this.hdr.scl_inter}intensityScaled2Raw(n){if(!this.hdr)throw new Error("hdr undefined");return this.hdr.scl_slope===0&&(this.hdr.scl_slope=1),(n-this.hdr.scl_inter)/this.hdr.scl_slope}saveToUint8Array(n,s=null){if(!this.hdr)throw new Error("hdr undefined");if(!this.img)throw new Error("img undefined");const c=s!==null,f=hdrToArrayBuffer(this.hdr,c),g=new Uint8Array(4);let A=new Uint8Array(this.img.buffer);c&&(A=new Uint8Array(s.buffer));const v=new Uint8Array(f.length+g.length+A.length);v.set(f),v.set(g,f.length),v.set(A,f.length+g.length);let y=null;return n.endsWith(".gz")?y=gzipSync$1(v,{filename:n,mtime:Date.now(),level:6}):y=v,y}saveToDisk(n="",s=null){const c=this.saveToUint8Array(n,s);if(n==="")return log$4.debug("saveToDisk: empty file name, returning data as Uint8Array rather than triggering download"),c;const f=new Blob([c.buffer],{type:"application/octet-stream"}),g=URL.createObjectURL(f),A=document.createElement("a");return A.setAttribute("href",g),A.setAttribute("download",n),A.style.visibility="hidden",document.body.appendChild(A),A.click(),document.body.removeChild(A),c}static async fetchDicomData(n,s={}){if(n==="")throw Error("url must not be empty");let f=/^(?:[a-z+]+:)?\/\//i.test(n)?n:new URL(n,window.location.href);/(?:.([^.]+))?$/.exec(f.pathname)||(f=new URL("niivue-manifest.txt",n));let v=await fetch(f,{headers:s});if(!v.ok)throw Error(v.statusText);const T=(await v.text()).split(` +`),S=/(.*\/).*/.exec(f)[0],k=[];for(const e of T){const N=new URL(e,S);if(v=await fetch(N,{headers:s}),!v.ok)throw Error(v.statusText);const M=await v.arrayBuffer();k.push(M)}return k}static async fetchPartial(n,s,c={}){try{return await fetch(n,{headers:{range:`bytes=0-'${s}`,stream:"true",...c}})}catch(f){return log$4.error(f),log$4.error("fetchPartial failed, trying again without range header"),await fetch(n,{headers:c})}}static async loadFromUrl({url:n="",urlImgData:s="",headers:c={},name:f="",colormap:g="gray",opacity:A=1,cal_min:v=NaN,cal_max:y=NaN,trustCalMinMax:T=!0,percentileFrac:I=.02,ignoreZeroVoxels:S=!1,useQFormNotSForm:k=!1,colormapNegative:e="",frame4D:N=0,isManifest:M=!1,limitFrames4D:O=NaN,imageType:U=NVIMAGE_TYPE.UNKNOWN,colorbarVisible:B=!0}={}){if(n==="")throw Error("url must not be empty");let V=null,b=null;if(n instanceof Uint8Array&&(n=n.buffer),n instanceof ArrayBuffer){b=n,n="array.nii";const Q=new Uint8Array(b);Q[0]===31&&Q[1]===139&&(n="array.nii.gz")}if(!isNaN(O)){let Q=await this.fetchPartial(n,512,c);b=await Q.arrayBuffer();let m=new Uint8Array(b),Z=!1;m[0]===31&&m[1]===139&&(Z=!0,new Decompress$1(fe=>{m=fe}).push(m),b=m.buffer);let ee=m[0]===92&&m[1]===1;if(ee||(ee=m[1]===92&&m[0]===1),!ee)b=null;else{const oe=nifti.readHeader(b);if(oe===null)throw new Error("could not read nifti header");const fe=oe.numBitsPerVoxel/8;let me=1;for(let we=1;we<4;we++)oe.dims[we]>1&&(me*=oe.dims[we]);let pe=1;for(let we=4;we<7;we++)oe.dims[we]>1&&(pe*=oe.dims[we]);const Se=Math.max(Math.min(O,pe),1),xe=oe.vox_offset+Se*me*fe;if(b.byteLength{we=De}).push(we),b=we.buffer}b.byteLength-1&&(f=f.slice(0,f.indexOf("?")))}let X=null;if(s.length>0){let Q=await fetch(s,{headers:c});Q.status===404&&s.lastIndexOf("BRIK")!==-1&&(Q=await fetch(s+".gz",{headers:c})),X=await Q.arrayBuffer()}if(!b)throw new Error("Unable to load buffer properly from volume");return V=new Zi(b,f,g,A,X,v,y,T,I,S,k,e,N,U),V.url=n,V.colorbarVisible=B,V}static readFileAsync(n,s=NaN){return new Promise((c,f)=>{const g=new FileReader;g.onload=()=>{n.name.lastIndexOf("gz")!==-1&&isNaN(s)?c(nifti.decompress(g.result)):c(g.result)},g.onerror=f,isNaN(s)?g.readAsArrayBuffer(n):g.readAsArrayBuffer(n.slice(0,s))})}static async loadFromFile({file:n,name:s="",colormap:c="gray",opacity:f=1,urlImgData:g=null,cal_min:A=NaN,cal_max:v=NaN,trustCalMinMax:y=!0,percentileFrac:T=.02,ignoreZeroVoxels:I=!1,useQFormNotSForm:S=!1,colormapNegative:k="",frame4D:e=0,limitFrames4D:N=NaN,imageType:M=NVIMAGE_TYPE.UNKNOWN}){let O=null,U=[];try{if(Array.isArray(n))for(let V=0;V{V=Y}).push(V),U=V.buffer);let W=V[0]===92&&V[1]===1;if(W||(W=V[1]===92&&V[0]===1),!W)U=await this.readFileAsync(n);else{const q=nifti.readHeader(U);if(!q)throw new Error("could not read nifti header");const Y=q.numBitsPerVoxel/8;let X=1;for(let ee=1;ee<4;ee++)q.dims[ee]>1&&(X*=q.dims[ee]);let Q=1;for(let ee=4;ee<7;ee++)q.dims[ee]>1&&(Q*=q.dims[ee]);const m=Math.max(Math.min(N,Q),1),Z=q.vox_offset+m*X*Y;if(U.byteLength{ee=fe}).push(ee),U=ee.buffer}if(U.byteLength"u")return g;if(!s){const v=clone$3(this.frac2mmOrtho);return invert(v,v),transformMat4(c,c,v),g[0]=c[0],g[1]=c[1],g[2]=c[2],g}if(f[1]<1||f[2]<1||f[3]<1)return g;const A=clone$3(this.matRAS);return invert(A,A),transpose$3(A,A),transformMat4(c,c,A),g[0]=(c[0]+.5)/f[1],g[1]=(c[1]+.5)/f[2],g[2]=(c[2]+.5)/f[3],g}},DRAG_MODE=(u=>(u[u.none=0]="none",u[u.contrast=1]="contrast",u[u.measurement=2]="measurement",u[u.pan=3]="pan",u[u.slicer3D=4]="slicer3D",u[u.callbackOnly=5]="callbackOnly",u))(DRAG_MODE||{}),DEFAULT_OPTIONS={textHeight:.06,colorbarHeight:.05,crosshairWidth:1,crosshairGap:0,rulerWidth:4,show3Dcrosshair:!1,backColor:[0,0,0,1],crosshairColor:[1,0,0,1],fontColor:[.5,.5,.5,1],selectionBoxColor:[1,1,1,.5],clipPlaneColor:[.7,0,.7,.5],rulerColor:[1,0,0,.8],colorbarMargin:.05,trustCalMinMax:!0,clipPlaneHotKey:"KeyC",viewModeHotKey:"KeyV",doubleTouchTimeout:500,longTouchTimeout:1e3,keyDebounceTime:50,isNearestInterpolation:!1,isResizeCanvas:!0,atlasOutline:0,isRuler:!1,isColorbar:!1,isOrientCube:!1,multiplanarPadPixels:0,multiplanarForceRender:!1,isRadiologicalConvention:!1,meshThicknessOn2D:1/0,dragMode:1,yoke3Dto2DZoom:!1,isDepthPickMesh:!1,isCornerOrientationText:!1,sagittalNoseLeft:!1,isSliceMM:!1,isV1SliceShader:!1,isHighResolutionCapable:!0,logLevel:"info",loadingText:"waiting for images...",isForceMouseClickToVoxelCenters:!1,dragAndDropEnabled:!0,drawingEnabled:!1,penValue:1,floodFillNeighbors:6,isFilledPen:!1,thumbnail:"",maxDrawUndoBitmaps:8,sliceType:3,meshXRay:0,isAntiAlias:null,limitFrames4D:NaN,isAdditiveBlend:!1,showLegend:!0,legendBackgroundColor:[.3,.3,.3,.5],legendTextColor:[1,1,1,1],multiplanarLayout:0,renderOverlayBlend:1},NVDocument=class Ji{constructor(){__publicField(this,"data",{title:"Untitled document",imageOptionsArray:[],meshOptionsArray:[],opts:{...DEFAULT_OPTIONS},previewImageDataURL:"",labels:[],encodedImageBlobs:[],encodedDrawingBlob:""}),__publicField(this,"scene"),__publicField(this,"volumes",[]),__publicField(this,"meshDataObjects"),__publicField(this,"meshes",[]),__publicField(this,"drawBitmap",null),__publicField(this,"imageOptionsMap",new Map),__publicField(this,"meshOptionsMap",new Map),this.scene={onAzimuthElevationChange:()=>{},onZoom3DChange:()=>{},sceneData:{azimuth:110,elevation:10,crosshairPos:[.5,.5,.5],clipPlane:[0,0,0,0],clipPlaneDepthAziElev:[2,0,0],volScaleMultiplier:1,pan2Dxyzmm:[0,0,0,1]},get renderAzimuth(){return this.sceneData.azimuth},set renderAzimuth(n){this.sceneData.azimuth=n,this.onAzimuthElevationChange&&this.onAzimuthElevationChange(this.sceneData.azimuth,this.sceneData.elevation)},get renderElevation(){return this.sceneData.elevation},set renderElevation(n){this.sceneData.elevation=n,this.onAzimuthElevationChange&&this.onAzimuthElevationChange(this.sceneData.azimuth,this.sceneData.elevation)},get volScaleMultiplier(){return this.sceneData.volScaleMultiplier},set volScaleMultiplier(n){this.sceneData.volScaleMultiplier=n,this.onZoom3DChange(n)},get crosshairPos(){return this.sceneData.crosshairPos},set crosshairPos(n){this.sceneData.crosshairPos=n},get clipPlane(){return this.sceneData.clipPlane},set clipPlane(n){this.sceneData.clipPlane=n},get clipPlaneDepthAziElev(){return this.sceneData.clipPlaneDepthAziElev},set clipPlaneDepthAziElev(n){this.sceneData.clipPlaneDepthAziElev=n},get pan2Dxyzmm(){return this.sceneData.pan2Dxyzmm},set pan2Dxyzmm(n){this.sceneData.pan2Dxyzmm=n}}}get title(){return this.data.title}get previewImageDataURL(){return this.data.previewImageDataURL}set previewImageDataURL(n){this.data.previewImageDataURL=n}set title(n){this.data.title=n}get imageOptionsArray(){return this.data.imageOptionsArray}get encodedImageBlobs(){return this.data.encodedImageBlobs}get encodedDrawingBlob(){return this.data.encodedDrawingBlob}get opts(){return this.data.opts}set opts(n){this.data.opts={...n}}get labels(){return this.data.labels}set labels(n){this.data.labels=n}hasImage(n){return this.volumes.find(s=>s.id===n.id)!==void 0}hasImageFromUrl(n){return this.data.imageOptionsArray.find(s=>s.url===n)!==void 0}addImageOptions(n,s){if(!this.hasImage(n)&&!s.name)if(s.url){const f=/^(?:[a-z+]+:)?\/\//i.test(s.url)?new URL(s.url):new URL(s.url,window.location.href);s.name=f.pathname.split("/").pop(),s.name.toLowerCase().endsWith(".gz")&&(s.name=s.name.slice(0,-3)),s.name.toLowerCase().endsWith(".nii")||(s.name+=".nii")}else s.name="untitled.nii";s.imageType=NVIMAGE_TYPE.NII,this.data.imageOptionsArray.push(s),this.imageOptionsMap.set(n.id,this.data.imageOptionsArray.length-1)}removeImage(n){if(this.imageOptionsMap.has(n.id)){const s=this.imageOptionsMap.get(n.id);this.data.imageOptionsArray.length>s&&this.data.imageOptionsArray.splice(s,1),this.imageOptionsMap.delete(n.id)}this.volumes=this.volumes.filter(s=>s.id!==n.id)}getImageOptions(n){return this.imageOptionsMap.has(n.id)?this.data.imageOptionsArray[this.imageOptionsMap.get(n.id)]:null}json(){const n={encodedImageBlobs:[],previewImageDataURL:this.data.previewImageDataURL,imageOptionsMap:new Map},s=[];if(n.sceneData={...this.scene.sceneData},n.opts={...this.opts},this.opts.meshThicknessOn2D===1/0&&(n.opts.meshThicknessOn2D="infinity"),n.labels=[...this.data.labels],this.volumes.length){let f=this.imageOptionsArray[0];if(f||(log$4.debug("no image options for base image"),f={name:"",colormap:"gray",opacity:1,pairedImgData:null,cal_min:NaN,cal_max:NaN,trustCalMinMax:!0,percentileFrac:.02,ignoreZeroVoxels:!1,useQFormNotSForm:!1,colormapNegative:"",colormapLabel:[],imageType:NVIMAGE_TYPE.NII,frame4D:0,limitFrames4D:NaN,url:"",urlImageData:"",alphaThreshold:!1,cal_minNeg:NaN,cal_maxNeg:NaN,colorbarVisible:!0}),f.colormap=this.volumes[0].colormap,f.opacity=this.volumes[0].opacity,f.cal_max=this.volumes[0].cal_max||NaN,f.cal_min=this.volumes[0].cal_min||NaN,f){s.push(f);const g=NVUtilities.uint8tob64(this.volumes[0].toUint8Array());n.encodedImageBlobs.push(g),this.drawBitmap&&(n.encodedDrawingBlob=NVUtilities.uint8tob64(this.volumes[0].toUint8Array(this.drawBitmap))),n.imageOptionsMap.set(this.volumes[0].id,0)}else throw new Error("image options for base layer not found");for(let g=1;g({values:A.values,nFrame4D:A.nFrame4D,frame4D:0,outlineBorder:A.outlineBorder,global_min:A.global_min,global_max:A.global_max,cal_min:A.cal_min,cal_max:A.cal_max,opacity:A.opacity,colormap:A.colormap,colormapNegative:A.colormapNegative,colormapLabel:A.colormapLabel,useNegativeCmap:A.useNegativeCmap})),hasConnectome:f.hasConnectome,edgeColormap:f.edgeColormap,edgeColormapNegative:f.edgeColormapNegative,edgeMax:f.edgeMax,edgeMin:f.edgeMin,edges:f.edges&&Array.isArray(f.edges)?[...f.edges]:[],extentsMax:f.extentsMax,extentsMin:f.extentsMin,fiberGroupColormap:f.fiberGroupColormap,furthestVertexFromOrigin:f.furthestVertexFromOrigin,nodeColormap:f.nodeColormap,nodeColormapNegative:f.nodeColormapNegative,nodeMaxColor:f.nodeMaxColor,nodeMinColor:f.nodeMinColor,nodeScale:f.nodeScale,legendLineThickness:f.legendLineThickness,offsetPt0:f.offsetPt0,nodes:f.nodes};c.push(g)}return n.meshesString=JSON.stringify(serialize(c)),n}download(n){const s=this.json();NVUtilities.download(JSON.stringify(s),n,"application/json")}static deserializeMeshDataObjects(n){if(n.data.meshesString){n.meshDataObjects=deserialize$1(JSON.parse(n.data.meshesString));for(const s of n.meshDataObjects)for(const c of s.layers)"colorMap"in c&&(c.colormap=c.colorMap,delete c.colorMap),"colorMapNegative"in c&&(c.colormapNegative=c.colorMapNegative,delete c.colorMapNegative)}}static async loadFromUrl(n){const c=await(await fetch(n)).json();return Ji.loadFromJSON(c)}static async loadFromFile(n){const s=await NVUtilities.readFileAsync(n),c=new Ji,g=new TextDecoder().decode(s);return c.data=JSON.parse(g),Ji.deserializeMeshDataObjects(c),c}static loadFromJSON(n){const s=new Ji;return s.data=n,s.data.opts.meshThicknessOn2D==="infinity"&&(s.data.opts.meshThicknessOn2D=1/0),s.scene.sceneData=n.sceneData,Ji.deserializeMeshDataObjects(s),s}},NVLabel3D=class{constructor(u,n,s){__publicField(this,"text"),__publicField(this,"style"),__publicField(this,"points"),this.text=u,this.style=n,this.points=s}},defaultOptions={name:"untitled connectome",nodeColormap:"warm",nodeColormapNegative:"winter",nodeMinColor:0,nodeMaxColor:4,nodeScale:3,edgeColormap:"warm",edgeColormapNegative:"winter",edgeMin:2,edgeMax:6,edgeScale:1,legendLineThickness:0},NVConnectome=class Uo extends NVMesh{constructor(n,s){super(new Float32Array([]),new Uint32Array([]),s.name,new Uint8Array([]),1,!0,n,s),__publicField(this,"gl"),__publicField(this,"nodesChanged"),this.gl=n,this.type="connectome",this.nodes&&this.updateLabels(),this.nodesChanged=new EventTarget}static convertLegacyConnectome(n){const s={nodes:[],edges:[],...defaultOptions};for(const f in n)if(f in defaultOptions){const g=f;s[g]=n[g]}const c=n.nodes;for(let f=0;f({name:Array.isArray(A.comments)&&A.comments.length>0&&"text"in A.comments[0]?A.comments[0].text:"",x:A.coordinates.x,y:A.coordinates.y,z:A.coordinates.z,colorValue:1,sizeValue:1,metadata:A.comments}));return{...defaultOptions,nodeColormap:s,edgeColormap:s,nodes:f,edges:[]}}updateLabels(){const n=this.nodes;if(n&&n.length>0){const s=n.reduce((T,I)=>T.sizeValue>I.sizeValue?T:I).sizeValue,c=this.nodeMinColor?this.nodeMinColor:n.reduce((T,I)=>T.colorValueT.colorValue>I.colorValue?T:I).colorValue,g=cmapper.colormap(this.nodeColormap,this.colormapInvert),A=cmapper.colormap(this.nodeColormapNegative,this.colormapInvert),v="nodeColormapNegative"in this,y=this.legendLineThickness?this.legendLineThickness:0;for(let T=0;Te/255),log$4.debug("adding label for ",n[T]),n[T].label=new NVLabel3D(n[T].name,{textColor:k,bulletScale:n[T].sizeValue/s,bulletColor:k,lineWidth:y,lineColor:k,textScale:1,textAlignment:"left",lineTerminator:"none"},[n[T].x,n[T].y,n[T].z]),log$4.debug("label for node:",n[T].label)}}}addConnectomeNode(n){if(log$4.debug("adding node",n),!this.nodes)throw new Error("nodes not defined");this.nodes.push(n),this.updateLabels(),this.nodesChanged.dispatchEvent(new CustomEvent("nodeAdded",{detail:{node:n}}))}deleteConnectomeNode(n){const s=this.nodes.indexOf(n),c=this.edges;c&&(this.edges=c.filter(f=>f.first!==s&&f.second!==s)),this.nodes=this.nodes.filter(f=>f!==n),this.updateLabels(),this.updateConnectome(this.gl),this.nodesChanged.dispatchEvent(new CustomEvent("nodeDeleted",{detail:{node:n}}))}updateConnectomeNodeByIndex(n,s){this.nodes[n]=s,this.updateLabels(),this.updateConnectome(this.gl),this.nodesChanged.dispatchEvent(new CustomEvent("nodeChanged",{detail:{node:s}}))}updateConnectomeNodeByPoint(n,s){const c=this.nodes;if(!c)throw new Error("Node to update does not exist");const f=c.find(A=>NVUtilities.arraysAreEqual([A.x,A.y,A.z],n));if(!f)throw new Error(`Node with point ${n} to update does not exist`);const g=c.findIndex(A=>A===f);this.updateConnectomeNodeByIndex(g,s)}addConnectomeEdge(n,s,c){const f=this.edges;let g=f.find(A=>(A.first===n||A.second===n)&&A.first+A.second===n+s);return g||(g={first:n,second:s,colorValue:c},f.push(g),this.updateConnectome(this.gl),g)}deleteConnectomeEdge(n,s){const c=this.edges,f=c.find(g=>(g.first===n||g.first===s)&&g.first+g.second===n+s);if(f)this.edges=c.filter(g=>g!==f);else throw new Error(`edge between ${n} and ${s} not found`);return this.updateConnectome(this.gl),f}findClosestConnectomeNode(n,s){const c=this.nodes;if(!c||c.length===0)return null;const f=c.map((g,A)=>({node:g,distance:Math.sqrt(Math.pow(g.x-n[0],2)+Math.pow(g.y-n[1],2)+Math.pow(g.z-n[2],2)),index:A})).filter(g=>g.distanceg.distance-A.distance);return f.length>0?f[0].node:null}updateConnectome(n){const s=[],c=[],f=[];let g=cmapper.colormap(this.nodeColormap,this.colormapInvert),A=cmapper.colormap(this.nodeColormapNegative,this.colormapInvert),v="nodeColormapNegative"in this;if(this.nodeMinColor===void 0||this.nodeMaxColor===void 0)throw new Error("nodeMinColor or nodeMaxColor is undefined");if(this.edgeMin===void 0||this.edgeMax===void 0)throw new Error("edgeMin or edgeMax undefined");let y=this.nodeMinColor,T=this.nodeMaxColor;const I=this.nodes,S=I.length;for(let U=0;Ug&&([f,g]=[g,f]),[f,g]}function swizzleVec3(u,n=[0,1,2]){const s=create$2();return s[0]=u[n[0]],s[1]=u[n[1]],s[2]=u[n[2]],s}function isRadiological(u){const n=fromValues$1(1,0,0,0),s=create$1();return transformMat4(s,n,u),s[0]}function unProject(u,n,s,c){const f=fromValues$1(u,n,s,1),g=clone$3(c);invert(g,g),f[0]=f[0]*2-1,f[1]=f[1]*2-1,f[2]=f[2]*2-1;const A=create$1();return transformMat4(A,f,g),A[3]===0||(A[0]/=A[3],A[1]/=A[3],A[2]/=A[3]),A}function unpackFloatFromVec4i(u){const n=[5960464477539063e-23,152587890625e-16,.00390625,1];return(u[0]*n[0]+u[1]*n[1]+u[2]*n[2]+u[3]*n[3])/255}function clamp$1(u,n,s){return Math.min(Math.max(u,n),s)}function encodeRLE(u){const n=u.length;let s=0;const c=new Uint8Array(n+Math.ceil(.01*n)),f=new Int8Array(c.buffer);let g=0;for(;s1){f[g]=-v+1,g++,c[g]=A,g++;continue}for(;s127||s+2 "+g+" bytes (x"+n/g+")"),c.slice(0,g)}function decodeRLE(u,n){const s=new Uint8Array(u.buffer),c=new Int8Array(s.buffer);let f=0;const g=new Uint8Array(n);let A=0;for(;f{}),__publicField(this,"onMouseUp",()=>{}),__publicField(this,"onLocationChange",()=>{}),__publicField(this,"onIntensityChange",()=>{}),__publicField(this,"onImageLoaded",()=>{}),__publicField(this,"onMeshLoaded",()=>{}),__publicField(this,"onFrameChange",()=>{}),__publicField(this,"onError",()=>{}),__publicField(this,"onColormapChange",()=>{}),__publicField(this,"onInfo",()=>{}),__publicField(this,"onWarn",()=>{}),__publicField(this,"onDebug",()=>{}),__publicField(this,"onVolumeAddedFromUrl",()=>{}),__publicField(this,"onVolumeWithUrlRemoved",()=>{}),__publicField(this,"onVolumeUpdated",()=>{}),__publicField(this,"onMeshAddedFromUrl",()=>{}),__publicField(this,"onMeshAdded",()=>{}),__publicField(this,"onMeshWithUrlRemoved",()=>{}),__publicField(this,"onZoom3DChange",()=>{}),__publicField(this,"onAzimuthElevationChange",()=>{}),__publicField(this,"onClipPlaneChange",()=>{}),__publicField(this,"onCustomMeshShaderAdded",()=>{}),__publicField(this,"onMeshShaderChanged",()=>{}),__publicField(this,"onMeshPropertyChanged",()=>{}),__publicField(this,"onDocumentLoaded",()=>{}),__publicField(this,"document",new NVDocument),__publicField(this,"opts",{...DEFAULT_OPTIONS}),__publicField(this,"scene",{...this.document.scene}),__publicField(this,"mediaUrlMap",new Map),__publicField(this,"initialized",!1),__publicField(this,"currentDrawUndoBitmap"),__publicField(this,"loadingText");for(const s in n)typeof n[s]=="function"?this[s]=n[s]:this.opts[s]=DEFAULT_OPTIONS[s]===void 0?DEFAULT_OPTIONS[s]:n[s];this.opts.isHighResolutionCapable?this.uiData.dpr=window.devicePixelRatio||1:this.uiData.dpr=1,this.currentDrawUndoBitmap=this.opts.maxDrawUndoBitmaps,this.opts.drawingEnabled&&this.createEmptyDrawing(),this.opts.thumbnail.length>0&&(this.thumbnailVisible=!0),this.loadingText=this.opts.loadingText,log$4.setLogLevel(this.opts.logLevel)}get volumes(){return this.document.volumes}set volumes(n){this.document.volumes=n}get meshes(){return this.document.meshes}set meshes(n){this.document.meshes=n}get drawBitmap(){return this.document.drawBitmap}set drawBitmap(n){this.document.drawBitmap=n}get volScaleMultiplier(){return this.scene.volScaleMultiplier}set volScaleMultiplier(n){this.setScale(n)}async saveScene(n="niivue.png"){function s(f,g){const A=document.createElement("a");document.body.appendChild(A),A.style.display="none";const v=window.URL.createObjectURL(f);A.href=v,A.download=g,A.click(),A.remove()}const c=this.canvas;if(!c)throw new Error("canvas not defined");this.drawScene(),c.toBlob(f=>{f&&(n===""&&(n=`niivue-screenshot-${new Date().toString()}.png`,n=n.replace(/\s/g,"_")),s(f,n))})}async attachTo(n,s=null){return await this.attachToCanvas(document.getElementById(n),s),log$4.debug("attached to element with id: ",n),this}async attachToCanvas(n,s=null){return this.canvas=n,s===null&&(s=navigator.hardwareConcurrency>6,log$4.debug("AntiAlias ",s," Threads ",navigator.hardwareConcurrency)),this.gl=this.canvas.getContext("webgl2",{alpha:!0,antialias:s}),log$4.info("NIIVUE VERSION ",version$1),this.canvas.parentElement.style.backgroundColor="black",this.opts.isResizeCanvas&&(this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,window.addEventListener("resize",this.resizeListener.bind(this)),this.resizeObserver=new ResizeObserver(this.resizeListener.bind(this)),this.resizeObserver.observe(this.canvas.parentElement)),this.registerInteractions(),await this.init(),this.drawScene(),this}syncWith(n,s={"2d":!0,"3d":!0}){this.otherNV=n,this.syncOpts=s}broadcastTo(n,s={"2d":!0,"3d":!0}){this.otherNV=n,this.syncOpts=s}sync(){if(!this.gl||!this.otherNV||typeof this.otherNV>"u"||!this.gl.canvas.matches(":focus"))return;const n=this.frac2mm(this.scene.crosshairPos);if(this.otherNV instanceof zo)this.syncOpts["2d"]&&(this.otherNV.scene.crosshairPos=this.otherNV.mm2frac(n)),this.syncOpts["3d"]&&(this.otherNV.scene.renderAzimuth=this.scene.renderAzimuth,this.otherNV.scene.renderElevation=this.scene.renderElevation),this.otherNV.drawScene(),this.otherNV.createOnLocationChange();else if(Array.isArray(this.otherNV))for(let s=0;sc===s[f])}resizeListener(){if(!(!this.canvas||!this.gl)){if(!this.opts.isResizeCanvas){this.opts.isHighResolutionCapable&&(log$4.warn("isHighResolutionCapable requires isResizeCanvas"),this.opts.isHighResolutionCapable=!1),this.uiData.dpr=1,this.drawScene();return}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.opts.isHighResolutionCapable?(this.uiData.dpr=window.devicePixelRatio||1,log$4.debug("devicePixelRatio: "+this.uiData.dpr)):this.uiData.dpr=1,"width"in this.canvas.parentElement?(this.canvas.width=this.canvas.parentElement.width*this.uiData.dpr,this.canvas.height=this.canvas.parentElement.height*this.uiData.dpr):(this.canvas.width=this.canvas.offsetWidth*this.uiData.dpr,this.canvas.height=this.canvas.offsetHeight*this.uiData.dpr),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.drawScene()}}getRelativeMousePosition(n,s){if(s=s||n.target,!s)return;const c=s.getBoundingClientRect();return{x:n.clientX-c.left,y:n.clientY-c.top}}getNoPaddingNoBorderCanvasRelativeMousePosition(n,s){return s=s||n.target,this.getRelativeMousePosition(n,s)}mouseContextMenuListener(n){n.preventDefault()}mouseDownListener(n){n.preventDefault(),this.drawPenLocation=[NaN,NaN,NaN],this.drawPenAxCorSag=-1,this.uiData.mousedown=!0,log$4.debug("mouse down"),log$4.debug(n);const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);if(!s)return;const[c,f]=[s.x*this.uiData.dpr,s.y*this.uiData.dpr],g=this.getLabelAtPoint([c,f]);if(g){for(const A of this.meshes)if(A.type==="connectome")for(const v of A.nodes)v.label===g&&(this.scene.crosshairPos=this.mm2frac([v.x,v.y,v.z]),this.updateGLVolume(),this.drawScene())}this.uiData.clickedTile=this.tileIndex(c,f),n.button===LEFT_MOUSE_BUTTON&&n.shiftKey?(this.uiData.mouseButtonCenterDown=!0,this.mouseCenterButtonHandler(n)):n.button===LEFT_MOUSE_BUTTON?(this.uiData.mouseButtonLeftDown=!0,this.mouseLeftButtonHandler(n)):n.button===RIGHT_MOUSE_BUTTON?(this.uiData.mouseButtonRightDown=!0,this.mouseRightButtonHandler(n)):n.button===CENTER_MOUSE_BUTTON&&(this.uiData.mouseButtonCenterDown=!0,this.mouseCenterButtonHandler(n))}mouseLeftButtonHandler(n){const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);this.mouseDown(s.x,s.y),this.mouseClick(s.x,s.y)}mouseCenterButtonHandler(n){const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);this.mousePos=[s.x*this.uiData.dpr,s.y*this.uiData.dpr],this.opts.dragMode!==0&&(this.setDragStart(s.x,s.y),this.uiData.isDragging||(this.uiData.pan2DxyzmmAtMouseDown=clone$1(this.scene.pan2Dxyzmm)),this.uiData.isDragging=!0,this.uiData.dragClipPlaneStartDepthAziElev=this.scene.clipPlaneDepthAziElev)}mouseRightButtonHandler(n){const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);this.mousePos=[s.x*this.uiData.dpr,s.y*this.uiData.dpr],this.opts.dragMode!==0&&(this.setDragStart(s.x,s.y),this.uiData.isDragging||(this.uiData.pan2DxyzmmAtMouseDown=clone$1(this.scene.pan2Dxyzmm)),this.uiData.isDragging=!0,this.uiData.dragClipPlaneStartDepthAziElev=this.scene.clipPlaneDepthAziElev)}calculateMinMaxVoxIdx(n){if(n.length>2)throw new Error("array must not contain more than two values");return[Math.floor(Math.min(n[0],n[1])),Math.floor(Math.max(n[0],n[1]))]}calculateNewRange({volIdx:n=0}={}){if(this.opts.sliceType===4&&this.sliceMosaicString.length<1||this.uiData.dragStart[0]===this.uiData.dragEnd[0]&&this.uiData.dragStart[1]===this.uiData.dragEnd[1])return;let s=this.canvasPos2frac([this.uiData.dragStart[0],this.uiData.dragStart[1]]);if(s[0]<0)return;const c=this.frac2vox(s,n);if(s=this.canvasPos2frac([this.uiData.dragEnd[0],this.uiData.dragEnd[1]]),s[0]<0)return;const f=this.frac2vox(s,n);let g=-Number.MAX_VALUE,A=Number.MAX_VALUE;const v=this.calculateMinMaxVoxIdx([c[0],f[0]]),y=this.calculateMinMaxVoxIdx([c[1],f[1]]),T=this.calculateMinMaxVoxIdx([c[2],f[2]]);c[0]-f[0]===0?v[1]=c[0]+1:c[1]-f[1]===0?y[1]=c[1]+1:c[2]-f[2]===0&&(T[1]=c[2]+1);const I=this.volumes[n].hdr,S=this.volumes[n].img;if(!I||!S)return;const k=I.dims[1],e=I.dims[2];for(let O=T[0];OS[W]&&(A=S[W]),g=g)return;const N=intensityRaw2Scaled(I,A),M=intensityRaw2Scaled(I,g);this.volumes[n].cal_min=N,this.volumes[n].cal_max=M,this.onIntensityChange(this.volumes[n])}generateMouseUpCallback(n,s){const c=this.tileIndex(this.uiData.dragStart[0],this.uiData.dragStart[1]),f=this.tileIndex(this.uiData.dragEnd[0],this.uiData.dragEnd[1]);let g=-1;c===f&&(g=f);let A=-1;g>=0&&(A=this.screenSlices[g].axCorSag);const v=this.frac2mm(n),y=this.frac2mm(s),T=create$2();sub$4(T,fromValues$2(v[0],v[1],v[2]),fromValues$2(y[0],y[1],y[2]));const I=len(T),S=this.frac2vox(n),k=this.frac2vox(s);this.onDragRelease({fracStart:n,fracEnd:s,voxStart:S,voxEnd:k,mmStart:v,mmEnd:y,mmLength:I,tileIdx:g,axCorSag:A})}mouseUpListener(){function n(f){return Object.prototype.toString.call(f).indexOf("Function")>-1}const s={mouseButtonRightDown:this.uiData.mouseButtonRightDown,mouseButtonCenterDown:this.uiData.mouseButtonCenterDown,isDragging:this.uiData.isDragging,mousePos:this.mousePos,fracPos:this.canvasPos2frac(this.mousePos)};this.uiData.mousedown=!1,this.uiData.mouseButtonRightDown=!1;const c=this.uiData.mouseButtonCenterDown;if(this.uiData.mouseButtonCenterDown=!1,this.uiData.mouseButtonLeftDown=!1,this.drawPenFillPts.length>0?this.drawPenFilled():this.drawPenAxCorSag>=0&&this.drawAddUndoBitmap(),this.drawPenLocation=[NaN,NaN,NaN],this.drawPenAxCorSag=-1,n(this.onMouseUp)&&this.onMouseUp(s),this.uiData.isDragging){this.uiData.isDragging=!1,this.opts.dragMode===5&&this.drawScene();const f=this.canvasPos2frac([this.uiData.dragStart[0],this.uiData.dragStart[1]]),g=this.canvasPos2frac([this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);if(this.generateMouseUpCallback(f,g),this.opts.dragMode!==1||c||this.uiData.dragStart[0]===this.uiData.dragEnd[0]&&this.uiData.dragStart[1]===this.uiData.dragEnd[1])return;this.calculateNewRange({volIdx:0}),this.refreshLayers(this.volumes[0],0)}this.drawScene()}checkMultitouch(n){if(this.uiData.touchdown&&!this.uiData.multiTouchGesture){const s=this.canvas.getBoundingClientRect();this.mouseDown(n.touches[0].clientX-s.left,n.touches[0].clientY-s.top),this.mouseClick(n.touches[0].clientX-s.left,n.touches[0].clientY-s.top)}}touchStartListener(n){n.preventDefault(),this.uiData.touchTimer||(this.uiData.touchTimer=setTimeout(()=>{this.resetBriCon(n)},this.opts.longTouchTimeout)),this.uiData.touchdown=!0,this.uiData.currentTouchTime=new Date().getTime();const s=this.uiData.currentTouchTime-this.uiData.lastTouchTime;if(s0){this.uiData.doubleTouch=!0,this.setDragStart(n.targetTouches[0].clientX-n.target.getBoundingClientRect().left,n.targetTouches[0].clientY-n.target.getBoundingClientRect().top),this.resetBriCon(n),this.uiData.lastTouchTime=this.uiData.currentTouchTime;return}else this.uiData.doubleTouch=!1,this.setDragStart(0,0),this.setDragEnd(0,0),this.uiData.lastTouchTime=this.uiData.currentTouchTime;this.uiData.touchdown&&n.touches.length<2?this.uiData.multiTouchGesture=!1:this.uiData.multiTouchGesture=!0,setTimeout(this.checkMultitouch.bind(this),1,n)}touchEndListener(n){if(n.preventDefault(),this.uiData.touchdown=!1,this.uiData.lastTwoTouchDistance=0,this.uiData.multiTouchGesture=!1,this.uiData.touchTimer&&(clearTimeout(this.uiData.touchTimer),this.uiData.touchTimer=null),this.uiData.isDragging){this.uiData.isDragging=!1,this.opts.dragMode===1&&(this.calculateNewRange(),this.refreshLayers(this.volumes[0],0));const s=this.canvasPos2frac([this.uiData.dragStart[0],this.uiData.dragStart[1]]),c=this.canvasPos2frac([this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);this.generateMouseUpCallback(s,c)}this.mouseUpListener()}mouseMoveListener(n){if(this.uiData.mousedown){const s=this.getNoPaddingNoBorderCanvasRelativeMousePosition(n,this.gl.canvas);if(!s)return;const c=s.x*this.uiData.dpr,f=s.y*this.uiData.dpr;if(this.tileIndex(c,f)!==this.uiData.clickedTile)return;this.uiData.mouseButtonLeftDown?(this.mouseMove(s.x,s.y),this.mouseClick(s.x,s.y)):(this.uiData.mouseButtonRightDown||this.uiData.mouseButtonCenterDown)&&this.setDragEnd(s.x,s.y),this.drawScene(),this.uiData.prevX=this.uiData.currX,this.uiData.prevY=this.uiData.currY}}resetBriCon(n=null){if(this.uiData.isDragging)return;let s=!1;this.opts.sliceType===4&&(s=!0);let c=0,f=0;if(n!==null&&("targetTouches"in n?(c=n.targetTouches[0].clientX-n.target.getBoundingClientRect().left,f=n.targetTouches[0].clientY-n.target.getBoundingClientRect().top):(c=n.offsetX,f=n.offsetY),c*=this.uiData.dpr,f*=this.uiData.dpr,this.inRenderTile(c,f)>=0&&(s=!0)),s){this.uiData.mouseDepthPicker=!0,this.drawScene(),this.drawScene();return}this.opts.dragMode!==4&&(this.volumes.length<1||this.uiData.doubleTouch||(this.volumes[0].cal_min=this.volumes[0].robust_min,this.volumes[0].cal_max=this.volumes[0].robust_max,this.onIntensityChange(this.volumes[0]),this.refreshLayers(this.volumes[0],0),this.drawScene()))}setDragStart(n,s){n*=this.uiData.dpr,s*=this.uiData.dpr,this.uiData.dragStart[0]=n,this.uiData.dragStart[1]=s}setDragEnd(n,s){n*=this.uiData.dpr,s*=this.uiData.dpr,this.uiData.dragEnd[0]=n,this.uiData.dragEnd[1]=s}touchMoveListener(n){if(this.uiData.touchdown&&n.touches.length<2){const s=this.canvas.getBoundingClientRect();if(this.uiData.isDragging||(this.uiData.pan2DxyzmmAtMouseDown=clone$1(this.scene.pan2Dxyzmm)),this.uiData.isDragging=!0,this.uiData.doubleTouch&&this.uiData.isDragging){this.setDragEnd(n.targetTouches[0].clientX-n.target.getBoundingClientRect().left,n.targetTouches[0].clientY-n.target.getBoundingClientRect().top),this.drawScene();return}this.mouseClick(n.touches[0].clientX-s.left,n.touches[0].clientY-s.top),this.mouseMove(n.touches[0].clientX-s.left,n.touches[0].clientY-s.top)}else this.handlePinchZoom(n)}handlePinchZoom(n){if(n.targetTouches.length===2&&n.changedTouches.length===2){const s=Math.hypot(n.touches[0].pageX-n.touches[1].pageX,n.touches[0].pageY-n.touches[1].pageY),c=this.canvas.getBoundingClientRect();this.mousePos=[n.touches[0].clientX-c.left,n.touches[0].clientY-c.top],sthis.opts.keyDebounceTime){switch(this.currentClipPlaneIndex=(this.currentClipPlaneIndex+1)%7,this.currentClipPlaneIndex){case 0:this.scene.clipPlaneDepthAziElev=[2,0,0];break;case 1:this.scene.clipPlaneDepthAziElev=[0,270,0];break;case 2:this.scene.clipPlaneDepthAziElev=[0,90,0];break;case 3:this.scene.clipPlaneDepthAziElev=[0,0,0];break;case 4:this.scene.clipPlaneDepthAziElev=[0,180,0];break;case 5:this.scene.clipPlaneDepthAziElev=[0,0,-90];break;case 6:this.scene.clipPlaneDepthAziElev=[0,0,90];break}this.setClipPlane(this.scene.clipPlaneDepthAziElev)}this.lastCalled=s}else if(n.code===this.opts.viewModeHotKey){const s=new Date().getTime();s-this.lastCalled>this.opts.keyDebounceTime&&(this.setSliceType((this.opts.sliceType+1)%5),this.lastCalled=s)}}keyDownListener(n){n.code==="KeyH"&&this.opts.sliceType===4?this.setRenderAzimuthElevation(this.scene.renderAzimuth-1,this.scene.renderElevation):n.code==="KeyL"&&this.opts.sliceType===4?this.setRenderAzimuthElevation(this.scene.renderAzimuth+1,this.scene.renderElevation):n.code==="KeyJ"&&this.opts.sliceType===4?this.setRenderAzimuthElevation(this.scene.renderAzimuth,this.scene.renderElevation+1):n.code==="KeyK"&&this.opts.sliceType===4?this.setRenderAzimuthElevation(this.scene.renderAzimuth,this.scene.renderElevation-1):n.code==="KeyH"&&this.opts.sliceType!==4?this.moveCrosshairInVox(-1,0,0):n.code==="KeyL"&&this.opts.sliceType!==4?this.moveCrosshairInVox(1,0,0):n.code==="KeyU"&&this.opts.sliceType!==4&&n.ctrlKey?this.moveCrosshairInVox(0,0,1):n.code==="KeyD"&&this.opts.sliceType!==4&&n.ctrlKey?this.moveCrosshairInVox(0,0,-1):n.code==="KeyJ"&&this.opts.sliceType!==4?this.moveCrosshairInVox(0,-1,0):n.code==="KeyK"&&this.opts.sliceType!==4?this.moveCrosshairInVox(0,1,0):n.code==="KeyM"&&this.opts.sliceType!==4?(this.opts.dragMode++,this.opts.dragMode>=4&&(this.opts.dragMode=0),log$4.info("drag mode changed to ",DRAG_MODE[this.opts.dragMode])):n.code==="ArrowLeft"?this.setFrame4D(this.volumes[0].id,this.volumes[0].frame4D-1):n.code==="ArrowRight"?this.setFrame4D(this.volumes[0].id,this.volumes[0].frame4D+1):n.code==="Slash"&&n.shiftKey&&alert(`NIIVUE VERSION: ${version$1}`)}wheelListener(n){if(n.preventDefault(),n.stopPropagation(),this.thumbnailVisible)return;const s=this.canvas.getBoundingClientRect();n.deltaY<0?this.sliceScroll2D(-.01,n.clientX-s.left,n.clientY-s.top):this.sliceScroll2D(.01,n.clientX-s.left,n.clientY-s.top)}registerInteractions(){if(!this.canvas)throw new Error("canvas undefined");this.canvas.addEventListener("mousedown",this.mouseDownListener.bind(this)),this.canvas.addEventListener("mouseup",this.mouseUpListener.bind(this)),this.canvas.addEventListener("mousemove",this.mouseMoveListener.bind(this)),this.canvas.addEventListener("touchstart",this.touchStartListener.bind(this)),this.canvas.addEventListener("touchend",this.touchEndListener.bind(this)),this.canvas.addEventListener("touchmove",this.touchMoveListener.bind(this)),this.canvas.addEventListener("wheel",this.wheelListener.bind(this)),this.canvas.addEventListener("contextmenu",this.mouseContextMenuListener.bind(this)),this.canvas.addEventListener("dblclick",this.resetBriCon.bind(this)),this.canvas.addEventListener("dragenter",this.dragEnterListener.bind(this),!1),this.canvas.addEventListener("dragover",this.dragOverListener.bind(this),!1),this.canvas.addEventListener("drop",this.dropListener.bind(this),!1),this.canvas.setAttribute("tabindex","0"),this.canvas.addEventListener("keyup",this.keyUpListener.bind(this),!1),this.canvas.addEventListener("keydown",this.keyDownListener.bind(this),!1)}dragEnterListener(n){n.stopPropagation(),n.preventDefault()}dragOverListener(n){n.stopPropagation(),n.preventDefault()}getFileExt(n,s=!0){log$4.debug("fullname: ",n);const c=/(?:\.([^.]+))?$/;let f=c.exec(n)[1];return f=f.toUpperCase(),f==="GZ"&&(f=c.exec(n.slice(0,-3))[1],f=f.toUpperCase()),s?f:f.toLowerCase()}async addVolumeFromUrl(n){const s=await NVImage.loadFromUrl(n);return this.document.addImageOptions(s,n),s.onColormapChange=this.onColormapChange,this.mediaUrlMap.set(s,n.url),this.onVolumeAddedFromUrl&&this.onVolumeAddedFromUrl(n,s),this.addVolume(s),s}getMediaByUrl(n){return[...this.mediaUrlMap.entries()].filter(s=>s[1]===n).map(s=>s[0]).pop()}removeVolumeByUrl(n){const s=this.getMediaByUrl(n);if(s)this.removeVolume(s);else throw new Error("No volume with URL present")}readDirectory(n){const s=n.createReader();let c=[];const f=async A=>{const v=[],y=async T=>new Promise((I,S)=>T.file(I,S));for(let T=0;T{s.readEntries(A=>{A.length?(c=c.concat(A),g()):f(c).then(v=>{NVImage.loadFromFile({file:v,name:n.name,urlImgData:null,imageType:NVIMAGE_TYPE.DCM_FOLDER}).then(y=>this.addVolume(y)).catch(y=>{throw y})}).catch(v=>{throw v})})};return g(),c}isMeshExt(n){const s=this.getFileExt(n);return log$4.debug("dropped ext"),log$4.debug(s),MESH_EXTENSIONS.includes(s)}dropListener(n){if(n.stopPropagation(),n.preventDefault(),!this.opts.dragAndDropEnabled)return;const s=n.dataTransfer;if(!s)return;const c=s.getData("text/uri-list");if(c){const f=NVImageFromUrlOptions(c),g=this.getFileExt(c);log$4.debug("dropped ext"),log$4.debug(g),MESH_EXTENSIONS.includes(g)?this.addMeshFromUrl({url:c}).catch(A=>{throw A}):g==="NVD"?this.loadDocumentFromUrl(c).catch(A=>{throw A}):this.addVolumeFromUrl(f).catch(A=>{throw A})}else{const f=s.items;if(f.length>0){!n.shiftKey&&!n.altKey&&(this.volumes=[],this.overlays=[],this.meshes=[]),this.closeDrawing();for(const g of Array.from(f)){const A=g.webkitGetAsEntry();if(log$4.debug(A),!A)throw new Error("could not get entry from file");if(A.isFile){const v=this.getFileExt(A.name);if(v==="PNG"){A.file(T=>{this.loadBmpTexture(T).catch(I=>{throw I})});continue}let y;if(A.name.lastIndexOf("HEAD")!==-1)for(const T of Array.from(f)){const I=T.webkitGetAsEntry();if(!I)throw new Error("could not get paired entry");const S=A.name.substring(0,A.name.lastIndexOf("HEAD")),k=I.name.substring(0,I.name.lastIndexOf("BRIK"));S===k&&(y=I)}if(A.name.lastIndexOf("BRIK")!==-1)continue;if(MESH_EXTENSIONS.includes(v)){A.file(T=>{NVMesh.loadFromFile({file:T,gl:this.gl,name:T.name}).then(I=>{this.addMesh(I)}).catch(I=>{throw I})});continue}else if(v==="NVD"){A.file(T=>{NVDocument.loadFromFile(T).then(I=>{this.loadDocument(I),log$4.debug("loaded document")}).catch(I=>{throw I})});break}A.file(T=>{y?y.file(I=>{NVImage.loadFromFile({file:T,urlImgData:I,limitFrames4D:this.opts.limitFrames4D}).then(S=>{this.addVolume(S)}).catch(S=>{throw S})}):NVImage.loadFromFile({file:T,urlImgData:y,limitFrames4D:this.opts.limitFrames4D}).then(I=>{n.altKey?(log$4.debug("alt key detected: assuming this is a drawing overlay"),this.drawClearAllUndoBitmaps(),this.loadDrawing(I)):this.addVolume(I)}).catch(I=>{throw I})})}else A.isDirectory&&this.readDirectory(A)}}}this.drawScene()}setMultiplanarPadPixels(n){this.opts.multiplanarPadPixels=n,this.drawScene()}setMultiplanarLayout(n){typeof n=="string"&&(n=parseInt(n)),this.opts.multiplanarLayout=n,this.drawScene()}setCornerOrientationText(n){this.opts.isCornerOrientationText=n,this.updateGLVolume()}setRadiologicalConvention(n){this.opts.isRadiologicalConvention=n,this.updateGLVolume()}setDefaults(n={},s=!1){this.opts={...DEFAULT_OPTIONS},this.scene={...this.document.scene};for(const c in n)typeof n[c]=="function"?this[c]=n[c]:this.opts[c]=DEFAULT_OPTIONS[c]===void 0?DEFAULT_OPTIONS[c]:n[c];if(this.scene.pan2Dxyzmm=[0,0,0,1],s&&this.volumes&&this.volumes.length>0)for(let c=0;c=this.opts.maxDrawUndoBitmaps&&(this.currentDrawUndoBitmap=0),this.drawUndoBitmaps[this.currentDrawUndoBitmap]=encodeRLE(this.drawBitmap)}drawClearAllUndoBitmaps(){if(this.currentDrawUndoBitmap=this.opts.maxDrawUndoBitmaps,!(!this.drawUndoBitmaps||this.drawUndoBitmaps.length<1))for(let n=this.drawUndoBitmaps.length-1;n>=0;n--)this.drawUndoBitmaps[n]=new Uint8Array}drawUndo(){if(this.drawUndoBitmaps.length<1){log$4.debug("undo bitmaps not loaded");return}if(this.currentDrawUndoBitmap--,this.currentDrawUndoBitmap<0&&(this.currentDrawUndoBitmap=this.drawUndoBitmaps.length-1),this.currentDrawUndoBitmap>=this.drawUndoBitmaps.length&&(this.currentDrawUndoBitmap=0),this.drawUndoBitmaps[this.currentDrawUndoBitmap].length<2){log$4.debug("drawUndo is misbehaving");return}this.drawBitmap=decodeRLE(this.drawUndoBitmaps[this.currentDrawUndoBitmap],this.drawBitmap.length),this.refreshDrawing(!0)}loadDrawing(n){if(this.drawBitmap&&log$4.debug("Overwriting open drawing!"),!this.back)throw new Error("back undefined");this.drawClearAllUndoBitmaps();const s=n.hdr.dims;if(s[1]!==this.back.hdr.dims[1]||s[2]!==this.back.hdr.dims[2]||s[3]!==this.back.hdr.dims[3])return log$4.debug("drawing dimensions do not match background image"),!1;n.img.constructor!==Uint8Array&&log$4.debug("Drawings should be UINT8");const c=n.permRAS,f=s[1]*s[2]*s[3];this.drawBitmap=new Uint8Array(f),this.drawTexture=this.r8Tex(this.drawTexture,TEXTURE7_DRAW,this.back.dims,!0);const g=[0,0,0];for(let M=0;M<3;M++)for(let O=0;O<3;O++)Math.abs(c[M])-1===O&&(g[O]=M*Math.sign(c[M]));let A=1;const v=[1,1,1],y=[!1,!1,!1];for(let M=0;MArray(f).fill(0)),M=Array(f).fill(0).map(()=>Array(f).fill(0));for(let B=1;B3)for(let B=0;BO&&(U[0]=B,U[1]=V,U[2]=b,O=W)}else if(n===3)for(let B=0;BO&&(U[0]=B,U[1]=V,O=b)}else for(let B=0;BO&&(U[0]=B,O=V)}return[I(U[0]),I(U[1]),I(U[2])]}drawOtsu(n=2){if(this.volumes.length===0)return;const s=this.volumes[0].img.length,c=this.findOtsu(n);if(c.length<3)return;this.drawBitmap||this.createEmptyDrawing();const f=this.drawBitmap,g=this.volumes[0].img;for(let A=0;Ac[0]&&(f[A]=1),v>c[1]&&(f[A]=2),v>c[2]&&(f[A]=3)}this.drawAddUndoBitmap(),this.refreshDrawing(!0)}removeHaze(n=5,s=0){const c=this.volumes[s].img,f=this.volumes[s].hdr,g=c.length;let A=2;(n===5||n===1)&&(A=4),(n===4||n===2)&&(A=3);const v=this.findOtsu(A);if(v.length<3)return;let y=v[0];n===1&&(y=v[2]),n===2&&(y=v[1]);const T=f.scl_inter,I=f.scl_slope,S=this.volumes[s].global_min;for(let k=0;k=this.meshes.length?-1:n;const s=this.meshes.length;for(let c=0;cc)return;const f=this.getVolumeIndexByID(n.id);s===0?(this.volumes.splice(f,1),this.volumes.unshift(n),this.back=this.volumes[0],this.overlays=this.volumes.slice(1)):s<0?(this.volumes.splice(this.getVolumeIndexByID(n.id),1),this.back=this.volumes[0],this.volumes.length>1?this.overlays=this.volumes.slice(1):this.overlays=[]):(this.volumes.splice(f,1),this.volumes.splice(s,0,n),this.overlays=this.volumes.slice(1),this.back=this.volumes[0]),this.updateGLVolume()}setMesh(n,s=0){this.meshes.forEach(g=>{log$4.debug("MESH: ",g.name)});const c=this.meshes.length;if(s>c)return;const f=this.getMeshIndexByID(n.id);s===0?(this.meshes.splice(f,1),this.meshes.unshift(n)):s<0?this.meshes.splice(this.getMeshIndexByID(n.id),1):(this.meshes.splice(f,1),this.meshes.splice(s,0,n)),this.updateGLVolume(),this.meshes.forEach(g=>{log$4.debug(g.name)})}removeVolume(n){if(this.setVolume(n,-1),this.mediaUrlMap.has(n)){const s=this.mediaUrlMap.get(n);this.onVolumeWithUrlRemoved(s),this.mediaUrlMap.delete(n)}this.drawScene()}removeVolumeByIndex(n){if(n>=this.volumes.length)throw new Error("Index of volume out of bounds");this.removeVolume(this.volumes[n])}removeMesh(n){if(this.setMesh(n,-1),this.mediaUrlMap.has(n)){const s=this.mediaUrlMap.get(n);this.onMeshWithUrlRemoved(s),this.mediaUrlMap.delete(n)}}removeMeshByUrl(n){const s=this.getMediaByUrl(n);s&&(this.removeMesh(s),this.mediaUrlMap.delete(s),this.onMeshWithUrlRemoved(n))}moveVolumeToBottom(n){this.setVolume(n,0)}moveVolumeUp(n){const s=this.getVolumeIndexByID(n.id);this.setVolume(n,s+1)}moveVolumeDown(n){const s=this.getVolumeIndexByID(n.id);this.setVolume(n,s-1)}moveVolumeToTop(n){this.setVolume(n,this.volumes.length-1)}mouseDown(n,s){n*=this.uiData.dpr,s*=this.uiData.dpr,this.mousePos=[n,s]}mouseMove(n,s){n*=this.uiData.dpr,s*=this.uiData.dpr;const c=(n-this.mousePos[0])/this.uiData.dpr,f=(s-this.mousePos[1])/this.uiData.dpr;this.mousePos=[n,s],!(this.inRenderTile(n,s)<0)&&(Math.abs(c)<1&&Math.abs(f)<1||(this.scene.renderAzimuth+=c,this.scene.renderElevation+=f,this.drawScene()))}sph2cartDeg(n,s){const c=-s*(Math.PI/180),f=(n-90)%360*(Math.PI/180),g=[Math.cos(c)*Math.cos(f),Math.cos(c)*Math.sin(f),Math.sin(c)],A=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]);return A<=0||(g[0]/=A,g[1]/=A,g[2]/=A),g}setClipPlane(n){const s=this.sph2cartDeg(n[1]+180,n[2]);this.scene.clipPlane=[s[0],s[1],s[2],n[0]],this.scene.clipPlaneDepthAziElev=n,this.onClipPlaneChange(this.scene.clipPlane),this.drawScene()}setCrosshairColor(n){this.opts.crosshairColor=n,this.drawScene()}setCrosshairWidth(n){this.opts.crosshairWidth=n,this.crosshairs3D&&(this.crosshairs3D.mm[0]=NaN),this.drawScene()}setDrawColormap(n){this.drawLut=cmapper.makeDrawLut(n),this.updateGLVolume()}setDrawingEnabled(n){this.opts.drawingEnabled=n,this.opts.drawingEnabled&&(this.drawBitmap||this.createEmptyDrawing()),this.drawScene()}setPenValue(n,s=!1){this.opts.penValue=n,this.opts.isFilledPen=s,this.drawScene()}setDrawOpacity(n){this.drawOpacity=n,this.drawScene()}setSelectionBoxColor(n){this.opts.selectionBoxColor=n}sliceScroll2D(n,s,c,f=!0){if(this.inGraphTile(s,c)){let g=this.volumes[0].frame4D;n>0&&g++,n<0&&g--,this.setFrame4D(this.volumes[0].id,g);return}if(n!==0&&this.opts.dragMode===3&&this.inRenderTile(this.uiData.dpr*s,this.uiData.dpr*c)===-1){let g=this.scene.pan2Dxyzmm[3]*(1+10*n);g=Math.round(g*10)/10;const A=this.scene.pan2Dxyzmm[3]-g;this.opts.yoke3Dto2DZoom&&(this.scene.volScaleMultiplier=g),this.scene.pan2Dxyzmm[3]=g;const v=this.frac2mm(this.scene.crosshairPos);this.scene.pan2Dxyzmm[0]+=A*v[0],this.scene.pan2Dxyzmm[1]+=A*v[1],this.scene.pan2Dxyzmm[2]+=A*v[2],this.drawScene();return}this.mouseClick(s,c,n,f)}setSliceType(n){return this.opts.sliceType=n,this.drawScene(),this}setOpacity(n,s){if(this.volumes[n].opacity=s,n===0){this.drawScene();return}this.updateGLVolume()}setScale(n){this.scene.volScaleMultiplier=n,this.drawScene()}setClipPlaneColor(n){this.opts.clipPlaneColor=n,this.renderShader.use(this.gl),this.gl.uniform4fv(this.renderShader.uniforms.clipPlaneColor,this.opts.clipPlaneColor),this.drawScene()}async setVolumeRenderIllumination(n=0){this.renderShader=this.renderVolumeShader,n>0&&(this.renderShader=this.renderGradientShader),n<0&&(this.renderShader=this.renderSliceShader),this.initRenderShader(this.renderShader,n),this.renderShader.use(this.gl),this.setClipPlaneColor(this.opts.clipPlaneColor),this.gradientTextureAmount=n,this.refreshLayers(this.volumes[0],0),this.drawScene()}overlayRGBA(n){const s=n.hdr,c=s.dims[1]*s.dims[2]*s.dims[3],f=new Uint8ClampedArray(c*4),g=.2*Math.min(Math.min(s.dims[1],s.dims[2]),s.dims[3]),A=.5*s.dims[1],v=.5*s.dims[2],y=.5*s.dims[3];let T=0;for(let I=0;I0&&(this.back=this.volumes[0]);const c=n.encodedDrawingBlob;if(c){const f=n.imageOptionsArray[0],g=NVImage.loadFromBase64({base64:c,...f});g&&this.loadDrawing(g)}for(const f of n.meshDataObjects??[]){const g={gl:this.gl,...f};log$4.debug(g);const A=new NVMesh(g.pts,g.tris,g.name,g.rgba255,g.opacity,g.visible,this.gl,g.connectome,g.dpg,g.dps,g.dpv);A.meshShaderIndex=g.meshShaderIndex,A.layers=g.layers,A.updateMesh(this.gl),log$4.debug(A),this.addMesh(A)}if(n.data.connectomes)for(const f of n.data.connectomes){const g=JSON.parse(f);this.loadConnectome(g)}return this.scene={...this.scene,...n.scene.sceneData},this.opts={...this.opts,...n.opts},this.updateGLVolume(),this.drawScene(),this.onDocumentLoaded(n),this}generateLoadDocumentJavaScript(n,s){const c=this.json(),f=NVUtilities.compressToBase64String(JSON.stringify(c));return` ${s} function saveNiivueAsHtml(pageName) { @@ -1699,8 +1699,8 @@ void main(void) { button.onclick = saveAsHtml; <\/script> - `}saveHTML(n="untitled.html",s="gl1",c){const f=this.generateHTML(s,c);NVUtilities.download(f,n,"application/html")}json(){this.document.opts=this.opts,this.document.scene=this.scene,this.document.volumes=this.volumes,this.document.meshes=this.meshes,this.drawScene(),this.document.previewImageDataURL=this.canvas.toDataURL();const n=this.document.json();return n.sceneData={...this.scene},n}async saveDocument(n="untitled.nvd"){this.document.opts=this.opts,this.document.scene=this.scene,this.document.title=n,log$4.debug("saveDocument",this.volumes[0]),this.drawScene(),this.document.previewImageDataURL=this.canvas.toDataURL(),this.document.download(n)}async loadVolumes(n){if(this.loadingText="loading...",this.drawScene(),this.thumbnailVisible)return this.deferredVolumes=n,this;this.volumes=[],this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let s=0;s0&&(g[W]=T);const I=this.r16Tex(null,TEXTURE12_GC_STRENGTH0,this.back.dims,g),S=this.r16Tex(null,TEXTURE13_GC_STRENGTH1,this.back.dims,g);s.bindVertexArray(this.genericVAO);const k=this.growCutShader;k.use(s);const e=128;s.uniform1i(k.uniforms.finalPass,0),s.uniform1i(k.uniforms.backTex,11);for(let W=0;Wn[0]&&(v=1),s[1]>n[1]&&(y=1),s[2]>n[2]&&(T=1);let I=n[0],S=n[1],k=n[2];const e=s[0],N=s[1],M=s[2];if(f>=g&&f>=A){let O=2*g-f,z=2*A-f;for(;I!==e;)I+=v,O>=0&&(S+=y,O-=2*f),z>=0&&(k+=T,z-=2*f),O+=2*g,z+=2*A,this.drawPt(I,S,k,c)}else if(g>=f&&g>=A){let O=2*f-g,z=2*A-g;for(;S!==N;)S+=y,O>=0&&(I+=v,O-=2*g),z>=0&&(k+=T,z-=2*g),O+=2*f,z+=2*A,this.drawPt(I,S,k,c)}else{let O=2*g-A,z=2*f-A;for(;k!==M;)k+=T,O>=0&&(S+=y,O-=2*A),z>=0&&(I+=v,z-=2*A),O+=2*g,z+=2*f,this.drawPt(I,S,k,c)}}drawFloodFillCore(n,s,c=6){var I;if(!((I=this.back)!=null&&I.dims))throw new Error("back.dims undefined");const f=[this.back.dims[1],this.back.dims[2],this.back.dims[3]],g=f[0],A=g*f[1];function v(S){return S[0]+S[1]*g+S[2]*A}function y(S){const k=Math.floor(S/A),e=Math.floor((S-k*A)/g);return[Math.floor(S%g),e,k]}const T=[];for(T.push(s),n[s]=2;T.length>0;){let S=function(N){const M=e.slice();if(M[0]+=N[0],M[1]+=N[1],M[2]+=N[2],M[0]<0||M[1]<0||M[2]<0||M[0]>=f[0]||M[1]>=f[1]||M[2]>=f[2])return;const O=v(M);n[O]===1&&(n[O]=2,T.push(O))};const k=T[0];T.shift();const e=y(k);S([0,0,-1]),S([0,0,1]),S([0,-1,0]),S([0,1,0]),S([-1,0,0]),S([1,0,0]),!(c<=6)&&(S([-1,-1,0]),S([1,1,0]),S([-1,1,0]),S([1,1,0]),S([0,-1,-1]),S([0,1,-1]),S([-1,0,-1]),S([1,0,-1]),S([0,-1,1]),S([0,1,1]),S([-1,0,1]),S([1,0,1]),!(c<=18)&&(S([-1,-1,-1]),S([1,-1,-1]),S([-1,1,-1]),S([1,1,-1]),S([-1,-1,1]),S([1,-1,1]),S([-1,1,1]),S([1,1,1])))}}drawFloodFill(n,s=0,c=0,f=NaN,g=NaN,A=6){var M;if(!this.drawBitmap)throw new Error("drawBitmap undefined");if(!((M=this.back)!=null&&M.dims))throw new Error("back.dims undefined");s=Math.abs(s);const v=[this.back.dims[1],this.back.dims[2],this.back.dims[3]];if(n[0]<0||n[1]<0||n[2]<0||n[0]>=v[0]||n[1]>=v[1]||n[2]>=v[2])return;const y=v[0],T=y*v[1],I=T*v[2],S=this.drawBitmap.slice();if(S.length!==T*v[2])return;function k(O){return O[0]+O[1]*y+O[2]*T}const e=k(n),N=S[e];if(N===s){c!==0?log$4.debug("drawFloodFill selected voxel is not part of a drawing"):log$4.debug("drawFloodFill selected voxel is already desired color");return}for(let O=1;O=B&&O[V]<=z&&(S[V]=1);this.drawFloodFillCore(S,e,A),s=N}for(let O=1;OM[0]&&(V=1),O[1]>M[1]&&(b=1);let W=M[0],q=M[1];const Y=O[0],X=O[1];if(z>=B){let Q=2*B-z;for(;W!==Y;)W+=V,Q>=0&&(q+=b,Q-=2*z),Q+=2*B,A[W+q*g[0]]=v}else{let Q=2*z-B;for(;q!==X;)q+=b,Q>=0&&(W+=V,Q-=2*B),Q+=2*z,A[W+q*g[0]]=v}}const T=[this.drawPenFillPts[0][c],this.drawPenFillPts[0][f]];let I=T;for(let M=1;M=g[0]||M[1]>=g[1])return;const O=M[0]+M[1]*g[0];A[O]===0&&(S.push(M),A[O]=2)}for(let M=0;M0;){const M=S.shift();k([M[0]-1,M[1]]),k([M[0]+1,M[1]]),k([M[0],M[1]-1]),k([M[0],M[1]+1])}v=this.opts.penValue;const e=this.drawPenFillPts[0][3-(c+f)];if(!this.drawBitmap)throw new Error("drawBitmap undefined");if(s===0){const M=e*g[0]*g[1];for(let O=0;O0){const M=this.drawBitmap.length,O=decodeRLE(this.drawUndoBitmaps[this.currentDrawUndoBitmap],M);for(let z=0;z{const g=new Image;g.onload=()=>{if(!this.bmpShader)return;let A;s===4?(this.bmpTexture!==null&&this.gl.deleteTexture(this.bmpTexture),this.bmpTexture=this.gl.createTexture(),A=this.bmpTexture,this.bmpTextureWH=g.width/g.height,this.gl.activeTexture(TEXTURE4_THUMBNAIL),this.bmpShader.use(this.gl),this.gl.uniform1i(this.bmpShader.uniforms.bmpTexture,4)):s===5?(this.gl.activeTexture(TEXTURE5_MATCAP),this.matCapTexture!==null&&this.gl.deleteTexture(this.matCapTexture),this.matCapTexture=this.gl.createTexture(),A=this.matCapTexture):(this.fontShader.use(this.gl),this.gl.activeTexture(TEXTURE3_FONT),this.gl.uniform1i(this.fontShader.uniforms.fontTexture,3),this.fontTexture!==null&&this.gl.deleteTexture(this.fontTexture),this.fontTexture=this.gl.createTexture(),A=this.fontTexture),this.gl.bindTexture(this.gl.TEXTURE_2D,A),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,g),c(A),s!==4&&this.drawScene()},g.onerror=f,this.requestCORSIfNotSameOrigin(g,n),g.src=n})}async loadFontTexture(n){return this.loadPngAsTexture(n,3)}async loadBmpTexture(n){return this.loadPngAsTexture(n,4)}async loadMatCapTexture(n){return this.loadPngAsTexture(n,5)}initFontMets(){if(!this.fontMetrics)throw new Error("fontMetrics undefined");this.fontMets={distanceRange:this.fontMetrics.atlas.distanceRange,size:this.fontMetrics.atlas.size,mets:{}};for(let c=0;c<256;c++)this.fontMets.mets[c]={xadv:0,uv_lbwh:[0,0,0,0],lbwh:[0,0,0,0]};const n=this.fontMetrics.atlas.width,s=this.fontMetrics.atlas.height;for(let c=0;c=this.meshes.length){log$4.debug("Unable to change shader until mesh is loaded (maybe you need async)");return}this.meshes[f].meshShaderIndex=c,this.updateGLVolume(),this.onMeshShaderChanged(f,c)}createCustomMeshShader(n,s="Custom"){if(!n)throw new Error("Need fragment shader");const c=this.meshShaderNameToNumber(s);c>=0&&(this.gl.deleteProgram(this.meshShaders[c].shader.program),this.meshShaders.splice(c,1));const f=new Shader(this.gl,vertMeshShader,n);return f.use(this.gl),{Name:s,Frag:n,shader:f}}setCustomMeshShader(n="",s="Custom"){const c=this.createCustomMeshShader(n,s);return this.meshShaders.push(c),this.onCustomMeshShaderAdded(n,s),this.meshShaders.length-1}meshShaderNames(n=!0){const s=[];for(let c=0;c0&&(await this.loadBmpTexture(this.opts.thumbnail),this.thumbnailVisible=!0),this.updateGLVolume(),this.initialized=!0,this.resizeListener(),this.drawScene(),this}gradientGL(n){const s=this.gl,c=[0,0,0,0,1,0,1,0,0,1,1,0],f=s.createVertexArray();s.bindVertexArray(f);const g=s.createBuffer();s.bindBuffer(s.ARRAY_BUFFER,g),s.bufferData(s.ARRAY_BUFFER,new Float32Array(c),s.STATIC_DRAW),s.enableVertexAttribArray(0),s.vertexAttribPointer(0,3,s.FLOAT,!1,0,0);const A=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,A),s.disable(s.CULL_FACE),s.viewport(0,0,n.dims[1],n.dims[2]),s.disable(s.BLEND);const v=this.rgbaTex(null,TEXTURE8_GRADIENT_TEMP,n.dims),y=this.blurShader;y.use(s),s.activeTexture(TEXTURE0_BACK_VOL),s.bindTexture(s.TEXTURE_3D,this.volumeTexture);const T=.7;s.uniform1i(y.uniforms.intensityVol,0),s.uniform1f(y.uniforms.dX,T/n.dims[1]),s.uniform1f(y.uniforms.dY,T/n.dims[2]),s.uniform1f(y.uniforms.dZ,T/n.dims[3]),s.bindVertexArray(f);for(let k=0;k0&&(this.furthestVertexFromOrigin=this.volumeObject3D.furthestVertexFromOrigin),this.meshes)for(let c=0;c0)for(let Y=0;Y0&&n.frame4D1&&g===0)return;let A=null;if(!this.back)throw new Error("back undefined");this.gl.bindVertexArray(this.unusedVAO),this.crosshairs3D&&(this.crosshairs3D.mm[0]=NaN);let v=clone$3(n.toRAS);if(s===0){this.volumeObject3D=n.toNiivueObject3D(this.VOLUME_ID,this.gl),invert(v,v),this.back.matRAS=n.matRAS,this.back.dims=n.dimsRAS,this.back.pixDims=n.pixDimsRAS,A=this.rgbaTex(this.volumeTexture,TEXTURE0_BACK_VOL,n.dimsRAS);const{volScale:q,vox:Y}=this.sliceScale(!0);if(this.volScale=q,this.vox=Y,this.volumeObject3D.scale=q,!this.renderShader)throw new Error("renderShader undefined");this.renderShader.use(this.gl),this.gl.uniform3fv(this.renderShader.uniforms.texVox,Y),this.gl.uniform3fv(this.renderShader.uniforms.volScale,q);const X=this.pickingImageShader;X.use(this.gl),this.gl.uniform1i(X.uniforms.volume,0),this.gl.uniform1i(X.uniforms.colormap,1),this.gl.uniform1i(X.uniforms.overlay,2),this.gl.uniform3fv(X.uniforms.volScale,q),log$4.debug(this.volumeObject3D)}else{((W=this.back)==null?void 0:W.dims)===void 0&&log$4.error("Fatal error: Unable to render overlay: background dimensions not defined!");const q=this.mm2frac(n.mm000,0,!0);let Y=this.mm2frac(n.mm100,0,!0),X=this.mm2frac(n.mm010,0,!0),Q=this.mm2frac(n.mm001,0,!0);Y=subtract$1(Y,Y,q),X=subtract$1(X,X,q),Q=subtract$1(Q,Q,q),v=fromValues$3(Y[0],X[0],Q[0],q[0],Y[1],X[1],Q[1],q[1],Y[2],X[2],Q[2],q[2],0,0,0,1),invert(v,v),s===1?(A=this.rgbaTex(this.overlayTexture,TEXTURE2_OVERLAY_VOL,this.back.dims),this.overlayTexture=A,this.overlayTextureID=A):A=this.overlayTextureID}const y=this.gl.createFramebuffer();this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,y),this.gl.disable(this.gl.CULL_FACE),this.gl.viewport(0,0,this.back.dims[1],this.back.dims[2]),this.gl.disable(this.gl.BLEND);const T=this.gl.createTexture();this.gl.activeTexture(TEXTURE9_ORIENT),this.gl.bindTexture(this.gl.TEXTURE_3D,T),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_WRAP_R,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,1);let I=this.orientShaderU;if(!c)throw new Error("hdr undefined");if(!f)throw new Error("img undefined");if(c.datatypeCode===2)c.intent_code===1002&&(I=this.orientShaderAtlasU),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R8UI,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED_INTEGER,this.gl.UNSIGNED_BYTE,f);else if(c.datatypeCode===4)I=this.orientShaderI,c.intent_code===1002&&(I=this.orientShaderAtlasI),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R16I,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED_INTEGER,this.gl.SHORT,f);else if(c.datatypeCode===16)this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R32F,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED,this.gl.FLOAT,f),I=this.orientShaderF;else if(c.datatypeCode===64){let q=new Float32Array;q=Float32Array.from(f),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R32F,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED,this.gl.FLOAT,q),I=this.orientShaderF}else c.datatypeCode===128?(I=this.orientShaderRGBU,I.use(this.gl),this.gl.uniform1i(I.uniforms.hasAlpha,0),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.RGB8UI,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RGB_INTEGER,this.gl.UNSIGNED_BYTE,f)):c.datatypeCode===512?(c.intent_code===1002&&(I=this.orientShaderAtlasU),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R16UI,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED_INTEGER,this.gl.UNSIGNED_SHORT,f)):c.datatypeCode===2304&&(I=this.orientShaderRGBU,I.use(this.gl),this.gl.uniform1i(I.uniforms.hasAlpha,1),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.RGBA8UI,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RGBA_INTEGER,this.gl.UNSIGNED_BYTE,f));n.global_min===void 0&&n.calMinMax();let S=null;if(this.gl.bindVertexArray(this.genericVAO),s>1){if(!this.back.dims)throw new Error("back.dims undefined");S=this.rgbaTex(S,TEXTURE10_BLEND,this.back.dims),this.gl.bindTexture(this.gl.TEXTURE_3D,S);const q=this.passThroughShader;q.use(this.gl),this.gl.uniform1i(q.uniforms.in3D,2);for(let Y=0;Y7){const q=n.colormapLabel.max-n.colormapLabel.min+1;k=this.createColormapTexture(k,1,q),this.gl.texSubImage2D(this.gl.TEXTURE_2D,0,0,0,q,1,this.gl.RGBA,this.gl.UNSIGNED_BYTE,n.colormapLabel.lut),this.gl.uniform1f(I.uniforms.cal_min,n.colormapLabel.min-.5),this.gl.uniform1f(I.uniforms.cal_max,n.colormapLabel.max+.5),this.gl.bindTexture(this.gl.TEXTURE_2D,k)}else this.gl.bindTexture(this.gl.TEXTURE_2D,this.colormapTexture),this.gl.uniform1f(I.uniforms.cal_min,n.cal_min),this.gl.uniform1f(I.uniforms.cal_max,n.cal_max);this.gl.uniform1i(I.uniforms.isAlphaThreshold,n.alphaThreshold),this.gl.uniform1i(I.uniforms.isAdditiveBlend,this.opts.isAdditiveBlend?1:0);let e=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY;if(n.colormapNegative.length>0&&(e=Math.min(-n.cal_min,-n.cal_max),N=Math.max(-n.cal_min,-n.cal_max),isFinite(n.cal_minNeg)&&isFinite(n.cal_maxNeg)&&(e=Math.min(n.cal_minNeg,n.cal_maxNeg),N=Math.max(n.cal_minNeg,n.cal_maxNeg))),!I)throw new Error("orientShader undefined");this.gl.uniform1f(I.uniforms.layer??null,s),this.gl.uniform1f(I.uniforms.cal_minNeg??null,e),this.gl.uniform1f(I.uniforms.cal_maxNeg??null,N),this.gl.bindTexture(this.gl.TEXTURE_3D,T),this.gl.uniform1i(I.uniforms.intensityVol??null,9),this.gl.uniform1i(I.uniforms.blend3D??null,10),this.gl.uniform1i(I.uniforms.colormap??null,1),this.gl.uniform1f(I.uniforms.scl_inter??null,c.scl_inter),this.gl.uniform1f(I.uniforms.scl_slope??null,c.scl_slope),this.gl.uniform1f(I.uniforms.opacity??null,g),this.gl.uniform1i(I.uniforms.modulationVol??null,7);let M=null;if(n.modulationImage!==null&&n.modulationImage>=0&&n.modulationImage0;let fe=this.volumes[n.modulationImage].cal_min,me=this.volumes[n.modulationImage].cal_max;isFinite(this.volumes[n.modulationImage].cal_minNeg)&&isFinite(this.volumes[n.modulationImage].cal_maxNeg)&&(fe=this.volumes[n.modulationImage].cal_minNeg,me=this.volumes[n.modulationImage].cal_minNeg),fe=Math.abs(fe),me=Math.abs(me),fe>me&&([fe,me]=[me,fe]);const pe=1/(me-fe);let Se=Math.abs(n.modulateAlpha);Se=Math.max(Se,1);const xe=this.volumes[n.modulationImage].frame4D*Y;for(let we=0;we0?this.gradientGL(c):(this.gradientTexture!==null&&this.gl.deleteTexture(this.gradientTexture),this.gradientTexture=null)),!this.renderShader)throw new Error("renderShader undefined");this.renderShader.use(this.gl);const z=this.sliceScale(!0),B=z.vox,V=z.volScale;if(this.gl.uniform1f(this.renderShader.uniforms.overlays,this.overlays),this.gl.uniform4fv(this.renderShader.uniforms.clipPlaneColor,this.opts.clipPlaneColor),this.gl.uniform1f(this.renderShader.uniforms.backOpacity,this.volumes[0].opacity),this.gl.uniform1f(this.renderShader.uniforms.renderOverlayBlend,this.opts.renderOverlayBlend),this.gl.uniform4fv(this.renderShader.uniforms.clipPlane,this.scene.clipPlane),this.gl.uniform3fv(this.renderShader.uniforms.texVox,B),this.gl.uniform3fv(this.renderShader.uniforms.volScale,V),!this.pickingImageShader)throw new Error("pickingImageShader undefined");this.pickingImageShader.use(this.gl),this.gl.uniform1f(this.pickingImageShader.uniforms.overlays,this.overlays.length),this.gl.uniform3fv(this.pickingImageShader.uniforms.texVox,B);let b=this.sliceMMShader;if(this.opts.isV1SliceShader&&(b=this.sliceV1Shader),!b)throw new Error("slice shader undefined");b.use(this.gl),this.gl.uniform1f(b.uniforms.overlays,this.overlays.length),this.gl.uniform1f(b.uniforms.drawOpacity,this.drawOpacity),k!==null&&(this.gl.deleteTexture(k),this.gl.activeTexture(TEXTURE1_COLORMAPS),this.gl.bindTexture(this.gl.TEXTURE_2D,this.colormapTexture)),this.gl.uniform1i(b.uniforms.drawing,7),this.gl.activeTexture(TEXTURE7_DRAW),this.gl.bindTexture(this.gl.TEXTURE_3D,this.drawTexture),this.updateInterpolation(s)}colormaps(){return cmapper.colormaps()}addColormap(n,s){cmapper.addColormap(n,s)}setColormap(n,s){const c=this.getVolumeIndexByID(n);this.volumes[c].colormap=s,this.updateGLVolume()}idx(n,s,c,f){return c*f[0]*f[1]+s*f[0]+n}check_previous_slice(n,s,c,f,g,A,v,y){const T=new Uint32Array(27);let I=0;if(!g)return 0;const S=n[this.idx(c,f,g,A)];if(v>=6){const k=this.idx(c,f,g-1,A);S===n[k]&&(T[I++]=s[k])}if(v>=18){if(c){const k=this.idx(c-1,f,g-1,A);S===n[k]&&(T[I++]=s[k])}if(f){const k=this.idx(c,f-1,g-1,A);S===n[k]&&(T[I++]=s[k])}if(c=6){if(k){const M=this.idx(k-1,S,I,s);N===n[M]&&(T[e++]=y[M])}if(S){const M=this.idx(k,S-1,I,s);N===n[M]&&(T[e++]=y[M])}}if(c>=18){if(S&&k){const M=this.idx(k-1,S-1,I,s);N===n[M]&&(T[e++]=y[M])}if(S&&k=A){A+=g;const M=new Uint32Array(A);M.set(v),v=M}v[f-1]=f,f++}}}for(let I=0;I100){log$4.info(` -Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y=1e-15&&I++;const S=1e3,k=(v-A)/S,e=new Array(S).fill(0);for(let V=0;V=M);)O++;const z=A;for(A=O*k+z,M=T-Math.floor((1-g)*I),O=0;O=M);)O++;v=O*k+z;let B=1;return A!==v&&(B=(c-s)/(v-A)),log$4.info(" Rescale: min: "+A+" max: "+v+" scale: "+B),[A,B]}conformVox2Vox(n,s,c=256,f=1,g=!1){const A=s.flat(),v=fromValues$3(A[0],A[1],A[2],A[3],A[4],A[5],A[6],A[7],A[8],A[9],A[10],A[11],A[12],A[13],A[14],A[15]),y=fromValues$1(n[1]/2,n[2]/2,n[3]/2,1),T=create$1(),I=create$3();transpose$3(I,v),transformMat4(T,y,I);const S=fromValues$2(T[0],T[1],T[2]),k=fromValues$2(f,f,f);let e=fromValues$3(-1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);g&&(e=fromValues$3(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),transpose$3(e,e);const N=fromValues$1(c,c,c,1),M=create$3();scale$4(M,e,k);const O=fromValues$1(N[0],N[1],N[2],1);transformMat4(O,O,M),scale$2(O,O,.5);const z=create$2();subtract$1(z,S,fromValues$2(O[0],O[1],O[2]));const B=create$3();transpose$3(B,M),B[3]=z[0],B[7]=z[1],B[11]=z[2];const V=create$3();invert(V,B);const b=create$3();mul$1(b,v,V);const W=create$3();return invert(W,b),[B,b,W]}async createNiftiArray(n=[256,256,256],s=[1,1,1],c=[1,0,0,-128,0,1,0,-128,0,0,1,-128,0,0,0,1],f=2,g=new Uint8Array){return await NVImage.createNiftiArray(n,s,c,f,g)}async niftiArray2NVImage(n=new Uint8Array){return await NVImage.loadFromUrl({url:n})}async loadFromUrl(n){return await NVImage.loadFromUrl({url:n})}async conform(n,s=!1,c=!0,f=!1){const v=this.conformVox2Vox(n.hdr.dims,n.hdr.affine.flat(),256,1,s),y=v[0],T=v[2],I=256*256*256,S=new Float32Array(I),k=new Float32Array(n.img),e=n.hdr.dims[1]*n.hdr.dims[2]*n.hdr.dims[3];if(n.hdr.scl_slope!==1||n.hdr.scl_inter!==0)for(let Q=0;Q=N||Ze>=M||nt>=O)continue;const Ue=me-xe,ye=pe-we,at=Se-Fe,ft=1-Ue,Tt=1-ye,Lt=1-at,Ot=V(xe,we,Fe);let Ft=0;Ft+=k[Ot]*ft*Tt*Lt,Ft+=k[Ot+z]*ft*Tt*at,Ft+=k[Ot+N]*ft*ye*Lt,Ft+=k[Ot+N+z]*ft*ye*at,Ft+=k[Ot+1]*Ue*Tt*Lt,Ft+=k[Ot+1+z]*Ue*Tt*at,Ft+=k[Ot+1+N]*Ue*ye*Lt,Ft+=k[Ot+1+N+z]*Ue*ye*at,S[B]=Ft}}else for(let Q=0;Q<256;Q++)for(let m=0;m<256;m++){const Z=m*T[1]+Q*T[2]+T[3],ee=m*T[5]+Q*T[6]+T[7],oe=m*T[9]+Q*T[10]+T[11];for(let fe=0;fe<256;fe++){const me=Math.round(fe*b+Z),pe=Math.round(fe*W+ee),Se=Math.round(fe*q+oe);B++,!(me<0||pe<0||Se<0)&&(me>=N||pe>=M||Se>=O||(S[B]=k[V(me,pe,Se)]))}}let Y=new Uint8Array;if(f){const Q=await this.getScale(n,0,1),m=await this.scalecropFloat32(S,0,1,Q[0],Q[1]);Y=await this.createNiftiArray([256,256,256],[1,1,1],Array.from(y),16,new Uint8Array(m.buffer))}else{const Q=await this.getScale(n,0,255),m=await this.scalecropUint8(S,0,255,Q[0],Q[1]);Y=await this.createNiftiArray([256,256,256],[1,1,1],Array.from(y),2,m)}return await this.niftiArray2NVImage(Y)}setRenderDrawAmbientOcclusion(n){if(!this.renderShader)throw new Error("renderShader undefined");this.renderDrawAmbientOcclusion=n,this.renderShader.use(this.gl),this.gl.uniform1fv(this.renderShader.uniforms.renderDrawAmbientOcclusion,[this.renderDrawAmbientOcclusion,1]),this.drawScene()}setColorMap(n,s){this.setColormap(n,s)}setColormapNegative(n,s){const c=this.getVolumeIndexByID(n);this.volumes[c].colormapNegative=s,this.updateGLVolume()}setModulationImage(n,s,c=0){const f=this.getVolumeIndexByID(n);let g=null;s.length>0&&(g=this.getVolumeIndexByID(s)),this.volumes[f].modulationImage=g,this.volumes[f].modulateAlpha=c,this.updateGLVolume()}setGamma(n=1){cmapper.gamma=n,this.updateGLVolume()}async loadDeferred4DVolumes(n){const s=this.getVolumeIndexByID(n),c=this.volumes[s];if(c.nTotalFrame4D<=c.nFrame4D)return;let f;c.fileObject?f=await NVImage.loadFromFile({file:c.fileObject}):f=await NVImage.loadFromUrl({url:c.url}),f&&(c.img=f.img.slice(),c.nTotalFrame4D=f.nTotalFrame4D,c.nFrame4D=f.nFrame4D,this.updateGLVolume())}setFrame4D(n,s){const c=this.getVolumeIndexByID(n),f=this.volumes[c];s>f.nFrame4D-1&&(s=f.nFrame4D-1),s<0&&(s=0),s!==f.frame4D&&(f.frame4D=s,this.updateGLVolume(),this.onFrameChange(f,s),this.createOnLocationChange())}getFrame4D(n){const s=this.getVolumeIndexByID(n);return this.volumes[s].frame4D}colormapFromKey(n){return cmapper.colormapFromKey(n)}colormap(n="",s=!1){return cmapper.colormap(n,s)}createColormapTexture(n=null,s=0,c=256){return n!==null&&this.gl.deleteTexture(n),s<1||c<1?null:(n=this.gl.createTexture(),this.gl.activeTexture(TEXTURE1_COLORMAPS),this.gl.bindTexture(this.gl.TEXTURE_2D,n),this.gl.texStorage2D(this.gl.TEXTURE_2D,1,this.gl.RGBA8,c,s),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_R,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,1),n)}addColormapList(n="",s=NaN,c=NaN,f=!1,g=!1,A=!0,v=!1){n.length<1&&(A=!1),this.colormapLists.push({name:n,min:s,max:c,alphaThreshold:f,negative:g,visible:A,invert:v})}refreshColormaps(){if(this.colormapLists=[],this.volumes.length<1&&this.meshes.length<1)return;const n=this.volumes.length;if(n>0)for(let A=0;A0)for(let A=0;Af[0]&&s>f[1]&&n=0&&this.screenSlices[c].axCorSag===4?c:-1}sliceScroll3D(n=0){if(n!==0){if(this.volumes.length>0&&this.scene.clipPlaneDepthAziElev[0]<1.8){const s=this.scene.clipPlaneDepthAziElev.slice();return n>0&&(s[0]=Math.min(1.5,s[0]+.025)),n<0&&(s[0]=Math.max(-1.5,s[0]-.025)),s[0]!==this.scene.clipPlaneDepthAziElev[0]?(this.scene.clipPlaneDepthAziElev=s,this.setClipPlane(this.scene.clipPlaneDepthAziElev)):void 0}n>0&&(this.scene.volScaleMultiplier=Math.min(2,this.scene.volScaleMultiplier*1.1)),n<0&&(this.scene.volScaleMultiplier=Math.max(.5,this.scene.volScaleMultiplier*.9)),this.drawScene()}}deleteThumbnail(){this.bmpTexture&&(this.gl.deleteTexture(this.bmpTexture),this.bmpTexture=null,this.thumbnailVisible=!1)}inGraphTile(n,s){if(this.graph.opacity<=0||this.volumes.length<1||this.volumes[0].nFrame4D<1||!this.graph.plotLTWH||this.graph.plotLTWH[2]<1||this.graph.plotLTWH[3]<1)return!1;const c=[(n-this.graph.LTWH[0])/this.graph.LTWH[2],(s-this.graph.LTWH[1])/this.graph.LTWH[3]];return c[0]>0&&c[1]>0&&c[0]<=1&&c[1]<=1}mouseClick(n,s,c=0,f=!0){if(n*=this.uiData.dpr,s*=this.uiData.dpr,this.canvas.focus(),this.thumbnailVisible){this.thumbnailVisible=!1,Promise.all([this.loadVolumes(this.deferredVolumes),this.loadMeshes(this.deferredMeshes)]).catch(g=>{throw g});return}if(this.inGraphTile(n,s)){if(!this.graph.plotLTWH)throw new Error("plotLTWH undefined");const g=[(n-this.graph.plotLTWH[0])/this.graph.plotLTWH[2],(s-this.graph.plotLTWH[1])/this.graph.plotLTWH[3]];if(g[0]>0&&g[1]>0&&g[0]<=1&&g[1]<=1){const A=Math.round(g[0]*(this.volumes[0].nFrame4D-1));this.setFrame4D(this.volumes[0].id,A);return}g[0]>.5&&g[1]>1&&this.loadDeferred4DVolumes(this.volumes[0].id).catch(A=>{throw A});return}if(this.inRenderTile(n,s)>=0){this.sliceScroll3D(c),this.drawScene();return}if(!(this.screenSlices.length<1||this.gl.canvas.height<1||this.gl.canvas.width<1))for(let g=0;g=0&&this.drawPenAxCorSag!==A||A>2)continue;const v=this.screenXY2TextureFrac(n,s,g,!1);if(!(v[0]<0)){if(!f){this.scene.crosshairPos[2-A]=c,this.drawScene();return}if(c!==0){let y=1;c<0&&(y=-1);const T=[0,0,0];T[2-A]=y,this.moveCrosshairInVox(T[0],T[1],T[2]),this.drawScene(),this.createOnLocationChange(A);return}if(this.opts.isForceMouseClickToVoxelCenters?this.scene.crosshairPos=clone$2(this.vox2frac(this.frac2vox(v))):this.scene.crosshairPos=clone$2(v),this.opts.drawingEnabled){const y=this.frac2vox(this.scene.crosshairPos);if(!isFinite(this.opts.penValue)||this.opts.penValue<0||Object.is(this.opts.penValue,-0)){isFinite(this.opts.penValue)?this.drawFloodFill(y,Math.abs(this.opts.penValue),this.opts.floodFillNeighbors):this.drawFloodFill(y,0,this.opts.penValue,this.opts.floodFillNeighbors);return}if(isNaN(this.drawPenLocation[0]))this.drawPenAxCorSag=A,this.drawPenFillPts=[],this.drawPt(...y,this.opts.penValue);else{if(y[0]===this.drawPenLocation[0]&&y[1]===this.drawPenLocation[1]&&y[2]===this.drawPenLocation[2])return;this.drawPenLine(y,this.drawPenLocation,this.opts.penValue)}this.drawPenLocation=y,this.opts.isFilledPen&&this.drawPenFillPts.push(y),this.refreshDrawing(!1)}this.drawScene(),this.createOnLocationChange(A);return}}}drawRuler(){let n=[],s=[];for(let y=0;y1){s=this.screenSlices[y].leftTopWidthHeight,n=this.screenSlices[y].fovMM;break}if(s.length<4)return;const f=100/n[0]*s[2],g=s[0]+.5*s[2]-.5*f,A=s[1]+s[3]-2*this.opts.rulerWidth,v=[g,A,g+f,A];this.drawRuler10cm(v)}drawRuler10cm(n){if(!this.lineShader)throw new Error("lineShader undefined");this.gl.bindVertexArray(this.genericVAO),this.lineShader.use(this.gl),this.gl.uniform4fv(this.lineShader.uniforms.lineColor,this.opts.rulerColor),this.gl.uniform2fv(this.lineShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform1f(this.lineShader.uniforms.thickness,this.opts.rulerWidth),this.gl.uniform4fv(this.lineShader.uniforms.startXYendXY,n),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4);const s=-.1*(n[0]-n[2]),c=n[1],f=c-2*this.opts.rulerWidth,g=c-4*this.opts.rulerWidth;for(let A=0;A<11;A++){const v=n[0]+A*s,y=[v,c,v,f];A%5===0&&(y[3]=g),this.gl.uniform4fv(this.lineShader.uniforms.startXYendXY,y),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)}this.gl.bindVertexArray(this.unusedVAO)}screenXY2mm(n,s,c=-1){let f;for(let g=0;g=0&&(A=c),this.screenSlices[A].axCorSag>2)continue;const y=this.screenSlices[A].leftTopWidthHeight;if(ny[0]+y[2]||s>y[1]+y[3]||(f=this.screenXY2TextureFrac(n,s,A,!1),f[0]<0))continue;const T=this.frac2mm(f);return fromValues$1(T[0],T[1],T[2],A)}return fromValues$1(NaN,NaN,NaN,NaN)}dragForPanZoom(n){const s=this.screenXY2mm(n[2],n[3]);if(isNaN(s[0]))return;const c=this.screenXY2mm(n[0],n[1],s[3]);if(isNaN(c[0])||isNaN(s[0])||isNaN(s[3]))return;const f=create$1(),g=this.uiData.pan2DxyzmmAtMouseDown[3];sub$3(f,s,c),this.scene.pan2Dxyzmm[0]=this.uiData.pan2DxyzmmAtMouseDown[0]+g*f[0],this.scene.pan2Dxyzmm[1]=this.uiData.pan2DxyzmmAtMouseDown[1]+g*f[1],this.scene.pan2Dxyzmm[2]=this.uiData.pan2DxyzmmAtMouseDown[2]+g*f[2]}dragForCenterButton(n){this.dragForPanZoom(n)}dragForSlicer3D(n){let s=this.uiData.pan2DxyzmmAtMouseDown[3];const c=n[3]-n[1];s+=c*.01,s=Math.max(s,.1),s=Math.min(s,10);const g=this.scene.pan2Dxyzmm[3]-s;this.opts.yoke3Dto2DZoom&&(this.scene.volScaleMultiplier=s),this.scene.pan2Dxyzmm[3]=s;const A=this.frac2mm(this.scene.crosshairPos);this.scene.pan2Dxyzmm[0]+=g*A[0],this.scene.pan2Dxyzmm[1]+=g*A[1],this.scene.pan2Dxyzmm[2]+=g*A[2]}drawMeasurementTool(n){const s=this.gl;if(s.bindVertexArray(this.genericVAO),s.depthFunc(s.ALWAYS),s.enable(s.BLEND),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),!this.lineShader)throw new Error("lineShader undefined");this.lineShader.use(this.gl),s.uniform4fv(this.lineShader.uniforms.lineColor,this.opts.rulerColor),s.uniform2fv(this.lineShader.uniforms.canvasWidthHeight,[s.canvas.width,s.canvas.height]),s.uniform1f(this.lineShader.uniforms.thickness,this.opts.rulerWidth),s.uniform4fv(this.lineShader.uniforms.startXYendXY,n),s.drawArrays(s.TRIANGLE_STRIP,0,4);const c=this.opts.rulerColor;c[3]=1,s.uniform4fv(this.lineShader.uniforms.lineColor,c);const f=this.opts.rulerWidth;s.uniform1f(this.lineShader.uniforms.thickness,f*2);let g=[n[0],n[1]-f,n[0],n[1]+f];s.uniform4fv(this.lineShader.uniforms.startXYendXY,g),s.drawArrays(s.TRIANGLE_STRIP,0,4),g=[n[2],n[3]-f,n[2],n[3]+f],s.uniform4fv(this.lineShader.uniforms.startXYendXY,g),s.drawArrays(s.TRIANGLE_STRIP,0,4);let A=this.canvasPos2frac([n[0],n[1]]),v=this.canvasPos2frac([n[2],n[3]]);if(A[0]>=0&&v[0]>=0){const y=this.frac2mm(A);A=fromValues$2(y[0],y[1],y[2]);const T=this.frac2mm(v);v=fromValues$2(T[0],T[1],T[2]);const I=create$2();sub$4(I,A,v);const S=len(I);let k=2;S>9&&(k=1),S>99&&(k=0);const e=S.toFixed(k);this.drawTextBetween(n,e,1,c)}s.bindVertexArray(this.unusedVAO)}drawRect(n,s=[1,0,0,-1]){if(s[3]<0&&(s=this.opts.crosshairColor),!this.rectShader)throw new Error("rectShader undefined");this.rectShader.use(this.gl),this.gl.enable(this.gl.BLEND),this.gl.uniform4fv(this.rectShader.uniforms.lineColor,s),this.gl.uniform2fv(this.rectShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform4f(this.rectShader.uniforms.leftTopWidthHeight,n[0],n[1],n[2],n[3]),this.gl.bindVertexArray(this.genericVAO),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}drawCircle(n,s=this.opts.fontColor,c=1){if(!this.circleShader)throw new Error("circleShader undefined");this.circleShader.use(this.gl),this.gl.enable(this.gl.BLEND),this.gl.uniform4fv(this.circleShader.uniforms.circleColor,s),this.gl.uniform2fv(this.circleShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform4f(this.circleShader.uniforms.leftTopWidthHeight,n[0],n[1],n[2],n[3]),this.gl.uniform1f(this.circleShader.uniforms.fillPercent,c),this.gl.uniform4fv(this.circleShader.uniforms.circleColor,s),this.gl.bindVertexArray(this.genericVAO),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}drawSelectionBox(n){this.drawRect(n,this.opts.selectionBoxColor)}effectiveCanvasHeight(){return this.gl.canvas.height-this.colorbarHeight}effectiveCanvasWidth(){return this.gl.canvas.width-this.getLegendPanelWidth()}getAllLabels(){const f=this.meshes.filter(A=>A.type==="connectome").flatMap(A=>A.nodes).map(A=>A.label).filter(A=>A!==void 0);return[...this.document.labels,...f]}getBulletMarginWidth(){let n=0;const s=this.getAllLabels();if(s.length===0)return 0;const c=s.length===1?s[0].style.bulletScale:s.reduce((A,v)=>A.style.bulletScale>v.style.bulletScale?A:v).style.bulletScale,f=s.length===1?s[0]:s.reduce((A,v)=>{const y=this.opts.textHeight*this.gl.canvas.height*A.style.textScale,T=this.opts.textHeight*this.gl.canvas.height*v.style.textScale;return this.textHeight(y,A.text)>this.textHeight(T,v.text)?A:v}),g=this.opts.textHeight*this.gl.canvas.height*f.style.textScale;return n=this.textHeight(g,f.text)*c,n+=g,n}getLegendPanelWidth(){const n=this.getAllLabels();if(!this.opts.showLegend||n.length===0)return 0;const c=this.opts.textHeight*this.gl.canvas.height*1;let f=0;const g=n.reduce((T,I)=>{const S=this.opts.textHeight*this.gl.canvas.height*T.style.textScale,k=this.opts.textHeight*this.gl.canvas.height*I.style.textScale;return this.textWidth(S,T.text)>this.textWidth(k,I.text)?T:I}),A=this.opts.textHeight*this.gl.canvas.height*g.style.textScale,v=this.textWidth(A,g.text),y=this.getBulletMarginWidth();return v&&(f=y+v,f+=c*2),f}getLegendPanelHeight(){const n=this.getAllLabels();let s=0;const f=this.opts.textHeight*this.gl.canvas.height*1;for(const g of n){const A=this.opts.textHeight*this.gl.canvas.height*g.style.textScale,v=this.textHeight(A,g.text);s+=v}return s&&(s+=f/2*(n.length+1)),s}reserveColorbarPanel(){let n=Math.max(this.opts.textHeight,.01);n=n*Math.min(this.gl.canvas.height,this.gl.canvas.width);const s=3*n,c=[0,this.gl.canvas.height-s,this.gl.canvas.width,s];return this.colorbarHeight=c[3]+1,c}drawColorbarCore(n=0,s=[0,0,0,0],c=!1,f=0,g=1,A){if(s[2]<=0||s[3]<=0)return;let v=Math.max(this.opts.textHeight,.01);v=v*Math.min(this.gl.canvas.height,this.gl.canvas.width);let y=v;const T=3*v;let I=v;if(s[3]0&&(N=f,f=0),f===g||v<1)return;const M=Math.abs(g-f);let[O,z]=tickSpacing(f,g);zf.includes(y)).reduce((v,y)=>v.lbwh[3]>y.lbwh[3]?v:y).lbwh[3];return n*A}drawChar(n,s,c){if(!this.fontShader)throw new Error("fontShader undefined");const f=this.fontMets.mets[c],g=n[0]+s*f.lbwh[0],A=-(s*f.lbwh[1]),v=s*f.lbwh[2],y=s*f.lbwh[3],T=n[1]+(A-y)+s;return this.gl.uniform4f(this.fontShader.uniforms.leftTopWidthHeight,g,T,v,y),this.gl.uniform4fv(this.fontShader.uniforms.uvLeftTopWidthHeight,f.uv_lbwh),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),s*f.xadv}drawLoadingText(n){if(!this.canvas)throw new Error("canvas undefined");this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.gl.enable(this.gl.CULL_FACE),this.gl.enable(this.gl.BLEND),this.drawTextBelow([this.canvas.width/2,this.canvas.height/2],n,3)}drawText(n,s,c=1,f=null){if(this.opts.textHeight<=0)return;if(!this.fontShader)throw new Error("fontShader undefined");this.fontShader.use(this.gl);const g=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*c;this.gl.enable(this.gl.BLEND),this.gl.uniform2f(this.fontShader.uniforms.canvasWidthHeight,this.gl.canvas.width,this.gl.canvas.height),f===null&&(f=this.opts.fontColor),this.gl.uniform4fv(this.fontShader.uniforms.fontColor,f);let A=g/this.fontMets.size*this.fontMets.distanceRange;A=Math.max(A,1),this.gl.uniform1f(this.fontShader.uniforms.screenPxRange,A);const v=new TextEncoder().encode(s);this.gl.bindVertexArray(this.genericVAO);for(let y=0;y.8?T=[0,0,0,.5]:T=[1,1,1,.5],this.drawRect(y,T),this.drawText(g,s,c,f)}drawTextBelow(n,s,c=1,f=null){if(this.opts.textHeight<=0)return;if(!this.canvas)throw new Error("canvas undefined");let g=this.opts.textHeight*this.gl.canvas.height*c,A=this.textWidth(g,s);A>this.canvas.width&&(c*=(this.canvas.width-2)/A,g=this.opts.textHeight*this.gl.canvas.height*c,A=this.textWidth(g,s)),n[0]-=.5*this.textWidth(g,s),n[0]=Math.max(n[0],1),n[0]=Math.min(n[0],this.canvas.width-A-1),this.drawText(n,s,c,f)}updateInterpolation(n,s=!1){let c=this.gl.LINEAR;!s&&this.opts.isNearestInterpolation&&(c=this.gl.NEAREST),n===0?this.gl.activeTexture(TEXTURE0_BACK_VOL):this.gl.activeTexture(TEXTURE2_OVERLAY_VOL),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_MIN_FILTER,c),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_MAG_FILTER,c)}setAtlasOutline(n){this.opts.atlasOutline=n,this.updateGLVolume(),this.drawScene()}setInterpolation(n){this.opts.isNearestInterpolation=n;const s=this.volumes.length;if(!(s<1)){for(let c=0;c0){this.opts.meshThicknessOn2D!==1/0&&(M=this.calculateMvpMatrix2D(n,g.mnMM,g.mxMM,this.opts.meshThicknessOn2D,N,T,y,v));const z=clone$3(M.modelViewProjectionMatrix);multiply$2(z,z,A),this.drawMesh3D(!0,1,z,M.modelMatrix,M.normalMatrix)}isNaN(c)&&this.drawCrosshairs3D(!1,.15,M.modelViewProjectionMatrix,!0,this.opts.isSliceMM),this.drawSliceOrientationText(n,s),this.readyForSync=!0}calculateMvpMatrix(n,s=[0,0,0,0],c,f){(s[2]===0||s[3]===0)&&(s=[0,0,this.gl.canvas.width,this.gl.canvas.height]);const g=s[2]/s[3];let A=this.furthestFromPivot;const v=this.pivot3D,y=create$3();A=.8*A/this.scene.volScaleMultiplier,g<1?ortho(y,-A,A,-A/g,A/g,A*.01,A*8):ortho(y,-A*g,A*g,-A,A,A*.01,A*8);const T=create$3();T[0]=-1;const I=fromValues$2(0,0,-A*1.8);translate(T,T,I),this.position&&translate(T,T,this.position),rotateX(T,T,deg2rad(270-f)),rotateZ(T,T,deg2rad(c-180)),translate(T,T,[-v[0],-v[1],-v[2]]);const S=create$3();invert(S,T);const k=create$3();transpose$3(k,S);const e=create$3();return multiply$2(e,y,T),[e,T,k]}calculateModelMatrix(n,s){if(!this.back)throw new Error("back undefined");const c=create$3();if(c[0]=-1,rotateX(c,c,deg2rad(270-s)),rotateZ(c,c,deg2rad(n-180)),this.back.obliqueRAS){const f=clone$3(this.back.obliqueRAS);multiply$2(c,c,f)}return c}calculateRayDirection(n,s){const c=this.calculateModelMatrix(n,s),f=fromValues$3(1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,1),g=create$3();multiply$2(g,f,c);const A=create$3();invert(A,g);const v=fromValues$1(0,0,-1,1);transformMat4(v,v,A);const y=fromValues$2(v[0],v[1],v[2]);normalize$1(y,y);const T=5e-5;return Math.abs(y[0])0){if(!this.volumeObject3D)throw new Error("volumeObject3D undefined");s=fromValues$2(this.volumeObject3D.extentsMin[0],this.volumeObject3D.extentsMin[1],this.volumeObject3D.extentsMin[2]),c=fromValues$2(this.volumeObject3D.extentsMax[0],this.volumeObject3D.extentsMax[1],this.volumeObject3D.extentsMax[2]),n||(s=fromValues$2(this.volumes[0].extentsMinOrtho[0],this.volumes[0].extentsMinOrtho[1],this.volumes[0].extentsMinOrtho[2]),c=fromValues$2(this.volumes[0].extentsMaxOrtho[0],this.volumes[0].extentsMaxOrtho[1],this.volumes[0].extentsMaxOrtho[2]))}if(this.meshes.length>0){if(this.volumes.length<1){const g=this.meshes[0].extentsMin,A=this.meshes[0].extentsMax;s=fromValues$2(g[0],g[1],g[2]),c=fromValues$2(A[0],A[1],A[2])}for(let g=0;gthis.gl.canvas.width||n.LTWH[1]+n.LTWH[3]>this.gl.canvas.height)return;n.backColor=[.15,.15,.15,n.opacity],n.lineColor=[1,1,1,1],this.opts.backColor[0]+this.opts.backColor[1]+this.opts.backColor[2]>1.5&&(n.backColor=[.95,.95,.95,n.opacity],n.lineColor=[0,0,0,1]),n.textColor=n.lineColor.slice(),n.lineThickness=4,n.lineAlpha=1,n.lines=[];const c=[];if(n.vols.length<1)this.volumes[0]!=null&&c.push(0);else for(let ee=0;eeg){const ee=A-g;for(let oe=0;oe=A&&(A=g+1),this.drawRect(n.LTWH,n.backColor);const[v,y,T]=tickSpacing(g,A),I=Math.max(0,-1*Math.floor(Math.log(v)/Math.log(10)));g=Math.min(y,g),A=Math.max(T,A);function S(ee){return ee.toFixed(6).replace(/\.?0*$/,"")}const e=.07*(Math.min(n.LTWH[2],n.LTWH[3])/(this.fontMets.size*this.uiData.dpr));let N=this.opts.textHeight*this.gl.canvas.height*e;N<16&&(N=0);let M=0,O=y;if(N>0)for(;O<=A;){const ee=O.toFixed(I),oe=this.textWidth(N,ee);M=Math.max(oe,M),O+=v}const z=.05,B=Math.abs(n.LTWH[2]),V=Math.abs(n.LTWH[3]),b=[n.LTWH[0]+z*B+M,n.LTWH[1]+z*V,n.LTWH[2]-M-2*z*B,n.LTWH[3]-N-2*z*V];this.graph.LTWH=n.LTWH,this.graph.plotLTWH=b,this.drawRect(b,this.opts.backColor);const W=A-g,q=b[3]/W,Y=b[2]/(n.lines[0].length-1),X=b[1]+b[3];O=y+.5*v;const Q=n.lineColor.slice();for(Q[3]=.25*n.lineColor[3];O<=A;){const ee=X-(O-g)*q;this.drawLine([b[0],ee,b[0]+b[2],ee],.5*n.lineThickness,Q),O+=v}O=y;const m=.5*n.lineThickness;for(;O<=A;){const ee=X-(O-g)*q;this.drawLine([b[0]-m,ee,b[0]+b[2]+n.lineThickness,ee],n.lineThickness,n.lineColor);const oe=O.toFixed(I);N>0&&this.drawTextLeft([b[0]-6,ee],oe,e,n.textColor),O+=v}let Z=1;for(;n.lines[0].length/Z>20;)Z*=5;for(let ee=0;ee0&&this.drawTextBelow([oe,2+b[1]+b[3]],me,e,n.textColor),this.drawLine([oe,b[1],oe,b[1]+b[3]],fe,n.lineColor)}}for(let ee=0;ee=0&&n.selectedColumnk/255);return}const v=unpackFloatFromVec4i(A);if(v>1)return;const y=(this.mousePos[0]-n[0])/n[2],T=(c.canvas.height-this.mousePos[1]-n[1])/n[3],I=unProject(y,T,v,s),S=this.mm2frac(I,0,!0);S[0]<0||S[0]>1||S[1]<0||S[1]>1||S[2]<0||S[2]>1||(this.scene.crosshairPos=this.mm2frac(I,0,!0))}drawImage3D(n,s,c){if(this.volumes.length===0)return;const f=this.gl,g=this.calculateRayDirection(s,c),A=this.volumeObject3D;if(A){f.enable(f.BLEND),f.blendFunc(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA),f.enable(f.CULL_FACE),f.cullFace(f.FRONT);let v=this.renderShader;if(this.uiData.mouseDepthPicker&&(v=this.pickingImageShader),v.use(this.gl),f.uniform1i(v.uniforms.backgroundMasksOverlays,this.backgroundMasksOverlays),this.gradientTextureAmount>0){f.activeTexture(TEXTURE6_GRADIENT),f.bindTexture(f.TEXTURE_3D,this.gradientTexture);const y=this.calculateModelMatrix(s,c),T=create$3();invert(T,y);const I=create$3();transpose$3(I,T),f.uniformMatrix4fv(v.uniforms.normMtx,!1,I)}this.drawBitmap&&this.drawBitmap.length>8?f.uniform2f(v.uniforms.renderDrawAmbientOcclusionXY,this.renderDrawAmbientOcclusion,this.drawOpacity):f.uniform2f(v.uniforms.renderDrawAmbientOcclusionXY,this.renderDrawAmbientOcclusion,0),f.uniformMatrix4fv(v.uniforms.mvpMtx,!1,n),f.uniformMatrix4fv(v.uniforms.matRAS,!1,this.back.matRAS),f.uniform3fv(v.uniforms.rayDir,g),this.gradientTextureAmount<0?f.uniform4fv(v.uniforms.clipPlane,[this.scene.crosshairPos[0],this.scene.crosshairPos[1],this.scene.crosshairPos[2],30]):f.uniform4fv(v.uniforms.clipPlane,this.scene.clipPlane),f.uniform1f(v.uniforms.drawOpacity,1),f.bindVertexArray(A.vao),f.drawElements(A.mode,A.indexCount,f.UNSIGNED_SHORT,0),f.bindVertexArray(this.unusedVAO)}}drawOrientationCube(n,s=0,c=0){if(!this.opts.isOrientCube)return;const f=.05*Math.min(n[2],n[3]);if(f<5)return;const g=this.gl;g.enable(g.CULL_FACE),g.cullFace(g.BACK),this.orientCubeShader.use(this.gl),g.bindVertexArray(this.orientCubeShaderVAO);const A=create$3(),v=create$3();ortho(v,0,g.canvas.width,0,g.canvas.height,-10*f,10*f);let y=0;n[1]===0&&(y=g.canvas.height-this.effectiveCanvasHeight()),translate(A,A,[1.8*f+n[0],y+1.8*f+n[1],0]),scale$4(A,A,[f,f,f]),rotateX(A,A,deg2rad(270-c)),rotateZ(A,A,deg2rad(-s));const T=create$3();multiply$2(T,v,A),g.uniformMatrix4fv(this.orientCubeShader.uniforms.u_matrix,!1,T),g.drawArrays(g.TRIANGLE_STRIP,0,168),g.bindVertexArray(this.unusedVAO),this.gl.disable(this.gl.CULL_FACE)}createOnLocationChange(n=NaN){const[s,c,f]=this.sceneExtentsMinMax(!0),g=Math.max(Math.max(f[0],f[1]),f[2]);function A(k){return Math.max(0,-Math.ceil(Math.log10(Math.abs(k))))}let v=A(g*.001);const y=this.frac2mm(this.scene.crosshairPos,0,!0);function T(k,e=0){return parseFloat(k.toFixed(e))}let I=T(y[0],v)+"×"+T(y[1],v)+"×"+T(y[2],v);if(this.volumes.length>0&&this.volumes[0].nFrame4D>0&&(I+="×"+T(this.volumes[0].frame4D)),this.volumes.length>0){let k=" = ";for(let M=0;M=0&&B=0&&(k+="+"),k+=T(z,v)),k+=" "}I+=k;const e=this.back.dimsRAS,N=e[1]*e[2]*e[3];if(this.drawBitmap&&this.drawBitmap.length===N){const M=this.frac2vox(this.scene.crosshairPos),O=M[0]+M[1]*e[1]+M[2]*e[1]*e[2];I+=" "+this.drawLut.labels[this.drawBitmap[O]]}}const S={mm:this.frac2mm(this.scene.crosshairPos,0,!0),axCorSag:n,vox:this.frac2vox(this.scene.crosshairPos),frac:this.scene.crosshairPos,xy:[this.mousePos[0],this.mousePos[1]],values:this.volumes.map(k=>{const e=this.frac2mm(this.scene.crosshairPos,0,!0),N=k.mm2vox(e),M=k.getValue(N[0],N[1],N[2],k.frame4D);return{name:k.name,value:M,id:k.id,mm:e,vox:N}}),string:I};this.onLocationChange(S)}addLabel(n,s,c){const f={textColor:this.opts.legendTextColor,textScale:1,textAlignment:"left",lineWidth:0,lineColor:this.opts.legendTextColor,lineTerminator:"none",bulletScale:0,bulletColor:this.opts.legendTextColor},g=s?{...f,...s}:{...f},A=new NVLabel3D(n,g,c);return this.document.labels.push(A),A}calculateScreenPoint(n,s,c){const f=create$1();return transformMat4(f,[...n,1],s),f[3]!==0&&(f[0]=(f[0]/f[3]+1)*.5*c[2],f[1]=(1-f[1]/f[3])*.5*c[3],f[2]/=f[3],f[0]+=c[0],f[1]+=c[1]),f}getLabelAtPoint(n){log$4.debug("screenPoint",n);const s=this.getLegendPanelHeight(),c=this.getLegendPanelWidth(),f=this.gl.canvas.width-c;let g=(this.canvas.height-s)/2;if(log$4.debug("panelrect",f,g,f+c,g+s),n[0]f+c||n[1]>g+s)return null;const v=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*1,y=this.getAllLabels();for(const T of y){const I=this.opts.textHeight*this.gl.canvas.height*T.style.textScale,S=this.textHeight(I,T.text);if(n[1]>=g&&n[1]<=g+S+v/2)return T;g+=S,g+=v/2}return null}drawLabelLine(n,s,c,f,g=!1){const A=Array.isArray(n.points)&&Array.isArray(n.points[0])?n.points:[n.points];for(const v of A){const y=this.calculateScreenPoint(v,c,f);g?this.drawDottedLine([...s,y[0],y[1]],n.style.lineWidth,n.style.lineColor):this.draw3DLine(s,[y[0],y[1],y[2]],n.style.lineWidth,n.style.lineColor)}}draw3DLabel(n,s,c,f,g=0,A,v=!1){const y=n.text,T=s[0],I=s[1],S=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*1,k=this.textHeight(n.style.textScale,y)*S;if(n.style.lineWidth>0&&Array.isArray(n.points)&&this.drawLabelLine(n,[T,I+k],c,f,v),n.style.bulletScale){const N=n.style.bulletScale*k,M=k-N,O=I+M/2+N/2,z=T+(g-N)/2;this.drawCircle([z,O,N,N],n.style.bulletColor)}let e=T;if(n.style.textAlignment!=="left"){const N=this.textWidth(n.style.textScale,n.text)*S;if(n.style.textAlignment==="right")e=T+A-S*1.5-N;else{const M=A-(g||S);e+=(M-N)/2}}else e+=g;this.drawText([e,I],y,n.style.textScale,n.style.textColor)}draw3DLabels(n,s,c=!1){const f=this.getAllLabels();if(!this.opts.showLegend||f.length===0)return;if(!this.canvas)throw new Error("canvas undefined");const g=this.gl;g.disable(g.CULL_FACE),g.viewport(0,0,this.canvas.width,this.canvas.height);const v=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*1,y=this.getBulletMarginWidth(),T=this.getLegendPanelHeight(),I=this.getLegendPanelWidth(),S=g.canvas.width-I;let k=(this.canvas.height-T)/2;this.drawRect([g.canvas.width-I,k,I-v,T],this.opts.legendBackgroundColor);const e=g.getParameter(g.BLEND),N=g.getParameter(g.DEPTH_FUNC);c||(g.disable(g.BLEND),g.depthFunc(g.GREATER));for(const M of f){this.draw3DLabel(M,[S,k],n,s,y,I,c);const O=this.opts.textHeight*this.gl.canvas.height*M.style.textScale,z=this.textHeight(O,M.text);k+=z,k+=v/2}c||(g.depthFunc(N),e&&g.enable(g.BLEND))}draw3D(n=[0,0,0,0],s=null,c=null,f=null,g=null,A=0){const v=g!==null;this.setPivot3D(),v||(g=this.scene.renderAzimuth,A=this.scene.renderElevation);const y=this.gl;s===null&&([s,c,f]=this.calculateMvpMatrix(null,n,g,A));let T=[...n];if(n[2]===0||n[3]===0?(n=[0,0,y.canvas.width,y.canvas.height],T=[...n],this.screenSlices.push({leftTopWidthHeight:n,axCorSag:4,sliceFrac:0,AxyzMxy:[],leftTopMM:[],fovMM:[isRadiological(c),0]})):(this.screenSlices.push({leftTopWidthHeight:n.slice(),axCorSag:4,sliceFrac:0,AxyzMxy:[],leftTopMM:[],fovMM:[isRadiological(c),0]}),n[1]=y.canvas.height-n[3]-n[1]),y.enable(y.DEPTH_TEST),y.depthFunc(y.ALWAYS),y.depthMask(!0),y.clearDepth(0),this.draw3DLabels(s,T,!1),y.viewport(n[0],n[1],n[2],n[3]),this.updateInterpolation(0,!0),this.volumes.length>0&&this.drawImage3D(s,g,A),this.updateInterpolation(0),v||this.drawCrosshairs3D(!0,1,s),this.drawMesh3D(!0,1,s,c,f),this.uiData.mouseDepthPicker){this.depthPicker(n,s),this.createOnLocationChange(),this.draw3D(n,s,c,f,g,A);return}this.opts.meshXRay>0&&this.drawMesh3D(!1,this.opts.meshXRay,s,c,f),this.draw3DLabels(s,T,!1),y.viewport(n[0],n[1],n[2],n[3]),v||this.drawCrosshairs3D(!1,.15,s),y.viewport(0,0,y.canvas.width,y.canvas.height),this.drawOrientationCube(n,g,A);const I="azimuth: "+this.scene.renderAzimuth.toFixed(0)+" elevation: "+this.scene.renderElevation.toFixed(0);return this.readyForSync=!0,this.sync(),this.draw3DLabels(s,T,!0),I}drawMesh3D(n=!0,s=1,c,f,g){if(this.meshes.length<1)return;const A=this.gl;c||([c,f,g]=this.calculateMvpMatrix(this.volumeObject3D,void 0,this.scene.renderAzimuth,this.scene.renderElevation)),A.enable(A.DEPTH_TEST),A.blendFunc(A.SRC_ALPHA,A.ONE_MINUS_SRC_ALPHA),A.disable(A.BLEND),A.depthFunc(A.GREATER),A.disable(A.CULL_FACE),n?(A.disable(A.BLEND),A.depthFunc(A.GREATER)):(A.enable(A.BLEND),A.depthFunc(A.ALWAYS),A.enable(A.CULL_FACE)),A.cullFace(A.BACK);let v=this.meshShaders[0].shader,y=!1;for(let T=0;T=3&&this.meshes[T].fiberRadius>0||(A.bindVertexArray(this.meshes[T].vaoFiber),A.drawElements(A.LINE_STRIP,this.meshes[T].indexCount,A.UNSIGNED_INT,0),A.bindVertexArray(this.unusedVAO)));A.enable(A.BLEND),A.depthFunc(A.ALWAYS),this.readyForSync=!0}drawCrosshairs3D(n=!0,s=1,c=null,f=!1,g=!0){if(!this.opts.show3Dcrosshair&&!f||this.opts.crosshairWidth<=0&&f)return;const A=this.gl,v=this.frac2mm(this.scene.crosshairPos,0,g);if(this.crosshairs3D===null||this.crosshairs3D.mm[0]!==v[0]||this.crosshairs3D.mm[1]!==v[1]||this.crosshairs3D.mm[2]!==v[2]){this.crosshairs3D!==null&&(A.deleteBuffer(this.crosshairs3D.indexBuffer),A.deleteBuffer(this.crosshairs3D.vertexBuffer));const[I,S,k]=this.sceneExtentsMinMax(g);let e=1;if(this.volumes.length>0){if(!this.back)throw new Error("back undefined");e=.5*Math.min(Math.min(this.back.pixDims[1],this.back.pixDims[2]),this.back.pixDims[3])}else(k[0]<50||k[0]>1e3)&&(e=k[0]*.02);e*=this.opts.crosshairWidth,this.crosshairs3D=NiivueObject3D.generateCrosshairs(this.gl,1,v,I,S,e,20,this.opts.crosshairGap),this.crosshairs3D.mm=v}if(!this.surfaceShader)throw new Error("surfaceShader undefined");const y=this.surfaceShader;y.use(this.gl),c==null&&([c]=this.calculateMvpMatrix(this.crosshairs3D,void 0,this.scene.renderAzimuth,this.scene.renderElevation)),A.uniformMatrix4fv(y.uniforms.mvpMtx,!1,c),A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,this.crosshairs3D.indexBuffer),A.enable(A.DEPTH_TEST);const T=[...this.opts.crosshairColor];n?(A.disable(A.BLEND),A.depthFunc(A.GREATER)):(A.enable(A.BLEND),A.blendFunc(A.SRC_ALPHA,A.ONE_MINUS_SRC_ALPHA),A.depthFunc(A.ALWAYS)),T[3]=s,A.uniform4fv(y.uniforms.surfaceColor,T),A.bindVertexArray(this.crosshairs3D.vao),A.drawElements(A.TRIANGLES,this.crosshairs3D.indexCount,A.UNSIGNED_INT,0),A.bindVertexArray(this.unusedVAO)}mm2frac(n,s=0,c=!1){if(this.volumes.length<1){const f=fromValues$2(.1,.5,.5),[g,A,v]=this.sceneExtentsMinMax();return f[0]=(n[0]-g[0])/v[0],f[1]=(n[1]-g[1])/v[1],f[2]=(n[2]-g[2])/v[2],isFinite(f)||(isFinite(f[0])||(f[0]=.5),isFinite(f[1])||(f[1]=.5),isFinite(f[2])||(f[2]=.5),this.meshes.length<1&&log$4.error("mm2frac() not finite: objects not (yet) loaded.")),f}return this.volumes[s].convertMM2Frac(n,c||this.opts.isSliceMM)}vox2frac(n,s=0){return this.volumes[s].convertVox2Frac(n)}frac2vox(n,s=0){return this.volumes.length<=s?[0,0,0]:this.volumes[s].convertFrac2Vox(n)}moveCrosshairInVox(n,s,c){const f=this.frac2vox(this.scene.crosshairPos);f[0]+=n,f[1]+=s,f[2]+=c,f[0]=clamp$1(f[0],0,this.volumes[0].dimsRAS[1]-1),f[1]=clamp$1(f[1],0,this.volumes[0].dimsRAS[2]-1),f[2]=clamp$1(f[2],0,this.volumes[0].dimsRAS[3]-1),this.scene.crosshairPos=this.vox2frac(f),this.createOnLocationChange(),this.drawScene()}frac2mm(n,s=0,c=!1){const f=fromValues$1(n[0],n[1],n[2],1);if(this.volumes.length>0)return this.volumes[s].convertFrac2MM(n,c||this.opts.isSliceMM);{const[g,A]=this.sceneExtentsMinMax(),v=(y,T,I)=>y*(1-I)+T*I;f[0]=v(g[0],A[0],n[0]),f[1]=v(g[1],A[1],n[1]),f[2]=v(g[2],A[2],n[2])}return f}screenXY2TextureFrac(n,s,c,f=!0){const g=fromValues$2(-1,-1,-1),A=this.screenSlices[c].axCorSag;if(A>2)return g;const v=this.screenSlices[c].leftTopWidthHeight.slice();let y=!1;v[2]<0&&(y=!0,v[0]+=v[2],v[2]=-v[2]);let T=(n-v[0])/v[2];y&&(T=1-T);const I=1-(s-v[1])/v[3];if(T<0||T>1||I<0||I>1||this.screenSlices[c].AxyzMxy.length<4)return g;let S=fromValues$2(0,0,0);S[0]=this.screenSlices[c].leftTopMM[0]+T*this.screenSlices[c].fovMM[0],S[1]=this.screenSlices[c].leftTopMM[1]+I*this.screenSlices[c].fovMM[1];const k=this.screenSlices[c].AxyzMxy;S[2]=k[2]+k[4]*(S[1]-k[1])-k[3]*(S[0]-k[0]),A===1&&(S=swizzleVec3(S,[0,2,1])),A===2&&(S=swizzleVec3(S,[2,0,1]));const e=this.mm2frac(S);return f&&(e[0]<0||e[0]>1||e[1]<0||e[1]>1||e[2]<0||e[2]>1)?g:e}canvasPos2frac(n){for(let s=0;s=0)return c}return[-1,-1,-1]}scaleSlice(n,s,c=0,f=0){const g=this.effectiveCanvasWidth()-c,A=this.effectiveCanvasHeight()-f;let v=g/n;s*v>A&&(v=A/s);const y=n*v,T=s*v;return[(g-y)*.5,(A-T)*.5,y,T,v]}drawThumbnail(){if(!this.bmpShader)throw new Error("bmpShader undefined");this.bmpShader.use(this.gl),this.gl.uniform2f(this.bmpShader.uniforms.canvasWidthHeight,this.gl.canvas.width,this.gl.canvas.height);let n=this.gl.canvas.height,s=this.gl.canvas.height*this.bmpTextureWH;s>this.gl.canvas.width&&(n=this.gl.canvas.width/this.bmpTextureWH,s=this.gl.canvas.width),this.gl.uniform4f(this.bmpShader.uniforms.leftTopWidthHeight,0,0,s,n),this.gl.bindVertexArray(this.genericVAO),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}drawLine(n,s=1,c=[1,0,0,-1]){if(this.gl.bindVertexArray(this.genericVAO),!this.lineShader)throw new Error("lineShader undefined");this.lineShader.use(this.gl),c[3]<0&&(c=this.opts.crosshairColor),this.gl.uniform4fv(this.lineShader.uniforms.lineColor,c),this.gl.uniform2fv(this.lineShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform1f(this.lineShader.uniforms.thickness,s),this.gl.uniform4fv(this.lineShader.uniforms.startXYendXY,n),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}draw3DLine(n,s,c=1,f=[1,0,0,-1]){if(this.gl.bindVertexArray(this.genericVAO),!this.line3DShader)throw new Error("line3DShader undefined");this.line3DShader.use(this.gl),f[3]<0&&(f=this.opts.crosshairColor),this.gl.uniform4fv(this.line3DShader.uniforms.lineColor,f),this.gl.uniform2fv(this.line3DShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform1f(this.line3DShader.uniforms.thickness,c),this.gl.uniform2fv(this.line3DShader.uniforms.startXY,n),this.gl.uniform3fv(this.line3DShader.uniforms.endXYZ,s),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}drawDottedLine(n,s=1,c=[1,0,0,-1]){if(this.gl.bindVertexArray(this.genericVAO),!this.lineShader)throw new Error("lineShader undefined");this.lineShader.use(this.gl);const f=c[3]<0?[...this.opts.crosshairColor]:[...c];f[3]=.3;const g=fromValues(n[2]-n[0],n[3]-n[1]),A=length(g);normalize(g,g);const y=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*1;scale$1(g,g,y/2);const T=length(g);let I=Math.floor(A/T);A%T&&I++;const S=[n[0],n[1]];this.gl.uniform4fv(this.lineShader.uniforms.lineColor,f),this.gl.uniform2fv(this.lineShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform1f(this.lineShader.uniforms.thickness,s);for(let k=0;k0&&s===0){const e=v,N=1;for(let M=0;M0&&s===1){const e=v,N=2;for(let M=0;M0&&s===2){const e=v,N=2;for(let M=0;M0&&s===0){const e=v,N=0;for(let M=0;M0&&s===1){const e=v,N=0;for(let M=0;M0&&s===2){const e=v,N=1;for(let M=0;M0){const T=A.leftTopWidthHeight.slice();let I=2;s===0&&(I=1);const S=this.frac2mm([.5,.5,.5]);for(let k=0;k0){const T=A.leftTopWidthHeight.slice(),I=A.fovMM[0]<0;let S=0;s===2&&(S=1);const k=this.frac2mm([.5,.5,.5]);for(let e=0;e"u"){if(this.meshes.length>0){this.screenSlices=[],this.opts.sliceType=4,this.draw3D(),this.opts.isColorbar&&this.drawColorbar();return}this.drawLoadingText(this.loadingText);return}if(this.back===null)return;if(this.uiData.isDragging&&this.scene.clipPlaneDepthAziElev[0]<1.8&&this.inRenderTile(this.uiData.dragStart[0],this.uiData.dragStart[1])>=0){const g=this.uiData.dragStart[0]-this.uiData.dragEnd[0],A=this.uiData.dragStart[1]-this.uiData.dragEnd[1],v=this.uiData.dragClipPlaneStartDepthAziElev.slice();if(v[1]-=g,v[1]=v[1]%360,v[2]+=A,v[1]!==this.scene.clipPlaneDepthAziElev[1]||v[2]!==this.scene.clipPlaneDepthAziElev[2])return this.scene.clipPlaneDepthAziElev=v,this.setClipPlane(this.scene.clipPlaneDepthAziElev)}if(this.sliceMosaicString.length<1&&this.opts.sliceType===4){this.opts.isColorbar&&this.reserveColorbarPanel(),this.screenSlices=[],this.draw3D(),this.opts.isColorbar&&this.drawColorbar();return}this.opts.isColorbar&&this.reserveColorbarPanel();const s=this.getMaxVols(),c=this.opts.sliceType===3&&s>1&&this.graph.autoSizeMultiplanar&&this.graph.opacity>0;if(this.sliceMosaicString.length>0)this.drawMosaic(this.sliceMosaicString);else if(this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.screenSlices=[],this.opts.sliceType===0)this.draw2D([0,0,0,0],0);else if(this.opts.sliceType===1)this.draw2D([0,0,0,0],1);else if(this.opts.sliceType===2)this.draw2D([0,0,0,0],2);else{const g=isFinite(this.drawPenLocation[0])&&this.opts.drawingEnabled,{volScale:A}=this.sliceScale();typeof this.opts.multiplanarPadPixels!="number"&&log$4.debug("multiplanarPadPixels must be numeric");const v=parseFloat(`${this.opts.multiplanarPadPixels}`),y=this.scaleSlice(A[0]+A[1],A[1]+A[2],v*1,v*1),T=Math.max(Math.max(A[1],A[2]),A[0]),I=this.scaleSlice(A[0]+A[0]+A[1],Math.max(A[1],A[2]),v*2),S=this.scaleSlice(A[0]+A[0]+A[1]+T,Math.max(A[1],A[2]),v*3),k=this.scaleSlice(T,A[1]+A[2]+A[2],0,v*2),e=this.scaleSlice(T,A[1]+A[2]+A[2]+T,0,v*3);let N=!g&&(s<2||!c),M=!1,O=!1,z=!1;if(this.opts.multiplanarLayout===1?M=!0:this.opts.multiplanarLayout===2?O=!0:this.opts.multiplanarLayout===3?z=!0:k[4]>I[4]&&k[4]>y[4]?M=!0:I[4]>y[4]?z=!0:O=!0,M){let B=k;this.opts.multiplanarForceRender||e[4]>=k[4]?B=e:N=!1;const V=A[0]*B[4],b=A[1]*B[4],W=A[2]*B[4],q=T*B[4];this.draw2D([B[0],B[1],V,b],0),this.draw2D([B[0],B[1]+b+v,V,W],1),this.draw2D([B[0],B[1]+b+v+W+v,b,W],2),N&&this.draw3D([B[0],B[1]+b+W+W+v*3,q,q])}else if(z){let B=I;this.opts.multiplanarForceRender||S[4]>=I[4]?B=S:N=!1;const V=A[0]*B[4],b=A[1]*B[4],W=A[2]*B[4];this.draw2D([B[0],B[1],V,b],0),this.draw2D([B[0]+V+v,B[1],V,W],1),this.draw2D([B[0]+V+V+v*2,B[1],b,W],2),N&&this.draw3D([B[0]+V+V+b+v*3,B[1],B[3],B[3]])}else if(O){const B=y,V=A[0]*B[4],b=A[1]*B[4],W=A[2]*B[4];this.draw2D([B[0],B[1]+W+v,V,b],0),this.draw2D([B[0],B[1],V,W],1),this.draw2D([B[0]+V+v,B[1],b,W],2),N&&this.draw3D([B[0]+V+v,B[1]+W+v,b,b])}}if(this.opts.isRuler&&this.drawRuler(),this.opts.isColorbar&&this.drawColorbar(),c&&this.drawGraph(),this.uiData.isDragging){if(this.uiData.mouseButtonCenterDown){this.dragForCenterButton([this.uiData.dragStart[0],this.uiData.dragStart[1],this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);return}if(this.opts.dragMode===4){this.dragForSlicer3D([this.uiData.dragStart[0],this.uiData.dragStart[1],this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);return}if(this.opts.dragMode===3){this.dragForPanZoom([this.uiData.dragStart[0],this.uiData.dragStart[1],this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);return}if(this.inRenderTile(this.uiData.dragStart[0],this.uiData.dragStart[1])>=0)return;if(this.opts.dragMode===2){this.drawMeasurementTool([this.uiData.dragStart[0],this.uiData.dragStart[1],this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);return}const g=Math.abs(this.uiData.dragStart[0]-this.uiData.dragEnd[0]),A=Math.abs(this.uiData.dragStart[1]-this.uiData.dragEnd[1]);this.drawSelectionBox([Math.min(this.uiData.dragStart[0],this.uiData.dragEnd[0]),Math.min(this.uiData.dragStart[1],this.uiData.dragEnd[1]),g,A])}const f=this.frac2mm([this.scene.crosshairPos[0],this.scene.crosshairPos[1],this.scene.crosshairPos[2]]);return n=f[0].toFixed(2)+"×"+f[1].toFixed(2)+"×"+f[2].toFixed(2),this.readyForSync=!0,this.sync(),n}drawScene(){if(this.isBusy){this.needsRefresh=!0;return}this.isBusy=!1,this.needsRefresh=!1;let n=this.drawSceneCore();return this._gl!==null&&this.gl.finish(),this.needsRefresh&&(n=this.drawScene()),n}get gl(){if(!this._gl)throw new Error("unable to get WebGL context. Maybe the browser doesn't support WebGL2.");return this._gl}set gl(n){this._gl=n}};/** + `}saveHTML(n="untitled.html",s="gl1",c){const f=this.generateHTML(s,c);NVUtilities.download(f,n,"application/html")}json(){this.document.opts=this.opts,this.document.scene=this.scene,this.document.volumes=this.volumes,this.document.meshes=this.meshes,this.drawScene(),this.document.previewImageDataURL=this.canvas.toDataURL();const n=this.document.json();return n.sceneData={...this.scene},n}async saveDocument(n="untitled.nvd"){this.document.opts=this.opts,this.document.scene=this.scene,this.document.title=n,log$4.debug("saveDocument",this.volumes[0]),this.drawScene(),this.document.previewImageDataURL=this.canvas.toDataURL(),this.document.download(n)}async loadVolumes(n){if(this.loadingText="loading...",this.drawScene(),this.thumbnailVisible)return this.deferredVolumes=n,this;this.volumes=[],this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let s=0;s0&&(g[W]=T);const I=this.r16Tex(null,TEXTURE12_GC_STRENGTH0,this.back.dims,g),S=this.r16Tex(null,TEXTURE13_GC_STRENGTH1,this.back.dims,g);s.bindVertexArray(this.genericVAO);const k=this.growCutShader;k.use(s);const e=128;s.uniform1i(k.uniforms.finalPass,0),s.uniform1i(k.uniforms.backTex,11);for(let W=0;Wn[0]&&(v=1),s[1]>n[1]&&(y=1),s[2]>n[2]&&(T=1);let I=n[0],S=n[1],k=n[2];const e=s[0],N=s[1],M=s[2];if(f>=g&&f>=A){let O=2*g-f,U=2*A-f;for(;I!==e;)I+=v,O>=0&&(S+=y,O-=2*f),U>=0&&(k+=T,U-=2*f),O+=2*g,U+=2*A,this.drawPt(I,S,k,c)}else if(g>=f&&g>=A){let O=2*f-g,U=2*A-g;for(;S!==N;)S+=y,O>=0&&(I+=v,O-=2*g),U>=0&&(k+=T,U-=2*g),O+=2*f,U+=2*A,this.drawPt(I,S,k,c)}else{let O=2*g-A,U=2*f-A;for(;k!==M;)k+=T,O>=0&&(S+=y,O-=2*A),U>=0&&(I+=v,U-=2*A),O+=2*g,U+=2*f,this.drawPt(I,S,k,c)}}drawFloodFillCore(n,s,c=6){var I;if(!((I=this.back)!=null&&I.dims))throw new Error("back.dims undefined");const f=[this.back.dims[1],this.back.dims[2],this.back.dims[3]],g=f[0],A=g*f[1];function v(S){return S[0]+S[1]*g+S[2]*A}function y(S){const k=Math.floor(S/A),e=Math.floor((S-k*A)/g);return[Math.floor(S%g),e,k]}const T=[];for(T.push(s),n[s]=2;T.length>0;){let S=function(N){const M=e.slice();if(M[0]+=N[0],M[1]+=N[1],M[2]+=N[2],M[0]<0||M[1]<0||M[2]<0||M[0]>=f[0]||M[1]>=f[1]||M[2]>=f[2])return;const O=v(M);n[O]===1&&(n[O]=2,T.push(O))};const k=T[0];T.shift();const e=y(k);S([0,0,-1]),S([0,0,1]),S([0,-1,0]),S([0,1,0]),S([-1,0,0]),S([1,0,0]),!(c<=6)&&(S([-1,-1,0]),S([1,1,0]),S([-1,1,0]),S([1,1,0]),S([0,-1,-1]),S([0,1,-1]),S([-1,0,-1]),S([1,0,-1]),S([0,-1,1]),S([0,1,1]),S([-1,0,1]),S([1,0,1]),!(c<=18)&&(S([-1,-1,-1]),S([1,-1,-1]),S([-1,1,-1]),S([1,1,-1]),S([-1,-1,1]),S([1,-1,1]),S([-1,1,1]),S([1,1,1])))}}drawFloodFill(n,s=0,c=0,f=NaN,g=NaN,A=6){var M;if(!this.drawBitmap)throw new Error("drawBitmap undefined");if(!((M=this.back)!=null&&M.dims))throw new Error("back.dims undefined");s=Math.abs(s);const v=[this.back.dims[1],this.back.dims[2],this.back.dims[3]];if(n[0]<0||n[1]<0||n[2]<0||n[0]>=v[0]||n[1]>=v[1]||n[2]>=v[2])return;const y=v[0],T=y*v[1],I=T*v[2],S=this.drawBitmap.slice();if(S.length!==T*v[2])return;function k(O){return O[0]+O[1]*y+O[2]*T}const e=k(n),N=S[e];if(N===s){c!==0?log$4.debug("drawFloodFill selected voxel is not part of a drawing"):log$4.debug("drawFloodFill selected voxel is already desired color");return}for(let O=1;O=B&&O[V]<=U&&(S[V]=1);this.drawFloodFillCore(S,e,A),s=N}for(let O=1;OM[0]&&(V=1),O[1]>M[1]&&(b=1);let W=M[0],q=M[1];const Y=O[0],X=O[1];if(U>=B){let Q=2*B-U;for(;W!==Y;)W+=V,Q>=0&&(q+=b,Q-=2*U),Q+=2*B,A[W+q*g[0]]=v}else{let Q=2*U-B;for(;q!==X;)q+=b,Q>=0&&(W+=V,Q-=2*B),Q+=2*U,A[W+q*g[0]]=v}}const T=[this.drawPenFillPts[0][c],this.drawPenFillPts[0][f]];let I=T;for(let M=1;M=g[0]||M[1]>=g[1])return;const O=M[0]+M[1]*g[0];A[O]===0&&(S.push(M),A[O]=2)}for(let M=0;M0;){const M=S.shift();k([M[0]-1,M[1]]),k([M[0]+1,M[1]]),k([M[0],M[1]-1]),k([M[0],M[1]+1])}v=this.opts.penValue;const e=this.drawPenFillPts[0][3-(c+f)];if(!this.drawBitmap)throw new Error("drawBitmap undefined");if(s===0){const M=e*g[0]*g[1];for(let O=0;O0){const M=this.drawBitmap.length,O=decodeRLE(this.drawUndoBitmaps[this.currentDrawUndoBitmap],M);for(let U=0;U{const g=new Image;g.onload=()=>{if(!this.bmpShader)return;let A;s===4?(this.bmpTexture!==null&&this.gl.deleteTexture(this.bmpTexture),this.bmpTexture=this.gl.createTexture(),A=this.bmpTexture,this.bmpTextureWH=g.width/g.height,this.gl.activeTexture(TEXTURE4_THUMBNAIL),this.bmpShader.use(this.gl),this.gl.uniform1i(this.bmpShader.uniforms.bmpTexture,4)):s===5?(this.gl.activeTexture(TEXTURE5_MATCAP),this.matCapTexture!==null&&this.gl.deleteTexture(this.matCapTexture),this.matCapTexture=this.gl.createTexture(),A=this.matCapTexture):(this.fontShader.use(this.gl),this.gl.activeTexture(TEXTURE3_FONT),this.gl.uniform1i(this.fontShader.uniforms.fontTexture,3),this.fontTexture!==null&&this.gl.deleteTexture(this.fontTexture),this.fontTexture=this.gl.createTexture(),A=this.fontTexture),this.gl.bindTexture(this.gl.TEXTURE_2D,A),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,g),c(A),s!==4&&this.drawScene()},g.onerror=f,this.requestCORSIfNotSameOrigin(g,n),g.src=n})}async loadFontTexture(n){return this.loadPngAsTexture(n,3)}async loadBmpTexture(n){return this.loadPngAsTexture(n,4)}async loadMatCapTexture(n){return this.loadPngAsTexture(n,5)}initFontMets(){if(!this.fontMetrics)throw new Error("fontMetrics undefined");this.fontMets={distanceRange:this.fontMetrics.atlas.distanceRange,size:this.fontMetrics.atlas.size,mets:{}};for(let c=0;c<256;c++)this.fontMets.mets[c]={xadv:0,uv_lbwh:[0,0,0,0],lbwh:[0,0,0,0]};const n=this.fontMetrics.atlas.width,s=this.fontMetrics.atlas.height;for(let c=0;c=this.meshes.length){log$4.debug("Unable to change shader until mesh is loaded (maybe you need async)");return}this.meshes[f].meshShaderIndex=c,this.updateGLVolume(),this.onMeshShaderChanged(f,c)}createCustomMeshShader(n,s="Custom"){if(!n)throw new Error("Need fragment shader");const c=this.meshShaderNameToNumber(s);c>=0&&(this.gl.deleteProgram(this.meshShaders[c].shader.program),this.meshShaders.splice(c,1));const f=new Shader(this.gl,vertMeshShader,n);return f.use(this.gl),{Name:s,Frag:n,shader:f}}setCustomMeshShader(n="",s="Custom"){const c=this.createCustomMeshShader(n,s);return this.meshShaders.push(c),this.onCustomMeshShaderAdded(n,s),this.meshShaders.length-1}meshShaderNames(n=!0){const s=[];for(let c=0;c0&&(await this.loadBmpTexture(this.opts.thumbnail),this.thumbnailVisible=!0),this.updateGLVolume(),this.initialized=!0,this.resizeListener(),this.drawScene(),this}gradientGL(n){const s=this.gl,c=[0,0,0,0,1,0,1,0,0,1,1,0],f=s.createVertexArray();s.bindVertexArray(f);const g=s.createBuffer();s.bindBuffer(s.ARRAY_BUFFER,g),s.bufferData(s.ARRAY_BUFFER,new Float32Array(c),s.STATIC_DRAW),s.enableVertexAttribArray(0),s.vertexAttribPointer(0,3,s.FLOAT,!1,0,0);const A=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,A),s.disable(s.CULL_FACE),s.viewport(0,0,n.dims[1],n.dims[2]),s.disable(s.BLEND);const v=this.rgbaTex(null,TEXTURE8_GRADIENT_TEMP,n.dims),y=this.blurShader;y.use(s),s.activeTexture(TEXTURE0_BACK_VOL),s.bindTexture(s.TEXTURE_3D,this.volumeTexture);const T=.7;s.uniform1i(y.uniforms.intensityVol,0),s.uniform1f(y.uniforms.dX,T/n.dims[1]),s.uniform1f(y.uniforms.dY,T/n.dims[2]),s.uniform1f(y.uniforms.dZ,T/n.dims[3]),s.bindVertexArray(f);for(let k=0;k0&&(this.furthestVertexFromOrigin=this.volumeObject3D.furthestVertexFromOrigin),this.meshes)for(let c=0;c0)for(let Y=0;Y0&&n.frame4D1&&g===0)return;let A=null;if(!this.back)throw new Error("back undefined");this.gl.bindVertexArray(this.unusedVAO),this.crosshairs3D&&(this.crosshairs3D.mm[0]=NaN);let v=clone$3(n.toRAS);if(s===0){this.volumeObject3D=n.toNiivueObject3D(this.VOLUME_ID,this.gl),invert(v,v),this.back.matRAS=n.matRAS,this.back.dims=n.dimsRAS,this.back.pixDims=n.pixDimsRAS,A=this.rgbaTex(this.volumeTexture,TEXTURE0_BACK_VOL,n.dimsRAS);const{volScale:q,vox:Y}=this.sliceScale(!0);if(this.volScale=q,this.vox=Y,this.volumeObject3D.scale=q,!this.renderShader)throw new Error("renderShader undefined");this.renderShader.use(this.gl),this.gl.uniform3fv(this.renderShader.uniforms.texVox,Y),this.gl.uniform3fv(this.renderShader.uniforms.volScale,q);const X=this.pickingImageShader;X.use(this.gl),this.gl.uniform1i(X.uniforms.volume,0),this.gl.uniform1i(X.uniforms.colormap,1),this.gl.uniform1i(X.uniforms.overlay,2),this.gl.uniform3fv(X.uniforms.volScale,q),log$4.debug(this.volumeObject3D)}else{((W=this.back)==null?void 0:W.dims)===void 0&&log$4.error("Fatal error: Unable to render overlay: background dimensions not defined!");const q=this.mm2frac(n.mm000,0,!0);let Y=this.mm2frac(n.mm100,0,!0),X=this.mm2frac(n.mm010,0,!0),Q=this.mm2frac(n.mm001,0,!0);Y=subtract$1(Y,Y,q),X=subtract$1(X,X,q),Q=subtract$1(Q,Q,q),v=fromValues$3(Y[0],X[0],Q[0],q[0],Y[1],X[1],Q[1],q[1],Y[2],X[2],Q[2],q[2],0,0,0,1),invert(v,v),s===1?(A=this.rgbaTex(this.overlayTexture,TEXTURE2_OVERLAY_VOL,this.back.dims),this.overlayTexture=A,this.overlayTextureID=A):A=this.overlayTextureID}const y=this.gl.createFramebuffer();this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,y),this.gl.disable(this.gl.CULL_FACE),this.gl.viewport(0,0,this.back.dims[1],this.back.dims[2]),this.gl.disable(this.gl.BLEND);const T=this.gl.createTexture();this.gl.activeTexture(TEXTURE9_ORIENT),this.gl.bindTexture(this.gl.TEXTURE_3D,T),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_WRAP_R,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,1);let I=this.orientShaderU;if(!c)throw new Error("hdr undefined");if(!f)throw new Error("img undefined");if(c.datatypeCode===2)c.intent_code===1002&&(I=this.orientShaderAtlasU),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R8UI,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED_INTEGER,this.gl.UNSIGNED_BYTE,f);else if(c.datatypeCode===4)I=this.orientShaderI,c.intent_code===1002&&(I=this.orientShaderAtlasI),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R16I,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED_INTEGER,this.gl.SHORT,f);else if(c.datatypeCode===16)this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R32F,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED,this.gl.FLOAT,f),I=this.orientShaderF;else if(c.datatypeCode===64){let q=new Float32Array;q=Float32Array.from(f),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R32F,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED,this.gl.FLOAT,q),I=this.orientShaderF}else c.datatypeCode===128?(I=this.orientShaderRGBU,I.use(this.gl),this.gl.uniform1i(I.uniforms.hasAlpha,0),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.RGB8UI,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RGB_INTEGER,this.gl.UNSIGNED_BYTE,f)):c.datatypeCode===512?(c.intent_code===1002&&(I=this.orientShaderAtlasU),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.R16UI,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RED_INTEGER,this.gl.UNSIGNED_SHORT,f)):c.datatypeCode===2304&&(I=this.orientShaderRGBU,I.use(this.gl),this.gl.uniform1i(I.uniforms.hasAlpha,1),this.gl.texStorage3D(this.gl.TEXTURE_3D,1,this.gl.RGBA8UI,c.dims[1],c.dims[2],c.dims[3]),this.gl.texSubImage3D(this.gl.TEXTURE_3D,0,0,0,0,c.dims[1],c.dims[2],c.dims[3],this.gl.RGBA_INTEGER,this.gl.UNSIGNED_BYTE,f));n.global_min===void 0&&n.calMinMax();let S=null;if(this.gl.bindVertexArray(this.genericVAO),s>1){if(!this.back.dims)throw new Error("back.dims undefined");S=this.rgbaTex(S,TEXTURE10_BLEND,this.back.dims),this.gl.bindTexture(this.gl.TEXTURE_3D,S);const q=this.passThroughShader;q.use(this.gl),this.gl.uniform1i(q.uniforms.in3D,2);for(let Y=0;Y7){const q=n.colormapLabel.max-n.colormapLabel.min+1;k=this.createColormapTexture(k,1,q),this.gl.texSubImage2D(this.gl.TEXTURE_2D,0,0,0,q,1,this.gl.RGBA,this.gl.UNSIGNED_BYTE,n.colormapLabel.lut),this.gl.uniform1f(I.uniforms.cal_min,n.colormapLabel.min-.5),this.gl.uniform1f(I.uniforms.cal_max,n.colormapLabel.max+.5),this.gl.bindTexture(this.gl.TEXTURE_2D,k)}else this.gl.bindTexture(this.gl.TEXTURE_2D,this.colormapTexture),this.gl.uniform1f(I.uniforms.cal_min,n.cal_min),this.gl.uniform1f(I.uniforms.cal_max,n.cal_max);this.gl.uniform1i(I.uniforms.isAlphaThreshold,n.alphaThreshold),this.gl.uniform1i(I.uniforms.isAdditiveBlend,this.opts.isAdditiveBlend?1:0);let e=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY;if(n.colormapNegative.length>0&&(e=Math.min(-n.cal_min,-n.cal_max),N=Math.max(-n.cal_min,-n.cal_max),isFinite(n.cal_minNeg)&&isFinite(n.cal_maxNeg)&&(e=Math.min(n.cal_minNeg,n.cal_maxNeg),N=Math.max(n.cal_minNeg,n.cal_maxNeg))),!I)throw new Error("orientShader undefined");this.gl.uniform1f(I.uniforms.layer??null,s),this.gl.uniform1f(I.uniforms.cal_minNeg??null,e),this.gl.uniform1f(I.uniforms.cal_maxNeg??null,N),this.gl.bindTexture(this.gl.TEXTURE_3D,T),this.gl.uniform1i(I.uniforms.intensityVol??null,9),this.gl.uniform1i(I.uniforms.blend3D??null,10),this.gl.uniform1i(I.uniforms.colormap??null,1),this.gl.uniform1f(I.uniforms.scl_inter??null,c.scl_inter),this.gl.uniform1f(I.uniforms.scl_slope??null,c.scl_slope),this.gl.uniform1f(I.uniforms.opacity??null,g),this.gl.uniform1i(I.uniforms.modulationVol??null,7);let M=null;if(n.modulationImage!==null&&n.modulationImage>=0&&n.modulationImage0;let fe=this.volumes[n.modulationImage].cal_min,me=this.volumes[n.modulationImage].cal_max;isFinite(this.volumes[n.modulationImage].cal_minNeg)&&isFinite(this.volumes[n.modulationImage].cal_maxNeg)&&(fe=this.volumes[n.modulationImage].cal_minNeg,me=this.volumes[n.modulationImage].cal_minNeg),fe=Math.abs(fe),me=Math.abs(me),fe>me&&([fe,me]=[me,fe]);const pe=1/(me-fe);let Se=Math.abs(n.modulateAlpha);Se=Math.max(Se,1);const xe=this.volumes[n.modulationImage].frame4D*Y;for(let we=0;we0?this.gradientGL(c):(this.gradientTexture!==null&&this.gl.deleteTexture(this.gradientTexture),this.gradientTexture=null)),!this.renderShader)throw new Error("renderShader undefined");this.renderShader.use(this.gl);const U=this.sliceScale(!0),B=U.vox,V=U.volScale;if(this.gl.uniform1f(this.renderShader.uniforms.overlays,this.overlays),this.gl.uniform4fv(this.renderShader.uniforms.clipPlaneColor,this.opts.clipPlaneColor),this.gl.uniform1f(this.renderShader.uniforms.backOpacity,this.volumes[0].opacity),this.gl.uniform1f(this.renderShader.uniforms.renderOverlayBlend,this.opts.renderOverlayBlend),this.gl.uniform4fv(this.renderShader.uniforms.clipPlane,this.scene.clipPlane),this.gl.uniform3fv(this.renderShader.uniforms.texVox,B),this.gl.uniform3fv(this.renderShader.uniforms.volScale,V),!this.pickingImageShader)throw new Error("pickingImageShader undefined");this.pickingImageShader.use(this.gl),this.gl.uniform1f(this.pickingImageShader.uniforms.overlays,this.overlays.length),this.gl.uniform3fv(this.pickingImageShader.uniforms.texVox,B);let b=this.sliceMMShader;if(this.opts.isV1SliceShader&&(b=this.sliceV1Shader),!b)throw new Error("slice shader undefined");b.use(this.gl),this.gl.uniform1f(b.uniforms.overlays,this.overlays.length),this.gl.uniform1f(b.uniforms.drawOpacity,this.drawOpacity),k!==null&&(this.gl.deleteTexture(k),this.gl.activeTexture(TEXTURE1_COLORMAPS),this.gl.bindTexture(this.gl.TEXTURE_2D,this.colormapTexture)),this.gl.uniform1i(b.uniforms.drawing,7),this.gl.activeTexture(TEXTURE7_DRAW),this.gl.bindTexture(this.gl.TEXTURE_3D,this.drawTexture),this.updateInterpolation(s)}colormaps(){return cmapper.colormaps()}addColormap(n,s){cmapper.addColormap(n,s)}setColormap(n,s){const c=this.getVolumeIndexByID(n);this.volumes[c].colormap=s,this.updateGLVolume()}idx(n,s,c,f){return c*f[0]*f[1]+s*f[0]+n}check_previous_slice(n,s,c,f,g,A,v,y){const T=new Uint32Array(27);let I=0;if(!g)return 0;const S=n[this.idx(c,f,g,A)];if(v>=6){const k=this.idx(c,f,g-1,A);S===n[k]&&(T[I++]=s[k])}if(v>=18){if(c){const k=this.idx(c-1,f,g-1,A);S===n[k]&&(T[I++]=s[k])}if(f){const k=this.idx(c,f-1,g-1,A);S===n[k]&&(T[I++]=s[k])}if(c=6){if(k){const M=this.idx(k-1,S,I,s);N===n[M]&&(T[e++]=y[M])}if(S){const M=this.idx(k,S-1,I,s);N===n[M]&&(T[e++]=y[M])}}if(c>=18){if(S&&k){const M=this.idx(k-1,S-1,I,s);N===n[M]&&(T[e++]=y[M])}if(S&&k=A){A+=g;const M=new Uint32Array(A);M.set(v),v=M}v[f-1]=f,f++}}}for(let I=0;I100){log$4.info(` +Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y=1e-15&&I++;const S=1e3,k=(v-A)/S,e=new Array(S).fill(0);for(let V=0;V=M);)O++;const U=A;for(A=O*k+U,M=T-Math.floor((1-g)*I),O=0;O=M);)O++;v=O*k+U;let B=1;return A!==v&&(B=(c-s)/(v-A)),log$4.info(" Rescale: min: "+A+" max: "+v+" scale: "+B),[A,B]}conformVox2Vox(n,s,c=256,f=1,g=!1){const A=s.flat(),v=fromValues$3(A[0],A[1],A[2],A[3],A[4],A[5],A[6],A[7],A[8],A[9],A[10],A[11],A[12],A[13],A[14],A[15]),y=fromValues$1(n[1]/2,n[2]/2,n[3]/2,1),T=create$1(),I=create$3();transpose$3(I,v),transformMat4(T,y,I);const S=fromValues$2(T[0],T[1],T[2]),k=fromValues$2(f,f,f);let e=fromValues$3(-1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);g&&(e=fromValues$3(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),transpose$3(e,e);const N=fromValues$1(c,c,c,1),M=create$3();scale$4(M,e,k);const O=fromValues$1(N[0],N[1],N[2],1);transformMat4(O,O,M),scale$2(O,O,.5);const U=create$2();subtract$1(U,S,fromValues$2(O[0],O[1],O[2]));const B=create$3();transpose$3(B,M),B[3]=U[0],B[7]=U[1],B[11]=U[2];const V=create$3();invert(V,B);const b=create$3();mul$1(b,v,V);const W=create$3();return invert(W,b),[B,b,W]}async createNiftiArray(n=[256,256,256],s=[1,1,1],c=[1,0,0,-128,0,1,0,-128,0,0,1,-128,0,0,0,1],f=2,g=new Uint8Array){return await NVImage.createNiftiArray(n,s,c,f,g)}async niftiArray2NVImage(n=new Uint8Array){return await NVImage.loadFromUrl({url:n})}async loadFromUrl(n){return await NVImage.loadFromUrl({url:n})}async conform(n,s=!1,c=!0,f=!1){const v=this.conformVox2Vox(n.hdr.dims,n.hdr.affine.flat(),256,1,s),y=v[0],T=v[2],I=256*256*256,S=new Float32Array(I),k=new Float32Array(n.img),e=n.hdr.dims[1]*n.hdr.dims[2]*n.hdr.dims[3];if(n.hdr.scl_slope!==1||n.hdr.scl_inter!==0)for(let Q=0;Q=N||Ze>=M||nt>=O)continue;const Ue=me-xe,ye=pe-we,at=Se-Fe,ft=1-Ue,Tt=1-ye,Lt=1-at,Ot=V(xe,we,Fe);let Ft=0;Ft+=k[Ot]*ft*Tt*Lt,Ft+=k[Ot+U]*ft*Tt*at,Ft+=k[Ot+N]*ft*ye*Lt,Ft+=k[Ot+N+U]*ft*ye*at,Ft+=k[Ot+1]*Ue*Tt*Lt,Ft+=k[Ot+1+U]*Ue*Tt*at,Ft+=k[Ot+1+N]*Ue*ye*Lt,Ft+=k[Ot+1+N+U]*Ue*ye*at,S[B]=Ft}}else for(let Q=0;Q<256;Q++)for(let m=0;m<256;m++){const Z=m*T[1]+Q*T[2]+T[3],ee=m*T[5]+Q*T[6]+T[7],oe=m*T[9]+Q*T[10]+T[11];for(let fe=0;fe<256;fe++){const me=Math.round(fe*b+Z),pe=Math.round(fe*W+ee),Se=Math.round(fe*q+oe);B++,!(me<0||pe<0||Se<0)&&(me>=N||pe>=M||Se>=O||(S[B]=k[V(me,pe,Se)]))}}let Y=new Uint8Array;if(f){const Q=await this.getScale(n,0,1),m=await this.scalecropFloat32(S,0,1,Q[0],Q[1]);Y=await this.createNiftiArray([256,256,256],[1,1,1],Array.from(y),16,new Uint8Array(m.buffer))}else{const Q=await this.getScale(n,0,255),m=await this.scalecropUint8(S,0,255,Q[0],Q[1]);Y=await this.createNiftiArray([256,256,256],[1,1,1],Array.from(y),2,m)}return await this.niftiArray2NVImage(Y)}setRenderDrawAmbientOcclusion(n){if(!this.renderShader)throw new Error("renderShader undefined");this.renderDrawAmbientOcclusion=n,this.renderShader.use(this.gl),this.gl.uniform1fv(this.renderShader.uniforms.renderDrawAmbientOcclusion,[this.renderDrawAmbientOcclusion,1]),this.drawScene()}setColorMap(n,s){this.setColormap(n,s)}setColormapNegative(n,s){const c=this.getVolumeIndexByID(n);this.volumes[c].colormapNegative=s,this.updateGLVolume()}setModulationImage(n,s,c=0){const f=this.getVolumeIndexByID(n);let g=null;s.length>0&&(g=this.getVolumeIndexByID(s)),this.volumes[f].modulationImage=g,this.volumes[f].modulateAlpha=c,this.updateGLVolume()}setGamma(n=1){cmapper.gamma=n,this.updateGLVolume()}async loadDeferred4DVolumes(n){const s=this.getVolumeIndexByID(n),c=this.volumes[s];if(c.nTotalFrame4D<=c.nFrame4D)return;let f;c.fileObject?f=await NVImage.loadFromFile({file:c.fileObject}):f=await NVImage.loadFromUrl({url:c.url}),f&&(c.img=f.img.slice(),c.nTotalFrame4D=f.nTotalFrame4D,c.nFrame4D=f.nFrame4D,this.updateGLVolume())}setFrame4D(n,s){const c=this.getVolumeIndexByID(n),f=this.volumes[c];s>f.nFrame4D-1&&(s=f.nFrame4D-1),s<0&&(s=0),s!==f.frame4D&&(f.frame4D=s,this.updateGLVolume(),this.onFrameChange(f,s),this.createOnLocationChange())}getFrame4D(n){const s=this.getVolumeIndexByID(n);return this.volumes[s].frame4D}colormapFromKey(n){return cmapper.colormapFromKey(n)}colormap(n="",s=!1){return cmapper.colormap(n,s)}createColormapTexture(n=null,s=0,c=256){return n!==null&&this.gl.deleteTexture(n),s<1||c<1?null:(n=this.gl.createTexture(),this.gl.activeTexture(TEXTURE1_COLORMAPS),this.gl.bindTexture(this.gl.TEXTURE_2D,n),this.gl.texStorage2D(this.gl.TEXTURE_2D,1,this.gl.RGBA8,c,s),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_R,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,1),n)}addColormapList(n="",s=NaN,c=NaN,f=!1,g=!1,A=!0,v=!1){n.length<1&&(A=!1),this.colormapLists.push({name:n,min:s,max:c,alphaThreshold:f,negative:g,visible:A,invert:v})}refreshColormaps(){if(this.colormapLists=[],this.volumes.length<1&&this.meshes.length<1)return;const n=this.volumes.length;if(n>0)for(let A=0;A0)for(let A=0;Af[0]&&s>f[1]&&n=0&&this.screenSlices[c].axCorSag===4?c:-1}sliceScroll3D(n=0){if(n!==0){if(this.volumes.length>0&&this.scene.clipPlaneDepthAziElev[0]<1.8){const s=this.scene.clipPlaneDepthAziElev.slice();return n>0&&(s[0]=Math.min(1.5,s[0]+.025)),n<0&&(s[0]=Math.max(-1.5,s[0]-.025)),s[0]!==this.scene.clipPlaneDepthAziElev[0]?(this.scene.clipPlaneDepthAziElev=s,this.setClipPlane(this.scene.clipPlaneDepthAziElev)):void 0}n>0&&(this.scene.volScaleMultiplier=Math.min(2,this.scene.volScaleMultiplier*1.1)),n<0&&(this.scene.volScaleMultiplier=Math.max(.5,this.scene.volScaleMultiplier*.9)),this.drawScene()}}deleteThumbnail(){this.bmpTexture&&(this.gl.deleteTexture(this.bmpTexture),this.bmpTexture=null,this.thumbnailVisible=!1)}inGraphTile(n,s){if(this.graph.opacity<=0||this.volumes.length<1||this.volumes[0].nFrame4D<1||!this.graph.plotLTWH||this.graph.plotLTWH[2]<1||this.graph.plotLTWH[3]<1)return!1;const c=[(n-this.graph.LTWH[0])/this.graph.LTWH[2],(s-this.graph.LTWH[1])/this.graph.LTWH[3]];return c[0]>0&&c[1]>0&&c[0]<=1&&c[1]<=1}mouseClick(n,s,c=0,f=!0){if(n*=this.uiData.dpr,s*=this.uiData.dpr,this.canvas.focus(),this.thumbnailVisible){this.thumbnailVisible=!1,Promise.all([this.loadVolumes(this.deferredVolumes),this.loadMeshes(this.deferredMeshes)]).catch(g=>{throw g});return}if(this.inGraphTile(n,s)){if(!this.graph.plotLTWH)throw new Error("plotLTWH undefined");const g=[(n-this.graph.plotLTWH[0])/this.graph.plotLTWH[2],(s-this.graph.plotLTWH[1])/this.graph.plotLTWH[3]];if(g[0]>0&&g[1]>0&&g[0]<=1&&g[1]<=1){const A=Math.round(g[0]*(this.volumes[0].nFrame4D-1));this.setFrame4D(this.volumes[0].id,A);return}g[0]>.5&&g[1]>1&&this.loadDeferred4DVolumes(this.volumes[0].id).catch(A=>{throw A});return}if(this.inRenderTile(n,s)>=0){this.sliceScroll3D(c),this.drawScene();return}if(!(this.screenSlices.length<1||this.gl.canvas.height<1||this.gl.canvas.width<1))for(let g=0;g=0&&this.drawPenAxCorSag!==A||A>2)continue;const v=this.screenXY2TextureFrac(n,s,g,!1);if(!(v[0]<0)){if(!f){this.scene.crosshairPos[2-A]=c,this.drawScene();return}if(c!==0){let y=1;c<0&&(y=-1);const T=[0,0,0];T[2-A]=y,this.moveCrosshairInVox(T[0],T[1],T[2]),this.drawScene(),this.createOnLocationChange(A);return}if(this.opts.isForceMouseClickToVoxelCenters?this.scene.crosshairPos=clone$2(this.vox2frac(this.frac2vox(v))):this.scene.crosshairPos=clone$2(v),this.opts.drawingEnabled){const y=this.frac2vox(this.scene.crosshairPos);if(!isFinite(this.opts.penValue)||this.opts.penValue<0||Object.is(this.opts.penValue,-0)){isFinite(this.opts.penValue)?this.drawFloodFill(y,Math.abs(this.opts.penValue),this.opts.floodFillNeighbors):this.drawFloodFill(y,0,this.opts.penValue,this.opts.floodFillNeighbors);return}if(isNaN(this.drawPenLocation[0]))this.drawPenAxCorSag=A,this.drawPenFillPts=[],this.drawPt(...y,this.opts.penValue);else{if(y[0]===this.drawPenLocation[0]&&y[1]===this.drawPenLocation[1]&&y[2]===this.drawPenLocation[2])return;this.drawPenLine(y,this.drawPenLocation,this.opts.penValue)}this.drawPenLocation=y,this.opts.isFilledPen&&this.drawPenFillPts.push(y),this.refreshDrawing(!1)}this.drawScene(),this.createOnLocationChange(A);return}}}drawRuler(){let n=[],s=[];for(let y=0;y1){s=this.screenSlices[y].leftTopWidthHeight,n=this.screenSlices[y].fovMM;break}if(s.length<4)return;const f=100/n[0]*s[2],g=s[0]+.5*s[2]-.5*f,A=s[1]+s[3]-2*this.opts.rulerWidth,v=[g,A,g+f,A];this.drawRuler10cm(v)}drawRuler10cm(n){if(!this.lineShader)throw new Error("lineShader undefined");this.gl.bindVertexArray(this.genericVAO),this.lineShader.use(this.gl),this.gl.uniform4fv(this.lineShader.uniforms.lineColor,this.opts.rulerColor),this.gl.uniform2fv(this.lineShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform1f(this.lineShader.uniforms.thickness,this.opts.rulerWidth),this.gl.uniform4fv(this.lineShader.uniforms.startXYendXY,n),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4);const s=-.1*(n[0]-n[2]),c=n[1],f=c-2*this.opts.rulerWidth,g=c-4*this.opts.rulerWidth;for(let A=0;A<11;A++){const v=n[0]+A*s,y=[v,c,v,f];A%5===0&&(y[3]=g),this.gl.uniform4fv(this.lineShader.uniforms.startXYendXY,y),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)}this.gl.bindVertexArray(this.unusedVAO)}screenXY2mm(n,s,c=-1){let f;for(let g=0;g=0&&(A=c),this.screenSlices[A].axCorSag>2)continue;const y=this.screenSlices[A].leftTopWidthHeight;if(ny[0]+y[2]||s>y[1]+y[3]||(f=this.screenXY2TextureFrac(n,s,A,!1),f[0]<0))continue;const T=this.frac2mm(f);return fromValues$1(T[0],T[1],T[2],A)}return fromValues$1(NaN,NaN,NaN,NaN)}dragForPanZoom(n){const s=this.screenXY2mm(n[2],n[3]);if(isNaN(s[0]))return;const c=this.screenXY2mm(n[0],n[1],s[3]);if(isNaN(c[0])||isNaN(s[0])||isNaN(s[3]))return;const f=create$1(),g=this.uiData.pan2DxyzmmAtMouseDown[3];sub$3(f,s,c),this.scene.pan2Dxyzmm[0]=this.uiData.pan2DxyzmmAtMouseDown[0]+g*f[0],this.scene.pan2Dxyzmm[1]=this.uiData.pan2DxyzmmAtMouseDown[1]+g*f[1],this.scene.pan2Dxyzmm[2]=this.uiData.pan2DxyzmmAtMouseDown[2]+g*f[2]}dragForCenterButton(n){this.dragForPanZoom(n)}dragForSlicer3D(n){let s=this.uiData.pan2DxyzmmAtMouseDown[3];const c=n[3]-n[1];s+=c*.01,s=Math.max(s,.1),s=Math.min(s,10);const g=this.scene.pan2Dxyzmm[3]-s;this.opts.yoke3Dto2DZoom&&(this.scene.volScaleMultiplier=s),this.scene.pan2Dxyzmm[3]=s;const A=this.frac2mm(this.scene.crosshairPos);this.scene.pan2Dxyzmm[0]+=g*A[0],this.scene.pan2Dxyzmm[1]+=g*A[1],this.scene.pan2Dxyzmm[2]+=g*A[2]}drawMeasurementTool(n){const s=this.gl;if(s.bindVertexArray(this.genericVAO),s.depthFunc(s.ALWAYS),s.enable(s.BLEND),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),!this.lineShader)throw new Error("lineShader undefined");this.lineShader.use(this.gl),s.uniform4fv(this.lineShader.uniforms.lineColor,this.opts.rulerColor),s.uniform2fv(this.lineShader.uniforms.canvasWidthHeight,[s.canvas.width,s.canvas.height]),s.uniform1f(this.lineShader.uniforms.thickness,this.opts.rulerWidth),s.uniform4fv(this.lineShader.uniforms.startXYendXY,n),s.drawArrays(s.TRIANGLE_STRIP,0,4);const c=this.opts.rulerColor;c[3]=1,s.uniform4fv(this.lineShader.uniforms.lineColor,c);const f=this.opts.rulerWidth;s.uniform1f(this.lineShader.uniforms.thickness,f*2);let g=[n[0],n[1]-f,n[0],n[1]+f];s.uniform4fv(this.lineShader.uniforms.startXYendXY,g),s.drawArrays(s.TRIANGLE_STRIP,0,4),g=[n[2],n[3]-f,n[2],n[3]+f],s.uniform4fv(this.lineShader.uniforms.startXYendXY,g),s.drawArrays(s.TRIANGLE_STRIP,0,4);let A=this.canvasPos2frac([n[0],n[1]]),v=this.canvasPos2frac([n[2],n[3]]);if(A[0]>=0&&v[0]>=0){const y=this.frac2mm(A);A=fromValues$2(y[0],y[1],y[2]);const T=this.frac2mm(v);v=fromValues$2(T[0],T[1],T[2]);const I=create$2();sub$4(I,A,v);const S=len(I);let k=2;S>9&&(k=1),S>99&&(k=0);const e=S.toFixed(k);this.drawTextBetween(n,e,1,c)}s.bindVertexArray(this.unusedVAO)}drawRect(n,s=[1,0,0,-1]){if(s[3]<0&&(s=this.opts.crosshairColor),!this.rectShader)throw new Error("rectShader undefined");this.rectShader.use(this.gl),this.gl.enable(this.gl.BLEND),this.gl.uniform4fv(this.rectShader.uniforms.lineColor,s),this.gl.uniform2fv(this.rectShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform4f(this.rectShader.uniforms.leftTopWidthHeight,n[0],n[1],n[2],n[3]),this.gl.bindVertexArray(this.genericVAO),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}drawCircle(n,s=this.opts.fontColor,c=1){if(!this.circleShader)throw new Error("circleShader undefined");this.circleShader.use(this.gl),this.gl.enable(this.gl.BLEND),this.gl.uniform4fv(this.circleShader.uniforms.circleColor,s),this.gl.uniform2fv(this.circleShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform4f(this.circleShader.uniforms.leftTopWidthHeight,n[0],n[1],n[2],n[3]),this.gl.uniform1f(this.circleShader.uniforms.fillPercent,c),this.gl.uniform4fv(this.circleShader.uniforms.circleColor,s),this.gl.bindVertexArray(this.genericVAO),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}drawSelectionBox(n){this.drawRect(n,this.opts.selectionBoxColor)}effectiveCanvasHeight(){return this.gl.canvas.height-this.colorbarHeight}effectiveCanvasWidth(){return this.gl.canvas.width-this.getLegendPanelWidth()}getAllLabels(){const f=this.meshes.filter(A=>A.type==="connectome").flatMap(A=>A.nodes).map(A=>A.label).filter(A=>A!==void 0);return[...this.document.labels,...f]}getBulletMarginWidth(){let n=0;const s=this.getAllLabels();if(s.length===0)return 0;const c=s.length===1?s[0].style.bulletScale:s.reduce((A,v)=>A.style.bulletScale>v.style.bulletScale?A:v).style.bulletScale,f=s.length===1?s[0]:s.reduce((A,v)=>{const y=this.opts.textHeight*this.gl.canvas.height*A.style.textScale,T=this.opts.textHeight*this.gl.canvas.height*v.style.textScale;return this.textHeight(y,A.text)>this.textHeight(T,v.text)?A:v}),g=this.opts.textHeight*this.gl.canvas.height*f.style.textScale;return n=this.textHeight(g,f.text)*c,n+=g,n}getLegendPanelWidth(){const n=this.getAllLabels();if(!this.opts.showLegend||n.length===0)return 0;const c=this.opts.textHeight*this.gl.canvas.height*1;let f=0;const g=n.reduce((T,I)=>{const S=this.opts.textHeight*this.gl.canvas.height*T.style.textScale,k=this.opts.textHeight*this.gl.canvas.height*I.style.textScale;return this.textWidth(S,T.text)>this.textWidth(k,I.text)?T:I}),A=this.opts.textHeight*this.gl.canvas.height*g.style.textScale,v=this.textWidth(A,g.text),y=this.getBulletMarginWidth();return v&&(f=y+v,f+=c*2),f}getLegendPanelHeight(){const n=this.getAllLabels();let s=0;const f=this.opts.textHeight*this.gl.canvas.height*1;for(const g of n){const A=this.opts.textHeight*this.gl.canvas.height*g.style.textScale,v=this.textHeight(A,g.text);s+=v}return s&&(s+=f/2*(n.length+1)),s}reserveColorbarPanel(){let n=Math.max(this.opts.textHeight,.01);n=n*Math.min(this.gl.canvas.height,this.gl.canvas.width);const s=3*n,c=[0,this.gl.canvas.height-s,this.gl.canvas.width,s];return this.colorbarHeight=c[3]+1,c}drawColorbarCore(n=0,s=[0,0,0,0],c=!1,f=0,g=1,A){if(s[2]<=0||s[3]<=0)return;let v=Math.max(this.opts.textHeight,.01);v=v*Math.min(this.gl.canvas.height,this.gl.canvas.width);let y=v;const T=3*v;let I=v;if(s[3]0&&(N=f,f=0),f===g||v<1)return;const M=Math.abs(g-f);let[O,U]=tickSpacing(f,g);Uf.includes(y)).reduce((v,y)=>v.lbwh[3]>y.lbwh[3]?v:y).lbwh[3];return n*A}drawChar(n,s,c){if(!this.fontShader)throw new Error("fontShader undefined");const f=this.fontMets.mets[c],g=n[0]+s*f.lbwh[0],A=-(s*f.lbwh[1]),v=s*f.lbwh[2],y=s*f.lbwh[3],T=n[1]+(A-y)+s;return this.gl.uniform4f(this.fontShader.uniforms.leftTopWidthHeight,g,T,v,y),this.gl.uniform4fv(this.fontShader.uniforms.uvLeftTopWidthHeight,f.uv_lbwh),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),s*f.xadv}drawLoadingText(n){if(!this.canvas)throw new Error("canvas undefined");this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.gl.enable(this.gl.CULL_FACE),this.gl.enable(this.gl.BLEND),this.drawTextBelow([this.canvas.width/2,this.canvas.height/2],n,3)}drawText(n,s,c=1,f=null){if(this.opts.textHeight<=0)return;if(!this.fontShader)throw new Error("fontShader undefined");this.fontShader.use(this.gl);const g=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*c;this.gl.enable(this.gl.BLEND),this.gl.uniform2f(this.fontShader.uniforms.canvasWidthHeight,this.gl.canvas.width,this.gl.canvas.height),f===null&&(f=this.opts.fontColor),this.gl.uniform4fv(this.fontShader.uniforms.fontColor,f);let A=g/this.fontMets.size*this.fontMets.distanceRange;A=Math.max(A,1),this.gl.uniform1f(this.fontShader.uniforms.screenPxRange,A);const v=new TextEncoder().encode(s);this.gl.bindVertexArray(this.genericVAO);for(let y=0;y.8?T=[0,0,0,.5]:T=[1,1,1,.5],this.drawRect(y,T),this.drawText(g,s,c,f)}drawTextBelow(n,s,c=1,f=null){if(this.opts.textHeight<=0)return;if(!this.canvas)throw new Error("canvas undefined");let g=this.opts.textHeight*this.gl.canvas.height*c,A=this.textWidth(g,s);A>this.canvas.width&&(c*=(this.canvas.width-2)/A,g=this.opts.textHeight*this.gl.canvas.height*c,A=this.textWidth(g,s)),n[0]-=.5*this.textWidth(g,s),n[0]=Math.max(n[0],1),n[0]=Math.min(n[0],this.canvas.width-A-1),this.drawText(n,s,c,f)}updateInterpolation(n,s=!1){let c=this.gl.LINEAR;!s&&this.opts.isNearestInterpolation&&(c=this.gl.NEAREST),n===0?this.gl.activeTexture(TEXTURE0_BACK_VOL):this.gl.activeTexture(TEXTURE2_OVERLAY_VOL),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_MIN_FILTER,c),this.gl.texParameteri(this.gl.TEXTURE_3D,this.gl.TEXTURE_MAG_FILTER,c)}setAtlasOutline(n){this.opts.atlasOutline=n,this.updateGLVolume(),this.drawScene()}setInterpolation(n){this.opts.isNearestInterpolation=n;const s=this.volumes.length;if(!(s<1)){for(let c=0;c0){this.opts.meshThicknessOn2D!==1/0&&(M=this.calculateMvpMatrix2D(n,g.mnMM,g.mxMM,this.opts.meshThicknessOn2D,N,T,y,v));const U=clone$3(M.modelViewProjectionMatrix);multiply$2(U,U,A),this.drawMesh3D(!0,1,U,M.modelMatrix,M.normalMatrix)}isNaN(c)&&this.drawCrosshairs3D(!1,.15,M.modelViewProjectionMatrix,!0,this.opts.isSliceMM),this.drawSliceOrientationText(n,s),this.readyForSync=!0}calculateMvpMatrix(n,s=[0,0,0,0],c,f){(s[2]===0||s[3]===0)&&(s=[0,0,this.gl.canvas.width,this.gl.canvas.height]);const g=s[2]/s[3];let A=this.furthestFromPivot;const v=this.pivot3D,y=create$3();A=.8*A/this.scene.volScaleMultiplier,g<1?ortho(y,-A,A,-A/g,A/g,A*.01,A*8):ortho(y,-A*g,A*g,-A,A,A*.01,A*8);const T=create$3();T[0]=-1;const I=fromValues$2(0,0,-A*1.8);translate(T,T,I),this.position&&translate(T,T,this.position),rotateX(T,T,deg2rad(270-f)),rotateZ(T,T,deg2rad(c-180)),translate(T,T,[-v[0],-v[1],-v[2]]);const S=create$3();invert(S,T);const k=create$3();transpose$3(k,S);const e=create$3();return multiply$2(e,y,T),[e,T,k]}calculateModelMatrix(n,s){if(!this.back)throw new Error("back undefined");const c=create$3();if(c[0]=-1,rotateX(c,c,deg2rad(270-s)),rotateZ(c,c,deg2rad(n-180)),this.back.obliqueRAS){const f=clone$3(this.back.obliqueRAS);multiply$2(c,c,f)}return c}calculateRayDirection(n,s){const c=this.calculateModelMatrix(n,s),f=fromValues$3(1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,1),g=create$3();multiply$2(g,f,c);const A=create$3();invert(A,g);const v=fromValues$1(0,0,-1,1);transformMat4(v,v,A);const y=fromValues$2(v[0],v[1],v[2]);normalize$1(y,y);const T=5e-5;return Math.abs(y[0])0){if(!this.volumeObject3D)throw new Error("volumeObject3D undefined");s=fromValues$2(this.volumeObject3D.extentsMin[0],this.volumeObject3D.extentsMin[1],this.volumeObject3D.extentsMin[2]),c=fromValues$2(this.volumeObject3D.extentsMax[0],this.volumeObject3D.extentsMax[1],this.volumeObject3D.extentsMax[2]),n||(s=fromValues$2(this.volumes[0].extentsMinOrtho[0],this.volumes[0].extentsMinOrtho[1],this.volumes[0].extentsMinOrtho[2]),c=fromValues$2(this.volumes[0].extentsMaxOrtho[0],this.volumes[0].extentsMaxOrtho[1],this.volumes[0].extentsMaxOrtho[2]))}if(this.meshes.length>0){if(this.volumes.length<1){const g=this.meshes[0].extentsMin,A=this.meshes[0].extentsMax;s=fromValues$2(g[0],g[1],g[2]),c=fromValues$2(A[0],A[1],A[2])}for(let g=0;gthis.gl.canvas.width||n.LTWH[1]+n.LTWH[3]>this.gl.canvas.height)return;n.backColor=[.15,.15,.15,n.opacity],n.lineColor=[1,1,1,1],this.opts.backColor[0]+this.opts.backColor[1]+this.opts.backColor[2]>1.5&&(n.backColor=[.95,.95,.95,n.opacity],n.lineColor=[0,0,0,1]),n.textColor=n.lineColor.slice(),n.lineThickness=4,n.lineAlpha=1,n.lines=[];const c=[];if(n.vols.length<1)this.volumes[0]!=null&&c.push(0);else for(let ee=0;eeg){const ee=A-g;for(let oe=0;oe=A&&(A=g+1),this.drawRect(n.LTWH,n.backColor);const[v,y,T]=tickSpacing(g,A),I=Math.max(0,-1*Math.floor(Math.log(v)/Math.log(10)));g=Math.min(y,g),A=Math.max(T,A);function S(ee){return ee.toFixed(6).replace(/\.?0*$/,"")}const e=.07*(Math.min(n.LTWH[2],n.LTWH[3])/(this.fontMets.size*this.uiData.dpr));let N=this.opts.textHeight*this.gl.canvas.height*e;N<16&&(N=0);let M=0,O=y;if(N>0)for(;O<=A;){const ee=O.toFixed(I),oe=this.textWidth(N,ee);M=Math.max(oe,M),O+=v}const U=.05,B=Math.abs(n.LTWH[2]),V=Math.abs(n.LTWH[3]),b=[n.LTWH[0]+U*B+M,n.LTWH[1]+U*V,n.LTWH[2]-M-2*U*B,n.LTWH[3]-N-2*U*V];this.graph.LTWH=n.LTWH,this.graph.plotLTWH=b,this.drawRect(b,this.opts.backColor);const W=A-g,q=b[3]/W,Y=b[2]/(n.lines[0].length-1),X=b[1]+b[3];O=y+.5*v;const Q=n.lineColor.slice();for(Q[3]=.25*n.lineColor[3];O<=A;){const ee=X-(O-g)*q;this.drawLine([b[0],ee,b[0]+b[2],ee],.5*n.lineThickness,Q),O+=v}O=y;const m=.5*n.lineThickness;for(;O<=A;){const ee=X-(O-g)*q;this.drawLine([b[0]-m,ee,b[0]+b[2]+n.lineThickness,ee],n.lineThickness,n.lineColor);const oe=O.toFixed(I);N>0&&this.drawTextLeft([b[0]-6,ee],oe,e,n.textColor),O+=v}let Z=1;for(;n.lines[0].length/Z>20;)Z*=5;for(let ee=0;ee0&&this.drawTextBelow([oe,2+b[1]+b[3]],me,e,n.textColor),this.drawLine([oe,b[1],oe,b[1]+b[3]],fe,n.lineColor)}}for(let ee=0;ee=0&&n.selectedColumnk/255);return}const v=unpackFloatFromVec4i(A);if(v>1)return;const y=(this.mousePos[0]-n[0])/n[2],T=(c.canvas.height-this.mousePos[1]-n[1])/n[3],I=unProject(y,T,v,s),S=this.mm2frac(I,0,!0);S[0]<0||S[0]>1||S[1]<0||S[1]>1||S[2]<0||S[2]>1||(this.scene.crosshairPos=this.mm2frac(I,0,!0))}drawImage3D(n,s,c){if(this.volumes.length===0)return;const f=this.gl,g=this.calculateRayDirection(s,c),A=this.volumeObject3D;if(A){f.enable(f.BLEND),f.blendFunc(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA),f.enable(f.CULL_FACE),f.cullFace(f.FRONT);let v=this.renderShader;if(this.uiData.mouseDepthPicker&&(v=this.pickingImageShader),v.use(this.gl),f.uniform1i(v.uniforms.backgroundMasksOverlays,this.backgroundMasksOverlays),this.gradientTextureAmount>0){f.activeTexture(TEXTURE6_GRADIENT),f.bindTexture(f.TEXTURE_3D,this.gradientTexture);const y=this.calculateModelMatrix(s,c),T=create$3();invert(T,y);const I=create$3();transpose$3(I,T),f.uniformMatrix4fv(v.uniforms.normMtx,!1,I)}this.drawBitmap&&this.drawBitmap.length>8?f.uniform2f(v.uniforms.renderDrawAmbientOcclusionXY,this.renderDrawAmbientOcclusion,this.drawOpacity):f.uniform2f(v.uniforms.renderDrawAmbientOcclusionXY,this.renderDrawAmbientOcclusion,0),f.uniformMatrix4fv(v.uniforms.mvpMtx,!1,n),f.uniformMatrix4fv(v.uniforms.matRAS,!1,this.back.matRAS),f.uniform3fv(v.uniforms.rayDir,g),this.gradientTextureAmount<0?f.uniform4fv(v.uniforms.clipPlane,[this.scene.crosshairPos[0],this.scene.crosshairPos[1],this.scene.crosshairPos[2],30]):f.uniform4fv(v.uniforms.clipPlane,this.scene.clipPlane),f.uniform1f(v.uniforms.drawOpacity,1),f.bindVertexArray(A.vao),f.drawElements(A.mode,A.indexCount,f.UNSIGNED_SHORT,0),f.bindVertexArray(this.unusedVAO)}}drawOrientationCube(n,s=0,c=0){if(!this.opts.isOrientCube)return;const f=.05*Math.min(n[2],n[3]);if(f<5)return;const g=this.gl;g.enable(g.CULL_FACE),g.cullFace(g.BACK),this.orientCubeShader.use(this.gl),g.bindVertexArray(this.orientCubeShaderVAO);const A=create$3(),v=create$3();ortho(v,0,g.canvas.width,0,g.canvas.height,-10*f,10*f);let y=0;n[1]===0&&(y=g.canvas.height-this.effectiveCanvasHeight()),translate(A,A,[1.8*f+n[0],y+1.8*f+n[1],0]),scale$4(A,A,[f,f,f]),rotateX(A,A,deg2rad(270-c)),rotateZ(A,A,deg2rad(-s));const T=create$3();multiply$2(T,v,A),g.uniformMatrix4fv(this.orientCubeShader.uniforms.u_matrix,!1,T),g.drawArrays(g.TRIANGLE_STRIP,0,168),g.bindVertexArray(this.unusedVAO),this.gl.disable(this.gl.CULL_FACE)}createOnLocationChange(n=NaN){const[s,c,f]=this.sceneExtentsMinMax(!0),g=Math.max(Math.max(f[0],f[1]),f[2]);function A(k){return Math.max(0,-Math.ceil(Math.log10(Math.abs(k))))}let v=A(g*.001);const y=this.frac2mm(this.scene.crosshairPos,0,!0);function T(k,e=0){return parseFloat(k.toFixed(e))}let I=T(y[0],v)+"×"+T(y[1],v)+"×"+T(y[2],v);if(this.volumes.length>0&&this.volumes[0].nFrame4D>0&&(I+="×"+T(this.volumes[0].frame4D)),this.volumes.length>0){let k=" = ";for(let M=0;M=0&&B=0&&(k+="+"),k+=T(U,v)),k+=" "}I+=k;const e=this.back.dimsRAS,N=e[1]*e[2]*e[3];if(this.drawBitmap&&this.drawBitmap.length===N){const M=this.frac2vox(this.scene.crosshairPos),O=M[0]+M[1]*e[1]+M[2]*e[1]*e[2];I+=" "+this.drawLut.labels[this.drawBitmap[O]]}}const S={mm:this.frac2mm(this.scene.crosshairPos,0,!0),axCorSag:n,vox:this.frac2vox(this.scene.crosshairPos),frac:this.scene.crosshairPos,xy:[this.mousePos[0],this.mousePos[1]],values:this.volumes.map(k=>{const e=this.frac2mm(this.scene.crosshairPos,0,!0),N=k.mm2vox(e),M=k.getValue(N[0],N[1],N[2],k.frame4D);return{name:k.name,value:M,id:k.id,mm:e,vox:N}}),string:I};this.onLocationChange(S)}addLabel(n,s,c){const f={textColor:this.opts.legendTextColor,textScale:1,textAlignment:"left",lineWidth:0,lineColor:this.opts.legendTextColor,lineTerminator:"none",bulletScale:0,bulletColor:this.opts.legendTextColor},g=s?{...f,...s}:{...f},A=new NVLabel3D(n,g,c);return this.document.labels.push(A),A}calculateScreenPoint(n,s,c){const f=create$1();return transformMat4(f,[...n,1],s),f[3]!==0&&(f[0]=(f[0]/f[3]+1)*.5*c[2],f[1]=(1-f[1]/f[3])*.5*c[3],f[2]/=f[3],f[0]+=c[0],f[1]+=c[1]),f}getLabelAtPoint(n){log$4.debug("screenPoint",n);const s=this.getLegendPanelHeight(),c=this.getLegendPanelWidth(),f=this.gl.canvas.width-c;let g=(this.canvas.height-s)/2;if(log$4.debug("panelrect",f,g,f+c,g+s),n[0]f+c||n[1]>g+s)return null;const v=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*1,y=this.getAllLabels();for(const T of y){const I=this.opts.textHeight*this.gl.canvas.height*T.style.textScale,S=this.textHeight(I,T.text);if(n[1]>=g&&n[1]<=g+S+v/2)return T;g+=S,g+=v/2}return null}drawLabelLine(n,s,c,f,g=!1){const A=Array.isArray(n.points)&&Array.isArray(n.points[0])?n.points:[n.points];for(const v of A){const y=this.calculateScreenPoint(v,c,f);g?this.drawDottedLine([...s,y[0],y[1]],n.style.lineWidth,n.style.lineColor):this.draw3DLine(s,[y[0],y[1],y[2]],n.style.lineWidth,n.style.lineColor)}}draw3DLabel(n,s,c,f,g=0,A,v=!1){const y=n.text,T=s[0],I=s[1],S=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*1,k=this.textHeight(n.style.textScale,y)*S;if(n.style.lineWidth>0&&Array.isArray(n.points)&&this.drawLabelLine(n,[T,I+k],c,f,v),n.style.bulletScale){const N=n.style.bulletScale*k,M=k-N,O=I+M/2+N/2,U=T+(g-N)/2;this.drawCircle([U,O,N,N],n.style.bulletColor)}let e=T;if(n.style.textAlignment!=="left"){const N=this.textWidth(n.style.textScale,n.text)*S;if(n.style.textAlignment==="right")e=T+A-S*1.5-N;else{const M=A-(g||S);e+=(M-N)/2}}else e+=g;this.drawText([e,I],y,n.style.textScale,n.style.textColor)}draw3DLabels(n,s,c=!1){const f=this.getAllLabels();if(!this.opts.showLegend||f.length===0)return;if(!this.canvas)throw new Error("canvas undefined");const g=this.gl;g.disable(g.CULL_FACE),g.viewport(0,0,this.canvas.width,this.canvas.height);const v=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*1,y=this.getBulletMarginWidth(),T=this.getLegendPanelHeight(),I=this.getLegendPanelWidth(),S=g.canvas.width-I;let k=(this.canvas.height-T)/2;this.drawRect([g.canvas.width-I,k,I-v,T],this.opts.legendBackgroundColor);const e=g.getParameter(g.BLEND),N=g.getParameter(g.DEPTH_FUNC);c||(g.disable(g.BLEND),g.depthFunc(g.GREATER));for(const M of f){this.draw3DLabel(M,[S,k],n,s,y,I,c);const O=this.opts.textHeight*this.gl.canvas.height*M.style.textScale,U=this.textHeight(O,M.text);k+=U,k+=v/2}c||(g.depthFunc(N),e&&g.enable(g.BLEND))}draw3D(n=[0,0,0,0],s=null,c=null,f=null,g=null,A=0){const v=g!==null;this.setPivot3D(),v||(g=this.scene.renderAzimuth,A=this.scene.renderElevation);const y=this.gl;s===null&&([s,c,f]=this.calculateMvpMatrix(null,n,g,A));let T=[...n];if(n[2]===0||n[3]===0?(n=[0,0,y.canvas.width,y.canvas.height],T=[...n],this.screenSlices.push({leftTopWidthHeight:n,axCorSag:4,sliceFrac:0,AxyzMxy:[],leftTopMM:[],fovMM:[isRadiological(c),0]})):(this.screenSlices.push({leftTopWidthHeight:n.slice(),axCorSag:4,sliceFrac:0,AxyzMxy:[],leftTopMM:[],fovMM:[isRadiological(c),0]}),n[1]=y.canvas.height-n[3]-n[1]),y.enable(y.DEPTH_TEST),y.depthFunc(y.ALWAYS),y.depthMask(!0),y.clearDepth(0),this.draw3DLabels(s,T,!1),y.viewport(n[0],n[1],n[2],n[3]),this.updateInterpolation(0,!0),this.volumes.length>0&&this.drawImage3D(s,g,A),this.updateInterpolation(0),v||this.drawCrosshairs3D(!0,1,s),this.drawMesh3D(!0,1,s,c,f),this.uiData.mouseDepthPicker){this.depthPicker(n,s),this.createOnLocationChange(),this.draw3D(n,s,c,f,g,A);return}this.opts.meshXRay>0&&this.drawMesh3D(!1,this.opts.meshXRay,s,c,f),this.draw3DLabels(s,T,!1),y.viewport(n[0],n[1],n[2],n[3]),v||this.drawCrosshairs3D(!1,.15,s),y.viewport(0,0,y.canvas.width,y.canvas.height),this.drawOrientationCube(n,g,A);const I="azimuth: "+this.scene.renderAzimuth.toFixed(0)+" elevation: "+this.scene.renderElevation.toFixed(0);return this.readyForSync=!0,this.sync(),this.draw3DLabels(s,T,!0),I}drawMesh3D(n=!0,s=1,c,f,g){if(this.meshes.length<1)return;const A=this.gl;c||([c,f,g]=this.calculateMvpMatrix(this.volumeObject3D,void 0,this.scene.renderAzimuth,this.scene.renderElevation)),A.enable(A.DEPTH_TEST),A.blendFunc(A.SRC_ALPHA,A.ONE_MINUS_SRC_ALPHA),A.disable(A.BLEND),A.depthFunc(A.GREATER),A.disable(A.CULL_FACE),n?(A.disable(A.BLEND),A.depthFunc(A.GREATER)):(A.enable(A.BLEND),A.depthFunc(A.ALWAYS),A.enable(A.CULL_FACE)),A.cullFace(A.BACK);let v=this.meshShaders[0].shader,y=!1;for(let T=0;T=3&&this.meshes[T].fiberRadius>0||(A.bindVertexArray(this.meshes[T].vaoFiber),A.drawElements(A.LINE_STRIP,this.meshes[T].indexCount,A.UNSIGNED_INT,0),A.bindVertexArray(this.unusedVAO)));A.enable(A.BLEND),A.depthFunc(A.ALWAYS),this.readyForSync=!0}drawCrosshairs3D(n=!0,s=1,c=null,f=!1,g=!0){if(!this.opts.show3Dcrosshair&&!f||this.opts.crosshairWidth<=0&&f)return;const A=this.gl,v=this.frac2mm(this.scene.crosshairPos,0,g);if(this.crosshairs3D===null||this.crosshairs3D.mm[0]!==v[0]||this.crosshairs3D.mm[1]!==v[1]||this.crosshairs3D.mm[2]!==v[2]){this.crosshairs3D!==null&&(A.deleteBuffer(this.crosshairs3D.indexBuffer),A.deleteBuffer(this.crosshairs3D.vertexBuffer));const[I,S,k]=this.sceneExtentsMinMax(g);let e=1;if(this.volumes.length>0){if(!this.back)throw new Error("back undefined");e=.5*Math.min(Math.min(this.back.pixDims[1],this.back.pixDims[2]),this.back.pixDims[3])}else(k[0]<50||k[0]>1e3)&&(e=k[0]*.02);e*=this.opts.crosshairWidth,this.crosshairs3D=NiivueObject3D.generateCrosshairs(this.gl,1,v,I,S,e,20,this.opts.crosshairGap),this.crosshairs3D.mm=v}if(!this.surfaceShader)throw new Error("surfaceShader undefined");const y=this.surfaceShader;y.use(this.gl),c==null&&([c]=this.calculateMvpMatrix(this.crosshairs3D,void 0,this.scene.renderAzimuth,this.scene.renderElevation)),A.uniformMatrix4fv(y.uniforms.mvpMtx,!1,c),A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,this.crosshairs3D.indexBuffer),A.enable(A.DEPTH_TEST);const T=[...this.opts.crosshairColor];n?(A.disable(A.BLEND),A.depthFunc(A.GREATER)):(A.enable(A.BLEND),A.blendFunc(A.SRC_ALPHA,A.ONE_MINUS_SRC_ALPHA),A.depthFunc(A.ALWAYS)),T[3]=s,A.uniform4fv(y.uniforms.surfaceColor,T),A.bindVertexArray(this.crosshairs3D.vao),A.drawElements(A.TRIANGLES,this.crosshairs3D.indexCount,A.UNSIGNED_INT,0),A.bindVertexArray(this.unusedVAO)}mm2frac(n,s=0,c=!1){if(this.volumes.length<1){const f=fromValues$2(.1,.5,.5),[g,A,v]=this.sceneExtentsMinMax();return f[0]=(n[0]-g[0])/v[0],f[1]=(n[1]-g[1])/v[1],f[2]=(n[2]-g[2])/v[2],isFinite(f)||(isFinite(f[0])||(f[0]=.5),isFinite(f[1])||(f[1]=.5),isFinite(f[2])||(f[2]=.5),this.meshes.length<1&&log$4.error("mm2frac() not finite: objects not (yet) loaded.")),f}return this.volumes[s].convertMM2Frac(n,c||this.opts.isSliceMM)}vox2frac(n,s=0){return this.volumes[s].convertVox2Frac(n)}frac2vox(n,s=0){return this.volumes.length<=s?[0,0,0]:this.volumes[s].convertFrac2Vox(n)}moveCrosshairInVox(n,s,c){const f=this.frac2vox(this.scene.crosshairPos);f[0]+=n,f[1]+=s,f[2]+=c,f[0]=clamp$1(f[0],0,this.volumes[0].dimsRAS[1]-1),f[1]=clamp$1(f[1],0,this.volumes[0].dimsRAS[2]-1),f[2]=clamp$1(f[2],0,this.volumes[0].dimsRAS[3]-1),this.scene.crosshairPos=this.vox2frac(f),this.createOnLocationChange(),this.drawScene()}frac2mm(n,s=0,c=!1){const f=fromValues$1(n[0],n[1],n[2],1);if(this.volumes.length>0)return this.volumes[s].convertFrac2MM(n,c||this.opts.isSliceMM);{const[g,A]=this.sceneExtentsMinMax(),v=(y,T,I)=>y*(1-I)+T*I;f[0]=v(g[0],A[0],n[0]),f[1]=v(g[1],A[1],n[1]),f[2]=v(g[2],A[2],n[2])}return f}screenXY2TextureFrac(n,s,c,f=!0){const g=fromValues$2(-1,-1,-1),A=this.screenSlices[c].axCorSag;if(A>2)return g;const v=this.screenSlices[c].leftTopWidthHeight.slice();let y=!1;v[2]<0&&(y=!0,v[0]+=v[2],v[2]=-v[2]);let T=(n-v[0])/v[2];y&&(T=1-T);const I=1-(s-v[1])/v[3];if(T<0||T>1||I<0||I>1||this.screenSlices[c].AxyzMxy.length<4)return g;let S=fromValues$2(0,0,0);S[0]=this.screenSlices[c].leftTopMM[0]+T*this.screenSlices[c].fovMM[0],S[1]=this.screenSlices[c].leftTopMM[1]+I*this.screenSlices[c].fovMM[1];const k=this.screenSlices[c].AxyzMxy;S[2]=k[2]+k[4]*(S[1]-k[1])-k[3]*(S[0]-k[0]),A===1&&(S=swizzleVec3(S,[0,2,1])),A===2&&(S=swizzleVec3(S,[2,0,1]));const e=this.mm2frac(S);return f&&(e[0]<0||e[0]>1||e[1]<0||e[1]>1||e[2]<0||e[2]>1)?g:e}canvasPos2frac(n){for(let s=0;s=0)return c}return[-1,-1,-1]}scaleSlice(n,s,c=0,f=0){const g=this.effectiveCanvasWidth()-c,A=this.effectiveCanvasHeight()-f;let v=g/n;s*v>A&&(v=A/s);const y=n*v,T=s*v;return[(g-y)*.5,(A-T)*.5,y,T,v]}drawThumbnail(){if(!this.bmpShader)throw new Error("bmpShader undefined");this.bmpShader.use(this.gl),this.gl.uniform2f(this.bmpShader.uniforms.canvasWidthHeight,this.gl.canvas.width,this.gl.canvas.height);let n=this.gl.canvas.height,s=this.gl.canvas.height*this.bmpTextureWH;s>this.gl.canvas.width&&(n=this.gl.canvas.width/this.bmpTextureWH,s=this.gl.canvas.width),this.gl.uniform4f(this.bmpShader.uniforms.leftTopWidthHeight,0,0,s,n),this.gl.bindVertexArray(this.genericVAO),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}drawLine(n,s=1,c=[1,0,0,-1]){if(this.gl.bindVertexArray(this.genericVAO),!this.lineShader)throw new Error("lineShader undefined");this.lineShader.use(this.gl),c[3]<0&&(c=this.opts.crosshairColor),this.gl.uniform4fv(this.lineShader.uniforms.lineColor,c),this.gl.uniform2fv(this.lineShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform1f(this.lineShader.uniforms.thickness,s),this.gl.uniform4fv(this.lineShader.uniforms.startXYendXY,n),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}draw3DLine(n,s,c=1,f=[1,0,0,-1]){if(this.gl.bindVertexArray(this.genericVAO),!this.line3DShader)throw new Error("line3DShader undefined");this.line3DShader.use(this.gl),f[3]<0&&(f=this.opts.crosshairColor),this.gl.uniform4fv(this.line3DShader.uniforms.lineColor,f),this.gl.uniform2fv(this.line3DShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform1f(this.line3DShader.uniforms.thickness,c),this.gl.uniform2fv(this.line3DShader.uniforms.startXY,n),this.gl.uniform3fv(this.line3DShader.uniforms.endXYZ,s),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.gl.bindVertexArray(this.unusedVAO)}drawDottedLine(n,s=1,c=[1,0,0,-1]){if(this.gl.bindVertexArray(this.genericVAO),!this.lineShader)throw new Error("lineShader undefined");this.lineShader.use(this.gl);const f=c[3]<0?[...this.opts.crosshairColor]:[...c];f[3]=.3;const g=fromValues(n[2]-n[0],n[3]-n[1]),A=length(g);normalize(g,g);const y=this.opts.textHeight*Math.min(this.gl.canvas.height,this.gl.canvas.width)*1;scale$1(g,g,y/2);const T=length(g);let I=Math.floor(A/T);A%T&&I++;const S=[n[0],n[1]];this.gl.uniform4fv(this.lineShader.uniforms.lineColor,f),this.gl.uniform2fv(this.lineShader.uniforms.canvasWidthHeight,[this.gl.canvas.width,this.gl.canvas.height]),this.gl.uniform1f(this.lineShader.uniforms.thickness,s);for(let k=0;k0&&s===0){const e=v,N=1;for(let M=0;M0&&s===1){const e=v,N=2;for(let M=0;M0&&s===2){const e=v,N=2;for(let M=0;M0&&s===0){const e=v,N=0;for(let M=0;M0&&s===1){const e=v,N=0;for(let M=0;M0&&s===2){const e=v,N=1;for(let M=0;M0){const T=A.leftTopWidthHeight.slice();let I=2;s===0&&(I=1);const S=this.frac2mm([.5,.5,.5]);for(let k=0;k0){const T=A.leftTopWidthHeight.slice(),I=A.fovMM[0]<0;let S=0;s===2&&(S=1);const k=this.frac2mm([.5,.5,.5]);for(let e=0;e"u"){if(this.meshes.length>0){this.screenSlices=[],this.opts.sliceType=4,this.draw3D(),this.opts.isColorbar&&this.drawColorbar();return}this.drawLoadingText(this.loadingText);return}if(this.back===null)return;if(this.uiData.isDragging&&this.scene.clipPlaneDepthAziElev[0]<1.8&&this.inRenderTile(this.uiData.dragStart[0],this.uiData.dragStart[1])>=0){const g=this.uiData.dragStart[0]-this.uiData.dragEnd[0],A=this.uiData.dragStart[1]-this.uiData.dragEnd[1],v=this.uiData.dragClipPlaneStartDepthAziElev.slice();if(v[1]-=g,v[1]=v[1]%360,v[2]+=A,v[1]!==this.scene.clipPlaneDepthAziElev[1]||v[2]!==this.scene.clipPlaneDepthAziElev[2])return this.scene.clipPlaneDepthAziElev=v,this.setClipPlane(this.scene.clipPlaneDepthAziElev)}if(this.sliceMosaicString.length<1&&this.opts.sliceType===4){this.opts.isColorbar&&this.reserveColorbarPanel(),this.screenSlices=[],this.draw3D(),this.opts.isColorbar&&this.drawColorbar();return}this.opts.isColorbar&&this.reserveColorbarPanel();const s=this.getMaxVols(),c=this.opts.sliceType===3&&s>1&&this.graph.autoSizeMultiplanar&&this.graph.opacity>0;if(this.sliceMosaicString.length>0)this.drawMosaic(this.sliceMosaicString);else if(this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.screenSlices=[],this.opts.sliceType===0)this.draw2D([0,0,0,0],0);else if(this.opts.sliceType===1)this.draw2D([0,0,0,0],1);else if(this.opts.sliceType===2)this.draw2D([0,0,0,0],2);else{const g=isFinite(this.drawPenLocation[0])&&this.opts.drawingEnabled,{volScale:A}=this.sliceScale();typeof this.opts.multiplanarPadPixels!="number"&&log$4.debug("multiplanarPadPixels must be numeric");const v=parseFloat(`${this.opts.multiplanarPadPixels}`),y=this.scaleSlice(A[0]+A[1],A[1]+A[2],v*1,v*1),T=Math.max(Math.max(A[1],A[2]),A[0]),I=this.scaleSlice(A[0]+A[0]+A[1],Math.max(A[1],A[2]),v*2),S=this.scaleSlice(A[0]+A[0]+A[1]+T,Math.max(A[1],A[2]),v*3),k=this.scaleSlice(T,A[1]+A[2]+A[2],0,v*2),e=this.scaleSlice(T,A[1]+A[2]+A[2]+T,0,v*3);let N=!g&&(s<2||!c),M=!1,O=!1,U=!1;if(this.opts.multiplanarLayout===1?M=!0:this.opts.multiplanarLayout===2?O=!0:this.opts.multiplanarLayout===3?U=!0:k[4]>I[4]&&k[4]>y[4]?M=!0:I[4]>y[4]?U=!0:O=!0,M){let B=k;this.opts.multiplanarForceRender||e[4]>=k[4]?B=e:N=!1;const V=A[0]*B[4],b=A[1]*B[4],W=A[2]*B[4],q=T*B[4];this.draw2D([B[0],B[1],V,b],0),this.draw2D([B[0],B[1]+b+v,V,W],1),this.draw2D([B[0],B[1]+b+v+W+v,b,W],2),N&&this.draw3D([B[0],B[1]+b+W+W+v*3,q,q])}else if(U){let B=I;this.opts.multiplanarForceRender||S[4]>=I[4]?B=S:N=!1;const V=A[0]*B[4],b=A[1]*B[4],W=A[2]*B[4];this.draw2D([B[0],B[1],V,b],0),this.draw2D([B[0]+V+v,B[1],V,W],1),this.draw2D([B[0]+V+V+v*2,B[1],b,W],2),N&&this.draw3D([B[0]+V+V+b+v*3,B[1],B[3],B[3]])}else if(O){const B=y,V=A[0]*B[4],b=A[1]*B[4],W=A[2]*B[4];this.draw2D([B[0],B[1]+W+v,V,b],0),this.draw2D([B[0],B[1],V,W],1),this.draw2D([B[0]+V+v,B[1],b,W],2),N&&this.draw3D([B[0]+V+v,B[1]+W+v,b,b])}}if(this.opts.isRuler&&this.drawRuler(),this.opts.isColorbar&&this.drawColorbar(),c&&this.drawGraph(),this.uiData.isDragging){if(this.uiData.mouseButtonCenterDown){this.dragForCenterButton([this.uiData.dragStart[0],this.uiData.dragStart[1],this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);return}if(this.opts.dragMode===4){this.dragForSlicer3D([this.uiData.dragStart[0],this.uiData.dragStart[1],this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);return}if(this.opts.dragMode===3){this.dragForPanZoom([this.uiData.dragStart[0],this.uiData.dragStart[1],this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);return}if(this.inRenderTile(this.uiData.dragStart[0],this.uiData.dragStart[1])>=0)return;if(this.opts.dragMode===2){this.drawMeasurementTool([this.uiData.dragStart[0],this.uiData.dragStart[1],this.uiData.dragEnd[0],this.uiData.dragEnd[1]]);return}const g=Math.abs(this.uiData.dragStart[0]-this.uiData.dragEnd[0]),A=Math.abs(this.uiData.dragStart[1]-this.uiData.dragEnd[1]);this.drawSelectionBox([Math.min(this.uiData.dragStart[0],this.uiData.dragEnd[0]),Math.min(this.uiData.dragStart[1],this.uiData.dragEnd[1]),g,A])}const f=this.frac2mm([this.scene.crosshairPos[0],this.scene.crosshairPos[1],this.scene.crosshairPos[2]]);return n=f[0].toFixed(2)+"×"+f[1].toFixed(2)+"×"+f[2].toFixed(2),this.readyForSync=!0,this.sync(),n}drawScene(){if(this.isBusy){this.needsRefresh=!0;return}this.isBusy=!1,this.needsRefresh=!1;let n=this.drawSceneCore();return this._gl!==null&&this.gl.finish(),this.needsRefresh&&(n=this.drawScene()),n}get gl(){if(!this._gl)throw new Error("unable to get WebGL context. Maybe the browser doesn't support WebGL2.");return this._gl}set gl(n){this._gl=n}};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1867,7 +1867,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y" "+T).join(` `)),y.join(` -`)}function computeMaxSizePerColumn(u,n,s,c){const f=sizeFromShape(n),g=c[c.length-1],A=new Array(g).fill(0),v=n.length,y=s==="complex64"?createComplexTuples(u):u;if(v>1)for(let T=0;TFORMAT_LIMIT_NUM_VALS){const O=FORMAT_NUM_FIRST_LAST_VALS*A;let z=Array.from(u.slice(0,O)),B=Array.from(u.slice((v-FORMAT_NUM_FIRST_LAST_VALS)*A,v*A));return s==="complex64"&&(z=createComplexTuples(z),B=createComplexTuples(B)),["["+z.map((V,b)=>valToString(V,f[b],s)).join(", ")+", ..., "+B.map((V,b)=>valToString(V,f[v-FORMAT_NUM_FIRST_LAST_VALS+b],s)).join(", ")+"]"]}return["["+(s==="complex64"?createComplexTuples(u):Array.from(u)).map((O,z)=>valToString(O,f[z],s)).join(", ")+"]"]}const T=n.slice(1),I=c.slice(1),S=c[0]*A,k=[];if(v>FORMAT_LIMIT_NUM_VALS){for(let M=0;M1)for(let T=0;TFORMAT_LIMIT_NUM_VALS){const O=FORMAT_NUM_FIRST_LAST_VALS*A;let U=Array.from(u.slice(0,O)),B=Array.from(u.slice((v-FORMAT_NUM_FIRST_LAST_VALS)*A,v*A));return s==="complex64"&&(U=createComplexTuples(U),B=createComplexTuples(B)),["["+U.map((V,b)=>valToString(V,f[b],s)).join(", ")+", ..., "+B.map((V,b)=>valToString(V,f[v-FORMAT_NUM_FIRST_LAST_VALS+b],s)).join(", ")+"]"]}return["["+(s==="complex64"?createComplexTuples(u):Array.from(u)).map((O,U)=>valToString(O,f[U],s)).join(", ")+"]"]}const T=n.slice(1),I=c.slice(1),S=c[0]*A,k=[];if(v>FORMAT_LIMIT_NUM_VALS){for(let M=0;Mn.name)))}}}dispose(){for(const n in this.registeredVariables)this.registeredVariables[n].dispose()}}class Engine{constructor(n){this.ENV=n,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new EngineState}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;const n=this.getSortedBackends();for(let s=0;s{s.setupFunc!=null&&s.setupFunc(this.backendInstance)})}disposeRegisteredKernels(n){getKernelsForBackend(n).forEach(c=>{c.disposeFunc!=null&&c.disposeFunc(this.registry[n])})}initializeBackend(n){const s=this.registryFactory[n];if(s==null)throw new Error(`Cannot initialize backend ${n}, no registration found.`);try{const c=s.factory();if(c&&!(c instanceof KernelBackend)&&typeof c.then=="function"){const f=++this.pendingBackendInitId,g=c.then(A=>f(fthis.registryFactory[s].priority-this.registryFactory[n].priority)}initializeBackendsAndReturnBest(){const n=this.getSortedBackends();for(let s=0;sthis.startScope(c),()=>this.endScope(f),()=>(f=s(),f instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),f))}scopedRun(n,s,c){n();try{const f=c();return s(),f}catch(f){throw s(),f}}nextTensorId(){return Engine.nextTensorId++}nextVariableId(){return Engine.nextVariableId++}clone(n){const s=ENGINE.runKernel(Identity$1,{x:n}),c={x:n},f=A=>({x:()=>{const v="float32",y={x:A},T={dtype:v};return ENGINE.runKernel(Cast,y,T)}}),g=[];return this.addTapeNode(this.state.activeScope.name,c,[s],f,g,{}),s}runKernel(n,s,c){if(this.backendName==null&&this.backend,!(getKernel(n,this.backendName)!=null))throw new Error(`Kernel '${n}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:n,inputs:s,attrs:c})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(n,s,c){const f=this.backend.numDataIds();let g=0;c.forEach(y=>{g+=y.dtype==="complex64"?3:1});const A=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],v=f-s-g-A;if(v>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${v} data ids) after running '${n}'`)}runKernelFunc(n){let s,c=[];const f=this.isTapeOn(),g=this.state.numBytes,A=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let v;this.backendName==null&&this.backend;let y;const T=isRegisteredKernelInvocation(n)?n.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(isRegisteredKernelInvocation(n)){const{kernelName:N,inputs:M,attrs:O}=n;this.backendName==null&&this.backend;const z=getKernel(N,this.backendName);assert$1(z!=null,()=>`Cannot find registered kernel '${N}' for backend '${this.backendName}'`),v=()=>{const B=this.backend.numDataIds();y=z.kernelFunc({inputs:M,attrs:O,backend:this.backend});const V=Array.isArray(y)?y:[y];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(N,B,V);const b=V.map(W=>{if(W.rank!=null)return W;const{dataId:q,shape:Y,dtype:X}=W;return this.makeTensorFromDataId(q,Y,X)});if(f){const W=this.getTensorsForGradient(N,M,b);c=this.saveTensorsForBackwardMode(W)}return b}}else{const{forwardFunc:N}=n,M=O=>{f&&(c=O.map(z=>this.keep(this.clone(z))))};v=()=>{const O=this.backend.numDataIds();y=this.tidy(()=>N(this.backend,M));const z=Array.isArray(y)?y:[y];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(T,O,z),z}}const{inputs:I,attrs:S}=n,k=isRegisteredKernelInvocation(n)?null:n.backwardsFunc;let e;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?s=v():(e=this.profiler.profileKernel(T,I,()=>v()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(e),s=e.outputs)}),f&&this.addTapeNode(T,I,s,k,c,S),this.state.profiling&&this.state.activeProfile.kernels.push({name:T,bytesAdded:this.state.numBytes-g,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-A,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(I).map(N=>I[N]!=null?I[N].shape:null),outputShapes:s.map(N=>N.shape),kernelTimeMs:e.timeMs,extraInfo:e.extraInfo}),Array.isArray(y)?s:s[0]}saveTensorsForBackwardMode(n){return n.map(c=>this.keep(this.clone(c)))}getTensorsForGradient(n,s,c){const f=getGradient(n);if(f!=null){const g=f.inputsToSave||[],A=f.outputsToSave||[];let v;f.saveAllInputs?(assert$1(Array.isArray(s),()=>"saveAllInputs is true, expected inputs to be an array."),v=Object.keys(s).map(T=>s[T])):v=g.map(T=>s[T]);const y=c.filter((T,I)=>A[I]);return v.concat(y)}return[]}makeTensor(n,s,c,f){if(n==null)throw new Error("Values passed to engine.makeTensor() are null");c=c||"float32",f=f||this.backend;let g=n;c==="string"&&isString(n[0])&&(g=n.map(y=>encodeString(y)));const A=f.write(g,s,c),v=new Tensor(s,c,A,this.nextTensorId());if(this.trackTensor(v,f),c==="string"){const y=this.state.tensorInfo.get(A),T=bytesFromStringArray(g);this.state.numBytes+=T-y.bytes,y.bytes=T}return v}makeTensorFromDataId(n,s,c,f){c=c||"float32";const g=new Tensor(s,c,n,this.nextTensorId());return this.trackTensor(g,f),g}makeVariable(n,s=!0,c,f){c=c||this.nextVariableId().toString(),f!=null&&f!==n.dtype&&(n=n.cast(f));const g=new Variable(n,s,c,this.nextTensorId());if(this.state.registeredVariables[g.name]!=null)throw new Error(`Variable with name ${g.name} was already registered`);return this.state.registeredVariables[g.name]=g,this.incRef(g,this.backend),g}trackTensor(n,s){this.state.numTensors++,n.dtype==="string"&&this.state.numStringTensors++;let c=0;n.dtype!=="complex64"&&n.dtype!=="string"&&(c=n.size*bytesPerElement(n.dtype)),this.state.numBytes+=c,this.state.tensorInfo.has(n.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(n.dataId,{backend:s||this.backend,dtype:n.dtype,shape:n.shape,bytes:c})),n instanceof Variable||this.track(n)}incRef(n,s){this.trackTensor(n,s),this.backend.incRef(n.dataId)}removeDataId(n,s){this.state.tensorInfo.has(n)&&this.state.tensorInfo.get(n).backend===s&&(this.state.tensorInfo.delete(n),this.state.numDataBuffers--)}disposeTensor(n){if(!this.state.tensorInfo.has(n.dataId))return;const s=this.state.tensorInfo.get(n.dataId);if(this.state.numTensors--,n.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=s.bytes),n.dtype!=="complex64"&&n.dtype!=="string"){const c=n.size*bytesPerElement(n.dtype);this.state.numBytes-=c}s.backend.disposeData(n.dataId)&&this.removeDataId(n.dataId,s.backend)}disposeVariables(){for(const n in this.state.registeredVariables){const s=this.state.registeredVariables[n];this.disposeVariable(s)}}disposeVariable(n){this.disposeTensor(n),this.state.registeredVariables[n.name]!=null&&delete this.state.registeredVariables[n.name]}memory(){const n=this.backend.memory();return n.numTensors=this.state.numTensors,n.numDataBuffers=this.state.numDataBuffers,n.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(n.unreliable=!0,n.reasons==null&&(n.reasons=[]),n.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),n}async profile(n){this.state.profiling=!0;const s=this.state.numBytes,c=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await n(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(f=>f.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-s,this.state.activeProfile.newTensors=this.state.numTensors-c;for(const f of this.state.activeProfile.kernels)f.kernelTimeMs=await f.kernelTimeMs,f.extraInfo=await f.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(n,s,c,f,g,A){const v={id:this.state.nextTapeNodeId++,kernelName:n,inputs:s,outputs:c,saved:g},y=getGradient(n);y!=null&&(f=y.gradFunc),f!=null&&(v.gradient=T=>(T=T.map((I,S)=>{if(I==null){const k=c[S],e=makeZerosTypedArray(k.size,k.dtype);return this.makeTensor(e,k.shape,k.dtype)}return I}),f(T.length>1?T:T[0],g,A))),this.state.activeTape.push(v)}keep(n){return n.kept=!0,n}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(n){const s={track:[],name:"unnamed scope",id:this.state.nextScopeId++};n&&(s.name=n),this.state.scopeStack.push(s),this.state.activeScope=s}endScope(n){const s=getTensorsInContainer(n),c=new Set(s.map(g=>g.id));for(let g=0;g{!g.kept&&g.scopeId===f.id&&this.track(g)})}gradients(n,s,c,f=!1){if(assert$1(s.length>0,()=>"gradients() received an empty list of xs."),c!=null&&c.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${c.dtype}'`);const g=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",n));assert$1(g instanceof Tensor,()=>"The result y returned by f() must be a tensor.");const A=getFilteredNodesXToY(this.state.activeTape,s,g);if(!f&&A.length===0&&s.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const v={};v[g.id]=c??ones$1(g.shape),backpropagateGradients(v,A,T=>this.tidy(T),add$2);const y=s.map(T=>v[T.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(T=>{for(const I of T.saved)I.dispose()}),this.state.activeTape=null),{value:g,grads:y}})}customGrad(n){return assert$1(isFunction(n),()=>"The f passed in customGrad(f) must be a function."),(...s)=>{assert$1(s.every(v=>v instanceof Tensor),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let c;const f={};s.forEach((v,y)=>{f[y]=v});const g=(v,y)=>(c=n(...s,y),assert$1(c.value instanceof Tensor,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),assert$1(isFunction(c.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),c.value),A=(v,y)=>{const T=c.gradFunc(v,y),I=Array.isArray(T)?T:[T];assert$1(I.length===s.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),assert$1(I.every(k=>k instanceof Tensor),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const S={};return I.forEach((k,e)=>{S[e]=()=>k}),S};return this.runKernelFunc({forwardFunc:g,backwardsFunc:A,inputs:f})}}readSync(n){return this.state.tensorInfo.get(n).backend.readSync(n)}read(n){return this.state.tensorInfo.get(n).backend.read(n)}async time(n){const s=now(),c=await this.backend.time(n);return c.wallMs=now()-s,c}track(n){return this.state.activeScope!=null&&(n.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(n)),n}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new EngineState;for(const n in this.registry)this.disposeRegisteredKernels(n),this.registry[n].dispose(),delete this.registry[n];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Engine.nextTensorId=0;Engine.nextVariableId=0;function ones$1(u){const n=makeOnesTypedArray(sizeFromShape(u),"float32");return ENGINE.makeTensor(n,u,"float32")}function getOrMakeEngine(){const u=getGlobalNamespace();if(u._tfengine==null){const n=new Environment(u);u._tfengine=new Engine(n)}return setEnvironmentGlobal(u._tfengine.ENV),setTensorTracker(()=>u._tfengine),u._tfengine}const ENGINE=getOrMakeEngine();function add$2(u,n){const s={a:u,b:n};return ENGINE.runKernel(Add$1,s)}/** + */function isRegisteredKernelInvocation(u){return u.kernelName!=null}class EngineState{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(n=>n.name)))}}}dispose(){for(const n in this.registeredVariables)this.registeredVariables[n].dispose()}}class Engine{constructor(n){this.ENV=n,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new EngineState}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;const n=this.getSortedBackends();for(let s=0;s{s.setupFunc!=null&&s.setupFunc(this.backendInstance)})}disposeRegisteredKernels(n){getKernelsForBackend(n).forEach(c=>{c.disposeFunc!=null&&c.disposeFunc(this.registry[n])})}initializeBackend(n){const s=this.registryFactory[n];if(s==null)throw new Error(`Cannot initialize backend ${n}, no registration found.`);try{const c=s.factory();if(c&&!(c instanceof KernelBackend)&&typeof c.then=="function"){const f=++this.pendingBackendInitId,g=c.then(A=>f(fthis.registryFactory[s].priority-this.registryFactory[n].priority)}initializeBackendsAndReturnBest(){const n=this.getSortedBackends();for(let s=0;sthis.startScope(c),()=>this.endScope(f),()=>(f=s(),f instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),f))}scopedRun(n,s,c){n();try{const f=c();return s(),f}catch(f){throw s(),f}}nextTensorId(){return Engine.nextTensorId++}nextVariableId(){return Engine.nextVariableId++}clone(n){const s=ENGINE.runKernel(Identity$1,{x:n}),c={x:n},f=A=>({x:()=>{const v="float32",y={x:A},T={dtype:v};return ENGINE.runKernel(Cast,y,T)}}),g=[];return this.addTapeNode(this.state.activeScope.name,c,[s],f,g,{}),s}runKernel(n,s,c){if(this.backendName==null&&this.backend,!(getKernel(n,this.backendName)!=null))throw new Error(`Kernel '${n}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:n,inputs:s,attrs:c})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(n,s,c){const f=this.backend.numDataIds();let g=0;c.forEach(y=>{g+=y.dtype==="complex64"?3:1});const A=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],v=f-s-g-A;if(v>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${v} data ids) after running '${n}'`)}runKernelFunc(n){let s,c=[];const f=this.isTapeOn(),g=this.state.numBytes,A=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let v;this.backendName==null&&this.backend;let y;const T=isRegisteredKernelInvocation(n)?n.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(isRegisteredKernelInvocation(n)){const{kernelName:N,inputs:M,attrs:O}=n;this.backendName==null&&this.backend;const U=getKernel(N,this.backendName);assert$1(U!=null,()=>`Cannot find registered kernel '${N}' for backend '${this.backendName}'`),v=()=>{const B=this.backend.numDataIds();y=U.kernelFunc({inputs:M,attrs:O,backend:this.backend});const V=Array.isArray(y)?y:[y];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(N,B,V);const b=V.map(W=>{if(W.rank!=null)return W;const{dataId:q,shape:Y,dtype:X}=W;return this.makeTensorFromDataId(q,Y,X)});if(f){const W=this.getTensorsForGradient(N,M,b);c=this.saveTensorsForBackwardMode(W)}return b}}else{const{forwardFunc:N}=n,M=O=>{f&&(c=O.map(U=>this.keep(this.clone(U))))};v=()=>{const O=this.backend.numDataIds();y=this.tidy(()=>N(this.backend,M));const U=Array.isArray(y)?y:[y];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(T,O,U),U}}const{inputs:I,attrs:S}=n,k=isRegisteredKernelInvocation(n)?null:n.backwardsFunc;let e;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?s=v():(e=this.profiler.profileKernel(T,I,()=>v()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(e),s=e.outputs)}),f&&this.addTapeNode(T,I,s,k,c,S),this.state.profiling&&this.state.activeProfile.kernels.push({name:T,bytesAdded:this.state.numBytes-g,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-A,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(I).map(N=>I[N]!=null?I[N].shape:null),outputShapes:s.map(N=>N.shape),kernelTimeMs:e.timeMs,extraInfo:e.extraInfo}),Array.isArray(y)?s:s[0]}saveTensorsForBackwardMode(n){return n.map(c=>this.keep(this.clone(c)))}getTensorsForGradient(n,s,c){const f=getGradient(n);if(f!=null){const g=f.inputsToSave||[],A=f.outputsToSave||[];let v;f.saveAllInputs?(assert$1(Array.isArray(s),()=>"saveAllInputs is true, expected inputs to be an array."),v=Object.keys(s).map(T=>s[T])):v=g.map(T=>s[T]);const y=c.filter((T,I)=>A[I]);return v.concat(y)}return[]}makeTensor(n,s,c,f){if(n==null)throw new Error("Values passed to engine.makeTensor() are null");c=c||"float32",f=f||this.backend;let g=n;c==="string"&&isString(n[0])&&(g=n.map(y=>encodeString(y)));const A=f.write(g,s,c),v=new Tensor(s,c,A,this.nextTensorId());if(this.trackTensor(v,f),c==="string"){const y=this.state.tensorInfo.get(A),T=bytesFromStringArray(g);this.state.numBytes+=T-y.bytes,y.bytes=T}return v}makeTensorFromDataId(n,s,c,f){c=c||"float32";const g=new Tensor(s,c,n,this.nextTensorId());return this.trackTensor(g,f),g}makeVariable(n,s=!0,c,f){c=c||this.nextVariableId().toString(),f!=null&&f!==n.dtype&&(n=n.cast(f));const g=new Variable(n,s,c,this.nextTensorId());if(this.state.registeredVariables[g.name]!=null)throw new Error(`Variable with name ${g.name} was already registered`);return this.state.registeredVariables[g.name]=g,this.incRef(g,this.backend),g}trackTensor(n,s){this.state.numTensors++,n.dtype==="string"&&this.state.numStringTensors++;let c=0;n.dtype!=="complex64"&&n.dtype!=="string"&&(c=n.size*bytesPerElement(n.dtype)),this.state.numBytes+=c,this.state.tensorInfo.has(n.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(n.dataId,{backend:s||this.backend,dtype:n.dtype,shape:n.shape,bytes:c})),n instanceof Variable||this.track(n)}incRef(n,s){this.trackTensor(n,s),this.backend.incRef(n.dataId)}removeDataId(n,s){this.state.tensorInfo.has(n)&&this.state.tensorInfo.get(n).backend===s&&(this.state.tensorInfo.delete(n),this.state.numDataBuffers--)}disposeTensor(n){if(!this.state.tensorInfo.has(n.dataId))return;const s=this.state.tensorInfo.get(n.dataId);if(this.state.numTensors--,n.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=s.bytes),n.dtype!=="complex64"&&n.dtype!=="string"){const c=n.size*bytesPerElement(n.dtype);this.state.numBytes-=c}s.backend.disposeData(n.dataId)&&this.removeDataId(n.dataId,s.backend)}disposeVariables(){for(const n in this.state.registeredVariables){const s=this.state.registeredVariables[n];this.disposeVariable(s)}}disposeVariable(n){this.disposeTensor(n),this.state.registeredVariables[n.name]!=null&&delete this.state.registeredVariables[n.name]}memory(){const n=this.backend.memory();return n.numTensors=this.state.numTensors,n.numDataBuffers=this.state.numDataBuffers,n.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(n.unreliable=!0,n.reasons==null&&(n.reasons=[]),n.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),n}async profile(n){this.state.profiling=!0;const s=this.state.numBytes,c=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await n(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(f=>f.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-s,this.state.activeProfile.newTensors=this.state.numTensors-c;for(const f of this.state.activeProfile.kernels)f.kernelTimeMs=await f.kernelTimeMs,f.extraInfo=await f.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(n,s,c,f,g,A){const v={id:this.state.nextTapeNodeId++,kernelName:n,inputs:s,outputs:c,saved:g},y=getGradient(n);y!=null&&(f=y.gradFunc),f!=null&&(v.gradient=T=>(T=T.map((I,S)=>{if(I==null){const k=c[S],e=makeZerosTypedArray(k.size,k.dtype);return this.makeTensor(e,k.shape,k.dtype)}return I}),f(T.length>1?T:T[0],g,A))),this.state.activeTape.push(v)}keep(n){return n.kept=!0,n}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(n){const s={track:[],name:"unnamed scope",id:this.state.nextScopeId++};n&&(s.name=n),this.state.scopeStack.push(s),this.state.activeScope=s}endScope(n){const s=getTensorsInContainer(n),c=new Set(s.map(g=>g.id));for(let g=0;g{!g.kept&&g.scopeId===f.id&&this.track(g)})}gradients(n,s,c,f=!1){if(assert$1(s.length>0,()=>"gradients() received an empty list of xs."),c!=null&&c.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${c.dtype}'`);const g=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",n));assert$1(g instanceof Tensor,()=>"The result y returned by f() must be a tensor.");const A=getFilteredNodesXToY(this.state.activeTape,s,g);if(!f&&A.length===0&&s.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const v={};v[g.id]=c??ones$1(g.shape),backpropagateGradients(v,A,T=>this.tidy(T),add$2);const y=s.map(T=>v[T.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(T=>{for(const I of T.saved)I.dispose()}),this.state.activeTape=null),{value:g,grads:y}})}customGrad(n){return assert$1(isFunction(n),()=>"The f passed in customGrad(f) must be a function."),(...s)=>{assert$1(s.every(v=>v instanceof Tensor),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let c;const f={};s.forEach((v,y)=>{f[y]=v});const g=(v,y)=>(c=n(...s,y),assert$1(c.value instanceof Tensor,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),assert$1(isFunction(c.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),c.value),A=(v,y)=>{const T=c.gradFunc(v,y),I=Array.isArray(T)?T:[T];assert$1(I.length===s.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),assert$1(I.every(k=>k instanceof Tensor),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const S={};return I.forEach((k,e)=>{S[e]=()=>k}),S};return this.runKernelFunc({forwardFunc:g,backwardsFunc:A,inputs:f})}}readSync(n){return this.state.tensorInfo.get(n).backend.readSync(n)}read(n){return this.state.tensorInfo.get(n).backend.read(n)}async time(n){const s=now(),c=await this.backend.time(n);return c.wallMs=now()-s,c}track(n){return this.state.activeScope!=null&&(n.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(n)),n}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new EngineState;for(const n in this.registry)this.disposeRegisteredKernels(n),this.registry[n].dispose(),delete this.registry[n];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Engine.nextTensorId=0;Engine.nextVariableId=0;function ones$1(u){const n=makeOnesTypedArray(sizeFromShape(u),"float32");return ENGINE.makeTensor(n,u,"float32")}function getOrMakeEngine(){const u=getGlobalNamespace();if(u._tfengine==null){const n=new Environment(u);u._tfengine=new Engine(n)}return setEnvironmentGlobal(u._tfengine.ENV),setTensorTracker(()=>u._tfengine),u._tfengine}const ENGINE=getOrMakeEngine();function add$2(u,n){const s={a:u,b:n};return ENGINE.runKernel(Add$1,s)}/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2064,7 +2064,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;yA.name):Object.keys(u);for(let A=0;A{const k=await y.bytes(),e=k.reduce((O,z)=>O+z.length,0)+NUM_BYTES_STRING_LENGTH*k.length,N=new Uint8Array(e);let M=0;for(let O=0;O{if(n+=g.byteLength,s.push(g.byteLength===g.buffer.byteLength?g:new g.constructor(g)),!(g instanceof Float32Array||g instanceof Int32Array||g instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${g.constructor.name}`)});const c=new Uint8Array(n);let f=0;return s.forEach(g=>{c.set(new Uint8Array(g.buffer),f),f+=g.byteLength}),c.buffer}const useNodeBuffer=typeof Buffer<"u"&&(typeof Blob>"u"||typeof atob>"u"||typeof btoa>"u");function stringByteLength(u){return useNodeBuffer?Buffer.byteLength(u):new Blob([u]).size}function arrayBufferToBase64String(u){if(useNodeBuffer)return Buffer.from(u).toString("base64");const n=new Uint8Array(u);let s="";for(let c=0,f=n.length;c{n+=f.byteLength});const s=new Uint8Array(n);let c=0;return u.forEach(f=>{s.set(new Uint8Array(f),c),c+=f.byteLength}),s.buffer}function getModelJSONForModelArtifacts(u,n){const s={modelTopology:u.modelTopology,format:u.format,generatedBy:u.generatedBy,convertedBy:u.convertedBy,weightsManifest:n};return u.signature!=null&&(s.signature=u.signature),u.userDefinedMetadata!=null&&(s.userDefinedMetadata=u.userDefinedMetadata),u.modelInitializer!=null&&(s.modelInitializer=u.modelInitializer),u.trainingConfig!=null&&(s.trainingConfig=u.trainingConfig),s}async function getModelArtifactsForJSON(u,n){const s={modelTopology:u.modelTopology,format:u.format,generatedBy:u.generatedBy,convertedBy:u.convertedBy};if(u.trainingConfig!=null&&(s.trainingConfig=u.trainingConfig),u.weightsManifest!=null){const[c,f]=await n(u.weightsManifest);s.weightSpecs=c,s.weightData=f}return u.signature!=null&&(s.signature=u.signature),u.userDefinedMetadata!=null&&(s.userDefinedMetadata=u.userDefinedMetadata),u.modelInitializer!=null&&(s.modelInitializer=u.modelInitializer),s}function getModelArtifactsInfoForJSON(u){if(u.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:u.modelTopology==null?0:stringByteLength(JSON.stringify(u.modelTopology)),weightSpecsBytes:u.weightSpecs==null?0:stringByteLength(JSON.stringify(u.weightSpecs)),weightDataBytes:u.weightData==null?0:u.weightData.byteLength}}function computeFloat16MantisaTable(){const u=s=>{let c=s<<13,f=0;for(;!(c&8388608);)f-=8388608,c<<=1;return c&=-8388609,f+=947912704,c|f},n=new Uint32Array(2048);n[0]=0;for(let s=1;s<1024;s++)n[s]=u(s);for(let s=1024;s<2048;s++)n[s]=939524096+(s-1024<<13);return n}function computeFloat16ExponentTable(){const u=new Uint32Array(64);u[0]=0,u[31]=1199570944,u[32]=2147483648,u[63]=3347054592;for(let n=1;n<31;n++)u[n]=n<<23;for(let n=33;n<63;n++)u[n]=2147483648+(n-32<<23);return u}function computeFloat16OffsetTable(){const u=new Uint32Array(64);for(let n=0;n<64;n++)u[n]=1024;return u[0]=u[32]=0,u}function getFloat16Decoder(){const u=computeFloat16MantisaTable(),n=computeFloat16ExponentTable(),s=computeFloat16OffsetTable();return c=>{const f=new ArrayBuffer(4*c.length),g=new Uint32Array(f);for(let A=0;A>10]+(v&1023)]+n[v>>10];g[A]=y}return new Float32Array(f)}}/** + */const NUM_BYTES_STRING_LENGTH=4;async function encodeWeights(u,n){const s=[],c=[],f=Array.isArray(u)?u.map(A=>A.name):Object.keys(u);for(let A=0;A{const k=await y.bytes(),e=k.reduce((O,U)=>O+U.length,0)+NUM_BYTES_STRING_LENGTH*k.length,N=new Uint8Array(e);let M=0;for(let O=0;O{if(n+=g.byteLength,s.push(g.byteLength===g.buffer.byteLength?g:new g.constructor(g)),!(g instanceof Float32Array||g instanceof Int32Array||g instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${g.constructor.name}`)});const c=new Uint8Array(n);let f=0;return s.forEach(g=>{c.set(new Uint8Array(g.buffer),f),f+=g.byteLength}),c.buffer}const useNodeBuffer=typeof Buffer<"u"&&(typeof Blob>"u"||typeof atob>"u"||typeof btoa>"u");function stringByteLength(u){return useNodeBuffer?Buffer.byteLength(u):new Blob([u]).size}function arrayBufferToBase64String(u){if(useNodeBuffer)return Buffer.from(u).toString("base64");const n=new Uint8Array(u);let s="";for(let c=0,f=n.length;c{n+=f.byteLength});const s=new Uint8Array(n);let c=0;return u.forEach(f=>{s.set(new Uint8Array(f),c),c+=f.byteLength}),s.buffer}function getModelJSONForModelArtifacts(u,n){const s={modelTopology:u.modelTopology,format:u.format,generatedBy:u.generatedBy,convertedBy:u.convertedBy,weightsManifest:n};return u.signature!=null&&(s.signature=u.signature),u.userDefinedMetadata!=null&&(s.userDefinedMetadata=u.userDefinedMetadata),u.modelInitializer!=null&&(s.modelInitializer=u.modelInitializer),u.trainingConfig!=null&&(s.trainingConfig=u.trainingConfig),s}async function getModelArtifactsForJSON(u,n){const s={modelTopology:u.modelTopology,format:u.format,generatedBy:u.generatedBy,convertedBy:u.convertedBy};if(u.trainingConfig!=null&&(s.trainingConfig=u.trainingConfig),u.weightsManifest!=null){const[c,f]=await n(u.weightsManifest);s.weightSpecs=c,s.weightData=f}return u.signature!=null&&(s.signature=u.signature),u.userDefinedMetadata!=null&&(s.userDefinedMetadata=u.userDefinedMetadata),u.modelInitializer!=null&&(s.modelInitializer=u.modelInitializer),s}function getModelArtifactsInfoForJSON(u){if(u.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:u.modelTopology==null?0:stringByteLength(JSON.stringify(u.modelTopology)),weightSpecsBytes:u.weightSpecs==null?0:stringByteLength(JSON.stringify(u.weightSpecs)),weightDataBytes:u.weightData==null?0:u.weightData.byteLength}}function computeFloat16MantisaTable(){const u=s=>{let c=s<<13,f=0;for(;!(c&8388608);)f-=8388608,c<<=1;return c&=-8388609,f+=947912704,c|f},n=new Uint32Array(2048);n[0]=0;for(let s=1;s<1024;s++)n[s]=u(s);for(let s=1024;s<2048;s++)n[s]=939524096+(s-1024<<13);return n}function computeFloat16ExponentTable(){const u=new Uint32Array(64);u[0]=0,u[31]=1199570944,u[32]=2147483648,u[63]=3347054592;for(let n=1;n<31;n++)u[n]=n<<23;for(let n=33;n<63;n++)u[n]=2147483648+(n-32<<23);return u}function computeFloat16OffsetTable(){const u=new Uint32Array(64);for(let n=0;n<64;n++)u[n]=1024;return u[0]=u[32]=0,u}function getFloat16Decoder(){const u=computeFloat16MantisaTable(),n=computeFloat16ExponentTable(),s=computeFloat16OffsetTable();return c=>{const f=new ArrayBuffer(4*c.length),g=new Uint32Array(f);for(let A=0;A>10]+(v&1023)]+n[v>>10];g[A]=y}return new Float32Array(f)}}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2334,7 +2334,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y`Error in slice${c}D: Length of begin ${n} must match the rank of the array (${c}).`),assert$1(c===s.length,()=>`Error in slice${c}D: Length of size ${s} must match the rank of the array (${c}).`);for(let f=0;f`Error in slice${c}D: begin[${f}] + size[${f}] (${n[f]+s[f]}) would overflow input.shape[${f}] (${u.shape[f]})`)}function maskToAxes(u){const n=[];let s=0;for(;u>0;)u&1&&n.push(s),u/=2,s++;return n}function computeOutShape$2(u,n,s){const c=[];for(let f=0;f0){const e=n[0],N=s+1;I=startIndicesWithElidedDims(A,e,N,c,u),S=stopIndicesWithElidedDims(v,e,N,f,u),k=stridesWithElidedDims(g,e,N,u)}else for(let e=0;e-1)g[v]=0;else{const y=unnormalizeAxis(n,s,v);let T=c[y];u&1<-1)g[v]=Number.MAX_SAFE_INTEGER;else{const y=unnormalizeAxis(n,s,v);let T=c[y];u&1<0?A=Number.MIN_SAFE_INTEGER:A=Number.MAX_SAFE_INTEGER);const y=c[f];return A<0&&(A+=y),A=clamp(0,A,y-1),A}function stopForAxis(u,n,s,c,f,g){let A=n[f];const v=s[f]||1;(u&1<0?A=Number.MAX_SAFE_INTEGER:A=Number.MIN_SAFE_INTEGER);const y=c[f];return A<0&&(A+=y),v>0?A=clamp(0,A,y):A=clamp(-1,A,y-1),A}function isSliceContinous(u,n,s){let c=s.length;for(let f=0;f1){c=f;break}for(let f=c+1;f0||s[f]!==u[f])return!1;return!0}function computeFlatOffset(u,n){let s=u.length>0?u[u.length-1]:1;for(let c=0;c{assert$1(A!==-1,()=>"slice() does not support negative begin indexing.")});let g;return s==null?g=new Array(f).fill(-1):typeof s=="number"?g=[s,...new Array(f-1).fill(-1)]:s.lengthA>=0?A:(assert$1(A===-1,()=>`Negative size values should be exactly -1 but got ${A} for the slice() size at index ${v}.`),u.shape[v]-c[v])),[c,g]}function sliceInfo(u,n,s,c,f,g,A,v,y){let T=n.slice(),I=s.slice(),S=c;c==null&&(S=new Array(T.length));const k=maskToAxes(A);if(k.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(A!==0&&v!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(A!==0&&y!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");const e=u.length-T.length,N=maskToAxes(v),M=u.slice();N.forEach(Y=>{T[Y]=0,I[Y]=1,M.splice(Y,0,1)});const{begin:O,end:z,strides:B}=getNormalizedAxes(M,k,e,T,I,S,f,g,A);T=O,I=z,S=B;const V=maskToAxes(y);V.forEach(Y=>{I[Y]=T[Y]+1,S[Y]=1});const b=computeOutShape$2(T,I,S),W=b.filter((Y,X)=>V.indexOf(X)===-1);return{nonStrided:S.every(Y=>Y===1),$begin:T,$end:I,$strides:S,size:b,newShape:M,outShape:W}}const slice_util=Object.freeze(Object.defineProperty({__proto__:null,assertParamsValid,computeFlatOffset,computeOutShape:computeOutShape$2,getNormalizedAxes,isSliceContinous,maskToAxes,parseSliceParams,sliceInfo,startForAxis,startIndicesWithElidedDims,stopForAxis,stopIndicesWithElidedDims,stridesForAxis,stridesWithElidedDims},Symbol.toStringTag,{value:"Module"}));/** + */function assertParamsValid(u,n,s){const c=u.shape.length;assert$1(c===n.length,()=>`Error in slice${c}D: Length of begin ${n} must match the rank of the array (${c}).`),assert$1(c===s.length,()=>`Error in slice${c}D: Length of size ${s} must match the rank of the array (${c}).`);for(let f=0;f`Error in slice${c}D: begin[${f}] + size[${f}] (${n[f]+s[f]}) would overflow input.shape[${f}] (${u.shape[f]})`)}function maskToAxes(u){const n=[];let s=0;for(;u>0;)u&1&&n.push(s),u/=2,s++;return n}function computeOutShape$2(u,n,s){const c=[];for(let f=0;f0){const e=n[0],N=s+1;I=startIndicesWithElidedDims(A,e,N,c,u),S=stopIndicesWithElidedDims(v,e,N,f,u),k=stridesWithElidedDims(g,e,N,u)}else for(let e=0;e-1)g[v]=0;else{const y=unnormalizeAxis(n,s,v);let T=c[y];u&1<-1)g[v]=Number.MAX_SAFE_INTEGER;else{const y=unnormalizeAxis(n,s,v);let T=c[y];u&1<0?A=Number.MIN_SAFE_INTEGER:A=Number.MAX_SAFE_INTEGER);const y=c[f];return A<0&&(A+=y),A=clamp(0,A,y-1),A}function stopForAxis(u,n,s,c,f,g){let A=n[f];const v=s[f]||1;(u&1<0?A=Number.MAX_SAFE_INTEGER:A=Number.MIN_SAFE_INTEGER);const y=c[f];return A<0&&(A+=y),v>0?A=clamp(0,A,y):A=clamp(-1,A,y-1),A}function isSliceContinous(u,n,s){let c=s.length;for(let f=0;f1){c=f;break}for(let f=c+1;f0||s[f]!==u[f])return!1;return!0}function computeFlatOffset(u,n){let s=u.length>0?u[u.length-1]:1;for(let c=0;c{assert$1(A!==-1,()=>"slice() does not support negative begin indexing.")});let g;return s==null?g=new Array(f).fill(-1):typeof s=="number"?g=[s,...new Array(f-1).fill(-1)]:s.lengthA>=0?A:(assert$1(A===-1,()=>`Negative size values should be exactly -1 but got ${A} for the slice() size at index ${v}.`),u.shape[v]-c[v])),[c,g]}function sliceInfo(u,n,s,c,f,g,A,v,y){let T=n.slice(),I=s.slice(),S=c;c==null&&(S=new Array(T.length));const k=maskToAxes(A);if(k.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(A!==0&&v!==0)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(A!==0&&y!==0)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");const e=u.length-T.length,N=maskToAxes(v),M=u.slice();N.forEach(Y=>{T[Y]=0,I[Y]=1,M.splice(Y,0,1)});const{begin:O,end:U,strides:B}=getNormalizedAxes(M,k,e,T,I,S,f,g,A);T=O,I=U,S=B;const V=maskToAxes(y);V.forEach(Y=>{I[Y]=T[Y]+1,S[Y]=1});const b=computeOutShape$2(T,I,S),W=b.filter((Y,X)=>V.indexOf(X)===-1);return{nonStrided:S.every(Y=>Y===1),$begin:T,$end:I,$strides:S,size:b,newShape:M,outShape:W}}const slice_util=Object.freeze(Object.defineProperty({__proto__:null,assertParamsValid,computeFlatOffset,computeOutShape:computeOutShape$2,getNormalizedAxes,isSliceContinous,maskToAxes,parseSliceParams,sliceInfo,startForAxis,startIndicesWithElidedDims,stopForAxis,stopIndicesWithElidedDims,stridesForAxis,stridesWithElidedDims},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2619,7 +2619,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y>>0,k-=y,k*=y,y=k>>>0,k-=y,y+=k*4294967296}return(y>>>0)*23283064365386963e-26};return T}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.alea=A})(commonjsGlobal,u,!1)})(alea$5);var aleaExports$2=alea$5.exports,xor128$5={exports:{}};xor128$5.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.x=0,y.y=0,y.z=0,y.w=0,y.next=function(){var S=y.x^y.x<<11;return y.x=y.y,y.y=y.z,y.z=y.w,y.w^=y.w>>>19^S^S>>>8},v===(v|0)?y.x=v:T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor128=A})(commonjsGlobal,u,!1)})(xor128$5);var xor128Exports$2=xor128$5.exports,xorwow$5={exports:{}};xorwow$5.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.x^y.x>>>2;return y.x=y.y,y.y=y.z,y.z=y.w,y.w=y.v,(y.d=y.d+362437|0)+(y.v=y.v^y.v<<4^(S^S<<1))|0},y.x=0,y.y=0,y.z=0,y.w=0,y.v=0,v===(v|0)?y.x=v:T+=v;for(var I=0;I>>4),y.next()}function g(v,y){return y.x=v.x,y.y=v.y,y.z=v.z,y.w=v.w,y.v=v.v,y.d=v.d,y}function A(v,y){var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorwow=A})(commonjsGlobal,u,!1)})(xorwow$5);var xorwowExports$2=xorwow$5.exports,xorshift7$5={exports:{}};xorshift7$5.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.x,S=y.i,k,e;return k=I[S],k^=k>>>7,e=k^k<<24,k=I[S+1&7],e^=k^k>>>10,k=I[S+3&7],e^=k^k>>>3,k=I[S+4&7],e^=k^k<<7,k=I[S+7&7],k=k^k<<13,e^=k^k<<9,I[S]=e,y.i=S+1&7,e};function T(I,S){var k,e=[];if(S===(S|0))e[0]=S;else for(S=""+S,k=0;k0;--k)I.next()}T(y,v)}function g(v,y){return y.x=v.x.slice(),y.i=v.i,y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.x&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorshift7=A})(commonjsGlobal,u,!1)})(xorshift7$5);var xorshift7Exports$2=xorshift7$5.exports,xor4096$5={exports:{}};xor4096$5.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.w,S=y.X,k=y.i,e,N;return y.w=I=I+1640531527|0,N=S[k+34&127],e=S[k=k+1&127],N^=N<<13,e^=e<<17,N^=N>>>15,e^=e>>>12,N=S[k]=N^e,y.i=k,N+(I^I>>>16)|0};function T(I,S){var k,e,N,M,O,z=[],B=128;for(S===(S|0)?(e=S,S=null):(S=S+"\0",e=0,B=Math.max(B,S.length)),N=0,M=-32;M>>15,e^=e<<4,e^=e>>>13,M>=0&&(O=O+1640531527|0,k=z[M&127]^=e+O,N=k==0?N+1:0);for(N>=128&&(z[(S&&S.length||0)&127]=-1),N=127,M=4*128;M>0;--M)e=z[N+34&127],k=z[N=N+1&127],e^=e<<13,k^=k<<17,e^=e>>>15,k^=k>>>12,z[N]=e^k;I.w=O,I.X=z,I.i=N}T(y,v)}function g(v,y){return y.i=v.i,y.w=v.w,y.X=v.X.slice(),y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.X&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor4096=A})(commonjsGlobal,u,!1)})(xor4096$5);var xor4096Exports$2=xor4096$5.exports,tychei$5={exports:{}};tychei$5.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.b,k=y.c,e=y.d,N=y.a;return S=S<<25^S>>>7^k,k=k-e|0,e=e<<24^e>>>8^N,N=N-S|0,y.b=S=S<<20^S>>>12^k,y.c=k=k-e|0,y.d=e<<16^k>>>16^N,y.a=N-S|0},y.a=0,y.b=0,y.c=-1640531527,y.d=1367130551,v===Math.floor(v)?(y.a=v/4294967296|0,y.b=v|0):T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.tychei=A})(commonjsGlobal,u,!1)})(tychei$5);var tycheiExports$2=tychei$5.exports,seedrandom$4={exports:{}};(function(u){(function(n,s){var c=this,f=256,g=6,A=52,v="random",y=s.pow(f,g),T=s.pow(2,A),I=T*2,S=f-1,k;function e(b,W,q){var Y=[];W=W==!0?{entropy:!0}:W||{};var X=z(O(W.entropy?[b,V(n)]:b??B(),3),Y),Q=new N(Y),m=function(){for(var Z=Q.g(g),ee=y,oe=0;Z=I;)Z/=2,ee/=2,oe>>>=1;return(Z+oe)/ee};return m.int32=function(){return Q.g(4)|0},m.quick=function(){return Q.g(4)/4294967296},m.double=m,z(V(Q.S),n),(W.pass||q||function(Z,ee,oe,fe){return fe&&(fe.S&&M(fe,Q),Z.state=function(){return M(Q,{})}),oe?(s[v]=Z,ee):Z})(m,X,"global"in W?W.global:this==s,W.state)}s["seed"+v]=e;function N(b){var W,q=b.length,Y=this,X=0,Q=Y.i=Y.j=0,m=Y.S=[];for(q||(b=[q++]);X>>0,k-=y,k*=y,y=k>>>0,k-=y,y+=k*4294967296}return(y>>>0)*23283064365386963e-26};return T}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.alea=A})(commonjsGlobal,u,!1)})(alea$5);var aleaExports$2=alea$5.exports,xor128$5={exports:{}};xor128$5.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.x=0,y.y=0,y.z=0,y.w=0,y.next=function(){var S=y.x^y.x<<11;return y.x=y.y,y.y=y.z,y.z=y.w,y.w^=y.w>>>19^S^S>>>8},v===(v|0)?y.x=v:T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor128=A})(commonjsGlobal,u,!1)})(xor128$5);var xor128Exports$2=xor128$5.exports,xorwow$5={exports:{}};xorwow$5.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.x^y.x>>>2;return y.x=y.y,y.y=y.z,y.z=y.w,y.w=y.v,(y.d=y.d+362437|0)+(y.v=y.v^y.v<<4^(S^S<<1))|0},y.x=0,y.y=0,y.z=0,y.w=0,y.v=0,v===(v|0)?y.x=v:T+=v;for(var I=0;I>>4),y.next()}function g(v,y){return y.x=v.x,y.y=v.y,y.z=v.z,y.w=v.w,y.v=v.v,y.d=v.d,y}function A(v,y){var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorwow=A})(commonjsGlobal,u,!1)})(xorwow$5);var xorwowExports$2=xorwow$5.exports,xorshift7$5={exports:{}};xorshift7$5.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.x,S=y.i,k,e;return k=I[S],k^=k>>>7,e=k^k<<24,k=I[S+1&7],e^=k^k>>>10,k=I[S+3&7],e^=k^k>>>3,k=I[S+4&7],e^=k^k<<7,k=I[S+7&7],k=k^k<<13,e^=k^k<<9,I[S]=e,y.i=S+1&7,e};function T(I,S){var k,e=[];if(S===(S|0))e[0]=S;else for(S=""+S,k=0;k0;--k)I.next()}T(y,v)}function g(v,y){return y.x=v.x.slice(),y.i=v.i,y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.x&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorshift7=A})(commonjsGlobal,u,!1)})(xorshift7$5);var xorshift7Exports$2=xorshift7$5.exports,xor4096$5={exports:{}};xor4096$5.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.w,S=y.X,k=y.i,e,N;return y.w=I=I+1640531527|0,N=S[k+34&127],e=S[k=k+1&127],N^=N<<13,e^=e<<17,N^=N>>>15,e^=e>>>12,N=S[k]=N^e,y.i=k,N+(I^I>>>16)|0};function T(I,S){var k,e,N,M,O,U=[],B=128;for(S===(S|0)?(e=S,S=null):(S=S+"\0",e=0,B=Math.max(B,S.length)),N=0,M=-32;M>>15,e^=e<<4,e^=e>>>13,M>=0&&(O=O+1640531527|0,k=U[M&127]^=e+O,N=k==0?N+1:0);for(N>=128&&(U[(S&&S.length||0)&127]=-1),N=127,M=4*128;M>0;--M)e=U[N+34&127],k=U[N=N+1&127],e^=e<<13,k^=k<<17,e^=e>>>15,k^=k>>>12,U[N]=e^k;I.w=O,I.X=U,I.i=N}T(y,v)}function g(v,y){return y.i=v.i,y.w=v.w,y.X=v.X.slice(),y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.X&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor4096=A})(commonjsGlobal,u,!1)})(xor4096$5);var xor4096Exports$2=xor4096$5.exports,tychei$5={exports:{}};tychei$5.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.b,k=y.c,e=y.d,N=y.a;return S=S<<25^S>>>7^k,k=k-e|0,e=e<<24^e>>>8^N,N=N-S|0,y.b=S=S<<20^S>>>12^k,y.c=k=k-e|0,y.d=e<<16^k>>>16^N,y.a=N-S|0},y.a=0,y.b=0,y.c=-1640531527,y.d=1367130551,v===Math.floor(v)?(y.a=v/4294967296|0,y.b=v|0):T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.tychei=A})(commonjsGlobal,u,!1)})(tychei$5);var tycheiExports$2=tychei$5.exports,seedrandom$4={exports:{}};(function(u){(function(n,s){var c=this,f=256,g=6,A=52,v="random",y=s.pow(f,g),T=s.pow(2,A),I=T*2,S=f-1,k;function e(b,W,q){var Y=[];W=W==!0?{entropy:!0}:W||{};var X=U(O(W.entropy?[b,V(n)]:b??B(),3),Y),Q=new N(Y),m=function(){for(var Z=Q.g(g),ee=y,oe=0;Z=I;)Z/=2,ee/=2,oe>>>=1;return(Z+oe)/ee};return m.int32=function(){return Q.g(4)|0},m.quick=function(){return Q.g(4)/4294967296},m.double=m,U(V(Q.S),n),(W.pass||q||function(Z,ee,oe,fe){return fe&&(fe.S&&M(fe,Q),Z.state=function(){return M(Q,{})}),oe?(s[v]=Z,ee):Z})(m,X,"global"in W?W.global:this==s,W.state)}s["seed"+v]=e;function N(b){var W,q=b.length,Y=this,X=0,Q=Y.i=Y.j=0,m=Y.S=[];for(q||(b=[q++]);X`Error in fused conv2d: input must be rank 4, but got rank ${e.rank}.`),assert$1(k.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${k.rank}.`),A!=null&&assert$1(isInt(c),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${A} but got pad ${c}.`),assert$1(e.shape[3]===k.shape[2],()=>`Error in conv2d: depth of input (${e.shape[3]}) must match input depth for filter ${k.shape[2]}.`),assert$1(eitherStridesOrDilationsAreOne(s,g),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${s} and dilations '${g}'`),assert$1(f==="NHWC",()=>`Error in conv2d: got dataFormat of ${f} but only NHWC is currently supported.`);const M=computeConv2DInfo(e.shape,k.shape,s,g,c,A);let O;v!=null&&(O=convertToTensor(v,"bias","fused conv2d"),[O]=makeTypesMatch(O,S),assertAndGetBroadcastShape(M.outShape,O.shape));let z;T!=null&&(z=convertToTensor(T,"prelu weights","fused conv2d"));const B=(W,q)=>{const[Y,X,Q,m]=q,Z=getFusedDyActivation(W,Q,y);assert$1(tupleValuesAreOne(g),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${g}'`);const ee=conv2DBackpropInput$2(X.shape,Z,Y,s,c),oe=conv2DBackpropFilter$2(X,Z,Y.shape,s,c),fe=[ee,oe];if(m!=null){const me=getFusedBiasGradient(m,Z);fe.push(me)}return fe},V={x:e,filter:k,bias:O,preluActivationWeights:z},b={strides:s,pad:c,dataFormat:f,dilations:g,dimRoundingMode:A,activation:y,leakyreluAlpha:I};return v==null?customGrad((q,Y,X)=>{let Q=ENGINE.runKernel(FusedConv2D,V,b);return X([Y,q,Q]),N&&(Q=reshape$2(Q,[Q.shape[1],Q.shape[2],Q.shape[3]])),{value:Q,gradFunc:B}})(e,k):customGrad((q,Y,X,Q)=>{let m=ENGINE.runKernel(FusedConv2D,V,b);return Q([Y,q,m,X]),N&&(m=reshape$2(m,[m.shape[1],m.shape[2],m.shape[3]])),{value:m,gradFunc:B}})(e,k,O)}const conv2d$1=op({fusedConv2d_});/** + */function fusedConv2d_({x:u,filter:n,strides:s,pad:c,dataFormat:f="NHWC",dilations:g=[1,1],dimRoundingMode:A,bias:v,activation:y="linear",preluActivationWeights:T,leakyreluAlpha:I}){if(y=y||"linear",shouldFuse(ENGINE.state.gradientDepth,y)===!1){let W=conv2d$2(u,n,s,c,f,g,A);return v!=null&&(W=add$1(W,v)),applyActivation$1(W,y,T,I)}const S=convertToTensor(u,"x","conv2d"),k=convertToTensor(n,"filter","conv2d");let e=S,N=!1;S.rank===3&&(N=!0,e=reshape$2(S,[1,S.shape[0],S.shape[1],S.shape[2]])),assert$1(e.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${e.rank}.`),assert$1(k.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${k.rank}.`),A!=null&&assert$1(isInt(c),()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${A} but got pad ${c}.`),assert$1(e.shape[3]===k.shape[2],()=>`Error in conv2d: depth of input (${e.shape[3]}) must match input depth for filter ${k.shape[2]}.`),assert$1(eitherStridesOrDilationsAreOne(s,g),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${s} and dilations '${g}'`),assert$1(f==="NHWC",()=>`Error in conv2d: got dataFormat of ${f} but only NHWC is currently supported.`);const M=computeConv2DInfo(e.shape,k.shape,s,g,c,A);let O;v!=null&&(O=convertToTensor(v,"bias","fused conv2d"),[O]=makeTypesMatch(O,S),assertAndGetBroadcastShape(M.outShape,O.shape));let U;T!=null&&(U=convertToTensor(T,"prelu weights","fused conv2d"));const B=(W,q)=>{const[Y,X,Q,m]=q,Z=getFusedDyActivation(W,Q,y);assert$1(tupleValuesAreOne(g),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${g}'`);const ee=conv2DBackpropInput$2(X.shape,Z,Y,s,c),oe=conv2DBackpropFilter$2(X,Z,Y.shape,s,c),fe=[ee,oe];if(m!=null){const me=getFusedBiasGradient(m,Z);fe.push(me)}return fe},V={x:e,filter:k,bias:O,preluActivationWeights:U},b={strides:s,pad:c,dataFormat:f,dilations:g,dimRoundingMode:A,activation:y,leakyreluAlpha:I};return v==null?customGrad((q,Y,X)=>{let Q=ENGINE.runKernel(FusedConv2D,V,b);return X([Y,q,Q]),N&&(Q=reshape$2(Q,[Q.shape[1],Q.shape[2],Q.shape[3]])),{value:Q,gradFunc:B}})(e,k):customGrad((q,Y,X,Q)=>{let m=ENGINE.runKernel(FusedConv2D,V,b);return Q([Y,q,m,X]),N&&(m=reshape$2(m,[m.shape[1],m.shape[2],m.shape[3]])),{value:m,gradFunc:B}})(e,k,O)}const conv2d$1=op({fusedConv2d_});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4680,7 +4680,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y=2&&T.rank>=2&&y.rank===T.rank,()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${y.rank} and ${T.rank}.`),assert$1(arraysEqual(N,M),()=>`Error in fused matMul: outer dimensions (${N}) and (${M}) of Tensors with shapes ${y.shape} and ${T.shape} must match.`),assert$1(I===S,()=>`Error in fused matMul: inner shapes (${I}) and (${S}) of Tensors with shapes ${y.shape} and ${T.shape} and transposeA=${s} and transposeB=${c} must match.`);const B=y.shape.slice(0,-2).concat([k,e]),V=s?reshape$2(y,[O,I,k]):reshape$2(y,[O,k,I]),b=c?reshape$2(T,[z,e,S]):reshape$2(T,[z,S,e]);let W;f!=null&&(W=convertToTensor(f,"bias","fused matMul"),[W]=makeTypesMatch(W,y),assertAndGetBroadcastShape(B,W.shape));let q;A!=null&&(q=convertToTensor(A,"prelu weights","fused matMul"));const Y=(m,Z)=>{const[ee,oe,fe,me]=Z,pe=getFusedDyActivation(reshape$2(m,fe.shape),fe,g);let Se,xe;if(!s&&!c?(Se=matMul$1(pe,oe,!1,!0),xe=matMul$1(ee,pe,!0,!1)):!s&&c?(Se=matMul$1(pe,oe,!1,!1),xe=matMul$1(pe,ee,!0,!1)):s&&!c?(Se=matMul$1(oe,pe,!1,!0),xe=matMul$1(ee,pe,!1,!1)):(Se=matMul$1(oe,pe,!0,!0),xe=matMul$1(pe,ee,!0,!0)),f!=null){const we=getFusedBiasGradient(me,pe);return[Se,xe,we]}else return[Se,xe]},X={a:V,b,bias:W,preluActivationWeights:q},Q={transposeA:s,transposeB:c,activation:g,leakyreluAlpha:v};return f==null?customGrad((Z,ee,oe)=>{const fe=ENGINE.runKernel(_FusedMatMul,X,Q);return oe([Z,ee,fe]),{value:reshape$2(fe,B),gradFunc:Y}})(V,b):customGrad((Z,ee,oe,fe)=>{const me=ENGINE.runKernel(_FusedMatMul,X,Q);return fe([Z,ee,me,oe]),{value:reshape$2(me,B),gradFunc:Y}})(V,b,W)}const matMul=op({fusedMatMul_});/** + */function fusedMatMul_({a:u,b:n,transposeA:s=!1,transposeB:c=!1,bias:f,activation:g="linear",preluActivationWeights:A,leakyreluAlpha:v}){if(shouldFuse(ENGINE.state.gradientDepth,g)===!1){let m=matMul$1(u,n,s,c);return f!=null&&(m=add$1(m,f)),applyActivation$1(m,g,A,v)}let y=convertToTensor(u,"a","fused matMul"),T=convertToTensor(n,"b","fused matMul");[y,T]=makeTypesMatch(y,T);const I=s?y.shape[y.rank-2]:y.shape[y.rank-1],S=c?T.shape[T.rank-1]:T.shape[T.rank-2],k=s?y.shape[y.rank-1]:y.shape[y.rank-2],e=c?T.shape[T.rank-2]:T.shape[T.rank-1],N=y.shape.slice(0,-2),M=T.shape.slice(0,-2),O=sizeFromShape(N),U=sizeFromShape(M);assert$1(y.rank>=2&&T.rank>=2&&y.rank===T.rank,()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${y.rank} and ${T.rank}.`),assert$1(arraysEqual(N,M),()=>`Error in fused matMul: outer dimensions (${N}) and (${M}) of Tensors with shapes ${y.shape} and ${T.shape} must match.`),assert$1(I===S,()=>`Error in fused matMul: inner shapes (${I}) and (${S}) of Tensors with shapes ${y.shape} and ${T.shape} and transposeA=${s} and transposeB=${c} must match.`);const B=y.shape.slice(0,-2).concat([k,e]),V=s?reshape$2(y,[O,I,k]):reshape$2(y,[O,k,I]),b=c?reshape$2(T,[U,e,S]):reshape$2(T,[U,S,e]);let W;f!=null&&(W=convertToTensor(f,"bias","fused matMul"),[W]=makeTypesMatch(W,y),assertAndGetBroadcastShape(B,W.shape));let q;A!=null&&(q=convertToTensor(A,"prelu weights","fused matMul"));const Y=(m,Z)=>{const[ee,oe,fe,me]=Z,pe=getFusedDyActivation(reshape$2(m,fe.shape),fe,g);let Se,xe;if(!s&&!c?(Se=matMul$1(pe,oe,!1,!0),xe=matMul$1(ee,pe,!0,!1)):!s&&c?(Se=matMul$1(pe,oe,!1,!1),xe=matMul$1(pe,ee,!0,!1)):s&&!c?(Se=matMul$1(oe,pe,!1,!0),xe=matMul$1(ee,pe,!1,!1)):(Se=matMul$1(oe,pe,!0,!0),xe=matMul$1(pe,ee,!0,!0)),f!=null){const we=getFusedBiasGradient(me,pe);return[Se,xe,we]}else return[Se,xe]},X={a:V,b,bias:W,preluActivationWeights:q},Q={transposeA:s,transposeB:c,activation:g,leakyreluAlpha:v};return f==null?customGrad((Z,ee,oe)=>{const fe=ENGINE.runKernel(_FusedMatMul,X,Q);return oe([Z,ee,fe]),{value:reshape$2(fe,B),gradFunc:Y}})(V,b):customGrad((Z,ee,oe,fe)=>{const me=ENGINE.runKernel(_FusedMatMul,X,Q);return fe([Z,ee,me,oe]),{value:reshape$2(me,B),gradFunc:Y}})(V,b,W)}const matMul=op({fusedMatMul_});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4800,7 +4800,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;yf&&T.push({score:n[O],boxIndex:O,suppressBeginIndex:0});T.sort(ascendingComparator);const I=g>0?-.5/g:0,S=[],k=[];for(;S.length0;){const O=T.pop(),{score:z,boxIndex:B,suppressBeginIndex:V}=O;if(z=V;--W){const q=intersectionOverUnion(u,B,S[W]);if(q>=c){b=!0;break}if(O.score=O.score*suppressWeight(c,I,q),O.score<=f)break}O.suppressBeginIndex=S.length,b||(O.score===z?(S.push(B),k.push(O.score)):O.score>f&&binaryInsert(T,O,ascendingComparator))}const e=S.length,N=s-e;v&&N>0&&(S.push(...new Array(N).fill(0)),k.push(...new Array(N).fill(0)));const M={selectedIndices:S};return A&&(M.selectedScores=k),y&&(M.validOutputs=e),M}function intersectionOverUnion(u,n,s){const c=u.subarray(n*4,n*4+4),f=u.subarray(s*4,s*4+4),g=Math.min(c[0],c[2]),A=Math.min(c[1],c[3]),v=Math.max(c[0],c[2]),y=Math.max(c[1],c[3]),T=Math.min(f[0],f[2]),I=Math.min(f[1],f[3]),S=Math.max(f[0],f[2]),k=Math.max(f[1],f[3]),e=(v-g)*(y-A),N=(S-T)*(k-I);if(e<=0||N<=0)return 0;const M=Math.max(g,T),O=Math.max(A,I),z=Math.min(v,S),B=Math.min(y,k),V=Math.max(z-M,0)*Math.max(B-O,0);return V/(e+N-V)}function suppressWeight(u,n,s){const c=Math.exp(n*s*s);return s<=u?c:0}function ascendingComparator(u,n){return u.score-n.score||u.score===n.score&&n.boxIndex-u.boxIndex}/** + */function nonMaxSuppressionV3Impl$2(u,n,s,c,f){return nonMaxSuppressionImpl_(u,n,s,c,f,0)}function nonMaxSuppressionV4Impl$2(u,n,s,c,f,g){return nonMaxSuppressionImpl_(u,n,s,c,f,0,!1,g,!0)}function nonMaxSuppressionV5Impl$2(u,n,s,c,f,g){return nonMaxSuppressionImpl_(u,n,s,c,f,g,!0)}function nonMaxSuppressionImpl_(u,n,s,c,f,g,A=!1,v=!1,y=!1){const T=[];for(let O=0;Of&&T.push({score:n[O],boxIndex:O,suppressBeginIndex:0});T.sort(ascendingComparator);const I=g>0?-.5/g:0,S=[],k=[];for(;S.length0;){const O=T.pop(),{score:U,boxIndex:B,suppressBeginIndex:V}=O;if(U=V;--W){const q=intersectionOverUnion(u,B,S[W]);if(q>=c){b=!0;break}if(O.score=O.score*suppressWeight(c,I,q),O.score<=f)break}O.suppressBeginIndex=S.length,b||(O.score===U?(S.push(B),k.push(O.score)):O.score>f&&binaryInsert(T,O,ascendingComparator))}const e=S.length,N=s-e;v&&N>0&&(S.push(...new Array(N).fill(0)),k.push(...new Array(N).fill(0)));const M={selectedIndices:S};return A&&(M.selectedScores=k),y&&(M.validOutputs=e),M}function intersectionOverUnion(u,n,s){const c=u.subarray(n*4,n*4+4),f=u.subarray(s*4,s*4+4),g=Math.min(c[0],c[2]),A=Math.min(c[1],c[3]),v=Math.max(c[0],c[2]),y=Math.max(c[1],c[3]),T=Math.min(f[0],f[2]),I=Math.min(f[1],f[3]),S=Math.max(f[0],f[2]),k=Math.max(f[1],f[3]),e=(v-g)*(y-A),N=(S-T)*(k-I);if(e<=0||N<=0)return 0;const M=Math.max(g,T),O=Math.max(A,I),U=Math.min(v,S),B=Math.min(y,k),V=Math.max(U-M,0)*Math.max(B-O,0);return V/(e+N-V)}function suppressWeight(u,n,s){const c=Math.exp(n*s*s);return s<=u?c:0}function ascendingComparator(u,n){return u.score-n.score||u.score===n.score&&n.boxIndex-u.boxIndex}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4920,7 +4920,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y`Error in threshold: image must be rank 3,but got rank ${f.rank}.`),assert$1(f.shape[2]===3||f.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${f.shape[2]}.`),assert$1(f.dtype==="int32"||f.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${f.dtype}.`),assert$1(n==="otsu"||n==="binary",()=>`Method must be binary or otsu, but was ${n}`),f.shape[2]===3){[I,S,k]=split$1(f,[1,1,1],-1);const O=mul(I,g),z=mul(S,A),B=mul(k,v);e=add$1(add$1(O,z),B)}else e=u;if(n==="otsu"){const O=bincount$2(cast$3(round$2(e),"int32"),tensor([]),256);T=otsu(O,y)}const N=s?lessEqual$2(e,T):greater$2(e,T);return cast$3(mul(N,255),"int32")}function otsu(u,n){let s=tensor1d([-1]),c=tensor1d([0]),f=tensor1d([0]),g,A,v,y,T,I;for(let S=0;S`Error in threshold: image must be rank 3,but got rank ${f.rank}.`),assert$1(f.shape[2]===3||f.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${f.shape[2]}.`),assert$1(f.dtype==="int32"||f.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${f.dtype}.`),assert$1(n==="otsu"||n==="binary",()=>`Method must be binary or otsu, but was ${n}`),f.shape[2]===3){[I,S,k]=split$1(f,[1,1,1],-1);const O=mul(I,g),U=mul(S,A),B=mul(k,v);e=add$1(add$1(O,U),B)}else e=u;if(n==="otsu"){const O=bincount$2(cast$3(round$2(e),"int32"),tensor([]),256);T=otsu(O,y)}const N=s?lessEqual$2(e,T):greater$2(e,T);return cast$3(mul(N,255),"int32")}function otsu(u,n){let s=tensor1d([-1]),c=tensor1d([0]),f=tensor1d([0]),g,A,v,y,T,I;for(let S=0;S=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${u.rank}`),u.rank===2)return qr2d(u,n);{const s=u.shape.slice(0,u.shape.length-2).reduce((y,T)=>y*T),c=unstack(reshape$2(u,[s,u.shape[u.shape.length-2],u.shape[u.shape.length-1]]),0),f=[],g=[];c.forEach(y=>{const[T,I]=qr2d(y,n);f.push(T),g.push(I)});const A=reshape$2(stack(f,0),u.shape),v=reshape$2(stack(g,0),u.shape);return[A,v]}}function qr2d(u,n=!1){return ENGINE.tidy(()=>{assert$1(u.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${u.shape.length}D Tensor.`);const s=u.shape[0],c=u.shape[1];let f=eye(s),g=clone(u);const A=tensor2d([[1]],[1,1]);let v=clone(A);const y=s>=c?c:s;for(let T=0;T{const e=slice$2(g,[T,T],[s-T,1]),N=norm(e),M=slice$2(g,[T,T],[1,1]),O=where(greater$2(M,0),tensor2d([[-1]]),tensor2d([[1]])),z=sub$2(M,mul(O,N)),B=div$1(e,z);B.shape[0]===1?v=clone(A):v=concat$2([A,slice$2(B,[1,0],[B.shape[0]-1,B.shape[1]])],0);const V=neg$2(div$1(matMul$1(O,z),N)),b=slice$2(g,[T,0],[s-T,c]),W=mul(V,v),q=transpose$2(v);if(T===0)g=sub$2(b,matMul$1(W,matMul$1(q,b)));else{const Q=sub$2(b,matMul$1(W,matMul$1(q,b)));g=concat$2([slice$2(g,[0,0],[T,c]),Q],0)}const Y=transpose$2(W),X=slice$2(f,[0,T],[s,f.shape[1]-T]);if(T===0)f=sub$2(X,matMul$1(matMul$1(X,v),Y));else{const Q=sub$2(X,matMul$1(matMul$1(X,v),Y));f=concat$2([slice$2(f,[0,0],[s,T]),Q],1)}return[v,g,f]}),dispose([I,S,k])}return!n&&s>c&&(f=slice$2(f,[0,0],[s,c]),g=slice$2(g,[0,0],[c,c])),[f,g]})}const qr=op({qr_});/** + */function qr_(u,n=!1){if(assert$1(u.rank>=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${u.rank}`),u.rank===2)return qr2d(u,n);{const s=u.shape.slice(0,u.shape.length-2).reduce((y,T)=>y*T),c=unstack(reshape$2(u,[s,u.shape[u.shape.length-2],u.shape[u.shape.length-1]]),0),f=[],g=[];c.forEach(y=>{const[T,I]=qr2d(y,n);f.push(T),g.push(I)});const A=reshape$2(stack(f,0),u.shape),v=reshape$2(stack(g,0),u.shape);return[A,v]}}function qr2d(u,n=!1){return ENGINE.tidy(()=>{assert$1(u.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${u.shape.length}D Tensor.`);const s=u.shape[0],c=u.shape[1];let f=eye(s),g=clone(u);const A=tensor2d([[1]],[1,1]);let v=clone(A);const y=s>=c?c:s;for(let T=0;T{const e=slice$2(g,[T,T],[s-T,1]),N=norm(e),M=slice$2(g,[T,T],[1,1]),O=where(greater$2(M,0),tensor2d([[-1]]),tensor2d([[1]])),U=sub$2(M,mul(O,N)),B=div$1(e,U);B.shape[0]===1?v=clone(A):v=concat$2([A,slice$2(B,[1,0],[B.shape[0]-1,B.shape[1]])],0);const V=neg$2(div$1(matMul$1(O,U),N)),b=slice$2(g,[T,0],[s-T,c]),W=mul(V,v),q=transpose$2(v);if(T===0)g=sub$2(b,matMul$1(W,matMul$1(q,b)));else{const Q=sub$2(b,matMul$1(W,matMul$1(q,b)));g=concat$2([slice$2(g,[0,0],[T,c]),Q],0)}const Y=transpose$2(W),X=slice$2(f,[0,T],[s,f.shape[1]-T]);if(T===0)f=sub$2(X,matMul$1(matMul$1(X,v),Y));else{const Q=sub$2(X,matMul$1(matMul$1(X,v),Y));f=concat$2([slice$2(f,[0,0],[s,T]),Q],1)}return[v,g,f]}),dispose([I,S,k])}return!n&&s>c&&(f=slice$2(f,[0,0],[s,c]),g=slice$2(g,[0,0],[c,c])),[f,g]})}const qr=op({qr_});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5941,7 +5941,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y{const[c,f]=n,{axis:g}=s,A=parseAxisParam(g,c.shape)[0];return{x:()=>{const y=c.shape,T=f.size,I=y.slice(0,A),S=I.length,k=y.slice(g,y.length).slice(1),e=k.length,N=arrayRange(0,S),M=arrayRange(S+1,S+1+e),O=arrayConcat([I,[T],k]),z=reshape$2(u,O),B=reshape$2(f,[T]),V=arrayConcat([[S],N,M]),b=transpose$2(z,V);let W=unsortedSegmentSum$2(b,B,c.shape[A]);const q=getUndoAxesPermutation(V);return W=transpose$2(W,q),W},indices:()=>f}}};function arrayRange(u,n){const s=[];for(let c=u;c{const[c,f]=n,{axis:g}=s,A=parseAxisParam(g,c.shape)[0];return{x:()=>{const y=c.shape,T=f.size,I=y.slice(0,A),S=I.length,k=y.slice(g,y.length).slice(1),e=k.length,N=arrayRange(0,S),M=arrayRange(S+1,S+1+e),O=arrayConcat([I,[T],k]),U=reshape$2(u,O),B=reshape$2(f,[T]),V=arrayConcat([[S],N,M]),b=transpose$2(U,V);let W=unsortedSegmentSum$2(b,B,c.shape[A]);const q=getUndoAxesPermutation(V);return W=transpose$2(W,q),W},indices:()=>f}}};function arrayRange(u,n){const s=[];for(let c=u;cN.name),y=[],T=n.names();for(const N of v)T.indexOf(N)!==-1?y.push(n.getValue(N)):y.push(null);c!=null&&(c.maxNumTensors=-1/0,c.minNumTensors=1/0);const I=v.join(",")+"|"+n.names().join(",");let S,k;if(cachedSorted[I]==null){const N=getTopologicalSortAndRecipientCounts(A,n);S=N.sorted,k=N.recipientCounts,cachedSorted[I]=S,cachedRecipientCounts[I]=k}S=cachedSorted[I],k={},f||Object.assign(k,cachedRecipientCounts[I]);const e=new FeedDict(n);for(let N=0;Nc.maxNumTensors&&(c.maxNumTensors=Q),Q0,()=>"Expected at least one fetch, got none");let s=[],c={};if(u.length===1){const f=getTopologicalSortAndRecipientCountsForOneFetch(u[0],n);s=f.sorted,c=f.recipientMap}else{const f=new Set;for(const g of u){const{sorted:A,recipientMap:v}=getTopologicalSortAndRecipientCountsForOneFetch(g,n);for(const y of A)f.has(y.name)||(s.push(y),f.add(y.name));for(const y in v)c[y]==null&&(c[y]=new Set),v[y].forEach(T=>c[y].add(T))}}return{sorted:s,recipientCounts:recipientMap2Counts(c)}}function recipientMap2Counts(u){const n={};for(const s in u)n[s]=u[s].size;return n}function getTopologicalSortAndRecipientCountsForOneFetch(u,n){const s=new Set,c=[],f={};for(const v of n.names())s.add(v);const g=[],A=[];for(g.push(u);g.length>0;){const v=g[g.length-1];if(s.has(v.name)){g.pop();continue}const y=A[A.length-1]===g.length-1;if(v.inputs.length===0||y)g.pop(),c.push(v),s.add(v.name),y&&A.pop();else{A.push(g.length-1);for(const T of v.inputs)f[T.name]==null&&(f[T.name]=new Set),f[T.name].add(v.name),!s.has(T.name)&&g.push(T)}}return{sorted:c,recipientMap:f}}function getNodeOutputs(u){let n;if(u.sourceLayer.inboundNodes.length===1)n=u.sourceLayer.output;else{let s=null;for(let c=0;cN.name),y=[],T=n.names();for(const N of v)T.indexOf(N)!==-1?y.push(n.getValue(N)):y.push(null);c!=null&&(c.maxNumTensors=-1/0,c.minNumTensors=1/0);const I=v.join(",")+"|"+n.names().join(",");let S,k;if(cachedSorted[I]==null){const N=getTopologicalSortAndRecipientCounts(A,n);S=N.sorted,k=N.recipientCounts,cachedSorted[I]=S,cachedRecipientCounts[I]=k}S=cachedSorted[I],k={},f||Object.assign(k,cachedRecipientCounts[I]);const e=new FeedDict(n);for(let N=0;Nc.maxNumTensors&&(c.maxNumTensors=Q),Q0,()=>"Expected at least one fetch, got none");let s=[],c={};if(u.length===1){const f=getTopologicalSortAndRecipientCountsForOneFetch(u[0],n);s=f.sorted,c=f.recipientMap}else{const f=new Set;for(const g of u){const{sorted:A,recipientMap:v}=getTopologicalSortAndRecipientCountsForOneFetch(g,n);for(const y of A)f.has(y.name)||(s.push(y),f.add(y.name));for(const y in v)c[y]==null&&(c[y]=new Set),v[y].forEach(T=>c[y].add(T))}}return{sorted:s,recipientCounts:recipientMap2Counts(c)}}function recipientMap2Counts(u){const n={};for(const s in u)n[s]=u[s].size;return n}function getTopologicalSortAndRecipientCountsForOneFetch(u,n){const s=new Set,c=[],f={};for(const v of n.names())s.add(v);const g=[],A=[];for(g.push(u);g.length>0;){const v=g[g.length-1];if(s.has(v.name)){g.pop();continue}const y=A[A.length-1]===g.length-1;if(v.inputs.length===0||y)g.pop(),c.push(v),s.add(v.name),y&&A.pop();else{A.push(g.length-1);for(const T of v.inputs)f[T.name]==null&&(f[T.name]=new Set),f[T.name].add(v.name),!s.has(T.name)&&g.push(T)}}return{sorted:c,recipientMap:f}}function getNodeOutputs(u){let n;if(u.sourceLayer.inboundNodes.length===1)n=u.sourceLayer.output;else{let s=null;for(let c=0;cB.name)}`);unique$2(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(B=>B.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const B of this.outputs){const V=B.sourceLayer,b=B.nodeIndex,W=B.tensorIndex;this.outputLayers.push(V),this.outputLayersNodeIndices.push(b),this.outputLayersTensorIndices.push(W)}for(const B of this.inputs){const V=B.sourceLayer,b=B.nodeIndex,W=B.tensorIndex;assert(b===0,"input layer has >1 nodes"),assert(W===0,"input layer has >1 tensors"),this.inputLayers.push(V),this.inputLayersNodeIndices.push(b),this.inputLayersTensorIndices.push(W)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let B=0;BB.shape),this.internalOutputShapes=this.outputs.map(B=>B.shape);const s={},c={},f={},g={},A={},v=[],y=(B,V,b,W,q,Y)=>{(W==null||q==null||Y==null)&&(W=B.sourceLayer,q=B.nodeIndex,Y=B.tensorIndex);const X=W.inboundNodes[q];if(b.indexOf(X)!==-1)throw new RuntimeError(`The tensor ${B.name} at layer "${W.name}" is part of a cycle.`);if(V.indexOf(X)!==-1)return;this.containerNodes.add(Container.nodeKey(W,q)),W.id in A||(A[W.id]=Object.keys(A).length),b.indexOf(X)===-1&&b.push(X);const Q=X.inboundLayers.length;for(let m=0;m=0;)b.splice(b.indexOf(X),1);v.push(X)},T=[],I=[];for(const B of this.outputs)y(B,T,I);const S=v.slice().reverse();for(const B of S){c[B.id]=B,B.id in s||(s[B.id]=0);let V=s[B.id];const b=f[B.outboundLayer.id]==null?0:f[B.outboundLayer.id];V=Math.max(V,b),f[B.outboundLayer.id]=V,g[B.outboundLayer.id]=B.outboundLayer,s[B.id]=V;for(let W=0;WparseInt(B,10)).sort(reverseNumberCompare);this.layers=[];for(const B of N){const V=e[B];V.sort((b,W)=>{const q=A[b.id],Y=A[W.id];return qY?1:0});for(const b of V)b instanceof Container&&this.internalContainerRefs.push(b),this.layers.push(b)}this.layersByDepth=e,N=Object.keys(k).map(B=>parseInt(B,10)).sort(reverseNumberCompare);const M=this.inputs.slice(),O=[];for(const B of N)for(const V of k[B]){const b=V.outboundLayer;if(b!=null){for(const W of V.inputTensors)if(M.indexOf(W)===-1)throw new RuntimeError(`Graph disconnected: cannot obtain value for tensor ${W} at layer "${b.name}". The following previous layers were accessed without issue: ${O}`);for(const W of V.outputTensors)M.push(W);O.push(b.name)}}this.nodesByDepth=k;const z=this.layers.map(B=>B.name);for(const B of z){const V=z.filter(b=>b===B).length;if(V!==1)throw new RuntimeError(`The name "${B}" is used ${V} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(z))}this.outboundNodes=[],this.inboundNodes=[],new Node({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(B=>null),outputMasks:this.outputs.map(B=>null),inputShapes:this.inputs.map(B=>B.shape),outputShapes:this.outputs.map(B=>B.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const n={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount===0){for(const s of this.layers)n.numDisposedVariables+=s.dispose().numDisposedVariables;for(const s of this.internalContainerRefs)n.numDisposedVariables+=s.dispose().numDisposedVariables}return n.refCountAfterDispose=this._refCount,n}get trainable(){return this.trainable_}set trainable(n){this.layers.forEach(s=>{s._trainableWeights.forEach(c=>c.trainable=n)}),this.trainable_=n}get trainableWeights(){if(this._trainableWeights.length>0)throw new ValueError("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let n=[];for(const s of this.layers)n=n.concat(s.trainableWeights);return n}get nonTrainableWeights(){const n=[];for(const s of this.layers)n.push(...s.nonTrainableWeights);if(!this.trainable){const s=[];for(const c of this.layers)s.push(...c.trainableWeights);return s.concat(n)}return n}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(n,s=!0){const c={};let f=0;for(const A of this.layers)for(const v of A.weights){if(c[v.originalName]!=null)throw new ValueError(`Duplicate weight name: ${v.originalName}`);c[v.originalName]=v,f++}const g=[];for(const A in n){let v=A;if(c[A]==null){const y=A.split("/");v=y.slice(0,-2).concat([y[y.length-1]]).join("/")}if(c[v]!=null)g.push([c[v],n[A]]);else if(s)throw new ValueError(`Provided weight data has no target variable: ${A}`);delete c[v]}if(s){const A=[];for(const v in c)A.push(v);if(A.length>0)throw new ValueError(`${A.length} of ${f} weights are not set: ${A}`)}batchSetValue(g)}updatedConfig(){const n=this.getConfig(),s={};return s.className=this.getClassName(),s.config=n,s.kerasVersion=`tfjs-layers ${version}`,s.backend="TensorFlow.js",s}toJSON(n,s=!0){const c=convertTsToPythonic(this.updatedConfig());return s?JSON.stringify(c):c}call(n,s){return tidy(()=>{n=toList(n);const c=new FeedDict;for(let f=0;f{n=toList(n);let c;return s==null?c=pyListRepeat(null,n.length):c=toList(s),this.runInternalGraph(n,c)[1]})}computeOutputShape(n){const s=normalizeShapeList(n);if(s.length!==this.inputLayers.length)throw new ValueError(`Invalid inputShape argument ${n}: model has ${this.inputLayers.length} tensor inputs.`);const c={};for(let v=0;vparseInt(v,10)).sort(reverseNumberCompare);if(f.length>1)for(const v of f){const y=this.nodesByDepth[v];for(const T of y){const I=T.outboundLayer;if(this.inputLayers.map(M=>M.id).indexOf(I.id)!==-1)continue;const S=[];for(let M=0;MparseInt(y,10)).sort(reverseNumberCompare);for(const y of f){const T=this.nodesByDepth[y];for(const I of T){const S=I.outboundLayer,k=I.inputTensors,e=I.outputTensors,N=new Array;for(const M of k)M.id in c&&N.push(c[M.id]);if(N.length===k.length){let M={},O,z,B,V;if(I.callArgs!=null&&(M=I.callArgs),N.length===1){const[b,W]=N[0];M.mask==null&&(M.mask=W),B=toList(S.call(b,M)),V=toList(S.computeMask(b,W)),O=[b],z=[W]}else O=N.map(b=>b[0]),z=N.map(b=>b[1]),M.mask==null&&(M.mask=z),B=toList(S.call(O,M)),V=toList(S.computeMask(O,z));if(S.activityRegularizer)throw new NotImplementedError("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let b=0;b{const n=[];for(const s of this.layers)for(let c=0;c0){const M=[];for(let O=0;O0&&O.apply(singletonOrArray(B),V)}function T(O){const z=O.name,B=deserialize(O,s.customObjects!=null?s.customObjects:{});B.setFastWeightInitDuringBuild(f),g[z]=B,O.inboundNodes.forEach(b=>{if(!(b instanceof Array))throw new ValueError(`Corrupted configuration, expected array for nodeData: ${b}`);v(B,b)})}const I=s.name,S=s.layers;for(const O of S)T(O);for(;!isObjectEmpty(A);)for(const O of S){const z=g[O.name];if(z.name in A){const B=A[z.name];delete A[z.name];for(const V of B)y(z,V)}}const k=[],e=[],N=s.inputLayers;for(const O of N){const z=O[0],B=O[1],V=O[2];assert(z in g);const W=g[z].inboundNodes[B].outputTensors;k.push(W[V])}const M=s.outputLayers;for(const O of M){const z=O[0],B=O[1],V=O[2];assert(z in g);const W=g[z].inboundNodes[B].outputTensors;e.push(W[V])}return new n({inputs:k,outputs:e,name:I})}get stateful(){if(this._stateful)throw new ValueError("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const n of this.layers)if(n.stateful)return!0;return!1}resetStates(){tidy(()=>{this.layers.forEach(n=>{n.stateful&&n.resetStates()})})}}/** + */class Container extends Layer{constructor(n){if(super({}),this.containerNodes=new Set,this.name=n.name,this.name==null){const B=this.getClassName().toLowerCase();this.name=getUid(B)}if(this.supportsMasking=!1,this.trainable_=!0,Array.isArray(n.inputs)?this.inputs=n.inputs.slice():this.inputs=[n.inputs],Array.isArray(n.outputs)?this.outputs=n.outputs.slice():this.outputs=[n.outputs],unique$2(this.inputs).length!==this.inputs.length)throw new ValueError(`The list of inputs passed to the model is redundant. All inputs should only appear once. Found: ${this.inputs.map(B=>B.name)}`);unique$2(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(B=>B.name)}`),this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const B of this.outputs){const V=B.sourceLayer,b=B.nodeIndex,W=B.tensorIndex;this.outputLayers.push(V),this.outputLayersNodeIndices.push(b),this.outputLayersTensorIndices.push(W)}for(const B of this.inputs){const V=B.sourceLayer,b=B.nodeIndex,W=B.tensorIndex;assert(b===0,"input layer has >1 nodes"),assert(W===0,"input layer has >1 tensors"),this.inputLayers.push(V),this.inputLayersNodeIndices.push(b),this.inputLayersTensorIndices.push(W)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let B=0;BB.shape),this.internalOutputShapes=this.outputs.map(B=>B.shape);const s={},c={},f={},g={},A={},v=[],y=(B,V,b,W,q,Y)=>{(W==null||q==null||Y==null)&&(W=B.sourceLayer,q=B.nodeIndex,Y=B.tensorIndex);const X=W.inboundNodes[q];if(b.indexOf(X)!==-1)throw new RuntimeError(`The tensor ${B.name} at layer "${W.name}" is part of a cycle.`);if(V.indexOf(X)!==-1)return;this.containerNodes.add(Container.nodeKey(W,q)),W.id in A||(A[W.id]=Object.keys(A).length),b.indexOf(X)===-1&&b.push(X);const Q=X.inboundLayers.length;for(let m=0;m=0;)b.splice(b.indexOf(X),1);v.push(X)},T=[],I=[];for(const B of this.outputs)y(B,T,I);const S=v.slice().reverse();for(const B of S){c[B.id]=B,B.id in s||(s[B.id]=0);let V=s[B.id];const b=f[B.outboundLayer.id]==null?0:f[B.outboundLayer.id];V=Math.max(V,b),f[B.outboundLayer.id]=V,g[B.outboundLayer.id]=B.outboundLayer,s[B.id]=V;for(let W=0;WparseInt(B,10)).sort(reverseNumberCompare);this.layers=[];for(const B of N){const V=e[B];V.sort((b,W)=>{const q=A[b.id],Y=A[W.id];return qY?1:0});for(const b of V)b instanceof Container&&this.internalContainerRefs.push(b),this.layers.push(b)}this.layersByDepth=e,N=Object.keys(k).map(B=>parseInt(B,10)).sort(reverseNumberCompare);const M=this.inputs.slice(),O=[];for(const B of N)for(const V of k[B]){const b=V.outboundLayer;if(b!=null){for(const W of V.inputTensors)if(M.indexOf(W)===-1)throw new RuntimeError(`Graph disconnected: cannot obtain value for tensor ${W} at layer "${b.name}". The following previous layers were accessed without issue: ${O}`);for(const W of V.outputTensors)M.push(W);O.push(b.name)}}this.nodesByDepth=k;const U=this.layers.map(B=>B.name);for(const B of U){const V=U.filter(b=>b===B).length;if(V!==1)throw new RuntimeError(`The name "${B}" is used ${V} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(U))}this.outboundNodes=[],this.inboundNodes=[],new Node({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map(B=>null),outputMasks:this.outputs.map(B=>null),inputShapes:this.inputs.map(B=>B.shape),outputShapes:this.outputs.map(B=>B.shape)}),this.built=!0,this._refCount=1}assertNotDisposed(){if(this._refCount===0)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const n={refCountAfterDispose:null,numDisposedVariables:0};if(--this._refCount===0){for(const s of this.layers)n.numDisposedVariables+=s.dispose().numDisposedVariables;for(const s of this.internalContainerRefs)n.numDisposedVariables+=s.dispose().numDisposedVariables}return n.refCountAfterDispose=this._refCount,n}get trainable(){return this.trainable_}set trainable(n){this.layers.forEach(s=>{s._trainableWeights.forEach(c=>c.trainable=n)}),this.trainable_=n}get trainableWeights(){if(this._trainableWeights.length>0)throw new ValueError("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let n=[];for(const s of this.layers)n=n.concat(s.trainableWeights);return n}get nonTrainableWeights(){const n=[];for(const s of this.layers)n.push(...s.nonTrainableWeights);if(!this.trainable){const s=[];for(const c of this.layers)s.push(...c.trainableWeights);return s.concat(n)}return n}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(n,s=!0){const c={};let f=0;for(const A of this.layers)for(const v of A.weights){if(c[v.originalName]!=null)throw new ValueError(`Duplicate weight name: ${v.originalName}`);c[v.originalName]=v,f++}const g=[];for(const A in n){let v=A;if(c[A]==null){const y=A.split("/");v=y.slice(0,-2).concat([y[y.length-1]]).join("/")}if(c[v]!=null)g.push([c[v],n[A]]);else if(s)throw new ValueError(`Provided weight data has no target variable: ${A}`);delete c[v]}if(s){const A=[];for(const v in c)A.push(v);if(A.length>0)throw new ValueError(`${A.length} of ${f} weights are not set: ${A}`)}batchSetValue(g)}updatedConfig(){const n=this.getConfig(),s={};return s.className=this.getClassName(),s.config=n,s.kerasVersion=`tfjs-layers ${version}`,s.backend="TensorFlow.js",s}toJSON(n,s=!0){const c=convertTsToPythonic(this.updatedConfig());return s?JSON.stringify(c):c}call(n,s){return tidy(()=>{n=toList(n);const c=new FeedDict;for(let f=0;f{n=toList(n);let c;return s==null?c=pyListRepeat(null,n.length):c=toList(s),this.runInternalGraph(n,c)[1]})}computeOutputShape(n){const s=normalizeShapeList(n);if(s.length!==this.inputLayers.length)throw new ValueError(`Invalid inputShape argument ${n}: model has ${this.inputLayers.length} tensor inputs.`);const c={};for(let v=0;vparseInt(v,10)).sort(reverseNumberCompare);if(f.length>1)for(const v of f){const y=this.nodesByDepth[v];for(const T of y){const I=T.outboundLayer;if(this.inputLayers.map(M=>M.id).indexOf(I.id)!==-1)continue;const S=[];for(let M=0;MparseInt(y,10)).sort(reverseNumberCompare);for(const y of f){const T=this.nodesByDepth[y];for(const I of T){const S=I.outboundLayer,k=I.inputTensors,e=I.outputTensors,N=new Array;for(const M of k)M.id in c&&N.push(c[M.id]);if(N.length===k.length){let M={},O,U,B,V;if(I.callArgs!=null&&(M=I.callArgs),N.length===1){const[b,W]=N[0];M.mask==null&&(M.mask=W),B=toList(S.call(b,M)),V=toList(S.computeMask(b,W)),O=[b],U=[W]}else O=N.map(b=>b[0]),U=N.map(b=>b[1]),M.mask==null&&(M.mask=U),B=toList(S.call(O,M)),V=toList(S.computeMask(O,U));if(S.activityRegularizer)throw new NotImplementedError("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let b=0;b{const n=[];for(const s of this.layers)for(let c=0;c0){const M=[];for(let O=0;O0&&O.apply(singletonOrArray(B),V)}function T(O){const U=O.name,B=deserialize(O,s.customObjects!=null?s.customObjects:{});B.setFastWeightInitDuringBuild(f),g[U]=B,O.inboundNodes.forEach(b=>{if(!(b instanceof Array))throw new ValueError(`Corrupted configuration, expected array for nodeData: ${b}`);v(B,b)})}const I=s.name,S=s.layers;for(const O of S)T(O);for(;!isObjectEmpty(A);)for(const O of S){const U=g[O.name];if(U.name in A){const B=A[U.name];delete A[U.name];for(const V of B)y(U,V)}}const k=[],e=[],N=s.inputLayers;for(const O of N){const U=O[0],B=O[1],V=O[2];assert(U in g);const W=g[U].inboundNodes[B].outputTensors;k.push(W[V])}const M=s.outputLayers;for(const O of M){const U=O[0],B=O[1],V=O[2];assert(U in g);const W=g[U].inboundNodes[B].outputTensors;e.push(W[V])}return new n({inputs:k,outputs:e,name:I})}get stateful(){if(this._stateful)throw new ValueError("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const n of this.layers)if(n.stateful)return!0;return!1}resetStates(){tidy(()=>{this.layers.forEach(n=>{n.stateful&&n.resetStates()})})}}/** * @license * Copyright 2018 Google LLC * @@ -9148,7 +9148,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${n}`);const g=flattenTensorOrArrayOrMap("input",u.inputNames,s),A=flattenTensorOrArrayOrMap("output",u.outputNames,c),v=g[0].shape[0];assert$1(g.length===u.inputs.length,()=>`LayersModel has ${u.inputs.length} inputs, but the dataset provides ${g.length} inputs. (Expected input keys: ${JSON.stringify(u.inputNames)})`),assert$1(A.length===u.outputs.length,()=>`LayersModel has ${u.outputs.length} outputs, but the dataset provides ${A.length} outputs. (Expected output keys: ${JSON.stringify(u.outputNames)})`);for(let y=0;y`Batch size mismatch: input ${u.inputNames[y]} has ${g[y].shape[0]}; expected ${v} based on input ${u.inputNames[0]}.`);for(let y=0;y`Batch size mismatch: output ${u.outputNames[y]} has ${A[y].shape[0]}; expected ${v} based on input ${u.inputNames[0]}.`);return{xs:g,ys:A}}function flattenTensorOrArrayOrMap(u,n,s){if(s instanceof Tensor)return[s];if(Array.isArray(s))return assert$1(s.length===n.length,()=>`Received an array of ${s.length} Tensors, but expected ${n.length} to match the ${u} keys ${n}.`),s;{const c=[];for(const f of n){if(s[f]==null)throw new ValueError(`The feature data generated by the dataset lacks the required ${u} key '${f}'.`);c.push(s[f])}return c}}function standardizeTensorValidationData(u){if(u.length===3)throw new NotImplementedError("Validation with sample weights is not implemented yet.");return{xs:u[0],ys:u[1]}}async function fitDataset(u,n,s){const c=s.batchesPerEpoch!=null;if(assert$1(u.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),assert$1(s!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),assert$1(s.epochs!=null&&s.epochs>0&&Number.isInteger(s.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${s.epochs}`),assert$1(!c||s.batchesPerEpoch>0&&Number.isInteger(s.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${s.batchesPerEpoch}`),assert$1(s.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),u.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");u.isTraining=!0;try{const f=s.validationData!=null;let g,A;if(f)if(isDatasetObject(s.validationData))assert$1(s.validationBatches==null||s.validationBatches>0&&Number.isInteger(s.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${s.validationBatches}`);else{const O=standardizeTensorValidationData(s.validationData);g=O.xs,A=O.ys}const v=u.makeTrainFunction(),y=u.getDedupedMetricsNames();let T;f?T=y.slice().concat(y.map(O=>"val_"+O)):T=y.slice();const I=standardizeCallbacks(s.callbacks,s.yieldEvery),S=s.verbose==null?1:s.verbose,{callbackList:k,history:e}=configureCallbacks(I,S,s.epochs,null,null,getStepsPerEpoch(n,s),null,f,T);k.setModel(u),u.history=e,await k.onTrainBegin(),u.stopTraining_=!1;let N=s.initialEpoch==null?0:s.initialEpoch,M=await n.iterator();for(;N=s.batchesPerEpoch:V.done){if(f){let b;isDatasetObject(s.validationData)?b=toList(await u.evaluateDataset(s.validationData,{batches:s.validationBatches})):b=toList(u.evaluate(g,A,{batchSize:s.validationBatchSize==null?DEFAULT_VALIDATION_BATCH_SIZE:s.validationBatchSize,verbose:0}));for(let W=0;W0)throw new NotImplementedError("Verbose mode is not implemented yet.");assert$1(!c||s.batches>0&&Number.isInteger(s.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(s.batches)}`);const A=isLazyIteratorObject(n)?n:await n.iterator();let v=0,y=0;for(;!c||y{if(T.value){const{xs:I,ys:S}=standardizeDataIteratorOutput(u,T.value),k=I.concat(S),e=tidy(()=>f(k));if(dispose(k),y===0)for(let M=0;Madd$1(g[M],mul(N,O))),y>0&&dispose(z)}dispose(e),v+=N,++y}return g}),T.done){c&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${s.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let T=0;T`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${n}`);const g=flattenTensorOrArrayOrMap("input",u.inputNames,s),A=flattenTensorOrArrayOrMap("output",u.outputNames,c),v=g[0].shape[0];assert$1(g.length===u.inputs.length,()=>`LayersModel has ${u.inputs.length} inputs, but the dataset provides ${g.length} inputs. (Expected input keys: ${JSON.stringify(u.inputNames)})`),assert$1(A.length===u.outputs.length,()=>`LayersModel has ${u.outputs.length} outputs, but the dataset provides ${A.length} outputs. (Expected output keys: ${JSON.stringify(u.outputNames)})`);for(let y=0;y`Batch size mismatch: input ${u.inputNames[y]} has ${g[y].shape[0]}; expected ${v} based on input ${u.inputNames[0]}.`);for(let y=0;y`Batch size mismatch: output ${u.outputNames[y]} has ${A[y].shape[0]}; expected ${v} based on input ${u.inputNames[0]}.`);return{xs:g,ys:A}}function flattenTensorOrArrayOrMap(u,n,s){if(s instanceof Tensor)return[s];if(Array.isArray(s))return assert$1(s.length===n.length,()=>`Received an array of ${s.length} Tensors, but expected ${n.length} to match the ${u} keys ${n}.`),s;{const c=[];for(const f of n){if(s[f]==null)throw new ValueError(`The feature data generated by the dataset lacks the required ${u} key '${f}'.`);c.push(s[f])}return c}}function standardizeTensorValidationData(u){if(u.length===3)throw new NotImplementedError("Validation with sample weights is not implemented yet.");return{xs:u[0],ys:u[1]}}async function fitDataset(u,n,s){const c=s.batchesPerEpoch!=null;if(assert$1(u.optimizer!=null,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),assert$1(s!=null,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),assert$1(s.epochs!=null&&s.epochs>0&&Number.isInteger(s.epochs),()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${s.epochs}`),assert$1(!c||s.batchesPerEpoch>0&&Number.isInteger(s.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${s.batchesPerEpoch}`),assert$1(s.validationSplit==null,()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."),u.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");u.isTraining=!0;try{const f=s.validationData!=null;let g,A;if(f)if(isDatasetObject(s.validationData))assert$1(s.validationBatches==null||s.validationBatches>0&&Number.isInteger(s.validationBatches),()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${s.validationBatches}`);else{const O=standardizeTensorValidationData(s.validationData);g=O.xs,A=O.ys}const v=u.makeTrainFunction(),y=u.getDedupedMetricsNames();let T;f?T=y.slice().concat(y.map(O=>"val_"+O)):T=y.slice();const I=standardizeCallbacks(s.callbacks,s.yieldEvery),S=s.verbose==null?1:s.verbose,{callbackList:k,history:e}=configureCallbacks(I,S,s.epochs,null,null,getStepsPerEpoch(n,s),null,f,T);k.setModel(u),u.history=e,await k.onTrainBegin(),u.stopTraining_=!1;let N=s.initialEpoch==null?0:s.initialEpoch,M=await n.iterator();for(;N=s.batchesPerEpoch:V.done){if(f){let b;isDatasetObject(s.validationData)?b=toList(await u.evaluateDataset(s.validationData,{batches:s.validationBatches})):b=toList(u.evaluate(g,A,{batchSize:s.validationBatchSize==null?DEFAULT_VALIDATION_BATCH_SIZE:s.validationBatchSize,verbose:0}));for(let W=0;W0)throw new NotImplementedError("Verbose mode is not implemented yet.");assert$1(!c||s.batches>0&&Number.isInteger(s.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(s.batches)}`);const A=isLazyIteratorObject(n)?n:await n.iterator();let v=0,y=0;for(;!c||y{if(T.value){const{xs:I,ys:S}=standardizeDataIteratorOutput(u,T.value),k=I.concat(S),e=tidy(()=>f(k));if(dispose(k),y===0)for(let M=0;Madd$1(g[M],mul(N,O))),y>0&&dispose(U)}dispose(e),v+=N,++y}return g}),T.done){c&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${s.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let T=0;T0&&Number.isInteger(u),()=>`batchSize is required to be a positive integer, but got ${u}`)}function sliceArrays(u,n,s){return u==null?[null]:Array.isArray(u)?u.map(c=>sliceAlongFirstAxis(c,n,s-n)):sliceAlongFirstAxis(u,n,s-n)}function sliceArraysByIndices(u,n){return tidy(()=>u==null?null:Array.isArray(u)?u.map(s=>sliceArraysByIndices(s,n)):gather(u,n.dtype==="int32"?n:cast$3(n,"int32")))}function makeBatches(u,n){const s=[];let c=0,f=null;for(;c=u&&(f=u),s.push([c,f]),c=f;return s}async function fitLoop(u,n,s,c,f,g,A,v,y,T,I,S,k,e,N){f==null&&(f=32),g==null&&(g=1),I==null&&(I=!0),k==null&&(k=0);let M=!1;if(y!=null&&T!=null&&(M=!0),N!=null&&(M=!0,e==null))throw new ValueError("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const O=u.checkNumSamples(s,f,e,"steps_per_epoch");let z;O!=null&&(z=range$2(0,O)),A==null&&(A=1);const{callbackList:B,history:V}=configureCallbacks(v,A,g,k,O,e,f,M,S);B.setModel(u),u.history=V,await B.onTrainBegin(),u.stopTraining_=!1;for(let b=k;b{const m=Y[X][0],Z=Y[X][1],ee=sliceAlongFirstAxis(q,m,Z-m);Q.batch=X,Q.size=Z-m;const oe=sliceArraysByIndices(s,ee),fe=n(oe);for(let me=0;me0){if(N=!0,c.validationData.length===2)A=c.validationData[0],v=c.validationData[1];else throw c.validationData.length===3?new NotImplementedError("validationData including sample weights is not supported yet."):new ValueError(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${c.validationData} is invalid.`);const X=await u.standardizeUserData(A,v,null,null,!0,S);y=X[0],T=X[1],M=y.concat(T)}else if(c.validationSplit!=null&&c.validationSplit>0&&c.validationSplit<1){N=!0;const Y=Math.floor(f[0].shape[0]*(1-c.validationSplit)),X=f[0].shape[0];y=sliceArrays(f,Y,X),f=sliceArrays(f,0,Y),T=sliceArrays(g,Y,X),g=sliceArrays(g,0,Y),M=y.concat(T)}else c.validationSteps!=null&&(N=!0);const O=f.concat(g).concat(I);u.checkTrainableWeightsConsistency();const z=u.makeTrainFunction(),B=u.getDedupedMetricsNames();let V,b;N?(u.makeTestFunction(),V=u.testFunction,b=B.slice().concat(B.map(Y=>"val_"+Y))):(V=null,M=[],b=B.slice());const W=standardizeCallbacks(c.callbacks,c.yieldEvery);return await fitLoop(u,z,O,B,S,c.epochs,c.verbose,W,V,M,c.shuffle,b,c.initialEpoch,null,null)}finally{u.isTraining=!1,disposeNewTensors(f,n),disposeNewTensors(g,s),disposeNewTensors(y,A),disposeNewTensors(T,v),I!=null&&dispose(I)}}function ensureTensorsRank2OrHigher(u){const n=[];u instanceof Tensor&&(u=[u]);for(let s=0;ss.push(f.id));else if(n!=null)for(const f in n){const g=n[f];s.push(g.id)}const c=[];if(u instanceof Tensor)s.indexOf(u.id)===-1&&c.push(u);else if(Array.isArray(u))u.forEach(f=>{s.indexOf(f.id)===-1&&c.push(f)});else if(u!=null)for(const f in u){const g=u[f];s.indexOf(g.id)===-1&&c.push(g)}c.forEach(f=>{f.isDisposed||f.dispose()})}/** + */function checkBatchSize(u){assert$1(u>0&&Number.isInteger(u),()=>`batchSize is required to be a positive integer, but got ${u}`)}function sliceArrays(u,n,s){return u==null?[null]:Array.isArray(u)?u.map(c=>sliceAlongFirstAxis(c,n,s-n)):sliceAlongFirstAxis(u,n,s-n)}function sliceArraysByIndices(u,n){return tidy(()=>u==null?null:Array.isArray(u)?u.map(s=>sliceArraysByIndices(s,n)):gather(u,n.dtype==="int32"?n:cast$3(n,"int32")))}function makeBatches(u,n){const s=[];let c=0,f=null;for(;c=u&&(f=u),s.push([c,f]),c=f;return s}async function fitLoop(u,n,s,c,f,g,A,v,y,T,I,S,k,e,N){f==null&&(f=32),g==null&&(g=1),I==null&&(I=!0),k==null&&(k=0);let M=!1;if(y!=null&&T!=null&&(M=!0),N!=null&&(M=!0,e==null))throw new ValueError("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const O=u.checkNumSamples(s,f,e,"steps_per_epoch");let U;O!=null&&(U=range$2(0,O)),A==null&&(A=1);const{callbackList:B,history:V}=configureCallbacks(v,A,g,k,O,e,f,M,S);B.setModel(u),u.history=V,await B.onTrainBegin(),u.stopTraining_=!1;for(let b=k;b{const m=Y[X][0],Z=Y[X][1],ee=sliceAlongFirstAxis(q,m,Z-m);Q.batch=X,Q.size=Z-m;const oe=sliceArraysByIndices(s,ee),fe=n(oe);for(let me=0;me0){if(N=!0,c.validationData.length===2)A=c.validationData[0],v=c.validationData[1];else throw c.validationData.length===3?new NotImplementedError("validationData including sample weights is not supported yet."):new ValueError(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${c.validationData} is invalid.`);const X=await u.standardizeUserData(A,v,null,null,!0,S);y=X[0],T=X[1],M=y.concat(T)}else if(c.validationSplit!=null&&c.validationSplit>0&&c.validationSplit<1){N=!0;const Y=Math.floor(f[0].shape[0]*(1-c.validationSplit)),X=f[0].shape[0];y=sliceArrays(f,Y,X),f=sliceArrays(f,0,Y),T=sliceArrays(g,Y,X),g=sliceArrays(g,0,Y),M=y.concat(T)}else c.validationSteps!=null&&(N=!0);const O=f.concat(g).concat(I);u.checkTrainableWeightsConsistency();const U=u.makeTrainFunction(),B=u.getDedupedMetricsNames();let V,b;N?(u.makeTestFunction(),V=u.testFunction,b=B.slice().concat(B.map(Y=>"val_"+Y))):(V=null,M=[],b=B.slice());const W=standardizeCallbacks(c.callbacks,c.yieldEvery);return await fitLoop(u,U,O,B,S,c.epochs,c.verbose,W,V,M,c.shuffle,b,c.initialEpoch,null,null)}finally{u.isTraining=!1,disposeNewTensors(f,n),disposeNewTensors(g,s),disposeNewTensors(y,A),disposeNewTensors(T,v),I!=null&&dispose(I)}}function ensureTensorsRank2OrHigher(u){const n=[];u instanceof Tensor&&(u=[u]);for(let s=0;ss.push(f.id));else if(n!=null)for(const f in n){const g=n[f];s.push(g.id)}const c=[];if(u instanceof Tensor)s.indexOf(u.id)===-1&&c.push(u);else if(Array.isArray(u))u.forEach(f=>{s.indexOf(f.id)===-1&&c.push(f)});else if(u!=null)for(const f in u){const g=u[f];s.indexOf(g.id)===-1&&c.push(g)}c.forEach(f=>{f.isDisposed||f.dispose()})}/** * @license * Copyright 2018 Google LLC * @@ -9164,7 +9164,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y0)A=!0;else if(isDataDict(u)){for(const v in u)if(u.hasOwnProperty(v)){A=!0;break}}else A=!0;if(A)throw new ValueError(`Error when checking model ${f} expected no data, but got ${u}`)}return[]}if(u==null)return n.map(A=>null);let g;if(isDataDict(u)){u=u,g=[];for(const A of n){if(u[A]==null)throw new ValueError(`No data provided for "${A}". Need data for each key in: ${n}`);g.push(u[A])}}else if(isDataArray(u)){if(u=u,u.length!==n.length)throw new ValueError(`Error when checking model ${f}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${n.length} Tensor(s), but instead got the following list of Tensor(s): ${u}`);g=u}else{if(u=u,n.length>1)throw new ValueError(`The model ${f} expects ${n.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${u.shape}`);g=[u]}if(g=ensureTensorsRank2OrHigher(g),s!=null)for(let A=0;A=0&&T!==I)throw new ValueError(`${f} expected a batch of elements where each example has shape [${s[A].slice(1,s[A].length)}] (i.e.,tensor shape [*,${s[A].slice(1,s[A].length)}]) but the ${f} received an input with ${v.shape[0]} examples, each with shape [${v.shape.slice(1,v.shape.length)}] (tensor shape [${v.shape}])`)}}return g}function checkArrayLengths(u,n,s){const c=unique$2(u.map(g=>g.shape[0]));c.sort();const f=unique$2(n.map(g=>g.shape[0]));if(f.sort(),c.length>1)throw new ValueError(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(u.map(g=>g.shape))}`);if(f.length>1)throw new ValueError(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(n.map(g=>g.shape))}`);if(c.length>0&&f.length>0&&!arraysEqual(c,f))throw new ValueError(`Input Tensors should have the same number of samples as target Tensors. Found ${c[0]} input sample(s) and ${f[0]} target sample(s).`)}function checkLossAndTargetCompatibility(u,n,s){const c=[meanSquaredError,binaryCrossentropy$1,categoricalCrossentropy$1];for(let f=0;f1)throw new ValueError(`The model expects ${n.length} ${f} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(u.shape)}.`);g=[u]}if(s!=null)for(let A=0;A[]);let s;if(typeof u=="string"||typeof u=="function")s=[u];else if(Array.isArray(u)||typeof u=="object")s=u;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${u}`);if(Array.isArray(s))return n.map(c=>s);{const c=[];for(const f of n){let g=s.hasOwnProperty(f)?s[f]:[];Array.isArray(g)||(g=[g]),c.push(g)}return c}}const LAYERS_MODEL_FORMAT_NAME="layers-model";class LayersModel extends Container{constructor(n){super(n),this.isTraining=!1}summary(n,s,c=console.log){if(!this.built)throw new ValueError("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");printSummary(this,n,s,c)}compile(n){if(n.loss==null&&(n.loss=[]),this.loss=n.loss,typeof n.optimizer=="string")this.optimizer_=getOptimizer(n.optimizer),this.isOptimizerOwned=!0;else{if(!(n.optimizer instanceof Optimizer))throw new ValueError("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=n.optimizer,this.isOptimizerOwned=!1}let s=[];if(!Array.isArray(n.loss)&&typeof n.loss!="string"&&typeof n.loss!="function"){n.loss=n.loss;for(const A in n.loss)if(this.outputNames.indexOf(A)===-1)throw new ValueError(`Unknown entry in loss dictionary: "${A}". Only expected the following keys: ${this.outputNames}`);for(const A of this.outputNames)n.loss[A]==null&&console.warn(`Output "${A}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${A} during training`),s.push(get$1(n.loss[A]))}else if(Array.isArray(n.loss)){if(n.loss.length!==this.outputs.length)throw new ValueError(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${n.loss}.`);s=n.loss.map(v=>get$1(v))}else{const A=get$1(n.loss);this.outputs.forEach(v=>{s.push(A)})}this.lossFunctions=s,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let A=0;A{for(let A=0;A1&&(this.metricsTensors.push([v,A]),this.metricsNames.push(this.outputNames[A]+"_loss"))}});const f=collectMetrics(n.metrics,this.outputNames),g=(A,v,y)=>{this.outputNames.length>1&&(v=this.outputNames[A]+"_"+v),this.metricsNames.push(v),this.metricsTensors.push([y,A])};nameScope("metric",()=>{for(let A=0;A{const I="";let S,k,e;for(const N of T){if(typeof N=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(N)!==-1){const O=this.internalOutputShapes[A];O[O.length-1]===1||this.lossFunctions[A]===binaryCrossentropy$1?["accuracy","acc"].indexOf(N)!==-1?k=binaryAccuracy:["crossentropy","ce"].indexOf(N)!==-1&&(k=binaryCrossentropy):this.lossFunctions[A]===sparseCategoricalCrossentropy$1?["accuracy","acc"].indexOf(N)!==-1?k=sparseCategoricalAccuracy:["crossentropy","ce"].indexOf(N)!==-1&&(k=sparseCategoricalCrossentropy):["accuracy","acc"].indexOf(N)!==-1?k=categoricalAccuracy:["crossentropy","ce"].indexOf(N)!==-1&&(k=categoricalCrossentropy);let z;["accuracy","acc"].indexOf(N)!==-1?z="acc":["crossentropy","ce"].indexOf(N)!==-1&&(z="ce"),e=k,S=I+z}else e=get(N),S=I+getLossOrMetricName(N);let M;nameScope(S,()=>{M=e}),g(A,S,M)}})(v)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(n,s,c={}){const f=c.batchSize==null?32:c.batchSize;checkBatchSize(f);const A=this.standardizeUserDataXY(n,s,!0,f);try{const v=A[0].concat(A[1]);this.makeTestFunction();const y=this.testFunction,T=this.testLoop(y,v,f,c.verbose,c.steps);return singletonOrArray(T)}finally{disposeNewTensors(A[0],n),disposeNewTensors(A[1],s)}}async evaluateDataset(n,s){return this.makeTestFunction(),evaluateDataset(this,n,s)}checkNumSamples(n,s,c,f="steps"){let g;if(c!=null){if(g=null,s!=null)throw new ValueError(`If ${f} is set, batchSize must be null or undefined.Got batchSize = ${s}`)}else if(n!=null)Array.isArray(n)?g=n[0].shape[0]:g=n.shape[0];else throw new ValueError(`Either the input data should have a defined shape, or ${f} shoud be specified.`);return g}execute(n,s){if(Array.isArray(s)&&s.length===0)throw new ValueError("`outputs` is an empty Array, which is not allowed.");const c=Array.isArray(s),f=c?s:[s],g=this.retrieveSymbolicTensors(f),A=new FeedDict;if(n instanceof Tensor&&(n=[n]),Array.isArray(n)){if(n.length!==this.inputs.length)throw new ValueError(`The number of inputs provided (${n.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let y=0;yv.name);for(let v=0;v0){const f=[];throw s.forEach((g,A)=>{g==null&&f.push(n[A])}),new ValueError(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(f)}`)}return s}predictLoop(n,s=32,c=!1){return tidy(()=>{const f=this.checkNumSamples(n);if(c)throw new NotImplementedError("Verbose predictLoop() is not implemented yet.");const g=makeBatches(f,s),A=this.outputs.map(v=>[]);for(let v=0;v{const T=g[v][0],I=g[v][1],S=sliceArrays(n,T,I),k=[];if(Array.isArray(S))for(let N=0;NA[I].push(T));return singletonOrArray(A.map(v=>concat$2(v,0)))})}predict(n,s={}){const c=ensureTensorsRank2OrHigher(n);checkInputData(c,this.inputNames,this.feedInputShapes,!1);try{const f=s.batchSize==null?32:s.batchSize;return checkBatchSize(f),this.predictLoop(c,f)}finally{disposeNewTensors(c,n)}}predictOnBatch(n){checkInputData(n,this.inputNames,this.feedInputShapes,!0);const s=(Array.isArray(n)?n[0]:n).shape[0];return this.predictLoop(n,s)}standardizeUserDataXY(n,s,c=!0,f){if(this.optimizer_==null)throw new RuntimeError("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const g=[];for(let A=0;A0&&n[0].shape[0]%f!==0)throw new ValueError(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${f}. Found: ${n[0].shape[0]} sample(s).`);return[n,s]}async standardizeUserData(n,s,c,f,g=!0,A){const[v,y]=this.standardizeUserDataXY(n,s,g,A);if(c!=null)throw new Error("sample weight is not supported yet.");let T=null;if(f!=null){const I=standardizeClassWeights(f,this.outputNames);T=[];for(let S=0;S{const A=this.checkNumSamples(s,c,g,"steps"),v=[];if(f>0)throw new NotImplementedError("Verbose mode is not implemented yet.");if(g!=null)throw new NotImplementedError("steps mode in testLoop() is not implemented yet");{const y=makeBatches(A,c),T=tensor1d(range$2(0,A));for(let I=0;I1){const A=count(n.slice(0,c),f);g+=`_${A}`}s.push(g)}return s}makeTrainFunction(){return n=>{const s=[],c=n.slice(0,this.inputs.length),f=n.slice(this.inputs.length,this.inputs.length+this.outputs.length),g=n.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),A=[],v=()=>{const S=[];for(let M=0;M1&&M{N=add$1(N,M)}),N},y=this.collectedTrainableWeights.map(S=>S.read());return[this.optimizer_.minimize(v,!0,y)].concat(A)}}makeTestFunction(){this.testFunction=n=>tidy(()=>{const s=[];let c;const f=n.slice(0,this.inputs.length),g=n.slice(this.inputs.length,this.inputs.length+this.outputs.length),A=[];for(let T=0;TtoSnakeCase(s))}else{const s=Object.keys(this.loss);n={};const c=this.loss;for(const f of s)if(typeof c[f]=="string")n[f]=toSnakeCase(c[f]);else throw new Error("Serialization of non-string loss is not supported.")}return n}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[toSnakeCase(getLossOrMetricName(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(n=>toSnakeCase(getLossOrMetricName(n)));{const n={};for(const s in this.metrics)n[s]=toSnakeCase(getLossOrMetricName(this.metrics[s]));return n}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(n){if(n.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(n.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(n.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");const s=convertPythonicToTs(n.optimizer_config),c=deserialize(s);let f;if(typeof n.loss=="string")f=toCamelCase(n.loss);else if(Array.isArray(n.loss))f=n.loss.map(A=>toCamelCase(A));else if(n.loss!=null){f={};for(const A in n.loss)f[A]=toCamelCase(n.loss[A])}let g;if(Array.isArray(n.metrics))g=n.metrics.map(A=>toCamelCase(A));else if(n.metrics!=null){g={};for(const A in n.metrics)g[A]=toCamelCase(n.metrics[A])}this.compile({loss:f,metrics:g,optimizer:c})}async save(n,s){if(typeof n=="string"){const T=getSaveHandlers(n);if(T.length===0)throw new ValueError(`Cannot find any save handlers for URL '${n}'`);if(T.length>1)throw new ValueError(`Found more than one (${T.length}) save handlers for URL '${n}'`);n=T[0]}if(n.save==null)throw new ValueError("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const c=await encodeWeights(this.getNamedWeights(s)),v={modelTopology:this.toJSON(null,!1),format:LAYERS_MODEL_FORMAT_NAME,generatedBy:`TensorFlow.js tfjs-layers v${version}`,convertedBy:null};if((s==null?!1:s.includeOptimizer)&&this.optimizer!=null){v.trainingConfig=this.getTrainingConfig();const T="optimizer",{data:I,specs:S}=await encodeWeights(await this.optimizer.getWeights(),T);c.specs.push(...S),c.data=concatenateArrayBuffers([c.data,I])}return this.userDefinedMetadata!=null&&(checkUserDefinedMetadata(this.userDefinedMetadata,this.name,!0),v.userDefinedMetadata=this.userDefinedMetadata),v.weightData=c.data,v.weightSpecs=c.specs,n.save(v)}setUserDefinedMetadata(n){checkUserDefinedMetadata(n,this.name),this.userDefinedMetadata=n}getUserDefinedMetadata(){return this.userDefinedMetadata}}LayersModel.className="Model";registerClass(LayersModel);class Functional extends LayersModel{}Functional.className="Functional";registerClass(Functional);/** + */function isDataTensor(u){return u instanceof Tensor}function isDataArray(u){return Array.isArray(u)}function isDataDict(u){return!isDataTensor(u)&&!isDataArray(u)}function standardizeInputData(u,n,s,c=!0,f=""){if(n==null||n.length===0){if(u!=null){let A=!1;if(isDataArray(u)&&u.length>0)A=!0;else if(isDataDict(u)){for(const v in u)if(u.hasOwnProperty(v)){A=!0;break}}else A=!0;if(A)throw new ValueError(`Error when checking model ${f} expected no data, but got ${u}`)}return[]}if(u==null)return n.map(A=>null);let g;if(isDataDict(u)){u=u,g=[];for(const A of n){if(u[A]==null)throw new ValueError(`No data provided for "${A}". Need data for each key in: ${n}`);g.push(u[A])}}else if(isDataArray(u)){if(u=u,u.length!==n.length)throw new ValueError(`Error when checking model ${f}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${n.length} Tensor(s), but instead got the following list of Tensor(s): ${u}`);g=u}else{if(u=u,n.length>1)throw new ValueError(`The model ${f} expects ${n.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${u.shape}`);g=[u]}if(g=ensureTensorsRank2OrHigher(g),s!=null)for(let A=0;A=0&&T!==I)throw new ValueError(`${f} expected a batch of elements where each example has shape [${s[A].slice(1,s[A].length)}] (i.e.,tensor shape [*,${s[A].slice(1,s[A].length)}]) but the ${f} received an input with ${v.shape[0]} examples, each with shape [${v.shape.slice(1,v.shape.length)}] (tensor shape [${v.shape}])`)}}return g}function checkArrayLengths(u,n,s){const c=unique$2(u.map(g=>g.shape[0]));c.sort();const f=unique$2(n.map(g=>g.shape[0]));if(f.sort(),c.length>1)throw new ValueError(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(u.map(g=>g.shape))}`);if(f.length>1)throw new ValueError(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(n.map(g=>g.shape))}`);if(c.length>0&&f.length>0&&!arraysEqual(c,f))throw new ValueError(`Input Tensors should have the same number of samples as target Tensors. Found ${c[0]} input sample(s) and ${f[0]} target sample(s).`)}function checkLossAndTargetCompatibility(u,n,s){const c=[meanSquaredError,binaryCrossentropy$1,categoricalCrossentropy$1];for(let f=0;f1)throw new ValueError(`The model expects ${n.length} ${f} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(u.shape)}.`);g=[u]}if(s!=null)for(let A=0;A[]);let s;if(typeof u=="string"||typeof u=="function")s=[u];else if(Array.isArray(u)||typeof u=="object")s=u;else throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${u}`);if(Array.isArray(s))return n.map(c=>s);{const c=[];for(const f of n){let g=s.hasOwnProperty(f)?s[f]:[];Array.isArray(g)||(g=[g]),c.push(g)}return c}}const LAYERS_MODEL_FORMAT_NAME="layers-model";class LayersModel extends Container{constructor(n){super(n),this.isTraining=!1}summary(n,s,c=console.log){if(!this.built)throw new ValueError("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");printSummary(this,n,s,c)}compile(n){if(n.loss==null&&(n.loss=[]),this.loss=n.loss,typeof n.optimizer=="string")this.optimizer_=getOptimizer(n.optimizer),this.isOptimizerOwned=!0;else{if(!(n.optimizer instanceof Optimizer))throw new ValueError("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=n.optimizer,this.isOptimizerOwned=!1}let s=[];if(!Array.isArray(n.loss)&&typeof n.loss!="string"&&typeof n.loss!="function"){n.loss=n.loss;for(const A in n.loss)if(this.outputNames.indexOf(A)===-1)throw new ValueError(`Unknown entry in loss dictionary: "${A}". Only expected the following keys: ${this.outputNames}`);for(const A of this.outputNames)n.loss[A]==null&&console.warn(`Output "${A}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${A} during training`),s.push(get$1(n.loss[A]))}else if(Array.isArray(n.loss)){if(n.loss.length!==this.outputs.length)throw new ValueError(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${n.loss}.`);s=n.loss.map(v=>get$1(v))}else{const A=get$1(n.loss);this.outputs.forEach(v=>{s.push(A)})}this.lossFunctions=s,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let A=0;A{for(let A=0;A1&&(this.metricsTensors.push([v,A]),this.metricsNames.push(this.outputNames[A]+"_loss"))}});const f=collectMetrics(n.metrics,this.outputNames),g=(A,v,y)=>{this.outputNames.length>1&&(v=this.outputNames[A]+"_"+v),this.metricsNames.push(v),this.metricsTensors.push([y,A])};nameScope("metric",()=>{for(let A=0;A{const I="";let S,k,e;for(const N of T){if(typeof N=="string"&&["accuracy","acc","crossentropy","ce"].indexOf(N)!==-1){const O=this.internalOutputShapes[A];O[O.length-1]===1||this.lossFunctions[A]===binaryCrossentropy$1?["accuracy","acc"].indexOf(N)!==-1?k=binaryAccuracy:["crossentropy","ce"].indexOf(N)!==-1&&(k=binaryCrossentropy):this.lossFunctions[A]===sparseCategoricalCrossentropy$1?["accuracy","acc"].indexOf(N)!==-1?k=sparseCategoricalAccuracy:["crossentropy","ce"].indexOf(N)!==-1&&(k=sparseCategoricalCrossentropy):["accuracy","acc"].indexOf(N)!==-1?k=categoricalAccuracy:["crossentropy","ce"].indexOf(N)!==-1&&(k=categoricalCrossentropy);let U;["accuracy","acc"].indexOf(N)!==-1?U="acc":["crossentropy","ce"].indexOf(N)!==-1&&(U="ce"),e=k,S=I+U}else e=get(N),S=I+getLossOrMetricName(N);let M;nameScope(S,()=>{M=e}),g(A,S,M)}})(v)}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){this.collectedTrainableWeights!=null&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(n,s,c={}){const f=c.batchSize==null?32:c.batchSize;checkBatchSize(f);const A=this.standardizeUserDataXY(n,s,!0,f);try{const v=A[0].concat(A[1]);this.makeTestFunction();const y=this.testFunction,T=this.testLoop(y,v,f,c.verbose,c.steps);return singletonOrArray(T)}finally{disposeNewTensors(A[0],n),disposeNewTensors(A[1],s)}}async evaluateDataset(n,s){return this.makeTestFunction(),evaluateDataset(this,n,s)}checkNumSamples(n,s,c,f="steps"){let g;if(c!=null){if(g=null,s!=null)throw new ValueError(`If ${f} is set, batchSize must be null or undefined.Got batchSize = ${s}`)}else if(n!=null)Array.isArray(n)?g=n[0].shape[0]:g=n.shape[0];else throw new ValueError(`Either the input data should have a defined shape, or ${f} shoud be specified.`);return g}execute(n,s){if(Array.isArray(s)&&s.length===0)throw new ValueError("`outputs` is an empty Array, which is not allowed.");const c=Array.isArray(s),f=c?s:[s],g=this.retrieveSymbolicTensors(f),A=new FeedDict;if(n instanceof Tensor&&(n=[n]),Array.isArray(n)){if(n.length!==this.inputs.length)throw new ValueError(`The number of inputs provided (${n.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let y=0;yv.name);for(let v=0;v0){const f=[];throw s.forEach((g,A)=>{g==null&&f.push(n[A])}),new ValueError(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(f)}`)}return s}predictLoop(n,s=32,c=!1){return tidy(()=>{const f=this.checkNumSamples(n);if(c)throw new NotImplementedError("Verbose predictLoop() is not implemented yet.");const g=makeBatches(f,s),A=this.outputs.map(v=>[]);for(let v=0;v{const T=g[v][0],I=g[v][1],S=sliceArrays(n,T,I),k=[];if(Array.isArray(S))for(let N=0;NA[I].push(T));return singletonOrArray(A.map(v=>concat$2(v,0)))})}predict(n,s={}){const c=ensureTensorsRank2OrHigher(n);checkInputData(c,this.inputNames,this.feedInputShapes,!1);try{const f=s.batchSize==null?32:s.batchSize;return checkBatchSize(f),this.predictLoop(c,f)}finally{disposeNewTensors(c,n)}}predictOnBatch(n){checkInputData(n,this.inputNames,this.feedInputShapes,!0);const s=(Array.isArray(n)?n[0]:n).shape[0];return this.predictLoop(n,s)}standardizeUserDataXY(n,s,c=!0,f){if(this.optimizer_==null)throw new RuntimeError("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const g=[];for(let A=0;A0&&n[0].shape[0]%f!==0)throw new ValueError(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${f}. Found: ${n[0].shape[0]} sample(s).`);return[n,s]}async standardizeUserData(n,s,c,f,g=!0,A){const[v,y]=this.standardizeUserDataXY(n,s,g,A);if(c!=null)throw new Error("sample weight is not supported yet.");let T=null;if(f!=null){const I=standardizeClassWeights(f,this.outputNames);T=[];for(let S=0;S{const A=this.checkNumSamples(s,c,g,"steps"),v=[];if(f>0)throw new NotImplementedError("Verbose mode is not implemented yet.");if(g!=null)throw new NotImplementedError("steps mode in testLoop() is not implemented yet");{const y=makeBatches(A,c),T=tensor1d(range$2(0,A));for(let I=0;I1){const A=count(n.slice(0,c),f);g+=`_${A}`}s.push(g)}return s}makeTrainFunction(){return n=>{const s=[],c=n.slice(0,this.inputs.length),f=n.slice(this.inputs.length,this.inputs.length+this.outputs.length),g=n.slice(this.inputs.length+this.outputs.length,this.inputs.length+this.outputs.length*2),A=[],v=()=>{const S=[];for(let M=0;M1&&M{N=add$1(N,M)}),N},y=this.collectedTrainableWeights.map(S=>S.read());return[this.optimizer_.minimize(v,!0,y)].concat(A)}}makeTestFunction(){this.testFunction=n=>tidy(()=>{const s=[];let c;const f=n.slice(0,this.inputs.length),g=n.slice(this.inputs.length,this.inputs.length+this.outputs.length),A=[];for(let T=0;TtoSnakeCase(s))}else{const s=Object.keys(this.loss);n={};const c=this.loss;for(const f of s)if(typeof c[f]=="string")n[f]=toSnakeCase(c[f]);else throw new Error("Serialization of non-string loss is not supported.")}return n}getMetricIdentifiers(){if(typeof this.metrics=="string"||typeof this.metrics=="function")return[toSnakeCase(getLossOrMetricName(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(n=>toSnakeCase(getLossOrMetricName(n)));{const n={};for(const s in this.metrics)n[s]=toSnakeCase(getLossOrMetricName(this.metrics[s]));return n}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(n){if(n.weighted_metrics!=null)throw new Error("Loading weight_metrics is not supported yet.");if(n.loss_weights!=null)throw new Error("Loading loss_weights is not supported yet.");if(n.sample_weight_mode!=null)throw new Error("Loading sample_weight_mode is not supported yet.");const s=convertPythonicToTs(n.optimizer_config),c=deserialize(s);let f;if(typeof n.loss=="string")f=toCamelCase(n.loss);else if(Array.isArray(n.loss))f=n.loss.map(A=>toCamelCase(A));else if(n.loss!=null){f={};for(const A in n.loss)f[A]=toCamelCase(n.loss[A])}let g;if(Array.isArray(n.metrics))g=n.metrics.map(A=>toCamelCase(A));else if(n.metrics!=null){g={};for(const A in n.metrics)g[A]=toCamelCase(n.metrics[A])}this.compile({loss:f,metrics:g,optimizer:c})}async save(n,s){if(typeof n=="string"){const T=getSaveHandlers(n);if(T.length===0)throw new ValueError(`Cannot find any save handlers for URL '${n}'`);if(T.length>1)throw new ValueError(`Found more than one (${T.length}) save handlers for URL '${n}'`);n=T[0]}if(n.save==null)throw new ValueError("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const c=await encodeWeights(this.getNamedWeights(s)),v={modelTopology:this.toJSON(null,!1),format:LAYERS_MODEL_FORMAT_NAME,generatedBy:`TensorFlow.js tfjs-layers v${version}`,convertedBy:null};if((s==null?!1:s.includeOptimizer)&&this.optimizer!=null){v.trainingConfig=this.getTrainingConfig();const T="optimizer",{data:I,specs:S}=await encodeWeights(await this.optimizer.getWeights(),T);c.specs.push(...S),c.data=concatenateArrayBuffers([c.data,I])}return this.userDefinedMetadata!=null&&(checkUserDefinedMetadata(this.userDefinedMetadata,this.name,!0),v.userDefinedMetadata=this.userDefinedMetadata),v.weightData=c.data,v.weightSpecs=c.specs,n.save(v)}setUserDefinedMetadata(n){checkUserDefinedMetadata(n,this.name),this.userDefinedMetadata=n}getUserDefinedMetadata(){return this.userDefinedMetadata}}LayersModel.className="Model";registerClass(LayersModel);class Functional extends LayersModel{}Functional.className="Functional";registerClass(Functional);/** * @license * Copyright 2018 Google LLC * @@ -9220,7 +9220,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y(checkDataFormat(n),n==="channelsFirst"?transpose$2(u,[0,2,3,1]):u))}function preprocessConv3DInput(u,n){return tidy(()=>(checkDataFormat(n),n==="channelsFirst"?transpose$2(u,[0,2,3,4,1]):u))}function conv1dWithBias(u,n,s,c=1,f="valid",g,A=1){return tidy(()=>{if(g==null&&(g=imageDataFormat()),checkDataFormat(g),u.shape.length!==3)throw new ValueError(`The input of a conv1dWithBias operation should be 3, but is ${u.shape.length} instead.`);if(n.shape.length!==3)throw new ValueError(`The kernel for a conv1dWithBias operation should be 3, but is ${n.shape.length} instead`);if(s!=null&&s.shape.length!==1)throw new ValueError(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if(g==="channelsFirst"&&(u=transpose$2(u,[0,2,1])),f==="causal")throw new NotImplementedError("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let v=conv1d(u,n,c,f==="same"?"same":"valid","NWC",A);return s!=null&&(v=biasAdd(v,s)),v})}function conv2dWithBiasActivation(u,n,s,c=[1,1],f="valid",g,A,v=null){return tidy(()=>{if(g==null&&(g=imageDataFormat()),checkDataFormat(g),u.rank!==3&&u.rank!==4)throw new ValueError(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${u.rank}.`);if(n.rank!==3&&n.rank!==4)throw new ValueError(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${u.rank}.`);let y=preprocessConv2DInput(u,g);if(f==="causal")throw new NotImplementedError("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return y=conv2d$1({x:y,filter:n,strides:c,pad:f==="same"?"same":"valid",dilations:A,dataFormat:"NHWC",bias:s,activation:v}),g==="channelsFirst"&&(y=transpose$2(y,[0,3,1,2])),y})}function conv3dWithBias(u,n,s,c=[1,1,1],f="valid",g,A){return tidy(()=>{if(g==null&&(g=imageDataFormat()),checkDataFormat(g),u.rank!==4&&u.rank!==5)throw new ValueError(`conv3dWithBias expects input to be of rank 4 or 5, but received ${u.rank}.`);if(n.rank!==4&&n.rank!==5)throw new ValueError(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${u.rank}.`);let v=preprocessConv3DInput(u,g);if(f==="causal")throw new NotImplementedError("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return v=conv3d(v,n,c,f==="same"?"same":"valid","NDHWC",A),s!=null&&(v=biasAdd(v,s)),g==="channelsFirst"&&(v=transpose$2(v,[0,4,1,2,3])),v})}class BaseConv extends Layer{constructor(n,s){if(super(s),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",BaseConv.verifyArgs(s),this.rank=n,assertPositiveInteger(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new NotImplementedError(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=normalizeArray(s.kernelSize,n,"kernelSize"),this.strides=normalizeArray(s.strides==null?1:s.strides,n,"strides"),this.padding=s.padding==null?"valid":s.padding,checkPaddingMode(this.padding),this.dataFormat=s.dataFormat==null?"channelsLast":s.dataFormat,checkDataFormat(this.dataFormat),this.activation=getActivation(s.activation),this.useBias=s.useBias==null?!0:s.useBias,this.biasInitializer=getInitializer(s.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=getConstraint(s.biasConstraint),this.biasRegularizer=getRegularizer(s.biasRegularizer),this.activityRegularizer=getRegularizer(s.activityRegularizer),this.dilationRate=normalizeArray(s.dilationRate==null?1:s.dilationRate,n,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new ValueError(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new ValueError(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new ValueError(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(n){if(assert("kernelSize"in n,"required key 'kernelSize' not in config"),typeof n.kernelSize!="number"&&!checkArrayTypeAndLength(n.kernelSize,"number",1,3))throw new ValueError(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(n.kernelSize)}.`)}getConfig(){const n={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:serializeActivation(this.activation),useBias:this.useBias,biasInitializer:serializeInitializer(this.biasInitializer),biasRegularizer:serializeRegularizer(this.biasRegularizer),activityRegularizer:serializeRegularizer(this.activityRegularizer),biasConstraint:serializeConstraint(this.biasConstraint)},s=super.getConfig();return Object.assign(n,s),n}}class Conv extends BaseConv{constructor(n,s){super(n,s),this.kernel=null,Conv.verifyArgs(s),this.filters=s.filters,assertPositiveInteger(this.filters,"filters"),this.kernelInitializer=getInitializer(s.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=getConstraint(s.kernelConstraint),this.kernelRegularizer=getRegularizer(s.kernelRegularizer)}build(n){n=getExactlyOneShape(n);const s=this.dataFormat==="channelsFirst"?1:n.length-1;if(n[s]==null)throw new ValueError(`The channel dimension of the input should be defined. Found ${n[s]}`);const c=n[s],f=this.kernelSize.concat([c,this.filters]);this.kernel=this.addWeight("kernel",f,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[s]:c}}],this.built=!0}call(n,s){return tidy(()=>{n=getExactlyOneTensor(n);let c;const f=this.bias==null?null:this.bias.read(),g=mapActivationToFusedKernel(this.activation.getClassName());if(g!=null&&this.rank===2)c=conv2dWithBiasActivation(n,this.kernel.read(),f,this.strides,this.padding,this.dataFormat,this.dilationRate,g);else{if(this.rank===1)c=conv1dWithBias(n,this.kernel.read(),f,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)c=conv2dWithBiasActivation(n,this.kernel.read(),f,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)c=conv3dWithBias(n,this.kernel.read(),f,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new NotImplementedError("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(c=this.activation.apply(c))}return c})}computeOutputShape(n){n=getExactlyOneShape(n);const s=[],c=this.dataFormat==="channelsLast"?n.slice(1,n.length-1):n.slice(2);for(let g=0;g 0 but got ${JSON.stringify(n.filters)}`)}}class Conv2D extends Conv{constructor(n){super(2,n),Conv2D.verifyArgs(n)}getConfig(){const n=super.getConfig();return delete n.rank,n}static verifyArgs(n){if(typeof n.kernelSize!="number"&&!checkArrayTypeAndLength(n.kernelSize,"number",1,2))throw new ValueError(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(n.kernelSize)}.`)}}Conv2D.className="Conv2D";registerClass(Conv2D);class Conv3D extends Conv{constructor(n){super(3,n),Conv3D.verifyArgs(n)}getConfig(){const n=super.getConfig();return delete n.rank,n}static verifyArgs(n){if(typeof n.kernelSize!="number"&&!(Array.isArray(n.kernelSize)&&(n.kernelSize.length===1||n.kernelSize.length===3)))throw new ValueError(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(n.kernelSize)}.`)}}Conv3D.className="Conv3D";registerClass(Conv3D);class Conv2DTranspose extends Conv2D{constructor(n){if(super(n),this.inputSpec=[new InputSpec({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new ValueError(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(n){if(n=getExactlyOneShape(n),n.length!==4)throw new ValueError("Input should have rank 4; Received input shape: "+JSON.stringify(n));const s=this.dataFormat==="channelsFirst"?1:n.length-1;if(n[s]==null)throw new ValueError("The channel dimension of the inputs should be defined. Found `None`.");const c=n[s],f=this.kernelSize.concat([this.filters,c]);this.kernel=this.addWeight("kernel",f,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new InputSpec({ndim:4,axes:{[s]:c}})],this.built=!0}call(n,s){return tidy(()=>{let c=getExactlyOneTensor(n);if(c.shape.length!==4)throw new ValueError(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${c.shape.length}`);const f=c.shape,g=f[0];let A,v;this.dataFormat==="channelsFirst"?(A=2,v=3):(A=1,v=2);const y=f[A],T=f[v],I=this.kernelSize[0],S=this.kernelSize[1],k=this.strides[0],e=this.strides[1],N=deconvLength(y,k,I,this.padding),M=deconvLength(T,e,S,this.padding),O=[g,N,M,this.filters];this.dataFormat!=="channelsLast"&&(c=transpose$2(c,[0,2,3,1]));let z=conv2dTranspose(c,this.kernel.read(),O,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(z=transpose$2(z,[0,3,1,2])),this.bias!=null&&(z=biasAdd(z,this.bias.read(),this.dataFormat)),this.activation!=null&&(z=this.activation.apply(z)),z})}computeOutputShape(n){n=getExactlyOneShape(n);const s=n.slice();let c,f,g;this.dataFormat==="channelsFirst"?(c=1,f=2,g=3):(c=3,f=1,g=2);const A=this.kernelSize[0],v=this.kernelSize[1],y=this.strides[0],T=this.strides[1];return s[c]=this.filters,s[f]=deconvLength(s[f],y,A,this.padding),s[g]=deconvLength(s[g],T,v,this.padding),s}getConfig(){const n=super.getConfig();return delete n.dilationRate,n}}Conv2DTranspose.className="Conv2DTranspose";registerClass(Conv2DTranspose);class Conv3DTranspose extends Conv3D{constructor(n){if(super(n),this.inputSpec=[new InputSpec({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new ValueError(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(n){if(n=getExactlyOneShape(n),n.length!==5)throw new ValueError("Input should have rank 5; Received input shape: "+JSON.stringify(n));const s=this.dataFormat==="channelsFirst"?1:n.length-1;if(n[s]==null)throw new ValueError("The channel dimension of the inputs should be defined. Found `None`.");const c=n[s],f=this.kernelSize.concat([this.filters,c]);this.kernel=this.addWeight("kernel",f,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new InputSpec({ndim:5,axes:{[s]:c}})],this.built=!0}call(n,s){return tidy(()=>{let c=getExactlyOneTensor(n);if(c.shape.length!==5)throw new ValueError(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${c.shape.length}`);const f=c.shape,g=f[0];let A,v,y;this.dataFormat==="channelsFirst"?(y=2,A=3,v=4):(y=1,A=2,v=3);const T=f[y],I=f[A],S=f[v],k=this.kernelSize[0],e=this.kernelSize[1],N=this.kernelSize[2],M=this.strides[0],O=this.strides[1],z=this.strides[2],B=deconvLength(T,M,k,this.padding),V=deconvLength(I,O,e,this.padding),b=deconvLength(S,z,N,this.padding),W=[g,B,V,b,this.filters];this.dataFormat!=="channelsLast"&&(c=transpose$2(c,[0,2,3,4,1]));let q=conv3dTranspose(c,this.kernel.read(),W,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(q=transpose$2(q,[0,4,1,2,3])),this.bias!==null&&(q=biasAdd(q,this.bias.read(),this.dataFormat)),this.activation!==null&&(q=this.activation.apply(q)),q})}computeOutputShape(n){n=getExactlyOneShape(n);const s=n.slice();let c,f,g,A;this.dataFormat==="channelsFirst"?(c=1,f=2,g=3,A=4):(c=4,f=1,g=2,A=3);const v=this.kernelSize[0],y=this.kernelSize[1],T=this.kernelSize[2],I=this.strides[0],S=this.strides[1],k=this.strides[2];return s[c]=this.filters,s[f]=deconvLength(s[f],I,v,this.padding),s[g]=deconvLength(s[g],S,y,this.padding),s[A]=deconvLength(s[A],k,T,this.padding),s}getConfig(){const n=super.getConfig();return delete n.dilationRate,n}}Conv3DTranspose.className="Conv3DTranspose";registerClass(Conv3DTranspose);class SeparableConv extends Conv{constructor(n,s){if(super(n,s),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,s.filters==null)throw new ValueError("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(s.kernelInitializer!=null||s.kernelRegularizer!=null||s.kernelConstraint!=null)throw new ValueError("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(s.padding!=null&&s.padding!=="same"&&s.padding!=="valid")throw new ValueError(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(s.padding)}`);this.depthMultiplier=s.depthMultiplier==null?1:s.depthMultiplier,this.depthwiseInitializer=getInitializer(s.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=getRegularizer(s.depthwiseRegularizer),this.depthwiseConstraint=getConstraint(s.depthwiseConstraint),this.pointwiseInitializer=getInitializer(s.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=getRegularizer(s.pointwiseRegularizer),this.pointwiseConstraint=getConstraint(s.pointwiseConstraint)}build(n){if(n=getExactlyOneShape(n),n.length{n=getExactlyOneTensor(n);let c;if(this.rank===1)throw new NotImplementedError("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(n=transpose$2(n,[0,2,3,1])),c=separableConv2d(n,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(c=biasAdd(c,this.bias.read(),this.dataFormat)),this.activation!=null&&(c=this.activation.apply(c)),this.dataFormat==="channelsFirst"&&(c=transpose$2(c,[0,3,1,2])),c})}getConfig(){const n=super.getConfig();return delete n.rank,delete n.kernelInitializer,delete n.kernelRegularizer,delete n.kernelConstraint,n.depthwiseInitializer=serializeInitializer(this.depthwiseInitializer),n.pointwiseInitializer=serializeInitializer(this.pointwiseInitializer),n.depthwiseRegularizer=serializeRegularizer(this.depthwiseRegularizer),n.pointwiseRegularizer=serializeRegularizer(this.pointwiseRegularizer),n.depthwiseConstraint=serializeConstraint(this.depthwiseConstraint),n.pointwiseConstraint=serializeConstraint(this.pointwiseConstraint),n}}SeparableConv.className="SeparableConv";class SeparableConv2D extends SeparableConv{constructor(n){super(2,n)}}SeparableConv2D.className="SeparableConv2D";registerClass(SeparableConv2D);class Conv1D extends Conv{constructor(n){super(1,n),Conv1D.verifyArgs(n),this.inputSpec=[{ndim:3}]}getConfig(){const n=super.getConfig();return delete n.rank,delete n.dataFormat,n}static verifyArgs(n){if(typeof n.kernelSize!="number"&&!checkArrayTypeAndLength(n.kernelSize,"number",1,1))throw new ValueError(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(n.kernelSize)}.`)}}Conv1D.className="Conv1D";registerClass(Conv1D);class Cropping2D extends Layer{constructor(n){super(n),typeof n.cropping=="number"?this.cropping=[[n.cropping,n.cropping],[n.cropping,n.cropping]]:typeof n.cropping[0]=="number"?this.cropping=[[n.cropping[0],n.cropping[0]],[n.cropping[1],n.cropping[1]]]:this.cropping=n.cropping,this.dataFormat=n.dataFormat===void 0?"channelsLast":n.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(n){return this.dataFormat==="channelsFirst"?[n[0],n[1],n[2]-this.cropping[0][0]-this.cropping[0][1],n[3]-this.cropping[1][0]-this.cropping[1][1]]:[n[0],n[1]-this.cropping[0][0]-this.cropping[0][1],n[2]-this.cropping[1][0]-this.cropping[1][1],n[3]]}call(n,s){return tidy(()=>{if(n=getExactlyOneTensor(n),this.dataFormat==="channelsLast"){const c=sliceAlongAxis(n,this.cropping[0][0],n.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return sliceAlongAxis(c,this.cropping[1][0],n.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{const c=sliceAlongAxis(n,this.cropping[0][0],n.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return sliceAlongAxis(c,this.cropping[1][0],n.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){const n={cropping:this.cropping,dataFormat:this.dataFormat},s=super.getConfig();return Object.assign(n,s),n}}Cropping2D.className="Cropping2D";registerClass(Cropping2D);class UpSampling2D extends Layer{constructor(n){super(n),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=n.size==null?this.DEFAULT_SIZE:n.size,this.dataFormat=n.dataFormat==null?"channelsLast":n.dataFormat,checkDataFormat(this.dataFormat),this.interpolation=n.interpolation==null?"nearest":n.interpolation,checkInterpolationFormat(this.interpolation)}computeOutputShape(n){if(this.dataFormat==="channelsFirst"){const s=n[2]==null?null:this.size[0]*n[2],c=n[3]==null?null:this.size[1]*n[3];return[n[0],n[1],s,c]}else{const s=n[1]==null?null:this.size[0]*n[1],c=n[2]==null?null:this.size[1]*n[2];return[n[0],s,c,n[3]]}}call(n,s){return tidy(()=>{let c=getExactlyOneTensor(n);const f=c.shape;if(this.dataFormat==="channelsFirst"){c=transpose$2(c,[0,2,3,1]);const g=this.size[0]*f[2],A=this.size[1]*f[3],v=this.interpolation==="nearest"?image.resizeNearestNeighbor(c,[g,A]):image.resizeBilinear(c,[g,A]);return transpose$2(v,[0,3,1,2])}else{const g=this.size[0]*f[1],A=this.size[1]*f[2];return this.interpolation==="nearest"?image.resizeNearestNeighbor(c,[g,A]):image.resizeBilinear(c,[g,A])}})}getConfig(){const n={size:this.size,dataFormat:this.dataFormat},s=super.getConfig();return Object.assign(n,s),n}}UpSampling2D.className="UpSampling2D";registerClass(UpSampling2D);/** + */function preprocessConv2DInput(u,n){return tidy(()=>(checkDataFormat(n),n==="channelsFirst"?transpose$2(u,[0,2,3,1]):u))}function preprocessConv3DInput(u,n){return tidy(()=>(checkDataFormat(n),n==="channelsFirst"?transpose$2(u,[0,2,3,4,1]):u))}function conv1dWithBias(u,n,s,c=1,f="valid",g,A=1){return tidy(()=>{if(g==null&&(g=imageDataFormat()),checkDataFormat(g),u.shape.length!==3)throw new ValueError(`The input of a conv1dWithBias operation should be 3, but is ${u.shape.length} instead.`);if(n.shape.length!==3)throw new ValueError(`The kernel for a conv1dWithBias operation should be 3, but is ${n.shape.length} instead`);if(s!=null&&s.shape.length!==1)throw new ValueError(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if(g==="channelsFirst"&&(u=transpose$2(u,[0,2,1])),f==="causal")throw new NotImplementedError("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let v=conv1d(u,n,c,f==="same"?"same":"valid","NWC",A);return s!=null&&(v=biasAdd(v,s)),v})}function conv2dWithBiasActivation(u,n,s,c=[1,1],f="valid",g,A,v=null){return tidy(()=>{if(g==null&&(g=imageDataFormat()),checkDataFormat(g),u.rank!==3&&u.rank!==4)throw new ValueError(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${u.rank}.`);if(n.rank!==3&&n.rank!==4)throw new ValueError(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${u.rank}.`);let y=preprocessConv2DInput(u,g);if(f==="causal")throw new NotImplementedError("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return y=conv2d$1({x:y,filter:n,strides:c,pad:f==="same"?"same":"valid",dilations:A,dataFormat:"NHWC",bias:s,activation:v}),g==="channelsFirst"&&(y=transpose$2(y,[0,3,1,2])),y})}function conv3dWithBias(u,n,s,c=[1,1,1],f="valid",g,A){return tidy(()=>{if(g==null&&(g=imageDataFormat()),checkDataFormat(g),u.rank!==4&&u.rank!==5)throw new ValueError(`conv3dWithBias expects input to be of rank 4 or 5, but received ${u.rank}.`);if(n.rank!==4&&n.rank!==5)throw new ValueError(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${u.rank}.`);let v=preprocessConv3DInput(u,g);if(f==="causal")throw new NotImplementedError("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return v=conv3d(v,n,c,f==="same"?"same":"valid","NDHWC",A),s!=null&&(v=biasAdd(v,s)),g==="channelsFirst"&&(v=transpose$2(v,[0,4,1,2,3])),v})}class BaseConv extends Layer{constructor(n,s){if(super(s),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",BaseConv.verifyArgs(s),this.rank=n,assertPositiveInteger(this.rank,"rank"),this.rank!==1&&this.rank!==2&&this.rank!==3)throw new NotImplementedError(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=normalizeArray(s.kernelSize,n,"kernelSize"),this.strides=normalizeArray(s.strides==null?1:s.strides,n,"strides"),this.padding=s.padding==null?"valid":s.padding,checkPaddingMode(this.padding),this.dataFormat=s.dataFormat==null?"channelsLast":s.dataFormat,checkDataFormat(this.dataFormat),this.activation=getActivation(s.activation),this.useBias=s.useBias==null?!0:s.useBias,this.biasInitializer=getInitializer(s.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=getConstraint(s.biasConstraint),this.biasRegularizer=getRegularizer(s.biasRegularizer),this.activityRegularizer=getRegularizer(s.activityRegularizer),this.dilationRate=normalizeArray(s.dilationRate==null?1:s.dilationRate,n,"dilationRate"),this.rank===1&&Array.isArray(this.dilationRate)&&this.dilationRate.length!==1)throw new ValueError(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(this.rank===2){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==2)throw new ValueError(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(this.rank===3){if(typeof this.dilationRate=="number")this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(this.dilationRate.length!==3)throw new ValueError(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}}static verifyArgs(n){if(assert("kernelSize"in n,"required key 'kernelSize' not in config"),typeof n.kernelSize!="number"&&!checkArrayTypeAndLength(n.kernelSize,"number",1,3))throw new ValueError(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(n.kernelSize)}.`)}getConfig(){const n={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:serializeActivation(this.activation),useBias:this.useBias,biasInitializer:serializeInitializer(this.biasInitializer),biasRegularizer:serializeRegularizer(this.biasRegularizer),activityRegularizer:serializeRegularizer(this.activityRegularizer),biasConstraint:serializeConstraint(this.biasConstraint)},s=super.getConfig();return Object.assign(n,s),n}}class Conv extends BaseConv{constructor(n,s){super(n,s),this.kernel=null,Conv.verifyArgs(s),this.filters=s.filters,assertPositiveInteger(this.filters,"filters"),this.kernelInitializer=getInitializer(s.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=getConstraint(s.kernelConstraint),this.kernelRegularizer=getRegularizer(s.kernelRegularizer)}build(n){n=getExactlyOneShape(n);const s=this.dataFormat==="channelsFirst"?1:n.length-1;if(n[s]==null)throw new ValueError(`The channel dimension of the input should be defined. Found ${n[s]}`);const c=n[s],f=this.kernelSize.concat([c,this.filters]);this.kernel=this.addWeight("kernel",f,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[s]:c}}],this.built=!0}call(n,s){return tidy(()=>{n=getExactlyOneTensor(n);let c;const f=this.bias==null?null:this.bias.read(),g=mapActivationToFusedKernel(this.activation.getClassName());if(g!=null&&this.rank===2)c=conv2dWithBiasActivation(n,this.kernel.read(),f,this.strides,this.padding,this.dataFormat,this.dilationRate,g);else{if(this.rank===1)c=conv1dWithBias(n,this.kernel.read(),f,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(this.rank===2)c=conv2dWithBiasActivation(n,this.kernel.read(),f,this.strides,this.padding,this.dataFormat,this.dilationRate);else if(this.rank===3)c=conv3dWithBias(n,this.kernel.read(),f,this.strides,this.padding,this.dataFormat,this.dilationRate);else throw new NotImplementedError("convolutions greater than 3D are not implemented yet.");this.activation!=null&&(c=this.activation.apply(c))}return c})}computeOutputShape(n){n=getExactlyOneShape(n);const s=[],c=this.dataFormat==="channelsLast"?n.slice(1,n.length-1):n.slice(2);for(let g=0;g 0 but got ${JSON.stringify(n.filters)}`)}}class Conv2D extends Conv{constructor(n){super(2,n),Conv2D.verifyArgs(n)}getConfig(){const n=super.getConfig();return delete n.rank,n}static verifyArgs(n){if(typeof n.kernelSize!="number"&&!checkArrayTypeAndLength(n.kernelSize,"number",1,2))throw new ValueError(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(n.kernelSize)}.`)}}Conv2D.className="Conv2D";registerClass(Conv2D);class Conv3D extends Conv{constructor(n){super(3,n),Conv3D.verifyArgs(n)}getConfig(){const n=super.getConfig();return delete n.rank,n}static verifyArgs(n){if(typeof n.kernelSize!="number"&&!(Array.isArray(n.kernelSize)&&(n.kernelSize.length===1||n.kernelSize.length===3)))throw new ValueError(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(n.kernelSize)}.`)}}Conv3D.className="Conv3D";registerClass(Conv3D);class Conv2DTranspose extends Conv2D{constructor(n){if(super(n),this.inputSpec=[new InputSpec({ndim:4})],this.padding!=="same"&&this.padding!=="valid")throw new ValueError(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(n){if(n=getExactlyOneShape(n),n.length!==4)throw new ValueError("Input should have rank 4; Received input shape: "+JSON.stringify(n));const s=this.dataFormat==="channelsFirst"?1:n.length-1;if(n[s]==null)throw new ValueError("The channel dimension of the inputs should be defined. Found `None`.");const c=n[s],f=this.kernelSize.concat([this.filters,c]);this.kernel=this.addWeight("kernel",f,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new InputSpec({ndim:4,axes:{[s]:c}})],this.built=!0}call(n,s){return tidy(()=>{let c=getExactlyOneTensor(n);if(c.shape.length!==4)throw new ValueError(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${c.shape.length}`);const f=c.shape,g=f[0];let A,v;this.dataFormat==="channelsFirst"?(A=2,v=3):(A=1,v=2);const y=f[A],T=f[v],I=this.kernelSize[0],S=this.kernelSize[1],k=this.strides[0],e=this.strides[1],N=deconvLength(y,k,I,this.padding),M=deconvLength(T,e,S,this.padding),O=[g,N,M,this.filters];this.dataFormat!=="channelsLast"&&(c=transpose$2(c,[0,2,3,1]));let U=conv2dTranspose(c,this.kernel.read(),O,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(U=transpose$2(U,[0,3,1,2])),this.bias!=null&&(U=biasAdd(U,this.bias.read(),this.dataFormat)),this.activation!=null&&(U=this.activation.apply(U)),U})}computeOutputShape(n){n=getExactlyOneShape(n);const s=n.slice();let c,f,g;this.dataFormat==="channelsFirst"?(c=1,f=2,g=3):(c=3,f=1,g=2);const A=this.kernelSize[0],v=this.kernelSize[1],y=this.strides[0],T=this.strides[1];return s[c]=this.filters,s[f]=deconvLength(s[f],y,A,this.padding),s[g]=deconvLength(s[g],T,v,this.padding),s}getConfig(){const n=super.getConfig();return delete n.dilationRate,n}}Conv2DTranspose.className="Conv2DTranspose";registerClass(Conv2DTranspose);class Conv3DTranspose extends Conv3D{constructor(n){if(super(n),this.inputSpec=[new InputSpec({ndim:5})],this.padding!=="same"&&this.padding!=="valid")throw new ValueError(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(n){if(n=getExactlyOneShape(n),n.length!==5)throw new ValueError("Input should have rank 5; Received input shape: "+JSON.stringify(n));const s=this.dataFormat==="channelsFirst"?1:n.length-1;if(n[s]==null)throw new ValueError("The channel dimension of the inputs should be defined. Found `None`.");const c=n[s],f=this.kernelSize.concat([this.filters,c]);this.kernel=this.addWeight("kernel",f,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new InputSpec({ndim:5,axes:{[s]:c}})],this.built=!0}call(n,s){return tidy(()=>{let c=getExactlyOneTensor(n);if(c.shape.length!==5)throw new ValueError(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${c.shape.length}`);const f=c.shape,g=f[0];let A,v,y;this.dataFormat==="channelsFirst"?(y=2,A=3,v=4):(y=1,A=2,v=3);const T=f[y],I=f[A],S=f[v],k=this.kernelSize[0],e=this.kernelSize[1],N=this.kernelSize[2],M=this.strides[0],O=this.strides[1],U=this.strides[2],B=deconvLength(T,M,k,this.padding),V=deconvLength(I,O,e,this.padding),b=deconvLength(S,U,N,this.padding),W=[g,B,V,b,this.filters];this.dataFormat!=="channelsLast"&&(c=transpose$2(c,[0,2,3,4,1]));let q=conv3dTranspose(c,this.kernel.read(),W,this.strides,this.padding);return this.dataFormat!=="channelsLast"&&(q=transpose$2(q,[0,4,1,2,3])),this.bias!==null&&(q=biasAdd(q,this.bias.read(),this.dataFormat)),this.activation!==null&&(q=this.activation.apply(q)),q})}computeOutputShape(n){n=getExactlyOneShape(n);const s=n.slice();let c,f,g,A;this.dataFormat==="channelsFirst"?(c=1,f=2,g=3,A=4):(c=4,f=1,g=2,A=3);const v=this.kernelSize[0],y=this.kernelSize[1],T=this.kernelSize[2],I=this.strides[0],S=this.strides[1],k=this.strides[2];return s[c]=this.filters,s[f]=deconvLength(s[f],I,v,this.padding),s[g]=deconvLength(s[g],S,y,this.padding),s[A]=deconvLength(s[A],k,T,this.padding),s}getConfig(){const n=super.getConfig();return delete n.dilationRate,n}}Conv3DTranspose.className="Conv3DTranspose";registerClass(Conv3DTranspose);class SeparableConv extends Conv{constructor(n,s){if(super(n,s),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,s.filters==null)throw new ValueError("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(s.kernelInitializer!=null||s.kernelRegularizer!=null||s.kernelConstraint!=null)throw new ValueError("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(s.padding!=null&&s.padding!=="same"&&s.padding!=="valid")throw new ValueError(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(s.padding)}`);this.depthMultiplier=s.depthMultiplier==null?1:s.depthMultiplier,this.depthwiseInitializer=getInitializer(s.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=getRegularizer(s.depthwiseRegularizer),this.depthwiseConstraint=getConstraint(s.depthwiseConstraint),this.pointwiseInitializer=getInitializer(s.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=getRegularizer(s.pointwiseRegularizer),this.pointwiseConstraint=getConstraint(s.pointwiseConstraint)}build(n){if(n=getExactlyOneShape(n),n.length{n=getExactlyOneTensor(n);let c;if(this.rank===1)throw new NotImplementedError("1D separable convolution is not implemented yet.");return this.rank===2&&(this.dataFormat==="channelsFirst"&&(n=transpose$2(n,[0,2,3,1])),c=separableConv2d(n,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(c=biasAdd(c,this.bias.read(),this.dataFormat)),this.activation!=null&&(c=this.activation.apply(c)),this.dataFormat==="channelsFirst"&&(c=transpose$2(c,[0,3,1,2])),c})}getConfig(){const n=super.getConfig();return delete n.rank,delete n.kernelInitializer,delete n.kernelRegularizer,delete n.kernelConstraint,n.depthwiseInitializer=serializeInitializer(this.depthwiseInitializer),n.pointwiseInitializer=serializeInitializer(this.pointwiseInitializer),n.depthwiseRegularizer=serializeRegularizer(this.depthwiseRegularizer),n.pointwiseRegularizer=serializeRegularizer(this.pointwiseRegularizer),n.depthwiseConstraint=serializeConstraint(this.depthwiseConstraint),n.pointwiseConstraint=serializeConstraint(this.pointwiseConstraint),n}}SeparableConv.className="SeparableConv";class SeparableConv2D extends SeparableConv{constructor(n){super(2,n)}}SeparableConv2D.className="SeparableConv2D";registerClass(SeparableConv2D);class Conv1D extends Conv{constructor(n){super(1,n),Conv1D.verifyArgs(n),this.inputSpec=[{ndim:3}]}getConfig(){const n=super.getConfig();return delete n.rank,delete n.dataFormat,n}static verifyArgs(n){if(typeof n.kernelSize!="number"&&!checkArrayTypeAndLength(n.kernelSize,"number",1,1))throw new ValueError(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(n.kernelSize)}.`)}}Conv1D.className="Conv1D";registerClass(Conv1D);class Cropping2D extends Layer{constructor(n){super(n),typeof n.cropping=="number"?this.cropping=[[n.cropping,n.cropping],[n.cropping,n.cropping]]:typeof n.cropping[0]=="number"?this.cropping=[[n.cropping[0],n.cropping[0]],[n.cropping[1],n.cropping[1]]]:this.cropping=n.cropping,this.dataFormat=n.dataFormat===void 0?"channelsLast":n.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(n){return this.dataFormat==="channelsFirst"?[n[0],n[1],n[2]-this.cropping[0][0]-this.cropping[0][1],n[3]-this.cropping[1][0]-this.cropping[1][1]]:[n[0],n[1]-this.cropping[0][0]-this.cropping[0][1],n[2]-this.cropping[1][0]-this.cropping[1][1],n[3]]}call(n,s){return tidy(()=>{if(n=getExactlyOneTensor(n),this.dataFormat==="channelsLast"){const c=sliceAlongAxis(n,this.cropping[0][0],n.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return sliceAlongAxis(c,this.cropping[1][0],n.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}else{const c=sliceAlongAxis(n,this.cropping[0][0],n.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return sliceAlongAxis(c,this.cropping[1][0],n.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}})}getConfig(){const n={cropping:this.cropping,dataFormat:this.dataFormat},s=super.getConfig();return Object.assign(n,s),n}}Cropping2D.className="Cropping2D";registerClass(Cropping2D);class UpSampling2D extends Layer{constructor(n){super(n),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=n.size==null?this.DEFAULT_SIZE:n.size,this.dataFormat=n.dataFormat==null?"channelsLast":n.dataFormat,checkDataFormat(this.dataFormat),this.interpolation=n.interpolation==null?"nearest":n.interpolation,checkInterpolationFormat(this.interpolation)}computeOutputShape(n){if(this.dataFormat==="channelsFirst"){const s=n[2]==null?null:this.size[0]*n[2],c=n[3]==null?null:this.size[1]*n[3];return[n[0],n[1],s,c]}else{const s=n[1]==null?null:this.size[0]*n[1],c=n[2]==null?null:this.size[1]*n[2];return[n[0],s,c,n[3]]}}call(n,s){return tidy(()=>{let c=getExactlyOneTensor(n);const f=c.shape;if(this.dataFormat==="channelsFirst"){c=transpose$2(c,[0,2,3,1]);const g=this.size[0]*f[2],A=this.size[1]*f[3],v=this.interpolation==="nearest"?image.resizeNearestNeighbor(c,[g,A]):image.resizeBilinear(c,[g,A]);return transpose$2(v,[0,3,1,2])}else{const g=this.size[0]*f[1],A=this.size[1]*f[2];return this.interpolation==="nearest"?image.resizeNearestNeighbor(c,[g,A]):image.resizeBilinear(c,[g,A])}})}getConfig(){const n={size:this.size,dataFormat:this.dataFormat},s=super.getConfig();return Object.assign(n,s),n}}UpSampling2D.className="UpSampling2D";registerClass(UpSampling2D);/** * @license * Copyright 2018 Google LLC * @@ -9236,7 +9236,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y1&&(n=u.slice(1,u.length)),u=u[0]}function f(g){return g==null||Array.isArray(g)?g:[g]}return n=f(n),s=f(s),{inputs:u,initialState:n,constants:s}}function rnn(u,n,s,c=!1,f,g,A=!1,v=!1){return tidy(()=>{const y=n.shape.length;if(y<3)throw new ValueError(`Input should be at least 3D, but is ${y}D.`);const T=[1,0].concat(range$2(2,y));if(n=transpose$2(n,T),g!=null)throw new NotImplementedError("The rnn() functoin of the deeplearn.js backend does not support constants yet.");A&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),f!=null&&(f=cast$3(cast$3(f,"bool"),"float32"),f.rank===y-1&&(f=expandDims$3(f,-1)),f=transpose$2(f,T)),c&&(n=reverse$2(n,0),f!=null&&(f=reverse$2(f,0)));const I=[];let S,k=s;const e=n.shape[0],N=unstack(n);let M;f!=null&&(M=unstack(f));for(let z=0;zu(B,k));if(f==null)S=V[0],k=V[1];else{const b=tidy(()=>{const W=M[z],q=sub$2(onesLike$2(W),W),Y=add$1(mul(V[0],W),mul(k[0],q)),X=k.map((Q,m)=>add$1(mul(V[1][m],W),mul(Q,q)));return{output:Y,newStates:X}});S=b.output,k=b.newStates}v&&I.push(S)}let O;return v&&(O=stack(I,1)),[S,O,k]})}class RNN extends Layer{constructor(n){super(n);let s;if(n.cell==null)throw new ValueError("cell property is missing for the constructor of RNN.");if(Array.isArray(n.cell)?s=new StackedRNNCells({cells:n.cell}):s=n.cell,s.stateSize==null)throw new ValueError("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=s,this.returnSequences=n.returnSequences==null?!1:n.returnSequences,this.returnState=n.returnState==null?!1:n.returnState,this.goBackwards=n.goBackwards==null?!1:n.goBackwards,this._stateful=n.stateful==null?!1:n.stateful,this.unroll=n.unroll==null?!1:n.unroll,this.supportsMasking=!0,this.inputSpec=[new InputSpec({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){const n=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return range$2(0,n).map(s=>null)}else return this.states_}setStates(n){this.states_=n}computeOutputShape(n){isArrayOfShapes(n)&&(n=n[0]),n=n;let s=this.cell.stateSize;Array.isArray(s)||(s=[s]);const c=s[0];let f;if(this.returnSequences?f=[n[0],n[1],c]:f=[n[0],c],this.returnState){const g=[];for(const A of s)g.push([n[0],A]);return[f].concat(g)}else return f}computeMask(n,s){return tidy(()=>{Array.isArray(s)&&(s=s[0]);const c=this.returnSequences?s:null;if(this.returnState){const f=this.states.map(g=>null);return[c].concat(f)}else return c})}get states(){if(this.states_==null){const n=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,s=[];for(let c=0;cA.shape[A.shape.length-1]),g))throw new ValueError(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=g.map(A=>new InputSpec({shape:[null,A]}));this.stateful&&this.resetStates()}resetStates(n,s=!1){tidy(()=>{if(!this.stateful)throw new AttributeError("Cannot call resetStates() on an RNN Layer that is not stateful.");const c=this.inputSpec[0].shape[0];if(c==null)throw new ValueError("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(f=>zeros$1([c,f])):this.states_=[zeros$1([c,this.cell.stateSize])];else if(n==null)dispose(this.states_),this.keptStates!=null&&(dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(f=>zeros$1([c,f])):this.states_[0]=zeros$1([c,this.cell.stateSize]);else{if(Array.isArray(n)||(n=[n]),n.length!==this.states_.length)throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${n.length} state value(s). Input received: ${n}`);s===!0?this.keptStates.push(this.states_.slice()):dispose(this.states_);for(let f=0;fkeep(f.clone()))})}apply(n,s){let c=s==null?null:s.initialState,f=s==null?null:s.constants;s==null&&(s={});const g=standardizeArgs(n,c,f,this.numConstants);n=g.inputs,c=g.initialState,f=g.constants;let A=[],v=[];if(c!=null){s.initialState=c,A=A.concat(c),this.stateSpec=[];for(const T of c)this.stateSpec.push(new InputSpec({shape:T.shape}));v=v.concat(this.stateSpec)}if(f!=null&&(s.constants=f,A=A.concat(f),this.numConstants=f.length),A[0]instanceof SymbolicTensor){const T=[n].concat(A),I=this.inputSpec.concat(v),S=this.inputSpec;this.inputSpec=I;const k=super.apply(T,s);return this.inputSpec=S,k}else return super.apply(n,s)}call(n,s){return tidy(()=>{const c=s==null?null:s.mask,f=s==null?null:s.training;let g=s==null?null:s.initialState;n=getExactlyOneTensor(n),g==null&&(this.stateful?g=this.states_:g=this.getInitialState(n));const A=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(g.length!==A)throw new ValueError(`RNN Layer has ${A} state(s) but was passed ${g.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const v={training:f},T=rnn((N,M)=>{const O=this.cell.call([N].concat(M),v);return[O[0],O.slice(1)]},n,g,this.goBackwards,c,null,this.unroll,this.returnSequences),I=T[0],S=T[1],k=T[2];this.stateful&&this.resetStates(k,f);const e=this.returnSequences?S:I;return this.returnState?[e].concat(k):e})}getInitialState(n){return tidy(()=>{let s=zeros$1(n.shape);return s=sum$2(s,[1,2]),s=expandDims$2(s),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(c=>c>1?tile$2(s,[1,c]):s):this.cell.stateSize>1?[tile$2(s,[1,this.cell.stateSize])]:[s]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(n){super.setFastWeightInitDuringBuild(n),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(n)}getConfig(){const n=super.getConfig(),s={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(s.numConstants=this.numConstants);const c=this.cell.getConfig();return this.getClassName()===RNN.className&&(s.cell={className:this.cell.getClassName(),config:c}),Object.assign({},c,n,s)}static fromConfig(n,s,c={}){const f=s.cell,g=deserialize(f,c);return new n(Object.assign(s,{cell:g}))}}RNN.className="RNN";registerClass(RNN);class RNNCell extends Layer{}class SimpleRNNCell extends RNNCell{constructor(n){super(n),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=n.units,assertPositiveInteger(this.units,"units"),this.activation=getActivation(n.activation==null?this.DEFAULT_ACTIVATION:n.activation),this.useBias=n.useBias==null?!0:n.useBias,this.kernelInitializer=getInitializer(n.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=getInitializer(n.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=getInitializer(n.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=getRegularizer(n.kernelRegularizer),this.recurrentRegularizer=getRegularizer(n.recurrentRegularizer),this.biasRegularizer=getRegularizer(n.biasRegularizer),this.kernelConstraint=getConstraint(n.kernelConstraint),this.recurrentConstraint=getConstraint(n.recurrentConstraint),this.biasConstraint=getConstraint(n.biasConstraint),this.dropout=min$2([1,max$2([0,n.dropout==null?0:n.dropout])]),this.recurrentDropout=min$2([1,max$2([0,n.recurrentDropout==null?0:n.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(n){n=getExactlyOneShape(n),this.kernel=this.addWeight("kernel",[n[n.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(n,s){return tidy(()=>{if(n=n,n.length!==2)throw new ValueError(`SimpleRNNCell expects 2 input Tensors, got ${n.length}.`);let c=n[1];n=n[0];const f=s.training==null?!1:s.training;0onesLike$2(n),rate:this.dropout,training:f})),0onesLike$2(c),rate:this.recurrentDropout,training:f}));let g;const A=this.dropoutMask,v=this.recurrentDropoutMask;A!=null?g=dot(mul(n,A),this.kernel.read()):g=dot(n,this.kernel.read()),this.bias!=null&&(g=biasAdd(g,this.bias.read())),v!=null&&(c=mul(c,v));let y=add$1(g,dot(c,this.recurrentKernel.read()));return this.activation!=null&&(y=this.activation.apply(y)),[y,y]})}getConfig(){const n=super.getConfig(),s={units:this.units,activation:serializeActivation(this.activation),useBias:this.useBias,kernelInitializer:serializeInitializer(this.kernelInitializer),recurrentInitializer:serializeInitializer(this.recurrentInitializer),biasInitializer:serializeInitializer(this.biasInitializer),kernelRegularizer:serializeRegularizer(this.kernelRegularizer),recurrentRegularizer:serializeRegularizer(this.recurrentRegularizer),biasRegularizer:serializeRegularizer(this.biasRegularizer),activityRegularizer:serializeRegularizer(this.activityRegularizer),kernelConstraint:serializeConstraint(this.kernelConstraint),recurrentConstraint:serializeConstraint(this.recurrentConstraint),biasConstraint:serializeConstraint(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},n,s)}}SimpleRNNCell.className="SimpleRNNCell";registerClass(SimpleRNNCell);class SimpleRNN extends RNN{constructor(n){n.cell=new SimpleRNNCell(n),super(n)}call(n,s){return tidy(()=>{this.cell.dropoutMask!=null&&(dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const c=s==null?null:s.mask,f=s==null?null:s.training,g=s==null?null:s.initialState;return super.call(n,{mask:c,training:f,initialState:g})})}static fromConfig(n,s){return new n(s)}}SimpleRNN.className="SimpleRNN";registerClass(SimpleRNN);class GRUCell extends RNNCell{constructor(n){if(super(n),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",n.resetAfter)throw new ValueError("GRUCell does not support reset_after parameter set to true.");this.units=n.units,assertPositiveInteger(this.units,"units"),this.activation=getActivation(n.activation===void 0?this.DEFAULT_ACTIVATION:n.activation),this.recurrentActivation=getActivation(n.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:n.recurrentActivation),this.useBias=n.useBias==null?!0:n.useBias,this.kernelInitializer=getInitializer(n.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=getInitializer(n.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=getInitializer(n.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=getRegularizer(n.kernelRegularizer),this.recurrentRegularizer=getRegularizer(n.recurrentRegularizer),this.biasRegularizer=getRegularizer(n.biasRegularizer),this.kernelConstraint=getConstraint(n.kernelConstraint),this.recurrentConstraint=getConstraint(n.recurrentConstraint),this.biasConstraint=getConstraint(n.biasConstraint),this.dropout=min$2([1,max$2([0,n.dropout==null?0:n.dropout])]),this.recurrentDropout=min$2([1,max$2([0,n.recurrentDropout==null?0:n.recurrentDropout])]),this.implementation=n.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(n){n=getExactlyOneShape(n);const s=n[n.length-1];this.kernel=this.addWeight("kernel",[s,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(n,s){return tidy(()=>{if(n=n,n.length!==2)throw new ValueError(`GRUCell expects 2 input Tensors (inputs, h, c), got ${n.length}.`);const c=s.training==null?!1:s.training;let f=n[1];n=n[0],0onesLike$2(n),rate:this.dropout,training:c,count:3})),0onesLike$2(f),rate:this.recurrentDropout,training:c,count:3}));const g=this.dropoutMask,A=this.recurrentDropoutMask;let v,y,T;0{this.cell.dropoutMask!=null&&(dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const c=s==null?null:s.mask,f=s==null?null:s.training,g=s==null?null:s.initialState;return super.call(n,{mask:c,training:f,initialState:g})})}static fromConfig(n,s){return s.implmentation===0&&(s.implementation=1),new n(s)}}GRU.className="GRU";registerClass(GRU);class LSTMCell extends RNNCell{constructor(n){super(n),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=n.units,assertPositiveInteger(this.units,"units"),this.activation=getActivation(n.activation===void 0?this.DEFAULT_ACTIVATION:n.activation),this.recurrentActivation=getActivation(n.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:n.recurrentActivation),this.useBias=n.useBias==null?!0:n.useBias,this.kernelInitializer=getInitializer(n.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=getInitializer(n.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=getInitializer(n.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=n.unitForgetBias,this.kernelRegularizer=getRegularizer(n.kernelRegularizer),this.recurrentRegularizer=getRegularizer(n.recurrentRegularizer),this.biasRegularizer=getRegularizer(n.biasRegularizer),this.kernelConstraint=getConstraint(n.kernelConstraint),this.recurrentConstraint=getConstraint(n.recurrentConstraint),this.biasConstraint=getConstraint(n.biasConstraint),this.dropout=min$2([1,max$2([0,n.dropout==null?0:n.dropout])]),this.recurrentDropout=min$2([1,max$2([0,n.recurrentDropout==null?0:n.recurrentDropout])]),this.implementation=n.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(n){var s;n=getExactlyOneShape(n);const c=n[n.length-1];this.kernel=this.addWeight("kernel",[c,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let f;if(this.useBias){if(this.unitForgetBias){const g=this.biasInitializer,A=this.units;f=new(s=class extends Initializer{apply(y,T){const I=g.apply([A]),S=new Ones().apply([A]),k=g.apply([A*2]);return concatAlongFirstAxis(concatAlongFirstAxis(I,S),k)}},s.className="CustomInit",s)}else f=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,f,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(n,s){return tidy(()=>{const c=s.training==null?!1:s.training;if(n=n,n.length!==3)throw new ValueError(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${n.length}.`);let f=n[1];const g=n[2];n=n[0],0onesLike$2(n),rate:this.dropout,training:c,count:4})),0onesLike$2(f),rate:this.recurrentDropout,training:c,count:4}));const A=this.dropoutMask,v=this.recurrentDropoutMask;let y,T,I,S;0{this.cell.dropoutMask!=null&&(dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const c=s==null?null:s.mask,f=s==null?null:s.training,g=s==null?null:s.initialState;return super.call(n,{mask:c,training:f,initialState:g})})}static fromConfig(n,s){return s.implmentation===0&&(s.implementation=1),new n(s)}}LSTM.className="LSTM";registerClass(LSTM);class StackedRNNCells extends RNNCell{constructor(n){super(n),this.cells=n.cells}get stateSize(){const n=[];for(const s of this.cells.slice().reverse())Array.isArray(s.stateSize)?n.push(...s.stateSize):n.push(s.stateSize);return n}call(n,s){return tidy(()=>{n=n;let c=n.slice(1);const f=[];for(const v of this.cells.slice().reverse())Array.isArray(v.stateSize)?f.push(c.splice(0,v.stateSize.length)):f.push(c.splice(0,1));f.reverse();const g=[];let A;for(let v=0;v{nameScope(`RNNCell_${f}`,()=>{c.build(n),Array.isArray(c.stateSize)?s=c.stateSize[0]:s=c.stateSize,n=[n[0],s]})}),this.built=!0}getConfig(){const n=super.getConfig(),s=g=>({className:g.getClassName(),config:g.getConfig()}),f={cells:this.cells.map(s)};return Object.assign({},n,f)}static fromConfig(n,s,c={}){const f=[];for(const g of s.cells)f.push(deserialize(g,c));return new n({cells:f})}get trainableWeights(){if(!this.trainable)return[];const n=[];for(const s of this.cells)n.push(...s.trainableWeights);return n}get nonTrainableWeights(){const n=[];for(const s of this.cells)n.push(...s.nonTrainableWeights);if(!this.trainable){const s=[];for(const c of this.cells)s.push(...c.trainableWeights);return s.concat(n)}return n}getWeights(){const n=[];for(const s of this.cells)n.push(...s.weights);return batchGetValue(n)}setWeights(n){const s=[];for(const c of this.cells){const f=c.weights.length,g=n.splice(f);for(let A=0;Adropout(n(),s),A=()=>inTrainPhase(g,n,c);return!f||f<=1?keep(A().clone()):Array(f).fill(void 0).map(A).map(y=>keep(y.clone()))}/** + */function standardizeArgs(u,n,s,c){if(Array.isArray(u)){if(n!=null||s!=null)throw new ValueError("When inputs is an array, neither initialState or constants should be provided");c!=null&&(s=u.slice(u.length-c,u.length),u=u.slice(0,u.length-c)),u.length>1&&(n=u.slice(1,u.length)),u=u[0]}function f(g){return g==null||Array.isArray(g)?g:[g]}return n=f(n),s=f(s),{inputs:u,initialState:n,constants:s}}function rnn(u,n,s,c=!1,f,g,A=!1,v=!1){return tidy(()=>{const y=n.shape.length;if(y<3)throw new ValueError(`Input should be at least 3D, but is ${y}D.`);const T=[1,0].concat(range$2(2,y));if(n=transpose$2(n,T),g!=null)throw new NotImplementedError("The rnn() functoin of the deeplearn.js backend does not support constants yet.");A&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),f!=null&&(f=cast$3(cast$3(f,"bool"),"float32"),f.rank===y-1&&(f=expandDims$3(f,-1)),f=transpose$2(f,T)),c&&(n=reverse$2(n,0),f!=null&&(f=reverse$2(f,0)));const I=[];let S,k=s;const e=n.shape[0],N=unstack(n);let M;f!=null&&(M=unstack(f));for(let U=0;Uu(B,k));if(f==null)S=V[0],k=V[1];else{const b=tidy(()=>{const W=M[U],q=sub$2(onesLike$2(W),W),Y=add$1(mul(V[0],W),mul(k[0],q)),X=k.map((Q,m)=>add$1(mul(V[1][m],W),mul(Q,q)));return{output:Y,newStates:X}});S=b.output,k=b.newStates}v&&I.push(S)}let O;return v&&(O=stack(I,1)),[S,O,k]})}class RNN extends Layer{constructor(n){super(n);let s;if(n.cell==null)throw new ValueError("cell property is missing for the constructor of RNN.");if(Array.isArray(n.cell)?s=new StackedRNNCells({cells:n.cell}):s=n.cell,s.stateSize==null)throw new ValueError("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=s,this.returnSequences=n.returnSequences==null?!1:n.returnSequences,this.returnState=n.returnState==null?!1:n.returnState,this.goBackwards=n.goBackwards==null?!1:n.goBackwards,this._stateful=n.stateful==null?!1:n.stateful,this.unroll=n.unroll==null?!1:n.unroll,this.supportsMasking=!0,this.inputSpec=[new InputSpec({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(this.states_==null){const n=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;return range$2(0,n).map(s=>null)}else return this.states_}setStates(n){this.states_=n}computeOutputShape(n){isArrayOfShapes(n)&&(n=n[0]),n=n;let s=this.cell.stateSize;Array.isArray(s)||(s=[s]);const c=s[0];let f;if(this.returnSequences?f=[n[0],n[1],c]:f=[n[0],c],this.returnState){const g=[];for(const A of s)g.push([n[0],A]);return[f].concat(g)}else return f}computeMask(n,s){return tidy(()=>{Array.isArray(s)&&(s=s[0]);const c=this.returnSequences?s:null;if(this.returnState){const f=this.states.map(g=>null);return[c].concat(f)}else return c})}get states(){if(this.states_==null){const n=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,s=[];for(let c=0;cA.shape[A.shape.length-1]),g))throw new ValueError(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=g.map(A=>new InputSpec({shape:[null,A]}));this.stateful&&this.resetStates()}resetStates(n,s=!1){tidy(()=>{if(!this.stateful)throw new AttributeError("Cannot call resetStates() on an RNN Layer that is not stateful.");const c=this.inputSpec[0].shape[0];if(c==null)throw new ValueError("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.states_==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(f=>zeros$1([c,f])):this.states_=[zeros$1([c,this.cell.stateSize])];else if(n==null)dispose(this.states_),this.keptStates!=null&&(dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(f=>zeros$1([c,f])):this.states_[0]=zeros$1([c,this.cell.stateSize]);else{if(Array.isArray(n)||(n=[n]),n.length!==this.states_.length)throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${n.length} state value(s). Input received: ${n}`);s===!0?this.keptStates.push(this.states_.slice()):dispose(this.states_);for(let f=0;fkeep(f.clone()))})}apply(n,s){let c=s==null?null:s.initialState,f=s==null?null:s.constants;s==null&&(s={});const g=standardizeArgs(n,c,f,this.numConstants);n=g.inputs,c=g.initialState,f=g.constants;let A=[],v=[];if(c!=null){s.initialState=c,A=A.concat(c),this.stateSpec=[];for(const T of c)this.stateSpec.push(new InputSpec({shape:T.shape}));v=v.concat(this.stateSpec)}if(f!=null&&(s.constants=f,A=A.concat(f),this.numConstants=f.length),A[0]instanceof SymbolicTensor){const T=[n].concat(A),I=this.inputSpec.concat(v),S=this.inputSpec;this.inputSpec=I;const k=super.apply(T,s);return this.inputSpec=S,k}else return super.apply(n,s)}call(n,s){return tidy(()=>{const c=s==null?null:s.mask,f=s==null?null:s.training;let g=s==null?null:s.initialState;n=getExactlyOneTensor(n),g==null&&(this.stateful?g=this.states_:g=this.getInitialState(n));const A=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(g.length!==A)throw new ValueError(`RNN Layer has ${A} state(s) but was passed ${g.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const v={training:f},T=rnn((N,M)=>{const O=this.cell.call([N].concat(M),v);return[O[0],O.slice(1)]},n,g,this.goBackwards,c,null,this.unroll,this.returnSequences),I=T[0],S=T[1],k=T[2];this.stateful&&this.resetStates(k,f);const e=this.returnSequences?S:I;return this.returnState?[e].concat(k):e})}getInitialState(n){return tidy(()=>{let s=zeros$1(n.shape);return s=sum$2(s,[1,2]),s=expandDims$2(s),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(c=>c>1?tile$2(s,[1,c]):s):this.cell.stateSize>1?[tile$2(s,[1,this.cell.stateSize])]:[s]})}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(n){super.setFastWeightInitDuringBuild(n),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(n)}getConfig(){const n=super.getConfig(),s={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(s.numConstants=this.numConstants);const c=this.cell.getConfig();return this.getClassName()===RNN.className&&(s.cell={className:this.cell.getClassName(),config:c}),Object.assign({},c,n,s)}static fromConfig(n,s,c={}){const f=s.cell,g=deserialize(f,c);return new n(Object.assign(s,{cell:g}))}}RNN.className="RNN";registerClass(RNN);class RNNCell extends Layer{}class SimpleRNNCell extends RNNCell{constructor(n){super(n),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=n.units,assertPositiveInteger(this.units,"units"),this.activation=getActivation(n.activation==null?this.DEFAULT_ACTIVATION:n.activation),this.useBias=n.useBias==null?!0:n.useBias,this.kernelInitializer=getInitializer(n.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=getInitializer(n.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=getInitializer(n.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=getRegularizer(n.kernelRegularizer),this.recurrentRegularizer=getRegularizer(n.recurrentRegularizer),this.biasRegularizer=getRegularizer(n.biasRegularizer),this.kernelConstraint=getConstraint(n.kernelConstraint),this.recurrentConstraint=getConstraint(n.recurrentConstraint),this.biasConstraint=getConstraint(n.biasConstraint),this.dropout=min$2([1,max$2([0,n.dropout==null?0:n.dropout])]),this.recurrentDropout=min$2([1,max$2([0,n.recurrentDropout==null?0:n.recurrentDropout])]),this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(n){n=getExactlyOneShape(n),this.kernel=this.addWeight("kernel",[n[n.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(n,s){return tidy(()=>{if(n=n,n.length!==2)throw new ValueError(`SimpleRNNCell expects 2 input Tensors, got ${n.length}.`);let c=n[1];n=n[0];const f=s.training==null?!1:s.training;0onesLike$2(n),rate:this.dropout,training:f})),0onesLike$2(c),rate:this.recurrentDropout,training:f}));let g;const A=this.dropoutMask,v=this.recurrentDropoutMask;A!=null?g=dot(mul(n,A),this.kernel.read()):g=dot(n,this.kernel.read()),this.bias!=null&&(g=biasAdd(g,this.bias.read())),v!=null&&(c=mul(c,v));let y=add$1(g,dot(c,this.recurrentKernel.read()));return this.activation!=null&&(y=this.activation.apply(y)),[y,y]})}getConfig(){const n=super.getConfig(),s={units:this.units,activation:serializeActivation(this.activation),useBias:this.useBias,kernelInitializer:serializeInitializer(this.kernelInitializer),recurrentInitializer:serializeInitializer(this.recurrentInitializer),biasInitializer:serializeInitializer(this.biasInitializer),kernelRegularizer:serializeRegularizer(this.kernelRegularizer),recurrentRegularizer:serializeRegularizer(this.recurrentRegularizer),biasRegularizer:serializeRegularizer(this.biasRegularizer),activityRegularizer:serializeRegularizer(this.activityRegularizer),kernelConstraint:serializeConstraint(this.kernelConstraint),recurrentConstraint:serializeConstraint(this.recurrentConstraint),biasConstraint:serializeConstraint(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},n,s)}}SimpleRNNCell.className="SimpleRNNCell";registerClass(SimpleRNNCell);class SimpleRNN extends RNN{constructor(n){n.cell=new SimpleRNNCell(n),super(n)}call(n,s){return tidy(()=>{this.cell.dropoutMask!=null&&(dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const c=s==null?null:s.mask,f=s==null?null:s.training,g=s==null?null:s.initialState;return super.call(n,{mask:c,training:f,initialState:g})})}static fromConfig(n,s){return new n(s)}}SimpleRNN.className="SimpleRNN";registerClass(SimpleRNN);class GRUCell extends RNNCell{constructor(n){if(super(n),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",n.resetAfter)throw new ValueError("GRUCell does not support reset_after parameter set to true.");this.units=n.units,assertPositiveInteger(this.units,"units"),this.activation=getActivation(n.activation===void 0?this.DEFAULT_ACTIVATION:n.activation),this.recurrentActivation=getActivation(n.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:n.recurrentActivation),this.useBias=n.useBias==null?!0:n.useBias,this.kernelInitializer=getInitializer(n.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=getInitializer(n.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=getInitializer(n.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=getRegularizer(n.kernelRegularizer),this.recurrentRegularizer=getRegularizer(n.recurrentRegularizer),this.biasRegularizer=getRegularizer(n.biasRegularizer),this.kernelConstraint=getConstraint(n.kernelConstraint),this.recurrentConstraint=getConstraint(n.recurrentConstraint),this.biasConstraint=getConstraint(n.biasConstraint),this.dropout=min$2([1,max$2([0,n.dropout==null?0:n.dropout])]),this.recurrentDropout=min$2([1,max$2([0,n.recurrentDropout==null?0:n.recurrentDropout])]),this.implementation=n.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(n){n=getExactlyOneShape(n);const s=n[n.length-1];this.kernel=this.addWeight("kernel",[s,this.units*3],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*3],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units*3],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(n,s){return tidy(()=>{if(n=n,n.length!==2)throw new ValueError(`GRUCell expects 2 input Tensors (inputs, h, c), got ${n.length}.`);const c=s.training==null?!1:s.training;let f=n[1];n=n[0],0onesLike$2(n),rate:this.dropout,training:c,count:3})),0onesLike$2(f),rate:this.recurrentDropout,training:c,count:3}));const g=this.dropoutMask,A=this.recurrentDropoutMask;let v,y,T;0{this.cell.dropoutMask!=null&&(dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const c=s==null?null:s.mask,f=s==null?null:s.training,g=s==null?null:s.initialState;return super.call(n,{mask:c,training:f,initialState:g})})}static fromConfig(n,s){return s.implmentation===0&&(s.implementation=1),new n(s)}}GRU.className="GRU";registerClass(GRU);class LSTMCell extends RNNCell{constructor(n){super(n),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=n.units,assertPositiveInteger(this.units,"units"),this.activation=getActivation(n.activation===void 0?this.DEFAULT_ACTIVATION:n.activation),this.recurrentActivation=getActivation(n.recurrentActivation===void 0?this.DEFAULT_RECURRENT_ACTIVATION:n.recurrentActivation),this.useBias=n.useBias==null?!0:n.useBias,this.kernelInitializer=getInitializer(n.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=getInitializer(n.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=getInitializer(n.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=n.unitForgetBias,this.kernelRegularizer=getRegularizer(n.kernelRegularizer),this.recurrentRegularizer=getRegularizer(n.recurrentRegularizer),this.biasRegularizer=getRegularizer(n.biasRegularizer),this.kernelConstraint=getConstraint(n.kernelConstraint),this.recurrentConstraint=getConstraint(n.recurrentConstraint),this.biasConstraint=getConstraint(n.biasConstraint),this.dropout=min$2([1,max$2([0,n.dropout==null?0:n.dropout])]),this.recurrentDropout=min$2([1,max$2([0,n.recurrentDropout==null?0:n.recurrentDropout])]),this.implementation=n.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(n){var s;n=getExactlyOneShape(n);const c=n[n.length-1];this.kernel=this.addWeight("kernel",[c,this.units*4],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units*4],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint);let f;if(this.useBias){if(this.unitForgetBias){const g=this.biasInitializer,A=this.units;f=new(s=class extends Initializer{apply(y,T){const I=g.apply([A]),S=new Ones().apply([A]),k=g.apply([A*2]);return concatAlongFirstAxis(concatAlongFirstAxis(I,S),k)}},s.className="CustomInit",s)}else f=this.biasInitializer;this.bias=this.addWeight("bias",[this.units*4],null,f,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(n,s){return tidy(()=>{const c=s.training==null?!1:s.training;if(n=n,n.length!==3)throw new ValueError(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${n.length}.`);let f=n[1];const g=n[2];n=n[0],0onesLike$2(n),rate:this.dropout,training:c,count:4})),0onesLike$2(f),rate:this.recurrentDropout,training:c,count:4}));const A=this.dropoutMask,v=this.recurrentDropoutMask;let y,T,I,S;0{this.cell.dropoutMask!=null&&(dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const c=s==null?null:s.mask,f=s==null?null:s.training,g=s==null?null:s.initialState;return super.call(n,{mask:c,training:f,initialState:g})})}static fromConfig(n,s){return s.implmentation===0&&(s.implementation=1),new n(s)}}LSTM.className="LSTM";registerClass(LSTM);class StackedRNNCells extends RNNCell{constructor(n){super(n),this.cells=n.cells}get stateSize(){const n=[];for(const s of this.cells.slice().reverse())Array.isArray(s.stateSize)?n.push(...s.stateSize):n.push(s.stateSize);return n}call(n,s){return tidy(()=>{n=n;let c=n.slice(1);const f=[];for(const v of this.cells.slice().reverse())Array.isArray(v.stateSize)?f.push(c.splice(0,v.stateSize.length)):f.push(c.splice(0,1));f.reverse();const g=[];let A;for(let v=0;v{nameScope(`RNNCell_${f}`,()=>{c.build(n),Array.isArray(c.stateSize)?s=c.stateSize[0]:s=c.stateSize,n=[n[0],s]})}),this.built=!0}getConfig(){const n=super.getConfig(),s=g=>({className:g.getClassName(),config:g.getConfig()}),f={cells:this.cells.map(s)};return Object.assign({},n,f)}static fromConfig(n,s,c={}){const f=[];for(const g of s.cells)f.push(deserialize(g,c));return new n({cells:f})}get trainableWeights(){if(!this.trainable)return[];const n=[];for(const s of this.cells)n.push(...s.trainableWeights);return n}get nonTrainableWeights(){const n=[];for(const s of this.cells)n.push(...s.nonTrainableWeights);if(!this.trainable){const s=[];for(const c of this.cells)s.push(...c.trainableWeights);return s.concat(n)}return n}getWeights(){const n=[];for(const s of this.cells)n.push(...s.weights);return batchGetValue(n)}setWeights(n){const s=[];for(const c of this.cells){const f=c.weights.length,g=n.splice(f);for(let A=0;Adropout(n(),s),A=()=>inTrainPhase(g,n,c);return!f||f<=1?keep(A().clone()):Array(f).fill(void 0).map(A).map(y=>keep(y.clone()))}/** * @license * Copyright 2020 Google LLC * @@ -9244,7 +9244,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y{if(this.cell.dropoutMask!=null&&(dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),s&&s.constants)throw new ValueError("ConvRNN2D cell does not support constants");const c=s==null?null:s.mask,f=s==null?null:s.training,g=s==null?null:s.initialState;return super.call(n,{mask:c,training:f,initialState:g})})}computeOutputShape(n){let s=this.computeSingleOutputShape(n);return this.returnSequences||(s=[s[0],...s.slice(2)]),this.returnState&&(s=[s,...Array(2).fill([n[0],...s.slice(-3)])]),s}getInitialState(n){return tidy(()=>{const{stateSize:s}=this.cell,c=n.shape,f=this.computeSingleOutputShape(c),g=[f[0],...f.slice(2)],A=zeros$1(g);return Array.isArray(s)?Array(s.length).fill(A):[A]})}resetStates(n,s=!1){tidy(()=>{if(!this.stateful)throw new AttributeError("Cannot call resetStates() on an RNN Layer that is not stateful.");const c=this.inputSpec[0].shape,f=this.computeSingleOutputShape(c),g=[f[0],...f.slice(2)];if(c[0]==null)throw new ValueError("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>zeros$1(g)):this.states_=[zeros$1(g)];else if(n==null)dispose(this.states_),this.keptStates!=null&&(dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>zeros$1(g)):this.states_[0]=zeros$1(g);else{if(Array.isArray(n)||(n=[n]),n.length!==this.states_.length)throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${n.length} state value(s). Input received: ${n}`);s?this.keptStates.push(this.states_.slice()):dispose(this.states_);for(let v=0;vkeep(v.clone()))})}computeSingleOutputShape(n){const{dataFormat:s,filters:c,kernelSize:f,padding:g,strides:A,dilationRate:v}=this.cell,y=s==="channelsFirst",T=n[y?3:2],I=n[y?4:3],S=convOutputLength(T,f[0],g,A[0],v[0]),k=convOutputLength(I,f[1],g,A[1],v[1]);return[...n.slice(0,2),...y?[c,S,k]:[S,k,c]]}}ConvRNN2D.className="ConvRNN2D";class ConvLSTM2DCell extends LSTMCell{constructor(n){const{filters:s,kernelSize:c,strides:f,padding:g,dataFormat:A,dilationRate:v}=n;super(Object.assign({},n,{units:s})),this.filters=s,assertPositiveInteger(this.filters,"filters"),this.kernelSize=normalizeArray(c,2,"kernelSize"),this.kernelSize.forEach(y=>assertPositiveInteger(y,"kernelSize")),this.strides=normalizeArray(f||1,2,"strides"),this.strides.forEach(y=>assertPositiveInteger(y,"strides")),this.padding=g||"valid",checkPaddingMode(this.padding),this.dataFormat=A||"channelsLast",checkDataFormat(this.dataFormat),this.dilationRate=normalizeArray(v||1,2,"dilationRate"),this.dilationRate.forEach(y=>assertPositiveInteger(y,"dilationRate"))}build(n){var s;n=getExactlyOneShape(n);const c=this.dataFormat==="channelsFirst"?1:n.length-1;if(n[c]==null)throw new ValueError(`The channel dimension of the input should be defined. Found ${n[c]}`);const f=n[c],g=4,A=this.kernelSize.concat([f,this.filters*g]);this.kernel=this.addWeight("kernel",A,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const v=this.kernelSize.concat([this.filters,this.filters*g]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",v,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let y;if(this.unitForgetBias){const T=this.biasInitializer,I=this.filters;y=new(s=class extends Initializer{apply(k,e){const N=T.apply([I]),M=ones([I]),O=T.apply([I*2]);return concatenate([N,M,O])}},s.className="CustomInit",s)}else y=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*g],null,y,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(n,s){return tidy(()=>{if(n.length!==3)throw new ValueError(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${n.length}.`);const c=s.training||!1,f=n[0],g=n[1],A=n[2],v=4;0onesLike$2(f),rate:this.dropout,training:c,count:v}));const y=this.dropoutMask,T=(Fe,De,Ze)=>!De||!De[Ze]?Fe:mul(De[Ze],Fe);let I=T(f,y,0),S=T(f,y,1),k=T(f,y,2),e=T(f,y,3);0onesLike$2(g),rate:this.recurrentDropout,training:c,count:v}));const N=this.recurrentDropoutMask;let M=T(g,N,0),O=T(g,N,1),z=T(g,N,2),B=T(g,N,3);const V=3,[b,W,q,Y]=split$1(this.kernel.read(),v,V),[X,Q,m,Z]=this.useBias?split$1(this.bias.read(),v):[null,null,null,null];I=this.inputConv(I,b,X,this.padding),S=this.inputConv(S,W,Q,this.padding),k=this.inputConv(k,q,m,this.padding),e=this.inputConv(e,Y,Z,this.padding);const[ee,oe,fe,me]=split$1(this.recurrentKernel.read(),v,V);M=this.recurrentConv(M,ee),O=this.recurrentConv(O,oe),z=this.recurrentConv(z,fe),B=this.recurrentConv(B,me);const pe=this.recurrentActivation.apply(add$1(I,M)),Se=this.recurrentActivation.apply(add$1(S,O)),xe=add$1(mul(Se,A),mul(pe,this.activation.apply(add$1(k,z)))),we=mul(this.recurrentActivation.apply(add$1(e,B)),this.activation.apply(xe));return[we,we,xe]})}getConfig(){const n=super.getConfig(),s=__rest(n,["units"]),c={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},s,c)}inputConv(n,s,c,f){const g=conv2d$2(n,s,this.strides,f||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return c?biasAdd(g,c,this.dataFormat):g}recurrentConv(n,s){return conv2d$2(n,s,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}}ConvLSTM2DCell.className="ConvLSTM2DCell";registerClass(ConvLSTM2DCell);class ConvLSTM2D extends ConvRNN2D{constructor(n){const s=new ConvLSTM2DCell(n);super(Object.assign({},n,{cell:s}))}static fromConfig(n,s){return new n(s)}}ConvLSTM2D.className="ConvLSTM2D";registerClass(ConvLSTM2D);/** + */var __rest=function(u,n){var s={};for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&n.indexOf(c)<0&&(s[c]=u[c]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,c=Object.getOwnPropertySymbols(u);f{if(this.cell.dropoutMask!=null&&(dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),this.cell.recurrentDropoutMask!=null&&(dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),s&&s.constants)throw new ValueError("ConvRNN2D cell does not support constants");const c=s==null?null:s.mask,f=s==null?null:s.training,g=s==null?null:s.initialState;return super.call(n,{mask:c,training:f,initialState:g})})}computeOutputShape(n){let s=this.computeSingleOutputShape(n);return this.returnSequences||(s=[s[0],...s.slice(2)]),this.returnState&&(s=[s,...Array(2).fill([n[0],...s.slice(-3)])]),s}getInitialState(n){return tidy(()=>{const{stateSize:s}=this.cell,c=n.shape,f=this.computeSingleOutputShape(c),g=[f[0],...f.slice(2)],A=zeros$1(g);return Array.isArray(s)?Array(s.length).fill(A):[A]})}resetStates(n,s=!1){tidy(()=>{if(!this.stateful)throw new AttributeError("Cannot call resetStates() on an RNN Layer that is not stateful.");const c=this.inputSpec[0].shape,f=this.computeSingleOutputShape(c),g=[f[0],...f.slice(2)];if(c[0]==null)throw new ValueError("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(this.getStates()==null)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>zeros$1(g)):this.states_=[zeros$1(g)];else if(n==null)dispose(this.states_),this.keptStates!=null&&(dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>zeros$1(g)):this.states_[0]=zeros$1(g);else{if(Array.isArray(n)||(n=[n]),n.length!==this.states_.length)throw new ValueError(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${n.length} state value(s). Input received: ${n}`);s?this.keptStates.push(this.states_.slice()):dispose(this.states_);for(let v=0;vkeep(v.clone()))})}computeSingleOutputShape(n){const{dataFormat:s,filters:c,kernelSize:f,padding:g,strides:A,dilationRate:v}=this.cell,y=s==="channelsFirst",T=n[y?3:2],I=n[y?4:3],S=convOutputLength(T,f[0],g,A[0],v[0]),k=convOutputLength(I,f[1],g,A[1],v[1]);return[...n.slice(0,2),...y?[c,S,k]:[S,k,c]]}}ConvRNN2D.className="ConvRNN2D";class ConvLSTM2DCell extends LSTMCell{constructor(n){const{filters:s,kernelSize:c,strides:f,padding:g,dataFormat:A,dilationRate:v}=n;super(Object.assign({},n,{units:s})),this.filters=s,assertPositiveInteger(this.filters,"filters"),this.kernelSize=normalizeArray(c,2,"kernelSize"),this.kernelSize.forEach(y=>assertPositiveInteger(y,"kernelSize")),this.strides=normalizeArray(f||1,2,"strides"),this.strides.forEach(y=>assertPositiveInteger(y,"strides")),this.padding=g||"valid",checkPaddingMode(this.padding),this.dataFormat=A||"channelsLast",checkDataFormat(this.dataFormat),this.dilationRate=normalizeArray(v||1,2,"dilationRate"),this.dilationRate.forEach(y=>assertPositiveInteger(y,"dilationRate"))}build(n){var s;n=getExactlyOneShape(n);const c=this.dataFormat==="channelsFirst"?1:n.length-1;if(n[c]==null)throw new ValueError(`The channel dimension of the input should be defined. Found ${n[c]}`);const f=n[c],g=4,A=this.kernelSize.concat([f,this.filters*g]);this.kernel=this.addWeight("kernel",A,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const v=this.kernelSize.concat([this.filters,this.filters*g]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",v,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let y;if(this.unitForgetBias){const T=this.biasInitializer,I=this.filters;y=new(s=class extends Initializer{apply(k,e){const N=T.apply([I]),M=ones([I]),O=T.apply([I*2]);return concatenate([N,M,O])}},s.className="CustomInit",s)}else y=this.biasInitializer;this.bias=this.addWeight("bias",[this.filters*g],null,y,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(n,s){return tidy(()=>{if(n.length!==3)throw new ValueError(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${n.length}.`);const c=s.training||!1,f=n[0],g=n[1],A=n[2],v=4;0onesLike$2(f),rate:this.dropout,training:c,count:v}));const y=this.dropoutMask,T=(Fe,De,Ze)=>!De||!De[Ze]?Fe:mul(De[Ze],Fe);let I=T(f,y,0),S=T(f,y,1),k=T(f,y,2),e=T(f,y,3);0onesLike$2(g),rate:this.recurrentDropout,training:c,count:v}));const N=this.recurrentDropoutMask;let M=T(g,N,0),O=T(g,N,1),U=T(g,N,2),B=T(g,N,3);const V=3,[b,W,q,Y]=split$1(this.kernel.read(),v,V),[X,Q,m,Z]=this.useBias?split$1(this.bias.read(),v):[null,null,null,null];I=this.inputConv(I,b,X,this.padding),S=this.inputConv(S,W,Q,this.padding),k=this.inputConv(k,q,m,this.padding),e=this.inputConv(e,Y,Z,this.padding);const[ee,oe,fe,me]=split$1(this.recurrentKernel.read(),v,V);M=this.recurrentConv(M,ee),O=this.recurrentConv(O,oe),U=this.recurrentConv(U,fe),B=this.recurrentConv(B,me);const pe=this.recurrentActivation.apply(add$1(I,M)),Se=this.recurrentActivation.apply(add$1(S,O)),xe=add$1(mul(Se,A),mul(pe,this.activation.apply(add$1(k,U)))),we=mul(this.recurrentActivation.apply(add$1(e,B)),this.activation.apply(xe));return[we,we,xe]})}getConfig(){const n=super.getConfig(),s=__rest(n,["units"]),c={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},s,c)}inputConv(n,s,c,f){const g=conv2d$2(n,s,this.strides,f||"valid",this.dataFormat==="channelsFirst"?"NCHW":"NHWC",this.dilationRate);return c?biasAdd(g,c,this.dataFormat):g}recurrentConv(n,s){return conv2d$2(n,s,1,"same",this.dataFormat==="channelsFirst"?"NCHW":"NHWC")}}ConvLSTM2DCell.className="ConvLSTM2DCell";registerClass(ConvLSTM2DCell);class ConvLSTM2D extends ConvRNN2D{constructor(n){const s=new ConvLSTM2DCell(n);super(Object.assign({},n,{cell:s}))}static fromConfig(n,s){return new n(s)}}ConvLSTM2D.className="ConvLSTM2D";registerClass(ConvLSTM2D);/** * @license * Copyright 2018 Google LLC * @@ -9324,7 +9324,7 @@ Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y>>0,k-=y,k*=y,y=k>>>0,k-=y,y+=k*4294967296}return(y>>>0)*23283064365386963e-26};return T}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.alea=A})(commonjsGlobal,u,!1)})(alea$3);var aleaExports$1=alea$3.exports,xor128$3={exports:{}};xor128$3.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.x=0,y.y=0,y.z=0,y.w=0,y.next=function(){var S=y.x^y.x<<11;return y.x=y.y,y.y=y.z,y.z=y.w,y.w^=y.w>>>19^S^S>>>8},v===(v|0)?y.x=v:T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor128=A})(commonjsGlobal,u,!1)})(xor128$3);var xor128Exports$1=xor128$3.exports,xorwow$3={exports:{}};xorwow$3.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.x^y.x>>>2;return y.x=y.y,y.y=y.z,y.z=y.w,y.w=y.v,(y.d=y.d+362437|0)+(y.v=y.v^y.v<<4^(S^S<<1))|0},y.x=0,y.y=0,y.z=0,y.w=0,y.v=0,v===(v|0)?y.x=v:T+=v;for(var I=0;I>>4),y.next()}function g(v,y){return y.x=v.x,y.y=v.y,y.z=v.z,y.w=v.w,y.v=v.v,y.d=v.d,y}function A(v,y){var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorwow=A})(commonjsGlobal,u,!1)})(xorwow$3);var xorwowExports$1=xorwow$3.exports,xorshift7$3={exports:{}};xorshift7$3.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.x,S=y.i,k,e;return k=I[S],k^=k>>>7,e=k^k<<24,k=I[S+1&7],e^=k^k>>>10,k=I[S+3&7],e^=k^k>>>3,k=I[S+4&7],e^=k^k<<7,k=I[S+7&7],k=k^k<<13,e^=k^k<<9,I[S]=e,y.i=S+1&7,e};function T(I,S){var k,e=[];if(S===(S|0))e[0]=S;else for(S=""+S,k=0;k0;--k)I.next()}T(y,v)}function g(v,y){return y.x=v.x.slice(),y.i=v.i,y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.x&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorshift7=A})(commonjsGlobal,u,!1)})(xorshift7$3);var xorshift7Exports$1=xorshift7$3.exports,xor4096$3={exports:{}};xor4096$3.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.w,S=y.X,k=y.i,e,N;return y.w=I=I+1640531527|0,N=S[k+34&127],e=S[k=k+1&127],N^=N<<13,e^=e<<17,N^=N>>>15,e^=e>>>12,N=S[k]=N^e,y.i=k,N+(I^I>>>16)|0};function T(I,S){var k,e,N,M,O,z=[],B=128;for(S===(S|0)?(e=S,S=null):(S=S+"\0",e=0,B=Math.max(B,S.length)),N=0,M=-32;M>>15,e^=e<<4,e^=e>>>13,M>=0&&(O=O+1640531527|0,k=z[M&127]^=e+O,N=k==0?N+1:0);for(N>=128&&(z[(S&&S.length||0)&127]=-1),N=127,M=4*128;M>0;--M)e=z[N+34&127],k=z[N=N+1&127],e^=e<<13,k^=k<<17,e^=e>>>15,k^=k>>>12,z[N]=e^k;I.w=O,I.X=z,I.i=N}T(y,v)}function g(v,y){return y.i=v.i,y.w=v.w,y.X=v.X.slice(),y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.X&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor4096=A})(commonjsGlobal,u,!1)})(xor4096$3);var xor4096Exports$1=xor4096$3.exports,tychei$3={exports:{}};tychei$3.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.b,k=y.c,e=y.d,N=y.a;return S=S<<25^S>>>7^k,k=k-e|0,e=e<<24^e>>>8^N,N=N-S|0,y.b=S=S<<20^S>>>12^k,y.c=k=k-e|0,y.d=e<<16^k>>>16^N,y.a=N-S|0},y.a=0,y.b=0,y.c=-1640531527,y.d=1367130551,v===Math.floor(v)?(y.a=v/4294967296|0,y.b=v|0):T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.tychei=A})(commonjsGlobal,u,!1)})(tychei$3);var tycheiExports$1=tychei$3.exports,seedrandom$2={exports:{}};(function(u){(function(n,s){var c=(0,eval)("this"),f=256,g=6,A=52,v="random",y=s.pow(f,g),T=s.pow(2,A),I=T*2,S=f-1,k;function e(b,W,q){var Y=[];W=W==!0?{entropy:!0}:W||{};var X=z(O(W.entropy?[b,V(n)]:b??B(),3),Y),Q=new N(Y),m=function(){for(var Z=Q.g(g),ee=y,oe=0;Z=I;)Z/=2,ee/=2,oe>>>=1;return(Z+oe)/ee};return m.int32=function(){return Q.g(4)|0},m.quick=function(){return Q.g(4)/4294967296},m.double=m,z(V(Q.S),n),(W.pass||q||function(Z,ee,oe,fe){return fe&&(fe.S&&M(fe,Q),Z.state=function(){return M(Q,{})}),oe?(s[v]=Z,ee):Z})(m,X,"global"in W?W.global:this==s,W.state)}s["seed"+v]=e;function N(b){var W,q=b.length,Y=this,X=0,Q=Y.i=Y.j=0,m=Y.S=[];for(q||(b=[q++]);X>>0,k-=y,k*=y,y=k>>>0,k-=y,y+=k*4294967296}return(y>>>0)*23283064365386963e-26};return T}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.alea=A})(commonjsGlobal,u,!1)})(alea$3);var aleaExports$1=alea$3.exports,xor128$3={exports:{}};xor128$3.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.x=0,y.y=0,y.z=0,y.w=0,y.next=function(){var S=y.x^y.x<<11;return y.x=y.y,y.y=y.z,y.z=y.w,y.w^=y.w>>>19^S^S>>>8},v===(v|0)?y.x=v:T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor128=A})(commonjsGlobal,u,!1)})(xor128$3);var xor128Exports$1=xor128$3.exports,xorwow$3={exports:{}};xorwow$3.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.x^y.x>>>2;return y.x=y.y,y.y=y.z,y.z=y.w,y.w=y.v,(y.d=y.d+362437|0)+(y.v=y.v^y.v<<4^(S^S<<1))|0},y.x=0,y.y=0,y.z=0,y.w=0,y.v=0,v===(v|0)?y.x=v:T+=v;for(var I=0;I>>4),y.next()}function g(v,y){return y.x=v.x,y.y=v.y,y.z=v.z,y.w=v.w,y.v=v.v,y.d=v.d,y}function A(v,y){var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorwow=A})(commonjsGlobal,u,!1)})(xorwow$3);var xorwowExports$1=xorwow$3.exports,xorshift7$3={exports:{}};xorshift7$3.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.x,S=y.i,k,e;return k=I[S],k^=k>>>7,e=k^k<<24,k=I[S+1&7],e^=k^k>>>10,k=I[S+3&7],e^=k^k>>>3,k=I[S+4&7],e^=k^k<<7,k=I[S+7&7],k=k^k<<13,e^=k^k<<9,I[S]=e,y.i=S+1&7,e};function T(I,S){var k,e=[];if(S===(S|0))e[0]=S;else for(S=""+S,k=0;k0;--k)I.next()}T(y,v)}function g(v,y){return y.x=v.x.slice(),y.i=v.i,y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.x&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorshift7=A})(commonjsGlobal,u,!1)})(xorshift7$3);var xorshift7Exports$1=xorshift7$3.exports,xor4096$3={exports:{}};xor4096$3.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.w,S=y.X,k=y.i,e,N;return y.w=I=I+1640531527|0,N=S[k+34&127],e=S[k=k+1&127],N^=N<<13,e^=e<<17,N^=N>>>15,e^=e>>>12,N=S[k]=N^e,y.i=k,N+(I^I>>>16)|0};function T(I,S){var k,e,N,M,O,U=[],B=128;for(S===(S|0)?(e=S,S=null):(S=S+"\0",e=0,B=Math.max(B,S.length)),N=0,M=-32;M>>15,e^=e<<4,e^=e>>>13,M>=0&&(O=O+1640531527|0,k=U[M&127]^=e+O,N=k==0?N+1:0);for(N>=128&&(U[(S&&S.length||0)&127]=-1),N=127,M=4*128;M>0;--M)e=U[N+34&127],k=U[N=N+1&127],e^=e<<13,k^=k<<17,e^=e>>>15,k^=k>>>12,U[N]=e^k;I.w=O,I.X=U,I.i=N}T(y,v)}function g(v,y){return y.i=v.i,y.w=v.w,y.X=v.X.slice(),y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.X&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor4096=A})(commonjsGlobal,u,!1)})(xor4096$3);var xor4096Exports$1=xor4096$3.exports,tychei$3={exports:{}};tychei$3.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.b,k=y.c,e=y.d,N=y.a;return S=S<<25^S>>>7^k,k=k-e|0,e=e<<24^e>>>8^N,N=N-S|0,y.b=S=S<<20^S>>>12^k,y.c=k=k-e|0,y.d=e<<16^k>>>16^N,y.a=N-S|0},y.a=0,y.b=0,y.c=-1640531527,y.d=1367130551,v===Math.floor(v)?(y.a=v/4294967296|0,y.b=v|0):T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.tychei=A})(commonjsGlobal,u,!1)})(tychei$3);var tycheiExports$1=tychei$3.exports,seedrandom$2={exports:{}};(function(u){(function(n,s){var c=(0,eval)("this"),f=256,g=6,A=52,v="random",y=s.pow(f,g),T=s.pow(2,A),I=T*2,S=f-1,k;function e(b,W,q){var Y=[];W=W==!0?{entropy:!0}:W||{};var X=U(O(W.entropy?[b,V(n)]:b??B(),3),Y),Q=new N(Y),m=function(){for(var Z=Q.g(g),ee=y,oe=0;Z=I;)Z/=2,ee/=2,oe>>>=1;return(Z+oe)/ee};return m.int32=function(){return Q.g(4)|0},m.quick=function(){return Q.g(4)/4294967296},m.double=m,U(V(Q.S),n),(W.pass||q||function(Z,ee,oe,fe){return fe&&(fe.S&&M(fe,Q),Z.state=function(){return M(Q,{})}),oe?(s[v]=Z,ee):Z})(m,X,"global"in W?W.global:this==s,W.state)}s["seed"+v]=e;function N(b){var W,q=b.length,Y=this,X=0,Q=Y.i=Y.j=0,m=Y.S=[];for(q||(b=[q++]);X{const A=assertAndGetBroadcastShape(n,s),v=A.length,y=computeStrides(A),T=sizeFromShape(A),I=getTypedArrayFromDType(g,T),S=n.length,k=s.length,e=computeStrides(n),N=computeStrides(s),M=getBroadcastDims$1(n,A),O=getBroadcastDims$1(s,A);if(M.length+O.length===0)for(let z=0;zV[Y]=0);const b=locToIndex(V,S,e),W=B.slice(-k);O.forEach(Y=>W[Y]=0);const q=locToIndex(W,k,N);I[z]=u(c[b],f[q])}return[I,A]}}/** + */function createSimpleBinaryKernelImpl(u){return(n,s,c,f,g)=>{const A=assertAndGetBroadcastShape(n,s),v=A.length,y=computeStrides(A),T=sizeFromShape(A),I=getTypedArrayFromDType(g,T),S=n.length,k=s.length,e=computeStrides(n),N=computeStrides(s),M=getBroadcastDims$1(n,A),O=getBroadcastDims$1(s,A);if(M.length+O.length===0)for(let U=0;UV[Y]=0);const b=locToIndex(V,S,e),W=B.slice(-k);O.forEach(Y=>W[Y]=0);const q=locToIndex(W,k,N);I[U]=u(c[b],f[q])}return[I,A]}}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9493,7 +9493,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function binaryKernelFunc$1(u,n,s,c){return s==null?({inputs:f,backend:g})=>{const{a:A,b:v}=f,y=g;assertNotComplex$1([A,v],u);const T=y.data.get(A.dataId).values,I=y.data.get(v.dataId).values,S=A.dtype==="string"?fromUint8ToStringArray(T):T,k=A.dtype==="string"?fromUint8ToStringArray(I):I,e=c||A.dtype,[N,M]=n(A.shape,v.shape,S,k,e);return y.makeTensorInfo(M,e,N)}:({inputs:f,backend:g})=>{const{a:A,b:v}=f,y=g;if(A.dtype==="complex64"||v.dtype==="complex64"){const T=cast$1({inputs:{x:A},backend:y,attrs:{dtype:"complex64"}}),I=y.data.get(T.dataId),S=I.complexTensorInfos.real,k=I.complexTensorInfos.imag,e=y.data.get(S.dataId).values,N=y.data.get(k.dataId).values,M=cast$1({inputs:{x:v},backend:y,attrs:{dtype:"complex64"}}),O=y.data.get(M.dataId),z=O.complexTensorInfos.real,B=O.complexTensorInfos.imag,V=y.data.get(z.dataId).values,b=y.data.get(B.dataId).values,[W,q,Y]=s(A.shape,v.shape,e,N,V,b),X=y.makeTensorInfo(Y,"float32",W),Q=y.makeTensorInfo(Y,"float32",q),m=complex$1({inputs:{real:X,imag:Q},backend:y});return y.disposeIntermediateTensorInfo(T),y.disposeIntermediateTensorInfo(M),y.disposeIntermediateTensorInfo(X),y.disposeIntermediateTensorInfo(Q),m}else{const T=y.data.get(A.dataId).values,I=y.data.get(v.dataId).values,S=c||A.dtype,[k,e]=n(A.shape,v.shape,T,I,S);return y.makeTensorInfo(e,S,k)}}}function createComplexBinaryKernelImpl(u){return(n,s,c,f,g,A)=>{const v=assertAndGetBroadcastShape(n,s),y=sizeFromShape(v),T=v.length,I=computeStrides(v),S=getTypedArrayFromDType("float32",y),k=getTypedArrayFromDType("float32",y),e=getBroadcastDims$1(n,v),N=getBroadcastDims$1(s,v),M=mergeRealAndImagArrays(c,f),O=mergeRealAndImagArrays(g,A),z=n.length,B=computeStrides(n),V=s.length,b=computeStrides(s);if(e.length+N.length===0)for(let W=0;WY[ee]=0);const X=locToIndex(Y,z,B),Q=q.slice(-V);N.forEach(ee=>Q[ee]=0);const m=locToIndex(Q,V,b),Z=u(M[X*2],M[X*2+1],O[m*2],O[m*2+1]);S[W]=Z.real,k[W]=Z.imag}return[S,k,v]}}/** + */function binaryKernelFunc$1(u,n,s,c){return s==null?({inputs:f,backend:g})=>{const{a:A,b:v}=f,y=g;assertNotComplex$1([A,v],u);const T=y.data.get(A.dataId).values,I=y.data.get(v.dataId).values,S=A.dtype==="string"?fromUint8ToStringArray(T):T,k=A.dtype==="string"?fromUint8ToStringArray(I):I,e=c||A.dtype,[N,M]=n(A.shape,v.shape,S,k,e);return y.makeTensorInfo(M,e,N)}:({inputs:f,backend:g})=>{const{a:A,b:v}=f,y=g;if(A.dtype==="complex64"||v.dtype==="complex64"){const T=cast$1({inputs:{x:A},backend:y,attrs:{dtype:"complex64"}}),I=y.data.get(T.dataId),S=I.complexTensorInfos.real,k=I.complexTensorInfos.imag,e=y.data.get(S.dataId).values,N=y.data.get(k.dataId).values,M=cast$1({inputs:{x:v},backend:y,attrs:{dtype:"complex64"}}),O=y.data.get(M.dataId),U=O.complexTensorInfos.real,B=O.complexTensorInfos.imag,V=y.data.get(U.dataId).values,b=y.data.get(B.dataId).values,[W,q,Y]=s(A.shape,v.shape,e,N,V,b),X=y.makeTensorInfo(Y,"float32",W),Q=y.makeTensorInfo(Y,"float32",q),m=complex$1({inputs:{real:X,imag:Q},backend:y});return y.disposeIntermediateTensorInfo(T),y.disposeIntermediateTensorInfo(M),y.disposeIntermediateTensorInfo(X),y.disposeIntermediateTensorInfo(Q),m}else{const T=y.data.get(A.dataId).values,I=y.data.get(v.dataId).values,S=c||A.dtype,[k,e]=n(A.shape,v.shape,T,I,S);return y.makeTensorInfo(e,S,k)}}}function createComplexBinaryKernelImpl(u){return(n,s,c,f,g,A)=>{const v=assertAndGetBroadcastShape(n,s),y=sizeFromShape(v),T=v.length,I=computeStrides(v),S=getTypedArrayFromDType("float32",y),k=getTypedArrayFromDType("float32",y),e=getBroadcastDims$1(n,v),N=getBroadcastDims$1(s,v),M=mergeRealAndImagArrays(c,f),O=mergeRealAndImagArrays(g,A),U=n.length,B=computeStrides(n),V=s.length,b=computeStrides(s);if(e.length+N.length===0)for(let W=0;WY[ee]=0);const X=locToIndex(Y,U,B),Q=q.slice(-V);N.forEach(ee=>Q[ee]=0);const m=locToIndex(Q,V,b),Z=u(M[X*2],M[X*2+1],O[m*2],O[m*2+1]);S[W]=Z.real,k[W]=Z.imag}return[S,k,v]}}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9898,7 +9898,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function prodImpl(u,n,s,c){const[f,g]=computeOutAndReduceShapes(u,c),A=upcastType(n,"int32"),v=makeZerosTypedArray(sizeFromShape(f),A),y=sizeFromShape(g);for(let T=0;Ts.disposeIntermediateTensorInfo(B)),s.makeTensorInfo(z,O,N)}const prodConfig$1={kernelName:Prod,backendName:"cpu",kernelFunc:prod$1};/** + */function prodImpl(u,n,s,c){const[f,g]=computeOutAndReduceShapes(u,c),A=upcastType(n,"int32"),v=makeZerosTypedArray(sizeFromShape(f),A),y=sizeFromShape(g);for(let T=0;Ts.disposeIntermediateTensorInfo(B)),s.makeTensorInfo(U,O,N)}const prodConfig$1={kernelName:Prod,backendName:"cpu",kernelFunc:prod$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9974,7 +9974,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * limitations under the License. * ============================================================================= */function sparseFillEmptyRowsImpl(u,n,s,c,f,g,A){const v=n[0],y=g[0],T=new Array(y),I=new Array(v),S=n[1];if(y===0){if(v!==0)throw new Error(`Received SparseTensor with denseShape[0] = 0 but - indices.shape[0] = ${v}`);const O=getArrayFromDType(s,0),z=getArrayFromDType(f,0);return[O,[0,S],z,T,I]}let k=!0,e=0;const N=new Array(y).fill(0);for(let O=0;O=y)throw new Error(`indices(${O}, 0) is invalid: ${z} >= ${y}`);++N[z],k=k&&z>=e,e=z}let M=!0;for(let O=0;O0&&(N[O]+=N[O-1])}if(M&&k){const O=u,z=c;for(let B=0;B=y)throw new Error(`indices(${O}, 0) is invalid: ${U} >= ${y}`);++N[U],k=k&&U>=e,e=U}let M=!0;for(let O=0;O0&&(N[O]+=N[O-1])}if(M&&k){const O=u,U=c;for(let B=0;B0){e[k-1]=1;for(let O=k-2;O>=0;--O)e[O]=e[O+1]*c[O+1]}const N=[];if(v>0){N[v-1]=1;for(let O=v-2;O>=0;--O)N[O]=N[O+1]*y[O+1]}const M=getArrayFromDType(s,A*v);for(let O=0;O0){e[k-1]=1;for(let O=k-2;O>=0;--O)e[O]=e[O+1]*c[O+1]}const N=[];if(v>0){N[v-1]=1;for(let O=v-2;O>=0;--O)N[O]=N[O+1]*y[O+1]}const M=getArrayFromDType(s,A*v);for(let O=0;O0?f[v-1]+1:0;if(S<0)throw new Error("segment ids must be >= 0");const k=n.slice();k[0]=S;const e=k.reduce((V,b)=>V*b,1),N=getArrayFromDType(s,e);if(v===0)return S>0&&N.fill(A),[N,k];if(S<=0)throw new Error("segment ids must be >= 0");let M=0,O=1,z=0,B=f[M];for(;;){let V=0;if(O=V)throw new Error("segment ids are not increasing")}if(B<0||B>=S)throw new Error(`Segment id ${B} out of range [0, ${S}), possibly because segmentIds input is not sorted.`);B>z&&N.fill(A,z*T,B*T);for(let b=M;b=y[0])throw new Error(`Bad: indices[${b}] == ${c[b]} out of range [0, ${y[0]})`);for(let q=0;qv)break}return z0?f[v-1]+1:0;if(S<0)throw new Error("segment ids must be >= 0");const k=n.slice();k[0]=S;const e=k.reduce((V,b)=>V*b,1),N=getArrayFromDType(s,e);if(v===0)return S>0&&N.fill(A),[N,k];if(S<=0)throw new Error("segment ids must be >= 0");let M=0,O=1,U=0,B=f[M];for(;;){let V=0;if(O=V)throw new Error("segment ids are not increasing")}if(B<0||B>=S)throw new Error(`Segment id ${B} out of range [0, ${S}), possibly because segmentIds input is not sorted.`);B>U&&N.fill(A,U*T,B*T);for(let b=M;b=y[0])throw new Error(`Bad: indices[${b}] == ${c[b]} out of range [0, ${y[0]})`);for(let q=0;qv)break}return U0?0:v-y);let e=0;e+=T*this.leftPad.length;for(let B=0;BB.forEach(V=>M[O++]=V);for(let B=0;B0){z(n[k+S-1]);for(let B=0;B0){let y=s[0];if(y!==0)throw new Error(`First split value must be 0, got ${y}`);for(let T=1;T=y;if(I=I&&s[T]<=c,!I)throw new Error(`Invalid split value ${s[T]}, must be in [${y}, ${c}]`);y=s[T]}if(y!==c)throw new Error(`Last split value must be data size. Expected ${c}, got ${y}`)}const g=f-1,A=getArrayFromDType("int32",f);if(c===0||f===0){const y=new Array(c);for(let T=0;T<=g;++T)A[T]=0;return[y,A]}A[0]=0;for(let y=1;y<=g;++y){const T=s[y]-s[y-1];let I=0;this.nGramWidths.forEach(S=>{I+=this.getNumNGrams(T,S)}),this.preserveShort&&T>0&&I===0&&(I=1),A[y]=A[y-1]+I}const v=new Array(A[g]);for(let y=0;y{const k=s[y+1]-s[y],e=this.getNumNGrams(k,S);this.createNGrams(n,T,v,I,e,S),I+=e}),this.preserveShort&&I===A[y]){const S=s[y+1]-s[y];if(S===0)continue;const k=S+2*this.padWidth;this.createNGrams(n,T,v,I,1,k)}}return[v,A]}}function stringNGramsImpl(u,n,s,c,f,g,A,v){return new StringNGramsOp(s,c,f,g,A,v).compute(u,n)}/** + */class StringNGramsOp{constructor(n,s,c,f,g,A){this.separator=encodeString(n),this.nGramWidths=s,this.leftPad=encodeString(c),this.rightPad=encodeString(f),this.padWidth=g,this.preserveShort=A}getPadWidth(n){return Math.min(this.padWidth<0?n-1:this.padWidth,n-1)}getNumNGrams(n,s){const c=this.getPadWidth(s);return Math.max(0,n+2*c-s+1)}createNGrams(n,s,c,f,g,A){for(let v=0;v0?0:v-y);let e=0;e+=T*this.leftPad.length;for(let B=0;BB.forEach(V=>M[O++]=V);for(let B=0;B0){U(n[k+S-1]);for(let B=0;B0){let y=s[0];if(y!==0)throw new Error(`First split value must be 0, got ${y}`);for(let T=1;T=y;if(I=I&&s[T]<=c,!I)throw new Error(`Invalid split value ${s[T]}, must be in [${y}, ${c}]`);y=s[T]}if(y!==c)throw new Error(`Last split value must be data size. Expected ${c}, got ${y}`)}const g=f-1,A=getArrayFromDType("int32",f);if(c===0||f===0){const y=new Array(c);for(let T=0;T<=g;++T)A[T]=0;return[y,A]}A[0]=0;for(let y=1;y<=g;++y){const T=s[y]-s[y-1];let I=0;this.nGramWidths.forEach(S=>{I+=this.getNumNGrams(T,S)}),this.preserveShort&&T>0&&I===0&&(I=1),A[y]=A[y-1]+I}const v=new Array(A[g]);for(let y=0;y{const k=s[y+1]-s[y],e=this.getNumNGrams(k,S);this.createNGrams(n,T,v,I,e,S),I+=e}),this.preserveShort&&I===A[y]){const S=s[y+1]-s[y];if(S===0)continue;const k=S+2*this.padWidth;this.createNGrams(n,T,v,I,1,k)}}return[v,A]}}function stringNGramsImpl(u,n,s,c,f,g,A,v){return new StringNGramsOp(s,c,f,g,A,v).compute(u,n)}/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10140,7 +10140,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const comparePair=(u,n)=>{const s=n.value-u.value;return s===0?u.index-n.index:s};function select$2(u,n,s=0,c=u.length-1){for(;c>s;){if(c-s>600){const v=c-s+1,y=n-s+1,T=Math.log(v),I=.5*Math.exp(2*T/3),S=.5*Math.sqrt(T*I*(v-I)/v)*Math.sign(y-v/2),k=Math.max(s,Math.floor(n-y*I/v+S)),e=Math.min(c,Math.floor(n+(v-y)*I/v+S));select$2(u,n,k,e)}const f=u[n];let g=s,A=c;for(swap(u,s,n),comparePair(u[c],f)>0&&swap(u,s,c);g0;)A=A-1}comparePair(u[s],f)===0?swap(u,s,A):(A=A+1,swap(u,A,c)),A<=n&&(s=A+1),n<=A&&(c=A-1)}}function topKImpl(u,n,s,c,f){const g=n[n.length-1],[A,v]=[u.length/g,g],y=getTypedArrayFromDType(s,A*c),T=getTypedArrayFromDType("int32",A*c);for(let S=0;SN[V]={value:B,index:V}),c{const s=n.value-u.value;return s===0?u.index-n.index:s};function select$2(u,n,s=0,c=u.length-1){for(;c>s;){if(c-s>600){const v=c-s+1,y=n-s+1,T=Math.log(v),I=.5*Math.exp(2*T/3),S=.5*Math.sqrt(T*I*(v-I)/v)*Math.sign(y-v/2),k=Math.max(s,Math.floor(n-y*I/v+S)),e=Math.min(c,Math.floor(n+(v-y)*I/v+S));select$2(u,n,k,e)}const f=u[n];let g=s,A=c;for(swap(u,s,n),comparePair(u[c],f)>0&&swap(u,s,c);g0;)A=A-1}comparePair(u[s],f)===0?swap(u,s,A):(A=A+1,swap(u,A,c)),A<=n&&(s=A+1),n<=A&&(c=A-1)}}function topKImpl(u,n,s,c,f){const g=n[n.length-1],[A,v]=[u.length/g,g],y=getTypedArrayFromDType(s,A*c),T=getTypedArrayFromDType("int32",A*c);for(let S=0;SN[V]={value:B,index:V}),c{for(let O=0;O{for(let O=0;O=2&&T>=2&&B,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${N}) and (${M}).`);const b=(O>z?f.shape.slice(0,-2):g.shape.slice(0,-2)).concat([k,e]);assert$1(I===S,()=>`Error in matMul: inner shapes (${I}) and (${S}) of Tensors with shapes ${f.shape} and ${g.shape} and transposeA=${A} and transposeB=${v} must match.`);const W=A?[O,I,k]:[O,k,I],q=v?[z,e,S]:[z,S,e],Y=reshape$1({inputs:{x:f},backend:s,attrs:{shape:W}}),X=reshape$1({inputs:{x:g},backend:s,attrs:{shape:q}}),Q=A?Y.shape[1]:Y.shape[2],m=A?Y.shape[2]:Y.shape[1],Z=v?X.shape[1]:X.shape[2],ee=Math.max(O,z),oe=s.data.get(Y.dataId).values,fe=s.data.get(X.dataId).values,me=computeStrides(Y.shape),pe=computeStrides(X.shape),[Se,xe,we]=A?[me[0],1,me[1]]:[me[0],me[1],1],[Fe,De,Ze]=v?[1,pe[1],pe[0]]:[pe[1],1,pe[0]],nt=m*Z,Ue=buffer([ee,m,Z],Y.dtype),ye=Ue.values,at=s.blockSize;for(let ft=0;ft=2&&T>=2&&B,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${N}) and (${M}).`);const b=(O>U?f.shape.slice(0,-2):g.shape.slice(0,-2)).concat([k,e]);assert$1(I===S,()=>`Error in matMul: inner shapes (${I}) and (${S}) of Tensors with shapes ${f.shape} and ${g.shape} and transposeA=${A} and transposeB=${v} must match.`);const W=A?[O,I,k]:[O,k,I],q=v?[U,e,S]:[U,S,e],Y=reshape$1({inputs:{x:f},backend:s,attrs:{shape:W}}),X=reshape$1({inputs:{x:g},backend:s,attrs:{shape:q}}),Q=A?Y.shape[1]:Y.shape[2],m=A?Y.shape[2]:Y.shape[1],Z=v?X.shape[1]:X.shape[2],ee=Math.max(O,U),oe=s.data.get(Y.dataId).values,fe=s.data.get(X.dataId).values,me=computeStrides(Y.shape),pe=computeStrides(X.shape),[Se,xe,we]=A?[me[0],1,me[1]]:[me[0],me[1],1],[Fe,De,Ze]=v?[1,pe[1],pe[0]]:[pe[1],1,pe[0]],nt=m*Z,Ue=buffer([ee,m,Z],Y.dtype),ye=Ue.values,at=s.blockSize;for(let ft=0;ftB&&(B=W,V=b)}e[O]=V}return T.forEach(O=>s.disposeIntermediateTensorInfo(O)),s.makeTensorInfo(I,"int32",e)}const argMaxConfig$1={kernelName:ArgMax,backendName:"cpu",kernelFunc:argMax$1};/** + */function argMax$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g}=c;assertNotComplex$1(f,"argMax");let A=parseAxisParam(g,f.shape);const v=getAxesPermutation(A,f.shape.length);let y=f;const T=[];v!=null&&(y=transpose$1({inputs:{x:f},backend:s,attrs:{perm:v}}),T.push(y),A=getInnerMostAxes(A.length,y.shape.length)),A=[A[0]],assertAxesAreInnerMostDims("argMax",A,y.shape.length);const[I,S]=computeOutAndReduceShapes(y.shape,A),k=sizeFromShape(I),e=makeZerosTypedArray(k,"int32"),N=sizeFromShape(S),M=s.data.get(y.dataId).values;for(let O=0;OB&&(B=W,V=b)}e[O]=V}return T.forEach(O=>s.disposeIntermediateTensorInfo(O)),s.makeTensorInfo(I,"int32",e)}const argMaxConfig$1={kernelName:ArgMax,backendName:"cpu",kernelFunc:argMax$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10425,7 +10425,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function argMin$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g}=c;assertNotComplex$1(f,"argMin");let A=parseAxisParam(g,f.shape);const v=getAxesPermutation(A,f.shape.length);let y=f;const T=[];v!=null&&(y=transpose$1({inputs:{x:f},backend:s,attrs:{perm:v}}),T.push(y),A=getInnerMostAxes(A.length,y.shape.length)),A=[A[0]],assertAxesAreInnerMostDims("argMin",A,y.shape.length);const[I,S]=computeOutAndReduceShapes(y.shape,A),k=sizeFromShape(I),e=makeZerosTypedArray(k,"int32"),N=sizeFromShape(S),M=s.data.get(y.dataId).values;for(let O=0;Os.disposeIntermediateTensorInfo(O)),s.makeTensorInfo(I,"int32",e)}const argMinConfig$1={kernelName:ArgMin,backendName:"cpu",kernelFunc:argMin$1};/** + */function argMin$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g}=c;assertNotComplex$1(f,"argMin");let A=parseAxisParam(g,f.shape);const v=getAxesPermutation(A,f.shape.length);let y=f;const T=[];v!=null&&(y=transpose$1({inputs:{x:f},backend:s,attrs:{perm:v}}),T.push(y),A=getInnerMostAxes(A.length,y.shape.length)),A=[A[0]],assertAxesAreInnerMostDims("argMin",A,y.shape.length);const[I,S]=computeOutAndReduceShapes(y.shape,A),k=sizeFromShape(I),e=makeZerosTypedArray(k,"int32"),N=sizeFromShape(S),M=s.data.get(y.dataId).values;for(let O=0;Os.disposeIntermediateTensorInfo(O)),s.makeTensorInfo(I,"int32",e)}const argMinConfig$1={kernelName:ArgMin,backendName:"cpu",kernelFunc:argMin$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); @@ -10515,7 +10515,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function pool(u,n,s,c,f,g){const A=f.strideHeight,v=f.strideWidth,y=f.dilationHeight,T=f.dilationWidth,I=f.effectiveFilterHeight,S=f.effectiveFilterWidth,k=f.padInfo.top,e=f.padInfo.left,N=g==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,M=buffer(f.outShape,s),O=M.values,z=f.outShape[1]*f.outShape[2]*f.outShape[3],B=f.outShape[2]*f.outShape[3],V=f.outShape[3];for(let b=0;bSe?Se=ye:g==="avg"&&(xe+=ye,we++)}if(isNaN(Se))break}const Fe=ee+oe*V+Y;O[Fe]=g==="avg"?xe/we:Se}}}return M}function maxPoolPositions(u,n,s,c,f=!1,g=!1){const A=buffer(c.outShape,"int32"),v=c.strideHeight,y=c.strideWidth,T=c.dilationHeight,I=c.dilationWidth,S=c.effectiveFilterHeight,k=c.effectiveFilterWidth,e=c.padInfo.top,N=c.padInfo.left,M=buffer(n,s,u);for(let O=0;Om&&(m=pe,f?Z=g?((O*c.inHeight+ee)*c.inWidth+fe)*c.inChannels+z:(ee*c.inWidth+fe)*c.inChannels+z:Z=oe*k+me)}}A.set(Z,O,B,q,z)}}return A}function pool3d(u,n,s,c,f,g){const A=f.strideDepth,v=f.strideHeight,y=f.strideWidth,T=f.dilationDepth,I=f.dilationHeight,S=f.dilationWidth,k=f.effectiveFilterDepth,e=f.effectiveFilterHeight,N=f.effectiveFilterWidth,M=f.padInfo.front,O=f.padInfo.top,z=f.padInfo.left,B=g==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,V=buffer(f.outShape,s),b=V.values,W=f.outShape[1]*f.outShape[2]*f.outShape[3]*f.outShape[4],q=f.outShape[2]*f.outShape[3]*f.outShape[4],Y=f.outShape[3]*f.outShape[4],X=f.outShape[4];for(let Q=0;QTt?Tt=lt:g==="avg"&&(Lt+=lt,Ot++),isNaN(Tt))break}if(isNaN(Tt))break}if(isNaN(Tt))break}const Ft=ft+ee;b[Ft]=g==="avg"?Lt/Ot:Tt}}}}return V}function maxPool3dPositions(u,n){const s=buffer(n.outShape,"int32"),c=n.strideDepth,f=n.strideHeight,g=n.strideWidth,A=n.dilationDepth,v=n.dilationHeight,y=n.dilationWidth,T=n.effectiveFilterDepth,I=n.effectiveFilterHeight,S=n.effectiveFilterWidth,k=n.padInfo.front,e=n.padInfo.top,N=n.padInfo.left;for(let M=0;M=oe&&(oe=De,fe=pe*I*S+xe*I+Fe)}}}s.set(fe,M,z,W,Q,O)}}}return s}/** + */function pool(u,n,s,c,f,g){const A=f.strideHeight,v=f.strideWidth,y=f.dilationHeight,T=f.dilationWidth,I=f.effectiveFilterHeight,S=f.effectiveFilterWidth,k=f.padInfo.top,e=f.padInfo.left,N=g==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,M=buffer(f.outShape,s),O=M.values,U=f.outShape[1]*f.outShape[2]*f.outShape[3],B=f.outShape[2]*f.outShape[3],V=f.outShape[3];for(let b=0;bSe?Se=ye:g==="avg"&&(xe+=ye,we++)}if(isNaN(Se))break}const Fe=ee+oe*V+Y;O[Fe]=g==="avg"?xe/we:Se}}}return M}function maxPoolPositions(u,n,s,c,f=!1,g=!1){const A=buffer(c.outShape,"int32"),v=c.strideHeight,y=c.strideWidth,T=c.dilationHeight,I=c.dilationWidth,S=c.effectiveFilterHeight,k=c.effectiveFilterWidth,e=c.padInfo.top,N=c.padInfo.left,M=buffer(n,s,u);for(let O=0;Om&&(m=pe,f?Z=g?((O*c.inHeight+ee)*c.inWidth+fe)*c.inChannels+U:(ee*c.inWidth+fe)*c.inChannels+U:Z=oe*k+me)}}A.set(Z,O,B,q,U)}}return A}function pool3d(u,n,s,c,f,g){const A=f.strideDepth,v=f.strideHeight,y=f.strideWidth,T=f.dilationDepth,I=f.dilationHeight,S=f.dilationWidth,k=f.effectiveFilterDepth,e=f.effectiveFilterHeight,N=f.effectiveFilterWidth,M=f.padInfo.front,O=f.padInfo.top,U=f.padInfo.left,B=g==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,V=buffer(f.outShape,s),b=V.values,W=f.outShape[1]*f.outShape[2]*f.outShape[3]*f.outShape[4],q=f.outShape[2]*f.outShape[3]*f.outShape[4],Y=f.outShape[3]*f.outShape[4],X=f.outShape[4];for(let Q=0;QTt?Tt=lt:g==="avg"&&(Lt+=lt,Ot++),isNaN(Tt))break}if(isNaN(Tt))break}if(isNaN(Tt))break}const Ft=ft+ee;b[Ft]=g==="avg"?Lt/Ot:Tt}}}}return V}function maxPool3dPositions(u,n){const s=buffer(n.outShape,"int32"),c=n.strideDepth,f=n.strideHeight,g=n.strideWidth,A=n.dilationDepth,v=n.dilationHeight,y=n.dilationWidth,T=n.effectiveFilterDepth,I=n.effectiveFilterHeight,S=n.effectiveFilterWidth,k=n.padInfo.front,e=n.padInfo.top,N=n.padInfo.left;for(let M=0;M=oe&&(oe=De,fe=pe*I*S+xe*I+Fe)}}}s.set(fe,M,U,W,Q,O)}}}return s}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10560,7 +10560,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function avgPool3DGrad$1(u){const{inputs:n,backend:s,attrs:c}=u,{dy:f,input:g}=n,{filterSize:A,strides:v,pad:y,dimRoundingMode:T}=c;assertNotComplex$1([f,g],"avgPool3DGrad");const I=computePool3DInfo(g.shape,A,v,1,y,T),S=I.strideDepth,k=I.strideHeight,e=I.strideWidth,N=I.filterDepth,M=I.filterHeight,O=I.filterWidth,z=I.dilationDepth,B=I.dilationHeight,V=I.dilationWidth,b=I.effectiveFilterDepth,W=I.effectiveFilterHeight,q=I.effectiveFilterWidth,Y=b-1-I.padInfo.front,X=q-1-I.padInfo.left,Q=W-1-I.padInfo.top,m=buffer(g.shape,"float32"),Z=1/(N*M*O),ee=s.bufferSync(f);for(let oe=0;oe=I.outDepth||Math.floor(nt)!==nt))for(let Ue=0;Ue=I.outHeight||Math.floor(ye)!==ye))for(let at=0;at=I.outWidth||Math.floor(ft)!==ft)continue;const Tt=ee.get(oe,nt,ye,ft,fe);De+=Tt}}}m.set(De*Z,oe,me,pe,Se,fe)}return s.makeTensorInfo(m.shape,m.dtype,m.values)}const avgPool3DGradConfig={kernelName:AvgPool3DGrad,backendName:"cpu",kernelFunc:avgPool3DGrad$1};/** + */function avgPool3DGrad$1(u){const{inputs:n,backend:s,attrs:c}=u,{dy:f,input:g}=n,{filterSize:A,strides:v,pad:y,dimRoundingMode:T}=c;assertNotComplex$1([f,g],"avgPool3DGrad");const I=computePool3DInfo(g.shape,A,v,1,y,T),S=I.strideDepth,k=I.strideHeight,e=I.strideWidth,N=I.filterDepth,M=I.filterHeight,O=I.filterWidth,U=I.dilationDepth,B=I.dilationHeight,V=I.dilationWidth,b=I.effectiveFilterDepth,W=I.effectiveFilterHeight,q=I.effectiveFilterWidth,Y=b-1-I.padInfo.front,X=q-1-I.padInfo.left,Q=W-1-I.padInfo.top,m=buffer(g.shape,"float32"),Z=1/(N*M*O),ee=s.bufferSync(f);for(let oe=0;oe=I.outDepth||Math.floor(nt)!==nt))for(let Ue=0;Ue=I.outHeight||Math.floor(ye)!==ye))for(let at=0;at=I.outWidth||Math.floor(ft)!==ft)continue;const Tt=ee.get(oe,nt,ye,ft,fe);De+=Tt}}}m.set(De*Z,oe,me,pe,Se,fe)}return s.makeTensorInfo(m.shape,m.dtype,m.values)}const avgPool3DGradConfig={kernelName:AvgPool3DGrad,backendName:"cpu",kernelFunc:avgPool3DGrad$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10575,7 +10575,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function avgPoolGrad$1(u){const{inputs:n,backend:s,attrs:c}=u,{dy:f,input:g}=n,A=g;assertNotComplex$1([f,g],"avgPoolGrad");const{filterSize:v,strides:y,pad:T}=c,I=computePool2DInfo(A.shape,v,y,1,T),S=I.strideHeight,k=I.strideWidth,e=I.filterHeight,N=I.filterWidth,M=I.dilationHeight,O=I.dilationWidth,z=I.effectiveFilterHeight,B=I.effectiveFilterWidth,V=B-1-I.padInfo.left,b=z-1-I.padInfo.top,W=buffer(A.shape,"float32"),q=1/(e*N),Y=s.data.get(f.dataId).values,X=buffer(f.shape,"float32",Y);for(let Q=0;Q=I.outHeight||Math.floor(Se)!==Se))for(let xe=0;xe=I.outWidth||Math.floor(we)!==we)continue;const Fe=X.get(Q,Se,we,m);me+=Fe}}W.set(me*q,Q,Z,ee,m)}return s.makeTensorInfo(W.shape,W.dtype,W.values)}const avgPoolGradConfig$1={kernelName:AvgPoolGrad,backendName:"cpu",kernelFunc:avgPoolGrad$1};/** + */function avgPoolGrad$1(u){const{inputs:n,backend:s,attrs:c}=u,{dy:f,input:g}=n,A=g;assertNotComplex$1([f,g],"avgPoolGrad");const{filterSize:v,strides:y,pad:T}=c,I=computePool2DInfo(A.shape,v,y,1,T),S=I.strideHeight,k=I.strideWidth,e=I.filterHeight,N=I.filterWidth,M=I.dilationHeight,O=I.dilationWidth,U=I.effectiveFilterHeight,B=I.effectiveFilterWidth,V=B-1-I.padInfo.left,b=U-1-I.padInfo.top,W=buffer(A.shape,"float32"),q=1/(e*N),Y=s.data.get(f.dataId).values,X=buffer(f.shape,"float32",Y);for(let Q=0;Q=I.outHeight||Math.floor(Se)!==Se))for(let xe=0;xe=I.outWidth||Math.floor(we)!==we)continue;const Fe=X.get(Q,Se,we,m);me+=Fe}}W.set(me*q,Q,Z,ee,m)}return s.makeTensorInfo(W.shape,W.dtype,W.values)}const avgPoolGradConfig$1={kernelName:AvgPoolGrad,backendName:"cpu",kernelFunc:avgPoolGrad$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10590,7 +10590,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function batchNorm$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,scale:g,offset:A,mean:v,variance:y}=n;assert$1(v.shape.length===y.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),assert$1(A==null||v.shape.length===A.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),assert$1(g==null||v.shape.length===g.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),assertNotComplex$1([f,v,y,g,A],"batchNorm");let{varianceEpsilon:T}=c;T==null&&(T=.001);const I=s.data.get(f.dataId).values,S=s.data.get(v.dataId).values,k=s.data.get(y.dataId).values,e=g?s.data.get(g.dataId).values:new Float32Array([1]),N=A?s.data.get(A.dataId).values:new Float32Array([0]),M=new Float32Array(I.length),O=N.length,z=e.length,B=k.length,V=S.length;let b=0,W=0,q=0,Y=0;for(let X=0;X=O&&(b=0),W>=V&&(W=0),q>=z&&(q=0),Y>=B&&(Y=0);return s.makeTensorInfo(f.shape,f.dtype,M)}const batchNormConfig$1={kernelName:FusedBatchNorm,backendName:"cpu",kernelFunc:batchNorm$1};/** + */function batchNorm$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,scale:g,offset:A,mean:v,variance:y}=n;assert$1(v.shape.length===y.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),assert$1(A==null||v.shape.length===A.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),assert$1(g==null||v.shape.length===g.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),assertNotComplex$1([f,v,y,g,A],"batchNorm");let{varianceEpsilon:T}=c;T==null&&(T=.001);const I=s.data.get(f.dataId).values,S=s.data.get(v.dataId).values,k=s.data.get(y.dataId).values,e=g?s.data.get(g.dataId).values:new Float32Array([1]),N=A?s.data.get(A.dataId).values:new Float32Array([0]),M=new Float32Array(I.length),O=N.length,U=e.length,B=k.length,V=S.length;let b=0,W=0,q=0,Y=0;for(let X=0;X=O&&(b=0),W>=V&&(W=0),q>=U&&(q=0),Y>=B&&(Y=0);return s.makeTensorInfo(f.shape,f.dtype,M)}const batchNormConfig$1={kernelName:FusedBatchNorm,backendName:"cpu",kernelFunc:batchNorm$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10605,7 +10605,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function batchToSpaceND$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{blockShape:g,crops:A}=c;assertNotComplex$1([f],"batchToSpaceND");const v=g.reduce((z,B)=>z*B),y=getReshaped(f.shape,g,v),T=getPermuted(y.length,g.length),I=getReshapedPermuted(f.shape,g,v),S=getSliceBeginCoords(A,g.length),k=getSliceSize(I,A,g.length),e=reshape$1({inputs:{x:f},backend:s,attrs:{shape:y}}),N=transpose$1({inputs:{x:e},backend:s,attrs:{perm:T}}),M=reshape$1({inputs:{x:N},backend:s,attrs:{shape:I}}),O=slice$1({inputs:{x:M},backend:s,attrs:{begin:S,size:k}});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(N),s.disposeIntermediateTensorInfo(M),O}const batchToSpaceNDConfig$1={kernelName:BatchToSpaceND,backendName:"cpu",kernelFunc:batchToSpaceND$1};/** + */function batchToSpaceND$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{blockShape:g,crops:A}=c;assertNotComplex$1([f],"batchToSpaceND");const v=g.reduce((U,B)=>U*B),y=getReshaped(f.shape,g,v),T=getPermuted(y.length,g.length),I=getReshapedPermuted(f.shape,g,v),S=getSliceBeginCoords(A,g.length),k=getSliceSize(I,A,g.length),e=reshape$1({inputs:{x:f},backend:s,attrs:{shape:y}}),N=transpose$1({inputs:{x:e},backend:s,attrs:{perm:T}}),M=reshape$1({inputs:{x:N},backend:s,attrs:{shape:I}}),O=slice$1({inputs:{x:M},backend:s,attrs:{begin:S,size:k}});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(N),s.disposeIntermediateTensorInfo(M),O}const batchToSpaceNDConfig$1={kernelName:BatchToSpaceND,backendName:"cpu",kernelFunc:batchToSpaceND$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10695,7 +10695,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function concat$1(u){const{inputs:n,backend:s,attrs:c}=u,{axis:f}=c,g=parseAxisParam(f,n[0].shape)[0];let A=computeOutShape$1(n.map(M=>M.shape),g);if(sizeFromShape(A)===0)return s.makeTensorInfo(A,n[0].dtype,[]);const v=n.filter(M=>sizeFromShape(M.shape)>0);if(v.length===1)return identity$1({inputs:{x:v[0]},backend:s});const y=v.map(M=>M.shape);if(assertParamsConsistent(y,g),v[0].dtype==="complex64"){const M=v.map(b=>real$1({inputs:{input:b},backend:s})),O=v.map(b=>imag$1({inputs:{input:b},backend:s})),z=concat$1({inputs:M,backend:s,attrs:{axis:g}}),B=concat$1({inputs:O,backend:s,attrs:{axis:g}}),V=complex$1({inputs:{real:z,imag:B},backend:s});return M.forEach(b=>s.disposeIntermediateTensorInfo(b)),O.forEach(b=>s.disposeIntermediateTensorInfo(b)),s.disposeIntermediateTensorInfo(z),s.disposeIntermediateTensorInfo(B),V}const T=v.map(M=>{const z=[-1,sizeFromShape(M.shape.slice(g))];return reshape$1({inputs:{x:M},backend:s,attrs:{shape:z}})}),I=T.map(M=>({vals:s.data.get(M.dataId).values,shape:M.shape}));A=computeOutShape$1(T.map(M=>M.shape),1);const S=T[0].shape[0]===1,k=concatImpl$1(I,A,n[0].dtype,S),e=computeOutShape$1(v.map(M=>M.shape),g),N=s.makeTensorInfo(e,n[0].dtype,k);return T.forEach(M=>s.disposeIntermediateTensorInfo(M)),N}const concatConfig$1={kernelName:Concat,backendName:"cpu",kernelFunc:concat$1};/** + */function concat$1(u){const{inputs:n,backend:s,attrs:c}=u,{axis:f}=c,g=parseAxisParam(f,n[0].shape)[0];let A=computeOutShape$1(n.map(M=>M.shape),g);if(sizeFromShape(A)===0)return s.makeTensorInfo(A,n[0].dtype,[]);const v=n.filter(M=>sizeFromShape(M.shape)>0);if(v.length===1)return identity$1({inputs:{x:v[0]},backend:s});const y=v.map(M=>M.shape);if(assertParamsConsistent(y,g),v[0].dtype==="complex64"){const M=v.map(b=>real$1({inputs:{input:b},backend:s})),O=v.map(b=>imag$1({inputs:{input:b},backend:s})),U=concat$1({inputs:M,backend:s,attrs:{axis:g}}),B=concat$1({inputs:O,backend:s,attrs:{axis:g}}),V=complex$1({inputs:{real:U,imag:B},backend:s});return M.forEach(b=>s.disposeIntermediateTensorInfo(b)),O.forEach(b=>s.disposeIntermediateTensorInfo(b)),s.disposeIntermediateTensorInfo(U),s.disposeIntermediateTensorInfo(B),V}const T=v.map(M=>{const U=[-1,sizeFromShape(M.shape.slice(g))];return reshape$1({inputs:{x:M},backend:s,attrs:{shape:U}})}),I=T.map(M=>({vals:s.data.get(M.dataId).values,shape:M.shape}));A=computeOutShape$1(T.map(M=>M.shape),1);const S=T[0].shape[0]===1,k=concatImpl$1(I,A,n[0].dtype,S),e=computeOutShape$1(v.map(M=>M.shape),g),N=s.makeTensorInfo(e,n[0].dtype,k);return T.forEach(M=>s.disposeIntermediateTensorInfo(M)),N}const concatConfig$1={kernelName:Concat,backendName:"cpu",kernelFunc:concat$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10710,7 +10710,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function conv2D(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,filter:g}=n,{strides:A,pad:v,dataFormat:y,dilations:T,dimRoundingMode:I}=c;assertNotComplex$1([f,g],"conv2d");const S=convertConv2DDataFormat(y),k=computeConv2DInfo(f.shape,g.shape,A,T,v,I,!1,S),e=k.filterHeight,N=k.filterWidth,M=k.dilationHeight,O=k.dilationWidth,z=k.padInfo.left,B=k.padInfo.top,V=k.dataFormat==="channelsLast",b=new TensorBuffer(k.outShape,f.dtype),W=computeStrides(f.shape),q=computeStrides(g.shape),Y=W[0],X=V?W[1]:W[2],Q=V?W[2]:1,m=V?1:W[1],Z=b.strides[0],ee=V?b.strides[1]:b.strides[2],oe=V?b.strides[2]:1,fe=V?1:b.strides[1],me=s.data.get(f.dataId).values,pe=s.data.get(g.dataId).values,Se=b.values;for(let xe=0;xe=k.inHeight)continue;const at=Ue*q[0],ft=we+ye*X;for(let Tt=0;Tt=k.inWidth)continue;const Ke=at+Ft*q[1],Re=ft+Mt*Q;let Qe=Ke;for(let Ie=0;Ie=k.inHeight)continue;const at=Ue*q[0],ft=we+ye*X;for(let Tt=0;Tt=k.inWidth)continue;const Ke=at+Ft*q[1],Re=ft+Mt*Q;let Qe=Ke;for(let Ie=0;Ie=T.inDepth)continue;const xe=pe*Q[0],we=Z+Se*X[1];for(let Fe=0;Fe=T.inHeight)continue;const ye=xe+nt*Q[1],at=we+Ue*X[2];for(let ft=0;ft=T.inWidth)continue;const Mt=ye+Ot*Q[2],Ke=at+Ft*T.inChannels;let Re=Mt;for(let Qe=0;Qe=T.inDepth)continue;const xe=pe*Q[0],we=Z+Se*X[1];for(let Fe=0;Fe=T.inHeight)continue;const ye=xe+nt*Q[1],at=we+Ue*X[2];for(let ft=0;ft=T.inWidth)continue;const Mt=ye+Ot*Q[2],Ke=at+Ft*T.inChannels;let Re=Mt;for(let Qe=0;Qe=I)continue;const fe=M>1?(Z-Q)*(S-1)/(M-1):0,me=O>1?(ee-m)*(k-1)/(O-1):0;for(let pe=0;pe1?Q*(S-1)+pe*fe:.5*(Q+Z)*(S-1);if(Se<0||Se>S-1){for(let xe=0;xe1?m*(k-1)+De*me:.5*(m+ee)*(k-1);if(Ze<0||Ze>k-1){for(let at=0;at1?m*(k-1)+xe*me:.5*(m+ee)*(k-1);if(we<0||we>k-1){for(let Ze=0;Ze=I)continue;const fe=M>1?(Z-Q)*(S-1)/(M-1):0,me=O>1?(ee-m)*(k-1)/(O-1):0;for(let pe=0;pe1?Q*(S-1)+pe*fe:.5*(Q+Z)*(S-1);if(Se<0||Se>S-1){for(let xe=0;xe1?m*(k-1)+De*me:.5*(m+ee)*(k-1);if(Ze<0||Ze>k-1){for(let at=0;at1?m*(k-1)+xe*me:.5*(m+ee)*(k-1);if(we<0||we>k-1){for(let Ze=0;Zez+N-B-1:(z,B)=>z+B;for(let z=0;zU+N-B-1:(U,B)=>U+B;for(let U=0;U`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${A}`),assert$1(g>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${g}`);const v=f.shape[0],y=f.shape[1],T=f.shape[2],I=f.shape[3],S=y*g,k=T*g,e=I/(g*g),N=s.data.get(f.dataId).values,M=new Float32Array(v*S*k*e);let O=0;for(let z=0;z`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${A}`),assert$1(g>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${g}`);const v=f.shape[0],y=f.shape[1],T=f.shape[2],I=f.shape[3],S=y*g,k=T*g,e=I/(g*g),N=s.data.get(f.dataId).values,M=new Float32Array(v*S*k*e);let O=0;for(let U=0;U`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${A} and dilations '${k}'`);const e=computeConv2DInfo(f.shape,g.shape,A,k,v,T,!0),{filterHeight:N,filterWidth:M,dilationHeight:O,dilationWidth:z,padInfo:B}=e,V=B.left,b=B.top,W=e.outChannels/e.inChannels,q=new TensorBuffer(e.outShape,f.dtype),Y=s.data.get(f.dataId).values,X=s.data.get(g.dataId).values,Q=q.values;for(let m=0;m=e.inHeight)continue;const xe=pe*S[0],we=Z+Se*I[1];for(let Fe=0;Fe=e.inWidth)continue;const ye=xe+nt*S[1],at=we+Ue*e.inChannels;let ft=De,Tt=ye;for(let Lt=0;Lt`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${A} and dilations '${k}'`);const e=computeConv2DInfo(f.shape,g.shape,A,k,v,T,!0),{filterHeight:N,filterWidth:M,dilationHeight:O,dilationWidth:U,padInfo:B}=e,V=B.left,b=B.top,W=e.outChannels/e.inChannels,q=new TensorBuffer(e.outShape,f.dtype),Y=s.data.get(f.dataId).values,X=s.data.get(g.dataId).values,Q=q.values;for(let m=0;m=e.inHeight)continue;const xe=pe*S[0],we=Z+Se*I[1];for(let Fe=0;Fe=e.inWidth)continue;const ye=xe+nt*S[1],at=we+Ue*e.inChannels;let ft=De,Tt=ye;for(let Lt=0;Lt{const{x:c,filter:f}=u,{strides:g,pad:A,dilations:v}=s,y=n,T=y.data.get(c.dataId).values,I=c.shape.length,S=y.data.get(f.dataId).values,k=f.shape.length,{batchSize:e,inHeight:N,inWidth:M,inChannels:O,outHeight:z,outWidth:B,padInfo:V,strideHeight:b,strideWidth:W,filterHeight:q,filterWidth:Y,dilationHeight:X,dilationWidth:Q,outShape:m}=computeDilation2DInfo(c.shape,f.shape,g,A,"NHWC",v),Z=sizeFromShape(m),ee=m.length,oe=getArrayFromDType(c.dtype,Z);for(let me=0;me=0&&Ue=0&&atDe&&(De=Lt)}}}const Ze=locToIndex([me,pe,xe,Fe],ee,computeStrides(m));oe[Ze]=De}}}return{dataId:y.write(toTypedArray(oe,c.dtype),m,c.dtype),shape:m,dtype:c.dtype}}};/** + */const dilation2dConfig={kernelName:Dilation2D,backendName:"cpu",kernelFunc:({inputs:u,backend:n,attrs:s})=>{const{x:c,filter:f}=u,{strides:g,pad:A,dilations:v}=s,y=n,T=y.data.get(c.dataId).values,I=c.shape.length,S=y.data.get(f.dataId).values,k=f.shape.length,{batchSize:e,inHeight:N,inWidth:M,inChannels:O,outHeight:U,outWidth:B,padInfo:V,strideHeight:b,strideWidth:W,filterHeight:q,filterWidth:Y,dilationHeight:X,dilationWidth:Q,outShape:m}=computeDilation2DInfo(c.shape,f.shape,g,A,"NHWC",v),Z=sizeFromShape(m),ee=m.length,oe=getArrayFromDType(c.dtype,Z);for(let me=0;me=0&&Ue=0&&atDe&&(De=Lt)}}}const Ze=locToIndex([me,pe,xe,Fe],ee,computeStrides(m));oe[Ze]=De}}}return{dataId:y.write(toTypedArray(oe,c.dtype),m,c.dtype),shape:m,dtype:c.dtype}}};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10965,7 +10965,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const dilation2dBackpropFilterConfig={kernelName:Dilation2DBackpropFilter,backendName:"cpu",kernelFunc:({inputs:u,backend:n,attrs:s})=>{const{x:c,filter:f,dy:g}=u,{strides:A,pad:v,dilations:y}=s,T=n,I=toNestedArray(c.shape,T.data.get(c.dataId).values),S=toNestedArray(f.shape,T.data.get(f.dataId).values),{batchSize:k,inHeight:e,inWidth:N,inChannels:M,outHeight:O,outWidth:z,padInfo:B,strideHeight:V,strideWidth:b,filterHeight:W,filterWidth:q,dilationHeight:Y,dilationWidth:X,outShape:Q}=computeDilation2DInfo(c.shape,f.shape,A,v,"NHWC",y);assert$1(g.rank===Q.length,()=>`Error in ${Dilation2DBackpropFilter}, dy must have the same rank as output ${Q.length}, but got ${g.rank}`);const m=toNestedArray(Q,T.data.get(g.dataId).values),Z=makeZerosNestedTypedArray(f.shape,f.dtype);for(let oe=0;oe=0&&nt=0&&yewe&&(we=at,Fe=Ze,De=Ue)}}}Z[Fe][De][xe]+=m[oe][fe][pe][xe]}}}return{dataId:T.write(toTypedArray(Z,c.dtype),f.shape,f.dtype),shape:f.shape,dtype:f.dtype}}};/** + */const dilation2dBackpropFilterConfig={kernelName:Dilation2DBackpropFilter,backendName:"cpu",kernelFunc:({inputs:u,backend:n,attrs:s})=>{const{x:c,filter:f,dy:g}=u,{strides:A,pad:v,dilations:y}=s,T=n,I=toNestedArray(c.shape,T.data.get(c.dataId).values),S=toNestedArray(f.shape,T.data.get(f.dataId).values),{batchSize:k,inHeight:e,inWidth:N,inChannels:M,outHeight:O,outWidth:U,padInfo:B,strideHeight:V,strideWidth:b,filterHeight:W,filterWidth:q,dilationHeight:Y,dilationWidth:X,outShape:Q}=computeDilation2DInfo(c.shape,f.shape,A,v,"NHWC",y);assert$1(g.rank===Q.length,()=>`Error in ${Dilation2DBackpropFilter}, dy must have the same rank as output ${Q.length}, but got ${g.rank}`);const m=toNestedArray(Q,T.data.get(g.dataId).values),Z=makeZerosNestedTypedArray(f.shape,f.dtype);for(let oe=0;oe=0&&nt=0&&yewe&&(we=at,Fe=Ze,De=Ue)}}}Z[Fe][De][xe]+=m[oe][fe][pe][xe]}}}return{dataId:T.write(toTypedArray(Z,c.dtype),f.shape,f.dtype),shape:f.shape,dtype:f.dtype}}};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10980,7 +10980,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const dilation2dBackpropInputConfig={kernelName:Dilation2DBackpropInput,backendName:"cpu",kernelFunc:({inputs:u,backend:n,attrs:s})=>{const{x:c,filter:f,dy:g}=u,{strides:A,pad:v,dilations:y}=s,T=n,I=toNestedArray(c.shape,T.data.get(c.dataId).values),S=toNestedArray(f.shape,T.data.get(f.dataId).values),{batchSize:k,inHeight:e,inWidth:N,inChannels:M,outHeight:O,outWidth:z,padInfo:B,strideHeight:V,strideWidth:b,filterHeight:W,filterWidth:q,dilationHeight:Y,dilationWidth:X,outShape:Q}=computeDilation2DInfo(c.shape,f.shape,A,v,"NHWC",y);assert$1(g.rank===Q.length,()=>`Error in ${Dilation2DBackpropInput}, dy must have the same rank as output ${Q.length}, but got ${g.rank}`);const m=toNestedArray(Q,T.data.get(g.dataId).values),Z=makeZerosNestedTypedArray(c.shape,c.dtype);for(let oe=0;oe=0&&nt=0&&yewe&&(we=at,Fe=nt,De=ye)}}}Z[oe][Fe][De][xe]+=m[oe][fe][pe][xe]}}}return{dataId:T.write(toTypedArray(Z,c.dtype),c.shape,c.dtype),shape:c.shape,dtype:c.dtype}}};/** + */const dilation2dBackpropInputConfig={kernelName:Dilation2DBackpropInput,backendName:"cpu",kernelFunc:({inputs:u,backend:n,attrs:s})=>{const{x:c,filter:f,dy:g}=u,{strides:A,pad:v,dilations:y}=s,T=n,I=toNestedArray(c.shape,T.data.get(c.dataId).values),S=toNestedArray(f.shape,T.data.get(f.dataId).values),{batchSize:k,inHeight:e,inWidth:N,inChannels:M,outHeight:O,outWidth:U,padInfo:B,strideHeight:V,strideWidth:b,filterHeight:W,filterWidth:q,dilationHeight:Y,dilationWidth:X,outShape:Q}=computeDilation2DInfo(c.shape,f.shape,A,v,"NHWC",y);assert$1(g.rank===Q.length,()=>`Error in ${Dilation2DBackpropInput}, dy must have the same rank as output ${Q.length}, but got ${g.rank}`);const m=toNestedArray(Q,T.data.get(g.dataId).values),Z=makeZerosNestedTypedArray(c.shape,c.dtype);for(let oe=0;oe=0&&nt=0&&yewe&&(we=at,Fe=nt,De=ye)}}}Z[oe][Fe][De][xe]+=m[oe][fe][pe][xe]}}}return{dataId:T.write(toTypedArray(Z,c.dtype),c.shape,c.dtype),shape:c.shape,dtype:c.dtype}}};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -10995,7 +10995,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function sum$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,keepDims:A}=c;assertNotComplex$1(f,"sum");let v;f.dtype==="bool"?v=cast$1({inputs:{x:f},backend:s,attrs:{dtype:"int32"}}):v=identity$1({inputs:{x:f},backend:s});const y=v.shape.length,T=parseAxisParam(g,v.shape),I=getAxesPermutation(T,y);let S=T,k=v;I!=null&&(k=transpose$1({inputs:{x:v},backend:s,attrs:{perm:I}}),S=getInnerMostAxes(S.length,y)),assertAxesAreInnerMostDims("sum",S,k.shape.length);const[e,N]=computeOutAndReduceShapes(k.shape,S),M=upcastType(k.dtype,"int32");let O=zeros(s,e,M);const z=sizeFromShape(N),B=s.data.get(O.dataId).values,V=s.data.get(k.dataId).values;for(let b=0;b=0&&(k=sum$1({inputs:{x:k},backend:s,attrs:{axis:T[M]-(A.length-e),keepDims:!1}}),N.push(k)),e--)}for(const M of N)M!==k&&s.disposeIntermediateTensorInfo(M);return k}const einsumConfig$1={kernelName:Einsum,backendName:"cpu",kernelFunc:einsum$1};/** + */function einsum$1(u){const{inputs:n,backend:s,attrs:c}=u,{equation:f}=c,g=n,{allDims:A,summedDims:v,idDims:y}=decodeEinsumEquation(f,g.length);checkEinsumDimSizes(A.length,y,g);const{path:T,steps:I}=getEinsumComputePath(v,y),S=I.length;let k=null,e=A.length;const N=[];for(let M=0;M=0&&(k=sum$1({inputs:{x:k},backend:s,attrs:{axis:T[M]-(A.length-e),keepDims:!1}}),N.push(k)),e--)}for(const M of N)M!==k&&s.disposeIntermediateTensorInfo(M);return k}const einsumConfig$1={kernelName:Einsum,backendName:"cpu",kernelFunc:einsum$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -11085,7 +11085,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function fftBatch(u,n,s){const c=u.shape,f=c[0],g=c[1],A=s.data.get(u.dataId),v=A.complexTensorInfos.real,y=A.complexTensorInfos.imag,T=[f,g],I=sizeFromShape(T),S=getTypedArrayFromDType("float32",I),k=getTypedArrayFromDType("float32",I);for(let O=0;O{const{image:c}=u,f=s,g=getTypedArrayFromDType(c.dtype,sizeFromShape(c.shape)),[A,v,y,T]=c.shape,I=f.data.get(c.dataId).values;for(let k=0;k=0&&V{const{image:c}=u,f=s,g=getTypedArrayFromDType(c.dtype,sizeFromShape(c.shape)),[A,v,y,T]=c.shape,I=f.data.get(c.dataId).values;for(let k=0;k=0&&V=I.outDepth||Math.floor(De)!==De))for(let Ze=0;Ze=I.outHeight||Math.floor(nt)!==nt))for(let Ue=0;Ue=I.outWidth||Math.floor(ye)!==ye)continue;const at=V*b*W-1-k.get(Z,De,nt,ye,ee),ft=Fe*b*W+Ze*W+Ue,Tt=at===ft?1:0;if(Tt===0)continue;const Lt=m.get(Z,De,nt,ye,ee);we+=Lt*Tt}}}Q.set(we,Z,oe,fe,me,ee)}return s.makeTensorInfo(Q.shape,Q.dtype,Q.values)}const maxPool3DGradConfig={kernelName:MaxPool3DGrad,backendName:"cpu",kernelFunc:maxPool3DGrad$1};/** + */function maxPool3DGrad$1(u){const{inputs:n,backend:s,attrs:c}=u,{dy:f,input:g}=n,{filterSize:A,strides:v,pad:y,dimRoundingMode:T}=c;assertNotComplex$1([f,g],"maxPool3DGrad");const I=computePool3DInfo(g.shape,A,v,1,y,T),S=s.bufferSync(g),k=maxPool3dPositions(S,I),e=I.strideDepth,N=I.strideHeight,M=I.strideWidth,O=I.dilationDepth,U=I.dilationHeight,B=I.dilationWidth,V=I.effectiveFilterDepth,b=I.effectiveFilterHeight,W=I.effectiveFilterWidth,q=V-1-I.padInfo.front,Y=W-1-I.padInfo.left,X=b-1-I.padInfo.top,Q=buffer(g.shape,"float32"),m=s.bufferSync(f);for(let Z=0;Z=I.outDepth||Math.floor(De)!==De))for(let Ze=0;Ze=I.outHeight||Math.floor(nt)!==nt))for(let Ue=0;Ue=I.outWidth||Math.floor(ye)!==ye)continue;const at=V*b*W-1-k.get(Z,De,nt,ye,ee),ft=Fe*b*W+Ze*W+Ue,Tt=at===ft?1:0;if(Tt===0)continue;const Lt=m.get(Z,De,nt,ye,ee);we+=Lt*Tt}}}Q.set(we,Z,oe,fe,me,ee)}return s.makeTensorInfo(Q.shape,Q.dtype,Q.values)}const maxPool3DGradConfig={kernelName:MaxPool3DGrad,backendName:"cpu",kernelFunc:maxPool3DGrad$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -11445,7 +11445,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function maxPoolGrad$1(u){const{inputs:n,backend:s,attrs:c}=u,{dy:f,input:g,output:A}=n,v=g;assertNotComplex$1([g,A],"maxPoolGrad");const{filterSize:y,strides:T,pad:I,dimRoundingMode:S}=c,k=computePool2DInfo(v.shape,y,T,1,I,S),e=s.data.get(v.dataId).values,N=buffer(k.outShape,v.dtype,maxPoolPositions(e,v.shape,v.dtype,k).values),M=k.strideHeight,O=k.strideWidth,z=k.dilationHeight,B=k.dilationWidth,V=k.effectiveFilterHeight,b=k.effectiveFilterWidth,W=b-1-k.padInfo.left,q=V-1-k.padInfo.top,Y=buffer(v.shape,"float32"),X=s.data.get(f.dataId).values,Q=buffer(f.shape,"float32",X);for(let m=0;m=k.outHeight||Math.floor(xe)!==xe))for(let we=0;we=k.outWidth||Math.floor(Fe)!==Fe)continue;const De=V*b-1-N.get(m,xe,Fe,Z),Ze=Se*b+we,nt=De===Ze?1:0;if(nt===0)continue;const Ue=Q.get(m,xe,Fe,Z);pe+=Ue*nt}}Y.set(pe,m,ee,oe,Z)}return s.makeTensorInfo(Y.shape,Y.dtype,Y.values)}const maxPoolGradConfig$1={kernelName:MaxPoolGrad,backendName:"cpu",kernelFunc:maxPoolGrad$1};/** + */function maxPoolGrad$1(u){const{inputs:n,backend:s,attrs:c}=u,{dy:f,input:g,output:A}=n,v=g;assertNotComplex$1([g,A],"maxPoolGrad");const{filterSize:y,strides:T,pad:I,dimRoundingMode:S}=c,k=computePool2DInfo(v.shape,y,T,1,I,S),e=s.data.get(v.dataId).values,N=buffer(k.outShape,v.dtype,maxPoolPositions(e,v.shape,v.dtype,k).values),M=k.strideHeight,O=k.strideWidth,U=k.dilationHeight,B=k.dilationWidth,V=k.effectiveFilterHeight,b=k.effectiveFilterWidth,W=b-1-k.padInfo.left,q=V-1-k.padInfo.top,Y=buffer(v.shape,"float32"),X=s.data.get(f.dataId).values,Q=buffer(f.shape,"float32",X);for(let m=0;m=k.outHeight||Math.floor(xe)!==xe))for(let we=0;we=k.outWidth||Math.floor(Fe)!==Fe)continue;const De=V*b-1-N.get(m,xe,Fe,Z),Ze=Se*b+we,nt=De===Ze?1:0;if(nt===0)continue;const Ue=Q.get(m,xe,Fe,Z);pe+=Ue*nt}}Y.set(pe,m,ee,oe,Z)}return s.makeTensorInfo(Y.shape,Y.dtype,Y.values)}const maxPoolGradConfig$1={kernelName:MaxPoolGrad,backendName:"cpu",kernelFunc:maxPoolGrad$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -11505,7 +11505,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function min$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,keepDims:A}=c;assertNotComplex$1(f,"min");const v=parseAxisParam(g,f.shape);let y=v;const T=getAxesPermutation(y,f.shape.length);let I=f;T!=null&&(I=transpose$1({inputs:{x:f},backend:s,attrs:{perm:T}}),y=getInnerMostAxes(y.length,f.shape.length)),assertAxesAreInnerMostDims("min",y,I.shape.length);const[S,k]=computeOutAndReduceShapes(I.shape,y),e=sizeFromShape(k),N=makeZerosTypedArray(sizeFromShape(S),I.dtype),M=s.data.get(I.dataId).values;for(let z=0;zV[0]+f.shape[b]+V[1]),y=g.map(V=>V[0]),T=g.map((V,b)=>V[0]+f.shape[b]),I=A==="reflect"?0:1,S=s.data.get(f.dataId).values,k=f.shape.length,e=computeStrides(f.shape),N=sizeFromShape(v),M=v.length,O=computeStrides(v),z=getTypedArrayFromDType(f.dtype,N);for(let V=0;V=T[q]&&(b[q]=(T[q]-1)*2-b[q]+I);b=b.map((q,Y)=>q-y[Y]);const W=locToIndex(b,k,e);z[V]=S[W]}return{dataId:s.write(z,v,f.dtype),shape:v,dtype:f.dtype}}const mirrorPadConfig$1={kernelName:MirrorPad,backendName:"cpu",kernelFunc:mirrorPad};/** + */function mirrorPad(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{paddings:g,mode:A}=c;assertNotComplex$1(f,"mirrorPad");const v=g.map((V,b)=>V[0]+f.shape[b]+V[1]),y=g.map(V=>V[0]),T=g.map((V,b)=>V[0]+f.shape[b]),I=A==="reflect"?0:1,S=s.data.get(f.dataId).values,k=f.shape.length,e=computeStrides(f.shape),N=sizeFromShape(v),M=v.length,O=computeStrides(v),U=getTypedArrayFromDType(f.dtype,N);for(let V=0;V=T[q]&&(b[q]=(T[q]-1)*2-b[q]+I);b=b.map((q,Y)=>q-y[Y]);const W=locToIndex(b,k,e);U[V]=S[W]}return{dataId:s.write(U,v,f.dtype),shape:v,dtype:f.dtype}}const mirrorPadConfig$1={kernelName:MirrorPad,backendName:"cpu",kernelFunc:mirrorPad};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -11535,7 +11535,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const modImpl=createSimpleBinaryKernelImpl((u,n)=>{const s=u%n;return u<0&&n<0||u>=0&&n>=0?s:(s+n)%n}),mod$1=binaryKernelFunc$1(Mod,modImpl),modConfig$1={kernelName:Mod,backendName:"cpu",kernelFunc:mod$1};var alea$1={exports:{}};alea$1.exports;(function(u){(function(n,s,c){function f(y){var T=this,I=v();T.next=function(){var S=2091639*T.s0+T.c*23283064365386963e-26;return T.s0=T.s1,T.s1=T.s2,T.s2=S-(T.c=S|0)},T.c=1,T.s0=I(" "),T.s1=I(" "),T.s2=I(" "),T.s0-=I(y),T.s0<0&&(T.s0+=1),T.s1-=I(y),T.s1<0&&(T.s1+=1),T.s2-=I(y),T.s2<0&&(T.s2+=1),I=null}function g(y,T){return T.c=y.c,T.s0=y.s0,T.s1=y.s1,T.s2=y.s2,T}function A(y,T){var I=new f(y),S=T&&T.state,k=I.next;return k.int32=function(){return I.next()*4294967296|0},k.double=function(){return k()+(k()*2097152|0)*11102230246251565e-32},k.quick=k,S&&(typeof S=="object"&&g(S,I),k.state=function(){return g(I,{})}),k}function v(){var y=4022871197,T=function(I){I=I.toString();for(var S=0;S>>0,k-=y,k*=y,y=k>>>0,k-=y,y+=k*4294967296}return(y>>>0)*23283064365386963e-26};return T}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.alea=A})(commonjsGlobal,u,!1)})(alea$1);var aleaExports=alea$1.exports,xor128$1={exports:{}};xor128$1.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.x=0,y.y=0,y.z=0,y.w=0,y.next=function(){var S=y.x^y.x<<11;return y.x=y.y,y.y=y.z,y.z=y.w,y.w^=y.w>>>19^S^S>>>8},v===(v|0)?y.x=v:T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor128=A})(commonjsGlobal,u,!1)})(xor128$1);var xor128Exports=xor128$1.exports,xorwow$1={exports:{}};xorwow$1.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.x^y.x>>>2;return y.x=y.y,y.y=y.z,y.z=y.w,y.w=y.v,(y.d=y.d+362437|0)+(y.v=y.v^y.v<<4^(S^S<<1))|0},y.x=0,y.y=0,y.z=0,y.w=0,y.v=0,v===(v|0)?y.x=v:T+=v;for(var I=0;I>>4),y.next()}function g(v,y){return y.x=v.x,y.y=v.y,y.z=v.z,y.w=v.w,y.v=v.v,y.d=v.d,y}function A(v,y){var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorwow=A})(commonjsGlobal,u,!1)})(xorwow$1);var xorwowExports=xorwow$1.exports,xorshift7$1={exports:{}};xorshift7$1.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.x,S=y.i,k,e;return k=I[S],k^=k>>>7,e=k^k<<24,k=I[S+1&7],e^=k^k>>>10,k=I[S+3&7],e^=k^k>>>3,k=I[S+4&7],e^=k^k<<7,k=I[S+7&7],k=k^k<<13,e^=k^k<<9,I[S]=e,y.i=S+1&7,e};function T(I,S){var k,e=[];if(S===(S|0))e[0]=S;else for(S=""+S,k=0;k0;--k)I.next()}T(y,v)}function g(v,y){return y.x=v.x.slice(),y.i=v.i,y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.x&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorshift7=A})(commonjsGlobal,u,!1)})(xorshift7$1);var xorshift7Exports=xorshift7$1.exports,xor4096$1={exports:{}};xor4096$1.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.w,S=y.X,k=y.i,e,N;return y.w=I=I+1640531527|0,N=S[k+34&127],e=S[k=k+1&127],N^=N<<13,e^=e<<17,N^=N>>>15,e^=e>>>12,N=S[k]=N^e,y.i=k,N+(I^I>>>16)|0};function T(I,S){var k,e,N,M,O,z=[],B=128;for(S===(S|0)?(e=S,S=null):(S=S+"\0",e=0,B=Math.max(B,S.length)),N=0,M=-32;M>>15,e^=e<<4,e^=e>>>13,M>=0&&(O=O+1640531527|0,k=z[M&127]^=e+O,N=k==0?N+1:0);for(N>=128&&(z[(S&&S.length||0)&127]=-1),N=127,M=4*128;M>0;--M)e=z[N+34&127],k=z[N=N+1&127],e^=e<<13,k^=k<<17,e^=e>>>15,k^=k>>>12,z[N]=e^k;I.w=O,I.X=z,I.i=N}T(y,v)}function g(v,y){return y.i=v.i,y.w=v.w,y.X=v.X.slice(),y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.X&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor4096=A})(commonjsGlobal,u,!1)})(xor4096$1);var xor4096Exports=xor4096$1.exports,tychei$1={exports:{}};tychei$1.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.b,k=y.c,e=y.d,N=y.a;return S=S<<25^S>>>7^k,k=k-e|0,e=e<<24^e>>>8^N,N=N-S|0,y.b=S=S<<20^S>>>12^k,y.c=k=k-e|0,y.d=e<<16^k>>>16^N,y.a=N-S|0},y.a=0,y.b=0,y.c=-1640531527,y.d=1367130551,v===Math.floor(v)?(y.a=v/4294967296|0,y.b=v|0):T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.tychei=A})(commonjsGlobal,u,!1)})(tychei$1);var tycheiExports=tychei$1.exports,seedrandom$1={exports:{}};(function(u){(function(n,s){var c=this,f=256,g=6,A=52,v="random",y=s.pow(f,g),T=s.pow(2,A),I=T*2,S=f-1,k;function e(b,W,q){var Y=[];W=W==!0?{entropy:!0}:W||{};var X=z(O(W.entropy?[b,V(n)]:b??B(),3),Y),Q=new N(Y),m=function(){for(var Z=Q.g(g),ee=y,oe=0;Z=I;)Z/=2,ee/=2,oe>>>=1;return(Z+oe)/ee};return m.int32=function(){return Q.g(4)|0},m.quick=function(){return Q.g(4)/4294967296},m.double=m,z(V(Q.S),n),(W.pass||q||function(Z,ee,oe,fe){return fe&&(fe.S&&M(fe,Q),Z.state=function(){return M(Q,{})}),oe?(s[v]=Z,ee):Z})(m,X,"global"in W?W.global:this==s,W.state)}s["seed"+v]=e;function N(b){var W,q=b.length,Y=this,X=0,Q=Y.i=Y.j=0,m=Y.S=[];for(q||(b=[q++]);X{const s=u%n;return u<0&&n<0||u>=0&&n>=0?s:(s+n)%n}),mod$1=binaryKernelFunc$1(Mod,modImpl),modConfig$1={kernelName:Mod,backendName:"cpu",kernelFunc:mod$1};var alea$1={exports:{}};alea$1.exports;(function(u){(function(n,s,c){function f(y){var T=this,I=v();T.next=function(){var S=2091639*T.s0+T.c*23283064365386963e-26;return T.s0=T.s1,T.s1=T.s2,T.s2=S-(T.c=S|0)},T.c=1,T.s0=I(" "),T.s1=I(" "),T.s2=I(" "),T.s0-=I(y),T.s0<0&&(T.s0+=1),T.s1-=I(y),T.s1<0&&(T.s1+=1),T.s2-=I(y),T.s2<0&&(T.s2+=1),I=null}function g(y,T){return T.c=y.c,T.s0=y.s0,T.s1=y.s1,T.s2=y.s2,T}function A(y,T){var I=new f(y),S=T&&T.state,k=I.next;return k.int32=function(){return I.next()*4294967296|0},k.double=function(){return k()+(k()*2097152|0)*11102230246251565e-32},k.quick=k,S&&(typeof S=="object"&&g(S,I),k.state=function(){return g(I,{})}),k}function v(){var y=4022871197,T=function(I){I=I.toString();for(var S=0;S>>0,k-=y,k*=y,y=k>>>0,k-=y,y+=k*4294967296}return(y>>>0)*23283064365386963e-26};return T}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.alea=A})(commonjsGlobal,u,!1)})(alea$1);var aleaExports=alea$1.exports,xor128$1={exports:{}};xor128$1.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.x=0,y.y=0,y.z=0,y.w=0,y.next=function(){var S=y.x^y.x<<11;return y.x=y.y,y.y=y.z,y.z=y.w,y.w^=y.w>>>19^S^S>>>8},v===(v|0)?y.x=v:T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor128=A})(commonjsGlobal,u,!1)})(xor128$1);var xor128Exports=xor128$1.exports,xorwow$1={exports:{}};xorwow$1.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.x^y.x>>>2;return y.x=y.y,y.y=y.z,y.z=y.w,y.w=y.v,(y.d=y.d+362437|0)+(y.v=y.v^y.v<<4^(S^S<<1))|0},y.x=0,y.y=0,y.z=0,y.w=0,y.v=0,v===(v|0)?y.x=v:T+=v;for(var I=0;I>>4),y.next()}function g(v,y){return y.x=v.x,y.y=v.y,y.z=v.z,y.w=v.w,y.v=v.v,y.d=v.d,y}function A(v,y){var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorwow=A})(commonjsGlobal,u,!1)})(xorwow$1);var xorwowExports=xorwow$1.exports,xorshift7$1={exports:{}};xorshift7$1.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.x,S=y.i,k,e;return k=I[S],k^=k>>>7,e=k^k<<24,k=I[S+1&7],e^=k^k>>>10,k=I[S+3&7],e^=k^k>>>3,k=I[S+4&7],e^=k^k<<7,k=I[S+7&7],k=k^k<<13,e^=k^k<<9,I[S]=e,y.i=S+1&7,e};function T(I,S){var k,e=[];if(S===(S|0))e[0]=S;else for(S=""+S,k=0;k0;--k)I.next()}T(y,v)}function g(v,y){return y.x=v.x.slice(),y.i=v.i,y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.x&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xorshift7=A})(commonjsGlobal,u,!1)})(xorshift7$1);var xorshift7Exports=xorshift7$1.exports,xor4096$1={exports:{}};xor4096$1.exports;(function(u){(function(n,s,c){function f(v){var y=this;y.next=function(){var I=y.w,S=y.X,k=y.i,e,N;return y.w=I=I+1640531527|0,N=S[k+34&127],e=S[k=k+1&127],N^=N<<13,e^=e<<17,N^=N>>>15,e^=e>>>12,N=S[k]=N^e,y.i=k,N+(I^I>>>16)|0};function T(I,S){var k,e,N,M,O,U=[],B=128;for(S===(S|0)?(e=S,S=null):(S=S+"\0",e=0,B=Math.max(B,S.length)),N=0,M=-32;M>>15,e^=e<<4,e^=e>>>13,M>=0&&(O=O+1640531527|0,k=U[M&127]^=e+O,N=k==0?N+1:0);for(N>=128&&(U[(S&&S.length||0)&127]=-1),N=127,M=4*128;M>0;--M)e=U[N+34&127],k=U[N=N+1&127],e^=e<<13,k^=k<<17,e^=e>>>15,k^=k>>>12,U[N]=e^k;I.w=O,I.X=U,I.i=N}T(y,v)}function g(v,y){return y.i=v.i,y.w=v.w,y.X=v.X.slice(),y}function A(v,y){v==null&&(v=+new Date);var T=new f(v),I=y&&y.state,S=function(){return(T.next()>>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(I.X&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.xor4096=A})(commonjsGlobal,u,!1)})(xor4096$1);var xor4096Exports=xor4096$1.exports,tychei$1={exports:{}};tychei$1.exports;(function(u){(function(n,s,c){function f(v){var y=this,T="";y.next=function(){var S=y.b,k=y.c,e=y.d,N=y.a;return S=S<<25^S>>>7^k,k=k-e|0,e=e<<24^e>>>8^N,N=N-S|0,y.b=S=S<<20^S>>>12^k,y.c=k=k-e|0,y.d=e<<16^k>>>16^N,y.a=N-S|0},y.a=0,y.b=0,y.c=-1640531527,y.d=1367130551,v===Math.floor(v)?(y.a=v/4294967296|0,y.b=v|0):T+=v;for(var I=0;I>>0)/4294967296};return S.double=function(){do var k=T.next()>>>11,e=(T.next()>>>0)/4294967296,N=(k+e)/(1<<21);while(N===0);return N},S.int32=T.next,S.quick=S,I&&(typeof I=="object"&&g(I,T),S.state=function(){return g(T,{})}),S}s&&s.exports?s.exports=A:c&&c.amd?c(function(){return A}):this.tychei=A})(commonjsGlobal,u,!1)})(tychei$1);var tycheiExports=tychei$1.exports,seedrandom$1={exports:{}};(function(u){(function(n,s){var c=this,f=256,g=6,A=52,v="random",y=s.pow(f,g),T=s.pow(2,A),I=T*2,S=f-1,k;function e(b,W,q){var Y=[];W=W==!0?{entropy:!0}:W||{};var X=U(O(W.entropy?[b,V(n)]:b??B(),3),Y),Q=new N(Y),m=function(){for(var Z=Q.g(g),ee=y,oe=0;Z=I;)Z/=2,ee/=2,oe>>>=1;return(Z+oe)/ee};return m.int32=function(){return Q.g(4)|0},m.quick=function(){return Q.g(4)/4294967296},m.double=m,U(V(Q.S),n),(W.pass||q||function(Z,ee,oe,fe){return fe&&(fe.S&&M(fe,Q),Z.state=function(){return M(Q,{})}),oe?(s[v]=Z,ee):Z})(m,X,"global"in W?W.global:this==s,W.state)}s["seed"+v]=e;function N(b){var W,q=b.length,Y=this,X=0,Q=Y.i=Y.j=0,m=Y.S=[];for(q||(b=[q++]);X1?k-1:k,g&&I>1?e-1:e],B=[g&&T>1?T-1:T,g&&I>1?I-1:I];let V=0;const b=z[0]/B[0],W=z[1]/B[1];for(let q=0;q1?k-1:k,g&&I>1?e-1:e],B=[g&&T>1?T-1:T,g&&I>1?I-1:I];let V=0;const b=U[0]/B[0],W=U[1]/B[1];for(let q=0;q1?T-1:T,A&&e>1?I-1:I],O=[A&&k>1?k-1:k,A&&e>1?e-1:e],z=M[0]/O[0],B=M[1]/O[1],V=s.data.get(g.dataId).values;let b=0;for(let W=0;W1?T-1:T,A&&e>1?I-1:I],O=[A&&k>1?k-1:k,A&&e>1?e-1:e],U=M[0]/O[0],B=M[1]/O[1],V=s.data.get(g.dataId).values;let b=0;for(let W=0;W1?k-1:k,g&&I>1?e-1:e],B=[g&&T>1?T-1:T,g&&I>1?I-1:I],V=z[0]/B[0],b=z[1]/B[1];let W=0;for(let q=0;q1?k-1:k,g&&I>1?e-1:e],B=[g&&T>1?T-1:T,g&&I>1?I-1:I],V=U[0]/B[0],b=U[1]/B[1];let W=0;for(let q=0;q1?I-1:I,A&&N>1?S-1:S],B=[A&&e>1?e-1:e,A&&N>1?N-1:N],V=z[0]/B[0],b=z[1]/B[1],W=1/V,q=1/b,Y=Math.ceil(W)*2+2,X=Math.ceil(q)*2+2;for(let Q=0;Q=e)continue;const nt=m+Ze*y[1],Ue=Ze*V,ye=Math.min(I-1,A?Math.round(Ue):Math.floor(Ue));if(Z===ye)for(let at=0;at=N)continue;const Tt=nt+ft*y[2],Lt=ft*b,Ot=Math.min(S-1,A?Math.round(Lt):Math.floor(Lt));me===Ot&&(Fe+=O[Tt+we])}}M[pe+we]=Fe}}}}return s.makeTensorInfo(f.shape,f.dtype,M)}const resizeNearestNeighborGradConfig$1={kernelName:ResizeNearestNeighborGrad,backendName:"cpu",kernelFunc:resizeNearestNeighborGrad$1};/** + */function resizeNearestNeighborGrad$1(u){const{inputs:n,backend:s,attrs:c}=u,{images:f,dy:g}=n,{alignCorners:A}=c;assertNotComplex$1([g,f],"resizeNearestNeighborGrad");const v=computeStrides(f.shape),y=computeStrides(g.shape),[T,I,S,k]=f.shape,[,e,N]=g.shape,M=new Float32Array(T*I*S*k),O=s.data.get(g.dataId).values,U=[A&&e>1?I-1:I,A&&N>1?S-1:S],B=[A&&e>1?e-1:e,A&&N>1?N-1:N],V=U[0]/B[0],b=U[1]/B[1],W=1/V,q=1/b,Y=Math.ceil(W)*2+2,X=Math.ceil(q)*2+2;for(let Q=0;Q=e)continue;const nt=m+Ze*y[1],Ue=Ze*V,ye=Math.min(I-1,A?Math.round(Ue):Math.floor(Ue));if(Z===ye)for(let at=0;at=N)continue;const Tt=nt+ft*y[2],Lt=ft*b,Ot=Math.min(S-1,A?Math.round(Lt):Math.floor(Lt));me===Ot&&(Fe+=O[Tt+we])}}M[pe+we]=Fe}}}}return s.makeTensorInfo(f.shape,f.dtype,M)}const resizeNearestNeighborGradConfig$1={kernelName:ResizeNearestNeighborGrad,backendName:"cpu",kernelFunc:resizeNearestNeighborGrad$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -11820,7 +11820,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const rotateWithOffsetConfig$1={kernelName:RotateWithOffset,backendName:"cpu",kernelFunc:({inputs:u,attrs:n,backend:s})=>{const{image:c}=u,{radians:f,fillValue:g,center:A}=n,v=s,y=getTypedArrayFromDType(c.dtype,sizeFromShape(c.shape)),[T,I,S,k]=c.shape,[e,N]=getImageCenter(A,I,S),M=255,O=Math.sin(f),z=Math.cos(f),B=v.data.get(c.dataId).values;for(let b=0;b=0&&fe=0&&me{const{image:c}=u,{radians:f,fillValue:g,center:A}=n,v=s,y=getTypedArrayFromDType(c.dtype,sizeFromShape(c.shape)),[T,I,S,k]=c.shape,[e,N]=getImageCenter(A,I,S),M=255,O=Math.sin(f),U=Math.cos(f),B=v.data.get(c.dataId).values;for(let b=0;b=0&&fe=0&&me=c/f)throw new Error(`Invalid indices: ${M} does not index into ${s}`);for(let z=0;z=c/f)throw new Error(`Invalid indices: ${M} does not index into ${s}`);for(let U=0;Uq===0))b=s.makeTensorInfo(B,f.dtype,[]);else{const q=s.bufferSync(V),Y=stridedSliceImpl(B,q,M,N);b=s.makeTensorInfo(Y.shape,Y.dtype,Y.values)}const W=reshape$1({inputs:{x:b},backend:s,attrs:{shape:B}});return s.disposeIntermediateTensorInfo(V),s.disposeIntermediateTensorInfo(b),W}const stridedSliceConfig$1={kernelName:StridedSlice,backendName:"cpu",kernelFunc:stridedSlice$1};/** + */function stridedSlice$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{begin:g,end:A,strides:v,beginMask:y,endMask:T,ellipsisMask:I,newAxisMask:S,shrinkAxisMask:k}=c;assertNotComplex$1(f,"stridedSlice");const{nonStrided:e,$begin:N,$strides:M,size:O,newShape:U,outShape:B}=sliceInfo(f.shape,g,A,v,y,T,I,S,k),V=reshape$1({inputs:{x:f},backend:s,attrs:{shape:U}});let b;if(e){const q=slice$1({inputs:{x:V},backend:s,attrs:{begin:N,size:O}});b=reshape$1({inputs:{x:q},backend:s,attrs:{shape:B}}),s.disposeIntermediateTensorInfo(q)}else if(B.some(q=>q===0))b=s.makeTensorInfo(B,f.dtype,[]);else{const q=s.bufferSync(V),Y=stridedSliceImpl(B,q,M,N);b=s.makeTensorInfo(Y.shape,Y.dtype,Y.values)}const W=reshape$1({inputs:{x:b},backend:s,attrs:{shape:B}});return s.disposeIntermediateTensorInfo(V),s.disposeIntermediateTensorInfo(b),W}const stridedSliceConfig$1={kernelName:StridedSlice,backendName:"cpu",kernelFunc:stridedSlice$1};/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -12235,7 +12235,7 @@ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed thi * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function transform$1(u){const{inputs:n,attrs:s,backend:c}=u,{image:f,transforms:g}=n,{interpolation:A,fillMode:v,fillValue:y,outputShape:T}=s,[I,S,k,e]=f.shape,[N,M]=T??[S,k],O=[I,N,M,e],z=computeStrides(f.shape),B=z[0],V=z[1],b=z[2],W=getTypedArrayFromDType(f.dtype,sizeFromShape(O));W.fill(y);const q=c.data.get(f.dataId).values,Y=c.data.get(g.dataId).values;for(let Q=0;Qn-1)if(n<=1)s=0;else{const c=2*n;s-=c*Math.trunc(s/c),s>=n&&(s=c-s-1)}return clamp(0,s,n-1)}function mapCoordWrap(u,n){let s=u;if(s<0)if(n<=1)s=0;else{const c=n-1;s+=n*(Math.trunc(-s/c)+1)}else if(s>n-1)if(n<=1)s=0;else{const c=n-1;s-=n*Math.trunc(s/c)}return clamp(0,s,n-1)}function mapCoordConstant(u,n){return u}function mapCoordNearest(u,n){return clamp(0,u,n-1)}function readWithFillValue(u,n,s,c,f,g,A,v,y,T,I){const S=A*c+v*f+y*g+T;return 0<=v&&vn-1)if(n<=1)s=0;else{const c=2*n;s-=c*Math.trunc(s/c),s>=n&&(s=c-s-1)}return clamp(0,s,n-1)}function mapCoordWrap(u,n){let s=u;if(s<0)if(n<=1)s=0;else{const c=n-1;s+=n*(Math.trunc(-s/c)+1)}else if(s>n-1)if(n<=1)s=0;else{const c=n-1;s-=n*Math.trunc(s/c)}return clamp(0,s,n-1)}function mapCoordConstant(u,n){return u}function mapCoordNearest(u,n){return clamp(0,u,n-1)}function readWithFillValue(u,n,s,c,f,g,A,v,y,T,I){const S=A*c+v*f+y*g+T;return 0<=v&&vs.disposeIntermediateTensorInfo(N)),e}const unsortedSegmentSumConfig$1={kernelName:UnsortedSegmentSum,backendName:"cpu",kernelFunc:unsortedSegmentSum$1};/** + */function unsortedSegmentSum$1(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,segmentIds:g}=n,{numSegments:A}=c;assertNotComplex$1(f,"unsortedSegmentSum");const v=f.shape.length,y=g.shape.length,T=[],I=[],S=v-y;let k=g;for(let N=0;Ns.disposeIntermediateTensorInfo(N)),e}const unsortedSegmentSumConfig$1={kernelName:UnsortedSegmentSum,backendName:"cpu",kernelFunc:unsortedSegmentSum$1};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -13184,7 +13184,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${e}.0, ${k}.0); return sampleTexture(${c}, uv); } - `;const z=getFlatOffsetUniformName(c);return n?` + `;const U=getFlatOffsetUniformName(c);return n?` float ${f}(int row, int col, int depth, int depth2) { // Explicitly use integer operations as dot() only works on floats. ${N} @@ -13192,7 +13192,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${O} int index = row * stride0 + col * stride1 + depth * stride2 + depth2; - vec2 uv = uvFromFlat(${c}TexShape[0], ${c}TexShape[1], index + ${z}); + vec2 uv = uvFromFlat(${c}TexShape[0], ${c}TexShape[1], index + ${U}); return sampleTexture(${c}, uv); } `:` @@ -13200,7 +13200,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, // Explicitly use integer operations as dot() only works on floats. int index = row * ${v} + col * ${A} + depth * ${g} + depth2; - vec2 uv = uvFromFlat(${k}, ${e}, index + ${z}); + vec2 uv = uvFromFlat(${k}, ${e}, index + ${U}); return sampleTexture(${c}, uv); } `}function getSampler5D(u){const n=u.shapeInfo.logicalShape,s=u.name,c="get"+s.charAt(0).toUpperCase()+s.slice(1),f=n[4],g=n[3]*f,A=n[2]*g,v=n[1]*A,{newShape:y,keptDims:T}=squeezeShape(n);if(y.length=1?I="coords = 0;":I=v.map(B=>`coords.${S[B+T]} = 0;`).join(` -`);let k="";A<2&&g>0?k="coords":k=u.shapeInfo.logicalShape.map((B,V)=>`coords.${S[V+T]}`).join(", ");let e="return outputValue;";const M=sizeFromShape(u.shapeInfo.logicalShape)===1,z=sizeFromShape(n.logicalShape)===1;if(g===1&&!M&&!z)e=` +`);let k="";A<2&&g>0?k="coords":k=u.shapeInfo.logicalShape.map((B,V)=>`coords.${S[V+T]}`).join(", ");let e="return outputValue;";const M=sizeFromShape(u.shapeInfo.logicalShape)===1,U=sizeFromShape(n.logicalShape)===1;if(g===1&&!M&&!U)e=` return vec4(outputValue.xy, outputValue.xy); - `;else if(M&&!z)A===1?e=` + `;else if(M&&!U)A===1?e=` return vec4(outputValue.x, outputValue.x, 0., 0.); `:e=` return vec4(outputValue.x); @@ -13340,7 +13340,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function compileProgram(u,n,s,c){const f=s.map((V,b)=>{const W={logicalShape:V.shape,texShape:V.isUniform?null:V.texData.texShape,isUniform:V.isUniform,isPacked:V.isUniform?!1:V.texData.isPacked,flatOffset:null};return V.texData!=null&&V.texData.slice!=null&&V.texData.slice.flatOffset>0&&(W.flatOffset=V.texData.slice.flatOffset),{name:n.variableNames[b],shapeInfo:W}}),g=f.map(V=>V.shapeInfo),A={logicalShape:c.shape,texShape:c.texData.texShape,isUniform:!1,isPacked:c.texData.isPacked,flatOffset:null},v=makeShader(f,A,n),y=u.createProgram(v);let T=null;const I=u.getUniformLocation(y,"NAN",!1);env().getNumber("WEBGL_VERSION")===1&&(T=u.getUniformLocation(y,"INFINITY",!1));const S=!1,k={},e={},N={};for(let V=0;V{B[b]=u.getUniformLocation(y,V.name,S)}),{program:n,source:v,webGLProgram:y,uniformLocations:k,customUniformLocations:B,inShapeInfos:g,outShapeInfo:A,infLoc:T,nanLoc:I,inShapesLocations:e,inTexShapesLocations:N,outShapeLocation:M,outShapeStridesLocation:z,outTexShapeLocation:O}}function validateBinaryAndProgram(u,n){if(u.length!==n.length)throw Error(`Binary was compiled with ${u.length} inputs, but was executed with ${n.length} inputs`);u.forEach((s,c)=>{const f=s.logicalShape,g=n[c],A=g.shape;if(!arraysEqual(f,A))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${f} and ${A} must match`);if(s.isUniform&&g.isUniform)return;const v=s.texShape,y=g.isUniform?null:g.texData.texShape;if(!arraysEqual(v,y))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${v} and ${y} must match`)})}function runProgram(u,n,s,c,f){n.program.enableShapeUniforms||(validateBinaryAndProgram(n.inShapeInfos,s),validateBinaryAndProgram([n.outShapeInfo],[c]));const g=c.texData.texture,A=c.texData.texShape;c.texData.isPacked?u.setOutputPackedMatrixTexture(g,A[0],A[1]):u.setOutputMatrixTexture(g,A[0],A[1]),u.setProgram(n.webGLProgram),env().getNumber("WEBGL_VERSION")===1&&n.infLoc!==null&&u.gl.uniform1f(n.infLoc,1/0),n.nanLoc!==null&&u.gl.uniform1f(n.nanLoc,NaN),s.forEach((y,T)=>{const I=n.program.variableNames[T],S=n.uniformLocations[I],k=n.uniformLocations[`offset${I}`],e=n.inShapesLocations[`${I}Shape`],N=n.inTexShapesLocations[`${I}TexShape`];if(e){const{uniformShape:M}=getUniformInfoFromShape(n.program.packedInputs,y.shape,y.texData.texShape);switch(M.length){case 1:u.gl.uniform1iv(e,new Int32Array(M));break;case 2:u.gl.uniform2iv(e,new Int32Array(M));break;case 3:u.gl.uniform3iv(e,new Int32Array(M));break;case 4:u.gl.uniform4iv(e,new Int32Array(M));break}}if(N&&u.gl.uniform2i(N,y.texData.texShape[0],y.texData.texShape[1]),S!=null){if(y.isUniform){if(sizeFromShape(y.shape)<2)u.gl.uniform1f(S,y.uniformValues[0]);else{let M=y.uniformValues;M instanceof Float32Array||(M=new Float32Array(M)),u.gl.uniform1fv(S,M)}return}y.texData.slice!=null&&k!=null&&u.gl.uniform1i(k,y.texData.slice.flatOffset),u.setInputMatrixTexture(y.texData.texture,S,T)}});const v=n.outShapeLocation;if(v)switch(c.shape.length){case 1:u.gl.uniform1iv(v,new Int32Array(c.shape));break;case 2:u.gl.uniform2iv(v,new Int32Array(c.shape));break;case 3:u.gl.uniform3iv(v,new Int32Array(c.shape));break;case 4:u.gl.uniform4iv(v,new Int32Array(c.shape));break}if(n.outShapeStridesLocation){const y=computeStrides(c.shape);switch(c.shape.length){case 2:u.gl.uniform1iv(n.outShapeStridesLocation,new Int32Array(y));break;case 3:u.gl.uniform2iv(n.outShapeStridesLocation,new Int32Array(y));break;case 4:u.gl.uniform3iv(n.outShapeStridesLocation,new Int32Array(y));break}}n.outTexShapeLocation&&u.gl.uniform2i(n.outTexShapeLocation,c.texData.texShape[0],c.texData.texShape[1]),n.program.customUniforms&&f&&n.program.customUniforms.forEach((y,T)=>{const I=n.customUniformLocations[T],S=f[T];if(y.type==="float")u.gl.uniform1fv(I,S);else if(y.type==="vec2")u.gl.uniform2fv(I,S);else if(y.type==="vec3")u.gl.uniform3fv(I,S);else if(y.type==="vec4")u.gl.uniform4fv(I,S);else if(y.type==="int")u.gl.uniform1iv(I,S);else if(y.type==="ivec2")u.gl.uniform2iv(I,S);else if(y.type==="ivec3")u.gl.uniform3iv(I,S);else if(y.type==="ivec4")u.gl.uniform4iv(I,S);else throw Error(`uniform type ${y.type} is not supported yet.`)}),u.executeProgram()}function makeShaderKey(u,n,s){let c="";n.concat(s).forEach(A=>{const v=A.texData!=null&&A.texData.slice!=null&&A.texData.slice.flatOffset>0;if(u.enableShapeUniforms&&!A.isUniform){const y=A.texData.texShape,{useSqueezeShape:T,uniformShape:I,keptDims:S}=getUniformInfoFromShape(u.packedInputs,A.shape,y);let k="",e="",N="";if(I.length===1&&u.packedInputs){const W=[Math.ceil(y[0]/2),Math.ceil(y[1]/2)];k=`${W[0]>1}_${W[1]>1}`}else if(I.length===2&&!u.packedInputs)e=`${I[0]>1}_${I[1]>1}`;else if(I.length>2&&!u.packedInputs){const W=computeStrides(I);N=`${W[0]===y[1]}_${W[W.length-1]===y[1]}`}const M=A.shape.length,O=I.length===2&&arraysEqual(A.shape,y),z=sizeFromShape(A.shape)===1,B=getBroadcastDims$1(A.shape,s.shape),V=!u.packedInputs&&M===s.shape.length&&arraysEqual(y,s.texData.texShape),b=u.packedInputs||I.length>2?"":`${y[0]>1}_${y[1]>1}`;c+=`${M}_${V}_${T?S:""}_${I.length}_${z}_${B}_${O}_${k}_${e}_${N}_${b}_${v}`}else{const y=A.isUniform?"uniform":A.texData.texShape;c+=`${A.shape}_${y}_${v}`}});const f=u.userCode;let g=u.constructor.name;return g+="_"+c+"_"+f+`${env().getNumber("WEBGL_VERSION")}`,g}function useShapeUniforms(u){return env().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&u<=4}/** + */function compileProgram(u,n,s,c){const f=s.map((V,b)=>{const W={logicalShape:V.shape,texShape:V.isUniform?null:V.texData.texShape,isUniform:V.isUniform,isPacked:V.isUniform?!1:V.texData.isPacked,flatOffset:null};return V.texData!=null&&V.texData.slice!=null&&V.texData.slice.flatOffset>0&&(W.flatOffset=V.texData.slice.flatOffset),{name:n.variableNames[b],shapeInfo:W}}),g=f.map(V=>V.shapeInfo),A={logicalShape:c.shape,texShape:c.texData.texShape,isUniform:!1,isPacked:c.texData.isPacked,flatOffset:null},v=makeShader(f,A,n),y=u.createProgram(v);let T=null;const I=u.getUniformLocation(y,"NAN",!1);env().getNumber("WEBGL_VERSION")===1&&(T=u.getUniformLocation(y,"INFINITY",!1));const S=!1,k={},e={},N={};for(let V=0;V{B[b]=u.getUniformLocation(y,V.name,S)}),{program:n,source:v,webGLProgram:y,uniformLocations:k,customUniformLocations:B,inShapeInfos:g,outShapeInfo:A,infLoc:T,nanLoc:I,inShapesLocations:e,inTexShapesLocations:N,outShapeLocation:M,outShapeStridesLocation:U,outTexShapeLocation:O}}function validateBinaryAndProgram(u,n){if(u.length!==n.length)throw Error(`Binary was compiled with ${u.length} inputs, but was executed with ${n.length} inputs`);u.forEach((s,c)=>{const f=s.logicalShape,g=n[c],A=g.shape;if(!arraysEqual(f,A))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${f} and ${A} must match`);if(s.isUniform&&g.isUniform)return;const v=s.texShape,y=g.isUniform?null:g.texData.texShape;if(!arraysEqual(v,y))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${v} and ${y} must match`)})}function runProgram(u,n,s,c,f){n.program.enableShapeUniforms||(validateBinaryAndProgram(n.inShapeInfos,s),validateBinaryAndProgram([n.outShapeInfo],[c]));const g=c.texData.texture,A=c.texData.texShape;c.texData.isPacked?u.setOutputPackedMatrixTexture(g,A[0],A[1]):u.setOutputMatrixTexture(g,A[0],A[1]),u.setProgram(n.webGLProgram),env().getNumber("WEBGL_VERSION")===1&&n.infLoc!==null&&u.gl.uniform1f(n.infLoc,1/0),n.nanLoc!==null&&u.gl.uniform1f(n.nanLoc,NaN),s.forEach((y,T)=>{const I=n.program.variableNames[T],S=n.uniformLocations[I],k=n.uniformLocations[`offset${I}`],e=n.inShapesLocations[`${I}Shape`],N=n.inTexShapesLocations[`${I}TexShape`];if(e){const{uniformShape:M}=getUniformInfoFromShape(n.program.packedInputs,y.shape,y.texData.texShape);switch(M.length){case 1:u.gl.uniform1iv(e,new Int32Array(M));break;case 2:u.gl.uniform2iv(e,new Int32Array(M));break;case 3:u.gl.uniform3iv(e,new Int32Array(M));break;case 4:u.gl.uniform4iv(e,new Int32Array(M));break}}if(N&&u.gl.uniform2i(N,y.texData.texShape[0],y.texData.texShape[1]),S!=null){if(y.isUniform){if(sizeFromShape(y.shape)<2)u.gl.uniform1f(S,y.uniformValues[0]);else{let M=y.uniformValues;M instanceof Float32Array||(M=new Float32Array(M)),u.gl.uniform1fv(S,M)}return}y.texData.slice!=null&&k!=null&&u.gl.uniform1i(k,y.texData.slice.flatOffset),u.setInputMatrixTexture(y.texData.texture,S,T)}});const v=n.outShapeLocation;if(v)switch(c.shape.length){case 1:u.gl.uniform1iv(v,new Int32Array(c.shape));break;case 2:u.gl.uniform2iv(v,new Int32Array(c.shape));break;case 3:u.gl.uniform3iv(v,new Int32Array(c.shape));break;case 4:u.gl.uniform4iv(v,new Int32Array(c.shape));break}if(n.outShapeStridesLocation){const y=computeStrides(c.shape);switch(c.shape.length){case 2:u.gl.uniform1iv(n.outShapeStridesLocation,new Int32Array(y));break;case 3:u.gl.uniform2iv(n.outShapeStridesLocation,new Int32Array(y));break;case 4:u.gl.uniform3iv(n.outShapeStridesLocation,new Int32Array(y));break}}n.outTexShapeLocation&&u.gl.uniform2i(n.outTexShapeLocation,c.texData.texShape[0],c.texData.texShape[1]),n.program.customUniforms&&f&&n.program.customUniforms.forEach((y,T)=>{const I=n.customUniformLocations[T],S=f[T];if(y.type==="float")u.gl.uniform1fv(I,S);else if(y.type==="vec2")u.gl.uniform2fv(I,S);else if(y.type==="vec3")u.gl.uniform3fv(I,S);else if(y.type==="vec4")u.gl.uniform4fv(I,S);else if(y.type==="int")u.gl.uniform1iv(I,S);else if(y.type==="ivec2")u.gl.uniform2iv(I,S);else if(y.type==="ivec3")u.gl.uniform3iv(I,S);else if(y.type==="ivec4")u.gl.uniform4iv(I,S);else throw Error(`uniform type ${y.type} is not supported yet.`)}),u.executeProgram()}function makeShaderKey(u,n,s){let c="";n.concat(s).forEach(A=>{const v=A.texData!=null&&A.texData.slice!=null&&A.texData.slice.flatOffset>0;if(u.enableShapeUniforms&&!A.isUniform){const y=A.texData.texShape,{useSqueezeShape:T,uniformShape:I,keptDims:S}=getUniformInfoFromShape(u.packedInputs,A.shape,y);let k="",e="",N="";if(I.length===1&&u.packedInputs){const W=[Math.ceil(y[0]/2),Math.ceil(y[1]/2)];k=`${W[0]>1}_${W[1]>1}`}else if(I.length===2&&!u.packedInputs)e=`${I[0]>1}_${I[1]>1}`;else if(I.length>2&&!u.packedInputs){const W=computeStrides(I);N=`${W[0]===y[1]}_${W[W.length-1]===y[1]}`}const M=A.shape.length,O=I.length===2&&arraysEqual(A.shape,y),U=sizeFromShape(A.shape)===1,B=getBroadcastDims$1(A.shape,s.shape),V=!u.packedInputs&&M===s.shape.length&&arraysEqual(y,s.texData.texShape),b=u.packedInputs||I.length>2?"":`${y[0]>1}_${y[1]>1}`;c+=`${M}_${V}_${T?S:""}_${I.length}_${U}_${B}_${O}_${k}_${e}_${N}_${b}_${v}`}else{const y=A.isUniform?"uniform":A.texData.texShape;c+=`${A.shape}_${y}_${v}`}});const f=u.userCode;let g=u.constructor.name;return g+="_"+c+"_"+f+`${env().getNumber("WEBGL_VERSION")}`,g}function useShapeUniforms(u){return env().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&u<=4}/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -13857,7 +13857,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const whereImpl=whereImpl$2,EPSILON_FLOAT32=1e-7,EPSILON_FLOAT16=1e-4,binaryCaches={};function getBinaryCache(u){return u in binaryCaches||(binaryCaches[u]={}),binaryCaches[u]}const CPU_HANDOFF_SIZE_THRESHOLD=env().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),BEFORE_PAGING_CONSTANT=600;function numMBBeforeWarning(){return env().global.screen==null?1024:env().global.screen.height*env().global.screen.width*window.devicePixelRatio*BEFORE_PAGING_CONSTANT/1024/1024}class MathBackendWebGL extends KernelBackend{constructor(n){if(super(),this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!env().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(n==null){const s=getWebGLContext(env().getNumber("WEBGL_VERSION"));this.binaryCache=getBinaryCache(env().getNumber("WEBGL_VERSION")),this.gpgpu=new GPGPUContext(s),this.canvas=s.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=n,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=n.gl.canvas;this.textureManager=new TextureManager(this.gpgpu),this.numMBBeforeWarning=numMBBeforeWarning(),this.texData=new DataStorage(this,engine())}nextDataId(){return MathBackendWebGL.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(n,s,c){if((env().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||env().getBool("DEBUG"))&&this.checkNumericalProblems(n),c==="complex64"&&n!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const f={id:this.nextDataId()};return this.texData.set(f,{shape:s,dtype:c,values:n,usage:TextureUsage.UPLOAD,refCount:1}),f}refCount(n){return this.texData.has(n)?this.texData.get(n).refCount:0}incRef(n){const s=this.texData.get(n);s.refCount++}decRef(n){if(this.texData.has(n)){const s=this.texData.get(n);s.refCount--}}move(n,s,c,f,g){if(env().getBool("DEBUG")&&this.checkNumericalProblems(s),f==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(n,{shape:c,dtype:f,values:s,usage:TextureUsage.UPLOAD,refCount:g})}disposeIntermediateTensorInfo(n){this.disposeData(n.dataId)}readSync(n){const s=this.texData.get(n),{values:c,dtype:f,complexTensorInfos:g,slice:A,shape:v,isPacked:y}=s;if(A!=null){let k;y?k=new UnaryOpPackedProgram(v,CLONE):k=new UnaryOpProgram(v,CLONE);const e=this.runWebGLProgram(k,[{dataId:n,shape:v,dtype:f}],f),N=this.readSync(e.dataId);return this.disposeIntermediateTensorInfo(e),N}if(c!=null)return this.convertAndCacheOnCPU(n);if(f==="string")return c;const T=this.activeTimers!=null;let I;T&&(I=now());let S;if(f==="complex64"){const k=this.readSync(g.real.dataId),e=this.readSync(g.imag.dataId);S=mergeRealAndImagArrays(k,e)}else S=this.getValuesFromTexture(n);return T&&(this.downloadWaitMs+=now()-I),this.convertAndCacheOnCPU(n,S)}async read(n){if(this.pendingRead.has(n)){const N=this.pendingRead.get(n);return new Promise(M=>N.push(M))}const s=this.texData.get(n),{values:c,shape:f,slice:g,dtype:A,complexTensorInfos:v,isPacked:y}=s;if(g!=null){let N;y?N=new UnaryOpPackedProgram(f,CLONE):N=new UnaryOpProgram(f,CLONE);const M=this.runWebGLProgram(N,[{dataId:n,shape:f,dtype:A}],A),O=this.read(M.dataId);return this.disposeIntermediateTensorInfo(M),O}if(c!=null)return this.convertAndCacheOnCPU(n);if(!env().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&env().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let T=null,I;if(A!=="complex64"&&env().get("WEBGL_BUFFER_SUPPORTED")){I=this.decode(n);const N=this.texData.get(I.dataId);T=this.gpgpu.createBufferFromTexture(N.texture,...getDenseTexShape(f))}this.pendingRead.set(n,[]),A!=="complex64"&&await this.gpgpu.createAndWaitForFence();let S;if(A==="complex64"){const N=await Promise.all([this.read(v.real.dataId),this.read(v.imag.dataId)]),M=N[0],O=N[1];S=mergeRealAndImagArrays(M,O)}else if(T==null)S=this.getValuesFromTexture(n);else{const N=sizeFromShape(f);S=this.gpgpu.downloadFloat32MatrixFromBuffer(T,N)}if(I!=null&&this.disposeIntermediateTensorInfo(I),T!=null){const N=this.gpgpu.gl;callAndCheck(N,()=>N.deleteBuffer(T))}const k=this.convertAndCacheOnCPU(n,S),e=this.pendingRead.get(n);return this.pendingRead.delete(n),e.forEach(N=>N(k)),this.pendingDisposal.has(n)&&(this.pendingDisposal.delete(n),this.disposeData(n)&&engine().removeDataId(n,this),this.pendingDeletes--),k}bufferSync(n){const s=this.readSync(n.dataId);let c=s;if(n.dtype==="string")try{c=s.map(f=>decodeString(f))}catch{throw new Error("Failed to decode encoded string bytes into utf-8")}return buffer(n.shape,n.dtype,c)}checkNumericalProblems(n){if(n!=null)for(let s=0;s0}async time(n){const s=this.activeTimers,c=[];let f=!1;this.programTimersStack==null?(this.programTimersStack=c,f=!0):this.activeTimers.push(c),this.activeTimers=c,n();const g=flatten$1(this.activeTimers.map(y=>y.query)).filter(y=>y!=null),A=flatten$1(this.activeTimers.map(y=>y.name)).filter(y=>y!=null);this.activeTimers=s,f&&(this.programTimersStack=null);const v={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(env().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const y=await Promise.all(g);v.kernelMs=sum$3(y),v.getExtraProfileInfo=()=>y.map((T,I)=>({name:A[I],ms:T})).map(T=>`${T.name}: ${T.ms}`).join(", ")}else v.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,v}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return env().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:now(),endMs:null}}endTimer(n){return env().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),n):(n.endMs=now(),n)}async getQueryTime(n){if(env().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(n);const s=n;return s.endMs-s.startMs}disposeData(n,s=!1){if(this.pendingDisposal.has(n))return!1;if(!this.texData.has(n))return!0;if(s?this.texData.get(n).refCount=0:this.texData.get(n).refCount--,!s&&this.texData.get(n).refCount>0)return!1;if(this.pendingRead.has(n))return this.pendingDisposal.add(n),this.pendingDeletes++,!1;this.releaseGPUData(n);const{complexTensorInfos:c}=this.texData.get(n);return c!=null&&(this.disposeData(c.real.dataId,s),this.disposeData(c.imag.dataId,s)),this.texData.delete(n),!0}releaseGPUData(n){const{texture:s,dtype:c,texShape:f,usage:g,isPacked:A,slice:v}=this.texData.get(n),y=v&&v.origDataId||n,T=this.dataRefCount.get(y);T>1?this.dataRefCount.set(y,T-1):(this.dataRefCount.delete(y),s!=null&&(this.numBytesInGPU-=this.computeBytes(f,c),this.textureManager.releaseTexture(s,f,g,A)));const I=this.texData.get(n);I.texture=null,I.texShape=null,I.isPacked=!1,I.slice=null}getTexture(n){return this.uploadToGPU(n),this.texData.get(n).texture}getDataInfo(n){return this.texData.get(n)}shouldExecuteOnCPU(n,s=CPU_HANDOFF_SIZE_THRESHOLD){return env().getBool("WEBGL_CPU_FORWARD")&&n.every(c=>this.texData.get(c.dataId).texture==null&&sizeFromShape(c.shape)0&&isString(c[0])){const g=c.map(A=>encodeString(A));f=this.write(g,n,s)}else f=this.write(c,n,s);return this.texData.get(f).usage=null,{dataId:f,shape:n,dtype:s}}makeOutput(n,s,c){const{dataId:f}=this.makeTensorInfo(n,s,c);return engine().makeTensorFromDataId(f,n,s,this)}unpackTensor(n){const s=new UnpackProgram(n.shape);return this.runWebGLProgram(s,[n],n.dtype)}packTensor(n){const s=new PackProgram(n.shape);return this.runWebGLProgram(s,[n],n.dtype,null,!0)}packedReshape(n,s){const c=[getBatchDim(n.shape),...getRowsCols(n.shape)],f={dtype:n.dtype,shape:c,dataId:n.dataId},g=[getBatchDim(s),...getRowsCols(s)],A=new ReshapePackedProgram(g,c),v=!0,y=[c],T=this.runWebGLProgram(A,[f],n.dtype,y,v);return{dataId:T.dataId,shape:s,dtype:T.dtype}}decode(n){const s=this.texData.get(n),{isPacked:c,shape:f,dtype:g}=s,A=getShapeAs3D(f);let v;const y=getDenseTexShape(A);c?v=new DecodeMatrixPackedProgram(A):v=new DecodeMatrixProgram(A);const T=!0,I=[y],S=this.runWebGLProgram(v,[{shape:A,dtype:g,dataId:n}],g,I,T);return{dtype:g,shape:f,dataId:S.dataId}}runWebGLProgram(n,s,c,f,g=!1){const A=this.makeTensorInfo(n.outputShape,c),v=this.texData.get(A.dataId);if(n.packedOutput&&(v.isPacked=!0),n.outPackingScheme===PackingScheme.DENSE){const O=getDenseTexShape(n.outputShape);v.texShape=O.map(z=>z*2)}if(n.outTexUsage!=null&&(v.usage=n.outTexUsage),sizeFromShape(A.shape)===0)return v.values=getTypedArrayFromDType(A.dtype,0),A;const y=[],T=s.map(O=>{if(O.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let z=this.texData.get(O.dataId);if(z.texture==null){if(!n.packedInputs&&sizeFromShape(O.shape)<=env().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:O.shape,texData:null,isUniform:!0,uniformValues:z.values};n.packedInputs&&(z.isPacked=!0,z.shape=O.shape)}else if(!!z.isPacked!=!!n.packedInputs)O=z.isPacked?this.unpackTensor(O):this.packTensor(O),y.push(O),z=this.texData.get(O.dataId);else if(z.isPacked&&!isReshapeFree(z.shape,O.shape)){const B=O,V=O.shape;O.shape=z.shape,O=this.packedReshape(O,V),y.push(O),z=this.texData.get(O.dataId),B.shape=V}return this.uploadToGPU(O.dataId),{shape:O.shape,texData:z,isUniform:!1}});this.uploadToGPU(A.dataId);const I={shape:A.shape,texData:v,isUniform:!1},S=makeShaderKey(n,T,I),k=this.getAndSaveBinary(S,()=>compileProgram(this.gpgpu,n,T,I)),e=this.activeTimers!=null;let N;e&&(N=this.startTimer()),runProgram(this.gpgpu,k,T,I,f),y.forEach(O=>this.disposeIntermediateTensorInfo(O)),e&&(N=this.endTimer(N),this.activeTimers.push({name:n.constructor.name,query:this.getQueryTime(N)}));const M=env().get("WEBGL_FLUSH_THRESHOLD");if(M>0){const O=now();O-this.lastGlFlushTime>M&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=O)}if(!env().getBool("WEBGL_LAZILY_UNPACK")&&v.isPacked&&g===!1){const O=this.unpackTensor(A);return this.disposeIntermediateTensorInfo(A),O}return A}compileAndRun(n,s,c,f,g=!1){return c=c||s[0].dtype,this.runWebGLProgram(n,s,c,f,g)}getAndSaveBinary(n,s){return n in this.binaryCache||(this.binaryCache[n]=s()),this.binaryCache[n]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(env().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(s=>{this.gpgpu.deleteProgram(this.binaryCache[s].webGLProgram),delete this.binaryCache[s]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement<"u"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return this.floatPrecisionValue==null&&(this.floatPrecisionValue=tidy(()=>{if(!env().get("WEBGL_RENDER_FLOAT32_ENABLED")){const n=env().getBool("DEBUG");env().set("DEBUG",!1);const s=this.abs(scalar(1e-8)).dataSync()[0];if(env().set("DEBUG",n),s>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?EPSILON_FLOAT32:EPSILON_FLOAT16}uploadToGPU(n){const s=this.texData.get(n),{shape:c,dtype:f,values:g,texture:A,usage:v,isPacked:y}=s;if(A!=null)return;const T=this.activeTimers!=null;let I;T&&(I=now());let S=s.texShape;if(S==null&&(S=getTextureShapeFromLogicalShape(c,y),s.texShape=S),g!=null){const k=getShapeAs3D(c);let e,N=S[1],M=S[0];const O=g instanceof Uint8Array;y?([N,M]=getPackedMatrixTextureShapeWidthHeight(S[0],S[1]),e=new EncodeMatrixPackedProgram(k,O)):e=new EncodeMatrixProgram(k,O);const z=this.makeTensorInfo([M,N],f);O?this.texData.get(z.dataId).usage=TextureUsage.PIXELS:this.texData.get(z.dataId).usage=TextureUsage.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(z.dataId),N,M,g);const B=[[M,N]],b=this.runWebGLProgram(e,[z],f,B,!0),W=this.texData.get(b.dataId);s.texture=W.texture,s.texShape=W.texShape,s.isPacked=W.isPacked,s.usage=W.usage,this.disposeIntermediateTensorInfo(z),this.texData.delete(b.dataId),s.values=null,T&&(this.uploadWaitMs+=now()-I)}else{const k=this.acquireTexture(S,v,f,y);s.texture=k}}convertAndCacheOnCPU(n,s){const c=this.texData.get(n),{dtype:f}=c;return this.releaseGPUData(n),s!=null&&(c.values=float32ToTypedArray(s,f)),c.values}acquireTexture(n,s,c,f){if(this.numBytesInGPU+=this.computeBytes(n,c),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){const g=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${g} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(n,s,f)}computeBytes(n,s){return n[0]*n[1]*bytesPerElement(s)}}MathBackendWebGL.nextDataId=0;function float32ToTypedArray(u,n){if(n==="float32"||n==="complex64")return u;if(n==="int32"||n==="bool"){const s=n==="int32"?new Int32Array(u.length):new Uint8Array(u.length);for(let c=0;cN.push(M))}const s=this.texData.get(n),{values:c,shape:f,slice:g,dtype:A,complexTensorInfos:v,isPacked:y}=s;if(g!=null){let N;y?N=new UnaryOpPackedProgram(f,CLONE):N=new UnaryOpProgram(f,CLONE);const M=this.runWebGLProgram(N,[{dataId:n,shape:f,dtype:A}],A),O=this.read(M.dataId);return this.disposeIntermediateTensorInfo(M),O}if(c!=null)return this.convertAndCacheOnCPU(n);if(!env().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&env().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let T=null,I;if(A!=="complex64"&&env().get("WEBGL_BUFFER_SUPPORTED")){I=this.decode(n);const N=this.texData.get(I.dataId);T=this.gpgpu.createBufferFromTexture(N.texture,...getDenseTexShape(f))}this.pendingRead.set(n,[]),A!=="complex64"&&await this.gpgpu.createAndWaitForFence();let S;if(A==="complex64"){const N=await Promise.all([this.read(v.real.dataId),this.read(v.imag.dataId)]),M=N[0],O=N[1];S=mergeRealAndImagArrays(M,O)}else if(T==null)S=this.getValuesFromTexture(n);else{const N=sizeFromShape(f);S=this.gpgpu.downloadFloat32MatrixFromBuffer(T,N)}if(I!=null&&this.disposeIntermediateTensorInfo(I),T!=null){const N=this.gpgpu.gl;callAndCheck(N,()=>N.deleteBuffer(T))}const k=this.convertAndCacheOnCPU(n,S),e=this.pendingRead.get(n);return this.pendingRead.delete(n),e.forEach(N=>N(k)),this.pendingDisposal.has(n)&&(this.pendingDisposal.delete(n),this.disposeData(n)&&engine().removeDataId(n,this),this.pendingDeletes--),k}bufferSync(n){const s=this.readSync(n.dataId);let c=s;if(n.dtype==="string")try{c=s.map(f=>decodeString(f))}catch{throw new Error("Failed to decode encoded string bytes into utf-8")}return buffer(n.shape,n.dtype,c)}checkNumericalProblems(n){if(n!=null)for(let s=0;s0}async time(n){const s=this.activeTimers,c=[];let f=!1;this.programTimersStack==null?(this.programTimersStack=c,f=!0):this.activeTimers.push(c),this.activeTimers=c,n();const g=flatten$1(this.activeTimers.map(y=>y.query)).filter(y=>y!=null),A=flatten$1(this.activeTimers.map(y=>y.name)).filter(y=>y!=null);this.activeTimers=s,f&&(this.programTimersStack=null);const v={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};if(env().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const y=await Promise.all(g);v.kernelMs=sum$3(y),v.getExtraProfileInfo=()=>y.map((T,I)=>({name:A[I],ms:T})).map(T=>`${T.name}: ${T.ms}`).join(", ")}else v.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,v}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return env().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:now(),endMs:null}}endTimer(n){return env().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),n):(n.endMs=now(),n)}async getQueryTime(n){if(env().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(n);const s=n;return s.endMs-s.startMs}disposeData(n,s=!1){if(this.pendingDisposal.has(n))return!1;if(!this.texData.has(n))return!0;if(s?this.texData.get(n).refCount=0:this.texData.get(n).refCount--,!s&&this.texData.get(n).refCount>0)return!1;if(this.pendingRead.has(n))return this.pendingDisposal.add(n),this.pendingDeletes++,!1;this.releaseGPUData(n);const{complexTensorInfos:c}=this.texData.get(n);return c!=null&&(this.disposeData(c.real.dataId,s),this.disposeData(c.imag.dataId,s)),this.texData.delete(n),!0}releaseGPUData(n){const{texture:s,dtype:c,texShape:f,usage:g,isPacked:A,slice:v}=this.texData.get(n),y=v&&v.origDataId||n,T=this.dataRefCount.get(y);T>1?this.dataRefCount.set(y,T-1):(this.dataRefCount.delete(y),s!=null&&(this.numBytesInGPU-=this.computeBytes(f,c),this.textureManager.releaseTexture(s,f,g,A)));const I=this.texData.get(n);I.texture=null,I.texShape=null,I.isPacked=!1,I.slice=null}getTexture(n){return this.uploadToGPU(n),this.texData.get(n).texture}getDataInfo(n){return this.texData.get(n)}shouldExecuteOnCPU(n,s=CPU_HANDOFF_SIZE_THRESHOLD){return env().getBool("WEBGL_CPU_FORWARD")&&n.every(c=>this.texData.get(c.dataId).texture==null&&sizeFromShape(c.shape)0&&isString(c[0])){const g=c.map(A=>encodeString(A));f=this.write(g,n,s)}else f=this.write(c,n,s);return this.texData.get(f).usage=null,{dataId:f,shape:n,dtype:s}}makeOutput(n,s,c){const{dataId:f}=this.makeTensorInfo(n,s,c);return engine().makeTensorFromDataId(f,n,s,this)}unpackTensor(n){const s=new UnpackProgram(n.shape);return this.runWebGLProgram(s,[n],n.dtype)}packTensor(n){const s=new PackProgram(n.shape);return this.runWebGLProgram(s,[n],n.dtype,null,!0)}packedReshape(n,s){const c=[getBatchDim(n.shape),...getRowsCols(n.shape)],f={dtype:n.dtype,shape:c,dataId:n.dataId},g=[getBatchDim(s),...getRowsCols(s)],A=new ReshapePackedProgram(g,c),v=!0,y=[c],T=this.runWebGLProgram(A,[f],n.dtype,y,v);return{dataId:T.dataId,shape:s,dtype:T.dtype}}decode(n){const s=this.texData.get(n),{isPacked:c,shape:f,dtype:g}=s,A=getShapeAs3D(f);let v;const y=getDenseTexShape(A);c?v=new DecodeMatrixPackedProgram(A):v=new DecodeMatrixProgram(A);const T=!0,I=[y],S=this.runWebGLProgram(v,[{shape:A,dtype:g,dataId:n}],g,I,T);return{dtype:g,shape:f,dataId:S.dataId}}runWebGLProgram(n,s,c,f,g=!1){const A=this.makeTensorInfo(n.outputShape,c),v=this.texData.get(A.dataId);if(n.packedOutput&&(v.isPacked=!0),n.outPackingScheme===PackingScheme.DENSE){const O=getDenseTexShape(n.outputShape);v.texShape=O.map(U=>U*2)}if(n.outTexUsage!=null&&(v.usage=n.outTexUsage),sizeFromShape(A.shape)===0)return v.values=getTypedArrayFromDType(A.dtype,0),A;const y=[],T=s.map(O=>{if(O.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let U=this.texData.get(O.dataId);if(U.texture==null){if(!n.packedInputs&&sizeFromShape(O.shape)<=env().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:O.shape,texData:null,isUniform:!0,uniformValues:U.values};n.packedInputs&&(U.isPacked=!0,U.shape=O.shape)}else if(!!U.isPacked!=!!n.packedInputs)O=U.isPacked?this.unpackTensor(O):this.packTensor(O),y.push(O),U=this.texData.get(O.dataId);else if(U.isPacked&&!isReshapeFree(U.shape,O.shape)){const B=O,V=O.shape;O.shape=U.shape,O=this.packedReshape(O,V),y.push(O),U=this.texData.get(O.dataId),B.shape=V}return this.uploadToGPU(O.dataId),{shape:O.shape,texData:U,isUniform:!1}});this.uploadToGPU(A.dataId);const I={shape:A.shape,texData:v,isUniform:!1},S=makeShaderKey(n,T,I),k=this.getAndSaveBinary(S,()=>compileProgram(this.gpgpu,n,T,I)),e=this.activeTimers!=null;let N;e&&(N=this.startTimer()),runProgram(this.gpgpu,k,T,I,f),y.forEach(O=>this.disposeIntermediateTensorInfo(O)),e&&(N=this.endTimer(N),this.activeTimers.push({name:n.constructor.name,query:this.getQueryTime(N)}));const M=env().get("WEBGL_FLUSH_THRESHOLD");if(M>0){const O=now();O-this.lastGlFlushTime>M&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=O)}if(!env().getBool("WEBGL_LAZILY_UNPACK")&&v.isPacked&&g===!1){const O=this.unpackTensor(A);return this.disposeIntermediateTensorInfo(A),O}return A}compileAndRun(n,s,c,f,g=!1){return c=c||s[0].dtype,this.runWebGLProgram(n,s,c,f,g)}getAndSaveBinary(n,s){return n in this.binaryCache||(this.binaryCache[n]=s()),this.binaryCache[n]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(env().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(s=>{this.gpgpu.deleteProgram(this.binaryCache[s].webGLProgram),delete this.binaryCache[s]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement<"u"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return this.floatPrecisionValue==null&&(this.floatPrecisionValue=tidy(()=>{if(!env().get("WEBGL_RENDER_FLOAT32_ENABLED")){const n=env().getBool("DEBUG");env().set("DEBUG",!1);const s=this.abs(scalar(1e-8)).dataSync()[0];if(env().set("DEBUG",n),s>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?EPSILON_FLOAT32:EPSILON_FLOAT16}uploadToGPU(n){const s=this.texData.get(n),{shape:c,dtype:f,values:g,texture:A,usage:v,isPacked:y}=s;if(A!=null)return;const T=this.activeTimers!=null;let I;T&&(I=now());let S=s.texShape;if(S==null&&(S=getTextureShapeFromLogicalShape(c,y),s.texShape=S),g!=null){const k=getShapeAs3D(c);let e,N=S[1],M=S[0];const O=g instanceof Uint8Array;y?([N,M]=getPackedMatrixTextureShapeWidthHeight(S[0],S[1]),e=new EncodeMatrixPackedProgram(k,O)):e=new EncodeMatrixProgram(k,O);const U=this.makeTensorInfo([M,N],f);O?this.texData.get(U.dataId).usage=TextureUsage.PIXELS:this.texData.get(U.dataId).usage=TextureUsage.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(U.dataId),N,M,g);const B=[[M,N]],b=this.runWebGLProgram(e,[U],f,B,!0),W=this.texData.get(b.dataId);s.texture=W.texture,s.texShape=W.texShape,s.isPacked=W.isPacked,s.usage=W.usage,this.disposeIntermediateTensorInfo(U),this.texData.delete(b.dataId),s.values=null,T&&(this.uploadWaitMs+=now()-I)}else{const k=this.acquireTexture(S,v,f,y);s.texture=k}}convertAndCacheOnCPU(n,s){const c=this.texData.get(n),{dtype:f}=c;return this.releaseGPUData(n),s!=null&&(c.values=float32ToTypedArray(s,f)),c.values}acquireTexture(n,s,c,f){if(this.numBytesInGPU+=this.computeBytes(n,c),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){const g=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${g} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(n,s,f)}computeBytes(n,s){return n[0]*n[1]*bytesPerElement(s)}}MathBackendWebGL.nextDataId=0;function float32ToTypedArray(u,n){if(n==="float32"||n==="complex64")return u;if(n==="int32"||n==="bool"){const s=n==="int32"?new Int32Array(u.length):new Uint8Array(u.length);for(let c=0;c 0. ? NAN : result.g; result.b = isNaN.b > 0. ? NAN : result.b; result.a = isNaN.a > 0. ? NAN : result.a; -`;function unaryKernelFunc({opSnippet:u,packedOpSnippet:n,cpuKernelImpl:s,dtype:c}){return({inputs:f,backend:g})=>{const{x:A}=f,v=g,y=c||A.dtype;if(v.shouldExecuteOnCPU([A])&&s!=null){const S=v.texData.get(A.dataId),k=s(S.values,y);return v.makeTensorInfo(A.shape,y,k)}const T=env().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&n!=null;let I;return T?I=new UnaryOpPackedProgram(A.shape,n):I=new UnaryOpProgram(A.shape,u),v.runWebGLProgram(I,[A],y)}}function binaryKernelFunc({opSnippet:u,packedOpSnippet:n,checkOutOfBounds:s=!1,supportsComplex:c=!1,cpuKernelImpl:f,dtype:g}){return({inputs:A,backend:v})=>{const{a:y,b:T}=A,I=v;if(c&&y.dtype==="complex64"){const N=I.texData.get(y.dataId),M=I.texData.get(T.dataId),[O,z]=[[N.complexTensorInfos.real,M.complexTensorInfos.real],[N.complexTensorInfos.imag,M.complexTensorInfos.imag]].map(V=>{const[b,W]=V,q={dataId:b.dataId,dtype:b.dtype,shape:y.shape},Y={dataId:W.dataId,dtype:W.dtype,shape:T.shape},X=new BinaryOpProgram(u,y.shape,T.shape);return I.runWebGLProgram(X,[q,Y],upcastType(b.dtype,W.dtype))}),B=complex({inputs:{real:O,imag:z},backend:I});return I.disposeIntermediateTensorInfo(O),I.disposeIntermediateTensorInfo(z),B}const S=g||upcastType(y.dtype,T.dtype);if((y.dtype==="string"||T.dtype==="string"||I.shouldExecuteOnCPU([y,T]))&&f!=null){const N=I.texData.get(y.dataId).values,M=I.texData.get(T.dataId).values,O=y.dtype==="string"?fromUint8ToStringArray(N):N,z=y.dtype==="string"?fromUint8ToStringArray(M):M,[B,V]=f(y.shape,T.shape,O,z,S),b=I.makeTensorInfo(V,S),W=I.texData.get(b.dataId);return W.values=B,b}const k=env().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&n!=null;let e;return k?e=new BinaryOpPackedProgram(n,y.shape,T.shape,s):e=new BinaryOpProgram(u,y.shape,T.shape),I.runWebGLProgram(e,[y,T],S)}}function mapActivationToShaderProgram(u,n=!1){if(u==="linear")return n?LINEAR:LINEAR$1;if(u==="relu")return n?RELU$1:RELU$2;if(u==="elu")return n?ELU$1:ELU$2;if(u==="relu6")return n?RELU6$1:RELU6$2;if(u==="prelu")return n?PRELU_PACKED:PRELU;if(u==="leakyrelu")return n?LEAKYRELU_PACKED:LEAKYRELU;if(u==="sigmoid")return n?SIGMOID$1:SIGMOID$2;throw new Error(`Activation ${u} has not been implemented for the WebGL backend.`)}/** +`;function unaryKernelFunc({opSnippet:u,packedOpSnippet:n,cpuKernelImpl:s,dtype:c}){return({inputs:f,backend:g})=>{const{x:A}=f,v=g,y=c||A.dtype;if(v.shouldExecuteOnCPU([A])&&s!=null){const S=v.texData.get(A.dataId),k=s(S.values,y);return v.makeTensorInfo(A.shape,y,k)}const T=env().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&n!=null;let I;return T?I=new UnaryOpPackedProgram(A.shape,n):I=new UnaryOpProgram(A.shape,u),v.runWebGLProgram(I,[A],y)}}function binaryKernelFunc({opSnippet:u,packedOpSnippet:n,checkOutOfBounds:s=!1,supportsComplex:c=!1,cpuKernelImpl:f,dtype:g}){return({inputs:A,backend:v})=>{const{a:y,b:T}=A,I=v;if(c&&y.dtype==="complex64"){const N=I.texData.get(y.dataId),M=I.texData.get(T.dataId),[O,U]=[[N.complexTensorInfos.real,M.complexTensorInfos.real],[N.complexTensorInfos.imag,M.complexTensorInfos.imag]].map(V=>{const[b,W]=V,q={dataId:b.dataId,dtype:b.dtype,shape:y.shape},Y={dataId:W.dataId,dtype:W.dtype,shape:T.shape},X=new BinaryOpProgram(u,y.shape,T.shape);return I.runWebGLProgram(X,[q,Y],upcastType(b.dtype,W.dtype))}),B=complex({inputs:{real:O,imag:U},backend:I});return I.disposeIntermediateTensorInfo(O),I.disposeIntermediateTensorInfo(U),B}const S=g||upcastType(y.dtype,T.dtype);if((y.dtype==="string"||T.dtype==="string"||I.shouldExecuteOnCPU([y,T]))&&f!=null){const N=I.texData.get(y.dataId).values,M=I.texData.get(T.dataId).values,O=y.dtype==="string"?fromUint8ToStringArray(N):N,U=y.dtype==="string"?fromUint8ToStringArray(M):M,[B,V]=f(y.shape,T.shape,O,U,S),b=I.makeTensorInfo(V,S),W=I.texData.get(b.dataId);return W.values=B,b}const k=env().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&n!=null;let e;return k?e=new BinaryOpPackedProgram(n,y.shape,T.shape,s):e=new BinaryOpProgram(u,y.shape,T.shape),I.runWebGLProgram(e,[y,T],S)}}function mapActivationToShaderProgram(u,n=!1){if(u==="linear")return n?LINEAR:LINEAR$1;if(u==="relu")return n?RELU$1:RELU$2;if(u==="elu")return n?ELU$1:ELU$2;if(u==="relu6")return n?RELU6$1:RELU6$2;if(u==="prelu")return n?PRELU_PACKED:PRELU;if(u==="leakyrelu")return n?LEAKYRELU_PACKED:LEAKYRELU;if(u==="sigmoid")return n?SIGMOID$1:SIGMOID$2;throw new Error(`Activation ${u} has not been implemented for the WebGL backend.`)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -14068,7 +14068,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */class MatMulPackedProgram{constructor(n,s,c,f=!1,g=!1,A=!1,v=null,y=!1,T=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=c,this.enableShapeUniforms=useShapeUniforms(this.outputShape.length);const I=f?n[1]:n[2],S=Math.ceil(I/2),k=f?"i * 2, rc.y":"rc.y, i * 2",e=g?"rc.z, i * 2":"i * 2, rc.z",N=f?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],M=g?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let O="",z="";v&&(y?O=`vec4 activation(vec4 a) { + */class MatMulPackedProgram{constructor(n,s,c,f=!1,g=!1,A=!1,v=null,y=!1,T=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=c,this.enableShapeUniforms=useShapeUniforms(this.outputShape.length);const I=f?n[1]:n[2],S=Math.ceil(I/2),k=f?"i * 2, rc.y":"rc.y, i * 2",e=g?"rc.z, i * 2":"i * 2, rc.z",N=f?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],M=g?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let O="",U="";v&&(y?O=`vec4 activation(vec4 a) { vec4 b = getPreluActivationWeightsAtOutCoords(); ${v} }`:T?O=`vec4 activation(vec4 a) { @@ -14076,7 +14076,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${v} }`:O=`vec4 activation(vec4 x) { ${v} - }`,z="result = activation(result);");const B=A?"result += getBiasAtOutCoords();":"";A&&this.variableNames.push("bias"),y&&this.variableNames.push("preluActivationWeights"),T&&this.variableNames.push("leakyreluAlpha");let V="rc.x",b="rc.x";n[0]=2&&I>=2&&V,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${M}) and (${O}).`);const W=(z>B?u.shape.slice(0,-2):n.shape.slice(0,-2)).concat([e,N]);assert$1(S===k,()=>`Error in matMul: inner shapes (${S}) and (${k}) of Tensors with shapes ${u.shape} and ${n.shape} and transposeA=${s} and transposeB=${c} must match.`);const q=s?[z,S,e]:[z,e,S],Y=c?[B,N,k]:[B,k,N],X=reshape({inputs:{x:u},backend:f,attrs:{shape:q}}),Q=reshape({inputs:{x:n},backend:f,attrs:{shape:Y}}),m=[X,Q],Z=Math.max(z,B),ee=s?X.shape[1]:X.shape[2],oe=g!=null,fe=A!=null,me=y==="leakyrelu",pe=y!=null?mapActivationToShaderProgram(y,!0):null,Se=oe||fe||me||pe!=null;let xe;if((e===1||N===1)&&ee>MATMUL_SHARED_DIM_THRESHOLD&&Se===!1){let Fe=X,De=Q;s&&(Fe=transpose({inputs:{x:X},backend:f,attrs:{perm:[0,2,1]}}),m.push(Fe)),c&&(De=transpose({inputs:{x:Q},backend:f,attrs:{perm:[0,2,1]}}),m.push(De));const Ze=N!==1,nt=N===1;let Ue=Fe;Ze&&(Ue=reshape({inputs:{x:Fe},backend:f,attrs:{shape:[Z,ee,1]}}),m.push(Ue));const ye=N===1?2:1;let at=De;nt&&(at=reshape({inputs:{x:De},backend:f,attrs:{shape:[Z,1,ee]}}),m.push(at));const ft=multiply({inputs:{a:Ue,b:at},backend:f});xe=sum({inputs:{x:ft},backend:f,attrs:{axis:ye,keepDims:!0}}),m.push(ft)}else{const Fe=upcastType(u.dtype,n.dtype),De=new MatMulPackedProgram(q,Y,[Z,e,N],s,c,oe,pe,fe,me),Ze=[X,Q];if(g!=null&&Ze.push(g),fe&&Ze.push(A),me){const nt=f.makeTensorInfo([],"float32",createScalarValue(v,"float32"));Ze.push(nt),m.push(nt)}xe=f.runWebGLProgram(De,Ze,Fe)}const we=reshape({inputs:{x:xe},backend:f,attrs:{shape:W}});m.push(xe);for(const Fe of m)f.disposeIntermediateTensorInfo(Fe);return we}/** + */const MATMUL_SHARED_DIM_THRESHOLD=1e3;function batchMatMulImpl({a:u,b:n,transposeA:s,transposeB:c,backend:f,bias:g=null,preluActivationWeights:A=null,leakyreluAlpha:v=0,activation:y=null}){const T=u.shape.length,I=n.shape.length,S=s?u.shape[T-2]:u.shape[T-1],k=c?n.shape[I-1]:n.shape[I-2],e=s?u.shape[T-1]:u.shape[T-2],N=c?n.shape[I-2]:n.shape[I-1],M=u.shape.slice(0,-2),O=n.shape.slice(0,-2),U=sizeFromShape(M),B=sizeFromShape(O),V=U===B||U===1||B===1;assert$1(T>=2&&I>=2&&V,()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${M}) and (${O}).`);const W=(U>B?u.shape.slice(0,-2):n.shape.slice(0,-2)).concat([e,N]);assert$1(S===k,()=>`Error in matMul: inner shapes (${S}) and (${k}) of Tensors with shapes ${u.shape} and ${n.shape} and transposeA=${s} and transposeB=${c} must match.`);const q=s?[U,S,e]:[U,e,S],Y=c?[B,N,k]:[B,k,N],X=reshape({inputs:{x:u},backend:f,attrs:{shape:q}}),Q=reshape({inputs:{x:n},backend:f,attrs:{shape:Y}}),m=[X,Q],Z=Math.max(U,B),ee=s?X.shape[1]:X.shape[2],oe=g!=null,fe=A!=null,me=y==="leakyrelu",pe=y!=null?mapActivationToShaderProgram(y,!0):null,Se=oe||fe||me||pe!=null;let xe;if((e===1||N===1)&&ee>MATMUL_SHARED_DIM_THRESHOLD&&Se===!1){let Fe=X,De=Q;s&&(Fe=transpose({inputs:{x:X},backend:f,attrs:{perm:[0,2,1]}}),m.push(Fe)),c&&(De=transpose({inputs:{x:Q},backend:f,attrs:{perm:[0,2,1]}}),m.push(De));const Ze=N!==1,nt=N===1;let Ue=Fe;Ze&&(Ue=reshape({inputs:{x:Fe},backend:f,attrs:{shape:[Z,ee,1]}}),m.push(Ue));const ye=N===1?2:1;let at=De;nt&&(at=reshape({inputs:{x:De},backend:f,attrs:{shape:[Z,1,ee]}}),m.push(at));const ft=multiply({inputs:{a:Ue,b:at},backend:f});xe=sum({inputs:{x:ft},backend:f,attrs:{axis:ye,keepDims:!0}}),m.push(ft)}else{const Fe=upcastType(u.dtype,n.dtype),De=new MatMulPackedProgram(q,Y,[Z,e,N],s,c,oe,pe,fe,me),Ze=[X,Q];if(g!=null&&Ze.push(g),fe&&Ze.push(A),me){const nt=f.makeTensorInfo([],"float32",createScalarValue(v,"float32"));Ze.push(nt),m.push(nt)}xe=f.runWebGLProgram(De,Ze,Fe)}const we=reshape({inputs:{x:xe},backend:f,attrs:{shape:W}});m.push(xe);for(const Fe of m)f.disposeIntermediateTensorInfo(Fe);return we}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); @@ -14655,7 +14655,7 @@ return log(x + sqrt(x * x - 1.0));`,acosh=unaryKernelFunc({opSnippet:ACOSH}),aco * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function all(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,keepDims:A}=c,v=f.shape.length,y=parseAxisParam(g,f.shape);let T=y;const I=getAxesPermutation(T,v);let S=f;I!=null&&(S=transpose({inputs:{x:f},backend:s,attrs:{perm:I}}),T=getInnerMostAxes(T.length,v)),assertAxesAreInnerMostDims("all",T,v);const[k,e]=computeOutAndReduceShapes(S.shape,T),N=sizeFromShape(e),M=reshape({inputs:{x:S},backend:s,attrs:{shape:[-1,N]}}),O=reduce(M,M.dtype,"all",s);let z;if(A){const B=expandShapeToKeepDim(k,y);z=reshape({inputs:{x:O},backend:s,attrs:{shape:B}})}else z=reshape({inputs:{x:O},backend:s,attrs:{shape:k}});return s.disposeIntermediateTensorInfo(M),s.disposeIntermediateTensorInfo(O),I!=null&&s.disposeIntermediateTensorInfo(S),z}const allConfig={kernelName:All,backendName:"webgl",kernelFunc:all};/** + */function all(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,keepDims:A}=c,v=f.shape.length,y=parseAxisParam(g,f.shape);let T=y;const I=getAxesPermutation(T,v);let S=f;I!=null&&(S=transpose({inputs:{x:f},backend:s,attrs:{perm:I}}),T=getInnerMostAxes(T.length,v)),assertAxesAreInnerMostDims("all",T,v);const[k,e]=computeOutAndReduceShapes(S.shape,T),N=sizeFromShape(e),M=reshape({inputs:{x:S},backend:s,attrs:{shape:[-1,N]}}),O=reduce(M,M.dtype,"all",s);let U;if(A){const B=expandShapeToKeepDim(k,y);U=reshape({inputs:{x:O},backend:s,attrs:{shape:B}})}else U=reshape({inputs:{x:O},backend:s,attrs:{shape:k}});return s.disposeIntermediateTensorInfo(M),s.disposeIntermediateTensorInfo(O),I!=null&&s.disposeIntermediateTensorInfo(S),U}const allConfig={kernelName:All,backendName:"webgl",kernelFunc:all};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -14670,7 +14670,7 @@ return log(x + sqrt(x * x - 1.0));`,acosh=unaryKernelFunc({opSnippet:ACOSH}),aco * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function any(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,keepDims:A}=c,v=f.shape.length,y=parseAxisParam(g,f.shape);let T=y;const I=getAxesPermutation(T,v);let S=f;I!=null&&(S=transpose({inputs:{x:f},backend:s,attrs:{perm:I}}),T=getInnerMostAxes(T.length,v)),assertAxesAreInnerMostDims("any",T,v);const[k,e]=computeOutAndReduceShapes(S.shape,T),N=sizeFromShape(e),M=reshape({inputs:{x:S},backend:s,attrs:{shape:[-1,N]}}),O=reduce(M,M.dtype,"any",s);let z;if(A){const B=expandShapeToKeepDim(k,y);z=reshape({inputs:{x:O},backend:s,attrs:{shape:B}})}else z=reshape({inputs:{x:O},backend:s,attrs:{shape:k}});return s.disposeIntermediateTensorInfo(M),s.disposeIntermediateTensorInfo(O),I!=null&&s.disposeIntermediateTensorInfo(S),z}const anyConfig={kernelName:Any,backendName:"webgl",kernelFunc:any};/** + */function any(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,keepDims:A}=c,v=f.shape.length,y=parseAxisParam(g,f.shape);let T=y;const I=getAxesPermutation(T,v);let S=f;I!=null&&(S=transpose({inputs:{x:f},backend:s,attrs:{perm:I}}),T=getInnerMostAxes(T.length,v)),assertAxesAreInnerMostDims("any",T,v);const[k,e]=computeOutAndReduceShapes(S.shape,T),N=sizeFromShape(e),M=reshape({inputs:{x:S},backend:s,attrs:{shape:[-1,N]}}),O=reduce(M,M.dtype,"any",s);let U;if(A){const B=expandShapeToKeepDim(k,y);U=reshape({inputs:{x:O},backend:s,attrs:{shape:B}})}else U=reshape({inputs:{x:O},backend:s,attrs:{shape:k}});return s.disposeIntermediateTensorInfo(M),s.disposeIntermediateTensorInfo(O),I!=null&&s.disposeIntermediateTensorInfo(S),U}const anyConfig={kernelName:Any,backendName:"webgl",kernelFunc:any};/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -14736,13 +14736,13 @@ return log(x + sqrt(x * x - 1.0));`,acosh=unaryKernelFunc({opSnippet:ACOSH}),aco ${T} sourceLocA = coords; --${I[y-1]}; ${T} sourceLocB = coords; - --${I[y-2]};`;const e=["x","y","z","w","u","v"].slice(0,k),N="."+e[k-1],M=e.map(X=>"int "+X),O=getChannels("sourceLocR",k-1).concat("inIdx.r"),z=getChannels("sourceLocG",k-1).concat("inIdx.g"),B=getChannels("sourceLocB",k-1).concat("inIdx.b"),V=getChannels("sourceLocA",k-1).concat("inIdx.a"),b=c==="max"?"greaterThan":"lessThan",W=f?"":` + --${I[y-2]};`;const e=["x","y","z","w","u","v"].slice(0,k),N="."+e[k-1],M=e.map(X=>"int "+X),O=getChannels("sourceLocR",k-1).concat("inIdx.r"),U=getChannels("sourceLocG",k-1).concat("inIdx.g"),B=getChannels("sourceLocB",k-1).concat("inIdx.b"),V=getChannels("sourceLocA",k-1).concat("inIdx.a"),b=c==="max"?"greaterThan":"lessThan",W=f?"":` inIdx = round(vec4(getBestIndicesAChannel(${O.join()}), - getBestIndicesAChannel(${z.join()}), + getBestIndicesAChannel(${U.join()}), getBestIndicesAChannel(${B.join()}), getBestIndicesAChannel(${V.join()})));`,q=`vec4( getAChannel(${O.join()}), - hasNextCol ? getAChannel(${z.join()}) : 0., + hasNextCol ? getAChannel(${U.join()}) : 0., hasNextRow ? getAChannel(${B.join()}) : 0., hasNextRow && hasNextCol ? getAChannel(${V.join()}) : 0.)`,Y=f?"":` float getBestIndicesAChannel(${M.join()}) { @@ -14933,7 +14933,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */class Pool2DProgram{constructor(n,s,c,f=!1,g=!1){if(this.variableNames=["x"],s==="avg"&&c)throw new Error("Cannot compute positions for average pool.");const A=n.filterWidth,v=n.strideHeight,y=n.strideWidth,T=n.dilationHeight,I=n.dilationWidth,S=n.effectiveFilterHeight,k=n.effectiveFilterWidth,e=n.padInfo.top,N=n.padInfo.left;this.outputShape=n.outShape;const M=s==="avg",O=`((batch * ${n.inHeight} + xR) * ${n.inWidth} + xC) * ${n.inChannels} + d`,z=`(xR * ${n.inWidth} + xC) * ${n.inChannels} + d`;let B="0.0";if(M||(B="-1.0 / 1e-20"),c){const X=">=";this.userCode=` + */class Pool2DProgram{constructor(n,s,c,f=!1,g=!1){if(this.variableNames=["x"],s==="avg"&&c)throw new Error("Cannot compute positions for average pool.");const A=n.filterWidth,v=n.strideHeight,y=n.strideWidth,T=n.dilationHeight,I=n.dilationWidth,S=n.effectiveFilterHeight,k=n.effectiveFilterWidth,e=n.padInfo.top,N=n.padInfo.left;this.outputShape=n.outShape;const M=s==="avg",O=`((batch * ${n.inHeight} + xR) * ${n.inWidth} + xC) * ${n.inChannels} + d`,U=`(xR * ${n.inWidth} + xC) * ${n.inChannels} + d`;let B="0.0";if(M||(B="-1.0 / 1e-20"),c){const X=">=";this.userCode=` const ivec2 strides = ivec2(${v}, ${y}); const ivec2 pads = ivec2(${e}, ${N}); @@ -14978,7 +14978,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT if (value ${X} currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; - minMaxPosition = ${f?g?O:z:`wR * ${k} + wC`}; + minMaxPosition = ${f?g?O:U:`wR * ${k} + wC`}; } } } @@ -15074,10 +15074,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT } setOutput(${b}); } - `}}class Pool3DProgram{constructor(n,s,c,f=!1,g=!1){if(this.variableNames=["x"],s==="avg"&&c)throw new Error("Cannot compute positions for average pool.");const A=n.filterWidth,v=n.strideDepth,y=n.strideHeight,T=n.strideWidth,I=n.dilationDepth,S=n.dilationHeight,k=n.dilationWidth,e=n.effectiveFilterDepth,N=n.effectiveFilterHeight,M=n.effectiveFilterWidth,O=n.padInfo.front,z=n.padInfo.top,B=n.padInfo.left;this.outputShape=n.outShape;const V=s==="avg";let b="0.0";if(V||(b="-1.0 / 1e-20"),c){const m=">=";this.userCode=` + `}}class Pool3DProgram{constructor(n,s,c,f=!1,g=!1){if(this.variableNames=["x"],s==="avg"&&c)throw new Error("Cannot compute positions for average pool.");const A=n.filterWidth,v=n.strideDepth,y=n.strideHeight,T=n.strideWidth,I=n.dilationDepth,S=n.dilationHeight,k=n.dilationWidth,e=n.effectiveFilterDepth,N=n.effectiveFilterHeight,M=n.effectiveFilterWidth,O=n.padInfo.front,U=n.padInfo.top,B=n.padInfo.left;this.outputShape=n.outShape;const V=s==="avg";let b="0.0";if(V||(b="-1.0 / 1e-20"),c){const m=">=";this.userCode=` const ivec3 strides = ivec3(${v}, ${y}, ${T}); - const ivec3 pads = ivec3(${O}, ${z}, ${B}); + const ivec3 pads = ivec3(${O}, ${U}, ${B}); void main() { ivec5 coords = getOutputCoords(); @@ -15145,7 +15145,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT `;this.userCode=` const ivec3 strides = ivec3(${v}, ${y}, ${T}); - const ivec3 pads = ivec3(${O}, ${z}, ${B}); + const ivec3 pads = ivec3(${O}, ${U}, ${B}); const float initializationValue = ${b}; const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); @@ -15324,9 +15324,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT } setOutput(dotProd); } - `}}class AvgPool3DBackpropProgram{constructor(n){this.variableNames=["dy"],this.outputShape=n.inShape;const s=n.filterDepth,c=n.filterHeight,f=n.filterWidth,g=n.strideDepth,A=n.strideHeight,v=n.strideWidth,y=n.dilationDepth,T=n.dilationHeight,I=n.dilationWidth,S=n.effectiveFilterDepth,k=n.effectiveFilterHeight,e=n.effectiveFilterWidth,N=S-1-n.padInfo.front,M=k-1-n.padInfo.top,O=e-1-n.padInfo.left,z=1/(s*c*f);this.userCode=` + `}}class AvgPool3DBackpropProgram{constructor(n){this.variableNames=["dy"],this.outputShape=n.inShape;const s=n.filterDepth,c=n.filterHeight,f=n.filterWidth,g=n.strideDepth,A=n.strideHeight,v=n.strideWidth,y=n.dilationDepth,T=n.dilationHeight,I=n.dilationWidth,S=n.effectiveFilterDepth,k=n.effectiveFilterHeight,e=n.effectiveFilterWidth,N=S-1-n.padInfo.front,M=k-1-n.padInfo.top,O=e-1-n.padInfo.left,U=1/(s*c*f);this.userCode=` const ivec3 pads = ivec3(${N}, ${M}, ${O}); - const float avgMultiplier = float(${z}); + const float avgMultiplier = float(${U}); void main() { ivec5 coords = getOutputCoords(); @@ -15592,7 +15592,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const batchToSpaceND=u=>{const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{blockShape:g,crops:A}=c;assert$1(f.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const v=g.reduce((B,V)=>B*V),y=getReshaped(f.shape,g,v),T=getPermuted(y.length,g.length),I=getReshapedPermuted(f.shape,g,v),S=getSliceBeginCoords(A,g.length),k=getSliceSize(I,A,g.length),e=[],N=reshape({inputs:{x:f},backend:s,attrs:{shape:y}}),M=transpose({inputs:{x:N},backend:s,attrs:{perm:T}}),O=reshape({inputs:{x:M},backend:s,attrs:{shape:I}}),z=slice({inputs:{x:O},backend:s,attrs:{begin:S,size:k}});return e.push(N),e.push(M),e.push(O),e.forEach(B=>s.disposeIntermediateTensorInfo(B)),z},batchToSpaceNDConfig={kernelName:BatchToSpaceND,backendName:"webgl",kernelFunc:batchToSpaceND};/** + */const batchToSpaceND=u=>{const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{blockShape:g,crops:A}=c;assert$1(f.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const v=g.reduce((B,V)=>B*V),y=getReshaped(f.shape,g,v),T=getPermuted(y.length,g.length),I=getReshapedPermuted(f.shape,g,v),S=getSliceBeginCoords(A,g.length),k=getSliceSize(I,A,g.length),e=[],N=reshape({inputs:{x:f},backend:s,attrs:{shape:y}}),M=transpose({inputs:{x:N},backend:s,attrs:{perm:T}}),O=reshape({inputs:{x:M},backend:s,attrs:{shape:I}}),U=slice({inputs:{x:O},backend:s,attrs:{begin:S,size:k}});return e.push(N),e.push(M),e.push(O),e.forEach(B=>s.disposeIntermediateTensorInfo(B)),U},batchToSpaceNDConfig={kernelName:BatchToSpaceND,backendName:"webgl",kernelFunc:batchToSpaceND};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15898,7 +15898,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function concatImpl(u,n,s){const c=u[0].dtype;if(c==="complex64"){const I=u.map(M=>real({inputs:{input:M},backend:s})),S=u.map(M=>imag({inputs:{input:M},backend:s})),k=concatImpl(I,n,s),e=concatImpl(S,n,s),N=complex({inputs:{real:k,imag:e},backend:s});return I.forEach(M=>s.disposeIntermediateTensorInfo(M)),S.forEach(M=>s.disposeIntermediateTensorInfo(M)),s.disposeIntermediateTensorInfo(k),s.disposeIntermediateTensorInfo(e),N}let f=s.shouldExecuteOnCPU(u);if(c==="string"&&(f=!0),f){const I=u.map(z=>{const V=[-1,sizeFromShape(z.shape.slice(n))];return reshape({inputs:{x:z},backend:s,attrs:{shape:V}})}),S=I.map(z=>({vals:s.readSync(z.dataId),shape:z.shape})),k=computeOutShape$1(I.map(z=>z.shape),1),e=I[0].shape[0]===1,N=concatImplCPU(S,k,c,e),M=computeOutShape$1(u.map(z=>z.shape),n),O=s.makeTensorInfo(M,c,N);return I.forEach(z=>s.disposeIntermediateTensorInfo(z)),O}if(u.length>env().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const I=Math.floor(u.length/2),S=concatImpl(u.slice(0,I),n,s),k=concatImpl(u.slice(I),n,s),e=concatImpl([S,k],n,s);return s.disposeIntermediateTensorInfo(S),s.disposeIntermediateTensorInfo(k),e}if(env().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&u[0].shape.length>1){const I=new ConcatPackedProgram(u.map(S=>S.shape),n);return s.runWebGLProgram(I,u,c)}const{tensors2D:g,outShape:A}=computeTensors2D(u,n,s),v=new ConcatProgram(g.map(I=>I.shape)),y=s.runWebGLProgram(v,g,c);g.forEach(I=>s.disposeIntermediateTensorInfo(I));const T=reshape({inputs:{x:y},attrs:{shape:A},backend:s});return s.disposeIntermediateTensorInfo(y),T}function computeTensors2D(u,n,s){const c=computeOutShape$1(u.map(g=>g.shape),n);return{tensors2D:u.map(g=>reshape({inputs:{x:g},attrs:{shape:[-1,sizeFromShape(g.shape.slice(n))]},backend:s})),outShape:c}}/** + */function concatImpl(u,n,s){const c=u[0].dtype;if(c==="complex64"){const I=u.map(M=>real({inputs:{input:M},backend:s})),S=u.map(M=>imag({inputs:{input:M},backend:s})),k=concatImpl(I,n,s),e=concatImpl(S,n,s),N=complex({inputs:{real:k,imag:e},backend:s});return I.forEach(M=>s.disposeIntermediateTensorInfo(M)),S.forEach(M=>s.disposeIntermediateTensorInfo(M)),s.disposeIntermediateTensorInfo(k),s.disposeIntermediateTensorInfo(e),N}let f=s.shouldExecuteOnCPU(u);if(c==="string"&&(f=!0),f){const I=u.map(U=>{const V=[-1,sizeFromShape(U.shape.slice(n))];return reshape({inputs:{x:U},backend:s,attrs:{shape:V}})}),S=I.map(U=>({vals:s.readSync(U.dataId),shape:U.shape})),k=computeOutShape$1(I.map(U=>U.shape),1),e=I[0].shape[0]===1,N=concatImplCPU(S,k,c,e),M=computeOutShape$1(u.map(U=>U.shape),n),O=s.makeTensorInfo(M,c,N);return I.forEach(U=>s.disposeIntermediateTensorInfo(U)),O}if(u.length>env().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const I=Math.floor(u.length/2),S=concatImpl(u.slice(0,I),n,s),k=concatImpl(u.slice(I),n,s),e=concatImpl([S,k],n,s);return s.disposeIntermediateTensorInfo(S),s.disposeIntermediateTensorInfo(k),e}if(env().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&u[0].shape.length>1){const I=new ConcatPackedProgram(u.map(S=>S.shape),n);return s.runWebGLProgram(I,u,c)}const{tensors2D:g,outShape:A}=computeTensors2D(u,n,s),v=new ConcatProgram(g.map(I=>I.shape)),y=s.runWebGLProgram(v,g,c);g.forEach(I=>s.disposeIntermediateTensorInfo(I));const T=reshape({inputs:{x:y},attrs:{shape:A},backend:s});return s.disposeIntermediateTensorInfo(y),T}function computeTensors2D(u,n,s){const c=computeOutShape$1(u.map(g=>g.shape),n);return{tensors2D:u.map(g=>reshape({inputs:{x:g},attrs:{shape:[-1,sizeFromShape(g.shape.slice(n))]},backend:s})),outShape:c}}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15928,7 +15928,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */class Conv2DProgram{constructor(n,s=!1,c=null,f=!1,g=!1){this.variableNames=["x","W"],this.outputShape=n.outShape;const A=n.padInfo.top,v=n.padInfo.left,y=n.strideHeight,T=n.strideWidth,I=n.dilationHeight,S=n.dilationWidth,k=n.filterHeight,e=n.filterWidth,N=Math.floor(n.inChannels/4)*4,M=n.inChannels%4,O=n.dataFormat==="channelsLast",z=O?1:2,B=O?2:3,V=O?3:1;let b="",W="";c&&(f?b=`float activation(float a) { + */class Conv2DProgram{constructor(n,s=!1,c=null,f=!1,g=!1){this.variableNames=["x","W"],this.outputShape=n.outShape;const A=n.padInfo.top,v=n.padInfo.left,y=n.strideHeight,T=n.strideWidth,I=n.dilationHeight,S=n.dilationWidth,k=n.filterHeight,e=n.filterWidth,N=Math.floor(n.inChannels/4)*4,M=n.inChannels%4,O=n.dataFormat==="channelsLast",U=O?1:2,B=O?2:3,V=O?3:1;let b="",W="";c&&(f?b=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${c} }`:g?b=`float activation(float a) { @@ -15950,7 +15950,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT int d2 = coords[${V}]; ivec2 xRCCorner = - ivec2(coords[${z}], coords[${B}]) * strides - pads; + ivec2(coords[${U}], coords[${B}]) * strides - pads; int xRCorner = xRCCorner.x; int xCCorner = xRCCorner.y; @@ -16227,7 +16227,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function conv2dByMatMul({x:u,filter:n,convInfo:s,backend:c,bias:f=null,preluActivationWeights:g=null,leakyreluAlpha:A=0,activation:v=null}){const y=u.shape,T=c.texData.get(u.dataId),I=s.inChannels,S=y[0]*y[1]*y[2],k=s.outChannels,e=s.dataFormat==="channelsLast",N=!1,M=!1;let O;const z=[];if(!((S===1||k===1)&&I>MATMUL_SHARED_DIM_THRESHOLD)&&T.isPacked&&e&&T.texture!=null&&y[2]%2!==0&&arraysEqual(T.shape.slice(-3),y.slice(-3))){const b=y[0]*y[1]*(y[2]+1),W={dataId:u.dataId,shape:[1,b,s.inChannels],dtype:u.dtype},q=T.shape;T.shape=T.shape.slice(),T.shape[T.shape.length-2]++,assert$1(isReshapeFree(T.shape,W.shape),()=>`packed reshape ${T.shape} to ${W.shape} isn't free`);const Y=reshape({inputs:{x:n},backend:c,attrs:{shape:[1,s.inChannels,s.outChannels]}});z.push(Y);const X=batchMatMulImpl({a:W,b:Y,backend:c,transposeA:N,transposeB:M,bias:f,activation:v,preluActivationWeights:g,leakyreluAlpha:A}),Q=c.texData.get(X.dataId);assert$1(Q.isPacked,()=>"batchMatMul result is expected to be packed"),T.shape=q,Q.shape=s.outShape,O=identity({inputs:{x:X},backend:c}),O.shape=s.outShape,z.push(X)}else{const b=e?y[0]*y[1]*y[2]:y[0]*y[2]*y[3],W=reshape({inputs:{x:u},backend:c,attrs:{shape:[1,b,s.inChannels]}}),q=reshape({inputs:{x:n},backend:c,attrs:{shape:[1,s.inChannels,s.outChannels]}}),Y=batchMatMulImpl({a:W,b:q,transposeA:N,transposeB:M,backend:c,bias:f,activation:v,preluActivationWeights:g,leakyreluAlpha:A});O=reshape({inputs:{x:Y},backend:c,attrs:{shape:s.outShape}}),z.push(W),z.push(q),z.push(Y)}for(const b of z)c.disposeIntermediateTensorInfo(b);return O}function conv2dWithIm2Row({x:u,filter:n,convInfo:s,backend:c,bias:f=null,preluActivationWeights:g=null,leakyreluAlpha:A=0,activation:v=null}){const{filterWidth:y,filterHeight:T,inChannels:I,outWidth:S,outHeight:k,dataFormat:e}=s,N=e==="channelsLast",M=y*T*I,O=k*S,z=[M,O],B=!0,V=!1,b=[],W=reshape({inputs:{x:u},backend:c,attrs:{shape:u.shape.slice(1)}}),q=reshape({inputs:{x:n},backend:c,attrs:{shape:[1,M,sizeFromShape(n.shape)/M]}});b.push(W),b.push(q);const Y=new Im2ColPackedProgram(z,s),X=[W.shape,[s.padInfo.top,s.padInfo.left],[s.strideHeight,s.strideWidth],[s.dilationHeight,s.dilationWidth],[s.inChannels],[s.filterWidth*s.inChannels],[s.outWidth]],Q=c.runWebGLProgram(Y,[W],"float32",X),m=reshape({inputs:{x:Q},backend:c,attrs:{shape:[1,z[0],z[1]]}});b.push(Q),b.push(m);const Z=f!=null,ee=g!=null,oe=v==="leakyrelu",fe=v?mapActivationToShaderProgram(v,!0):null,me=new MatMulPackedProgram(m.shape,q.shape,[1,O,s.outChannels],B,V,Z,fe,ee,oe),pe=[m,q];if(f&&pe.push(f),ee&&pe.push(g),oe){const Fe=c.makeTensorInfo([],"float32",createScalarValue(A,"float32"));pe.push(Fe),b.push(Fe)}const Se=c.runWebGLProgram(me,pe,"float32"),xe=N?[1,k,S,s.outChannels]:[1,s.outChannels,k,S],we=reshape({inputs:{x:Se},backend:c,attrs:{shape:xe}});b.push(Se);for(const Fe of b)c.disposeIntermediateTensorInfo(Fe);return we}/** + */function conv2dByMatMul({x:u,filter:n,convInfo:s,backend:c,bias:f=null,preluActivationWeights:g=null,leakyreluAlpha:A=0,activation:v=null}){const y=u.shape,T=c.texData.get(u.dataId),I=s.inChannels,S=y[0]*y[1]*y[2],k=s.outChannels,e=s.dataFormat==="channelsLast",N=!1,M=!1;let O;const U=[];if(!((S===1||k===1)&&I>MATMUL_SHARED_DIM_THRESHOLD)&&T.isPacked&&e&&T.texture!=null&&y[2]%2!==0&&arraysEqual(T.shape.slice(-3),y.slice(-3))){const b=y[0]*y[1]*(y[2]+1),W={dataId:u.dataId,shape:[1,b,s.inChannels],dtype:u.dtype},q=T.shape;T.shape=T.shape.slice(),T.shape[T.shape.length-2]++,assert$1(isReshapeFree(T.shape,W.shape),()=>`packed reshape ${T.shape} to ${W.shape} isn't free`);const Y=reshape({inputs:{x:n},backend:c,attrs:{shape:[1,s.inChannels,s.outChannels]}});U.push(Y);const X=batchMatMulImpl({a:W,b:Y,backend:c,transposeA:N,transposeB:M,bias:f,activation:v,preluActivationWeights:g,leakyreluAlpha:A}),Q=c.texData.get(X.dataId);assert$1(Q.isPacked,()=>"batchMatMul result is expected to be packed"),T.shape=q,Q.shape=s.outShape,O=identity({inputs:{x:X},backend:c}),O.shape=s.outShape,U.push(X)}else{const b=e?y[0]*y[1]*y[2]:y[0]*y[2]*y[3],W=reshape({inputs:{x:u},backend:c,attrs:{shape:[1,b,s.inChannels]}}),q=reshape({inputs:{x:n},backend:c,attrs:{shape:[1,s.inChannels,s.outChannels]}}),Y=batchMatMulImpl({a:W,b:q,transposeA:N,transposeB:M,backend:c,bias:f,activation:v,preluActivationWeights:g,leakyreluAlpha:A});O=reshape({inputs:{x:Y},backend:c,attrs:{shape:s.outShape}}),U.push(W),U.push(q),U.push(Y)}for(const b of U)c.disposeIntermediateTensorInfo(b);return O}function conv2dWithIm2Row({x:u,filter:n,convInfo:s,backend:c,bias:f=null,preluActivationWeights:g=null,leakyreluAlpha:A=0,activation:v=null}){const{filterWidth:y,filterHeight:T,inChannels:I,outWidth:S,outHeight:k,dataFormat:e}=s,N=e==="channelsLast",M=y*T*I,O=k*S,U=[M,O],B=!0,V=!1,b=[],W=reshape({inputs:{x:u},backend:c,attrs:{shape:u.shape.slice(1)}}),q=reshape({inputs:{x:n},backend:c,attrs:{shape:[1,M,sizeFromShape(n.shape)/M]}});b.push(W),b.push(q);const Y=new Im2ColPackedProgram(U,s),X=[W.shape,[s.padInfo.top,s.padInfo.left],[s.strideHeight,s.strideWidth],[s.dilationHeight,s.dilationWidth],[s.inChannels],[s.filterWidth*s.inChannels],[s.outWidth]],Q=c.runWebGLProgram(Y,[W],"float32",X),m=reshape({inputs:{x:Q},backend:c,attrs:{shape:[1,U[0],U[1]]}});b.push(Q),b.push(m);const Z=f!=null,ee=g!=null,oe=v==="leakyrelu",fe=v?mapActivationToShaderProgram(v,!0):null,me=new MatMulPackedProgram(m.shape,q.shape,[1,O,s.outChannels],B,V,Z,fe,ee,oe),pe=[m,q];if(f&&pe.push(f),ee&&pe.push(g),oe){const Fe=c.makeTensorInfo([],"float32",createScalarValue(A,"float32"));pe.push(Fe),b.push(Fe)}const Se=c.runWebGLProgram(me,pe,"float32"),xe=N?[1,k,S,s.outChannels]:[1,s.outChannels,k,S],we=reshape({inputs:{x:Se},backend:c,attrs:{shape:xe}});b.push(Se);for(const Fe of b)c.disposeIntermediateTensorInfo(Fe);return we}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16576,7 +16576,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */class CropAndResizeProgram{constructor(n,s,c,f,g){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[A,v,y,T]=n,[I]=s,[S,k]=c;this.outputShape=[I,S,k,T];const e=f==="bilinear"?1:0,[N,M]=[`${v-1}.0`,`${y-1}.0`],[O,z,B]=S>1?[`${(v-1)/(S-1)}`,"(y2-y1) * height_ratio",`y1*${N} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${N}`],[V,b,W]=k>1?[`${(y-1)/(k-1)}`,"(x2-x1) * width_ratio",`x1*${M} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${M}`];this.userCode=` + */class CropAndResizeProgram{constructor(n,s,c,f,g){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[A,v,y,T]=n,[I]=s,[S,k]=c;this.outputShape=[I,S,k,T];const e=f==="bilinear"?1:0,[N,M]=[`${v-1}.0`,`${y-1}.0`],[O,U,B]=S>1?[`${(v-1)/(S-1)}`,"(y2-y1) * height_ratio",`y1*${N} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${N}`],[V,b,W]=k>1?[`${(y-1)/(k-1)}`,"(x2-x1) * width_ratio",`x1*${M} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${M}`];this.userCode=` const float height_ratio = float(${O}); const float width_ratio = float(${V}); void main() { @@ -16598,7 +16598,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT return; } - float height_scale = ${z}; + float height_scale = ${U}; float width_scale = ${b}; float in_y = ${B}; @@ -16680,7 +16680,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function cumsum(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,exclusive:A,reverse:v}=c,y=f.shape.length,T=getAxesPermutation([g],y);let I=f;T!=null&&(I=transpose({inputs:{x:f},backend:s,attrs:{perm:T}}));const S=getInnerMostAxes(1,y)[0];if(S!==y-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${f.shape.length-1} but got axis=${g}`);const k=I.shape[S];let e=identity({inputs:{x:I},backend:s});for(let N=0;N<=Math.ceil(Math.log2(k))-1;N++){const M=new CumSumProgram(I.shape,!1,v),O=[[N]],z=e;e=s.runWebGLProgram(M,[e],e.dtype,O),s.disposeIntermediateTensorInfo(z)}if(A){const N=new CumSumProgram(I.shape,A,v),M=e;e=s.runWebGLProgram(N,[e],e.dtype),s.disposeIntermediateTensorInfo(M)}if(T!=null){const N=getUndoAxesPermutation(T),M=transpose({inputs:{x:e},backend:s,attrs:{perm:N}});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(I),M}return e}const cumsumConfig={kernelName:Cumsum,backendName:"webgl",kernelFunc:cumsum};/** + */function cumsum(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,exclusive:A,reverse:v}=c,y=f.shape.length,T=getAxesPermutation([g],y);let I=f;T!=null&&(I=transpose({inputs:{x:f},backend:s,attrs:{perm:T}}));const S=getInnerMostAxes(1,y)[0];if(S!==y-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${f.shape.length-1} but got axis=${g}`);const k=I.shape[S];let e=identity({inputs:{x:I},backend:s});for(let N=0;N<=Math.ceil(Math.log2(k))-1;N++){const M=new CumSumProgram(I.shape,!1,v),O=[[N]],U=e;e=s.runWebGLProgram(M,[e],e.dtype,O),s.disposeIntermediateTensorInfo(U)}if(A){const N=new CumSumProgram(I.shape,A,v),M=e;e=s.runWebGLProgram(N,[e],e.dtype),s.disposeIntermediateTensorInfo(M)}if(T!=null){const N=getUndoAxesPermutation(T),M=transpose({inputs:{x:e},backend:s,attrs:{perm:N}});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(I),M}return e}const cumsumConfig={kernelName:Cumsum,backendName:"webgl",kernelFunc:cumsum};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16829,18 +16829,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * ============================================================================= */class DepthwiseConvPacked2DProgram{constructor(n,s=!1,c=null,f=!1,g=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=n.outShape,this.enableShapeUniforms=useShapeUniforms(this.outputShape.length);const A=n.outChannels/n.inChannels,v=n.padInfo.left,y=n.strideWidth,T=n.dilationWidth,I=n.filterHeight,S=n.filterWidth,k=S;let e=` int xR; int xC; int xCOffset; - vec4 wTexel; vec4 previous; vec4 final;`;for(let z=0;z=0 && xR < inDims[0]) { `;for(let B=0;B<(k+1)/2;B++){const V=B*2;if(e+=` xC = xCCorner + ${V*T}; @@ -16972,10 +16972,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT `,V+1=0&&(k=sum({inputs:{x:k},backend:s,attrs:{axis:T[M]-(A.length-e),keepDims:!1}}),N.push(k)),e--)}for(const M of N)M!==k&&s.disposeIntermediateTensorInfo(M);return k}const einsumConfig={kernelName:Einsum,backendName:"webgl",kernelFunc:einsum};/** + */function einsum(u){const{inputs:n,backend:s,attrs:c}=u,{equation:f}=c,g=n,{allDims:A,summedDims:v,idDims:y}=decodeEinsumEquation(f,g.length);checkEinsumDimSizes(A.length,y,g);const{path:T,steps:I}=getEinsumComputePath(v,y),S=I.length;let k=null,e=A.length;const N=[];for(let M=0;M=0&&(k=sum({inputs:{x:k},backend:s,attrs:{axis:T[M]-(A.length-e),keepDims:!1}}),N.push(k)),e--)}for(const M of N)M!==k&&s.disposeIntermediateTensorInfo(M);return k}const einsumConfig={kernelName:Einsum,backendName:"webgl",kernelFunc:einsum};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17737,7 +17737,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function fusedConv2d(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,filter:g,bias:A,preluActivationWeights:v}=n,{strides:y,pad:T,dataFormat:I,dilations:S,dimRoundingMode:k,activation:e,leakyreluAlpha:N}=c,M=convertConv2DDataFormat(I),O=computeConv2DInfo(f.shape,g.shape,y,S,T,k,!1,M);let z;const B=[];if(O.filterHeight===1&&O.filterWidth===1&&O.dilationHeight===1&&O.dilationWidth===1&&O.strideHeight===1&&O.strideWidth===1&&(O.padInfo.type==="SAME"||O.padInfo.type==="VALID"))z=conv2dByMatMul({x:f,filter:g,convInfo:O,backend:s,bias:A,activation:e,preluActivationWeights:v,leakyreluAlpha:N});else if(env().getBool("WEBGL_CONV_IM2COL")&&f.shape[0]===1)z=conv2dWithIm2Row({x:f,filter:g,convInfo:O,backend:s,bias:A,activation:e,preluActivationWeights:v,leakyreluAlpha:N});else{const b=A!=null,W=v!=null,q=e==="leakyrelu",Y=e?mapActivationToShaderProgram(e,!1):null,X=new Conv2DProgram(O,b,Y,W,q),Q=[f,g];if(A&&Q.push(A),v&&Q.push(v),q){const m=s.makeTensorInfo([],"float32",createScalarValue(N,"float32"));Q.push(m),B.push(m)}z=s.runWebGLProgram(X,Q,"float32")}const V=reshape({inputs:{x:z},backend:s,attrs:{shape:O.outShape}});return B.push(z),B.forEach(b=>s.disposeIntermediateTensorInfo(b)),V}const fusedConv2DConfig={kernelName:FusedConv2D,backendName:"webgl",kernelFunc:fusedConv2d};/** + */function fusedConv2d(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,filter:g,bias:A,preluActivationWeights:v}=n,{strides:y,pad:T,dataFormat:I,dilations:S,dimRoundingMode:k,activation:e,leakyreluAlpha:N}=c,M=convertConv2DDataFormat(I),O=computeConv2DInfo(f.shape,g.shape,y,S,T,k,!1,M);let U;const B=[];if(O.filterHeight===1&&O.filterWidth===1&&O.dilationHeight===1&&O.dilationWidth===1&&O.strideHeight===1&&O.strideWidth===1&&(O.padInfo.type==="SAME"||O.padInfo.type==="VALID"))U=conv2dByMatMul({x:f,filter:g,convInfo:O,backend:s,bias:A,activation:e,preluActivationWeights:v,leakyreluAlpha:N});else if(env().getBool("WEBGL_CONV_IM2COL")&&f.shape[0]===1)U=conv2dWithIm2Row({x:f,filter:g,convInfo:O,backend:s,bias:A,activation:e,preluActivationWeights:v,leakyreluAlpha:N});else{const b=A!=null,W=v!=null,q=e==="leakyrelu",Y=e?mapActivationToShaderProgram(e,!1):null,X=new Conv2DProgram(O,b,Y,W,q),Q=[f,g];if(A&&Q.push(A),v&&Q.push(v),q){const m=s.makeTensorInfo([],"float32",createScalarValue(N,"float32"));Q.push(m),B.push(m)}U=s.runWebGLProgram(X,Q,"float32")}const V=reshape({inputs:{x:U},backend:s,attrs:{shape:O.outShape}});return B.push(U),B.forEach(b=>s.disposeIntermediateTensorInfo(b)),V}const fusedConv2DConfig={kernelName:FusedConv2D,backendName:"webgl",kernelFunc:fusedConv2d};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17752,7 +17752,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function fusedDepthwiseConv2D(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,filter:g,bias:A,preluActivationWeights:v}=n,{strides:y,pad:T,dilations:I,dimRoundingMode:S,activation:k,leakyreluAlpha:e}=c,N=[];let M=I;M==null&&(M=[1,1]),assert$1(eitherStridesOrDilationsAreOne(y,M),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${y} and dilations '${M}'`);const O=computeConv2DInfo(f.shape,g.shape,y,M,T,S,!0),z=env().getBool("WEBGL_PACK_DEPTHWISECONV")&&O.strideWidth<=2&&O.outChannels/O.inChannels===1,B=k?mapActivationToShaderProgram(k,z):null,V=[f,g],b=A!=null,W=v!=null,q=k==="leakyrelu";if(b&&V.push(A),W&&V.push(v),q){const m=s.makeTensorInfo([],"float32",createScalarValue(e,"float32"));V.push(m),N.push(m)}let Y;z?Y=new DepthwiseConvPacked2DProgram(O,b,B,W,q):Y=new DepthwiseConv2DProgram(O,b,B,W,q);const X=[[O.padInfo.top,O.padInfo.left],[O.strideHeight,O.strideWidth],[O.dilationHeight,O.dilationWidth],[O.inHeight,O.inWidth]],Q=s.runWebGLProgram(Y,V,"float32",X);return N.forEach(m=>s.disposeIntermediateTensorInfo(m)),Q}const fusedDepthwiseConv2DConfig={kernelName:FusedDepthwiseConv2D,backendName:"webgl",kernelFunc:fusedDepthwiseConv2D};class GatherNDProgram{constructor(n,s,c){this.sliceDim=n,this.strides=s,this.variableNames=["x","indices"],this.outputShape=c;const f=getCoordsDataType(s.length),g=getCoordsDataType(c.length),A=this.sliceDim>1?"strides[j]":"strides";this.userCode=` + */function fusedDepthwiseConv2D(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,filter:g,bias:A,preluActivationWeights:v}=n,{strides:y,pad:T,dilations:I,dimRoundingMode:S,activation:k,leakyreluAlpha:e}=c,N=[];let M=I;M==null&&(M=[1,1]),assert$1(eitherStridesOrDilationsAreOne(y,M),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${y} and dilations '${M}'`);const O=computeConv2DInfo(f.shape,g.shape,y,M,T,S,!0),U=env().getBool("WEBGL_PACK_DEPTHWISECONV")&&O.strideWidth<=2&&O.outChannels/O.inChannels===1,B=k?mapActivationToShaderProgram(k,U):null,V=[f,g],b=A!=null,W=v!=null,q=k==="leakyrelu";if(b&&V.push(A),W&&V.push(v),q){const m=s.makeTensorInfo([],"float32",createScalarValue(e,"float32"));V.push(m),N.push(m)}let Y;U?Y=new DepthwiseConvPacked2DProgram(O,b,B,W,q):Y=new DepthwiseConv2DProgram(O,b,B,W,q);const X=[[O.padInfo.top,O.padInfo.left],[O.strideHeight,O.strideWidth],[O.dilationHeight,O.dilationWidth],[O.inHeight,O.inWidth]],Q=s.runWebGLProgram(Y,V,"float32",X);return N.forEach(m=>s.disposeIntermediateTensorInfo(m)),Q}const fusedDepthwiseConv2DConfig={kernelName:FusedDepthwiseConv2D,backendName:"webgl",kernelFunc:fusedDepthwiseConv2D};class GatherNDProgram{constructor(n,s,c){this.sliceDim=n,this.strides=s,this.variableNames=["x","indices"],this.outputShape=c;const f=getCoordsDataType(s.length),g=getCoordsDataType(c.length),A=this.sliceDim>1?"strides[j]":"strides";this.userCode=` ${f} strides = ${f}(${this.strides}); void main() { ${g} coords = getOutputCoords(); @@ -17778,7 +17778,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function gatherNd(u){const{inputs:n,backend:s}=u,{params:c,indices:f}=n,g=f.shape,A=g[g.length-1],v=sizeFromShape(c.shape),[y,T,I,S]=prepareAndValidate(c,f),k=reshape({inputs:{x:f},backend:s,attrs:{shape:[T,A]}}),e=reshape({inputs:{x:c},backend:s,attrs:{shape:[sizeFromShape(c.shape)/I,I]}});if(s.shouldExecuteOnCPU([c,f])||c.dtype==="string"){const z=s.readSync(f.dataId),B=s.bufferSync(c),V=gatherNdImplCPU(z,B,c.dtype,T,A,I,S,c.shape,v);return s.makeTensorInfo(y,c.dtype,V.values)}const N=new GatherNDProgram(A,S,[T,I]),M=s.runWebGLProgram(N,[e,k],e.dtype),O=reshape({inputs:{x:M},backend:s,attrs:{shape:y}});return s.disposeIntermediateTensorInfo(k),s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(M),O}const gatherNdConfig={kernelName:GatherNd,backendName:"webgl",kernelFunc:gatherNd};/** + */function gatherNd(u){const{inputs:n,backend:s}=u,{params:c,indices:f}=n,g=f.shape,A=g[g.length-1],v=sizeFromShape(c.shape),[y,T,I,S]=prepareAndValidate(c,f),k=reshape({inputs:{x:f},backend:s,attrs:{shape:[T,A]}}),e=reshape({inputs:{x:c},backend:s,attrs:{shape:[sizeFromShape(c.shape)/I,I]}});if(s.shouldExecuteOnCPU([c,f])||c.dtype==="string"){const U=s.readSync(f.dataId),B=s.bufferSync(c),V=gatherNdImplCPU(U,B,c.dtype,T,A,I,S,c.shape,v);return s.makeTensorInfo(y,c.dtype,V.values)}const N=new GatherNDProgram(A,S,[T,I]),M=s.runWebGLProgram(N,[e,k],e.dtype),O=reshape({inputs:{x:M},backend:s,attrs:{shape:y}});return s.disposeIntermediateTensorInfo(k),s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(M),O}const gatherNdConfig={kernelName:GatherNd,backendName:"webgl",kernelFunc:gatherNd};/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17813,7 +17813,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function gatherV2(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,indices:g}=n,{axis:A,batchDims:v}=c,y=parseAxisParam(A,f.shape)[0],T=collectGatherOpShapeInfo(f,g,y,v),I=sizeFromShape(g.shape),S=[],k=reshape({inputs:{x:f},backend:s,attrs:{shape:[T.batchSize,T.outerSize,T.dimSize,T.sliceSize]}}),e=reshape({inputs:{x:g},backend:s,attrs:{shape:[T.batchSize,I/T.batchSize]}});S.push(k),S.push(e);const N=[T.batchSize,T.outerSize,I/T.batchSize,T.sliceSize];if(s.shouldExecuteOnCPU([f,g])||f.dtype==="string"){const B=s.bufferSync(e),V=s.bufferSync(k),b=gatherV2ImplCPU(V,B,N);return S.forEach(W=>s.disposeIntermediateTensorInfo(W)),s.makeTensorInfo(T.outputShape,b.dtype,b.values)}const M=new GatherProgram(k.shape,N),O=s.runWebGLProgram(M,[k,e],k.dtype);S.push(O);const z=reshape({inputs:{x:O},backend:s,attrs:{shape:T.outputShape}});return S.forEach(B=>s.disposeIntermediateTensorInfo(B)),z}const gatherV2Config={kernelName:GatherV2,backendName:"webgl",kernelFunc:gatherV2};/** + */function gatherV2(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,indices:g}=n,{axis:A,batchDims:v}=c,y=parseAxisParam(A,f.shape)[0],T=collectGatherOpShapeInfo(f,g,y,v),I=sizeFromShape(g.shape),S=[],k=reshape({inputs:{x:f},backend:s,attrs:{shape:[T.batchSize,T.outerSize,T.dimSize,T.sliceSize]}}),e=reshape({inputs:{x:g},backend:s,attrs:{shape:[T.batchSize,I/T.batchSize]}});S.push(k),S.push(e);const N=[T.batchSize,T.outerSize,I/T.batchSize,T.sliceSize];if(s.shouldExecuteOnCPU([f,g])||f.dtype==="string"){const B=s.bufferSync(e),V=s.bufferSync(k),b=gatherV2ImplCPU(V,B,N);return S.forEach(W=>s.disposeIntermediateTensorInfo(W)),s.makeTensorInfo(T.outputShape,b.dtype,b.values)}const M=new GatherProgram(k.shape,N),O=s.runWebGLProgram(M,[k,e],k.dtype);S.push(O);const U=reshape({inputs:{x:O},backend:s,attrs:{shape:T.outputShape}});return S.forEach(B=>s.disposeIntermediateTensorInfo(B)),U}const gatherV2Config={kernelName:GatherV2,backendName:"webgl",kernelFunc:gatherV2};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18291,7 +18291,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,atanh=unaryKernelFunc({opSnippet:AT * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function max(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{reductionIndices:g,keepDims:A}=c,v=f.shape.length,y=parseAxisParam(g,f.shape);let T=y;const I=getAxesPermutation(T,v),S=I!=null,k=s.shouldExecuteOnCPU([f]);let e=f;if(S){if(k){const V=s.texData.get(e.dataId).values,b=new Array(v);for(let Y=0;Y{const{x:c}=u,{keepDims:f,axis:g}=n,A=s,v=c.shape.length,y=parseAxisParam(g,c.shape);let T=y;const I=getAxesPermutation(T,v),S=I!=null,k=A.shouldExecuteOnCPU([c]),e=[];let N=c;if(S){if(k){const b=A.texData.get(N.dataId).values,W=new Array(v);for(let X=0;X{const{x:c}=u,{keepDims:f,axis:g}=n,A=s,v=c.shape.length,y=parseAxisParam(g,c.shape);let T=y;const I=getAxesPermutation(T,v),S=I!=null,k=A.shouldExecuteOnCPU([c]),e=[];let N=c;if(S){if(k){const b=A.texData.get(N.dataId).values,W=new Array(v);for(let X=0;Xs.disposeIntermediateTensorInfo(N)),e}const prodConfig={kernelName:Prod,backendName:"webgl",kernelFunc:prod};/** + */function prod(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{axis:g,keepDims:A}=c,v=f.shape.length,y=[],T=parseAxisParam(g,f.shape);let I=T;const S=getAxesPermutation(I,v);let k=f;S!=null&&(k=transpose({inputs:{x:f},backend:s,attrs:{perm:S}}),I=getInnerMostAxes(I.length,v),y.push(k)),assertAxesAreInnerMostDims("prod",I,v);let e;if(s.shouldExecuteOnCPU([k])){const N=s.texData.get(k.dataId).values,{outVals:M,outShape:O,outDtype:U}=prodImplCPU(k.shape,k.dtype,N,I);e=s.makeTensorInfo(O,U,M)}else{const[N,M]=computeOutAndReduceShapes(k.shape,I),O=sizeFromShape(M),U=reshape({inputs:{x:k},backend:s,attrs:{shape:[-1,O]}}),B=sumOutType(f.dtype),V=reduce(U,B,"prod",s);e=reshape({inputs:{x:V},backend:s,attrs:{shape:N}}),y.push(U),y.push(V)}if(A){y.push(e);const N=expandShapeToKeepDim(e.shape,T);e=reshape({inputs:{x:e},backend:s,attrs:{shape:N}})}return y.forEach(N=>s.disposeIntermediateTensorInfo(N)),e}const prodConfig={kernelName:Prod,backendName:"webgl",kernelFunc:prod};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19780,7 +19780,7 @@ return a / b;`,DIV_PACKED=` } setOutput(result); } - `;function y(N){return k(N)}function T(N){return N[c-1]="("+N[c-1]+" + 1)",k(N)}function I(N){return N[c-2]="("+N[c-2]+" + 1)",k(N)}function S(N){return N[c-1]="("+N[c-1]+" + 1)",N[c-2]="("+N[c-2]+" + 1)",k(N)}function k(N){const M=n.map((B,V)=>e(V,N)),O=M.join(","),z=M.slice(-2).join(",");return`getChannel(getX(${O}), vec2(${z}))`}function e(N,M){return s.indexOf(N)!==-1&&n[N]!==1?`${n[N]} - ${M[N]} - 1`:`${M[N]}`}}}/** + `;function y(N){return k(N)}function T(N){return N[c-1]="("+N[c-1]+" + 1)",k(N)}function I(N){return N[c-2]="("+N[c-2]+" + 1)",k(N)}function S(N){return N[c-1]="("+N[c-1]+" + 1)",N[c-2]="("+N[c-2]+" + 1)",k(N)}function k(N){const M=n.map((B,V)=>e(V,N)),O=M.join(","),U=M.slice(-2).join(",");return`getChannel(getX(${O}), vec2(${U}))`}function e(N,M){return s.indexOf(N)!==-1&&n[N]!==1?`${n[N]} - ${M[N]} - 1`:`${M[N]}`}}}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19939,7 +19939,7 @@ return a / b;`,DIV_PACKED=` * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function scatterNd(u){const{inputs:n,backend:s,attrs:c}=u,{indices:f,updates:g}=n,{shape:A}=c,{sliceRank:v,numUpdates:y,sliceSize:T,strides:I,outputSize:S}=calculateShapes(g,f,A),k=[S/T,T];if(S===0)return s.makeTensorInfo(A,f.dtype);const e=reshape({inputs:{x:f},backend:s,attrs:{shape:[y,v]}}),N=reshape({inputs:{x:g},backend:s,attrs:{shape:[y,T]}}),M=s.makeTensorInfo([],"float32",new Float32Array([0])),O=new ScatterProgram(y,v,e.shape.length,N.shape.length,I,k),z=s.runWebGLProgram(O,[N,e,M],N.dtype),B=reshape({inputs:{x:z},backend:s,attrs:{shape:A}});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(N),s.disposeIntermediateTensorInfo(z),s.disposeIntermediateTensorInfo(M),B}const scatterNdConfig={kernelName:ScatterNd,backendName:"webgl",kernelFunc:scatterNd};/** + */function scatterNd(u){const{inputs:n,backend:s,attrs:c}=u,{indices:f,updates:g}=n,{shape:A}=c,{sliceRank:v,numUpdates:y,sliceSize:T,strides:I,outputSize:S}=calculateShapes(g,f,A),k=[S/T,T];if(S===0)return s.makeTensorInfo(A,f.dtype);const e=reshape({inputs:{x:f},backend:s,attrs:{shape:[y,v]}}),N=reshape({inputs:{x:g},backend:s,attrs:{shape:[y,T]}}),M=s.makeTensorInfo([],"float32",new Float32Array([0])),O=new ScatterProgram(y,v,e.shape.length,N.shape.length,I,k),U=s.runWebGLProgram(O,[N,e,M],N.dtype),B=reshape({inputs:{x:U},backend:s,attrs:{shape:A}});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(N),s.disposeIntermediateTensorInfo(U),s.disposeIntermediateTensorInfo(M),B}const scatterNdConfig={kernelName:ScatterNd,backendName:"webgl",kernelFunc:scatterNd};/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20118,7 +20118,7 @@ return a / b;`,DIV_PACKED=` * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const spaceToBatchND=u=>{const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{blockShape:g,paddings:A}=c;assert$1(f.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const v=g.reduce((z,B)=>z*B),y=[[0,0]];y.push(...A);for(let z=1+g.length;zs.disposeIntermediateTensorInfo(z)),O},spaceToBatchNDConfig={kernelName:SpaceToBatchND,backendName:"webgl",kernelFunc:spaceToBatchND};/** + */const spaceToBatchND=u=>{const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{blockShape:g,paddings:A}=c;assert$1(f.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const v=g.reduce((U,B)=>U*B),y=[[0,0]];y.push(...A);for(let U=1+g.length;Us.disposeIntermediateTensorInfo(U)),O},spaceToBatchNDConfig={kernelName:SpaceToBatchND,backendName:"webgl",kernelFunc:spaceToBatchND};/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20316,7 +20316,7 @@ return a / b;`,DIV_PACKED=` * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function stridedSlice(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{begin:g,end:A,strides:v,beginMask:y,endMask:T,ellipsisMask:I,newAxisMask:S,shrinkAxisMask:k}=c,{nonStrided:e,$begin:N,$strides:M,size:O,newShape:z,outShape:B}=sliceInfo(f.shape,g,A,v,y,T,I,S,k),V=reshape({inputs:{x:f},backend:s,attrs:{shape:z}});let b;if(e){const q=slice({inputs:{x:V},backend:s,attrs:{begin:N,size:O}});b=reshape({inputs:{x:q},backend:s,attrs:{shape:B}}),s.disposeIntermediateTensorInfo(q)}else if(B.some(q=>q===0))b=s.makeTensorInfo(B,f.dtype,[]);else if(s.shouldExecuteOnCPU([V])){const X=s.texData.get(V.dataId).values,Q=buffer(V.shape,V.dtype,X),m=stridedSliceImplCPU(B,Q,M,N);b=s.makeTensorInfo(B,V.dtype,m.values)}else{const Y=new StridedSliceProgram(N,M,B);b=s.runWebGLProgram(Y,[V],V.dtype)}const W=reshape({inputs:{x:b},backend:s,attrs:{shape:B}});return s.disposeIntermediateTensorInfo(V),s.disposeIntermediateTensorInfo(b),W}const stridedSliceConfig={kernelName:StridedSlice,backendName:"webgl",kernelFunc:stridedSlice};/** + */function stridedSlice(u){const{inputs:n,backend:s,attrs:c}=u,{x:f}=n,{begin:g,end:A,strides:v,beginMask:y,endMask:T,ellipsisMask:I,newAxisMask:S,shrinkAxisMask:k}=c,{nonStrided:e,$begin:N,$strides:M,size:O,newShape:U,outShape:B}=sliceInfo(f.shape,g,A,v,y,T,I,S,k),V=reshape({inputs:{x:f},backend:s,attrs:{shape:U}});let b;if(e){const q=slice({inputs:{x:V},backend:s,attrs:{begin:N,size:O}});b=reshape({inputs:{x:q},backend:s,attrs:{shape:B}}),s.disposeIntermediateTensorInfo(q)}else if(B.some(q=>q===0))b=s.makeTensorInfo(B,f.dtype,[]);else if(s.shouldExecuteOnCPU([V])){const X=s.texData.get(V.dataId).values,Q=buffer(V.shape,V.dtype,X),m=stridedSliceImplCPU(B,Q,M,N);b=s.makeTensorInfo(B,V.dtype,m.values)}else{const Y=new StridedSliceProgram(N,M,B);b=s.runWebGLProgram(Y,[V],V.dtype)}const W=reshape({inputs:{x:b},backend:s,attrs:{shape:B}});return s.disposeIntermediateTensorInfo(V),s.disposeIntermediateTensorInfo(b),W}const stridedSliceConfig={kernelName:StridedSlice,backendName:"webgl",kernelFunc:stridedSlice};/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20518,7 +20518,7 @@ return a / b;`,DIV_PACKED=` * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function disposeIntermediateTensorInfoOrNull(u,n){n!==null&&u.disposeIntermediateTensorInfo(n)}function roundUpToPow2(u){let n=1;for(;ny){const m=s.readSync(f.dataId),[Z,ee]=topKImplCPU(m,T,f.dtype,g,A);return[s.makeTensorInfo(Z.shape,Z.dtype,Z.values),s.makeTensorInfo(ee.shape,ee.dtype,ee.values)]}if(g===0)return T[T.length-1]=0,[s.makeTensorInfo(T,f.dtype,[]),s.makeTensorInfo(T,"int32",[])];if(I===1)return[f,fill({attrs:{shape:T,dtype:"int32",value:0},backend:s})];const S=s.texData.get(f.dataId),k=S!==null&&S.isPacked,e=k?s.unpackTensor(f):f,M=sizeFromShape(T)/I,O=reshape({inputs:{x:e},attrs:{shape:[M,I]},backend:s});k&&disposeIntermediateTensorInfoOrNull(s,e);const z=roundUpToPow2(g),B=roundUpToPow2(I);let V=null;const b=()=>V===null?[O,O]:[O,V],W=(m,Z,ee)=>{const oe=b(),fe=new SwapProgram(ee),pe=[[I],[V===null?1:0],[Number.NEGATIVE_INFINITY],[m],[Z]],Se=V;V=s.runWebGLProgram(fe,oe,"int32",pe),disposeIntermediateTensorInfoOrNull(s,Se)};for(let m=1;m=1;ee/=2)W(Z,ee,[M,B])}for(let m=B;m>z;m/=2){const Z=b(),ee=new MergeProgram([M,m/2]),fe=[[I],[V===null?1:0],[z]],me=V;V=s.runWebGLProgram(ee,Z,"int32",fe),disposeIntermediateTensorInfoOrNull(s,me);const pe=z/2,Se=pe*2;for(let xe=pe;xe>=1;xe/=2)W(Se,xe,V.shape)}let q=V;V=slice({inputs:{x:V},backend:s,attrs:{begin:0,size:[M,g]}}),disposeIntermediateTensorInfoOrNull(s,q);let Y=gatherV2({inputs:{x:O,indices:V},backend:s,attrs:{axis:1,batchDims:1}});disposeIntermediateTensorInfoOrNull(s,O);const X=T.slice(0,-1);X.push(g),q=V,V=reshape({inputs:{x:V},attrs:{shape:X},backend:s}),disposeIntermediateTensorInfoOrNull(s,q);const Q=Y;return Y=reshape({inputs:{x:Y},attrs:{shape:X},backend:s}),disposeIntermediateTensorInfoOrNull(s,Q),[Y,V]}const topKConfig={kernelName:TopK,backendName:"webgl",kernelFunc:topK};/** + */function disposeIntermediateTensorInfoOrNull(u,n){n!==null&&u.disposeIntermediateTensorInfo(n)}function roundUpToPow2(u){let n=1;for(;ny){const m=s.readSync(f.dataId),[Z,ee]=topKImplCPU(m,T,f.dtype,g,A);return[s.makeTensorInfo(Z.shape,Z.dtype,Z.values),s.makeTensorInfo(ee.shape,ee.dtype,ee.values)]}if(g===0)return T[T.length-1]=0,[s.makeTensorInfo(T,f.dtype,[]),s.makeTensorInfo(T,"int32",[])];if(I===1)return[f,fill({attrs:{shape:T,dtype:"int32",value:0},backend:s})];const S=s.texData.get(f.dataId),k=S!==null&&S.isPacked,e=k?s.unpackTensor(f):f,M=sizeFromShape(T)/I,O=reshape({inputs:{x:e},attrs:{shape:[M,I]},backend:s});k&&disposeIntermediateTensorInfoOrNull(s,e);const U=roundUpToPow2(g),B=roundUpToPow2(I);let V=null;const b=()=>V===null?[O,O]:[O,V],W=(m,Z,ee)=>{const oe=b(),fe=new SwapProgram(ee),pe=[[I],[V===null?1:0],[Number.NEGATIVE_INFINITY],[m],[Z]],Se=V;V=s.runWebGLProgram(fe,oe,"int32",pe),disposeIntermediateTensorInfoOrNull(s,Se)};for(let m=1;m=1;ee/=2)W(Z,ee,[M,B])}for(let m=B;m>U;m/=2){const Z=b(),ee=new MergeProgram([M,m/2]),fe=[[I],[V===null?1:0],[U]],me=V;V=s.runWebGLProgram(ee,Z,"int32",fe),disposeIntermediateTensorInfoOrNull(s,me);const pe=U/2,Se=pe*2;for(let xe=pe;xe>=1;xe/=2)W(Se,xe,V.shape)}let q=V;V=slice({inputs:{x:V},backend:s,attrs:{begin:0,size:[M,g]}}),disposeIntermediateTensorInfoOrNull(s,q);let Y=gatherV2({inputs:{x:O,indices:V},backend:s,attrs:{axis:1,batchDims:1}});disposeIntermediateTensorInfoOrNull(s,O);const X=T.slice(0,-1);X.push(g),q=V,V=reshape({inputs:{x:V},attrs:{shape:X},backend:s}),disposeIntermediateTensorInfoOrNull(s,q);const Q=Y;return Y=reshape({inputs:{x:Y},attrs:{shape:X},backend:s}),disposeIntermediateTensorInfoOrNull(s,Q),[Y,V]}const topKConfig={kernelName:TopK,backendName:"webgl",kernelFunc:topK};/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20660,7 +20660,7 @@ return a / b;`,DIV_PACKED=` * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function transform(u){const{inputs:n,backend:s,attrs:c}=u,{image:f,transforms:g}=n,{interpolation:A,fillMode:v,fillValue:y,outputShape:T}=c,[I,S,k,e]=f.shape,[N,M]=T??[S,k],O=[I,N,M,e],z=new TransformProgram(S,k,A,v,y,O);return s.runWebGLProgram(z,[f,g],"float32")}const transformConfig={kernelName:Transform,backendName:"webgl",kernelFunc:transform};/** + */function transform(u){const{inputs:n,backend:s,attrs:c}=u,{image:f,transforms:g}=n,{interpolation:A,fillMode:v,fillValue:y,outputShape:T}=c,[I,S,k,e]=f.shape,[N,M]=T??[S,k],O=[I,N,M,e],U=new TransformProgram(S,k,A,v,y,O);return s.runWebGLProgram(U,[f,g],"float32")}const transformConfig={kernelName:Transform,backendName:"webgl",kernelFunc:transform};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); @@ -20690,7 +20690,7 @@ return a / b;`,DIV_PACKED=` * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function unpack(u){const{inputs:n,backend:s,attrs:c}=u,{value:f}=n;let{axis:g}=c;g<0&&(g+=f.shape.length);const A=f,v=A.shape.length,y=f.shape[g],T=new Array(v-1);let I=0;for(let M=0;Ms.disposeIntermediateTensorInfo(M)),N}const unpackConfig={kernelName:Unpack,backendName:"webgl",kernelFunc:unpack};/** + */function unpack(u){const{inputs:n,backend:s,attrs:c}=u,{value:f}=n;let{axis:g}=c;g<0&&(g+=f.shape.length);const A=f,v=A.shape.length,y=f.shape[g],T=new Array(v-1);let I=0;for(let M=0;Ms.disposeIntermediateTensorInfo(M)),N}const unpackConfig={kernelName:Unpack,backendName:"webgl",kernelFunc:unpack};/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20826,7 +20826,7 @@ return a / b;`,DIV_PACKED=` * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */function unsortedSegmentSum(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,segmentIds:g}=n,{numSegments:A}=c,v=f.shape.length,y=[];let T=0;const I=getAxesPermutation([T],v);let S=f;I!=null&&(S=transpose({inputs:{x:f},backend:s,attrs:{perm:I}}),y.push(S),T=getInnerMostAxes(1,v)[0]);const k=computeOutShape(S.shape,T,A),e=sizeFromShape([S.shape[T]]),N=reshape({inputs:{x:S},backend:s,attrs:{shape:[-1,e]}});y.push(N);const M=sumOutType(f.dtype),O=(b,W,q,Y,X)=>{const Q=b.shape[0],m=b.shape[1],Z=segOpComputeOptimalWindowSize(m,X),ee={windowSize:Z,inSize:m,batchSize:Q,numSegments:X},oe=new SegmentOpProgram(ee,W),fe=s.compileAndRun(oe,[b,q],Y);if(y.push(fe),fe.shape[1]===X)return fe;const me=range({backend:s,attrs:{start:0,stop:X,step:1,dtype:"float32"}}),pe=tile({inputs:{x:me},backend:s,attrs:{reps:[m/Z]}});return y.push(me),y.push(pe),O(fe,W,pe,Y,X)},z=O(N,"unsortedSegmentSum",g,M,A),B=reshape({inputs:{x:z},backend:s,attrs:{shape:k}});let V=B;if(I!=null){y.push(B);const b=getUndoAxesPermutation(I);V=transpose({inputs:{x:V},backend:s,attrs:{perm:b}})}return y.forEach(b=>s.disposeIntermediateTensorInfo(b)),V}const unsortedSegmentSumConfig={kernelName:UnsortedSegmentSum,backendName:"webgl",kernelFunc:unsortedSegmentSum};/** + */function unsortedSegmentSum(u){const{inputs:n,backend:s,attrs:c}=u,{x:f,segmentIds:g}=n,{numSegments:A}=c,v=f.shape.length,y=[];let T=0;const I=getAxesPermutation([T],v);let S=f;I!=null&&(S=transpose({inputs:{x:f},backend:s,attrs:{perm:I}}),y.push(S),T=getInnerMostAxes(1,v)[0]);const k=computeOutShape(S.shape,T,A),e=sizeFromShape([S.shape[T]]),N=reshape({inputs:{x:S},backend:s,attrs:{shape:[-1,e]}});y.push(N);const M=sumOutType(f.dtype),O=(b,W,q,Y,X)=>{const Q=b.shape[0],m=b.shape[1],Z=segOpComputeOptimalWindowSize(m,X),ee={windowSize:Z,inSize:m,batchSize:Q,numSegments:X},oe=new SegmentOpProgram(ee,W),fe=s.compileAndRun(oe,[b,q],Y);if(y.push(fe),fe.shape[1]===X)return fe;const me=range({backend:s,attrs:{start:0,stop:X,step:1,dtype:"float32"}}),pe=tile({inputs:{x:me},backend:s,attrs:{reps:[m/Z]}});return y.push(me),y.push(pe),O(fe,W,pe,Y,X)},U=O(N,"unsortedSegmentSum",g,M,A),B=reshape({inputs:{x:U},backend:s,attrs:{shape:k}});let V=B;if(I!=null){y.push(B);const b=getUndoAxesPermutation(I);V=transpose({inputs:{x:V},backend:s,attrs:{perm:b}})}return y.forEach(b=>s.disposeIntermediateTensorInfo(b)),V}const unsortedSegmentSumConfig={kernelName:UnsortedSegmentSum,backendName:"webgl",kernelFunc:unsortedSegmentSum};/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20841,5 +20841,5 @@ return a / b;`,DIV_PACKED=` * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */const kernelConfigs=[LRNConfig,LRNGradConfig,_fusedMatMulConfig,absConfig,acosConfig,acoshConfig,addConfig,addNConfig,allConfig,anyConfig,argMaxConfig,argMinConfig,asinConfig,asinhConfig,atan2Config,atanConfig,atanhConfig,avgPool3DConfig,avgPoolConfig,avgPoolGrad3DConfig,avgPoolGradConfig,batchMatMulConfig,batchNormConfig,batchToSpaceNDConfig,bincountConfig,castConfig,ceilConfig,clipByValueConfig,complexAbsConfig,complexConfig,concatConfig,conv2DBackpropFilterConfig,conv2DBackpropInputConfig,conv2DConfig,conv3DBackpropFilterV2Config,conv3DBackpropInputConfig,conv3DConfig,cosConfig,coshConfig,cropAndResizeConfig,cumsumConfig,denseBincountConfig,depthToSpaceConfig,depthwiseConv2dNativeBackpropFilterConfig,depthwiseConv2dNativeBackpropInputConfig,depthwiseConv2dNativeConfig,diagConfig,dilation2DConfig,einsumConfig,eluConfig,eluGradConfig,equalConfig,erfConfig,expConfig,expandDimsConfig,expm1Config,fftConfig,fillConfig,flipLeftRightConfig,floorConfig,floorDivConfig,fromPixelsConfig,fusedConv2DConfig,fusedDepthwiseConv2DConfig,gatherNdConfig,gatherV2Config,greaterConfig,greaterEqualConfig,identityConfig,ifftConfig,imagConfig,isFiniteConfig,isInfConfig,isNaNConfig,leakyReluConfig,lessConfig,lessEqualConfig,linSpaceConfig,log1pConfig,logConfig,logicalAndConfig,logicalNotConfig,logicalOrConfig,maxConfig,maxPool3DConfig,maxPoolConfig,maxPoolGrad3DConfig,maxPoolGradConfig,maxPoolWithArgmaxConfig,maximumConfig,meanConfig,minConfig,minimumConfig,mirrorPadConfig,modConfig,multinomialConfig,multiplyConfig,negConfig,nonMaxSuppressionV3Config,nonMaxSuppressionV4Config,nonMaxSuppressionV5Config,notEqualConfig,oneHotConfig,onesLikeConfig,packConfig,padV2Config,powConfig,preluConfig,prodConfig,rangeConfig,realConfig,realDivConfig,reciprocalConfig,relu6Config,reluConfig,reshapeConfig,resizeBilinearConfig,resizeBilinearGradConfig,resizeNearestNeighborConfig,resizeNearestNeighborGradConfig,reverseConfig,rotateWithOffsetConfig,roundConfig,rsqrtConfig,scatterNdConfig,selectConfig,seluConfig,sigmoidConfig,signConfig,sinConfig,sinhConfig,sliceConfig,softmaxConfig,softplusConfig,spaceToBatchNDConfig,sparseFillEmptyRowsConfig,sparseReshapeConfig,sparseSegmentMeanConfig,sparseSegmentSumConfig,sparseToDenseConfig,splitVConfig,sqrtConfig,squareConfig,squaredDifferenceConfig,stepConfig,stridedSliceConfig,stringNGramsConfig,stringSplitConfig,stringToHashBucketFastConfig,subConfig,sumConfig,tanConfig,tanhConfig,tileConfig,topKConfig,transformConfig,transposeConfig,uniqueConfig,unpackConfig,unsortedSegmentSumConfig,zerosLikeConfig];for(const u of kernelConfigs)registerKernel(u);class BWLabeler{idx(n,s,c,f){return c*f[0]*f[1]+s*f[0]+n}check_previous_slice(n,s,c,f,g,A,v,y){const T=new Uint32Array(27);let I=0;if(!g)return 0;const S=n[this.idx(c,f,g,A)];if(v>=6){const k=this.idx(c,f,g-1,A);S===n[k]&&(T[I++]=s[k])}if(v>=18){if(c){const k=this.idx(c-1,f,g-1,A);S===n[k]&&(T[I++]=s[k])}if(f){const k=this.idx(c,f-1,g-1,A);S===n[k]&&(T[I++]=s[k])}if(c=6){if(k){const M=this.idx(k-1,S,I,s);N===n[M]&&(T[e++]=y[M])}if(S){const M=this.idx(k,S-1,I,s);N===n[M]&&(T[e++]=y[M])}}if(c>=18){if(S&&k){const M=this.idx(k-1,S-1,I,s);N===n[M]&&(T[e++]=y[M])}if(S&&k=A){A+=g;const M=new Uint32Array(A);M.set(v),v=M}v[f-1]=f,f++}}}for(let I=0;I100){console.log(` -Ooh no!!`);break}g[y]=T,v=Math.min(v,T)}for(let y=0;y.",inferenceDelay:100,description:"Gray and white matter segmentation model. Operates on full T1 image in a single pass but needs a dedicated graphics card to operate. Provides the best accuracy with hard cropping for better speed"},{id:3,type:"Segmentation",path:"./models/model20chan3cls/model.json",modelName:"🔪 Tissue GWM (High Acc, Low Mem)",labelsPath:"./models/model20chan3cls/labels.json",colorsPath:"./models/model20chan3cls/colorLUT.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:.2,enableQuantileNorm:!0,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Gray and white matter segmentation model. Operates on full T1 image in a single pass but needs a dedicated graphics card to operate. Provides high accuracy and fit low memory available but slower"},{id:4,type:"Atlas",path:"./models/model30chan18cls/model.json",modelName:"🪓 Subcortical + GWM (High Mem, Fast)",labelsPath:"./models/model30chan18cls/labels.json",colorsPath:"./models/model30chan18cls/colorLUT.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:.2,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Parcellation of the brain into 17 regions: gray and white matter plus subcortical areas. This is a robust model able to handle range of data quality, including varying saturation, and even clinical scans. It may work on infant brains, but your mileage may vary."},{id:5,type:"Atlas",path:"./models/model30chan18cls/model.json",modelName:"🪓 Subcortical + GWM (Low Mem, Slow)",labelsPath:"./models/model30chan18cls/labels.json",colorsPath:"./models/model30chan18cls/colorLUT.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:.2,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Parcellation of the brain into 17 regions: gray and white matter plus subcortical areas. This is a robust model able to handle range of data quality, including varying saturation, and even clinical scans. It may work on infant brains, but your mileage may vary."},{id:6,type:"Atlas",path:"./models/model18cls/model.json",modelName:"🪓 Subcortical + GWM (Low Mem, Faster)",labelsPath:"./models/model18cls/labels.json",colorsPath:"./models/model18cls/colorLUT.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:.2,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Parcellation of the brain into 17 regions: gray and white matter plus subcortical areas. This is a robust model able to handle range of data quality, including varying saturation, and even clinical scans. It may work on infant brains, but your mileage may vary."},{id:7,type:"Atlas",path:"./models/model30chan18cls/model.json",modelName:"🔪🪓 Subcortical + GWM (Failsafe, Less Acc)",labelsPath:"./models/model30chan18cls/labels.json",colorsPath:"./models/model30chan18cls/colorLUT.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Parcellation of the brain into 17 regions: gray and white matter plus subcortical areas. This is not a robust model, it may work on low data quality, including varying saturation, and even clinical scans. It may work also on infant brains, but your mileage may vary."},{id:8,type:"Atlas",path:"./models/model30chan50cls/model.json",modelName:"🔪 Aparc+Aseg 50 (High Mem, Fast)",labelsPath:"./models/model30chan50cls/labels.json",colorsPath:"./models/model30chan50cls/colorLUT.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!0,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"This is a 50-class model, that segments the brain into the Aparc+Aseg Freesurfer Atlas but one where cortical homologues are merged into a single class."},{id:9,type:"Atlas",path:"./models/model30chan50cls/model.json",modelName:"🔪 Aparc+Aseg 50 (Low Mem, Slow)",labelsPath:"./models/model30chan50cls/labels.json",colorsPath:"./models/model30chan50cls/colorLUT.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!0,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"This is a 50-class model, that segments the brain into the Aparc+Aseg Freesurfer Atlas but one where cortical homologues are merged into a single class. The model use sequential convolution for inference to overcome browser memory limitations but leads to longer computation time."},{id:10,type:"Brain_Extraction",path:"./models/model5_gw_ae/model.json",modelName:"⚡ Extract the Brain (FAST)",labelsPath:null,colorsPath:null,preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:2,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:null,inferenceDelay:100,description:"Extract the brain fast model operates on full T1 image in a single pass, but uses only 5 filters per layer. Can work on integrated graphics cards but is barely large enough to provide good accuracy. Still more accurate than the failsafe version."},{id:11,type:"Brain_Extraction",path:"./models/model11_gw_ae/model.json",modelName:"🔪 Extract the Brain (High Acc, Slow)",labelsPath:null,colorsPath:null,preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:2,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Extract the brain high accuracy model operates on full T1 image in a single pass, but uses only 11 filters per layer. Can work on dedicated graphics cards. Still more accurate than the fast version."},{id:12,type:"Brain_Masking",path:"./models/model5_gw_ae/model.json",modelName:"⚡ Brain Mask (FAST)",labelsPath:null,colorsPath:null,preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:2,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:null,inferenceDelay:100,description:"This fast masking model operates on full T1 image in a single pass, but uses only 5 filters per layer. Can work on integrated graphics cards but is barely large enough to provide good accuracy. Still more accurate than failsafe version."},{id:13,type:"Brain_Masking",path:"./models/model11_gw_ae/model.json",modelName:"🔪 Brain Mask (High Acc, Low Mem)",labelsPath:null,colorsPath:null,preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:2,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"This masking model operates on full T1 image in a single pass, but uses 11 filters per layer. Can work on dedicated graphics cards. Still more accurate than fast version."},{id:14,type:"Atlas",path:"./models/model21_104class/model.json",modelName:"🔪 Aparc+Aseg 104 (High Mem, Fast)",labelsPath:"./models/model21_104class/labels.json",colorsPath:"./models/model21_104class/colorLUT.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"FreeSurfer aparc+aseg atlas 104 parcellate brain areas into 104 regions. It contains a combination of the Desikan-Killiany atlas for cortical area and also segmentation of subcortical regions."},{id:15,type:"Atlas",path:"./models/model21_104class/model.json",modelName:"🔪 Aparc+Aseg 104 (Low Mem, Slow)",labelsPath:"./models/model21_104class/labels.json",colorsPath:"./models/model21_104class/colorLUT.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"FreeSurfer aparc+aseg atlas 104 parcellate brain areas into 104 regions. It contains a combination of the Desikan-Killiany atlas for cortical area and also segmentation of subcortical regions. The model use sequential convolution for inference to overcome browser memory limitations but leads to longer computation time. "}];async function checkZero(u){return u<10?u:"0"+u}async function detectBrowser(){return navigator.userAgent.indexOf("OPR/")>-1?"Opera":navigator.userAgent.indexOf("Edg/")>-1?"Edge":navigator.userAgent.indexOf("Falkon/")>-1?"Falkon":navigator.userAgent.indexOf("Chrome/")>-1?"Chrome":navigator.userAgent.indexOf("Firefox/")>-1?"Firefox":navigator.userAgent.indexOf("Safari/")>-1?"Safari":navigator.userAgent.indexOf("MSIE/")>-1||navigator.userAgent.indexOf("rv:")>-1?"IExplorer":"Unknown"}async function detectBrowserVersion(){return navigator.userAgent.indexOf("OPR/")>-1?parseInt(navigator.userAgent.split("OPR/")[1]):navigator.userAgent.indexOf("Edg/")>-1?parseInt(navigator.userAgent.split("Edg/")[1]):navigator.userAgent.indexOf("Falkon/")>-1?parseInt(navigator.userAgent.split("Falkon/")[1]):navigator.userAgent.indexOf("Chrome/")>-1?parseInt(navigator.userAgent.split("Chrome/")[1]):navigator.userAgent.indexOf("Firefox/")>-1?parseInt(navigator.userAgent.split("Firefox/")[1]):navigator.userAgent.indexOf("Safari/")>-1?parseInt(navigator.userAgent.split("Safari/")[1]):navigator.userAgent.indexOf("MSIE/")>-1||navigator.userAgent.indexOf("rv:")>-1?parseInt(navigator.userAgent.split("MSIE/")[1]):1/0}async function detectOperatingSys(){return navigator.userAgent.indexOf("Win")>-1?"Windows":navigator.userAgent.indexOf("Mac")>-1?"MacOS":navigator.userAgent.indexOf("Linux")>-1?"Linux":navigator.userAgent.indexOf("UNIX")>-1?"UNIX":"Unknown"}async function checkWebGl2(u){if(document.createElement("canvas").getContext("webgl2"))return console.log("WebGl2 is enabled"),!0;if(typeof WebGL2RenderingContext<"u"){const s="WebGL2 may be disabled. Please try updating video card drivers";u(s,-1,s)}else console.log("WebGL2 is not supported");return!1}async function detectGPUVendor(){const u=document.createElement("canvas").getContext("webgl");let n;if(u&&(n=u.getExtension("WEBGL_debug_renderer_info"),n)){const s=u.getParameter(n.UNMASKED_VENDOR_WEBGL);return s.indexOf("(")>-1&&s.indexOf(")")>-1?s.substring(s.indexOf("(")+1,s.indexOf(")")):s}return null}async function detectGPUVendor_v0(){const u=document.createElement("canvas").getContext("webgl");if(u){const n=u.getExtension("WEBGL_debug_renderer_info");return n?u.getParameter(n.UNMASKED_VENDOR_WEBGL):null}else return null}async function detectGPUCardType_v0(){const u=document.createElement("canvas").getContext("webgl");if(u){if(detectBrowser()==="Firefox")return u.getParameter(u.RENDERER);const n=u.getExtension("WEBGL_debug_renderer_info");return n?u.getParameter(n.UNMASKED_RENDERER_WEBGL):null}else return null}async function detectGPUCardType(){const u=document.createElement("canvas").getContext("webgl");let n;if(u){if(detectBrowser()==="Firefox")return u.getParameter(u.RENDERER);if(n=u.getExtension("WEBGL_debug_renderer_info"),n){let s=u.getParameter(n.UNMASKED_RENDERER_WEBGL);return s.indexOf("(")>-1&&s.indexOf(")")>-1&&s.indexOf("(R)")===-1&&(s=s.substring(s.indexOf("(")+1,s.indexOf(")")),s.split(",").length===3)?s.split(",")[1].trim():s}}return null}async function getCPUNumCores(){return navigator.hardwareConcurrency}async function isChrome(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}async function submitTiming2GoogleSheet(u,n){if(navigator.onLine){const s="Telemetry not yet supported";n(s,-1,s),console.log(u)}else console.log(" Offline Mode ")}async function getModelNumParameters(u){let n=0;for(let s=0;se-N);const g=tensor1d(f),A=g.shape[0],v=Math.floor(A*n),y=Math.ceil(A*s)-1,T=g.slice(v,1),I=g.slice(y,1),S=(await T.array())[0],k=(await I.array())[0];return c.dispose(),g.dispose(),T.dispose(),I.dispose(),{qmin:S,qmax:k}}async function quantileNormalizeVolumeData(u,n=.05,s=.95){const{qmin:c,qmax:f}=await calculateQuantiles(u,n,s),g=scalar(c),A=scalar(f),v=u.sub(g).div(A.sub(g));return g.dispose(),A.dispose(),v}async function minMaxNormalizeVolumeData(u){const n=u.max(),s=u.min();return await u.sub(s).div(n.sub(s))}async function findArrayMax(u){return u.reduce((n,s)=>n>s?n:s)}async function inferenceFullVolumeSeqCovLayer(u,n,s,c,f,g,A){window.alert("inferenceFullVolumeSeqCovLayer() is not dead code?")}async function inferenceFullVolume(u,n,s,c,f,g,A){window.alert("inferenceFullVolume() is not dead code?")}async function inferenceSubVolumes(u,n,s,c,f,g=null){window.alert("inferenceSubVolumes() is not dead code?")}async function tensor2LightBuffer(u,n){window.alert("tensor2LightBuffer() is not dead code?")}async function draw3dObjBoundingVolume(u){window.alert("draw3dObjBoundingVolume() is not dead code?")}async function argMaxLarge(u,n,s,c,f,g="float32"){window.alert("argMaxLarge() is not dead code?")}async function addZeroPaddingTo3dTensor(u,n=[1,1],s=[1,1],c=[1,1]){if(u.rank!==3)throw new Error("Tensor must be 3D");return u.pad([n,s,c])}async function removeZeroPaddingFrom3dTensor(u,n=1,s=1,c=1){if(u.rank!==3)throw new Error("Tensor must be 3D");let f,g,A;return[f,g,A]=u.shape,u.slice([n,s,c],[f-2*n,g-2*s,A-2*c])}async function resizeWithZeroPadding(u,n,s,c,f,g){const A=f[0],v=f[1],y=f[2],T=A+g[0]-1,I=v+g[1]-1,S=y+g[2]-1,k=s-T-1>0?s-T-1:0,e=c-I-1>0?c-I-1:0,N=n-S-1>0?n-S-1:0;return u.pad([[A,k],[v,e],[y,N]])}async function applyMriThreshold(u,n){const s=u.max(),c=s.mul(n),f=await c.data();return s.dispose(),c.dispose(),tidy(()=>u.clone().greater(f[0]))}async function binarizeVolumeDataTensor(u){return u.step(0)}async function generateBrainMask(u,n,s,c,f,g,A,v){console.log("Generate Brain Masking ... ");let y=[];for(let e=0;e{const e="postProcessSlices3D() should be upgraded to BWLabeler";A(e,-1,e)}),console.log("Post processing done ")):console.log("Phase-1 Post processing disabled ... ");const I=new Array(y[0].length*y.length);let S=0;for(let e=0;e{const V=u.slice([0,0,0,0,O],[-1,-1,-1,-1,z-O]),b=n.slice([0,0,0,O,I],[-1,-1,-1,z-O,1]);return conv3d(V,b,c,f,"NDHWC",g)});if(e===null)e=B;else{const V=e.add(B);e.dispose(),B.dispose(),e=V}}}const N=e.add(k);if(e.dispose(),k.dispose(),T==null)T=N;else{const M=await concat$2([T,N],4);N.dispose(),T.dispose(),T=M}}return T}function processTensorInChunks(u,n,s){const A=u.shape[4],v=Math.ceil(A/s);let y=null;for(let T=0;Tu.slice([0,0,0,0,I],[-1,-1,-1,-1,k])),N=tidy(()=>n.slice([0,0,0,I,0],[-1,-1,-1,k,-1])),M=conv3d(e,N,1,0,"NDHWC",1);e.dispose(),N.dispose();const O=squeeze(M);if(M.dispose(),y===null)y=O;else{const z=y.add(O);y.dispose(),y!==O&&O.dispose(),y=z}tidy(()=>{matMul$1(zeros$1([1,1]),zeros$1([1,1]))})}return y}class SequentialConvLayer{constructor(n,s,c,f){this.model=n,this.outChannels=n.outputLayers[0].kernel.shape[4],this.chunkSize=s,this.isChannelLast=c,this.callbackUI=f}async apply(n){const s=ENV$2.get("WEBGL_DELETE_TEXTURE_THRESHOLD");ENV$2.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0);const c=this;return new Promise(f=>{const g=performance.now(),A=c.model.layers[c.model.layers.length-1],v=A.getWeights()[0],y=A.getWeights()[1],T=c.isChannelLast?n.shape.slice(1,-1):n.shape.slice(2);let I=mul(ones(T),-1e4),S=zeros$1(T),k=0;console.log(" channel loop");const e=window.setInterval(async function(){engine().startScope(),console.log("=======================");const N=memory();console.log(`| Number of Tensors: ${N.numTensors}`),console.log(`| Number of Data Buffers: ${N.numDataBuffers}`),console.log("Channel : ",k);const M=await tidy(()=>{const B=v.slice([0,0,0,0,k],[-1,-1,-1,-1,1]),V=y.slice([k],[1]),b=processTensorInChunks(n,B,Math.min(c.chunkSize,c.outChannels)).add(V),W=greater$2(b,I),q=where(W,b,I),Y=where(W,fill$2(S.shape,k),S);return dispose([I,S,B,V,b,W]),tidy(()=>matMul$1(ones([1,1]),ones([1,1]))),[Y,q]}),O=memory();console.log(`| Number of Tensors: ${O.numTensors}`),console.log(`| Number of Data Buffers: ${O.numDataBuffers}`),console.log("=======================");const z=memory();if(c.callbackUI(`Iteration ${k}`,k/c.outChannels),console.log(`Number of Tensors: ${z.numTensors}`),console.log(`Number of Data Buffers: ${z.numDataBuffers}`),console.log(`Bytes In Use: ${z.numBytes}`),console.log(`Megabytes In Use: ${(z.numBytes/1048576).toFixed(3)} MB`),z.unreliable&&console.log(`Unreliable: ${z.unreliable}`),typeof S<"u"&&S.dispose(),typeof I<"u"&&I.dispose(),S=keep(M[0]),I=keep(M[1]),engine().endScope(),k===c.outChannels-1){window.clearInterval(e),dispose(I);const V=performance.now()-g;console.log(`Execution time for output layer: ${V} milliseconds`),ENV$2.set("WEBGL_DELETE_TEXTURE_THRESHOLD",s),f(S)}else{k++;const B=S.shape,V=S.dataSync(),b=S.shape,W=I.dataSync();S.dispose(),I.dispose(),S=tensor(V,B),I=tensor(W,b)}await new Promise(B=>setTimeout(B,300))},0)})}}async function generateOutputSlicesV2(u,n,s,c,f,g,A,v,y,T){if(y.isPostProcessEnable){const k=new BWLabeler,e=new Uint32Array(n),N=26,M=!0,O=!0,[z,B]=k.bwlabel(u,e,N,M,O);for(let V=0;V0&&ee<=1?e=await applyMriThreshold(c,ee):(console.log("No valid crop threshold value"),e=await c.greater([0]).asType("bool"))}else e=await v.greater([0]).asType("bool");console.log(" mask_3d shape : ",e.shape);const N=await whereAsync(e);e.dispose();const M=N.arraySync();let O=g,z=0,B=A,V=0,b=f,W=0;for(let ee=0;eeM[ee][0]?O=M[ee][0]:zM[ee][1]?B=M[ee][1]:VM[ee][2]?b=M[ee][2]:W{Tt=await ft.apply(ye[Se])});if(console.log("profileInfo : ",Lt),dispose(ye[Se]),console.log(" Output tensor",Tt),console.log(" Output tensor shape : ",Tt.shape),Tt.shape.length!==3){const be="Output tensor shape should be 3 dims but it is "+Tt.shape.length;y(be,-1,be)}const Ot=((performance.now()-ee)/1e3).toFixed(4);console.log(" find array max ");const Ft=await findArrayMax(Array.from(Tt.dataSync()));fehere
'),memory().unreliable){const oe="unreliable reasons :"+memory().reasons;y(oe,NaN,oe)}}}async function inferenceFullVolumePhase2(u,n,s,c,f,g,A,v,y,T,I,S){let k=[];console.log(" ---- Start FullVolume inference phase-II ---- "),A.enableQuantileNorm?(console.log("preModel Quantile normalization enabled"),n=await quantileNormalizeVolumeData(n)):(console.log("preModel Min Max normalization enabled"),n=await minMaxNormalizeVolumeData(n));let N;if(g==null){const me=A.autoThreshold;me>0&&me<=1?N=await applyMriThreshold(n,me):(console.log("No valid crop threshold value"),N=await n.greater([0]).asType("bool"))}else N=g.greater([0]).asType("bool");console.log(" mask_3d shape : ",N.shape);const M=await whereAsync(N);N.dispose();const O=M.arraySync();let z=c,B=0,V=f,b=0,W=s,q=0;for(let me=0;meO[me][0]?z=O[me][0]:BO[me][1]?V=O[me][1]:bO[me][2]?W=O[me][2]:qhere')}}async function inferenceFullVolumePhase1(u,n,s,c,f,g,A,v,y,T,I,S){if(v.No_SubVolumes=1,A.preModelId){const k=await load_model(inferenceModelsList[A.preModelId-1].path),e=inferenceModelsList[A.preModelId-1].enableTranspose,N=inferenceModelsList[A.preModelId-1].enableQuantileNorm;let M=null;N?(console.log("preModel Quantile normalization enabled"),M=await quantileNormalizeVolumeData(n)):(console.log("preModel Min Max normalization enabled"),M=await minMaxNormalizeVolumeData(n)),e?(M=M.transpose(),console.log("Input transposed for pre-model")):console.log("Transpose not enabled for pre-model"),v.Brainchop_Ver="PreModel_FV";const O=await k;try{const z=performance.now(),B=O,V=B.layers[0].batchInputShape;if(console.log(" Pre-Model batch input shape : ",V),V.length!==5){const Se="The pre-model input shape must be 5D ";return I(Se,-1,Se),0}const b=isModelChnlLast(B),W=y.batchSize,q=y.numOfChan;let Y,X,Q,m;if(b){if(console.log("Pre-Model Channel Last"),isNaN(V[4])||V[4]!==1){const Se="The number of channels for pre-model input shape must be 1";return I(Se,-1,Se),0}Y=V[1],X=V[2],Q=V[3],m=[W,Y,X,Q,q]}else{if(console.log("Pre-Model Channel First"),isNaN(V[1])||V[1]!==1){const Se="The number of channels for pre-model input shape must be 1";return I(Se,-1,Se),0}Y=V[2],X=V[3],Q=V[4],m=[W,q,Y,X,Q]}v.Input_Shape=JSON.stringify(m),v.Output_Shape=JSON.stringify(B.output.shape),v.Channel_Last=b,v.Model_Param=await getModelNumParameters(B),v.Model_Layers=await getModelNumLayers(B);let Z=0;const ee=inferenceModelsList[A.preModelId-1].inferenceDelay;let oe=1;const fe=O.layers.length,me=[];me[0]=M.reshape(m),dispose(M);const pe=window.setInterval(async function(){try{me[oe]=O.layers[oe].apply(me[oe-1])}catch(Se){return I(Se.message,-1,Se.message),window.clearInterval(pe),engine().endScope(),engine().disposeVariables(),v.Inference_t=1/0,v.Postprocess_t=1/0,v.Status="Fail",v.Error_Type=Se.message,v.Extra_Err_Info="PreModel Failed while model layer "+oe+" apply",y.telemetryFlag&&await submitTiming2GoogleSheet(v,I),0}if(O.layers[oe].dispose(),me[oe-1].dispose(),I("Layer "+oe.toString(),(oe+1)/fe),memory().unreliable){const Se="unreliable reasons :"+memory().reasons;I(Se,NaN,Se)}if(oe===fe-1){window.clearInterval(pe);const Se=b?-1:1;console.log(" find argmax "),console.log("last Tensor shape : ",me[oe].shape);const xe=b?me[oe].shape[4]:me[oe].shape[1];let we;try{console.log(" Try tf.argMax for fullVolume .."),we=await argMax$2(me[oe],Se)}catch(ft){if(Se===-1)try{const Tt=performance.now();console.log(" tf.argMax failed .. try argMaxLarge ..");const Lt=tensor2LightBuffer(me[oe].reshape([s,c,f,xe]),"float16");we=argMaxLarge(Lt,s,c,f,xe,"float16"),console.log("argMaxLarge for fullVolume takes : ",((performance.now()-Tt)/1e3).toFixed(4))}catch(Tt){const Lt="argMax buffer couldn't be created due to limited memory resources.";return I(Lt,-1,Lt),we.dispose(),window.clearInterval(pe),engine().endScope(),engine().disposeVariables(),v.Inference_t=1/0,v.Postprocess_t=1/0,v.Status="Fail",v.Error_Type=Tt.message,v.Extra_Err_Info="preModel prediction_argmax from argMaxLarge failed",y.telemetryFlag&&await submitTiming2GoogleSheet(v,I),0}else{const Tt="argMax buffer couldn't be created due to limited memory resources.";return I(Tt,-1,Tt),we.dispose(),window.clearInterval(pe),engine().endScope(),engine().disposeVariables(),v.Inference_t=1/0,v.Postprocess_t=1/0,v.Status="Fail",v.Error_Type=ft.message,v.Extra_Err_Info="preModel prediction_argmax from argMaxLarge not support yet channel first",y.telemetryFlag&&await submitTiming2GoogleSheet(v,I),0}}console.log(" Pre-model prediction_argmax shape : ",we.shape);const Fe=((performance.now()-z)/1e3).toFixed(4);dispose(me[oe]),console.log(" Pre-model find array max ");const De=await findArrayMax(Array.from(we.dataSync()));Zhere')}}else console.log("--- No pre-model is selected ---"),console.log("------ Run voxel cropping ------"),g?A.enableSeqConv?(console.log("------ Seq Convoluton ------"),await inferenceFullVolumeSeqCovLayerPhase2(y,A,u,n,s,c,f,null,I,T,v,S)):inferenceFullVolumePhase2(u,n,s,c,f,null,A,v,y,T,I,S):inferenceSubVolumes(u,n,s,c,f,null)}async function enableProductionMode(u=!0){await enableProdMode(),env().set("DEBUG",!1),env().set("WEBGL_FORCE_F16_TEXTURES",u),env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0),await ready(),console.log("tf env() flags :",env().flags),console.log("tf env() features :",env().features),console.log("tf env total features: ",Object.keys(env().features).length),console.log(getBackend())}async function runInference(u,n,s,c,f,g){g("Segmentation started",0);const A=performance.now(),v=u.batchSize,y=u.numOfChan;if(isNaN(v)||v!==1){const m="The batch Size for input shape must be 1";return g(m,-1,m),0}if(isNaN(y)||y!==1){const m="The number of channels for input shape must be 1";return g(m,-1,m),0}engine().startScope(),console.log("Batch size: ",v),console.log("Num of Channels: ",y);const T=await load_model(n.path);await enableProductionMode(!0);const I=T;let S=[];if(S=I.layers[0].batchInputShape,console.log(" Model batch input shape : ",S),S.length!==5){const m="The model input shape must be 5D";return g(m,-1,m),0}let k,e,N;const M=s.dims[1],O=s.dims[2],z=s.dims[3],B=await isModelChnlLast(I);if(B){if(console.log("Model Channel Last"),isNaN(S[4])||S[4]!==1){const m="The number of channels for input shape must be 1";return g(m,-1,m),0}k=S[1],e=S[2],N=S[3]}else{if(console.log("Model Channel First"),isNaN(S[1])||S[1]!==1){const m="The number of channels for input shape must be 1";return g(m,-1,m),0}k=S[2],e=S[3],N=S[4]}let V;k===256&&e===256&&N===256?V=!0:V=!1;let b=await getAllSlicesData1D(z,s,c);const W=await getAllSlices2D(b,O,M);b=null;let q=await getSlices3D(W);dispose(W);const Y=[];if(u.telemetryFlag){const m=((performance.now()-A)/1e3).toFixed(4),Z=new Date;V?Y.Brainchop_Ver="FullVolume":Y.Brainchop_Ver="SubVolumes",Y.Date=parseInt(Z.getMonth()+1)+"/"+Z.getDate()+"/"+Z.getFullYear(),Y.Time=await checkZero(Z.getHours())+":"+checkZero(Z.getMinutes())+":"+checkZero(Z.getSeconds()),Y.Input_Shape=JSON.stringify(S),Y.Output_Shape=JSON.stringify(I.output.shape),Y.Channel_Last=B,Y.Model_Param=await getModelNumParameters(I),Y.Model_Layers=await getModelNumLayers(I),Y.Preprocess_t=m,Y.Model=n.modelName,Y.Browser=await detectBrowser(),Y.Browser_Ver=await detectBrowserVersion(),Y.OS=await detectOperatingSys(),Y.WebGL2=await checkWebGl2(g),Y.GPU_Vendor=await detectGPUVendor(),Y.GPU_Card=await detectGPUCardType(),Y.GPU_Vendor_Full=await detectGPUVendor_v0(),Y.GPU_Card_Full=await detectGPUCardType_v0(),Y.CPU_Cores=await getCPUNumCores(),Y.TF_Backend=getBackend(),Y.Which_Brainchop="latest",Y.Seq_Conv=n.enableSeqConv,Y.Actual_Labels=1/0,Y.Expect_Labels=1/0,Y.NumLabels_Match=null,Y.Inference_t=1/0,Y.Merge_t=1/0,Y.Postprocess_t=1/0,Y.Status=null,Y.Error_Type=null,Y.Extra_Err_Info=null,Y.Extra_Info=null,isChrome()&&(Y.Heap_Size_MB=window.performance.memory.totalJSHeapSize/(1024*1024).toFixed(2),Y.Used_Heap_MB=window.performance.memory.usedJSHeapSize/(1024*1024).toFixed(2),Y.Heap_Limit_MB=window.performance.memory.jsHeapSizeLimit/(1024*1024).toFixed(2));const ee=checkWebGl2()?document.createElement("canvas").getContext("webgl2"):null;console.log("MAX_TEXTURE_SIZE :",ee.getParameter(ee.MAX_TEXTURE_SIZE)),console.log("MAX_RENDERBUFFER_SIZE :",ee.getParameter(ee.MAX_RENDERBUFFER_SIZE));const oe=ee.getExtension("WEBGL_debug_renderer_info");console.log("VENDOR WEBGL:",ee.getParameter(oe.UNMASKED_VENDOR_WEBGL)),ee?Y.Texture_Size=ee.getParameter(ee.MAX_TEXTURE_SIZE):Y.Texture_Size=null}const X=n.enableTranspose,Q=n.enableCrop;V&&(Q?await inferenceFullVolumePhase1(T,q,z,O,M,V,n,Y,u,f,g,c):(console.log("Cropping Disabled"),X?(q=q.transpose(),console.log("Input transposed")):console.log("Transpose NOT Enabled"),n.enableSeqConv?(console.log("Seq Convoluton Enabled"),await inferenceFullVolumeSeqCovLayer()):(console.log("Seq Convoluton Disabled"),await inferenceFullVolume())))}async function main(){let u={backColor:[.4,.4,.4,1],show3Dcrosshair:!0,onLocationChange:g},n=new Niivue(u);n.attachToCanvas(gl1),n.opts.dragMode=n.dragModes.pan,n.opts.multiplanarForceRender=!0,n.opts.yoke3Dto2DZoom=!0,await n.loadVolumes([{url:"./t1_crop.nii.gz"}]),aboutBtn.onclick=function(){window.alert("BrainChop models https://github.com/neuroneural/brainchop")},opacitySlider.oninput=function(){n.setOpacity(1,opacitySlider.value/255)};async function s(){let v=n.volumes[0],y=v.dims[1]===256&&v.dims[2]===256&&v.dims[3]===256;if((v.permRAS[0]!==-1||v.permRAS[1]!==3||v.permRAS[2]!==-2)&&(y=!1),y)return;let T=await n.conform(v,!1);n.removeVolume(n.volumes[0]),n.addVolume(T)}modelSelect.onchange=async function(){await s();let v=inferenceModelsList[this.selectedIndex];runInference(brainChopOpts,v,n.volumes[0].hdr,n.volumes[0].img,c,f)},saveBtn.onclick=function(){n.volumes[1].saveToDisk("Custom.nii")};async function c(v,y,T){for(;n.volumes.length>1;)n.removeVolume(n.volumes[1]);let I=await n.volumes[0].clone();I.zeroImage(),I.hdr.scl_inter=0,I.hdr.scl_slope=1,I.img=new Uint8Array(v);let S=y.atlasSelectedColorTable.toLowerCase();n.colormaps().includes(S)||(S="actc",T.type==="Atlas"&&(S="random")),I.colormap=S,I.opacity=opacitySlider.value/255,n.addVolume(I)}function f(v="",y=-1,T=""){console.log(v),document.getElementById("location").innerHTML=v,isNaN(y)?(memstatus.style.color="red",memstatus.innerHTML="Memory Issue"):y>=0&&(modelProgress.value=y*modelProgress.max),T!==""&&window.alert(T)}function g(v){document.getElementById("location").innerHTML="  "+v.string}for(let v=0;v=6){const e=this.idx(c,f,g-1,A);k===n[e]&&(T[S++]=s[e])}if(v>=18){if(c){const e=this.idx(c-1,f,g-1,A);k===n[e]&&(T[S++]=s[e])}if(f){const e=this.idx(c,f-1,g-1,A);k===n[e]&&(T[S++]=s[e])}if(c=6){if(N){const U=this.idx(N-1,e,k,s);O===n[U]&&(S[M++]=I[U])}if(e){const U=this.idx(N,e-1,k,s);O===n[U]&&(S[M++]=I[U])}}if(c>=18){if(e&&N){const U=this.idx(N-1,e-1,k,s);O===n[U]&&(S[M++]=I[U])}if(e&&N=y){y+=v;const U=new Uint32Array(y);U.set(T),T=U}T[A-1]=A,A++}}}for(let k=0;k100){console.log(` +Ooh no!!`);break}f[y]=T,v=Math.min(v,T)}for(let y=0;y.",inferenceDelay:100,description:"Gray and white matter segmentation model. Operates on full T1 image in a single pass but needs a dedicated graphics card to operate. Provides the best accuracy with hard cropping for better speed"},{id:3,type:"Segmentation",path:"./models/model20chan3cls/model.json",modelName:"🔪 Tissue GWM (High Acc, Low Mem)",labelsPath:"./models/model20chan3cls/labels.json",colorsPath:"./models/model20chan3cls/colorLUT.json",colormapPath:"./models/model20chan3cls/colormap.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:.2,enableQuantileNorm:!0,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Gray and white matter segmentation model. Operates on full T1 image in a single pass but needs a dedicated graphics card to operate. Provides high accuracy and fit low memory available but slower"},{id:4,type:"Atlas",path:"./models/model30chan18cls/model.json",modelName:"🪓 Subcortical + GWM (High Mem, Fast)",labelsPath:"./models/model30chan18cls/labels.json",colorsPath:"./models/model30chan18cls/colorLUT.json",colormapPath:"./models/model30chan18cls/colormap.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:.2,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Parcellation of the brain into 17 regions: gray and white matter plus subcortical areas. This is a robust model able to handle range of data quality, including varying saturation, and even clinical scans. It may work on infant brains, but your mileage may vary."},{id:5,type:"Atlas",path:"./models/model30chan18cls/model.json",modelName:"🪓 Subcortical + GWM (Low Mem, Slow)",labelsPath:"./models/model30chan18cls/labels.json",colorsPath:"./models/model30chan18cls/colorLUT.json",colormapPath:"./models/model30chan18cls/colormap.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:.2,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Parcellation of the brain into 17 regions: gray and white matter plus subcortical areas. This is a robust model able to handle range of data quality, including varying saturation, and even clinical scans. It may work on infant brains, but your mileage may vary."},{id:6,type:"Atlas",path:"./models/model18cls/model.json",modelName:"🪓 Subcortical + GWM (Low Mem, Faster)",labelsPath:"./models/model18cls/labels.json",colorsPath:"./models/model18cls/colorLUT.json",colormapPath:"./models/model18cls/colormap.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:.2,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Parcellation of the brain into 17 regions: gray and white matter plus subcortical areas. This is a robust model able to handle range of data quality, including varying saturation, and even clinical scans. It may work on infant brains, but your mileage may vary."},{id:7,type:"Atlas",path:"./models/model30chan18cls/model.json",modelName:"🔪🪓 Subcortical + GWM (Failsafe, Less Acc)",labelsPath:"./models/model30chan18cls/labels.json",colorsPath:"./models/model30chan18cls/colorLUT.json",colormapPath:"./models/model30chan18cls/colormap.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Parcellation of the brain into 17 regions: gray and white matter plus subcortical areas. This is not a robust model, it may work on low data quality, including varying saturation, and even clinical scans. It may work also on infant brains, but your mileage may vary."},{id:8,type:"Atlas",path:"./models/model30chan50cls/model.json",modelName:"🔪 Aparc+Aseg 50 (High Mem, Fast)",labelsPath:"./models/model30chan50cls/labels.json",colorsPath:"./models/model30chan50cls/colorLUT.json",colormapPath:"./models/model30chan50cls/colormap.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!0,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"This is a 50-class model, that segments the brain into the Aparc+Aseg Freesurfer Atlas but one where cortical homologues are merged into a single class."},{id:9,type:"Atlas",path:"./models/model30chan50cls/model.json",modelName:"🔪 Aparc+Aseg 50 (Low Mem, Slow)",labelsPath:"./models/model30chan50cls/labels.json",colorsPath:"./models/model30chan50cls/colorLUT.json",colormapPath:"./models/model30chan50cls/colormap.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!0,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"This is a 50-class model, that segments the brain into the Aparc+Aseg Freesurfer Atlas but one where cortical homologues are merged into a single class. The model use sequential convolution for inference to overcome browser memory limitations but leads to longer computation time."},{id:10,type:"Brain_Extraction",path:"./models/model5_gw_ae/model.json",modelName:"⚡ Extract the Brain (FAST)",labelsPath:null,colorsPath:null,preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:18,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:null,inferenceDelay:100,description:"Extract the brain fast model operates on full T1 image in a single pass, but uses only 5 filters per layer. Can work on integrated graphics cards but is barely large enough to provide good accuracy. Still more accurate than the failsafe version."},{id:11,type:"Brain_Extraction",path:"./models/model11_gw_ae/model.json",modelName:"🔪 Extract the Brain (High Acc, Slow)",labelsPath:null,colorsPath:null,preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"Extract the brain high accuracy model operates on full T1 image in a single pass, but uses only 11 filters per layer. Can work on dedicated graphics cards. Still more accurate than the fast version."},{id:12,type:"Brain_Masking",path:"./models/model5_gw_ae/model.json",modelName:"⚡ Brain Mask (FAST)",labelsPath:null,colorsPath:null,colormapPath:"./models/model5_gw_ae/colormap.json",preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:17,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:null,inferenceDelay:100,description:"This fast masking model operates on full T1 image in a single pass, but uses only 5 filters per layer. Can work on integrated graphics cards but is barely large enough to provide good accuracy. Still more accurate than failsafe version."},{id:13,type:"Brain_Masking",path:"./models/model11_gw_ae/model.json",modelName:"🔪 Brain Mask (High Acc, Low Mem)",labelsPath:null,colorsPath:null,preModelId:null,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:0,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!0,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"This masking model operates on full T1 image in a single pass, but uses 11 filters per layer. Can work on dedicated graphics cards. Still more accurate than fast version."},{id:14,type:"Atlas",path:"./models/model21_104class/model.json",modelName:"🔪 Aparc+Aseg 104 (High Mem, Fast)",labelsPath:"./models/model21_104class/labels.json",colorsPath:"./models/model21_104class/colorLUT.json",colormapPath:"./models/model21_104class/colormap.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!1,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"FreeSurfer aparc+aseg atlas 104 parcellate brain areas into 104 regions. It contains a combination of the Desikan-Killiany atlas for cortical area and also segmentation of subcortical regions."},{id:15,type:"Atlas",path:"./models/model21_104class/model.json",modelName:"🔪 Aparc+Aseg 104 (Low Mem, Slow)",labelsPath:"./models/model21_104class/labels.json",colorsPath:"./models/model21_104class/colorLUT.json",colormapPath:"./models/model21_104class/colormap.json",preModelId:1,preModelPostProcess:!1,isBatchOverlapEnable:!1,numOverlapBatches:200,enableTranspose:!0,enableCrop:!0,cropPadding:0,autoThreshold:0,enableQuantileNorm:!1,filterOutWithPreMask:!1,enableSeqConv:!0,textureSize:0,warning:"This model may need dedicated graphics card. For more info please check with Browser Resources .",inferenceDelay:100,description:"FreeSurfer aparc+aseg atlas 104 parcellate brain areas into 104 regions. It contains a combination of the Desikan-Killiany atlas for cortical area and also segmentation of subcortical regions. The model use sequential convolution for inference to overcome browser memory limitations but leads to longer computation time. "}];async function checkZero(u){return u<10?u:"0"+u}async function detectBrowser(){return navigator.userAgent.indexOf("OPR/")>-1?"Opera":navigator.userAgent.indexOf("Edg/")>-1?"Edge":navigator.userAgent.indexOf("Falkon/")>-1?"Falkon":navigator.userAgent.indexOf("Chrome/")>-1?"Chrome":navigator.userAgent.indexOf("Firefox/")>-1?"Firefox":navigator.userAgent.indexOf("Safari/")>-1?"Safari":navigator.userAgent.indexOf("MSIE/")>-1||navigator.userAgent.indexOf("rv:")>-1?"IExplorer":"Unknown"}async function detectBrowserVersion(){return navigator.userAgent.indexOf("OPR/")>-1?parseInt(navigator.userAgent.split("OPR/")[1]):navigator.userAgent.indexOf("Edg/")>-1?parseInt(navigator.userAgent.split("Edg/")[1]):navigator.userAgent.indexOf("Falkon/")>-1?parseInt(navigator.userAgent.split("Falkon/")[1]):navigator.userAgent.indexOf("Chrome/")>-1?parseInt(navigator.userAgent.split("Chrome/")[1]):navigator.userAgent.indexOf("Firefox/")>-1?parseInt(navigator.userAgent.split("Firefox/")[1]):navigator.userAgent.indexOf("Safari/")>-1?parseInt(navigator.userAgent.split("Safari/")[1]):navigator.userAgent.indexOf("MSIE/")>-1||navigator.userAgent.indexOf("rv:")>-1?parseInt(navigator.userAgent.split("MSIE/")[1]):1/0}async function detectOperatingSys(){return navigator.userAgent.indexOf("Win")>-1?"Windows":navigator.userAgent.indexOf("Mac")>-1?"MacOS":navigator.userAgent.indexOf("Linux")>-1?"Linux":navigator.userAgent.indexOf("UNIX")>-1?"UNIX":"Unknown"}async function checkWebGl2(u){if(document.createElement("canvas").getContext("webgl2"))return console.log("WebGl2 is enabled"),!0;if(typeof WebGL2RenderingContext<"u"){const s="WebGL2 may be disabled. Please try updating video card drivers";u(s,-1,s)}else console.log("WebGL2 is not supported");return!1}async function detectGPUVendor(){const u=document.createElement("canvas").getContext("webgl");let n;if(u&&(n=u.getExtension("WEBGL_debug_renderer_info"),n)){const s=u.getParameter(n.UNMASKED_VENDOR_WEBGL);return s.indexOf("(")>-1&&s.indexOf(")")>-1?s.substring(s.indexOf("(")+1,s.indexOf(")")):s}return null}async function detectGPUVendor_v0(){const u=document.createElement("canvas").getContext("webgl");if(u){const n=u.getExtension("WEBGL_debug_renderer_info");return n?u.getParameter(n.UNMASKED_VENDOR_WEBGL):null}else return null}async function detectGPUCardType_v0(){const u=document.createElement("canvas").getContext("webgl");if(u){if(detectBrowser()==="Firefox")return u.getParameter(u.RENDERER);const n=u.getExtension("WEBGL_debug_renderer_info");return n?u.getParameter(n.UNMASKED_RENDERER_WEBGL):null}else return null}async function detectGPUCardType(){const u=document.createElement("canvas").getContext("webgl");let n;if(u){if(detectBrowser()==="Firefox")return u.getParameter(u.RENDERER);if(n=u.getExtension("WEBGL_debug_renderer_info"),n){let s=u.getParameter(n.UNMASKED_RENDERER_WEBGL);return s.indexOf("(")>-1&&s.indexOf(")")>-1&&s.indexOf("(R)")===-1&&(s=s.substring(s.indexOf("(")+1,s.indexOf(")")),s.split(",").length===3)?s.split(",")[1].trim():s}}return null}async function getCPUNumCores(){return navigator.hardwareConcurrency}async function isChrome(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}async function submitTiming2GoogleSheet(u,n){if(navigator.onLine){const s="Telemetry not yet supported";n(s,-1,s),console.log(u)}else console.log(" Offline Mode ")}async function getModelNumParameters(u){let n=0;for(let s=0;se-N);const g=tensor1d(f),A=g.shape[0],v=Math.floor(A*n),y=Math.ceil(A*s)-1,T=g.slice(v,1),I=g.slice(y,1),S=(await T.array())[0],k=(await I.array())[0];return c.dispose(),g.dispose(),T.dispose(),I.dispose(),{qmin:S,qmax:k}}async function quantileNormalizeVolumeData(u,n=.05,s=.95){const{qmin:c,qmax:f}=await calculateQuantiles(u,n,s),g=scalar(c),A=scalar(f),v=u.sub(g).div(A.sub(g));return g.dispose(),A.dispose(),v}async function minMaxNormalizeVolumeData(u){const n=u.max(),s=u.min();return await u.sub(s).div(n.sub(s))}async function findArrayMax(u){return u.reduce((n,s)=>n>s?n:s)}async function inferenceFullVolumeSeqCovLayer(u,n,s,c,f,g,A){window.alert("inferenceFullVolumeSeqCovLayer() is not dead code?")}async function inferenceFullVolume(u,n,s,c,f,g,A){window.alert("inferenceFullVolume() is not dead code?")}async function inferenceSubVolumes(u,n,s,c,f,g=null){window.alert("inferenceSubVolumes() is not dead code?")}async function tensor2LightBuffer(u,n){window.alert("tensor2LightBuffer() is not dead code?")}async function draw3dObjBoundingVolume(u){window.alert("draw3dObjBoundingVolume() is not dead code?")}async function argMaxLarge(u,n,s,c,f,g="float32"){window.alert("argMaxLarge() is not dead code?")}async function addZeroPaddingTo3dTensor(u,n=[1,1],s=[1,1],c=[1,1]){if(u.rank!==3)throw new Error("Tensor must be 3D");return u.pad([n,s,c])}async function removeZeroPaddingFrom3dTensor(u,n=1,s=1,c=1){if(u.rank!==3)throw new Error("Tensor must be 3D");let f,g,A;return[f,g,A]=u.shape,u.slice([n,s,c],[f-2*n,g-2*s,A-2*c])}async function resizeWithZeroPadding(u,n,s,c,f,g){const A=f[0],v=f[1],y=f[2],T=A+g[0]-1,I=v+g[1]-1,S=y+g[2]-1,k=s-T-1>0?s-T-1:0,e=c-I-1>0?c-I-1:0,N=n-S-1>0?n-S-1:0;return u.pad([[A,k],[v,e],[y,N]])}async function applyMriThreshold(u,n){const s=u.max(),c=s.mul(n),f=await c.data();return s.dispose(),c.dispose(),tidy(()=>u.clone().greater(f[0]))}async function binarizeVolumeDataTensor(u){return u.step(0)}async function generateBrainMask(u,n,s,c,f,g,A,v,y=!0){console.log("Generate Brain Masking ... ");let T=[];for(let N=0;N{const N="postProcessSlices3D() should be upgraded to BWLabeler";A(N,-1,N)}),console.log("Post processing done ")):console.log("Phase-1 Post processing disabled ... ");const S=new Array(T[0].length*T.length);let k=0;for(let N=0;N{const V=u.slice([0,0,0,0,O],[-1,-1,-1,-1,U-O]),b=n.slice([0,0,0,O,I],[-1,-1,-1,U-O,1]);return conv3d(V,b,c,f,"NDHWC",g)});if(e===null)e=B;else{const V=e.add(B);e.dispose(),B.dispose(),e=V}}}const N=e.add(k);if(e.dispose(),k.dispose(),T==null)T=N;else{const M=await concat$2([T,N],4);N.dispose(),T.dispose(),T=M}}return T}function processTensorInChunks(u,n,s){const A=u.shape[4],v=Math.ceil(A/s);let y=null;for(let T=0;Tu.slice([0,0,0,0,I],[-1,-1,-1,-1,k])),N=tidy(()=>n.slice([0,0,0,I,0],[-1,-1,-1,k,-1])),M=conv3d(e,N,1,0,"NDHWC",1);e.dispose(),N.dispose();const O=squeeze(M);if(M.dispose(),y===null)y=O;else{const U=y.add(O);y.dispose(),y!==O&&O.dispose(),y=U}tidy(()=>{matMul$1(zeros$1([1,1]),zeros$1([1,1]))})}return y}class SequentialConvLayer{constructor(n,s,c,f){this.model=n,this.outChannels=n.outputLayers[0].kernel.shape[4],this.chunkSize=s,this.isChannelLast=c,this.callbackUI=f}async apply(n){const s=ENV$2.get("WEBGL_DELETE_TEXTURE_THRESHOLD");ENV$2.set("WEBGL_DELETE_TEXTURE_THRESHOLD",0);const c=this;return new Promise(f=>{const g=performance.now(),A=c.model.layers[c.model.layers.length-1],v=A.getWeights()[0],y=A.getWeights()[1],T=c.isChannelLast?n.shape.slice(1,-1):n.shape.slice(2);let I=mul(ones(T),-1e4),S=zeros$1(T),k=0;console.log(" channel loop");const e=window.setInterval(async function(){engine().startScope(),console.log("=======================");const N=memory();console.log(`| Number of Tensors: ${N.numTensors}`),console.log(`| Number of Data Buffers: ${N.numDataBuffers}`),console.log("Channel : ",k);const M=await tidy(()=>{const B=v.slice([0,0,0,0,k],[-1,-1,-1,-1,1]),V=y.slice([k],[1]),b=processTensorInChunks(n,B,Math.min(c.chunkSize,c.outChannels)).add(V),W=greater$2(b,I),q=where(W,b,I),Y=where(W,fill$2(S.shape,k),S);return dispose([I,S,B,V,b,W]),tidy(()=>matMul$1(ones([1,1]),ones([1,1]))),[Y,q]}),O=memory();console.log(`| Number of Tensors: ${O.numTensors}`),console.log(`| Number of Data Buffers: ${O.numDataBuffers}`),console.log("=======================");const U=memory();if(c.callbackUI(`Iteration ${k}`,k/c.outChannels),console.log(`Number of Tensors: ${U.numTensors}`),console.log(`Number of Data Buffers: ${U.numDataBuffers}`),console.log(`Bytes In Use: ${U.numBytes}`),console.log(`Megabytes In Use: ${(U.numBytes/1048576).toFixed(3)} MB`),U.unreliable&&console.log(`Unreliable: ${U.unreliable}`),typeof S<"u"&&S.dispose(),typeof I<"u"&&I.dispose(),S=keep(M[0]),I=keep(M[1]),engine().endScope(),k===c.outChannels-1){window.clearInterval(e),dispose(I);const V=performance.now()-g;console.log(`Execution time for output layer: ${V} milliseconds`),ENV$2.set("WEBGL_DELETE_TEXTURE_THRESHOLD",s),f(S)}else{k++;const B=S.shape,V=S.dataSync(),b=S.shape,W=I.dataSync();S.dispose(),I.dispose(),S=tensor(V,B),I=tensor(W,b)}await new Promise(B=>setTimeout(B,300))},0)})}}async function generateOutputSlicesV2(u,n,s,c,f,g,A,v,y,T){if(y.isPostProcessEnable){const k=new BWLabeler,e=new Uint32Array(n),N=26,M=!0,O=!0,[U,B]=k.bwlabel(u,e,N,M,O);for(let V=0;V0&&ee<=1?e=await applyMriThreshold(c,ee):(console.log("No valid crop threshold value"),e=await c.greater([0]).asType("bool"))}else e=await v.greater([0]).asType("bool");console.log(" mask_3d shape : ",e.shape);const N=await whereAsync(e);e.dispose();const M=N.arraySync();let O=g,U=0,B=A,V=0,b=f,W=0;for(let ee=0;eeM[ee][0]?O=M[ee][0]:UM[ee][1]?B=M[ee][1]:VM[ee][2]?b=M[ee][2]:W{Tt=await ft.apply(ye[Se])});if(console.log("profileInfo : ",Lt),dispose(ye[Se]),console.log(" Output tensor",Tt),console.log(" Output tensor shape : ",Tt.shape),Tt.shape.length!==3){const be="Output tensor shape should be 3 dims but it is "+Tt.shape.length;y(be,-1,be)}const Ot=((performance.now()-ee)/1e3).toFixed(4);console.log(" find array max ");const Ft=await findArrayMax(Array.from(Tt.dataSync()));fehere'),memory().unreliable){const oe="unreliable reasons :"+memory().reasons;y(oe,NaN,oe)}}}async function inferenceFullVolumePhase2(u,n,s,c,f,g,A,v,y,T,I,S){let k=[];console.log(" ---- Start FullVolume inference phase-II ---- "),A.enableQuantileNorm?(console.log("preModel Quantile normalization enabled"),n=await quantileNormalizeVolumeData(n)):(console.log("preModel Min Max normalization enabled"),n=await minMaxNormalizeVolumeData(n));let N;if(g==null){const me=A.autoThreshold;me>0&&me<=1?N=await applyMriThreshold(n,me):(console.log("No valid crop threshold value"),N=await n.greater([0]).asType("bool"))}else N=g.greater([0]).asType("bool");console.log(" mask_3d shape : ",N.shape);const M=await whereAsync(N);N.dispose();const O=M.arraySync();let U=c,B=0,V=f,b=0,W=s,q=0;for(let me=0;meO[me][0]?U=O[me][0]:BO[me][1]?V=O[me][1]:bO[me][2]?W=O[me][2]:qhere')}}async function inferenceFullVolumePhase1(u,n,s,c,f,g,A,v,y,T,I,S){if(v.No_SubVolumes=1,A.preModelId){const k=await load_model(inferenceModelsList[A.preModelId-1].path),e=inferenceModelsList[A.preModelId-1].enableTranspose,N=inferenceModelsList[A.preModelId-1].enableQuantileNorm;let M=null;N?(console.log("preModel Quantile normalization enabled"),M=await quantileNormalizeVolumeData(n)):(console.log("preModel Min Max normalization enabled"),M=await minMaxNormalizeVolumeData(n)),e?(M=await M.transpose(),console.log("Input transposed for pre-model")):console.log("Transpose not enabled for pre-model"),v.Brainchop_Ver="PreModel_FV";const O=await k;try{const U=performance.now(),B=O,V=B.layers[0].batchInputShape;if(console.log(" Pre-Model batch input shape : ",V),V.length!==5){const Se="The pre-model input shape must be 5D ";return I(Se,-1,Se),0}const b=isModelChnlLast(B),W=y.batchSize,q=y.numOfChan;let Y,X,Q,m;if(b){if(console.log("Pre-Model Channel Last"),isNaN(V[4])||V[4]!==1){const Se="The number of channels for pre-model input shape must be 1";return I(Se,-1,Se),0}Y=V[1],X=V[2],Q=V[3],m=[W,Y,X,Q,q]}else{if(console.log("Pre-Model Channel First"),isNaN(V[1])||V[1]!==1){const Se="The number of channels for pre-model input shape must be 1";return I(Se,-1,Se),0}Y=V[2],X=V[3],Q=V[4],m=[W,q,Y,X,Q]}v.Input_Shape=JSON.stringify(m),v.Output_Shape=JSON.stringify(B.output.shape),v.Channel_Last=b,v.Model_Param=await getModelNumParameters(B),v.Model_Layers=await getModelNumLayers(B);let Z=0;const ee=inferenceModelsList[A.preModelId-1].inferenceDelay;let oe=1;const fe=O.layers.length,me=[];me[0]=M.reshape(m),dispose(M);const pe=window.setInterval(async function(){try{me[oe]=O.layers[oe].apply(me[oe-1])}catch(Se){return I(Se.message,-1,Se.message),window.clearInterval(pe),engine().endScope(),engine().disposeVariables(),v.Inference_t=1/0,v.Postprocess_t=1/0,v.Status="Fail",v.Error_Type=Se.message,v.Extra_Err_Info="PreModel Failed while model layer "+oe+" apply",y.telemetryFlag&&await submitTiming2GoogleSheet(v,I),0}if(O.layers[oe].dispose(),me[oe-1].dispose(),I("Layer "+oe.toString(),(oe+1)/fe),memory().unreliable){const Se="unreliable reasons :"+memory().reasons;I(Se,NaN,Se)}if(oe===fe-1){window.clearInterval(pe);const Se=b?-1:1;console.log(" find argmax "),console.log("last Tensor shape : ",me[oe].shape);const xe=b?me[oe].shape[4]:me[oe].shape[1];let we;try{console.log(" Try tf.argMax for fullVolume .."),we=await argMax$2(me[oe],Se)}catch(ft){if(Se===-1)try{const Tt=performance.now();console.log(" tf.argMax failed .. try argMaxLarge ..");const Lt=tensor2LightBuffer(me[oe].reshape([s,c,f,xe]),"float16");we=argMaxLarge(Lt,s,c,f,xe,"float16"),console.log("argMaxLarge for fullVolume takes : ",((performance.now()-Tt)/1e3).toFixed(4))}catch(Tt){const Lt="argMax buffer couldn't be created due to limited memory resources.";return I(Lt,-1,Lt),we.dispose(),window.clearInterval(pe),engine().endScope(),engine().disposeVariables(),v.Inference_t=1/0,v.Postprocess_t=1/0,v.Status="Fail",v.Error_Type=Tt.message,v.Extra_Err_Info="preModel prediction_argmax from argMaxLarge failed",y.telemetryFlag&&await submitTiming2GoogleSheet(v,I),0}else{const Tt="argMax buffer couldn't be created due to limited memory resources.";return I(Tt,-1,Tt),we.dispose(),window.clearInterval(pe),engine().endScope(),engine().disposeVariables(),v.Inference_t=1/0,v.Postprocess_t=1/0,v.Status="Fail",v.Error_Type=ft.message,v.Extra_Err_Info="preModel prediction_argmax from argMaxLarge not support yet channel first",y.telemetryFlag&&await submitTiming2GoogleSheet(v,I),0}}console.log(" Pre-model prediction_argmax shape : ",we.shape);const Fe=((performance.now()-U)/1e3).toFixed(4);dispose(me[oe]),console.log(" Pre-model find array max ");const De=await findArrayMax(Array.from(we.dataSync()));Zhere')}}else console.log("--- No pre-model is selected ---"),console.log("------ Run voxel cropping ------"),g?A.enableSeqConv?(console.log("------ Seq Convoluton ------"),await inferenceFullVolumeSeqCovLayerPhase2(y,A,u,n,s,c,f,null,I,T,v,S)):inferenceFullVolumePhase2(u,n,s,c,f,null,A,v,y,T,I,S):inferenceSubVolumes(u,n,s,c,f,null)}async function enableProductionMode(u=!0){await enableProdMode(),env().set("DEBUG",!1),env().set("WEBGL_FORCE_F16_TEXTURES",u),env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0),await ready(),console.log("tf env() flags :",env().flags),console.log("tf env() features :",env().features),console.log("tf env total features: ",Object.keys(env().features).length),console.log(getBackend())}async function runInference(u,n,s,c,f,g){g("Segmentation started",0);const A=performance.now(),v=u.batchSize,y=u.numOfChan;if(isNaN(v)||v!==1){const m="The batch Size for input shape must be 1";return g(m,-1,m),0}if(isNaN(y)||y!==1){const m="The number of channels for input shape must be 1";return g(m,-1,m),0}engine().startScope(),console.log("Batch size: ",v),console.log("Num of Channels: ",y);const T=await load_model(n.path);await enableProductionMode(!0);const I=T;let S=[];if(S=I.layers[0].batchInputShape,console.log(" Model batch input shape : ",S),S.length!==5){const m="The model input shape must be 5D";return g(m,-1,m),0}let k,e,N;const M=s.dims[1],O=s.dims[2],U=s.dims[3],B=await isModelChnlLast(I);if(B){if(console.log("Model Channel Last"),isNaN(S[4])||S[4]!==1){const m="The number of channels for input shape must be 1";return g(m,-1,m),0}k=S[1],e=S[2],N=S[3]}else{if(console.log("Model Channel First"),isNaN(S[1])||S[1]!==1){const m="The number of channels for input shape must be 1";return g(m,-1,m),0}k=S[2],e=S[3],N=S[4]}let V;k===256&&e===256&&N===256?V=!0:V=!1;let b=await getAllSlicesData1D(U,s,c);const W=await getAllSlices2D(b,O,M);b=null;let q=await getSlices3D(W);dispose(W);const Y=[];if(u.telemetryFlag){const m=((performance.now()-A)/1e3).toFixed(4),Z=new Date;V?Y.Brainchop_Ver="FullVolume":Y.Brainchop_Ver="SubVolumes",Y.Date=parseInt(Z.getMonth()+1)+"/"+Z.getDate()+"/"+Z.getFullYear(),Y.Time=await checkZero(Z.getHours())+":"+checkZero(Z.getMinutes())+":"+checkZero(Z.getSeconds()),Y.Input_Shape=JSON.stringify(S),Y.Output_Shape=JSON.stringify(I.output.shape),Y.Channel_Last=B,Y.Model_Param=await getModelNumParameters(I),Y.Model_Layers=await getModelNumLayers(I),Y.Preprocess_t=m,Y.Model=n.modelName,Y.Browser=await detectBrowser(),Y.Browser_Ver=await detectBrowserVersion(),Y.OS=await detectOperatingSys(),Y.WebGL2=await checkWebGl2(g),Y.GPU_Vendor=await detectGPUVendor(),Y.GPU_Card=await detectGPUCardType(),Y.GPU_Vendor_Full=await detectGPUVendor_v0(),Y.GPU_Card_Full=await detectGPUCardType_v0(),Y.CPU_Cores=await getCPUNumCores(),Y.TF_Backend=getBackend(),Y.Which_Brainchop="latest",Y.Seq_Conv=n.enableSeqConv,Y.Actual_Labels=1/0,Y.Expect_Labels=1/0,Y.NumLabels_Match=null,Y.Inference_t=1/0,Y.Merge_t=1/0,Y.Postprocess_t=1/0,Y.Status=null,Y.Error_Type=null,Y.Extra_Err_Info=null,Y.Extra_Info=null,isChrome()&&(Y.Heap_Size_MB=window.performance.memory.totalJSHeapSize/(1024*1024).toFixed(2),Y.Used_Heap_MB=window.performance.memory.usedJSHeapSize/(1024*1024).toFixed(2),Y.Heap_Limit_MB=window.performance.memory.jsHeapSizeLimit/(1024*1024).toFixed(2));const ee=checkWebGl2()?document.createElement("canvas").getContext("webgl2"):null;console.log("MAX_TEXTURE_SIZE :",ee.getParameter(ee.MAX_TEXTURE_SIZE)),console.log("MAX_RENDERBUFFER_SIZE :",ee.getParameter(ee.MAX_RENDERBUFFER_SIZE));const oe=ee.getExtension("WEBGL_debug_renderer_info");console.log("VENDOR WEBGL:",ee.getParameter(oe.UNMASKED_VENDOR_WEBGL)),ee?Y.Texture_Size=ee.getParameter(ee.MAX_TEXTURE_SIZE):Y.Texture_Size=null}const X=n.enableTranspose,Q=n.enableCrop;V&&(Q?await inferenceFullVolumePhase1(T,q,U,O,M,V,n,Y,u,f,g,c):(console.log("Cropping Disabled"),X?(q=q.transpose(),console.log("Input transposed")):console.log("Transpose NOT Enabled"),n.enableSeqConv?(console.log("Seq Convoluton Enabled"),await inferenceFullVolumeSeqCovLayer()):(console.log("Seq Convoluton Disabled"),await inferenceFullVolume())))}async function main(){let u={backColor:[.4,.4,.4,1],show3Dcrosshair:!0,onLocationChange:A},n=new Niivue(u);n.attachToCanvas(gl1),n.opts.dragMode=n.dragModes.pan,n.opts.multiplanarForceRender=!0,n.opts.yoke3Dto2DZoom=!0,await n.loadVolumes([{url:"./t1_crop.nii.gz"}]),aboutBtn.onclick=function(){window.alert("BrainChop models https://github.com/neuroneural/brainchop")},opacitySlider.oninput=function(){n.setOpacity(1,opacitySlider.value/255)};async function s(){let y=n.volumes[0],T=y.dims[1]===256&&y.dims[2]===256&&y.dims[3]===256;if((y.permRAS[0]!==-1||y.permRAS[1]!==3||y.permRAS[2]!==-2)&&(T=!1),T)return;let I=await n.conform(y,!1);n.removeVolume(n.volumes[0]),n.addVolume(I)}modelSelect.onchange=async function(){await s();let y=inferenceModelsList[this.selectedIndex];runInference(brainChopOpts,y,n.volumes[0].hdr,n.volumes[0].img,f,g)},saveBtn.onclick=function(){n.volumes[1].saveToDisk("Custom.nii")};async function c(y){return await(await fetch(y)).json()}async function f(y,T,I){for(;n.volumes.length>1;)await n.removeVolume(n.volumes[1]);let S=await n.volumes[0].clone();if(S.zeroImage(),S.hdr.scl_inter=0,S.hdr.scl_slope=1,S.img=new Uint8Array(y),I.colormapPath){let k=await c(I.colormapPath);S.setColormapLabel(k)}else{let k=T.atlasSelectedColorTable.toLowerCase();n.colormaps().includes(k)||(k="actc"),S.colormap=k}S.opacity=opacitySlider.value/255,await n.addVolume(S)}function g(y="",T=-1,I=""){console.log(y),document.getElementById("location").innerHTML=y,isNaN(T)?(memstatus.style.color="red",memstatus.innerHTML="Memory Issue"):T>=0&&(modelProgress.value=T*modelProgress.max),I!==""&&window.alert(I)}function A(y){document.getElementById("location").innerHTML="  "+y.string}for(let y=0;y Niivue brain chop - + diff --git a/models/model18cls/colormap.json b/models/model18cls/colormap.json new file mode 100644 index 0000000..ee61421 --- /dev/null +++ b/models/model18cls/colormap.json @@ -0,0 +1,6 @@ +{ + "R": [ 0, 245, 205, 120, 196, 220, 230, 0, 122, 236, 12, 204, 42, 119, 220, 103, 255, 165], + "G": [ 0, 245, 62, 18, 58, 248, 148, 118, 186, 13, 48, 182, 204, 159, 216, 255, 165, 42], + "B": [ 0, 245, 78, 134, 250, 164, 34, 14, 220, 176, 255, 142, 164, 176, 20, 255, 0, 42], + "labels": [ "Unknown", "Cerebral-White-Matter", "Cerebral-Cortex", "Lateral-Ventricle", "Inferior-Lateral-Ventricle", "Cerebellum-White-Matter", "Cerebellum-Cortex", "Thalamus", "Caudate", "Putamen", "Pallidum", "3rd-Ventricle", "4th-Ventricle", "Brain-Stem", "Hippocampus", "Amygdala", "Accumbens-area", "VentralDC"] +} \ No newline at end of file diff --git a/models/model20chan3cls/colormap.json b/models/model20chan3cls/colormap.json new file mode 100644 index 0000000..2343358 --- /dev/null +++ b/models/model20chan3cls/colormap.json @@ -0,0 +1,6 @@ +{ + "R": [ 0, 255, 205], + "G": [ 0, 255, 62], + "B": [ 0, 255, 78], + "labels": [ "background", "White Matter", "Grey Matter"] +} \ No newline at end of file diff --git a/models/model21_104class/colormap.json b/models/model21_104class/colormap.json new file mode 100644 index 0000000..f728661 --- /dev/null +++ b/models/model21_104class/colormap.json @@ -0,0 +1,6 @@ +{ + "R": [ 0, 25, 125, 100, 220, 220, 180, 220, 180, 140, 20, 35, 225, 200, 160, 20, 60, 220, 20, 220, 120, 220, 220, 60, 160, 80, 75, 20, 20, 140, 80, 100, 70, 150, 255, 25, 125, 100, 220, 220, 180, 220, 180, 140, 20, 35, 225, 200, 160, 20, 60, 220, 20, 220, 120, 220, 220, 60, 160, 80, 75, 20, 20, 140, 80, 100, 70, 150, 255, 0, 0, 122, 122, 236, 236, 12, 13, 220, 220, 103, 103, 255, 255, 165, 165, 245, 245, 120, 196, 120, 196, 204, 42, 60, 119, 220, 220, 230, 230, 0, 0, 0, 0, 0], + "G": [ 0, 100, 100, 25, 20, 20, 220, 60, 40, 20, 30, 75, 140, 35, 100, 220, 220, 180, 100, 60, 100, 20, 180, 20, 140, 20, 50, 220, 180, 220, 160, 0, 70, 150, 192, 100, 100, 25, 20, 20, 220, 60, 40, 20, 30, 75, 140, 35, 100, 220, 220, 180, 100, 60, 100, 20, 180, 20, 140, 20, 50, 220, 180, 220, 160, 0, 70, 150, 192, 118, 118, 186, 186, 13, 13, 48, 48, 216, 216, 255, 255, 165, 165, 42, 42, 245, 245, 18, 58, 18, 58, 182, 204, 60, 159, 248, 248, 148, 148, 0, 0, 0, 0, 0], + "B": [ 0, 40, 160, 0, 100, 10, 140, 220, 120, 140, 140, 50, 140, 75, 50, 60, 60, 140, 50, 20, 60, 20, 220, 220, 180, 140, 125, 160, 140, 220, 20, 100, 70, 200, 32, 40, 160, 0, 100, 10, 140, 220, 120, 140, 140, 50, 140, 75, 50, 60, 60, 140, 50, 20, 60, 20, 220, 220, 180, 140, 125, 160, 140, 220, 20, 100, 70, 200, 32, 14, 14, 220, 220, 176, 176, 255, 255, 20, 20, 255, 255, 0, 0, 42, 42, 245, 245, 134, 250, 134, 250, 142, 164, 60, 176, 164, 164, 34, 34, 64, 112, 160, 208, 255], + "labels": [ "BG", "ctx-lh-bankssts", "ctx-lh-caudalanteriorcingulate", "ctx-lh-caudalmiddlefrontal", "ctx-lh-cuneus", "ctx-lh-entorhinal", "ctx-lh-fusiform", "ctx-lh-inferiorparietal", "ctx-lh-inferiortemporal", "ctx-lh-isthmuscingulate", "ctx-lh-lateraloccipital", "ctx-lh-lateralorbitofrontal", "ctx-lh-lingual", "ctx-lh-medialorbitofrontal", "ctx-lh-middletemporal", "ctx-lh-parahippocampal", "ctx-lh-paracentral", "ctx-lh-parsopercularis", "ctx-lh-parsorbitalis", "ctx-lh-parstriangularis", "ctx-lh-pericalcarine", "ctx-lh-postcentral", "ctx-lh-posteriorcingulate", "ctx-lh-precentral", "ctx-lh-precuneus", "ctx-lh-rostralanteriorcingulate", "ctx-lh-rostralmiddlefrontal", "ctx-lh-superiorfrontal", "ctx-lh-superiorparietal", "ctx-lh-superiortemporal", "ctx-lh-supramarginal", "ctx-lh-frontalpole", "ctx-lh-temporalpole", "ctx-lh-transversetemporal", "ctx-lh-insula", "ctx-rh-bankssts", "ctx-rh-caudalanteriorcingulate", "ctx-rh-caudalmiddlefrontal", "ctx-rh-cuneus", "ctx-rh-entorhinal", "ctx-rh-fusiform", "ctx-rh-inferiorparietal", "ctx-rh-inferiortemporal", "ctx-rh-isthmuscingulate", "ctx-rh-lateraloccipital", "ctx-rh-lateralorbitofrontal", "ctx-rh-lingual", "ctx-rh-medialorbitofrontal", "ctx-rh-middletemporal", "ctx-rh-parahippocampal", "ctx-rh-paracentral", "ctx-rh-parsopercularis", "ctx-rh-parsorbitalis", "ctx-rh-parstriangularis", "ctx-rh-pericalcarine", "ctx-rh-postcentral", "ctx-rh-posteriorcingulate", "ctx-rh-precentral", "ctx-rh-precuneus", "ctx-rh-rostralanteriorcingulate", "ctx-rh-rostralmiddlefrontal", "ctx-rh-superiorfrontal", "ctx-rh-superiorparietal", "ctx-rh-superiortemporal", "ctx-rh-supramarginal", "ctx-rh-frontalpole", "ctx-rh-temporalpole", "ctx-rh-transversetemporal", "ctx-rh-insula", "Left-Thalamus-Proper*", "Right-Thalamus-Proper*", "Left-Caudate", "Right-Caudate", "Left-Putamen", "Right-Putamen", "Left-Pallidum", "Right-Pallidum", "Left-Hippocampus", "Right-Hippocampus", "Left-Amygdala", "Right-Amygdala", "Left-Accumbens-area", "Right-Accumbens-area", "Left-VentralDC", "Right-VentralDC", "Left-Cerebral-White-Matter", "Right-Cerebral-White-Matter", "Left-Lateral-Ventricle", "Left-Inf-Lat-Vent", "Right-Lateral-Ventricle", "Right-Inf-Lat-Vent", "3rd-Ventricle", "4th-Ventricle", "CSF", "Brain-Stem", "Left-Cerebellum-White-Matter", "Right-Cerebellum-White-Matter", "Left-Cerebellum-Cortex", "Right-Cerebellum-Cortex", "CC_Posterior", "CC_Mid_Posterior", "CC_Central", "CC_Mid_Anterior", "CC_Anterior"] +} \ No newline at end of file diff --git a/models/model30chan18cls/colormap.json b/models/model30chan18cls/colormap.json new file mode 100644 index 0000000..ee61421 --- /dev/null +++ b/models/model30chan18cls/colormap.json @@ -0,0 +1,6 @@ +{ + "R": [ 0, 245, 205, 120, 196, 220, 230, 0, 122, 236, 12, 204, 42, 119, 220, 103, 255, 165], + "G": [ 0, 245, 62, 18, 58, 248, 148, 118, 186, 13, 48, 182, 204, 159, 216, 255, 165, 42], + "B": [ 0, 245, 78, 134, 250, 164, 34, 14, 220, 176, 255, 142, 164, 176, 20, 255, 0, 42], + "labels": [ "Unknown", "Cerebral-White-Matter", "Cerebral-Cortex", "Lateral-Ventricle", "Inferior-Lateral-Ventricle", "Cerebellum-White-Matter", "Cerebellum-Cortex", "Thalamus", "Caudate", "Putamen", "Pallidum", "3rd-Ventricle", "4th-Ventricle", "Brain-Stem", "Hippocampus", "Amygdala", "Accumbens-area", "VentralDC"] +} \ No newline at end of file diff --git a/models/model30chan50cls/colormap.json b/models/model30chan50cls/colormap.json new file mode 100644 index 0000000..102ee20 --- /dev/null +++ b/models/model30chan50cls/colormap.json @@ -0,0 +1,6 @@ +{ + "R": [ 0, 245, 196, 220, 230, 0, 122, 236, 12, 119, 220, 103, 60, 255, 165, 0, 25, 125, 100, 220, 220, 180, 220, 180, 140, 20, 35, 225, 200, 160, 20, 60, 220, 20, 220, 120, 220, 220, 60, 160, 80, 75, 20, 20, 140, 80, 100, 70, 150, 255], + "G": [ 0, 245, 58, 248, 148, 118, 186, 13, 48, 159, 216, 255, 60, 165, 42, 0, 100, 100, 25, 20, 20, 220, 60, 40, 20, 30, 75, 140, 35, 100, 220, 220, 180, 100, 60, 100, 20, 180, 20, 140, 20, 50, 220, 180, 220, 160, 0, 70, 150, 192], + "B": [ 0, 245, 250, 164, 34, 14, 220, 176, 255, 176, 20, 255, 60, 0, 42, 208, 40, 160, 0, 100, 10, 140, 220, 120, 140, 140, 50, 140, 75, 50, 60, 60, 140, 50, 20, 60, 20, 220, 220, 180, 140, 125, 160, 140, 220, 20, 100, 70, 200, 32], + "labels": [ "BG", "Cerebral-White-Matter", "Ventricle", "Cerebellum-White-Matter", "Cerebellum", "Thalamus-Proper*", "Caudate", "Putamen", "Pallidum", "Brain-Stem", "Hippocampus", "Amygdala", "CSF", "Accumbens-area", "VentralDC", "CC_Posterior / CC_Mid_Posterior / CC_Central / CC_Mid_Anterior / CC_Anterior", "ctx-bankssts", "ctx-caudalanteriorcingulate", "ctx-caudalmiddlefrontal", "ctx-cuneus", "ctx-entorhinal", "ctx-fusiform", "ctx-inferiorparietal", "ctx-inferiortemporal", "ctx-isthmuscingulate", "ctx-lateraloccipital", "ctx-lateralorbitofrontal", "ctx-lingual", "ctx-medialorbitofrontal", "ctx-middletemporal", "ctx-parahippocampal", "ctx-paracentral", "ctx-parsopercularis", "ctx-parsorbitalis", "ctx-parstriangularis", "ctx-pericalcarine", "ctx-postcentral", "ctx-posteriorcingulate", "ctx-precentral", "ctx-precuneus", "ctx-rostralanteriorcingulate", "ctx-rostralmiddlefrontal", "ctx-superiorfrontal", "ctx-superiorparietal", "ctx-superiortemporal", "ctx-supramarginal", "ctx-frontalpole", "ctx-temporalpole", "ctx-transversetemporal", "ctx-insula"] +} \ No newline at end of file diff --git a/models/model5_gw_ae/colormap.json b/models/model5_gw_ae/colormap.json new file mode 100644 index 0000000..9838f5d --- /dev/null +++ b/models/model5_gw_ae/colormap.json @@ -0,0 +1,6 @@ +{ + "R": [0, 255], + "G": [0, 0], + "B": [0, 0], + "labels": ["background", "brain"] +} \ No newline at end of file diff --git a/models/model5_gw_ae/colormap3.json b/models/model5_gw_ae/colormap3.json new file mode 100644 index 0000000..2343358 --- /dev/null +++ b/models/model5_gw_ae/colormap3.json @@ -0,0 +1,6 @@ +{ + "R": [ 0, 255, 205], + "G": [ 0, 255, 62], + "B": [ 0, 255, 78], + "labels": [ "background", "White Matter", "Grey Matter"] +} \ No newline at end of file