@zip.js/zip.js 2.8.45 → 2.8.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -2
- package/deno.json +13 -3
- package/dist/zip-core-external.js +146 -35
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +154 -32
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +146 -35
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +124 -30
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +146 -35
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +160 -36
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +160 -36
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +156 -34
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +158 -36
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +158 -36
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +160 -36
- package/index-native.min.js +1 -1
- package/index.cjs +160 -36
- package/index.d.cts +232 -1
- package/index.d.ts +232 -1
- package/index.min.js +1 -1
- package/lib/core/codec-pool.js +9 -5
- package/lib/core/codec-worker.js +30 -13
- package/lib/core/configuration.js +20 -2
- package/lib/core/constants.js +2 -0
- package/lib/core/options.js +4 -0
- package/lib/core/streams/codec-stream.js +2 -0
- package/lib/core/streams/common-crypto.js +2 -1
- package/lib/core/streams/zip-entry-stream.js +12 -10
- package/lib/core/util/sync-access-handle-temp-stream.js +2 -1
- package/lib/core/web-worker-base.js +27 -0
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/web-worker-native.js +7 -9
- package/lib/core/web-worker-wasm.js +9 -12
- package/lib/core/zip-fs.js +1 -1
- package/lib/core/zip-reader.js +58 -5
- package/lib/core/zip-writer.js +43 -8
- package/lib/zip-core-base.js +2 -1
- package/lib/{core/web-worker-inline-template.js → zip-core-custom.js} +13 -20
- package/lib/zip-core-reader.js +2 -1
- package/lib/zip-core-writer.js +10 -1
- package/lib/zip-module-native.js +3 -3
- package/lib/zip-module-wasm-base.js +3 -3
- package/package.json +20 -2
- package/lib/core/web-worker-inline-template-native.js +0 -48
- package/lib/core/zlib-streams-inline-template.js +0 -45
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=4294967295,e=65535,r=255,n=67324752,a=134695760,s=a,i=33639248,o=101010256,c=101075792,l=117853008,d=22,u=20,f=39169,w=21589,h=6534,p=30837,m=30805,y=2048,b=16384,S=2048,E=1024,g="/",x=30,z=new Date(2107,11,31,23,59,58),R=new Date(1980,0,1),A=void 0,F=1/0,D="undefined",U="function",O=new Uint8Array;let T=2;try{typeof navigator!=D&&navigator.hardwareConcurrency&&(T=navigator.hardwareConcurrency)}catch{}const k={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:T,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=D&&CompressionStream,DecompressionStream:typeof DecompressionStream!=D&&DecompressionStream},v=["baseURI","wasmURI","workerURI","chunkSize","maxWorkers","terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout","useCompressionStream","useWebWorkers","transferStreams","CompressionStream","DecompressionStream","CompressionStreamZlib","DecompressionStreamZlib"],C={...k};function M(){return C}function I(t){return Math.max(t.chunkSize,64)}function j(t){for(const e of v){const r=t[e];r!==A&&(C[e]=r)}}function P(t){for(const e of v){const r=t[e];r!==A&&(k[e]=r)}j(t)}function N(){for(const t of v)delete C[t];Object.assign(C,k)}const W="Invalid codec definition",_="Reserved compression method",L="Invalid codec module",B="string",Z=[0,8,9,99],V=new Map,H=new Map;function q(t={}){const{compressionMethod:r,format:n,codecURI:a,CompressionStream:s,DecompressionStream:i,versionNeeded:o}=t;if(!Number.isInteger(r)||0>r||r>e||typeof n!=B||!n.length)throw Error(W);if(Z.includes(r))throw Error(_);const c=typeof s==U||typeof i==U;if(!(c||typeof a==B&&a.length))throw Error(W);V.set(r,{compressionMethod:r,format:n,codecURI:a,versionNeeded:o}),c&&X(n,{CompressionStream:s,DecompressionStream:i})}function K(t){const e=V.get(t);if(e){let r;V.delete(t),V.forEach(t=>r=r||t.format==e.format),r||H.delete(e.format)}}function Y(t){return V.get(t)}function G(t){return H.get(t)}function X(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=U&&typeof n!=U)throw Error(L);H.set(t,{CompressionStream:r,DecompressionStream:n})}const J=[[],[],[],[],[],[],[],[]];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?e>>>1^3988292384:e>>>1;J[0][t]=e}for(let t=0;256>t;t++)for(let e=1;8>e;e++){const r=J[e-1][t];J[e][t]=r>>>8^J[0][255&r]}const[Q,$,tt,et,rt,nt,at,st]=J;class it{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(;s>=n;n+=8){const t=e^a.getInt32(n,!0),r=a.getInt32(n+4,!0);e=st[255&t]^at[t>>>8&255]^nt[t>>>16&255]^rt[t>>>24&255]^et[255&r]^tt[r>>>8&255]^$[r>>>16&255]^Q[r>>>24&255]}}for(;r>n;n++)e=e>>>8^Q[255&(e^t[n])];this.o=e}get(){return~this.o}}class ot extends TransformStream{constructor(){let t;const e=new it;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 ct(t){if(typeof TextEncoder==D){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)}function lt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function dt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function ut(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const ft={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=ft.l(r);return 32===n?t.concat(e):ft.h(e,n,0|r,t.slice(0,t.length-1))},m(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+ft.l(r)},S(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]=ft.R(e,t[r-1]&2147483648>>e-1,1)),t},R:(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=ft.l(a);return n.push(ft.R(e+s&31,e+s>32?r:n.pop(),1)),n}},wt={bytes:{A(t){const e=ft.m(t)/8,r=new Uint8Array(e);let n;for(let a=0;e>a;a++)3&a||(n=t[a/4]),r[a]=n>>>24,n<<=8;return r},F(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(ft.R(8*(3&r),n)),e}}},ht=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.U=[1518500249,1859775393,2400959708,3395469782],t?(e.O=t.O.slice(0),e.T=t.T.slice(0),e.v=t.v):e.reset()}reset(){const t=this;return t.O=t.D.slice(0),t.T=[],t.v=0,t}update(t){const e=this;"string"==typeof t&&(t=wt.C.F(t));const r=e.T=ft.concat(e.T,t),n=e.v,a=e.v=n+ft.m(t);if(a>9007199254740991)throw Error("Cannot hash more than 2^53 - 1 bits");const s=new Uint32Array(r);let i=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);a>=t;t+=e.blockSize)e.M(s.subarray(16*i,16*(i+1))),i+=1;return r.splice(0,16*i),e}I(){const t=this;let e=t.T;const r=t.O;e=ft.concat(e,[ft.R(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(t.v/4294967296)),e.push(0|t.v);e.length;)t.M(e.splice(0,16));return t.reset(),r}j(t,e,r,n){return t>19?t>39?t>59?t>79?void 0:e^r^n:e&r|e&n|r&n:e^r^n:e&r|~e&n}P(t,e){return e<<t|e>>>32-t}M(t){const e=this,r=e.O,n=Array(80);for(let e=0;16>e;e++)n[e]=t[e];let a=r[0],s=r[1],i=r[2],o=r[3],c=r[4];for(let t=0;79>=t;t++){16>t||(n[t]=e.P(1,n[t-3]^n[t-8]^n[t-14]^n[t-16]));const r=e.P(5,a)+e.j(t,s,i,o)+c+n[t]+e.U[Math.floor(t/20)]|0;c=o,o=i,i=e.P(30,s),s=a,a=r}r[0]=r[0]+a|0,r[1]=r[1]+s|0,r[2]=r[2]+i|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0}},pt={importKey:t=>new pt.N(wt.bytes.F(t)),W(t,e,r,n){if(r=r||1e4,0>n||0>r)throw Error("invalid params to pbkdf2");const a=1+(n>>5)<<2;let s,i,o,c,l;const d=new ArrayBuffer(a),u=new DataView(d);let f=0;const w=ft;for(e=wt.bytes.F(e),l=1;(a||1)>f;l++){for(s=i=t.encrypt(w.concat(e,[l])),o=1;r>o;o++)for(i=t.encrypt(i),c=0;c<i.length;c++)s[c]^=i[c];for(o=0;(a||1)>f&&o<s.length;o++)u.setInt32(f,s[o]),f+=4}return d.slice(0,n/8)},N:class{constructor(t){const e=this,r=e._=ht,n=[[],[]];e.L=[new r,new r];const a=e.L[0].blockSize/32;t.length>a&&(t=(new r).update(t).I());for(let e=0;a>e;e++)n[0][e]=909522486^t[e],n[1][e]=1549556828^t[e];e.L[0].update(n[0]),e.L[1].update(n[1]),e.B=new r(e.L[0])}reset(){const t=this;t.B=new t._(t.L[0]),t.Z=!1}update(t){this.Z=!0,this.B.update(t)}digest(){const t=this,e=t.B.I(),r=new t._(t.L[1]).update(e).I();return t.reset(),r}encrypt(t){if(this.Z)throw Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},mt=typeof crypto!=D&&typeof crypto.getRandomValues==U,yt="Invalid password",bt="Invalid signature",St=bt,Et="zipjs-abort-check-password";function gt(t){if(mt)return crypto.getRandomValues(t);throw Error("Crypto API not supported")}const xt=16,zt={name:"PBKDF2"},Rt=Object.assign({hash:{name:"HMAC"}},zt),At=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},zt),Ft=["deriveBits"],Dt=[8,12,16],Ut=[16,24,32],Ot=10,Tt=[0,0,0,0],kt=typeof crypto!=D,vt=kt&&crypto.subtle,Ct=kt&&typeof vt!=D,Mt=wt.bytes,It=class{constructor(t){const e=this;e.V=[[[],[],[],[],[]],[[],[],[],[],[]]],e.V[0][0][0]||e.H();const r=e.V[0][4],n=e.V[1],a=t.length;let s,i,o,c=1;if(4!==a&&6!==a&&8!==a)throw Error("invalid aes key size");for(e.U=[i=t.slice(0),o=[]],s=a;4*a+28>s;s++){let t=i[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))),i[s]=i[s-a]^t}for(let t=0;s;t++,s--){const e=i[3&t?s:s-4];o[t]=4>=s||4>t?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.K(t,0)}decrypt(t){return this.K(t,1)}H(){const t=this.V[0],e=this.V[1],r=t[4],n=e[4],a=[],s=[];let i,o,c,l;for(let t=0;256>t;t++)s[(a[t]=t<<1^283*(t>>7))^t]=t;for(let d=i=0;!r[d];d^=o||1,i=s[i]||1){let s=i^i<<1^i<<2^i<<3^i<<4;s=s>>8^255&s^99,r[d]=s,n[s]=d,l=a[c=a[o=a[d]]];let u=16843009*l^65537*c^257*o^16843008*d,f=257*a[s]^16843008*s;for(let r=0;4>r;r++)t[r][d]=f=f<<24^f>>>8,e[r][s]=u=u<<24^u>>>8}for(let r=0;5>r;r++)t[r]=t[r].slice(0),e[r]=e[r].slice(0)}K(t,e){if(4!==t.length)throw Error("invalid aes block size");const r=this.U[e],n=r.length/4-2,a=[0,0,0,0],s=this.V[e],i=s[0],o=s[1],c=s[2],l=s[3],d=s[4];let u,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;n>t;t++)u=i[h>>>24]^o[p>>16&255]^c[m>>8&255]^l[255&y]^r[b],f=i[p>>>24]^o[m>>16&255]^c[y>>8&255]^l[255&h]^r[b+1],w=i[m>>>24]^o[y>>16&255]^c[h>>8&255]^l[255&p]^r[b+2],y=i[y>>>24]^o[h>>16&255]^c[p>>8&255]^l[255&m]^r[b+3],b+=4,h=u,p=f,m=w;for(let t=0;4>t;t++)a[e?3&-t:t]=d[h>>>24]<<24^d[p>>16&255]<<16^d[m>>8&255]<<8^d[255&y]^r[b++],u=h,h=p,p=m,m=y,y=u;return a}},jt=class{constructor(t,e){this.Y=t,this.G=e,this.X=e}reset(){this.X=this.G}update(t){return this.J(this.Y,t,this.X)}$(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}et(t){0===(t[0]=this.$(t[0]))&&(t[1]=this.$(t[1]))}J(t,e,r){let n;if(!(n=e.length))return[];const a=ft.m(e);for(let a=0;n>a;a+=4){this.et(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 ft.S(e,a)}},Pt=pt.N;let Nt=kt&&Ct&&typeof vt.importKey==U,Wt=kt&&Ct&&typeof vt.deriveBits==U;class _t extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:a=!0}){super({start(){Bt(this,t,e,r)},async transform(t,e){const r=this,{password:a,strength:s,nt:i,ready:o}=r;a?(await(async(t,e,r,n)=>{const a=await Vt(t,e,r,qt(n,0,Dt[e])),s=qt(n,Dt[e]);if(a[0]!=s[0]||a[1]!=s[1])throw Error(yt)})(r,s,a,qt(t,0,Dt[s]+2)),t=qt(t,Dt[s]+2),n?e.error(Error(Et)):i()):await o;const c=new Uint8Array(t.length-Ot-(t.length-Ot)%xt);e.enqueue(Zt(r,t,c,0,Ot,!0))},async flush(t){const{st:e,it:r,pending:n,ready:s}=this;if(r&&e){await s;const i=qt(n,0,n.length-Ot),o=qt(n,n.length-Ot);let c=O;if(i.length){const t=Yt(Mt,i);r.update(t);const n=e.update(t);c=Kt(Mt,n)}const l=qt(Kt(Mt,r.digest()),0,Ot);let d=n.length<Ot?1:0;for(let t=0;Ot>t;t++)d|=l[t]^o[t];if(d&&a)throw Error(St);t.enqueue(c)}}})}}class Lt extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){Bt(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:a,nt:s,ready:i}=r;let o=O;n?(o=await(async(t,e,r)=>{const n=gt(new Uint8Array(Dt[e]));return lt(n,await Vt(t,e,r,n))})(r,a,n),s()):await i;const c=new Uint8Array(o.length+t.length-t.length%xt);c.set(o,0),e.enqueue(Zt(r,t,c,o.length,0))},async flush(t){const{st:e,it:r,pending:n,ready:a}=this;if(r&&e){await a;let s=O;if(n.length){const t=e.update(Yt(Mt,n));r.update(t),s=Kt(Mt,t)}const i=Kt(Mt,r.digest()).slice(0,Ot);t.enqueue(lt(s,i))}}})}}function Bt(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.nt=e),password:Ht(e,r),strength:n-1,pending:O})}function Zt(t,e,r,n,a,s){const{st:i,it:o,pending:c}=t;c.length&&(e=lt(c,e));const l=e.length-a;let d;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)),d=0;l-xt>=d;d+=xt){const t=Yt(Mt,qt(e,d,d+xt));s&&o.update(t);const a=i.update(t);s||o.update(a),r.set(Kt(Mt,a),d+n)}return t.pending=qt(e,d),r}async function Vt(t,e,r,n){t.password=null;const a=await(async(t,e,r,n,a)=>{if(!Nt)return pt.importKey(e);try{return await vt.importKey("raw",e,r,!1,a)}catch{return Nt=!1,pt.importKey(e)}})(0,r,Rt,0,Ft),s=await(async(t,e,r)=>{if(!Wt)return pt.W(e,t.salt,At.iterations,r);try{return await vt.deriveBits(t,e,r)}catch{return Wt=!1,pt.W(e,t.salt,At.iterations,r)}})(Object.assign({salt:n},At),a,8*(2*Ut[e]+2)),i=new Uint8Array(s),o=Yt(Mt,qt(i,0,Ut[e])),c=Yt(Mt,qt(i,Ut[e],2*Ut[e])),l=qt(i,2*Ut[e]);return Object.assign(t,{keys:{key:o,ot:c,passwordVerification:l},st:new jt(new It(o),Array.from(Tt)),it:new Pt(c)}),l}function Ht(t,e){return e===A?ct(t):e}function qt(t,e,r){return t.subarray(e,r)}function Kt(t,e){return t.A(e)}function Yt(t,e){return t.F(e)}class Gt extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){Jt(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=Qt(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw Error(yt);t=t.subarray(12)}n?e.error(Error(Et)):e.enqueue(Qt(r,t))}})}}class Xt extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){Jt(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($t(r,e),0),a=12}else n=new Uint8Array(t.length),a=0;n.set($t(r,t),a),e.enqueue(n)}})}}function Jt(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 it(n[0]),lt:new it(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 Qt(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=ee(t)^e[n],te(t,r[n]);return r}function $t(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=ee(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=ne(Math.imul(ne(r+re(n)),134775813)+1),t.lt.append([r>>>24]);const a=~t.lt.get();t.keys=[n,r,a]}function ee(t){const e=2|t.keys[2];return re(Math.imul(e,1^e)>>>8)}function re(t){return 255&t}function ne(t){return 4294967295&t}function ae(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 se(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 ie="Invalid uncompressed size",oe="Invalid compressed data",ce=bt,le="deflate-raw",de="gzip",ue=[31,139,8];class fe extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamZlib:r,CompressionStream:n}){super({});const{compressed:a,encrypted:s,useCompressionStream:i,zipCrypto:o,computeCrc32:c,level:l,deflate64:d,format:u,compressionMethod:f}=t,w=this;let h,p,m,y=super.readable;const b=u&&G(u),S=c&&a&&!d&&!b&&(!s||o)&&!(!i||!n);if(s&&!o||!c||S||(h=new ot,y=ge(y,h)),a)if(b)y=xe(y,Se(b.CompressionStream,u,{level:l,chunkSize:e,compressionMethod:f}));else if(S)m=new we,y=xe(y,new n(de)),y=ge(y,m);else try{y=Ee(y,i,{level:l,chunkSize:e},n,r)}catch(t){let e;try{e=new n(de)}catch{throw t}y=xe(y,e),y=ge(y,new we)}s&&(o?y=ge(y,new Xt(t)):(p=new Lt(t),y=ge(y,p))),be(w,y,()=>{s&&!o||!c||(w.crc32=S?m.crc32:new DataView(h.value.buffer).getUint32(0))})}}class we 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(8>=a)return void(r=lt(r,t));const s=a-8,i=Math.min(s,r.length);n.enqueue(lt(r.subarray(0,i),t.subarray(0,s-i))),r=lt(r.subarray(i),t.subarray(s-i))},flush(){const e=ut(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class he extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamZlib:r,DecompressionStream:n}){super({});const{zipCrypto:a,encrypted:s,checkCrc32:i,crc32:o,compressed:c,useCompressionStream:l,deflate64:d,format:u,compressionMethod:f,rawBitFlag:w,outputSize:h}=t;let p,m,y=super.readable;if(s&&(a?y=ge(y,new Gt(t)):(m=new _t(t),y=ge(y,m))),c){const t=u&&G(u);if(t)y=xe(y,Se(t.DecompressionStream,u,{chunkSize:e,compressionMethod:f,rawBitFlag:w,uncompressedSize:h}));else try{y=Ee(y,l,{chunkSize:e,deflate64:d},n,r)}catch(t){if(d||h===A)throw t;let e;try{e=new n(de)}catch{throw t}y=((t,e,r)=>{const n=new it;let a,s,i,o=0,c=!1;const l=new Promise((t,e)=>{s=t,i=e});l.catch(()=>{}),r||s();const d=new TransformStream({start(t){const e=new Uint8Array(10);e.set(ue),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=ut(e);a.setUint32(0,n.get(),!0),a.setUint32(4,r,!0),t.enqueue(e)},cancel(t){i(t)}}),u=new TransformStream({transform(t,e){n.append(t),o+=t.length,r>o?c&&f():s(),e.enqueue(t)},cancel(t){i(t)}});return t=ge(t,d),ge(t=xe(t,e),u);function f(){w(),a=setTimeout(()=>i(Error(ie)),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(oe);throw e.cause=t,e}const{value:n,done:a}=r;a?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})})(y)}i&&(p=new ot,y=ge(y,p)),be(this,y,()=>{if(i){const t=new DataView(p.value.buffer);if(o!=t.getUint32(0,!1))throw Error(ce)}})}}const pe=new Map;function me(t,e){if(!t)return!1;let r=pe.get(t);r||(r=new Map,pe.set(t,r));let n=r.get(e);if(n===A){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function ye(t){return me(t,le)}function be(t,e,r){e=ge(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function Se(t,e,r){if(!t)throw Error("Compression method not supported");return new t(e,r)}function Ee(t,e,r,n,a){const s=e&&n?n:a||n,i=r.deflate64?"deflate64-raw":le;let o;try{o=new s(i,r)}catch(t){if(!e||!a||s==a)throw t;o=new a(i,r)}return xe(t,o)}function ge(t,e){return ae(t).pipeThrough(e)}function xe(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 ze="data",Re="deflate",Ae="inflate";class Fe extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let a;n.startsWith(Re)?a=fe:n.startsWith(Ae)&&(a=he),r.outputSize=0;let s=0;const i=new a(t,e),o=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!==A&&r.outputSize>t.outputSize))throw Error(ie)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:s})}});Object.defineProperty(r,"readable",{get:()=>o.pipeThrough(c).pipeThrough(i).pipeThrough(l)})}}class De extends TransformStream{constructor(t){const e=[];let r=0;function n(){const n=new Uint8Array(t);let a=0;for(;t>a;){const r=e[0],s=t-a;r.length>s?(n.set(r.subarray(0,s),a),e[0]=r.subarray(s),a+=s):(n.set(r,a),a+=r.length,e.shift())}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 Ue={type:"module"},Oe="error";let Te,ke,ve,Ce,Me=!0;try{Me=typeof structuredClone==U&&structuredClone(new DOMException("","AbortError")).code!==A}catch{}let Ie=()=>{};class je{constructor(t,{readable:e,writable:r},{options:n,config:a,ut:s,useWebWorkers:i,transferStreams:o,workerURI:c},l){const{signal:d}=s;return Object.assign(t,{ft:!0,wt:(t.wt||0)+1,readable:e.pipeThrough(new De(I(a))).pipeThrough(new Pe(s),{signal:d}),writable:r,options:Object.assign({},n),workerURI:c,transferStreams:o,terminate:()=>new Promise(e=>{const{ht:r,ft:n}=t;r?(n?t.yt=e:(r.terminate(),e()),t.bt=null):e()}),St(){if(t.ft){const{yt:e}=t;e&&(t.yt=null,t.Et=!0,t.ht.terminate(),e()),t.ft=!1,l(t)}}}),Te===A&&(Te=typeof Worker!=D),(i&&Te?_e:We)(t,a)}}class Pe extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let a=0;super({async start(){t&&await Ne(t,r)},async transform(t,n){a+=t.length,e&&await Ne(e,a,r),n.enqueue(t)},async flush(){n&&await Ne(n,a)}})}}async function Ne(t,...e){try{await t(...e)}catch{}}function We(t,e){return{run:()=>Le(t,e)}}function _e(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:a}=e;let{wasmURI:s}=e;if(!t.bt){let i;typeof s==U&&(s=s());try{i=Ze(t.workerURI,r,t)}catch{return Te=!1,We(t,e)}Object.assign(t,{ht:i,gt:!1,Et:!1,bt:{run:async()=>{try{return await(async(t,e)=>{let r,n;const a=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,xt:r,zt:n,result:a});const{readable:s,options:i}=t,{writable:o,closed:c,Rt: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,Rt:()=>e.abort()}})(t.writable);let d;try{d=qe({type:"start",options:i,config:e,readable:s,writable:o},t)}catch(e){l();try{await c}catch{}throw t.St(),e}d||Object.assign(t,{reader:s.getReader(),writer:o.getWriter()});const{workerStartupTimeout:u}=e;t.gt||!Number.isFinite(u)||0>u||(t.At=setTimeout(()=>(t=>{if(t.At=null,t.gt)return;const{zt:e,writer:r}=t;if(Be(t),t.ht=null,e){const t=Error("Worker startup timeout");t.Ft=!0,e(t),r&&r.releaseLock()}})(t),u));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(!d&&!o.locked)try{await o.getWriter().close()}catch{}}})(t,{chunkSize:n,wasmURI:s,baseURI:r,workerStartupTimeout:a})}catch(r){if(r&&r.Ft){Te=!1;const{reader:r}=t;return r&&r.releaseLock(),t.reader=null,t.writer=null,Le(t,e)}throw r}}}})}return t.bt}async function Le({options:t,readable:e,writable:r,St:n},a){let s;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(Re),r=e?a.CompressionStreamZlib:a.DecompressionStreamZlib,n=e?a.CompressionStream:a.DecompressionStream;if(t.useCompressionStream){if(r&&r.Dt&&!ye(n))try{await Ie(a)}catch{}}else try{await Ie(a)}catch{r&&!r.Dt||(t.useCompressionStream=!0)}}s=new Fe(t,a),await e.pipeThrough(s).pipeThrough(new De(I(a))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{crc32:n,inputSize:i,outputSize:o}=s;return{crc32:n,inputSize:i,outputSize:o}}catch(t){throw s&&(t.outputSize=s.outputSize),t}finally{n()}}function Be(t){const{ht:e}=t;if(e)try{e.terminate()}catch{}t.bt=null}function Ze(t,e,r,n,a=!0){let s,i,o;if(ve===A||ke!==t){const c=typeof t==U;i=c?t(a):t;const l=i.startsWith("data:"),d=i.startsWith("blob:");if(l||d){n===A&&(n=!1),n&&(o=Ue);try{s=new Worker(i,o)}catch(a){if(d)try{URL.revokeObjectURL(i)}catch{}if(c&&d)return Ze(t,e,r,n,!1);if(n)throw a;return Ze(t,e,r,!0,!1)}}else{n===A&&(n=!0),n&&(o=Ue);try{i=new URL(i,e)}catch{}try{s=new Worker(i,o)}catch(s){if(n)throw s;return Ze(t,e,r,!1,a)}}ke=t,ve=i,Ce=o}else s=new Worker(ve,Ce);return s.addEventListener("message",t=>{r.gt=!0,Ve(r),(async({data:t},e)=>{const{type:r,value:n,messageId:a,result:s,error:i}=t,{reader:o,writer:c,xt:l,zt:d,St:u,wt:f}=e,w=()=>e.wt!=f;try{if(i){const{message:t,stack:e,code:r,name:n,outputSize:a,cause:s}=i,o=Error(t);Object.assign(o,{stack:e,code:r,name:n,outputSize:a}),s&&(o.cause=Object.assign(Error(s.message),{name:s.name})),h(o)}else{if("pull"==r){const{value:t,done:r}=await o.read();w()||qe({type:ze,value:t,done:r,messageId:a},e)}r==ze&&(await c.ready,await c.write(new Uint8Array(n)),w()||qe({type:"ack",messageId:a},e)),"close"==r&&h(null,s)}}catch(i){w()||(Be(e),h(i))}function h(t,e){w()||(t?d(t):l(e),c&&c.releaseLock(),u())}})(t,r)}),s.addEventListener(Oe,t=>He(t,r)),s.addEventListener("messageerror",t=>He(t,r)),s}function Ve(t){const{At:e}=t;e&&(clearTimeout(e),t.At=null)}function He(t,e){t.preventDefault&&t.preventDefault(),Ve(e);const{gt:r,zt:n,writer:a,St:s}=e;if(Be(e),r||(e.ht=null),n){let e=t.error||Error(t.message||Oe);r||(e=Object.assign(Error(e.message||Oe),{Ft:!0})),n(e),a&&a.releaseLock(),r&&s()}}function qe(t,{ht:e,writer:r,transferStreams:n,gt:a}){try{const{value:r,readable:s,writable:i}=t,o=[];if(r&&(t.value=dt(r),o.push(t.value.buffer)),n&&Me&&a?(s&&o.push(s),i&&o.push(i)):t.readable=t.writable=null,o.length)try{return e.postMessage(t,o),!0}catch{Me=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}let Ke=[];const Ye=[];let Ge,Xe,Je=0;async function Qe(t,e){const{options:r,config:n}=e,{transferStreams:a,useWebWorkers:s,useCompressionStream:i,compressed:o,checkCrc32:c,computeCrc32:l,encrypted:d,format:u,codecURI:f}=r,{workerURI:w,maxWorkers:h}=n;u&&(f&&(r.codecURI=((t,e)=>{try{return new URL(t,e).toString()}catch{return t}})(f,n.baseURI)),await(async(t,e)=>{!H.has(t)&&e&&X(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(u,r.codecURI)),e.transferStreams=a||a===A&&n.transferStreams;const p=!(o||c||l||d),m=u===A||!!r.codecURI;return e.useWebWorkers=!p&&m&&(s||s===A&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:A,r.useCompressionStream=i||i===A&&n.useCompressionStream,(await(async()=>{const r=Ke.find(t=>!t.ft);if(r)return nr(r),new je(r,t,e,y);if(Ke.length<h){const r={Ut:Je};return Je++,Ke.push(r),new je(r,t,e,y)}return new Promise(r=>{Ye.push({resolve:r,stream:t,Ot:e}),Xe=n.workerStarvationTimeout,$e()})})()).run();function y(t){if(tr(),Ye.length){const[{resolve:e,stream:r,Ot:n}]=Ye.splice(0,1);e(new je(t,r,n,y)),$e()}else t.ht?(nr(t),((t,e)=>{const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.Et?t.Et=!1:t.Tt=setTimeout(async()=>{Ke=Ke.filter(e=>e!=t);try{await t.terminate()}catch{}},n))})(t,e)):Ke=Ke.filter(e=>e!=t)}}function $e(){!Ge&&Ye.length&&Number.isFinite(Xe)&&Xe>=0&&(Ge=setTimeout(er,Xe))}function tr(){Ge&&(clearTimeout(Ge),Ge=null)}function er(){if(Ge=null,Ye.length){const[{resolve:t,stream:e,Ot:r}]=Ye.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:A});t(new je({},e,n,rr)),$e()}}function rr(){tr(),$e()}function nr(t){const{Tt:e}=t;e&&(clearTimeout(e),t.Tt=null)}const ar="HTTP error ",sr="HTTP Range not supported",ir="HTTP resource changed",or="Writer iterator completed too soon",cr="Writer not initialized",lr="Content-Range",dr="Range",ur="GET",fr="bytes",wr=16777216,hr="writable",pr=Symbol();class mr{constructor(){this.size=0}init(){this.initialized=!0}}class yr extends mr{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=I(M())}={}){const n=this;let a=0;return new ReadableStream({async pull(s){const i=e===A?r:Math.min(r,e-a),o=await $r(n,t+a,i);s.enqueue(o),a+r>e||e===A&&!o.length&&i?s.close():a+=r}})}}class br extends mr{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw Error(cr);return t.writeUint8Array(dt(e))}});Object.defineProperty(t,hr,{get:()=>e})}writeUint8Array(){}}class Sr extends yr{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{dataURI:t,kt:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{kt:r,dataURI:n}=this,a=new Uint8Array(e),s=4*Math.floor(t/3),i=atob(n.substring(s+r,4*Math.ceil((t+e)/3)+r)),o=t-3*Math.floor(s/4);let c=0;for(let t=o;o+e>t&&t<i.length;t++)a[t-o]=i.charCodeAt(t),c++;return c<a.length?a.subarray(0,c):a}}class Er extends br{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){const e=this;let r,n=e.pending;const a=e.pending.length;for(e.pending="",r=0;r<3*Math.floor((a+t.length)/3)-a;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.pending+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.pending=n+e.pending}getData(){return this.data+btoa(this.pending)}}let gr,xr;class zr extends yr{constructor(t){super(),Object.assign(this,{blob:t,size:t.size}),xr||(xr=(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();gr=1==e}catch{gr=!1}})())}createReadable(t){const{blob:e,size:r}=this,{offset:n=0,size:a=r-n}=t||{};return n||r>a?gr?ae(e.slice(n,n+a).stream()):super.createReadable(t):ae(e.stream())}async readUint8Array(t,e){const r=this,n=t+e,a=t||n<r.size?r.blob.slice(t,n):r.blob;let s=await a.arrayBuffer();return s.byteLength>e&&(s=s.slice(t,n)),new Uint8Array(s)}}class Rr extends mr{constructor(t){super();const e=this,r=new TransformStream;if(Object.defineProperty(e,hr,{get:()=>r.writable}),typeof Blob.prototype.stream!=U||new Blob([]).stream()instanceof ReadableStream){const n=[];t&&n.push(["Content-Type",t]),e.blob=new Response(r.readable,{headers:n}).blob()}else{const n=[];e.blob=r.readable.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,{type:t}))}e.blob.catch(()=>{})}getData(){return this.blob}}class Ar extends zr{constructor(t){super(new Blob([t],{type:"text/plain"}))}}class Fr extends Rr{constructor(t){super(t),Object.assign(this,{encoding:t,vt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,vt:e}=this,r=await super.getData();if(r.text&&e)return r.text();{const e=new FileReader;return new Promise((n,a)=>{Object.assign(e,{onload:({target:t})=>n(t.result),onerror:()=>a(e.error)}),e.readAsText(r,t)})}}}class Dr extends yr{constructor(t,e){super(),Or(this,t,e)}async init(){await Tr(this,Br,Nr),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:a}=e;if((r||n)&&a!==A){const{offset:r=0,size:n=a-r}=t||{};if(n>0&&a>r)return((t,e,r)=>{let n,a=e,s=0,i=r;return new ReadableStream({start:()=>o(),async pull(t){n||await o();const{value:e,done:r}=await n.read();if(r)throw Error(sr);const a=e.length>s?e.subarray(0,s):e;s-=a.length,i-=a.length,a.length&&t.enqueue(a),s||(await(async()=>{const t=n;n=A,await t.cancel()})(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function o(){const e=Math.min(t.maximumRangeSize,i),r=await Br(ur,t,jr(t,a,e));if(206!=r.status)throw Error(sr);const o=r.headers.get(lr);if(o){const t=Number(o.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=a)throw Error(sr)}Ir(t,r),Mr(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 kr(this,t,e,Br,Nr)}}class Ur extends yr{constructor(t,e){super(),Or(this,t,e)}async init(){await Tr(this,Zr,Wr),super.init()}readUint8Array(t,e){return kr(this,t,e,Zr,Wr)}}function Or(t,e,r){const{preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:i,checkResourceChanges:o=!0,maximumRangeSize:c=wr,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:i,checkResourceChanges:o,maximumRangeSize:c,fetch:l})}async function Tr(t,e,r){const{url:n,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:i,combineSizeEocd:o}=t;if((t=>{const{baseURI:e}=M(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r})(n)&&(s||i)&&(void 0===a||a)){const n=await e(ur,t,jr(t,o?-22:void 0)),a=n.headers.get("Accept-Ranges");if(!(i||a&&a.toLowerCase()==fr))throw Error(sr);{if(o){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Ct=e)}Mr(t,n);const a=vr(n);a===A?await Lr(t,e,r):t.size=a}}else await Lr(t,e,r)}async function kr(t,e,r,n,a){const{useRangeHeader:s,forceRangeRequests:i,Ct:o,size:c,options:l}=t;if(s||i){if(o&&e==c-d&&r==d)return o;if(c>e&&0!==r){e+r>c&&(r=c-e);const a=await n(ur,t,jr(t,e,r));if(206!=a.status)throw Error(sr);const s=a.headers.get(lr);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw Error(sr)}Ir(t,a),Mr(t,a);const i=new Uint8Array(await a.arrayBuffer());if(i.length!=r)throw Error(sr);return i}return O}{const{data:n}=t;return n||await a(t,l),t.data.subarray(e,e+r)}}function vr(t){const e=t.headers.get(lr);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Cr({headers:t}){return{Mt:t.get("Etag")||A,lastModified:t.get("Last-Modified")||A}}function Mr(t,e){const{checkResourceChanges:r,It:n}=t;r&&!n&&206==e.status&&(t.It=Cr(e))}function Ir(t,e){const{checkResourceChanges:r,It:n,size:a}=t;if(r){const t=vr(e);if(t!==A&&a!==A&&t!=a)throw Error(ir);if(n){const t=Cr(e);if(Object.entries(n).some(([e,r])=>r!==A&&t[e]!==A&&r!=t[e]))throw Error(ir)}}}function jr(t,e=0,r=1){return Object.assign({},Pr(t),{[dr]:fr+"="+(0>e?e:e+"-"+(e+r-1))})}function Pr({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function Nr(t){await _r(t,Br)}async function Wr(t){await _r(t,Zr)}async function _r(t,e){const r=await e(ur,t,Pr(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Lr(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Pr(t)),a=n.headers.get("Content-Length");a&&!n.headers.get("Content-Encoding")?t.size=Number(a):await r(t,t.options)}}async function Br(t,{fetch:e=fetch,options:r,url:n},a){const s=await e(n,Object.assign({},r,{method:t,headers:a}));if(400>s.status)return s;throw 416==s.status?Error(sr):Error(ar+(s.statusText||s.status))}function Zr(t,{url:e},r){return new Promise((n,a)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(400>s.status){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(sr):Error(ar+(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 Vr extends yr{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Ur(t,e):new Dr(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 Hr extends Vr{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class qr extends yr{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{array:t,size:t.length})}readUint8Array(t,e){return this.array.slice(t,t+e)}}class Kr extends br{constructor(t){super(),this.defaultBufferSize=t||262144}init(t=0){Object.assign(this,{offset:0,array:new Uint8Array(t>0?t:this.defaultBufferSize)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.array.length){let t=e.array.length?2*e.array.length:e.defaultBufferSize;for(;r>t;)t*=2;const n=e.array;e.array=new Uint8Array(t),e.array.set(n)}e.array.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.array.length?this.array:this.array.slice(0,this.offset)}}class Yr extends yr{constructor(t){super(),this.jt=t}async init(){const t=this,{jt:e}=t;t.Pt=0,await Promise.all(e.map(t=>Qr(t))),t.Nt=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}Wt(t){const{Nt:e,size:r}=this,n=e[t];return n===A?r:n}async readUint8Array(t,e){const r=this,{jt:n}=this;let a,s=0,i=t;for(;n[s]&&i>=n[s].size;)i-=n[s].size,s++;const o=n[s];if(o){const n=o.size;if(i+e>n){const s=n-i;a=lt(await $r(o,i,s),await r.readUint8Array(t+s,e-s))}else a=await $r(o,i,e)}else a=O;return r.Pt=Math.max(s,r.Pt),a}}class Gr extends mr{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 i=new WritableStream({async write(e){if(e===pr)return void(s&&await c());const{availableSize:i}=r;if(s)e.length<i?await o(e):(await o(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i)));else{const{value:i,done:o}=await t.next();if(o&&!i)throw Error(or);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await Qr(n),a=i.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 o(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,hr,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(pr)}finally{t.releaseLock()}}}class Xr{constructor(t){return Array.isArray(t)&&(t=new Yr(t)),(t instanceof ReadableStream||typeof t.getReader==U)&&(t={readable:ae(t)}),t}}class Jr{constructor(t){return t.writable===A&&typeof t.next==U&&(t=new Gr(t)),(t instanceof WritableStream||typeof t.getWriter==U)&&(t={writable:se(t)}),t.size===A&&(t.size=0),t}}async function Qr(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}function $r(t,e,r){return t.readUint8Array(e,r)}const tn="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function en(t,e){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let r=0;r<t.length;r++)e+=tn[t[r]];return e}})(t):new TextDecoder(e,{ignoreBOM:!0}).decode(t)}const rn="filename",nn="rawFilename",an="comment",sn="rawComment",on="uncompressedSize",cn="compressedSize",ln="offset",dn="diskNumberStart",un="lastModDate",fn="rawLastModDate",wn="lastAccessDate",hn="rawLastAccessDate",pn="creationDate",mn="rawCreationDate",yn="internalFileAttributes",bn="externalFileAttributes",Sn="msdosAttributesRaw",En="msdosAttributes",gn="msDosCompatible",xn="zip64",zn="encrypted",Rn="version",An="versionMadeBy",Fn="zipCrypto",Dn="directory",Un="executable",On="compressionMethod",Tn="signature",kn="extraField",vn="unixMode",Cn="setuid",Mn="setgid",In="sticky",jn=[rn,nn,on,cn,un,fn,an,sn,wn,hn,pn,mn,ln,dn,yn,bn,Sn,En,gn,xn,zn,Rn,An,Fn,Dn,Un,On,Tn,"crc32",kn,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",vn,Cn,Mn,In,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Pn{constructor(t){jn.forEach(e=>this[e]=t[e])}}const Nn="password",Wn="rawPassword",_n="passThrough",Ln="signal",Bn="checkAmbiguity",Zn="useWebWorkers",Vn="useCompressionStream",Hn="transferStreams",qn="preventClose",Kn="offset",Yn="usdz",Gn="strictness",Xn="strict",Jn="tolerant",Qn="File format is not recognized",$n="End of central directory not found",ta="End of Zip64 central directory locator not found",ea="Central directory header not found",ra="Local file header not found",na="Zip64 extra field not found",aa="File contains encrypted entry",sa="Encryption method not supported",ia="Compression method not supported",oa="Split zip file",ca="Overlapping entry found",la="Ambiguous archive",da="Encrypted central directory is not supported",ua="utf-8",fa="cp437",wa=[[on,t],[cn,t],[ln,t],[dn,e]],ha={[e]:{_t:La,bytes:4},[t]:{_t:Ba,bytes:8}};class pa{constructor(t,e={}){Object.assign(this,{reader:new Xr(t),options:e,config:M(),Lt:new Map})}async*getEntriesGenerator(n={}){const s=this;let{reader:o}=s;const{config:f}=s;if(await Qr(o),o.size!==A&&o.readUint8Array||(o=new zr(await new Response(o.readable).blob()),await Qr(o)),o.size<d)throw Error(Qn);const w=Fa(ja(s,n,Gn),ja(s,n,Bn)),h=w==Xn,p=w!=Jn,m=((t,r)=>t!==A?t:r==Xn?0:r==Jn?1/0:e)(ja(s,n,"maxAppendedDataSize"),w),{Bt:y,Zt:x}=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,65557),s={count:Da};let i,o,c=0;for await(const[r,l,u,f,w]of ka(t,a)){const a=_a(r,f+20);if(w+d+a==n){const a=await Ca(t,r,l,f,w,n,s);if(a==Ta){if(i||(i=va(u,f,w)),c++,!e||c>1)break}else a!=Oa||o||(o=va(u,f,w))}}return i||(i=o),i||(i=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,e==1/0?n:65557+e);let s,i;for await(const[e,o,c,l,d]of ka(t,a)){const a=va(c,l,d);s||(s=a);const u=await Ca(t,e,o,l,d,n,r);if(u==Ta)return a;u!=Oa||i||(i=a)}return i||s})(t,r,s)),{Bt:i,Zt:c}})(o,p,m);if(!y)throw La(ut(await $r(o,0,4)))==a?Error(oa):Error($n);p&&x>1&&Ia("multiple end of central directory records");const z=ut(y);let R=La(z,12),F=La(z,16);const D=y.offset,U=_a(z,20),T=D+d+U;o.size-T>m&&Ia("appended data");let k=_a(z,4);const v=o.Pt||0;let C,M,I,j=_a(z,6),P=_a(z,10),N=0;const W=F==t||R==t||P==e||j==e;if(F!=t&&j!=e&&(F+=Aa(o,j)),W){const r=y.offset<u?O:await $r(o,y.offset-u,u),n=ut(r);if(r.length==u&&La(n,0)==l){F=Aa(o,La(n,4))+Ba(n,8);let r=await $r(o,F,56),a=ut(r);const s=y.offset-u-56;if((56>r.length||La(a,0)!=c)&&F!=s&&s>=0){const t=F;F=s,F>t&&(N=F-t),r=await $r(o,F,56),a=ut(r)}if(56>r.length||La(a,0)!=c)throw Error(ta);M=!0,I=Ba(a,4)>44,k==e?k=La(a,16):h&&k!=La(a,16)&&Ia("mismatched zip64 end of central directory record"),j==e?j=La(a,20):h&&j!=La(a,20)&&Ia("mismatched zip64 end of central directory record"),P==e?P=Ba(a,32):h&&P!=Ba(a,32)&&Ia("mismatched zip64 end of central directory record"),R==t?R=Ba(a,40):h&&R!=Ba(a,40)&&Ia("mismatched zip64 end of central directory record"),F=Aa(o,j)+Ba(a,48)+N}}const _=R,L=y.offset-(M?76:0);if(F<o.size||(N=o.size-F-R-d,F=o.size-R-d),v!=k)throw Error(oa);if(0>F)throw Error(Qn);let B=0,Z=await $r(o,F,R),V=ut(Z);if(R){if(4>Z.length)throw Error(Qn);const t=L-R;if(F!=t&&j==k){let e=!(La(V,B)==i);if(e||0>t||t+4>o.size||(e=La(ut(await $r(o,t,4)),0)==i),e){const e=F;F=t,F>e&&(N+=F-e),Z=await $r(o,F,R),V=ut(Z)}}}const H=L-F;if(R==H||0>H||j!=k||(R=H,Z=await $r(o,F,R),V=ut(Z)),0>F||F>=o.size)throw Error(Qn);C=F;const q=ja(s,n,"filenameEncoding"),K=ja(s,n,"commentEncoding"),Y=h?new Set:A;let G;for(let t=0;P>t;t++){const a=new ya(o,f,s.options);if(B+46>Z.length||La(V,B)!=i){if(0==t&&(I||ba(V)))throw Error(da);throw Error(ea)}Sa(a,V,B+6);const c=!!a.bitFlag.languageEncodingFlag,l=B+46,d=l+a.filenameLength,u=d+a.extraFieldLength,w=_a(V,B+4),p=!(w>>8),m=w>>8==3,y=Z.subarray(l,d),x=_a(V,B+32),z=u+x,R=Z.subarray(u,z),F=c,D=c,U=La(V,B+38),O=U&r,T={readOnly:!!(1&O),hidden:!!(2&O),system:!!(4&O),directory:!!(16&O),archive:!!(32&O)},k=La(V,B+42),v=ja(s,n,"decodeText")||en,M=F?ua:q||fa,j=D?ua:K||fa;let W=v(y,M);W===A&&(W=en(y,M));let _=v(R,j);_===A&&(_=en(R,j)),Object.assign(a,{index:t,versionMadeBy:w,msDosCompatible:p,compressedSize:0,uncompressedSize:0,Vt:x,offset:k,diskNumberStart:_a(V,B+34),internalFileAttributes:_a(V,B+36),externalFileAttributes:U,msdosAttributesRaw:O,msdosAttributes:T,rawFilename:y,filenameUTF8:F,commentUTF8:D,rawExtraField:Z.subarray(d,u),rawComment:R,filename:W,comment:_}),Ea(a,a,V,B+6),a.offset+=N,C=Math.min(Aa(o,a.diskNumberStart)+a.offset,C),h&&(Y.has(a.filename)&&(G=!0),Y.add(a.filename));const L=a.externalFileAttributes>>16&e;a.unixMode===A&&16877&L&&(a.unixMode=L);const H=!!(a.unixMode&S),X=!!(a.unixMode&E),J=!!(512&a.unixMode),Q=a.unixMode!==A?!!(73&a.unixMode):m&&!!(73&L),$=a.unixMode!==A&&(61440&a.unixMode)==b,tt=(61440&L)==b;Object.assign(a,{setuid:H,setgid:X,sticky:J,unixExternalUpper:L,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:Q,directory:$||tt||p&&T.directory||a.filename.endsWith(g)&&!a.uncompressedSize,zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new Pn(a);et.getData=(t,e)=>a.getData(t,et,s.Lt,e),et.arrayBuffer=async t=>{const e=new TransformStream,[r]=await Promise.all([new Response(e.readable).arrayBuffer(),a.getData(e,et,s.Lt,t)]);return r},B=z;const{onprogress:rt}=n;if(rt)try{await rt(t+1,P,new Pn(a))}catch{}yield et}h&&B!=_&&Ia("trailing central directory data"),G&&Ia("duplicate filename"),h&&(N||P&&C>0)&&Ia("prepended data");const X=ja(s,n,"extractPrependedData"),J=ja(s,n,"extractAppendedData");return X&&(s.prependedData=C>0?await $r(o,0,C):O),s.comment=U?await $r(o,D+d,U):O,J&&(s.appendedData=T<o.size?await $r(o,T,o.size-T):O),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){}}class ma{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new pa(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 ya=class{constructor(t,e,r){Object.assign(this,{reader:t,config:e,options:r})}async getData(t,e,a,i={}){const o=this,{reader:c,index:l,offset:d,diskNumberStart:u,extraFieldAES:f,extraFieldZip64:w,compressionMethod:h,config:p,bitFlag:m,rawBitFlag:y,crc32:b,rawLastModDate:S,uncompressedSize:E,compressedSize:g}=o,{dataDescriptor:z}=m,R=e.localDirectory={},F=Aa(c,u)+d,D=await $r(c,F,x),U=ut(D);let T=ja(o,i,Nn),k=ja(o,i,Wn);const v=ja(o,i,_n);if(T=T&&T.length&&T,k=k&&k.length&&k,f&&99!=f.originalCompressionMethod)throw Error(ia);if(D.length<x||La(U,0)!=n)throw Error(ra);Sa(R,U,4);const{extraFieldLength:C,filenameLength:M}=R,I=Fa(ja(o,i,Gn),ja(o,i,Bn))==Xn;let j=O;if(I&&(M||C)){const t=await $r(c,F+x,M+C);j=t.subarray(0,M),R.rawExtraField=t.subarray(M)}else R.rawExtraField=C?await $r(c,F+x+M,C):O;Ea(o,R,U,4,!0),I&&((t,e,r)=>{const{rawFilename:n}=t;(r.length!=n.length||r.some((t,e)=>t!=n[e]))&&Ia("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Ia("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&Ia("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Ia("mismatched local file header (crc32 or sizes)")})(o,R,j);const{lastAccessDate:P,creationDate:N}=R;P&&(e.lastAccessDate=P),N&&(e.creationDate=N);const W=o.encrypted&&R.encrypted&&!v,_=W&&!f;if(v||(e.zipCrypto=_),W&&!(64&~R.rawBitFlag))throw Error(sa);const L=v?A:Y(h);if(0!=h&&8!=h&&9!=h&&!L&&!v)throw Error(ia);if(W){if(!_&&(1>f.strength||f.strength>3))throw Error(sa);if(!T&&!k)throw Error(aa)}const B=F+x+M+C,Z=g,V=ae(c.createReadable({offset:B,size:Z})),H=ja(o,i,Ln),q=ja(o,i,"checkPasswordOnly");let K=ja(o,i,"checkOverlappingEntry");const G=ja(o,i,"checkOverlappingEntryOnly");G&&(K=!0);const{onstart:X,onprogress:J,onend:Q}=i,$=9==h;let tt=ja(o,i,Vn);$&&(tt=!1);const et=ja(o,i,"checkCrc32"),rt=(et===A?ja(o,i,"checkSignature"):et)&&!v&&(!W||_||f&&1==f.vendorVersion),nt={options:{codecType:Ae,password:T,rawPassword:k,zipCrypto:_,encryptionStrength:f&&f.strength,checkCrc32:rt,checkAuthenticationCode:ja(o,i,"checkAuthenticationCode"),passwordVerification:_&&(z?S>>>8&r:b>>>24&r),outputSize:v?g:E,crc32:b,compressed:0!=h&&!v,encrypted:W,useWebWorkers:ja(o,i,Zn),useCompressionStream:tt,transferStreams:ja(o,i,Hn),deflate64:$,format:L?L.format:A,codecURI:L?L.codecURI:A,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:q},config:p,ut:{signal:H,size:Z,onstart:X,onprogress:J,onend:Q}};let at;K&&await(async({reader:t,Ht:e,index:r,offset:n,crc32:a,compressedSize:i,uncompressedSize:o,qt:c,dataDescriptor:l,extraFieldZip64:d,Lt:u})=>{let f=0;if(l&&(f=d?20:12),f){const r=await $r(t,c+i,f+4);if(r.length==f+4&&La(ut(r),0)==s){const t=La(ut(r),4);let n,s;d?(n=Ba(ut(r),8),s=Ba(ut(r),16)):(n=La(ut(r),8),s=La(ut(r),12)),(e.encrypted&&!e.zipCrypto||t==a)&&n==i&&s==o&&(f+=4)}}const w={start:n,end:c+i+f,Ht:e};for(const[t,e]of u)if(t!=r&&w.start<e.end&&e.start<w.end){const t=Error(ca);throw t.Kt=e.Ht,t}u.set(r,w)})({reader:c,Ht:e,index:l,offset:F,crc32:b,compressedSize:g,uncompressedSize:E,qt:B,dataDescriptor:z||R.bitFlag.dataDescriptor,extraFieldZip64:w||R.extraFieldZip64,Lt:a});try{if(!G){q&&(t=new WritableStream),t=new Jr(t),await Qr(t,v?g:E),({writable:at}=t);const{outputSize:e}=await Qe({readable:V,writable:at},nt);if(t.size+=e,e!=(v?g:E))throw Error(ie)}}catch(e){if(e.outputSize!==A&&(t.size+=e.outputSize),!q||e.message!=Et)throw e}finally{ja(o,i,qn)||!at||at.locked||await at.getWriter().close()}return q||G?A:t.getData?t.getData():at}};function ba(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;e>r;r++)if(134630224==La(t,r))return!0;return!1}function Sa(t,e,r){const n=t.rawBitFlag=_a(e,r+2),a=!(1&~n),s=La(e,r+6);Object.assign(t,{encrypted:a,version:_a(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&y)==y},rawLastModDate:s,lastModDate:Pa(s),filenameLength:_a(e,r+22),extraFieldLength:_a(e,r+24)})}function Ea(t,e,r,n,a){const{rawExtraField:s}=e,i=e.extraField=new Map,o=ut(s);let c=0;try{for(;c<s.length;){const t=_a(o,c),e=_a(o,c+2);i.set(t,{type:t,data:s.slice(c+4,c+4+e)}),c+=4+e}}catch{}const l=_a(r,n+4);Object.assign(e,{signature:La(r,n+10),crc32:La(r,n+10),compressedSize:La(r,n+14),uncompressedSize:La(r,n+18)});const d=i.get(1);d&&(((t,e)=>{e.zip64=!0;const r=ut(t.data),n=wa.filter(([t,r])=>e[t]==r),a=n.reduce((t,[,e])=>t+ha[e].bytes,0);if(t.data.length<a)throw Error(na);for(let a=0,s=0;a<n.length;a++){const[i,o]=n[a],c=ha[o];e[i]=t[i]=c._t(r,s),s+=c.bytes}})(d,e),e.extraFieldZip64=d);const u=i.get(28789);u&&(ga(u,rn,nn,e,t),e.extraFieldUnicodePath=u);const y=i.get(25461);y&&(ga(y,an,sn,e,t),e.extraFieldUnicodeComment=y);const b=i.get(f);b&&b.data.length>=7?(((t,e,r)=>{const n=ut(t.data),a=Wa(n,4);Object.assign(t,{vendorVersion:Wa(n,0),vendorId:Wa(n,2),strength:a,originalCompressionMethod:r,compressionMethod:_a(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=A)})(b,e,l),e.extraFieldAES=b):e.compressionMethod=l;const S=i.get(13);S&&(xa(S,e),e.extraFieldPkwareUnix=S);const E=i.get(22613);E&&(xa(E,e),e.extraFieldUnixType1=E);const g=i.get(10);g&&(((t,e)=>{const r=ut(t.data);let n,a=4;try{for(;a<t.data.length&&!n;){const e=_a(r,a),s=_a(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=ut(n),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:i});const o={lastModDate:Na(a),lastAccessDate:Na(s),creationDate:Na(i)};Object.assign(t,o),Object.assign(e,o)}})(g,e),e.extraFieldNTFS=g);const x=i.get(m);if(x)za(x,e,!1),e.extraFieldUnix=x;else{const t=i.get(p);t&&(za(t,e,!0),e.extraFieldInfoZip=t)}const z=i.get(w);z&&(((t,e,r)=>{if(!t.data.length)return;const n=ut(t.data),a=Wa(n,0),s=[],i=[];r?(1&~a||(s.push(un),i.push(fn)),2&~a||(s.push(wn),i.push(hn)),4&~a||(s.push(pn),i.push(mn))):5>t.data.length||(s.push(un),i.push(fn));let o=1;s.forEach((r,a)=>{if(t.data.length>=o+4){const s=La(n,o);e[r]=t[r]=new Date(1e3*(0|s));const c=i[a];t[c]=s}o+=4})})(z,e,a),e.extraFieldExtendedTimestamp=z);const R=i.get(h);R&&(e.extraFieldUSDZ=R)}function ga(t,e,r,n,a){if(5>t.data.length)return void(t.valid=!1);const s=ut(t.data),i=new it;i.append(a[r]);const o=ut(new Uint8Array(4));o.setUint32(0,i.get(),!0);const c=La(s,1);Object.assign(t,{version:Wa(s,0),[e]:en(t.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==La(o,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function xa(t,e){if(8>t.data.length)return;const r=ut(t.data),n={lastAccessDate:new Date(1e3*La(r,0)),lastModDate:new Date(1e3*La(r,4))};12>t.data.length||(n.uid=_a(r,8),n.gid=_a(r,10)),Object.assign(t,n),Object.assign(e,n)}function za(t,e,r){try{const n=ut(t.data);let a,s;if(r){let e=0;const r=Wa(n,e++),i=Wa(n,e++);a=Ra(t.data.subarray(e,e+i)),e+=i;const o=Wa(n,e++);s=Ra(t.data.subarray(e,e+o)),Object.assign(t,{version:r,uid:a,gid:s})}else 4>t.data.length||(a=_a(n,0),s=_a(n,2),Object.assign(t,{uid:a,gid:s}));a!==A&&(e.uid=a),s!==A&&(e.gid=s)}catch{}}function Ra(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Aa(t,e){return t.Wt?t.Wt(e):0}function Fa(t,e){return t===A?e?Xn:"balanced":t}const Da=64,Ua=0,Oa=1,Ta=2;async function*ka(t,e){const r=t.size-e,n=await $r(t,r,e),a=ut(n);for(let t=n.length-d;t>=0;t--)La(a,t)==o&&(yield[a,r,n,t,r+t])}function va(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function Ca(r,n,a,s,o,c,d){const f=_a(n,s+10),w=La(n,s+12),h=La(n,s+16);if(f==e||w==t||h==t)return await Ma(r,n,a,o-u,c,d)==l?Ta:Ua;if(!f&&!w)return Oa;const p=_a(n,s+6);for(const t of[o-w,Aa(r,p)+h])if(await Ma(r,n,a,t,c,d)==i)return Ta;return Ua}async function Ma(t,e,r,n,a,s){return 0>n||n+4>a?A:r>n?s.count>0?(s.count--,La(ut(await $r(t,n,4)),0)):A:La(e,n-r)}function Ia(t){const e=Error(la);throw e.reason=t,e}function ja(t,e,r){return e[r]===A?t.options[r]:e[r]}function Pa(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 Na(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Wa(t,e){return t.getUint8(e)}function _a(t,e){return t.getUint16(e,!0)}function La(t,e){return t.getUint32(e,!0)}function Ba(t,e){return Number(t.getBigUint64(e,!0))}var Za=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:la,ERR_BAD_FORMAT:Qn,ERR_CENTRAL_DIRECTORY_NOT_FOUND:ea,ERR_ENCRYPTED:aa,ERR_ENCRYPTED_CENTRAL_DIRECTORY:da,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:ta,ERR_EOCDR_NOT_FOUND:$n,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:na,ERR_INVALID_AUTHENTICATION_CODE:St,ERR_INVALID_COMPRESSED_DATA:oe,ERR_INVALID_CRC32:ce,ERR_INVALID_PASSWORD:yt,ERR_INVALID_SIGNATURE:bt,ERR_INVALID_UNCOMPRESSED_SIZE:ie,ERR_LOCAL_FILE_HEADER_NOT_FOUND:ra,ERR_OVERLAPPING_ENTRY:ca,ERR_SPLIT_ZIP_FILE:oa,ERR_UNSUPPORTED_COMPRESSION:ia,ERR_UNSUPPORTED_ENCRYPTION:sa,ZipReader:pa,ZipReaderStream:ma});const Va="File already exists",Ha="Zip file comment exceeds 64KB",qa="File entry comment exceeds 64KB",Ka="File entry name exceeds 64KB",Ya="Version exceeds 65535",Ga="The strength must equal 1, 2, or 3",Xa="Encryption is not supported in USDZ files",Ja="Extra field type exceeds 65535",Qa="Extra field data exceeds 64KB",$a=-2147483648,ts=2147483647,es=BigInt(0),rs=BigInt("0x7fffffffffffffff"),ns="Zip64 is not supported (set the 'zip64' option to 'true')",as="Undefined uncompressed size",ss="Undefined reader",is="Zip file not empty",os=new Uint8Array([7,0,2,0,65,69,3,0,0]),cs="infozip",ls="unix";let ds=0;const us=[];class fs{constructor(t,e={}){t=new Jr(t);const{availableSize:r=F,maxSize:n=F}=t;Object.assign(this,{writer:t,Yt:r>0&&r!==F&&n>0&&n!==F,options:e,config:M(),files:new Map,Gt:new Set,offset:e[Kn]===A?t.size||t.writable.size||0:e[Kn],Xt:e[Kn]===A?0:e[Kn]-(t.size||t.writable.size||0),Jt:new Set,Qt:0,$t:A})}async prependZip(e){if(this.Gt.size)throw Error(is);e=new Xr(e),await Qr(e);const{ZipReader:r}=await Promise.resolve().then(()=>Za),n=new r(e.readable),a=await n.getEntries();await n.close(),await Qr(this.writer),await e.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=e.size,this.Gt=new Set(a.map(t=>t.filename)),this.files=new Map(a.map(e=>{const{version:r,rawLastModDate:n,lastAccessDate:a,creationDate:s,rawFilename:i,bitFlag:o,encrypted:c,uncompressedSize:l,compressedSize:d,zip64:u}=e;let{compressionMethod:f,te:w,ee:h,re:p,ne:m,ae:y,rawExtraField:b}=e;const{level:S,languageEncodingFlag:E,dataDescriptor:g}=o;w=w||O,h=h||O,p=p||O,m=m||O,y=y||O,b=b||O,e.extraFieldAES&&(f=99);const x=Ms(w,h,p,m,y,b),z=u&&l>=t,R=u&&d>=t,F=-7&js(S,E,g,c,f)|S<<1,{se:D,ie:U}=Is({version:r,bitFlag:F,compressionMethod:f,uncompressedSize:l,compressedSize:d,rawLastModDate:n,rawFilename:i,oe:R,ce:z,extraFieldLength:x}),{crc32:T}=e;return T!==A&&ks(U,10,T),Object.assign(e,{ce:z,oe:R,le:u&&e.offset>=t,diskNumberStart:0,de:!1,te:w,ee:h,re:p,ne:m,ae:y,rawExtraField:b,extendedTimestamp:p.length>0||m.length>0,ue:1+(a?2:0)+(s?4:0),se:D,ie:U}),[e.filename,e]}))}async add(i="",o,c={}){const l=this;c=Object.assign({},c);const{Jt:d,config:u}=l;let h,y;ds<u.maxWorkers?ds++:await new Promise(t=>us.push(t));try{if(i=i.trim(),Us(l,c,Dn)&&!i.endsWith(g)&&(i+=g),l.Gt.has(i))throw Error(Va);return l.Gt.add(i),y=!0,h=(async(i,o,c,l)=>{const d=((n,a,s)=>{a=a.trim();let i=Us(n,s,gn),o=Us(n,s,An,i?20:768);const c=Us(n,s,Un),l=Us(n,s,"uid"),d=Us(n,s,"gid");let u=Us(n,s,vn),f=Us(n,s,"unixExtraFieldType"),w=Us(n,s,Cn),h=Us(n,s,Mn),p=Us(n,s,In);if(l!==A&&(0>l||l>t))throw Error("Invalid uid (must be integer 0..2^32-1)");if(d!==A&&(0>d||d>t))throw Error("Invalid gid (must be integer 0..2^32-1)");if(u!==A&&(0>u||u>e))throw Error("Invalid UNIX mode (must be integer 0..65535)");if(f!==A&&f!==cs&&f!==ls)throw Error("Invalid unixExtraFieldType (must be 'infozip' or 'unix')");if(f===ls&&(l!==A&&l>e||d!==A&&d>e))throw Error("uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)");f!==A||l===A&&d===A||(f=cs);let m=Us(n,s,Sn),y=Us(n,s,En);const x=m!==A||y!==A;if(l!==A||d!==A||u!==A||f?(i=!1,o=o&e|768):x&&(i=!0,o&=r),m!==A&&(0>m||m>r))throw Error("Invalid msdosAttributesRaw (must be integer 0..255)");if(y&&"object"!=typeof y)throw Error("Invalid msdosAttributes (must be an object with boolean flags)");if(o>e)throw Error(Ya);let z=Us(n,s,bn);const R=z!==A;R||(z=0),!s[Dn]&&a.endsWith(g)&&(s[Dn]=!0);const F=Us(n,s,Dn);let D;if(F?(a.endsWith(g)||(a+=g),R||(z=16,i||(z|=16877<<16))):i||R||(z=c?493<<16:27525120),!i){const t=u!==A||!!(w||h||p);D=z>>16&e,u=u===A?D:u&e,w?u|=S:w=!!(u&S),h?u|=E:h=!!(u&E),p?u|=512:p=!!(512&u),R&&!t||(F&&(u|=b),z=(u&e)<<16|z&e)}return({msdosAttributesRaw:m,msdosAttributes:y}=((t,e)=>{if(t!==A)t&=r;else if(e!==A){const{readOnly:n,hidden:a,system:s,directory:i,archive:o}=e;let c=0;n&&(c|=1),a&&(c|=2),s&&(c|=4),i&&(c|=16),o&&(c|=32),t=c&r}return e===A&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(m,y)),x&&(z=z&t|m&r),{name:a,fe:{versionMadeBy:o,msDosCompatible:i,externalFileAttributes:z,unixExternalUpper:D,uid:l,gid:d,unixMode:u,unixExtraFieldType:f,setuid:w,setgid:h,sticky:p,msdosAttributesRaw:m,msdosAttributes:y}}})(i,o,l);({name:o}=d);const u=((t,r,n)=>{const a=Us(t,n,"encodeText",ct);let s=a(r);if(s===A&&(s=ct(r)),Ms(s)>e)throw Error(Ka);const i=n[an]||"";let o=a(i);if(o===A&&(o=ct(i)),Ms(o)>e)throw Error(qa);const c=Us(t,n,Rn,20);if(c>e)throw Error(Ya);const l=Us(t,n,un,new Date),d=Us(t,n,wn),u=Us(t,n,pn),f=Us(t,n,yn,0),w=Us(t,n,_n);let h,p;w||(h=Us(t,n,Nn),p=Us(t,n,Wn));const m=Us(t,n,"encryptionStrength",3),y=Us(t,n,Fn),b=Us(t,n,"extendedTimestamp",!0),S=Us(t,n,"ntfsTimestamp"),E=Us(t,n,"keepOrder",!0),g=Us(t,n,Zn),x=Us(t,n,Hn),z=Us(t,n,"bufferedWrite"),R=Us(t,n,"createTempStream"),F=Us(t,n,"dataDescriptorSignature",!0),D=Us(t,n,Ln),U=Us(t,n,"useUnicodeFileNames",!0),O=Us(t,n,On),T=w||O===A?A:Y(O);if(!w&&O!==A&&0!==O&&8!==O&&!T)throw Error("Compression method not supported");let k=Us(t,n,"level");if(t.options[Yn]){if(h!==A||p!==A)throw Error(Xa);k===A&&O===A&&(k=0)}let v=Us(t,n,Vn),C=Us(t,n,"dataDescriptor");z&&C===A&&(C=!1),(C===A||y)&&(C=!0),k!==A&&6!=k&&(v=!1);const M=Us(t,n,xn);if(!y&&(h!==A||p!==A)&&(1>m||m>3))throw Error(Ga);const I=ps(n[kn]),j=ps(n.localExtraField);return{comment:i,fe:{rawFilename:s,rawComment:o,version:c,lastModDate:l,lastAccessDate:d,creationDate:u,internalFileAttributes:f,passThrough:w,password:h,rawPassword:p,encryptionStrength:m,zipCrypto:y,extendedTimestamp:b,ntfsTimestamp:S,keepOrder:E,useWebWorkers:g,transferStreams:x,bufferedWrite:z,createTempStream:R,dataDescriptorSignature:F,signal:D,useUnicodeFileNames:U,compressionMethod:O,format:T?T.format:A,codecURI:T?T.codecURI:A,we:T?T.versionNeeded:A,level:k,useCompressionStream:v,dataDescriptor:C,zip64:M,rawExtraField:I,he:j}}})(i,o,l),{comment:h}=u,y=l[kn];let D;i.files.set(o,A);try{const{fe:h}=u;0==h.level||h.compressionMethod!==A||h.passThrough||await(async t=>{const{CompressionStream:e,CompressionStreamZlib:r}=t;if(r&&!r.Dt)return!0;if(ye(e)||me(e,de))return!0;if(r)try{return await Ie(t),!0}catch{return!1}return!1})(i.config)||(h.level=0);const y=await(async(e,r,{fe:n},a)=>{const{passThrough:s,zipCrypto:i,password:o,rawPassword:c,encryptionStrength:l}=n;let{dataDescriptor:d,zip64:u,level:f,compressionMethod:w}=n,h=0,p=0;if(s){if(!r)throw Error(ss);if(p=a[on],p===A)throw Error(as)}const m=!0===u,y=Us(e,a,zn),b=!!r&&(!!(o&&Ms(o)||c&&Ms(c))||s&&y);r||(f=0,w=0);const S=b?i?12:16+4*l:0;r&&(r=new Xr(r),await Qr(r),s?(a.uncompressedSize=p,h=Os(p)+S):r.size===A?(d=!0,(u||u===A)&&(u=!0,p=h=4294967296)):(a.uncompressedSize=p=r.size,h=Os(p)+S));const E=m||p>=t,g=m||h>=t;if(E||g){if(!1===u)throw Error(ns);u=!0}return u=u||!1,{reader:r,fe:{dataDescriptor:d,zip64:u,ce:E,oe:g,uncompressedSize:p,level:f,compressionMethod:w,encrypted:b}}})(i,c,u,l);({reader:c}=y);const b=Es(i.writer),S=Ss(i.writer),E=(t=>{const{rawFilename:r,lastModDate:a,lastAccessDate:s,creationDate:i,level:o,zip64:c,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:u,directory:h,rawExtraField:y,he:b,encryptionStrength:S,extendedTimestamp:E,ntfsTimestamp:g,passThrough:F,encrypted:D,ce:U,oe:T,uncompressedSize:k,crc32:v}=t;let{version:C,compressionMethod:M}=t;const I=!h&&(M===A?o===A||o>0:0!==M);let j;const P=F||!I,N=c&&(t.bufferedWrite||!u||!U&&!T||P),W=N||c&&u&&(U||T);if(c&&(U||T)){const t=20,e=bs(t);if(e.uint16(1),e.uint16(t-4),j=e.array,N&&(e.pe(k),P)){const t=D?l?12:16+4*S:0;e.pe(F?0:k+t)}}else j=O;let _,L,B,Z,V;if(D&&!l){const t=bs(Ms(os)+2);t.uint16(f),t.bytes(os),_=t.array,_[8]=S}else _=O;if(E){const t=As(a),e=Fs(t);if(e){const e=9+(s?4:0)+(i?4:0),r=bs(e);Z=1+(s?2:0)+(i?4:0),r.uint16(w),r.uint16(e-4),r.uint8(Z),r.uint32(t),s&&r.uint32(Ds(As(s))),i&&r.uint32(Ds(As(i))),B=r.array}else B=O;if(g===A?!e||s||i:g)try{const t=Rs(a),e=bs(36);e.uint16(10),e.uint16(32),e.me(4),e.uint16(1),e.uint16(24),e.pe(t),e.pe(s?Rs(s):t),e.pe(i?Rs(i):t),L=e.array}catch{L=O}else L=O}else L=B=O;try{const{uid:r,gid:n,unixExtraFieldType:a}=t;if(a!=cs||r===A&&n===A)if(a!=ls||r===A&&n===A)V=O;else{const t=bs(8);t.uint16(m),t.uint16(4),t.uint16((r===A?0:r)&e),t.uint16((n===A?0:n)&e),V=t.array}else{const t=ys(r),e=ys(n),a=3+t.length+e.length,s=bs(4+a);s.uint16(p),s.uint16(a),s.uint8(1),s.uint8(t.length),s.bytes(t),s.uint8(e.length),s.bytes(e),V=s.array}}catch{V=O}M===A&&(M=I?8:0);const{we:H}=t;I&&H!==A&&(C=C>H?C:H),c&&(C=C>45?C:45),D&&!l&&(C=C>51?C:51,F&&v!==A&&(_[4]=1),_[9]=M,M=99);const q=W?Ms(j):0,K=q+Ms(_,B,L,V,y,b);if(K>e)throw Error(Qa);const Y=new Date(2e3*Math.ceil(Math.floor(a.getTime()/1e3)/2)),{se:G,ie:X,rawLastModDate:J}=Is({version:C,bitFlag:js(o,d,u,D,M),compressionMethod:M,uncompressedSize:k,lastModDate:R>Y?R:Y>z?z:Y,rawFilename:r,oe:T,ce:U,extraFieldLength:K}),Q=bs(x+Ms(r)+K),$=Q.array,tt=ut($);return Q.uint32(n),Q.bytes(G),Q.bytes(r),W&&Q.bytes(j),Q.bytes(_),Q.bytes(B),Q.bytes(L),Q.bytes(V),Q.bytes(y),Q.bytes(b),u&&(T||ks(tt,18,0),U||ks(tt,22,0)),{ye:$,be:tt,se:G,ie:X,lastModDate:a,rawLastModDate:J,encrypted:D,compressed:I,version:C,compressionMethod:M,ue:Z,te:O,Se:q,re:B,ne:L,ae:V,ee:_,extraFieldLength:K}})(l=Object.assign({},l,d.fe,u.fe,y.fe,{internalFileAttribute:u.fe.internalFileAttributes,externalFileAttribute:d.fe.externalFileAttributes,signature:l[Tn],crc32:l.crc32===A?l[Tn]:l.crc32,offset:i.offset-b,diskNumberStart:S})),g=(({zip64:t,dataDescriptor:e,dataDescriptorSignature:r})=>{let n,a=O,i=0,o=t?20:12;return r&&(o+=4),e&&(a=new Uint8Array(o),n=ut(a),r&&(i=4,ks(n,0,s))),{Ee:a,ge:n,xe:i}})(l),U=Ms(E.ye,g.Ee);D=await(async(e,n,s,i,o)=>{const{files:c,writer:l}=e,{keepOrder:d,dataDescriptor:u,signal:f}=o,{ze:w}=i,h=e.options[Yn],p=e.$t;let m,y,b,S,E,g,z,R={},D=0;c.set(n,R),e.$t=R;try{let y;d&&(y=p&&p.lock,R.lock=new Promise(t=>b=t)),o.bufferedWrite||!d||e.Re||e.Qt||!u?(m=!0,e.Qt++,z=o.createTempStream?await o.createTempStream():new TransformStream(A,A,{highWaterMark:F}),z.size=0,await Qr(l)):(z=l,await U()),await Qr(z);const T=Es(l);if(e.Yt){delete e.Yt;const t=new Uint8Array(4);ks(ut(t),0,a),await zs(l,t),e.offset+=4}h&&!m&&ms(i,e.offset-T);const{ye:k}=w;m||(await y,await O());const v=Ss(l),C=xs(e,l);if(R.diskNumberStart=v,m||(E=!0,g=l.size,await zs(z,k)),R=await(async(e,n,{diskNumberStart:a,lock:s},i,o,c)=>{const{ze:l,Ae:d,Fe:u}=i,{se:f,ie:w,lastModDate:h,rawLastModDate:p,encrypted:m,compressed:y,version:b,compressionMethod:S,te:E,Se:g,re:x,ue:z,ne:R,ae:F,ee:D}=l,{Ee:U}=d,{rawFilename:O,lastAccessDate:T,creationDate:k,password:v,rawPassword:C,level:M,zip64:I,ce:j,oe:P,zipCrypto:N,dataDescriptor:W,directory:_,executable:L,versionMadeBy:B,rawComment:Z,rawExtraField:V,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,setuid:st,setgid:it,sticky:ot,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt,useCompressionStream:ut,passThrough:ft,format:wt,codecURI:ht}=c,pt={lock:s,versionMadeBy:B,zip64:I,directory:!!_,executable:!!L,filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:Z,te:E,Se:g,re:x,ne:R,ae:F,ee:D,rawExtraField:V,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,diskNumberStart:a,uid:rt,gid:nt,unixMode:at,setuid:st,setgid:it,sticky:ot,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt};let{crc32:mt,uncompressedSize:yt}=c,bt=0;ft||(yt=0);const{writable:St}=n;if(e){const a=ae(e.createReadable?e.createReadable():e.readable),s=e.size,i={options:{codecType:Re,level:M,rawPassword:C,password:v,encryptionStrength:J,zipCrypto:m&&N,passwordVerification:m&&N&&p>>8&r,computeCrc32:!ft,compressed:y&&!ft,encrypted:m&&!ft,useWebWorkers:H,useCompressionStream:ut,transferStreams:q,format:wt,codecURI:ht,compressionMethod:S},config:o,ut:{signal:X,size:s,onstart:K,onprogress:Y,onend:G}};try{const e=await Qe({readable:a,writable:St},i);if(bt=e.outputSize,n.size+=bt,ft||(yt=e.inputSize,m&&!N||(mt=e.crc32)),!P&&bt>=t||!j&&yt>=t)throw Error(ns)}catch(t){throw t.outputSize!==A&&(n.size+=t.outputSize),t}}return(({crc32:t,compressedSize:e,uncompressedSize:r,ze:n,Ae:a},{zip64:s,zipCrypto:i,passThrough:o,dataDescriptor:c})=>{const{ie:l,encrypted:d}=n,{ge:u,xe:f}=a;d&&!i&&!o||t===A||(ks(l,10,t),c&&ks(u,f,t)),s?c&&(vs(u,f+4,BigInt(e)),vs(u,f+12,BigInt(r))):(ks(l,14,e),ks(l,18,r),c&&(ks(u,f+4,e),ks(u,f+8,r)))})({crc32:mt,compressedSize:bt,uncompressedSize:yt,ze:l,Ae:d},c),W&&await zs(n,U),Object.assign(pt,{uncompressedSize:yt,compressedSize:bt,lastModDate:h,rawLastModDate:p,creationDate:k,lastAccessDate:T,encrypted:m,zipCrypto:N,size:u+bt,compressionMethod:S,version:b,se:f,ie:w,signature:mt,crc32:!m||N||ft?mt:A,ue:z,ce:j,oe:P}),pt})(s,z,R,i,e.config,o),m||(E=!1),c.set(n,R),R.filename=n,m){if(await Promise.all([z.writable.getWriter().close(),y]),await U(),S=!0,g=l.size,await O(),R.diskNumberStart=Ss(l),R.offset=xs(e,l),h){const t=i.Fe;ms(i,e.offset-Es(l)),R.size+=i.Fe-t}(({rawFilename:t,encrypted:e,zip64:r,Se:n,crc32:a,compressedSize:s,uncompressedSize:i,ce:o,oe:c},l,{dataDescriptor:d,passThrough:u})=>{if(d||((!e||u&&a!==A)&&ks(l,14,a),c||ks(l,18,s),o||ks(l,22,i)),r&&n){const e=x+Ms(t)+4;vs(l,e,BigInt(i)),vs(l,e+8,BigInt(s))}})(R,w.be,o),await zs(l,w.ye),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=Ms(t),D+=e}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{n.releaseLock()}})(z.readable,l,f),l.size+=z.size,S=!1}else R.diskNumberStart=v,R.offset=C;return e.offset+=R.size,R}catch(t){if(S||E){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=l.size-g,m&&(e.offset+=D)}throw c.delete(n),t}finally{if(m&&e.Qt--,b&&b(),y&&y(),m&&z&&z.dispose)try{await z.dispose()}catch{}}async function U(){e.Re=!0;const{De:t}=e;e.De=new Promise(t=>y=()=>{e.Re=!1,t()}),await t}async function O(){gs(l,Ms(w.ye))&&await l.closeDisk()}})(i,o,c,{ze:E,Ae:g,Fe:U},l)}catch(t){throw i.files.delete(o),t}return Object.assign(D,{name:o,comment:h,extraField:y}),new Pn(D)})(l,i,o,c),d.add(h),await h}catch(t){throw y&&l.Gt.delete(i),t}finally{d.delete(h);const t=us.shift();t?t():ds--}}remove(t){const{Gt:e,files:r}=this;if("string"==typeof t&&(t=r.get(t)),t&&t.filename!==A){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=O,n={}){const{Jt:a,writer:s}=this,{writable:u}=s;if(Ms(r)>e)throw Error(Ha);for(;a.size;)await Promise.allSettled(Array.from(a));return await(async(r,n,a)=>{const s=(r=>{let n=0;for(const[,a]of r){const{rawFilename:r,ee:s,rawComment:i,ne:o,ae:c,rawExtraField:l,extendedTimestamp:d,ue:u,lastModDate:f,ce:h,oe:p,uncompressedSize:m,compressedSize:y}=a,b=a.offset>=t,S=a.diskNumberStart>=e;let E,g;if(b||S||h||p){const t=4+(h?8:0)+(p?8:0)+(b?8:0)+(S?4:0),e=bs(t);e.uint16(1),e.uint16(t-4),h&&e.pe(m),p&&e.pe(y),b&&e.pe(a.offset),S&&e.uint32(a.diskNumberStart),E=e.array}else E=O;a.te=E,a.le=b,a.de=S;const x=As(f);if(d&&Fs(x)){const t=bs(9);t.uint16(w),t.uint16(5),t.uint8(u),t.uint32(x),g=t.array}else g=O;a.re=g;const z=Ms(E,s,o,c,g,l);if(z>e)throw Error(Qa);n+=46+Ms(r,i)+z}return n})(r.files),u=await(async(r,n,a)=>{const{files:s,writer:o}=r,c=new Uint8Array(n);await Qr(o);let l=0,d=0,u=Ss(o),f=Es(o);for(const[r,n]of Array.from(s.values()).entries()){const{offset:w,rawFilename:h,te:p,ee:m,re:y,ne:b,ae:S,rawExtraField:E,rawComment:g,versionMadeBy:x,se:z,ie:R,ce:A,oe:F,de:D,le:U,internalFileAttributes:O,externalFileAttributes:T,diskNumberStart:k,uncompressedSize:v,compressedSize:C}=n,M=Ms(p,m,y,b,S,E),I=46+Ms(h,g)+M;gs(o,l+I-d)&&(await zs(o,c.slice(d,l)),d=l,await o.closeDisk()),0==r&&(u=Ss(o),f=Es(o)),A||ks(R,18,v),F||ks(R,14,C),(U||D)&&45>n.version&&Ts(R,0,45);const j=bs(I);if(j.uint32(i),j.uint16(x),j.bytes(z.subarray(0,24)),j.uint16(M),j.uint16(Ms(g)),j.uint16(D?e:k),j.uint16(O),j.uint32(T),j.uint32(U?t:w),j.bytes(h),j.bytes(p),j.bytes(m),j.bytes(y),j.bytes(b),j.bytes(S),j.bytes(E),j.bytes(g),Cs(c,j.array,l),l+=I,a.onprogress)try{await a.onprogress(r+1,s.size,new Pn(n))}catch{}}return await zs(o,d?c.slice(d):c),{diskNumber:u,diskOffset:f}})(r,s,a);await(async(r,n,a,s)=>{const{writer:i}=r,{Ue:u}=s;let{Oe:f}=s,w=r.files.size,h=u.diskNumber,p=xs(r,u),m=Ss(i);gs(i,d)&&m++;let y=Us(r,a,xn);if(!(t>p&&t>f&&e>w&&e>m)){if(!1===y)throw Error(ns);y=!0}const b=Ms(n);if(b>e)throw Error(Ha);const S=bs(y?98:d);gs(i,Ms(S.array)+b)&&await i.closeDisk(),m=Ss(i),y&&(S.uint32(c),S.pe(44),S.uint16(45),S.uint16(45),S.uint32(m),S.uint32(h),S.pe(w),S.pe(w),S.pe(f),S.pe(p),S.uint32(l),S.uint32(m),S.pe(BigInt(xs(r,i))+BigInt(f)),S.uint32(m+1),Us(r,a,"supportZip64SplitFile",!0)&&(m=e,h=e),w=e,p=t,f=t),S.uint32(o),S.uint16(m),S.uint16(h),S.uint16(w),S.uint16(w),S.uint32(f),S.uint32(p),S.uint16(b),await zs(i,S.array),b&&await zs(i,n)})(r,n,a,{Ue:u,Oe:s})})(this,r,n),Us(this,n,qn)||await u.getWriter().close(),s.getData?s.getData():u}}class ws{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new fs(r,t),this.Jt=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 hs(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 hs(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){return await Promise.all(Array.from(this.Jt)),this.zipWriter.close(t,e)}}function hs(t,e,r){t.Jt.add(e),e.catch(t=>{try{r(t)}catch{}})}function ps(t){if(!t)return O;let r=0,n=0;t.forEach(t=>r+=4+Ms(t));const a=new Uint8Array(r),s=ut(a);return t.forEach((t,r)=>{if(r>e)throw Error(Ja);if(Ms(t)>e)throw Error(Qa);Ts(s,n,r),Ts(s,n+2,Ms(t)),Cs(a,t,n+4),n+=4+Ms(t)}),a}function ms(t,e){const{ze:r}=t;let{ye:n,extraFieldLength:a}=r,s=64-(e+Ms(n))%64;4>s&&(s+=64);const i=new Uint8Array(s),o=ut(i);Ts(o,0,h),Ts(o,2,s-4);const c=n;r.ye=n=new Uint8Array(Ms(c)+s),Cs(n,c),Cs(n,i,Ms(c));const l=ut(n);Ts(l,28,a+s),r.be=l,t.Fe+=s}function ys(t){if(t===A)return O;{const e=new Uint8Array(4);ut(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}}function bs(t){const e=new Uint8Array(t),r=ut(e);let n=0;return{array:e,uint8:t=>{((t,e,r)=>{t.setUint8(e,r)})(r,n,t),n+=1},uint16:t=>{Ts(r,n,t),n+=2},uint32:t=>{ks(r,n,t),n+=4},pe:t=>{vs(r,n,BigInt(t)),n+=8},bytes:t=>{Cs(e,t,n),n+=Ms(t)},me:t=>n+=t}}function Ss(t){const{diskNumber:e=0}=t;return e}function Es(t){const{diskOffset:e=0}=t;return e}function gs(t,e){const{availableSize:r=F}=t;return e>r}function xs(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.Xt:0)}async function zs(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=Ms(e),await n.write(e)}finally{n.releaseLock()}}function Rs(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return es>e?es:e>rs?rs:e}}function As(t){return Math.floor(t.getTime()/1e3)}function Fs(t){return t>=$a&&ts>=t}function Ds(t){return Math.min(ts,Math.max($a,t))}function Us(t,e,r,n){const a=e[r]===A?t.options[r]:e[r];return a===A?n:a}function Os(t){return t+5*(Math.floor(t/16383)+1)}function Ts(t,e,r){t.setUint16(e,r,!0)}function ks(t,e,r){t.setUint32(e,r,!0)}function vs(t,e,r){t.setBigUint64(e,r,!0)}function Cs(t,e,r){t.set(e,r)}function Ms(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Is({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:a,compressedSize:s,lastModDate:i,rawLastModDate:o,rawFilename:c,oe:l,ce:d,extraFieldLength:u}){const f=bs(26),w=f.array,h=ut(w);if(f.uint16(e),f.uint16(r),f.uint16(n),o===A){const t=new Uint32Array(1),e=ut(t);Ts(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Ts(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),o=t[0]}return f.uint32(o),f.me(4),l||s!==A?f.uint32(l?t:s):f.me(4),d||a!==A?f.uint32(d?t:a):f.me(4),f.uint16(Ms(c)),f.uint16(u),{se:w,ie:h,rawLastModDate:o}}function js(t,e,r,n,a){let s=0;return e&&(s|=y),r&&(s|=8),8!=a&&9!=a||(0>t||t>3||(s|=6),t>3&&5>=t&&(s|=4),9==t&&(s|=2)),n&&(s|=1),s}function Ps(){return"application/octet-stream"}const Ns=1048576,Ws=".zip.js-temp";function _s(t={}){const{thresholdBytes:e=Ns,directoryName:r=Ws,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,i,o=0,c=!1;const l=new WritableStream({async write(i){c?await a.write(i):(t.push(i),o+=i.length,o>e&&await(async()=>{const e=await s();r=crypto.randomUUID(),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 d=0;return{writable:l,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 d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){i&&await i.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 Ls=1048576;function Bs(t={}){const{thresholdBytes:e=Ls}=t;return()=>{const t=[];let r,n,a,s=0,i=!1;const o=new WritableStream({async write(a){i?await r.write(a):(t.push(a),s+=a.length,s>e&&await(async()=>{const e=new TransformStream;n=new Response(e.readable).blob(),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:o,readable:new ReadableStream({async pull(e){if(i){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 Zs=1048576,Vs=".zip.js-temp";function Hs(t={}){const{thresholdBytes:e=Zs,directoryName:r=Vs,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw Error("createSyncAccessHandle is only available in dedicated workers");const a=n||(()=>navigator.storage.getDirectory());let s;function i(){return s||(s=Promise.resolve(a()).then(t=>t.getDirectoryHandle(r,{create:!0}))),s}return()=>{const t=[];let r,n,a=0,s=!1,o=0,c=0;const l=new WritableStream({async write(c){s?(n.write(c,{at:o}),o+=c.length):(t.push(c),a+=c.length,a>e&&await(async()=>{const e=await i();r=crypto.randomUUID();const a=await e.getFileHandle(r,{create:!0});n=await a.createSyncAccessHandle(),s=!0;for(const e of t)n.write(e,{at:o}),o+=e.length;t.length=0})())},close(){n&&n.flush()}});let d=0;return{writable:l,readable:new ReadableStream({pull(e){if(s){const t=o-c;if(0>=t)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 d<t.length?e.enqueue(t[d++]):e.close()}},{highWaterMark:0}),dispose:async()=>{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{P({baseURI:import.meta.url})}catch{}let qs,Ks,Ys,Gs,Xs;function Js(t,e,r={}){if(!qs){const t=Error("WASM module not loaded");throw t.cause=Xs,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.Te=Ks(a),this.in=Ks(s),this.inBufferSize=s,!this.Te||!this.in)throw Error("allocation failed");if(this.ke=new Uint8Array(a),t?(this.ve=qs.deflate_process,this.Ce=qs.deflate_last_consumed,this.Me=qs.deflate_end,this.Ie=qs.deflate_new(),r="gzip"===e?qs.deflate_init_gzip(this.Ie,n):"deflate-raw"===e?qs.deflate_init_raw(this.Ie,n):qs.deflate_init(this.Ie,n)):"deflate64-raw"===e?(this.ve=qs.inflate9_process,this.Ce=qs.inflate9_last_consumed,this.Me=qs.inflate9_end,this.Ie=qs.inflate9_new(),r=qs.inflate9_init_raw(this.Ie)):(this.ve=qs.inflate_process,this.Ce=qs.inflate_last_consumed,this.Me=qs.inflate_end,this.Ie=qs.inflate_new(),r="deflate-raw"===e?qs.inflate_init_raw(this.Ie):"gzip"===e?qs.inflate_init_gzip(this.Ie):qs.inflate_init(this.Ie)),0!==r)throw Error("init failed:"+r)}catch(t){throw i(this),t}},transform(e,r){try{const n=e,s=new Uint8Array(Gs.buffer),i=this.ve,o=this.Ce,c=this.Te,l=this.ke;let d=0;for(;d<n.length;){const e=Math.min(n.length-d,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&Ys&&(Ys(this.in),this.in=0),this.in=Ks(e),this.inBufferSize=e,!this.in))throw Error("allocation failed");s.set(n.subarray(d,d+e),this.in);const u=i(this.Ie,this.in,e,c,a,0),f=16777215&u;if(f&&(l.set(s.subarray(c,c+f),0),r.enqueue(l.slice(0,f))),!t){const t=u>>24&255,e=128&t?t-256:t;if(0>e)throw Error("process error:"+e)}const w=o(this.Ie);if(0===w)break;d+=w}}catch(t){i(this),r.error(t)}},flush(e){try{const r=new Uint8Array(Gs.buffer),n=this.ve,s=this.Te,i=this.ke;for(;;){const o=n(this.Ie,0,0,s,a,4),c=16777215&o,l=o>>24&255;if(!t){const t=128&l?l-256:l;if(0>t)throw Error("process error:"+t)}if(c&&(i.set(r.subarray(s,s+c),0),e.enqueue(i.slice(0,c))),1===l||0===c)break}}catch(t){e.error(t)}finally{const t=i(this);0!==t&&e.error(Error("end error:"+t))}},cancel(){i(this)}});function i(t){let e=0;return t.Ie&&t.Me&&(e=t.Me(t.Ie)),t.Ie=0,t.in&&Ys&&Ys(t.in),t.in=0,t.Te&&Ys&&Ys(t.Te),t.Te=0,e}}class Qs{constructor(t="deflate",e){return Js(!0,t,e)}}class $s{constructor(t="deflate",e){return Js(!1,t,e)}}Qs.Dt=!0,$s.Dt=!0;let ti,ei=!1;function ri(){ti=null,(async()=>{await Promise.allSettled(Ke.map(t=>(nr(t),t.terminate()))),Te=A})(),ei=!1,qs=Ks=Ys=Gs=Xs=null}(({je:t})=>{Ie=t})({je:t=>{if(!ti){let{wasmURI:e}=t;typeof e==U&&(e=e()),ti=(async(t,{baseURI:e})=>{if(!ei)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;n>t;++t)a[t]=r.charCodeAt(t);return a.buffer})(t)}(t=>{if(qs=t,({malloc:Ks,free:Ys,memory:Gs}=qs),"function"!=typeof Ks||"function"!=typeof Ys||!Gs)throw qs=Ks=Ys=Gs=null,Error("Invalid WASM module")})((await WebAssembly.instantiate(r)).instance.exports)})(t,e),ei=!0}catch(t){throw(t=>{Xs=t})(t),t}})(e,t).catch(t=>{throw ti=null,t})}return ti}}),P({CompressionStreamZlib:Qs,DecompressionStreamZlib:$s}),P({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",ai=new Set([1,f,10,w,28789,25461,h,p,m,22613,13]);class si{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,id:t.Pe++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,passThrough:r.passThrough}),!n&&t.root||(t.entries[a.id]=a),n&&a.parent.children.push(a)}moveTo(t){this.fs.move(this,t)}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}}class ii extends si{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 ii(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data)return r.data;{const n=r.reader=fi(r.Reader,r.data,e),a=r.data?r.data.uncompressedSize:n.size;await Promise.all([Qr(n),Qr(t,a)]);const{readable:s}=n;return r.uncompressedSize=n.size,await s.pipeTo(t.writable),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==yt)return!1;throw t}}getText(t,e){return this.getData(new Fr(t),e)}getBlob(t,e){return this.getData(new Rr(t),e)}getData64URI(t,e){return this.getData(new Er(t),e)}getUint8Array(t){return this.getData(new Kr,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return dt(await this.getUint8Array(t)).buffer}replaceBlob(t){Object.assign(this,{data:t,Reader:zr,Writer:Rr,reader:null})}replaceText(t){Object.assign(this,{data:t,Reader:Ar,Writer:Fr,reader:null})}replaceData64URI(t){Object.assign(this,{data:t,Reader:Sr,Writer:Er,reader:null})}replaceUint8Array(t){Object.assign(this,{data:t,Reader:qr,Writer:Kr,reader:null})}replaceReadable(t){Object.assign(this,{data:null,Reader:di(t),Writer:null,reader:null})}}class oi extends si{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new oi(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 bi(this,t,{options:e},!0)}addText(t,e,r={}){return bi(this,t,{data:e,Reader:Ar,Writer:Fr,options:r,uncompressedSize:e.length})}addBlob(t,e,r={}){return bi(this,t,{data:e,Reader:zr,Writer:Rr,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 bi(this,t,{data:e,Reader:Sr,Writer:Er,options:r,uncompressedSize:Math.floor(.75*(n-a))})}addUint8Array(t,e,r={}){return bi(this,t,{data:e,Reader:qr,Writer:Kr,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return bi(this,t,{data:e,Reader:class extends Vr{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return bi(this,t,{Reader:di(e),options:r})}addFileSystemEntry(t,e={}){return pi(this,t,e)}addFileSystemHandle(t,e={}){return pi(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),bi(this,t.name,{data:t,Reader:()=>({readable:t.stream(),size:t.size}),options:e,uncompressedSize:t.size})}Ne(t,e){return bi(this,t,e)}importBlob(t,e){return this.importZip(new zr(t),e)}importData64URI(t,e){return this.importZip(new Sr(t),e)}importUint8Array(t,e){return this.importZip(new qr(t),e)}importHttpContent(t,e){return this.importZip(new Vr(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new Rr(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new Er(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Kr,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return(async(t,e,r)=>{const n=li([t],"uncompressedSize"),a=new Map;return await s(t,e),e;async function s(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>i(t,e)))).find(t=>"rejected"==t.status);if(r)throw r.reason}else for(const r of t.children)await i(r,e)}async function i(t,e){try{if(t.directory){const r=await e.getDirectoryHandle(t.name,{create:!0});await s(t,r)}else{const s=await e.getFileHandle(t.name,{create:!0}),i=await s.createWritable();await t.getData({writable:i},Object.assign({},r,{onprogress:async e=>{if(r.onprogress){a.set(t.id,e);try{await r.onprogress(Array.from(a.values()).reduce((t,e)=>t+e,0),n)}catch{}}}}))}}catch(e){throw Error(e.message+(t?" ("+t.name+")":""),{cause:e})}}})(this,t,e)}async importZip(t,e={}){await Qr(t);const r=new pa(t,e),n=[],a=await r.getEntries();for(const t of a){let r=this;try{const a=t.filename.split("/"),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 oi(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 oi(this.fs,s,{data:null},r),n.push(e);e==this||e.data||(e.data=t)}else n.push(bi(r,s,{data:t,Reader:ui(Object.assign({},e)),uncompressedSize: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===A&&(e.bufferedWrite=!0);const[n]=await Promise.all([wi(r,e.readerOptions),Qr(t)]),a=new fs(t,e);return await(async(t,e,r,n,a)=>{const s=e,i=new Map;await async function t(e,o){async function c(o){const c=n.relativePath?o.getRelativeName(s):o.getFullname(),l=o.options||{};let d={};if(o.data instanceof Pn){const{externalFileAttributes:t,versionMadeBy:e,comment:r,lastModDate:a,creationDate:s,lastAccessDate:i,uncompressedSize:c,encrypted:l,zipCrypto:u,crc32:f,compressionMethod:w,extraFieldAES:h,internalFileAttributes:p,extraField:m,uid:y,gid:b}=o.data;d={externalFileAttributes:t,versionMadeBy:e,comment:r,lastModDate:a,creationDate:s,lastAccessDate:i,internalFileAttributes:p};const S=(t=>{if(t){const e=new Map;if(t.forEach((t,r)=>{ai.has(r)||e.set(r,t.data)}),e.size)return e}})(m);if(S&&(d.extraField=S),y===A&&b===A||Object.assign(d,{uid:y,gid:b,unixExtraFieldType:n.unixExtraFieldType||"infozip"}),o.passThrough){let t,e;0===w&&(t=0),h&&(e=h.strength),d=Object.assign(d,{passThrough:!0,encrypted:l,zipCrypto:u,crc32:f,uncompressedSize:c,level:t,encryptionStrength:e,compressionMethod:w})}}await e.add(c,a.get(o),Object.assign({},n,d,l,{directory:o.directory,onprogress:async t=>{if(n.onprogress){i.set(c,t);try{await n.onprogress(Array.from(i.values()).reduce((t,e)=>t+e),r)}catch{}}}})),await t(e,o)}await(async()=>{if(n.bufferedWrite){const t=(await Promise.allSettled(o.children.map(c))).find(t=>"rejected"==t.status);if(t)throw t.reason}else for(const t of o.children)await c(t)})()}(t,e)})(a,r,li([r],"uncompressedSize"),e,n),await a.close(),t.getData?t.getData():t.writable}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}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)}}const ci={FS:class{constructor(){yi(this)}get children(){return this.root.children}remove(t){hi(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=A}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 hi(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)}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)}Ne(t,e){return this.root.Ne(t,e)}importBlob(t,e){return yi(this),this.root.importBlob(t,e)}importData64URI(t,e){return yi(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return yi(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return yi(this),this.root.importHttpContent(t,e)}importReadable(t,e){return yi(this),this.root.importReadable(t,e)}importZip(t,e){return yi(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)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}},ZipDirectoryEntry:oi,ZipFileEntry:ii};function li(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=t[e]||0;for(const e of t.children)n.push(e)}return r}function di(t){let e;return()=>{if(e)throw Error("Readable stream already consumed");return e=!0,{readable:t}}}function ui(t){return class extends yr{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this;e.size=e.entry.uncompressedSize;const r=await e.entry.getData(new Rr,Object.assign({},t,e.options));e.data=r,e.We=new zr(r),super.init()}readUint8Array(t,e){return this.We.readUint8Array(t,e)}}}function fi(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function wi(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=fi(t.Reader,t.data,e);a.set(t,r);try{await Qr(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==A&&(t.uncompressedSize=r.size)})),a}function hi(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function pi(t,e,r){return async function t(e,n,a){if(n)try{if((n.isFile||n.isDirectory)&&(n=await mi(n)),"file"==n.kind){const t=await n.getFile();a.push(e.Ne(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 r=e.addDirectory(n.name);a.push(r);for await(const e of n.values())await t(r,e,a)}}catch(t){const e=t.message+(n?" ("+n.name+")":"");throw Error(e,{cause:t})}return a}(t,e,[])}async function mi(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 mi(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 yi(t){t.entries=[],t.Pe=0,t.root=new oi(t)}function bi(t,e,r,n){if(t.directory)return n?new oi(t.fs,e,r,t):new ii(t.fs,e,r,t);throw Error("Parent entry is not a directory")}export{zr as BlobReader,Rr as BlobWriter,Sr as Data64URIReader,Er as Data64URIWriter,la as ERR_AMBIGUOUS_ARCHIVE,Qn as ERR_BAD_FORMAT,ea as ERR_CENTRAL_DIRECTORY_NOT_FOUND,Va as ERR_DUPLICATED_NAME,aa as ERR_ENCRYPTED,da as ERR_ENCRYPTED_CENTRAL_DIRECTORY,ta as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,$n as ERR_EOCDR_NOT_FOUND,na as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,sr as ERR_HTTP_RANGE,ir as ERR_HTTP_RESOURCE_CHANGED,St as ERR_INVALID_AUTHENTICATION_CODE,W as ERR_INVALID_CODEC_DEFINITION,L as ERR_INVALID_CODEC_MODULE,Ha as ERR_INVALID_COMMENT,oe as ERR_INVALID_COMPRESSED_DATA,ce as ERR_INVALID_CRC32,Ga as ERR_INVALID_ENCRYPTION_STRENGTH,qa as ERR_INVALID_ENTRY_COMMENT,Ka as ERR_INVALID_ENTRY_NAME,Qa as ERR_INVALID_EXTRAFIELD_DATA,Ja as ERR_INVALID_EXTRAFIELD_TYPE,yt as ERR_INVALID_PASSWORD,bt as ERR_INVALID_SIGNATURE,ie as ERR_INVALID_UNCOMPRESSED_SIZE,Ya as ERR_INVALID_VERSION,or as ERR_ITERATOR_COMPLETED_TOO_SOON,ra as ERR_LOCAL_FILE_HEADER_NOT_FOUND,ca as ERR_OVERLAPPING_ENTRY,_ as ERR_RESERVED_COMPRESSION_METHOD,oa as ERR_SPLIT_ZIP_FILE,ss as ERR_UNDEFINED_READER,as as ERR_UNDEFINED_UNCOMPRESSED_SIZE,ia as ERR_UNSUPPORTED_COMPRESSION,sa as ERR_UNSUPPORTED_ENCRYPTION,Xa as ERR_UNSUPPORTED_ENCRYPTION_USDZ,ns as ERR_UNSUPPORTED_FORMAT,cr as ERR_WRITER_NOT_INITIALIZED,is as ERR_ZIP_NOT_EMPTY,Hr as HttpRangeReader,Vr as HttpReader,yr as Reader,Yr as SplitDataReader,Gr as SplitDataWriter,Ar as TextReader,Fr as TextWriter,qr as Uint8ArrayReader,Kr as Uint8ArrayWriter,br as Writer,pa as ZipReader,ma as ZipReaderStream,fs as ZipWriter,ws as ZipWriterStream,j as configure,Bs as createBlobTempStream,_s as createOPFSTempStream,Hs as createSyncAccessHandleTempStream,ci as fs,Ps as getMimeType,q as registerCodec,N as resetConfiguration,ri as terminateWorkers,K as unregisterCodec};
|
|
1
|
+
const t=4294967295,e=65535,r=255,n=67324752,a=134695760,s=a,i=84233040,o=33639248,c=101010256,l=101075792,d=117853008,u=22,f=20,w=56,h=39169,p=21589,m=6534,y=30837,b=30805,S=2048,E=16384,g=2048,x=1024,R="/",z=30,A=new Date(2107,11,31,23,59,58),F=new Date(1980,0,1),D=void 0,U=1/0,O="undefined",T="function",k=new Uint8Array;let C=2;try{typeof navigator!=O&&navigator.hardwareConcurrency&&(C=navigator.hardwareConcurrency)}catch{}const v={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:C,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=O&&CompressionStream,DecompressionStream:typeof DecompressionStream!=O&&DecompressionStream},M=["baseURI","wasmURI","workerURI","createWorker","chunkSize","maxWorkers","terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout","useCompressionStream","useWebWorkers","transferStreams","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],I={...v};function j(){return I}function N(t){return Math.max(t.chunkSize,64)}function P(t){t=W(t);for(const e of M){const r=t[e];r!==D&&(I[e]=r)}}function W(t){const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===D&&r===D)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===D&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===D&&(n.DecompressionStreamFallback=r),n}function _(t){t=W(t);for(const e of M){const r=t[e];r!==D&&(v[e]=r)}P(t)}function L(){for(const t of M)delete I[t];Object.assign(I,v)}const B="Invalid codec definition",V="Reserved compression method",Z="Invalid codec module",H="string",q=[0,8,9,99],K=new Map,Y=new Map;function G(t={}){const{compressionMethod:r,format:n,codecURI:a,CompressionStream:s,DecompressionStream:i,versionNeeded:o}=t;if(!Number.isInteger(r)||0>r||r>e||typeof n!=H||!n.length)throw Error(B);if(q.includes(r))throw Error(V);const c=typeof s==T||typeof i==T;if(!(c||typeof a==H&&a.length))throw Error(B);K.set(r,{compressionMethod:r,format:n,codecURI:a,versionNeeded:o}),c&&$(n,{CompressionStream:s,DecompressionStream:i})}function X(t){const e=K.get(t);if(e){let r;K.delete(t),K.forEach(t=>r=r||t.format==e.format),r||Y.delete(e.format)}}function J(t){return K.get(t)}function Q(t){return Y.get(t)}function $(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=T&&typeof n!=T)throw Error(Z);Y.set(t,{CompressionStream:r,DecompressionStream:n})}const tt=[[],[],[],[],[],[],[],[]];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?e>>>1^3988292384:e>>>1;tt[0][t]=e}for(let t=0;256>t;t++)for(let e=1;8>e;e++){const r=tt[e-1][t];tt[e][t]=r>>>8^tt[0][255&r]}const[et,rt,nt,at,st,it,ot,ct]=tt;class lt{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(;s>=n;n+=8){const t=e^a.getInt32(n,!0),r=a.getInt32(n+4,!0);e=ct[255&t]^ot[t>>>8&255]^it[t>>>16&255]^st[t>>>24&255]^at[255&r]^nt[r>>>8&255]^rt[r>>>16&255]^et[r>>>24&255]}}for(;r>n;n++)e=e>>>8^et[255&(e^t[n])];this.o=e}get(){return~this.o}}class dt extends TransformStream{constructor(){let t;const e=new lt;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 ut(t){if(typeof TextEncoder==O){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)}function ft(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function wt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function ht(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const pt={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=pt.l(r);return 32===n?t.concat(e):pt.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)+pt.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]=pt.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=pt.l(a);return n.push(pt.S(e+s&31,e+s>32?r:n.pop(),1)),n}},mt={bytes:{R(t){const e=pt.bitLength(t)/8,r=new Uint8Array(e);let n;for(let a=0;e>a;a++)3&a||(n=t[a/4]),r[a]=n>>>24,n<<=8;return r},A(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(pt.S(8*(3&r),n)),e}}},yt=class{constructor(t){const e=this;e.blockSize=512,e.F=[1732584193,4023233417,2562383102,271733878,3285377520],e.D=[1518500249,1859775393,2400959708,3395469782],t?(e.U=t.U.slice(0),e.O=t.O.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.U=t.F.slice(0),t.O=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=mt.C.A(t));const r=e.O=pt.concat(e.O,t),n=e.T,a=e.T=n+pt.bitLength(t);if(a>9007199254740991)throw Error("Cannot hash more than 2^53 - 1 bits");const s=new Uint32Array(r);let i=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);a>=t;t+=e.blockSize)e.v(s.subarray(16*i,16*(i+1))),i+=1;return r.splice(0,16*i),e}M(){const t=this;let e=t.O;const r=t.U;e=pt.concat(e,[pt.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.v(e.splice(0,16));return t.reset(),r}I(t,e,r,n){return t>19?t>39?t>59?t>79?void 0:e^r^n:e&r|e&n|r&n:e^r^n:e&r|~e&n}j(t,e){return e<<t|e>>>32-t}v(t){const e=this,r=e.U,n=Array(80);for(let e=0;16>e;e++)n[e]=t[e];let a=r[0],s=r[1],i=r[2],o=r[3],c=r[4];for(let t=0;79>=t;t++){16>t||(n[t]=e.j(1,n[t-3]^n[t-8]^n[t-14]^n[t-16]));const r=e.j(5,a)+e.I(t,s,i,o)+c+n[t]+e.D[Math.floor(t/20)]|0;c=o,o=i,i=e.j(30,s),s=a,a=r}r[0]=r[0]+a|0,r[1]=r[1]+s|0,r[2]=r[2]+i|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0}},bt={importKey:t=>new bt.N(mt.bytes.A(t)),P(t,e,r,n){if(r=r||1e4,0>n||0>r)throw Error("invalid params to pbkdf2");const a=1+(n>>5)<<2;let s,i,o,c,l;const d=new ArrayBuffer(a),u=new DataView(d);let f=0;const w=pt;for(e=mt.bytes.A(e),l=1;(a||1)>f;l++){for(s=i=t.encrypt(w.concat(e,[l])),o=1;r>o;o++)for(i=t.encrypt(i),c=0;c<i.length;c++)s[c]^=i[c];for(o=0;(a||1)>f&&o<s.length;o++)u.setInt32(f,s[o]),f+=4}return d.slice(0,n/8)},N:class{constructor(t){const e=this,r=e.W=yt,n=[[],[]];e._=[new r,new r];const a=e._[0].blockSize/32;t.length>a&&(t=(new r).update(t).M());for(let e=0;a>e;e++)n[0][e]=909522486^t[e],n[1][e]=1549556828^t[e];e._[0].update(n[0]),e._[1].update(n[1]),e.L=new r(e._[0])}reset(){const t=this;t.L=new t.W(t._[0]),t.B=!1}update(t){this.B=!0,this.L.update(t)}digest(){const t=this,e=t.L.M(),r=new t.W(t._[1]).update(e).M();return t.reset(),r}encrypt(t){if(this.B)throw Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},St=typeof crypto!=O&&typeof crypto.getRandomValues==T,Et="Invalid password",gt="Invalid signature",xt=gt,Rt="zipjs-abort-check-password",zt="Crypto API not supported";function At(t){if(St)return crypto.getRandomValues(t);throw Error(zt)}const Ft=16,Dt={name:"PBKDF2"},Ut=Object.assign({hash:{name:"HMAC"}},Dt),Ot=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Dt),Tt=["deriveBits"],kt=[8,12,16],Ct=[16,24,32],vt=10,Mt=[0,0,0,0],It=typeof crypto!=O,jt=It&&crypto.subtle,Nt=It&&typeof jt!=O,Pt=mt.bytes,Wt=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,i,o,c=1;if(4!==a&&6!==a&&8!==a)throw Error("invalid aes key size");for(e.D=[i=t.slice(0),o=[]],s=a;4*a+28>s;s++){let t=i[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))),i[s]=i[s-a]^t}for(let t=0;s;t++,s--){const e=i[3&t?s:s-4];o[t]=4>=s||4>t?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 i,o,c,l;for(let t=0;256>t;t++)s[(a[t]=t<<1^283*(t>>7))^t]=t;for(let d=i=0;!r[d];d^=o||1,i=s[i]||1){let s=i^i<<1^i<<2^i<<3^i<<4;s=s>>8^255&s^99,r[d]=s,n[s]=d,l=a[c=a[o=a[d]]];let u=16843009*l^65537*c^257*o^16843008*d,f=257*a[s]^16843008*s;for(let r=0;4>r;r++)t[r][d]=f=f<<24^f>>>8,e[r][s]=u=u<<24^u>>>8}for(let r=0;5>r;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],i=s[0],o=s[1],c=s[2],l=s[3],d=s[4];let u,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;n>t;t++)u=i[h>>>24]^o[p>>16&255]^c[m>>8&255]^l[255&y]^r[b],f=i[p>>>24]^o[m>>16&255]^c[y>>8&255]^l[255&h]^r[b+1],w=i[m>>>24]^o[y>>16&255]^c[h>>8&255]^l[255&p]^r[b+2],y=i[y>>>24]^o[h>>16&255]^c[p>>8&255]^l[255&m]^r[b+3],b+=4,h=u,p=f,m=w;for(let t=0;4>t;t++)a[e?3&-t:t]=d[h>>>24]<<24^d[p>>16&255]<<16^d[m>>8&255]<<8^d[255&y]^r[b++],u=h,h=p,p=m,m=y,y=u;return a}},_t=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=pt.bitLength(e);for(let a=0;n>a;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 pt.m(e,a)}},Lt=bt.N;let Bt=It&&Nt&&typeof jt.importKey==T,Vt=It&&Nt&&typeof jt.deriveBits==T;class Zt extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:a=!0}){super({start(){qt(this,t,e,r)},async transform(t,e){const r=this,{password:a,strength:s,et:i,ready:o}=r;a?(await(async(t,e,r,n)=>{const a=await Yt(t,e,r,Xt(n,0,kt[e])),s=Xt(n,kt[e]);if(a[0]!=s[0]||a[1]!=s[1])throw Error(Et)})(r,s,a,Xt(t,0,kt[s]+2)),t=Xt(t,kt[s]+2),n?e.error(Error(Rt)):i()):await o;const c=new Uint8Array(t.length-vt-(t.length-vt)%Ft);e.enqueue(Kt(r,t,c,0,vt,!0))},async flush(t){const{nt:e,st:r,pending:n,ready:s}=this;if(r&&e){await s;const i=Xt(n,0,n.length-vt),o=Xt(n,n.length-vt);let c=k;if(i.length){const t=Qt(Pt,i);r.update(t);const n=e.update(t);c=Jt(Pt,n)}const l=Xt(Jt(Pt,r.digest()),0,vt);let d=n.length<vt?1:0;for(let t=0;vt>t;t++)d|=l[t]^o[t];if(d&&a)throw Error(xt);t.enqueue(c)}}})}}class Ht extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){qt(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:a,et:s,ready:i}=r;let o=k;n?(o=await(async(t,e,r)=>{const n=At(new Uint8Array(kt[e]));return ft(n,await Yt(t,e,r,n))})(r,a,n),s()):await i;const c=new Uint8Array(o.length+t.length-t.length%Ft);c.set(o,0),e.enqueue(Kt(r,t,c,o.length,0))},async flush(t){const{nt:e,st:r,pending:n,ready:a}=this;if(r&&e){await a;let s=k;if(n.length){const t=e.update(Qt(Pt,n));r.update(t),s=Jt(Pt,t)}const i=Jt(Pt,r.digest()).slice(0,vt);t.enqueue(ft(s,i))}}})}}function qt(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.et=e),password:Gt(e,r),strength:n-1,pending:k})}function Kt(t,e,r,n,a,s){const{nt:i,st:o,pending:c}=t;c.length&&(e=ft(c,e));const l=e.length-a;let d;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%Ft)),d=0;l-Ft>=d;d+=Ft){const t=Qt(Pt,Xt(e,d,d+Ft));s&&o.update(t);const a=i.update(t);s||o.update(a),r.set(Jt(Pt,a),d+n)}return t.pending=Xt(e,d),r}async function Yt(t,e,r,n){t.password=null;const a=await(async(t,e,r,n,a)=>{if(!Bt)return bt.importKey(e);try{return await jt.importKey("raw",e,r,!1,a)}catch{return Bt=!1,bt.importKey(e)}})(0,r,Ut,0,Tt),s=await(async(t,e,r)=>{if(!Vt)return bt.P(e,t.salt,Ot.iterations,r);try{return await jt.deriveBits(t,e,r)}catch{return Vt=!1,bt.P(e,t.salt,Ot.iterations,r)}})(Object.assign({salt:n},Ot),a,8*(2*Ct[e]+2)),i=new Uint8Array(s),o=Qt(Pt,Xt(i,0,Ct[e])),c=Qt(Pt,Xt(i,Ct[e],2*Ct[e])),l=Xt(i,2*Ct[e]);return Object.assign(t,{keys:{key:o,it:c,passwordVerification:l},nt:new _t(new Wt(o),Array.from(Mt)),st:new Lt(c)}),l}function Gt(t,e){return e===D?ut(t):e}function Xt(t,e,r){return t.subarray(e,r)}function Jt(t,e){return t.R(e)}function Qt(t,e){return t.A(e)}class $t extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){ee(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=re(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw Error(Et);t=t.subarray(12)}n?e.error(Error(Rt)):e.enqueue(re(r,t))}})}}class te extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){ee(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=At(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(ne(r,e),0),a=12}else n=new Uint8Array(t.length),a=0;n.set(ne(r,t),a),e.enqueue(n)}})}}function ee(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,ot:new lt(n[0]),ct:new lt(n[2])}),r)for(let e=0;e<r.length;e++)ae(t,r[e]);else for(let r=0;r<e.length;r++)ae(t,e.charCodeAt(r))})(t,e,r)}function re(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=se(t)^e[n],ae(t,r[n]);return r}function ne(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=se(t)^e[n],ae(t,e[n]);return r}function ae(t,e){let[,r]=t.keys;t.ot.append([e]);const n=~t.ot.get();r=oe(Math.imul(oe(r+ie(n)),134775813)+1),t.ct.append([r>>>24]);const a=~t.ct.get();t.keys=[n,r,a]}function se(t){const e=2|t.keys[2];return ie(Math.imul(e,1^e)>>>8)}function ie(t){return 255&t}function oe(t){return 4294967295&t}function ce(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 le(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 de="Invalid uncompressed size",ue="Invalid compressed data",fe=gt,we="deflate-raw",he="gzip",pe=[31,139,8];class me extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:a,encrypted:s,useCompressionStream:i,zipCrypto:o,computeCrc32:c,level:l,deflate64:d,format:u,compressionMethod:f}=t,w=this;let h,p,m,y=super.readable;const b=u&&Q(u),S=c&&a&&!d&&!b&&(!s||o)&&!(!i||!n);if(s&&!o||!c||S||(h=new dt,y=Ae(y,h)),a)if(b)y=Fe(y,Re(b.CompressionStream,u,{level:l,chunkSize:e,compressionMethod:f}));else if(S)m=new ye,y=Fe(y,new n(he)),y=Ae(y,m);else try{y=ze(y,i,{level:l,chunkSize:e},n,r)}catch(t){let e;try{e=new n(he)}catch{throw t}y=Fe(y,e),y=Ae(y,new ye)}s&&(o?y=Ae(y,new te(t)):(p=new Ht(t),y=Ae(y,p))),xe(w,y,()=>{s&&!o||!c||(w.crc32=S?m.crc32:new DataView(h.value.buffer).getUint32(0))})}}class ye 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(8>=a)return void(r=ft(r,t));const s=a-8,i=Math.min(s,r.length);n.enqueue(ft(r.subarray(0,i),t.subarray(0,s-i))),r=ft(r.subarray(i),t.subarray(s-i))},flush(){const e=ht(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class be extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:a,encrypted:s,checkCrc32:i,crc32:o,compressed:c,useCompressionStream:l,deflate64:d,format:u,compressionMethod:f,rawBitFlag:w,outputSize:h}=t;let p,m,y=super.readable;if(s&&(a?y=Ae(y,new $t(t)):(m=new Zt(t),y=Ae(y,m))),c){const t=u&&Q(u);if(t)y=Fe(y,Re(t.DecompressionStream,u,{chunkSize:e,compressionMethod:f,rawBitFlag:w,uncompressedSize:h}));else try{y=ze(y,l,{chunkSize:e,deflate64:d},n,r)}catch(t){if(d||h===D)throw t;let e;try{e=new n(he)}catch{throw t}y=((t,e,r)=>{const n=new lt;let a,s,i,o=0,c=!1;const l=new Promise((t,e)=>{s=t,i=e});l.catch(()=>{}),r||s();const d=new TransformStream({start(t){const e=new Uint8Array(10);e.set(pe),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=ht(e);a.setUint32(0,n.get(),!0),a.setUint32(4,r,!0),t.enqueue(e)},cancel(t){i(t)}}),u=new TransformStream({transform(t,e){n.append(t),o+=t.length,r>o?c&&f():s(),e.enqueue(t)},cancel(t){i(t)}});return t=Ae(t,d),Ae(t=Fe(t,e),u);function f(){w(),a=setTimeout(()=>i(Error(de)),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(ue);throw e.cause=t,e}const{value:n,done:a}=r;a?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})})(y)}i&&(p=new dt,y=Ae(y,p)),xe(this,y,()=>{if(i){const t=new DataView(p.value.buffer);if(o!=t.getUint32(0,!1))throw Error(fe)}})}}const Se=new Map;function Ee(t,e){if(!t)return!1;let r=Se.get(t);r||(r=new Map,Se.set(t,r));let n=r.get(e);if(n===D){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function ge(t){return Ee(t,we)}function xe(t,e,r){e=Ae(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function Re(t,e,r){if(!t)throw Error("Compression method not supported");return new t(e,r)}function ze(t,e,r,n,a){const s=e&&n?n:a||n,i=r.deflate64?"deflate64-raw":we;let o;try{o=new s(i,r)}catch(t){if(!e||!a||s==a)throw t;o=new a(i,r)}return Fe(t,o)}function Ae(t,e){return ce(t).pipeThrough(e)}function Fe(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 De="data",Ue="deflate",Oe="inflate";class Te extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let a;n.startsWith(Ue)?a=me:n.startsWith(Oe)&&(a=be),r.outputSize=0;let s=0;const i=new a(t,e),o=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!==D&&r.outputSize>t.outputSize))throw Error(de)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:s})}});Object.defineProperty(r,"readable",{get:()=>o.pipeThrough(c).pipeThrough(i).pipeThrough(l)})}}class ke extends TransformStream{constructor(t){const e=[];let r=0;function n(){const n=new Uint8Array(t);let a=0;for(;t>a;){const r=e[0],s=t-a;r.length>s?(n.set(r.subarray(0,s),a),e[0]=r.subarray(s),a+=s):(n.set(r,a),a+=r.length,e.shift())}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 Ce={type:"module"},ve="error",Me="Worker startup timeout";let Ie,je,Ne,Pe,We,_e=!0;try{_e=typeof structuredClone==T&&structuredClone(new DOMException("","AbortError")).code!==D}catch{}let Le=()=>{};class Be{constructor(t,{readable:e,writable:r},{options:n,config:a,lt:s,useWebWorkers:i,transferStreams:o,workerURI:c,createWorker:l},d){const{signal:u}=s;return We&&(l=D),Object.assign(t,{ut:!0,ft:(t.ft||0)+1,readable:e.pipeThrough(new ke(N(a))).pipeThrough(new Ve(s),{signal:u}),writable:r,options:Object.assign({},n),workerURI:c,createWorker:l,transferStreams:o,terminate:()=>new Promise(e=>{const{wt:r,ut:n}=t;r?(n?t.ht=e:(r.terminate(),e()),t.yt=null):e()}),bt(){if(t.ut){const{ht:e}=t;e&&(t.ht=null,t.St=!0,t.wt.terminate(),e()),t.ut=!1,d(t)}}}),Ie===D&&(Ie=typeof Worker!=O),(i&&(Ie&&c||l)?qe:He)(t,a)}}class Ve extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let a=0;super({async start(){t&&await Ze(t,r)},async transform(t,n){a+=t.length,e&&await Ze(e,a,r),n.enqueue(t)},async flush(){n&&await Ze(n,a)}})}}async function Ze(t,...e){try{await t(...e)}catch{}}function He(t,e){return{run:()=>Ke(t,e)}}function qe(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:a}=e;let{wasmURI:s}=e;if(!t.yt){let i;typeof s==T&&(s=s());try{i=Ge(t.workerURI,r,t)}catch{return t.createWorker?We=!0:Ie=!1,He(t,e)}Object.assign(t,{wt:i,Et:!1,St:!1,yt:{run:async()=>{try{return await(async(t,e)=>{let r,n;const a=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,gt:r,xt:n,result:a});const{readable:s,options:i}=t,{writable:o,closed:c,Rt: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,Rt:()=>e.abort()}})(t.writable);let d;try{d=Qe({type:"start",options:i,config:e,readable:s,writable:o},t)}catch(e){l();try{await c}catch{}throw t.bt(),e}d||Object.assign(t,{reader:s.getReader(),writer:o.getWriter()});const{workerStartupTimeout:u}=e;t.Et||!Number.isFinite(u)||0>u||(t.zt=setTimeout(()=>(t=>{if(t.zt=null,t.Et)return;const{xt:e,writer:r}=t;if(Ye(t),t.wt=null,e){const t=Error(Me);t.At=!0,e(t),r&&r.releaseLock()}})(t),u));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(!d&&!o.locked)try{await o.getWriter().close()}catch{}}})(t,{chunkSize:n,wasmURI:s,baseURI:r,workerStartupTimeout:a})}catch(r){if(r&&r.At){t.createWorker?We=!0:Ie=!1;const{reader:r}=t;return r&&r.releaseLock(),t.reader=null,t.writer=null,Ke(t,e)}throw r}}}})}return t.yt}async function Ke({options:t,readable:e,writable:r,bt:n},a){let s;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(Ue),r=e?a.CompressionStreamFallback:a.DecompressionStreamFallback,n=e?a.CompressionStream:a.DecompressionStream;if(t.useCompressionStream){if(r&&r.Ft&&!ge(n))try{await Le(a)}catch{}}else try{await Le(a)}catch{r&&!r.Ft||(t.useCompressionStream=!0)}}s=new Te(t,a),await e.pipeThrough(s).pipeThrough(new ke(N(a))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{crc32:n,inputSize:i,outputSize:o}=s;return{crc32:n,inputSize:i,outputSize:o}}catch(t){throw s&&(t.outputSize=s.outputSize),t}finally{n()}}function Ye(t){const{wt:e}=t;if(e)try{e.terminate()}catch{}t.yt=null}function Ge(t,e,r,n,a=!0){const{createWorker:s}=r;let i,o,c;if(s)i=s();else if(Ne===D||je!==t){const s=typeof t==T;o=s?t(a):t;const l=o.startsWith("data:"),d=o.startsWith("blob:");if(l||d){n===D&&(n=!1),n&&(c=Ce);try{i=new Worker(o,c)}catch(a){if(d)try{URL.revokeObjectURL(o)}catch{}if(s&&d)return Ge(t,e,r,n,!1);if(n)throw a;return Ge(t,e,r,!0,!1)}}else{n===D&&(n=!0),n&&(c=Ce);try{o=new URL(o,e)}catch{}try{i=new Worker(o,c)}catch(s){if(n)throw s;return Ge(t,e,r,!1,a)}}je=t,Ne=o,Pe=c}else i=new Worker(Ne,Pe);return i.addEventListener("message",t=>{r.Et=!0,Xe(r),(async({data:t},e)=>{const{type:r,value:n,messageId:a,result:s,error:i}=t,{reader:o,writer:c,gt:l,xt:d,bt:u,ft:f}=e,w=()=>e.ft!=f;try{if(i){const{message:t,stack:e,code:r,name:n,outputSize:a,cause:s}=i,o=Error(t);Object.assign(o,{stack:e,code:r,name:n,outputSize:a}),s&&(o.cause=Object.assign(Error(s.message),{name:s.name})),h(o)}else{if("pull"==r){const{value:t,done:r}=await o.read();w()||Qe({type:De,value:t,done:r,messageId:a},e)}r==De&&(await c.ready,await c.write(new Uint8Array(n)),w()||Qe({type:"ack",messageId:a},e)),"close"==r&&h(null,s)}}catch(i){w()||(Ye(e),h(i))}function h(t,e){w()||(t?d(t):l(e),c&&c.releaseLock(),u())}})(t,r)}),i.addEventListener(ve,t=>Je(t,r)),i.addEventListener("messageerror",t=>Je(t,r)),i}function Xe(t){const{zt:e}=t;e&&(clearTimeout(e),t.zt=null)}function Je(t,e){t.preventDefault&&t.preventDefault(),Xe(e);const{Et:r,xt:n,writer:a,bt:s}=e;if(Ye(e),r||(e.wt=null),n){let e=t.error||Error(t.message||ve);r||(e=Object.assign(Error(e.message||ve),{At:!0})),n(e),a&&a.releaseLock(),r&&s()}}function Qe(t,{wt:e,writer:r,transferStreams:n,Et:a}){try{const{value:r,readable:s,writable:i}=t,o=[];if(r&&(t.value=wt(r),o.push(t.value.buffer)),n&&_e&&a?(s&&o.push(s),i&&o.push(i)):t.readable=t.writable=null,o.length)try{return e.postMessage(t,o),!0}catch{_e=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}let $e=[];const tr=[];let er,rr,nr=0;async function ar(t,e){const{options:r,config:n}=e,{transferStreams:a,useWebWorkers:s,useCompressionStream:i,compressed:o,checkCrc32:c,computeCrc32:l,encrypted:d,format:u,codecURI:f}=r,{workerURI:w,createWorker:h,maxWorkers:p}=n;u&&(f&&(r.codecURI=((t,e)=>{try{return new URL(t,e).toString()}catch{return t}})(f,n.baseURI)),await(async(t,e)=>{!Y.has(t)&&e&&$(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(u,r.codecURI)),e.transferStreams=a||a===D&&n.transferStreams;const m=!(o||c||l||d),y=u===D||!!r.codecURI;return e.useWebWorkers=!m&&y&&(s||s===D&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:D,e.createWorker=e.useWebWorkers&&h?h:D,r.useCompressionStream=i||i===D&&n.useCompressionStream,(await(async()=>{const r=$e.find(t=>!t.ut);if(r)return lr(r),new Be(r,t,e,b);if($e.length<p){const r={Dt:nr};return nr++,$e.push(r),new Be(r,t,e,b)}return new Promise(r=>{tr.push({resolve:r,stream:t,Ut:e}),rr=n.workerStarvationTimeout,sr()})})()).run();function b(t){if(ir(),tr.length){const[{resolve:e,stream:r,Ut:n}]=tr.splice(0,1);e(new Be(t,r,n,b)),sr()}else t.wt?(lr(t),((t,e)=>{const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.St?t.St=!1:t.Ot=setTimeout(async()=>{$e=$e.filter(e=>e!=t);try{await t.terminate()}catch{}},n))})(t,e)):$e=$e.filter(e=>e!=t)}}function sr(){!er&&tr.length&&Number.isFinite(rr)&&rr>=0&&(er=setTimeout(or,rr))}function ir(){er&&(clearTimeout(er),er=null)}function or(){if(er=null,tr.length){const[{resolve:t,stream:e,Ut:r}]=tr.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:D,createWorker:D});t(new Be({},e,n,cr)),sr()}}function cr(){ir(),sr()}function lr(t){const{Ot:e}=t;e&&(clearTimeout(e),t.Ot=null)}const dr="HTTP error ",ur="HTTP Range not supported",fr="HTTP resource changed",wr="Writer iterator completed too soon",hr="Writer not initialized",pr="Content-Range",mr="Range",yr="GET",br="bytes",Sr=16777216,Er="writable",gr=Symbol();class xr{constructor(){this.size=0}init(){this.initialized=!0}}class Rr extends xr{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=N(j())}={}){const n=this;let a=0;return new ReadableStream({async pull(s){const i=e===D?r:Math.min(r,e-a),o=await sn(n,t+a,i);s.enqueue(o),a+r>e||e===D&&!o.length&&i?s.close():a+=r}})}}class zr extends xr{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw Error(hr);return t.writeUint8Array(wt(e))}});Object.defineProperty(t,Er,{get:()=>e})}writeUint8Array(){}}class Ar extends Rr{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{dataURI:t,Tt:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{Tt:r,dataURI:n}=this,a=new Uint8Array(e),s=4*Math.floor(t/3),i=atob(n.substring(s+r,4*Math.ceil((t+e)/3)+r)),o=t-3*Math.floor(s/4);let c=0;for(let t=o;o+e>t&&t<i.length;t++)a[t-o]=i.charCodeAt(t),c++;return c<a.length?a.subarray(0,c):a}}class Fr extends zr{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){const e=this;let r,n=e.pending;const a=e.pending.length;for(e.pending="",r=0;r<3*Math.floor((a+t.length)/3)-a;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.pending+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.pending=n+e.pending}getData(){return this.data+btoa(this.pending)}}let Dr,Ur;class Or extends Rr{constructor(t){super(),Object.assign(this,{blob:t,size:t.size}),Ur||(Ur=(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();Dr=1==e}catch{Dr=!1}})())}createReadable(t){const{blob:e,size:r}=this,{offset:n=0,size:a=r-n}=t||{};return n||r>a?Dr?ce(e.slice(n,n+a).stream()):super.createReadable(t):ce(e.stream())}async readUint8Array(t,e){const r=this,n=t+e,a=t||n<r.size?r.blob.slice(t,n):r.blob;let s=await a.arrayBuffer();return s.byteLength>e&&(s=s.slice(t,n)),new Uint8Array(s)}}class Tr extends xr{constructor(t){super();const e=this,r=new TransformStream;if(Object.defineProperty(e,Er,{get:()=>r.writable}),typeof Blob.prototype.stream!=T||new Blob([]).stream()instanceof ReadableStream){const n=[];t&&n.push(["Content-Type",t]),e.blob=new Response(r.readable,{headers:n}).blob()}else{const n=[];e.blob=r.readable.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,{type:t}))}e.blob.catch(()=>{})}getData(){return this.blob}}class kr extends Or{constructor(t){super(new Blob([t],{type:"text/plain"}))}}class Cr extends Tr{constructor(t){super(t),Object.assign(this,{encoding:t,kt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,kt:e}=this,r=await super.getData();if(r.text&&e)return r.text();{const e=new FileReader;return new Promise((n,a)=>{Object.assign(e,{onload:({target:t})=>n(t.result),onerror:()=>a(e.error)}),e.readAsText(r,t)})}}}class vr extends Rr{constructor(t,e){super(),Ir(this,t,e)}async init(){await jr(this,Yr,Zr),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:a}=e;if((r||n)&&a!==D){const{offset:r=0,size:n=a-r}=t||{};if(n>0&&a>r)return((t,e,r)=>{let n,a=e,s=0,i=r;return new ReadableStream({start:()=>o(),async pull(t){n||await o();const{value:e,done:r}=await n.read();if(r)throw Error(ur);const a=e.length>s?e.subarray(0,s):e;s-=a.length,i-=a.length,a.length&&t.enqueue(a),s||(await(async()=>{const t=n;n=D,await t.cancel()})(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function o(){const e=Math.min(t.maximumRangeSize,i),r=await Yr(yr,t,Br(t,a,e));if(206!=r.status)throw Error(ur);const o=r.headers.get(pr);if(o){const t=Number(o.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=a)throw Error(ur)}Lr(t,r),_r(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 Nr(this,t,e,Yr,Zr)}}class Mr extends Rr{constructor(t,e){super(),Ir(this,t,e)}async init(){await jr(this,Gr,Hr),super.init()}readUint8Array(t,e){return Nr(this,t,e,Gr,Hr)}}function Ir(t,e,r){const{preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:i,checkResourceChanges:o=!0,maximumRangeSize:c=Sr,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:i,checkResourceChanges:o,maximumRangeSize:c,fetch:l})}async function jr(t,e,r){const{url:n,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:i,combineSizeEocd:o}=t;if((t=>{const{baseURI:e}=j(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r})(n)&&(s||i)&&(void 0===a||a)){const n=await e(yr,t,Br(t,o?-22:void 0)),a=n.headers.get("Accept-Ranges");if(!(i||a&&a.toLowerCase()==br))throw Error(ur);{if(o){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==u&&(t.Ct=e)}_r(t,n);const a=Pr(n);a===D?await Kr(t,e,r):t.size=a}}else await Kr(t,e,r)}async function Nr(t,e,r,n,a){const{useRangeHeader:s,forceRangeRequests:i,Ct:o,size:c,options:l}=t;if(s||i){if(o&&e==c-u&&r==u)return o;if(c>e&&0!==r){e+r>c&&(r=c-e);const a=await n(yr,t,Br(t,e,r));if(206!=a.status)throw Error(ur);const s=a.headers.get(pr);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw Error(ur)}Lr(t,a),_r(t,a);const i=new Uint8Array(await a.arrayBuffer());if(i.length!=r)throw Error(ur);return i}return k}{const{data:n}=t;return n||await a(t,l),t.data.subarray(e,e+r)}}function Pr(t){const e=t.headers.get(pr);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Wr({headers:t}){return{vt:t.get("Etag")||D,lastModified:t.get("Last-Modified")||D}}function _r(t,e){const{checkResourceChanges:r,Mt:n}=t;r&&!n&&206==e.status&&(t.Mt=Wr(e))}function Lr(t,e){const{checkResourceChanges:r,Mt:n,size:a}=t;if(r){const t=Pr(e);if(t!==D&&a!==D&&t!=a)throw Error(fr);if(n){const t=Wr(e);if(Object.entries(n).some(([e,r])=>r!==D&&t[e]!==D&&r!=t[e]))throw Error(fr)}}}function Br(t,e=0,r=1){return Object.assign({},Vr(t),{[mr]:br+"="+(0>e?e:e+"-"+(e+r-1))})}function Vr({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function Zr(t){await qr(t,Yr)}async function Hr(t){await qr(t,Gr)}async function qr(t,e){const r=await e(yr,t,Vr(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Kr(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Vr(t)),a=n.headers.get("Content-Length");a&&!n.headers.get("Content-Encoding")?t.size=Number(a):await r(t,t.options)}}async function Yr(t,{fetch:e=fetch,options:r,url:n},a){const s=await e(n,Object.assign({},r,{method:t,headers:a}));if(400>s.status)return s;throw 416==s.status?Error(ur):Error(dr+(s.statusText||s.status))}function Gr(t,{url:e},r){return new Promise((n,a)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(400>s.status){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(ur):Error(dr+(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 Xr extends Rr{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Mr(t,e):new vr(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 Jr extends Xr{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Qr extends Rr{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{array:t,size:t.length})}readUint8Array(t,e){return this.array.slice(t,t+e)}}class $r extends zr{constructor(t){super(),this.defaultBufferSize=t||262144}init(t=0){Object.assign(this,{offset:0,array:new Uint8Array(t>0?t:this.defaultBufferSize)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.array.length){let t=e.array.length?2*e.array.length:e.defaultBufferSize;for(;r>t;)t*=2;const n=e.array;e.array=new Uint8Array(t),e.array.set(n)}e.array.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.array.length?this.array:this.array.slice(0,this.offset)}}class tn extends Rr{constructor(t){super(),this.It=t}async init(){const t=this,{It:e}=t;t.jt=0,await Promise.all(e.map(t=>an(t))),t.Nt=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}Pt(t){const{Nt:e,size:r}=this,n=e[t];return n===D?r:n}async readUint8Array(t,e){const r=this,{It:n}=this;let a,s=0,i=t;for(;n[s]&&i>=n[s].size;)i-=n[s].size,s++;const o=n[s];if(o){const n=o.size;if(i+e>n){const s=n-i;a=ft(await sn(o,i,s),await r.readUint8Array(t+s,e-s))}else a=await sn(o,i,e)}else a=k;return r.jt=Math.max(s,r.jt),a}}class en extends xr{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 i=new WritableStream({async write(e){if(e===gr)return void(s&&await c());const{availableSize:i}=r;if(s)e.length<i?await o(e):(await o(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i)));else{const{value:i,done:o}=await t.next();if(o&&!i)throw Error(wr);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await an(n),a=i.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 o(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,Er,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(gr)}finally{t.releaseLock()}}}class rn{constructor(t){return Array.isArray(t)&&(t=new tn(t)),(t instanceof ReadableStream||typeof t.getReader==T)&&(t={readable:ce(t)}),t}}class nn{constructor(t){return t.writable===D&&typeof t.next==T&&(t=new en(t)),(t instanceof WritableStream||typeof t.getWriter==T)&&(t={writable:le(t)}),t.size===D&&(t.size=0),t}}async function an(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}function sn(t,e,r){return t.readUint8Array(e,r)}const on="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function cn(t,e){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let r=0;r<t.length;r++)e+=on[t[r]];return e}})(t):new TextDecoder(e,{ignoreBOM:!0}).decode(t)}const ln="filename",dn="rawFilename",un="comment",fn="rawComment",wn="uncompressedSize",hn="compressedSize",pn="offset",mn="diskNumberStart",yn="lastModDate",bn="rawLastModDate",Sn="lastAccessDate",En="rawLastAccessDate",gn="creationDate",xn="rawCreationDate",Rn="internalFileAttributes",zn="externalFileAttributes",An="msdosAttributesRaw",Fn="msdosAttributes",Dn="msDosCompatible",Un="zip64",On="encrypted",Tn="version",kn="versionMadeBy",Cn="zipCrypto",vn="directory",Mn="executable",In="compressionMethod",jn="signature",Nn="extraField",Pn="unixMode",Wn="setuid",_n="setgid",Ln="sticky",Bn=[ln,dn,wn,hn,yn,bn,un,fn,Sn,En,gn,xn,pn,mn,Rn,zn,An,Fn,Dn,Un,On,Tn,kn,Cn,vn,Mn,In,jn,"crc32",Nn,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Pn,Wn,_n,Ln,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Vn{constructor(t){Bn.forEach(e=>this[e]=t[e])}}const Zn="password",Hn="rawPassword",qn="passThrough",Kn="signal",Yn="checkAmbiguity",Gn="useWebWorkers",Xn="useCompressionStream",Jn="transferStreams",Qn="preventClose",$n="offset",ta="usdz",ea="strictness",ra="strict",na="tolerant",aa="File format is not recognized",sa="End of central directory not found",ia="End of Zip64 central directory locator not found",oa="Central directory header not found",ca="Local file header not found",la="Zip64 extra field not found",da="File contains encrypted entry",ua="Encryption method not supported",fa="Compression method not supported",wa="Split zip file",ha="Overlapping entry found",pa="Ambiguous archive",ma="Encrypted central directory is not supported",ya="utf-8",ba="cp437",Sa=[[wn,t],[hn,t],[pn,t],[mn,e]],Ea={[e]:{Wt:Ka,bytes:4},[t]:{Wt:Ya,bytes:8}};class ga{constructor(t,e={}){Object.assign(this,{reader:new rn(t),options:e,config:j(),_t:new Map})}async*getEntriesGenerator(n={}){const s=this;let{reader:c}=s;const{config:h}=s;if(await an(c),c.size!==D&&c.readUint8Array||(c=new Or(await new Response(c.readable).blob()),await an(c)),c.size<u)throw Error(aa);const p=Ca(Ba(s,n,ea),Ba(s,n,Yn)),m=p==ra,y=p!=na,b=((t,r)=>t!==D?t:r==ra?0:r==na?1/0:e)(Ba(s,n,"maxAppendedDataSize"),p),{Lt:S,Bt:z}=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,65557),s={count:va};let i,o,c=0;for await(const[r,l,d,f,w]of Na(t,a)){const a=qa(r,f+20);if(w+u+a==n){const a=await Wa(t,r,l,f,w,n,s);if(a==ja){if(i||(i=Pa(d,f,w)),c++,!e||c>1)break}else a!=Ia||o||(o=Pa(d,f,w))}}return i||(i=o),i||(i=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,e==1/0?n:65557+e);let s,i;for await(const[e,o,c,l,d]of Na(t,a)){const a=Pa(c,l,d);s||(s=a);const u=await Wa(t,e,o,l,d,n,r);if(u==ja)return a;u!=Ia||i||(i=a)}return i||s})(t,r,s)),{Lt:i,Bt:c}})(c,y,b);if(!S)throw Ka(ht(await sn(c,0,4)))==a?Error(wa):Error(sa);y&&z>1&&La("multiple end of central directory records");const A=ht(S);let F=Ka(A,12),U=Ka(A,16);const O=S.offset,T=qa(A,20),C=O+u+T;c.size-C>b&&La("appended data");let v=qa(A,4);const M=c.jt||0;let I,j,N,P,W=qa(A,6),_=qa(A,10),L=0;const B=U==t||F==t||_==e||W==e;if(U!=t&&W!=e&&(U+=ka(c,W)),B){const r=S.offset<f?k:await sn(c,S.offset-f,f),n=ht(r);if(r.length==f&&Ka(n,0)==d){U=ka(c,Ka(n,4))+Ya(n,8);let r=await sn(c,U,w),a=ht(r);const s=S.offset-f-w;if((r.length<w||Ka(a,0)!=l)&&U!=s&&s>=0){const t=U;U=s,U>t&&(L=U-t),r=await sn(c,U,w),a=ht(r)}if(r.length<w||Ka(a,0)!=l)throw Error(ia);if(j=!0,N=Ya(a,4)>44,N){const t=Math.min(Number(Ya(a,4))-44,c.size-U-w);t>0&&(P=(t=>{const e={rawExtensibleData:t};if(t.length>=28){const r=ht(t),n=qa(r,26);Object.assign(e,{compressionMethod:qa(r,0),compressedSize:Number(Ya(r,2)),uncompressedSize:Number(Ya(r,10)),encryptionAlgorithm:qa(r,18),bitLength:qa(r,20),flags:qa(r,22),hashAlgorithm:qa(r,24),hashData:t.subarray(28,28+n)})}return e})(await sn(c,U+w,t)))}v==e?v=Ka(a,16):m&&v!=Ka(a,16)&&La("mismatched zip64 end of central directory record"),W==e?W=Ka(a,20):m&&W!=Ka(a,20)&&La("mismatched zip64 end of central directory record"),_==e?_=Ya(a,32):m&&_!=Ya(a,32)&&La("mismatched zip64 end of central directory record"),F==t?F=Ya(a,40):m&&F!=Ya(a,40)&&La("mismatched zip64 end of central directory record"),U=ka(c,W)+Ya(a,48)+L}}let V=F;const Z=S.offset-(j?76:0);if(U<c.size||(L=c.size-U-F-u,U=c.size-F-u),M!=v)throw Error(wa);if(0>U)throw Error(aa);let H=0,q=await sn(c,U,F),K=ht(q);if(F){if(4>q.length)throw Error(aa);const t=Z-F;if(U!=t&&W==v){let e=!(Ka(K,H)==o);if(e||0>t||t+4>c.size||(e=Ka(ht(await sn(c,t,4)),0)==o),e){const e=U;U=t,U>e&&(L+=U-e),q=await sn(c,U,F),K=ht(q)}}}const Y=Z-U;if(F==Y||0>Y||W!=v||(F=Y,q=await sn(c,U,F),K=ht(q)),0>U||U>=c.size)throw Error(aa);s.directoryOffset=U,s.directoryLength=V;const G=Ba(s,n,"decryptCentralDirectory");let X;G&&_&&q.length>=4&&Ka(K,0)!=o&&(N||za(K))&&(q=await G(q,P),K=ht(q),V=q.length,X=!0),I=U;const J=Ba(s,n,"filenameEncoding"),Q=Ba(s,n,"commentEncoding"),$=m?new Set:D;let tt;for(let t=0;_>t;t++){const a=new Ra(c,h,s.options);if(H+46>q.length||Ka(K,H)!=o){if(0==t&&!X&&(N||za(K)))throw Error(ma);throw Error(oa)}Aa(a,K,H+6);const i=!!a.bitFlag.languageEncodingFlag,l=H+46,d=l+a.filenameLength,u=d+a.extraFieldLength,f=qa(K,H+4),w=!(f>>8),p=f>>8==3,y=q.subarray(l,d),b=qa(K,H+32),S=u+b,z=q.subarray(u,S),A=i,F=i,U=Ka(K,H+38),O=U&r,T={readOnly:!!(1&O),hidden:!!(2&O),system:!!(4&O),directory:!!(16&O),archive:!!(32&O)},k=Ka(K,H+42),C=Ba(s,n,"decodeText")||cn,v=A?ya:J||ba,M=F?ya:Q||ba;let j=C(y,v);j===D&&(j=cn(y,v));let P=C(z,M);P===D&&(P=cn(z,M)),Object.assign(a,{index:t,versionMadeBy:f,msDosCompatible:w,compressedSize:0,uncompressedSize:0,Vt:b,offset:k,diskNumberStart:qa(K,H+34),internalFileAttributes:qa(K,H+36),externalFileAttributes:U,msdosAttributesRaw:O,msdosAttributes:T,rawFilename:y,filenameUTF8:A,commentUTF8:F,rawExtraField:q.subarray(d,u),rawComment:z,filename:j,comment:P}),Fa(a,a,K,H+6),a.offset+=L,I=Math.min(ka(c,a.diskNumberStart)+a.offset,I),m&&($.has(a.filename)&&(tt=!0),$.add(a.filename));const W=a.externalFileAttributes>>16&e;a.unixMode===D&&16877&W&&(a.unixMode=W);const B=!!(a.unixMode&g),V=!!(a.unixMode&x),Z=!!(512&a.unixMode),Y=a.unixMode!==D?!!(73&a.unixMode):p&&!!(73&W),G=a.unixMode!==D&&(61440&a.unixMode)==E,et=(61440&W)==E;Object.assign(a,{setuid:B,setgid:V,sticky:Z,unixExternalUpper:W,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:Y,directory:G||et||w&&T.directory||a.filename.endsWith(R)&&!a.uncompressedSize,zipCrypto:a.encrypted&&!a.extraFieldAES});const rt=new Vn(a);rt.getData=(t,e)=>a.getData(t,rt,s._t,e),rt.arrayBuffer=async t=>{const e=new TransformStream,[r]=await Promise.all([new Response(e.readable).arrayBuffer(),a.getData(e,rt,s._t,t)]);return r},H=S;const{onprogress:nt}=n;if(nt)try{await nt(t+1,_,new Vn(a))}catch{}yield rt}let et=H;if(H+6<=q.length&&Ka(K,H)==i){const t=qa(K,H+4);H+6+t>q.length||(s.digitalSignature=q.subarray(H+6,H+6+t),et=H+6+t)}m&&H!=V&&et!=V&&La("trailing central directory data"),tt&&La("duplicate filename"),m&&(L||_&&I>0)&&La("prepended data");const rt=Ba(s,n,"extractPrependedData"),nt=Ba(s,n,"extractAppendedData");return rt&&(s.prependedData=I>0?await sn(c,0,I):k),s.comment=T?await sn(c,O+u,T):k,nt&&(s.appendedData=C<c.size?await sn(c,C,c.size-C):k),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){}}class xa{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new ga(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 Ra=class{constructor(t,e,r){Object.assign(this,{reader:t,config:e,options:r})}async getData(t,e,a,i={}){const o=this,{reader:c,index:l,offset:d,diskNumberStart:u,extraFieldAES:f,extraFieldZip64:w,compressionMethod:h,config:p,bitFlag:m,rawBitFlag:y,crc32:b,rawLastModDate:S,uncompressedSize:E,compressedSize:g}=o,{dataDescriptor:x}=m,R=e.localDirectory={},A=ka(c,u)+d,F=await sn(c,A,z),U=ht(F);let O=Ba(o,i,Zn),T=Ba(o,i,Hn);const C=Ba(o,i,qn);if(O=O&&O.length&&O,T=T&&T.length&&T,f&&99!=f.originalCompressionMethod)throw Error(fa);if(F.length<z||Ka(U,0)!=n)throw Error(ca);Aa(R,U,4);const{extraFieldLength:v,filenameLength:M}=R,I=Ca(Ba(o,i,ea),Ba(o,i,Yn))==ra;let j=k;if(I&&(M||v)){const t=await sn(c,A+z,M+v);j=t.subarray(0,M),R.rawExtraField=t.subarray(M)}else R.rawExtraField=v?await sn(c,A+z+M,v):k;Fa(o,R,U,4,!0),I&&((t,e,r)=>{const{rawFilename:n}=t;(r.length!=n.length||r.some((t,e)=>t!=n[e]))&&La("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&La("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&La("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||La("mismatched local file header (crc32 or sizes)")})(o,R,j);const{lastAccessDate:N,creationDate:P}=R;N&&(e.lastAccessDate=N),P&&(e.creationDate=P);const W=o.encrypted&&R.encrypted&&!C,_=W&&!f;if(C||(e.zipCrypto=_),W&&!(64&~R.rawBitFlag))throw Error(ua);const L=C?D:J(h);if(0!=h&&8!=h&&9!=h&&!L&&!C)throw Error(fa);if(W){if(!_&&(1>f.strength||f.strength>3))throw Error(ua);if(!O&&!T)throw Error(da)}const B=A+z+M+v,V=g,Z=ce(c.createReadable({offset:B,size:V})),H=Ba(o,i,Kn),q=Ba(o,i,"checkPasswordOnly");let K=Ba(o,i,"checkOverlappingEntry");const Y=Ba(o,i,"checkOverlappingEntryOnly");Y&&(K=!0);const{onstart:G,onprogress:X,onend:Q}=i,$=9==h;let tt=Ba(o,i,Xn);$&&(tt=!1);const et=Ba(o,i,"checkCrc32"),rt=(et===D?Ba(o,i,"checkSignature"):et)&&!C&&(!W||_||f&&1==f.vendorVersion),nt={options:{codecType:Oe,password:O,rawPassword:T,zipCrypto:_,encryptionStrength:f&&f.strength,checkCrc32:rt,checkAuthenticationCode:Ba(o,i,"checkAuthenticationCode"),passwordVerification:_&&(x?S>>>8&r:b>>>24&r),outputSize:C?g:E,crc32:b,compressed:0!=h&&!C,encrypted:W,useWebWorkers:Ba(o,i,Gn),useCompressionStream:tt,transferStreams:Ba(o,i,Jn),deflate64:$,format:L?L.format:D,codecURI:L?L.codecURI:D,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:q},config:p,lt:{signal:H,size:V,onstart:G,onprogress:X,onend:Q}};let at;K&&await(async({reader:t,Zt:e,index:r,offset:n,crc32:a,compressedSize:i,uncompressedSize:o,Ht:c,dataDescriptor:l,extraFieldZip64:d,_t:u})=>{let f=0;if(l&&(f=d?20:12),f){const r=await sn(t,c+i,f+4);if(r.length==f+4&&Ka(ht(r),0)==s){const t=Ka(ht(r),4);let n,s;d?(n=Ya(ht(r),8),s=Ya(ht(r),16)):(n=Ka(ht(r),8),s=Ka(ht(r),12)),(e.encrypted&&!e.zipCrypto||t==a)&&n==i&&s==o&&(f+=4)}}const w={start:n,end:c+i+f,Zt:e};for(const[t,e]of u)if(t!=r&&w.start<e.end&&e.start<w.end){const t=Error(ha);throw t.qt=e.Zt,t}u.set(r,w)})({reader:c,Zt:e,index:l,offset:A,crc32:b,compressedSize:g,uncompressedSize:E,Ht:B,dataDescriptor:x||R.bitFlag.dataDescriptor,extraFieldZip64:w||R.extraFieldZip64,_t:a});try{if(!Y){q&&(t=new WritableStream),t=new nn(t),await an(t,C?g:E),({writable:at}=t);const{outputSize:e}=await ar({readable:Z,writable:at},nt);if(t.size+=e,e!=(C?g:E))throw Error(de)}}catch(e){if(e.outputSize!==D&&(t.size+=e.outputSize),!q||e.message!=Rt)throw e}finally{Ba(o,i,Qn)||!at||at.locked||await at.getWriter().close()}return q||Y?D:t.getData?t.getData():at}};function za(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;e>r;r++)if(134630224==Ka(t,r))return!0;return!1}function Aa(t,e,r){const n=t.rawBitFlag=qa(e,r+2),a=!(1&~n),s=Ka(e,r+6);Object.assign(t,{encrypted:a,version:qa(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&S)==S},rawLastModDate:s,lastModDate:Va(s),filenameLength:qa(e,r+22),extraFieldLength:qa(e,r+24)})}function Fa(t,e,r,n,a){const{rawExtraField:s}=e,i=e.extraField=new Map,o=ht(s);let c=0;try{for(;c<s.length;){const t=qa(o,c),e=qa(o,c+2);i.set(t,{type:t,data:s.slice(c+4,c+4+e)}),c+=4+e}}catch{}const l=qa(r,n+4);Object.assign(e,{signature:Ka(r,n+10),crc32:Ka(r,n+10),compressedSize:Ka(r,n+14),uncompressedSize:Ka(r,n+18)});const d=i.get(1);d&&(((t,e)=>{e.zip64=!0;const r=ht(t.data),n=Sa.filter(([t,r])=>e[t]==r),a=n.reduce((t,[,e])=>t+Ea[e].bytes,0);if(t.data.length<a)throw Error(la);for(let a=0,s=0;a<n.length;a++){const[i,o]=n[a],c=Ea[o];e[i]=t[i]=c.Wt(r,s),s+=c.bytes}})(d,e),e.extraFieldZip64=d);const u=i.get(28789);u&&(Da(u,ln,dn,e,t),e.extraFieldUnicodePath=u);const f=i.get(25461);f&&(Da(f,un,fn,e,t),e.extraFieldUnicodeComment=f);const w=i.get(h);w&&w.data.length>=7?(((t,e,r)=>{const n=ht(t.data),a=Ha(n,4);Object.assign(t,{vendorVersion:Ha(n,0),vendorId:Ha(n,2),strength:a,originalCompressionMethod:r,compressionMethod:qa(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=D)})(w,e,l),e.extraFieldAES=w):e.compressionMethod=l;const S=i.get(13);S&&(Ua(S,e),e.extraFieldPkwareUnix=S);const E=i.get(22613);E&&(Ua(E,e),e.extraFieldUnixType1=E);const g=i.get(10);g&&(((t,e)=>{const r=ht(t.data);let n,a=4;try{for(;a<t.data.length&&!n;){const e=qa(r,a),s=qa(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=ht(n),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:i});const o={lastModDate:Za(a),lastAccessDate:Za(s),creationDate:Za(i)};Object.assign(t,o),Object.assign(e,o)}})(g,e),e.extraFieldNTFS=g);const x=i.get(b);if(x)Oa(x,e,!1),e.extraFieldUnix=x;else{const t=i.get(y);t&&(Oa(t,e,!0),e.extraFieldInfoZip=t)}const R=i.get(p);R&&(((t,e,r)=>{if(!t.data.length)return;const n=ht(t.data),a=Ha(n,0),s=[],i=[];r?(1&~a||(s.push(yn),i.push(bn)),2&~a||(s.push(Sn),i.push(En)),4&~a||(s.push(gn),i.push(xn))):5>t.data.length||(s.push(yn),i.push(bn));let o=1;s.forEach((r,a)=>{if(t.data.length>=o+4){const s=Ka(n,o);e[r]=t[r]=new Date(1e3*(0|s));const c=i[a];t[c]=s}o+=4})})(R,e,a),e.extraFieldExtendedTimestamp=R);const z=i.get(m);z&&(e.extraFieldUSDZ=z)}function Da(t,e,r,n,a){if(5>t.data.length)return void(t.valid=!1);const s=ht(t.data),i=new lt;i.append(a[r]);const o=ht(new Uint8Array(4));o.setUint32(0,i.get(),!0);const c=Ka(s,1);Object.assign(t,{version:Ha(s,0),[e]:cn(t.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==Ka(o,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function Ua(t,e){if(8>t.data.length)return;const r=ht(t.data),n={lastAccessDate:new Date(1e3*Ka(r,0)),lastModDate:new Date(1e3*Ka(r,4))};12>t.data.length||(n.uid=qa(r,8),n.gid=qa(r,10)),Object.assign(t,n),Object.assign(e,n)}function Oa(t,e,r){try{const n=ht(t.data);let a,s;if(r){let e=0;const r=Ha(n,e++),i=Ha(n,e++);a=Ta(t.data.subarray(e,e+i)),e+=i;const o=Ha(n,e++);s=Ta(t.data.subarray(e,e+o)),Object.assign(t,{version:r,uid:a,gid:s})}else 4>t.data.length||(a=qa(n,0),s=qa(n,2),Object.assign(t,{uid:a,gid:s}));a!==D&&(e.uid=a),s!==D&&(e.gid=s)}catch{}}function Ta(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ka(t,e){return t.Pt?t.Pt(e):0}function Ca(t,e){return t===D?e?ra:"balanced":t}const va=64,Ma=0,Ia=1,ja=2;async function*Na(t,e){const r=t.size-e,n=await sn(t,r,e),a=ht(n);for(let t=n.length-u;t>=0;t--)Ka(a,t)==c&&(yield[a,r,n,t,r+t])}function Pa(t,e,r){return{offset:r,buffer:t.slice(e,e+u).buffer}}async function Wa(r,n,a,s,i,c,l){const u=qa(n,s+10),w=Ka(n,s+12),h=Ka(n,s+16);if(u==e||w==t||h==t)return await _a(r,n,a,i-f,c,l)==d?ja:Ma;if(!u&&!w)return Ia;const p=qa(n,s+6);for(const t of[i-w,ka(r,p)+h])if(await _a(r,n,a,t,c,l)==o)return ja;return Ma}async function _a(t,e,r,n,a,s){return 0>n||n+4>a?D:r>n?s.count>0?(s.count--,Ka(ht(await sn(t,n,4)),0)):D:Ka(e,n-r)}function La(t){const e=Error(pa);throw e.reason=t,e}function Ba(t,e,r){return e[r]===D?t.options[r]:e[r]}function Va(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 Za(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Ha(t,e){return t.getUint8(e)}function qa(t,e){return t.getUint16(e,!0)}function Ka(t,e){return t.getUint32(e,!0)}function Ya(t,e){return Number(t.getBigUint64(e,!0))}var Ga=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:pa,ERR_BAD_FORMAT:aa,ERR_CENTRAL_DIRECTORY_NOT_FOUND:oa,ERR_ENCRYPTED:da,ERR_ENCRYPTED_CENTRAL_DIRECTORY:ma,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:ia,ERR_EOCDR_NOT_FOUND:sa,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:la,ERR_INVALID_AUTHENTICATION_CODE:xt,ERR_INVALID_COMPRESSED_DATA:ue,ERR_INVALID_CRC32:fe,ERR_INVALID_PASSWORD:Et,ERR_INVALID_SIGNATURE:gt,ERR_INVALID_UNCOMPRESSED_SIZE:de,ERR_LOCAL_FILE_HEADER_NOT_FOUND:ca,ERR_OVERLAPPING_ENTRY:ha,ERR_SPLIT_ZIP_FILE:wa,ERR_UNSUPPORTED_COMPRESSION:fa,ERR_UNSUPPORTED_ENCRYPTION:ua,ERR_WORKER_STARTUP_TIMEOUT:Me,ZipReader:ga,ZipReaderStream:xa});const Xa="File already exists",Ja="Zip file comment exceeds 64KB",Qa="File entry comment exceeds 64KB",$a="File entry name exceeds 64KB",ts="Version exceeds 65535",es="The strength must equal 1, 2, or 3",rs="Encryption is not supported in USDZ files",ns="Extra field type exceeds 65535",as="Extra field data exceeds 64KB",ss=-2147483648,is=2147483647,os=BigInt(0),cs=BigInt("0x7fffffffffffffff"),ls="Zip64 is not supported (set the 'zip64' option to 'true')",ds="Undefined uncompressed size",us="Undefined reader",fs="Zip file not empty",ws="Invalid uid (must be integer 0..2^32-1)",hs="Invalid gid (must be integer 0..2^32-1)",ps="Invalid UNIX mode (must be integer 0..65535)",ms="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",ys="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",bs="Invalid msdosAttributesRaw (must be integer 0..255)",Ss="Invalid msdosAttributes (must be an object with boolean flags)",Es="Signature data exceeds 64KB",gs=new Uint8Array([7,0,2,0,65,69,3,0,0]),xs="infozip",Rs="unix";let zs=0;const As=[];class Fs{constructor(t,e={}){t=new nn(t);const{availableSize:r=U,maxSize:n=U}=t;Object.assign(this,{writer:t,Kt:r>0&&r!==U&&n>0&&n!==U,options:e,config:j(),files:new Map,Yt:new Set,offset:e[$n]===D?t.size||t.writable.size||0:e[$n],Gt:e[$n]===D?0:e[$n]-(t.size||t.writable.size||0),Xt:new Set,Jt:0,Qt:D})}async prependZip(e){if(this.Yt.size)throw Error(fs);e=new rn(e),await an(e);const{ZipReader:r}=await Promise.resolve().then(()=>Ga),n=new r(e.readable),a=await n.getEntries();await n.close(),await an(this.writer),await e.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=e.size,this.Yt=new Set(a.map(t=>t.filename)),this.files=new Map(a.map(e=>{const{version:r,rawLastModDate:n,lastAccessDate:a,creationDate:s,rawFilename:i,bitFlag:o,encrypted:c,uncompressedSize:l,compressedSize:d,zip64:u}=e;let{compressionMethod:f,$t:w,te:h,ee:p,re:m,ne:y,rawExtraField:b}=e;const{level:S,languageEncodingFlag:E,dataDescriptor:g}=o;w=w||k,h=h||k,p=p||k,m=m||k,y=y||k,b=b||k,e.extraFieldAES&&(f=99);const x=Ys(w,h,p,m,y,b),R=u&&l>=t,z=u&&d>=t,A=-7&Xs(S,E,g,c,f)|S<<1,{ae:F,se:U}=Gs({version:r,bitFlag:A,compressionMethod:f,uncompressedSize:l,compressedSize:d,rawLastModDate:n,rawFilename:i,ie:z,oe:R,extraFieldLength:x}),{crc32:O}=e;return O!==D&&Hs(U,10,O),Object.assign(e,{oe:R,ie:z,ce:u&&e.offset>=t,diskNumberStart:0,le:!1,$t:w,te:h,ee:p,re:m,ne:y,rawExtraField:b,extendedTimestamp:p.length>0||m.length>0,de:1+(a?2:0)+(s?4:0),ae:F,se:U}),[e.filename,e]}))}async add(i="",o,c={}){const l=this;c=Object.assign({},c);const{Xt:d,config:u}=l;let f,w;zs<u.maxWorkers?zs++:await new Promise(t=>As.push(t));try{if(i=i.trim(),Bs(l,c,vn)&&!i.endsWith(R)&&(i+=R),l.Yt.has(i))throw Error(Xa);return l.Yt.add(i),w=!0,f=(async(i,o,c,l)=>{const d=((n,a,s)=>{a=a.trim();let i=Bs(n,s,Dn),o=Bs(n,s,kn,i?20:768);const c=Bs(n,s,Mn),l=Bs(n,s,"uid"),d=Bs(n,s,"gid");let u=Bs(n,s,Pn),f=Bs(n,s,"unixExtraFieldType"),w=Bs(n,s,Wn),h=Bs(n,s,_n),p=Bs(n,s,Ln);if(l!==D&&(0>l||l>t))throw Error(ws);if(d!==D&&(0>d||d>t))throw Error(hs);if(u!==D&&(0>u||u>e))throw Error(ps);if(f!==D&&f!==xs&&f!==Rs)throw Error(ms);if(f===Rs&&(l!==D&&l>e||d!==D&&d>e))throw Error(ys);f!==D||l===D&&d===D||(f=xs);let m=Bs(n,s,An),y=Bs(n,s,Fn);const b=m!==D||y!==D;if(l!==D||d!==D||u!==D||f?(i=!1,o=o&e|768):b&&(i=!0,o&=r),m!==D&&(0>m||m>r))throw Error(bs);if(y&&"object"!=typeof y)throw Error(Ss);if(o>e)throw Error(ts);let S=Bs(n,s,zn);const z=S!==D;z||(S=0),!s[vn]&&a.endsWith(R)&&(s[vn]=!0);const A=Bs(n,s,vn);let F;if(A?(a.endsWith(R)||(a+=R),z||(S=16,i||(S|=16877<<16))):i||z||(S=c?493<<16:27525120),!i){const t=u!==D||!!(w||h||p);F=S>>16&e,u=u===D?F:u&e,w?u|=g:w=!!(u&g),h?u|=x:h=!!(u&x),p?u|=512:p=!!(512&u),z&&!t||(A&&(u|=E),S=(u&e)<<16|S&e)}return({msdosAttributesRaw:m,msdosAttributes:y}=((t,e)=>{if(t!==D)t&=r;else if(e!==D){const{readOnly:n,hidden:a,system:s,directory:i,archive:o}=e;let c=0;n&&(c|=1),a&&(c|=2),s&&(c|=4),i&&(c|=16),o&&(c|=32),t=c&r}return e===D&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(m,y)),b&&(S=S&t|m&r),{name:a,ue:{versionMadeBy:o,msDosCompatible:i,externalFileAttributes:S,unixExternalUpper:F,uid:l,gid:d,unixMode:u,unixExtraFieldType:f,setuid:w,setgid:h,sticky:p,msdosAttributesRaw:m,msdosAttributes:y}}})(i,o,l);({name:o}=d);const u=((t,r,n)=>{const a=Bs(t,n,"encodeText",ut);let s=a(r);if(s===D&&(s=ut(r)),Ys(s)>e)throw Error($a);const i=n[un]||"";let o=a(i);if(o===D&&(o=ut(i)),Ys(o)>e)throw Error(Qa);const c=Bs(t,n,Tn,20);if(c>e)throw Error(ts);const l=Bs(t,n,yn,new Date),d=Bs(t,n,Sn),u=Bs(t,n,gn),f=Bs(t,n,Rn,0),w=Bs(t,n,qn);let h,p;w||(h=Bs(t,n,Zn),p=Bs(t,n,Hn));const m=Bs(t,n,"encryptionStrength",3),y=Bs(t,n,Cn),b=Bs(t,n,"extendedTimestamp",!0),S=Bs(t,n,"ntfsTimestamp"),E=Bs(t,n,"keepOrder",!0),g=Bs(t,n,Gn),x=Bs(t,n,Jn),R=Bs(t,n,"bufferedWrite"),z=Bs(t,n,"createTempStream"),A=Bs(t,n,"dataDescriptorSignature",!0),F=Bs(t,n,Kn),U=Bs(t,n,"useUnicodeFileNames",!0),O=Bs(t,n,In),T=w||O===D?D:J(O);if(!w&&O!==D&&0!==O&&8!==O&&!T)throw Error("Compression method not supported");let k=Bs(t,n,"level");if(t.options[ta]){if(h!==D||p!==D)throw Error(rs);k===D&&O===D&&(k=0)}let C=Bs(t,n,Xn),v=Bs(t,n,"dataDescriptor");R&&v===D&&(v=!1),(v===D||y)&&(v=!0),k!==D&&6!=k&&(C=!1);const M=Bs(t,n,Un);if(!y&&(h!==D||p!==D)&&(1>m||m>3))throw Error(es);const I=Os(n[Nn]),j=Os(n.localExtraField);return{comment:i,ue:{rawFilename:s,rawComment:o,version:c,lastModDate:l,lastAccessDate:d,creationDate:u,internalFileAttributes:f,passThrough:w,password:h,rawPassword:p,encryptionStrength:m,zipCrypto:y,extendedTimestamp:b,ntfsTimestamp:S,keepOrder:E,useWebWorkers:g,transferStreams:x,bufferedWrite:R,createTempStream:z,dataDescriptorSignature:A,signal:F,useUnicodeFileNames:U,compressionMethod:O,format:T?T.format:D,codecURI:T?T.codecURI:D,fe:T?T.versionNeeded:D,level:k,useCompressionStream:C,dataDescriptor:v,zip64:M,rawExtraField:I,we:j}}})(i,o,l),{comment:f}=u,w=l[Nn];let m;i.files.set(o,D);try{const{ue:f}=u;0==f.level||f.compressionMethod!==D||f.passThrough||await(async t=>{const{CompressionStream:e,CompressionStreamFallback:r}=t;if(r&&!r.Ft)return!0;if(ge(e)||Ee(e,he))return!0;if(r)try{return await Le(t),!0}catch{return!1}return!1})(i.config)||(f.level=0);const w=await(async(e,r,{ue:n},a)=>{const{passThrough:s,zipCrypto:i,password:o,rawPassword:c,encryptionStrength:l}=n;let{dataDescriptor:d,zip64:u,level:f,compressionMethod:w}=n,h=0,p=0;if(s){if(!r)throw Error(us);if(p=a[wn],p===D)throw Error(ds)}const m=!0===u,y=Bs(e,a,On),b=!!r&&(!!(o&&Ys(o)||c&&Ys(c))||s&&y);r||(f=0,w=0);const S=b?i?12:16+4*l:0;r&&(r=new rn(r),await an(r),s?(a.uncompressedSize=p,h=Vs(p)+S):r.size===D?(d=!0,(u||u===D)&&(u=!0,p=h=4294967296)):(a.uncompressedSize=p=r.size,h=Vs(p)+S));const E=m||p>=t,g=m||h>=t;if(E||g){if(!1===u)throw Error(ls);u=!0}return u=u||!1,{reader:r,ue:{dataDescriptor:d,zip64:u,oe:E,ie:g,uncompressedSize:p,level:f,compressionMethod:w,encrypted:b}}})(i,c,u,l);({reader:c}=w);const S=Ms(i.writer),E=vs(i.writer),g=(t=>{const{rawFilename:r,lastModDate:a,lastAccessDate:s,creationDate:i,level:o,zip64:c,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:u,directory:f,rawExtraField:w,we:m,encryptionStrength:S,extendedTimestamp:E,ntfsTimestamp:g,passThrough:x,encrypted:R,oe:U,ie:O,uncompressedSize:T,crc32:C}=t;let{version:v,compressionMethod:M}=t;const I=!f&&(M===D?o===D||o>0:0!==M);let j;const N=x||!I,P=c&&(t.bufferedWrite||!u||!U&&!O||N),W=P||c&&u&&(U||O);if(c&&(U||O)){const t=20,e=Cs(t);if(e.uint16(1),e.uint16(t-4),j=e.array,P&&(e.he(T),N)){const t=R?l?12:16+4*S:0;e.he(x?0:T+t)}}else j=k;let _,L,B,V,Z;if(R&&!l){const t=Cs(Ys(gs)+2);t.uint16(h),t.bytes(gs),_=t.array,_[8]=S}else _=k;if(E){const t=Ws(a),e=_s(t);if(e){const e=9+(s?4:0)+(i?4:0),r=Cs(e);V=1+(s?2:0)+(i?4:0),r.uint16(p),r.uint16(e-4),r.uint8(V),r.uint32(t),s&&r.uint32(Ls(Ws(s))),i&&r.uint32(Ls(Ws(i))),B=r.array}else B=k;if(g===D?!e||s||i:g)try{const t=Ps(a),e=Cs(36);e.uint16(10),e.uint16(32),e.pe(4),e.uint16(1),e.uint16(24),e.he(t),e.he(s?Ps(s):t),e.he(i?Ps(i):t),L=e.array}catch{L=k}else L=k}else L=B=k;try{const{uid:r,gid:n,unixExtraFieldType:a}=t;if(a!=xs||r===D&&n===D)if(a!=Rs||r===D&&n===D)Z=k;else{const t=Cs(8);t.uint16(b),t.uint16(4),t.uint16((r===D?0:r)&e),t.uint16((n===D?0:n)&e),Z=t.array}else{const t=ks(r),e=ks(n),a=3+t.length+e.length,s=Cs(4+a);s.uint16(y),s.uint16(a),s.uint8(1),s.uint8(t.length),s.bytes(t),s.uint8(e.length),s.bytes(e),Z=s.array}}catch{Z=k}M===D&&(M=I?8:0);const{fe:H}=t;I&&H!==D&&(v=v>H?v:H),c&&(v=v>45?v:45),R&&!l&&(v=v>51?v:51,x&&C!==D&&(_[4]=1),_[9]=M,M=99);const q=W?Ys(j):0,K=q+Ys(_,B,L,Z,w,m);if(K>e)throw Error(as);const Y=new Date(2e3*Math.ceil(Math.floor(a.getTime()/1e3)/2)),{ae:G,se:X,rawLastModDate:J}=Gs({version:v,bitFlag:Xs(o,d,u,R,M),compressionMethod:M,uncompressedSize:T,lastModDate:F>Y?F:Y>A?A:Y,rawFilename:r,ie:O,oe:U,extraFieldLength:K}),Q=Cs(z+Ys(r)+K),$=Q.array,tt=ht($);return Q.uint32(n),Q.bytes(G),Q.bytes(r),W&&Q.bytes(j),Q.bytes(_),Q.bytes(B),Q.bytes(L),Q.bytes(Z),Q.bytes(w),Q.bytes(m),u&&(O||Hs(tt,18,0),U||Hs(tt,22,0)),{me:$,ye:tt,ae:G,se:X,lastModDate:a,rawLastModDate:J,encrypted:R,compressed:I,version:v,compressionMethod:M,de:V,$t:k,be:q,ee:B,re:L,ne:Z,te:_,extraFieldLength:K}})(l=Object.assign({},l,d.ue,u.ue,w.ue,{internalFileAttribute:u.ue.internalFileAttributes,externalFileAttribute:d.ue.externalFileAttributes,signature:l[jn],crc32:l.crc32===D?l[jn]:l.crc32,offset:i.offset-S,diskNumberStart:E})),x=(({zip64:t,dataDescriptor:e,dataDescriptorSignature:r})=>{let n,a=k,i=0,o=t?20:12;return r&&(o+=4),e&&(a=new Uint8Array(o),n=ht(a),r&&(i=4,Hs(n,0,s))),{Se:a,Ee:n,ge:i}})(l),R=Ys(g.me,x.Se);m=await(async(e,n,s,i,o)=>{const{files:c,writer:l}=e,{keepOrder:d,dataDescriptor:u,signal:f}=o,{xe:w}=i,h=e.options[ta],p=e.Qt;let m,y,b,S,E,g,x,R={},A=0;c.set(n,R),e.Qt=R;try{let y;d&&(y=p&&p.lock,R.lock=new Promise(t=>b=t)),o.bufferedWrite||!d||e.Re||e.Jt||!u?(m=!0,e.Jt++,x=o.createTempStream?await o.createTempStream():new TransformStream(D,D,{highWaterMark:U}),x.size=0,await an(l)):(x=l,await F()),await an(x);const T=Ms(l);if(e.Kt){delete e.Kt;const t=new Uint8Array(4);Hs(ht(t),0,a),await Ns(l,t),e.offset+=4}h&&!m&&Ts(i,e.offset-T);const{me:k}=w;m||(await y,await O());const C=vs(l),v=js(e,l);if(R.diskNumberStart=C,m||(E=!0,g=l.size,await Ns(x,k)),R=await(async(e,n,{diskNumberStart:a,lock:s},i,o,c)=>{const{xe:l,ze:d,Ae:u}=i,{ae:f,se:w,lastModDate:h,rawLastModDate:p,encrypted:m,compressed:y,version:b,compressionMethod:S,$t:E,be:g,ee:x,de:R,re:z,ne:A,te:F}=l,{Se:U}=d,{rawFilename:O,lastAccessDate:T,creationDate:k,password:C,rawPassword:v,level:M,zip64:I,oe:j,ie:N,zipCrypto:P,dataDescriptor:W,directory:_,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,setuid:st,setgid:it,sticky:ot,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt,useCompressionStream:ut,passThrough:ft,format:wt,codecURI:ht}=c,pt={lock:s,versionMadeBy:B,zip64:I,directory:!!_,executable:!!L,filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:V,$t:E,be:g,ee:x,re:z,ne:A,te:F,rawExtraField:Z,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,diskNumberStart:a,uid:rt,gid:nt,unixMode:at,setuid:st,setgid:it,sticky:ot,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt};let{crc32:mt,uncompressedSize:yt}=c,bt=0;ft||(yt=0);const{writable:St}=n;if(e){const a=ce(e.createReadable?e.createReadable():e.readable),s=e.size,i={options:{codecType:Ue,level:M,rawPassword:v,password:C,encryptionStrength:J,zipCrypto:m&&P,passwordVerification:m&&P&&p>>8&r,computeCrc32:!ft,compressed:y&&!ft,encrypted:m&&!ft,useWebWorkers:H,useCompressionStream:ut,transferStreams:q,format:wt,codecURI:ht,compressionMethod:S},config:o,lt:{signal:X,size:s,onstart:K,onprogress:Y,onend:G}};try{const e=await ar({readable:a,writable:St},i);if(bt=e.outputSize,n.size+=bt,ft||(yt=e.inputSize,m&&!P||(mt=e.crc32)),!N&&bt>=t||!j&&yt>=t)throw Error(ls)}catch(t){throw t.outputSize!==D&&(n.size+=t.outputSize),t}}return(({crc32:t,compressedSize:e,uncompressedSize:r,xe:n,ze:a},{zip64:s,zipCrypto:i,passThrough:o,dataDescriptor:c})=>{const{se:l,encrypted:d}=n,{Ee:u,ge:f}=a;d&&!i&&!o||t===D||(Hs(l,10,t),c&&Hs(u,f,t)),s?c&&(qs(u,f+4,BigInt(e)),qs(u,f+12,BigInt(r))):(Hs(l,14,e),Hs(l,18,r),c&&(Hs(u,f+4,e),Hs(u,f+8,r)))})({crc32:mt,compressedSize:bt,uncompressedSize:yt,xe:l,ze:d},c),W&&await Ns(n,U),Object.assign(pt,{uncompressedSize:yt,compressedSize:bt,lastModDate:h,rawLastModDate:p,creationDate:k,lastAccessDate:T,encrypted:m,zipCrypto:P,size:u+bt,compressionMethod:S,version:b,ae:f,se:w,signature:mt,crc32:!m||P||ft?mt:D,de:R,oe:j,ie:N}),pt})(s,x,R,i,e.config,o),m||(E=!1),c.set(n,R),R.filename=n,m){if(await Promise.all([x.writable.getWriter().close(),y]),await F(),S=!0,g=l.size,await O(),R.diskNumberStart=vs(l),R.offset=js(e,l),h){const t=i.Ae;Ts(i,e.offset-Ms(l)),R.size+=i.Ae-t}(({rawFilename:t,encrypted:e,zip64:r,be:n,crc32:a,compressedSize:s,uncompressedSize:i,oe:o,ie:c},l,{dataDescriptor:d,passThrough:u})=>{if(d||((!e||u&&a!==D)&&Hs(l,14,a),c||Hs(l,18,s),o||Hs(l,22,i)),r&&n){const e=z+Ys(t)+4;qs(l,e,BigInt(i)),qs(l,e+8,BigInt(s))}})(R,w.ye,o),await Ns(l,w.me),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=Ys(t),A+=e}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{n.releaseLock()}})(x.readable,l,f),l.size+=x.size,S=!1}else R.diskNumberStart=C,R.offset=v;return e.offset+=R.size,R}catch(t){if(S||E){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=l.size-g,m&&(e.offset+=A)}throw c.delete(n),t}finally{if(m&&e.Jt--,b&&b(),y&&y(),m&&x&&x.dispose)try{await x.dispose()}catch{}}async function F(){e.Re=!0;const{Fe:t}=e;e.Fe=new Promise(t=>y=()=>{e.Re=!1,t()}),await t}async function O(){Is(l,Ys(w.me))&&await l.closeDisk()}})(i,o,c,{xe:g,ze:x,Ae:R},l)}catch(t){throw i.files.delete(o),t}return Object.assign(m,{name:o,comment:f,extraField:w}),new Vn(m)})(l,i,o,c),d.add(f),await f}catch(t){throw w&&l.Yt.delete(i),t}finally{d.delete(f);const t=As.shift();t?t():zs--}}remove(t){const{Yt:e,files:r}=this;if("string"==typeof t&&(t=r.get(t)),t&&t.filename!==D){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=k,n={}){const{Xt:a,writer:s}=this,{writable:f}=s;if(Ys(r)>e)throw Error(Ja);for(;a.size;)await Promise.allSettled(Array.from(a));return await(async(r,n,a)=>{const s=(r=>{let n=0;for(const[,a]of r){const{rawFilename:r,te:s,rawComment:i,re:o,ne:c,rawExtraField:l,extendedTimestamp:d,de:u,lastModDate:f,oe:w,ie:h,uncompressedSize:m,compressedSize:y}=a,b=a.offset>=t,S=a.diskNumberStart>=e;let E,g;if(b||S||w||h){const t=4+(w?8:0)+(h?8:0)+(b?8:0)+(S?4:0),e=Cs(t);e.uint16(1),e.uint16(t-4),w&&e.he(m),h&&e.he(y),b&&e.he(a.offset),S&&e.uint32(a.diskNumberStart),E=e.array}else E=k;a.$t=E,a.ce=b,a.le=S;const x=Ws(f);if(d&&_s(x)){const t=Cs(9);t.uint16(p),t.uint16(5),t.uint8(u),t.uint32(x),g=t.array}else g=k;a.ee=g;const R=Ys(E,s,o,c,g,l);if(R>e)throw Error(as);n+=46+Ys(r,i)+R}return n})(r.files),{De:f,Ue:w}=await(async(r,n,a)=>{const{files:s,writer:i}=r,c=new Uint8Array(n);await an(i);let l=0,d=0,u=vs(i),f=Ms(i);for(const[r,n]of Array.from(s.values()).entries()){const{offset:w,rawFilename:h,$t:p,te:m,ee:y,re:b,ne:S,rawExtraField:E,rawComment:g,versionMadeBy:x,ae:R,se:z,oe:A,ie:F,le:D,ce:U,internalFileAttributes:O,externalFileAttributes:T,diskNumberStart:k,uncompressedSize:C,compressedSize:v}=n,M=Ys(p,m,y,b,S,E),I=46+Ys(h,g)+M;Is(i,l+I-d)&&(await Ns(i,c.slice(d,l)),d=l,await i.closeDisk()),0==r&&(u=vs(i),f=Ms(i)),A||Hs(z,18,C),F||Hs(z,14,v),(U||D)&&45>n.version&&Zs(z,0,45);const j=Cs(I);if(j.uint32(o),j.uint16(x),j.bytes(R.subarray(0,24)),j.uint16(M),j.uint16(Ys(g)),j.uint16(D?e:k),j.uint16(O),j.uint32(T),j.uint32(U?t:w),j.bytes(h),j.bytes(p),j.bytes(m),j.bytes(y),j.bytes(b),j.bytes(S),j.bytes(E),j.bytes(g),Ks(c,j.array,l),l+=I,a.onprogress)try{await a.onprogress(r+1,s.size,new Vn(n))}catch{}}return await Ns(i,d?c.slice(d):c),{De:{diskNumber:u,diskOffset:f},Ue:c}})(r,s,a),h=await(async(t,r,n)=>{const a=Bs(t,n,"signCentralDirectory");if(a){const n=await a(r),s=Ys(n);if(s>e)throw Error(Es);const o=Cs(6+s);return o.uint32(i),o.uint16(s),o.bytes(n),await Ns(t.writer,o.array),6+s}return 0})(r,w,a);await(async(r,n,a,s)=>{const{writer:i}=r,{De:o,Oe:f}=s;let{Te:w}=s,h=r.files.size,p=o.diskNumber,m=js(r,o),y=vs(i);Is(i,u)&&y++;let b=Bs(r,a,Un);if(!(t>m&&t>w&&e>h&&e>y)){if(!1===b)throw Error(ls);b=!0}const S=Ys(n);if(S>e)throw Error(Ja);const E=Cs(b?98:u);Is(i,Ys(E.array)+S)&&await i.closeDisk(),y=vs(i),b&&(E.uint32(l),E.he(44),E.uint16(45),E.uint16(45),E.uint32(y),E.uint32(p),E.he(h),E.he(h),E.he(w),E.he(m),E.uint32(d),E.uint32(y),E.he(BigInt(js(r,i))+BigInt(w)+BigInt(f)),E.uint32(y+1),Bs(r,a,"supportZip64SplitFile",!0)&&(y=e,p=e),h=e,m=t,w=t),E.uint32(c),E.uint16(y),E.uint16(p),E.uint16(h),E.uint16(h),E.uint32(w),E.uint32(m),E.uint16(S),await Ns(i,E.array),S&&await Ns(i,n)})(r,n,a,{De:f,Te:s,Oe:h})})(this,r,n),Bs(this,n,Qn)||await f.getWriter().close(),s.getData?s.getData():f}}class Ds{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new Fs(r,t),this.Xt=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 Us(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 Us(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){return await Promise.all(Array.from(this.Xt)),this.zipWriter.close(t,e)}}function Us(t,e,r){t.Xt.add(e),e.catch(t=>{try{r(t)}catch{}})}function Os(t){if(!t)return k;let r=0,n=0;t.forEach(t=>r+=4+Ys(t));const a=new Uint8Array(r),s=ht(a);return t.forEach((t,r)=>{if(r>e)throw Error(ns);if(Ys(t)>e)throw Error(as);Zs(s,n,r),Zs(s,n+2,Ys(t)),Ks(a,t,n+4),n+=4+Ys(t)}),a}function Ts(t,e){const{xe:r}=t;let{me:n,extraFieldLength:a}=r,s=64-(e+Ys(n))%64;4>s&&(s+=64);const i=new Uint8Array(s),o=ht(i);Zs(o,0,m),Zs(o,2,s-4);const c=n;r.me=n=new Uint8Array(Ys(c)+s),Ks(n,c),Ks(n,i,Ys(c));const l=ht(n);Zs(l,28,a+s),r.ye=l,t.Ae+=s}function ks(t){if(t===D)return k;{const e=new Uint8Array(4);ht(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}}function Cs(t){const e=new Uint8Array(t),r=ht(e);let n=0;return{array:e,uint8:t=>{((t,e,r)=>{t.setUint8(e,r)})(r,n,t),n+=1},uint16:t=>{Zs(r,n,t),n+=2},uint32:t=>{Hs(r,n,t),n+=4},he:t=>{qs(r,n,BigInt(t)),n+=8},bytes:t=>{Ks(e,t,n),n+=Ys(t)},pe:t=>n+=t}}function vs(t){const{diskNumber:e=0}=t;return e}function Ms(t){const{diskOffset:e=0}=t;return e}function Is(t,e){const{availableSize:r=U}=t;return e>r}function js(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.Gt:0)}async function Ns(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=Ys(e),await n.write(e)}finally{n.releaseLock()}}function Ps(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return os>e?os:e>cs?cs:e}}function Ws(t){return Math.floor(t.getTime()/1e3)}function _s(t){return t>=ss&&is>=t}function Ls(t){return Math.min(is,Math.max(ss,t))}function Bs(t,e,r,n){const a=e[r]===D?t.options[r]:e[r];return a===D?n:a}function Vs(t){return t+5*(Math.floor(t/16383)+1)}function Zs(t,e,r){t.setUint16(e,r,!0)}function Hs(t,e,r){t.setUint32(e,r,!0)}function qs(t,e,r){t.setBigUint64(e,r,!0)}function Ks(t,e,r){t.set(e,r)}function Ys(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Gs({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:a,compressedSize:s,lastModDate:i,rawLastModDate:o,rawFilename:c,ie:l,oe:d,extraFieldLength:u}){const f=Cs(26),w=f.array,h=ht(w);if(f.uint16(e),f.uint16(r),f.uint16(n),o===D){const t=new Uint32Array(1),e=ht(t);Zs(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Zs(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),o=t[0]}return f.uint32(o),f.pe(4),l||s!==D?f.uint32(l?t:s):f.pe(4),d||a!==D?f.uint32(d?t:a):f.pe(4),f.uint16(Ys(c)),f.uint16(u),{ae:w,se:h,rawLastModDate:o}}function Xs(t,e,r,n,a){let s=0;return e&&(s|=S),r&&(s|=8),8!=a&&9!=a||(0>t||t>3||(s|=6),t>3&&5>=t&&(s|=4),9==t&&(s|=2)),n&&(s|=1),s}function Js(){return"application/octet-stream"}const Qs=1048576,$s=".zip.js-temp";function ti(t={}){const{thresholdBytes:e=Qs,directoryName:r=$s,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,i,o=0,c=!1;const l=new WritableStream({async write(i){c?await a.write(i):(t.push(i),o+=i.length,o>e&&await(async()=>{const e=await s();r=crypto.randomUUID(),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 d=0;return{writable:l,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 d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){i&&await i.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 ri(t={}){const{thresholdBytes:e=ei}=t;return()=>{const t=[];let r,n,a,s=0,i=!1;const o=new WritableStream({async write(a){i?await r.write(a):(t.push(a),s+=a.length,s>e&&await(async()=>{const e=new TransformStream;n=new Response(e.readable).blob(),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:o,readable:new ReadableStream({async pull(e){if(i){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 ni=1048576,ai=".zip.js-temp",si="createSyncAccessHandle is only available in dedicated workers";function ii(t={}){const{thresholdBytes:e=ni,directoryName:r=ai,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw Error(si);const a=n||(()=>navigator.storage.getDirectory());let s;function i(){return s||(s=Promise.resolve(a()).then(t=>t.getDirectoryHandle(r,{create:!0}))),s}return()=>{const t=[];let r,n,a=0,s=!1,o=0,c=0;const l=new WritableStream({async write(c){s?(n.write(c,{at:o}),o+=c.length):(t.push(c),a+=c.length,a>e&&await(async()=>{const e=await i();r=crypto.randomUUID();const a=await e.getFileHandle(r,{create:!0});n=await a.createSyncAccessHandle(),s=!0;for(const e of t)n.write(e,{at:o}),o+=e.length;t.length=0})())},close(){n&&n.flush()}});let d=0;return{writable:l,readable:new ReadableStream({pull(e){if(s){const t=o-c;if(0>=t)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 d<t.length?e.enqueue(t[d++]):e.close()}},{highWaterMark:0}),dispose:async()=>{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{_({baseURI:import.meta.url})}catch{}let oi,ci,li,di,ui;function fi(t,e,r={}){if(!oi){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=ci(a),this.in=ci(s),this.inBufferSize=s,!this.ke||!this.in)throw Error("allocation failed");if(this.Ce=new Uint8Array(a),t?(this.ve=oi.deflate_process,this.Me=oi.deflate_last_consumed,this.Ie=oi.deflate_end,this.je=oi.deflate_new(),r="gzip"===e?oi.deflate_init_gzip(this.je,n):"deflate-raw"===e?oi.deflate_init_raw(this.je,n):oi.deflate_init(this.je,n)):"deflate64-raw"===e?(this.ve=oi.inflate9_process,this.Me=oi.inflate9_last_consumed,this.Ie=oi.inflate9_end,this.je=oi.inflate9_new(),r=oi.inflate9_init_raw(this.je)):(this.ve=oi.inflate_process,this.Me=oi.inflate_last_consumed,this.Ie=oi.inflate_end,this.je=oi.inflate_new(),r="deflate-raw"===e?oi.inflate_init_raw(this.je):"gzip"===e?oi.inflate_init_gzip(this.je):oi.inflate_init(this.je)),0!==r)throw Error("init failed:"+r)}catch(t){throw i(this),t}},transform(e,r){try{const n=e,s=new Uint8Array(di.buffer),i=this.ve,o=this.Me,c=this.ke,l=this.Ce;let d=0;for(;d<n.length;){const e=Math.min(n.length-d,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&li&&(li(this.in),this.in=0),this.in=ci(e),this.inBufferSize=e,!this.in))throw Error("allocation failed");s.set(n.subarray(d,d+e),this.in);const u=i(this.je,this.in,e,c,a,0),f=16777215&u;if(f&&(l.set(s.subarray(c,c+f),0),r.enqueue(l.slice(0,f))),!t){const t=u>>24&255,e=128&t?t-256:t;if(0>e)throw Error("process error:"+e)}const w=o(this.je);if(0===w)break;d+=w}}catch(t){i(this),r.error(t)}},flush(e){try{const r=new Uint8Array(di.buffer),n=this.ve,s=this.ke,i=this.Ce;for(;;){const o=n(this.je,0,0,s,a,4),c=16777215&o,l=o>>24&255;if(!t){const t=128&l?l-256:l;if(0>t)throw Error("process error:"+t)}if(c&&(i.set(r.subarray(s,s+c),0),e.enqueue(i.slice(0,c))),1===l||0===c)break}}catch(t){e.error(t)}finally{const t=i(this);0!==t&&e.error(Error("end error:"+t))}},cancel(){i(this)}});function i(t){let e=0;return t.je&&t.Ie&&(e=t.Ie(t.je)),t.je=0,t.in&&li&&li(t.in),t.in=0,t.ke&&li&&li(t.ke),t.ke=0,e}}class wi{constructor(t="deflate",e){return fi(!0,t,e)}}class hi{constructor(t="deflate",e){return fi(!1,t,e)}}wi.Ft=!0,hi.Ft=!0;let pi,mi=!1;function yi(){pi=null,(async()=>{await Promise.allSettled($e.map(t=>(lr(t),t.terminate()))),Ie=D,We=!1})(),mi=!1,oi=ci=li=di=ui=null}(({Ne:t})=>{Le=t})({Ne:t=>{if(!pi){let{wasmURI:e}=t;typeof e==T&&(e=e()),pi=(async(t,{baseURI:e})=>{if(!mi)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;n>t;++t)a[t]=r.charCodeAt(t);return a.buffer})(t)}(t=>{if(oi=t,({malloc:ci,free:li,memory:di}=oi),"function"!=typeof ci||"function"!=typeof li||!di)throw oi=ci=li=di=null,Error("Invalid WASM module")})((await WebAssembly.instantiate(r)).instance.exports)})(t,e),mi=!0}catch(t){throw(t=>{ui=t})(t),t}})(e,t).catch(t=>{throw pi=null,t})}return pi}}),_({CompressionStreamFallback:wi,DecompressionStreamFallback:hi}),_({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const bi="Entry filename already exists",Si="Readable stream already consumed",Ei=new Set([1,h,10,p,28789,25461,m,y,b,22613,13]);class gi{constructor(t,e,r,n){const a=this;if(t.root&&n&&n.getChildByName(e))throw Error(bi);r||(r={}),Object.assign(a,{fs:t,name:e,data:r.data,options:r.options,id:t.Pe++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,passThrough:r.passThrough}),!n&&t.root||(t.entries[a.id]=a),n&&a.parent.children.push(a)}moveTo(t){this.fs.move(this,t)}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(bi);this.name=t}}class xi extends gi{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 xi(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data)return r.data;{const n=r.reader=Ui(r.Reader,r.data,e),a=r.data?r.data.uncompressedSize:n.size;await Promise.all([an(n),an(t,a)]);const{readable:s}=n;return r.uncompressedSize=n.size,await s.pipeTo(t.writable),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==Et)return!1;throw t}}getText(t,e){return this.getData(new Cr(t),e)}getBlob(t,e){return this.getData(new Tr(t),e)}getData64URI(t,e){return this.getData(new Fr(t),e)}getUint8Array(t){return this.getData(new $r,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return wt(await this.getUint8Array(t)).buffer}replaceBlob(t){Object.assign(this,{data:t,Reader:Or,Writer:Tr,reader:null})}replaceText(t){Object.assign(this,{data:t,Reader:kr,Writer:Cr,reader:null})}replaceData64URI(t){Object.assign(this,{data:t,Reader:Ar,Writer:Fr,reader:null})}replaceUint8Array(t){Object.assign(this,{data:t,Reader:Qr,Writer:$r,reader:null})}replaceReadable(t){Object.assign(this,{data:null,Reader:Fi(t),Writer:null,reader:null})}}class Ri extends gi{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new Ri(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 Mi(this,t,{options:e},!0)}addText(t,e,r={}){return Mi(this,t,{data:e,Reader:kr,Writer:Cr,options:r,uncompressedSize:e.length})}addBlob(t,e,r={}){return Mi(this,t,{data:e,Reader:Or,Writer:Tr,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 Mi(this,t,{data:e,Reader:Ar,Writer:Fr,options:r,uncompressedSize:Math.floor(.75*(n-a))})}addUint8Array(t,e,r={}){return Mi(this,t,{data:e,Reader:Qr,Writer:$r,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return Mi(this,t,{data:e,Reader:class extends Xr{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return Mi(this,t,{Reader:Fi(e),options:r})}addFileSystemEntry(t,e={}){return ki(this,t,e)}addFileSystemHandle(t,e={}){return ki(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),Mi(this,t.name,{data:t,Reader:()=>({readable:t.stream(),size:t.size}),options:e,uncompressedSize:t.size})}We(t,e){return Mi(this,t,e)}importBlob(t,e){return this.importZip(new Or(t),e)}importData64URI(t,e){return this.importZip(new Ar(t),e)}importUint8Array(t,e){return this.importZip(new Qr(t),e)}importHttpContent(t,e){return this.importZip(new Xr(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new Tr(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new Fr(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new $r,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return(async(t,e,r)=>{const n=Ai([t],"uncompressedSize"),a=new Map;return await s(t,e),e;async function s(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>i(t,e)))).find(t=>"rejected"==t.status);if(r)throw r.reason}else for(const r of t.children)await i(r,e)}async function i(t,e){try{if(t.directory){const r=await e.getDirectoryHandle(t.name,{create:!0});await s(t,r)}else{const s=await e.getFileHandle(t.name,{create:!0}),i=await s.createWritable();await t.getData({writable:i},Object.assign({},r,{onprogress:async e=>{if(r.onprogress){a.set(t.id,e);try{await r.onprogress(Array.from(a.values()).reduce((t,e)=>t+e,0),n)}catch{}}}}))}}catch(e){throw Error(e.message+(t?" ("+t.name+")":""),{cause:e})}}})(this,t,e)}async importZip(t,e={}){await an(t);const r=new ga(t,e),n=[],a=await r.getEntries();for(const t of a){let r=this;try{const a=t.filename.split("/"),s=a.pop();if(a.forEach(t=>{const e=r;if(r=r.getChildByName(t),r){if(!r.directory)throw Error(bi)}else r=new Ri(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(bi)}else e=new Ri(this.fs,s,{data:null},r),n.push(e);e==this||e.data||(e.data=t)}else n.push(Mi(r,s,{data:t,Reader:Di(Object.assign({},e)),uncompressedSize: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===D&&(e.bufferedWrite=!0);const[n]=await Promise.all([Oi(r,e.readerOptions),an(t)]),a=new Fs(t,e);return await(async(t,e,r,n,a)=>{const s=e,i=new Map;await async function t(e,o){async function c(o){const c=n.relativePath?o.getRelativeName(s):o.getFullname(),l=o.options||{};let d={};if(o.data instanceof Vn){const{externalFileAttributes:t,versionMadeBy:e,comment:r,lastModDate:a,creationDate:s,lastAccessDate:i,uncompressedSize:c,encrypted:l,zipCrypto:u,crc32:f,compressionMethod:w,extraFieldAES:h,internalFileAttributes:p,extraField:m,uid:y,gid:b}=o.data;d={externalFileAttributes:t,versionMadeBy:e,comment:r,lastModDate:a,creationDate:s,lastAccessDate:i,internalFileAttributes:p};const S=(t=>{if(t){const e=new Map;if(t.forEach((t,r)=>{Ei.has(r)||e.set(r,t.data)}),e.size)return e}})(m);if(S&&(d.extraField=S),y===D&&b===D||Object.assign(d,{uid:y,gid:b,unixExtraFieldType:n.unixExtraFieldType||"infozip"}),o.passThrough){let t,e;0===w&&(t=0),h&&(e=h.strength),d=Object.assign(d,{passThrough:!0,encrypted:l,zipCrypto:u,crc32:f,uncompressedSize:c,level:t,encryptionStrength:e,compressionMethod:w})}}await e.add(c,a.get(o),Object.assign({},n,d,l,{directory:o.directory,onprogress:async t=>{if(n.onprogress){i.set(c,t);try{await n.onprogress(Array.from(i.values()).reduce((t,e)=>t+e),r)}catch{}}}})),await t(e,o)}await(async()=>{if(n.bufferedWrite){const t=(await Promise.allSettled(o.children.map(c))).find(t=>"rejected"==t.status);if(t)throw t.reason}else for(const t of o.children)await c(t)})()}(t,e)})(a,r,Ai([r],"uncompressedSize"),e,n),await a.close(),t.getData?t.getData():t.writable}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}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)}}const zi={FS:class{constructor(){vi(this)}get children(){return this.root.children}remove(t){Ti(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=D}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(bi)}else Ti(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)}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)}We(t,e){return this.root.We(t,e)}importBlob(t,e){return vi(this),this.root.importBlob(t,e)}importData64URI(t,e){return vi(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return vi(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return vi(this),this.root.importHttpContent(t,e)}importReadable(t,e){return vi(this),this.root.importReadable(t,e)}importZip(t,e){return vi(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)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}},ZipDirectoryEntry:Ri,ZipFileEntry:xi};function Ai(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=t[e]||0;for(const e of t.children)n.push(e)}return r}function Fi(t){let e;return()=>{if(e)throw Error(Si);return e=!0,{readable:t}}}function Di(t){return class extends Rr{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this;e.size=e.entry.uncompressedSize;const r=await e.entry.getData(new Tr,Object.assign({},t,e.options));e.data=r,e._e=new Or(r),super.init()}readUint8Array(t,e){return this._e.readUint8Array(t,e)}}}function Ui(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function Oi(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=Ui(t.Reader,t.data,e);a.set(t,r);try{await an(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==D&&(t.uncompressedSize=r.size)})),a}function Ti(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function ki(t,e,r){return async function t(e,n,a){if(n)try{if((n.isFile||n.isDirectory)&&(n=await Ci(n)),"file"==n.kind){const t=await n.getFile();a.push(e.We(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 r=e.addDirectory(n.name);a.push(r);for await(const e of n.values())await t(r,e,a)}}catch(t){const e=t.message+(n?" ("+n.name+")":"");throw Error(e,{cause:t})}return a}(t,e,[])}async function Ci(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 Ci(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 vi(t){t.entries=[],t.Pe=0,t.root=new Ri(t)}function Mi(t,e,r,n){if(t.directory)return n?new Ri(t.fs,e,r,t):new xi(t.fs,e,r,t);throw Error("Parent entry is not a directory")}export{Or as BlobReader,Tr as BlobWriter,Ar as Data64URIReader,Fr as Data64URIWriter,pa as ERR_AMBIGUOUS_ARCHIVE,aa as ERR_BAD_FORMAT,oa as ERR_CENTRAL_DIRECTORY_NOT_FOUND,Xa as ERR_DUPLICATED_NAME,da as ERR_ENCRYPTED,ma as ERR_ENCRYPTED_CENTRAL_DIRECTORY,bi as ERR_ENTRY_EXISTS,ia as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,sa as ERR_EOCDR_NOT_FOUND,la as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,ur as ERR_HTTP_RANGE,fr as ERR_HTTP_RESOURCE_CHANGED,xt as ERR_INVALID_AUTHENTICATION_CODE,B as ERR_INVALID_CODEC_DEFINITION,Z as ERR_INVALID_CODEC_MODULE,Ja as ERR_INVALID_COMMENT,ue as ERR_INVALID_COMPRESSED_DATA,fe as ERR_INVALID_CRC32,es as ERR_INVALID_ENCRYPTION_STRENGTH,Qa as ERR_INVALID_ENTRY_COMMENT,$a as ERR_INVALID_ENTRY_NAME,as as ERR_INVALID_EXTRAFIELD_DATA,ns as ERR_INVALID_EXTRAFIELD_TYPE,hs as ERR_INVALID_GID,bs as ERR_INVALID_MSDOS_ATTRIBUTES,Ss as ERR_INVALID_MSDOS_DATA,Et as ERR_INVALID_PASSWORD,gt as ERR_INVALID_SIGNATURE,Es as ERR_INVALID_SIGNATURE_DATA,ws as ERR_INVALID_UID,de as ERR_INVALID_UNCOMPRESSED_SIZE,ms as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,ys as ERR_INVALID_UNIX_ID_SIZE,ps as ERR_INVALID_UNIX_MODE,ts as ERR_INVALID_VERSION,wr as ERR_ITERATOR_COMPLETED_TOO_SOON,ca as ERR_LOCAL_FILE_HEADER_NOT_FOUND,ha as ERR_OVERLAPPING_ENTRY,Si as ERR_READABLE_CONSUMED,V as ERR_RESERVED_COMPRESSION_METHOD,wa as ERR_SPLIT_ZIP_FILE,us as ERR_UNDEFINED_READER,ds as ERR_UNDEFINED_UNCOMPRESSED_SIZE,fa as ERR_UNSUPPORTED_COMPRESSION,si as ERR_UNSUPPORTED_CONTEXT,zt as ERR_UNSUPPORTED_CRYPTO_API,ua as ERR_UNSUPPORTED_ENCRYPTION,rs as ERR_UNSUPPORTED_ENCRYPTION_USDZ,ls as ERR_UNSUPPORTED_FORMAT,Me as ERR_WORKER_STARTUP_TIMEOUT,hr as ERR_WRITER_NOT_INITIALIZED,fs as ERR_ZIP_NOT_EMPTY,Jr as HttpRangeReader,Xr as HttpReader,Rr as Reader,tn as SplitDataReader,en as SplitDataWriter,kr as TextReader,Cr as TextWriter,Qr as Uint8ArrayReader,$r as Uint8ArrayWriter,zr as Writer,ga as ZipReader,xa as ZipReaderStream,Fs as ZipWriter,Ds as ZipWriterStream,P as configure,ri as createBlobTempStream,ti as createOPFSTempStream,ii as createSyncAccessHandleTempStream,zi as fs,Js as getMimeType,G as registerCodec,L as resetConfiguration,yi as terminateWorkers,X as unregisterCodec};
|