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