@zip.js/zip.js 2.8.57 → 2.8.59

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.
@@ -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&&lt!=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,A=16384,R=2048,x=1024,D="/",z=30,F=new Date(2107,11,31,23,59,58),O=new Date(1980,0,1),U=void 0,T=1/0,I="undefined",k="function",C="object",M="string",v=new Uint8Array,N="password",_="rawPassword",B="passThrough",j="signal",P="useWebWorkers",W="useCompressionStream",L="transferStreams",Z="preventClose",V="dataDescriptor",H="offset",G="usdz",K="maxAppendedDataSize",q="signCentralDirectory",Y="filename",X="comment",J="strict",Q="balanced",$="tolerant",tt="Invalid option (must be a function)",et="Invalid signal (must be an AbortSignal instance)",rt="Invalid password (password must be a string, rawPassword must be a Uint8Array)";function nt(t){if(t&&typeof t!=k)throw new Error(tt);return t}function ot(t){if(t&&(typeof t.addEventListener!=k||"boolean"!=typeof t.aborted))throw new Error(et);return t||U}function at(t,e){if(t&&typeof t!=M||e&&!(e instanceof Uint8Array))throw new Error(rt)}function it(t,e,r){if(!Number.isInteger(t)||t<0||t>e)throw new Error(r)}function st(t,e,r){t!==U&&it(t,e,r)}function ct(t){return typeof t==M&&t.trim()?Number(t):t}const ut="Invalid maxWorkers (must be an integer greater than 0)";let lt=2;try{typeof navigator!=I&&navigator.hardwareConcurrency&&(lt=navigator.hardwareConcurrency)}catch{}const ft={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:lt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=I&&CompressionStream,DecompressionStream:typeof DecompressionStream!=I&&DecompressionStream},dt="maxWorkers",wt=["chunkSize",dt,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],ht=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],pt=["baseURI","wasmURI","workerURI","useCompressionStream","useWebWorkers","transferStreams",...wt,...ht],mt={...ft};function yt(){return mt}function bt(t){return Et(t.chunkSize)}function Et(t){return t=ct(t),Number.isInteger(t)&&t>=1?Math.max(t,64):65536}function St(t){Object.assign(mt,gt(Rt(t)))}function gt(t){const e={};for(const r of pt){const n=t[r];n!==U&&(e[r]=At(r,n))}return e}function At(t,e){if(wt.includes(t)){if(e=ct(e),t==dt&&(!Number.isInteger(e)||e<1))throw new Error(ut)}else ht.includes(t)&&nt(e);return e}function Rt(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 xt(t){const e=gt(Rt(t));Object.assign(ft,e),Object.assign(mt,e)}function Dt(){for(const t of pt)delete mt[t];Object.assign(mt,ft)}function zt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function Ft(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function Ot(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const Ut=[[],[],[],[],[],[],[],[]];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;Ut[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const r=Ut[e-1][t];Ut[e][t]=r>>>8^Ut[0][255&r]}const[Tt,It,kt,Ct,Mt,vt,Nt,_t]=Ut;class Bt{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=_t[255&t]^Nt[t>>>8&255]^vt[t>>>16&255]^Mt[t>>>24&255]^Ct[255&r]^kt[r>>>8&255]^It[r>>>16&255]^Tt[r>>>24&255]}}for(;n<r;n++)e=e>>>8^Tt[255&(e^t[n])];this.o=e}get(){return~this.o}}class jt extends TransformStream{constructor(){let t;const e=new Bt;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==I){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 Wt={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=Wt.l(r);return 32===n?t.concat(e):Wt.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)+Wt.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]=Wt.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=Wt.l(o);return n.push(Wt.S(e+a&31,e+a>32?r:n.pop(),1)),n}},Lt={bytes:{A(t){const e=Wt.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(Wt.S(8*(3&r),n)),e}}},Zt=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=Lt.I.R(t));const r=e.U=Wt.concat(e.U,t),n=e.T,o=e.T=n+Wt.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.C(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=Wt.concat(e,[Wt.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.C(e.splice(0,16));return t.reset(),r}v(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}C(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.v(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._(Lt.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=Wt;for(e=Lt.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)},_:class{constructor(t){const e=this,r=e.j=Zt,n=[[],[]];e.P=[new r,new r];const o=e.P[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.P[0].update(n[0]),e.P[1].update(n[1]),e.W=new r(e.P[0])}reset(){const t=this;t.W=new t.j(t.P[0]),t.L=!1}update(t){this.L=!0,this.W.update(t)}digest(){const t=this,e=t.W.M(),r=new t.j(t.P[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)}}},Ht=typeof crypto!=I&&typeof crypto.getRandomValues==k,Gt="Invalid password",Kt="Invalid signature",qt=Kt,Yt="zipjs-abort-check-password",Xt="Crypto API not supported";function Jt(t){if(Ht)return crypto.getRandomValues(t);throw new Error(Xt)}const Qt=16,$t={name:"PBKDF2"},te=Object.assign({hash:{name:"HMAC"}},$t),ee=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},$t),re=["deriveBits"],ne=[8,12,16],oe=[16,24,32],ae=10,ie=[0,0,0,0],se=typeof crypto!=I,ce=se&&crypto.subtle,ue=se&&typeof ce!=I,le=Lt.bytes,fe=class{constructor(t){const e=this;e.Z=[[[],[],[],[],[]],[[],[],[],[],[]]],e.Z[0][0][0]||e.V();const r=e.Z[0][4],n=e.Z[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)}V(){const t=this.Z[0],e=this.Z[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.Z[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}},de=class{constructor(t,e){this.G=t,this.K=e,this.Y=e}reset(){this.Y=this.K}update(t){return this.X(this.G,t,this.Y)}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=Wt.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 Wt.m(e,o)}},we=Vt._;let he=se&&ue&&typeof ce.importKey==k,pe=se&&ue&&typeof ce.deriveBits==k;class me extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:o=!0}){super({start(){be(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 Se(t,e,r,Ae(n,0,ne[e])),a=Ae(n,ne[e]);if(o[0]!=a[0]||o[1]!=a[1])throw new Error(Gt)}(r,a,o,Ae(t,0,ne[a]+2)),t=Ae(t,ne[a]+2),n?e.error(new Error(Yt)):i()):await s;const c=new Uint8Array(t.length-ae-(t.length-ae)%Qt);e.enqueue(Ee(r,t,c,0,ae,!0))},async flush(t){const{nt:e,ot:r,it:n,ready:a}=this;if(r&&e){await a;const i=Ae(n,0,n.length-ae),s=Ae(n,n.length-ae);let c=v;if(i.length){const t=xe(le,i);r.update(t);const n=e.update(t);c=Re(le,n)}const u=Ae(Re(le,r.digest()),0,ae);let l=n.length<ae?1:0;for(let t=0;t<ae;t++)l|=u[t]^s[t];if(l&&o)throw new Error(qt);t.enqueue(c)}}})}}class ye extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){be(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:o,et:a,ready:i}=r;let s=v;n?(s=await async function(t,e,r){const n=Jt(new Uint8Array(ne[e]));return zt(n,await Se(t,e,r,n))}(r,o,n),a()):await i;const c=new Uint8Array(s.length+t.length-t.length%Qt);c.set(s,0),e.enqueue(Ee(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=v;if(n.length){const t=e.update(xe(le,n));r.update(t),a=Re(le,t)}const i=Re(le,r.digest()).slice(0,ae);t.enqueue(zt(a,i))}}})}}function be(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.et=e),password:ge(e,r),strength:n-1,it:v})}function Ee(t,e,r,n,o,a){const{nt:i,ot:s,it:c}=t;c.length&&(e=zt(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%Qt)),l=0;l<=u-Qt;l+=Qt){const t=xe(le,Ae(e,l,l+Qt));a&&s.update(t);const o=i.update(t);a||s.update(o),r.set(Re(le,o),l+n)}return t.it=Ae(e,l),r}async function Se(t,e,r,n){t.password=null;const o=await async function(t,e,r,n,o){if(!he)return Vt.importKey(e);try{return await ce.importKey("raw",e,r,!1,o)}catch{return he=!1,Vt.importKey(e)}}(0,r,te,0,re),a=await async function(t,e,r){if(!pe)return Vt.B(e,t.salt,ee.iterations,r);try{return await ce.deriveBits(t,e,r)}catch{return pe=!1,Vt.B(e,t.salt,ee.iterations,r)}}(Object.assign({salt:n},ee),o,8*(2*oe[e]+2)),i=new Uint8Array(a),s=xe(le,Ae(i,0,oe[e])),c=xe(le,Ae(i,oe[e],2*oe[e])),u=Ae(i,2*oe[e]);return Object.assign(t,{keys:{key:s,st:c,passwordVerification:u},nt:new de(new fe(s),Array.from(ie)),ot:new we(c)}),u}function ge(t,e){return e===U?Pt(t):e}function Ae(t,e,r){return t.subarray(e,r)}function Re(t,e){return t.A(e)}function xe(t,e){return t.R(e)}class De extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){Fe(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=Oe(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw new Error(Gt);t=t.subarray(12)}n?e.error(new Error(Yt)):e.enqueue(Oe(r,t))}})}}class ze extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){Fe(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=Jt(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(Ue(r,e),0),o=12}else n=new Uint8Array(t.length),o=0;n.set(Ue(r,t),o),e.enqueue(n)}})}}function Fe(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 Bt(n[0]),ut:new Bt(n[2])}),r)for(let e=0;e<r.length;e++)Te(t,r[e]);else for(let r=0;r<e.length;r++)Te(t,e.charCodeAt(r))}(t,e,r)}function Oe(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ie(t)^e[n],Te(t,r[n]);return r}function Ue(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ie(t)^e[n],Te(t,e[n]);return r}function Te(t,e){let[,r]=t.keys;t.ct.append([e]);const n=~t.ct.get();r=Ce(Math.imul(Ce(r+ke(n)),134775813)+1),t.ut.append([r>>>24]);const o=~t.ut.get();t.keys=[n,r,o]}function Ie(t){const e=2|t.keys[2];return ke(Math.imul(e,1^e)>>>8)}function ke(t){return 255&t}function Ce(t){return 4294967295&t}function Me(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 ve(t,e){t=Me(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 Ne(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 _e="Invalid codec definition",Be="Reserved compression method",je="Invalid codec module",Pe=[0,8,9,99],We=new Map,Le=new Map;function Ze(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(_e);if(Pe.includes(r))throw new Error(Be);const c=typeof a==k||typeof i==k;if(!(c||typeof o==M&&o.length))throw new Error(_e);We.set(r,{compressionMethod:r,format:n,codecURI:o,versionNeeded:s}),c&&Ke(n,{CompressionStream:a,DecompressionStream:i})}function Ve(t){const e=We.get(t);if(e){let r;We.delete(t),We.forEach(t=>r=r||t.format==e.format),r||Le.delete(e.format)}}function He(t){return We.get(t)}function Ge(t){return Le.get(t)}function Ke(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=k&&typeof n!=k)throw new Error(je);Le.set(t,{CompressionStream:r,DecompressionStream:n})}const qe="Invalid uncompressed size",Ye="Invalid compressed data",Xe=Kt,Je="deflate-raw",Qe="gzip",$e=[31,139,8];class tr 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&&Ge(f),E=c&&o&&!l&&!b&&(!a||s)&&Boolean(i&&n);if(a&&!s||!c||E||(h=new jt,y=ur(y,h)),o)if(b)y=lr(y,sr(b.CompressionStream,f,{level:u,chunkSize:e,compressionMethod:d}));else if(E)m=new er,y=lr(y,new n(Qe)),y=ur(y,m);else try{y=cr(y,i,{level:u,chunkSize:e},n,r)}catch(t){let e;try{e=new n(Qe)}catch{throw t}y=lr(y,e),y=ur(y,new er)}a&&(s?y=ur(y,new ze(t)):(p=new ye(t),y=ur(y,p))),ir(w,y,()=>{a&&!s||!c||(w.crc32=E?m.crc32:new DataView(h.value.buffer).getUint32(0))})}}class er 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=zt(r,t));const a=o-8,i=Math.min(a,r.length);n.enqueue(zt(r.subarray(0,i),t.subarray(0,a-i))),r=zt(r.subarray(i),t.subarray(a-i))},flush(){const e=Ot(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class rr 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=ur(y,new De(t)):(m=new me(t),y=ur(y,m))),c){const t=f&&Ge(f);if(t)y=lr(y,sr(t.DecompressionStream,f,{chunkSize:e,compressionMethod:d,rawBitFlag:w,uncompressedSize:h}));else try{y=cr(y,u,{chunkSize:e,deflate64:l},n,r)}catch(t){if(l||h===U)throw t;let e;try{e=new n(Qe)}catch{throw t}y=function(t,e,r){const n=new Bt;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($e),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=Ot(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=ur(t,l),ur(t=lr(t,e),f);function d(){w(),o=setTimeout(()=>i(new Error(qe)),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 jt,y=ur(y,p)),ir(this,y,()=>{if(i){const t=new DataView(p.value.buffer);if(s!=t.getUint32(0,!1))throw new Error(Xe)}})}}const nr=new Map;function or(t,e){if(!t)return!1;let r=nr.get(t);r||(r=new Map,nr.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 ar(t){return or(t,Je)}function ir(t,e,r){e=ur(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function sr(t,e,r){if(!t)throw new Error("Compression method not supported");return new t(e,r)}function cr(t,e,r,n,o){const a=e&&n?n:o||n,i=r.deflate64?"deflate64-raw":Je;let s;try{s=new a(i,r)}catch(t){if(!e||!o||a==o)throw t;s=new o(i,r)}return lr(t,s)}function ur(t,e){return Me(t).pipeThrough(e)}function lr(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 fr="data",dr="deflate",wr="inflate";class hr extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let o;n.startsWith(dr)?o=tr:n.startsWith(wr)&&(o=rr),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(qe)},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 pr 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 mr="Worker startup timeout";let yr,br,Er,Sr=()=>{};async function gr(t){const{CompressionStream:e,CompressionStreamFallback:r}=t;if(r&&!r.lt)return!0;if(ar(e)||or(e,Qe))return!0;if(r)try{return await Sr(t),!0}catch{return!1}return!1}function Ar(t){t.createWorker?br=!0:yr=!1}class Rr{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 br&&(u=U),Object.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new pr(bt(o))).pipeThrough(new xr(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)}}}),yr===U&&(yr=typeof Worker!=I),(i&&Er&&(yr&&c||u)?Er:zr)(t,o)}}class xr extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let o=0;super({async start(){t&&await Dr(t,r)},async transform(t,n){o+=t.length,e&&await Dr(e,o,r),n.enqueue(t)},async flush(){n&&await Dr(n,o)}})}}async function Dr(t,...e){try{await t(...e)}catch{}}function zr(t,e){return{run:()=>Fr(t,e)}}async function Fr({options:t,readable:e,writable:r,St:n},o){let a;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(dr),r=e?o.CompressionStreamFallback:o.DecompressionStreamFallback,n=e?o.CompressionStream:o.DecompressionStream;if(t.useCompressionStream){if(r&&r.lt&&!ar(n))try{await Sr(o)}catch{}}else try{await Sr(o)}catch{r&&!r.lt||(t.useCompressionStream=!0)}}a=new hr(t,o),await e.pipeThrough(a).pipeThrough(new pr(bt(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 Or={type:"module"},Ur="error";let Tr,Ir,kr,Cr=!0;try{Cr=typeof structuredClone==k&&structuredClone(new DOMException("","AbortError")).code!==U}catch{}var Mr;function vr(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Nr(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.Et=null}function _r(t,e,r,n,o=!0){const{createWorker:a}=r;let i,s,c;if(a)i=a();else if(Ir===U||Tr!==t){const a=typeof t==k;s=a?t(o):t;const u=s.startsWith("data:"),l=s.startsWith("blob:");if(u||l){n===U&&(n=!1),n&&(c=Or);try{i=new Worker(s,c)}catch(o){if(l)try{URL.revokeObjectURL(s)}catch{}if(a&&l)return _r(t,e,r,n,!1);if(n)throw o;return _r(t,e,r,!0,!1)}}else{n===U&&(n=!0),n&&(c=Or);try{s=new URL(s,e)}catch{}try{i=new Worker(s,c)}catch(a){if(n)return _r(t,e,r,!1,o);throw a}}Tr=t,Ir=s,kr=c}else i=new Worker(Ir,kr);return i.addEventListener("message",t=>{r.At=!0,Br(r),async function({data:t},e){const{type:r,value:n,messageId:o,result:a,error:i}=t,{reader:s,writer:c,Rt:u,xt: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:fr,value:t,done:r,messageId:o},e)}r==fr&&(await c.ready,await c.write(new Uint8Array(n)),w()||Pr({type:"ack",messageId:o},e)),"close"==r&&h(null,a)}}catch(i){w()||(Nr(e),h(i))}function h(t,e){w()||(t?l(t):u(e),c&&c.releaseLock(),t&&t.codecImportFailed||f())}}(t,r)}),i.addEventListener(Ur,t=>jr(t,r)),i.addEventListener("messageerror",t=>jr(t,r)),i}function Br(t){const{Dt:e}=t;e&&(clearTimeout(e),t.Dt=null)}function jr(t,e){t.preventDefault&&t.preventDefault(),Br(e);const{At:r,xt:n,writer:o,St:a}=e;Nr(e),r||(e.yt=null);let i=t.error||new Error(t.message||Ur);r||(i=Object.assign(new Error(i.message||Ur),{zt:!0}),e.Ft=i),n&&(n(i),o&&o.releaseLock(),r&&a())}function Pr(t,{yt:e,writer:r,transferStreams:n,At:o}){try{const{value:r,readable:a,writable:i}=t,s=[];if(r&&(t.value=Ft(r),s.push(t.value.buffer)),n&&Cr&&o?(a&&s.push(a),i&&s.push(i)):t.readable=t.writable=null,s.length)try{return e.postMessage(t,s),!0}catch{Cr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}Mr=function(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:o}=e;let{wasmURI:a}=e;if(!t.Et){let i;typeof a==k&&(a=a());try{i=_r(t.workerURI,r,t)}catch{return Ar(t),zr(t,e)}Object.assign(t,{yt:i,At:!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(mr);throw r.zt=!0,r}let r,n;const o=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,Rt:r,xt: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.At&&Number.isFinite(f)&&f>=0&&(t.Dt=setTimeout(()=>function(t){if(t.Dt=null,t.At)return;const{xt:e,writer:r}=t;if(Nr(t),t.yt=null,e){const t=new Error(mr);t.zt=!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.zt)return Ar(t),vr(t),Fr(t,e);if(r&&r.codecImportFailed){if(t.reader)return vr(t),Fr(t,e);t.St()}throw r}}}})}return t.Et},Er=Mr;let Wr=[];const Lr=[];let Zr,Vr,Hr=0;async function Gr(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){!Le.has(t)&&e&&Ke(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=Wr.find(t=>!t.wt);if(r)return Jr(r),new Rr(r,t,e,b);if(Wr.length<p){const r={Ut:Hr};return Hr++,Wr.push(r),new Rr(r,t,e,b)}return new Promise(r=>{Lr.push({resolve:r,stream:t,Tt:e}),Vr=n.workerStarvationTimeout,Kr()})}()).run();function b(t){if(qr(),Lr.length){const[{resolve:e,stream:r,Tt:n}]=Lr.splice(0,1);e(new Rr(t,r,n,b)),Kr()}else t.yt?(Jr(t),function(t,e){const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.gt?t.gt=!1:t.It=setTimeout(async()=>{Wr=Wr.filter(e=>e!=t);try{await t.terminate()}catch{}},n))}(t,e)):Wr=Wr.filter(e=>e!=t)}}function Kr(){!Zr&&Lr.length&&Number.isFinite(Vr)&&Vr>=0&&(Zr=setTimeout(Yr,Vr))}function qr(){Zr&&(clearTimeout(Zr),Zr=null)}function Yr(){if(Zr=null,Lr.length){const[{resolve:t,stream:e,Tt:r}]=Lr.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:U,createWorker:U});t(new Rr({},e,n,Xr)),Kr()}}function Xr(){qr(),Kr()}function Jr(t){const{It:e}=t;e&&(clearTimeout(e),t.It=null)}const Qr="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),$r=256==Qr.length;function tn(t,e){return en(t,e,!0)}function en(t,e,r){return e&&"cp437"==e.trim().toLowerCase()?function(t){if($r){let e="";for(let r=0;r<t.length;r++)e+=Qr[t[r]];return e}return(new TextDecoder).decode(t)}(t):new TextDecoder(e,{ignoreBOM:r}).decode(t)}const rn="HTTP error ",nn="HTTP Range not supported",on="HTTP resource changed",an="Writer iterator completed too soon",sn="Writer not initialized",cn="Content-Range",un="Range",ln="GET",fn="bytes",dn=16777216,wn="writable",hn=Symbol();class pn{constructor(){this.size=0}init(){this.initialized=!0}}class mn extends pn{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=bt(yt())}={}){const n=this;let o=0;return r=Et(r),new ReadableStream({async pull(a){const i=e===U?r:Math.min(r,e-o),s=await eo(n,t+o,i);s.length&&a.enqueue(s),o+r>=e||!s.length&&i?a.close():o+=r}})}}class yn extends pn{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw new Error(sn);return t.writeUint8Array(Ft(e))}});Object.defineProperty(t,wn,{get:()=>e})}writeUint8Array(){}}class bn extends mn{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{kt:t,Ct:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{Ct:r,kt: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 En extends yn{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 Sn,gn;class An extends mn{constructor(t){super(),Object.assign(this,{vt:t,size:t.size}),gn||(gn=(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();Sn=1==e}catch{Sn=!1}})())}createReadable(t){const{vt:e,size:r}=this,{offset:n=0,size:o=r-n}=t||{};return!n&&o>=r?Me(e.stream()):Sn?Me(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.vt:r.vt.slice(t,n);let a=await o.arrayBuffer();return a.byteLength>e&&(a=a.slice(t,n)),new Uint8Array(a)}}class Rn extends pn{constructor(t){super();const e=this,r=new TransformStream;Object.defineProperty(e,wn,{get:()=>r.writable}),e.contentType=t,e.Nt=ve(r.readable,t),e.Nt.catch(()=>{})}getData(){return this.Nt}}class xn extends An{constructor(t){super(new Blob([t],{type:"text/plain"}))}}function Dn(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 zn extends Rn{constructor(t){super(),Object.assign(this,{encoding:t,_t:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,_t:e}=this,r=await super.getData();return r.text&&e?r.text():function(t,e){return en(t,e,!1)}(new Uint8Array(await r.arrayBuffer()),t)}}class Fn extends mn{constructor(t,e){super(),Un(this,t,e)}async init(){await Tn(this,Ln,Bn),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(nn);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 Ln(ln,t,Nn(t,o,e));if(206!=r.status)throw new Error(nn);const s=r.headers.get(cn);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=o)throw new Error(nn)}vn(t,r),Mn(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 In(this,t,e,Ln,Bn)}}class On extends mn{constructor(t,e){super(),Un(this,t,e)}async init(){await Tn(this,Zn,jn),super.init()}readUint8Array(t,e){return In(this,t,e,Zn,jn)}}function Un(t,e,r){const{preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s=!0,maximumRangeSize:c=dn,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 Tn(t,e,r){const{url:n,preventHeadRequest:o,useRangeHeader:a,forceRangeRequests:i,combineSizeEocd:s}=t;if(function(t){const{baseURI:e}=yt(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r}(n)&&(a||i)&&(typeof o==I||o)){const n=await e(ln,t,Nn(t,s?-22:void 0)),o=n.headers.get("Accept-Ranges");if(!(i||o&&o.toLowerCase()==fn))throw new Error(nn);{if(s){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Bt=e)}Mn(t,n);const o=kn(n);o===U?await Wn(t,e,r):t.size=o}}else await Wn(t,e,r)}async function In(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 v;{e+r>c&&(r=c-e);const o=await n(ln,t,Nn(t,e,r));if(206!=o.status)throw new Error(nn);const a=o.headers.get(cn);if(a){const t=Number(a.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw new Error(nn)}vn(t,o),Mn(t,o);const i=new Uint8Array(await o.arrayBuffer());if(i.length!=r)throw new Error(nn);return i}}{const{data:n}=t;return n||await o(t,u),t.data.subarray(e,e+r)}}function kn(t){const e=t.headers.get(cn);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Cn({headers:t}){return{jt:t.get("Etag")||U,lastModified:t.get("Last-Modified")||U}}function Mn(t,e){const{checkResourceChanges:r,Pt:n}=t;r&&!n&&206==e.status&&(t.Pt=Cn(e))}function vn(t,e){const{checkResourceChanges:r,Pt:n,size:o}=t;if(r){const t=kn(e);if(t!==U&&o!==U&&t!=o)throw new Error(on);if(n){const t=Cn(e);if(Object.entries(n).some(([e,r])=>r!==U&&t[e]!==U&&r!=t[e]))throw new Error(on)}}}function Nn(t,e=0,r=1){return Object.assign({},_n(t),{[un]:fn+"="+(e<0?e:e+"-"+(e+r-1))})}function _n({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function Bn(t){await Pn(t,Ln)}async function jn(t){await Pn(t,Zn)}async function Pn(t,e){const r=await e(ln,t,_n(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Wn(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,_n(t)),o=n.headers.get("Content-Length");o&&!n.headers.get("Content-Encoding")?t.size=Number(o):await r(t,t.options)}}async function Ln(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(nn):new Error(rn+(a.statusText||a.status))}function Zn(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(nn):new Error(rn+(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 mn{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new On(t,e):new Fn(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 Hn extends Vn{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Gn extends mn{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 Kn extends yn{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 qn extends mn{constructor(t){super(),this.Zt=t}async init(){const t=this;t.Vt=0;const e=t.Zt=await Promise.all(t.Zt.map(to));t.Ht=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}Gt(t){const{Ht:e,size:r}=this,n=e[t];return n===U?r:n}async readUint8Array(t,e){const r=this,{Zt: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 eo(s,i,e);else{const a=n-i;o=zt(await eo(s,i,a),await r.readUint8Array(t+a,e-a))}}else o=v;return r.Vt=Math.max(a,r.Vt),o}}class Yn extends pn{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===hn)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(an);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await $n(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,wn,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(hn)}finally{t.releaseLock()}}}class Xn{constructor(t){return Array.isArray(t)&&(t=new qn(t)),(t instanceof ReadableStream||typeof t.getReader==k)&&(t={readable:Me(t)}),t}}class Jn{constructor(t){return t.writable===U&&typeof t.next==k&&(t=new Yn(t)),(t instanceof WritableStream||typeof t.getWriter==k)&&(t={writable:Ne(t)}),t.size===U&&(t.size=0),t}}function Qn(t){return Boolean(t&&t.getData)}async function $n(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}async function to(t){return t=new Xn(t),await $n(t),t.size!==U&&t.readUint8Array||(t=new An(await ve(t.readable)),await $n(t)),t}function eo(t,e,r){return t.readUint8Array(e,r)}function ro(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?mn.prototype.createReadable.call(t,e):t.readable}const no="filename",oo="rawFilename",ao="comment",io="rawComment",so="uncompressedSize",co="compressedSize",uo="offset",lo="diskNumberStart",fo="lastModDate",wo="rawLastModDate",ho="lastAccessDate",po="rawLastAccessDate",mo="creationDate",yo="rawCreationDate",bo="internalFileAttributes",Eo="externalFileAttributes",So="internalFileAttribute",go="externalFileAttribute",Ao="msdosAttributesRaw",Ro="msdosAttributes",xo="msDosCompatible",Do="zip64",zo="encrypted",Fo="version",Oo="versionMadeBy",Uo="zipCrypto",To="directory",Io="executable",ko="compressionMethod",Co="signature",Mo="extraField",vo="unixMode",No="setuid",_o="setgid",Bo="sticky",jo=[no,oo,so,co,fo,wo,ao,io,ho,po,mo,yo,uo,lo,bo,Eo,So,go,Ao,Ro,xo,Do,zo,Fo,Oo,Uo,To,Io,"symlink",ko,Co,"crc32",Mo,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",vo,"unixExternalUpper",No,_o,Bo,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Po{constructor(t){jo.forEach(e=>this[e]=t[e])}}const Wo="File format is not recognized",Lo="End of central directory not found",Zo="End of Zip64 central directory locator not found",Vo="Central directory header not found",Ho="Local file header not found",Go="Zip64 extra field not found",Ko="File contains encrypted entry",qo="Encryption method not supported",Yo="Compression method not supported",Xo="Split zip file",Jo="Overlapping entry found",Qo="Entry data out of bounds",$o="Ambiguous archive",ta="Encrypted central directory is not supported",ea="Unsafe filename",ra="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",na="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",oa="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",aa="64-bit value exceeds Number.MAX_SAFE_INTEGER",ia="unsorted central directory",sa="unknown version needed to extract",ca="compressed patched data",ua="malformed extra field",la="unknown zip64 extensible data",fa="wrapped entries count",da="appended data",wa="prepended data",ha="trailing central directory data",pa="duplicate filename",ma="mismatched zip64 end of central directory record",ya="mismatched local file header (general purpose bit flag)",ba="mismatched local file header (compression method)",Ea="mismatched local file header (crc32 or sizes)",Sa=/^[a-zA-Z]:/,ga="utf-8",Aa="cp437",Ra=[[so,t],[co,t],[uo,t],[lo,e]],xa={[e]:{Kt:si,bytes:4},[t]:{Kt:ci,bytes:8}},Da=BigInt(Number.MAX_SAFE_INTEGER);class za{constructor(t,e={}){Object.assign(this,{reader:new Xn(t),options:e,qt:new Map})}async*getEntriesGenerator(n={}){const a=this;let{reader:i}=a;if(await $n(i),i.size!==U&&i.readUint8Array||(i=new An(await ve(i.readable)),await $n(i)),i.size<d)throw new Error(Wo);const c=a.warnings=[],p=Za(n,a.options),m=p==J,y=p!=$,b=Ga(ei(a,n,K),p),E=function(t,e){if(t===U)return e;if(!La(t))throw new Error(na);return t}(ei(a,n,"filenameValidation"),p),S=ei(a,n,"normalizeFilename"),{Yt:z,Xt:F}=await Ka(i,y,b);if(!z)throw await async function(t){return await Wa(t)==o}(i)?new Error(Xo):new Error(Lo);y&&F>1&&ti("multiple end of central directory records");const O=Ot(z);let T=si(O,12),I=si(O,16);const k=z.offset,C=ii(O,20),M=k+d+C,N=i.size-M;N>b&&ti(da),N>0&&$a(c,da);let _=ii(O,4);const B=i.Vt||0;let j,P,W,L,Z=ii(O,6),V=ii(O,10),H=0,G=h;const q=I==t||T==t||V==e||Z==e;if(I!=t&&Z!=e&&(I+=Pa(i,Z)),q){const r=z.offset>=w?await eo(i,z.offset-w,w):v,n=Ot(r);if(r.length==w&&si(n,0)==l){I=Pa(i,si(n,4))+ci(n,8);let r=await eo(i,I,h),o=Ot(r);const a=z.offset-w-h;if((r.length<h||si(o,0)!=u)&&I!=a&&a>=0){const t=I;I=a,I>t&&(H=I-t),r=await eo(i,I,h),o=Ot(r)}if(r.length<h||si(o,0)!=u)throw new Error(Zo);if(P=!0,W=ci(o,4)>44,W){const t=Math.min(ci(o,4)-44,i.size-I-h);t>0&&(G+=t,L=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=Ot(t),n=ii(r,26);Object.assign(e,{compressionMethod:ii(r,0),compressedSize:ci(r,2),uncompressedSize:ci(r,10),encryptionAlgorithm:ii(r,18),bitLength:ii(r,20),flags:ii(r,22),hashAlgorithm:ii(r,24),hashData:t.subarray(28,28+n)})}return e}(await eo(i,I+h,t)))}_==e?_=si(o,16):_!=si(o,16)&&Qa(m,c,ma),Z==e?Z=si(o,20):Z!=si(o,20)&&Qa(m,c,ma),V==e?V=ci(o,32):V!=ci(o,32)&&Qa(m,c,ma),T==t?T=ci(o,40):T!=ci(o,40)&&Qa(m,c,ma),I=Pa(i,Z)+ci(o,48)+H}}let Q=T;const tt=z.offset-(P?G+w:0);if(I>=i.size&&(H=i.size-I-T-d,I=i.size-T-d),B!=_)throw new Error(Xo);if(I<0)throw new Error(Wo);let et=0,rt=await eo(i,I,T),nt=Ot(rt);if(T){if(rt.length<4)throw new Error(Wo);const t=tt-T;if(I!=t&&Z==_){let e=!(si(nt,et)==s||Boolean(L&&L.compressedSize)||Ta(nt));if(!e&&t>=0&&t+4<=i.size&&(e=si(Ot(await eo(i,t,4)),0)==s),e){const e=I;I=t,I>e&&(H+=I-e),rt=await eo(i,I,T),nt=Ot(rt)}}}const ot=tt-I;if(T!=ot&&ot>=0&&Z==_&&(T=ot,rt=await eo(i,I,T),nt=Ot(rt)),I<0||I>=i.size)throw new Error(Wo);a.directoryOffset=I,a.directoryLength=Q;const at=ri(a,n,"decryptCentralDirectory");let it,st;if(at&&V&&rt.length>=4&&si(nt,0)!=s&&(W||Ta(nt))){const t=function(t,e,r){const n=t&&t.compressedSize?t.compressedSize:e;return n>0&&n<=r?n:r}(L,Q,rt.length);st=rt.subarray(t),rt=await at(rt.subarray(0,t),L),nt=Ot(rt),Q=rt.length,it=!0}L&&!it&&(rt.length<4||si(nt,0)==s)&&$a(c,la),j=I;const ct=ei(a,n,"filenameEncoding"),ut=ei(a,n,"commentEncoding"),lt=new Set;let ft,dt=-1;const wt=!m&&!P;!V&&wt&&(V=Ia(nt,rt,et),V&&$a(c,fa));for(let t=0;t<V;t++){const o=new Ua(i,a.options);if(et+f>rt.length||si(nt,et)!=s){if(0==t&&!it&&(W||Ta(nt)))throw new Error(ta);throw new Error(Vo)}Ca(o,nt,et+6);const u=Boolean(o.bitFlag.languageEncodingFlag),l=et+f,d=l+o.filenameLength,w=d+o.extraFieldLength,h=ii(nt,et+4),p=!(h>>8),m=h>>8==3,y=rt.subarray(l,d),b=ii(nt,et+32),z=w+b,F=rt.subarray(w,z),O=u,T=u,I=si(nt,et+38),k=I&r,C={readOnly:Boolean(1&k),hidden:Boolean(2&k),system:Boolean(4&k),directory:Boolean(16&k),archive:Boolean(32&k)},M=si(nt,et+42),v=ri(a,n,"decodeText")||tn,N=O?ga:ct||Aa,_=T?ga:ut||Aa;let B=v(y,N,Y);if(B===U&&(B=tn(y,N)),S){const t=S(B);t!==U&&(B=t)}if(Ha(B,E)){const t=new Error(ea);throw t.filename=B,t}let P=v(F,_,X);P===U&&(P=tn(F,_)),Object.assign(o,{index:t,Jt:it,versionMadeBy:h,msDosCompatible:p,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:b,offset:M,diskNumberStart:ii(nt,et+34),internalFileAttributes:ii(nt,et+36),externalFileAttributes:I,msdosAttributesRaw:k,msdosAttributes:C,rawFilename:y,filenameUTF8:O,commentUTF8:T,rawExtraField:rt.subarray(d,w),rawComment:F,filename:B,comment:P}),Ma(o,o,nt,et+6)&&$a(c,ua,B),o.offset+=H;const L=Pa(i,o.diskNumberStart)+o.offset;j=Math.min(L,j),L<dt&&$a(c,ia,B),dt=L,(o.version&r)>63&&$a(c,sa,B),32&~o.rawBitFlag||$a(c,ca,B),lt.has(o.filename)&&(ft=!0),lt.add(o.filename);const Z=o.externalFileAttributes>>16&e;o.unixMode===U&&16877&Z&&(o.unixMode=Z);const G=Boolean(o.unixMode&R),K=Boolean(o.unixMode&x),q=Boolean(512&o.unixMode),J=40960==((o.unixMode===U?Z:o.unixMode)&g),Q=!J&&(o.unixMode!==U?!!(73&o.unixMode):m&&!!(73&Z)),$=o.unixMode!==U&&(o.unixMode&g)==A,tt=(Z&g)==A;Object.assign(o,{setuid:G,setgid:K,sticky:q,symlink:J,unixExternalUpper:Z,internalFileAttribute:o.internalFileAttributes,externalFileAttribute:o.externalFileAttributes,executable:Q,directory:$||tt||p&&C.directory||o.filename.endsWith(D),zipCrypto:o.encrypted&&!o.extraFieldAES});const ot=new Po(o);if(ot.getData=(t,e)=>o.getData(t,ot,a.qt,e),ot.arrayBuffer=async t=>{const e=new TransformStream,r=ve(e.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await o.getData(e,ot,a.qt,t),r},et=z,t==V-1&&wt){const t=Ia(nt,rt,et);t&&(V+=t,$a(c,fa))}const{onprogress:at}=n;if(at)try{await at(t+1,V,new Po(o))}catch{}yield ot}let ht=et,pt=ka(rt.subarray(et))||(it?ka(st):U);if(!pt&&!it){const t=I+et,e=Math.min(tt-t,65541);e>=6&&(pt=ka(await eo(i,t,e)))}pt&&(a.digitalSignature=pt,ht=et+6+pt.length),(et!=Q&&ht!=Q||!it&&et!=T&&ht!=T)&&Qa(m,c,ha),ft&&Qa(m,c,pa);const mt=ei(a,n,"extractPrependedData"),yt=ei(a,n,"extractAppendedData"),bt=(m||mt)&&V&&4==j&&await async function(t){const e=await Wa(t);return e==o||808471376==e}(i)?4:0;return m&&(H||V&&j>bt)&&ti(wa),(H||V&&j>4)&&$a(c,wa),mt&&(a.prependedData=j>bt?await eo(i,bt,j-bt):v),a.comment=C?await eo(i,k+d,C):v,yt&&(a.appendedData=M<i.size?await eo(i,M,i.size-M):v),!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 Fa{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new za(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}}async function Oa(t,e={}){if(t=new Xn(t),await $n(t),t.size!==U&&t.readUint8Array||(t=new An(await ve(t.readable)),await $n(t)),t.size<d)return!1;const r=Za(e,{}),n=r!=$,o=Ga(e[K],r),{Yt:a,Xt:i}=await Ka(t,n,o);if(!a||r==J&&i>1)return!1;const s=ii(Ot(a),20),c=a.offset+d+s;return t.size-c<=o}let Ua=class{constructor(t,e){Object.assign(this,{reader:t,options:e})}async getData(t,e,o,i={}){const s=this,c=yt(),{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:A}=m,R=e.localDirectory={},x=e.warnings=[],D=Pa(u,d)+f,F=await eo(u,D,z),O=Ot(F);let T=ei(s,i,N),I=ei(s,i,_);const k=ei(s,i,B);if(at(T,I),T=T&&T.length&&T,I=I&&I.length&&I,w&&99!=w.originalCompressionMethod)throw new Error(Yo);if(F.length<z||si(O,0)!=n)throw new Error(Ho);Ca(R,O,4);const{extraFieldLength:C,filenameLength:M}=R,V=R.dataOffset=D+z+M+C,H=ei(s,i,"checkLocalDirectory"),G=Za(i,s.options),K=function(t,e){return t===U?e!=$:Boolean(t)}(H,G),q=function(t,e){return t===U?e==J:Boolean(t)}(H,G);let Y=v;if(q&&(M||C)){const t=await eo(u,D+z,M+C);Y=t.subarray(0,M),R.rawExtraField=t.subarray(M)}else R.rawExtraField=C?await eo(u,D+z+M,C):v;q&&(R.rawFilename=Y),Ma(s,R,O,4,!0)&&$a(x,ua),function(t,e,r,n,o){const{rawFilename:a}=t,i=!o,s=t.Jt&&!(8192&~e.rawBitFlag);!n||s||r.length==a.length&&!r.some((t,e)=>t!=a[e])||Qa(i,o,"mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Qa(i,o,ya),e.compressionMethod!=t.compressionMethod&&Qa(i,o,ba),e.bitFlag.dataDescriptor||s||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Qa(i,o,Ea)}(s,R,Y,q,K?U:x);const{lastAccessDate:X,creationDate:Q,uid:tt,gid:et}=R;X&&(e.lastAccessDate=X),Q&&(e.creationDate=Q),tt!==U&&e.uid===U&&(e.uid=tt),et!==U&&e.gid===U&&(e.gid=et);const rt=s.encrypted&&R.encrypted&&!k,nt=rt&&!w;if(k||(e.zipCrypto=nt),rt&&!(64&~R.rawBitFlag))throw new Error(qo);const it=k?U:He(p);if(0!=p&&8!=p&&9!=p&&!it&&!k)throw new Error(Yo);if(rt){if(!nt&&(w.strength<1||w.strength>3))throw new Error(qo);if(!T&&!I)throw new Error(Ko)}if(V+g>u.size)throw new Error(Qo);const st=g,ct=Me(u.createReadable({offset:V,size:st})),ut=ot(ei(s,i,j)),lt=ei(s,i,"checkPasswordOnly");let ft=ei(s,i,"checkOverlappingEntry");const dt=ei(s,i,"checkOverlappingEntryOnly");dt&&(ft=!0);const{onstart:wt,onprogress:ht,onend:pt}=i,mt=0!=p&&!k,bt=k?g:S,Et=9==p;let St=ei(s,i,W);Et&&(St=!1);const gt=ei(s,i,"checkCrc32"),At=(gt===U?ei(s,i,"checkSignature"):gt)&&!k&&(!rt||nt||w&&1==w.vendorVersion),Rt={options:{codecType:wr,password:T,rawPassword:I,zipCrypto:nt,encryptionStrength:w&&w.strength,checkCrc32:At,checkAuthenticationCode:ei(s,i,"checkAuthenticationCode"),passwordVerification:nt&&(A?E>>>8&r:b>>>24&r),outputSize:bt,crc32:b,compressed:mt,encrypted:rt,useWebWorkers:ei(s,i,P),useCompressionStream:St,transferStreams:ei(s,i,L),deflate64:Et,format:it?it.format:U,codecURI:it?it.codecURI:U,compressionMethod:p,rawBitFlag:y,checkPasswordOnly:lt},config:c,ft:{signal:ut,size:st,onstart:wt,onprogress:ht,onend:pt}};let xt,Dt;ft&&await async function({reader:t,$t:e,index:r,offset:n,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:c,dataDescriptor:u,extraFieldZip64:l,qt:f}){let d=0;if(u&&(d=l?20:12),d){const r=await eo(t,c+i,d+4),n=Ot(r);let u=r.length==d+4&&si(n,0)==a;if(u){const t=ja(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=ja(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(Jo);throw t.overlappingEntry=e.$t,t}f.set(r,w)}({reader:u,$t:e,index:l,offset:D,crc32:b,compressedSize:g,uncompressedSize:S,dataOffset:V,dataDescriptor:A||R.bitFlag.dataDescriptor,extraFieldZip64:h||R.extraFieldZip64,qt:o});try{if(!dt){lt&&(t=new WritableStream),t=new Jn(t),await $n(t,function(t,e,r){return Math.min(t,r?1032*e:e)}(bt,g,mt)),({writable:xt}=t);const{outputSize:e}=await Gr({readable:ct,writable:xt},Rt);if(t.size+=e,e!=bt)throw new Error(qe)}}catch(e){if(e.outputSize!==U&&(t.size+=e.outputSize),!lt||e.message!=Yt)throw Dt=e,e}finally{if((Qn(t)||!ei(s,i,Z))&&xt&&!xt.locked){const t=xt.getWriter();if(Dt)try{await t.abort(Dt)}catch{}else await t.close()}}return lt||dt?U:t.getData?t.getData():xt}};function Ta(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;r<e;r++)if(134630224==si(t,r))return!0;return!1}function Ia(t,e,r){let n=0;for(;r+f<=e.length&&si(t,r)==s;)r+=f+ii(t,r+28)+ii(t,r+30)+ii(t,r+32),n++;return n%65536?0:n}function ka(t){if(t.length>=6){const e=Ot(t);if(si(e,0)==i){const r=ii(e,4);if(6+r<=t.length)return t.subarray(6,6+r)}}}function Ca(t,e,r){const n=t.rawBitFlag=ii(e,r+2),o=!(1&~n),a=si(e,r+6);Object.assign(t,{encrypted:o,version:ii(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&S)==S},rawLastModDate:a,lastModDate:ni(a),filenameLength:ii(e,r+22),extraFieldLength:ii(e,r+24)})}function Ma(t,e,r,n,o){const{rawExtraField:a}=e,i=e.extraField=new Map,s=Ot(a);let c=0,u=!1;try{for(;c<a.length;){const t=ii(s,c),e=ii(s,c+2);i.set(t,{type:t,data:a.slice(c+4,c+4+e)}),c+=4+e}}catch{u=!0}c>a.length&&(u=!0);const l=ii(r,n+4);Object.assign(e,{signature:si(r,n+10),crc32:si(r,n+10),compressedSize:si(r,n+14),uncompressedSize:si(r,n+18)});const f=i.get(1);f&&(function(t,e){e.zip64=!0;const r=Ot(t.data),n=Ra.filter(([t,r])=>e[t]==r),o=n.reduce((t,[,e])=>t+xa[e].bytes,0);if(t.data.length<o)throw new Error(Go);for(let o=0,a=0;o<n.length;o++){const[i,s]=n[o],c=xa[s];e[i]=t[i]=c.Kt(r,a),a+=c.bytes}}(f,e),e.extraFieldZip64=f);const d=i.get(28789);d&&(va(d,no,oo,e,t),e.extraFieldUnicodePath=d);const w=i.get(25461);w&&(va(w,ao,io,e,t),e.extraFieldUnicodeComment=w);const h=i.get(p);h&&h.data.length>=7?(function(t,e,r){const n=Ot(t.data),o=ai(n,4);Object.assign(t,{vendorVersion:ai(n,0),vendorId:ai(n,2),strength:o,originalCompressionMethod:r,compressionMethod:ii(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=U)}(h,e,l),e.extraFieldAES=h):e.compressionMethod=l;const S=i.get(13);S&&(Na(S,e),e.extraFieldPkwareUnix=S);const g=i.get(22613);g&&(Na(g,e),e.extraFieldUnixType1=g);const A=i.get(10);A&&(function(t,e){const r=Ot(t.data);let n,o=4;try{for(;o<t.data.length&&!n;){const e=ii(r,o),a=ii(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=Ot(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:oi(o),lastAccessDate:oi(a),creationDate:oi(i)};Object.assign(t,s),Object.assign(e,s,{rawLastAccessDate:a,rawCreationDate:i})}}(A,e),e.extraFieldNTFS=A);const R=i.get(E);let x;if(R&&(x=_a(R,e,!1),e.extraFieldUnix=R),!x){const t=i.get(b);t&&(_a(t,e,!0),e.extraFieldInfoZip=t)}const D=i.get(m);D&&(function(t,e,r){if(!t.data.length)return;const n=Ot(t.data),o=ai(n,0),a=[],i=[];r?(1&~o||(a.push(fo),i.push(wo)),2&~o||(a.push(ho),i.push(po)),4&~o||(a.push(mo),i.push(yo))):t.data.length>=5&&(a.push(fo),i.push(wo));let s=1;a.forEach((r,o)=>{if(t.data.length>=s+4){const a=si(n,s);e[r]=t[r]=new Date(1e3*(0|a));const c=i[o];t[c]=a}s+=4})}(D,e,o),e.extraFieldExtendedTimestamp=D);const z=i.get(y);return z&&(e.extraFieldUSDZ=z),u}function va(t,e,r,n,o){if(t.data.length<5)return void(t.valid=!1);const a=Ot(t.data),i=new Bt;i.append(o[r]);const s=Ot(new Uint8Array(4));s.setUint32(0,i.get(),!0);const c=si(a,1),u=ai(a,0);Object.assign(t,{version:u,[e]:tn(t.data.subarray(5)),valid:1==u&&!o.bitFlag.languageEncodingFlag&&c==si(s,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function Na(t,e){if(t.data.length<8)return;const r=Ot(t.data),n={lastAccessDate:new Date(1e3*(0|si(r,0))),lastModDate:new Date(1e3*(0|si(r,4)))};t.data.length>=12&&(n.uid=ii(r,8),n.gid=ii(r,10)),Object.assign(t,n),Object.assign(e,n)}function _a(t,e,r){try{const n=Ot(t.data);let o,a;if(r){let e=0;const r=ai(n,e++),i=ai(n,e++);o=Ba(t.data.subarray(e,e+i)),e+=i;const s=ai(n,e++);a=Ba(t.data.subarray(e,e+s)),Object.assign(t,{version:r,uid:o,gid:a})}else t.data.length>=4&&(o=ii(n,0),a=ii(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 Ba(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ja(t,e,r){const n=si(t,e);let o,a;return r?(o=ci(t,e+4),a=ci(t,e+12)):(o=si(t,e+4),a=si(t,e+8)),{crc32:n,compressedSize:o,uncompressedSize:a}}function Pa(t,e){return t.Gt?t.Gt(e):0}async function Wa(t){return si(Ot(await eo(t,0,4)))}function La(t){return t===J||t===Q||t===$}function Za(t,e){return Va(t,Va(e,Q))}function Va(t,e){const r=t.strictness;if(r!==U){if(!La(r))throw new Error(ra);return r}const n=t.checkAmbiguity;return n===U?e:n?J:e==$?$:Q}function Ha(t,e){if(e==$)return!1;const r=t.split("/");return r.length>1&&""===r[r.length-1]&&r.pop(),!!(r.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Sa.test(t))||e==J&&(r.includes(".")||r.includes(""))}function Ga(t,r){if(t!==U){const e=ct(t);if("number"!=typeof e||Number.isNaN(e)||e<0)throw new Error(oa);return e}return r==J?0:r==$?1/0:e}async function Ka(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 qa(t,o)){const o=ii(r,f+20);if(w+d+o==n){const o=await Xa(t,r,u,f,w,n,a);if(2==o){if(i||(i=Ya(l,f,w)),c++,!e||c>1)break}else 1!=o||s||(s=Ya(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 qa(t,o)){const o=Ya(c,u,l);a||(a=o);const f=await Xa(t,e,s,u,l,n,r);if(2==f)return o;1!=f||i||(i=o)}return i||a}(t,r,a)),{Yt:i,Xt:c}}async function*qa(t,e){const r=t.size-e,n=await eo(t,r,e),o=Ot(n);for(let t=n.length-d;t>=0;t--)si(o,t)==c&&(yield[o,r,n,t,r+t])}function Ya(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function Xa(r,n,o,a,i,c,u){const f=ii(n,a+10),d=si(n,a+12),h=si(n,a+16);if(f==e||d==t||h==t)return await Ja(r,n,o,i-w,c,u)==l?2:0;if(!f&&!d)return 1;const p=ii(n,a+6);for(const t of[i-d,Pa(r,p)+h])if(await Ja(r,n,o,t,c,u)==s)return 2;return 0}async function Ja(t,e,r,n,o,a){return n<0||n+4>o?U:n>=r?si(e,n-r):a.count>0?(a.count--,si(Ot(await eo(t,n,4)),0)):U}function Qa(t,e,r){t?ti(r):$a(e,r)}function $a(t,e,r){if(!t.some(t=>t.reason==e)){const n={reason:e};r!==U&&(n.filename=r),t.push(n)}}function ti(t){const e=new Error($o);throw e.reason=t,e}function ei(t,e,r){return e[r]===U?t.options[r]:e[r]}function ri(t,e,r){return nt(ei(t,e,r))}function ni(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 oi(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function ai(t,e){return t.getUint8(e)}function ii(t,e){return t.getUint16(e,!0)}function si(t,e){return t.getUint32(e,!0)}function ci(t,e){const r=t.getBigUint64(e,!0);if(r>Da)throw new Error(aa);return Number(r)}var ui=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:$o,ERR_BAD_FORMAT:Wo,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Vo,ERR_ENCRYPTED:Ko,ERR_ENCRYPTED_CENTRAL_DIRECTORY:ta,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Qo,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Zo,ERR_EOCDR_NOT_FOUND:Lo,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Go,ERR_INVALID_AUTHENTICATION_CODE:qt,ERR_INVALID_COMPRESSED_DATA:Ye,ERR_INVALID_CRC32:Xe,ERR_INVALID_FILENAME_VALIDATION:na,ERR_INVALID_MAX_APPENDED_DATA_SIZE:oa,ERR_INVALID_PASSWORD:Gt,ERR_INVALID_SIGNATURE:Kt,ERR_INVALID_STRICTNESS:ra,ERR_INVALID_UNCOMPRESSED_SIZE:qe,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Ho,ERR_OVERLAPPING_ENTRY:Jo,ERR_SPLIT_ZIP_FILE:Xo,ERR_UNSAFE_FILENAME:ea,ERR_UNSUPPORTED_COMPRESSION:Yo,ERR_UNSUPPORTED_ENCRYPTION:qo,ERR_UNSUPPORTED_UINT64:aa,ERR_WORKER_STARTUP_TIMEOUT:mr,WARNING_APPENDED_DATA:da,WARNING_COMPRESSED_PATCHED_DATA:ca,WARNING_DUPLICATE_FILENAME:pa,WARNING_MALFORMED_EXTRA_FIELD:ua,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:ya,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:ba,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:Ea,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:ma,WARNING_PREPENDED_DATA:wa,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:ha,WARNING_UNKNOWN_VERSION:sa,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:la,WARNING_UNSORTED_CENTRAL_DIRECTORY:ia,WARNING_WRAPPED_ENTRIES_COUNT:fa,ZipReader:za,ZipReaderStream:Fa,isZipFile:Oa});const li="File already exists",fi="Zip file comment exceeds 64KB",di="Invalid zip file comment (must be a Uint8Array)",wi="File entry comment exceeds 64KB",hi="Invalid file entry comment (must be a string)",pi="Invalid date (must be a valid Date instance)",mi="File entry name exceeds 64KB",yi="Version exceeds 65535",bi="The strength must equal 1, 2, or 3",Ei="Encryption is not supported in USDZ files",Si="Encryption is not supported when the 'passThrough' option is set",gi="Invalid extra field (must be a Map)",Ai="Invalid extra field type (must be integer 0..65535)",Ri="Invalid extra field data (must be a Uint8Array)",xi="Extra field data exceeds 64KB",Di=-2147483648,zi=2147483647,Fi=BigInt(0),Oi=BigInt("0x7fffffffffffffff"),Ui="Zip64 is not supported (set the 'zip64' option to 'true')",Ti="Undefined uncompressed size",Ii="Undefined compression method",ki="Undetermined size",Ci="Undefined reader",Mi="Zip file not empty",vi="Invalid uid (must be integer 0..2^32-1)",Ni="Invalid gid (must be integer 0..2^32-1)",_i="Invalid UNIX mode (must be integer 0..65535)",Bi="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",ji="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Pi="Invalid msdosAttributesRaw (must be integer 0..255)",Wi="Invalid msdosAttributes (must be an object with boolean flags)",Li="Invalid level (must be integer 0..9)",Zi="Signature data exceeds 64KB",Vi=new Uint8Array([7,0,2,0,65,69,3,0,0]),Hi="infozip",Gi="unix";let Ki=0;const qi=[];class Yi{constructor(t,e={}){t=new Jn(t);const{availableSize:r=T,maxSize:n=T}=t,o=r>0&&r!==T&&n>0&&n!==T;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 Qi(this,async function(t,e){if(t.re.size)throw new Error(Mi);await t.ce(e)}(this,t))}appendZip(t){return Qi(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 Xn(t),await $n(t),t.size!==U&&t.readUint8Array||(t=new An(await ve(t.readable)),await $n(t));const{ZipReader:r}=await Promise.resolve().then(function(){return ui}),i=new r(t),s=await i.getEntries();await i.close(),await $n(e.writer);const{directoryOffset:l}=i;s.forEach(({filename:t})=>{if(n.has(t))throw new Error(li);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 Ot(await eo(t,0,4)).getUint32(0,!0)==o}(t)||(await gs(e.writer,Es()),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)=>bs(e,t)-bs(e,r));let s=0;for(const r of i){const n=bs(e,r);await ms(t,e,s,n-s),ws(o,await ys(e,n))&&await o.closeDisk(),a.set(r,{offset:hs(t,o),diskNumberStart:fs(o)}),s=n}await ms(t,e,s,n-s)}else{const o=t.offset;await ms(t,e,0,n),r.forEach(t=>a.set(t,{offset:o+bs(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=ps(f||v),t.extraFieldAES&&(l=99);const m=Ps(f),y=Boolean(u)&&u.uncompressedSize!==U,b=Boolean(u)&&u.compressedSize!==U,E=-7&Ls(w,h,p,i,l)|w<<1,{fe:S,de:g}=Ws({version:e,bitFlag:E,compressionMethod:l,uncompressedSize:s,compressedSize:c,rawLastModDate:r,rawFilename:n,we:b,he:y,extraFieldLength:m}),{crc32:A}=t;A!==U&&_s(g,10,A);const{offset:R,diskNumberStart:x}=d.get(t);Object.assign(t,{he:y,we:b,offset:R,diskNumberStart:x,pe:!1,me:v,ye:v,be:v,Ee:v,Se:v,rawExtraField:f,ge:v,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(Fs(e,a=Object.assign({},a),To)&&!n.endsWith(D)&&(n+=D),e.re.has(n))throw new Error(li);e.re.add(n),Ki<yt().maxWorkers?Ki++:await new Promise(t=>qi.push(t));try{return await async function(e,n,o,a){const i=es(e,n,a);({name:n}=i);const s=rs(e,n,a),{comment:c}=s,u=a[Mo];let l;e.ee.set(n,U);try{const{Ae:c}=s;0==c.level||c.compressionMethod!==U||c.passThrough||await gr(yt())||(c.level=0);const u=await async function(t,e,{Ae:r},n){if(r.passThrough&&!e&&!Fs(t,n,To))throw new Error(Ci);let o;return e&&(e=new Xn(e),await $n(e),({size:o}=e)),Object.assign({reader:e},os(t,Boolean(e),o,r,n))}(e,o,s,a);({reader:o}=u);const f=ds(e.writer),d=fs(e.writer),w=as(a=Object.assign({},a,i.Ae,s.Ae,u.Ae,{signature:a[Co],crc32:a.crc32===U?a[Co]:a.crc32,offset:e.offset-f,diskNumberStart:d,[G]:e.options[G]})),h=cs(a),p=Ps(w.Re,h.xe);l=await async function(e,n,o,a,i){const{ee:s,writer:c}=e,{keepOrder:u,dataDescriptor:l,De:f,signal:d}=i,{ze:w}=a,h=e.options[G],p=e.se;let m,y,b,E,S,g,A,R={},x=0;s.set(n,R),e.se=R;try{let y;u&&(y=p&&p.Fe,R.Fe=new Promise(t=>b=t)),i.bufferedWrite||!u||e.ue||e.ie||!l&&!f?(m=!0,e.ie++,A=i.createTempStream?await i.createTempStream():new TransformStream(U,U,{highWaterMark:T}),A.size=0,await $n(c)):(A=c,await D()),await $n(A);const O=ds(c);e.te&&!m&&await Ss(e,c),h&&!m&&is(a,e.offset-O);const{Re:I}=w;m||(await y,await F());const k=fs(c),C=hs(e,c);if(R.diskNumberStart=k,m||(S=!0,g=c.size,await gs(A,I)),R=await async function(e,n,{diskNumberStart:o,Fe:a},i,s,c){const{ze:u,Oe:l,Ue:f}=i,{fe:d,de:w,lastModDate:h,rawLastModDate:p,encrypted:m,compressed:y,version:b,compressionMethod:E,me:S,Te:g,be:A,Ie:R,Ee:x,Se:D,ye:z}=u,{xe:F}=l,{rawFilename:O,lastAccessDate:T,creationDate:I,password:k,rawPassword:C,level:M,zip64:v,he:N,we:_,zipCrypto:B,dataDescriptor:j,directory:P,executable:W,versionMadeBy:L,rawComment:Z,rawExtraField:V,ge:H,useWebWorkers:G,transferStreams:K,onstart:q,onprogress:Y,onend:X,signal:J,encryptionStrength:Q,extendedTimestamp:$,msDosCompatible:tt,internalFileAttributes:et,externalFileAttributes:rt,uid:nt,gid:ot,unixMode:at,symlink:it,setuid:st,setgid:ct,sticky:ut,unixExternalUpper:lt,msdosAttributesRaw:ft,msdosAttributes:dt,useCompressionStream:wt,passThrough:ht,format:pt,codecURI:mt}=c,yt={Fe:a,versionMadeBy:L,zip64:v,directory:Boolean(P),executable:Boolean(W),filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:Z,me:S,Te:g,be:A,Ee:x,Se:D,ye:z,rawExtraField:V,ge:H,extendedTimestamp:$,msDosCompatible:tt,internalFileAttributes:et,externalFileAttributes:rt,diskNumberStart:o,uid:nt,gid:ot,unixMode:at,symlink:Boolean(it),setuid:st,setgid:ct,sticky:ut,unixExternalUpper:lt,msdosAttributesRaw:ft,msdosAttributes:dt};let{crc32:bt,uncompressedSize:Et}=c,St=0;ht||(Et=0);const{writable:gt}=n;if(e){const o=Me(ro(e)),a=e.size,i={options:{codecType:dr,level:M,rawPassword:C,password:k,encryptionStrength:Q,zipCrypto:m&&B,passwordVerification:m&&B&&p>>8&r,computeCrc32:!ht,compressed:y&&!ht,encrypted:m&&!ht,useWebWorkers:G,useCompressionStream:wt,transferStreams:K,format:pt,codecURI:mt,compressionMethod:E},config:s,ft:{signal:J,size:a,onstart:q,onprogress:Y,onend:X}};try{const e=await Gr({readable:o,writable:gt},i);if(St=e.outputSize,n.size+=St,ht||(Et=e.inputSize,m&&!B||(bt=e.crc32)),!_&&St>=t||!N&&Et>=t)throw new Error(Ui)}catch(t){throw t.outputSize!==U&&(n.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:r,ze:n,Oe:o},{zip64:a,zipCrypto:i,passThrough:s,dataDescriptor:c}){const{de:u,encrypted:l}=n,{ke:f,Ce:d}=o;l&&!i&&!s||t===U||(_s(u,10,t),c&&_s(f,d,t)),a?c&&(Bs(f,d+4,BigInt(e)),Bs(f,d+12,BigInt(r))):(_s(u,14,e),_s(u,18,r),c&&(_s(f,d+4,e),_s(f,d+8,r)))}({crc32:bt,compressedSize:St,uncompressedSize:Et,ze:u,Oe:l},c),j&&await gs(n,F),Object.assign(yt,{uncompressedSize:Et,compressedSize:St,lastModDate:h,rawLastModDate:p,creationDate:I,lastAccessDate:T,encrypted:Boolean(m),zipCrypto:Boolean(B),size:f+St,compressionMethod:E,version:b,fe:d,de:w,signature:bt,crc32:!m||B||ht?bt:U,Ie:R,he:N,we:_}),yt}(o,A,R,a,yt(),i),m||(S=!1),s.set(n,R),R.filename=n,m){if(await Promise.all([A.writable.getWriter().close(),y]),await D(),e.te&&await Ss(e,c),E=!0,g=c.size,await F(),R.diskNumberStart=fs(c),R.offset=hs(e,c),h){const t=a.Ue;is(a,e.offset-ds(c)),R.size+=a.Ue-t}!function({rawFilename:t,encrypted:e,zip64:r,Te:n,crc32:o,compressedSize:a,uncompressedSize:i,he:s,we:c},u,{dataDescriptor:l,passThrough:f}){if(l||((!e||f&&o!==U)&&_s(u,14,o),c||_s(u,18,a),s||_s(u,22,i)),r&&n){const e=z+Ps(t)+4;Bs(u,e,BigInt(i)),Bs(u,e+8,BigInt(a))}}(R,w.Me,i),await gs(c,w.Re),await As(A.readable,c,d,t=>x+=t),c.size+=A.size,E=!1}else R.diskNumberStart=k,R.offset=C;return e.offset+=R.size,R}catch(t){if(E||S){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=c.size-g,m&&(e.offset+=x)}throw s.delete(n),t}finally{if(m&&e.ie--,b&&b(),y&&y(),m&&A&&A.dispose)try{await A.dispose()}catch{}}async function D(){e.ue=!0;const{le:t}=e;e.le=new Promise(t=>y=()=>{e.ue=!1,t()}),await t}async function F(){ws(c,Ps(w.Re))&&await c.closeDisk()}}(e,n,o,{ze:w,Oe:h,Ue:p},a)}catch(t){throw e.ee.delete(n),t}return Object.assign(l,{name:n,comment:c,extraField:u,[So]:l.internalFileAttributes,[go]:l.externalFileAttributes}),new Po(l)}(e,n,o,a)}catch(t){throw e.re.delete(n),t}finally{const t=qi.shift();t?t():Ki--}}(a,e,n,o);i.add(s);const c=()=>i.delete(s);return Promise.prototype.then.call(s,c,c),Qi(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=v,n={}){const o=this,{oe:a,writer:w}=this,{writable:h}=w;if(!(r instanceof Uint8Array))throw new Error(di);if(Ps(r)>e)throw new Error(fi);for(;a.size;)await Promise.allSettled(Array.from(a));await Promise.allSettled(o.ae.map(t=>t.ve));const p=o.ae.filter(t=>t.error&&!t.Ne);if(p.length){const t=p.map(t=>t.error);p.forEach(t=>t.Ne=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(r,n,o){const a=us(r.ee),{_e:w,Be:h,je:p}=await async function(r,n,o){const{ee:a,writer:i}=r,c=new Uint8Array(n);await $n(i);let u=0,l=0,d=fs(i),w=ds(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:A,ge:R,rawComment:x,versionMadeBy:D,fe:z,de:F,he:O,we:U,pe:T,Pe:I,internalFileAttributes:k,externalFileAttributes:C,diskNumberStart:M,uncompressedSize:v,compressedSize:N}=n,_=Ps(y,b,E,S,g,A,R),B=f+Ps(m,x)+_;ws(i,u+B-l)&&(await gs(i,c.slice(l,u)),l=u,h=0,await i.closeDisk()),0==r&&(d=fs(i),w=ds(i)),O||_s(F,18,v),U||_s(F,14,N),(I||T)&&n.version<45&&Ns(F,0,45);const j=ls(B);if(j.We(s),j.Le(D),j.Ze(z.subarray(0,24)),j.Le(_),j.Le(Ps(x)),j.Le(T?e:M),j.Le(k),j.We(C),j.We(I?t:p),j.Ze(m),j.Ze(y),j.Ze(b),j.Ze(E),j.Ze(S),j.Ze(g),j.Ze(A),j.Ze(R),j.Ze(x),js(c,j.Wt,u),u+=B,h++,o.onprogress)try{await o.onprogress(r+1,a.size,new Po(n))}catch{}}return await gs(i,l?c.slice(l):c),{_e:{diskNumber:d,diskOffset:w},Be:{diskNumber:fs(i),Ve:h},je:c}}(r,a,o),m=await async function(t,r,n){const o=Us(t,n,q);if(o){const n=await o(r),a=Ps(n);if(a>e)throw new Error(Zi);const s=ls(6+a);s.We(i),s.Le(a),s.Ze(n);const{writer:c}=t;return ws(c,Ps(s.Wt))&&await c.closeDisk(),await gs(c,s.Wt),6+a}return 0}(r,p,o);await async function(r,n,o,a){const{writer:i}=r,{_e:s,Be:f,He:w}=a;let{Ge:h}=a,p=r.ee.size,m=s.diskNumber,y=hs(r,s);const b=Ps(n);if(b>e)throw new Error(fi);let E=Fs(r,o,Do),S=fs(i);if(ws(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=ls(E?98:d);ws(i,Ps(g.Wt)+b)&&await i.closeDisk(),S=fs(i);let A=S==f.diskNumber?f.Ve:0;E&&(g.We(u),g.Ke(44),g.Le(45),g.Le(45),g.We(S),g.We(m),g.Ke(A),g.Ke(p),g.Ke(h),g.Ke(y),g.We(l),g.We(S),g.Ke(BigInt(hs(r,i))+BigInt(h)+BigInt(w)),g.We(S+1),Fs(r,o,"supportZip64SplitFile",!0)&&(S=e,m=e),A=e,p=e,y=t,h=t),g.We(c),g.Le(S),g.Le(m),g.Le(A),g.Le(p),g.We(h),g.We(y),g.Le(b),await gs(i,g.Wt),b&&await gs(i,n)}(r,n,o,{_e:w,Be:h,Ge:a,He:m})}(o,r,n),!Qn(w)&&Fs(o,n,Z)||await h.getWriter().close(),w.getData?w.getData():h}}class Xi{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new Yi(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 $i(e,t)}}()}});return ts(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 ts(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 $i(r,t),t}try{return await r.close(t,e)}catch(t){throw await $i(r,t),t}}}class Ji extends Promise{then(t,e){const{qe:r}=this;return r&&(r.Ne=!0),super.then(t,e)}}function Qi(t,e){const r=new Ji((t,r)=>Promise.prototype.then.call(e,t,r)),n={};return r.qe=n,n.ve=Promise.prototype.then.call(r,U,t=>n.error=t),t.ae.push(n),r}async function $i(t,e){try{await t.writer.writable.abort(e)}catch{}}function ts(t,e,r){t.oe.add(e),e.catch(t=>{try{r(t)}catch{}})}function es(n,o,a){let i=Fs(n,a,xo),s=Fs(n,a,Oo,i?20:768);const c=Fs(n,a,Io),u=ks(n,a,"uid"),l=ks(n,a,"gid");let f=ks(n,a,vo),d=Fs(n,a,"unixExtraFieldType"),w=Fs(n,a,No),h=Fs(n,a,_o),p=Fs(n,a,Bo);if(st(u,t,vi),st(l,t,Ni),st(f,e,_i),d!==U&&d!==Hi&&d!==Gi)throw new Error(Bi);if(d===Gi&&(u!==U&&u>e||l!==U&&l>e))throw new Error(ji);d!==U||u===U&&l===U||(d=Hi);let m=ks(n,a,Ao),y=Fs(n,a,Ro);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),st(m,r,Pi),y&&(typeof y!==C||Array.isArray(y)))throw new Error(Wi);if(s>e)throw new Error(yi);let E=Ts(n,a,Eo,go);const S=E!==U;S||(E=0),!a[To]&&o.endsWith(D)&&(a[To]=!0);const z=Fs(n,a,To);if(z?(o.endsWith(D)||(o+=D),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|=R:w=Boolean(f&R),h?f|=x:h=Boolean(f&x),p?f|=512:p=Boolean(512&f),S&&!t||(z?f=-61441&f|A: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,Ae:{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 rs(t,r,n){const o=Us(t,n,"encodeText")||Pt;let a=o(r,Y);if(a===U&&(a=Pt(r)),Ps(a)>e)throw new Error(mi);const i=n[ao]||"";if(typeof i!=M)throw new Error(hi);let s=o(i,X);if(s===U&&(s=Pt(i)),Ps(s)>e)throw new Error(wi);const c=Fs(t,n,Fo);if(c!==U&&c>e)throw new Error(yi);const u=Os(t,n,fo,new Date),l=Fs(t,n,wo),f=Os(t,n,ho),d=Os(t,n,mo),w=Ts(t,n,bo,So,0),h=Fs(t,n,B),p=Fs(t,n,N),m=Fs(t,n,_);at(p,m);const y=ks(t,n,"encryptionStrength",3),b=Fs(t,n,Uo),E=Fs(t,n,"extendedTimestamp",!0),S=Fs(t,n,"ntfsTimestamp"),g=Fs(t,n,"keepOrder",!0),A=Fs(t,n,P),R=Fs(t,n,L),x=Fs(t,n,"bufferedWrite"),D=Us(t,n,"createTempStream"),z=Fs(t,n,"dataDescriptorSignature",!0),F=ot(Fs(t,n,j)),O=Fs(t,n,"useUnicodeFileNames",!0),T=Fs(t,n,ko),I=h||T===U?U:He(T);if(!h&&T!==U&&0!==T&&8!==T&&!I)throw new Error("Compression method not supported");let k=ks(t,n,"level");if(st(k,9,Li),t.options[G]){if(p!==U||m!==U)throw new Error(Ei);k===U&&T===U&&(k=0)}h&&(k=U);let C=Fs(t,n,W),v=Fs(t,n,V);x&&v===U&&(v=!1),(v===U||b&&!h)&&(v=!0),k!==U&&6!=k&&(C=!1);const Z=Fs(t,n,Do);if(!(b||p===U&&m===U||Number.isInteger(y)&&y>=1&&y<=3))throw new Error(bi);const H=ns(n[Mo]),K=ns(n.localExtraField),q=ns(n.centralExtraField);return{comment:i,Ae:{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:A,transferStreams:R,bufferedWrite:x,createTempStream:D,dataDescriptorSignature:z,signal:F,useUnicodeFileNames:O,compressionMethod:T,format:I?I.format:U,codecURI:I?I.codecURI:U,Ye:I?I.versionNeeded:U,level:k,useCompressionStream:C,dataDescriptor:v,zip64:Z,rawExtraField:H,Xe:K,ge:q}}}function ns(t){if(!t)return v;if(!(t instanceof Map))throw new Error(gi);let r=0,n=0;t.forEach((t,n)=>{if(it(n,e,Ai),!(t instanceof Uint8Array))throw new Error(Ri);if(Ps(t)>e)throw new Error(xi);r+=4+Ps(t)});const o=new Uint8Array(r),a=Ot(o);return t.forEach((t,e)=>{Ns(a,n,e),Ns(a,n+2,Ps(t)),js(o,t,n+4),n+=4+Ps(t)}),o}function os(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[so],m===U)throw new Error(Ti);if(h===U)throw new Error(Ii)}const y=!0===d,b=Fs(e,a,zo);if(r&&i&&!b&&Ps(c,u))throw new Error(Si);const E=r&&(Boolean(c&&Ps(c)||u&&Ps(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?Cs(m)+S:n):n===U?(f=!0,(d||d===U)&&(d=!0,m=p=4294967296)):(a.uncompressedSize=m=n,p=(Ms(h,w)?Cs(m):m)+S));const g=!(E||r&&(0!==n||i)||Ms(h,w));g&&!s&&Fs(e,a,V)===U&&(f=!1);const A=y||m>=t,R=y||p>=t;if(A||R){if(!1===d)throw new Error(Ui);d=!0}return d=d||!1,{Je:p,Ae:{dataDescriptor:f,De:g,zip64:d,he:A,we:R,uncompressedSize:m,level:w,compressionMethod:h,encrypted:E}}}function as(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,Xe:y,encryptionStrength:S,extendedTimestamp:g,ntfsTimestamp:A,passThrough:R,encrypted:x,he:D,we:T,uncompressedSize:I,crc32:k}=t;let{version:C,compressionMethod:M}=t;const N=!w&&Ms(M,c);let _;const B=R||!N,j=u&&(t.bufferedWrite||!d||!D&&!T||B),P=j||u&&d&&(D||T);if(u&&(D||T)){const t=20,e=ls(t);if(e.Le(1),e.Le(t-4),_=e.Wt,j&&(e.Ke(I),B)){const t=x?l?12:16+4*S:0;e.Ke(R?0:I+t)}}else _=v;let W,L,Z,V,H;if(x&&!l){const t=ls(Ps(Vi)+2);t.Le(p),t.Ze(Vi),W=t.Wt,W[8]=S}else W=v;if(g){const t=xs(o),e=Ds(t);if(e){const e=9+(i?4:0)+(s?4:0),r=ls(e);V=1+(i?2:0)+(s?4:0),r.Le(m),r.Le(e-4),r.Qe(V),r.We(t),i&&r.We(zs(xs(i))),s&&r.We(zs(xs(s))),Z=r.Wt}else Z=v;if(A===U?!e||Boolean(i||s):A)try{const t=Rs(o),e=ls(36);e.Le(10),e.Le(32),e.$e(4),e.Le(1),e.Le(24),e.Ke(t),e.Ke(i?Rs(i):t),e.Ke(s?Rs(s):t),L=e.Wt}catch{L=v}else L=v}else L=Z=v;try{const{uid:r,gid:n,unixExtraFieldType:o}=t;if(o!=Hi||r===U&&n===U)if(o!=Gi||r===U&&n===U)H=v;else{const t=ls(8);t.Le(E),t.Le(4),t.Le((r===U?0:r)&e),t.Le((n===U?0:n)&e),H=t.Wt}else{const t=ss(r===U?0:r),e=ss(n===U?0:n),o=3+t.length+e.length,a=ls(4+o);a.Le(b),a.Le(o),a.Qe(1),a.Qe(t.length),a.Ze(t),a.Qe(e.length),a.Ze(e),H=a.Wt}}catch{H=v}M===U&&(M=N?8:0),C===U&&(C=0!=M||w||x?20:10);const{Ye:K}=t;N&&K!==U&&(C=C>K?C:K),u&&(C=C>45?C:45),x&&!l&&(C=C>51?C:51,R&&k!==U&&(W[4]=1),Ns(Ot(W),9,M),M=99);const q=P?Ps(_):0,Y=q+Ps(W,Z,L,H,h,y);if(Y+(t[G]?67:0)>e)throw new Error(xi);const X=new Date(2e3*Math.ceil(Math.floor(o.getTime()/1e3)/2)),{fe:J,de:Q,rawLastModDate:$}=Ws({version:C,bitFlag:Ls(c,f,d,x,M),compressionMethod:M,uncompressedSize:I,lastModDate:X<O?O:X>F?F:X,rawLastModDate:a,rawFilename:r,we:T,he:D,extraFieldLength:Y}),tt=ls(z+Ps(r)+Y),et=tt.Wt,rt=Ot(et);return tt.We(n),tt.Ze(J),tt.Ze(r),P&&tt.Ze(_),tt.Ze(W),tt.Ze(Z),tt.Ze(L),tt.Ze(H),tt.Ze(h),tt.Ze(y),d&&(T||_s(rt,18,0),D||_s(rt,22,0)),{Re:et,Me:rt,fe:J,de:Q,lastModDate:o,rawLastModDate:$,encrypted:x,compressed:N,version:C,compressionMethod:M,Ie:V,me:v,Te:q,be:Z,Ee:L,Se:H,ye:W,extraFieldLength:Y}}function is(t,e){const{ze:r}=t;let{Re:n,extraFieldLength:o}=r,a=64-(e+Ps(n))%64;a<4&&(a+=64);const i=new Uint8Array(a),s=Ot(i);Ns(s,0,y),Ns(s,2,a-4);const c=n;r.Re=n=new Uint8Array(Ps(c)+a),js(n,c),js(n,i,Ps(c));const u=Ot(n);Ns(u,28,o+a),r.Me=u,t.Ue+=a}function ss(t){const e=new Uint8Array(4);Ot(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}function cs({zip64:t,dataDescriptor:e,dataDescriptorSignature:r}){let n,o=v,i=0,s=t?20:12;return r&&(s+=4),e&&(o=new Uint8Array(s),n=Ot(o),r&&(i=4,_s(n,0,a))),{xe:o,ke:n,Ce:i}}function us(r){let n=0;for(const[,o]of r){const{rawFilename:r,ye:a,rawComment:i,Ee:s,Se:c,rawExtraField:u,ge:l,extendedTimestamp:d,Ie:w,lastModDate:h,he:p,we:y,uncompressedSize:b,compressedSize:E}=o,S=o.offset>=t,g=o.diskNumberStart>=e;let A,R;if(S||g||p||y){const t=4+(p?8:0)+(y?8:0)+(S?8:0)+(g?4:0),e=ls(t);e.Le(1),e.Le(t-4),p&&e.Ke(b),y&&e.Ke(E),S&&e.Ke(o.offset),g&&e.We(o.diskNumberStart),A=e.Wt}else A=v;o.me=A,o.Pe=S,o.pe=g;const x=xs(h);if(d&&Ds(x)){const t=ls(9);t.Le(m),t.Le(5),t.Qe(w),t.We(x),R=t.Wt}else R=v;o.be=R;const D=Ps(A,a,s,c,R,u,l);if(D>e)throw new Error(xi);n+=f+Ps(r,i)+D}return n}function ls(t){const e=new Uint8Array(t),r=Ot(e);let n=0;return{Wt:e,Qe:t=>{!function(t,e,r){t.setUint8(e,r)}(r,n,t),n+=1},Le:t=>{Ns(r,n,t),n+=2},We:t=>{_s(r,n,t),n+=4},Ke:t=>{Bs(r,n,BigInt(t)),n+=8},Ze:t=>{js(e,t,n),n+=Ps(t)},$e:t=>n+=t}}function fs(t){const{diskNumber:e=0}=t;return e}function ds(t){const{diskOffset:e=0}=t;return e}function ws(t,e){const{availableSize:r=T}=t;return e>r}function hs(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.ne:0)}function ps(t){const e=Ot(t);let r=0;for(;r+4<=Ps(t);){const n=4+vs(e,r+2);if(1==vs(e,r))return ps(zt(t.subarray(0,r),t.subarray(Math.min(r+n,Ps(t)))));r+=n}return t}async function ms(t,e,r,n){if(n>0){const{writer:o}=t;let a=0;try{await As(ro(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 ys(t,e){const r=await eo(t,e,z);if(Ps(r)<z)return z;const n=Ot(r);return z+vs(n,26)+vs(n,28)}function bs(t,{offset:e,diskNumberStart:r}){return e+(t.Gt?t.Gt(r):0)}function Es(){const t=new Uint8Array(4);return _s(Ot(t),0,o),t}async function Ss(t,e){delete t.te,await gs(e,Es()),t.offset+=4}async function gs(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=Ps(e),await n.write(e)}finally{n.releaseLock()}}async function As(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(Ps(t))}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{o.releaseLock()}}function Rs(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return e<Fi?Fi:e>Oi?Oi:e}}function xs(t){return Math.floor(t.getTime()/1e3)}function Ds(t){return t>=Di&&t<=zi}function zs(t){return Math.min(zi,Math.max(Di,t))}function Fs(t,e,r,n){const o=e[r]===U?t.options[r]:e[r];return o===U?n:o}function Os(t,e,r,n){const o=Fs(t,e,r,n);if(null===o)return n;if(o!==U&&(typeof o.getTime!=k||Number.isNaN(o.getTime())))throw new Error(pi);return o}function Us(t,e,r){return nt(Fs(t,e,r))}function Ts(t,e,r,n,o){const a=Is(e,r,n),i=a===U?Is(t.options,r,n):a;return i===U?o:i}function Is(t,e,r){return t[e]===U?t[r]:t[e]}function ks(t,e,r,n){return ct(Fs(t,e,r,n))}function Cs(t){return t+5*(Math.floor(t/16383)+1)}function Ms(t,e){return t===U?e===U||e>0:0!==t}function vs(t,e){return t.getUint16(e,!0)}function Ns(t,e,r){t.setUint16(e,r,!0)}function _s(t,e,r){t.setUint32(e,r,!0)}function Bs(t,e,r){t.setBigUint64(e,r,!0)}function js(t,e,r){t.set(e,r)}function Ps(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Ws({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:o,compressedSize:a,lastModDate:i,rawLastModDate:s,rawFilename:c,we:u,he:l,extraFieldLength:f}){const d=ls(26),w=d.Wt,h=Ot(w);if(d.Le(e),d.Le(r),d.Le(n),s===U){const t=new Uint32Array(1),e=Ot(t);Ns(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Ns(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.We(s),d.$e(4),u||a!==U?d.We(u?t:a):d.$e(4),l||o!==U?d.We(l?t:o):d.$e(4),d.Le(Ps(c)),d.Le(f),{fe:w,de:h,rawLastModDate:s}}function Ls(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 Zs(){return"application/octet-stream"}const Vs=1048576,Hs=".zip.js-temp";function Gs(t={}){const{thresholdBytes:e=Vs,directoryName:r=Hs,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 Ks=1048576;function qs(t={}){const{thresholdBytes:e=Ks}=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=ve(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 Ys=1048576,Xs=".zip.js-temp",Js="createSyncAccessHandle is only available in dedicated workers";function Qs(t={}){const{thresholdBytes:e=Ys,directoryName:r=Xs,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new Error(Js);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{xt({baseURI:import.meta.url})}catch{}let $s,tc,ec,rc,nc;function oc(t,e,r={}){if(!$s){const t=new Error("WASM module not loaded");throw t.cause=nc,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.er=tc(o),this.in=tc(a),this.inBufferSize=a,!this.er||!this.in)throw new Error("allocation failed");if(this.rr=new Uint8Array(o),t?(this.nr=$s.deflate_process,this.ar=$s.deflate_last_consumed,this.ir=$s.deflate_end,this.sr=$s.deflate_new(),r="gzip"===e?$s.deflate_init_gzip(this.sr,n):"deflate-raw"===e?$s.deflate_init_raw(this.sr,n):$s.deflate_init(this.sr,n)):"deflate64-raw"===e?(this.nr=$s.inflate9_process,this.ar=$s.inflate9_last_consumed,this.ir=$s.inflate9_end,this.sr=$s.inflate9_new(),r=$s.inflate9_init_raw(this.sr)):(this.nr=$s.inflate_process,this.ar=$s.inflate_last_consumed,this.ir=$s.inflate_end,this.sr=$s.inflate_new(),r="deflate-raw"===e?$s.inflate_init_raw(this.sr):"gzip"===e?$s.inflate_init_gzip(this.sr):$s.inflate_init(this.sr)),0!==r)throw new Error("init failed:"+r)}catch(t){throw i(this),t}},transform(e,r){try{const n=e,a=new Uint8Array(rc.buffer),i=this.nr,s=this.ar,c=this.er,u=this.rr;let l=0;for(;l<n.length;){const e=Math.min(n.length-l,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&ec&&(ec(this.in),this.in=0),this.in=tc(e),this.inBufferSize=e,!this.in))throw new Error("allocation failed");a.set(n.subarray(l,l+e),this.in);const f=i(this.sr,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.sr);if(0===w)break;l+=w}}catch(t){i(this),r.error(t)}},flush(e){try{const r=new Uint8Array(rc.buffer),n=this.nr,a=this.er,i=this.rr;for(;;){const s=n(this.sr,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.sr&&t.ir&&(e=t.ir(t.sr)),t.sr=0,t.in&&ec&&ec(t.in),t.in=0,t.er&&ec&&ec(t.er),t.er=0,e}}class ac{constructor(t="deflate",e){return oc(!0,t,e)}}class ic{constructor(t="deflate",e){return oc(!1,t,e)}}ac.lt=!0,ic.lt=!0;let sc,cc=!1;function uc(){sc=null,async function(){await Promise.allSettled(Wr.map(t=>(Jr(t),t.terminate()))),yr=U,br=!1}(),cc=!1,$s=tc=ec=rc=nc=null}!function({cr:t}){Sr=t}({cr:t=>{if(!sc){let{wasmURI:e}=t;typeof e==k&&(e=e()),sc=async function(t,{baseURI:e}){if(!cc)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($s=t,({malloc:tc,free:ec,memory:rc}=$s),"function"!=typeof tc||"function"!=typeof ec||!rc)throw $s=tc=ec=rc=null,new Error("Invalid WASM module")}((await WebAssembly.instantiate(r)).instance.exports)}(t,e),cc=!0}catch(t){throw function(t){nc=t}(t),t}}(e,t).catch(t=>{throw sc=null,t})}return sc}}),xt({CompressionStreamFallback:ac,DecompressionStreamFallback:ic}),xt({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const lc="Entry filename already exists",fc="Readable stream already consumed",dc="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",wc="Invalid readerOptions (must be an object)",hc="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",pc="zipjs-abort-export",mc="The operation was aborted",yc=new Set([1,p,10,m,28789,25461,y,b,E,22613,13]);class bc{constructor(t,e,r,n){const o=this;if(t.root&&n&&n.getChildByName(e))throw new Error(lc);r||(r={}),Object.assign(o,{fs:t,name:e,data:r.data,options:r.options&&Object.assign({},r.options),id:t.ur++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,lr:r.lr||r.uncompressedSize===U,passThrough:r.passThrough,dr:r.dr||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(lc);this.name=t}setOptions(t){const e=Object.assign({},this.options,t);this.options=Object.fromEntries(Object.entries(e).filter(([,t])=>t!==U))}}class Ec extends bc{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 Ec(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==Rn?e.type==r:t.constructor!=En||e.startsWith("data:"+(r||"")+";base64,"))}(t,r.data))return r.data;{const n=r.reader=Oc(r.Reader,r.data,e),o=r.uncompressedSize||n.size;await Promise.all([$n(n),$n(t,o)]);const a=ot(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:Me(s).pipeThrough(new xr({onstart:o,onprogress:a,onend:i,size:e.size}),{signal:n})}(r,n,e,a),s=!Qn(t)&&Boolean(e.preventClose);return r.uncompressedSize=n.size,await Me(i).pipeTo(Ne(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==Gt)return!1;throw t}}getText(t,e){return this.getData(new zn(t),e)}getBlob(t,e){return this.getData(new Rn(t),e)}getData64URI(t,e){return this.getData(new En(t),e)}getUint8Array(t){return this.getData(new Kn,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Ft(await this.getUint8Array(t)).buffer}replaceBlob(t){Object.assign(this,{data:t,Reader:An,Writer:Rn,reader:null})}replaceText(t){Object.assign(this,{data:t,Reader:xn,Writer:zn,reader:null})}replaceData64URI(t){Object.assign(this,{data:t,Reader:bn,Writer:En,reader:null})}replaceUint8Array(t){Object.assign(this,{data:t,Reader:Gn,Writer:Kn,reader:null})}replaceReadable(t){Object.assign(this,{data:null,Reader:zc(t),Writer:null,reader:null})}}class Sc extends bc{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new Sc(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 Pc(this,t,{options:e},!0)}addText(t,e,r={}){return Pc(this,t,{data:e,Reader:xn,Writer:zn,options:r,uncompressedSize:Dn(e)})}addBlob(t,e,r={}){return Pc(this,t,{data:e,Reader:An,Writer:Rn,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 Pc(this,t,{data:e,Reader:bn,Writer:En,options:r,uncompressedSize:Math.floor(.75*(n-o))})}addUint8Array(t,e,r={}){return Pc(this,t,{data:e,Reader:Gn,Writer:Kn,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return Pc(this,t,{data:e,Reader:class extends Vn{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return Pc(this,t,{Reader:zc(e),options:r})}addFileSystemEntry(t,e={}){return _c(this,t,e)}addFileSystemHandle(t,e={}){return _c(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),Pc(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 An(t),e)}importData64URI(t,e){return this.importZip(new bn(t),e)}importUint8Array(t,e){return this.importZip(new Gn(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 Rn(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new En(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Kn,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=Mc(r.readerOptions),s=new AbortController,{signal:c}=s,u=function(t,e){if(!ot(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=Rc([t],t=>Dc(t,l.passThrough)),d=[];let w=!1,h=0;try{n&&await Dr(n,f),await m(t,e),a&&await Dr(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 Dr(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=>!Ic(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||Ic(c.reason))return;throw c.reason===U?new DOMException(mc,"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(pc):t}d.push(e.getRelativeName(t))}}catch(r){w=!0,s.abort(new Error(pc));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==k?(r=t,e=Object.assign({},r.options,e)):(await $n(t),r=new za(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(lc)}else r=new Sc(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(lc)}else e=new Sc(this.fs,a,{data:null},r),n.push(e);e==this||e.data||(e.data=t)}else n.push(Pc(r,a,{data:t,Reader:Fc(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,Mc(e.readerOptions)),$n(t)]),o=new Yi(t,e);return await async function(t,e,r,n,o){const{onstart:a,onprogress:i,onend:s,onentryprogress:c}=n,u=e,l=Rc(e.children,t=>Nc(t)?0:1);let f=0,d=0;if(a&&await Dr(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(Nc(e))return;const{name:a,wr:s}=kc(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 Dr(i,f,r)}}));d++,c&&await Dr(c,d,l,h)}s&&await Dr(s,f)}(o,r,Rc([r],xc),e,n),await o.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(r={}){const n=this;Mc((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(nt(r[q]))throw new Error(ki);if(a!==U&&!(a instanceof Uint8Array))throw new Error(di);const s=Ps(a);if(s>e)throw new Error(fi);const c=r[G],u=new Map;let l=Boolean(c);const f=r[H]===U?0:r[H];let w=f,h=T;for(const t of n){let{name:e}=t;const{size:r}=t,n=Object.assign({},t.options);Fs(i,n,To)&&!e.endsWith(D)&&(e+=D);const o=es(i,e,n);({name:e}=o);const{Ae:a}=rs(i,e,n);0==a.level||a.compressionMethod!==U||a.passThrough||await gr(yt())||(a.level=0);const s=!Fs(i,n,To);if(s&&r===U)throw new Error(ki);const{Je:l,Ae:f}=os(i,s,r,a,n);if(s&&!a.passThrough&&Ms(f.compressionMethod,f.level))throw new Error(ki);const d=Object.assign({},n,o.Ae,a,f,{[G]:c}),p=as(d),m=cs(d),y={ze:p,Ue:Ps(p.Re,m.xe)};c&&is(y,w);const b=s?l:0;u.set(e,Object.assign({},d,p,{offset:w,diskNumberStart:0,compressedSize:b}));const E=y.Ue+b;h=Math.min(h,E),w+=E}if(u.size&&w-h>=t&&(l=!0),l&&!o)throw new Error(ki);const p=us(u);let m=Fs(i,r,Do);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=>!Nc(t)).map(t=>{const{name:e,wr:o}=kc(t,n,r);return{name:e,size:t.directory?0:Cc(t,vc(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 gc{constructor(){jc(this)}get children(){return this.root.children}remove(t){Tc(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(lc)}else Tc(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 jc(this),this.root.importBlob(t,e)}importData64URI(t,e){return jc(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return jc(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return jc(this),this.root.importHttpContent(t,e)}importReadable(t,e){return jc(this),this.root.importReadable(t,e)}importZip(t,e){return jc(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 Ac={FS:gc,ZipDirectoryEntry:Sc,ZipFileEntry:Ec};function Rc(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 xc(t){return t.uncompressedSize}function Dc(t,e){const{data:r}=t;return e&&r instanceof Po?r.compressedSize:t.uncompressedSize}function zc(t){let e;return function(){if(e)throw new Error(fc);return e=!0,{readable:t}}}function Fc(t){return class extends mn{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 Rn,Object.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:o||n,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=a,e.pr=new An(a),e.size=a.size,super.init()}readUint8Array(t,e){return this.pr.readUint8Array(t,e)}}}function Oc(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=Oc(t.Reader,t.data,e);o.set(t,r);try{await $n(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==U&&(t.uncompressedSize=r.size,t.lr=!1)})),o}function Tc(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function Ic(t){return Boolean(t)&&t.message==pc}function kc(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:A,gid:R}=t.data;i={externalFileAttributes:e,versionMadeBy:o,comment:c,lastModDate:u,creationDate:f,lastAccessDate:d,internalFileAttributes:E};const x=function(t){if(t){const e=new Map;if(t.forEach((t,r)=>{yc.has(r)||e.set(r,t.data)}),e.size)return e}}(S);if(x&&(i.extraField=x),A===U&&R===U||Object.assign(i,{uid:A,gid:R,unixExtraFieldType:"infozip"}),vc(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(hc)}}const c=Object.assign({lastModDate:t.dr},i,n,a,s,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===U)throw new Error(dc);return{name:o,wr:c}}function Cc(t,e){const{reader:r}=t;return r&&r.size!==U?r.size:t.lr?U:Dc(t,e)}function Mc(t){if(t&&(typeof t!=C||Array.isArray(t)))throw new Error(wc);return t}function vc(t,e){const{readerOptions:r}=e;return Boolean(!t.directory&&(t.passThrough||r&&r.passThrough))}function Nc(t){return t.directory&&null===t.data}function _c(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(Pc(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 jc(t){t.entries=[],t.ur=0,t.root=new Sc(t)}function Pc(t,e,r,n){if(t.directory)return n?new Sc(t.fs,e,r,t):new Ec(t.fs,e,r,t);throw new Error("Parent entry is not a directory")}export{An as BlobReader,Rn as BlobWriter,bn as Data64URIReader,En as Data64URIWriter,mc as ERR_ABORTED,$o as ERR_AMBIGUOUS_ARCHIVE,Wo as ERR_BAD_FORMAT,Vo as ERR_CENTRAL_DIRECTORY_NOT_FOUND,li as ERR_DUPLICATED_NAME,Ko as ERR_ENCRYPTED,ta as ERR_ENCRYPTED_CENTRAL_DIRECTORY,Qo as ERR_ENTRY_DATA_OUT_OF_BOUNDS,lc as ERR_ENTRY_EXISTS,Zo as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,Lo as ERR_EOCDR_NOT_FOUND,Go as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,nn as ERR_HTTP_RANGE,on as ERR_HTTP_RESOURCE_CHANGED,qt as ERR_INVALID_AUTHENTICATION_CODE,_e as ERR_INVALID_CODEC_DEFINITION,je as ERR_INVALID_CODEC_MODULE,fi as ERR_INVALID_COMMENT,di as ERR_INVALID_COMMENT_TYPE,Ye as ERR_INVALID_COMPRESSED_DATA,Xe as ERR_INVALID_CRC32,pi as ERR_INVALID_DATE,bi as ERR_INVALID_ENCRYPTION_STRENGTH,wi as ERR_INVALID_ENTRY_COMMENT,hi as ERR_INVALID_ENTRY_COMMENT_TYPE,mi as ERR_INVALID_ENTRY_NAME,gi as ERR_INVALID_EXTRAFIELD,xi as ERR_INVALID_EXTRAFIELD_DATA,Ri as ERR_INVALID_EXTRAFIELD_DATA_TYPE,Ai as ERR_INVALID_EXTRAFIELD_TYPE,na as ERR_INVALID_FILENAME_VALIDATION,tt as ERR_INVALID_FUNCTION_OPTION,Ni as ERR_INVALID_GID,Li as ERR_INVALID_LEVEL,oa as ERR_INVALID_MAX_APPENDED_DATA_SIZE,ut as ERR_INVALID_MAX_WORKERS,Pi as ERR_INVALID_MSDOS_ATTRIBUTES,Wi as ERR_INVALID_MSDOS_DATA,Gt as ERR_INVALID_PASSWORD,rt as ERR_INVALID_PASSWORD_TYPE,dc as ERR_INVALID_PASS_THROUGH,wc as ERR_INVALID_READER_OPTIONS,et as ERR_INVALID_SIGNAL,Kt as ERR_INVALID_SIGNATURE,Zi as ERR_INVALID_SIGNATURE_DATA,ra as ERR_INVALID_STRICTNESS,vi as ERR_INVALID_UID,qe as ERR_INVALID_UNCOMPRESSED_SIZE,Bi as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,ji as ERR_INVALID_UNIX_ID_SIZE,_i as ERR_INVALID_UNIX_MODE,yi as ERR_INVALID_VERSION,an as ERR_ITERATOR_COMPLETED_TOO_SOON,Ho as ERR_LOCAL_FILE_HEADER_NOT_FOUND,Jo as ERR_OVERLAPPING_ENTRY,fc as ERR_READABLE_CONSUMED,Be as ERR_RESERVED_COMPRESSION_METHOD,Xo as ERR_SPLIT_ZIP_FILE,Ii as ERR_UNDEFINED_COMPRESSION_METHOD,Ci as ERR_UNDEFINED_READER,Ti as ERR_UNDEFINED_UNCOMPRESSED_SIZE,ki as ERR_UNDETERMINED_SIZE,ea as ERR_UNSAFE_FILENAME,Yo as ERR_UNSUPPORTED_COMPRESSION,Js as ERR_UNSUPPORTED_CONTEXT,Xt as ERR_UNSUPPORTED_CRYPTO_API,qo as ERR_UNSUPPORTED_ENCRYPTION,Si as ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH,Ei as ERR_UNSUPPORTED_ENCRYPTION_USDZ,Ui as ERR_UNSUPPORTED_FORMAT,aa as ERR_UNSUPPORTED_UINT64,mr as ERR_WORKER_STARTUP_TIMEOUT,sn as ERR_WRITER_NOT_INITIALIZED,hc as ERR_ZIP_CRYPTO_LAST_MOD_DATE,Mi as ERR_ZIP_NOT_EMPTY,Hn as HttpRangeReader,Vn as HttpReader,mn as Reader,qn as SplitDataReader,Yn as SplitDataWriter,xn as TextReader,zn as TextWriter,Gn as Uint8ArrayReader,Kn as Uint8ArrayWriter,da as WARNING_APPENDED_DATA,ca as WARNING_COMPRESSED_PATCHED_DATA,pa as WARNING_DUPLICATE_FILENAME,ua as WARNING_MALFORMED_EXTRA_FIELD,ya as WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG,ba as WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD,Ea as WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES,ma as WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,wa as WARNING_PREPENDED_DATA,ha as WARNING_TRAILING_CENTRAL_DIRECTORY_DATA,sa as WARNING_UNKNOWN_VERSION,la as WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA,ia as WARNING_UNSORTED_CENTRAL_DIRECTORY,fa as WARNING_WRAPPED_ENTRIES_COUNT,yn as Writer,Sc as ZipDirectoryEntry,bc as ZipEntry,gc as ZipFS,Ec as ZipFileEntry,za as ZipReader,Fa as ZipReaderStream,Yi as ZipWriter,Xi as ZipWriterStream,St as configure,qs as createBlobTempStream,Gs as createOPFSTempStream,Qs as createSyncAccessHandleTempStream,Ac as fs,Zs as getMimeType,Oa as isZipFile,Ze as registerCodec,Dt as resetConfiguration,uc as terminateWorkers,Ve as unregisterCodec};