@zenfs/core 1.0.5 → 1.0.6

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,8 +1,8 @@
1
- "use strict";var ZenFS=(()=>{var qh=Object.create;var Mt=Object.defineProperty;var lc=Object.getOwnPropertyDescriptor;var $h=Object.getOwnPropertyNames;var zh=Object.getPrototypeOf,Vh=Object.prototype.hasOwnProperty;var sc=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Dt=e=>{throw TypeError(e)};var Hh=(e,t,i)=>t in e?Mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var s=(e,t)=>Mt(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Un=(e,t)=>{for(var i in t)Mt(e,i,{get:t[i],enumerable:!0})},fc=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $h(t))!Vh.call(e,r)&&r!==i&&Mt(e,r,{get:()=>t[r],enumerable:!(n=lc(t,r))||n.enumerable});return e};var $i=(e,t,i)=>(i=e!=null?qh(zh(e)):{},fc(t||!e||!e.__esModule?Mt(i,"default",{value:e,enumerable:!0}):i,e)),Kh=e=>fc(Mt({},"__esModule",{value:!0}),e);var uc=["class","method","getter","setter","accessor","field","value","get","set"],qi=e=>e!==void 0&&typeof e!="function"?Dt("Function expected"):e,Gh=(e,t,i,n)=>({kind:uc[e],name:t,addInitializer:r=>i._?Dt("Already initialized"):n.push(qi(r||null))}),dc=(e,t,i)=>{for(var n=0,r=e[t>>1],o=r&&r.length;n<o;n++)t&1?r[n].call(i):i=(0,r[n])(i);return i},_e=(e,t,i,n,r,o)=>{var a,c,l,f,d,h=t&7,b=!!(t&8),p=!!(t&16),w=h>3?e.length+1:h?b?1:2:0,g=uc[h+5],A=h>3&&(e[w-1]=[]),k=e[w]||(e[w]=[]),v=h&&(!p&&!b&&(r=r.prototype),h<5&&(h>3||!p)&&lc(h<4?r:{get[i](){return ac(this,o)},set[i](F){return cc(this,o,F)}},i));h?p&&h<4&&s(o,(h>2?"set ":h>1?"get ":"")+i):s(r,i);for(var L=n.length-1;L>=0;L--)f=Gh(h,i,l={},k),h&&(f.static=b,f.private=p,d=f.access={has:p?F=>Yh(r,F):F=>i in F},h^3&&(d.get=p?F=>(h^1?ac:Xh)(F,r,h^4?o:v.get):F=>F[i]),h>2&&(d.set=p?(F,B)=>cc(F,r,B,h^4?o:v.set):(F,B)=>F[i]=B)),c=(0,n[L])(h?h<4?p?o:v[g]:h>4?void 0:{get:v.get,set:v.set}:r,f),l._=1,h^4||c===void 0?qi(c)&&(h>4?A.unshift(c):h?p?o=c:v[g]=c:r=c):typeof c!="object"||c===null?Dt("Object expected"):(qi(a=c.get)&&(v.get=a),qi(a=c.set)&&(v.set=a),qi(a=c.init)&&A.unshift(a));return v&&Mt(r,i,v),p?h^4?o:v:r},oo=(e,t,i)=>Hh(e,typeof t!="symbol"?t+"":t,i),so=(e,t,i)=>t.has(e)||Dt("Cannot "+i),Yh=(e,t)=>Object(t)!==t?Dt('Cannot use the "in" operator on this value'):e.has(t),ac=(e,t,i)=>(so(e,t,"read from private field"),i?i.call(e):t.get(e));var cc=(e,t,i,n)=>(so(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Xh=(e,t,i)=>(so(e,t,"access private method"),i);var S=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Dt("Object expected");var n;i&&(n=t[sc("asyncDispose")]),n===void 0&&(n=t[sc("dispose")]),typeof n!="function"&&Dt("Object not disposable"),e.push([i,n,t])}else i&&e.push([i]);return t},E=(e,t,i)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},r=a=>t=i?new n(a,t,"An error was suppressed during disposal"):(i=!0,a),o=a=>{for(;a=e.pop();)try{var c=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(c).then(o,l=>(r(l),o()))}catch(l){r(l)}if(i)throw t};return o()};var bc=T(zn=>{"use strict";zn.byteLength=np;zn.toByteArray=op;zn.fromByteArray=cp;var qe=[],Fe=[],ip=typeof Uint8Array<"u"?Uint8Array:Array,fo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ut=0,yc=fo.length;Ut<yc;++Ut)qe[Ut]=fo[Ut],Fe[fo.charCodeAt(Ut)]=Ut;var Ut,yc;Fe[45]=62;Fe[95]=63;function mc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");i===-1&&(i=t);var n=i===t?0:4-i%4;return[i,n]}s(mc,"getLens");function np(e){var t=mc(e),i=t[0],n=t[1];return(i+n)*3/4-n}s(np,"byteLength");function rp(e,t,i){return(t+i)*3/4-i}s(rp,"_byteLength");function op(e){var t,i=mc(e),n=i[0],r=i[1],o=new ip(rp(e,n,r)),a=0,c=r>0?n-4:n,l;for(l=0;l<c;l+=4)t=Fe[e.charCodeAt(l)]<<18|Fe[e.charCodeAt(l+1)]<<12|Fe[e.charCodeAt(l+2)]<<6|Fe[e.charCodeAt(l+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return r===2&&(t=Fe[e.charCodeAt(l)]<<2|Fe[e.charCodeAt(l+1)]>>4,o[a++]=t&255),r===1&&(t=Fe[e.charCodeAt(l)]<<10|Fe[e.charCodeAt(l+1)]<<4|Fe[e.charCodeAt(l+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}s(op,"toByteArray");function sp(e){return qe[e>>18&63]+qe[e>>12&63]+qe[e>>6&63]+qe[e&63]}s(sp,"tripletToBase64");function ap(e,t,i){for(var n,r=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),r.push(sp(n));return r.join("")}s(ap,"encodeChunk");function cp(e){for(var t,i=e.length,n=i%3,r=[],o=16383,a=0,c=i-n;a<c;a+=o)r.push(ap(e,a,a+o>c?c:a+o));return n===1?(t=e[i-1],r.push(qe[t>>2]+qe[t<<4&63]+"==")):n===2&&(t=(e[i-2]<<8)+e[i-1],r.push(qe[t>>10]+qe[t>>4&63]+qe[t<<2&63]+"=")),r.join("")}s(cp,"fromByteArray")});var gc=T(uo=>{uo.read=function(e,t,i,n,r){var o,a,c=r*8-n-1,l=(1<<c)-1,f=l>>1,d=-7,h=i?r-1:0,b=i?-1:1,p=e[t+h];for(h+=b,o=p&(1<<-d)-1,p>>=-d,d+=c;d>0;o=o*256+e[t+h],h+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+e[t+h],h+=b,d-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(p?-1:1)*a*Math.pow(2,o-n)};uo.write=function(e,t,i,n,r,o){var a,c,l,f=o*8-r-1,d=(1<<f)-1,h=d>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,w=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?t+=b/l:t+=b*Math.pow(2,1-h),t*l>=2&&(a++,l/=2),a+h>=d?(c=0,a=d):a+h>=1?(c=(t*l-1)*Math.pow(2,r),a=a+h):(c=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[i+p]=c&255,p+=w,c/=256,r-=8);for(a=a<<r|c,f+=r;f>0;e[i+p]=a&255,p+=w,a/=256,f-=8);e[i+p-w]|=g*128}});var Ie=T(ui=>{"use strict";var ho=bc(),li=gc(),wc=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=m;ui.SlowBuffer=pp;ui.INSPECT_MAX_BYTES=50;var Vn=2147483647;ui.kMaxLength=Vn;m.TYPED_ARRAY_SUPPORT=lp();!m.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 lp(){try{let e=new Uint8Array(1),t={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}s(lp,"typedArraySupport");Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.buffer},"get")});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.byteOffset},"get")});function ct(e){if(e>Vn)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,m.prototype),t}s(ct,"createBuffer");function m(e,t,i){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return bo(e)}return xc(e,t,i)}s(m,"Buffer");m.poolSize=8192;function xc(e,t,i){if(typeof e=="string")return up(e,t);if(ArrayBuffer.isView(e))return dp(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($e(e,ArrayBuffer)||e&&$e(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($e(e,SharedArrayBuffer)||e&&$e(e.buffer,SharedArrayBuffer)))return yo(e,t,i);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return m.from(n,t,i);let r=hp(e);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return m.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s(xc,"from");m.from=function(e,t,i){return xc(e,t,i)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function kc(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}s(kc,"assertSize");function fp(e,t,i){return kc(e),e<=0?ct(e):t!==void 0?typeof i=="string"?ct(e).fill(t,i):ct(e).fill(t):ct(e)}s(fp,"alloc");m.alloc=function(e,t,i){return fp(e,t,i)};function bo(e){return kc(e),ct(e<0?0:go(e)|0)}s(bo,"allocUnsafe");m.allocUnsafe=function(e){return bo(e)};m.allocUnsafeSlow=function(e){return bo(e)};function up(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let i=vc(e,t)|0,n=ct(i),r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}s(up,"fromString");function po(e){let t=e.length<0?0:go(e.length)|0,i=ct(t);for(let n=0;n<t;n+=1)i[n]=e[n]&255;return i}s(po,"fromArrayLike");function dp(e){if($e(e,Uint8Array)){let t=new Uint8Array(e);return yo(t.buffer,t.byteOffset,t.byteLength)}return po(e)}s(dp,"fromArrayView");function yo(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),Object.setPrototypeOf(n,m.prototype),n}s(yo,"fromArrayBuffer");function hp(e){if(m.isBuffer(e)){let t=go(e.length)|0,i=ct(t);return i.length===0||e.copy(i,0,0,t),i}if(e.length!==void 0)return typeof e.length!="number"||So(e.length)?ct(0):po(e);if(e.type==="Buffer"&&Array.isArray(e.data))return po(e.data)}s(hp,"fromObject");function go(e){if(e>=Vn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Vn.toString(16)+" bytes");return e|0}s(go,"checked");function pp(e){return+e!=e&&(e=0),m.alloc(+e)}s(pp,"SlowBuffer");m.isBuffer=s(function(t){return t!=null&&t._isBuffer===!0&&t!==m.prototype},"isBuffer");m.compare=s(function(t,i){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),$e(i,Uint8Array)&&(i=m.from(i,i.offset,i.byteLength)),!m.isBuffer(t)||!m.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===i)return 0;let n=t.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(t[o]!==i[o]){n=t[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");m.isEncoding=s(function(t){switch(String(t).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");m.concat=s(function(t,i){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return m.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<t.length;++n)i+=t[n].length;let r=m.allocUnsafe(i),o=0;for(n=0;n<t.length;++n){let a=t[n];if($e(a,Uint8Array))o+a.length>r.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(m.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function vc(e,t){if(m.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$e(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let i=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return mo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Nc(e).length;default:if(r)return n?-1:mo(e).length;t=(""+t).toLowerCase(),r=!0}}s(vc,"byteLength");m.byteLength=vc;function yp(e,t,i){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,t>>>=0,i<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return vp(this,t,i);case"utf8":case"utf-8":return Ic(this,t,i);case"ascii":return xp(this,t,i);case"latin1":case"binary":return kp(this,t,i);case"base64":return Ep(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fp(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s(yp,"slowToString");m.prototype._isBuffer=!0;function jt(e,t,i){let n=e[t];e[t]=e[i],e[i]=n}s(jt,"swap");m.prototype.swap16=s(function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<t;i+=2)jt(this,i,i+1);return this},"swap16");m.prototype.swap32=s(function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<t;i+=4)jt(this,i,i+3),jt(this,i+1,i+2);return this},"swap32");m.prototype.swap64=s(function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<t;i+=8)jt(this,i,i+7),jt(this,i+1,i+6),jt(this,i+2,i+5),jt(this,i+3,i+4);return this},"swap64");m.prototype.toString=s(function(){let t=this.length;return t===0?"":arguments.length===0?Ic(this,0,t):yp.apply(this,arguments)},"toString");m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=s(function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:m.compare(this,t)===0},"equals");m.prototype.inspect=s(function(){let t="",i=ui.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},"inspect");wc&&(m.prototype[wc]=m.prototype.inspect);m.prototype.compare=s(function(t,i,n,r,o){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(i===void 0&&(i=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let a=o-r,c=n-i,l=Math.min(a,c),f=this.slice(r,o),d=t.slice(i,n);for(let h=0;h<l;++h)if(f[h]!==d[h]){a=f[h],c=d[h];break}return a<c?-1:c<a?1:0},"compare");function Fc(e,t,i,n,r){if(e.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,So(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof t=="string"&&(t=m.from(t,n)),m.isBuffer(t))return t.length===0?-1:Sc(e,t,i,n,r);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):Sc(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(Fc,"bidirectionalIndexOf");function Sc(e,t,i,n,r){let o=1,a=e.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(l,"read");let f;if(r){let d=-1;for(f=i;f<a;f++)if(l(e,f)===l(t,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let d=!0;for(let h=0;h<c;h++)if(l(e,f+h)!==l(t,h)){d=!1;break}if(d)return f}return-1}s(Sc,"arrayIndexOf");m.prototype.includes=s(function(t,i,n){return this.indexOf(t,i,n)!==-1},"includes");m.prototype.indexOf=s(function(t,i,n){return Fc(this,t,i,n,!0)},"indexOf");m.prototype.lastIndexOf=s(function(t,i,n){return Fc(this,t,i,n,!1)},"lastIndexOf");function mp(e,t,i,n){i=Number(i)||0;let r=e.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=t.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let c=parseInt(t.substr(a*2,2),16);if(So(c))return a;e[i+a]=c}return a}s(mp,"hexWrite");function bp(e,t,i,n){return Hn(mo(t,e.length-i),e,i,n)}s(bp,"utf8Write");function gp(e,t,i,n){return Hn(Pp(t),e,i,n)}s(gp,"asciiWrite");function wp(e,t,i,n){return Hn(Nc(t),e,i,n)}s(wp,"base64Write");function Sp(e,t,i,n){return Hn(Tp(t,e.length-i),e,i,n)}s(Sp,"ucs2Write");m.prototype.write=s(function(t,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return mp(this,t,i,n);case"utf8":case"utf-8":return bp(this,t,i,n);case"ascii":case"latin1":case"binary":return gp(this,t,i,n);case"base64":return wp(this,t,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sp(this,t,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");m.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function Ep(e,t,i){return t===0&&i===e.length?ho.fromByteArray(e):ho.fromByteArray(e.slice(t,i))}s(Ep,"base64Slice");function Ic(e,t,i){i=Math.min(e.length,i);let n=[],r=t;for(;r<i;){let o=e[r],a=null,c=o>239?4:o>223?3:o>191?2:1;if(r+c<=i){let l,f,d,h;switch(c){case 1:o<128&&(a=o);break;case 2:l=e[r+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(a=h));break;case 3:l=e[r+1],f=e[r+2],(l&192)===128&&(f&192)===128&&(h=(o&15)<<12|(l&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:l=e[r+1],f=e[r+2],d=e[r+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(l&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=c}return _p(n)}s(Ic,"utf8Slice");var Ec=4096;function _p(e){let t=e.length;if(t<=Ec)return String.fromCharCode.apply(String,e);let i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=Ec));return i}s(_p,"decodeCodePointsArray");function xp(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]&127);return n}s(xp,"asciiSlice");function kp(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}s(kp,"latin1Slice");function vp(e,t,i){let n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=t;o<i;++o)r+=Rp[e[o]];return r}s(vp,"hexSlice");function Fp(e,t,i){let n=e.slice(t,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Fp,"utf16leSlice");m.prototype.slice=s(function(t,i){let n=this.length;t=~~t,i=i===void 0?n:~~i,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<t&&(i=t);let r=this.subarray(t,i);return Object.setPrototypeOf(r,m.prototype),r},"slice");function Z(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}s(Z,"checkOffset");m.prototype.readUintLE=m.prototype.readUIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return r},"readUIntLE");m.prototype.readUintBE=m.prototype.readUIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t+--i],o=1;for(;i>0&&(o*=256);)r+=this[t+--i]*o;return r},"readUIntBE");m.prototype.readUint8=m.prototype.readUInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]},"readUInt8");m.prototype.readUint16LE=m.prototype.readUInt16LE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]|this[t+1]<<8},"readUInt16LE");m.prototype.readUint16BE=m.prototype.readUInt16BE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]<<8|this[t+1]},"readUInt16BE");m.prototype.readUint32LE=m.prototype.readUInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},"readUInt32LE");m.prototype.readUint32BE=m.prototype.readUInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},"readUInt32BE");m.prototype.readBigUInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));m.prototype.readBigUInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=i*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));m.prototype.readIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");m.prototype.readIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=i,o=1,a=this[t+--r];for(;r>0&&(o*=256);)a+=this[t+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");m.prototype.readInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},"readInt8");m.prototype.readInt16LE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");m.prototype.readInt16BE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},"readInt16BE");m.prototype.readInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},"readInt32LE");m.prototype.readInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},"readInt32BE");m.prototype.readBigInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)},"readBigInt64LE"));m.prototype.readBigInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=(i<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)},"readBigInt64BE"));m.prototype.readFloatLE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!0,23,4)},"readFloatLE");m.prototype.readFloatBE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!1,23,4)},"readFloatBE");m.prototype.readDoubleLE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!0,52,8)},"readDoubleLE");m.prototype.readDoubleBE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!1,52,8)},"readDoubleBE");function fe(e,t,i,n,r,o){if(!m.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}s(fe,"checkInt");m.prototype.writeUintLE=m.prototype.writeUIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=1,a=0;for(this[i]=t&255;++a<n&&(o*=256);)this[i+a]=t/o&255;return i+n},"writeUIntLE");m.prototype.writeUintBE=m.prototype.writeUIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=n-1,a=1;for(this[i+o]=t&255;--o>=0&&(a*=256);)this[i+o]=t/a&255;return i+n},"writeUIntBE");m.prototype.writeUint8=m.prototype.writeUInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,255,0),this[i]=t&255,i+1},"writeUInt8");m.prototype.writeUint16LE=m.prototype.writeUInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeUInt16LE");m.prototype.writeUint16BE=m.prototype.writeUInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeUInt16BE");m.prototype.writeUint32LE=m.prototype.writeUInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i+3]=t>>>24,this[i+2]=t>>>16,this[i+1]=t>>>8,this[i]=t&255,i+4},"writeUInt32LE");m.prototype.writeUint32BE=m.prototype.writeUInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeUInt32BE");function Ac(e,t,i,n,r){Lc(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,i}s(Ac,"wrtBigUInt64LE");function Oc(e,t,i,n,r){Lc(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i+7]=o,o=o>>8,e[i+6]=o,o=o>>8,e[i+5]=o,o=o>>8,e[i+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=a,a=a>>8,e[i+2]=a,a=a>>8,e[i+1]=a,a=a>>8,e[i]=a,i+8}s(Oc,"wrtBigUInt64BE");m.prototype.writeBigUInt64LE=xt(s(function(t,i=0){return Ac(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));m.prototype.writeBigUInt64BE=xt(s(function(t,i=0){return Oc(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));m.prototype.writeIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=0,a=1,c=0;for(this[i]=t&255;++o<n&&(a*=256);)t<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntLE");m.prototype.writeIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=n-1,a=1,c=0;for(this[i+o]=t&255;--o>=0&&(a*=256);)t<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntBE");m.prototype.writeInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,127,-128),t<0&&(t=255+t+1),this[i]=t&255,i+1},"writeInt8");m.prototype.writeInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeInt16LE");m.prototype.writeInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeInt16BE");m.prototype.writeInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),this[i]=t&255,this[i+1]=t>>>8,this[i+2]=t>>>16,this[i+3]=t>>>24,i+4},"writeInt32LE");m.prototype.writeInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeInt32BE");m.prototype.writeBigInt64LE=xt(s(function(t,i=0){return Ac(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));m.prototype.writeBigInt64BE=xt(s(function(t,i=0){return Oc(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Pc(e,t,i,n,r,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(Pc,"checkIEEE754");function Tc(e,t,i,n,r){return t=+t,i=i>>>0,r||Pc(e,t,i,4,34028234663852886e22,-34028234663852886e22),li.write(e,t,i,n,23,4),i+4}s(Tc,"writeFloat");m.prototype.writeFloatLE=s(function(t,i,n){return Tc(this,t,i,!0,n)},"writeFloatLE");m.prototype.writeFloatBE=s(function(t,i,n){return Tc(this,t,i,!1,n)},"writeFloatBE");function Rc(e,t,i,n,r){return t=+t,i=i>>>0,r||Pc(e,t,i,8,17976931348623157e292,-17976931348623157e292),li.write(e,t,i,n,52,8),i+8}s(Rc,"writeDouble");m.prototype.writeDoubleLE=s(function(t,i,n){return Rc(this,t,i,!0,n)},"writeDoubleLE");m.prototype.writeDoubleBE=s(function(t,i,n){return Rc(this,t,i,!1,n)},"writeDoubleBE");m.prototype.copy=s(function(t,i,n,r){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=t.length&&(i=t.length),i||(i=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-i<r-n&&(r=t.length-i+n);let o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),i),o},"copy");m.prototype.fill=s(function(t,i,n,r){if(typeof t=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!m.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){let a=t.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=i;o<n;++o)this[o]=t;else{let a=m.isBuffer(t)?t:m.from(t,r),c=a.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%c]}return this},"fill");var ci={};function wo(e,t,i){var n;ci[e]=(n=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}},s(n,"NodeError"),n)}s(wo,"E");wo("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);wo("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);wo("ERR_OUT_OF_RANGE",function(e,t,i){let n=`The value of "${e}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=_c(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=_c(r)),r+="n"),n+=` It must be ${t}. Received ${r}`,n},RangeError);function _c(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(_c,"addNumericalSeparator");function Ip(e,t,i){fi(t,"offset"),(e[t]===void 0||e[t+i]===void 0)&&Ki(t,e.length-(i+1))}s(Ip,"checkBounds");function Lc(e,t,i,n,r,o){if(e>i||e<t){let a=typeof t=="bigint"?"n":"",c;throw o>3?t===0||t===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${t}${a} and <= ${i}${a}`,new ci.ERR_OUT_OF_RANGE("value",c,e)}Ip(n,r,o)}s(Lc,"checkIntBI");function fi(e,t){if(typeof e!="number")throw new ci.ERR_INVALID_ARG_TYPE(t,"number",e)}s(fi,"validateNumber");function Ki(e,t,i){throw Math.floor(e)!==e?(fi(e,i),new ci.ERR_OUT_OF_RANGE(i||"offset","an integer",e)):t<0?new ci.ERR_BUFFER_OUT_OF_BOUNDS:new ci.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}s(Ki,"boundsError");var Ap=/[^+/0-9A-Za-z-_]/g;function Op(e){if(e=e.split("=")[0],e=e.trim().replace(Ap,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}s(Op,"base64clean");function mo(e,t){t=t||1/0;let i,n=e.length,r=null,o=[];for(let a=0;a<n;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(mo,"utf8ToBytes");function Pp(e){let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i)&255);return t}s(Pp,"asciiToBytes");function Tp(e,t){let i,n,r,o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(Tp,"utf16leToBytes");function Nc(e){return ho.toByteArray(Op(e))}s(Nc,"base64ToBytes");function Hn(e,t,i,n){let r;for(r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}s(Hn,"blitBuffer");function $e(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}s($e,"isInstance");function So(e){return e!==e}s(So,"numberIsNaN");var Rp=function(){let e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)t[n+r]=e[i]+e[r]}return t}();function xt(e){return typeof BigInt>"u"?Lp:e}s(xt,"defineBigIntMethod");function Lp(){throw new Error("BigInt not supported")}s(Lp,"BufferBigIntNotDefined")});var Bc=T((vE,ko)=>{"use strict";var ry=Object.prototype.hasOwnProperty,se="~";function Xi(){}s(Xi,"Events");Object.create&&(Xi.prototype=Object.create(null),new Xi().__proto__||(se=!1));function oy(e,t,i){this.fn=e,this.context=t,this.once=i||!1}s(oy,"EE");function Cc(e,t,i,n,r){if(typeof i!="function")throw new TypeError("The listener must be a function");var o=new oy(i,n||e,r),a=se?se+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}s(Cc,"addListener");function Kn(e,t){--e._eventsCount===0?e._events=new Xi:delete e._events[t]}s(Kn,"clearEvent");function ne(){this._events=new Xi,this._eventsCount=0}s(ne,"EventEmitter");ne.prototype.eventNames=s(function(){var t=[],i,n;if(this._eventsCount===0)return t;for(n in i=this._events)ry.call(i,n)&&t.push(se?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(i)):t},"eventNames");ne.prototype.listeners=s(function(t){var i=se?se+t:t,n=this._events[i];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},"listeners");ne.prototype.listenerCount=s(function(t){var i=se?se+t:t,n=this._events[i];return n?n.fn?1:n.length:0},"listenerCount");ne.prototype.emit=s(function(t,i,n,r,o,a){var c=se?se+t:t;if(!this._events[c])return!1;var l=this._events[c],f=arguments.length,d,h;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,i),!0;case 3:return l.fn.call(l.context,i,n),!0;case 4:return l.fn.call(l.context,i,n,r),!0;case 5:return l.fn.call(l.context,i,n,r,o),!0;case 6:return l.fn.call(l.context,i,n,r,o,a),!0}for(h=1,d=new Array(f-1);h<f;h++)d[h-1]=arguments[h];l.fn.apply(l.context,d)}else{var b=l.length,p;for(h=0;h<b;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),f){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,i);break;case 3:l[h].fn.call(l[h].context,i,n);break;case 4:l[h].fn.call(l[h].context,i,n,r);break;default:if(!d)for(p=1,d=new Array(f-1);p<f;p++)d[p-1]=arguments[p];l[h].fn.apply(l[h].context,d)}}return!0},"emit");ne.prototype.on=s(function(t,i,n){return Cc(this,t,i,n,!1)},"on");ne.prototype.once=s(function(t,i,n){return Cc(this,t,i,n,!0)},"once");ne.prototype.removeListener=s(function(t,i,n,r){var o=se?se+t:t;if(!this._events[o])return this;if(!i)return Kn(this,o),this;var a=this._events[o];if(a.fn)a.fn===i&&(!r||a.once)&&(!n||a.context===n)&&Kn(this,o);else{for(var c=0,l=[],f=a.length;c<f;c++)(a[c].fn!==i||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[o]=l.length===1?l[0]:l:Kn(this,o)}return this},"removeListener");ne.prototype.removeAllListeners=s(function(t){var i;return t?(i=se?se+t:t,this._events[i]&&Kn(this,i)):(this._events=new Xi,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=se;ne.EventEmitter=ne;typeof ko<"u"&&(ko.exports=ne)});var q=T((Sx,Tl)=>{"use strict";Tl.exports={ArrayIsArray:s(function(e){return Array.isArray(e)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(e,t){return e.includes(t)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(e,t){return e.indexOf(t)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(e,t){return e.join(t)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(e,t){return e.map(t)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(e,t){return e.pop(t)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(e,t){return e.push(t)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(e,t,...i){return e.call(t,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},"FunctionPrototypeSymbolHasInstance"),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:s(function(e,t){return Object.defineProperties(e,t)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(e,t,i){return Object.defineProperty(e,t,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(e,t){return Object.getOwnPropertyDescriptor(e,t)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(e){return Object.keys(e)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(e,t){return Object.setPrototypeOf(e,t)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(e,t){return e.catch(t)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(e,t,i){return e.then(t,i)},"PromisePrototypeThen"),PromiseReject:s(function(e){return Promise.reject(e)},"PromiseReject"),PromiseResolve:s(function(e){return Promise.resolve(e)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(e,t){return e.test(t)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(e){return e.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(e){return e.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(e){return e.trim()},"StringPrototypeTrim"),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:s(function(e,t,i){return e.set(t,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var Ei=T((_x,sr)=>{"use strict";var{AbortController:Rl,AbortSignal:Sy}=typeof self<"u"?self:typeof window<"u"?window:void 0;sr.exports=Rl;sr.exports.AbortSignal=Sy;sr.exports.default=Rl});var gn=T((xx,ls)=>{"use strict";var _i=typeof Reflect=="object"?Reflect:null,Ll=_i&&typeof _i.apply=="function"?_i.apply:s(function(t,i,n){return Function.prototype.apply.call(t,i,n)},"ReflectApply"),ar;_i&&typeof _i.ownKeys=="function"?ar=_i.ownKeys:Object.getOwnPropertySymbols?ar=s(function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))},"ReflectOwnKeys"):ar=s(function(t){return Object.getOwnPropertyNames(t)},"ReflectOwnKeys");function Ey(e){console&&console.warn&&console.warn(e)}s(Ey,"ProcessEmitWarning");var Cl=Number.isNaN||s(function(t){return t!==t},"NumberIsNaN");function N(){N.init.call(this)}s(N,"EventEmitter");ls.exports=N;ls.exports.once=vy;N.EventEmitter=N;N.prototype._events=void 0;N.prototype._eventsCount=0;N.prototype._maxListeners=void 0;var Nl=10;function cr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}s(cr,"checkListener");Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Nl},"get"),set:s(function(e){if(typeof e!="number"||e<0||Cl(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Nl=e},"set")});N.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};N.prototype.setMaxListeners=s(function(t){if(typeof t!="number"||t<0||Cl(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},"setMaxListeners");function Bl(e){return e._maxListeners===void 0?N.defaultMaxListeners:e._maxListeners}s(Bl,"_getMaxListeners");N.prototype.getMaxListeners=s(function(){return Bl(this)},"getMaxListeners");N.prototype.emit=s(function(t){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=t==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[t];if(l===void 0)return!1;if(typeof l=="function")Ll(l,this,i);else for(var f=l.length,d=jl(l,f),n=0;n<f;++n)Ll(d[n],this,i);return!0},"emit");function Dl(e,t,i,n){var r,o,a;if(cr(i),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),a===void 0)a=o[t]=i,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Bl(e),r>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,Ey(c)}return e}s(Dl,"_addListener");N.prototype.addListener=s(function(t,i){return Dl(this,t,i,!1)},"addListener");N.prototype.on=N.prototype.addListener;N.prototype.prependListener=s(function(t,i){return Dl(this,t,i,!0)},"prependListener");function _y(){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(_y,"onceWrapper");function Ml(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=_y.bind(n);return r.listener=i,n.wrapFn=r,r}s(Ml,"_onceWrap");N.prototype.once=s(function(t,i){return cr(i),this.on(t,Ml(this,t,i)),this},"once");N.prototype.prependOnceListener=s(function(t,i){return cr(i),this.prependListener(t,Ml(this,t,i)),this},"prependOnceListener");N.prototype.removeListener=s(function(t,i){var n,r,o,a,c;if(cr(i),r=this._events,r===void 0)return this;if(n=r[t],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){c=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():xy(n,o),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,c||i)}return this},"removeListener");N.prototype.off=N.prototype.removeListener;N.prototype.removeAllListeners=s(function(t){var i,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[t],typeof i=="function")this.removeListener(t,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(t,i[r]);return this},"removeAllListeners");function Wl(e,t,i){var n=e._events;if(n===void 0)return[];var r=n[t];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?ky(r):jl(r,r.length)}s(Wl,"_listeners");N.prototype.listeners=s(function(t){return Wl(this,t,!0)},"listeners");N.prototype.rawListeners=s(function(t){return Wl(this,t,!1)},"rawListeners");N.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Ul.call(e,t)};N.prototype.listenerCount=Ul;function Ul(e){var t=this._events;if(t!==void 0){var i=t[e];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(Ul,"listenerCount");N.prototype.eventNames=s(function(){return this._eventsCount>0?ar(this._events):[]},"eventNames");function jl(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}s(jl,"arrayClone");function xy(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}s(xy,"spliceOne");function ky(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}s(ky,"unwrapListeners");function vy(e,t){return new Promise(function(i,n){function r(a){e.removeListener(t,o),n(a)}s(r,"errorListener");function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),ql(e,t,o,{once:!0}),t!=="error"&&Fy(e,r,{once:!0})})}s(vy,"once");function Fy(e,t,i){typeof e.on=="function"&&ql(e,"error",t,i)}s(Fy,"addErrorHandlerIfEventEmitter");function ql(e,t,i,n){if(typeof e.on=="function")n.once?e.once(t,i):e.on(t,i);else if(typeof e.addEventListener=="function")e.addEventListener(t,s(function r(o){n.once&&e.removeEventListener(t,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}s(ql,"eventTargetAgnosticAddListener")});var re=T((vx,us)=>{"use strict";var Iy=Ie(),{kResistStopPropagation:Ay,SymbolDispose:Oy}=q(),Py=globalThis.AbortSignal||Ei().AbortSignal,Ty=globalThis.AbortController||Ei().AbortController,Ry=Object.getPrototypeOf(async function(){}).constructor,$l=globalThis.Blob||Iy.Blob,Ly=s(typeof $l<"u"?function(t){return t instanceof $l}:function(t){return!1},"isBlob"),zl=s((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)},"validateAbortSignal"),Ny=s((e,t)=>{if(typeof e!="function")throw new ERR_INVALID_ARG_TYPE(t,"Function",e)},"validateFunction"),ds=class ds extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let i="";for(let n=0;n<t.length;n++)i+=` ${t[n].stack}
2
- `;super(i),this.name="AggregateError",this.errors=t}};s(ds,"AggregateError");var fs=ds;us.exports={AggregateError:fs,kEmptyObject:Object.freeze({}),once:s(function(e){let t=!1;return function(...i){t||(t=!0,e.apply(this,i))}},"once"),createDeferredPromise:s(function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},"createDeferredPromise"),promisify:s(function(e){return new Promise((t,i)=>{e((n,...r)=>n?i(n):t(...r))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(e,...t){return e.replace(/%([sdifj])/g,function(...[i,n]){let r=t.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},"format"),inspect:s(function(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(e){return e instanceof Ry},"isAsyncFunction"),isArrayBufferView:s(function(e){return ArrayBuffer.isView(e)},"isArrayBufferView")},isBlob:Ly,deprecate:s(function(e,t){return e},"deprecate"),addAbortListener:gn().addAbortListener||s(function(t,i){if(t===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);zl(t,"signal"),Ny(i,"listener");let n;return t.aborted?queueMicrotask(()=>i()):(t.addEventListener("abort",i,{__proto__:null,once:!0,[Ay]:!0}),n=s(()=>{t.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Oy](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Py.any||s(function(t){if(t.length===1)return t[0];let i=new Ty,n=s(()=>i.abort(),"abort");return t.forEach(r=>{zl(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{t.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};us.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=T((Ix,Kl)=>{"use strict";var{format:Cy,inspect:lr,AggregateError:By}=re(),Dy=globalThis.AggregateError||By,My=Symbol("kIsNodeError"),Wy=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Uy=/^([A-Z][a-z0-9]*)+$/,jy="__node_internal_",fr={};function Kt(e,t){if(!e)throw new fr.ERR_INTERNAL_ASSERTION(t)}s(Kt,"assert");function Vl(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(Vl,"addNumericalSeparator");function qy(e,t,i){if(typeof t=="function")return Kt(t.length<=i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${t.length}).`),t(...i);let n=(t.match(/%[dfijoOs]/g)||[]).length;return Kt(n===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?t:Cy(t,...i)}s(qy,"getMessage");function ie(e,t,i){i||(i=Error);let r=class r extends i{constructor(...a){super(qy(e,t,a))}toString(){return`${this.name} [${e}]: ${this.message}`}};s(r,"NodeError");let n=r;Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${e}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[My]=!0,fr[e]=n}s(ie,"E");function Hl(e){let t=jy+e.name;return Object.defineProperty(e,"name",{value:t}),e}s(Hl,"hideStackFrames");function $y(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let i=new Dy([t,e],t.message);return i.code=t.code,i}return e||t}s($y,"aggregateTwoErrors");var ps=class ps extends Error{constructor(t="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new fr.ERR_INVALID_ARG_TYPE("options","Object",i);super(t,i),this.code="ABORT_ERR",this.name="AbortError"}};s(ps,"AbortError");var hs=ps;ie("ERR_ASSERTION","%s",Error);ie("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Kt(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let l of t)Kt(typeof l=="string","All expected entries have to be of type string"),Wy.includes(l)?r.push(l.toLowerCase()):Uy.test(l)?o.push(l):(Kt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=r.indexOf("object");l!==-1&&(r.splice(r,l,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let l=r.pop();n+=`one of type ${r.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();n+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)n+=`. Received an instance of ${i.constructor.name}`;else{let l=lr(i,{depth:-1});n+=`. Received ${l}`}}else{let l=lr(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof i} (${l})`}return n},TypeError);ie("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let n=lr(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${n}`},TypeError);ie("ERR_INVALID_RETURN_VALUE",(e,t,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${e} to be returned from the "${t}" function but got ${r}.`},TypeError);ie("ERR_MISSING_ARGS",(...e)=>{Kt(e.length>0,"At least one arg needs to be specified");let t,i=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),i){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);ie("ERR_OUT_OF_RANGE",(e,t,i)=>{Kt(t,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Vl(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=Vl(n)),n+="n"):n=lr(i),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);ie("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ie("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ie("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ie("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ie("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ie("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ie("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ie("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ie("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ie("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ie("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Kl.exports={AbortError:hs,aggregateTwoErrors:Hl($y),hideStackFrames:Hl,codes:fr}});var ki=T((Ox,rf)=>{"use strict";var{ArrayIsArray:ms,ArrayPrototypeIncludes:Jl,ArrayPrototypeJoin:Ql,ArrayPrototypeMap:zy,NumberIsInteger:bs,NumberIsNaN:Vy,NumberMAX_SAFE_INTEGER:Hy,NumberMIN_SAFE_INTEGER:Ky,NumberParseInt:Gy,ObjectPrototypeHasOwnProperty:Yy,RegExpPrototypeExec:Zl,String:Xy,StringPrototypeToUpperCase:Jy,StringPrototypeTrim:Qy}=q(),{hideStackFrames:Re,codes:{ERR_SOCKET_BAD_PORT:Zy,ERR_INVALID_ARG_TYPE:oe,ERR_INVALID_ARG_VALUE:xi,ERR_OUT_OF_RANGE:Gt,ERR_UNKNOWN_SIGNAL:Gl}}=ae(),{normalizeEncoding:em}=re(),{isAsyncFunction:tm,isArrayBufferView:im}=re().types,Yl={};function nm(e){return e===(e|0)}s(nm,"isInt32");function rm(e){return e===e>>>0}s(rm,"isUint32");var om=/^[0-7]+$/,sm="must be a 32-bit unsigned integer or an octal string";function am(e,t,i){if(typeof e>"u"&&(e=i),typeof e=="string"){if(Zl(om,e)===null)throw new xi(t,e,sm);e=Gy(e,8)}return ef(e,t),e}s(am,"parseFileMode");var cm=Re((e,t,i=Ky,n=Hy)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);if(e<i||e>n)throw new Gt(t,`>= ${i} && <= ${n}`,e)}),lm=Re((e,t,i=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);if(e<i||e>n)throw new Gt(t,`>= ${i} && <= ${n}`,e)}),ef=Re((e,t,i=!1)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);let n=i?1:0,r=4294967295;if(e<n||e>r)throw new Gt(t,`>= ${n} && <= ${r}`,e)});function gs(e,t){if(typeof e!="string")throw new oe(t,"string",e)}s(gs,"validateString");function fm(e,t,i=void 0,n){if(typeof e!="number")throw new oe(t,"number",e);if(i!=null&&e<i||n!=null&&e>n||(i!=null||n!=null)&&Vy(e))throw new Gt(t,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}s(fm,"validateNumber");var um=Re((e,t,i)=>{if(!Jl(i,e)){let r="must be one of: "+Ql(zy(i,o=>typeof o=="string"?`'${o}'`:Xy(o)),", ");throw new xi(t,e,r)}});function tf(e,t){if(typeof e!="boolean")throw new oe(t,"boolean",e)}s(tf,"validateBoolean");function ys(e,t,i){return e==null||!Yy(e,t)?i:e[t]}s(ys,"getOwnPropertyValueOrDefault");var dm=Re((e,t,i=null)=>{let n=ys(i,"allowArray",!1),r=ys(i,"allowFunction",!1);if(!ys(i,"nullable",!1)&&e===null||!n&&ms(e)||typeof e!="object"&&(!r||typeof e!="function"))throw new oe(t,"Object",e)}),hm=Re((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new oe(t,"a dictionary",e)}),ur=Re((e,t,i=0)=>{if(!ms(e))throw new oe(t,"Array",e);if(e.length<i){let n=`must be longer than ${i}`;throw new xi(t,e,n)}});function pm(e,t){ur(e,t);for(let i=0;i<e.length;i++)gs(e[i],`${t}[${i}]`)}s(pm,"validateStringArray");function ym(e,t){ur(e,t);for(let i=0;i<e.length;i++)tf(e[i],`${t}[${i}]`)}s(ym,"validateBooleanArray");function mm(e,t){ur(e,t);for(let i=0;i<e.length;i++){let n=e[i],r=`${t}[${i}]`;if(n==null)throw new oe(r,"AbortSignal",n);nf(n,r)}}s(mm,"validateAbortSignalArray");function bm(e,t="signal"){if(gs(e,t),Yl[e]===void 0)throw Yl[Jy(e)]!==void 0?new Gl(e+" (signals must use all capital letters)"):new Gl(e)}s(bm,"validateSignalName");var gm=Re((e,t="buffer")=>{if(!im(e))throw new oe(t,["Buffer","TypedArray","DataView"],e)});function wm(e,t){let i=em(t),n=e.length;if(i==="hex"&&n%2!==0)throw new xi("encoding",t,`is invalid for data of length ${n}`)}s(wm,"validateEncoding");function Sm(e,t="Port",i=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&Qy(e).length===0||+e!==+e>>>0||e>65535||e===0&&!i)throw new Zy(t,e,i);return e|0}s(Sm,"validatePort");var nf=Re((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new oe(t,"AbortSignal",e)}),Em=Re((e,t)=>{if(typeof e!="function")throw new oe(t,"Function",e)}),_m=Re((e,t)=>{if(typeof e!="function"||tm(e))throw new oe(t,"Function",e)}),xm=Re((e,t)=>{if(e!==void 0)throw new oe(t,"undefined",e)});function km(e,t,i){if(!Jl(i,e))throw new oe(t,`('${Ql(i,"|")}')`,e)}s(km,"validateUnion");var vm=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Xl(e,t){if(typeof e>"u"||!Zl(vm,e))throw new xi(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Xl,"validateLinkHeaderFormat");function Fm(e){if(typeof e=="string")return Xl(e,"hints"),e;if(ms(e)){let t=e.length,i="";if(t===0)return i;for(let n=0;n<t;n++){let r=e[n];Xl(r,"hints"),i+=r,n!==t-1&&(i+=", ")}return i}throw new xi("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Fm,"validateLinkHeaderValue");rf.exports={isInt32:nm,isUint32:rm,parseFileMode:am,validateArray:ur,validateStringArray:pm,validateBooleanArray:ym,validateAbortSignalArray:mm,validateBoolean:tf,validateBuffer:gm,validateDictionary:hm,validateEncoding:wm,validateFunction:Em,validateInt32:lm,validateInteger:cm,validateNumber:fm,validateObject:dm,validateOneOf:um,validatePlainFunction:_m,validatePort:Sm,validateSignalName:bm,validateString:gs,validateUint32:ef,validateUndefined:xm,validateUnion:km,validateAbortSignal:nf,validateLinkHeaderValue:Fm}});var Pt=T((Tx,cf)=>{var V=cf.exports={},Qe,Ze;function ws(){throw new Error("setTimeout has not been defined")}s(ws,"defaultSetTimout");function Ss(){throw new Error("clearTimeout has not been defined")}s(Ss,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Qe=setTimeout:Qe=ws}catch{Qe=ws}try{typeof clearTimeout=="function"?Ze=clearTimeout:Ze=Ss}catch{Ze=Ss}})();function of(e){if(Qe===setTimeout)return setTimeout(e,0);if((Qe===ws||!Qe)&&setTimeout)return Qe=setTimeout,setTimeout(e,0);try{return Qe(e,0)}catch{try{return Qe.call(null,e,0)}catch{return Qe.call(this,e,0)}}}s(of,"runTimeout");function Im(e){if(Ze===clearTimeout)return clearTimeout(e);if((Ze===Ss||!Ze)&&clearTimeout)return Ze=clearTimeout,clearTimeout(e);try{return Ze(e)}catch{try{return Ze.call(null,e)}catch{return Ze.call(this,e)}}}s(Im,"runClearTimeout");var yt=[],vi=!1,Yt,dr=-1;function Am(){!vi||!Yt||(vi=!1,Yt.length?yt=Yt.concat(yt):dr=-1,yt.length&&sf())}s(Am,"cleanUpNextTick");function sf(){if(!vi){var e=of(Am);vi=!0;for(var t=yt.length;t;){for(Yt=yt,yt=[];++dr<t;)Yt&&Yt[dr].run();dr=-1,t=yt.length}Yt=null,vi=!1,Im(e)}}s(sf,"drainQueue");V.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];yt.push(new af(e,t)),yt.length===1&&!vi&&of(sf)};function af(e,t){this.fun=e,this.array=t}s(af,"Item");af.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function mt(){}s(mt,"noop");V.on=mt;V.addListener=mt;V.once=mt;V.off=mt;V.removeListener=mt;V.removeAllListeners=mt;V.emit=mt;V.prependListener=mt;V.prependOnceListener=mt;V.listeners=function(e){return[]};V.binding=function(e){throw new Error("process.binding is not supported")};V.cwd=function(){return"/"};V.chdir=function(e){throw new Error("process.chdir is not supported")};V.umask=function(){return 0}});var tt=T((Lx,xf)=>{"use strict";var{SymbolAsyncIterator:lf,SymbolIterator:ff,SymbolFor:Xt}=q(),uf=Xt("nodejs.stream.destroyed"),df=Xt("nodejs.stream.errored"),Es=Xt("nodejs.stream.readable"),_s=Xt("nodejs.stream.writable"),hf=Xt("nodejs.stream.disturbed"),Om=Xt("nodejs.webstream.isClosedPromise"),Pm=Xt("nodejs.webstream.controllerErrorFunction");function hr(e,t=!1){var i;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((i=e._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!e._writableState||e._readableState))}s(hr,"isReadableNodeStream");function pr(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}s(pr,"isWritableNodeStream");function Tm(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}s(Tm,"isDuplexNodeStream");function et(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}s(et,"isNodeStream");function pf(e){return!!(e&&!et(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}s(pf,"isReadableStream");function yf(e){return!!(e&&!et(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}s(yf,"isWritableStream");function mf(e){return!!(e&&!et(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}s(mf,"isTransformStream");function Rm(e){return pf(e)||yf(e)||mf(e)}s(Rm,"isWebStream");function Lm(e,t){return e==null?!1:t===!0?typeof e[lf]=="function":t===!1?typeof e[ff]=="function":typeof e[lf]=="function"||typeof e[ff]=="function"}s(Lm,"isIterable");function yr(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!!(e.destroyed||e[uf]||n!=null&&n.destroyed)}s(yr,"isDestroyed");function bf(e){if(!pr(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(bf,"isWritableEnded");function Nm(e,t){if(!pr(e))return null;if(e.writableFinished===!0)return!0;let i=e._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||t===!1&&i.ended===!0&&i.length===0)}s(Nm,"isWritableFinished");function Cm(e){if(!hr(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(Cm,"isReadableEnded");function gf(e,t){if(!hr(e))return null;let i=e._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||t===!1&&i.ended===!0&&i.length===0)}s(gf,"isReadableFinished");function wf(e){return e&&e[Es]!=null?e[Es]:typeof e?.readable!="boolean"?null:yr(e)?!1:hr(e)&&e.readable&&!gf(e)}s(wf,"isReadable");function Sf(e){return e&&e[_s]!=null?e[_s]:typeof e?.writable!="boolean"?null:yr(e)?!1:pr(e)&&e.writable&&!bf(e)}s(Sf,"isWritable");function Bm(e,t){return et(e)?yr(e)?!0:!(t?.readable!==!1&&wf(e)||t?.writable!==!1&&Sf(e)):null}s(Bm,"isFinished");function Dm(e){var t,i;return et(e)?e.writableErrored?e.writableErrored:(t=(i=e._writableState)===null||i===void 0?void 0:i.errored)!==null&&t!==void 0?t:null:null}s(Dm,"isWritableErrored");function Mm(e){var t,i;return et(e)?e.readableErrored?e.readableErrored:(t=(i=e._readableState)===null||i===void 0?void 0:i.errored)!==null&&t!==void 0?t:null:null}s(Mm,"isReadableErrored");function Wm(e){if(!et(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,i=e._readableState;return typeof t?.closed=="boolean"||typeof i?.closed=="boolean"?t?.closed||i?.closed:typeof e._closed=="boolean"&&Ef(e)?e._closed:null}s(Wm,"isClosed");function Ef(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}s(Ef,"isOutgoingMessage");function _f(e){return typeof e._sent100=="boolean"&&Ef(e)}s(_f,"isServerResponse");function Um(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}s(Um,"isServerRequest");function jm(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!n&&_f(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(jm,"willEmitClose");function qm(e){var t;return!!(e&&((t=e[hf])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}s(qm,"isDisturbed");function $m(e){var t,i,n,r,o,a,c,l,f,d;return!!(e&&((t=(i=(n=(r=(o=(a=e[df])!==null&&a!==void 0?a:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&r!==void 0?r:(c=e._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&n!==void 0?n:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(f=e._readableState)===null||f===void 0?void 0:f.errored)!==null&&t!==void 0?t:!((d=e._writableState)===null||d===void 0)&&d.errored))}s($m,"isErrored");xf.exports={isDestroyed:yr,kIsDestroyed:uf,isDisturbed:qm,kIsDisturbed:hf,isErrored:$m,kIsErrored:df,isReadable:wf,kIsReadable:Es,kIsClosedPromise:Om,kControllerErrorFunction:Pm,kIsWritable:_s,isClosed:Wm,isDuplexNodeStream:Tm,isFinished:Bm,isIterable:Lm,isReadableNodeStream:hr,isReadableStream:pf,isReadableEnded:Cm,isReadableFinished:gf,isReadableErrored:Mm,isNodeStream:et,isWebStream:Rm,isWritable:Sf,isWritableNodeStream:pr,isWritableStream:yf,isWritableEnded:bf,isWritableFinished:Nm,isWritableErrored:Dm,isServerRequest:Um,isServerResponse:_f,willEmitClose:jm,isTransformStream:mf}});var bt=T((Cx,Is)=>{var Tt=Pt(),{AbortError:Rf,codes:zm}=ae(),{ERR_INVALID_ARG_TYPE:Vm,ERR_STREAM_PREMATURE_CLOSE:kf}=zm,{kEmptyObject:ks,once:vs}=re(),{validateAbortSignal:Hm,validateFunction:Km,validateObject:Gm,validateBoolean:Ym}=ki(),{Promise:Xm,PromisePrototypeThen:Jm,SymbolDispose:Lf}=q(),{isClosed:Qm,isReadable:vf,isReadableNodeStream:xs,isReadableStream:Zm,isReadableFinished:Ff,isReadableErrored:If,isWritable:Af,isWritableNodeStream:Of,isWritableStream:eb,isWritableFinished:Pf,isWritableErrored:Tf,isNodeStream:tb,willEmitClose:ib,kIsClosedPromise:nb}=tt(),Fi;function rb(e){return e.setHeader&&typeof e.abort=="function"}s(rb,"isRequest");var Fs=s(()=>{},"nop");function Nf(e,t,i){var n,r;if(arguments.length===2?(i=t,t=ks):t==null?t=ks:Gm(t,"options"),Km(i,"callback"),Hm(t.signal,"options.signal"),i=vs(i),Zm(e)||eb(e))return ob(e,t,i);if(!tb(e))throw new Vm("stream",["ReadableStream","WritableStream","Stream"],e);let o=(n=t.readable)!==null&&n!==void 0?n:xs(e),a=(r=t.writable)!==null&&r!==void 0?r:Of(e),c=e._writableState,l=e._readableState,f=s(()=>{e.writable||b()},"onlegacyfinish"),d=ib(e)&&xs(e)===o&&Of(e)===a,h=Pf(e,!1),b=s(()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||o))&&(!o||p)&&i.call(e)},"onfinish"),p=Ff(e,!1),w=s(()=>{p=!0,e.destroyed&&(d=!1),!(d&&(!e.writable||a))&&(!a||h)&&i.call(e)},"onend"),g=s(B=>{i.call(e,B)},"onerror"),A=Qm(e),k=s(()=>{A=!0;let B=Tf(e)||If(e);if(B&&typeof B!="boolean")return i.call(e,B);if(o&&!p&&xs(e,!0)&&!Ff(e,!1))return i.call(e,new kf);if(a&&!h&&!Pf(e,!1))return i.call(e,new kf);i.call(e)},"onclose"),v=s(()=>{A=!0;let B=Tf(e)||If(e);if(B&&typeof B!="boolean")return i.call(e,B);i.call(e)},"onclosed"),L=s(()=>{e.req.on("finish",b)},"onrequest");rb(e)?(e.on("complete",b),d||e.on("abort",k),e.req?L():e.on("request",L)):a&&!c&&(e.on("end",f),e.on("close",f)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",w),e.on("finish",b),t.error!==!1&&e.on("error",g),e.on("close",k),A?Tt.nextTick(k):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||Tt.nextTick(v):(!o&&(!d||vf(e))&&(h||Af(e)===!1)||!a&&(!d||Af(e))&&(p||vf(e)===!1)||l&&e.req&&e.aborted)&&Tt.nextTick(v);let F=s(()=>{i=Fs,e.removeListener("aborted",k),e.removeListener("complete",b),e.removeListener("abort",k),e.removeListener("request",L),e.req&&e.req.removeListener("finish",b),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",b),e.removeListener("end",w),e.removeListener("error",g),e.removeListener("close",k)},"cleanup");if(t.signal&&!A){let B=s(()=>{let Bt=i;F(),Bt.call(e,new Rf(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)Tt.nextTick(B);else{Fi=Fi||re().addAbortListener;let Bt=Fi(t.signal,B),Ee=i;i=vs((...si)=>{Bt[Lf](),Ee.apply(e,si)})}}return F}s(Nf,"eos");function ob(e,t,i){let n=!1,r=Fs;if(t.signal)if(r=s(()=>{n=!0,i.call(e,new Rf(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)Tt.nextTick(r);else{Fi=Fi||re().addAbortListener;let a=Fi(t.signal,r),c=i;i=vs((...l)=>{a[Lf](),c.apply(e,l)})}let o=s((...a)=>{n||Tt.nextTick(()=>i.apply(e,a))},"resolverFn");return Jm(e[nb].promise,o,o),Fs}s(ob,"eosWeb");function sb(e,t){var i;let n=!1;return t===null&&(t=ks),(i=t)!==null&&i!==void 0&&i.cleanup&&(Ym(t.cleanup,"cleanup"),n=t.cleanup),new Xm((r,o)=>{let a=Nf(e,t,c=>{n&&a(),c?o(c):r()})})}s(sb,"finished");Is.exports=Nf;Is.exports.finished=sb});var Jt=T((Dx,qf)=>{"use strict";var it=Pt(),{aggregateTwoErrors:ab,codes:{ERR_MULTIPLE_CALLBACK:cb},AbortError:lb}=ae(),{Symbol:Df}=q(),{kIsDestroyed:fb,isDestroyed:ub,isFinished:db,isServerRequest:hb}=tt(),Mf=Df("kDestroy"),As=Df("kConstruct");function Wf(e,t,i){e&&(e.stack,t&&!t.errored&&(t.errored=e),i&&!i.errored&&(i.errored=e))}s(Wf,"checkError");function pb(e,t){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof t=="function"&&t(),this):(Wf(e,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Cf(this,e,t):this.once(Mf,function(o){Cf(this,ab(o,e),t)}),this)}s(pb,"destroy");function Cf(e,t,i){let n=!1;function r(o){if(n)return;n=!0;let a=e._readableState,c=e._writableState;Wf(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?it.nextTick(yb,e,o):it.nextTick(Uf,e)}s(r,"onDestroy");try{e._destroy(t||null,r)}catch(o){r(o)}}s(Cf,"_destroy");function yb(e,t){Os(e,t),Uf(e)}s(yb,"emitErrorCloseNT");function Uf(e){let t=e._readableState,i=e._writableState;i&&(i.closeEmitted=!0),t&&(t.closeEmitted=!0),(i!=null&&i.emitClose||t!=null&&t.emitClose)&&e.emit("close")}s(Uf,"emitCloseNT");function Os(e,t){let i=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),e.emit("error",t))}s(Os,"emitErrorNT");function mb(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}s(mb,"undestroy");function Ps(e,t,i){let n=e._readableState,r=e._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?e.destroy(t):t&&(t.stack,r&&!r.errored&&(r.errored=t),n&&!n.errored&&(n.errored=t),i?it.nextTick(Os,e,t):Os(e,t))}s(Ps,"errorOrDestroy");function bb(e,t){if(typeof e._construct!="function")return;let i=e._readableState,n=e._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),e.once(As,t),!(e.listenerCount(As)>1)&&it.nextTick(gb,e)}s(bb,"construct");function gb(e){let t=!1;function i(n){if(t){Ps(e,n??new cb);return}t=!0;let r=e._readableState,o=e._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(Mf,n):n?Ps(e,n,!0):it.nextTick(wb,e)}s(i,"onConstruct");try{e._construct(n=>{it.nextTick(i,n)})}catch(n){it.nextTick(i,n)}}s(gb,"constructNT");function wb(e){e.emit(As)}s(wb,"emitConstructNT");function Bf(e){return e?.setHeader&&typeof e.abort=="function"}s(Bf,"isRequest");function jf(e){e.emit("close")}s(jf,"emitCloseLegacy");function Sb(e,t){e.emit("error",t),it.nextTick(jf,e)}s(Sb,"emitErrorCloseLegacy");function Eb(e,t){!e||ub(e)||(!t&&!db(e)&&(t=new lb),hb(e)?(e.socket=null,e.destroy(t)):Bf(e)?e.abort():Bf(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?it.nextTick(Sb,e,t):it.nextTick(jf,e),e.destroyed||(e[fb]=!0))}s(Eb,"destroyer");qf.exports={construct:bb,destroyer:Eb,destroy:pb,undestroy:mb,errorOrDestroy:Ps}});var gr=T((Wx,zf)=>{"use strict";var{ArrayIsArray:_b,ObjectSetPrototypeOf:$f}=q(),{EventEmitter:mr}=gn();function br(e){mr.call(this,e)}s(br,"Stream");$f(br.prototype,mr.prototype);$f(br,mr);br.prototype.pipe=function(e,t){let i=this;function n(d){e.writable&&e.write(d)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),e.on("drain",r),!e._isStdio&&(!t||t.end!==!1)&&(i.on("end",a),i.on("close",c));let o=!1;function a(){o||(o=!0,e.end())}s(a,"onend");function c(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}s(c,"onclose");function l(d){f(),mr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),Ts(i,"error",l),Ts(e,"error",l);function f(){i.removeListener("data",n),e.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),e.removeListener("error",l),i.removeListener("end",f),i.removeListener("close",f),e.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),e.on("close",f),e.emit("pipe",i),e};function Ts(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):_b(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}s(Ts,"prependListener");zf.exports={Stream:br,prependListener:Ts}});var wn=T((jx,wr)=>{"use strict";var{SymbolDispose:xb}=q(),{AbortError:Vf,codes:kb}=ae(),{isNodeStream:Hf,isWebStream:vb,kControllerErrorFunction:Fb}=tt(),Ib=bt(),{ERR_INVALID_ARG_TYPE:Kf}=kb,Rs,Ab=s((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new Kf(t,"AbortSignal",e)},"validateAbortSignal");wr.exports.addAbortSignal=s(function(t,i){if(Ab(t,"signal"),!Hf(i)&&!vb(i))throw new Kf("stream",["ReadableStream","WritableStream","Stream"],i);return wr.exports.addAbortSignalNoValidate(t,i)},"addAbortSignal");wr.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let i=Hf(t)?()=>{t.destroy(new Vf(void 0,{cause:e.reason}))}:()=>{t[Fb](new Vf(void 0,{cause:e.reason}))};if(e.aborted)i();else{Rs=Rs||re().addAbortListener;let n=Rs(e,i);Ib(t,n[xb])}return t}});var Xf=T(($x,Yf)=>{"use strict";var{StringPrototypeSlice:Gf,SymbolIterator:Ob,TypedArrayPrototypeSet:Sr,Uint8Array:Pb}=q(),{Buffer:Ls}=Ie(),{inspect:Tb}=re(),Ii;Yf.exports=(Ii=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(t){let i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=t+i.data;return n}concat(t){if(this.length===0)return Ls.alloc(0);let i=Ls.allocUnsafe(t>>>0),n=this.head,r=0;for(;n;)Sr(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(t,i){let n=this.head.data;if(t<n.length){let r=n.slice(0,t);return this.head.data=n.slice(t),r}return t===n.length?this.shift():i?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[Ob](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let i="",n=this.head,r=0;do{let o=n.data;if(t>o.length)i+=o,t-=o.length;else{t===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=Gf(o,0,t),this.head=n,n.data=Gf(o,t));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(t){let i=Ls.allocUnsafe(t),n=t,r=this.head,o=0;do{let a=r.data;if(t>a.length)Sr(i,a,n-t),t-=a.length;else{t===a.length?(Sr(i,a,n-t),++o,r.next?this.head=r.next:this.head=this.tail=null):(Sr(i,new Pb(a.buffer,a.byteOffset,t),n-t),this.head=r,r.data=a.slice(t));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](t,i){return Tb(this,{...i,depth:0,customInspect:!1})}},s(Ii,"BufferList"),Ii)});var Sn=T((Vx,eu)=>{"use strict";var{MathFloor:Rb,NumberIsInteger:Lb}=q(),{validateInteger:Nb}=ki(),{ERR_INVALID_ARG_VALUE:Cb}=ae().codes,Jf=16*1024,Qf=16;function Bb(e,t,i){return e.highWaterMark!=null?e.highWaterMark:t?e[i]:null}s(Bb,"highWaterMarkFrom");function Zf(e){return e?Qf:Jf}s(Zf,"getDefaultHighWaterMark");function Db(e,t){Nb(t,"value",0),e?Qf=t:Jf=t}s(Db,"setDefaultHighWaterMark");function Mb(e,t,i,n){let r=Bb(t,n,i);if(r!=null){if(!Lb(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Cb(o,r)}return Rb(r)}return Zf(e.objectMode)}s(Mb,"getHighWaterMark");eu.exports={getHighWaterMark:Mb,getDefaultHighWaterMark:Zf,setDefaultHighWaterMark:Db}});var nu=T((Ns,iu)=>{var Er=Ie(),nt=Er.Buffer;function tu(e,t){for(var i in e)t[i]=e[i]}s(tu,"copyProps");nt.from&&nt.alloc&&nt.allocUnsafe&&nt.allocUnsafeSlow?iu.exports=Er:(tu(Er,Ns),Ns.Buffer=Qt);function Qt(e,t,i){return nt(e,t,i)}s(Qt,"SafeBuffer");Qt.prototype=Object.create(nt.prototype);tu(nt,Qt);Qt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return nt(e,t,i)};Qt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=nt(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};Qt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return nt(e)};Qt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Er.SlowBuffer(e)}});var su=T(ou=>{"use strict";var Bs=nu().Buffer,ru=Bs.isEncoding||function(e){switch(e=""+e,e&&e.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 Wb(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}s(Wb,"_normalizeEncoding");function Ub(e){var t=Wb(e);if(typeof t!="string"&&(Bs.isEncoding===ru||!ru(e)))throw new Error("Unknown encoding: "+e);return t||e}s(Ub,"normalizeEncoding");ou.StringDecoder=En;function En(e){this.encoding=Ub(e);var t;switch(this.encoding){case"utf16le":this.text=Hb,this.end=Kb,t=4;break;case"utf8":this.fillLast=$b,t=4;break;case"base64":this.text=Gb,this.end=Yb,t=3;break;default:this.write=Xb,this.end=Jb;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bs.allocUnsafe(t)}s(En,"StringDecoder");En.prototype.write=function(e){if(e.length===0)return"";var t,i;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""};En.prototype.end=Vb;En.prototype.text=zb;En.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Cs(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}s(Cs,"utf8CheckByte");function jb(e,t,i){var n=t.length-1;if(n<i)return 0;var r=Cs(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=Cs(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=Cs(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}s(jb,"utf8CheckIncomplete");function qb(e,t,i){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}s(qb,"utf8CheckExtraBytes");function $b(e){var t=this.lastTotal-this.lastNeed,i=qb(this,e,t);if(i!==void 0)return i;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}s($b,"utf8FillLast");function zb(e,t){var i=jb(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}s(zb,"utf8Text");function Vb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}s(Vb,"utf8End");function Hb(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}s(Hb,"utf16Text");function Kb(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}s(Kb,"utf16End");function Gb(e,t){var i=(e.length-t)%3;return i===0?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}s(Gb,"base64Text");function Yb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}s(Yb,"base64End");function Xb(e){return e.toString(this.encoding)}s(Xb,"simpleWrite");function Jb(e){return e&&e.length?this.write(e):""}s(Jb,"simpleEnd")});var Ds=T((Xx,fu)=>{"use strict";var au=Pt(),{PromisePrototypeThen:Qb,SymbolAsyncIterator:cu,SymbolIterator:lu}=q(),{Buffer:Zb}=Ie(),{ERR_INVALID_ARG_TYPE:eg,ERR_STREAM_NULL_VALUES:tg}=ae().codes;function ig(e,t,i){let n;if(typeof t=="string"||t instanceof Zb)return new e({objectMode:!0,...i,read:s(function(){this.push(t),this.push(null)},"read")});let r;if(t&&t[cu])r=!0,n=t[cu]();else if(t&&t[lu])r=!1,n=t[lu]();else throw new eg("iterable",["Iterable"],t);let o=new e({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(f,d){Qb(c(f),()=>au.nextTick(d,f),h=>au.nextTick(d,h||f))};async function c(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:b,done:p}=await n.throw(f);if(await b,p)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}s(c,"close");async function l(){for(;;){try{let{value:f,done:d}=r?await n.next():n.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new tg;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(ig,"from");fu.exports=ig});var xn=T((Qx,Au)=>{var Me=Pt(),{ArrayPrototypeIndexOf:ng,NumberIsInteger:rg,NumberIsNaN:og,NumberParseInt:sg,ObjectDefineProperties:Vs,ObjectKeys:ag,ObjectSetPrototypeOf:hu,Promise:pu,SafeSet:cg,SymbolAsyncDispose:lg,SymbolAsyncIterator:fg,Symbol:ug}=q();Au.exports=O;O.ReadableState=vr;var{EventEmitter:dg}=gn(),{Stream:Rt,prependListener:hg}=gr(),{Buffer:Ms}=Ie(),{addAbortSignal:pg}=wn(),yu=bt(),P=re().debuglog("stream",e=>{P=e}),yg=Xf(),Pi=Jt(),{getHighWaterMark:mg,getDefaultHighWaterMark:bg}=Sn(),{aggregateTwoErrors:uu,codes:{ERR_INVALID_ARG_TYPE:gg,ERR_METHOD_NOT_IMPLEMENTED:wg,ERR_OUT_OF_RANGE:Sg,ERR_STREAM_PUSH_AFTER_EOF:Eg,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:_g},AbortError:xg}=ae(),{validateObject:kg}=ki(),Zt=ug("kPaused"),{StringDecoder:mu}=su(),vg=Ds();hu(O.prototype,Rt.prototype);hu(O,Rt);var Ws=s(()=>{},"nop"),{errorOrDestroy:Ai}=Pi,Oi=1,Fg=2,bu=4,_n=8,gu=16,_r=32,xr=64,wu=128,Ig=256,Ag=512,Og=1024,$s=2048,zs=4096,Pg=8192,Tg=16384,Rg=32768,Su=65536,Lg=1<<17,Ng=1<<18;function J(e){return{enumerable:!1,get:s(function(){return(this.state&e)!==0},"get"),set:s(function(t){t?this.state|=e:this.state&=~e},"set")}}s(J,"makeBitMapDescriptor");Vs(vr.prototype,{objectMode:J(Oi),ended:J(Fg),endEmitted:J(bu),reading:J(_n),constructed:J(gu),sync:J(_r),needReadable:J(xr),emittedReadable:J(wu),readableListening:J(Ig),resumeScheduled:J(Ag),errorEmitted:J(Og),emitClose:J($s),autoDestroy:J(zs),destroyed:J(Pg),closed:J(Tg),closeEmitted:J(Rg),multiAwaitDrain:J(Su),readingMore:J(Lg),dataEmitted:J(Ng)});function vr(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.state=$s|zs|gu|_r,e&&e.objectMode&&(this.state|=Oi),i&&e&&e.readableObjectMode&&(this.state|=Oi),this.highWaterMark=e?mg(this,e,"readableHighWaterMark",i):bg(!1),this.buffer=new yg,this.length=0,this.pipes=[],this.flowing=null,this[Zt]=null,e&&e.emitClose===!1&&(this.state&=~$s),e&&e.autoDestroy===!1&&(this.state&=~zs),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new mu(e.encoding),this.encoding=e.encoding)}s(vr,"ReadableState");function O(e){if(!(this instanceof O))return new O(e);let t=this instanceof rt();this._readableState=new vr(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&pg(e.signal,this)),Rt.call(this,e),Pi.construct(this,()=>{this._readableState.needReadable&&kr(this,this._readableState)})}s(O,"Readable");O.prototype.destroy=Pi.destroy;O.prototype._undestroy=Pi.undestroy;O.prototype._destroy=function(e,t){t(e)};O.prototype[dg.captureRejectionSymbol]=function(e){this.destroy(e)};O.prototype[lg]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new xg,this.destroy(e)),new pu((t,i)=>yu(this,n=>n&&n!==e?i(n):t(null)))};O.prototype.push=function(e,t){return Eu(this,e,t,!1)};O.prototype.unshift=function(e,t){return Eu(this,e,t,!0)};function Eu(e,t,i,n){P("readableAddChunk",t);let r=e._readableState,o;if(r.state&Oi||(typeof t=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?t=Ms.from(t,i).toString(r.encoding):(t=Ms.from(t,i),i=""))):t instanceof Ms?i="":Rt._isUint8Array(t)?(t=Rt._uint8ArrayToBuffer(t),i=""):t!=null&&(o=new gg("chunk",["string","Buffer","Uint8Array"],t))),o)Ai(e,o);else if(t===null)r.state&=~_n,Dg(e,r);else if(r.state&Oi||t&&t.length>0)if(n)if(r.state&bu)Ai(e,new _g);else{if(r.destroyed||r.errored)return!1;Us(e,r,t,!0)}else if(r.ended)Ai(e,new Eg);else{if(r.destroyed||r.errored)return!1;r.state&=~_n,r.decoder&&!i?(t=r.decoder.write(t),r.objectMode||t.length!==0?Us(e,r,t,!1):kr(e,r)):Us(e,r,t,!1)}else n||(r.state&=~_n,kr(e,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(Eu,"readableAddChunk");function Us(e,t,i,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&Su?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.state&xr&&Fr(e)),kr(e,t)}s(Us,"addChunk");O.prototype.isPaused=function(){let e=this._readableState;return e[Zt]===!0||e.flowing===!1};O.prototype.setEncoding=function(e){let t=new mu(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=t.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var Cg=1073741824;function Bg(e){if(e>Cg)throw new Sg("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}s(Bg,"computeNewHighWaterMark");function du(e,t){return e<=0||t.length===0&&t.ended?0:t.state&Oi?1:og(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}s(du,"howMuchToRead");O.prototype.read=function(e){P("read",e),e===void 0?e=NaN:rg(e)||(e=sg(e,10));let t=this._readableState,i=e;if(e>t.highWaterMark&&(t.highWaterMark=Bg(e)),e!==0&&(t.state&=~wu),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return P("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?js(this):Fr(this),null;if(e=du(e,t),e===0&&t.ended)return t.length===0&&js(this),null;let n=(t.state&xr)!==0;if(P("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,P("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,P("reading, ended or constructing",n);else if(n){P("do read"),t.state|=_n|_r,t.length===0&&(t.state|=xr);try{this._read(t.highWaterMark)}catch(o){Ai(this,o)}t.state&=~_r,t.reading||(e=du(i,t))}let r;return e>0?r=Fu(e,t):r=null,r===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&js(this)),r!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",r)),r};function Dg(e,t){if(P("onEofChunk"),!t.ended){if(t.decoder){let i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?Fr(e):(t.needReadable=!1,t.emittedReadable=!0,_u(e))}}s(Dg,"onEofChunk");function Fr(e){let t=e._readableState;P("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,Me.nextTick(_u,e))}s(Fr,"emitReadable");function _u(e){let t=e._readableState;P("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ku(e)}s(_u,"emitReadable_");function kr(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Me.nextTick(Mg,e,t))}s(kr,"maybeReadMore");function Mg(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let i=t.length;if(P("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}s(Mg,"maybeReadMore_");O.prototype._read=function(e){throw new wg("_read()")};O.prototype.pipe=function(e,t){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new cg(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),P("pipe count=%d opts=%j",n.pipes.length,t);let o=(!t||t.end!==!1)&&e!==Me.stdout&&e!==Me.stderr?c:A;n.endEmitted?Me.nextTick(o):i.once("end",o),e.on("unpipe",a);function a(k,v){P("onunpipe"),k===i&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,d())}s(a,"onunpipe");function c(){P("onend"),e.end()}s(c,"onend");let l,f=!1;function d(){P("cleanup"),e.removeListener("close",w),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",A),i.removeListener("data",b),f=!0,l&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}s(d,"cleanup");function h(){f||(n.pipes.length===1&&n.pipes[0]===e?(P("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(P("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),i.pause()),l||(l=Wg(i,e),e.on("drain",l))}s(h,"pause"),i.on("data",b);function b(k){P("ondata");let v=e.write(k);P("dest.write",v),v===!1&&h()}s(b,"ondata");function p(k){if(P("onerror",k),A(),e.removeListener("error",p),e.listenerCount("error")===0){let v=e._writableState||e._readableState;v&&!v.errorEmitted?Ai(e,k):e.emit("error",k)}}s(p,"onerror"),hg(e,"error",p);function w(){e.removeListener("finish",g),A()}s(w,"onclose"),e.once("close",w);function g(){P("onfinish"),e.removeListener("close",w),A()}s(g,"onfinish"),e.once("finish",g);function A(){P("unpipe"),i.unpipe(e)}return s(A,"unpipe"),e.emit("pipe",i),e.writableNeedDrain===!0?h():n.flowing||(P("pipe resume"),i.resume()),e};function Wg(e,t){return s(function(){let n=e._readableState;n.awaitDrainWriters===t?(P("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(P("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()},"pipeOnDrainFunctionResult")}s(Wg,"pipeOnDrain");O.prototype.unpipe=function(e){let t=this._readableState,i={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let r=t.pipes;t.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=ng(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,i),this)};O.prototype.on=function(e,t){let i=Rt.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,P("on readable",n.length,n.reading),n.length?Fr(this):n.reading||Me.nextTick(Ug,this)),i};O.prototype.addListener=O.prototype.on;O.prototype.removeListener=function(e,t){let i=Rt.prototype.removeListener.call(this,e,t);return e==="readable"&&Me.nextTick(xu,this),i};O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=function(e){let t=Rt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Me.nextTick(xu,this),t};function xu(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[Zt]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}s(xu,"updateReadableListening");function Ug(e){P("readable nexttick read 0"),e.read(0)}s(Ug,"nReadingNextTick");O.prototype.resume=function(){let e=this._readableState;return e.flowing||(P("resume"),e.flowing=!e.readableListening,jg(this,e)),e[Zt]=!1,this};function jg(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick(qg,e,t))}s(jg,"resume");function qg(e,t){P("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ku(e),t.flowing&&!t.reading&&e.read(0)}s(qg,"resume_");O.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Zt]=!0,this};function ku(e){let t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}s(ku,"flow");O.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{Ai(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let i=ag(e);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof e[r]=="function"&&(this[r]=e[r].bind(e))}return this};O.prototype[fg]=function(){return vu(this)};O.prototype.iterator=function(e){return e!==void 0&&kg(e,"options"),vu(this,e)};function vu(e,t){typeof e.read!="function"&&(e=O.wrap(e,{objectMode:!0}));let i=$g(e,t);return i.stream=e,i}s(vu,"streamToAsyncIterator");async function*$g(e,t){let i=Ws;function n(a){this===e?(i(),i=Ws):i=a}s(n,"next"),e.on("readable",n);let r,o=yu(e,{writable:!1},a=>{r=a?uu(r,a):null,i(),i=Ws});try{for(;;){let a=e.destroyed?null:e.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new pu(n)}}}catch(a){throw r=uu(r,a),r}finally{(r||t?.destroyOnReturn!==!1)&&(r===void 0||e._readableState.autoDestroy)?Pi.destroyer(e,null):(e.off("readable",n),o())}}s($g,"createAsyncIterator");Vs(O.prototype,{readable:{__proto__:null,get:s(function(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},"get"),set:s(function(e){this._readableState&&(this._readableState.readable=!!e)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(e){this._readableState&&(this._readableState.flowing=e)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});Vs(vr.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Zt]!==!1},"get"),set:s(function(e){this[Zt]=!!e},"set")}});O._fromList=Fu;function Fu(e,t){if(t.length===0)return null;let i;return t.objectMode?i=t.buffer.shift():!e||e>=t.length?(t.decoder?i=t.buffer.join(""):t.buffer.length===1?i=t.buffer.first():i=t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i}s(Fu,"fromList");function js(e){let t=e._readableState;P("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Me.nextTick(zg,t,e))}s(js,"endReadable");function zg(e,t){if(P("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Me.nextTick(Vg,t);else if(e.autoDestroy){let i=t._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&t.destroy()}}}s(zg,"endReadableNT");function Vg(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}s(Vg,"endWritableNT");O.from=function(e,t){return vg(O,e,t)};var qs;function Iu(){return qs===void 0&&(qs={}),qs}s(Iu,"lazyWebStreams");O.fromWeb=function(e,t){return Iu().newStreamReadableFromReadableStream(e,t)};O.toWeb=function(e,t){return Iu().newReadableStreamFromStreamReadable(e,t)};O.wrap=function(e,t){var i,n;return new O({objectMode:(i=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&i!==void 0?i:!0,...t,destroy:s(function(r,o){Pi.destroyer(e,r),o(r)},"destroy")}).wrap(e)}});var Tr=T((e0,Uu)=>{var ei=Pt(),{ArrayPrototypeSlice:Tu,Error:Hg,FunctionPrototypeSymbolHasInstance:Ru,ObjectDefineProperty:Lu,ObjectDefineProperties:Kg,ObjectSetPrototypeOf:Nu,StringPrototypeToLowerCase:Gg,Symbol:Yg,SymbolHasInstance:Xg}=q();Uu.exports=$;$.WritableState=Fn;var{EventEmitter:Jg}=gn(),kn=gr().Stream,{Buffer:Ir}=Ie(),Pr=Jt(),{addAbortSignal:Qg}=wn(),{getHighWaterMark:Zg,getDefaultHighWaterMark:ew}=Sn(),{ERR_INVALID_ARG_TYPE:tw,ERR_METHOD_NOT_IMPLEMENTED:iw,ERR_MULTIPLE_CALLBACK:Cu,ERR_STREAM_CANNOT_PIPE:nw,ERR_STREAM_DESTROYED:vn,ERR_STREAM_ALREADY_FINISHED:rw,ERR_STREAM_NULL_VALUES:ow,ERR_STREAM_WRITE_AFTER_END:sw,ERR_UNKNOWN_ENCODING:Bu}=ae().codes,{errorOrDestroy:Ti}=Pr;Nu($.prototype,kn.prototype);Nu($,kn);function Gs(){}s(Gs,"nop");var Ri=Yg("kOnFinished");function Fn(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.objectMode=!!(e&&e.objectMode),i&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?Zg(this,e,"writableHighWaterMark",i):ew(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=cw.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Or(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Ri]=[]}s(Fn,"WritableState");function Or(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}s(Or,"resetBuffer");Fn.prototype.getBuffer=s(function(){return Tu(this.buffered,this.bufferedIndex)},"getBuffer");Lu(Fn.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function $(e){let t=this instanceof rt();if(!t&&!Ru($,this))return new $(e);this._writableState=new Fn(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&Qg(e.signal,this)),kn.call(this,e),Pr.construct(this,()=>{let i=this._writableState;i.writing||Xs(this,i),Js(this,i)})}s($,"Writable");Lu($,Xg,{__proto__:null,value:s(function(e){return Ru(this,e)?!0:this!==$?!1:e&&e._writableState instanceof Fn},"value")});$.prototype.pipe=function(){Ti(this,new nw)};function Du(e,t,i,n){let r=e._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!Ir.isEncoding(i))throw new Bu(i);typeof n!="function"&&(n=Gs)}if(t===null)throw new ow;if(!r.objectMode)if(typeof t=="string")r.decodeStrings!==!1&&(t=Ir.from(t,i),i="buffer");else if(t instanceof Ir)i="buffer";else if(kn._isUint8Array(t))t=kn._uint8ArrayToBuffer(t),i="buffer";else throw new tw("chunk",["string","Buffer","Uint8Array"],t);let o;return r.ending?o=new sw:r.destroyed&&(o=new vn("write")),o?(ei.nextTick(n,o),Ti(e,o,!0),o):(r.pendingcb++,aw(e,r,t,i,n))}s(Du,"_write");$.prototype.write=function(e,t,i){return Du(this,e,t,i)===!0};$.prototype.cork=function(){this._writableState.corked++};$.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||Xs(this,e))};$.prototype.setDefaultEncoding=s(function(t){if(typeof t=="string"&&(t=Gg(t)),!Ir.isEncoding(t))throw new Bu(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function aw(e,t,i,n,r){let o=t.objectMode?1:i.length;t.length+=o;let a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:i,encoding:n,callback:r}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&r!==Gs&&(t.allNoop=!1)):(t.writelen=o,t.writecb=r,t.writing=!0,t.sync=!0,e._write(i,n,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}s(aw,"writeOrBuffer");function Ou(e,t,i,n,r,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new vn("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}s(Ou,"doWrite");function Pu(e,t,i,n){--t.pendingcb,n(i),Ys(t),Ti(e,i)}s(Pu,"onwriteError");function cw(e,t){let i=e._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){Ti(e,new Cu);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,t?(t.stack,i.errored||(i.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?ei.nextTick(Pu,e,i,t,r):Pu(e,i,t,r)):(i.buffered.length>i.bufferedIndex&&Xs(e,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:e,state:i},ei.nextTick(lw,i.afterWriteTickInfo)):Mu(e,i,1,r))}s(cw,"onwrite");function lw({stream:e,state:t,count:i,cb:n}){return t.afterWriteTickInfo=null,Mu(e,t,i,n)}s(lw,"afterWriteTick");function Mu(e,t,i,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));i-- >0;)t.pendingcb--,n();t.destroyed&&Ys(t),Js(e,t)}s(Mu,"afterWrite");function Ys(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:o,callback:a}=e.buffered[r],c=e.objectMode?1:o.length;e.length-=c,a((t=e.errored)!==null&&t!==void 0?t:new vn("write"))}let i=e[Ri].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=e.errored)!==null&&n!==void 0?n:new vn("end"))}Or(e)}s(Ys,"errorBuffer");function Xs(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=t,o=i.length-n;if(!o)return;let a=n;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let c=t.allNoop?Gs:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=t.allNoop&&a===0?i:Tu(i,a);l.allBuffers=t.allBuffers,Ou(e,t,!0,t.length,l,"",c),Or(t)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=r?1:c.length;Ou(e,t,!1,d,c,l,f)}while(a<i.length&&!t.writing);a===i.length?Or(t):a>256?(i.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}s(Xs,"clearBuffer");$.prototype._write=function(e,t,i){if(this._writev)this._writev([{chunk:e,encoding:t}],i);else throw new iw("_write()")};$.prototype._writev=null;$.prototype.end=function(e,t,i){let n=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null);let r;if(e!=null){let o=Du(this,e,t);o instanceof Hg&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Js(this,n,!0),n.ended=!0):n.finished?r=new rw("end"):n.destroyed&&(r=new vn("end"))),typeof i=="function"&&(r||n.finished?ei.nextTick(i,r):n[Ri].push(i)),this};function Ar(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}s(Ar,"needFinish");function fw(e,t){let i=!1;function n(r){if(i){Ti(e,r??Cu());return}if(i=!0,t.pendingcb--,r){let o=t[Ri].splice(0);for(let a=0;a<o.length;a++)o[a](r);Ti(e,r,t.sync)}else Ar(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,ei.nextTick(Ks,e,t))}s(n,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(n)}catch(r){n(r)}t.sync=!1}s(fw,"callFinal");function uw(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,fw(e,t)):(t.prefinished=!0,e.emit("prefinish")))}s(uw,"prefinish");function Js(e,t,i){Ar(t)&&(uw(e,t),t.pendingcb===0&&(i?(t.pendingcb++,ei.nextTick((n,r)=>{Ar(r)?Ks(n,r):r.pendingcb--},e,t)):Ar(t)&&(t.pendingcb++,Ks(e,t))))}s(Js,"finishMaybe");function Ks(e,t){t.pendingcb--,t.finished=!0;let i=t[Ri].splice(0);for(let n=0;n<i.length;n++)i[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}s(Ks,"finish");Kg($.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")},writable:{__proto__:null,get:s(function(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},"get"),set:s(function(e){this._writableState&&(this._writableState.writable=!!e)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var dw=Pr.destroy;$.prototype.destroy=function(e,t){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ri].length)&&ei.nextTick(Ys,i),dw.call(this,e,t),this};$.prototype._undestroy=Pr.undestroy;$.prototype._destroy=function(e,t){t(e)};$.prototype[Jg.captureRejectionSymbol]=function(e){this.destroy(e)};var Hs;function Wu(){return Hs===void 0&&(Hs={}),Hs}s(Wu,"lazyWebStreams");$.fromWeb=function(e,t){return Wu().newStreamWritableFromWritableStream(e,t)};$.toWeb=function(e){return Wu().newWritableStreamFromStreamWritable(e)}});var td=T((i0,ed)=>{var Qs=Pt(),hw=Ie(),{isReadable:pw,isWritable:yw,isIterable:ju,isNodeStream:mw,isReadableNodeStream:qu,isWritableNodeStream:$u,isDuplexNodeStream:bw,isReadableStream:zu,isWritableStream:Vu}=tt(),Hu=bt(),{AbortError:Qu,codes:{ERR_INVALID_ARG_TYPE:gw,ERR_INVALID_RETURN_VALUE:Ku}}=ae(),{destroyer:Ni}=Jt(),ww=rt(),Zu=xn(),Sw=Tr(),{createDeferredPromise:Gu}=re(),Yu=Ds(),Xu=globalThis.Blob||hw.Blob,Ew=s(typeof Xu<"u"?function(t){return t instanceof Xu}:function(t){return!1},"isBlob"),_w=globalThis.AbortController||Ei().AbortController,{FunctionPrototypeCall:Ju}=q(),Zs=class Zs extends ww{constructor(t){super(t),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)}};s(Zs,"Duplexify");var Lt=Zs;ed.exports=s(function e(t,i){if(bw(t))return t;if(qu(t))return Li({readable:t});if($u(t))return Li({writable:t});if(mw(t))return Li({writable:!1,readable:!1});if(zu(t))return Li({readable:Zu.fromWeb(t)});if(Vu(t))return Li({writable:Sw.fromWeb(t)});if(typeof t=="function"){let{value:r,write:o,final:a,destroy:c}=xw(t);if(ju(r))return Yu(Lt,r,{objectMode:!0,write:o,final:a,destroy:c});let l=r?.then;if(typeof l=="function"){let f,d=Ju(l,r,h=>{if(h!=null)throw new Ku("nully","body",h)},h=>{Ni(f,h)});return f=new Lt({objectMode:!0,readable:!1,write:o,final:s(function(h){a(async()=>{try{await d,Qs.nextTick(h,null)}catch(b){Qs.nextTick(h,b)}})},"final"),destroy:c})}throw new Ku("Iterable, AsyncIterable or AsyncFunction",i,r)}if(Ew(t))return e(t.arrayBuffer());if(ju(t))return Yu(Lt,t,{objectMode:!0,writable:!1});if(zu(t?.readable)&&Vu(t?.writable))return Lt.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let r=t!=null&&t.readable?qu(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?$u(t?.writable)?t?.writable:e(t.writable):void 0;return Li({readable:r,writable:o})}let n=t?.then;if(typeof n=="function"){let r;return Ju(n,t,o=>{o!=null&&r.push(o),r.push(null)},o=>{Ni(r,o)}),r=new Lt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new gw(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function xw(e){let{promise:t,resolve:i}=Gu(),n=new _w,r=n.signal;return{value:e(async function*(){for(;;){let a=t;t=null;let{chunk:c,done:l,cb:f}=await a;if(Qs.nextTick(f),l)return;if(r.aborted)throw new Qu(void 0,{cause:r.reason});({promise:t,resolve:i}=Gu()),yield c}}(),{signal:r}),write:s(function(a,c,l){let f=i;i=null,f({chunk:a,done:!1,cb:l})},"write"),final:s(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:s(function(a,c){n.abort(),c(a)},"destroy")}}s(xw,"fromAsyncGen");function Li(e){let t=e.readable&&typeof e.readable.read!="function"?Zu.wrap(e.readable):e.readable,i=e.writable,n=!!pw(t),r=!!yw(i),o,a,c,l,f;function d(h){let b=l;l=null,b?b(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Lt({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(Hu(i,h=>{r=!1,h&&Ni(t,h),d(h)}),f._write=function(h,b,p){i.write(h,b)?p():o=p},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),n&&(Hu(t,h=>{n=!1,h&&Ni(t,h),d(h)}),t.on("readable",function(){if(c){let h=c;c=null,h()}}),t.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=t.read();if(h===null){c=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,b){!h&&l!==null&&(h=new Qu),c=null,o=null,a=null,l===null?b(h):(l=b,Ni(i,h),Ni(t,h))},f}s(Li,"_duplexify")});var rt=T((r0,rd)=>{"use strict";var{ObjectDefineProperties:kw,ObjectGetOwnPropertyDescriptor:gt,ObjectKeys:vw,ObjectSetPrototypeOf:id}=q();rd.exports=We;var ia=xn(),Le=Tr();id(We.prototype,ia.prototype);id(We,ia);{let e=vw(Le.prototype);for(let t=0;t<e.length;t++){let i=e[t];We.prototype[i]||(We.prototype[i]=Le.prototype[i])}}function We(e){if(!(this instanceof We))return new We(e);ia.call(this,e),Le.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,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)):this.allowHalfOpen=!0}s(We,"Duplex");kw(We.prototype,{writable:{__proto__:null,...gt(Le.prototype,"writable")},writableHighWaterMark:{__proto__:null,...gt(Le.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...gt(Le.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...gt(Le.prototype,"writableBuffer")},writableLength:{__proto__:null,...gt(Le.prototype,"writableLength")},writableFinished:{__proto__:null,...gt(Le.prototype,"writableFinished")},writableCorked:{__proto__:null,...gt(Le.prototype,"writableCorked")},writableEnded:{__proto__:null,...gt(Le.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...gt(Le.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")}});var ea;function nd(){return ea===void 0&&(ea={}),ea}s(nd,"lazyWebStreams");We.fromWeb=function(e,t){return nd().newStreamDuplexFromReadableWritablePair(e,t)};We.toWeb=function(e){return nd().newReadableWritablePairFromDuplex(e)};var ta;We.from=function(e){return ta||(ta=td()),ta(e,"body")}});var oa=T((s0,sd)=>{"use strict";var{ObjectSetPrototypeOf:od,Symbol:Fw}=q();sd.exports=wt;var{ERR_METHOD_NOT_IMPLEMENTED:Iw}=ae().codes,ra=rt(),{getHighWaterMark:Aw}=Sn();od(wt.prototype,ra.prototype);od(wt,ra);var In=Fw("kCallback");function wt(e){if(!(this instanceof wt))return new wt(e);let t=e?Aw(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),ra.call(this,e),this._readableState.sync=!1,this[In]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Ow)}s(wt,"Transform");function na(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,i)=>{if(t){e?e(t):this.destroy(t);return}i!=null&&this.push(i),this.push(null),e&&e()}):(this.push(null),e&&e())}s(na,"final");function Ow(){this._final!==na&&na.call(this)}s(Ow,"prefinish");wt.prototype._final=na;wt.prototype._transform=function(e,t,i){throw new Iw("_transform()")};wt.prototype._write=function(e,t,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(e,t,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),r.ended||o===n.length||n.length<n.highWaterMark?i():this[In]=i})};wt.prototype._read=function(){if(this[In]){let e=this[In];this[In]=null,e()}}});var aa=T((c0,cd)=>{"use strict";var{ObjectSetPrototypeOf:ad}=q();cd.exports=Ci;var sa=oa();ad(Ci.prototype,sa.prototype);ad(Ci,sa);function Ci(e){if(!(this instanceof Ci))return new Ci(e);sa.call(this,e)}s(Ci,"PassThrough");Ci.prototype._transform=function(e,t,i){i(null,e)}});var Cr=T((f0,hd)=>{var An=Pt(),{ArrayIsArray:Pw,Promise:Tw,SymbolAsyncIterator:Rw,SymbolDispose:Lw}=q(),Nr=bt(),{once:Nw}=re(),Cw=Jt(),ld=rt(),{aggregateTwoErrors:Bw,codes:{ERR_INVALID_ARG_TYPE:ma,ERR_INVALID_RETURN_VALUE:ca,ERR_MISSING_ARGS:Dw,ERR_STREAM_DESTROYED:Mw,ERR_STREAM_PREMATURE_CLOSE:Ww},AbortError:Uw}=ae(),{validateFunction:jw,validateAbortSignal:qw}=ki(),{isIterable:ti,isReadable:la,isReadableNodeStream:Lr,isNodeStream:fd,isTransformStream:Bi,isWebStream:$w,isReadableStream:fa,isReadableFinished:zw}=tt(),Vw=globalThis.AbortController||Ei().AbortController,ua,da,ha;function ud(e,t,i){let n=!1;e.on("close",()=>{n=!0});let r=Nr(e,{readable:t,writable:i},o=>{n=!o});return{destroy:s(o=>{n||(n=!0,Cw.destroyer(e,o||new Mw("pipe")))},"destroy"),cleanup:r}}s(ud,"destroyer");function Hw(e){return jw(e[e.length-1],"streams[stream.length - 1]"),e.pop()}s(Hw,"popCallback");function pa(e){if(ti(e))return e;if(Lr(e))return Kw(e);throw new ma("val",["Readable","Iterable","AsyncIterable"],e)}s(pa,"makeAsyncIterable");async function*Kw(e){da||(da=xn()),yield*da.prototype[Rw].call(e)}s(Kw,"fromReadable");async function Rr(e,t,i,{end:n}){let r,o=null,a=s(f=>{if(f&&(r=f),o){let d=o;o=null,d()}},"resume"),c=s(()=>new Tw((f,d)=>{r?d(r):o=s(()=>{r?d(r):f()},"onresolve")}),"wait");t.on("drain",a);let l=Nr(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(let f of e)t.write(f)||await c();n&&(t.end(),await c()),i()}catch(f){i(r!==f?Bw(r,f):f)}finally{l(),t.off("drain",a)}}s(Rr,"pumpToNode");async function ya(e,t,i,{end:n}){Bi(t)&&(t=t.writable);let r=t.getWriter();try{for await(let o of e)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(ya,"pumpToWeb");function Gw(...e){return dd(e,Nw(Hw(e)))}s(Gw,"pipeline");function dd(e,t,i){if(e.length===1&&Pw(e[0])&&(e=e[0]),e.length<2)throw new Dw("streams");let n=new Vw,r=n.signal,o=i?.signal,a=[];qw(o,"options.signal");function c(){w(new Uw)}s(c,"abort"),ha=ha||re().addAbortListener;let l;o&&(l=ha(o,c));let f,d,h=[],b=0;function p(L){w(L,--b===0)}s(p,"finish");function w(L,F){var B;if(L&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=L),!(!f&&!F)){for(;h.length;)h.shift()(f);(B=l)===null||B===void 0||B[Lw](),n.abort(),F&&(f||a.forEach(Bt=>Bt()),An.nextTick(t,f,d))}}s(w,"finishImpl");let g;for(let L=0;L<e.length;L++){let F=e[L],B=L<e.length-1,Bt=L>0,Ee=B||i?.end!==!1,si=L===e.length-1;if(fd(F)){let le=function(at){at&&at.name!=="AbortError"&&at.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(at)};var v=le;if(s(le,"onError"),Ee){let{destroy:at,cleanup:ro}=ud(F,B,Bt);h.push(at),la(F)&&si&&a.push(ro)}F.on("error",le),la(F)&&si&&a.push(()=>{F.removeListener("error",le)})}if(L===0)if(typeof F=="function"){if(g=F({signal:r}),!ti(g))throw new ca("Iterable, AsyncIterable or Stream","source",g)}else ti(F)||Lr(F)||Bi(F)?g=F:g=ld.from(F);else if(typeof F=="function"){if(Bi(g)){var A;g=pa((A=g)===null||A===void 0?void 0:A.readable)}else g=pa(g);if(g=F(g,{signal:r}),B){if(!ti(g,!0))throw new ca("AsyncIterable",`transform[${L-1}]`,g)}else{var k;ua||(ua=aa());let le=new ua({objectMode:!0}),at=(k=g)===null||k===void 0?void 0:k.then;if(typeof at=="function")b++,at.call(g,Et=>{d=Et,Et!=null&&le.write(Et),Ee&&le.end(),An.nextTick(p)},Et=>{le.destroy(Et),An.nextTick(p,Et)});else if(ti(g,!0))b++,Rr(g,le,p,{end:Ee});else if(fa(g)||Bi(g)){let Et=g.readable||g;b++,Rr(Et,le,p,{end:Ee})}else throw new ca("AsyncIterable or Promise","destination",g);g=le;let{destroy:ro,cleanup:jh}=ud(g,!1,!0);h.push(ro),si&&a.push(jh)}}else if(fd(F)){if(Lr(g)){b+=2;let le=Yw(g,F,p,{end:Ee});la(F)&&si&&a.push(le)}else if(Bi(g)||fa(g)){let le=g.readable||g;b++,Rr(le,F,p,{end:Ee})}else if(ti(g))b++,Rr(g,F,p,{end:Ee});else throw new ma("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else if($w(F)){if(Lr(g))b++,ya(pa(g),F,p,{end:Ee});else if(fa(g)||ti(g))b++,ya(g,F,p,{end:Ee});else if(Bi(g))b++,ya(g.readable,F,p,{end:Ee});else throw new ma("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else g=ld.from(F)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&An.nextTick(c),g}s(dd,"pipelineImpl");function Yw(e,t,i,{end:n}){let r=!1;if(t.on("close",()=>{r||i(new Ww)}),e.pipe(t,{end:!1}),n){let a=function(){r=!0,t.end()};var o=a;s(a,"endFn"),zw(e)?An.nextTick(a):e.once("end",a)}else i();return Nr(e,{readable:!0,writable:!1},a=>{let c=e._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?e.once("end",i).once("error",i):i(a)}),Nr(t,{readable:!1,writable:!0},i)}s(Yw,"pipe");hd.exports={pipelineImpl:dd,pipeline:Gw}});var ga=T((d0,wd)=>{"use strict";var{pipeline:Xw}=Cr(),Br=rt(),{destroyer:Jw}=Jt(),{isNodeStream:Dr,isReadable:pd,isWritable:yd,isWebStream:ba,isTransformStream:ii,isWritableStream:md,isReadableStream:bd}=tt(),{AbortError:Qw,codes:{ERR_INVALID_ARG_VALUE:gd,ERR_MISSING_ARGS:Zw}}=ae(),eS=bt();wd.exports=s(function(...t){if(t.length===0)throw new Zw("streams");if(t.length===1)return Br.from(t[0]);let i=[...t];if(typeof t[0]=="function"&&(t[0]=Br.from(t[0])),typeof t[t.length-1]=="function"){let p=t.length-1;t[p]=Br.from(t[p])}for(let p=0;p<t.length;++p)if(!(!Dr(t[p])&&!ba(t[p]))){if(p<t.length-1&&!(pd(t[p])||bd(t[p])||ii(t[p])))throw new gd(`streams[${p}]`,i[p],"must be readable");if(p>0&&!(yd(t[p])||md(t[p])||ii(t[p])))throw new gd(`streams[${p}]`,i[p],"must be writable")}let n,r,o,a,c;function l(p){let w=a;a=null,w?w(p):p?c.destroy(p):!b&&!h&&c.destroy()}s(l,"onfinished");let f=t[0],d=Xw(t,l),h=!!(yd(f)||md(f)||ii(f)),b=!!(pd(d)||bd(d)||ii(d));if(c=new Br({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Dr(f))c._write=function(w,g,A){f.write(w,g)?A():n=A},c._final=function(w){f.end(),r=w},f.on("drain",function(){if(n){let w=n;n=null,w()}});else if(ba(f)){let g=(ii(f)?f.writable:f).getWriter();c._write=async function(A,k,v){try{await g.ready,g.write(A).catch(()=>{}),v()}catch(L){v(L)}},c._final=async function(A){try{await g.ready,g.close().catch(()=>{}),r=A}catch(k){A(k)}}}let p=ii(d)?d.readable:d;eS(p,()=>{if(r){let w=r;r=null,w()}})}if(b){if(Dr(d))d.on("readable",function(){if(o){let p=o;o=null,p()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let p=d.read();if(p===null){o=c._read;return}if(!c.push(p))return}};else if(ba(d)){let w=(ii(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:A}=await w.read();if(!c.push(g))return;if(A){c.push(null);return}}catch{return}}}}return c._destroy=function(p,w){!p&&a!==null&&(p=new Qw),o=null,n=null,r=null,a===null?w(p):(a=w,Dr(d)&&Jw(d,p))},c},"compose")});var Od=T((p0,Ea)=>{"use strict";var tS=globalThis.AbortController||Ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:iS,ERR_INVALID_ARG_TYPE:On,ERR_MISSING_ARGS:nS,ERR_OUT_OF_RANGE:rS},AbortError:ot}=ae(),{validateAbortSignal:ni,validateInteger:Sd,validateObject:ri}=ki(),oS=q().Symbol("kWeak"),sS=q().Symbol("kResistStopPropagation"),{finished:aS}=bt(),cS=ga(),{addAbortSignalNoValidate:lS}=wn(),{isWritable:fS,isNodeStream:uS}=tt(),{deprecate:dS}=re(),{ArrayPrototypePush:hS,Boolean:pS,MathFloor:Ed,Number:yS,NumberIsNaN:mS,Promise:_d,PromiseReject:xd,PromiseResolve:bS,PromisePrototypeThen:kd,Symbol:Fd}=q(),Mr=Fd("kEmpty"),vd=Fd("kEof");function gS(e,t){if(t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),uS(e)&&!fS(e))throw new iS("stream",e,"must be writable");let i=cS(this,e);return t!=null&&t.signal&&lS(t.signal,i),i}s(gS,"compose");function Wr(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal");let i=1;t?.concurrency!=null&&(i=Ed(t.concurrency));let n=i-1;return t?.highWaterMark!=null&&(n=Ed(t.highWaterMark)),Sd(i,"options.concurrency",1),Sd(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=re().AbortSignalAny([t?.signal].filter(pS)),a=this,c=[],l={signal:o},f,d,h=!1,b=0;function p(){h=!0,w()}s(p,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&b<i&&c.length<n&&(d(),d=null)}s(g,"maybeResume");async function A(){try{for await(let k of a){if(h)return;if(o.aborted)throw new ot;try{if(k=e(k,l),k===Mr)continue;k=bS(k)}catch(v){k=xd(v)}b+=1,kd(k,w,p),c.push(k),f&&(f(),f=null),!h&&(c.length>=n||b>=i)&&await new _d(v=>{d=v})}c.push(vd)}catch(k){let v=xd(k);kd(v,w,p),c.push(v)}finally{h=!0,f&&(f(),f=null)}}s(A,"pump"),A();try{for(;;){for(;c.length>0;){let k=await c[0];if(k===vd)return;if(o.aborted)throw new ot;k!==Mr&&(yield k),c.shift(),g()}await new _d(k=>{f=k})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(Wr,"map");function wS(e=void 0){return e!=null&&ri(e,"options"),e?.signal!=null&&ni(e.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new ot({cause:e.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(wS,"asIndexedPairs");async function Id(e,t=void 0){for await(let i of Sa.call(this,e,t))return!0;return!1}s(Id,"some");async function SS(e,t=void 0){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);return!await Id.call(this,async(...i)=>!await e(...i),t)}s(SS,"every");async function ES(e,t){for await(let i of Sa.call(this,e,t))return i}s(ES,"find");async function _S(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r),Mr}s(i,"forEachFn");for await(let n of Wr.call(this,i,t));}s(_S,"forEach");function Sa(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r)?n:Mr}return s(i,"filterFn"),Wr.call(this,i,t)}s(Sa,"filter");var _a=class _a extends nS{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(_a,"ReduceAwareErrMissingArgs");var wa=_a;async function xS(e,t,i){var n;if(typeof e!="function")throw new On("reducer",["Function","AsyncFunction"],e);i!=null&&ri(i,"options"),i?.signal!=null&&ni(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let f=new ot(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await aS(this.destroy(f)),f}let o=new tS,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[oS]:this,[sS]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let c=!1;try{for await(let f of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new ot;r?t=await e(t,f,{signal:a}):(t=f,r=!0)}if(!c&&!r)throw new wa}finally{o.abort()}return t}s(xS,"reduce");async function kS(e){e!=null&&ri(e,"options"),e?.signal!=null&&ni(e.signal,"options.signal");let t=[];for await(let n of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new ot(void 0,{cause:e.signal.reason});hS(t,n)}return t}s(kS,"toArray");function vS(e,t){let i=Wr.call(this,e,t);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(vS,"flatMap");function Ad(e){if(e=yS(e),mS(e))return 0;if(e<0)throw new rS("number",">= 0",e);return e}s(Ad,"toIntegerOrInfinity");function FS(e,t=void 0){return t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),e=Ad(e),s(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ot;for await(let o of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ot;e--<=0&&(yield o)}},"drop").call(this)}s(FS,"drop");function IS(e,t=void 0){return t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),e=Ad(e),s(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ot;for await(let o of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ot;if(e-- >0&&(yield o),e<=0)return}},"take").call(this)}s(IS,"take");Ea.exports.streamReturningOperators={asIndexedPairs:dS(wS,"readable.asIndexedPairs will be removed in a future version."),drop:FS,filter:Sa,flatMap:vS,map:Wr,take:IS,compose:gS};Ea.exports.promiseReturningOperators={every:SS,forEach:_S,reduce:xS,toArray:kS,some:Id,find:ES}});var xa=T((m0,Pd)=>{"use strict";var{ArrayPrototypePop:AS,Promise:OS}=q(),{isIterable:PS,isNodeStream:TS,isWebStream:RS}=tt(),{pipelineImpl:LS}=Cr(),{finished:NS}=bt();ka();function CS(...e){return new OS((t,i)=>{let n,r,o=e[e.length-1];if(o&&typeof o=="object"&&!TS(o)&&!PS(o)&&!RS(o)){let a=AS(e);n=a.signal,r=a.end}LS(e,(a,c)=>{a?i(a):t(c)},{signal:n,end:r})})}s(CS,"pipeline");Pd.exports={finished:NS,pipeline:CS}});var ka=T((g0,Wd)=>{var{Buffer:BS}=Ie(),{ObjectDefineProperty:St,ObjectKeys:Ld,ReflectApply:Nd}=q(),{promisify:{custom:Cd}}=re(),{streamReturningOperators:Td,promiseReturningOperators:Rd}=Od(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Bd}}=ae(),DS=ga(),{setDefaultHighWaterMark:MS,getDefaultHighWaterMark:WS}=Sn(),{pipeline:Dd}=Cr(),{destroyer:US}=Jt(),Md=bt(),va=xa(),Pn=tt(),C=Wd.exports=gr().Stream;C.isDestroyed=Pn.isDestroyed;C.isDisturbed=Pn.isDisturbed;C.isErrored=Pn.isErrored;C.isReadable=Pn.isReadable;C.isWritable=Pn.isWritable;C.Readable=xn();for(let e of Ld(Td)){let i=function(...n){if(new.target)throw Bd();return C.Readable.from(Nd(t,this,n))};Fa=i,s(i,"fn");let t=Td[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fa;for(let e of Ld(Rd)){let i=function(...r){if(new.target)throw Bd();return Nd(t,this,r)};Fa=i,s(i,"fn");let t=Rd[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fa;C.Writable=Tr();C.Duplex=rt();C.Transform=oa();C.PassThrough=aa();C.pipeline=Dd;var{addAbortSignal:jS}=wn();C.addAbortSignal=jS;C.finished=Md;C.destroy=US;C.compose=DS;C.setDefaultHighWaterMark=MS;C.getDefaultHighWaterMark=WS;St(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return va},"get")});St(Dd,Cd,{__proto__:null,enumerable:!0,get:s(function(){return va.pipeline},"get")});St(Md,Cd,{__proto__:null,enumerable:!0,get:s(function(){return va.finished},"get")});C.Stream=C;C._isUint8Array=s(function(t){return t instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(t){return BS.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var Ud=T((S0,H)=>{"use strict";var Q=ka(),qS=xa(),$S=Q.Readable.destroy;H.exports=Q.Readable;H.exports._uint8ArrayToBuffer=Q._uint8ArrayToBuffer;H.exports._isUint8Array=Q._isUint8Array;H.exports.isDisturbed=Q.isDisturbed;H.exports.isErrored=Q.isErrored;H.exports.isReadable=Q.isReadable;H.exports.Readable=Q.Readable;H.exports.Writable=Q.Writable;H.exports.Duplex=Q.Duplex;H.exports.Transform=Q.Transform;H.exports.PassThrough=Q.PassThrough;H.exports.addAbortSignal=Q.addAbortSignal;H.exports.finished=Q.finished;H.exports.destroy=Q.destroy;H.exports.destroy=$S;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return qS},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var oE={};Un(oE,{Async:()=>Va,AsyncTransaction:()=>$o,BigIntStats:()=>be,BigIntStatsFs:()=>on,Dir:()=>Ot,Dirent:()=>At,Errno:()=>U,ErrnoError:()=>u,Fetch:()=>eE,FetchFS:()=>Zr,File:()=>qt,FileSystem:()=>pe,InMemory:()=>dn,InMemoryStore:()=>Xn,Index:()=>Jr,IndexFS:()=>Mn,Inode:()=>Ge,MutexLock:()=>to,Mutexed:()=>ec,NoSyncFile:()=>mi,Overlay:()=>iE,OverlayFS:()=>Wn,Port:()=>JS,PortFS:()=>Xr,PortFile:()=>Bn,PreloadFile:()=>we,ReadStream:()=>Nt,Readonly:()=>Ja,SimpleAsyncStore:()=>Ko,SimpleTransaction:()=>bi,Stats:()=>G,StatsCommon:()=>nn,StatsFs:()=>rn,StoreFS:()=>ln,Sync:()=>nE,SyncTransaction:()=>un,Transaction:()=>fn,UnmutexedOverlayFS:()=>no,WriteStream:()=>Ct,ZenFsType:()=>Ro,__MutexedFS:()=>io,_toUnixTimestamp:()=>ep,access:()=>Sh,accessSync:()=>vl,appendFile:()=>Xd,appendFileSync:()=>ul,attachFS:()=>Wh,checkOptions:()=>lo,chmod:()=>yh,chmodSync:()=>_l,chown:()=>hh,chownSync:()=>Sl,close:()=>Qd,closeSync:()=>It,configure:()=>HS,configureSingle:()=>VS,constants:()=>kt,copyFile:()=>Ah,copyFileSync:()=>os,cp:()=>Rh,cpSync:()=>ss,createReadStream:()=>kh,createWriteStream:()=>vh,credentials:()=>ye,decode:()=>ai,decodeDirListing:()=>$n,default:()=>rE,detachFS:()=>YS,encode:()=>Ne,encodeDirListing:()=>xe,errorMessages:()=>ao,exists:()=>qd,existsSync:()=>Je,fchmod:()=>oh,fchmodSync:()=>nr,fchown:()=>rh,fchownSync:()=>ir,fdatasync:()=>th,fdatasyncSync:()=>yl,flagToMode:()=>sn,flagToNumber:()=>py,flagToString:()=>ol,fs:()=>Cn,fstat:()=>Jd,fstatSync:()=>dl,fsync:()=>eh,fsyncSync:()=>pl,ftruncate:()=>Zd,ftruncateSync:()=>hl,futimes:()=>sh,futimesSync:()=>rr,handleRequest:()=>Dn,isAppendable:()=>pt,isBackend:()=>Vi,isBackendConfig:()=>Hi,isExclusive:()=>cn,isReadable:()=>vt,isStatsEqual:()=>To,isSynchronous:()=>yy,isTruncating:()=>an,isWriteable:()=>ge,lchmod:()=>mh,lchmodSync:()=>xl,lchown:()=>ph,lchownSync:()=>El,levenshtein:()=>co,link:()=>fh,linkSync:()=>gl,lopenSync:()=>mn,lstat:()=>zd,lstatSync:()=>es,lutimes:()=>gh,lutimesSync:()=>kl,mkdir:()=>ch,mkdirSync:()=>or,mkdirpSync:()=>pc,mkdtemp:()=>Ih,mkdtempSync:()=>Fl,mount:()=>zt,mountObject:()=>pn,mounts:()=>Pe,normalizeMode:()=>ke,normalizeOptions:()=>ve,normalizePath:()=>x,normalizeTime:()=>Wt,open:()=>Kd,openAsBlob:()=>Nh,openSync:()=>yn,opendir:()=>Th,opendirSync:()=>Ol,parseFlag:()=>M,promises:()=>Nn,randomIno:()=>tn,read:()=>nh,readFile:()=>Gd,readFileSync:()=>tr,readSync:()=>bl,readdir:()=>lh,readdirSync:()=>Si,readlink:()=>dh,readlinkSync:()=>is,readv:()=>Oh,readvSync:()=>Il,realpath:()=>wh,realpathSync:()=>Xe,rename:()=>jd,renameSync:()=>cl,resolveMountConfig:()=>Ui,resolveRemoteMount:()=>QS,rm:()=>Fh,rmSync:()=>rs,rmdir:()=>ah,rmdirSync:()=>ts,rootCredentials:()=>tp,rootIno:()=>Ye,setImmediate:()=>Zh,size_max:()=>Oe,stat:()=>$d,statSync:()=>Te,statfs:()=>Lh,statfsSync:()=>Pl,symlink:()=>uh,symlinkSync:()=>wl,truncate:()=>Vd,truncateSync:()=>ll,umount:()=>gi,unlink:()=>Hd,unlinkSync:()=>er,unwatchFile:()=>_h,utimes:()=>bh,utimesSync:()=>ns,version:()=>Qa,watch:()=>xh,watchFile:()=>Eh,write:()=>ih,writeFile:()=>Yd,writeFileSync:()=>bn,writeSync:()=>ml,writev:()=>Ph,writevSync:()=>Al});var U=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EINTR=4]="EINTR",y[y.EIO=5]="EIO",y[y.ENXIO=6]="ENXIO",y[y.EBADF=9]="EBADF",y[y.EAGAIN=11]="EAGAIN",y[y.ENOMEM=12]="ENOMEM",y[y.EACCES=13]="EACCES",y[y.EFAULT=14]="EFAULT",y[y.ENOTBLK=15]="ENOTBLK",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.EXDEV=18]="EXDEV",y[y.ENODEV=19]="ENODEV",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.ENFILE=23]="ENFILE",y[y.EMFILE=24]="EMFILE",y[y.ETXTBSY=26]="ETXTBSY",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.ESPIPE=29]="ESPIPE",y[y.EROFS=30]="EROFS",y[y.EMLINK=31]="EMLINK",y[y.EPIPE=32]="EPIPE",y[y.EDOM=33]="EDOM",y[y.ERANGE=34]="ERANGE",y[y.EDEADLK=35]="EDEADLK",y[y.ENAMETOOLONG=36]="ENAMETOOLONG",y[y.ENOLCK=37]="ENOLCK",y[y.ENOSYS=38]="ENOSYS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ELOOP=40]="ELOOP",y[y.ENOMSG=42]="ENOMSG",y[y.EBADE=52]="EBADE",y[y.EBADR=53]="EBADR",y[y.EXFULL=54]="EXFULL",y[y.ENOANO=55]="ENOANO",y[y.EBADRQC=56]="EBADRQC",y[y.ENOSTR=60]="ENOSTR",y[y.ENODATA=61]="ENODATA",y[y.ETIME=62]="ETIME",y[y.ENOSR=63]="ENOSR",y[y.ENONET=64]="ENONET",y[y.EREMOTE=66]="EREMOTE",y[y.ENOLINK=67]="ENOLINK",y[y.ECOMM=70]="ECOMM",y[y.EPROTO=71]="EPROTO",y[y.EBADMSG=74]="EBADMSG",y[y.EOVERFLOW=75]="EOVERFLOW",y[y.EBADFD=77]="EBADFD",y[y.ESTRPIPE=86]="ESTRPIPE",y[y.ENOTSOCK=88]="ENOTSOCK",y[y.EDESTADDRREQ=89]="EDESTADDRREQ",y[y.EMSGSIZE=90]="EMSGSIZE",y[y.EPROTOTYPE=91]="EPROTOTYPE",y[y.ENOPROTOOPT=92]="ENOPROTOOPT",y[y.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",y[y.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",y[y.ENOTSUP=95]="ENOTSUP",y[y.ENETDOWN=100]="ENETDOWN",y[y.ENETUNREACH=101]="ENETUNREACH",y[y.ENETRESET=102]="ENETRESET",y[y.ETIMEDOUT=110]="ETIMEDOUT",y[y.ECONNREFUSED=111]="ECONNREFUSED",y[y.EHOSTDOWN=112]="EHOSTDOWN",y[y.EHOSTUNREACH=113]="EHOSTUNREACH",y[y.EALREADY=114]="EALREADY",y[y.EINPROGRESS=115]="EINPROGRESS",y[y.ESTALE=116]="ESTALE",y[y.EREMOTEIO=121]="EREMOTEIO",y[y.EDQUOT=122]="EDQUOT",y))(U||{}),ao={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},zi=class zi extends Error{constructor(i,n=ao[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=U[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let n=new zi(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new zi(U[i],ao[U[i]],n,r)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(zi,"ErrnoError");var u=zi;var Jh="/";function hc(e,t){let i="",n=0,r=-1,o=0,a="\0";for(let c=0;c<=e.length;++c){if(c<e.length)a=e[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===c-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",n=0):(i=i.slice(0,l),n=i.length-1-i.lastIndexOf("/")),r=c,o=0;continue}else if(i.length!==0){i="",n=0,r=c,o=0;continue}}t&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+e.slice(r+1,c):i=e.slice(r+1,c),n=c-r-1;r=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(hc,"normalizeString");function _t(...e){let t="";for(let n of[...e.reverse(),Jh])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;let i=t.startsWith("/");return t=hc(t,!i),i?`/${t}`:t.length?t:"/"}s(_t,"resolve");function Qh(e){if(!e.length)return".";let t=e.startsWith("/"),i=e.endsWith("/");return e=hc(e,!t),e.length?(i&&(e+="/"),t?`/${e}`:e):t?"/":i?"./":"."}s(Qh,"normalize");function z(...e){if(!e.length)return".";let t=e.join("/");return t?.length?Qh(t):"."}s(z,"join");function _(e){if(e.length===0)return".";let t=e[0]==="/",i=-1,n=!0;for(let r=e.length-1;r>=1;--r)if(e[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?t?"/":".":t&&i===1?"//":e.slice(0,i)}s(_,"dirname");function D(e,t){let i=0,n=-1,r=!0;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(let c=e.length-1;c>=0;--c)if(e[c]==="/"){if(!r){i=c+1;break}}else a===-1&&(r=!1,a=c+1),o>=0&&(e[c]===t[o]?--o===-1&&(n=c):(o=-1,n=a));return i===n?n=a:n===-1&&(n=e.length),e.slice(i,n)}for(let o=e.length-1;o>=0;--o)if(e[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":e.slice(i,n)}s(D,"basename");function jn(e){let t=e.startsWith("/"),i={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(e.length===0)return i;let n=t?1:0,r=-1,o=0,a=-1,c=!0,l=e.length-1,f=0;for(;l>=n;--l){if(e[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),e[l]==="."?r===-1?r=l:f!==1&&(f=1):r!==-1&&(f=-1)}if(a!==-1){let d=o===0&&t?1:o;r===-1||f===0||f===1&&r===a-1&&r===o+1?i.base=i.name=e.slice(d,a):(i.name=e.slice(d,r),i.base=e.slice(d,a),i.ext=e.slice(r,a))}return o>0?i.dir=e.slice(0,o-1):t&&(i.dir="/"),i}s(jn,"parse");function pc(e,t,i){i.existsSync(e)||(pc(_(e),t,i),i.mkdirSync(e,t))}s(pc,"mkdirpSync");function qn(e,t,i,n,r){return Math.min(e+1,t+1,i+1,n===r?t:t+1)}s(qn,"_min");function co(e,t){if(e===t)return 0;e.length>t.length&&([e,t]=[t,e]);let i=e.length,n=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&e.charCodeAt(r)===t.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=e.charCodeAt(r+b),o[b]=++b;let a,c,l,f,d;for(a=0;a+3<n;){let b=t.charCodeAt(r+(c=a)),p=t.charCodeAt(r+(l=a+1)),w=t.charCodeAt(r+(f=a+2)),g=t.charCodeAt(r+(d=a+3)),A=a+=4;for(let k=0;k<i;){let v=o[i+k],L=o[k];c=qn(L,c,l,b,v),l=qn(c,l,f,p,v),f=qn(l,f,d,w,v),A=qn(f,d,A,g,v),o[k++]=A,d=f,f=l,l=c,c=L}}let h=0;for(;a<n;){let b=t.charCodeAt(r+(c=a));h=++a;for(let p=0;p<i;p++){let w=o[p];o[p]=h=w<c||h<c?w>h?h+1:w+1:b===o[i+p]?c:c+1,c=w}}return h}s(co,"levenshtein");var Zh=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:e=>setTimeout(e,0);function Ne(e){if(typeof e!="string")throw new u(22,"Can not encode a non-string");return new Uint8Array(Array.from(e).map(t=>t.charCodeAt(0)))}s(Ne,"encode");function ai(e){if(!(e instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return Array.from(e).map(t=>String.fromCharCode(t)).join("")}s(ai,"decode");function $n(e){return JSON.parse(ai(e),(t,i)=>t==""?i:BigInt(i))}s($n,"decodeDirListing");function xe(e){return Ne(JSON.stringify(e,(t,i)=>t==""?i:i.toString()))}s(xe,"encodeDirListing");function ep(e){if(typeof e=="number")return Math.floor(e);if(e instanceof Date)return Math.floor(e.getTime()/1e3);throw new Error("Cannot parse time")}s(ep,"_toUnixTimestamp");function ke(e,t){if(typeof e=="number")return e;if(typeof e=="string"){let i=parseInt(e,8);if(!isNaN(i))return i}if(typeof t=="number")return t;throw new u(22,"Invalid mode: "+e?.toString())}s(ke,"normalizeMode");function Wt(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e*1e3);if(typeof e=="string")return new Date(e);throw new u(22,"Invalid time.")}s(Wt,"normalizeTime");function x(e){if(e=e.toString(),e.includes("\0"))throw new u(22,"Path can not contain null character");if(e.length==0)throw new u(22,"Path can not be empty");return _t(e.replaceAll(/[/\\]+/g,"/"))}s(x,"normalizePath");function ve(e,t="utf8",i,n=0){return typeof e!="object"||e===null?{encoding:typeof e=="string"?e:t??null,flag:i,mode:n}:{encoding:typeof e?.encoding=="string"?e.encoding:t??null,flag:typeof e?.flag=="string"?e.flag:i,mode:ke("mode"in e?e?.mode:null,n)}}s(ve,"normalizeOptions");function Vi(e){return e!=null&&typeof e=="object"&&"isAvailable"in e&&typeof e.isAvailable=="function"&&"create"in e&&typeof e.create=="function"}s(Vi,"isBackend");async function lo(e,t){if(typeof t!="object"||t===null)throw new u(22,"Invalid options");for(let[i,n]of Object.entries(e.options)){let r=t?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(t).filter(c=>!(c in e.options)).map(c=>({str:c,distance:co(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new u(22,`${e.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new u(22,`${e.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(lo,"checkOptions");function Hi(e){return e!=null&&typeof e=="object"&&"backend"in e&&Vi(e.backend)}s(Hi,"isBackendConfig");var ye={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0},tp={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Cn={};Un(Cn,{BigIntStatsFs:()=>on,Dir:()=>Ot,Dirent:()=>At,ReadStream:()=>Nt,Stats:()=>G,StatsFs:()=>rn,WriteStream:()=>Ct,access:()=>Sh,accessSync:()=>vl,appendFile:()=>Xd,appendFileSync:()=>ul,chmod:()=>yh,chmodSync:()=>_l,chown:()=>hh,chownSync:()=>Sl,close:()=>Qd,closeSync:()=>It,constants:()=>kt,copyFile:()=>Ah,copyFileSync:()=>os,cp:()=>Rh,cpSync:()=>ss,createReadStream:()=>kh,createWriteStream:()=>vh,exists:()=>qd,existsSync:()=>Je,fchmod:()=>oh,fchmodSync:()=>nr,fchown:()=>rh,fchownSync:()=>ir,fdatasync:()=>th,fdatasyncSync:()=>yl,fstat:()=>Jd,fstatSync:()=>dl,fsync:()=>eh,fsyncSync:()=>pl,ftruncate:()=>Zd,ftruncateSync:()=>hl,futimes:()=>sh,futimesSync:()=>rr,lchmod:()=>mh,lchmodSync:()=>xl,lchown:()=>ph,lchownSync:()=>El,link:()=>fh,linkSync:()=>gl,lopenSync:()=>mn,lstat:()=>zd,lstatSync:()=>es,lutimes:()=>gh,lutimesSync:()=>kl,mkdir:()=>ch,mkdirSync:()=>or,mkdtemp:()=>Ih,mkdtempSync:()=>Fl,mount:()=>zt,mountObject:()=>pn,mounts:()=>Pe,open:()=>Kd,openAsBlob:()=>Nh,openSync:()=>yn,opendir:()=>Th,opendirSync:()=>Ol,promises:()=>Nn,read:()=>nh,readFile:()=>Gd,readFileSync:()=>tr,readSync:()=>bl,readdir:()=>lh,readdirSync:()=>Si,readlink:()=>dh,readlinkSync:()=>is,readv:()=>Oh,readvSync:()=>Il,realpath:()=>wh,realpathSync:()=>Xe,rename:()=>jd,renameSync:()=>cl,rm:()=>Fh,rmSync:()=>rs,rmdir:()=>ah,rmdirSync:()=>ts,stat:()=>$d,statSync:()=>Te,statfs:()=>Lh,statfsSync:()=>Pl,symlink:()=>uh,symlinkSync:()=>wl,truncate:()=>Vd,truncateSync:()=>ll,umount:()=>gi,unlink:()=>Hd,unlinkSync:()=>er,unwatchFile:()=>_h,utimes:()=>bh,utimesSync:()=>ns,watch:()=>xh,watchFile:()=>Eh,write:()=>ih,writeFile:()=>Yd,writeFileSync:()=>bn,writeSync:()=>ml,writev:()=>Ph,writevSync:()=>Al});var za=$i(Ie(),1);var kt={};Un(kt,{COPYFILE_EXCL:()=>Yi,COPYFILE_FICLONE:()=>Cp,COPYFILE_FICLONE_FORCE:()=>Bp,F_OK:()=>Gi,O_APPEND:()=>Ke,O_CREAT:()=>ee,O_DIRECT:()=>$p,O_DIRECTORY:()=>Mp,O_DSYNC:()=>jp,O_EXCL:()=>Ve,O_NOATIME:()=>Wp,O_NOCTTY:()=>Dp,O_NOFOLLOW:()=>Up,O_NONBLOCK:()=>zp,O_RDONLY:()=>di,O_RDWR:()=>ue,O_SYMLINK:()=>qp,O_SYNC:()=>hi,O_TRUNC:()=>He,O_WRONLY:()=>ze,R_OK:()=>Ae,S_IFBLK:()=>ft,S_IFCHR:()=>ut,S_IFDIR:()=>he,S_IFIFO:()=>dt,S_IFLNK:()=>Ce,S_IFMT:()=>K,S_IFREG:()=>de,S_IFSOCK:()=>lt,S_IRGRP:()=>Jp,S_IROTH:()=>ey,S_IRUSR:()=>Gp,S_IRWXG:()=>_o,S_IRWXO:()=>xo,S_IRWXU:()=>Eo,S_ISGID:()=>Hp,S_ISUID:()=>Vp,S_ISVTX:()=>Kp,S_IWGRP:()=>Qp,S_IWOTH:()=>ty,S_IWUSR:()=>Yp,S_IXGRP:()=>Zp,S_IXOTH:()=>iy,S_IXUSR:()=>Xp,UV_FS_O_FILEMAP:()=>ny,W_OK:()=>X,X_OK:()=>Np});var Gi=0,Ae=4,X=2,Np=1,Yi=1,Cp=2,Bp=4,di=0,ze=1,ue=2,ee=64,Ve=128,Dp=256,He=512,Ke=1024,Mp=65536,Wp=262144,Up=131072,hi=1052672,jp=4096,qp=32768,$p=16384,zp=2048,K=61440,lt=49152,Ce=40960,de=32768,ft=24576,he=16384,ut=8192,dt=4096,Vp=2048,Hp=1024,Kp=512,Eo=448,Gp=256,Yp=128,Xp=64,_o=56,Jp=32,Qp=16,Zp=8,xo=7,ey=4,ty=2,iy=1,ny=0;var Ji=$i(Bc(),1);var Mc,vo=class vo extends Ji.default{constructor(i){super();oo(this,Mc,"List");oo(this,"data",new Set);i&&this.push(...i)}toSet(){return new Set(this.data)}toArray(){return Array.from(this.data)}toJSON(){return JSON.stringify(Array.from(this.data))}toString(){return this.join(",")}set(i,n){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not set an element outside the bounds of the list");let r=Array.from(this.data);r.splice(i,1,n),this.data=new Set(r),this.emit("update")}deleteAt(i){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not delete an element outside the bounds of the list");this.delete(Array.from(this.data).at(i))}at(i){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not access an element outside the bounds of the list");return Array.from(this.data).at(i)}pop(){let i=Array.from(this.data).pop();return i!==void 0&&this.delete(i),i}push(...i){for(let n of i)this.add(n);return this.data.size}join(i){return Array.from(this.data).join(i)}splice(i,n,...r){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not splice elements outside the bounds of the list");let o=Array.from(this.data),a=o.splice(i,n,...r);return this.data=new Set(o),this.emit("update"),a}add(i){return this.data.add(i),this.emit("update"),this}clear(){this.data.clear(),this.emit("update")}delete(i){let n=this.data.delete(i);return this.emit("update"),n}has(i){return this.data.has(i)}get size(){return this.data.size}entries(){return this.data.entries()}keys(){return this.data.keys()}values(){return this.data.values()}[(Mc=Symbol.toStringTag,Symbol.iterator)](){return this.data[Symbol.iterator]()}};s(vo,"List");var Dc=vo;function Wc(e){try{return JSON.parse(e),!0}catch{return!1}}s(Wc,"isJSON");function Qi(e){return e.at(0).toUpperCase()+e.slice(1)}s(Qi,"capitalize");var Uc=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],jc=[...Uc,...Uc.map(e=>Qi(e)),"char"],Gn=/^(u?int|float)(8|16|32|64)$/i;function Fo(e){return e=="char"?"uint8":e.toLowerCase()}s(Fo,"normalize");function Io(e){return Gn.test(e.toString())}s(Io,"isType");function Yn(e){return e=="char"||Gn.test(e.toString().toLowerCase())}s(Yn,"isValid");function qc(e){if(!Yn(e))throw new TypeError("Not a valid primitive type: "+e)}s(qc,"checkValid");var Zi=Symbol("struct_init"),yi=Symbol("struct");function ay(e){return e!=null&&typeof e=="object"&&yi in e}s(ay,"isValidMetadata");Symbol.metadata??=Symbol.for("Symbol.metadata");function cy(e){Symbol?.metadata&&(Symbol.metadata in e||Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)}))}s(cy,"_polyfill_contextMetadata");function pi(e){let t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(i=>i.description=="Symbol.metadata");if(cy(e),!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}s(pi,"symbol_metadata");function en(e){return typeof e=="function"&&pi(e)in e&&ay(e[pi(e)])}s(en,"isStatic");function $c(e){return e!=null&&typeof e=="object"&&en(e.constructor)}s($c,"isInstance");function Ao(e){if(!$c(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct instance")}s(Ao,"checkInstance");function ly(e){return $c(e)||en(e)}s(ly,"isStruct");function zc(e){if(!ly(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct")}s(zc,"checkStruct");function ht(e){if(typeof e=="string")return qc(e),+Fo(e).match(Gn)[2]/8;zc(e);let t=en(e)?e:e.constructor;return t[pi(t)][yi].size}s(ht,"sizeof");function uy(e,t){return Math.ceil(e/t)*t}s(uy,"align");function Hc(e={}){return s(function(i,n){n.metadata??={},n.metadata[Zi]||=[];let r=0,o=new Map;for(let a of n.metadata[Zi]){let{name:c,type:l,length:f}=a;if(!Yn(l)&&!en(l))throw new TypeError("Not a valid type: "+l);o.set(c,{offset:r,type:Yn(l)?Fo(l):l,length:f}),r+=ht(l)*(f||1),r=uy(r,e.align||1)}return n.metadata[yi]={options:e,members:o,size:r},i},"_decorateStruct")}s(Hc,"struct");function Vc(e,t){return function(i,n){let r=n.name;if(typeof r=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+r.toString()),r=r.toString()),!r)throw new ReferenceError("Invalid name for struct member");return n.metadata??={},n.metadata[Zi]||=[],n.metadata[Zi].push({name:r,type:e,length:t}),i}}s(Vc,"member");function Oo(e){Ao(e);let{options:t,members:i}=e.constructor[pi(e.constructor)][yi],n=new Uint8Array(ht(e)),r=new DataView(n.buffer);for(let[o,{type:a,length:c,offset:l}]of i)for(let f=0;f<(c||1);f++){let d=l+ht(a)*f,h=c>0?e[o][f]:e[o];if(typeof h=="string"&&(h=h.charCodeAt(0)),!Io(a)){n.set(h?Oo(h):new Uint8Array(ht(a)),d);continue}let p="set"+Qi(a);if(p=="setInt64"){r.setBigInt64(d,BigInt(h),!t.bigEndian);continue}if(p=="setUint64"){r.setBigUint64(d,BigInt(h),!t.bigEndian);continue}r[p](d,Number(h),!t.bigEndian)}return n}s(Oo,"serialize");function Po(e,t){Ao(e);let{options:i,members:n}=e.constructor[pi(e.constructor)][yi],r=t instanceof Uint8Array?t:new Uint8Array("buffer"in t?t.buffer:t),o=new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));for(let[a,{type:c,offset:l,length:f}]of n)for(let d=0;d<(f||1);d++){let h=f>0?e[a]:e,b=f>0?d:a,p=l+ht(c)*d;if(typeof e[a]=="string"){e[a]=e[a].slice(0,d)+String.fromCharCode(o.getUint8(p))+e[a].slice(d+1);continue}if(!Io(c)){if(h[b]===null||h[b]===void 0)continue;Po(h[b],new Uint8Array(r.slice(p,p+ht(c))));continue}f>0&&(h||=[]);let g="get"+Qi(c);if(g=="getInt64"){h[b]=o.getBigInt64(p,!i.bigEndian);continue}if(g=="getUint64"){h[b]=o.getBigUint64(p,!i.bigEndian);continue}h[b]=o[g](p,!i.bigEndian)}}s(Po,"deserialize");function dy(e){function t(i,n){return typeof i=="number"?Vc(e,i):Vc(e)(i,n)}return s(t,"_structMemberDecorator"),t}s(dy,"_member");var Be=Object.fromEntries(jc.map(e=>[e,dy(e)]));var Oe=2**32-1,Ye=0n;function Kc(){return Math.round(Math.random()*2**32).toString(16)}s(Kc,"_random");function tn(){return BigInt("0x"+Kc()+Kc())}s(tn,"randomIno");var Gc,Yc,Xc,Jc,Qc,Zc,el,tl,il,nl,rl,me;me=[,,,],rl=[Hc()],nl=[Be.uint64],il=[Be.uint32],tl=[Be.uint16],el=[Be.uint32],Zc=[Be.uint32],Qc=[Be.uint32],Jc=[Be.float64],Xc=[Be.float64],Yc=[Be.float64],Gc=[Be.float64];var te=class te{get data(){return Oo(this)}constructor(t){if(t){if(t.byteLength<ht(te))throw new RangeError(`Can not create an inode from a buffer less than ${ht(te)} bytes`);Po(this,t);return}this.ino=tn(),this.nlink=1,this.size=4096;let i=Date.now();this.atimeMs=i,this.mtimeMs=i,this.ctimeMs=i,this.birthtimeMs=i}toStats(){return new G(this)}update(t){let i=!1;return this.size!==t.size&&(this.size=t.size,i=!0),this.mode!==t.mode&&(this.mode=t.mode,i=!0),this.nlink!==t.nlink&&(this.nlink=t.nlink,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.atimeMs!==t.atimeMs&&(this.atimeMs=t.atimeMs,i=!0),this.mtimeMs!==t.mtimeMs&&(this.mtimeMs=t.mtimeMs,i=!0),this.ctimeMs!==t.ctimeMs&&(this.ctimeMs=t.ctimeMs,i=!0),i}};_e(me,5,"ino",nl,te),_e(me,5,"size",il,te),_e(me,5,"mode",tl,te),_e(me,5,"nlink",el,te),_e(me,5,"uid",Zc,te),_e(me,5,"gid",Qc,te),_e(me,5,"atimeMs",Jc,te),_e(me,5,"birthtimeMs",Xc,te),_e(me,5,"mtimeMs",Yc,te),_e(me,5,"ctimeMs",Gc,te),te=_e(me,0,"Inode",rl,te),s(te,"Inode"),dc(me,1,te);var Ge=te;var Lo=class Lo{constructor({atimeMs:t,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:c,mode:l,ino:f}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(t??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(n??d),this.birthtimeMs=this._convert(r??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(t){if(ye.euid===0||ye.egid===0)return!0;let i=(ye.uid==this.uid?448:0)|(ye.gid==this.gid?56:0)|7;return(t&this.mode&i)==t}cred(t=Number(this.uid),i=Number(this.gid)){return{uid:t,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:t,egid:i}}chmod(t){this.mode=this._convert(this.mode&61440|t)}chown(t,i){t=Number(t),i=Number(i),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}};s(Lo,"StatsCommon");var nn=Lo,No=class No extends nn{constructor(){super(...arguments);this._isBigint=!1}};s(No,"Stats");var G=No,Co=class Co extends nn{constructor(){super(...arguments);this._isBigint=!0}};s(Co,"BigIntStats");var be=Co;function To(e,t){return e.size==t.size&&+e.atime==+t.atime&&+e.mtime==+t.mtime&&+e.ctime==+t.ctime&&e.mode==t.mode}s(To,"isStatsEqual");var Ro=525687744115,Bo=class Bo{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Oe;this.ffree=Oe}};s(Bo,"StatsFs");var rn=Bo,Do=class Do{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Oe);this.ffree=BigInt(Oe)}};s(Do,"BigIntStatsFs");var on=Do;var Nn={};Un(Nn,{FileHandle:()=>ce,access:()=>Wa,appendFile:()=>Ta,chmod:()=>Ba,chown:()=>Na,constants:()=>kt,copyFile:()=>Hr,cp:()=>Kr,exists:()=>je,lchmod:()=>Da,lchown:()=>Ca,link:()=>Ra,lstat:()=>jr,lutimes:()=>Ma,mkdir:()=>Ln,mkdtemp:()=>Ua,open:()=>Se,opendir:()=>ja,readFile:()=>Rn,readdir:()=>Ht,readlink:()=>$r,realpath:()=>Ue,rename:()=>Oa,rm:()=>Vr,rmdir:()=>qr,stat:()=>st,statfs:()=>qa,symlink:()=>La,truncate:()=>Pa,unlink:()=>Tn,utimes:()=>zr,watch:()=>zS,writeFile:()=>Mi});var oi=$i(Ie(),1);Promise.withResolvers??=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var hy=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function M(e){if(typeof e=="number")return ol(e);if(!hy.includes(e))throw new Error("Invalid flag string: "+e);return e}s(M,"parseFlag");function ol(e){switch(e){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: "+e)}}s(ol,"flagToString");function py(e){switch(e){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: "+e)}}s(py,"flagToNumber");function sn(e){let t=0;return t<<=1,t+=+vt(e),t<<=1,t+=+ge(e),t<<=1,t}s(sn,"flagToMode");function vt(e){return e.indexOf("r")!==-1||e.indexOf("+")!==-1}s(vt,"isReadable");function ge(e){return e.indexOf("w")!==-1||e.indexOf("a")!==-1||e.indexOf("+")!==-1}s(ge,"isWriteable");function an(e){return e.indexOf("w")!==-1}s(an,"isTruncating");function pt(e){return e.indexOf("a")!==-1}s(pt,"isAppendable");function yy(e){return e.indexOf("s")!==-1}s(yy,"isSynchronous");function cn(e){return e.indexOf("x")!==-1}s(cn,"isExclusive");var Mo=class Mo{constructor(t,i){this.fs=t;this.path=i}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(Mo,"File");var qt=Mo,Wo=class Wo extends qt{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:Oe}))){super(i,n);this.fs=i;this.flag=r;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;this.closed=!1;if(this.stats.size!=a.byteLength){if(vt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return pt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw u.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw u.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(i){if(this.closed)throw u.With("EBADF",this.path,"File.dispose");if(this.dirty&&!i)throw u.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return Promise.resolve(new G(this.stats))}statSync(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return new G(this.stats)}_truncate(i){if(this.closed)throw u.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i)}async truncate(i){this._truncate(i),await this.sync()}truncateSync(i){this._truncate(i),this.syncSync()}_write(i,n=0,r=this.stats.size,o=this.position){if(this.closed)throw u.With("EBADF",this.path,"File.write");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+r;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 l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:Oe}));l.set(this._buffer),this._buffer=l}let c=i.slice(n,n+r);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,n,r,o){let a=this._write(i,n,r,o);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,o=this.position){let a=this._write(i,n,r,o);return this.syncSync(),a}_read(i,n=0,r=this.stats.size,o){if(this.closed)throw u.With("EBADF",this.path,"File.read");if(!vt(this.flag))throw new u(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,n,r).set(this._buffer.slice(o,a)),c}async read(i,n,r,o){let a=this._read(i,n,r,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,n,r,o){let a=this._read(i,n,r,o);return this.statSync(),a}async chmod(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),await this.sync()}chownSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,await this.sync()}utimesSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}async _setType(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,await this.sync()}_setTypeSync(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}};s(Wo,"PreloadFile");var we=Wo,Uo=class Uo extends we{constructor(t,i,n,r,o){super(t,i,n,r,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};s(Uo,"NoSyncFile");var mi=Uo;var Ft=$i(Ie(),1);var jo=class jo{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Ro}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(i){return i.code!="ENOENT"}}existsSync(t){try{return this.statSync(t),!0}catch(i){return i.code!="ENOENT"}}};s(jo,"FileSystem");var pe=jo;var sl=5,qo=class qo extends pe{constructor(i){super();this.store=i;this._initialized=!1}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,n){var w=[];try{let r=S(w,this.store.transaction(),!0);let o=_(i),a=D(i),c=_(n),l=D(n),f=await this.findINode(r,o),d=await this.getDirListing(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")===0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=await this.findINode(r,c),p=await this.getDirListing(r,b,c));if(p[l]){let L=await this.getINode(r,p[l],n);if(!L.toStats().isFile())throw u.With("EPERM",n,"rename");await r.remove(L.ino),await r.remove(p[l])}p[l]=h;await r.set(f.ino,xe(d));await r.set(b.ino,xe(p));await r.commit()}catch(g){var A=g,k=!0}finally{var v=E(w,A,k);v&&await v}}renameSync(i,n){var w=[];try{let r=S(w,this.store.transaction());let o=_(i),a=D(i),c=_(n),l=D(n),f=this.findINodeSync(r,o),d=this.getDirListingSync(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")==0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=this.findINodeSync(r,c),p=this.getDirListingSync(r,b,c));if(p[l]){let v=this.getINodeSync(r,p[l],n);if(!v.toStats().isFile())throw u.With("EPERM",n,"rename");r.removeSync(v.ino),r.removeSync(p[l])}p[l]=h;r.setSync(f.ino,xe(d));r.setSync(b.ino,xe(p));r.commitSync()}catch(g){var A=g,k=!0}finally{E(w,A,k)}}async stat(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);if(!r)throw u.With("ENOENT",i,"stat");return r.toStats()}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}statSync(i){var r=[];try{let n=S(r,this.store.transaction());return this.findINodeSync(n,i).toStats()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async createFile(i,n,r){let o=await this.commitNew(i,32768,r,new Uint8Array(0));return new we(this,i,n,o.toStats(),new Uint8Array(0))}createFileSync(i,n,r){return this.commitNewSync(i,32768,r),this.openFileSync(i,n)}async openFile(i,n){var c=[];try{let r=S(c,this.store.transaction(),!0);let o=await this.findINode(r,i),a=await r.get(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}openFileSync(i,n){var c=[];try{let r=S(c,this.store.transaction());let o=this.findINodeSync(r,i),a=r.getSync(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}async unlink(i){return this.remove(i,!1)}unlinkSync(i){this.removeSync(i,!1)}async rmdir(i){if((await this.readdir(i)).length)throw u.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0)}rmdirSync(i){if(this.readdirSync(i).length)throw u.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0)}async mkdir(i,n){await this.commitNew(i,16384,n,Ne("{}"))}mkdirSync(i,n){this.commitNewSync(i,16384,n,Ne("{}"))}async readdir(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);return Object.keys(await this.getDirListing(n,r,i))}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}readdirSync(i){var o=[];try{let n=S(o,this.store.transaction());let r=this.findINodeSync(n,i);return Object.keys(this.getDirListingSync(n,r,i))}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async sync(i,n,r){var f=[];try{let o=S(f,this.store.transaction(),!0);let a=await this._findINode(o,_(i),D(i)),c=await this.getINode(o,a,i),l=c.update(r);await o.set(c.ino,n);l&&await o.set(a,c.data);await o.commit()}catch(d){var h=d,b=!0}finally{var p=E(f,h,b);p&&await p}}syncSync(i,n,r){var f=[];try{let o=S(f,this.store.transaction());let a=this._findINodeSync(o,_(i),D(i)),c=this.getINodeSync(o,a,i),l=c.update(r);o.setSync(c.ino,n);l&&o.setSync(a,c.data);o.commitSync()}catch(d){var h=d,b=!0}finally{E(f,h,b)}}async link(i,n){var d=[];try{let r=S(d,this.store.transaction(),!0);let o=_(n),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o);let l=await this._findINode(r,_(i),D(i));let f=await this.getINode(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{var w=E(d,b,p);w&&await w}}linkSync(i,n){var d=[];try{let r=S(d,this.store.transaction());let o=_(n),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o);let l=this._findINodeSync(r,_(i),D(i));let f=this.getINodeSync(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{E(d,b,p)}}async checkRoot(){var r=[];try{let i=S(r,this.store.transaction(),!0);if(await i.get(Ye))return;let n=new Ge;n.mode=16895;await i.set(n.ino,Ne("{}"));await i.set(Ye,n.data);await i.commit()}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}checkRootSync(){var r=[];try{let i=S(r,this.store.transaction());if(i.getSync(Ye))return;let n=new Ge;n.mode=16895;i.setSync(n.ino,Ne("{}"));i.setSync(Ye,n.data);i.commitSync()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async _findINode(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?await this.getINode(i,Ye,n):await this.findINode(i,n,o),l=await this.getDirListing(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}_findINodeSync(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?this.getINodeSync(i,Ye,n):this.findINodeSync(i,n,o),l=this.getDirListingSync(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}async findINode(i,n,r=new Set){let o=await this._findINode(i,_(n),D(n),r);return this.getINode(i,o,n)}findINodeSync(i,n,r=new Set){let o=this._findINodeSync(i,_(n),D(n),r);return this.getINodeSync(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}getINodeSync(i,n,r){let o=i.getSync(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return $n(o)}getDirListingSync(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=i.getSync(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return $n(o)}async addNew(i,n,r){for(let o=0;o<sl;o++){let a=tn();if(!await i.get(a))return await i.set(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}addNewSync(i,n,r){for(let o=0;o<sl;o++){let a=tn();if(!i.getSync(a))return i.setSync(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}async commitNew(i,n,r,o){var b=[];try{let a=S(b,this.store.transaction(),!0);let c=_(i),l=await this.findINode(a,c);let f=D(i),d=await this.getDirListing(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw await a.abort(),u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=await this.addNew(a,o,i);h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;h.size=o.length;d[f]=await this.addNew(a,h.data,i);await a.set(l.ino,xe(d));await a.commit();return h}catch(p){var w=p,g=!0}finally{var A=E(b,w,g);A&&await A}}commitNewSync(i,n,r,o=new Uint8Array){var b=[];try{let a=S(b,this.store.transaction());let c=_(i),l=this.findINodeSync(a,c);let f=D(i),d=this.getDirListingSync(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=this.addNewSync(a,o,i);h.size=o.length;h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;d[f]=this.addNewSync(a,h.data,i);a.setSync(l.ino,xe(d));a.commitSync();return h}catch(p){var w=p,g=!0}finally{E(b,w,g)}}async remove(i,n){var h=[];try{let r=S(h,this.store.transaction(),!0);let o=_(i),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o),l=D(i);if(!c[l])throw u.With("ENOENT",i,"remove");let f=c[l];let d=await this.getINode(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");await r.set(a.ino,xe(c));--d.nlink<1&&(await r.remove(d.ino),await r.remove(f));await r.commit()}catch(b){var p=b,w=!0}finally{var g=E(h,p,w);g&&await g}}removeSync(i,n){var h=[];try{let r=S(h,this.store.transaction());let o=_(i),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o),l=D(i),f=c[l];if(!f)throw u.With("ENOENT",i,"remove");let d=this.getINodeSync(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");r.setSync(a.ino,xe(c));--d.nlink<1&&(r.removeSync(d.ino),r.removeSync(f));r.commitSync()}catch(b){var p=b,w=!0}finally{E(h,p,w)}}};s(qo,"StoreFS");var ln=qo;var zo=class zo{constructor(t){this.store=t;this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}};s(zo,"Transaction");var fn=zo,Vo=class Vo extends fn{async get(t){return this.getSync(t)}async set(t,i){return this.setSync(t,i)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}};s(Vo,"SyncTransaction");var un=Vo,Ho=class Ho extends fn{getSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};s(Ho,"AsyncTransaction");var $o=Ho;var Go=class Go{constructor(){this.cache=new Map;this.queue=new Set}get(t){return this.cache.get(t)}set(t,i){this.cache.set(t,i),this.queue.add(this._set(t,i))}delete(t){this.cache.delete(t),this.queue.add(this._delete(t))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[t,i]of await this.entries())this.cache.has(t)||this.cache.set(t,i);for(let t of this.queue)await t}transaction(){return new bi(this)}};s(Go,"SimpleAsyncStore");var Ko=Go,Yo=class Yo extends un{constructor(){super(...arguments);this.originalData=new Map;this.modifiedKeys=new Set}getSync(i){let n=this.store.get(i);return this.stashOldValue(i,n),n}setSync(i,n){return this.markModified(i),this.store.set(i,n)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){this.done=!0}abortSync(){if(this.done){for(let i of this.modifiedKeys){let n=this.originalData.get(i);n?this.store.set(i,n):this.store.delete(i)}this.done=!0}}stashOldValue(i,n){this.originalData.has(i)||this.originalData.set(i,n)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};s(Yo,"SimpleTransaction");var bi=Yo;var Xo=class Xo extends Map{constructor(i="tmp"){super();this.name=i}async sync(){}clearSync(){this.clear()}transaction(){return new bi(this)}};s(Xo,"InMemoryStore");var Xn=Xo,my={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:e}){let t=new ln(new Xn(e));return t.checkRootSync(),t},"create")},dn=my;var $t=new Map,by=100;function hn(e){let t=by++;return $t.set(t,e),t}s(hn,"file2fd");function j(e){if(!$t.has(e))throw new u(9);return $t.get(e)}s(j,"fd2file");var Pe=new Map;zt("/",dn.create({name:"root"}));function zt(e,t){if(e[0]!=="/"&&(e="/"+e),e=_t(e),Pe.has(e))throw new u(22,"Mount point "+e+" is already in use.");Pe.set(e,t)}s(zt,"mount");function gi(e){if(e[0]!=="/"&&(e=`/${e}`),e=_t(e),!Pe.has(e))throw new u(22,"Mount point "+e+" is already unmounted.");Pe.delete(e)}s(gi,"umount");function R(e){e=x(e);let t=[...Pe].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of t)if(i.length<=e.length&&e.startsWith(i))return e=e.slice(i.length>1?i.length:0),e===""&&(e="/"),{fs:n,path:e,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(R,"resolveMount");function al(e,t){for(let[i,n]of Object.entries(t))e=e?.replaceAll(i,n);return e}s(al,"fixPaths");function Y(e,t){return typeof e.stack=="string"&&(e.stack=al(e.stack,t)),e.message=al(e.message,t),e}s(Y,"fixError");function pn(e){"/"in e&&gi("/");for(let[t,i]of Object.entries(e))zt(t,i)}s(pn,"mountObject");function Jn(e,t){let i=e.metadata(),n=i.blockSize||4096;return{type:(t?BigInt:Number)(i.type),bsize:(t?BigInt:Number)(n),ffree:(t?BigInt:Number)(i.freeNodes||Oe),files:(t?BigInt:Number)(i.totalNodes||Oe),bavail:(t?BigInt:Number)(i.freeSpace/n),bfree:(t?BigInt:Number)(i.freeSpace/n),blocks:(t?BigInt:Number)(i.totalSpace/n)}}s(Jn,"_statfs");var Jo=class Jo extends Ji.default{constructor(i){super();this.path=i}off(i,n,r,o){return super.off(i,n,r,o)}removeListener(i,n,r,o){return super.removeListener(i,n,r,o)}setMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw u.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw u.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw u.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}};s(Jo,"Watcher");var Qn=Jo,Qo=class Qo extends Qn{constructor(i,n){super(i);this.options=n;gy(i.toString(),this)}close(){super.emit("close"),wy(this.path.toString(),this)}[Symbol.dispose](){this.close()}};s(Qo,"FSWatcher");var wi=Qo,Zo=class Zo extends Qn{constructor(i,n){super(i);this.options=n;this.start()}onInterval(){try{let i=Te(this.path);To(this.previous,i)||(this.emit("change",i,this.previous),this.previous=i)}catch(i){this.emit("error",i)}}start(){let i=this.options.interval||5e3;try{this.previous=Te(this.path)}catch(n){this.emit("error",n);return}this.intervalId=setInterval(this.onInterval.bind(this),i),!this.options.persistent&&typeof this.intervalId=="object"&&this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}};s(Zo,"StatWatcher");var Zn=Zo,De=new Map;function gy(e,t){let i=x(e);De.has(i)||De.set(i,new Set),De.get(i).add(t)}s(gy,"addWatcher");function wy(e,t){let i=x(e);De.has(i)&&(De.get(i).delete(t),De.get(i).size===0&&De.delete(i))}s(wy,"removeWatcher");function W(e,t){let i=x(t);if(De.has(i))for(let r of De.get(i))r.emit("change",e,D(t));let n=_(i);for(;n!==i&&n!=="/";){if(De.has(n))for(let r of De.get(n))r.emit("change",e,D(t));i=n,n=_(n)}}s(W,"emitChange");function cl(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!Te(_(e)).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i===n){i.fs.renameSync(i.path,n.path),W("rename",e.toString());return}bn(t,tr(e)),er(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(cl,"renameSync");function Je(e){e=x(e);try{let{fs:t,path:i}=R(Xe(e));return t.existsSync(i)}catch(t){if(t.errno==2)return!1;throw t}}s(Je,"existsSync");function Te(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e);try{let r=i.statSync(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(Te,"statSync");function es(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=i.statSync(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(es,"lstatSync");function ll(e,t=0){var n=[];try{let i=S(n,Vt(e,"r+"));t||=0;if(t<0)throw new u(22);i.truncateSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}s(ll,"truncateSync");function er(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"unlink");t.unlinkSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(er,"unlinkSync");function Vt(e,t,i,n=!0){e=x(e);let r=ke(i,420),o=M(t);e=n&&Je(e)?Xe(e):e;let{fs:a,path:c}=R(e);if(!a.existsSync(c)){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=a.statSync(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return a.createFileSync(c,o,r)}let l=a.statSync(c);if(!l.hasAccess(r)||!l.hasAccess(sn(o)))throw u.With("EACCES",e,"_open");if(cn(o))throw u.With("EEXIST",e,"_open");let f=a.openFileSync(c,o);return an(o)&&(f.truncateSync(0),f.syncSync()),f}s(Vt,"_openSync");function yn(e,t,i=0){return hn(Vt(e,t,i,!0))}s(yn,"openSync");function mn(e,t,i){return hn(Vt(e,t,i,!1))}s(mn,"lopenSync");function fl(e,t,i){var a=[];try{let n=S(a,Vt(e,t,420,i));let r=n.statSync();let o=new Uint8Array(r.size);n.readSync(o,0,r.size,0);return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}s(fl,"_readFileSync");function tr(e,t={}){let i=ve(t,null,"r",420),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed to readFile must allow for reading.");let r=Ft.Buffer.from(fl(typeof e=="number"?j(e).path:e.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(tr,"readFileSync");function bn(e,t,i={}){var c=[];try{let n=ve(i,"utf8","w+",420);let r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new u(22,"Data not specified");let a=S(c,Vt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength,0);W("change",e.toString())}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(bn,"writeFileSync");function ul(e,t,i={}){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,Vt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(ul,"appendFileSync");function dl(e,t){let i=j(e).statSync();return t?.bigint?new be(i):i}s(dl,"fstatSync");function It(e){j(e).closeSync(),$t.delete(e)}s(It,"closeSync");function hl(e,t=0){if(t||=0,t<0)throw new u(22);j(e).truncateSync(t)}s(hl,"ftruncateSync");function pl(e){j(e).syncSync()}s(pl,"fsyncSync");function yl(e){j(e).datasyncSync()}s(yl,"fdatasyncSync");function ml(e,t,i,n,r){let o,a,c,l;if(typeof t=="string"){l=typeof i=="number"?i:null;let h=typeof n=="string"?n:"utf8";a=0,o=Ft.Buffer.from(t,h),c=o.byteLength}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,l=typeof r=="number"?r:null;let f=j(e);l??=f.position;let d=f.writeSync(o,a,c,l);return W("change",f.path),d}s(ml,"writeSync");function bl(e,t,i,n,r){let o=j(e),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=o.position),o.readSync(t,a,n,r)}s(bl,"readSync");function ir(e,t,i){j(e).chownSync(t,i)}s(ir,"fchownSync");function nr(e,t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");j(e).chmodSync(i)}s(nr,"fchmodSync");function rr(e,t,i){j(e).utimesSync(Wt(t),Wt(i))}s(rr,"futimesSync");function ts(e){e=x(e);let{fs:t,path:i}=R(Je(e)?Xe(e):e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"rmdir");t.rmdirSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(ts,"rmdirSync");function or(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=Je(e)?Xe(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!n.statSync(_(r)).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");return n.mkdirSync(r,i)}let a=[];for(let c=r,l=e;!n.existsSync(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!n.statSync(_(c)).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");n.mkdirSync(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(or,"mkdirSync");function Si(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e),r;if(!Te(e).hasAccess(4))throw u.With("EACCES",e,"readdir");try{r=i.readdirSync(n)}catch(o){throw Y(o,{[n]:e})}for(let o of Pe.keys()){if(!o.startsWith(e))continue;let a=o.slice(e.length);a.includes("/")||a.length==0||r.push(a)}return r.map(o=>typeof t=="object"&&t?.withFileTypes?new At(o,Te(z(e.toString(),o))):t=="buffer"||typeof t=="object"&&t?.encoding=="buffer"?Ft.Buffer.from(o):o)}s(Si,"readdirSync");function gl(e,t){if(e=x(e),!Te(_(e)).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!Te(_(t)).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!i.statSync(n).hasAccess(2))throw u.With("EACCES",n,"link");return i.linkSync(n,t)}catch(o){throw Y(o,{[n]:e,[r.path]:t})}}s(gl,"linkSync");function wl(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(Je(t))throw u.With("EEXIST",t.toString(),"symlink");bn(t,e.toString()),Vt(t,"r+",420,!1)._setTypeSync(40960)}s(wl,"symlinkSync");function is(e,t){let i=Ft.Buffer.from(fl(e.toString(),"r",!1)),n=typeof t=="object"?t?.encoding:t;return n=="buffer"?i:i.toString(n)}s(is,"readlinkSync");function Sl(e,t,i){let n=yn(e,"r+");ir(n,t,i),It(n)}s(Sl,"chownSync");function El(e,t,i){let n=mn(e,"r+");ir(n,t,i),It(n)}s(El,"lchownSync");function _l(e,t){let i=yn(e,"r+");nr(i,t),It(i)}s(_l,"chmodSync");function xl(e,t){let i=mn(e,"r+");nr(i,t),It(i)}s(xl,"lchmodSync");function ns(e,t,i){let n=yn(e,"r+");rr(n,t,i),It(n)}s(ns,"utimesSync");function kl(e,t,i){let n=mn(e,"r+");rr(n,t,i),It(n)}s(kl,"lutimesSync");function Xe(e,t){e=x(e);let{base:i,dir:n}=jn(e),r=z(n=="/"?"/":Xe(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return o.statSync(a).isSymbolicLink()?Xe(c+is(r,t).toString()):r}catch(l){throw Y(l,{[a]:r})}}s(Xe,"realpathSync");function vl(e,t=384){if(!Te(e).hasAccess(t))throw new u(13)}s(vl,"accessSync");function rs(e,t){switch(e=x(e),Te(e).mode&61440){case 16384:if(t?.recursive)for(let n of Si(e))rs(z(e,n),t);ts(e);return;case 32768:case 40960:er(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(rs,"rmSync");function Fl(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return or(r),i=="buffer"?Ft.Buffer.from(r):r}s(Fl,"mkdtempSync");function os(e,t,i){if(e=x(e),t=x(t),i&&i&1&&Je(t))throw new u(17,"Destination file already exists.",t,"copyFile");bn(t,tr(e)),W("rename",t.toString())}s(os,"copyFileSync");function Il(e,t,i){let n=j(e),r=0;for(let o of t)r+=n.readSync(o,0,o.byteLength,i+r);return r}s(Il,"readvSync");function Al(e,t,i){let n=j(e),r=0;for(let o of t)r+=n.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+r);return r}s(Al,"writevSync");function Ol(e,t){return e=x(e),new Ot(e)}s(Ol,"opendirSync");function ss(e,t,i){e=x(e),t=x(t);let n=es(e);if(i?.errorOnExist&&Je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");or(t,{recursive:!0});for(let r of Si(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||ss(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:os(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&ns(t,n.atime,n.mtime)}s(ss,"cpSync");function Pl(e,t){e=x(e);let{fs:i}=R(e);return Jn(i,t?.bigint)}s(Pl,"statfsSync");var as=class as{constructor(t,i){this.path=t;this.stats=i}get name(){return D(this.path)}get parentPath(){return this.path}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(as,"Dirent");var At=as,cs=class cs{constructor(t){this.path=t;this.closed=!1}checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??=await Ht(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then(i=>t(void 0,i))}readSync(){return this.checkClosed(),this._entries??=Si(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}async next(){let t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}};s(cs,"Dir");var Ot=cs;var Ur=$i(Ud(),1);var Ia=class Ia extends Ur.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};s(Ia,"ReadStream");var Nt=Ia,Aa=class Aa extends Ur.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};s(Aa,"WriteStream");var Ct=Aa;var $a=class $a{constructor(t){let i=typeof t!="number";this.fd=i?hn(t):t,this.file=i?t:j(t)}async chown(t,i){await this.file.chown(t,i),W("change",this.file.path)}async chmod(t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");await this.file.chmod(i),W("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||=0,t<0)throw new u(22);await this.file.truncate(t),W("change",this.file.path)}async utimes(t,i){await this.file.utimes(Wt(t),Wt(i)),W("change",this.file.path)}async appendFile(t,i={}){let n=ve(i,"utf8","a",420),r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length),W("change",this.file.path)}read(t,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(t,i,n,r)}async readFile(t){let i=ve(t,null,"r",292),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(r),0,r,0),a=oi.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(t={}){let i=s(async r=>{try{let c=0,l=0,f=NaN;for(;f>0;){let d=await this.read(new Uint8Array(65536),0,65536,l);if(!d.bytesRead){r.close();return}if(r.enqueue(d.buffer.slice(0,d.bytesRead)),l+=d.bytesRead,++c>=1e7)throw new u(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=d.bytesRead}}catch(o){r.error(o)}},"start"),n=globalThis;if(!("ReadableStream"in n))throw new u(38,"ReadableStream is missing on globalThis");return new n.ReadableStream({start:i,type:t.type})}readLines(t){throw u.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){let i=await this.file.stat();if(!i.hasAccess(4))throw u.With("EACCES",this.file.path,"stat");return t?.bigint?new be(i):i}async write(t,i,n,r){let o,a,c;if(typeof t=="string"){r=typeof i=="number"?i:null;let f=typeof n=="string"?n:"utf8";a=0,o=oi.Buffer.from(t,f),c=o.length}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,r=typeof r=="number"?r:null;r??=this.file.position;let l=await this.file.write(o,a,c,r);return W("change",this.file.path),{buffer:o,bytesWritten:l}}async writeFile(t,i={}){let n=ve(i,"utf8","w",420),r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length,0),W("change",this.file.path)}async close(){await this.file.close(),$t.delete(this.fd)}async writev(t,i){let n=0;for(let r of t)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,i){let n=0;for(let r of t)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){let i=new Nt({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:s(async n=>{try{let r=await this.read(new Uint8Array(n),0,n,this.file.position);i.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),this.file.position+=r.bytesRead}catch(r){i.destroy(r)}},"read")});return i.path=this.file.path,i}createWriteStream(t){let i={highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:s(async(r,o,a)=>{try{let{bytesWritten:c}=await this.write(r,null,o);a(c==r.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},n=new Ct(i);return n.path=this.file.path,n}};s($a,"FileHandle");var ce=$a;async function Oa(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!(await st(_(e))).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path),W("rename",e.toString());return}await Mi(t,await Rn(e)),await Tn(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(Oa,"rename");async function je(e){try{let{fs:t,path:i}=R(await Ue(e));return await t.exists(i)}catch(t){if(t instanceof u&&t.code=="ENOENT")return!1;throw t}}s(je,"exists");async function st(e,t){e=x(e);let{fs:i,path:n}=R(await je(e)?await Ue(e):e);try{let r=await i.stat(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(st,"stat");async function jr(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=await i.stat(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(jr,"lstat");async function Pa(e,t=0){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.truncate(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Pa,"truncate");async function Tn(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"unlink");await t.unlink(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(Tn,"unlink");async function Di(e,t,i=420,n){e=x(e);let r=ke(i,420),o=M(t);e=n&&await je(e)?await Ue(e):e;let{fs:a,path:c}=R(e),l=await a.stat(c).catch(()=>null);if(!l){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=await a.stat(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return new ce(await a.createFile(c,o,r))}if(!l.hasAccess(sn(o)))throw u.With("EACCES",e,"_open");if(cn(o))throw u.With("EEXIST",e,"_open");let f=new ce(await a.openFile(c,o));return an(o)&&(await f.truncate(0),await f.sync()),f}s(Di,"_open");async function Se(e,t="r",i=420){return await Di(e,t,i,!0)}s(Se,"open");async function Rn(e,t){var r=[];try{let i=ve(t,null,"r",420);let n=S(r,typeof e=="object"&&"fd"in e?e:await Se(e,i.flag,i.mode),!0);return await n.readFile(i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Rn,"readFile");async function Mi(e,t,i){var a=[];try{let n=ve(i,"utf8","w+",420);let r=S(a,e instanceof ce?e:await Se(e.toString(),n.flag,n.mode),!0);let o=t;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,n)}catch(c){var l=c,f=!0}finally{var d=E(a,l,f);d&&await d}}s(Mi,"writeFile");async function Ta(e,t,i){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,typeof e=="object"&&"fd"in e?e:await Se(e,n.flag,n.mode),!0);await a.appendFile(o,n)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}s(Ta,"appendFile");async function qr(e){e=x(e),e=await je(e)?await Ue(e):e;let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"rmdir");await t.rmdir(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(qr,"rmdir");async function Ln(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=await je(e)?await Ue(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!(await n.stat(_(r))).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");await n.mkdir(r,i),W("rename",e.toString());return}let a=[];for(let c=r,l=e;!await n.exists(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!(await n.stat(_(c))).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");await n.mkdir(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(Ln,"mkdir");async function Ht(e,t){if(e=x(e),!(await st(e)).hasAccess(4))throw u.With("EACCES",e,"readdir");e=await je(e)?await Ue(e):e;let{fs:i,path:n}=R(e),r;try{r=await i.readdir(n)}catch(a){throw Y(a,{[n]:e})}for(let a of Pe.keys())if(a.startsWith(e)){let c=a.slice(e.length);if(c.includes("/")||c.length==0)continue;r.push(c)}let o=[];for(let a of r)o.push(typeof t=="object"&&t?.withFileTypes?new At(a,await st(z(e,a))):a);return o}s(Ht,"readdir");async function Ra(e,t){if(e=x(e),!(await st(_(e))).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!(await st(_(t))).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!(await i.stat(n)).hasAccess(2))throw u.With("EACCES",n,"link");return await i.link(n,r.path)}catch(o){throw Y(o,{[r.path]:t,[n]:e})}}s(Ra,"link");async function La(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await je(t))throw u.With("EEXIST",t.toString(),"symlink");await Mi(t,e.toString()),await(await Di(t,"r+",420,!1)).file._setType(40960)}s(La,"symlink");async function $r(e,t){var o=[];try{let i=S(o,await Di(x(e),"r",420,!1),!0);let n=await i.readFile();let r=typeof t=="object"?t?.encoding:t;return r=="buffer"?n:n.toString(r)}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}s($r,"readlink");async function Na(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Na,"chown");async function Ca(e,t,i){var r=[];try{let n=S(r,await Di(e,"r+",420,!1),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Ca,"lchown");async function Ba(e,t){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Ba,"chmod");async function Da(e,t){var n=[];try{let i=S(n,await Di(e,"r+",420,!1),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Da,"lchmod");async function zr(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.utimes(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(zr,"utimes");async function Ma(e,t,i){var r=[];try{let n=S(r,await Di(e,"r+",420,!1),!0);await n.utimes(new Date(t),new Date(i))}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Ma,"lutimes");async function Ue(e,t){e=x(e);let{base:i,dir:n}=jn(e),r=z(n=="/"?"/":await Ue(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return(await o.stat(a)).isSymbolicLink()?Ue(c+await $r(r)):r}catch(l){throw Y(l,{[a]:r})}}s(Ue,"realpath");function zS(e,t={}){return{[Symbol.asyncIterator](){let i=new wi(e.toString(),typeof t!="string"?t:{encoding:t});function n(r){return function(){let o=Promise.withResolvers();return i.on("change",(a,c)=>{o.resolve({value:{eventType:a,filename:c},done:r})}),o.promise}}return s(n,"withDone"),{next:n(!1),return:n(!0),throw:n(!0)}}}}s(zS,"watch");async function Wa(e,t=0){if(!(await st(e)).hasAccess(t))throw new u(13)}s(Wa,"access");async function Vr(e,t){switch(e=x(e),(await st(e)).mode&61440){case 16384:if(t?.recursive)for(let n of await Ht(e))await Vr(z(e,n),t);await qr(e);return;case 32768:case 40960:await Tn(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(Vr,"rm");async function Ua(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await Ln(r),i=="buffer"?oi.Buffer.from(r):r}s(Ua,"mkdtemp");async function Hr(e,t,i){if(e=x(e),t=x(t),i&&i&1&&await je(t))throw new u(17,"Destination file already exists.",t,"copyFile");await Mi(t,await Rn(e)),W("rename",t.toString())}s(Hr,"copyFile");async function ja(e,t){return e=x(e),new Ot(e)}s(ja,"opendir");async function Kr(e,t,i){e=x(e),t=x(t);let n=await jr(e);if(i?.errorOnExist&&await je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");await Ln(t,{recursive:!0});for(let r of await Ht(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||await Kr(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:await Hr(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&await zr(t,n.atime,n.mtime)}s(Kr,"cp");async function qa(e,t){e=x(e);let{fs:i}=R(e);return Jn(i,t?.bigint)}s(qa,"statfs");var I=s(()=>{},"nop");function jd(e,t,i=I){Oa(e,t).then(()=>i()).catch(i)}s(jd,"rename");function qd(e,t=I){je(e).then(t).catch(()=>t(!1))}s(qd,"exists");function $d(e,t,i=I){i=typeof t=="function"?t:i,st(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s($d,"stat");function zd(e,t,i=I){i=typeof t=="function"?t:i,jr(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(zd,"lstat");function Vd(e,t=0,i=I){i=typeof t=="function"?t:i,Pa(e,typeof t=="number"?t:0).then(()=>i()).catch(i)}s(Vd,"truncate");function Hd(e,t=I){Tn(e).then(()=>t()).catch(t)}s(Hd,"unlink");function Kd(e,t,i,n=I){let r=ke(i,420);n=typeof i=="function"?i:n,Se(e,t,r).then(o=>n(void 0,o.fd)).catch(n)}s(Kd,"open");function Gd(e,t,i=I){i=typeof t=="function"?t:i,Rn(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(Gd,"readFile");function Yd(e,t,i,n=I){n=typeof i=="function"?i:n,Mi(e,t,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(Yd,"writeFile");function Xd(e,t,i,n=I){let r=typeof i!="function"?i:void 0;n=typeof i=="function"?i:n,Ta(e,t,r).then(()=>n()).catch(n)}s(Xd,"appendFile");function Jd(e,t,i=I){i=typeof t=="function"?t:i,j(e).stat().then(n=>i(void 0,typeof t=="object"&&t?.bigint?new be(n):n)).catch(i)}s(Jd,"fstat");function Qd(e,t=I){new ce(e).close().then(()=>t()).catch(t)}s(Qd,"close");function Zd(e,t,i=I){let n=typeof t=="number"?t:0;i=typeof t=="function"?t:i;let r=j(e);if(n<0)throw new u(22);r.truncate(n).then(()=>i()).catch(i)}s(Zd,"ftruncate");function eh(e,t=I){j(e).sync().then(()=>t()).catch(t)}s(eh,"fsync");function th(e,t=I){j(e).datasync().then(()=>t()).catch(t)}s(th,"fdatasync");function ih(e,t,i,n,r,o=I){let a,c,l,f,d,h=new ce(e);if(typeof t=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new u(22,"Invalid arguments."));return}a=za.Buffer.from(t),c=0,l=a.length;let b=o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a.toString(d))).catch(b)}else{a=za.Buffer.from(t.buffer),c=i,l=n,f=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a)).catch(b)}}s(ih,"write");function nh(e,t,i,n,r,o=I){new ce(e).read(t,i,n,r).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(nh,"read");function rh(e,t,i,n=I){new ce(e).chown(t,i).then(()=>n()).catch(n)}s(rh,"fchown");function oh(e,t,i){new ce(e).chmod(t).then(()=>i()).catch(i)}s(oh,"fchmod");function sh(e,t,i,n=I){new ce(e).utimes(t,i).then(()=>n()).catch(n)}s(sh,"futimes");function ah(e,t=I){qr(e).then(()=>t()).catch(t)}s(ah,"rmdir");function ch(e,t,i=I){Ln(e,t).then(()=>i()).catch(i)}s(ch,"mkdir");function lh(e,t,i=I){i=typeof t=="function"?t:i,Ht(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(lh,"readdir");function fh(e,t,i=I){Ra(e,t).then(()=>i()).catch(i)}s(fh,"link");function uh(e,t,i,n=I){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,La(e,t,r).then(()=>n()).catch(n)}s(uh,"symlink");function dh(e,t,i=I){i=typeof t=="function"?t:i,$r(e).then(n=>i(void 0,n)).catch(i)}s(dh,"readlink");function hh(e,t,i,n=I){Na(e,t,i).then(()=>n()).catch(n)}s(hh,"chown");function ph(e,t,i,n=I){Ca(e,t,i).then(()=>n()).catch(n)}s(ph,"lchown");function yh(e,t,i=I){Ba(e,t).then(()=>i()).catch(i)}s(yh,"chmod");function mh(e,t,i=I){Da(e,t).then(()=>i()).catch(i)}s(mh,"lchmod");function bh(e,t,i,n=I){zr(e,t,i).then(()=>n()).catch(n)}s(bh,"utimes");function gh(e,t,i,n=I){Ma(e,t,i).then(()=>n()).catch(n)}s(gh,"lutimes");function wh(e,t,i=I){i=typeof t=="function"?t:i,Ue(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(wh,"realpath");function Sh(e,t,i=I){let n=typeof t=="number"?t:4;i=typeof t=="function"?t:i,Wa(e,n).then(()=>i()).catch(i)}s(Sh,"access");var Wi=new Map;function Eh(e,t,i){let n=x(e.toString()),r=typeof t!="function"?t:{};if(typeof t=="function"&&(i=t),!i)throw new u(22,"No listener specified",e.toString(),"watchFile");if(Wi.has(n)){let a=Wi.get(n);a&&a.listeners.add(i);return}let o=new Zn(n,r);o.on("change",(a,c)=>{let l=Wi.get(n);if(l)for(let f of l.listeners)f(a,c)}),Wi.set(n,{watcher:o,listeners:new Set})}s(Eh,"watchFile");function _h(e,t=I){let i=x(e.toString()),n=Wi.get(i);n&&(t&&t!==I?n.listeners.delete(t):n.listeners.clear(),n.listeners.size===0&&(n.watcher.stop(),Wi.delete(i)))}s(_h,"unwatchFile");function xh(e,t,i){let n=new wi(x(e),typeof t=="object"?t:{});return i=typeof t=="function"?t:i,n.on("change",i||I),n}s(xh,"watch");function kh(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Nt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{n||=await Se(e,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},"read"),destroy:s(function(o,a){n?.close().then(()=>a(o)).catch(I)},"destroy")});return r.path=e.toString(),r}s(kh,"createReadStream");function vh(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Ct({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{n||=await Se(e,"w",i?.mode||438),await n.write(o,0,a),c(void 0)}catch(l){await n?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){n?.close().then(()=>o()).catch(o)},"final")});return r.path=e.toString(),r}s(vh,"createWriteStream");function Fh(e,t,i=I){i=typeof t=="function"?t:i,Vr(e,typeof t=="function"?void 0:t).then(()=>i(void 0)).catch(i)}s(Fh,"rm");function Ih(e,t,i=I){i=typeof t=="function"?t:i,Ua(e,typeof t!="function"?t:null).then(n=>i(void 0,n)).catch(i)}s(Ih,"mkdtemp");function Ah(e,t,i,n=I){n=typeof i=="function"?i:n,Hr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Ah,"copyFile");function Oh(e,t,i,n=I){n=typeof i=="function"?i:n,new ce(e).readv(t,typeof i=="function"?void 0:i).then(({buffers:r,bytesRead:o})=>n(void 0,o,r)).catch(n)}s(Oh,"readv");function Ph(e,t,i,n=I){n=typeof i=="function"?i:n,new ce(e).writev(t,typeof i=="function"?void 0:i).then(({buffers:r,bytesWritten:o})=>n(void 0,o,r)).catch(n)}s(Ph,"writev");function Th(e,t,i=I){i=typeof t=="function"?t:i,ja(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Th,"opendir");function Rh(e,t,i,n=I){n=typeof i=="function"?i:n,Kr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Rh,"cp");function Lh(e,t,i=I){i=typeof t=="function"?t:i,qa(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Lh,"statfs");async function Nh(e,t){let i=await Se(e.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],t)}s(Nh,"openAsBlob");function Ch(e){return Hi(e)||Vi(e)||e instanceof pe}s(Ch,"isMountConfig");async function Ui(e,t=0){if(typeof e!="object"||e==null)throw new u(22,"Invalid options on mount configuration");if(!Ch(e))throw new u(22,"Invalid mount configuration");if(e instanceof pe)return e;Vi(e)&&(e={backend:e});for(let[r,o]of Object.entries(e))if(r!="backend"&&Ch(o)){if(t>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");e[r]=await Ui(o,++t)}let{backend:i}=e;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await lo(i,e);let n=await i.create(e);return n._disableSync=e.disableAsyncCache||!1,await n.ready(),n}s(Ui,"resolveMountConfig");async function VS(e){if(!Hi(e))throw new TypeError("Invalid single mount point configuration");let t=await Ui(e);gi("/"),zt("/",t)}s(VS,"configureSingle");async function HS(e){let t="uid"in e&&e.uid||0,i="gid"in e&&e.gid||0;if(Object.assign(ye,{uid:t,gid:i,suid:t,sgid:i,euid:t,egid:i}),!!e.mounts){for(let[n,r]of Object.entries(e.mounts)){if(!n.startsWith("/"))throw new u(22,"Mount points must have absolute paths");Hi(r)&&(r.disableAsyncCache??=e.disableAsyncCache||!1),e.mounts[n]=await Ui(r)}pn(e.mounts)}}s(HS,"configure");function Va(e){let i=class i extends e{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(o=>{let a=s(()=>this._queueRunning?setTimeout(a):o(),"check");a()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(o){throw this._isInitialized=!1,o}}}checkSync(o,a){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",o,a);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",o,a)}renameSync(o,a){this.checkSync(o,"rename"),this._sync.renameSync(o,a),this.queue("rename",o,a)}statSync(o){return this.checkSync(o,"stat"),this._sync.statSync(o)}createFileSync(o,a,c){return this.checkSync(o,"createFile"),this._sync.createFileSync(o,a,c),this.queue("createFile",o,a,c),this.openFileSync(o,a)}openFileSync(o,a){this.checkSync(o,"openFile");let c=this._sync.openFileSync(o,a),l=c.statSync(),f=new Uint8Array(l.size);return c.readSync(f),new we(this,o,a,l,f)}unlinkSync(o){this.checkSync(o,"unlinkSync"),this._sync.unlinkSync(o),this.queue("unlink",o)}rmdirSync(o){this.checkSync(o,"rmdir"),this._sync.rmdirSync(o),this.queue("rmdir",o)}mkdirSync(o,a){this.checkSync(o,"mkdir"),this._sync.mkdirSync(o,a),this.queue("mkdir",o,a)}readdirSync(o){return this.checkSync(o,"readdir"),this._sync.readdirSync(o)}linkSync(o,a){this.checkSync(o,"link"),this._sync.linkSync(o,a),this.queue("link",o,a)}syncSync(o,a,c){this.checkSync(o,"sync"),this._sync.syncSync(o,a,c),this.queue("sync",o,a,c)}existsSync(o){return this.checkSync(o,"exists"),this._sync.existsSync(o)}async crossCopy(o){this.checkSync(o,"crossCopy");let a=await this.stat(o);if(!a.isDirectory()){var l=[];try{let p=S(l,await this.openFile(o,M("r")),!0);let w=S(l,this._sync.createFileSync(o,M("w"),a.mode));let g=new Uint8Array(a.size);await p.read(g);w.writeSync(g,0,a.size);return}catch(f){var d=f,h=!0}finally{var b=E(l,d,h);b&&await b}}if(o!=="/"){let p=await this.stat(o);this._sync.mkdirSync(o,p.mode)}let c=await this.readdir(o);for(let p of c)await this.crossCopy(z(o,p))}async _next(){if(!this._queueRunning)return;let[o,...a]=this._queue.shift();await this[o](...a),await this._next()}queue(...o){this._queue.push(o),this._next()}};s(i,"AsyncFS");let t=i;return t}s(Va,"Async");function KS(e){return typeof e=="object"&&e!=null&&"fd"in e&&"path"in e&&"position"in e}s(KS,"isFileData");function Ha(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}s(Ha,"isMessage");var ji=new Map;function Ka(e,{port:t,timeout:i=1e3,fs:n}={}){let r=`
3
- `+new Error().stack.slice(6);if(!t)throw u.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);ji.set(c,{resolve:o,reject:a,fs:n}),t.postMessage({...e,_zenfs:!0,id:c,stack:r});let l=setTimeout(()=>{let f=new u(5,"RPC Failed");f.stack+=r,a(f),typeof l=="object"&&l.unref()},i)})}s(Ka,"request");function Bh(e){if(!Ha(e))return;let{id:t,value:i,error:n,stack:r}=e;if(!ji.has(t)){let l=new u(5,"Invalid RPC id:"+t);throw l.stack+=r,l}let{resolve:o,reject:a,fs:c}=ji.get(t);if(n){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=r,a(l),ji.delete(t);return}if(KS(i)){let{fd:l,path:f,position:d}=i,h=new Bn(c,l,f,d);o(h),ji.delete(t);return}o(i),ji.delete(t)}s(Bh,"handleResponse");function Gr(e,t){if(!e)throw u.With("EINVAL");e["on"in e?"on":"addEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Gr,"attach");function Ga(e,t){if(!e)throw u.With("EINVAL");e["off"in e?"off":"removeEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Ga,"detach");function Dh(e){let t=[],i=t.push.bind(t);return Gr(e,i),function(n){Ga(e,i);for(let r of t){let o="data"in r?r.data:r;Dn(e,n,o)}}}s(Dh,"catchMessages");var Ya=class Ya extends qt{constructor(i,n,r,o){super(i,r);this.fs=i;this.fd=n;this.position=o}rpc(i,...n){return Ka({scope:"file",fd:this.fd,method:i,args:n},this.fs.options)}_throwNoSync(i){throw new u(95,"Synchronous operations not supported on PortFile",this.path,i)}async stat(){return new G(await this.rpc("stat"))}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,n,r,o){return this.rpc("write",i,n,r,o)}writeSync(){this._throwNoSync("write")}async read(i,n,r,o){return await this.rpc("read",i,n,r,o)}readSync(){this._throwNoSync("read")}chown(i,n){return this.rpc("chown",i,n)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,n){return this.rpc("utimes",i,n)}utimesSync(){this._throwNoSync("utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){this._throwNoSync("_setType")}close(){return this.rpc("close")}closeSync(){this._throwNoSync("close")}sync(){return this.rpc("sync")}syncSync(){this._throwNoSync("sync")}};s(Ya,"PortFile");var Bn=Ya,Xa=class Xa extends Va(pe){constructor(i){super();this.options=i;this._sync=dn.create({name:"port-tmpfs"});this.port=i.port,Gr(this.port,Bh)}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return Ka({scope:"fs",method:i,args:n},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,n){return this.rpc("rename",i,n)}async stat(i){return new G(await this.rpc("stat",i))}sync(i,n,r){return this.rpc("sync",i,n,r)}openFile(i,n){return this.rpc("openFile",i,n)}createFile(i,n,r){return this.rpc("createFile",i,n,r)}unlink(i){return this.rpc("unlink",i)}rmdir(i){return this.rpc("rmdir",i)}mkdir(i,n){return this.rpc("mkdir",i,n)}readdir(i){return this.rpc("readdir",i)}exists(i){return this.rpc("exists",i)}link(i,n){return this.rpc("link",i,n)}};s(Xa,"PortFS");var Xr=Xa,Mh=0,Yr=new Map;async function Dn(e,t,i){if(!Ha(i))return;let{method:n,args:r,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await t[n](...r),l instanceof qt&&(Yr.set(++Mh,l),l={fd:Mh,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Yr.has(d))throw new u(9);l=await Yr.get(d)[n](...r),n=="close"&&Yr.delete(d);break;default:return}}catch(d){l=d instanceof u?d.toJSON():d.toString(),f=!0}e.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:n,stack:c,value:l})}s(Dn,"handleRequest");function Wh(e,t){Gr(e,i=>Dn(e,t,i))}s(Wh,"attachFS");function YS(e,t){Ga(e,i=>Dn(e,t,i))}s(YS,"detachFS");var XS={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(e){if(typeof e?.postMessage!="function")throw new u(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function(e){return new Xr(e)},"create")},JS=XS;async function QS(e,t,i=0){let n=Dh(e),r=await Ui(t,i);return Wh(e,r),n(r),r}s(QS,"resolveRemoteMount");function Ja(e){let i=class i extends e{metadata(){return{...super.metadata(),readonly:!0}}async rename(r,o){throw new u(30)}renameSync(r,o){throw new u(30)}async createFile(r,o,a){throw new u(30)}createFileSync(r,o,a){throw new u(30)}async unlink(r){throw new u(30)}unlinkSync(r){throw new u(30)}async rmdir(r){throw new u(30)}rmdirSync(r){throw new u(30)}async mkdir(r,o){throw new u(30)}mkdirSync(r,o){throw new u(30)}async link(r,o){throw new u(30)}linkSync(r,o){throw new u(30)}async sync(r,o,a){throw new u(30)}syncSync(r,o,a){throw new u(30)}};s(i,"ReadonlyFS");let t=i;return t}s(Ja,"Readonly");var Qa=1,Qr=class Qr extends Map{files(){let t=new Map;for(let[i,n]of this)n.isFile()&&t.set(i,n);return t}toJSON(){return{version:Qa,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(t){let i=[];for(let n of this.keys())_(n)==t&&i.push(D(n));return i}fromJSON(t){if(t.version!=Qa)throw new u(22,"Index version mismatch");this.clear();for(let[i,n]of Object.entries(t.entries)){let r=new G(n);r.isDirectory()&&(r.fileData=Ne(JSON.stringify(this.dirEntries(i)))),this.set(i,r)}}static parse(t){if(!Wc(t))throw new u(22,"Invalid JSON");let i=JSON.parse(t),n=new Qr;return n.fromJSON(i),n}};s(Qr,"Index");var Jr=Qr,Za=class Za extends Ja(pe){constructor(i){super();this.indexData=i;this.index=new Jr;this._isInitialized=!1}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=await this.getData(i,n)}reloadFilesSync(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=this.getDataSync(i,n)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw u.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:await this.getData(i,r))}openFileSync(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:this.getDataSync(i,r))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let n=this.index.get(i);if(!n)throw u.With("ENOENT",i,"readdir");if(!n.isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=JSON.parse(ai(n.fileData));if(!Array.isArray(r))throw u.With("ENODATA",i,"readdir");if(!r.every(o=>typeof o=="string"))throw u.With("ENODATA",i,"readdir");return r}};s(Za,"IndexFS");var Mn=Za;async function Uh(e,t){let i=await fetch(e).catch(n=>{throw new u(5,n.message)});if(!i.ok)throw new u(5,"fetch failed: response returned code "+i.status);switch(t){case"buffer":{let n=await i.arrayBuffer().catch(r=>{throw new u(5,r.message)});return new Uint8Array(n)}case"json":return i.json().catch(n=>{throw new u(5,n.message)});default:throw new u(22,"Invalid download type: "+t)}}s(Uh,"fetchFile");var eo=class eo extends Mn{async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[t,i]of this.index.files())await this.getData(t,i)}constructor({index:t="index.json",baseUrl:i=""}){super(typeof t!="string"?t:Uh(t,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:eo.name,readonly:!0}}preload(t,i){let n=this.index.get(t);if(!n)throw u.With("ENOENT",t,"preload");if(!n.isFile())throw u.With("EISDIR",t,"preload");n.size=i.length,n.fileData=i}async getData(t,i){if(i.fileData)return i.fileData;let n=await Uh(this.baseUrl+(t.startsWith("/")?t.slice(1):t),"buffer");return i.fileData=n,n}getDataSync(t,i){if(i.fileData)return i.fileData;throw new u(61,"",t,"getData")}};s(eo,"FetchFS");var Zr=eo,ZS={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(e){return new Zr(e)},"create")},eE=ZS;var tc=class tc{constructor(t){this.previous=t;this.current=Promise.withResolvers();this._isLocked=!0}get isLocked(){return this._isLocked}async done(){await this.previous?.done(),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}};s(tc,"MutexLock");var to=tc,ic=class ic{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){let t=new to(this.currentLock);return this.currentLock=t,t}async lock(t,i){let n=this.currentLock,r=this.addLock(),o=new Error().stack;return setTimeout(()=>{if(r.isLocked){let a=u.With("EDEADLK",t,i);throw a.stack+=o?.slice(5),a}},5e3),await n?.done(),r}lockSync(t,i){if(this.currentLock)throw u.With("EBUSY",t,i);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,i){var r=[];try{let n=S(r,await this.lock(t,"rename"));await this._fs.rename(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}renameSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"rename"));return this._fs.renameSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async stat(t){var n=[];try{let i=S(n,await this.lock(t,"stat"));return await this._fs.stat(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}statSync(t){var n=[];try{let i=S(n,this.lockSync(t,"stat"));return this._fs.statSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async openFile(t,i){var o=[];try{let n=S(o,await this.lock(t,"openFile"));let r=await this._fs.openFile(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}openFileSync(t,i){var o=[];try{let n=S(o,this.lockSync(t,"openFile"));let r=this._fs.openFileSync(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async createFile(t,i,n){var a=[];try{let r=S(a,await this.lock(t,"createFile"));let o=await this._fs.createFile(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}createFileSync(t,i,n){var a=[];try{let r=S(a,this.lockSync(t,"createFile"));let o=this._fs.createFileSync(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async unlink(t){var n=[];try{let i=S(n,await this.lock(t,"unlink"));await this._fs.unlink(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}unlinkSync(t){var n=[];try{let i=S(n,this.lockSync(t,"unlink"));return this._fs.unlinkSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async rmdir(t){var n=[];try{let i=S(n,await this.lock(t,"rmdir"));await this._fs.rmdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}rmdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"rmdir"));return this._fs.rmdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async mkdir(t,i){var r=[];try{let n=S(r,await this.lock(t,"mkdir"));await this._fs.mkdir(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}mkdirSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"mkdir"));return this._fs.mkdirSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async readdir(t){var n=[];try{let i=S(n,await this.lock(t,"readdir"));return await this._fs.readdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}readdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"readdir"));return this._fs.readdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async exists(t){var n=[];try{let i=S(n,await this.lock(t,"exists"));return await this._fs.exists(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}existsSync(t){var n=[];try{let i=S(n,this.lockSync(t,"exists"));return this._fs.existsSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async link(t,i){var r=[];try{let n=S(r,await this.lock(t,"link"));await this._fs.link(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}linkSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"link"));return this._fs.linkSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async sync(t,i,n){var o=[];try{let r=S(o,await this.lock(t,"sync"));await this._fs.sync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}syncSync(t,i,n){var o=[];try{let r=S(o,this.lockSync(t,"sync"));return this._fs.syncSync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}};s(ic,"__MutexedFS");var io=ic;function ec(e){let i=class i extends io{constructor(...r){super(),this._fs=new e(...r)}};s(i,"MutexedFS");let t=i;return t}s(ec,"Mutexed");var nc="/.deleted",rc=class rc extends pe{constructor({writable:i,readable:n}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this.writable=i,this.readable=n,this.writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:Wn.name}}async sync(i,n,r){await this.createParentDirectories(i),await this.writable.exists(i)||await this.writable.createFile(i,"w",420),await this.writable.sync(i,n,r)}syncSync(i,n,r){this.createParentDirectoriesSync(i),this.writable.syncSync(i,n,r)}async _initialize(){if(!this._isInitialized){try{let i=await this.writable.openFile(nc,M("r")),{size:n}=await i.stat(),{buffer:r}=await i.read(new Uint8Array(n));this._deleteLog=ai(r)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("")}async rename(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{await this.writable.rename(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}renameSync(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{this.writable.renameSync(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}async stat(i){this.checkInitialized();try{return await this.writable.stat(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(await this.readable.stat(i));return r.mode|=146,r}}statSync(i){this.checkInitialized();try{return this.writable.statSync(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(this.readable.statSync(i));return r.mode|=146,r}}async openFile(i,n){if(await this.writable.exists(i))return this.writable.openFile(i,n);let r=await this.readable.openFile(i,M("r")),o=new G(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new we(this,i,n,o,a)}openFileSync(i,n){if(this.writable.existsSync(i))return this.writable.openFileSync(i,n);let r=this.readable.openFileSync(i,M("r")),o=new G(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new we(this,i,n,o,a)}async createFile(i,n,r){return this.checkInitialized(),await this.writable.createFile(i,n,r),this.openFile(i,n)}createFileSync(i,n,r){return this.checkInitialized(),this.writable.createFileSync(i,n,r),this.openFileSync(i,n)}async link(i,n){this.checkInitialized(),await this.writable.link(i,n)}linkSync(i,n){this.checkInitialized(),this.writable.linkSync(i,n)}async unlink(i){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i))throw u.With("ENOENT",i,"unlink");await this.writable.exists(i)&&await this.writable.unlink(i),await this.exists(i)&&await this.deletePath(i)}unlinkSync(i){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i))throw u.With("ENOENT",i,"unlink");this.writable.existsSync(i)&&this.writable.unlinkSync(i),this.existsSync(i)&&this.deletePath(i)}async rmdir(i){if(this.checkInitialized(),!await this.exists(i))throw u.With("ENOENT",i,"rmdir");if(await this.writable.exists(i)&&await this.writable.rmdir(i),await this.exists(i)){if((await this.readdir(i)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i)}}rmdirSync(i){if(this.checkInitialized(),!this.existsSync(i))throw u.With("ENOENT",i,"rmdir");if(this.writable.existsSync(i)&&this.writable.rmdirSync(i),this.existsSync(i)){if(this.readdirSync(i).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.deletePath(i)}}async mkdir(i,n){if(this.checkInitialized(),await this.exists(i))throw u.With("EEXIST",i,"mkdir");await this.createParentDirectories(i),await this.writable.mkdir(i,n)}mkdirSync(i,n){if(this.checkInitialized(),this.existsSync(i))throw u.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i),this.writable.mkdirSync(i,n)}async readdir(i){if(this.checkInitialized(),!(await this.stat(i)).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r.push(...await this.writable.readdir(i))}catch{}try{r.push(...(await this.readable.readdir(i)).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}readdirSync(i){if(this.checkInitialized(),!this.statSync(i).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r=r.concat(this.writable.readdirSync(i))}catch{}try{r=r.concat(this.readable.readdirSync(i).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}async deletePath(i){this._deletedFiles.add(i),await this.updateLog(`d${i}
1
+ "use strict";var ZenFS=(()=>{var qh=Object.create;var Mt=Object.defineProperty;var lc=Object.getOwnPropertyDescriptor;var $h=Object.getOwnPropertyNames;var zh=Object.getPrototypeOf,Vh=Object.prototype.hasOwnProperty;var sc=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Dt=e=>{throw TypeError(e)};var Hh=(e,t,i)=>t in e?Mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var s=(e,t)=>Mt(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Un=(e,t)=>{for(var i in t)Mt(e,i,{get:t[i],enumerable:!0})},fc=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $h(t))!Vh.call(e,r)&&r!==i&&Mt(e,r,{get:()=>t[r],enumerable:!(n=lc(t,r))||n.enumerable});return e};var $i=(e,t,i)=>(i=e!=null?qh(zh(e)):{},fc(t||!e||!e.__esModule?Mt(i,"default",{value:e,enumerable:!0}):i,e)),Kh=e=>fc(Mt({},"__esModule",{value:!0}),e);var uc=["class","method","getter","setter","accessor","field","value","get","set"],qi=e=>e!==void 0&&typeof e!="function"?Dt("Function expected"):e,Gh=(e,t,i,n)=>({kind:uc[e],name:t,addInitializer:r=>i._?Dt("Already initialized"):n.push(qi(r||null))}),dc=(e,t,i)=>{for(var n=0,r=e[t>>1],o=r&&r.length;n<o;n++)t&1?r[n].call(i):i=(0,r[n])(i);return i},_e=(e,t,i,n,r,o)=>{var a,c,l,f,d,h=t&7,b=!!(t&8),p=!!(t&16),w=h>3?e.length+1:h?b?1:2:0,g=uc[h+5],A=h>3&&(e[w-1]=[]),k=e[w]||(e[w]=[]),v=h&&(!p&&!b&&(r=r.prototype),h<5&&(h>3||!p)&&lc(h<4?r:{get[i](){return ac(this,o)},set[i](F){return cc(this,o,F)}},i));h?p&&h<4&&s(o,(h>2?"set ":h>1?"get ":"")+i):s(r,i);for(var L=n.length-1;L>=0;L--)f=Gh(h,i,l={},k),h&&(f.static=b,f.private=p,d=f.access={has:p?F=>Yh(r,F):F=>i in F},h^3&&(d.get=p?F=>(h^1?ac:Xh)(F,r,h^4?o:v.get):F=>F[i]),h>2&&(d.set=p?(F,B)=>cc(F,r,B,h^4?o:v.set):(F,B)=>F[i]=B)),c=(0,n[L])(h?h<4?p?o:v[g]:h>4?void 0:{get:v.get,set:v.set}:r,f),l._=1,h^4||c===void 0?qi(c)&&(h>4?A.unshift(c):h?p?o=c:v[g]=c:r=c):typeof c!="object"||c===null?Dt("Object expected"):(qi(a=c.get)&&(v.get=a),qi(a=c.set)&&(v.set=a),qi(a=c.init)&&A.unshift(a));return v&&Mt(r,i,v),p?h^4?o:v:r},oo=(e,t,i)=>Hh(e,typeof t!="symbol"?t+"":t,i),so=(e,t,i)=>t.has(e)||Dt("Cannot "+i),Yh=(e,t)=>Object(t)!==t?Dt('Cannot use the "in" operator on this value'):e.has(t),ac=(e,t,i)=>(so(e,t,"read from private field"),i?i.call(e):t.get(e));var cc=(e,t,i,n)=>(so(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Xh=(e,t,i)=>(so(e,t,"access private method"),i);var S=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Dt("Object expected");var n;i&&(n=t[sc("asyncDispose")]),n===void 0&&(n=t[sc("dispose")]),typeof n!="function"&&Dt("Object not disposable"),e.push([i,n,t])}else i&&e.push([i]);return t},E=(e,t,i)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},r=a=>t=i?new n(a,t,"An error was suppressed during disposal"):(i=!0,a),o=a=>{for(;a=e.pop();)try{var c=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(c).then(o,l=>(r(l),o()))}catch(l){r(l)}if(i)throw t};return o()};var bc=T(zn=>{"use strict";zn.byteLength=op;zn.toByteArray=ap;zn.fromByteArray=fp;var qe=[],Fe=[],rp=typeof Uint8Array<"u"?Uint8Array:Array,fo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ut=0,yc=fo.length;Ut<yc;++Ut)qe[Ut]=fo[Ut],Fe[fo.charCodeAt(Ut)]=Ut;var Ut,yc;Fe[45]=62;Fe[95]=63;function mc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");i===-1&&(i=t);var n=i===t?0:4-i%4;return[i,n]}s(mc,"getLens");function op(e){var t=mc(e),i=t[0],n=t[1];return(i+n)*3/4-n}s(op,"byteLength");function sp(e,t,i){return(t+i)*3/4-i}s(sp,"_byteLength");function ap(e){var t,i=mc(e),n=i[0],r=i[1],o=new rp(sp(e,n,r)),a=0,c=r>0?n-4:n,l;for(l=0;l<c;l+=4)t=Fe[e.charCodeAt(l)]<<18|Fe[e.charCodeAt(l+1)]<<12|Fe[e.charCodeAt(l+2)]<<6|Fe[e.charCodeAt(l+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return r===2&&(t=Fe[e.charCodeAt(l)]<<2|Fe[e.charCodeAt(l+1)]>>4,o[a++]=t&255),r===1&&(t=Fe[e.charCodeAt(l)]<<10|Fe[e.charCodeAt(l+1)]<<4|Fe[e.charCodeAt(l+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}s(ap,"toByteArray");function cp(e){return qe[e>>18&63]+qe[e>>12&63]+qe[e>>6&63]+qe[e&63]}s(cp,"tripletToBase64");function lp(e,t,i){for(var n,r=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),r.push(cp(n));return r.join("")}s(lp,"encodeChunk");function fp(e){for(var t,i=e.length,n=i%3,r=[],o=16383,a=0,c=i-n;a<c;a+=o)r.push(lp(e,a,a+o>c?c:a+o));return n===1?(t=e[i-1],r.push(qe[t>>2]+qe[t<<4&63]+"==")):n===2&&(t=(e[i-2]<<8)+e[i-1],r.push(qe[t>>10]+qe[t>>4&63]+qe[t<<2&63]+"=")),r.join("")}s(fp,"fromByteArray")});var gc=T(uo=>{uo.read=function(e,t,i,n,r){var o,a,c=r*8-n-1,l=(1<<c)-1,f=l>>1,d=-7,h=i?r-1:0,b=i?-1:1,p=e[t+h];for(h+=b,o=p&(1<<-d)-1,p>>=-d,d+=c;d>0;o=o*256+e[t+h],h+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+e[t+h],h+=b,d-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(p?-1:1)*a*Math.pow(2,o-n)};uo.write=function(e,t,i,n,r,o){var a,c,l,f=o*8-r-1,d=(1<<f)-1,h=d>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,w=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?t+=b/l:t+=b*Math.pow(2,1-h),t*l>=2&&(a++,l/=2),a+h>=d?(c=0,a=d):a+h>=1?(c=(t*l-1)*Math.pow(2,r),a=a+h):(c=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[i+p]=c&255,p+=w,c/=256,r-=8);for(a=a<<r|c,f+=r;f>0;e[i+p]=a&255,p+=w,a/=256,f-=8);e[i+p-w]|=g*128}});var Ie=T(ui=>{"use strict";var ho=bc(),li=gc(),wc=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=m;ui.SlowBuffer=mp;ui.INSPECT_MAX_BYTES=50;var Vn=2147483647;ui.kMaxLength=Vn;m.TYPED_ARRAY_SUPPORT=up();!m.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 up(){try{let e=new Uint8Array(1),t={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}s(up,"typedArraySupport");Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.buffer},"get")});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.byteOffset},"get")});function ct(e){if(e>Vn)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,m.prototype),t}s(ct,"createBuffer");function m(e,t,i){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return bo(e)}return xc(e,t,i)}s(m,"Buffer");m.poolSize=8192;function xc(e,t,i){if(typeof e=="string")return hp(e,t);if(ArrayBuffer.isView(e))return pp(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($e(e,ArrayBuffer)||e&&$e(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($e(e,SharedArrayBuffer)||e&&$e(e.buffer,SharedArrayBuffer)))return yo(e,t,i);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return m.from(n,t,i);let r=yp(e);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return m.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s(xc,"from");m.from=function(e,t,i){return xc(e,t,i)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function kc(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}s(kc,"assertSize");function dp(e,t,i){return kc(e),e<=0?ct(e):t!==void 0?typeof i=="string"?ct(e).fill(t,i):ct(e).fill(t):ct(e)}s(dp,"alloc");m.alloc=function(e,t,i){return dp(e,t,i)};function bo(e){return kc(e),ct(e<0?0:go(e)|0)}s(bo,"allocUnsafe");m.allocUnsafe=function(e){return bo(e)};m.allocUnsafeSlow=function(e){return bo(e)};function hp(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let i=vc(e,t)|0,n=ct(i),r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}s(hp,"fromString");function po(e){let t=e.length<0?0:go(e.length)|0,i=ct(t);for(let n=0;n<t;n+=1)i[n]=e[n]&255;return i}s(po,"fromArrayLike");function pp(e){if($e(e,Uint8Array)){let t=new Uint8Array(e);return yo(t.buffer,t.byteOffset,t.byteLength)}return po(e)}s(pp,"fromArrayView");function yo(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),Object.setPrototypeOf(n,m.prototype),n}s(yo,"fromArrayBuffer");function yp(e){if(m.isBuffer(e)){let t=go(e.length)|0,i=ct(t);return i.length===0||e.copy(i,0,0,t),i}if(e.length!==void 0)return typeof e.length!="number"||So(e.length)?ct(0):po(e);if(e.type==="Buffer"&&Array.isArray(e.data))return po(e.data)}s(yp,"fromObject");function go(e){if(e>=Vn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Vn.toString(16)+" bytes");return e|0}s(go,"checked");function mp(e){return+e!=e&&(e=0),m.alloc(+e)}s(mp,"SlowBuffer");m.isBuffer=s(function(t){return t!=null&&t._isBuffer===!0&&t!==m.prototype},"isBuffer");m.compare=s(function(t,i){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),$e(i,Uint8Array)&&(i=m.from(i,i.offset,i.byteLength)),!m.isBuffer(t)||!m.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===i)return 0;let n=t.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(t[o]!==i[o]){n=t[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");m.isEncoding=s(function(t){switch(String(t).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");m.concat=s(function(t,i){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return m.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<t.length;++n)i+=t[n].length;let r=m.allocUnsafe(i),o=0;for(n=0;n<t.length;++n){let a=t[n];if($e(a,Uint8Array))o+a.length>r.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(m.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function vc(e,t){if(m.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$e(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let i=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return mo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Nc(e).length;default:if(r)return n?-1:mo(e).length;t=(""+t).toLowerCase(),r=!0}}s(vc,"byteLength");m.byteLength=vc;function bp(e,t,i){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,t>>>=0,i<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ip(this,t,i);case"utf8":case"utf-8":return Ic(this,t,i);case"ascii":return vp(this,t,i);case"latin1":case"binary":return Fp(this,t,i);case"base64":return xp(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ap(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s(bp,"slowToString");m.prototype._isBuffer=!0;function jt(e,t,i){let n=e[t];e[t]=e[i],e[i]=n}s(jt,"swap");m.prototype.swap16=s(function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<t;i+=2)jt(this,i,i+1);return this},"swap16");m.prototype.swap32=s(function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<t;i+=4)jt(this,i,i+3),jt(this,i+1,i+2);return this},"swap32");m.prototype.swap64=s(function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<t;i+=8)jt(this,i,i+7),jt(this,i+1,i+6),jt(this,i+2,i+5),jt(this,i+3,i+4);return this},"swap64");m.prototype.toString=s(function(){let t=this.length;return t===0?"":arguments.length===0?Ic(this,0,t):bp.apply(this,arguments)},"toString");m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=s(function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:m.compare(this,t)===0},"equals");m.prototype.inspect=s(function(){let t="",i=ui.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},"inspect");wc&&(m.prototype[wc]=m.prototype.inspect);m.prototype.compare=s(function(t,i,n,r,o){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(i===void 0&&(i=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let a=o-r,c=n-i,l=Math.min(a,c),f=this.slice(r,o),d=t.slice(i,n);for(let h=0;h<l;++h)if(f[h]!==d[h]){a=f[h],c=d[h];break}return a<c?-1:c<a?1:0},"compare");function Fc(e,t,i,n,r){if(e.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,So(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof t=="string"&&(t=m.from(t,n)),m.isBuffer(t))return t.length===0?-1:Sc(e,t,i,n,r);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):Sc(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(Fc,"bidirectionalIndexOf");function Sc(e,t,i,n,r){let o=1,a=e.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(l,"read");let f;if(r){let d=-1;for(f=i;f<a;f++)if(l(e,f)===l(t,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let d=!0;for(let h=0;h<c;h++)if(l(e,f+h)!==l(t,h)){d=!1;break}if(d)return f}return-1}s(Sc,"arrayIndexOf");m.prototype.includes=s(function(t,i,n){return this.indexOf(t,i,n)!==-1},"includes");m.prototype.indexOf=s(function(t,i,n){return Fc(this,t,i,n,!0)},"indexOf");m.prototype.lastIndexOf=s(function(t,i,n){return Fc(this,t,i,n,!1)},"lastIndexOf");function gp(e,t,i,n){i=Number(i)||0;let r=e.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=t.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let c=parseInt(t.substr(a*2,2),16);if(So(c))return a;e[i+a]=c}return a}s(gp,"hexWrite");function wp(e,t,i,n){return Hn(mo(t,e.length-i),e,i,n)}s(wp,"utf8Write");function Sp(e,t,i,n){return Hn(Rp(t),e,i,n)}s(Sp,"asciiWrite");function Ep(e,t,i,n){return Hn(Nc(t),e,i,n)}s(Ep,"base64Write");function _p(e,t,i,n){return Hn(Lp(t,e.length-i),e,i,n)}s(_p,"ucs2Write");m.prototype.write=s(function(t,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return gp(this,t,i,n);case"utf8":case"utf-8":return wp(this,t,i,n);case"ascii":case"latin1":case"binary":return Sp(this,t,i,n);case"base64":return Ep(this,t,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _p(this,t,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");m.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function xp(e,t,i){return t===0&&i===e.length?ho.fromByteArray(e):ho.fromByteArray(e.slice(t,i))}s(xp,"base64Slice");function Ic(e,t,i){i=Math.min(e.length,i);let n=[],r=t;for(;r<i;){let o=e[r],a=null,c=o>239?4:o>223?3:o>191?2:1;if(r+c<=i){let l,f,d,h;switch(c){case 1:o<128&&(a=o);break;case 2:l=e[r+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(a=h));break;case 3:l=e[r+1],f=e[r+2],(l&192)===128&&(f&192)===128&&(h=(o&15)<<12|(l&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:l=e[r+1],f=e[r+2],d=e[r+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(l&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=c}return kp(n)}s(Ic,"utf8Slice");var Ec=4096;function kp(e){let t=e.length;if(t<=Ec)return String.fromCharCode.apply(String,e);let i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=Ec));return i}s(kp,"decodeCodePointsArray");function vp(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]&127);return n}s(vp,"asciiSlice");function Fp(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}s(Fp,"latin1Slice");function Ip(e,t,i){let n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=t;o<i;++o)r+=Np[e[o]];return r}s(Ip,"hexSlice");function Ap(e,t,i){let n=e.slice(t,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Ap,"utf16leSlice");m.prototype.slice=s(function(t,i){let n=this.length;t=~~t,i=i===void 0?n:~~i,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<t&&(i=t);let r=this.subarray(t,i);return Object.setPrototypeOf(r,m.prototype),r},"slice");function Z(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}s(Z,"checkOffset");m.prototype.readUintLE=m.prototype.readUIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return r},"readUIntLE");m.prototype.readUintBE=m.prototype.readUIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t+--i],o=1;for(;i>0&&(o*=256);)r+=this[t+--i]*o;return r},"readUIntBE");m.prototype.readUint8=m.prototype.readUInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]},"readUInt8");m.prototype.readUint16LE=m.prototype.readUInt16LE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]|this[t+1]<<8},"readUInt16LE");m.prototype.readUint16BE=m.prototype.readUInt16BE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]<<8|this[t+1]},"readUInt16BE");m.prototype.readUint32LE=m.prototype.readUInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},"readUInt32LE");m.prototype.readUint32BE=m.prototype.readUInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},"readUInt32BE");m.prototype.readBigUInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));m.prototype.readBigUInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=i*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));m.prototype.readIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");m.prototype.readIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=i,o=1,a=this[t+--r];for(;r>0&&(o*=256);)a+=this[t+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");m.prototype.readInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},"readInt8");m.prototype.readInt16LE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");m.prototype.readInt16BE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},"readInt16BE");m.prototype.readInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},"readInt32LE");m.prototype.readInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},"readInt32BE");m.prototype.readBigInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)},"readBigInt64LE"));m.prototype.readBigInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=(i<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)},"readBigInt64BE"));m.prototype.readFloatLE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!0,23,4)},"readFloatLE");m.prototype.readFloatBE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!1,23,4)},"readFloatBE");m.prototype.readDoubleLE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!0,52,8)},"readDoubleLE");m.prototype.readDoubleBE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!1,52,8)},"readDoubleBE");function fe(e,t,i,n,r,o){if(!m.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}s(fe,"checkInt");m.prototype.writeUintLE=m.prototype.writeUIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=1,a=0;for(this[i]=t&255;++a<n&&(o*=256);)this[i+a]=t/o&255;return i+n},"writeUIntLE");m.prototype.writeUintBE=m.prototype.writeUIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=n-1,a=1;for(this[i+o]=t&255;--o>=0&&(a*=256);)this[i+o]=t/a&255;return i+n},"writeUIntBE");m.prototype.writeUint8=m.prototype.writeUInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,255,0),this[i]=t&255,i+1},"writeUInt8");m.prototype.writeUint16LE=m.prototype.writeUInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeUInt16LE");m.prototype.writeUint16BE=m.prototype.writeUInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeUInt16BE");m.prototype.writeUint32LE=m.prototype.writeUInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i+3]=t>>>24,this[i+2]=t>>>16,this[i+1]=t>>>8,this[i]=t&255,i+4},"writeUInt32LE");m.prototype.writeUint32BE=m.prototype.writeUInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeUInt32BE");function Ac(e,t,i,n,r){Lc(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,i}s(Ac,"wrtBigUInt64LE");function Oc(e,t,i,n,r){Lc(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i+7]=o,o=o>>8,e[i+6]=o,o=o>>8,e[i+5]=o,o=o>>8,e[i+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=a,a=a>>8,e[i+2]=a,a=a>>8,e[i+1]=a,a=a>>8,e[i]=a,i+8}s(Oc,"wrtBigUInt64BE");m.prototype.writeBigUInt64LE=xt(s(function(t,i=0){return Ac(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));m.prototype.writeBigUInt64BE=xt(s(function(t,i=0){return Oc(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));m.prototype.writeIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=0,a=1,c=0;for(this[i]=t&255;++o<n&&(a*=256);)t<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntLE");m.prototype.writeIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=n-1,a=1,c=0;for(this[i+o]=t&255;--o>=0&&(a*=256);)t<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntBE");m.prototype.writeInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,127,-128),t<0&&(t=255+t+1),this[i]=t&255,i+1},"writeInt8");m.prototype.writeInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeInt16LE");m.prototype.writeInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeInt16BE");m.prototype.writeInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),this[i]=t&255,this[i+1]=t>>>8,this[i+2]=t>>>16,this[i+3]=t>>>24,i+4},"writeInt32LE");m.prototype.writeInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeInt32BE");m.prototype.writeBigInt64LE=xt(s(function(t,i=0){return Ac(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));m.prototype.writeBigInt64BE=xt(s(function(t,i=0){return Oc(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Pc(e,t,i,n,r,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(Pc,"checkIEEE754");function Tc(e,t,i,n,r){return t=+t,i=i>>>0,r||Pc(e,t,i,4,34028234663852886e22,-34028234663852886e22),li.write(e,t,i,n,23,4),i+4}s(Tc,"writeFloat");m.prototype.writeFloatLE=s(function(t,i,n){return Tc(this,t,i,!0,n)},"writeFloatLE");m.prototype.writeFloatBE=s(function(t,i,n){return Tc(this,t,i,!1,n)},"writeFloatBE");function Rc(e,t,i,n,r){return t=+t,i=i>>>0,r||Pc(e,t,i,8,17976931348623157e292,-17976931348623157e292),li.write(e,t,i,n,52,8),i+8}s(Rc,"writeDouble");m.prototype.writeDoubleLE=s(function(t,i,n){return Rc(this,t,i,!0,n)},"writeDoubleLE");m.prototype.writeDoubleBE=s(function(t,i,n){return Rc(this,t,i,!1,n)},"writeDoubleBE");m.prototype.copy=s(function(t,i,n,r){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=t.length&&(i=t.length),i||(i=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-i<r-n&&(r=t.length-i+n);let o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),i),o},"copy");m.prototype.fill=s(function(t,i,n,r){if(typeof t=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!m.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){let a=t.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=i;o<n;++o)this[o]=t;else{let a=m.isBuffer(t)?t:m.from(t,r),c=a.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%c]}return this},"fill");var ci={};function wo(e,t,i){var n;ci[e]=(n=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}},s(n,"NodeError"),n)}s(wo,"E");wo("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);wo("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);wo("ERR_OUT_OF_RANGE",function(e,t,i){let n=`The value of "${e}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=_c(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=_c(r)),r+="n"),n+=` It must be ${t}. Received ${r}`,n},RangeError);function _c(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(_c,"addNumericalSeparator");function Op(e,t,i){fi(t,"offset"),(e[t]===void 0||e[t+i]===void 0)&&Ki(t,e.length-(i+1))}s(Op,"checkBounds");function Lc(e,t,i,n,r,o){if(e>i||e<t){let a=typeof t=="bigint"?"n":"",c;throw o>3?t===0||t===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${t}${a} and <= ${i}${a}`,new ci.ERR_OUT_OF_RANGE("value",c,e)}Op(n,r,o)}s(Lc,"checkIntBI");function fi(e,t){if(typeof e!="number")throw new ci.ERR_INVALID_ARG_TYPE(t,"number",e)}s(fi,"validateNumber");function Ki(e,t,i){throw Math.floor(e)!==e?(fi(e,i),new ci.ERR_OUT_OF_RANGE(i||"offset","an integer",e)):t<0?new ci.ERR_BUFFER_OUT_OF_BOUNDS:new ci.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}s(Ki,"boundsError");var Pp=/[^+/0-9A-Za-z-_]/g;function Tp(e){if(e=e.split("=")[0],e=e.trim().replace(Pp,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}s(Tp,"base64clean");function mo(e,t){t=t||1/0;let i,n=e.length,r=null,o=[];for(let a=0;a<n;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(mo,"utf8ToBytes");function Rp(e){let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i)&255);return t}s(Rp,"asciiToBytes");function Lp(e,t){let i,n,r,o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(Lp,"utf16leToBytes");function Nc(e){return ho.toByteArray(Tp(e))}s(Nc,"base64ToBytes");function Hn(e,t,i,n){let r;for(r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}s(Hn,"blitBuffer");function $e(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}s($e,"isInstance");function So(e){return e!==e}s(So,"numberIsNaN");var Np=function(){let e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)t[n+r]=e[i]+e[r]}return t}();function xt(e){return typeof BigInt>"u"?Cp:e}s(xt,"defineBigIntMethod");function Cp(){throw new Error("BigInt not supported")}s(Cp,"BufferBigIntNotDefined")});var Bc=T((IE,ko)=>{"use strict";var sy=Object.prototype.hasOwnProperty,se="~";function Xi(){}s(Xi,"Events");Object.create&&(Xi.prototype=Object.create(null),new Xi().__proto__||(se=!1));function ay(e,t,i){this.fn=e,this.context=t,this.once=i||!1}s(ay,"EE");function Cc(e,t,i,n,r){if(typeof i!="function")throw new TypeError("The listener must be a function");var o=new ay(i,n||e,r),a=se?se+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}s(Cc,"addListener");function Kn(e,t){--e._eventsCount===0?e._events=new Xi:delete e._events[t]}s(Kn,"clearEvent");function ne(){this._events=new Xi,this._eventsCount=0}s(ne,"EventEmitter");ne.prototype.eventNames=s(function(){var t=[],i,n;if(this._eventsCount===0)return t;for(n in i=this._events)sy.call(i,n)&&t.push(se?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(i)):t},"eventNames");ne.prototype.listeners=s(function(t){var i=se?se+t:t,n=this._events[i];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},"listeners");ne.prototype.listenerCount=s(function(t){var i=se?se+t:t,n=this._events[i];return n?n.fn?1:n.length:0},"listenerCount");ne.prototype.emit=s(function(t,i,n,r,o,a){var c=se?se+t:t;if(!this._events[c])return!1;var l=this._events[c],f=arguments.length,d,h;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,i),!0;case 3:return l.fn.call(l.context,i,n),!0;case 4:return l.fn.call(l.context,i,n,r),!0;case 5:return l.fn.call(l.context,i,n,r,o),!0;case 6:return l.fn.call(l.context,i,n,r,o,a),!0}for(h=1,d=new Array(f-1);h<f;h++)d[h-1]=arguments[h];l.fn.apply(l.context,d)}else{var b=l.length,p;for(h=0;h<b;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),f){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,i);break;case 3:l[h].fn.call(l[h].context,i,n);break;case 4:l[h].fn.call(l[h].context,i,n,r);break;default:if(!d)for(p=1,d=new Array(f-1);p<f;p++)d[p-1]=arguments[p];l[h].fn.apply(l[h].context,d)}}return!0},"emit");ne.prototype.on=s(function(t,i,n){return Cc(this,t,i,n,!1)},"on");ne.prototype.once=s(function(t,i,n){return Cc(this,t,i,n,!0)},"once");ne.prototype.removeListener=s(function(t,i,n,r){var o=se?se+t:t;if(!this._events[o])return this;if(!i)return Kn(this,o),this;var a=this._events[o];if(a.fn)a.fn===i&&(!r||a.once)&&(!n||a.context===n)&&Kn(this,o);else{for(var c=0,l=[],f=a.length;c<f;c++)(a[c].fn!==i||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[o]=l.length===1?l[0]:l:Kn(this,o)}return this},"removeListener");ne.prototype.removeAllListeners=s(function(t){var i;return t?(i=se?se+t:t,this._events[i]&&Kn(this,i)):(this._events=new Xi,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=se;ne.EventEmitter=ne;typeof ko<"u"&&(ko.exports=ne)});var q=T((_x,Tl)=>{"use strict";Tl.exports={ArrayIsArray:s(function(e){return Array.isArray(e)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(e,t){return e.includes(t)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(e,t){return e.indexOf(t)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(e,t){return e.join(t)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(e,t){return e.map(t)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(e,t){return e.pop(t)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(e,t){return e.push(t)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(e,t,...i){return e.call(t,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},"FunctionPrototypeSymbolHasInstance"),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:s(function(e,t){return Object.defineProperties(e,t)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(e,t,i){return Object.defineProperty(e,t,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(e,t){return Object.getOwnPropertyDescriptor(e,t)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(e){return Object.keys(e)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(e,t){return Object.setPrototypeOf(e,t)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(e,t){return e.catch(t)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(e,t,i){return e.then(t,i)},"PromisePrototypeThen"),PromiseReject:s(function(e){return Promise.reject(e)},"PromiseReject"),PromiseResolve:s(function(e){return Promise.resolve(e)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(e,t){return e.test(t)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(e){return e.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(e){return e.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(e){return e.trim()},"StringPrototypeTrim"),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:s(function(e,t,i){return e.set(t,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var Ei=T((kx,sr)=>{"use strict";var{AbortController:Rl,AbortSignal:_y}=typeof self<"u"?self:typeof window<"u"?window:void 0;sr.exports=Rl;sr.exports.AbortSignal=_y;sr.exports.default=Rl});var gn=T((vx,ls)=>{"use strict";var _i=typeof Reflect=="object"?Reflect:null,Ll=_i&&typeof _i.apply=="function"?_i.apply:s(function(t,i,n){return Function.prototype.apply.call(t,i,n)},"ReflectApply"),ar;_i&&typeof _i.ownKeys=="function"?ar=_i.ownKeys:Object.getOwnPropertySymbols?ar=s(function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))},"ReflectOwnKeys"):ar=s(function(t){return Object.getOwnPropertyNames(t)},"ReflectOwnKeys");function xy(e){console&&console.warn&&console.warn(e)}s(xy,"ProcessEmitWarning");var Cl=Number.isNaN||s(function(t){return t!==t},"NumberIsNaN");function N(){N.init.call(this)}s(N,"EventEmitter");ls.exports=N;ls.exports.once=Iy;N.EventEmitter=N;N.prototype._events=void 0;N.prototype._eventsCount=0;N.prototype._maxListeners=void 0;var Nl=10;function cr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}s(cr,"checkListener");Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Nl},"get"),set:s(function(e){if(typeof e!="number"||e<0||Cl(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Nl=e},"set")});N.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};N.prototype.setMaxListeners=s(function(t){if(typeof t!="number"||t<0||Cl(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},"setMaxListeners");function Bl(e){return e._maxListeners===void 0?N.defaultMaxListeners:e._maxListeners}s(Bl,"_getMaxListeners");N.prototype.getMaxListeners=s(function(){return Bl(this)},"getMaxListeners");N.prototype.emit=s(function(t){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=t==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[t];if(l===void 0)return!1;if(typeof l=="function")Ll(l,this,i);else for(var f=l.length,d=jl(l,f),n=0;n<f;++n)Ll(d[n],this,i);return!0},"emit");function Dl(e,t,i,n){var r,o,a;if(cr(i),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),a===void 0)a=o[t]=i,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Bl(e),r>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,xy(c)}return e}s(Dl,"_addListener");N.prototype.addListener=s(function(t,i){return Dl(this,t,i,!1)},"addListener");N.prototype.on=N.prototype.addListener;N.prototype.prependListener=s(function(t,i){return Dl(this,t,i,!0)},"prependListener");function ky(){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(ky,"onceWrapper");function Ml(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=ky.bind(n);return r.listener=i,n.wrapFn=r,r}s(Ml,"_onceWrap");N.prototype.once=s(function(t,i){return cr(i),this.on(t,Ml(this,t,i)),this},"once");N.prototype.prependOnceListener=s(function(t,i){return cr(i),this.prependListener(t,Ml(this,t,i)),this},"prependOnceListener");N.prototype.removeListener=s(function(t,i){var n,r,o,a,c;if(cr(i),r=this._events,r===void 0)return this;if(n=r[t],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){c=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():vy(n,o),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,c||i)}return this},"removeListener");N.prototype.off=N.prototype.removeListener;N.prototype.removeAllListeners=s(function(t){var i,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[t],typeof i=="function")this.removeListener(t,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(t,i[r]);return this},"removeAllListeners");function Wl(e,t,i){var n=e._events;if(n===void 0)return[];var r=n[t];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?Fy(r):jl(r,r.length)}s(Wl,"_listeners");N.prototype.listeners=s(function(t){return Wl(this,t,!0)},"listeners");N.prototype.rawListeners=s(function(t){return Wl(this,t,!1)},"rawListeners");N.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Ul.call(e,t)};N.prototype.listenerCount=Ul;function Ul(e){var t=this._events;if(t!==void 0){var i=t[e];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(Ul,"listenerCount");N.prototype.eventNames=s(function(){return this._eventsCount>0?ar(this._events):[]},"eventNames");function jl(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}s(jl,"arrayClone");function vy(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}s(vy,"spliceOne");function Fy(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}s(Fy,"unwrapListeners");function Iy(e,t){return new Promise(function(i,n){function r(a){e.removeListener(t,o),n(a)}s(r,"errorListener");function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),ql(e,t,o,{once:!0}),t!=="error"&&Ay(e,r,{once:!0})})}s(Iy,"once");function Ay(e,t,i){typeof e.on=="function"&&ql(e,"error",t,i)}s(Ay,"addErrorHandlerIfEventEmitter");function ql(e,t,i,n){if(typeof e.on=="function")n.once?e.once(t,i):e.on(t,i);else if(typeof e.addEventListener=="function")e.addEventListener(t,s(function r(o){n.once&&e.removeEventListener(t,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}s(ql,"eventTargetAgnosticAddListener")});var re=T((Ix,us)=>{"use strict";var Oy=Ie(),{kResistStopPropagation:Py,SymbolDispose:Ty}=q(),Ry=globalThis.AbortSignal||Ei().AbortSignal,Ly=globalThis.AbortController||Ei().AbortController,Ny=Object.getPrototypeOf(async function(){}).constructor,$l=globalThis.Blob||Oy.Blob,Cy=s(typeof $l<"u"?function(t){return t instanceof $l}:function(t){return!1},"isBlob"),zl=s((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)},"validateAbortSignal"),By=s((e,t)=>{if(typeof e!="function")throw new ERR_INVALID_ARG_TYPE(t,"Function",e)},"validateFunction"),ds=class ds extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let i="";for(let n=0;n<t.length;n++)i+=` ${t[n].stack}
2
+ `;super(i),this.name="AggregateError",this.errors=t}};s(ds,"AggregateError");var fs=ds;us.exports={AggregateError:fs,kEmptyObject:Object.freeze({}),once:s(function(e){let t=!1;return function(...i){t||(t=!0,e.apply(this,i))}},"once"),createDeferredPromise:s(function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},"createDeferredPromise"),promisify:s(function(e){return new Promise((t,i)=>{e((n,...r)=>n?i(n):t(...r))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(e,...t){return e.replace(/%([sdifj])/g,function(...[i,n]){let r=t.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},"format"),inspect:s(function(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(e){return e instanceof Ny},"isAsyncFunction"),isArrayBufferView:s(function(e){return ArrayBuffer.isView(e)},"isArrayBufferView")},isBlob:Cy,deprecate:s(function(e,t){return e},"deprecate"),addAbortListener:gn().addAbortListener||s(function(t,i){if(t===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);zl(t,"signal"),By(i,"listener");let n;return t.aborted?queueMicrotask(()=>i()):(t.addEventListener("abort",i,{__proto__:null,once:!0,[Py]:!0}),n=s(()=>{t.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Ty](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Ry.any||s(function(t){if(t.length===1)return t[0];let i=new Ly,n=s(()=>i.abort(),"abort");return t.forEach(r=>{zl(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{t.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};us.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=T((Ox,Kl)=>{"use strict";var{format:Dy,inspect:lr,AggregateError:My}=re(),Wy=globalThis.AggregateError||My,Uy=Symbol("kIsNodeError"),jy=["string","function","number","object","Function","Object","boolean","bigint","symbol"],qy=/^([A-Z][a-z0-9]*)+$/,$y="__node_internal_",fr={};function Kt(e,t){if(!e)throw new fr.ERR_INTERNAL_ASSERTION(t)}s(Kt,"assert");function Vl(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(Vl,"addNumericalSeparator");function zy(e,t,i){if(typeof t=="function")return Kt(t.length<=i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${t.length}).`),t(...i);let n=(t.match(/%[dfijoOs]/g)||[]).length;return Kt(n===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?t:Dy(t,...i)}s(zy,"getMessage");function ie(e,t,i){i||(i=Error);let r=class r extends i{constructor(...a){super(zy(e,t,a))}toString(){return`${this.name} [${e}]: ${this.message}`}};s(r,"NodeError");let n=r;Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${e}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[Uy]=!0,fr[e]=n}s(ie,"E");function Hl(e){let t=$y+e.name;return Object.defineProperty(e,"name",{value:t}),e}s(Hl,"hideStackFrames");function Vy(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let i=new Wy([t,e],t.message);return i.code=t.code,i}return e||t}s(Vy,"aggregateTwoErrors");var ps=class ps extends Error{constructor(t="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new fr.ERR_INVALID_ARG_TYPE("options","Object",i);super(t,i),this.code="ABORT_ERR",this.name="AbortError"}};s(ps,"AbortError");var hs=ps;ie("ERR_ASSERTION","%s",Error);ie("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Kt(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let l of t)Kt(typeof l=="string","All expected entries have to be of type string"),jy.includes(l)?r.push(l.toLowerCase()):qy.test(l)?o.push(l):(Kt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=r.indexOf("object");l!==-1&&(r.splice(r,l,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let l=r.pop();n+=`one of type ${r.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();n+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)n+=`. Received an instance of ${i.constructor.name}`;else{let l=lr(i,{depth:-1});n+=`. Received ${l}`}}else{let l=lr(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof i} (${l})`}return n},TypeError);ie("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let n=lr(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${n}`},TypeError);ie("ERR_INVALID_RETURN_VALUE",(e,t,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${e} to be returned from the "${t}" function but got ${r}.`},TypeError);ie("ERR_MISSING_ARGS",(...e)=>{Kt(e.length>0,"At least one arg needs to be specified");let t,i=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),i){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);ie("ERR_OUT_OF_RANGE",(e,t,i)=>{Kt(t,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Vl(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=Vl(n)),n+="n"):n=lr(i),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);ie("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ie("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ie("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ie("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ie("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ie("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ie("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ie("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ie("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ie("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ie("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Kl.exports={AbortError:hs,aggregateTwoErrors:Hl(Vy),hideStackFrames:Hl,codes:fr}});var ki=T((Tx,rf)=>{"use strict";var{ArrayIsArray:ms,ArrayPrototypeIncludes:Jl,ArrayPrototypeJoin:Ql,ArrayPrototypeMap:Hy,NumberIsInteger:bs,NumberIsNaN:Ky,NumberMAX_SAFE_INTEGER:Gy,NumberMIN_SAFE_INTEGER:Yy,NumberParseInt:Xy,ObjectPrototypeHasOwnProperty:Jy,RegExpPrototypeExec:Zl,String:Qy,StringPrototypeToUpperCase:Zy,StringPrototypeTrim:em}=q(),{hideStackFrames:Re,codes:{ERR_SOCKET_BAD_PORT:tm,ERR_INVALID_ARG_TYPE:oe,ERR_INVALID_ARG_VALUE:xi,ERR_OUT_OF_RANGE:Gt,ERR_UNKNOWN_SIGNAL:Gl}}=ae(),{normalizeEncoding:im}=re(),{isAsyncFunction:nm,isArrayBufferView:rm}=re().types,Yl={};function om(e){return e===(e|0)}s(om,"isInt32");function sm(e){return e===e>>>0}s(sm,"isUint32");var am=/^[0-7]+$/,cm="must be a 32-bit unsigned integer or an octal string";function lm(e,t,i){if(typeof e>"u"&&(e=i),typeof e=="string"){if(Zl(am,e)===null)throw new xi(t,e,cm);e=Xy(e,8)}return ef(e,t),e}s(lm,"parseFileMode");var fm=Re((e,t,i=Yy,n=Gy)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);if(e<i||e>n)throw new Gt(t,`>= ${i} && <= ${n}`,e)}),um=Re((e,t,i=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);if(e<i||e>n)throw new Gt(t,`>= ${i} && <= ${n}`,e)}),ef=Re((e,t,i=!1)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);let n=i?1:0,r=4294967295;if(e<n||e>r)throw new Gt(t,`>= ${n} && <= ${r}`,e)});function gs(e,t){if(typeof e!="string")throw new oe(t,"string",e)}s(gs,"validateString");function dm(e,t,i=void 0,n){if(typeof e!="number")throw new oe(t,"number",e);if(i!=null&&e<i||n!=null&&e>n||(i!=null||n!=null)&&Ky(e))throw new Gt(t,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}s(dm,"validateNumber");var hm=Re((e,t,i)=>{if(!Jl(i,e)){let r="must be one of: "+Ql(Hy(i,o=>typeof o=="string"?`'${o}'`:Qy(o)),", ");throw new xi(t,e,r)}});function tf(e,t){if(typeof e!="boolean")throw new oe(t,"boolean",e)}s(tf,"validateBoolean");function ys(e,t,i){return e==null||!Jy(e,t)?i:e[t]}s(ys,"getOwnPropertyValueOrDefault");var pm=Re((e,t,i=null)=>{let n=ys(i,"allowArray",!1),r=ys(i,"allowFunction",!1);if(!ys(i,"nullable",!1)&&e===null||!n&&ms(e)||typeof e!="object"&&(!r||typeof e!="function"))throw new oe(t,"Object",e)}),ym=Re((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new oe(t,"a dictionary",e)}),ur=Re((e,t,i=0)=>{if(!ms(e))throw new oe(t,"Array",e);if(e.length<i){let n=`must be longer than ${i}`;throw new xi(t,e,n)}});function mm(e,t){ur(e,t);for(let i=0;i<e.length;i++)gs(e[i],`${t}[${i}]`)}s(mm,"validateStringArray");function bm(e,t){ur(e,t);for(let i=0;i<e.length;i++)tf(e[i],`${t}[${i}]`)}s(bm,"validateBooleanArray");function gm(e,t){ur(e,t);for(let i=0;i<e.length;i++){let n=e[i],r=`${t}[${i}]`;if(n==null)throw new oe(r,"AbortSignal",n);nf(n,r)}}s(gm,"validateAbortSignalArray");function wm(e,t="signal"){if(gs(e,t),Yl[e]===void 0)throw Yl[Zy(e)]!==void 0?new Gl(e+" (signals must use all capital letters)"):new Gl(e)}s(wm,"validateSignalName");var Sm=Re((e,t="buffer")=>{if(!rm(e))throw new oe(t,["Buffer","TypedArray","DataView"],e)});function Em(e,t){let i=im(t),n=e.length;if(i==="hex"&&n%2!==0)throw new xi("encoding",t,`is invalid for data of length ${n}`)}s(Em,"validateEncoding");function _m(e,t="Port",i=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&em(e).length===0||+e!==+e>>>0||e>65535||e===0&&!i)throw new tm(t,e,i);return e|0}s(_m,"validatePort");var nf=Re((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new oe(t,"AbortSignal",e)}),xm=Re((e,t)=>{if(typeof e!="function")throw new oe(t,"Function",e)}),km=Re((e,t)=>{if(typeof e!="function"||nm(e))throw new oe(t,"Function",e)}),vm=Re((e,t)=>{if(e!==void 0)throw new oe(t,"undefined",e)});function Fm(e,t,i){if(!Jl(i,e))throw new oe(t,`('${Ql(i,"|")}')`,e)}s(Fm,"validateUnion");var Im=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Xl(e,t){if(typeof e>"u"||!Zl(Im,e))throw new xi(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Xl,"validateLinkHeaderFormat");function Am(e){if(typeof e=="string")return Xl(e,"hints"),e;if(ms(e)){let t=e.length,i="";if(t===0)return i;for(let n=0;n<t;n++){let r=e[n];Xl(r,"hints"),i+=r,n!==t-1&&(i+=", ")}return i}throw new xi("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Am,"validateLinkHeaderValue");rf.exports={isInt32:om,isUint32:sm,parseFileMode:lm,validateArray:ur,validateStringArray:mm,validateBooleanArray:bm,validateAbortSignalArray:gm,validateBoolean:tf,validateBuffer:Sm,validateDictionary:ym,validateEncoding:Em,validateFunction:xm,validateInt32:um,validateInteger:fm,validateNumber:dm,validateObject:pm,validateOneOf:hm,validatePlainFunction:km,validatePort:_m,validateSignalName:wm,validateString:gs,validateUint32:ef,validateUndefined:vm,validateUnion:Fm,validateAbortSignal:nf,validateLinkHeaderValue:Am}});var Pt=T((Lx,cf)=>{var V=cf.exports={},Qe,Ze;function ws(){throw new Error("setTimeout has not been defined")}s(ws,"defaultSetTimout");function Ss(){throw new Error("clearTimeout has not been defined")}s(Ss,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Qe=setTimeout:Qe=ws}catch{Qe=ws}try{typeof clearTimeout=="function"?Ze=clearTimeout:Ze=Ss}catch{Ze=Ss}})();function of(e){if(Qe===setTimeout)return setTimeout(e,0);if((Qe===ws||!Qe)&&setTimeout)return Qe=setTimeout,setTimeout(e,0);try{return Qe(e,0)}catch{try{return Qe.call(null,e,0)}catch{return Qe.call(this,e,0)}}}s(of,"runTimeout");function Om(e){if(Ze===clearTimeout)return clearTimeout(e);if((Ze===Ss||!Ze)&&clearTimeout)return Ze=clearTimeout,clearTimeout(e);try{return Ze(e)}catch{try{return Ze.call(null,e)}catch{return Ze.call(this,e)}}}s(Om,"runClearTimeout");var yt=[],vi=!1,Yt,dr=-1;function Pm(){!vi||!Yt||(vi=!1,Yt.length?yt=Yt.concat(yt):dr=-1,yt.length&&sf())}s(Pm,"cleanUpNextTick");function sf(){if(!vi){var e=of(Pm);vi=!0;for(var t=yt.length;t;){for(Yt=yt,yt=[];++dr<t;)Yt&&Yt[dr].run();dr=-1,t=yt.length}Yt=null,vi=!1,Om(e)}}s(sf,"drainQueue");V.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];yt.push(new af(e,t)),yt.length===1&&!vi&&of(sf)};function af(e,t){this.fun=e,this.array=t}s(af,"Item");af.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function mt(){}s(mt,"noop");V.on=mt;V.addListener=mt;V.once=mt;V.off=mt;V.removeListener=mt;V.removeAllListeners=mt;V.emit=mt;V.prependListener=mt;V.prependOnceListener=mt;V.listeners=function(e){return[]};V.binding=function(e){throw new Error("process.binding is not supported")};V.cwd=function(){return"/"};V.chdir=function(e){throw new Error("process.chdir is not supported")};V.umask=function(){return 0}});var tt=T((Cx,xf)=>{"use strict";var{SymbolAsyncIterator:lf,SymbolIterator:ff,SymbolFor:Xt}=q(),uf=Xt("nodejs.stream.destroyed"),df=Xt("nodejs.stream.errored"),Es=Xt("nodejs.stream.readable"),_s=Xt("nodejs.stream.writable"),hf=Xt("nodejs.stream.disturbed"),Tm=Xt("nodejs.webstream.isClosedPromise"),Rm=Xt("nodejs.webstream.controllerErrorFunction");function hr(e,t=!1){var i;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((i=e._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!e._writableState||e._readableState))}s(hr,"isReadableNodeStream");function pr(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}s(pr,"isWritableNodeStream");function Lm(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}s(Lm,"isDuplexNodeStream");function et(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}s(et,"isNodeStream");function pf(e){return!!(e&&!et(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}s(pf,"isReadableStream");function yf(e){return!!(e&&!et(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}s(yf,"isWritableStream");function mf(e){return!!(e&&!et(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}s(mf,"isTransformStream");function Nm(e){return pf(e)||yf(e)||mf(e)}s(Nm,"isWebStream");function Cm(e,t){return e==null?!1:t===!0?typeof e[lf]=="function":t===!1?typeof e[ff]=="function":typeof e[lf]=="function"||typeof e[ff]=="function"}s(Cm,"isIterable");function yr(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!!(e.destroyed||e[uf]||n!=null&&n.destroyed)}s(yr,"isDestroyed");function bf(e){if(!pr(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(bf,"isWritableEnded");function Bm(e,t){if(!pr(e))return null;if(e.writableFinished===!0)return!0;let i=e._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||t===!1&&i.ended===!0&&i.length===0)}s(Bm,"isWritableFinished");function Dm(e){if(!hr(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(Dm,"isReadableEnded");function gf(e,t){if(!hr(e))return null;let i=e._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||t===!1&&i.ended===!0&&i.length===0)}s(gf,"isReadableFinished");function wf(e){return e&&e[Es]!=null?e[Es]:typeof e?.readable!="boolean"?null:yr(e)?!1:hr(e)&&e.readable&&!gf(e)}s(wf,"isReadable");function Sf(e){return e&&e[_s]!=null?e[_s]:typeof e?.writable!="boolean"?null:yr(e)?!1:pr(e)&&e.writable&&!bf(e)}s(Sf,"isWritable");function Mm(e,t){return et(e)?yr(e)?!0:!(t?.readable!==!1&&wf(e)||t?.writable!==!1&&Sf(e)):null}s(Mm,"isFinished");function Wm(e){var t,i;return et(e)?e.writableErrored?e.writableErrored:(t=(i=e._writableState)===null||i===void 0?void 0:i.errored)!==null&&t!==void 0?t:null:null}s(Wm,"isWritableErrored");function Um(e){var t,i;return et(e)?e.readableErrored?e.readableErrored:(t=(i=e._readableState)===null||i===void 0?void 0:i.errored)!==null&&t!==void 0?t:null:null}s(Um,"isReadableErrored");function jm(e){if(!et(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,i=e._readableState;return typeof t?.closed=="boolean"||typeof i?.closed=="boolean"?t?.closed||i?.closed:typeof e._closed=="boolean"&&Ef(e)?e._closed:null}s(jm,"isClosed");function Ef(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}s(Ef,"isOutgoingMessage");function _f(e){return typeof e._sent100=="boolean"&&Ef(e)}s(_f,"isServerResponse");function qm(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}s(qm,"isServerRequest");function $m(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!n&&_f(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s($m,"willEmitClose");function zm(e){var t;return!!(e&&((t=e[hf])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}s(zm,"isDisturbed");function Vm(e){var t,i,n,r,o,a,c,l,f,d;return!!(e&&((t=(i=(n=(r=(o=(a=e[df])!==null&&a!==void 0?a:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&r!==void 0?r:(c=e._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&n!==void 0?n:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(f=e._readableState)===null||f===void 0?void 0:f.errored)!==null&&t!==void 0?t:!((d=e._writableState)===null||d===void 0)&&d.errored))}s(Vm,"isErrored");xf.exports={isDestroyed:yr,kIsDestroyed:uf,isDisturbed:zm,kIsDisturbed:hf,isErrored:Vm,kIsErrored:df,isReadable:wf,kIsReadable:Es,kIsClosedPromise:Tm,kControllerErrorFunction:Rm,kIsWritable:_s,isClosed:jm,isDuplexNodeStream:Lm,isFinished:Mm,isIterable:Cm,isReadableNodeStream:hr,isReadableStream:pf,isReadableEnded:Dm,isReadableFinished:gf,isReadableErrored:Um,isNodeStream:et,isWebStream:Nm,isWritable:Sf,isWritableNodeStream:pr,isWritableStream:yf,isWritableEnded:bf,isWritableFinished:Bm,isWritableErrored:Wm,isServerRequest:qm,isServerResponse:_f,willEmitClose:$m,isTransformStream:mf}});var bt=T((Dx,Is)=>{var Tt=Pt(),{AbortError:Rf,codes:Hm}=ae(),{ERR_INVALID_ARG_TYPE:Km,ERR_STREAM_PREMATURE_CLOSE:kf}=Hm,{kEmptyObject:ks,once:vs}=re(),{validateAbortSignal:Gm,validateFunction:Ym,validateObject:Xm,validateBoolean:Jm}=ki(),{Promise:Qm,PromisePrototypeThen:Zm,SymbolDispose:Lf}=q(),{isClosed:eb,isReadable:vf,isReadableNodeStream:xs,isReadableStream:tb,isReadableFinished:Ff,isReadableErrored:If,isWritable:Af,isWritableNodeStream:Of,isWritableStream:ib,isWritableFinished:Pf,isWritableErrored:Tf,isNodeStream:nb,willEmitClose:rb,kIsClosedPromise:ob}=tt(),Fi;function sb(e){return e.setHeader&&typeof e.abort=="function"}s(sb,"isRequest");var Fs=s(()=>{},"nop");function Nf(e,t,i){var n,r;if(arguments.length===2?(i=t,t=ks):t==null?t=ks:Xm(t,"options"),Ym(i,"callback"),Gm(t.signal,"options.signal"),i=vs(i),tb(e)||ib(e))return ab(e,t,i);if(!nb(e))throw new Km("stream",["ReadableStream","WritableStream","Stream"],e);let o=(n=t.readable)!==null&&n!==void 0?n:xs(e),a=(r=t.writable)!==null&&r!==void 0?r:Of(e),c=e._writableState,l=e._readableState,f=s(()=>{e.writable||b()},"onlegacyfinish"),d=rb(e)&&xs(e)===o&&Of(e)===a,h=Pf(e,!1),b=s(()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||o))&&(!o||p)&&i.call(e)},"onfinish"),p=Ff(e,!1),w=s(()=>{p=!0,e.destroyed&&(d=!1),!(d&&(!e.writable||a))&&(!a||h)&&i.call(e)},"onend"),g=s(B=>{i.call(e,B)},"onerror"),A=eb(e),k=s(()=>{A=!0;let B=Tf(e)||If(e);if(B&&typeof B!="boolean")return i.call(e,B);if(o&&!p&&xs(e,!0)&&!Ff(e,!1))return i.call(e,new kf);if(a&&!h&&!Pf(e,!1))return i.call(e,new kf);i.call(e)},"onclose"),v=s(()=>{A=!0;let B=Tf(e)||If(e);if(B&&typeof B!="boolean")return i.call(e,B);i.call(e)},"onclosed"),L=s(()=>{e.req.on("finish",b)},"onrequest");sb(e)?(e.on("complete",b),d||e.on("abort",k),e.req?L():e.on("request",L)):a&&!c&&(e.on("end",f),e.on("close",f)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",w),e.on("finish",b),t.error!==!1&&e.on("error",g),e.on("close",k),A?Tt.nextTick(k):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||Tt.nextTick(v):(!o&&(!d||vf(e))&&(h||Af(e)===!1)||!a&&(!d||Af(e))&&(p||vf(e)===!1)||l&&e.req&&e.aborted)&&Tt.nextTick(v);let F=s(()=>{i=Fs,e.removeListener("aborted",k),e.removeListener("complete",b),e.removeListener("abort",k),e.removeListener("request",L),e.req&&e.req.removeListener("finish",b),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",b),e.removeListener("end",w),e.removeListener("error",g),e.removeListener("close",k)},"cleanup");if(t.signal&&!A){let B=s(()=>{let Bt=i;F(),Bt.call(e,new Rf(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)Tt.nextTick(B);else{Fi=Fi||re().addAbortListener;let Bt=Fi(t.signal,B),Ee=i;i=vs((...si)=>{Bt[Lf](),Ee.apply(e,si)})}}return F}s(Nf,"eos");function ab(e,t,i){let n=!1,r=Fs;if(t.signal)if(r=s(()=>{n=!0,i.call(e,new Rf(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)Tt.nextTick(r);else{Fi=Fi||re().addAbortListener;let a=Fi(t.signal,r),c=i;i=vs((...l)=>{a[Lf](),c.apply(e,l)})}let o=s((...a)=>{n||Tt.nextTick(()=>i.apply(e,a))},"resolverFn");return Zm(e[ob].promise,o,o),Fs}s(ab,"eosWeb");function cb(e,t){var i;let n=!1;return t===null&&(t=ks),(i=t)!==null&&i!==void 0&&i.cleanup&&(Jm(t.cleanup,"cleanup"),n=t.cleanup),new Qm((r,o)=>{let a=Nf(e,t,c=>{n&&a(),c?o(c):r()})})}s(cb,"finished");Is.exports=Nf;Is.exports.finished=cb});var Jt=T((Wx,qf)=>{"use strict";var it=Pt(),{aggregateTwoErrors:lb,codes:{ERR_MULTIPLE_CALLBACK:fb},AbortError:ub}=ae(),{Symbol:Df}=q(),{kIsDestroyed:db,isDestroyed:hb,isFinished:pb,isServerRequest:yb}=tt(),Mf=Df("kDestroy"),As=Df("kConstruct");function Wf(e,t,i){e&&(e.stack,t&&!t.errored&&(t.errored=e),i&&!i.errored&&(i.errored=e))}s(Wf,"checkError");function mb(e,t){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof t=="function"&&t(),this):(Wf(e,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Cf(this,e,t):this.once(Mf,function(o){Cf(this,lb(o,e),t)}),this)}s(mb,"destroy");function Cf(e,t,i){let n=!1;function r(o){if(n)return;n=!0;let a=e._readableState,c=e._writableState;Wf(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?it.nextTick(bb,e,o):it.nextTick(Uf,e)}s(r,"onDestroy");try{e._destroy(t||null,r)}catch(o){r(o)}}s(Cf,"_destroy");function bb(e,t){Os(e,t),Uf(e)}s(bb,"emitErrorCloseNT");function Uf(e){let t=e._readableState,i=e._writableState;i&&(i.closeEmitted=!0),t&&(t.closeEmitted=!0),(i!=null&&i.emitClose||t!=null&&t.emitClose)&&e.emit("close")}s(Uf,"emitCloseNT");function Os(e,t){let i=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),e.emit("error",t))}s(Os,"emitErrorNT");function gb(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}s(gb,"undestroy");function Ps(e,t,i){let n=e._readableState,r=e._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?e.destroy(t):t&&(t.stack,r&&!r.errored&&(r.errored=t),n&&!n.errored&&(n.errored=t),i?it.nextTick(Os,e,t):Os(e,t))}s(Ps,"errorOrDestroy");function wb(e,t){if(typeof e._construct!="function")return;let i=e._readableState,n=e._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),e.once(As,t),!(e.listenerCount(As)>1)&&it.nextTick(Sb,e)}s(wb,"construct");function Sb(e){let t=!1;function i(n){if(t){Ps(e,n??new fb);return}t=!0;let r=e._readableState,o=e._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(Mf,n):n?Ps(e,n,!0):it.nextTick(Eb,e)}s(i,"onConstruct");try{e._construct(n=>{it.nextTick(i,n)})}catch(n){it.nextTick(i,n)}}s(Sb,"constructNT");function Eb(e){e.emit(As)}s(Eb,"emitConstructNT");function Bf(e){return e?.setHeader&&typeof e.abort=="function"}s(Bf,"isRequest");function jf(e){e.emit("close")}s(jf,"emitCloseLegacy");function _b(e,t){e.emit("error",t),it.nextTick(jf,e)}s(_b,"emitErrorCloseLegacy");function xb(e,t){!e||hb(e)||(!t&&!pb(e)&&(t=new ub),yb(e)?(e.socket=null,e.destroy(t)):Bf(e)?e.abort():Bf(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?it.nextTick(_b,e,t):it.nextTick(jf,e),e.destroyed||(e[db]=!0))}s(xb,"destroyer");qf.exports={construct:wb,destroyer:xb,destroy:mb,undestroy:gb,errorOrDestroy:Ps}});var gr=T((jx,zf)=>{"use strict";var{ArrayIsArray:kb,ObjectSetPrototypeOf:$f}=q(),{EventEmitter:mr}=gn();function br(e){mr.call(this,e)}s(br,"Stream");$f(br.prototype,mr.prototype);$f(br,mr);br.prototype.pipe=function(e,t){let i=this;function n(d){e.writable&&e.write(d)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),e.on("drain",r),!e._isStdio&&(!t||t.end!==!1)&&(i.on("end",a),i.on("close",c));let o=!1;function a(){o||(o=!0,e.end())}s(a,"onend");function c(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}s(c,"onclose");function l(d){f(),mr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),Ts(i,"error",l),Ts(e,"error",l);function f(){i.removeListener("data",n),e.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),e.removeListener("error",l),i.removeListener("end",f),i.removeListener("close",f),e.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),e.on("close",f),e.emit("pipe",i),e};function Ts(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):kb(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}s(Ts,"prependListener");zf.exports={Stream:br,prependListener:Ts}});var wn=T(($x,wr)=>{"use strict";var{SymbolDispose:vb}=q(),{AbortError:Vf,codes:Fb}=ae(),{isNodeStream:Hf,isWebStream:Ib,kControllerErrorFunction:Ab}=tt(),Ob=bt(),{ERR_INVALID_ARG_TYPE:Kf}=Fb,Rs,Pb=s((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new Kf(t,"AbortSignal",e)},"validateAbortSignal");wr.exports.addAbortSignal=s(function(t,i){if(Pb(t,"signal"),!Hf(i)&&!Ib(i))throw new Kf("stream",["ReadableStream","WritableStream","Stream"],i);return wr.exports.addAbortSignalNoValidate(t,i)},"addAbortSignal");wr.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let i=Hf(t)?()=>{t.destroy(new Vf(void 0,{cause:e.reason}))}:()=>{t[Ab](new Vf(void 0,{cause:e.reason}))};if(e.aborted)i();else{Rs=Rs||re().addAbortListener;let n=Rs(e,i);Ob(t,n[vb])}return t}});var Xf=T((Vx,Yf)=>{"use strict";var{StringPrototypeSlice:Gf,SymbolIterator:Tb,TypedArrayPrototypeSet:Sr,Uint8Array:Rb}=q(),{Buffer:Ls}=Ie(),{inspect:Lb}=re(),Ii;Yf.exports=(Ii=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(t){let i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=t+i.data;return n}concat(t){if(this.length===0)return Ls.alloc(0);let i=Ls.allocUnsafe(t>>>0),n=this.head,r=0;for(;n;)Sr(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(t,i){let n=this.head.data;if(t<n.length){let r=n.slice(0,t);return this.head.data=n.slice(t),r}return t===n.length?this.shift():i?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[Tb](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let i="",n=this.head,r=0;do{let o=n.data;if(t>o.length)i+=o,t-=o.length;else{t===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=Gf(o,0,t),this.head=n,n.data=Gf(o,t));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(t){let i=Ls.allocUnsafe(t),n=t,r=this.head,o=0;do{let a=r.data;if(t>a.length)Sr(i,a,n-t),t-=a.length;else{t===a.length?(Sr(i,a,n-t),++o,r.next?this.head=r.next:this.head=this.tail=null):(Sr(i,new Rb(a.buffer,a.byteOffset,t),n-t),this.head=r,r.data=a.slice(t));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](t,i){return Lb(this,{...i,depth:0,customInspect:!1})}},s(Ii,"BufferList"),Ii)});var Sn=T((Kx,eu)=>{"use strict";var{MathFloor:Nb,NumberIsInteger:Cb}=q(),{validateInteger:Bb}=ki(),{ERR_INVALID_ARG_VALUE:Db}=ae().codes,Jf=16*1024,Qf=16;function Mb(e,t,i){return e.highWaterMark!=null?e.highWaterMark:t?e[i]:null}s(Mb,"highWaterMarkFrom");function Zf(e){return e?Qf:Jf}s(Zf,"getDefaultHighWaterMark");function Wb(e,t){Bb(t,"value",0),e?Qf=t:Jf=t}s(Wb,"setDefaultHighWaterMark");function Ub(e,t,i,n){let r=Mb(t,n,i);if(r!=null){if(!Cb(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Db(o,r)}return Nb(r)}return Zf(e.objectMode)}s(Ub,"getHighWaterMark");eu.exports={getHighWaterMark:Ub,getDefaultHighWaterMark:Zf,setDefaultHighWaterMark:Wb}});var nu=T((Ns,iu)=>{var Er=Ie(),nt=Er.Buffer;function tu(e,t){for(var i in e)t[i]=e[i]}s(tu,"copyProps");nt.from&&nt.alloc&&nt.allocUnsafe&&nt.allocUnsafeSlow?iu.exports=Er:(tu(Er,Ns),Ns.Buffer=Qt);function Qt(e,t,i){return nt(e,t,i)}s(Qt,"SafeBuffer");Qt.prototype=Object.create(nt.prototype);tu(nt,Qt);Qt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return nt(e,t,i)};Qt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=nt(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};Qt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return nt(e)};Qt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Er.SlowBuffer(e)}});var su=T(ou=>{"use strict";var Bs=nu().Buffer,ru=Bs.isEncoding||function(e){switch(e=""+e,e&&e.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 jb(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}s(jb,"_normalizeEncoding");function qb(e){var t=jb(e);if(typeof t!="string"&&(Bs.isEncoding===ru||!ru(e)))throw new Error("Unknown encoding: "+e);return t||e}s(qb,"normalizeEncoding");ou.StringDecoder=En;function En(e){this.encoding=qb(e);var t;switch(this.encoding){case"utf16le":this.text=Gb,this.end=Yb,t=4;break;case"utf8":this.fillLast=Vb,t=4;break;case"base64":this.text=Xb,this.end=Jb,t=3;break;default:this.write=Qb,this.end=Zb;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bs.allocUnsafe(t)}s(En,"StringDecoder");En.prototype.write=function(e){if(e.length===0)return"";var t,i;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""};En.prototype.end=Kb;En.prototype.text=Hb;En.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Cs(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}s(Cs,"utf8CheckByte");function $b(e,t,i){var n=t.length-1;if(n<i)return 0;var r=Cs(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=Cs(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=Cs(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}s($b,"utf8CheckIncomplete");function zb(e,t,i){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}s(zb,"utf8CheckExtraBytes");function Vb(e){var t=this.lastTotal-this.lastNeed,i=zb(this,e,t);if(i!==void 0)return i;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}s(Vb,"utf8FillLast");function Hb(e,t){var i=$b(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}s(Hb,"utf8Text");function Kb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}s(Kb,"utf8End");function Gb(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}s(Gb,"utf16Text");function Yb(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}s(Yb,"utf16End");function Xb(e,t){var i=(e.length-t)%3;return i===0?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}s(Xb,"base64Text");function Jb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}s(Jb,"base64End");function Qb(e){return e.toString(this.encoding)}s(Qb,"simpleWrite");function Zb(e){return e&&e.length?this.write(e):""}s(Zb,"simpleEnd")});var Ds=T((Qx,fu)=>{"use strict";var au=Pt(),{PromisePrototypeThen:eg,SymbolAsyncIterator:cu,SymbolIterator:lu}=q(),{Buffer:tg}=Ie(),{ERR_INVALID_ARG_TYPE:ig,ERR_STREAM_NULL_VALUES:ng}=ae().codes;function rg(e,t,i){let n;if(typeof t=="string"||t instanceof tg)return new e({objectMode:!0,...i,read:s(function(){this.push(t),this.push(null)},"read")});let r;if(t&&t[cu])r=!0,n=t[cu]();else if(t&&t[lu])r=!1,n=t[lu]();else throw new ig("iterable",["Iterable"],t);let o=new e({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(f,d){eg(c(f),()=>au.nextTick(d,f),h=>au.nextTick(d,h||f))};async function c(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:b,done:p}=await n.throw(f);if(await b,p)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}s(c,"close");async function l(){for(;;){try{let{value:f,done:d}=r?await n.next():n.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new ng;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(rg,"from");fu.exports=rg});var xn=T((e0,Au)=>{var Me=Pt(),{ArrayPrototypeIndexOf:og,NumberIsInteger:sg,NumberIsNaN:ag,NumberParseInt:cg,ObjectDefineProperties:Vs,ObjectKeys:lg,ObjectSetPrototypeOf:hu,Promise:pu,SafeSet:fg,SymbolAsyncDispose:ug,SymbolAsyncIterator:dg,Symbol:hg}=q();Au.exports=O;O.ReadableState=vr;var{EventEmitter:pg}=gn(),{Stream:Rt,prependListener:yg}=gr(),{Buffer:Ms}=Ie(),{addAbortSignal:mg}=wn(),yu=bt(),P=re().debuglog("stream",e=>{P=e}),bg=Xf(),Pi=Jt(),{getHighWaterMark:gg,getDefaultHighWaterMark:wg}=Sn(),{aggregateTwoErrors:uu,codes:{ERR_INVALID_ARG_TYPE:Sg,ERR_METHOD_NOT_IMPLEMENTED:Eg,ERR_OUT_OF_RANGE:_g,ERR_STREAM_PUSH_AFTER_EOF:xg,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:kg},AbortError:vg}=ae(),{validateObject:Fg}=ki(),Zt=hg("kPaused"),{StringDecoder:mu}=su(),Ig=Ds();hu(O.prototype,Rt.prototype);hu(O,Rt);var Ws=s(()=>{},"nop"),{errorOrDestroy:Ai}=Pi,Oi=1,Ag=2,bu=4,_n=8,gu=16,_r=32,xr=64,wu=128,Og=256,Pg=512,Tg=1024,$s=2048,zs=4096,Rg=8192,Lg=16384,Ng=32768,Su=65536,Cg=1<<17,Bg=1<<18;function J(e){return{enumerable:!1,get:s(function(){return(this.state&e)!==0},"get"),set:s(function(t){t?this.state|=e:this.state&=~e},"set")}}s(J,"makeBitMapDescriptor");Vs(vr.prototype,{objectMode:J(Oi),ended:J(Ag),endEmitted:J(bu),reading:J(_n),constructed:J(gu),sync:J(_r),needReadable:J(xr),emittedReadable:J(wu),readableListening:J(Og),resumeScheduled:J(Pg),errorEmitted:J(Tg),emitClose:J($s),autoDestroy:J(zs),destroyed:J(Rg),closed:J(Lg),closeEmitted:J(Ng),multiAwaitDrain:J(Su),readingMore:J(Cg),dataEmitted:J(Bg)});function vr(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.state=$s|zs|gu|_r,e&&e.objectMode&&(this.state|=Oi),i&&e&&e.readableObjectMode&&(this.state|=Oi),this.highWaterMark=e?gg(this,e,"readableHighWaterMark",i):wg(!1),this.buffer=new bg,this.length=0,this.pipes=[],this.flowing=null,this[Zt]=null,e&&e.emitClose===!1&&(this.state&=~$s),e&&e.autoDestroy===!1&&(this.state&=~zs),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new mu(e.encoding),this.encoding=e.encoding)}s(vr,"ReadableState");function O(e){if(!(this instanceof O))return new O(e);let t=this instanceof rt();this._readableState=new vr(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&mg(e.signal,this)),Rt.call(this,e),Pi.construct(this,()=>{this._readableState.needReadable&&kr(this,this._readableState)})}s(O,"Readable");O.prototype.destroy=Pi.destroy;O.prototype._undestroy=Pi.undestroy;O.prototype._destroy=function(e,t){t(e)};O.prototype[pg.captureRejectionSymbol]=function(e){this.destroy(e)};O.prototype[ug]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new vg,this.destroy(e)),new pu((t,i)=>yu(this,n=>n&&n!==e?i(n):t(null)))};O.prototype.push=function(e,t){return Eu(this,e,t,!1)};O.prototype.unshift=function(e,t){return Eu(this,e,t,!0)};function Eu(e,t,i,n){P("readableAddChunk",t);let r=e._readableState,o;if(r.state&Oi||(typeof t=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?t=Ms.from(t,i).toString(r.encoding):(t=Ms.from(t,i),i=""))):t instanceof Ms?i="":Rt._isUint8Array(t)?(t=Rt._uint8ArrayToBuffer(t),i=""):t!=null&&(o=new Sg("chunk",["string","Buffer","Uint8Array"],t))),o)Ai(e,o);else if(t===null)r.state&=~_n,Wg(e,r);else if(r.state&Oi||t&&t.length>0)if(n)if(r.state&bu)Ai(e,new kg);else{if(r.destroyed||r.errored)return!1;Us(e,r,t,!0)}else if(r.ended)Ai(e,new xg);else{if(r.destroyed||r.errored)return!1;r.state&=~_n,r.decoder&&!i?(t=r.decoder.write(t),r.objectMode||t.length!==0?Us(e,r,t,!1):kr(e,r)):Us(e,r,t,!1)}else n||(r.state&=~_n,kr(e,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(Eu,"readableAddChunk");function Us(e,t,i,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&Su?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.state&xr&&Fr(e)),kr(e,t)}s(Us,"addChunk");O.prototype.isPaused=function(){let e=this._readableState;return e[Zt]===!0||e.flowing===!1};O.prototype.setEncoding=function(e){let t=new mu(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=t.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var Dg=1073741824;function Mg(e){if(e>Dg)throw new _g("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}s(Mg,"computeNewHighWaterMark");function du(e,t){return e<=0||t.length===0&&t.ended?0:t.state&Oi?1:ag(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}s(du,"howMuchToRead");O.prototype.read=function(e){P("read",e),e===void 0?e=NaN:sg(e)||(e=cg(e,10));let t=this._readableState,i=e;if(e>t.highWaterMark&&(t.highWaterMark=Mg(e)),e!==0&&(t.state&=~wu),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return P("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?js(this):Fr(this),null;if(e=du(e,t),e===0&&t.ended)return t.length===0&&js(this),null;let n=(t.state&xr)!==0;if(P("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,P("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,P("reading, ended or constructing",n);else if(n){P("do read"),t.state|=_n|_r,t.length===0&&(t.state|=xr);try{this._read(t.highWaterMark)}catch(o){Ai(this,o)}t.state&=~_r,t.reading||(e=du(i,t))}let r;return e>0?r=Fu(e,t):r=null,r===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&js(this)),r!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",r)),r};function Wg(e,t){if(P("onEofChunk"),!t.ended){if(t.decoder){let i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?Fr(e):(t.needReadable=!1,t.emittedReadable=!0,_u(e))}}s(Wg,"onEofChunk");function Fr(e){let t=e._readableState;P("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,Me.nextTick(_u,e))}s(Fr,"emitReadable");function _u(e){let t=e._readableState;P("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ku(e)}s(_u,"emitReadable_");function kr(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Me.nextTick(Ug,e,t))}s(kr,"maybeReadMore");function Ug(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let i=t.length;if(P("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}s(Ug,"maybeReadMore_");O.prototype._read=function(e){throw new Eg("_read()")};O.prototype.pipe=function(e,t){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new fg(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),P("pipe count=%d opts=%j",n.pipes.length,t);let o=(!t||t.end!==!1)&&e!==Me.stdout&&e!==Me.stderr?c:A;n.endEmitted?Me.nextTick(o):i.once("end",o),e.on("unpipe",a);function a(k,v){P("onunpipe"),k===i&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,d())}s(a,"onunpipe");function c(){P("onend"),e.end()}s(c,"onend");let l,f=!1;function d(){P("cleanup"),e.removeListener("close",w),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",A),i.removeListener("data",b),f=!0,l&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}s(d,"cleanup");function h(){f||(n.pipes.length===1&&n.pipes[0]===e?(P("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(P("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),i.pause()),l||(l=jg(i,e),e.on("drain",l))}s(h,"pause"),i.on("data",b);function b(k){P("ondata");let v=e.write(k);P("dest.write",v),v===!1&&h()}s(b,"ondata");function p(k){if(P("onerror",k),A(),e.removeListener("error",p),e.listenerCount("error")===0){let v=e._writableState||e._readableState;v&&!v.errorEmitted?Ai(e,k):e.emit("error",k)}}s(p,"onerror"),yg(e,"error",p);function w(){e.removeListener("finish",g),A()}s(w,"onclose"),e.once("close",w);function g(){P("onfinish"),e.removeListener("close",w),A()}s(g,"onfinish"),e.once("finish",g);function A(){P("unpipe"),i.unpipe(e)}return s(A,"unpipe"),e.emit("pipe",i),e.writableNeedDrain===!0?h():n.flowing||(P("pipe resume"),i.resume()),e};function jg(e,t){return s(function(){let n=e._readableState;n.awaitDrainWriters===t?(P("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(P("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()},"pipeOnDrainFunctionResult")}s(jg,"pipeOnDrain");O.prototype.unpipe=function(e){let t=this._readableState,i={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let r=t.pipes;t.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=og(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,i),this)};O.prototype.on=function(e,t){let i=Rt.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,P("on readable",n.length,n.reading),n.length?Fr(this):n.reading||Me.nextTick(qg,this)),i};O.prototype.addListener=O.prototype.on;O.prototype.removeListener=function(e,t){let i=Rt.prototype.removeListener.call(this,e,t);return e==="readable"&&Me.nextTick(xu,this),i};O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=function(e){let t=Rt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Me.nextTick(xu,this),t};function xu(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[Zt]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}s(xu,"updateReadableListening");function qg(e){P("readable nexttick read 0"),e.read(0)}s(qg,"nReadingNextTick");O.prototype.resume=function(){let e=this._readableState;return e.flowing||(P("resume"),e.flowing=!e.readableListening,$g(this,e)),e[Zt]=!1,this};function $g(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick(zg,e,t))}s($g,"resume");function zg(e,t){P("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ku(e),t.flowing&&!t.reading&&e.read(0)}s(zg,"resume_");O.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Zt]=!0,this};function ku(e){let t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}s(ku,"flow");O.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{Ai(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let i=lg(e);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof e[r]=="function"&&(this[r]=e[r].bind(e))}return this};O.prototype[dg]=function(){return vu(this)};O.prototype.iterator=function(e){return e!==void 0&&Fg(e,"options"),vu(this,e)};function vu(e,t){typeof e.read!="function"&&(e=O.wrap(e,{objectMode:!0}));let i=Vg(e,t);return i.stream=e,i}s(vu,"streamToAsyncIterator");async function*Vg(e,t){let i=Ws;function n(a){this===e?(i(),i=Ws):i=a}s(n,"next"),e.on("readable",n);let r,o=yu(e,{writable:!1},a=>{r=a?uu(r,a):null,i(),i=Ws});try{for(;;){let a=e.destroyed?null:e.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new pu(n)}}}catch(a){throw r=uu(r,a),r}finally{(r||t?.destroyOnReturn!==!1)&&(r===void 0||e._readableState.autoDestroy)?Pi.destroyer(e,null):(e.off("readable",n),o())}}s(Vg,"createAsyncIterator");Vs(O.prototype,{readable:{__proto__:null,get:s(function(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},"get"),set:s(function(e){this._readableState&&(this._readableState.readable=!!e)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(e){this._readableState&&(this._readableState.flowing=e)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});Vs(vr.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Zt]!==!1},"get"),set:s(function(e){this[Zt]=!!e},"set")}});O._fromList=Fu;function Fu(e,t){if(t.length===0)return null;let i;return t.objectMode?i=t.buffer.shift():!e||e>=t.length?(t.decoder?i=t.buffer.join(""):t.buffer.length===1?i=t.buffer.first():i=t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i}s(Fu,"fromList");function js(e){let t=e._readableState;P("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Me.nextTick(Hg,t,e))}s(js,"endReadable");function Hg(e,t){if(P("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Me.nextTick(Kg,t);else if(e.autoDestroy){let i=t._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&t.destroy()}}}s(Hg,"endReadableNT");function Kg(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}s(Kg,"endWritableNT");O.from=function(e,t){return Ig(O,e,t)};var qs;function Iu(){return qs===void 0&&(qs={}),qs}s(Iu,"lazyWebStreams");O.fromWeb=function(e,t){return Iu().newStreamReadableFromReadableStream(e,t)};O.toWeb=function(e,t){return Iu().newReadableStreamFromStreamReadable(e,t)};O.wrap=function(e,t){var i,n;return new O({objectMode:(i=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&i!==void 0?i:!0,...t,destroy:s(function(r,o){Pi.destroyer(e,r),o(r)},"destroy")}).wrap(e)}});var Tr=T((i0,Uu)=>{var ei=Pt(),{ArrayPrototypeSlice:Tu,Error:Gg,FunctionPrototypeSymbolHasInstance:Ru,ObjectDefineProperty:Lu,ObjectDefineProperties:Yg,ObjectSetPrototypeOf:Nu,StringPrototypeToLowerCase:Xg,Symbol:Jg,SymbolHasInstance:Qg}=q();Uu.exports=$;$.WritableState=Fn;var{EventEmitter:Zg}=gn(),kn=gr().Stream,{Buffer:Ir}=Ie(),Pr=Jt(),{addAbortSignal:ew}=wn(),{getHighWaterMark:tw,getDefaultHighWaterMark:iw}=Sn(),{ERR_INVALID_ARG_TYPE:nw,ERR_METHOD_NOT_IMPLEMENTED:rw,ERR_MULTIPLE_CALLBACK:Cu,ERR_STREAM_CANNOT_PIPE:ow,ERR_STREAM_DESTROYED:vn,ERR_STREAM_ALREADY_FINISHED:sw,ERR_STREAM_NULL_VALUES:aw,ERR_STREAM_WRITE_AFTER_END:cw,ERR_UNKNOWN_ENCODING:Bu}=ae().codes,{errorOrDestroy:Ti}=Pr;Nu($.prototype,kn.prototype);Nu($,kn);function Gs(){}s(Gs,"nop");var Ri=Jg("kOnFinished");function Fn(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.objectMode=!!(e&&e.objectMode),i&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?tw(this,e,"writableHighWaterMark",i):iw(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=fw.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Or(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Ri]=[]}s(Fn,"WritableState");function Or(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}s(Or,"resetBuffer");Fn.prototype.getBuffer=s(function(){return Tu(this.buffered,this.bufferedIndex)},"getBuffer");Lu(Fn.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function $(e){let t=this instanceof rt();if(!t&&!Ru($,this))return new $(e);this._writableState=new Fn(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&ew(e.signal,this)),kn.call(this,e),Pr.construct(this,()=>{let i=this._writableState;i.writing||Xs(this,i),Js(this,i)})}s($,"Writable");Lu($,Qg,{__proto__:null,value:s(function(e){return Ru(this,e)?!0:this!==$?!1:e&&e._writableState instanceof Fn},"value")});$.prototype.pipe=function(){Ti(this,new ow)};function Du(e,t,i,n){let r=e._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!Ir.isEncoding(i))throw new Bu(i);typeof n!="function"&&(n=Gs)}if(t===null)throw new aw;if(!r.objectMode)if(typeof t=="string")r.decodeStrings!==!1&&(t=Ir.from(t,i),i="buffer");else if(t instanceof Ir)i="buffer";else if(kn._isUint8Array(t))t=kn._uint8ArrayToBuffer(t),i="buffer";else throw new nw("chunk",["string","Buffer","Uint8Array"],t);let o;return r.ending?o=new cw:r.destroyed&&(o=new vn("write")),o?(ei.nextTick(n,o),Ti(e,o,!0),o):(r.pendingcb++,lw(e,r,t,i,n))}s(Du,"_write");$.prototype.write=function(e,t,i){return Du(this,e,t,i)===!0};$.prototype.cork=function(){this._writableState.corked++};$.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||Xs(this,e))};$.prototype.setDefaultEncoding=s(function(t){if(typeof t=="string"&&(t=Xg(t)),!Ir.isEncoding(t))throw new Bu(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function lw(e,t,i,n,r){let o=t.objectMode?1:i.length;t.length+=o;let a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:i,encoding:n,callback:r}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&r!==Gs&&(t.allNoop=!1)):(t.writelen=o,t.writecb=r,t.writing=!0,t.sync=!0,e._write(i,n,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}s(lw,"writeOrBuffer");function Ou(e,t,i,n,r,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new vn("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}s(Ou,"doWrite");function Pu(e,t,i,n){--t.pendingcb,n(i),Ys(t),Ti(e,i)}s(Pu,"onwriteError");function fw(e,t){let i=e._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){Ti(e,new Cu);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,t?(t.stack,i.errored||(i.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?ei.nextTick(Pu,e,i,t,r):Pu(e,i,t,r)):(i.buffered.length>i.bufferedIndex&&Xs(e,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:e,state:i},ei.nextTick(uw,i.afterWriteTickInfo)):Mu(e,i,1,r))}s(fw,"onwrite");function uw({stream:e,state:t,count:i,cb:n}){return t.afterWriteTickInfo=null,Mu(e,t,i,n)}s(uw,"afterWriteTick");function Mu(e,t,i,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));i-- >0;)t.pendingcb--,n();t.destroyed&&Ys(t),Js(e,t)}s(Mu,"afterWrite");function Ys(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:o,callback:a}=e.buffered[r],c=e.objectMode?1:o.length;e.length-=c,a((t=e.errored)!==null&&t!==void 0?t:new vn("write"))}let i=e[Ri].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=e.errored)!==null&&n!==void 0?n:new vn("end"))}Or(e)}s(Ys,"errorBuffer");function Xs(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=t,o=i.length-n;if(!o)return;let a=n;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let c=t.allNoop?Gs:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=t.allNoop&&a===0?i:Tu(i,a);l.allBuffers=t.allBuffers,Ou(e,t,!0,t.length,l,"",c),Or(t)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=r?1:c.length;Ou(e,t,!1,d,c,l,f)}while(a<i.length&&!t.writing);a===i.length?Or(t):a>256?(i.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}s(Xs,"clearBuffer");$.prototype._write=function(e,t,i){if(this._writev)this._writev([{chunk:e,encoding:t}],i);else throw new rw("_write()")};$.prototype._writev=null;$.prototype.end=function(e,t,i){let n=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null);let r;if(e!=null){let o=Du(this,e,t);o instanceof Gg&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Js(this,n,!0),n.ended=!0):n.finished?r=new sw("end"):n.destroyed&&(r=new vn("end"))),typeof i=="function"&&(r||n.finished?ei.nextTick(i,r):n[Ri].push(i)),this};function Ar(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}s(Ar,"needFinish");function dw(e,t){let i=!1;function n(r){if(i){Ti(e,r??Cu());return}if(i=!0,t.pendingcb--,r){let o=t[Ri].splice(0);for(let a=0;a<o.length;a++)o[a](r);Ti(e,r,t.sync)}else Ar(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,ei.nextTick(Ks,e,t))}s(n,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(n)}catch(r){n(r)}t.sync=!1}s(dw,"callFinal");function hw(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,dw(e,t)):(t.prefinished=!0,e.emit("prefinish")))}s(hw,"prefinish");function Js(e,t,i){Ar(t)&&(hw(e,t),t.pendingcb===0&&(i?(t.pendingcb++,ei.nextTick((n,r)=>{Ar(r)?Ks(n,r):r.pendingcb--},e,t)):Ar(t)&&(t.pendingcb++,Ks(e,t))))}s(Js,"finishMaybe");function Ks(e,t){t.pendingcb--,t.finished=!0;let i=t[Ri].splice(0);for(let n=0;n<i.length;n++)i[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}s(Ks,"finish");Yg($.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")},writable:{__proto__:null,get:s(function(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},"get"),set:s(function(e){this._writableState&&(this._writableState.writable=!!e)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var pw=Pr.destroy;$.prototype.destroy=function(e,t){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ri].length)&&ei.nextTick(Ys,i),pw.call(this,e,t),this};$.prototype._undestroy=Pr.undestroy;$.prototype._destroy=function(e,t){t(e)};$.prototype[Zg.captureRejectionSymbol]=function(e){this.destroy(e)};var Hs;function Wu(){return Hs===void 0&&(Hs={}),Hs}s(Wu,"lazyWebStreams");$.fromWeb=function(e,t){return Wu().newStreamWritableFromWritableStream(e,t)};$.toWeb=function(e){return Wu().newWritableStreamFromStreamWritable(e)}});var td=T((r0,ed)=>{var Qs=Pt(),yw=Ie(),{isReadable:mw,isWritable:bw,isIterable:ju,isNodeStream:gw,isReadableNodeStream:qu,isWritableNodeStream:$u,isDuplexNodeStream:ww,isReadableStream:zu,isWritableStream:Vu}=tt(),Hu=bt(),{AbortError:Qu,codes:{ERR_INVALID_ARG_TYPE:Sw,ERR_INVALID_RETURN_VALUE:Ku}}=ae(),{destroyer:Ni}=Jt(),Ew=rt(),Zu=xn(),_w=Tr(),{createDeferredPromise:Gu}=re(),Yu=Ds(),Xu=globalThis.Blob||yw.Blob,xw=s(typeof Xu<"u"?function(t){return t instanceof Xu}:function(t){return!1},"isBlob"),kw=globalThis.AbortController||Ei().AbortController,{FunctionPrototypeCall:Ju}=q(),Zs=class Zs extends Ew{constructor(t){super(t),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)}};s(Zs,"Duplexify");var Lt=Zs;ed.exports=s(function e(t,i){if(ww(t))return t;if(qu(t))return Li({readable:t});if($u(t))return Li({writable:t});if(gw(t))return Li({writable:!1,readable:!1});if(zu(t))return Li({readable:Zu.fromWeb(t)});if(Vu(t))return Li({writable:_w.fromWeb(t)});if(typeof t=="function"){let{value:r,write:o,final:a,destroy:c}=vw(t);if(ju(r))return Yu(Lt,r,{objectMode:!0,write:o,final:a,destroy:c});let l=r?.then;if(typeof l=="function"){let f,d=Ju(l,r,h=>{if(h!=null)throw new Ku("nully","body",h)},h=>{Ni(f,h)});return f=new Lt({objectMode:!0,readable:!1,write:o,final:s(function(h){a(async()=>{try{await d,Qs.nextTick(h,null)}catch(b){Qs.nextTick(h,b)}})},"final"),destroy:c})}throw new Ku("Iterable, AsyncIterable or AsyncFunction",i,r)}if(xw(t))return e(t.arrayBuffer());if(ju(t))return Yu(Lt,t,{objectMode:!0,writable:!1});if(zu(t?.readable)&&Vu(t?.writable))return Lt.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let r=t!=null&&t.readable?qu(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?$u(t?.writable)?t?.writable:e(t.writable):void 0;return Li({readable:r,writable:o})}let n=t?.then;if(typeof n=="function"){let r;return Ju(n,t,o=>{o!=null&&r.push(o),r.push(null)},o=>{Ni(r,o)}),r=new Lt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new Sw(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function vw(e){let{promise:t,resolve:i}=Gu(),n=new kw,r=n.signal;return{value:e(async function*(){for(;;){let a=t;t=null;let{chunk:c,done:l,cb:f}=await a;if(Qs.nextTick(f),l)return;if(r.aborted)throw new Qu(void 0,{cause:r.reason});({promise:t,resolve:i}=Gu()),yield c}}(),{signal:r}),write:s(function(a,c,l){let f=i;i=null,f({chunk:a,done:!1,cb:l})},"write"),final:s(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:s(function(a,c){n.abort(),c(a)},"destroy")}}s(vw,"fromAsyncGen");function Li(e){let t=e.readable&&typeof e.readable.read!="function"?Zu.wrap(e.readable):e.readable,i=e.writable,n=!!mw(t),r=!!bw(i),o,a,c,l,f;function d(h){let b=l;l=null,b?b(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Lt({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(Hu(i,h=>{r=!1,h&&Ni(t,h),d(h)}),f._write=function(h,b,p){i.write(h,b)?p():o=p},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),n&&(Hu(t,h=>{n=!1,h&&Ni(t,h),d(h)}),t.on("readable",function(){if(c){let h=c;c=null,h()}}),t.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=t.read();if(h===null){c=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,b){!h&&l!==null&&(h=new Qu),c=null,o=null,a=null,l===null?b(h):(l=b,Ni(i,h),Ni(t,h))},f}s(Li,"_duplexify")});var rt=T((s0,rd)=>{"use strict";var{ObjectDefineProperties:Fw,ObjectGetOwnPropertyDescriptor:gt,ObjectKeys:Iw,ObjectSetPrototypeOf:id}=q();rd.exports=We;var ia=xn(),Le=Tr();id(We.prototype,ia.prototype);id(We,ia);{let e=Iw(Le.prototype);for(let t=0;t<e.length;t++){let i=e[t];We.prototype[i]||(We.prototype[i]=Le.prototype[i])}}function We(e){if(!(this instanceof We))return new We(e);ia.call(this,e),Le.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,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)):this.allowHalfOpen=!0}s(We,"Duplex");Fw(We.prototype,{writable:{__proto__:null,...gt(Le.prototype,"writable")},writableHighWaterMark:{__proto__:null,...gt(Le.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...gt(Le.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...gt(Le.prototype,"writableBuffer")},writableLength:{__proto__:null,...gt(Le.prototype,"writableLength")},writableFinished:{__proto__:null,...gt(Le.prototype,"writableFinished")},writableCorked:{__proto__:null,...gt(Le.prototype,"writableCorked")},writableEnded:{__proto__:null,...gt(Le.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...gt(Le.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")}});var ea;function nd(){return ea===void 0&&(ea={}),ea}s(nd,"lazyWebStreams");We.fromWeb=function(e,t){return nd().newStreamDuplexFromReadableWritablePair(e,t)};We.toWeb=function(e){return nd().newReadableWritablePairFromDuplex(e)};var ta;We.from=function(e){return ta||(ta=td()),ta(e,"body")}});var oa=T((c0,sd)=>{"use strict";var{ObjectSetPrototypeOf:od,Symbol:Aw}=q();sd.exports=wt;var{ERR_METHOD_NOT_IMPLEMENTED:Ow}=ae().codes,ra=rt(),{getHighWaterMark:Pw}=Sn();od(wt.prototype,ra.prototype);od(wt,ra);var In=Aw("kCallback");function wt(e){if(!(this instanceof wt))return new wt(e);let t=e?Pw(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),ra.call(this,e),this._readableState.sync=!1,this[In]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Tw)}s(wt,"Transform");function na(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,i)=>{if(t){e?e(t):this.destroy(t);return}i!=null&&this.push(i),this.push(null),e&&e()}):(this.push(null),e&&e())}s(na,"final");function Tw(){this._final!==na&&na.call(this)}s(Tw,"prefinish");wt.prototype._final=na;wt.prototype._transform=function(e,t,i){throw new Ow("_transform()")};wt.prototype._write=function(e,t,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(e,t,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),r.ended||o===n.length||n.length<n.highWaterMark?i():this[In]=i})};wt.prototype._read=function(){if(this[In]){let e=this[In];this[In]=null,e()}}});var aa=T((f0,cd)=>{"use strict";var{ObjectSetPrototypeOf:ad}=q();cd.exports=Ci;var sa=oa();ad(Ci.prototype,sa.prototype);ad(Ci,sa);function Ci(e){if(!(this instanceof Ci))return new Ci(e);sa.call(this,e)}s(Ci,"PassThrough");Ci.prototype._transform=function(e,t,i){i(null,e)}});var Cr=T((d0,hd)=>{var An=Pt(),{ArrayIsArray:Rw,Promise:Lw,SymbolAsyncIterator:Nw,SymbolDispose:Cw}=q(),Nr=bt(),{once:Bw}=re(),Dw=Jt(),ld=rt(),{aggregateTwoErrors:Mw,codes:{ERR_INVALID_ARG_TYPE:ma,ERR_INVALID_RETURN_VALUE:ca,ERR_MISSING_ARGS:Ww,ERR_STREAM_DESTROYED:Uw,ERR_STREAM_PREMATURE_CLOSE:jw},AbortError:qw}=ae(),{validateFunction:$w,validateAbortSignal:zw}=ki(),{isIterable:ti,isReadable:la,isReadableNodeStream:Lr,isNodeStream:fd,isTransformStream:Bi,isWebStream:Vw,isReadableStream:fa,isReadableFinished:Hw}=tt(),Kw=globalThis.AbortController||Ei().AbortController,ua,da,ha;function ud(e,t,i){let n=!1;e.on("close",()=>{n=!0});let r=Nr(e,{readable:t,writable:i},o=>{n=!o});return{destroy:s(o=>{n||(n=!0,Dw.destroyer(e,o||new Uw("pipe")))},"destroy"),cleanup:r}}s(ud,"destroyer");function Gw(e){return $w(e[e.length-1],"streams[stream.length - 1]"),e.pop()}s(Gw,"popCallback");function pa(e){if(ti(e))return e;if(Lr(e))return Yw(e);throw new ma("val",["Readable","Iterable","AsyncIterable"],e)}s(pa,"makeAsyncIterable");async function*Yw(e){da||(da=xn()),yield*da.prototype[Nw].call(e)}s(Yw,"fromReadable");async function Rr(e,t,i,{end:n}){let r,o=null,a=s(f=>{if(f&&(r=f),o){let d=o;o=null,d()}},"resume"),c=s(()=>new Lw((f,d)=>{r?d(r):o=s(()=>{r?d(r):f()},"onresolve")}),"wait");t.on("drain",a);let l=Nr(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(let f of e)t.write(f)||await c();n&&(t.end(),await c()),i()}catch(f){i(r!==f?Mw(r,f):f)}finally{l(),t.off("drain",a)}}s(Rr,"pumpToNode");async function ya(e,t,i,{end:n}){Bi(t)&&(t=t.writable);let r=t.getWriter();try{for await(let o of e)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(ya,"pumpToWeb");function Xw(...e){return dd(e,Bw(Gw(e)))}s(Xw,"pipeline");function dd(e,t,i){if(e.length===1&&Rw(e[0])&&(e=e[0]),e.length<2)throw new Ww("streams");let n=new Kw,r=n.signal,o=i?.signal,a=[];zw(o,"options.signal");function c(){w(new qw)}s(c,"abort"),ha=ha||re().addAbortListener;let l;o&&(l=ha(o,c));let f,d,h=[],b=0;function p(L){w(L,--b===0)}s(p,"finish");function w(L,F){var B;if(L&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=L),!(!f&&!F)){for(;h.length;)h.shift()(f);(B=l)===null||B===void 0||B[Cw](),n.abort(),F&&(f||a.forEach(Bt=>Bt()),An.nextTick(t,f,d))}}s(w,"finishImpl");let g;for(let L=0;L<e.length;L++){let F=e[L],B=L<e.length-1,Bt=L>0,Ee=B||i?.end!==!1,si=L===e.length-1;if(fd(F)){let le=function(at){at&&at.name!=="AbortError"&&at.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(at)};var v=le;if(s(le,"onError"),Ee){let{destroy:at,cleanup:ro}=ud(F,B,Bt);h.push(at),la(F)&&si&&a.push(ro)}F.on("error",le),la(F)&&si&&a.push(()=>{F.removeListener("error",le)})}if(L===0)if(typeof F=="function"){if(g=F({signal:r}),!ti(g))throw new ca("Iterable, AsyncIterable or Stream","source",g)}else ti(F)||Lr(F)||Bi(F)?g=F:g=ld.from(F);else if(typeof F=="function"){if(Bi(g)){var A;g=pa((A=g)===null||A===void 0?void 0:A.readable)}else g=pa(g);if(g=F(g,{signal:r}),B){if(!ti(g,!0))throw new ca("AsyncIterable",`transform[${L-1}]`,g)}else{var k;ua||(ua=aa());let le=new ua({objectMode:!0}),at=(k=g)===null||k===void 0?void 0:k.then;if(typeof at=="function")b++,at.call(g,Et=>{d=Et,Et!=null&&le.write(Et),Ee&&le.end(),An.nextTick(p)},Et=>{le.destroy(Et),An.nextTick(p,Et)});else if(ti(g,!0))b++,Rr(g,le,p,{end:Ee});else if(fa(g)||Bi(g)){let Et=g.readable||g;b++,Rr(Et,le,p,{end:Ee})}else throw new ca("AsyncIterable or Promise","destination",g);g=le;let{destroy:ro,cleanup:jh}=ud(g,!1,!0);h.push(ro),si&&a.push(jh)}}else if(fd(F)){if(Lr(g)){b+=2;let le=Jw(g,F,p,{end:Ee});la(F)&&si&&a.push(le)}else if(Bi(g)||fa(g)){let le=g.readable||g;b++,Rr(le,F,p,{end:Ee})}else if(ti(g))b++,Rr(g,F,p,{end:Ee});else throw new ma("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else if(Vw(F)){if(Lr(g))b++,ya(pa(g),F,p,{end:Ee});else if(fa(g)||ti(g))b++,ya(g,F,p,{end:Ee});else if(Bi(g))b++,ya(g.readable,F,p,{end:Ee});else throw new ma("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else g=ld.from(F)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&An.nextTick(c),g}s(dd,"pipelineImpl");function Jw(e,t,i,{end:n}){let r=!1;if(t.on("close",()=>{r||i(new jw)}),e.pipe(t,{end:!1}),n){let a=function(){r=!0,t.end()};var o=a;s(a,"endFn"),Hw(e)?An.nextTick(a):e.once("end",a)}else i();return Nr(e,{readable:!0,writable:!1},a=>{let c=e._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?e.once("end",i).once("error",i):i(a)}),Nr(t,{readable:!1,writable:!0},i)}s(Jw,"pipe");hd.exports={pipelineImpl:dd,pipeline:Xw}});var ga=T((p0,wd)=>{"use strict";var{pipeline:Qw}=Cr(),Br=rt(),{destroyer:Zw}=Jt(),{isNodeStream:Dr,isReadable:pd,isWritable:yd,isWebStream:ba,isTransformStream:ii,isWritableStream:md,isReadableStream:bd}=tt(),{AbortError:eS,codes:{ERR_INVALID_ARG_VALUE:gd,ERR_MISSING_ARGS:tS}}=ae(),iS=bt();wd.exports=s(function(...t){if(t.length===0)throw new tS("streams");if(t.length===1)return Br.from(t[0]);let i=[...t];if(typeof t[0]=="function"&&(t[0]=Br.from(t[0])),typeof t[t.length-1]=="function"){let p=t.length-1;t[p]=Br.from(t[p])}for(let p=0;p<t.length;++p)if(!(!Dr(t[p])&&!ba(t[p]))){if(p<t.length-1&&!(pd(t[p])||bd(t[p])||ii(t[p])))throw new gd(`streams[${p}]`,i[p],"must be readable");if(p>0&&!(yd(t[p])||md(t[p])||ii(t[p])))throw new gd(`streams[${p}]`,i[p],"must be writable")}let n,r,o,a,c;function l(p){let w=a;a=null,w?w(p):p?c.destroy(p):!b&&!h&&c.destroy()}s(l,"onfinished");let f=t[0],d=Qw(t,l),h=!!(yd(f)||md(f)||ii(f)),b=!!(pd(d)||bd(d)||ii(d));if(c=new Br({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Dr(f))c._write=function(w,g,A){f.write(w,g)?A():n=A},c._final=function(w){f.end(),r=w},f.on("drain",function(){if(n){let w=n;n=null,w()}});else if(ba(f)){let g=(ii(f)?f.writable:f).getWriter();c._write=async function(A,k,v){try{await g.ready,g.write(A).catch(()=>{}),v()}catch(L){v(L)}},c._final=async function(A){try{await g.ready,g.close().catch(()=>{}),r=A}catch(k){A(k)}}}let p=ii(d)?d.readable:d;iS(p,()=>{if(r){let w=r;r=null,w()}})}if(b){if(Dr(d))d.on("readable",function(){if(o){let p=o;o=null,p()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let p=d.read();if(p===null){o=c._read;return}if(!c.push(p))return}};else if(ba(d)){let w=(ii(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:A}=await w.read();if(!c.push(g))return;if(A){c.push(null);return}}catch{return}}}}return c._destroy=function(p,w){!p&&a!==null&&(p=new eS),o=null,n=null,r=null,a===null?w(p):(a=w,Dr(d)&&Zw(d,p))},c},"compose")});var Od=T((m0,Ea)=>{"use strict";var nS=globalThis.AbortController||Ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:rS,ERR_INVALID_ARG_TYPE:On,ERR_MISSING_ARGS:oS,ERR_OUT_OF_RANGE:sS},AbortError:ot}=ae(),{validateAbortSignal:ni,validateInteger:Sd,validateObject:ri}=ki(),aS=q().Symbol("kWeak"),cS=q().Symbol("kResistStopPropagation"),{finished:lS}=bt(),fS=ga(),{addAbortSignalNoValidate:uS}=wn(),{isWritable:dS,isNodeStream:hS}=tt(),{deprecate:pS}=re(),{ArrayPrototypePush:yS,Boolean:mS,MathFloor:Ed,Number:bS,NumberIsNaN:gS,Promise:_d,PromiseReject:xd,PromiseResolve:wS,PromisePrototypeThen:kd,Symbol:Fd}=q(),Mr=Fd("kEmpty"),vd=Fd("kEof");function SS(e,t){if(t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),hS(e)&&!dS(e))throw new rS("stream",e,"must be writable");let i=fS(this,e);return t!=null&&t.signal&&uS(t.signal,i),i}s(SS,"compose");function Wr(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal");let i=1;t?.concurrency!=null&&(i=Ed(t.concurrency));let n=i-1;return t?.highWaterMark!=null&&(n=Ed(t.highWaterMark)),Sd(i,"options.concurrency",1),Sd(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=re().AbortSignalAny([t?.signal].filter(mS)),a=this,c=[],l={signal:o},f,d,h=!1,b=0;function p(){h=!0,w()}s(p,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&b<i&&c.length<n&&(d(),d=null)}s(g,"maybeResume");async function A(){try{for await(let k of a){if(h)return;if(o.aborted)throw new ot;try{if(k=e(k,l),k===Mr)continue;k=wS(k)}catch(v){k=xd(v)}b+=1,kd(k,w,p),c.push(k),f&&(f(),f=null),!h&&(c.length>=n||b>=i)&&await new _d(v=>{d=v})}c.push(vd)}catch(k){let v=xd(k);kd(v,w,p),c.push(v)}finally{h=!0,f&&(f(),f=null)}}s(A,"pump"),A();try{for(;;){for(;c.length>0;){let k=await c[0];if(k===vd)return;if(o.aborted)throw new ot;k!==Mr&&(yield k),c.shift(),g()}await new _d(k=>{f=k})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(Wr,"map");function ES(e=void 0){return e!=null&&ri(e,"options"),e?.signal!=null&&ni(e.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new ot({cause:e.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(ES,"asIndexedPairs");async function Id(e,t=void 0){for await(let i of Sa.call(this,e,t))return!0;return!1}s(Id,"some");async function _S(e,t=void 0){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);return!await Id.call(this,async(...i)=>!await e(...i),t)}s(_S,"every");async function xS(e,t){for await(let i of Sa.call(this,e,t))return i}s(xS,"find");async function kS(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r),Mr}s(i,"forEachFn");for await(let n of Wr.call(this,i,t));}s(kS,"forEach");function Sa(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r)?n:Mr}return s(i,"filterFn"),Wr.call(this,i,t)}s(Sa,"filter");var _a=class _a extends oS{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(_a,"ReduceAwareErrMissingArgs");var wa=_a;async function vS(e,t,i){var n;if(typeof e!="function")throw new On("reducer",["Function","AsyncFunction"],e);i!=null&&ri(i,"options"),i?.signal!=null&&ni(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let f=new ot(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await lS(this.destroy(f)),f}let o=new nS,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[aS]:this,[cS]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let c=!1;try{for await(let f of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new ot;r?t=await e(t,f,{signal:a}):(t=f,r=!0)}if(!c&&!r)throw new wa}finally{o.abort()}return t}s(vS,"reduce");async function FS(e){e!=null&&ri(e,"options"),e?.signal!=null&&ni(e.signal,"options.signal");let t=[];for await(let n of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new ot(void 0,{cause:e.signal.reason});yS(t,n)}return t}s(FS,"toArray");function IS(e,t){let i=Wr.call(this,e,t);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(IS,"flatMap");function Ad(e){if(e=bS(e),gS(e))return 0;if(e<0)throw new sS("number",">= 0",e);return e}s(Ad,"toIntegerOrInfinity");function AS(e,t=void 0){return t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),e=Ad(e),s(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ot;for await(let o of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ot;e--<=0&&(yield o)}},"drop").call(this)}s(AS,"drop");function OS(e,t=void 0){return t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),e=Ad(e),s(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ot;for await(let o of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ot;if(e-- >0&&(yield o),e<=0)return}},"take").call(this)}s(OS,"take");Ea.exports.streamReturningOperators={asIndexedPairs:pS(ES,"readable.asIndexedPairs will be removed in a future version."),drop:AS,filter:Sa,flatMap:IS,map:Wr,take:OS,compose:SS};Ea.exports.promiseReturningOperators={every:_S,forEach:kS,reduce:vS,toArray:FS,some:Id,find:xS}});var xa=T((g0,Pd)=>{"use strict";var{ArrayPrototypePop:PS,Promise:TS}=q(),{isIterable:RS,isNodeStream:LS,isWebStream:NS}=tt(),{pipelineImpl:CS}=Cr(),{finished:BS}=bt();ka();function DS(...e){return new TS((t,i)=>{let n,r,o=e[e.length-1];if(o&&typeof o=="object"&&!LS(o)&&!RS(o)&&!NS(o)){let a=PS(e);n=a.signal,r=a.end}CS(e,(a,c)=>{a?i(a):t(c)},{signal:n,end:r})})}s(DS,"pipeline");Pd.exports={finished:BS,pipeline:DS}});var ka=T((S0,Wd)=>{var{Buffer:MS}=Ie(),{ObjectDefineProperty:St,ObjectKeys:Ld,ReflectApply:Nd}=q(),{promisify:{custom:Cd}}=re(),{streamReturningOperators:Td,promiseReturningOperators:Rd}=Od(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Bd}}=ae(),WS=ga(),{setDefaultHighWaterMark:US,getDefaultHighWaterMark:jS}=Sn(),{pipeline:Dd}=Cr(),{destroyer:qS}=Jt(),Md=bt(),va=xa(),Pn=tt(),C=Wd.exports=gr().Stream;C.isDestroyed=Pn.isDestroyed;C.isDisturbed=Pn.isDisturbed;C.isErrored=Pn.isErrored;C.isReadable=Pn.isReadable;C.isWritable=Pn.isWritable;C.Readable=xn();for(let e of Ld(Td)){let i=function(...n){if(new.target)throw Bd();return C.Readable.from(Nd(t,this,n))};Fa=i,s(i,"fn");let t=Td[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fa;for(let e of Ld(Rd)){let i=function(...r){if(new.target)throw Bd();return Nd(t,this,r)};Fa=i,s(i,"fn");let t=Rd[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fa;C.Writable=Tr();C.Duplex=rt();C.Transform=oa();C.PassThrough=aa();C.pipeline=Dd;var{addAbortSignal:$S}=wn();C.addAbortSignal=$S;C.finished=Md;C.destroy=qS;C.compose=WS;C.setDefaultHighWaterMark=US;C.getDefaultHighWaterMark=jS;St(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return va},"get")});St(Dd,Cd,{__proto__:null,enumerable:!0,get:s(function(){return va.pipeline},"get")});St(Md,Cd,{__proto__:null,enumerable:!0,get:s(function(){return va.finished},"get")});C.Stream=C;C._isUint8Array=s(function(t){return t instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(t){return MS.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var Ud=T((_0,H)=>{"use strict";var Q=ka(),zS=xa(),VS=Q.Readable.destroy;H.exports=Q.Readable;H.exports._uint8ArrayToBuffer=Q._uint8ArrayToBuffer;H.exports._isUint8Array=Q._isUint8Array;H.exports.isDisturbed=Q.isDisturbed;H.exports.isErrored=Q.isErrored;H.exports.isReadable=Q.isReadable;H.exports.Readable=Q.Readable;H.exports.Writable=Q.Writable;H.exports.Duplex=Q.Duplex;H.exports.Transform=Q.Transform;H.exports.PassThrough=Q.PassThrough;H.exports.addAbortSignal=Q.addAbortSignal;H.exports.finished=Q.finished;H.exports.destroy=Q.destroy;H.exports.destroy=VS;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return zS},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var aE={};Un(aE,{Async:()=>Va,AsyncTransaction:()=>$o,BigIntStats:()=>be,BigIntStatsFs:()=>on,Dir:()=>Ot,Dirent:()=>At,Errno:()=>U,ErrnoError:()=>u,Fetch:()=>iE,FetchFS:()=>Zr,File:()=>qt,FileSystem:()=>pe,InMemory:()=>dn,InMemoryStore:()=>Xn,Index:()=>Jr,IndexFS:()=>Mn,Inode:()=>Ge,MutexLock:()=>to,Mutexed:()=>ec,NoSyncFile:()=>mi,Overlay:()=>rE,OverlayFS:()=>Wn,Port:()=>ZS,PortFS:()=>Xr,PortFile:()=>Bn,PreloadFile:()=>we,ReadStream:()=>Nt,Readonly:()=>Ja,SimpleAsyncStore:()=>Ko,SimpleTransaction:()=>bi,Stats:()=>G,StatsCommon:()=>nn,StatsFs:()=>rn,StoreFS:()=>ln,Sync:()=>oE,SyncTransaction:()=>un,Transaction:()=>fn,UnmutexedOverlayFS:()=>no,WriteStream:()=>Ct,ZenFsType:()=>Ro,__MutexedFS:()=>io,_toUnixTimestamp:()=>ip,access:()=>Sh,accessSync:()=>vl,appendFile:()=>Xd,appendFileSync:()=>ul,attachFS:()=>Wh,checkOptions:()=>lo,chmod:()=>yh,chmodSync:()=>_l,chown:()=>hh,chownSync:()=>Sl,close:()=>Qd,closeSync:()=>It,configure:()=>GS,configureSingle:()=>KS,constants:()=>kt,copyFile:()=>Ah,copyFileSync:()=>os,cp:()=>Rh,cpSync:()=>ss,createReadStream:()=>kh,createWriteStream:()=>vh,credentials:()=>ye,decode:()=>ai,decodeDirListing:()=>$n,default:()=>sE,detachFS:()=>JS,encode:()=>Ne,encodeDirListing:()=>xe,errorMessages:()=>ao,exists:()=>qd,existsSync:()=>Je,fchmod:()=>oh,fchmodSync:()=>nr,fchown:()=>rh,fchownSync:()=>ir,fdatasync:()=>th,fdatasyncSync:()=>yl,flagToMode:()=>sn,flagToNumber:()=>my,flagToString:()=>ol,fs:()=>Cn,fstat:()=>Jd,fstatSync:()=>dl,fsync:()=>eh,fsyncSync:()=>pl,ftruncate:()=>Zd,ftruncateSync:()=>hl,futimes:()=>sh,futimesSync:()=>rr,handleRequest:()=>Dn,isAppendable:()=>pt,isBackend:()=>Vi,isBackendConfig:()=>Hi,isExclusive:()=>cn,isReadable:()=>vt,isStatsEqual:()=>To,isSynchronous:()=>by,isTruncating:()=>an,isWriteable:()=>ge,lchmod:()=>mh,lchmodSync:()=>xl,lchown:()=>ph,lchownSync:()=>El,levenshtein:()=>co,link:()=>fh,linkSync:()=>gl,lopenSync:()=>mn,lstat:()=>zd,lstatSync:()=>es,lutimes:()=>gh,lutimesSync:()=>kl,mkdir:()=>ch,mkdirSync:()=>or,mkdirpSync:()=>pc,mkdtemp:()=>Ih,mkdtempSync:()=>Fl,mount:()=>zt,mountObject:()=>pn,mounts:()=>Pe,normalizeMode:()=>ke,normalizeOptions:()=>ve,normalizePath:()=>x,normalizeTime:()=>Wt,open:()=>Kd,openAsBlob:()=>Nh,openSync:()=>yn,opendir:()=>Th,opendirSync:()=>Ol,parseFlag:()=>M,promises:()=>Nn,randomIno:()=>tn,read:()=>nh,readFile:()=>Gd,readFileSync:()=>tr,readSync:()=>bl,readdir:()=>lh,readdirSync:()=>Si,readlink:()=>dh,readlinkSync:()=>is,readv:()=>Oh,readvSync:()=>Il,realpath:()=>wh,realpathSync:()=>Xe,rename:()=>jd,renameSync:()=>cl,resolveMountConfig:()=>Ui,resolveRemoteMount:()=>eE,rm:()=>Fh,rmSync:()=>rs,rmdir:()=>ah,rmdirSync:()=>ts,rootCredentials:()=>np,rootIno:()=>Ye,setImmediate:()=>Zh,size_max:()=>Oe,stat:()=>$d,statSync:()=>Te,statfs:()=>Lh,statfsSync:()=>Pl,symlink:()=>uh,symlinkSync:()=>wl,truncate:()=>Vd,truncateSync:()=>ll,umount:()=>gi,unlink:()=>Hd,unlinkSync:()=>er,unwatchFile:()=>_h,utimes:()=>bh,utimesSync:()=>ns,version:()=>Qa,watch:()=>xh,watchFile:()=>Eh,write:()=>ih,writeFile:()=>Yd,writeFileSync:()=>bn,writeSync:()=>ml,writev:()=>Ph,writevSync:()=>Al});var U=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EINTR=4]="EINTR",y[y.EIO=5]="EIO",y[y.ENXIO=6]="ENXIO",y[y.EBADF=9]="EBADF",y[y.EAGAIN=11]="EAGAIN",y[y.ENOMEM=12]="ENOMEM",y[y.EACCES=13]="EACCES",y[y.EFAULT=14]="EFAULT",y[y.ENOTBLK=15]="ENOTBLK",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.EXDEV=18]="EXDEV",y[y.ENODEV=19]="ENODEV",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.ENFILE=23]="ENFILE",y[y.EMFILE=24]="EMFILE",y[y.ETXTBSY=26]="ETXTBSY",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.ESPIPE=29]="ESPIPE",y[y.EROFS=30]="EROFS",y[y.EMLINK=31]="EMLINK",y[y.EPIPE=32]="EPIPE",y[y.EDOM=33]="EDOM",y[y.ERANGE=34]="ERANGE",y[y.EDEADLK=35]="EDEADLK",y[y.ENAMETOOLONG=36]="ENAMETOOLONG",y[y.ENOLCK=37]="ENOLCK",y[y.ENOSYS=38]="ENOSYS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ELOOP=40]="ELOOP",y[y.ENOMSG=42]="ENOMSG",y[y.EBADE=52]="EBADE",y[y.EBADR=53]="EBADR",y[y.EXFULL=54]="EXFULL",y[y.ENOANO=55]="ENOANO",y[y.EBADRQC=56]="EBADRQC",y[y.ENOSTR=60]="ENOSTR",y[y.ENODATA=61]="ENODATA",y[y.ETIME=62]="ETIME",y[y.ENOSR=63]="ENOSR",y[y.ENONET=64]="ENONET",y[y.EREMOTE=66]="EREMOTE",y[y.ENOLINK=67]="ENOLINK",y[y.ECOMM=70]="ECOMM",y[y.EPROTO=71]="EPROTO",y[y.EBADMSG=74]="EBADMSG",y[y.EOVERFLOW=75]="EOVERFLOW",y[y.EBADFD=77]="EBADFD",y[y.ESTRPIPE=86]="ESTRPIPE",y[y.ENOTSOCK=88]="ENOTSOCK",y[y.EDESTADDRREQ=89]="EDESTADDRREQ",y[y.EMSGSIZE=90]="EMSGSIZE",y[y.EPROTOTYPE=91]="EPROTOTYPE",y[y.ENOPROTOOPT=92]="ENOPROTOOPT",y[y.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",y[y.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",y[y.ENOTSUP=95]="ENOTSUP",y[y.ENETDOWN=100]="ENETDOWN",y[y.ENETUNREACH=101]="ENETUNREACH",y[y.ENETRESET=102]="ENETRESET",y[y.ETIMEDOUT=110]="ETIMEDOUT",y[y.ECONNREFUSED=111]="ECONNREFUSED",y[y.EHOSTDOWN=112]="EHOSTDOWN",y[y.EHOSTUNREACH=113]="EHOSTUNREACH",y[y.EALREADY=114]="EALREADY",y[y.EINPROGRESS=115]="EINPROGRESS",y[y.ESTALE=116]="ESTALE",y[y.EREMOTEIO=121]="EREMOTEIO",y[y.EDQUOT=122]="EDQUOT",y))(U||{}),ao={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},zi=class zi extends Error{constructor(i,n=ao[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=U[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let n=new zi(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new zi(U[i],ao[U[i]],n,r)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(zi,"ErrnoError");var u=zi;var Jh="/";function hc(e,t){let i="",n=0,r=-1,o=0,a="\0";for(let c=0;c<=e.length;++c){if(c<e.length)a=e[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===c-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",n=0):(i=i.slice(0,l),n=i.length-1-i.lastIndexOf("/")),r=c,o=0;continue}else if(i.length!==0){i="",n=0,r=c,o=0;continue}}t&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+e.slice(r+1,c):i=e.slice(r+1,c),n=c-r-1;r=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(hc,"normalizeString");function _t(...e){let t="";for(let n of[...e.reverse(),Jh])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;let i=t.startsWith("/");return t=hc(t,!i),i?`/${t}`:t.length?t:"/"}s(_t,"resolve");function Qh(e){if(!e.length)return".";let t=e.startsWith("/"),i=e.endsWith("/");return e=hc(e,!t),e.length?(i&&(e+="/"),t?`/${e}`:e):t?"/":i?"./":"."}s(Qh,"normalize");function z(...e){if(!e.length)return".";let t=e.join("/");return t?.length?Qh(t):"."}s(z,"join");function _(e){if(e.length===0)return".";let t=e[0]==="/",i=-1,n=!0;for(let r=e.length-1;r>=1;--r)if(e[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?t?"/":".":t&&i===1?"//":e.slice(0,i)}s(_,"dirname");function D(e,t){let i=0,n=-1,r=!0;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(let c=e.length-1;c>=0;--c)if(e[c]==="/"){if(!r){i=c+1;break}}else a===-1&&(r=!1,a=c+1),o>=0&&(e[c]===t[o]?--o===-1&&(n=c):(o=-1,n=a));return i===n?n=a:n===-1&&(n=e.length),e.slice(i,n)}for(let o=e.length-1;o>=0;--o)if(e[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":e.slice(i,n)}s(D,"basename");function jn(e){let t=e.startsWith("/"),i={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(e.length===0)return i;let n=t?1:0,r=-1,o=0,a=-1,c=!0,l=e.length-1,f=0;for(;l>=n;--l){if(e[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),e[l]==="."?r===-1?r=l:f!==1&&(f=1):r!==-1&&(f=-1)}if(a!==-1){let d=o===0&&t?1:o;r===-1||f===0||f===1&&r===a-1&&r===o+1?i.base=i.name=e.slice(d,a):(i.name=e.slice(d,r),i.base=e.slice(d,a),i.ext=e.slice(r,a))}return o>0?i.dir=e.slice(0,o-1):t&&(i.dir="/"),i}s(jn,"parse");function pc(e,t,i){i.existsSync(e)||(pc(_(e),t,i),i.mkdirSync(e,t))}s(pc,"mkdirpSync");function qn(e,t,i,n,r){return Math.min(e+1,t+1,i+1,n===r?t:t+1)}s(qn,"_min");function co(e,t){if(e===t)return 0;e.length>t.length&&([e,t]=[t,e]);let i=e.length,n=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&e.charCodeAt(r)===t.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=e.charCodeAt(r+b),o[b]=++b;let a,c,l,f,d;for(a=0;a+3<n;){let b=t.charCodeAt(r+(c=a)),p=t.charCodeAt(r+(l=a+1)),w=t.charCodeAt(r+(f=a+2)),g=t.charCodeAt(r+(d=a+3)),A=a+=4;for(let k=0;k<i;){let v=o[i+k],L=o[k];c=qn(L,c,l,b,v),l=qn(c,l,f,p,v),f=qn(l,f,d,w,v),A=qn(f,d,A,g,v),o[k++]=A,d=f,f=l,l=c,c=L}}let h=0;for(;a<n;){let b=t.charCodeAt(r+(c=a));h=++a;for(let p=0;p<i;p++){let w=o[p];o[p]=h=w<c||h<c?w>h?h+1:w+1:b===o[i+p]?c:c+1,c=w}}return h}s(co,"levenshtein");var Zh=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:e=>setTimeout(e,0),ep=new TextEncoder;function Ne(e){if(typeof e!="string")throw new u(22,"Can not encode a non-string");return ep.encode(e)}s(Ne,"encode");var tp=new TextDecoder;function ai(e){if(!(e instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return tp.decode(e)}s(ai,"decode");function $n(e){return JSON.parse(ai(e),(t,i)=>t==""?i:BigInt(i))}s($n,"decodeDirListing");function xe(e){return Ne(JSON.stringify(e,(t,i)=>t==""?i:i.toString()))}s(xe,"encodeDirListing");function ip(e){if(typeof e=="number")return Math.floor(e);if(e instanceof Date)return Math.floor(e.getTime()/1e3);throw new Error("Cannot parse time")}s(ip,"_toUnixTimestamp");function ke(e,t){if(typeof e=="number")return e;if(typeof e=="string"){let i=parseInt(e,8);if(!isNaN(i))return i}if(typeof t=="number")return t;throw new u(22,"Invalid mode: "+e?.toString())}s(ke,"normalizeMode");function Wt(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e*1e3);if(typeof e=="string")return new Date(e);throw new u(22,"Invalid time.")}s(Wt,"normalizeTime");function x(e){if(e=e.toString(),e.includes("\0"))throw new u(22,"Path can not contain null character");if(e.length==0)throw new u(22,"Path can not be empty");return _t(e.replaceAll(/[/\\]+/g,"/"))}s(x,"normalizePath");function ve(e,t="utf8",i,n=0){return typeof e!="object"||e===null?{encoding:typeof e=="string"?e:t??null,flag:i,mode:n}:{encoding:typeof e?.encoding=="string"?e.encoding:t??null,flag:typeof e?.flag=="string"?e.flag:i,mode:ke("mode"in e?e?.mode:null,n)}}s(ve,"normalizeOptions");function Vi(e){return e!=null&&typeof e=="object"&&"isAvailable"in e&&typeof e.isAvailable=="function"&&"create"in e&&typeof e.create=="function"}s(Vi,"isBackend");async function lo(e,t){if(typeof t!="object"||t===null)throw new u(22,"Invalid options");for(let[i,n]of Object.entries(e.options)){let r=t?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(t).filter(c=>!(c in e.options)).map(c=>({str:c,distance:co(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new u(22,`${e.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new u(22,`${e.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(lo,"checkOptions");function Hi(e){return e!=null&&typeof e=="object"&&"backend"in e&&Vi(e.backend)}s(Hi,"isBackendConfig");var ye={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0},np={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Cn={};Un(Cn,{BigIntStatsFs:()=>on,Dir:()=>Ot,Dirent:()=>At,ReadStream:()=>Nt,Stats:()=>G,StatsFs:()=>rn,WriteStream:()=>Ct,access:()=>Sh,accessSync:()=>vl,appendFile:()=>Xd,appendFileSync:()=>ul,chmod:()=>yh,chmodSync:()=>_l,chown:()=>hh,chownSync:()=>Sl,close:()=>Qd,closeSync:()=>It,constants:()=>kt,copyFile:()=>Ah,copyFileSync:()=>os,cp:()=>Rh,cpSync:()=>ss,createReadStream:()=>kh,createWriteStream:()=>vh,exists:()=>qd,existsSync:()=>Je,fchmod:()=>oh,fchmodSync:()=>nr,fchown:()=>rh,fchownSync:()=>ir,fdatasync:()=>th,fdatasyncSync:()=>yl,fstat:()=>Jd,fstatSync:()=>dl,fsync:()=>eh,fsyncSync:()=>pl,ftruncate:()=>Zd,ftruncateSync:()=>hl,futimes:()=>sh,futimesSync:()=>rr,lchmod:()=>mh,lchmodSync:()=>xl,lchown:()=>ph,lchownSync:()=>El,link:()=>fh,linkSync:()=>gl,lopenSync:()=>mn,lstat:()=>zd,lstatSync:()=>es,lutimes:()=>gh,lutimesSync:()=>kl,mkdir:()=>ch,mkdirSync:()=>or,mkdtemp:()=>Ih,mkdtempSync:()=>Fl,mount:()=>zt,mountObject:()=>pn,mounts:()=>Pe,open:()=>Kd,openAsBlob:()=>Nh,openSync:()=>yn,opendir:()=>Th,opendirSync:()=>Ol,promises:()=>Nn,read:()=>nh,readFile:()=>Gd,readFileSync:()=>tr,readSync:()=>bl,readdir:()=>lh,readdirSync:()=>Si,readlink:()=>dh,readlinkSync:()=>is,readv:()=>Oh,readvSync:()=>Il,realpath:()=>wh,realpathSync:()=>Xe,rename:()=>jd,renameSync:()=>cl,rm:()=>Fh,rmSync:()=>rs,rmdir:()=>ah,rmdirSync:()=>ts,stat:()=>$d,statSync:()=>Te,statfs:()=>Lh,statfsSync:()=>Pl,symlink:()=>uh,symlinkSync:()=>wl,truncate:()=>Vd,truncateSync:()=>ll,umount:()=>gi,unlink:()=>Hd,unlinkSync:()=>er,unwatchFile:()=>_h,utimes:()=>bh,utimesSync:()=>ns,watch:()=>xh,watchFile:()=>Eh,write:()=>ih,writeFile:()=>Yd,writeFileSync:()=>bn,writeSync:()=>ml,writev:()=>Ph,writevSync:()=>Al});var za=$i(Ie(),1);var kt={};Un(kt,{COPYFILE_EXCL:()=>Yi,COPYFILE_FICLONE:()=>Dp,COPYFILE_FICLONE_FORCE:()=>Mp,F_OK:()=>Gi,O_APPEND:()=>Ke,O_CREAT:()=>ee,O_DIRECT:()=>Vp,O_DIRECTORY:()=>Up,O_DSYNC:()=>$p,O_EXCL:()=>Ve,O_NOATIME:()=>jp,O_NOCTTY:()=>Wp,O_NOFOLLOW:()=>qp,O_NONBLOCK:()=>Hp,O_RDONLY:()=>di,O_RDWR:()=>ue,O_SYMLINK:()=>zp,O_SYNC:()=>hi,O_TRUNC:()=>He,O_WRONLY:()=>ze,R_OK:()=>Ae,S_IFBLK:()=>ft,S_IFCHR:()=>ut,S_IFDIR:()=>he,S_IFIFO:()=>dt,S_IFLNK:()=>Ce,S_IFMT:()=>K,S_IFREG:()=>de,S_IFSOCK:()=>lt,S_IRGRP:()=>Zp,S_IROTH:()=>iy,S_IRUSR:()=>Xp,S_IRWXG:()=>_o,S_IRWXO:()=>xo,S_IRWXU:()=>Eo,S_ISGID:()=>Gp,S_ISUID:()=>Kp,S_ISVTX:()=>Yp,S_IWGRP:()=>ey,S_IWOTH:()=>ny,S_IWUSR:()=>Jp,S_IXGRP:()=>ty,S_IXOTH:()=>ry,S_IXUSR:()=>Qp,UV_FS_O_FILEMAP:()=>oy,W_OK:()=>X,X_OK:()=>Bp});var Gi=0,Ae=4,X=2,Bp=1,Yi=1,Dp=2,Mp=4,di=0,ze=1,ue=2,ee=64,Ve=128,Wp=256,He=512,Ke=1024,Up=65536,jp=262144,qp=131072,hi=1052672,$p=4096,zp=32768,Vp=16384,Hp=2048,K=61440,lt=49152,Ce=40960,de=32768,ft=24576,he=16384,ut=8192,dt=4096,Kp=2048,Gp=1024,Yp=512,Eo=448,Xp=256,Jp=128,Qp=64,_o=56,Zp=32,ey=16,ty=8,xo=7,iy=4,ny=2,ry=1,oy=0;var Ji=$i(Bc(),1);var Mc,vo=class vo extends Ji.default{constructor(i){super();oo(this,Mc,"List");oo(this,"data",new Set);i&&this.push(...i)}toSet(){return new Set(this.data)}toArray(){return Array.from(this.data)}toJSON(){return JSON.stringify(Array.from(this.data))}toString(){return this.join(",")}set(i,n){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not set an element outside the bounds of the list");let r=Array.from(this.data);r.splice(i,1,n),this.data=new Set(r),this.emit("update")}deleteAt(i){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not delete an element outside the bounds of the list");this.delete(Array.from(this.data).at(i))}at(i){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not access an element outside the bounds of the list");return Array.from(this.data).at(i)}pop(){let i=Array.from(this.data).pop();return i!==void 0&&this.delete(i),i}push(...i){for(let n of i)this.add(n);return this.data.size}join(i){return Array.from(this.data).join(i)}splice(i,n,...r){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not splice elements outside the bounds of the list");let o=Array.from(this.data),a=o.splice(i,n,...r);return this.data=new Set(o),this.emit("update"),a}add(i){return this.data.add(i),this.emit("update"),this}clear(){this.data.clear(),this.emit("update")}delete(i){let n=this.data.delete(i);return this.emit("update"),n}has(i){return this.data.has(i)}get size(){return this.data.size}entries(){return this.data.entries()}keys(){return this.data.keys()}values(){return this.data.values()}[(Mc=Symbol.toStringTag,Symbol.iterator)](){return this.data[Symbol.iterator]()}};s(vo,"List");var Dc=vo;function Wc(e){try{return JSON.parse(e),!0}catch{return!1}}s(Wc,"isJSON");function Qi(e){return e.at(0).toUpperCase()+e.slice(1)}s(Qi,"capitalize");var Uc=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],jc=[...Uc,...Uc.map(e=>Qi(e)),"char"],Gn=/^(u?int|float)(8|16|32|64)$/i;function Fo(e){return e=="char"?"uint8":e.toLowerCase()}s(Fo,"normalize");function Io(e){return Gn.test(e.toString())}s(Io,"isType");function Yn(e){return e=="char"||Gn.test(e.toString().toLowerCase())}s(Yn,"isValid");function qc(e){if(!Yn(e))throw new TypeError("Not a valid primitive type: "+e)}s(qc,"checkValid");var Zi=Symbol("struct_init"),yi=Symbol("struct");function ly(e){return e!=null&&typeof e=="object"&&yi in e}s(ly,"isValidMetadata");Symbol.metadata??=Symbol.for("Symbol.metadata");function fy(e){Symbol?.metadata&&(Symbol.metadata in e||Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)}))}s(fy,"_polyfill_contextMetadata");function pi(e){let t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(i=>i.description=="Symbol.metadata");if(fy(e),!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}s(pi,"symbol_metadata");function en(e){return typeof e=="function"&&pi(e)in e&&ly(e[pi(e)])}s(en,"isStatic");function $c(e){return e!=null&&typeof e=="object"&&en(e.constructor)}s($c,"isInstance");function Ao(e){if(!$c(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct instance")}s(Ao,"checkInstance");function uy(e){return $c(e)||en(e)}s(uy,"isStruct");function zc(e){if(!uy(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct")}s(zc,"checkStruct");function ht(e){if(typeof e=="string")return qc(e),+Fo(e).match(Gn)[2]/8;zc(e);let t=en(e)?e:e.constructor;return t[pi(t)][yi].size}s(ht,"sizeof");function hy(e,t){return Math.ceil(e/t)*t}s(hy,"align");function Hc(e={}){return s(function(i,n){n.metadata??={},n.metadata[Zi]||=[];let r=0,o=new Map;for(let a of n.metadata[Zi]){let{name:c,type:l,length:f}=a;if(!Yn(l)&&!en(l))throw new TypeError("Not a valid type: "+l);o.set(c,{offset:r,type:Yn(l)?Fo(l):l,length:f}),r+=ht(l)*(f||1),r=hy(r,e.align||1)}return n.metadata[yi]={options:e,members:o,size:r},i},"_decorateStruct")}s(Hc,"struct");function Vc(e,t){return function(i,n){let r=n.name;if(typeof r=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+r.toString()),r=r.toString()),!r)throw new ReferenceError("Invalid name for struct member");return n.metadata??={},n.metadata[Zi]||=[],n.metadata[Zi].push({name:r,type:e,length:t}),i}}s(Vc,"member");function Oo(e){Ao(e);let{options:t,members:i}=e.constructor[pi(e.constructor)][yi],n=new Uint8Array(ht(e)),r=new DataView(n.buffer);for(let[o,{type:a,length:c,offset:l}]of i)for(let f=0;f<(c||1);f++){let d=l+ht(a)*f,h=c>0?e[o][f]:e[o];if(typeof h=="string"&&(h=h.charCodeAt(0)),!Io(a)){n.set(h?Oo(h):new Uint8Array(ht(a)),d);continue}let p="set"+Qi(a);if(p=="setInt64"){r.setBigInt64(d,BigInt(h),!t.bigEndian);continue}if(p=="setUint64"){r.setBigUint64(d,BigInt(h),!t.bigEndian);continue}r[p](d,Number(h),!t.bigEndian)}return n}s(Oo,"serialize");function Po(e,t){Ao(e);let{options:i,members:n}=e.constructor[pi(e.constructor)][yi],r=t instanceof Uint8Array?t:new Uint8Array("buffer"in t?t.buffer:t),o=new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));for(let[a,{type:c,offset:l,length:f}]of n)for(let d=0;d<(f||1);d++){let h=f>0?e[a]:e,b=f>0?d:a,p=l+ht(c)*d;if(typeof e[a]=="string"){e[a]=e[a].slice(0,d)+String.fromCharCode(o.getUint8(p))+e[a].slice(d+1);continue}if(!Io(c)){if(h[b]===null||h[b]===void 0)continue;Po(h[b],new Uint8Array(r.slice(p,p+ht(c))));continue}f>0&&(h||=[]);let g="get"+Qi(c);if(g=="getInt64"){h[b]=o.getBigInt64(p,!i.bigEndian);continue}if(g=="getUint64"){h[b]=o.getBigUint64(p,!i.bigEndian);continue}h[b]=o[g](p,!i.bigEndian)}}s(Po,"deserialize");function py(e){function t(i,n){return typeof i=="number"?Vc(e,i):Vc(e)(i,n)}return s(t,"_structMemberDecorator"),t}s(py,"_member");var Be=Object.fromEntries(jc.map(e=>[e,py(e)]));var Oe=2**32-1,Ye=0n;function Kc(){return Math.round(Math.random()*2**32).toString(16)}s(Kc,"_random");function tn(){return BigInt("0x"+Kc()+Kc())}s(tn,"randomIno");var Gc,Yc,Xc,Jc,Qc,Zc,el,tl,il,nl,rl,me;me=[,,,],rl=[Hc()],nl=[Be.uint64],il=[Be.uint32],tl=[Be.uint16],el=[Be.uint32],Zc=[Be.uint32],Qc=[Be.uint32],Jc=[Be.float64],Xc=[Be.float64],Yc=[Be.float64],Gc=[Be.float64];var te=class te{get data(){return Oo(this)}constructor(t){if(t){if(t.byteLength<ht(te))throw new RangeError(`Can not create an inode from a buffer less than ${ht(te)} bytes`);Po(this,t);return}this.ino=tn(),this.nlink=1,this.size=4096;let i=Date.now();this.atimeMs=i,this.mtimeMs=i,this.ctimeMs=i,this.birthtimeMs=i}toStats(){return new G(this)}update(t){let i=!1;return this.size!==t.size&&(this.size=t.size,i=!0),this.mode!==t.mode&&(this.mode=t.mode,i=!0),this.nlink!==t.nlink&&(this.nlink=t.nlink,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.atimeMs!==t.atimeMs&&(this.atimeMs=t.atimeMs,i=!0),this.mtimeMs!==t.mtimeMs&&(this.mtimeMs=t.mtimeMs,i=!0),this.ctimeMs!==t.ctimeMs&&(this.ctimeMs=t.ctimeMs,i=!0),i}};_e(me,5,"ino",nl,te),_e(me,5,"size",il,te),_e(me,5,"mode",tl,te),_e(me,5,"nlink",el,te),_e(me,5,"uid",Zc,te),_e(me,5,"gid",Qc,te),_e(me,5,"atimeMs",Jc,te),_e(me,5,"birthtimeMs",Xc,te),_e(me,5,"mtimeMs",Yc,te),_e(me,5,"ctimeMs",Gc,te),te=_e(me,0,"Inode",rl,te),s(te,"Inode"),dc(me,1,te);var Ge=te;var Lo=class Lo{constructor({atimeMs:t,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:c,mode:l,ino:f}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(t??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(n??d),this.birthtimeMs=this._convert(r??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(t){if(ye.euid===0||ye.egid===0)return!0;let i=(ye.uid==this.uid?448:0)|(ye.gid==this.gid?56:0)|7;return(t&this.mode&i)==t}cred(t=Number(this.uid),i=Number(this.gid)){return{uid:t,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:t,egid:i}}chmod(t){this.mode=this._convert(this.mode&61440|t)}chown(t,i){t=Number(t),i=Number(i),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}};s(Lo,"StatsCommon");var nn=Lo,No=class No extends nn{constructor(){super(...arguments);this._isBigint=!1}};s(No,"Stats");var G=No,Co=class Co extends nn{constructor(){super(...arguments);this._isBigint=!0}};s(Co,"BigIntStats");var be=Co;function To(e,t){return e.size==t.size&&+e.atime==+t.atime&&+e.mtime==+t.mtime&&+e.ctime==+t.ctime&&e.mode==t.mode}s(To,"isStatsEqual");var Ro=525687744115,Bo=class Bo{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Oe;this.ffree=Oe}};s(Bo,"StatsFs");var rn=Bo,Do=class Do{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Oe);this.ffree=BigInt(Oe)}};s(Do,"BigIntStatsFs");var on=Do;var Nn={};Un(Nn,{FileHandle:()=>ce,access:()=>Wa,appendFile:()=>Ta,chmod:()=>Ba,chown:()=>Na,constants:()=>kt,copyFile:()=>Hr,cp:()=>Kr,exists:()=>je,lchmod:()=>Da,lchown:()=>Ca,link:()=>Ra,lstat:()=>jr,lutimes:()=>Ma,mkdir:()=>Ln,mkdtemp:()=>Ua,open:()=>Se,opendir:()=>ja,readFile:()=>Rn,readdir:()=>Ht,readlink:()=>$r,realpath:()=>Ue,rename:()=>Oa,rm:()=>Vr,rmdir:()=>qr,stat:()=>st,statfs:()=>qa,symlink:()=>La,truncate:()=>Pa,unlink:()=>Tn,utimes:()=>zr,watch:()=>HS,writeFile:()=>Mi});var oi=$i(Ie(),1);Promise.withResolvers??=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var yy=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function M(e){if(typeof e=="number")return ol(e);if(!yy.includes(e))throw new Error("Invalid flag string: "+e);return e}s(M,"parseFlag");function ol(e){switch(e){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: "+e)}}s(ol,"flagToString");function my(e){switch(e){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: "+e)}}s(my,"flagToNumber");function sn(e){let t=0;return t<<=1,t+=+vt(e),t<<=1,t+=+ge(e),t<<=1,t}s(sn,"flagToMode");function vt(e){return e.indexOf("r")!==-1||e.indexOf("+")!==-1}s(vt,"isReadable");function ge(e){return e.indexOf("w")!==-1||e.indexOf("a")!==-1||e.indexOf("+")!==-1}s(ge,"isWriteable");function an(e){return e.indexOf("w")!==-1}s(an,"isTruncating");function pt(e){return e.indexOf("a")!==-1}s(pt,"isAppendable");function by(e){return e.indexOf("s")!==-1}s(by,"isSynchronous");function cn(e){return e.indexOf("x")!==-1}s(cn,"isExclusive");var Mo=class Mo{constructor(t,i){this.fs=t;this.path=i}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(Mo,"File");var qt=Mo,Wo=class Wo extends qt{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:Oe}))){super(i,n);this.fs=i;this.flag=r;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;this.closed=!1;if(this.stats.size!=a.byteLength){if(vt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return pt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw u.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw u.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(i){if(this.closed)throw u.With("EBADF",this.path,"File.dispose");if(this.dirty&&!i)throw u.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return Promise.resolve(new G(this.stats))}statSync(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return new G(this.stats)}_truncate(i){if(this.closed)throw u.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i)}async truncate(i){this._truncate(i),await this.sync()}truncateSync(i){this._truncate(i),this.syncSync()}_write(i,n=0,r=this.stats.size,o=this.position){if(this.closed)throw u.With("EBADF",this.path,"File.write");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+r;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 l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:Oe}));l.set(this._buffer),this._buffer=l}let c=i.slice(n,n+r);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,n,r,o){let a=this._write(i,n,r,o);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,o=this.position){let a=this._write(i,n,r,o);return this.syncSync(),a}_read(i,n=0,r=this.stats.size,o){if(this.closed)throw u.With("EBADF",this.path,"File.read");if(!vt(this.flag))throw new u(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,n,r).set(this._buffer.slice(o,a)),c}async read(i,n,r,o){let a=this._read(i,n,r,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,n,r,o){let a=this._read(i,n,r,o);return this.statSync(),a}async chmod(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),await this.sync()}chownSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,await this.sync()}utimesSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}async _setType(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,await this.sync()}_setTypeSync(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}};s(Wo,"PreloadFile");var we=Wo,Uo=class Uo extends we{constructor(t,i,n,r,o){super(t,i,n,r,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};s(Uo,"NoSyncFile");var mi=Uo;var Ft=$i(Ie(),1);var jo=class jo{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Ro}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(i){return i.code!="ENOENT"}}existsSync(t){try{return this.statSync(t),!0}catch(i){return i.code!="ENOENT"}}};s(jo,"FileSystem");var pe=jo;var sl=5,qo=class qo extends pe{constructor(i){super();this.store=i;this._initialized=!1}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,n){var w=[];try{let r=S(w,this.store.transaction(),!0);let o=_(i),a=D(i),c=_(n),l=D(n),f=await this.findINode(r,o),d=await this.getDirListing(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")===0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=await this.findINode(r,c),p=await this.getDirListing(r,b,c));if(p[l]){let L=await this.getINode(r,p[l],n);if(!L.toStats().isFile())throw u.With("EPERM",n,"rename");await r.remove(L.ino),await r.remove(p[l])}p[l]=h;await r.set(f.ino,xe(d));await r.set(b.ino,xe(p));await r.commit()}catch(g){var A=g,k=!0}finally{var v=E(w,A,k);v&&await v}}renameSync(i,n){var w=[];try{let r=S(w,this.store.transaction());let o=_(i),a=D(i),c=_(n),l=D(n),f=this.findINodeSync(r,o),d=this.getDirListingSync(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")==0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=this.findINodeSync(r,c),p=this.getDirListingSync(r,b,c));if(p[l]){let v=this.getINodeSync(r,p[l],n);if(!v.toStats().isFile())throw u.With("EPERM",n,"rename");r.removeSync(v.ino),r.removeSync(p[l])}p[l]=h;r.setSync(f.ino,xe(d));r.setSync(b.ino,xe(p));r.commitSync()}catch(g){var A=g,k=!0}finally{E(w,A,k)}}async stat(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);if(!r)throw u.With("ENOENT",i,"stat");return r.toStats()}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}statSync(i){var r=[];try{let n=S(r,this.store.transaction());return this.findINodeSync(n,i).toStats()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async createFile(i,n,r){let o=await this.commitNew(i,32768,r,new Uint8Array(0));return new we(this,i,n,o.toStats(),new Uint8Array(0))}createFileSync(i,n,r){return this.commitNewSync(i,32768,r),this.openFileSync(i,n)}async openFile(i,n){var c=[];try{let r=S(c,this.store.transaction(),!0);let o=await this.findINode(r,i),a=await r.get(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}openFileSync(i,n){var c=[];try{let r=S(c,this.store.transaction());let o=this.findINodeSync(r,i),a=r.getSync(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}async unlink(i){return this.remove(i,!1)}unlinkSync(i){this.removeSync(i,!1)}async rmdir(i){if((await this.readdir(i)).length)throw u.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0)}rmdirSync(i){if(this.readdirSync(i).length)throw u.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0)}async mkdir(i,n){await this.commitNew(i,16384,n,Ne("{}"))}mkdirSync(i,n){this.commitNewSync(i,16384,n,Ne("{}"))}async readdir(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);return Object.keys(await this.getDirListing(n,r,i))}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}readdirSync(i){var o=[];try{let n=S(o,this.store.transaction());let r=this.findINodeSync(n,i);return Object.keys(this.getDirListingSync(n,r,i))}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async sync(i,n,r){var f=[];try{let o=S(f,this.store.transaction(),!0);let a=await this._findINode(o,_(i),D(i)),c=await this.getINode(o,a,i),l=c.update(r);await o.set(c.ino,n);l&&await o.set(a,c.data);await o.commit()}catch(d){var h=d,b=!0}finally{var p=E(f,h,b);p&&await p}}syncSync(i,n,r){var f=[];try{let o=S(f,this.store.transaction());let a=this._findINodeSync(o,_(i),D(i)),c=this.getINodeSync(o,a,i),l=c.update(r);o.setSync(c.ino,n);l&&o.setSync(a,c.data);o.commitSync()}catch(d){var h=d,b=!0}finally{E(f,h,b)}}async link(i,n){var d=[];try{let r=S(d,this.store.transaction(),!0);let o=_(n),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o);let l=await this._findINode(r,_(i),D(i));let f=await this.getINode(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{var w=E(d,b,p);w&&await w}}linkSync(i,n){var d=[];try{let r=S(d,this.store.transaction());let o=_(n),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o);let l=this._findINodeSync(r,_(i),D(i));let f=this.getINodeSync(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{E(d,b,p)}}async checkRoot(){var r=[];try{let i=S(r,this.store.transaction(),!0);if(await i.get(Ye))return;let n=new Ge;n.mode=16895;await i.set(n.ino,Ne("{}"));await i.set(Ye,n.data);await i.commit()}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}checkRootSync(){var r=[];try{let i=S(r,this.store.transaction());if(i.getSync(Ye))return;let n=new Ge;n.mode=16895;i.setSync(n.ino,Ne("{}"));i.setSync(Ye,n.data);i.commitSync()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async _findINode(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?await this.getINode(i,Ye,n):await this.findINode(i,n,o),l=await this.getDirListing(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}_findINodeSync(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?this.getINodeSync(i,Ye,n):this.findINodeSync(i,n,o),l=this.getDirListingSync(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}async findINode(i,n,r=new Set){let o=await this._findINode(i,_(n),D(n),r);return this.getINode(i,o,n)}findINodeSync(i,n,r=new Set){let o=this._findINodeSync(i,_(n),D(n),r);return this.getINodeSync(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}getINodeSync(i,n,r){let o=i.getSync(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return $n(o)}getDirListingSync(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=i.getSync(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return $n(o)}async addNew(i,n,r){for(let o=0;o<sl;o++){let a=tn();if(!await i.get(a))return await i.set(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}addNewSync(i,n,r){for(let o=0;o<sl;o++){let a=tn();if(!i.getSync(a))return i.setSync(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}async commitNew(i,n,r,o){var b=[];try{let a=S(b,this.store.transaction(),!0);let c=_(i),l=await this.findINode(a,c);let f=D(i),d=await this.getDirListing(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw await a.abort(),u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=await this.addNew(a,o,i);h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;h.size=o.length;d[f]=await this.addNew(a,h.data,i);await a.set(l.ino,xe(d));await a.commit();return h}catch(p){var w=p,g=!0}finally{var A=E(b,w,g);A&&await A}}commitNewSync(i,n,r,o=new Uint8Array){var b=[];try{let a=S(b,this.store.transaction());let c=_(i),l=this.findINodeSync(a,c);let f=D(i),d=this.getDirListingSync(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=this.addNewSync(a,o,i);h.size=o.length;h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;d[f]=this.addNewSync(a,h.data,i);a.setSync(l.ino,xe(d));a.commitSync();return h}catch(p){var w=p,g=!0}finally{E(b,w,g)}}async remove(i,n){var h=[];try{let r=S(h,this.store.transaction(),!0);let o=_(i),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o),l=D(i);if(!c[l])throw u.With("ENOENT",i,"remove");let f=c[l];let d=await this.getINode(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");await r.set(a.ino,xe(c));--d.nlink<1&&(await r.remove(d.ino),await r.remove(f));await r.commit()}catch(b){var p=b,w=!0}finally{var g=E(h,p,w);g&&await g}}removeSync(i,n){var h=[];try{let r=S(h,this.store.transaction());let o=_(i),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o),l=D(i),f=c[l];if(!f)throw u.With("ENOENT",i,"remove");let d=this.getINodeSync(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");r.setSync(a.ino,xe(c));--d.nlink<1&&(r.removeSync(d.ino),r.removeSync(f));r.commitSync()}catch(b){var p=b,w=!0}finally{E(h,p,w)}}};s(qo,"StoreFS");var ln=qo;var zo=class zo{constructor(t){this.store=t;this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}};s(zo,"Transaction");var fn=zo,Vo=class Vo extends fn{async get(t){return this.getSync(t)}async set(t,i){return this.setSync(t,i)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}};s(Vo,"SyncTransaction");var un=Vo,Ho=class Ho extends fn{getSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};s(Ho,"AsyncTransaction");var $o=Ho;var Go=class Go{constructor(){this.cache=new Map;this.queue=new Set}get(t){return this.cache.get(t)}set(t,i){this.cache.set(t,i),this.queue.add(this._set(t,i))}delete(t){this.cache.delete(t),this.queue.add(this._delete(t))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[t,i]of await this.entries())this.cache.has(t)||this.cache.set(t,i);for(let t of this.queue)await t}transaction(){return new bi(this)}};s(Go,"SimpleAsyncStore");var Ko=Go,Yo=class Yo extends un{constructor(){super(...arguments);this.originalData=new Map;this.modifiedKeys=new Set}getSync(i){let n=this.store.get(i);return this.stashOldValue(i,n),n}setSync(i,n){return this.markModified(i),this.store.set(i,n)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){this.done=!0}abortSync(){if(this.done){for(let i of this.modifiedKeys){let n=this.originalData.get(i);n?this.store.set(i,n):this.store.delete(i)}this.done=!0}}stashOldValue(i,n){this.originalData.has(i)||this.originalData.set(i,n)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};s(Yo,"SimpleTransaction");var bi=Yo;var Xo=class Xo extends Map{constructor(i="tmp"){super();this.name=i}async sync(){}clearSync(){this.clear()}transaction(){return new bi(this)}};s(Xo,"InMemoryStore");var Xn=Xo,gy={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:e}){let t=new ln(new Xn(e));return t.checkRootSync(),t},"create")},dn=gy;var $t=new Map,wy=100;function hn(e){let t=wy++;return $t.set(t,e),t}s(hn,"file2fd");function j(e){if(!$t.has(e))throw new u(9);return $t.get(e)}s(j,"fd2file");var Pe=new Map;zt("/",dn.create({name:"root"}));function zt(e,t){if(e[0]!=="/"&&(e="/"+e),e=_t(e),Pe.has(e))throw new u(22,"Mount point "+e+" is already in use.");Pe.set(e,t)}s(zt,"mount");function gi(e){if(e[0]!=="/"&&(e=`/${e}`),e=_t(e),!Pe.has(e))throw new u(22,"Mount point "+e+" is already unmounted.");Pe.delete(e)}s(gi,"umount");function R(e){e=x(e);let t=[...Pe].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of t)if(i.length<=e.length&&e.startsWith(i))return e=e.slice(i.length>1?i.length:0),e===""&&(e="/"),{fs:n,path:e,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(R,"resolveMount");function al(e,t){for(let[i,n]of Object.entries(t))e=e?.replaceAll(i,n);return e}s(al,"fixPaths");function Y(e,t){return typeof e.stack=="string"&&(e.stack=al(e.stack,t)),e.message=al(e.message,t),e}s(Y,"fixError");function pn(e){"/"in e&&gi("/");for(let[t,i]of Object.entries(e))zt(t,i)}s(pn,"mountObject");function Jn(e,t){let i=e.metadata(),n=i.blockSize||4096;return{type:(t?BigInt:Number)(i.type),bsize:(t?BigInt:Number)(n),ffree:(t?BigInt:Number)(i.freeNodes||Oe),files:(t?BigInt:Number)(i.totalNodes||Oe),bavail:(t?BigInt:Number)(i.freeSpace/n),bfree:(t?BigInt:Number)(i.freeSpace/n),blocks:(t?BigInt:Number)(i.totalSpace/n)}}s(Jn,"_statfs");var Jo=class Jo extends Ji.default{constructor(i){super();this.path=i}off(i,n,r,o){return super.off(i,n,r,o)}removeListener(i,n,r,o){return super.removeListener(i,n,r,o)}setMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw u.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw u.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw u.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}};s(Jo,"Watcher");var Qn=Jo,Qo=class Qo extends Qn{constructor(i,n){super(i);this.options=n;Sy(i.toString(),this)}close(){super.emit("close"),Ey(this.path.toString(),this)}[Symbol.dispose](){this.close()}};s(Qo,"FSWatcher");var wi=Qo,Zo=class Zo extends Qn{constructor(i,n){super(i);this.options=n;this.start()}onInterval(){try{let i=Te(this.path);To(this.previous,i)||(this.emit("change",i,this.previous),this.previous=i)}catch(i){this.emit("error",i)}}start(){let i=this.options.interval||5e3;try{this.previous=Te(this.path)}catch(n){this.emit("error",n);return}this.intervalId=setInterval(this.onInterval.bind(this),i),!this.options.persistent&&typeof this.intervalId=="object"&&this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}};s(Zo,"StatWatcher");var Zn=Zo,De=new Map;function Sy(e,t){let i=x(e);De.has(i)||De.set(i,new Set),De.get(i).add(t)}s(Sy,"addWatcher");function Ey(e,t){let i=x(e);De.has(i)&&(De.get(i).delete(t),De.get(i).size===0&&De.delete(i))}s(Ey,"removeWatcher");function W(e,t){let i=x(t);if(De.has(i))for(let r of De.get(i))r.emit("change",e,D(t));let n=_(i);for(;n!==i&&n!=="/";){if(De.has(n))for(let r of De.get(n))r.emit("change",e,D(t));i=n,n=_(n)}}s(W,"emitChange");function cl(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!Te(_(e)).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i===n){i.fs.renameSync(i.path,n.path),W("rename",e.toString());return}bn(t,tr(e)),er(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(cl,"renameSync");function Je(e){e=x(e);try{let{fs:t,path:i}=R(Xe(e));return t.existsSync(i)}catch(t){if(t.errno==2)return!1;throw t}}s(Je,"existsSync");function Te(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e);try{let r=i.statSync(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(Te,"statSync");function es(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=i.statSync(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(es,"lstatSync");function ll(e,t=0){var n=[];try{let i=S(n,Vt(e,"r+"));t||=0;if(t<0)throw new u(22);i.truncateSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}s(ll,"truncateSync");function er(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"unlink");t.unlinkSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(er,"unlinkSync");function Vt(e,t,i,n=!0){e=x(e);let r=ke(i,420),o=M(t);e=n&&Je(e)?Xe(e):e;let{fs:a,path:c}=R(e);if(!a.existsSync(c)){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=a.statSync(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return a.createFileSync(c,o,r)}let l=a.statSync(c);if(!l.hasAccess(r)||!l.hasAccess(sn(o)))throw u.With("EACCES",e,"_open");if(cn(o))throw u.With("EEXIST",e,"_open");let f=a.openFileSync(c,o);return an(o)&&(f.truncateSync(0),f.syncSync()),f}s(Vt,"_openSync");function yn(e,t,i=0){return hn(Vt(e,t,i,!0))}s(yn,"openSync");function mn(e,t,i){return hn(Vt(e,t,i,!1))}s(mn,"lopenSync");function fl(e,t,i){var a=[];try{let n=S(a,Vt(e,t,420,i));let r=n.statSync();let o=new Uint8Array(r.size);n.readSync(o,0,r.size,0);return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}s(fl,"_readFileSync");function tr(e,t={}){let i=ve(t,null,"r",420),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed to readFile must allow for reading.");let r=Ft.Buffer.from(fl(typeof e=="number"?j(e).path:e.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(tr,"readFileSync");function bn(e,t,i={}){var c=[];try{let n=ve(i,"utf8","w+",420);let r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new u(22,"Data not specified");let a=S(c,Vt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength,0);W("change",e.toString())}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(bn,"writeFileSync");function ul(e,t,i={}){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,Vt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(ul,"appendFileSync");function dl(e,t){let i=j(e).statSync();return t?.bigint?new be(i):i}s(dl,"fstatSync");function It(e){j(e).closeSync(),$t.delete(e)}s(It,"closeSync");function hl(e,t=0){if(t||=0,t<0)throw new u(22);j(e).truncateSync(t)}s(hl,"ftruncateSync");function pl(e){j(e).syncSync()}s(pl,"fsyncSync");function yl(e){j(e).datasyncSync()}s(yl,"fdatasyncSync");function ml(e,t,i,n,r){let o,a,c,l;if(typeof t=="string"){l=typeof i=="number"?i:null;let h=typeof n=="string"?n:"utf8";a=0,o=Ft.Buffer.from(t,h),c=o.byteLength}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,l=typeof r=="number"?r:null;let f=j(e);l??=f.position;let d=f.writeSync(o,a,c,l);return W("change",f.path),d}s(ml,"writeSync");function bl(e,t,i,n,r){let o=j(e),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=o.position),o.readSync(t,a,n,r)}s(bl,"readSync");function ir(e,t,i){j(e).chownSync(t,i)}s(ir,"fchownSync");function nr(e,t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");j(e).chmodSync(i)}s(nr,"fchmodSync");function rr(e,t,i){j(e).utimesSync(Wt(t),Wt(i))}s(rr,"futimesSync");function ts(e){e=x(e);let{fs:t,path:i}=R(Je(e)?Xe(e):e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"rmdir");t.rmdirSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(ts,"rmdirSync");function or(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=Je(e)?Xe(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!n.statSync(_(r)).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");return n.mkdirSync(r,i)}let a=[];for(let c=r,l=e;!n.existsSync(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!n.statSync(_(c)).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");n.mkdirSync(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(or,"mkdirSync");function Si(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e),r;if(!Te(e).hasAccess(4))throw u.With("EACCES",e,"readdir");try{r=i.readdirSync(n)}catch(o){throw Y(o,{[n]:e})}for(let o of Pe.keys()){if(!o.startsWith(e))continue;let a=o.slice(e.length);a.includes("/")||a.length==0||r.push(a)}return r.map(o=>typeof t=="object"&&t?.withFileTypes?new At(o,Te(z(e.toString(),o))):t=="buffer"||typeof t=="object"&&t?.encoding=="buffer"?Ft.Buffer.from(o):o)}s(Si,"readdirSync");function gl(e,t){if(e=x(e),!Te(_(e)).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!Te(_(t)).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!i.statSync(n).hasAccess(2))throw u.With("EACCES",n,"link");return i.linkSync(n,t)}catch(o){throw Y(o,{[n]:e,[r.path]:t})}}s(gl,"linkSync");function wl(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(Je(t))throw u.With("EEXIST",t.toString(),"symlink");bn(t,e.toString()),Vt(t,"r+",420,!1)._setTypeSync(40960)}s(wl,"symlinkSync");function is(e,t){let i=Ft.Buffer.from(fl(e.toString(),"r",!1)),n=typeof t=="object"?t?.encoding:t;return n=="buffer"?i:i.toString(n)}s(is,"readlinkSync");function Sl(e,t,i){let n=yn(e,"r+");ir(n,t,i),It(n)}s(Sl,"chownSync");function El(e,t,i){let n=mn(e,"r+");ir(n,t,i),It(n)}s(El,"lchownSync");function _l(e,t){let i=yn(e,"r+");nr(i,t),It(i)}s(_l,"chmodSync");function xl(e,t){let i=mn(e,"r+");nr(i,t),It(i)}s(xl,"lchmodSync");function ns(e,t,i){let n=yn(e,"r+");rr(n,t,i),It(n)}s(ns,"utimesSync");function kl(e,t,i){let n=mn(e,"r+");rr(n,t,i),It(n)}s(kl,"lutimesSync");function Xe(e,t){e=x(e);let{base:i,dir:n}=jn(e),r=z(n=="/"?"/":Xe(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return o.statSync(a).isSymbolicLink()?Xe(c+is(r,t).toString()):r}catch(l){throw Y(l,{[a]:r})}}s(Xe,"realpathSync");function vl(e,t=384){if(!Te(e).hasAccess(t))throw new u(13)}s(vl,"accessSync");function rs(e,t){switch(e=x(e),Te(e).mode&61440){case 16384:if(t?.recursive)for(let n of Si(e))rs(z(e,n),t);ts(e);return;case 32768:case 40960:er(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(rs,"rmSync");function Fl(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return or(r),i=="buffer"?Ft.Buffer.from(r):r}s(Fl,"mkdtempSync");function os(e,t,i){if(e=x(e),t=x(t),i&&i&1&&Je(t))throw new u(17,"Destination file already exists.",t,"copyFile");bn(t,tr(e)),W("rename",t.toString())}s(os,"copyFileSync");function Il(e,t,i){let n=j(e),r=0;for(let o of t)r+=n.readSync(o,0,o.byteLength,i+r);return r}s(Il,"readvSync");function Al(e,t,i){let n=j(e),r=0;for(let o of t)r+=n.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+r);return r}s(Al,"writevSync");function Ol(e,t){return e=x(e),new Ot(e)}s(Ol,"opendirSync");function ss(e,t,i){e=x(e),t=x(t);let n=es(e);if(i?.errorOnExist&&Je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");or(t,{recursive:!0});for(let r of Si(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||ss(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:os(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&ns(t,n.atime,n.mtime)}s(ss,"cpSync");function Pl(e,t){e=x(e);let{fs:i}=R(e);return Jn(i,t?.bigint)}s(Pl,"statfsSync");var as=class as{constructor(t,i){this.path=t;this.stats=i}get name(){return D(this.path)}get parentPath(){return this.path}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(as,"Dirent");var At=as,cs=class cs{constructor(t){this.path=t;this.closed=!1}checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??=await Ht(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then(i=>t(void 0,i))}readSync(){return this.checkClosed(),this._entries??=Si(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}async next(){let t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}};s(cs,"Dir");var Ot=cs;var Ur=$i(Ud(),1);var Ia=class Ia extends Ur.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};s(Ia,"ReadStream");var Nt=Ia,Aa=class Aa extends Ur.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};s(Aa,"WriteStream");var Ct=Aa;var $a=class $a{constructor(t){let i=typeof t!="number";this.fd=i?hn(t):t,this.file=i?t:j(t)}async chown(t,i){await this.file.chown(t,i),W("change",this.file.path)}async chmod(t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");await this.file.chmod(i),W("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||=0,t<0)throw new u(22);await this.file.truncate(t),W("change",this.file.path)}async utimes(t,i){await this.file.utimes(Wt(t),Wt(i)),W("change",this.file.path)}async appendFile(t,i={}){let n=ve(i,"utf8","a",420),r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length),W("change",this.file.path)}read(t,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(t,i,n,r)}async readFile(t){let i=ve(t,null,"r",292),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(r),0,r,0),a=oi.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(t={}){let i=s(async r=>{try{let c=0,l=0,f=NaN;for(;f>0;){let d=await this.read(new Uint8Array(65536),0,65536,l);if(!d.bytesRead){r.close();return}if(r.enqueue(d.buffer.slice(0,d.bytesRead)),l+=d.bytesRead,++c>=1e7)throw new u(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=d.bytesRead}}catch(o){r.error(o)}},"start"),n=globalThis;if(!("ReadableStream"in n))throw new u(38,"ReadableStream is missing on globalThis");return new n.ReadableStream({start:i,type:t.type})}readLines(t){throw u.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){let i=await this.file.stat();if(!i.hasAccess(4))throw u.With("EACCES",this.file.path,"stat");return t?.bigint?new be(i):i}async write(t,i,n,r){let o,a,c;if(typeof t=="string"){r=typeof i=="number"?i:null;let f=typeof n=="string"?n:"utf8";a=0,o=oi.Buffer.from(t,f),c=o.length}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,r=typeof r=="number"?r:null;r??=this.file.position;let l=await this.file.write(o,a,c,r);return W("change",this.file.path),{buffer:o,bytesWritten:l}}async writeFile(t,i={}){let n=ve(i,"utf8","w",420),r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length,0),W("change",this.file.path)}async close(){await this.file.close(),$t.delete(this.fd)}async writev(t,i){let n=0;for(let r of t)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,i){let n=0;for(let r of t)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){let i=new Nt({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:s(async n=>{try{let r=await this.read(new Uint8Array(n),0,n,this.file.position);i.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),this.file.position+=r.bytesRead}catch(r){i.destroy(r)}},"read")});return i.path=this.file.path,i}createWriteStream(t){let i={highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:s(async(r,o,a)=>{try{let{bytesWritten:c}=await this.write(r,null,o);a(c==r.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},n=new Ct(i);return n.path=this.file.path,n}};s($a,"FileHandle");var ce=$a;async function Oa(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!(await st(_(e))).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path),W("rename",e.toString());return}await Mi(t,await Rn(e)),await Tn(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(Oa,"rename");async function je(e){try{let{fs:t,path:i}=R(await Ue(e));return await t.exists(i)}catch(t){if(t instanceof u&&t.code=="ENOENT")return!1;throw t}}s(je,"exists");async function st(e,t){e=x(e);let{fs:i,path:n}=R(await je(e)?await Ue(e):e);try{let r=await i.stat(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(st,"stat");async function jr(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=await i.stat(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(jr,"lstat");async function Pa(e,t=0){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.truncate(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Pa,"truncate");async function Tn(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"unlink");await t.unlink(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(Tn,"unlink");async function Di(e,t,i=420,n){e=x(e);let r=ke(i,420),o=M(t);e=n&&await je(e)?await Ue(e):e;let{fs:a,path:c}=R(e),l=await a.stat(c).catch(()=>null);if(!l){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=await a.stat(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return new ce(await a.createFile(c,o,r))}if(!l.hasAccess(sn(o)))throw u.With("EACCES",e,"_open");if(cn(o))throw u.With("EEXIST",e,"_open");let f=new ce(await a.openFile(c,o));return an(o)&&(await f.truncate(0),await f.sync()),f}s(Di,"_open");async function Se(e,t="r",i=420){return await Di(e,t,i,!0)}s(Se,"open");async function Rn(e,t){var r=[];try{let i=ve(t,null,"r",420);let n=S(r,typeof e=="object"&&"fd"in e?e:await Se(e,i.flag,i.mode),!0);return await n.readFile(i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Rn,"readFile");async function Mi(e,t,i){var a=[];try{let n=ve(i,"utf8","w+",420);let r=S(a,e instanceof ce?e:await Se(e.toString(),n.flag,n.mode),!0);let o=t;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,n)}catch(c){var l=c,f=!0}finally{var d=E(a,l,f);d&&await d}}s(Mi,"writeFile");async function Ta(e,t,i){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,typeof e=="object"&&"fd"in e?e:await Se(e,n.flag,n.mode),!0);await a.appendFile(o,n)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}s(Ta,"appendFile");async function qr(e){e=x(e),e=await je(e)?await Ue(e):e;let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"rmdir");await t.rmdir(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(qr,"rmdir");async function Ln(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=await je(e)?await Ue(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!(await n.stat(_(r))).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");await n.mkdir(r,i),W("rename",e.toString());return}let a=[];for(let c=r,l=e;!await n.exists(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!(await n.stat(_(c))).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");await n.mkdir(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(Ln,"mkdir");async function Ht(e,t){if(e=x(e),!(await st(e)).hasAccess(4))throw u.With("EACCES",e,"readdir");e=await je(e)?await Ue(e):e;let{fs:i,path:n}=R(e),r;try{r=await i.readdir(n)}catch(a){throw Y(a,{[n]:e})}for(let a of Pe.keys())if(a.startsWith(e)){let c=a.slice(e.length);if(c.includes("/")||c.length==0)continue;r.push(c)}let o=[];for(let a of r)o.push(typeof t=="object"&&t?.withFileTypes?new At(a,await st(z(e,a))):a);return o}s(Ht,"readdir");async function Ra(e,t){if(e=x(e),!(await st(_(e))).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!(await st(_(t))).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!(await i.stat(n)).hasAccess(2))throw u.With("EACCES",n,"link");return await i.link(n,r.path)}catch(o){throw Y(o,{[r.path]:t,[n]:e})}}s(Ra,"link");async function La(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await je(t))throw u.With("EEXIST",t.toString(),"symlink");await Mi(t,e.toString()),await(await Di(t,"r+",420,!1)).file._setType(40960)}s(La,"symlink");async function $r(e,t){var o=[];try{let i=S(o,await Di(x(e),"r",420,!1),!0);let n=await i.readFile();let r=typeof t=="object"?t?.encoding:t;return r=="buffer"?n:n.toString(r)}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}s($r,"readlink");async function Na(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Na,"chown");async function Ca(e,t,i){var r=[];try{let n=S(r,await Di(e,"r+",420,!1),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Ca,"lchown");async function Ba(e,t){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Ba,"chmod");async function Da(e,t){var n=[];try{let i=S(n,await Di(e,"r+",420,!1),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Da,"lchmod");async function zr(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.utimes(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(zr,"utimes");async function Ma(e,t,i){var r=[];try{let n=S(r,await Di(e,"r+",420,!1),!0);await n.utimes(new Date(t),new Date(i))}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Ma,"lutimes");async function Ue(e,t){e=x(e);let{base:i,dir:n}=jn(e),r=z(n=="/"?"/":await Ue(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return(await o.stat(a)).isSymbolicLink()?Ue(c+await $r(r)):r}catch(l){throw Y(l,{[a]:r})}}s(Ue,"realpath");function HS(e,t={}){return{[Symbol.asyncIterator](){let i=new wi(e.toString(),typeof t!="string"?t:{encoding:t});function n(r){return function(){let o=Promise.withResolvers();return i.on("change",(a,c)=>{o.resolve({value:{eventType:a,filename:c},done:r})}),o.promise}}return s(n,"withDone"),{next:n(!1),return:n(!0),throw:n(!0)}}}}s(HS,"watch");async function Wa(e,t=0){if(!(await st(e)).hasAccess(t))throw new u(13)}s(Wa,"access");async function Vr(e,t){switch(e=x(e),(await st(e)).mode&61440){case 16384:if(t?.recursive)for(let n of await Ht(e))await Vr(z(e,n),t);await qr(e);return;case 32768:case 40960:await Tn(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(Vr,"rm");async function Ua(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await Ln(r),i=="buffer"?oi.Buffer.from(r):r}s(Ua,"mkdtemp");async function Hr(e,t,i){if(e=x(e),t=x(t),i&&i&1&&await je(t))throw new u(17,"Destination file already exists.",t,"copyFile");await Mi(t,await Rn(e)),W("rename",t.toString())}s(Hr,"copyFile");async function ja(e,t){return e=x(e),new Ot(e)}s(ja,"opendir");async function Kr(e,t,i){e=x(e),t=x(t);let n=await jr(e);if(i?.errorOnExist&&await je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");await Ln(t,{recursive:!0});for(let r of await Ht(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||await Kr(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:await Hr(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&await zr(t,n.atime,n.mtime)}s(Kr,"cp");async function qa(e,t){e=x(e);let{fs:i}=R(e);return Jn(i,t?.bigint)}s(qa,"statfs");var I=s(()=>{},"nop");function jd(e,t,i=I){Oa(e,t).then(()=>i()).catch(i)}s(jd,"rename");function qd(e,t=I){je(e).then(t).catch(()=>t(!1))}s(qd,"exists");function $d(e,t,i=I){i=typeof t=="function"?t:i,st(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s($d,"stat");function zd(e,t,i=I){i=typeof t=="function"?t:i,jr(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(zd,"lstat");function Vd(e,t=0,i=I){i=typeof t=="function"?t:i,Pa(e,typeof t=="number"?t:0).then(()=>i()).catch(i)}s(Vd,"truncate");function Hd(e,t=I){Tn(e).then(()=>t()).catch(t)}s(Hd,"unlink");function Kd(e,t,i,n=I){let r=ke(i,420);n=typeof i=="function"?i:n,Se(e,t,r).then(o=>n(void 0,o.fd)).catch(n)}s(Kd,"open");function Gd(e,t,i=I){i=typeof t=="function"?t:i,Rn(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(Gd,"readFile");function Yd(e,t,i,n=I){n=typeof i=="function"?i:n,Mi(e,t,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(Yd,"writeFile");function Xd(e,t,i,n=I){let r=typeof i!="function"?i:void 0;n=typeof i=="function"?i:n,Ta(e,t,r).then(()=>n()).catch(n)}s(Xd,"appendFile");function Jd(e,t,i=I){i=typeof t=="function"?t:i,j(e).stat().then(n=>i(void 0,typeof t=="object"&&t?.bigint?new be(n):n)).catch(i)}s(Jd,"fstat");function Qd(e,t=I){new ce(e).close().then(()=>t()).catch(t)}s(Qd,"close");function Zd(e,t,i=I){let n=typeof t=="number"?t:0;i=typeof t=="function"?t:i;let r=j(e);if(n<0)throw new u(22);r.truncate(n).then(()=>i()).catch(i)}s(Zd,"ftruncate");function eh(e,t=I){j(e).sync().then(()=>t()).catch(t)}s(eh,"fsync");function th(e,t=I){j(e).datasync().then(()=>t()).catch(t)}s(th,"fdatasync");function ih(e,t,i,n,r,o=I){let a,c,l,f,d,h=new ce(e);if(typeof t=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new u(22,"Invalid arguments."));return}a=za.Buffer.from(t),c=0,l=a.length;let b=o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a.toString(d))).catch(b)}else{a=za.Buffer.from(t.buffer),c=i,l=n,f=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a)).catch(b)}}s(ih,"write");function nh(e,t,i,n,r,o=I){new ce(e).read(t,i,n,r).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(nh,"read");function rh(e,t,i,n=I){new ce(e).chown(t,i).then(()=>n()).catch(n)}s(rh,"fchown");function oh(e,t,i){new ce(e).chmod(t).then(()=>i()).catch(i)}s(oh,"fchmod");function sh(e,t,i,n=I){new ce(e).utimes(t,i).then(()=>n()).catch(n)}s(sh,"futimes");function ah(e,t=I){qr(e).then(()=>t()).catch(t)}s(ah,"rmdir");function ch(e,t,i=I){Ln(e,t).then(()=>i()).catch(i)}s(ch,"mkdir");function lh(e,t,i=I){i=typeof t=="function"?t:i,Ht(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(lh,"readdir");function fh(e,t,i=I){Ra(e,t).then(()=>i()).catch(i)}s(fh,"link");function uh(e,t,i,n=I){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,La(e,t,r).then(()=>n()).catch(n)}s(uh,"symlink");function dh(e,t,i=I){i=typeof t=="function"?t:i,$r(e).then(n=>i(void 0,n)).catch(i)}s(dh,"readlink");function hh(e,t,i,n=I){Na(e,t,i).then(()=>n()).catch(n)}s(hh,"chown");function ph(e,t,i,n=I){Ca(e,t,i).then(()=>n()).catch(n)}s(ph,"lchown");function yh(e,t,i=I){Ba(e,t).then(()=>i()).catch(i)}s(yh,"chmod");function mh(e,t,i=I){Da(e,t).then(()=>i()).catch(i)}s(mh,"lchmod");function bh(e,t,i,n=I){zr(e,t,i).then(()=>n()).catch(n)}s(bh,"utimes");function gh(e,t,i,n=I){Ma(e,t,i).then(()=>n()).catch(n)}s(gh,"lutimes");function wh(e,t,i=I){i=typeof t=="function"?t:i,Ue(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(wh,"realpath");function Sh(e,t,i=I){let n=typeof t=="number"?t:4;i=typeof t=="function"?t:i,Wa(e,n).then(()=>i()).catch(i)}s(Sh,"access");var Wi=new Map;function Eh(e,t,i){let n=x(e.toString()),r=typeof t!="function"?t:{};if(typeof t=="function"&&(i=t),!i)throw new u(22,"No listener specified",e.toString(),"watchFile");if(Wi.has(n)){let a=Wi.get(n);a&&a.listeners.add(i);return}let o=new Zn(n,r);o.on("change",(a,c)=>{let l=Wi.get(n);if(l)for(let f of l.listeners)f(a,c)}),Wi.set(n,{watcher:o,listeners:new Set})}s(Eh,"watchFile");function _h(e,t=I){let i=x(e.toString()),n=Wi.get(i);n&&(t&&t!==I?n.listeners.delete(t):n.listeners.clear(),n.listeners.size===0&&(n.watcher.stop(),Wi.delete(i)))}s(_h,"unwatchFile");function xh(e,t,i){let n=new wi(x(e),typeof t=="object"?t:{});return i=typeof t=="function"?t:i,n.on("change",i||I),n}s(xh,"watch");function kh(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Nt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{n||=await Se(e,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},"read"),destroy:s(function(o,a){n?.close().then(()=>a(o)).catch(I)},"destroy")});return r.path=e.toString(),r}s(kh,"createReadStream");function vh(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Ct({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{n||=await Se(e,"w",i?.mode||438),await n.write(o,0,a),c(void 0)}catch(l){await n?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){n?.close().then(()=>o()).catch(o)},"final")});return r.path=e.toString(),r}s(vh,"createWriteStream");function Fh(e,t,i=I){i=typeof t=="function"?t:i,Vr(e,typeof t=="function"?void 0:t).then(()=>i(void 0)).catch(i)}s(Fh,"rm");function Ih(e,t,i=I){i=typeof t=="function"?t:i,Ua(e,typeof t!="function"?t:null).then(n=>i(void 0,n)).catch(i)}s(Ih,"mkdtemp");function Ah(e,t,i,n=I){n=typeof i=="function"?i:n,Hr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Ah,"copyFile");function Oh(e,t,i,n=I){n=typeof i=="function"?i:n,new ce(e).readv(t,typeof i=="function"?void 0:i).then(({buffers:r,bytesRead:o})=>n(void 0,o,r)).catch(n)}s(Oh,"readv");function Ph(e,t,i,n=I){n=typeof i=="function"?i:n,new ce(e).writev(t,typeof i=="function"?void 0:i).then(({buffers:r,bytesWritten:o})=>n(void 0,o,r)).catch(n)}s(Ph,"writev");function Th(e,t,i=I){i=typeof t=="function"?t:i,ja(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Th,"opendir");function Rh(e,t,i,n=I){n=typeof i=="function"?i:n,Kr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Rh,"cp");function Lh(e,t,i=I){i=typeof t=="function"?t:i,qa(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Lh,"statfs");async function Nh(e,t){let i=await Se(e.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],t)}s(Nh,"openAsBlob");function Ch(e){return Hi(e)||Vi(e)||e instanceof pe}s(Ch,"isMountConfig");async function Ui(e,t=0){if(typeof e!="object"||e==null)throw new u(22,"Invalid options on mount configuration");if(!Ch(e))throw new u(22,"Invalid mount configuration");if(e instanceof pe)return e;Vi(e)&&(e={backend:e});for(let[r,o]of Object.entries(e))if(r!="backend"&&Ch(o)){if(t>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");e[r]=await Ui(o,++t)}let{backend:i}=e;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await lo(i,e);let n=await i.create(e);return n._disableSync=e.disableAsyncCache||!1,await n.ready(),n}s(Ui,"resolveMountConfig");async function KS(e){if(!Hi(e))throw new TypeError("Invalid single mount point configuration");let t=await Ui(e);gi("/"),zt("/",t)}s(KS,"configureSingle");async function GS(e){let t="uid"in e&&e.uid||0,i="gid"in e&&e.gid||0;if(Object.assign(ye,{uid:t,gid:i,suid:t,sgid:i,euid:t,egid:i}),!!e.mounts){for(let[n,r]of Object.entries(e.mounts)){if(!n.startsWith("/"))throw new u(22,"Mount points must have absolute paths");Hi(r)&&(r.disableAsyncCache??=e.disableAsyncCache||!1),e.mounts[n]=await Ui(r)}pn(e.mounts)}}s(GS,"configure");function Va(e){let i=class i extends e{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(o=>{let a=s(()=>this._queueRunning?setTimeout(a):o(),"check");a()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(o){throw this._isInitialized=!1,o}}}checkSync(o,a){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",o,a);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",o,a)}renameSync(o,a){this.checkSync(o,"rename"),this._sync.renameSync(o,a),this.queue("rename",o,a)}statSync(o){return this.checkSync(o,"stat"),this._sync.statSync(o)}createFileSync(o,a,c){return this.checkSync(o,"createFile"),this._sync.createFileSync(o,a,c),this.queue("createFile",o,a,c),this.openFileSync(o,a)}openFileSync(o,a){this.checkSync(o,"openFile");let c=this._sync.openFileSync(o,a),l=c.statSync(),f=new Uint8Array(l.size);return c.readSync(f),new we(this,o,a,l,f)}unlinkSync(o){this.checkSync(o,"unlinkSync"),this._sync.unlinkSync(o),this.queue("unlink",o)}rmdirSync(o){this.checkSync(o,"rmdir"),this._sync.rmdirSync(o),this.queue("rmdir",o)}mkdirSync(o,a){this.checkSync(o,"mkdir"),this._sync.mkdirSync(o,a),this.queue("mkdir",o,a)}readdirSync(o){return this.checkSync(o,"readdir"),this._sync.readdirSync(o)}linkSync(o,a){this.checkSync(o,"link"),this._sync.linkSync(o,a),this.queue("link",o,a)}syncSync(o,a,c){this.checkSync(o,"sync"),this._sync.syncSync(o,a,c),this.queue("sync",o,a,c)}existsSync(o){return this.checkSync(o,"exists"),this._sync.existsSync(o)}async crossCopy(o){this.checkSync(o,"crossCopy");let a=await this.stat(o);if(!a.isDirectory()){var l=[];try{let p=S(l,await this.openFile(o,M("r")),!0);let w=S(l,this._sync.createFileSync(o,M("w"),a.mode));let g=new Uint8Array(a.size);await p.read(g);w.writeSync(g,0,a.size);return}catch(f){var d=f,h=!0}finally{var b=E(l,d,h);b&&await b}}if(o!=="/"){let p=await this.stat(o);this._sync.mkdirSync(o,p.mode)}let c=await this.readdir(o);for(let p of c)await this.crossCopy(z(o,p))}async _next(){if(!this._queueRunning)return;let[o,...a]=this._queue.shift();await this[o](...a),await this._next()}queue(...o){this._queue.push(o),this._next()}};s(i,"AsyncFS");let t=i;return t}s(Va,"Async");function YS(e){return typeof e=="object"&&e!=null&&"fd"in e&&"path"in e&&"position"in e}s(YS,"isFileData");function Ha(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}s(Ha,"isMessage");var ji=new Map;function Ka(e,{port:t,timeout:i=1e3,fs:n}={}){let r=`
3
+ `+new Error().stack.slice(6);if(!t)throw u.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);ji.set(c,{resolve:o,reject:a,fs:n}),t.postMessage({...e,_zenfs:!0,id:c,stack:r});let l=setTimeout(()=>{let f=new u(5,"RPC Failed");f.stack+=r,a(f),typeof l=="object"&&l.unref()},i)})}s(Ka,"request");function Bh(e){if(!Ha(e))return;let{id:t,value:i,error:n,stack:r}=e;if(!ji.has(t)){let l=new u(5,"Invalid RPC id:"+t);throw l.stack+=r,l}let{resolve:o,reject:a,fs:c}=ji.get(t);if(n){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=r,a(l),ji.delete(t);return}if(YS(i)){let{fd:l,path:f,position:d}=i,h=new Bn(c,l,f,d);o(h),ji.delete(t);return}o(i),ji.delete(t)}s(Bh,"handleResponse");function Gr(e,t){if(!e)throw u.With("EINVAL");e["on"in e?"on":"addEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Gr,"attach");function Ga(e,t){if(!e)throw u.With("EINVAL");e["off"in e?"off":"removeEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Ga,"detach");function Dh(e){let t=[],i=t.push.bind(t);return Gr(e,i),function(n){Ga(e,i);for(let r of t){let o="data"in r?r.data:r;Dn(e,n,o)}}}s(Dh,"catchMessages");var Ya=class Ya extends qt{constructor(i,n,r,o){super(i,r);this.fs=i;this.fd=n;this.position=o}rpc(i,...n){return Ka({scope:"file",fd:this.fd,method:i,args:n},this.fs.options)}_throwNoSync(i){throw new u(95,"Synchronous operations not supported on PortFile",this.path,i)}async stat(){return new G(await this.rpc("stat"))}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,n,r,o){return this.rpc("write",i,n,r,o)}writeSync(){this._throwNoSync("write")}async read(i,n,r,o){return await this.rpc("read",i,n,r,o)}readSync(){this._throwNoSync("read")}chown(i,n){return this.rpc("chown",i,n)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,n){return this.rpc("utimes",i,n)}utimesSync(){this._throwNoSync("utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){this._throwNoSync("_setType")}close(){return this.rpc("close")}closeSync(){this._throwNoSync("close")}sync(){return this.rpc("sync")}syncSync(){this._throwNoSync("sync")}};s(Ya,"PortFile");var Bn=Ya,Xa=class Xa extends Va(pe){constructor(i){super();this.options=i;this._sync=dn.create({name:"port-tmpfs"});this.port=i.port,Gr(this.port,Bh)}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return Ka({scope:"fs",method:i,args:n},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,n){return this.rpc("rename",i,n)}async stat(i){return new G(await this.rpc("stat",i))}sync(i,n,r){return this.rpc("sync",i,n,r)}openFile(i,n){return this.rpc("openFile",i,n)}createFile(i,n,r){return this.rpc("createFile",i,n,r)}unlink(i){return this.rpc("unlink",i)}rmdir(i){return this.rpc("rmdir",i)}mkdir(i,n){return this.rpc("mkdir",i,n)}readdir(i){return this.rpc("readdir",i)}exists(i){return this.rpc("exists",i)}link(i,n){return this.rpc("link",i,n)}};s(Xa,"PortFS");var Xr=Xa,Mh=0,Yr=new Map;async function Dn(e,t,i){if(!Ha(i))return;let{method:n,args:r,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await t[n](...r),l instanceof qt&&(Yr.set(++Mh,l),l={fd:Mh,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Yr.has(d))throw new u(9);l=await Yr.get(d)[n](...r),n=="close"&&Yr.delete(d);break;default:return}}catch(d){l=d instanceof u?d.toJSON():d.toString(),f=!0}e.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:n,stack:c,value:l})}s(Dn,"handleRequest");function Wh(e,t){Gr(e,i=>Dn(e,t,i))}s(Wh,"attachFS");function JS(e,t){Ga(e,i=>Dn(e,t,i))}s(JS,"detachFS");var QS={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(e){if(typeof e?.postMessage!="function")throw new u(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function(e){return new Xr(e)},"create")},ZS=QS;async function eE(e,t,i=0){let n=Dh(e),r=await Ui(t,i);return Wh(e,r),n(r),r}s(eE,"resolveRemoteMount");function Ja(e){let i=class i extends e{metadata(){return{...super.metadata(),readonly:!0}}async rename(r,o){throw new u(30)}renameSync(r,o){throw new u(30)}async createFile(r,o,a){throw new u(30)}createFileSync(r,o,a){throw new u(30)}async unlink(r){throw new u(30)}unlinkSync(r){throw new u(30)}async rmdir(r){throw new u(30)}rmdirSync(r){throw new u(30)}async mkdir(r,o){throw new u(30)}mkdirSync(r,o){throw new u(30)}async link(r,o){throw new u(30)}linkSync(r,o){throw new u(30)}async sync(r,o,a){throw new u(30)}syncSync(r,o,a){throw new u(30)}};s(i,"ReadonlyFS");let t=i;return t}s(Ja,"Readonly");var Qa=1,Qr=class Qr extends Map{files(){let t=new Map;for(let[i,n]of this)n.isFile()&&t.set(i,n);return t}toJSON(){return{version:Qa,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(t){let i=[];for(let n of this.keys())_(n)==t&&i.push(D(n));return i}fromJSON(t){if(t.version!=Qa)throw new u(22,"Index version mismatch");this.clear();for(let[i,n]of Object.entries(t.entries)){let r=new G(n);r.isDirectory()&&(r.fileData=Ne(JSON.stringify(this.dirEntries(i)))),this.set(i,r)}}static parse(t){if(!Wc(t))throw new u(22,"Invalid JSON");let i=JSON.parse(t),n=new Qr;return n.fromJSON(i),n}};s(Qr,"Index");var Jr=Qr,Za=class Za extends Ja(pe){constructor(i){super();this.indexData=i;this.index=new Jr;this._isInitialized=!1}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=await this.getData(i,n)}reloadFilesSync(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=this.getDataSync(i,n)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw u.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:await this.getData(i,r))}openFileSync(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:this.getDataSync(i,r))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let n=this.index.get(i);if(!n)throw u.With("ENOENT",i,"readdir");if(!n.isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=JSON.parse(ai(n.fileData));if(!Array.isArray(r))throw u.With("ENODATA",i,"readdir");if(!r.every(o=>typeof o=="string"))throw u.With("ENODATA",i,"readdir");return r}};s(Za,"IndexFS");var Mn=Za;async function Uh(e,t){let i=await fetch(e).catch(n=>{throw new u(5,n.message)});if(!i.ok)throw new u(5,"fetch failed: response returned code "+i.status);switch(t){case"buffer":{let n=await i.arrayBuffer().catch(r=>{throw new u(5,r.message)});return new Uint8Array(n)}case"json":return i.json().catch(n=>{throw new u(5,n.message)});default:throw new u(22,"Invalid download type: "+t)}}s(Uh,"fetchFile");var eo=class eo extends Mn{async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[t,i]of this.index.files())await this.getData(t,i)}constructor({index:t="index.json",baseUrl:i=""}){super(typeof t!="string"?t:Uh(t,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:eo.name,readonly:!0}}preload(t,i){let n=this.index.get(t);if(!n)throw u.With("ENOENT",t,"preload");if(!n.isFile())throw u.With("EISDIR",t,"preload");n.size=i.length,n.fileData=i}async getData(t,i){if(i.fileData)return i.fileData;let n=await Uh(this.baseUrl+(t.startsWith("/")?t.slice(1):t),"buffer");return i.fileData=n,n}getDataSync(t,i){if(i.fileData)return i.fileData;throw new u(61,"",t,"getData")}};s(eo,"FetchFS");var Zr=eo,tE={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(e){return new Zr(e)},"create")},iE=tE;var tc=class tc{constructor(t){this.previous=t;this.current=Promise.withResolvers();this._isLocked=!0}get isLocked(){return this._isLocked}async done(){await this.previous?.done(),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}};s(tc,"MutexLock");var to=tc,ic=class ic{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){let t=new to(this.currentLock);return this.currentLock=t,t}async lock(t,i){let n=this.currentLock,r=this.addLock(),o=new Error().stack;return setTimeout(()=>{if(r.isLocked){let a=u.With("EDEADLK",t,i);throw a.stack+=o?.slice(5),a}},5e3),await n?.done(),r}lockSync(t,i){if(this.currentLock)throw u.With("EBUSY",t,i);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,i){var r=[];try{let n=S(r,await this.lock(t,"rename"));await this._fs.rename(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}renameSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"rename"));return this._fs.renameSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async stat(t){var n=[];try{let i=S(n,await this.lock(t,"stat"));return await this._fs.stat(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}statSync(t){var n=[];try{let i=S(n,this.lockSync(t,"stat"));return this._fs.statSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async openFile(t,i){var o=[];try{let n=S(o,await this.lock(t,"openFile"));let r=await this._fs.openFile(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}openFileSync(t,i){var o=[];try{let n=S(o,this.lockSync(t,"openFile"));let r=this._fs.openFileSync(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async createFile(t,i,n){var a=[];try{let r=S(a,await this.lock(t,"createFile"));let o=await this._fs.createFile(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}createFileSync(t,i,n){var a=[];try{let r=S(a,this.lockSync(t,"createFile"));let o=this._fs.createFileSync(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async unlink(t){var n=[];try{let i=S(n,await this.lock(t,"unlink"));await this._fs.unlink(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}unlinkSync(t){var n=[];try{let i=S(n,this.lockSync(t,"unlink"));return this._fs.unlinkSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async rmdir(t){var n=[];try{let i=S(n,await this.lock(t,"rmdir"));await this._fs.rmdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}rmdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"rmdir"));return this._fs.rmdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async mkdir(t,i){var r=[];try{let n=S(r,await this.lock(t,"mkdir"));await this._fs.mkdir(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}mkdirSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"mkdir"));return this._fs.mkdirSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async readdir(t){var n=[];try{let i=S(n,await this.lock(t,"readdir"));return await this._fs.readdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}readdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"readdir"));return this._fs.readdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async exists(t){var n=[];try{let i=S(n,await this.lock(t,"exists"));return await this._fs.exists(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}existsSync(t){var n=[];try{let i=S(n,this.lockSync(t,"exists"));return this._fs.existsSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async link(t,i){var r=[];try{let n=S(r,await this.lock(t,"link"));await this._fs.link(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}linkSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"link"));return this._fs.linkSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async sync(t,i,n){var o=[];try{let r=S(o,await this.lock(t,"sync"));await this._fs.sync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}syncSync(t,i,n){var o=[];try{let r=S(o,this.lockSync(t,"sync"));return this._fs.syncSync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}};s(ic,"__MutexedFS");var io=ic;function ec(e){let i=class i extends io{constructor(...r){super(),this._fs=new e(...r)}};s(i,"MutexedFS");let t=i;return t}s(ec,"Mutexed");var nc="/.deleted",rc=class rc extends pe{constructor({writable:i,readable:n}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this.writable=i,this.readable=n,this.writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:Wn.name}}async sync(i,n,r){await this.createParentDirectories(i),await this.writable.exists(i)||await this.writable.createFile(i,"w",420),await this.writable.sync(i,n,r)}syncSync(i,n,r){this.createParentDirectoriesSync(i),this.writable.syncSync(i,n,r)}async _initialize(){if(!this._isInitialized){try{let i=await this.writable.openFile(nc,M("r")),{size:n}=await i.stat(),{buffer:r}=await i.read(new Uint8Array(n));this._deleteLog=ai(r)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("")}async rename(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{await this.writable.rename(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}renameSync(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{this.writable.renameSync(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}async stat(i){this.checkInitialized();try{return await this.writable.stat(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(await this.readable.stat(i));return r.mode|=146,r}}statSync(i){this.checkInitialized();try{return this.writable.statSync(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(this.readable.statSync(i));return r.mode|=146,r}}async openFile(i,n){if(await this.writable.exists(i))return this.writable.openFile(i,n);let r=await this.readable.openFile(i,M("r")),o=new G(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new we(this,i,n,o,a)}openFileSync(i,n){if(this.writable.existsSync(i))return this.writable.openFileSync(i,n);let r=this.readable.openFileSync(i,M("r")),o=new G(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new we(this,i,n,o,a)}async createFile(i,n,r){return this.checkInitialized(),await this.writable.createFile(i,n,r),this.openFile(i,n)}createFileSync(i,n,r){return this.checkInitialized(),this.writable.createFileSync(i,n,r),this.openFileSync(i,n)}async link(i,n){this.checkInitialized(),await this.writable.link(i,n)}linkSync(i,n){this.checkInitialized(),this.writable.linkSync(i,n)}async unlink(i){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i))throw u.With("ENOENT",i,"unlink");await this.writable.exists(i)&&await this.writable.unlink(i),await this.exists(i)&&await this.deletePath(i)}unlinkSync(i){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i))throw u.With("ENOENT",i,"unlink");this.writable.existsSync(i)&&this.writable.unlinkSync(i),this.existsSync(i)&&this.deletePath(i)}async rmdir(i){if(this.checkInitialized(),!await this.exists(i))throw u.With("ENOENT",i,"rmdir");if(await this.writable.exists(i)&&await this.writable.rmdir(i),await this.exists(i)){if((await this.readdir(i)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i)}}rmdirSync(i){if(this.checkInitialized(),!this.existsSync(i))throw u.With("ENOENT",i,"rmdir");if(this.writable.existsSync(i)&&this.writable.rmdirSync(i),this.existsSync(i)){if(this.readdirSync(i).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.deletePath(i)}}async mkdir(i,n){if(this.checkInitialized(),await this.exists(i))throw u.With("EEXIST",i,"mkdir");await this.createParentDirectories(i),await this.writable.mkdir(i,n)}mkdirSync(i,n){if(this.checkInitialized(),this.existsSync(i))throw u.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i),this.writable.mkdirSync(i,n)}async readdir(i){if(this.checkInitialized(),!(await this.stat(i)).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r.push(...await this.writable.readdir(i))}catch{}try{r.push(...(await this.readable.readdir(i)).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}readdirSync(i){if(this.checkInitialized(),!this.statSync(i).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r=r.concat(this.writable.readdirSync(i))}catch{}try{r=r.concat(this.readable.readdirSync(i).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}async deletePath(i){this._deletedFiles.add(i),await this.updateLog(`d${i}
4
4
  `)}async updateLog(i){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this.writable.openFile(nc,M("w"));try{await n.write(Ne(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(r){this._deleteLogError=r}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let i of this._deleteLog.split(`
5
- `))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==nc)throw u.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i){let n=_(i),r=[];for(;!this.writable.existsSync(n);)r.push(n),n=_(n);for(let o of r.reverse())this.writable.mkdirSync(o,this.statSync(o).mode)}async createParentDirectories(i){let n=_(i),r=[];for(;!await this.writable.exists(n);)r.push(n),n=_(n);for(let o of r.reverse()){let a=await this.stat(o);await this.writable.mkdir(o,a.mode)}}operateOnWritable(i){if(!this.existsSync(i))throw u.With("ENOENT",i,"operateOnWriteable");this.writable.existsSync(i)||this.copyToWritableSync(i)}async operateOnWritableAsync(i){if(!await this.exists(i))throw u.With("ENOENT",i,"operateOnWritable");if(!await this.writable.exists(i))return this.copyToWritable(i)}copyToWritableSync(i){let n=this.statSync(i);if(n.isDirectory()){this.writable.mkdirSync(i,n.mode);return}let r=new Uint8Array(n.size),o=this.readable.openFileSync(i,M("r"));o.readSync(r),o.closeSync();let a=this.writable.openFileSync(i,M("w"));a.writeSync(r),a.closeSync()}async copyToWritable(i){let n=await this.stat(i);if(n.isDirectory()){await this.writable.mkdir(i,n.mode);return}let r=new Uint8Array(n.size),o=await this.readable.openFile(i,M("r"));await o.read(r),await o.close();let a=await this.writable.openFile(i,M("w"));await a.write(r),await a.close()}};s(rc,"UnmutexedOverlayFS");var no=rc,oc=class oc extends ec(no){};s(oc,"OverlayFS");var Wn=oc,tE={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:s(function(){return!0},"isAvailable"),create:s(function(e){return new Wn(e)},"create")},iE=tE;function nE(e){let i=class i extends e{async exists(r){return this.existsSync(r)}async rename(r,o){return this.renameSync(r,o)}async stat(r){return this.statSync(r)}async createFile(r,o,a){return this.createFileSync(r,o,a)}async openFile(r,o){return this.openFileSync(r,o)}async unlink(r){return this.unlinkSync(r)}async rmdir(r){return this.rmdirSync(r)}async mkdir(r,o){return this.mkdirSync(r,o)}async readdir(r){return this.readdirSync(r)}async link(r,o){return this.linkSync(r,o)}async sync(r,o,a){return this.syncSync(r,o,a)}};s(i,"SyncFS");let t=i;return t}s(nE,"Sync");var rE=Cn;return Kh(oE);})();
5
+ `))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==nc)throw u.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i){let n=_(i),r=[];for(;!this.writable.existsSync(n);)r.push(n),n=_(n);for(let o of r.reverse())this.writable.mkdirSync(o,this.statSync(o).mode)}async createParentDirectories(i){let n=_(i),r=[];for(;!await this.writable.exists(n);)r.push(n),n=_(n);for(let o of r.reverse()){let a=await this.stat(o);await this.writable.mkdir(o,a.mode)}}operateOnWritable(i){if(!this.existsSync(i))throw u.With("ENOENT",i,"operateOnWriteable");this.writable.existsSync(i)||this.copyToWritableSync(i)}async operateOnWritableAsync(i){if(!await this.exists(i))throw u.With("ENOENT",i,"operateOnWritable");if(!await this.writable.exists(i))return this.copyToWritable(i)}copyToWritableSync(i){let n=this.statSync(i);if(n.isDirectory()){this.writable.mkdirSync(i,n.mode);return}let r=new Uint8Array(n.size),o=this.readable.openFileSync(i,M("r"));o.readSync(r),o.closeSync();let a=this.writable.openFileSync(i,M("w"));a.writeSync(r),a.closeSync()}async copyToWritable(i){let n=await this.stat(i);if(n.isDirectory()){await this.writable.mkdir(i,n.mode);return}let r=new Uint8Array(n.size),o=await this.readable.openFile(i,M("r"));await o.read(r),await o.close();let a=await this.writable.openFile(i,M("w"));await a.write(r),await a.close()}};s(rc,"UnmutexedOverlayFS");var no=rc,oc=class oc extends ec(no){};s(oc,"OverlayFS");var Wn=oc,nE={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:s(function(){return!0},"isAvailable"),create:s(function(e){return new Wn(e)},"create")},rE=nE;function oE(e){let i=class i extends e{async exists(r){return this.existsSync(r)}async rename(r,o){return this.renameSync(r,o)}async stat(r){return this.statSync(r)}async createFile(r,o,a){return this.createFileSync(r,o,a)}async openFile(r,o){return this.openFileSync(r,o)}async unlink(r){return this.unlinkSync(r)}async rmdir(r){return this.rmdirSync(r)}async mkdir(r,o){return this.mkdirSync(r,o)}async readdir(r){return this.readdirSync(r)}async link(r,o){return this.linkSync(r,o)}async sync(r,o,a){return this.syncSync(r,o,a)}};s(i,"SyncFS");let t=i;return t}s(oE,"Sync");var sE=Cn;return Kh(aE);})();
6
6
  /*! Bundled license information:
7
7
 
8
8
  ieee754/index.js: