@zenfs/core 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- var ZenFS=(()=>{var tu=Object.create;var yr=Object.defineProperty;var ru=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var nu=Object.getPrototypeOf,ou=Object.prototype.hasOwnProperty;var s=(t,e)=>yr(t,"name",{value:e,configurable:!0});var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ei=(t,e)=>{for(var r in e)yr(t,r,{get:e[r],enumerable:!0})},cs=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of iu(e))!ou.call(t,n)&&n!==r&&yr(t,n,{get:()=>e[n],enumerable:!(i=ru(e,n))||i.enumerable});return t};var su=(t,e,r)=>(r=t!=null?tu(nu(t)):{},cs(e||!t||!t.__esModule?yr(r,"default",{value:t,enumerable:!0}):r,t)),au=t=>cs(yr({},"__esModule",{value:!0}),t);var ks=N(mi=>{"use strict";mi.byteLength=Ud;mi.toByteArray=qd;mi.fromByteArray=zd;var Ce=[],be=[],Md=typeof Uint8Array<"u"?Uint8Array:Array,jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(bt=0,vs=jn.length;bt<vs;++bt)Ce[bt]=jn[bt],be[jn.charCodeAt(bt)]=bt;var bt,vs;be["-".charCodeAt(0)]=62;be["_".charCodeAt(0)]=63;function As(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}s(As,"getLens");function Ud(t){var e=As(t),r=e[0],i=e[1];return(r+i)*3/4-i}s(Ud,"byteLength");function Wd(t,e,r){return(e+r)*3/4-r}s(Wd,"_byteLength");function qd(t){var e,r=As(t),i=r[0],n=r[1],o=new Md(Wd(t,i,n)),a=0,l=n>0?i-4:i,u;for(u=0;u<l;u+=4)e=be[t.charCodeAt(u)]<<18|be[t.charCodeAt(u+1)]<<12|be[t.charCodeAt(u+2)]<<6|be[t.charCodeAt(u+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=be[t.charCodeAt(u)]<<2|be[t.charCodeAt(u+1)]>>4,o[a++]=e&255),n===1&&(e=be[t.charCodeAt(u)]<<10|be[t.charCodeAt(u+1)]<<4|be[t.charCodeAt(u+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(qd,"toByteArray");function jd(t){return Ce[t>>18&63]+Ce[t>>12&63]+Ce[t>>6&63]+Ce[t&63]}s(jd,"tripletToBase64");function $d(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(jd(i));return n.join("")}s($d,"encodeChunk");function zd(t){for(var e,r=t.length,i=r%3,n=[],o=16383,a=0,l=r-i;a<l;a+=o)n.push($d(t,a,a+o>l?l:a+o));return i===1?(e=t[r-1],n.push(Ce[e>>2]+Ce[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(Ce[e>>10]+Ce[e>>4&63]+Ce[e<<2&63]+"=")),n.join("")}s(zd,"fromByteArray")});var Ns=N($n=>{$n.read=function(t,e,r,i,n){var o,a,l=n*8-i-1,u=(1<<l)-1,f=u>>1,d=-7,h=r?n-1:0,m=r?-1:1,y=t[e+h];for(h+=m,o=y&(1<<-d)-1,y>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=i;d>0;a=a*256+t[e+h],h+=m,d-=8);if(o===0)o=1-f;else{if(o===u)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-f}return(y?-1:1)*a*Math.pow(2,o-i)};$n.write=function(t,e,r,i,n,o){var a,l,u,f=o*8-n-1,d=(1<<f)-1,h=d>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,w=i?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+h>=1?e+=m/u:e+=m*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*u-1)*Math.pow(2,n),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[r+y]=l&255,y+=w,l/=256,n-=8);for(a=a<<n|l,f+=n;f>0;t[r+y]=a&255,y+=w,a/=256,f-=8);t[r+y-w]|=b*128}});var He=N(Jt=>{"use strict";var zn=ks(),Yt=Ns(),Ts=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Jt.Buffer=p;Jt.SlowBuffer=Xd;Jt.INSPECT_MAX_BYTES=50;var bi=2147483647;Jt.kMaxLength=bi;p.TYPED_ARRAY_SUPPORT=Vd();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Vd(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Vd,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function Ve(t){if(t>bi)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}s(Ve,"createBuffer");function p(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Gn(t)}return Ls(t,e,r)}s(p,"Buffer");p.poolSize=8192;function Ls(t,e,r){if(typeof t=="string")return Kd(t,e);if(ArrayBuffer.isView(t))return Gd(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Re(t,ArrayBuffer)||t&&Re(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Re(t,SharedArrayBuffer)||t&&Re(t.buffer,SharedArrayBuffer)))return Hn(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return p.from(i,e,r);let n=Yd(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(Ls,"from");p.from=function(t,e,r){return Ls(t,e,r)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function Cs(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(Cs,"assertSize");function Hd(t,e,r){return Cs(t),t<=0?Ve(t):e!==void 0?typeof r=="string"?Ve(t).fill(e,r):Ve(t).fill(e):Ve(t)}s(Hd,"alloc");p.alloc=function(t,e,r){return Hd(t,e,r)};function Gn(t){return Cs(t),Ve(t<0?0:Yn(t)|0)}s(Gn,"allocUnsafe");p.allocUnsafe=function(t){return Gn(t)};p.allocUnsafeSlow=function(t){return Gn(t)};function Kd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Rs(t,e)|0,i=Ve(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}s(Kd,"fromString");function Vn(t){let e=t.length<0?0:Yn(t.length)|0,r=Ve(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}s(Vn,"fromArrayLike");function Gd(t){if(Re(t,Uint8Array)){let e=new Uint8Array(t);return Hn(e.buffer,e.byteOffset,e.byteLength)}return Vn(t)}s(Gd,"fromArrayView");function Hn(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,p.prototype),i}s(Hn,"fromArrayBuffer");function Yd(t){if(p.isBuffer(t)){let e=Yn(t.length)|0,r=Ve(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Jn(t.length)?Ve(0):Vn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Vn(t.data)}s(Yd,"fromObject");function Yn(t){if(t>=bi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+bi.toString(16)+" bytes");return t|0}s(Yn,"checked");function Xd(t){return+t!=t&&(t=0),p.alloc(+t)}s(Xd,"SlowBuffer");p.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=s(function(e,r){if(Re(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Re(r,Uint8Array)&&(r=p.from(r,r.offset,r.byteLength)),!p.isBuffer(e)||!p.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,a=Math.min(i,n);o<a;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0},"compare");p.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");p.concat=s(function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=p.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let a=e[i];if(Re(a,Uint8Array))o+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(p.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function Rs(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Re(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Kn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return $s(t).length;default:if(n)return i?-1:Kn(t).length;e=(""+e).toLowerCase(),n=!0}}s(Rs,"byteLength");p.byteLength=Rs;function Jd(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return ah(this,e,r);case"utf8":case"utf-8":return Bs(this,e,r);case"ascii":return oh(this,e,r);case"latin1":case"binary":return sh(this,e,r);case"base64":return ih(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lh(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}s(Jd,"slowToString");p.prototype._isBuffer=!0;function gt(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}s(gt,"swap");p.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)gt(this,r,r+1);return this},"swap16");p.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)gt(this,r,r+3),gt(this,r+1,r+2);return this},"swap32");p.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)gt(this,r,r+7),gt(this,r+1,r+6),gt(this,r+2,r+5),gt(this,r+3,r+4);return this},"swap64");p.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?Bs(this,0,e):Jd.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=s(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=s(function(){let e="",r=Jt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Ts&&(p.prototype[Ts]=p.prototype.inspect);p.prototype.compare=s(function(e,r,i,n,o){if(Re(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,l=i-r,u=Math.min(a,l),f=this.slice(n,o),d=e.slice(r,i);for(let h=0;h<u;++h)if(f[h]!==d[h]){a=f[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function Os(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Jn(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,i)),p.isBuffer(e))return e.length===0?-1:Is(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Is(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}s(Os,"bidirectionalIndexOf");function Is(t,e,r,i,n){let o=1,a=t.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}function u(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(u,"read");let f;if(n){let d=-1;for(f=r;f<a;f++)if(u(t,f)===u(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===l)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(r+l>a&&(r=a-l),f=r;f>=0;f--){let d=!0;for(let h=0;h<l;h++)if(u(t,f+h)!==u(e,h)){d=!1;break}if(d)return f}return-1}s(Is,"arrayIndexOf");p.prototype.includes=s(function(e,r,i){return this.indexOf(e,r,i)!==-1},"includes");p.prototype.indexOf=s(function(e,r,i){return Os(this,e,r,i,!0)},"indexOf");p.prototype.lastIndexOf=s(function(e,r,i){return Os(this,e,r,i,!1)},"lastIndexOf");function Qd(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let a;for(a=0;a<i;++a){let l=parseInt(e.substr(a*2,2),16);if(Jn(l))return a;t[r+a]=l}return a}s(Qd,"hexWrite");function Zd(t,e,r,i){return gi(Kn(e,t.length-r),t,r,i)}s(Zd,"utf8Write");function eh(t,e,r,i){return gi(dh(e),t,r,i)}s(eh,"asciiWrite");function th(t,e,r,i){return gi($s(e),t,r,i)}s(th,"base64Write");function rh(t,e,r,i){return gi(hh(e,t.length-r),t,r,i)}s(rh,"ucs2Write");p.prototype.write=s(function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return Qd(this,e,r,i);case"utf8":case"utf-8":return Zd(this,e,r,i);case"ascii":case"latin1":case"binary":return eh(this,e,r,i);case"base64":return th(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rh(this,e,r,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function ih(t,e,r){return e===0&&r===t.length?zn.fromByteArray(t):zn.fromByteArray(t.slice(e,r))}s(ih,"base64Slice");function Bs(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=r){let u,f,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:u=t[n+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(a=h));break;case 3:u=t[n+1],f=t[n+2],(u&192)===128&&(f&192)===128&&(h=(o&15)<<12|(u&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:u=t[n+1],f=t[n+2],d=t[n+3],(u&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(u&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=l}return nh(i)}s(Bs,"utf8Slice");var Ps=4096;function nh(t){let e=t.length;if(e<=Ps)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Ps));return r}s(nh,"decodeCodePointsArray");function oh(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}s(oh,"asciiSlice");function sh(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}s(sh,"latin1Slice");function ah(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=ph[t[o]];return n}s(ah,"hexSlice");function lh(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}s(lh,"utf16leSlice");p.prototype.slice=s(function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,p.prototype),n},"slice");function G(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s(G,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=s(function(e,r,i){e=e>>>0,r=r>>>0,i||G(e,r,this.length);let n=this[e],o=1,a=0;for(;++a<r&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=s(function(e,r,i){e=e>>>0,r=r>>>0,i||G(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=s(function(e,r){return e=e>>>0,r||G(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=s(function(e,r){return e=e>>>0,r||G(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=s(function(e,r){return e=e>>>0,r||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Mr(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Mr(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));p.prototype.readIntLE=s(function(e,r,i){e=e>>>0,r=r>>>0,i||G(e,r,this.length);let n=this[e],o=1,a=0;for(;++a<r&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},"readIntLE");p.prototype.readIntBE=s(function(e,r,i){e=e>>>0,r=r>>>0,i||G(e,r,this.length);let n=r,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a},"readIntBE");p.prototype.readInt8=s(function(e,r){return e=e>>>0,r||G(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=s(function(e,r){e=e>>>0,r||G(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},"readInt16LE");p.prototype.readInt16BE=s(function(e,r){e=e>>>0,r||G(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},"readInt16BE");p.prototype.readInt32LE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Mr(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Mr(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)},"readBigInt64BE"));p.prototype.readFloatLE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),Yt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),Yt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=s(function(e,r){return e=e>>>0,r||G(e,8,this.length),Yt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=s(function(e,r){return e=e>>>0,r||G(e,8,this.length),Yt.read(this,e,!1,52,8)},"readDoubleBE");function se(t,e,r,i,n,o){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}s(se,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=s(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;se(this,e,r,i,l,0)}let o=1,a=0;for(this[r]=e&255;++a<i&&(o*=256);)this[r+a]=e/o&255;return r+i},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=s(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;se(this,e,r,i,l,0)}let o=i-1,a=1;for(this[r+o]=e&255;--o>=0&&(a*=256);)this[r+o]=e/a&255;return r+i},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,1,255,0),this[r]=e&255,r+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeUInt32BE");function Ds(t,e,r,i,n){js(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}s(Ds,"wrtBigUInt64LE");function Ms(t,e,r,i,n){js(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}s(Ms,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=lt(s(function(e,r=0){return Ds(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=lt(s(function(e,r=0){return Ms(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=s(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let u=Math.pow(2,8*i-1);se(this,e,r,i,u-1,-u)}let o=0,a=1,l=0;for(this[r]=e&255;++o<i&&(a*=256);)e<0&&l===0&&this[r+o-1]!==0&&(l=1),this[r+o]=(e/a>>0)-l&255;return r+i},"writeIntLE");p.prototype.writeIntBE=s(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let u=Math.pow(2,8*i-1);se(this,e,r,i,u-1,-u)}let o=i-1,a=1,l=0;for(this[r+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[r+o+1]!==0&&(l=1),this[r+o]=(e/a>>0)-l&255;return r+i},"writeIntBE");p.prototype.writeInt8=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},"writeInt8");p.prototype.writeInt16LE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeInt16LE");p.prototype.writeInt16BE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeInt16BE");p.prototype.writeInt32LE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},"writeInt32LE");p.prototype.writeInt32BE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeInt32BE");p.prototype.writeBigInt64LE=lt(s(function(e,r=0){return Ds(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=lt(s(function(e,r=0){return Ms(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Us(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}s(Us,"checkIEEE754");function Ws(t,e,r,i,n){return e=+e,r=r>>>0,n||Us(t,e,r,4,34028234663852886e22,-34028234663852886e22),Yt.write(t,e,r,i,23,4),r+4}s(Ws,"writeFloat");p.prototype.writeFloatLE=s(function(e,r,i){return Ws(this,e,r,!0,i)},"writeFloatLE");p.prototype.writeFloatBE=s(function(e,r,i){return Ws(this,e,r,!1,i)},"writeFloatBE");function qs(t,e,r,i,n){return e=+e,r=r>>>0,n||Us(t,e,r,8,17976931348623157e292,-17976931348623157e292),Yt.write(t,e,r,i,52,8),r+8}s(qs,"writeDouble");p.prototype.writeDoubleLE=s(function(e,r,i){return qs(this,e,r,!0,i)},"writeDoubleLE");p.prototype.writeDoubleBE=s(function(e,r,i){return qs(this,e,r,!1,i)},"writeDoubleBE");p.prototype.copy=s(function(e,r,i,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o},"copy");p.prototype.fill=s(function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=a[o%l]}return this},"fill");var Gt={};function Xn(t,e,r){Gt[t]=s(class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(Xn,"E");Xn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Xn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Xn("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Fs(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Fs(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Fs(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}s(Fs,"addNumericalSeparator");function ch(t,e,r){Xt(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Mr(e,t.length-(r+1))}s(ch,"checkBounds");function js(t,e,r,i,n,o){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${r}${a}`,new Gt.ERR_OUT_OF_RANGE("value",l,t)}ch(i,n,o)}s(js,"checkIntBI");function Xt(t,e){if(typeof t!="number")throw new Gt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(Xt,"validateNumber");function Mr(t,e,r){throw Math.floor(t)!==t?(Xt(t,r),new Gt.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Gt.ERR_BUFFER_OUT_OF_BOUNDS:new Gt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}s(Mr,"boundsError");var uh=/[^+/0-9A-Za-z-_]/g;function fh(t){if(t=t.split("=")[0],t=t.trim().replace(uh,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(fh,"base64clean");function Kn(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let a=0;a<i;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}s(Kn,"utf8ToBytes");function dh(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}s(dh,"asciiToBytes");function hh(t,e){let r,i,n,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),i=r>>8,n=r%256,o.push(n),o.push(i);return o}s(hh,"utf16leToBytes");function $s(t){return zn.toByteArray(fh(t))}s($s,"base64ToBytes");function gi(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}s(gi,"blitBuffer");function Re(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(Re,"isInstance");function Jn(t){return t!==t}s(Jn,"numberIsNaN");var ph=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function lt(t){return typeof BigInt>"u"?yh:t}s(lt,"defineBigIntMethod");function yh(){throw new Error("BigInt not supported")}s(yh,"BufferBigIntNotDefined")});var O=N((m_,zs)=>{"use strict";zs.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Qt=N((b_,wi)=>{"use strict";var{AbortController:Vs,AbortSignal:mh}=typeof self<"u"?self:typeof window<"u"?window:void 0;wi.exports=Vs;wi.exports.AbortSignal=mh;wi.exports.default=Vs});var Ur=N((g_,Qn)=>{"use strict";var Zt=typeof Reflect=="object"?Reflect:null,Hs=Zt&&typeof Zt.apply=="function"?Zt.apply:s(function(e,r,i){return Function.prototype.apply.call(e,r,i)},"ReflectApply"),Si;Zt&&typeof Zt.ownKeys=="function"?Si=Zt.ownKeys:Object.getOwnPropertySymbols?Si=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Si=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function bh(t){console&&console.warn&&console.warn(t)}s(bh,"ProcessEmitWarning");var Gs=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function P(){P.init.call(this)}s(P,"EventEmitter");Qn.exports=P;Qn.exports.once=_h;P.EventEmitter=P;P.prototype._events=void 0;P.prototype._eventsCount=0;P.prototype._maxListeners=void 0;var Ks=10;function _i(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(_i,"checkListener");Object.defineProperty(P,"defaultMaxListeners",{enumerable:!0,get:function(){return Ks},set:function(t){if(typeof t!="number"||t<0||Gs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ks=t}});P.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};P.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Gs(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function Ys(t){return t._maxListeners===void 0?P.defaultMaxListeners:t._maxListeners}s(Ys,"_getMaxListeners");P.prototype.getMaxListeners=s(function(){return Ys(this)},"getMaxListeners");P.prototype.emit=s(function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var u=o[e];if(u===void 0)return!1;if(typeof u=="function")Hs(u,this,r);else for(var f=u.length,d=ea(u,f),i=0;i<f;++i)Hs(d[i],this,r);return!0},"emit");function Xs(t,e,r,i){var n,o,a;if(_i(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),a===void 0)a=o[e]=r,++t._eventsCount;else if(typeof a=="function"?a=o[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),n=Ys(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,bh(l)}return t}s(Xs,"_addListener");P.prototype.addListener=s(function(e,r){return Xs(this,e,r,!1)},"addListener");P.prototype.on=P.prototype.addListener;P.prototype.prependListener=s(function(e,r){return Xs(this,e,r,!0)},"prependListener");function gh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}s(gh,"onceWrapper");function Js(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=gh.bind(i);return n.listener=r,i.wrapFn=n,n}s(Js,"_onceWrap");P.prototype.once=s(function(e,r){return _i(r),this.on(e,Js(this,e,r)),this},"once");P.prototype.prependOnceListener=s(function(e,r){return _i(r),this.prependListener(e,Js(this,e,r)),this},"prependOnceListener");P.prototype.removeListener=s(function(e,r){var i,n,o,a,l;if(_i(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(o=-1,a=i.length-1;a>=0;a--)if(i[a]===r||i[a].listener===r){l=i[a].listener,o=a;break}if(o<0)return this;o===0?i.shift():wh(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},"removeListener");P.prototype.off=P.prototype.removeListener;P.prototype.removeAllListeners=s(function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this},"removeAllListeners");function Qs(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Sh(n):ea(n,n.length)}s(Qs,"_listeners");P.prototype.listeners=s(function(e){return Qs(this,e,!0)},"listeners");P.prototype.rawListeners=s(function(e){return Qs(this,e,!1)},"rawListeners");P.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Zs.call(t,e)};P.prototype.listenerCount=Zs;function Zs(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}s(Zs,"listenerCount");P.prototype.eventNames=s(function(){return this._eventsCount>0?Si(this._events):[]},"eventNames");function ea(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}s(ea,"arrayClone");function wh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(wh,"spliceOne");function Sh(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}s(Sh,"unwrapListeners");function _h(t,e){return new Promise(function(r,i){function n(a){t.removeListener(e,o),i(a)}s(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}s(o,"resolver"),ta(t,e,o,{once:!0}),e!=="error"&&Eh(t,n,{once:!0})})}s(_h,"once");function Eh(t,e,r){typeof t.on=="function"&&ta(t,"error",e,r)}s(Eh,"addErrorHandlerIfEventEmitter");function ta(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function n(o){i.once&&t.removeEventListener(e,n),r(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(ta,"eventTargetAgnosticAddListener")});var Z=N((S_,Zn)=>{"use strict";var xh=He(),{kResistStopPropagation:vh,SymbolDispose:Ah}=O(),kh=globalThis.AbortSignal||Qt().AbortSignal,Nh=globalThis.AbortController||Qt().AbortController,Th=Object.getPrototypeOf(async function(){}).constructor,ra=globalThis.Blob||xh.Blob,Ih=s(typeof ra<"u"?function(e){return e instanceof ra}:function(e){return!1},"isBlob"),ia=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Ph=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),Ei=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
2
- `;super(r),this.name="AggregateError",this.errors=e}};s(Ei,"AggregateError");Zn.exports={AggregateError:Ei,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof Th},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Ih,deprecate(t,e){return t},addAbortListener:Ur().addAbortListener||s(function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);ia(e,"signal"),Ph(r,"listener");let i;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[vh]:!0}),i=s(()=>{e.removeEventListener("abort",r)},"removeEventListener")),{__proto__:null,[Ah](){var n;(n=i)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:kh.any||s(function(e){if(e.length===1)return e[0];let r=new Nh,i=s(()=>r.abort(),"abort");return e.forEach(n=>{ia(n,"signals"),n.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),r.signal},"AbortSignalAny")};Zn.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var re=N((E_,sa)=>{"use strict";var{format:Fh,inspect:vi,AggregateError:Lh}=Z(),Ch=globalThis.AggregateError||Lh,Rh=Symbol("kIsNodeError"),Oh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Bh=/^([A-Z][a-z0-9]*)+$/,Dh="__node_internal_",Ai={};function wt(t,e){if(!t)throw new Ai.ERR_INTERNAL_ASSERTION(e)}s(wt,"assert");function na(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}s(na,"addNumericalSeparator");function Mh(t,e,r){if(typeof e=="function")return wt(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return wt(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:Fh(e,...r)}s(Mh,"getMessage");function Q(t,e,r){r||(r=Error);class i extends r{constructor(...o){super(Mh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(i,"NodeError"),Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[Rh]=!0,Ai[t]=i}s(Q,"E");function oa(t){let e=Dh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(oa,"hideStackFrames");function Uh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new Ch([e,t],e.message);return r.code=e.code,r}return t||e}s(Uh,"aggregateTwoErrors");var xi=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Ai.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};s(xi,"AbortError");Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,r)=>{wt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],a=[];for(let u of e)wt(typeof u=="string","All expected entries have to be of type string"),Oh.includes(u)?n.push(u.toLowerCase()):Bh.test(u)?o.push(u):(wt(u!=="object",'The value "object" should be written as "Object"'),a.push(u));if(o.length>0){let u=n.indexOf("object");u!==-1&&(n.splice(n,u,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let u=n.pop();i+=`one of type ${n.join(", ")}, or ${u}`}}(o.length>0||a.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let u=o.pop();i+=`an instance of ${o.join(", ")}, or ${u}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{let u=a.pop();i+=`one of ${a.join(", ")}, or ${u}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var l;if((l=r.constructor)!==null&&l!==void 0&&l.name)i+=`. Received an instance of ${r.constructor.name}`;else{let u=vi(r,{depth:-1});i+=`. Received ${u}`}}else{let u=vi(r,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),i+=`. Received type ${typeof r} (${u})`}return i},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=vi(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);Q("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);Q("ERR_MISSING_ARGS",(...t)=>{wt(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);Q("ERR_OUT_OF_RANGE",(t,e,r)=>{wt(e,'Missing "range" argument');let i;return Number.isInteger(r)&&Math.abs(r)>2**32?i=na(String(r)):typeof r=="bigint"?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=na(i)),i+="n"):i=vi(r),`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);sa.exports={AbortError:xi,aggregateTwoErrors:oa(Uh),hideStackFrames:oa,codes:Ai}});var tr=N((v_,ma)=>{"use strict";var{ArrayIsArray:to,ArrayPrototypeIncludes:ua,ArrayPrototypeJoin:fa,ArrayPrototypeMap:Wh,NumberIsInteger:ro,NumberIsNaN:qh,NumberMAX_SAFE_INTEGER:jh,NumberMIN_SAFE_INTEGER:$h,NumberParseInt:zh,ObjectPrototypeHasOwnProperty:Vh,RegExpPrototypeExec:da,String:Hh,StringPrototypeToUpperCase:Kh,StringPrototypeTrim:Gh}=O(),{hideStackFrames:ge,codes:{ERR_SOCKET_BAD_PORT:Yh,ERR_INVALID_ARG_TYPE:ee,ERR_INVALID_ARG_VALUE:er,ERR_OUT_OF_RANGE:St,ERR_UNKNOWN_SIGNAL:aa}}=re(),{normalizeEncoding:Xh}=Z(),{isAsyncFunction:Jh,isArrayBufferView:Qh}=Z().types,la={};function Zh(t){return t===(t|0)}s(Zh,"isInt32");function ep(t){return t===t>>>0}s(ep,"isUint32");var tp=/^[0-7]+$/,rp="must be a 32-bit unsigned integer or an octal string";function ip(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(da(tp,t)===null)throw new er(e,t,rp);t=zh(t,8)}return ha(t,e),t}s(ip,"parseFileMode");var np=ge((t,e,r=$h,i=jh)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!ro(t))throw new St(e,"an integer",t);if(t<r||t>i)throw new St(e,`>= ${r} && <= ${i}`,t)}),op=ge((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!ro(t))throw new St(e,"an integer",t);if(t<r||t>i)throw new St(e,`>= ${r} && <= ${i}`,t)}),ha=ge((t,e,r=!1)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!ro(t))throw new St(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new St(e,`>= ${i} && <= ${n}`,t)});function io(t,e){if(typeof t!="string")throw new ee(e,"string",t)}s(io,"validateString");function sp(t,e,r=void 0,i){if(typeof t!="number")throw new ee(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&qh(t))throw new St(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}s(sp,"validateNumber");var ap=ge((t,e,r)=>{if(!ua(r,t)){let n="must be one of: "+fa(Wh(r,o=>typeof o=="string"?`'${o}'`:Hh(o)),", ");throw new er(e,t,n)}});function pa(t,e){if(typeof t!="boolean")throw new ee(e,"boolean",t)}s(pa,"validateBoolean");function eo(t,e,r){return t==null||!Vh(t,e)?r:t[e]}s(eo,"getOwnPropertyValueOrDefault");var lp=ge((t,e,r=null)=>{let i=eo(r,"allowArray",!1),n=eo(r,"allowFunction",!1);if(!eo(r,"nullable",!1)&&t===null||!i&&to(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new ee(e,"Object",t)}),cp=ge((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ee(e,"a dictionary",t)}),ki=ge((t,e,r=0)=>{if(!to(t))throw new ee(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new er(e,t,i)}});function up(t,e){ki(t,e);for(let r=0;r<t.length;r++)io(t[r],`${e}[${r}]`)}s(up,"validateStringArray");function fp(t,e){ki(t,e);for(let r=0;r<t.length;r++)pa(t[r],`${e}[${r}]`)}s(fp,"validateBooleanArray");function dp(t,e){ki(t,e);for(let r=0;r<t.length;r++){let i=t[r],n=`${e}[${r}]`;if(i==null)throw new ee(n,"AbortSignal",i);ya(i,n)}}s(dp,"validateAbortSignalArray");function hp(t,e="signal"){if(io(t,e),la[t]===void 0)throw la[Kh(t)]!==void 0?new aa(t+" (signals must use all capital letters)"):new aa(t)}s(hp,"validateSignalName");var pp=ge((t,e="buffer")=>{if(!Qh(t))throw new ee(e,["Buffer","TypedArray","DataView"],t)});function yp(t,e){let r=Xh(e),i=t.length;if(r==="hex"&&i%2!==0)throw new er("encoding",e,`is invalid for data of length ${i}`)}s(yp,"validateEncoding");function mp(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Gh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Yh(e,t,r);return t|0}s(mp,"validatePort");var ya=ge((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ee(e,"AbortSignal",t)}),bp=ge((t,e)=>{if(typeof t!="function")throw new ee(e,"Function",t)}),gp=ge((t,e)=>{if(typeof t!="function"||Jh(t))throw new ee(e,"Function",t)}),wp=ge((t,e)=>{if(t!==void 0)throw new ee(e,"undefined",t)});function Sp(t,e,r){if(!ua(r,t))throw new ee(e,`('${fa(r,"|")}')`,t)}s(Sp,"validateUnion");var _p=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ca(t,e){if(typeof t>"u"||!da(_p,t))throw new er(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(ca,"validateLinkHeaderFormat");function Ep(t){if(typeof t=="string")return ca(t,"hints"),t;if(to(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];ca(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new er("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Ep,"validateLinkHeaderValue");ma.exports={isInt32:Zh,isUint32:ep,parseFileMode:ip,validateArray:ki,validateStringArray:up,validateBooleanArray:fp,validateAbortSignalArray:dp,validateBoolean:pa,validateBuffer:pp,validateDictionary:cp,validateEncoding:yp,validateFunction:bp,validateInt32:op,validateInteger:np,validateNumber:sp,validateObject:lp,validateOneOf:ap,validatePlainFunction:gp,validatePort:mp,validateSignalName:hp,validateString:io,validateUint32:ha,validateUndefined:wp,validateUnion:Sp,validateAbortSignal:ya,validateLinkHeaderValue:Ep}});var ct=N((k_,Sa)=>{var q=Sa.exports={},Oe,Be;function no(){throw new Error("setTimeout has not been defined")}s(no,"defaultSetTimout");function oo(){throw new Error("clearTimeout has not been defined")}s(oo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Oe=setTimeout:Oe=no}catch{Oe=no}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=oo}catch{Be=oo}})();function ba(t){if(Oe===setTimeout)return setTimeout(t,0);if((Oe===no||!Oe)&&setTimeout)return Oe=setTimeout,setTimeout(t,0);try{return Oe(t,0)}catch{try{return Oe.call(null,t,0)}catch{return Oe.call(this,t,0)}}}s(ba,"runTimeout");function xp(t){if(Be===clearTimeout)return clearTimeout(t);if((Be===oo||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(t);try{return Be(t)}catch{try{return Be.call(null,t)}catch{return Be.call(this,t)}}}s(xp,"runClearTimeout");var Ke=[],rr=!1,_t,Ni=-1;function vp(){!rr||!_t||(rr=!1,_t.length?Ke=_t.concat(Ke):Ni=-1,Ke.length&&ga())}s(vp,"cleanUpNextTick");function ga(){if(!rr){var t=ba(vp);rr=!0;for(var e=Ke.length;e;){for(_t=Ke,Ke=[];++Ni<e;)_t&&_t[Ni].run();Ni=-1,e=Ke.length}_t=null,rr=!1,xp(t)}}s(ga,"drainQueue");q.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ke.push(new wa(t,e)),Ke.length===1&&!rr&&ba(ga)};function wa(t,e){this.fun=t,this.array=e}s(wa,"Item");wa.prototype.run=function(){this.fun.apply(null,this.array)};q.title="browser";q.browser=!0;q.env={};q.argv=[];q.version="";q.versions={};function Ge(){}s(Ge,"noop");q.on=Ge;q.addListener=Ge;q.once=Ge;q.off=Ge;q.removeListener=Ge;q.removeAllListeners=Ge;q.emit=Ge;q.prependListener=Ge;q.prependOnceListener=Ge;q.listeners=function(t){return[]};q.binding=function(t){throw new Error("process.binding is not supported")};q.cwd=function(){return"/"};q.chdir=function(t){throw new Error("process.chdir is not supported")};q.umask=function(){return 0}});var Me=N((T_,Oa)=>{"use strict";var{SymbolAsyncIterator:_a,SymbolIterator:Ea,SymbolFor:Et}=O(),xa=Et("nodejs.stream.destroyed"),va=Et("nodejs.stream.errored"),so=Et("nodejs.stream.readable"),ao=Et("nodejs.stream.writable"),Aa=Et("nodejs.stream.disturbed"),Ap=Et("nodejs.webstream.isClosedPromise"),kp=Et("nodejs.webstream.controllerErrorFunction");function Ti(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}s(Ti,"isReadableNodeStream");function Ii(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(Ii,"isWritableNodeStream");function Np(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Np,"isDuplexNodeStream");function De(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(De,"isNodeStream");function ka(t){return!!(t&&!De(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(ka,"isReadableStream");function Na(t){return!!(t&&!De(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(Na,"isWritableStream");function Ta(t){return!!(t&&!De(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(Ta,"isTransformStream");function Tp(t){return ka(t)||Na(t)||Ta(t)}s(Tp,"isWebStream");function Ip(t,e){return t==null?!1:e===!0?typeof t[_a]=="function":e===!1?typeof t[Ea]=="function":typeof t[_a]=="function"||typeof t[Ea]=="function"}s(Ip,"isIterable");function Pi(t){if(!De(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[xa]||i!=null&&i.destroyed)}s(Pi,"isDestroyed");function Ia(t){if(!Ii(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ia,"isWritableEnded");function Pp(t,e){if(!Ii(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}s(Pp,"isWritableFinished");function Fp(t){if(!Ti(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Fp,"isReadableEnded");function Pa(t,e){if(!Ti(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}s(Pa,"isReadableFinished");function Fa(t){return t&&t[so]!=null?t[so]:typeof t?.readable!="boolean"?null:Pi(t)?!1:Ti(t)&&t.readable&&!Pa(t)}s(Fa,"isReadable");function La(t){return t&&t[ao]!=null?t[ao]:typeof t?.writable!="boolean"?null:Pi(t)?!1:Ii(t)&&t.writable&&!Ia(t)}s(La,"isWritable");function Lp(t,e){return De(t)?Pi(t)?!0:!(e?.readable!==!1&&Fa(t)||e?.writable!==!1&&La(t)):null}s(Lp,"isFinished");function Cp(t){var e,r;return De(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}s(Cp,"isWritableErrored");function Rp(t){var e,r;return De(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}s(Rp,"isReadableErrored");function Op(t){if(!De(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Ca(t)?t._closed:null}s(Op,"isClosed");function Ca(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Ca,"isOutgoingMessage");function Ra(t){return typeof t._sent100=="boolean"&&Ca(t)}s(Ra,"isServerResponse");function Bp(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(Bp,"isServerRequest");function Dp(t){if(!De(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&Ra(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}s(Dp,"willEmitClose");function Mp(t){var e;return!!(t&&((e=t[Aa])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Mp,"isDisturbed");function Up(t){var e,r,i,n,o,a,l,u,f,d;return!!(t&&((e=(r=(i=(n=(o=(a=t[va])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(Up,"isErrored");Oa.exports={isDestroyed:Pi,kIsDestroyed:xa,isDisturbed:Mp,kIsDisturbed:Aa,isErrored:Up,kIsErrored:va,isReadable:Fa,kIsReadable:so,kIsClosedPromise:Ap,kControllerErrorFunction:kp,kIsWritable:ao,isClosed:Op,isDuplexNodeStream:Np,isFinished:Lp,isIterable:Ip,isReadableNodeStream:Ti,isReadableStream:ka,isReadableEnded:Fp,isReadableFinished:Pa,isReadableErrored:Rp,isNodeStream:De,isWebStream:Tp,isWritable:La,isWritableNodeStream:Ii,isWritableStream:Na,isWritableEnded:Ia,isWritableFinished:Pp,isWritableErrored:Cp,isServerRequest:Bp,isServerResponse:Ra,willEmitClose:Dp,isTransformStream:Ta}});var Ye=N((P_,ho)=>{var ut=ct(),{AbortError:za,codes:Wp}=re(),{ERR_INVALID_ARG_TYPE:qp,ERR_STREAM_PREMATURE_CLOSE:Ba}=Wp,{kEmptyObject:co,once:uo}=Z(),{validateAbortSignal:jp,validateFunction:$p,validateObject:zp,validateBoolean:Vp}=tr(),{Promise:Hp,PromisePrototypeThen:Kp,SymbolDispose:Va}=O(),{isClosed:Gp,isReadable:Da,isReadableNodeStream:lo,isReadableStream:Yp,isReadableFinished:Ma,isReadableErrored:Ua,isWritable:Wa,isWritableNodeStream:qa,isWritableStream:Xp,isWritableFinished:ja,isWritableErrored:$a,isNodeStream:Jp,willEmitClose:Qp,kIsClosedPromise:Zp}=Me(),ir;function ey(t){return t.setHeader&&typeof t.abort=="function"}s(ey,"isRequest");var fo=s(()=>{},"nop");function Ha(t,e,r){var i,n;if(arguments.length===2?(r=e,e=co):e==null?e=co:zp(e,"options"),$p(r,"callback"),jp(e.signal,"options.signal"),r=uo(r),Yp(t)||Xp(t))return ty(t,e,r);if(!Jp(t))throw new qp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(i=e.readable)!==null&&i!==void 0?i:lo(t),a=(n=e.writable)!==null&&n!==void 0?n:qa(t),l=t._writableState,u=t._readableState,f=s(()=>{t.writable||m()},"onlegacyfinish"),d=Qp(t)&&lo(t)===o&&qa(t)===a,h=ja(t,!1),m=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||y)&&r.call(t)},"onfinish"),y=Ma(t,!1),w=s(()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&r.call(t)},"onend"),b=s($=>{r.call(t,$)},"onerror"),g=Gp(t),S=s(()=>{g=!0;let $=$a(t)||Ua(t);if($&&typeof $!="boolean")return r.call(t,$);if(o&&!y&&lo(t,!0)&&!Ma(t,!1))return r.call(t,new Ba);if(a&&!h&&!ja(t,!1))return r.call(t,new Ba);r.call(t)},"onclose"),I=s(()=>{g=!0;let $=$a(t)||Ua(t);if($&&typeof $!="boolean")return r.call(t,$);r.call(t)},"onclosed"),D=s(()=>{t.req.on("finish",m)},"onrequest");ey(t)?(t.on("complete",m),d||t.on("abort",S),t.req?D():t.on("request",D)):a&&!l&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",b),t.on("close",S),g?ut.nextTick(S):l!=null&&l.errorEmitted||u!=null&&u.errorEmitted?d||ut.nextTick(I):(!o&&(!d||Da(t))&&(h||Wa(t)===!1)||!a&&(!d||Wa(t))&&(y||Da(t)===!1)||u&&t.req&&t.aborted)&&ut.nextTick(I);let k=s(()=>{r=fo,t.removeListener("aborted",S),t.removeListener("complete",m),t.removeListener("abort",S),t.removeListener("request",D),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",b),t.removeListener("close",S)},"cleanup");if(e.signal&&!g){let $=s(()=>{let dt=r;k(),dt.call(t,new za(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ut.nextTick($);else{ir=ir||Z().addAbortListener;let dt=ir(e.signal,$),fe=r;r=uo((...Lt)=>{dt[Va](),fe.apply(t,Lt)})}}return k}s(Ha,"eos");function ty(t,e,r){let i=!1,n=fo;if(e.signal)if(n=s(()=>{i=!0,r.call(t,new za(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ut.nextTick(n);else{ir=ir||Z().addAbortListener;let a=ir(e.signal,n),l=r;r=uo((...u)=>{a[Va](),l.apply(t,u)})}let o=s((...a)=>{i||ut.nextTick(()=>r.apply(t,a))},"resolverFn");return Kp(t[Zp].promise,o,o),fo}s(ty,"eosWeb");function ry(t,e){var r;let i=!1;return e===null&&(e=co),(r=e)!==null&&r!==void 0&&r.cleanup&&(Vp(e.cleanup,"cleanup"),i=e.cleanup),new Hp((n,o)=>{let a=Ha(t,e,l=>{i&&a(),l?o(l):n()})})}s(ry,"finished");ho.exports=Ha;ho.exports.finished=ry});var xt=N((L_,el)=>{"use strict";var Ue=ct(),{aggregateTwoErrors:iy,codes:{ERR_MULTIPLE_CALLBACK:ny},AbortError:oy}=re(),{Symbol:Ya}=O(),{kIsDestroyed:sy,isDestroyed:ay,isFinished:ly,isServerRequest:cy}=Me(),Xa=Ya("kDestroy"),po=Ya("kConstruct");function Ja(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}s(Ja,"checkError");function uy(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Ja(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?Ka(this,t,e):this.once(Xa,function(o){Ka(this,iy(o,t),e)}),this)}s(uy,"destroy");function Ka(t,e,r){let i=!1;function n(o){if(i)return;i=!0;let a=t._readableState,l=t._writableState;Ja(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof r=="function"&&r(o),o?Ue.nextTick(fy,t,o):Ue.nextTick(Qa,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(Ka,"_destroy");function fy(t,e){yo(t,e),Qa(t)}s(fy,"emitErrorCloseNT");function Qa(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(Qa,"emitCloseNT");function yo(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}s(yo,"emitErrorNT");function dy(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(dy,"undestroy");function mo(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?Ue.nextTick(yo,t,e):yo(t,e))}s(mo,"errorOrDestroy");function hy(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(po,e),!(t.listenerCount(po)>1)&&Ue.nextTick(py,t)}s(hy,"construct");function py(t){let e=!1;function r(i){if(e){mo(t,i??new ny);return}e=!0;let n=t._readableState,o=t._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Xa,i):i?mo(t,i,!0):Ue.nextTick(yy,t)}s(r,"onConstruct");try{t._construct(i=>{Ue.nextTick(r,i)})}catch(i){Ue.nextTick(r,i)}}s(py,"constructNT");function yy(t){t.emit(po)}s(yy,"emitConstructNT");function Ga(t){return t?.setHeader&&typeof t.abort=="function"}s(Ga,"isRequest");function Za(t){t.emit("close")}s(Za,"emitCloseLegacy");function my(t,e){t.emit("error",e),Ue.nextTick(Za,t)}s(my,"emitErrorCloseLegacy");function by(t,e){!t||ay(t)||(!e&&!ly(t)&&(e=new oy),cy(t)?(t.socket=null,t.destroy(e)):Ga(t)?t.abort():Ga(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ue.nextTick(my,t,e):Ue.nextTick(Za,t),t.destroyed||(t[sy]=!0))}s(by,"destroyer");el.exports={construct:hy,destroyer:by,destroy:uy,undestroy:dy,errorOrDestroy:mo}});var Ci=N((R_,rl)=>{"use strict";var{ArrayIsArray:gy,ObjectSetPrototypeOf:tl}=O(),{EventEmitter:Fi}=Ur();function Li(t){Fi.call(this,t)}s(Li,"Stream");tl(Li.prototype,Fi.prototype);tl(Li,Fi);Li.prototype.pipe=function(t,e){let r=this;function i(d){t.writable&&t.write(d)===!1&&r.pause&&r.pause()}s(i,"ondata"),r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}s(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",a),r.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function u(d){f(),Fi.listenerCount(this,"error")===0&&this.emit("error",d)}s(u,"onerror"),bo(r,"error",u),bo(t,"error",u);function f(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",l),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return s(f,"cleanup"),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};function bo(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):gy(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}s(bo,"prependListener");rl.exports={Stream:Li,prependListener:bo}});var Wr=N((B_,Ri)=>{"use strict";var{SymbolDispose:wy}=O(),{AbortError:il,codes:Sy}=re(),{isNodeStream:nl,isWebStream:_y,kControllerErrorFunction:Ey}=Me(),xy=Ye(),{ERR_INVALID_ARG_TYPE:ol}=Sy,go,vy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new ol(e,"AbortSignal",t)},"validateAbortSignal");Ri.exports.addAbortSignal=s(function(e,r){if(vy(e,"signal"),!nl(r)&&!_y(r))throw new ol("stream",["ReadableStream","WritableStream","Stream"],r);return Ri.exports.addAbortSignalNoValidate(e,r)},"addAbortSignal");Ri.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=nl(e)?()=>{e.destroy(new il(void 0,{cause:t.reason}))}:()=>{e[Ey](new il(void 0,{cause:t.reason}))};if(t.aborted)r();else{go=go||Z().addAbortListener;let i=go(t,r);xy(e,i[wy])}return e}});var ll=N((U_,al)=>{"use strict";var{StringPrototypeSlice:sl,SymbolIterator:Ay,TypedArrayPrototypeSet:Oi,Uint8Array:ky}=O(),{Buffer:wo}=He(),{inspect:Ny}=Z();al.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return wo.alloc(0);let r=wo.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)Oi(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Ay](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",i=this.head,n=0;do{let o=i.data;if(e>o.length)r+=o,e-=o.length;else{e===o.length?(r+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=sl(o,0,e),this.head=i,i.data=sl(o,e));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=wo.allocUnsafe(e),i=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)Oi(r,a,i-e),e-=a.length;else{e===a.length?(Oi(r,a,i-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Oi(r,new ky(a.buffer,a.byteOffset,e),i-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Ny(this,{...r,depth:0,customInspect:!1})}},"BufferList")});var qr=N((q_,dl)=>{"use strict";var{MathFloor:Ty,NumberIsInteger:Iy}=O(),{validateInteger:Py}=tr(),{ERR_INVALID_ARG_VALUE:Fy}=re().codes,cl=16*1024,ul=16;function Ly(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}s(Ly,"highWaterMarkFrom");function fl(t){return t?ul:cl}s(fl,"getDefaultHighWaterMark");function Cy(t,e){Py(e,"value",0),t?ul=e:cl=e}s(Cy,"setDefaultHighWaterMark");function Ry(t,e,r,i){let n=Ly(e,i,r);if(n!=null){if(!Iy(n)||n<0){let o=i?`options.${r}`:"options.highWaterMark";throw new Fy(o,n)}return Ty(n)}return fl(t.objectMode)}s(Ry,"getHighWaterMark");dl.exports={getHighWaterMark:Ry,getDefaultHighWaterMark:fl,setDefaultHighWaterMark:Cy}});var yl=N((So,pl)=>{var Bi=He(),We=Bi.Buffer;function hl(t,e){for(var r in t)e[r]=t[r]}s(hl,"copyProps");We.from&&We.alloc&&We.allocUnsafe&&We.allocUnsafeSlow?pl.exports=Bi:(hl(Bi,So),So.Buffer=vt);function vt(t,e,r){return We(t,e,r)}s(vt,"SafeBuffer");vt.prototype=Object.create(We.prototype);hl(We,vt);vt.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return We(t,e,r)};vt.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=We(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};vt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return We(t)};vt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Bi.SlowBuffer(t)}});var gl=N(bl=>{"use strict";var Eo=yl().Buffer,ml=Eo.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Oy(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Oy,"_normalizeEncoding");function By(t){var e=Oy(t);if(typeof e!="string"&&(Eo.isEncoding===ml||!ml(t)))throw new Error("Unknown encoding: "+t);return e||t}s(By,"normalizeEncoding");bl.StringDecoder=jr;function jr(t){this.encoding=By(t);var e;switch(this.encoding){case"utf16le":this.text=jy,this.end=$y,e=4;break;case"utf8":this.fillLast=Uy,e=4;break;case"base64":this.text=zy,this.end=Vy,e=3;break;default:this.write=Hy,this.end=Ky;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Eo.allocUnsafe(e)}s(jr,"StringDecoder");jr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};jr.prototype.end=qy;jr.prototype.text=Wy;jr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function _o(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(_o,"utf8CheckByte");function Dy(t,e,r){var i=e.length-1;if(i<r)return 0;var n=_o(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=_o(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=_o(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}s(Dy,"utf8CheckIncomplete");function My(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s(My,"utf8CheckExtraBytes");function Uy(t){var e=this.lastTotal-this.lastNeed,r=My(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Uy,"utf8FillLast");function Wy(t,e){var r=Dy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}s(Wy,"utf8Text");function qy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(qy,"utf8End");function jy(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(jy,"utf16Text");function $y(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}s($y,"utf16End");function zy(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}s(zy,"base64Text");function Vy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Vy,"base64End");function Hy(t){return t.toString(this.encoding)}s(Hy,"simpleWrite");function Ky(t){return t&&t.length?this.write(t):""}s(Ky,"simpleEnd")});var xo=N((H_,El)=>{"use strict";var wl=ct(),{PromisePrototypeThen:Gy,SymbolAsyncIterator:Sl,SymbolIterator:_l}=O(),{Buffer:Yy}=He(),{ERR_INVALID_ARG_TYPE:Xy,ERR_STREAM_NULL_VALUES:Jy}=re().codes;function Qy(t,e,r){let i;if(typeof e=="string"||e instanceof Yy)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let n;if(e&&e[Sl])n=!0,i=e[Sl]();else if(e&&e[_l])n=!1,i=e[_l]();else throw new Xy("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),a=!1;o._read=function(){a||(a=!0,u())},o._destroy=function(f,d){Gy(l(f),()=>wl.nextTick(d,f),h=>wl.nextTick(d,h||f))};async function l(f){let d=f!=null,h=typeof i.throw=="function";if(d&&h){let{value:m,done:y}=await i.throw(f);if(await m,y)return}if(typeof i.return=="function"){let{value:m}=await i.return();await m}}s(l,"close");async function u(){for(;;){try{let{value:f,done:d}=n?await i.next():i.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Jy;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(u,"next"),o}s(Qy,"from");El.exports=Qy});var zr=N((G_,Wl)=>{var ke=ct(),{ArrayPrototypeIndexOf:Zy,NumberIsInteger:em,NumberIsNaN:tm,NumberParseInt:rm,ObjectDefineProperties:Fo,ObjectKeys:im,ObjectSetPrototypeOf:Al,Promise:kl,SafeSet:nm,SymbolAsyncDispose:om,SymbolAsyncIterator:sm,Symbol:am}=O();Wl.exports=E;E.ReadableState=Wi;var{EventEmitter:lm}=Ur(),{Stream:ft,prependListener:cm}=Ci(),{Buffer:vo}=He(),{addAbortSignal:um}=Wr(),Nl=Ye(),v=Z().debuglog("stream",t=>{v=t}),fm=ll(),sr=xt(),{getHighWaterMark:dm,getDefaultHighWaterMark:hm}=qr(),{aggregateTwoErrors:xl,codes:{ERR_INVALID_ARG_TYPE:pm,ERR_METHOD_NOT_IMPLEMENTED:ym,ERR_OUT_OF_RANGE:mm,ERR_STREAM_PUSH_AFTER_EOF:bm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:gm},AbortError:wm}=re(),{validateObject:Sm}=tr(),At=am("kPaused"),{StringDecoder:Tl}=gl(),_m=xo();Al(E.prototype,ft.prototype);Al(E,ft);var Ao=s(()=>{},"nop"),{errorOrDestroy:nr}=sr,or=1<<0,Em=1<<1,Il=1<<2,$r=1<<3,Pl=1<<4,Di=1<<5,Mi=1<<6,Fl=1<<7,xm=1<<8,vm=1<<9,Am=1<<10,Io=1<<11,Po=1<<12,km=1<<13,Nm=1<<14,Tm=1<<15,Ll=1<<16,Im=1<<17,Pm=1<<18;function z(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(z,"makeBitMapDescriptor");Fo(Wi.prototype,{objectMode:z(or),ended:z(Em),endEmitted:z(Il),reading:z($r),constructed:z(Pl),sync:z(Di),needReadable:z(Mi),emittedReadable:z(Fl),readableListening:z(xm),resumeScheduled:z(vm),errorEmitted:z(Am),emitClose:z(Io),autoDestroy:z(Po),destroyed:z(km),closed:z(Nm),closeEmitted:z(Tm),multiAwaitDrain:z(Ll),readingMore:z(Im),dataEmitted:z(Pm)});function Wi(t,e,r){typeof r!="boolean"&&(r=e instanceof qe()),this.state=Io|Po|Pl|Di,t&&t.objectMode&&(this.state|=or),r&&t&&t.readableObjectMode&&(this.state|=or),this.highWaterMark=t?dm(this,t,"readableHighWaterMark",r):hm(!1),this.buffer=new fm,this.length=0,this.pipes=[],this.flowing=null,this[At]=null,t&&t.emitClose===!1&&(this.state&=~Io),t&&t.autoDestroy===!1&&(this.state&=~Po),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Tl(t.encoding),this.encoding=t.encoding)}s(Wi,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof qe();this._readableState=new Wi(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&um(t.signal,this)),ft.call(this,t),sr.construct(this,()=>{this._readableState.needReadable&&Ui(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=sr.destroy;E.prototype._undestroy=sr.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[lm.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[om]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new wm,this.destroy(t)),new kl((e,r)=>Nl(this,i=>i&&i!==t?r(i):e(null)))};E.prototype.push=function(t,e){return Cl(this,t,e,!1)};E.prototype.unshift=function(t,e){return Cl(this,t,e,!0)};function Cl(t,e,r,i){v("readableAddChunk",e);let n=t._readableState,o;if(n.state&or||(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=vo.from(e,r).toString(n.encoding):(e=vo.from(e,r),r=""))):e instanceof vo?r="":ft._isUint8Array(e)?(e=ft._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new pm("chunk",["string","Buffer","Uint8Array"],e))),o)nr(t,o);else if(e===null)n.state&=~$r,Cm(t,n);else if(n.state&or||e&&e.length>0)if(i)if(n.state&Il)nr(t,new gm);else{if(n.destroyed||n.errored)return!1;ko(t,n,e,!0)}else if(n.ended)nr(t,new bm);else{if(n.destroyed||n.errored)return!1;n.state&=~$r,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?ko(t,n,e,!1):Ui(t,n)):ko(t,n,e,!1)}else i||(n.state&=~$r,Ui(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Cl,"readableAddChunk");function ko(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Ll?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.state&Mi&&qi(t)),Ui(t,e)}s(ko,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[At]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new Tl(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var Fm=1073741824;function Lm(t){if(t>Fm)throw new mm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Lm,"computeNewHighWaterMark");function vl(t,e){return t<=0||e.length===0&&e.ended?0:e.state&or?1:tm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(vl,"howMuchToRead");E.prototype.read=function(t){v("read",t),t===void 0?t=NaN:em(t)||(t=rm(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=Lm(t)),t!==0&&(e.state&=~Fl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return v("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?No(this):qi(this),null;if(t=vl(t,e),t===0&&e.ended)return e.length===0&&No(this),null;let i=(e.state&Mi)!==0;if(v("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,v("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,v("reading, ended or constructing",i);else if(i){v("do read"),e.state|=$r|Di,e.length===0&&(e.state|=Mi);try{this._read(e.highWaterMark)}catch(o){nr(this,o)}e.state&=~Di,e.reading||(t=vl(r,e))}let n;return t>0?n=Ml(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&No(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Cm(t,e){if(v("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?qi(t):(e.needReadable=!1,e.emittedReadable=!0,Rl(t))}}s(Cm,"onEofChunk");function qi(t){let e=t._readableState;v("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(v("emitReadable",e.flowing),e.emittedReadable=!0,ke.nextTick(Rl,t))}s(qi,"emitReadable");function Rl(t){let e=t._readableState;v("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Bl(t)}s(Rl,"emitReadable_");function Ui(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ke.nextTick(Rm,t,e))}s(Ui,"maybeReadMore");function Rm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(v("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}s(Rm,"maybeReadMore_");E.prototype._read=function(t){throw new ym("_read()")};E.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new nm(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),v("pipe count=%d opts=%j",i.pipes.length,e);let o=(!e||e.end!==!1)&&t!==ke.stdout&&t!==ke.stderr?l:g;i.endEmitted?ke.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(S,I){v("onunpipe"),S===r&&I&&I.hasUnpiped===!1&&(I.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){v("onend"),t.end()}s(l,"onend");let u,f=!1;function d(){v("cleanup"),t.removeListener("close",w),t.removeListener("finish",b),u&&t.removeListener("drain",u),t.removeListener("error",y),t.removeListener("unpipe",a),r.removeListener("end",l),r.removeListener("end",g),r.removeListener("data",m),f=!0,u&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&u()}s(d,"cleanup");function h(){f||(i.pipes.length===1&&i.pipes[0]===t?(v("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(v("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),u||(u=Om(r,t),t.on("drain",u))}s(h,"pause"),r.on("data",m);function m(S){v("ondata");let I=t.write(S);v("dest.write",I),I===!1&&h()}s(m,"ondata");function y(S){if(v("onerror",S),g(),t.removeListener("error",y),t.listenerCount("error")===0){let I=t._writableState||t._readableState;I&&!I.errorEmitted?nr(t,S):t.emit("error",S)}}s(y,"onerror"),cm(t,"error",y);function w(){t.removeListener("finish",b),g()}s(w,"onclose"),t.once("close",w);function b(){v("onfinish"),t.removeListener("close",w),g()}s(b,"onfinish"),t.once("finish",b);function g(){v("unpipe"),r.unpipe(t)}return s(g,"unpipe"),t.emit("pipe",r),t.writableNeedDrain===!0?h():i.flowing||(v("pipe resume"),r.resume()),t};function Om(t,e){return s(function(){let i=t._readableState;i.awaitDrainWriters===e?(v("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(v("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Om,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=Zy(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};E.prototype.on=function(t,e){let r=ft.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,v("on readable",i.length,i.reading),i.length?qi(this):i.reading||ke.nextTick(Bm,this)),r};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let r=ft.prototype.removeListener.call(this,t,e);return t==="readable"&&ke.nextTick(Ol,this),r};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=ft.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ke.nextTick(Ol,this),e};function Ol(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[At]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Ol,"updateReadableListening");function Bm(t){v("readable nexttick read 0"),t.read(0)}s(Bm,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(v("resume"),t.flowing=!t.readableListening,Dm(this,t)),t[At]=!1,this};function Dm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ke.nextTick(Mm,t,e))}s(Dm,"resume");function Mm(t,e){v("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Bl(t),e.flowing&&!e.reading&&t.read(0)}s(Mm,"resume_");E.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[At]=!0,this};function Bl(t){let e=t._readableState;for(v("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Bl,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{nr(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=im(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};E.prototype[sm]=function(){return Dl(this)};E.prototype.iterator=function(t){return t!==void 0&&Sm(t,"options"),Dl(this,t)};function Dl(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let r=Um(t,e);return r.stream=t,r}s(Dl,"streamToAsyncIterator");async function*Um(t,e){let r=Ao;function i(a){this===t?(r(),r=Ao):r=a}s(i,"next"),t.on("readable",i);let n,o=Nl(t,{writable:!1},a=>{n=a?xl(n,a):null,r(),r=Ao});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new kl(i)}}}catch(a){throw n=xl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?sr.destroyer(t,null):(t.off("readable",i),o())}}s(Um,"createAsyncIterator");Fo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Fo(Wi.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[At]!==!1},set(t){this[At]=!!t}}});E._fromList=Ml;function Ml(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}s(Ml,"fromList");function No(t){let e=t._readableState;v("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ke.nextTick(Wm,e,t))}s(No,"endReadable");function Wm(t,e){if(v("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ke.nextTick(qm,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}s(Wm,"endReadableNT");function qm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(qm,"endWritableNT");E.from=function(t,e){return _m(E,t,e)};var To;function Ul(){return To===void 0&&(To={}),To}s(Ul,"lazyWebStreams");E.fromWeb=function(t,e){return Ul().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return Ul().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var r,i;return new E({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(n,o){sr.destroyer(t,n),o(n)}}).wrap(t)}});var Hi=N((X_,Ql)=>{var kt=ct(),{ArrayPrototypeSlice:$l,Error:jm,FunctionPrototypeSymbolHasInstance:zl,ObjectDefineProperty:Vl,ObjectDefineProperties:$m,ObjectSetPrototypeOf:Hl,StringPrototypeToLowerCase:zm,Symbol:Vm,SymbolHasInstance:Hm}=O();Ql.exports=B;B.WritableState=Kr;var{EventEmitter:Km}=Ur(),Vr=Ci().Stream,{Buffer:ji}=He(),Vi=xt(),{addAbortSignal:Gm}=Wr(),{getHighWaterMark:Ym,getDefaultHighWaterMark:Xm}=qr(),{ERR_INVALID_ARG_TYPE:Jm,ERR_METHOD_NOT_IMPLEMENTED:Qm,ERR_MULTIPLE_CALLBACK:Kl,ERR_STREAM_CANNOT_PIPE:Zm,ERR_STREAM_DESTROYED:Hr,ERR_STREAM_ALREADY_FINISHED:eb,ERR_STREAM_NULL_VALUES:tb,ERR_STREAM_WRITE_AFTER_END:rb,ERR_UNKNOWN_ENCODING:Gl}=re().codes,{errorOrDestroy:ar}=Vi;Hl(B.prototype,Vr.prototype);Hl(B,Vr);function Ro(){}s(Ro,"nop");var lr=Vm("kOnFinished");function Kr(t,e,r){typeof r!="boolean"&&(r=e instanceof qe()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Ym(this,t,"writableHighWaterMark",r):Xm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=nb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,zi(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[lr]=[]}s(Kr,"WritableState");function zi(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(zi,"resetBuffer");Kr.prototype.getBuffer=s(function(){return $l(this.buffered,this.bufferedIndex)},"getBuffer");Vl(Kr.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function B(t){let e=this instanceof qe();if(!e&&!zl(B,this))return new B(t);this._writableState=new Kr(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Gm(t.signal,this)),Vr.call(this,t),Vi.construct(this,()=>{let r=this._writableState;r.writing||Bo(this,r),Do(this,r)})}s(B,"Writable");Vl(B,Hm,{__proto__:null,value:function(t){return zl(this,t)?!0:this!==B?!1:t&&t._writableState instanceof Kr}});B.prototype.pipe=function(){ar(this,new Zm)};function Yl(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!ji.isEncoding(r))throw new Gl(r);typeof i!="function"&&(i=Ro)}if(e===null)throw new tb;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=ji.from(e,r),r="buffer");else if(e instanceof ji)r="buffer";else if(Vr._isUint8Array(e))e=Vr._uint8ArrayToBuffer(e),r="buffer";else throw new Jm("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new rb:n.destroyed&&(o=new Hr("write")),o?(kt.nextTick(i,o),ar(t,o,!0),o):(n.pendingcb++,ib(t,n,e,r,i))}s(Yl,"_write");B.prototype.write=function(t,e,r){return Yl(this,t,e,r)===!0};B.prototype.cork=function(){this._writableState.corked++};B.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Bo(this,t))};B.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=zm(e)),!ji.isEncoding(e))throw new Gl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function ib(t,e,r,i,n){let o=e.objectMode?1:r.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Ro&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(ib,"writeOrBuffer");function ql(t,e,r,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Hr("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s(ql,"doWrite");function jl(t,e,r,i){--e.pendingcb,i(r),Oo(e),ar(t,r)}s(jl,"onwriteError");function nb(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){ar(t,new Kl);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?kt.nextTick(jl,t,r,e,n):jl(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&Bo(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},kt.nextTick(ob,r.afterWriteTickInfo)):Xl(t,r,1,n))}s(nb,"onwrite");function ob({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,Xl(t,e,r,i)}s(ob,"afterWriteTick");function Xl(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&Oo(e),Do(t,e)}s(Xl,"afterWrite");function Oo(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:a}=t.buffered[n],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Hr("write"))}let r=t[lr].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new Hr("end"))}zi(t)}s(Oo,"errorBuffer");function Bo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,o=r.length-i;if(!o)return;let a=i;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Ro:f=>{for(let d=a;d<r.length;++d)r[d].callback(f)},u=e.allNoop&&a===0?r:$l(r,a);u.allBuffers=e.allBuffers,ql(t,e,!0,e.length,u,"",l),zi(e)}else{do{let{chunk:l,encoding:u,callback:f}=r[a];r[a++]=null;let d=n?1:l.length;ql(t,e,!1,d,l,u,f)}while(a<r.length&&!e.writing);a===r.length?zi(e):a>256?(r.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Bo,"clearBuffer");B.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Qm("_write()")};B.prototype._writev=null;B.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let o=Yl(this,t,e);o instanceof jm&&(n=o)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,Do(this,i,!0),i.ended=!0):i.finished?n=new eb("end"):i.destroyed&&(n=new Hr("end"))),typeof r=="function"&&(n||i.finished?kt.nextTick(r,n):i[lr].push(r)),this};function $i(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s($i,"needFinish");function sb(t,e){let r=!1;function i(n){if(r){ar(t,n??Kl());return}if(r=!0,e.pendingcb--,n){let o=e[lr].splice(0);for(let a=0;a<o.length;a++)o[a](n);ar(t,n,e.sync)}else $i(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,kt.nextTick(Co,t,e))}s(i,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(i)}catch(n){i(n)}e.sync=!1}s(sb,"callFinal");function ab(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,sb(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(ab,"prefinish");function Do(t,e,r){$i(e)&&(ab(t,e),e.pendingcb===0&&(r?(e.pendingcb++,kt.nextTick((i,n)=>{$i(n)?Co(i,n):n.pendingcb--},t,e)):$i(e)&&(e.pendingcb++,Co(t,e))))}s(Do,"finishMaybe");function Co(t,e){e.pendingcb--,e.finished=!0;let r=e[lr].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}s(Co,"finish");$m(B.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var lb=Vi.destroy;B.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[lr].length)&&kt.nextTick(Oo,r),lb.call(this,t,e),this};B.prototype._undestroy=Vi.undestroy;B.prototype._destroy=function(t,e){e(t)};B.prototype[Km.captureRejectionSymbol]=function(t){this.destroy(t)};var Lo;function Jl(){return Lo===void 0&&(Lo={}),Lo}s(Jl,"lazyWebStreams");B.fromWeb=function(t,e){return Jl().newStreamWritableFromWritableStream(t,e)};B.toWeb=function(t){return Jl().newWritableStreamFromStreamWritable(t)}});var hc=N((Q_,dc)=>{var Mo=ct(),cb=He(),{isReadable:ub,isWritable:fb,isIterable:Zl,isNodeStream:db,isReadableNodeStream:ec,isWritableNodeStream:tc,isDuplexNodeStream:hb,isReadableStream:rc,isWritableStream:ic}=Me(),nc=Ye(),{AbortError:uc,codes:{ERR_INVALID_ARG_TYPE:pb,ERR_INVALID_RETURN_VALUE:oc}}=re(),{destroyer:ur}=xt(),yb=qe(),fc=zr(),mb=Hi(),{createDeferredPromise:sc}=Z(),ac=xo(),lc=globalThis.Blob||cb.Blob,bb=s(typeof lc<"u"?function(e){return e instanceof lc}:function(e){return!1},"isBlob"),gb=globalThis.AbortController||Qt().AbortController,{FunctionPrototypeCall:cc}=O(),Xe=class extends yb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(Xe,"Duplexify");dc.exports=s(function t(e,r){if(hb(e))return e;if(ec(e))return cr({readable:e});if(tc(e))return cr({writable:e});if(db(e))return cr({writable:!1,readable:!1});if(rc(e))return cr({readable:fc.fromWeb(e)});if(ic(e))return cr({writable:mb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:l}=wb(e);if(Zl(n))return ac(Xe,n,{objectMode:!0,write:o,final:a,destroy:l});let u=n?.then;if(typeof u=="function"){let f,d=cc(u,n,h=>{if(h!=null)throw new oc("nully","body",h)},h=>{ur(f,h)});return f=new Xe({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,Mo.nextTick(h,null)}catch(m){Mo.nextTick(h,m)}})},destroy:l})}throw new oc("Iterable, AsyncIterable or AsyncFunction",r,n)}if(bb(e))return t(e.arrayBuffer());if(Zl(e))return ac(Xe,e,{objectMode:!0,writable:!1});if(rc(e?.readable)&&ic(e?.writable))return Xe.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?ec(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?tc(e?.writable)?e?.writable:t(e.writable):void 0;return cr({readable:n,writable:o})}let i=e?.then;if(typeof i=="function"){let n;return cc(i,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{ur(n,o)}),n=new Xe({objectMode:!0,writable:!1,read(){}})}throw new pb(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function wb(t){let{promise:e,resolve:r}=sc(),i=new gb,n=i.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:u,cb:f}=await a;if(Mo.nextTick(f),u)return;if(n.aborted)throw new uc(void 0,{cause:n.reason});({promise:e,resolve:r}=sc()),yield l}}(),{signal:n}),write(a,l,u){let f=r;r=null,f({chunk:a,done:!1,cb:u})},final(a){let l=r;r=null,l({done:!0,cb:a})},destroy(a,l){i.abort(),l(a)}}}s(wb,"fromAsyncGen");function cr(t){let e=t.readable&&typeof t.readable.read!="function"?fc.wrap(t.readable):t.readable,r=t.writable,i=!!ub(e),n=!!fb(r),o,a,l,u,f;function d(h){let m=u;u=null,m?m(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Xe({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(nc(r,h=>{n=!1,h&&ur(e,h),d(h)}),f._write=function(h,m,y){r.write(h,m)?y():o=y},f._final=function(h){r.end(),a=h},r.on("drain",function(){if(o){let h=o;o=null,h()}}),r.on("finish",function(){if(a){let h=a;a=null,h()}})),i&&(nc(e,h=>{i=!1,h&&ur(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){l=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,m){!h&&u!==null&&(h=new uc),l=null,o=null,a=null,u===null?m(h):(u=m,ur(r,h),ur(e,h))},f}s(cr,"_duplexify")});var qe=N((e0,mc)=>{"use strict";var{ObjectDefineProperties:Sb,ObjectGetOwnPropertyDescriptor:Je,ObjectKeys:_b,ObjectSetPrototypeOf:pc}=O();mc.exports=Ne;var qo=zr(),we=Hi();pc(Ne.prototype,qo.prototype);pc(Ne,qo);{let t=_b(we.prototype);for(let e=0;e<t.length;e++){let r=t[e];Ne.prototype[r]||(Ne.prototype[r]=we.prototype[r])}}function Ne(t){if(!(this instanceof Ne))return new Ne(t);qo.call(this,t),we.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Ne,"Duplex");Sb(Ne.prototype,{writable:{__proto__:null,...Je(we.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Je(we.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Je(we.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Je(we.prototype,"writableBuffer")},writableLength:{__proto__:null,...Je(we.prototype,"writableLength")},writableFinished:{__proto__:null,...Je(we.prototype,"writableFinished")},writableCorked:{__proto__:null,...Je(we.prototype,"writableCorked")},writableEnded:{__proto__:null,...Je(we.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Je(we.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Uo;function yc(){return Uo===void 0&&(Uo={}),Uo}s(yc,"lazyWebStreams");Ne.fromWeb=function(t,e){return yc().newStreamDuplexFromReadableWritablePair(t,e)};Ne.toWeb=function(t){return yc().newReadableWritablePairFromDuplex(t)};var Wo;Ne.from=function(t){return Wo||(Wo=hc()),Wo(t,"body")}});var zo=N((r0,gc)=>{"use strict";var{ObjectSetPrototypeOf:bc,Symbol:Eb}=O();gc.exports=Qe;var{ERR_METHOD_NOT_IMPLEMENTED:xb}=re().codes,$o=qe(),{getHighWaterMark:vb}=qr();bc(Qe.prototype,$o.prototype);bc(Qe,$o);var Gr=Eb("kCallback");function Qe(t){if(!(this instanceof Qe))return new Qe(t);let e=t?vb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),$o.call(this,t),this._readableState.sync=!1,this[Gr]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Ab)}s(Qe,"Transform");function jo(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}s(jo,"final");function Ab(){this._final!==jo&&jo.call(this)}s(Ab,"prefinish");Qe.prototype._final=jo;Qe.prototype._transform=function(t,e,r){throw new xb("_transform()")};Qe.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,o=i.length;this._transform(t,e,(a,l)=>{if(a){r(a);return}l!=null&&this.push(l),n.ended||o===i.length||i.length<i.highWaterMark?r():this[Gr]=r})};Qe.prototype._read=function(){if(this[Gr]){let t=this[Gr];this[Gr]=null,t()}}});var Ho=N((n0,Sc)=>{"use strict";var{ObjectSetPrototypeOf:wc}=O();Sc.exports=fr;var Vo=zo();wc(fr.prototype,Vo.prototype);wc(fr,Vo);function fr(t){if(!(this instanceof fr))return new fr(t);Vo.call(this,t)}s(fr,"PassThrough");fr.prototype._transform=function(t,e,r){r(null,t)}});var Xi=N((s0,Ac)=>{var Yr=ct(),{ArrayIsArray:kb,Promise:Nb,SymbolAsyncIterator:Tb,SymbolDispose:Ib}=O(),Yi=Ye(),{once:Pb}=Z(),Fb=xt(),_c=qe(),{aggregateTwoErrors:Lb,codes:{ERR_INVALID_ARG_TYPE:ts,ERR_INVALID_RETURN_VALUE:Ko,ERR_MISSING_ARGS:Cb,ERR_STREAM_DESTROYED:Rb,ERR_STREAM_PREMATURE_CLOSE:Ob},AbortError:Bb}=re(),{validateFunction:Db,validateAbortSignal:Mb}=tr(),{isIterable:Nt,isReadable:Go,isReadableNodeStream:Gi,isNodeStream:Ec,isTransformStream:dr,isWebStream:Ub,isReadableStream:Yo,isReadableFinished:Wb}=Me(),qb=globalThis.AbortController||Qt().AbortController,Xo,Jo,Qo;function xc(t,e,r){let i=!1;t.on("close",()=>{i=!0});let n=Yi(t,{readable:e,writable:r},o=>{i=!o});return{destroy:o=>{i||(i=!0,Fb.destroyer(t,o||new Rb("pipe")))},cleanup:n}}s(xc,"destroyer");function jb(t){return Db(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(jb,"popCallback");function Zo(t){if(Nt(t))return t;if(Gi(t))return $b(t);throw new ts("val",["Readable","Iterable","AsyncIterable"],t)}s(Zo,"makeAsyncIterable");async function*$b(t){Jo||(Jo=zr()),yield*Jo.prototype[Tb].call(t)}s($b,"fromReadable");async function Ki(t,e,r,{end:i}){let n,o=null,a=s(f=>{if(f&&(n=f),o){let d=o;o=null,d()}},"resume"),l=s(()=>new Nb((f,d)=>{n?d(n):o=s(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let u=Yi(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let f of t)e.write(f)||await l();i&&(e.end(),await l()),r()}catch(f){r(n!==f?Lb(n,f):f)}finally{u(),e.off("drain",a)}}s(Ki,"pumpToNode");async function es(t,e,r,{end:i}){dr(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),r()}catch(o){try{await n.abort(o),r(o)}catch(a){r(a)}}}s(es,"pumpToWeb");function zb(...t){return vc(t,Pb(jb(t)))}s(zb,"pipeline");function vc(t,e,r){if(t.length===1&&kb(t[0])&&(t=t[0]),t.length<2)throw new Cb("streams");let i=new qb,n=i.signal,o=r?.signal,a=[];Mb(o,"options.signal");function l(){w(new Bb)}s(l,"abort"),Qo=Qo||Z().addAbortListener;let u;o&&(u=Qo(o,l));let f,d,h=[],m=0;function y(D){w(D,--m===0)}s(y,"finish");function w(D,k){var $;if(D&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=D),!(!f&&!k)){for(;h.length;)h.shift()(f);($=u)===null||$===void 0||$[Ib](),i.abort(),k&&(f||a.forEach(dt=>dt()),Yr.nextTick(e,f,d))}}s(w,"finishImpl");let b;for(let D=0;D<t.length;D++){let k=t[D],$=D<t.length-1,dt=D>0,fe=$||r?.end!==!1,Lt=D===t.length-1;if(Ec(k)){let ie=function($e){$e&&$e.name!=="AbortError"&&$e.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y($e)};var I=ie;if(s(ie,"onError"),fe){let{destroy:$e,cleanup:ln}=xc(k,$,dt);h.push($e),Go(k)&&Lt&&a.push(ln)}k.on("error",ie),Go(k)&&Lt&&a.push(()=>{k.removeListener("error",ie)})}if(D===0)if(typeof k=="function"){if(b=k({signal:n}),!Nt(b))throw new Ko("Iterable, AsyncIterable or Stream","source",b)}else Nt(k)||Gi(k)||dr(k)?b=k:b=_c.from(k);else if(typeof k=="function"){if(dr(b)){var g;b=Zo((g=b)===null||g===void 0?void 0:g.readable)}else b=Zo(b);if(b=k(b,{signal:n}),$){if(!Nt(b,!0))throw new Ko("AsyncIterable",`transform[${D-1}]`,b)}else{var S;Xo||(Xo=Ho());let ie=new Xo({objectMode:!0}),$e=(S=b)===null||S===void 0?void 0:S.then;if(typeof $e=="function")m++,$e.call(b,tt=>{d=tt,tt!=null&&ie.write(tt),fe&&ie.end(),Yr.nextTick(y)},tt=>{ie.destroy(tt),Yr.nextTick(y,tt)});else if(Nt(b,!0))m++,Ki(b,ie,y,{end:fe});else if(Yo(b)||dr(b)){let tt=b.readable||b;m++,Ki(tt,ie,y,{end:fe})}else throw new Ko("AsyncIterable or Promise","destination",b);b=ie;let{destroy:ln,cleanup:eu}=xc(b,!1,!0);h.push(ln),Lt&&a.push(eu)}}else if(Ec(k)){if(Gi(b)){m+=2;let ie=Vb(b,k,y,{end:fe});Go(k)&&Lt&&a.push(ie)}else if(dr(b)||Yo(b)){let ie=b.readable||b;m++,Ki(ie,k,y,{end:fe})}else if(Nt(b))m++,Ki(b,k,y,{end:fe});else throw new ts("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=k}else if(Ub(k)){if(Gi(b))m++,es(Zo(b),k,y,{end:fe});else if(Yo(b)||Nt(b))m++,es(b,k,y,{end:fe});else if(dr(b))m++,es(b.readable,k,y,{end:fe});else throw new ts("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=k}else b=_c.from(k)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Yr.nextTick(l),b}s(vc,"pipelineImpl");function Vb(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new Ob)}),t.pipe(e,{end:!1}),i){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Wb(t)?Yr.nextTick(a):t.once("end",a)}else r();return Yi(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",r).once("error",r):r(a)}),Yi(e,{readable:!1,writable:!0},r)}s(Vb,"pipe");Ac.exports={pipelineImpl:vc,pipeline:zb}});var is=N((l0,Fc)=>{"use strict";var{pipeline:Hb}=Xi(),Ji=qe(),{destroyer:Kb}=xt(),{isNodeStream:Qi,isReadable:kc,isWritable:Nc,isWebStream:rs,isTransformStream:Tt,isWritableStream:Tc,isReadableStream:Ic}=Me(),{AbortError:Gb,codes:{ERR_INVALID_ARG_VALUE:Pc,ERR_MISSING_ARGS:Yb}}=re(),Xb=Ye();Fc.exports=s(function(...e){if(e.length===0)throw new Yb("streams");if(e.length===1)return Ji.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Ji.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=Ji.from(e[y])}for(let y=0;y<e.length;++y)if(!(!Qi(e[y])&&!rs(e[y]))){if(y<e.length-1&&!(kc(e[y])||Ic(e[y])||Tt(e[y])))throw new Pc(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(Nc(e[y])||Tc(e[y])||Tt(e[y])))throw new Pc(`streams[${y}]`,r[y],"must be writable")}let i,n,o,a,l;function u(y){let w=a;a=null,w?w(y):y?l.destroy(y):!m&&!h&&l.destroy()}s(u,"onfinished");let f=e[0],d=Hb(e,u),h=!!(Nc(f)||Tc(f)||Tt(f)),m=!!(kc(d)||Ic(d)||Tt(d));if(l=new Ji({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(Qi(f))l._write=function(w,b,g){f.write(w,b)?g():i=g},l._final=function(w){f.end(),n=w},f.on("drain",function(){if(i){let w=i;i=null,w()}});else if(rs(f)){let b=(Tt(f)?f.writable:f).getWriter();l._write=async function(g,S,I){try{await b.ready,b.write(g).catch(()=>{}),I()}catch(D){I(D)}},l._final=async function(g){try{await b.ready,b.close().catch(()=>{}),n=g}catch(S){g(S)}}}let y=Tt(d)?d.readable:d;Xb(y,()=>{if(n){let w=n;n=null,w()}})}if(m){if(Qi(d))d.on("readable",function(){if(o){let y=o;o=null,y()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let y=d.read();if(y===null){o=l._read;return}if(!l.push(y))return}};else if(rs(d)){let w=(Tt(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:b,done:g}=await w.read();if(!l.push(b))return;if(g){l.push(null);return}}catch{return}}}}return l._destroy=function(y,w){!y&&a!==null&&(y=new Gb),o=null,i=null,n=null,a===null?w(y):(a=w,Qi(d)&&Kb(d,y))},l},"compose")});var qc=N((u0,os)=>{"use strict";var Jb=globalThis.AbortController||Qt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Qb,ERR_INVALID_ARG_TYPE:Xr,ERR_MISSING_ARGS:Zb,ERR_OUT_OF_RANGE:eg},AbortError:je}=re(),{validateAbortSignal:It,validateInteger:Lc,validateObject:Pt}=tr(),tg=O().Symbol("kWeak"),rg=O().Symbol("kResistStopPropagation"),{finished:ig}=Ye(),ng=is(),{addAbortSignalNoValidate:og}=Wr(),{isWritable:sg,isNodeStream:ag}=Me(),{deprecate:lg}=Z(),{ArrayPrototypePush:cg,Boolean:ug,MathFloor:Cc,Number:fg,NumberIsNaN:dg,Promise:Rc,PromiseReject:Oc,PromiseResolve:hg,PromisePrototypeThen:Bc,Symbol:Mc}=O(),en=Mc("kEmpty"),Dc=Mc("kEof");function pg(t,e){if(e!=null&&Pt(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),ag(t)&&!sg(t))throw new Qb("stream",t,"must be writable");let r=ng(this,t);return e!=null&&e.signal&&og(e.signal,r),r}s(pg,"compose");function tn(t,e){if(typeof t!="function")throw new Xr("fn",["Function","AsyncFunction"],t);e!=null&&Pt(e,"options"),e?.signal!=null&&It(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=Cc(e.concurrency));let i=r-1;return e?.highWaterMark!=null&&(i=Cc(e.highWaterMark)),Lc(r,"options.concurrency",1),Lc(i,"options.highWaterMark",0),i+=r,s(async function*(){let o=Z().AbortSignalAny([e?.signal].filter(ug)),a=this,l=[],u={signal:o},f,d,h=!1,m=0;function y(){h=!0,w()}s(y,"onCatch");function w(){m-=1,b()}s(w,"afterItemProcessed");function b(){d&&!h&&m<r&&l.length<i&&(d(),d=null)}s(b,"maybeResume");async function g(){try{for await(let S of a){if(h)return;if(o.aborted)throw new je;try{if(S=t(S,u),S===en)continue;S=hg(S)}catch(I){S=Oc(I)}m+=1,Bc(S,w,y),l.push(S),f&&(f(),f=null),!h&&(l.length>=i||m>=r)&&await new Rc(I=>{d=I})}l.push(Dc)}catch(S){let I=Oc(S);Bc(I,w,y),l.push(I)}finally{h=!0,f&&(f(),f=null)}}s(g,"pump"),g();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===Dc)return;if(o.aborted)throw new je;S!==en&&(yield S),l.shift(),b()}await new Rc(S=>{f=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(tn,"map");function yg(t=void 0){return t!=null&&Pt(t,"options"),t?.signal!=null&&It(t.signal,"options.signal"),s(async function*(){let r=0;for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new je({cause:t.signal.reason});yield[r++,n]}},"asIndexedPairs").call(this)}s(yg,"asIndexedPairs");async function Uc(t,e=void 0){for await(let r of ns.call(this,t,e))return!0;return!1}s(Uc,"some");async function mg(t,e=void 0){if(typeof t!="function")throw new Xr("fn",["Function","AsyncFunction"],t);return!await Uc.call(this,async(...r)=>!await t(...r),e)}s(mg,"every");async function bg(t,e){for await(let r of ns.call(this,t,e))return r}s(bg,"find");async function gg(t,e){if(typeof t!="function")throw new Xr("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n),en}s(r,"forEachFn");for await(let i of tn.call(this,r,e));}s(gg,"forEach");function ns(t,e){if(typeof t!="function")throw new Xr("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:en}return s(r,"filterFn"),tn.call(this,r,e)}s(ns,"filter");var Zi=class extends Zb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(Zi,"ReduceAwareErrMissingArgs");async function wg(t,e,r){var i;if(typeof t!="function")throw new Xr("reducer",["Function","AsyncFunction"],t);r!=null&&Pt(r,"options"),r?.signal!=null&&It(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let f=new je(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await ig(this.destroy(f)),f}let o=new Jb,a=o.signal;if(r!=null&&r.signal){let f={once:!0,[tg]:this,[rg]:!0};r.signal.addEventListener("abort",()=>o.abort(),f)}let l=!1;try{for await(let f of this){var u;if(l=!0,r!=null&&(u=r.signal)!==null&&u!==void 0&&u.aborted)throw new je;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!l&&!n)throw new Zi}finally{o.abort()}return e}s(wg,"reduce");async function Sg(t){t!=null&&Pt(t,"options"),t?.signal!=null&&It(t.signal,"options.signal");let e=[];for await(let i of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new je(void 0,{cause:t.signal.reason});cg(e,i)}return e}s(Sg,"toArray");function _g(t,e){let r=tn.call(this,t,e);return s(async function*(){for await(let n of r)yield*n},"flatMap").call(this)}s(_g,"flatMap");function Wc(t){if(t=fg(t),dg(t))return 0;if(t<0)throw new eg("number",">= 0",t);return t}s(Wc,"toIntegerOrInfinity");function Eg(t,e=void 0){return e!=null&&Pt(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),t=Wc(t),s(async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;t--<=0&&(yield o)}},"drop").call(this)}s(Eg,"drop");function xg(t,e=void 0){return e!=null&&Pt(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),t=Wc(t),s(async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(xg,"take");os.exports.streamReturningOperators={asIndexedPairs:lg(yg,"readable.asIndexedPairs will be removed in a future version."),drop:Eg,filter:ns,flatMap:_g,map:tn,take:xg,compose:pg};os.exports.promiseReturningOperators={every:mg,forEach:gg,reduce:wg,toArray:Sg,some:Uc,find:bg}});var ss=N((d0,jc)=>{"use strict";var{ArrayPrototypePop:vg,Promise:Ag}=O(),{isIterable:kg,isNodeStream:Ng,isWebStream:Tg}=Me(),{pipelineImpl:Ig}=Xi(),{finished:Pg}=Ye();as();function Fg(...t){return new Ag((e,r)=>{let i,n,o=t[t.length-1];if(o&&typeof o=="object"&&!Ng(o)&&!kg(o)&&!Tg(o)){let a=vg(t);i=a.signal,n=a.end}Ig(t,(a,l)=>{a?r(a):e(l)},{signal:i,end:n})})}s(Fg,"pipeline");jc.exports={finished:Pg,pipeline:Fg}});var as=N((p0,Jc)=>{var{Buffer:Lg}=He(),{ObjectDefineProperty:Ze,ObjectKeys:Vc,ReflectApply:Hc}=O(),{promisify:{custom:Kc}}=Z(),{streamReturningOperators:$c,promiseReturningOperators:zc}=qc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Gc}}=re(),Cg=is(),{setDefaultHighWaterMark:Rg,getDefaultHighWaterMark:Og}=qr(),{pipeline:Yc}=Xi(),{destroyer:Bg}=xt(),Xc=Ye(),ls=ss(),Jr=Me(),L=Jc.exports=Ci().Stream;L.isDestroyed=Jr.isDestroyed;L.isDisturbed=Jr.isDisturbed;L.isErrored=Jr.isErrored;L.isReadable=Jr.isReadable;L.isWritable=Jr.isWritable;L.Readable=zr();for(let t of Vc($c)){let r=function(...i){if(new.target)throw Gc();return L.Readable.from(Hc(e,this,i))};Mg=r,s(r,"fn");let e=$c[t];Ze(r,"name",{__proto__:null,value:e.name}),Ze(r,"length",{__proto__:null,value:e.length}),Ze(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Mg;for(let t of Vc(zc)){let r=function(...n){if(new.target)throw Gc();return Hc(e,this,n)};Mg=r,s(r,"fn");let e=zc[t];Ze(r,"name",{__proto__:null,value:e.name}),Ze(r,"length",{__proto__:null,value:e.length}),Ze(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Mg;L.Writable=Hi();L.Duplex=qe();L.Transform=zo();L.PassThrough=Ho();L.pipeline=Yc;var{addAbortSignal:Dg}=Wr();L.addAbortSignal=Dg;L.finished=Xc;L.destroy=Bg;L.compose=Cg;L.setDefaultHighWaterMark=Rg;L.getDefaultHighWaterMark=Og;Ze(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return ls}});Ze(Yc,Kc,{__proto__:null,enumerable:!0,get(){return ls.pipeline}});Ze(Xc,Kc,{__proto__:null,enumerable:!0,get(){return ls.finished}});L.Stream=L;L._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");L._uint8ArrayToBuffer=s(function(e){return Lg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Qc=N((m0,j)=>{"use strict";var V=as(),Ug=ss(),Wg=V.Readable.destroy;j.exports=V.Readable;j.exports._uint8ArrayToBuffer=V._uint8ArrayToBuffer;j.exports._isUint8Array=V._isUint8Array;j.exports.isDisturbed=V.isDisturbed;j.exports.isErrored=V.isErrored;j.exports.isReadable=V.isReadable;j.exports.Readable=V.Readable;j.exports.Writable=V.Writable;j.exports.Duplex=V.Duplex;j.exports.Transform=V.Transform;j.exports.PassThrough=V.PassThrough;j.exports.addAbortSignal=V.addAbortSignal;j.exports.finished=V.finished;j.exports.destroy=V.destroy;j.exports.destroy=Wg;j.exports.pipeline=V.pipeline;j.exports.compose=V.compose;Object.defineProperty(V,"promises",{configurable:!0,enumerable:!0,get(){return Ug}});j.exports.Stream=V.Stream;j.exports.default=j.exports});var $g={};ei($g,{ActionType:()=>oi,ApiError:()=>c,Async:()=>gr,AsyncFile:()=>Mt,AsyncFileIndexFS:()=>an,AsyncMirror:()=>ef,AsyncMirrorFS:()=>yt,AsyncStoreFS:()=>ai,BigIntStats:()=>K,ErrorCode:()=>Y,ErrorStrings:()=>cn,File:()=>vr,FileIndex:()=>Ft,FileIndexFS:()=>pr,FileSystem:()=>J,FileType:()=>U,InMemory:()=>hn,InMemoryStore:()=>Ir,IndexDirInode:()=>et,IndexFileInode:()=>Zr,IndexInode:()=>hr,Inode:()=>he,LockedFS:()=>jt,MirrorFile:()=>Nr,Mutex:()=>qt,NoSyncFile:()=>pt,Overlay:()=>tf,OverlayFS:()=>zt,OverlayFile:()=>$t,PreloadFile:()=>oe,Readonly:()=>dn,SimpleSyncTransaction:()=>Ut,Stats:()=>M,StatsCommon:()=>Bt,Sync:()=>ht,SyncFile:()=>ni,SyncFileIndexFS:()=>sn,SyncStoreFS:()=>Wt,SyncStoreFile:()=>Tr,UnlockedOverlayFS:()=>Pr,checkOptions:()=>fn,configure:()=>qg,createBackend:()=>du,decode:()=>X,decodeDirListing:()=>mr,default:()=>jg,encode:()=>R,encodeDirListing:()=>ae,flagToMode:()=>rt,flagToNumber:()=>Zu,flagToString:()=>ys,fs:()=>Qr,initialize:()=>Zc,isAppendable:()=>it,isBackend:()=>br,isBackendConfig:()=>hs,isBlockDevice:()=>Yu,isCharacterDevice:()=>Xu,isDirectory:()=>Hu,isExclusive:()=>bs,isFIFO:()=>Ju,isFile:()=>Vu,isReadable:()=>ze,isSocket:()=>Gu,isSymbolicLink:()=>Ku,isSynchronous:()=>xr,isTruncating:()=>ms,isWriteable:()=>ye,levenshtein:()=>un,mkdirpSync:()=>ds,parseFlag:()=>F,pathExistsAction:()=>Ar,pathNotExistsAction:()=>kr,randomIno:()=>Dt,resolveBackend:()=>ri,rootCred:()=>_e,rootIno:()=>pe,setImmediate:()=>fu,size_max:()=>ii,wait:()=>uu});var Y=(g=>(g[g.EPERM=1]="EPERM",g[g.ENOENT=2]="ENOENT",g[g.EIO=5]="EIO",g[g.EBADF=9]="EBADF",g[g.EACCES=13]="EACCES",g[g.EBUSY=16]="EBUSY",g[g.EEXIST=17]="EEXIST",g[g.ENOTDIR=20]="ENOTDIR",g[g.EISDIR=21]="EISDIR",g[g.EINVAL=22]="EINVAL",g[g.EFBIG=27]="EFBIG",g[g.ENOSPC=28]="ENOSPC",g[g.EROFS=30]="EROFS",g[g.EDEADLK=35]="EDEADLK",g[g.ENOTEMPTY=39]="ENOTEMPTY",g[g.ENOTSUP=95]="ENOTSUP",g))(Y||{}),cn={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[35]:"Resource deadlock would occur",[39]:"Directory is not empty.",[95]:"Operation is not supported."},c=class extends Error{constructor(r,i=cn[r],n){super(i);this.errno=r;this.path=n;this.code=Y[r],this.message=`${this.code}: ${i}${this.path?`, '${this.path}'`:""}`}static fromJSON(r){let i=new c(r.errno,r.message,r.path);return i.code=r.code,i.stack=r.stack,i}static OnPath(r,i){return new c(r,cn[r],i)}static EACCES(r){return this.OnPath(13,r)}static ENOENT(r){return this.OnPath(2,r)}static EEXIST(r){return this.OnPath(17,r)}static EISDIR(r){return this.OnPath(21,r)}static ENOTDIR(r){return this.OnPath(20,r)}static EPERM(r){return this.OnPath(1,r)}static ENOTEMPTY(r){return this.OnPath(39,r)}code;syscall="";stack;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(c,"ApiError");var lu="/",us="/";function Ct(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(Ct,"validateString");function fs(t,e){let r="",i=0,n=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||o===1))if(o===2){if(r.length<2||i!==2||r.at(-1)!=="."||r.at(-2)!=="."){if(r.length>2){let u=r.lastIndexOf("/");u===-1?(r="",i=0):(r=r.slice(0,u),i=r.length-1-r.lastIndexOf("/")),n=l,o=0;continue}else if(r.length!==0){r="",i=0,n=l,o=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,l):r=t.slice(n+1,l),i=l-n-1;n=l,o=0}else a==="."&&o!==-1?++o:o=-1}return r}s(fs,"normalizeString");function Te(...t){let e="",r=!1;for(let i=t.length-1;i>=-1&&!r;i--){let n=i>=0?t[i]:lu;Ct(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,r=n[0]==="/")}return e=fs(e,!r),r?`/${e}`:e.length>0?e:"."}s(Te,"resolve");function cu(t){if(Ct(t,"path"),t.length===0)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=fs(t,!e),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)}s(cu,"normalize");function de(...t){if(t.length===0)return".";let e;for(let r=0;r<t.length;++r){let i=t[r];Ct(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":cu(e)}s(de,"join");function x(t){if(Ct(t,"path"),t.length===0)return".";let e=t[0]==="/",r=-1,i=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!i){r=n;break}}else i=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)}s(x,"dirname");function C(t,e){e!==void 0&&Ct(e,"ext"),Ct(t,"path");let r=0,i=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!n){r=l+1;break}}else a===-1&&(n=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(i=l):(o=-1,i=a));return r===i?i=a:i===-1&&(i=t.length),t.slice(r,i)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!n){r=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":t.slice(r,i)}s(C,"basename");function ds(t,e,r,i){i.existsSync(t,r)||(ds(x(t),e,r,i),i.mkdirSync(t,e,r))}s(ds,"mkdirpSync");function ti(t,e,r,i,n){return Math.min(t+1,e+1,r+1,i===n?e:e+1)}s(ti,"_min");function un(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let r=t.length,i=e.length;for(;r>0&&t.charCodeAt(r-1)===e.charCodeAt(i-1);)r--,i--;let n=0;for(;n<r&&t.charCodeAt(n)===e.charCodeAt(n);)n++;if(r-=n,i-=n,r===0||i===1)return i;let o=new Array(r<<1);for(let m=0;m<r;)o[r+m]=t.charCodeAt(n+m),o[m]=++m;let a,l,u,f,d;for(a=0;a+3<i;){let m=e.charCodeAt(n+(l=a)),y=e.charCodeAt(n+(u=a+1)),w=e.charCodeAt(n+(f=a+2)),b=e.charCodeAt(n+(d=a+3)),g=a+=4;for(let S=0;S<r;){let I=o[r+S],D=o[S];l=ti(D,l,u,m,I),u=ti(l,u,f,y,I),f=ti(u,f,d,w,I),g=ti(f,d,g,b,I),o[S++]=g,d=f,f=u,u=l,l=D}}let h=0;for(;a<i;){let m=e.charCodeAt(n+(l=a));h=++a;for(let y=0;y<r;y++){let w=o[y];o[y]=h=w<l||h<l?w>h?h+1:w+1:m===o[r+y]?l:l+1,l=w}}return h}s(un,"levenshtein");function uu(t){return new Promise(e=>{setTimeout(e,t)})}s(uu,"wait");var fu=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function R(t,e="utf8"){if(typeof t!="string")throw new c(22,"Can not encode a non-string");switch(e){case"ascii":case"latin1":case"binary":return new Uint8Array(Array.from(t).map(i=>i.charCodeAt(0)));case"utf8":case"utf-8":return new Uint8Array(Array.from(t).flatMap(i=>{let n=i.charCodeAt(0);if(n<128)return n;let o=n&63|128;if(n<2048)return[n>>6|192,o];let a=n>>6&63|128;return n<65536?[n>>12|224,a,o]:[n>>18|240,n>>12&63|128,a,o]}));case"base64":return R(atob(t),"utf-8");case"base64url":return R(t.replace("_","/").replace("-","+"),"base64");case"hex":return new Uint8Array(t.match(/.{1,2}/g).map(i=>parseInt(i,16)));case"utf16le":case"ucs2":case"ucs-2":let r=new Uint16Array(new ArrayBuffer(t.length*2));for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return new Uint8Array(r.buffer);default:throw new c(22,"Invalid encoding: "+e)}}s(R,"encode");function X(t,e="utf8"){if(!(t instanceof Uint8Array))throw new c(22,"Can not decode a non-Uint8Array");switch(e){case"ascii":case"latin1":case"binary":return Array.from(t).map(n=>String.fromCharCode(n)).join("");case"utf8":case"utf-8":let r="";for(let n=0;n<t.length;n++){let o;t[n]<128?o=t[n]:t[n]<224?o=(t[n]&31)<<6|t[++n]&63:t[n]<240?o=(t[n]&15)<<12|(t[++n]&63)<<6|t[++n]&63:o=(t[n]&7)<<18|(t[++n]&63)<<12|(t[++n]&63)<<6|t[++n]&63,r+=String.fromCharCode(o)}return r;case"utf16le":case"ucs2":case"ucs-2":let i="";for(let n=0;n<t.length;n+=2){let o=t[n]|t[n+1]<<8;i+=String.fromCharCode(o)}return i;case"base64":return btoa(X(t,"utf-8"));case"base64url":return X(t,"base64").replace("/","_").replace("+","-");case"hex":return Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("");default:throw new c(22,"Invalid encoding: "+e)}}s(X,"decode");function mr(t){return JSON.parse(X(t),(e,r)=>e==""?r:BigInt(r))}s(mr,"decodeDirListing");function ae(t){return R(JSON.stringify(t,(e,r)=>e==""?r:r.toString()))}s(ae,"encodeDirListing");function br(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(br,"isBackend");async function fn(t,e){if(typeof e!="object"||e===null)throw new c(22,"Invalid options");for(let[r,i]of Object.entries(t.options)){let n=e?.[r];if(n==null){if(!i.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:un(r,l)})).filter(l=>l.distance<5).sort((l,u)=>l.distance-u.distance);throw new c(22,`${t.name}: Required option '${r}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${r}'.`:""}`)}if(!(Array.isArray(i.type)?i.type.indexOf(typeof n)!=-1:typeof n==i.type))throw new c(22,`${t.name}: Value provided for option ${r} is not the proper type. Expected ${Array.isArray(i.type)?`one of {${i.type.join(", ")}}`:i.type}, but received ${typeof n}`);i.validator&&await i.validator(n)}}s(fn,"checkOptions");function du(t,e){return fn(t,e),t.create(e).ready()}s(du,"createBackend");function hs(t){return t!=null&&typeof t=="object"&&"backend"in t}s(hs,"isBackendConfig");async function ri(t,e=0){if(typeof t!="object"||t==null)throw new c(22,"Invalid options on configuration object.");let{backend:r}=t;if(!br(r))throw new c(22,"Missing or invalid backend");let i=Object.keys(t).filter(o=>o!="backend");for(let o of i){let a=t[o];if(br(a)&&(a={backend:a}),hs(a)){if(e>10)throw new c(22,"Invalid configuration, too deep and possibly infinite");t[o]=await ri(a,++e)}}if(!await r.isAvailable())throw new c(1,"Backend not available: "+r);fn(r,t);let n=r.create(t);return await n.ready(),n}s(ri,"resolveBackend");var J=class{metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,r){try{return await this.stat(e,r),!0}catch{return!1}}existsSync(e,r){try{return this.statSync(e,r),!0}catch{return!1}}};s(J,"FileSystem");function ht(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!0}}async ready(){return this}async exists(i,n){return this.existsSync(i,n)}async rename(i,n,o){return this.renameSync(i,n,o)}async stat(i,n){return this.statSync(i,n)}async createFile(i,n,o,a){return this.createFileSync(i,n,o,a)}async openFile(i,n,o){return this.openFileSync(i,n,o)}async unlink(i,n){return this.unlinkSync(i,n)}async rmdir(i,n){return this.rmdirSync(i,n)}async mkdir(i,n,o){return this.mkdirSync(i,n,o)}async readdir(i,n){return this.readdirSync(i,n)}async link(i,n,o){return this.linkSync(i,n,o)}async sync(i,n,o){return this.syncSync(i,n,o)}}return s(e,"_SyncFileSystem"),e}s(ht,"Sync");function gr(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!1}}renameSync(i,n,o){throw new c(95)}statSync(i,n){throw new c(95)}createFileSync(i,n,o,a){throw new c(95)}openFileSync(i,n,o){throw new c(95)}unlinkSync(i,n){throw new c(95)}rmdirSync(i,n){throw new c(95)}mkdirSync(i,n,o){throw new c(95)}readdirSync(i,n){throw new c(95)}linkSync(i,n,o){throw new c(95)}syncSync(i,n,o){throw new c(95)}}return s(e,"_AsyncFileSystem"),e}s(gr,"Async");function dn(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(i,n,o){throw new c(30)}renameSync(i,n,o){throw new c(30)}async createFile(i,n,o,a){throw new c(30)}createFileSync(i,n,o,a){throw new c(30)}async unlink(i,n){throw new c(30)}unlinkSync(i,n){throw new c(30)}async rmdir(i,n){throw new c(30)}rmdirSync(i,n){throw new c(30)}async mkdir(i,n,o){throw new c(30)}mkdirSync(i,n,o){throw new c(30)}async link(i,n,o){throw new c(30)}linkSync(i,n,o){throw new c(30)}async sync(i,n,o){throw new c(30)}syncSync(i,n,o){throw new c(30)}}return s(e,"_ReadonlyFileSystem"),e}s(dn,"Readonly");var Er={};ei(Er,{COPYFILE_EXCL:()=>yu,COPYFILE_FICLONE:()=>mu,COPYFILE_FICLONE_FORCE:()=>bu,F_OK:()=>hu,O_APPEND:()=>Le,O_CREAT:()=>H,O_DIRECT:()=>vu,O_DIRECTORY:()=>wu,O_DSYNC:()=>Eu,O_EXCL:()=>Pe,O_NOATIME:()=>Su,O_NOCTTY:()=>gu,O_NOFOLLOW:()=>_u,O_NONBLOCK:()=>Au,O_RDONLY:()=>Rt,O_RDWR:()=>ne,O_SYMLINK:()=>xu,O_SYNC:()=>Ot,O_TRUNC:()=>Fe,O_WRONLY:()=>Ie,R_OK:()=>Se,S_IFBLK:()=>Nu,S_IFCHR:()=>Tu,S_IFDIR:()=>_r,S_IFIFO:()=>Iu,S_IFLNK:()=>wr,S_IFMT:()=>te,S_IFREG:()=>Sr,S_IFSOCK:()=>ku,S_IRGRP:()=>Mu,S_IROTH:()=>ju,S_IRUSR:()=>Ru,S_IRWXG:()=>Du,S_IRWXO:()=>qu,S_IRWXU:()=>Cu,S_ISGID:()=>Fu,S_ISUID:()=>Pu,S_ISVTX:()=>Lu,S_IWGRP:()=>Uu,S_IWOTH:()=>$u,S_IWUSR:()=>Ou,S_IXGRP:()=>Wu,S_IXOTH:()=>zu,S_IXUSR:()=>Bu,W_OK:()=>le,X_OK:()=>pu});var hu=0,Se=4,le=2,pu=1,yu=1,mu=2,bu=4,Rt=0,Ie=1,ne=2,H=64,Pe=128,gu=256,Fe=512,Le=1024,wu=65536,Su=262144,_u=131072,Ot=1052672,Eu=4096,xu=32768,vu=16384,Au=2048,te=61440,ku=49152,wr=40960,Sr=32768,Nu=24576,_r=16384,Tu=8192,Iu=4096,Pu=2048,Fu=1024,Lu=512,Cu=448,Ru=256,Ou=128,Bu=64,Du=56,Mu=32,Uu=16,Wu=8,qu=7,ju=4,$u=2,zu=1;var U=(i=>(i[i.FILE=32768]="FILE",i[i.DIRECTORY=16384]="DIRECTORY",i[i.SYMLINK=40960]="SYMLINK",i))(U||{}),Bt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:r,ctimeMs:i,birthtimeMs:n,uid:o,gid:a,size:l,mode:u}={}){let f=Date.now(),d=s((m,y)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:y),"resolveT");this.atimeMs=d(e,f),this.mtimeMs=d(r,f),this.ctimeMs=d(i,f),this.birthtimeMs=d(n,f),this.uid=d(o,0),this.gid=d(a,0),this.size=this._convert(l);let h=Number(u)&61440||U.FILE;if(u)this.mode=this._convert(u);else switch(h){case U.FILE:this.mode=this._convert(420);break;case U.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(h))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,r){if(r.euid===0||r.egid===0)return!0;let i=this.mode&-61441,n=15,o=15,a=15;if(r.euid==this.uid){let f=(3840&i)>>8;n=(e^f)&e}if(r.egid==this.gid){let f=(240&i)>>4;o=(e^f)&e}let l=15&i;return a=(e^l)&e,!(n&o&a)}cred(e=Number(this.uid),r=Number(this.gid)){return{uid:e,gid:r,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:r}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,r){e=Number(e),r=Number(r),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(r)&&0<=r&&r<2**32&&(this.gid=this._convert(r))}};s(Bt,"StatsCommon");var M=class extends Bt{_isBigint=!1;static clone(e){return new M(e)}};s(M,"Stats");var K=class extends Bt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new K(e)}};s(K,"BigIntStats");function Vu(t){return(Number(t.mode)&61440)===32768}s(Vu,"isFile");function Hu(t){return(Number(t.mode)&61440)===16384}s(Hu,"isDirectory");function Ku(t){return(Number(t.mode)&61440)===40960}s(Ku,"isSymbolicLink");function Gu(){return!1}s(Gu,"isSocket");function Yu(){return!1}s(Yu,"isBlockDevice");function Xu(){return!1}s(Xu,"isCharacterDevice");function Ju(){return!1}s(Ju,"isFIFO");var ii=2**32-1,pe=0n;function ps(){return Math.round(Math.random()*2**32).toString(16)}s(ps,"_random");function Dt(){return BigInt("0x"+ps()+ps())}s(Dt,"randomIno");var he=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let r=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!r)return;this.ino=Dt(),this.nlink=1,this.size=4096;let i=Date.now();this.atimeMs=i,this.mtimeMs=i,this.ctimeMs=i,this.birthtimeMs=i}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new M(this)}update(e){let r=!1;return this.size!==e.size&&(this.size=e.size,r=!0),this.mode!==e.mode&&(this.mode=e.mode,r=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,r=!0),this.uid!==e.uid&&(this.uid=e.uid,r=!0),this.uid!==e.uid&&(this.uid=e.uid,r=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,r=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,r=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,r=!0),r}};s(he,"Inode");var oi=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(oi||{}),Qu=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function F(t){if(typeof t=="number")return ys(t);if(!Qu.includes(t))throw new Error("Invalid flag string: "+t);return t}s(F,"parseFlag");function ys(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}s(ys,"flagToString");function Zu(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(Zu,"flagToNumber");function rt(t){let e=0;return e<<=1,e+=+ze(t),e<<=1,e+=+ye(t),e<<=1,e}s(rt,"flagToMode");function ze(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(ze,"isReadable");function ye(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(ye,"isWriteable");function ms(t){return t.indexOf("w")!==-1}s(ms,"isTruncating");function it(t){return t.indexOf("a")!==-1}s(it,"isAppendable");function xr(t){return t.indexOf("s")!==-1}s(xr,"isSynchronous");function bs(t){return t.indexOf("x")!==-1}s(bs,"isExclusive");function Ar(t){return bs(t)?1:ms(t)?2:0}s(Ar,"pathExistsAction");function kr(t){return(ye(t)||it(t))&&t!=="r+"?3:1}s(kr,"pathNotExistsAction");var vr=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(vr,"File");var oe=class extends vr{constructor(r,i,n,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:ii}))){super();this.fs=r;this.path=i;this.flag=n;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(ze(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return it(this.flag)?this.stats.size:this._position}set position(r){this._position=r}async stat(){return new M(this.stats)}statSync(){return new M(this.stats)}truncate(r){if(this.truncateSync(r),xr(this.flag)&&!this.fs.metadata().synchronous)return this.sync()}truncateSync(r){if(this._dirty=!0,!ye(this.flag))throw new c(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),r>this._buffer.length){let i=new Uint8Array(r-this._buffer.length);this.writeSync(i,0,i.length,this._buffer.length),xr(this.flag)&&this.fs.metadata().synchronous&&this.syncSync();return}this.stats.size=r,this._buffer=this._buffer.subarray(0,r),xr(this.flag)&&this.fs.metadata().synchronous&&this.syncSync()}async write(r,i=0,n=this.stats.size,o=0){return this.writeSync(r,i,n,o)}writeSync(r,i=0,n=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!ye(this.flag))throw new c(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let u=new Uint8Array(new ArrayBuffer(a,{maxByteLength:ii}));u.set(this._buffer),this._buffer=u}this._buffer.set(r.slice(i,i+n),o);let l=this._buffer.byteOffset;return this.stats.mtimeMs=Date.now(),xr(this.flag)?(this.syncSync(),l):(this.position=o+l,l)}async read(r,i=0,n=this.stats.size,o=0){return{bytesRead:this.readSync(r,i,n,o),buffer:r}}readSync(r,i=0,n=this.stats.size,o=0){if(!ze(this.flag))throw new c(1,"File not opened with a readable mode.");o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||r.set(this._buffer.slice(o,a),i),l}async chmod(r){this.chmodSync(r)}chmodSync(r){if(!this.fs.metadata().supportsProperties)throw new c(95);this._dirty=!0,this.stats.chmod(r),this.syncSync()}async chown(r,i){this.chownSync(r,i)}chownSync(r,i){if(!this.fs.metadata().supportsProperties)throw new c(95);this._dirty=!0,this.stats.chown(r,i),this.syncSync()}async utimes(r,i){this.utimesSync(r,i)}utimesSync(r,i){if(!this.fs.metadata().supportsProperties)throw new c(95);this._dirty=!0,this.stats.atime=r,this.stats.mtime=i,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(r){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|r,this.sync()}_setTypeSync(r){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|r,this.syncSync()}};s(oe,"PreloadFile");var ni=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(ni,"SyncFile");var pt=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(pt,"NoSyncFile");var _e={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Nr=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(Nr,"MirrorFile");var yt=class extends ht(J){_queue=[];_queueRunning=!1;_sync;_async;_isInitialized=!1;_ready;async ready(){return await this._ready,this}constructor({sync:e,async:r}){super(),this._sync=e,this._async=r,this._ready=this._initialize()}metadata(){return{...super.metadata(),name:yt.name,synchronous:!0,supportsProperties:this._sync.metadata().supportsProperties&&this._async.metadata().supportsProperties}}syncSync(e,r,i){this._sync.syncSync(e,r,i),this.enqueue({apiMethod:"sync",arguments:[e,r,i]})}openFileSync(e,r,i){return this._sync.openFileSync(e,r,i)}createFileSync(e,r,i,n){let o=this._sync.createFileSync(e,r,i,n);this.enqueue({apiMethod:"createFile",arguments:[e,r,i,n]});let a=o.statSync(),l=new Uint8Array(a.size);return o.readSync(l),new Nr(this,e,r,a,l)}linkSync(e,r,i){this._sync.linkSync(e,r,i),this.enqueue({apiMethod:"link",arguments:[e,r,i]})}renameSync(e,r,i){this._sync.renameSync(e,r,i),this.enqueue({apiMethod:"rename",arguments:[e,r,i]})}statSync(e,r){return this._sync.statSync(e,r)}unlinkSync(e,r){this._sync.unlinkSync(e,r),this.enqueue({apiMethod:"unlink",arguments:[e,r]})}rmdirSync(e,r){this._sync.rmdirSync(e,r),this.enqueue({apiMethod:"rmdir",arguments:[e,r]})}mkdirSync(e,r,i){this._sync.mkdirSync(e,r,i),this.enqueue({apiMethod:"mkdir",arguments:[e,r,i]})}readdirSync(e,r){return this._sync.readdirSync(e,r)}existsSync(e,r){return this._sync.existsSync(e,r)}async crossCopyDirectory(e,r){if(e!=="/"){let n=await this._async.stat(e,_e);this._sync.mkdirSync(e,r,n.cred())}let i=await this._async.readdir(e,_e);for(let n of i)await this.crossCopy(de(e,n))}async crossCopyFile(e,r){let i=await this._async.openFile(e,F("r"),_e),n=this._sync.createFileSync(e,F("w"),r,_e);try{let{size:o}=await i.stat(),a=new Uint8Array(o);await i.read(a),n.writeSync(a)}finally{await i.close(),n.closeSync()}}async crossCopy(e){let r=await this._async.stat(e,_e);r.isDirectory()?await this.crossCopyDirectory(e,r.mode):await this.crossCopyFile(e,r.mode)}async _initialize(){if(!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let e=this._queue.shift();try{await this._async[e.apiMethod](...e.arguments)}catch(r){throw new c(5,"AsyncMirror desync: "+r)}await this._next()}enqueue(e){this._queue.push(e),!this._queueRunning&&(this._queueRunning=!0,this._next())}};s(yt,"AsyncMirrorFS");var ef={name:"AsyncMirror",options:{sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if("metadata"in t&&!t.metadata().synchronous)throw new c(22,'"sync" option must be a file system that supports synchronous operations')}},async:{type:"object",description:"The asynchronous file system to mirror."}},isAvailable(){return!0},create(t){return new yt(t)}};var si=class{constructor(e){this.limit=e}cache=[];set(e,r){let i=this.cache.findIndex(n=>n.key===e);i!=-1?this.cache.splice(i,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:r})}get(e){let r=this.cache.find(i=>i.key===e);if(r)return this.set(e,r.value),r.value}remove(e){let r=this.cache.findIndex(i=>i.key===e);r!==-1&&this.cache.splice(r,1)}reset(){this.cache=[]}};s(si,"LRUCache");var Mt=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this.resetDirty())}syncSync(){throw new c(95)}async close(){this.sync()}closeSync(){throw new c(95)}};s(Mt,"AsyncFile");var ai=class extends gr(J){store;_cache;_ready;ready(){return this._ready}metadata(){return{...super.metadata(),name:this.store.name}}constructor({store:e,cacheSize:r}){super(),r>0&&(this._cache=new si(r)),this._ready=this._initialize(e)}async _initialize(e){return this.store=await e,await this.makeRootDirectory(),this}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(e,r,i){let n=this._cache;this._cache&&(this._cache=null,n.reset());try{let o=this.store.beginTransaction(),a=x(e),l=C(e),u=x(r),f=C(r),d=await this.findINode(o,a),h=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,i))throw c.EACCES(e);if(!h[l])throw c.ENOENT(e);let m=h[l];if(delete h[l],(u+"/").indexOf(e+"/")===0)throw new c(16,a);let y,w;if(u===a?(y=d,w=h):(y=await this.findINode(o,u),w=await this.getDirListing(o,y,u)),w[f]){let b=await this.getINode(o,w[f],r);if(b.toStats().isFile())try{await o.remove(b.ino),await o.remove(w[f])}catch(g){throw await o.abort(),g}else throw c.EPERM(r)}w[f]=m;try{await o.put(d.ino,ae(h),!0),await o.put(y.ino,ae(w),!0)}catch(b){throw await o.abort(),b}await o.commit()}finally{n&&(this._cache=n)}}async stat(e,r){let i=this.store.beginTransaction(),n=await this.findINode(i,e);if(!n)throw c.ENOENT(e);let o=n.toStats();if(!o.hasAccess(4,r))throw c.EACCES(e);return o}async createFile(e,r,i,n){let o=this.store.beginTransaction(),a=new Uint8Array(0),l=await this.commitNewFile(o,e,U.FILE,i,n,a);return new Mt(this,e,r,l.toStats(),a)}async openFile(e,r,i){let n=this.store.beginTransaction(),o=await this.findINode(n,e),a=await n.get(o.ino);if(!o.toStats().hasAccess(rt(r),i))throw c.EACCES(e);if(!a)throw c.ENOENT(e);return new Mt(this,e,r,o.toStats(),a)}async unlink(e,r){return this.removeEntry(e,!1,r)}async rmdir(e,r){if((await this.readdir(e,r)).length>0)throw c.ENOTEMPTY(e);await this.removeEntry(e,!0,r)}async mkdir(e,r,i){let n=this.store.beginTransaction(),o=R("{}");await this.commitNewFile(n,e,U.DIRECTORY,r,i,o)}async readdir(e,r){let i=this.store.beginTransaction(),n=await this.findINode(i,e);if(!n.toStats().hasAccess(4,r))throw c.EACCES(e);return Object.keys(await this.getDirListing(i,n,e))}async sync(e,r,i){let n=this.store.beginTransaction(),o=await this._findINode(n,x(e),C(e)),a=await this.getINode(n,o,e),l=a.update(i);try{await n.put(a.ino,r,!0),l&&await n.put(o,a.data,!0)}catch(u){throw await n.abort(),u}await n.commit()}async link(e,r,i){let n=this.store.beginTransaction(),o=x(e);if(!(await this.findINode(n,o)).toStats().hasAccess(4,i))throw c.EACCES(o);let l=x(r),u=await this.findINode(n,l),f=await this.getDirListing(n,u,l);if(!u.toStats().hasAccess(2,i))throw c.EACCES(l);let d=await this._findINode(n,o,C(e)),h=await this.getINode(n,d,e);if(!h.toStats().hasAccess(2,i))throw c.EACCES(r);h.nlink++,f[C(r)]=d;try{n.put(d,h.data,!0),n.put(u.ino,ae(f),!0)}catch(m){throw n.abort(),m}n.commit()}async makeRootDirectory(){let e=this.store.beginTransaction();if(await e.get(pe)===void 0){let r=new he;r.mode=511|U.DIRECTORY,await e.put(r.ino,R("{}"),!1),await e.put(pe,r.data,!1),await e.commit()}}async _findINode(e,r,i,n=new Set){let o=de(r,i);if(n.has(o))throw new c(5,"Infinite loop detected while finding inode",o);if(n.add(o),this._cache){let a=this._cache.get(o);if(a)return a}if(r==="/"){if(i==="")return this._cache&&this._cache.set(o,pe),pe;{let a=await this.getINode(e,pe,r),l=await this.getDirListing(e,a,r);if(l[i]){let u=l[i];return this._cache&&this._cache.set(o,u),u}else throw c.ENOENT(Te(r,i))}}else{let a=await this.findINode(e,r,n),l=await this.getDirListing(e,a,r);if(l[i]){let u=l[i];return this._cache&&this._cache.set(o,u),u}else throw c.ENOENT(Te(r,i))}}async findINode(e,r,i=new Set){let n=await this._findINode(e,x(r),C(r),i);return this.getINode(e,n,r)}async getINode(e,r,i){let n=await e.get(r);if(!n)throw c.ENOENT(i);return new he(n.buffer)}async getDirListing(e,r,i){if(!r.toStats().isDirectory())throw c.ENOTDIR(i);let n=await e.get(r.ino);if(!n)throw c.ENOENT(i);return mr(n)}async addNewNode(e,r){let i=0,n=s(async()=>{if(++i===5)throw new c(5,"Unable to commit data to key-value store.");{let o=Dt();return await e.put(o,r,!1)?o:n()}},"reroll");return n()}async commitNewFile(e,r,i,n,o,a){let l=x(r),u=C(r),f=await this.findINode(e,l),d=await this.getDirListing(e,f,l);if(!f.toStats().hasAccess(2,o))throw c.EACCES(r);if(r==="/")throw c.EEXIST(r);if(d[u])throw await e.abort(),c.EEXIST(r);try{let h=new he;return h.ino=await this.addNewNode(e,a),h.mode=n|i,h.uid=o.uid,h.gid=o.gid,h.size=a.length,d[u]=await this.addNewNode(e,h.data),await e.put(f.ino,ae(d),!0),await e.commit(),h}catch(h){throw e.abort(),h}}async removeEntry(e,r,i){this._cache&&this._cache.remove(e);let n=this.store.beginTransaction(),o=x(e),a=await this.findINode(n,o),l=await this.getDirListing(n,a,o),u=C(e);if(!l[u])throw c.ENOENT(e);let f=l[u],d=await this.getINode(n,f,e);if(!d.toStats().hasAccess(2,i))throw c.EACCES(e);if(delete l[u],!r&&d.toStats().isDirectory())throw c.EISDIR(e);if(r&&!d.toStats().isDirectory())throw c.ENOTDIR(e);try{await n.put(a.ino,ae(l),!0),--d.nlink<1&&(await n.remove(d.ino),await n.remove(f))}catch(h){throw await n.abort(),h}await n.commit()}};s(ai,"AsyncStoreFS");var Ut=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let r=this.store.get(e);return this.stashOldValue(e,r),r}put(e,r,i){return this.markModified(e),this.store.put(e,r,i)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let r=this.originalData.get(e);r?this.store.put(e,r,!0):this.store.remove(e)}}stashOldValue(e,r){this.originalData.has(e)||this.originalData.set(e,r)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(Ut,"SimpleSyncTransaction");var Tr=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(Tr,"SyncStoreFile");var Wt=class extends ht(J){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,r,i){let n=this.store.beginTransaction(),o=x(e),a=C(e),l=x(r),u=C(r),f=this.findINode(n,o),d=this.getDirListing(n,f,o);if(!f.toStats().hasAccess(2,i))throw c.EACCES(e);if(!d[a])throw c.ENOENT(e);let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new c(16,o);let m,y;if(l===o?(m=f,y=d):(m=this.findINode(n,l),y=this.getDirListing(n,m,l)),y[u]){let w=this.getINode(n,y[u],r);if(w.toStats().isFile())try{n.remove(w.ino),n.remove(y[u])}catch(b){throw n.abort(),b}else throw c.EPERM(r)}y[u]=h;try{n.put(f.ino,ae(d),!0),n.put(m.ino,ae(y),!0)}catch(w){throw n.abort(),w}n.commit()}statSync(e,r){let i=this.findINode(this.store.beginTransaction(),e).toStats();if(!i.hasAccess(4,r))throw c.EACCES(e);return i}createFileSync(e,r,i,n){return this.commitNewFile(e,U.FILE,i,n),this.openFileSync(e,r,n)}openFileSync(e,r,i){let n=this.store.beginTransaction(),o=this.findINode(n,e),a=n.get(o.ino);if(!o.toStats().hasAccess(rt(r),i))throw c.EACCES(e);if(a===null)throw c.ENOENT(e);return new Tr(this,e,r,o.toStats(),a)}unlinkSync(e,r){this.removeEntry(e,!1,r)}rmdirSync(e,r){if(this.readdirSync(e,r).length>0)throw c.ENOTEMPTY(e);this.removeEntry(e,!0,r)}mkdirSync(e,r,i){this.commitNewFile(e,U.DIRECTORY,r,i,R("{}"))}readdirSync(e,r){let i=this.store.beginTransaction(),n=this.findINode(i,e);if(!n.toStats().hasAccess(4,r))throw c.EACCES(e);return Object.keys(this.getDirListing(i,n,e))}syncSync(e,r,i){let n=this.store.beginTransaction(),o=this._findINode(n,x(e),C(e)),a=this.getINode(n,o,e),l=a.update(i);try{n.put(a.ino,r,!0),l&&n.put(o,a.data,!0)}catch(u){throw n.abort(),u}n.commit()}linkSync(e,r,i){let n=this.store.beginTransaction(),o=x(e);if(!this.findINode(n,o).toStats().hasAccess(4,i))throw c.EACCES(o);let l=x(r),u=this.findINode(n,l),f=this.getDirListing(n,u,l);if(!u.toStats().hasAccess(2,i))throw c.EACCES(l);let d=this._findINode(n,o,C(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,i))throw c.EACCES(r);h.nlink++,f[C(r)]=d;try{n.put(d,h.data,!0),n.put(u.ino,ae(f),!0)}catch(m){throw n.abort(),m}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(pe))return;let r=new he;r.mode=511|U.DIRECTORY,e.put(r.ino,R("{}"),!1),e.put(pe,r.data,!1),e.commit()}_findINode(e,r,i,n=new Set){let o=de(r,i);if(n.has(o))throw new c(5,"Infinite loop detected while finding inode",o);if(n.add(o),r!="/"){let a=this._findINode(e,x(r),C(r),n),l=this.getDirListing(e,this.getINode(e,a,r+us+i),r);if(!(i in l))throw c.ENOENT(Te(r,i));return l[i]}if(i!=""){let a=this.getDirListing(e,this.getINode(e,pe,r),r);if(!(i in a))throw c.ENOENT(Te(r,i));return a[i]}return pe}findINode(e,r){let i=this._findINode(e,x(r),C(r));return this.getINode(e,i,r)}getINode(e,r,i){let n=e.get(r);if(!n)throw c.ENOENT(i);return new he(n.buffer)}getDirListing(e,r,i){if(!r.toStats().isDirectory())throw c.ENOTDIR(i);let n=e.get(r.ino);if(!n)throw c.ENOENT(i);return mr(n)}addNewNode(e,r){let n;for(;0<5;)try{return n=Dt(),e.put(n,r,!1),n}catch{}throw new c(5,"Unable to commit data to key-value store.")}commitNewFile(e,r,i,n,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),u=C(e),f=this.findINode(a,l),d=this.getDirListing(a,f,l);if(!f.toStats().hasAccess(2,n))throw c.EACCES(e);if(e==="/")throw c.EEXIST(e);if(d[u])throw c.EEXIST(e);let h=new he;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=i|r,h.uid=n.uid,h.gid=n.gid,d[u]=this.addNewNode(a,h.data),a.put(f.ino,ae(d),!0)}catch(m){throw a.abort(),m}return a.commit(),h}removeEntry(e,r,i){let n=this.store.beginTransaction(),o=x(e),a=this.findINode(n,o),l=this.getDirListing(n,a,o),u=C(e),f=l[u];if(!f)throw c.ENOENT(e);let d=this.getINode(n,f,e);if(!d.toStats().hasAccess(2,i))throw c.EACCES(e);if(delete l[u],!r&&d.toStats().isDirectory())throw c.EISDIR(e);if(r&&!d.toStats().isDirectory())throw c.ENOTDIR(e);try{n.put(a.ino,ae(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(f))}catch(h){throw n.abort(),h}n.commit()}};s(Wt,"SyncStoreFS");var Ir=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new Ut(this)}get(e){return this.store.get(e)}put(e,r,i){return!i&&this.store.has(e)?!1:(this.store.set(e,r),!0)}remove(e){this.store.delete(e)}};s(Ir,"InMemoryStore");var hn={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",description:"The name of the store"}},create({name:t}){return new Wt({store:new Ir(t)})}};var qt=class{_locks=new Map;lock(e){return new Promise(r=>{this._locks.has(e)?this._locks.get(e).push(r):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let r=this._locks.get(e).shift();if(r){setTimeout(r,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(qt,"Mutex");var jt=class{constructor(e){this.fs=e}_mu=new qt;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,r,i){await this._mu.lock(e),await this.fs.rename(e,r,i),this._mu.unlock(e)}renameSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,r,i)}async stat(e,r){await this._mu.lock(e);let i=await this.fs.stat(e,r);return this._mu.unlock(e),i}statSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,r)}async openFile(e,r,i){await this._mu.lock(e);let n=await this.fs.openFile(e,r,i);return this._mu.unlock(e),n}openFileSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,r,i)}async createFile(e,r,i,n){await this._mu.lock(e);let o=await this.fs.createFile(e,r,i,n);return this._mu.unlock(e),o}createFileSync(e,r,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,r,i,n)}async unlink(e,r){await this._mu.lock(e),await this.fs.unlink(e,r),this._mu.unlock(e)}unlinkSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,r)}async rmdir(e,r){await this._mu.lock(e),await this.fs.rmdir(e,r),this._mu.unlock(e)}rmdirSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,r)}async mkdir(e,r,i){await this._mu.lock(e),await this.fs.mkdir(e,r,i),this._mu.unlock(e)}mkdirSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,r,i)}async readdir(e,r){await this._mu.lock(e);let i=await this.fs.readdir(e,r);return this._mu.unlock(e),i}readdirSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,r)}async exists(e,r){await this._mu.lock(e);let i=await this.fs.exists(e,r);return this._mu.unlock(e),i}existsSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,r)}async link(e,r,i){await this._mu.lock(e),await this.fs.link(e,r,i),this._mu.unlock(e)}linkSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,r,i)}async sync(e,r,i){await this._mu.lock(e),await this.fs.sync(e,r,i),this._mu.unlock(e)}syncSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,r,i)}};s(jt,"LockedFS");var pn="/.deleted",$t=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this.buffer,this.stats),this.resetDirty())}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this.buffer,this.stats),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};s($t,"OverlayFile");var Pr=class extends J{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:r}){if(super(),this._writable=e,this._readable=r,this._writable.metadata().readonly)throw new c(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:zt.name,synchronous:this._readable.metadata().synchronous&&this._writable.metadata().synchronous,supportsProperties:this._readable.metadata().supportsProperties&&this._writable.metadata().supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,r,i){let n=i.cred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,r,i)}syncSync(e,r,i){let n=i.cred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,r,i)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(pn,F("r"),_e),{size:r}=await e.stat(),{buffer:i}=await e.read(new Uint8Array(r));this._deleteLog=X(i)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,r){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",r)}async rename(e,r,i){this.checkInitialized(),this.checkPath(e),this.checkPath(r);try{await this._writable.rename(e,r,i)}catch{if(this._deletedFiles.has(e))throw c.ENOENT(e)}}renameSync(e,r,i){this.checkInitialized(),this.checkPath(e),this.checkPath(r);try{this._writable.renameSync(e,r,i)}catch{if(this._deletedFiles.has(e))throw c.ENOENT(e)}}async stat(e,r){this.checkInitialized();try{return this._writable.stat(e,r)}catch{if(this._deletedFiles.has(e))throw c.ENOENT(e);let n=new M(await this._readable.stat(e,r));return n.mode|=146,n}}statSync(e,r){this.checkInitialized();try{return this._writable.statSync(e,r)}catch{if(this._deletedFiles.has(e))throw c.ENOENT(e);let n=new M(this._readable.statSync(e,r));return n.mode|=146,n}}async openFile(e,r,i){if(await this._writable.exists(e,i))return this._writable.openFile(e,r,i);let n=await this._readable.openFile(e,F("r"),i),o=new M(await n.stat()),{buffer:a}=await n.read(new Uint8Array(o.size));return new $t(this,e,r,o,a)}openFileSync(e,r,i){if(this._writable.existsSync(e,i))return this._writable.openFileSync(e,r,i);let n=this._readable.openFileSync(e,F("r"),i),o=M.clone(n.statSync()),a=new Uint8Array(o.size);return n.readSync(a),new $t(this,e,r,o,a)}async createFile(e,r,i,n){return this.checkInitialized(),await this._writable.createFile(e,r,i,n),this.openFile(e,r,n)}createFileSync(e,r,i,n){return this.checkInitialized(),this._writable.createFileSync(e,r,i,n),this.openFileSync(e,r,n)}async link(e,r,i){this.checkInitialized(),await this._writable.link(e,r,i)}linkSync(e,r,i){this.checkInitialized(),this._writable.linkSync(e,r,i)}async unlink(e,r){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,r))throw c.ENOENT(e);await this._writable.exists(e,r)&&await this._writable.unlink(e,r),await this.exists(e,r)&&this.deletePath(e,r)}unlinkSync(e,r){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,r))throw c.ENOENT(e);this._writable.existsSync(e,r)&&this._writable.unlinkSync(e,r),this.existsSync(e,r)&&this.deletePath(e,r)}async rmdir(e,r){if(this.checkInitialized(),!await this.exists(e,r))throw c.ENOENT(e);if(await this._writable.exists(e,r)&&await this._writable.rmdir(e,r),await this.exists(e,r)){if((await this.readdir(e,r)).length>0)throw c.ENOTEMPTY(e);this.deletePath(e,r)}}rmdirSync(e,r){if(this.checkInitialized(),!this.existsSync(e,r))throw c.ENOENT(e);if(this._writable.existsSync(e,r)&&this._writable.rmdirSync(e,r),this.existsSync(e,r)){if(this.readdirSync(e,r).length>0)throw c.ENOTEMPTY(e);this.deletePath(e,r)}}async mkdir(e,r,i){if(this.checkInitialized(),await this.exists(e,i))throw c.EEXIST(e);await this.createParentDirectories(e,i),await this._writable.mkdir(e,r,i)}mkdirSync(e,r,i){if(this.checkInitialized(),this.existsSync(e,i))throw c.EEXIST(e);this.createParentDirectoriesSync(e,i),this._writable.mkdirSync(e,r,i)}async readdir(e,r){if(this.checkInitialized(),!(await this.stat(e,r)).isDirectory())throw c.ENOTDIR(e);let n=[];try{n.push(...await this._writable.readdir(e,r))}catch{}try{n.push(...(await this._readable.readdir(e,r)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,r){if(this.checkInitialized(),!this.statSync(e,r).isDirectory())throw c.ENOTDIR(e);let n=[];try{n=n.concat(this._writable.readdirSync(e,r))}catch{}try{n=n.concat(this._readable.readdirSync(e,r).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,r){this._deletedFiles.add(e),this.updateLog(`d${e}
1
+ var ZenFS=(()=>{var tu=Object.create;var yr=Object.defineProperty;var ru=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var nu=Object.getPrototypeOf,ou=Object.prototype.hasOwnProperty;var s=(t,e)=>yr(t,"name",{value:e,configurable:!0});var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ei=(t,e)=>{for(var r in e)yr(t,r,{get:e[r],enumerable:!0})},cs=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of iu(e))!ou.call(t,n)&&n!==r&&yr(t,n,{get:()=>e[n],enumerable:!(i=ru(e,n))||i.enumerable});return t};var su=(t,e,r)=>(r=t!=null?tu(nu(t)):{},cs(e||!t||!t.__esModule?yr(r,"default",{value:t,enumerable:!0}):r,t)),au=t=>cs(yr({},"__esModule",{value:!0}),t);var ks=N(mi=>{"use strict";mi.byteLength=Ud;mi.toByteArray=qd;mi.fromByteArray=zd;var Le=[],be=[],Md=typeof Uint8Array<"u"?Uint8Array:Array,jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(bt=0,vs=jn.length;bt<vs;++bt)Le[bt]=jn[bt],be[jn.charCodeAt(bt)]=bt;var bt,vs;be["-".charCodeAt(0)]=62;be["_".charCodeAt(0)]=63;function As(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}s(As,"getLens");function Ud(t){var e=As(t),r=e[0],i=e[1];return(r+i)*3/4-i}s(Ud,"byteLength");function Wd(t,e,r){return(e+r)*3/4-r}s(Wd,"_byteLength");function qd(t){var e,r=As(t),i=r[0],n=r[1],o=new Md(Wd(t,i,n)),a=0,l=n>0?i-4:i,u;for(u=0;u<l;u+=4)e=be[t.charCodeAt(u)]<<18|be[t.charCodeAt(u+1)]<<12|be[t.charCodeAt(u+2)]<<6|be[t.charCodeAt(u+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=be[t.charCodeAt(u)]<<2|be[t.charCodeAt(u+1)]>>4,o[a++]=e&255),n===1&&(e=be[t.charCodeAt(u)]<<10|be[t.charCodeAt(u+1)]<<4|be[t.charCodeAt(u+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(qd,"toByteArray");function jd(t){return Le[t>>18&63]+Le[t>>12&63]+Le[t>>6&63]+Le[t&63]}s(jd,"tripletToBase64");function $d(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(jd(i));return n.join("")}s($d,"encodeChunk");function zd(t){for(var e,r=t.length,i=r%3,n=[],o=16383,a=0,l=r-i;a<l;a+=o)n.push($d(t,a,a+o>l?l:a+o));return i===1?(e=t[r-1],n.push(Le[e>>2]+Le[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(Le[e>>10]+Le[e>>4&63]+Le[e<<2&63]+"=")),n.join("")}s(zd,"fromByteArray")});var Ns=N($n=>{$n.read=function(t,e,r,i,n){var o,a,l=n*8-i-1,u=(1<<l)-1,f=u>>1,d=-7,h=r?n-1:0,m=r?-1:1,y=t[e+h];for(h+=m,o=y&(1<<-d)-1,y>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=i;d>0;a=a*256+t[e+h],h+=m,d-=8);if(o===0)o=1-f;else{if(o===u)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-f}return(y?-1:1)*a*Math.pow(2,o-i)};$n.write=function(t,e,r,i,n,o){var a,l,u,f=o*8-n-1,d=(1<<f)-1,h=d>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,w=i?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+h>=1?e+=m/u:e+=m*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*u-1)*Math.pow(2,n),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[r+y]=l&255,y+=w,l/=256,n-=8);for(a=a<<n|l,f+=n;f>0;t[r+y]=a&255,y+=w,a/=256,f-=8);t[r+y-w]|=b*128}});var He=N(Jt=>{"use strict";var zn=ks(),Yt=Ns(),Ts=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Jt.Buffer=p;Jt.SlowBuffer=Xd;Jt.INSPECT_MAX_BYTES=50;var bi=2147483647;Jt.kMaxLength=bi;p.TYPED_ARRAY_SUPPORT=Vd();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Vd(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Vd,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function Ve(t){if(t>bi)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}s(Ve,"createBuffer");function p(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Gn(t)}return Cs(t,e,r)}s(p,"Buffer");p.poolSize=8192;function Cs(t,e,r){if(typeof t=="string")return Kd(t,e);if(ArrayBuffer.isView(t))return Gd(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Re(t,ArrayBuffer)||t&&Re(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Re(t,SharedArrayBuffer)||t&&Re(t.buffer,SharedArrayBuffer)))return Hn(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return p.from(i,e,r);let n=Yd(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(Cs,"from");p.from=function(t,e,r){return Cs(t,e,r)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function Ls(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(Ls,"assertSize");function Hd(t,e,r){return Ls(t),t<=0?Ve(t):e!==void 0?typeof r=="string"?Ve(t).fill(e,r):Ve(t).fill(e):Ve(t)}s(Hd,"alloc");p.alloc=function(t,e,r){return Hd(t,e,r)};function Gn(t){return Ls(t),Ve(t<0?0:Yn(t)|0)}s(Gn,"allocUnsafe");p.allocUnsafe=function(t){return Gn(t)};p.allocUnsafeSlow=function(t){return Gn(t)};function Kd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Rs(t,e)|0,i=Ve(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}s(Kd,"fromString");function Vn(t){let e=t.length<0?0:Yn(t.length)|0,r=Ve(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}s(Vn,"fromArrayLike");function Gd(t){if(Re(t,Uint8Array)){let e=new Uint8Array(t);return Hn(e.buffer,e.byteOffset,e.byteLength)}return Vn(t)}s(Gd,"fromArrayView");function Hn(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,p.prototype),i}s(Hn,"fromArrayBuffer");function Yd(t){if(p.isBuffer(t)){let e=Yn(t.length)|0,r=Ve(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Jn(t.length)?Ve(0):Vn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Vn(t.data)}s(Yd,"fromObject");function Yn(t){if(t>=bi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+bi.toString(16)+" bytes");return t|0}s(Yn,"checked");function Xd(t){return+t!=t&&(t=0),p.alloc(+t)}s(Xd,"SlowBuffer");p.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=s(function(e,r){if(Re(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Re(r,Uint8Array)&&(r=p.from(r,r.offset,r.byteLength)),!p.isBuffer(e)||!p.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,a=Math.min(i,n);o<a;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0},"compare");p.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");p.concat=s(function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=p.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let a=e[i];if(Re(a,Uint8Array))o+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(p.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function Rs(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Re(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Kn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return $s(t).length;default:if(n)return i?-1:Kn(t).length;e=(""+e).toLowerCase(),n=!0}}s(Rs,"byteLength");p.byteLength=Rs;function Jd(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return ah(this,e,r);case"utf8":case"utf-8":return Bs(this,e,r);case"ascii":return oh(this,e,r);case"latin1":case"binary":return sh(this,e,r);case"base64":return ih(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lh(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}s(Jd,"slowToString");p.prototype._isBuffer=!0;function gt(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}s(gt,"swap");p.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)gt(this,r,r+1);return this},"swap16");p.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)gt(this,r,r+3),gt(this,r+1,r+2);return this},"swap32");p.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)gt(this,r,r+7),gt(this,r+1,r+6),gt(this,r+2,r+5),gt(this,r+3,r+4);return this},"swap64");p.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?Bs(this,0,e):Jd.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=s(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=s(function(){let e="",r=Jt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Ts&&(p.prototype[Ts]=p.prototype.inspect);p.prototype.compare=s(function(e,r,i,n,o){if(Re(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,l=i-r,u=Math.min(a,l),f=this.slice(n,o),d=e.slice(r,i);for(let h=0;h<u;++h)if(f[h]!==d[h]){a=f[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function Os(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Jn(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,i)),p.isBuffer(e))return e.length===0?-1:Is(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Is(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}s(Os,"bidirectionalIndexOf");function Is(t,e,r,i,n){let o=1,a=t.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}function u(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(u,"read");let f;if(n){let d=-1;for(f=r;f<a;f++)if(u(t,f)===u(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===l)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(r+l>a&&(r=a-l),f=r;f>=0;f--){let d=!0;for(let h=0;h<l;h++)if(u(t,f+h)!==u(e,h)){d=!1;break}if(d)return f}return-1}s(Is,"arrayIndexOf");p.prototype.includes=s(function(e,r,i){return this.indexOf(e,r,i)!==-1},"includes");p.prototype.indexOf=s(function(e,r,i){return Os(this,e,r,i,!0)},"indexOf");p.prototype.lastIndexOf=s(function(e,r,i){return Os(this,e,r,i,!1)},"lastIndexOf");function Qd(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let a;for(a=0;a<i;++a){let l=parseInt(e.substr(a*2,2),16);if(Jn(l))return a;t[r+a]=l}return a}s(Qd,"hexWrite");function Zd(t,e,r,i){return gi(Kn(e,t.length-r),t,r,i)}s(Zd,"utf8Write");function eh(t,e,r,i){return gi(dh(e),t,r,i)}s(eh,"asciiWrite");function th(t,e,r,i){return gi($s(e),t,r,i)}s(th,"base64Write");function rh(t,e,r,i){return gi(hh(e,t.length-r),t,r,i)}s(rh,"ucs2Write");p.prototype.write=s(function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return Qd(this,e,r,i);case"utf8":case"utf-8":return Zd(this,e,r,i);case"ascii":case"latin1":case"binary":return eh(this,e,r,i);case"base64":return th(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rh(this,e,r,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function ih(t,e,r){return e===0&&r===t.length?zn.fromByteArray(t):zn.fromByteArray(t.slice(e,r))}s(ih,"base64Slice");function Bs(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=r){let u,f,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:u=t[n+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(a=h));break;case 3:u=t[n+1],f=t[n+2],(u&192)===128&&(f&192)===128&&(h=(o&15)<<12|(u&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:u=t[n+1],f=t[n+2],d=t[n+3],(u&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(u&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=l}return nh(i)}s(Bs,"utf8Slice");var Ps=4096;function nh(t){let e=t.length;if(e<=Ps)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Ps));return r}s(nh,"decodeCodePointsArray");function oh(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}s(oh,"asciiSlice");function sh(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}s(sh,"latin1Slice");function ah(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=ph[t[o]];return n}s(ah,"hexSlice");function lh(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}s(lh,"utf16leSlice");p.prototype.slice=s(function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,p.prototype),n},"slice");function G(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s(G,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=s(function(e,r,i){e=e>>>0,r=r>>>0,i||G(e,r,this.length);let n=this[e],o=1,a=0;for(;++a<r&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=s(function(e,r,i){e=e>>>0,r=r>>>0,i||G(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=s(function(e,r){return e=e>>>0,r||G(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=s(function(e,r){return e=e>>>0,r||G(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=s(function(e,r){return e=e>>>0,r||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Mr(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Mr(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));p.prototype.readIntLE=s(function(e,r,i){e=e>>>0,r=r>>>0,i||G(e,r,this.length);let n=this[e],o=1,a=0;for(;++a<r&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},"readIntLE");p.prototype.readIntBE=s(function(e,r,i){e=e>>>0,r=r>>>0,i||G(e,r,this.length);let n=r,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a},"readIntBE");p.prototype.readInt8=s(function(e,r){return e=e>>>0,r||G(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=s(function(e,r){e=e>>>0,r||G(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},"readInt16LE");p.prototype.readInt16BE=s(function(e,r){e=e>>>0,r||G(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},"readInt16BE");p.prototype.readInt32LE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Mr(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Mr(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)},"readBigInt64BE"));p.prototype.readFloatLE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),Yt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=s(function(e,r){return e=e>>>0,r||G(e,4,this.length),Yt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=s(function(e,r){return e=e>>>0,r||G(e,8,this.length),Yt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=s(function(e,r){return e=e>>>0,r||G(e,8,this.length),Yt.read(this,e,!1,52,8)},"readDoubleBE");function se(t,e,r,i,n,o){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}s(se,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=s(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;se(this,e,r,i,l,0)}let o=1,a=0;for(this[r]=e&255;++a<i&&(o*=256);)this[r+a]=e/o&255;return r+i},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=s(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;se(this,e,r,i,l,0)}let o=i-1,a=1;for(this[r+o]=e&255;--o>=0&&(a*=256);)this[r+o]=e/a&255;return r+i},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,1,255,0),this[r]=e&255,r+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeUInt32BE");function Ds(t,e,r,i,n){js(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}s(Ds,"wrtBigUInt64LE");function Ms(t,e,r,i,n){js(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}s(Ms,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=lt(s(function(e,r=0){return Ds(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=lt(s(function(e,r=0){return Ms(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=s(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let u=Math.pow(2,8*i-1);se(this,e,r,i,u-1,-u)}let o=0,a=1,l=0;for(this[r]=e&255;++o<i&&(a*=256);)e<0&&l===0&&this[r+o-1]!==0&&(l=1),this[r+o]=(e/a>>0)-l&255;return r+i},"writeIntLE");p.prototype.writeIntBE=s(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let u=Math.pow(2,8*i-1);se(this,e,r,i,u-1,-u)}let o=i-1,a=1,l=0;for(this[r+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[r+o+1]!==0&&(l=1),this[r+o]=(e/a>>0)-l&255;return r+i},"writeIntBE");p.prototype.writeInt8=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},"writeInt8");p.prototype.writeInt16LE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeInt16LE");p.prototype.writeInt16BE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeInt16BE");p.prototype.writeInt32LE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},"writeInt32LE");p.prototype.writeInt32BE=s(function(e,r,i){return e=+e,r=r>>>0,i||se(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeInt32BE");p.prototype.writeBigInt64LE=lt(s(function(e,r=0){return Ds(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=lt(s(function(e,r=0){return Ms(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Us(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}s(Us,"checkIEEE754");function Ws(t,e,r,i,n){return e=+e,r=r>>>0,n||Us(t,e,r,4,34028234663852886e22,-34028234663852886e22),Yt.write(t,e,r,i,23,4),r+4}s(Ws,"writeFloat");p.prototype.writeFloatLE=s(function(e,r,i){return Ws(this,e,r,!0,i)},"writeFloatLE");p.prototype.writeFloatBE=s(function(e,r,i){return Ws(this,e,r,!1,i)},"writeFloatBE");function qs(t,e,r,i,n){return e=+e,r=r>>>0,n||Us(t,e,r,8,17976931348623157e292,-17976931348623157e292),Yt.write(t,e,r,i,52,8),r+8}s(qs,"writeDouble");p.prototype.writeDoubleLE=s(function(e,r,i){return qs(this,e,r,!0,i)},"writeDoubleLE");p.prototype.writeDoubleBE=s(function(e,r,i){return qs(this,e,r,!1,i)},"writeDoubleBE");p.prototype.copy=s(function(e,r,i,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o},"copy");p.prototype.fill=s(function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=a[o%l]}return this},"fill");var Gt={};function Xn(t,e,r){Gt[t]=s(class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(Xn,"E");Xn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Xn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Xn("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Fs(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Fs(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Fs(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}s(Fs,"addNumericalSeparator");function ch(t,e,r){Xt(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Mr(e,t.length-(r+1))}s(ch,"checkBounds");function js(t,e,r,i,n,o){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${r}${a}`,new Gt.ERR_OUT_OF_RANGE("value",l,t)}ch(i,n,o)}s(js,"checkIntBI");function Xt(t,e){if(typeof t!="number")throw new Gt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(Xt,"validateNumber");function Mr(t,e,r){throw Math.floor(t)!==t?(Xt(t,r),new Gt.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Gt.ERR_BUFFER_OUT_OF_BOUNDS:new Gt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}s(Mr,"boundsError");var uh=/[^+/0-9A-Za-z-_]/g;function fh(t){if(t=t.split("=")[0],t=t.trim().replace(uh,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(fh,"base64clean");function Kn(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let a=0;a<i;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}s(Kn,"utf8ToBytes");function dh(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}s(dh,"asciiToBytes");function hh(t,e){let r,i,n,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),i=r>>8,n=r%256,o.push(n),o.push(i);return o}s(hh,"utf16leToBytes");function $s(t){return zn.toByteArray(fh(t))}s($s,"base64ToBytes");function gi(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}s(gi,"blitBuffer");function Re(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(Re,"isInstance");function Jn(t){return t!==t}s(Jn,"numberIsNaN");var ph=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function lt(t){return typeof BigInt>"u"?yh:t}s(lt,"defineBigIntMethod");function yh(){throw new Error("BigInt not supported")}s(yh,"BufferBigIntNotDefined")});var O=N((m_,zs)=>{"use strict";zs.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Qt=N((b_,wi)=>{"use strict";var{AbortController:Vs,AbortSignal:mh}=typeof self<"u"?self:typeof window<"u"?window:void 0;wi.exports=Vs;wi.exports.AbortSignal=mh;wi.exports.default=Vs});var Ur=N((g_,Qn)=>{"use strict";var Zt=typeof Reflect=="object"?Reflect:null,Hs=Zt&&typeof Zt.apply=="function"?Zt.apply:s(function(e,r,i){return Function.prototype.apply.call(e,r,i)},"ReflectApply"),Si;Zt&&typeof Zt.ownKeys=="function"?Si=Zt.ownKeys:Object.getOwnPropertySymbols?Si=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Si=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function bh(t){console&&console.warn&&console.warn(t)}s(bh,"ProcessEmitWarning");var Gs=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function P(){P.init.call(this)}s(P,"EventEmitter");Qn.exports=P;Qn.exports.once=_h;P.EventEmitter=P;P.prototype._events=void 0;P.prototype._eventsCount=0;P.prototype._maxListeners=void 0;var Ks=10;function _i(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(_i,"checkListener");Object.defineProperty(P,"defaultMaxListeners",{enumerable:!0,get:function(){return Ks},set:function(t){if(typeof t!="number"||t<0||Gs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ks=t}});P.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};P.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Gs(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function Ys(t){return t._maxListeners===void 0?P.defaultMaxListeners:t._maxListeners}s(Ys,"_getMaxListeners");P.prototype.getMaxListeners=s(function(){return Ys(this)},"getMaxListeners");P.prototype.emit=s(function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var u=o[e];if(u===void 0)return!1;if(typeof u=="function")Hs(u,this,r);else for(var f=u.length,d=ea(u,f),i=0;i<f;++i)Hs(d[i],this,r);return!0},"emit");function Xs(t,e,r,i){var n,o,a;if(_i(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),a===void 0)a=o[e]=r,++t._eventsCount;else if(typeof a=="function"?a=o[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),n=Ys(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,bh(l)}return t}s(Xs,"_addListener");P.prototype.addListener=s(function(e,r){return Xs(this,e,r,!1)},"addListener");P.prototype.on=P.prototype.addListener;P.prototype.prependListener=s(function(e,r){return Xs(this,e,r,!0)},"prependListener");function gh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}s(gh,"onceWrapper");function Js(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=gh.bind(i);return n.listener=r,i.wrapFn=n,n}s(Js,"_onceWrap");P.prototype.once=s(function(e,r){return _i(r),this.on(e,Js(this,e,r)),this},"once");P.prototype.prependOnceListener=s(function(e,r){return _i(r),this.prependListener(e,Js(this,e,r)),this},"prependOnceListener");P.prototype.removeListener=s(function(e,r){var i,n,o,a,l;if(_i(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(o=-1,a=i.length-1;a>=0;a--)if(i[a]===r||i[a].listener===r){l=i[a].listener,o=a;break}if(o<0)return this;o===0?i.shift():wh(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},"removeListener");P.prototype.off=P.prototype.removeListener;P.prototype.removeAllListeners=s(function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this},"removeAllListeners");function Qs(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Sh(n):ea(n,n.length)}s(Qs,"_listeners");P.prototype.listeners=s(function(e){return Qs(this,e,!0)},"listeners");P.prototype.rawListeners=s(function(e){return Qs(this,e,!1)},"rawListeners");P.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Zs.call(t,e)};P.prototype.listenerCount=Zs;function Zs(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}s(Zs,"listenerCount");P.prototype.eventNames=s(function(){return this._eventsCount>0?Si(this._events):[]},"eventNames");function ea(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}s(ea,"arrayClone");function wh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(wh,"spliceOne");function Sh(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}s(Sh,"unwrapListeners");function _h(t,e){return new Promise(function(r,i){function n(a){t.removeListener(e,o),i(a)}s(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}s(o,"resolver"),ta(t,e,o,{once:!0}),e!=="error"&&Eh(t,n,{once:!0})})}s(_h,"once");function Eh(t,e,r){typeof t.on=="function"&&ta(t,"error",e,r)}s(Eh,"addErrorHandlerIfEventEmitter");function ta(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function n(o){i.once&&t.removeEventListener(e,n),r(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(ta,"eventTargetAgnosticAddListener")});var Z=N((S_,Zn)=>{"use strict";var xh=He(),{kResistStopPropagation:vh,SymbolDispose:Ah}=O(),kh=globalThis.AbortSignal||Qt().AbortSignal,Nh=globalThis.AbortController||Qt().AbortController,Th=Object.getPrototypeOf(async function(){}).constructor,ra=globalThis.Blob||xh.Blob,Ih=s(typeof ra<"u"?function(e){return e instanceof ra}:function(e){return!1},"isBlob"),ia=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Ph=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),Ei=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
2
+ `;super(r),this.name="AggregateError",this.errors=e}};s(Ei,"AggregateError");Zn.exports={AggregateError:Ei,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof Th},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Ih,deprecate(t,e){return t},addAbortListener:Ur().addAbortListener||s(function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);ia(e,"signal"),Ph(r,"listener");let i;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[vh]:!0}),i=s(()=>{e.removeEventListener("abort",r)},"removeEventListener")),{__proto__:null,[Ah](){var n;(n=i)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:kh.any||s(function(e){if(e.length===1)return e[0];let r=new Nh,i=s(()=>r.abort(),"abort");return e.forEach(n=>{ia(n,"signals"),n.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),r.signal},"AbortSignalAny")};Zn.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var re=N((E_,sa)=>{"use strict";var{format:Fh,inspect:vi,AggregateError:Ch}=Z(),Lh=globalThis.AggregateError||Ch,Rh=Symbol("kIsNodeError"),Oh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Bh=/^([A-Z][a-z0-9]*)+$/,Dh="__node_internal_",Ai={};function wt(t,e){if(!t)throw new Ai.ERR_INTERNAL_ASSERTION(e)}s(wt,"assert");function na(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}s(na,"addNumericalSeparator");function Mh(t,e,r){if(typeof e=="function")return wt(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return wt(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:Fh(e,...r)}s(Mh,"getMessage");function Q(t,e,r){r||(r=Error);class i extends r{constructor(...o){super(Mh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(i,"NodeError"),Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[Rh]=!0,Ai[t]=i}s(Q,"E");function oa(t){let e=Dh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(oa,"hideStackFrames");function Uh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new Lh([e,t],e.message);return r.code=e.code,r}return t||e}s(Uh,"aggregateTwoErrors");var xi=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Ai.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};s(xi,"AbortError");Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,r)=>{wt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],a=[];for(let u of e)wt(typeof u=="string","All expected entries have to be of type string"),Oh.includes(u)?n.push(u.toLowerCase()):Bh.test(u)?o.push(u):(wt(u!=="object",'The value "object" should be written as "Object"'),a.push(u));if(o.length>0){let u=n.indexOf("object");u!==-1&&(n.splice(n,u,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let u=n.pop();i+=`one of type ${n.join(", ")}, or ${u}`}}(o.length>0||a.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let u=o.pop();i+=`an instance of ${o.join(", ")}, or ${u}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{let u=a.pop();i+=`one of ${a.join(", ")}, or ${u}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var l;if((l=r.constructor)!==null&&l!==void 0&&l.name)i+=`. Received an instance of ${r.constructor.name}`;else{let u=vi(r,{depth:-1});i+=`. Received ${u}`}}else{let u=vi(r,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),i+=`. Received type ${typeof r} (${u})`}return i},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=vi(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);Q("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);Q("ERR_MISSING_ARGS",(...t)=>{wt(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);Q("ERR_OUT_OF_RANGE",(t,e,r)=>{wt(e,'Missing "range" argument');let i;return Number.isInteger(r)&&Math.abs(r)>2**32?i=na(String(r)):typeof r=="bigint"?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=na(i)),i+="n"):i=vi(r),`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);sa.exports={AbortError:xi,aggregateTwoErrors:oa(Uh),hideStackFrames:oa,codes:Ai}});var tr=N((v_,ma)=>{"use strict";var{ArrayIsArray:to,ArrayPrototypeIncludes:ua,ArrayPrototypeJoin:fa,ArrayPrototypeMap:Wh,NumberIsInteger:ro,NumberIsNaN:qh,NumberMAX_SAFE_INTEGER:jh,NumberMIN_SAFE_INTEGER:$h,NumberParseInt:zh,ObjectPrototypeHasOwnProperty:Vh,RegExpPrototypeExec:da,String:Hh,StringPrototypeToUpperCase:Kh,StringPrototypeTrim:Gh}=O(),{hideStackFrames:ge,codes:{ERR_SOCKET_BAD_PORT:Yh,ERR_INVALID_ARG_TYPE:ee,ERR_INVALID_ARG_VALUE:er,ERR_OUT_OF_RANGE:St,ERR_UNKNOWN_SIGNAL:aa}}=re(),{normalizeEncoding:Xh}=Z(),{isAsyncFunction:Jh,isArrayBufferView:Qh}=Z().types,la={};function Zh(t){return t===(t|0)}s(Zh,"isInt32");function ep(t){return t===t>>>0}s(ep,"isUint32");var tp=/^[0-7]+$/,rp="must be a 32-bit unsigned integer or an octal string";function ip(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(da(tp,t)===null)throw new er(e,t,rp);t=zh(t,8)}return ha(t,e),t}s(ip,"parseFileMode");var np=ge((t,e,r=$h,i=jh)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!ro(t))throw new St(e,"an integer",t);if(t<r||t>i)throw new St(e,`>= ${r} && <= ${i}`,t)}),op=ge((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!ro(t))throw new St(e,"an integer",t);if(t<r||t>i)throw new St(e,`>= ${r} && <= ${i}`,t)}),ha=ge((t,e,r=!1)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!ro(t))throw new St(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new St(e,`>= ${i} && <= ${n}`,t)});function io(t,e){if(typeof t!="string")throw new ee(e,"string",t)}s(io,"validateString");function sp(t,e,r=void 0,i){if(typeof t!="number")throw new ee(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&qh(t))throw new St(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}s(sp,"validateNumber");var ap=ge((t,e,r)=>{if(!ua(r,t)){let n="must be one of: "+fa(Wh(r,o=>typeof o=="string"?`'${o}'`:Hh(o)),", ");throw new er(e,t,n)}});function pa(t,e){if(typeof t!="boolean")throw new ee(e,"boolean",t)}s(pa,"validateBoolean");function eo(t,e,r){return t==null||!Vh(t,e)?r:t[e]}s(eo,"getOwnPropertyValueOrDefault");var lp=ge((t,e,r=null)=>{let i=eo(r,"allowArray",!1),n=eo(r,"allowFunction",!1);if(!eo(r,"nullable",!1)&&t===null||!i&&to(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new ee(e,"Object",t)}),cp=ge((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ee(e,"a dictionary",t)}),ki=ge((t,e,r=0)=>{if(!to(t))throw new ee(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new er(e,t,i)}});function up(t,e){ki(t,e);for(let r=0;r<t.length;r++)io(t[r],`${e}[${r}]`)}s(up,"validateStringArray");function fp(t,e){ki(t,e);for(let r=0;r<t.length;r++)pa(t[r],`${e}[${r}]`)}s(fp,"validateBooleanArray");function dp(t,e){ki(t,e);for(let r=0;r<t.length;r++){let i=t[r],n=`${e}[${r}]`;if(i==null)throw new ee(n,"AbortSignal",i);ya(i,n)}}s(dp,"validateAbortSignalArray");function hp(t,e="signal"){if(io(t,e),la[t]===void 0)throw la[Kh(t)]!==void 0?new aa(t+" (signals must use all capital letters)"):new aa(t)}s(hp,"validateSignalName");var pp=ge((t,e="buffer")=>{if(!Qh(t))throw new ee(e,["Buffer","TypedArray","DataView"],t)});function yp(t,e){let r=Xh(e),i=t.length;if(r==="hex"&&i%2!==0)throw new er("encoding",e,`is invalid for data of length ${i}`)}s(yp,"validateEncoding");function mp(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Gh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Yh(e,t,r);return t|0}s(mp,"validatePort");var ya=ge((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ee(e,"AbortSignal",t)}),bp=ge((t,e)=>{if(typeof t!="function")throw new ee(e,"Function",t)}),gp=ge((t,e)=>{if(typeof t!="function"||Jh(t))throw new ee(e,"Function",t)}),wp=ge((t,e)=>{if(t!==void 0)throw new ee(e,"undefined",t)});function Sp(t,e,r){if(!ua(r,t))throw new ee(e,`('${fa(r,"|")}')`,t)}s(Sp,"validateUnion");var _p=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ca(t,e){if(typeof t>"u"||!da(_p,t))throw new er(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(ca,"validateLinkHeaderFormat");function Ep(t){if(typeof t=="string")return ca(t,"hints"),t;if(to(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];ca(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new er("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Ep,"validateLinkHeaderValue");ma.exports={isInt32:Zh,isUint32:ep,parseFileMode:ip,validateArray:ki,validateStringArray:up,validateBooleanArray:fp,validateAbortSignalArray:dp,validateBoolean:pa,validateBuffer:pp,validateDictionary:cp,validateEncoding:yp,validateFunction:bp,validateInt32:op,validateInteger:np,validateNumber:sp,validateObject:lp,validateOneOf:ap,validatePlainFunction:gp,validatePort:mp,validateSignalName:hp,validateString:io,validateUint32:ha,validateUndefined:wp,validateUnion:Sp,validateAbortSignal:ya,validateLinkHeaderValue:Ep}});var ct=N((k_,Sa)=>{var q=Sa.exports={},Oe,Be;function no(){throw new Error("setTimeout has not been defined")}s(no,"defaultSetTimout");function oo(){throw new Error("clearTimeout has not been defined")}s(oo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Oe=setTimeout:Oe=no}catch{Oe=no}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=oo}catch{Be=oo}})();function ba(t){if(Oe===setTimeout)return setTimeout(t,0);if((Oe===no||!Oe)&&setTimeout)return Oe=setTimeout,setTimeout(t,0);try{return Oe(t,0)}catch{try{return Oe.call(null,t,0)}catch{return Oe.call(this,t,0)}}}s(ba,"runTimeout");function xp(t){if(Be===clearTimeout)return clearTimeout(t);if((Be===oo||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(t);try{return Be(t)}catch{try{return Be.call(null,t)}catch{return Be.call(this,t)}}}s(xp,"runClearTimeout");var Ke=[],rr=!1,_t,Ni=-1;function vp(){!rr||!_t||(rr=!1,_t.length?Ke=_t.concat(Ke):Ni=-1,Ke.length&&ga())}s(vp,"cleanUpNextTick");function ga(){if(!rr){var t=ba(vp);rr=!0;for(var e=Ke.length;e;){for(_t=Ke,Ke=[];++Ni<e;)_t&&_t[Ni].run();Ni=-1,e=Ke.length}_t=null,rr=!1,xp(t)}}s(ga,"drainQueue");q.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ke.push(new wa(t,e)),Ke.length===1&&!rr&&ba(ga)};function wa(t,e){this.fun=t,this.array=e}s(wa,"Item");wa.prototype.run=function(){this.fun.apply(null,this.array)};q.title="browser";q.browser=!0;q.env={};q.argv=[];q.version="";q.versions={};function Ge(){}s(Ge,"noop");q.on=Ge;q.addListener=Ge;q.once=Ge;q.off=Ge;q.removeListener=Ge;q.removeAllListeners=Ge;q.emit=Ge;q.prependListener=Ge;q.prependOnceListener=Ge;q.listeners=function(t){return[]};q.binding=function(t){throw new Error("process.binding is not supported")};q.cwd=function(){return"/"};q.chdir=function(t){throw new Error("process.chdir is not supported")};q.umask=function(){return 0}});var Me=N((T_,Oa)=>{"use strict";var{SymbolAsyncIterator:_a,SymbolIterator:Ea,SymbolFor:Et}=O(),xa=Et("nodejs.stream.destroyed"),va=Et("nodejs.stream.errored"),so=Et("nodejs.stream.readable"),ao=Et("nodejs.stream.writable"),Aa=Et("nodejs.stream.disturbed"),Ap=Et("nodejs.webstream.isClosedPromise"),kp=Et("nodejs.webstream.controllerErrorFunction");function Ti(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}s(Ti,"isReadableNodeStream");function Ii(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(Ii,"isWritableNodeStream");function Np(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Np,"isDuplexNodeStream");function De(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(De,"isNodeStream");function ka(t){return!!(t&&!De(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(ka,"isReadableStream");function Na(t){return!!(t&&!De(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(Na,"isWritableStream");function Ta(t){return!!(t&&!De(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(Ta,"isTransformStream");function Tp(t){return ka(t)||Na(t)||Ta(t)}s(Tp,"isWebStream");function Ip(t,e){return t==null?!1:e===!0?typeof t[_a]=="function":e===!1?typeof t[Ea]=="function":typeof t[_a]=="function"||typeof t[Ea]=="function"}s(Ip,"isIterable");function Pi(t){if(!De(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[xa]||i!=null&&i.destroyed)}s(Pi,"isDestroyed");function Ia(t){if(!Ii(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ia,"isWritableEnded");function Pp(t,e){if(!Ii(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}s(Pp,"isWritableFinished");function Fp(t){if(!Ti(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Fp,"isReadableEnded");function Pa(t,e){if(!Ti(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}s(Pa,"isReadableFinished");function Fa(t){return t&&t[so]!=null?t[so]:typeof t?.readable!="boolean"?null:Pi(t)?!1:Ti(t)&&t.readable&&!Pa(t)}s(Fa,"isReadable");function Ca(t){return t&&t[ao]!=null?t[ao]:typeof t?.writable!="boolean"?null:Pi(t)?!1:Ii(t)&&t.writable&&!Ia(t)}s(Ca,"isWritable");function Cp(t,e){return De(t)?Pi(t)?!0:!(e?.readable!==!1&&Fa(t)||e?.writable!==!1&&Ca(t)):null}s(Cp,"isFinished");function Lp(t){var e,r;return De(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}s(Lp,"isWritableErrored");function Rp(t){var e,r;return De(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}s(Rp,"isReadableErrored");function Op(t){if(!De(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&La(t)?t._closed:null}s(Op,"isClosed");function La(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(La,"isOutgoingMessage");function Ra(t){return typeof t._sent100=="boolean"&&La(t)}s(Ra,"isServerResponse");function Bp(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(Bp,"isServerRequest");function Dp(t){if(!De(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&Ra(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}s(Dp,"willEmitClose");function Mp(t){var e;return!!(t&&((e=t[Aa])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Mp,"isDisturbed");function Up(t){var e,r,i,n,o,a,l,u,f,d;return!!(t&&((e=(r=(i=(n=(o=(a=t[va])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(Up,"isErrored");Oa.exports={isDestroyed:Pi,kIsDestroyed:xa,isDisturbed:Mp,kIsDisturbed:Aa,isErrored:Up,kIsErrored:va,isReadable:Fa,kIsReadable:so,kIsClosedPromise:Ap,kControllerErrorFunction:kp,kIsWritable:ao,isClosed:Op,isDuplexNodeStream:Np,isFinished:Cp,isIterable:Ip,isReadableNodeStream:Ti,isReadableStream:ka,isReadableEnded:Fp,isReadableFinished:Pa,isReadableErrored:Rp,isNodeStream:De,isWebStream:Tp,isWritable:Ca,isWritableNodeStream:Ii,isWritableStream:Na,isWritableEnded:Ia,isWritableFinished:Pp,isWritableErrored:Lp,isServerRequest:Bp,isServerResponse:Ra,willEmitClose:Dp,isTransformStream:Ta}});var Ye=N((P_,ho)=>{var ut=ct(),{AbortError:za,codes:Wp}=re(),{ERR_INVALID_ARG_TYPE:qp,ERR_STREAM_PREMATURE_CLOSE:Ba}=Wp,{kEmptyObject:co,once:uo}=Z(),{validateAbortSignal:jp,validateFunction:$p,validateObject:zp,validateBoolean:Vp}=tr(),{Promise:Hp,PromisePrototypeThen:Kp,SymbolDispose:Va}=O(),{isClosed:Gp,isReadable:Da,isReadableNodeStream:lo,isReadableStream:Yp,isReadableFinished:Ma,isReadableErrored:Ua,isWritable:Wa,isWritableNodeStream:qa,isWritableStream:Xp,isWritableFinished:ja,isWritableErrored:$a,isNodeStream:Jp,willEmitClose:Qp,kIsClosedPromise:Zp}=Me(),ir;function ey(t){return t.setHeader&&typeof t.abort=="function"}s(ey,"isRequest");var fo=s(()=>{},"nop");function Ha(t,e,r){var i,n;if(arguments.length===2?(r=e,e=co):e==null?e=co:zp(e,"options"),$p(r,"callback"),jp(e.signal,"options.signal"),r=uo(r),Yp(t)||Xp(t))return ty(t,e,r);if(!Jp(t))throw new qp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(i=e.readable)!==null&&i!==void 0?i:lo(t),a=(n=e.writable)!==null&&n!==void 0?n:qa(t),l=t._writableState,u=t._readableState,f=s(()=>{t.writable||m()},"onlegacyfinish"),d=Qp(t)&&lo(t)===o&&qa(t)===a,h=ja(t,!1),m=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||y)&&r.call(t)},"onfinish"),y=Ma(t,!1),w=s(()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&r.call(t)},"onend"),b=s($=>{r.call(t,$)},"onerror"),g=Gp(t),S=s(()=>{g=!0;let $=$a(t)||Ua(t);if($&&typeof $!="boolean")return r.call(t,$);if(o&&!y&&lo(t,!0)&&!Ma(t,!1))return r.call(t,new Ba);if(a&&!h&&!ja(t,!1))return r.call(t,new Ba);r.call(t)},"onclose"),I=s(()=>{g=!0;let $=$a(t)||Ua(t);if($&&typeof $!="boolean")return r.call(t,$);r.call(t)},"onclosed"),D=s(()=>{t.req.on("finish",m)},"onrequest");ey(t)?(t.on("complete",m),d||t.on("abort",S),t.req?D():t.on("request",D)):a&&!l&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",b),t.on("close",S),g?ut.nextTick(S):l!=null&&l.errorEmitted||u!=null&&u.errorEmitted?d||ut.nextTick(I):(!o&&(!d||Da(t))&&(h||Wa(t)===!1)||!a&&(!d||Wa(t))&&(y||Da(t)===!1)||u&&t.req&&t.aborted)&&ut.nextTick(I);let k=s(()=>{r=fo,t.removeListener("aborted",S),t.removeListener("complete",m),t.removeListener("abort",S),t.removeListener("request",D),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",b),t.removeListener("close",S)},"cleanup");if(e.signal&&!g){let $=s(()=>{let dt=r;k(),dt.call(t,new za(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ut.nextTick($);else{ir=ir||Z().addAbortListener;let dt=ir(e.signal,$),fe=r;r=uo((...Ct)=>{dt[Va](),fe.apply(t,Ct)})}}return k}s(Ha,"eos");function ty(t,e,r){let i=!1,n=fo;if(e.signal)if(n=s(()=>{i=!0,r.call(t,new za(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ut.nextTick(n);else{ir=ir||Z().addAbortListener;let a=ir(e.signal,n),l=r;r=uo((...u)=>{a[Va](),l.apply(t,u)})}let o=s((...a)=>{i||ut.nextTick(()=>r.apply(t,a))},"resolverFn");return Kp(t[Zp].promise,o,o),fo}s(ty,"eosWeb");function ry(t,e){var r;let i=!1;return e===null&&(e=co),(r=e)!==null&&r!==void 0&&r.cleanup&&(Vp(e.cleanup,"cleanup"),i=e.cleanup),new Hp((n,o)=>{let a=Ha(t,e,l=>{i&&a(),l?o(l):n()})})}s(ry,"finished");ho.exports=Ha;ho.exports.finished=ry});var xt=N((C_,el)=>{"use strict";var Ue=ct(),{aggregateTwoErrors:iy,codes:{ERR_MULTIPLE_CALLBACK:ny},AbortError:oy}=re(),{Symbol:Ya}=O(),{kIsDestroyed:sy,isDestroyed:ay,isFinished:ly,isServerRequest:cy}=Me(),Xa=Ya("kDestroy"),po=Ya("kConstruct");function Ja(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}s(Ja,"checkError");function uy(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Ja(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?Ka(this,t,e):this.once(Xa,function(o){Ka(this,iy(o,t),e)}),this)}s(uy,"destroy");function Ka(t,e,r){let i=!1;function n(o){if(i)return;i=!0;let a=t._readableState,l=t._writableState;Ja(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof r=="function"&&r(o),o?Ue.nextTick(fy,t,o):Ue.nextTick(Qa,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(Ka,"_destroy");function fy(t,e){yo(t,e),Qa(t)}s(fy,"emitErrorCloseNT");function Qa(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(Qa,"emitCloseNT");function yo(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}s(yo,"emitErrorNT");function dy(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(dy,"undestroy");function mo(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?Ue.nextTick(yo,t,e):yo(t,e))}s(mo,"errorOrDestroy");function hy(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(po,e),!(t.listenerCount(po)>1)&&Ue.nextTick(py,t)}s(hy,"construct");function py(t){let e=!1;function r(i){if(e){mo(t,i??new ny);return}e=!0;let n=t._readableState,o=t._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Xa,i):i?mo(t,i,!0):Ue.nextTick(yy,t)}s(r,"onConstruct");try{t._construct(i=>{Ue.nextTick(r,i)})}catch(i){Ue.nextTick(r,i)}}s(py,"constructNT");function yy(t){t.emit(po)}s(yy,"emitConstructNT");function Ga(t){return t?.setHeader&&typeof t.abort=="function"}s(Ga,"isRequest");function Za(t){t.emit("close")}s(Za,"emitCloseLegacy");function my(t,e){t.emit("error",e),Ue.nextTick(Za,t)}s(my,"emitErrorCloseLegacy");function by(t,e){!t||ay(t)||(!e&&!ly(t)&&(e=new oy),cy(t)?(t.socket=null,t.destroy(e)):Ga(t)?t.abort():Ga(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ue.nextTick(my,t,e):Ue.nextTick(Za,t),t.destroyed||(t[sy]=!0))}s(by,"destroyer");el.exports={construct:hy,destroyer:by,destroy:uy,undestroy:dy,errorOrDestroy:mo}});var Li=N((R_,rl)=>{"use strict";var{ArrayIsArray:gy,ObjectSetPrototypeOf:tl}=O(),{EventEmitter:Fi}=Ur();function Ci(t){Fi.call(this,t)}s(Ci,"Stream");tl(Ci.prototype,Fi.prototype);tl(Ci,Fi);Ci.prototype.pipe=function(t,e){let r=this;function i(d){t.writable&&t.write(d)===!1&&r.pause&&r.pause()}s(i,"ondata"),r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}s(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",a),r.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function u(d){f(),Fi.listenerCount(this,"error")===0&&this.emit("error",d)}s(u,"onerror"),bo(r,"error",u),bo(t,"error",u);function f(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",l),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return s(f,"cleanup"),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};function bo(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):gy(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}s(bo,"prependListener");rl.exports={Stream:Ci,prependListener:bo}});var Wr=N((B_,Ri)=>{"use strict";var{SymbolDispose:wy}=O(),{AbortError:il,codes:Sy}=re(),{isNodeStream:nl,isWebStream:_y,kControllerErrorFunction:Ey}=Me(),xy=Ye(),{ERR_INVALID_ARG_TYPE:ol}=Sy,go,vy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new ol(e,"AbortSignal",t)},"validateAbortSignal");Ri.exports.addAbortSignal=s(function(e,r){if(vy(e,"signal"),!nl(r)&&!_y(r))throw new ol("stream",["ReadableStream","WritableStream","Stream"],r);return Ri.exports.addAbortSignalNoValidate(e,r)},"addAbortSignal");Ri.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=nl(e)?()=>{e.destroy(new il(void 0,{cause:t.reason}))}:()=>{e[Ey](new il(void 0,{cause:t.reason}))};if(t.aborted)r();else{go=go||Z().addAbortListener;let i=go(t,r);xy(e,i[wy])}return e}});var ll=N((U_,al)=>{"use strict";var{StringPrototypeSlice:sl,SymbolIterator:Ay,TypedArrayPrototypeSet:Oi,Uint8Array:ky}=O(),{Buffer:wo}=He(),{inspect:Ny}=Z();al.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return wo.alloc(0);let r=wo.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)Oi(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Ay](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",i=this.head,n=0;do{let o=i.data;if(e>o.length)r+=o,e-=o.length;else{e===o.length?(r+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=sl(o,0,e),this.head=i,i.data=sl(o,e));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=wo.allocUnsafe(e),i=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)Oi(r,a,i-e),e-=a.length;else{e===a.length?(Oi(r,a,i-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Oi(r,new ky(a.buffer,a.byteOffset,e),i-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Ny(this,{...r,depth:0,customInspect:!1})}},"BufferList")});var qr=N((q_,dl)=>{"use strict";var{MathFloor:Ty,NumberIsInteger:Iy}=O(),{validateInteger:Py}=tr(),{ERR_INVALID_ARG_VALUE:Fy}=re().codes,cl=16*1024,ul=16;function Cy(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}s(Cy,"highWaterMarkFrom");function fl(t){return t?ul:cl}s(fl,"getDefaultHighWaterMark");function Ly(t,e){Py(e,"value",0),t?ul=e:cl=e}s(Ly,"setDefaultHighWaterMark");function Ry(t,e,r,i){let n=Cy(e,i,r);if(n!=null){if(!Iy(n)||n<0){let o=i?`options.${r}`:"options.highWaterMark";throw new Fy(o,n)}return Ty(n)}return fl(t.objectMode)}s(Ry,"getHighWaterMark");dl.exports={getHighWaterMark:Ry,getDefaultHighWaterMark:fl,setDefaultHighWaterMark:Ly}});var yl=N((So,pl)=>{var Bi=He(),We=Bi.Buffer;function hl(t,e){for(var r in t)e[r]=t[r]}s(hl,"copyProps");We.from&&We.alloc&&We.allocUnsafe&&We.allocUnsafeSlow?pl.exports=Bi:(hl(Bi,So),So.Buffer=vt);function vt(t,e,r){return We(t,e,r)}s(vt,"SafeBuffer");vt.prototype=Object.create(We.prototype);hl(We,vt);vt.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return We(t,e,r)};vt.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=We(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};vt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return We(t)};vt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Bi.SlowBuffer(t)}});var gl=N(bl=>{"use strict";var Eo=yl().Buffer,ml=Eo.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Oy(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Oy,"_normalizeEncoding");function By(t){var e=Oy(t);if(typeof e!="string"&&(Eo.isEncoding===ml||!ml(t)))throw new Error("Unknown encoding: "+t);return e||t}s(By,"normalizeEncoding");bl.StringDecoder=jr;function jr(t){this.encoding=By(t);var e;switch(this.encoding){case"utf16le":this.text=jy,this.end=$y,e=4;break;case"utf8":this.fillLast=Uy,e=4;break;case"base64":this.text=zy,this.end=Vy,e=3;break;default:this.write=Hy,this.end=Ky;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Eo.allocUnsafe(e)}s(jr,"StringDecoder");jr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};jr.prototype.end=qy;jr.prototype.text=Wy;jr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function _o(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(_o,"utf8CheckByte");function Dy(t,e,r){var i=e.length-1;if(i<r)return 0;var n=_o(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=_o(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=_o(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}s(Dy,"utf8CheckIncomplete");function My(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s(My,"utf8CheckExtraBytes");function Uy(t){var e=this.lastTotal-this.lastNeed,r=My(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Uy,"utf8FillLast");function Wy(t,e){var r=Dy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}s(Wy,"utf8Text");function qy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(qy,"utf8End");function jy(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(jy,"utf16Text");function $y(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}s($y,"utf16End");function zy(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}s(zy,"base64Text");function Vy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Vy,"base64End");function Hy(t){return t.toString(this.encoding)}s(Hy,"simpleWrite");function Ky(t){return t&&t.length?this.write(t):""}s(Ky,"simpleEnd")});var xo=N((H_,El)=>{"use strict";var wl=ct(),{PromisePrototypeThen:Gy,SymbolAsyncIterator:Sl,SymbolIterator:_l}=O(),{Buffer:Yy}=He(),{ERR_INVALID_ARG_TYPE:Xy,ERR_STREAM_NULL_VALUES:Jy}=re().codes;function Qy(t,e,r){let i;if(typeof e=="string"||e instanceof Yy)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let n;if(e&&e[Sl])n=!0,i=e[Sl]();else if(e&&e[_l])n=!1,i=e[_l]();else throw new Xy("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),a=!1;o._read=function(){a||(a=!0,u())},o._destroy=function(f,d){Gy(l(f),()=>wl.nextTick(d,f),h=>wl.nextTick(d,h||f))};async function l(f){let d=f!=null,h=typeof i.throw=="function";if(d&&h){let{value:m,done:y}=await i.throw(f);if(await m,y)return}if(typeof i.return=="function"){let{value:m}=await i.return();await m}}s(l,"close");async function u(){for(;;){try{let{value:f,done:d}=n?await i.next():i.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Jy;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(u,"next"),o}s(Qy,"from");El.exports=Qy});var zr=N((G_,Wl)=>{var ke=ct(),{ArrayPrototypeIndexOf:Zy,NumberIsInteger:em,NumberIsNaN:tm,NumberParseInt:rm,ObjectDefineProperties:Fo,ObjectKeys:im,ObjectSetPrototypeOf:Al,Promise:kl,SafeSet:nm,SymbolAsyncDispose:om,SymbolAsyncIterator:sm,Symbol:am}=O();Wl.exports=E;E.ReadableState=Wi;var{EventEmitter:lm}=Ur(),{Stream:ft,prependListener:cm}=Li(),{Buffer:vo}=He(),{addAbortSignal:um}=Wr(),Nl=Ye(),v=Z().debuglog("stream",t=>{v=t}),fm=ll(),sr=xt(),{getHighWaterMark:dm,getDefaultHighWaterMark:hm}=qr(),{aggregateTwoErrors:xl,codes:{ERR_INVALID_ARG_TYPE:pm,ERR_METHOD_NOT_IMPLEMENTED:ym,ERR_OUT_OF_RANGE:mm,ERR_STREAM_PUSH_AFTER_EOF:bm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:gm},AbortError:wm}=re(),{validateObject:Sm}=tr(),At=am("kPaused"),{StringDecoder:Tl}=gl(),_m=xo();Al(E.prototype,ft.prototype);Al(E,ft);var Ao=s(()=>{},"nop"),{errorOrDestroy:nr}=sr,or=1<<0,Em=1<<1,Il=1<<2,$r=1<<3,Pl=1<<4,Di=1<<5,Mi=1<<6,Fl=1<<7,xm=1<<8,vm=1<<9,Am=1<<10,Io=1<<11,Po=1<<12,km=1<<13,Nm=1<<14,Tm=1<<15,Cl=1<<16,Im=1<<17,Pm=1<<18;function z(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(z,"makeBitMapDescriptor");Fo(Wi.prototype,{objectMode:z(or),ended:z(Em),endEmitted:z(Il),reading:z($r),constructed:z(Pl),sync:z(Di),needReadable:z(Mi),emittedReadable:z(Fl),readableListening:z(xm),resumeScheduled:z(vm),errorEmitted:z(Am),emitClose:z(Io),autoDestroy:z(Po),destroyed:z(km),closed:z(Nm),closeEmitted:z(Tm),multiAwaitDrain:z(Cl),readingMore:z(Im),dataEmitted:z(Pm)});function Wi(t,e,r){typeof r!="boolean"&&(r=e instanceof qe()),this.state=Io|Po|Pl|Di,t&&t.objectMode&&(this.state|=or),r&&t&&t.readableObjectMode&&(this.state|=or),this.highWaterMark=t?dm(this,t,"readableHighWaterMark",r):hm(!1),this.buffer=new fm,this.length=0,this.pipes=[],this.flowing=null,this[At]=null,t&&t.emitClose===!1&&(this.state&=~Io),t&&t.autoDestroy===!1&&(this.state&=~Po),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Tl(t.encoding),this.encoding=t.encoding)}s(Wi,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof qe();this._readableState=new Wi(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&um(t.signal,this)),ft.call(this,t),sr.construct(this,()=>{this._readableState.needReadable&&Ui(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=sr.destroy;E.prototype._undestroy=sr.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[lm.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[om]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new wm,this.destroy(t)),new kl((e,r)=>Nl(this,i=>i&&i!==t?r(i):e(null)))};E.prototype.push=function(t,e){return Ll(this,t,e,!1)};E.prototype.unshift=function(t,e){return Ll(this,t,e,!0)};function Ll(t,e,r,i){v("readableAddChunk",e);let n=t._readableState,o;if(n.state&or||(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=vo.from(e,r).toString(n.encoding):(e=vo.from(e,r),r=""))):e instanceof vo?r="":ft._isUint8Array(e)?(e=ft._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new pm("chunk",["string","Buffer","Uint8Array"],e))),o)nr(t,o);else if(e===null)n.state&=~$r,Lm(t,n);else if(n.state&or||e&&e.length>0)if(i)if(n.state&Il)nr(t,new gm);else{if(n.destroyed||n.errored)return!1;ko(t,n,e,!0)}else if(n.ended)nr(t,new bm);else{if(n.destroyed||n.errored)return!1;n.state&=~$r,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?ko(t,n,e,!1):Ui(t,n)):ko(t,n,e,!1)}else i||(n.state&=~$r,Ui(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Ll,"readableAddChunk");function ko(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Cl?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.state&Mi&&qi(t)),Ui(t,e)}s(ko,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[At]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new Tl(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var Fm=1073741824;function Cm(t){if(t>Fm)throw new mm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Cm,"computeNewHighWaterMark");function vl(t,e){return t<=0||e.length===0&&e.ended?0:e.state&or?1:tm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(vl,"howMuchToRead");E.prototype.read=function(t){v("read",t),t===void 0?t=NaN:em(t)||(t=rm(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=Cm(t)),t!==0&&(e.state&=~Fl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return v("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?No(this):qi(this),null;if(t=vl(t,e),t===0&&e.ended)return e.length===0&&No(this),null;let i=(e.state&Mi)!==0;if(v("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,v("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,v("reading, ended or constructing",i);else if(i){v("do read"),e.state|=$r|Di,e.length===0&&(e.state|=Mi);try{this._read(e.highWaterMark)}catch(o){nr(this,o)}e.state&=~Di,e.reading||(t=vl(r,e))}let n;return t>0?n=Ml(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&No(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Lm(t,e){if(v("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?qi(t):(e.needReadable=!1,e.emittedReadable=!0,Rl(t))}}s(Lm,"onEofChunk");function qi(t){let e=t._readableState;v("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(v("emitReadable",e.flowing),e.emittedReadable=!0,ke.nextTick(Rl,t))}s(qi,"emitReadable");function Rl(t){let e=t._readableState;v("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Bl(t)}s(Rl,"emitReadable_");function Ui(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ke.nextTick(Rm,t,e))}s(Ui,"maybeReadMore");function Rm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(v("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}s(Rm,"maybeReadMore_");E.prototype._read=function(t){throw new ym("_read()")};E.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new nm(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),v("pipe count=%d opts=%j",i.pipes.length,e);let o=(!e||e.end!==!1)&&t!==ke.stdout&&t!==ke.stderr?l:g;i.endEmitted?ke.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(S,I){v("onunpipe"),S===r&&I&&I.hasUnpiped===!1&&(I.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){v("onend"),t.end()}s(l,"onend");let u,f=!1;function d(){v("cleanup"),t.removeListener("close",w),t.removeListener("finish",b),u&&t.removeListener("drain",u),t.removeListener("error",y),t.removeListener("unpipe",a),r.removeListener("end",l),r.removeListener("end",g),r.removeListener("data",m),f=!0,u&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&u()}s(d,"cleanup");function h(){f||(i.pipes.length===1&&i.pipes[0]===t?(v("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(v("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),u||(u=Om(r,t),t.on("drain",u))}s(h,"pause"),r.on("data",m);function m(S){v("ondata");let I=t.write(S);v("dest.write",I),I===!1&&h()}s(m,"ondata");function y(S){if(v("onerror",S),g(),t.removeListener("error",y),t.listenerCount("error")===0){let I=t._writableState||t._readableState;I&&!I.errorEmitted?nr(t,S):t.emit("error",S)}}s(y,"onerror"),cm(t,"error",y);function w(){t.removeListener("finish",b),g()}s(w,"onclose"),t.once("close",w);function b(){v("onfinish"),t.removeListener("close",w),g()}s(b,"onfinish"),t.once("finish",b);function g(){v("unpipe"),r.unpipe(t)}return s(g,"unpipe"),t.emit("pipe",r),t.writableNeedDrain===!0?h():i.flowing||(v("pipe resume"),r.resume()),t};function Om(t,e){return s(function(){let i=t._readableState;i.awaitDrainWriters===e?(v("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(v("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Om,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=Zy(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};E.prototype.on=function(t,e){let r=ft.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,v("on readable",i.length,i.reading),i.length?qi(this):i.reading||ke.nextTick(Bm,this)),r};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let r=ft.prototype.removeListener.call(this,t,e);return t==="readable"&&ke.nextTick(Ol,this),r};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=ft.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ke.nextTick(Ol,this),e};function Ol(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[At]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Ol,"updateReadableListening");function Bm(t){v("readable nexttick read 0"),t.read(0)}s(Bm,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(v("resume"),t.flowing=!t.readableListening,Dm(this,t)),t[At]=!1,this};function Dm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ke.nextTick(Mm,t,e))}s(Dm,"resume");function Mm(t,e){v("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Bl(t),e.flowing&&!e.reading&&t.read(0)}s(Mm,"resume_");E.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[At]=!0,this};function Bl(t){let e=t._readableState;for(v("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Bl,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{nr(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=im(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};E.prototype[sm]=function(){return Dl(this)};E.prototype.iterator=function(t){return t!==void 0&&Sm(t,"options"),Dl(this,t)};function Dl(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let r=Um(t,e);return r.stream=t,r}s(Dl,"streamToAsyncIterator");async function*Um(t,e){let r=Ao;function i(a){this===t?(r(),r=Ao):r=a}s(i,"next"),t.on("readable",i);let n,o=Nl(t,{writable:!1},a=>{n=a?xl(n,a):null,r(),r=Ao});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new kl(i)}}}catch(a){throw n=xl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?sr.destroyer(t,null):(t.off("readable",i),o())}}s(Um,"createAsyncIterator");Fo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Fo(Wi.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[At]!==!1},set(t){this[At]=!!t}}});E._fromList=Ml;function Ml(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}s(Ml,"fromList");function No(t){let e=t._readableState;v("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ke.nextTick(Wm,e,t))}s(No,"endReadable");function Wm(t,e){if(v("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ke.nextTick(qm,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}s(Wm,"endReadableNT");function qm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(qm,"endWritableNT");E.from=function(t,e){return _m(E,t,e)};var To;function Ul(){return To===void 0&&(To={}),To}s(Ul,"lazyWebStreams");E.fromWeb=function(t,e){return Ul().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return Ul().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var r,i;return new E({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(n,o){sr.destroyer(t,n),o(n)}}).wrap(t)}});var Hi=N((X_,Ql)=>{var kt=ct(),{ArrayPrototypeSlice:$l,Error:jm,FunctionPrototypeSymbolHasInstance:zl,ObjectDefineProperty:Vl,ObjectDefineProperties:$m,ObjectSetPrototypeOf:Hl,StringPrototypeToLowerCase:zm,Symbol:Vm,SymbolHasInstance:Hm}=O();Ql.exports=B;B.WritableState=Kr;var{EventEmitter:Km}=Ur(),Vr=Li().Stream,{Buffer:ji}=He(),Vi=xt(),{addAbortSignal:Gm}=Wr(),{getHighWaterMark:Ym,getDefaultHighWaterMark:Xm}=qr(),{ERR_INVALID_ARG_TYPE:Jm,ERR_METHOD_NOT_IMPLEMENTED:Qm,ERR_MULTIPLE_CALLBACK:Kl,ERR_STREAM_CANNOT_PIPE:Zm,ERR_STREAM_DESTROYED:Hr,ERR_STREAM_ALREADY_FINISHED:eb,ERR_STREAM_NULL_VALUES:tb,ERR_STREAM_WRITE_AFTER_END:rb,ERR_UNKNOWN_ENCODING:Gl}=re().codes,{errorOrDestroy:ar}=Vi;Hl(B.prototype,Vr.prototype);Hl(B,Vr);function Ro(){}s(Ro,"nop");var lr=Vm("kOnFinished");function Kr(t,e,r){typeof r!="boolean"&&(r=e instanceof qe()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Ym(this,t,"writableHighWaterMark",r):Xm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=nb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,zi(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[lr]=[]}s(Kr,"WritableState");function zi(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(zi,"resetBuffer");Kr.prototype.getBuffer=s(function(){return $l(this.buffered,this.bufferedIndex)},"getBuffer");Vl(Kr.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function B(t){let e=this instanceof qe();if(!e&&!zl(B,this))return new B(t);this._writableState=new Kr(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Gm(t.signal,this)),Vr.call(this,t),Vi.construct(this,()=>{let r=this._writableState;r.writing||Bo(this,r),Do(this,r)})}s(B,"Writable");Vl(B,Hm,{__proto__:null,value:function(t){return zl(this,t)?!0:this!==B?!1:t&&t._writableState instanceof Kr}});B.prototype.pipe=function(){ar(this,new Zm)};function Yl(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!ji.isEncoding(r))throw new Gl(r);typeof i!="function"&&(i=Ro)}if(e===null)throw new tb;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=ji.from(e,r),r="buffer");else if(e instanceof ji)r="buffer";else if(Vr._isUint8Array(e))e=Vr._uint8ArrayToBuffer(e),r="buffer";else throw new Jm("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new rb:n.destroyed&&(o=new Hr("write")),o?(kt.nextTick(i,o),ar(t,o,!0),o):(n.pendingcb++,ib(t,n,e,r,i))}s(Yl,"_write");B.prototype.write=function(t,e,r){return Yl(this,t,e,r)===!0};B.prototype.cork=function(){this._writableState.corked++};B.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Bo(this,t))};B.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=zm(e)),!ji.isEncoding(e))throw new Gl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function ib(t,e,r,i,n){let o=e.objectMode?1:r.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Ro&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(ib,"writeOrBuffer");function ql(t,e,r,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Hr("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s(ql,"doWrite");function jl(t,e,r,i){--e.pendingcb,i(r),Oo(e),ar(t,r)}s(jl,"onwriteError");function nb(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){ar(t,new Kl);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?kt.nextTick(jl,t,r,e,n):jl(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&Bo(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},kt.nextTick(ob,r.afterWriteTickInfo)):Xl(t,r,1,n))}s(nb,"onwrite");function ob({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,Xl(t,e,r,i)}s(ob,"afterWriteTick");function Xl(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&Oo(e),Do(t,e)}s(Xl,"afterWrite");function Oo(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:a}=t.buffered[n],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Hr("write"))}let r=t[lr].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new Hr("end"))}zi(t)}s(Oo,"errorBuffer");function Bo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,o=r.length-i;if(!o)return;let a=i;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Ro:f=>{for(let d=a;d<r.length;++d)r[d].callback(f)},u=e.allNoop&&a===0?r:$l(r,a);u.allBuffers=e.allBuffers,ql(t,e,!0,e.length,u,"",l),zi(e)}else{do{let{chunk:l,encoding:u,callback:f}=r[a];r[a++]=null;let d=n?1:l.length;ql(t,e,!1,d,l,u,f)}while(a<r.length&&!e.writing);a===r.length?zi(e):a>256?(r.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Bo,"clearBuffer");B.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Qm("_write()")};B.prototype._writev=null;B.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let o=Yl(this,t,e);o instanceof jm&&(n=o)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,Do(this,i,!0),i.ended=!0):i.finished?n=new eb("end"):i.destroyed&&(n=new Hr("end"))),typeof r=="function"&&(n||i.finished?kt.nextTick(r,n):i[lr].push(r)),this};function $i(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s($i,"needFinish");function sb(t,e){let r=!1;function i(n){if(r){ar(t,n??Kl());return}if(r=!0,e.pendingcb--,n){let o=e[lr].splice(0);for(let a=0;a<o.length;a++)o[a](n);ar(t,n,e.sync)}else $i(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,kt.nextTick(Lo,t,e))}s(i,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(i)}catch(n){i(n)}e.sync=!1}s(sb,"callFinal");function ab(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,sb(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(ab,"prefinish");function Do(t,e,r){$i(e)&&(ab(t,e),e.pendingcb===0&&(r?(e.pendingcb++,kt.nextTick((i,n)=>{$i(n)?Lo(i,n):n.pendingcb--},t,e)):$i(e)&&(e.pendingcb++,Lo(t,e))))}s(Do,"finishMaybe");function Lo(t,e){e.pendingcb--,e.finished=!0;let r=e[lr].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}s(Lo,"finish");$m(B.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var lb=Vi.destroy;B.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[lr].length)&&kt.nextTick(Oo,r),lb.call(this,t,e),this};B.prototype._undestroy=Vi.undestroy;B.prototype._destroy=function(t,e){e(t)};B.prototype[Km.captureRejectionSymbol]=function(t){this.destroy(t)};var Co;function Jl(){return Co===void 0&&(Co={}),Co}s(Jl,"lazyWebStreams");B.fromWeb=function(t,e){return Jl().newStreamWritableFromWritableStream(t,e)};B.toWeb=function(t){return Jl().newWritableStreamFromStreamWritable(t)}});var hc=N((Q_,dc)=>{var Mo=ct(),cb=He(),{isReadable:ub,isWritable:fb,isIterable:Zl,isNodeStream:db,isReadableNodeStream:ec,isWritableNodeStream:tc,isDuplexNodeStream:hb,isReadableStream:rc,isWritableStream:ic}=Me(),nc=Ye(),{AbortError:uc,codes:{ERR_INVALID_ARG_TYPE:pb,ERR_INVALID_RETURN_VALUE:oc}}=re(),{destroyer:ur}=xt(),yb=qe(),fc=zr(),mb=Hi(),{createDeferredPromise:sc}=Z(),ac=xo(),lc=globalThis.Blob||cb.Blob,bb=s(typeof lc<"u"?function(e){return e instanceof lc}:function(e){return!1},"isBlob"),gb=globalThis.AbortController||Qt().AbortController,{FunctionPrototypeCall:cc}=O(),Xe=class extends yb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(Xe,"Duplexify");dc.exports=s(function t(e,r){if(hb(e))return e;if(ec(e))return cr({readable:e});if(tc(e))return cr({writable:e});if(db(e))return cr({writable:!1,readable:!1});if(rc(e))return cr({readable:fc.fromWeb(e)});if(ic(e))return cr({writable:mb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:l}=wb(e);if(Zl(n))return ac(Xe,n,{objectMode:!0,write:o,final:a,destroy:l});let u=n?.then;if(typeof u=="function"){let f,d=cc(u,n,h=>{if(h!=null)throw new oc("nully","body",h)},h=>{ur(f,h)});return f=new Xe({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,Mo.nextTick(h,null)}catch(m){Mo.nextTick(h,m)}})},destroy:l})}throw new oc("Iterable, AsyncIterable or AsyncFunction",r,n)}if(bb(e))return t(e.arrayBuffer());if(Zl(e))return ac(Xe,e,{objectMode:!0,writable:!1});if(rc(e?.readable)&&ic(e?.writable))return Xe.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?ec(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?tc(e?.writable)?e?.writable:t(e.writable):void 0;return cr({readable:n,writable:o})}let i=e?.then;if(typeof i=="function"){let n;return cc(i,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{ur(n,o)}),n=new Xe({objectMode:!0,writable:!1,read(){}})}throw new pb(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function wb(t){let{promise:e,resolve:r}=sc(),i=new gb,n=i.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:u,cb:f}=await a;if(Mo.nextTick(f),u)return;if(n.aborted)throw new uc(void 0,{cause:n.reason});({promise:e,resolve:r}=sc()),yield l}}(),{signal:n}),write(a,l,u){let f=r;r=null,f({chunk:a,done:!1,cb:u})},final(a){let l=r;r=null,l({done:!0,cb:a})},destroy(a,l){i.abort(),l(a)}}}s(wb,"fromAsyncGen");function cr(t){let e=t.readable&&typeof t.readable.read!="function"?fc.wrap(t.readable):t.readable,r=t.writable,i=!!ub(e),n=!!fb(r),o,a,l,u,f;function d(h){let m=u;u=null,m?m(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Xe({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(nc(r,h=>{n=!1,h&&ur(e,h),d(h)}),f._write=function(h,m,y){r.write(h,m)?y():o=y},f._final=function(h){r.end(),a=h},r.on("drain",function(){if(o){let h=o;o=null,h()}}),r.on("finish",function(){if(a){let h=a;a=null,h()}})),i&&(nc(e,h=>{i=!1,h&&ur(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){l=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,m){!h&&u!==null&&(h=new uc),l=null,o=null,a=null,u===null?m(h):(u=m,ur(r,h),ur(e,h))},f}s(cr,"_duplexify")});var qe=N((e0,mc)=>{"use strict";var{ObjectDefineProperties:Sb,ObjectGetOwnPropertyDescriptor:Je,ObjectKeys:_b,ObjectSetPrototypeOf:pc}=O();mc.exports=Ne;var qo=zr(),we=Hi();pc(Ne.prototype,qo.prototype);pc(Ne,qo);{let t=_b(we.prototype);for(let e=0;e<t.length;e++){let r=t[e];Ne.prototype[r]||(Ne.prototype[r]=we.prototype[r])}}function Ne(t){if(!(this instanceof Ne))return new Ne(t);qo.call(this,t),we.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Ne,"Duplex");Sb(Ne.prototype,{writable:{__proto__:null,...Je(we.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Je(we.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Je(we.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Je(we.prototype,"writableBuffer")},writableLength:{__proto__:null,...Je(we.prototype,"writableLength")},writableFinished:{__proto__:null,...Je(we.prototype,"writableFinished")},writableCorked:{__proto__:null,...Je(we.prototype,"writableCorked")},writableEnded:{__proto__:null,...Je(we.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Je(we.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Uo;function yc(){return Uo===void 0&&(Uo={}),Uo}s(yc,"lazyWebStreams");Ne.fromWeb=function(t,e){return yc().newStreamDuplexFromReadableWritablePair(t,e)};Ne.toWeb=function(t){return yc().newReadableWritablePairFromDuplex(t)};var Wo;Ne.from=function(t){return Wo||(Wo=hc()),Wo(t,"body")}});var zo=N((r0,gc)=>{"use strict";var{ObjectSetPrototypeOf:bc,Symbol:Eb}=O();gc.exports=Qe;var{ERR_METHOD_NOT_IMPLEMENTED:xb}=re().codes,$o=qe(),{getHighWaterMark:vb}=qr();bc(Qe.prototype,$o.prototype);bc(Qe,$o);var Gr=Eb("kCallback");function Qe(t){if(!(this instanceof Qe))return new Qe(t);let e=t?vb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),$o.call(this,t),this._readableState.sync=!1,this[Gr]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Ab)}s(Qe,"Transform");function jo(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}s(jo,"final");function Ab(){this._final!==jo&&jo.call(this)}s(Ab,"prefinish");Qe.prototype._final=jo;Qe.prototype._transform=function(t,e,r){throw new xb("_transform()")};Qe.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,o=i.length;this._transform(t,e,(a,l)=>{if(a){r(a);return}l!=null&&this.push(l),n.ended||o===i.length||i.length<i.highWaterMark?r():this[Gr]=r})};Qe.prototype._read=function(){if(this[Gr]){let t=this[Gr];this[Gr]=null,t()}}});var Ho=N((n0,Sc)=>{"use strict";var{ObjectSetPrototypeOf:wc}=O();Sc.exports=fr;var Vo=zo();wc(fr.prototype,Vo.prototype);wc(fr,Vo);function fr(t){if(!(this instanceof fr))return new fr(t);Vo.call(this,t)}s(fr,"PassThrough");fr.prototype._transform=function(t,e,r){r(null,t)}});var Xi=N((s0,Ac)=>{var Yr=ct(),{ArrayIsArray:kb,Promise:Nb,SymbolAsyncIterator:Tb,SymbolDispose:Ib}=O(),Yi=Ye(),{once:Pb}=Z(),Fb=xt(),_c=qe(),{aggregateTwoErrors:Cb,codes:{ERR_INVALID_ARG_TYPE:ts,ERR_INVALID_RETURN_VALUE:Ko,ERR_MISSING_ARGS:Lb,ERR_STREAM_DESTROYED:Rb,ERR_STREAM_PREMATURE_CLOSE:Ob},AbortError:Bb}=re(),{validateFunction:Db,validateAbortSignal:Mb}=tr(),{isIterable:Nt,isReadable:Go,isReadableNodeStream:Gi,isNodeStream:Ec,isTransformStream:dr,isWebStream:Ub,isReadableStream:Yo,isReadableFinished:Wb}=Me(),qb=globalThis.AbortController||Qt().AbortController,Xo,Jo,Qo;function xc(t,e,r){let i=!1;t.on("close",()=>{i=!0});let n=Yi(t,{readable:e,writable:r},o=>{i=!o});return{destroy:o=>{i||(i=!0,Fb.destroyer(t,o||new Rb("pipe")))},cleanup:n}}s(xc,"destroyer");function jb(t){return Db(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(jb,"popCallback");function Zo(t){if(Nt(t))return t;if(Gi(t))return $b(t);throw new ts("val",["Readable","Iterable","AsyncIterable"],t)}s(Zo,"makeAsyncIterable");async function*$b(t){Jo||(Jo=zr()),yield*Jo.prototype[Tb].call(t)}s($b,"fromReadable");async function Ki(t,e,r,{end:i}){let n,o=null,a=s(f=>{if(f&&(n=f),o){let d=o;o=null,d()}},"resume"),l=s(()=>new Nb((f,d)=>{n?d(n):o=s(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let u=Yi(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let f of t)e.write(f)||await l();i&&(e.end(),await l()),r()}catch(f){r(n!==f?Cb(n,f):f)}finally{u(),e.off("drain",a)}}s(Ki,"pumpToNode");async function es(t,e,r,{end:i}){dr(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),r()}catch(o){try{await n.abort(o),r(o)}catch(a){r(a)}}}s(es,"pumpToWeb");function zb(...t){return vc(t,Pb(jb(t)))}s(zb,"pipeline");function vc(t,e,r){if(t.length===1&&kb(t[0])&&(t=t[0]),t.length<2)throw new Lb("streams");let i=new qb,n=i.signal,o=r?.signal,a=[];Mb(o,"options.signal");function l(){w(new Bb)}s(l,"abort"),Qo=Qo||Z().addAbortListener;let u;o&&(u=Qo(o,l));let f,d,h=[],m=0;function y(D){w(D,--m===0)}s(y,"finish");function w(D,k){var $;if(D&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=D),!(!f&&!k)){for(;h.length;)h.shift()(f);($=u)===null||$===void 0||$[Ib](),i.abort(),k&&(f||a.forEach(dt=>dt()),Yr.nextTick(e,f,d))}}s(w,"finishImpl");let b;for(let D=0;D<t.length;D++){let k=t[D],$=D<t.length-1,dt=D>0,fe=$||r?.end!==!1,Ct=D===t.length-1;if(Ec(k)){let ie=function($e){$e&&$e.name!=="AbortError"&&$e.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y($e)};var I=ie;if(s(ie,"onError"),fe){let{destroy:$e,cleanup:ln}=xc(k,$,dt);h.push($e),Go(k)&&Ct&&a.push(ln)}k.on("error",ie),Go(k)&&Ct&&a.push(()=>{k.removeListener("error",ie)})}if(D===0)if(typeof k=="function"){if(b=k({signal:n}),!Nt(b))throw new Ko("Iterable, AsyncIterable or Stream","source",b)}else Nt(k)||Gi(k)||dr(k)?b=k:b=_c.from(k);else if(typeof k=="function"){if(dr(b)){var g;b=Zo((g=b)===null||g===void 0?void 0:g.readable)}else b=Zo(b);if(b=k(b,{signal:n}),$){if(!Nt(b,!0))throw new Ko("AsyncIterable",`transform[${D-1}]`,b)}else{var S;Xo||(Xo=Ho());let ie=new Xo({objectMode:!0}),$e=(S=b)===null||S===void 0?void 0:S.then;if(typeof $e=="function")m++,$e.call(b,tt=>{d=tt,tt!=null&&ie.write(tt),fe&&ie.end(),Yr.nextTick(y)},tt=>{ie.destroy(tt),Yr.nextTick(y,tt)});else if(Nt(b,!0))m++,Ki(b,ie,y,{end:fe});else if(Yo(b)||dr(b)){let tt=b.readable||b;m++,Ki(tt,ie,y,{end:fe})}else throw new Ko("AsyncIterable or Promise","destination",b);b=ie;let{destroy:ln,cleanup:eu}=xc(b,!1,!0);h.push(ln),Ct&&a.push(eu)}}else if(Ec(k)){if(Gi(b)){m+=2;let ie=Vb(b,k,y,{end:fe});Go(k)&&Ct&&a.push(ie)}else if(dr(b)||Yo(b)){let ie=b.readable||b;m++,Ki(ie,k,y,{end:fe})}else if(Nt(b))m++,Ki(b,k,y,{end:fe});else throw new ts("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=k}else if(Ub(k)){if(Gi(b))m++,es(Zo(b),k,y,{end:fe});else if(Yo(b)||Nt(b))m++,es(b,k,y,{end:fe});else if(dr(b))m++,es(b.readable,k,y,{end:fe});else throw new ts("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=k}else b=_c.from(k)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Yr.nextTick(l),b}s(vc,"pipelineImpl");function Vb(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new Ob)}),t.pipe(e,{end:!1}),i){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Wb(t)?Yr.nextTick(a):t.once("end",a)}else r();return Yi(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",r).once("error",r):r(a)}),Yi(e,{readable:!1,writable:!0},r)}s(Vb,"pipe");Ac.exports={pipelineImpl:vc,pipeline:zb}});var is=N((l0,Fc)=>{"use strict";var{pipeline:Hb}=Xi(),Ji=qe(),{destroyer:Kb}=xt(),{isNodeStream:Qi,isReadable:kc,isWritable:Nc,isWebStream:rs,isTransformStream:Tt,isWritableStream:Tc,isReadableStream:Ic}=Me(),{AbortError:Gb,codes:{ERR_INVALID_ARG_VALUE:Pc,ERR_MISSING_ARGS:Yb}}=re(),Xb=Ye();Fc.exports=s(function(...e){if(e.length===0)throw new Yb("streams");if(e.length===1)return Ji.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Ji.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=Ji.from(e[y])}for(let y=0;y<e.length;++y)if(!(!Qi(e[y])&&!rs(e[y]))){if(y<e.length-1&&!(kc(e[y])||Ic(e[y])||Tt(e[y])))throw new Pc(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(Nc(e[y])||Tc(e[y])||Tt(e[y])))throw new Pc(`streams[${y}]`,r[y],"must be writable")}let i,n,o,a,l;function u(y){let w=a;a=null,w?w(y):y?l.destroy(y):!m&&!h&&l.destroy()}s(u,"onfinished");let f=e[0],d=Hb(e,u),h=!!(Nc(f)||Tc(f)||Tt(f)),m=!!(kc(d)||Ic(d)||Tt(d));if(l=new Ji({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(Qi(f))l._write=function(w,b,g){f.write(w,b)?g():i=g},l._final=function(w){f.end(),n=w},f.on("drain",function(){if(i){let w=i;i=null,w()}});else if(rs(f)){let b=(Tt(f)?f.writable:f).getWriter();l._write=async function(g,S,I){try{await b.ready,b.write(g).catch(()=>{}),I()}catch(D){I(D)}},l._final=async function(g){try{await b.ready,b.close().catch(()=>{}),n=g}catch(S){g(S)}}}let y=Tt(d)?d.readable:d;Xb(y,()=>{if(n){let w=n;n=null,w()}})}if(m){if(Qi(d))d.on("readable",function(){if(o){let y=o;o=null,y()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let y=d.read();if(y===null){o=l._read;return}if(!l.push(y))return}};else if(rs(d)){let w=(Tt(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:b,done:g}=await w.read();if(!l.push(b))return;if(g){l.push(null);return}}catch{return}}}}return l._destroy=function(y,w){!y&&a!==null&&(y=new Gb),o=null,i=null,n=null,a===null?w(y):(a=w,Qi(d)&&Kb(d,y))},l},"compose")});var qc=N((u0,os)=>{"use strict";var Jb=globalThis.AbortController||Qt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Qb,ERR_INVALID_ARG_TYPE:Xr,ERR_MISSING_ARGS:Zb,ERR_OUT_OF_RANGE:eg},AbortError:je}=re(),{validateAbortSignal:It,validateInteger:Cc,validateObject:Pt}=tr(),tg=O().Symbol("kWeak"),rg=O().Symbol("kResistStopPropagation"),{finished:ig}=Ye(),ng=is(),{addAbortSignalNoValidate:og}=Wr(),{isWritable:sg,isNodeStream:ag}=Me(),{deprecate:lg}=Z(),{ArrayPrototypePush:cg,Boolean:ug,MathFloor:Lc,Number:fg,NumberIsNaN:dg,Promise:Rc,PromiseReject:Oc,PromiseResolve:hg,PromisePrototypeThen:Bc,Symbol:Mc}=O(),en=Mc("kEmpty"),Dc=Mc("kEof");function pg(t,e){if(e!=null&&Pt(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),ag(t)&&!sg(t))throw new Qb("stream",t,"must be writable");let r=ng(this,t);return e!=null&&e.signal&&og(e.signal,r),r}s(pg,"compose");function tn(t,e){if(typeof t!="function")throw new Xr("fn",["Function","AsyncFunction"],t);e!=null&&Pt(e,"options"),e?.signal!=null&&It(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=Lc(e.concurrency));let i=r-1;return e?.highWaterMark!=null&&(i=Lc(e.highWaterMark)),Cc(r,"options.concurrency",1),Cc(i,"options.highWaterMark",0),i+=r,s(async function*(){let o=Z().AbortSignalAny([e?.signal].filter(ug)),a=this,l=[],u={signal:o},f,d,h=!1,m=0;function y(){h=!0,w()}s(y,"onCatch");function w(){m-=1,b()}s(w,"afterItemProcessed");function b(){d&&!h&&m<r&&l.length<i&&(d(),d=null)}s(b,"maybeResume");async function g(){try{for await(let S of a){if(h)return;if(o.aborted)throw new je;try{if(S=t(S,u),S===en)continue;S=hg(S)}catch(I){S=Oc(I)}m+=1,Bc(S,w,y),l.push(S),f&&(f(),f=null),!h&&(l.length>=i||m>=r)&&await new Rc(I=>{d=I})}l.push(Dc)}catch(S){let I=Oc(S);Bc(I,w,y),l.push(I)}finally{h=!0,f&&(f(),f=null)}}s(g,"pump"),g();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===Dc)return;if(o.aborted)throw new je;S!==en&&(yield S),l.shift(),b()}await new Rc(S=>{f=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(tn,"map");function yg(t=void 0){return t!=null&&Pt(t,"options"),t?.signal!=null&&It(t.signal,"options.signal"),s(async function*(){let r=0;for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new je({cause:t.signal.reason});yield[r++,n]}},"asIndexedPairs").call(this)}s(yg,"asIndexedPairs");async function Uc(t,e=void 0){for await(let r of ns.call(this,t,e))return!0;return!1}s(Uc,"some");async function mg(t,e=void 0){if(typeof t!="function")throw new Xr("fn",["Function","AsyncFunction"],t);return!await Uc.call(this,async(...r)=>!await t(...r),e)}s(mg,"every");async function bg(t,e){for await(let r of ns.call(this,t,e))return r}s(bg,"find");async function gg(t,e){if(typeof t!="function")throw new Xr("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n),en}s(r,"forEachFn");for await(let i of tn.call(this,r,e));}s(gg,"forEach");function ns(t,e){if(typeof t!="function")throw new Xr("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:en}return s(r,"filterFn"),tn.call(this,r,e)}s(ns,"filter");var Zi=class extends Zb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(Zi,"ReduceAwareErrMissingArgs");async function wg(t,e,r){var i;if(typeof t!="function")throw new Xr("reducer",["Function","AsyncFunction"],t);r!=null&&Pt(r,"options"),r?.signal!=null&&It(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let f=new je(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await ig(this.destroy(f)),f}let o=new Jb,a=o.signal;if(r!=null&&r.signal){let f={once:!0,[tg]:this,[rg]:!0};r.signal.addEventListener("abort",()=>o.abort(),f)}let l=!1;try{for await(let f of this){var u;if(l=!0,r!=null&&(u=r.signal)!==null&&u!==void 0&&u.aborted)throw new je;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!l&&!n)throw new Zi}finally{o.abort()}return e}s(wg,"reduce");async function Sg(t){t!=null&&Pt(t,"options"),t?.signal!=null&&It(t.signal,"options.signal");let e=[];for await(let i of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new je(void 0,{cause:t.signal.reason});cg(e,i)}return e}s(Sg,"toArray");function _g(t,e){let r=tn.call(this,t,e);return s(async function*(){for await(let n of r)yield*n},"flatMap").call(this)}s(_g,"flatMap");function Wc(t){if(t=fg(t),dg(t))return 0;if(t<0)throw new eg("number",">= 0",t);return t}s(Wc,"toIntegerOrInfinity");function Eg(t,e=void 0){return e!=null&&Pt(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),t=Wc(t),s(async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;t--<=0&&(yield o)}},"drop").call(this)}s(Eg,"drop");function xg(t,e=void 0){return e!=null&&Pt(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),t=Wc(t),s(async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(xg,"take");os.exports.streamReturningOperators={asIndexedPairs:lg(yg,"readable.asIndexedPairs will be removed in a future version."),drop:Eg,filter:ns,flatMap:_g,map:tn,take:xg,compose:pg};os.exports.promiseReturningOperators={every:mg,forEach:gg,reduce:wg,toArray:Sg,some:Uc,find:bg}});var ss=N((d0,jc)=>{"use strict";var{ArrayPrototypePop:vg,Promise:Ag}=O(),{isIterable:kg,isNodeStream:Ng,isWebStream:Tg}=Me(),{pipelineImpl:Ig}=Xi(),{finished:Pg}=Ye();as();function Fg(...t){return new Ag((e,r)=>{let i,n,o=t[t.length-1];if(o&&typeof o=="object"&&!Ng(o)&&!kg(o)&&!Tg(o)){let a=vg(t);i=a.signal,n=a.end}Ig(t,(a,l)=>{a?r(a):e(l)},{signal:i,end:n})})}s(Fg,"pipeline");jc.exports={finished:Pg,pipeline:Fg}});var as=N((p0,Jc)=>{var{Buffer:Cg}=He(),{ObjectDefineProperty:Ze,ObjectKeys:Vc,ReflectApply:Hc}=O(),{promisify:{custom:Kc}}=Z(),{streamReturningOperators:$c,promiseReturningOperators:zc}=qc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Gc}}=re(),Lg=is(),{setDefaultHighWaterMark:Rg,getDefaultHighWaterMark:Og}=qr(),{pipeline:Yc}=Xi(),{destroyer:Bg}=xt(),Xc=Ye(),ls=ss(),Jr=Me(),C=Jc.exports=Li().Stream;C.isDestroyed=Jr.isDestroyed;C.isDisturbed=Jr.isDisturbed;C.isErrored=Jr.isErrored;C.isReadable=Jr.isReadable;C.isWritable=Jr.isWritable;C.Readable=zr();for(let t of Vc($c)){let r=function(...i){if(new.target)throw Gc();return C.Readable.from(Hc(e,this,i))};Mg=r,s(r,"fn");let e=$c[t];Ze(r,"name",{__proto__:null,value:e.name}),Ze(r,"length",{__proto__:null,value:e.length}),Ze(C.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Mg;for(let t of Vc(zc)){let r=function(...n){if(new.target)throw Gc();return Hc(e,this,n)};Mg=r,s(r,"fn");let e=zc[t];Ze(r,"name",{__proto__:null,value:e.name}),Ze(r,"length",{__proto__:null,value:e.length}),Ze(C.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Mg;C.Writable=Hi();C.Duplex=qe();C.Transform=zo();C.PassThrough=Ho();C.pipeline=Yc;var{addAbortSignal:Dg}=Wr();C.addAbortSignal=Dg;C.finished=Xc;C.destroy=Bg;C.compose=Lg;C.setDefaultHighWaterMark=Rg;C.getDefaultHighWaterMark=Og;Ze(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return ls}});Ze(Yc,Kc,{__proto__:null,enumerable:!0,get(){return ls.pipeline}});Ze(Xc,Kc,{__proto__:null,enumerable:!0,get(){return ls.finished}});C.Stream=C;C._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(e){return Cg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Qc=N((m0,j)=>{"use strict";var V=as(),Ug=ss(),Wg=V.Readable.destroy;j.exports=V.Readable;j.exports._uint8ArrayToBuffer=V._uint8ArrayToBuffer;j.exports._isUint8Array=V._isUint8Array;j.exports.isDisturbed=V.isDisturbed;j.exports.isErrored=V.isErrored;j.exports.isReadable=V.isReadable;j.exports.Readable=V.Readable;j.exports.Writable=V.Writable;j.exports.Duplex=V.Duplex;j.exports.Transform=V.Transform;j.exports.PassThrough=V.PassThrough;j.exports.addAbortSignal=V.addAbortSignal;j.exports.finished=V.finished;j.exports.destroy=V.destroy;j.exports.destroy=Wg;j.exports.pipeline=V.pipeline;j.exports.compose=V.compose;Object.defineProperty(V,"promises",{configurable:!0,enumerable:!0,get(){return Ug}});j.exports.Stream=V.Stream;j.exports.default=j.exports});var $g={};ei($g,{ActionType:()=>oi,ApiError:()=>c,Async:()=>gr,AsyncFile:()=>Mt,AsyncFileIndexFS:()=>an,AsyncMirror:()=>ef,AsyncMirrorFS:()=>yt,AsyncStoreFS:()=>ai,BigIntStats:()=>K,ErrorCode:()=>Y,ErrorStrings:()=>cn,File:()=>vr,FileIndex:()=>Ft,FileIndexFS:()=>pr,FileSystem:()=>J,FileType:()=>U,InMemory:()=>hn,InMemoryStore:()=>Ir,IndexDirInode:()=>et,IndexFileInode:()=>Zr,IndexInode:()=>hr,Inode:()=>he,LockedFS:()=>jt,MirrorFile:()=>Nr,Mutex:()=>qt,NoSyncFile:()=>pt,Overlay:()=>tf,OverlayFS:()=>zt,OverlayFile:()=>$t,PreloadFile:()=>oe,Readonly:()=>dn,SimpleSyncTransaction:()=>Ut,Stats:()=>M,StatsCommon:()=>Bt,Sync:()=>ht,SyncFile:()=>ni,SyncFileIndexFS:()=>sn,SyncStoreFS:()=>Wt,SyncStoreFile:()=>Tr,UnlockedOverlayFS:()=>Pr,checkOptions:()=>fn,configure:()=>qg,createBackend:()=>du,decode:()=>X,decodeDirListing:()=>mr,default:()=>jg,encode:()=>R,encodeDirListing:()=>ae,flagToMode:()=>rt,flagToNumber:()=>Zu,flagToString:()=>ys,fs:()=>Qr,initialize:()=>Zc,isAppendable:()=>it,isBackend:()=>br,isBackendConfig:()=>hs,isBlockDevice:()=>Yu,isCharacterDevice:()=>Xu,isDirectory:()=>Hu,isExclusive:()=>bs,isFIFO:()=>Ju,isFile:()=>Vu,isReadable:()=>ze,isSocket:()=>Gu,isSymbolicLink:()=>Ku,isSynchronous:()=>xr,isTruncating:()=>ms,isWriteable:()=>ye,levenshtein:()=>un,mkdirpSync:()=>ds,parseFlag:()=>F,pathExistsAction:()=>Ar,pathNotExistsAction:()=>kr,randomIno:()=>Dt,resolveBackend:()=>ri,rootCred:()=>_e,rootIno:()=>pe,setImmediate:()=>fu,size_max:()=>ii,wait:()=>uu});var Y=(g=>(g[g.EPERM=1]="EPERM",g[g.ENOENT=2]="ENOENT",g[g.EIO=5]="EIO",g[g.EBADF=9]="EBADF",g[g.EACCES=13]="EACCES",g[g.EBUSY=16]="EBUSY",g[g.EEXIST=17]="EEXIST",g[g.ENOTDIR=20]="ENOTDIR",g[g.EISDIR=21]="EISDIR",g[g.EINVAL=22]="EINVAL",g[g.EFBIG=27]="EFBIG",g[g.ENOSPC=28]="ENOSPC",g[g.EROFS=30]="EROFS",g[g.EDEADLK=35]="EDEADLK",g[g.ENOTEMPTY=39]="ENOTEMPTY",g[g.ENOTSUP=95]="ENOTSUP",g))(Y||{}),cn={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[35]:"Resource deadlock would occur",[39]:"Directory is not empty.",[95]:"Operation is not supported."},c=class extends Error{constructor(r,i=cn[r],n){super(i);this.errno=r;this.path=n;this.code=Y[r],this.message=`${this.code}: ${i}${this.path?`, '${this.path}'`:""}`}static fromJSON(r){let i=new c(r.errno,r.message,r.path);return i.code=r.code,i.stack=r.stack,i}static OnPath(r,i){return new c(r,cn[r],i)}static EACCES(r){return this.OnPath(13,r)}static ENOENT(r){return this.OnPath(2,r)}static EEXIST(r){return this.OnPath(17,r)}static EISDIR(r){return this.OnPath(21,r)}static ENOTDIR(r){return this.OnPath(20,r)}static EPERM(r){return this.OnPath(1,r)}static ENOTEMPTY(r){return this.OnPath(39,r)}code;syscall="";stack;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(c,"ApiError");var lu="/",us="/";function Lt(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(Lt,"validateString");function fs(t,e){let r="",i=0,n=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||o===1))if(o===2){if(r.length<2||i!==2||r.at(-1)!=="."||r.at(-2)!=="."){if(r.length>2){let u=r.lastIndexOf("/");u===-1?(r="",i=0):(r=r.slice(0,u),i=r.length-1-r.lastIndexOf("/")),n=l,o=0;continue}else if(r.length!==0){r="",i=0,n=l,o=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,l):r=t.slice(n+1,l),i=l-n-1;n=l,o=0}else a==="."&&o!==-1?++o:o=-1}return r}s(fs,"normalizeString");function Te(...t){let e="",r=!1;for(let i=t.length-1;i>=-1&&!r;i--){let n=i>=0?t[i]:lu;Lt(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,r=n[0]==="/")}return e=fs(e,!r),r?`/${e}`:e.length>0?e:"."}s(Te,"resolve");function cu(t){if(Lt(t,"path"),t.length===0)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=fs(t,!e),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)}s(cu,"normalize");function de(...t){if(t.length===0)return".";let e;for(let r=0;r<t.length;++r){let i=t[r];Lt(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":cu(e)}s(de,"join");function x(t){if(Lt(t,"path"),t.length===0)return".";let e=t[0]==="/",r=-1,i=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!i){r=n;break}}else i=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)}s(x,"dirname");function L(t,e){e!==void 0&&Lt(e,"ext"),Lt(t,"path");let r=0,i=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!n){r=l+1;break}}else a===-1&&(n=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(i=l):(o=-1,i=a));return r===i?i=a:i===-1&&(i=t.length),t.slice(r,i)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!n){r=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":t.slice(r,i)}s(L,"basename");function ds(t,e,r,i){i.existsSync(t,r)||(ds(x(t),e,r,i),i.mkdirSync(t,e,r))}s(ds,"mkdirpSync");function ti(t,e,r,i,n){return Math.min(t+1,e+1,r+1,i===n?e:e+1)}s(ti,"_min");function un(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let r=t.length,i=e.length;for(;r>0&&t.charCodeAt(r-1)===e.charCodeAt(i-1);)r--,i--;let n=0;for(;n<r&&t.charCodeAt(n)===e.charCodeAt(n);)n++;if(r-=n,i-=n,r===0||i===1)return i;let o=new Array(r<<1);for(let m=0;m<r;)o[r+m]=t.charCodeAt(n+m),o[m]=++m;let a,l,u,f,d;for(a=0;a+3<i;){let m=e.charCodeAt(n+(l=a)),y=e.charCodeAt(n+(u=a+1)),w=e.charCodeAt(n+(f=a+2)),b=e.charCodeAt(n+(d=a+3)),g=a+=4;for(let S=0;S<r;){let I=o[r+S],D=o[S];l=ti(D,l,u,m,I),u=ti(l,u,f,y,I),f=ti(u,f,d,w,I),g=ti(f,d,g,b,I),o[S++]=g,d=f,f=u,u=l,l=D}}let h=0;for(;a<i;){let m=e.charCodeAt(n+(l=a));h=++a;for(let y=0;y<r;y++){let w=o[y];o[y]=h=w<l||h<l?w>h?h+1:w+1:m===o[r+y]?l:l+1,l=w}}return h}s(un,"levenshtein");function uu(t){return new Promise(e=>{setTimeout(e,t)})}s(uu,"wait");var fu=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function R(t,e="utf8"){if(typeof t!="string")throw new c(22,"Can not encode a non-string");switch(e){case"ascii":case"latin1":case"binary":return new Uint8Array(Array.from(t).map(i=>i.charCodeAt(0)));case"utf8":case"utf-8":return new Uint8Array(Array.from(t).flatMap(i=>{let n=i.charCodeAt(0);if(n<128)return n;let o=n&63|128;if(n<2048)return[n>>6|192,o];let a=n>>6&63|128;return n<65536?[n>>12|224,a,o]:[n>>18|240,n>>12&63|128,a,o]}));case"base64":return R(atob(t),"utf-8");case"base64url":return R(t.replace("_","/").replace("-","+"),"base64");case"hex":return new Uint8Array(t.match(/.{1,2}/g).map(i=>parseInt(i,16)));case"utf16le":case"ucs2":case"ucs-2":let r=new Uint16Array(new ArrayBuffer(t.length*2));for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return new Uint8Array(r.buffer);default:throw new c(22,"Invalid encoding: "+e)}}s(R,"encode");function X(t,e="utf8"){if(!(t instanceof Uint8Array))throw new c(22,"Can not decode a non-Uint8Array");switch(e){case"ascii":case"latin1":case"binary":return Array.from(t).map(n=>String.fromCharCode(n)).join("");case"utf8":case"utf-8":let r="";for(let n=0;n<t.length;n++){let o;t[n]<128?o=t[n]:t[n]<224?o=(t[n]&31)<<6|t[++n]&63:t[n]<240?o=(t[n]&15)<<12|(t[++n]&63)<<6|t[++n]&63:o=(t[n]&7)<<18|(t[++n]&63)<<12|(t[++n]&63)<<6|t[++n]&63,r+=String.fromCharCode(o)}return r;case"utf16le":case"ucs2":case"ucs-2":let i="";for(let n=0;n<t.length;n+=2){let o=t[n]|t[n+1]<<8;i+=String.fromCharCode(o)}return i;case"base64":return btoa(X(t,"utf-8"));case"base64url":return X(t,"base64").replace("/","_").replace("+","-");case"hex":return Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("");default:throw new c(22,"Invalid encoding: "+e)}}s(X,"decode");function mr(t){return JSON.parse(X(t),(e,r)=>e==""?r:BigInt(r))}s(mr,"decodeDirListing");function ae(t){return R(JSON.stringify(t,(e,r)=>e==""?r:r.toString()))}s(ae,"encodeDirListing");function br(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(br,"isBackend");async function fn(t,e){if(typeof e!="object"||e===null)throw new c(22,"Invalid options");for(let[r,i]of Object.entries(t.options)){let n=e?.[r];if(n==null){if(!i.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:un(r,l)})).filter(l=>l.distance<5).sort((l,u)=>l.distance-u.distance);throw new c(22,`${t.name}: Required option '${r}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${r}'.`:""}`)}if(!(Array.isArray(i.type)?i.type.indexOf(typeof n)!=-1:typeof n==i.type))throw new c(22,`${t.name}: Value provided for option ${r} is not the proper type. Expected ${Array.isArray(i.type)?`one of {${i.type.join(", ")}}`:i.type}, but received ${typeof n}`);i.validator&&await i.validator(n)}}s(fn,"checkOptions");function du(t,e){return fn(t,e),t.create(e).ready()}s(du,"createBackend");function hs(t){return t!=null&&typeof t=="object"&&"backend"in t}s(hs,"isBackendConfig");async function ri(t,e=0){if(typeof t!="object"||t==null)throw new c(22,"Invalid options on configuration object.");let{backend:r}=t;if(!br(r))throw new c(22,"Missing or invalid backend");let i=Object.keys(t).filter(o=>o!="backend");for(let o of i){let a=t[o];if(br(a)&&(a={backend:a}),hs(a)){if(e>10)throw new c(22,"Invalid configuration, too deep and possibly infinite");t[o]=await ri(a,++e)}}if(!await r.isAvailable())throw new c(1,"Backend not available: "+r);fn(r,t);let n=r.create(t);return await n.ready(),n}s(ri,"resolveBackend");var J=class{metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,r){try{return await this.stat(e,r),!0}catch{return!1}}existsSync(e,r){try{return this.statSync(e,r),!0}catch{return!1}}};s(J,"FileSystem");function ht(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!0}}async ready(){return this}async exists(i,n){return this.existsSync(i,n)}async rename(i,n,o){return this.renameSync(i,n,o)}async stat(i,n){return this.statSync(i,n)}async createFile(i,n,o,a){return this.createFileSync(i,n,o,a)}async openFile(i,n,o){return this.openFileSync(i,n,o)}async unlink(i,n){return this.unlinkSync(i,n)}async rmdir(i,n){return this.rmdirSync(i,n)}async mkdir(i,n,o){return this.mkdirSync(i,n,o)}async readdir(i,n){return this.readdirSync(i,n)}async link(i,n,o){return this.linkSync(i,n,o)}async sync(i,n,o){return this.syncSync(i,n,o)}}return s(e,"_SyncFileSystem"),e}s(ht,"Sync");function gr(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!1}}renameSync(i,n,o){throw new c(95)}statSync(i,n){throw new c(95)}createFileSync(i,n,o,a){throw new c(95)}openFileSync(i,n,o){throw new c(95)}unlinkSync(i,n){throw new c(95)}rmdirSync(i,n){throw new c(95)}mkdirSync(i,n,o){throw new c(95)}readdirSync(i,n){throw new c(95)}linkSync(i,n,o){throw new c(95)}syncSync(i,n,o){throw new c(95)}}return s(e,"_AsyncFileSystem"),e}s(gr,"Async");function dn(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(i,n,o){throw new c(30)}renameSync(i,n,o){throw new c(30)}async createFile(i,n,o,a){throw new c(30)}createFileSync(i,n,o,a){throw new c(30)}async unlink(i,n){throw new c(30)}unlinkSync(i,n){throw new c(30)}async rmdir(i,n){throw new c(30)}rmdirSync(i,n){throw new c(30)}async mkdir(i,n,o){throw new c(30)}mkdirSync(i,n,o){throw new c(30)}async link(i,n,o){throw new c(30)}linkSync(i,n,o){throw new c(30)}async sync(i,n,o){throw new c(30)}syncSync(i,n,o){throw new c(30)}}return s(e,"_ReadonlyFileSystem"),e}s(dn,"Readonly");var Er={};ei(Er,{COPYFILE_EXCL:()=>yu,COPYFILE_FICLONE:()=>mu,COPYFILE_FICLONE_FORCE:()=>bu,F_OK:()=>hu,O_APPEND:()=>Ce,O_CREAT:()=>H,O_DIRECT:()=>vu,O_DIRECTORY:()=>wu,O_DSYNC:()=>Eu,O_EXCL:()=>Pe,O_NOATIME:()=>Su,O_NOCTTY:()=>gu,O_NOFOLLOW:()=>_u,O_NONBLOCK:()=>Au,O_RDONLY:()=>Rt,O_RDWR:()=>ne,O_SYMLINK:()=>xu,O_SYNC:()=>Ot,O_TRUNC:()=>Fe,O_WRONLY:()=>Ie,R_OK:()=>Se,S_IFBLK:()=>Nu,S_IFCHR:()=>Tu,S_IFDIR:()=>_r,S_IFIFO:()=>Iu,S_IFLNK:()=>wr,S_IFMT:()=>te,S_IFREG:()=>Sr,S_IFSOCK:()=>ku,S_IRGRP:()=>Mu,S_IROTH:()=>ju,S_IRUSR:()=>Ru,S_IRWXG:()=>Du,S_IRWXO:()=>qu,S_IRWXU:()=>Lu,S_ISGID:()=>Fu,S_ISUID:()=>Pu,S_ISVTX:()=>Cu,S_IWGRP:()=>Uu,S_IWOTH:()=>$u,S_IWUSR:()=>Ou,S_IXGRP:()=>Wu,S_IXOTH:()=>zu,S_IXUSR:()=>Bu,W_OK:()=>le,X_OK:()=>pu});var hu=0,Se=4,le=2,pu=1,yu=1,mu=2,bu=4,Rt=0,Ie=1,ne=2,H=64,Pe=128,gu=256,Fe=512,Ce=1024,wu=65536,Su=262144,_u=131072,Ot=1052672,Eu=4096,xu=32768,vu=16384,Au=2048,te=61440,ku=49152,wr=40960,Sr=32768,Nu=24576,_r=16384,Tu=8192,Iu=4096,Pu=2048,Fu=1024,Cu=512,Lu=448,Ru=256,Ou=128,Bu=64,Du=56,Mu=32,Uu=16,Wu=8,qu=7,ju=4,$u=2,zu=1;var U=(i=>(i[i.FILE=32768]="FILE",i[i.DIRECTORY=16384]="DIRECTORY",i[i.SYMLINK=40960]="SYMLINK",i))(U||{}),Bt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:r,ctimeMs:i,birthtimeMs:n,uid:o,gid:a,size:l,mode:u}={}){let f=Date.now(),d=s((m,y)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:y),"resolveT");this.atimeMs=d(e,f),this.mtimeMs=d(r,f),this.ctimeMs=d(i,f),this.birthtimeMs=d(n,f),this.uid=d(o,0),this.gid=d(a,0),this.size=this._convert(l);let h=Number(u)&61440||U.FILE;if(u)this.mode=this._convert(u);else switch(h){case U.FILE:this.mode=this._convert(420);break;case U.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(h))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,r){if(r.euid===0||r.egid===0)return!0;let i=this.mode&-61441,n=15,o=15,a=15;if(r.euid==this.uid){let f=(3840&i)>>8;n=(e^f)&e}if(r.egid==this.gid){let f=(240&i)>>4;o=(e^f)&e}let l=15&i;return a=(e^l)&e,!(n&o&a)}cred(e=Number(this.uid),r=Number(this.gid)){return{uid:e,gid:r,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:r}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,r){e=Number(e),r=Number(r),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(r)&&0<=r&&r<2**32&&(this.gid=this._convert(r))}};s(Bt,"StatsCommon");var M=class extends Bt{_isBigint=!1;static clone(e){return new M(e)}};s(M,"Stats");var K=class extends Bt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new K(e)}};s(K,"BigIntStats");function Vu(t){return(Number(t.mode)&61440)===32768}s(Vu,"isFile");function Hu(t){return(Number(t.mode)&61440)===16384}s(Hu,"isDirectory");function Ku(t){return(Number(t.mode)&61440)===40960}s(Ku,"isSymbolicLink");function Gu(){return!1}s(Gu,"isSocket");function Yu(){return!1}s(Yu,"isBlockDevice");function Xu(){return!1}s(Xu,"isCharacterDevice");function Ju(){return!1}s(Ju,"isFIFO");var ii=2**32-1,pe=0n;function ps(){return Math.round(Math.random()*2**32).toString(16)}s(ps,"_random");function Dt(){return BigInt("0x"+ps()+ps())}s(Dt,"randomIno");var he=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let r=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!r)return;this.ino=Dt(),this.nlink=1,this.size=4096;let i=Date.now();this.atimeMs=i,this.mtimeMs=i,this.ctimeMs=i,this.birthtimeMs=i}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new M(this)}update(e){let r=!1;return this.size!==e.size&&(this.size=e.size,r=!0),this.mode!==e.mode&&(this.mode=e.mode,r=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,r=!0),this.uid!==e.uid&&(this.uid=e.uid,r=!0),this.uid!==e.uid&&(this.uid=e.uid,r=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,r=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,r=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,r=!0),r}};s(he,"Inode");var oi=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(oi||{}),Qu=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function F(t){if(typeof t=="number")return ys(t);if(!Qu.includes(t))throw new Error("Invalid flag string: "+t);return t}s(F,"parseFlag");function ys(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}s(ys,"flagToString");function Zu(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(Zu,"flagToNumber");function rt(t){let e=0;return e<<=1,e+=+ze(t),e<<=1,e+=+ye(t),e<<=1,e}s(rt,"flagToMode");function ze(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(ze,"isReadable");function ye(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(ye,"isWriteable");function ms(t){return t.indexOf("w")!==-1}s(ms,"isTruncating");function it(t){return t.indexOf("a")!==-1}s(it,"isAppendable");function xr(t){return t.indexOf("s")!==-1}s(xr,"isSynchronous");function bs(t){return t.indexOf("x")!==-1}s(bs,"isExclusive");function Ar(t){return bs(t)?1:ms(t)?2:0}s(Ar,"pathExistsAction");function kr(t){return(ye(t)||it(t))&&t!=="r+"?3:1}s(kr,"pathNotExistsAction");var vr=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(vr,"File");var oe=class extends vr{constructor(r,i,n,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:ii}))){super();this.fs=r;this.path=i;this.flag=n;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(ze(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return it(this.flag)?this.stats.size:this._position}set position(r){this._position=r}async stat(){return new M(this.stats)}statSync(){return new M(this.stats)}truncate(r){if(this.truncateSync(r),xr(this.flag)&&!this.fs.metadata().synchronous)return this.sync()}truncateSync(r){if(this._dirty=!0,!ye(this.flag))throw new c(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),r>this._buffer.length){let i=new Uint8Array(r-this._buffer.length);this.writeSync(i,0,i.length,this._buffer.length),xr(this.flag)&&this.fs.metadata().synchronous&&this.syncSync();return}this.stats.size=r,this._buffer=this._buffer.subarray(0,r),xr(this.flag)&&this.fs.metadata().synchronous&&this.syncSync()}async write(r,i=0,n=this.stats.size,o=0){return this.writeSync(r,i,n,o)}writeSync(r,i=0,n=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!ye(this.flag))throw new c(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let u=new Uint8Array(new ArrayBuffer(a,{maxByteLength:ii}));u.set(this._buffer),this._buffer=u}this._buffer.set(r.slice(i,i+n),o);let l=this._buffer.byteOffset;return this.stats.mtimeMs=Date.now(),xr(this.flag)?(this.syncSync(),l):(this.position=o+l,l)}async read(r,i=0,n=this.stats.size,o=0){return{bytesRead:this.readSync(r,i,n,o),buffer:r}}readSync(r,i=0,n=this.stats.size,o=0){if(!ze(this.flag))throw new c(1,"File not opened with a readable mode.");o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||r.set(this._buffer.slice(o,a),i),l}async chmod(r){this.chmodSync(r)}chmodSync(r){if(!this.fs.metadata().supportsProperties)throw new c(95);this._dirty=!0,this.stats.chmod(r),this.syncSync()}async chown(r,i){this.chownSync(r,i)}chownSync(r,i){if(!this.fs.metadata().supportsProperties)throw new c(95);this._dirty=!0,this.stats.chown(r,i),this.syncSync()}async utimes(r,i){this.utimesSync(r,i)}utimesSync(r,i){if(!this.fs.metadata().supportsProperties)throw new c(95);this._dirty=!0,this.stats.atime=r,this.stats.mtime=i,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(r){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|r,this.sync()}_setTypeSync(r){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|r,this.syncSync()}};s(oe,"PreloadFile");var ni=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(ni,"SyncFile");var pt=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(pt,"NoSyncFile");var _e={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Nr=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(Nr,"MirrorFile");var yt=class extends ht(J){_queue=[];_queueRunning=!1;_sync;_async;_isInitialized=!1;_ready;async ready(){return await this._ready,this}constructor({sync:e,async:r}){super(),this._sync=e,this._async=r,this._ready=this._initialize()}metadata(){return{...super.metadata(),name:yt.name,synchronous:!0,supportsProperties:this._sync.metadata().supportsProperties&&this._async.metadata().supportsProperties}}syncSync(e,r,i){this._sync.syncSync(e,r,i),this.enqueue({apiMethod:"sync",arguments:[e,r,i]})}openFileSync(e,r,i){return this._sync.openFileSync(e,r,i)}createFileSync(e,r,i,n){let o=this._sync.createFileSync(e,r,i,n);this.enqueue({apiMethod:"createFile",arguments:[e,r,i,n]});let a=o.statSync(),l=new Uint8Array(a.size);return o.readSync(l),new Nr(this,e,r,a,l)}linkSync(e,r,i){this._sync.linkSync(e,r,i),this.enqueue({apiMethod:"link",arguments:[e,r,i]})}renameSync(e,r,i){this._sync.renameSync(e,r,i),this.enqueue({apiMethod:"rename",arguments:[e,r,i]})}statSync(e,r){return this._sync.statSync(e,r)}unlinkSync(e,r){this._sync.unlinkSync(e,r),this.enqueue({apiMethod:"unlink",arguments:[e,r]})}rmdirSync(e,r){this._sync.rmdirSync(e,r),this.enqueue({apiMethod:"rmdir",arguments:[e,r]})}mkdirSync(e,r,i){this._sync.mkdirSync(e,r,i),this.enqueue({apiMethod:"mkdir",arguments:[e,r,i]})}readdirSync(e,r){return this._sync.readdirSync(e,r)}existsSync(e,r){return this._sync.existsSync(e,r)}async crossCopyDirectory(e,r){if(e!=="/"){let n=await this._async.stat(e,_e);this._sync.mkdirSync(e,r,n.cred())}let i=await this._async.readdir(e,_e);for(let n of i)await this.crossCopy(de(e,n))}async crossCopyFile(e,r){let i=await this._async.openFile(e,F("r"),_e),n=this._sync.createFileSync(e,F("w"),r,_e);try{let{size:o}=await i.stat(),a=new Uint8Array(o);await i.read(a),n.writeSync(a)}finally{await i.close(),n.closeSync()}}async crossCopy(e){let r=await this._async.stat(e,_e);r.isDirectory()?await this.crossCopyDirectory(e,r.mode):await this.crossCopyFile(e,r.mode)}async _initialize(){if(!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let e=this._queue.shift();try{await this._async[e.apiMethod](...e.arguments)}catch(r){throw new c(5,"AsyncMirror desync: "+r)}await this._next()}enqueue(e){this._queue.push(e),!this._queueRunning&&(this._queueRunning=!0,this._next())}};s(yt,"AsyncMirrorFS");var ef={name:"AsyncMirror",options:{sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if("metadata"in t&&!t.metadata().synchronous)throw new c(22,'"sync" option must be a file system that supports synchronous operations')}},async:{type:"object",description:"The asynchronous file system to mirror."}},isAvailable(){return!0},create(t){return new yt(t)}};var si=class{constructor(e){this.limit=e}cache=[];set(e,r){let i=this.cache.findIndex(n=>n.key===e);i!=-1?this.cache.splice(i,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:r})}get(e){let r=this.cache.find(i=>i.key===e);if(r)return this.set(e,r.value),r.value}remove(e){let r=this.cache.findIndex(i=>i.key===e);r!==-1&&this.cache.splice(r,1)}reset(){this.cache=[]}};s(si,"LRUCache");var Mt=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this.resetDirty())}syncSync(){throw new c(95)}async close(){this.sync()}closeSync(){throw new c(95)}};s(Mt,"AsyncFile");var ai=class extends gr(J){store;_cache;_ready;ready(){return this._ready}metadata(){return{...super.metadata(),name:this.store.name}}constructor({store:e,cacheSize:r}){super(),r>0&&(this._cache=new si(r)),this._ready=this._initialize(e)}async _initialize(e){return this.store=await e,await this.makeRootDirectory(),this}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(e,r,i){let n=this._cache;this._cache&&(this._cache=null,n.reset());try{let o=this.store.beginTransaction(),a=x(e),l=L(e),u=x(r),f=L(r),d=await this.findINode(o,a),h=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,i))throw c.EACCES(e);if(!h[l])throw c.ENOENT(e);let m=h[l];if(delete h[l],(u+"/").indexOf(e+"/")===0)throw new c(16,a);let y,w;if(u===a?(y=d,w=h):(y=await this.findINode(o,u),w=await this.getDirListing(o,y,u)),w[f]){let b=await this.getINode(o,w[f],r);if(b.toStats().isFile())try{await o.remove(b.ino),await o.remove(w[f])}catch(g){throw await o.abort(),g}else throw c.EPERM(r)}w[f]=m;try{await o.put(d.ino,ae(h),!0),await o.put(y.ino,ae(w),!0)}catch(b){throw await o.abort(),b}await o.commit()}finally{n&&(this._cache=n)}}async stat(e,r){let i=this.store.beginTransaction(),n=await this.findINode(i,e);if(!n)throw c.ENOENT(e);let o=n.toStats();if(!o.hasAccess(4,r))throw c.EACCES(e);return o}async createFile(e,r,i,n){let o=this.store.beginTransaction(),a=new Uint8Array(0),l=await this.commitNewFile(o,e,U.FILE,i,n,a);return new Mt(this,e,r,l.toStats(),a)}async openFile(e,r,i){let n=this.store.beginTransaction(),o=await this.findINode(n,e),a=await n.get(o.ino);if(!o.toStats().hasAccess(rt(r),i))throw c.EACCES(e);if(!a)throw c.ENOENT(e);return new Mt(this,e,r,o.toStats(),a)}async unlink(e,r){return this.removeEntry(e,!1,r)}async rmdir(e,r){if((await this.readdir(e,r)).length>0)throw c.ENOTEMPTY(e);await this.removeEntry(e,!0,r)}async mkdir(e,r,i){let n=this.store.beginTransaction(),o=R("{}");await this.commitNewFile(n,e,U.DIRECTORY,r,i,o)}async readdir(e,r){let i=this.store.beginTransaction(),n=await this.findINode(i,e);if(!n.toStats().hasAccess(4,r))throw c.EACCES(e);return Object.keys(await this.getDirListing(i,n,e))}async sync(e,r,i){let n=this.store.beginTransaction(),o=await this._findINode(n,x(e),L(e)),a=await this.getINode(n,o,e),l=a.update(i);try{await n.put(a.ino,r,!0),l&&await n.put(o,a.data,!0)}catch(u){throw await n.abort(),u}await n.commit()}async link(e,r,i){let n=this.store.beginTransaction(),o=x(e);if(!(await this.findINode(n,o)).toStats().hasAccess(4,i))throw c.EACCES(o);let l=x(r),u=await this.findINode(n,l),f=await this.getDirListing(n,u,l);if(!u.toStats().hasAccess(2,i))throw c.EACCES(l);let d=await this._findINode(n,o,L(e)),h=await this.getINode(n,d,e);if(!h.toStats().hasAccess(2,i))throw c.EACCES(r);h.nlink++,f[L(r)]=d;try{n.put(d,h.data,!0),n.put(u.ino,ae(f),!0)}catch(m){throw n.abort(),m}n.commit()}async makeRootDirectory(){let e=this.store.beginTransaction();if(await e.get(pe)===void 0){let r=new he;r.mode=511|U.DIRECTORY,await e.put(r.ino,R("{}"),!1),await e.put(pe,r.data,!1),await e.commit()}}async _findINode(e,r,i,n=new Set){let o=de(r,i);if(n.has(o))throw new c(5,"Infinite loop detected while finding inode",o);if(n.add(o),this._cache){let a=this._cache.get(o);if(a)return a}if(r==="/"){if(i==="")return this._cache&&this._cache.set(o,pe),pe;{let a=await this.getINode(e,pe,r),l=await this.getDirListing(e,a,r);if(l[i]){let u=l[i];return this._cache&&this._cache.set(o,u),u}else throw c.ENOENT(Te(r,i))}}else{let a=await this.findINode(e,r,n),l=await this.getDirListing(e,a,r);if(l[i]){let u=l[i];return this._cache&&this._cache.set(o,u),u}else throw c.ENOENT(Te(r,i))}}async findINode(e,r,i=new Set){let n=await this._findINode(e,x(r),L(r),i);return this.getINode(e,n,r)}async getINode(e,r,i){let n=await e.get(r);if(!n)throw c.ENOENT(i);return new he(n.buffer)}async getDirListing(e,r,i){if(!r.toStats().isDirectory())throw c.ENOTDIR(i);let n=await e.get(r.ino);if(!n)throw c.ENOENT(i);return mr(n)}async addNewNode(e,r,i=5){if(i<=0)throw new c(5,"Unable to commit data to key-value store.");let n=Dt();return await e.put(n,r,!1)?n:await this.addNewNode(e,r,--i)}async commitNewFile(e,r,i,n,o,a){let l=x(r),u=L(r),f=await this.findINode(e,l),d=await this.getDirListing(e,f,l);if(!f.toStats().hasAccess(2,o))throw c.EACCES(r);if(r==="/")throw c.EEXIST(r);if(d[u])throw await e.abort(),c.EEXIST(r);try{let h=new he;return h.ino=await this.addNewNode(e,a),h.mode=n|i,h.uid=o.uid,h.gid=o.gid,h.size=a.length,d[u]=await this.addNewNode(e,h.data),await e.put(f.ino,ae(d),!0),await e.commit(),h}catch(h){throw e.abort(),h}}async removeEntry(e,r,i){this._cache&&this._cache.remove(e);let n=this.store.beginTransaction(),o=x(e),a=await this.findINode(n,o),l=await this.getDirListing(n,a,o),u=L(e);if(!l[u])throw c.ENOENT(e);let f=l[u],d=await this.getINode(n,f,e);if(!d.toStats().hasAccess(2,i))throw c.EACCES(e);if(delete l[u],!r&&d.toStats().isDirectory())throw c.EISDIR(e);if(r&&!d.toStats().isDirectory())throw c.ENOTDIR(e);try{await n.put(a.ino,ae(l),!0),--d.nlink<1&&(await n.remove(d.ino),await n.remove(f))}catch(h){throw await n.abort(),h}await n.commit()}};s(ai,"AsyncStoreFS");var Ut=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let r=this.store.get(e);return this.stashOldValue(e,r),r}put(e,r,i){return this.markModified(e),this.store.put(e,r,i)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let r=this.originalData.get(e);r?this.store.put(e,r,!0):this.store.remove(e)}}stashOldValue(e,r){this.originalData.has(e)||this.originalData.set(e,r)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(Ut,"SimpleSyncTransaction");var Tr=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(Tr,"SyncStoreFile");var Wt=class extends ht(J){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,r,i){let n=this.store.beginTransaction(),o=x(e),a=L(e),l=x(r),u=L(r),f=this.findINode(n,o),d=this.getDirListing(n,f,o);if(!f.toStats().hasAccess(2,i))throw c.EACCES(e);if(!d[a])throw c.ENOENT(e);let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new c(16,o);let m,y;if(l===o?(m=f,y=d):(m=this.findINode(n,l),y=this.getDirListing(n,m,l)),y[u]){let w=this.getINode(n,y[u],r);if(w.toStats().isFile())try{n.remove(w.ino),n.remove(y[u])}catch(b){throw n.abort(),b}else throw c.EPERM(r)}y[u]=h;try{n.put(f.ino,ae(d),!0),n.put(m.ino,ae(y),!0)}catch(w){throw n.abort(),w}n.commit()}statSync(e,r){let i=this.findINode(this.store.beginTransaction(),e).toStats();if(!i.hasAccess(4,r))throw c.EACCES(e);return i}createFileSync(e,r,i,n){return this.commitNewFile(e,U.FILE,i,n),this.openFileSync(e,r,n)}openFileSync(e,r,i){let n=this.store.beginTransaction(),o=this.findINode(n,e),a=n.get(o.ino);if(!o.toStats().hasAccess(rt(r),i))throw c.EACCES(e);if(a===null)throw c.ENOENT(e);return new Tr(this,e,r,o.toStats(),a)}unlinkSync(e,r){this.removeEntry(e,!1,r)}rmdirSync(e,r){if(this.readdirSync(e,r).length>0)throw c.ENOTEMPTY(e);this.removeEntry(e,!0,r)}mkdirSync(e,r,i){this.commitNewFile(e,U.DIRECTORY,r,i,R("{}"))}readdirSync(e,r){let i=this.store.beginTransaction(),n=this.findINode(i,e);if(!n.toStats().hasAccess(4,r))throw c.EACCES(e);return Object.keys(this.getDirListing(i,n,e))}syncSync(e,r,i){let n=this.store.beginTransaction(),o=this._findINode(n,x(e),L(e)),a=this.getINode(n,o,e),l=a.update(i);try{n.put(a.ino,r,!0),l&&n.put(o,a.data,!0)}catch(u){throw n.abort(),u}n.commit()}linkSync(e,r,i){let n=this.store.beginTransaction(),o=x(e);if(!this.findINode(n,o).toStats().hasAccess(4,i))throw c.EACCES(o);let l=x(r),u=this.findINode(n,l),f=this.getDirListing(n,u,l);if(!u.toStats().hasAccess(2,i))throw c.EACCES(l);let d=this._findINode(n,o,L(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,i))throw c.EACCES(r);h.nlink++,f[L(r)]=d;try{n.put(d,h.data,!0),n.put(u.ino,ae(f),!0)}catch(m){throw n.abort(),m}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(pe))return;let r=new he;r.mode=511|U.DIRECTORY,e.put(r.ino,R("{}"),!1),e.put(pe,r.data,!1),e.commit()}_findINode(e,r,i,n=new Set){let o=de(r,i);if(n.has(o))throw new c(5,"Infinite loop detected while finding inode",o);if(n.add(o),r!="/"){let a=this._findINode(e,x(r),L(r),n),l=this.getDirListing(e,this.getINode(e,a,r+us+i),r);if(!(i in l))throw c.ENOENT(Te(r,i));return l[i]}if(i!=""){let a=this.getDirListing(e,this.getINode(e,pe,r),r);if(!(i in a))throw c.ENOENT(Te(r,i));return a[i]}return pe}findINode(e,r){let i=this._findINode(e,x(r),L(r));return this.getINode(e,i,r)}getINode(e,r,i){let n=e.get(r);if(!n)throw c.ENOENT(i);return new he(n.buffer)}getDirListing(e,r,i){if(!r.toStats().isDirectory())throw c.ENOTDIR(i);let n=e.get(r.ino);if(!n)throw c.ENOENT(i);return mr(n)}addNewNode(e,r,i=5){for(let n=0;n<i;n++){let o=Dt();if(e.put(o,r,!1))return o}throw new c(5,"Unable to commit data to key-value store.")}commitNewFile(e,r,i,n,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),u=L(e),f=this.findINode(a,l),d=this.getDirListing(a,f,l);if(!f.toStats().hasAccess(2,n))throw c.EACCES(e);if(e==="/")throw c.EEXIST(e);if(d[u])throw c.EEXIST(e);let h=new he;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=i|r,h.uid=n.uid,h.gid=n.gid,d[u]=this.addNewNode(a,h.data),a.put(f.ino,ae(d),!0)}catch(m){throw a.abort(),m}return a.commit(),h}removeEntry(e,r,i){let n=this.store.beginTransaction(),o=x(e),a=this.findINode(n,o),l=this.getDirListing(n,a,o),u=L(e),f=l[u];if(!f)throw c.ENOENT(e);let d=this.getINode(n,f,e);if(!d.toStats().hasAccess(2,i))throw c.EACCES(e);if(delete l[u],!r&&d.toStats().isDirectory())throw c.EISDIR(e);if(r&&!d.toStats().isDirectory())throw c.ENOTDIR(e);try{n.put(a.ino,ae(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(f))}catch(h){throw n.abort(),h}n.commit()}};s(Wt,"SyncStoreFS");var Ir=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new Ut(this)}get(e){return this.store.get(e)}put(e,r,i){return!i&&this.store.has(e)?!1:(this.store.set(e,r),!0)}remove(e){this.store.delete(e)}};s(Ir,"InMemoryStore");var hn={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",description:"The name of the store"}},create({name:t}){return new Wt({store:new Ir(t)})}};var qt=class{_locks=new Map;lock(e){return new Promise(r=>{this._locks.has(e)?this._locks.get(e).push(r):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let r=this._locks.get(e).shift();if(r){setTimeout(r,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(qt,"Mutex");var jt=class{constructor(e){this.fs=e}_mu=new qt;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,r,i){await this._mu.lock(e),await this.fs.rename(e,r,i),this._mu.unlock(e)}renameSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,r,i)}async stat(e,r){await this._mu.lock(e);let i=await this.fs.stat(e,r);return this._mu.unlock(e),i}statSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,r)}async openFile(e,r,i){await this._mu.lock(e);let n=await this.fs.openFile(e,r,i);return this._mu.unlock(e),n}openFileSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,r,i)}async createFile(e,r,i,n){await this._mu.lock(e);let o=await this.fs.createFile(e,r,i,n);return this._mu.unlock(e),o}createFileSync(e,r,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,r,i,n)}async unlink(e,r){await this._mu.lock(e),await this.fs.unlink(e,r),this._mu.unlock(e)}unlinkSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,r)}async rmdir(e,r){await this._mu.lock(e),await this.fs.rmdir(e,r),this._mu.unlock(e)}rmdirSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,r)}async mkdir(e,r,i){await this._mu.lock(e),await this.fs.mkdir(e,r,i),this._mu.unlock(e)}mkdirSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,r,i)}async readdir(e,r){await this._mu.lock(e);let i=await this.fs.readdir(e,r);return this._mu.unlock(e),i}readdirSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,r)}async exists(e,r){await this._mu.lock(e);let i=await this.fs.exists(e,r);return this._mu.unlock(e),i}existsSync(e,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,r)}async link(e,r,i){await this._mu.lock(e),await this.fs.link(e,r,i),this._mu.unlock(e)}linkSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,r,i)}async sync(e,r,i){await this._mu.lock(e),await this.fs.sync(e,r,i),this._mu.unlock(e)}syncSync(e,r,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,r,i)}};s(jt,"LockedFS");var pn="/.deleted",$t=class extends oe{constructor(e,r,i,n,o){super(e,r,i,n,o)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this.buffer,this.stats),this.resetDirty())}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this.buffer,this.stats),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};s($t,"OverlayFile");var Pr=class extends J{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:r}){if(super(),this._writable=e,this._readable=r,this._writable.metadata().readonly)throw new c(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:zt.name,synchronous:this._readable.metadata().synchronous&&this._writable.metadata().synchronous,supportsProperties:this._readable.metadata().supportsProperties&&this._writable.metadata().supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,r,i){let n=i.cred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,r,i)}syncSync(e,r,i){let n=i.cred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,r,i)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(pn,F("r"),_e),{size:r}=await e.stat(),{buffer:i}=await e.read(new Uint8Array(r));this._deleteLog=X(i)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,r){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",r)}async rename(e,r,i){this.checkInitialized(),this.checkPath(e),this.checkPath(r);try{await this._writable.rename(e,r,i)}catch{if(this._deletedFiles.has(e))throw c.ENOENT(e)}}renameSync(e,r,i){this.checkInitialized(),this.checkPath(e),this.checkPath(r);try{this._writable.renameSync(e,r,i)}catch{if(this._deletedFiles.has(e))throw c.ENOENT(e)}}async stat(e,r){this.checkInitialized();try{return this._writable.stat(e,r)}catch{if(this._deletedFiles.has(e))throw c.ENOENT(e);let n=new M(await this._readable.stat(e,r));return n.mode|=146,n}}statSync(e,r){this.checkInitialized();try{return this._writable.statSync(e,r)}catch{if(this._deletedFiles.has(e))throw c.ENOENT(e);let n=new M(this._readable.statSync(e,r));return n.mode|=146,n}}async openFile(e,r,i){if(await this._writable.exists(e,i))return this._writable.openFile(e,r,i);let n=await this._readable.openFile(e,F("r"),i),o=new M(await n.stat()),{buffer:a}=await n.read(new Uint8Array(o.size));return new $t(this,e,r,o,a)}openFileSync(e,r,i){if(this._writable.existsSync(e,i))return this._writable.openFileSync(e,r,i);let n=this._readable.openFileSync(e,F("r"),i),o=M.clone(n.statSync()),a=new Uint8Array(o.size);return n.readSync(a),new $t(this,e,r,o,a)}async createFile(e,r,i,n){return this.checkInitialized(),await this._writable.createFile(e,r,i,n),this.openFile(e,r,n)}createFileSync(e,r,i,n){return this.checkInitialized(),this._writable.createFileSync(e,r,i,n),this.openFileSync(e,r,n)}async link(e,r,i){this.checkInitialized(),await this._writable.link(e,r,i)}linkSync(e,r,i){this.checkInitialized(),this._writable.linkSync(e,r,i)}async unlink(e,r){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,r))throw c.ENOENT(e);await this._writable.exists(e,r)&&await this._writable.unlink(e,r),await this.exists(e,r)&&this.deletePath(e,r)}unlinkSync(e,r){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,r))throw c.ENOENT(e);this._writable.existsSync(e,r)&&this._writable.unlinkSync(e,r),this.existsSync(e,r)&&this.deletePath(e,r)}async rmdir(e,r){if(this.checkInitialized(),!await this.exists(e,r))throw c.ENOENT(e);if(await this._writable.exists(e,r)&&await this._writable.rmdir(e,r),await this.exists(e,r)){if((await this.readdir(e,r)).length>0)throw c.ENOTEMPTY(e);this.deletePath(e,r)}}rmdirSync(e,r){if(this.checkInitialized(),!this.existsSync(e,r))throw c.ENOENT(e);if(this._writable.existsSync(e,r)&&this._writable.rmdirSync(e,r),this.existsSync(e,r)){if(this.readdirSync(e,r).length>0)throw c.ENOTEMPTY(e);this.deletePath(e,r)}}async mkdir(e,r,i){if(this.checkInitialized(),await this.exists(e,i))throw c.EEXIST(e);await this.createParentDirectories(e,i),await this._writable.mkdir(e,r,i)}mkdirSync(e,r,i){if(this.checkInitialized(),this.existsSync(e,i))throw c.EEXIST(e);this.createParentDirectoriesSync(e,i),this._writable.mkdirSync(e,r,i)}async readdir(e,r){if(this.checkInitialized(),!(await this.stat(e,r)).isDirectory())throw c.ENOTDIR(e);let n=[];try{n.push(...await this._writable.readdir(e,r))}catch{}try{n.push(...(await this._readable.readdir(e,r)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,r){if(this.checkInitialized(),!this.statSync(e,r).isDirectory())throw c.ENOTDIR(e);let n=[];try{n=n.concat(this._writable.readdirSync(e,r))}catch{}try{n=n.concat(this._readable.readdirSync(e,r).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,r){this._deletedFiles.add(e),this.updateLog(`d${e}
3
3
  `,r)}async updateLog(e,r){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let i=await this._writable.openFile(pn,F("w"),r);try{await i.write(R(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",r))}catch(n){this._deleteLogError=n}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let e of this._deleteLog.split(`
4
- `))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new c(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==pn)throw c.EPERM(e)}createParentDirectoriesSync(e,r){let i=x(e),n=[];for(;!this._writable.existsSync(i,r);)n.push(i),i=x(i);n=n.reverse();for(let o of n)this._writable.mkdirSync(o,this.statSync(o,r).mode,r)}async createParentDirectories(e,r){let i=x(e),n=[];for(;!await this._writable.exists(i,r);)n.push(i),i=x(i);n=n.reverse();for(let o of n){let a=await this.stat(o,r);await this._writable.mkdir(o,a.mode,r)}}operateOnWritable(e,r){if(!this.existsSync(e,r))throw c.ENOENT(e);this._writable.existsSync(e,r)||this.copyToWritableSync(e,r)}async operateOnWritableAsync(e,r){if(!await this.exists(e,r))throw c.ENOENT(e);if(!await this._writable.exists(e,r))return this.copyToWritable(e,r)}copyToWritableSync(e,r){let i=this.statSync(e,r);if(i.isDirectory()){this._writable.mkdirSync(e,i.mode,r);return}let n=new Uint8Array(i.size),o=this._readable.openFileSync(e,F("r"),r);o.readSync(n),o.closeSync();let a=this._writable.openFileSync(e,F("w"),r);a.writeSync(n),a.closeSync()}async copyToWritable(e,r){let i=await this.stat(e,r);if(i.isDirectory()){await this._writable.mkdir(e,i.mode,r);return}let n=new Uint8Array(i.size),o=await this._readable.openFile(e,F("r"),r);await o.read(n),await o.close();let a=await this._writable.openFile(e,F("w"),r);await a.write(n),await a.close()}};s(Pr,"UnlockedOverlayFS");var zt=class extends jt{async ready(){return await super.ready(),this}constructor(e){super(new Pr(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(zt,"OverlayFS");var tf={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new zt(t)}};var Qr={};ei(Qr,{BigIntStats:()=>K,Dir:()=>fi,Dirent:()=>st,ReadStream:()=>rn,Stats:()=>M,WriteStream:()=>nn,_toUnixTimestamp:()=>ws,access:()=>kd,accessSync:()=>kf,appendFile:()=>rd,appendFileSync:()=>cf,chmod:()=>_d,chmodSync:()=>Ef,chown:()=>wd,chownSync:()=>Sf,close:()=>nd,closeSync:()=>ot,constants:()=>Er,copyFile:()=>Rd,copyFileSync:()=>If,createReadStream:()=>Pd,createWriteStream:()=>Fd,exists:()=>Gf,existsSync:()=>mn,fchmod:()=>fd,fchmodSync:()=>_n,fchown:()=>ud,fchownSync:()=>Sn,fdatasync:()=>ad,fdatasyncSync:()=>df,fstat:()=>id,fstatSync:()=>uf,fsync:()=>sd,fsyncSync:()=>ff,ftruncate:()=>od,ftruncateSync:()=>xs,futimes:()=>dd,futimesSync:()=>En,initialize:()=>ci,lchmod:()=>Ed,lchmodSync:()=>xf,lchown:()=>Sd,lchownSync:()=>_f,link:()=>md,linkSync:()=>bf,lopenSync:()=>ui,lstat:()=>Xf,lstatSync:()=>of,lutimes:()=>vd,lutimesSync:()=>Af,mkdir:()=>pd,mkdirSync:()=>mf,mkdtemp:()=>Cd,mkdtempSync:()=>Tf,mount:()=>li,mounts:()=>Ee,open:()=>Zf,openSync:()=>Fr,opendir:()=>Dd,opendirSync:()=>Lf,promises:()=>yi,read:()=>cd,readFile:()=>ed,readFileSync:()=>Es,readSync:()=>pf,readdir:()=>yd,readdirSync:()=>xn,readlink:()=>gd,readlinkSync:()=>wf,readv:()=>Od,readvSync:()=>Pf,realpath:()=>Ad,realpathSync:()=>vn,rename:()=>Kf,renameSync:()=>nf,rm:()=>Ld,rmSync:()=>Nf,rmdir:()=>hd,rmdirSync:()=>yf,stat:()=>Yf,statSync:()=>bn,symlink:()=>bd,symlinkSync:()=>gf,truncate:()=>Jf,truncateSync:()=>sf,umount:()=>yn,unlink:()=>Qf,unlinkSync:()=>_s,unwatchFile:()=>Td,utimes:()=>xd,utimesSync:()=>vf,watch:()=>Id,watchFile:()=>Nd,write:()=>ld,writeFile:()=>td,writeFileSync:()=>wn,writeSync:()=>hf,writev:()=>Bd,writevSync:()=>Ff});function ws(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(ws,"_toUnixTimestamp");function xe(t,e){switch(typeof t){case"number":return t;case"string":let r=parseInt(t,8);if(!isNaN(r))return r}if(typeof e=="number")return e;throw new c(22,"Invalid mode: "+t?.toString())}s(xe,"normalizeMode");function Vt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new c(22,"Invalid time.")}s(Vt,"normalizeTime");function W(t){if(t.indexOf("\0")>=0)throw new c(22,"Path must be a string without null bytes.");if(t==="")throw new c(22,"Path must not be empty.");return t=t.replaceAll(/\/+/g,"/"),Te(t)}s(W,"normalizePath");function ve(t,e,r,i){switch(t===null?"null":typeof t){case"object":return{encoding:typeof t.encoding<"u"?t.encoding:e,flag:typeof t.flag<"u"?t.flag:r,mode:xe(t.mode,i)};case"string":return{encoding:t,flag:r,mode:i};case"null":case"undefined":case"function":return{encoding:e,flag:r,mode:i};default:throw new TypeError(`"options" must be a string or an object, got ${typeof t} instead.`)}}s(ve,"normalizeOptions");function _(){}s(_,"nop");var A=_e;function Ss(t){A=t}s(Ss,"setCred");var mt=new Map,rf=100;function Ht(t){let e=rf++;return mt.set(e,t),e}s(Ht,"getFdForFile");function T(t){if(!mt.has(t))throw new c(9);return mt.get(t)}s(T,"fd2file");var Ee=new Map;li("/",hn.create({name:"root"}));function li(t,e){if(t[0]!=="/"&&(t="/"+t),t=Te(t),Ee.has(t))throw new c(22,"Mount point "+t+" is already in use.");Ee.set(t,e)}s(li,"mount");function yn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Te(t),!Ee.has(t))throw new c(22,"Mount point "+t+" is already unmounted.");Ee.delete(t)}s(yn,"umount");function me(t){t=W(t);let e=[...Ee].sort((r,i)=>r[0].length>i[0].length?-1:1);for(let[r,i]of e)if(r.length<=t.length&&t.startsWith(r))return t=t.slice(r.length>1?r.length:0),t===""&&(t="/"),{fs:i,path:t,mountPoint:r};throw new c(5,"ZenFS not initialized with a file system")}s(me,"resolveFS");function gs(t,e){for(let[r,i]of Object.entries(e))t=t?.replaceAll(r,i);return t}s(gs,"fixPaths");function nt(t,e){return typeof t.stack=="string"&&(t.stack=gs(t.stack,e)),t.message=gs(t.message,e),t}s(nt,"fixError");function ci(t){"/"in t&&yn("/");for(let[e,r]of Object.entries(t))li(e,r)}s(ci,"initialize");var yi={};ei(yi,{FileHandle:()=>ue,access:()=>qn,appendFile:()=>In,chmod:()=>Dn,chown:()=>On,constants:()=>Er,copyFile:()=>Hf,createReadStream:()=>jf,createWriteStream:()=>$f,exists:()=>Cr,fchmod:()=>Df,fchown:()=>Bf,futimes:()=>Mf,lchmod:()=>Mn,lchown:()=>Bn,link:()=>Ln,lopen:()=>hi,lstat:()=>kn,lutimes:()=>Wn,mkdir:()=>Fn,mkdtemp:()=>Vf,open:()=>at,read:()=>Of,readFile:()=>pi,readdir:()=>Lr,readlink:()=>Rn,realpath:()=>Dr,rename:()=>An,rm:()=>zf,rmdir:()=>Pn,stat:()=>Rr,symlink:()=>Cn,truncate:()=>Nn,unlink:()=>di,unwatchFile:()=>Wf,utimes:()=>Un,watch:()=>qf,watchFile:()=>Uf,write:()=>Rf,writeFile:()=>Br});function ce(...[t,e,r,...i]){r=W(r);let{fs:n,path:o}=me(e&&mn(r)?vn(r):r);try{return n[t](o,...i)}catch(a){throw nt(a,{[o]:r})}}s(ce,"doOp");function nf(t,e){t=W(t),e=W(e);let r=me(t),i=me(e),n={[r.path]:t,[i.path]:e};try{if(r===i)return r.fs.renameSync(r.path,i.path,A);let o=Es(t);wn(e,o),_s(t)}catch(o){throw nt(o,n)}}s(nf,"renameSync");function mn(t){t=W(t);try{let{fs:e,path:r}=me(t);return e.existsSync(r,A)}catch(e){if(e.errno==2)return!1;throw e}}s(mn,"existsSync");function bn(t,e){let r=ce("statSync",!0,t,A);return e?.bigint?new K(r):r}s(bn,"statSync");function of(t,e){let r=ce("statSync",!1,t,A);return e?.bigint?new K(r):r}s(of,"lstatSync");function sf(t,e=0){let r=Fr(t,"r+");try{xs(r,e)}finally{ot(r)}}s(sf,"truncateSync");function _s(t){return ce("unlinkSync",!1,t,A)}s(_s,"unlinkSync");function Kt(t,e,r,i){let n=W(t),o=xe(r,420),a=F(e),l;try{l=ce("statSync",i,n,A)}catch{switch(kr(a)){case 3:if(!ce("statSync",i,x(n),A).isDirectory())throw c.ENOTDIR(x(n));return ce("createFileSync",i,n,a,o,A);case 1:throw c.ENOENT(n);default:throw new c(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,A))throw c.EACCES(n);switch(Ar(a)){case 1:throw c.EEXIST(n);case 2:return ce("unlinkSync",i,n,A),ce("createFileSync",i,n,a,l.mode,A);case 0:return ce("openFileSync",i,n,a,A);default:throw new c(22,"Invalid FileFlag object.")}}s(Kt,"_openSync");function Fr(t,e,r){return Ht(Kt(t,e,r,!0))}s(Fr,"openSync");function ui(t,e,r){return Ht(Kt(t,e,r,!1))}s(ui,"lopenSync");function gn(t,e,r){let i=Kt(t,e,420,r);try{let n=i.statSync(),o=new Uint8Array(n.size);return i.readSync(o,0,n.size,0),i.closeSync(),o}finally{i.closeSync()}}s(gn,"_readFileSync");function Es(t,e={}){let r=ve(e,null,"r",420),i=F(r.flag);if(!ze(i))throw new c(22,"Flag passed to readFile must allow for reading.");let n=gn(t,r.flag,!0);return r.encoding?X(n,r.encoding):n}s(Es,"readFileSync");function af(t,e,r,i,n){let o=Kt(t,r,i,n);try{o.writeSync(e,0,e.length,0)}finally{o.closeSync()}}s(af,"_writeFileSync");function wn(t,e,r){let i=ve(r,"utf8","w",420),n=F(i.flag);if(!ye(n))throw new c(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e,i.encoding):e;if(o===void 0)throw new c(22,"Data not specified");af(t,o,i.flag,i.mode,!0)}s(wn,"writeFileSync");function lf(t,e,r,i,n){let o=Kt(t,r,i,n);try{o.writeSync(e,0,e.length,null)}finally{o.closeSync()}}s(lf,"_appendFileSync");function cf(t,e,r){let i=ve(r,"utf8","a",420),n=F(i.flag);if(!it(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;lf(t,o,i.flag,i.mode,!0)}s(cf,"appendFileSync");function uf(t,e){let r=T(t).statSync();return e?.bigint?new K(r):r}s(uf,"fstatSync");function ot(t){T(t).closeSync(),mt.delete(t)}s(ot,"closeSync");function xs(t,e=0){if(e<0)throw new c(22);T(t).truncateSync(e)}s(xs,"ftruncateSync");function ff(t){T(t).syncSync()}s(ff,"fsyncSync");function df(t){T(t).datasyncSync()}s(df,"fdatasyncSync");function hf(t,e,r,i,n){let o,a=0,l,u;if(typeof e=="string"){u=typeof r=="number"?r:null;let d=typeof i=="string"?i:"utf8";a=0,o=R(e,d),l=o.length}else o=e,a=r,l=i,u=typeof n=="number"?n:null;let f=T(t);return u==null&&(u=f.position),f.writeSync(o,a,l,u)}s(hf,"writeSync");function pf(t,e,r,i,n){let o=T(t),a=r;return typeof r=="object"&&({offset:a,length:i,position:n}=r),isNaN(+n)&&(n=o.position),o.readSync(e,a,i,n)}s(pf,"readSync");function Sn(t,e,r){T(t).chownSync(e,r)}s(Sn,"fchownSync");function _n(t,e){let r=xe(e,-1);if(r<0)throw new c(22,"Invalid mode.");T(t).chmodSync(r)}s(_n,"fchmodSync");function En(t,e,r){T(t).utimesSync(Vt(e),Vt(r))}s(En,"futimesSync");function yf(t){return ce("rmdirSync",!0,t,A)}s(yf,"rmdirSync");function mf(t,e){let r=typeof e=="number"||typeof e=="string"?e:e?.mode,i=typeof e=="object"&&e?.recursive;ce("mkdirSync",!0,t,xe(r,511),A)}s(mf,"mkdirSync");function xn(t,e){t=W(t);let r=ce("readdirSync",!0,t,A);for(let i of Ee.keys()){if(!i.startsWith(t))continue;let n=i.slice(t.length);n.includes("/")||n.length==0||r.push(n)}return r.map(i=>typeof e=="object"&&e?.withFileTypes?new st(i,bn(de(t,i))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?R(i):i)}s(xn,"readdirSync");function bf(t,e){return e=W(e),ce("linkSync",!1,t,e,A)}s(bf,"linkSync");function gf(t,e,r="file"){if(!["file","dir","junction"].includes(r))throw new c(22,"Invalid type: "+r);if(mn(e))throw c.EEXIST(e);wn(e,t),Kt(e,"r+",420,!1)._setTypeSync(U.SYMLINK)}s(gf,"symlinkSync");function wf(t,e){let r=gn(t,"r",!1),i=typeof e=="object"?e.encoding:e;return i=="buffer"?r:X(r,i)}s(wf,"readlinkSync");function Sf(t,e,r){let i=Fr(t,"r+");Sn(i,e,r),ot(i)}s(Sf,"chownSync");function _f(t,e,r){let i=ui(t,"r+");Sn(i,e,r),ot(i)}s(_f,"lchownSync");function Ef(t,e){let r=Fr(t,"r+");_n(r,e),ot(r)}s(Ef,"chmodSync");function xf(t,e){let r=ui(t,"r+");_n(r,e),ot(r)}s(xf,"lchmodSync");function vf(t,e,r){let i=Fr(t,"r+");En(i,e,r),ot(i)}s(vf,"utimesSync");function Af(t,e,r){let i=ui(t,"r+");En(i,e,r),ot(i)}s(Af,"lutimesSync");function vn(t,e){t=W(t);let{fs:r,path:i,mountPoint:n}=me(t);try{if(!r.statSync(i,A).isSymbolicLink())return t;let a=W(n+X(gn(i,"r+",!1)));return vn(a)}catch(o){throw nt(o,{[i]:t})}}s(vn,"realpathSync");function kf(t,e=384){if(!bn(t).hasAccess(e,A))throw new c(13)}s(kf,"accessSync");function Nf(t){throw new c(95)}s(Nf,"rmSync");function Tf(t,e){throw new c(95)}s(Tf,"mkdtempSync");function If(t,e,r){throw new c(95)}s(If,"copyFileSync");function Pf(t,e,r){throw new c(95)}s(Pf,"readvSync");function Ff(t,e,r){throw new c(95)}s(Ff,"writevSync");function Lf(t,e){throw new c(95)}s(Lf,"opendirSync");var st=class{constructor(e,r){this.name=e;this.stats=r}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(st,"Dirent");var fi=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new c(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Lr(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(r=>e(null,r))}readSync(){return this._entries||(this._entries=xn(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let r=await e._read();return r!=null?{done:!1,value:r}:(await e.close(),{done:!0,value:void 0})}}}};s(fi,"Dir");var ue=class{constructor(e){this.fd=e}chown(e,r){return T(this.fd).chown(e,r)}chmod(e){let r=xe(e,-1);if(r<0)throw new c(22,"Invalid mode.");return T(this.fd).chmod(r)}datasync(){return T(this.fd).datasync()}sync(){return T(this.fd).sync()}truncate(e){if(e<0)throw new c(22);return T(this.fd).truncate(e)}utimes(e,r){return T(this.fd).utimes(Vt(e),Vt(r))}async appendFile(e,r){let i=ve(r,"utf8","a",420),n=F(i.flag);if(!it(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;await T(this.fd).write(o,0,o.length,null)}read(e,r,i,n){return isNaN(+n)&&(n=T(this.fd).position),T(this.fd).read(e,r,i,n)}async readFile(e){let r=ve(e,null,"r",null),i=F(r.flag);if(!ze(i))throw new c(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),o=new Uint8Array(n);return await T(this.fd).read(o,0,n,0),r.encoding?X(o,r.encoding):o}async stat(e){let r=await T(this.fd).stat();return e?.bigint?new K(r):r}async write(e,r,i,n){let o,a=0,l;if(typeof e=="string"){n=typeof r=="number"?r:null;let f=typeof i=="string"?i:"utf8";a=0,o=R(e,f),l=o.length}else o=e,a=r,l=i,n=typeof n=="number"?n:null;n??=T(this.fd).position;let u=await T(this.fd).write(o,a,l,n);return{buffer:o,bytesWritten:u}}async writeFile(e,r){let i=ve(r,"utf8","w",420),n=F(i.flag);if(!ye(n))throw new c(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e,i.encoding):e;await T(this.fd).write(o,0,o.length,0)}writev(e,r){throw new c(95)}readv(e,r){throw new c(95)}async close(){await T(this.fd).close(),mt.delete(this.fd)}};s(ue,"FileHandle");async function Ae(...[t,e,r,...i]){r=W(r);let{fs:n,path:o}=me(e&&await Cr(r)?await Dr(r):r);try{return n[t](o,...i)}catch(a){throw nt(a,{[o]:r})}}s(Ae,"doOp");async function An(t,e){t=W(t),e=W(e);let{path:r}=me(t),{fs:i,path:n}=me(e);try{let o=await pi(t);await Br(e,o),await di(t)}catch(o){throw nt(o,{[r]:t,[n]:e})}}s(An,"rename");async function Cr(t){try{let{fs:e,path:r}=me(t);return e.exists(r,A)}catch(e){if(e.errno==2)return!1;throw e}}s(Cr,"exists");async function Rr(t,e){let r=await Ae("stat",!0,t,A);return e?.bigint?new K(r):r}s(Rr,"stat");async function kn(t,e){let r=await Ae("stat",!1,t,A);return e?.bigint?new K(r):r}s(kn,"lstat");async function Nn(t,e=0){let r=await at(t,"r+");try{await r.truncate(e)}finally{await r.close()}}s(Nn,"truncate");async function di(t){return Ae("unlink",!1,t,A)}s(di,"unlink");async function Or(t,e,r=420,i){let n=W(t),o=xe(r,420),a=F(e);try{switch(Ar(a)){case 1:throw c.EEXIST(n);case 2:let l=await Ae("openFile",i,n,a,A);if(!l)throw new c(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await Ae("openFile",i,n,a,A);default:throw new c(22,"Invalid file flag")}}catch{switch(kr(a)){case 3:let u=await Ae("stat",i,x(n),A);if(u&&!u.isDirectory())throw c.ENOTDIR(x(n));return await Ae("createFile",i,n,a,o,A);case 1:throw c.ENOENT(n);default:throw new c(22,"Invalid file flag")}}}s(Or,"_open");async function at(t,e,r=420){let i=await Or(t,e,r,!0);return new ue(Ht(i))}s(at,"open");async function hi(t,e,r=420){let i=await Or(t,e,r,!1);return new ue(Ht(i))}s(hi,"lopen");async function Tn(t,e,r){let i=await Or(W(t),e,420,r);try{let n=await i.stat(),o=new Uint8Array(n.size);return await i.read(o,0,n.size,0),await i.close(),o}catch(n){throw await i.close(),n}}s(Tn,"_readFile");async function pi(t,e){let r=ve(e,null,"r",null),i=F(r.flag);if(!ze(i))throw new c(22,"Flag passed must allow for reading.");let n=await Tn(t,r.flag,!0);return r.encoding?X(n,r.encoding):n}s(pi,"readFile");async function Br(t,e,r){let i=ve(r,"utf8","w",420),n=await at(t,i.flag,i.mode);try{await n.writeFile(e,i)}finally{await n.close()}}s(Br,"writeFile");async function Cf(t,e,r,i,n){let o=await Or(t,r,i,n);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(Cf,"_appendFile");async function In(t,e,r){let i=ve(r,"utf8","a",420),n=F(i.flag);if(!it(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;await Cf(t,o,i.flag,i.mode,!0)}s(In,"appendFile");function Rf(t,e,r,i,n){return t.write(e,r,i,n)}s(Rf,"write");function Of(t,e,r,i,n){return t.read(e,r,i,n)}s(Of,"read");function Bf(t,e,r){return t.chown(e,r)}s(Bf,"fchown");function Df(t,e){return t.chmod(e)}s(Df,"fchmod");function Mf(t,e,r){return t.utimes(e,r)}s(Mf,"futimes");async function Pn(t){return Ae("rmdir",!0,t,A)}s(Pn,"rmdir");async function Fn(t,e){await Ae("mkdir",!0,t,xe(typeof e=="object"?e?.mode:e,511),A)}s(Fn,"mkdir");async function Lr(t,e){t=W(t);let r=await Ae("readdir",!0,t,A),i=[...Ee.keys()];for(let o of i)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;r.push(a)}let n=[];for(let o of r)n.push(typeof e=="object"&&e?.withFileTypes?new st(o,await Rr(de(t,o))):o);return n}s(Lr,"readdir");async function Ln(t,e){return e=W(e),Ae("link",!1,t,e,A)}s(Ln,"link");async function Cn(t,e,r="file"){if(!["file","dir","junction"].includes(r))throw new c(22,"Invalid symlink type: "+r);if(await Cr(e))throw c.EEXIST(e);await Br(e,t),await(await Or(e,"r+",420,!1))._setType(U.SYMLINK)}s(Cn,"symlink");async function Rn(t,e){let r=await Tn(t,"r",!1),i=typeof e=="object"?e.encoding:e;return i=="buffer"?r:X(r,i)}s(Rn,"readlink");async function On(t,e,r){let i=await at(t,"r+");try{await i.chown(e,r)}finally{await i.close()}}s(On,"chown");async function Bn(t,e,r){let i=await hi(t,"r+");try{await i.chown(e,r)}finally{await i.close()}}s(Bn,"lchown");async function Dn(t,e){let r=await at(t,"r+");try{await r.chmod(e)}finally{await r.close()}}s(Dn,"chmod");async function Mn(t,e){let r=await hi(t,"r+");try{await r.chmod(e)}finally{await r.close()}}s(Mn,"lchmod");async function Un(t,e,r){let i=await at(t,"r+");try{await i.utimes(e,r)}finally{await i.close()}}s(Un,"utimes");async function Wn(t,e,r){let i=await hi(t,"r+");try{await i.utimes(e,r)}finally{await i.close()}}s(Wn,"lutimes");async function Dr(t,e){t=W(t);let{fs:r,path:i,mountPoint:n}=me(t);try{if(!(await r.stat(i,A)).isSymbolicLink())return t;let a=n+W(X(await Tn(i,"r+",!1)));return Dr(a)}catch(o){throw nt(o,{[i]:t})}}s(Dr,"realpath");async function Uf(t,e,r=_){throw new c(95)}s(Uf,"watchFile");async function Wf(t,e=_){throw new c(95)}s(Wf,"unwatchFile");async function qf(t,e,r=_){throw new c(95)}s(qf,"watch");async function qn(t,e=384){if(!(await Rr(t)).hasAccess(e,A))throw new c(13)}s(qn,"access");async function jf(t,e){throw new c(95)}s(jf,"createReadStream");async function $f(t,e){throw new c(95)}s($f,"createWriteStream");async function zf(t){throw new c(95)}s(zf,"rm");async function Vf(t){throw new c(95)}s(Vf,"mkdtemp");async function Hf(t){throw new c(95)}s(Hf,"copyFile");function Kf(t,e,r=_){An(t,e).then(()=>r()).catch(r)}s(Kf,"rename");function Gf(t,e=_){Cr(t).then(e).catch(()=>e(!1))}s(Gf,"exists");function Yf(t,e,r=_){r=typeof e=="function"?e:r,Rr(t,typeof e!="function"?e:{}).then(i=>r(null,i)).catch(r)}s(Yf,"stat");function Xf(t,e,r=_){r=typeof e=="function"?e:r,kn(t,typeof e!="function"?e:{}).then(i=>r(null,i)).catch(r)}s(Xf,"lstat");function Jf(t,e=0,r=_){r=typeof e=="function"?e:r,Nn(t,typeof e=="number"?e:0).then(()=>r()).catch(r)}s(Jf,"truncate");function Qf(t,e=_){di(t).then(()=>e()).catch(e)}s(Qf,"unlink");function Zf(t,e,r,i=_){let n=xe(r,420);i=typeof r=="function"?r:i,at(t,e,n).then(o=>i(null,o.fd)).catch(i)}s(Zf,"open");function ed(t,e,r=_){r=typeof e=="function"?e:r,pi(t,typeof e=="function"?null:e).then(i=>r(null,i)).catch(r)}s(ed,"readFile");function td(t,e,r,i=_){i=typeof r=="function"?r:i,Br(t,e,typeof r!="function"?r:null).then(()=>i(null)).catch(i)}s(td,"writeFile");function rd(t,e,r,i=_){i=typeof r=="function"?r:i,In(t,e,typeof r=="function"?null:r)}s(rd,"appendFile");function id(t,e,r=_){r=typeof e=="function"?e:r,T(t).stat().then(i=>r(null,typeof e=="object"&&e?.bigint?new K(i):i)).catch(r)}s(id,"fstat");function nd(t,e=_){new ue(t).close().then(()=>e()).catch(e)}s(nd,"close");function od(t,e,r=_){let i=typeof e=="number"?e:0;r=typeof e=="function"?e:r;let n=T(t);if(i<0)throw new c(22);n.truncate(i).then(()=>r()).catch(r)}s(od,"ftruncate");function sd(t,e=_){T(t).sync().then(()=>e()).catch(e)}s(sd,"fsync");function ad(t,e=_){T(t).datasync().then(()=>e()).catch(e)}s(ad,"fdatasync");function ld(t,e,r,i,n,o=_){let a,l,u,f=null,d,h=new ue(t);if(typeof e=="string"){switch(d="utf8",typeof r){case"function":o=r;break;case"number":f=r,d=typeof i=="string"?i:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof i=="function"?i:typeof n=="function"?n:o,o(new c(22,"Invalid arguments."));return}a=R(e),l=0,u=a.length;let m=o;h.write(a,l,u,f).then(({bytesWritten:y})=>m(null,y,X(a))).catch(m)}else{a=e,l=r,u=i,f=typeof n=="number"?n:null;let m=typeof n=="function"?n:o;h.write(a,l,u,f).then(({bytesWritten:y})=>m(null,y,a)).catch(m)}}s(ld,"write");function cd(t,e,r,i,n,o=_){new ue(t).read(e,r,i,n).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(cd,"read");function ud(t,e,r,i=_){new ue(t).chown(e,r).then(()=>i()).catch(i)}s(ud,"fchown");function fd(t,e,r){new ue(t).chmod(e).then(()=>r()).catch(r)}s(fd,"fchmod");function dd(t,e,r,i=_){new ue(t).utimes(e,r).then(()=>i()).catch(i)}s(dd,"futimes");function hd(t,e=_){Pn(t).then(()=>e()).catch(e)}s(hd,"rmdir");function pd(t,e,r=_){Fn(t,e).then(()=>r()).catch(r)}s(pd,"mkdir");function yd(t,e,r=_){r=typeof e=="function"?e:r,Lr(t,typeof e!="function"?e:{}).then(n=>r(null,n)).catch(r)}s(yd,"readdir");function md(t,e,r=_){Ln(t,e).then(()=>r()).catch(r)}s(md,"link");function bd(t,e,r,i=_){let n=typeof r=="string"?r:"file";i=typeof r=="function"?r:i,Cn(t,e,n).then(()=>i()).catch(i)}s(bd,"symlink");function gd(t,e,r=_){r=typeof e=="function"?e:r,Rn(t).then(i=>r(null,i)).catch(r)}s(gd,"readlink");function wd(t,e,r,i=_){On(t,e,r).then(()=>i()).catch(i)}s(wd,"chown");function Sd(t,e,r,i=_){Bn(t,e,r).then(()=>i()).catch(i)}s(Sd,"lchown");function _d(t,e,r=_){Dn(t,e).then(()=>r()).catch(r)}s(_d,"chmod");function Ed(t,e,r=_){Mn(t,e).then(()=>r()).catch(r)}s(Ed,"lchmod");function xd(t,e,r,i=_){Un(t,e,r).then(()=>i()).catch(i)}s(xd,"utimes");function vd(t,e,r,i=_){Wn(t,e,r).then(()=>i()).catch(i)}s(vd,"lutimes");function Ad(t,e,r=_){r=typeof e=="function"?e:r,Dr(t,typeof e=="function"?null:e).then(i=>r(null,i)).catch(r)}s(Ad,"realpath");function kd(t,e,r=_){let i=typeof e=="number"?e:4;r=typeof e=="function"?e:r,qn(t,typeof e=="function"?null:e).then(()=>r()).catch(r)}s(kd,"access");function Nd(t,e,r=_){throw new c(95)}s(Nd,"watchFile");function Td(t,e=_){throw new c(95)}s(Td,"unwatchFile");function Id(t,e,r=_){throw new c(95)}s(Id,"watch");function Pd(t,e){throw new c(95)}s(Pd,"createReadStream");function Fd(t,e){throw new c(95)}s(Fd,"createWriteStream");function Ld(t){new c(95)}s(Ld,"rm");function Cd(t){new c(95)}s(Cd,"mkdtemp");function Rd(t,e,r,i){new c(95)}s(Rd,"copyFile");function Od(t){new c(95)}s(Od,"readv");function Bd(t,e,r,i){throw new c(95)}s(Bd,"writev");function Dd(t){throw new c(95)}s(Dd,"opendir");var on=su(Qc(),1);var rn=class extends on.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(r){e(r)}}bytesRead;path;pending;addListener(e,r){return super.addListener(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}prependListener(e,r){return super.prependListener(e,r)}prependOnceListener(e,r){return super.prependOnceListener(e,r)}};s(rn,"ReadStream");var nn=class extends on.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(r){e(r)}}bytesWritten;path;pending;addListener(e,r){return super.addListener(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}prependListener(e,r){return super.prependListener(e,r)}prependOnceListener(e,r){return super.prependOnceListener(e,r)}};s(nn,"WriteStream");function Zc(t,e=0,r=0){Ss({uid:e,gid:r,suid:e,sgid:r,euid:e,egid:r}),ci(t)}s(Zc,"initialize");async function qg(t){("backend"in t||t instanceof J)&&(t={"/":t});for(let[e,r]of Object.entries(t))typeof r!="number"&&(r instanceof J||(br(r)&&(r={backend:r}),t[e]=await ri(r)));Zc(t)}s(qg,"configure");var Ft=class{static FromListing(e){let r=new Ft,i=new et;r._index.set("/",i);let n=[{pwd:"",tree:e,parent:i}];for(;n.length>0;){let o,{tree:a,pwd:l,parent:u}=n.pop();for(let f in a){if(!Object.hasOwn(a,f))continue;let d=a[f];if(d){let h=l+"/"+f;o=new et,r._index.set(h,o),n.push({pwd:h,tree:d,parent:o})}else o=new Zr(new M({mode:U.FILE|365}));u&&u._listing.set(f,o)}}return r}_index=new Map;constructor(){this.add("/",new et)}files(){let e=[];for(let r of this._index.values())for(let i of r.listing){let n=r.get(i);n?.isFile()&&e.push(n)}return e}add(e,r){if(!r)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===r;let i=x(e),n=this._index.get(i);return!n&&e!="/"&&(n=new et,!this.add(i,n))||e!="/"&&!n.add(C(e),r)?!1:(r.isDirectory()&&this._index.set(e,r),!0)}addFast(e,r){let i=x(e),n=C(e),o=this._index.get(i);return o||(o=new et,this.addFast(i,o)),o.add(n,r)?(r.isDirectory()&&this._index.set(e,r),!0):!1}remove(e){let r=x(e),i=this._index.get(r);if(!i)return;let n=i.remove(C(e));if(!n)return;if(!n.isDirectory())return n;let o=n.listing;for(let a of o)this.remove(de(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let r=x(e),i=this._index.get(r);return r==e?i:i?.get(C(e))}};s(Ft,"FileIndex");var hr=class{constructor(e){this.data=e}};s(hr,"IndexInode");var Zr=class extends hr{isFile(){return!0}isDirectory(){return!1}toStats(){return new M({mode:U.FILE|438,size:4096})}};s(Zr,"IndexFileInode");var et=class extends hr{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new M({mode:U.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,r){return this._listing.has(e)?!1:(this._listing.set(e,r),!0)}remove(e){let r=this._listing.get(e);if(r)return this._listing.delete(e),r}};s(et,"IndexDirInode");var pr=class extends dn(J){_index;constructor(e){super(),this._index=Ft.FromListing(e)}async stat(e){let r=this._index.get(e);if(!r)throw c.ENOENT(e);if(r.isDirectory())return r.stats;if(r.isFile())return this.statFileInode(r,e);throw new c(22,"Invalid inode.")}statSync(e){let r=this._index.get(e);if(!r)throw c.ENOENT(e);if(r.isDirectory())return r.stats;if(r.isFile())return this.statFileInodeSync(r,e);throw new c(22,"Invalid inode.")}async openFile(e,r,i){if(ye(r))throw new c(1,e);let n=this._index.get(e);if(!n)throw c.ENOENT(e);if(!n.toStats().hasAccess(rt(r),i))throw c.EACCES(e);if(n.isDirectory()){let o=n.stats;return new pt(this,e,r,o,o.fileData)}return this.openFileInode(n,e,r)}openFileSync(e,r,i){if(ye(r))throw new c(1,e);let n=this._index.get(e);if(!n)throw c.ENOENT(e);if(!n.toStats().hasAccess(rt(r),i))throw c.EACCES(e);if(n.isDirectory()){let o=n.stats;return new pt(this,e,r,o,o.fileData)}return this.openFileInodeSync(n,e,r)}async readdir(e){let r=this._index.get(e);if(!r)throw c.ENOENT(e);if(r.isDirectory())return r.listing;throw c.ENOTDIR(e)}readdirSync(e){let r=this._index.get(e);if(!r)throw c.ENOENT(e);if(r.isDirectory())return r.listing;throw c.ENOTDIR(e)}};s(pr,"FileIndexFS");var sn=class extends ht(pr){async statFileInode(e,r){return this.statFileInodeSync(e,r)}async openFileInode(e,r,i){return this.openFileInodeSync(e,r,i)}};s(sn,"SyncFileIndexFS");var an=class extends gr(pr){statFileInodeSync(){throw new c(95)}openFileInodeSync(){throw new c(95)}};s(an,"AsyncFileIndexFS");var jg=Qr;return au($g);})();
4
+ `))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new c(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==pn)throw c.EPERM(e)}createParentDirectoriesSync(e,r){let i=x(e),n=[];for(;!this._writable.existsSync(i,r);)n.push(i),i=x(i);n=n.reverse();for(let o of n)this._writable.mkdirSync(o,this.statSync(o,r).mode,r)}async createParentDirectories(e,r){let i=x(e),n=[];for(;!await this._writable.exists(i,r);)n.push(i),i=x(i);n=n.reverse();for(let o of n){let a=await this.stat(o,r);await this._writable.mkdir(o,a.mode,r)}}operateOnWritable(e,r){if(!this.existsSync(e,r))throw c.ENOENT(e);this._writable.existsSync(e,r)||this.copyToWritableSync(e,r)}async operateOnWritableAsync(e,r){if(!await this.exists(e,r))throw c.ENOENT(e);if(!await this._writable.exists(e,r))return this.copyToWritable(e,r)}copyToWritableSync(e,r){let i=this.statSync(e,r);if(i.isDirectory()){this._writable.mkdirSync(e,i.mode,r);return}let n=new Uint8Array(i.size),o=this._readable.openFileSync(e,F("r"),r);o.readSync(n),o.closeSync();let a=this._writable.openFileSync(e,F("w"),r);a.writeSync(n),a.closeSync()}async copyToWritable(e,r){let i=await this.stat(e,r);if(i.isDirectory()){await this._writable.mkdir(e,i.mode,r);return}let n=new Uint8Array(i.size),o=await this._readable.openFile(e,F("r"),r);await o.read(n),await o.close();let a=await this._writable.openFile(e,F("w"),r);await a.write(n),await a.close()}};s(Pr,"UnlockedOverlayFS");var zt=class extends jt{async ready(){return await super.ready(),this}constructor(e){super(new Pr(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(zt,"OverlayFS");var tf={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new zt(t)}};var Qr={};ei(Qr,{BigIntStats:()=>K,Dir:()=>fi,Dirent:()=>st,ReadStream:()=>rn,Stats:()=>M,WriteStream:()=>nn,_toUnixTimestamp:()=>ws,access:()=>kd,accessSync:()=>kf,appendFile:()=>rd,appendFileSync:()=>cf,chmod:()=>_d,chmodSync:()=>Ef,chown:()=>wd,chownSync:()=>Sf,close:()=>nd,closeSync:()=>ot,constants:()=>Er,copyFile:()=>Rd,copyFileSync:()=>If,createReadStream:()=>Pd,createWriteStream:()=>Fd,exists:()=>Gf,existsSync:()=>mn,fchmod:()=>fd,fchmodSync:()=>_n,fchown:()=>ud,fchownSync:()=>Sn,fdatasync:()=>ad,fdatasyncSync:()=>df,fstat:()=>id,fstatSync:()=>uf,fsync:()=>sd,fsyncSync:()=>ff,ftruncate:()=>od,ftruncateSync:()=>xs,futimes:()=>dd,futimesSync:()=>En,initialize:()=>ci,lchmod:()=>Ed,lchmodSync:()=>xf,lchown:()=>Sd,lchownSync:()=>_f,link:()=>md,linkSync:()=>bf,lopenSync:()=>ui,lstat:()=>Xf,lstatSync:()=>of,lutimes:()=>vd,lutimesSync:()=>Af,mkdir:()=>pd,mkdirSync:()=>mf,mkdtemp:()=>Ld,mkdtempSync:()=>Tf,mount:()=>li,mounts:()=>Ee,open:()=>Zf,openSync:()=>Fr,opendir:()=>Dd,opendirSync:()=>Cf,promises:()=>yi,read:()=>cd,readFile:()=>ed,readFileSync:()=>Es,readSync:()=>pf,readdir:()=>yd,readdirSync:()=>xn,readlink:()=>gd,readlinkSync:()=>wf,readv:()=>Od,readvSync:()=>Pf,realpath:()=>Ad,realpathSync:()=>vn,rename:()=>Kf,renameSync:()=>nf,rm:()=>Cd,rmSync:()=>Nf,rmdir:()=>hd,rmdirSync:()=>yf,stat:()=>Yf,statSync:()=>bn,symlink:()=>bd,symlinkSync:()=>gf,truncate:()=>Jf,truncateSync:()=>sf,umount:()=>yn,unlink:()=>Qf,unlinkSync:()=>_s,unwatchFile:()=>Td,utimes:()=>xd,utimesSync:()=>vf,watch:()=>Id,watchFile:()=>Nd,write:()=>ld,writeFile:()=>td,writeFileSync:()=>wn,writeSync:()=>hf,writev:()=>Bd,writevSync:()=>Ff});function ws(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(ws,"_toUnixTimestamp");function xe(t,e){switch(typeof t){case"number":return t;case"string":let r=parseInt(t,8);if(!isNaN(r))return r}if(typeof e=="number")return e;throw new c(22,"Invalid mode: "+t?.toString())}s(xe,"normalizeMode");function Vt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new c(22,"Invalid time.")}s(Vt,"normalizeTime");function W(t){if(t.indexOf("\0")>=0)throw new c(22,"Path must be a string without null bytes.");if(t==="")throw new c(22,"Path must not be empty.");return t=t.replaceAll(/\/+/g,"/"),Te(t)}s(W,"normalizePath");function ve(t,e,r,i){switch(t===null?"null":typeof t){case"object":return{encoding:typeof t.encoding<"u"?t.encoding:e,flag:typeof t.flag<"u"?t.flag:r,mode:xe(t.mode,i)};case"string":return{encoding:t,flag:r,mode:i};case"null":case"undefined":case"function":return{encoding:e,flag:r,mode:i};default:throw new TypeError(`"options" must be a string or an object, got ${typeof t} instead.`)}}s(ve,"normalizeOptions");function _(){}s(_,"nop");var A=_e;function Ss(t){A=t}s(Ss,"setCred");var mt=new Map,rf=100;function Ht(t){let e=rf++;return mt.set(e,t),e}s(Ht,"getFdForFile");function T(t){if(!mt.has(t))throw new c(9);return mt.get(t)}s(T,"fd2file");var Ee=new Map;li("/",hn.create({name:"root"}));function li(t,e){if(t[0]!=="/"&&(t="/"+t),t=Te(t),Ee.has(t))throw new c(22,"Mount point "+t+" is already in use.");Ee.set(t,e)}s(li,"mount");function yn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Te(t),!Ee.has(t))throw new c(22,"Mount point "+t+" is already unmounted.");Ee.delete(t)}s(yn,"umount");function me(t){t=W(t);let e=[...Ee].sort((r,i)=>r[0].length>i[0].length?-1:1);for(let[r,i]of e)if(r.length<=t.length&&t.startsWith(r))return t=t.slice(r.length>1?r.length:0),t===""&&(t="/"),{fs:i,path:t,mountPoint:r};throw new c(5,"ZenFS not initialized with a file system")}s(me,"resolveFS");function gs(t,e){for(let[r,i]of Object.entries(e))t=t?.replaceAll(r,i);return t}s(gs,"fixPaths");function nt(t,e){return typeof t.stack=="string"&&(t.stack=gs(t.stack,e)),t.message=gs(t.message,e),t}s(nt,"fixError");function ci(t){"/"in t&&yn("/");for(let[e,r]of Object.entries(t))li(e,r)}s(ci,"initialize");var yi={};ei(yi,{FileHandle:()=>ue,access:()=>qn,appendFile:()=>In,chmod:()=>Dn,chown:()=>On,constants:()=>Er,copyFile:()=>Hf,createReadStream:()=>jf,createWriteStream:()=>$f,exists:()=>Lr,fchmod:()=>Df,fchown:()=>Bf,futimes:()=>Mf,lchmod:()=>Mn,lchown:()=>Bn,link:()=>Cn,lopen:()=>hi,lstat:()=>kn,lutimes:()=>Wn,mkdir:()=>Fn,mkdtemp:()=>Vf,open:()=>at,read:()=>Of,readFile:()=>pi,readdir:()=>Cr,readlink:()=>Rn,realpath:()=>Dr,rename:()=>An,rm:()=>zf,rmdir:()=>Pn,stat:()=>Rr,symlink:()=>Ln,truncate:()=>Nn,unlink:()=>di,unwatchFile:()=>Wf,utimes:()=>Un,watch:()=>qf,watchFile:()=>Uf,write:()=>Rf,writeFile:()=>Br});function ce(...[t,e,r,...i]){r=W(r);let{fs:n,path:o}=me(e&&mn(r)?vn(r):r);try{return n[t](o,...i)}catch(a){throw nt(a,{[o]:r})}}s(ce,"doOp");function nf(t,e){t=W(t),e=W(e);let r=me(t),i=me(e),n={[r.path]:t,[i.path]:e};try{if(r===i)return r.fs.renameSync(r.path,i.path,A);let o=Es(t);wn(e,o),_s(t)}catch(o){throw nt(o,n)}}s(nf,"renameSync");function mn(t){t=W(t);try{let{fs:e,path:r}=me(t);return e.existsSync(r,A)}catch(e){if(e.errno==2)return!1;throw e}}s(mn,"existsSync");function bn(t,e){let r=ce("statSync",!0,t,A);return e?.bigint?new K(r):r}s(bn,"statSync");function of(t,e){let r=ce("statSync",!1,t,A);return e?.bigint?new K(r):r}s(of,"lstatSync");function sf(t,e=0){let r=Fr(t,"r+");try{xs(r,e)}finally{ot(r)}}s(sf,"truncateSync");function _s(t){return ce("unlinkSync",!1,t,A)}s(_s,"unlinkSync");function Kt(t,e,r,i){let n=W(t),o=xe(r,420),a=F(e),l;try{l=ce("statSync",i,n,A)}catch{switch(kr(a)){case 3:if(!ce("statSync",i,x(n),A).isDirectory())throw c.ENOTDIR(x(n));return ce("createFileSync",i,n,a,o,A);case 1:throw c.ENOENT(n);default:throw new c(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,A))throw c.EACCES(n);switch(Ar(a)){case 1:throw c.EEXIST(n);case 2:return ce("unlinkSync",i,n,A),ce("createFileSync",i,n,a,l.mode,A);case 0:return ce("openFileSync",i,n,a,A);default:throw new c(22,"Invalid FileFlag object.")}}s(Kt,"_openSync");function Fr(t,e,r){return Ht(Kt(t,e,r,!0))}s(Fr,"openSync");function ui(t,e,r){return Ht(Kt(t,e,r,!1))}s(ui,"lopenSync");function gn(t,e,r){let i=Kt(t,e,420,r);try{let n=i.statSync(),o=new Uint8Array(n.size);return i.readSync(o,0,n.size,0),i.closeSync(),o}finally{i.closeSync()}}s(gn,"_readFileSync");function Es(t,e={}){let r=ve(e,null,"r",420),i=F(r.flag);if(!ze(i))throw new c(22,"Flag passed to readFile must allow for reading.");let n=gn(t,r.flag,!0);return r.encoding?X(n,r.encoding):n}s(Es,"readFileSync");function af(t,e,r,i,n){let o=Kt(t,r,i,n);try{o.writeSync(e,0,e.length,0)}finally{o.closeSync()}}s(af,"_writeFileSync");function wn(t,e,r){let i=ve(r,"utf8","w",420),n=F(i.flag);if(!ye(n))throw new c(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e,i.encoding):e;if(o===void 0)throw new c(22,"Data not specified");af(t,o,i.flag,i.mode,!0)}s(wn,"writeFileSync");function lf(t,e,r,i,n){let o=Kt(t,r,i,n);try{o.writeSync(e,0,e.length,null)}finally{o.closeSync()}}s(lf,"_appendFileSync");function cf(t,e,r){let i=ve(r,"utf8","a",420),n=F(i.flag);if(!it(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;lf(t,o,i.flag,i.mode,!0)}s(cf,"appendFileSync");function uf(t,e){let r=T(t).statSync();return e?.bigint?new K(r):r}s(uf,"fstatSync");function ot(t){T(t).closeSync(),mt.delete(t)}s(ot,"closeSync");function xs(t,e=0){if(e<0)throw new c(22);T(t).truncateSync(e)}s(xs,"ftruncateSync");function ff(t){T(t).syncSync()}s(ff,"fsyncSync");function df(t){T(t).datasyncSync()}s(df,"fdatasyncSync");function hf(t,e,r,i,n){let o,a=0,l,u;if(typeof e=="string"){u=typeof r=="number"?r:null;let d=typeof i=="string"?i:"utf8";a=0,o=R(e,d),l=o.length}else o=e,a=r,l=i,u=typeof n=="number"?n:null;let f=T(t);return u==null&&(u=f.position),f.writeSync(o,a,l,u)}s(hf,"writeSync");function pf(t,e,r,i,n){let o=T(t),a=r;return typeof r=="object"&&({offset:a,length:i,position:n}=r),isNaN(+n)&&(n=o.position),o.readSync(e,a,i,n)}s(pf,"readSync");function Sn(t,e,r){T(t).chownSync(e,r)}s(Sn,"fchownSync");function _n(t,e){let r=xe(e,-1);if(r<0)throw new c(22,"Invalid mode.");T(t).chmodSync(r)}s(_n,"fchmodSync");function En(t,e,r){T(t).utimesSync(Vt(e),Vt(r))}s(En,"futimesSync");function yf(t){return ce("rmdirSync",!0,t,A)}s(yf,"rmdirSync");function mf(t,e){let r=typeof e=="number"||typeof e=="string"?e:e?.mode,i=typeof e=="object"&&e?.recursive;ce("mkdirSync",!0,t,xe(r,511),A)}s(mf,"mkdirSync");function xn(t,e){t=W(t);let r=ce("readdirSync",!0,t,A);for(let i of Ee.keys()){if(!i.startsWith(t))continue;let n=i.slice(t.length);n.includes("/")||n.length==0||r.push(n)}return r.map(i=>typeof e=="object"&&e?.withFileTypes?new st(i,bn(de(t,i))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?R(i):i)}s(xn,"readdirSync");function bf(t,e){return e=W(e),ce("linkSync",!1,t,e,A)}s(bf,"linkSync");function gf(t,e,r="file"){if(!["file","dir","junction"].includes(r))throw new c(22,"Invalid type: "+r);if(mn(e))throw c.EEXIST(e);wn(e,t),Kt(e,"r+",420,!1)._setTypeSync(U.SYMLINK)}s(gf,"symlinkSync");function wf(t,e){let r=gn(t,"r",!1),i=typeof e=="object"?e.encoding:e;return i=="buffer"?r:X(r,i)}s(wf,"readlinkSync");function Sf(t,e,r){let i=Fr(t,"r+");Sn(i,e,r),ot(i)}s(Sf,"chownSync");function _f(t,e,r){let i=ui(t,"r+");Sn(i,e,r),ot(i)}s(_f,"lchownSync");function Ef(t,e){let r=Fr(t,"r+");_n(r,e),ot(r)}s(Ef,"chmodSync");function xf(t,e){let r=ui(t,"r+");_n(r,e),ot(r)}s(xf,"lchmodSync");function vf(t,e,r){let i=Fr(t,"r+");En(i,e,r),ot(i)}s(vf,"utimesSync");function Af(t,e,r){let i=ui(t,"r+");En(i,e,r),ot(i)}s(Af,"lutimesSync");function vn(t,e){t=W(t);let{fs:r,path:i,mountPoint:n}=me(t);try{if(!r.statSync(i,A).isSymbolicLink())return t;let a=W(n+X(gn(i,"r+",!1)));return vn(a)}catch(o){throw nt(o,{[i]:t})}}s(vn,"realpathSync");function kf(t,e=384){if(!bn(t).hasAccess(e,A))throw new c(13)}s(kf,"accessSync");function Nf(t){throw new c(95)}s(Nf,"rmSync");function Tf(t,e){throw new c(95)}s(Tf,"mkdtempSync");function If(t,e,r){throw new c(95)}s(If,"copyFileSync");function Pf(t,e,r){throw new c(95)}s(Pf,"readvSync");function Ff(t,e,r){throw new c(95)}s(Ff,"writevSync");function Cf(t,e){throw new c(95)}s(Cf,"opendirSync");var st=class{constructor(e,r){this.name=e;this.stats=r}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(st,"Dirent");var fi=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new c(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Cr(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(r=>e(null,r))}readSync(){return this._entries||(this._entries=xn(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let r=await e._read();return r!=null?{done:!1,value:r}:(await e.close(),{done:!0,value:void 0})}}}};s(fi,"Dir");var ue=class{constructor(e){this.fd=e}chown(e,r){return T(this.fd).chown(e,r)}chmod(e){let r=xe(e,-1);if(r<0)throw new c(22,"Invalid mode.");return T(this.fd).chmod(r)}datasync(){return T(this.fd).datasync()}sync(){return T(this.fd).sync()}truncate(e){if(e<0)throw new c(22);return T(this.fd).truncate(e)}utimes(e,r){return T(this.fd).utimes(Vt(e),Vt(r))}async appendFile(e,r){let i=ve(r,"utf8","a",420),n=F(i.flag);if(!it(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;await T(this.fd).write(o,0,o.length,null)}read(e,r,i,n){return isNaN(+n)&&(n=T(this.fd).position),T(this.fd).read(e,r,i,n)}async readFile(e){let r=ve(e,null,"r",null),i=F(r.flag);if(!ze(i))throw new c(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),o=new Uint8Array(n);return await T(this.fd).read(o,0,n,0),r.encoding?X(o,r.encoding):o}async stat(e){let r=await T(this.fd).stat();return e?.bigint?new K(r):r}async write(e,r,i,n){let o,a=0,l;if(typeof e=="string"){n=typeof r=="number"?r:null;let f=typeof i=="string"?i:"utf8";a=0,o=R(e,f),l=o.length}else o=e,a=r,l=i,n=typeof n=="number"?n:null;n??=T(this.fd).position;let u=await T(this.fd).write(o,a,l,n);return{buffer:o,bytesWritten:u}}async writeFile(e,r){let i=ve(r,"utf8","w",420),n=F(i.flag);if(!ye(n))throw new c(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e,i.encoding):e;await T(this.fd).write(o,0,o.length,0)}writev(e,r){throw new c(95)}readv(e,r){throw new c(95)}async close(){await T(this.fd).close(),mt.delete(this.fd)}};s(ue,"FileHandle");async function Ae(...[t,e,r,...i]){r=W(r);let{fs:n,path:o}=me(e&&await Lr(r)?await Dr(r):r);try{return n[t](o,...i)}catch(a){throw nt(a,{[o]:r})}}s(Ae,"doOp");async function An(t,e){t=W(t),e=W(e);let{path:r}=me(t),{fs:i,path:n}=me(e);try{let o=await pi(t);await Br(e,o),await di(t)}catch(o){throw nt(o,{[r]:t,[n]:e})}}s(An,"rename");async function Lr(t){try{let{fs:e,path:r}=me(t);return e.exists(r,A)}catch(e){if(e.errno==2)return!1;throw e}}s(Lr,"exists");async function Rr(t,e){let r=await Ae("stat",!0,t,A);return e?.bigint?new K(r):r}s(Rr,"stat");async function kn(t,e){let r=await Ae("stat",!1,t,A);return e?.bigint?new K(r):r}s(kn,"lstat");async function Nn(t,e=0){let r=await at(t,"r+");try{await r.truncate(e)}finally{await r.close()}}s(Nn,"truncate");async function di(t){return Ae("unlink",!1,t,A)}s(di,"unlink");async function Or(t,e,r=420,i){let n=W(t),o=xe(r,420),a=F(e);try{switch(Ar(a)){case 1:throw c.EEXIST(n);case 2:let l=await Ae("openFile",i,n,a,A);if(!l)throw new c(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await Ae("openFile",i,n,a,A);default:throw new c(22,"Invalid file flag")}}catch{switch(kr(a)){case 3:let u=await Ae("stat",i,x(n),A);if(u&&!u.isDirectory())throw c.ENOTDIR(x(n));return await Ae("createFile",i,n,a,o,A);case 1:throw c.ENOENT(n);default:throw new c(22,"Invalid file flag")}}}s(Or,"_open");async function at(t,e,r=420){let i=await Or(t,e,r,!0);return new ue(Ht(i))}s(at,"open");async function hi(t,e,r=420){let i=await Or(t,e,r,!1);return new ue(Ht(i))}s(hi,"lopen");async function Tn(t,e,r){let i=await Or(W(t),e,420,r);try{let n=await i.stat(),o=new Uint8Array(n.size);return await i.read(o,0,n.size,0),await i.close(),o}catch(n){throw await i.close(),n}}s(Tn,"_readFile");async function pi(t,e){let r=ve(e,null,"r",null),i=F(r.flag);if(!ze(i))throw new c(22,"Flag passed must allow for reading.");let n=await Tn(t,r.flag,!0);return r.encoding?X(n,r.encoding):n}s(pi,"readFile");async function Br(t,e,r){let i=ve(r,"utf8","w",420),n=await at(t,i.flag,i.mode);try{await n.writeFile(e,i)}finally{await n.close()}}s(Br,"writeFile");async function Lf(t,e,r,i,n){let o=await Or(t,r,i,n);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(Lf,"_appendFile");async function In(t,e,r){let i=ve(r,"utf8","a",420),n=F(i.flag);if(!it(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;await Lf(t,o,i.flag,i.mode,!0)}s(In,"appendFile");function Rf(t,e,r,i,n){return t.write(e,r,i,n)}s(Rf,"write");function Of(t,e,r,i,n){return t.read(e,r,i,n)}s(Of,"read");function Bf(t,e,r){return t.chown(e,r)}s(Bf,"fchown");function Df(t,e){return t.chmod(e)}s(Df,"fchmod");function Mf(t,e,r){return t.utimes(e,r)}s(Mf,"futimes");async function Pn(t){return Ae("rmdir",!0,t,A)}s(Pn,"rmdir");async function Fn(t,e){await Ae("mkdir",!0,t,xe(typeof e=="object"?e?.mode:e,511),A)}s(Fn,"mkdir");async function Cr(t,e){t=W(t);let r=await Ae("readdir",!0,t,A),i=[...Ee.keys()];for(let o of i)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;r.push(a)}let n=[];for(let o of r)n.push(typeof e=="object"&&e?.withFileTypes?new st(o,await Rr(de(t,o))):o);return n}s(Cr,"readdir");async function Cn(t,e){return e=W(e),Ae("link",!1,t,e,A)}s(Cn,"link");async function Ln(t,e,r="file"){if(!["file","dir","junction"].includes(r))throw new c(22,"Invalid symlink type: "+r);if(await Lr(e))throw c.EEXIST(e);await Br(e,t),await(await Or(e,"r+",420,!1))._setType(U.SYMLINK)}s(Ln,"symlink");async function Rn(t,e){let r=await Tn(t,"r",!1),i=typeof e=="object"?e.encoding:e;return i=="buffer"?r:X(r,i)}s(Rn,"readlink");async function On(t,e,r){let i=await at(t,"r+");try{await i.chown(e,r)}finally{await i.close()}}s(On,"chown");async function Bn(t,e,r){let i=await hi(t,"r+");try{await i.chown(e,r)}finally{await i.close()}}s(Bn,"lchown");async function Dn(t,e){let r=await at(t,"r+");try{await r.chmod(e)}finally{await r.close()}}s(Dn,"chmod");async function Mn(t,e){let r=await hi(t,"r+");try{await r.chmod(e)}finally{await r.close()}}s(Mn,"lchmod");async function Un(t,e,r){let i=await at(t,"r+");try{await i.utimes(e,r)}finally{await i.close()}}s(Un,"utimes");async function Wn(t,e,r){let i=await hi(t,"r+");try{await i.utimes(e,r)}finally{await i.close()}}s(Wn,"lutimes");async function Dr(t,e){t=W(t);let{fs:r,path:i,mountPoint:n}=me(t);try{if(!(await r.stat(i,A)).isSymbolicLink())return t;let a=n+W(X(await Tn(i,"r+",!1)));return Dr(a)}catch(o){throw nt(o,{[i]:t})}}s(Dr,"realpath");async function Uf(t,e,r=_){throw new c(95)}s(Uf,"watchFile");async function Wf(t,e=_){throw new c(95)}s(Wf,"unwatchFile");async function qf(t,e,r=_){throw new c(95)}s(qf,"watch");async function qn(t,e=384){if(!(await Rr(t)).hasAccess(e,A))throw new c(13)}s(qn,"access");async function jf(t,e){throw new c(95)}s(jf,"createReadStream");async function $f(t,e){throw new c(95)}s($f,"createWriteStream");async function zf(t){throw new c(95)}s(zf,"rm");async function Vf(t){throw new c(95)}s(Vf,"mkdtemp");async function Hf(t){throw new c(95)}s(Hf,"copyFile");function Kf(t,e,r=_){An(t,e).then(()=>r()).catch(r)}s(Kf,"rename");function Gf(t,e=_){Lr(t).then(e).catch(()=>e(!1))}s(Gf,"exists");function Yf(t,e,r=_){r=typeof e=="function"?e:r,Rr(t,typeof e!="function"?e:{}).then(i=>r(null,i)).catch(r)}s(Yf,"stat");function Xf(t,e,r=_){r=typeof e=="function"?e:r,kn(t,typeof e!="function"?e:{}).then(i=>r(null,i)).catch(r)}s(Xf,"lstat");function Jf(t,e=0,r=_){r=typeof e=="function"?e:r,Nn(t,typeof e=="number"?e:0).then(()=>r()).catch(r)}s(Jf,"truncate");function Qf(t,e=_){di(t).then(()=>e()).catch(e)}s(Qf,"unlink");function Zf(t,e,r,i=_){let n=xe(r,420);i=typeof r=="function"?r:i,at(t,e,n).then(o=>i(null,o.fd)).catch(i)}s(Zf,"open");function ed(t,e,r=_){r=typeof e=="function"?e:r,pi(t,typeof e=="function"?null:e).then(i=>r(null,i)).catch(r)}s(ed,"readFile");function td(t,e,r,i=_){i=typeof r=="function"?r:i,Br(t,e,typeof r!="function"?r:null).then(()=>i(null)).catch(i)}s(td,"writeFile");function rd(t,e,r,i=_){i=typeof r=="function"?r:i,In(t,e,typeof r=="function"?null:r)}s(rd,"appendFile");function id(t,e,r=_){r=typeof e=="function"?e:r,T(t).stat().then(i=>r(null,typeof e=="object"&&e?.bigint?new K(i):i)).catch(r)}s(id,"fstat");function nd(t,e=_){new ue(t).close().then(()=>e()).catch(e)}s(nd,"close");function od(t,e,r=_){let i=typeof e=="number"?e:0;r=typeof e=="function"?e:r;let n=T(t);if(i<0)throw new c(22);n.truncate(i).then(()=>r()).catch(r)}s(od,"ftruncate");function sd(t,e=_){T(t).sync().then(()=>e()).catch(e)}s(sd,"fsync");function ad(t,e=_){T(t).datasync().then(()=>e()).catch(e)}s(ad,"fdatasync");function ld(t,e,r,i,n,o=_){let a,l,u,f=null,d,h=new ue(t);if(typeof e=="string"){switch(d="utf8",typeof r){case"function":o=r;break;case"number":f=r,d=typeof i=="string"?i:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof i=="function"?i:typeof n=="function"?n:o,o(new c(22,"Invalid arguments."));return}a=R(e),l=0,u=a.length;let m=o;h.write(a,l,u,f).then(({bytesWritten:y})=>m(null,y,X(a))).catch(m)}else{a=e,l=r,u=i,f=typeof n=="number"?n:null;let m=typeof n=="function"?n:o;h.write(a,l,u,f).then(({bytesWritten:y})=>m(null,y,a)).catch(m)}}s(ld,"write");function cd(t,e,r,i,n,o=_){new ue(t).read(e,r,i,n).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(cd,"read");function ud(t,e,r,i=_){new ue(t).chown(e,r).then(()=>i()).catch(i)}s(ud,"fchown");function fd(t,e,r){new ue(t).chmod(e).then(()=>r()).catch(r)}s(fd,"fchmod");function dd(t,e,r,i=_){new ue(t).utimes(e,r).then(()=>i()).catch(i)}s(dd,"futimes");function hd(t,e=_){Pn(t).then(()=>e()).catch(e)}s(hd,"rmdir");function pd(t,e,r=_){Fn(t,e).then(()=>r()).catch(r)}s(pd,"mkdir");function yd(t,e,r=_){r=typeof e=="function"?e:r,Cr(t,typeof e!="function"?e:{}).then(n=>r(null,n)).catch(r)}s(yd,"readdir");function md(t,e,r=_){Cn(t,e).then(()=>r()).catch(r)}s(md,"link");function bd(t,e,r,i=_){let n=typeof r=="string"?r:"file";i=typeof r=="function"?r:i,Ln(t,e,n).then(()=>i()).catch(i)}s(bd,"symlink");function gd(t,e,r=_){r=typeof e=="function"?e:r,Rn(t).then(i=>r(null,i)).catch(r)}s(gd,"readlink");function wd(t,e,r,i=_){On(t,e,r).then(()=>i()).catch(i)}s(wd,"chown");function Sd(t,e,r,i=_){Bn(t,e,r).then(()=>i()).catch(i)}s(Sd,"lchown");function _d(t,e,r=_){Dn(t,e).then(()=>r()).catch(r)}s(_d,"chmod");function Ed(t,e,r=_){Mn(t,e).then(()=>r()).catch(r)}s(Ed,"lchmod");function xd(t,e,r,i=_){Un(t,e,r).then(()=>i()).catch(i)}s(xd,"utimes");function vd(t,e,r,i=_){Wn(t,e,r).then(()=>i()).catch(i)}s(vd,"lutimes");function Ad(t,e,r=_){r=typeof e=="function"?e:r,Dr(t,typeof e=="function"?null:e).then(i=>r(null,i)).catch(r)}s(Ad,"realpath");function kd(t,e,r=_){let i=typeof e=="number"?e:4;r=typeof e=="function"?e:r,qn(t,typeof e=="function"?null:e).then(()=>r()).catch(r)}s(kd,"access");function Nd(t,e,r=_){throw new c(95)}s(Nd,"watchFile");function Td(t,e=_){throw new c(95)}s(Td,"unwatchFile");function Id(t,e,r=_){throw new c(95)}s(Id,"watch");function Pd(t,e){throw new c(95)}s(Pd,"createReadStream");function Fd(t,e){throw new c(95)}s(Fd,"createWriteStream");function Cd(t){new c(95)}s(Cd,"rm");function Ld(t){new c(95)}s(Ld,"mkdtemp");function Rd(t,e,r,i){new c(95)}s(Rd,"copyFile");function Od(t){new c(95)}s(Od,"readv");function Bd(t,e,r,i){throw new c(95)}s(Bd,"writev");function Dd(t){throw new c(95)}s(Dd,"opendir");var on=su(Qc(),1);var rn=class extends on.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(r){e(r)}}bytesRead;path;pending;addListener(e,r){return super.addListener(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}prependListener(e,r){return super.prependListener(e,r)}prependOnceListener(e,r){return super.prependOnceListener(e,r)}};s(rn,"ReadStream");var nn=class extends on.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(r){e(r)}}bytesWritten;path;pending;addListener(e,r){return super.addListener(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}prependListener(e,r){return super.prependListener(e,r)}prependOnceListener(e,r){return super.prependOnceListener(e,r)}};s(nn,"WriteStream");function Zc(t,e=0,r=0){Ss({uid:e,gid:r,suid:e,sgid:r,euid:e,egid:r}),ci(t)}s(Zc,"initialize");async function qg(t){("backend"in t||t instanceof J)&&(t={"/":t});for(let[e,r]of Object.entries(t))typeof r!="number"&&(r instanceof J||(br(r)&&(r={backend:r}),t[e]=await ri(r)));Zc(t)}s(qg,"configure");var Ft=class{static FromListing(e){let r=new Ft,i=new et;r._index.set("/",i);let n=[{pwd:"",tree:e,parent:i}];for(;n.length>0;){let o,{tree:a,pwd:l,parent:u}=n.pop();for(let f in a){if(!Object.hasOwn(a,f))continue;let d=a[f];if(d){let h=l+"/"+f;o=new et,r._index.set(h,o),n.push({pwd:h,tree:d,parent:o})}else o=new Zr(new M({mode:U.FILE|365}));u&&u._listing.set(f,o)}}return r}_index=new Map;constructor(){this.add("/",new et)}files(){let e=[];for(let r of this._index.values())for(let i of r.listing){let n=r.get(i);n?.isFile()&&e.push(n)}return e}add(e,r){if(!r)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===r;let i=x(e),n=this._index.get(i);return!n&&e!="/"&&(n=new et,!this.add(i,n))||e!="/"&&!n.add(L(e),r)?!1:(r.isDirectory()&&this._index.set(e,r),!0)}addFast(e,r){let i=x(e),n=L(e),o=this._index.get(i);return o||(o=new et,this.addFast(i,o)),o.add(n,r)?(r.isDirectory()&&this._index.set(e,r),!0):!1}remove(e){let r=x(e),i=this._index.get(r);if(!i)return;let n=i.remove(L(e));if(!n)return;if(!n.isDirectory())return n;let o=n.listing;for(let a of o)this.remove(de(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let r=x(e),i=this._index.get(r);return r==e?i:i?.get(L(e))}};s(Ft,"FileIndex");var hr=class{constructor(e){this.data=e}};s(hr,"IndexInode");var Zr=class extends hr{isFile(){return!0}isDirectory(){return!1}toStats(){return new M({mode:U.FILE|438,size:4096})}};s(Zr,"IndexFileInode");var et=class extends hr{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new M({mode:U.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,r){return this._listing.has(e)?!1:(this._listing.set(e,r),!0)}remove(e){let r=this._listing.get(e);if(r)return this._listing.delete(e),r}};s(et,"IndexDirInode");var pr=class extends dn(J){_index;constructor(e){super(),this._index=Ft.FromListing(e)}async stat(e){let r=this._index.get(e);if(!r)throw c.ENOENT(e);if(r.isDirectory())return r.stats;if(r.isFile())return this.statFileInode(r,e);throw new c(22,"Invalid inode.")}statSync(e){let r=this._index.get(e);if(!r)throw c.ENOENT(e);if(r.isDirectory())return r.stats;if(r.isFile())return this.statFileInodeSync(r,e);throw new c(22,"Invalid inode.")}async openFile(e,r,i){if(ye(r))throw new c(1,e);let n=this._index.get(e);if(!n)throw c.ENOENT(e);if(!n.toStats().hasAccess(rt(r),i))throw c.EACCES(e);if(n.isDirectory()){let o=n.stats;return new pt(this,e,r,o,o.fileData)}return this.openFileInode(n,e,r)}openFileSync(e,r,i){if(ye(r))throw new c(1,e);let n=this._index.get(e);if(!n)throw c.ENOENT(e);if(!n.toStats().hasAccess(rt(r),i))throw c.EACCES(e);if(n.isDirectory()){let o=n.stats;return new pt(this,e,r,o,o.fileData)}return this.openFileInodeSync(n,e,r)}async readdir(e){let r=this._index.get(e);if(!r)throw c.ENOENT(e);if(r.isDirectory())return r.listing;throw c.ENOTDIR(e)}readdirSync(e){let r=this._index.get(e);if(!r)throw c.ENOENT(e);if(r.isDirectory())return r.listing;throw c.ENOTDIR(e)}};s(pr,"FileIndexFS");var sn=class extends ht(pr){async statFileInode(e,r){return this.statFileInodeSync(e,r)}async openFileInode(e,r,i){return this.openFileInodeSync(e,r,i)}};s(sn,"SyncFileIndexFS");var an=class extends gr(pr){statFileInodeSync(){throw new c(95)}openFileInodeSync(){throw new c(95)}};s(an,"AsyncFileIndexFS");var jg=Qr;return au($g);})();
5
5
  /*! Bundled license information:
6
6
 
7
7
  ieee754/index.js: