@zip.js/zip.js 2.8.52 → 2.8.54

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