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