@zenfs/core 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backends/file_index.d.ts +1 -1
- package/dist/backends/port/fs.d.ts +1 -1
- package/dist/backends/port/rpc.js +1 -1
- package/dist/browser.min.js +5 -4
- package/dist/browser.min.js.map +4 -4
- package/dist/inode.d.ts +10 -22
- package/dist/inode.js +188 -168
- package/dist/mixins/index.d.ts +1 -0
- package/dist/mixins/index.js +1 -0
- package/dist/mixins/shared.d.ts +5 -1
- package/package.json +2 -2
- package/src/backends/port/rpc.ts +1 -1
- package/src/inode.ts +18 -128
- package/src/mixins/index.ts +1 -0
- package/src/mixins/shared.ts +5 -1
package/dist/browser.min.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
"use strict";var ZenFS=(()=>{var wd=Object.create;var Ni=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var Ed=Object.getOwnPropertyNames;var _d=Object.getPrototypeOf,xd=Object.prototype.hasOwnProperty;var ia=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),na=t=>{throw TypeError(t)};var o=(t,e)=>Ni(t,"name",{value:e,configurable:!0});var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Fn=(t,e)=>{for(var i in e)Ni(t,i,{get:e[i],enumerable:!0})},ra=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ed(e))!xd.call(t,r)&&r!==i&&Ni(t,r,{get:()=>e[r],enumerable:!(n=Sd(e,r))||n.enumerable});return t};var Li=(t,e,i)=>(i=t!=null?wd(_d(t)):{},ra(e||!t||!t.__esModule?Ni(i,"default",{value:t,enumerable:!0}):i,t)),kd=t=>ra(Ni({},"__esModule",{value:!0}),t);var w=(t,e,i)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&na("Object expected");var n;i&&(n=e[ia("asyncDispose")]),n===void 0&&(n=e[ia("dispose")]),typeof n!="function"&&na("Object not disposable"),t.push([i,n,e])}else i&&t.push([i]);return e},E=(t,e,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=>e=i?new n(a,e,"An error was suppressed during disposal"):(i=!0,a),s=a=>{for(;a=t.pop();)try{var c=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(c).then(s,l=>(r(l),s()))}catch(l){r(l)}if(i)throw e};return s()};var la=O(Tn=>{"use strict";Tn.byteLength=Od;Tn.toByteArray=Nd;Tn.fromByteArray=Bd;var We=[],ke=[],Td=typeof Uint8Array<"u"?Uint8Array:Array,Vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Lt=0,aa=Vr.length;Lt<aa;++Lt)We[Lt]=Vr[Lt],ke[Vr.charCodeAt(Lt)]=Lt;var Lt,aa;ke[45]=62;ke[95]=63;function ca(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var n=i===e?0:4-i%4;return[i,n]}o(ca,"getLens");function Od(t){var e=ca(t),i=e[0],n=e[1];return(i+n)*3/4-n}o(Od,"byteLength");function Rd(t,e,i){return(e+i)*3/4-i}o(Rd,"_byteLength");function Nd(t){var e,i=ca(t),n=i[0],r=i[1],s=new Td(Rd(t,n,r)),a=0,c=r>0?n-4:n,l;for(l=0;l<c;l+=4)e=ke[t.charCodeAt(l)]<<18|ke[t.charCodeAt(l+1)]<<12|ke[t.charCodeAt(l+2)]<<6|ke[t.charCodeAt(l+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=e&255;return r===2&&(e=ke[t.charCodeAt(l)]<<2|ke[t.charCodeAt(l+1)]>>4,s[a++]=e&255),r===1&&(e=ke[t.charCodeAt(l)]<<10|ke[t.charCodeAt(l+1)]<<4|ke[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}o(Nd,"toByteArray");function Ld(t){return We[t>>18&63]+We[t>>12&63]+We[t>>6&63]+We[t&63]}o(Ld,"tripletToBase64");function Cd(t,e,i){for(var n,r=[],s=e;s<i;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),r.push(Ld(n));return r.join("")}o(Cd,"encodeChunk");function Bd(t){for(var e,i=t.length,n=i%3,r=[],s=16383,a=0,c=i-n;a<c;a+=s)r.push(Cd(t,a,a+s>c?c:a+s));return n===1?(e=t[i-1],r.push(We[e>>2]+We[e<<4&63]+"==")):n===2&&(e=(t[i-2]<<8)+t[i-1],r.push(We[e>>10]+We[e>>4&63]+We[e<<2&63]+"=")),r.join("")}o(Bd,"fromByteArray")});var fa=O(Hr=>{Hr.read=function(t,e,i,n,r){var s,a,c=r*8-n-1,l=(1<<c)-1,f=l>>1,d=-7,h=i?r-1:0,b=i?-1:1,y=t[e+h];for(h+=b,s=y&(1<<-d)-1,y>>=-d,d+=c;d>0;s=s*256+t[e+h],h+=b,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=n;d>0;a=a*256+t[e+h],h+=b,d-=8);if(s===0)s=1-f;else{if(s===l)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-f}return(y?-1:1)*a*Math.pow(2,s-n)};Hr.write=function(t,e,i,n,r,s){var a,c,l,f=s*8-r-1,d=(1<<f)-1,h=d>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,S=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?e+=b/l:e+=b*Math.pow(2,1-h),e*l>=2&&(a++,l/=2),a+h>=d?(c=0,a=d):a+h>=1?(c=(e*l-1)*Math.pow(2,r),a=a+h):(c=e*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;t[i+y]=c&255,y+=S,c/=256,r-=8);for(a=a<<r|c,f+=r;f>0;t[i+y]=a&255,y+=S,a/=256,f-=8);t[i+y-S]|=g*128}});var ve=O(si=>{"use strict";var Kr=la(),ni=fa(),ua=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;si.Buffer=m;si.SlowBuffer=qd;si.INSPECT_MAX_BYTES=50;var On=2147483647;si.kMaxLength=On;m.TYPED_ARRAY_SUPPORT=Dd();!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 Dd(){try{let t=new Uint8Array(1),e={foo:o(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}o(Dd,"typedArraySupport");Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:o(function(){if(m.isBuffer(this))return this.buffer},"get")});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:o(function(){if(m.isBuffer(this))return this.byteOffset},"get")});function st(t){if(t>On)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,m.prototype),e}o(st,"createBuffer");function m(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Jr(t)}return ya(t,e,i)}o(m,"Buffer");m.poolSize=8192;function ya(t,e,i){if(typeof t=="string")return Wd(t,e);if(ArrayBuffer.isView(t))return Ud(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Ue(t,ArrayBuffer)||t&&Ue(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ue(t,SharedArrayBuffer)||t&&Ue(t.buffer,SharedArrayBuffer)))return Yr(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return m.from(n,e,i);let r=jd(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return m.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}o(ya,"from");m.from=function(t,e,i){return ya(t,e,i)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function ma(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}o(ma,"assertSize");function Md(t,e,i){return ma(t),t<=0?st(t):e!==void 0?typeof i=="string"?st(t).fill(e,i):st(t).fill(e):st(t)}o(Md,"alloc");m.alloc=function(t,e,i){return Md(t,e,i)};function Jr(t){return ma(t),st(t<0?0:Qr(t)|0)}o(Jr,"allocUnsafe");m.allocUnsafe=function(t){return Jr(t)};m.allocUnsafeSlow=function(t){return Jr(t)};function Wd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!m.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=ba(t,e)|0,n=st(i),r=n.write(t,e);return r!==i&&(n=n.slice(0,r)),n}o(Wd,"fromString");function Gr(t){let e=t.length<0?0:Qr(t.length)|0,i=st(e);for(let n=0;n<e;n+=1)i[n]=t[n]&255;return i}o(Gr,"fromArrayLike");function Ud(t){if(Ue(t,Uint8Array)){let e=new Uint8Array(t);return Yr(e.buffer,e.byteOffset,e.byteLength)}return Gr(t)}o(Ud,"fromArrayView");function Yr(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&i===void 0?n=new Uint8Array(t):i===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,i),Object.setPrototypeOf(n,m.prototype),n}o(Yr,"fromArrayBuffer");function jd(t){if(m.isBuffer(t)){let e=Qr(t.length)|0,i=st(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||es(t.length)?st(0):Gr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Gr(t.data)}o(jd,"fromObject");function Qr(t){if(t>=On)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+On.toString(16)+" bytes");return t|0}o(Qr,"checked");function qd(t){return+t!=t&&(t=0),m.alloc(+t)}o(qd,"SlowBuffer");m.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==m.prototype},"isBuffer");m.compare=o(function(e,i){if(Ue(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),Ue(i,Uint8Array)&&(i=m.from(i,i.offset,i.byteLength)),!m.isBuffer(e)||!m.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let n=e.length,r=i.length;for(let s=0,a=Math.min(n,r);s<a;++s)if(e[s]!==i[s]){n=e[s],r=i[s];break}return n<r?-1:r<n?1:0},"compare");m.isEncoding=o(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");m.concat=o(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return m.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<e.length;++n)i+=e[n].length;let r=m.allocUnsafe(i),s=0;for(n=0;n<e.length;++n){let a=e[n];if(Ue(a,Uint8Array))s+a.length>r.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(r,s)):Uint8Array.prototype.set.call(r,a,s);else if(m.isBuffer(a))a.copy(r,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length}return r},"concat");function ba(t,e){if(m.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ue(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Xr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Fa(t).length;default:if(r)return n?-1:Xr(t).length;e=(""+e).toLowerCase(),r=!0}}o(ba,"byteLength");m.byteLength=ba;function $d(t,e,i){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zd(this,e,i);case"utf8":case"utf-8":return wa(this,e,i);case"ascii":return Jd(this,e,i);case"latin1":case"binary":return Qd(this,e,i);case"base64":return Yd(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eh(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}o($d,"slowToString");m.prototype._isBuffer=!0;function Ct(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}o(Ct,"swap");m.prototype.swap16=o(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)Ct(this,i,i+1);return this},"swap16");m.prototype.swap32=o(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)Ct(this,i,i+3),Ct(this,i+1,i+2);return this},"swap32");m.prototype.swap64=o(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)Ct(this,i,i+7),Ct(this,i+1,i+6),Ct(this,i+2,i+5),Ct(this,i+3,i+4);return this},"swap64");m.prototype.toString=o(function(){let e=this.length;return e===0?"":arguments.length===0?wa(this,0,e):$d.apply(this,arguments)},"toString");m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=o(function(e){if(!m.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:m.compare(this,e)===0},"equals");m.prototype.inspect=o(function(){let e="",i=si.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");ua&&(m.prototype[ua]=m.prototype.inspect);m.prototype.compare=o(function(e,i,n,r,s){if(Ue(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),s===void 0&&(s=this.length),i<0||n>e.length||r<0||s>this.length)throw new RangeError("out of range index");if(r>=s&&i>=n)return 0;if(r>=s)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,s>>>=0,this===e)return 0;let a=s-r,c=n-i,l=Math.min(a,c),f=this.slice(r,s),d=e.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 ga(t,e,i,n,r){if(t.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,es(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof e=="string"&&(e=m.from(e,n)),m.isBuffer(e))return e.length===0?-1:da(t,e,i,n,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):da(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}o(ga,"bidirectionalIndexOf");function da(t,e,i,n,r){let s=1,a=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,i/=2}function l(d,h){return s===1?d[h]:d.readUInt16BE(h*s)}o(l,"read");let f;if(r){let d=-1;for(f=i;f<a;f++)if(l(t,f)===l(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*s}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(t,f+h)!==l(e,h)){d=!1;break}if(d)return f}return-1}o(da,"arrayIndexOf");m.prototype.includes=o(function(e,i,n){return this.indexOf(e,i,n)!==-1},"includes");m.prototype.indexOf=o(function(e,i,n){return ga(this,e,i,n,!0)},"indexOf");m.prototype.lastIndexOf=o(function(e,i,n){return ga(this,e,i,n,!1)},"lastIndexOf");function zd(t,e,i,n){i=Number(i)||0;let r=t.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let s=e.length;n>s/2&&(n=s/2);let a;for(a=0;a<n;++a){let c=parseInt(e.substr(a*2,2),16);if(es(c))return a;t[i+a]=c}return a}o(zd,"hexWrite");function Vd(t,e,i,n){return Rn(Xr(e,t.length-i),t,i,n)}o(Vd,"utf8Write");function Hd(t,e,i,n){return Rn(rh(e),t,i,n)}o(Hd,"asciiWrite");function Kd(t,e,i,n){return Rn(Fa(e),t,i,n)}o(Kd,"base64Write");function Gd(t,e,i,n){return Rn(sh(e,t.length-i),t,i,n)}o(Gd,"ucs2Write");m.prototype.write=o(function(e,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 s=this.length-i;if((n===void 0||n>s)&&(n=s),e.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 zd(this,e,i,n);case"utf8":case"utf-8":return Vd(this,e,i,n);case"ascii":case"latin1":case"binary":return Hd(this,e,i,n);case"base64":return Kd(this,e,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gd(this,e,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");m.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function Yd(t,e,i){return e===0&&i===t.length?Kr.fromByteArray(t):Kr.fromByteArray(t.slice(e,i))}o(Yd,"base64Slice");function wa(t,e,i){i=Math.min(t.length,i);let n=[],r=e;for(;r<i;){let s=t[r],a=null,c=s>239?4:s>223?3:s>191?2:1;if(r+c<=i){let l,f,d,h;switch(c){case 1:s<128&&(a=s);break;case 2:l=t[r+1],(l&192)===128&&(h=(s&31)<<6|l&63,h>127&&(a=h));break;case 3:l=t[r+1],f=t[r+2],(l&192)===128&&(f&192)===128&&(h=(s&15)<<12|(l&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:l=t[r+1],f=t[r+2],d=t[r+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(h=(s&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 Xd(n)}o(wa,"utf8Slice");var ha=4096;function Xd(t){let e=t.length;if(e<=ha)return String.fromCharCode.apply(String,t);let i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=ha));return i}o(Xd,"decodeCodePointsArray");function Jd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]&127);return n}o(Jd,"asciiSlice");function Qd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}o(Qd,"latin1Slice");function Zd(t,e,i){let n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);let r="";for(let s=e;s<i;++s)r+=oh[t[s]];return r}o(Zd,"hexSlice");function eh(t,e,i){let n=t.slice(e,i),r="";for(let s=0;s<n.length-1;s+=2)r+=String.fromCharCode(n[s]+n[s+1]*256);return r}o(eh,"utf16leSlice");m.prototype.slice=o(function(e,i){let n=this.length;e=~~e,i=i===void 0?n:~~i,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<e&&(i=e);let r=this.subarray(e,i);return Object.setPrototypeOf(r,m.prototype),r},"slice");function ee(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}o(ee,"checkOffset");m.prototype.readUintLE=m.prototype.readUIntLE=o(function(e,i,n){e=e>>>0,i=i>>>0,n||ee(e,i,this.length);let r=this[e],s=1,a=0;for(;++a<i&&(s*=256);)r+=this[e+a]*s;return r},"readUIntLE");m.prototype.readUintBE=m.prototype.readUIntBE=o(function(e,i,n){e=e>>>0,i=i>>>0,n||ee(e,i,this.length);let r=this[e+--i],s=1;for(;i>0&&(s*=256);)r+=this[e+--i]*s;return r},"readUIntBE");m.prototype.readUint8=m.prototype.readUInt8=o(function(e,i){return e=e>>>0,i||ee(e,1,this.length),this[e]},"readUInt8");m.prototype.readUint16LE=m.prototype.readUInt16LE=o(function(e,i){return e=e>>>0,i||ee(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");m.prototype.readUint16BE=m.prototype.readUInt16BE=o(function(e,i){return e=e>>>0,i||ee(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");m.prototype.readUint32LE=m.prototype.readUInt32LE=o(function(e,i){return e=e>>>0,i||ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");m.prototype.readUint32BE=m.prototype.readUInt32BE=o(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");m.prototype.readBigUInt64LE=wt(o(function(e){e=e>>>0,ri(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Di(e,this.length-8);let r=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(s)<<BigInt(32))},"readBigUInt64LE"));m.prototype.readBigUInt64BE=wt(o(function(e){e=e>>>0,ri(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Di(e,this.length-8);let r=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(s)},"readBigUInt64BE"));m.prototype.readIntLE=o(function(e,i,n){e=e>>>0,i=i>>>0,n||ee(e,i,this.length);let r=this[e],s=1,a=0;for(;++a<i&&(s*=256);)r+=this[e+a]*s;return s*=128,r>=s&&(r-=Math.pow(2,8*i)),r},"readIntLE");m.prototype.readIntBE=o(function(e,i,n){e=e>>>0,i=i>>>0,n||ee(e,i,this.length);let r=i,s=1,a=this[e+--r];for(;r>0&&(s*=256);)a+=this[e+--r]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*i)),a},"readIntBE");m.prototype.readInt8=o(function(e,i){return e=e>>>0,i||ee(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");m.prototype.readInt16LE=o(function(e,i){e=e>>>0,i||ee(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");m.prototype.readInt16BE=o(function(e,i){e=e>>>0,i||ee(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");m.prototype.readInt32LE=o(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");m.prototype.readInt32BE=o(function(e,i){return e=e>>>0,i||ee(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");m.prototype.readBigInt64LE=wt(o(function(e){e=e>>>0,ri(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Di(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));m.prototype.readBigInt64BE=wt(o(function(e){e=e>>>0,ri(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Di(e,this.length-8);let r=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));m.prototype.readFloatLE=o(function(e,i){return e=e>>>0,i||ee(e,4,this.length),ni.read(this,e,!0,23,4)},"readFloatLE");m.prototype.readFloatBE=o(function(e,i){return e=e>>>0,i||ee(e,4,this.length),ni.read(this,e,!1,23,4)},"readFloatBE");m.prototype.readDoubleLE=o(function(e,i){return e=e>>>0,i||ee(e,8,this.length),ni.read(this,e,!0,52,8)},"readDoubleLE");m.prototype.readDoubleBE=o(function(e,i){return e=e>>>0,i||ee(e,8,this.length),ni.read(this,e,!1,52,8)},"readDoubleBE");function fe(t,e,i,n,r,s){if(!m.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<s)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}o(fe,"checkInt");m.prototype.writeUintLE=m.prototype.writeUIntLE=o(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,e,i,n,c,0)}let s=1,a=0;for(this[i]=e&255;++a<n&&(s*=256);)this[i+a]=e/s&255;return i+n},"writeUIntLE");m.prototype.writeUintBE=m.prototype.writeUIntBE=o(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,e,i,n,c,0)}let s=n-1,a=1;for(this[i+s]=e&255;--s>=0&&(a*=256);)this[i+s]=e/a&255;return i+n},"writeUIntBE");m.prototype.writeUint8=m.prototype.writeUInt8=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");m.prototype.writeUint16LE=m.prototype.writeUInt16LE=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");m.prototype.writeUint16BE=m.prototype.writeUInt16BE=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");m.prototype.writeUint32LE=m.prototype.writeUInt32LE=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");m.prototype.writeUint32BE=m.prototype.writeUInt32BE=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function Sa(t,e,i,n,r){va(e,n,r,t,i,7);let s=Number(e&BigInt(4294967295));t[i++]=s,s=s>>8,t[i++]=s,s=s>>8,t[i++]=s,s=s>>8,t[i++]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}o(Sa,"wrtBigUInt64LE");function Ea(t,e,i,n,r){va(e,n,r,t,i,7);let s=Number(e&BigInt(4294967295));t[i+7]=s,s=s>>8,t[i+6]=s,s=s>>8,t[i+5]=s,s=s>>8,t[i+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}o(Ea,"wrtBigUInt64BE");m.prototype.writeBigUInt64LE=wt(o(function(e,i=0){return Sa(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));m.prototype.writeBigUInt64BE=wt(o(function(e,i=0){return Ea(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));m.prototype.writeIntLE=o(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,e,i,n,l-1,-l)}let s=0,a=1,c=0;for(this[i]=e&255;++s<n&&(a*=256);)e<0&&c===0&&this[i+s-1]!==0&&(c=1),this[i+s]=(e/a>>0)-c&255;return i+n},"writeIntLE");m.prototype.writeIntBE=o(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,e,i,n,l-1,-l)}let s=n-1,a=1,c=0;for(this[i+s]=e&255;--s>=0&&(a*=256);)e<0&&c===0&&this[i+s+1]!==0&&(c=1),this[i+s]=(e/a>>0)-c&255;return i+n},"writeIntBE");m.prototype.writeInt8=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");m.prototype.writeInt16LE=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");m.prototype.writeInt16BE=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");m.prototype.writeInt32LE=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");m.prototype.writeInt32BE=o(function(e,i,n){return e=+e,i=i>>>0,n||fe(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");m.prototype.writeBigInt64LE=wt(o(function(e,i=0){return Sa(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));m.prototype.writeBigInt64BE=wt(o(function(e,i=0){return Ea(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function _a(t,e,i,n,r,s){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}o(_a,"checkIEEE754");function xa(t,e,i,n,r){return e=+e,i=i>>>0,r||_a(t,e,i,4,34028234663852886e22,-34028234663852886e22),ni.write(t,e,i,n,23,4),i+4}o(xa,"writeFloat");m.prototype.writeFloatLE=o(function(e,i,n){return xa(this,e,i,!0,n)},"writeFloatLE");m.prototype.writeFloatBE=o(function(e,i,n){return xa(this,e,i,!1,n)},"writeFloatBE");function ka(t,e,i,n,r){return e=+e,i=i>>>0,r||_a(t,e,i,8,17976931348623157e292,-17976931348623157e292),ni.write(t,e,i,n,52,8),i+8}o(ka,"writeDouble");m.prototype.writeDoubleLE=o(function(e,i,n){return ka(this,e,i,!0,n)},"writeDoubleLE");m.prototype.writeDoubleBE=o(function(e,i,n){return ka(this,e,i,!1,n)},"writeDoubleBE");m.prototype.copy=o(function(e,i,n,r){if(!m.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=e.length&&(i=e.length),i||(i=0),r>0&&r<n&&(r=n),r===n||e.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),e.length-i<r-n&&(r=e.length-i+n);let s=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),i),s},"copy");m.prototype.fill=o(function(e,i,n,r){if(typeof e=="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(e.length===1){let a=e.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);let s;if(typeof e=="number")for(s=i;s<n;++s)this[s]=e;else{let a=m.isBuffer(e)?e:m.from(e,r),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<n-i;++s)this[s+i]=a[s%c]}return this},"fill");var ii={};function Zr(t,e,i){ii[t]=class extends i{static{o(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}o(Zr,"E");Zr("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Zr("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Zr("ERR_OUT_OF_RANGE",function(t,e,i){let n=`The value of "${t}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=pa(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=pa(r)),r+="n"),n+=` It must be ${e}. Received ${r}`,n},RangeError);function pa(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}o(pa,"addNumericalSeparator");function th(t,e,i){ri(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Di(e,t.length-(i+1))}o(th,"checkBounds");function va(t,e,i,n,r,s){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",c;throw s>3?e===0||e===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:c=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:c=`>= ${e}${a} and <= ${i}${a}`,new ii.ERR_OUT_OF_RANGE("value",c,t)}th(n,r,s)}o(va,"checkIntBI");function ri(t,e){if(typeof t!="number")throw new ii.ERR_INVALID_ARG_TYPE(e,"number",t)}o(ri,"validateNumber");function Di(t,e,i){throw Math.floor(t)!==t?(ri(t,i),new ii.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new ii.ERR_BUFFER_OUT_OF_BOUNDS:new ii.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}o(Di,"boundsError");var ih=/[^+/0-9A-Za-z-_]/g;function nh(t){if(t=t.split("=")[0],t=t.trim().replace(ih,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}o(nh,"base64clean");function Xr(t,e){e=e||1/0;let i,n=t.length,r=null,s=[];for(let a=0;a<n;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return s}o(Xr,"utf8ToBytes");function rh(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}o(rh,"asciiToBytes");function sh(t,e){let i,n,r,s=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,s.push(r),s.push(n);return s}o(sh,"utf16leToBytes");function Fa(t){return Kr.toByteArray(nh(t))}o(Fa,"base64ToBytes");function Rn(t,e,i,n){let r;for(r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}o(Rn,"blitBuffer");function Ue(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}o(Ue,"isInstance");function es(t){return t!==t}o(es,"numberIsNaN");var oh=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)e[n+r]=t[i]+t[r]}return e}();function wt(t){return typeof BigInt>"u"?ah:t}o(wt,"defineBigIntMethod");function ah(){throw new Error("BigInt not supported")}o(ah,"BufferBigIntNotDefined")});var Na=O((jS,cs)=>{"use strict";var Bh=Object.prototype.hasOwnProperty,oe="~";function Zi(){}o(Zi,"Events");Object.create&&(Zi.prototype=Object.create(null),new Zi().__proto__||(oe=!1));function Dh(t,e,i){this.fn=t,this.context=e,this.once=i||!1}o(Dh,"EE");function Ra(t,e,i,n,r){if(typeof i!="function")throw new TypeError("The listener must be a function");var s=new Dh(i,n||t,r),a=oe?oe+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],s]:t._events[a].push(s):(t._events[a]=s,t._eventsCount++),t}o(Ra,"addListener");function Cn(t,e){--t._eventsCount===0?t._events=new Zi:delete t._events[e]}o(Cn,"clearEvent");function ne(){this._events=new Zi,this._eventsCount=0}o(ne,"EventEmitter");ne.prototype.eventNames=o(function(){var e=[],i,n;if(this._eventsCount===0)return e;for(n in i=this._events)Bh.call(i,n)&&e.push(oe?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(i)):e},"eventNames");ne.prototype.listeners=o(function(e){var i=oe?oe+e:e,n=this._events[i];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r<s;r++)a[r]=n[r].fn;return a},"listeners");ne.prototype.listenerCount=o(function(e){var i=oe?oe+e:e,n=this._events[i];return n?n.fn?1:n.length:0},"listenerCount");ne.prototype.emit=o(function(e,i,n,r,s,a){var c=oe?oe+e:e;if(!this._events[c])return!1;var l=this._events[c],f=arguments.length,d,h;if(l.fn){switch(l.once&&this.removeListener(e,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,s),!0;case 6:return l.fn.call(l.context,i,n,r,s,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,y;for(h=0;h<b;h++)switch(l[h].once&&this.removeListener(e,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(y=1,d=new Array(f-1);y<f;y++)d[y-1]=arguments[y];l[h].fn.apply(l[h].context,d)}}return!0},"emit");ne.prototype.on=o(function(e,i,n){return Ra(this,e,i,n,!1)},"on");ne.prototype.once=o(function(e,i,n){return Ra(this,e,i,n,!0)},"once");ne.prototype.removeListener=o(function(e,i,n,r){var s=oe?oe+e:e;if(!this._events[s])return this;if(!i)return Cn(this,s),this;var a=this._events[s];if(a.fn)a.fn===i&&(!r||a.once)&&(!n||a.context===n)&&Cn(this,s);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[s]=l.length===1?l[0]:l:Cn(this,s)}return this},"removeListener");ne.prototype.removeAllListeners=o(function(e){var i;return e?(i=oe?oe+e:e,this._events[i]&&Cn(this,i)):(this._events=new Zi,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=oe;ne.EventEmitter=ne;typeof cs<"u"&&(cs.exports=ne)});var q=O((pE,nc)=>{"use strict";nc.exports={ArrayIsArray:o(function(t){return Array.isArray(t)},"ArrayIsArray"),ArrayPrototypeIncludes:o(function(t,e){return t.includes(e)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:o(function(t,e){return t.indexOf(e)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:o(function(t,e){return t.join(e)},"ArrayPrototypeJoin"),ArrayPrototypeMap:o(function(t,e){return t.map(e)},"ArrayPrototypeMap"),ArrayPrototypePop:o(function(t,e){return t.pop(e)},"ArrayPrototypePop"),ArrayPrototypePush:o(function(t,e){return t.push(e)},"ArrayPrototypePush"),ArrayPrototypeSlice:o(function(t,e,i){return t.slice(e,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:o(function(t,e,...i){return t.call(e,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:o(function(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},"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:o(function(t,e){return Object.defineProperties(t,e)},"ObjectDefineProperties"),ObjectDefineProperty:o(function(t,e,i){return Object.defineProperty(t,e,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:o(function(t,e){return Object.getOwnPropertyDescriptor(t,e)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:o(function(t){return Object.keys(t)},"ObjectKeys"),ObjectSetPrototypeOf:o(function(t,e){return Object.setPrototypeOf(t,e)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:o(function(t,e){return t.catch(e)},"PromisePrototypeCatch"),PromisePrototypeThen:o(function(t,e,i){return t.then(e,i)},"PromisePrototypeThen"),PromiseReject:o(function(t){return Promise.reject(t)},"PromiseReject"),PromiseResolve:o(function(t){return Promise.resolve(t)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:o(function(t,e){return t.test(e)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:o(function(t,e,i){return t.slice(e,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:o(function(t){return t.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:o(function(t){return t.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:o(function(t){return t.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:o(function(t,e,i){return t.set(e,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var hi=O((mE,Vn)=>{"use strict";var{AbortController:rc,AbortSignal:Uh}=typeof self<"u"?self:typeof window<"u"?window:void 0;Vn.exports=rc;Vn.exports.AbortSignal=Uh;Vn.exports.default=rc});var rn=O((bE,ms)=>{"use strict";var pi=typeof Reflect=="object"?Reflect:null,sc=pi&&typeof pi.apply=="function"?pi.apply:o(function(e,i,n){return Function.prototype.apply.call(e,i,n)},"ReflectApply"),Hn;pi&&typeof pi.ownKeys=="function"?Hn=pi.ownKeys:Object.getOwnPropertySymbols?Hn=o(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Hn=o(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function jh(t){console&&console.warn&&console.warn(t)}o(jh,"ProcessEmitWarning");var ac=Number.isNaN||o(function(e){return e!==e},"NumberIsNaN");function N(){N.init.call(this)}o(N,"EventEmitter");ms.exports=N;ms.exports.once=Vh;N.EventEmitter=N;N.prototype._events=void 0;N.prototype._eventsCount=0;N.prototype._maxListeners=void 0;var oc=10;function Kn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}o(Kn,"checkListener");Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:o(function(){return oc},"get"),set:o(function(t){if(typeof t!="number"||t<0||ac(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");oc=t},"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=o(function(e){if(typeof e!="number"||e<0||ac(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function cc(t){return t._maxListeners===void 0?N.defaultMaxListeners:t._maxListeners}o(cc,"_getMaxListeners");N.prototype.getMaxListeners=o(function(){return cc(this)},"getMaxListeners");N.prototype.emit=o(function(e){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=e==="error",s=this._events;if(s!==void 0)r=r&&s.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=s[e];if(l===void 0)return!1;if(typeof l=="function")sc(l,this,i);else for(var f=l.length,d=hc(l,f),n=0;n<f;++n)sc(d[n],this,i);return!0},"emit");function lc(t,e,i,n){var r,s,a;if(Kn(i),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),a=s[e]),a===void 0)a=s[e]=i,++t._eventsCount;else if(typeof a=="function"?a=s[e]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=cc(t),r>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,jh(c)}return t}o(lc,"_addListener");N.prototype.addListener=o(function(e,i){return lc(this,e,i,!1)},"addListener");N.prototype.on=N.prototype.addListener;N.prototype.prependListener=o(function(e,i){return lc(this,e,i,!0)},"prependListener");function qh(){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)}o(qh,"onceWrapper");function fc(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=qh.bind(n);return r.listener=i,n.wrapFn=r,r}o(fc,"_onceWrap");N.prototype.once=o(function(e,i){return Kn(i),this.on(e,fc(this,e,i)),this},"once");N.prototype.prependOnceListener=o(function(e,i){return Kn(i),this.prependListener(e,fc(this,e,i)),this},"prependOnceListener");N.prototype.removeListener=o(function(e,i){var n,r,s,a,c;if(Kn(i),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||i));else if(typeof n!="function"){for(s=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){c=n[a].listener,s=a;break}if(s<0)return this;s===0?n.shift():$h(n,s),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,c||i)}return this},"removeListener");N.prototype.off=N.prototype.removeListener;N.prototype.removeAllListeners=o(function(e){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[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),a;for(r=0;r<s.length;++r)a=s[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(e,i[r]);return this},"removeAllListeners");function uc(t,e,i){var n=t._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?zh(r):hc(r,r.length)}o(uc,"_listeners");N.prototype.listeners=o(function(e){return uc(this,e,!0)},"listeners");N.prototype.rawListeners=o(function(e){return uc(this,e,!1)},"rawListeners");N.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):dc.call(t,e)};N.prototype.listenerCount=dc;function dc(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}o(dc,"listenerCount");N.prototype.eventNames=o(function(){return this._eventsCount>0?Hn(this._events):[]},"eventNames");function hc(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}o(hc,"arrayClone");function $h(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}o($h,"spliceOne");function zh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}o(zh,"unwrapListeners");function Vh(t,e){return new Promise(function(i,n){function r(a){t.removeListener(e,s),n(a)}o(r,"errorListener");function s(){typeof t.removeListener=="function"&&t.removeListener("error",r),i([].slice.call(arguments))}o(s,"resolver"),pc(t,e,s,{once:!0}),e!=="error"&&Hh(t,r,{once:!0})})}o(Vh,"once");function Hh(t,e,i){typeof t.on=="function"&&pc(t,"error",e,i)}o(Hh,"addErrorHandlerIfEventEmitter");function pc(t,e,i,n){if(typeof t.on=="function")n.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,o(function r(s){n.once&&t.removeEventListener(e,r),i(s)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}o(pc,"eventTargetAgnosticAddListener")});var re=O((wE,gs)=>{"use strict";var Kh=ve(),{kResistStopPropagation:Gh,SymbolDispose:Yh}=q(),Xh=globalThis.AbortSignal||hi().AbortSignal,Jh=globalThis.AbortController||hi().AbortController,Qh=Object.getPrototypeOf(async function(){}).constructor,yc=globalThis.Blob||Kh.Blob,Zh=o(typeof yc<"u"?function(e){return e instanceof yc}:function(e){return!1},"isBlob"),mc=o((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),ep=o((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),bs=class extends Error{static{o(this,"AggregateError")}constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let n=0;n<e.length;n++)i+=` ${e[n].stack}
|
|
2
|
-
`;super(i),this.name="AggregateError",this.errors=e}};gs.exports={AggregateError:bs,kEmptyObject:Object.freeze({}),once:o(function(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},"once"),createDeferredPromise:o(function(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},"createDeferredPromise"),promisify:o(function(t){return new Promise((e,i)=>{t((n,...r)=>n?i(n):e(...r))})},"promisify"),debuglog:o(function(){return function(){}},"debuglog"),format:o(function(t,...e){return t.replace(/%([sdifj])/g,function(...[i,n]){let r=e.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:o(function(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:o(function(t){return t instanceof Qh},"isAsyncFunction"),isArrayBufferView:o(function(t){return ArrayBuffer.isView(t)},"isArrayBufferView")},isBlob:Zh,deprecate:o(function(t,e){return t},"deprecate"),addAbortListener:rn().addAbortListener||o(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);mc(e,"signal"),ep(i,"listener");let n;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Gh]:!0}),n=o(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Yh](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Xh.any||o(function(e){if(e.length===1)return e[0];let i=new Jh,n=o(()=>i.abort(),"abort");return e.forEach(r=>{mc(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};gs.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=O((EE,wc)=>{"use strict";var{format:tp,inspect:Gn,AggregateError:ip}=re(),np=globalThis.AggregateError||ip,rp=Symbol("kIsNodeError"),sp=["string","function","number","object","Function","Object","boolean","bigint","symbol"],op=/^([A-Z][a-z0-9]*)+$/,ap="__node_internal_",Yn={};function jt(t,e){if(!t)throw new Yn.ERR_INTERNAL_ASSERTION(e)}o(jt,"assert");function bc(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}o(bc,"addNumericalSeparator");function cp(t,e,i){if(typeof e=="function")return jt(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let n=(e.match(/%[dfijoOs]/g)||[]).length;return jt(n===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?e:tp(e,...i)}o(cp,"getMessage");function ie(t,e,i){i||(i=Error);class n extends i{static{o(this,"NodeError")}constructor(...s){super(cp(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:o(function(){return`${this.name} [${t}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[rp]=!0,Yn[t]=n}o(ie,"E");function gc(t){let e=ap+t.name;return Object.defineProperty(t,"name",{value:e}),t}o(gc,"hideStackFrames");function lp(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new np([e,t],e.message);return i.code=e.code,i}return t||e}o(lp,"aggregateTwoErrors");var ws=class extends Error{static{o(this,"AbortError")}constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Yn.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};ie("ERR_ASSERTION","%s",Error);ie("ERR_INVALID_ARG_TYPE",(t,e,i)=>{jt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let r=[],s=[],a=[];for(let l of e)jt(typeof l=="string","All expected entries have to be of type string"),sp.includes(l)?r.push(l.toLowerCase()):op.test(l)?s.push(l):(jt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(s.length>0){let l=r.indexOf("object");l!==-1&&(r.splice(r,l,1),s.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}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();n+=`an instance of ${s.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=Gn(i,{depth:-1});n+=`. Received ${l}`}}else{let l=Gn(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",(t,e,i="is invalid")=>{let n=Gn(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError);ie("ERR_INVALID_RETURN_VALUE",(t,e,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 ${t} to be returned from the "${e}" function but got ${r}.`},TypeError);ie("ERR_MISSING_ARGS",(...t)=>{jt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);ie("ERR_OUT_OF_RANGE",(t,e,i)=>{jt(e,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=bc(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=bc(n)),n+="n"):n=Gn(i),`The value of "${t}" is out of range. It must be ${e}. 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);wc.exports={AbortError:ws,aggregateTwoErrors:gc(lp),hideStackFrames:gc,codes:Yn}});var mi=O((xE,Pc)=>{"use strict";var{ArrayIsArray:Es,ArrayPrototypeIncludes:xc,ArrayPrototypeJoin:kc,ArrayPrototypeMap:fp,NumberIsInteger:_s,NumberIsNaN:up,NumberMAX_SAFE_INTEGER:dp,NumberMIN_SAFE_INTEGER:hp,NumberParseInt:pp,ObjectPrototypeHasOwnProperty:yp,RegExpPrototypeExec:vc,String:mp,StringPrototypeToUpperCase:bp,StringPrototypeTrim:gp}=q(),{hideStackFrames:Te,codes:{ERR_SOCKET_BAD_PORT:wp,ERR_INVALID_ARG_TYPE:se,ERR_INVALID_ARG_VALUE:yi,ERR_OUT_OF_RANGE:qt,ERR_UNKNOWN_SIGNAL:Sc}}=ae(),{normalizeEncoding:Sp}=re(),{isAsyncFunction:Ep,isArrayBufferView:_p}=re().types,Ec={};function xp(t){return t===(t|0)}o(xp,"isInt32");function kp(t){return t===t>>>0}o(kp,"isUint32");var vp=/^[0-7]+$/,Fp="must be a 32-bit unsigned integer or an octal string";function Ip(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(vc(vp,t)===null)throw new yi(e,t,Fp);t=pp(t,8)}return Fc(t,e),t}o(Ip,"parseFileMode");var Ap=Te((t,e,i=hp,n=dp)=>{if(typeof t!="number")throw new se(e,"number",t);if(!_s(t))throw new qt(e,"an integer",t);if(t<i||t>n)throw new qt(e,`>= ${i} && <= ${n}`,t)}),Pp=Te((t,e,i=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new se(e,"number",t);if(!_s(t))throw new qt(e,"an integer",t);if(t<i||t>n)throw new qt(e,`>= ${i} && <= ${n}`,t)}),Fc=Te((t,e,i=!1)=>{if(typeof t!="number")throw new se(e,"number",t);if(!_s(t))throw new qt(e,"an integer",t);let n=i?1:0,r=4294967295;if(t<n||t>r)throw new qt(e,`>= ${n} && <= ${r}`,t)});function xs(t,e){if(typeof t!="string")throw new se(e,"string",t)}o(xs,"validateString");function Tp(t,e,i=void 0,n){if(typeof t!="number")throw new se(e,"number",t);if(i!=null&&t<i||n!=null&&t>n||(i!=null||n!=null)&&up(t))throw new qt(e,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}o(Tp,"validateNumber");var Op=Te((t,e,i)=>{if(!xc(i,t)){let r="must be one of: "+kc(fp(i,s=>typeof s=="string"?`'${s}'`:mp(s)),", ");throw new yi(e,t,r)}});function Ic(t,e){if(typeof t!="boolean")throw new se(e,"boolean",t)}o(Ic,"validateBoolean");function Ss(t,e,i){return t==null||!yp(t,e)?i:t[e]}o(Ss,"getOwnPropertyValueOrDefault");var Rp=Te((t,e,i=null)=>{let n=Ss(i,"allowArray",!1),r=Ss(i,"allowFunction",!1);if(!Ss(i,"nullable",!1)&&t===null||!n&&Es(t)||typeof t!="object"&&(!r||typeof t!="function"))throw new se(e,"Object",t)}),Np=Te((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new se(e,"a dictionary",t)}),Xn=Te((t,e,i=0)=>{if(!Es(t))throw new se(e,"Array",t);if(t.length<i){let n=`must be longer than ${i}`;throw new yi(e,t,n)}});function Lp(t,e){Xn(t,e);for(let i=0;i<t.length;i++)xs(t[i],`${e}[${i}]`)}o(Lp,"validateStringArray");function Cp(t,e){Xn(t,e);for(let i=0;i<t.length;i++)Ic(t[i],`${e}[${i}]`)}o(Cp,"validateBooleanArray");function Bp(t,e){Xn(t,e);for(let i=0;i<t.length;i++){let n=t[i],r=`${e}[${i}]`;if(n==null)throw new se(r,"AbortSignal",n);Ac(n,r)}}o(Bp,"validateAbortSignalArray");function Dp(t,e="signal"){if(xs(t,e),Ec[t]===void 0)throw Ec[bp(t)]!==void 0?new Sc(t+" (signals must use all capital letters)"):new Sc(t)}o(Dp,"validateSignalName");var Mp=Te((t,e="buffer")=>{if(!_p(t))throw new se(e,["Buffer","TypedArray","DataView"],t)});function Wp(t,e){let i=Sp(e),n=t.length;if(i==="hex"&&n%2!==0)throw new yi("encoding",e,`is invalid for data of length ${n}`)}o(Wp,"validateEncoding");function Up(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&gp(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new wp(e,t,i);return t|0}o(Up,"validatePort");var Ac=Te((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new se(e,"AbortSignal",t)}),jp=Te((t,e)=>{if(typeof t!="function")throw new se(e,"Function",t)}),qp=Te((t,e)=>{if(typeof t!="function"||Ep(t))throw new se(e,"Function",t)}),$p=Te((t,e)=>{if(t!==void 0)throw new se(e,"undefined",t)});function zp(t,e,i){if(!xc(i,t))throw new se(e,`('${kc(i,"|")}')`,t)}o(zp,"validateUnion");var Vp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function _c(t,e){if(typeof t>"u"||!vc(Vp,t))throw new yi(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(_c,"validateLinkHeaderFormat");function Hp(t){if(typeof t=="string")return _c(t,"hints"),t;if(Es(t)){let e=t.length,i="";if(e===0)return i;for(let n=0;n<e;n++){let r=t[n];_c(r,"hints"),i+=r,n!==e-1&&(i+=", ")}return i}throw new yi("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(Hp,"validateLinkHeaderValue");Pc.exports={isInt32:xp,isUint32:kp,parseFileMode:Ip,validateArray:Xn,validateStringArray:Lp,validateBooleanArray:Cp,validateAbortSignalArray:Bp,validateBoolean:Ic,validateBuffer:Mp,validateDictionary:Np,validateEncoding:Wp,validateFunction:jp,validateInt32:Pp,validateInteger:Ap,validateNumber:Tp,validateObject:Rp,validateOneOf:Op,validatePlainFunction:qp,validatePort:Up,validateSignalName:Dp,validateString:xs,validateUint32:Fc,validateUndefined:$p,validateUnion:zp,validateAbortSignal:Ac,validateLinkHeaderValue:Hp}});var Ft=O((vE,Nc)=>{var V=Nc.exports={},Ye,Xe;function ks(){throw new Error("setTimeout has not been defined")}o(ks,"defaultSetTimout");function vs(){throw new Error("clearTimeout has not been defined")}o(vs,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ye=setTimeout:Ye=ks}catch{Ye=ks}try{typeof clearTimeout=="function"?Xe=clearTimeout:Xe=vs}catch{Xe=vs}})();function Tc(t){if(Ye===setTimeout)return setTimeout(t,0);if((Ye===ks||!Ye)&&setTimeout)return Ye=setTimeout,setTimeout(t,0);try{return Ye(t,0)}catch{try{return Ye.call(null,t,0)}catch{return Ye.call(this,t,0)}}}o(Tc,"runTimeout");function Kp(t){if(Xe===clearTimeout)return clearTimeout(t);if((Xe===vs||!Xe)&&clearTimeout)return Xe=clearTimeout,clearTimeout(t);try{return Xe(t)}catch{try{return Xe.call(null,t)}catch{return Xe.call(this,t)}}}o(Kp,"runClearTimeout");var ut=[],bi=!1,$t,Jn=-1;function Gp(){!bi||!$t||(bi=!1,$t.length?ut=$t.concat(ut):Jn=-1,ut.length&&Oc())}o(Gp,"cleanUpNextTick");function Oc(){if(!bi){var t=Tc(Gp);bi=!0;for(var e=ut.length;e;){for($t=ut,ut=[];++Jn<e;)$t&&$t[Jn].run();Jn=-1,e=ut.length}$t=null,bi=!1,Kp(t)}}o(Oc,"drainQueue");V.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];ut.push(new Rc(t,e)),ut.length===1&&!bi&&Tc(Oc)};function Rc(t,e){this.fun=t,this.array=e}o(Rc,"Item");Rc.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function dt(){}o(dt,"noop");V.on=dt;V.addListener=dt;V.once=dt;V.off=dt;V.removeListener=dt;V.removeAllListeners=dt;V.emit=dt;V.prependListener=dt;V.prependOnceListener=dt;V.listeners=function(t){return[]};V.binding=function(t){throw new Error("process.binding is not supported")};V.cwd=function(){return"/"};V.chdir=function(t){throw new Error("process.chdir is not supported")};V.umask=function(){return 0}});var Qe=O((IE,Gc)=>{"use strict";var{SymbolAsyncIterator:Lc,SymbolIterator:Cc,SymbolFor:zt}=q(),Bc=zt("nodejs.stream.destroyed"),Dc=zt("nodejs.stream.errored"),Fs=zt("nodejs.stream.readable"),Is=zt("nodejs.stream.writable"),Mc=zt("nodejs.stream.disturbed"),Yp=zt("nodejs.webstream.isClosedPromise"),Xp=zt("nodejs.webstream.controllerErrorFunction");function Qn(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}o(Qn,"isReadableNodeStream");function Zn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}o(Zn,"isWritableNodeStream");function Jp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}o(Jp,"isDuplexNodeStream");function Je(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}o(Je,"isNodeStream");function Wc(t){return!!(t&&!Je(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}o(Wc,"isReadableStream");function Uc(t){return!!(t&&!Je(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}o(Uc,"isWritableStream");function jc(t){return!!(t&&!Je(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}o(jc,"isTransformStream");function Qp(t){return Wc(t)||Uc(t)||jc(t)}o(Qp,"isWebStream");function Zp(t,e){return t==null?!1:e===!0?typeof t[Lc]=="function":e===!1?typeof t[Cc]=="function":typeof t[Lc]=="function"||typeof t[Cc]=="function"}o(Zp,"isIterable");function er(t){if(!Je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!!(t.destroyed||t[Bc]||n!=null&&n.destroyed)}o(er,"isDestroyed");function qc(t){if(!Zn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}o(qc,"isWritableEnded");function ey(t,e){if(!Zn(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}o(ey,"isWritableFinished");function ty(t){if(!Qn(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}o(ty,"isReadableEnded");function $c(t,e){if(!Qn(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}o($c,"isReadableFinished");function zc(t){return t&&t[Fs]!=null?t[Fs]:typeof t?.readable!="boolean"?null:er(t)?!1:Qn(t)&&t.readable&&!$c(t)}o(zc,"isReadable");function Vc(t){return t&&t[Is]!=null?t[Is]:typeof t?.writable!="boolean"?null:er(t)?!1:Zn(t)&&t.writable&&!qc(t)}o(Vc,"isWritable");function iy(t,e){return Je(t)?er(t)?!0:!(e?.readable!==!1&&zc(t)||e?.writable!==!1&&Vc(t)):null}o(iy,"isFinished");function ny(t){var e,i;return Je(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}o(ny,"isWritableErrored");function ry(t){var e,i;return Je(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}o(ry,"isReadableErrored");function sy(t){if(!Je(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&Hc(t)?t._closed:null}o(sy,"isClosed");function Hc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}o(Hc,"isOutgoingMessage");function Kc(t){return typeof t._sent100=="boolean"&&Hc(t)}o(Kc,"isServerResponse");function oy(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}o(oy,"isServerRequest");function ay(t){if(!Je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!n&&Kc(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}o(ay,"willEmitClose");function cy(t){var e;return!!(t&&((e=t[Mc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}o(cy,"isDisturbed");function ly(t){var e,i,n,r,s,a,c,l,f,d;return!!(t&&((e=(i=(n=(r=(s=(a=t[Dc])!==null&&a!==void 0?a:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&r!==void 0?r:(c=t._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&n!==void 0?n:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}o(ly,"isErrored");Gc.exports={isDestroyed:er,kIsDestroyed:Bc,isDisturbed:cy,kIsDisturbed:Mc,isErrored:ly,kIsErrored:Dc,isReadable:zc,kIsReadable:Fs,kIsClosedPromise:Yp,kControllerErrorFunction:Xp,kIsWritable:Is,isClosed:sy,isDuplexNodeStream:Jp,isFinished:iy,isIterable:Zp,isReadableNodeStream:Qn,isReadableStream:Wc,isReadableEnded:ty,isReadableFinished:$c,isReadableErrored:ry,isNodeStream:Je,isWebStream:Qp,isWritable:Vc,isWritableNodeStream:Zn,isWritableStream:Uc,isWritableEnded:qc,isWritableFinished:ey,isWritableErrored:ny,isServerRequest:oy,isServerResponse:Kc,willEmitClose:ay,isTransformStream:jc}});var ht=O((PE,Rs)=>{var It=Ft(),{AbortError:nl,codes:fy}=ae(),{ERR_INVALID_ARG_TYPE:uy,ERR_STREAM_PREMATURE_CLOSE:Yc}=fy,{kEmptyObject:Ps,once:Ts}=re(),{validateAbortSignal:dy,validateFunction:hy,validateObject:py,validateBoolean:yy}=mi(),{Promise:my,PromisePrototypeThen:by,SymbolDispose:rl}=q(),{isClosed:gy,isReadable:Xc,isReadableNodeStream:As,isReadableStream:wy,isReadableFinished:Jc,isReadableErrored:Qc,isWritable:Zc,isWritableNodeStream:el,isWritableStream:Sy,isWritableFinished:tl,isWritableErrored:il,isNodeStream:Ey,willEmitClose:_y,kIsClosedPromise:xy}=Qe(),gi;function ky(t){return t.setHeader&&typeof t.abort=="function"}o(ky,"isRequest");var Os=o(()=>{},"nop");function sl(t,e,i){var n,r;if(arguments.length===2?(i=e,e=Ps):e==null?e=Ps:py(e,"options"),hy(i,"callback"),dy(e.signal,"options.signal"),i=Ts(i),wy(t)||Sy(t))return vy(t,e,i);if(!Ey(t))throw new uy("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:As(t),a=(r=e.writable)!==null&&r!==void 0?r:el(t),c=t._writableState,l=t._readableState,f=o(()=>{t.writable||b()},"onlegacyfinish"),d=_y(t)&&As(t)===s&&el(t)===a,h=tl(t,!1),b=o(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||y)&&i.call(t)},"onfinish"),y=Jc(t,!1),S=o(()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),g=o(K=>{i.call(t,K)},"onerror"),I=gy(t),k=o(()=>{I=!0;let K=il(t)||Qc(t);if(K&&typeof K!="boolean")return i.call(t,K);if(s&&!y&&As(t,!0)&&!Jc(t,!1))return i.call(t,new Yc);if(a&&!h&&!tl(t,!1))return i.call(t,new Yc);i.call(t)},"onclose"),A=o(()=>{I=!0;let K=il(t)||Qc(t);if(K&&typeof K!="boolean")return i.call(t,K);i.call(t)},"onclosed"),L=o(()=>{t.req.on("finish",b)},"onrequest");ky(t)?(t.on("complete",b),d||t.on("abort",k),t.req?L():t.on("request",L)):a&&!c&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",k),t.on("end",S),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",k),I?It.nextTick(k):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||It.nextTick(A):(!s&&(!d||Xc(t))&&(h||Zc(t)===!1)||!a&&(!d||Zc(t))&&(y||Xc(t)===!1)||l&&t.req&&t.aborted)&&It.nextTick(A);let T=o(()=>{i=Os,t.removeListener("aborted",k),t.removeListener("complete",b),t.removeListener("abort",k),t.removeListener("request",L),t.req&&t.req.removeListener("finish",b),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",b),t.removeListener("end",S),t.removeListener("error",g),t.removeListener("close",k)},"cleanup");if(e.signal&&!I){let K=o(()=>{let Rt=i;T(),Rt.call(t,new nl(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)It.nextTick(K);else{gi=gi||re().addAbortListener;let Rt=gi(e.signal,K),Se=i;i=Ts((...ei)=>{Rt[rl](),Se.apply(t,ei)})}}return T}o(sl,"eos");function vy(t,e,i){let n=!1,r=Os;if(e.signal)if(r=o(()=>{n=!0,i.call(t,new nl(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)It.nextTick(r);else{gi=gi||re().addAbortListener;let a=gi(e.signal,r),c=i;i=Ts((...l)=>{a[rl](),c.apply(t,l)})}let s=o((...a)=>{n||It.nextTick(()=>i.apply(t,a))},"resolverFn");return by(t[xy].promise,s,s),Os}o(vy,"eosWeb");function Fy(t,e){var i;let n=!1;return e===null&&(e=Ps),(i=e)!==null&&i!==void 0&&i.cleanup&&(yy(e.cleanup,"cleanup"),n=e.cleanup),new my((r,s)=>{let a=sl(t,e,c=>{n&&a(),c?s(c):r()})})}o(Fy,"finished");Rs.exports=sl;Rs.exports.finished=Fy});var Vt=O((OE,hl)=>{"use strict";var Ze=Ft(),{aggregateTwoErrors:Iy,codes:{ERR_MULTIPLE_CALLBACK:Ay},AbortError:Py}=ae(),{Symbol:cl}=q(),{kIsDestroyed:Ty,isDestroyed:Oy,isFinished:Ry,isServerRequest:Ny}=Qe(),ll=cl("kDestroy"),Ns=cl("kConstruct");function fl(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}o(fl,"checkError");function Ly(t,e){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(fl(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?ol(this,t,e):this.once(ll,function(s){ol(this,Iy(s,t),e)}),this)}o(Ly,"destroy");function ol(t,e,i){let n=!1;function r(s){if(n)return;n=!0;let a=t._readableState,c=t._writableState;fl(s,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(s),s?Ze.nextTick(Cy,t,s):Ze.nextTick(ul,t)}o(r,"onDestroy");try{t._destroy(e||null,r)}catch(s){r(s)}}o(ol,"_destroy");function Cy(t,e){Ls(t,e),ul(t)}o(Cy,"emitErrorCloseNT");function ul(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}o(ul,"emitCloseNT");function Ls(t,e){let i=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}o(Ls,"emitErrorNT");function By(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}o(By,"undestroy");function Cs(t,e,i){let n=t._readableState,r=t._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),n&&!n.errored&&(n.errored=e),i?Ze.nextTick(Ls,t,e):Ls(t,e))}o(Cs,"errorOrDestroy");function Dy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,n=t._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),t.once(Ns,e),!(t.listenerCount(Ns)>1)&&Ze.nextTick(My,t)}o(Dy,"construct");function My(t){let e=!1;function i(n){if(e){Cs(t,n??new Ay);return}e=!0;let r=t._readableState,s=t._writableState,a=s||r;r&&(r.constructed=!0),s&&(s.constructed=!0),a.destroyed?t.emit(ll,n):n?Cs(t,n,!0):Ze.nextTick(Wy,t)}o(i,"onConstruct");try{t._construct(n=>{Ze.nextTick(i,n)})}catch(n){Ze.nextTick(i,n)}}o(My,"constructNT");function Wy(t){t.emit(Ns)}o(Wy,"emitConstructNT");function al(t){return t?.setHeader&&typeof t.abort=="function"}o(al,"isRequest");function dl(t){t.emit("close")}o(dl,"emitCloseLegacy");function Uy(t,e){t.emit("error",e),Ze.nextTick(dl,t)}o(Uy,"emitErrorCloseLegacy");function jy(t,e){!t||Oy(t)||(!e&&!Ry(t)&&(e=new Py),Ny(t)?(t.socket=null,t.destroy(e)):al(t)?t.abort():al(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ze.nextTick(Uy,t,e):Ze.nextTick(dl,t),t.destroyed||(t[Ty]=!0))}o(jy,"destroyer");hl.exports={construct:Dy,destroyer:jy,destroy:Ly,undestroy:By,errorOrDestroy:Cs}});var nr=O((NE,yl)=>{"use strict";var{ArrayIsArray:qy,ObjectSetPrototypeOf:pl}=q(),{EventEmitter:tr}=rn();function ir(t){tr.call(this,t)}o(ir,"Stream");pl(ir.prototype,tr.prototype);pl(ir,tr);ir.prototype.pipe=function(t,e){let i=this;function n(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}o(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}o(r,"ondrain"),t.on("drain",r),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",c));let s=!1;function a(){s||(s=!0,t.end())}o(a,"onend");function c(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}o(c,"onclose");function l(d){f(),tr.listenerCount(this,"error")===0&&this.emit("error",d)}o(l,"onerror"),Bs(i,"error",l),Bs(t,"error",l);function f(){i.removeListener("data",n),t.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),t.removeListener("error",l),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return o(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function Bs(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):qy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}o(Bs,"prependListener");yl.exports={Stream:ir,prependListener:Bs}});var sn=O((CE,rr)=>{"use strict";var{SymbolDispose:$y}=q(),{AbortError:ml,codes:zy}=ae(),{isNodeStream:bl,isWebStream:Vy,kControllerErrorFunction:Hy}=Qe(),Ky=ht(),{ERR_INVALID_ARG_TYPE:gl}=zy,Ds,Gy=o((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new gl(e,"AbortSignal",t)},"validateAbortSignal");rr.exports.addAbortSignal=o(function(e,i){if(Gy(e,"signal"),!bl(i)&&!Vy(i))throw new gl("stream",["ReadableStream","WritableStream","Stream"],i);return rr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");rr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=bl(e)?()=>{e.destroy(new ml(void 0,{cause:t.reason}))}:()=>{e[Hy](new ml(void 0,{cause:t.reason}))};if(t.aborted)i();else{Ds=Ds||re().addAbortListener;let n=Ds(t,i);Ky(e,n[$y])}return e}});var El=O((ME,Sl)=>{"use strict";var{StringPrototypeSlice:wl,SymbolIterator:Yy,TypedArrayPrototypeSet:sr,Uint8Array:Xy}=q(),{Buffer:Ms}=ve(),{inspect:Jy}=re();Sl.exports=class{static{o(this,"BufferList")}constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=e+i.data;return n}concat(e){if(this.length===0)return Ms.alloc(0);let i=Ms.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)sr(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(e,i){let n=this.head.data;if(e<n.length){let r=n.slice(0,e);return this.head.data=n.slice(e),r}return e===n.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Yy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",n=this.head,r=0;do{let s=n.data;if(e>s.length)i+=s,e-=s.length;else{e===s.length?(i+=s,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=wl(s,0,e),this.head=n,n.data=wl(s,e));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(e){let i=Ms.allocUnsafe(e),n=e,r=this.head,s=0;do{let a=r.data;if(e>a.length)sr(i,a,n-e),e-=a.length;else{e===a.length?(sr(i,a,n-e),++s,r.next?this.head=r.next:this.head=this.tail=null):(sr(i,new Xy(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}++s}while((r=r.next)!==null);return this.length-=s,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return Jy(this,{...i,depth:0,customInspect:!1})}}});var on=O((UE,vl)=>{"use strict";var{MathFloor:Qy,NumberIsInteger:Zy}=q(),{validateInteger:em}=mi(),{ERR_INVALID_ARG_VALUE:tm}=ae().codes,_l=16*1024,xl=16;function im(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}o(im,"highWaterMarkFrom");function kl(t){return t?xl:_l}o(kl,"getDefaultHighWaterMark");function nm(t,e){em(e,"value",0),t?xl=e:_l=e}o(nm,"setDefaultHighWaterMark");function rm(t,e,i,n){let r=im(e,n,i);if(r!=null){if(!Zy(r)||r<0){let s=n?`options.${i}`:"options.highWaterMark";throw new tm(s,r)}return Qy(r)}return kl(t.objectMode)}o(rm,"getHighWaterMark");vl.exports={getHighWaterMark:rm,getDefaultHighWaterMark:kl,setDefaultHighWaterMark:nm}});var Al=O((Ws,Il)=>{var or=ve(),et=or.Buffer;function Fl(t,e){for(var i in t)e[i]=t[i]}o(Fl,"copyProps");et.from&&et.alloc&&et.allocUnsafe&&et.allocUnsafeSlow?Il.exports=or:(Fl(or,Ws),Ws.Buffer=Ht);function Ht(t,e,i){return et(t,e,i)}o(Ht,"SafeBuffer");Ht.prototype=Object.create(et.prototype);Fl(et,Ht);Ht.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return et(t,e,i)};Ht.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=et(t);return e!==void 0?typeof i=="string"?n.fill(e,i):n.fill(e):n.fill(0),n};Ht.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return et(t)};Ht.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return or.SlowBuffer(t)}});var Ol=O(Tl=>{"use strict";var js=Al().Buffer,Pl=js.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function sm(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}o(sm,"_normalizeEncoding");function om(t){var e=sm(t);if(typeof e!="string"&&(js.isEncoding===Pl||!Pl(t)))throw new Error("Unknown encoding: "+t);return e||t}o(om,"normalizeEncoding");Tl.StringDecoder=an;function an(t){this.encoding=om(t);var e;switch(this.encoding){case"utf16le":this.text=dm,this.end=hm,e=4;break;case"utf8":this.fillLast=lm,e=4;break;case"base64":this.text=pm,this.end=ym,e=3;break;default:this.write=mm,this.end=bm;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=js.allocUnsafe(e)}o(an,"StringDecoder");an.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};an.prototype.end=um;an.prototype.text=fm;an.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Us(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}o(Us,"utf8CheckByte");function am(t,e,i){var n=e.length-1;if(n<i)return 0;var r=Us(e[n]);return r>=0?(r>0&&(t.lastNeed=r-1),r):--n<i||r===-2?0:(r=Us(e[n]),r>=0?(r>0&&(t.lastNeed=r-2),r):--n<i||r===-2?0:(r=Us(e[n]),r>=0?(r>0&&(r===2?r=0:t.lastNeed=r-3),r):0))}o(am,"utf8CheckIncomplete");function cm(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}o(cm,"utf8CheckExtraBytes");function lm(t){var e=this.lastTotal-this.lastNeed,i=cm(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}o(lm,"utf8FillLast");function fm(t,e){var i=am(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}o(fm,"utf8Text");function um(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}o(um,"utf8End");function dm(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}o(dm,"utf16Text");function hm(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}o(hm,"utf16End");function pm(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}o(pm,"base64Text");function ym(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}o(ym,"base64End");function mm(t){return t.toString(this.encoding)}o(mm,"simpleWrite");function bm(t){return t&&t.length?this.write(t):""}o(bm,"simpleEnd")});var qs=O((VE,Cl)=>{"use strict";var Rl=Ft(),{PromisePrototypeThen:gm,SymbolAsyncIterator:Nl,SymbolIterator:Ll}=q(),{Buffer:wm}=ve(),{ERR_INVALID_ARG_TYPE:Sm,ERR_STREAM_NULL_VALUES:Em}=ae().codes;function _m(t,e,i){let n;if(typeof e=="string"||e instanceof wm)return new t({objectMode:!0,...i,read:o(function(){this.push(e),this.push(null)},"read")});let r;if(e&&e[Nl])r=!0,n=e[Nl]();else if(e&&e[Ll])r=!1,n=e[Ll]();else throw new Sm("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;s._read=function(){a||(a=!0,l())},s._destroy=function(f,d){gm(c(f),()=>Rl.nextTick(d,f),h=>Rl.nextTick(d,h||f))};async function c(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:b,done:y}=await n.throw(f);if(await b,y)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}o(c,"close");async function l(){for(;;){try{let{value:f,done:d}=r?await n.next():n.next();if(d)s.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Em;if(s.push(h))continue;a=!1}}catch(f){s.destroy(f)}break}}return o(l,"next"),s}o(_m,"from");Cl.exports=_m});var ln=O((KE,Zl)=>{var Ce=Ft(),{ArrayPrototypeIndexOf:xm,NumberIsInteger:km,NumberIsNaN:vm,NumberParseInt:Fm,ObjectDefineProperties:Xs,ObjectKeys:Im,ObjectSetPrototypeOf:Ml,Promise:Wl,SafeSet:Am,SymbolAsyncDispose:Pm,SymbolAsyncIterator:Tm,Symbol:Om}=q();Zl.exports=F;F.ReadableState=fr;var{EventEmitter:Rm}=rn(),{Stream:At,prependListener:Nm}=nr(),{Buffer:$s}=ve(),{addAbortSignal:Lm}=sn(),Ul=ht(),P=re().debuglog("stream",t=>{P=t}),Cm=El(),Ei=Vt(),{getHighWaterMark:Bm,getDefaultHighWaterMark:Dm}=on(),{aggregateTwoErrors:Bl,codes:{ERR_INVALID_ARG_TYPE:Mm,ERR_METHOD_NOT_IMPLEMENTED:Wm,ERR_OUT_OF_RANGE:Um,ERR_STREAM_PUSH_AFTER_EOF:jm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:qm},AbortError:$m}=ae(),{validateObject:zm}=mi(),Kt=Om("kPaused"),{StringDecoder:jl}=Ol(),Vm=qs();Ml(F.prototype,At.prototype);Ml(F,At);var zs=o(()=>{},"nop"),{errorOrDestroy:wi}=Ei,Si=1,Hm=2,ql=4,cn=8,$l=16,ar=32,cr=64,zl=128,Km=256,Gm=512,Ym=1024,Gs=2048,Ys=4096,Xm=8192,Jm=16384,Qm=32768,Vl=65536,Zm=1<<17,eb=1<<18;function Q(t){return{enumerable:!1,get:o(function(){return(this.state&t)!==0},"get"),set:o(function(e){e?this.state|=t:this.state&=~t},"set")}}o(Q,"makeBitMapDescriptor");Xs(fr.prototype,{objectMode:Q(Si),ended:Q(Hm),endEmitted:Q(ql),reading:Q(cn),constructed:Q($l),sync:Q(ar),needReadable:Q(cr),emittedReadable:Q(zl),readableListening:Q(Km),resumeScheduled:Q(Gm),errorEmitted:Q(Ym),emitClose:Q(Gs),autoDestroy:Q(Ys),destroyed:Q(Xm),closed:Q(Jm),closeEmitted:Q(Qm),multiAwaitDrain:Q(Vl),readingMore:Q(Zm),dataEmitted:Q(eb)});function fr(t,e,i){typeof i!="boolean"&&(i=e instanceof tt()),this.state=Gs|Ys|$l|ar,t&&t.objectMode&&(this.state|=Si),i&&t&&t.readableObjectMode&&(this.state|=Si),this.highWaterMark=t?Bm(this,t,"readableHighWaterMark",i):Dm(!1),this.buffer=new Cm,this.length=0,this.pipes=[],this.flowing=null,this[Kt]=null,t&&t.emitClose===!1&&(this.state&=~Gs),t&&t.autoDestroy===!1&&(this.state&=~Ys),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new jl(t.encoding),this.encoding=t.encoding)}o(fr,"ReadableState");function F(t){if(!(this instanceof F))return new F(t);let e=this instanceof tt();this._readableState=new fr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Lm(t.signal,this)),At.call(this,t),Ei.construct(this,()=>{this._readableState.needReadable&&lr(this,this._readableState)})}o(F,"Readable");F.prototype.destroy=Ei.destroy;F.prototype._undestroy=Ei.undestroy;F.prototype._destroy=function(t,e){e(t)};F.prototype[Rm.captureRejectionSymbol]=function(t){this.destroy(t)};F.prototype[Pm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new $m,this.destroy(t)),new Wl((e,i)=>Ul(this,n=>n&&n!==t?i(n):e(null)))};F.prototype.push=function(t,e){return Hl(this,t,e,!1)};F.prototype.unshift=function(t,e){return Hl(this,t,e,!0)};function Hl(t,e,i,n){P("readableAddChunk",e);let r=t._readableState,s;if(r.state&Si||(typeof e=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?e=$s.from(e,i).toString(r.encoding):(e=$s.from(e,i),i=""))):e instanceof $s?i="":At._isUint8Array(e)?(e=At._uint8ArrayToBuffer(e),i=""):e!=null&&(s=new Mm("chunk",["string","Buffer","Uint8Array"],e))),s)wi(t,s);else if(e===null)r.state&=~cn,nb(t,r);else if(r.state&Si||e&&e.length>0)if(n)if(r.state&ql)wi(t,new qm);else{if(r.destroyed||r.errored)return!1;Vs(t,r,e,!0)}else if(r.ended)wi(t,new jm);else{if(r.destroyed||r.errored)return!1;r.state&=~cn,r.decoder&&!i?(e=r.decoder.write(e),r.objectMode||e.length!==0?Vs(t,r,e,!1):lr(t,r)):Vs(t,r,e,!1)}else n||(r.state&=~cn,lr(t,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}o(Hl,"readableAddChunk");function Vs(t,e,i,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Vl?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.state&cr&&ur(t)),lr(t,e)}o(Vs,"addChunk");F.prototype.isPaused=function(){let t=this._readableState;return t[Kt]===!0||t.flowing===!1};F.prototype.setEncoding=function(t){let e=new jl(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=e.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var tb=1073741824;function ib(t){if(t>tb)throw new Um("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}o(ib,"computeNewHighWaterMark");function Dl(t,e){return t<=0||e.length===0&&e.ended?0:e.state&Si?1:vm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}o(Dl,"howMuchToRead");F.prototype.read=function(t){P("read",t),t===void 0?t=NaN:km(t)||(t=Fm(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=ib(t)),t!==0&&(e.state&=~zl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return P("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Hs(this):ur(this),null;if(t=Dl(t,e),t===0&&e.ended)return e.length===0&&Hs(this),null;let n=(e.state&cr)!==0;if(P("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,P("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,P("reading, ended or constructing",n);else if(n){P("do read"),e.state|=cn|ar,e.length===0&&(e.state|=cr);try{this._read(e.highWaterMark)}catch(s){wi(this,s)}e.state&=~ar,e.reading||(t=Dl(i,e))}let r;return t>0?r=Jl(t,e):r=null,r===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&Hs(this)),r!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",r)),r};function nb(t,e){if(P("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?ur(t):(e.needReadable=!1,e.emittedReadable=!0,Kl(t))}}o(nb,"onEofChunk");function ur(t){let e=t._readableState;P("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(P("emitReadable",e.flowing),e.emittedReadable=!0,Ce.nextTick(Kl,t))}o(ur,"emitReadable");function Kl(t){let e=t._readableState;P("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Yl(t)}o(Kl,"emitReadable_");function lr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ce.nextTick(rb,t,e))}o(lr,"maybeReadMore");function rb(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(P("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}o(rb,"maybeReadMore_");F.prototype._read=function(t){throw new Wm("_read()")};F.prototype.pipe=function(t,e){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new Am(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),P("pipe count=%d opts=%j",n.pipes.length,e);let s=(!e||e.end!==!1)&&t!==Ce.stdout&&t!==Ce.stderr?c:I;n.endEmitted?Ce.nextTick(s):i.once("end",s),t.on("unpipe",a);function a(k,A){P("onunpipe"),k===i&&A&&A.hasUnpiped===!1&&(A.hasUnpiped=!0,d())}o(a,"onunpipe");function c(){P("onend"),t.end()}o(c,"onend");let l,f=!1;function d(){P("cleanup"),t.removeListener("close",S),t.removeListener("finish",g),l&&t.removeListener("drain",l),t.removeListener("error",y),t.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",I),i.removeListener("data",b),f=!0,l&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}o(d,"cleanup");function h(){f||(n.pipes.length===1&&n.pipes[0]===t?(P("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(P("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),i.pause()),l||(l=sb(i,t),t.on("drain",l))}o(h,"pause"),i.on("data",b);function b(k){P("ondata");let A=t.write(k);P("dest.write",A),A===!1&&h()}o(b,"ondata");function y(k){if(P("onerror",k),I(),t.removeListener("error",y),t.listenerCount("error")===0){let A=t._writableState||t._readableState;A&&!A.errorEmitted?wi(t,k):t.emit("error",k)}}o(y,"onerror"),Nm(t,"error",y);function S(){t.removeListener("finish",g),I()}o(S,"onclose"),t.once("close",S);function g(){P("onfinish"),t.removeListener("close",S),I()}o(g,"onfinish"),t.once("finish",g);function I(){P("unpipe"),i.unpipe(t)}return o(I,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():n.flowing||(P("pipe resume"),i.resume()),t};function sb(t,e){return o(function(){let n=t._readableState;n.awaitDrainWriters===e?(P("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(P("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}o(sb,"pipeOnDrain");F.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let r=e.pipes;e.pipes=[],this.pause();for(let s=0;s<r.length;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=xm(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};F.prototype.on=function(t,e){let i=At.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="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?ur(this):n.reading||Ce.nextTick(ob,this)),i};F.prototype.addListener=F.prototype.on;F.prototype.removeListener=function(t,e){let i=At.prototype.removeListener.call(this,t,e);return t==="readable"&&Ce.nextTick(Gl,this),i};F.prototype.off=F.prototype.removeListener;F.prototype.removeAllListeners=function(t){let e=At.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ce.nextTick(Gl,this),e};function Gl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Kt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}o(Gl,"updateReadableListening");function ob(t){P("readable nexttick read 0"),t.read(0)}o(ob,"nReadingNextTick");F.prototype.resume=function(){let t=this._readableState;return t.flowing||(P("resume"),t.flowing=!t.readableListening,ab(this,t)),t[Kt]=!1,this};function ab(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ce.nextTick(cb,t,e))}o(ab,"resume");function cb(t,e){P("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Yl(t),e.flowing&&!e.reading&&t.read(0)}o(cb,"resume_");F.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[Kt]=!0,this};function Yl(t){let e=t._readableState;for(P("flow",e.flowing);e.flowing&&t.read()!==null;);}o(Yl,"flow");F.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{wi(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=Im(t);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof t[r]=="function"&&(this[r]=t[r].bind(t))}return this};F.prototype[Tm]=function(){return Xl(this)};F.prototype.iterator=function(t){return t!==void 0&&zm(t,"options"),Xl(this,t)};function Xl(t,e){typeof t.read!="function"&&(t=F.wrap(t,{objectMode:!0}));let i=lb(t,e);return i.stream=t,i}o(Xl,"streamToAsyncIterator");async function*lb(t,e){let i=zs;function n(a){this===t?(i(),i=zs):i=a}o(n,"next"),t.on("readable",n);let r,s=Ul(t,{writable:!1},a=>{r=a?Bl(r,a):null,i(),i=zs});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new Wl(n)}}}catch(a){throw r=Bl(r,a),r}finally{(r||e?.destroyOnReturn!==!1)&&(r===void 0||t._readableState.autoDestroy)?Ei.destroyer(t,null):(t.off("readable",n),s())}}o(lb,"createAsyncIterator");Xs(F.prototype,{readable:{__proto__:null,get:o(function(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},"get"),set:o(function(t){this._readableState&&(this._readableState.readable=!!t)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:o(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.flowing},"get"),set:o(function(t){this._readableState&&(this._readableState.flowing=t)},"set")},readableLength:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:o(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:o(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});Xs(fr.prototype,{pipesCount:{__proto__:null,get:o(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:o(function(){return this[Kt]!==!1},"get"),set:o(function(t){this[Kt]=!!t},"set")}});F._fromList=Jl;function Jl(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}o(Jl,"fromList");function Hs(t){let e=t._readableState;P("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ce.nextTick(fb,e,t))}o(Hs,"endReadable");function fb(t,e){if(P("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)Ce.nextTick(ub,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}o(fb,"endReadableNT");function ub(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}o(ub,"endWritableNT");F.from=function(t,e){return Vm(F,t,e)};var Ks;function Ql(){return Ks===void 0&&(Ks={}),Ks}o(Ql,"lazyWebStreams");F.fromWeb=function(t,e){return Ql().newStreamReadableFromReadableStream(t,e)};F.toWeb=function(t,e){return Ql().newReadableStreamFromStreamReadable(t,e)};F.wrap=function(t,e){var i,n;return new F({objectMode:(i=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy:o(function(r,s){Ei.destroyer(t,r),s(r)},"destroy")}).wrap(t)}});var mr=O((YE,df)=>{var Gt=Ft(),{ArrayPrototypeSlice:nf,Error:db,FunctionPrototypeSymbolHasInstance:rf,ObjectDefineProperty:sf,ObjectDefineProperties:hb,ObjectSetPrototypeOf:of,StringPrototypeToLowerCase:pb,Symbol:yb,SymbolHasInstance:mb}=q();df.exports=$;$.WritableState=dn;var{EventEmitter:bb}=rn(),fn=nr().Stream,{Buffer:dr}=ve(),yr=Vt(),{addAbortSignal:gb}=sn(),{getHighWaterMark:wb,getDefaultHighWaterMark:Sb}=on(),{ERR_INVALID_ARG_TYPE:Eb,ERR_METHOD_NOT_IMPLEMENTED:_b,ERR_MULTIPLE_CALLBACK:af,ERR_STREAM_CANNOT_PIPE:xb,ERR_STREAM_DESTROYED:un,ERR_STREAM_ALREADY_FINISHED:kb,ERR_STREAM_NULL_VALUES:vb,ERR_STREAM_WRITE_AFTER_END:Fb,ERR_UNKNOWN_ENCODING:cf}=ae().codes,{errorOrDestroy:_i}=yr;of($.prototype,fn.prototype);of($,fn);function Zs(){}o(Zs,"nop");var xi=yb("kOnFinished");function dn(t,e,i){typeof i!="boolean"&&(i=e instanceof tt()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?wb(this,t,"writableHighWaterMark",i):Sb(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Ab.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,pr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[xi]=[]}o(dn,"WritableState");function pr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}o(pr,"resetBuffer");dn.prototype.getBuffer=o(function(){return nf(this.buffered,this.bufferedIndex)},"getBuffer");sf(dn.prototype,"bufferedRequestCount",{__proto__:null,get:o(function(){return this.buffered.length-this.bufferedIndex},"get")});function $(t){let e=this instanceof tt();if(!e&&!rf($,this))return new $(t);this._writableState=new dn(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&gb(t.signal,this)),fn.call(this,t),yr.construct(this,()=>{let i=this._writableState;i.writing||to(this,i),io(this,i)})}o($,"Writable");sf($,mb,{__proto__:null,value:o(function(t){return rf(this,t)?!0:this!==$?!1:t&&t._writableState instanceof dn},"value")});$.prototype.pipe=function(){_i(this,new xb)};function lf(t,e,i,n){let r=t._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!dr.isEncoding(i))throw new cf(i);typeof n!="function"&&(n=Zs)}if(e===null)throw new vb;if(!r.objectMode)if(typeof e=="string")r.decodeStrings!==!1&&(e=dr.from(e,i),i="buffer");else if(e instanceof dr)i="buffer";else if(fn._isUint8Array(e))e=fn._uint8ArrayToBuffer(e),i="buffer";else throw new Eb("chunk",["string","Buffer","Uint8Array"],e);let s;return r.ending?s=new Fb:r.destroyed&&(s=new un("write")),s?(Gt.nextTick(n,s),_i(t,s,!0),s):(r.pendingcb++,Ib(t,r,e,i,n))}o(lf,"_write");$.prototype.write=function(t,e,i){return lf(this,t,e,i)===!0};$.prototype.cork=function(){this._writableState.corked++};$.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||to(this,t))};$.prototype.setDefaultEncoding=o(function(e){if(typeof e=="string"&&(e=pb(e)),!dr.isEncoding(e))throw new cf(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function Ib(t,e,i,n,r){let s=e.objectMode?1:i.length;e.length+=s;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:n,callback:r}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&r!==Zs&&(e.allNoop=!1)):(e.writelen=s,e.writecb=r,e.writing=!0,e.sync=!0,t._write(i,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}o(Ib,"writeOrBuffer");function ef(t,e,i,n,r,s,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new un("write")):i?t._writev(r,e.onwrite):t._write(r,s,e.onwrite),e.sync=!1}o(ef,"doWrite");function tf(t,e,i,n){--e.pendingcb,n(i),eo(e),_i(t,i)}o(tf,"onwriteError");function Ab(t,e){let i=t._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){_i(t,new af);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?Gt.nextTick(tf,t,i,e,r):tf(t,i,e,r)):(i.buffered.length>i.bufferedIndex&&to(t,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:t,state:i},Gt.nextTick(Pb,i.afterWriteTickInfo)):ff(t,i,1,r))}o(Ab,"onwrite");function Pb({stream:t,state:e,count:i,cb:n}){return e.afterWriteTickInfo=null,ff(t,e,i,n)}o(Pb,"afterWriteTick");function ff(t,e,i,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,n();e.destroyed&&eo(e),io(t,e)}o(ff,"afterWrite");function eo(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:s,callback:a}=t.buffered[r],c=t.objectMode?1:s.length;t.length-=c,a((e=t.errored)!==null&&e!==void 0?e:new un("write"))}let i=t[xi].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=t.errored)!==null&&n!==void 0?n:new un("end"))}pr(t)}o(eo,"errorBuffer");function to(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=e,s=i.length-n;if(!s)return;let a=n;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let c=e.allNoop?Zs:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=e.allNoop&&a===0?i:nf(i,a);l.allBuffers=e.allBuffers,ef(t,e,!0,e.length,l,"",c),pr(e)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=r?1:c.length;ef(t,e,!1,d,c,l,f)}while(a<i.length&&!e.writing);a===i.length?pr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}o(to,"clearBuffer");$.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new _b("_write()")};$.prototype._writev=null;$.prototype.end=function(t,e,i){let n=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let r;if(t!=null){let s=lf(this,t,e);s instanceof db&&(r=s)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,io(this,n,!0),n.ended=!0):n.finished?r=new kb("end"):n.destroyed&&(r=new un("end"))),typeof i=="function"&&(r||n.finished?Gt.nextTick(i,r):n[xi].push(i)),this};function hr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}o(hr,"needFinish");function Tb(t,e){let i=!1;function n(r){if(i){_i(t,r??af());return}if(i=!0,e.pendingcb--,r){let s=e[xi].splice(0);for(let a=0;a<s.length;a++)s[a](r);_i(t,r,e.sync)}else hr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Gt.nextTick(Qs,t,e))}o(n,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(n)}catch(r){n(r)}e.sync=!1}o(Tb,"callFinal");function Ob(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Tb(t,e)):(e.prefinished=!0,t.emit("prefinish")))}o(Ob,"prefinish");function io(t,e,i){hr(e)&&(Ob(t,e),e.pendingcb===0&&(i?(e.pendingcb++,Gt.nextTick((n,r)=>{hr(r)?Qs(n,r):r.pendingcb--},t,e)):hr(e)&&(e.pendingcb++,Qs(t,e))))}o(io,"finishMaybe");function Qs(t,e){e.pendingcb--,e.finished=!0;let i=e[xi].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}o(Qs,"finish");hb($.prototype,{closed:{__proto__:null,get:o(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:o(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:o(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")},writable:{__proto__:null,get:o(function(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},"get"),set:o(function(t){this._writableState&&(this._writableState.writable=!!t)},"set")},writableFinished:{__proto__:null,get:o(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:o(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:o(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:o(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:o(function(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:o(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:o(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:o(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:o(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:o(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var Rb=yr.destroy;$.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[xi].length)&&Gt.nextTick(eo,i),Rb.call(this,t,e),this};$.prototype._undestroy=yr.undestroy;$.prototype._destroy=function(t,e){e(t)};$.prototype[bb.captureRejectionSymbol]=function(t){this.destroy(t)};var Js;function uf(){return Js===void 0&&(Js={}),Js}o(uf,"lazyWebStreams");$.fromWeb=function(t,e){return uf().newStreamWritableFromWritableStream(t,e)};$.toWeb=function(t){return uf().newWritableStreamFromStreamWritable(t)}});var If=O((JE,Ff)=>{var no=Ft(),Nb=ve(),{isReadable:Lb,isWritable:Cb,isIterable:hf,isNodeStream:Bb,isReadableNodeStream:pf,isWritableNodeStream:yf,isDuplexNodeStream:Db,isReadableStream:mf,isWritableStream:bf}=Qe(),gf=ht(),{AbortError:kf,codes:{ERR_INVALID_ARG_TYPE:Mb,ERR_INVALID_RETURN_VALUE:wf}}=ae(),{destroyer:vi}=Vt(),Wb=tt(),vf=ln(),Ub=mr(),{createDeferredPromise:Sf}=re(),Ef=qs(),_f=globalThis.Blob||Nb.Blob,jb=o(typeof _f<"u"?function(e){return e instanceof _f}:function(e){return!1},"isBlob"),qb=globalThis.AbortController||hi().AbortController,{FunctionPrototypeCall:xf}=q(),Pt=class extends Wb{static{o(this,"Duplexify")}constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Ff.exports=o(function t(e,i){if(Db(e))return e;if(pf(e))return ki({readable:e});if(yf(e))return ki({writable:e});if(Bb(e))return ki({writable:!1,readable:!1});if(mf(e))return ki({readable:vf.fromWeb(e)});if(bf(e))return ki({writable:Ub.fromWeb(e)});if(typeof e=="function"){let{value:r,write:s,final:a,destroy:c}=$b(e);if(hf(r))return Ef(Pt,r,{objectMode:!0,write:s,final:a,destroy:c});let l=r?.then;if(typeof l=="function"){let f,d=xf(l,r,h=>{if(h!=null)throw new wf("nully","body",h)},h=>{vi(f,h)});return f=new Pt({objectMode:!0,readable:!1,write:s,final:o(function(h){a(async()=>{try{await d,no.nextTick(h,null)}catch(b){no.nextTick(h,b)}})},"final"),destroy:c})}throw new wf("Iterable, AsyncIterable or AsyncFunction",i,r)}if(jb(e))return t(e.arrayBuffer());if(hf(e))return Ef(Pt,e,{objectMode:!0,writable:!1});if(mf(e?.readable)&&bf(e?.writable))return Pt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?pf(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?yf(e?.writable)?e?.writable:t(e.writable):void 0;return ki({readable:r,writable:s})}let n=e?.then;if(typeof n=="function"){let r;return xf(n,e,s=>{s!=null&&r.push(s),r.push(null)},s=>{vi(r,s)}),r=new Pt({objectMode:!0,writable:!1,read:o(function(){},"read")})}throw new Mb(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function $b(t){let{promise:e,resolve:i}=Sf(),n=new qb,r=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:c,done:l,cb:f}=await a;if(no.nextTick(f),l)return;if(r.aborted)throw new kf(void 0,{cause:r.reason});({promise:e,resolve:i}=Sf()),yield c}}(),{signal:r}),write:o(function(a,c,l){let f=i;i=null,f({chunk:a,done:!1,cb:l})},"write"),final:o(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:o(function(a,c){n.abort(),c(a)},"destroy")}}o($b,"fromAsyncGen");function ki(t){let e=t.readable&&typeof t.readable.read!="function"?vf.wrap(t.readable):t.readable,i=t.writable,n=!!Lb(e),r=!!Cb(i),s,a,c,l,f;function d(h){let b=l;l=null,b?b(h):h&&f.destroy(h)}return o(d,"onfinished"),f=new Pt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(gf(i,h=>{r=!1,h&&vi(e,h),d(h)}),f._write=function(h,b,y){i.write(h,b)?y():s=y},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(s){let h=s;s=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),n&&(gf(e,h=>{n=!1,h&&vi(e,h),d(h)}),e.on("readable",function(){if(c){let h=c;c=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){c=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,b){!h&&l!==null&&(h=new kf),c=null,s=null,a=null,l===null?b(h):(l=b,vi(i,h),vi(e,h))},f}o(ki,"_duplexify")});var tt=O((ZE,Tf)=>{"use strict";var{ObjectDefineProperties:zb,ObjectGetOwnPropertyDescriptor:pt,ObjectKeys:Vb,ObjectSetPrototypeOf:Af}=q();Tf.exports=Be;var oo=ln(),Oe=mr();Af(Be.prototype,oo.prototype);Af(Be,oo);{let t=Vb(Oe.prototype);for(let e=0;e<t.length;e++){let i=t[e];Be.prototype[i]||(Be.prototype[i]=Oe.prototype[i])}}function Be(t){if(!(this instanceof Be))return new Be(t);oo.call(this,t),Oe.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}o(Be,"Duplex");zb(Be.prototype,{writable:{__proto__:null,...pt(Oe.prototype,"writable")},writableHighWaterMark:{__proto__:null,...pt(Oe.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...pt(Oe.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...pt(Oe.prototype,"writableBuffer")},writableLength:{__proto__:null,...pt(Oe.prototype,"writableLength")},writableFinished:{__proto__:null,...pt(Oe.prototype,"writableFinished")},writableCorked:{__proto__:null,...pt(Oe.prototype,"writableCorked")},writableEnded:{__proto__:null,...pt(Oe.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...pt(Oe.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:o(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:o(function(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")}});var ro;function Pf(){return ro===void 0&&(ro={}),ro}o(Pf,"lazyWebStreams");Be.fromWeb=function(t,e){return Pf().newStreamDuplexFromReadableWritablePair(t,e)};Be.toWeb=function(t){return Pf().newReadableWritablePairFromDuplex(t)};var so;Be.from=function(t){return so||(so=If()),so(t,"body")}});var lo=O((t_,Rf)=>{"use strict";var{ObjectSetPrototypeOf:Of,Symbol:Hb}=q();Rf.exports=yt;var{ERR_METHOD_NOT_IMPLEMENTED:Kb}=ae().codes,co=tt(),{getHighWaterMark:Gb}=on();Of(yt.prototype,co.prototype);Of(yt,co);var hn=Hb("kCallback");function yt(t){if(!(this instanceof yt))return new yt(t);let e=t?Gb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),co.call(this,t),this._readableState.sync=!1,this[hn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Yb)}o(yt,"Transform");function ao(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}o(ao,"final");function Yb(){this._final!==ao&&ao.call(this)}o(Yb,"prefinish");yt.prototype._final=ao;yt.prototype._transform=function(t,e,i){throw new Kb("_transform()")};yt.prototype._write=function(t,e,i){let n=this._readableState,r=this._writableState,s=n.length;this._transform(t,e,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),r.ended||s===n.length||n.length<n.highWaterMark?i():this[hn]=i})};yt.prototype._read=function(){if(this[hn]){let t=this[hn];this[hn]=null,t()}}});var uo=O((n_,Lf)=>{"use strict";var{ObjectSetPrototypeOf:Nf}=q();Lf.exports=Fi;var fo=lo();Nf(Fi.prototype,fo.prototype);Nf(Fi,fo);function Fi(t){if(!(this instanceof Fi))return new Fi(t);fo.call(this,t)}o(Fi,"PassThrough");Fi.prototype._transform=function(t,e,i){i(null,t)}});var Sr=O((s_,Wf)=>{var pn=Ft(),{ArrayIsArray:Xb,Promise:Jb,SymbolAsyncIterator:Qb,SymbolDispose:Zb}=q(),wr=ht(),{once:eg}=re(),tg=Vt(),Cf=tt(),{aggregateTwoErrors:ig,codes:{ERR_INVALID_ARG_TYPE:Eo,ERR_INVALID_RETURN_VALUE:ho,ERR_MISSING_ARGS:ng,ERR_STREAM_DESTROYED:rg,ERR_STREAM_PREMATURE_CLOSE:sg},AbortError:og}=ae(),{validateFunction:ag,validateAbortSignal:cg}=mi(),{isIterable:Yt,isReadable:po,isReadableNodeStream:gr,isNodeStream:Bf,isTransformStream:Ii,isWebStream:lg,isReadableStream:yo,isReadableFinished:fg}=Qe(),ug=globalThis.AbortController||hi().AbortController,mo,bo,go;function Df(t,e,i){let n=!1;t.on("close",()=>{n=!0});let r=wr(t,{readable:e,writable:i},s=>{n=!s});return{destroy:o(s=>{n||(n=!0,tg.destroyer(t,s||new rg("pipe")))},"destroy"),cleanup:r}}o(Df,"destroyer");function dg(t){return ag(t[t.length-1],"streams[stream.length - 1]"),t.pop()}o(dg,"popCallback");function wo(t){if(Yt(t))return t;if(gr(t))return hg(t);throw new Eo("val",["Readable","Iterable","AsyncIterable"],t)}o(wo,"makeAsyncIterable");async function*hg(t){bo||(bo=ln()),yield*bo.prototype[Qb].call(t)}o(hg,"fromReadable");async function br(t,e,i,{end:n}){let r,s=null,a=o(f=>{if(f&&(r=f),s){let d=s;s=null,d()}},"resume"),c=o(()=>new Jb((f,d)=>{r?d(r):s=o(()=>{r?d(r):f()},"onresolve")}),"wait");e.on("drain",a);let l=wr(e,{readable:!1},a);try{e.writableNeedDrain&&await c();for await(let f of t)e.write(f)||await c();n&&(e.end(),await c()),i()}catch(f){i(r!==f?ig(r,f):f)}finally{l(),e.off("drain",a)}}o(br,"pumpToNode");async function So(t,e,i,{end:n}){Ii(e)&&(e=e.writable);let r=e.getWriter();try{for await(let s of t)await r.ready,r.write(s).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(s){try{await r.abort(s),i(s)}catch(a){i(a)}}}o(So,"pumpToWeb");function pg(...t){return Mf(t,eg(dg(t)))}o(pg,"pipeline");function Mf(t,e,i){if(t.length===1&&Xb(t[0])&&(t=t[0]),t.length<2)throw new ng("streams");let n=new ug,r=n.signal,s=i?.signal,a=[];cg(s,"options.signal");function c(){S(new og)}o(c,"abort"),go=go||re().addAbortListener;let l;s&&(l=go(s,c));let f,d,h=[],b=0;function y(L){S(L,--b===0)}o(y,"finish");function S(L,T){var K;if(L&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=L),!(!f&&!T)){for(;h.length;)h.shift()(f);(K=l)===null||K===void 0||K[Zb](),n.abort(),T&&(f||a.forEach(Rt=>Rt()),pn.nextTick(e,f,d))}}o(S,"finishImpl");let g;for(let L=0;L<t.length;L++){let T=t[L],K=L<t.length-1,Rt=L>0,Se=K||i?.end!==!1,ei=L===t.length-1;if(Bf(T)){let le=function(rt){rt&&rt.name!=="AbortError"&&rt.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y(rt)};var A=le;if(o(le,"onError"),Se){let{destroy:rt,cleanup:jr}=Df(T,K,Rt);h.push(rt),po(T)&&ei&&a.push(jr)}T.on("error",le),po(T)&&ei&&a.push(()=>{T.removeListener("error",le)})}if(L===0)if(typeof T=="function"){if(g=T({signal:r}),!Yt(g))throw new ho("Iterable, AsyncIterable or Stream","source",g)}else Yt(T)||gr(T)||Ii(T)?g=T:g=Cf.from(T);else if(typeof T=="function"){if(Ii(g)){var I;g=wo((I=g)===null||I===void 0?void 0:I.readable)}else g=wo(g);if(g=T(g,{signal:r}),K){if(!Yt(g,!0))throw new ho("AsyncIterable",`transform[${L-1}]`,g)}else{var k;mo||(mo=uo());let le=new mo({objectMode:!0}),rt=(k=g)===null||k===void 0?void 0:k.then;if(typeof rt=="function")b++,rt.call(g,bt=>{d=bt,bt!=null&&le.write(bt),Se&&le.end(),pn.nextTick(y)},bt=>{le.destroy(bt),pn.nextTick(y,bt)});else if(Yt(g,!0))b++,br(g,le,y,{end:Se});else if(yo(g)||Ii(g)){let bt=g.readable||g;b++,br(bt,le,y,{end:Se})}else throw new ho("AsyncIterable or Promise","destination",g);g=le;let{destroy:jr,cleanup:gd}=Df(g,!1,!0);h.push(jr),ei&&a.push(gd)}}else if(Bf(T)){if(gr(g)){b+=2;let le=yg(g,T,y,{end:Se});po(T)&&ei&&a.push(le)}else if(Ii(g)||yo(g)){let le=g.readable||g;b++,br(le,T,y,{end:Se})}else if(Yt(g))b++,br(g,T,y,{end:Se});else throw new Eo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=T}else if(lg(T)){if(gr(g))b++,So(wo(g),T,y,{end:Se});else if(yo(g)||Yt(g))b++,So(g,T,y,{end:Se});else if(Ii(g))b++,So(g.readable,T,y,{end:Se});else throw new Eo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=T}else g=Cf.from(T)}return(r!=null&&r.aborted||s!=null&&s.aborted)&&pn.nextTick(c),g}o(Mf,"pipelineImpl");function yg(t,e,i,{end:n}){let r=!1;if(e.on("close",()=>{r||i(new sg)}),t.pipe(e,{end:!1}),n){let a=function(){r=!0,e.end()};var s=a;o(a,"endFn"),fg(t)?pn.nextTick(a):t.once("end",a)}else i();return wr(t,{readable:!0,writable:!1},a=>{let c=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?t.once("end",i).once("error",i):i(a)}),wr(e,{readable:!1,writable:!0},i)}o(yg,"pipe");Wf.exports={pipelineImpl:Mf,pipeline:pg}});var xo=O((a_,Vf)=>{"use strict";var{pipeline:mg}=Sr(),Er=tt(),{destroyer:bg}=Vt(),{isNodeStream:_r,isReadable:Uf,isWritable:jf,isWebStream:_o,isTransformStream:Xt,isWritableStream:qf,isReadableStream:$f}=Qe(),{AbortError:gg,codes:{ERR_INVALID_ARG_VALUE:zf,ERR_MISSING_ARGS:wg}}=ae(),Sg=ht();Vf.exports=o(function(...e){if(e.length===0)throw new wg("streams");if(e.length===1)return Er.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=Er.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=Er.from(e[y])}for(let y=0;y<e.length;++y)if(!(!_r(e[y])&&!_o(e[y]))){if(y<e.length-1&&!(Uf(e[y])||$f(e[y])||Xt(e[y])))throw new zf(`streams[${y}]`,i[y],"must be readable");if(y>0&&!(jf(e[y])||qf(e[y])||Xt(e[y])))throw new zf(`streams[${y}]`,i[y],"must be writable")}let n,r,s,a,c;function l(y){let S=a;a=null,S?S(y):y?c.destroy(y):!b&&!h&&c.destroy()}o(l,"onfinished");let f=e[0],d=mg(e,l),h=!!(jf(f)||qf(f)||Xt(f)),b=!!(Uf(d)||$f(d)||Xt(d));if(c=new Er({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(_r(f))c._write=function(S,g,I){f.write(S,g)?I():n=I},c._final=function(S){f.end(),r=S},f.on("drain",function(){if(n){let S=n;n=null,S()}});else if(_o(f)){let g=(Xt(f)?f.writable:f).getWriter();c._write=async function(I,k,A){try{await g.ready,g.write(I).catch(()=>{}),A()}catch(L){A(L)}},c._final=async function(I){try{await g.ready,g.close().catch(()=>{}),r=I}catch(k){I(k)}}}let y=Xt(d)?d.readable:d;Sg(y,()=>{if(r){let S=r;r=null,S()}})}if(b){if(_r(d))d.on("readable",function(){if(s){let y=s;s=null,y()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let y=d.read();if(y===null){s=c._read;return}if(!c.push(y))return}};else if(_o(d)){let S=(Xt(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:I}=await S.read();if(!c.push(g))return;if(I){c.push(null);return}}catch{return}}}}return c._destroy=function(y,S){!y&&a!==null&&(y=new gg),s=null,n=null,r=null,a===null?S(y):(a=S,_r(d)&&bg(d,y))},c},"compose")});var tu=O((l_,Fo)=>{"use strict";var Eg=globalThis.AbortController||hi().AbortController,{codes:{ERR_INVALID_ARG_VALUE:_g,ERR_INVALID_ARG_TYPE:yn,ERR_MISSING_ARGS:xg,ERR_OUT_OF_RANGE:kg},AbortError:it}=ae(),{validateAbortSignal:Jt,validateInteger:Hf,validateObject:Qt}=mi(),vg=q().Symbol("kWeak"),Fg=q().Symbol("kResistStopPropagation"),{finished:Ig}=ht(),Ag=xo(),{addAbortSignalNoValidate:Pg}=sn(),{isWritable:Tg,isNodeStream:Og}=Qe(),{deprecate:Rg}=re(),{ArrayPrototypePush:Ng,Boolean:Lg,MathFloor:Kf,Number:Cg,NumberIsNaN:Bg,Promise:Gf,PromiseReject:Yf,PromiseResolve:Dg,PromisePrototypeThen:Xf,Symbol:Qf}=q(),xr=Qf("kEmpty"),Jf=Qf("kEof");function Mg(t,e){if(e!=null&&Qt(e,"options"),e?.signal!=null&&Jt(e.signal,"options.signal"),Og(t)&&!Tg(t))throw new _g("stream",t,"must be writable");let i=Ag(this,t);return e!=null&&e.signal&&Pg(e.signal,i),i}o(Mg,"compose");function kr(t,e){if(typeof t!="function")throw new yn("fn",["Function","AsyncFunction"],t);e!=null&&Qt(e,"options"),e?.signal!=null&&Jt(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Kf(e.concurrency));let n=i-1;return e?.highWaterMark!=null&&(n=Kf(e.highWaterMark)),Hf(i,"options.concurrency",1),Hf(n,"options.highWaterMark",0),n+=i,o(async function*(){let s=re().AbortSignalAny([e?.signal].filter(Lg)),a=this,c=[],l={signal:s},f,d,h=!1,b=0;function y(){h=!0,S()}o(y,"onCatch");function S(){b-=1,g()}o(S,"afterItemProcessed");function g(){d&&!h&&b<i&&c.length<n&&(d(),d=null)}o(g,"maybeResume");async function I(){try{for await(let k of a){if(h)return;if(s.aborted)throw new it;try{if(k=t(k,l),k===xr)continue;k=Dg(k)}catch(A){k=Yf(A)}b+=1,Xf(k,S,y),c.push(k),f&&(f(),f=null),!h&&(c.length>=n||b>=i)&&await new Gf(A=>{d=A})}c.push(Jf)}catch(k){let A=Yf(k);Xf(A,S,y),c.push(A)}finally{h=!0,f&&(f(),f=null)}}o(I,"pump"),I();try{for(;;){for(;c.length>0;){let k=await c[0];if(k===Jf)return;if(s.aborted)throw new it;k!==xr&&(yield k),c.shift(),g()}await new Gf(k=>{f=k})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}o(kr,"map");function Wg(t=void 0){return t!=null&&Qt(t,"options"),t?.signal!=null&&Jt(t.signal,"options.signal"),o(async function*(){let i=0;for await(let r of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new it({cause:t.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}o(Wg,"asIndexedPairs");async function Zf(t,e=void 0){for await(let i of vo.call(this,t,e))return!0;return!1}o(Zf,"some");async function Ug(t,e=void 0){if(typeof t!="function")throw new yn("fn",["Function","AsyncFunction"],t);return!await Zf.call(this,async(...i)=>!await t(...i),e)}o(Ug,"every");async function jg(t,e){for await(let i of vo.call(this,t,e))return i}o(jg,"find");async function qg(t,e){if(typeof t!="function")throw new yn("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r),xr}o(i,"forEachFn");for await(let n of kr.call(this,i,e));}o(qg,"forEach");function vo(t,e){if(typeof t!="function")throw new yn("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r)?n:xr}return o(i,"filterFn"),kr.call(this,i,e)}o(vo,"filter");var ko=class extends xg{static{o(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function $g(t,e,i){var n;if(typeof t!="function")throw new yn("reducer",["Function","AsyncFunction"],t);i!=null&&Qt(i,"options"),i?.signal!=null&&Jt(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let f=new it(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Ig(this.destroy(f)),f}let s=new Eg,a=s.signal;if(i!=null&&i.signal){let f={once:!0,[vg]:this,[Fg]:!0};i.signal.addEventListener("abort",()=>s.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 it;r?e=await t(e,f,{signal:a}):(e=f,r=!0)}if(!c&&!r)throw new ko}finally{s.abort()}return e}o($g,"reduce");async function zg(t){t!=null&&Qt(t,"options"),t?.signal!=null&&Jt(t.signal,"options.signal");let e=[];for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new it(void 0,{cause:t.signal.reason});Ng(e,n)}return e}o(zg,"toArray");function Vg(t,e){let i=kr.call(this,t,e);return o(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}o(Vg,"flatMap");function eu(t){if(t=Cg(t),Bg(t))return 0;if(t<0)throw new kg("number",">= 0",t);return t}o(eu,"toIntegerOrInfinity");function Hg(t,e=void 0){return e!=null&&Qt(e,"options"),e?.signal!=null&&Jt(e.signal,"options.signal"),t=eu(t),o(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new it;for await(let s of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new it;t--<=0&&(yield s)}},"drop").call(this)}o(Hg,"drop");function Kg(t,e=void 0){return e!=null&&Qt(e,"options"),e?.signal!=null&&Jt(e.signal,"options.signal"),t=eu(t),o(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new it;for await(let s of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new it;if(t-- >0&&(yield s),t<=0)return}},"take").call(this)}o(Kg,"take");Fo.exports.streamReturningOperators={asIndexedPairs:Rg(Wg,"readable.asIndexedPairs will be removed in a future version."),drop:Hg,filter:vo,flatMap:Vg,map:kr,take:Kg,compose:Mg};Fo.exports.promiseReturningOperators={every:Ug,forEach:qg,reduce:$g,toArray:zg,some:Zf,find:jg}});var Io=O((u_,iu)=>{"use strict";var{ArrayPrototypePop:Gg,Promise:Yg}=q(),{isIterable:Xg,isNodeStream:Jg,isWebStream:Qg}=Qe(),{pipelineImpl:Zg}=Sr(),{finished:ew}=ht();Ao();function tw(...t){return new Yg((e,i)=>{let n,r,s=t[t.length-1];if(s&&typeof s=="object"&&!Jg(s)&&!Xg(s)&&!Qg(s)){let a=Gg(t);n=a.signal,r=a.end}Zg(t,(a,c)=>{a?i(a):e(c)},{signal:n,end:r})})}o(tw,"pipeline");iu.exports={finished:ew,pipeline:tw}});var Ao=O((h_,uu)=>{var{Buffer:iw}=ve(),{ObjectDefineProperty:mt,ObjectKeys:su,ReflectApply:ou}=q(),{promisify:{custom:au}}=re(),{streamReturningOperators:nu,promiseReturningOperators:ru}=tu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:cu}}=ae(),nw=xo(),{setDefaultHighWaterMark:rw,getDefaultHighWaterMark:sw}=on(),{pipeline:lu}=Sr(),{destroyer:ow}=Vt(),fu=ht(),Po=Io(),mn=Qe(),C=uu.exports=nr().Stream;C.isDestroyed=mn.isDestroyed;C.isDisturbed=mn.isDisturbed;C.isErrored=mn.isErrored;C.isReadable=mn.isReadable;C.isWritable=mn.isWritable;C.Readable=ln();for(let t of su(nu)){let i=function(...n){if(new.target)throw cu();return C.Readable.from(ou(e,this,n))};To=i,o(i,"fn");let e=nu[t];mt(i,"name",{__proto__:null,value:e.name}),mt(i,"length",{__proto__:null,value:e.length}),mt(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var To;for(let t of su(ru)){let i=function(...r){if(new.target)throw cu();return ou(e,this,r)};To=i,o(i,"fn");let e=ru[t];mt(i,"name",{__proto__:null,value:e.name}),mt(i,"length",{__proto__:null,value:e.length}),mt(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var To;C.Writable=mr();C.Duplex=tt();C.Transform=lo();C.PassThrough=uo();C.pipeline=lu;var{addAbortSignal:aw}=sn();C.addAbortSignal=aw;C.finished=fu;C.destroy=ow;C.compose=nw;C.setDefaultHighWaterMark=rw;C.getDefaultHighWaterMark=sw;mt(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:o(function(){return Po},"get")});mt(lu,au,{__proto__:null,enumerable:!0,get:o(function(){return Po.pipeline},"get")});mt(fu,au,{__proto__:null,enumerable:!0,get:o(function(){return Po.finished},"get")});C.Stream=C;C._isUint8Array=o(function(e){return e instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=o(function(e){return iw.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var du=O((y_,H)=>{"use strict";var Z=Ao(),cw=Io(),lw=Z.Readable.destroy;H.exports=Z.Readable;H.exports._uint8ArrayToBuffer=Z._uint8ArrayToBuffer;H.exports._isUint8Array=Z._isUint8Array;H.exports.isDisturbed=Z.isDisturbed;H.exports.isErrored=Z.isErrored;H.exports.isReadable=Z.isReadable;H.exports.Readable=Z.Readable;H.exports.Writable=Z.Writable;H.exports.Duplex=Z.Duplex;H.exports.Transform=Z.Transform;H.exports.PassThrough=Z.PassThrough;H.exports.addAbortSignal=Z.addAbortSignal;H.exports.finished=Z.finished;H.exports.destroy=Z.destroy;H.exports.destroy=lw;H.exports.pipeline=Z.pipeline;H.exports.compose=Z.compose;Object.defineProperty(Z,"promises",{configurable:!0,enumerable:!0,get:o(function(){return cw},"get")});H.exports.Stream=Z.Stream;H.exports.default=H.exports});var Aw={};Fn(Aw,{Async:()=>Ho,AsyncTransaction:()=>os,BigIntStats:()=>me,BigIntStatsFs:()=>$i,Dir:()=>vt,Dirent:()=>kt,Errno:()=>W,ErrnoError:()=>u,Fetch:()=>xw,FetchFS:()=>Dr,File:()=>Bt,FileSystem:()=>pe,InMemory:()=>Xi,InMemoryStore:()=>Nn,Index:()=>Br,IndexFS:()=>kn,Inode:()=>Ve,MutexLock:()=>Mr,Mutexed:()=>ea,NoSyncFile:()=>ci,Overlay:()=>vw,OverlayFS:()=>vn,Port:()=>mw,PortFS:()=>Cr,PortFile:()=>_n,PreloadFile:()=>ge,ReadStream:()=>Tt,Readonly:()=>Qo,SimpleAsyncStore:()=>as,SimpleTransaction:()=>li,Stats:()=>Y,StatsCommon:()=>ji,StatsFs:()=>qi,StoreFS:()=>Ki,Sync:()=>Fw,SyncTransaction:()=>Yi,Transaction:()=>Gi,UnmutexedOverlayFS:()=>Ur,WriteStream:()=>Ot,ZenFsType:()=>ss,_InMemory:()=>Ta,_Port:()=>dd,__MutexedFS:()=>Wr,_toUnixTimestamp:()=>Ad,access:()=>Hu,accessSync:()=>Ja,appendFile:()=>_u,appendFileSync:()=>Da,attachFS:()=>ud,checkOptions:()=>zr,chmod:()=>ju,chmodSync:()=>Ga,chown:()=>Wu,chownSync:()=>Ha,close:()=>ku,closeSync:()=>xt,configure:()=>dw,configureSingle:()=>uw,constants:()=>St,copyFile:()=>ed,copyFileSync:()=>ps,cp:()=>rd,cpSync:()=>ys,createReadStream:()=>Xu,createWriteStream:()=>Ju,credentials:()=>ye,decode:()=>ti,decodeDirListing:()=>Pn,default:()=>Iw,detachFS:()=>yw,encode:()=>Re,encodeDirListing:()=>Ee,errorMessages:()=>qr,exists:()=>pu,existsSync:()=>Ge,fchmod:()=>Ou,fchmodSync:()=>qn,fchown:()=>Tu,fchownSync:()=>jn,fdatasync:()=>Iu,fdatasyncSync:()=>ja,flagToMode:()=>zi,flagToNumber:()=>Nh,flagToString:()=>Aa,fs:()=>En,fstat:()=>xu,fstatSync:()=>Ma,fsync:()=>Fu,fsyncSync:()=>Ua,ftruncate:()=>vu,ftruncateSync:()=>Wa,futimes:()=>Ru,futimesSync:()=>$n,handleRequest:()=>xn,isAppendable:()=>ft,isBackend:()=>Ci,isBackendConfig:()=>Bi,isExclusive:()=>Hi,isReadable:()=>Et,isStatsEqual:()=>rs,isSynchronous:()=>Lh,isTruncating:()=>Vi,isWriteable:()=>be,lchmod:()=>qu,lchmodSync:()=>Ya,lchown:()=>Uu,lchownSync:()=>Ka,levenshtein:()=>$r,link:()=>Bu,linkSync:()=>za,lopenSync:()=>tn,lstat:()=>mu,lstatSync:()=>ls,lutimes:()=>zu,lutimesSync:()=>Xa,mkdir:()=>Lu,mkdirSync:()=>zn,mkdirpSync:()=>oa,mkdtemp:()=>Zu,mkdtempSync:()=>Qa,mount:()=>Mt,mountObject:()=>Qi,mounts:()=>Ae,normalizeMode:()=>_e,normalizeOptions:()=>xe,normalizePath:()=>x,normalizeTime:()=>Nt,open:()=>wu,openAsBlob:()=>od,openSync:()=>en,opendir:()=>nd,opendirSync:()=>tc,parseFlag:()=>D,promises:()=>Sn,randomIno:()=>Ui,read:()=>Pu,readFile:()=>Su,readFileSync:()=>Un,readSync:()=>$a,readdir:()=>Cu,readdirSync:()=>di,readlink:()=>Mu,readlinkSync:()=>us,readv:()=>td,readvSync:()=>Za,realpath:()=>Vu,realpathSync:()=>Ke,rename:()=>hu,renameSync:()=>La,resolveMountConfig:()=>Oi,resolveRemoteMount:()=>bw,rm:()=>Qu,rmSync:()=>hs,rmdir:()=>Nu,rmdirSync:()=>fs,rootCredentials:()=>Pd,rootIno:()=>He,setImmediate:()=>Id,size_max:()=>Ie,stat:()=>yu,statSync:()=>Pe,statfs:()=>sd,statfsSync:()=>ic,symlink:()=>Du,symlinkSync:()=>Va,truncate:()=>bu,truncateSync:()=>Ca,umount:()=>fi,unlink:()=>gu,unlinkSync:()=>Wn,unwatchFile:()=>Gu,utimes:()=>$u,utimesSync:()=>ds,version:()=>Zo,watch:()=>Yu,watchFile:()=>Ku,write:()=>Au,writeFile:()=>Eu,writeFileSync:()=>nn,writeSync:()=>qa,writev:()=>id,writevSync:()=>ec});var W=(p=>(p[p.EPERM=1]="EPERM",p[p.ENOENT=2]="ENOENT",p[p.EINTR=4]="EINTR",p[p.EIO=5]="EIO",p[p.ENXIO=6]="ENXIO",p[p.EBADF=9]="EBADF",p[p.EAGAIN=11]="EAGAIN",p[p.ENOMEM=12]="ENOMEM",p[p.EACCES=13]="EACCES",p[p.EFAULT=14]="EFAULT",p[p.ENOTBLK=15]="ENOTBLK",p[p.EBUSY=16]="EBUSY",p[p.EEXIST=17]="EEXIST",p[p.EXDEV=18]="EXDEV",p[p.ENODEV=19]="ENODEV",p[p.ENOTDIR=20]="ENOTDIR",p[p.EISDIR=21]="EISDIR",p[p.EINVAL=22]="EINVAL",p[p.ENFILE=23]="ENFILE",p[p.EMFILE=24]="EMFILE",p[p.ETXTBSY=26]="ETXTBSY",p[p.EFBIG=27]="EFBIG",p[p.ENOSPC=28]="ENOSPC",p[p.ESPIPE=29]="ESPIPE",p[p.EROFS=30]="EROFS",p[p.EMLINK=31]="EMLINK",p[p.EPIPE=32]="EPIPE",p[p.EDOM=33]="EDOM",p[p.ERANGE=34]="ERANGE",p[p.EDEADLK=35]="EDEADLK",p[p.ENAMETOOLONG=36]="ENAMETOOLONG",p[p.ENOLCK=37]="ENOLCK",p[p.ENOSYS=38]="ENOSYS",p[p.ENOTEMPTY=39]="ENOTEMPTY",p[p.ELOOP=40]="ELOOP",p[p.ENOMSG=42]="ENOMSG",p[p.EBADE=52]="EBADE",p[p.EBADR=53]="EBADR",p[p.EXFULL=54]="EXFULL",p[p.ENOANO=55]="ENOANO",p[p.EBADRQC=56]="EBADRQC",p[p.ENOSTR=60]="ENOSTR",p[p.ENODATA=61]="ENODATA",p[p.ETIME=62]="ETIME",p[p.ENOSR=63]="ENOSR",p[p.ENONET=64]="ENONET",p[p.EREMOTE=66]="EREMOTE",p[p.ENOLINK=67]="ENOLINK",p[p.ECOMM=70]="ECOMM",p[p.EPROTO=71]="EPROTO",p[p.EBADMSG=74]="EBADMSG",p[p.EOVERFLOW=75]="EOVERFLOW",p[p.EBADFD=77]="EBADFD",p[p.ESTRPIPE=86]="ESTRPIPE",p[p.ENOTSOCK=88]="ENOTSOCK",p[p.EDESTADDRREQ=89]="EDESTADDRREQ",p[p.EMSGSIZE=90]="EMSGSIZE",p[p.EPROTOTYPE=91]="EPROTOTYPE",p[p.ENOPROTOOPT=92]="ENOPROTOOPT",p[p.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",p[p.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",p[p.ENOTSUP=95]="ENOTSUP",p[p.ENETDOWN=100]="ENETDOWN",p[p.ENETUNREACH=101]="ENETUNREACH",p[p.ENETRESET=102]="ENETRESET",p[p.ETIMEDOUT=110]="ETIMEDOUT",p[p.ECONNREFUSED=111]="ECONNREFUSED",p[p.EHOSTDOWN=112]="EHOSTDOWN",p[p.EHOSTUNREACH=113]="EHOSTUNREACH",p[p.EALREADY=114]="EALREADY",p[p.EINPROGRESS=115]="EINPROGRESS",p[p.ESTALE=116]="ESTALE",p[p.EREMOTEIO=121]="EREMOTEIO",p[p.EDQUOT=122]="EDQUOT",p))(W||{}),qr={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"},u=class t extends Error{constructor(i,n=qr[i],r,s=""){super(n);this.errno=i;this.path=r;this.syscall=s;this.code=W[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static{o(this,"ErrnoError")}static fromJSON(i){let n=new t(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 t(W[i],qr[W[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}};var vd="/";function sa(t,e){let i="",n=0,r=-1,s=0,a="\0";for(let c=0;c<=t.length;++c){if(c<t.length)a=t[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===c-1||s===1))if(s===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,s=0;continue}else if(i.length!==0){i="",n=0,r=c,s=0;continue}}e&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,c):i=t.slice(r+1,c),n=c-r-1;r=c,s=0}else a==="."&&s!==-1?++s:s=-1}return i}o(sa,"normalizeString");function gt(...t){let e="";for(let n of[...t.reverse(),vd])if(n.length&&(e=`${n}/${e}`,n.startsWith("/")))break;let i=e.startsWith("/");return e=sa(e,!i),i?`/${e}`:e.length?e:"/"}o(gt,"resolve");function Fd(t){if(!t.length)return".";let e=t.startsWith("/"),i=t.endsWith("/");return t=sa(t,!e),t.length?(i&&(t+="/"),e?`/${t}`:t):e?"/":i?"./":"."}o(Fd,"normalize");function z(...t){if(!t.length)return".";let e=t.join("/");return e?.length?Fd(e):"."}o(z,"join");function _(t){if(t.length===0)return".";let e=t[0]==="/",i=-1,n=!0;for(let r=t.length-1;r>=1;--r)if(t[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}o(_,"dirname");function B(t,e){let i=0,n=-1,r=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let s=e.length-1,a=-1;for(let c=t.length-1;c>=0;--c)if(t[c]==="/"){if(!r){i=c+1;break}}else a===-1&&(r=!1,a=c+1),s>=0&&(t[c]===e[s]?--s===-1&&(n=c):(s=-1,n=a));return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}for(let s=t.length-1;s>=0;--s)if(t[s]==="/"){if(!r){i=s+1;break}}else n===-1&&(r=!1,n=s+1);return n===-1?"":t.slice(i,n)}o(B,"basename");function In(t){let e=t.startsWith("/"),i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let n=e?1:0,r=-1,s=0,a=-1,c=!0,l=t.length-1,f=0;for(;l>=n;--l){if(t[l]==="/"){if(!c){s=l+1;break}continue}a===-1&&(c=!1,a=l+1),t[l]==="."?r===-1?r=l:f!==1&&(f=1):r!==-1&&(f=-1)}if(a!==-1){let d=s===0&&e?1:s;r===-1||f===0||f===1&&r===a-1&&r===s+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,r),i.base=t.slice(d,a),i.ext=t.slice(r,a))}return s>0?i.dir=t.slice(0,s-1):e&&(i.dir="/"),i}o(In,"parse");function oa(t,e,i){i.existsSync(t)||(oa(_(t),e,i),i.mkdirSync(t,e))}o(oa,"mkdirpSync");function An(t,e,i,n,r){return Math.min(t+1,e+1,i+1,n===r?e:e+1)}o(An,"_min");function $r(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,n=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let s=new Array(i<<1);for(let b=0;b<i;)s[i+b]=t.charCodeAt(r+b),s[b]=++b;let a,c,l,f,d;for(a=0;a+3<n;){let b=e.charCodeAt(r+(c=a)),y=e.charCodeAt(r+(l=a+1)),S=e.charCodeAt(r+(f=a+2)),g=e.charCodeAt(r+(d=a+3)),I=a+=4;for(let k=0;k<i;){let A=s[i+k],L=s[k];c=An(L,c,l,b,A),l=An(c,l,f,y,A),f=An(l,f,d,S,A),I=An(f,d,I,g,A),s[k++]=I,d=f,f=l,l=c,c=L}}let h=0;for(;a<n;){let b=e.charCodeAt(r+(c=a));h=++a;for(let y=0;y<i;y++){let S=s[y];s[y]=h=S<c||h<c?S>h?h+1:S+1:b===s[i+y]?c:c+1,c=S}}return h}o($r,"levenshtein");var Id=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Re(t){if(typeof t!="string")throw new u(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}o(Re,"encode");function ti(t){if(!(t instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}o(ti,"decode");function Pn(t){return JSON.parse(ti(t),(e,i)=>e==""?i:BigInt(i))}o(Pn,"decodeDirListing");function Ee(t){return Re(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}o(Ee,"encodeDirListing");function Ad(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time")}o(Ad,"_toUnixTimestamp");function _e(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new u(22,"Invalid mode: "+t?.toString())}o(_e,"normalizeMode");function Nt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new u(22,"Invalid time.")}o(Nt,"normalizeTime");function x(t){if(t=t.toString(),t.includes("\0"))throw new u(22,"Path can not contain null character");if(t.length==0)throw new u(22,"Path can not be empty");return gt(t.replaceAll(/[/\\]+/g,"/"))}o(x,"normalizePath");function xe(t,e="utf8",i,n=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e??null,flag:i,mode:n}:{encoding:typeof t?.encoding=="string"?t.encoding:e??null,flag:typeof t?.flag=="string"?t.flag:i,mode:_e("mode"in t?t?.mode:null,n)}}o(xe,"normalizeOptions");function Ci(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}o(Ci,"isBackend");async function zr(t,e){if(typeof e!="object"||e===null)throw new u(22,"Invalid options");for(let[i,n]of Object.entries(t.options)){let r=e?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(e).filter(c=>!(c in t.options)).map(c=>({str:c,distance:$r(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new u(22,`${t.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,`${t.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)}}o(zr,"checkOptions");function Bi(t){return t!=null&&typeof t=="object"&&"backend"in t&&Ci(t.backend)}o(Bi,"isBackendConfig");var ye={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0},Pd={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var En={};Fn(En,{BigIntStatsFs:()=>$i,Dir:()=>vt,Dirent:()=>kt,ReadStream:()=>Tt,Stats:()=>Y,StatsFs:()=>qi,WriteStream:()=>Ot,access:()=>Hu,accessSync:()=>Ja,appendFile:()=>_u,appendFileSync:()=>Da,chmod:()=>ju,chmodSync:()=>Ga,chown:()=>Wu,chownSync:()=>Ha,close:()=>ku,closeSync:()=>xt,constants:()=>St,copyFile:()=>ed,copyFileSync:()=>ps,cp:()=>rd,cpSync:()=>ys,createReadStream:()=>Xu,createWriteStream:()=>Ju,exists:()=>pu,existsSync:()=>Ge,fchmod:()=>Ou,fchmodSync:()=>qn,fchown:()=>Tu,fchownSync:()=>jn,fdatasync:()=>Iu,fdatasyncSync:()=>ja,fstat:()=>xu,fstatSync:()=>Ma,fsync:()=>Fu,fsyncSync:()=>Ua,ftruncate:()=>vu,ftruncateSync:()=>Wa,futimes:()=>Ru,futimesSync:()=>$n,lchmod:()=>qu,lchmodSync:()=>Ya,lchown:()=>Uu,lchownSync:()=>Ka,link:()=>Bu,linkSync:()=>za,lopenSync:()=>tn,lstat:()=>mu,lstatSync:()=>ls,lutimes:()=>zu,lutimesSync:()=>Xa,mkdir:()=>Lu,mkdirSync:()=>zn,mkdtemp:()=>Zu,mkdtempSync:()=>Qa,mount:()=>Mt,mountObject:()=>Qi,mounts:()=>Ae,open:()=>wu,openAsBlob:()=>od,openSync:()=>en,opendir:()=>nd,opendirSync:()=>tc,promises:()=>Sn,read:()=>Pu,readFile:()=>Su,readFileSync:()=>Un,readSync:()=>$a,readdir:()=>Cu,readdirSync:()=>di,readlink:()=>Mu,readlinkSync:()=>us,readv:()=>td,readvSync:()=>Za,realpath:()=>Vu,realpathSync:()=>Ke,rename:()=>hu,renameSync:()=>La,rm:()=>Qu,rmSync:()=>hs,rmdir:()=>Nu,rmdirSync:()=>fs,stat:()=>yu,statSync:()=>Pe,statfs:()=>sd,statfsSync:()=>ic,symlink:()=>Du,symlinkSync:()=>Va,truncate:()=>bu,truncateSync:()=>Ca,umount:()=>fi,unlink:()=>gu,unlinkSync:()=>Wn,unwatchFile:()=>Gu,utimes:()=>$u,utimesSync:()=>ds,watch:()=>Yu,watchFile:()=>Ku,write:()=>Au,writeFile:()=>Eu,writeFileSync:()=>nn,writeSync:()=>qa,writev:()=>id,writevSync:()=>ec});var Vo=Li(ve(),1);var St={};Fn(St,{COPYFILE_EXCL:()=>Wi,COPYFILE_FICLONE:()=>lh,COPYFILE_FICLONE_FORCE:()=>fh,F_OK:()=>Mi,O_APPEND:()=>ze,O_CREAT:()=>te,O_DIRECT:()=>bh,O_DIRECTORY:()=>dh,O_DSYNC:()=>yh,O_EXCL:()=>qe,O_NOATIME:()=>hh,O_NOCTTY:()=>uh,O_NOFOLLOW:()=>ph,O_NONBLOCK:()=>gh,O_RDONLY:()=>oi,O_RDWR:()=>ue,O_SYMLINK:()=>mh,O_SYNC:()=>ai,O_TRUNC:()=>$e,O_WRONLY:()=>je,R_OK:()=>Fe,S_IFBLK:()=>at,S_IFCHR:()=>ct,S_IFDIR:()=>he,S_IFIFO:()=>lt,S_IFLNK:()=>Ne,S_IFMT:()=>G,S_IFREG:()=>de,S_IFSOCK:()=>ot,S_IRGRP:()=>vh,S_IROTH:()=>Ah,S_IRUSR:()=>_h,S_IRWXG:()=>is,S_IRWXO:()=>ns,S_IRWXU:()=>ts,S_ISGID:()=>Sh,S_ISUID:()=>wh,S_ISVTX:()=>Eh,S_IWGRP:()=>Fh,S_IWOTH:()=>Ph,S_IWUSR:()=>xh,S_IXGRP:()=>Ih,S_IXOTH:()=>Th,S_IXUSR:()=>kh,UV_FS_O_FILEMAP:()=>Oh,W_OK:()=>J,X_OK:()=>ch});var Mi=0,Fe=4,J=2,ch=1,Wi=1,lh=2,fh=4,oi=0,je=1,ue=2,te=64,qe=128,uh=256,$e=512,ze=1024,dh=65536,hh=262144,ph=131072,ai=1052672,yh=4096,mh=32768,bh=16384,gh=2048,G=61440,ot=49152,Ne=40960,de=32768,at=24576,he=16384,ct=8192,lt=4096,wh=2048,Sh=1024,Eh=512,ts=448,_h=256,xh=128,kh=64,is=56,vh=32,Fh=16,Ih=8,ns=7,Ah=4,Ph=2,Th=1,Oh=0;var Ie=2**32-1,He=0n;function Ia(){return Math.round(Math.random()*2**32).toString(16)}o(Ia,"_random");function Ui(){return BigInt("0x"+Ia()+Ia())}o(Ui,"randomIno");var U={ino:0,size:8,mode:12,nlink:14,uid:18,gid:22,atime:26,birthtime:34,mtime:42,ctime:50,end:58};var Ve=class{static{o(this,"Inode")}get data(){return new Uint8Array(this.buffer)}constructor(e){let i=!e;if(e??=new ArrayBuffer(U.end),e?.byteLength<U.end)throw new RangeError(`Can not create an inode from a buffer less than ${U.end} bytes`);if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Ui(),this.nlink=1,this.size=4096;let n=Date.now();this.atimeMs=n,this.mtimeMs=n,this.ctimeMs=n,this.birthtimeMs=n}get ino(){return this.view.getBigUint64(U.ino,!0)}set ino(e){this.view.setBigUint64(U.ino,e,!0)}get size(){return this.view.getUint32(U.size,!0)}set size(e){this.view.setUint32(U.size,e,!0)}get mode(){return this.view.getUint16(U.mode,!0)}set mode(e){this.view.setUint16(U.mode,e,!0)}get nlink(){return this.view.getUint32(U.nlink,!0)}set nlink(e){this.view.setUint32(U.nlink,e,!0)}get uid(){return this.view.getUint32(U.uid,!0)}set uid(e){this.view.setUint32(U.uid,e,!0)}get gid(){return this.view.getUint32(U.gid,!0)}set gid(e){this.view.setUint32(U.gid,e,!0)}get atimeMs(){return this.view.getFloat64(U.atime,!0)}set atimeMs(e){this.view.setFloat64(U.atime,e,!0)}get birthtimeMs(){return this.view.getFloat64(U.birthtime,!0)}set birthtimeMs(e){this.view.setFloat64(U.birthtime,e,!0)}get mtimeMs(){return this.view.getFloat64(U.mtime,!0)}set mtimeMs(e){this.view.setFloat64(U.mtime,e,!0)}get ctimeMs(){return this.view.getFloat64(U.ctime,!0)}set ctimeMs(e){this.view.setFloat64(U.ctime,e,!0)}toStats(){return new Y(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};var ji=class{constructor({atimeMs:e,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:s,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(e??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(n??d),this.birthtimeMs=this._convert(r??d),this.uid=this._convert(s??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))}static{o(this,"StatsCommon")}_convert(e){return this._isBigint?BigInt(e):Number(e)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.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(e){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(e&this.mode&i)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!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}},Y=class extends ji{constructor(){super(...arguments);this._isBigint=!1}static{o(this,"Stats")}},me=class extends ji{constructor(){super(...arguments);this._isBigint=!0}static{o(this,"BigIntStats")}};function rs(t,e){return t.size==e.size&&+t.atime==+e.atime&&+t.mtime==+e.mtime&&+t.ctime==+e.ctime&&t.mode==e.mode}o(rs,"isStatsEqual");var ss=525687744115,qi=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Ie;this.ffree=Ie}static{o(this,"StatsFs")}},$i=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Ie);this.ffree=BigInt(Ie)}static{o(this,"BigIntStatsFs")}};var Sn={};Fn(Sn,{FileHandle:()=>ce,access:()=>jo,appendFile:()=>No,chmod:()=>Mo,chown:()=>Bo,constants:()=>St,copyFile:()=>Or,cp:()=>Rr,exists:()=>Me,lchmod:()=>Wo,lchown:()=>Do,link:()=>Lo,lstat:()=>Fr,lutimes:()=>Uo,mkdir:()=>wn,mkdtemp:()=>qo,open:()=>we,opendir:()=>$o,readFile:()=>gn,readdir:()=>Ut,readlink:()=>Ar,realpath:()=>De,rename:()=>Oo,rm:()=>Tr,rmdir:()=>Ir,stat:()=>nt,statfs:()=>zo,symlink:()=>Co,truncate:()=>Ro,unlink:()=>bn,utimes:()=>Pr,watch:()=>fw,writeFile:()=>Pi});var Zt=Li(ve(),1);Promise.withResolvers??=function(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Rh=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function D(t){if(typeof t=="number")return Aa(t);if(!Rh.includes(t))throw new Error("Invalid flag string: "+t);return t}o(D,"parseFlag");function Aa(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}o(Aa,"flagToString");function Nh(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}o(Nh,"flagToNumber");function zi(t){let e=0;return e<<=1,e+=+Et(t),e<<=1,e+=+be(t),e<<=1,e}o(zi,"flagToMode");function Et(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}o(Et,"isReadable");function be(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}o(be,"isWriteable");function Vi(t){return t.indexOf("w")!==-1}o(Vi,"isTruncating");function ft(t){return t.indexOf("a")!==-1}o(ft,"isAppendable");function Lh(t){return t.indexOf("s")!==-1}o(Lh,"isSynchronous");function Hi(t){return t.indexOf("x")!==-1}o(Hi,"isExclusive");var Bt=class{constructor(e,i){this.fs=e;this.path=i}static{o(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},ge=class extends Bt{constructor(i,n,r,s,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:Ie}))){super(i,n);this.fs=i;this.flag=r;this.stats=s;this._buffer=a;this._position=0;this.dirty=!1;this.closed=!1;if(this.stats.size!=a.byteLength){if(Et(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}static{o(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return ft(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 Y(this.stats))}statSync(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return new Y(this.stats)}_truncate(i){if(this.closed)throw u.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!be(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,s=this.position){if(this.closed)throw u.With("EBADF",this.path,"File.write");if(this.dirty=!0,!be(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=s+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:Ie}));l.set(this._buffer),this._buffer=l}let c=i.slice(n,n+r);return this._buffer.set(c,s),this.stats.mtimeMs=Date.now(),this.position=s+c.byteLength,c.byteLength}async write(i,n,r,s){let a=this._write(i,n,r,s);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,s=this.position){let a=this._write(i,n,r,s);return this.syncSync(),a}_read(i,n=0,r=this.stats.size,s){if(this.closed)throw u.With("EBADF",this.path,"File.read");if(!Et(this.flag))throw new u(1,"File not opened with a readable mode.");this.dirty=!0,s??=this.position;let a=s+r;a>this.stats.size&&(a=s+Math.max(this.stats.size-s,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-s;return c==0||new Uint8Array(i.buffer,n,r).set(this._buffer.slice(s,a)),c}async read(i,n,r,s){let a=this._read(i,n,r,s);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,n,r,s){let a=this._read(i,n,r,s);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()}},ci=class extends ge{static{o(this,"NoSyncFile")}constructor(e,i,n,r,s){super(e,i,n,r,s)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};var _t=Li(ve(),1);var pe=class{static{o(this,"FileSystem")}metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:ss}}constructor(...e){}async ready(){}async exists(e){try{return await this.stat(e),!0}catch(i){return i.code!="ENOENT"}}existsSync(e){try{return this.statSync(e),!0}catch(i){return i.code!="ENOENT"}}};var Pa=5,Ki=class extends pe{constructor(i){super();this.store=i;this._initialized=!1}static{o(this,"StoreFS")}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 S=[];try{let r=w(S,this.store.transaction(),!0);let s=_(i),a=B(i),c=_(n),l=B(n),f=await this.findINode(r,s),d=await this.getDirListing(r,f,s);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,s);let b,y;c===s?(b=f,y=d):(b=await this.findINode(r,c),y=await this.getDirListing(r,b,c));if(y[l]){let L=await this.getINode(r,y[l],n);if(!L.toStats().isFile())throw u.With("EPERM",n,"rename");await r.remove(L.ino),await r.remove(y[l])}y[l]=h;await r.set(f.ino,Ee(d));await r.set(b.ino,Ee(y));await r.commit()}catch(g){var I=g,k=!0}finally{var A=E(S,I,k);A&&await A}}renameSync(i,n){var S=[];try{let r=w(S,this.store.transaction());let s=_(i),a=B(i),c=_(n),l=B(n),f=this.findINodeSync(r,s),d=this.getDirListingSync(r,f,s);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,s);let b,y;c===s?(b=f,y=d):(b=this.findINodeSync(r,c),y=this.getDirListingSync(r,b,c));if(y[l]){let A=this.getINodeSync(r,y[l],n);if(!A.toStats().isFile())throw u.With("EPERM",n,"rename");r.removeSync(A.ino),r.removeSync(y[l])}y[l]=h;r.setSync(f.ino,Ee(d));r.setSync(b.ino,Ee(y));r.commitSync()}catch(g){var I=g,k=!0}finally{E(S,I,k)}}async stat(i){var s=[];try{let n=w(s,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(s,c,l);f&&await f}}statSync(i){var r=[];try{let n=w(r,this.store.transaction());return this.findINodeSync(n,i).toStats()}catch(s){var a=s,c=!0}finally{E(r,a,c)}}async createFile(i,n,r){let s=await this.commitNew(i,32768,r,new Uint8Array(0));return new ge(this,i,n,s.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=w(c,this.store.transaction(),!0);let s=await this.findINode(r,i),a=await r.get(s.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new ge(this,i,n,s.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=w(c,this.store.transaction());let s=this.findINodeSync(r,i),a=r.getSync(s.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new ge(this,i,n,s.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,Re("{}"))}mkdirSync(i,n){this.commitNewSync(i,16384,n,Re("{}"))}async readdir(i){var s=[];try{let n=w(s,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(s,c,l);f&&await f}}readdirSync(i){var s=[];try{let n=w(s,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(s,c,l)}}async sync(i,n,r){var f=[];try{let s=w(f,this.store.transaction(),!0);let a=await this._findINode(s,_(i),B(i)),c=await this.getINode(s,a,i),l=c.update(r);await s.set(c.ino,n);l&&await s.set(a,c.data);await s.commit()}catch(d){var h=d,b=!0}finally{var y=E(f,h,b);y&&await y}}syncSync(i,n,r){var f=[];try{let s=w(f,this.store.transaction());let a=this._findINodeSync(s,_(i),B(i)),c=this.getINodeSync(s,a,i),l=c.update(r);s.setSync(c.ino,n);l&&s.setSync(a,c.data);s.commitSync()}catch(d){var h=d,b=!0}finally{E(f,h,b)}}async link(i,n){var d=[];try{let r=w(d,this.store.transaction(),!0);let s=_(n),a=await this.findINode(r,s),c=await this.getDirListing(r,a,s);let l=await this._findINode(r,_(i),B(i));let f=await this.getINode(r,l,i);f.nlink++;c[B(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,Ee(c));r.commitSync()}catch(h){var b=h,y=!0}finally{var S=E(d,b,y);S&&await S}}linkSync(i,n){var d=[];try{let r=w(d,this.store.transaction());let s=_(n),a=this.findINodeSync(r,s),c=this.getDirListingSync(r,a,s);let l=this._findINodeSync(r,_(i),B(i));let f=this.getINodeSync(r,l,i);f.nlink++;c[B(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,Ee(c));r.commitSync()}catch(h){var b=h,y=!0}finally{E(d,b,y)}}async checkRoot(){var r=[];try{let i=w(r,this.store.transaction(),!0);if(await i.get(He))return;let n=new Ve;n.mode=16895;await i.set(n.ino,Re("{}"));await i.set(He,n.data);await i.commit()}catch(s){var a=s,c=!0}finally{var l=E(r,a,c);l&&await l}}checkRootSync(){var r=[];try{let i=w(r,this.store.transaction());if(i.getSync(He))return;let n=new Ve;n.mode=16895;i.setSync(n.ino,Re("{}"));i.setSync(He,n.data);i.commitSync()}catch(s){var a=s,c=!0}finally{E(r,a,c)}}async _findINode(i,n,r,s=new Set){let a=z(n,r);if(s.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(s.add(a),n=="/"&&r==="")return He;let c=n=="/"?await this.getINode(i,He,n):await this.findINode(i,n,s),l=await this.getDirListing(i,c,n);if(!(r in l))throw u.With("ENOENT",gt(n,r),"_findINode");return l[r]}_findINodeSync(i,n,r,s=new Set){let a=z(n,r);if(s.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(s.add(a),n=="/"&&r==="")return He;let c=n=="/"?this.getINodeSync(i,He,n):this.findINodeSync(i,n,s),l=this.getDirListingSync(i,c,n);if(!(r in l))throw u.With("ENOENT",gt(n,r),"_findINode");return l[r]}async findINode(i,n,r=new Set){let s=await this._findINode(i,_(n),B(n),r);return this.getINode(i,s,n)}findINodeSync(i,n,r=new Set){let s=this._findINodeSync(i,_(n),B(n),r);return this.getINodeSync(i,s,n)}async getINode(i,n,r){let s=await i.get(n);if(!s)throw u.With("ENOENT",r,"getINode");return new Ve(s.buffer)}getINodeSync(i,n,r){let s=i.getSync(n);if(!s)throw u.With("ENOENT",r,"getINode");return new Ve(s.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let s=await i.get(n.ino);if(!s)throw u.With("ENOENT",r,"getDirListing");return Pn(s)}getDirListingSync(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let s=i.getSync(n.ino);if(!s)throw u.With("ENOENT",r,"getDirListing");return Pn(s)}async addNew(i,n,r){for(let s=0;s<Pa;s++){let a=Ui();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 s=0;s<Pa;s++){let a=Ui();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,s){var b=[];try{let a=w(b,this.store.transaction(),!0);let c=_(i),l=await this.findINode(a,c);let f=B(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 Ve;h.ino=await this.addNew(a,s,i);h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;h.size=s.length;d[f]=await this.addNew(a,h.data,i);await a.set(l.ino,Ee(d));await a.commit();return h}catch(y){var S=y,g=!0}finally{var I=E(b,S,g);I&&await I}}commitNewSync(i,n,r,s=new Uint8Array){var b=[];try{let a=w(b,this.store.transaction());let c=_(i),l=this.findINodeSync(a,c);let f=B(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 Ve;h.ino=this.addNewSync(a,s,i);h.size=s.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,Ee(d));a.commitSync();return h}catch(y){var S=y,g=!0}finally{E(b,S,g)}}async remove(i,n){var h=[];try{let r=w(h,this.store.transaction(),!0);let s=_(i),a=await this.findINode(r,s),c=await this.getDirListing(r,a,s),l=B(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,Ee(c));--d.nlink<1&&(await r.remove(d.ino),await r.remove(f));await r.commit()}catch(b){var y=b,S=!0}finally{var g=E(h,y,S);g&&await g}}removeSync(i,n){var h=[];try{let r=w(h,this.store.transaction());let s=_(i),a=this.findINodeSync(r,s),c=this.getDirListingSync(r,a,s),l=B(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,Ee(c));--d.nlink<1&&(r.removeSync(d.ino),r.removeSync(f));r.commitSync()}catch(b){var y=b,S=!0}finally{E(h,y,S)}}};var Gi=class{constructor(e){this.store=e;this.done=!1}static{o(this,"Transaction")}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}},Yi=class extends Gi{static{o(this,"SyncTransaction")}async get(e){return this.getSync(e)}async set(e,i){return this.setSync(e,i)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},os=class extends Gi{static{o(this,"AsyncTransaction")}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")}};var as=class{constructor(){this.cache=new Map;this.queue=new Set}static{o(this,"SimpleAsyncStore")}get(e){return this.cache.get(e)}set(e,i){this.cache.set(e,i),this.queue.add(this._set(e,i))}delete(e){this.cache.delete(e),this.queue.add(this._delete(e))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[e,i]of await this.entries())this.cache.has(e)||this.cache.set(e,i);for(let e of this.queue)await e}transaction(){return new li(this)}},li=class extends Yi{constructor(){super(...arguments);this.originalData=new Map;this.modifiedKeys=new Set}static{o(this,"SimpleTransaction")}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))}};var Nn=class extends Map{constructor(i="tmp"){super();this.name=i}static{o(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new li(this)}},Ta={name:"InMemory",isAvailable:o(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:o(function({name:t}){let e=new Ki(new Nn(t));return e.checkRootSync(),e},"create")},Xi=Ta;var Dt=new Map,Ch=100;function Ji(t){let e=Ch++;return Dt.set(e,t),e}o(Ji,"file2fd");function j(t){if(!Dt.has(t))throw new u(9);return Dt.get(t)}o(j,"fd2file");var Ae=new Map;Mt("/",Xi.create({name:"root"}));function Mt(t,e){if(t[0]!=="/"&&(t="/"+t),t=gt(t),Ae.has(t))throw new u(22,"Mount point "+t+" is already in use.");Ae.set(t,e)}o(Mt,"mount");function fi(t){if(t[0]!=="/"&&(t=`/${t}`),t=gt(t),!Ae.has(t))throw new u(22,"Mount point "+t+" is already unmounted.");Ae.delete(t)}o(fi,"umount");function R(t){t=x(t);let e=[...Ae].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:n,path:t,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}o(R,"resolveMount");function Oa(t,e){for(let[i,n]of Object.entries(e))t=t?.replaceAll(i,n);return t}o(Oa,"fixPaths");function X(t,e){return typeof t.stack=="string"&&(t.stack=Oa(t.stack,e)),t.message=Oa(t.message,e),t}o(X,"fixError");function Qi(t){"/"in t&&fi("/");for(let[e,i]of Object.entries(t))Mt(e,i)}o(Qi,"mountObject");function Ln(t,e){let i=t.metadata(),n=i.blockSize||4096;return{type:(e?BigInt:Number)(i.type),bsize:(e?BigInt:Number)(n),ffree:(e?BigInt:Number)(i.freeNodes||Ie),files:(e?BigInt:Number)(i.totalNodes||Ie),bavail:(e?BigInt:Number)(i.freeSpace/n),bfree:(e?BigInt:Number)(i.freeSpace/n),blocks:(e?BigInt:Number)(i.totalSpace/n)}}o(Ln,"_statfs");var Bn=Li(Na(),1);var Dn=class extends Bn.default{constructor(i){super();this.path=i}static{o(this,"Watcher")}off(i,n,r,s){return super.off(i,n,r,s)}removeListener(i,n,r,s){return super.removeListener(i,n,r,s)}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}},ui=class extends Dn{constructor(i,n){super(i);this.options=n;Mh(i.toString(),this)}static{o(this,"FSWatcher")}close(){super.emit("close"),Wh(this.path.toString(),this)}[Symbol.dispose](){this.close()}},Mn=class extends Dn{constructor(i,n){super(i);this.options=n;this.start()}static{o(this,"StatWatcher")}onInterval(){try{let i=Pe(this.path);rs(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=Pe(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()}},Le=new Map;function Mh(t,e){let i=x(t);Le.has(i)||Le.set(i,new Set),Le.get(i).add(e)}o(Mh,"addWatcher");function Wh(t,e){let i=x(t);Le.has(i)&&(Le.get(i).delete(e),Le.get(i).size===0&&Le.delete(i))}o(Wh,"removeWatcher");function M(t,e){let i=x(e);if(Le.has(i))for(let r of Le.get(i))r.emit("change",t,B(e));let n=_(i);for(;n!==i&&n!=="/";){if(Le.has(n))for(let r of Le.get(n))r.emit("change",t,B(e));i=n,n=_(n)}}o(M,"emitChange");function La(t,e){t=x(t),e=x(e);let i=R(t),n=R(e);if(!Pe(_(t)).hasAccess(2))throw u.With("EACCES",t,"rename");try{if(i===n){i.fs.renameSync(i.path,n.path),M("rename",t.toString());return}nn(e,Un(t)),Wn(t),M("rename",t.toString())}catch(r){throw X(r,{[i.path]:t,[n.path]:e})}}o(La,"renameSync");function Ge(t){t=x(t);try{let{fs:e,path:i}=R(Ke(t));return e.existsSync(i)}catch(e){if(e.errno==2)return!1;throw e}}o(Ge,"existsSync");function Pe(t,e){t=x(t);let{fs:i,path:n}=R(Ge(t)?Ke(t):t);try{let r=i.statSync(n);if(!r.hasAccess(4))throw u.With("EACCES",t,"stat");return e?.bigint?new me(r):r}catch(r){throw X(r,{[n]:t})}}o(Pe,"statSync");function ls(t,e){t=x(t);let{fs:i,path:n}=R(t);try{let r=i.statSync(n);return e?.bigint?new me(r):r}catch(r){throw X(r,{[n]:t})}}o(ls,"lstatSync");function Ca(t,e=0){var n=[];try{let i=w(n,Wt(t,"r+"));e||=0;if(e<0)throw new u(22);i.truncateSync(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}o(Ca,"truncateSync");function Wn(t){t=x(t);let{fs:e,path:i}=R(t);try{if(!e.statSync(i).hasAccess(2))throw u.With("EACCES",i,"unlink");e.unlinkSync(i),M("rename",t.toString())}catch(n){throw X(n,{[i]:t})}}o(Wn,"unlinkSync");function Wt(t,e,i,n=!0){t=x(t);let r=_e(i,420),s=D(e);t=n&&Ge(t)?Ke(t):t;let{fs:a,path:c}=R(t);if(!a.existsSync(c)){if(!be(s)&&!ft(s)||s=="r+")throw u.With("ENOENT",t,"_open");let d=a.statSync(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(t),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(t),"_open");return a.createFileSync(c,s,r)}let l=a.statSync(c);if(!l.hasAccess(r)||!l.hasAccess(zi(s)))throw u.With("EACCES",t,"_open");if(Hi(s))throw u.With("EEXIST",t,"_open");let f=a.openFileSync(c,s);return Vi(s)&&(f.truncateSync(0),f.syncSync()),f}o(Wt,"_openSync");function en(t,e,i=0){return Ji(Wt(t,e,i,!0))}o(en,"openSync");function tn(t,e,i){return Ji(Wt(t,e,i,!1))}o(tn,"lopenSync");function Ba(t,e,i){var a=[];try{let n=w(a,Wt(t,e,420,i));let r=n.statSync();let s=new Uint8Array(r.size);n.readSync(s,0,r.size,0);return s}catch(c){var l=c,f=!0}finally{E(a,l,f)}}o(Ba,"_readFileSync");function Un(t,e={}){let i=xe(e,null,"r",420),n=D(i.flag);if(!Et(n))throw new u(22,"Flag passed to readFile must allow for reading.");let r=_t.Buffer.from(Ba(typeof t=="number"?j(t).path:t.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}o(Un,"readFileSync");function nn(t,e,i={}){var c=[];try{let n=xe(i,"utf8","w+",420);let r=D(n.flag);if(!be(r))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?_t.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!s)throw new u(22,"Data not specified");let a=w(c,Wt(typeof t=="number"?j(t).path:t.toString(),r,n.mode,!0));a.writeSync(s,0,s.byteLength,0);M("change",t.toString())}catch(l){var f=l,d=!0}finally{E(c,f,d)}}o(nn,"writeFileSync");function Da(t,e,i={}){var c=[];try{let n=xe(i,"utf8","a",420);let r=D(n.flag);if(!ft(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?_t.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=w(c,Wt(typeof t=="number"?j(t).path:t.toString(),r,n.mode,!0));a.writeSync(s,0,s.byteLength)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}o(Da,"appendFileSync");function Ma(t,e){let i=j(t).statSync();return e?.bigint?new me(i):i}o(Ma,"fstatSync");function xt(t){j(t).closeSync(),Dt.delete(t)}o(xt,"closeSync");function Wa(t,e=0){if(e||=0,e<0)throw new u(22);j(t).truncateSync(e)}o(Wa,"ftruncateSync");function Ua(t){j(t).syncSync()}o(Ua,"fsyncSync");function ja(t){j(t).datasyncSync()}o(ja,"fdatasyncSync");function qa(t,e,i,n,r){let s,a,c,l;if(typeof e=="string"){l=typeof i=="number"?i:null;let h=typeof n=="string"?n:"utf8";a=0,s=_t.Buffer.from(e,h),c=s.byteLength}else s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=n,l=typeof r=="number"?r:null;let f=j(t);l??=f.position;let d=f.writeSync(s,a,c,l);return M("change",f.path),d}o(qa,"writeSync");function $a(t,e,i,n,r){let s=j(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=s.position),s.readSync(e,a,n,r)}o($a,"readSync");function jn(t,e,i){j(t).chownSync(e,i)}o(jn,"fchownSync");function qn(t,e){let i=_e(e,-1);if(i<0)throw new u(22,"Invalid mode.");j(t).chmodSync(i)}o(qn,"fchmodSync");function $n(t,e,i){j(t).utimesSync(Nt(e),Nt(i))}o($n,"futimesSync");function fs(t){t=x(t);let{fs:e,path:i}=R(Ge(t)?Ke(t):t);try{if(!e.statSync(i).hasAccess(2))throw u.With("EACCES",i,"rmdir");e.rmdirSync(i),M("rename",t.toString())}catch(n){throw X(n,{[i]:t})}}o(fs,"rmdirSync");function zn(t,e){e=typeof e=="object"?e:{mode:e};let i=_e(e?.mode,511);t=x(t),t=Ge(t)?Ke(t):t;let{fs:n,path:r}=R(t),s={[r]:t};try{if(!e?.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=t;!n.existsSync(c);c=_(c),l=_(l))a.unshift(c),s[c]=l;for(let c of a){if(!n.statSync(_(c)).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");n.mkdirSync(c,i),M("rename",c)}return a[0]}catch(a){throw X(a,s)}}o(zn,"mkdirSync");function di(t,e){t=x(t);let{fs:i,path:n}=R(Ge(t)?Ke(t):t),r;if(!Pe(t).hasAccess(4))throw u.With("EACCES",t,"readdir");try{r=i.readdirSync(n)}catch(s){throw X(s,{[n]:t})}for(let s of Ae.keys()){if(!s.startsWith(t))continue;let a=s.slice(t.length);a.includes("/")||a.length==0||r.push(a)}return r.map(s=>typeof e=="object"&&e?.withFileTypes?new kt(s,Pe(z(t.toString(),s))):e=="buffer"||typeof e=="object"&&e?.encoding=="buffer"?_t.Buffer.from(s):s)}o(di,"readdirSync");function za(t,e){if(t=x(t),!Pe(_(t)).hasAccess(4))throw u.With("EACCES",_(t),"link");if(e=x(e),!Pe(_(e)).hasAccess(2))throw u.With("EACCES",_(e),"link");let{fs:i,path:n}=R(t),r=R(e);if(i!=r.fs)throw u.With("EXDEV",e,"link");try{if(!i.statSync(n).hasAccess(2))throw u.With("EACCES",n,"link");return i.linkSync(n,e)}catch(s){throw X(s,{[n]:t,[r.path]:e})}}o(za,"linkSync");function Va(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(Ge(e))throw u.With("EEXIST",e.toString(),"symlink");nn(e,t.toString()),Wt(e,"r+",420,!1)._setTypeSync(40960)}o(Va,"symlinkSync");function us(t,e){let i=_t.Buffer.from(Ba(t.toString(),"r",!1)),n=typeof e=="object"?e?.encoding:e;return n=="buffer"?i:i.toString(n)}o(us,"readlinkSync");function Ha(t,e,i){let n=en(t,"r+");jn(n,e,i),xt(n)}o(Ha,"chownSync");function Ka(t,e,i){let n=tn(t,"r+");jn(n,e,i),xt(n)}o(Ka,"lchownSync");function Ga(t,e){let i=en(t,"r+");qn(i,e),xt(i)}o(Ga,"chmodSync");function Ya(t,e){let i=tn(t,"r+");qn(i,e),xt(i)}o(Ya,"lchmodSync");function ds(t,e,i){let n=en(t,"r+");$n(n,e,i),xt(n)}o(ds,"utimesSync");function Xa(t,e,i){let n=tn(t,"r+");$n(n,e,i),xt(n)}o(Xa,"lutimesSync");function Ke(t,e){t=x(t);let{base:i,dir:n}=In(t),r=z(n=="/"?"/":Ke(n),i),{fs:s,path:a,mountPoint:c}=R(r);try{return s.statSync(a).isSymbolicLink()?Ke(c+us(r,e).toString()):r}catch(l){throw X(l,{[a]:r})}}o(Ke,"realpathSync");function Ja(t,e=384){if(!Pe(t).hasAccess(e))throw new u(13)}o(Ja,"accessSync");function hs(t,e){switch(t=x(t),Pe(t).mode&61440){case 16384:if(e?.recursive)for(let n of di(t))hs(z(t,n),e);fs(t);return;case 32768:case 40960:Wn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}}o(hs,"rmSync");function Qa(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return zn(r),i=="buffer"?_t.Buffer.from(r):r}o(Qa,"mkdtempSync");function ps(t,e,i){if(t=x(t),e=x(e),i&&i&1&&Ge(e))throw new u(17,"Destination file already exists.",e,"copyFile");nn(e,Un(t)),M("rename",e.toString())}o(ps,"copyFileSync");function Za(t,e,i){let n=j(t),r=0;for(let s of e)r+=n.readSync(s,0,s.byteLength,i+r);return r}o(Za,"readvSync");function ec(t,e,i){let n=j(t),r=0;for(let s of e)r+=n.writeSync(new Uint8Array(s.buffer),0,s.byteLength,i+r);return r}o(ec,"writevSync");function tc(t,e){return t=x(t),new vt(t)}o(tc,"opendirSync");function ys(t,e,i){t=x(t),e=x(e);let n=ls(t);if(i?.errorOnExist&&Ge(e))throw new u(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,t+" is a directory (not copied)",t,"cp");zn(e,{recursive:!0});for(let r of di(t,{withFileTypes:!0}))i.filter&&!i.filter(z(t,r.name),z(e,r.name))||ys(z(t,r.name),z(e,r.name),i);break;case 32768:case 40960:ps(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&ds(e,n.atime,n.mtime)}o(ys,"cpSync");function ic(t,e){t=x(t);let{fs:i}=R(t);return Ln(i,e?.bigint)}o(ic,"statfsSync");var kt=class{constructor(e,i){this.path=e;this.stats=i}static{o(this,"Dirent")}get name(){return B(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()}},vt=class{constructor(e){this.path=e;this.closed=!1}static{o(this,"Dir")}checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??=await Ut(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}read(e){if(!e)return this._read();this._read().then(i=>e(void 0,i))}readSync(){return this.checkClosed(),this._entries??=di(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}async next(){let e=await this._read();return e?{done:!1,value:e}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}};var vr=Li(du(),1);var Tt=class extends vr.Readable{static{o(this,"ReadStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new u(5,i.toString()))}}},Ot=class extends vr.Writable{static{o(this,"WriteStream")}close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(new u(5,i.toString()))}}};var ce=class{static{o(this,"FileHandle")}constructor(e){let i=typeof e!="number";this.fd=i?Ji(e):e,this.file=i?e:j(e)}async chown(e,i){await this.file.chown(e,i),M("change",this.file.path)}async chmod(e){let i=_e(e,-1);if(i<0)throw new u(22,"Invalid mode.");await this.file.chmod(i),M("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(e){if(e||=0,e<0)throw new u(22);await this.file.truncate(e),M("change",this.file.path)}async utimes(e,i){await this.file.utimes(Nt(e),Nt(i)),M("change",this.file.path)}async appendFile(e,i={}){let n=xe(i,"utf8","a",420),r=D(n.flag);if(!ft(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?Zt.Buffer.from(e,n.encoding):e;await this.file.write(s,0,s.length),M("change",this.file.path)}read(e,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(e,i,n,r)}async readFile(e){let i=xe(e,null,"r",292),n=D(i.flag);if(!Et(n))throw new u(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),{buffer:s}=await this.file.read(new Uint8Array(r),0,r,0),a=Zt.Buffer.from(s);return i.encoding?a.toString(i.encoding):a}readableWebStream(e={}){let i=o(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(s){r.error(s)}},"start"),n=globalThis;if(!("ReadableStream"in n))throw new u(38,"ReadableStream is missing on globalThis");return new n.ReadableStream({start:i,type:e.type})}readLines(e){throw u.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();if(!i.hasAccess(4))throw u.With("EACCES",this.file.path,"stat");return e?.bigint?new me(i):i}async write(e,i,n,r){let s,a,c;if(typeof e=="string"){r=typeof i=="number"?i:null;let f=typeof n=="string"?n:"utf8";a=0,s=Zt.Buffer.from(e,f),c=s.length}else s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=i,c=n,r=typeof r=="number"?r:null;r??=this.file.position;let l=await this.file.write(s,a,c,r);return M("change",this.file.path),{buffer:s,bytesWritten:l}}async writeFile(e,i={}){let n=xe(i,"utf8","w",420),r=D(n.flag);if(!be(r))throw new u(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?Zt.Buffer.from(e,n.encoding):e;await this.file.write(s,0,s.length,0),M("change",this.file.path)}async close(){await this.file.close(),Dt.delete(this.fd)}async writev(e,i){let n=0;for(let r of e)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,i){let n=0;for(let r of e)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){let i=new Tt({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:o(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(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:o(async(r,s,a)=>{try{let{bytesWritten:c}=await this.write(r,null,s);a(c==r.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},n=new Ot(i);return n.path=this.file.path,n}};async function Oo(t,e){t=x(t),e=x(e);let i=R(t),n=R(e);if(!(await nt(_(t))).hasAccess(2))throw u.With("EACCES",t,"rename");try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path),M("rename",t.toString());return}await Pi(e,await gn(t)),await bn(t),M("rename",t.toString())}catch(r){throw X(r,{[i.path]:t,[n.path]:e})}}o(Oo,"rename");async function Me(t){try{let{fs:e,path:i}=R(await De(t));return await e.exists(i)}catch(e){if(e instanceof u&&e.code=="ENOENT")return!1;throw e}}o(Me,"exists");async function nt(t,e){t=x(t);let{fs:i,path:n}=R(await Me(t)?await De(t):t);try{let r=await i.stat(n);if(!r.hasAccess(4))throw u.With("EACCES",t,"stat");return e?.bigint?new me(r):r}catch(r){throw X(r,{[n]:t})}}o(nt,"stat");async function Fr(t,e){t=x(t);let{fs:i,path:n}=R(t);try{let r=await i.stat(n);return e?.bigint?new me(r):r}catch(r){throw X(r,{[n]:t})}}o(Fr,"lstat");async function Ro(t,e=0){var n=[];try{let i=w(n,await we(t,"r+"),!0);await i.truncate(e)}catch(r){var s=r,a=!0}finally{var c=E(n,s,a);c&&await c}}o(Ro,"truncate");async function bn(t){t=x(t);let{fs:e,path:i}=R(t);try{if(!(await e.stat(i)).hasAccess(2))throw u.With("EACCES",i,"unlink");await e.unlink(i),M("rename",t.toString())}catch(n){throw X(n,{[i]:t})}}o(bn,"unlink");async function Ai(t,e,i=420,n){t=x(t);let r=_e(i,420),s=D(e);t=n&&await Me(t)?await De(t):t;let{fs:a,path:c}=R(t),l=await a.stat(c).catch(()=>null);if(!l){if(!be(s)&&!ft(s)||s=="r+")throw u.With("ENOENT",t,"_open");let d=await a.stat(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(t),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(t),"_open");return new ce(await a.createFile(c,s,r))}if(!l.hasAccess(zi(s)))throw u.With("EACCES",t,"_open");if(Hi(s))throw u.With("EEXIST",t,"_open");let f=new ce(await a.openFile(c,s));return Vi(s)&&(await f.truncate(0),await f.sync()),f}o(Ai,"_open");async function we(t,e="r",i=420){return await Ai(t,e,i,!0)}o(we,"open");async function gn(t,e){var r=[];try{let i=xe(e,null,"r",420);let n=w(r,typeof t=="object"&&"fd"in t?t:await we(t,i.flag,i.mode),!0);return await n.readFile(i)}catch(s){var a=s,c=!0}finally{var l=E(r,a,c);l&&await l}}o(gn,"readFile");async function Pi(t,e,i){var a=[];try{let n=xe(i,"utf8","w+",420);let r=w(a,t instanceof ce?t:await we(t.toString(),n.flag,n.mode),!0);let s=e;if(typeof s!="string"&&!(s instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(s,n)}catch(c){var l=c,f=!0}finally{var d=E(a,l,f);d&&await d}}o(Pi,"writeFile");async function No(t,e,i){var c=[];try{let n=xe(i,"utf8","a",420);let r=D(n.flag);if(!ft(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let s=typeof e=="string"?Zt.Buffer.from(e,n.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=w(c,typeof t=="object"&&"fd"in t?t:await we(t,n.flag,n.mode),!0);await a.appendFile(s,n)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}o(No,"appendFile");async function Ir(t){t=x(t),t=await Me(t)?await De(t):t;let{fs:e,path:i}=R(t);try{if(!(await e.stat(i)).hasAccess(2))throw u.With("EACCES",i,"rmdir");await e.rmdir(i),M("rename",t.toString())}catch(n){throw X(n,{[i]:t})}}o(Ir,"rmdir");async function wn(t,e){e=typeof e=="object"?e:{mode:e};let i=_e(e?.mode,511);t=x(t),t=await Me(t)?await De(t):t;let{fs:n,path:r}=R(t),s={[r]:t};try{if(!e?.recursive){if(!(await n.stat(_(r))).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");await n.mkdir(r,i),M("rename",t.toString());return}let a=[];for(let c=r,l=t;!await n.exists(c);c=_(c),l=_(l))a.unshift(c),s[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),M("rename",c)}return a[0]}catch(a){throw X(a,s)}}o(wn,"mkdir");async function Ut(t,e){if(t=x(t),!(await nt(t)).hasAccess(4))throw u.With("EACCES",t,"readdir");t=await Me(t)?await De(t):t;let{fs:i,path:n}=R(t),r;try{r=await i.readdir(n)}catch(a){throw X(a,{[n]:t})}for(let a of Ae.keys())if(a.startsWith(t)){let c=a.slice(t.length);if(c.includes("/")||c.length==0)continue;r.push(c)}let s=[];for(let a of r)s.push(typeof e=="object"&&e?.withFileTypes?new kt(a,await nt(z(t,a))):a);return s}o(Ut,"readdir");async function Lo(t,e){if(t=x(t),!(await nt(_(t))).hasAccess(4))throw u.With("EACCES",_(t),"link");if(e=x(e),!(await nt(_(e))).hasAccess(2))throw u.With("EACCES",_(e),"link");let{fs:i,path:n}=R(t),r=R(e);if(i!=r.fs)throw u.With("EXDEV",e,"link");try{if(!(await i.stat(n)).hasAccess(2))throw u.With("EACCES",n,"link");return await i.link(n,r.path)}catch(s){throw X(s,{[r.path]:e,[n]:t})}}o(Lo,"link");async function Co(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await Me(e))throw u.With("EEXIST",e.toString(),"symlink");await Pi(e,t.toString()),await(await Ai(e,"r+",420,!1)).file._setType(40960)}o(Co,"symlink");async function Ar(t,e){var s=[];try{let i=w(s,await Ai(x(t),"r",420,!1),!0);let n=await i.readFile();let r=typeof e=="object"?e?.encoding:e;return r=="buffer"?n:n.toString(r)}catch(a){var c=a,l=!0}finally{var f=E(s,c,l);f&&await f}}o(Ar,"readlink");async function Bo(t,e,i){var r=[];try{let n=w(r,await we(t,"r+"),!0);await n.chown(e,i)}catch(s){var a=s,c=!0}finally{var l=E(r,a,c);l&&await l}}o(Bo,"chown");async function Do(t,e,i){var r=[];try{let n=w(r,await Ai(t,"r+",420,!1),!0);await n.chown(e,i)}catch(s){var a=s,c=!0}finally{var l=E(r,a,c);l&&await l}}o(Do,"lchown");async function Mo(t,e){var n=[];try{let i=w(n,await we(t,"r+"),!0);await i.chmod(e)}catch(r){var s=r,a=!0}finally{var c=E(n,s,a);c&&await c}}o(Mo,"chmod");async function Wo(t,e){var n=[];try{let i=w(n,await Ai(t,"r+",420,!1),!0);await i.chmod(e)}catch(r){var s=r,a=!0}finally{var c=E(n,s,a);c&&await c}}o(Wo,"lchmod");async function Pr(t,e,i){var r=[];try{let n=w(r,await we(t,"r+"),!0);await n.utimes(e,i)}catch(s){var a=s,c=!0}finally{var l=E(r,a,c);l&&await l}}o(Pr,"utimes");async function Uo(t,e,i){var r=[];try{let n=w(r,await Ai(t,"r+",420,!1),!0);await n.utimes(new Date(e),new Date(i))}catch(s){var a=s,c=!0}finally{var l=E(r,a,c);l&&await l}}o(Uo,"lutimes");async function De(t,e){t=x(t);let{base:i,dir:n}=In(t),r=z(n=="/"?"/":await De(n),i),{fs:s,path:a,mountPoint:c}=R(r);try{return(await s.stat(a)).isSymbolicLink()?De(c+await Ar(r)):r}catch(l){throw X(l,{[a]:r})}}o(De,"realpath");function fw(t,e={}){return{[Symbol.asyncIterator](){let i=new ui(t.toString(),typeof e!="string"?e:{encoding:e});function n(r){return function(){let s=Promise.withResolvers();return i.on("change",(a,c)=>{s.resolve({value:{eventType:a,filename:c},done:r})}),s.promise}}return o(n,"withDone"),{next:n(!1),return:n(!0),throw:n(!0)}}}}o(fw,"watch");async function jo(t,e=0){if(!(await nt(t)).hasAccess(e))throw new u(13)}o(jo,"access");async function Tr(t,e){switch(t=x(t),(await nt(t)).mode&61440){case 16384:if(e?.recursive)for(let n of await Ut(t))await Tr(z(t,n),e);await Ir(t);return;case 32768:case 40960:await bn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}}o(Tr,"rm");async function qo(t,e){let i=typeof e=="object"?e?.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await wn(r),i=="buffer"?Zt.Buffer.from(r):r}o(qo,"mkdtemp");async function Or(t,e,i){if(t=x(t),e=x(e),i&&i&1&&await Me(e))throw new u(17,"Destination file already exists.",e,"copyFile");await Pi(e,await gn(t)),M("rename",e.toString())}o(Or,"copyFile");async function $o(t,e){return t=x(t),new vt(t)}o($o,"opendir");async function Rr(t,e,i){t=x(t),e=x(e);let n=await Fr(t);if(i?.errorOnExist&&await Me(e))throw new u(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,t+" is a directory (not copied)",t,"cp");await wn(e,{recursive:!0});for(let r of await Ut(t,{withFileTypes:!0}))i.filter&&!i.filter(z(t,r.name),z(e,r.name))||await Rr(z(t,r.name),z(e,r.name),i);break;case 32768:case 40960:await Or(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await Pr(e,n.atime,n.mtime)}o(Rr,"cp");async function zo(t,e){t=x(t);let{fs:i}=R(t);return Ln(i,e?.bigint)}o(zo,"statfs");var v=o(()=>{},"nop");function hu(t,e,i=v){Oo(t,e).then(()=>i()).catch(i)}o(hu,"rename");function pu(t,e=v){Me(t).then(e).catch(()=>e(!1))}o(pu,"exists");function yu(t,e,i=v){i=typeof e=="function"?e:i,nt(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}o(yu,"stat");function mu(t,e,i=v){i=typeof e=="function"?e:i,Fr(t,typeof e!="function"?e:{}).then(n=>i(void 0,n)).catch(i)}o(mu,"lstat");function bu(t,e=0,i=v){i=typeof e=="function"?e:i,Ro(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}o(bu,"truncate");function gu(t,e=v){bn(t).then(()=>e()).catch(e)}o(gu,"unlink");function wu(t,e,i,n=v){let r=_e(i,420);n=typeof i=="function"?i:n,we(t,e,r).then(s=>n(void 0,s.fd)).catch(n)}o(wu,"open");function Su(t,e,i=v){i=typeof e=="function"?e:i,gn(t,typeof e=="function"?null:e).then(n=>i(void 0,n)).catch(i)}o(Su,"readFile");function Eu(t,e,i,n=v){n=typeof i=="function"?i:n,Pi(t,e,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}o(Eu,"writeFile");function _u(t,e,i,n=v){let r=typeof i!="function"?i:void 0;n=typeof i=="function"?i:n,No(t,e,r).then(()=>n()).catch(n)}o(_u,"appendFile");function xu(t,e,i=v){i=typeof e=="function"?e:i,j(t).stat().then(n=>i(void 0,typeof e=="object"&&e?.bigint?new me(n):n)).catch(i)}o(xu,"fstat");function ku(t,e=v){new ce(t).close().then(()=>e()).catch(e)}o(ku,"close");function vu(t,e,i=v){let n=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let r=j(t);if(n<0)throw new u(22);r.truncate(n).then(()=>i()).catch(i)}o(vu,"ftruncate");function Fu(t,e=v){j(t).sync().then(()=>e()).catch(e)}o(Fu,"fsync");function Iu(t,e=v){j(t).datasync().then(()=>e()).catch(e)}o(Iu,"fdatasync");function Au(t,e,i,n,r,s=v){let a,c,l,f,d,h=new ce(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":s=i;break;case"number":f=i,d=typeof n=="string"?n:"utf8",s=typeof r=="function"?r:s;break;default:s=typeof n=="function"?n:typeof r=="function"?r:s,s(new u(22,"Invalid arguments."));return}a=Vo.Buffer.from(e),c=0,l=a.length;let b=s;h.write(a,c,l,f).then(({bytesWritten:y})=>b(void 0,y,a.toString(d))).catch(b)}else{a=Vo.Buffer.from(e.buffer),c=i,l=n,f=typeof r=="number"?r:null;let b=typeof r=="function"?r:s;h.write(a,c,l,f).then(({bytesWritten:y})=>b(void 0,y,a)).catch(b)}}o(Au,"write");function Pu(t,e,i,n,r,s=v){new ce(t).read(e,i,n,r).then(({bytesRead:a,buffer:c})=>s(void 0,a,c)).catch(s)}o(Pu,"read");function Tu(t,e,i,n=v){new ce(t).chown(e,i).then(()=>n()).catch(n)}o(Tu,"fchown");function Ou(t,e,i){new ce(t).chmod(e).then(()=>i()).catch(i)}o(Ou,"fchmod");function Ru(t,e,i,n=v){new ce(t).utimes(e,i).then(()=>n()).catch(n)}o(Ru,"futimes");function Nu(t,e=v){Ir(t).then(()=>e()).catch(e)}o(Nu,"rmdir");function Lu(t,e,i=v){wn(t,e).then(()=>i()).catch(i)}o(Lu,"mkdir");function Cu(t,e,i=v){i=typeof e=="function"?e:i,Ut(t,typeof e!="function"?e:{}).then(r=>i(void 0,r)).catch(i)}o(Cu,"readdir");function Bu(t,e,i=v){Lo(t,e).then(()=>i()).catch(i)}o(Bu,"link");function Du(t,e,i,n=v){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,Co(t,e,r).then(()=>n()).catch(n)}o(Du,"symlink");function Mu(t,e,i=v){i=typeof e=="function"?e:i,Ar(t).then(n=>i(void 0,n)).catch(i)}o(Mu,"readlink");function Wu(t,e,i,n=v){Bo(t,e,i).then(()=>n()).catch(n)}o(Wu,"chown");function Uu(t,e,i,n=v){Do(t,e,i).then(()=>n()).catch(n)}o(Uu,"lchown");function ju(t,e,i=v){Mo(t,e).then(()=>i()).catch(i)}o(ju,"chmod");function qu(t,e,i=v){Wo(t,e).then(()=>i()).catch(i)}o(qu,"lchmod");function $u(t,e,i,n=v){Pr(t,e,i).then(()=>n()).catch(n)}o($u,"utimes");function zu(t,e,i,n=v){Uo(t,e,i).then(()=>n()).catch(n)}o(zu,"lutimes");function Vu(t,e,i=v){i=typeof e=="function"?e:i,De(t,typeof e=="function"?null:e).then(n=>i(void 0,n)).catch(i)}o(Vu,"realpath");function Hu(t,e,i=v){let n=typeof e=="number"?e:4;i=typeof e=="function"?e:i,jo(t,n).then(()=>i()).catch(i)}o(Hu,"access");var Ti=new Map;function Ku(t,e,i){let n=x(t.toString()),r=typeof e!="function"?e:{};if(typeof e=="function"&&(i=e),!i)throw new u(22,"No listener specified",t.toString(),"watchFile");if(Ti.has(n)){let a=Ti.get(n);a&&a.listeners.add(i);return}let s=new Mn(n,r);s.on("change",(a,c)=>{let l=Ti.get(n);if(l)for(let f of l.listeners)f(a,c)}),Ti.set(n,{watcher:s,listeners:new Set})}o(Ku,"watchFile");function Gu(t,e=v){let i=x(t.toString()),n=Ti.get(i);n&&(e&&e!==v?n.listeners.delete(e):n.listeners.clear(),n.listeners.size===0&&(n.watcher.stop(),Ti.delete(i)))}o(Gu,"unwatchFile");function Yu(t,e,i){let n=new ui(x(t),typeof e=="object"?e:{});return i=typeof e=="function"?e:i,n.on("change",i||v),n}o(Yu,"watch");function Xu(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new Tt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:o(async function(s){try{n||=await we(t,"r",i?.mode);let a=await n.read(new Uint8Array(s),0,s,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:o(function(s,a){n?.close().then(()=>a(s)).catch(v)},"destroy")});return r.path=t.toString(),r}o(Xu,"createReadStream");function Ju(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new Ot({highWaterMark:i?.highWaterMark,write:o(async function(s,a,c){try{n||=await we(t,"w",i?.mode||438),await n.write(s,0,a),c(void 0)}catch(l){await n?.close(),c(l)}},"write"),destroy:o(function(s,a){a(s),n?.close().then(()=>a(s)).catch(a)},"destroy"),final:o(function(s){n?.close().then(()=>s()).catch(s)},"final")});return r.path=t.toString(),r}o(Ju,"createWriteStream");function Qu(t,e,i=v){i=typeof e=="function"?e:i,Tr(t,typeof e=="function"?void 0:e).then(()=>i(void 0)).catch(i)}o(Qu,"rm");function Zu(t,e,i=v){i=typeof e=="function"?e:i,qo(t,typeof e!="function"?e:null).then(n=>i(void 0,n)).catch(i)}o(Zu,"mkdtemp");function ed(t,e,i,n=v){n=typeof i=="function"?i:n,Or(t,e,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}o(ed,"copyFile");function td(t,e,i,n=v){n=typeof i=="function"?i:n,new ce(t).readv(e,typeof i=="function"?void 0:i).then(({buffers:r,bytesRead:s})=>n(void 0,s,r)).catch(n)}o(td,"readv");function id(t,e,i,n=v){n=typeof i=="function"?i:n,new ce(t).writev(e,typeof i=="function"?void 0:i).then(({buffers:r,bytesWritten:s})=>n(void 0,s,r)).catch(n)}o(id,"writev");function nd(t,e,i=v){i=typeof e=="function"?e:i,$o(t,typeof e=="function"?void 0:e).then(n=>i(void 0,n)).catch(i)}o(nd,"opendir");function rd(t,e,i,n=v){n=typeof i=="function"?i:n,Rr(t,e,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}o(rd,"cp");function sd(t,e,i=v){i=typeof e=="function"?e:i,zo(t,typeof e=="function"?void 0:e).then(n=>i(void 0,n)).catch(i)}o(sd,"statfs");async function od(t,e){let i=await we(t.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],e)}o(od,"openAsBlob");function ad(t){return Bi(t)||Ci(t)||t instanceof pe}o(ad,"isMountConfig");async function Oi(t,e=0){if(typeof t!="object"||t==null)throw new u(22,"Invalid options on mount configuration");if(!ad(t))throw new u(22,"Invalid mount configuration");if(t instanceof pe)return t;Ci(t)&&(t={backend:t});for(let[r,s]of Object.entries(t))if(r!="backend"&&ad(s)){if(e>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");t[r]=await Oi(s,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await zr(i,t);let n=await i.create(t);return n._disableSync=t.disableAsyncCache||!1,await n.ready(),n}o(Oi,"resolveMountConfig");async function uw(t){if(!Bi(t))throw new TypeError("Invalid single mount point configuration");let e=await Oi(t);fi("/"),Mt("/",e)}o(uw,"configureSingle");async function dw(t){let e="uid"in t&&t.uid||0,i="gid"in t&&t.gid||0;if(Object.assign(ye,{uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i}),!!t.mounts){for(let[n,r]of Object.entries(t.mounts)){if(!n.startsWith("/"))throw new u(22,"Mount points must have absolute paths");Bi(r)&&(r.disableAsyncCache??=t.disableAsyncCache||!1),t.mounts[n]=await Oi(r)}Qi(t.mounts)}}o(dw,"configure");function Ho(t){class e extends t{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{o(this,"AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(r=>{let s=o(()=>this._queueRunning?setTimeout(s):r(),"check");s()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(r){throw this._isInitialized=!1,r}}}checkSync(r,s){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",r,s);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",r,s)}renameSync(r,s){this.checkSync(r,"rename"),this._sync.renameSync(r,s),this.queue("rename",r,s)}statSync(r){return this.checkSync(r,"stat"),this._sync.statSync(r)}createFileSync(r,s,a){return this.checkSync(r,"createFile"),this._sync.createFileSync(r,s,a),this.queue("createFile",r,s,a),this.openFileSync(r,s)}openFileSync(r,s){this.checkSync(r,"openFile");let a=this._sync.openFileSync(r,s),c=a.statSync(),l=new Uint8Array(c.size);return a.readSync(l),new ge(this,r,s,c,l)}unlinkSync(r){this.checkSync(r,"unlinkSync"),this._sync.unlinkSync(r),this.queue("unlink",r)}rmdirSync(r){this.checkSync(r,"rmdir"),this._sync.rmdirSync(r),this.queue("rmdir",r)}mkdirSync(r,s){this.checkSync(r,"mkdir"),this._sync.mkdirSync(r,s),this.queue("mkdir",r,s)}readdirSync(r){return this.checkSync(r,"readdir"),this._sync.readdirSync(r)}linkSync(r,s){this.checkSync(r,"link"),this._sync.linkSync(r,s),this.queue("link",r,s)}syncSync(r,s,a){this.checkSync(r,"sync"),this._sync.syncSync(r,s,a),this.queue("sync",r,s,a)}existsSync(r){return this.checkSync(r,"exists"),this._sync.existsSync(r)}async crossCopy(r){this.checkSync(r,"crossCopy");let s=await this.stat(r);if(!s.isDirectory()){var c=[];try{let b=w(c,await this.openFile(r,D("r")),!0);let y=w(c,this._sync.createFileSync(r,D("w"),s.mode));let S=new Uint8Array(s.size);await b.read(S);y.writeSync(S,0,s.size);return}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}if(r!=="/"){let b=await this.stat(r);this._sync.mkdirSync(r,b.mode)}let a=await this.readdir(r);for(let b of a)await this.crossCopy(z(r,b))}async _next(){if(!this._queueRunning)return;let[r,...s]=this._queue.shift();await this[r](...s),await this._next()}queue(...r){this._queue.push(r),this._next()}}return e}o(Ho,"Async");function hw(t){return typeof t=="object"&&t!=null&&"fd"in t&&"path"in t&&"position"in t}o(hw,"isFileData");function Ko(t){return typeof t=="object"&&t!=null&&"_zenfs"in t&&!!t._zenfs}o(Ko,"isMessage");var Ri=new Map;function Go(t,{port:e,timeout:i=1e3,fs:n}={}){let r=new Error().stack.slice(6);if(!e)throw u.With("EINVAL");return new Promise((s,a)=>{let c=Math.random().toString(16).slice(10);Ri.set(c,{resolve:s,reject:a,fs:n}),e.postMessage({...t,_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)})}o(Go,"request");function cd(t){if(!Ko(t))return;let{id:e,value:i,error:n,stack:r}=t;if(!Ri.has(e)){let l=new u(5,"Invalid RPC id:"+e);throw l.stack+=r,l}let{resolve:s,reject:a,fs:c}=Ri.get(e);if(n){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=r,a(l),Ri.delete(e);return}if(hw(i)){let{fd:l,path:f,position:d}=i,h=new _n(c,l,f,d);s(h),Ri.delete(e);return}s(i),Ri.delete(e)}o(cd,"handleResponse");function Nr(t,e){if(!t)throw u.With("EINVAL");t["on"in t?"on":"addEventListener"]("message",i=>{e("data"in i?i.data:i)})}o(Nr,"attach");function Yo(t,e){if(!t)throw u.With("EINVAL");t["off"in t?"off":"removeEventListener"]("message",i=>{e("data"in i?i.data:i)})}o(Yo,"detach");function ld(t){let e=[],i=e.push.bind(e);return Nr(t,i),function(n){Yo(t,i);for(let r of e){let s="data"in r?r.data:r;xn(t,n,s)}}}o(ld,"catchMessages");var _n=class extends Bt{constructor(i,n,r,s){super(i,r);this.fs=i;this.fd=n;this.position=s}static{o(this,"PortFile")}rpc(i,...n){return Go({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 Y(await this.rpc("stat"))}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,n,r,s){return this.rpc("write",i,n,r,s)}writeSync(){this._throwNoSync("write")}async read(i,n,r,s){return await this.rpc("read",i,n,r,s)}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")}},Cr=class extends Ho(pe){constructor(i){super();this.options=i;this._sync=Xi.create({name:"port-tmpfs"});this.port=i.port,Nr(this.port,cd)}static{o(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return Go({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 Y(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)}},fd=0,Lr=new Map;async function xn(t,e,i){if(!Ko(i))return;let{method:n,args:r,id:s,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await e[n](...r),l instanceof Bt&&(Lr.set(++fd,l),l={fd,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Lr.has(d))throw new u(9);l=await Lr.get(d)[n](...r),n=="close"&&Lr.delete(d);break;default:return}}catch(d){l=d instanceof u?d.toJSON():d.toString(),f=!0}t.postMessage({_zenfs:!0,scope:a,id:s,error:f,method:n,stack:c,value:l})}o(xn,"handleRequest");function ud(t,e){Nr(t,i=>xn(t,e,i))}o(ud,"attachFS");function yw(t,e){Yo(t,i=>xn(t,e,i))}o(yw,"detachFS");var dd={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:o(function(t){if(typeof t?.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:o(async function(){return!0},"isAvailable"),create:o(function(t){return new Cr(t)},"create")},mw=dd;async function bw(t,e,i=0){let n=ld(t),r=await Oi(e,i);return ud(t,r),n(r),r}o(bw,"resolveRemoteMount");function hd(t){try{return JSON.parse(t),!0}catch{return!1}}o(hd,"isJSON");function Xo(t){return t.at(0).toUpperCase()+t.slice(1)}o(Xo,"capitalize");var pd=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],yd=[...pd,...pd.map(t=>Xo(t)),"char"];var Jo=Symbol("struct_init"),ww=Symbol("struct");function md(t,e){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[Jo]||=[],n.metadata[Jo].push({name:r,type:t,length:e}),i}}o(md,"member");function Ew(t){function e(i,n){return typeof i=="number"?md(t,i):md(t)(i,n)}return o(e,"_structMemberDecorator"),e}o(Ew,"_member");var jx=Object.fromEntries(yd.map(t=>[t,Ew(t)]));function Qo(t){class e extends t{static{o(this,"ReadonlyFS")}metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r){throw new u(30)}renameSync(n,r){throw new u(30)}async createFile(n,r,s){throw new u(30)}createFileSync(n,r,s){throw new u(30)}async unlink(n){throw new u(30)}unlinkSync(n){throw new u(30)}async rmdir(n){throw new u(30)}rmdirSync(n){throw new u(30)}async mkdir(n,r){throw new u(30)}mkdirSync(n,r){throw new u(30)}async link(n,r){throw new u(30)}linkSync(n,r){throw new u(30)}async sync(n,r,s){throw new u(30)}syncSync(n,r,s){throw new u(30)}}return e}o(Qo,"Readonly");var Zo=1,Br=class t extends Map{static{o(this,"Index")}files(){let e=new Map;for(let[i,n]of this)n.isFile()&&e.set(i,n);return e}toJSON(){return{version:Zo,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(e){let i=[];for(let n of this.keys())_(n)==e&&i.push(B(n));return i}fromJSON(e){if(e.version!=Zo)throw new u(22,"Index version mismatch");this.clear();for(let[i,n]of Object.entries(e.entries)){let r=new Y(n);r.isDirectory()&&(r.fileData=Re(JSON.stringify(this.dirEntries(i)))),this.set(i,r)}}static parse(e){if(!hd(e))throw new u(22,"Invalid JSON");let i=JSON.parse(e),n=new t;return n.fromJSON(i),n}},kn=class extends Qo(pe){constructor(i){super();this.indexData=i;this.index=new Br;this._isInitialized=!1}static{o(this,"IndexFS")}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(be(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new ci(this,i,n,r,r.isDirectory()?r.fileData:await this.getData(i,r))}openFileSync(i,n){if(be(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new ci(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(ti(n.fileData));if(!Array.isArray(r))throw u.With("ENODATA",i,"readdir");if(!r.every(s=>typeof s=="string"))throw u.With("ENODATA",i,"readdir");return r}};async function bd(t,e){let i=await fetch(t).catch(n=>{throw new u(5,n.message)});if(!i.ok)throw new u(5,"fetch failed: response returned code "+i.status);switch(e){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: "+e)}}o(bd,"fetchFile");var Dr=class t extends kn{static{o(this,"FetchFS")}async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[e,i]of this.index.files())await this.getData(e,i)}constructor({index:e="index.json",baseUrl:i=""}){super(typeof e!="string"?e:bd(e,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:t.name,readonly:!0}}preload(e,i){let n=this.index.get(e);if(!n)throw u.With("ENOENT",e,"preload");if(!n.isFile())throw u.With("EISDIR",e,"preload");n.size=i.length,n.fileData=i}async getData(e,i){if(i.fileData)return i.fileData;let n=await bd(this.baseUrl+(e.startsWith("/")?e.slice(1):e),"buffer");return i.fileData=n,n}getDataSync(e,i){if(i.fileData)return i.fileData;throw new u(61,"",e,"getData")}},_w={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:o(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:o(function(t){return new Dr(t)},"create")},xw=_w;var Mr=class{constructor(e){this.previous=e;this.current=Promise.withResolvers();this._isLocked=!0}static{o(this,"MutexLock")}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()}},Wr=class{static{o(this,"__MutexedFS")}async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){let e=new Mr(this.currentLock);return this.currentLock=e,e}async lock(e,i){let n=this.currentLock,r=this.addLock(),s=new Error().stack;return setTimeout(()=>{if(r.isLocked){let a=u.With("EDEADLK",e,i);throw a.stack+=s?.slice(5),a}},5e3),await n?.done(),r}lockSync(e,i){if(this.currentLock)throw u.With("EBUSY",e,i);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(e,i){var r=[];try{let n=w(r,await this.lock(e,"rename"));await this._fs.rename(e,i)}catch(s){var a=s,c=!0}finally{E(r,a,c)}}renameSync(e,i){var r=[];try{let n=w(r,this.lockSync(e,"rename"));return this._fs.renameSync(e,i)}catch(s){var a=s,c=!0}finally{E(r,a,c)}}async stat(e){var n=[];try{let i=w(n,await this.lock(e,"stat"));return await this._fs.stat(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}statSync(e){var n=[];try{let i=w(n,this.lockSync(e,"stat"));return this._fs.statSync(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}async openFile(e,i){var s=[];try{let n=w(s,await this.lock(e,"openFile"));let r=await this._fs.openFile(e,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(s,c,l)}}openFileSync(e,i){var s=[];try{let n=w(s,this.lockSync(e,"openFile"));let r=this._fs.openFileSync(e,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(s,c,l)}}async createFile(e,i,n){var a=[];try{let r=w(a,await this.lock(e,"createFile"));let s=await this._fs.createFile(e,i,n);s.fs=this;return s}catch(c){var l=c,f=!0}finally{E(a,l,f)}}createFileSync(e,i,n){var a=[];try{let r=w(a,this.lockSync(e,"createFile"));let s=this._fs.createFileSync(e,i,n);s.fs=this;return s}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async unlink(e){var n=[];try{let i=w(n,await this.lock(e,"unlink"));await this._fs.unlink(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}unlinkSync(e){var n=[];try{let i=w(n,this.lockSync(e,"unlink"));return this._fs.unlinkSync(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}async rmdir(e){var n=[];try{let i=w(n,await this.lock(e,"rmdir"));await this._fs.rmdir(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}rmdirSync(e){var n=[];try{let i=w(n,this.lockSync(e,"rmdir"));return this._fs.rmdirSync(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}async mkdir(e,i){var r=[];try{let n=w(r,await this.lock(e,"mkdir"));await this._fs.mkdir(e,i)}catch(s){var a=s,c=!0}finally{E(r,a,c)}}mkdirSync(e,i){var r=[];try{let n=w(r,this.lockSync(e,"mkdir"));return this._fs.mkdirSync(e,i)}catch(s){var a=s,c=!0}finally{E(r,a,c)}}async readdir(e){var n=[];try{let i=w(n,await this.lock(e,"readdir"));return await this._fs.readdir(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}readdirSync(e){var n=[];try{let i=w(n,this.lockSync(e,"readdir"));return this._fs.readdirSync(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}async exists(e){var n=[];try{let i=w(n,await this.lock(e,"exists"));return await this._fs.exists(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}existsSync(e){var n=[];try{let i=w(n,this.lockSync(e,"exists"));return this._fs.existsSync(e)}catch(r){var s=r,a=!0}finally{E(n,s,a)}}async link(e,i){var r=[];try{let n=w(r,await this.lock(e,"link"));await this._fs.link(e,i)}catch(s){var a=s,c=!0}finally{E(r,a,c)}}linkSync(e,i){var r=[];try{let n=w(r,this.lockSync(e,"link"));return this._fs.linkSync(e,i)}catch(s){var a=s,c=!0}finally{E(r,a,c)}}async sync(e,i,n){var s=[];try{let r=w(s,await this.lock(e,"sync"));await this._fs.sync(e,i,n)}catch(a){var c=a,l=!0}finally{E(s,c,l)}}syncSync(e,i,n){var s=[];try{let r=w(s,this.lockSync(e,"sync"));return this._fs.syncSync(e,i,n)}catch(a){var c=a,l=!0}finally{E(s,c,l)}}};function ea(t){class e extends Wr{static{o(this,"MutexedFS")}constructor(...n){super(),this._fs=new t(...n)}}return e}o(ea,"Mutexed");var ta="/.deleted",Ur=class 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()}static{o(this,"UnmutexedOverlayFS")}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:vn.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(ta,D("r")),{size:n}=await i.stat(),{buffer:r}=await i.read(new Uint8Array(n));this._deleteLog=ti(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 Y(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 Y(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,D("r")),s=new Y(await r.stat()),{buffer:a}=await r.read(new Uint8Array(s.size));return new ge(this,i,n,s,a)}openFileSync(i,n){if(this.writable.existsSync(i))return this.writable.openFileSync(i,n);let r=this.readable.openFileSync(i,D("r")),s=new Y(r.statSync()),a=new Uint8Array(s.size);return r.readSync(a),new ge(this,i,n,s,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 s={};return r.filter(a=>{let c=!s[a];return s[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 s={};return r.filter(a=>{let c=!s[a];return s[a]=!0,c})}async deletePath(i){this._deletedFiles.add(i),await this.updateLog(`d${i}
|
|
3
|
-
`)}async updateLog(i){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this.writable.openFile(ta,D("w"));try{await n.write(Re(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(`
|
|
4
|
-
`)
|
|
1
|
+
"use strict";var ZenFS=(()=>{var th=Object.create;var si=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var ih=Object.getOwnPropertyNames;var nh=Object.getPrototypeOf,rh=Object.prototype.hasOwnProperty;var wa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Dt=e=>{throw TypeError(e)};var s=(e,t)=>si(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Dn=(e,t)=>{for(var i in t)si(e,i,{get:t[i],enumerable:!0})},xa=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ih(t))!rh.call(e,r)&&r!==i&&si(e,r,{get:()=>t[r],enumerable:!(n=_a(t,r))||n.enumerable});return e};var qi=(e,t,i)=>(i=e!=null?th(nh(e)):{},xa(t||!e||!e.__esModule?si(i,"default",{value:e,enumerable:!0}):i,e)),oh=e=>xa(si({},"__esModule",{value:!0}),e);var ka=["class","method","getter","setter","accessor","field","value","get","set"],ji=e=>e!==void 0&&typeof e!="function"?Dt("Function expected"):e,sh=(e,t,i,n)=>({kind:ka[e],name:t,addInitializer:r=>i._?Dt("Already initialized"):n.push(ji(r||null))}),va=(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=ka[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)&&_a(h<4?r:{get[i](){return Sa(this,o)},set[i](F){return Ea(this,o,F)}},i));h?p&&h<4&&s(o,(h>2?"set ":h>1?"get ":"")+i):s(r,i);for(var N=n.length-1;N>=0;N--)f=sh(h,i,l={},k),h&&(f.static=b,f.private=p,d=f.access={has:p?F=>ah(r,F):F=>i in F},h^3&&(d.get=p?F=>(h^1?Sa:ch)(F,r,h^4?o:v.get):F=>F[i]),h>2&&(d.set=p?(F,B)=>Ea(F,r,B,h^4?o:v.set):(F,B)=>F[i]=B)),c=(0,n[N])(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?ji(c)&&(h>4?A.unshift(c):h?p?o=c:v[g]=c:r=c):typeof c!="object"||c===null?Dt("Object expected"):(ji(a=c.get)&&(v.get=a),ji(a=c.set)&&(v.set=a),ji(a=c.init)&&A.unshift(a));return v&&si(r,i,v),p?h^4?o:v:r};var to=(e,t,i)=>t.has(e)||Dt("Cannot "+i),ah=(e,t)=>Object(t)!==t?Dt('Cannot use the "in" operator on this value'):e.has(t),Sa=(e,t,i)=>(to(e,t,"read from private field"),i?i.call(e):t.get(e));var Ea=(e,t,i,n)=>(to(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),ch=(e,t,i)=>(to(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[wa("asyncDispose")]),n===void 0&&(n=t[wa("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 Pa=T(jn=>{"use strict";jn.byteLength=yh;jn.toByteArray=bh;jn.fromByteArray=Sh;var qe=[],Fe=[],ph=typeof Uint8Array<"u"?Uint8Array:Array,oo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Wt=0,Aa=oo.length;Wt<Aa;++Wt)qe[Wt]=oo[Wt],Fe[oo.charCodeAt(Wt)]=Wt;var Wt,Aa;Fe[45]=62;Fe[95]=63;function Oa(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(Oa,"getLens");function yh(e){var t=Oa(e),i=t[0],n=t[1];return(i+n)*3/4-n}s(yh,"byteLength");function mh(e,t,i){return(t+i)*3/4-i}s(mh,"_byteLength");function bh(e){var t,i=Oa(e),n=i[0],r=i[1],o=new ph(mh(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(bh,"toByteArray");function gh(e){return qe[e>>18&63]+qe[e>>12&63]+qe[e>>6&63]+qe[e&63]}s(gh,"tripletToBase64");function wh(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(gh(n));return r.join("")}s(wh,"encodeChunk");function Sh(e){for(var t,i=e.length,n=i%3,r=[],o=16383,a=0,c=i-n;a<c;a+=o)r.push(wh(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(Sh,"fromByteArray")});var Ta=T(so=>{so.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)};so.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 ao=Pa(),li=Ta(),Ra=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=m;ui.SlowBuffer=Fh;ui.INSPECT_MAX_BYTES=50;var qn=2147483647;ui.kMaxLength=qn;m.TYPED_ARRAY_SUPPORT=Eh();!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 Eh(){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(Eh,"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>qn)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 uo(e)}return Ba(e,t,i)}s(m,"Buffer");m.poolSize=8192;function Ba(e,t,i){if(typeof e=="string")return xh(e,t);if(ArrayBuffer.isView(e))return kh(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 lo(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=vh(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(Ba,"from");m.from=function(e,t,i){return Ba(e,t,i)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function Da(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(Da,"assertSize");function _h(e,t,i){return Da(e),e<=0?ct(e):t!==void 0?typeof i=="string"?ct(e).fill(t,i):ct(e).fill(t):ct(e)}s(_h,"alloc");m.alloc=function(e,t,i){return _h(e,t,i)};function uo(e){return Da(e),ct(e<0?0:ho(e)|0)}s(uo,"allocUnsafe");m.allocUnsafe=function(e){return uo(e)};m.allocUnsafeSlow=function(e){return uo(e)};function xh(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let i=Ma(e,t)|0,n=ct(i),r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}s(xh,"fromString");function co(e){let t=e.length<0?0:ho(e.length)|0,i=ct(t);for(let n=0;n<t;n+=1)i[n]=e[n]&255;return i}s(co,"fromArrayLike");function kh(e){if($e(e,Uint8Array)){let t=new Uint8Array(e);return lo(t.buffer,t.byteOffset,t.byteLength)}return co(e)}s(kh,"fromArrayView");function lo(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(lo,"fromArrayBuffer");function vh(e){if(m.isBuffer(e)){let t=ho(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"||yo(e.length)?ct(0):co(e);if(e.type==="Buffer"&&Array.isArray(e.data))return co(e.data)}s(vh,"fromObject");function ho(e){if(e>=qn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qn.toString(16)+" bytes");return e|0}s(ho,"checked");function Fh(e){return+e!=e&&(e=0),m.alloc(+e)}s(Fh,"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 Ma(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 fo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Ka(e).length;default:if(r)return n?-1:fo(e).length;t=(""+t).toLowerCase(),r=!0}}s(Ma,"byteLength");m.byteLength=Ma;function Ih(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 Dh(this,t,i);case"utf8":case"utf-8":return Ua(this,t,i);case"ascii":return Ch(this,t,i);case"latin1":case"binary":return Bh(this,t,i);case"base64":return Nh(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mh(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s(Ih,"slowToString");m.prototype._isBuffer=!0;function Ut(e,t,i){let n=e[t];e[t]=e[i],e[i]=n}s(Ut,"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)Ut(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)Ut(this,i,i+3),Ut(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)Ut(this,i,i+7),Ut(this,i+1,i+6),Ut(this,i+2,i+5),Ut(this,i+3,i+4);return this},"swap64");m.prototype.toString=s(function(){let t=this.length;return t===0?"":arguments.length===0?Ua(this,0,t):Ih.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");Ra&&(m.prototype[Ra]=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 Wa(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,yo(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:Na(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):Na(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(Wa,"bidirectionalIndexOf");function Na(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(Na,"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 Wa(this,t,i,n,!0)},"indexOf");m.prototype.lastIndexOf=s(function(t,i,n){return Wa(this,t,i,n,!1)},"lastIndexOf");function Ah(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(yo(c))return a;e[i+a]=c}return a}s(Ah,"hexWrite");function Oh(e,t,i,n){return $n(fo(t,e.length-i),e,i,n)}s(Oh,"utf8Write");function Ph(e,t,i,n){return $n(qh(t),e,i,n)}s(Ph,"asciiWrite");function Th(e,t,i,n){return $n(Ka(t),e,i,n)}s(Th,"base64Write");function Rh(e,t,i,n){return $n($h(t,e.length-i),e,i,n)}s(Rh,"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 Ah(this,t,i,n);case"utf8":case"utf-8":return Oh(this,t,i,n);case"ascii":case"latin1":case"binary":return Ph(this,t,i,n);case"base64":return Th(this,t,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rh(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 Nh(e,t,i){return t===0&&i===e.length?ao.fromByteArray(e):ao.fromByteArray(e.slice(t,i))}s(Nh,"base64Slice");function Ua(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 Lh(n)}s(Ua,"utf8Slice");var La=4096;function Lh(e){let t=e.length;if(t<=La)return String.fromCharCode.apply(String,e);let i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=La));return i}s(Lh,"decodeCodePointsArray");function Ch(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(Ch,"asciiSlice");function Bh(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(Bh,"latin1Slice");function Dh(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+=zh[e[o]];return r}s(Dh,"hexSlice");function Mh(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(Mh,"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)&&Vi(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)&&Vi(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)&&Vi(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)&&Vi(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 ja(e,t,i,n,r){Ha(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(ja,"wrtBigUInt64LE");function qa(e,t,i,n,r){Ha(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(qa,"wrtBigUInt64BE");m.prototype.writeBigUInt64LE=xt(s(function(t,i=0){return ja(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));m.prototype.writeBigUInt64BE=xt(s(function(t,i=0){return qa(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 ja(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));m.prototype.writeBigInt64BE=xt(s(function(t,i=0){return qa(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function $a(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($a,"checkIEEE754");function za(e,t,i,n,r){return t=+t,i=i>>>0,r||$a(e,t,i,4,34028234663852886e22,-34028234663852886e22),li.write(e,t,i,n,23,4),i+4}s(za,"writeFloat");m.prototype.writeFloatLE=s(function(t,i,n){return za(this,t,i,!0,n)},"writeFloatLE");m.prototype.writeFloatBE=s(function(t,i,n){return za(this,t,i,!1,n)},"writeFloatBE");function Va(e,t,i,n,r){return t=+t,i=i>>>0,r||$a(e,t,i,8,17976931348623157e292,-17976931348623157e292),li.write(e,t,i,n,52,8),i+8}s(Va,"writeDouble");m.prototype.writeDoubleLE=s(function(t,i,n){return Va(this,t,i,!0,n)},"writeDoubleLE");m.prototype.writeDoubleBE=s(function(t,i,n){return Va(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 po(e,t,i){ci[e]=class extends i{static{s(this,"NodeError")}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(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}s(po,"E");po("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);po("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);po("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=Ca(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=Ca(r)),r+="n"),n+=` It must be ${t}. Received ${r}`,n},RangeError);function Ca(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(Ca,"addNumericalSeparator");function Wh(e,t,i){fi(t,"offset"),(e[t]===void 0||e[t+i]===void 0)&&Vi(t,e.length-(i+1))}s(Wh,"checkBounds");function Ha(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)}Wh(n,r,o)}s(Ha,"checkIntBI");function fi(e,t){if(typeof e!="number")throw new ci.ERR_INVALID_ARG_TYPE(t,"number",e)}s(fi,"validateNumber");function Vi(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(Vi,"boundsError");var Uh=/[^+/0-9A-Za-z-_]/g;function jh(e){if(e=e.split("=")[0],e=e.trim().replace(Uh,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}s(jh,"base64clean");function fo(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(fo,"utf8ToBytes");function qh(e){let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i)&255);return t}s(qh,"asciiToBytes");function $h(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($h,"utf16leToBytes");function Ka(e){return ao.toByteArray(jh(e))}s(Ka,"base64ToBytes");function $n(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($n,"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 yo(e){return e!==e}s(yo,"numberIsNaN");var zh=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"?Vh:e}s(xt,"defineBigIntMethod");function Vh(){throw new Error("BigInt not supported")}s(Vh,"BufferBigIntNotDefined")});var Ya=T((CS,wo)=>{"use strict";var mp=Object.prototype.hasOwnProperty,se="~";function Gi(){}s(Gi,"Events");Object.create&&(Gi.prototype=Object.create(null),new Gi().__proto__||(se=!1));function bp(e,t,i){this.fn=e,this.context=t,this.once=i||!1}s(bp,"EE");function Ga(e,t,i,n,r){if(typeof i!="function")throw new TypeError("The listener must be a function");var o=new bp(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(Ga,"addListener");function zn(e,t){--e._eventsCount===0?e._events=new Gi:delete e._events[t]}s(zn,"clearEvent");function ne(){this._events=new Gi,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)mp.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 Ga(this,t,i,n,!1)},"on");ne.prototype.once=s(function(t,i,n){return Ga(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 zn(this,o),this;var a=this._events[o];if(a.fn)a.fn===i&&(!r||a.once)&&(!n||a.context===n)&&zn(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:zn(this,o)}return this},"removeListener");ne.prototype.removeAllListeners=s(function(t){var i;return t?(i=se?se+t:t,this._events[i]&&zn(this,i)):(this._events=new Gi,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=se;ne.EventEmitter=ne;typeof wo<"u"&&(wo.exports=ne)});var q=T((P_,$c)=>{"use strict";$c.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((R_,rr)=>{"use strict";var{AbortController:zc,AbortSignal:Pp}=typeof self<"u"?self:typeof window<"u"?window:void 0;rr.exports=zc;rr.exports.AbortSignal=Pp;rr.exports.default=zc});var yn=T((N_,Bo)=>{"use strict";var _i=typeof Reflect=="object"?Reflect:null,Vc=_i&&typeof _i.apply=="function"?_i.apply:s(function(t,i,n){return Function.prototype.apply.call(t,i,n)},"ReflectApply"),or;_i&&typeof _i.ownKeys=="function"?or=_i.ownKeys:Object.getOwnPropertySymbols?or=s(function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))},"ReflectOwnKeys"):or=s(function(t){return Object.getOwnPropertyNames(t)},"ReflectOwnKeys");function Tp(e){console&&console.warn&&console.warn(e)}s(Tp,"ProcessEmitWarning");var Kc=Number.isNaN||s(function(t){return t!==t},"NumberIsNaN");function L(){L.init.call(this)}s(L,"EventEmitter");Bo.exports=L;Bo.exports.once=Cp;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount=0;L.prototype._maxListeners=void 0;var Hc=10;function sr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}s(sr,"checkListener");Object.defineProperty(L,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Hc},"get"),set:s(function(e){if(typeof e!="number"||e<0||Kc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Hc=e},"set")});L.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};L.prototype.setMaxListeners=s(function(t){if(typeof t!="number"||t<0||Kc(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 Gc(e){return e._maxListeners===void 0?L.defaultMaxListeners:e._maxListeners}s(Gc,"_getMaxListeners");L.prototype.getMaxListeners=s(function(){return Gc(this)},"getMaxListeners");L.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")Vc(l,this,i);else for(var f=l.length,d=Zc(l,f),n=0;n<f;++n)Vc(d[n],this,i);return!0},"emit");function Yc(e,t,i,n){var r,o,a;if(sr(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=Gc(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,Tp(c)}return e}s(Yc,"_addListener");L.prototype.addListener=s(function(t,i){return Yc(this,t,i,!1)},"addListener");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=s(function(t,i){return Yc(this,t,i,!0)},"prependListener");function Rp(){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(Rp,"onceWrapper");function Xc(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=Rp.bind(n);return r.listener=i,n.wrapFn=r,r}s(Xc,"_onceWrap");L.prototype.once=s(function(t,i){return sr(i),this.on(t,Xc(this,t,i)),this},"once");L.prototype.prependOnceListener=s(function(t,i){return sr(i),this.prependListener(t,Xc(this,t,i)),this},"prependOnceListener");L.prototype.removeListener=s(function(t,i){var n,r,o,a,c;if(sr(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():Np(n,o),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,c||i)}return this},"removeListener");L.prototype.off=L.prototype.removeListener;L.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 Jc(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?Lp(r):Zc(r,r.length)}s(Jc,"_listeners");L.prototype.listeners=s(function(t){return Jc(this,t,!0)},"listeners");L.prototype.rawListeners=s(function(t){return Jc(this,t,!1)},"rawListeners");L.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Qc.call(e,t)};L.prototype.listenerCount=Qc;function Qc(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(Qc,"listenerCount");L.prototype.eventNames=s(function(){return this._eventsCount>0?or(this._events):[]},"eventNames");function Zc(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}s(Zc,"arrayClone");function Np(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}s(Np,"spliceOne");function Lp(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}s(Lp,"unwrapListeners");function Cp(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"),el(e,t,o,{once:!0}),t!=="error"&&Bp(e,r,{once:!0})})}s(Cp,"once");function Bp(e,t,i){typeof e.on=="function"&&el(e,"error",t,i)}s(Bp,"addErrorHandlerIfEventEmitter");function el(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(el,"eventTargetAgnosticAddListener")});var re=T((C_,Mo)=>{"use strict";var Dp=Ie(),{kResistStopPropagation:Mp,SymbolDispose:Wp}=q(),Up=globalThis.AbortSignal||Ei().AbortSignal,jp=globalThis.AbortController||Ei().AbortController,qp=Object.getPrototypeOf(async function(){}).constructor,tl=globalThis.Blob||Dp.Blob,$p=s(typeof tl<"u"?function(t){return t instanceof tl}:function(t){return!1},"isBlob"),il=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"),zp=s((e,t)=>{if(typeof e!="function")throw new ERR_INVALID_ARG_TYPE(t,"Function",e)},"validateFunction"),Do=class extends Error{static{s(this,"AggregateError")}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}};Mo.exports={AggregateError:Do,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 qp},"isAsyncFunction"),isArrayBufferView:s(function(e){return ArrayBuffer.isView(e)},"isArrayBufferView")},isBlob:$p,deprecate:s(function(e,t){return e},"deprecate"),addAbortListener:yn().addAbortListener||s(function(t,i){if(t===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);il(t,"signal"),zp(i,"listener");let n;return t.aborted?queueMicrotask(()=>i()):(t.addEventListener("abort",i,{__proto__:null,once:!0,[Mp]:!0}),n=s(()=>{t.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Wp](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Up.any||s(function(t){if(t.length===1)return t[0];let i=new jp,n=s(()=>i.abort(),"abort");return t.forEach(r=>{il(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{t.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};Mo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=T((D_,ol)=>{"use strict";var{format:Vp,inspect:ar,AggregateError:Hp}=re(),Kp=globalThis.AggregateError||Hp,Gp=Symbol("kIsNodeError"),Yp=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Xp=/^([A-Z][a-z0-9]*)+$/,Jp="__node_internal_",cr={};function Ht(e,t){if(!e)throw new cr.ERR_INTERNAL_ASSERTION(t)}s(Ht,"assert");function nl(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(nl,"addNumericalSeparator");function Qp(e,t,i){if(typeof t=="function")return Ht(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 Ht(n===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?t:Vp(t,...i)}s(Qp,"getMessage");function ie(e,t,i){i||(i=Error);class n extends i{static{s(this,"NodeError")}constructor(...o){super(Qp(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}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[Gp]=!0,cr[e]=n}s(ie,"E");function rl(e){let t=Jp+e.name;return Object.defineProperty(e,"name",{value:t}),e}s(rl,"hideStackFrames");function Zp(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let i=new Kp([t,e],t.message);return i.code=t.code,i}return e||t}s(Zp,"aggregateTwoErrors");var Wo=class extends Error{static{s(this,"AbortError")}constructor(t="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new cr.ERR_INVALID_ARG_TYPE("options","Object",i);super(t,i),this.code="ABORT_ERR",this.name="AbortError"}};ie("ERR_ASSERTION","%s",Error);ie("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Ht(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)Ht(typeof l=="string","All expected entries have to be of type string"),Yp.includes(l)?r.push(l.toLowerCase()):Xp.test(l)?o.push(l):(Ht(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=ar(i,{depth:-1});n+=`. Received ${l}`}}else{let l=ar(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=ar(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)=>{Ht(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)=>{Ht(t,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=nl(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=nl(n)),n+="n"):n=ar(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);ol.exports={AbortError:Wo,aggregateTwoErrors:rl(Zp),hideStackFrames:rl,codes:cr}});var ki=T((W_,yl)=>{"use strict";var{ArrayIsArray:jo,ArrayPrototypeIncludes:ll,ArrayPrototypeJoin:fl,ArrayPrototypeMap:ey,NumberIsInteger:qo,NumberIsNaN:ty,NumberMAX_SAFE_INTEGER:iy,NumberMIN_SAFE_INTEGER:ny,NumberParseInt:ry,ObjectPrototypeHasOwnProperty:oy,RegExpPrototypeExec:ul,String:sy,StringPrototypeToUpperCase:ay,StringPrototypeTrim:cy}=q(),{hideStackFrames:Re,codes:{ERR_SOCKET_BAD_PORT:ly,ERR_INVALID_ARG_TYPE:oe,ERR_INVALID_ARG_VALUE:xi,ERR_OUT_OF_RANGE:Kt,ERR_UNKNOWN_SIGNAL:sl}}=ae(),{normalizeEncoding:fy}=re(),{isAsyncFunction:uy,isArrayBufferView:dy}=re().types,al={};function hy(e){return e===(e|0)}s(hy,"isInt32");function py(e){return e===e>>>0}s(py,"isUint32");var yy=/^[0-7]+$/,my="must be a 32-bit unsigned integer or an octal string";function by(e,t,i){if(typeof e>"u"&&(e=i),typeof e=="string"){if(ul(yy,e)===null)throw new xi(t,e,my);e=ry(e,8)}return dl(e,t),e}s(by,"parseFileMode");var gy=Re((e,t,i=ny,n=iy)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!qo(e))throw new Kt(t,"an integer",e);if(e<i||e>n)throw new Kt(t,`>= ${i} && <= ${n}`,e)}),wy=Re((e,t,i=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!qo(e))throw new Kt(t,"an integer",e);if(e<i||e>n)throw new Kt(t,`>= ${i} && <= ${n}`,e)}),dl=Re((e,t,i=!1)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!qo(e))throw new Kt(t,"an integer",e);let n=i?1:0,r=4294967295;if(e<n||e>r)throw new Kt(t,`>= ${n} && <= ${r}`,e)});function $o(e,t){if(typeof e!="string")throw new oe(t,"string",e)}s($o,"validateString");function Sy(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)&&ty(e))throw new Kt(t,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}s(Sy,"validateNumber");var Ey=Re((e,t,i)=>{if(!ll(i,e)){let r="must be one of: "+fl(ey(i,o=>typeof o=="string"?`'${o}'`:sy(o)),", ");throw new xi(t,e,r)}});function hl(e,t){if(typeof e!="boolean")throw new oe(t,"boolean",e)}s(hl,"validateBoolean");function Uo(e,t,i){return e==null||!oy(e,t)?i:e[t]}s(Uo,"getOwnPropertyValueOrDefault");var _y=Re((e,t,i=null)=>{let n=Uo(i,"allowArray",!1),r=Uo(i,"allowFunction",!1);if(!Uo(i,"nullable",!1)&&e===null||!n&&jo(e)||typeof e!="object"&&(!r||typeof e!="function"))throw new oe(t,"Object",e)}),xy=Re((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new oe(t,"a dictionary",e)}),lr=Re((e,t,i=0)=>{if(!jo(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 ky(e,t){lr(e,t);for(let i=0;i<e.length;i++)$o(e[i],`${t}[${i}]`)}s(ky,"validateStringArray");function vy(e,t){lr(e,t);for(let i=0;i<e.length;i++)hl(e[i],`${t}[${i}]`)}s(vy,"validateBooleanArray");function Fy(e,t){lr(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);pl(n,r)}}s(Fy,"validateAbortSignalArray");function Iy(e,t="signal"){if($o(e,t),al[e]===void 0)throw al[ay(e)]!==void 0?new sl(e+" (signals must use all capital letters)"):new sl(e)}s(Iy,"validateSignalName");var Ay=Re((e,t="buffer")=>{if(!dy(e))throw new oe(t,["Buffer","TypedArray","DataView"],e)});function Oy(e,t){let i=fy(t),n=e.length;if(i==="hex"&&n%2!==0)throw new xi("encoding",t,`is invalid for data of length ${n}`)}s(Oy,"validateEncoding");function Py(e,t="Port",i=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&cy(e).length===0||+e!==+e>>>0||e>65535||e===0&&!i)throw new ly(t,e,i);return e|0}s(Py,"validatePort");var pl=Re((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new oe(t,"AbortSignal",e)}),Ty=Re((e,t)=>{if(typeof e!="function")throw new oe(t,"Function",e)}),Ry=Re((e,t)=>{if(typeof e!="function"||uy(e))throw new oe(t,"Function",e)}),Ny=Re((e,t)=>{if(e!==void 0)throw new oe(t,"undefined",e)});function Ly(e,t,i){if(!ll(i,e))throw new oe(t,`('${fl(i,"|")}')`,e)}s(Ly,"validateUnion");var Cy=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function cl(e,t){if(typeof e>"u"||!ul(Cy,e))throw new xi(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(cl,"validateLinkHeaderFormat");function By(e){if(typeof e=="string")return cl(e,"hints"),e;if(jo(e)){let t=e.length,i="";if(t===0)return i;for(let n=0;n<t;n++){let r=e[n];cl(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(By,"validateLinkHeaderValue");yl.exports={isInt32:hy,isUint32:py,parseFileMode:by,validateArray:lr,validateStringArray:ky,validateBooleanArray:vy,validateAbortSignalArray:Fy,validateBoolean:hl,validateBuffer:Ay,validateDictionary:xy,validateEncoding:Oy,validateFunction:Ty,validateInt32:wy,validateInteger:gy,validateNumber:Sy,validateObject:_y,validateOneOf:Ey,validatePlainFunction:Ry,validatePort:Py,validateSignalName:Iy,validateString:$o,validateUint32:dl,validateUndefined:Ny,validateUnion:Ly,validateAbortSignal:pl,validateLinkHeaderValue:By}});var Pt=T((j_,wl)=>{var V=wl.exports={},Qe,Ze;function zo(){throw new Error("setTimeout has not been defined")}s(zo,"defaultSetTimout");function Vo(){throw new Error("clearTimeout has not been defined")}s(Vo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Qe=setTimeout:Qe=zo}catch{Qe=zo}try{typeof clearTimeout=="function"?Ze=clearTimeout:Ze=Vo}catch{Ze=Vo}})();function ml(e){if(Qe===setTimeout)return setTimeout(e,0);if((Qe===zo||!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(ml,"runTimeout");function Dy(e){if(Ze===clearTimeout)return clearTimeout(e);if((Ze===Vo||!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(Dy,"runClearTimeout");var yt=[],vi=!1,Gt,fr=-1;function My(){!vi||!Gt||(vi=!1,Gt.length?yt=Gt.concat(yt):fr=-1,yt.length&&bl())}s(My,"cleanUpNextTick");function bl(){if(!vi){var e=ml(My);vi=!0;for(var t=yt.length;t;){for(Gt=yt,yt=[];++fr<t;)Gt&&Gt[fr].run();fr=-1,t=yt.length}Gt=null,vi=!1,Dy(e)}}s(bl,"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 gl(e,t)),yt.length===1&&!vi&&ml(bl)};function gl(e,t){this.fun=e,this.array=t}s(gl,"Item");gl.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(($_,Ll)=>{"use strict";var{SymbolAsyncIterator:Sl,SymbolIterator:El,SymbolFor:Yt}=q(),_l=Yt("nodejs.stream.destroyed"),xl=Yt("nodejs.stream.errored"),Ho=Yt("nodejs.stream.readable"),Ko=Yt("nodejs.stream.writable"),kl=Yt("nodejs.stream.disturbed"),Wy=Yt("nodejs.webstream.isClosedPromise"),Uy=Yt("nodejs.webstream.controllerErrorFunction");function ur(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(ur,"isReadableNodeStream");function dr(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(dr,"isWritableNodeStream");function jy(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}s(jy,"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 vl(e){return!!(e&&!et(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}s(vl,"isReadableStream");function Fl(e){return!!(e&&!et(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}s(Fl,"isWritableStream");function Il(e){return!!(e&&!et(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}s(Il,"isTransformStream");function qy(e){return vl(e)||Fl(e)||Il(e)}s(qy,"isWebStream");function $y(e,t){return e==null?!1:t===!0?typeof e[Sl]=="function":t===!1?typeof e[El]=="function":typeof e[Sl]=="function"||typeof e[El]=="function"}s($y,"isIterable");function hr(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!!(e.destroyed||e[_l]||n!=null&&n.destroyed)}s(hr,"isDestroyed");function Al(e){if(!dr(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(Al,"isWritableEnded");function zy(e,t){if(!dr(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(zy,"isWritableFinished");function Vy(e){if(!ur(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(Vy,"isReadableEnded");function Ol(e,t){if(!ur(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(Ol,"isReadableFinished");function Pl(e){return e&&e[Ho]!=null?e[Ho]:typeof e?.readable!="boolean"?null:hr(e)?!1:ur(e)&&e.readable&&!Ol(e)}s(Pl,"isReadable");function Tl(e){return e&&e[Ko]!=null?e[Ko]:typeof e?.writable!="boolean"?null:hr(e)?!1:dr(e)&&e.writable&&!Al(e)}s(Tl,"isWritable");function Hy(e,t){return et(e)?hr(e)?!0:!(t?.readable!==!1&&Pl(e)||t?.writable!==!1&&Tl(e)):null}s(Hy,"isFinished");function Ky(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(Ky,"isWritableErrored");function Gy(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(Gy,"isReadableErrored");function Yy(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"&&Rl(e)?e._closed:null}s(Yy,"isClosed");function Rl(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}s(Rl,"isOutgoingMessage");function Nl(e){return typeof e._sent100=="boolean"&&Rl(e)}s(Nl,"isServerResponse");function Xy(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(Xy,"isServerRequest");function Jy(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!n&&Nl(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(Jy,"willEmitClose");function Qy(e){var t;return!!(e&&((t=e[kl])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}s(Qy,"isDisturbed");function Zy(e){var t,i,n,r,o,a,c,l,f,d;return!!(e&&((t=(i=(n=(r=(o=(a=e[xl])!==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(Zy,"isErrored");Ll.exports={isDestroyed:hr,kIsDestroyed:_l,isDisturbed:Qy,kIsDisturbed:kl,isErrored:Zy,kIsErrored:xl,isReadable:Pl,kIsReadable:Ho,kIsClosedPromise:Wy,kControllerErrorFunction:Uy,kIsWritable:Ko,isClosed:Yy,isDuplexNodeStream:jy,isFinished:Hy,isIterable:$y,isReadableNodeStream:ur,isReadableStream:vl,isReadableEnded:Vy,isReadableFinished:Ol,isReadableErrored:Gy,isNodeStream:et,isWebStream:qy,isWritable:Tl,isWritableNodeStream:dr,isWritableStream:Fl,isWritableEnded:Al,isWritableFinished:zy,isWritableErrored:Ky,isServerRequest:Xy,isServerResponse:Nl,willEmitClose:Jy,isTransformStream:Il}});var bt=T((V_,Qo)=>{var Tt=Pt(),{AbortError:$l,codes:em}=ae(),{ERR_INVALID_ARG_TYPE:tm,ERR_STREAM_PREMATURE_CLOSE:Cl}=em,{kEmptyObject:Yo,once:Xo}=re(),{validateAbortSignal:im,validateFunction:nm,validateObject:rm,validateBoolean:om}=ki(),{Promise:sm,PromisePrototypeThen:am,SymbolDispose:zl}=q(),{isClosed:cm,isReadable:Bl,isReadableNodeStream:Go,isReadableStream:lm,isReadableFinished:Dl,isReadableErrored:Ml,isWritable:Wl,isWritableNodeStream:Ul,isWritableStream:fm,isWritableFinished:jl,isWritableErrored:ql,isNodeStream:um,willEmitClose:dm,kIsClosedPromise:hm}=tt(),Fi;function pm(e){return e.setHeader&&typeof e.abort=="function"}s(pm,"isRequest");var Jo=s(()=>{},"nop");function Vl(e,t,i){var n,r;if(arguments.length===2?(i=t,t=Yo):t==null?t=Yo:rm(t,"options"),nm(i,"callback"),im(t.signal,"options.signal"),i=Xo(i),lm(e)||fm(e))return ym(e,t,i);if(!um(e))throw new tm("stream",["ReadableStream","WritableStream","Stream"],e);let o=(n=t.readable)!==null&&n!==void 0?n:Go(e),a=(r=t.writable)!==null&&r!==void 0?r:Ul(e),c=e._writableState,l=e._readableState,f=s(()=>{e.writable||b()},"onlegacyfinish"),d=dm(e)&&Go(e)===o&&Ul(e)===a,h=jl(e,!1),b=s(()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||o))&&(!o||p)&&i.call(e)},"onfinish"),p=Dl(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=cm(e),k=s(()=>{A=!0;let B=ql(e)||Ml(e);if(B&&typeof B!="boolean")return i.call(e,B);if(o&&!p&&Go(e,!0)&&!Dl(e,!1))return i.call(e,new Cl);if(a&&!h&&!jl(e,!1))return i.call(e,new Cl);i.call(e)},"onclose"),v=s(()=>{A=!0;let B=ql(e)||Ml(e);if(B&&typeof B!="boolean")return i.call(e,B);i.call(e)},"onclosed"),N=s(()=>{e.req.on("finish",b)},"onrequest");pm(e)?(e.on("complete",b),d||e.on("abort",k),e.req?N():e.on("request",N)):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||Bl(e))&&(h||Wl(e)===!1)||!a&&(!d||Wl(e))&&(p||Bl(e)===!1)||l&&e.req&&e.aborted)&&Tt.nextTick(v);let F=s(()=>{i=Jo,e.removeListener("aborted",k),e.removeListener("complete",b),e.removeListener("abort",k),e.removeListener("request",N),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 $l(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=Xo((...oi)=>{Bt[zl](),Ee.apply(e,oi)})}}return F}s(Vl,"eos");function ym(e,t,i){let n=!1,r=Jo;if(t.signal)if(r=s(()=>{n=!0,i.call(e,new $l(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=Xo((...l)=>{a[zl](),c.apply(e,l)})}let o=s((...a)=>{n||Tt.nextTick(()=>i.apply(e,a))},"resolverFn");return am(e[hm].promise,o,o),Jo}s(ym,"eosWeb");function mm(e,t){var i;let n=!1;return t===null&&(t=Yo),(i=t)!==null&&i!==void 0&&i.cleanup&&(om(t.cleanup,"cleanup"),n=t.cleanup),new sm((r,o)=>{let a=Vl(e,t,c=>{n&&a(),c?o(c):r()})})}s(mm,"finished");Qo.exports=Vl;Qo.exports.finished=mm});var Xt=T((K_,Zl)=>{"use strict";var it=Pt(),{aggregateTwoErrors:bm,codes:{ERR_MULTIPLE_CALLBACK:gm},AbortError:wm}=ae(),{Symbol:Gl}=q(),{kIsDestroyed:Sm,isDestroyed:Em,isFinished:_m,isServerRequest:xm}=tt(),Yl=Gl("kDestroy"),Zo=Gl("kConstruct");function Xl(e,t,i){e&&(e.stack,t&&!t.errored&&(t.errored=e),i&&!i.errored&&(i.errored=e))}s(Xl,"checkError");function km(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):(Xl(e,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Hl(this,e,t):this.once(Yl,function(o){Hl(this,bm(o,e),t)}),this)}s(km,"destroy");function Hl(e,t,i){let n=!1;function r(o){if(n)return;n=!0;let a=e._readableState,c=e._writableState;Xl(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?it.nextTick(vm,e,o):it.nextTick(Jl,e)}s(r,"onDestroy");try{e._destroy(t||null,r)}catch(o){r(o)}}s(Hl,"_destroy");function vm(e,t){es(e,t),Jl(e)}s(vm,"emitErrorCloseNT");function Jl(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(Jl,"emitCloseNT");function es(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(es,"emitErrorNT");function Fm(){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(Fm,"undestroy");function ts(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(es,e,t):es(e,t))}s(ts,"errorOrDestroy");function Im(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(Zo,t),!(e.listenerCount(Zo)>1)&&it.nextTick(Am,e)}s(Im,"construct");function Am(e){let t=!1;function i(n){if(t){ts(e,n??new gm);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(Yl,n):n?ts(e,n,!0):it.nextTick(Om,e)}s(i,"onConstruct");try{e._construct(n=>{it.nextTick(i,n)})}catch(n){it.nextTick(i,n)}}s(Am,"constructNT");function Om(e){e.emit(Zo)}s(Om,"emitConstructNT");function Kl(e){return e?.setHeader&&typeof e.abort=="function"}s(Kl,"isRequest");function Ql(e){e.emit("close")}s(Ql,"emitCloseLegacy");function Pm(e,t){e.emit("error",t),it.nextTick(Ql,e)}s(Pm,"emitErrorCloseLegacy");function Tm(e,t){!e||Em(e)||(!t&&!_m(e)&&(t=new wm),xm(e)?(e.socket=null,e.destroy(t)):Kl(e)?e.abort():Kl(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?it.nextTick(Pm,e,t):it.nextTick(Ql,e),e.destroyed||(e[Sm]=!0))}s(Tm,"destroyer");Zl.exports={construct:Im,destroyer:Tm,destroy:km,undestroy:Fm,errorOrDestroy:ts}});var mr=T((Y_,tf)=>{"use strict";var{ArrayIsArray:Rm,ObjectSetPrototypeOf:ef}=q(),{EventEmitter:pr}=yn();function yr(e){pr.call(this,e)}s(yr,"Stream");ef(yr.prototype,pr.prototype);ef(yr,pr);yr.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(),pr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),is(i,"error",l),is(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 is(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):Rm(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}s(is,"prependListener");tf.exports={Stream:yr,prependListener:is}});var mn=T((J_,br)=>{"use strict";var{SymbolDispose:Nm}=q(),{AbortError:nf,codes:Lm}=ae(),{isNodeStream:rf,isWebStream:Cm,kControllerErrorFunction:Bm}=tt(),Dm=bt(),{ERR_INVALID_ARG_TYPE:of}=Lm,ns,Mm=s((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new of(t,"AbortSignal",e)},"validateAbortSignal");br.exports.addAbortSignal=s(function(t,i){if(Mm(t,"signal"),!rf(i)&&!Cm(i))throw new of("stream",["ReadableStream","WritableStream","Stream"],i);return br.exports.addAbortSignalNoValidate(t,i)},"addAbortSignal");br.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let i=rf(t)?()=>{t.destroy(new nf(void 0,{cause:e.reason}))}:()=>{t[Bm](new nf(void 0,{cause:e.reason}))};if(e.aborted)i();else{ns=ns||re().addAbortListener;let n=ns(e,i);Dm(t,n[Nm])}return t}});var cf=T((ex,af)=>{"use strict";var{StringPrototypeSlice:sf,SymbolIterator:Wm,TypedArrayPrototypeSet:gr,Uint8Array:Um}=q(),{Buffer:rs}=Ie(),{inspect:jm}=re();af.exports=class{static{s(this,"BufferList")}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 rs.alloc(0);let i=rs.allocUnsafe(t>>>0),n=this.head,r=0;for(;n;)gr(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}*[Wm](){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+=sf(o,0,t),this.head=n,n.data=sf(o,t));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(t){let i=rs.allocUnsafe(t),n=t,r=this.head,o=0;do{let a=r.data;if(t>a.length)gr(i,a,n-t),t-=a.length;else{t===a.length?(gr(i,a,n-t),++o,r.next?this.head=r.next:this.head=this.tail=null):(gr(i,new Um(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 jm(this,{...i,depth:0,customInspect:!1})}}});var bn=T((ix,df)=>{"use strict";var{MathFloor:qm,NumberIsInteger:$m}=q(),{validateInteger:zm}=ki(),{ERR_INVALID_ARG_VALUE:Vm}=ae().codes,lf=16*1024,ff=16;function Hm(e,t,i){return e.highWaterMark!=null?e.highWaterMark:t?e[i]:null}s(Hm,"highWaterMarkFrom");function uf(e){return e?ff:lf}s(uf,"getDefaultHighWaterMark");function Km(e,t){zm(t,"value",0),e?ff=t:lf=t}s(Km,"setDefaultHighWaterMark");function Gm(e,t,i,n){let r=Hm(t,n,i);if(r!=null){if(!$m(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Vm(o,r)}return qm(r)}return uf(e.objectMode)}s(Gm,"getHighWaterMark");df.exports={getHighWaterMark:Gm,getDefaultHighWaterMark:uf,setDefaultHighWaterMark:Km}});var yf=T((os,pf)=>{var wr=Ie(),nt=wr.Buffer;function hf(e,t){for(var i in e)t[i]=e[i]}s(hf,"copyProps");nt.from&&nt.alloc&&nt.allocUnsafe&&nt.allocUnsafeSlow?pf.exports=wr:(hf(wr,os),os.Buffer=Jt);function Jt(e,t,i){return nt(e,t,i)}s(Jt,"SafeBuffer");Jt.prototype=Object.create(nt.prototype);hf(nt,Jt);Jt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return nt(e,t,i)};Jt.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};Jt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return nt(e)};Jt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return wr.SlowBuffer(e)}});var gf=T(bf=>{"use strict";var as=yf().Buffer,mf=as.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 Ym(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(Ym,"_normalizeEncoding");function Xm(e){var t=Ym(e);if(typeof t!="string"&&(as.isEncoding===mf||!mf(e)))throw new Error("Unknown encoding: "+e);return t||e}s(Xm,"normalizeEncoding");bf.StringDecoder=gn;function gn(e){this.encoding=Xm(e);var t;switch(this.encoding){case"utf16le":this.text=ib,this.end=nb,t=4;break;case"utf8":this.fillLast=Zm,t=4;break;case"base64":this.text=rb,this.end=ob,t=3;break;default:this.write=sb,this.end=ab;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=as.allocUnsafe(t)}s(gn,"StringDecoder");gn.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||""};gn.prototype.end=tb;gn.prototype.text=eb;gn.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 ss(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}s(ss,"utf8CheckByte");function Jm(e,t,i){var n=t.length-1;if(n<i)return 0;var r=ss(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=ss(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=ss(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}s(Jm,"utf8CheckIncomplete");function Qm(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(Qm,"utf8CheckExtraBytes");function Zm(e){var t=this.lastTotal-this.lastNeed,i=Qm(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(Zm,"utf8FillLast");function eb(e,t){var i=Jm(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(eb,"utf8Text");function tb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}s(tb,"utf8End");function ib(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(ib,"utf16Text");function nb(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(nb,"utf16End");function rb(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(rb,"base64Text");function ob(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}s(ob,"base64End");function sb(e){return e.toString(this.encoding)}s(sb,"simpleWrite");function ab(e){return e&&e.length?this.write(e):""}s(ab,"simpleEnd")});var cs=T((ax,_f)=>{"use strict";var wf=Pt(),{PromisePrototypeThen:cb,SymbolAsyncIterator:Sf,SymbolIterator:Ef}=q(),{Buffer:lb}=Ie(),{ERR_INVALID_ARG_TYPE:fb,ERR_STREAM_NULL_VALUES:ub}=ae().codes;function db(e,t,i){let n;if(typeof t=="string"||t instanceof lb)return new e({objectMode:!0,...i,read:s(function(){this.push(t),this.push(null)},"read")});let r;if(t&&t[Sf])r=!0,n=t[Sf]();else if(t&&t[Ef])r=!1,n=t[Ef]();else throw new fb("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){cb(c(f),()=>wf.nextTick(d,f),h=>wf.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 ub;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(db,"from");_f.exports=db});var Sn=T((lx,Uf)=>{var Me=Pt(),{ArrayPrototypeIndexOf:hb,NumberIsInteger:pb,NumberIsNaN:yb,NumberParseInt:mb,ObjectDefineProperties:ms,ObjectKeys:bb,ObjectSetPrototypeOf:vf,Promise:Ff,SafeSet:gb,SymbolAsyncDispose:wb,SymbolAsyncIterator:Sb,Symbol:Eb}=q();Uf.exports=O;O.ReadableState=xr;var{EventEmitter:_b}=yn(),{Stream:Rt,prependListener:xb}=mr(),{Buffer:ls}=Ie(),{addAbortSignal:kb}=mn(),If=bt(),P=re().debuglog("stream",e=>{P=e}),vb=cf(),Oi=Xt(),{getHighWaterMark:Fb,getDefaultHighWaterMark:Ib}=bn(),{aggregateTwoErrors:xf,codes:{ERR_INVALID_ARG_TYPE:Ab,ERR_METHOD_NOT_IMPLEMENTED:Ob,ERR_OUT_OF_RANGE:Pb,ERR_STREAM_PUSH_AFTER_EOF:Tb,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Rb},AbortError:Nb}=ae(),{validateObject:Lb}=ki(),Qt=Eb("kPaused"),{StringDecoder:Af}=gf(),Cb=cs();vf(O.prototype,Rt.prototype);vf(O,Rt);var fs=s(()=>{},"nop"),{errorOrDestroy:Ii}=Oi,Ai=1,Bb=2,Of=4,wn=8,Pf=16,Sr=32,Er=64,Tf=128,Db=256,Mb=512,Wb=1024,ps=2048,ys=4096,Ub=8192,jb=16384,qb=32768,Rf=65536,$b=1<<17,zb=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");ms(xr.prototype,{objectMode:J(Ai),ended:J(Bb),endEmitted:J(Of),reading:J(wn),constructed:J(Pf),sync:J(Sr),needReadable:J(Er),emittedReadable:J(Tf),readableListening:J(Db),resumeScheduled:J(Mb),errorEmitted:J(Wb),emitClose:J(ps),autoDestroy:J(ys),destroyed:J(Ub),closed:J(jb),closeEmitted:J(qb),multiAwaitDrain:J(Rf),readingMore:J($b),dataEmitted:J(zb)});function xr(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.state=ps|ys|Pf|Sr,e&&e.objectMode&&(this.state|=Ai),i&&e&&e.readableObjectMode&&(this.state|=Ai),this.highWaterMark=e?Fb(this,e,"readableHighWaterMark",i):Ib(!1),this.buffer=new vb,this.length=0,this.pipes=[],this.flowing=null,this[Qt]=null,e&&e.emitClose===!1&&(this.state&=~ps),e&&e.autoDestroy===!1&&(this.state&=~ys),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new Af(e.encoding),this.encoding=e.encoding)}s(xr,"ReadableState");function O(e){if(!(this instanceof O))return new O(e);let t=this instanceof rt();this._readableState=new xr(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&&kb(e.signal,this)),Rt.call(this,e),Oi.construct(this,()=>{this._readableState.needReadable&&_r(this,this._readableState)})}s(O,"Readable");O.prototype.destroy=Oi.destroy;O.prototype._undestroy=Oi.undestroy;O.prototype._destroy=function(e,t){t(e)};O.prototype[_b.captureRejectionSymbol]=function(e){this.destroy(e)};O.prototype[wb]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new Nb,this.destroy(e)),new Ff((t,i)=>If(this,n=>n&&n!==e?i(n):t(null)))};O.prototype.push=function(e,t){return Nf(this,e,t,!1)};O.prototype.unshift=function(e,t){return Nf(this,e,t,!0)};function Nf(e,t,i,n){P("readableAddChunk",t);let r=e._readableState,o;if(r.state&Ai||(typeof t=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?t=ls.from(t,i).toString(r.encoding):(t=ls.from(t,i),i=""))):t instanceof ls?i="":Rt._isUint8Array(t)?(t=Rt._uint8ArrayToBuffer(t),i=""):t!=null&&(o=new Ab("chunk",["string","Buffer","Uint8Array"],t))),o)Ii(e,o);else if(t===null)r.state&=~wn,Kb(e,r);else if(r.state&Ai||t&&t.length>0)if(n)if(r.state&Of)Ii(e,new Rb);else{if(r.destroyed||r.errored)return!1;us(e,r,t,!0)}else if(r.ended)Ii(e,new Tb);else{if(r.destroyed||r.errored)return!1;r.state&=~wn,r.decoder&&!i?(t=r.decoder.write(t),r.objectMode||t.length!==0?us(e,r,t,!1):_r(e,r)):us(e,r,t,!1)}else n||(r.state&=~wn,_r(e,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(Nf,"readableAddChunk");function us(e,t,i,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&Rf?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&Er&&kr(e)),_r(e,t)}s(us,"addChunk");O.prototype.isPaused=function(){let e=this._readableState;return e[Qt]===!0||e.flowing===!1};O.prototype.setEncoding=function(e){let t=new Af(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 Vb=1073741824;function Hb(e){if(e>Vb)throw new Pb("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}s(Hb,"computeNewHighWaterMark");function kf(e,t){return e<=0||t.length===0&&t.ended?0:t.state&Ai?1:yb(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}s(kf,"howMuchToRead");O.prototype.read=function(e){P("read",e),e===void 0?e=NaN:pb(e)||(e=mb(e,10));let t=this._readableState,i=e;if(e>t.highWaterMark&&(t.highWaterMark=Hb(e)),e!==0&&(t.state&=~Tf),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?ds(this):kr(this),null;if(e=kf(e,t),e===0&&t.ended)return t.length===0&&ds(this),null;let n=(t.state&Er)!==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|=wn|Sr,t.length===0&&(t.state|=Er);try{this._read(t.highWaterMark)}catch(o){Ii(this,o)}t.state&=~Sr,t.reading||(e=kf(i,t))}let r;return e>0?r=Mf(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&&ds(this)),r!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",r)),r};function Kb(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?kr(e):(t.needReadable=!1,t.emittedReadable=!0,Lf(e))}}s(Kb,"onEofChunk");function kr(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(Lf,e))}s(kr,"emitReadable");function Lf(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,Bf(e)}s(Lf,"emitReadable_");function _r(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Me.nextTick(Gb,e,t))}s(_r,"maybeReadMore");function Gb(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(Gb,"maybeReadMore_");O.prototype._read=function(e){throw new Ob("_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 gb(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=Yb(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?Ii(e,k):e.emit("error",k)}}s(p,"onerror"),xb(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 Yb(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(Yb,"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=hb(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?kr(this):n.reading||Me.nextTick(Xb,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(Cf,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(Cf,this),t};function Cf(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[Qt]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}s(Cf,"updateReadableListening");function Xb(e){P("readable nexttick read 0"),e.read(0)}s(Xb,"nReadingNextTick");O.prototype.resume=function(){let e=this._readableState;return e.flowing||(P("resume"),e.flowing=!e.readableListening,Jb(this,e)),e[Qt]=!1,this};function Jb(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick(Qb,e,t))}s(Jb,"resume");function Qb(e,t){P("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Bf(e),t.flowing&&!t.reading&&e.read(0)}s(Qb,"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[Qt]=!0,this};function Bf(e){let t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}s(Bf,"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=>{Ii(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let i=bb(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[Sb]=function(){return Df(this)};O.prototype.iterator=function(e){return e!==void 0&&Lb(e,"options"),Df(this,e)};function Df(e,t){typeof e.read!="function"&&(e=O.wrap(e,{objectMode:!0}));let i=Zb(e,t);return i.stream=e,i}s(Df,"streamToAsyncIterator");async function*Zb(e,t){let i=fs;function n(a){this===e?(i(),i=fs):i=a}s(n,"next"),e.on("readable",n);let r,o=If(e,{writable:!1},a=>{r=a?xf(r,a):null,i(),i=fs});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 Ff(n)}}}catch(a){throw r=xf(r,a),r}finally{(r||t?.destroyOnReturn!==!1)&&(r===void 0||e._readableState.autoDestroy)?Oi.destroyer(e,null):(e.off("readable",n),o())}}s(Zb,"createAsyncIterator");ms(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")}});ms(xr.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Qt]!==!1},"get"),set:s(function(e){this[Qt]=!!e},"set")}});O._fromList=Mf;function Mf(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(Mf,"fromList");function ds(e){let t=e._readableState;P("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Me.nextTick(eg,t,e))}s(ds,"endReadable");function eg(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(tg,t);else if(e.autoDestroy){let i=t._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&t.destroy()}}}s(eg,"endReadableNT");function tg(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}s(tg,"endWritableNT");O.from=function(e,t){return Cb(O,e,t)};var hs;function Wf(){return hs===void 0&&(hs={}),hs}s(Wf,"lazyWebStreams");O.fromWeb=function(e,t){return Wf().newStreamReadableFromReadableStream(e,t)};O.toWeb=function(e,t){return Wf().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){Oi.destroyer(e,r),o(r)},"destroy")}).wrap(e)}});var Or=T((ux,Qf)=>{var Zt=Pt(),{ArrayPrototypeSlice:$f,Error:ig,FunctionPrototypeSymbolHasInstance:zf,ObjectDefineProperty:Vf,ObjectDefineProperties:ng,ObjectSetPrototypeOf:Hf,StringPrototypeToLowerCase:rg,Symbol:og,SymbolHasInstance:sg}=q();Qf.exports=$;$.WritableState=xn;var{EventEmitter:ag}=yn(),En=mr().Stream,{Buffer:vr}=Ie(),Ar=Xt(),{addAbortSignal:cg}=mn(),{getHighWaterMark:lg,getDefaultHighWaterMark:fg}=bn(),{ERR_INVALID_ARG_TYPE:ug,ERR_METHOD_NOT_IMPLEMENTED:dg,ERR_MULTIPLE_CALLBACK:Kf,ERR_STREAM_CANNOT_PIPE:hg,ERR_STREAM_DESTROYED:_n,ERR_STREAM_ALREADY_FINISHED:pg,ERR_STREAM_NULL_VALUES:yg,ERR_STREAM_WRITE_AFTER_END:mg,ERR_UNKNOWN_ENCODING:Gf}=ae().codes,{errorOrDestroy:Pi}=Ar;Hf($.prototype,En.prototype);Hf($,En);function ws(){}s(ws,"nop");var Ti=og("kOnFinished");function xn(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?lg(this,e,"writableHighWaterMark",i):fg(!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=gg.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Ir(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[Ti]=[]}s(xn,"WritableState");function Ir(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}s(Ir,"resetBuffer");xn.prototype.getBuffer=s(function(){return $f(this.buffered,this.bufferedIndex)},"getBuffer");Vf(xn.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function $(e){let t=this instanceof rt();if(!t&&!zf($,this))return new $(e);this._writableState=new xn(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&&cg(e.signal,this)),En.call(this,e),Ar.construct(this,()=>{let i=this._writableState;i.writing||Es(this,i),_s(this,i)})}s($,"Writable");Vf($,sg,{__proto__:null,value:s(function(e){return zf(this,e)?!0:this!==$?!1:e&&e._writableState instanceof xn},"value")});$.prototype.pipe=function(){Pi(this,new hg)};function Yf(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"&&!vr.isEncoding(i))throw new Gf(i);typeof n!="function"&&(n=ws)}if(t===null)throw new yg;if(!r.objectMode)if(typeof t=="string")r.decodeStrings!==!1&&(t=vr.from(t,i),i="buffer");else if(t instanceof vr)i="buffer";else if(En._isUint8Array(t))t=En._uint8ArrayToBuffer(t),i="buffer";else throw new ug("chunk",["string","Buffer","Uint8Array"],t);let o;return r.ending?o=new mg:r.destroyed&&(o=new _n("write")),o?(Zt.nextTick(n,o),Pi(e,o,!0),o):(r.pendingcb++,bg(e,r,t,i,n))}s(Yf,"_write");$.prototype.write=function(e,t,i){return Yf(this,e,t,i)===!0};$.prototype.cork=function(){this._writableState.corked++};$.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||Es(this,e))};$.prototype.setDefaultEncoding=s(function(t){if(typeof t=="string"&&(t=rg(t)),!vr.isEncoding(t))throw new Gf(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function bg(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!==ws&&(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(bg,"writeOrBuffer");function jf(e,t,i,n,r,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _n("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}s(jf,"doWrite");function qf(e,t,i,n){--t.pendingcb,n(i),Ss(t),Pi(e,i)}s(qf,"onwriteError");function gg(e,t){let i=e._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){Pi(e,new Kf);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?Zt.nextTick(qf,e,i,t,r):qf(e,i,t,r)):(i.buffered.length>i.bufferedIndex&&Es(e,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:e,state:i},Zt.nextTick(wg,i.afterWriteTickInfo)):Xf(e,i,1,r))}s(gg,"onwrite");function wg({stream:e,state:t,count:i,cb:n}){return t.afterWriteTickInfo=null,Xf(e,t,i,n)}s(wg,"afterWriteTick");function Xf(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&&Ss(t),_s(e,t)}s(Xf,"afterWrite");function Ss(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 _n("write"))}let i=e[Ti].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=e.errored)!==null&&n!==void 0?n:new _n("end"))}Ir(e)}s(Ss,"errorBuffer");function Es(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?ws:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=t.allNoop&&a===0?i:$f(i,a);l.allBuffers=t.allBuffers,jf(e,t,!0,t.length,l,"",c),Ir(t)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=r?1:c.length;jf(e,t,!1,d,c,l,f)}while(a<i.length&&!t.writing);a===i.length?Ir(t):a>256?(i.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}s(Es,"clearBuffer");$.prototype._write=function(e,t,i){if(this._writev)this._writev([{chunk:e,encoding:t}],i);else throw new dg("_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=Yf(this,e,t);o instanceof ig&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,_s(this,n,!0),n.ended=!0):n.finished?r=new pg("end"):n.destroyed&&(r=new _n("end"))),typeof i=="function"&&(r||n.finished?Zt.nextTick(i,r):n[Ti].push(i)),this};function Fr(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(Fr,"needFinish");function Sg(e,t){let i=!1;function n(r){if(i){Pi(e,r??Kf());return}if(i=!0,t.pendingcb--,r){let o=t[Ti].splice(0);for(let a=0;a<o.length;a++)o[a](r);Pi(e,r,t.sync)}else Fr(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,Zt.nextTick(gs,e,t))}s(n,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(n)}catch(r){n(r)}t.sync=!1}s(Sg,"callFinal");function Eg(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,Sg(e,t)):(t.prefinished=!0,e.emit("prefinish")))}s(Eg,"prefinish");function _s(e,t,i){Fr(t)&&(Eg(e,t),t.pendingcb===0&&(i?(t.pendingcb++,Zt.nextTick((n,r)=>{Fr(r)?gs(n,r):r.pendingcb--},e,t)):Fr(t)&&(t.pendingcb++,gs(e,t))))}s(_s,"finishMaybe");function gs(e,t){t.pendingcb--,t.finished=!0;let i=t[Ti].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(gs,"finish");ng($.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 _g=Ar.destroy;$.prototype.destroy=function(e,t){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ti].length)&&Zt.nextTick(Ss,i),_g.call(this,e,t),this};$.prototype._undestroy=Ar.undestroy;$.prototype._destroy=function(e,t){t(e)};$.prototype[ag.captureRejectionSymbol]=function(e){this.destroy(e)};var bs;function Jf(){return bs===void 0&&(bs={}),bs}s(Jf,"lazyWebStreams");$.fromWeb=function(e,t){return Jf().newStreamWritableFromWritableStream(e,t)};$.toWeb=function(e){return Jf().newWritableStreamFromStreamWritable(e)}});var hu=T((hx,du)=>{var xs=Pt(),xg=Ie(),{isReadable:kg,isWritable:vg,isIterable:Zf,isNodeStream:Fg,isReadableNodeStream:eu,isWritableNodeStream:tu,isDuplexNodeStream:Ig,isReadableStream:iu,isWritableStream:nu}=tt(),ru=bt(),{AbortError:fu,codes:{ERR_INVALID_ARG_TYPE:Ag,ERR_INVALID_RETURN_VALUE:ou}}=ae(),{destroyer:Ni}=Xt(),Og=rt(),uu=Sn(),Pg=Or(),{createDeferredPromise:su}=re(),au=cs(),cu=globalThis.Blob||xg.Blob,Tg=s(typeof cu<"u"?function(t){return t instanceof cu}:function(t){return!1},"isBlob"),Rg=globalThis.AbortController||Ei().AbortController,{FunctionPrototypeCall:lu}=q(),Nt=class extends Og{static{s(this,"Duplexify")}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)}};du.exports=s(function e(t,i){if(Ig(t))return t;if(eu(t))return Ri({readable:t});if(tu(t))return Ri({writable:t});if(Fg(t))return Ri({writable:!1,readable:!1});if(iu(t))return Ri({readable:uu.fromWeb(t)});if(nu(t))return Ri({writable:Pg.fromWeb(t)});if(typeof t=="function"){let{value:r,write:o,final:a,destroy:c}=Ng(t);if(Zf(r))return au(Nt,r,{objectMode:!0,write:o,final:a,destroy:c});let l=r?.then;if(typeof l=="function"){let f,d=lu(l,r,h=>{if(h!=null)throw new ou("nully","body",h)},h=>{Ni(f,h)});return f=new Nt({objectMode:!0,readable:!1,write:o,final:s(function(h){a(async()=>{try{await d,xs.nextTick(h,null)}catch(b){xs.nextTick(h,b)}})},"final"),destroy:c})}throw new ou("Iterable, AsyncIterable or AsyncFunction",i,r)}if(Tg(t))return e(t.arrayBuffer());if(Zf(t))return au(Nt,t,{objectMode:!0,writable:!1});if(iu(t?.readable)&&nu(t?.writable))return Nt.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let r=t!=null&&t.readable?eu(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?tu(t?.writable)?t?.writable:e(t.writable):void 0;return Ri({readable:r,writable:o})}let n=t?.then;if(typeof n=="function"){let r;return lu(n,t,o=>{o!=null&&r.push(o),r.push(null)},o=>{Ni(r,o)}),r=new Nt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new Ag(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function Ng(e){let{promise:t,resolve:i}=su(),n=new Rg,r=n.signal;return{value:e(async function*(){for(;;){let a=t;t=null;let{chunk:c,done:l,cb:f}=await a;if(xs.nextTick(f),l)return;if(r.aborted)throw new fu(void 0,{cause:r.reason});({promise:t,resolve:i}=su()),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(Ng,"fromAsyncGen");function Ri(e){let t=e.readable&&typeof e.readable.read!="function"?uu.wrap(e.readable):e.readable,i=e.writable,n=!!kg(t),r=!!vg(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 Nt({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(ru(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&&(ru(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 fu),c=null,o=null,a=null,l===null?b(h):(l=b,Ni(i,h),Ni(t,h))},f}s(Ri,"_duplexify")});var rt=T((yx,mu)=>{"use strict";var{ObjectDefineProperties:Lg,ObjectGetOwnPropertyDescriptor:gt,ObjectKeys:Cg,ObjectSetPrototypeOf:pu}=q();mu.exports=We;var Fs=Sn(),Ne=Or();pu(We.prototype,Fs.prototype);pu(We,Fs);{let e=Cg(Ne.prototype);for(let t=0;t<e.length;t++){let i=e[t];We.prototype[i]||(We.prototype[i]=Ne.prototype[i])}}function We(e){if(!(this instanceof We))return new We(e);Fs.call(this,e),Ne.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");Lg(We.prototype,{writable:{__proto__:null,...gt(Ne.prototype,"writable")},writableHighWaterMark:{__proto__:null,...gt(Ne.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...gt(Ne.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...gt(Ne.prototype,"writableBuffer")},writableLength:{__proto__:null,...gt(Ne.prototype,"writableLength")},writableFinished:{__proto__:null,...gt(Ne.prototype,"writableFinished")},writableCorked:{__proto__:null,...gt(Ne.prototype,"writableCorked")},writableEnded:{__proto__:null,...gt(Ne.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...gt(Ne.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 ks;function yu(){return ks===void 0&&(ks={}),ks}s(yu,"lazyWebStreams");We.fromWeb=function(e,t){return yu().newStreamDuplexFromReadableWritablePair(e,t)};We.toWeb=function(e){return yu().newReadableWritablePairFromDuplex(e)};var vs;We.from=function(e){return vs||(vs=hu()),vs(e,"body")}});var Os=T((bx,gu)=>{"use strict";var{ObjectSetPrototypeOf:bu,Symbol:Bg}=q();gu.exports=wt;var{ERR_METHOD_NOT_IMPLEMENTED:Dg}=ae().codes,As=rt(),{getHighWaterMark:Mg}=bn();bu(wt.prototype,As.prototype);bu(wt,As);var kn=Bg("kCallback");function wt(e){if(!(this instanceof wt))return new wt(e);let t=e?Mg(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),As.call(this,e),this._readableState.sync=!1,this[kn]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Wg)}s(wt,"Transform");function Is(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(Is,"final");function Wg(){this._final!==Is&&Is.call(this)}s(Wg,"prefinish");wt.prototype._final=Is;wt.prototype._transform=function(e,t,i){throw new Dg("_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[kn]=i})};wt.prototype._read=function(){if(this[kn]){let e=this[kn];this[kn]=null,e()}}});var Ts=T((wx,Su)=>{"use strict";var{ObjectSetPrototypeOf:wu}=q();Su.exports=Li;var Ps=Os();wu(Li.prototype,Ps.prototype);wu(Li,Ps);function Li(e){if(!(this instanceof Li))return new Li(e);Ps.call(this,e)}s(Li,"PassThrough");Li.prototype._transform=function(e,t,i){i(null,e)}});var Nr=T((Ex,vu)=>{var vn=Pt(),{ArrayIsArray:Ug,Promise:jg,SymbolAsyncIterator:qg,SymbolDispose:$g}=q(),Rr=bt(),{once:zg}=re(),Vg=Xt(),Eu=rt(),{aggregateTwoErrors:Hg,codes:{ERR_INVALID_ARG_TYPE:Us,ERR_INVALID_RETURN_VALUE:Rs,ERR_MISSING_ARGS:Kg,ERR_STREAM_DESTROYED:Gg,ERR_STREAM_PREMATURE_CLOSE:Yg},AbortError:Xg}=ae(),{validateFunction:Jg,validateAbortSignal:Qg}=ki(),{isIterable:ei,isReadable:Ns,isReadableNodeStream:Tr,isNodeStream:_u,isTransformStream:Ci,isWebStream:Zg,isReadableStream:Ls,isReadableFinished:ew}=tt(),tw=globalThis.AbortController||Ei().AbortController,Cs,Bs,Ds;function xu(e,t,i){let n=!1;e.on("close",()=>{n=!0});let r=Rr(e,{readable:t,writable:i},o=>{n=!o});return{destroy:s(o=>{n||(n=!0,Vg.destroyer(e,o||new Gg("pipe")))},"destroy"),cleanup:r}}s(xu,"destroyer");function iw(e){return Jg(e[e.length-1],"streams[stream.length - 1]"),e.pop()}s(iw,"popCallback");function Ms(e){if(ei(e))return e;if(Tr(e))return nw(e);throw new Us("val",["Readable","Iterable","AsyncIterable"],e)}s(Ms,"makeAsyncIterable");async function*nw(e){Bs||(Bs=Sn()),yield*Bs.prototype[qg].call(e)}s(nw,"fromReadable");async function Pr(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 jg((f,d)=>{r?d(r):o=s(()=>{r?d(r):f()},"onresolve")}),"wait");t.on("drain",a);let l=Rr(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?Hg(r,f):f)}finally{l(),t.off("drain",a)}}s(Pr,"pumpToNode");async function Ws(e,t,i,{end:n}){Ci(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(Ws,"pumpToWeb");function rw(...e){return ku(e,zg(iw(e)))}s(rw,"pipeline");function ku(e,t,i){if(e.length===1&&Ug(e[0])&&(e=e[0]),e.length<2)throw new Kg("streams");let n=new tw,r=n.signal,o=i?.signal,a=[];Qg(o,"options.signal");function c(){w(new Xg)}s(c,"abort"),Ds=Ds||re().addAbortListener;let l;o&&(l=Ds(o,c));let f,d,h=[],b=0;function p(N){w(N,--b===0)}s(p,"finish");function w(N,F){var B;if(N&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=N),!(!f&&!F)){for(;h.length;)h.shift()(f);(B=l)===null||B===void 0||B[$g](),n.abort(),F&&(f||a.forEach(Bt=>Bt()),vn.nextTick(t,f,d))}}s(w,"finishImpl");let g;for(let N=0;N<e.length;N++){let F=e[N],B=N<e.length-1,Bt=N>0,Ee=B||i?.end!==!1,oi=N===e.length-1;if(_u(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:eo}=xu(F,B,Bt);h.push(at),Ns(F)&&oi&&a.push(eo)}F.on("error",le),Ns(F)&&oi&&a.push(()=>{F.removeListener("error",le)})}if(N===0)if(typeof F=="function"){if(g=F({signal:r}),!ei(g))throw new Rs("Iterable, AsyncIterable or Stream","source",g)}else ei(F)||Tr(F)||Ci(F)?g=F:g=Eu.from(F);else if(typeof F=="function"){if(Ci(g)){var A;g=Ms((A=g)===null||A===void 0?void 0:A.readable)}else g=Ms(g);if(g=F(g,{signal:r}),B){if(!ei(g,!0))throw new Rs("AsyncIterable",`transform[${N-1}]`,g)}else{var k;Cs||(Cs=Ts());let le=new Cs({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(),vn.nextTick(p)},Et=>{le.destroy(Et),vn.nextTick(p,Et)});else if(ei(g,!0))b++,Pr(g,le,p,{end:Ee});else if(Ls(g)||Ci(g)){let Et=g.readable||g;b++,Pr(Et,le,p,{end:Ee})}else throw new Rs("AsyncIterable or Promise","destination",g);g=le;let{destroy:eo,cleanup:eh}=xu(g,!1,!0);h.push(eo),oi&&a.push(eh)}}else if(_u(F)){if(Tr(g)){b+=2;let le=ow(g,F,p,{end:Ee});Ns(F)&&oi&&a.push(le)}else if(Ci(g)||Ls(g)){let le=g.readable||g;b++,Pr(le,F,p,{end:Ee})}else if(ei(g))b++,Pr(g,F,p,{end:Ee});else throw new Us("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else if(Zg(F)){if(Tr(g))b++,Ws(Ms(g),F,p,{end:Ee});else if(Ls(g)||ei(g))b++,Ws(g,F,p,{end:Ee});else if(Ci(g))b++,Ws(g.readable,F,p,{end:Ee});else throw new Us("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else g=Eu.from(F)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&vn.nextTick(c),g}s(ku,"pipelineImpl");function ow(e,t,i,{end:n}){let r=!1;if(t.on("close",()=>{r||i(new Yg)}),e.pipe(t,{end:!1}),n){let a=function(){r=!0,t.end()};var o=a;s(a,"endFn"),ew(e)?vn.nextTick(a):e.once("end",a)}else i();return Rr(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)}),Rr(t,{readable:!1,writable:!0},i)}s(ow,"pipe");vu.exports={pipelineImpl:ku,pipeline:rw}});var qs=T((xx,Tu)=>{"use strict";var{pipeline:sw}=Nr(),Lr=rt(),{destroyer:aw}=Xt(),{isNodeStream:Cr,isReadable:Fu,isWritable:Iu,isWebStream:js,isTransformStream:ti,isWritableStream:Au,isReadableStream:Ou}=tt(),{AbortError:cw,codes:{ERR_INVALID_ARG_VALUE:Pu,ERR_MISSING_ARGS:lw}}=ae(),fw=bt();Tu.exports=s(function(...t){if(t.length===0)throw new lw("streams");if(t.length===1)return Lr.from(t[0]);let i=[...t];if(typeof t[0]=="function"&&(t[0]=Lr.from(t[0])),typeof t[t.length-1]=="function"){let p=t.length-1;t[p]=Lr.from(t[p])}for(let p=0;p<t.length;++p)if(!(!Cr(t[p])&&!js(t[p]))){if(p<t.length-1&&!(Fu(t[p])||Ou(t[p])||ti(t[p])))throw new Pu(`streams[${p}]`,i[p],"must be readable");if(p>0&&!(Iu(t[p])||Au(t[p])||ti(t[p])))throw new Pu(`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=sw(t,l),h=!!(Iu(f)||Au(f)||ti(f)),b=!!(Fu(d)||Ou(d)||ti(d));if(c=new Lr({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Cr(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(js(f)){let g=(ti(f)?f.writable:f).getWriter();c._write=async function(A,k,v){try{await g.ready,g.write(A).catch(()=>{}),v()}catch(N){v(N)}},c._final=async function(A){try{await g.ready,g.close().catch(()=>{}),r=A}catch(k){A(k)}}}let p=ti(d)?d.readable:d;fw(p,()=>{if(r){let w=r;r=null,w()}})}if(b){if(Cr(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(js(d)){let w=(ti(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 cw),o=null,n=null,r=null,a===null?w(p):(a=w,Cr(d)&&aw(d,p))},c},"compose")});var ju=T((vx,Vs)=>{"use strict";var uw=globalThis.AbortController||Ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:dw,ERR_INVALID_ARG_TYPE:Fn,ERR_MISSING_ARGS:hw,ERR_OUT_OF_RANGE:pw},AbortError:ot}=ae(),{validateAbortSignal:ii,validateInteger:Ru,validateObject:ni}=ki(),yw=q().Symbol("kWeak"),mw=q().Symbol("kResistStopPropagation"),{finished:bw}=bt(),gw=qs(),{addAbortSignalNoValidate:ww}=mn(),{isWritable:Sw,isNodeStream:Ew}=tt(),{deprecate:_w}=re(),{ArrayPrototypePush:xw,Boolean:kw,MathFloor:Nu,Number:vw,NumberIsNaN:Fw,Promise:Lu,PromiseReject:Cu,PromiseResolve:Iw,PromisePrototypeThen:Bu,Symbol:Mu}=q(),Br=Mu("kEmpty"),Du=Mu("kEof");function Aw(e,t){if(t!=null&&ni(t,"options"),t?.signal!=null&&ii(t.signal,"options.signal"),Ew(e)&&!Sw(e))throw new dw("stream",e,"must be writable");let i=gw(this,e);return t!=null&&t.signal&&ww(t.signal,i),i}s(Aw,"compose");function Dr(e,t){if(typeof e!="function")throw new Fn("fn",["Function","AsyncFunction"],e);t!=null&&ni(t,"options"),t?.signal!=null&&ii(t.signal,"options.signal");let i=1;t?.concurrency!=null&&(i=Nu(t.concurrency));let n=i-1;return t?.highWaterMark!=null&&(n=Nu(t.highWaterMark)),Ru(i,"options.concurrency",1),Ru(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=re().AbortSignalAny([t?.signal].filter(kw)),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===Br)continue;k=Iw(k)}catch(v){k=Cu(v)}b+=1,Bu(k,w,p),c.push(k),f&&(f(),f=null),!h&&(c.length>=n||b>=i)&&await new Lu(v=>{d=v})}c.push(Du)}catch(k){let v=Cu(k);Bu(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===Du)return;if(o.aborted)throw new ot;k!==Br&&(yield k),c.shift(),g()}await new Lu(k=>{f=k})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(Dr,"map");function Ow(e=void 0){return e!=null&&ni(e,"options"),e?.signal!=null&&ii(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(Ow,"asIndexedPairs");async function Wu(e,t=void 0){for await(let i of zs.call(this,e,t))return!0;return!1}s(Wu,"some");async function Pw(e,t=void 0){if(typeof e!="function")throw new Fn("fn",["Function","AsyncFunction"],e);return!await Wu.call(this,async(...i)=>!await e(...i),t)}s(Pw,"every");async function Tw(e,t){for await(let i of zs.call(this,e,t))return i}s(Tw,"find");async function Rw(e,t){if(typeof e!="function")throw new Fn("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r),Br}s(i,"forEachFn");for await(let n of Dr.call(this,i,t));}s(Rw,"forEach");function zs(e,t){if(typeof e!="function")throw new Fn("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r)?n:Br}return s(i,"filterFn"),Dr.call(this,i,t)}s(zs,"filter");var $s=class extends hw{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Nw(e,t,i){var n;if(typeof e!="function")throw new Fn("reducer",["Function","AsyncFunction"],e);i!=null&&ni(i,"options"),i?.signal!=null&&ii(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 bw(this.destroy(f)),f}let o=new uw,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[yw]:this,[mw]:!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 $s}finally{o.abort()}return t}s(Nw,"reduce");async function Lw(e){e!=null&&ni(e,"options"),e?.signal!=null&&ii(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});xw(t,n)}return t}s(Lw,"toArray");function Cw(e,t){let i=Dr.call(this,e,t);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(Cw,"flatMap");function Uu(e){if(e=vw(e),Fw(e))return 0;if(e<0)throw new pw("number",">= 0",e);return e}s(Uu,"toIntegerOrInfinity");function Bw(e,t=void 0){return t!=null&&ni(t,"options"),t?.signal!=null&&ii(t.signal,"options.signal"),e=Uu(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(Bw,"drop");function Dw(e,t=void 0){return t!=null&&ni(t,"options"),t?.signal!=null&&ii(t.signal,"options.signal"),e=Uu(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(Dw,"take");Vs.exports.streamReturningOperators={asIndexedPairs:_w(Ow,"readable.asIndexedPairs will be removed in a future version."),drop:Bw,filter:zs,flatMap:Cw,map:Dr,take:Dw,compose:Aw};Vs.exports.promiseReturningOperators={every:Pw,forEach:Rw,reduce:Nw,toArray:Lw,some:Wu,find:Tw}});var Hs=T((Ix,qu)=>{"use strict";var{ArrayPrototypePop:Mw,Promise:Ww}=q(),{isIterable:Uw,isNodeStream:jw,isWebStream:qw}=tt(),{pipelineImpl:$w}=Nr(),{finished:zw}=bt();Ks();function Vw(...e){return new Ww((t,i)=>{let n,r,o=e[e.length-1];if(o&&typeof o=="object"&&!jw(o)&&!Uw(o)&&!qw(o)){let a=Mw(e);n=a.signal,r=a.end}$w(e,(a,c)=>{a?i(a):t(c)},{signal:n,end:r})})}s(Vw,"pipeline");qu.exports={finished:zw,pipeline:Vw}});var Ks=T((Ox,Ju)=>{var{Buffer:Hw}=Ie(),{ObjectDefineProperty:St,ObjectKeys:Vu,ReflectApply:Hu}=q(),{promisify:{custom:Ku}}=re(),{streamReturningOperators:$u,promiseReturningOperators:zu}=ju(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Gu}}=ae(),Kw=qs(),{setDefaultHighWaterMark:Gw,getDefaultHighWaterMark:Yw}=bn(),{pipeline:Yu}=Nr(),{destroyer:Xw}=Xt(),Xu=bt(),Gs=Hs(),In=tt(),C=Ju.exports=mr().Stream;C.isDestroyed=In.isDestroyed;C.isDisturbed=In.isDisturbed;C.isErrored=In.isErrored;C.isReadable=In.isReadable;C.isWritable=In.isWritable;C.Readable=Sn();for(let e of Vu($u)){let i=function(...n){if(new.target)throw Gu();return C.Readable.from(Hu(t,this,n))};Ys=i,s(i,"fn");let t=$u[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 Ys;for(let e of Vu(zu)){let i=function(...r){if(new.target)throw Gu();return Hu(t,this,r)};Ys=i,s(i,"fn");let t=zu[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 Ys;C.Writable=Or();C.Duplex=rt();C.Transform=Os();C.PassThrough=Ts();C.pipeline=Yu;var{addAbortSignal:Jw}=mn();C.addAbortSignal=Jw;C.finished=Xu;C.destroy=Xw;C.compose=Kw;C.setDefaultHighWaterMark=Gw;C.getDefaultHighWaterMark=Yw;St(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return Gs},"get")});St(Yu,Ku,{__proto__:null,enumerable:!0,get:s(function(){return Gs.pipeline},"get")});St(Xu,Ku,{__proto__:null,enumerable:!0,get:s(function(){return Gs.finished},"get")});C.Stream=C;C._isUint8Array=s(function(t){return t instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(t){return Hw.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var Qu=T((Tx,H)=>{"use strict";var Q=Ks(),Qw=Hs(),Zw=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=Zw;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return Qw},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var pS={};Dn(pS,{Async:()=>ua,AsyncTransaction:()=>Io,BigIntStats:()=>be,BigIntStatsFs:()=>tn,Dir:()=>Ot,Dirent:()=>At,Errno:()=>U,ErrnoError:()=>u,Fetch:()=>lS,FetchFS:()=>Xr,File:()=>jt,FileSystem:()=>pe,InMemory:()=>ln,InMemoryStore:()=>Gn,Index:()=>Yr,IndexFS:()=>Cn,Inode:()=>Ge,MutexLock:()=>Jr,Mutexed:()=>ba,NoSyncFile:()=>mi,Overlay:()=>uS,OverlayFS:()=>Bn,Port:()=>sS,PortFS:()=>Gr,PortFile:()=>Nn,PreloadFile:()=>we,ReadStream:()=>Lt,Readonly:()=>ya,SimpleAsyncStore:()=>Ao,SimpleTransaction:()=>bi,Stats:()=>G,StatsCommon:()=>Zi,StatsFs:()=>en,StoreFS:()=>sn,Sync:()=>dS,SyncTransaction:()=>cn,Transaction:()=>an,UnmutexedOverlayFS:()=>Zr,WriteStream:()=>Ct,ZenFsType:()=>Fo,_InMemory:()=>gc,_Port:()=>Qd,__MutexedFS:()=>Qr,_toUnixTimestamp:()=>dh,access:()=>Rd,accessSync:()=>Dc,appendFile:()=>cd,appendFileSync:()=>xc,attachFS:()=>Jd,checkOptions:()=>ro,chmod:()=>Id,chmodSync:()=>Lc,chown:()=>vd,chownSync:()=>Rc,close:()=>fd,closeSync:()=>It,configure:()=>iS,configureSingle:()=>tS,constants:()=>kt,copyFile:()=>Ud,copyFileSync:()=>Lo,cp:()=>zd,cpSync:()=>Co,createReadStream:()=>Bd,createWriteStream:()=>Dd,credentials:()=>ye,decode:()=>ai,decodeDirListing:()=>Un,default:()=>hS,detachFS:()=>oS,encode:()=>Le,encodeDirListing:()=>xe,errorMessages:()=>io,exists:()=>ed,existsSync:()=>Je,fchmod:()=>bd,fchmodSync:()=>tr,fchown:()=>md,fchownSync:()=>er,fdatasync:()=>hd,fdatasyncSync:()=>Ic,flagToMode:()=>nn,flagToNumber:()=>vp,flagToString:()=>mc,fs:()=>Rn,fstat:()=>ld,fstatSync:()=>kc,fsync:()=>dd,fsyncSync:()=>Fc,ftruncate:()=>ud,ftruncateSync:()=>vc,futimes:()=>gd,futimesSync:()=>ir,handleRequest:()=>Ln,isAppendable:()=>pt,isBackend:()=>$i,isBackendConfig:()=>zi,isExclusive:()=>on,isReadable:()=>vt,isStatsEqual:()=>vo,isSynchronous:()=>Fp,isTruncating:()=>rn,isWriteable:()=>ge,lchmod:()=>Ad,lchmodSync:()=>Cc,lchown:()=>Fd,lchownSync:()=>Nc,levenshtein:()=>no,link:()=>_d,linkSync:()=>Pc,lopenSync:()=>hn,lstat:()=>id,lstatSync:()=>Oo,lutimes:()=>Pd,lutimesSync:()=>Bc,mkdir:()=>Sd,mkdirSync:()=>nr,mkdirpSync:()=>Ia,mkdtemp:()=>Wd,mkdtempSync:()=>Mc,mount:()=>$t,mountObject:()=>un,mounts:()=>Pe,normalizeMode:()=>ke,normalizeOptions:()=>ve,normalizePath:()=>x,normalizeTime:()=>Mt,open:()=>od,openAsBlob:()=>Hd,openSync:()=>dn,opendir:()=>$d,opendirSync:()=>jc,parseFlag:()=>M,promises:()=>Tn,randomIno:()=>Qi,read:()=>yd,readFile:()=>sd,readFileSync:()=>Zn,readSync:()=>Oc,readdir:()=>Ed,readdirSync:()=>Si,readlink:()=>kd,readlinkSync:()=>To,readv:()=>jd,readvSync:()=>Wc,realpath:()=>Td,realpathSync:()=>Xe,rename:()=>Zu,renameSync:()=>Sc,resolveMountConfig:()=>Wi,resolveRemoteMount:()=>aS,rm:()=>Md,rmSync:()=>No,rmdir:()=>wd,rmdirSync:()=>Po,rootCredentials:()=>hh,rootIno:()=>Ye,setImmediate:()=>uh,size_max:()=>Oe,stat:()=>td,statSync:()=>Te,statfs:()=>Vd,statfsSync:()=>qc,symlink:()=>xd,symlinkSync:()=>Tc,truncate:()=>nd,truncateSync:()=>Ec,umount:()=>gi,unlink:()=>rd,unlinkSync:()=>Qn,unwatchFile:()=>Ld,utimes:()=>Od,utimesSync:()=>Ro,version:()=>ma,watch:()=>Cd,watchFile:()=>Nd,write:()=>pd,writeFile:()=>ad,writeFileSync:()=>pn,writeSync:()=>Ac,writev:()=>qd,writevSync:()=>Uc});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||{}),io={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"},u=class e extends Error{constructor(i,n=io[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{s(this,"ErrnoError")}static fromJSON(i){let n=new e(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 e(U[i],io[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}};var lh="/";function Fa(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(Fa,"normalizeString");function _t(...e){let t="";for(let n of[...e.reverse(),lh])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;let i=t.startsWith("/");return t=Fa(t,!i),i?`/${t}`:t.length?t:"/"}s(_t,"resolve");function fh(e){if(!e.length)return".";let t=e.startsWith("/"),i=e.endsWith("/");return e=Fa(e,!t),e.length?(i&&(e+="/"),t?`/${e}`:e):t?"/":i?"./":"."}s(fh,"normalize");function z(...e){if(!e.length)return".";let t=e.join("/");return t?.length?fh(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 Mn(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(Mn,"parse");function Ia(e,t,i){i.existsSync(e)||(Ia(_(e),t,i),i.mkdirSync(e,t))}s(Ia,"mkdirpSync");function Wn(e,t,i,n,r){return Math.min(e+1,t+1,i+1,n===r?t:t+1)}s(Wn,"_min");function no(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],N=o[k];c=Wn(N,c,l,b,v),l=Wn(c,l,f,p,v),f=Wn(l,f,d,w,v),A=Wn(f,d,A,g,v),o[k++]=A,d=f,f=l,l=c,c=N}}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(no,"levenshtein");var uh=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:e=>setTimeout(e,0);function Le(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(Le,"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 Un(e){return JSON.parse(ai(e),(t,i)=>t==""?i:BigInt(i))}s(Un,"decodeDirListing");function xe(e){return Le(JSON.stringify(e,(t,i)=>t==""?i:i.toString()))}s(xe,"encodeDirListing");function dh(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(dh,"_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 Mt(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(Mt,"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 $i(e){return e!=null&&typeof e=="object"&&"isAvailable"in e&&typeof e.isAvailable=="function"&&"create"in e&&typeof e.create=="function"}s($i,"isBackend");async function ro(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:no(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(ro,"checkOptions");function zi(e){return e!=null&&typeof e=="object"&&"backend"in e&&$i(e.backend)}s(zi,"isBackendConfig");var ye={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0},hh={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Rn={};Dn(Rn,{BigIntStatsFs:()=>tn,Dir:()=>Ot,Dirent:()=>At,ReadStream:()=>Lt,Stats:()=>G,StatsFs:()=>en,WriteStream:()=>Ct,access:()=>Rd,accessSync:()=>Dc,appendFile:()=>cd,appendFileSync:()=>xc,chmod:()=>Id,chmodSync:()=>Lc,chown:()=>vd,chownSync:()=>Rc,close:()=>fd,closeSync:()=>It,constants:()=>kt,copyFile:()=>Ud,copyFileSync:()=>Lo,cp:()=>zd,cpSync:()=>Co,createReadStream:()=>Bd,createWriteStream:()=>Dd,exists:()=>ed,existsSync:()=>Je,fchmod:()=>bd,fchmodSync:()=>tr,fchown:()=>md,fchownSync:()=>er,fdatasync:()=>hd,fdatasyncSync:()=>Ic,fstat:()=>ld,fstatSync:()=>kc,fsync:()=>dd,fsyncSync:()=>Fc,ftruncate:()=>ud,ftruncateSync:()=>vc,futimes:()=>gd,futimesSync:()=>ir,lchmod:()=>Ad,lchmodSync:()=>Cc,lchown:()=>Fd,lchownSync:()=>Nc,link:()=>_d,linkSync:()=>Pc,lopenSync:()=>hn,lstat:()=>id,lstatSync:()=>Oo,lutimes:()=>Pd,lutimesSync:()=>Bc,mkdir:()=>Sd,mkdirSync:()=>nr,mkdtemp:()=>Wd,mkdtempSync:()=>Mc,mount:()=>$t,mountObject:()=>un,mounts:()=>Pe,open:()=>od,openAsBlob:()=>Hd,openSync:()=>dn,opendir:()=>$d,opendirSync:()=>jc,promises:()=>Tn,read:()=>yd,readFile:()=>sd,readFileSync:()=>Zn,readSync:()=>Oc,readdir:()=>Ed,readdirSync:()=>Si,readlink:()=>kd,readlinkSync:()=>To,readv:()=>jd,readvSync:()=>Wc,realpath:()=>Td,realpathSync:()=>Xe,rename:()=>Zu,renameSync:()=>Sc,rm:()=>Md,rmSync:()=>No,rmdir:()=>wd,rmdirSync:()=>Po,stat:()=>td,statSync:()=>Te,statfs:()=>Vd,statfsSync:()=>qc,symlink:()=>xd,symlinkSync:()=>Tc,truncate:()=>nd,truncateSync:()=>Ec,umount:()=>gi,unlink:()=>rd,unlinkSync:()=>Qn,unwatchFile:()=>Ld,utimes:()=>Od,utimesSync:()=>Ro,watch:()=>Cd,watchFile:()=>Nd,write:()=>pd,writeFile:()=>ad,writeFileSync:()=>pn,writeSync:()=>Ac,writev:()=>qd,writevSync:()=>Uc});var fa=qi(Ie(),1);var kt={};Dn(kt,{COPYFILE_EXCL:()=>Ki,COPYFILE_FICLONE:()=>Kh,COPYFILE_FICLONE_FORCE:()=>Gh,F_OK:()=>Hi,O_APPEND:()=>Ke,O_CREAT:()=>ee,O_DIRECT:()=>tp,O_DIRECTORY:()=>Xh,O_DSYNC:()=>Zh,O_EXCL:()=>Ve,O_NOATIME:()=>Jh,O_NOCTTY:()=>Yh,O_NOFOLLOW:()=>Qh,O_NONBLOCK:()=>ip,O_RDONLY:()=>di,O_RDWR:()=>ue,O_SYMLINK:()=>ep,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:()=>lp,S_IROTH:()=>dp,S_IRUSR:()=>sp,S_IRWXG:()=>bo,S_IRWXO:()=>go,S_IRWXU:()=>mo,S_ISGID:()=>rp,S_ISUID:()=>np,S_ISVTX:()=>op,S_IWGRP:()=>fp,S_IWOTH:()=>hp,S_IWUSR:()=>ap,S_IXGRP:()=>up,S_IXOTH:()=>pp,S_IXUSR:()=>cp,UV_FS_O_FILEMAP:()=>yp,W_OK:()=>X,X_OK:()=>Hh});var Hi=0,Ae=4,X=2,Hh=1,Ki=1,Kh=2,Gh=4,di=0,ze=1,ue=2,ee=64,Ve=128,Yh=256,He=512,Ke=1024,Xh=65536,Jh=262144,Qh=131072,hi=1052672,Zh=4096,ep=32768,tp=16384,ip=2048,K=61440,lt=49152,Ce=40960,de=32768,ft=24576,he=16384,ut=8192,dt=4096,np=2048,rp=1024,op=512,mo=448,sp=256,ap=128,cp=64,bo=56,lp=32,fp=16,up=8,go=7,dp=4,hp=2,pp=1,yp=0;var Vn=qi(Ya(),1);function Xa(e){try{return JSON.parse(e),!0}catch{return!1}}s(Xa,"isJSON");function Yi(e){return e.at(0).toUpperCase()+e.slice(1)}s(Yi,"capitalize");var Ja=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],Qa=[...Ja,...Ja.map(e=>Yi(e)),"char"],Hn=/^(u?int|float)(8|16|32|64)$/i;function So(e){return e=="char"?"uint8":e.toLowerCase()}s(So,"normalize");function Eo(e){return Hn.test(e.toString())}s(Eo,"isType");function Kn(e){return e=="char"||Hn.test(e.toString().toLowerCase())}s(Kn,"isValid");function Za(e){if(!Kn(e))throw new TypeError("Not a valid primitive type: "+e)}s(Za,"checkValid");var Xi=Symbol("struct_init"),yi=Symbol("struct");function wp(e){return e!=null&&typeof e=="object"&&yi in e}s(wp,"isValidMetadata");function pi(e){let t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(i=>i.description=="Symbol.metadata");if(!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}s(pi,"symbol_metadata");function Ji(e){return typeof e=="function"&&pi(e)in e&&wp(e[pi(e)])}s(Ji,"isStatic");function ec(e){return e!=null&&typeof e=="object"&&Ji(e.constructor)}s(ec,"isInstance");function _o(e){if(!ec(e))throw new TypeError((typeof e=="function"?e.name:e&&e.constructor.name)+" is not a struct instance")}s(_o,"checkInstance");function Sp(e){return ec(e)||Ji(e)}s(Sp,"isStruct");function tc(e){if(!Sp(e))throw new TypeError((typeof e=="function"?e.name:e&&e.constructor.name)+" is not a struct")}s(tc,"checkStruct");function ht(e){if(typeof e=="string")return Za(e),+So(e).match(Hn)[2]/8;tc(e);let t=Ji(e)?e:e.constructor;return t[pi(t)][yi].size}s(ht,"sizeof");function _p(e,t){return Math.ceil(e/t)*t}s(_p,"align");function nc(e={}){return s(function(i,n){n.metadata??={},n.metadata[Xi]||=[];let r=0,o=new Map;for(let a of n.metadata[Xi]){let{name:c,type:l,length:f}=a;if(!Kn(l)&&!Ji(l))throw new TypeError("Not a valid type: "+l);o.set(c,{offset:r,type:Kn(l)?So(l):l,length:f}),r+=ht(l)*(f||1),r=_p(r,e.align||1)}return n.metadata[yi]={options:e,members:o,size:r},i},"_decorateStruct")}s(nc,"struct");function ic(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[Xi]||=[],n.metadata[Xi].push({name:r,type:e,length:t}),i}}s(ic,"member");function xo(e){_o(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)),!Eo(a)){n.set(h?xo(h):new Uint8Array(ht(a)),d);continue}let p="set"+Yi(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(xo,"serialize");function ko(e,t){_o(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(!Eo(c)){if(h[b]===null||h[b]===void 0)continue;ko(h[b],new Uint8Array(r.slice(p,p+ht(c))));continue}f>0&&(h||=[]);let g="get"+Yi(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(ko,"deserialize");function xp(e){function t(i,n){return typeof i=="number"?ic(e,i):ic(e)(i,n)}return s(t,"_structMemberDecorator"),t}s(xp,"_member");var Be=Object.fromEntries(Qa.map(e=>[e,xp(e)]));var Oe=2**32-1,Ye=0n;function rc(){return Math.round(Math.random()*2**32).toString(16)}s(rc,"_random");function Qi(){return BigInt("0x"+rc()+rc())}s(Qi,"randomIno");var oc,sc,ac,cc,lc,fc,uc,dc,hc,pc,yc,me;me=[,,,],yc=[nc()],pc=[Be.uint64],hc=[Be.uint32],dc=[Be.uint16],uc=[Be.uint32],fc=[Be.uint32],lc=[Be.uint32],cc=[Be.float64],ac=[Be.float64],sc=[Be.float64],oc=[Be.float64];var te=class te{get data(){return xo(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`);ko(this,t);return}this.ino=Qi(),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",pc,te),_e(me,5,"size",hc,te),_e(me,5,"mode",dc,te),_e(me,5,"nlink",uc,te),_e(me,5,"uid",fc,te),_e(me,5,"gid",lc,te),_e(me,5,"atimeMs",cc,te),_e(me,5,"birthtimeMs",ac,te),_e(me,5,"mtimeMs",sc,te),_e(me,5,"ctimeMs",oc,te),te=_e(me,0,"Inode",yc,te),s(te,"Inode"),va(me,1,te);var Ge=te;var Zi=class{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))}static{s(this,"StatsCommon")}_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}},G=class extends Zi{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}},be=class extends Zi{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}};function vo(e,t){return e.size==t.size&&+e.atime==+t.atime&&+e.mtime==+t.mtime&&+e.ctime==+t.ctime&&e.mode==t.mode}s(vo,"isStatsEqual");var Fo=525687744115,en=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Oe;this.ffree=Oe}static{s(this,"StatsFs")}},tn=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Oe);this.ffree=BigInt(Oe)}static{s(this,"BigIntStatsFs")}};var Tn={};Dn(Tn,{FileHandle:()=>ce,access:()=>sa,appendFile:()=>Qs,chmod:()=>na,chown:()=>ta,constants:()=>kt,copyFile:()=>zr,cp:()=>Vr,exists:()=>je,lchmod:()=>ra,lchown:()=>ia,link:()=>Zs,lstat:()=>Wr,lutimes:()=>oa,mkdir:()=>Pn,mkdtemp:()=>aa,open:()=>Se,opendir:()=>ca,readFile:()=>On,readdir:()=>Vt,readlink:()=>jr,realpath:()=>Ue,rename:()=>Xs,rm:()=>$r,rmdir:()=>Ur,stat:()=>st,statfs:()=>la,symlink:()=>ea,truncate:()=>Js,unlink:()=>An,utimes:()=>qr,watch:()=>eS,writeFile:()=>Di});var ri=qi(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 kp=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function M(e){if(typeof e=="number")return mc(e);if(!kp.includes(e))throw new Error("Invalid flag string: "+e);return e}s(M,"parseFlag");function mc(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(mc,"flagToString");function vp(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(vp,"flagToNumber");function nn(e){let t=0;return t<<=1,t+=+vt(e),t<<=1,t+=+ge(e),t<<=1,t}s(nn,"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 rn(e){return e.indexOf("w")!==-1}s(rn,"isTruncating");function pt(e){return e.indexOf("a")!==-1}s(pt,"isAppendable");function Fp(e){return e.indexOf("s")!==-1}s(Fp,"isSynchronous");function on(e){return e.indexOf("x")!==-1}s(on,"isExclusive");var jt=class{constructor(t,i){this.fs=t;this.path=i}static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},we=class extends jt{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}}static{s(this,"PreloadFile")}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()}},mi=class extends we{static{s(this,"NoSyncFile")}constructor(t,i,n,r,o){super(t,i,n,r,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};var Ft=qi(Ie(),1);var pe=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Fo}}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"}}};var bc=5,sn=class extends pe{constructor(i){super();this.store=i;this._initialized=!1}static{s(this,"StoreFS")}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 N=await this.getINode(r,p[l],n);if(!N.toStats().isFile())throw u.With("EPERM",n,"rename");await r.remove(N.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,Le("{}"))}mkdirSync(i,n){this.commitNewSync(i,16384,n,Le("{}"))}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,Le("{}"));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,Le("{}"));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 Un(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 Un(o)}async addNew(i,n,r){for(let o=0;o<bc;o++){let a=Qi();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<bc;o++){let a=Qi();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)}}};var an=class{constructor(t){this.store=t;this.done=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}},cn=class extends an{static{s(this,"SyncTransaction")}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()}},Io=class extends an{static{s(this,"AsyncTransaction")}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")}};var Ao=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}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)}},bi=class extends cn{constructor(){super(...arguments);this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}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))}};var Gn=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new bi(this)}},gc={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 sn(new Gn(e));return t.checkRootSync(),t},"create")},ln=gc;var qt=new Map,Ip=100;function fn(e){let t=Ip++;return qt.set(t,e),t}s(fn,"file2fd");function j(e){if(!qt.has(e))throw new u(9);return qt.get(e)}s(j,"fd2file");var Pe=new Map;$t("/",ln.create({name:"root"}));function $t(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($t,"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 wc(e,t){for(let[i,n]of Object.entries(t))e=e?.replaceAll(i,n);return e}s(wc,"fixPaths");function Y(e,t){return typeof e.stack=="string"&&(e.stack=wc(e.stack,t)),e.message=wc(e.message,t),e}s(Y,"fixError");function un(e){"/"in e&&gi("/");for(let[t,i]of Object.entries(e))$t(t,i)}s(un,"mountObject");function Yn(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(Yn,"_statfs");var Xn=class extends Vn.default{constructor(i){super();this.path=i}static{s(this,"Watcher")}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}},wi=class extends Xn{constructor(i,n){super(i);this.options=n;Ap(i.toString(),this)}static{s(this,"FSWatcher")}close(){super.emit("close"),Op(this.path.toString(),this)}[Symbol.dispose](){this.close()}},Jn=class extends Xn{constructor(i,n){super(i);this.options=n;this.start()}static{s(this,"StatWatcher")}onInterval(){try{let i=Te(this.path);vo(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()}},De=new Map;function Ap(e,t){let i=x(e);De.has(i)||De.set(i,new Set),De.get(i).add(t)}s(Ap,"addWatcher");function Op(e,t){let i=x(e);De.has(i)&&(De.get(i).delete(t),De.get(i).size===0&&De.delete(i))}s(Op,"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 Sc(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}pn(t,Zn(e)),Qn(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(Sc,"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 Oo(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(Oo,"lstatSync");function Ec(e,t=0){var n=[];try{let i=S(n,zt(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(Ec,"truncateSync");function Qn(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(Qn,"unlinkSync");function zt(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(nn(o)))throw u.With("EACCES",e,"_open");if(on(o))throw u.With("EEXIST",e,"_open");let f=a.openFileSync(c,o);return rn(o)&&(f.truncateSync(0),f.syncSync()),f}s(zt,"_openSync");function dn(e,t,i=0){return fn(zt(e,t,i,!0))}s(dn,"openSync");function hn(e,t,i){return fn(zt(e,t,i,!1))}s(hn,"lopenSync");function _c(e,t,i){var a=[];try{let n=S(a,zt(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(_c,"_readFileSync");function Zn(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(_c(typeof e=="number"?j(e).path:e.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(Zn,"readFileSync");function pn(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,zt(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(pn,"writeFileSync");function xc(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,zt(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(xc,"appendFileSync");function kc(e,t){let i=j(e).statSync();return t?.bigint?new be(i):i}s(kc,"fstatSync");function It(e){j(e).closeSync(),qt.delete(e)}s(It,"closeSync");function vc(e,t=0){if(t||=0,t<0)throw new u(22);j(e).truncateSync(t)}s(vc,"ftruncateSync");function Fc(e){j(e).syncSync()}s(Fc,"fsyncSync");function Ic(e){j(e).datasyncSync()}s(Ic,"fdatasyncSync");function Ac(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(Ac,"writeSync");function Oc(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(Oc,"readSync");function er(e,t,i){j(e).chownSync(t,i)}s(er,"fchownSync");function tr(e,t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");j(e).chmodSync(i)}s(tr,"fchmodSync");function ir(e,t,i){j(e).utimesSync(Mt(t),Mt(i))}s(ir,"futimesSync");function Po(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(Po,"rmdirSync");function nr(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(nr,"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 Pc(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(Pc,"linkSync");function Tc(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");pn(t,e.toString()),zt(t,"r+",420,!1)._setTypeSync(40960)}s(Tc,"symlinkSync");function To(e,t){let i=Ft.Buffer.from(_c(e.toString(),"r",!1)),n=typeof t=="object"?t?.encoding:t;return n=="buffer"?i:i.toString(n)}s(To,"readlinkSync");function Rc(e,t,i){let n=dn(e,"r+");er(n,t,i),It(n)}s(Rc,"chownSync");function Nc(e,t,i){let n=hn(e,"r+");er(n,t,i),It(n)}s(Nc,"lchownSync");function Lc(e,t){let i=dn(e,"r+");tr(i,t),It(i)}s(Lc,"chmodSync");function Cc(e,t){let i=hn(e,"r+");tr(i,t),It(i)}s(Cc,"lchmodSync");function Ro(e,t,i){let n=dn(e,"r+");ir(n,t,i),It(n)}s(Ro,"utimesSync");function Bc(e,t,i){let n=hn(e,"r+");ir(n,t,i),It(n)}s(Bc,"lutimesSync");function Xe(e,t){e=x(e);let{base:i,dir:n}=Mn(e),r=z(n=="/"?"/":Xe(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return o.statSync(a).isSymbolicLink()?Xe(c+To(r,t).toString()):r}catch(l){throw Y(l,{[a]:r})}}s(Xe,"realpathSync");function Dc(e,t=384){if(!Te(e).hasAccess(t))throw new u(13)}s(Dc,"accessSync");function No(e,t){switch(e=x(e),Te(e).mode&61440){case 16384:if(t?.recursive)for(let n of Si(e))No(z(e,n),t);Po(e);return;case 32768:case 40960:Qn(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(No,"rmSync");function Mc(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return nr(r),i=="buffer"?Ft.Buffer.from(r):r}s(Mc,"mkdtempSync");function Lo(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");pn(t,Zn(e)),W("rename",t.toString())}s(Lo,"copyFileSync");function Wc(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(Wc,"readvSync");function Uc(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(Uc,"writevSync");function jc(e,t){return e=x(e),new Ot(e)}s(jc,"opendirSync");function Co(e,t,i){e=x(e),t=x(t);let n=Oo(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");nr(t,{recursive:!0});for(let r of Si(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||Co(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:Lo(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&Ro(t,n.atime,n.mtime)}s(Co,"cpSync");function qc(e,t){e=x(e);let{fs:i}=R(e);return Yn(i,t?.bigint)}s(qc,"statfsSync");var At=class{constructor(t,i){this.path=t;this.stats=i}static{s(this,"Dirent")}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()}},Ot=class{constructor(t){this.path=t;this.closed=!1}static{s(this,"Dir")}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 Vt(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}};var Mr=qi(Qu(),1);var Lt=class extends Mr.Readable{static{s(this,"ReadStream")}close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}},Ct=class extends Mr.Writable{static{s(this,"WriteStream")}close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};var ce=class{static{s(this,"FileHandle")}constructor(t){let i=typeof t!="number";this.fd=i?fn(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(Mt(t),Mt(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"?ri.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=ri.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=ri.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"?ri.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(),qt.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 Lt({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}};async function Xs(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 Di(t,await On(e)),await An(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(Xs,"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 Wr(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(Wr,"lstat");async function Js(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(Js,"truncate");async function An(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(An,"unlink");async function Bi(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(nn(o)))throw u.With("EACCES",e,"_open");if(on(o))throw u.With("EEXIST",e,"_open");let f=new ce(await a.openFile(c,o));return rn(o)&&(await f.truncate(0),await f.sync()),f}s(Bi,"_open");async function Se(e,t="r",i=420){return await Bi(e,t,i,!0)}s(Se,"open");async function On(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(On,"readFile");async function Di(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(Di,"writeFile");async function Qs(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"?ri.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(Qs,"appendFile");async function Ur(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(Ur,"rmdir");async function Pn(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(Pn,"mkdir");async function Vt(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(Vt,"readdir");async function Zs(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(Zs,"link");async function ea(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 Di(t,e.toString()),await(await Bi(t,"r+",420,!1)).file._setType(40960)}s(ea,"symlink");async function jr(e,t){var o=[];try{let i=S(o,await Bi(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(jr,"readlink");async function ta(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(ta,"chown");async function ia(e,t,i){var r=[];try{let n=S(r,await Bi(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(ia,"lchown");async function na(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(na,"chmod");async function ra(e,t){var n=[];try{let i=S(n,await Bi(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(ra,"lchmod");async function qr(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(qr,"utimes");async function oa(e,t,i){var r=[];try{let n=S(r,await Bi(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(oa,"lutimes");async function Ue(e,t){e=x(e);let{base:i,dir:n}=Mn(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 jr(r)):r}catch(l){throw Y(l,{[a]:r})}}s(Ue,"realpath");function eS(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(eS,"watch");async function sa(e,t=0){if(!(await st(e)).hasAccess(t))throw new u(13)}s(sa,"access");async function $r(e,t){switch(e=x(e),(await st(e)).mode&61440){case 16384:if(t?.recursive)for(let n of await Vt(e))await $r(z(e,n),t);await Ur(e);return;case 32768:case 40960:await An(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s($r,"rm");async function aa(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await Pn(r),i=="buffer"?ri.Buffer.from(r):r}s(aa,"mkdtemp");async function zr(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 Di(t,await On(e)),W("rename",t.toString())}s(zr,"copyFile");async function ca(e,t){return e=x(e),new Ot(e)}s(ca,"opendir");async function Vr(e,t,i){e=x(e),t=x(t);let n=await Wr(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 Pn(t,{recursive:!0});for(let r of await Vt(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||await Vr(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:await zr(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 qr(t,n.atime,n.mtime)}s(Vr,"cp");async function la(e,t){e=x(e);let{fs:i}=R(e);return Yn(i,t?.bigint)}s(la,"statfs");var I=s(()=>{},"nop");function Zu(e,t,i=I){Xs(e,t).then(()=>i()).catch(i)}s(Zu,"rename");function ed(e,t=I){je(e).then(t).catch(()=>t(!1))}s(ed,"exists");function td(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(td,"stat");function id(e,t,i=I){i=typeof t=="function"?t:i,Wr(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(id,"lstat");function nd(e,t=0,i=I){i=typeof t=="function"?t:i,Js(e,typeof t=="number"?t:0).then(()=>i()).catch(i)}s(nd,"truncate");function rd(e,t=I){An(e).then(()=>t()).catch(t)}s(rd,"unlink");function od(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(od,"open");function sd(e,t,i=I){i=typeof t=="function"?t:i,On(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(sd,"readFile");function ad(e,t,i,n=I){n=typeof i=="function"?i:n,Di(e,t,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(ad,"writeFile");function cd(e,t,i,n=I){let r=typeof i!="function"?i:void 0;n=typeof i=="function"?i:n,Qs(e,t,r).then(()=>n()).catch(n)}s(cd,"appendFile");function ld(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(ld,"fstat");function fd(e,t=I){new ce(e).close().then(()=>t()).catch(t)}s(fd,"close");function ud(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(ud,"ftruncate");function dd(e,t=I){j(e).sync().then(()=>t()).catch(t)}s(dd,"fsync");function hd(e,t=I){j(e).datasync().then(()=>t()).catch(t)}s(hd,"fdatasync");function pd(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=fa.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=fa.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(pd,"write");function yd(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(yd,"read");function md(e,t,i,n=I){new ce(e).chown(t,i).then(()=>n()).catch(n)}s(md,"fchown");function bd(e,t,i){new ce(e).chmod(t).then(()=>i()).catch(i)}s(bd,"fchmod");function gd(e,t,i,n=I){new ce(e).utimes(t,i).then(()=>n()).catch(n)}s(gd,"futimes");function wd(e,t=I){Ur(e).then(()=>t()).catch(t)}s(wd,"rmdir");function Sd(e,t,i=I){Pn(e,t).then(()=>i()).catch(i)}s(Sd,"mkdir");function Ed(e,t,i=I){i=typeof t=="function"?t:i,Vt(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(Ed,"readdir");function _d(e,t,i=I){Zs(e,t).then(()=>i()).catch(i)}s(_d,"link");function xd(e,t,i,n=I){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,ea(e,t,r).then(()=>n()).catch(n)}s(xd,"symlink");function kd(e,t,i=I){i=typeof t=="function"?t:i,jr(e).then(n=>i(void 0,n)).catch(i)}s(kd,"readlink");function vd(e,t,i,n=I){ta(e,t,i).then(()=>n()).catch(n)}s(vd,"chown");function Fd(e,t,i,n=I){ia(e,t,i).then(()=>n()).catch(n)}s(Fd,"lchown");function Id(e,t,i=I){na(e,t).then(()=>i()).catch(i)}s(Id,"chmod");function Ad(e,t,i=I){ra(e,t).then(()=>i()).catch(i)}s(Ad,"lchmod");function Od(e,t,i,n=I){qr(e,t,i).then(()=>n()).catch(n)}s(Od,"utimes");function Pd(e,t,i,n=I){oa(e,t,i).then(()=>n()).catch(n)}s(Pd,"lutimes");function Td(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(Td,"realpath");function Rd(e,t,i=I){let n=typeof t=="number"?t:4;i=typeof t=="function"?t:i,sa(e,n).then(()=>i()).catch(i)}s(Rd,"access");var Mi=new Map;function Nd(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(Mi.has(n)){let a=Mi.get(n);a&&a.listeners.add(i);return}let o=new Jn(n,r);o.on("change",(a,c)=>{let l=Mi.get(n);if(l)for(let f of l.listeners)f(a,c)}),Mi.set(n,{watcher:o,listeners:new Set})}s(Nd,"watchFile");function Ld(e,t=I){let i=x(e.toString()),n=Mi.get(i);n&&(t&&t!==I?n.listeners.delete(t):n.listeners.clear(),n.listeners.size===0&&(n.watcher.stop(),Mi.delete(i)))}s(Ld,"unwatchFile");function Cd(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(Cd,"watch");function Bd(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Lt({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(Bd,"createReadStream");function Dd(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(Dd,"createWriteStream");function Md(e,t,i=I){i=typeof t=="function"?t:i,$r(e,typeof t=="function"?void 0:t).then(()=>i(void 0)).catch(i)}s(Md,"rm");function Wd(e,t,i=I){i=typeof t=="function"?t:i,aa(e,typeof t!="function"?t:null).then(n=>i(void 0,n)).catch(i)}s(Wd,"mkdtemp");function Ud(e,t,i,n=I){n=typeof i=="function"?i:n,zr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Ud,"copyFile");function jd(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(jd,"readv");function qd(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(qd,"writev");function $d(e,t,i=I){i=typeof t=="function"?t:i,ca(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s($d,"opendir");function zd(e,t,i,n=I){n=typeof i=="function"?i:n,Vr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(zd,"cp");function Vd(e,t,i=I){i=typeof t=="function"?t:i,la(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Vd,"statfs");async function Hd(e,t){let i=await Se(e.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],t)}s(Hd,"openAsBlob");function Kd(e){return zi(e)||$i(e)||e instanceof pe}s(Kd,"isMountConfig");async function Wi(e,t=0){if(typeof e!="object"||e==null)throw new u(22,"Invalid options on mount configuration");if(!Kd(e))throw new u(22,"Invalid mount configuration");if(e instanceof pe)return e;$i(e)&&(e={backend:e});for(let[r,o]of Object.entries(e))if(r!="backend"&&Kd(o)){if(t>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");e[r]=await Wi(o,++t)}let{backend:i}=e;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await ro(i,e);let n=await i.create(e);return n._disableSync=e.disableAsyncCache||!1,await n.ready(),n}s(Wi,"resolveMountConfig");async function tS(e){if(!zi(e))throw new TypeError("Invalid single mount point configuration");let t=await Wi(e);gi("/"),$t("/",t)}s(tS,"configureSingle");async function iS(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");zi(r)&&(r.disableAsyncCache??=e.disableAsyncCache||!1),e.mounts[n]=await Wi(r)}un(e.mounts)}}s(iS,"configure");function ua(e){class t extends e{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{s(this,"AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(r=>{let o=s(()=>this._queueRunning?setTimeout(o):r(),"check");o()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(r){throw this._isInitialized=!1,r}}}checkSync(r,o){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",r,o);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",r,o)}renameSync(r,o){this.checkSync(r,"rename"),this._sync.renameSync(r,o),this.queue("rename",r,o)}statSync(r){return this.checkSync(r,"stat"),this._sync.statSync(r)}createFileSync(r,o,a){return this.checkSync(r,"createFile"),this._sync.createFileSync(r,o,a),this.queue("createFile",r,o,a),this.openFileSync(r,o)}openFileSync(r,o){this.checkSync(r,"openFile");let a=this._sync.openFileSync(r,o),c=a.statSync(),l=new Uint8Array(c.size);return a.readSync(l),new we(this,r,o,c,l)}unlinkSync(r){this.checkSync(r,"unlinkSync"),this._sync.unlinkSync(r),this.queue("unlink",r)}rmdirSync(r){this.checkSync(r,"rmdir"),this._sync.rmdirSync(r),this.queue("rmdir",r)}mkdirSync(r,o){this.checkSync(r,"mkdir"),this._sync.mkdirSync(r,o),this.queue("mkdir",r,o)}readdirSync(r){return this.checkSync(r,"readdir"),this._sync.readdirSync(r)}linkSync(r,o){this.checkSync(r,"link"),this._sync.linkSync(r,o),this.queue("link",r,o)}syncSync(r,o,a){this.checkSync(r,"sync"),this._sync.syncSync(r,o,a),this.queue("sync",r,o,a)}existsSync(r){return this.checkSync(r,"exists"),this._sync.existsSync(r)}async crossCopy(r){this.checkSync(r,"crossCopy");let o=await this.stat(r);if(!o.isDirectory()){var c=[];try{let b=S(c,await this.openFile(r,M("r")),!0);let p=S(c,this._sync.createFileSync(r,M("w"),o.mode));let w=new Uint8Array(o.size);await b.read(w);p.writeSync(w,0,o.size);return}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}if(r!=="/"){let b=await this.stat(r);this._sync.mkdirSync(r,b.mode)}let a=await this.readdir(r);for(let b of a)await this.crossCopy(z(r,b))}async _next(){if(!this._queueRunning)return;let[r,...o]=this._queue.shift();await this[r](...o),await this._next()}queue(...r){this._queue.push(r),this._next()}}return t}s(ua,"Async");function nS(e){return typeof e=="object"&&e!=null&&"fd"in e&&"path"in e&&"position"in e}s(nS,"isFileData");function da(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}s(da,"isMessage");var Ui=new Map;function ha(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);Ui.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(ha,"request");function Gd(e){if(!da(e))return;let{id:t,value:i,error:n,stack:r}=e;if(!Ui.has(t)){let l=new u(5,"Invalid RPC id:"+t);throw l.stack+=r,l}let{resolve:o,reject:a,fs:c}=Ui.get(t);if(n){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=r,a(l),Ui.delete(t);return}if(nS(i)){let{fd:l,path:f,position:d}=i,h=new Nn(c,l,f,d);o(h),Ui.delete(t);return}o(i),Ui.delete(t)}s(Gd,"handleResponse");function Hr(e,t){if(!e)throw u.With("EINVAL");e["on"in e?"on":"addEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Hr,"attach");function pa(e,t){if(!e)throw u.With("EINVAL");e["off"in e?"off":"removeEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(pa,"detach");function Yd(e){let t=[],i=t.push.bind(t);return Hr(e,i),function(n){pa(e,i);for(let r of t){let o="data"in r?r.data:r;Ln(e,n,o)}}}s(Yd,"catchMessages");var Nn=class extends jt{constructor(i,n,r,o){super(i,r);this.fs=i;this.fd=n;this.position=o}static{s(this,"PortFile")}rpc(i,...n){return ha({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")}},Gr=class extends ua(pe){constructor(i){super();this.options=i;this._sync=ln.create({name:"port-tmpfs"});this.port=i.port,Hr(this.port,Gd)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return ha({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)}},Xd=0,Kr=new Map;async function Ln(e,t,i){if(!da(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 jt&&(Kr.set(++Xd,l),l={fd:Xd,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Kr.has(d))throw new u(9);l=await Kr.get(d)[n](...r),n=="close"&&Kr.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(Ln,"handleRequest");function Jd(e,t){Hr(e,i=>Ln(e,t,i))}s(Jd,"attachFS");function oS(e,t){pa(e,i=>Ln(e,t,i))}s(oS,"detachFS");var Qd={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(async function(){return!0},"isAvailable"),create:s(function(e){return new Gr(e)},"create")},sS=Qd;async function aS(e,t,i=0){let n=Yd(e),r=await Wi(t,i);return Jd(e,r),n(r),r}s(aS,"resolveRemoteMount");function ya(e){class t extends e{static{s(this,"ReadonlyFS")}metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r){throw new u(30)}renameSync(n,r){throw new u(30)}async createFile(n,r,o){throw new u(30)}createFileSync(n,r,o){throw new u(30)}async unlink(n){throw new u(30)}unlinkSync(n){throw new u(30)}async rmdir(n){throw new u(30)}rmdirSync(n){throw new u(30)}async mkdir(n,r){throw new u(30)}mkdirSync(n,r){throw new u(30)}async link(n,r){throw new u(30)}linkSync(n,r){throw new u(30)}async sync(n,r,o){throw new u(30)}syncSync(n,r,o){throw new u(30)}}return t}s(ya,"Readonly");var ma=1,Yr=class e extends Map{static{s(this,"Index")}files(){let t=new Map;for(let[i,n]of this)n.isFile()&&t.set(i,n);return t}toJSON(){return{version:ma,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!=ma)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=Le(JSON.stringify(this.dirEntries(i)))),this.set(i,r)}}static parse(t){if(!Xa(t))throw new u(22,"Invalid JSON");let i=JSON.parse(t),n=new e;return n.fromJSON(i),n}},Cn=class extends ya(pe){constructor(i){super();this.indexData=i;this.index=new Yr;this._isInitialized=!1}static{s(this,"IndexFS")}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}};async function Zd(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(Zd,"fetchFile");var Xr=class e extends Cn{static{s(this,"FetchFS")}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:Zd(t,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:e.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 Zd(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")}},cS={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 Xr(e)},"create")},lS=cS;var Jr=class{constructor(t){this.previous=t;this.current=Promise.withResolvers();this._isLocked=!0}static{s(this,"MutexLock")}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()}},Qr=class{static{s(this,"__MutexedFS")}async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){let t=new Jr(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)}}};function ba(e){class t extends Qr{static{s(this,"MutexedFS")}constructor(...n){super(),this._fs=new e(...n)}}return t}s(ba,"Mutexed");var ga="/.deleted",Zr=class 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()}static{s(this,"UnmutexedOverlayFS")}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:Bn.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(ga,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
|
+
`)}async updateLog(i){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this.writable.openFile(ga,M("w"));try{await n.write(Le(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==ga)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()}},Bn=class extends ba(Zr){static{s(this,"OverlayFS")}},fS={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 Bn(e)},"create")},uS=fS;function dS(e){class t extends e{static{s(this,"SyncFS")}async exists(n){return this.existsSync(n)}async rename(n,r){return this.renameSync(n,r)}async stat(n){return this.statSync(n)}async createFile(n,r,o){return this.createFileSync(n,r,o)}async openFile(n,r){return this.openFileSync(n,r)}async unlink(n){return this.unlinkSync(n)}async rmdir(n){return this.rmdirSync(n)}async mkdir(n,r){return this.mkdirSync(n,r)}async readdir(n){return this.readdirSync(n)}async link(n,r){return this.linkSync(n,r)}async sync(n,r,o){return this.syncSync(n,r,o)}}return t}s(dS,"Sync");var hS=Rn;return oh(pS);})();
|
|
5
6
|
/*! Bundled license information:
|
|
6
7
|
|
|
7
8
|
ieee754/index.js:
|