@zip.js/zip.js 2.8.57 → 2.8.59

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