@zip.js/zip.js 2.8.57 → 2.8.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deno.json +1 -1
- package/dist/zip-core-external.js +303 -163
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +303 -163
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +327 -164
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +344 -157
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +327 -164
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +329 -165
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +330 -166
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +305 -165
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +305 -165
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +306 -166
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +329 -165
- package/index-native.min.js +1 -1
- package/index.cjs +330 -166
- package/index.d.cts +113 -9
- package/index.d.ts +113 -9
- package/index.min.js +1 -1
- package/lib/core/constants.js +2 -0
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-fs.js +27 -1
- package/lib/core/zip-reader.js +26 -6
- package/lib/core/zip-writer.js +278 -156
- package/lib/core/zlib-streams-inline.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=4294967295,e=65535,r=255,n=67324752,a=134695760,s=a,o=84233040,i=33639248,c=101010256,l=101075792,u=117853008,d=22,f=20,w=56,h=39169,p=21589,m=6534,y=30837,b=30805,E=2048,S=61440,g=16384,x=2048,A=1024,z="/",R=30,F=new Date(2107,11,31,23,59,58),D=new Date(1980,0,1),O=void 0,U=1/0,T="undefined",k="function",v="object",I="string",C=new Uint8Array,M="password",N="rawPassword",j="passThrough",P="signal",_="useWebWorkers",W="useCompressionStream",L="transferStreams",B="preventClose",V="dataDescriptor",Z="offset",H="usdz",q="signCentralDirectory",K="filename",Y="comment",G="strict",X="balanced",J="tolerant",Q="Invalid option (must be a function)",$="Invalid signal (must be an AbortSignal instance)",tt="Invalid password (password must be a string, rawPassword must be a Uint8Array)";function et(t){if(t&&typeof t!=k)throw Error(Q);return t}function rt(t){if(t&&(typeof t.addEventListener!=k||"boolean"!=typeof t.aborted))throw Error($);return t||O}function nt(t,e){if(t&&typeof t!=I||e&&!(e instanceof Uint8Array))throw Error(tt)}function at(t,e,r){if(!Number.isInteger(t)||t<0||t>e)throw Error(r)}function st(t,e,r){t!==O&&at(t,e,r)}function ot(t){return typeof t==I&&t.trim()?Number(t):t}const it="Invalid maxWorkers (must be an integer greater than 0)";let ct=2;try{typeof navigator!=T&&navigator.hardwareConcurrency&&(ct=navigator.hardwareConcurrency)}catch{}const lt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:ct,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=T&&CompressionStream,DecompressionStream:typeof DecompressionStream!=T&&DecompressionStream},ut="maxWorkers",dt=["chunkSize",ut,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],ft=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],wt=["baseURI","wasmURI","workerURI","useCompressionStream","useWebWorkers","transferStreams",...dt,...ft],ht={...lt};function pt(){return ht}function mt(t){return yt(t.chunkSize)}function yt(t){return t=ot(t),Number.isInteger(t)&&t>=1?Math.max(t,64):65536}function bt(t){Object.assign(ht,Et(gt(t)))}function Et(t){const e={};for(const r of wt){const n=t[r];n!==O&&(e[r]=St(r,n))}return e}function St(t,e){if(dt.includes(t)){if(e=ot(e),t==ut&&(!Number.isInteger(e)||e<1))throw Error(it)}else ft.includes(t)&&et(e);return e}function gt(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===O&&r===O)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===O&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===O&&(n.DecompressionStreamFallback=r),n}function xt(t){const e=Et(gt(t));Object.assign(lt,e),Object.assign(ht,e)}function At(){for(const t of wt)delete ht[t];Object.assign(ht,lt)}function zt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function Rt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function Ft(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const Dt=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?e>>>1^3988292384:e>>>1;Dt[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const r=Dt[e-1][t];Dt[e][t]=r>>>8^Dt[0][255&r]}const[Ot,Ut,Tt,kt,vt,It,Ct,Mt]=Dt;class Nt{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const r=0|t.length;let n=0;if(r>=8&&t.buffer){const a=new DataView(t.buffer,t.byteOffset,r),s=r-8;for(;n<=s;n+=8){const t=e^a.getInt32(n,!0),r=a.getInt32(n+4,!0);e=Mt[255&t]^Ct[t>>>8&255]^It[t>>>16&255]^vt[t>>>24&255]^kt[255&r]^Tt[r>>>8&255]^Ut[r>>>16&255]^Ot[r>>>24&255]}}for(;n<r;n++)e=e>>>8^Ot[255&(e^t[n])];this.o=e}get(){return~this.o}}class jt extends TransformStream{constructor(){let t;const e=new Nt;super({transform(t,r){e.append(t),r.enqueue(t)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function Pt(t){if(typeof TextEncoder==T){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return e}return(new TextEncoder).encode(t)}const _t={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=_t.l(r);return 32===n?t.concat(e):_t.h(e,n,0|r,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+_t.l(r)},m(t,e){if(32*t.length<e)return t;const r=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,r>0&&e&&(t[r-1]=_t.S(e,t[r-1]&2147483648>>e-1,1)),t},S:(t,e,r)=>32===t?e:(r?0|e:e<<32-t)+1099511627776*t,l:t=>Math.round(t/1099511627776)||32,h(t,e,r,n){for(void 0===n&&(n=[]);e>=32;e-=32)n.push(r),r=0;if(0===e)return n.concat(t);for(let a=0;a<t.length;a++)n.push(r|t[a]>>>e),r=t[a]<<32-e;const a=t.length?t[t.length-1]:0,s=_t.l(a);return n.push(_t.S(e+s&31,e+s>32?r:n.pop(),1)),n}},Wt={bytes:{A(t){const e=_t.bitLength(t)/8,r=new Uint8Array(e);let n;for(let a=0;a<e;a++)3&a||(n=t[a/4]),r[a]=n>>>24,n<<=8;return r},R(t){const e=[];let r,n=0;for(r=0;r<t.length;r++)n=n<<8|t[r],3&~r||(e.push(n),n=0);return 3&r&&e.push(_t.S(8*(3&r),n)),e}}},Lt=class{constructor(t){const e=this;e.blockSize=512,e.F=[1732584193,4023233417,2562383102,271733878,3285377520],e.D=[1518500249,1859775393,2400959708,3395469782],t?(e.O=t.O.slice(0),e.U=t.U.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.O=t.F.slice(0),t.U=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=Wt.v.R(t));const r=e.U=_t.concat(e.U,t),n=e.T,a=e.T=n+_t.bitLength(t);if(a>9007199254740991)throw Error("Cannot hash more than 2^53 - 1 bits");const s=new Uint32Array(r);let o=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);t<=a;t+=e.blockSize)e.I(s.subarray(16*o,16*(o+1))),o+=1;return r.splice(0,16*o),e}C(){const t=this;let e=t.U;const r=t.O;e=_t.concat(e,[_t.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(t.T/4294967296)),e.push(0|t.T);e.length;)t.I(e.splice(0,16));return t.reset(),r}M(t,e,r,n){return t<=19?e&r|~e&n:t<=39?e^r^n:t<=59?e&r|e&n|r&n:t<=79?e^r^n:void 0}N(t,e){return e<<t|e>>>32-t}I(t){const e=this,r=e.O,n=Array(80);for(let e=0;e<16;e++)n[e]=t[e];let a=r[0],s=r[1],o=r[2],i=r[3],c=r[4];for(let t=0;t<=79;t++){t>=16&&(n[t]=e.N(1,n[t-3]^n[t-8]^n[t-14]^n[t-16]));const r=e.N(5,a)+e.M(t,s,o,i)+c+n[t]+e.D[Math.floor(t/20)]|0;c=i,i=o,o=e.N(30,s),s=a,a=r}r[0]=r[0]+a|0,r[1]=r[1]+s|0,r[2]=r[2]+o|0,r[3]=r[3]+i|0,r[4]=r[4]+c|0}},Bt={importKey:t=>new Bt.j(Wt.bytes.R(t)),P(t,e,r,n){if(r=r||1e4,n<0||r<0)throw Error("invalid params to pbkdf2");const a=1+(n>>5)<<2;let s,o,i,c,l;const u=new ArrayBuffer(a),d=new DataView(u);let f=0;const w=_t;for(e=Wt.bytes.R(e),l=1;f<(a||1);l++){for(s=o=t.encrypt(w.concat(e,[l])),i=1;i<r;i++)for(o=t.encrypt(o),c=0;c<o.length;c++)s[c]^=o[c];for(i=0;f<(a||1)&&i<s.length;i++)d.setInt32(f,s[i]),f+=4}return u.slice(0,n/8)},j:class{constructor(t){const e=this,r=e._=Lt,n=[[],[]];e.W=[new r,new r];const a=e.W[0].blockSize/32;t.length>a&&(t=(new r).update(t).C());for(let e=0;e<a;e++)n[0][e]=909522486^t[e],n[1][e]=1549556828^t[e];e.W[0].update(n[0]),e.W[1].update(n[1]),e.L=new r(e.W[0])}reset(){const t=this;t.L=new t._(t.W[0]),t.B=!1}update(t){this.B=!0,this.L.update(t)}digest(){const t=this,e=t.L.C(),r=new t._(t.W[1]).update(e).C();return t.reset(),r}encrypt(t){if(this.B)throw Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},Vt=typeof crypto!=T&&typeof crypto.getRandomValues==k,Zt="Invalid password",Ht="Invalid signature",qt=Ht,Kt="zipjs-abort-check-password",Yt="Crypto API not supported";function Gt(t){if(Vt)return crypto.getRandomValues(t);throw Error(Yt)}const Xt=16,Jt={name:"PBKDF2"},Qt=Object.assign({hash:{name:"HMAC"}},Jt),$t=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Jt),te=["deriveBits"],ee=[8,12,16],re=[16,24,32],ne=10,ae=[0,0,0,0],se=typeof crypto!=T,oe=se&&crypto.subtle,ie=se&&typeof oe!=T,ce=Wt.bytes,le=class{constructor(t){const e=this;e.V=[[[],[],[],[],[]],[[],[],[],[],[]]],e.V[0][0][0]||e.Z();const r=e.V[0][4],n=e.V[1],a=t.length;let s,o,i,c=1;if(4!==a&&6!==a&&8!==a)throw Error("invalid aes key size");for(e.D=[o=t.slice(0),i=[]],s=a;s<4*a+28;s++){let t=o[s-1];(s%a===0||8===a&&s%a===4)&&(t=r[t>>>24]<<24^r[t>>16&255]<<16^r[t>>8&255]<<8^r[255&t],s%a===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),o[s]=o[s-a]^t}for(let t=0;s;t++,s--){const e=o[3&t?s:s-4];i[t]=s<=4||t<4?e:n[0][r[e>>>24]]^n[1][r[e>>16&255]]^n[2][r[e>>8&255]]^n[3][r[255&e]]}}encrypt(t){return this.H(t,0)}decrypt(t){return this.H(t,1)}Z(){const t=this.V[0],e=this.V[1],r=t[4],n=e[4],a=[],s=[];let o,i,c,l;for(let t=0;t<256;t++)s[(a[t]=t<<1^283*(t>>7))^t]=t;for(let u=o=0;!r[u];u^=i||1,o=s[o]||1){let s=o^o<<1^o<<2^o<<3^o<<4;s=s>>8^255&s^99,r[u]=s,n[s]=u,l=a[c=a[i=a[u]]];let d=16843009*l^65537*c^257*i^16843008*u,f=257*a[s]^16843008*s;for(let r=0;r<4;r++)t[r][u]=f=f<<24^f>>>8,e[r][s]=d=d<<24^d>>>8}for(let r=0;r<5;r++)t[r]=t[r].slice(0),e[r]=e[r].slice(0)}H(t,e){if(4!==t.length)throw Error("invalid aes block size");const r=this.D[e],n=r.length/4-2,a=[0,0,0,0],s=this.V[e],o=s[0],i=s[1],c=s[2],l=s[3],u=s[4];let d,f,w,h=t[0]^r[0],p=t[e?3:1]^r[1],m=t[2]^r[2],y=t[e?1:3]^r[3],b=4;for(let t=0;t<n;t++)d=o[h>>>24]^i[p>>16&255]^c[m>>8&255]^l[255&y]^r[b],f=o[p>>>24]^i[m>>16&255]^c[y>>8&255]^l[255&h]^r[b+1],w=o[m>>>24]^i[y>>16&255]^c[h>>8&255]^l[255&p]^r[b+2],y=o[y>>>24]^i[h>>16&255]^c[p>>8&255]^l[255&m]^r[b+3],b+=4,h=d,p=f,m=w;for(let t=0;t<4;t++)a[e?3&-t:t]=u[h>>>24]<<24^u[p>>16&255]<<16^u[m>>8&255]<<8^u[255&y]^r[b++],d=h,h=p,p=m,m=y,y=d;return a}},ue=class{constructor(t,e){this.K=t,this.Y=e,this.G=e}reset(){this.G=this.Y}update(t){return this.X(this.K,t,this.G)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,r){let n;if(!(n=e.length))return[];const a=_t.bitLength(e);for(let a=0;a<n;a+=4){this.$(r);const n=t.encrypt(r);e[a]^=n[0],e[a+1]^=n[1],e[a+2]^=n[2],e[a+3]^=n[3]}return _t.m(e,a)}},de=Bt.j;let fe=se&&ie&&typeof oe.importKey==k,we=se&&ie&&typeof oe.deriveBits==k;class he extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:a=!0}){super({start(){me(this,t,e,r)},async transform(t,e){const r=this,{password:a,strength:s,et:o,ready:i}=r;a?(await(async(t,e,r,n)=>{const a=await be(t,e,r,Se(n,0,ee[e])),s=Se(n,ee[e]);if(a[0]!=s[0]||a[1]!=s[1])throw Error(Zt)})(r,s,a,Se(t,0,ee[s]+2)),t=Se(t,ee[s]+2),n?e.error(Error(Kt)):o()):await i;const c=new Uint8Array(t.length-ne-(t.length-ne)%Xt);e.enqueue(ye(r,t,c,0,ne,!0))},async flush(t){const{nt:e,st:r,ot:n,ready:s}=this;if(r&&e){await s;const o=Se(n,0,n.length-ne),i=Se(n,n.length-ne);let c=C;if(o.length){const t=xe(ce,o);r.update(t);const n=e.update(t);c=ge(ce,n)}const l=Se(ge(ce,r.digest()),0,ne);let u=n.length<ne?1:0;for(let t=0;t<ne;t++)u|=l[t]^i[t];if(u&&a)throw Error(qt);t.enqueue(c)}}})}}class pe extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){me(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:a,et:s,ready:o}=r;let i=C;n?(i=await(async(t,e,r)=>{const n=Gt(new Uint8Array(ee[e]));return zt(n,await be(t,e,r,n))})(r,a,n),s()):await o;const c=new Uint8Array(i.length+t.length-t.length%Xt);c.set(i,0),e.enqueue(ye(r,t,c,i.length,0))},async flush(t){const{nt:e,st:r,ot:n,ready:a}=this;if(r&&e){await a;let s=C;if(n.length){const t=e.update(xe(ce,n));r.update(t),s=ge(ce,t)}const o=ge(ce,r.digest()).slice(0,ne);t.enqueue(zt(s,o))}}})}}function me(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.et=e),password:Ee(e,r),strength:n-1,ot:C})}function ye(t,e,r,n,a,s){const{nt:o,st:i,ot:c}=t;c.length&&(e=zt(c,e));const l=e.length-a;let u;for(r=((t,e)=>{if(e&&e>t.length){const r=t;(t=new Uint8Array(e)).set(r,0)}return t})(r,n+(l-l%Xt)),u=0;u<=l-Xt;u+=Xt){const t=xe(ce,Se(e,u,u+Xt));s&&i.update(t);const a=o.update(t);s||i.update(a),r.set(ge(ce,a),u+n)}return t.ot=Se(e,u),r}async function be(t,e,r,n){t.password=null;const a=await(async(t,e,r,n,a)=>{if(!fe)return Bt.importKey(e);try{return await oe.importKey("raw",e,r,!1,a)}catch{return fe=!1,Bt.importKey(e)}})(0,r,Qt,0,te),s=await(async(t,e,r)=>{if(!we)return Bt.P(e,t.salt,$t.iterations,r);try{return await oe.deriveBits(t,e,r)}catch{return we=!1,Bt.P(e,t.salt,$t.iterations,r)}})(Object.assign({salt:n},$t),a,8*(2*re[e]+2)),o=new Uint8Array(s),i=xe(ce,Se(o,0,re[e])),c=xe(ce,Se(o,re[e],2*re[e])),l=Se(o,2*re[e]);return Object.assign(t,{keys:{key:i,it:c,passwordVerification:l},nt:new ue(new le(i),Array.from(ae)),st:new de(c)}),l}function Ee(t,e){return e===O?Pt(t):e}function Se(t,e,r){return t.subarray(e,r)}function ge(t,e){return t.A(e)}function xe(t,e){return t.R(e)}class Ae extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){Re(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=Fe(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw Error(Zt);t=t.subarray(12)}n?e.error(Error(Kt)):e.enqueue(Fe(r,t))}})}}class ze extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){Re(this,t,e,r)},transform(t,e){const r=this;let n,a;if(r.password||r.rawPassword){r.password=r.rawPassword=null;const e=Gt(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(De(r,e),0),a=12}else n=new Uint8Array(t.length),a=0;n.set(De(r,t),a),e.enqueue(n)}})}}function Re(t,e,r,n){Object.assign(t,{password:e,rawPassword:r,passwordVerification:n}),((t,e,r)=>{const n=[305419896,591751049,878082192];if(Object.assign(t,{keys:n,ct:new Nt(n[0]),lt:new Nt(n[2])}),r)for(let e=0;e<r.length;e++)Oe(t,r[e]);else for(let r=0;r<e.length;r++)Oe(t,e.charCodeAt(r))})(t,e,r)}function Fe(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ue(t)^e[n],Oe(t,r[n]);return r}function De(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ue(t)^e[n],Oe(t,e[n]);return r}function Oe(t,e){let[,r]=t.keys;t.ct.append([e]);const n=~t.ct.get();r=ke(Math.imul(ke(r+Te(n)),134775813)+1),t.lt.append([r>>>24]);const a=~t.lt.get();t.keys=[n,r,a]}function Ue(t){const e=2|t.keys[2];return Te(Math.imul(e,1^e)>>>8)}function Te(t){return 255&t}function ke(t){return 4294967295&t}function ve(t){if(t instanceof ReadableStream)return t;const e=t.getReader();return new ReadableStream({async pull(t){const{value:r,done:n}=await e.read();n?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}function Ie(t,e){t=ve(t);const r=e?{type:e}:{};if(typeof Blob.prototype.stream!=k||new Blob([]).stream()instanceof ReadableStream)return new Response(t).blob().then(t=>e?new Blob([t],r):t);const n=[];return t.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,r))}function Ce(t){if(t instanceof WritableStream)return t;const e=t.getWriter();return new WritableStream({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const Me="Invalid codec definition",Ne="Reserved compression method",je="Invalid codec module",Pe=[0,8,9,99],_e=new Map,We=new Map;function Le(t={}){const{compressionMethod:r,format:n,codecURI:a,CompressionStream:s,DecompressionStream:o,versionNeeded:i}=t;if(!Number.isInteger(r)||r<0||r>e||typeof n!=I||!n.length)throw Error(Me);if(Pe.includes(r))throw Error(Ne);const c=typeof s==k||typeof o==k;if(!(c||typeof a==I&&a.length))throw Error(Me);_e.set(r,{compressionMethod:r,format:n,codecURI:a,versionNeeded:i}),c&&He(n,{CompressionStream:s,DecompressionStream:o})}function Be(t){const e=_e.get(t);if(e){let r;_e.delete(t),_e.forEach(t=>r=r||t.format==e.format),r||We.delete(e.format)}}function Ve(t){return _e.get(t)}function Ze(t){return We.get(t)}function He(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=k&&typeof n!=k)throw Error(je);We.set(t,{CompressionStream:r,DecompressionStream:n})}const qe="Invalid uncompressed size",Ke="Invalid compressed data",Ye=Ht,Ge="deflate-raw",Xe="gzip",Je=[31,139,8];class Qe extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:a,encrypted:s,useCompressionStream:o,zipCrypto:i,computeCrc32:c,level:l,deflate64:u,format:d,compressionMethod:f}=t,w=this;let h,p,m,y=super.readable;const b=d&&Ze(d),E=c&&a&&!u&&!b&&(!s||i)&&!(!o||!n);if(s&&!i||!c||E||(h=new jt,y=ir(y,h)),a)if(b)y=cr(y,sr(b.CompressionStream,d,{level:l,chunkSize:e,compressionMethod:f}));else if(E)m=new $e,y=cr(y,new n(Xe)),y=ir(y,m);else try{y=or(y,o,{level:l,chunkSize:e},n,r)}catch(t){let e;try{e=new n(Xe)}catch{throw t}y=cr(y,e),y=ir(y,new $e)}s&&(i?y=ir(y,new ze(t)):(p=new pe(t),y=ir(y,p))),ar(w,y,()=>{s&&!i||!c||(w.crc32=E?m.crc32:new DataView(h.value.buffer).getUint32(0))})}}class $e extends TransformStream{constructor(){let t,e=10,r=new Uint8Array(0);super({transform(t,n){if(e){const r=Math.min(e,t.length);if(e-=r,!(t=t.subarray(r)).length)return}const a=r.length+t.length;if(a<=8)return void(r=zt(r,t));const s=a-8,o=Math.min(s,r.length);n.enqueue(zt(r.subarray(0,o),t.subarray(0,s-o))),r=zt(r.subarray(o),t.subarray(s-o))},flush(){const e=Ft(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class tr extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:a,encrypted:s,checkCrc32:o,crc32:i,compressed:c,useCompressionStream:l,deflate64:u,format:d,compressionMethod:f,rawBitFlag:w,outputSize:h}=t;let p,m,y=super.readable;if(s&&(a?y=ir(y,new Ae(t)):(m=new he(t),y=ir(y,m))),c){const t=d&&Ze(d);if(t)y=cr(y,sr(t.DecompressionStream,d,{chunkSize:e,compressionMethod:f,rawBitFlag:w,uncompressedSize:h}));else try{y=or(y,l,{chunkSize:e,deflate64:u},n,r)}catch(t){if(u||h===O)throw t;let e;try{e=new n(Xe)}catch{throw t}y=((t,e,r)=>{const n=new Nt;let a,s,o,i=0,c=!1;const l=new Promise((t,e)=>{s=t,o=e});l.catch(()=>{}),r||s();const u=new TransformStream({start(t){const e=new Uint8Array(10);e.set(Je),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,f();try{await l}finally{w()}const e=new Uint8Array(8),a=Ft(e);a.setUint32(0,n.get(),!0),a.setUint32(4,r,!0),t.enqueue(e)},cancel(t){o(t)}}),d=new TransformStream({transform(t,e){n.append(t),i+=t.length,i>=r?s():c&&f(),e.enqueue(t)},cancel(t){o(t)}});return t=ir(t,u),ir(t=cr(t,e),d);function f(){w(),a=setTimeout(()=>o(Error(qe)),5e3)}function w(){clearTimeout(a)}})(y,e,h)}y=(t=>{const e=t.getReader();return new ReadableStream({async pull(t){let r;try{r=await e.read()}catch(t){if(t&&t.message)throw t;const e=Error(Ke);throw e.cause=t,e}const{value:n,done:a}=r;a?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})})(y)}o&&(p=new jt,y=ir(y,p)),ar(this,y,()=>{if(o){const t=new DataView(p.value.buffer);if(i!=t.getUint32(0,!1))throw Error(Ye)}})}}const er=new Map;function rr(t,e){if(!t)return!1;let r=er.get(t);r||(r=new Map,er.set(t,r));let n=r.get(e);if(n===O){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function nr(t){return rr(t,Ge)}function ar(t,e,r){e=ir(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function sr(t,e,r){if(!t)throw Error("Compression method not supported");return new t(e,r)}function or(t,e,r,n,a){const s=e&&n?n:a||n,o=r.deflate64?"deflate64-raw":Ge;let i;try{i=new s(o,r)}catch(t){if(!e||!a||s==a)throw t;i=new a(o,r)}return cr(t,i)}function ir(t,e){return ve(t).pipeThrough(e)}function cr(t,e){const r=e.writable.getWriter(),n=t.getReader();return(async()=>{try{for(;;){await r.ready;const t=await n.read();if(t.done){await r.close();break}await r.write(t.value)}}catch(t){await(async(t,e)=>{try{await t.abort(e)}catch{}})(r,t),await(async(t,e)=>{try{await t.cancel(e)}catch{}})(n,t)}})(),e.readable}const lr="data",ur="deflate",dr="inflate";class fr extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let a;n.startsWith(ur)?a=Qe:n.startsWith(dr)&&(a=tr),r.outputSize=0;let s=0;const o=new a(t,e),i=super.readable,c=new TransformStream({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){Object.assign(r,{inputSize:s})}}),l=new TransformStream({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==O&&r.outputSize>t.outputSize))throw Error(qe)},flush(){const{crc32:t}=o;Object.assign(r,{crc32:t,inputSize:s})}});Object.defineProperty(r,"readable",{get:()=>i.pipeThrough(c).pipeThrough(o).pipeThrough(l)})}}class wr extends TransformStream{constructor(t){const e=[];let r=0;function n(){const n=new Uint8Array(t);let a=0;for(;a<t;){const r=e[0],s=t-a;r.length<=s?(n.set(r,a),a+=r.length,e.shift()):(n.set(r.subarray(0,s),a),e[0]=r.subarray(s),a+=s)}return r-=t,n}(!Number.isFinite(t)||t<1)&&(t=65536),super({transform(a,s){for(e.push(a),r+=a.length;r>t;)s.enqueue(n())},flush(t){r&&t.enqueue(((t,e)=>{const r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r})(e,r))}})}}const hr="Worker startup timeout";let pr,mr,yr,br=()=>{};async function Er(t){const{CompressionStream:e,CompressionStreamFallback:r}=t;if(r&&!r.ut)return!0;if(nr(e)||rr(e,Xe))return!0;if(r)try{return await br(t),!0}catch{return!1}return!1}function Sr(t){t.createWorker?mr=!0:pr=!1}class gr{constructor(t,{readable:e,writable:r},{options:n,config:a,ft:s,useWebWorkers:o,transferStreams:i,workerURI:c,createWorker:l},u){const{signal:d}=s;return mr&&(l=O),Object.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new wr(mt(a))).pipeThrough(new xr(s),{signal:d}),writable:r,options:Object.assign({},n),workerURI:c,createWorker:l,transferStreams:i,terminate:()=>new Promise(e=>{const{yt:r,wt:n}=t;r?(n?t.bt=e:(r.terminate(),e()),t.Et=null):e()}),St(){if(t.wt){const{bt:e}=t;e&&(t.bt=null,t.gt=!0,t.yt.terminate(),e()),t.wt=!1,u(t)}}}),pr===O&&(pr=typeof Worker!=T),(o&&yr&&(pr&&c||l)?yr:zr)(t,a)}}class xr extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let a=0;super({async start(){t&&await Ar(t,r)},async transform(t,n){a+=t.length,e&&await Ar(e,a,r),n.enqueue(t)},async flush(){n&&await Ar(n,a)}})}}async function Ar(t,...e){try{await t(...e)}catch{}}function zr(t,e){return{run:()=>Rr(t,e)}}async function Rr({options:t,readable:e,writable:r,St:n},a){let s;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(ur),r=e?a.CompressionStreamFallback:a.DecompressionStreamFallback,n=e?a.CompressionStream:a.DecompressionStream;if(t.useCompressionStream){if(r&&r.ut&&!nr(n))try{await br(a)}catch{}}else try{await br(a)}catch{r&&!r.ut||(t.useCompressionStream=!0)}}s=new fr(t,a),await e.pipeThrough(s).pipeThrough(new wr(mt(a))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{crc32:n,inputSize:o,outputSize:i}=s;return{crc32:n,inputSize:o,outputSize:i}}catch(t){throw s&&(t.outputSize=s.outputSize),t}finally{n()}}const Fr={type:"module"},Dr="error";let Or,Ur,Tr,kr=!0;try{kr=typeof structuredClone==k&&structuredClone(new DOMException("","AbortError")).code!==O}catch{}var vr;function Ir(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Cr(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.Et=null}function Mr(t,e,r,n,a=!0){const{createWorker:s}=r;let o,i,c;if(s)o=s();else if(Ur===O||Or!==t){const s=typeof t==k;i=s?t(a):t;const l=i.startsWith("data:"),u=i.startsWith("blob:");if(l||u){n===O&&(n=!1),n&&(c=Fr);try{o=new Worker(i,c)}catch(a){if(u)try{URL.revokeObjectURL(i)}catch{}if(s&&u)return Mr(t,e,r,n,!1);if(n)throw a;return Mr(t,e,r,!0,!1)}}else{n===O&&(n=!0),n&&(c=Fr);try{i=new URL(i,e)}catch{}try{o=new Worker(i,c)}catch(s){if(n)return Mr(t,e,r,!1,a);throw s}}Or=t,Ur=i,Tr=c}else o=new Worker(Ur,Tr);return o.addEventListener("message",t=>{r.xt=!0,Nr(r),(async({data:t},e)=>{const{type:r,value:n,messageId:a,result:s,error:o}=t,{reader:i,writer:c,At:l,zt:u,St:d,ht:f}=e,w=()=>e.ht!=f;try{if(o){const{message:t,stack:e,code:r,name:n,outputSize:a,cause:s,codecImportFailed:i}=o,c=Error(t);Object.assign(c,{stack:e,code:r,name:n,outputSize:a}),s&&(c.cause=Object.assign(Error(s.message),{name:s.name})),i&&(c.codecImportFailed=!0),h(c)}else{if("pull"==r){const{value:t,done:r}=await i.read();w()||Pr({type:lr,value:t,done:r,messageId:a},e)}r==lr&&(await c.ready,await c.write(new Uint8Array(n)),w()||Pr({type:"ack",messageId:a},e)),"close"==r&&h(null,s)}}catch(o){w()||(Cr(e),h(o))}function h(t,e){w()||(t?u(t):l(e),c&&c.releaseLock(),t&&t.codecImportFailed||d())}})(t,r)}),o.addEventListener(Dr,t=>jr(t,r)),o.addEventListener("messageerror",t=>jr(t,r)),o}function Nr(t){const{Rt:e}=t;e&&(clearTimeout(e),t.Rt=null)}function jr(t,e){t.preventDefault&&t.preventDefault(),Nr(e);const{xt:r,zt:n,writer:a,St:s}=e;Cr(e),r||(e.yt=null);let o=t.error||Error(t.message||Dr);r||(o=Object.assign(Error(o.message||Dr),{Ft:!0}),e.Dt=o),n&&(n(o),a&&a.releaseLock(),r&&s())}function Pr(t,{yt:e,writer:r,transferStreams:n,xt:a}){try{const{value:r,readable:s,writable:o}=t,i=[];if(r&&(t.value=Rt(r),i.push(t.value.buffer)),n&&kr&&a?(s&&i.push(s),o&&i.push(o)):t.readable=t.writable=null,i.length)try{return e.postMessage(t,i),!0}catch{kr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}vr=(t,e)=>{const{baseURI:r,chunkSize:n,workerStartupTimeout:a}=e;let{wasmURI:s}=e;if(!t.Et){let o;typeof s==k&&(s=s());try{o=Mr(t.workerURI,r,t)}catch{return Sr(t),zr(t,e)}Object.assign(t,{yt:o,xt:!1,gt:!1,Dt:null,Et:{run:async()=>{try{return await(async(t,e)=>{if(!t.yt){const{Dt:e}=t;t.Dt=null;const r=e||Error(hr);throw r.Ft=!0,r}let r,n;const a=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,At:r,zt:n,result:a});const{readable:s,options:o}=t,{writable:i,closed:c,Ot:l}=(t=>{const e=new AbortController,{writable:r,readable:n}=new TransformStream,a=n.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return a.catch(()=>{}),{writable:r,closed:a,Ot:()=>e.abort()}})(t.writable);let u;try{u=Pr({type:"start",options:o,config:e,readable:s,writable:i},t)}catch(e){l();try{await c}catch{}throw t.St(),e}u||Object.assign(t,{reader:s.getReader(),writer:i.getWriter()});const{workerStartupTimeout:d}=e;!t.xt&&Number.isFinite(d)&&d>=0&&(t.Rt=setTimeout(()=>(t=>{if(t.Rt=null,t.xt)return;const{zt:e,writer:r}=t;if(Cr(t),t.yt=null,e){const t=Error(hr);t.Ft=!0,e(t),r&&r.releaseLock()}})(t),d));try{const t=await a;return await f(),await c,t}catch(t){await f(),l();try{await c}catch{}throw t}async function f(){if(!u&&!i.locked)try{await i.getWriter().close()}catch{}}})(t,{chunkSize:n,wasmURI:s,baseURI:r,workerStartupTimeout:a})}catch(r){if(r&&r.Ft)return Sr(t),Ir(t),Rr(t,e);if(r&&r.codecImportFailed){if(t.reader)return Ir(t),Rr(t,e);t.St()}throw r}}}})}return t.Et},yr=vr;let _r=[];const Wr=[];let Lr,Br,Vr=0;async function Zr(t,e){const{options:r,config:n}=e,{transferStreams:a,useWebWorkers:s,useCompressionStream:o,compressed:i,checkCrc32:c,computeCrc32:l,encrypted:u,format:d,codecURI:f}=r,{workerURI:w,createWorker:h,maxWorkers:p}=n;d&&(f&&(r.codecURI=((t,e)=>{try{return new URL(t,e).toString()}catch{return t}})(f,n.baseURI)),await(async(t,e)=>{!We.has(t)&&e&&He(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(d,r.codecURI)),e.transferStreams=!d&&(a||a===O&&n.transferStreams);const m=!(i||c||l||u),y=d===O||!!r.codecURI;return e.useWebWorkers=!m&&y&&(s||s===O&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:O,e.createWorker=e.useWebWorkers&&h?h:O,r.useCompressionStream=o||o===O&&n.useCompressionStream,(await(async()=>{const r=_r.find(t=>!t.wt);if(r)return Gr(r),new gr(r,t,e,b);if(_r.length<p){const r={Ut:Vr};return Vr++,_r.push(r),new gr(r,t,e,b)}return new Promise(r=>{Wr.push({resolve:r,stream:t,Tt:e}),Br=n.workerStarvationTimeout,Hr()})})()).run();function b(t){if(qr(),Wr.length){const[{resolve:e,stream:r,Tt:n}]=Wr.splice(0,1);e(new gr(t,r,n,b)),Hr()}else t.yt?(Gr(t),((t,e)=>{const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.gt?t.gt=!1:t.kt=setTimeout(async()=>{_r=_r.filter(e=>e!=t);try{await t.terminate()}catch{}},n))})(t,e)):_r=_r.filter(e=>e!=t)}}function Hr(){!Lr&&Wr.length&&Number.isFinite(Br)&&Br>=0&&(Lr=setTimeout(Kr,Br))}function qr(){Lr&&(clearTimeout(Lr),Lr=null)}function Kr(){if(Lr=null,Wr.length){const[{resolve:t,stream:e,Tt:r}]=Wr.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:O,createWorker:O});t(new gr({},e,n,Yr)),Hr()}}function Yr(){qr(),Hr()}function Gr(t){const{kt:e}=t;e&&(clearTimeout(e),t.kt=null)}const Xr="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function Jr(t,e){return Qr(t,e,!0)}function Qr(t,e,r){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let r=0;r<t.length;r++)e+=Xr[t[r]];return e}})(t):new TextDecoder(e,{ignoreBOM:r}).decode(t)}const $r="HTTP error ",tn="HTTP Range not supported",en="HTTP resource changed",rn="Writer iterator completed too soon",nn="Writer not initialized",an="Content-Range",sn="Range",on="GET",cn="bytes",ln=16777216,un="writable",dn=Symbol();class fn{constructor(){this.size=0}init(){this.initialized=!0}}class wn extends fn{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=mt(pt())}={}){const n=this;let a=0;return r=yt(r),new ReadableStream({async pull(s){const o=e===O?r:Math.min(r,e-a),i=await Qn(n,t+a,o);i.length&&s.enqueue(i),a+r>=e||!i.length&&o?s.close():a+=r}})}}class hn extends fn{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw Error(nn);return t.writeUint8Array(Rt(e))}});Object.defineProperty(t,un,{get:()=>e})}writeUint8Array(){}}class pn extends wn{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{vt:t,It:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{It:r,vt:n}=this,a=new Uint8Array(e),s=4*Math.floor(t/3),o=atob(n.substring(s+r,4*Math.ceil((t+e)/3)+r)),i=t-3*Math.floor(s/4);let c=0;for(let t=i;t<i+e&&t<o.length;t++)a[t-i]=o.charCodeAt(t),c++;return c<a.length?a.subarray(0,c):a}}class mn extends hn{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Ct:""})}writeUint8Array(t){const e=this;let r,n=e.Ct;const a=e.Ct.length;for(e.Ct="",r=0;r<3*Math.floor((a+t.length)/3)-a;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.Ct+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.Ct=n+e.Ct}getData(){return this.data+btoa(this.Ct)}}let yn,bn;class En extends wn{constructor(t){super(),Object.assign(this,{Mt:t,size:t.size}),bn||(bn=(async()=>{try{const t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader();let e=0,r=await t.read();for(;!r.done;)e+=r.value.length,r=await t.read();yn=1==e}catch{yn=!1}})())}createReadable(t){const{Mt:e,size:r}=this,{offset:n=0,size:a=r-n}=t||{};return!n&&a>=r?ve(e.stream()):yn?ve(e.slice(n,n+a).stream()):super.createReadable(t)}async readUint8Array(t,e){const r=this,n=t+e,a=!t&&n>=r.size?r.Mt:r.Mt.slice(t,n);let s=await a.arrayBuffer();return s.byteLength>e&&(s=s.slice(t,n)),new Uint8Array(s)}}class Sn extends fn{constructor(t){super();const e=this,r=new TransformStream;Object.defineProperty(e,un,{get:()=>r.writable}),e.contentType=t,e.Nt=Ie(r.readable,t),e.Nt.catch(()=>{})}getData(){return this.Nt}}class gn extends En{constructor(t){super(new Blob([t],{type:"text/plain"}))}}function xn(t){let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);n<128?e+=1:n<2048?e+=2:n<55296||n>=57344?e+=3:n<56320&&56320==(64512&t.charCodeAt(r+1))?(e+=4,r++):e+=3}return e}class An extends Sn{constructor(t){super(),Object.assign(this,{encoding:t,jt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,jt:e}=this,r=await super.getData();return r.text&&e?r.text():((t,e)=>Qr(t,e,!1))(new Uint8Array(await r.arrayBuffer()),t)}}class zn extends wn{constructor(t,e){super(),Fn(this,t,e)}async init(){await Dn(this,_n,Mn),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:a}=e;if((r||n)&&a!==O){const{offset:r=0,size:n=a-r}=t||{};if(n>0&&r<a)return((t,e,r)=>{let n,a=e,s=0,o=r;return new ReadableStream({start:()=>i(),async pull(t){n||await i();const{value:e,done:r}=await n.read();if(r)throw Error(tn);const a=e.length>s?e.subarray(0,s):e;s-=a.length,o-=a.length,a.length&&t.enqueue(a),s||(await(async()=>{const t=n;n=O,await t.cancel()})(),o||t.close())},cancel:t=>n&&n.cancel(t)});async function i(){const e=Math.min(t.maximumRangeSize,o),r=await _n(on,t,In(t,a,e));if(206!=r.status)throw Error(tn);const i=r.headers.get(an);if(i){const t=Number(i.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=a)throw Error(tn)}vn(t,r),kn(t,r),a+=e,s=e,n=r.body.getReader()}})(e,r,Math.min(n,a-r))}return super.createReadable(t)}readUint8Array(t,e){return On(this,t,e,_n,Mn)}}class Rn extends wn{constructor(t,e){super(),Fn(this,t,e)}async init(){await Dn(this,Wn,Nn),super.init()}readUint8Array(t,e){return On(this,t,e,Wn,Nn)}}function Fn(t,e,r){const{preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:o,checkResourceChanges:i=!0,maximumRangeSize:c=ln,fetch:l}=r;delete(r=Object.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,Object.assign(t,{url:e,options:r,preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:o,checkResourceChanges:i,maximumRangeSize:c,fetch:l})}async function Dn(t,e,r){const{url:n,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:o,combineSizeEocd:i}=t;if((t=>{const{baseURI:e}=pt(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r})(n)&&(s||o)&&(typeof a==T||a)){const n=await e(on,t,In(t,i?-22:void 0)),a=n.headers.get("Accept-Ranges");if(!(o||a&&a.toLowerCase()==cn))throw Error(tn);{if(i){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Pt=e)}kn(t,n);const a=Un(n);a===O?await Pn(t,e,r):t.size=a}}else await Pn(t,e,r)}async function On(t,e,r,n,a){const{useRangeHeader:s,forceRangeRequests:o,Pt:i,size:c,options:l}=t;if(s||o){if(i&&e==c-d&&r==d)return i;if(e>=c||0===r)return C;{e+r>c&&(r=c-e);const a=await n(on,t,In(t,e,r));if(206!=a.status)throw Error(tn);const s=a.headers.get(an);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw Error(tn)}vn(t,a),kn(t,a);const o=new Uint8Array(await a.arrayBuffer());if(o.length!=r)throw Error(tn);return o}}{const{data:n}=t;return n||await a(t,l),t.data.subarray(e,e+r)}}function Un(t){const e=t.headers.get(an);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Tn({headers:t}){return{_t:t.get("Etag")||O,lastModified:t.get("Last-Modified")||O}}function kn(t,e){const{checkResourceChanges:r,Wt:n}=t;r&&!n&&206==e.status&&(t.Wt=Tn(e))}function vn(t,e){const{checkResourceChanges:r,Wt:n,size:a}=t;if(r){const t=Un(e);if(t!==O&&a!==O&&t!=a)throw Error(en);if(n){const t=Tn(e);if(Object.entries(n).some(([e,r])=>r!==O&&t[e]!==O&&r!=t[e]))throw Error(en)}}}function In(t,e=0,r=1){return Object.assign({},Cn(t),{[sn]:cn+"="+(e<0?e:e+"-"+(e+r-1))})}function Cn({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function Mn(t){await jn(t,_n)}async function Nn(t){await jn(t,Wn)}async function jn(t,e){const r=await e(on,t,Cn(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Pn(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Cn(t)),a=n.headers.get("Content-Length");a&&!n.headers.get("Content-Encoding")?t.size=Number(a):await r(t,t.options)}}async function _n(t,{fetch:e=fetch,options:r,url:n},a){const s=await e(n,Object.assign({},r,{method:t,headers:a}));if(s.status<400)return s;throw 416==s.status?Error(tn):Error($r+(s.statusText||s.status))}function Wn(t,{url:e},r){return new Promise((n,a)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(s.status<400){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const r=e.trim().split(/\s*:\s*/);r[0]=r[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(r)}),n({status:s.status,arrayBuffer:()=>s.response,headers:new Map(t)})}else a(416==s.status?Error(tn):Error($r+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>a(t.detail?t.detail.error:Error("Network error")),!1),s.open(t,e),r)for(const t of Object.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class Ln extends wn{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Rn(t,e):new zn(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}createReadable(t){return this.reader.createReadable(t)}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class Bn extends Ln{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Vn extends wn{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{Lt:t,size:t.length})}readUint8Array(t,e){return this.Lt.slice(t,t+e)}}class Zn extends hn{constructor(t){super(),this.Bt=t||262144}init(t=0){Object.assign(this,{offset:0,Lt:new Uint8Array(t>0?t:this.Bt)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.Lt.length){let t=e.Lt.length?2*e.Lt.length:e.Bt;for(;t<r;)t*=2;const n=e.Lt;e.Lt=new Uint8Array(t),e.Lt.set(n)}e.Lt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Lt.length?this.Lt:this.Lt.slice(0,this.offset)}}class Hn extends wn{constructor(t){super(),this.Vt=t}async init(){const t=this;t.Zt=0;const e=t.Vt=await Promise.all(t.Vt.map(Jn));t.Ht=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}qt(t){const{Ht:e,size:r}=this,n=e[t];return n===O?r:n}async readUint8Array(t,e){const r=this,{Vt:n}=this;let a,s=0,o=t;for(;n[s]&&o>=n[s].size;)o-=n[s].size,s++;const i=n[s];if(i){const n=i.size;if(o+e<=n)a=await Qn(i,o,e);else{const s=n-o;a=zt(await Qn(i,o,s),await r.readUint8Array(t+s,e-s))}}else a=C;return r.Zt=Math.max(s,r.Zt),a}}class qn extends fn{constructor(t,e=4294967295){super();const r=this;let n,a,s;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const o=new WritableStream({async write(e){if(e===dn)return void(s&&await c());const{availableSize:o}=r;if(s)e.length>=o?(await i(e.subarray(0,o)),await c(),e.length>o&&await this.write(e.subarray(o))):await i(e);else{const{value:o,done:i}=await t.next();if(i&&!o)throw Error(rn);n=o,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await Xn(n),a=o.writable,s=a.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function i(t){const e=t.length;e&&(await s.ready,await s.write(t),n.size+=e,r.availableSize-=e)}async function c(){await l(),r.diskOffset+=n.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}Object.defineProperty(r,un,{get:()=>o})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(dn)}finally{t.releaseLock()}}}class Kn{constructor(t){return Array.isArray(t)&&(t=new Hn(t)),(t instanceof ReadableStream||typeof t.getReader==k)&&(t={readable:ve(t)}),t}}class Yn{constructor(t){return t.writable===O&&typeof t.next==k&&(t=new qn(t)),(t instanceof WritableStream||typeof t.getWriter==k)&&(t={writable:Ce(t)}),t.size===O&&(t.size=0),t}}function Gn(t){return!(!t||!t.getData)}async function Xn(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}async function Jn(t){return t=new Kn(t),await Xn(t),t.size!==O&&t.readUint8Array||(t=new En(await Ie(t.readable)),await Xn(t)),t}function Qn(t,e,r){return t.readUint8Array(e,r)}function $n(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?wn.prototype.createReadable.call(t,e):t.readable}const ta="filename",ea="rawFilename",ra="comment",na="rawComment",aa="uncompressedSize",sa="compressedSize",oa="offset",ia="diskNumberStart",ca="lastModDate",la="rawLastModDate",ua="lastAccessDate",da="rawLastAccessDate",fa="creationDate",wa="rawCreationDate",ha="internalFileAttributes",pa="externalFileAttributes",ma="internalFileAttribute",ya="externalFileAttribute",ba="msdosAttributesRaw",Ea="msdosAttributes",Sa="msDosCompatible",ga="zip64",xa="encrypted",Aa="version",za="versionMadeBy",Ra="zipCrypto",Fa="directory",Da="executable",Oa="compressionMethod",Ua="signature",Ta="extraField",ka="unixMode",va="setuid",Ia="setgid",Ca="sticky",Ma=[ta,ea,aa,sa,ca,la,ra,na,ua,da,fa,wa,oa,ia,ha,pa,ma,ya,ba,Ea,Sa,ga,xa,Aa,za,Ra,Fa,Da,"symlink",Oa,Ua,"crc32",Ta,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",ka,"unixExternalUpper",va,Ia,Ca,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Na{constructor(t){Ma.forEach(e=>this[e]=t[e])}}const ja="File format is not recognized",Pa="End of central directory not found",_a="End of Zip64 central directory locator not found",Wa="Central directory header not found",La="Local file header not found",Ba="Zip64 extra field not found",Va="File contains encrypted entry",Za="Encryption method not supported",Ha="Compression method not supported",qa="Split zip file",Ka="Overlapping entry found",Ya="Entry data out of bounds",Ga="Ambiguous archive",Xa="Encrypted central directory is not supported",Ja="Unsafe filename",Qa="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",$a="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",ts="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",es="64-bit value exceeds Number.MAX_SAFE_INTEGER",rs=/^[a-zA-Z]:/,ns="utf-8",as="cp437",ss=[[aa,t],[sa,t],[oa,t],[ia,e]],os={[e]:{Kt:js,bytes:4},[t]:{Kt:Ps,bytes:8}},is=BigInt(Number.MAX_SAFE_INTEGER);class cs{constructor(t,e={}){Object.assign(this,{reader:new Kn(t),options:e,Yt:new Map})}async*getEntriesGenerator(n={}){const s=this;let{reader:o}=s;if(await Xn(o),o.size!==O&&o.readUint8Array||(o=new En(await Ie(o.readable)),await Xn(o)),o.size<d)throw Error(ja);const c=As(n,s.options),h=c==G,p=c!=J,m=((t,r)=>{if(t!==O){const e=ot(t);if("number"!=typeof e||Number.isNaN(e)||e<0)throw Error(ts);return e}return r==G?0:r==J?1/0:e})(ks(s,n,"maxAppendedDataSize"),c),y=((t,e)=>{if(t===O)return e;if(!xs(t))throw Error($a);return t})(ks(s,n,"filenameValidation"),c),b=ks(s,n,"normalizeFilename"),{Gt:E,Xt:R}=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,65557),s={count:64};let o,i,c=0;for await(const[r,l,u,f,w]of Fs(t,a)){const a=Ns(r,f+20);if(w+d+a==n){const a=await Os(t,r,l,f,w,n,s);if(2==a){if(o||(o=Ds(u,f,w)),c++,!e||c>1)break}else 1!=a||i||(i=Ds(u,f,w))}}return o||(o=i),o||(o=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,e==1/0?n:65557+e);let s,o;for await(const[e,i,c,l,u]of Fs(t,a)){const a=Ds(c,l,u);s||(s=a);const d=await Os(t,e,i,l,u,n,r);if(2==d)return a;1!=d||o||(o=a)}return o||s})(t,r,s)),{Gt:o,Xt:c}})(o,p,m);if(!E)throw await(async t=>await gs(t)==a)(o)?Error(qa):Error(Pa);p&&R>1&&Ts("multiple end of central directory records");const F=Ft(E);let D=js(F,12),U=js(F,16);const T=E.offset,k=Ns(F,20),v=T+d+k;o.size-v>m&&Ts("appended data");let I=Ns(F,4);const M=o.Zt||0;let N,j,P,_,W=Ns(F,6),L=Ns(F,10),B=0,V=w;const Z=U==t||D==t||L==e||W==e;if(U!=t&&W!=e&&(U+=Ss(o,W)),Z){const r=E.offset>=f?await Qn(o,E.offset-f,f):C,n=Ft(r);if(r.length==f&&js(n,0)==u){U=Ss(o,js(n,4))+Ps(n,8);let r=await Qn(o,U,w),a=Ft(r);const s=E.offset-f-w;if((r.length<w||js(a,0)!=l)&&U!=s&&s>=0){const t=U;U=s,U>t&&(B=U-t),r=await Qn(o,U,w),a=Ft(r)}if(r.length<w||js(a,0)!=l)throw Error(_a);if(j=!0,P=Ps(a,4)>44,P){const t=Math.min(Ps(a,4)-44,o.size-U-w);t>0&&(V+=t,_=(t=>{const e={rawExtensibleData:t};if(t.length>=28){const r=Ft(t),n=Ns(r,26);Object.assign(e,{compressionMethod:Ns(r,0),compressedSize:Ps(r,2),uncompressedSize:Ps(r,10),encryptionAlgorithm:Ns(r,18),bitLength:Ns(r,20),flags:Ns(r,22),hashAlgorithm:Ns(r,24),hashData:t.subarray(28,28+n)})}return e})(await Qn(o,U+w,t)))}I==e?I=js(a,16):h&&I!=js(a,16)&&Ts("mismatched zip64 end of central directory record"),W==e?W=js(a,20):h&&W!=js(a,20)&&Ts("mismatched zip64 end of central directory record"),L==e?L=Ps(a,32):h&&L!=Ps(a,32)&&Ts("mismatched zip64 end of central directory record"),D==t?D=Ps(a,40):h&&D!=Ps(a,40)&&Ts("mismatched zip64 end of central directory record"),U=Ss(o,W)+Ps(a,48)+B}}let H=D;const q=E.offset-(j?V+f:0);if(U>=o.size&&(B=o.size-U-D-d,U=o.size-D-d),M!=I)throw Error(qa);if(U<0)throw Error(ja);let X=0,Q=await Qn(o,U,D),$=Ft(Q);if(D){if(Q.length<4)throw Error(ja);const t=q-D;if(U!=t&&W==I){let e=!(js($,X)==i||_&&_.compressedSize||ds($));if(!e&&t>=0&&t+4<=o.size&&(e=js(Ft(await Qn(o,t,4)),0)==i),e){const e=U;U=t,U>e&&(B+=U-e),Q=await Qn(o,U,D),$=Ft(Q)}}}const tt=q-U;if(D!=tt&&tt>=0&&W==I&&(D=tt,Q=await Qn(o,U,D),$=Ft(Q)),U<0||U>=o.size)throw Error(ja);s.directoryOffset=U,s.directoryLength=H;const et=vs(s,n,"decryptCentralDirectory");let rt,nt;if(et&&L&&Q.length>=4&&js($,0)!=i&&(P||ds($))){const t=((t,e,r)=>{const n=t&&t.compressedSize?t.compressedSize:e;return n>0&&n<=r?n:r})(_,H,Q.length);nt=Q.subarray(t),Q=await et(Q.subarray(0,t),_),$=Ft(Q),H=Q.length,rt=!0}N=U;const at=ks(s,n,"filenameEncoding"),st=ks(s,n,"commentEncoding"),it=h?new Set:O;let ct;for(let t=0;t<L;t++){const a=new us(o,s.options);if(X+46>Q.length||js($,X)!=i){if(0==t&&!rt&&(P||ds($)))throw Error(Xa);throw Error(Wa)}ws(a,$,X+6);const c=!!a.bitFlag.languageEncodingFlag,l=X+46,u=l+a.filenameLength,d=u+a.extraFieldLength,f=Ns($,X+4),w=!(f>>8),p=f>>8==3,m=Q.subarray(l,u),E=Ns($,X+32),R=d+E,F=Q.subarray(d,R),D=c,U=c,T=js($,X+38),k=T&r,v={readOnly:!!(1&k),hidden:!!(2&k),system:!!(4&k),directory:!!(16&k),archive:!!(32&k)},I=js($,X+42),C=vs(s,n,"decodeText")||Jr,M=D?ns:at||as,j=U?ns:st||as;let _=C(m,M,K);if(_===O&&(_=Jr(m,M)),b){const t=b(_);t!==O&&(_=t)}if(Rs(_,y)){const t=Error(Ja);throw t.filename=_,t}let W=C(F,j,Y);W===O&&(W=Jr(F,j)),Object.assign(a,{index:t,Jt:rt,versionMadeBy:f,msDosCompatible:w,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:E,offset:I,diskNumberStart:Ns($,X+34),internalFileAttributes:Ns($,X+36),externalFileAttributes:T,msdosAttributesRaw:k,msdosAttributes:v,rawFilename:m,filenameUTF8:D,commentUTF8:U,rawExtraField:Q.subarray(u,d),rawComment:F,filename:_,comment:W}),hs(a,a,$,X+6),a.offset+=B,N=Math.min(Ss(o,a.diskNumberStart)+a.offset,N),h&&(it.has(a.filename)&&(ct=!0),it.add(a.filename));const V=a.externalFileAttributes>>16&e;a.unixMode===O&&16877&V&&(a.unixMode=V);const Z=!!(a.unixMode&x),H=!!(a.unixMode&A),q=!!(512&a.unixMode),G=40960==((a.unixMode===O?V:a.unixMode)&S),J=!G&&(a.unixMode!==O?!!(73&a.unixMode):p&&!!(73&V)),tt=a.unixMode!==O&&(a.unixMode&S)==g,et=(V&S)==g;Object.assign(a,{setuid:Z,setgid:H,sticky:q,symlink:G,unixExternalUpper:V,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:J,directory:tt||et||w&&v.directory||a.filename.endsWith(z)&&!a.uncompressedSize,zipCrypto:a.encrypted&&!a.extraFieldAES});const nt=new Na(a);nt.getData=(t,e)=>a.getData(t,nt,s.Yt,e),nt.arrayBuffer=async t=>{const e=new TransformStream,r=Ie(e.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await a.getData(e,nt,s.Yt,t),r},X=R;const{onprogress:ot}=n;if(ot)try{await ot(t+1,L,new Na(a))}catch{}yield nt}let lt=X,ut=fs(Q.subarray(X))||(rt?fs(nt):O);if(!ut&&!rt){const t=U+X,e=Math.min(q-t,65541);e>=6&&(ut=fs(await Qn(o,t,e)))}ut&&(s.digitalSignature=ut,lt=X+6+ut.length),h&&X!=H&<!=H&&Ts("trailing central directory data"),ct&&Ts("duplicate filename");const dt=ks(s,n,"extractPrependedData"),ft=ks(s,n,"extractAppendedData"),wt=(h||dt)&&L&&4==N&&await(async t=>{const e=await gs(t);return e==a||808471376==e})(o)?4:0;return h&&(B||L&&N>wt)&&Ts("prepended data"),dt&&(s.prependedData=N>wt?await Qn(o,wt,N-wt):C),s.comment=k?await Qn(o,T+d,k):C,ft&&(s.appendedData=v<o.size?await Qn(o,v,o.size-v):C),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}class ls{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new cs(e,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(t){const{done:e,value:r}=await n.next();if(e)return t.close();const a={...r,readable:(()=>{const{readable:t,writable:e}=new TransformStream;if(r.getData)return(async()=>{try{await r.getData(e)}catch(t){try{await e.abort(t)}catch{}}})(),t})()};delete a.getData,t.enqueue(a)}}),this.writable=r}}let us=class{constructor(t,e){Object.assign(this,{reader:t,options:e})}async getData(t,e,a,o={}){const i=this,c=pt(),{reader:l,index:u,offset:d,diskNumberStart:f,extraFieldAES:w,extraFieldZip64:h,compressionMethod:p,bitFlag:m,rawBitFlag:y,crc32:b,rawLastModDate:E,uncompressedSize:S,compressedSize:g}=i,{dataDescriptor:x}=m,A=e.localDirectory={},z=Ss(l,f)+d,F=await Qn(l,z,R),D=Ft(F);let U=ks(i,o,M),T=ks(i,o,N);const k=ks(i,o,j);if(nt(U,T),U=U&&U.length&&U,T=T&&T.length&&T,w&&99!=w.originalCompressionMethod)throw Error(Ha);if(F.length<R||js(D,0)!=n)throw Error(La);ws(A,D,4);const{extraFieldLength:v,filenameLength:I}=A,V=ks(i,o,"checkLocalDirectory"),Z=As(o,i.options),H=((t,e)=>t===O?e!=J:!!t)(V,Z),q=((t,e)=>t===O?e==G:!!t)(V,Z);let K=C;if(q&&(I||v)){const t=await Qn(l,z+R,I+v);K=t.subarray(0,I),A.rawExtraField=t.subarray(I)}else A.rawExtraField=v?await Qn(l,z+R+I,v):C;q&&(A.rawFilename=K),hs(i,A,D,4,!0),H&&((t,e,r,n)=>{const{rawFilename:a}=t,s=t.Jt&&!(8192&~e.rawBitFlag);!n||s||r.length==a.length&&!r.some((t,e)=>t!=a[e])||Ts("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Ts("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&Ts("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||s||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Ts("mismatched local file header (crc32 or sizes)")})(i,A,K,q);const{lastAccessDate:Y,creationDate:X,uid:Q,gid:$}=A;Y&&(e.lastAccessDate=Y),X&&(e.creationDate=X),Q!==O&&e.uid===O&&(e.uid=Q),$!==O&&e.gid===O&&(e.gid=$);const tt=i.encrypted&&A.encrypted&&!k,et=tt&&!w;if(k||(e.zipCrypto=et),tt&&!(64&~A.rawBitFlag))throw Error(Za);const at=k?O:Ve(p);if(0!=p&&8!=p&&9!=p&&!at&&!k)throw Error(Ha);if(tt){if(!et&&(w.strength<1||w.strength>3))throw Error(Za);if(!U&&!T)throw Error(Va)}const st=z+R+I+v;if(st+g>l.size)throw Error(Ya);const ot=g,it=ve(l.createReadable({offset:st,size:ot})),ct=rt(ks(i,o,P)),lt=ks(i,o,"checkPasswordOnly");let ut=ks(i,o,"checkOverlappingEntry");const dt=ks(i,o,"checkOverlappingEntryOnly");dt&&(ut=!0);const{onstart:ft,onprogress:wt,onend:ht}=o,mt=0!=p&&!k,yt=k?g:S,bt=9==p;let Et=ks(i,o,W);bt&&(Et=!1);const St=ks(i,o,"checkCrc32"),gt=(St===O?ks(i,o,"checkSignature"):St)&&!k&&(!tt||et||w&&1==w.vendorVersion),xt={options:{codecType:dr,password:U,rawPassword:T,zipCrypto:et,encryptionStrength:w&&w.strength,checkCrc32:gt,checkAuthenticationCode:ks(i,o,"checkAuthenticationCode"),passwordVerification:et&&(x?E>>>8&r:b>>>24&r),outputSize:yt,crc32:b,compressed:mt,encrypted:tt,useWebWorkers:ks(i,o,_),useCompressionStream:Et,transferStreams:ks(i,o,L),deflate64:bt,format:at?at.format:O,codecURI:at?at.codecURI:O,compressionMethod:p,rawBitFlag:y,checkPasswordOnly:lt},config:c,ft:{signal:ct,size:ot,onstart:ft,onprogress:wt,onend:ht}};let At,zt;ut&&await(async({reader:t,$t:e,index:r,offset:n,crc32:a,compressedSize:o,uncompressedSize:i,te:c,dataDescriptor:l,extraFieldZip64:u,Yt:d})=>{let f=0;if(l&&(f=u?20:12),f){const r=await Qn(t,c+o,f+4),n=Ft(r);let l=r.length==f+4&&js(n,0)==s;if(l){const t=Es(n,4,u);(e.encrypted&&!e.zipCrypto||t.crc32==a)&&t.compressedSize==o&&t.uncompressedSize==i?f+=4:l=!1}if(r.length>=f){const t=Es(n,l?4:0,u);t.signature=l,e.localDirectory.dataDescriptor=t}}const w={start:n,end:c+o+f,$t:e};for(const[t,e]of d)if(t!=r&&w.start<e.end&&e.start<w.end){const t=Error(Ka);throw t.overlappingEntry=e.$t,t}d.set(r,w)})({reader:l,$t:e,index:u,offset:z,crc32:b,compressedSize:g,uncompressedSize:S,te:st,dataDescriptor:x||A.bitFlag.dataDescriptor,extraFieldZip64:h||A.extraFieldZip64,Yt:a});try{if(!dt){lt&&(t=new WritableStream),t=new Yn(t),await Xn(t,((t,e,r)=>Math.min(t,r?1032*e:e))(yt,g,mt)),({writable:At}=t);const{outputSize:e}=await Zr({readable:it,writable:At},xt);if(t.size+=e,e!=yt)throw Error(qe)}}catch(e){if(e.outputSize!==O&&(t.size+=e.outputSize),!lt||e.message!=Kt)throw zt=e,e}finally{if((Gn(t)||!ks(i,o,B))&&At&&!At.locked){const t=At.getWriter();if(zt)try{await t.abort(zt)}catch{}else await t.close()}}return lt||dt?O:t.getData?t.getData():At}};function ds(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;r<e;r++)if(134630224==js(t,r))return!0;return!1}function fs(t){if(t.length>=6){const e=Ft(t);if(js(e,0)==o){const r=Ns(e,4);if(6+r<=t.length)return t.subarray(6,6+r)}}}function ws(t,e,r){const n=t.rawBitFlag=Ns(e,r+2),a=!(1&~n),s=js(e,r+6);Object.assign(t,{encrypted:a,version:Ns(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&E)==E},rawLastModDate:s,lastModDate:Is(s),filenameLength:Ns(e,r+22),extraFieldLength:Ns(e,r+24)})}function hs(t,e,r,n,a){const{rawExtraField:s}=e,o=e.extraField=new Map,i=Ft(s);let c=0;try{for(;c<s.length;){const t=Ns(i,c),e=Ns(i,c+2);o.set(t,{type:t,data:s.slice(c+4,c+4+e)}),c+=4+e}}catch{}const l=Ns(r,n+4);Object.assign(e,{signature:js(r,n+10),crc32:js(r,n+10),compressedSize:js(r,n+14),uncompressedSize:js(r,n+18)});const u=o.get(1);u&&(((t,e)=>{e.zip64=!0;const r=Ft(t.data),n=ss.filter(([t,r])=>e[t]==r),a=n.reduce((t,[,e])=>t+os[e].bytes,0);if(t.data.length<a)throw Error(Ba);for(let a=0,s=0;a<n.length;a++){const[o,i]=n[a],c=os[i];e[o]=t[o]=c.Kt(r,s),s+=c.bytes}})(u,e),e.extraFieldZip64=u);const d=o.get(28789);d&&(ps(d,ta,ea,e,t),e.extraFieldUnicodePath=d);const f=o.get(25461);f&&(ps(f,ra,na,e,t),e.extraFieldUnicodeComment=f);const w=o.get(h);w&&w.data.length>=7?(((t,e,r)=>{const n=Ft(t.data),a=Ms(n,4);Object.assign(t,{vendorVersion:Ms(n,0),vendorId:Ms(n,2),strength:a,originalCompressionMethod:r,compressionMethod:Ns(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=O)})(w,e,l),e.extraFieldAES=w):e.compressionMethod=l;const E=o.get(13);E&&(ms(E,e),e.extraFieldPkwareUnix=E);const S=o.get(22613);S&&(ms(S,e),e.extraFieldUnixType1=S);const g=o.get(10);g&&(((t,e)=>{const r=Ft(t.data);let n,a=4;try{for(;a<t.data.length&&!n;){const e=Ns(r,a),s=Ns(r,a+2);1==e&&(n=t.data.slice(a+4,a+4+s)),a+=4+s}}catch{}if(n&&24==n.length){const r=Ft(n),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),o=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:o});const i={lastModDate:Cs(a),lastAccessDate:Cs(s),creationDate:Cs(o)};Object.assign(t,i),Object.assign(e,i,{rawLastAccessDate:s,rawCreationDate:o})}})(g,e),e.extraFieldNTFS=g);const x=o.get(b);let A;if(x&&(A=ys(x,e,!1),e.extraFieldUnix=x),!A){const t=o.get(y);t&&(ys(t,e,!0),e.extraFieldInfoZip=t)}const z=o.get(p);z&&(((t,e,r)=>{if(!t.data.length)return;const n=Ft(t.data),a=Ms(n,0),s=[],o=[];r?(1&~a||(s.push(ca),o.push(la)),2&~a||(s.push(ua),o.push(da)),4&~a||(s.push(fa),o.push(wa))):t.data.length>=5&&(s.push(ca),o.push(la));let i=1;s.forEach((r,a)=>{if(t.data.length>=i+4){const s=js(n,i);e[r]=t[r]=new Date(1e3*(0|s));const c=o[a];t[c]=s}i+=4})})(z,e,a),e.extraFieldExtendedTimestamp=z);const R=o.get(m);R&&(e.extraFieldUSDZ=R)}function ps(t,e,r,n,a){if(t.data.length<5)return void(t.valid=!1);const s=Ft(t.data),o=new Nt;o.append(a[r]);const i=Ft(new Uint8Array(4));i.setUint32(0,o.get(),!0);const c=js(s,1);Object.assign(t,{version:Ms(s,0),[e]:Jr(t.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==js(i,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function ms(t,e){if(t.data.length<8)return;const r=Ft(t.data),n={lastAccessDate:new Date(1e3*(0|js(r,0))),lastModDate:new Date(1e3*(0|js(r,4)))};t.data.length>=12&&(n.uid=Ns(r,8),n.gid=Ns(r,10)),Object.assign(t,n),Object.assign(e,n)}function ys(t,e,r){try{const n=Ft(t.data);let a,s;if(r){let e=0;const r=Ms(n,e++),o=Ms(n,e++);a=bs(t.data.subarray(e,e+o)),e+=o;const i=Ms(n,e++);s=bs(t.data.subarray(e,e+i)),Object.assign(t,{version:r,uid:a,gid:s})}else t.data.length>=4&&(a=Ns(n,0),s=Ns(n,2),Object.assign(t,{uid:a,gid:s}));return a!==O&&(e.uid=a),s!==O&&(e.gid=s),a!==O||s!==O}catch{}}function bs(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Es(t,e,r){const n=js(t,e);let a,s;return r?(a=Ps(t,e+4),s=Ps(t,e+12)):(a=js(t,e+4),s=js(t,e+8)),{crc32:n,compressedSize:a,uncompressedSize:s}}function Ss(t,e){return t.qt?t.qt(e):0}async function gs(t){return js(Ft(await Qn(t,0,4)))}function xs(t){return t===G||t===X||t===J}function As(t,e){return zs(t,zs(e,X))}function zs(t,e){const r=t.strictness;if(r!==O){if(!xs(r))throw Error(Qa);return r}const n=t.checkAmbiguity;return n===O?e:n?G:e==J?J:X}function Rs(t,e){if(e==J)return!1;const r=t.split("/");return r.length>1&&""===r[r.length-1]&&r.pop(),!!(r.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||rs.test(t))||e==G&&(r.includes(".")||r.includes(""))}async function*Fs(t,e){const r=t.size-e,n=await Qn(t,r,e),a=Ft(n);for(let t=n.length-d;t>=0;t--)js(a,t)==c&&(yield[a,r,n,t,r+t])}function Ds(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function Os(r,n,a,s,o,c,l){const d=Ns(n,s+10),w=js(n,s+12),h=js(n,s+16);if(d==e||w==t||h==t)return await Us(r,n,a,o-f,c,l)==u?2:0;if(!d&&!w)return 1;const p=Ns(n,s+6);for(const t of[o-w,Ss(r,p)+h])if(await Us(r,n,a,t,c,l)==i)return 2;return 0}async function Us(t,e,r,n,a,s){return n<0||n+4>a?O:n>=r?js(e,n-r):s.count>0?(s.count--,js(Ft(await Qn(t,n,4)),0)):O}function Ts(t){const e=Error(Ga);throw e.reason=t,e}function ks(t,e,r){return e[r]===O?t.options[r]:e[r]}function vs(t,e,r){return et(ks(t,e,r))}function Is(t){const r=(4294901760&t)>>16,n=t&e;return new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}function Cs(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Ms(t,e){return t.getUint8(e)}function Ns(t,e){return t.getUint16(e,!0)}function js(t,e){return t.getUint32(e,!0)}function Ps(t,e){const r=t.getBigUint64(e,!0);if(r>is)throw Error(es);return Number(r)}var _s=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Ga,ERR_BAD_FORMAT:ja,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Wa,ERR_ENCRYPTED:Va,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Xa,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Ya,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:_a,ERR_EOCDR_NOT_FOUND:Pa,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Ba,ERR_INVALID_AUTHENTICATION_CODE:qt,ERR_INVALID_COMPRESSED_DATA:Ke,ERR_INVALID_CRC32:Ye,ERR_INVALID_FILENAME_VALIDATION:$a,ERR_INVALID_MAX_APPENDED_DATA_SIZE:ts,ERR_INVALID_PASSWORD:Zt,ERR_INVALID_SIGNATURE:Ht,ERR_INVALID_STRICTNESS:Qa,ERR_INVALID_UNCOMPRESSED_SIZE:qe,ERR_LOCAL_FILE_HEADER_NOT_FOUND:La,ERR_OVERLAPPING_ENTRY:Ka,ERR_SPLIT_ZIP_FILE:qa,ERR_UNSAFE_FILENAME:Ja,ERR_UNSUPPORTED_COMPRESSION:Ha,ERR_UNSUPPORTED_ENCRYPTION:Za,ERR_UNSUPPORTED_UINT64:es,ERR_WORKER_STARTUP_TIMEOUT:hr,ZipReader:cs,ZipReaderStream:ls});const Ws="File already exists",Ls="Zip file comment exceeds 64KB",Bs="Invalid zip file comment (must be a Uint8Array)",Vs="File entry comment exceeds 64KB",Zs="Invalid file entry comment (must be a string)",Hs="Invalid date (must be a valid Date instance)",qs="File entry name exceeds 64KB",Ks="Version exceeds 65535",Ys="The strength must equal 1, 2, or 3",Gs="Encryption is not supported in USDZ files",Xs="Encryption is not supported when the 'passThrough' option is set",Js="Invalid extra field (must be a Map)",Qs="Invalid extra field type (must be integer 0..65535)",$s="Invalid extra field data (must be a Uint8Array)",to="Extra field data exceeds 64KB",eo=-2147483648,ro=2147483647,no=BigInt(0),ao=BigInt("0x7fffffffffffffff"),so="Zip64 is not supported (set the 'zip64' option to 'true')",oo="Undefined uncompressed size",io="Undefined compression method",co="Undetermined size",lo="Undefined reader",uo="Zip file not empty",fo="Invalid uid (must be integer 0..2^32-1)",wo="Invalid gid (must be integer 0..2^32-1)",ho="Invalid UNIX mode (must be integer 0..65535)",po="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",mo="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",yo="Invalid msdosAttributesRaw (must be integer 0..255)",bo="Invalid msdosAttributes (must be an object with boolean flags)",Eo="Invalid level (must be integer 0..9)",So="Signature data exceeds 64KB",go=new Uint8Array([7,0,2,0,65,69,3,0,0]),xo="infozip",Ao="unix";let zo=0;const Ro=[];class Fo{constructor(t,e={}){t=new Yn(t);const{availableSize:r=U,maxSize:n=U}=t;Object.assign(this,{writer:t,ee:r>0&&r!==U&&n>0&&n!==U,options:e,re:new Map,ne:new Set,offset:e[Z]===O?t.size||t.writable.size||0:e[Z],ae:e[Z]===O?0:e[Z]-(t.size||t.writable.size||0),se:new Set,oe:0,ie:O})}async prependZip(t){if(this.ne.size)throw Error(uo);t=new Kn(t),await Xn(t),t.size!==O&&t.readUint8Array||(t=new En(await Ie(t.readable)),await Xn(t));const{ZipReader:e}=await Promise.resolve().then(()=>_s),r=new e(t),n=await r.getEntries();await r.close(),await Xn(this.writer);const{directoryOffset:s}=r;this.ee&&(delete this.ee,await(async t=>Ft(await Qn(t,0,4)).getUint32(0,!0)==a)(t)||(await Yo(this.writer,Ko()),this.offset+=4));const o=await(async(t,e,r,n)=>{const{writer:a}=t,s=new Map;if(a.closeDisk){const o=Array.from(r).sort((t,r)=>qo(e,t)-qo(e,r));let i=0;for(const r of o){const n=qo(e,r);await Zo(t,e,i,n-i),Lo(a,await Ho(e,n))&&await a.closeDisk(),s.set(r,{offset:Bo(t,a),diskNumberStart:_o(a)}),i=n}await Zo(t,e,i,n-i)}else{const a=t.offset;await Zo(t,e,0,n),r.forEach(t=>s.set(t,{offset:a+qo(e,t),diskNumberStart:0}))}return s})(this,t,n,s);this.ne=new Set(n.map(t=>t.filename)),this.re=new Map(n.map(t=>{const{version:e,rawLastModDate:r,lastAccessDate:n,creationDate:a,rawFilename:s,bitFlag:i,encrypted:c,uncompressedSize:l,compressedSize:u,extraFieldZip64:d}=t;let{compressionMethod:f,ce:w,le:h,ue:p,de:m,fe:y,rawExtraField:b}=t;const{level:E,languageEncodingFlag:S,dataDescriptor:g}=i;w=w||C,h=h||C,p=p||C,m=m||C,y=y||C,b=Vo(b||C),t.extraFieldAES&&(f=99);const x=fi(w,h,p,m,y,b),A=!!d&&d.uncompressedSize!==O,z=!!d&&d.compressedSize!==O,R=-7&hi(E,S,g,c,f)|E<<1,{we:F,he:D}=wi({version:e,bitFlag:R,compressionMethod:f,uncompressedSize:l,compressedSize:u,rawLastModDate:r,rawFilename:s,pe:z,me:A,extraFieldLength:x}),{crc32:U}=t;U!==O&&li(D,10,U);const{offset:T,diskNumberStart:k}=o.get(t);return Object.assign(t,{me:A,pe:z,offset:T,diskNumberStart:k,ye:!1,ce:w,le:h,ue:p,de:m,fe:y,rawExtraField:b,extendedTimestamp:p.length>0||m.length>0,be:1+(n?2:0)+(a?4:0),we:F,he:D}),[t.filename,t]}))}async add(e="",n,a={}){const s=this;a=Object.assign({},a);const{se:o}=s;let i,c;zo<pt().maxWorkers?zo++:await new Promise(t=>Ro.push(t));try{if(e=e.trim(),$o(s,a,Fa)&&!e.endsWith(z)&&(e+=z),s.ne.has(e))throw Error(Ws);return s.ne.add(e),c=!0,i=(async(e,n,a,s)=>{const o=Uo(e,n,s);({name:n}=o);const i=To(e,n,s),{comment:c}=i,l=s[Ta];let u;e.re.set(n,O);try{const{Ee:c}=i;0==c.level||c.compressionMethod!==O||c.passThrough||await Er(pt())||(c.level=0);const l=await(async(t,e,{Ee:r},n)=>{if(r.passThrough&&!e&&!$o(t,n,Fa))throw Error(lo);let a;return e&&(e=new Kn(e),await Xn(e),({size:a}=e)),Object.assign({reader:e},vo(t,!!e,a,r,n))})(e,a,i,s);({reader:a}=l);const d=Wo(e.writer),f=_o(e.writer),w=Io(s=Object.assign({},s,o.Ee,i.Ee,l.Ee,{signature:s[Ua],crc32:s.crc32===O?s[Ua]:s.crc32,offset:e.offset-d,diskNumberStart:f,[H]:e.options[H]})),h=No(s),p=fi(w.Se,h.ge);u=await(async(e,n,a,s,o)=>{const{re:i,writer:c}=e,{keepOrder:l,dataDescriptor:u,xe:d,signal:f}=o,{Ae:w}=s,h=e.options[H],p=e.ie;let m,y,b,E,S,g,x,A={},z=0;i.set(n,A),e.ie=A;try{let y;l&&(y=p&&p.ze,A.ze=new Promise(t=>b=t)),o.bufferedWrite||!l||e.Re||e.oe||!u&&!d?(m=!0,e.oe++,x=o.createTempStream?await o.createTempStream():new TransformStream(O,O,{highWaterMark:U}),x.size=0,await Xn(c)):(x=c,await F()),await Xn(x);const T=Wo(c);e.ee&&(delete e.ee,await Yo(c,Ko()),e.offset+=4),h&&!m&&Co(s,e.offset-T);const{Se:k}=w;m||(await y,await D());const v=_o(c),I=Bo(e,c);if(A.diskNumberStart=v,m||(S=!0,g=c.size,await Yo(x,k)),A=await(async(e,n,{diskNumberStart:a,ze:s},o,i,c)=>{const{Ae:l,Fe:u,De:d}=o,{we:f,he:w,lastModDate:h,rawLastModDate:p,encrypted:m,compressed:y,version:b,compressionMethod:E,ce:S,Oe:g,ue:x,be:A,de:z,fe:R,le:F}=l,{ge:D}=u,{rawFilename:U,lastAccessDate:T,creationDate:k,password:v,rawPassword:I,level:C,zip64:M,me:N,pe:j,zipCrypto:P,dataDescriptor:_,directory:W,executable:L,versionMadeBy:B,rawComment:V,rawExtraField:Z,useWebWorkers:H,transferStreams:q,onstart:K,onprogress:Y,onend:G,signal:X,encryptionStrength:J,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,uid:rt,gid:nt,unixMode:at,symlink:st,setuid:ot,setgid:it,sticky:ct,unixExternalUpper:lt,msdosAttributesRaw:ut,msdosAttributes:dt,useCompressionStream:ft,passThrough:wt,format:ht,codecURI:pt}=c,mt={ze:s,versionMadeBy:B,zip64:M,directory:!!W,executable:!!L,filenameUTF8:!0,rawFilename:U,commentUTF8:!0,rawComment:V,ce:S,Oe:g,ue:x,de:z,fe:R,le:F,rawExtraField:Z,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,diskNumberStart:a,uid:rt,gid:nt,unixMode:at,symlink:!!st,setuid:ot,setgid:it,sticky:ct,unixExternalUpper:lt,msdosAttributesRaw:ut,msdosAttributes:dt};let{crc32:yt,uncompressedSize:bt}=c,Et=0;wt||(bt=0);const{writable:St}=n;if(e){const a=ve($n(e)),s=e.size,o={options:{codecType:ur,level:C,rawPassword:I,password:v,encryptionStrength:J,zipCrypto:m&&P,passwordVerification:m&&P&&p>>8&r,computeCrc32:!wt,compressed:y&&!wt,encrypted:m&&!wt,useWebWorkers:H,useCompressionStream:ft,transferStreams:q,format:ht,codecURI:pt,compressionMethod:E},config:i,ft:{signal:X,size:s,onstart:K,onprogress:Y,onend:G}};try{const e=await Zr({readable:a,writable:St},o);if(Et=e.outputSize,n.size+=Et,wt||(bt=e.inputSize,m&&!P||(yt=e.crc32)),!j&&Et>=t||!N&&bt>=t)throw Error(so)}catch(t){throw t.outputSize!==O&&(n.size+=t.outputSize),t}}return(({crc32:t,compressedSize:e,uncompressedSize:r,Ae:n,Fe:a},{zip64:s,zipCrypto:o,passThrough:i,dataDescriptor:c})=>{const{he:l,encrypted:u}=n,{Ue:d,Te:f}=a;u&&!o&&!i||t===O||(li(l,10,t),c&&li(d,f,t)),s?c&&(ui(d,f+4,BigInt(e)),ui(d,f+12,BigInt(r))):(li(l,14,e),li(l,18,r),c&&(li(d,f+4,e),li(d,f+8,r)))})({crc32:yt,compressedSize:Et,uncompressedSize:bt,Ae:l,Fe:u},c),_&&await Yo(n,D),Object.assign(mt,{uncompressedSize:bt,compressedSize:Et,lastModDate:h,rawLastModDate:p,creationDate:k,lastAccessDate:T,encrypted:!!m,zipCrypto:!!P,size:d+Et,compressionMethod:E,version:b,we:f,he:w,signature:yt,crc32:!m||P||wt?yt:O,be:A,me:N,pe:j}),mt})(a,x,A,s,pt(),o),m||(S=!1),i.set(n,A),A.filename=n,m){if(await Promise.all([x.writable.getWriter().close(),y]),await F(),E=!0,g=c.size,await D(),A.diskNumberStart=_o(c),A.offset=Bo(e,c),h){const t=s.De;Co(s,e.offset-Wo(c)),A.size+=s.De-t}(({rawFilename:t,encrypted:e,zip64:r,Oe:n,crc32:a,compressedSize:s,uncompressedSize:o,me:i,pe:c},l,{dataDescriptor:u,passThrough:d})=>{if(u||((!e||d&&a!==O)&&li(l,14,a),c||li(l,18,s),i||li(l,22,o)),r&&n){const e=R+fi(t)+4;ui(l,e,BigInt(o)),ui(l,e+8,BigInt(s))}})(A,w.ke,o),await Yo(c,w.Se),await(async(t,e,r)=>{const n=e.writable.getWriter();try{await t.pipeTo(new WritableStream({async write(t){var e;await n.ready,await n.write(t),e=fi(t),z+=e}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{n.releaseLock()}})(x.readable,c,f),c.size+=x.size,E=!1}else A.diskNumberStart=v,A.offset=I;return e.offset+=A.size,A}catch(t){if(E||S){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=c.size-g,m&&(e.offset+=z)}throw i.delete(n),t}finally{if(m&&e.oe--,b&&b(),y&&y(),m&&x&&x.dispose)try{await x.dispose()}catch{}}async function F(){e.Re=!0;const{ve:t}=e;e.ve=new Promise(t=>y=()=>{e.Re=!1,t()}),await t}async function D(){Lo(c,fi(w.Se))&&await c.closeDisk()}})(e,n,a,{Ae:w,Fe:h,De:p},s)}catch(t){throw e.re.delete(n),t}return Object.assign(u,{name:n,comment:c,extraField:l,[ma]:u.internalFileAttributes,[ya]:u.externalFileAttributes}),new Na(u)})(s,e,n,a),o.add(i),await i}catch(t){throw c&&s.ne.delete(e),t}finally{o.delete(i);const t=Ro.shift();t?t():zo--}}remove(t){const{ne:e,re:r}=this;if(typeof t==I&&(t=r.get(t)),t&&t.filename!==O){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=C,n={}){const{se:a,writer:s}=this,{writable:f}=s;if(!(r instanceof Uint8Array))throw Error(Bs);if(fi(r)>e)throw Error(Ls);for(;a.size;)await Promise.allSettled(Array.from(a));return await(async(r,n,a)=>{const s=jo(r.re),{Ie:f,Ce:w}=await(async(r,n,a)=>{const{re:s,writer:o}=r,c=new Uint8Array(n);await Xn(o);let l=0,u=0,d=_o(o),f=Wo(o);for(const[r,n]of Array.from(s.values()).entries()){const{offset:w,rawFilename:h,ce:p,le:m,ue:y,de:b,fe:E,rawExtraField:S,rawComment:g,versionMadeBy:x,we:A,he:z,me:R,pe:F,ye:D,Me:O,internalFileAttributes:U,externalFileAttributes:T,diskNumberStart:k,uncompressedSize:v,compressedSize:I}=n,C=fi(p,m,y,b,E,S),M=46+fi(h,g)+C;Lo(o,l+M-u)&&(await Yo(o,c.slice(u,l)),u=l,await o.closeDisk()),0==r&&(d=_o(o),f=Wo(o)),R||li(z,18,v),F||li(z,14,I),(O||D)&&n.version<45&&ci(z,0,45);const N=Po(M);if(N.Ne(i),N.je(x),N.Pe(A.subarray(0,24)),N.je(C),N.je(fi(g)),N.je(D?e:k),N.je(U),N.Ne(T),N.Ne(O?t:w),N.Pe(h),N.Pe(p),N.Pe(m),N.Pe(y),N.Pe(b),N.Pe(E),N.Pe(S),N.Pe(g),di(c,N.Lt,l),l+=M,a.onprogress)try{await a.onprogress(r+1,s.size,new Na(n))}catch{}}return await Yo(o,u?c.slice(u):c),{Ie:{diskNumber:d,diskOffset:f},Ce:c}})(r,s,a),h=await(async(t,r,n)=>{const a=ei(t,n,q);if(a){const n=await a(r),s=fi(n);if(s>e)throw Error(So);const i=Po(6+s);i.Ne(o),i.je(s),i.Pe(n);const{writer:c}=t;return Lo(c,fi(i.Lt))&&await c.closeDisk(),await Yo(c,i.Lt),6+s}return 0})(r,w,a);await(async(r,n,a,s)=>{const{writer:o}=r,{Ie:i,_e:f}=s;let{We:w}=s,h=r.re.size,p=i.diskNumber,m=Bo(r,i),y=_o(o);Lo(o,d)&&y++;let b=$o(r,a,ga);if(m>=t||w>=t||h>=e||y>=e){if(!1===b)throw Error(so);b=!0}const E=fi(n);if(E>e)throw Error(Ls);const S=Po(b?98:d);Lo(o,fi(S.Lt)+E)&&await o.closeDisk(),y=_o(o),b&&(S.Ne(l),S.Le(44),S.je(45),S.je(45),S.Ne(y),S.Ne(p),S.Le(h),S.Le(h),S.Le(w),S.Le(m),S.Ne(u),S.Ne(y),S.Le(BigInt(Bo(r,o))+BigInt(w)+BigInt(f)),S.Ne(y+1),$o(r,a,"supportZip64SplitFile",!0)&&(y=e,p=e),h=e,m=t,w=t),S.Ne(c),S.je(y),S.je(p),S.je(h),S.je(h),S.Ne(w),S.Ne(m),S.je(E),await Yo(o,S.Lt),E&&await Yo(o,n)})(r,n,a,{Ie:f,We:s,_e:h})})(this,r,n),!Gn(s)&&$o(this,n,B)||await f.getWriter().close(),s.getData?s.getData():f}}class Do{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new Fo(r,t),this.se=new Set}transform(t){const e=this.zipWriter;let r;const{readable:n,writable:a}=new TransformStream({start(t){r=t},flush:()=>{(async()=>{try{await e.close()}catch(t){try{await e.writer.writable.abort(t)}catch{}}})()}});return Oo(this,this.zipWriter.add(t,n),t=>r.error(t)),{readable:this.readable,writable:a}}writable(t){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}});return Oo(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){return await Promise.all(Array.from(this.se)),this.zipWriter.close(t,e)}}function Oo(t,e,r){t.se.add(e),e.catch(t=>{try{r(t)}catch{}})}function Uo(n,a,s){a=a.trim();let o=$o(n,s,Sa),i=$o(n,s,za,o?20:768);const c=$o(n,s,Da),l=ai(n,s,"uid"),u=ai(n,s,"gid");let d=ai(n,s,ka),f=$o(n,s,"unixExtraFieldType"),w=$o(n,s,va),h=$o(n,s,Ia),p=$o(n,s,Ca);if(st(l,t,fo),st(u,t,wo),st(d,e,ho),f!==O&&f!==xo&&f!==Ao)throw Error(po);if(f===Ao&&(l!==O&&l>e||u!==O&&u>e))throw Error(mo);f!==O||l===O&&u===O||(f=xo);let m=ai(n,s,ba),y=$o(n,s,Ea);const b=m!==O||y!==O;if(l!==O||u!==O||d!==O||f||c?(o=!1,i=i&r|768):b&&(o=!0,i&=r),st(m,r,yo),y&&(typeof y!==v||Array.isArray(y)))throw Error(bo);if(i>e)throw Error(Ks);let E=ri(n,s,pa,ya);const R=E!==O;R||(E=0),!s[Fa]&&a.endsWith(z)&&(s[Fa]=!0);const F=$o(n,s,Fa);if(F?(a.endsWith(z)||(a+=z),R||(E=16,o||(E|=16877<<16))):o||R||(E=c?493<<16:27525120),!o){const t=d!==O||!!(w||h||p);d=d===O?E>>16&e:d&e,w?d|=x:w=!!(d&x),h?d|=A:h=!!(d&A),p?d|=512:p=!!(512&d),R&&!t||(F?d=-61441&d|g:d&S||(d|=32768),E=(d&e)<<16|E&e)}return({msdosAttributesRaw:m,msdosAttributes:y}=((t,e)=>{if(t!==O)t&=r;else if(e!==O){const{readOnly:n,hidden:a,system:s,directory:o,archive:i}=e;let c=0;n&&(c|=1),a&&(c|=2),s&&(c|=4),o&&(c|=16),i&&(c|=32),t=c&r}return e===O&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(m,y)),b&&(E=E&t|m&r),{name:a,Ee:{versionMadeBy:i,msDosCompatible:!!o,externalFileAttributes:E,unixExternalUpper:E>>16&e,uid:l,gid:u,unixMode:d,unixExtraFieldType:f,symlink:d!==O&&40960==(d&S),setuid:w,setgid:h,sticky:p,msdosAttributesRaw:m,msdosAttributes:y}}}function To(t,r,n){const a=ei(t,n,"encodeText")||Pt;let s=a(r,K);if(s===O&&(s=Pt(r)),fi(s)>e)throw Error(qs);const o=n[ra]||"";if(typeof o!=I)throw Error(Zs);let i=a(o,Y);if(i===O&&(i=Pt(o)),fi(i)>e)throw Error(Vs);const c=$o(t,n,Aa,20);if(c>e)throw Error(Ks);const l=ti(t,n,ca,new Date),u=ti(t,n,ua),d=ti(t,n,fa),f=ri(t,n,ha,ma,0),w=$o(t,n,j),h=$o(t,n,M),p=$o(t,n,N);nt(h,p);const m=ai(t,n,"encryptionStrength",3),y=$o(t,n,Ra),b=$o(t,n,"extendedTimestamp",!0),E=$o(t,n,"ntfsTimestamp"),S=$o(t,n,"keepOrder",!0),g=$o(t,n,_),x=$o(t,n,L),A=$o(t,n,"bufferedWrite"),z=ei(t,n,"createTempStream"),R=$o(t,n,"dataDescriptorSignature",!0),F=rt($o(t,n,P)),D=$o(t,n,"useUnicodeFileNames",!0),U=$o(t,n,Oa),T=w||U===O?O:Ve(U);if(!w&&U!==O&&0!==U&&8!==U&&!T)throw Error("Compression method not supported");let k=ai(t,n,"level");if(st(k,9,Eo),t.options[H]){if(h!==O||p!==O)throw Error(Gs);k===O&&U===O&&(k=0)}w&&(k=O);let v=$o(t,n,W),C=$o(t,n,V);A&&C===O&&(C=!1),(C===O||y)&&(C=!0),k!==O&&6!=k&&(v=!1);const B=$o(t,n,ga);if(!(y||h===O&&p===O||Number.isInteger(m)&&m>=1&&m<=3))throw Error(Ys);const Z=ko(n[Ta]),q=ko(n.localExtraField);return{comment:o,Ee:{rawFilename:s,rawComment:i,version:c,lastModDate:l,lastAccessDate:u,creationDate:d,internalFileAttributes:f,passThrough:w,password:h,rawPassword:p,encryptionStrength:m,zipCrypto:y,extendedTimestamp:b,ntfsTimestamp:E,keepOrder:S,useWebWorkers:g,transferStreams:x,bufferedWrite:A,createTempStream:z,dataDescriptorSignature:R,signal:F,useUnicodeFileNames:D,compressionMethod:U,format:T?T.format:O,codecURI:T?T.codecURI:O,Be:T?T.versionNeeded:O,level:k,useCompressionStream:v,dataDescriptor:C,zip64:B,rawExtraField:Z,Ve:q}}}function ko(t){if(!t)return C;if(!(t instanceof Map))throw Error(Js);let r=0,n=0;t.forEach((t,n)=>{if(at(n,e,Qs),!(t instanceof Uint8Array))throw Error($s);if(fi(t)>e)throw Error(to);r+=4+fi(t)});const a=new Uint8Array(r),s=Ft(a);return t.forEach((t,e)=>{ci(s,n,e),ci(s,n+2,fi(t)),di(a,t,n+4),n+=4+fi(t)}),a}function vo(e,r,n,a,s){const{passThrough:o,zipCrypto:i,password:c,rawPassword:l,encryptionStrength:u}=a;let{dataDescriptor:d,zip64:f,level:w,compressionMethod:h}=a,p=0,m=0;if(o&&r){if(m=s[aa],m===O)throw Error(oo);if(h===O)throw Error(io)}const y=!0===f,b=$o(e,s,xa);if(r&&o&&!b&&fi(c,l))throw Error(Xs);const E=r&&(!!(c&&fi(c)||l&&fi(l))||o&&b);r||(w=0,h=0);const S=E?i?12:16+4*u:0;r&&(o?(s.uncompressedSize=m,p=n===O?si(m)+S:n):n===O?(d=!0,(f||f===O)&&(f=!0,m=p=4294967296)):(s.uncompressedSize=m=n,p=(oi(h,w)?si(m):m)+S));const g=!(E||r&&(0!==n||o)||oi(h,w));g&&!i&&$o(e,s,V)===O&&(d=!1);const x=y||m>=t,A=y||p>=t;if(x||A){if(!1===f)throw Error(so);f=!0}return f=f||!1,{Ze:p,Ee:{dataDescriptor:d,xe:g,zip64:f,me:x,pe:A,uncompressedSize:m,level:w,compressionMethod:h,encrypted:E}}}function Io(t){const{rawFilename:r,lastModDate:a,lastAccessDate:s,creationDate:o,level:i,zip64:c,zipCrypto:l,useUnicodeFileNames:u,dataDescriptor:d,directory:f,rawExtraField:w,Ve:m,encryptionStrength:E,extendedTimestamp:S,ntfsTimestamp:g,passThrough:x,encrypted:A,me:z,pe:U,uncompressedSize:T,crc32:k}=t;let{version:v,compressionMethod:I}=t;const M=!f&&oi(I,i);let N;const j=x||!M,P=c&&(t.bufferedWrite||!d||!z&&!U||j),_=P||c&&d&&(z||U);if(c&&(z||U)){const t=20,e=Po(t);if(e.je(1),e.je(t-4),N=e.Lt,P&&(e.Le(T),j)){const t=A?l?12:16+4*E:0;e.Le(x?0:T+t)}}else N=C;let W,L,B,V,Z;if(A&&!l){const t=Po(fi(go)+2);t.je(h),t.Pe(go),W=t.Lt,W[8]=E}else W=C;if(S){const t=Xo(a),e=Jo(t);if(e){const e=9+(s?4:0)+(o?4:0),r=Po(e);V=1+(s?2:0)+(o?4:0),r.je(p),r.je(e-4),r.He(V),r.Ne(t),s&&r.Ne(Qo(Xo(s))),o&&r.Ne(Qo(Xo(o))),B=r.Lt}else B=C;if(g===O?!e||s||o:g)try{const t=Go(a),e=Po(36);e.je(10),e.je(32),e.qe(4),e.je(1),e.je(24),e.Le(t),e.Le(s?Go(s):t),e.Le(o?Go(o):t),L=e.Lt}catch{L=C}else L=C}else L=B=C;try{const{uid:r,gid:n,unixExtraFieldType:a}=t;if(a!=xo||r===O&&n===O)if(a!=Ao||r===O&&n===O)Z=C;else{const t=Po(8);t.je(b),t.je(4),t.je((r===O?0:r)&e),t.je((n===O?0:n)&e),Z=t.Lt}else{const t=Mo(r===O?0:r),e=Mo(n===O?0:n),a=3+t.length+e.length,s=Po(4+a);s.je(y),s.je(a),s.He(1),s.He(t.length),s.Pe(t),s.He(e.length),s.Pe(e),Z=s.Lt}}catch{Z=C}I===O&&(I=M?8:0);const{Be:q}=t;M&&q!==O&&(v=v>q?v:q),c&&(v=v>45?v:45),A&&!l&&(v=v>51?v:51,x&&k!==O&&(W[4]=1),ci(Ft(W),9,I),I=99);const K=_?fi(N):0,Y=K+fi(W,B,L,Z,w,m);if(Y+(t[H]?67:0)>e)throw Error(to);const G=new Date(2e3*Math.ceil(Math.floor(a.getTime()/1e3)/2)),{we:X,he:J,rawLastModDate:Q}=wi({version:v,bitFlag:hi(i,u,d,A,I),compressionMethod:I,uncompressedSize:T,lastModDate:G<D?D:G>F?F:G,rawFilename:r,pe:U,me:z,extraFieldLength:Y}),$=Po(R+fi(r)+Y),tt=$.Lt,et=Ft(tt);return $.Ne(n),$.Pe(X),$.Pe(r),_&&$.Pe(N),$.Pe(W),$.Pe(B),$.Pe(L),$.Pe(Z),$.Pe(w),$.Pe(m),d&&(U||li(et,18,0),z||li(et,22,0)),{Se:tt,ke:et,we:X,he:J,lastModDate:a,rawLastModDate:Q,encrypted:A,compressed:M,version:v,compressionMethod:I,be:V,ce:C,Oe:K,ue:B,de:L,fe:Z,le:W,extraFieldLength:Y}}function Co(t,e){const{Ae:r}=t;let{Se:n,extraFieldLength:a}=r,s=64-(e+fi(n))%64;s<4&&(s+=64);const o=new Uint8Array(s),i=Ft(o);ci(i,0,m),ci(i,2,s-4);const c=n;r.Se=n=new Uint8Array(fi(c)+s),di(n,c),di(n,o,fi(c));const l=Ft(n);ci(l,28,a+s),r.ke=l,t.De+=s}function Mo(t){const e=new Uint8Array(4);Ft(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}function No({zip64:t,dataDescriptor:e,dataDescriptorSignature:r}){let n,a=C,o=0,i=t?20:12;return r&&(i+=4),e&&(a=new Uint8Array(i),n=Ft(a),r&&(o=4,li(n,0,s))),{ge:a,Ue:n,Te:o}}function jo(r){let n=0;for(const[,a]of r){const{rawFilename:r,le:s,rawComment:o,de:i,fe:c,rawExtraField:l,extendedTimestamp:u,be:d,lastModDate:f,me:w,pe:h,uncompressedSize:m,compressedSize:y}=a,b=a.offset>=t,E=a.diskNumberStart>=e;let S,g;if(b||E||w||h){const t=4+(w?8:0)+(h?8:0)+(b?8:0)+(E?4:0),e=Po(t);e.je(1),e.je(t-4),w&&e.Le(m),h&&e.Le(y),b&&e.Le(a.offset),E&&e.Ne(a.diskNumberStart),S=e.Lt}else S=C;a.ce=S,a.Me=b,a.ye=E;const x=Xo(f);if(u&&Jo(x)){const t=Po(9);t.je(p),t.je(5),t.He(d),t.Ne(x),g=t.Lt}else g=C;a.ue=g;const A=fi(S,s,i,c,g,l);if(A>e)throw Error(to);n+=46+fi(r,o)+A}return n}function Po(t){const e=new Uint8Array(t),r=Ft(e);let n=0;return{Lt:e,He:t=>{((t,e,r)=>{t.setUint8(e,r)})(r,n,t),n+=1},je:t=>{ci(r,n,t),n+=2},Ne:t=>{li(r,n,t),n+=4},Le:t=>{ui(r,n,BigInt(t)),n+=8},Pe:t=>{di(e,t,n),n+=fi(t)},qe:t=>n+=t}}function _o(t){const{diskNumber:e=0}=t;return e}function Wo(t){const{diskOffset:e=0}=t;return e}function Lo(t,e){const{availableSize:r=U}=t;return e>r}function Bo(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.ae:0)}function Vo(t){const e=Ft(t);let r=0;for(;r+4<=fi(t);){const n=4+ii(e,r+2);if(1==ii(e,r))return Vo(zt(t.subarray(0,r),t.subarray(Math.min(r+n,fi(t)))));r+=n}return t}async function Zo(t,e,r,n){if(n>0){const{writer:a}=t;await $n(e,{offset:r,size:n}).pipeTo(a.writable,{preventClose:!0,preventAbort:!0}),a.size+=n,t.offset+=n}}async function Ho(t,e){const r=await Qn(t,e,R);if(fi(r)<R)return R;const n=Ft(r);return R+ii(n,26)+ii(n,28)}function qo(t,{offset:e,diskNumberStart:r}){return e+(t.qt?t.qt(r):0)}function Ko(){const t=new Uint8Array(4);return li(Ft(t),0,a),t}async function Yo(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=fi(e),await n.write(e)}finally{n.releaseLock()}}function Go(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return e<no?no:e>ao?ao:e}}function Xo(t){return Math.floor(t.getTime()/1e3)}function Jo(t){return t>=eo&&t<=ro}function Qo(t){return Math.min(ro,Math.max(eo,t))}function $o(t,e,r,n){const a=e[r]===O?t.options[r]:e[r];return a===O?n:a}function ti(t,e,r,n){const a=$o(t,e,r,n);if(null===a)return n;if(a!==O&&(typeof a.getTime!=k||Number.isNaN(a.getTime())))throw Error(Hs);return a}function ei(t,e,r){return et($o(t,e,r))}function ri(t,e,r,n,a){const s=ni(e,r,n),o=s===O?ni(t.options,r,n):s;return o===O?a:o}function ni(t,e,r){return t[e]===O?t[r]:t[e]}function ai(t,e,r,n){return ot($o(t,e,r,n))}function si(t){return t+5*(Math.floor(t/16383)+1)}function oi(t,e){return t===O?e===O||e>0:0!==t}function ii(t,e){return t.getUint16(e,!0)}function ci(t,e,r){t.setUint16(e,r,!0)}function li(t,e,r){t.setUint32(e,r,!0)}function ui(t,e,r){t.setBigUint64(e,r,!0)}function di(t,e,r){t.set(e,r)}function fi(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function wi({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:a,compressedSize:s,lastModDate:o,rawLastModDate:i,rawFilename:c,pe:l,me:u,extraFieldLength:d}){const f=Po(26),w=f.Lt,h=Ft(w);if(f.je(e),f.je(r),f.je(n),i===O){const t=new Uint32Array(1),e=Ft(t);ci(e,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),ci(e,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),i=t[0]}return f.Ne(i),f.qe(4),l||s!==O?f.Ne(l?t:s):f.qe(4),u||a!==O?f.Ne(u?t:a):f.qe(4),f.je(fi(c)),f.je(d),{we:w,he:h,rawLastModDate:i}}function hi(t,e,r,n,a){let s=0;return e&&(s|=E),r&&(s|=8),8!=a&&9!=a||(t>=0&&t<=3&&(s|=6),t>3&&t<=5&&(s|=4),9==t&&(s|=2)),n&&(s|=1),s}function pi(){return"application/octet-stream"}const mi=1048576,yi=".zip.js-temp";function bi(t={}){const{thresholdBytes:e=mi,directoryName:r=yi,getDirectory:n=()=>navigator.storage.getDirectory()}=t;let a;function s(){return a||(a=Promise.resolve(n()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return()=>{const t=[];let r,n,a,o,i=0,c=!1;const l=new WritableStream({async write(o){c?await a.write(o):(t.push(o),i+=o.length,i>e&&await(async()=>{const e=await s();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join(""),n=await e.getFileHandle(r,{create:!0}),a=(await n.createWritable()).getWriter(),c=!0;for(const e of t)await a.write(e);t.length=0})())},async close(){a&&(await a.close(),a=null)}});let u=0;return{writable:l,readable:new ReadableStream({async pull(e){if(c){if(!o){const t=await n.getFile();o=t.stream().getReader()}const{value:t,done:r}=await o.read();r?e.close():e.enqueue(t)}else u<t.length?e.enqueue(t[u++]):e.close()},async cancel(t){o&&await o.cancel(t)}},{highWaterMark:0}),dispose:async()=>{if(a){try{await a.close()}catch{}a=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}n=r=null}t.length=0}}}}const Ei=1048576;function Si(t={}){const{thresholdBytes:e=Ei}=t;return()=>{const t=[];let r,n,a,s=0,o=!1;const i=new WritableStream({async write(a){o?await r.write(a):(t.push(a),s+=a.length,s>e&&await(async()=>{const e=new TransformStream;n=Ie(e.readable),r=e.writable.getWriter(),o=!0;for(const e of t)await r.write(e);t.length=0})())},async close(){r&&(await r.close(),r=null)}});let c=0;return{writable:i,readable:new ReadableStream({async pull(e){if(o){if(!a){const t=await n;a=t.stream().getReader()}const{value:t,done:r}=await a.read();r?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async()=>{if(r){try{await r.abort()}catch{}r=null}n&&(n.catch(()=>{}),n=null),t.length=0}}}}const gi=1048576,xi=".zip.js-temp",Ai="createSyncAccessHandle is only available in dedicated workers";function zi(t={}){const{thresholdBytes:e=gi,directoryName:r=xi,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw Error(Ai);const a=n||(()=>navigator.storage.getDirectory());let s;function o(){return s||(s=Promise.resolve(a()).then(t=>t.getDirectoryHandle(r,{create:!0}))),s}return()=>{const t=[];let r,n,a=0,s=!1,i=0,c=0;const l=new WritableStream({async write(c){s?(n.write(c,{at:i}),i+=c.length):(t.push(c),a+=c.length,a>e&&await(async()=>{const e=await o();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("");const a=await e.getFileHandle(r,{create:!0});n=await a.createSyncAccessHandle(),s=!0;for(const e of t)n.write(e,{at:i}),i+=e.length;t.length=0})())},close(){n&&n.flush()}});let u=0;return{writable:l,readable:new ReadableStream({pull(e){if(s){const t=i-c;if(t<=0)return void e.close();const r=new Uint8Array(Math.min(524288,t)),a=n.read(r,{at:c});a?(c+=a,e.enqueue(r.subarray(0,a))):e.close()}else u<t.length?e.enqueue(t[u++]):e.close()}},{highWaterMark:0}),dispose:async()=>{if(n){try{n.close()}catch{}n=null}if(r){try{const t=await o();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{xt({baseURI:import.meta.url})}catch{}let Ri,Fi,Di,Oi,Ui;function Ti(t,e,r={}){if(!Ri){const t=Error("WASM module not loaded");throw t.cause=Ui,t}const n="number"==typeof r.level?r.level:-1,a="number"==typeof r.outBuffer?r.outBuffer:65536,s="number"==typeof r.inBufferSize?r.inBufferSize:65536;return new TransformStream({start(){try{let r;if(this.Ke=Fi(a),this.in=Fi(s),this.inBufferSize=s,!this.Ke||!this.in)throw Error("allocation failed");if(this.Ye=new Uint8Array(a),t?(this.Ge=Ri.deflate_process,this.Xe=Ri.deflate_last_consumed,this.Je=Ri.deflate_end,this.Qe=Ri.deflate_new(),r="gzip"===e?Ri.deflate_init_gzip(this.Qe,n):"deflate-raw"===e?Ri.deflate_init_raw(this.Qe,n):Ri.deflate_init(this.Qe,n)):"deflate64-raw"===e?(this.Ge=Ri.inflate9_process,this.Xe=Ri.inflate9_last_consumed,this.Je=Ri.inflate9_end,this.Qe=Ri.inflate9_new(),r=Ri.inflate9_init_raw(this.Qe)):(this.Ge=Ri.inflate_process,this.Xe=Ri.inflate_last_consumed,this.Je=Ri.inflate_end,this.Qe=Ri.inflate_new(),r="deflate-raw"===e?Ri.inflate_init_raw(this.Qe):"gzip"===e?Ri.inflate_init_gzip(this.Qe):Ri.inflate_init(this.Qe)),0!==r)throw Error("init failed:"+r)}catch(t){throw o(this),t}},transform(e,r){try{const n=e,s=new Uint8Array(Oi.buffer),o=this.Ge,i=this.Xe,c=this.Ke,l=this.Ye;let u=0;for(;u<n.length;){const e=Math.min(n.length-u,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&Di&&(Di(this.in),this.in=0),this.in=Fi(e),this.inBufferSize=e,!this.in))throw Error("allocation failed");s.set(n.subarray(u,u+e),this.in);const d=o(this.Qe,this.in,e,c,a,0),f=16777215&d;if(f&&(l.set(s.subarray(c,c+f),0),r.enqueue(l.slice(0,f))),!t){const t=d>>24&255,e=128&t?t-256:t;if(e<0)throw Error("process error:"+e)}const w=i(this.Qe);if(0===w)break;u+=w}}catch(t){o(this),r.error(t)}},flush(e){try{const r=new Uint8Array(Oi.buffer),n=this.Ge,s=this.Ke,o=this.Ye;for(;;){const i=n(this.Qe,0,0,s,a,4),c=16777215&i,l=i>>24&255;if(!t){const t=128&l?l-256:l;if(t<0)throw Error("process error:"+t)}if(c&&(o.set(r.subarray(s,s+c),0),e.enqueue(o.slice(0,c))),1===l||0===c)break}}catch(t){e.error(t)}finally{const t=o(this);0!==t&&e.error(Error("end error:"+t))}},cancel(){o(this)}});function o(t){let e=0;return t.Qe&&t.Je&&(e=t.Je(t.Qe)),t.Qe=0,t.in&&Di&&Di(t.in),t.in=0,t.Ke&&Di&&Di(t.Ke),t.Ke=0,e}}class ki{constructor(t="deflate",e){return Ti(!0,t,e)}}class vi{constructor(t="deflate",e){return Ti(!1,t,e)}}ki.ut=!0,vi.ut=!0;let Ii,Ci=!1;function Mi(){Ii=null,(async()=>{await Promise.allSettled(_r.map(t=>(Gr(t),t.terminate()))),pr=O,mr=!1})(),Ci=!1,Ri=Fi=Di=Oi=Ui=null}(({$e:t})=>{br=t})({$e:t=>{if(!Ii){let{wasmURI:e}=t;typeof e==k&&(e=e()),Ii=(async(t,{baseURI:e})=>{if(!Ci)try{await(async(t,e)=>{let r,n;try{try{n=new URL(t,e)}catch{}const a=await fetch(n);r=await a.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;r=(t=>{const e=t.split(",")[1],r=atob(e),n=r.length,a=new Uint8Array(n);for(let t=0;t<n;++t)a[t]=r.charCodeAt(t);return a.buffer})(t)}(t=>{if(Ri=t,({malloc:Fi,free:Di,memory:Oi}=Ri),"function"!=typeof Fi||"function"!=typeof Di||!Oi)throw Ri=Fi=Di=Oi=null,Error("Invalid WASM module")})((await WebAssembly.instantiate(r)).instance.exports)})(t,e),Ci=!0}catch(t){throw(t=>{Ui=t})(t),t}})(e,t).catch(t=>{throw Ii=null,t})}return Ii}}),xt({CompressionStreamFallback:ki,DecompressionStreamFallback:vi}),xt({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const Ni="Entry filename already exists",ji="Readable stream already consumed",Pi="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",_i="Invalid readerOptions (must be an object)",Wi="zipjs-abort-export",Li="The operation was aborted",Bi=new Set([1,h,10,p,28789,25461,m,y,b,22613,13]);class Vi{constructor(t,e,r,n){const a=this;if(t.root&&n&&n.getChildByName(e))throw Error(Ni);r||(r={}),Object.assign(a,{fs:t,name:e,data:r.data,options:r.options&&Object.assign({},r.options),id:t.er++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,rr:r.rr||r.uncompressedSize===O,passThrough:r.passThrough,nr:r.nr||new Date}),!n&&t.root||(t.entries[a.id]=a),n&&a.parent.children.push(a)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,r=this.parent;for(;r&&r!=t;)e=(r.name?r.name+"/":"")+e,r=r.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return!!e}rename(t){const e=this.parent;if(e&&e.getChildByName(t))throw Error(Ni);this.name=t}setOptions(t){const e=Object.assign({},this.options,t);this.options=Object.fromEntries(Object.entries(e).filter(([,t])=>t!==O))}}class Zi extends Vi{constructor(t,e,r,n){super(t,e,r,n);const a=this;a.Reader=r.Reader,a.Writer=r.Writer,r.getData&&(a.getData=r.getData)}clone(){return new Zi(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data&&((t,e)=>{const{contentType:r}=t;return r===O||(t.constructor==Sn?e.type==r:t.constructor!=mn||e.startsWith("data:"+(r||"")+";base64,"))})(t,r.data))return r.data;{const n=r.reader=$i(r.Reader,r.data,e),a=r.uncompressedSize||n.size;await Promise.all([Xn(n),Xn(t,a)]);const s=rt(e.signal),o=((t,e,r,n)=>{const{onstart:a,onprogress:s,onend:o}=r,{readable:i}=e;return t.data instanceof Na||!a&&!s&&!o?i:ve(i).pipeThrough(new xr({onstart:a,onprogress:s,onend:o,size:e.size}),{signal:n})})(r,n,e,s),i=!Gn(t)&&!!e.preventClose;return r.uncompressedSize=n.size,await ve(o).pipeTo(Ce(t.writable),{signal:s,preventClose:i,preventAbort:i}),t.getData?t.getData():t.writable}}isPasswordProtected(){return!(!this.data||!this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,Object.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==Zt)return!1;throw t}}getText(t,e){return this.getData(new An(t),e)}getBlob(t,e){return this.getData(new Sn(t),e)}getData64URI(t,e){return this.getData(new mn(t),e)}getUint8Array(t){return this.getData(new Zn,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Rt(await this.getUint8Array(t)).buffer}replaceBlob(t){Object.assign(this,{data:t,Reader:En,Writer:Sn,reader:null})}replaceText(t){Object.assign(this,{data:t,Reader:gn,Writer:An,reader:null})}replaceData64URI(t){Object.assign(this,{data:t,Reader:pn,Writer:mn,reader:null})}replaceUint8Array(t){Object.assign(this,{data:t,Reader:Vn,Writer:Zn,reader:null})}replaceReadable(t){Object.assign(this,{data:null,Reader:Ji(t),Writer:null,reader:null})}}class Hi extends Vi{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new Hi(e.fs,e.name,e);return t&&(r.children=e.children.map(e=>{const n=e.clone(t);return n.parent=r,n})),r}addDirectory(t,e){return dc(this,t,{options:e},!0)}addText(t,e,r={}){return dc(this,t,{data:e,Reader:gn,Writer:An,options:r,uncompressedSize:xn(e)})}addBlob(t,e,r={}){return dc(this,t,{data:e,Reader:En,Writer:Sn,options:r,uncompressedSize:e.size})}addData64URI(t,e,r={}){let n=e.length;for(;"="==e.charAt(n-1);)n--;const a=e.indexOf(",")+1;return dc(this,t,{data:e,Reader:pn,Writer:mn,options:r,uncompressedSize:Math.floor(.75*(n-a))})}addUint8Array(t,e,r={}){return dc(this,t,{data:e,Reader:Vn,Writer:Zn,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return dc(this,t,{data:e,Reader:class extends Ln{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return dc(this,t,{Reader:Ji(e),options:r})}addFileSystemEntry(t,e={}){return cc(this,t,e)}addFileSystemHandle(t,e={}){return cc(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),dc(this,t.name,{data:t,Reader:()=>({readable:t.stream(),size:t.size}),options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new En(t),e)}importData64URI(t,e){return this.importZip(new pn(t),e)}importUint8Array(t,e){return this.importZip(new Vn(t),e)}importHttpContent(t,e){return this.importZip(new Ln(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new Sn(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new mn(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Zn,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return(async(t,e,r)=>{const{onstart:n,onprogress:a,onend:s}=r,o=sc(r.readerOptions),i=new AbortController,{signal:c}=i,l=((t,e)=>{if(!rt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const r=()=>e.abort(t.reason);return t.addEventListener("abort",r,{once:!0}),()=>t.removeEventListener("abort",r)})(r.signal,i),u=Object.assign({},r,o,{signal:c,onstart:O,onprogress:O,onend:O,preventClose:!1}),d=Yi([t],t=>Xi(t,u.passThrough)),f=[];let w=!1,h=0;try{n&&await Ar(n,d),await m(t,e),s&&await Ar(s,h)}catch(t){try{t.exportedEntryNames=f}catch{}throw t}finally{l()}return e;function p(t){const e=t.getWriter();return new WritableStream({async write(t){await e.write(t),h+=t.length,a&&await Ar(a,h,d)},close:()=>e.close(),abort:t=>e.abort(t)})}async function m(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>y(t,e)))).filter(t=>"rejected"==t.status);if(r.length){const t=r.filter(t=>!rc(t.reason));throw(t=>{const[e]=t,r=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(r.length)try{e.entryErrors=[...e.entryErrors||[],...r]}catch{}return e})((t.length?t:r).map(t=>t.reason))}}else for(const r of t.children)await y(r,e)}async function y(e,r){if(c.aborted){if(w||rc(c.reason))return;throw c.reason===O?new DOMException(Li,"AbortError"):c.reason}try{if(e.directory){const t=await r.getDirectoryHandle(e.name,{create:!0});await m(e,t)}else{const n=await r.getFileHandle(e.name,{create:!0}),a=await n.createWritable();try{await e.getData({writable:p(a)},u)}catch(t){throw w?Error(Wi):t}f.push(e.getRelativeName(t))}}catch(r){w=!0,i.abort(Error(Wi));try{r.entryName===O&&(r.entryName=e.getRelativeName(t),r.entryId=e.id)}catch{}throw r}}})(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==k?(r=t,e=Object.assign({},r.options,e)):(await Xn(t),r=new cs(t,e));const n=[],a=await r.getEntries(e);for(const t of a){let r=this;try{const a=t.filename.split("/").filter(t=>""!=t&&"."!=t),s=a.pop();if(a.forEach(t=>{const e=r;if(r=r.getChildByName(t),r){if(!r.directory)throw Error(Ni)}else r=new Hi(this.fs,t,{data:null},e),n.push(r)}),t.directory){let e=r;if(s)if(e=r.getChildByName(s),e){if(!e.directory)throw Error(Ni)}else e=new Hi(this.fs,s,{data:null},r),n.push(e);e==this||e.data||(e.data=t)}else n.push(dc(r,s,{data:t,Reader:Qi(Object.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}catch(e){try{e.cause={entry:t}}catch{}throw e}}return n}async exportZip(t,e={}){const r=this;(e=Object.assign({},e)).bufferedWrite===O&&(e.bufferedWrite=!0);const[n]=await Promise.all([tc(r,sc(e.readerOptions)),Xn(t)]),a=new Fo(t,e);return await(async(t,e,r,n,a)=>{const{onstart:s,onprogress:o,onend:i,onentryprogress:c}=n,l=e,u=Yi(e.children,t=>ic(t)?0:1);let d=0,f=0;if(s&&await Ar(s,r),n.bufferedWrite)await async function t(e){const r=(await Promise.allSettled(e.children.map(async e=>{await w(e),await t(e)}))).find(t=>"rejected"==t.status);if(r)throw r.reason}(e);else for(const t of e.getChildren({recursive:!0}))await w(t);async function w(e){if(ic(e))return;const{name:s,ar:i}=nc(e,l,n);let w=0;const h=await t.add(s,a.get(e),Object.assign(i,{onstart:O,onend:O,onprogress:async t=>{d+=t-w,w=t,o&&await Ar(o,d,r)}}));f++,c&&await Ar(c,f,u,h)}i&&await Ar(i,d)})(a,r,Yi([r],Gi),e,n),await a.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(r={}){const n=this;sc((r=Object.assign({},r)).readerOptions),r.bufferedWrite===O&&(r.bufferedWrite=!0);const a=!r.bufferedWrite||!1!==r.keepOrder&&n.children.every(t=>!t.children.length);return(async(r,n,a,s)=>{const o={options:r};if(et(r[q]))throw Error(co);if(s!==O&&!(s instanceof Uint8Array))throw Error(Bs);const i=fi(s);if(i>e)throw Error(Ls);const c=r[H],l=new Map;let u=!!c;const f=r[Z]===O?0:r[Z];let w=f,h=U;for(const t of n){let{name:e}=t;const{size:r}=t,n=Object.assign({},t.options);e=e.trim(),$o(o,n,Fa)&&!e.endsWith(z)&&(e+=z);const a=Uo(o,e,n);({name:e}=a);const{Ee:s}=To(o,e,n);0==s.level||s.compressionMethod!==O||s.passThrough||await Er(pt())||(s.level=0);const i=!$o(o,n,Fa);if(i&&r===O)throw Error(co);const{Ze:u,Ee:d}=vo(o,i,r,s,n);if(i&&!s.passThrough&&oi(d.compressionMethod,d.level))throw Error(co);const f=Object.assign({},n,a.Ee,s,d,{[H]:c}),p=Io(f),m=No(f),y={Ae:p,De:fi(p.Se,m.ge)};c&&Co(y,w);const b=i?u:0;l.set(e,Object.assign({},f,p,{offset:w,diskNumberStart:0,compressedSize:b}));const E=y.De+b;h=Math.min(h,E),w+=E}if(l.size&&w-h>=t&&(u=!0),u&&!a)throw Error(co);const p=jo(l);let m=$o(o,r,ga);if(w>=t||p>=t||l.size>=e){if(!1===m)throw Error(so);m=!0}return w-f+p+i+(m?98:d)})(r,n.getChildren({recursive:!0}).filter(t=>!ic(t)).map(t=>{const{name:e,ar:a}=nc(t,n,r);return{name:e,size:t.directory?0:ac(t,oc(t,r)),options:a}}),a,r.globalComment)}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}getChildren(t={}){return((t,e)=>{const r=[],n=[t];let a=0;for(;a<n.length;)for(const t of n[a++].children)r.push(t),e&&n.push(t);return r})(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const r=this.children;return!(await Promise.all(r.map(r=>r.checkPassword(t,e)))).includes(!1)}}class qi{constructor(){uc(this)}get children(){return this.root.children}remove(t){ec(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const r of t.children)e.push(r)}t.parent=O}move(t,e){if(t==this.root)throw Error("Root directory cannot be moved");if(!e.directory)throw Error("Target entry is not a directory");if(e.isDescendantOf(t))throw Error("Entry is a ancestor of target entry");if(t!=e){const r=e.getChildByName(t.name);if(r){if(r!=t)throw Error(Ni)}else ec(t),t.parent=e,e.children.push(t),((t,e)=>{const r=[e];for(;r.length;){const e=r.pop();t.entries[e.id]=e;for(const t of e.children)r.push(t)}})(this,t)}}find(t){const e=t.split("/");let r=this.root;for(let t=0;r&&t<e.length;t++)r=r.getChildByName(e[t]);return r||(r=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),r}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,r){return this.root.addText(t,e,r)}addBlob(t,e,r){return this.root.addBlob(t,e,r)}addData64URI(t,e,r){return this.root.addData64URI(t,e,r)}addUint8Array(t,e,r){return this.root.addUint8Array(t,e,r)}addHttpContent(t,e,r){return this.root.addHttpContent(t,e,r)}addReadable(t,e,r){return this.root.addReadable(t,e,r)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return uc(this),this.root.importBlob(t,e)}importData64URI(t,e){return uc(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return uc(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return uc(this),this.root.importHttpContent(t,e)}importReadable(t,e){return uc(this),this.root.importReadable(t,e)}importZip(t,e){return uc(this),this.root.importZip(t,e)}exportBlob(t){return this.root.exportBlob(t)}exportData64URI(t){return this.root.exportData64URI(t)}exportUint8Array(t){return this.root.exportUint8Array(t)}exportWritable(t,e){return this.root.exportWritable(t,e)}exportFileSystemHandle(t,e){return this.root.exportFileSystemHandle(t,e)}exportZip(t,e){return this.root.exportZip(t,e)}getExportedSize(t){return this.root.getExportedSize(t)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}}const Ki={FS:qi,ZipDirectoryEntry:Hi,ZipFileEntry:Zi};function Yi(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=e(t)||0;for(const e of t.children)n.push(e)}return r}function Gi(t){return t.uncompressedSize}function Xi(t,e){const{data:r}=t;return e&&r instanceof Na?r.compressedSize:t.uncompressedSize}function Ji(t){let e;return()=>{if(e)throw Error(ji);return e=!0,{readable:t}}}function Qi(t){return class extends wn{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=Object.assign({},t,e.options),{checkOverlappingEntry:n,checkOverlappingEntryOnly:a}=r,s=await e.entry.getData(new Sn,Object.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:a||n,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.sr=new En(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.sr.readUint8Array(t,e)}}}function $i(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function tc(t,e){const r=[],n=[t],a=new Map;for(;n.length;){const t=n.pop();for(const e of t.children)e.directory?n.push(e):r.push(e)}return await Promise.all(r.map(async t=>{const r=t.reader=$i(t.Reader,t.data,e);a.set(t,r);try{await Xn(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==O&&(t.uncompressedSize=r.size,t.rr=!1)})),a}function ec(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function rc(t){return!!t&&t.message==Wi}function nc(t,e,r){const n=r.relativePath?t.getRelativeName(e):t.getFullname(),a=t.options||{};let s={},o={};if(t.data instanceof Na){const{externalFileAttributes:e,versionMadeBy:n,comment:a,lastModDate:i,creationDate:c,lastAccessDate:l,uncompressedSize:u,encrypted:d,zipCrypto:f,crc32:w,compressionMethod:h,extraFieldAES:p,internalFileAttributes:m,extraField:y,uid:b,gid:E}=t.data;s={externalFileAttributes:e,versionMadeBy:n,comment:a,lastModDate:i,creationDate:c,lastAccessDate:l,internalFileAttributes:m};const S=(t=>{if(t){const e=new Map;if(t.forEach((t,r)=>{Bi.has(r)||e.set(r,t.data)}),e.size)return e}})(y);if(S&&(s.extraField=S),b===O&&E===O||Object.assign(s,{uid:b,gid:E,unixExtraFieldType:"infozip"}),oc(t,r)){let t;p&&(t=p.strength),o={passThrough:!0,encrypted:d,zipCrypto:f,crc32:w,uncompressedSize:u,encryptionStrength:t,compressionMethod:h}}}const i=Object.assign({lastModDate:t.nr},s,r,a,o,{directory:t.directory});if(!t.directory&&i.passThrough&&i.uncompressedSize===O)throw Error(Pi);return{name:n,ar:i}}function ac(t,e){const{reader:r}=t;return r&&r.size!==O?r.size:t.rr?O:Xi(t,e)}function sc(t){if(t&&(typeof t!=v||Array.isArray(t)))throw Error(_i);return t}function oc(t,e){const{readerOptions:r}=e;return!(t.directory||!(t.passThrough||r&&r.passThrough))}function ic(t){return t.directory&&null===t.data}function cc(t,e,r){return async function t(e,n,a,s=""){if(n){const o=s?s+"/"+n.name:n.name;try{if((n.isFile||n.isDirectory)&&(n=await lc(n)),"file"==n.kind){const t=await n.getFile();a.push(dc(e,t.name,{Reader:()=>({readable:t.stream(),size:t.size}),options:Object.assign({},{lastModDate:new Date(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==n.kind){const s=e.addDirectory(n.name,r);a.push(s);for await(const e of n.values())await t(s,e,a,o)}}catch(t){try{t.entryName===O&&(t.entryName=o)}catch{}throw t}}return a}(t,e,[])}async function lc(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new Promise((e,r)=>t.file(e,r))),t.isDirectory){e.kind="directory";const r=await(async t=>{const e=[];function r(t,n,a){t.readEntries(async s=>{if(s.length){for(const t of s)e.push(await lc(t));r(t,n,a)}else n(e)},a)}return await new Promise((e,n)=>r(t.createReader(),e,n)),{[Symbol.iterator](){let t=0;return{next(){const r={value:e[t],done:t==e.length};return t++,r}}}}})(t);e.values=()=>r}return e}function uc(t){t.entries=[],t.er=0,t.root=new Hi(t)}function dc(t,e,r,n){if(t.directory)return n?new Hi(t.fs,e,r,t):new Zi(t.fs,e,r,t);throw Error("Parent entry is not a directory")}export{En as BlobReader,Sn as BlobWriter,pn as Data64URIReader,mn as Data64URIWriter,Li as ERR_ABORTED,Ga as ERR_AMBIGUOUS_ARCHIVE,ja as ERR_BAD_FORMAT,Wa as ERR_CENTRAL_DIRECTORY_NOT_FOUND,Ws as ERR_DUPLICATED_NAME,Va as ERR_ENCRYPTED,Xa as ERR_ENCRYPTED_CENTRAL_DIRECTORY,Ya as ERR_ENTRY_DATA_OUT_OF_BOUNDS,Ni as ERR_ENTRY_EXISTS,_a as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,Pa as ERR_EOCDR_NOT_FOUND,Ba as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,tn as ERR_HTTP_RANGE,en as ERR_HTTP_RESOURCE_CHANGED,qt as ERR_INVALID_AUTHENTICATION_CODE,Me as ERR_INVALID_CODEC_DEFINITION,je as ERR_INVALID_CODEC_MODULE,Ls as ERR_INVALID_COMMENT,Bs as ERR_INVALID_COMMENT_TYPE,Ke as ERR_INVALID_COMPRESSED_DATA,Ye as ERR_INVALID_CRC32,Hs as ERR_INVALID_DATE,Ys as ERR_INVALID_ENCRYPTION_STRENGTH,Vs as ERR_INVALID_ENTRY_COMMENT,Zs as ERR_INVALID_ENTRY_COMMENT_TYPE,qs as ERR_INVALID_ENTRY_NAME,Js as ERR_INVALID_EXTRAFIELD,to as ERR_INVALID_EXTRAFIELD_DATA,$s as ERR_INVALID_EXTRAFIELD_DATA_TYPE,Qs as ERR_INVALID_EXTRAFIELD_TYPE,$a as ERR_INVALID_FILENAME_VALIDATION,Q as ERR_INVALID_FUNCTION_OPTION,wo as ERR_INVALID_GID,Eo as ERR_INVALID_LEVEL,ts as ERR_INVALID_MAX_APPENDED_DATA_SIZE,it as ERR_INVALID_MAX_WORKERS,yo as ERR_INVALID_MSDOS_ATTRIBUTES,bo as ERR_INVALID_MSDOS_DATA,Zt as ERR_INVALID_PASSWORD,tt as ERR_INVALID_PASSWORD_TYPE,Pi as ERR_INVALID_PASS_THROUGH,_i as ERR_INVALID_READER_OPTIONS,$ as ERR_INVALID_SIGNAL,Ht as ERR_INVALID_SIGNATURE,So as ERR_INVALID_SIGNATURE_DATA,Qa as ERR_INVALID_STRICTNESS,fo as ERR_INVALID_UID,qe as ERR_INVALID_UNCOMPRESSED_SIZE,po as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,mo as ERR_INVALID_UNIX_ID_SIZE,ho as ERR_INVALID_UNIX_MODE,Ks as ERR_INVALID_VERSION,rn as ERR_ITERATOR_COMPLETED_TOO_SOON,La as ERR_LOCAL_FILE_HEADER_NOT_FOUND,Ka as ERR_OVERLAPPING_ENTRY,ji as ERR_READABLE_CONSUMED,Ne as ERR_RESERVED_COMPRESSION_METHOD,qa as ERR_SPLIT_ZIP_FILE,io as ERR_UNDEFINED_COMPRESSION_METHOD,lo as ERR_UNDEFINED_READER,oo as ERR_UNDEFINED_UNCOMPRESSED_SIZE,co as ERR_UNDETERMINED_SIZE,Ja as ERR_UNSAFE_FILENAME,Ha as ERR_UNSUPPORTED_COMPRESSION,Ai as ERR_UNSUPPORTED_CONTEXT,Yt as ERR_UNSUPPORTED_CRYPTO_API,Za as ERR_UNSUPPORTED_ENCRYPTION,Xs as ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH,Gs as ERR_UNSUPPORTED_ENCRYPTION_USDZ,so as ERR_UNSUPPORTED_FORMAT,es as ERR_UNSUPPORTED_UINT64,hr as ERR_WORKER_STARTUP_TIMEOUT,nn as ERR_WRITER_NOT_INITIALIZED,uo as ERR_ZIP_NOT_EMPTY,Bn as HttpRangeReader,Ln as HttpReader,wn as Reader,Hn as SplitDataReader,qn as SplitDataWriter,gn as TextReader,An as TextWriter,Vn as Uint8ArrayReader,Zn as Uint8ArrayWriter,hn as Writer,Hi as ZipDirectoryEntry,Vi as ZipEntry,qi as ZipFS,Zi as ZipFileEntry,cs as ZipReader,ls as ZipReaderStream,Fo as ZipWriter,Do as ZipWriterStream,bt as configure,Si as createBlobTempStream,bi as createOPFSTempStream,zi as createSyncAccessHandleTempStream,Ki as fs,pi as getMimeType,Le as registerCodec,At as resetConfiguration,Mi as terminateWorkers,Be as unregisterCodec};
|
|
1
|
+
const t=4294967295,e=65535,r=255,n=67324752,o=134695760,a=o,i=84233040,s=33639248,c=101010256,u=101075792,l=117853008,f=46,d=22,w=20,h=56,p=39169,m=21589,y=6534,b=30837,E=30805,S=2048,g=61440,x=16384,A=2048,z=1024,R="/",D=30,F=new Date(2107,11,31,23,59,58),O=new Date(1980,0,1),U=void 0,k=1/0,T="undefined",v="function",I="object",M="string",C=new Uint8Array,N="password",j="rawPassword",B="passThrough",P="signal",_="useWebWorkers",W="useCompressionStream",L="transferStreams",V="preventClose",Z="dataDescriptor",H="offset",q="usdz",K="signCentralDirectory",Y="filename",G="comment",X="strict",J="balanced",Q="tolerant",$="Invalid option (must be a function)",tt="Invalid signal (must be an AbortSignal instance)",et="Invalid password (password must be a string, rawPassword must be a Uint8Array)";function rt(t){if(t&&typeof t!=v)throw new Error($);return t}function nt(t){if(t&&(typeof t.addEventListener!=v||"boolean"!=typeof t.aborted))throw new Error(tt);return t||U}function ot(t,e){if(t&&typeof t!=M||e&&!(e instanceof Uint8Array))throw new Error(et)}function at(t,e,r){if(!Number.isInteger(t)||t<0||t>e)throw new Error(r)}function it(t,e,r){t!==U&&at(t,e,r)}function st(t){return typeof t==M&&t.trim()?Number(t):t}const ct="Invalid maxWorkers (must be an integer greater than 0)";let ut=2;try{typeof navigator!=T&&navigator.hardwareConcurrency&&(ut=navigator.hardwareConcurrency)}catch{}const lt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:ut,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=T&&CompressionStream,DecompressionStream:typeof DecompressionStream!=T&&DecompressionStream},ft="maxWorkers",dt=["chunkSize",ft,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],wt=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],ht=["baseURI","wasmURI","workerURI","useCompressionStream","useWebWorkers","transferStreams",...dt,...wt],pt={...lt};function mt(){return pt}function yt(t){return bt(t.chunkSize)}function bt(t){return t=st(t),Number.isInteger(t)&&t>=1?Math.max(t,64):65536}function Et(t){Object.assign(pt,St(xt(t)))}function St(t){const e={};for(const r of ht){const n=t[r];n!==U&&(e[r]=gt(r,n))}return e}function gt(t,e){if(dt.includes(t)){if(e=st(e),t==ft&&(!Number.isInteger(e)||e<1))throw new Error(ct)}else wt.includes(t)&&rt(e);return e}function xt(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===U&&r===U)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===U&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===U&&(n.DecompressionStreamFallback=r),n}function At(t){const e=St(xt(t));Object.assign(lt,e),Object.assign(pt,e)}function zt(){for(const t of ht)delete pt[t];Object.assign(pt,lt)}function Rt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function Dt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function Ft(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const Ot=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?e>>>1^3988292384:e>>>1;Ot[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const r=Ot[e-1][t];Ot[e][t]=r>>>8^Ot[0][255&r]}const[Ut,kt,Tt,vt,It,Mt,Ct,Nt]=Ot;class jt{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const r=0|t.length;let n=0;if(r>=8&&t.buffer){const o=new DataView(t.buffer,t.byteOffset,r),a=r-8;for(;n<=a;n+=8){const t=e^o.getInt32(n,!0),r=o.getInt32(n+4,!0);e=Nt[255&t]^Ct[t>>>8&255]^Mt[t>>>16&255]^It[t>>>24&255]^vt[255&r]^Tt[r>>>8&255]^kt[r>>>16&255]^Ut[r>>>24&255]}}for(;n<r;n++)e=e>>>8^Ut[255&(e^t[n])];this.o=e}get(){return~this.o}}class Bt extends TransformStream{constructor(){let t;const e=new jt;super({transform(t,r){e.append(t),r.enqueue(t)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function Pt(t){if(typeof TextEncoder==T){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return e}return(new TextEncoder).encode(t)}const _t={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=_t.l(r);return 32===n?t.concat(e):_t.h(e,n,0|r,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+_t.l(r)},m(t,e){if(32*t.length<e)return t;const r=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,r>0&&e&&(t[r-1]=_t.S(e,t[r-1]&2147483648>>e-1,1)),t},S:(t,e,r)=>32===t?e:(r?0|e:e<<32-t)+1099511627776*t,l:t=>Math.round(t/1099511627776)||32,h(t,e,r,n){for(void 0===n&&(n=[]);e>=32;e-=32)n.push(r),r=0;if(0===e)return n.concat(t);for(let o=0;o<t.length;o++)n.push(r|t[o]>>>e),r=t[o]<<32-e;const o=t.length?t[t.length-1]:0,a=_t.l(o);return n.push(_t.S(e+a&31,e+a>32?r:n.pop(),1)),n}},Wt={bytes:{A(t){const e=_t.bitLength(t)/8,r=new Uint8Array(e);let n;for(let o=0;o<e;o++)3&o||(n=t[o/4]),r[o]=n>>>24,n<<=8;return r},R(t){const e=[];let r,n=0;for(r=0;r<t.length;r++)n=n<<8|t[r],3&~r||(e.push(n),n=0);return 3&r&&e.push(_t.S(8*(3&r),n)),e}}},Lt=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.F=[1518500249,1859775393,2400959708,3395469782],t?(e.O=t.O.slice(0),e.U=t.U.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.O=t.D.slice(0),t.U=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=Wt.v.R(t));const r=e.U=_t.concat(e.U,t),n=e.T,o=e.T=n+_t.bitLength(t);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const a=new Uint32Array(r);let i=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);t<=o;t+=e.blockSize)e.I(a.subarray(16*i,16*(i+1))),i+=1;return r.splice(0,16*i),e}M(){const t=this;let e=t.U;const r=t.O;e=_t.concat(e,[_t.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(t.T/4294967296)),e.push(0|t.T);e.length;)t.I(e.splice(0,16));return t.reset(),r}C(t,e,r,n){return t<=19?e&r|~e&n:t<=39?e^r^n:t<=59?e&r|e&n|r&n:t<=79?e^r^n:void 0}N(t,e){return e<<t|e>>>32-t}I(t){const e=this,r=e.O,n=Array(80);for(let e=0;e<16;e++)n[e]=t[e];let o=r[0],a=r[1],i=r[2],s=r[3],c=r[4];for(let t=0;t<=79;t++){t>=16&&(n[t]=e.N(1,n[t-3]^n[t-8]^n[t-14]^n[t-16]));const r=e.N(5,o)+e.C(t,a,i,s)+c+n[t]+e.F[Math.floor(t/20)]|0;c=s,s=i,i=e.N(30,a),a=o,o=r}r[0]=r[0]+o|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0}},Vt={importKey:t=>new Vt.j(Wt.bytes.R(t)),B(t,e,r,n){if(r=r||1e4,n<0||r<0)throw new Error("invalid params to pbkdf2");const o=1+(n>>5)<<2;let a,i,s,c,u;const l=new ArrayBuffer(o),f=new DataView(l);let d=0;const w=_t;for(e=Wt.bytes.R(e),u=1;d<(o||1);u++){for(a=i=t.encrypt(w.concat(e,[u])),s=1;s<r;s++)for(i=t.encrypt(i),c=0;c<i.length;c++)a[c]^=i[c];for(s=0;d<(o||1)&&s<a.length;s++)f.setInt32(d,a[s]),d+=4}return l.slice(0,n/8)},j:class{constructor(t){const e=this,r=e.P=Lt,n=[[],[]];e._=[new r,new r];const o=e._[0].blockSize/32;t.length>o&&(t=(new r).update(t).M());for(let e=0;e<o;e++)n[0][e]=909522486^t[e],n[1][e]=1549556828^t[e];e._[0].update(n[0]),e._[1].update(n[1]),e.W=new r(e._[0])}reset(){const t=this;t.W=new t.P(t._[0]),t.L=!1}update(t){this.L=!0,this.W.update(t)}digest(){const t=this,e=t.W.M(),r=new t.P(t._[1]).update(e).M();return t.reset(),r}encrypt(t){if(this.L)throw new Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},Zt=typeof crypto!=T&&typeof crypto.getRandomValues==v,Ht="Invalid password",qt="Invalid signature",Kt=qt,Yt="zipjs-abort-check-password",Gt="Crypto API not supported";function Xt(t){if(Zt)return crypto.getRandomValues(t);throw new Error(Gt)}const Jt=16,Qt={name:"PBKDF2"},$t=Object.assign({hash:{name:"HMAC"}},Qt),te=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Qt),ee=["deriveBits"],re=[8,12,16],ne=[16,24,32],oe=10,ae=[0,0,0,0],ie=typeof crypto!=T,se=ie&&crypto.subtle,ce=ie&&typeof se!=T,ue=Wt.bytes,le=class{constructor(t){const e=this;e.V=[[[],[],[],[],[]],[[],[],[],[],[]]],e.V[0][0][0]||e.Z();const r=e.V[0][4],n=e.V[1],o=t.length;let a,i,s,c=1;if(4!==o&&6!==o&&8!==o)throw new Error("invalid aes key size");for(e.F=[i=t.slice(0),s=[]],a=o;a<4*o+28;a++){let t=i[a-1];(a%o===0||8===o&&a%o===4)&&(t=r[t>>>24]<<24^r[t>>16&255]<<16^r[t>>8&255]<<8^r[255&t],a%o===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),i[a]=i[a-o]^t}for(let t=0;a;t++,a--){const e=i[3&t?a:a-4];s[t]=a<=4||t<4?e:n[0][r[e>>>24]]^n[1][r[e>>16&255]]^n[2][r[e>>8&255]]^n[3][r[255&e]]}}encrypt(t){return this.H(t,0)}decrypt(t){return this.H(t,1)}Z(){const t=this.V[0],e=this.V[1],r=t[4],n=e[4],o=[],a=[];let i,s,c,u;for(let t=0;t<256;t++)a[(o[t]=t<<1^283*(t>>7))^t]=t;for(let l=i=0;!r[l];l^=s||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,r[l]=a,n[a]=l,u=o[c=o[s=o[l]]];let f=16843009*u^65537*c^257*s^16843008*l,d=257*o[a]^16843008*a;for(let r=0;r<4;r++)t[r][l]=d=d<<24^d>>>8,e[r][a]=f=f<<24^f>>>8}for(let r=0;r<5;r++)t[r]=t[r].slice(0),e[r]=e[r].slice(0)}H(t,e){if(4!==t.length)throw new Error("invalid aes block size");const r=this.F[e],n=r.length/4-2,o=[0,0,0,0],a=this.V[e],i=a[0],s=a[1],c=a[2],u=a[3],l=a[4];let f,d,w,h=t[0]^r[0],p=t[e?3:1]^r[1],m=t[2]^r[2],y=t[e?1:3]^r[3],b=4;for(let t=0;t<n;t++)f=i[h>>>24]^s[p>>16&255]^c[m>>8&255]^u[255&y]^r[b],d=i[p>>>24]^s[m>>16&255]^c[y>>8&255]^u[255&h]^r[b+1],w=i[m>>>24]^s[y>>16&255]^c[h>>8&255]^u[255&p]^r[b+2],y=i[y>>>24]^s[h>>16&255]^c[p>>8&255]^u[255&m]^r[b+3],b+=4,h=f,p=d,m=w;for(let t=0;t<4;t++)o[e?3&-t:t]=l[h>>>24]<<24^l[p>>16&255]<<16^l[m>>8&255]<<8^l[255&y]^r[b++],f=h,h=p,p=m,m=y,y=f;return o}},fe=class{constructor(t,e){this.K=t,this.Y=e,this.G=e}reset(){this.G=this.Y}update(t){return this.X(this.K,t,this.G)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,r){let n;if(!(n=e.length))return[];const o=_t.bitLength(e);for(let o=0;o<n;o+=4){this.$(r);const n=t.encrypt(r);e[o]^=n[0],e[o+1]^=n[1],e[o+2]^=n[2],e[o+3]^=n[3]}return _t.m(e,o)}},de=Vt.j;let we=ie&&ce&&typeof se.importKey==v,he=ie&&ce&&typeof se.deriveBits==v;class pe extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:o=!0}){super({start(){ye(this,t,e,r)},async transform(t,e){const r=this,{password:o,strength:a,et:i,ready:s}=r;o?(await async function(t,e,r,n){const o=await Ee(t,e,r,ge(n,0,re[e])),a=ge(n,re[e]);if(o[0]!=a[0]||o[1]!=a[1])throw new Error(Ht)}(r,a,o,ge(t,0,re[a]+2)),t=ge(t,re[a]+2),n?e.error(new Error(Yt)):i()):await s;const c=new Uint8Array(t.length-oe-(t.length-oe)%Jt);e.enqueue(be(r,t,c,0,oe,!0))},async flush(t){const{nt:e,ot:r,it:n,ready:a}=this;if(r&&e){await a;const i=ge(n,0,n.length-oe),s=ge(n,n.length-oe);let c=C;if(i.length){const t=Ae(ue,i);r.update(t);const n=e.update(t);c=xe(ue,n)}const u=ge(xe(ue,r.digest()),0,oe);let l=n.length<oe?1:0;for(let t=0;t<oe;t++)l|=u[t]^s[t];if(l&&o)throw new Error(Kt);t.enqueue(c)}}})}}class me extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){ye(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:o,et:a,ready:i}=r;let s=C;n?(s=await async function(t,e,r){const n=Xt(new Uint8Array(re[e]));return Rt(n,await Ee(t,e,r,n))}(r,o,n),a()):await i;const c=new Uint8Array(s.length+t.length-t.length%Jt);c.set(s,0),e.enqueue(be(r,t,c,s.length,0))},async flush(t){const{nt:e,ot:r,it:n,ready:o}=this;if(r&&e){await o;let a=C;if(n.length){const t=e.update(Ae(ue,n));r.update(t),a=xe(ue,t)}const i=xe(ue,r.digest()).slice(0,oe);t.enqueue(Rt(a,i))}}})}}function ye(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.et=e),password:Se(e,r),strength:n-1,it:C})}function be(t,e,r,n,o,a){const{nt:i,ot:s,it:c}=t;c.length&&(e=Rt(c,e));const u=e.length-o;let l;for(r=function(t,e){if(e&&e>t.length){const r=t;(t=new Uint8Array(e)).set(r,0)}return t}(r,n+(u-u%Jt)),l=0;l<=u-Jt;l+=Jt){const t=Ae(ue,ge(e,l,l+Jt));a&&s.update(t);const o=i.update(t);a||s.update(o),r.set(xe(ue,o),l+n)}return t.it=ge(e,l),r}async function Ee(t,e,r,n){t.password=null;const o=await async function(t,e,r,n,o){if(!we)return Vt.importKey(e);try{return await se.importKey("raw",e,r,!1,o)}catch{return we=!1,Vt.importKey(e)}}(0,r,$t,0,ee),a=await async function(t,e,r){if(!he)return Vt.B(e,t.salt,te.iterations,r);try{return await se.deriveBits(t,e,r)}catch{return he=!1,Vt.B(e,t.salt,te.iterations,r)}}(Object.assign({salt:n},te),o,8*(2*ne[e]+2)),i=new Uint8Array(a),s=Ae(ue,ge(i,0,ne[e])),c=Ae(ue,ge(i,ne[e],2*ne[e])),u=ge(i,2*ne[e]);return Object.assign(t,{keys:{key:s,st:c,passwordVerification:u},nt:new fe(new le(s),Array.from(ae)),ot:new de(c)}),u}function Se(t,e){return e===U?Pt(t):e}function ge(t,e,r){return t.subarray(e,r)}function xe(t,e){return t.A(e)}function Ae(t,e){return t.R(e)}class ze extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){De(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=Fe(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw new Error(Ht);t=t.subarray(12)}n?e.error(new Error(Yt)):e.enqueue(Fe(r,t))}})}}class Re extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){De(this,t,e,r)},transform(t,e){const r=this;let n,o;if(r.password||r.rawPassword){r.password=r.rawPassword=null;const e=Xt(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(Oe(r,e),0),o=12}else n=new Uint8Array(t.length),o=0;n.set(Oe(r,t),o),e.enqueue(n)}})}}function De(t,e,r,n){Object.assign(t,{password:e,rawPassword:r,passwordVerification:n}),function(t,e,r){const n=[305419896,591751049,878082192];if(Object.assign(t,{keys:n,ct:new jt(n[0]),ut:new jt(n[2])}),r)for(let e=0;e<r.length;e++)Ue(t,r[e]);else for(let r=0;r<e.length;r++)Ue(t,e.charCodeAt(r))}(t,e,r)}function Fe(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=ke(t)^e[n],Ue(t,r[n]);return r}function Oe(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=ke(t)^e[n],Ue(t,e[n]);return r}function Ue(t,e){let[,r]=t.keys;t.ct.append([e]);const n=~t.ct.get();r=ve(Math.imul(ve(r+Te(n)),134775813)+1),t.ut.append([r>>>24]);const o=~t.ut.get();t.keys=[n,r,o]}function ke(t){const e=2|t.keys[2];return Te(Math.imul(e,1^e)>>>8)}function Te(t){return 255&t}function ve(t){return 4294967295&t}function Ie(t){if(t instanceof ReadableStream)return t;const e=t.getReader();return new ReadableStream({async pull(t){const{value:r,done:n}=await e.read();n?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}function Me(t,e){t=Ie(t);const r=e?{type:e}:{};if(typeof Blob.prototype.stream!=v||new Blob([]).stream()instanceof ReadableStream)return new Response(t).blob().then(t=>e?new Blob([t],r):t);const n=[];return t.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,r))}function Ce(t){if(t instanceof WritableStream)return t;const e=t.getWriter();return new WritableStream({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const Ne="Invalid codec definition",je="Reserved compression method",Be="Invalid codec module",Pe=[0,8,9,99],_e=new Map,We=new Map;function Le(t={}){const{compressionMethod:r,format:n,codecURI:o,CompressionStream:a,DecompressionStream:i,versionNeeded:s}=t;if(!Number.isInteger(r)||r<0||r>e||typeof n!=M||!n.length)throw new Error(Ne);if(Pe.includes(r))throw new Error(je);const c=typeof a==v||typeof i==v;if(!(c||typeof o==M&&o.length))throw new Error(Ne);_e.set(r,{compressionMethod:r,format:n,codecURI:o,versionNeeded:s}),c&&qe(n,{CompressionStream:a,DecompressionStream:i})}function Ve(t){const e=_e.get(t);if(e){let r;_e.delete(t),_e.forEach(t=>r=r||t.format==e.format),r||We.delete(e.format)}}function Ze(t){return _e.get(t)}function He(t){return We.get(t)}function qe(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=v&&typeof n!=v)throw new Error(Be);We.set(t,{CompressionStream:r,DecompressionStream:n})}const Ke="Invalid uncompressed size",Ye="Invalid compressed data",Ge=qt,Xe="deflate-raw",Je="gzip",Qe=[31,139,8];class $e extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:o,encrypted:a,useCompressionStream:i,zipCrypto:s,computeCrc32:c,level:u,deflate64:l,format:f,compressionMethod:d}=t,w=this;let h,p,m,y=super.readable;const b=f&&He(f),E=c&&o&&!l&&!b&&(!a||s)&&Boolean(i&&n);if(a&&!s||!c||E||(h=new Bt,y=cr(y,h)),o)if(b)y=ur(y,ir(b.CompressionStream,f,{level:u,chunkSize:e,compressionMethod:d}));else if(E)m=new tr,y=ur(y,new n(Je)),y=cr(y,m);else try{y=sr(y,i,{level:u,chunkSize:e},n,r)}catch(t){let e;try{e=new n(Je)}catch{throw t}y=ur(y,e),y=cr(y,new tr)}a&&(s?y=cr(y,new Re(t)):(p=new me(t),y=cr(y,p))),ar(w,y,()=>{a&&!s||!c||(w.crc32=E?m.crc32:new DataView(h.value.buffer).getUint32(0))})}}class tr extends TransformStream{constructor(){let t,e=10,r=new Uint8Array(0);super({transform(t,n){if(e){const r=Math.min(e,t.length);if(e-=r,!(t=t.subarray(r)).length)return}const o=r.length+t.length;if(o<=8)return void(r=Rt(r,t));const a=o-8,i=Math.min(a,r.length);n.enqueue(Rt(r.subarray(0,i),t.subarray(0,a-i))),r=Rt(r.subarray(i),t.subarray(a-i))},flush(){const e=Ft(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class er extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:o,encrypted:a,checkCrc32:i,crc32:s,compressed:c,useCompressionStream:u,deflate64:l,format:f,compressionMethod:d,rawBitFlag:w,outputSize:h}=t;let p,m,y=super.readable;if(a&&(o?y=cr(y,new ze(t)):(m=new pe(t),y=cr(y,m))),c){const t=f&&He(f);if(t)y=ur(y,ir(t.DecompressionStream,f,{chunkSize:e,compressionMethod:d,rawBitFlag:w,uncompressedSize:h}));else try{y=sr(y,u,{chunkSize:e,deflate64:l},n,r)}catch(t){if(l||h===U)throw t;let e;try{e=new n(Je)}catch{throw t}y=function(t,e,r){const n=new jt;let o,a,i,s=0,c=!1;const u=new Promise((t,e)=>{a=t,i=e});u.catch(()=>{}),r||a();const l=new TransformStream({start(t){const e=new Uint8Array(10);e.set(Qe),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,d();try{await u}finally{w()}const e=new Uint8Array(8),o=Ft(e);o.setUint32(0,n.get(),!0),o.setUint32(4,r,!0),t.enqueue(e)},cancel(t){i(t)}}),f=new TransformStream({transform(t,e){n.append(t),s+=t.length,s>=r?a():c&&d(),e.enqueue(t)},cancel(t){i(t)}});return t=cr(t,l),cr(t=ur(t,e),f);function d(){w(),o=setTimeout(()=>i(new Error(Ke)),5e3)}function w(){clearTimeout(o)}}(y,e,h)}y=function(t){const e=t.getReader();return new ReadableStream({async pull(t){let r;try{r=await e.read()}catch(t){if(t&&t.message)throw t;const e=new Error(Ye);throw e.cause=t,e}const{value:n,done:o}=r;o?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}(y)}i&&(p=new Bt,y=cr(y,p)),ar(this,y,()=>{if(i){const t=new DataView(p.value.buffer);if(s!=t.getUint32(0,!1))throw new Error(Ge)}})}}const rr=new Map;function nr(t,e){if(!t)return!1;let r=rr.get(t);r||(r=new Map,rr.set(t,r));let n=r.get(e);if(n===U){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function or(t){return nr(t,Xe)}function ar(t,e,r){e=cr(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function ir(t,e,r){if(!t)throw new Error("Compression method not supported");return new t(e,r)}function sr(t,e,r,n,o){const a=e&&n?n:o||n,i=r.deflate64?"deflate64-raw":Xe;let s;try{s=new a(i,r)}catch(t){if(!e||!o||a==o)throw t;s=new o(i,r)}return ur(t,s)}function cr(t,e){return Ie(t).pipeThrough(e)}function ur(t,e){const r=e.writable.getWriter(),n=t.getReader();return async function(){try{for(;;){await r.ready;const t=await n.read();if(t.done){await r.close();break}await r.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(r,t),await async function(t,e){try{await t.cancel(e)}catch{}}(n,t)}}(),e.readable}const lr="data",fr="deflate",dr="inflate";class wr extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let o;n.startsWith(fr)?o=$e:n.startsWith(dr)&&(o=er),r.outputSize=0;let a=0;const i=new o(t,e),s=super.readable,c=new TransformStream({transform(t,e){t&&t.length&&(a+=t.length,e.enqueue(t))},flush(){Object.assign(r,{inputSize:a})}}),u=new TransformStream({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==U&&r.outputSize>t.outputSize))throw new Error(Ke)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:a})}});Object.defineProperty(r,"readable",{get:()=>s.pipeThrough(c).pipeThrough(i).pipeThrough(u)})}}class hr extends TransformStream{constructor(t){const e=[];let r=0;function n(){const n=new Uint8Array(t);let o=0;for(;o<t;){const r=e[0],a=t-o;r.length<=a?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,a),o),e[0]=r.subarray(a),o+=a)}return r-=t,n}(!Number.isFinite(t)||t<1)&&(t=65536),super({transform(o,a){for(e.push(o),r+=o.length;r>t;)a.enqueue(n())},flush(t){r&&t.enqueue(function(t,e){const r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r}(e,r))}})}}const pr="Worker startup timeout";let mr,yr,br,Er=()=>{};async function Sr(t){const{CompressionStream:e,CompressionStreamFallback:r}=t;if(r&&!r.lt)return!0;if(or(e)||nr(e,Je))return!0;if(r)try{return await Er(t),!0}catch{return!1}return!1}function gr(t){t.createWorker?yr=!0:mr=!1}class xr{constructor(t,{readable:e,writable:r},{options:n,config:o,ft:a,useWebWorkers:i,transferStreams:s,workerURI:c,createWorker:u},l){const{signal:f}=a;return yr&&(u=U),Object.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new hr(yt(o))).pipeThrough(new Ar(a),{signal:f}),writable:r,options:Object.assign({},n),workerURI:c,createWorker:u,transferStreams:s,terminate:()=>new Promise(e=>{const{yt:r,wt:n}=t;r?(n?t.bt=e:(r.terminate(),e()),t.Et=null):e()}),St(){if(t.wt){const{bt:e}=t;e&&(t.bt=null,t.gt=!0,t.yt.terminate(),e()),t.wt=!1,l(t)}}}),mr===U&&(mr=typeof Worker!=T),(i&&br&&(mr&&c||u)?br:Rr)(t,o)}}class Ar extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let o=0;super({async start(){t&&await zr(t,r)},async transform(t,n){o+=t.length,e&&await zr(e,o,r),n.enqueue(t)},async flush(){n&&await zr(n,o)}})}}async function zr(t,...e){try{await t(...e)}catch{}}function Rr(t,e){return{run:()=>Dr(t,e)}}async function Dr({options:t,readable:e,writable:r,St:n},o){let a;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(fr),r=e?o.CompressionStreamFallback:o.DecompressionStreamFallback,n=e?o.CompressionStream:o.DecompressionStream;if(t.useCompressionStream){if(r&&r.lt&&!or(n))try{await Er(o)}catch{}}else try{await Er(o)}catch{r&&!r.lt||(t.useCompressionStream=!0)}}a=new wr(t,o),await e.pipeThrough(a).pipeThrough(new hr(yt(o))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{crc32:n,inputSize:i,outputSize:s}=a;return{crc32:n,inputSize:i,outputSize:s}}catch(t){throw a&&(t.outputSize=a.outputSize),t}finally{n()}}const Fr={type:"module"},Or="error";let Ur,kr,Tr,vr=!0;try{vr=typeof structuredClone==v&&structuredClone(new DOMException("","AbortError")).code!==U}catch{}var Ir;function Mr(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Cr(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.Et=null}function Nr(t,e,r,n,o=!0){const{createWorker:a}=r;let i,s,c;if(a)i=a();else if(kr===U||Ur!==t){const a=typeof t==v;s=a?t(o):t;const u=s.startsWith("data:"),l=s.startsWith("blob:");if(u||l){n===U&&(n=!1),n&&(c=Fr);try{i=new Worker(s,c)}catch(o){if(l)try{URL.revokeObjectURL(s)}catch{}if(a&&l)return Nr(t,e,r,n,!1);if(n)throw o;return Nr(t,e,r,!0,!1)}}else{n===U&&(n=!0),n&&(c=Fr);try{s=new URL(s,e)}catch{}try{i=new Worker(s,c)}catch(a){if(n)return Nr(t,e,r,!1,o);throw a}}Ur=t,kr=s,Tr=c}else i=new Worker(kr,Tr);return i.addEventListener("message",t=>{r.xt=!0,jr(r),async function({data:t},e){const{type:r,value:n,messageId:o,result:a,error:i}=t,{reader:s,writer:c,At:u,zt:l,St:f,ht:d}=e,w=()=>e.ht!=d;try{if(i){const{message:t,stack:e,code:r,name:n,outputSize:o,cause:a,codecImportFailed:s}=i,c=new Error(t);Object.assign(c,{stack:e,code:r,name:n,outputSize:o}),a&&(c.cause=Object.assign(new Error(a.message),{name:a.name})),s&&(c.codecImportFailed=!0),h(c)}else{if("pull"==r){const{value:t,done:r}=await s.read();w()||Pr({type:lr,value:t,done:r,messageId:o},e)}r==lr&&(await c.ready,await c.write(new Uint8Array(n)),w()||Pr({type:"ack",messageId:o},e)),"close"==r&&h(null,a)}}catch(i){w()||(Cr(e),h(i))}function h(t,e){w()||(t?l(t):u(e),c&&c.releaseLock(),t&&t.codecImportFailed||f())}}(t,r)}),i.addEventListener(Or,t=>Br(t,r)),i.addEventListener("messageerror",t=>Br(t,r)),i}function jr(t){const{Rt:e}=t;e&&(clearTimeout(e),t.Rt=null)}function Br(t,e){t.preventDefault&&t.preventDefault(),jr(e);const{xt:r,zt:n,writer:o,St:a}=e;Cr(e),r||(e.yt=null);let i=t.error||new Error(t.message||Or);r||(i=Object.assign(new Error(i.message||Or),{Dt:!0}),e.Ft=i),n&&(n(i),o&&o.releaseLock(),r&&a())}function Pr(t,{yt:e,writer:r,transferStreams:n,xt:o}){try{const{value:r,readable:a,writable:i}=t,s=[];if(r&&(t.value=Dt(r),s.push(t.value.buffer)),n&&vr&&o?(a&&s.push(a),i&&s.push(i)):t.readable=t.writable=null,s.length)try{return e.postMessage(t,s),!0}catch{vr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}Ir=function(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:o}=e;let{wasmURI:a}=e;if(!t.Et){let i;typeof a==v&&(a=a());try{i=Nr(t.workerURI,r,t)}catch{return gr(t),Rr(t,e)}Object.assign(t,{yt:i,xt:!1,gt:!1,Ft:null,Et:{run:async()=>{try{return await async function(t,e){if(!t.yt){const{Ft:e}=t;t.Ft=null;const r=e||new Error(pr);throw r.Dt=!0,r}let r,n;const o=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,At:r,zt:n,result:o});const{readable:a,options:i}=t,{writable:s,closed:c,Ot:u}=function(t){const e=new AbortController,{writable:r,readable:n}=new TransformStream,o=n.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:r,closed:o,Ot:()=>e.abort()}}(t.writable);let l;try{l=Pr({type:"start",options:i,config:e,readable:a,writable:s},t)}catch(e){u();try{await c}catch{}throw t.St(),e}l||Object.assign(t,{reader:a.getReader(),writer:s.getWriter()});const{workerStartupTimeout:f}=e;!t.xt&&Number.isFinite(f)&&f>=0&&(t.Rt=setTimeout(()=>function(t){if(t.Rt=null,t.xt)return;const{zt:e,writer:r}=t;if(Cr(t),t.yt=null,e){const t=new Error(pr);t.Dt=!0,e(t),r&&r.releaseLock()}}(t),f));try{const t=await o;return await d(),await c,t}catch(t){await d(),u();try{await c}catch{}throw t}async function d(){if(!l&&!s.locked)try{await s.getWriter().close()}catch{}}}(t,{chunkSize:n,wasmURI:a,baseURI:r,workerStartupTimeout:o})}catch(r){if(r&&r.Dt)return gr(t),Mr(t),Dr(t,e);if(r&&r.codecImportFailed){if(t.reader)return Mr(t),Dr(t,e);t.St()}throw r}}}})}return t.Et},br=Ir;let _r=[];const Wr=[];let Lr,Vr,Zr=0;async function Hr(t,e){const{options:r,config:n}=e,{transferStreams:o,useWebWorkers:a,useCompressionStream:i,compressed:s,checkCrc32:c,computeCrc32:u,encrypted:l,format:f,codecURI:d}=r,{workerURI:w,createWorker:h,maxWorkers:p}=n;f&&(d&&(r.codecURI=function(t,e){try{return new URL(t,e).toString()}catch{return t}}(d,n.baseURI)),await async function(t,e){!We.has(t)&&e&&qe(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(f,r.codecURI)),e.transferStreams=!f&&(o||o===U&&n.transferStreams);const m=!(s||c||u||l),y=f===U||Boolean(r.codecURI);return e.useWebWorkers=!m&&y&&(a||a===U&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:U,e.createWorker=e.useWebWorkers&&h?h:U,r.useCompressionStream=i||i===U&&n.useCompressionStream,(await async function(){const r=_r.find(t=>!t.wt);if(r)return Xr(r),new xr(r,t,e,b);if(_r.length<p){const r={Ut:Zr};return Zr++,_r.push(r),new xr(r,t,e,b)}return new Promise(r=>{Wr.push({resolve:r,stream:t,kt:e}),Vr=n.workerStarvationTimeout,qr()})}()).run();function b(t){if(Kr(),Wr.length){const[{resolve:e,stream:r,kt:n}]=Wr.splice(0,1);e(new xr(t,r,n,b)),qr()}else t.yt?(Xr(t),function(t,e){const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.gt?t.gt=!1:t.Tt=setTimeout(async()=>{_r=_r.filter(e=>e!=t);try{await t.terminate()}catch{}},n))}(t,e)):_r=_r.filter(e=>e!=t)}}function qr(){!Lr&&Wr.length&&Number.isFinite(Vr)&&Vr>=0&&(Lr=setTimeout(Yr,Vr))}function Kr(){Lr&&(clearTimeout(Lr),Lr=null)}function Yr(){if(Lr=null,Wr.length){const[{resolve:t,stream:e,kt:r}]=Wr.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:U,createWorker:U});t(new xr({},e,n,Gr)),qr()}}function Gr(){Kr(),qr()}function Xr(t){const{Tt:e}=t;e&&(clearTimeout(e),t.Tt=null)}const Jr="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),Qr=256==Jr.length;function $r(t,e){return tn(t,e,!0)}function tn(t,e,r){return e&&"cp437"==e.trim().toLowerCase()?function(t){if(Qr){let e="";for(let r=0;r<t.length;r++)e+=Jr[t[r]];return e}return(new TextDecoder).decode(t)}(t):new TextDecoder(e,{ignoreBOM:r}).decode(t)}const en="HTTP error ",rn="HTTP Range not supported",nn="HTTP resource changed",on="Writer iterator completed too soon",an="Writer not initialized",sn="Content-Range",cn="Range",un="GET",ln="bytes",fn=16777216,dn="writable",wn=Symbol();class hn{constructor(){this.size=0}init(){this.initialized=!0}}class pn extends hn{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=yt(mt())}={}){const n=this;let o=0;return r=bt(r),new ReadableStream({async pull(a){const i=e===U?r:Math.min(r,e-o),s=await to(n,t+o,i);s.length&&a.enqueue(s),o+r>=e||!s.length&&i?a.close():o+=r}})}}class mn extends hn{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw new Error(an);return t.writeUint8Array(Dt(e))}});Object.defineProperty(t,dn,{get:()=>e})}writeUint8Array(){}}class yn extends pn{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{vt:t,It:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{It:r,vt:n}=this,o=new Uint8Array(e),a=4*Math.floor(t/3),i=atob(n.substring(a+r,4*Math.ceil((t+e)/3)+r)),s=t-3*Math.floor(a/4);let c=0;for(let t=s;t<s+e&&t<i.length;t++)o[t-s]=i.charCodeAt(t),c++;return c<o.length?o.subarray(0,c):o}}class bn extends mn{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Mt:""})}writeUint8Array(t){const e=this;let r,n=e.Mt;const o=e.Mt.length;for(e.Mt="",r=0;r<3*Math.floor((o+t.length)/3)-o;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.Mt+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.Mt=n+e.Mt}getData(){return this.data+btoa(this.Mt)}}let En,Sn;class gn extends pn{constructor(t){super(),Object.assign(this,{Ct:t,size:t.size}),Sn||(Sn=(async()=>{try{const t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader();let e=0,r=await t.read();for(;!r.done;)e+=r.value.length,r=await t.read();En=1==e}catch{En=!1}})())}createReadable(t){const{Ct:e,size:r}=this,{offset:n=0,size:o=r-n}=t||{};return!n&&o>=r?Ie(e.stream()):En?Ie(e.slice(n,n+o).stream()):super.createReadable(t)}async readUint8Array(t,e){const r=this,n=t+e,o=!t&&n>=r.size?r.Ct:r.Ct.slice(t,n);let a=await o.arrayBuffer();return a.byteLength>e&&(a=a.slice(t,n)),new Uint8Array(a)}}class xn extends hn{constructor(t){super();const e=this,r=new TransformStream;Object.defineProperty(e,dn,{get:()=>r.writable}),e.contentType=t,e.Nt=Me(r.readable,t),e.Nt.catch(()=>{})}getData(){return this.Nt}}class An extends gn{constructor(t){super(new Blob([t],{type:"text/plain"}))}}function zn(t){let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);n<128?e+=1:n<2048?e+=2:n<55296||n>=57344?e+=3:n<56320&&56320==(64512&t.charCodeAt(r+1))?(e+=4,r++):e+=3}return e}class Rn extends xn{constructor(t){super(),Object.assign(this,{encoding:t,jt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,jt:e}=this,r=await super.getData();return r.text&&e?r.text():function(t,e){return tn(t,e,!1)}(new Uint8Array(await r.arrayBuffer()),t)}}class Dn extends pn{constructor(t,e){super(),On(this,t,e)}async init(){await Un(this,Wn,jn),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:o}=e;if((r||n)&&o!==U){const{offset:r=0,size:n=o-r}=t||{};if(n>0&&r<o)return function(t,e,r){let n,o=e,a=0,i=r;return new ReadableStream({start:()=>s(),async pull(t){n||await s();const{value:e,done:r}=await n.read();if(r)throw new Error(rn);const o=e.length>a?e.subarray(0,a):e;a-=o.length,i-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=n;n=U,await t.cancel()}(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function s(){const e=Math.min(t.maximumRangeSize,i),r=await Wn(un,t,Cn(t,o,e));if(206!=r.status)throw new Error(rn);const s=r.headers.get(sn);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=o)throw new Error(rn)}Mn(t,r),In(t,r),o+=e,a=e,n=r.body.getReader()}}(e,r,Math.min(n,o-r))}return super.createReadable(t)}readUint8Array(t,e){return kn(this,t,e,Wn,jn)}}class Fn extends pn{constructor(t,e){super(),On(this,t,e)}async init(){await Un(this,Ln,Bn),super.init()}readUint8Array(t,e){return kn(this,t,e,Ln,Bn)}}function On(t,e,r){const{preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s=!0,maximumRangeSize:c=fn,fetch:u}=r;delete(r=Object.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,Object.assign(t,{url:e,options:r,preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s,maximumRangeSize:c,fetch:u})}async function Un(t,e,r){const{url:n,preventHeadRequest:o,useRangeHeader:a,forceRangeRequests:i,combineSizeEocd:s}=t;if(function(t){const{baseURI:e}=mt(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r}(n)&&(a||i)&&(typeof o==T||o)){const n=await e(un,t,Cn(t,s?-22:void 0)),o=n.headers.get("Accept-Ranges");if(!(i||o&&o.toLowerCase()==ln))throw new Error(rn);{if(s){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Bt=e)}In(t,n);const o=Tn(n);o===U?await _n(t,e,r):t.size=o}}else await _n(t,e,r)}async function kn(t,e,r,n,o){const{useRangeHeader:a,forceRangeRequests:i,Bt:s,size:c,options:u}=t;if(a||i){if(s&&e==c-d&&r==d)return s;if(e>=c||0===r)return C;{e+r>c&&(r=c-e);const o=await n(un,t,Cn(t,e,r));if(206!=o.status)throw new Error(rn);const a=o.headers.get(sn);if(a){const t=Number(a.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw new Error(rn)}Mn(t,o),In(t,o);const i=new Uint8Array(await o.arrayBuffer());if(i.length!=r)throw new Error(rn);return i}}{const{data:n}=t;return n||await o(t,u),t.data.subarray(e,e+r)}}function Tn(t){const e=t.headers.get(sn);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function vn({headers:t}){return{Pt:t.get("Etag")||U,lastModified:t.get("Last-Modified")||U}}function In(t,e){const{checkResourceChanges:r,_t:n}=t;r&&!n&&206==e.status&&(t._t=vn(e))}function Mn(t,e){const{checkResourceChanges:r,_t:n,size:o}=t;if(r){const t=Tn(e);if(t!==U&&o!==U&&t!=o)throw new Error(nn);if(n){const t=vn(e);if(Object.entries(n).some(([e,r])=>r!==U&&t[e]!==U&&r!=t[e]))throw new Error(nn)}}}function Cn(t,e=0,r=1){return Object.assign({},Nn(t),{[cn]:ln+"="+(e<0?e:e+"-"+(e+r-1))})}function Nn({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function jn(t){await Pn(t,Wn)}async function Bn(t){await Pn(t,Ln)}async function Pn(t,e){const r=await e(un,t,Nn(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function _n(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Nn(t)),o=n.headers.get("Content-Length");o&&!n.headers.get("Content-Encoding")?t.size=Number(o):await r(t,t.options)}}async function Wn(t,{fetch:e=fetch,options:r,url:n},o){const a=await e(n,Object.assign({},r,{method:t,headers:o}));if(a.status<400)return a;throw 416==a.status?new Error(rn):new Error(en+(a.statusText||a.status))}function Ln(t,{url:e},r){return new Promise((n,o)=>{const a=new XMLHttpRequest;if(a.addEventListener("load",()=>{if(a.status<400){const t=[];a.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const r=e.trim().split(/\s*:\s*/);r[0]=r[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(r)}),n({status:a.status,arrayBuffer:()=>a.response,headers:new Map(t)})}else o(416==a.status?new Error(rn):new Error(en+(a.statusText||a.status)))},!1),a.addEventListener("error",t=>o(t.detail?t.detail.error:new Error("Network error")),!1),a.open(t,e),r)for(const t of Object.entries(r))a.setRequestHeader(t[0],t[1]);a.responseType="arraybuffer",a.send()})}class Vn extends pn{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Fn(t,e):new Dn(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}createReadable(t){return this.reader.createReadable(t)}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class Zn extends Vn{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Hn extends pn{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{Wt:t,size:t.length})}readUint8Array(t,e){return this.Wt.slice(t,t+e)}}class qn extends mn{constructor(t){super(),this.Lt=t||262144}init(t=0){Object.assign(this,{offset:0,Wt:new Uint8Array(t>0?t:this.Lt)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.Wt.length){let t=e.Wt.length?2*e.Wt.length:e.Lt;for(;t<r;)t*=2;const n=e.Wt;e.Wt=new Uint8Array(t),e.Wt.set(n)}e.Wt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Wt.length?this.Wt:this.Wt.slice(0,this.offset)}}class Kn extends pn{constructor(t){super(),this.Vt=t}async init(){const t=this;t.Zt=0;const e=t.Vt=await Promise.all(t.Vt.map($n));t.Ht=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}qt(t){const{Ht:e,size:r}=this,n=e[t];return n===U?r:n}async readUint8Array(t,e){const r=this,{Vt:n}=this;let o,a=0,i=t;for(;n[a]&&i>=n[a].size;)i-=n[a].size,a++;const s=n[a];if(s){const n=s.size;if(i+e<=n)o=await to(s,i,e);else{const a=n-i;o=Rt(await to(s,i,a),await r.readUint8Array(t+a,e-a))}}else o=C;return r.Zt=Math.max(a,r.Zt),o}}class Yn extends hn{constructor(t,e=4294967295){super();const r=this;let n,o,a;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const i=new WritableStream({async write(e){if(e===wn)return void(a&&await c());const{availableSize:i}=r;if(a)e.length>=i?(await s(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i))):await s(e);else{const{value:i,done:s}=await t.next();if(s&&!i)throw new Error(on);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await Qn(n),o=i.writable,a=o.getWriter(),await this.write(e)}},async close(){a&&(await a.ready,await u())},async abort(t){a&&await a.abort(t)}});async function s(t){const e=t.length;e&&(await a.ready,await a.write(t),n.size+=e,r.availableSize-=e)}async function c(){await u(),r.diskOffset+=n.size,r.diskNumber++,a=null,r.availableSize=r.maxSize}async function u(){await a.close()}Object.defineProperty(r,dn,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(wn)}finally{t.releaseLock()}}}class Gn{constructor(t){return Array.isArray(t)&&(t=new Kn(t)),(t instanceof ReadableStream||typeof t.getReader==v)&&(t={readable:Ie(t)}),t}}class Xn{constructor(t){return t.writable===U&&typeof t.next==v&&(t=new Yn(t)),(t instanceof WritableStream||typeof t.getWriter==v)&&(t={writable:Ce(t)}),t.size===U&&(t.size=0),t}}function Jn(t){return Boolean(t&&t.getData)}async function Qn(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}async function $n(t){return t=new Gn(t),await Qn(t),t.size!==U&&t.readUint8Array||(t=new gn(await Me(t.readable)),await Qn(t)),t}function to(t,e,r){return t.readUint8Array(e,r)}function eo(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?pn.prototype.createReadable.call(t,e):t.readable}const ro="filename",no="rawFilename",oo="comment",ao="rawComment",io="uncompressedSize",so="compressedSize",co="offset",uo="diskNumberStart",lo="lastModDate",fo="rawLastModDate",wo="lastAccessDate",ho="rawLastAccessDate",po="creationDate",mo="rawCreationDate",yo="internalFileAttributes",bo="externalFileAttributes",Eo="internalFileAttribute",So="externalFileAttribute",go="msdosAttributesRaw",xo="msdosAttributes",Ao="msDosCompatible",zo="zip64",Ro="encrypted",Do="version",Fo="versionMadeBy",Oo="zipCrypto",Uo="directory",ko="executable",To="compressionMethod",vo="signature",Io="extraField",Mo="unixMode",Co="setuid",No="setgid",jo="sticky",Bo=[ro,no,io,so,lo,fo,oo,ao,wo,ho,po,mo,co,uo,yo,bo,Eo,So,go,xo,Ao,zo,Ro,Do,Fo,Oo,Uo,ko,"symlink",To,vo,"crc32",Io,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Mo,"unixExternalUpper",Co,No,jo,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Po{constructor(t){Bo.forEach(e=>this[e]=t[e])}}const _o="File format is not recognized",Wo="End of central directory not found",Lo="End of Zip64 central directory locator not found",Vo="Central directory header not found",Zo="Local file header not found",Ho="Zip64 extra field not found",qo="File contains encrypted entry",Ko="Encryption method not supported",Yo="Compression method not supported",Go="Split zip file",Xo="Overlapping entry found",Jo="Entry data out of bounds",Qo="Ambiguous archive",$o="Encrypted central directory is not supported",ta="Unsafe filename",ea="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",ra="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",na="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",oa="64-bit value exceeds Number.MAX_SAFE_INTEGER",aa=/^[a-zA-Z]:/,ia="utf-8",sa="cp437",ca=[[io,t],[so,t],[co,t],[uo,e]],ua={[e]:{Kt:Wa,bytes:4},[t]:{Kt:La,bytes:8}},la=BigInt(Number.MAX_SAFE_INTEGER);class fa{constructor(t,e={}){Object.assign(this,{reader:new Gn(t),options:e,Yt:new Map})}async*getEntriesGenerator(n={}){const a=this;let{reader:i}=a;if(await Qn(i),i.size!==U&&i.readUint8Array||(i=new gn(await Me(i.readable)),await Qn(i)),i.size<d)throw new Error(_o);const c=Fa(n,a.options),p=c==X,m=c!=Q,y=function(t,r){if(t!==U){const e=st(t);if("number"!=typeof e||Number.isNaN(e)||e<0)throw new Error(na);return e}return r==X?0:r==Q?1/0:e}(Ca(a,n,"maxAppendedDataSize"),c),b=function(t,e){if(t===U)return e;if(!Da(t))throw new Error(ra);return t}(Ca(a,n,"filenameValidation"),c),E=Ca(a,n,"normalizeFilename"),{Gt:S,Xt:D}=await async function(t,e,r){const{size:n}=t,o=Math.min(n,65557),a={count:64};let i,s,c=0;for await(const[r,u,l,f,w]of ka(t,o)){const o=_a(r,f+20);if(w+d+o==n){const o=await va(t,r,u,f,w,n,a);if(2==o){if(i||(i=Ta(l,f,w)),c++,!e||c>1)break}else 1!=o||s||(s=Ta(l,f,w))}}return i||(i=s),i||(i=await async function(t,e,r){const{size:n}=t,o=Math.min(n,e==1/0?n:65557+e);let a,i;for await(const[e,s,c,u,l]of ka(t,o)){const o=Ta(c,u,l);a||(a=o);const f=await va(t,e,s,u,l,n,r);if(2==f)return o;1!=f||i||(i=o)}return i||a}(t,r,a)),{Gt:i,Xt:c}}(i,m,y);if(!S)throw await async function(t){return await Ra(t)==o}(i)?new Error(Go):new Error(Wo);m&&D>1&&Ma("multiple end of central directory records");const F=Ft(S);let O=Wa(F,12),k=Wa(F,16);const T=S.offset,v=_a(F,20),I=T+d+v;i.size-I>y&&Ma("appended data");let M=_a(F,4);const N=i.Zt||0;let j,B,P,_,W=_a(F,6),L=_a(F,10),V=0,Z=h;const H=k==t||O==t||L==e||W==e;if(k!=t&&W!=e&&(k+=za(i,W)),H){const r=S.offset>=w?await to(i,S.offset-w,w):C,n=Ft(r);if(r.length==w&&Wa(n,0)==l){k=za(i,Wa(n,4))+La(n,8);let r=await to(i,k,h),o=Ft(r);const a=S.offset-w-h;if((r.length<h||Wa(o,0)!=u)&&k!=a&&a>=0){const t=k;k=a,k>t&&(V=k-t),r=await to(i,k,h),o=Ft(r)}if(r.length<h||Wa(o,0)!=u)throw new Error(Lo);if(B=!0,P=La(o,4)>44,P){const t=Math.min(La(o,4)-44,i.size-k-h);t>0&&(Z+=t,_=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=Ft(t),n=_a(r,26);Object.assign(e,{compressionMethod:_a(r,0),compressedSize:La(r,2),uncompressedSize:La(r,10),encryptionAlgorithm:_a(r,18),bitLength:_a(r,20),flags:_a(r,22),hashAlgorithm:_a(r,24),hashData:t.subarray(28,28+n)})}return e}(await to(i,k+h,t)))}M==e?M=Wa(o,16):p&&M!=Wa(o,16)&&Ma("mismatched zip64 end of central directory record"),W==e?W=Wa(o,20):p&&W!=Wa(o,20)&&Ma("mismatched zip64 end of central directory record"),L==e?L=La(o,32):p&&L!=La(o,32)&&Ma("mismatched zip64 end of central directory record"),O==t?O=La(o,40):p&&O!=La(o,40)&&Ma("mismatched zip64 end of central directory record"),k=za(i,W)+La(o,48)+V}}let q=O;const K=S.offset-(B?Z+w:0);if(k>=i.size&&(V=i.size-k-O-d,k=i.size-O-d),N!=M)throw new Error(Go);if(k<0)throw new Error(_o);let J=0,$=await to(i,k,O),tt=Ft($);if(O){if($.length<4)throw new Error(_o);const t=K-O;if(k!=t&&W==M){let e=!(Wa(tt,J)==s||Boolean(_&&_.compressedSize)||ha(tt));if(!e&&t>=0&&t+4<=i.size&&(e=Wa(Ft(await to(i,t,4)),0)==s),e){const e=k;k=t,k>e&&(V+=k-e),$=await to(i,k,O),tt=Ft($)}}}const et=K-k;if(O!=et&&et>=0&&W==M&&(O=et,$=await to(i,k,O),tt=Ft($)),k<0||k>=i.size)throw new Error(_o);a.directoryOffset=k,a.directoryLength=q;const rt=Na(a,n,"decryptCentralDirectory");let nt,ot;if(rt&&L&&$.length>=4&&Wa(tt,0)!=s&&(P||ha(tt))){const t=function(t,e,r){const n=t&&t.compressedSize?t.compressedSize:e;return n>0&&n<=r?n:r}(_,q,$.length);ot=$.subarray(t),$=await rt($.subarray(0,t),_),tt=Ft($),q=$.length,nt=!0}j=k;const at=Ca(a,n,"filenameEncoding"),it=Ca(a,n,"commentEncoding"),ct=p?new Set:U;let ut;const lt=!p&&!B;!L&<&&(L=pa(tt,$,J));for(let t=0;t<L;t++){const o=new wa(i,a.options);if(J+f>$.length||Wa(tt,J)!=s){if(0==t&&!nt&&(P||ha(tt)))throw new Error($o);throw new Error(Vo)}ya(o,tt,J+6);const c=Boolean(o.bitFlag.languageEncodingFlag),u=J+f,l=u+o.filenameLength,d=l+o.extraFieldLength,w=_a(tt,J+4),h=!(w>>8),m=w>>8==3,y=$.subarray(u,l),S=_a(tt,J+32),D=d+S,F=$.subarray(d,D),O=c,k=c,T=Wa(tt,J+38),v=T&r,I={readOnly:Boolean(1&v),hidden:Boolean(2&v),system:Boolean(4&v),directory:Boolean(16&v),archive:Boolean(32&v)},M=Wa(tt,J+42),C=Na(a,n,"decodeText")||$r,N=O?ia:at||sa,B=k?ia:it||sa;let _=C(y,N,Y);if(_===U&&(_=$r(y,N)),E){const t=E(_);t!==U&&(_=t)}if(Ua(_,b)){const t=new Error(ta);throw t.filename=_,t}let W=C(F,B,G);W===U&&(W=$r(F,B)),Object.assign(o,{index:t,Jt:nt,versionMadeBy:w,msDosCompatible:h,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:S,offset:M,diskNumberStart:_a(tt,J+34),internalFileAttributes:_a(tt,J+36),externalFileAttributes:T,msdosAttributesRaw:v,msdosAttributes:I,rawFilename:y,filenameUTF8:O,commentUTF8:k,rawExtraField:$.subarray(l,d),rawComment:F,filename:_,comment:W}),ba(o,o,tt,J+6),o.offset+=V,j=Math.min(za(i,o.diskNumberStart)+o.offset,j),p&&(ct.has(o.filename)&&(ut=!0),ct.add(o.filename));const Z=o.externalFileAttributes>>16&e;o.unixMode===U&&16877&Z&&(o.unixMode=Z);const H=Boolean(o.unixMode&A),q=Boolean(o.unixMode&z),K=Boolean(512&o.unixMode),X=40960==((o.unixMode===U?Z:o.unixMode)&g),Q=!X&&(o.unixMode!==U?!!(73&o.unixMode):m&&!!(73&Z)),et=o.unixMode!==U&&(o.unixMode&g)==x,rt=(Z&g)==x;Object.assign(o,{setuid:H,setgid:q,sticky:K,symlink:X,unixExternalUpper:Z,internalFileAttribute:o.internalFileAttributes,externalFileAttribute:o.externalFileAttributes,executable:Q,directory:et||rt||h&&I.directory||o.filename.endsWith(R),zipCrypto:o.encrypted&&!o.extraFieldAES});const ot=new Po(o);ot.getData=(t,e)=>o.getData(t,ot,a.Yt,e),ot.arrayBuffer=async t=>{const e=new TransformStream,r=Me(e.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await o.getData(e,ot,a.Yt,t),r},J=D,t==L-1&<&&(L+=pa(tt,$,J));const{onprogress:st}=n;if(st)try{await st(t+1,L,new Po(o))}catch{}yield ot}let ft=J,dt=ma($.subarray(J))||(nt?ma(ot):U);if(!dt&&!nt){const t=k+J,e=Math.min(K-t,65541);e>=6&&(dt=ma(await to(i,t,e)))}dt&&(a.digitalSignature=dt,ft=J+6+dt.length),p&&J!=q&&ft!=q&&Ma("trailing central directory data"),ut&&Ma("duplicate filename");const wt=Ca(a,n,"extractPrependedData"),ht=Ca(a,n,"extractAppendedData"),pt=(p||wt)&&L&&4==j&&await async function(t){const e=await Ra(t);return e==o||808471376==e}(i)?4:0;return p&&(V||L&&j>pt)&&Ma("prepended data"),wt&&(a.prependedData=j>pt?await to(i,pt,j-pt):C),a.comment=v?await to(i,T+d,v):C,ht&&(a.appendedData=I<i.size?await to(i,I,i.size-I):C),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}class da{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new fa(e,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(t){const{done:e,value:r}=await n.next();if(e)return t.close();const o={...r,readable:function(){const{readable:t,writable:e}=new TransformStream;if(r.getData)return async function(){try{await r.getData(e)}catch(t){try{await e.abort(t)}catch{}}}(),t}()};delete o.getData,t.enqueue(o)}}),this.writable=r}}let wa=class{constructor(t,e){Object.assign(this,{reader:t,options:e})}async getData(t,e,o,i={}){const s=this,c=mt(),{reader:u,index:l,offset:f,diskNumberStart:d,extraFieldAES:w,extraFieldZip64:h,compressionMethod:p,bitFlag:m,rawBitFlag:y,crc32:b,rawLastModDate:E,uncompressedSize:S,compressedSize:g}=s,{dataDescriptor:x}=m,A=e.localDirectory={},z=za(u,d)+f,R=await to(u,z,D),F=Ft(R);let O=Ca(s,i,N),k=Ca(s,i,j);const T=Ca(s,i,B);if(ot(O,k),O=O&&O.length&&O,k=k&&k.length&&k,w&&99!=w.originalCompressionMethod)throw new Error(Yo);if(R.length<D||Wa(F,0)!=n)throw new Error(Zo);ya(A,F,4);const{extraFieldLength:v,filenameLength:I}=A,M=A.dataOffset=z+D+I+v,Z=Ca(s,i,"checkLocalDirectory"),H=Fa(i,s.options),q=function(t,e){return t===U?e!=Q:Boolean(t)}(Z,H),K=function(t,e){return t===U?e==X:Boolean(t)}(Z,H);let Y=C;if(K&&(I||v)){const t=await to(u,z+D,I+v);Y=t.subarray(0,I),A.rawExtraField=t.subarray(I)}else A.rawExtraField=v?await to(u,z+D+I,v):C;K&&(A.rawFilename=Y),ba(s,A,F,4,!0),q&&function(t,e,r,n){const{rawFilename:o}=t,a=t.Jt&&!(8192&~e.rawBitFlag);!n||a||r.length==o.length&&!r.some((t,e)=>t!=o[e])||Ma("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Ma("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&Ma("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Ma("mismatched local file header (crc32 or sizes)")}(s,A,Y,K);const{lastAccessDate:G,creationDate:J,uid:$,gid:tt}=A;G&&(e.lastAccessDate=G),J&&(e.creationDate=J),$!==U&&e.uid===U&&(e.uid=$),tt!==U&&e.gid===U&&(e.gid=tt);const et=s.encrypted&&A.encrypted&&!T,rt=et&&!w;if(T||(e.zipCrypto=rt),et&&!(64&~A.rawBitFlag))throw new Error(Ko);const at=T?U:Ze(p);if(0!=p&&8!=p&&9!=p&&!at&&!T)throw new Error(Yo);if(et){if(!rt&&(w.strength<1||w.strength>3))throw new Error(Ko);if(!O&&!k)throw new Error(qo)}if(M+g>u.size)throw new Error(Jo);const it=g,st=Ie(u.createReadable({offset:M,size:it})),ct=nt(Ca(s,i,P)),ut=Ca(s,i,"checkPasswordOnly");let lt=Ca(s,i,"checkOverlappingEntry");const ft=Ca(s,i,"checkOverlappingEntryOnly");ft&&(lt=!0);const{onstart:dt,onprogress:wt,onend:ht}=i,pt=0!=p&&!T,yt=T?g:S,bt=9==p;let Et=Ca(s,i,W);bt&&(Et=!1);const St=Ca(s,i,"checkCrc32"),gt=(St===U?Ca(s,i,"checkSignature"):St)&&!T&&(!et||rt||w&&1==w.vendorVersion),xt={options:{codecType:dr,password:O,rawPassword:k,zipCrypto:rt,encryptionStrength:w&&w.strength,checkCrc32:gt,checkAuthenticationCode:Ca(s,i,"checkAuthenticationCode"),passwordVerification:rt&&(x?E>>>8&r:b>>>24&r),outputSize:yt,crc32:b,compressed:pt,encrypted:et,useWebWorkers:Ca(s,i,_),useCompressionStream:Et,transferStreams:Ca(s,i,L),deflate64:bt,format:at?at.format:U,codecURI:at?at.codecURI:U,compressionMethod:p,rawBitFlag:y,checkPasswordOnly:ut},config:c,ft:{signal:ct,size:it,onstart:dt,onprogress:wt,onend:ht}};let At,zt;lt&&await async function({reader:t,$t:e,index:r,offset:n,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:c,dataDescriptor:u,extraFieldZip64:l,Yt:f}){let d=0;if(u&&(d=l?20:12),d){const r=await to(t,c+i,d+4),n=Ft(r);let u=r.length==d+4&&Wa(n,0)==a;if(u){const t=Aa(n,4,l);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:u=!1}if(r.length>=d){const t=Aa(n,u?4:0,l);t.signature=u,e.localDirectory.dataDescriptor=t}}const w={start:n,end:c+i+d,$t:e};for(const[t,e]of f)if(t!=r&&w.start<e.end&&e.start<w.end){const t=new Error(Xo);throw t.overlappingEntry=e.$t,t}f.set(r,w)}({reader:u,$t:e,index:l,offset:z,crc32:b,compressedSize:g,uncompressedSize:S,dataOffset:M,dataDescriptor:x||A.bitFlag.dataDescriptor,extraFieldZip64:h||A.extraFieldZip64,Yt:o});try{if(!ft){ut&&(t=new WritableStream),t=new Xn(t),await Qn(t,function(t,e,r){return Math.min(t,r?1032*e:e)}(yt,g,pt)),({writable:At}=t);const{outputSize:e}=await Hr({readable:st,writable:At},xt);if(t.size+=e,e!=yt)throw new Error(Ke)}}catch(e){if(e.outputSize!==U&&(t.size+=e.outputSize),!ut||e.message!=Yt)throw zt=e,e}finally{if((Jn(t)||!Ca(s,i,V))&&At&&!At.locked){const t=At.getWriter();if(zt)try{await t.abort(zt)}catch{}else await t.close()}}return ut||ft?U:t.getData?t.getData():At}};function ha(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;r<e;r++)if(134630224==Wa(t,r))return!0;return!1}function pa(t,e,r){let n=0;for(;r+f<=e.length&&Wa(t,r)==s;)r+=f+_a(t,r+28)+_a(t,r+30)+_a(t,r+32),n++;return n%65536?0:n}function ma(t){if(t.length>=6){const e=Ft(t);if(Wa(e,0)==i){const r=_a(e,4);if(6+r<=t.length)return t.subarray(6,6+r)}}}function ya(t,e,r){const n=t.rawBitFlag=_a(e,r+2),o=!(1&~n),a=Wa(e,r+6);Object.assign(t,{encrypted:o,version:_a(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&S)==S},rawLastModDate:a,lastModDate:ja(a),filenameLength:_a(e,r+22),extraFieldLength:_a(e,r+24)})}function ba(t,e,r,n,o){const{rawExtraField:a}=e,i=e.extraField=new Map,s=Ft(a);let c=0;try{for(;c<a.length;){const t=_a(s,c),e=_a(s,c+2);i.set(t,{type:t,data:a.slice(c+4,c+4+e)}),c+=4+e}}catch{}const u=_a(r,n+4);Object.assign(e,{signature:Wa(r,n+10),crc32:Wa(r,n+10),compressedSize:Wa(r,n+14),uncompressedSize:Wa(r,n+18)});const l=i.get(1);l&&(function(t,e){e.zip64=!0;const r=Ft(t.data),n=ca.filter(([t,r])=>e[t]==r),o=n.reduce((t,[,e])=>t+ua[e].bytes,0);if(t.data.length<o)throw new Error(Ho);for(let o=0,a=0;o<n.length;o++){const[i,s]=n[o],c=ua[s];e[i]=t[i]=c.Kt(r,a),a+=c.bytes}}(l,e),e.extraFieldZip64=l);const f=i.get(28789);f&&(Ea(f,ro,no,e,t),e.extraFieldUnicodePath=f);const d=i.get(25461);d&&(Ea(d,oo,ao,e,t),e.extraFieldUnicodeComment=d);const w=i.get(p);w&&w.data.length>=7?(function(t,e,r){const n=Ft(t.data),o=Pa(n,4);Object.assign(t,{vendorVersion:Pa(n,0),vendorId:Pa(n,2),strength:o,originalCompressionMethod:r,compressionMethod:_a(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=U)}(w,e,u),e.extraFieldAES=w):e.compressionMethod=u;const h=i.get(13);h&&(Sa(h,e),e.extraFieldPkwareUnix=h);const S=i.get(22613);S&&(Sa(S,e),e.extraFieldUnixType1=S);const g=i.get(10);g&&(function(t,e){const r=Ft(t.data);let n,o=4;try{for(;o<t.data.length&&!n;){const e=_a(r,o),a=_a(r,o+2);1==e&&(n=t.data.slice(o+4,o+4+a)),o+=4+a}}catch{}if(n&&24==n.length){const r=Ft(n),o=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:o,rawLastAccessDate:a,rawCreationDate:i});const s={lastModDate:Ba(o),lastAccessDate:Ba(a),creationDate:Ba(i)};Object.assign(t,s),Object.assign(e,s,{rawLastAccessDate:a,rawCreationDate:i})}}(g,e),e.extraFieldNTFS=g);const x=i.get(E);let A;if(x&&(A=ga(x,e,!1),e.extraFieldUnix=x),!A){const t=i.get(b);t&&(ga(t,e,!0),e.extraFieldInfoZip=t)}const z=i.get(m);z&&(function(t,e,r){if(!t.data.length)return;const n=Ft(t.data),o=Pa(n,0),a=[],i=[];r?(1&~o||(a.push(lo),i.push(fo)),2&~o||(a.push(wo),i.push(ho)),4&~o||(a.push(po),i.push(mo))):t.data.length>=5&&(a.push(lo),i.push(fo));let s=1;a.forEach((r,o)=>{if(t.data.length>=s+4){const a=Wa(n,s);e[r]=t[r]=new Date(1e3*(0|a));const c=i[o];t[c]=a}s+=4})}(z,e,o),e.extraFieldExtendedTimestamp=z);const R=i.get(y);R&&(e.extraFieldUSDZ=R)}function Ea(t,e,r,n,o){if(t.data.length<5)return void(t.valid=!1);const a=Ft(t.data),i=new jt;i.append(o[r]);const s=Ft(new Uint8Array(4));s.setUint32(0,i.get(),!0);const c=Wa(a,1),u=Pa(a,0);Object.assign(t,{version:u,[e]:$r(t.data.subarray(5)),valid:1==u&&!o.bitFlag.languageEncodingFlag&&c==Wa(s,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function Sa(t,e){if(t.data.length<8)return;const r=Ft(t.data),n={lastAccessDate:new Date(1e3*(0|Wa(r,0))),lastModDate:new Date(1e3*(0|Wa(r,4)))};t.data.length>=12&&(n.uid=_a(r,8),n.gid=_a(r,10)),Object.assign(t,n),Object.assign(e,n)}function ga(t,e,r){try{const n=Ft(t.data);let o,a;if(r){let e=0;const r=Pa(n,e++),i=Pa(n,e++);o=xa(t.data.subarray(e,e+i)),e+=i;const s=Pa(n,e++);a=xa(t.data.subarray(e,e+s)),Object.assign(t,{version:r,uid:o,gid:a})}else t.data.length>=4&&(o=_a(n,0),a=_a(n,2),Object.assign(t,{uid:o,gid:a}));return o!==U&&(e.uid=o),a!==U&&(e.gid=a),o!==U||a!==U}catch{}}function xa(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Aa(t,e,r){const n=Wa(t,e);let o,a;return r?(o=La(t,e+4),a=La(t,e+12)):(o=Wa(t,e+4),a=Wa(t,e+8)),{crc32:n,compressedSize:o,uncompressedSize:a}}function za(t,e){return t.qt?t.qt(e):0}async function Ra(t){return Wa(Ft(await to(t,0,4)))}function Da(t){return t===X||t===J||t===Q}function Fa(t,e){return Oa(t,Oa(e,J))}function Oa(t,e){const r=t.strictness;if(r!==U){if(!Da(r))throw new Error(ea);return r}const n=t.checkAmbiguity;return n===U?e:n?X:e==Q?Q:J}function Ua(t,e){if(e==Q)return!1;const r=t.split("/");return r.length>1&&""===r[r.length-1]&&r.pop(),!!(r.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||aa.test(t))||e==X&&(r.includes(".")||r.includes(""))}async function*ka(t,e){const r=t.size-e,n=await to(t,r,e),o=Ft(n);for(let t=n.length-d;t>=0;t--)Wa(o,t)==c&&(yield[o,r,n,t,r+t])}function Ta(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function va(r,n,o,a,i,c,u){const f=_a(n,a+10),d=Wa(n,a+12),h=Wa(n,a+16);if(f==e||d==t||h==t)return await Ia(r,n,o,i-w,c,u)==l?2:0;if(!f&&!d)return 1;const p=_a(n,a+6);for(const t of[i-d,za(r,p)+h])if(await Ia(r,n,o,t,c,u)==s)return 2;return 0}async function Ia(t,e,r,n,o,a){return n<0||n+4>o?U:n>=r?Wa(e,n-r):a.count>0?(a.count--,Wa(Ft(await to(t,n,4)),0)):U}function Ma(t){const e=new Error(Qo);throw e.reason=t,e}function Ca(t,e,r){return e[r]===U?t.options[r]:e[r]}function Na(t,e,r){return rt(Ca(t,e,r))}function ja(t){const r=(4294901760&t)>>16,n=t&e,o=new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return o<O?O:o}function Ba(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Pa(t,e){return t.getUint8(e)}function _a(t,e){return t.getUint16(e,!0)}function Wa(t,e){return t.getUint32(e,!0)}function La(t,e){const r=t.getBigUint64(e,!0);if(r>la)throw new Error(oa);return Number(r)}var Va=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Qo,ERR_BAD_FORMAT:_o,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Vo,ERR_ENCRYPTED:qo,ERR_ENCRYPTED_CENTRAL_DIRECTORY:$o,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Jo,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Lo,ERR_EOCDR_NOT_FOUND:Wo,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Ho,ERR_INVALID_AUTHENTICATION_CODE:Kt,ERR_INVALID_COMPRESSED_DATA:Ye,ERR_INVALID_CRC32:Ge,ERR_INVALID_FILENAME_VALIDATION:ra,ERR_INVALID_MAX_APPENDED_DATA_SIZE:na,ERR_INVALID_PASSWORD:Ht,ERR_INVALID_SIGNATURE:qt,ERR_INVALID_STRICTNESS:ea,ERR_INVALID_UNCOMPRESSED_SIZE:Ke,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Zo,ERR_OVERLAPPING_ENTRY:Xo,ERR_SPLIT_ZIP_FILE:Go,ERR_UNSAFE_FILENAME:ta,ERR_UNSUPPORTED_COMPRESSION:Yo,ERR_UNSUPPORTED_ENCRYPTION:Ko,ERR_UNSUPPORTED_UINT64:oa,ERR_WORKER_STARTUP_TIMEOUT:pr,ZipReader:fa,ZipReaderStream:da});const Za="File already exists",Ha="Zip file comment exceeds 64KB",qa="Invalid zip file comment (must be a Uint8Array)",Ka="File entry comment exceeds 64KB",Ya="Invalid file entry comment (must be a string)",Ga="Invalid date (must be a valid Date instance)",Xa="File entry name exceeds 64KB",Ja="Version exceeds 65535",Qa="The strength must equal 1, 2, or 3",$a="Encryption is not supported in USDZ files",ti="Encryption is not supported when the 'passThrough' option is set",ei="Invalid extra field (must be a Map)",ri="Invalid extra field type (must be integer 0..65535)",ni="Invalid extra field data (must be a Uint8Array)",oi="Extra field data exceeds 64KB",ai=-2147483648,ii=2147483647,si=BigInt(0),ci=BigInt("0x7fffffffffffffff"),ui="Zip64 is not supported (set the 'zip64' option to 'true')",li="Undefined uncompressed size",fi="Undefined compression method",di="Undetermined size",wi="Undefined reader",hi="Zip file not empty",pi="Invalid uid (must be integer 0..2^32-1)",mi="Invalid gid (must be integer 0..2^32-1)",yi="Invalid UNIX mode (must be integer 0..65535)",bi="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Ei="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Si="Invalid msdosAttributesRaw (must be integer 0..255)",gi="Invalid msdosAttributes (must be an object with boolean flags)",xi="Invalid level (must be integer 0..9)",Ai="Signature data exceeds 64KB",zi=new Uint8Array([7,0,2,0,65,69,3,0,0]),Ri="infozip",Di="unix";let Fi=0;const Oi=[];class Ui{constructor(t,e={}){t=new Xn(t);const{availableSize:r=k,maxSize:n=k}=t,o=r>0&&r!==k&&n>0&&n!==k;Object.assign(this,{writer:t,te:o,options:e,ee:new Map,re:new Set,offset:e[H]===U?t.size||t.writable.size||0:e[H],ne:e[H]===U?0:e[H]-(t.size||t.writable.size||0),oe:new Set,ae:[],ie:0,se:U})}prependZip(t){return vi(this,async function(t,e){if(t.re.size)throw new Error(hi);await t.ce(e)}(this,t))}appendZip(t){return vi(this,this.ce(t))}async ce(t){const e=this,{oe:r,re:n,ee:a}=e;for(;r.size;)await Promise.allSettled(Array.from(r));let i;const s=new Promise(t=>i=t);r.add(s);const c=[];let u;try{t=new Gn(t),await Qn(t),t.size!==U&&t.readUint8Array||(t=new gn(await Me(t.readable)),await Qn(t));const{ZipReader:r}=await Promise.resolve().then(function(){return Va}),i=new r(t),s=await i.getEntries();await i.close(),await Qn(e.writer);const{directoryOffset:l}=i;s.forEach(({filename:t})=>{if(n.has(t))throw new Error(Za);n.add(t),c.push(t)}),e.ue=!0;const{le:f}=e;e.le=new Promise(t=>u=()=>{e.ue=!1,t()}),await f,e.te&&(delete e.te,await async function(t){return Ft(await to(t,0,4)).getUint32(0,!0)==o}(t)||(await es(e.writer,$i()),e.offset+=4));const d=await async function(t,e,r,n){const{writer:o}=t,a=new Map;if(o.closeDisk){const i=Array.from(r).sort((t,r)=>Qi(e,t)-Qi(e,r));let s=0;for(const r of i){const n=Qi(e,r);await Xi(t,e,s,n-s),Ki(o,await Ji(e,n))&&await o.closeDisk(),a.set(r,{offset:Yi(t,o),diskNumberStart:Hi(o)}),s=n}await Xi(t,e,s,n-s)}else{const o=t.offset;await Xi(t,e,0,n),r.forEach(t=>a.set(t,{offset:o+Qi(e,t),diskNumberStart:0}))}return a}(e,t,s,l);s.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:n,bitFlag:o,encrypted:i,uncompressedSize:s,compressedSize:c,extraFieldZip64:u}=t;let{compressionMethod:l,rawExtraField:f}=t;const{level:w,languageEncodingFlag:h,dataDescriptor:p}=o;f=Gi(f||C),t.extraFieldAES&&(l=99);const m=Ss(f),y=Boolean(u)&&u.uncompressedSize!==U,b=Boolean(u)&&u.compressedSize!==U,E=-7&xs(w,h,p,i,l)|w<<1,{fe:S,de:g}=gs({version:e,bitFlag:E,compressionMethod:l,uncompressedSize:s,compressedSize:c,rawLastModDate:r,rawFilename:n,we:b,he:y,extraFieldLength:m}),{crc32:x}=t;x!==U&&ys(g,10,x);const{offset:A,diskNumberStart:z}=d.get(t);Object.assign(t,{he:y,we:b,offset:A,diskNumberStart:z,pe:!1,me:C,ye:C,be:C,Ee:C,Se:C,rawExtraField:f,extendedTimestamp:!1,fe:S,de:g}),a.set(t.filename,t)})}catch(t){throw c.forEach(t=>n.delete(t)),t}finally{i(),r.delete(s),u&&u()}}add(e="",n,o={}){const a=this,{oe:i}=a,s=async function(e,n,o,a){if(a=Object.assign({},a),n=n.trim(),ss(e,a,Uo)&&!n.endsWith(R)&&(n+=R),e.re.has(n))throw new Error(Za);e.re.add(n),Fi<mt().maxWorkers?Fi++:await new Promise(t=>Oi.push(t));try{return await async function(e,n,o,a){const i=Ci(e,n,a);({name:n}=i);const s=Ni(e,n,a),{comment:c}=s,u=a[Io];let l;e.ee.set(n,U);try{const{ge:c}=s;0==c.level||c.compressionMethod!==U||c.passThrough||await Sr(mt())||(c.level=0);const u=await async function(t,e,{ge:r},n){if(r.passThrough&&!e&&!ss(t,n,Uo))throw new Error(wi);let o;return e&&(e=new Gn(e),await Qn(e),({size:o}=e)),Object.assign({reader:e},Bi(t,Boolean(e),o,r,n))}(e,o,s,a);({reader:o}=u);const f=qi(e.writer),d=Hi(e.writer),w=Pi(a=Object.assign({},a,i.ge,s.ge,u.ge,{signature:a[vo],crc32:a.crc32===U?a[vo]:a.crc32,offset:e.offset-f,diskNumberStart:d,[q]:e.options[q]})),h=Li(a),p=Ss(w.xe,h.Ae);l=await async function(e,n,o,a,i){const{ee:s,writer:c}=e,{keepOrder:u,dataDescriptor:l,ze:f,signal:d}=i,{Re:w}=a,h=e.options[q],p=e.se;let m,y,b,E,S,g,x,A={},z=0;s.set(n,A),e.se=A;try{let y;u&&(y=p&&p.De,A.De=new Promise(t=>b=t)),i.bufferedWrite||!u||e.ue||e.ie||!l&&!f?(m=!0,e.ie++,x=i.createTempStream?await i.createTempStream():new TransformStream(U,U,{highWaterMark:k}),x.size=0,await Qn(c)):(x=c,await R()),await Qn(x);const O=qi(c);e.te&&!m&&await ts(e,c),h&&!m&&_i(a,e.offset-O);const{xe:T}=w;m||(await y,await F());const v=Hi(c),I=Yi(e,c);if(A.diskNumberStart=v,m||(S=!0,g=c.size,await es(x,T)),A=await async function(e,n,{diskNumberStart:o,De:a},i,s,c){const{Re:u,Fe:l,Oe:f}=i,{fe:d,de:w,lastModDate:h,rawLastModDate:p,encrypted:m,compressed:y,version:b,compressionMethod:E,me:S,Ue:g,be:x,ke:A,Ee:z,Se:R,ye:D}=u,{Ae:F}=l,{rawFilename:O,lastAccessDate:k,creationDate:T,password:v,rawPassword:I,level:M,zip64:C,he:N,we:j,zipCrypto:B,dataDescriptor:P,directory:_,executable:W,versionMadeBy:L,rawComment:V,rawExtraField:Z,useWebWorkers:H,transferStreams:q,onstart:K,onprogress:Y,onend:G,signal:X,encryptionStrength:J,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,uid:rt,gid:nt,unixMode:ot,symlink:at,setuid:it,setgid:st,sticky:ct,unixExternalUpper:ut,msdosAttributesRaw:lt,msdosAttributes:ft,useCompressionStream:dt,passThrough:wt,format:ht,codecURI:pt}=c,mt={De:a,versionMadeBy:L,zip64:C,directory:Boolean(_),executable:Boolean(W),filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:V,me:S,Ue:g,be:x,Ee:z,Se:R,ye:D,rawExtraField:Z,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,diskNumberStart:o,uid:rt,gid:nt,unixMode:ot,symlink:Boolean(at),setuid:it,setgid:st,sticky:ct,unixExternalUpper:ut,msdosAttributesRaw:lt,msdosAttributes:ft};let{crc32:yt,uncompressedSize:bt}=c,Et=0;wt||(bt=0);const{writable:St}=n;if(e){const o=Ie(eo(e)),a=e.size,i={options:{codecType:fr,level:M,rawPassword:I,password:v,encryptionStrength:J,zipCrypto:m&&B,passwordVerification:m&&B&&p>>8&r,computeCrc32:!wt,compressed:y&&!wt,encrypted:m&&!wt,useWebWorkers:H,useCompressionStream:dt,transferStreams:q,format:ht,codecURI:pt,compressionMethod:E},config:s,ft:{signal:X,size:a,onstart:K,onprogress:Y,onend:G}};try{const e=await Hr({readable:o,writable:St},i);if(Et=e.outputSize,n.size+=Et,wt||(bt=e.inputSize,m&&!B||(yt=e.crc32)),!j&&Et>=t||!N&&bt>=t)throw new Error(ui)}catch(t){throw t.outputSize!==U&&(n.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:r,Re:n,Fe:o},{zip64:a,zipCrypto:i,passThrough:s,dataDescriptor:c}){const{de:u,encrypted:l}=n,{Te:f,ve:d}=o;l&&!i&&!s||t===U||(ys(u,10,t),c&&ys(f,d,t)),a?c&&(bs(f,d+4,BigInt(e)),bs(f,d+12,BigInt(r))):(ys(u,14,e),ys(u,18,r),c&&(ys(f,d+4,e),ys(f,d+8,r)))}({crc32:yt,compressedSize:Et,uncompressedSize:bt,Re:u,Fe:l},c),P&&await es(n,F),Object.assign(mt,{uncompressedSize:bt,compressedSize:Et,lastModDate:h,rawLastModDate:p,creationDate:T,lastAccessDate:k,encrypted:Boolean(m),zipCrypto:Boolean(B),size:f+Et,compressionMethod:E,version:b,fe:d,de:w,signature:yt,crc32:!m||B||wt?yt:U,ke:A,he:N,we:j}),mt}(o,x,A,a,mt(),i),m||(S=!1),s.set(n,A),A.filename=n,m){if(await Promise.all([x.writable.getWriter().close(),y]),await R(),e.te&&await ts(e,c),E=!0,g=c.size,await F(),A.diskNumberStart=Hi(c),A.offset=Yi(e,c),h){const t=a.Oe;_i(a,e.offset-qi(c)),A.size+=a.Oe-t}!function({rawFilename:t,encrypted:e,zip64:r,Ue:n,crc32:o,compressedSize:a,uncompressedSize:i,he:s,we:c},u,{dataDescriptor:l,passThrough:f}){if(l||((!e||f&&o!==U)&&ys(u,14,o),c||ys(u,18,a),s||ys(u,22,i)),r&&n){const e=D+Ss(t)+4;bs(u,e,BigInt(i)),bs(u,e+8,BigInt(a))}}(A,w.Ie,i),await es(c,w.xe),await rs(x.readable,c,d,t=>z+=t),c.size+=x.size,E=!1}else A.diskNumberStart=v,A.offset=I;return e.offset+=A.size,A}catch(t){if(E||S){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=c.size-g,m&&(e.offset+=z)}throw s.delete(n),t}finally{if(m&&e.ie--,b&&b(),y&&y(),m&&x&&x.dispose)try{await x.dispose()}catch{}}async function R(){e.ue=!0;const{le:t}=e;e.le=new Promise(t=>y=()=>{e.ue=!1,t()}),await t}async function F(){Ki(c,Ss(w.xe))&&await c.closeDisk()}}(e,n,o,{Re:w,Fe:h,Oe:p},a)}catch(t){throw e.ee.delete(n),t}return Object.assign(l,{name:n,comment:c,extraField:u,[Eo]:l.internalFileAttributes,[So]:l.externalFileAttributes}),new Po(l)}(e,n,o,a)}catch(t){throw e.re.delete(n),t}finally{const t=Oi.shift();t?t():Fi--}}(a,e,n,o);i.add(s);const c=()=>i.delete(s);return Promise.prototype.then.call(s,c,c),vi(a,s)}remove(t){const{re:e,ee:r}=this;if(typeof t==M&&(t=r.get(t)),t&&t.filename!==U){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=C,n={}){const o=this,{oe:a,writer:w}=this,{writable:h}=w;if(!(r instanceof Uint8Array))throw new Error(qa);if(Ss(r)>e)throw new Error(Ha);for(;a.size;)await Promise.allSettled(Array.from(a));await Promise.allSettled(o.ae.map(t=>t.Me));const p=o.ae.filter(t=>t.error&&!t.Ce);if(p.length){const t=p.map(t=>t.error);p.forEach(t=>t.Ce=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(r,n,o){const a=Vi(r.ee),{Ne:w,je:h,Be:p}=await async function(r,n,o){const{ee:a,writer:i}=r,c=new Uint8Array(n);await Qn(i);let u=0,l=0,d=Hi(i),w=qi(i),h=0;for(const[r,n]of Array.from(a.values()).entries()){const{offset:p,rawFilename:m,me:y,ye:b,be:E,Ee:S,Se:g,rawExtraField:x,rawComment:A,versionMadeBy:z,fe:R,de:D,he:F,we:O,pe:U,Pe:k,internalFileAttributes:T,externalFileAttributes:v,diskNumberStart:I,uncompressedSize:M,compressedSize:C}=n,N=Ss(y,b,E,S,g,x),j=f+Ss(m,A)+N;Ki(i,u+j-l)&&(await es(i,c.slice(l,u)),l=u,h=0,await i.closeDisk()),0==r&&(d=Hi(i),w=qi(i)),F||ys(D,18,M),O||ys(D,14,C),(k||U)&&n.version<45&&ms(D,0,45);const B=Zi(j);if(B._e(s),B.We(z),B.Le(R.subarray(0,24)),B.We(N),B.We(Ss(A)),B.We(U?e:I),B.We(T),B._e(v),B._e(k?t:p),B.Le(m),B.Le(y),B.Le(b),B.Le(E),B.Le(S),B.Le(g),B.Le(x),B.Le(A),Es(c,B.Wt,u),u+=j,h++,o.onprogress)try{await o.onprogress(r+1,a.size,new Po(n))}catch{}}return await es(i,l?c.slice(l):c),{Ne:{diskNumber:d,diskOffset:w},je:{diskNumber:Hi(i),Ve:h},Be:c}}(r,a,o),m=await async function(t,r,n){const o=us(t,n,K);if(o){const n=await o(r),a=Ss(n);if(a>e)throw new Error(Ai);const s=Zi(6+a);s._e(i),s.We(a),s.Le(n);const{writer:c}=t;return Ki(c,Ss(s.Wt))&&await c.closeDisk(),await es(c,s.Wt),6+a}return 0}(r,p,o);await async function(r,n,o,a){const{writer:i}=r,{Ne:s,je:f,Ze:w}=a;let{He:h}=a,p=r.ee.size,m=s.diskNumber,y=Yi(r,s);const b=Ss(n);if(b>e)throw new Error(Ha);let E=ss(r,o,zo),S=Hi(i);if(Ki(i,(E?98:d)+b)&&S++,y>=t||h>=t||p>=e||S>=e){if(!1===E)throw new Error(ui);E=!0}const g=Zi(E?98:d);Ki(i,Ss(g.Wt)+b)&&await i.closeDisk(),S=Hi(i);let x=S==f.diskNumber?f.Ve:0;E&&(g._e(u),g.qe(44),g.We(45),g.We(45),g._e(S),g._e(m),g.qe(x),g.qe(p),g.qe(h),g.qe(y),g._e(l),g._e(S),g.qe(BigInt(Yi(r,i))+BigInt(h)+BigInt(w)),g._e(S+1),ss(r,o,"supportZip64SplitFile",!0)&&(S=e,m=e),x=e,p=e,y=t,h=t),g._e(c),g.We(S),g.We(m),g.We(x),g.We(p),g._e(h),g._e(y),g.We(b),await es(i,g.Wt),b&&await es(i,n)}(r,n,o,{Ne:w,je:h,He:a,Ze:m})}(o,r,n),!Jn(w)&&ss(o,n,V)||await h.getWriter().close(),w.getData?w.getData():h}}class ki{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new Ui(r,t),this.oe=new Set}transform(t){const e=this.zipWriter;let r;const{readable:n,writable:o}=new TransformStream({start(t){r=t},flush:()=>{!async function(){try{await e.close()}catch(t){await Ii(e,t)}}()}});return Mi(this,this.zipWriter.add(t,n),t=>r.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}});return Mi(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){const{zipWriter:r}=this,n=(await Promise.allSettled(Array.from(this.oe))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(n.length){const[t]=n;try{t.entryErrors=n}catch{}throw await Ii(r,t),t}try{return await r.close(t,e)}catch(t){throw await Ii(r,t),t}}}class Ti extends Promise{then(t,e){const{Ke:r}=this;return r&&(r.Ce=!0),super.then(t,e)}}function vi(t,e){const r=new Ti((t,r)=>Promise.prototype.then.call(e,t,r)),n={};return r.Ke=n,n.Me=Promise.prototype.then.call(r,U,t=>n.error=t),t.ae.push(n),r}async function Ii(t,e){try{await t.writer.writable.abort(e)}catch{}}function Mi(t,e,r){t.oe.add(e),e.catch(t=>{try{r(t)}catch{}})}function Ci(n,o,a){o=o.trim();let i=ss(n,a,Ao),s=ss(n,a,Fo,i?20:768);const c=ss(n,a,ko),u=ds(n,a,"uid"),l=ds(n,a,"gid");let f=ds(n,a,Mo),d=ss(n,a,"unixExtraFieldType"),w=ss(n,a,Co),h=ss(n,a,No),p=ss(n,a,jo);if(it(u,t,pi),it(l,t,mi),it(f,e,yi),d!==U&&d!==Ri&&d!==Di)throw new Error(bi);if(d===Di&&(u!==U&&u>e||l!==U&&l>e))throw new Error(Ei);d!==U||u===U&&l===U||(d=Ri);let m=ds(n,a,go),y=ss(n,a,xo);const b=m!==U||y!==U;if(u!==U||l!==U||f!==U||d||c?(i=!1,s=s&r|768):b&&(i=!0,s&=r),it(m,r,Si),y&&(typeof y!==I||Array.isArray(y)))throw new Error(gi);if(s>e)throw new Error(Ja);let E=ls(n,a,bo,So);const S=E!==U;S||(E=0),!a[Uo]&&o.endsWith(R)&&(a[Uo]=!0);const D=ss(n,a,Uo);if(D?(o.endsWith(R)||(o+=R),S||(E=16,i||(E|=16877<<16))):i||S||(E=c?493<<16:27525120),!i){const t=f!==U||Boolean(w||h||p);f=f===U?E>>16&e:f&e,w?f|=A:w=Boolean(f&A),h?f|=z:h=Boolean(f&z),p?f|=512:p=Boolean(512&f),S&&!t||(D?f=-61441&f|x:f&g||(f|=32768),E=(f&e)<<16|E&e)}({msdosAttributesRaw:m,msdosAttributes:y}=function(t,e){if(t!==U)t&=r;else if(e!==U){const{readOnly:n,hidden:o,system:a,directory:i,archive:s}=e;let c=0;n&&(c|=1),o&&(c|=2),a&&(c|=4),i&&(c|=16),s&&(c|=32),t=c&r}return e===U&&(e={readOnly:Boolean(1&t),hidden:Boolean(2&t),system:Boolean(4&t),directory:Boolean(16&t),archive:Boolean(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}}(m,y)),b&&(E=E&t|m&r);const F=E>>16&e,O=f!==U&&40960==(f&g);return{name:o,ge:{versionMadeBy:s,msDosCompatible:Boolean(i),externalFileAttributes:E,unixExternalUpper:F,uid:u,gid:l,unixMode:f,unixExtraFieldType:d,symlink:O,setuid:w,setgid:h,sticky:p,msdosAttributesRaw:m,msdosAttributes:y}}}function Ni(t,r,n){const o=us(t,n,"encodeText")||Pt;let a=o(r,Y);if(a===U&&(a=Pt(r)),Ss(a)>e)throw new Error(Xa);const i=n[oo]||"";if(typeof i!=M)throw new Error(Ya);let s=o(i,G);if(s===U&&(s=Pt(i)),Ss(s)>e)throw new Error(Ka);const c=ss(t,n,Do);if(c!==U&&c>e)throw new Error(Ja);const u=cs(t,n,lo,new Date),l=ss(t,n,fo),f=cs(t,n,wo),d=cs(t,n,po),w=ls(t,n,yo,Eo,0),h=ss(t,n,B),p=ss(t,n,N),m=ss(t,n,j);ot(p,m);const y=ds(t,n,"encryptionStrength",3),b=ss(t,n,Oo),E=ss(t,n,"extendedTimestamp",!0),S=ss(t,n,"ntfsTimestamp"),g=ss(t,n,"keepOrder",!0),x=ss(t,n,_),A=ss(t,n,L),z=ss(t,n,"bufferedWrite"),R=us(t,n,"createTempStream"),D=ss(t,n,"dataDescriptorSignature",!0),F=nt(ss(t,n,P)),O=ss(t,n,"useUnicodeFileNames",!0),k=ss(t,n,To),T=h||k===U?U:Ze(k);if(!h&&k!==U&&0!==k&&8!==k&&!T)throw new Error("Compression method not supported");let v=ds(t,n,"level");if(it(v,9,xi),t.options[q]){if(p!==U||m!==U)throw new Error($a);v===U&&k===U&&(v=0)}h&&(v=U);let I=ss(t,n,W),C=ss(t,n,Z);z&&C===U&&(C=!1),(C===U||b&&!h)&&(C=!0),v!==U&&6!=v&&(I=!1);const V=ss(t,n,zo);if(!(b||p===U&&m===U||Number.isInteger(y)&&y>=1&&y<=3))throw new Error(Qa);const H=ji(n[Io]),K=ji(n.localExtraField);return{comment:i,ge:{rawFilename:a,rawComment:s,version:c,lastModDate:u,rawLastModDate:l,lastAccessDate:f,creationDate:d,internalFileAttributes:w,passThrough:h,password:p,rawPassword:m,encryptionStrength:y,zipCrypto:b,extendedTimestamp:E,ntfsTimestamp:S,keepOrder:g,useWebWorkers:x,transferStreams:A,bufferedWrite:z,createTempStream:R,dataDescriptorSignature:D,signal:F,useUnicodeFileNames:O,compressionMethod:k,format:T?T.format:U,codecURI:T?T.codecURI:U,Ye:T?T.versionNeeded:U,level:v,useCompressionStream:I,dataDescriptor:C,zip64:V,rawExtraField:H,Ge:K}}}function ji(t){if(!t)return C;if(!(t instanceof Map))throw new Error(ei);let r=0,n=0;t.forEach((t,n)=>{if(at(n,e,ri),!(t instanceof Uint8Array))throw new Error(ni);if(Ss(t)>e)throw new Error(oi);r+=4+Ss(t)});const o=new Uint8Array(r),a=Ft(o);return t.forEach((t,e)=>{ms(a,n,e),ms(a,n+2,Ss(t)),Es(o,t,n+4),n+=4+Ss(t)}),o}function Bi(e,r,n,o,a){const{passThrough:i,zipCrypto:s,password:c,rawPassword:u,encryptionStrength:l}=o;let{dataDescriptor:f,zip64:d,level:w,compressionMethod:h}=o,p=0,m=0;if(i&&r){if(m=a[io],m===U)throw new Error(li);if(h===U)throw new Error(fi)}const y=!0===d,b=ss(e,a,Ro);if(r&&i&&!b&&Ss(c,u))throw new Error(ti);const E=r&&(Boolean(c&&Ss(c)||u&&Ss(u))||i&&b);r||(w=0,h=0);const S=E?s?12:16+4*l:0;r&&(i?(a.uncompressedSize=m,p=n===U?ws(m)+S:n):n===U?(f=!0,(d||d===U)&&(d=!0,m=p=4294967296)):(a.uncompressedSize=m=n,p=(hs(h,w)?ws(m):m)+S));const g=!(E||r&&(0!==n||i)||hs(h,w));g&&!s&&ss(e,a,Z)===U&&(f=!1);const x=y||m>=t,A=y||p>=t;if(x||A){if(!1===d)throw new Error(ui);d=!0}return d=d||!1,{Xe:p,ge:{dataDescriptor:f,ze:g,zip64:d,he:x,we:A,uncompressedSize:m,level:w,compressionMethod:h,encrypted:E}}}function Pi(t){const{rawFilename:r,lastModDate:o,rawLastModDate:a,lastAccessDate:i,creationDate:s,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:f,dataDescriptor:d,directory:w,rawExtraField:h,Ge:y,encryptionStrength:S,extendedTimestamp:g,ntfsTimestamp:x,passThrough:A,encrypted:z,he:R,we:k,uncompressedSize:T,crc32:v}=t;let{version:I,compressionMethod:M}=t;const N=!w&&hs(M,c);let j;const B=A||!N,P=u&&(t.bufferedWrite||!d||!R&&!k||B),_=P||u&&d&&(R||k);if(u&&(R||k)){const t=20,e=Zi(t);if(e.We(1),e.We(t-4),j=e.Wt,P&&(e.qe(T),B)){const t=z?l?12:16+4*S:0;e.qe(A?0:T+t)}}else j=C;let W,L,V,Z,H;if(z&&!l){const t=Zi(Ss(zi)+2);t.We(p),t.Le(zi),W=t.Wt,W[8]=S}else W=C;if(g){const t=os(o),e=as(t);if(e){const e=9+(i?4:0)+(s?4:0),r=Zi(e);Z=1+(i?2:0)+(s?4:0),r.We(m),r.We(e-4),r.Je(Z),r._e(t),i&&r._e(is(os(i))),s&&r._e(is(os(s))),V=r.Wt}else V=C;if(x===U?!e||Boolean(i||s):x)try{const t=ns(o),e=Zi(36);e.We(10),e.We(32),e.Qe(4),e.We(1),e.We(24),e.qe(t),e.qe(i?ns(i):t),e.qe(s?ns(s):t),L=e.Wt}catch{L=C}else L=C}else L=V=C;try{const{uid:r,gid:n,unixExtraFieldType:o}=t;if(o!=Ri||r===U&&n===U)if(o!=Di||r===U&&n===U)H=C;else{const t=Zi(8);t.We(E),t.We(4),t.We((r===U?0:r)&e),t.We((n===U?0:n)&e),H=t.Wt}else{const t=Wi(r===U?0:r),e=Wi(n===U?0:n),o=3+t.length+e.length,a=Zi(4+o);a.We(b),a.We(o),a.Je(1),a.Je(t.length),a.Le(t),a.Je(e.length),a.Le(e),H=a.Wt}}catch{H=C}M===U&&(M=N?8:0),I===U&&(I=0!=M||w||z?20:10);const{Ye:K}=t;N&&K!==U&&(I=I>K?I:K),u&&(I=I>45?I:45),z&&!l&&(I=I>51?I:51,A&&v!==U&&(W[4]=1),ms(Ft(W),9,M),M=99);const Y=_?Ss(j):0,G=Y+Ss(W,V,L,H,h,y);if(G+(t[q]?67:0)>e)throw new Error(oi);const X=new Date(2e3*Math.ceil(Math.floor(o.getTime()/1e3)/2)),{fe:J,de:Q,rawLastModDate:$}=gs({version:I,bitFlag:xs(c,f,d,z,M),compressionMethod:M,uncompressedSize:T,lastModDate:X<O?O:X>F?F:X,rawLastModDate:a,rawFilename:r,we:k,he:R,extraFieldLength:G}),tt=Zi(D+Ss(r)+G),et=tt.Wt,rt=Ft(et);return tt._e(n),tt.Le(J),tt.Le(r),_&&tt.Le(j),tt.Le(W),tt.Le(V),tt.Le(L),tt.Le(H),tt.Le(h),tt.Le(y),d&&(k||ys(rt,18,0),R||ys(rt,22,0)),{xe:et,Ie:rt,fe:J,de:Q,lastModDate:o,rawLastModDate:$,encrypted:z,compressed:N,version:I,compressionMethod:M,ke:Z,me:C,Ue:Y,be:V,Ee:L,Se:H,ye:W,extraFieldLength:G}}function _i(t,e){const{Re:r}=t;let{xe:n,extraFieldLength:o}=r,a=64-(e+Ss(n))%64;a<4&&(a+=64);const i=new Uint8Array(a),s=Ft(i);ms(s,0,y),ms(s,2,a-4);const c=n;r.xe=n=new Uint8Array(Ss(c)+a),Es(n,c),Es(n,i,Ss(c));const u=Ft(n);ms(u,28,o+a),r.Ie=u,t.Oe+=a}function Wi(t){const e=new Uint8Array(4);Ft(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}function Li({zip64:t,dataDescriptor:e,dataDescriptorSignature:r}){let n,o=C,i=0,s=t?20:12;return r&&(s+=4),e&&(o=new Uint8Array(s),n=Ft(o),r&&(i=4,ys(n,0,a))),{Ae:o,Te:n,ve:i}}function Vi(r){let n=0;for(const[,o]of r){const{rawFilename:r,ye:a,rawComment:i,Ee:s,Se:c,rawExtraField:u,extendedTimestamp:l,ke:d,lastModDate:w,he:h,we:p,uncompressedSize:y,compressedSize:b}=o,E=o.offset>=t,S=o.diskNumberStart>=e;let g,x;if(E||S||h||p){const t=4+(h?8:0)+(p?8:0)+(E?8:0)+(S?4:0),e=Zi(t);e.We(1),e.We(t-4),h&&e.qe(y),p&&e.qe(b),E&&e.qe(o.offset),S&&e._e(o.diskNumberStart),g=e.Wt}else g=C;o.me=g,o.Pe=E,o.pe=S;const A=os(w);if(l&&as(A)){const t=Zi(9);t.We(m),t.We(5),t.Je(d),t._e(A),x=t.Wt}else x=C;o.be=x;const z=Ss(g,a,s,c,x,u);if(z>e)throw new Error(oi);n+=f+Ss(r,i)+z}return n}function Zi(t){const e=new Uint8Array(t),r=Ft(e);let n=0;return{Wt:e,Je:t=>{!function(t,e,r){t.setUint8(e,r)}(r,n,t),n+=1},We:t=>{ms(r,n,t),n+=2},_e:t=>{ys(r,n,t),n+=4},qe:t=>{bs(r,n,BigInt(t)),n+=8},Le:t=>{Es(e,t,n),n+=Ss(t)},Qe:t=>n+=t}}function Hi(t){const{diskNumber:e=0}=t;return e}function qi(t){const{diskOffset:e=0}=t;return e}function Ki(t,e){const{availableSize:r=k}=t;return e>r}function Yi(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.ne:0)}function Gi(t){const e=Ft(t);let r=0;for(;r+4<=Ss(t);){const n=4+ps(e,r+2);if(1==ps(e,r))return Gi(Rt(t.subarray(0,r),t.subarray(Math.min(r+n,Ss(t)))));r+=n}return t}async function Xi(t,e,r,n){if(n>0){const{writer:o}=t;let a=0;try{await rs(eo(e,{offset:r,size:n}),o,U,t=>a+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=a,t.offset+=a}}}async function Ji(t,e){const r=await to(t,e,D);if(Ss(r)<D)return D;const n=Ft(r);return D+ps(n,26)+ps(n,28)}function Qi(t,{offset:e,diskNumberStart:r}){return e+(t.qt?t.qt(r):0)}function $i(){const t=new Uint8Array(4);return ys(Ft(t),0,o),t}async function ts(t,e){delete t.te,await es(e,$i()),t.offset+=4}async function es(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=Ss(e),await n.write(e)}finally{n.releaseLock()}}async function rs(t,e,r,n){const o=e.writable.getWriter();try{await t.pipeTo(new WritableStream({async write(t){await o.ready,await o.write(t),n(Ss(t))}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{o.releaseLock()}}function ns(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return e<si?si:e>ci?ci:e}}function os(t){return Math.floor(t.getTime()/1e3)}function as(t){return t>=ai&&t<=ii}function is(t){return Math.min(ii,Math.max(ai,t))}function ss(t,e,r,n){const o=e[r]===U?t.options[r]:e[r];return o===U?n:o}function cs(t,e,r,n){const o=ss(t,e,r,n);if(null===o)return n;if(o!==U&&(typeof o.getTime!=v||Number.isNaN(o.getTime())))throw new Error(Ga);return o}function us(t,e,r){return rt(ss(t,e,r))}function ls(t,e,r,n,o){const a=fs(e,r,n),i=a===U?fs(t.options,r,n):a;return i===U?o:i}function fs(t,e,r){return t[e]===U?t[r]:t[e]}function ds(t,e,r,n){return st(ss(t,e,r,n))}function ws(t){return t+5*(Math.floor(t/16383)+1)}function hs(t,e){return t===U?e===U||e>0:0!==t}function ps(t,e){return t.getUint16(e,!0)}function ms(t,e,r){t.setUint16(e,r,!0)}function ys(t,e,r){t.setUint32(e,r,!0)}function bs(t,e,r){t.setBigUint64(e,r,!0)}function Es(t,e,r){t.set(e,r)}function Ss(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function gs({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:o,compressedSize:a,lastModDate:i,rawLastModDate:s,rawFilename:c,we:u,he:l,extraFieldLength:f}){const d=Zi(26),w=d.Wt,h=Ft(w);if(d.We(e),d.We(r),d.We(n),s===U){const t=new Uint32Array(1),e=Ft(t);ms(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),ms(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d._e(s),d.Qe(4),u||a!==U?d._e(u?t:a):d.Qe(4),l||o!==U?d._e(l?t:o):d.Qe(4),d.We(Ss(c)),d.We(f),{fe:w,de:h,rawLastModDate:s}}function xs(t,e,r,n,o){let a=0;return e&&(a|=S),r&&(a|=8),8!=o&&9!=o||(t>=0&&t<=3&&(a|=6),t>3&&t<=5&&(a|=4),9==t&&(a|=2)),n&&(a|=1),a}function As(){return"application/octet-stream"}const zs=1048576,Rs=".zip.js-temp";function Ds(t={}){const{thresholdBytes:e=zs,directoryName:r=Rs,getDirectory:n=()=>navigator.storage.getDirectory()}=t;let o;function a(){return o||(o=Promise.resolve(n()).then(t=>t.getDirectoryHandle(r,{create:!0}))),o}return function(){const t=[];let r,n,o,i,s=0,c=!1;const u=new WritableStream({async write(i){c?await o.write(i):(t.push(i),s+=i.length,s>e&&await async function(){const e=await a();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join(""),n=await e.getFileHandle(r,{create:!0}),o=(await n.createWritable()).getWriter(),c=!0;for(const e of t)await o.write(e);t.length=0}())},async close(){o&&(await o.close(),o=null)}});let l=0;return{writable:u,readable:new ReadableStream({async pull(e){if(c){if(!i){const t=await n.getFile();i=t.stream().getReader()}const{value:t,done:r}=await i.read();r?e.close():e.enqueue(t)}else l<t.length?e.enqueue(t[l++]):e.close()},async cancel(t){i&&await i.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(o){try{await o.close()}catch{}o=null}if(r){try{const t=await a();await t.removeEntry(r)}catch{}n=r=null}t.length=0}}}}const Fs=1048576;function Os(t={}){const{thresholdBytes:e=Fs}=t;return function(){const t=[];let r,n,o,a=0,i=!1;const s=new WritableStream({async write(o){i?await r.write(o):(t.push(o),a+=o.length,a>e&&await async function(){const e=new TransformStream;n=Me(e.readable),r=e.writable.getWriter(),i=!0;for(const e of t)await r.write(e);t.length=0}())},async close(){r&&(await r.close(),r=null)}});let c=0;return{writable:s,readable:new ReadableStream({async pull(e){if(i){if(!o){const t=await n;o=t.stream().getReader()}const{value:t,done:r}=await o.read();r?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){o&&await o.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(r){try{await r.abort()}catch{}r=null}n&&(n.catch(()=>{}),n=null),t.length=0}}}}const Us=1048576,ks=".zip.js-temp",Ts="createSyncAccessHandle is only available in dedicated workers";function vs(t={}){const{thresholdBytes:e=Us,directoryName:r=ks,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new Error(Ts);const o=n||(()=>navigator.storage.getDirectory());let a;function i(){return a||(a=Promise.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,n,o=0,a=!1,s=0,c=0;const u=new WritableStream({async write(c){a?(n.write(c,{at:s}),s+=c.length):(t.push(c),o+=c.length,o>e&&await async function(){const e=await i();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("");const o=await e.getFileHandle(r,{create:!0});n=await o.createSyncAccessHandle(),a=!0;for(const e of t)n.write(e,{at:s}),s+=e.length;t.length=0}())},close(){n&&n.flush()}});let l=0;return{writable:u,readable:new ReadableStream({pull(e){if(a){const t=s-c;if(t<=0)return void e.close();const r=new Uint8Array(Math.min(524288,t)),o=n.read(r,{at:c});o?(c+=o,e.enqueue(r.subarray(0,o))):e.close()}else l<t.length?e.enqueue(t[l++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(n){try{n.close()}catch{}n=null}if(r){try{const t=await i();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{At({baseURI:import.meta.url})}catch{}let Is,Ms,Cs,Ns,js;function Bs(t,e,r={}){if(!Is){const t=new Error("WASM module not loaded");throw t.cause=js,t}const n="number"==typeof r.level?r.level:-1,o="number"==typeof r.outBuffer?r.outBuffer:65536,a="number"==typeof r.inBufferSize?r.inBufferSize:65536;return new TransformStream({start(){try{let r;if(this.$e=Ms(o),this.in=Ms(a),this.inBufferSize=a,!this.$e||!this.in)throw new Error("allocation failed");if(this.er=new Uint8Array(o),t?(this.rr=Is.deflate_process,this.nr=Is.deflate_last_consumed,this.ar=Is.deflate_end,this.ir=Is.deflate_new(),r="gzip"===e?Is.deflate_init_gzip(this.ir,n):"deflate-raw"===e?Is.deflate_init_raw(this.ir,n):Is.deflate_init(this.ir,n)):"deflate64-raw"===e?(this.rr=Is.inflate9_process,this.nr=Is.inflate9_last_consumed,this.ar=Is.inflate9_end,this.ir=Is.inflate9_new(),r=Is.inflate9_init_raw(this.ir)):(this.rr=Is.inflate_process,this.nr=Is.inflate_last_consumed,this.ar=Is.inflate_end,this.ir=Is.inflate_new(),r="deflate-raw"===e?Is.inflate_init_raw(this.ir):"gzip"===e?Is.inflate_init_gzip(this.ir):Is.inflate_init(this.ir)),0!==r)throw new Error("init failed:"+r)}catch(t){throw i(this),t}},transform(e,r){try{const n=e,a=new Uint8Array(Ns.buffer),i=this.rr,s=this.nr,c=this.$e,u=this.er;let l=0;for(;l<n.length;){const e=Math.min(n.length-l,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&Cs&&(Cs(this.in),this.in=0),this.in=Ms(e),this.inBufferSize=e,!this.in))throw new Error("allocation failed");a.set(n.subarray(l,l+e),this.in);const f=i(this.ir,this.in,e,c,o,0),d=16777215&f;if(d&&(u.set(a.subarray(c,c+d),0),r.enqueue(u.slice(0,d))),!t){const t=f>>24&255,e=128&t?t-256:t;if(e<0)throw new Error("process error:"+e)}const w=s(this.ir);if(0===w)break;l+=w}}catch(t){i(this),r.error(t)}},flush(e){try{const r=new Uint8Array(Ns.buffer),n=this.rr,a=this.$e,i=this.er;for(;;){const s=n(this.ir,0,0,a,o,4),c=16777215&s,u=s>>24&255;if(!t){const t=128&u?u-256:u;if(t<0)throw new Error("process error:"+t)}if(c&&(i.set(r.subarray(a,a+c),0),e.enqueue(i.slice(0,c))),1===u||0===c)break}}catch(t){e.error(t)}finally{const t=i(this);0!==t&&e.error(new Error("end error:"+t))}},cancel(){i(this)}});function i(t){let e=0;return t.ir&&t.ar&&(e=t.ar(t.ir)),t.ir=0,t.in&&Cs&&Cs(t.in),t.in=0,t.$e&&Cs&&Cs(t.$e),t.$e=0,e}}class Ps{constructor(t="deflate",e){return Bs(!0,t,e)}}class _s{constructor(t="deflate",e){return Bs(!1,t,e)}}Ps.lt=!0,_s.lt=!0;let Ws,Ls=!1;function Vs(){Ws=null,async function(){await Promise.allSettled(_r.map(t=>(Xr(t),t.terminate()))),mr=U,yr=!1}(),Ls=!1,Is=Ms=Cs=Ns=js=null}!function({sr:t}){Er=t}({sr:t=>{if(!Ws){let{wasmURI:e}=t;typeof e==v&&(e=e()),Ws=async function(t,{baseURI:e}){if(!Ls)try{await async function(t,e){let r,n;try{try{n=new URL(t,e)}catch{}const o=await fetch(n);r=await o.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;r=function(t){const e=t.split(",")[1],r=atob(e),n=r.length,o=new Uint8Array(n);for(let t=0;t<n;++t)o[t]=r.charCodeAt(t);return o.buffer}(t)}!function(t){if(Is=t,({malloc:Ms,free:Cs,memory:Ns}=Is),"function"!=typeof Ms||"function"!=typeof Cs||!Ns)throw Is=Ms=Cs=Ns=null,new Error("Invalid WASM module")}((await WebAssembly.instantiate(r)).instance.exports)}(t,e),Ls=!0}catch(t){throw function(t){js=t}(t),t}}(e,t).catch(t=>{throw Ws=null,t})}return Ws}}),At({CompressionStreamFallback:Ps,DecompressionStreamFallback:_s}),At({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const Zs="Entry filename already exists",Hs="Readable stream already consumed",qs="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",Ks="Invalid readerOptions (must be an object)",Ys="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Gs="zipjs-abort-export",Xs="The operation was aborted",Js=new Set([1,p,10,m,28789,25461,y,b,E,22613,13]);class Qs{constructor(t,e,r,n){const o=this;if(t.root&&n&&n.getChildByName(e))throw new Error(Zs);r||(r={}),Object.assign(o,{fs:t,name:e,data:r.data,options:r.options&&Object.assign({},r.options),id:t.cr++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,ur:r.ur||r.uncompressedSize===U,passThrough:r.passThrough,lr:r.lr||new Date}),!n&&t.root||(t.entries[o.id]=o),n&&o.parent.children.push(o)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,r=this.parent;for(;r&&r!=t;)e=(r.name?r.name+"/":"")+e,r=r.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this.parent;if(e&&e.getChildByName(t))throw new Error(Zs);this.name=t}setOptions(t){const e=Object.assign({},this.options,t);this.options=Object.fromEntries(Object.entries(e).filter(([,t])=>t!==U))}}class $s extends Qs{constructor(t,e,r,n){super(t,e,r,n);const o=this;o.Reader=r.Reader,o.Writer=r.Writer,r.getData&&(o.getData=r.getData)}clone(){return new $s(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data&&function(t,e){const{contentType:r}=t;return r===U||(t.constructor==xn?e.type==r:t.constructor!=bn||e.startsWith("data:"+(r||"")+";base64,"))}(t,r.data))return r.data;{const n=r.reader=cc(r.Reader,r.data,e),o=r.uncompressedSize||n.size;await Promise.all([Qn(n),Qn(t,o)]);const a=nt(e.signal),i=function(t,e,r,n){const{onstart:o,onprogress:a,onend:i}=r,{readable:s}=e;return t.data instanceof Po||!o&&!a&&!i?s:Ie(s).pipeThrough(new Ar({onstart:o,onprogress:a,onend:i,size:e.size}),{signal:n})}(r,n,e,a),s=!Jn(t)&&Boolean(e.preventClose);return r.uncompressedSize=n.size,await Ie(i).pipeTo(Ce(t.writable),{signal:a,preventClose:s,preventAbort:s}),t.getData?t.getData():t.writable}}isPasswordProtected(){return Boolean(this.data&&this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,Object.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==Ht)return!1;throw t}}getText(t,e){return this.getData(new Rn(t),e)}getBlob(t,e){return this.getData(new xn(t),e)}getData64URI(t,e){return this.getData(new bn(t),e)}getUint8Array(t){return this.getData(new qn,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Dt(await this.getUint8Array(t)).buffer}replaceBlob(t){Object.assign(this,{data:t,Reader:gn,Writer:xn,reader:null})}replaceText(t){Object.assign(this,{data:t,Reader:An,Writer:Rn,reader:null})}replaceData64URI(t){Object.assign(this,{data:t,Reader:yn,Writer:bn,reader:null})}replaceUint8Array(t){Object.assign(this,{data:t,Reader:Hn,Writer:qn,reader:null})}replaceReadable(t){Object.assign(this,{data:null,Reader:ic(t),Writer:null,reader:null})}}class tc extends Qs{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new tc(e.fs,e.name,e);return t&&(r.children=e.children.map(e=>{const n=e.clone(t);return n.parent=r,n})),r}addDirectory(t,e){return Sc(this,t,{options:e},!0)}addText(t,e,r={}){return Sc(this,t,{data:e,Reader:An,Writer:Rn,options:r,uncompressedSize:zn(e)})}addBlob(t,e,r={}){return Sc(this,t,{data:e,Reader:gn,Writer:xn,options:r,uncompressedSize:e.size})}addData64URI(t,e,r={}){let n=e.length;for(;"="==e.charAt(n-1);)n--;const o=e.indexOf(",")+1;return Sc(this,t,{data:e,Reader:yn,Writer:bn,options:r,uncompressedSize:Math.floor(.75*(n-o))})}addUint8Array(t,e,r={}){return Sc(this,t,{data:e,Reader:Hn,Writer:qn,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return Sc(this,t,{data:e,Reader:class extends Vn{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return Sc(this,t,{Reader:ic(e),options:r})}addFileSystemEntry(t,e={}){return yc(this,t,e)}addFileSystemHandle(t,e={}){return yc(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),Sc(this,t.name,{data:t,Reader:function(){return{readable:t.stream(),size:t.size}},options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new gn(t),e)}importData64URI(t,e){return this.importZip(new yn(t),e)}importUint8Array(t,e){return this.importZip(new Hn(t),e)}importHttpContent(t,e){return this.importZip(new Vn(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new xn(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new bn(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new qn,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:n,onprogress:o,onend:a}=r,i=hc(r.readerOptions),s=new AbortController,{signal:c}=s,u=function(t,e){if(!nt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const r=()=>e.abort(t.reason);return t.addEventListener("abort",r,{once:!0}),()=>t.removeEventListener("abort",r)}(r.signal,s),l=Object.assign({},r,i,{signal:c,onstart:U,onprogress:U,onend:U,preventClose:!1}),f=nc([t],t=>ac(t,l.passThrough)),d=[];let w=!1,h=0;try{n&&await zr(n,f),await m(t,e),a&&await zr(a,h)}catch(t){try{t.exportedEntryNames=d}catch{}throw t}finally{u()}return e;function p(t){const e=t.getWriter();return new WritableStream({async write(t){await e.write(t),h+=t.length,o&&await zr(o,h,f)},close:()=>e.close(),abort:t=>e.abort(t)})}async function m(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>y(t,e)))).filter(t=>"rejected"==t.status);if(r.length){const t=r.filter(t=>!fc(t.reason));throw function(t){const[e]=t,r=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(r.length)try{e.entryErrors=[...e.entryErrors||[],...r]}catch{}return e}((t.length?t:r).map(t=>t.reason))}}else for(const r of t.children)await y(r,e)}async function y(e,r){if(c.aborted){if(w||fc(c.reason))return;throw c.reason===U?new DOMException(Xs,"AbortError"):c.reason}try{if(e.directory){const t=await r.getDirectoryHandle(e.name,{create:!0});await m(e,t)}else{const n=await r.getFileHandle(e.name,{create:!0}),o=await n.createWritable();try{await e.getData({writable:p(o)},l)}catch(t){throw w?new Error(Gs):t}d.push(e.getRelativeName(t))}}catch(r){w=!0,s.abort(new Error(Gs));try{r.entryName===U&&(r.entryName=e.getRelativeName(t),r.entryId=e.id)}catch{}throw r}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==v?(r=t,e=Object.assign({},r.options,e)):(await Qn(t),r=new fa(t,e));const n=[],o=await r.getEntries(e);for(const t of o){let r=this;try{const o=t.filename.split("/").filter(t=>""!=t&&"."!=t),a=o.pop();if(o.forEach(t=>{const e=r;if(r=r.getChildByName(t),r){if(!r.directory)throw new Error(Zs)}else r=new tc(this.fs,t,{data:null},e),n.push(r)}),t.directory){let e=r;if(a)if(e=r.getChildByName(a),e){if(!e.directory)throw new Error(Zs)}else e=new tc(this.fs,a,{data:null},r),n.push(e);e==this||e.data||(e.data=t)}else n.push(Sc(r,a,{data:t,Reader:sc(Object.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}catch(e){try{e.cause={entry:t}}catch{}throw e}}return n}async exportZip(t,e={}){const r=this;(e=Object.assign({},e)).bufferedWrite===U&&(e.bufferedWrite=!0);const[n]=await Promise.all([uc(r,hc(e.readerOptions)),Qn(t)]),o=new Ui(t,e);return await async function(t,e,r,n,o){const{onstart:a,onprogress:i,onend:s,onentryprogress:c}=n,u=e,l=nc(e.children,t=>mc(t)?0:1);let f=0,d=0;if(a&&await zr(a,r),n.bufferedWrite)await async function t(e){const r=(await Promise.allSettled(e.children.map(async e=>{await w(e),await t(e)}))).find(t=>"rejected"==t.status);if(r)throw r.reason}(e);else for(const t of e.getChildren({recursive:!0}))await w(t);async function w(e){if(mc(e))return;const{name:a,dr:s}=dc(e,u,n);let w=0;const h=await t.add(a,o.get(e),Object.assign(s,{onstart:U,onend:U,onprogress:async t=>{f+=t-w,w=t,i&&await zr(i,f,r)}}));d++,c&&await zr(c,d,l,h)}s&&await zr(s,f)}(o,r,nc([r],oc),e,n),await o.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(r={}){const n=this;hc((r=Object.assign({},r)).readerOptions),r.bufferedWrite===U&&(r.bufferedWrite=!0);const o=!r.bufferedWrite||!1!==r.keepOrder&&n.children.every(t=>!t.children.length);return async function(r,n,o,a){const i={options:r};if(rt(r[K]))throw new Error(di);if(a!==U&&!(a instanceof Uint8Array))throw new Error(qa);const s=Ss(a);if(s>e)throw new Error(Ha);const c=r[q],u=new Map;let l=Boolean(c);const f=r[H]===U?0:r[H];let w=f,h=k;for(const t of n){let{name:e}=t;const{size:r}=t,n=Object.assign({},t.options);e=e.trim(),ss(i,n,Uo)&&!e.endsWith(R)&&(e+=R);const o=Ci(i,e,n);({name:e}=o);const{ge:a}=Ni(i,e,n);0==a.level||a.compressionMethod!==U||a.passThrough||await Sr(mt())||(a.level=0);const s=!ss(i,n,Uo);if(s&&r===U)throw new Error(di);const{Xe:l,ge:f}=Bi(i,s,r,a,n);if(s&&!a.passThrough&&hs(f.compressionMethod,f.level))throw new Error(di);const d=Object.assign({},n,o.ge,a,f,{[q]:c}),p=Pi(d),m=Li(d),y={Re:p,Oe:Ss(p.xe,m.Ae)};c&&_i(y,w);const b=s?l:0;u.set(e,Object.assign({},d,p,{offset:w,diskNumberStart:0,compressedSize:b}));const E=y.Oe+b;h=Math.min(h,E),w+=E}if(u.size&&w-h>=t&&(l=!0),l&&!o)throw new Error(di);const p=Vi(u);let m=ss(i,r,zo);if(w>=t||p>=t||u.size>=e){if(!1===m)throw new Error(ui);m=!0}return w-f+p+s+(m?98:d)}(r,n.getChildren({recursive:!0}).filter(t=>!mc(t)).map(t=>{const{name:e,dr:o}=dc(t,n,r);return{name:e,size:t.directory?0:wc(t,pc(t,r)),options:o}}),o,r.globalComment)}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}getChildren(t={}){return function(t,e){const r=[],n=[t];let o=0;for(;o<n.length;)for(const t of n[o++].children)r.push(t),e&&n.push(t);return r}(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const r=this.children;return!(await Promise.all(r.map(r=>r.checkPassword(t,e)))).includes(!1)}}class ec{constructor(){Ec(this)}get children(){return this.root.children}remove(t){lc(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const r of t.children)e.push(r)}t.parent=U}move(t,e){if(t==this.root)throw new Error("Root directory cannot be moved");if(!e.directory)throw new Error("Target entry is not a directory");if(e.isDescendantOf(t))throw new Error("Entry is a ancestor of target entry");if(t!=e){const r=e.getChildByName(t.name);if(r){if(r!=t)throw new Error(Zs)}else lc(t),t.parent=e,e.children.push(t),function(t,e){const r=[e];for(;r.length;){const e=r.pop();t.entries[e.id]=e;for(const t of e.children)r.push(t)}}(this,t)}}find(t){const e=t.split("/");let r=this.root;for(let t=0;r&&t<e.length;t++)r=r.getChildByName(e[t]);return r||(r=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),r}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,r){return this.root.addText(t,e,r)}addBlob(t,e,r){return this.root.addBlob(t,e,r)}addData64URI(t,e,r){return this.root.addData64URI(t,e,r)}addUint8Array(t,e,r){return this.root.addUint8Array(t,e,r)}addHttpContent(t,e,r){return this.root.addHttpContent(t,e,r)}addReadable(t,e,r){return this.root.addReadable(t,e,r)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Ec(this),this.root.importBlob(t,e)}importData64URI(t,e){return Ec(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return Ec(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return Ec(this),this.root.importHttpContent(t,e)}importReadable(t,e){return Ec(this),this.root.importReadable(t,e)}importZip(t,e){return Ec(this),this.root.importZip(t,e)}exportBlob(t){return this.root.exportBlob(t)}exportData64URI(t){return this.root.exportData64URI(t)}exportUint8Array(t){return this.root.exportUint8Array(t)}exportWritable(t,e){return this.root.exportWritable(t,e)}exportFileSystemHandle(t,e){return this.root.exportFileSystemHandle(t,e)}exportZip(t,e){return this.root.exportZip(t,e)}getExportedSize(t){return this.root.getExportedSize(t)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}}const rc={FS:ec,ZipDirectoryEntry:tc,ZipFileEntry:$s};function nc(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=e(t)||0;for(const e of t.children)n.push(e)}return r}function oc(t){return t.uncompressedSize}function ac(t,e){const{data:r}=t;return e&&r instanceof Po?r.compressedSize:t.uncompressedSize}function ic(t){let e;return function(){if(e)throw new Error(Hs);return e=!0,{readable:t}}}function sc(t){return class extends pn{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=Object.assign({},t,e.options),{checkOverlappingEntry:n,checkOverlappingEntryOnly:o}=r,a=await e.entry.getData(new xn,Object.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:o||n,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=a,e.wr=new gn(a),e.size=a.size,super.init()}readUint8Array(t,e){return this.wr.readUint8Array(t,e)}}}function cc(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function uc(t,e){const r=[],n=[t],o=new Map;for(;n.length;){const t=n.pop();for(const e of t.children)e.directory?n.push(e):r.push(e)}return await Promise.all(r.map(async t=>{const r=t.reader=cc(t.Reader,t.data,e);o.set(t,r);try{await Qn(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==U&&(t.uncompressedSize=r.size,t.ur=!1)})),o}function lc(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function fc(t){return Boolean(t)&&t.message==Gs}function dc(t,e,n){const o=n.relativePath?t.getRelativeName(e):t.getFullname(),a=t.options||{};let i={},s={};if(t.data instanceof Po){const{externalFileAttributes:e,versionMadeBy:o,comment:c,lastModDate:u,rawLastModDate:l,creationDate:f,lastAccessDate:d,uncompressedSize:w,encrypted:h,zipCrypto:p,crc32:m,compressionMethod:y,extraFieldAES:b,internalFileAttributes:E,extraField:S,bitFlag:g,uid:x,gid:A}=t.data;i={externalFileAttributes:e,versionMadeBy:o,comment:c,lastModDate:u,creationDate:f,lastAccessDate:d,internalFileAttributes:E};const z=function(t){if(t){const e=new Map;if(t.forEach((t,r)=>{Js.has(r)||e.set(r,t.data)}),e.size)return e}}(S);if(z&&(i.extraField=z),x===U&&A===U||Object.assign(i,{uid:x,gid:A,unixExtraFieldType:"infozip"}),pc(t,n)){let t;b&&(t=b.strength),s={passThrough:!0,encrypted:h,zipCrypto:p,crc32:m,uncompressedSize:w,encryptionStrength:t,compressionMethod:y},g&&(s.dataDescriptor=g.dataDescriptor);const e=a.lastModDate===U?n.lastModDate:a.lastModDate;if(e===U)s.rawLastModDate=l;else if(p&&(!g||g.dataDescriptor)&&e instanceof Date&&function(t){let e=new Date(2e3*Math.ceil(Math.floor(t.getTime()/1e3)/2));return e<O?e=O:e>F&&(e=F),(e.getHours()<<3|e.getMinutes()>>3)&r}(e)!=(l>>>8&r))throw new Error(Ys)}}const c=Object.assign({lastModDate:t.lr},i,n,a,s,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===U)throw new Error(qs);return{name:o,dr:c}}function wc(t,e){const{reader:r}=t;return r&&r.size!==U?r.size:t.ur?U:ac(t,e)}function hc(t){if(t&&(typeof t!=I||Array.isArray(t)))throw new Error(Ks);return t}function pc(t,e){const{readerOptions:r}=e;return Boolean(!t.directory&&(t.passThrough||r&&r.passThrough))}function mc(t){return t.directory&&null===t.data}function yc(t,e,r){return async function t(e,n,o,a=""){if(n){const i=a?a+"/"+n.name:n.name;try{if((n.isFile||n.isDirectory)&&(n=await bc(n)),"file"==n.kind){const t=await n.getFile();o.push(Sc(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:Object.assign({},{lastModDate:new Date(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==n.kind){const a=e.addDirectory(n.name,r);o.push(a);for await(const e of n.values())await t(a,e,o,i)}}catch(t){try{t.entryName===U&&(t.entryName=i)}catch{}throw t}}return o}(t,e,[])}async function bc(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new Promise((e,r)=>t.file(e,r))),t.isDirectory){e.kind="directory";const r=await async function(t){const e=[];function r(t,n,o){t.readEntries(async a=>{if(a.length){for(const t of a)e.push(await bc(t));r(t,n,o)}else n(e)},o)}return await new Promise((e,n)=>r(t.createReader(),e,n)),{[Symbol.iterator](){let t=0;return{next(){const r={value:e[t],done:t==e.length};return t++,r}}}}}(t);e.values=()=>r}return e}function Ec(t){t.entries=[],t.cr=0,t.root=new tc(t)}function Sc(t,e,r,n){if(t.directory)return n?new tc(t.fs,e,r,t):new $s(t.fs,e,r,t);throw new Error("Parent entry is not a directory")}export{gn as BlobReader,xn as BlobWriter,yn as Data64URIReader,bn as Data64URIWriter,Xs as ERR_ABORTED,Qo as ERR_AMBIGUOUS_ARCHIVE,_o as ERR_BAD_FORMAT,Vo as ERR_CENTRAL_DIRECTORY_NOT_FOUND,Za as ERR_DUPLICATED_NAME,qo as ERR_ENCRYPTED,$o as ERR_ENCRYPTED_CENTRAL_DIRECTORY,Jo as ERR_ENTRY_DATA_OUT_OF_BOUNDS,Zs as ERR_ENTRY_EXISTS,Lo as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,Wo as ERR_EOCDR_NOT_FOUND,Ho as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,rn as ERR_HTTP_RANGE,nn as ERR_HTTP_RESOURCE_CHANGED,Kt as ERR_INVALID_AUTHENTICATION_CODE,Ne as ERR_INVALID_CODEC_DEFINITION,Be as ERR_INVALID_CODEC_MODULE,Ha as ERR_INVALID_COMMENT,qa as ERR_INVALID_COMMENT_TYPE,Ye as ERR_INVALID_COMPRESSED_DATA,Ge as ERR_INVALID_CRC32,Ga as ERR_INVALID_DATE,Qa as ERR_INVALID_ENCRYPTION_STRENGTH,Ka as ERR_INVALID_ENTRY_COMMENT,Ya as ERR_INVALID_ENTRY_COMMENT_TYPE,Xa as ERR_INVALID_ENTRY_NAME,ei as ERR_INVALID_EXTRAFIELD,oi as ERR_INVALID_EXTRAFIELD_DATA,ni as ERR_INVALID_EXTRAFIELD_DATA_TYPE,ri as ERR_INVALID_EXTRAFIELD_TYPE,ra as ERR_INVALID_FILENAME_VALIDATION,$ as ERR_INVALID_FUNCTION_OPTION,mi as ERR_INVALID_GID,xi as ERR_INVALID_LEVEL,na as ERR_INVALID_MAX_APPENDED_DATA_SIZE,ct as ERR_INVALID_MAX_WORKERS,Si as ERR_INVALID_MSDOS_ATTRIBUTES,gi as ERR_INVALID_MSDOS_DATA,Ht as ERR_INVALID_PASSWORD,et as ERR_INVALID_PASSWORD_TYPE,qs as ERR_INVALID_PASS_THROUGH,Ks as ERR_INVALID_READER_OPTIONS,tt as ERR_INVALID_SIGNAL,qt as ERR_INVALID_SIGNATURE,Ai as ERR_INVALID_SIGNATURE_DATA,ea as ERR_INVALID_STRICTNESS,pi as ERR_INVALID_UID,Ke as ERR_INVALID_UNCOMPRESSED_SIZE,bi as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,Ei as ERR_INVALID_UNIX_ID_SIZE,yi as ERR_INVALID_UNIX_MODE,Ja as ERR_INVALID_VERSION,on as ERR_ITERATOR_COMPLETED_TOO_SOON,Zo as ERR_LOCAL_FILE_HEADER_NOT_FOUND,Xo as ERR_OVERLAPPING_ENTRY,Hs as ERR_READABLE_CONSUMED,je as ERR_RESERVED_COMPRESSION_METHOD,Go as ERR_SPLIT_ZIP_FILE,fi as ERR_UNDEFINED_COMPRESSION_METHOD,wi as ERR_UNDEFINED_READER,li as ERR_UNDEFINED_UNCOMPRESSED_SIZE,di as ERR_UNDETERMINED_SIZE,ta as ERR_UNSAFE_FILENAME,Yo as ERR_UNSUPPORTED_COMPRESSION,Ts as ERR_UNSUPPORTED_CONTEXT,Gt as ERR_UNSUPPORTED_CRYPTO_API,Ko as ERR_UNSUPPORTED_ENCRYPTION,ti as ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH,$a as ERR_UNSUPPORTED_ENCRYPTION_USDZ,ui as ERR_UNSUPPORTED_FORMAT,oa as ERR_UNSUPPORTED_UINT64,pr as ERR_WORKER_STARTUP_TIMEOUT,an as ERR_WRITER_NOT_INITIALIZED,Ys as ERR_ZIP_CRYPTO_LAST_MOD_DATE,hi as ERR_ZIP_NOT_EMPTY,Zn as HttpRangeReader,Vn as HttpReader,pn as Reader,Kn as SplitDataReader,Yn as SplitDataWriter,An as TextReader,Rn as TextWriter,Hn as Uint8ArrayReader,qn as Uint8ArrayWriter,mn as Writer,tc as ZipDirectoryEntry,Qs as ZipEntry,ec as ZipFS,$s as ZipFileEntry,fa as ZipReader,da as ZipReaderStream,Ui as ZipWriter,ki as ZipWriterStream,Et as configure,Os as createBlobTempStream,Ds as createOPFSTempStream,vs as createSyncAccessHandleTempStream,rc as fs,As as getMimeType,Le as registerCodec,zt as resetConfiguration,Vs as terminateWorkers,Ve as unregisterCodec};
|