@substrate-system/fflate
Version:
High performance (de)compression in an 8kB package
3 lines (2 loc) • 32.6 kB
JavaScript
var Qe=Object.create;var gt=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var tn=Object.getPrototypeOf,en=Object.prototype.hasOwnProperty;var o=(e,t)=>gt(e,"name",{value:t,configurable:!0});var nn=(e,t)=>{for(var n in t)gt(e,n,{get:t[n],enumerable:!0})},he=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $e(t))!en.call(e,r)&&r!==n&>(e,r,{get:()=>t[r],enumerable:!(i=Xe(t,r))||i.enumerable});return e};var rn=(e,t,n)=>(n=e!=null?Qe(tn(e)):{},he(t||!e||!e.__esModule?gt(n,"default",{value:e,enumerable:!0}):n,e)),sn=e=>he(gt({},"__esModule",{value:!0}),e);var On={};nn(On,{AsyncCompress:()=>Le,AsyncDecompress:()=>pn,AsyncDeflate:()=>Re,AsyncGunzip:()=>Pe,AsyncGzip:()=>Le,AsyncInflate:()=>se,AsyncUnzipInflate:()=>zn,AsyncUnzlib:()=>je,AsyncZipDeflate:()=>dn,AsyncZlib:()=>on,Compress:()=>Mt,DecodeUTF8:()=>mn,Decompress:()=>ce,Deflate:()=>J,EncodeUTF8:()=>yn,FlateErrorCode:()=>an,Gunzip:()=>Bt,Gzip:()=>Mt,Inflate:()=>N,Unzip:()=>xn,UnzipInflate:()=>Fn,UnzipPassThrough:()=>Ye,Unzlib:()=>qt,Zip:()=>An,ZipDeflate:()=>bn,ZipPassThrough:()=>Ot,Zlib:()=>le,compress:()=>Ne,compressSync:()=>Et,createZippable:()=>hn,decompress:()=>fn,decompressSync:()=>un,deflate:()=>qe,deflateSync:()=>wt,gunzip:()=>We,gunzipSync:()=>Rt,gzip:()=>Ne,gzipSync:()=>Et,inflate:()=>ae,inflateSync:()=>At,strFromU8:()=>pe,strToU8:()=>it,unzip:()=>Sn,unzipSync:()=>wn,unzlib:()=>Ve,unzlibSync:()=>Lt,zip:()=>gn,zipSync:()=>Un,zlib:()=>cn,zlibSync:()=>oe});module.exports=sn(On);var Be=rn(require("./node-worker"),1);const S=Uint8Array,q=Uint16Array,Ut=Int32Array,at=new S([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]),lt=new S([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]),Ft=new S([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),me=o((e,t)=>{const n=new q(31);for(let r=0;r<31;++r)n[r]=t+=1<<e[r-1];const i=new Ut(n[30]);for(let r=1;r<30;++r)for(let s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},"freb"),{b:Wt,r:kt}=me(at,2);Wt[28]=258,kt[258]=28;const{b:ye,r:jt}=me(lt,0),zt=new q(32768);for(let e=0;e<32768;++e){let t=(e&43690)>>1|(e&21845)<<1;t=(t&52428)>>2|(t&13107)<<2,t=(t&61680)>>4|(t&3855)<<4,zt[e]=((t&65280)>>8|(t&255)<<8)>>1}const j=o((e,t,n)=>{const i=e.length;let r=0;const s=new q(t);for(;r<i;++r)e[r]&&++s[e[r]-1];const a=new q(t);for(r=1;r<t;++r)a[r]=a[r-1]+s[r-1]<<1;let c;if(n){c=new q(1<<t);const u=15-t;for(r=0;r<i;++r)if(e[r]){const f=r<<4|e[r],l=t-e[r];let p=a[e[r]-1]++<<l;for(const m=p|(1<<l)-1;p<=m;++p)c[zt[p]>>u]=f}}else for(c=new q(i),r=0;r<i;++r)e[r]&&(c[r]=zt[a[e[r]-1]++]>>15-e[r]);return c},"hMap"),Q=new S(288);for(let e=0;e<144;++e)Q[e]=8;for(let e=144;e<256;++e)Q[e]=9;for(let e=256;e<280;++e)Q[e]=7;for(let e=280;e<288;++e)Q[e]=8;const ot=new S(32);for(let e=0;e<32;++e)ot[e]=5;const be=j(Q,9,0),de=j(Q,9,1),Ae=j(ot,5,0),ge=j(ot,5,1),Ht=o(e=>{let t=e[0];for(let n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},"max"),V=o((e,t,n)=>{const i=t/8|0;return(e[i]|e[i+1]<<8)>>(t&7)&n},"bits"),Ct=o((e,t)=>{const n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},"bits16"),ct=o(e=>(e+7)/8|0,"shft"),Y=o((e,t,n)=>((t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new S(e.subarray(t,n))),"slc"),an={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},Ue=["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"],b=o((e,t,n)=>{const i=new Error(t||Ue[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,b),!n)throw i;return i},"err"),xt=o((e,t,n,i)=>{const r=e.length,s=i?i.length:0;if(!r||t.f&&!t.l)return n||new S(0);const a=!n,c=a||t.i!=2,u=t.i;a&&(n=new S(r*3));const f=o(A=>{let O=n.length;if(A>O){const w=new S(Math.max(O*2,A));w.set(n),n=w}},"cbuf");let l=t.f||0,p=t.p||0,m=t.b||0,h=t.l,y=t.d,d=t.m,x=t.n;const g=r*8;do{if(!h){l=V(e,p,1);const z=V(e,p+1,3);if(p+=3,z)if(z==1)h=de,y=ge,d=9,x=5;else if(z==2){const U=V(e,p,31)+257,k=V(e,p+10,15)+4,I=U+V(e,p+5,31)+1;p+=14;const F=new S(I),H=new S(19);for(let C=0;C<k;++C)H[Ft[C]]=V(e,p+C*3,7);p+=k*3;const T=Ht(H),D=(1<<T)-1,G=j(H,T,1);for(let C=0;C<I;){const B=G[V(e,p,D)];p+=B&15;const R=B>>4;if(R<16)F[C++]=R;else{let X=0,P=0;for(R==16?(P=3+V(e,p,3),p+=2,X=F[C-1]):R==17?(P=3+V(e,p,7),p+=3):R==18&&(P=11+V(e,p,127),p+=7);P--;)F[C++]=X}}const Z=F.subarray(0,U),E=F.subarray(U);d=Ht(Z),x=Ht(E),h=j(Z,d,1),y=j(E,x,1)}else b(1);else{const U=ct(p)+4,k=e[U-4]|e[U-3]<<8,I=U+k;if(I>r){u&&b(0);break}c&&f(m+k),n.set(e.subarray(U,I),m),t.b=m+=k,t.p=p=I*8,t.f=l;continue}if(p>g){u&&b(0);break}}c&&f(m+131072);const A=(1<<d)-1,O=(1<<x)-1;let w=p;for(;;w=p){const z=h[Ct(e,p)&A],U=z>>4;if(p+=z&15,p>g){u&&b(0);break}if(z||b(2),U<256)n[m++]=U;else if(U==256){w=p,h=null;break}else{let k=U-254;if(U>264){const D=U-257,G=at[D];k=V(e,p,(1<<G)-1)+Wt[D],p+=G}const I=y[Ct(e,p)&O],F=I>>4;I||b(3),p+=I&15;let H=ye[F];if(F>3){const D=lt[F];H+=Ct(e,p)&(1<<D)-1,p+=D}if(p>g){u&&b(0);break}c&&f(m+131072);const T=m+k;if(m<H){const D=s-H,G=Math.min(H,T);for(D+m<0&&b(3);m<G;++m)n[m]=i[D+m]}for(;m<T;++m)n[m]=n[m-H]}}t.l=h,t.p=w,t.b=m,t.f=l,h&&(l=1,t.m=d,t.d=y,t.n=x)}while(!l);return m!=n.length&&a?Y(n,0,m):n.subarray(0,m)},"inflt"),K=o((e,t,n)=>{n<<=t&7;const i=t/8|0;e[i]|=n,e[i+1]|=n>>8},"wbits"),pt=o((e,t,n)=>{n<<=t&7;const i=t/8|0;e[i]|=n,e[i+1]|=n>>8,e[i+2]|=n>>16},"wbits16"),Zt=o((e,t)=>{const n=[];for(let h=0;h<e.length;++h)e[h]&&n.push({s:h,f:e[h]});const i=n.length,r=n.slice();if(!i)return{t:tt,l:0};if(i==1){const h=new S(n[0].s+1);return h[n[0].s]=1,{t:h,l:1}}n.sort((h,y)=>h.f-y.f),n.push({s:-1,f:25001});let s=n[0],a=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:s.f+a.f,l:s,r:a};u!=i-1;)s=n[n[c].f<n[f].f?c++:f++],a=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:s.f+a.f,l:s,r:a};let l=r[0].s;for(let h=1;h<i;++h)r[h].s>l&&(l=r[h].s);const p=new q(l+1);let m=It(n[u-1],p,0);if(m>t){let h=0,y=0;const d=m-t,x=1<<d;for(r.sort((g,A)=>p[A.s]-p[g.s]||g.f-A.f);h<i;++h){const g=r[h].s;if(p[g]>t)y+=x-(1<<m-p[g]),p[g]=t;else break}for(y>>=d;y>0;){const g=r[h].s;p[g]<t?y-=1<<t-p[g]++-1:++h}for(;h>=0&&y;--h){const g=r[h].s;p[g]==t&&(--p[g],++y)}m=t}return{t:new S(p),l:m}},"hTree"),It=o((e,t,n)=>e.s==-1?Math.max(It(e.l,t,n+1),It(e.r,t,n+1)):t[e.s]=n,"ln"),Vt=o(e=>{let t=e.length;for(;t&&!e[--t];);const n=new q(++t);let i=0,r=e[0],s=1;const a=o(c=>{n[i++]=c},"w");for(let c=1;c<=t;++c)if(e[c]==r&&c!=t)++s;else{if(!r&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(r),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(r);s=1,r=e[c]}return{c:n.subarray(0,i),n:t}},"lc"),ft=o((e,t)=>{let n=0;for(let i=0;i<t.length;++i)n+=e[i]*t[i];return n},"clen"),Yt=o((e,t,n)=>{const i=n.length,r=ct(t+2);e[r]=i&255,e[r+1]=i>>8,e[r+2]=e[r]^255,e[r+3]=e[r+1]^255;for(let s=0;s<i;++s)e[r+s+4]=n[s];return(r+4+i)*8},"wfblk"),_t=o((e,t,n,i,r,s,a,c,u,f,l)=>{K(t,l++,n),++r[256];const{t:p,l:m}=Zt(r,15),{t:h,l:y}=Zt(s,15),{c:d,n:x}=Vt(p),{c:g,n:A}=Vt(h),O=new q(19);for(let Z=0;Z<d.length;++Z)++O[d[Z]&31];for(let Z=0;Z<g.length;++Z)++O[g[Z]&31];const{t:w,l:z}=Zt(O,7);let U=19;for(;U>4&&!w[Ft[U-1]];--U);const k=f+5<<3,I=ft(r,Q)+ft(s,ot)+a,F=ft(r,p)+ft(s,h)+a+14+3*U+ft(O,w)+2*O[16]+3*O[17]+7*O[18];if(u>=0&&k<=I&&k<=F)return Yt(t,l,e.subarray(u,u+f));let H,T,D,G;if(K(t,l,1+(F<I)),l+=2,F<I){H=j(p,m,0),T=p,D=j(h,y,0),G=h;const Z=j(w,z,0);K(t,l,x-257),K(t,l+5,A-1),K(t,l+10,U-4),l+=14;for(let C=0;C<U;++C)K(t,l+3*C,w[Ft[C]]);l+=3*U;const E=[d,g];for(let C=0;C<2;++C){const B=E[C];for(let R=0;R<B.length;++R){const X=B[R]&31;K(t,l,Z[X]),l+=w[X],X>15&&(K(t,l,B[R]>>5&127),l+=B[R]>>12)}}}else H=be,T=Q,D=Ae,G=ot;for(let Z=0;Z<c;++Z){const E=i[Z];if(E>255){const C=E>>18&31;pt(t,l,H[C+257]),l+=T[C+257],C>7&&(K(t,l,E>>23&31),l+=at[C]);const B=E&31;pt(t,l,D[B]),l+=G[B],B>3&&(pt(t,l,E>>5&8191),l+=lt[B])}else pt(t,l,H[E]),l+=T[E]}return pt(t,l,H[256]),l+T[256]},"wblk"),Fe=new Ut([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),tt=new S(0),ze=o((e,t,n,i,r,s)=>{const a=s.z||e.length,c=new S(i+a+5*(1+Math.ceil(a/7e3))+r),u=c.subarray(i,c.length-r),f=s.l;let l=(s.r||0)&7;if(t){l&&(u[0]=s.r>>3);const p=Fe[t-1],m=p>>13,h=p&8191,y=(1<<n)-1,d=s.p||new q(32768),x=s.h||new q(y+1),g=Math.ceil(n/3),A=2*g,O=o(G=>(e[G]^e[G+1]<<g^e[G+2]<<A)&y,"hsh"),w=new Ut(25e3),z=new q(288),U=new q(32);let k=0,I=0,F=s.i||0,H=0,T=s.w||0,D=0;for(;F+2<a;++F){const G=O(F);let Z=F&32767,E=x[G];if(d[Z]=E,x[G]=Z,T<=F){const C=a-F;if((k>7e3||H>24576)&&(C>423||!f)){l=_t(e,u,0,w,z,U,I,H,D,F-D,l),H=k=I=0,D=F;for(let W=0;W<286;++W)z[W]=0;for(let W=0;W<30;++W)U[W]=0}let B=2,R=0,X=h,P=Z-E&32767;if(C>2&&G==O(F-P)){const W=Math.min(m,C)-1,vt=Math.min(32767,F),_e=Math.min(258,C);for(;P<=vt&&--X&&Z!=E;){if(e[F+B]==e[F+B-P]){let $=0;for(;$<_e&&e[F+$]==e[F+$-P];++$);if($>B){if(B=$,R=P,$>W)break;const Je=Math.min(P,$-2);let fe=0;for(let Nt=0;Nt<Je;++Nt){const Pt=F-P+Nt&32767,Ke=d[Pt],ue=Pt-Ke&32767;ue>fe&&(fe=ue,E=Pt)}}}Z=E,E=d[Z],P+=Z-E&32767}}if(R){w[H++]=268435456|kt[B]<<18|jt[R];const W=kt[B]&31,vt=jt[R]&31;I+=at[W]+lt[vt],++z[257+W],++U[vt],T=F+B,++k}else w[H++]=e[F],++z[e[F]]}}for(F=Math.max(F,T);F<a;++F)w[H++]=e[F],++z[e[F]];l=_t(e,u,f,w,z,U,I,H,D,F-D,l),f||(s.r=l&7|u[l/8|0]<<3,l-=7,s.h=x,s.p=d,s.i=F,s.w=T)}else{for(let p=s.w||0;p<a+f;p+=65535){let m=p+65535;m>=a&&(u[l/8|0]=f,m=a),l=Yt(u,l+1,e.subarray(p,m))}s.i=a}return Y(c,0,i+ct(l)+r)},"dflt"),xe=(()=>{const e=new Int32Array(256);for(let t=0;t<256;++t){let n=t,i=9;for(;--i;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),ut=o(()=>{let e=-1;return{p(t){let n=e;for(let i=0;i<t.length;++i)n=xe[n&255^t[i]]^n>>>8;e=n},d(){return~e}}},"crc"),Dt=o(()=>{let e=1,t=0;return{p(n){let i=e,r=t;const s=n.length|0;for(let a=0;a!=s;){const c=Math.min(a+2655,s);for(;a<c;++a)r+=i+=n[a];i=(i&65535)+15*(i>>16),r=(r&65535)+15*(r>>16)}e=i,t=r},d(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},"adler"),rt=o((e,t,n,i,r)=>{if(!r&&(r={l:1},t.dictionary)){const s=t.dictionary.subarray(-32768),a=new S(s.length+e.length);a.set(s),a.set(e,s.length),e=a,r.w=s.length}return ze(e,t.level==null?6:t.level,t.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,i,r)},"dopt"),St=o((e,t)=>{const n={};for(const i in e)n[i]=e[i];for(const i in t)n[i]=t[i];return n},"mrg"),Se=o((e,t,n)=>{const i=e(),r=e.toString(),s=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(",");for(let a=0;a<i.length;++a){let c=i[a],u=s[a];if(typeof c=="function"){t+=";"+u+"=";const f=c.toString();if(c.prototype)if(f.indexOf("[native code]")!=-1){const l=f.indexOf(" ",8)+1;t+=f.slice(l,f.indexOf("(",l))}else{t+=f;for(const l in c.prototype)t+=";"+u+".prototype."+l+"="+c.prototype[l].toString()}else t+=f}else n[u]=c}return t},"wcln"),Tt=[],ln=o(e=>{const t=[];for(const n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t},"cbfs"),we=o((e,t,n,i)=>{if(!Tt[n]){let s="",a={},c=e.length-1;for(let u=0;u<c;++u)s=Se(e[u],s,a);Tt[n]={c:Se(e[c],s,a),e:a}}const r=St({},Tt[n].e);return(0,Be.default)(Tt[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,r,ln(r),i)},"wrkr"),ht=o(()=>[S,q,Ut,at,lt,Ft,Wt,ye,de,ge,zt,Ue,j,Ht,V,Ct,ct,Y,b,xt,At,et,Jt],"bInflt"),mt=o(()=>[S,q,Ut,at,lt,Ft,kt,jt,be,Q,Ae,ot,zt,Fe,tt,j,K,pt,Zt,It,Vt,ft,Yt,_t,ct,Y,ze,rt,wt,et],"bDflt"),Oe=o(()=>[Qt,$t,v,ut,xe],"gze"),ve=o(()=>[Xt,Ce],"guze"),ke=o(()=>[te,v,Dt],"zle"),He=o(()=>[ee],"zule"),et=o(e=>postMessage(e,[e.buffer]),"pbf"),Jt=o(e=>e&&{out:e.size&&new S(e.size),dictionary:e.dictionary},"gopt"),yt=o((e,t,n,i,r,s)=>{const a=we(n,i,r,(c,u)=>{a.terminate(),s(c,u)});return a.postMessage([e,t],t.consume?[e.buffer]:[]),()=>{a.terminate()}},"cbify"),_=o(e=>(e.ondata=(t,n)=>postMessage([t,n],[t.buffer]),t=>{t.data.length?(e.push(t.data[0],t.data[1]),postMessage([t.data[0].length])):e.flush()}),"astrm"),bt=o((e,t,n,i,r,s,a)=>{let c;const u=we(e,i,r,(f,l)=>{f?(u.terminate(),t.ondata.call(t,f)):Array.isArray(l)?l.length==1?(t.queuedSize-=l[0],t.ondrain&&t.ondrain(l[0])):(l[1]&&u.terminate(),t.ondata.call(t,f,l[0],l[1])):a(l)});u.postMessage(n),t.queuedSize=0,t.push=(f,l)=>{t.ondata||b(5),c&&t.ondata(b(4,0,1),null,!!l),t.queuedSize+=f.length,u.postMessage([f,c=l],[f.buffer])},t.terminate=()=>{u.terminate()},s&&(t.flush=()=>{u.postMessage([])})},"astrmify"),L=o((e,t)=>e[t]|e[t+1]<<8,"b2"),M=o((e,t)=>(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0,"b4"),Kt=o((e,t)=>M(e,t)+M(e,t+4)*4294967296,"b8"),v=o((e,t,n)=>{for(;n;++t)e[t]=n,n>>>=8},"wbytes"),Qt=o((e,t)=>{const n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&v(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(let i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}},"gzh"),Xt=o(e=>{(e[0]!=31||e[1]!=139||e[2]!=8)&&b(6,"invalid gzip data");const t=e[3];let n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(let i=(t>>3&1)+(t>>4&1);i>0;i-=!e[n++]);return n+(t&2)},"gzs"),Ce=o(e=>{const t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},"gzl"),$t=o(e=>10+(e.filename?e.filename.length+1:0),"gzhl"),te=o((e,t)=>{const n=t.level,i=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=i<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){const r=Dt();r.p(t.dictionary),v(e,2,r.d())}},"zlh"),ee=o((e,t)=>(((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&b(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&b(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2),"zls");function st(e,t){return typeof e=="function"&&(t=e,e={}),this.ondata=t,e}o(st,"StrmOpt");class J{static{o(this,"Deflate")}constructor(t,n){if(typeof t=="function"&&(n=t,t={}),this.ondata=n,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new S(98304),this.o.dictionary){const i=this.o.dictionary.subarray(-32768);this.b.set(i,32768-i.length),this.s.i=32768-i.length}}b;s;o;ondata;p(t,n){this.ondata(rt(t,this.o,0,0,this.s),n)}push(t,n){this.ondata||b(5),this.s.l&&b(4);const i=t.length+this.s.z;if(i>this.b.length){if(i>2*this.b.length-32768){const s=new S(i&-32768);s.set(this.b.subarray(0,this.s.z)),this.b=s}const r=this.b.length-this.s.z;this.b.set(t.subarray(0,r),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(r),32768),this.s.z=t.length-r+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=n&1,(this.s.z>this.s.w+8191||n)&&(this.p(this.b,n||!1),this.s.w=this.s.i,this.s.i-=2)}flush(){this.ondata||b(5),this.s.l&&b(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2}}class Re{static{o(this,"AsyncDeflate")}ondata;ondrain;queuedSize;constructor(t,n){bt([mt,()=>[_,J]],this,st.call(this,t,n),i=>{const r=new J(i.data);onmessage=_(r)},6,1)}terminate}function qe(e,t,n){return n||(n=t,t={}),typeof n!="function"&&b(7),yt(e,t,[mt],i=>et(wt(i.data[0],i.data[1])),0,n)}o(qe,"deflate");function wt(e,t){return rt(e,t||{},0,0)}o(wt,"deflateSync");class N{static{o(this,"Inflate")}s;o;p;d;ondata;constructor(t,n){typeof t=="function"&&(n=t,t={}),this.ondata=n;const i=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:i?i.length:0},this.o=new S(32768),this.p=new S(0),i&&this.o.set(i)}e(t){if(this.ondata||b(5),this.d&&b(4),!this.p.length)this.p=t;else if(t.length){const n=new S(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length),this.p=n}}c(t){this.s.i=+(this.d=t||!1);const n=this.s.b,i=xt(this.p,this.s,this.o);this.ondata(Y(i,n,this.s.b),this.d),this.o=Y(i,this.s.b-32768),this.s.b=this.o.length,this.p=Y(this.p,this.s.p/8|0),this.s.p&=7}push(t,n){this.e(t),this.c(n)}}class se{static{o(this,"AsyncInflate")}ondata;ondrain;queuedSize;constructor(t,n){bt([ht,()=>[_,N]],this,st.call(this,t,n),i=>{const r=new N(i.data);onmessage=_(r)},7,0)}terminate}function ae(e,t,n){return n||(n=t,t={}),typeof n!="function"&&b(7),yt(e,t,[ht],i=>et(At(i.data[0],Jt(i.data[1]))),1,n)}o(ae,"inflate");function At(e,t){return xt(e,{i:2},t&&t.out,t&&t.dictionary)}o(At,"inflateSync");class Mt{static{o(this,"Gzip")}c=ut();l=0;v=1;o;s;ondata;constructor(t,n){J.call(this,t,n)}push(t,n){this.c.p(t),this.l+=t.length,J.prototype.push.call(this,t,n)}p(t,n){const i=rt(t,this.o,this.v&&$t(this.o),n&&8,this.s);this.v&&(Qt(i,this.o),this.v=0),n&&(v(i,i.length-8,this.c.d()),v(i,i.length-4,this.l)),this.ondata(i,n)}flush(){J.prototype.flush.call(this)}}class Le{static{o(this,"AsyncGzip")}ondata;ondrain;queuedSize;constructor(t,n){bt([mt,Oe,()=>[_,J,Mt]],this,st.call(this,t,n),i=>{const r=new Mt(i.data);onmessage=_(r)},8,1)}terminate}function Ne(e,t,n){return n||(n=t,t={}),typeof n!="function"&&b(7),yt(e,t,[mt,Oe,()=>[Et]],i=>et(Et(i.data[0],i.data[1])),2,n)}o(Ne,"gzip");function Et(e,t){t||(t={});const n=ut(),i=e.length;n.p(e);const r=rt(e,t,$t(t),8),s=r.length;return Qt(r,t),v(r,s-8,n.d()),v(r,s-4,i),r}o(Et,"gzipSync");class Bt{static{o(this,"Gunzip")}v=1;r=0;o;p;s;ondata;onmember;constructor(t,n){N.call(this,t,n)}push(t,n){if(N.prototype.e.call(this,t),this.r+=t.length,this.v){const i=this.p.subarray(this.v-1),r=i.length>3?Xt(i):4;if(r>i.length){if(!n)return}else this.v>1&&this.onmember&&this.onmember(this.r-i.length);this.p=i.subarray(r),this.v=0}N.prototype.c.call(this,0),this.s.f&&!this.s.l?(this.v=ct(this.s.p)+9,this.s={i:0},this.o=new S(0),this.push(new S(0),n)):n&&N.prototype.c.call(this,n)}}class Pe{static{o(this,"AsyncGunzip")}ondata;ondrain;queuedSize;onmember;constructor(t,n){bt([ht,ve,()=>[_,N,Bt]],this,st.call(this,t,n),i=>{const r=new Bt(i.data);r.onmember=s=>postMessage(s),onmessage=_(r)},9,0,i=>this.onmember&&this.onmember(i))}terminate}function We(e,t,n){return n||(n=t,t={}),typeof n!="function"&&b(7),yt(e,t,[ht,ve,()=>[Rt]],i=>et(Rt(i.data[0],i.data[1])),3,n)}o(We,"gunzip");function Rt(e,t){const n=Xt(e);return n+8>e.length&&b(6,"invalid gzip data"),xt(e.subarray(n,-8),{i:2},t&&t.out||new S(Ce(e)),t&&t.dictionary)}o(Rt,"gunzipSync");class le{static{o(this,"Zlib")}c=Dt();v=1;o;s;ondata;constructor(t,n){J.call(this,t,n)}push(t,n){this.c.p(t),J.prototype.push.call(this,t,n)}p(t,n){const i=rt(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(te(i,this.o),this.v=0),n&&v(i,i.length-4,this.c.d()),this.ondata(i,n)}flush(){J.prototype.flush.call(this)}}class on{static{o(this,"AsyncZlib")}ondata;ondrain;queuedSize;constructor(t,n){bt([mt,ke,()=>[_,J,le]],this,st.call(this,t,n),i=>{const r=new le(i.data);onmessage=_(r)},10,1)}terminate}function cn(e,t,n){return n||(n=t,t={}),typeof n!="function"&&b(7),yt(e,t,[mt,ke,()=>[oe]],i=>et(oe(i.data[0],i.data[1])),4,n)}o(cn,"zlib");function oe(e,t){t||(t={});const n=Dt();n.p(e);const i=rt(e,t,t.dictionary?6:2,4);return te(i,t),v(i,i.length-4,n.d()),i}o(oe,"zlibSync");class qt{static{o(this,"Unzlib")}v;p;ondata;constructor(t,n){N.call(this,t,n),this.v=t&&t.dictionary?2:1}push(t,n){if(N.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(ee(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&b(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),N.prototype.c.call(this,n)}}class je{static{o(this,"AsyncUnzlib")}ondata;ondrain;queuedSize;constructor(t,n){bt([ht,He,()=>[_,N,qt]],this,st.call(this,t,n),i=>{const r=new qt(i.data);onmessage=_(r)},11,0)}terminate}function Ve(e,t,n){return n||(n=t,t={}),typeof n!="function"&&b(7),yt(e,t,[ht,He,()=>[Lt]],i=>et(Lt(i.data[0],Jt(i.data[1]))),5,n)}o(Ve,"unzlib");function Lt(e,t){return xt(e.subarray(ee(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}o(Lt,"unzlibSync");class ce{static{o(this,"Decompress")}G;I;Z;o;s;p;ondata;constructor(t,n){this.o=st.call(this,t,n)||{},this.G=Bt,this.I=N,this.Z=qt}i(){this.s.ondata=(t,n)=>{this.ondata(t,n)}}push(t,n){if(this.ondata||b(5),this.s)this.s.push(t,n);else{if(this.p&&this.p.length){const i=new S(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length)}else this.p=t;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,n),this.p=null)}}}class pn{static{o(this,"AsyncDecompress")}G;I;Z;ondata;ondrain;queuedSize;constructor(t,n){ce.call(this,t,n),this.queuedSize=0,this.G=Pe,this.I=se,this.Z=je}i(){this.s.ondata=(t,n,i)=>{this.ondata(t,n,i)},this.s.ondrain=t=>{this.queuedSize-=t,this.ondrain&&this.ondrain(t)}}push(t,n){this.queuedSize+=t.length,ce.prototype.push.call(this,t,n)}}function fn(e,t,n){return n||(n=t,t={}),typeof n!="function"&&b(7),e[0]==31&&e[1]==139&&e[2]==8?We(e,t,n):(e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31?ae(e,t,n):Ve(e,t,n)}o(fn,"decompress");function un(e,t){return e[0]==31&&e[1]==139&&e[2]==8?Rt(e,t):(e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31?At(e,t):Lt(e,t)}o(un,"decompressSync");async function hn(e,t={hiddenFiles:!1}){const n=t?.hiddenFiles;return await Array.from(e).reduce(async(r,s)=>{const a=await r;return s.webkitRelativePath.split("/").pop()?.startsWith(".")&&!n||(a[s.webkitRelativePath]=new Uint8Array(await s.arrayBuffer())),a},Promise.resolve({}))}o(hn,"createZippable");const ne=o((e,t,n,i)=>{for(const r in e){let s=e[r],a=t+r,c=i;Array.isArray(s)&&(c=St(i,s[1]),s=s[0]),s instanceof S?n[a]=[s,c]:(n[a+="/"]=[new S(0),c],ne(s,a,n,i))}},"fltn"),Ze=typeof TextEncoder<"u"&&new TextEncoder,ie=typeof TextDecoder<"u"&&new TextDecoder;let Ie=0;try{ie.decode(tt,{stream:!0}),Ie=1}catch{}const De=o(e=>{for(let t="",n=0;;){let i=e[n++];const r=(i>127)+(i>223)+(i>239);if(n+r>e.length)return{s:t,r:Y(e,n-1)};r?r==3?(i=((i&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|i>>10,56320|i&1023)):r&1?t+=String.fromCharCode((i&31)<<6|e[n++]&63):t+=String.fromCharCode((i&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(i)}},"dutf8");class mn{static{o(this,"DecodeUTF8")}p;t;constructor(t){this.ondata=t,Ie?this.t=new TextDecoder:this.p=tt}push(t,n){if(this.ondata||b(5),n=!!n,this.t){this.ondata(this.t.decode(t,{stream:!0}),n),n&&(this.t.decode().length&&b(8),this.t=null);return}this.p||b(4);const i=new S(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length);const{s:r,r:s}=De(i);n?(s.length&&b(8),this.p=null):this.p=s,this.ondata(r,n)}ondata}class yn{static{o(this,"EncodeUTF8")}d;constructor(t){this.ondata=t}push(t,n){this.ondata||b(5),this.d&&b(4),this.ondata(it(t),this.d=n||!1)}ondata}function it(e,t){if(t){const a=new S(e.length);for(let c=0;c<e.length;++c)a[c]=e.charCodeAt(c);return a}if(Ze)return Ze.encode(e);const n=e.length;let i=new S(e.length+(e.length>>1)),r=0;const s=o(a=>{i[r++]=a},"w");for(let a=0;a<n;++a){if(r+5>i.length){const u=new S(r+8+(n-a<<1));u.set(i),i=u}let c=e.charCodeAt(a);c<128||t?s(c):c<2048?(s(192|c>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++a)&1023,s(240|c>>18),s(128|c>>12&63),s(128|c>>6&63),s(128|c&63)):(s(224|c>>12),s(128|c>>6&63),s(128|c&63))}return Y(i,0,r)}o(it,"strToU8");function pe(e,t){if(t){let n="";for(let i=0;i<e.length;i+=16384)n+=String.fromCharCode.apply(null,e.subarray(i,i+16384));return n}else{if(ie)return ie.decode(e);{const{s:n,r:i}=De(e);return i.length&&b(8),n}}}o(pe,"strFromU8");const Te=o(e=>e==1?3:e<6?2:e==9?1:0,"dbf"),Ge=o((e,t)=>t+30+L(e,t+26)+L(e,t+28),"slzh"),Me=o((e,t,n)=>{const i=L(e,t+28),r=pe(e.subarray(t+46,t+46+i),!(L(e,t+8)&2048)),s=t+46+i,a=M(e,t+20),[c,u,f]=n&&a==4294967295?Ee(e,s):[a,M(e,t+24),M(e,t+42)];return[L(e,t+10),c,u,r,s+L(e,t+30)+L(e,t+32),f]},"zh"),Ee=o((e,t)=>{for(;L(e,t)!=1;t+=4+L(e,t+2));return[Kt(e,t+12),Kt(e,t+4),Kt(e,t+20)]},"z64e"),nt=o(e=>{let t=0;if(e)for(const n in e){const i=e[n].length;i>65535&&b(9),t+=i+4}return t},"exfl"),dt=o((e,t,n,i,r,s,a,c)=>{const u=i.length,f=n.extra,l=c&&c.length;let p=nt(f);v(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(s<0&&8),e[t++]=r&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;const m=new Date(n.mtime==null?Date.now():n.mtime),h=m.getFullYear()-1980;if((h<0||h>119)&&b(10),v(e,t,h<<25|m.getMonth()+1<<21|m.getDate()<<16|m.getHours()<<11|m.getMinutes()<<5|m.getSeconds()>>1),t+=4,s!=-1&&(v(e,t,n.crc),v(e,t+4,s<0?-s-2:s),v(e,t+8,n.size)),v(e,t+12,u),v(e,t+14,p),t+=16,a!=null&&(v(e,t,l),v(e,t+6,n.attrs),v(e,t+10,a),t+=14),e.set(i,t),t+=u,p)for(const y in f){const d=f[y],x=d.length;v(e,t,+y),v(e,t+2,x),e.set(d,t+4),t+=4+x}return l&&(e.set(c,t),t+=l),t},"wzh"),re=o((e,t,n,i,r)=>{v(e,t,101010256),v(e,t+8,n),v(e,t+10,n),v(e,t+12,i),v(e,t+16,r)},"wzf");class Ot{static{o(this,"ZipPassThrough")}filename;crc;size;compression;os;attrs;comment;extra;mtime;ondata;c;constructor(t){this.filename=t,this.c=ut(),this.size=0,this.compression=0}process(t,n){this.ondata(null,t,n)}push(t,n){this.ondata||b(5),this.c.p(t),this.size+=t.length,n&&(this.crc=this.c.d()),this.process(t,n||!1)}}class bn{static{o(this,"ZipDeflate")}filename;crc;size;compression;flag;os;attrs;comment;extra;mtime;ondata;d;constructor(t,n){n||(n={}),Ot.call(this,t),this.d=new J(n,(i,r)=>{this.ondata(null,i,r)}),this.compression=8,this.flag=Te(n.level)}process(t,n){try{this.d.push(t,n)}catch(i){this.ondata(i,null,n)}}push(t,n){Ot.prototype.push.call(this,t,n)}}class dn{static{o(this,"AsyncZipDeflate")}filename;crc;size;compression;flag;os;attrs;comment;extra;mtime;ondata;d;terminate;constructor(t,n){n||(n={}),Ot.call(this,t),this.d=new Re(n,(i,r,s)=>{this.ondata(i,r,s)}),this.compression=8,this.flag=Te(n.level),this.terminate=this.d.terminate}process(t,n){this.d.push(t,n)}push(t,n){Ot.prototype.push.call(this,t,n)}}class An{static{o(this,"Zip")}u;d;constructor(t){this.ondata=t,this.u=[],this.d=1}add(t){if(this.ondata||b(5),this.d&2)this.ondata(b(4+(this.d&1)*8,0,1),null,!1);else{const n=it(t.filename),i=n.length,r=t.comment,s=r&&it(r),a=i!=t.filename.length||s&&r.length!=s.length,c=i+nt(t.extra)+30;i>65535&&this.ondata(b(11,0,1),null,!1);const u=new S(c);dt(u,0,t,n,a,-1);let f=[u];const l=o(()=>{for(const d of f)this.ondata(null,d,!1);f=[]},"pAll");let p=this.d;this.d=0;const m=this.u.length,h=St(t,{f:n,u:a,o:s,t:o(()=>{t.terminate&&t.terminate()},"t"),r:o(()=>{if(l(),p){const d=this.u[m+1];d?d.r():this.d=1}p=1},"r")});let y=0;t.ondata=(d,x,g)=>{if(d)this.ondata(d,x,g),this.terminate();else if(y+=x.length,f.push(x),g){const A=new S(16);v(A,0,134695760),v(A,4,t.crc),v(A,8,y),v(A,12,t.size),f.push(A),h.c=y,h.b=c+y+16,h.crc=t.crc,h.size=t.size,p&&h.r(),p=1}else p&&l()},this.u.push(h)}}end(){if(this.d&2){this.ondata(b(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:o(()=>{this.d&1&&(this.u.splice(-1,1),this.e())},"r"),t:o(()=>{},"t")}),this.d=3}e(){let t=0,n=0,i=0;for(const s of this.u)i+=46+s.f.length+nt(s.extra)+(s.o?s.o.length:0);const r=new S(i+22);for(const s of this.u)dt(r,t,s,s.f,s.u,-s.c-2,n,s.o),t+=46+s.f.length+nt(s.extra)+(s.o?s.o.length:0),n+=s.b;re(r,t,this.u.length,i,n),this.ondata(null,r,!0),this.d=2}terminate(){for(const t of this.u)t.t();this.d=2}ondata}function gn(e,t,n){n||(n=t,t={}),typeof n!="function"&&b(7);const i={};ne(e,"",i,t);const r=Object.keys(i);let s=r.length,a=0,c=0;const u=s,f=new Array(s),l=[],p=o(()=>{for(let y=0;y<l.length;++y)l[y]()},"tAll");let m=o((y,d)=>{Gt(()=>{n(y,d)})},"cbd");Gt(()=>{m=n});const h=o(()=>{const y=new S(c+22),d=a,x=c-a;c=0;for(let g=0;g<u;++g){const A=f[g];try{const O=A.c.length;dt(y,c,A,A.f,A.u,O);const w=30+A.f.length+nt(A.extra),z=c+w;y.set(A.c,z),dt(y,a,A,A.f,A.u,O,c,A.m),a+=16+w+(A.m?A.m.length:0),c=z+O}catch(O){return m(O,null)}}re(y,a,f.length,x,d),m(null,y)},"cbf");s||h();for(let y=0;y<u;++y){const d=r[y],[x,g]=i[d],A=ut(),O=x.length;A.p(x);const w=it(d),z=w.length,U=g.comment,k=U&&it(U),I=k&&k.length,F=nt(g.extra),H=g.level==0?0:8,T=o((D,G)=>{if(D)p(),m(D,null);else{const Z=G.length;f[y]=St(g,{size:O,crc:A.d(),c:G,f:w,m:k,u:z!=d.length||k&&U.length!=I,compression:H}),a+=30+z+F+Z,c+=76+2*(z+F)+(I||0)+Z,--s||h()}},"cbl");if(z>65535&&T(b(11,0,1),null),!H)T(null,x);else if(O<16e4)try{T(null,wt(x,g))}catch(D){T(D,null)}else l.push(qe(x,g,T))}return p}o(gn,"zip");function Un(e,t){t||(t={});const n={},i=[];ne(e,"",n,t);let r=0,s=0;for(const f in n){const[l,p]=n[f],m=p.level==0?0:8,h=it(f),y=h.length,d=p.comment,x=d&&it(d),g=x&&x.length,A=nt(p.extra);y>65535&&b(11);const O=m?wt(l,p):l,w=O.length,z=ut();z.p(l),i.push(St(p,{size:l.length,crc:z.d(),c:O,f:h,m:x,u:y!=f.length||x&&d.length!=g,o:r,compression:m})),r+=30+y+A+w,s+=76+2*(y+A)+(g||0)+w}const a=new S(s+22),c=r,u=s-r;for(let f=0;f<i.length;++f){const l=i[f];dt(a,l.o,l,l.f,l.u,l.c.length);const p=30+l.f.length+nt(l.extra);a.set(l.c,l.o+p),dt(a,r,l,l.f,l.u,l.c.length,l.o,l.m),r+=16+p+(l.m?l.m.length:0)}return re(a,r,i.length,u,c),a}o(Un,"zipSync");class Ye{static{o(this,"UnzipPassThrough")}static compression=0;ondata;push(t,n){this.ondata(null,t,n)}}class Fn{static{o(this,"UnzipInflate")}static compression=8;i;ondata;constructor(){this.i=new N((t,n)=>{this.ondata(null,t,n)})}push(t,n){try{this.i.push(t,n)}catch(i){this.ondata(i,null,n)}}}class zn{static{o(this,"AsyncUnzipInflate")}static compression=8;i;ondata;terminate;constructor(t,n){n<32e4?this.i=new N((i,r)=>{this.ondata(null,i,r)}):(this.i=new se((i,r,s)=>{this.ondata(i,r,s)}),this.terminate=this.i.terminate)}push(t,n){this.i.terminate&&(t=Y(t,0)),this.i.push(t,n)}}class xn{static{o(this,"Unzip")}d;c;p;k;o;constructor(t){this.onfile=t,this.k=[],this.o={0:Ye},this.p=tt}push(t,n){if(this.onfile||b(5),this.p||b(4),this.c>0){const i=Math.min(this.c,t.length),r=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(r,!this.c):this.k[0].push(r),t=t.subarray(i),t.length)return this.push(t,n)}else{let i=0,r=0,s,a;this.p.length?t.length?(a=new S(this.p.length+t.length),a.set(this.p),a.set(t,this.p.length)):a=this.p:a=t;const c=a.length,u=this.c,f=u&&this.d;for(;r<c-4;++r){const l=M(a,r);if(l==67324752){i=1,s=r,this.d=null,this.c=0;const p=L(a,r+6),m=L(a,r+8),h=p&2048,y=p&8,d=L(a,r+26),x=L(a,r+28);if(c>r+30+d+x){const g=[];this.k.unshift(g),i=2;let A=M(a,r+18),O=M(a,r+22);const w=pe(a.subarray(r+30,r+=30+d),!h);A==4294967295?[A,O]=y?[-2]:Ee(a,r):y&&(A=-1),r+=x,this.c=A;let z;const U={name:w,compression:m,start:o(()=>{if(U.ondata||b(5),!A)U.ondata(null,tt,!0);else{const k=this.o[m];k||U.ondata(b(14,"unknown compression type "+m,1),null,!1),z=A<0?new k(w):new k(w,A,O),z.ondata=(I,F,H)=>{U.ondata(I,F,H)};for(const I of g)z.push(I,!1);this.k[0]==g&&this.c?this.d=z:z.push(tt,!0)}},"start"),terminate:o(()=>{z&&z.terminate&&z.terminate()},"terminate")};A>=0&&(U.size=A,U.originalSize=O),this.onfile(U)}break}else if(u){if(l==134695760){s=r+=12+(u==-2&&8),i=3,this.c=0;break}else if(l==33639248){s=r-=4,i=3,this.c=0;break}}}if(this.p=tt,u<0){const l=i?a.subarray(0,s-12-(u==-2&&8)-(M(a,s-16)==134695760&&4)):a.subarray(0,r);f?f.push(l,!!i):this.k[+(i==2)].push(l)}if(i&2)return this.push(a.subarray(r),n);this.p=a.subarray(r)}n&&(this.c&&b(13),this.p=null)}register(t){this.o[t.compression]=t}onfile}const Gt=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:e=>{e()};function Sn(e,t,n){n||(n=t,t={}),typeof n!="function"&&b(7);const i=[],r=o(()=>{for(let f=0;f<i.length;++f)i[f]()},"tAll"),s={};let a=o((f,l)=>{Gt(()=>{n(f,l)})},"cbd");Gt(()=>{a=n});let c=e.length-22;for(;M(e,c)!=101010256;--c)if(!c||e.length-c>65558)return a(b(13,0,1),null),r;let u=L(e,c+8);if(u){let f=u,l=M(e,c+16),p=l==4294967295||f==65535;if(p){let h=M(e,c-12);p=M(e,h)==101075792,p&&(f=u=M(e,h+32),l=M(e,h+48))}const m=t&&t.filter;for(let h=0;h<f;++h){const[y,d,x,g,A,O]=Me(e,l,p),w=Ge(e,O);l=A;const z=o((U,k)=>{U?(r(),a(U,null)):(k&&(s[g]=k),--u||a(null,s))},"cbl");if(!m||m({name:g,size:d,originalSize:x,compression:y}))if(!y)z(null,Y(e,w,w+d));else if(y==8){const U=e.subarray(w,w+d);if(x<524288||d>.8*x)try{z(null,At(U,{out:new S(x)}))}catch(k){z(k,null)}else i.push(ae(U,{size:x},z))}else z(b(14,"unknown compression type "+y,1),null);else z(null,null)}}else a(null,{});return r}o(Sn,"unzip");function wn(e,t){const n={};let i=e.length-22;for(;M(e,i)!=101010256;--i)(!i||e.length-i>65558)&&b(13);let r=L(e,i+8);if(!r)return{};let s=M(e,i+16),a=s==4294967295||r==65535;if(a){let u=M(e,i-12);a=M(e,u)==101075792,a&&(r=M(e,u+32),s=M(e,u+48))}const c=t&&t.filter;for(let u=0;u<r;++u){const[f,l,p,m,h,y]=Me(e,s,a),d=Ge(e,y);s=h,(!c||c({name:m,size:l,originalSize:p,compression:f}))&&(f?f==8?n[m]=At(e.subarray(d,d+l),{out:new S(p)}):b(14,"unknown compression type "+f):n[m]=Y(e,d,d+l))}return n}o(wn,"unzipSync");
//# sourceMappingURL=index.min.cjs.map