@nocobase/plugin-backup-restore 2.4.0-alpha.8 → 2.4.0-alpha.9

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.
@@ -10,14 +10,14 @@
10
10
  module.exports = {
11
11
  "@ant-design/icons": "5.6.1",
12
12
  "@formily/antd-v5": "1.2.3",
13
- "@nocobase/client": "2.4.0-alpha.8",
13
+ "@nocobase/client": "2.4.0-alpha.9",
14
14
  "antd": "5.24.2",
15
15
  "react": "18.2.0",
16
- "@nocobase/server": "2.4.0-alpha.8",
17
- "@nocobase/utils": "2.4.0-alpha.8",
18
- "@nocobase/database": "2.4.0-alpha.8",
16
+ "@nocobase/server": "2.4.0-alpha.9",
17
+ "@nocobase/utils": "2.4.0-alpha.9",
18
+ "@nocobase/database": "2.4.0-alpha.9",
19
19
  "dayjs": "1.11.13",
20
20
  "lodash": "4.18.1",
21
21
  "react-i18next": "11.18.6",
22
- "@nocobase/actions": "2.4.0-alpha.8"
22
+ "@nocobase/actions": "2.4.0-alpha.9"
23
23
  };
@@ -1 +1 @@
1
- {"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2026-09-24T07:20:40.732Z"}
1
+ {"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2026-09-30T16:03:18.225Z"}
@@ -0,0 +1,3 @@
1
+ import{createRequire as r}from"module";var n={4779:(r,n,a)=>{n.formatArgs=formatArgs;n.save=save;n.load=load;n.useColors=useColors;n.storage=localstorage();n.destroy=(()=>{let r=false;return()=>{if(!r){r=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let r;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(n){n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff);if(!this.useColors){return}const a="color: "+this.color;n.splice(1,0,a,"color: inherit");let s=0;let u=0;n[0].replace(/%[a-zA-Z%]/g,(r=>{if(r==="%%"){return}s++;if(r==="%c"){u=s}}));n.splice(u,0,a)}n.log=console.debug||console.log||(()=>{});function save(r){try{if(r){n.storage.setItem("debug",r)}else{n.storage.removeItem("debug")}}catch(r){}}function load(){let r;try{r=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch(r){}if(!r&&typeof process!=="undefined"&&"env"in process){r=process.env.DEBUG}return r}function localstorage(){try{return localStorage}catch(r){}}r.exports=a(2725)(n);const{formatters:s}=r.exports;s.j=function(r){try{return JSON.stringify(r)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}},2725:(r,n,a)=>{function setup(r){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=a(900);createDebug.destroy=destroy;Object.keys(r).forEach((n=>{createDebug[n]=r[n]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(r){let n=0;for(let a=0;a<r.length;a++){n=(n<<5)-n+r.charCodeAt(a);n|=0}return createDebug.colors[Math.abs(n)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(r){let n;let a=null;let s;let u;function debug(...r){if(!debug.enabled){return}const a=debug;const s=Number(new Date);const u=s-(n||s);a.diff=u;a.prev=n;a.curr=s;n=s;r[0]=createDebug.coerce(r[0]);if(typeof r[0]!=="string"){r.unshift("%O")}let l=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if(n==="%%"){return"%"}l++;const u=createDebug.formatters[s];if(typeof u==="function"){const s=r[l];n=u.call(a,s);r.splice(l,1);l--}return n}));createDebug.formatArgs.call(a,r);const d=a.log||createDebug.log;d.apply(a,r)}debug.namespace=r;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(r);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(a!==null){return a}if(s!==createDebug.namespaces){s=createDebug.namespaces;u=createDebug.enabled(r)}return u},set:r=>{a=r}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(r,n){const a=createDebug(this.namespace+(typeof n==="undefined"?":":n)+r);a.log=this.log;return a}function enable(r){createDebug.save(r);createDebug.namespaces=r;createDebug.names=[];createDebug.skips=[];const n=(typeof r==="string"?r:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const r of n){if(r[0]==="-"){createDebug.skips.push(r.slice(1))}else{createDebug.names.push(r)}}}function matchesTemplate(r,n){let a=0;let s=0;let u=-1;let l=0;while(a<r.length){if(s<n.length&&(n[s]===r[a]||n[s]==="*")){if(n[s]==="*"){u=s;l=a;s++}else{a++;s++}}else if(u!==-1){s=u+1;l++;a=l}else{return false}}while(s<n.length&&n[s]==="*"){s++}return s===n.length}function disable(){const r=[...createDebug.names,...createDebug.skips.map((r=>"-"+r))].join(",");createDebug.enable("");return r}function enabled(r){for(const n of createDebug.skips){if(matchesTemplate(r,n)){return false}}for(const n of createDebug.names){if(matchesTemplate(r,n)){return true}}return false}function coerce(r){if(r instanceof Error){return r.stack||r.message}return r}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}r.exports=setup},6657:(r,n,a)=>{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){r.exports=a(4779)}else{r.exports=a(6128)}},6128:(r,n,a)=>{const s=a(6224);const u=a(3837);n.init=init;n.log=log;n.formatArgs=formatArgs;n.save=save;n.load=load;n.useColors=useColors;n.destroy=u.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");n.colors=[6,2,3,4,5,1];try{const r=a(9318);if(r&&(r.stderr||r).level>=2){n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(r){}n.inspectOpts=Object.keys(process.env).filter((r=>/^debug_/i.test(r))).reduce(((r,n)=>{const a=n.substring(6).toLowerCase().replace(/_([a-z])/g,((r,n)=>n.toUpperCase()));let s=process.env[n];if(/^(yes|on|true|enabled)$/i.test(s)){s=true}else if(/^(no|off|false|disabled)$/i.test(s)){s=false}else if(s==="null"){s=null}else{s=Number(s)}r[a]=s;return r}),{});function useColors(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):s.isatty(process.stderr.fd)}function formatArgs(n){const{namespace:a,useColors:s}=this;if(s){const s=this.color;const u="[3"+(s<8?s:"8;5;"+s);const l=` ${u};1m${a} `;n[0]=l+n[0].split("\n").join("\n"+l);n.push(u+"m+"+r.exports.humanize(this.diff)+"")}else{n[0]=getDate()+a+" "+n[0]}}function getDate(){if(n.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...r){return process.stderr.write(u.formatWithOptions(n.inspectOpts,...r)+"\n")}function save(r){if(r){process.env.DEBUG=r}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(r){r.inspectOpts={};const a=Object.keys(n.inspectOpts);for(let s=0;s<a.length;s++){r.inspectOpts[a[s]]=n.inspectOpts[a[s]]}}r.exports=a(2725)(n);const{formatters:l}=r.exports;l.o=function(r){this.inspectOpts.colors=this.useColors;return u.inspect(r,this.inspectOpts).split("\n").map((r=>r.trim())).join(" ")};l.O=function(r){this.inspectOpts.colors=this.useColors;return u.inspect(r,this.inspectOpts)}},3644:(r,n,a)=>{const s={S_IFMT:61440,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960};try{r.exports=a(7147).constants||s}catch{r.exports=s}},5827:(r,n,a)=>{const{Writable:s,Readable:u,getStreamError:l}=a(5147);const d=a(2958);const p=a(3497);const m=a(7448);const g=p.alloc(0);class BufferList{constructor(){this.buffered=0;this.shifted=0;this.queue=new d;this._offset=0}push(r){this.buffered+=r.byteLength;this.queue.push(r)}shiftFirst(r){return this._buffered===0?null:this._next(r)}shift(r){if(r>this.buffered)return null;if(r===0)return g;let n=this._next(r);if(r===n.byteLength)return n;const a=[n];while((r-=n.byteLength)>0){n=this._next(r);a.push(n)}return p.concat(a)}_next(r){const n=this.queue.peek();const a=n.byteLength-this._offset;if(r>=a){const r=this._offset?n.subarray(this._offset,n.byteLength):n;this.queue.shift();this._offset=0;this.buffered-=a;this.shifted+=a;return r}this.buffered-=r;this.shifted+=r;return n.subarray(this._offset,this._offset+=r)}}class Source extends u{constructor(r,n,a){super();this.header=n;this.offset=a;this._parent=r}_read(r){if(this.header.size===0){this.push(null)}if(this._parent._stream===this){this._parent._update()}r(null)}_predestroy(){this._parent.destroy(l(this))}_detach(){if(this._parent._stream===this){this._parent._stream=null;this._parent._missing=overflow(this.header.size);this._parent._update()}}_destroy(r){this._detach();r(null)}}class Extract extends s{constructor(r){super(r);if(!r)r={};this._buffer=new BufferList;this._offset=0;this._header=null;this._stream=null;this._missing=0;this._longHeader=false;this._callback=noop;this._locked=false;this._finished=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;this._filenameEncoding=r.filenameEncoding||"utf-8";this._allowUnknownFormat=!!r.allowUnknownFormat;this._unlockBound=this._unlock.bind(this)}_unlock(r){this._locked=false;if(r){this.destroy(r);this._continueWrite(r);return}this._update()}_consumeHeader(){if(this._locked)return false;this._offset=this._buffer.shifted;try{this._header=m.decode(this._buffer.shift(512),this._filenameEncoding,this._allowUnknownFormat)}catch(r){this._continueWrite(r);return false}if(!this._header)return true;switch(this._header.type){case"gnu-long-path":case"gnu-long-link-path":case"pax-global-header":case"pax-header":this._longHeader=true;this._missing=this._header.size;return true}this._locked=true;this._applyLongHeaders();if(this._header.size===0||this._header.type==="directory"){this.emit("entry",this._header,this._createStream(),this._unlockBound);return true}this._stream=this._createStream();this._missing=this._header.size;this.emit("entry",this._header,this._stream,this._unlockBound);return true}_applyLongHeaders(){if(this._gnuLongPath){this._header.name=this._gnuLongPath;this._gnuLongPath=null}if(this._gnuLongLinkPath){this._header.linkname=this._gnuLongLinkPath;this._gnuLongLinkPath=null}if(this._pax){if(this._pax.path)this._header.name=this._pax.path;if(this._pax.linkpath)this._header.linkname=this._pax.linkpath;if(this._pax.size)this._header.size=parseInt(this._pax.size,10);this._header.pax=this._pax;this._pax=null}}_decodeLongHeader(r){switch(this._header.type){case"gnu-long-path":this._gnuLongPath=m.decodeLongPath(r,this._filenameEncoding);break;case"gnu-long-link-path":this._gnuLongLinkPath=m.decodeLongPath(r,this._filenameEncoding);break;case"pax-global-header":this._paxGlobal=m.decodePax(r);break;case"pax-header":this._pax=this._paxGlobal===null?m.decodePax(r):Object.assign({},this._paxGlobal,m.decodePax(r));break}}_consumeLongHeader(){this._longHeader=false;this._missing=overflow(this._header.size);const r=this._buffer.shift(this._header.size);try{this._decodeLongHeader(r)}catch(r){this._continueWrite(r);return false}return true}_consumeStream(){const r=this._buffer.shiftFirst(this._missing);if(r===null)return false;this._missing-=r.byteLength;const n=this._stream.push(r);if(this._missing===0){this._stream.push(null);if(n)this._stream._detach();return n&&this._locked===false}return n}_createStream(){return new Source(this,this._header,this._offset)}_update(){while(this._buffer.buffered>0&&!this.destroying){if(this._missing>0){if(this._stream!==null){if(this._consumeStream()===false)return;continue}if(this._longHeader===true){if(this._missing>this._buffer.buffered)break;if(this._consumeLongHeader()===false)return false;continue}const r=this._buffer.shiftFirst(this._missing);if(r!==null)this._missing-=r.byteLength;continue}if(this._buffer.buffered<512)break;if(this._stream!==null||this._consumeHeader()===false)return}this._continueWrite(null)}_continueWrite(r){const n=this._callback;this._callback=noop;n(r)}_write(r,n){this._callback=n;this._buffer.push(r);this._update()}_final(r){this._finished=this._missing===0&&this._buffer.buffered===0;r(this._finished?null:new Error("Unexpected end of data"))}_predestroy(){this._continueWrite(null)}_destroy(r){if(this._stream)this._stream.destroy(l(this));r(null)}[Symbol.asyncIterator](){let r=null;let n=null;let a=null;let s=null;let u=null;const l=this;this.on("entry",onentry);this.on("error",(n=>{r=n}));this.on("close",onclose);return{[Symbol.asyncIterator](){return this},next(){return new Promise(onnext)},return(){return destroy(null)},throw(r){return destroy(r)}};function consumeCallback(r){if(!u)return;const n=u;u=null;n(r)}function onnext(u,d){if(r){return d(r)}if(s){u({value:s,done:false});s=null;return}n=u;a=d;consumeCallback(null);if(l._finished&&n){n({value:undefined,done:true});n=a=null}}function onentry(r,l,d){u=d;l.on("error",noop);if(n){n({value:l,done:false});n=a=null}else{s=l}}function onclose(){consumeCallback(r);if(!n)return;if(r)a(r);else n({value:undefined,done:true});n=a=null}function destroy(r){l.destroy(r);consumeCallback(r);return new Promise(((n,a)=>{if(l.destroyed)return n({value:undefined,done:true});l.once("close",(function(){if(r)a(r);else n({value:undefined,done:true})}))}))}}}r.exports=function extract(r){return new Extract(r)};function noop(){}function overflow(r){r&=511;return r&&512-r}},7448:(r,n,a)=>{const s=a(3497);const u="0000000000000000000";const l="7777777777777777777";const d="0".charCodeAt(0);const p=s.from([117,115,116,97,114,0]);const m=s.from([d,d]);const g=s.from([117,115,116,97,114,32]);const y=s.from([32,0]);const b=4095;const w=257;const x=263;n.decodeLongPath=function decodeLongPath(r,n){return decodeStr(r,0,r.length,n)};n.encodePax=function encodePax(r){let n="";if(r.name)n+=addLength(" path="+r.name+"\n");if(r.linkname)n+=addLength(" linkpath="+r.linkname+"\n");const a=r.pax;if(a){for(const r in a){n+=addLength(" "+r+"="+a[r]+"\n")}}return s.from(n)};n.decodePax=function decodePax(r){const n={};while(r.length){let a=0;while(a<r.length&&r[a]!==32)a++;const u=parseInt(s.toString(r.subarray(0,a)),10);if(!u)return n;const l=s.toString(r.subarray(a+1,u-1));const d=l.indexOf("=");if(d===-1)return n;n[l.slice(0,d)]=l.slice(d+1);r=r.subarray(u)}return n};n.encode=function encode(r){const n=s.alloc(512);let a=r.name;let u="";if(r.typeflag===5&&a[a.length-1]!=="/")a+="/";if(s.byteLength(a)!==a.length)return null;while(s.byteLength(a)>100){const r=a.indexOf("/");if(r===-1)return null;u+=u?"/"+a.slice(0,r):a.slice(0,r);a=a.slice(r+1)}if(s.byteLength(a)>100||s.byteLength(u)>155)return null;if(r.linkname&&s.byteLength(r.linkname)>100)return null;s.write(n,a);s.write(n,encodeOct(r.mode&b,6),100);s.write(n,encodeOct(r.uid,6),108);s.write(n,encodeOct(r.gid,6),116);encodeSize(r.size,n,124);s.write(n,encodeOct(r.mtime.getTime()/1e3|0,11),136);n[156]=d+toTypeflag(r.type);if(r.linkname)s.write(n,r.linkname,157);s.copy(p,n,w);s.copy(m,n,x);if(r.uname)s.write(n,r.uname,265);if(r.gname)s.write(n,r.gname,297);s.write(n,encodeOct(r.devmajor||0,6),329);s.write(n,encodeOct(r.devminor||0,6),337);if(u)s.write(n,u,345);s.write(n,encodeOct(cksum(n),6),148);return n};n.decode=function decode(r,n,a){let s=r[156]===0?0:r[156]-d;let u=decodeStr(r,0,100,n);const l=decodeOct(r,100,8);const p=decodeOct(r,108,8);const m=decodeOct(r,116,8);const g=decodeOct(r,124,12);const y=decodeOct(r,136,12);const b=toType(s);const w=r[157]===0?null:decodeStr(r,157,100,n);const x=decodeStr(r,265,32);const _=decodeStr(r,297,32);const S=decodeOct(r,329,8);const v=decodeOct(r,337,8);const k=cksum(r);if(k===8*32)return null;if(k!==decodeOct(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(isUSTAR(r)){if(r[345])u=decodeStr(r,345,155,n)+"/"+u}else if(isGNU(r)){}else{if(!a){throw new Error("Invalid tar header: unknown format.")}}if(s===0&&u&&u[u.length-1]==="/")s=5;return{name:u,mode:l,uid:p,gid:m,size:g,mtime:new Date(1e3*y),type:b,linkname:w,uname:x,gname:_,devmajor:S,devminor:v,pax:null}};function isUSTAR(r){return s.equals(p,r.subarray(w,w+6))}function isGNU(r){return s.equals(g,r.subarray(w,w+6))&&s.equals(y,r.subarray(x,x+2))}function clamp(r,n,a){if(typeof r!=="number")return a;r=~~r;if(r>=n)return n;if(r>=0)return r;r+=n;if(r>=0)return r;return 0}function toType(r){switch(r){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function toTypeflag(r){switch(r){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function indexOf(r,n,a,s){for(;a<s;a++){if(r[a]===n)return a}return s}function cksum(r){let n=8*32;for(let a=0;a<148;a++)n+=r[a];for(let a=156;a<512;a++)n+=r[a];return n}function encodeOct(r,n){r=r.toString(8);if(r.length>n)return l.slice(0,n)+" ";return u.slice(0,n-r.length)+r+" "}function encodeSizeBin(r,n,a){n[a]=128;for(let s=11;s>0;s--){n[a+s]=r&255;r=Math.floor(r/256)}}function encodeSize(r,n,a){if(r.toString(8).length>11){encodeSizeBin(r,n,a)}else{s.write(n,encodeOct(r,11),a)}}function parse256(r){let n;if(r[0]===128)n=true;else if(r[0]===255)n=false;else return null;const a=[];let s;for(s=r.length-1;s>0;s--){const u=r[s];if(n)a.push(u);else a.push(255-u)}let u=0;const l=a.length;for(s=0;s<l;s++){u+=a[s]*Math.pow(256,s)}return n?u:-1*u}function decodeOct(r,n,a){r=r.subarray(n,n+a);n=0;if(r[n]&128){return parse256(r)}else{while(n<r.length&&r[n]===32)n++;const a=clamp(indexOf(r,32,n,r.length),r.length,r.length);while(n<a&&r[n]===0)n++;if(a===n)return 0;return parseInt(s.toString(r.subarray(n,a)),8)}}function decodeStr(r,n,a,u){return s.toString(r.subarray(n,indexOf(r,0,n,n+a)),u)}function addLength(r){const n=s.byteLength(r);let a=Math.floor(Math.log(n)/Math.log(10))+1;if(n+a>=Math.pow(10,a))a++;return n+a+r}},2703:(r,n,a)=>{n.extract=a(5827);n.pack=a(9629)},9629:(r,n,a)=>{const{Readable:s,Writable:u,getStreamError:l}=a(5147);const d=a(3497);const p=a(3644);const m=a(7448);const g=493;const y=420;const b=d.alloc(1024);class Sink extends u{constructor(r,n,a){super({mapWritable:mapWritable,eagerOpen:true});this.written=0;this.header=n;this._callback=a;this._linkname=null;this._isLinkname=n.type==="symlink"&&!n.linkname;this._isVoid=n.type!=="file"&&n.type!=="contiguous-file";this._finished=false;this._pack=r;this._openCallback=null;if(this._pack._stream===null)this._pack._stream=this;else this._pack._pending.push(this)}_open(r){this._openCallback=r;if(this._pack._stream===this)this._continueOpen()}_continuePack(r){if(this._callback===null)return;const n=this._callback;this._callback=null;n(r)}_continueOpen(){if(this._pack._stream===null)this._pack._stream=this;const r=this._openCallback;this._openCallback=null;if(r===null)return;if(this._pack.destroying)return r(new Error("pack stream destroyed"));if(this._pack._finalized)return r(new Error("pack stream is already finalized"));this._pack._stream=this;if(!this._isLinkname){this._pack._encode(this.header)}if(this._isVoid){this._finish();this._continuePack(null)}r(null)}_write(r,n){if(this._isLinkname){this._linkname=this._linkname?d.concat([this._linkname,r]):r;return n(null)}if(this._isVoid){if(r.byteLength>0){return n(new Error("No body allowed for this entry"))}return n()}this.written+=r.byteLength;if(this._pack.push(r))return n();this._pack._drain=n}_finish(){if(this._finished)return;this._finished=true;if(this._isLinkname){this.header.linkname=this._linkname?d.toString(this._linkname,"utf-8"):"";this._pack._encode(this.header)}overflow(this._pack,this.header.size);this._pack._done(this)}_final(r){if(this.written!==this.header.size){return r(new Error("Size mismatch"))}this._finish();r(null)}_getError(){return l(this)||new Error("tar entry destroyed")}_predestroy(){this._pack.destroy(this._getError())}_destroy(r){this._pack._done(this);this._continuePack(this._finished?null:this._getError());r()}}class Pack extends s{constructor(r){super(r);this._drain=noop;this._finalized=false;this._finalizing=false;this._pending=[];this._stream=null}entry(r,n,a){if(this._finalized||this.destroying)throw new Error("already finalized or destroyed");if(typeof n==="function"){a=n;n=null}if(!a)a=noop;if(!r.size||r.type==="symlink")r.size=0;if(!r.type)r.type=modeToType(r.mode);if(!r.mode)r.mode=r.type==="directory"?g:y;if(!r.uid)r.uid=0;if(!r.gid)r.gid=0;if(!r.mtime)r.mtime=new Date;if(typeof n==="string")n=d.from(n);const s=new Sink(this,r,a);if(d.isBuffer(n)){r.size=n.byteLength;s.write(n);s.end();return s}if(s._isVoid){return s}return s}finalize(){if(this._stream||this._pending.length>0){this._finalizing=true;return}if(this._finalized)return;this._finalized=true;this.push(b);this.push(null)}_done(r){if(r!==this._stream)return;this._stream=null;if(this._finalizing)this.finalize();if(this._pending.length)this._pending.shift()._continueOpen()}_encode(r){if(!r.pax){const n=m.encode(r);if(n){this.push(n);return}}this._encodePax(r)}_encodePax(r){const n=m.encodePax({name:r.name,linkname:r.linkname,pax:r.pax});const a={name:"PaxHeader",mode:r.mode,uid:r.uid,gid:r.gid,size:n.byteLength,mtime:r.mtime,type:"pax-header",linkname:r.linkname&&"PaxHeader",uname:r.uname,gname:r.gname,devmajor:r.devmajor,devminor:r.devminor};this.push(m.encode(a));this.push(n);overflow(this,n.byteLength);a.size=r.size;a.type=r.type;this.push(m.encode(a))}_doDrain(){const r=this._drain;this._drain=noop;r()}_predestroy(){const r=l(this);if(this._stream)this._stream.destroy(r);while(this._pending.length){const n=this._pending.shift();n.destroy(r);n._continueOpen()}this._doDrain()}_read(r){this._doDrain();r()}}r.exports=function pack(r){return new Pack(r)};function modeToType(r){switch(r&p.S_IFMT){case p.S_IFBLK:return"block-device";case p.S_IFCHR:return"character-device";case p.S_IFDIR:return"directory";case p.S_IFIFO:return"fifo";case p.S_IFLNK:return"symlink"}return"file"}function noop(){}function overflow(r,n){n&=511;if(n)r.push(b.subarray(0,512-n))}function mapWritable(r){return d.isBuffer(r)?r:d.from(r)}},8060:r=>{const n=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function crc32(r){let a=-1;for(let s of r){a=n[(a^s)&255]^a>>>8}return(a^-1)>>>0}r.exports=crc32},3008:(r,n,a)=>{var s=a(7147);var u=a(3837);var l=a(2781);var d=l.Readable;var p=l.PassThrough;var m=a(4833);var g=a(2361).EventEmitter;n.BufferSlicer=BufferSlicer;n.FdSlicer=FdSlicer;u.inherits(FdSlicer,g);function FdSlicer(r){g.call(this);this.fd=r;this.pend=new m;this.pend.max=1;this.refCount=0}FdSlicer.prototype.read=function(r,n,a,u,l){var d=this;d.pend.go((function(p){s.read(d.fd,r,n,a,u,(function(r,n,a){p();l(r,n,a)}))}))};FdSlicer.prototype.createReadStream=function(r){return new ReadStream(this,r)};FdSlicer.prototype.ref=function(){this.refCount+=1};FdSlicer.prototype.unref=function(){var r=this;r.refCount-=1;if(r.refCount<0)throw new Error("invalid unref");if(r.refCount>0)return;s.close(r.fd,onCloseDone);function onCloseDone(n){if(n){r.emit("error",n)}else{r.emit("close")}}};u.inherits(ReadStream,d);function ReadStream(r,n){n=n||{};d.call(this,n);this.context=r;this.context.ref();this.start=n.start||0;this.endOffset=n.end;this.pos=this.start}ReadStream.prototype._read=function(r){var n=this;var a=Math.min(n._readableState.highWaterMark,r);if(n.endOffset!=null){a=Math.min(a,n.endOffset-n.pos)}if(a<=0){n.push(null);this._cleanup();return}n.context.pend.go((function(r){var u=Buffer.allocUnsafe(a);s.read(n.context.fd,u,0,a,n.pos,(function(a,s){if(a){n.destroy(a)}else if(s===0){n.push(null);n._cleanup()}else{n.pos+=s;n.push(u.slice(0,s))}r()}))}))};ReadStream.prototype._destroy=function(r,n){this._cleanup();n(r)};ReadStream.prototype._cleanup=function(){if(this.context!=null){this.context.unref();this.context=null}};u.inherits(BufferSlicer,g);function BufferSlicer(r){g.call(this);this.refCount=0;this.buffer=r}BufferSlicer.prototype.read=function(r,n,a,s,u){if(!(0<=n&&n<=r.length))throw new RangeError("offset outside buffer: 0 <= "+n+" <= "+r.length);if(s<0)throw new RangeError("position is negative: "+s);if(n+a>r.length){a=r.length-n}if(s+a>this.buffer.length){a=this.buffer.length-s}if(a<=0){setImmediate((function(){u(null,0)}));return}this.buffer.copy(r,n,s,s+a);setImmediate((function(){u(null,a)}))};BufferSlicer.prototype.createReadStream=function(r){r=r||{};var n=new p(r);n.start=r.start||0;n.endOffset=r.end;n.pos=n.endOffset||this.buffer.length;var a=this.buffer.slice(n.start,n.pos);var s=65536;var u=0;while(true){var l=u+s;if(l>=a.length){if(u<a.length){n.write(a.slice(u,a.length))}break}n.write(a.slice(u,l));u=l}n.end();return n};BufferSlicer.prototype.ref=function(){this.refCount+=1};BufferSlicer.prototype.unref=function(){this.refCount-=1;if(this.refCount<0){throw new Error("invalid unref")}}},6594:(r,n,a)=>{var s=a(7147);var u=a(9796);var l=a(3008);var d=a(3837);var p=a(2361).EventEmitter;var m=a(2781).Transform;var g=a(2781).PassThrough;var y=a(2781).Writable;const b=typeof u.crc32==="function"?u.crc32:a(8060);n.open=open;n.fromFd=fromFd;n.fromBuffer=fromBuffer;n.fromRandomAccessReader=fromRandomAccessReader;n.openPromise=openPromise;n.fromFdPromise=fromFdPromise;n.fromBufferPromise=fromBufferPromise;n.fromRandomAccessReaderPromise=fromRandomAccessReaderPromise;n.dosDateTimeToDate=dosDateTimeToDate;n.getFileNameLowLevel=getFileNameLowLevel;n.validateFileName=validateFileName;n.parseExtraFields=parseExtraFields;n.ZipFile=ZipFile;n.Entry=Entry;n.LocalFileHeader=LocalFileHeader;n.RandomAccessReader=RandomAccessReader;function openPromise(r,n){return new Promise(((a,s)=>{open(r,{...n,lazyEntries:true},(function(r,n){if(r)return s(r);a(n)}))}))}function fromFdPromise(r,n){return new Promise(((a,s)=>{fromFd(r,{...n,lazyEntries:true},(function(r,n){if(r)return s(r);a(n)}))}))}function fromBufferPromise(r,n){return new Promise(((a,s)=>{fromBuffer(r,{...n,lazyEntries:true},(function(r,n){if(r)return s(r);a(n)}))}))}function fromRandomAccessReaderPromise(r,n,a){return new Promise(((s,u)=>{fromRandomAccessReader(r,n,{...a,lazyEntries:true},(function(r,n){if(r)return u(r);s(n)}))}))}function open(r,n,a){if(typeof n==="function"){a=n;n=null}if(n==null)n={};if(n.autoClose==null)n.autoClose=true;if(n.lazyEntries==null)n.lazyEntries=false;if(n.decodeStrings==null)n.decodeStrings=true;if(n.validateEntrySizes==null)n.validateEntrySizes=true;if(n.strictFileNames==null)n.strictFileNames=false;if(a==null)a=defaultCallback;s.open(r,"r",(function(r,u){if(r)return a(r);fromFd(u,n,(function(r,n){if(r)s.close(u,defaultCallback);a(r,n)}))}))}function fromFd(r,n,a){if(typeof n==="function"){a=n;n=null}if(n==null)n={};if(n.autoClose==null)n.autoClose=false;if(n.lazyEntries==null)n.lazyEntries=false;if(n.decodeStrings==null)n.decodeStrings=true;if(n.validateEntrySizes==null)n.validateEntrySizes=true;if(n.strictFileNames==null)n.strictFileNames=false;if(a==null)a=defaultCallback;s.fstat(r,(function(s,u){if(s)return a(s);var d=new l.FdSlicer(r);fromRandomAccessReader(d,u.size,n,a)}))}function fromBuffer(r,n,a){if(typeof n==="function"){a=n;n=null}if(n==null)n={};n.autoClose=false;if(n.lazyEntries==null)n.lazyEntries=false;if(n.decodeStrings==null)n.decodeStrings=true;if(n.validateEntrySizes==null)n.validateEntrySizes=true;if(n.strictFileNames==null)n.strictFileNames=false;var s=new l.BufferSlicer(r);fromRandomAccessReader(s,r.length,n,a)}function fromRandomAccessReader(r,n,a,s){if(typeof a==="function"){s=a;a=null}if(a==null)a={};if(a.autoClose==null)a.autoClose=true;if(a.lazyEntries==null)a.lazyEntries=false;if(a.decodeStrings==null)a.decodeStrings=true;var u=!!a.decodeStrings;if(a.validateEntrySizes==null)a.validateEntrySizes=true;if(a.strictFileNames==null)a.strictFileNames=false;if(s==null)s=defaultCallback;if(typeof n!=="number")throw new Error("expected totalSize parameter to be a number");if(n>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}r.ref();var l=22;var d=20;var p=65535;var m=Math.min(d+l+p,n);var g=x(m);var y=n-g.length;readAndAssertNoEof(r,g,0,m,y,(function(p){if(p)return s(p);for(var y=m-l;y>=0;y-=1){if(g.readUInt32LE(y)!==101010256)continue;var b=g.subarray(y);var w=b.readUInt16LE(4);var _=b.readUInt16LE(10);var S=b.readUInt32LE(16);var v=b.readUInt16LE(20);var k=b.length-l;if(v!==k){return s(new Error("Invalid comment length. Expected: "+k+". Found: "+v+". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK☺☻` in the comment?"))}var E=u?decodeBuffer(b.subarray(22),false):b.subarray(22);if(y-d>=0&&g.readUInt32LE(y-d)===117853008){var C=g.subarray(y-d,y-d+d);var F=readUInt64LE(C,8);var T=x(56);return readAndAssertNoEof(r,T,0,T.length,F,(function(l){if(l)return s(l);if(T.readUInt32LE(0)!==101075792){return s(new Error("invalid zip64 end of central directory record signature"))}w=T.readUInt32LE(16);if(w!==0){return s(new Error("multi-disk zip files are not supported: found disk number: "+w))}_=readUInt64LE(T,32);S=readUInt64LE(T,48);return s(null,new ZipFile(r,S,n,_,E,a.autoClose,a.lazyEntries,u,a.validateEntrySizes,a.strictFileNames))}))}if(w!==0){return s(new Error("multi-disk zip files are not supported: found disk number: "+w))}return s(null,new ZipFile(r,S,n,_,E,a.autoClose,a.lazyEntries,u,a.validateEntrySizes,a.strictFileNames))}s(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))}))}d.inherits(ZipFile,p);function ZipFile(r,n,a,s,u,l,d,m,g,y){var b=this;p.call(b);b.reader=r;b.reader.on("error",(function(r){emitError(b,r)}));b.reader.once("close",(function(){b.emit("close")}));b.readEntryCursor=n;b.fileSize=a;b.entryCount=s;b.comment=u;b.entriesRead=0;b.autoClose=!!l;b.lazyEntries=!!d;b.decodeStrings=!!m;b.validateEntrySizes=!!g;b.strictFileNames=!!y;b.isOpen=true;b.emittedError=false;b.hasEachEntryBeenCalled=false;if(!b.lazyEntries)b._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(r,n){if(r.autoClose)r.close();emitError(r,n)}function emitError(r,n){if(r.emittedError)return;r.emittedError=true;r.emit("error",n)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var r=this;if(r.entryCount===r.entriesRead){setImmediate((function(){if(r.autoClose)r.close();if(r.emittedError)return;r.emit("end")}));return}if(r.emittedError)return;var n=x(46);readAndAssertNoEof(r.reader,n,0,n.length,r.readEntryCursor,(function(a){if(a)return emitErrorAndAutoClose(r,a);if(r.emittedError)return;var s=new Entry;var u=n.readUInt32LE(0);if(u!==33639248)return emitErrorAndAutoClose(r,new Error("invalid central directory file header signature: 0x"+u.toString(16)));s.versionMadeBy=n.readUInt16LE(4);s.versionNeededToExtract=n.readUInt16LE(6);s.generalPurposeBitFlag=n.readUInt16LE(8);s.compressionMethod=n.readUInt16LE(10);s.lastModFileTime=n.readUInt16LE(12);s.lastModFileDate=n.readUInt16LE(14);s.crc32=n.readUInt32LE(16);s.compressedSize=n.readUInt32LE(20);s.uncompressedSize=n.readUInt32LE(24);s.fileNameLength=n.readUInt16LE(28);s.extraFieldLength=n.readUInt16LE(30);s.fileCommentLength=n.readUInt16LE(32);s.internalFileAttributes=n.readUInt16LE(36);s.externalFileAttributes=n.readUInt32LE(38);s.relativeOffsetOfLocalHeader=n.readUInt32LE(42);if(s.generalPurposeBitFlag&64)return emitErrorAndAutoClose(r,new Error("strong encryption is not supported"));r.readEntryCursor+=46;n=x(s.fileNameLength+s.extraFieldLength+s.fileCommentLength);readAndAssertNoEof(r.reader,n,0,n.length,r.readEntryCursor,(function(a){if(a)return emitErrorAndAutoClose(r,a);if(r.emittedError)return;s.fileNameRaw=n.subarray(0,s.fileNameLength);var u=s.fileNameLength+s.extraFieldLength;s.extraFieldRaw=n.subarray(s.fileNameLength,u);s.fileCommentRaw=n.subarray(u,u+s.fileCommentLength);try{s.extraFields=parseExtraFields(s.extraFieldRaw)}catch(a){return emitErrorAndAutoClose(r,a)}if(r.decodeStrings){var l=(s.generalPurposeBitFlag&2048)!==0;s.fileComment=decodeBuffer(s.fileCommentRaw,l);s.fileName=getFileNameLowLevel(s.generalPurposeBitFlag,s.fileNameRaw,s.extraFields,r.strictFileNames);var d=validateFileName(s.fileName);if(d!=null)return emitErrorAndAutoClose(r,new Error(d))}else{s.fileComment=s.fileCommentRaw;s.fileName=s.fileNameRaw}s.comment=s.fileComment;r.readEntryCursor+=n.length;r.entriesRead+=1;for(var p=0;p<s.extraFields.length;p++){var m=s.extraFields[p];if(m.id!==1)continue;var g=m.data;var y=0;if(s.uncompressedSize===4294967295){if(y+8>g.length){return emitErrorAndAutoClose(r,new Error("zip64 extended information extra field does not include uncompressed size"))}s.uncompressedSize=readUInt64LE(g,y);y+=8}if(s.compressedSize===4294967295){if(y+8>g.length){return emitErrorAndAutoClose(r,new Error("zip64 extended information extra field does not include compressed size"))}s.compressedSize=readUInt64LE(g,y);y+=8}if(s.relativeOffsetOfLocalHeader===4294967295){if(y+8>g.length){return emitErrorAndAutoClose(r,new Error("zip64 extended information extra field does not include relative header offset"))}s.relativeOffsetOfLocalHeader=readUInt64LE(g,y);y+=8}break}if(r.validateEntrySizes&&s.compressionMethod===0){var b=s.uncompressedSize;if(s.isEncrypted()){b+=12}if(s.compressedSize!==b){var w="compressed/uncompressed size mismatch for stored file: "+s.compressedSize+" != "+s.uncompressedSize;return emitErrorAndAutoClose(r,new Error(w))}}r.emit("entry",s);if(!r.lazyEntries)r._readEntry()}))}))};ZipFile.prototype.eachEntry=function(){const r=this;if(!r.lazyEntries)throw new Error("eachEntry() requires lazyEntries: true");if(r.hasEachEntryBeenCalled)throw new Error("eachEntry() must only be called once per ZipFile");r.hasEachEntryBeenCalled=true;let n=null;r.on("entry",onEntry);r.on("end",onEnd);r.on("error",onError);function cleanup(){r.removeListener("entry",onEntry);r.removeListener("end",onEnd);r.removeListener("error",onError);if(r.autoClose)r.close()}function onEntry(r){let{resolve:a}=n;n=null;a({value:r})}function onEnd(){let{resolve:r}=n;n=null;cleanup();r({done:true})}function onError(r){let{reject:a}=n;n=null;cleanup();a(r)}return{[Symbol.asyncIterator](){return this},next(){const a=new Promise(((r,a)=>{if(n!=null)throw new Error("next() called before previous Promise was resolved.");n={resolve:r,reject:a}}));r.readEntry();return a},return(r){cleanup();return Promise.resolve({done:true,value:r})},throw(r){cleanup();return Promise.reject(r)}}};ZipFile.prototype.openReadStream=function(r,n,a){var s=this;var u=0;var l=r.compressedSize;if(a==null){a=n;n=null}if(n==null){n={}}else{if(n.decodeFileData===false){if(n.decrypt!=null){throw new Error("cannot use options.decrypt when options.decodeFileData === false")}if(n.decompress!=null){throw new Error("cannot use options.decompress when options.decodeFileData === false")}}else{if(n.decrypt!=null){if(!r.isEncrypted()){throw new Error("options.decrypt can only be specified for encrypted entries. See also option decodeFileData.")}if(n.decrypt!==false)throw new Error("invalid options.decrypt value: "+n.decrypt);if(r.isCompressed()){if(n.decompress!==false)throw new Error("entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.")}}if(n.decompress!=null){if(!r.isCompressed()){throw new Error("options.decompress can only be specified for compressed entries. See also option decodeFileData.")}if(!(n.decompress===false||n.decompress===true)){throw new Error("invalid options.decompress value: "+n.decompress)}p=n.decompress}}if(n.start!=null){u=n.start;if(u<0)throw new Error("options.start < 0");if(u>r.compressedSize)throw new Error("options.start > entry.compressedSize")}if(n.end!=null){l=n.end;if(l<0)throw new Error("options.end < 0");if(l>r.compressedSize)throw new Error("options.end > entry.compressedSize");if(l<u)throw new Error("options.end < options.start")}}var d=n.decodeFileData===false||(r.compressionMethod===0||r.compressionMethod===8&&n.decompress===false)&&(!r.isEncrypted()||n.decrypt===false);if(n.start!=null||n.end!=null){if(!d)throw new Error("start/end range require options.decodeFileData === false for non-trivial encoded entries.")}if(!s.isOpen)return a(new Error("closed"));if(r.isEncrypted()&&!d){if(n.decrypt!==false)return a(new Error("entry is encrypted, and options.decodeFileData !== false"))}var p;if(d){p=false}else if(r.compressionMethod===8){p=n.decodeFileData!==true}else{return a(new Error("unsupported compression method: "+r.compressionMethod))}s.readLocalFileHeader(r,{minimal:true},(function(n,d){if(n)return a(n);s.openReadStreamLowLevel(d.fileDataStart,r.compressedSize,u,l,p,r.uncompressedSize,a)}))};ZipFile.prototype.openReadStreamLowLevel=function(r,n,a,s,l,d,p){var m=this;var g=r+n;var y=m.reader.createReadStream({start:r+a,end:r+s});var b=y;if(l){var w=false;var x=u.createInflateRaw();y.on("error",(function(r){setImmediate((function(){if(!w)x.emit("error",r)}))}));y.pipe(x);if(m.validateEntrySizes){b=new AssertByteCountStream(d);x.on("error",(function(r){setImmediate((function(){if(!w)b.emit("error",r)}))}));x.pipe(b)}else{b=x}installDestroyFn(b,(function(){w=true;if(x!==b)x.unpipe(b);y.unpipe(x);y.destroy()}))}p(null,b)};ZipFile.prototype.readLocalFileHeader=function(r,n,a){var s=this;if(a==null){a=n;n=null}if(n==null)n={};s.reader.ref();var u=x(30);readAndAssertNoEof(s.reader,u,0,u.length,r.relativeOffsetOfLocalHeader,(function(l){try{if(l)return a(l);var d=u.readUInt32LE(0);if(d!==67324752){return a(new Error("invalid local file header signature: 0x"+d.toString(16)))}var p=u.readUInt16LE(26);var m=u.readUInt16LE(28);var g=r.relativeOffsetOfLocalHeader+30+p+m;if(g+r.compressedSize>s.fileSize){return a(new Error("file data overflows file bounds: "+g+" + "+r.compressedSize+" > "+s.fileSize))}if(n.minimal){return a(null,{fileDataStart:g})}var y=new LocalFileHeader;y.fileDataStart=g;y.versionNeededToExtract=u.readUInt16LE(4);y.generalPurposeBitFlag=u.readUInt16LE(6);y.compressionMethod=u.readUInt16LE(8);y.lastModFileTime=u.readUInt16LE(10);y.lastModFileDate=u.readUInt16LE(12);y.crc32=u.readUInt32LE(14);y.compressedSize=u.readUInt32LE(18);y.uncompressedSize=u.readUInt32LE(22);y.fileNameLength=p;y.extraFieldLength=m;u=x(p+m);s.reader.ref();readAndAssertNoEof(s.reader,u,0,u.length,r.relativeOffsetOfLocalHeader+30,(function(r){try{if(r)return a(r);y.fileName=u.subarray(0,p);y.extraField=u.subarray(p);return a(null,y)}finally{s.reader.unref()}}))}finally{s.reader.unref()}}))};ZipFile.prototype.openReadStreamPromise=function(r,n){return new Promise(((a,s)=>{this.openReadStream(r,n,(function(r,n){if(r)return s(r);a(n)}))}))};ZipFile.prototype.openReadStreamLowLevelPromise=function(r,n,a,s,u,l){return new Promise(((d,p)=>{this.openReadStream(r,n,a,s,u,l,(function(r,n){if(r)return p(r);d(n)}))}))};ZipFile.prototype.readLocalFileHeaderPromise=function(r,n){return new Promise(((a,s)=>{this.readLocalFileHeader(r,n,(function(r,n){if(r)return s(r);a(n)}))}))};function Entry(){}Entry.prototype.getLastModDate=function(r){if(r==null)r={};if(!r.forceDosFormat){for(var n=0;n<this.extraFields.length;n++){var a=this.extraFields[n];if(a.id===21589){var s=a.data;if(s.length<5)continue;var u=s[0];var l=1;if(!(u&l))continue;var d=s.readInt32LE(1);return new Date(d*1e3)}else if(a.id===10){var s=a.data;if(s.length!==32)continue;if(s.readUInt16LE(4)!==1)continue;if(s.readUInt16LE(6)!==24)continue;var p=s.readUInt32LE(8)+4294967296*s.readInt32LE(12);var m=p/1e4-116444736e5;return new Date(m)}}}return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime,r.timezone)};Entry.prototype.canDecodeFileData=function(){return!this.isEncrypted()&&(this.compressionMethod===0||this.compressionMethod===8)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function LocalFileHeader(){}function dosDateTimeToDate(r,n,a){var s=r&31;var u=(r>>5&15)-1;var l=(r>>9&127)+1980;var d=0;var p=(n&31)*2;var m=n>>5&63;var g=n>>11&31;if(a==null||a==="local"){return new Date(l,u,s,g,m,p,d)}else if(a==="UTC"){return new Date(Date.UTC(l,u,s,g,m,p,d))}else{throw new Error("unrecognized options.timezone: "+options.timezone)}}function getFileNameLowLevel(r,n,a,s){var u=null;for(var l=0;l<a.length;l++){var d=a[l];if(d.id===28789){if(d.data.length<6){continue}if(d.data.readUInt8(0)!==1){continue}var p=d.data.readUInt32LE(1);if(b(n)!==p){continue}u=decodeBuffer(d.data.subarray(5),true);break}}if(u==null){var m=(r&2048)!==0;u=decodeBuffer(n,m)}if(!s){u=u.replace(/\\/g,"/")}return u}function validateFileName(r){if(r.indexOf("\\")!==-1){return"invalid characters in fileName: "+r}if(/^[a-zA-Z]:/.test(r)||/^\//.test(r)){return"absolute path: "+r}if(r.split("/").indexOf("..")!==-1){return"invalid relative path: "+r}return null}function parseExtraFields(r){var n=[];var a=0;while(a<r.length-3){var s=r.readUInt16LE(a+0);var u=r.readUInt16LE(a+2);var l=a+4;var d=l+u;if(d>r.length)throw new Error("extra field length exceeds extra field buffer size");var p=r.subarray(l,d);n.push({id:s,data:p});a=d}return n}function readAndAssertNoEof(r,n,a,s,u,l){if(s===0){return setImmediate((function(){l(null,x(0))}))}r.read(n,a,s,u,(function(r,n){if(r)return l(r);if(n<s){return l(new Error("unexpected EOF"))}l()}))}d.inherits(AssertByteCountStream,m);function AssertByteCountStream(r){m.call(this);this.actualByteCount=0;this.expectedByteCount=r}AssertByteCountStream.prototype._transform=function(r,n,a){this.actualByteCount+=r.length;if(this.actualByteCount>this.expectedByteCount){var s="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return a(new Error(s))}a(null,r)};AssertByteCountStream.prototype._flush=function(r){if(this.actualByteCount<this.expectedByteCount){var n="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return r(new Error(n))}r()};d.inherits(RandomAccessReader,p);function RandomAccessReader(){p.call(this);this.refCount=0}RandomAccessReader.prototype.ref=function(){this.refCount+=1};RandomAccessReader.prototype.unref=function(){var r=this;r.refCount-=1;if(r.refCount>0)return;if(r.refCount<0)throw new Error("invalid unref");r.close(onCloseDone);function onCloseDone(n){if(n)return r.emit("error",n);r.emit("close")}};RandomAccessReader.prototype.createReadStream=function(r){if(r==null)r={};var n=r.start;var a=r.end;if(n===a){var s=new g;setImmediate((function(){s.end()}));return s}var u=this._readStreamForRange(n,a);var l=false;var d=new RefUnrefFilter(this);u.on("error",(function(r){setImmediate((function(){if(!l)d.emit("error",r)}))}));installDestroyFn(d,(function(){u.unpipe(d);d.unref();u.destroy()}));var p=new AssertByteCountStream(a-n);d.on("error",(function(r){setImmediate((function(){if(!l)p.emit("error",r)}))}));installDestroyFn(p,(function(){l=true;d.unpipe(p);d.destroy()}));return u.pipe(d).pipe(p)};RandomAccessReader.prototype._readStreamForRange=function(r,n){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(r,n,a,s,u){var l=this.createReadStream({start:s,end:s+a});var d=new y;var p=0;d._write=function(a,s,u){a.copy(r,n+p,0,a.length);p+=a.length;u()};d.on("finish",u);l.on("error",(function(r){u(r)}));l.pipe(d)};RandomAccessReader.prototype.close=function(r){setImmediate(r)};d.inherits(RefUnrefFilter,g);function RefUnrefFilter(r){g.call(this);this.context=r;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(r){this.unref();r()};RefUnrefFilter.prototype.unref=function(r){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var w="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(r,n){if(n){return r.toString("utf8")}else{var a="";for(var s=0;s<r.length;s++){a+=w[r[s]]}return a}}function readUInt64LE(r,n){var a=r.readUInt32LE(n);var s=r.readUInt32LE(n+4);return s*4294967296+a}var x;if(typeof Buffer.allocUnsafe==="function"){x=function(r){return Buffer.allocUnsafe(r)}}else{x=function(r){return new Buffer(r)}}function installDestroyFn(r,n){if(typeof r.destroy==="function"){r._destroy=function(r,a){n();if(a!=null)a(r)}}else{r.destroy=n}}function defaultCallback(r){if(r)throw r}},3497:r=>{function isBuffer(r){return Buffer.isBuffer(r)||r instanceof Uint8Array}function isEncoding(r){return Buffer.isEncoding(r)}function alloc(r,n,a){return Buffer.alloc(r,n,a)}function allocUnsafe(r){return Buffer.allocUnsafe(r)}function allocUnsafeSlow(r){return Buffer.allocUnsafeSlow(r)}function byteLength(r,n){return Buffer.byteLength(r,n)}function compare(r,n){return Buffer.compare(r,n)}function concat(r,n){return Buffer.concat(r,n)}function copy(r,n,a,s,u){return toBuffer(r).copy(n,a,s,u)}function equals(r,n){return toBuffer(r).equals(n)}function fill(r,n,a,s,u){return toBuffer(r).fill(n,a,s,u)}function from(r,n,a){return Buffer.from(r,n,a)}function includes(r,n,a,s){return toBuffer(r).includes(n,a,s)}function indexOf(r,n,a,s){return toBuffer(r).indexOf(n,a,s)}function lastIndexOf(r,n,a,s){return toBuffer(r).lastIndexOf(n,a,s)}function swap16(r){return toBuffer(r).swap16()}function swap32(r){return toBuffer(r).swap32()}function swap64(r){return toBuffer(r).swap64()}function toBuffer(r){if(Buffer.isBuffer(r))return r;return Buffer.from(r.buffer,r.byteOffset,r.byteLength)}function toString(r,n,a,s){return toBuffer(r).toString(n,a,s)}function write(r,n,a,s,u){return toBuffer(r).write(n,a,s,u)}function writeDoubleLE(r,n,a){return toBuffer(r).writeDoubleLE(n,a)}function writeFloatLE(r,n,a){return toBuffer(r).writeFloatLE(n,a)}function writeUInt32LE(r,n,a){return toBuffer(r).writeUInt32LE(n,a)}function writeInt32LE(r,n,a){return toBuffer(r).writeInt32LE(n,a)}function readDoubleLE(r,n){return toBuffer(r).readDoubleLE(n)}function readFloatLE(r,n){return toBuffer(r).readFloatLE(n)}function readUInt32LE(r,n){return toBuffer(r).readUInt32LE(n)}function readInt32LE(r,n){return toBuffer(r).readInt32LE(n)}r.exports={isBuffer:isBuffer,isEncoding:isEncoding,alloc:alloc,allocUnsafe:allocUnsafe,allocUnsafeSlow:allocUnsafeSlow,byteLength:byteLength,compare:compare,concat:concat,copy:copy,equals:equals,fill:fill,from:from,includes:includes,indexOf:indexOf,lastIndexOf:lastIndexOf,swap16:swap16,swap32:swap32,swap64:swap64,toBuffer:toBuffer,toString:toString,write:write,writeDoubleLE:writeDoubleLE,writeFloatLE:writeFloatLE,writeUInt32LE:writeUInt32LE,writeInt32LE:writeInt32LE,readDoubleLE:readDoubleLE,readFloatLE:readFloatLE,readUInt32LE:readUInt32LE,readInt32LE:readInt32LE}},7030:r=>{r.exports=class FixedFIFO{constructor(r){if(!(r>0)||(r-1&r)!==0)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(r);this.mask=r-1;this.top=0;this.btm=0;this.next=null}clear(){this.top=this.btm=0;this.next=null;this.buffer.fill(undefined)}push(r){if(this.buffer[this.top]!==undefined)return false;this.buffer[this.top]=r;this.top=this.top+1&this.mask;return true}shift(){const r=this.buffer[this.btm];if(r===undefined)return undefined;this.buffer[this.btm]=undefined;this.btm=this.btm+1&this.mask;return r}peek(){return this.buffer[this.btm]}isEmpty(){return this.buffer[this.btm]===undefined}}},2958:(r,n,a)=>{const s=a(7030);r.exports=class FastFIFO{constructor(r){this.hwm=r||16;this.head=new s(this.hwm);this.tail=this.head;this.length=0}clear(){this.head=this.tail;this.head.clear();this.length=0}push(r){this.length++;if(!this.head.push(r)){const n=this.head;this.head=n.next=new s(2*this.head.buffer.length);this.head.push(r)}}shift(){if(this.length!==0)this.length--;const r=this.tail.shift();if(r===undefined&&this.tail.next){const r=this.tail.next;this.tail.next=null;this.tail=r;return this.tail.shift()}return r}peek(){const r=this.tail.peek();if(r===undefined&&this.tail.next)return this.tail.next.peek();return r}isEmpty(){return this.length===0}}},7356:r=>{r.exports=clone;var n=Object.getPrototypeOf||function(r){return r.__proto__};function clone(r){if(r===null||typeof r!=="object")return r;if(r instanceof Object)var a={__proto__:n(r)};else var a=Object.create(null);Object.getOwnPropertyNames(r).forEach((function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))}));return a}},7758:(r,n,a)=>{var s=a(7147);var u=a(263);var l=a(3086);var d=a(7356);var p=a(3837);var m;var g;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){m=Symbol.for("graceful-fs.queue");g=Symbol.for("graceful-fs.previous")}else{m="___graceful-fs.queue";g="___graceful-fs.previous"}function noop(){}function publishQueue(r,n){Object.defineProperty(r,m,{get:function(){return n}})}var y=noop;if(p.debuglog)y=p.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))y=function(){var r=p.format.apply(p,arguments);r="GFS4: "+r.split(/\n/).join("\nGFS4: ");console.error(r)};if(!s[m]){var b=global[m]||[];publishQueue(s,b);s.close=function(r){function close(n,a){return r.call(s,n,(function(r){if(!r){resetQueue()}if(typeof a==="function")a.apply(this,arguments)}))}Object.defineProperty(close,g,{value:r});return close}(s.close);s.closeSync=function(r){function closeSync(n){r.apply(s,arguments);resetQueue()}Object.defineProperty(closeSync,g,{value:r});return closeSync}(s.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){y(s[m]);a(9491).equal(s[m].length,0)}))}}if(!global[m]){publishQueue(global,s[m])}r.exports=patch(d(s));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!s.__patched){r.exports=patch(s);s.__patched=true}function patch(r){u(r);r.gracefulify=patch;r.createReadStream=createReadStream;r.createWriteStream=createWriteStream;var n=r.readFile;r.readFile=readFile;function readFile(r,a,s){if(typeof a==="function")s=a,a=null;return go$readFile(r,a,s);function go$readFile(r,a,s,u){return n(r,a,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$readFile,[r,a,s],n,u||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var a=r.writeFile;r.writeFile=writeFile;function writeFile(r,n,s,u){if(typeof s==="function")u=s,s=null;return go$writeFile(r,n,s,u);function go$writeFile(r,n,s,u,l){return a(r,n,s,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$writeFile,[r,n,s,u],a,l||Date.now(),Date.now()]);else{if(typeof u==="function")u.apply(this,arguments)}}))}}var s=r.appendFile;if(s)r.appendFile=appendFile;function appendFile(r,n,a,u){if(typeof a==="function")u=a,a=null;return go$appendFile(r,n,a,u);function go$appendFile(r,n,a,u,l){return s(r,n,a,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$appendFile,[r,n,a,u],s,l||Date.now(),Date.now()]);else{if(typeof u==="function")u.apply(this,arguments)}}))}}var d=r.copyFile;if(d)r.copyFile=copyFile;function copyFile(r,n,a,s){if(typeof a==="function"){s=a;a=0}return go$copyFile(r,n,a,s);function go$copyFile(r,n,a,s,u){return d(r,n,a,(function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([go$copyFile,[r,n,a,s],l,u||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var p=r.readdir;r.readdir=readdir;var m=/^v[0-5]\./;function readdir(r,n,a){if(typeof n==="function")a=n,n=null;var s=m.test(process.version)?function go$readdir(r,n,a,s){return p(r,fs$readdirCallback(r,n,a,s))}:function go$readdir(r,n,a,s){return p(r,n,fs$readdirCallback(r,n,a,s))};return s(r,n,a);function fs$readdirCallback(r,n,a,u){return function(l,d){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([s,[r,n,a],l,u||Date.now(),Date.now()]);else{if(d&&d.sort)d.sort();if(typeof a==="function")a.call(this,l,d)}}}}if(process.version.substr(0,4)==="v0.8"){var g=l(r);ReadStream=g.ReadStream;WriteStream=g.WriteStream}var y=r.ReadStream;if(y){ReadStream.prototype=Object.create(y.prototype);ReadStream.prototype.open=ReadStream$open}var b=r.WriteStream;if(b){WriteStream.prototype=Object.create(b.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(r,"ReadStream",{get:function(){return ReadStream},set:function(r){ReadStream=r},enumerable:true,configurable:true});Object.defineProperty(r,"WriteStream",{get:function(){return WriteStream},set:function(r){WriteStream=r},enumerable:true,configurable:true});var w=ReadStream;Object.defineProperty(r,"FileReadStream",{get:function(){return w},set:function(r){w=r},enumerable:true,configurable:true});var x=WriteStream;Object.defineProperty(r,"FileWriteStream",{get:function(){return x},set:function(r){x=r},enumerable:true,configurable:true});function ReadStream(r,n){if(this instanceof ReadStream)return y.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var r=this;open(r.path,r.flags,r.mode,(function(n,a){if(n){if(r.autoClose)r.destroy();r.emit("error",n)}else{r.fd=a;r.emit("open",a);r.read()}}))}function WriteStream(r,n){if(this instanceof WriteStream)return b.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var r=this;open(r.path,r.flags,r.mode,(function(n,a){if(n){r.destroy();r.emit("error",n)}else{r.fd=a;r.emit("open",a)}}))}function createReadStream(n,a){return new r.ReadStream(n,a)}function createWriteStream(n,a){return new r.WriteStream(n,a)}var _=r.open;r.open=open;function open(r,n,a,s){if(typeof a==="function")s=a,a=null;return go$open(r,n,a,s);function go$open(r,n,a,s,u){return _(r,n,a,(function(l,d){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([go$open,[r,n,a,s],l,u||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}return r}function enqueue(r){y("ENQUEUE",r[0].name,r[1]);s[m].push(r);retry()}var w;function resetQueue(){var r=Date.now();for(var n=0;n<s[m].length;++n){if(s[m][n].length>2){s[m][n][3]=r;s[m][n][4]=r}}retry()}function retry(){clearTimeout(w);w=undefined;if(s[m].length===0)return;var r=s[m].shift();var n=r[0];var a=r[1];var u=r[2];var l=r[3];var d=r[4];if(l===undefined){y("RETRY",n.name,a);n.apply(null,a)}else if(Date.now()-l>=6e4){y("TIMEOUT",n.name,a);var p=a.pop();if(typeof p==="function")p.call(null,u)}else{var g=Date.now()-d;var b=Math.max(d-l,1);var x=Math.min(b*1.2,100);if(g>=x){y("RETRY",n.name,a);n.apply(null,a.concat([l]))}else{s[m].push(r)}}if(w===undefined){w=setTimeout(retry,0)}}},3086:(r,n,a)=>{var s=a(2781).Stream;r.exports=legacy;function legacy(r){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(n,a){if(!(this instanceof ReadStream))return new ReadStream(n,a);s.call(this);var u=this;this.path=n;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;a=a||{};var l=Object.keys(a);for(var d=0,p=l.length;d<p;d++){var m=l[d];this[m]=a[m]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){u._read()}));return}r.open(this.path,this.flags,this.mode,(function(r,n){if(r){u.emit("error",r);u.readable=false;return}u.fd=n;u.emit("open",n);u._read()}))}function WriteStream(n,a){if(!(this instanceof WriteStream))return new WriteStream(n,a);s.call(this);this.path=n;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;a=a||{};var u=Object.keys(a);for(var l=0,d=u.length;l<d;l++){var p=u[l];this[p]=a[p]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=r.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},263:(r,n,a)=>{var s=a(2057);var u=process.cwd;var l=null;var d=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!l)l=u.call(process);return l};try{process.cwd()}catch(r){}if(typeof process.chdir==="function"){var p=process.chdir;process.chdir=function(r){l=null;p.call(process,r)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,p)}r.exports=patch;function patch(r){if(s.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(r)}if(!r.lutimes){patchLutimes(r)}r.chown=chownFix(r.chown);r.fchown=chownFix(r.fchown);r.lchown=chownFix(r.lchown);r.chmod=chmodFix(r.chmod);r.fchmod=chmodFix(r.fchmod);r.lchmod=chmodFix(r.lchmod);r.chownSync=chownFixSync(r.chownSync);r.fchownSync=chownFixSync(r.fchownSync);r.lchownSync=chownFixSync(r.lchownSync);r.chmodSync=chmodFixSync(r.chmodSync);r.fchmodSync=chmodFixSync(r.fchmodSync);r.lchmodSync=chmodFixSync(r.lchmodSync);r.stat=statFix(r.stat);r.fstat=statFix(r.fstat);r.lstat=statFix(r.lstat);r.statSync=statFixSync(r.statSync);r.fstatSync=statFixSync(r.fstatSync);r.lstatSync=statFixSync(r.lstatSync);if(r.chmod&&!r.lchmod){r.lchmod=function(r,n,a){if(a)process.nextTick(a)};r.lchmodSync=function(){}}if(r.chown&&!r.lchown){r.lchown=function(r,n,a,s){if(s)process.nextTick(s)};r.lchownSync=function(){}}if(d==="win32"){r.rename=typeof r.rename!=="function"?r.rename:function(n){function rename(a,s,u){var l=Date.now();var d=0;n(a,s,(function CB(p){if(p&&(p.code==="EACCES"||p.code==="EPERM"||p.code==="EBUSY")&&Date.now()-l<6e4){setTimeout((function(){r.stat(s,(function(r,l){if(r&&r.code==="ENOENT")n(a,s,CB);else u(p)}))}),d);if(d<100)d+=10;return}if(u)u(p)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,n);return rename}(r.rename)}r.read=typeof r.read!=="function"?r.read:function(n){function read(a,s,u,l,d,p){var m;if(p&&typeof p==="function"){var g=0;m=function(y,b,w){if(y&&y.code==="EAGAIN"&&g<10){g++;return n.call(r,a,s,u,l,d,m)}p.apply(this,arguments)}}return n.call(r,a,s,u,l,d,m)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,n);return read}(r.read);r.readSync=typeof r.readSync!=="function"?r.readSync:function(n){return function(a,s,u,l,d){var p=0;while(true){try{return n.call(r,a,s,u,l,d)}catch(r){if(r.code==="EAGAIN"&&p<10){p++;continue}throw r}}}}(r.readSync);function patchLchmod(r){r.lchmod=function(n,a,u){r.open(n,s.O_WRONLY|s.O_SYMLINK,a,(function(n,s){if(n){if(u)u(n);return}r.fchmod(s,a,(function(n){r.close(s,(function(r){if(u)u(n||r)}))}))}))};r.lchmodSync=function(n,a){var u=r.openSync(n,s.O_WRONLY|s.O_SYMLINK,a);var l=true;var d;try{d=r.fchmodSync(u,a);l=false}finally{if(l){try{r.closeSync(u)}catch(r){}}else{r.closeSync(u)}}return d}}function patchLutimes(r){if(s.hasOwnProperty("O_SYMLINK")&&r.futimes){r.lutimes=function(n,a,u,l){r.open(n,s.O_SYMLINK,(function(n,s){if(n){if(l)l(n);return}r.futimes(s,a,u,(function(n){r.close(s,(function(r){if(l)l(n||r)}))}))}))};r.lutimesSync=function(n,a,u){var l=r.openSync(n,s.O_SYMLINK);var d;var p=true;try{d=r.futimesSync(l,a,u);p=false}finally{if(p){try{r.closeSync(l)}catch(r){}}else{r.closeSync(l)}}return d}}else if(r.futimes){r.lutimes=function(r,n,a,s){if(s)process.nextTick(s)};r.lutimesSync=function(){}}}function chmodFix(n){if(!n)return n;return function(a,s,u){return n.call(r,a,s,(function(r){if(chownErOk(r))r=null;if(u)u.apply(this,arguments)}))}}function chmodFixSync(n){if(!n)return n;return function(a,s){try{return n.call(r,a,s)}catch(r){if(!chownErOk(r))throw r}}}function chownFix(n){if(!n)return n;return function(a,s,u,l){return n.call(r,a,s,u,(function(r){if(chownErOk(r))r=null;if(l)l.apply(this,arguments)}))}}function chownFixSync(n){if(!n)return n;return function(a,s,u){try{return n.call(r,a,s,u)}catch(r){if(!chownErOk(r))throw r}}}function statFix(n){if(!n)return n;return function(a,s,u){if(typeof s==="function"){u=s;s=null}function callback(r,n){if(n){if(n.uid<0)n.uid+=4294967296;if(n.gid<0)n.gid+=4294967296}if(u)u.apply(this,arguments)}return s?n.call(r,a,s,callback):n.call(r,a,callback)}}function statFixSync(n){if(!n)return n;return function(a,s){var u=s?n.call(r,a,s):n.call(r,a);if(u){if(u.uid<0)u.uid+=4294967296;if(u.gid<0)u.gid+=4294967296}return u}}function chownErOk(r){if(!r)return true;if(r.code==="ENOSYS")return true;var n=!process.getuid||process.getuid()!==0;if(n){if(r.code==="EINVAL"||r.code==="EPERM")return true}return false}}},3092:(r,n)=>{
2
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
+ n.i=function(r,n,a,s,u){var l,d;var p=u*8-s-1;var m=(1<<p)-1;var g=m>>1;var y=-7;var b=a?u-1:0;var w=a?-1:1;var x=r[n+b];b+=w;l=x&(1<<-y)-1;x>>=-y;y+=p;for(;y>0;l=l*256+r[n+b],b+=w,y-=8){}d=l&(1<<-y)-1;l>>=-y;y+=s;for(;y>0;d=d*256+r[n+b],b+=w,y-=8){}if(l===0){l=1-g}else if(l===m){return d?NaN:(x?-1:1)*Infinity}else{d=d+Math.pow(2,s);l=l-g}return(x?-1:1)*d*Math.pow(2,l-s)};n.c=function(r,n,a,s,u,l){var d,p,m;var g=l*8-u-1;var y=(1<<g)-1;var b=y>>1;var w=u===23?Math.pow(2,-24)-Math.pow(2,-77):0;var x=s?0:l-1;var _=s?1:-1;var S=n<0||n===0&&1/n<0?1:0;n=Math.abs(n);if(isNaN(n)||n===Infinity){p=isNaN(n)?1:0;d=y}else{d=Math.floor(Math.log(n)/Math.LN2);if(n*(m=Math.pow(2,-d))<1){d--;m*=2}if(d+b>=1){n+=w/m}else{n+=w*Math.pow(2,1-b)}if(n*m>=2){d++;m/=2}if(d+b>=y){p=0;d=y}else if(d+b>=1){p=(n*m-1)*Math.pow(2,u);d=d+b}else{p=n*Math.pow(2,b-1)*Math.pow(2,u);d=0}}for(;u>=8;r[a+x]=p&255,x+=_,p/=256,u-=8){}d=d<<u|p;g+=u;for(;g>0;r[a+x]=d&255,x+=_,d/=256,g-=8){}r[a+x-_]|=S*128}},6555:(r,n,a)=>{const s=a(3837).inspect;const u=a(6961);const l=new Set(["arguments","array","bigint","boolean","date","number","object","regexp","string"]);r.exports=function inspectWithKind(r,n){const a=u(r);const d=s(r,Object.assign({breakLength:Infinity,maxArrayLength:10},n));if(a==="error"){return r.toString()}if(!l.has(a)){return d}if(d.startsWith("Observable {")){return d}return`${d} (${a})`}},864:r=>{var n=Object.prototype.toString;r.exports=function(r){var a;return n.call(r)==="[object Object]"&&(a=Object.getPrototypeOf(r),a===null||a===Object.getPrototypeOf({}))}},6961:r=>{var n=Object.prototype.toString;r.exports=function kindOf(r){if(r===void 0)return"undefined";if(r===null)return"null";var a=typeof r;if(a==="boolean")return"boolean";if(a==="string")return"string";if(a==="number")return"number";if(a==="symbol")return"symbol";if(a==="function"){return isGeneratorFn(r)?"generatorfunction":"function"}if(isArray(r))return"array";if(isBuffer(r))return"buffer";if(isArguments(r))return"arguments";if(isDate(r))return"date";if(isError(r))return"error";if(isRegexp(r))return"regexp";switch(ctorName(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(isGeneratorObj(r)){return"generator"}a=n.call(r);switch(a){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return a.slice(8,-1).toLowerCase().replace(/\s/g,"")};function ctorName(r){return typeof r.constructor==="function"?r.constructor.name:null}function isArray(r){if(Array.isArray)return Array.isArray(r);return r instanceof Array}function isError(r){return r instanceof Error||typeof r.message==="string"&&r.constructor&&typeof r.constructor.stackTraceLimit==="number"}function isDate(r){if(r instanceof Date)return true;return typeof r.toDateString==="function"&&typeof r.getDate==="function"&&typeof r.setDate==="function"}function isRegexp(r){if(r instanceof RegExp)return true;return typeof r.flags==="string"&&typeof r.ignoreCase==="boolean"&&typeof r.multiline==="boolean"&&typeof r.global==="boolean"}function isGeneratorFn(r,n){return ctorName(r)==="GeneratorFunction"}function isGeneratorObj(r){return typeof r.throw==="function"&&typeof r.return==="function"&&typeof r.next==="function"}function isArguments(r){try{if(typeof r.length==="number"&&typeof r.callee==="function"){return true}}catch(r){if(r.message.indexOf("callee")!==-1){return true}}return false}function isBuffer(r){if(r.constructor&&typeof r.constructor.isBuffer==="function"){return r.constructor.isBuffer(r)}return false}},900:r=>{var n=1e3;var a=n*60;var s=a*60;var u=s*24;var l=u*7;var d=u*365.25;r.exports=function(r,n){n=n||{};var a=typeof r;if(a==="string"&&r.length>0){return parse(r)}else if(a==="number"&&isFinite(r)){return n.long?fmtLong(r):fmtShort(r)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function parse(r){r=String(r);if(r.length>100){return}var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(!p){return}var m=parseFloat(p[1]);var g=(p[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return m*d;case"weeks":case"week":case"w":return m*l;case"days":case"day":case"d":return m*u;case"hours":case"hour":case"hrs":case"hr":case"h":return m*s;case"minutes":case"minute":case"mins":case"min":case"m":return m*a;case"seconds":case"second":case"secs":case"sec":case"s":return m*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return undefined}}function fmtShort(r){var l=Math.abs(r);if(l>=u){return Math.round(r/u)+"d"}if(l>=s){return Math.round(r/s)+"h"}if(l>=a){return Math.round(r/a)+"m"}if(l>=n){return Math.round(r/n)+"s"}return r+"ms"}function fmtLong(r){var l=Math.abs(r);if(l>=u){return plural(r,l,u,"day")}if(l>=s){return plural(r,l,s,"hour")}if(l>=a){return plural(r,l,a,"minute")}if(l>=n){return plural(r,l,n,"second")}return r+" ms"}function plural(r,n,a,s){var u=n>=a*1.5;return Math.round(r/a)+" "+s+(u?"s":"")}},4833:r=>{r.exports=Pend;function Pend(){this.pending=0;this.max=Infinity;this.listeners=[];this.waiting=[];this.error=null}Pend.prototype.go=function(r){if(this.pending<this.max){pendGo(this,r)}else{this.waiting.push(r)}};Pend.prototype.wait=function(r){if(this.pending===0){r(this.error)}else{this.listeners.push(r)}};Pend.prototype.hold=function(){return pendHold(this)};function pendHold(r){r.pending+=1;var n=false;return onCb;function onCb(a){if(n)throw new Error("callback called twice");n=true;r.error=r.error||a;r.pending-=1;if(r.waiting.length>0&&r.pending<r.max){pendGo(r,r.waiting.shift())}else if(r.pending===0){var s=r.listeners;r.listeners=[];s.forEach(cbListener)}}function cbListener(n){n(r.error)}}function pendGo(r,n){n(pendHold(r))}},5322:(r,n,a)=>{r.exports=typeof process!=="undefined"&&typeof process.nextTick==="function"?process.nextTick.bind(process):a(1031)},1031:r=>{r.exports=typeof queueMicrotask==="function"?queueMicrotask:r=>Promise.resolve().then(r)},8982:r=>{var n=[0,1,3,7,15,31,63,127,255];var BitReader=function(r){this.stream=r;this.bitOffset=0;this.curByte=0;this.hasByte=false};BitReader.prototype._ensureByte=function(){if(!this.hasByte){this.curByte=this.stream.readByte();this.hasByte=true}};BitReader.prototype.read=function(r){var a=0;while(r>0){this._ensureByte();var s=8-this.bitOffset;if(r>=s){a<<=s;a|=n[s]&this.curByte;this.hasByte=false;this.bitOffset=0;r-=s}else{a<<=r;var u=s-r;a|=(this.curByte&n[r]<<u)>>u;this.bitOffset+=r;r=0}}return a};BitReader.prototype.seek=function(r){var n=r%8;var a=(r-n)/8;this.bitOffset=n;this.stream.seek(a);this.hasByte=false};BitReader.prototype.pi=function(){var r=new Buffer(6),n;for(n=0;n<r.length;n++){r[n]=this.read(8)}return r.toString("hex")};r.exports=BitReader},9343:r=>{r.exports=function(){var r=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]);var CRC32=function(){var n=4294967295;this.getCRC=function(){return~n>>>0};this.updateCRC=function(a){n=n<<8^r[(n>>>24^a)&255]};this.updateCRCRun=function(a,s){while(s-- >0){n=n<<8^r[(n>>>24^a)&255]}}};return CRC32}()},9562:(r,n,a)=>{var s=a(8982);var u=a(4290);var l=a(9343);var d=a(6507);var p=20;var m=258;var g=0;var y=1;var b=2;var w=6;var x=50;var _="314159265359";var S="177245385090";var mtf=function(r,n){var a=r[n],s;for(s=n;s>0;s--){r[s]=r[s-1]}r[0]=a;return a};var v={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8};var k={};k[v.LAST_BLOCK]="Bad file checksum";k[v.NOT_BZIP_DATA]="Not bzip data";k[v.UNEXPECTED_INPUT_EOF]="Unexpected input EOF";k[v.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF";k[v.DATA_ERROR]="Data error";k[v.OUT_OF_MEMORY]="Out of memory";k[v.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var _throw=function(r,n){var a=k[r]||"unknown error";if(n){a+=": "+n}var s=new TypeError(a);s.errorCode=r;throw s};var Bunzip=function(r,n){this.writePos=this.writeCurrent=this.writeCount=0;this._start_bunzip(r,n)};Bunzip.prototype._init_block=function(){var r=this._get_next_block();if(!r){this.writeCount=-1;return false}this.blockCRC=new l;return true};Bunzip.prototype._start_bunzip=function(r,n){var a=new Buffer(4);if(r.read(a,0,4)!==4||String.fromCharCode(a[0],a[1],a[2])!=="BZh")_throw(v.NOT_BZIP_DATA,"bad magic");var u=a[3]-48;if(u<1||u>9)_throw(v.NOT_BZIP_DATA,"level out of range");this.reader=new s(r);this.dbufSize=1e5*u;this.nextoutput=0;this.outputStream=n;this.streamCRC=0};Bunzip.prototype._get_next_block=function(){var r,n,a;var s=this.reader;var u=s.pi();if(u===S){return false}if(u!==_)_throw(v.NOT_BZIP_DATA);this.targetBlockCRC=s.read(32)>>>0;this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0;if(s.read(1))_throw(v.OBSOLETE_INPUT);var l=s.read(24);if(l>this.dbufSize)_throw(v.DATA_ERROR,"initial position out of bounds");var d=s.read(16);var k=new Buffer(256),E=0;for(r=0;r<16;r++){if(d&1<<15-r){var C=r*16;a=s.read(16);for(n=0;n<16;n++)if(a&1<<15-n)k[E++]=C+n}}var F=s.read(3);if(F<b||F>w)_throw(v.DATA_ERROR);var T=s.read(15);if(T===0)_throw(v.DATA_ERROR);var B=new Buffer(256);for(r=0;r<F;r++)B[r]=r;var z=new Buffer(T);for(r=0;r<T;r++){for(n=0;s.read(1);n++)if(n>=F)_throw(v.DATA_ERROR);z[r]=mtf(B,n)}var A=E+2;var O=[],L;for(n=0;n<F;n++){var R=new Buffer(A),U=new Uint16Array(p+1);d=s.read(5);for(r=0;r<A;r++){for(;;){if(d<1||d>p)_throw(v.DATA_ERROR);if(!s.read(1))break;if(!s.read(1))d++;else d--}R[r]=d}var I,D;I=D=R[0];for(r=1;r<A;r++){if(R[r]>D)D=R[r];else if(R[r]<I)I=R[r]}L={};O.push(L);L.permute=new Uint16Array(m);L.limit=new Uint32Array(p+2);L.base=new Uint32Array(p+1);L.minLen=I;L.maxLen=D;var P=0;for(r=I;r<=D;r++){U[r]=L.limit[r]=0;for(d=0;d<A;d++)if(R[d]===r)L.permute[P++]=d}for(r=0;r<A;r++)U[R[r]]++;P=d=0;for(r=I;r<D;r++){P+=U[r];L.limit[r]=P-1;P<<=1;d+=U[r];L.base[r+1]=P-d}L.limit[D+1]=Number.MAX_VALUE;L.limit[D]=P+U[D]-1;L.base[I]=0}var M=new Uint32Array(256);for(r=0;r<256;r++)B[r]=r;var N=0,j=0,W=0,$;var q=this.dbuf=new Uint32Array(this.dbufSize);A=0;for(;;){if(!A--){A=x-1;if(W>=T){_throw(v.DATA_ERROR)}L=O[z[W++]]}r=L.minLen;n=s.read(r);for(;;r++){if(r>L.maxLen){_throw(v.DATA_ERROR)}if(n<=L.limit[r])break;n=n<<1|s.read(1)}n-=L.base[r];if(n<0||n>=m){_throw(v.DATA_ERROR)}var H=L.permute[n];if(H===g||H===y){if(!N){N=1;d=0}if(H===g)d+=N;else d+=2*N;N<<=1;continue}if(N){N=0;if(j+d>this.dbufSize){_throw(v.DATA_ERROR)}$=k[B[0]];M[$]+=d;while(d--)q[j++]=$}if(H>E)break;if(j>=this.dbufSize){_throw(v.DATA_ERROR)}r=H-1;$=mtf(B,r);$=k[$];M[$]++;q[j++]=$}if(l<0||l>=j){_throw(v.DATA_ERROR)}n=0;for(r=0;r<256;r++){a=n+M[r];M[r]=n;n=a}for(r=0;r<j;r++){$=q[r]&255;q[M[$]]|=r<<8;M[$]++}var Z=0,G=0,V=0;if(j){Z=q[l];G=Z&255;Z>>=8;V=-1}this.writePos=Z;this.writeCurrent=G;this.writeCount=j;this.writeRun=V;return true};Bunzip.prototype._read_bunzip=function(r,n){var a,s,u;if(this.writeCount<0){return 0}var l=0;var d=this.dbuf,p=this.writePos,m=this.writeCurrent;var g=this.writeCount,y=this.outputsize;var b=this.writeRun;while(g){g--;s=m;p=d[p];m=p&255;p>>=8;if(b++===3){a=m;u=s;m=-1}else{a=1;u=m}this.blockCRC.updateCRCRun(u,a);while(a--){this.outputStream.writeByte(u);this.nextoutput++}if(m!=s)b=0}this.writeCount=g;if(this.blockCRC.getCRC()!==this.targetBlockCRC){_throw(v.DATA_ERROR,"Bad block CRC "+"(got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")")}return this.nextoutput};var coerceInputStream=function(r){if("readByte"in r){return r}var n=new u;n.pos=0;n.readByte=function(){return r[this.pos++]};n.seek=function(r){this.pos=r};n.eof=function(){return this.pos>=r.length};return n};var coerceOutputStream=function(r){var n=new u;var a=true;if(r){if(typeof r==="number"){n.buffer=new Buffer(r);a=false}else if("writeByte"in r){return r}else{n.buffer=r;a=false}}else{n.buffer=new Buffer(16384)}n.pos=0;n.writeByte=function(r){if(a&&this.pos>=this.buffer.length){var n=new Buffer(this.buffer.length*2);this.buffer.copy(n);this.buffer=n}this.buffer[this.pos++]=r};n.getBuffer=function(){if(this.pos!==this.buffer.length){if(!a)throw new TypeError("outputsize does not match decoded input");var r=new Buffer(this.pos);this.buffer.copy(r,0,0,this.pos);this.buffer=r}return this.buffer};n._coerced=true;return n};Bunzip.Err=v;Bunzip.decode=function(r,n,a){var s=coerceInputStream(r);var u=coerceOutputStream(n);var l=new Bunzip(s,u);while(true){if("eof"in s&&s.eof())break;if(l._init_block()){l._read_bunzip()}else{var d=l.reader.read(32)>>>0;if(d!==l.streamCRC){_throw(v.DATA_ERROR,"Bad stream CRC "+"(got "+l.streamCRC.toString(16)+" expected "+d.toString(16)+")")}if(a&&"eof"in s&&!s.eof()){l._start_bunzip(s,u)}else break}}if("getBuffer"in u)return u.getBuffer()};Bunzip.decodeBlock=function(r,n,a){var s=coerceInputStream(r);var u=coerceOutputStream(a);var d=new Bunzip(s,u);d.reader.seek(n);var p=d._get_next_block();if(p){d.blockCRC=new l;d.writeCopies=0;d._read_bunzip()}if("getBuffer"in u)return u.getBuffer()};Bunzip.table=function(r,n,a){var s=new u;s.delegate=coerceInputStream(r);s.pos=0;s.readByte=function(){this.pos++;return this.delegate.readByte()};if(s.delegate.eof){s.eof=s.delegate.eof.bind(s.delegate)}var l=new u;l.pos=0;l.writeByte=function(){this.pos++};var d=new Bunzip(s,l);var p=d.dbufSize;while(true){if("eof"in s&&s.eof())break;var m=s.pos*8+d.reader.bitOffset;if(d.reader.hasByte){m-=8}if(d._init_block()){var g=l.pos;d._read_bunzip();n(m,l.pos-g)}else{var y=d.reader.read(32);if(a&&"eof"in s&&!s.eof()){d._start_bunzip(s,l);console.assert(d.dbufSize===p,"shouldn't change block size within multistream file")}else break}}};Bunzip.Stream=u;Bunzip.version=d.version;Bunzip.license=d.license;r.exports=Bunzip},4290:r=>{var Stream=function(){};Stream.prototype.readByte=function(){throw new Error("abstract method readByte() not implemented")};Stream.prototype.read=function(r,n,a){var s=0;while(s<a){var u=this.readByte();if(u<0){return s===0?-1:s}r[n++]=u;s++}return s};Stream.prototype.seek=function(r){throw new Error("abstract method seek() not implemented")};Stream.prototype.writeByte=function(r){throw new Error("abstract method readByte() not implemented")};Stream.prototype.write=function(r,n,a){var s;for(s=0;s<a;s++){this.writeByte(r[n++])}return a};Stream.prototype.flush=function(){};r.exports=Stream},5147:(r,n,a)=>{const{EventEmitter:s}=a(2361);const u=new Error("Stream was destroyed");const l=new Error("Premature close");const d=a(5322);const p=a(2958);const m=(1<<27)-1;const g=1;const y=2;const b=4;const w=8;const x=m^g;const _=m^y;const S=1<<4;const v=2<<4;const k=4<<4;const E=8<<4;const C=16<<4;const F=32<<4;const T=64<<4;const B=128<<4;const z=256<<4;const A=512<<4;const O=1024<<4;const L=2048<<4;const R=4096<<4;const U=C|F;const I=S|R;const D=k|S;const P=z|E;const M=m^S;const N=m^k;const j=m^(k|R);const W=m^R;const $=m^C;const q=m^(E|A);const H=m^T;const Z=m^U;const G=m^L;const V=m^v;const Y=1<<17;const K=2<<17;const X=4<<17;const Q=8<<17;const J=16<<17;const ee=32<<17;const te=64<<17;const re=128<<17;const ne=256<<17;const ie=512<<17;const oe=m^(Y|ne);const ae=m^X;const se=m^ie;const ce=m^J;const ue=m^Q;const fe=m^re;const le=m^K;const de=S|Y;const he=m^de;const pe=O|ee;const me=b|w|y;const ge=me|g;const ye=me|pe;const be=ae&N;const we=re|L;const xe=we&he;const _e=ge|xe;const Se=ge|T|O;const ve=ge|O|E;const ke=ge|T|E;const Ee=ge|z|E|A;const Ce=ge|S|T|O|R;const Fe=me|T|O;const Te=v|ge|L|k;const Be=ge|ie|ee;const ze=Q|J;const Ae=Q|Y;const Oe=Q|J|ge|Y;const Le=ge|Y|Q;const Re=X|Y;const Ue=Y|ne;const Ie=ge|ie|Ae|ee;const De=J|me|ie|ee;const Pe=K|ge|re|X;const Me=Symbol.asyncIterator||Symbol("asyncIterator");class WritableState{constructor(r,{highWaterMark:n=16384,map:a=null,mapWritable:s,byteLength:u,byteLengthWritable:l}={}){this.stream=r;this.queue=new p;this.highWaterMark=n;this.buffered=0;this.error=null;this.pipeline=null;this.drains=null;this.byteLength=l||u||defaultByteLength;this.map=s||a;this.afterWrite=afterWrite.bind(this);this.afterUpdateNextTick=updateWriteNT.bind(this)}get ended(){return(this.stream._duplexState&ee)!==0}push(r){if(this.map!==null)r=this.map(r);this.buffered+=this.byteLength(r);this.queue.push(r);if(this.buffered<this.highWaterMark){this.stream._duplexState|=Q;return true}this.stream._duplexState|=ze;return false}shift(){const r=this.queue.shift();this.buffered-=this.byteLength(r);if(this.buffered===0)this.stream._duplexState&=ue;return r}end(r){if(typeof r==="function")this.stream.once("finish",r);else if(r!==undefined&&r!==null)this.push(r);this.stream._duplexState=(this.stream._duplexState|ie)&ae}autoBatch(r,n){const a=[];const s=this.stream;a.push(r);while((s._duplexState&Le)===Ae){a.push(s._writableState.shift())}if((s._duplexState&ge)!==0)return n(null);s._writev(a,n)}update(){const r=this.stream;r._duplexState|=K;do{while((r._duplexState&Le)===Q){const n=this.shift();r._duplexState|=Ue;r._write(n,this.afterWrite)}if((r._duplexState&Re)===0)this.updateNonPrimary()}while(this.continueUpdate()===true);r._duplexState&=le}updateNonPrimary(){const r=this.stream;if((r._duplexState&Ie)===ie){r._duplexState=(r._duplexState|Y)&se;r._final(afterFinal.bind(this));return}if((r._duplexState&me)===b){if((r._duplexState&we)===0){r._duplexState|=de;r._destroy(afterDestroy.bind(this))}return}if((r._duplexState&_e)===g){r._duplexState=(r._duplexState|de)&x;r._open(afterOpen.bind(this))}}continueUpdate(){if((this.stream._duplexState&re)===0)return false;this.stream._duplexState&=fe;return true}updateCallback(){if((this.stream._duplexState&Pe)===X)this.update();else this.updateNextTick()}updateNextTick(){if((this.stream._duplexState&re)!==0)return;this.stream._duplexState|=re;if((this.stream._duplexState&K)===0)d(this.afterUpdateNextTick)}}class ReadableState{constructor(r,{highWaterMark:n=16384,map:a=null,mapReadable:s,byteLength:u,byteLengthReadable:l}={}){this.stream=r;this.queue=new p;this.highWaterMark=n;this.buffered=0;this.error=null;this.pipeline=null;this.byteLength=l||u||defaultByteLength;this.map=s||a;this.pipeTo=null;this.afterRead=afterRead.bind(this);this.afterUpdateNextTick=updateReadNT.bind(this)}get ended(){return(this.stream._duplexState&O)!==0}pipe(r,n){if(this.pipeTo!==null)throw new Error("Can only pipe to one destination");if(typeof n!=="function")n=null;this.stream._duplexState|=F;this.pipeTo=r;this.pipeline=new Pipeline(this.stream,r,n);if(n)this.stream.on("error",noop);if(isStreamx(r)){r._writableState.pipeline=this.pipeline;if(n)r.on("error",noop);r.on("finish",this.pipeline.finished.bind(this.pipeline))}else{const n=this.pipeline.done.bind(this.pipeline,r);const a=this.pipeline.done.bind(this.pipeline,r,null);r.on("error",n);r.on("close",a);r.on("finish",this.pipeline.finished.bind(this.pipeline))}r.on("drain",afterDrain.bind(this));this.stream.emit("piping",r);r.emit("pipe",this.stream)}push(r){const n=this.stream;if(r===null){this.highWaterMark=0;n._duplexState=(n._duplexState|T)&j;return false}if(this.map!==null)r=this.map(r);this.buffered+=this.byteLength(r);this.queue.push(r);n._duplexState=(n._duplexState|E)&W;return this.buffered<this.highWaterMark}shift(){const r=this.queue.shift();this.buffered-=this.byteLength(r);if(this.buffered===0)this.stream._duplexState&=q;return r}unshift(r){const n=[this.map!==null?this.map(r):r];while(this.buffered>0)n.push(this.shift());for(let r=0;r<n.length-1;r++){const a=n[r];this.buffered+=this.byteLength(a);this.queue.push(a)}this.push(n[n.length-1])}read(){const r=this.stream;if((r._duplexState&ve)===E){const n=this.shift();if(this.pipeTo!==null&&this.pipeTo.write(n)===false)r._duplexState&=Z;if((r._duplexState&B)!==0)r.emit("data",n);return n}return null}drain(){const r=this.stream;while((r._duplexState&ve)===E&&(r._duplexState&U)!==0){const n=this.shift();if(this.pipeTo!==null&&this.pipeTo.write(n)===false)r._duplexState&=Z;if((r._duplexState&B)!==0)r.emit("data",n)}}update(){const r=this.stream;r._duplexState|=v;do{this.drain();while(this.buffered<this.highWaterMark&&(r._duplexState&Ce)===0){r._duplexState|=I;r._read(this.afterRead);this.drain()}if((r._duplexState&Ee)===P){r._duplexState|=A;r.emit("readable")}if((r._duplexState&D)===0)this.updateNonPrimary()}while(this.continueUpdate()===true);r._duplexState&=V}updateNonPrimary(){const r=this.stream;if((r._duplexState&ke)===T){r._duplexState=(r._duplexState|O)&H;r.emit("end");if((r._duplexState&ye)===pe)r._duplexState|=b;if(this.pipeTo!==null)this.pipeTo.end()}if((r._duplexState&me)===b){if((r._duplexState&we)===0){r._duplexState|=de;r._destroy(afterDestroy.bind(this))}return}if((r._duplexState&_e)===g){r._duplexState=(r._duplexState|de)&x;r._open(afterOpen.bind(this))}}continueUpdate(){if((this.stream._duplexState&L)===0)return false;this.stream._duplexState&=G;return true}updateCallback(){if((this.stream._duplexState&Te)===k)this.update();else this.updateNextTick()}updateNextTick(){if((this.stream._duplexState&L)!==0)return;this.stream._duplexState|=L;if((this.stream._duplexState&v)===0)d(this.afterUpdateNextTick)}}class TransformState{constructor(r){this.data=null;this.afterTransform=afterTransform.bind(r);this.afterFinal=null}}class Pipeline{constructor(r,n,a){this.from=r;this.to=n;this.afterPipe=a;this.error=null;this.pipeToFinished=false}finished(){this.pipeToFinished=true}done(r,n){if(n)this.error=n;if(r===this.to){this.to=null;if(this.from!==null){if((this.from._duplexState&O)===0||!this.pipeToFinished){this.from.destroy(this.error||new Error("Writable stream closed prematurely"))}return}}if(r===this.from){this.from=null;if(this.to!==null){if((r._duplexState&O)===0){this.to.destroy(this.error||new Error("Readable stream closed before ending"))}return}}if(this.afterPipe!==null)this.afterPipe(this.error);this.to=this.from=this.afterPipe=null}}function afterDrain(){this.stream._duplexState|=F;this.updateCallback()}function afterFinal(r){const n=this.stream;if(r)n.destroy(r);if((n._duplexState&me)===0){n._duplexState|=ee;n.emit("finish")}if((n._duplexState&ye)===pe){n._duplexState|=b}n._duplexState&=oe;if((n._duplexState&K)===0)this.update();else this.updateNextTick()}function afterDestroy(r){const n=this.stream;if(!r&&this.error!==u)r=this.error;if(r)n.emit("error",r);n._duplexState|=w;n.emit("close");const a=n._readableState;const s=n._writableState;if(a!==null&&a.pipeline!==null)a.pipeline.done(n,r);if(s!==null){while(s.drains!==null&&s.drains.length>0)s.drains.shift().resolve(false);if(s.pipeline!==null)s.pipeline.done(n,r)}}function afterWrite(r){const n=this.stream;if(r)n.destroy(r);n._duplexState&=oe;if(this.drains!==null)tickDrains(this.drains);if((n._duplexState&Oe)===J){n._duplexState&=ce;if((n._duplexState&te)===te){n.emit("drain")}}this.updateCallback()}function afterRead(r){if(r)this.stream.destroy(r);this.stream._duplexState&=M;this.updateCallback()}function updateReadNT(){if((this.stream._duplexState&v)===0){this.stream._duplexState&=G;this.update()}}function updateWriteNT(){if((this.stream._duplexState&K)===0){this.stream._duplexState&=fe;this.update()}}function tickDrains(r){for(let n=0;n<r.length;n++){if(--r[n].writes===0){r.shift().resolve(true);n--}}}function afterOpen(r){const n=this.stream;if(r)n.destroy(r);if((n._duplexState&b)===0){if((n._duplexState&Se)===0)n._duplexState|=k;if((n._duplexState&Be)===0)n._duplexState|=X;n.emit("open")}n._duplexState&=he;if(n._writableState!==null){n._writableState.updateCallback()}if(n._readableState!==null){n._readableState.updateCallback()}}function afterTransform(r,n){if(n!==undefined&&n!==null)this.push(n);this._writableState.afterWrite(r)}class Stream extends s{constructor(r){super();this._duplexState=0;this._readableState=null;this._writableState=null;if(r){if(r.open)this._open=r.open;if(r.destroy)this._destroy=r.destroy;if(r.predestroy)this._predestroy=r.predestroy;if(r.signal){r.signal.addEventListener("abort",abort.bind(this))}}}_open(r){r(null)}_destroy(r){r(null)}_predestroy(){}get readable(){return this._readableState!==null?true:undefined}get writable(){return this._writableState!==null?true:undefined}get destroyed(){return(this._duplexState&w)!==0}get destroying(){return(this._duplexState&me)!==0}destroy(r){if((this._duplexState&me)===0){if(!r)r=u;this._duplexState=(this._duplexState|b)&be;if(this._readableState!==null){this._readableState.highWaterMark=0;this._readableState.error=r}if(this._writableState!==null){this._writableState.highWaterMark=0;this._writableState.error=r}this._duplexState|=y;this._predestroy();this._duplexState&=_;if(this._readableState!==null)this._readableState.updateNextTick();if(this._writableState!==null)this._writableState.updateNextTick()}}on(r,n){if(this._readableState!==null){if(r==="data"){this._duplexState|=B|C;this._readableState.updateNextTick()}if(r==="readable"){this._duplexState|=z;this._readableState.updateNextTick()}}if(this._writableState!==null){if(r==="drain"){this._duplexState|=te;this._writableState.updateNextTick()}}return super.on(r,n)}}class Readable extends Stream{constructor(r){super(r);this._duplexState|=g|ee;this._readableState=new ReadableState(this,r);if(r){if(r.read)this._read=r.read;if(r.eagerOpen)this._readableState.updateNextTick()}}_read(r){r(null)}pipe(r,n){this._readableState.updateNextTick();this._readableState.pipe(r,n);return r}read(){this._readableState.updateNextTick();return this._readableState.read()}push(r){this._readableState.updateNextTick();return this._readableState.push(r)}unshift(r){this._readableState.updateNextTick();return this._readableState.unshift(r)}resume(){this._duplexState|=C;this._readableState.updateNextTick();return this}pause(){this._duplexState&=$;return this}static _fromAsyncIterator(r,n){let a;const s=new Readable({...n,read(n){r.next().then(push).then(n.bind(null,null)).catch(n)},predestroy(){a=r.return()},destroy(r){if(!a)return r(null);a.then(r.bind(null,null)).catch(r)}});return s;function push(r){if(r.done)s.push(null);else s.push(r.value)}}static from(r,n){if(isReadStreamx(r))return r;if(r[Me])return this._fromAsyncIterator(r[Me](),n);if(!Array.isArray(r))r=r===undefined?[]:[r];let a=0;return new Readable({...n,read(n){this.push(a===r.length?null:r[a++]);n(null)}})}static isBackpressured(r){return(r._duplexState&Fe)!==0||r._readableState.buffered>=r._readableState.highWaterMark}static isPaused(r){return(r._duplexState&C)===0}[Me](){const r=this;let n=null;let a=null;let s=null;this.on("error",(r=>{n=r}));this.on("readable",onreadable);this.on("close",onclose);return{[Me](){return this},next(){return new Promise((function(n,u){a=n;s=u;const l=r.read();if(l!==null)ondata(l);else if((r._duplexState&w)!==0)ondata(null)}))},return(){return destroy(null)},throw(r){return destroy(r)}};function onreadable(){if(a!==null)ondata(r.read())}function onclose(){if(a!==null)ondata(null)}function ondata(l){if(s===null)return;if(n)s(n);else if(l===null&&(r._duplexState&O)===0)s(u);else a({value:l,done:l===null});s=a=null}function destroy(n){r.destroy(n);return new Promise(((a,s)=>{if(r._duplexState&w)return a({value:undefined,done:true});r.once("close",(function(){if(n)s(n);else a({value:undefined,done:true})}))}))}}}class Writable extends Stream{constructor(r){super(r);this._duplexState|=g|O;this._writableState=new WritableState(this,r);if(r){if(r.writev)this._writev=r.writev;if(r.write)this._write=r.write;if(r.final)this._final=r.final;if(r.eagerOpen)this._writableState.updateNextTick()}}_writev(r,n){n(null)}_write(r,n){this._writableState.autoBatch(r,n)}_final(r){r(null)}static isBackpressured(r){return(r._duplexState&De)!==0}static drained(r){if(r.destroyed)return Promise.resolve(false);const n=r._writableState;const a=n.queue.length+(r._duplexState&ne?1:0);if(a===0)return Promise.resolve(true);if(n.drains===null)n.drains=[];return new Promise((r=>{n.drains.push({writes:a,resolve:r})}))}write(r){this._writableState.updateNextTick();return this._writableState.push(r)}end(r){this._writableState.updateNextTick();this._writableState.end(r);return this}}class Duplex extends Readable{constructor(r){super(r);this._duplexState=g;this._writableState=new WritableState(this,r);if(r){if(r.writev)this._writev=r.writev;if(r.write)this._write=r.write;if(r.final)this._final=r.final}}_writev(r,n){n(null)}_write(r,n){this._writableState.autoBatch(r,n)}_final(r){r(null)}write(r){this._writableState.updateNextTick();return this._writableState.push(r)}end(r){this._writableState.updateNextTick();this._writableState.end(r);return this}}class Transform extends Duplex{constructor(r){super(r);this._transformState=new TransformState(this);if(r){if(r.transform)this._transform=r.transform;if(r.flush)this._flush=r.flush}}_write(r,n){if(this._readableState.buffered>=this._readableState.highWaterMark){this._transformState.data=r}else{this._transform(r,this._transformState.afterTransform)}}_read(r){if(this._transformState.data!==null){const n=this._transformState.data;this._transformState.data=null;r(null);this._transform(n,this._transformState.afterTransform)}else{r(null)}}_transform(r,n){n(null,r)}_flush(r){r(null)}_final(r){this._transformState.afterFinal=r;this._flush(transformAfterFlush.bind(this))}}class PassThrough extends Transform{}function transformAfterFlush(r,n){const a=this._transformState.afterFinal;if(r)return a(r);if(n!==null&&n!==undefined)this.push(n);this.push(null);a(null)}function pipelinePromise(...r){return new Promise(((n,a)=>pipeline(...r,(r=>{if(r)return a(r);n()}))))}function pipeline(r,...n){const a=Array.isArray(r)?[...r,...n]:[r,...n];const s=a.length&&typeof a[a.length-1]==="function"?a.pop():null;if(a.length<2)throw new Error("Pipeline requires at least 2 streams");let u=a[0];let d=null;let p=null;for(let r=1;r<a.length;r++){d=a[r];if(isStreamx(u)){u.pipe(d,onerror)}else{errorHandle(u,true,r>1,onerror);u.pipe(d)}u=d}if(s){let r=false;const n=isStreamx(d)||!!(d._writableState&&d._writableState.autoDestroy);d.on("error",(r=>{if(p===null)p=r}));d.on("finish",(()=>{r=true;if(!n)s(p)}));if(n){d.on("close",(()=>s(p||(r?null:l))))}}return d;function errorHandle(r,n,a,s){r.on("error",s);r.on("close",onclose);function onclose(){if(n&&r._readableState&&!r._readableState.ended)return s(l);if(a&&r._writableState&&!r._writableState.ended)return s(l)}}function onerror(r){if(!r||p)return;p=r;for(const n of a){n.destroy(r)}}}function isStream(r){return!!r._readableState||!!r._writableState}function isStreamx(r){return typeof r._duplexState==="number"&&isStream(r)}function getStreamError(r){const n=r._readableState&&r._readableState.error||r._writableState&&r._writableState.error;return n===u?null:n}function isReadStreamx(r){return isStreamx(r)&&r.readable}function isTypedArray(r){return typeof r==="object"&&r!==null&&typeof r.byteLength==="number"}function defaultByteLength(r){return isTypedArray(r)?r.byteLength:1024}function noop(){}function abort(){this.destroy(new Error("Stream aborted."))}r.exports={pipeline:pipeline,pipelinePromise:pipelinePromise,isStream:isStream,isStreamx:isStreamx,getStreamError:getStreamError,Stream:Stream,Writable:Writable,Readable:Readable,Duplex:Duplex,Transform:Transform,PassThrough:PassThrough}},5723:(r,n,a)=>{const{join:s,normalize:u,sep:l,posix:{isAbsolute:d},win32:{isAbsolute:p}}=a(1017);const{inspect:m}=a(3837);const g=a(6555);const y=a(864);const b="Expected a non-negative integer";r.exports=function stripDirs(...r){const n=r.length;if(n!==2&&n!==3){throw new RangeError(`Expected 2 or 3 arguments (<string>, <integer>[, <Object>]), but got ${n===0?"no":n} arguments.`)}const[a,w,x={disallowOverflow:false}]=r;if(typeof a!=="string"){throw new TypeError(`Expected a relative file path (<string>), but got a non-string value ${g(a)}.`)}if(d(a)||p(a)){throw new Error(`Expected a relative file path, but got an absolute path ${m(a)}.`)}if(typeof w!=="number"){throw new TypeError(`${b}, but got a non-number value ${g(w)}.`)}if(w<0){throw new RangeError(`${b}, but got a negative value ${g(w)}.`)}if(!isFinite(w)){throw new RangeError(`${b}, but got ${w}.`)}if(w>Number.MAX_SAFE_INTEGER){throw new RangeError(`${b}, but got an extremely large number ${w}.`)}if(!Number.isInteger(w)){throw new RangeError(`${b}, but got a non-integer number ${w}.`)}if(n===3){if(!y(x)){throw new TypeError(`Expected an option object to set strip-dirs option, but got ${g(x)}.`)}if(x.disallowOverflow!==undefined&&typeof x.disallowOverflow!=="boolean"){throw new TypeError(`Expected \`disallowOverflow\` option to be a boolean, but got a non-boolean value ${g(x.disallowOverflow)}.`)}}const _=u(a).split(l);if(_.length>1&&_[0]==="."){_.shift()}if(w>_.length-1){if(x.disallowOverflow){throw new RangeError("Cannot strip more directories than there are.")}return u(_[_.length-1])}return s(..._.slice(w))}},9318:(r,n,a)=>{const s=a(2037);const u=a(6224);const l=a(1533);const{env:d}=process;let p;if(l("no-color")||l("no-colors")||l("color=false")||l("color=never")){p=0}else if(l("color")||l("colors")||l("color=true")||l("color=always")){p=1}function envForceColor(){if("FORCE_COLOR"in d){if(d.FORCE_COLOR==="true"){return 1}if(d.FORCE_COLOR==="false"){return 0}return d.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(d.FORCE_COLOR,10),3)}}function translateLevel(r){if(r===0){return false}return{level:r,hasBasic:true,has256:r>=2,has16m:r>=3}}function supportsColor(r,{streamIsTTY:n,sniffFlags:a=true}={}){const u=envForceColor();if(u!==undefined){p=u}const m=a?p:u;if(m===0){return 0}if(a){if(l("color=16m")||l("color=full")||l("color=truecolor")){return 3}if(l("color=256")){return 2}}if(r&&!n&&m===undefined){return 0}const g=m||0;if(d.TERM==="dumb"){return g}if(process.platform==="win32"){const r=s.release().split(".");if(Number(r[0])>=10&&Number(r[2])>=10586){return Number(r[2])>=14931?3:2}return 1}if("CI"in d){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((r=>r in d))||d.CI_NAME==="codeship"){return 1}return g}if("TEAMCITY_VERSION"in d){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d.TEAMCITY_VERSION)?1:0}if(d.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in d){const r=Number.parseInt((d.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(d.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(d.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(d.TERM)){return 1}if("COLORTERM"in d){return 1}return g}function getSupportLevel(r,n={}){const a=supportsColor(r,{streamIsTTY:r&&r.isTTY,...n});return translateLevel(a)}r.exports={supportsColor:getSupportLevel,stdout:getSupportLevel({isTTY:u.isatty(1)}),stderr:getSupportLevel({isTTY:u.isatty(2)})}},1533:r=>{r.exports=(r,n=process.argv)=>{const a=r.startsWith("-")?"":r.length===1?"-":"--";const s=n.indexOf(a+r);const u=n.indexOf("--");return s!==-1&&(u===-1||s<u)}},421:(r,n,a)=>{var s=a(2781);n=r.exports=through;through.through=through;function through(r,n,a){r=r||function(r){this.queue(r)};n=n||function(){this.queue(null)};var u=false,l=false,d=[],p=false;var m=new s;m.readable=m.writable=true;m.paused=false;m.autoDestroy=!(a&&a.autoDestroy===false);m.write=function(n){r.call(this,n);return!m.paused};function drain(){while(d.length&&!m.paused){var r=d.shift();if(null===r)return m.emit("end");else m.emit("data",r)}}m.queue=m.push=function(r){if(p)return m;if(r===null)p=true;d.push(r);drain();return m};m.on("end",(function(){m.readable=false;if(!m.writable&&m.autoDestroy)process.nextTick((function(){m.destroy()}))}));function _end(){m.writable=false;n.call(m);if(!m.readable&&m.autoDestroy)m.destroy()}m.end=function(r){if(u)return;u=true;if(arguments.length)m.write(r);_end();return m};m.destroy=function(){if(l)return;l=true;u=true;d.length=0;m.writable=m.readable=false;m.emit("close");return m};m.pause=function(){if(m.paused)return;m.paused=true;return m};m.resume=function(){if(m.paused){m.paused=false;m.emit("resume")}drain();if(!m.paused)m.emit("drain");return m};return m}},3467:(r,n,a)=>{var s=a(421);var u=a(2589);var l=a(7877);r.exports=unbzip2Stream;function unbzip2Stream(){var r=[];var n=0;var a=0;var d=false;var p=false;var m=null;var g=null;function decompressBlock(r){if(!a){a=u.header(m);g=0;return true}else{var n=1e5*a;var s=new Int32Array(n);var l=[];var f=function(r){l.push(r)};g=u.decompress(m,f,s,n,g);if(g===null){a=0;return false}else{r(Buffer.from(l));return true}}}var y=0;function decompressAndQueue(r){if(d)return;try{return decompressBlock((function(n){r.queue(n);if(n!==null){y+=n.length}else{}}))}catch(n){r.emit("error",n);d=true;return false}}return s((function write(s){r.push(s);n+=s.length;if(m===null){m=l((function(){return r.shift()}))}while(!d&&n-m.bytesRead+1>=(25e3+1e5*a||4)){decompressAndQueue(this)}}),(function end(r){while(!d&&m&&n>m.bytesRead){decompressAndQueue(this)}if(!d){if(g!==null)this.emit("error",new Error("input stream ended prematurely"));this.queue(null)}}))}},7877:r=>{var n=[0,1,3,7,15,31,63,127,255];r.exports=function bitIterator(r){var a=0,s=0;var u=r();var f=function(l){if(l===null&&a!=0){a=0;s++;return}var d=0;while(l>0){if(s>=u.length){s=0;u=r()}var p=8-a;if(a===0&&l>0)f.bytesRead++;if(l>=p){d<<=p;d|=n[p]&u[s++];a=0;l-=p}else{d<<=l;d|=(u[s]&n[l]<<8-l-a)>>8-l-a;a+=l;l=0}}return d};f.bytesRead=0;return f}},2589:r=>{function Bzip2Error(r){this.name="Bzip2Error";this.message=r;this.stack=(new Error).stack}Bzip2Error.prototype=new Error;var n={Error:function(r){throw new Bzip2Error(r)}};var a={};a.Bzip2Error=Bzip2Error;a.crcTable=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];a.array=function(r){var n=0,a=0;var s=[0,1,3,7,15,31,63,127,255];return function(u){var l=0;while(u>0){var d=8-n;if(u>=d){l<<=d;l|=s[d]&r[a++];n=0;u-=d}else{l<<=u;l|=(r[a]&s[u]<<8-u-n)>>8-u-n;n+=u;u=0}}return l}};a.simple=function(r,n){var s=a.array(r);var u=a.header(s);var l=false;var d=1e5*u;var p=new Int32Array(d);do{l=a.decompress(s,n,p,d)}while(!l)};a.header=function(r){this.byteCount=new Int32Array(256);this.symToByte=new Uint8Array(256);this.mtfSymbol=new Int32Array(256);this.selectors=new Uint8Array(32768);if(r(8*3)!=4348520)n.Error("No magic number found");var a=r(8)-48;if(a<1||a>9)n.Error("Not a BZIP archive");return a};a.decompress=function(r,a,s,u,l){var d=20;var p=258;var m=0;var g=1;var y=50;var b=0^-1;for(var w="",x=0;x<6;x++)w+=r(8).toString(16);if(w=="177245385090"){var _=r(32)|0;if(_!==l)n.Error("Error in bzip2: crc32 do not match");r(null);return null}if(w!="314159265359")n.Error("eek not valid bzip data");var S=r(32)|0;if(r(1))n.Error("unsupported obsolete version");var v=r(24);if(v>u)n.Error("Initial position larger than buffer size");var k=r(16);var E=0;for(x=0;x<16;x++){if(k&1<<15-x){var C=r(16);for(B=0;B<16;B++){if(C&1<<15-B){this.symToByte[E++]=16*x+B}}}}var F=r(3);if(F<2||F>6)n.Error("another error");var T=r(15);if(T==0)n.Error("meh");for(var x=0;x<F;x++)this.mtfSymbol[x]=x;for(var x=0;x<T;x++){for(var B=0;r(1);B++)if(B>=F)n.Error("whoops another error");var z=this.mtfSymbol[B];for(var C=B-1;C>=0;C--){this.mtfSymbol[C+1]=this.mtfSymbol[C]}this.mtfSymbol[0]=z;this.selectors[x]=z}var A=E+2;var O=[];var L=new Uint8Array(p),R=new Uint16Array(d+1);var U;for(var B=0;B<F;B++){k=r(5);for(var x=0;x<A;x++){while(true){if(k<1||k>d)n.Error("I gave up a while ago on writing error messages");if(!r(1))break;if(!r(1))k++;else k--}L[x]=k}var I,D;I=D=L[0];for(var x=1;x<A;x++){if(L[x]>D)D=L[x];else if(L[x]<I)I=L[x]}U=O[B]={};U.permute=new Int32Array(p);U.limit=new Int32Array(d+1);U.base=new Int32Array(d+1);U.minLen=I;U.maxLen=D;var P=U.base;var M=U.limit;var N=0;for(var x=I;x<=D;x++)for(var k=0;k<A;k++)if(L[k]==x)U.permute[N++]=k;for(x=I;x<=D;x++)R[x]=M[x]=0;for(x=0;x<A;x++)R[L[x]]++;N=k=0;for(x=I;x<D;x++){N+=R[x];M[x]=N-1;N<<=1;P[x+1]=N-(k+=R[x])}M[D]=N+R[D]-1;P[I]=0}for(var x=0;x<256;x++){this.mtfSymbol[x]=x;this.byteCount[x]=0}var j,W,A,$;j=W=A=$=0;while(true){if(!A--){A=y-1;if($>=T)n.Error("meow i'm a kitty, that's an error");U=O[this.selectors[$++]];P=U.base;M=U.limit}x=U.minLen;B=r(x);while(true){if(x>U.maxLen)n.Error("rawr i'm a dinosaur");if(B<=M[x])break;x++;B=B<<1|r(1)}B-=P[x];if(B<0||B>=p)n.Error("moo i'm a cow");var q=U.permute[B];if(q==m||q==g){if(!j){j=1;k=0}if(q==m)k+=j;else k+=2*j;j<<=1;continue}if(j){j=0;if(W+k>u)n.Error("Boom.");z=this.symToByte[this.mtfSymbol[0]];this.byteCount[z]+=k;while(k--)s[W++]=z}if(q>E)break;if(W>=u)n.Error("I can't think of anything. Error");x=q-1;z=this.mtfSymbol[x];for(var C=x-1;C>=0;C--){this.mtfSymbol[C+1]=this.mtfSymbol[C]}this.mtfSymbol[0]=z;z=this.symToByte[z];this.byteCount[z]++;s[W++]=z}if(v<0||v>=W)n.Error("I'm a monkey and I'm throwing something at someone, namely you");var B=0;for(var x=0;x<256;x++){C=B+this.byteCount[x];this.byteCount[x]=B;B=C}for(var x=0;x<W;x++){z=s[x]&255;s[this.byteCount[z]]|=x<<8;this.byteCount[z]++}var H=0,Z=0,G=0;if(W){H=s[v];Z=H&255;H>>=8;G=-1}W=W;var V,Y,K;while(W){W--;Y=Z;H=s[H];Z=H&255;H>>=8;if(G++==3){V=Z;K=Y;Z=-1}else{V=1;K=Z}while(V--){b=(b<<8^this.crcTable[(b>>24^K)&255])&4294967295;a(K)}if(Z!=Y)G=0}b=(b^-1)>>>0;if((b|0)!=(S|0))n.Error("Error in bzip2: crc32 do not match");l=(b^(l<<1|l>>>31))&4294967295;return l};r.exports=a},9491:n=>{n.exports=r(import.meta.url)("assert")},2057:n=>{n.exports=r(import.meta.url)("constants")},2361:n=>{n.exports=r(import.meta.url)("events")},7147:n=>{n.exports=r(import.meta.url)("fs")},2037:n=>{n.exports=r(import.meta.url)("os")},1017:n=>{n.exports=r(import.meta.url)("path")},2781:n=>{n.exports=r(import.meta.url)("stream")},6224:n=>{n.exports=r(import.meta.url)("tty")},3837:n=>{n.exports=r(import.meta.url)("util")},9796:n=>{n.exports=r(import.meta.url)("zlib")},6507:r=>{r.exports=JSON.parse('{"name":"seek-bzip","version":"2.0.0","contributors":["C. Scott Ananian (http://cscott.net)","Eli Skeggs","Kevin Kwok","Rob Landley (http://landley.net)"],"description":"a pure-JavaScript Node.JS module for random-access decoding bzip2 data","main":"./lib/index.js","repository":{"type":"git","url":"https://github.com/cscott/seek-bzip.git"},"license":"MIT","bin":{"seek-bunzip":"./bin/seek-bunzip","seek-table":"./bin/seek-bzip-table"},"directories":{"test":"test"},"dependencies":{"commander":"^6.0.0"},"devDependencies":{"fibers":"^5.0.0","mocha":"^8.1.0"},"scripts":{"test":"mocha"}}')}};var a={};function __nccwpck_require__(r){var s=a[r];if(s!==undefined){return s.exports}var u=a[r]={exports:{}};var l=true;try{n[r](u,u.exports,__nccwpck_require__);l=false}finally{if(l)delete a[r]}return u.exports}(()=>{__nccwpck_require__.d=(r,n)=>{for(var a in n){if(__nccwpck_require__.o(n,a)&&!__nccwpck_require__.o(r,a)){Object.defineProperty(r,a,{enumerable:true,get:n[a]})}}}})();(()=>{__nccwpck_require__.o=(r,n)=>Object.prototype.hasOwnProperty.call(r,n)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var s={};(()=>{__nccwpck_require__.d(s,{l:()=>assertSafeEntryPath,Z:()=>Vt});const n=r(import.meta.url)("node:buffer");const a=r(import.meta.url)("node:fs");const u=r(import.meta.url)("node:fs/promises");const l=r(import.meta.url)("node:path");const d=r(import.meta.url)("node:process");const p=r(import.meta.url)("node:util");var m=__nccwpck_require__(3092);const g={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};const y={};for(const[r,n]of Object.entries(g)){y[n]=Number.parseInt(r,10)}let b;let w;function utf8Decoder(){if(typeof globalThis.TextDecoder==="undefined")return undefined;return b!==null&&b!==void 0?b:b=new globalThis.TextDecoder("utf-8")}function utf8Encoder(){if(typeof globalThis.TextEncoder==="undefined")return undefined;return w!==null&&w!==void 0?w:w=new globalThis.TextEncoder}const x=32*1024;const _=65533;function textDecode(r,n="utf-8"){switch(n.toLowerCase()){case"utf-8":case"utf8":{const n=utf8Decoder();return n?n.decode(r):decodeUTF8(r)}case"utf-16le":return decodeUTF16LE(r);case"us-ascii":case"ascii":return decodeASCII(r);case"latin1":case"iso-8859-1":return decodeLatin1(r);case"windows-1252":return decodeWindows1252(r);default:throw new RangeError(`Encoding '${n}' not supported`)}}function textEncode(r="",n="utf-8"){switch(n.toLowerCase()){case"utf-8":case"utf8":{const n=utf8Encoder();return n?n.encode(r):encodeUTF8(r)}case"utf-16le":return encodeUTF16LE(r);case"us-ascii":case"ascii":return encodeASCII(r);case"latin1":case"iso-8859-1":return encodeLatin1(r);case"windows-1252":return encodeWindows1252(r);default:throw new RangeError(`Encoding '${n}' not supported`)}}function appendCodePoint(r,n){if(n<=65535){r.push(String.fromCharCode(n));return}n-=65536;r.push(String.fromCharCode(55296+(n>>10),56320+(n&1023)))}function flushChunk(r,n){if(n.length===0)return;r.push(String.fromCharCode.apply(null,n));n.length=0}function pushCodeUnit(r,n,a){n.push(a);if(n.length>=x)flushChunk(r,n)}function pushCodePoint(r,n,a){if(a<=65535){pushCodeUnit(r,n,a);return}a-=65536;pushCodeUnit(r,n,55296+(a>>10));pushCodeUnit(r,n,56320+(a&1023))}function decodeUTF8(r){const n=[];const a=[];let s=0;if(r.length>=3&&r[0]===239&&r[1]===187&&r[2]===191){s=3}while(s<r.length){const u=r[s];if(u<=127){pushCodeUnit(n,a,u);s++;continue}if(u<194||u>244){pushCodeUnit(n,a,_);s++;continue}if(u<=223){if(s+1>=r.length){pushCodeUnit(n,a,_);s++;continue}const l=r[s+1];if((l&192)!==128){pushCodeUnit(n,a,_);s++;continue}const d=(u&31)<<6|l&63;pushCodeUnit(n,a,d);s+=2;continue}if(u<=239){if(s+2>=r.length){pushCodeUnit(n,a,_);s++;continue}const l=r[s+1];const d=r[s+2];const p=(l&192)===128&&(d&192)===128&&!(u===224&&l<160)&&!(u===237&&l>=160);if(!p){pushCodeUnit(n,a,_);s++;continue}const m=(u&15)<<12|(l&63)<<6|d&63;pushCodeUnit(n,a,m);s+=3;continue}if(s+3>=r.length){pushCodeUnit(n,a,_);s++;continue}const l=r[s+1];const d=r[s+2];const p=r[s+3];const m=(l&192)===128&&(d&192)===128&&(p&192)===128&&!(u===240&&l<144)&&!(u===244&&l>143);if(!m){pushCodeUnit(n,a,_);s++;continue}const g=(u&7)<<18|(l&63)<<12|(d&63)<<6|p&63;pushCodePoint(n,a,g);s+=4}flushChunk(n,a);return n.join("")}function decodeUTF16LE(r){const n=[];const a=[];const s=r.length;let u=0;while(u+1<s){const l=r[u]|r[u+1]<<8;u+=2;if(l>=55296&&l<=56319){if(u+1<s){const s=r[u]|r[u+1]<<8;if(s>=56320&&s<=57343){pushCodeUnit(n,a,l);pushCodeUnit(n,a,s);u+=2}else{pushCodeUnit(n,a,_)}}else{pushCodeUnit(n,a,_)}continue}if(l>=56320&&l<=57343){pushCodeUnit(n,a,_);continue}pushCodeUnit(n,a,l)}if(u<s){pushCodeUnit(n,a,_)}flushChunk(n,a);return n.join("")}function decodeASCII(r){const n=[];for(let a=0;a<r.length;a+=x){const s=Math.min(r.length,a+x);const u=new Array(s-a);for(let n=a,l=0;n<s;n++,l++){u[l]=r[n]&127}n.push(String.fromCharCode.apply(null,u))}return n.join("")}function decodeLatin1(r){const n=[];for(let a=0;a<r.length;a+=x){const s=Math.min(r.length,a+x);const u=new Array(s-a);for(let n=a,l=0;n<s;n++,l++){u[l]=r[n]}n.push(String.fromCharCode.apply(null,u))}return n.join("")}function decodeWindows1252(r){const n=[];let a="";for(let s=0;s<r.length;s++){const u=r[s];const l=u>=128&&u<=159?g[u]:undefined;a+=l!==null&&l!==void 0?l:String.fromCharCode(u);if(a.length>=x){n.push(a);a=""}}if(a)n.push(a);return n.join("")}function encodeUTF8(r){const n=[];for(let a=0;a<r.length;a++){let s=r.charCodeAt(a);if(s>=55296&&s<=56319){if(a+1<r.length){const n=r.charCodeAt(a+1);if(n>=56320&&n<=57343){s=65536+(s-55296<<10)+(n-56320);a++}else{s=_}}else{s=_}}else if(s>=56320&&s<=57343){s=_}if(s<128){n.push(s)}else if(s<2048){n.push(192|s>>6,128|s&63)}else if(s<65536){n.push(224|s>>12,128|s>>6&63,128|s&63)}else{n.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63)}}return new Uint8Array(n)}function encodeUTF16LE(r){const n=[];for(let a=0;a<r.length;a++){const s=r.charCodeAt(a);if(s>=55296&&s<=56319){if(a+1<r.length){const u=r.charCodeAt(a+1);if(u>=56320&&u<=57343){n.push(s,u);a++}else{n.push(_)}}else{n.push(_)}continue}if(s>=56320&&s<=57343){n.push(_);continue}n.push(s)}const a=new Uint8Array(n.length*2);for(let r=0;r<n.length;r++){const s=n[r];const u=r*2;a[u]=s&255;a[u+1]=s>>>8}return a}function encodeASCII(r){const n=new Uint8Array(r.length);for(let a=0;a<r.length;a++)n[a]=r.charCodeAt(a)&127;return n}function encodeLatin1(r){const n=new Uint8Array(r.length);for(let a=0;a<r.length;a++)n[a]=r.charCodeAt(a)&255;return n}function encodeWindows1252(r){const n=new Uint8Array(r.length);for(let a=0;a<r.length;a++){const s=r[a];const u=s.charCodeAt(0);if(y[s]!==undefined){n[a]=y[s];continue}if(u>=0&&u<=127||u>=160&&u<=255){n[a]=u;continue}n[a]=63}return n}function dv(r){return new DataView(r.buffer,r.byteOffset)}const S={len:1,get(r,n){return dv(r).getUint8(n)},put(r,n,a){dv(r).setUint8(n,a);return n+1}};const v={len:2,get(r,n){return dv(r).getUint16(n,true)},put(r,n,a){dv(r).setUint16(n,a,true);return n+2}};const k={len:2,get(r,n){return dv(r).getUint16(n)},put(r,n,a){dv(r).setUint16(n,a);return n+2}};const E={len:3,get(r,n){const a=dv(r);return a.getUint8(n)+(a.getUint16(n+1,true)<<8)},put(r,n,a){const s=dv(r);s.setUint8(n,a&255);s.setUint16(n+1,a>>8,true);return n+3}};const C={len:3,get(r,n){const a=dv(r);return(a.getUint16(n)<<8)+a.getUint8(n+2)},put(r,n,a){const s=dv(r);s.setUint16(n,a>>8);s.setUint8(n+2,a&255);return n+3}};const F={len:4,get(r,n){return dv(r).getUint32(n,true)},put(r,n,a){dv(r).setUint32(n,a,true);return n+4}};const T={len:4,get(r,n){return dv(r).getUint32(n)},put(r,n,a){dv(r).setUint32(n,a);return n+4}};const B={len:1,get(r,n){return dv(r).getInt8(n)},put(r,n,a){dv(r).setInt8(n,a);return n+1}};const z={len:2,get(r,n){return dv(r).getInt16(n)},put(r,n,a){dv(r).setInt16(n,a);return n+2}};const A={len:2,get(r,n){return dv(r).getInt16(n,true)},put(r,n,a){dv(r).setInt16(n,a,true);return n+2}};const O={len:3,get(r,n){const a=E.get(r,n);return a>8388607?a-16777216:a},put(r,n,a){const s=dv(r);s.setUint8(n,a&255);s.setUint16(n+1,a>>8,true);return n+3}};const L={len:3,get(r,n){const a=C.get(r,n);return a>8388607?a-16777216:a},put(r,n,a){const s=dv(r);s.setUint16(n,a>>8);s.setUint8(n+2,a&255);return n+3}};const R={len:4,get(r,n){return dv(r).getInt32(n)},put(r,n,a){dv(r).setInt32(n,a);return n+4}};const U={len:4,get(r,n){return dv(r).getInt32(n,true)},put(r,n,a){dv(r).setInt32(n,a,true);return n+4}};const I={len:8,get(r,n){return dv(r).getBigUint64(n,true)},put(r,n,a){dv(r).setBigUint64(n,a,true);return n+8}};const D={len:8,get(r,n){return dv(r).getBigInt64(n,true)},put(r,n,a){dv(r).setBigInt64(n,a,true);return n+8}};const P={len:8,get(r,n){return dv(r).getBigUint64(n)},put(r,n,a){dv(r).setBigUint64(n,a);return n+8}};const M={len:8,get(r,n){return dv(r).getBigInt64(n)},put(r,n,a){dv(r).setBigInt64(n,a);return n+8}};const N={len:2,get(r,n){return m.i(r,n,false,10,this.len)},put(r,n,a){m.c(r,a,n,false,10,this.len);return n+this.len}};const j={len:2,get(r,n){return m.i(r,n,true,10,this.len)},put(r,n,a){m.c(r,a,n,true,10,this.len);return n+this.len}};const W={len:4,get(r,n){return dv(r).getFloat32(n)},put(r,n,a){dv(r).setFloat32(n,a);return n+4}};const $={len:4,get(r,n){return dv(r).getFloat32(n,true)},put(r,n,a){dv(r).setFloat32(n,a,true);return n+4}};const q={len:8,get(r,n){return dv(r).getFloat64(n)},put(r,n,a){dv(r).setFloat64(n,a);return n+8}};const H={len:8,get(r,n){return dv(r).getFloat64(n,true)},put(r,n,a){dv(r).setFloat64(n,a,true);return n+8}};const Z={len:10,get(r,n){return m.i(r,n,false,63,this.len)},put(r,n,a){m.c(r,a,n,false,63,this.len);return n+this.len}};const G={len:10,get(r,n){return m.i(r,n,true,63,this.len)},put(r,n,a){m.c(r,a,n,true,63,this.len);return n+this.len}};class IgnoreType{constructor(r){this.len=r}get(r,n){}}class Uint8ArrayType{constructor(r){this.len=r}get(r,n){return r.subarray(n,n+this.len)}}class StringType{constructor(r,n){this.len=r;this.encoding=n}get(r,n=0){const a=r.subarray(n,n+this.len);return textDecode(a,this.encoding)}}class AnsiStringType extends(null&&StringType){constructor(r){super(r,"windows-1252")}}const V="End-Of-Stream";class EndOfStreamError extends Error{constructor(){super(V);this.name="EndOfStreamError"}}class Errors_AbortError extends Error{constructor(r="The operation was aborted"){super(r);this.name="AbortError"}}class AbstractStreamReader_AbstractStreamReader{constructor(){this.endOfStream=false;this.interrupted=false;this.peekQueue=[]}async peek(r,n=false){const a=await this.read(r,n);this.peekQueue.push(r.subarray(0,a));return a}async read(r,n=false){if(r.length===0){return 0}let a=this.readFromPeekBuffer(r);if(!this.endOfStream){a+=await this.readRemainderFromStream(r.subarray(a),n)}if(a===0&&!n){throw new EndOfStreamError}return a}readFromPeekBuffer(r){let n=r.length;let a=0;while(this.peekQueue.length>0&&n>0){const s=this.peekQueue.pop();if(!s)throw new Error("peekData should be defined");const u=Math.min(s.length,n);r.set(s.subarray(0,u),a);a+=u;n-=u;if(u<s.length){this.peekQueue.push(s.subarray(u))}}return a}async readRemainderFromStream(r,n){let a=0;while(a<r.length&&!this.endOfStream){if(this.interrupted){throw new Errors_AbortError}const s=await this.readFromStream(r.subarray(a),n);if(s===0)break;a+=s}if(!n&&a<r.length){throw new EndOfStreamError}return a}}class StreamReader_StreamReader extends(null&&AbstractStreamReader){constructor(r){super();this.s=r;this.deferred=null;if(!r.read||!r.once){throw new Error("Expected an instance of stream.Readable")}this.s.once("end",(()=>{this.endOfStream=true;if(this.deferred){this.deferred.resolve(0)}}));this.s.once("error",(r=>this.reject(r)));this.s.once("close",(()=>this.abort()))}async readFromStream(r,n){if(r.length===0)return 0;const a=this.s.read(r.length);if(a){r.set(a);return a.length}const s={buffer:r,mayBeLess:n,deferred:new Deferred};this.deferred=s.deferred;this.s.once("readable",(()=>{this.readDeferred(s)}));return s.deferred.promise}readDeferred(r){const n=this.s.read(r.buffer.length);if(n){r.buffer.set(n);r.deferred.resolve(n.length);this.deferred=null}else{this.s.once("readable",(()=>{this.readDeferred(r)}))}}reject(r){this.interrupted=true;if(this.deferred){this.deferred.reject(r);this.deferred=null}}async abort(){this.reject(new AbortError)}async close(){return this.abort()}}class WebStreamReader extends AbstractStreamReader_AbstractStreamReader{constructor(r){super();this.reader=r}async abort(){return this.close()}async close(){this.reader.releaseLock()}}class WebStreamByobReader extends WebStreamReader{async readFromStream(r,n){if(r.length===0)return 0;const a=await this.reader.read(new Uint8Array(r.length),{min:n?undefined:r.length});if(a.done){this.endOfStream=a.done}if(a.value){r.set(a.value);return a.value.length}return 0}}class WebStreamDefaultReader extends AbstractStreamReader_AbstractStreamReader{constructor(r){super();this.reader=r;this.buffer=null}writeChunk(r,n){const a=Math.min(n.length,r.length);r.set(n.subarray(0,a));if(a<n.length){this.buffer=n.subarray(a)}else{this.buffer=null}return a}async readFromStream(r,n){if(r.length===0)return 0;let a=0;if(this.buffer){a+=this.writeChunk(r,this.buffer)}while(a<r.length&&!this.endOfStream){const n=await this.reader.read();if(n.done){this.endOfStream=true;break}if(n.value){a+=this.writeChunk(r.subarray(a),n.value)}}if(!n&&a===0&&this.endOfStream){throw new EndOfStreamError}return a}abort(){this.interrupted=true;return this.reader.cancel()}async close(){await this.abort();this.reader.releaseLock()}}function makeWebStreamReader(r){try{const n=r.getReader({mode:"byob"});if(n instanceof ReadableStreamDefaultReader){return new WebStreamDefaultReader(n)}return new WebStreamByobReader(n)}catch(n){if(n instanceof TypeError){return new WebStreamDefaultReader(r.getReader())}throw n}}class AbstractTokenizer{constructor(r){this.numBuffer=new Uint8Array(8);this.position=0;this.onClose=r?.onClose;if(r?.abortSignal){r.abortSignal.addEventListener("abort",(()=>{this.abort()}))}}async readToken(r,n=this.position){const a=new Uint8Array(r.len);const s=await this.readBuffer(a,{position:n});if(s<r.len)throw new EndOfStreamError;return r.get(a,0)}async peekToken(r,n=this.position){const a=new Uint8Array(r.len);const s=await this.peekBuffer(a,{position:n});if(s<r.len)throw new EndOfStreamError;return r.get(a,0)}async readNumber(r){const n=await this.readBuffer(this.numBuffer,{length:r.len});if(n<r.len)throw new EndOfStreamError;return r.get(this.numBuffer,0)}async peekNumber(r){const n=await this.peekBuffer(this.numBuffer,{length:r.len});if(n<r.len)throw new EndOfStreamError;return r.get(this.numBuffer,0)}async ignore(r){if(r<0){throw new RangeError("ignore length must be ≥ 0 bytes")}if(this.fileInfo.size!==undefined){const n=this.fileInfo.size-this.position;if(r>n){this.position+=n;return n}}this.position+=r;return r}async close(){await this.abort();await(this.onClose?.())}normalizeOptions(r,n){if(!this.supportsRandomAccess()&&n&&n.position!==undefined&&n.position<this.position){throw new Error("`options.position` must be equal or greater than `tokenizer.position`")}return{...{mayBeLess:false,offset:0,length:r.length,position:this.position},...n}}abort(){return Promise.resolve()}}const Y=256e3;class ReadStreamTokenizer_ReadStreamTokenizer extends AbstractTokenizer{constructor(r,n){super(n);this.streamReader=r;this.fileInfo=n?.fileInfo??{}}async readBuffer(r,n){const a=this.normalizeOptions(r,n);const s=a.position-this.position;if(s>0){await this.ignore(s);return this.readBuffer(r,n)}if(s<0){throw new Error("`options.position` must be equal or greater than `tokenizer.position`")}if(a.length===0){return 0}const u=await this.streamReader.read(r.subarray(0,a.length),a.mayBeLess);this.position+=u;if((!n||!n.mayBeLess)&&u<a.length){throw new EndOfStreamError}return u}async peekBuffer(r,n){const a=this.normalizeOptions(r,n);let s=0;if(a.position){const n=a.position-this.position;if(n>0){const u=new Uint8Array(a.length+n);s=await this.peekBuffer(u,{mayBeLess:a.mayBeLess});r.set(u.subarray(n));return s-n}if(n<0){throw new Error("Cannot peek from a negative offset in a stream")}}if(a.length>0){try{s=await this.streamReader.peek(r.subarray(0,a.length),a.mayBeLess)}catch(r){if(n?.mayBeLess&&r instanceof EndOfStreamError){return 0}throw r}if(!a.mayBeLess&&s<a.length){throw new EndOfStreamError}}return s}async ignore(r){if(r<0){throw new RangeError("ignore length must be ≥ 0 bytes")}const n=Math.min(Y,r);const a=new Uint8Array(n);let s=0;while(s<r){const u=r-s;const l=await this.readBuffer(a,{length:Math.min(n,u)});if(l<0){return l}s+=l}return s}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return false}}class BufferTokenizer extends AbstractTokenizer{constructor(r,n){super(n);this.uint8Array=r;this.fileInfo={...n?.fileInfo??{},...{size:r.length}}}async readBuffer(r,n){if(n?.position){this.position=n.position}const a=await this.peekBuffer(r,n);this.position+=a;return a}async peekBuffer(r,n){const a=this.normalizeOptions(r,n);const s=Math.min(this.uint8Array.length-a.position,a.length);if(!a.mayBeLess&&s<a.length){throw new EndOfStreamError}r.set(this.uint8Array.subarray(a.position,a.position+s));return s}close(){return super.close()}supportsRandomAccess(){return true}setPosition(r){this.position=r}}class BlobTokenizer extends AbstractTokenizer{constructor(r,n){super(n);this.blob=r;this.fileInfo={...n?.fileInfo??{},...{size:r.size,mimeType:r.type}}}async readBuffer(r,n){if(n?.position){this.position=n.position}const a=await this.peekBuffer(r,n);this.position+=a;return a}async peekBuffer(r,n){const a=this.normalizeOptions(r,n);const s=Math.min(this.blob.size-a.position,a.length);if(!a.mayBeLess&&s<a.length){throw new EndOfStreamError}const u=await this.blob.slice(a.position,a.position+s).arrayBuffer();r.set(new Uint8Array(u));return s}close(){return super.close()}supportsRandomAccess(){return true}setPosition(r){this.position=r}}function fromStream(r,n){const a=new StreamReader(r);const s=n??{};const u=s.onClose;s.onClose=async()=>{await a.close();if(u){return u()}};return new ReadStreamTokenizer(a,s)}function fromWebStream(r,n){const a=makeWebStreamReader(r);const s=n??{};const u=s.onClose;s.onClose=async()=>{await a.close();if(u){return u()}};return new ReadStreamTokenizer_ReadStreamTokenizer(a,s)}function fromBuffer(r,n){return new BufferTokenizer(r,n)}function fromBlob(r,n){return new BlobTokenizer(r,n)}function lib_dv(r){return new DataView(r.buffer,r.byteOffset)}const K={len:1,get(r,n){return lib_dv(r).getUint8(n)},put(r,n,a){lib_dv(r).setUint8(n,a);return n+1}};const X={len:2,get(r,n){return lib_dv(r).getUint16(n,true)},put(r,n,a){lib_dv(r).setUint16(n,a,true);return n+2}};const Q={len:2,get(r,n){return lib_dv(r).getUint16(n)},put(r,n,a){lib_dv(r).setUint16(n,a);return n+2}};const J={len:3,get(r,n){const a=lib_dv(r);return a.getUint8(n)+(a.getUint16(n+1,true)<<8)},put(r,n,a){const s=lib_dv(r);s.setUint8(n,a&255);s.setUint16(n+1,a>>8,true);return n+3}};const ee={len:3,get(r,n){const a=lib_dv(r);return(a.getUint16(n)<<8)+a.getUint8(n+2)},put(r,n,a){const s=lib_dv(r);s.setUint16(n,a>>8);s.setUint8(n+2,a&255);return n+3}};const te={len:4,get(r,n){return lib_dv(r).getUint32(n,true)},put(r,n,a){lib_dv(r).setUint32(n,a,true);return n+4}};const re={len:4,get(r,n){return lib_dv(r).getUint32(n)},put(r,n,a){lib_dv(r).setUint32(n,a);return n+4}};const ne={len:1,get(r,n){return lib_dv(r).getInt8(n)},put(r,n,a){lib_dv(r).setInt8(n,a);return n+1}};const ie={len:2,get(r,n){return lib_dv(r).getInt16(n)},put(r,n,a){lib_dv(r).setInt16(n,a);return n+2}};const oe={len:2,get(r,n){return lib_dv(r).getInt16(n,true)},put(r,n,a){lib_dv(r).setInt16(n,a,true);return n+2}};const ae={len:3,get(r,n){const a=J.get(r,n);return a>8388607?a-16777216:a},put(r,n,a){const s=lib_dv(r);s.setUint8(n,a&255);s.setUint16(n+1,a>>8,true);return n+3}};const se={len:3,get(r,n){const a=ee.get(r,n);return a>8388607?a-16777216:a},put(r,n,a){const s=lib_dv(r);s.setUint16(n,a>>8);s.setUint8(n+2,a&255);return n+3}};const ce={len:4,get(r,n){return lib_dv(r).getInt32(n)},put(r,n,a){lib_dv(r).setInt32(n,a);return n+4}};const ue={len:4,get(r,n){return lib_dv(r).getInt32(n,true)},put(r,n,a){lib_dv(r).setInt32(n,a,true);return n+4}};const fe={len:8,get(r,n){return lib_dv(r).getBigUint64(n,true)},put(r,n,a){lib_dv(r).setBigUint64(n,a,true);return n+8}};const le={len:8,get(r,n){return lib_dv(r).getBigInt64(n,true)},put(r,n,a){lib_dv(r).setBigInt64(n,a,true);return n+8}};const de={len:8,get(r,n){return lib_dv(r).getBigUint64(n)},put(r,n,a){lib_dv(r).setBigUint64(n,a);return n+8}};const he={len:8,get(r,n){return lib_dv(r).getBigInt64(n)},put(r,n,a){lib_dv(r).setBigInt64(n,a);return n+8}};const pe={len:2,get(r,n){return m.i(r,n,false,10,this.len)},put(r,n,a){m.c(r,a,n,false,10,this.len);return n+this.len}};const me={len:2,get(r,n){return m.i(r,n,true,10,this.len)},put(r,n,a){m.c(r,a,n,true,10,this.len);return n+this.len}};const ge={len:4,get(r,n){return lib_dv(r).getFloat32(n)},put(r,n,a){lib_dv(r).setFloat32(n,a);return n+4}};const ye={len:4,get(r,n){return lib_dv(r).getFloat32(n,true)},put(r,n,a){lib_dv(r).setFloat32(n,a,true);return n+4}};const be={len:8,get(r,n){return lib_dv(r).getFloat64(n)},put(r,n,a){lib_dv(r).setFloat64(n,a);return n+8}};const we={len:8,get(r,n){return lib_dv(r).getFloat64(n,true)},put(r,n,a){lib_dv(r).setFloat64(n,a,true);return n+8}};const xe={len:10,get(r,n){return m.i(r,n,false,63,this.len)},put(r,n,a){m.c(r,a,n,false,63,this.len);return n+this.len}};const _e={len:10,get(r,n){return m.i(r,n,true,63,this.len)},put(r,n,a){m.c(r,a,n,true,63,this.len);return n+this.len}};class lib_IgnoreType{constructor(r){this.len=r}get(r,n){}}class lib_Uint8ArrayType{constructor(r){this.len=r}get(r,n){return r.subarray(n,n+this.len)}}class lib_StringType{constructor(r,n){this.len=r;this.encoding=n}get(r,n=0){const a=r.subarray(n,n+this.len);return textDecode(a,this.encoding)}}class lib_AnsiStringType extends(null&&lib_StringType){constructor(r){super(r,"windows-1252")}}var Se=__nccwpck_require__(6657);const ve={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256};const ke={get(r){return{signature:te.get(r,0),compressedSize:te.get(r,8),uncompressedSize:te.get(r,12)}},len:16};const Ee={get(r){const n=X.get(r,6);return{signature:te.get(r,0),minVersion:X.get(r,4),dataDescriptor:!!(n&8),compressedMethod:X.get(r,8),compressedSize:te.get(r,18),uncompressedSize:te.get(r,22),filenameLength:X.get(r,26),extraFieldLength:X.get(r,28),filename:null}},len:30};const Ce={get(r){return{signature:te.get(r,0),nrOfThisDisk:X.get(r,4),nrOfThisDiskWithTheStart:X.get(r,6),nrOfEntriesOnThisDisk:X.get(r,8),nrOfEntriesOfSize:X.get(r,10),sizeOfCd:te.get(r,12),offsetOfStartOfCd:te.get(r,16),zipFileCommentLength:X.get(r,20)}},len:22};const Fe={get(r){const n=X.get(r,8);return{signature:te.get(r,0),minVersion:X.get(r,6),dataDescriptor:!!(n&8),compressedMethod:X.get(r,10),compressedSize:te.get(r,20),uncompressedSize:te.get(r,24),filenameLength:X.get(r,28),extraFieldLength:X.get(r,30),fileCommentLength:X.get(r,32),relativeOffsetOfLocalHeader:te.get(r,42),filename:null}},len:46};function signatureToArray(r){const n=new Uint8Array(te.len);te.put(n,0,r);return n}const Te=Se("tokenizer:inflate");const Be=256*1024;const ze=signatureToArray(ve.DataDescriptor);const Ae=signatureToArray(ve.EndOfCentralDirectory);class ZipHandler{constructor(r){this.tokenizer=r;this.syncBuffer=new Uint8Array(Be)}async isZip(){return await this.peekSignature()===ve.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(te)}async findEndOfCentralDirectoryLocator(){const r=this.tokenizer;const n=Math.min(16*1024,r.fileInfo.size);const a=this.syncBuffer.subarray(0,n);await this.tokenizer.readBuffer(a,{position:r.fileInfo.size-n});for(let s=a.length-4;s>=0;s--){if(a[s]===Ae[0]&&a[s+1]===Ae[1]&&a[s+2]===Ae[2]&&a[s+3]===Ae[3]){return r.fileInfo.size-n+s}}return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){Te("Cannot reading central-directory without random-read support");return}Te("Reading central-directory...");const r=this.tokenizer.position;const n=await this.findEndOfCentralDirectoryLocator();if(n>0){Te("Central-directory 32-bit signature found");const a=await this.tokenizer.readToken(Ce,n);const s=[];this.tokenizer.setPosition(a.offsetOfStartOfCd);for(let r=0;r<a.nrOfEntriesOfSize;++r){const n=await this.tokenizer.readToken(Fe);if(n.signature!==ve.CentralFileHeader){throw new Error("Expected Central-File-Header signature")}n.filename=await this.tokenizer.readToken(new lib_StringType(n.filenameLength,"utf-8"));await this.tokenizer.ignore(n.extraFieldLength);await this.tokenizer.ignore(n.fileCommentLength);s.push(n);Te(`Add central-directory file-entry: n=${r+1}/${s.length}: filename=${s[r].filename}`)}this.tokenizer.setPosition(r);return s}this.tokenizer.setPosition(r)}async unzip(r){const n=await this.readCentralDirectory();if(n){return this.iterateOverCentralDirectory(n,r)}let a=false;do{const n=await this.readLocalFileHeader();if(!n)break;const s=r(n);a=!!s.stop;let u;await this.tokenizer.ignore(n.extraFieldLength);if(n.dataDescriptor&&n.compressedSize===0){const r=[];let a=Be;Te("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let u=-1;while(u<0&&a===Be){a=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:true});u=indexOf(this.syncBuffer.subarray(0,a),ze);const n=u>=0?u:a;if(s.handler){const a=new Uint8Array(n);await this.tokenizer.readBuffer(a);r.push(a)}else{await this.tokenizer.ignore(n)}}Te(`Found data-descriptor-signature at pos=${this.tokenizer.position}`);if(s.handler){await this.inflate(n,mergeArrays(r),s.handler)}}else{if(s.handler){Te(`Reading compressed-file-data: ${n.compressedSize} bytes`);u=new Uint8Array(n.compressedSize);await this.tokenizer.readBuffer(u);await this.inflate(n,u,s.handler)}else{Te(`Ignoring compressed-file-data: ${n.compressedSize} bytes`);await this.tokenizer.ignore(n.compressedSize)}}Te(`Reading data-descriptor at pos=${this.tokenizer.position}`);if(n.dataDescriptor){const r=await this.tokenizer.readToken(ke);if(r.signature!==134695760){throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-ke.len}`)}}}while(!a)}async iterateOverCentralDirectory(r,n){for(const a of r){const r=n(a);if(r.handler){this.tokenizer.setPosition(a.relativeOffsetOfLocalHeader);const n=await this.readLocalFileHeader();if(n){await this.tokenizer.ignore(n.extraFieldLength);const s=new Uint8Array(a.compressedSize);await this.tokenizer.readBuffer(s);await this.inflate(n,s,r.handler)}}if(r.stop)break}}async inflate(r,n,a){if(r.compressedMethod===0){return a(n)}if(r.compressedMethod!==8){throw new Error(`Unsupported ZIP compression method: ${r.compressedMethod}`)}Te(`Decompress filename=${r.filename}, compressed-size=${n.length}`);const s=await ZipHandler.decompressDeflateRaw(n);return a(s)}static async decompressDeflateRaw(r){const n=new ReadableStream({start(n){n.enqueue(r);n.close()}});const a=new DecompressionStream("deflate-raw");const s=n.pipeThrough(a);try{const r=new Response(s);const n=await r.arrayBuffer();return new Uint8Array(n)}catch(r){const n=r instanceof Error?`Failed to deflate ZIP entry: ${r.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(n)}}async readLocalFileHeader(){const r=await this.tokenizer.peekToken(te);if(r===ve.LocalFileHeader){const r=await this.tokenizer.readToken(Ee);r.filename=await this.tokenizer.readToken(new lib_StringType(r.filenameLength,"utf-8"));return r}if(r===ve.CentralFileHeader){return false}if(r===3759263696){throw new Error("Encrypted ZIP")}throw new Error("Unexpected signature")}}function indexOf(r,n){const a=r.length;const s=n.length;if(s>a)return-1;for(let u=0;u<=a-s;u++){let a=true;for(let l=0;l<s;l++){if(r[u+l]!==n[l]){a=false;break}}if(a){return u}}return-1}function mergeArrays(r){const n=r.reduce(((r,n)=>r+n.length),0);const a=new Uint8Array(n);let s=0;for(const n of r){a.set(n,s);s+=n.length}return a}class GzipHandler{constructor(r){this.tokenizer=r}inflate(){const r=this.tokenizer;return new ReadableStream({async pull(n){const a=new Uint8Array(1024);const s=await r.readBuffer(a,{mayBeLess:true});if(s===0){n.close();return}n.enqueue(a.subarray(0,s))}}).pipeThrough(new DecompressionStream("gzip"))}}const Oe=Object.prototype.toString;const Le="[object Uint8Array]";const Re="[object ArrayBuffer]";function isType(r,n,a){if(!r){return false}if(r.constructor===n){return true}return Oe.call(r)===a}function isUint8Array(r){return isType(r,Uint8Array,Le)}function isArrayBuffer(r){return isType(r,ArrayBuffer,Re)}function isUint8ArrayOrArrayBuffer(r){return isUint8Array(r)||isArrayBuffer(r)}function assertUint8Array(r){if(!isUint8Array(r)){throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof r}\``)}}function assertUint8ArrayOrArrayBuffer(r){if(!isUint8ArrayOrArrayBuffer(r)){throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}}function toUint8Array(r){if(r instanceof ArrayBuffer){return new Uint8Array(r)}if(ArrayBuffer.isView(r)){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}throw new TypeError(`Unsupported value, got \`${typeof r}\`.`)}function concatUint8Arrays(r,n){if(r.length===0){return new Uint8Array(0)}n??=r.reduce(((r,n)=>r+n.length),0);const a=new Uint8Array(n);let s=0;for(const n of r){assertUint8Array(n);a.set(n,s);s+=n.length}return a}function areUint8ArraysEqual(r,n){assertUint8Array(r);assertUint8Array(n);if(r===n){return true}if(r.length!==n.length){return false}for(let a=0;a<r.length;a++){if(r[a]!==n[a]){return false}}return true}function compareUint8Arrays(r,n){assertUint8Array(r);assertUint8Array(n);const a=Math.min(r.length,n.length);for(let s=0;s<a;s++){const a=r[s]-n[s];if(a!==0){return Math.sign(a)}}return Math.sign(r.length-n.length)}const Ue={utf8:new globalThis.TextDecoder("utf8")};function uint8ArrayToString(r,n="utf8"){assertUint8ArrayOrArrayBuffer(r);Ue[n]??=new globalThis.TextDecoder(n);return Ue[n].decode(r)}function assertString(r){if(typeof r!=="string"){throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}}const Ie=new globalThis.TextEncoder;function stringToUint8Array(r){assertString(r);return Ie.encode(r)}function base64ToBase64Url(r){return r.replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function base64UrlToBase64(r){return r.replaceAll("-","+").replaceAll("_","/")}const De=65535;function uint8ArrayToBase64(r,{urlSafe:n=false}={}){assertUint8Array(r);let a;if(r.length<De){a=globalThis.btoa(String.fromCodePoint.apply(this,r))}else{a="";for(const n of r){a+=String.fromCodePoint(n)}a=globalThis.btoa(a)}return n?base64ToBase64Url(a):a}function base64ToUint8Array(r){assertString(r);return Uint8Array.from(globalThis.atob(base64UrlToBase64(r)),(r=>r.codePointAt(0)))}function stringToBase64(r,{urlSafe:n=false}={}){assertString(r);return uint8ArrayToBase64(stringToUint8Array(r),{urlSafe:n})}function base64ToString(r){assertString(r);return uint8ArrayToString(base64ToUint8Array(r))}const Pe=Array.from({length:256},((r,n)=>n.toString(16).padStart(2,"0")));function uint8ArrayToHex(r){assertUint8Array(r);let n="";for(let a=0;a<r.length;a++){n+=Pe[r[a]]}return n}const Me={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function hexToUint8Array(r){assertString(r);if(r.length%2!==0){throw new Error("Invalid Hex string length.")}const n=r.length/2;const a=new Uint8Array(n);for(let s=0;s<n;s++){const n=Me[r[s*2]];const u=Me[r[s*2+1]];if(n===undefined||u===undefined){throw new Error(`Invalid Hex character encountered at position ${s*2}`)}a[s]=n<<4|u}return a}function getUintBE(r){const{byteLength:n}=r;if(n===6){return r.getUint16(0)*2**32+r.getUint32(2)}if(n===5){return r.getUint8(0)*2**32+r.getUint32(1)}if(n===4){return r.getUint32(0)}if(n===3){return r.getUint8(0)*2**16+r.getUint16(1)}if(n===2){return r.getUint16(0)}if(n===1){return r.getUint8(0)}}function uint8array_extras_indexOf(r,n){const a=r.length;const s=n.length;if(s===0){return-1}if(s>a){return-1}const u=a-s;for(let a=0;a<=u;a++){let u=true;for(let l=0;l<s;l++){if(r[a+l]!==n[l]){u=false;break}}if(u){return a}}return-1}function includes(r,n){return uint8array_extras_indexOf(r,n)!==-1}function stringToBytes(r,n){if(n==="utf-16le"){const n=[];for(let a=0;a<r.length;a++){const s=r.charCodeAt(a);n.push(s&255,s>>8&255)}return n}if(n==="utf-16be"){const n=[];for(let a=0;a<r.length;a++){const s=r.charCodeAt(a);n.push(s>>8&255,s&255)}return n}return[...r].map((r=>r.charCodeAt(0)))}function tarHeaderChecksumMatches(r,n=0){const a=Number.parseInt(new StringType(6).get(r,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(a)){return false}let s=8*32;for(let a=n;a<n+148;a++){s+=r[a]}for(let a=n+156;a<n+512;a++){s+=r[a]}return a===s}const Ne={get:(r,n)=>r[n+3]&127|r[n+2]<<7|r[n+1]<<14|r[n]<<21,len:4};const je=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"];const We=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"];const $e=4100;const qe=$e-2;const He=1024*1024;const Ze=1024;const Ge=2**31-1;const Ve=16*1024*1024;const Ye=He;const Ke=He;const Xe=Ve;const Qe=1;const Je=100;const et=Ve;const tt=64;const rt=Ye;const nt=256;const it=512;const ot=Ve;const at=512;const st=512;const ct=256;const ut=Ye;const ft=Ye;const lt=Ye;const dt=Ve;const ht=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]);const pt=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "];const mt=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]);class ParserHardLimitError extends Error{}function patchWebByobTokenizerClose(r){const n=r?.streamReader;if(n?.constructor?.name!=="WebStreamByobReader"){return r}const{reader:a}=n;const cancelAndRelease=async()=>{await a.cancel();a.releaseLock()};n.close=cancelAndRelease;n.abort=async()=>{n.interrupted=true;await cancelAndRelease()};return r}function getSafeBound(r,n,a){if(!Number.isFinite(r)||r<0||r>n){throw new ParserHardLimitError(`${a} has invalid size ${r} (maximum ${n} bytes)`)}return r}async function safeIgnore(r,n,{maximumLength:a=Ve,reason:s="skip"}={}){const u=getSafeBound(n,a,s);await r.ignore(u)}async function safeReadBuffer(r,n,a,{maximumLength:s=n.length,reason:u="read"}={}){const l=a?.length??n.length;const d=getSafeBound(l,s,u);return r.readBuffer(n,{...a,length:d})}async function decompressDeflateRawWithLimit(r,{maximumLength:n=He}={}){const a=new ReadableStream({start(n){n.enqueue(r);n.close()}});const s=a.pipeThrough(new DecompressionStream("deflate-raw"));const u=s.getReader();const l=[];let d=0;try{for(;;){const{done:r,value:a}=await u.read();if(r){break}d+=a.length;if(d>n){await u.cancel();throw new Error(`ZIP entry decompressed data exceeds ${n} bytes`)}l.push(a)}}finally{u.releaseLock()}const p=new Uint8Array(d);let m=0;for(const r of l){p.set(r,m);m+=r.length}return p}const gt=134695760;const yt=16;const bt=yt-1;function findZipDataDescriptorOffset(r,n){if(r.length<yt){return-1}const a=r.length-yt;for(let s=0;s<=a;s++){if(F.get(r,s)===gt&&F.get(r,s+8)===n+s){return s}}return-1}function isPngAncillaryChunk(r){return(r.codePointAt(0)&32)!==0}function mergeByteChunks(r,n){const a=new Uint8Array(n);let s=0;for(const n of r){a.set(n,s);s+=n.length}return a}async function readZipDataDescriptorEntryWithLimit(r,{shouldBuffer:n,maximumLength:a=He}={}){const{syncBuffer:s}=r;const{length:u}=s;const l=[];let d=0;for(;;){const p=await r.tokenizer.peekBuffer(s,{mayBeLess:true});const m=findZipDataDescriptorOffset(s.subarray(0,p),d);const g=m>=0?0:p===u?Math.min(bt,p-1):0;const y=m>=0?m:p-g;if(y===0){break}d+=y;if(d>a){throw new Error(`ZIP entry compressed data exceeds ${a} bytes`)}if(n){const n=new Uint8Array(y);await r.tokenizer.readBuffer(n);l.push(n)}else{await r.tokenizer.ignore(y)}if(m>=0){break}}if(!hasUnknownFileSize(r.tokenizer)){r.knownSizeDescriptorScannedBytes+=d}if(!n){return}return mergeByteChunks(l,d)}function getRemainingZipScanBudget(r,n){if(hasUnknownFileSize(r.tokenizer)){return Math.max(0,Ve-(r.tokenizer.position-n))}return Math.max(0,He-r.knownSizeDescriptorScannedBytes)}async function readZipEntryData(r,n,{shouldBuffer:a,maximumDescriptorLength:s=He}={}){if(n.dataDescriptor&&n.compressedSize===0){return readZipDataDescriptorEntryWithLimit(r,{shouldBuffer:a,maximumLength:s})}if(!a){await safeIgnore(r.tokenizer,n.compressedSize,{maximumLength:hasUnknownFileSize(r.tokenizer)?He:r.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}const u=getMaximumZipBufferedReadLength(r.tokenizer);if(!Number.isFinite(n.compressedSize)||n.compressedSize<0||n.compressedSize>u){throw new Error(`ZIP entry compressed data exceeds ${u} bytes`)}const l=new Uint8Array(n.compressedSize);await r.tokenizer.readBuffer(l);return l}ZipHandler.prototype.inflate=async function(r,n,a){if(r.compressedMethod===0){return a(n)}if(r.compressedMethod!==8){throw new Error(`Unsupported ZIP compression method: ${r.compressedMethod}`)}const s=await decompressDeflateRawWithLimit(n,{maximumLength:He});return a(s)};ZipHandler.prototype.unzip=async function(r){let n=false;let a=0;const s=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(hasExceededUnknownSizeScanBudget(this.tokenizer,s,Ve)){throw new ParserHardLimitError(`ZIP stream probing exceeds ${Ve} bytes`)}const u=await this.readLocalFileHeader();if(!u){break}a++;if(a>Ze){throw new Error(`ZIP entry count exceeds ${Ze}`)}const l=r(u);n=Boolean(l.stop);await this.tokenizer.ignore(u.extraFieldLength);const d=await readZipEntryData(this,u,{shouldBuffer:Boolean(l.handler),maximumDescriptorLength:Math.min(He,getRemainingZipScanBudget(this,s))});if(l.handler){await this.inflate(u,d,l.handler)}if(u.dataDescriptor){const r=new Uint8Array(yt);await this.tokenizer.readBuffer(r);if(F.get(r,0)!==gt){throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-r.length}`)}}if(hasExceededUnknownSizeScanBudget(this.tokenizer,s,Ve)){throw new ParserHardLimitError(`ZIP stream probing exceeds ${Ve} bytes`)}}while(!n)};function createByteLimitedReadableStream(r,n){const a=r.getReader();let s=0;let u=false;let l=false;const cancelSource=async r=>{if(u||l){return}l=true;await a.cancel(r)};return new ReadableStream({async pull(r){if(s>=n){r.close();await cancelSource();return}const{done:l,value:d}=await a.read();if(l||!d){u=true;r.close();return}const p=n-s;if(d.length>p){r.enqueue(d.subarray(0,p));s+=p;r.close();await cancelSource();return}r.enqueue(d);s+=d.length},async cancel(r){await cancelSource(r)}})}async function fileTypeFromStream(r,n){return new FileTypeParser(n).fromStream(r)}async function fileTypeFromBuffer(r,n){return new FileTypeParser(n).fromBuffer(r)}async function fileTypeFromBlob(r,n){return new FileTypeParser(n).fromBlob(r)}function getFileTypeFromMimeType(r){r=r.toLowerCase();switch(r){case"application/epub+zip":return{ext:"epub",mime:r};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:r};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:r};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:r};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:r};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:r};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:r};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:r};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:r};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:r};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:r};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:r};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:r};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:r};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:r};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:r};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function _check(r,n,a){a={offset:0,...a};for(const[s,u]of n.entries()){if(a.mask){if(u!==(a.mask[s]&r[s+a.offset])){return false}}else if(u!==r[s+a.offset]){return false}}return true}function normalizeSampleSize(r){if(!Number.isFinite(r)){return $e}return Math.max(1,Math.trunc(r))}function readByobReaderWithSignal(r,n,a){if(a===undefined){return r.read(n)}a.throwIfAborted();return new Promise(((s,u)=>{const cleanup=()=>{a.removeEventListener("abort",onAbort)};const onAbort=()=>{const n=a.reason;cleanup();(async()=>{try{await r.cancel(n)}catch{}})();u(n)};a.addEventListener("abort",onAbort,{once:true});(async()=>{try{const a=await r.read(n);cleanup();s(a)}catch(r){cleanup();u(r)}})()}))}function normalizeMpegOffsetTolerance(r){if(!Number.isFinite(r)){return 0}return Math.max(0,Math.min(qe,Math.trunc(r)))}function getKnownFileSizeOrMaximum(r){if(!Number.isFinite(r)){return Number.MAX_SAFE_INTEGER}return Math.max(0,r)}function hasUnknownFileSize(r){const n=r.fileInfo.size;return!Number.isFinite(n)||n===Number.MAX_SAFE_INTEGER}function hasExceededUnknownSizeScanBudget(r,n,a){return hasUnknownFileSize(r)&&r.position-n>a}function getMaximumZipBufferedReadLength(r){const n=r.fileInfo.size;const a=Number.isFinite(n)?Math.max(0,n-r.position):Number.MAX_SAFE_INTEGER;return Math.min(a,Ge)}function isRecoverableZipError(r){if(r instanceof EndOfStreamError){return true}if(r instanceof ParserHardLimitError){return true}if(!(r instanceof Error)){return false}if(ht.has(r.message)){return true}if(mt.has(r.code)){return true}for(const n of pt){if(r.message.startsWith(n)){return true}}return false}function canReadZipEntryForDetection(r,n=He){const a=[r.compressedSize,r.uncompressedSize];for(const r of a){if(!Number.isFinite(r)||r<0||r>n){return false}}return true}function createOpenXmlZipDetectionState(){return{hasContentTypesEntry:false,hasParsedContentTypesEntry:false,isParsingContentTypes:false,hasUnparseableContentTypes:false,hasWordDirectory:false,hasPresentationDirectory:false,hasSpreadsheetDirectory:false,hasThreeDimensionalModelEntry:false}}function updateOpenXmlZipDetectionStateFromFilename(r,n){if(n.startsWith("word/")){r.hasWordDirectory=true}if(n.startsWith("ppt/")){r.hasPresentationDirectory=true}if(n.startsWith("xl/")){r.hasSpreadsheetDirectory=true}if(n.startsWith("3D/")&&n.endsWith(".model")){r.hasThreeDimensionalModelEntry=true}}function getOpenXmlFileTypeFromZipEntries(r){if(!r.hasContentTypesEntry||r.hasUnparseableContentTypes||r.isParsingContentTypes||r.hasParsedContentTypesEntry){return}if(r.hasWordDirectory){return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}}if(r.hasPresentationDirectory){return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}}if(r.hasSpreadsheetDirectory){return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}if(r.hasThreeDimensionalModelEntry){return{ext:"3mf",mime:"model/3mf"}}}function getOpenXmlMimeTypeFromContentTypesXml(r){const n=r.indexOf('.main+xml"');if(n===-1){const n="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";if(r.includes(`ContentType="${n}"`)){return n}return}const a=r.slice(0,n);const s=a.lastIndexOf('"');return a.slice(s+1)}async function fileTypeFromTokenizer(r,n){return new FileTypeParser(n).fromTokenizer(r)}async function fileTypeStream(r,n){return new FileTypeParser(n).toDetectionStream(r,n)}class FileTypeParser{constructor(r){const n=normalizeMpegOffsetTolerance(r?.mpegOffsetTolerance);this.options={...r,mpegOffsetTolerance:n};this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}];this.tokenizerOptions={abortSignal:this.options.signal};this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(r){return patchWebByobTokenizerClose(fromWebStream(r,this.getTokenizerOptions()))}async parseTokenizer(r,n=0){this.detectionReentryCount=n;const a=r.position;for(const n of this.detectors){let s;try{s=await n.detect(r)}catch(r){if(r instanceof EndOfStreamError){return}if(r instanceof ParserHardLimitError){return}throw r}if(s){return s}if(a!==r.position){return undefined}}}async fromTokenizer(r){try{return await this.parseTokenizer(r)}finally{await r.close()}}async fromBuffer(r){if(!(r instanceof Uint8Array||r instanceof ArrayBuffer)){throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}const n=r instanceof Uint8Array?r:new Uint8Array(r);if(!(n?.length>1)){return}return this.fromTokenizer(fromBuffer(n,this.getTokenizerOptions()))}async fromBlob(r){this.options.signal?.throwIfAborted();const n=fromBlob(r,this.getTokenizerOptions());return this.fromTokenizer(n)}async fromStream(r){this.options.signal?.throwIfAborted();const n=this.createTokenizerFromWebStream(r);return this.fromTokenizer(n)}async toDetectionStream(r,n){const a=normalizeSampleSize(n?.sampleSize??$e);let s;let u;const l=r.getReader({mode:"byob"});try{const{value:r,done:n}=await readByobReaderWithSignal(l,new Uint8Array(a),this.options.signal);u=r;if(!n&&r){try{s=await this.fromBuffer(r.subarray(0,a))}catch(r){if(!(r instanceof EndOfStreamError)){throw r}s=undefined}}u=r}finally{l.releaseLock()}const d=new TransformStream({async start(r){r.enqueue(u)},transform(r,n){n.enqueue(r)}});const p=r.pipeThrough(d);p.fileType=s;return p}async detectGzip(r){if(this.gzipProbeDepth>=Qe){return{ext:"gz",mime:"application/gzip"}}const n=new GzipHandler(r);const a=createByteLimitedReadableStream(n.inflate(),Xe);const s=hasUnknownFileSize(r);let u;let l;let d;let p;if(s){const r=new AbortController;u=setTimeout((()=>{r.abort(new DOMException(`Operation timed out after ${Je} ms`,"TimeoutError"))}),Je);l=this.options.signal===undefined?r.signal:AbortSignal.any([this.options.signal,r.signal]);d=new FileTypeParser({...this.options,signal:l});d.gzipProbeDepth=this.gzipProbeDepth+1}else{this.gzipProbeDepth++}try{p=await(d??this).fromStream(a)}catch(r){if(r?.name==="AbortError"&&l?.reason?.name!=="TimeoutError"){throw r}}finally{clearTimeout(u);if(!s){this.gzipProbeDepth--}}if(p?.ext==="tar"){return{ext:"tar.gz",mime:"application/gzip"}}return{ext:"gz",mime:"application/gzip"}}check(r,n){return _check(this.buffer,r,n)}checkString(r,n){return this.check(stringToBytes(r,n?.encoding),n)}detectConfident=async r=>{this.buffer=new Uint8Array($e);if(r.fileInfo.size===undefined){r.fileInfo.size=Number.MAX_SAFE_INTEGER}this.tokenizer=r;if(hasUnknownFileSize(r)){await r.peekBuffer(this.buffer,{length:3,mayBeLess:true});if(this.check([31,139,8])){return this.detectGzip(r)}}await r.peekBuffer(this.buffer,{length:32,mayBeLess:true});if(this.check([66,77])){return{ext:"bmp",mime:"image/bmp"}}if(this.check([11,119])){return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"}}if(this.check([120,1])){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(this.check([77,90])){return{ext:"exe",mime:"application/x-msdownload"}}if(this.check([37,33])){await r.peekBuffer(this.buffer,{length:24,mayBeLess:true});if(this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})){return{ext:"eps",mime:"application/eps"}}return{ext:"ps",mime:"application/postscript"}}if(this.check([31,160])||this.check([31,157])){return{ext:"Z",mime:"application/x-compress"}}if(this.check([199,113])){return{ext:"cpio",mime:"application/x-cpio"}}if(this.check([96,234])){return{ext:"arj",mime:"application/x-arj"}}if(this.check([239,187,191])){if(this.detectionReentryCount>=ct){return}this.detectionReentryCount++;await this.tokenizer.ignore(3);return this.detectConfident(r)}if(this.check([71,73,70])){return{ext:"gif",mime:"image/gif"}}if(this.check([73,73,188])){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(this.check([31,139,8])){return this.detectGzip(r)}if(this.check([66,90,104])){return{ext:"bz2",mime:"application/x-bzip2"}}if(this.checkString("ID3")){await safeIgnore(r,6,{maximumLength:6,reason:"ID3 header prefix"});const n=await r.readToken(Ne);const a=hasUnknownFileSize(r);if(!Number.isFinite(n)||n<0||a&&(n>et||r.position+n>et)){return}if(r.position+n>r.fileInfo.size){if(a){return}return{ext:"mp3",mime:"audio/mpeg"}}try{await safeIgnore(r,n,{maximumLength:a?et:r.fileInfo.size,reason:"ID3 payload"})}catch(r){if(r instanceof EndOfStreamError){return}throw r}if(this.detectionReentryCount>=ct){return}this.detectionReentryCount++;return this.parseTokenizer(r,this.detectionReentryCount)}if(this.checkString("MP+")){return{ext:"mpc",mime:"audio/x-musepack"}}if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1})){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(this.check([255,216,255])){if(this.check([247],{offset:3})){return{ext:"jls",mime:"image/jls"}}return{ext:"jpg",mime:"image/jpeg"}}if(this.check([79,98,106,1])){return{ext:"avro",mime:"application/avro"}}if(this.checkString("FLIF")){return{ext:"flif",mime:"image/flif"}}if(this.checkString("8BPS")){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(this.checkString("MPCK")){return{ext:"mpc",mime:"audio/x-musepack"}}if(this.checkString("FORM")){return{ext:"aif",mime:"audio/aiff"}}if(this.checkString("icns",{offset:0})){return{ext:"icns",mime:"image/icns"}}if(this.check([80,75,3,4])){let n;const a=createOpenXmlZipDetectionState();try{await new ZipHandler(r).unzip((r=>{updateOpenXmlZipDetectionStateFromFilename(a,r.filename);const s=r.filename==="[Content_Types].xml";const u=getOpenXmlFileTypeFromZipEntries(a);if(!s&&u){n=u;return{stop:true}}switch(r.filename){case"META-INF/mozilla.rsa":n={ext:"xpi",mime:"application/x-xpinstall"};return{stop:true};case"META-INF/MANIFEST.MF":n={ext:"jar",mime:"application/java-archive"};return{stop:true};case"mimetype":if(!canReadZipEntryForDetection(r,Ke)){return{}}return{async handler(r){const a=new TextDecoder("utf-8").decode(r).trim();n=getFileTypeFromMimeType(a)},stop:true};case"[Content_Types].xml":{a.hasContentTypesEntry=true;if(!canReadZipEntryForDetection(r,Ke)){a.hasUnparseableContentTypes=true;return{}}a.isParsingContentTypes=true;return{async handler(r){const s=new TextDecoder("utf-8").decode(r);const u=getOpenXmlMimeTypeFromContentTypesXml(s);if(u){n=getFileTypeFromMimeType(u)}a.hasParsedContentTypesEntry=true;a.isParsingContentTypes=false},stop:true}}default:if(/classes\d*\.dex/.test(r.filename)){n={ext:"apk",mime:"application/vnd.android.package-archive"};return{stop:true}}return{}}}))}catch(r){if(!isRecoverableZipError(r)){throw r}if(a.isParsingContentTypes){a.isParsingContentTypes=false;a.hasUnparseableContentTypes=true}}return n??getOpenXmlFileTypeFromZipEntries(a)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await r.ignore(28);const n=new Uint8Array(8);await r.readBuffer(n);if(_check(n,[79,112,117,115,72,101,97,100])){return{ext:"opus",mime:"audio/ogg; codecs=opus"}}if(_check(n,[128,116,104,101,111,114,97])){return{ext:"ogv",mime:"video/ogg"}}if(_check(n,[1,118,105,100,101,111,0])){return{ext:"ogm",mime:"video/ogg"}}if(_check(n,[127,70,76,65,67])){return{ext:"oga",mime:"audio/ogg"}}if(_check(n,[83,112,101,101,120,32,32])){return{ext:"spx",mime:"audio/ogg"}}if(_check(n,[1,118,111,114,98,105,115])){return{ext:"ogg",mime:"audio/ogg"}}return{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8)){return{ext:"zip",mime:"application/zip"}}if(this.checkString("MThd")){return{ext:"mid",mime:"audio/midi"}}if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4}))){return{ext:"woff",mime:"font/woff"}}if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4}))){return{ext:"woff2",mime:"font/woff2"}}if(this.check([212,195,178,161])||this.check([161,178,195,212])){return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"}}if(this.checkString("DSD ")){return{ext:"dsf",mime:"audio/x-dsf"}}if(this.checkString("LZIP")){return{ext:"lz",mime:"application/x-lzip"}}if(this.checkString("fLaC")){return{ext:"flac",mime:"audio/flac"}}if(this.check([66,80,71,251])){return{ext:"bpg",mime:"image/bpg"}}if(this.checkString("wvpk")){return{ext:"wv",mime:"audio/wavpack"}}if(this.checkString("%PDF")){return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109])){return{ext:"wasm",mime:"application/wasm"}}if(this.check([73,73])){const r=await this.readTiffHeader(false);if(r){return r}}if(this.check([77,77])){const r=await this.readTiffHeader(true);if(r){return r}}if(this.checkString("MAC ")){return{ext:"ape",mime:"audio/ape"}}if(this.check([26,69,223,163])){async function readField(){const n=await r.peekNumber(S);let a=128;let s=0;while((n&a)===0&&a!==0){++s;a>>=1}const u=new Uint8Array(s+1);await safeReadBuffer(r,u,undefined,{maximumLength:u.length,reason:"EBML field"});return u}async function readElement(){const r=await readField();const n=await readField();n[0]^=128>>n.length-1;const a=Math.min(6,n.length);const s=new DataView(r.buffer);const u=new DataView(n.buffer,n.length-a,a);return{id:getUintBE(s),len:getUintBE(u)}}async function readChildren(n){let s=0;while(n>0){s++;if(s>nt){return}if(hasExceededUnknownSizeScanBudget(r,a,Ve)){return}const u=r.position;const l=await readElement();if(l.id===17026){if(l.len>tt){return}const n=getSafeBound(l.len,tt,"EBML DocType");const a=await r.readToken(new StringType(n));return a.replaceAll(/\00.*$/g,"")}if(hasUnknownFileSize(r)&&(!Number.isFinite(l.len)||l.len<0||l.len>rt)){return}await safeIgnore(r,l.len,{maximumLength:hasUnknownFileSize(r)?rt:r.fileInfo.size,reason:"EBML payload"});--n;if(r.position<=u){return}}}const n=await readElement();const a=r.position;const s=await readChildren(n.len);switch(s){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi")){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(this.check([78,69,83,26])){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(this.checkString("Cr24")){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(this.checkString("MSCF")||this.checkString("ISc(")){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(this.check([237,171,238,219])){return{ext:"rpm",mime:"application/x-rpm"}}if(this.check([197,208,211,198])){return{ext:"eps",mime:"application/eps"}}if(this.check([40,181,47,253])){return{ext:"zst",mime:"application/zstd"}}if(this.check([127,69,76,70])){return{ext:"elf",mime:"application/x-elf"}}if(this.check([33,66,68,78])){return{ext:"pst",mime:"application/vnd.ms-outlook"}}if(this.checkString("PAR1")||this.checkString("PARE")){return{ext:"parquet",mime:"application/vnd.apache.parquet"}}if(this.checkString("ttcf")){return{ext:"ttc",mime:"font/collection"}}if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254])){return{ext:"macho",mime:"application/x-mach-binary"}}if(this.check([4,34,77,24])){return{ext:"lz4",mime:"application/x-lz4"}}if(this.checkString("regf")){return{ext:"dat",mime:"application/x-ft-windows-registry-hive"}}if(this.checkString("$FL2")||this.checkString("$FL3")){return{ext:"sav",mime:"application/x-spss-sav"}}if(this.check([79,84,84,79,0])){return{ext:"otf",mime:"font/otf"}}if(this.checkString("#!AMR")){return{ext:"amr",mime:"audio/amr"}}if(this.checkString("{\\rtf")){return{ext:"rtf",mime:"application/rtf"}}if(this.check([70,76,86,1])){return{ext:"flv",mime:"video/x-flv"}}if(this.checkString("IMPM")){return{ext:"it",mime:"audio/x-it"}}if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2})){return{ext:"lzh",mime:"application/x-lzh-compressed"}}if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]})){return{ext:"mpg",mime:"video/MP1S"}}if(this.check([68],{offset:4,mask:[196]})){return{ext:"mpg",mime:"video/MP2P"}}}if(this.checkString("ITSF")){return{ext:"chm",mime:"application/vnd.ms-htmlhelp"}}if(this.check([202,254,186,190])){const r=T.get(this.buffer,4);const n=k.get(this.buffer,6);if(r>0&&r<=30){return{ext:"macho",mime:"application/x-mach-binary"}}if(n>30){return{ext:"class",mime:"application/java-vm"}}}if(this.checkString(".RMF")){return{ext:"rm",mime:"application/vnd.rn-realmedia"}}if(this.checkString("DRACO")){return{ext:"drc",mime:"application/vnd.google.draco"}}if(this.check([253,55,122,88,90,0])){return{ext:"xz",mime:"application/x-xz"}}if(this.checkString("<?xml ")){return{ext:"xml",mime:"application/xml"}}if(this.check([55,122,188,175,39,28])){return{ext:"7z",mime:"application/x-7z-compressed"}}if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(this.checkString("solid ")){return{ext:"stl",mime:"model/stl"}}if(this.checkString("AC")){const r=new StringType(4,"latin1").get(this.buffer,2);if(r.match("^d*")&&r>=1e3&&r<=1050){return{ext:"dwg",mime:"image/vnd.dwg"}}}if(this.checkString("070707")){return{ext:"cpio",mime:"application/x-cpio"}}if(this.checkString("BLENDER")){return{ext:"blend",mime:"application/x-blender"}}if(this.checkString("!<arch>")){await r.ignore(8);const n=await r.readToken(new StringType(13,"ascii"));if(n==="debian-binary"){return{ext:"deb",mime:"application/x-deb"}}return{ext:"ar",mime:"application/x-unix-archive"}}if(this.checkString("WEBVTT")&&["\n","\r","\t"," ","\0"].some((r=>this.checkString(r,{offset:6})))){return{ext:"vtt",mime:"text/vtt"}}if(this.check([137,80,78,71,13,10,26,10])){const n={ext:"png",mime:"image/png"};const a={ext:"apng",mime:"image/apng"};await r.ignore(8);async function readChunkHeader(){return{length:await r.readToken(R),type:await r.readToken(new StringType(4,"latin1"))}}const s=hasUnknownFileSize(r);const u=r.position;let l=0;let d=false;do{l++;if(l>it){break}if(hasExceededUnknownSizeScanBudget(r,u,ot)){break}const p=r.position;const m=await readChunkHeader();if(m.length<0){return}if(m.type==="IHDR"){if(m.length!==13){return}d=true}switch(m.type){case"IDAT":return n;case"acTL":return a;default:if(!d&&m.type!=="CgBI"){return}if(s&&m.length>ut){return d&&isPngAncillaryChunk(m.type)?n:undefined}try{await safeIgnore(r,m.length+4,{maximumLength:s?ut+4:r.fileInfo.size,reason:"PNG chunk payload"})}catch(r){if(!s&&(r instanceof ParserHardLimitError||r instanceof EndOfStreamError)){return n}throw r}}if(r.position<=p){break}}while(r.position+8<r.fileInfo.size);return n}if(this.check([65,82,82,79,87,49,0,0])){return{ext:"arrow",mime:"application/vnd.apache.arrow.file"}}if(this.check([103,108,84,70,2,0,0,0])){return{ext:"glb",mime:"model/gltf-binary"}}if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4})){return{ext:"mov",mime:"video/quicktime"}}if(this.check([73,73,82,79,8,0,0,0,24])){return{ext:"orf",mime:"image/x-olympus-orf"}}if(this.checkString("gimp xcf ")){return{ext:"xcf",mime:"image/x-xcf"}}if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){const r=new StringType(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(r){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:if(r.startsWith("3g")){if(r.startsWith("3g2")){return{ext:"3g2",mime:"video/3gpp2"}}return{ext:"3gp",mime:"video/3gpp"}}return{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("REGEDIT4\r\n")){return{ext:"reg",mime:"application/x-ms-regedit"}}if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8})){return{ext:"webp",mime:"image/webp"}}if(this.check([65,86,73],{offset:8})){return{ext:"avi",mime:"video/vnd.avi"}}if(this.check([87,65,86,69],{offset:8})){return{ext:"wav",mime:"audio/wav"}}if(this.check([81,76,67,77],{offset:8})){return{ext:"qcp",mime:"audio/qcelp"}}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216])){return{ext:"rw2",mime:"image/x-panasonic-rw2"}}if(this.check([48,38,178,117,142,102,207,17,166,217])){let n=false;try{async function readHeader(){const n=new Uint8Array(16);await safeReadBuffer(r,n,undefined,{maximumLength:n.length,reason:"ASF header GUID"});return{id:n,size:Number(await r.readToken(I))}}await safeIgnore(r,30,{maximumLength:30,reason:"ASF header prelude"});const a=hasUnknownFileSize(r);const s=r.position;let u=0;while(r.position+24<r.fileInfo.size){u++;if(u>at){break}if(hasExceededUnknownSizeScanBudget(r,s,Ve)){break}const l=r.position;const d=await readHeader();let p=d.size-24;if(!Number.isFinite(p)||p<0){n=true;break}if(_check(d.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const n=new Uint8Array(16);p-=await safeReadBuffer(r,n,undefined,{maximumLength:n.length,reason:"ASF stream type GUID"});if(_check(n,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43])){return{ext:"asf",mime:"audio/x-ms-asf"}}if(_check(n,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43])){return{ext:"asf",mime:"video/x-ms-asf"}}break}if(a&&p>ft){n=true;break}await safeIgnore(r,p,{maximumLength:a?ft:r.fileInfo.size,reason:"ASF header payload"});if(r.position<=l){n=true;break}}}catch(a){if(a instanceof EndOfStreamError||a instanceof ParserHardLimitError){if(hasUnknownFileSize(r)){n=true}}else{throw a}}if(n){return}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10])){return{ext:"ktx",mime:"image/ktx"}}if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4})){return{ext:"mie",mime:"application/x-mie"}}if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2})){return{ext:"shp",mime:"application/x-esri-shape"}}if(this.check([255,79,255,81])){return{ext:"j2c",mime:"image/j2c"}}if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await r.ignore(20);const n=await r.readToken(new StringType(4,"ascii"));switch(n){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10])){return{ext:"jxl",mime:"image/jxl"}}if(this.check([254,255])){if(this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})){return{ext:"xml",mime:"application/xml"}}return undefined}if(this.check([208,207,17,224,161,177,26,225])){return{ext:"cfb",mime:"application/x-cfb"}}await r.peekBuffer(this.buffer,{length:Math.min(256,r.fileInfo.size),mayBeLess:true});if(this.check([97,99,115,112],{offset:36})){return{ext:"icc",mime:"application/vnd.iccprofile"}}if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12})){return{ext:"ace",mime:"application/x-ace-compressed"}}if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6})){return{ext:"vcf",mime:"text/vcard"}}if(this.checkString("VCALENDAR",{offset:6})){return{ext:"ics",mime:"text/calendar"}}}if(this.checkString("FUJIFILMCCD-RAW")){return{ext:"raf",mime:"image/x-fujifilm-raf"}}if(this.checkString("Extended Module:")){return{ext:"xm",mime:"audio/x-xm"}}if(this.checkString("Creative Voice File")){return{ext:"voc",mime:"audio/x-voc"}}if(this.check([4,0,0,0])&&this.buffer.length>=16){const r=new DataView(this.buffer.buffer).getUint32(12,true);if(r>12&&this.buffer.length>=r+16){try{const n=(new TextDecoder).decode(this.buffer.subarray(16,r+16));const a=JSON.parse(n);if(a.files){return{ext:"asar",mime:"application/x-asar"}}}catch{}}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){return{ext:"mxf",mime:"application/mxf"}}if(this.checkString("SCRM",{offset:44})){return{ext:"s3m",mime:"audio/x-s3m"}}if(this.check([71])&&this.check([71],{offset:188})){return{ext:"mts",mime:"video/mp2t"}}if(this.check([71],{offset:4})&&this.check([71],{offset:196})){return{ext:"mts",mime:"video/mp2t"}}if(this.check([66,79,79,75,77,79,66,73],{offset:60})){return{ext:"mobi",mime:"application/x-mobipocket-ebook"}}if(this.check([68,73,67,77],{offset:128})){return{ext:"dcm",mime:"application/dicom"}}if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70])){return{ext:"lnk",mime:"application/x.ms.shortcut"}}if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0])){return{ext:"alias",mime:"application/x.apple.alias"}}if(this.checkString("Kaydara FBX Binary \0")){return{ext:"fbx",mime:"application/x.autodesk.fbx"}}if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8}))){return{ext:"eot",mime:"application/vnd.ms-fontobject"}}if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29])){return{ext:"indd",mime:"application/x-indesign"}}if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1])){return{ext:"jmp",mime:"application/x-jmp-data"}}await r.peekBuffer(this.buffer,{length:Math.min(512,r.fileInfo.size),mayBeLess:true});if(this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&tarHeaderChecksumMatches(this.buffer)){return{ext:"tar",mime:"application/x-tar"}}if(this.check([255,254])){const r="utf-16le";if(this.checkString("<?xml ",{offset:2,encoding:r})){return{ext:"xml",mime:"application/xml"}}if(this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:r})){return{ext:"skp",mime:"application/vnd.sketchup.skp"}}if(this.checkString("Windows Registry Editor Version 5.00\r\n",{offset:2,encoding:r})){return{ext:"reg",mime:"application/x-ms-regedit"}}return undefined}if(this.checkString("-----BEGIN PGP MESSAGE-----")){return{ext:"pgp",mime:"application/pgp-encrypted"}}};detectImprecise=async r=>{this.buffer=new Uint8Array($e);const n=getKnownFileSizeOrMaximum(r.fileInfo.size);await r.peekBuffer(this.buffer,{length:Math.min(8,n),mayBeLess:true});if(this.check([0,0,1,186])||this.check([0,0,1,179])){return{ext:"mpg",mime:"video/mpeg"}}if(this.check([0,1,0,0,0])){return{ext:"ttf",mime:"font/ttf"}}if(this.check([0,0,1,0])){return{ext:"ico",mime:"image/x-icon"}}if(this.check([0,0,2,0])){return{ext:"cur",mime:"image/x-icon"}}await r.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,n),mayBeLess:true});if(this.buffer.length>=2+this.options.mpegOffsetTolerance){for(let r=0;r<=this.options.mpegOffsetTolerance;++r){const n=this.scanMpeg(r);if(n){return n}}}};async readTiffTag(r){const n=await this.tokenizer.readToken(r?k:v);await this.tokenizer.ignore(10);switch(n){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(r){const n=await this.tokenizer.readToken(r?k:v);if(n>st){return}if(hasUnknownFileSize(this.tokenizer)&&2+n*12>dt){return}for(let a=0;a<n;++a){const n=await this.readTiffTag(r);if(n){return n}}}async readTiffHeader(r){const n={ext:"tif",mime:"image/tiff"};const a=(r?k:v).get(this.buffer,2);const s=(r?T:F).get(this.buffer,4);if(a===42){if(s>=6){if(this.checkString("CR",{offset:8})){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(s>=8){const n=(r?k:v).get(this.buffer,8);const a=(r?k:v).get(this.buffer,10);if(n===28&&a===254||n===31&&a===11){return{ext:"nef",mime:"image/x-nikon-nef"}}}}if(hasUnknownFileSize(this.tokenizer)&&s>lt){return n}const a=hasUnknownFileSize(this.tokenizer)?dt:this.tokenizer.fileInfo.size;try{await safeIgnore(this.tokenizer,s,{maximumLength:a,reason:"TIFF IFD offset"})}catch(r){if(r instanceof EndOfStreamError){return}throw r}let u;try{u=await this.readTiffIFD(r)}catch(r){if(r instanceof EndOfStreamError){return}throw r}return u??n}if(a===43){return n}}scanMpeg(r){if(this.check([255,224],{offset:r,mask:[255,224]})){if(this.check([16],{offset:r+1,mask:[22]})){if(this.check([8],{offset:r+1,mask:[8]})){return{ext:"aac",mime:"audio/aac"}}return{ext:"aac",mime:"audio/aac"}}if(this.check([2],{offset:r+1,mask:[6]})){return{ext:"mp3",mime:"audio/mpeg"}}if(this.check([4],{offset:r+1,mask:[6]})){return{ext:"mp2",mime:"audio/mpeg"}}if(this.check([6],{offset:r+1,mask:[6]})){return{ext:"mp1",mime:"audio/mpeg"}}}}}const wt=new Set(je);const xt=new Set(We);function isStream(r,{checkOpen:n=true}={}){return r!==null&&typeof r==="object"&&(r.writable||r.readable||!n||r.writable===undefined&&r.readable===undefined)&&typeof r.pipe==="function"}function isWritableStream(r,{checkOpen:n=true}={}){return isStream(r,{checkOpen:n})&&(r.writable||!n)&&typeof r.write==="function"&&typeof r.end==="function"&&typeof r.writable==="boolean"&&typeof r.writableObjectMode==="boolean"&&typeof r.destroy==="function"&&typeof r.destroyed==="boolean"}function isReadableStream(r,{checkOpen:n=true}={}){return isStream(r,{checkOpen:n})&&(r.readable||!n)&&typeof r.read==="function"&&typeof r.readable==="boolean"&&typeof r.readableObjectMode==="boolean"&&typeof r.destroy==="function"&&typeof r.destroyed==="boolean"}function isDuplexStream(r,n){return isWritableStream(r,n)&&isReadableStream(r,n)}function isTransformStream(r,n){return isDuplexStream(r,n)&&typeof r._transform==="function"}var _t=__nccwpck_require__(2703);const decompressTar=()=>async r=>{if(!n.Buffer.isBuffer(r)&&!isStream(r)){throw new TypeError(`Expected a Buffer or Stream, got ${typeof r}`)}if(n.Buffer.isBuffer(r)){const n=await fileTypeFromBuffer(r);if(!n||n.mime!=="application/x-tar"){return[]}}const a=_t.extract();const s=[];const u=new Promise(((u,l)=>{if(!n.Buffer.isBuffer(r)){r.on("error",l)}a.on("entry",((r,a,u)=>{if(r.type==="directory"&&r.size>0){a.resume();l(new Error("Refusing to extract a directory entry with a non-zero size"));return}const d=[];a.on("error",l);a.on("data",(r=>d.push(r)));a.on("end",(()=>{const a={data:n.Buffer.concat(d),mode:r.mode,mtime:r.mtime,path:r.name,type:r.type};if(r.type==="symlink"||r.type==="link"){a.linkname=r.linkname}s.push(a);u()}))}));a.on("finish",(()=>u(s)));a.on("error",l)}));a.then=u.then.bind(u);a.catch=u.catch.bind(u);if(n.Buffer.isBuffer(r)){a.end(r)}else{r.pipe(a)}return a};const St=decompressTar;function is_stream_isStream(r,{checkOpen:n=true}={}){return r!==null&&typeof r==="object"&&(r.writable||r.readable||!n||r.writable===undefined&&r.readable===undefined)&&typeof r.pipe==="function"}function is_stream_isWritableStream(r,{checkOpen:n=true}={}){return is_stream_isStream(r,{checkOpen:n})&&(r.writable||!n)&&typeof r.write==="function"&&typeof r.end==="function"&&typeof r.writable==="boolean"&&typeof r.writableObjectMode==="boolean"&&typeof r.destroy==="function"&&typeof r.destroyed==="boolean"}function is_stream_isReadableStream(r,{checkOpen:n=true}={}){return is_stream_isStream(r,{checkOpen:n})&&(r.readable||!n)&&typeof r.read==="function"&&typeof r.readable==="boolean"&&typeof r.readableObjectMode==="boolean"&&typeof r.destroy==="function"&&typeof r.destroyed==="boolean"}function is_stream_isDuplexStream(r,n){return is_stream_isWritableStream(r,n)&&is_stream_isReadableStream(r,n)}function is_stream_isTransformStream(r,n){return is_stream_isDuplexStream(r,n)&&typeof r._transform==="function"}var vt=__nccwpck_require__(9562);var kt=__nccwpck_require__(3467);const decompressTarBz2=()=>async r=>{if(!n.Buffer.isBuffer(r)&&!is_stream_isStream(r)){throw new TypeError(`Expected a Buffer or Stream, got ${typeof r}`)}if(n.Buffer.isBuffer(r)){const n=await fileTypeFromBuffer(r);if(!n||n.mime!=="application/x-bzip2"){return[]}return St()(vt.decode(r))}return St()(r.pipe(kt()))};const Et=decompressTarBz2;const Ct=r(import.meta.url)("node:zlib");function node_modules_is_stream_isStream(r,{checkOpen:n=true}={}){return r!==null&&typeof r==="object"&&(r.writable||r.readable||!n||r.writable===undefined&&r.readable===undefined)&&typeof r.pipe==="function"}function node_modules_is_stream_isWritableStream(r,{checkOpen:n=true}={}){return node_modules_is_stream_isStream(r,{checkOpen:n})&&(r.writable||!n)&&typeof r.write==="function"&&typeof r.end==="function"&&typeof r.writable==="boolean"&&typeof r.writableObjectMode==="boolean"&&typeof r.destroy==="function"&&typeof r.destroyed==="boolean"}function node_modules_is_stream_isReadableStream(r,{checkOpen:n=true}={}){return node_modules_is_stream_isStream(r,{checkOpen:n})&&(r.readable||!n)&&typeof r.read==="function"&&typeof r.readable==="boolean"&&typeof r.readableObjectMode==="boolean"&&typeof r.destroy==="function"&&typeof r.destroyed==="boolean"}function node_modules_is_stream_isDuplexStream(r,n){return node_modules_is_stream_isWritableStream(r,n)&&node_modules_is_stream_isReadableStream(r,n)}function node_modules_is_stream_isTransformStream(r,n){return node_modules_is_stream_isDuplexStream(r,n)&&typeof r._transform==="function"}const decompressTarGz=()=>async r=>{if(!n.Buffer.isBuffer(r)&&!node_modules_is_stream_isStream(r)){throw new TypeError(`Expected a Buffer or Stream, got ${typeof r}`)}if(n.Buffer.isBuffer(r)){const n=await fileTypeFromBuffer(r);if(!n||n.mime!=="application/gzip"){return[]}}const a=Ct.createGunzip();const s=St()(a);if(n.Buffer.isBuffer(r)){a.end(r)}else{r.pipe(a)}return s};const Ft=decompressTarGz;function decompress_unzip_node_modules_is_stream_isStream(r,{checkOpen:n=true}={}){return r!==null&&typeof r==="object"&&(r.writable||r.readable||!n||r.writable===undefined&&r.readable===undefined)&&typeof r.pipe==="function"}function decompress_unzip_node_modules_is_stream_isWritableStream(r,{checkOpen:n=true}={}){return decompress_unzip_node_modules_is_stream_isStream(r,{checkOpen:n})&&(r.writable||!n)&&typeof r.write==="function"&&typeof r.end==="function"&&typeof r.writable==="boolean"&&typeof r.writableObjectMode==="boolean"&&typeof r.destroy==="function"&&typeof r.destroyed==="boolean"}function decompress_unzip_node_modules_is_stream_isReadableStream(r,{checkOpen:n=true}={}){return decompress_unzip_node_modules_is_stream_isStream(r,{checkOpen:n})&&(r.readable||!n)&&typeof r.read==="function"&&typeof r.readable==="boolean"&&typeof r.readableObjectMode==="boolean"&&typeof r.destroy==="function"&&typeof r.destroyed==="boolean"}function decompress_unzip_node_modules_is_stream_isDuplexStream(r,n){return decompress_unzip_node_modules_is_stream_isWritableStream(r,n)&&decompress_unzip_node_modules_is_stream_isReadableStream(r,n)}function decompress_unzip_node_modules_is_stream_isTransformStream(r,n){return decompress_unzip_node_modules_is_stream_isDuplexStream(r,n)&&typeof r._transform==="function"}const Tt=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class c{#e;#t;#r=!1;#n=void 0;constructor(r,n){this.#e=r,this.#t=n}next(){const e=()=>this.#i();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(r){const t=()=>this.#o(r);return this.#n?this.#n.then(t,t):t()}async#i(){if(this.#r)return{done:!0,value:void 0};let r;try{r=await this.#e.read()}catch(r){throw this.#n=void 0,this.#r=!0,this.#e.releaseLock(),r}return r.done&&(this.#n=void 0,this.#r=!0,this.#e.releaseLock()),r}async#o(r){if(this.#r)return{done:!0,value:r};if(this.#r=!0,!this.#t){const n=this.#e.cancel(r);return this.#e.releaseLock(),await n,{done:!0,value:r}}return this.#e.releaseLock(),{done:!0,value:r}}}const Bt=Symbol();function i(){return this[Bt].next()}Object.defineProperty(i,"name",{value:"next"});function o(r){return this[Bt].return(r)}Object.defineProperty(o,"name",{value:"return"});const zt=Object.create(Tt,{next:{enumerable:!0,configurable:!0,writable:!0,value:i},return:{enumerable:!0,configurable:!0,writable:!0,value:o}});function h({preventCancel:r=!1}={}){const n=this.getReader(),a=new c(n,r),s=Object.create(zt);return s[Bt]=a,s}const getAsyncIterable=r=>{if(decompress_unzip_node_modules_is_stream_isReadableStream(r,{checkOpen:false})&&Ot.on!==undefined){return getStreamIterable(r)}if(typeof r?.[Symbol.asyncIterator]==="function"){return r}if(At.call(r)==="[object ReadableStream]"){return h.call(r)}throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")};const{toString:At}=Object.prototype;const getStreamIterable=async function*(r){const n=new AbortController;const a={};handleStreamEnd(r,n,a);try{for await(const[a]of Ot.on(r,"data",{signal:n.signal})){yield a}}catch(r){if(a.error!==undefined){throw a.error}else if(!n.signal.aborted){throw r}}finally{r.destroy()}};const handleStreamEnd=async(r,n,a)=>{try{await Ot.finished(r,{cleanup:true,readable:true,writable:false,error:false})}catch(r){a.error=r}finally{n.abort()}};const Ot={};const getStreamContents=async(r,{init:n,convertChunk:a,getSize:s,truncateChunk:u,addChunk:l,getFinalChunk:d,finalize:p},{maxBuffer:m=Number.POSITIVE_INFINITY}={})=>{const g=getAsyncIterable(r);const y=n();y.length=0;try{for await(const r of g){const n=getChunkType(r);const d=a[n](r,y);appendChunk({convertedChunk:d,state:y,getSize:s,truncateChunk:u,addChunk:l,maxBuffer:m})}appendFinalChunk({state:y,convertChunk:a,getSize:s,truncateChunk:u,addChunk:l,getFinalChunk:d,maxBuffer:m});return p(y)}catch(r){const n=typeof r==="object"&&r!==null?r:new Error(r);n.bufferedData=p(y);throw n}};const appendFinalChunk=({state:r,getSize:n,truncateChunk:a,addChunk:s,getFinalChunk:u,maxBuffer:l})=>{const d=u(r);if(d!==undefined){appendChunk({convertedChunk:d,state:r,getSize:n,truncateChunk:a,addChunk:s,maxBuffer:l})}};const appendChunk=({convertedChunk:r,state:n,getSize:a,truncateChunk:s,addChunk:u,maxBuffer:l})=>{const d=a(r);const p=n.length+d;if(p<=l){addNewChunk(r,n,u,p);return}const m=s(r,l-n.length);if(m!==undefined){addNewChunk(m,n,u,l)}throw new MaxBufferError};const addNewChunk=(r,n,a,s)=>{n.contents=a(r,n,s);n.length=s};const getChunkType=r=>{const n=typeof r;if(n==="string"){return"string"}if(n!=="object"||r===null){return"others"}if(globalThis.Buffer?.isBuffer(r)){return"buffer"}const a=Lt.call(r);if(a==="[object ArrayBuffer]"){return"arrayBuffer"}if(a==="[object DataView]"){return"dataView"}if(Number.isInteger(r.byteLength)&&Number.isInteger(r.byteOffset)&&Lt.call(r.buffer)==="[object ArrayBuffer]"){return"typedArray"}return"others"};const{toString:Lt}=Object.prototype;class MaxBufferError extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const identity=r=>r;const noop=()=>undefined;const getContentsProperty=({contents:r})=>r;const throwObjectStream=r=>{throw new Error(`Streams in object mode are not supported: ${String(r)}`)};const getLengthProperty=r=>r.length;async function getStreamAsArrayBuffer(r,n){return getStreamContents(r,It,n)}const initArrayBuffer=()=>({contents:new ArrayBuffer(0)});const useTextEncoder=r=>Rt.encode(r);const Rt=new TextEncoder;const useUint8Array=r=>new Uint8Array(r);const useUint8ArrayWithOffset=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);const truncateArrayBufferChunk=(r,n)=>r.slice(0,n);const addArrayBufferChunk=(r,{contents:n,length:a},s)=>{const u=hasArrayBufferResize()?resizeArrayBuffer(n,s):resizeArrayBufferSlow(n,s);new Uint8Array(u).set(r,a);return u};const resizeArrayBufferSlow=(r,n)=>{if(n<=r.byteLength){return r}const a=new ArrayBuffer(getNewContentsLength(n));new Uint8Array(a).set(new Uint8Array(r),0);return a};const resizeArrayBuffer=(r,n)=>{if(n<=r.maxByteLength){r.resize(n);return r}const a=new ArrayBuffer(n,{maxByteLength:getNewContentsLength(n)});new Uint8Array(a).set(new Uint8Array(r),0);return a};const getNewContentsLength=r=>Ut**Math.ceil(Math.log(r)/Math.log(Ut));const Ut=2;const finalizeArrayBuffer=({contents:r,length:n})=>hasArrayBufferResize()?r:r.slice(0,n);const hasArrayBufferResize=()=>"resize"in ArrayBuffer.prototype;const It={init:initArrayBuffer,convertChunk:{string:useTextEncoder,buffer:useUint8Array,arrayBuffer:useUint8Array,dataView:useUint8ArrayWithOffset,typedArray:useUint8ArrayWithOffset,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateArrayBufferChunk,addChunk:addArrayBufferChunk,getFinalChunk:noop,finalize:finalizeArrayBuffer};async function getStreamAsBuffer(r,n){if(!("Buffer"in globalThis)){throw new Error("getStreamAsBuffer() is only supported in Node.js")}try{return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(r,n))}catch(r){if(r.bufferedData!==undefined){r.bufferedData=arrayBufferToNodeBuffer(r.bufferedData)}throw r}}const arrayBufferToNodeBuffer=r=>globalThis.Buffer.from(r);var Dt=__nccwpck_require__(6594);const getType=(r,n)=>{const a=61440;const s=16384;const u=40960;const l=r.versionMadeBy>>8;if((n&a)===u){return"symlink"}if((n&a)===s||l===0&&r.externalFileAttributes===16){return"directory"}return"file"};const extractEntry=async(r,n)=>{const a={mode:r.externalFileAttributes>>16&65535,mtime:r.getLastModDate(),path:r.fileName};a.type=getType(r,a.mode);if(a.mode===0&&a.type==="directory"){a.mode=493}if(a.mode===0){a.mode=420}const s=await n.openReadStreamPromise(r);const u=await getStreamAsBuffer(s);a.data=u;if(a.type==="symlink"){a.linkname=u.toString()}return a};const decompressUnzip=()=>async r=>{if(!n.Buffer.isBuffer(r)){throw new TypeError(`Expected a Buffer, got ${typeof r}`)}const a=await fileTypeFromBuffer(r);if(!a||a.mime!=="application/zip"){return[]}const s=await Dt.fromBufferPromise(r);const u=[];for await(const r of s.eachEntry()){u.push(await extractEntry(r,s))}return u};const Pt=decompressUnzip;var Mt=__nccwpck_require__(7758);var Nt=__nccwpck_require__(5723);const jt=(0,p.promisify)(Mt.link);const Wt=(0,p.promisify)(Mt.mkdir);const $t=(0,p.promisify)(Mt.readFile);const qt=(0,p.promisify)(Mt.symlink);const Ht=(0,p.promisify)(Mt.utimes);const Zt=d.platform==="win32";const Gt=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;const runPlugins=async(r,n)=>{if(n.plugins.length===0){return[]}const a=await Promise.all(n.plugins.map((a=>a(r,n))));return a.flat()};const isInsideOutput=(r,n)=>{const a=l.relative(n,r);return a===""||a!==".."&&!a.startsWith(`..${l.sep}`)&&!l.isAbsolute(a)};const isUnsafeWindowsSegment=r=>{if(r===""||r==="."||r===".."){return false}if(/[<>:"|?*]/.test(r)||[...r].some((r=>r.codePointAt(0)<32))){return true}return Gt.test(r)};const assertSafeEntryPath=(r,n=Zt)=>{if(r.includes("\0")){throw new Error(`Refusing to extract a path containing a NUL byte: ${r}`)}if(!n){return}const a=r.split(/[/\\]/).find((r=>isUnsafeWindowsSegment(r)));if(a!==undefined){throw new Error(`Refusing to extract a path that is unsafe on Windows: ${r}`)}};const safeMakeDir=async(r,n)=>{let a;try{a=await(0,u.realpath)(r)}catch{const s=l.dirname(r);a=await safeMakeDir(s,n)}if(!isInsideOutput(a,n)){throw new Error("Refusing to create a directory outside the output path.")}await Wt(r,{recursive:true});return(0,u.realpath)(r)};const ensureLinkTargetInsideOutput=async(r,n,a)=>{const s=l.resolve(n,r);if(!isInsideOutput(s,a)){throw new Error(`Refusing to create a link pointing outside the output directory: ${s}`)}let d;try{d=await(0,u.realpath)(s)}catch{return s}if(!isInsideOutput(d,a)){throw new Error(`Refusing to create a link pointing outside the output directory: ${d}`)}return s};const assertNotSymlink=async r=>{const n=await(0,u.lstat)(r).catch((()=>null));if(n&&n.isSymbolicLink()){throw new Error(`Refusing to hardlink to a symlink: ${r}`)}};const resolveMaybeMissing=async r=>{let n=r;const a=[];for(;;){try{return l.join(await(0,u.realpath)(n),...a.toReversed())}catch{const s=l.dirname(n);if(s===n){return r}a.push(l.basename(n));n=s}}};const assertSymlinkResolvesInside=async(r,n,a)=>{const s=l.isAbsolute(n)?n:l.dirname(r)+l.sep+n;const d=await resolveMaybeMissing(s);if(!isInsideOutput(d,a)){await(0,u.unlink)(r).catch((()=>null));throw new Error(`Refusing to keep a symlink that escapes the output directory: ${r}`)}};const isSymlink=r=>r.type==="symlink"&&!Zt;const isHardlink=r=>r.type==="link"||r.type==="symlink"&&Zt;const extractFile=async(r,n,s)=>{let p=await runPlugins(r,s);if(s.strip>0){p=p.map((r=>{r.path=Nt(r.path,s.strip);return r})).filter((r=>r.path!=="."))}if(typeof s.filter==="function"){p=p.filter(s.filter)}if(typeof s.map==="function"){p=p.map(s.map)}if(!n||p.length===0){return p}const m=new Set;for(const r of p){const n=Zt?r.path.toLowerCase():r.path;if(m.has(n)){throw new Error(`Refusing to extract an archive with a duplicate entry path: ${r.path}`)}m.add(n)}await Wt(n,{recursive:true});const g=await(0,u.realpath)(n);const y=d.umask();const b=new Date;const extractEntry=async r=>{assertSafeEntryPath(r.path);const s=l.join(n,r.path);if(r.type==="directory"){await safeMakeDir(s,g);await Ht(s,b,r.mtime);return}await safeMakeDir(l.dirname(s),g);const d=await(0,u.realpath)(l.dirname(s));if(!isInsideOutput(d,g)){throw new Error(`Refusing to write outside output directory: ${d}`)}if(r.type==="link"){const n=await ensureLinkTargetInsideOutput(r.linkname,g,g);await assertNotSymlink(n);await jt(n,s)}else if(r.type==="symlink"&&Zt){const n=await ensureLinkTargetInsideOutput(r.linkname,d,g);await assertNotSymlink(n);await jt(n,s)}else if(r.type==="symlink"){await ensureLinkTargetInsideOutput(r.linkname,d,g);await qt(r.linkname,s)}else{const n=r.mode&511&~y;const l=a.constants.O_WRONLY|a.constants.O_CREAT|a.constants.O_TRUNC|(a.constants.O_NOFOLLOW||0);const d=await(0,u.open)(s,l,n).catch((r=>{if(r.code==="ELOOP"){throw new Error("Refusing to write into a symlink")}throw r}));try{await d.writeFile(r.data);await d.utimes(b,r.mtime)}finally{await d.close()}}};const w=Array.from({length:p.length});const settle=async(r,n)=>{try{await n(p[r]);w[r]={status:"fulfilled"}}catch(n){w[r]={status:"rejected",reason:n}}};const x=[...p.keys()];const _=x.filter((r=>isSymlink(p[r])));await Promise.all(x.filter((r=>!isSymlink(p[r])&&!isHardlink(p[r]))).map((r=>settle(r,extractEntry))));await Promise.all(_.map((r=>settle(r,extractEntry))));await Promise.all(x.filter((r=>isHardlink(p[r]))).map((r=>settle(r,extractEntry))));await Promise.all(_.filter((r=>w[r].status==="fulfilled")).map((r=>settle(r,(r=>assertSymlinkResolvesInside(l.join(n,r.path),r.linkname,g))))));const S=w.find((r=>r.status==="rejected"));if(S){throw S.reason}return p};const decompress=async(r,a,s)=>{if(typeof r!=="string"&&!n.Buffer.isBuffer(r)){throw new TypeError("Input file required")}if(typeof a==="object"){s=a;a=null}s={plugins:[St(),Et(),Ft(),Pt()],...s};const u=typeof r==="string"?await $t(r):r;return extractFile(u,a,s)};const Vt=decompress})();var u=s.l;var l=s.Z;export{u as assertSafeEntryPath,l as default};
@@ -0,0 +1 @@
1
+ {"name":"@xhmikosr/decompress","version":"11.1.4","description":"Extracting archives made easy","license":"MIT","repository":{"type":"git","url":"git+https://github.com/XhmikosR/decompress.git"},"publishConfig":{"access":"public"},"author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"https://github.com/kevva"},"engines":{"node":">=20"},"scripts":{"ava":"ava","lint":"xo","xo":"xo","fix":"xo --fix","test":"npm run xo && npm run ava","test-ci":"c8 ava"},"main":"index.js","type":"module","exports":{".":"./index.js"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"@xhmikosr/decompress-tar":"^9.0.2","@xhmikosr/decompress-tarbz2":"^9.0.2","@xhmikosr/decompress-targz":"^9.0.1","@xhmikosr/decompress-unzip":"^8.2.1","graceful-fs":"^4.2.11","strip-dirs":"^3.0.0"},"devDependencies":{"ava":"^7.0.0","c8":"^12.0.0","file-type":"^21.3.4","xo":"^2.0.2"},"xo":{"rules":{"capitalized-comments":"off","require-unicode-regexp":"off","unicorn/prevent-abbreviations":"off"}},"allowScripts":{"unrs-resolver@1.11.1":true},"_lastModified":"2026-09-30T16:03:18.004Z"}
@@ -1 +1 @@
1
- {"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2026-09-24T07:20:39.410Z"}
1
+ {"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2026-09-30T16:03:15.880Z"}