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