@zenfs/core 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/eslint.shared.js +0 -4
- package/package.json +2 -3
- package/scripts/build.js +27 -24
- 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 zh=Object.create;var Mt=Object.defineProperty;var lc=Object.getOwnPropertyDescriptor;var Vh=Object.getOwnPropertyNames;var Hh=Object.getPrototypeOf,Kh=Object.prototype.hasOwnProperty;var sc=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Dt=e=>{throw TypeError(e)};var Gh=(e,t,i)=>t in e?Mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var s=(e,t)=>Mt(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Un=(e,t)=>{for(var i in t)Mt(e,i,{get:t[i],enumerable:!0})},fc=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Vh(t))!Kh.call(e,r)&&r!==i&&Mt(e,r,{get:()=>t[r],enumerable:!(n=lc(t,r))||n.enumerable});return e};var $i=(e,t,i)=>(i=e!=null?zh(Hh(e)):{},fc(t||!e||!e.__esModule?Mt(i,"default",{value:e,enumerable:!0}):i,e)),Yh=e=>fc(Mt({},"__esModule",{value:!0}),e);var uc=["class","method","getter","setter","accessor","field","value","get","set"],qi=e=>e!==void 0&&typeof e!="function"?Dt("Function expected"):e,Xh=(e,t,i,n)=>({kind:uc[e],name:t,addInitializer:r=>i._?Dt("Already initialized"):n.push(qi(r||null))}),dc=(e,t,i)=>{for(var n=0,r=e[t>>1],o=r&&r.length;n<o;n++)t&1?r[n].call(i):i=(0,r[n])(i);return i},_e=(e,t,i,n,r,o)=>{var a,c,l,f,d,h=t&7,b=!!(t&8),p=!!(t&16),w=h>3?e.length+1:h?b?1:2:0,g=uc[h+5],A=h>3&&(e[w-1]=[]),k=e[w]||(e[w]=[]),v=h&&(!p&&!b&&(r=r.prototype),h<5&&(h>3||!p)&&lc(h<4?r:{get[i](){return ac(this,o)},set[i](F){return cc(this,o,F)}},i));h?p&&h<4&&s(o,(h>2?"set ":h>1?"get ":"")+i):s(r,i);for(var L=n.length-1;L>=0;L--)f=Xh(h,i,l={},k),h&&(f.static=b,f.private=p,d=f.access={has:p?F=>Jh(r,F):F=>i in F},h^3&&(d.get=p?F=>(h^1?ac:Qh)(F,r,h^4?o:v.get):F=>F[i]),h>2&&(d.set=p?(F,B)=>cc(F,r,B,h^4?o:v.set):(F,B)=>F[i]=B)),c=(0,n[L])(h?h<4?p?o:v[g]:h>4?void 0:{get:v.get,set:v.set}:r,f),l._=1,h^4||c===void 0?qi(c)&&(h>4?A.unshift(c):h?p?o=c:v[g]=c:r=c):typeof c!="object"||c===null?Dt("Object expected"):(qi(a=c.get)&&(v.get=a),qi(a=c.set)&&(v.set=a),qi(a=c.init)&&A.unshift(a));return v&&Mt(r,i,v),p?h^4?o:v:r},oo=(e,t,i)=>Gh(e,typeof t!="symbol"?t+"":t,i),so=(e,t,i)=>t.has(e)||Dt("Cannot "+i),Jh=(e,t)=>Object(t)!==t?Dt('Cannot use the "in" operator on this value'):e.has(t),ac=(e,t,i)=>(so(e,t,"read from private field"),i?i.call(e):t.get(e));var cc=(e,t,i,n)=>(so(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Qh=(e,t,i)=>(so(e,t,"access private method"),i);var S=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Dt("Object expected");var n;i&&(n=t[sc("asyncDispose")]),n===void 0&&(n=t[sc("dispose")]),typeof n!="function"&&Dt("Object not disposable"),e.push([i,n,t])}else i&&e.push([i]);return t},E=(e,t,i)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},r=a=>t=i?new n(a,t,"An error was suppressed during disposal"):(i=!0,a),o=a=>{for(;a=e.pop();)try{var c=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(c).then(o,l=>(r(l),o()))}catch(l){r(l)}if(i)throw t};return o()};var bc=T(zn=>{"use strict";zn.byteLength=op;zn.toByteArray=ap;zn.fromByteArray=fp;var qe=[],Fe=[],rp=typeof Uint8Array<"u"?Uint8Array:Array,fo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ut=0,yc=fo.length;Ut<yc;++Ut)qe[Ut]=fo[Ut],Fe[fo.charCodeAt(Ut)]=Ut;var Ut,yc;Fe[45]=62;Fe[95]=63;function mc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");i===-1&&(i=t);var n=i===t?0:4-i%4;return[i,n]}s(mc,"getLens");function op(e){var t=mc(e),i=t[0],n=t[1];return(i+n)*3/4-n}s(op,"byteLength");function sp(e,t,i){return(t+i)*3/4-i}s(sp,"_byteLength");function ap(e){var t,i=mc(e),n=i[0],r=i[1],o=new rp(sp(e,n,r)),a=0,c=r>0?n-4:n,l;for(l=0;l<c;l+=4)t=Fe[e.charCodeAt(l)]<<18|Fe[e.charCodeAt(l+1)]<<12|Fe[e.charCodeAt(l+2)]<<6|Fe[e.charCodeAt(l+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return r===2&&(t=Fe[e.charCodeAt(l)]<<2|Fe[e.charCodeAt(l+1)]>>4,o[a++]=t&255),r===1&&(t=Fe[e.charCodeAt(l)]<<10|Fe[e.charCodeAt(l+1)]<<4|Fe[e.charCodeAt(l+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}s(ap,"toByteArray");function cp(e){return qe[e>>18&63]+qe[e>>12&63]+qe[e>>6&63]+qe[e&63]}s(cp,"tripletToBase64");function lp(e,t,i){for(var n,r=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),r.push(cp(n));return r.join("")}s(lp,"encodeChunk");function fp(e){for(var t,i=e.length,n=i%3,r=[],o=16383,a=0,c=i-n;a<c;a+=o)r.push(lp(e,a,a+o>c?c:a+o));return n===1?(t=e[i-1],r.push(qe[t>>2]+qe[t<<4&63]+"==")):n===2&&(t=(e[i-2]<<8)+e[i-1],r.push(qe[t>>10]+qe[t>>4&63]+qe[t<<2&63]+"=")),r.join("")}s(fp,"fromByteArray")});var gc=T(uo=>{uo.read=function(e,t,i,n,r){var o,a,c=r*8-n-1,l=(1<<c)-1,f=l>>1,d=-7,h=i?r-1:0,b=i?-1:1,p=e[t+h];for(h+=b,o=p&(1<<-d)-1,p>>=-d,d+=c;d>0;o=o*256+e[t+h],h+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+e[t+h],h+=b,d-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(p?-1:1)*a*Math.pow(2,o-n)};uo.write=function(e,t,i,n,r,o){var a,c,l,f=o*8-r-1,d=(1<<f)-1,h=d>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,w=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?t+=b/l:t+=b*Math.pow(2,1-h),t*l>=2&&(a++,l/=2),a+h>=d?(c=0,a=d):a+h>=1?(c=(t*l-1)*Math.pow(2,r),a=a+h):(c=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[i+p]=c&255,p+=w,c/=256,r-=8);for(a=a<<r|c,f+=r;f>0;e[i+p]=a&255,p+=w,a/=256,f-=8);e[i+p-w]|=g*128}});var Ie=T(ui=>{"use strict";var ho=bc(),li=gc(),wc=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=m;ui.SlowBuffer=mp;ui.INSPECT_MAX_BYTES=50;var Vn=2147483647;ui.kMaxLength=Vn;m.TYPED_ARRAY_SUPPORT=up();!m.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function up(){try{let e=new Uint8Array(1),t={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}s(up,"typedArraySupport");Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.buffer},"get")});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.byteOffset},"get")});function ct(e){if(e>Vn)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,m.prototype),t}s(ct,"createBuffer");function m(e,t,i){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return bo(e)}return xc(e,t,i)}s(m,"Buffer");m.poolSize=8192;function xc(e,t,i){if(typeof e=="string")return hp(e,t);if(ArrayBuffer.isView(e))return pp(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($e(e,ArrayBuffer)||e&&$e(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($e(e,SharedArrayBuffer)||e&&$e(e.buffer,SharedArrayBuffer)))return yo(e,t,i);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return m.from(n,t,i);let r=yp(e);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return m.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s(xc,"from");m.from=function(e,t,i){return xc(e,t,i)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function kc(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}s(kc,"assertSize");function dp(e,t,i){return kc(e),e<=0?ct(e):t!==void 0?typeof i=="string"?ct(e).fill(t,i):ct(e).fill(t):ct(e)}s(dp,"alloc");m.alloc=function(e,t,i){return dp(e,t,i)};function bo(e){return kc(e),ct(e<0?0:go(e)|0)}s(bo,"allocUnsafe");m.allocUnsafe=function(e){return bo(e)};m.allocUnsafeSlow=function(e){return bo(e)};function hp(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let i=vc(e,t)|0,n=ct(i),r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}s(hp,"fromString");function po(e){let t=e.length<0?0:go(e.length)|0,i=ct(t);for(let n=0;n<t;n+=1)i[n]=e[n]&255;return i}s(po,"fromArrayLike");function pp(e){if($e(e,Uint8Array)){let t=new Uint8Array(e);return yo(t.buffer,t.byteOffset,t.byteLength)}return po(e)}s(pp,"fromArrayView");function yo(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),Object.setPrototypeOf(n,m.prototype),n}s(yo,"fromArrayBuffer");function yp(e){if(m.isBuffer(e)){let t=go(e.length)|0,i=ct(t);return i.length===0||e.copy(i,0,0,t),i}if(e.length!==void 0)return typeof e.length!="number"||So(e.length)?ct(0):po(e);if(e.type==="Buffer"&&Array.isArray(e.data))return po(e.data)}s(yp,"fromObject");function go(e){if(e>=Vn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Vn.toString(16)+" bytes");return e|0}s(go,"checked");function mp(e){return+e!=e&&(e=0),m.alloc(+e)}s(mp,"SlowBuffer");m.isBuffer=s(function(t){return t!=null&&t._isBuffer===!0&&t!==m.prototype},"isBuffer");m.compare=s(function(t,i){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),$e(i,Uint8Array)&&(i=m.from(i,i.offset,i.byteLength)),!m.isBuffer(t)||!m.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===i)return 0;let n=t.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(t[o]!==i[o]){n=t[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");m.isEncoding=s(function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");m.concat=s(function(t,i){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return m.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<t.length;++n)i+=t[n].length;let r=m.allocUnsafe(i),o=0;for(n=0;n<t.length;++n){let a=t[n];if($e(a,Uint8Array))o+a.length>r.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(m.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function vc(e,t){if(m.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$e(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let i=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return mo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Nc(e).length;default:if(r)return n?-1:mo(e).length;t=(""+t).toLowerCase(),r=!0}}s(vc,"byteLength");m.byteLength=vc;function bp(e,t,i){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,t>>>=0,i<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ip(this,t,i);case"utf8":case"utf-8":return Ic(this,t,i);case"ascii":return vp(this,t,i);case"latin1":case"binary":return Fp(this,t,i);case"base64":return xp(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ap(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s(bp,"slowToString");m.prototype._isBuffer=!0;function jt(e,t,i){let n=e[t];e[t]=e[i],e[i]=n}s(jt,"swap");m.prototype.swap16=s(function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<t;i+=2)jt(this,i,i+1);return this},"swap16");m.prototype.swap32=s(function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<t;i+=4)jt(this,i,i+3),jt(this,i+1,i+2);return this},"swap32");m.prototype.swap64=s(function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<t;i+=8)jt(this,i,i+7),jt(this,i+1,i+6),jt(this,i+2,i+5),jt(this,i+3,i+4);return this},"swap64");m.prototype.toString=s(function(){let t=this.length;return t===0?"":arguments.length===0?Ic(this,0,t):bp.apply(this,arguments)},"toString");m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=s(function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:m.compare(this,t)===0},"equals");m.prototype.inspect=s(function(){let t="",i=ui.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},"inspect");wc&&(m.prototype[wc]=m.prototype.inspect);m.prototype.compare=s(function(t,i,n,r,o){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(i===void 0&&(i=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let a=o-r,c=n-i,l=Math.min(a,c),f=this.slice(r,o),d=t.slice(i,n);for(let h=0;h<l;++h)if(f[h]!==d[h]){a=f[h],c=d[h];break}return a<c?-1:c<a?1:0},"compare");function Fc(e,t,i,n,r){if(e.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,So(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof t=="string"&&(t=m.from(t,n)),m.isBuffer(t))return t.length===0?-1:Sc(e,t,i,n,r);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):Sc(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(Fc,"bidirectionalIndexOf");function Sc(e,t,i,n,r){let o=1,a=e.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(l,"read");let f;if(r){let d=-1;for(f=i;f<a;f++)if(l(e,f)===l(t,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let d=!0;for(let h=0;h<c;h++)if(l(e,f+h)!==l(t,h)){d=!1;break}if(d)return f}return-1}s(Sc,"arrayIndexOf");m.prototype.includes=s(function(t,i,n){return this.indexOf(t,i,n)!==-1},"includes");m.prototype.indexOf=s(function(t,i,n){return Fc(this,t,i,n,!0)},"indexOf");m.prototype.lastIndexOf=s(function(t,i,n){return Fc(this,t,i,n,!1)},"lastIndexOf");function gp(e,t,i,n){i=Number(i)||0;let r=e.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=t.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let c=parseInt(t.substr(a*2,2),16);if(So(c))return a;e[i+a]=c}return a}s(gp,"hexWrite");function wp(e,t,i,n){return Hn(mo(t,e.length-i),e,i,n)}s(wp,"utf8Write");function Sp(e,t,i,n){return Hn(Rp(t),e,i,n)}s(Sp,"asciiWrite");function Ep(e,t,i,n){return Hn(Nc(t),e,i,n)}s(Ep,"base64Write");function _p(e,t,i,n){return Hn(Lp(t,e.length-i),e,i,n)}s(_p,"ucs2Write");m.prototype.write=s(function(t,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return gp(this,t,i,n);case"utf8":case"utf-8":return wp(this,t,i,n);case"ascii":case"latin1":case"binary":return Sp(this,t,i,n);case"base64":return Ep(this,t,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _p(this,t,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");m.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function xp(e,t,i){return t===0&&i===e.length?ho.fromByteArray(e):ho.fromByteArray(e.slice(t,i))}s(xp,"base64Slice");function Ic(e,t,i){i=Math.min(e.length,i);let n=[],r=t;for(;r<i;){let o=e[r],a=null,c=o>239?4:o>223?3:o>191?2:1;if(r+c<=i){let l,f,d,h;switch(c){case 1:o<128&&(a=o);break;case 2:l=e[r+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(a=h));break;case 3:l=e[r+1],f=e[r+2],(l&192)===128&&(f&192)===128&&(h=(o&15)<<12|(l&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:l=e[r+1],f=e[r+2],d=e[r+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(l&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=c}return kp(n)}s(Ic,"utf8Slice");var Ec=4096;function kp(e){let t=e.length;if(t<=Ec)return String.fromCharCode.apply(String,e);let i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=Ec));return i}s(kp,"decodeCodePointsArray");function vp(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]&127);return n}s(vp,"asciiSlice");function Fp(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}s(Fp,"latin1Slice");function Ip(e,t,i){let n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=t;o<i;++o)r+=Np[e[o]];return r}s(Ip,"hexSlice");function Ap(e,t,i){let n=e.slice(t,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Ap,"utf16leSlice");m.prototype.slice=s(function(t,i){let n=this.length;t=~~t,i=i===void 0?n:~~i,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<t&&(i=t);let r=this.subarray(t,i);return Object.setPrototypeOf(r,m.prototype),r},"slice");function Z(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}s(Z,"checkOffset");m.prototype.readUintLE=m.prototype.readUIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return r},"readUIntLE");m.prototype.readUintBE=m.prototype.readUIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t+--i],o=1;for(;i>0&&(o*=256);)r+=this[t+--i]*o;return r},"readUIntBE");m.prototype.readUint8=m.prototype.readUInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]},"readUInt8");m.prototype.readUint16LE=m.prototype.readUInt16LE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]|this[t+1]<<8},"readUInt16LE");m.prototype.readUint16BE=m.prototype.readUInt16BE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]<<8|this[t+1]},"readUInt16BE");m.prototype.readUint32LE=m.prototype.readUInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},"readUInt32LE");m.prototype.readUint32BE=m.prototype.readUInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},"readUInt32BE");m.prototype.readBigUInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));m.prototype.readBigUInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=i*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));m.prototype.readIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");m.prototype.readIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=i,o=1,a=this[t+--r];for(;r>0&&(o*=256);)a+=this[t+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");m.prototype.readInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},"readInt8");m.prototype.readInt16LE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");m.prototype.readInt16BE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},"readInt16BE");m.prototype.readInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},"readInt32LE");m.prototype.readInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},"readInt32BE");m.prototype.readBigInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)},"readBigInt64LE"));m.prototype.readBigInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=(i<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)},"readBigInt64BE"));m.prototype.readFloatLE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!0,23,4)},"readFloatLE");m.prototype.readFloatBE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!1,23,4)},"readFloatBE");m.prototype.readDoubleLE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!0,52,8)},"readDoubleLE");m.prototype.readDoubleBE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!1,52,8)},"readDoubleBE");function fe(e,t,i,n,r,o){if(!m.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}s(fe,"checkInt");m.prototype.writeUintLE=m.prototype.writeUIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=1,a=0;for(this[i]=t&255;++a<n&&(o*=256);)this[i+a]=t/o&255;return i+n},"writeUIntLE");m.prototype.writeUintBE=m.prototype.writeUIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=n-1,a=1;for(this[i+o]=t&255;--o>=0&&(a*=256);)this[i+o]=t/a&255;return i+n},"writeUIntBE");m.prototype.writeUint8=m.prototype.writeUInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,255,0),this[i]=t&255,i+1},"writeUInt8");m.prototype.writeUint16LE=m.prototype.writeUInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeUInt16LE");m.prototype.writeUint16BE=m.prototype.writeUInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeUInt16BE");m.prototype.writeUint32LE=m.prototype.writeUInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i+3]=t>>>24,this[i+2]=t>>>16,this[i+1]=t>>>8,this[i]=t&255,i+4},"writeUInt32LE");m.prototype.writeUint32BE=m.prototype.writeUInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeUInt32BE");function Ac(e,t,i,n,r){Lc(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,i}s(Ac,"wrtBigUInt64LE");function Oc(e,t,i,n,r){Lc(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i+7]=o,o=o>>8,e[i+6]=o,o=o>>8,e[i+5]=o,o=o>>8,e[i+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=a,a=a>>8,e[i+2]=a,a=a>>8,e[i+1]=a,a=a>>8,e[i]=a,i+8}s(Oc,"wrtBigUInt64BE");m.prototype.writeBigUInt64LE=xt(s(function(t,i=0){return Ac(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));m.prototype.writeBigUInt64BE=xt(s(function(t,i=0){return Oc(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));m.prototype.writeIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=0,a=1,c=0;for(this[i]=t&255;++o<n&&(a*=256);)t<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntLE");m.prototype.writeIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=n-1,a=1,c=0;for(this[i+o]=t&255;--o>=0&&(a*=256);)t<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntBE");m.prototype.writeInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,127,-128),t<0&&(t=255+t+1),this[i]=t&255,i+1},"writeInt8");m.prototype.writeInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeInt16LE");m.prototype.writeInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeInt16BE");m.prototype.writeInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),this[i]=t&255,this[i+1]=t>>>8,this[i+2]=t>>>16,this[i+3]=t>>>24,i+4},"writeInt32LE");m.prototype.writeInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeInt32BE");m.prototype.writeBigInt64LE=xt(s(function(t,i=0){return Ac(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));m.prototype.writeBigInt64BE=xt(s(function(t,i=0){return Oc(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Pc(e,t,i,n,r,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(Pc,"checkIEEE754");function Tc(e,t,i,n,r){return t=+t,i=i>>>0,r||Pc(e,t,i,4,34028234663852886e22,-34028234663852886e22),li.write(e,t,i,n,23,4),i+4}s(Tc,"writeFloat");m.prototype.writeFloatLE=s(function(t,i,n){return Tc(this,t,i,!0,n)},"writeFloatLE");m.prototype.writeFloatBE=s(function(t,i,n){return Tc(this,t,i,!1,n)},"writeFloatBE");function Rc(e,t,i,n,r){return t=+t,i=i>>>0,r||Pc(e,t,i,8,17976931348623157e292,-17976931348623157e292),li.write(e,t,i,n,52,8),i+8}s(Rc,"writeDouble");m.prototype.writeDoubleLE=s(function(t,i,n){return Rc(this,t,i,!0,n)},"writeDoubleLE");m.prototype.writeDoubleBE=s(function(t,i,n){return Rc(this,t,i,!1,n)},"writeDoubleBE");m.prototype.copy=s(function(t,i,n,r){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=t.length&&(i=t.length),i||(i=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-i<r-n&&(r=t.length-i+n);let o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),i),o},"copy");m.prototype.fill=s(function(t,i,n,r){if(typeof t=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!m.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){let a=t.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=i;o<n;++o)this[o]=t;else{let a=m.isBuffer(t)?t:m.from(t,r),c=a.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%c]}return this},"fill");var ci={};function wo(e,t,i){var n;ci[e]=(n=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}},s(n,"NodeError"),n)}s(wo,"E");wo("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);wo("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);wo("ERR_OUT_OF_RANGE",function(e,t,i){let n=`The value of "${e}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=_c(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=_c(r)),r+="n"),n+=` It must be ${t}. Received ${r}`,n},RangeError);function _c(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(_c,"addNumericalSeparator");function Op(e,t,i){fi(t,"offset"),(e[t]===void 0||e[t+i]===void 0)&&Ki(t,e.length-(i+1))}s(Op,"checkBounds");function Lc(e,t,i,n,r,o){if(e>i||e<t){let a=typeof t=="bigint"?"n":"",c;throw o>3?t===0||t===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${t}${a} and <= ${i}${a}`,new ci.ERR_OUT_OF_RANGE("value",c,e)}Op(n,r,o)}s(Lc,"checkIntBI");function fi(e,t){if(typeof e!="number")throw new ci.ERR_INVALID_ARG_TYPE(t,"number",e)}s(fi,"validateNumber");function Ki(e,t,i){throw Math.floor(e)!==e?(fi(e,i),new ci.ERR_OUT_OF_RANGE(i||"offset","an integer",e)):t<0?new ci.ERR_BUFFER_OUT_OF_BOUNDS:new ci.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}s(Ki,"boundsError");var Pp=/[^+/0-9A-Za-z-_]/g;function Tp(e){if(e=e.split("=")[0],e=e.trim().replace(Pp,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}s(Tp,"base64clean");function mo(e,t){t=t||1/0;let i,n=e.length,r=null,o=[];for(let a=0;a<n;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(mo,"utf8ToBytes");function Rp(e){let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i)&255);return t}s(Rp,"asciiToBytes");function Lp(e,t){let i,n,r,o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(Lp,"utf16leToBytes");function Nc(e){return ho.toByteArray(Tp(e))}s(Nc,"base64ToBytes");function Hn(e,t,i,n){let r;for(r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}s(Hn,"blitBuffer");function $e(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}s($e,"isInstance");function So(e){return e!==e}s(So,"numberIsNaN");var Np=function(){let e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)t[n+r]=e[i]+e[r]}return t}();function xt(e){return typeof BigInt>"u"?Cp:e}s(xt,"defineBigIntMethod");function Cp(){throw new Error("BigInt not supported")}s(Cp,"BufferBigIntNotDefined")});var Bc=T((vE,ko)=>{"use strict";var sy=Object.prototype.hasOwnProperty,se="~";function Xi(){}s(Xi,"Events");Object.create&&(Xi.prototype=Object.create(null),new Xi().__proto__||(se=!1));function ay(e,t,i){this.fn=e,this.context=t,this.once=i||!1}s(ay,"EE");function Cc(e,t,i,n,r){if(typeof i!="function")throw new TypeError("The listener must be a function");var o=new ay(i,n||e,r),a=se?se+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}s(Cc,"addListener");function Kn(e,t){--e._eventsCount===0?e._events=new Xi:delete e._events[t]}s(Kn,"clearEvent");function ne(){this._events=new Xi,this._eventsCount=0}s(ne,"EventEmitter");ne.prototype.eventNames=s(function(){var t=[],i,n;if(this._eventsCount===0)return t;for(n in i=this._events)sy.call(i,n)&&t.push(se?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(i)):t},"eventNames");ne.prototype.listeners=s(function(t){var i=se?se+t:t,n=this._events[i];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},"listeners");ne.prototype.listenerCount=s(function(t){var i=se?se+t:t,n=this._events[i];return n?n.fn?1:n.length:0},"listenerCount");ne.prototype.emit=s(function(t,i,n,r,o,a){var c=se?se+t:t;if(!this._events[c])return!1;var l=this._events[c],f=arguments.length,d,h;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,i),!0;case 3:return l.fn.call(l.context,i,n),!0;case 4:return l.fn.call(l.context,i,n,r),!0;case 5:return l.fn.call(l.context,i,n,r,o),!0;case 6:return l.fn.call(l.context,i,n,r,o,a),!0}for(h=1,d=new Array(f-1);h<f;h++)d[h-1]=arguments[h];l.fn.apply(l.context,d)}else{var b=l.length,p;for(h=0;h<b;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),f){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,i);break;case 3:l[h].fn.call(l[h].context,i,n);break;case 4:l[h].fn.call(l[h].context,i,n,r);break;default:if(!d)for(p=1,d=new Array(f-1);p<f;p++)d[p-1]=arguments[p];l[h].fn.apply(l[h].context,d)}}return!0},"emit");ne.prototype.on=s(function(t,i,n){return Cc(this,t,i,n,!1)},"on");ne.prototype.once=s(function(t,i,n){return Cc(this,t,i,n,!0)},"once");ne.prototype.removeListener=s(function(t,i,n,r){var o=se?se+t:t;if(!this._events[o])return this;if(!i)return Kn(this,o),this;var a=this._events[o];if(a.fn)a.fn===i&&(!r||a.once)&&(!n||a.context===n)&&Kn(this,o);else{for(var c=0,l=[],f=a.length;c<f;c++)(a[c].fn!==i||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[o]=l.length===1?l[0]:l:Kn(this,o)}return this},"removeListener");ne.prototype.removeAllListeners=s(function(t){var i;return t?(i=se?se+t:t,this._events[i]&&Kn(this,i)):(this._events=new Xi,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=se;ne.EventEmitter=ne;typeof ko<"u"&&(ko.exports=ne)});var q=T((Sx,Rl)=>{"use strict";Rl.exports={ArrayIsArray:s(function(e){return Array.isArray(e)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(e,t){return e.includes(t)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(e,t){return e.indexOf(t)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(e,t){return e.join(t)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(e,t){return e.map(t)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(e,t){return e.pop(t)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(e,t){return e.push(t)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(e,t,...i){return e.call(t,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},"FunctionPrototypeSymbolHasInstance"),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:s(function(e,t){return Object.defineProperties(e,t)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(e,t,i){return Object.defineProperty(e,t,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(e,t){return Object.getOwnPropertyDescriptor(e,t)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(e){return Object.keys(e)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(e,t){return Object.setPrototypeOf(e,t)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(e,t){return e.catch(t)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(e,t,i){return e.then(t,i)},"PromisePrototypeThen"),PromiseReject:s(function(e){return Promise.reject(e)},"PromiseReject"),PromiseResolve:s(function(e){return Promise.resolve(e)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(e,t){return e.test(t)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(e){return e.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(e){return e.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(e){return e.trim()},"StringPrototypeTrim"),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:s(function(e,t,i){return e.set(t,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var Ei=T((_x,sr)=>{"use strict";var{AbortController:Ll,AbortSignal:Ey}=typeof self<"u"?self:typeof window<"u"?window:void 0;sr.exports=Ll;sr.exports.AbortSignal=Ey;sr.exports.default=Ll});var gn=T((xx,ls)=>{"use strict";var _i=typeof Reflect=="object"?Reflect:null,Nl=_i&&typeof _i.apply=="function"?_i.apply:s(function(t,i,n){return Function.prototype.apply.call(t,i,n)},"ReflectApply"),ar;_i&&typeof _i.ownKeys=="function"?ar=_i.ownKeys:Object.getOwnPropertySymbols?ar=s(function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))},"ReflectOwnKeys"):ar=s(function(t){return Object.getOwnPropertyNames(t)},"ReflectOwnKeys");function _y(e){console&&console.warn&&console.warn(e)}s(_y,"ProcessEmitWarning");var Bl=Number.isNaN||s(function(t){return t!==t},"NumberIsNaN");function N(){N.init.call(this)}s(N,"EventEmitter");ls.exports=N;ls.exports.once=Fy;N.EventEmitter=N;N.prototype._events=void 0;N.prototype._eventsCount=0;N.prototype._maxListeners=void 0;var Cl=10;function cr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}s(cr,"checkListener");Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Cl},"get"),set:s(function(e){if(typeof e!="number"||e<0||Bl(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Cl=e},"set")});N.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};N.prototype.setMaxListeners=s(function(t){if(typeof t!="number"||t<0||Bl(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 Dl(e){return e._maxListeners===void 0?N.defaultMaxListeners:e._maxListeners}s(Dl,"_getMaxListeners");N.prototype.getMaxListeners=s(function(){return Dl(this)},"getMaxListeners");N.prototype.emit=s(function(t){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=t==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[t];if(l===void 0)return!1;if(typeof l=="function")Nl(l,this,i);else for(var f=l.length,d=ql(l,f),n=0;n<f;++n)Nl(d[n],this,i);return!0},"emit");function Ml(e,t,i,n){var r,o,a;if(cr(i),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),a===void 0)a=o[t]=i,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Dl(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,_y(c)}return e}s(Ml,"_addListener");N.prototype.addListener=s(function(t,i){return Ml(this,t,i,!1)},"addListener");N.prototype.on=N.prototype.addListener;N.prototype.prependListener=s(function(t,i){return Ml(this,t,i,!0)},"prependListener");function xy(){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(xy,"onceWrapper");function Wl(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=xy.bind(n);return r.listener=i,n.wrapFn=r,r}s(Wl,"_onceWrap");N.prototype.once=s(function(t,i){return cr(i),this.on(t,Wl(this,t,i)),this},"once");N.prototype.prependOnceListener=s(function(t,i){return cr(i),this.prependListener(t,Wl(this,t,i)),this},"prependOnceListener");N.prototype.removeListener=s(function(t,i){var n,r,o,a,c;if(cr(i),r=this._events,r===void 0)return this;if(n=r[t],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){c=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():ky(n,o),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,c||i)}return this},"removeListener");N.prototype.off=N.prototype.removeListener;N.prototype.removeAllListeners=s(function(t){var i,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[t],typeof i=="function")this.removeListener(t,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(t,i[r]);return this},"removeAllListeners");function Ul(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?vy(r):ql(r,r.length)}s(Ul,"_listeners");N.prototype.listeners=s(function(t){return Ul(this,t,!0)},"listeners");N.prototype.rawListeners=s(function(t){return Ul(this,t,!1)},"rawListeners");N.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):jl.call(e,t)};N.prototype.listenerCount=jl;function jl(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(jl,"listenerCount");N.prototype.eventNames=s(function(){return this._eventsCount>0?ar(this._events):[]},"eventNames");function ql(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}s(ql,"arrayClone");function ky(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}s(ky,"spliceOne");function vy(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}s(vy,"unwrapListeners");function Fy(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"),$l(e,t,o,{once:!0}),t!=="error"&&Iy(e,r,{once:!0})})}s(Fy,"once");function Iy(e,t,i){typeof e.on=="function"&&$l(e,"error",t,i)}s(Iy,"addErrorHandlerIfEventEmitter");function $l(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($l,"eventTargetAgnosticAddListener")});var re=T((vx,us)=>{"use strict";var Ay=Ie(),{kResistStopPropagation:Oy,SymbolDispose:Py}=q(),Ty=globalThis.AbortSignal||Ei().AbortSignal,Ry=globalThis.AbortController||Ei().AbortController,Ly=Object.getPrototypeOf(async function(){}).constructor,zl=globalThis.Blob||Ay.Blob,Ny=s(typeof zl<"u"?function(t){return t instanceof zl}:function(t){return!1},"isBlob"),Vl=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"),Cy=s((e,t)=>{if(typeof e!="function")throw new ERR_INVALID_ARG_TYPE(t,"Function",e)},"validateFunction"),ds=class ds extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let i="";for(let n=0;n<t.length;n++)i+=` ${t[n].stack}
|
|
2
|
+
`;super(i),this.name="AggregateError",this.errors=t}};s(ds,"AggregateError");var fs=ds;us.exports={AggregateError:fs,kEmptyObject:Object.freeze({}),once:s(function(e){let t=!1;return function(...i){t||(t=!0,e.apply(this,i))}},"once"),createDeferredPromise:s(function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},"createDeferredPromise"),promisify:s(function(e){return new Promise((t,i)=>{e((n,...r)=>n?i(n):t(...r))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(e,...t){return e.replace(/%([sdifj])/g,function(...[i,n]){let r=t.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},"format"),inspect:s(function(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(e){return e instanceof Ly},"isAsyncFunction"),isArrayBufferView:s(function(e){return ArrayBuffer.isView(e)},"isArrayBufferView")},isBlob:Ny,deprecate:s(function(e,t){return e},"deprecate"),addAbortListener:gn().addAbortListener||s(function(t,i){if(t===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);Vl(t,"signal"),Cy(i,"listener");let n;return t.aborted?queueMicrotask(()=>i()):(t.addEventListener("abort",i,{__proto__:null,once:!0,[Oy]:!0}),n=s(()=>{t.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Py](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Ty.any||s(function(t){if(t.length===1)return t[0];let i=new Ry,n=s(()=>i.abort(),"abort");return t.forEach(r=>{Vl(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{t.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};us.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=T((Ix,Gl)=>{"use strict";var{format:By,inspect:lr,AggregateError:Dy}=re(),My=globalThis.AggregateError||Dy,Wy=Symbol("kIsNodeError"),Uy=["string","function","number","object","Function","Object","boolean","bigint","symbol"],jy=/^([A-Z][a-z0-9]*)+$/,qy="__node_internal_",fr={};function Kt(e,t){if(!e)throw new fr.ERR_INTERNAL_ASSERTION(t)}s(Kt,"assert");function Hl(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(Hl,"addNumericalSeparator");function $y(e,t,i){if(typeof t=="function")return Kt(t.length<=i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${t.length}).`),t(...i);let n=(t.match(/%[dfijoOs]/g)||[]).length;return Kt(n===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?t:By(t,...i)}s($y,"getMessage");function ie(e,t,i){i||(i=Error);let r=class r extends i{constructor(...a){super($y(e,t,a))}toString(){return`${this.name} [${e}]: ${this.message}`}};s(r,"NodeError");let n=r;Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${e}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[Wy]=!0,fr[e]=n}s(ie,"E");function Kl(e){let t=qy+e.name;return Object.defineProperty(e,"name",{value:t}),e}s(Kl,"hideStackFrames");function zy(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let i=new My([t,e],t.message);return i.code=t.code,i}return e||t}s(zy,"aggregateTwoErrors");var ps=class ps extends Error{constructor(t="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new fr.ERR_INVALID_ARG_TYPE("options","Object",i);super(t,i),this.code="ABORT_ERR",this.name="AbortError"}};s(ps,"AbortError");var hs=ps;ie("ERR_ASSERTION","%s",Error);ie("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Kt(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let l of t)Kt(typeof l=="string","All expected entries have to be of type string"),Uy.includes(l)?r.push(l.toLowerCase()):jy.test(l)?o.push(l):(Kt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=r.indexOf("object");l!==-1&&(r.splice(r,l,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let l=r.pop();n+=`one of type ${r.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();n+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)n+=`. Received an instance of ${i.constructor.name}`;else{let l=lr(i,{depth:-1});n+=`. Received ${l}`}}else{let l=lr(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof i} (${l})`}return n},TypeError);ie("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let n=lr(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${n}`},TypeError);ie("ERR_INVALID_RETURN_VALUE",(e,t,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${e} to be returned from the "${t}" function but got ${r}.`},TypeError);ie("ERR_MISSING_ARGS",(...e)=>{Kt(e.length>0,"At least one arg needs to be specified");let t,i=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),i){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);ie("ERR_OUT_OF_RANGE",(e,t,i)=>{Kt(t,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Hl(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=Hl(n)),n+="n"):n=lr(i),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);ie("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ie("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ie("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ie("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ie("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ie("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ie("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ie("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ie("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ie("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ie("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Gl.exports={AbortError:hs,aggregateTwoErrors:Kl(zy),hideStackFrames:Kl,codes:fr}});var ki=T((Ox,of)=>{"use strict";var{ArrayIsArray:ms,ArrayPrototypeIncludes:Ql,ArrayPrototypeJoin:Zl,ArrayPrototypeMap:Vy,NumberIsInteger:bs,NumberIsNaN:Hy,NumberMAX_SAFE_INTEGER:Ky,NumberMIN_SAFE_INTEGER:Gy,NumberParseInt:Yy,ObjectPrototypeHasOwnProperty:Xy,RegExpPrototypeExec:ef,String:Jy,StringPrototypeToUpperCase:Qy,StringPrototypeTrim:Zy}=q(),{hideStackFrames:Re,codes:{ERR_SOCKET_BAD_PORT:em,ERR_INVALID_ARG_TYPE:oe,ERR_INVALID_ARG_VALUE:xi,ERR_OUT_OF_RANGE:Gt,ERR_UNKNOWN_SIGNAL:Yl}}=ae(),{normalizeEncoding:tm}=re(),{isAsyncFunction:im,isArrayBufferView:nm}=re().types,Xl={};function rm(e){return e===(e|0)}s(rm,"isInt32");function om(e){return e===e>>>0}s(om,"isUint32");var sm=/^[0-7]+$/,am="must be a 32-bit unsigned integer or an octal string";function cm(e,t,i){if(typeof e>"u"&&(e=i),typeof e=="string"){if(ef(sm,e)===null)throw new xi(t,e,am);e=Yy(e,8)}return tf(e,t),e}s(cm,"parseFileMode");var lm=Re((e,t,i=Gy,n=Ky)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);if(e<i||e>n)throw new Gt(t,`>= ${i} && <= ${n}`,e)}),fm=Re((e,t,i=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);if(e<i||e>n)throw new Gt(t,`>= ${i} && <= ${n}`,e)}),tf=Re((e,t,i=!1)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);let n=i?1:0,r=4294967295;if(e<n||e>r)throw new Gt(t,`>= ${n} && <= ${r}`,e)});function gs(e,t){if(typeof e!="string")throw new oe(t,"string",e)}s(gs,"validateString");function um(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)&&Hy(e))throw new Gt(t,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}s(um,"validateNumber");var dm=Re((e,t,i)=>{if(!Ql(i,e)){let r="must be one of: "+Zl(Vy(i,o=>typeof o=="string"?`'${o}'`:Jy(o)),", ");throw new xi(t,e,r)}});function nf(e,t){if(typeof e!="boolean")throw new oe(t,"boolean",e)}s(nf,"validateBoolean");function ys(e,t,i){return e==null||!Xy(e,t)?i:e[t]}s(ys,"getOwnPropertyValueOrDefault");var hm=Re((e,t,i=null)=>{let n=ys(i,"allowArray",!1),r=ys(i,"allowFunction",!1);if(!ys(i,"nullable",!1)&&e===null||!n&&ms(e)||typeof e!="object"&&(!r||typeof e!="function"))throw new oe(t,"Object",e)}),pm=Re((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new oe(t,"a dictionary",e)}),ur=Re((e,t,i=0)=>{if(!ms(e))throw new oe(t,"Array",e);if(e.length<i){let n=`must be longer than ${i}`;throw new xi(t,e,n)}});function ym(e,t){ur(e,t);for(let i=0;i<e.length;i++)gs(e[i],`${t}[${i}]`)}s(ym,"validateStringArray");function mm(e,t){ur(e,t);for(let i=0;i<e.length;i++)nf(e[i],`${t}[${i}]`)}s(mm,"validateBooleanArray");function bm(e,t){ur(e,t);for(let i=0;i<e.length;i++){let n=e[i],r=`${t}[${i}]`;if(n==null)throw new oe(r,"AbortSignal",n);rf(n,r)}}s(bm,"validateAbortSignalArray");function gm(e,t="signal"){if(gs(e,t),Xl[e]===void 0)throw Xl[Qy(e)]!==void 0?new Yl(e+" (signals must use all capital letters)"):new Yl(e)}s(gm,"validateSignalName");var wm=Re((e,t="buffer")=>{if(!nm(e))throw new oe(t,["Buffer","TypedArray","DataView"],e)});function Sm(e,t){let i=tm(t),n=e.length;if(i==="hex"&&n%2!==0)throw new xi("encoding",t,`is invalid for data of length ${n}`)}s(Sm,"validateEncoding");function Em(e,t="Port",i=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&Zy(e).length===0||+e!==+e>>>0||e>65535||e===0&&!i)throw new em(t,e,i);return e|0}s(Em,"validatePort");var rf=Re((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new oe(t,"AbortSignal",e)}),_m=Re((e,t)=>{if(typeof e!="function")throw new oe(t,"Function",e)}),xm=Re((e,t)=>{if(typeof e!="function"||im(e))throw new oe(t,"Function",e)}),km=Re((e,t)=>{if(e!==void 0)throw new oe(t,"undefined",e)});function vm(e,t,i){if(!Ql(i,e))throw new oe(t,`('${Zl(i,"|")}')`,e)}s(vm,"validateUnion");var Fm=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Jl(e,t){if(typeof e>"u"||!ef(Fm,e))throw new xi(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Jl,"validateLinkHeaderFormat");function Im(e){if(typeof e=="string")return Jl(e,"hints"),e;if(ms(e)){let t=e.length,i="";if(t===0)return i;for(let n=0;n<t;n++){let r=e[n];Jl(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(Im,"validateLinkHeaderValue");of.exports={isInt32:rm,isUint32:om,parseFileMode:cm,validateArray:ur,validateStringArray:ym,validateBooleanArray:mm,validateAbortSignalArray:bm,validateBoolean:nf,validateBuffer:wm,validateDictionary:pm,validateEncoding:Sm,validateFunction:_m,validateInt32:fm,validateInteger:lm,validateNumber:um,validateObject:hm,validateOneOf:dm,validatePlainFunction:xm,validatePort:Em,validateSignalName:gm,validateString:gs,validateUint32:tf,validateUndefined:km,validateUnion:vm,validateAbortSignal:rf,validateLinkHeaderValue:Im}});var Pt=T((Tx,lf)=>{var V=lf.exports={},Qe,Ze;function ws(){throw new Error("setTimeout has not been defined")}s(ws,"defaultSetTimout");function Ss(){throw new Error("clearTimeout has not been defined")}s(Ss,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Qe=setTimeout:Qe=ws}catch{Qe=ws}try{typeof clearTimeout=="function"?Ze=clearTimeout:Ze=Ss}catch{Ze=Ss}})();function sf(e){if(Qe===setTimeout)return setTimeout(e,0);if((Qe===ws||!Qe)&&setTimeout)return Qe=setTimeout,setTimeout(e,0);try{return Qe(e,0)}catch{try{return Qe.call(null,e,0)}catch{return Qe.call(this,e,0)}}}s(sf,"runTimeout");function Am(e){if(Ze===clearTimeout)return clearTimeout(e);if((Ze===Ss||!Ze)&&clearTimeout)return Ze=clearTimeout,clearTimeout(e);try{return Ze(e)}catch{try{return Ze.call(null,e)}catch{return Ze.call(this,e)}}}s(Am,"runClearTimeout");var yt=[],vi=!1,Yt,dr=-1;function Om(){!vi||!Yt||(vi=!1,Yt.length?yt=Yt.concat(yt):dr=-1,yt.length&&af())}s(Om,"cleanUpNextTick");function af(){if(!vi){var e=sf(Om);vi=!0;for(var t=yt.length;t;){for(Yt=yt,yt=[];++dr<t;)Yt&&Yt[dr].run();dr=-1,t=yt.length}Yt=null,vi=!1,Am(e)}}s(af,"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 cf(e,t)),yt.length===1&&!vi&&sf(af)};function cf(e,t){this.fun=e,this.array=t}s(cf,"Item");cf.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function mt(){}s(mt,"noop");V.on=mt;V.addListener=mt;V.once=mt;V.off=mt;V.removeListener=mt;V.removeAllListeners=mt;V.emit=mt;V.prependListener=mt;V.prependOnceListener=mt;V.listeners=function(e){return[]};V.binding=function(e){throw new Error("process.binding is not supported")};V.cwd=function(){return"/"};V.chdir=function(e){throw new Error("process.chdir is not supported")};V.umask=function(){return 0}});var tt=T((Lx,kf)=>{"use strict";var{SymbolAsyncIterator:ff,SymbolIterator:uf,SymbolFor:Xt}=q(),df=Xt("nodejs.stream.destroyed"),hf=Xt("nodejs.stream.errored"),Es=Xt("nodejs.stream.readable"),_s=Xt("nodejs.stream.writable"),pf=Xt("nodejs.stream.disturbed"),Pm=Xt("nodejs.webstream.isClosedPromise"),Tm=Xt("nodejs.webstream.controllerErrorFunction");function hr(e,t=!1){var i;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((i=e._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!e._writableState||e._readableState))}s(hr,"isReadableNodeStream");function pr(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}s(pr,"isWritableNodeStream");function Rm(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}s(Rm,"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 yf(e){return!!(e&&!et(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}s(yf,"isReadableStream");function mf(e){return!!(e&&!et(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}s(mf,"isWritableStream");function bf(e){return!!(e&&!et(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}s(bf,"isTransformStream");function Lm(e){return yf(e)||mf(e)||bf(e)}s(Lm,"isWebStream");function Nm(e,t){return e==null?!1:t===!0?typeof e[ff]=="function":t===!1?typeof e[uf]=="function":typeof e[ff]=="function"||typeof e[uf]=="function"}s(Nm,"isIterable");function yr(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!!(e.destroyed||e[df]||n!=null&&n.destroyed)}s(yr,"isDestroyed");function gf(e){if(!pr(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(gf,"isWritableEnded");function Cm(e,t){if(!pr(e))return null;if(e.writableFinished===!0)return!0;let i=e._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||t===!1&&i.ended===!0&&i.length===0)}s(Cm,"isWritableFinished");function Bm(e){if(!hr(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(Bm,"isReadableEnded");function wf(e,t){if(!hr(e))return null;let i=e._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||t===!1&&i.ended===!0&&i.length===0)}s(wf,"isReadableFinished");function Sf(e){return e&&e[Es]!=null?e[Es]:typeof e?.readable!="boolean"?null:yr(e)?!1:hr(e)&&e.readable&&!wf(e)}s(Sf,"isReadable");function Ef(e){return e&&e[_s]!=null?e[_s]:typeof e?.writable!="boolean"?null:yr(e)?!1:pr(e)&&e.writable&&!gf(e)}s(Ef,"isWritable");function Dm(e,t){return et(e)?yr(e)?!0:!(t?.readable!==!1&&Sf(e)||t?.writable!==!1&&Ef(e)):null}s(Dm,"isFinished");function Mm(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(Mm,"isWritableErrored");function Wm(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(Wm,"isReadableErrored");function Um(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"&&_f(e)?e._closed:null}s(Um,"isClosed");function _f(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}s(_f,"isOutgoingMessage");function xf(e){return typeof e._sent100=="boolean"&&_f(e)}s(xf,"isServerResponse");function jm(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(jm,"isServerRequest");function qm(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!n&&xf(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(qm,"willEmitClose");function $m(e){var t;return!!(e&&((t=e[pf])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}s($m,"isDisturbed");function zm(e){var t,i,n,r,o,a,c,l,f,d;return!!(e&&((t=(i=(n=(r=(o=(a=e[hf])!==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(zm,"isErrored");kf.exports={isDestroyed:yr,kIsDestroyed:df,isDisturbed:$m,kIsDisturbed:pf,isErrored:zm,kIsErrored:hf,isReadable:Sf,kIsReadable:Es,kIsClosedPromise:Pm,kControllerErrorFunction:Tm,kIsWritable:_s,isClosed:Um,isDuplexNodeStream:Rm,isFinished:Dm,isIterable:Nm,isReadableNodeStream:hr,isReadableStream:yf,isReadableEnded:Bm,isReadableFinished:wf,isReadableErrored:Wm,isNodeStream:et,isWebStream:Lm,isWritable:Ef,isWritableNodeStream:pr,isWritableStream:mf,isWritableEnded:gf,isWritableFinished:Cm,isWritableErrored:Mm,isServerRequest:jm,isServerResponse:xf,willEmitClose:qm,isTransformStream:bf}});var bt=T((Cx,Is)=>{var Tt=Pt(),{AbortError:Lf,codes:Vm}=ae(),{ERR_INVALID_ARG_TYPE:Hm,ERR_STREAM_PREMATURE_CLOSE:vf}=Vm,{kEmptyObject:ks,once:vs}=re(),{validateAbortSignal:Km,validateFunction:Gm,validateObject:Ym,validateBoolean:Xm}=ki(),{Promise:Jm,PromisePrototypeThen:Qm,SymbolDispose:Nf}=q(),{isClosed:Zm,isReadable:Ff,isReadableNodeStream:xs,isReadableStream:eb,isReadableFinished:If,isReadableErrored:Af,isWritable:Of,isWritableNodeStream:Pf,isWritableStream:tb,isWritableFinished:Tf,isWritableErrored:Rf,isNodeStream:ib,willEmitClose:nb,kIsClosedPromise:rb}=tt(),Fi;function ob(e){return e.setHeader&&typeof e.abort=="function"}s(ob,"isRequest");var Fs=s(()=>{},"nop");function Cf(e,t,i){var n,r;if(arguments.length===2?(i=t,t=ks):t==null?t=ks:Ym(t,"options"),Gm(i,"callback"),Km(t.signal,"options.signal"),i=vs(i),eb(e)||tb(e))return sb(e,t,i);if(!ib(e))throw new Hm("stream",["ReadableStream","WritableStream","Stream"],e);let o=(n=t.readable)!==null&&n!==void 0?n:xs(e),a=(r=t.writable)!==null&&r!==void 0?r:Pf(e),c=e._writableState,l=e._readableState,f=s(()=>{e.writable||b()},"onlegacyfinish"),d=nb(e)&&xs(e)===o&&Pf(e)===a,h=Tf(e,!1),b=s(()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||o))&&(!o||p)&&i.call(e)},"onfinish"),p=If(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=Zm(e),k=s(()=>{A=!0;let B=Rf(e)||Af(e);if(B&&typeof B!="boolean")return i.call(e,B);if(o&&!p&&xs(e,!0)&&!If(e,!1))return i.call(e,new vf);if(a&&!h&&!Tf(e,!1))return i.call(e,new vf);i.call(e)},"onclose"),v=s(()=>{A=!0;let B=Rf(e)||Af(e);if(B&&typeof B!="boolean")return i.call(e,B);i.call(e)},"onclosed"),L=s(()=>{e.req.on("finish",b)},"onrequest");ob(e)?(e.on("complete",b),d||e.on("abort",k),e.req?L():e.on("request",L)):a&&!c&&(e.on("end",f),e.on("close",f)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",w),e.on("finish",b),t.error!==!1&&e.on("error",g),e.on("close",k),A?Tt.nextTick(k):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||Tt.nextTick(v):(!o&&(!d||Ff(e))&&(h||Of(e)===!1)||!a&&(!d||Of(e))&&(p||Ff(e)===!1)||l&&e.req&&e.aborted)&&Tt.nextTick(v);let F=s(()=>{i=Fs,e.removeListener("aborted",k),e.removeListener("complete",b),e.removeListener("abort",k),e.removeListener("request",L),e.req&&e.req.removeListener("finish",b),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",b),e.removeListener("end",w),e.removeListener("error",g),e.removeListener("close",k)},"cleanup");if(t.signal&&!A){let B=s(()=>{let Bt=i;F(),Bt.call(e,new Lf(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)Tt.nextTick(B);else{Fi=Fi||re().addAbortListener;let Bt=Fi(t.signal,B),Ee=i;i=vs((...si)=>{Bt[Nf](),Ee.apply(e,si)})}}return F}s(Cf,"eos");function sb(e,t,i){let n=!1,r=Fs;if(t.signal)if(r=s(()=>{n=!0,i.call(e,new Lf(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)Tt.nextTick(r);else{Fi=Fi||re().addAbortListener;let a=Fi(t.signal,r),c=i;i=vs((...l)=>{a[Nf](),c.apply(e,l)})}let o=s((...a)=>{n||Tt.nextTick(()=>i.apply(e,a))},"resolverFn");return Qm(e[rb].promise,o,o),Fs}s(sb,"eosWeb");function ab(e,t){var i;let n=!1;return t===null&&(t=ks),(i=t)!==null&&i!==void 0&&i.cleanup&&(Xm(t.cleanup,"cleanup"),n=t.cleanup),new Jm((r,o)=>{let a=Cf(e,t,c=>{n&&a(),c?o(c):r()})})}s(ab,"finished");Is.exports=Cf;Is.exports.finished=ab});var Jt=T((Dx,$f)=>{"use strict";var it=Pt(),{aggregateTwoErrors:cb,codes:{ERR_MULTIPLE_CALLBACK:lb},AbortError:fb}=ae(),{Symbol:Mf}=q(),{kIsDestroyed:ub,isDestroyed:db,isFinished:hb,isServerRequest:pb}=tt(),Wf=Mf("kDestroy"),As=Mf("kConstruct");function Uf(e,t,i){e&&(e.stack,t&&!t.errored&&(t.errored=e),i&&!i.errored&&(i.errored=e))}s(Uf,"checkError");function yb(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):(Uf(e,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Bf(this,e,t):this.once(Wf,function(o){Bf(this,cb(o,e),t)}),this)}s(yb,"destroy");function Bf(e,t,i){let n=!1;function r(o){if(n)return;n=!0;let a=e._readableState,c=e._writableState;Uf(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?it.nextTick(mb,e,o):it.nextTick(jf,e)}s(r,"onDestroy");try{e._destroy(t||null,r)}catch(o){r(o)}}s(Bf,"_destroy");function mb(e,t){Os(e,t),jf(e)}s(mb,"emitErrorCloseNT");function jf(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(jf,"emitCloseNT");function Os(e,t){let i=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),e.emit("error",t))}s(Os,"emitErrorNT");function bb(){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(bb,"undestroy");function Ps(e,t,i){let n=e._readableState,r=e._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?e.destroy(t):t&&(t.stack,r&&!r.errored&&(r.errored=t),n&&!n.errored&&(n.errored=t),i?it.nextTick(Os,e,t):Os(e,t))}s(Ps,"errorOrDestroy");function gb(e,t){if(typeof e._construct!="function")return;let i=e._readableState,n=e._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),e.once(As,t),!(e.listenerCount(As)>1)&&it.nextTick(wb,e)}s(gb,"construct");function wb(e){let t=!1;function i(n){if(t){Ps(e,n??new lb);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(Wf,n):n?Ps(e,n,!0):it.nextTick(Sb,e)}s(i,"onConstruct");try{e._construct(n=>{it.nextTick(i,n)})}catch(n){it.nextTick(i,n)}}s(wb,"constructNT");function Sb(e){e.emit(As)}s(Sb,"emitConstructNT");function Df(e){return e?.setHeader&&typeof e.abort=="function"}s(Df,"isRequest");function qf(e){e.emit("close")}s(qf,"emitCloseLegacy");function Eb(e,t){e.emit("error",t),it.nextTick(qf,e)}s(Eb,"emitErrorCloseLegacy");function _b(e,t){!e||db(e)||(!t&&!hb(e)&&(t=new fb),pb(e)?(e.socket=null,e.destroy(t)):Df(e)?e.abort():Df(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?it.nextTick(Eb,e,t):it.nextTick(qf,e),e.destroyed||(e[ub]=!0))}s(_b,"destroyer");$f.exports={construct:gb,destroyer:_b,destroy:yb,undestroy:bb,errorOrDestroy:Ps}});var gr=T((Wx,Vf)=>{"use strict";var{ArrayIsArray:xb,ObjectSetPrototypeOf:zf}=q(),{EventEmitter:mr}=gn();function br(e){mr.call(this,e)}s(br,"Stream");zf(br.prototype,mr.prototype);zf(br,mr);br.prototype.pipe=function(e,t){let i=this;function n(d){e.writable&&e.write(d)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),e.on("drain",r),!e._isStdio&&(!t||t.end!==!1)&&(i.on("end",a),i.on("close",c));let o=!1;function a(){o||(o=!0,e.end())}s(a,"onend");function c(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}s(c,"onclose");function l(d){f(),mr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),Ts(i,"error",l),Ts(e,"error",l);function f(){i.removeListener("data",n),e.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),e.removeListener("error",l),i.removeListener("end",f),i.removeListener("close",f),e.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),e.on("close",f),e.emit("pipe",i),e};function Ts(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):xb(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}s(Ts,"prependListener");Vf.exports={Stream:br,prependListener:Ts}});var wn=T((jx,wr)=>{"use strict";var{SymbolDispose:kb}=q(),{AbortError:Hf,codes:vb}=ae(),{isNodeStream:Kf,isWebStream:Fb,kControllerErrorFunction:Ib}=tt(),Ab=bt(),{ERR_INVALID_ARG_TYPE:Gf}=vb,Rs,Ob=s((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new Gf(t,"AbortSignal",e)},"validateAbortSignal");wr.exports.addAbortSignal=s(function(t,i){if(Ob(t,"signal"),!Kf(i)&&!Fb(i))throw new Gf("stream",["ReadableStream","WritableStream","Stream"],i);return wr.exports.addAbortSignalNoValidate(t,i)},"addAbortSignal");wr.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let i=Kf(t)?()=>{t.destroy(new Hf(void 0,{cause:e.reason}))}:()=>{t[Ib](new Hf(void 0,{cause:e.reason}))};if(e.aborted)i();else{Rs=Rs||re().addAbortListener;let n=Rs(e,i);Ab(t,n[kb])}return t}});var Jf=T(($x,Xf)=>{"use strict";var{StringPrototypeSlice:Yf,SymbolIterator:Pb,TypedArrayPrototypeSet:Sr,Uint8Array:Tb}=q(),{Buffer:Ls}=Ie(),{inspect:Rb}=re(),Ii;Xf.exports=(Ii=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(t){let i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=t+i.data;return n}concat(t){if(this.length===0)return Ls.alloc(0);let i=Ls.allocUnsafe(t>>>0),n=this.head,r=0;for(;n;)Sr(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(t,i){let n=this.head.data;if(t<n.length){let r=n.slice(0,t);return this.head.data=n.slice(t),r}return t===n.length?this.shift():i?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[Pb](){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+=Yf(o,0,t),this.head=n,n.data=Yf(o,t));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(t){let i=Ls.allocUnsafe(t),n=t,r=this.head,o=0;do{let a=r.data;if(t>a.length)Sr(i,a,n-t),t-=a.length;else{t===a.length?(Sr(i,a,n-t),++o,r.next?this.head=r.next:this.head=this.tail=null):(Sr(i,new Tb(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 Rb(this,{...i,depth:0,customInspect:!1})}},s(Ii,"BufferList"),Ii)});var Sn=T((Vx,tu)=>{"use strict";var{MathFloor:Lb,NumberIsInteger:Nb}=q(),{validateInteger:Cb}=ki(),{ERR_INVALID_ARG_VALUE:Bb}=ae().codes,Qf=16*1024,Zf=16;function Db(e,t,i){return e.highWaterMark!=null?e.highWaterMark:t?e[i]:null}s(Db,"highWaterMarkFrom");function eu(e){return e?Zf:Qf}s(eu,"getDefaultHighWaterMark");function Mb(e,t){Cb(t,"value",0),e?Zf=t:Qf=t}s(Mb,"setDefaultHighWaterMark");function Wb(e,t,i,n){let r=Db(t,n,i);if(r!=null){if(!Nb(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Bb(o,r)}return Lb(r)}return eu(e.objectMode)}s(Wb,"getHighWaterMark");tu.exports={getHighWaterMark:Wb,getDefaultHighWaterMark:eu,setDefaultHighWaterMark:Mb}});var ru=T((Ns,nu)=>{var Er=Ie(),nt=Er.Buffer;function iu(e,t){for(var i in e)t[i]=e[i]}s(iu,"copyProps");nt.from&&nt.alloc&&nt.allocUnsafe&&nt.allocUnsafeSlow?nu.exports=Er:(iu(Er,Ns),Ns.Buffer=Qt);function Qt(e,t,i){return nt(e,t,i)}s(Qt,"SafeBuffer");Qt.prototype=Object.create(nt.prototype);iu(nt,Qt);Qt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return nt(e,t,i)};Qt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=nt(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};Qt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return nt(e)};Qt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Er.SlowBuffer(e)}});var au=T(su=>{"use strict";var Bs=ru().Buffer,ou=Bs.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ub(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(Ub,"_normalizeEncoding");function jb(e){var t=Ub(e);if(typeof t!="string"&&(Bs.isEncoding===ou||!ou(e)))throw new Error("Unknown encoding: "+e);return t||e}s(jb,"normalizeEncoding");su.StringDecoder=En;function En(e){this.encoding=jb(e);var t;switch(this.encoding){case"utf16le":this.text=Kb,this.end=Gb,t=4;break;case"utf8":this.fillLast=zb,t=4;break;case"base64":this.text=Yb,this.end=Xb,t=3;break;default:this.write=Jb,this.end=Qb;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bs.allocUnsafe(t)}s(En,"StringDecoder");En.prototype.write=function(e){if(e.length===0)return"";var t,i;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""};En.prototype.end=Hb;En.prototype.text=Vb;En.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Cs(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}s(Cs,"utf8CheckByte");function qb(e,t,i){var n=t.length-1;if(n<i)return 0;var r=Cs(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=Cs(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=Cs(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}s(qb,"utf8CheckIncomplete");function $b(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($b,"utf8CheckExtraBytes");function zb(e){var t=this.lastTotal-this.lastNeed,i=$b(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(zb,"utf8FillLast");function Vb(e,t){var i=qb(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(Vb,"utf8Text");function Hb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}s(Hb,"utf8End");function Kb(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(Kb,"utf16Text");function Gb(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(Gb,"utf16End");function Yb(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(Yb,"base64Text");function Xb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}s(Xb,"base64End");function Jb(e){return e.toString(this.encoding)}s(Jb,"simpleWrite");function Qb(e){return e&&e.length?this.write(e):""}s(Qb,"simpleEnd")});var Ds=T((Xx,uu)=>{"use strict";var cu=Pt(),{PromisePrototypeThen:Zb,SymbolAsyncIterator:lu,SymbolIterator:fu}=q(),{Buffer:eg}=Ie(),{ERR_INVALID_ARG_TYPE:tg,ERR_STREAM_NULL_VALUES:ig}=ae().codes;function ng(e,t,i){let n;if(typeof t=="string"||t instanceof eg)return new e({objectMode:!0,...i,read:s(function(){this.push(t),this.push(null)},"read")});let r;if(t&&t[lu])r=!0,n=t[lu]();else if(t&&t[fu])r=!1,n=t[fu]();else throw new tg("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){Zb(c(f),()=>cu.nextTick(d,f),h=>cu.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 ig;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(ng,"from");uu.exports=ng});var xn=T((Qx,Ou)=>{var Me=Pt(),{ArrayPrototypeIndexOf:rg,NumberIsInteger:og,NumberIsNaN:sg,NumberParseInt:ag,ObjectDefineProperties:Vs,ObjectKeys:cg,ObjectSetPrototypeOf:pu,Promise:yu,SafeSet:lg,SymbolAsyncDispose:fg,SymbolAsyncIterator:ug,Symbol:dg}=q();Ou.exports=O;O.ReadableState=vr;var{EventEmitter:hg}=gn(),{Stream:Rt,prependListener:pg}=gr(),{Buffer:Ms}=Ie(),{addAbortSignal:yg}=wn(),mu=bt(),P=re().debuglog("stream",e=>{P=e}),mg=Jf(),Pi=Jt(),{getHighWaterMark:bg,getDefaultHighWaterMark:gg}=Sn(),{aggregateTwoErrors:du,codes:{ERR_INVALID_ARG_TYPE:wg,ERR_METHOD_NOT_IMPLEMENTED:Sg,ERR_OUT_OF_RANGE:Eg,ERR_STREAM_PUSH_AFTER_EOF:_g,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:xg},AbortError:kg}=ae(),{validateObject:vg}=ki(),Zt=dg("kPaused"),{StringDecoder:bu}=au(),Fg=Ds();pu(O.prototype,Rt.prototype);pu(O,Rt);var Ws=s(()=>{},"nop"),{errorOrDestroy:Ai}=Pi,Oi=1,Ig=2,gu=4,_n=8,wu=16,_r=32,xr=64,Su=128,Ag=256,Og=512,Pg=1024,$s=2048,zs=4096,Tg=8192,Rg=16384,Lg=32768,Eu=65536,Ng=1<<17,Cg=1<<18;function J(e){return{enumerable:!1,get:s(function(){return(this.state&e)!==0},"get"),set:s(function(t){t?this.state|=e:this.state&=~e},"set")}}s(J,"makeBitMapDescriptor");Vs(vr.prototype,{objectMode:J(Oi),ended:J(Ig),endEmitted:J(gu),reading:J(_n),constructed:J(wu),sync:J(_r),needReadable:J(xr),emittedReadable:J(Su),readableListening:J(Ag),resumeScheduled:J(Og),errorEmitted:J(Pg),emitClose:J($s),autoDestroy:J(zs),destroyed:J(Tg),closed:J(Rg),closeEmitted:J(Lg),multiAwaitDrain:J(Eu),readingMore:J(Ng),dataEmitted:J(Cg)});function vr(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.state=$s|zs|wu|_r,e&&e.objectMode&&(this.state|=Oi),i&&e&&e.readableObjectMode&&(this.state|=Oi),this.highWaterMark=e?bg(this,e,"readableHighWaterMark",i):gg(!1),this.buffer=new mg,this.length=0,this.pipes=[],this.flowing=null,this[Zt]=null,e&&e.emitClose===!1&&(this.state&=~$s),e&&e.autoDestroy===!1&&(this.state&=~zs),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new bu(e.encoding),this.encoding=e.encoding)}s(vr,"ReadableState");function O(e){if(!(this instanceof O))return new O(e);let t=this instanceof rt();this._readableState=new vr(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&yg(e.signal,this)),Rt.call(this,e),Pi.construct(this,()=>{this._readableState.needReadable&&kr(this,this._readableState)})}s(O,"Readable");O.prototype.destroy=Pi.destroy;O.prototype._undestroy=Pi.undestroy;O.prototype._destroy=function(e,t){t(e)};O.prototype[hg.captureRejectionSymbol]=function(e){this.destroy(e)};O.prototype[fg]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new kg,this.destroy(e)),new yu((t,i)=>mu(this,n=>n&&n!==e?i(n):t(null)))};O.prototype.push=function(e,t){return _u(this,e,t,!1)};O.prototype.unshift=function(e,t){return _u(this,e,t,!0)};function _u(e,t,i,n){P("readableAddChunk",t);let r=e._readableState,o;if(r.state&Oi||(typeof t=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?t=Ms.from(t,i).toString(r.encoding):(t=Ms.from(t,i),i=""))):t instanceof Ms?i="":Rt._isUint8Array(t)?(t=Rt._uint8ArrayToBuffer(t),i=""):t!=null&&(o=new wg("chunk",["string","Buffer","Uint8Array"],t))),o)Ai(e,o);else if(t===null)r.state&=~_n,Mg(e,r);else if(r.state&Oi||t&&t.length>0)if(n)if(r.state&gu)Ai(e,new xg);else{if(r.destroyed||r.errored)return!1;Us(e,r,t,!0)}else if(r.ended)Ai(e,new _g);else{if(r.destroyed||r.errored)return!1;r.state&=~_n,r.decoder&&!i?(t=r.decoder.write(t),r.objectMode||t.length!==0?Us(e,r,t,!1):kr(e,r)):Us(e,r,t,!1)}else n||(r.state&=~_n,kr(e,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(_u,"readableAddChunk");function Us(e,t,i,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&Eu?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.state&xr&&Fr(e)),kr(e,t)}s(Us,"addChunk");O.prototype.isPaused=function(){let e=this._readableState;return e[Zt]===!0||e.flowing===!1};O.prototype.setEncoding=function(e){let t=new bu(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 Bg=1073741824;function Dg(e){if(e>Bg)throw new Eg("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}s(Dg,"computeNewHighWaterMark");function hu(e,t){return e<=0||t.length===0&&t.ended?0:t.state&Oi?1:sg(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}s(hu,"howMuchToRead");O.prototype.read=function(e){P("read",e),e===void 0?e=NaN:og(e)||(e=ag(e,10));let t=this._readableState,i=e;if(e>t.highWaterMark&&(t.highWaterMark=Dg(e)),e!==0&&(t.state&=~Su),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return P("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?js(this):Fr(this),null;if(e=hu(e,t),e===0&&t.ended)return t.length===0&&js(this),null;let n=(t.state&xr)!==0;if(P("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,P("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,P("reading, ended or constructing",n);else if(n){P("do read"),t.state|=_n|_r,t.length===0&&(t.state|=xr);try{this._read(t.highWaterMark)}catch(o){Ai(this,o)}t.state&=~_r,t.reading||(e=hu(i,t))}let r;return e>0?r=Iu(e,t):r=null,r===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&js(this)),r!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",r)),r};function Mg(e,t){if(P("onEofChunk"),!t.ended){if(t.decoder){let i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?Fr(e):(t.needReadable=!1,t.emittedReadable=!0,xu(e))}}s(Mg,"onEofChunk");function Fr(e){let t=e._readableState;P("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,Me.nextTick(xu,e))}s(Fr,"emitReadable");function xu(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,vu(e)}s(xu,"emitReadable_");function kr(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Me.nextTick(Wg,e,t))}s(kr,"maybeReadMore");function Wg(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(Wg,"maybeReadMore_");O.prototype._read=function(e){throw new Sg("_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 lg(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=Ug(i,e),e.on("drain",l))}s(h,"pause"),i.on("data",b);function b(k){P("ondata");let v=e.write(k);P("dest.write",v),v===!1&&h()}s(b,"ondata");function p(k){if(P("onerror",k),A(),e.removeListener("error",p),e.listenerCount("error")===0){let v=e._writableState||e._readableState;v&&!v.errorEmitted?Ai(e,k):e.emit("error",k)}}s(p,"onerror"),pg(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 Ug(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(Ug,"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=rg(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,i),this)};O.prototype.on=function(e,t){let i=Rt.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,P("on readable",n.length,n.reading),n.length?Fr(this):n.reading||Me.nextTick(jg,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(ku,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(ku,this),t};function ku(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[Zt]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}s(ku,"updateReadableListening");function jg(e){P("readable nexttick read 0"),e.read(0)}s(jg,"nReadingNextTick");O.prototype.resume=function(){let e=this._readableState;return e.flowing||(P("resume"),e.flowing=!e.readableListening,qg(this,e)),e[Zt]=!1,this};function qg(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick($g,e,t))}s(qg,"resume");function $g(e,t){P("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),vu(e),t.flowing&&!t.reading&&e.read(0)}s($g,"resume_");O.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Zt]=!0,this};function vu(e){let t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}s(vu,"flow");O.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{Ai(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let i=cg(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[ug]=function(){return Fu(this)};O.prototype.iterator=function(e){return e!==void 0&&vg(e,"options"),Fu(this,e)};function Fu(e,t){typeof e.read!="function"&&(e=O.wrap(e,{objectMode:!0}));let i=zg(e,t);return i.stream=e,i}s(Fu,"streamToAsyncIterator");async function*zg(e,t){let i=Ws;function n(a){this===e?(i(),i=Ws):i=a}s(n,"next"),e.on("readable",n);let r,o=mu(e,{writable:!1},a=>{r=a?du(r,a):null,i(),i=Ws});try{for(;;){let a=e.destroyed?null:e.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new yu(n)}}}catch(a){throw r=du(r,a),r}finally{(r||t?.destroyOnReturn!==!1)&&(r===void 0||e._readableState.autoDestroy)?Pi.destroyer(e,null):(e.off("readable",n),o())}}s(zg,"createAsyncIterator");Vs(O.prototype,{readable:{__proto__:null,get:s(function(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},"get"),set:s(function(e){this._readableState&&(this._readableState.readable=!!e)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(e){this._readableState&&(this._readableState.flowing=e)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});Vs(vr.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Zt]!==!1},"get"),set:s(function(e){this[Zt]=!!e},"set")}});O._fromList=Iu;function Iu(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(Iu,"fromList");function js(e){let t=e._readableState;P("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Me.nextTick(Vg,t,e))}s(js,"endReadable");function Vg(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(Hg,t);else if(e.autoDestroy){let i=t._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&t.destroy()}}}s(Vg,"endReadableNT");function Hg(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}s(Hg,"endWritableNT");O.from=function(e,t){return Fg(O,e,t)};var qs;function Au(){return qs===void 0&&(qs={}),qs}s(Au,"lazyWebStreams");O.fromWeb=function(e,t){return Au().newStreamReadableFromReadableStream(e,t)};O.toWeb=function(e,t){return Au().newReadableStreamFromStreamReadable(e,t)};O.wrap=function(e,t){var i,n;return new O({objectMode:(i=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&i!==void 0?i:!0,...t,destroy:s(function(r,o){Pi.destroyer(e,r),o(r)},"destroy")}).wrap(e)}});var Tr=T((e0,ju)=>{var ei=Pt(),{ArrayPrototypeSlice:Ru,Error:Kg,FunctionPrototypeSymbolHasInstance:Lu,ObjectDefineProperty:Nu,ObjectDefineProperties:Gg,ObjectSetPrototypeOf:Cu,StringPrototypeToLowerCase:Yg,Symbol:Xg,SymbolHasInstance:Jg}=q();ju.exports=$;$.WritableState=Fn;var{EventEmitter:Qg}=gn(),kn=gr().Stream,{Buffer:Ir}=Ie(),Pr=Jt(),{addAbortSignal:Zg}=wn(),{getHighWaterMark:ew,getDefaultHighWaterMark:tw}=Sn(),{ERR_INVALID_ARG_TYPE:iw,ERR_METHOD_NOT_IMPLEMENTED:nw,ERR_MULTIPLE_CALLBACK:Bu,ERR_STREAM_CANNOT_PIPE:rw,ERR_STREAM_DESTROYED:vn,ERR_STREAM_ALREADY_FINISHED:ow,ERR_STREAM_NULL_VALUES:sw,ERR_STREAM_WRITE_AFTER_END:aw,ERR_UNKNOWN_ENCODING:Du}=ae().codes,{errorOrDestroy:Ti}=Pr;Cu($.prototype,kn.prototype);Cu($,kn);function Gs(){}s(Gs,"nop");var Ri=Xg("kOnFinished");function Fn(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.objectMode=!!(e&&e.objectMode),i&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?ew(this,e,"writableHighWaterMark",i):tw(!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=lw.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Or(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Ri]=[]}s(Fn,"WritableState");function Or(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}s(Or,"resetBuffer");Fn.prototype.getBuffer=s(function(){return Ru(this.buffered,this.bufferedIndex)},"getBuffer");Nu(Fn.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function $(e){let t=this instanceof rt();if(!t&&!Lu($,this))return new $(e);this._writableState=new Fn(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&Zg(e.signal,this)),kn.call(this,e),Pr.construct(this,()=>{let i=this._writableState;i.writing||Xs(this,i),Js(this,i)})}s($,"Writable");Nu($,Jg,{__proto__:null,value:s(function(e){return Lu(this,e)?!0:this!==$?!1:e&&e._writableState instanceof Fn},"value")});$.prototype.pipe=function(){Ti(this,new rw)};function Mu(e,t,i,n){let r=e._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!Ir.isEncoding(i))throw new Du(i);typeof n!="function"&&(n=Gs)}if(t===null)throw new sw;if(!r.objectMode)if(typeof t=="string")r.decodeStrings!==!1&&(t=Ir.from(t,i),i="buffer");else if(t instanceof Ir)i="buffer";else if(kn._isUint8Array(t))t=kn._uint8ArrayToBuffer(t),i="buffer";else throw new iw("chunk",["string","Buffer","Uint8Array"],t);let o;return r.ending?o=new aw:r.destroyed&&(o=new vn("write")),o?(ei.nextTick(n,o),Ti(e,o,!0),o):(r.pendingcb++,cw(e,r,t,i,n))}s(Mu,"_write");$.prototype.write=function(e,t,i){return Mu(this,e,t,i)===!0};$.prototype.cork=function(){this._writableState.corked++};$.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||Xs(this,e))};$.prototype.setDefaultEncoding=s(function(t){if(typeof t=="string"&&(t=Yg(t)),!Ir.isEncoding(t))throw new Du(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function cw(e,t,i,n,r){let o=t.objectMode?1:i.length;t.length+=o;let a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:i,encoding:n,callback:r}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&r!==Gs&&(t.allNoop=!1)):(t.writelen=o,t.writecb=r,t.writing=!0,t.sync=!0,e._write(i,n,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}s(cw,"writeOrBuffer");function Pu(e,t,i,n,r,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new vn("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}s(Pu,"doWrite");function Tu(e,t,i,n){--t.pendingcb,n(i),Ys(t),Ti(e,i)}s(Tu,"onwriteError");function lw(e,t){let i=e._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){Ti(e,new Bu);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,t?(t.stack,i.errored||(i.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?ei.nextTick(Tu,e,i,t,r):Tu(e,i,t,r)):(i.buffered.length>i.bufferedIndex&&Xs(e,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:e,state:i},ei.nextTick(fw,i.afterWriteTickInfo)):Wu(e,i,1,r))}s(lw,"onwrite");function fw({stream:e,state:t,count:i,cb:n}){return t.afterWriteTickInfo=null,Wu(e,t,i,n)}s(fw,"afterWriteTick");function Wu(e,t,i,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));i-- >0;)t.pendingcb--,n();t.destroyed&&Ys(t),Js(e,t)}s(Wu,"afterWrite");function Ys(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:o,callback:a}=e.buffered[r],c=e.objectMode?1:o.length;e.length-=c,a((t=e.errored)!==null&&t!==void 0?t:new vn("write"))}let i=e[Ri].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=e.errored)!==null&&n!==void 0?n:new vn("end"))}Or(e)}s(Ys,"errorBuffer");function Xs(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=t,o=i.length-n;if(!o)return;let a=n;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let c=t.allNoop?Gs:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=t.allNoop&&a===0?i:Ru(i,a);l.allBuffers=t.allBuffers,Pu(e,t,!0,t.length,l,"",c),Or(t)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=r?1:c.length;Pu(e,t,!1,d,c,l,f)}while(a<i.length&&!t.writing);a===i.length?Or(t):a>256?(i.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}s(Xs,"clearBuffer");$.prototype._write=function(e,t,i){if(this._writev)this._writev([{chunk:e,encoding:t}],i);else throw new nw("_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=Mu(this,e,t);o instanceof Kg&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Js(this,n,!0),n.ended=!0):n.finished?r=new ow("end"):n.destroyed&&(r=new vn("end"))),typeof i=="function"&&(r||n.finished?ei.nextTick(i,r):n[Ri].push(i)),this};function Ar(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}s(Ar,"needFinish");function uw(e,t){let i=!1;function n(r){if(i){Ti(e,r??Bu());return}if(i=!0,t.pendingcb--,r){let o=t[Ri].splice(0);for(let a=0;a<o.length;a++)o[a](r);Ti(e,r,t.sync)}else Ar(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,ei.nextTick(Ks,e,t))}s(n,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(n)}catch(r){n(r)}t.sync=!1}s(uw,"callFinal");function dw(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,uw(e,t)):(t.prefinished=!0,e.emit("prefinish")))}s(dw,"prefinish");function Js(e,t,i){Ar(t)&&(dw(e,t),t.pendingcb===0&&(i?(t.pendingcb++,ei.nextTick((n,r)=>{Ar(r)?Ks(n,r):r.pendingcb--},e,t)):Ar(t)&&(t.pendingcb++,Ks(e,t))))}s(Js,"finishMaybe");function Ks(e,t){t.pendingcb--,t.finished=!0;let i=t[Ri].splice(0);for(let n=0;n<i.length;n++)i[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}s(Ks,"finish");Gg($.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 hw=Pr.destroy;$.prototype.destroy=function(e,t){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ri].length)&&ei.nextTick(Ys,i),hw.call(this,e,t),this};$.prototype._undestroy=Pr.undestroy;$.prototype._destroy=function(e,t){t(e)};$.prototype[Qg.captureRejectionSymbol]=function(e){this.destroy(e)};var Hs;function Uu(){return Hs===void 0&&(Hs={}),Hs}s(Uu,"lazyWebStreams");$.fromWeb=function(e,t){return Uu().newStreamWritableFromWritableStream(e,t)};$.toWeb=function(e){return Uu().newWritableStreamFromStreamWritable(e)}});var id=T((i0,td)=>{var Qs=Pt(),pw=Ie(),{isReadable:yw,isWritable:mw,isIterable:qu,isNodeStream:bw,isReadableNodeStream:$u,isWritableNodeStream:zu,isDuplexNodeStream:gw,isReadableStream:Vu,isWritableStream:Hu}=tt(),Ku=bt(),{AbortError:Zu,codes:{ERR_INVALID_ARG_TYPE:ww,ERR_INVALID_RETURN_VALUE:Gu}}=ae(),{destroyer:Ni}=Jt(),Sw=rt(),ed=xn(),Ew=Tr(),{createDeferredPromise:Yu}=re(),Xu=Ds(),Ju=globalThis.Blob||pw.Blob,_w=s(typeof Ju<"u"?function(t){return t instanceof Ju}:function(t){return!1},"isBlob"),xw=globalThis.AbortController||Ei().AbortController,{FunctionPrototypeCall:Qu}=q(),Zs=class Zs extends Sw{constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(Zs,"Duplexify");var Lt=Zs;td.exports=s(function e(t,i){if(gw(t))return t;if($u(t))return Li({readable:t});if(zu(t))return Li({writable:t});if(bw(t))return Li({writable:!1,readable:!1});if(Vu(t))return Li({readable:ed.fromWeb(t)});if(Hu(t))return Li({writable:Ew.fromWeb(t)});if(typeof t=="function"){let{value:r,write:o,final:a,destroy:c}=kw(t);if(qu(r))return Xu(Lt,r,{objectMode:!0,write:o,final:a,destroy:c});let l=r?.then;if(typeof l=="function"){let f,d=Qu(l,r,h=>{if(h!=null)throw new Gu("nully","body",h)},h=>{Ni(f,h)});return f=new Lt({objectMode:!0,readable:!1,write:o,final:s(function(h){a(async()=>{try{await d,Qs.nextTick(h,null)}catch(b){Qs.nextTick(h,b)}})},"final"),destroy:c})}throw new Gu("Iterable, AsyncIterable or AsyncFunction",i,r)}if(_w(t))return e(t.arrayBuffer());if(qu(t))return Xu(Lt,t,{objectMode:!0,writable:!1});if(Vu(t?.readable)&&Hu(t?.writable))return Lt.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let r=t!=null&&t.readable?$u(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?zu(t?.writable)?t?.writable:e(t.writable):void 0;return Li({readable:r,writable:o})}let n=t?.then;if(typeof n=="function"){let r;return Qu(n,t,o=>{o!=null&&r.push(o),r.push(null)},o=>{Ni(r,o)}),r=new Lt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new ww(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function kw(e){let{promise:t,resolve:i}=Yu(),n=new xw,r=n.signal;return{value:e(async function*(){for(;;){let a=t;t=null;let{chunk:c,done:l,cb:f}=await a;if(Qs.nextTick(f),l)return;if(r.aborted)throw new Zu(void 0,{cause:r.reason});({promise:t,resolve:i}=Yu()),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(kw,"fromAsyncGen");function Li(e){let t=e.readable&&typeof e.readable.read!="function"?ed.wrap(e.readable):e.readable,i=e.writable,n=!!yw(t),r=!!mw(i),o,a,c,l,f;function d(h){let b=l;l=null,b?b(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Lt({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(Ku(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&&(Ku(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 Zu),c=null,o=null,a=null,l===null?b(h):(l=b,Ni(i,h),Ni(t,h))},f}s(Li,"_duplexify")});var rt=T((r0,od)=>{"use strict";var{ObjectDefineProperties:vw,ObjectGetOwnPropertyDescriptor:gt,ObjectKeys:Fw,ObjectSetPrototypeOf:nd}=q();od.exports=We;var ia=xn(),Le=Tr();nd(We.prototype,ia.prototype);nd(We,ia);{let e=Fw(Le.prototype);for(let t=0;t<e.length;t++){let i=e[t];We.prototype[i]||(We.prototype[i]=Le.prototype[i])}}function We(e){if(!(this instanceof We))return new We(e);ia.call(this,e),Le.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(We,"Duplex");vw(We.prototype,{writable:{__proto__:null,...gt(Le.prototype,"writable")},writableHighWaterMark:{__proto__:null,...gt(Le.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...gt(Le.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...gt(Le.prototype,"writableBuffer")},writableLength:{__proto__:null,...gt(Le.prototype,"writableLength")},writableFinished:{__proto__:null,...gt(Le.prototype,"writableFinished")},writableCorked:{__proto__:null,...gt(Le.prototype,"writableCorked")},writableEnded:{__proto__:null,...gt(Le.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...gt(Le.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")}});var ea;function rd(){return ea===void 0&&(ea={}),ea}s(rd,"lazyWebStreams");We.fromWeb=function(e,t){return rd().newStreamDuplexFromReadableWritablePair(e,t)};We.toWeb=function(e){return rd().newReadableWritablePairFromDuplex(e)};var ta;We.from=function(e){return ta||(ta=id()),ta(e,"body")}});var oa=T((s0,ad)=>{"use strict";var{ObjectSetPrototypeOf:sd,Symbol:Iw}=q();ad.exports=wt;var{ERR_METHOD_NOT_IMPLEMENTED:Aw}=ae().codes,ra=rt(),{getHighWaterMark:Ow}=Sn();sd(wt.prototype,ra.prototype);sd(wt,ra);var In=Iw("kCallback");function wt(e){if(!(this instanceof wt))return new wt(e);let t=e?Ow(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),ra.call(this,e),this._readableState.sync=!1,this[In]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Pw)}s(wt,"Transform");function na(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,i)=>{if(t){e?e(t):this.destroy(t);return}i!=null&&this.push(i),this.push(null),e&&e()}):(this.push(null),e&&e())}s(na,"final");function Pw(){this._final!==na&&na.call(this)}s(Pw,"prefinish");wt.prototype._final=na;wt.prototype._transform=function(e,t,i){throw new Aw("_transform()")};wt.prototype._write=function(e,t,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(e,t,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),r.ended||o===n.length||n.length<n.highWaterMark?i():this[In]=i})};wt.prototype._read=function(){if(this[In]){let e=this[In];this[In]=null,e()}}});var aa=T((c0,ld)=>{"use strict";var{ObjectSetPrototypeOf:cd}=q();ld.exports=Ci;var sa=oa();cd(Ci.prototype,sa.prototype);cd(Ci,sa);function Ci(e){if(!(this instanceof Ci))return new Ci(e);sa.call(this,e)}s(Ci,"PassThrough");Ci.prototype._transform=function(e,t,i){i(null,e)}});var Cr=T((f0,pd)=>{var An=Pt(),{ArrayIsArray:Tw,Promise:Rw,SymbolAsyncIterator:Lw,SymbolDispose:Nw}=q(),Nr=bt(),{once:Cw}=re(),Bw=Jt(),fd=rt(),{aggregateTwoErrors:Dw,codes:{ERR_INVALID_ARG_TYPE:ma,ERR_INVALID_RETURN_VALUE:ca,ERR_MISSING_ARGS:Mw,ERR_STREAM_DESTROYED:Ww,ERR_STREAM_PREMATURE_CLOSE:Uw},AbortError:jw}=ae(),{validateFunction:qw,validateAbortSignal:$w}=ki(),{isIterable:ti,isReadable:la,isReadableNodeStream:Lr,isNodeStream:ud,isTransformStream:Bi,isWebStream:zw,isReadableStream:fa,isReadableFinished:Vw}=tt(),Hw=globalThis.AbortController||Ei().AbortController,ua,da,ha;function dd(e,t,i){let n=!1;e.on("close",()=>{n=!0});let r=Nr(e,{readable:t,writable:i},o=>{n=!o});return{destroy:s(o=>{n||(n=!0,Bw.destroyer(e,o||new Ww("pipe")))},"destroy"),cleanup:r}}s(dd,"destroyer");function Kw(e){return qw(e[e.length-1],"streams[stream.length - 1]"),e.pop()}s(Kw,"popCallback");function pa(e){if(ti(e))return e;if(Lr(e))return Gw(e);throw new ma("val",["Readable","Iterable","AsyncIterable"],e)}s(pa,"makeAsyncIterable");async function*Gw(e){da||(da=xn()),yield*da.prototype[Lw].call(e)}s(Gw,"fromReadable");async function Rr(e,t,i,{end:n}){let r,o=null,a=s(f=>{if(f&&(r=f),o){let d=o;o=null,d()}},"resume"),c=s(()=>new Rw((f,d)=>{r?d(r):o=s(()=>{r?d(r):f()},"onresolve")}),"wait");t.on("drain",a);let l=Nr(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(let f of e)t.write(f)||await c();n&&(t.end(),await c()),i()}catch(f){i(r!==f?Dw(r,f):f)}finally{l(),t.off("drain",a)}}s(Rr,"pumpToNode");async function ya(e,t,i,{end:n}){Bi(t)&&(t=t.writable);let r=t.getWriter();try{for await(let o of e)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(ya,"pumpToWeb");function Yw(...e){return hd(e,Cw(Kw(e)))}s(Yw,"pipeline");function hd(e,t,i){if(e.length===1&&Tw(e[0])&&(e=e[0]),e.length<2)throw new Mw("streams");let n=new Hw,r=n.signal,o=i?.signal,a=[];$w(o,"options.signal");function c(){w(new jw)}s(c,"abort"),ha=ha||re().addAbortListener;let l;o&&(l=ha(o,c));let f,d,h=[],b=0;function p(L){w(L,--b===0)}s(p,"finish");function w(L,F){var B;if(L&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=L),!(!f&&!F)){for(;h.length;)h.shift()(f);(B=l)===null||B===void 0||B[Nw](),n.abort(),F&&(f||a.forEach(Bt=>Bt()),An.nextTick(t,f,d))}}s(w,"finishImpl");let g;for(let L=0;L<e.length;L++){let F=e[L],B=L<e.length-1,Bt=L>0,Ee=B||i?.end!==!1,si=L===e.length-1;if(ud(F)){let le=function(at){at&&at.name!=="AbortError"&&at.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(at)};var v=le;if(s(le,"onError"),Ee){let{destroy:at,cleanup:ro}=dd(F,B,Bt);h.push(at),la(F)&&si&&a.push(ro)}F.on("error",le),la(F)&&si&&a.push(()=>{F.removeListener("error",le)})}if(L===0)if(typeof F=="function"){if(g=F({signal:r}),!ti(g))throw new ca("Iterable, AsyncIterable or Stream","source",g)}else ti(F)||Lr(F)||Bi(F)?g=F:g=fd.from(F);else if(typeof F=="function"){if(Bi(g)){var A;g=pa((A=g)===null||A===void 0?void 0:A.readable)}else g=pa(g);if(g=F(g,{signal:r}),B){if(!ti(g,!0))throw new ca("AsyncIterable",`transform[${L-1}]`,g)}else{var k;ua||(ua=aa());let le=new ua({objectMode:!0}),at=(k=g)===null||k===void 0?void 0:k.then;if(typeof at=="function")b++,at.call(g,Et=>{d=Et,Et!=null&&le.write(Et),Ee&&le.end(),An.nextTick(p)},Et=>{le.destroy(Et),An.nextTick(p,Et)});else if(ti(g,!0))b++,Rr(g,le,p,{end:Ee});else if(fa(g)||Bi(g)){let Et=g.readable||g;b++,Rr(Et,le,p,{end:Ee})}else throw new ca("AsyncIterable or Promise","destination",g);g=le;let{destroy:ro,cleanup:$h}=dd(g,!1,!0);h.push(ro),si&&a.push($h)}}else if(ud(F)){if(Lr(g)){b+=2;let le=Xw(g,F,p,{end:Ee});la(F)&&si&&a.push(le)}else if(Bi(g)||fa(g)){let le=g.readable||g;b++,Rr(le,F,p,{end:Ee})}else if(ti(g))b++,Rr(g,F,p,{end:Ee});else throw new ma("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else if(zw(F)){if(Lr(g))b++,ya(pa(g),F,p,{end:Ee});else if(fa(g)||ti(g))b++,ya(g,F,p,{end:Ee});else if(Bi(g))b++,ya(g.readable,F,p,{end:Ee});else throw new ma("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else g=fd.from(F)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&An.nextTick(c),g}s(hd,"pipelineImpl");function Xw(e,t,i,{end:n}){let r=!1;if(t.on("close",()=>{r||i(new Uw)}),e.pipe(t,{end:!1}),n){let a=function(){r=!0,t.end()};var o=a;s(a,"endFn"),Vw(e)?An.nextTick(a):e.once("end",a)}else i();return Nr(e,{readable:!0,writable:!1},a=>{let c=e._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?e.once("end",i).once("error",i):i(a)}),Nr(t,{readable:!1,writable:!0},i)}s(Xw,"pipe");pd.exports={pipelineImpl:hd,pipeline:Yw}});var ga=T((d0,Sd)=>{"use strict";var{pipeline:Jw}=Cr(),Br=rt(),{destroyer:Qw}=Jt(),{isNodeStream:Dr,isReadable:yd,isWritable:md,isWebStream:ba,isTransformStream:ii,isWritableStream:bd,isReadableStream:gd}=tt(),{AbortError:Zw,codes:{ERR_INVALID_ARG_VALUE:wd,ERR_MISSING_ARGS:eS}}=ae(),tS=bt();Sd.exports=s(function(...t){if(t.length===0)throw new eS("streams");if(t.length===1)return Br.from(t[0]);let i=[...t];if(typeof t[0]=="function"&&(t[0]=Br.from(t[0])),typeof t[t.length-1]=="function"){let p=t.length-1;t[p]=Br.from(t[p])}for(let p=0;p<t.length;++p)if(!(!Dr(t[p])&&!ba(t[p]))){if(p<t.length-1&&!(yd(t[p])||gd(t[p])||ii(t[p])))throw new wd(`streams[${p}]`,i[p],"must be readable");if(p>0&&!(md(t[p])||bd(t[p])||ii(t[p])))throw new wd(`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=Jw(t,l),h=!!(md(f)||bd(f)||ii(f)),b=!!(yd(d)||gd(d)||ii(d));if(c=new Br({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Dr(f))c._write=function(w,g,A){f.write(w,g)?A():n=A},c._final=function(w){f.end(),r=w},f.on("drain",function(){if(n){let w=n;n=null,w()}});else if(ba(f)){let g=(ii(f)?f.writable:f).getWriter();c._write=async function(A,k,v){try{await g.ready,g.write(A).catch(()=>{}),v()}catch(L){v(L)}},c._final=async function(A){try{await g.ready,g.close().catch(()=>{}),r=A}catch(k){A(k)}}}let p=ii(d)?d.readable:d;tS(p,()=>{if(r){let w=r;r=null,w()}})}if(b){if(Dr(d))d.on("readable",function(){if(o){let p=o;o=null,p()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let p=d.read();if(p===null){o=c._read;return}if(!c.push(p))return}};else if(ba(d)){let w=(ii(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:A}=await w.read();if(!c.push(g))return;if(A){c.push(null);return}}catch{return}}}}return c._destroy=function(p,w){!p&&a!==null&&(p=new Zw),o=null,n=null,r=null,a===null?w(p):(a=w,Dr(d)&&Qw(d,p))},c},"compose")});var Pd=T((p0,Ea)=>{"use strict";var iS=globalThis.AbortController||Ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:nS,ERR_INVALID_ARG_TYPE:On,ERR_MISSING_ARGS:rS,ERR_OUT_OF_RANGE:oS},AbortError:ot}=ae(),{validateAbortSignal:ni,validateInteger:Ed,validateObject:ri}=ki(),sS=q().Symbol("kWeak"),aS=q().Symbol("kResistStopPropagation"),{finished:cS}=bt(),lS=ga(),{addAbortSignalNoValidate:fS}=wn(),{isWritable:uS,isNodeStream:dS}=tt(),{deprecate:hS}=re(),{ArrayPrototypePush:pS,Boolean:yS,MathFloor:_d,Number:mS,NumberIsNaN:bS,Promise:xd,PromiseReject:kd,PromiseResolve:gS,PromisePrototypeThen:vd,Symbol:Id}=q(),Mr=Id("kEmpty"),Fd=Id("kEof");function wS(e,t){if(t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),dS(e)&&!uS(e))throw new nS("stream",e,"must be writable");let i=lS(this,e);return t!=null&&t.signal&&fS(t.signal,i),i}s(wS,"compose");function Wr(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal");let i=1;t?.concurrency!=null&&(i=_d(t.concurrency));let n=i-1;return t?.highWaterMark!=null&&(n=_d(t.highWaterMark)),Ed(i,"options.concurrency",1),Ed(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=re().AbortSignalAny([t?.signal].filter(yS)),a=this,c=[],l={signal:o},f,d,h=!1,b=0;function p(){h=!0,w()}s(p,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&b<i&&c.length<n&&(d(),d=null)}s(g,"maybeResume");async function A(){try{for await(let k of a){if(h)return;if(o.aborted)throw new ot;try{if(k=e(k,l),k===Mr)continue;k=gS(k)}catch(v){k=kd(v)}b+=1,vd(k,w,p),c.push(k),f&&(f(),f=null),!h&&(c.length>=n||b>=i)&&await new xd(v=>{d=v})}c.push(Fd)}catch(k){let v=kd(k);vd(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===Fd)return;if(o.aborted)throw new ot;k!==Mr&&(yield k),c.shift(),g()}await new xd(k=>{f=k})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(Wr,"map");function SS(e=void 0){return e!=null&&ri(e,"options"),e?.signal!=null&&ni(e.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new ot({cause:e.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(SS,"asIndexedPairs");async function Ad(e,t=void 0){for await(let i of Sa.call(this,e,t))return!0;return!1}s(Ad,"some");async function ES(e,t=void 0){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);return!await Ad.call(this,async(...i)=>!await e(...i),t)}s(ES,"every");async function _S(e,t){for await(let i of Sa.call(this,e,t))return i}s(_S,"find");async function xS(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r),Mr}s(i,"forEachFn");for await(let n of Wr.call(this,i,t));}s(xS,"forEach");function Sa(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r)?n:Mr}return s(i,"filterFn"),Wr.call(this,i,t)}s(Sa,"filter");var _a=class _a extends rS{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(_a,"ReduceAwareErrMissingArgs");var wa=_a;async function kS(e,t,i){var n;if(typeof e!="function")throw new On("reducer",["Function","AsyncFunction"],e);i!=null&&ri(i,"options"),i?.signal!=null&&ni(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let f=new ot(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await cS(this.destroy(f)),f}let o=new iS,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[sS]:this,[aS]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let c=!1;try{for await(let f of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new ot;r?t=await e(t,f,{signal:a}):(t=f,r=!0)}if(!c&&!r)throw new wa}finally{o.abort()}return t}s(kS,"reduce");async function vS(e){e!=null&&ri(e,"options"),e?.signal!=null&&ni(e.signal,"options.signal");let t=[];for await(let n of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new ot(void 0,{cause:e.signal.reason});pS(t,n)}return t}s(vS,"toArray");function FS(e,t){let i=Wr.call(this,e,t);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(FS,"flatMap");function Od(e){if(e=mS(e),bS(e))return 0;if(e<0)throw new oS("number",">= 0",e);return e}s(Od,"toIntegerOrInfinity");function IS(e,t=void 0){return t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),e=Od(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(IS,"drop");function AS(e,t=void 0){return t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),e=Od(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(AS,"take");Ea.exports.streamReturningOperators={asIndexedPairs:hS(SS,"readable.asIndexedPairs will be removed in a future version."),drop:IS,filter:Sa,flatMap:FS,map:Wr,take:AS,compose:wS};Ea.exports.promiseReturningOperators={every:ES,forEach:xS,reduce:kS,toArray:vS,some:Ad,find:_S}});var xa=T((m0,Td)=>{"use strict";var{ArrayPrototypePop:OS,Promise:PS}=q(),{isIterable:TS,isNodeStream:RS,isWebStream:LS}=tt(),{pipelineImpl:NS}=Cr(),{finished:CS}=bt();ka();function BS(...e){return new PS((t,i)=>{let n,r,o=e[e.length-1];if(o&&typeof o=="object"&&!RS(o)&&!TS(o)&&!LS(o)){let a=OS(e);n=a.signal,r=a.end}NS(e,(a,c)=>{a?i(a):t(c)},{signal:n,end:r})})}s(BS,"pipeline");Td.exports={finished:CS,pipeline:BS}});var ka=T((g0,Ud)=>{var{Buffer:DS}=Ie(),{ObjectDefineProperty:St,ObjectKeys:Nd,ReflectApply:Cd}=q(),{promisify:{custom:Bd}}=re(),{streamReturningOperators:Rd,promiseReturningOperators:Ld}=Pd(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Dd}}=ae(),MS=ga(),{setDefaultHighWaterMark:WS,getDefaultHighWaterMark:US}=Sn(),{pipeline:Md}=Cr(),{destroyer:jS}=Jt(),Wd=bt(),va=xa(),Pn=tt(),C=Ud.exports=gr().Stream;C.isDestroyed=Pn.isDestroyed;C.isDisturbed=Pn.isDisturbed;C.isErrored=Pn.isErrored;C.isReadable=Pn.isReadable;C.isWritable=Pn.isWritable;C.Readable=xn();for(let e of Nd(Rd)){let i=function(...n){if(new.target)throw Dd();return C.Readable.from(Cd(t,this,n))};Fa=i,s(i,"fn");let t=Rd[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fa;for(let e of Nd(Ld)){let i=function(...r){if(new.target)throw Dd();return Cd(t,this,r)};Fa=i,s(i,"fn");let t=Ld[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fa;C.Writable=Tr();C.Duplex=rt();C.Transform=oa();C.PassThrough=aa();C.pipeline=Md;var{addAbortSignal:qS}=wn();C.addAbortSignal=qS;C.finished=Wd;C.destroy=jS;C.compose=MS;C.setDefaultHighWaterMark=WS;C.getDefaultHighWaterMark=US;St(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return va},"get")});St(Md,Bd,{__proto__:null,enumerable:!0,get:s(function(){return va.pipeline},"get")});St(Wd,Bd,{__proto__:null,enumerable:!0,get:s(function(){return va.finished},"get")});C.Stream=C;C._isUint8Array=s(function(t){return t instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(t){return DS.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var jd=T((S0,H)=>{"use strict";var Q=ka(),$S=xa(),zS=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=zS;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return $S},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var oE={};Un(oE,{Async:()=>Va,AsyncTransaction:()=>$o,BigIntStats:()=>be,BigIntStatsFs:()=>on,Dir:()=>Ot,Dirent:()=>At,Errno:()=>U,ErrnoError:()=>u,Fetch:()=>eE,FetchFS:()=>Zr,File:()=>qt,FileSystem:()=>pe,InMemory:()=>dn,InMemoryStore:()=>Xn,Index:()=>Jr,IndexFS:()=>Mn,Inode:()=>Ge,MutexLock:()=>to,Mutexed:()=>ec,NoSyncFile:()=>mi,Overlay:()=>iE,OverlayFS:()=>Wn,Port:()=>JS,PortFS:()=>Xr,PortFile:()=>Bn,PreloadFile:()=>we,ReadStream:()=>Nt,Readonly:()=>Ja,SimpleAsyncStore:()=>Ko,SimpleTransaction:()=>bi,Stats:()=>G,StatsCommon:()=>nn,StatsFs:()=>rn,StoreFS:()=>ln,Sync:()=>nE,SyncTransaction:()=>un,Transaction:()=>fn,UnmutexedOverlayFS:()=>no,WriteStream:()=>Ct,ZenFsType:()=>Ro,_InMemory:()=>al,_Port:()=>jh,__MutexedFS:()=>io,_toUnixTimestamp:()=>ip,access:()=>Eh,accessSync:()=>Fl,appendFile:()=>Jd,appendFileSync:()=>dl,attachFS:()=>Uh,checkOptions:()=>lo,chmod:()=>mh,chmodSync:()=>xl,chown:()=>ph,chownSync:()=>El,close:()=>Zd,closeSync:()=>It,configure:()=>KS,configureSingle:()=>HS,constants:()=>kt,copyFile:()=>Oh,copyFileSync:()=>os,cp:()=>Lh,cpSync:()=>ss,createReadStream:()=>vh,createWriteStream:()=>Fh,credentials:()=>ye,decode:()=>ai,decodeDirListing:()=>$n,default:()=>rE,detachFS:()=>XS,encode:()=>Ne,encodeDirListing:()=>xe,errorMessages:()=>ao,exists:()=>$d,existsSync:()=>Je,fchmod:()=>sh,fchmodSync:()=>nr,fchown:()=>oh,fchownSync:()=>ir,fdatasync:()=>ih,fdatasyncSync:()=>ml,flagToMode:()=>sn,flagToNumber:()=>my,flagToString:()=>ol,fs:()=>Cn,fstat:()=>Qd,fstatSync:()=>hl,fsync:()=>th,fsyncSync:()=>yl,ftruncate:()=>eh,ftruncateSync:()=>pl,futimes:()=>ah,futimesSync:()=>rr,handleRequest:()=>Dn,isAppendable:()=>pt,isBackend:()=>Vi,isBackendConfig:()=>Hi,isExclusive:()=>cn,isReadable:()=>vt,isStatsEqual:()=>To,isSynchronous:()=>by,isTruncating:()=>an,isWriteable:()=>ge,lchmod:()=>bh,lchmodSync:()=>kl,lchown:()=>yh,lchownSync:()=>_l,levenshtein:()=>co,link:()=>uh,linkSync:()=>wl,lopenSync:()=>mn,lstat:()=>Vd,lstatSync:()=>es,lutimes:()=>wh,lutimesSync:()=>vl,mkdir:()=>lh,mkdirSync:()=>or,mkdirpSync:()=>pc,mkdtemp:()=>Ah,mkdtempSync:()=>Il,mount:()=>zt,mountObject:()=>pn,mounts:()=>Pe,normalizeMode:()=>ke,normalizeOptions:()=>ve,normalizePath:()=>x,normalizeTime:()=>Wt,open:()=>Gd,openAsBlob:()=>Ch,openSync:()=>yn,opendir:()=>Rh,opendirSync:()=>Pl,parseFlag:()=>M,promises:()=>Nn,randomIno:()=>tn,read:()=>rh,readFile:()=>Yd,readFileSync:()=>tr,readSync:()=>gl,readdir:()=>fh,readdirSync:()=>Si,readlink:()=>hh,readlinkSync:()=>is,readv:()=>Ph,readvSync:()=>Al,realpath:()=>Sh,realpathSync:()=>Xe,rename:()=>qd,renameSync:()=>ll,resolveMountConfig:()=>Ui,resolveRemoteMount:()=>QS,rm:()=>Ih,rmSync:()=>rs,rmdir:()=>ch,rmdirSync:()=>ts,rootCredentials:()=>np,rootIno:()=>Ye,setImmediate:()=>tp,size_max:()=>Oe,stat:()=>zd,statSync:()=>Te,statfs:()=>Nh,statfsSync:()=>Tl,symlink:()=>dh,symlinkSync:()=>Sl,truncate:()=>Hd,truncateSync:()=>fl,umount:()=>gi,unlink:()=>Kd,unlinkSync:()=>er,unwatchFile:()=>xh,utimes:()=>gh,utimesSync:()=>ns,version:()=>Qa,watch:()=>kh,watchFile:()=>_h,write:()=>nh,writeFile:()=>Xd,writeFileSync:()=>bn,writeSync:()=>bl,writev:()=>Th,writevSync:()=>Ol});var U=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EINTR=4]="EINTR",y[y.EIO=5]="EIO",y[y.ENXIO=6]="ENXIO",y[y.EBADF=9]="EBADF",y[y.EAGAIN=11]="EAGAIN",y[y.ENOMEM=12]="ENOMEM",y[y.EACCES=13]="EACCES",y[y.EFAULT=14]="EFAULT",y[y.ENOTBLK=15]="ENOTBLK",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.EXDEV=18]="EXDEV",y[y.ENODEV=19]="ENODEV",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.ENFILE=23]="ENFILE",y[y.EMFILE=24]="EMFILE",y[y.ETXTBSY=26]="ETXTBSY",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.ESPIPE=29]="ESPIPE",y[y.EROFS=30]="EROFS",y[y.EMLINK=31]="EMLINK",y[y.EPIPE=32]="EPIPE",y[y.EDOM=33]="EDOM",y[y.ERANGE=34]="ERANGE",y[y.EDEADLK=35]="EDEADLK",y[y.ENAMETOOLONG=36]="ENAMETOOLONG",y[y.ENOLCK=37]="ENOLCK",y[y.ENOSYS=38]="ENOSYS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ELOOP=40]="ELOOP",y[y.ENOMSG=42]="ENOMSG",y[y.EBADE=52]="EBADE",y[y.EBADR=53]="EBADR",y[y.EXFULL=54]="EXFULL",y[y.ENOANO=55]="ENOANO",y[y.EBADRQC=56]="EBADRQC",y[y.ENOSTR=60]="ENOSTR",y[y.ENODATA=61]="ENODATA",y[y.ETIME=62]="ETIME",y[y.ENOSR=63]="ENOSR",y[y.ENONET=64]="ENONET",y[y.EREMOTE=66]="EREMOTE",y[y.ENOLINK=67]="ENOLINK",y[y.ECOMM=70]="ECOMM",y[y.EPROTO=71]="EPROTO",y[y.EBADMSG=74]="EBADMSG",y[y.EOVERFLOW=75]="EOVERFLOW",y[y.EBADFD=77]="EBADFD",y[y.ESTRPIPE=86]="ESTRPIPE",y[y.ENOTSOCK=88]="ENOTSOCK",y[y.EDESTADDRREQ=89]="EDESTADDRREQ",y[y.EMSGSIZE=90]="EMSGSIZE",y[y.EPROTOTYPE=91]="EPROTOTYPE",y[y.ENOPROTOOPT=92]="ENOPROTOOPT",y[y.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",y[y.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",y[y.ENOTSUP=95]="ENOTSUP",y[y.ENETDOWN=100]="ENETDOWN",y[y.ENETUNREACH=101]="ENETUNREACH",y[y.ENETRESET=102]="ENETRESET",y[y.ETIMEDOUT=110]="ETIMEDOUT",y[y.ECONNREFUSED=111]="ECONNREFUSED",y[y.EHOSTDOWN=112]="EHOSTDOWN",y[y.EHOSTUNREACH=113]="EHOSTUNREACH",y[y.EALREADY=114]="EALREADY",y[y.EINPROGRESS=115]="EINPROGRESS",y[y.ESTALE=116]="ESTALE",y[y.EREMOTEIO=121]="EREMOTEIO",y[y.EDQUOT=122]="EDQUOT",y))(U||{}),ao={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},zi=class zi extends Error{constructor(i,n=ao[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=U[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let n=new zi(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new zi(U[i],ao[U[i]],n,r)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(zi,"ErrnoError");var u=zi;var Zh="/";function hc(e,t){let i="",n=0,r=-1,o=0,a="\0";for(let c=0;c<=e.length;++c){if(c<e.length)a=e[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===c-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",n=0):(i=i.slice(0,l),n=i.length-1-i.lastIndexOf("/")),r=c,o=0;continue}else if(i.length!==0){i="",n=0,r=c,o=0;continue}}t&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+e.slice(r+1,c):i=e.slice(r+1,c),n=c-r-1;r=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(hc,"normalizeString");function _t(...e){let t="";for(let n of[...e.reverse(),Zh])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;let i=t.startsWith("/");return t=hc(t,!i),i?`/${t}`:t.length?t:"/"}s(_t,"resolve");function ep(e){if(!e.length)return".";let t=e.startsWith("/"),i=e.endsWith("/");return e=hc(e,!t),e.length?(i&&(e+="/"),t?`/${e}`:e):t?"/":i?"./":"."}s(ep,"normalize");function z(...e){if(!e.length)return".";let t=e.join("/");return t?.length?ep(t):"."}s(z,"join");function _(e){if(e.length===0)return".";let t=e[0]==="/",i=-1,n=!0;for(let r=e.length-1;r>=1;--r)if(e[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?t?"/":".":t&&i===1?"//":e.slice(0,i)}s(_,"dirname");function D(e,t){let i=0,n=-1,r=!0;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(let c=e.length-1;c>=0;--c)if(e[c]==="/"){if(!r){i=c+1;break}}else a===-1&&(r=!1,a=c+1),o>=0&&(e[c]===t[o]?--o===-1&&(n=c):(o=-1,n=a));return i===n?n=a:n===-1&&(n=e.length),e.slice(i,n)}for(let o=e.length-1;o>=0;--o)if(e[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":e.slice(i,n)}s(D,"basename");function jn(e){let t=e.startsWith("/"),i={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(e.length===0)return i;let n=t?1:0,r=-1,o=0,a=-1,c=!0,l=e.length-1,f=0;for(;l>=n;--l){if(e[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),e[l]==="."?r===-1?r=l:f!==1&&(f=1):r!==-1&&(f=-1)}if(a!==-1){let d=o===0&&t?1:o;r===-1||f===0||f===1&&r===a-1&&r===o+1?i.base=i.name=e.slice(d,a):(i.name=e.slice(d,r),i.base=e.slice(d,a),i.ext=e.slice(r,a))}return o>0?i.dir=e.slice(0,o-1):t&&(i.dir="/"),i}s(jn,"parse");function pc(e,t,i){i.existsSync(e)||(pc(_(e),t,i),i.mkdirSync(e,t))}s(pc,"mkdirpSync");function qn(e,t,i,n,r){return Math.min(e+1,t+1,i+1,n===r?t:t+1)}s(qn,"_min");function co(e,t){if(e===t)return 0;e.length>t.length&&([e,t]=[t,e]);let i=e.length,n=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&e.charCodeAt(r)===t.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=e.charCodeAt(r+b),o[b]=++b;let a,c,l,f,d;for(a=0;a+3<n;){let b=t.charCodeAt(r+(c=a)),p=t.charCodeAt(r+(l=a+1)),w=t.charCodeAt(r+(f=a+2)),g=t.charCodeAt(r+(d=a+3)),A=a+=4;for(let k=0;k<i;){let v=o[i+k],L=o[k];c=qn(L,c,l,b,v),l=qn(c,l,f,p,v),f=qn(l,f,d,w,v),A=qn(f,d,A,g,v),o[k++]=A,d=f,f=l,l=c,c=L}}let h=0;for(;a<n;){let b=t.charCodeAt(r+(c=a));h=++a;for(let p=0;p<i;p++){let w=o[p];o[p]=h=w<c||h<c?w>h?h+1:w+1:b===o[i+p]?c:c+1,c=w}}return h}s(co,"levenshtein");var tp=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:e=>setTimeout(e,0);function Ne(e){if(typeof e!="string")throw new u(22,"Can not encode a non-string");return new Uint8Array(Array.from(e).map(t=>t.charCodeAt(0)))}s(Ne,"encode");function ai(e){if(!(e instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return Array.from(e).map(t=>String.fromCharCode(t)).join("")}s(ai,"decode");function $n(e){return JSON.parse(ai(e),(t,i)=>t==""?i:BigInt(i))}s($n,"decodeDirListing");function xe(e){return Ne(JSON.stringify(e,(t,i)=>t==""?i:i.toString()))}s(xe,"encodeDirListing");function ip(e){if(typeof e=="number")return Math.floor(e);if(e instanceof Date)return Math.floor(e.getTime()/1e3);throw new Error("Cannot parse time")}s(ip,"_toUnixTimestamp");function ke(e,t){if(typeof e=="number")return e;if(typeof e=="string"){let i=parseInt(e,8);if(!isNaN(i))return i}if(typeof t=="number")return t;throw new u(22,"Invalid mode: "+e?.toString())}s(ke,"normalizeMode");function Wt(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e*1e3);if(typeof e=="string")return new Date(e);throw new u(22,"Invalid time.")}s(Wt,"normalizeTime");function x(e){if(e=e.toString(),e.includes("\0"))throw new u(22,"Path can not contain null character");if(e.length==0)throw new u(22,"Path can not be empty");return _t(e.replaceAll(/[/\\]+/g,"/"))}s(x,"normalizePath");function ve(e,t="utf8",i,n=0){return typeof e!="object"||e===null?{encoding:typeof e=="string"?e:t??null,flag:i,mode:n}:{encoding:typeof e?.encoding=="string"?e.encoding:t??null,flag:typeof e?.flag=="string"?e.flag:i,mode:ke("mode"in e?e?.mode:null,n)}}s(ve,"normalizeOptions");function Vi(e){return e!=null&&typeof e=="object"&&"isAvailable"in e&&typeof e.isAvailable=="function"&&"create"in e&&typeof e.create=="function"}s(Vi,"isBackend");async function lo(e,t){if(typeof t!="object"||t===null)throw new u(22,"Invalid options");for(let[i,n]of Object.entries(e.options)){let r=t?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(t).filter(c=>!(c in e.options)).map(c=>({str:c,distance:co(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new u(22,`${e.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new u(22,`${e.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(lo,"checkOptions");function Hi(e){return e!=null&&typeof e=="object"&&"backend"in e&&Vi(e.backend)}s(Hi,"isBackendConfig");var ye={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0},np={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Cn={};Un(Cn,{BigIntStatsFs:()=>on,Dir:()=>Ot,Dirent:()=>At,ReadStream:()=>Nt,Stats:()=>G,StatsFs:()=>rn,WriteStream:()=>Ct,access:()=>Eh,accessSync:()=>Fl,appendFile:()=>Jd,appendFileSync:()=>dl,chmod:()=>mh,chmodSync:()=>xl,chown:()=>ph,chownSync:()=>El,close:()=>Zd,closeSync:()=>It,constants:()=>kt,copyFile:()=>Oh,copyFileSync:()=>os,cp:()=>Lh,cpSync:()=>ss,createReadStream:()=>vh,createWriteStream:()=>Fh,exists:()=>$d,existsSync:()=>Je,fchmod:()=>sh,fchmodSync:()=>nr,fchown:()=>oh,fchownSync:()=>ir,fdatasync:()=>ih,fdatasyncSync:()=>ml,fstat:()=>Qd,fstatSync:()=>hl,fsync:()=>th,fsyncSync:()=>yl,ftruncate:()=>eh,ftruncateSync:()=>pl,futimes:()=>ah,futimesSync:()=>rr,lchmod:()=>bh,lchmodSync:()=>kl,lchown:()=>yh,lchownSync:()=>_l,link:()=>uh,linkSync:()=>wl,lopenSync:()=>mn,lstat:()=>Vd,lstatSync:()=>es,lutimes:()=>wh,lutimesSync:()=>vl,mkdir:()=>lh,mkdirSync:()=>or,mkdtemp:()=>Ah,mkdtempSync:()=>Il,mount:()=>zt,mountObject:()=>pn,mounts:()=>Pe,open:()=>Gd,openAsBlob:()=>Ch,openSync:()=>yn,opendir:()=>Rh,opendirSync:()=>Pl,promises:()=>Nn,read:()=>rh,readFile:()=>Yd,readFileSync:()=>tr,readSync:()=>gl,readdir:()=>fh,readdirSync:()=>Si,readlink:()=>hh,readlinkSync:()=>is,readv:()=>Ph,readvSync:()=>Al,realpath:()=>Sh,realpathSync:()=>Xe,rename:()=>qd,renameSync:()=>ll,rm:()=>Ih,rmSync:()=>rs,rmdir:()=>ch,rmdirSync:()=>ts,stat:()=>zd,statSync:()=>Te,statfs:()=>Nh,statfsSync:()=>Tl,symlink:()=>dh,symlinkSync:()=>Sl,truncate:()=>Hd,truncateSync:()=>fl,umount:()=>gi,unlink:()=>Kd,unlinkSync:()=>er,unwatchFile:()=>xh,utimes:()=>gh,utimesSync:()=>ns,watch:()=>kh,watchFile:()=>_h,write:()=>nh,writeFile:()=>Xd,writeFileSync:()=>bn,writeSync:()=>bl,writev:()=>Th,writevSync:()=>Ol});var za=$i(Ie(),1);var kt={};Un(kt,{COPYFILE_EXCL:()=>Yi,COPYFILE_FICLONE:()=>Dp,COPYFILE_FICLONE_FORCE:()=>Mp,F_OK:()=>Gi,O_APPEND:()=>Ke,O_CREAT:()=>ee,O_DIRECT:()=>Vp,O_DIRECTORY:()=>Up,O_DSYNC:()=>$p,O_EXCL:()=>Ve,O_NOATIME:()=>jp,O_NOCTTY:()=>Wp,O_NOFOLLOW:()=>qp,O_NONBLOCK:()=>Hp,O_RDONLY:()=>di,O_RDWR:()=>ue,O_SYMLINK:()=>zp,O_SYNC:()=>hi,O_TRUNC:()=>He,O_WRONLY:()=>ze,R_OK:()=>Ae,S_IFBLK:()=>ft,S_IFCHR:()=>ut,S_IFDIR:()=>he,S_IFIFO:()=>dt,S_IFLNK:()=>Ce,S_IFMT:()=>K,S_IFREG:()=>de,S_IFSOCK:()=>lt,S_IRGRP:()=>Zp,S_IROTH:()=>iy,S_IRUSR:()=>Xp,S_IRWXG:()=>_o,S_IRWXO:()=>xo,S_IRWXU:()=>Eo,S_ISGID:()=>Gp,S_ISUID:()=>Kp,S_ISVTX:()=>Yp,S_IWGRP:()=>ey,S_IWOTH:()=>ny,S_IWUSR:()=>Jp,S_IXGRP:()=>ty,S_IXOTH:()=>ry,S_IXUSR:()=>Qp,UV_FS_O_FILEMAP:()=>oy,W_OK:()=>X,X_OK:()=>Bp});var Gi=0,Ae=4,X=2,Bp=1,Yi=1,Dp=2,Mp=4,di=0,ze=1,ue=2,ee=64,Ve=128,Wp=256,He=512,Ke=1024,Up=65536,jp=262144,qp=131072,hi=1052672,$p=4096,zp=32768,Vp=16384,Hp=2048,K=61440,lt=49152,Ce=40960,de=32768,ft=24576,he=16384,ut=8192,dt=4096,Kp=2048,Gp=1024,Yp=512,Eo=448,Xp=256,Jp=128,Qp=64,_o=56,Zp=32,ey=16,ty=8,xo=7,iy=4,ny=2,ry=1,oy=0;var Ji=$i(Bc(),1);var Mc,vo=class vo extends Ji.default{constructor(i){super();oo(this,Mc,"List");oo(this,"data",new Set);i&&this.push(...i)}toSet(){return new Set(this.data)}toArray(){return Array.from(this.data)}toJSON(){return JSON.stringify(Array.from(this.data))}toString(){return this.join(",")}set(i,n){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not set an element outside the bounds of the list");let r=Array.from(this.data);r.splice(i,1,n),this.data=new Set(r),this.emit("update")}deleteAt(i){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not delete an element outside the bounds of the list");this.delete(Array.from(this.data).at(i))}at(i){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not access an element outside the bounds of the list");return Array.from(this.data).at(i)}pop(){let i=Array.from(this.data).pop();return i!==void 0&&this.delete(i),i}push(...i){for(let n of i)this.add(n);return this.data.size}join(i){return Array.from(this.data).join(i)}splice(i,n,...r){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not splice elements outside the bounds of the list");let o=Array.from(this.data),a=o.splice(i,n,...r);return this.data=new Set(o),this.emit("update"),a}add(i){return this.data.add(i),this.emit("update"),this}clear(){this.data.clear(),this.emit("update")}delete(i){let n=this.data.delete(i);return this.emit("update"),n}has(i){return this.data.has(i)}get size(){return this.data.size}entries(){return this.data.entries()}keys(){return this.data.keys()}values(){return this.data.values()}[(Mc=Symbol.toStringTag,Symbol.iterator)](){return this.data[Symbol.iterator]()}};s(vo,"List");var Dc=vo;function Wc(e){try{return JSON.parse(e),!0}catch{return!1}}s(Wc,"isJSON");function Qi(e){return e.at(0).toUpperCase()+e.slice(1)}s(Qi,"capitalize");var Uc=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],jc=[...Uc,...Uc.map(e=>Qi(e)),"char"],Gn=/^(u?int|float)(8|16|32|64)$/i;function Fo(e){return e=="char"?"uint8":e.toLowerCase()}s(Fo,"normalize");function Io(e){return Gn.test(e.toString())}s(Io,"isType");function Yn(e){return e=="char"||Gn.test(e.toString().toLowerCase())}s(Yn,"isValid");function qc(e){if(!Yn(e))throw new TypeError("Not a valid primitive type: "+e)}s(qc,"checkValid");var Zi=Symbol("struct_init"),yi=Symbol("struct");function ly(e){return e!=null&&typeof e=="object"&&yi in e}s(ly,"isValidMetadata");Symbol.metadata??=Symbol.for("Symbol.metadata");function fy(e){Symbol?.metadata&&(Symbol.metadata in e||Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)}))}s(fy,"_polyfill_contextMetadata");function pi(e){let t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(i=>i.description=="Symbol.metadata");if(fy(e),!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}s(pi,"symbol_metadata");function en(e){return typeof e=="function"&&pi(e)in e&&ly(e[pi(e)])}s(en,"isStatic");function $c(e){return e!=null&&typeof e=="object"&&en(e.constructor)}s($c,"isInstance");function Ao(e){if(!$c(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct instance")}s(Ao,"checkInstance");function uy(e){return $c(e)||en(e)}s(uy,"isStruct");function zc(e){if(!uy(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct")}s(zc,"checkStruct");function ht(e){if(typeof e=="string")return qc(e),+Fo(e).match(Gn)[2]/8;zc(e);let t=en(e)?e:e.constructor;return t[pi(t)][yi].size}s(ht,"sizeof");function hy(e,t){return Math.ceil(e/t)*t}s(hy,"align");function Hc(e={}){return s(function(i,n){n.metadata??={},n.metadata[Zi]||=[];let r=0,o=new Map;for(let a of n.metadata[Zi]){let{name:c,type:l,length:f}=a;if(!Yn(l)&&!en(l))throw new TypeError("Not a valid type: "+l);o.set(c,{offset:r,type:Yn(l)?Fo(l):l,length:f}),r+=ht(l)*(f||1),r=hy(r,e.align||1)}return n.metadata[yi]={options:e,members:o,size:r},i},"_decorateStruct")}s(Hc,"struct");function Vc(e,t){return function(i,n){let r=n.name;if(typeof r=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+r.toString()),r=r.toString()),!r)throw new ReferenceError("Invalid name for struct member");return n.metadata??={},n.metadata[Zi]||=[],n.metadata[Zi].push({name:r,type:e,length:t}),i}}s(Vc,"member");function Oo(e){Ao(e);let{options:t,members:i}=e.constructor[pi(e.constructor)][yi],n=new Uint8Array(ht(e)),r=new DataView(n.buffer);for(let[o,{type:a,length:c,offset:l}]of i)for(let f=0;f<(c||1);f++){let d=l+ht(a)*f,h=c>0?e[o][f]:e[o];if(typeof h=="string"&&(h=h.charCodeAt(0)),!Io(a)){n.set(h?Oo(h):new Uint8Array(ht(a)),d);continue}let p="set"+Qi(a);if(p=="setInt64"){r.setBigInt64(d,BigInt(h),!t.bigEndian);continue}if(p=="setUint64"){r.setBigUint64(d,BigInt(h),!t.bigEndian);continue}r[p](d,Number(h),!t.bigEndian)}return n}s(Oo,"serialize");function Po(e,t){Ao(e);let{options:i,members:n}=e.constructor[pi(e.constructor)][yi],r=t instanceof Uint8Array?t:new Uint8Array("buffer"in t?t.buffer:t),o=new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));for(let[a,{type:c,offset:l,length:f}]of n)for(let d=0;d<(f||1);d++){let h=f>0?e[a]:e,b=f>0?d:a,p=l+ht(c)*d;if(typeof e[a]=="string"){e[a]=e[a].slice(0,d)+String.fromCharCode(o.getUint8(p))+e[a].slice(d+1);continue}if(!Io(c)){if(h[b]===null||h[b]===void 0)continue;Po(h[b],new Uint8Array(r.slice(p,p+ht(c))));continue}f>0&&(h||=[]);let g="get"+Qi(c);if(g=="getInt64"){h[b]=o.getBigInt64(p,!i.bigEndian);continue}if(g=="getUint64"){h[b]=o.getBigUint64(p,!i.bigEndian);continue}h[b]=o[g](p,!i.bigEndian)}}s(Po,"deserialize");function py(e){function t(i,n){return typeof i=="number"?Vc(e,i):Vc(e)(i,n)}return s(t,"_structMemberDecorator"),t}s(py,"_member");var Be=Object.fromEntries(jc.map(e=>[e,py(e)]));var Oe=2**32-1,Ye=0n;function Kc(){return Math.round(Math.random()*2**32).toString(16)}s(Kc,"_random");function tn(){return BigInt("0x"+Kc()+Kc())}s(tn,"randomIno");var Gc,Yc,Xc,Jc,Qc,Zc,el,tl,il,nl,rl,me;me=[,,,],rl=[Hc()],nl=[Be.uint64],il=[Be.uint32],tl=[Be.uint16],el=[Be.uint32],Zc=[Be.uint32],Qc=[Be.uint32],Jc=[Be.float64],Xc=[Be.float64],Yc=[Be.float64],Gc=[Be.float64];var te=class te{get data(){return Oo(this)}constructor(t){if(t){if(t.byteLength<ht(te))throw new RangeError(`Can not create an inode from a buffer less than ${ht(te)} bytes`);Po(this,t);return}this.ino=tn(),this.nlink=1,this.size=4096;let i=Date.now();this.atimeMs=i,this.mtimeMs=i,this.ctimeMs=i,this.birthtimeMs=i}toStats(){return new G(this)}update(t){let i=!1;return this.size!==t.size&&(this.size=t.size,i=!0),this.mode!==t.mode&&(this.mode=t.mode,i=!0),this.nlink!==t.nlink&&(this.nlink=t.nlink,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.atimeMs!==t.atimeMs&&(this.atimeMs=t.atimeMs,i=!0),this.mtimeMs!==t.mtimeMs&&(this.mtimeMs=t.mtimeMs,i=!0),this.ctimeMs!==t.ctimeMs&&(this.ctimeMs=t.ctimeMs,i=!0),i}};_e(me,5,"ino",nl,te),_e(me,5,"size",il,te),_e(me,5,"mode",tl,te),_e(me,5,"nlink",el,te),_e(me,5,"uid",Zc,te),_e(me,5,"gid",Qc,te),_e(me,5,"atimeMs",Jc,te),_e(me,5,"birthtimeMs",Xc,te),_e(me,5,"mtimeMs",Yc,te),_e(me,5,"ctimeMs",Gc,te),te=_e(me,0,"Inode",rl,te),s(te,"Inode"),dc(me,1,te);var Ge=te;var Lo=class Lo{constructor({atimeMs:t,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:c,mode:l,ino:f}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(t??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(n??d),this.birthtimeMs=this._convert(r??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(t){if(ye.euid===0||ye.egid===0)return!0;let i=(ye.uid==this.uid?448:0)|(ye.gid==this.gid?56:0)|7;return(t&this.mode&i)==t}cred(t=Number(this.uid),i=Number(this.gid)){return{uid:t,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:t,egid:i}}chmod(t){this.mode=this._convert(this.mode&61440|t)}chown(t,i){t=Number(t),i=Number(i),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}};s(Lo,"StatsCommon");var nn=Lo,No=class No extends nn{constructor(){super(...arguments);this._isBigint=!1}};s(No,"Stats");var G=No,Co=class Co extends nn{constructor(){super(...arguments);this._isBigint=!0}};s(Co,"BigIntStats");var be=Co;function To(e,t){return e.size==t.size&&+e.atime==+t.atime&&+e.mtime==+t.mtime&&+e.ctime==+t.ctime&&e.mode==t.mode}s(To,"isStatsEqual");var Ro=525687744115,Bo=class Bo{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Oe;this.ffree=Oe}};s(Bo,"StatsFs");var rn=Bo,Do=class Do{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Oe);this.ffree=BigInt(Oe)}};s(Do,"BigIntStatsFs");var on=Do;var Nn={};Un(Nn,{FileHandle:()=>ce,access:()=>Wa,appendFile:()=>Ta,chmod:()=>Ba,chown:()=>Na,constants:()=>kt,copyFile:()=>Hr,cp:()=>Kr,exists:()=>je,lchmod:()=>Da,lchown:()=>Ca,link:()=>Ra,lstat:()=>jr,lutimes:()=>Ma,mkdir:()=>Ln,mkdtemp:()=>Ua,open:()=>Se,opendir:()=>ja,readFile:()=>Rn,readdir:()=>Ht,readlink:()=>$r,realpath:()=>Ue,rename:()=>Oa,rm:()=>Vr,rmdir:()=>qr,stat:()=>st,statfs:()=>qa,symlink:()=>La,truncate:()=>Pa,unlink:()=>Tn,utimes:()=>zr,watch:()=>VS,writeFile:()=>Mi});var oi=$i(Ie(),1);Promise.withResolvers??=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var yy=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function M(e){if(typeof e=="number")return ol(e);if(!yy.includes(e))throw new Error("Invalid flag string: "+e);return e}s(M,"parseFlag");function ol(e){switch(e){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+e)}}s(ol,"flagToString");function my(e){switch(e){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+e)}}s(my,"flagToNumber");function sn(e){let t=0;return t<<=1,t+=+vt(e),t<<=1,t+=+ge(e),t<<=1,t}s(sn,"flagToMode");function vt(e){return e.indexOf("r")!==-1||e.indexOf("+")!==-1}s(vt,"isReadable");function ge(e){return e.indexOf("w")!==-1||e.indexOf("a")!==-1||e.indexOf("+")!==-1}s(ge,"isWriteable");function an(e){return e.indexOf("w")!==-1}s(an,"isTruncating");function pt(e){return e.indexOf("a")!==-1}s(pt,"isAppendable");function by(e){return e.indexOf("s")!==-1}s(by,"isSynchronous");function cn(e){return e.indexOf("x")!==-1}s(cn,"isExclusive");var Mo=class Mo{constructor(t,i){this.fs=t;this.path=i}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(Mo,"File");var qt=Mo,Wo=class Wo extends qt{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:Oe}))){super(i,n);this.fs=i;this.flag=r;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;this.closed=!1;if(this.stats.size!=a.byteLength){if(vt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return pt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw u.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw u.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(i){if(this.closed)throw u.With("EBADF",this.path,"File.dispose");if(this.dirty&&!i)throw u.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return Promise.resolve(new G(this.stats))}statSync(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return new G(this.stats)}_truncate(i){if(this.closed)throw u.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i)}async truncate(i){this._truncate(i),await this.sync()}truncateSync(i){this._truncate(i),this.syncSync()}_write(i,n=0,r=this.stats.size,o=this.position){if(this.closed)throw u.With("EBADF",this.path,"File.write");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+r;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:Oe}));l.set(this._buffer),this._buffer=l}let c=i.slice(n,n+r);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,n,r,o){let a=this._write(i,n,r,o);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,o=this.position){let a=this._write(i,n,r,o);return this.syncSync(),a}_read(i,n=0,r=this.stats.size,o){if(this.closed)throw u.With("EBADF",this.path,"File.read");if(!vt(this.flag))throw new u(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,n,r).set(this._buffer.slice(o,a)),c}async read(i,n,r,o){let a=this._read(i,n,r,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,n,r,o){let a=this._read(i,n,r,o);return this.statSync(),a}async chmod(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),await this.sync()}chownSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,await this.sync()}utimesSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}async _setType(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,await this.sync()}_setTypeSync(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}};s(Wo,"PreloadFile");var we=Wo,Uo=class Uo extends we{constructor(t,i,n,r,o){super(t,i,n,r,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};s(Uo,"NoSyncFile");var mi=Uo;var Ft=$i(Ie(),1);var jo=class jo{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Ro}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(i){return i.code!="ENOENT"}}existsSync(t){try{return this.statSync(t),!0}catch(i){return i.code!="ENOENT"}}};s(jo,"FileSystem");var pe=jo;var sl=5,qo=class qo extends pe{constructor(i){super();this.store=i;this._initialized=!1}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,n){var w=[];try{let r=S(w,this.store.transaction(),!0);let o=_(i),a=D(i),c=_(n),l=D(n),f=await this.findINode(r,o),d=await this.getDirListing(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")===0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=await this.findINode(r,c),p=await this.getDirListing(r,b,c));if(p[l]){let L=await this.getINode(r,p[l],n);if(!L.toStats().isFile())throw u.With("EPERM",n,"rename");await r.remove(L.ino),await r.remove(p[l])}p[l]=h;await r.set(f.ino,xe(d));await r.set(b.ino,xe(p));await r.commit()}catch(g){var A=g,k=!0}finally{var v=E(w,A,k);v&&await v}}renameSync(i,n){var w=[];try{let r=S(w,this.store.transaction());let o=_(i),a=D(i),c=_(n),l=D(n),f=this.findINodeSync(r,o),d=this.getDirListingSync(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")==0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=this.findINodeSync(r,c),p=this.getDirListingSync(r,b,c));if(p[l]){let v=this.getINodeSync(r,p[l],n);if(!v.toStats().isFile())throw u.With("EPERM",n,"rename");r.removeSync(v.ino),r.removeSync(p[l])}p[l]=h;r.setSync(f.ino,xe(d));r.setSync(b.ino,xe(p));r.commitSync()}catch(g){var A=g,k=!0}finally{E(w,A,k)}}async stat(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);if(!r)throw u.With("ENOENT",i,"stat");return r.toStats()}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}statSync(i){var r=[];try{let n=S(r,this.store.transaction());return this.findINodeSync(n,i).toStats()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async createFile(i,n,r){let o=await this.commitNew(i,32768,r,new Uint8Array(0));return new we(this,i,n,o.toStats(),new Uint8Array(0))}createFileSync(i,n,r){return this.commitNewSync(i,32768,r),this.openFileSync(i,n)}async openFile(i,n){var c=[];try{let r=S(c,this.store.transaction(),!0);let o=await this.findINode(r,i),a=await r.get(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}openFileSync(i,n){var c=[];try{let r=S(c,this.store.transaction());let o=this.findINodeSync(r,i),a=r.getSync(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}async unlink(i){return this.remove(i,!1)}unlinkSync(i){this.removeSync(i,!1)}async rmdir(i){if((await this.readdir(i)).length)throw u.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0)}rmdirSync(i){if(this.readdirSync(i).length)throw u.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0)}async mkdir(i,n){await this.commitNew(i,16384,n,Ne("{}"))}mkdirSync(i,n){this.commitNewSync(i,16384,n,Ne("{}"))}async readdir(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);return Object.keys(await this.getDirListing(n,r,i))}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}readdirSync(i){var o=[];try{let n=S(o,this.store.transaction());let r=this.findINodeSync(n,i);return Object.keys(this.getDirListingSync(n,r,i))}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async sync(i,n,r){var f=[];try{let o=S(f,this.store.transaction(),!0);let a=await this._findINode(o,_(i),D(i)),c=await this.getINode(o,a,i),l=c.update(r);await o.set(c.ino,n);l&&await o.set(a,c.data);await o.commit()}catch(d){var h=d,b=!0}finally{var p=E(f,h,b);p&&await p}}syncSync(i,n,r){var f=[];try{let o=S(f,this.store.transaction());let a=this._findINodeSync(o,_(i),D(i)),c=this.getINodeSync(o,a,i),l=c.update(r);o.setSync(c.ino,n);l&&o.setSync(a,c.data);o.commitSync()}catch(d){var h=d,b=!0}finally{E(f,h,b)}}async link(i,n){var d=[];try{let r=S(d,this.store.transaction(),!0);let o=_(n),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o);let l=await this._findINode(r,_(i),D(i));let f=await this.getINode(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{var w=E(d,b,p);w&&await w}}linkSync(i,n){var d=[];try{let r=S(d,this.store.transaction());let o=_(n),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o);let l=this._findINodeSync(r,_(i),D(i));let f=this.getINodeSync(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{E(d,b,p)}}async checkRoot(){var r=[];try{let i=S(r,this.store.transaction(),!0);if(await i.get(Ye))return;let n=new Ge;n.mode=16895;await i.set(n.ino,Ne("{}"));await i.set(Ye,n.data);await i.commit()}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}checkRootSync(){var r=[];try{let i=S(r,this.store.transaction());if(i.getSync(Ye))return;let n=new Ge;n.mode=16895;i.setSync(n.ino,Ne("{}"));i.setSync(Ye,n.data);i.commitSync()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async _findINode(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?await this.getINode(i,Ye,n):await this.findINode(i,n,o),l=await this.getDirListing(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}_findINodeSync(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?this.getINodeSync(i,Ye,n):this.findINodeSync(i,n,o),l=this.getDirListingSync(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}async findINode(i,n,r=new Set){let o=await this._findINode(i,_(n),D(n),r);return this.getINode(i,o,n)}findINodeSync(i,n,r=new Set){let o=this._findINodeSync(i,_(n),D(n),r);return this.getINodeSync(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}getINodeSync(i,n,r){let o=i.getSync(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return $n(o)}getDirListingSync(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=i.getSync(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return $n(o)}async addNew(i,n,r){for(let o=0;o<sl;o++){let a=tn();if(!await i.get(a))return await i.set(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}addNewSync(i,n,r){for(let o=0;o<sl;o++){let a=tn();if(!i.getSync(a))return i.setSync(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}async commitNew(i,n,r,o){var b=[];try{let a=S(b,this.store.transaction(),!0);let c=_(i),l=await this.findINode(a,c);let f=D(i),d=await this.getDirListing(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw await a.abort(),u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=await this.addNew(a,o,i);h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;h.size=o.length;d[f]=await this.addNew(a,h.data,i);await a.set(l.ino,xe(d));await a.commit();return h}catch(p){var w=p,g=!0}finally{var A=E(b,w,g);A&&await A}}commitNewSync(i,n,r,o=new Uint8Array){var b=[];try{let a=S(b,this.store.transaction());let c=_(i),l=this.findINodeSync(a,c);let f=D(i),d=this.getDirListingSync(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=this.addNewSync(a,o,i);h.size=o.length;h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;d[f]=this.addNewSync(a,h.data,i);a.setSync(l.ino,xe(d));a.commitSync();return h}catch(p){var w=p,g=!0}finally{E(b,w,g)}}async remove(i,n){var h=[];try{let r=S(h,this.store.transaction(),!0);let o=_(i),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o),l=D(i);if(!c[l])throw u.With("ENOENT",i,"remove");let f=c[l];let d=await this.getINode(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");await r.set(a.ino,xe(c));--d.nlink<1&&(await r.remove(d.ino),await r.remove(f));await r.commit()}catch(b){var p=b,w=!0}finally{var g=E(h,p,w);g&&await g}}removeSync(i,n){var h=[];try{let r=S(h,this.store.transaction());let o=_(i),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o),l=D(i),f=c[l];if(!f)throw u.With("ENOENT",i,"remove");let d=this.getINodeSync(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");r.setSync(a.ino,xe(c));--d.nlink<1&&(r.removeSync(d.ino),r.removeSync(f));r.commitSync()}catch(b){var p=b,w=!0}finally{E(h,p,w)}}};s(qo,"StoreFS");var ln=qo;var zo=class zo{constructor(t){this.store=t;this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}};s(zo,"Transaction");var fn=zo,Vo=class Vo extends fn{async get(t){return this.getSync(t)}async set(t,i){return this.setSync(t,i)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}};s(Vo,"SyncTransaction");var un=Vo,Ho=class Ho extends fn{getSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};s(Ho,"AsyncTransaction");var $o=Ho;var Go=class Go{constructor(){this.cache=new Map;this.queue=new Set}get(t){return this.cache.get(t)}set(t,i){this.cache.set(t,i),this.queue.add(this._set(t,i))}delete(t){this.cache.delete(t),this.queue.add(this._delete(t))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[t,i]of await this.entries())this.cache.has(t)||this.cache.set(t,i);for(let t of this.queue)await t}transaction(){return new bi(this)}};s(Go,"SimpleAsyncStore");var Ko=Go,Yo=class Yo extends un{constructor(){super(...arguments);this.originalData=new Map;this.modifiedKeys=new Set}getSync(i){let n=this.store.get(i);return this.stashOldValue(i,n),n}setSync(i,n){return this.markModified(i),this.store.set(i,n)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){this.done=!0}abortSync(){if(this.done){for(let i of this.modifiedKeys){let n=this.originalData.get(i);n?this.store.set(i,n):this.store.delete(i)}this.done=!0}}stashOldValue(i,n){this.originalData.has(i)||this.originalData.set(i,n)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};s(Yo,"SimpleTransaction");var bi=Yo;var Xo=class Xo extends Map{constructor(i="tmp"){super();this.name=i}async sync(){}clearSync(){this.clear()}transaction(){return new bi(this)}};s(Xo,"InMemoryStore");var Xn=Xo,al={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:e}){let t=new ln(new Xn(e));return t.checkRootSync(),t},"create")},dn=al;var $t=new Map,gy=100;function hn(e){let t=gy++;return $t.set(t,e),t}s(hn,"file2fd");function j(e){if(!$t.has(e))throw new u(9);return $t.get(e)}s(j,"fd2file");var Pe=new Map;zt("/",dn.create({name:"root"}));function zt(e,t){if(e[0]!=="/"&&(e="/"+e),e=_t(e),Pe.has(e))throw new u(22,"Mount point "+e+" is already in use.");Pe.set(e,t)}s(zt,"mount");function gi(e){if(e[0]!=="/"&&(e=`/${e}`),e=_t(e),!Pe.has(e))throw new u(22,"Mount point "+e+" is already unmounted.");Pe.delete(e)}s(gi,"umount");function R(e){e=x(e);let t=[...Pe].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of t)if(i.length<=e.length&&e.startsWith(i))return e=e.slice(i.length>1?i.length:0),e===""&&(e="/"),{fs:n,path:e,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(R,"resolveMount");function cl(e,t){for(let[i,n]of Object.entries(t))e=e?.replaceAll(i,n);return e}s(cl,"fixPaths");function Y(e,t){return typeof e.stack=="string"&&(e.stack=cl(e.stack,t)),e.message=cl(e.message,t),e}s(Y,"fixError");function pn(e){"/"in e&&gi("/");for(let[t,i]of Object.entries(e))zt(t,i)}s(pn,"mountObject");function Jn(e,t){let i=e.metadata(),n=i.blockSize||4096;return{type:(t?BigInt:Number)(i.type),bsize:(t?BigInt:Number)(n),ffree:(t?BigInt:Number)(i.freeNodes||Oe),files:(t?BigInt:Number)(i.totalNodes||Oe),bavail:(t?BigInt:Number)(i.freeSpace/n),bfree:(t?BigInt:Number)(i.freeSpace/n),blocks:(t?BigInt:Number)(i.totalSpace/n)}}s(Jn,"_statfs");var Jo=class Jo extends Ji.default{constructor(i){super();this.path=i}off(i,n,r,o){return super.off(i,n,r,o)}removeListener(i,n,r,o){return super.removeListener(i,n,r,o)}setMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw u.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw u.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw u.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}};s(Jo,"Watcher");var Qn=Jo,Qo=class Qo extends Qn{constructor(i,n){super(i);this.options=n;wy(i.toString(),this)}close(){super.emit("close"),Sy(this.path.toString(),this)}[Symbol.dispose](){this.close()}};s(Qo,"FSWatcher");var wi=Qo,Zo=class Zo extends Qn{constructor(i,n){super(i);this.options=n;this.start()}onInterval(){try{let i=Te(this.path);To(this.previous,i)||(this.emit("change",i,this.previous),this.previous=i)}catch(i){this.emit("error",i)}}start(){let i=this.options.interval||5e3;try{this.previous=Te(this.path)}catch(n){this.emit("error",n);return}this.intervalId=setInterval(this.onInterval.bind(this),i),!this.options.persistent&&typeof this.intervalId=="object"&&this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}};s(Zo,"StatWatcher");var Zn=Zo,De=new Map;function wy(e,t){let i=x(e);De.has(i)||De.set(i,new Set),De.get(i).add(t)}s(wy,"addWatcher");function Sy(e,t){let i=x(e);De.has(i)&&(De.get(i).delete(t),De.get(i).size===0&&De.delete(i))}s(Sy,"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 ll(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!Te(_(e)).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i===n){i.fs.renameSync(i.path,n.path),W("rename",e.toString());return}bn(t,tr(e)),er(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(ll,"renameSync");function Je(e){e=x(e);try{let{fs:t,path:i}=R(Xe(e));return t.existsSync(i)}catch(t){if(t.errno==2)return!1;throw t}}s(Je,"existsSync");function Te(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e);try{let r=i.statSync(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(Te,"statSync");function es(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=i.statSync(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(es,"lstatSync");function fl(e,t=0){var n=[];try{let i=S(n,Vt(e,"r+"));t||=0;if(t<0)throw new u(22);i.truncateSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}s(fl,"truncateSync");function er(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"unlink");t.unlinkSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(er,"unlinkSync");function Vt(e,t,i,n=!0){e=x(e);let r=ke(i,420),o=M(t);e=n&&Je(e)?Xe(e):e;let{fs:a,path:c}=R(e);if(!a.existsSync(c)){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=a.statSync(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return a.createFileSync(c,o,r)}let l=a.statSync(c);if(!l.hasAccess(r)||!l.hasAccess(sn(o)))throw u.With("EACCES",e,"_open");if(cn(o))throw u.With("EEXIST",e,"_open");let f=a.openFileSync(c,o);return an(o)&&(f.truncateSync(0),f.syncSync()),f}s(Vt,"_openSync");function yn(e,t,i=0){return hn(Vt(e,t,i,!0))}s(yn,"openSync");function mn(e,t,i){return hn(Vt(e,t,i,!1))}s(mn,"lopenSync");function ul(e,t,i){var a=[];try{let n=S(a,Vt(e,t,420,i));let r=n.statSync();let o=new Uint8Array(r.size);n.readSync(o,0,r.size,0);return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}s(ul,"_readFileSync");function tr(e,t={}){let i=ve(t,null,"r",420),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed to readFile must allow for reading.");let r=Ft.Buffer.from(ul(typeof e=="number"?j(e).path:e.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(tr,"readFileSync");function bn(e,t,i={}){var c=[];try{let n=ve(i,"utf8","w+",420);let r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new u(22,"Data not specified");let a=S(c,Vt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength,0);W("change",e.toString())}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(bn,"writeFileSync");function dl(e,t,i={}){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,Vt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(dl,"appendFileSync");function hl(e,t){let i=j(e).statSync();return t?.bigint?new be(i):i}s(hl,"fstatSync");function It(e){j(e).closeSync(),$t.delete(e)}s(It,"closeSync");function pl(e,t=0){if(t||=0,t<0)throw new u(22);j(e).truncateSync(t)}s(pl,"ftruncateSync");function yl(e){j(e).syncSync()}s(yl,"fsyncSync");function ml(e){j(e).datasyncSync()}s(ml,"fdatasyncSync");function bl(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(bl,"writeSync");function gl(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(gl,"readSync");function ir(e,t,i){j(e).chownSync(t,i)}s(ir,"fchownSync");function nr(e,t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");j(e).chmodSync(i)}s(nr,"fchmodSync");function rr(e,t,i){j(e).utimesSync(Wt(t),Wt(i))}s(rr,"futimesSync");function ts(e){e=x(e);let{fs:t,path:i}=R(Je(e)?Xe(e):e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"rmdir");t.rmdirSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(ts,"rmdirSync");function or(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=Je(e)?Xe(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!n.statSync(_(r)).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");return n.mkdirSync(r,i)}let a=[];for(let c=r,l=e;!n.existsSync(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!n.statSync(_(c)).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");n.mkdirSync(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(or,"mkdirSync");function Si(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e),r;if(!Te(e).hasAccess(4))throw u.With("EACCES",e,"readdir");try{r=i.readdirSync(n)}catch(o){throw Y(o,{[n]:e})}for(let o of Pe.keys()){if(!o.startsWith(e))continue;let a=o.slice(e.length);a.includes("/")||a.length==0||r.push(a)}return r.map(o=>typeof t=="object"&&t?.withFileTypes?new At(o,Te(z(e.toString(),o))):t=="buffer"||typeof t=="object"&&t?.encoding=="buffer"?Ft.Buffer.from(o):o)}s(Si,"readdirSync");function wl(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(wl,"linkSync");function Sl(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(Je(t))throw u.With("EEXIST",t.toString(),"symlink");bn(t,e.toString()),Vt(t,"r+",420,!1)._setTypeSync(40960)}s(Sl,"symlinkSync");function is(e,t){let i=Ft.Buffer.from(ul(e.toString(),"r",!1)),n=typeof t=="object"?t?.encoding:t;return n=="buffer"?i:i.toString(n)}s(is,"readlinkSync");function El(e,t,i){let n=yn(e,"r+");ir(n,t,i),It(n)}s(El,"chownSync");function _l(e,t,i){let n=mn(e,"r+");ir(n,t,i),It(n)}s(_l,"lchownSync");function xl(e,t){let i=yn(e,"r+");nr(i,t),It(i)}s(xl,"chmodSync");function kl(e,t){let i=mn(e,"r+");nr(i,t),It(i)}s(kl,"lchmodSync");function ns(e,t,i){let n=yn(e,"r+");rr(n,t,i),It(n)}s(ns,"utimesSync");function vl(e,t,i){let n=mn(e,"r+");rr(n,t,i),It(n)}s(vl,"lutimesSync");function Xe(e,t){e=x(e);let{base:i,dir:n}=jn(e),r=z(n=="/"?"/":Xe(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return o.statSync(a).isSymbolicLink()?Xe(c+is(r,t).toString()):r}catch(l){throw Y(l,{[a]:r})}}s(Xe,"realpathSync");function Fl(e,t=384){if(!Te(e).hasAccess(t))throw new u(13)}s(Fl,"accessSync");function rs(e,t){switch(e=x(e),Te(e).mode&61440){case 16384:if(t?.recursive)for(let n of Si(e))rs(z(e,n),t);ts(e);return;case 32768:case 40960:er(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(rs,"rmSync");function Il(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return or(r),i=="buffer"?Ft.Buffer.from(r):r}s(Il,"mkdtempSync");function os(e,t,i){if(e=x(e),t=x(t),i&&i&1&&Je(t))throw new u(17,"Destination file already exists.",t,"copyFile");bn(t,tr(e)),W("rename",t.toString())}s(os,"copyFileSync");function Al(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(Al,"readvSync");function Ol(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(Ol,"writevSync");function Pl(e,t){return e=x(e),new Ot(e)}s(Pl,"opendirSync");function ss(e,t,i){e=x(e),t=x(t);let n=es(e);if(i?.errorOnExist&&Je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");or(t,{recursive:!0});for(let r of Si(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||ss(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:os(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&ns(t,n.atime,n.mtime)}s(ss,"cpSync");function Tl(e,t){e=x(e);let{fs:i}=R(e);return Jn(i,t?.bigint)}s(Tl,"statfsSync");var as=class as{constructor(t,i){this.path=t;this.stats=i}get name(){return D(this.path)}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(as,"Dirent");var At=as,cs=class cs{constructor(t){this.path=t;this.closed=!1}checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??=await Ht(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then(i=>t(void 0,i))}readSync(){return this.checkClosed(),this._entries??=Si(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}async next(){let t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}};s(cs,"Dir");var Ot=cs;var Ur=$i(jd(),1);var Ia=class Ia extends Ur.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};s(Ia,"ReadStream");var Nt=Ia,Aa=class Aa extends Ur.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};s(Aa,"WriteStream");var Ct=Aa;var $a=class $a{constructor(t){let i=typeof t!="number";this.fd=i?hn(t):t,this.file=i?t:j(t)}async chown(t,i){await this.file.chown(t,i),W("change",this.file.path)}async chmod(t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");await this.file.chmod(i),W("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||=0,t<0)throw new u(22);await this.file.truncate(t),W("change",this.file.path)}async utimes(t,i){await this.file.utimes(Wt(t),Wt(i)),W("change",this.file.path)}async appendFile(t,i={}){let n=ve(i,"utf8","a",420),r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length),W("change",this.file.path)}read(t,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(t,i,n,r)}async readFile(t){let i=ve(t,null,"r",292),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(r),0,r,0),a=oi.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(t={}){let i=s(async r=>{try{let c=0,l=0,f=NaN;for(;f>0;){let d=await this.read(new Uint8Array(65536),0,65536,l);if(!d.bytesRead){r.close();return}if(r.enqueue(d.buffer.slice(0,d.bytesRead)),l+=d.bytesRead,++c>=1e7)throw new u(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=d.bytesRead}}catch(o){r.error(o)}},"start"),n=globalThis;if(!("ReadableStream"in n))throw new u(38,"ReadableStream is missing on globalThis");return new n.ReadableStream({start:i,type:t.type})}readLines(t){throw u.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){let i=await this.file.stat();if(!i.hasAccess(4))throw u.With("EACCES",this.file.path,"stat");return t?.bigint?new be(i):i}async write(t,i,n,r){let o,a,c;if(typeof t=="string"){r=typeof i=="number"?i:null;let f=typeof n=="string"?n:"utf8";a=0,o=oi.Buffer.from(t,f),c=o.length}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,r=typeof r=="number"?r:null;r??=this.file.position;let l=await this.file.write(o,a,c,r);return W("change",this.file.path),{buffer:o,bytesWritten:l}}async writeFile(t,i={}){let n=ve(i,"utf8","w",420),r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length,0),W("change",this.file.path)}async close(){await this.file.close(),$t.delete(this.fd)}async writev(t,i){let n=0;for(let r of t)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,i){let n=0;for(let r of t)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){let i=new Nt({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:s(async n=>{try{let r=await this.read(new Uint8Array(n),0,n,this.file.position);i.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),this.file.position+=r.bytesRead}catch(r){i.destroy(r)}},"read")});return i.path=this.file.path,i}createWriteStream(t){let i={highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:s(async(r,o,a)=>{try{let{bytesWritten:c}=await this.write(r,null,o);a(c==r.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},n=new Ct(i);return n.path=this.file.path,n}};s($a,"FileHandle");var ce=$a;async function Oa(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!(await st(_(e))).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path),W("rename",e.toString());return}await Mi(t,await Rn(e)),await Tn(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(Oa,"rename");async function je(e){try{let{fs:t,path:i}=R(await Ue(e));return await t.exists(i)}catch(t){if(t instanceof u&&t.code=="ENOENT")return!1;throw t}}s(je,"exists");async function st(e,t){e=x(e);let{fs:i,path:n}=R(await je(e)?await Ue(e):e);try{let r=await i.stat(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(st,"stat");async function jr(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=await i.stat(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(jr,"lstat");async function Pa(e,t=0){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.truncate(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Pa,"truncate");async function Tn(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"unlink");await t.unlink(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(Tn,"unlink");async function Di(e,t,i=420,n){e=x(e);let r=ke(i,420),o=M(t);e=n&&await je(e)?await Ue(e):e;let{fs:a,path:c}=R(e),l=await a.stat(c).catch(()=>null);if(!l){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=await a.stat(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return new ce(await a.createFile(c,o,r))}if(!l.hasAccess(sn(o)))throw u.With("EACCES",e,"_open");if(cn(o))throw u.With("EEXIST",e,"_open");let f=new ce(await a.openFile(c,o));return an(o)&&(await f.truncate(0),await f.sync()),f}s(Di,"_open");async function Se(e,t="r",i=420){return await Di(e,t,i,!0)}s(Se,"open");async function Rn(e,t){var r=[];try{let i=ve(t,null,"r",420);let n=S(r,typeof e=="object"&&"fd"in e?e:await Se(e,i.flag,i.mode),!0);return await n.readFile(i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Rn,"readFile");async function Mi(e,t,i){var a=[];try{let n=ve(i,"utf8","w+",420);let r=S(a,e instanceof ce?e:await Se(e.toString(),n.flag,n.mode),!0);let o=t;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,n)}catch(c){var l=c,f=!0}finally{var d=E(a,l,f);d&&await d}}s(Mi,"writeFile");async function Ta(e,t,i){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,typeof e=="object"&&"fd"in e?e:await Se(e,n.flag,n.mode),!0);await a.appendFile(o,n)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}s(Ta,"appendFile");async function qr(e){e=x(e),e=await je(e)?await Ue(e):e;let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"rmdir");await t.rmdir(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(qr,"rmdir");async function Ln(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=await je(e)?await Ue(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!(await n.stat(_(r))).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");await n.mkdir(r,i),W("rename",e.toString());return}let a=[];for(let c=r,l=e;!await n.exists(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!(await n.stat(_(c))).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");await n.mkdir(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(Ln,"mkdir");async function Ht(e,t){if(e=x(e),!(await st(e)).hasAccess(4))throw u.With("EACCES",e,"readdir");e=await je(e)?await Ue(e):e;let{fs:i,path:n}=R(e),r;try{r=await i.readdir(n)}catch(a){throw Y(a,{[n]:e})}for(let a of Pe.keys())if(a.startsWith(e)){let c=a.slice(e.length);if(c.includes("/")||c.length==0)continue;r.push(c)}let o=[];for(let a of r)o.push(typeof t=="object"&&t?.withFileTypes?new At(a,await st(z(e,a))):a);return o}s(Ht,"readdir");async function Ra(e,t){if(e=x(e),!(await st(_(e))).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!(await st(_(t))).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!(await i.stat(n)).hasAccess(2))throw u.With("EACCES",n,"link");return await i.link(n,r.path)}catch(o){throw Y(o,{[r.path]:t,[n]:e})}}s(Ra,"link");async function La(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await je(t))throw u.With("EEXIST",t.toString(),"symlink");await Mi(t,e.toString()),await(await Di(t,"r+",420,!1)).file._setType(40960)}s(La,"symlink");async function $r(e,t){var o=[];try{let i=S(o,await Di(x(e),"r",420,!1),!0);let n=await i.readFile();let r=typeof t=="object"?t?.encoding:t;return r=="buffer"?n:n.toString(r)}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}s($r,"readlink");async function Na(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Na,"chown");async function Ca(e,t,i){var r=[];try{let n=S(r,await Di(e,"r+",420,!1),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Ca,"lchown");async function Ba(e,t){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Ba,"chmod");async function Da(e,t){var n=[];try{let i=S(n,await Di(e,"r+",420,!1),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Da,"lchmod");async function zr(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.utimes(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(zr,"utimes");async function Ma(e,t,i){var r=[];try{let n=S(r,await Di(e,"r+",420,!1),!0);await n.utimes(new Date(t),new Date(i))}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Ma,"lutimes");async function Ue(e,t){e=x(e);let{base:i,dir:n}=jn(e),r=z(n=="/"?"/":await Ue(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return(await o.stat(a)).isSymbolicLink()?Ue(c+await $r(r)):r}catch(l){throw Y(l,{[a]:r})}}s(Ue,"realpath");function VS(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(VS,"watch");async function Wa(e,t=0){if(!(await st(e)).hasAccess(t))throw new u(13)}s(Wa,"access");async function Vr(e,t){switch(e=x(e),(await st(e)).mode&61440){case 16384:if(t?.recursive)for(let n of await Ht(e))await Vr(z(e,n),t);await qr(e);return;case 32768:case 40960:await Tn(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(Vr,"rm");async function Ua(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await Ln(r),i=="buffer"?oi.Buffer.from(r):r}s(Ua,"mkdtemp");async function Hr(e,t,i){if(e=x(e),t=x(t),i&&i&1&&await je(t))throw new u(17,"Destination file already exists.",t,"copyFile");await Mi(t,await Rn(e)),W("rename",t.toString())}s(Hr,"copyFile");async function ja(e,t){return e=x(e),new Ot(e)}s(ja,"opendir");async function Kr(e,t,i){e=x(e),t=x(t);let n=await jr(e);if(i?.errorOnExist&&await je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");await Ln(t,{recursive:!0});for(let r of await Ht(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||await Kr(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:await Hr(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&await zr(t,n.atime,n.mtime)}s(Kr,"cp");async function qa(e,t){e=x(e);let{fs:i}=R(e);return Jn(i,t?.bigint)}s(qa,"statfs");var I=s(()=>{},"nop");function qd(e,t,i=I){Oa(e,t).then(()=>i()).catch(i)}s(qd,"rename");function $d(e,t=I){je(e).then(t).catch(()=>t(!1))}s($d,"exists");function zd(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(zd,"stat");function Vd(e,t,i=I){i=typeof t=="function"?t:i,jr(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(Vd,"lstat");function Hd(e,t=0,i=I){i=typeof t=="function"?t:i,Pa(e,typeof t=="number"?t:0).then(()=>i()).catch(i)}s(Hd,"truncate");function Kd(e,t=I){Tn(e).then(()=>t()).catch(t)}s(Kd,"unlink");function Gd(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(Gd,"open");function Yd(e,t,i=I){i=typeof t=="function"?t:i,Rn(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(Yd,"readFile");function Xd(e,t,i,n=I){n=typeof i=="function"?i:n,Mi(e,t,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(Xd,"writeFile");function Jd(e,t,i,n=I){let r=typeof i!="function"?i:void 0;n=typeof i=="function"?i:n,Ta(e,t,r).then(()=>n()).catch(n)}s(Jd,"appendFile");function Qd(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(Qd,"fstat");function Zd(e,t=I){new ce(e).close().then(()=>t()).catch(t)}s(Zd,"close");function eh(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(eh,"ftruncate");function th(e,t=I){j(e).sync().then(()=>t()).catch(t)}s(th,"fsync");function ih(e,t=I){j(e).datasync().then(()=>t()).catch(t)}s(ih,"fdatasync");function nh(e,t,i,n,r,o=I){let a,c,l,f,d,h=new ce(e);if(typeof t=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new u(22,"Invalid arguments."));return}a=za.Buffer.from(t),c=0,l=a.length;let b=o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a.toString(d))).catch(b)}else{a=za.Buffer.from(t.buffer),c=i,l=n,f=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a)).catch(b)}}s(nh,"write");function rh(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(rh,"read");function oh(e,t,i,n=I){new ce(e).chown(t,i).then(()=>n()).catch(n)}s(oh,"fchown");function sh(e,t,i){new ce(e).chmod(t).then(()=>i()).catch(i)}s(sh,"fchmod");function ah(e,t,i,n=I){new ce(e).utimes(t,i).then(()=>n()).catch(n)}s(ah,"futimes");function ch(e,t=I){qr(e).then(()=>t()).catch(t)}s(ch,"rmdir");function lh(e,t,i=I){Ln(e,t).then(()=>i()).catch(i)}s(lh,"mkdir");function fh(e,t,i=I){i=typeof t=="function"?t:i,Ht(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(fh,"readdir");function uh(e,t,i=I){Ra(e,t).then(()=>i()).catch(i)}s(uh,"link");function dh(e,t,i,n=I){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,La(e,t,r).then(()=>n()).catch(n)}s(dh,"symlink");function hh(e,t,i=I){i=typeof t=="function"?t:i,$r(e).then(n=>i(void 0,n)).catch(i)}s(hh,"readlink");function ph(e,t,i,n=I){Na(e,t,i).then(()=>n()).catch(n)}s(ph,"chown");function yh(e,t,i,n=I){Ca(e,t,i).then(()=>n()).catch(n)}s(yh,"lchown");function mh(e,t,i=I){Ba(e,t).then(()=>i()).catch(i)}s(mh,"chmod");function bh(e,t,i=I){Da(e,t).then(()=>i()).catch(i)}s(bh,"lchmod");function gh(e,t,i,n=I){zr(e,t,i).then(()=>n()).catch(n)}s(gh,"utimes");function wh(e,t,i,n=I){Ma(e,t,i).then(()=>n()).catch(n)}s(wh,"lutimes");function Sh(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(Sh,"realpath");function Eh(e,t,i=I){let n=typeof t=="number"?t:4;i=typeof t=="function"?t:i,Wa(e,n).then(()=>i()).catch(i)}s(Eh,"access");var Wi=new Map;function _h(e,t,i){let n=x(e.toString()),r=typeof t!="function"?t:{};if(typeof t=="function"&&(i=t),!i)throw new u(22,"No listener specified",e.toString(),"watchFile");if(Wi.has(n)){let a=Wi.get(n);a&&a.listeners.add(i);return}let o=new Zn(n,r);o.on("change",(a,c)=>{let l=Wi.get(n);if(l)for(let f of l.listeners)f(a,c)}),Wi.set(n,{watcher:o,listeners:new Set})}s(_h,"watchFile");function xh(e,t=I){let i=x(e.toString()),n=Wi.get(i);n&&(t&&t!==I?n.listeners.delete(t):n.listeners.clear(),n.listeners.size===0&&(n.watcher.stop(),Wi.delete(i)))}s(xh,"unwatchFile");function kh(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(kh,"watch");function vh(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Nt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{n||=await Se(e,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},"read"),destroy:s(function(o,a){n?.close().then(()=>a(o)).catch(I)},"destroy")});return r.path=e.toString(),r}s(vh,"createReadStream");function Fh(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(Fh,"createWriteStream");function Ih(e,t,i=I){i=typeof t=="function"?t:i,Vr(e,typeof t=="function"?void 0:t).then(()=>i(void 0)).catch(i)}s(Ih,"rm");function Ah(e,t,i=I){i=typeof t=="function"?t:i,Ua(e,typeof t!="function"?t:null).then(n=>i(void 0,n)).catch(i)}s(Ah,"mkdtemp");function Oh(e,t,i,n=I){n=typeof i=="function"?i:n,Hr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Oh,"copyFile");function Ph(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(Ph,"readv");function Th(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(Th,"writev");function Rh(e,t,i=I){i=typeof t=="function"?t:i,ja(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Rh,"opendir");function Lh(e,t,i,n=I){n=typeof i=="function"?i:n,Kr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Lh,"cp");function Nh(e,t,i=I){i=typeof t=="function"?t:i,qa(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Nh,"statfs");async function Ch(e,t){let i=await Se(e.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],t)}s(Ch,"openAsBlob");function Bh(e){return Hi(e)||Vi(e)||e instanceof pe}s(Bh,"isMountConfig");async function Ui(e,t=0){if(typeof e!="object"||e==null)throw new u(22,"Invalid options on mount configuration");if(!Bh(e))throw new u(22,"Invalid mount configuration");if(e instanceof pe)return e;Vi(e)&&(e={backend:e});for(let[r,o]of Object.entries(e))if(r!="backend"&&Bh(o)){if(t>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");e[r]=await Ui(o,++t)}let{backend:i}=e;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await lo(i,e);let n=await i.create(e);return n._disableSync=e.disableAsyncCache||!1,await n.ready(),n}s(Ui,"resolveMountConfig");async function HS(e){if(!Hi(e))throw new TypeError("Invalid single mount point configuration");let t=await Ui(e);gi("/"),zt("/",t)}s(HS,"configureSingle");async function KS(e){let t="uid"in e&&e.uid||0,i="gid"in e&&e.gid||0;if(Object.assign(ye,{uid:t,gid:i,suid:t,sgid:i,euid:t,egid:i}),!!e.mounts){for(let[n,r]of Object.entries(e.mounts)){if(!n.startsWith("/"))throw new u(22,"Mount points must have absolute paths");Hi(r)&&(r.disableAsyncCache??=e.disableAsyncCache||!1),e.mounts[n]=await Ui(r)}pn(e.mounts)}}s(KS,"configure");function Va(e){let i=class i extends e{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(o=>{let a=s(()=>this._queueRunning?setTimeout(a):o(),"check");a()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(o){throw this._isInitialized=!1,o}}}checkSync(o,a){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",o,a);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",o,a)}renameSync(o,a){this.checkSync(o,"rename"),this._sync.renameSync(o,a),this.queue("rename",o,a)}statSync(o){return this.checkSync(o,"stat"),this._sync.statSync(o)}createFileSync(o,a,c){return this.checkSync(o,"createFile"),this._sync.createFileSync(o,a,c),this.queue("createFile",o,a,c),this.openFileSync(o,a)}openFileSync(o,a){this.checkSync(o,"openFile");let c=this._sync.openFileSync(o,a),l=c.statSync(),f=new Uint8Array(l.size);return c.readSync(f),new we(this,o,a,l,f)}unlinkSync(o){this.checkSync(o,"unlinkSync"),this._sync.unlinkSync(o),this.queue("unlink",o)}rmdirSync(o){this.checkSync(o,"rmdir"),this._sync.rmdirSync(o),this.queue("rmdir",o)}mkdirSync(o,a){this.checkSync(o,"mkdir"),this._sync.mkdirSync(o,a),this.queue("mkdir",o,a)}readdirSync(o){return this.checkSync(o,"readdir"),this._sync.readdirSync(o)}linkSync(o,a){this.checkSync(o,"link"),this._sync.linkSync(o,a),this.queue("link",o,a)}syncSync(o,a,c){this.checkSync(o,"sync"),this._sync.syncSync(o,a,c),this.queue("sync",o,a,c)}existsSync(o){return this.checkSync(o,"exists"),this._sync.existsSync(o)}async crossCopy(o){this.checkSync(o,"crossCopy");let a=await this.stat(o);if(!a.isDirectory()){var l=[];try{let p=S(l,await this.openFile(o,M("r")),!0);let w=S(l,this._sync.createFileSync(o,M("w"),a.mode));let g=new Uint8Array(a.size);await p.read(g);w.writeSync(g,0,a.size);return}catch(f){var d=f,h=!0}finally{var b=E(l,d,h);b&&await b}}if(o!=="/"){let p=await this.stat(o);this._sync.mkdirSync(o,p.mode)}let c=await this.readdir(o);for(let p of c)await this.crossCopy(z(o,p))}async _next(){if(!this._queueRunning)return;let[o,...a]=this._queue.shift();await this[o](...a),await this._next()}queue(...o){this._queue.push(o),this._next()}};s(i,"AsyncFS");let t=i;return t}s(Va,"Async");function GS(e){return typeof e=="object"&&e!=null&&"fd"in e&&"path"in e&&"position"in e}s(GS,"isFileData");function Ha(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}s(Ha,"isMessage");var ji=new Map;function Ka(e,{port:t,timeout:i=1e3,fs:n}={}){let r=`
|
|
3
|
+
`+new Error().stack.slice(6);if(!t)throw u.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);ji.set(c,{resolve:o,reject:a,fs:n}),t.postMessage({...e,_zenfs:!0,id:c,stack:r});let l=setTimeout(()=>{let f=new u(5,"RPC Failed");f.stack+=r,a(f),typeof l=="object"&&l.unref()},i)})}s(Ka,"request");function Dh(e){if(!Ha(e))return;let{id:t,value:i,error:n,stack:r}=e;if(!ji.has(t)){let l=new u(5,"Invalid RPC id:"+t);throw l.stack+=r,l}let{resolve:o,reject:a,fs:c}=ji.get(t);if(n){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=r,a(l),ji.delete(t);return}if(GS(i)){let{fd:l,path:f,position:d}=i,h=new Bn(c,l,f,d);o(h),ji.delete(t);return}o(i),ji.delete(t)}s(Dh,"handleResponse");function Gr(e,t){if(!e)throw u.With("EINVAL");e["on"in e?"on":"addEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Gr,"attach");function Ga(e,t){if(!e)throw u.With("EINVAL");e["off"in e?"off":"removeEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Ga,"detach");function Mh(e){let t=[],i=t.push.bind(t);return Gr(e,i),function(n){Ga(e,i);for(let r of t){let o="data"in r?r.data:r;Dn(e,n,o)}}}s(Mh,"catchMessages");var Ya=class Ya extends qt{constructor(i,n,r,o){super(i,r);this.fs=i;this.fd=n;this.position=o}rpc(i,...n){return Ka({scope:"file",fd:this.fd,method:i,args:n},this.fs.options)}_throwNoSync(i){throw new u(95,"Synchronous operations not supported on PortFile",this.path,i)}async stat(){return new G(await this.rpc("stat"))}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,n,r,o){return this.rpc("write",i,n,r,o)}writeSync(){this._throwNoSync("write")}async read(i,n,r,o){return await this.rpc("read",i,n,r,o)}readSync(){this._throwNoSync("read")}chown(i,n){return this.rpc("chown",i,n)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,n){return this.rpc("utimes",i,n)}utimesSync(){this._throwNoSync("utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){this._throwNoSync("_setType")}close(){return this.rpc("close")}closeSync(){this._throwNoSync("close")}sync(){return this.rpc("sync")}syncSync(){this._throwNoSync("sync")}};s(Ya,"PortFile");var Bn=Ya,Xa=class Xa extends Va(pe){constructor(i){super();this.options=i;this._sync=dn.create({name:"port-tmpfs"});this.port=i.port,Gr(this.port,Dh)}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return Ka({scope:"fs",method:i,args:n},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,n){return this.rpc("rename",i,n)}async stat(i){return new G(await this.rpc("stat",i))}sync(i,n,r){return this.rpc("sync",i,n,r)}openFile(i,n){return this.rpc("openFile",i,n)}createFile(i,n,r){return this.rpc("createFile",i,n,r)}unlink(i){return this.rpc("unlink",i)}rmdir(i){return this.rpc("rmdir",i)}mkdir(i,n){return this.rpc("mkdir",i,n)}readdir(i){return this.rpc("readdir",i)}exists(i){return this.rpc("exists",i)}link(i,n){return this.rpc("link",i,n)}};s(Xa,"PortFS");var Xr=Xa,Wh=0,Yr=new Map;async function Dn(e,t,i){if(!Ha(i))return;let{method:n,args:r,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await t[n](...r),l instanceof qt&&(Yr.set(++Wh,l),l={fd:Wh,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Yr.has(d))throw new u(9);l=await Yr.get(d)[n](...r),n=="close"&&Yr.delete(d);break;default:return}}catch(d){l=d instanceof u?d.toJSON():d.toString(),f=!0}e.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:n,stack:c,value:l})}s(Dn,"handleRequest");function Uh(e,t){Gr(e,i=>Dn(e,t,i))}s(Uh,"attachFS");function XS(e,t){Ga(e,i=>Dn(e,t,i))}s(XS,"detachFS");var jh={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 Xr(e)},"create")},JS=jh;async function QS(e,t,i=0){let n=Mh(e),r=await Ui(t,i);return Uh(e,r),n(r),r}s(QS,"resolveRemoteMount");function Ja(e){let i=class i extends e{metadata(){return{...super.metadata(),readonly:!0}}async rename(r,o){throw new u(30)}renameSync(r,o){throw new u(30)}async createFile(r,o,a){throw new u(30)}createFileSync(r,o,a){throw new u(30)}async unlink(r){throw new u(30)}unlinkSync(r){throw new u(30)}async rmdir(r){throw new u(30)}rmdirSync(r){throw new u(30)}async mkdir(r,o){throw new u(30)}mkdirSync(r,o){throw new u(30)}async link(r,o){throw new u(30)}linkSync(r,o){throw new u(30)}async sync(r,o,a){throw new u(30)}syncSync(r,o,a){throw new u(30)}};s(i,"ReadonlyFS");let t=i;return t}s(Ja,"Readonly");var Qa=1,Qr=class Qr extends Map{files(){let t=new Map;for(let[i,n]of this)n.isFile()&&t.set(i,n);return t}toJSON(){return{version:Qa,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(t){let i=[];for(let n of this.keys())_(n)==t&&i.push(D(n));return i}fromJSON(t){if(t.version!=Qa)throw new u(22,"Index version mismatch");this.clear();for(let[i,n]of Object.entries(t.entries)){let r=new G(n);r.isDirectory()&&(r.fileData=Ne(JSON.stringify(this.dirEntries(i)))),this.set(i,r)}}static parse(t){if(!Wc(t))throw new u(22,"Invalid JSON");let i=JSON.parse(t),n=new Qr;return n.fromJSON(i),n}};s(Qr,"Index");var Jr=Qr,Za=class Za extends Ja(pe){constructor(i){super();this.indexData=i;this.index=new Jr;this._isInitialized=!1}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=await this.getData(i,n)}reloadFilesSync(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=this.getDataSync(i,n)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw u.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:await this.getData(i,r))}openFileSync(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:this.getDataSync(i,r))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let n=this.index.get(i);if(!n)throw u.With("ENOENT",i,"readdir");if(!n.isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=JSON.parse(ai(n.fileData));if(!Array.isArray(r))throw u.With("ENODATA",i,"readdir");if(!r.every(o=>typeof o=="string"))throw u.With("ENODATA",i,"readdir");return r}};s(Za,"IndexFS");var Mn=Za;async function qh(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(qh,"fetchFile");var eo=class eo extends Mn{async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[t,i]of this.index.files())await this.getData(t,i)}constructor({index:t="index.json",baseUrl:i=""}){super(typeof t!="string"?t:qh(t,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:eo.name,readonly:!0}}preload(t,i){let n=this.index.get(t);if(!n)throw u.With("ENOENT",t,"preload");if(!n.isFile())throw u.With("EISDIR",t,"preload");n.size=i.length,n.fileData=i}async getData(t,i){if(i.fileData)return i.fileData;let n=await qh(this.baseUrl+(t.startsWith("/")?t.slice(1):t),"buffer");return i.fileData=n,n}getDataSync(t,i){if(i.fileData)return i.fileData;throw new u(61,"",t,"getData")}};s(eo,"FetchFS");var Zr=eo,ZS={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(e){return new Zr(e)},"create")},eE=ZS;var tc=class tc{constructor(t){this.previous=t;this.current=Promise.withResolvers();this._isLocked=!0}get isLocked(){return this._isLocked}async done(){await this.previous?.done(),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}};s(tc,"MutexLock");var to=tc,ic=class ic{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){let t=new to(this.currentLock);return this.currentLock=t,t}async lock(t,i){let n=this.currentLock,r=this.addLock(),o=new Error().stack;return setTimeout(()=>{if(r.isLocked){let a=u.With("EDEADLK",t,i);throw a.stack+=o?.slice(5),a}},5e3),await n?.done(),r}lockSync(t,i){if(this.currentLock)throw u.With("EBUSY",t,i);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,i){var r=[];try{let n=S(r,await this.lock(t,"rename"));await this._fs.rename(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}renameSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"rename"));return this._fs.renameSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async stat(t){var n=[];try{let i=S(n,await this.lock(t,"stat"));return await this._fs.stat(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}statSync(t){var n=[];try{let i=S(n,this.lockSync(t,"stat"));return this._fs.statSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async openFile(t,i){var o=[];try{let n=S(o,await this.lock(t,"openFile"));let r=await this._fs.openFile(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}openFileSync(t,i){var o=[];try{let n=S(o,this.lockSync(t,"openFile"));let r=this._fs.openFileSync(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async createFile(t,i,n){var a=[];try{let r=S(a,await this.lock(t,"createFile"));let o=await this._fs.createFile(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}createFileSync(t,i,n){var a=[];try{let r=S(a,this.lockSync(t,"createFile"));let o=this._fs.createFileSync(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async unlink(t){var n=[];try{let i=S(n,await this.lock(t,"unlink"));await this._fs.unlink(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}unlinkSync(t){var n=[];try{let i=S(n,this.lockSync(t,"unlink"));return this._fs.unlinkSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async rmdir(t){var n=[];try{let i=S(n,await this.lock(t,"rmdir"));await this._fs.rmdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}rmdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"rmdir"));return this._fs.rmdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async mkdir(t,i){var r=[];try{let n=S(r,await this.lock(t,"mkdir"));await this._fs.mkdir(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}mkdirSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"mkdir"));return this._fs.mkdirSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async readdir(t){var n=[];try{let i=S(n,await this.lock(t,"readdir"));return await this._fs.readdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}readdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"readdir"));return this._fs.readdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async exists(t){var n=[];try{let i=S(n,await this.lock(t,"exists"));return await this._fs.exists(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}existsSync(t){var n=[];try{let i=S(n,this.lockSync(t,"exists"));return this._fs.existsSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async link(t,i){var r=[];try{let n=S(r,await this.lock(t,"link"));await this._fs.link(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}linkSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"link"));return this._fs.linkSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async sync(t,i,n){var o=[];try{let r=S(o,await this.lock(t,"sync"));await this._fs.sync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}syncSync(t,i,n){var o=[];try{let r=S(o,this.lockSync(t,"sync"));return this._fs.syncSync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}};s(ic,"__MutexedFS");var io=ic;function ec(e){let i=class i extends io{constructor(...r){super(),this._fs=new e(...r)}};s(i,"MutexedFS");let t=i;return t}s(ec,"Mutexed");var nc="/.deleted",rc=class rc extends pe{constructor({writable:i,readable:n}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this.writable=i,this.readable=n,this.writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:Wn.name}}async sync(i,n,r){await this.createParentDirectories(i),await this.writable.exists(i)||await this.writable.createFile(i,"w",420),await this.writable.sync(i,n,r)}syncSync(i,n,r){this.createParentDirectoriesSync(i),this.writable.syncSync(i,n,r)}async _initialize(){if(!this._isInitialized){try{let i=await this.writable.openFile(nc,M("r")),{size:n}=await i.stat(),{buffer:r}=await i.read(new Uint8Array(n));this._deleteLog=ai(r)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("")}async rename(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{await this.writable.rename(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}renameSync(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{this.writable.renameSync(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}async stat(i){this.checkInitialized();try{return await this.writable.stat(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(await this.readable.stat(i));return r.mode|=146,r}}statSync(i){this.checkInitialized();try{return this.writable.statSync(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(this.readable.statSync(i));return r.mode|=146,r}}async openFile(i,n){if(await this.writable.exists(i))return this.writable.openFile(i,n);let r=await this.readable.openFile(i,M("r")),o=new G(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new we(this,i,n,o,a)}openFileSync(i,n){if(this.writable.existsSync(i))return this.writable.openFileSync(i,n);let r=this.readable.openFileSync(i,M("r")),o=new G(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new we(this,i,n,o,a)}async createFile(i,n,r){return this.checkInitialized(),await this.writable.createFile(i,n,r),this.openFile(i,n)}createFileSync(i,n,r){return this.checkInitialized(),this.writable.createFileSync(i,n,r),this.openFileSync(i,n)}async link(i,n){this.checkInitialized(),await this.writable.link(i,n)}linkSync(i,n){this.checkInitialized(),this.writable.linkSync(i,n)}async unlink(i){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i))throw u.With("ENOENT",i,"unlink");await this.writable.exists(i)&&await this.writable.unlink(i),await this.exists(i)&&await this.deletePath(i)}unlinkSync(i){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i))throw u.With("ENOENT",i,"unlink");this.writable.existsSync(i)&&this.writable.unlinkSync(i),this.existsSync(i)&&this.deletePath(i)}async rmdir(i){if(this.checkInitialized(),!await this.exists(i))throw u.With("ENOENT",i,"rmdir");if(await this.writable.exists(i)&&await this.writable.rmdir(i),await this.exists(i)){if((await this.readdir(i)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i)}}rmdirSync(i){if(this.checkInitialized(),!this.existsSync(i))throw u.With("ENOENT",i,"rmdir");if(this.writable.existsSync(i)&&this.writable.rmdirSync(i),this.existsSync(i)){if(this.readdirSync(i).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.deletePath(i)}}async mkdir(i,n){if(this.checkInitialized(),await this.exists(i))throw u.With("EEXIST",i,"mkdir");await this.createParentDirectories(i),await this.writable.mkdir(i,n)}mkdirSync(i,n){if(this.checkInitialized(),this.existsSync(i))throw u.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i),this.writable.mkdirSync(i,n)}async readdir(i){if(this.checkInitialized(),!(await this.stat(i)).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r.push(...await this.writable.readdir(i))}catch{}try{r.push(...(await this.readable.readdir(i)).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}readdirSync(i){if(this.checkInitialized(),!this.statSync(i).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r=r.concat(this.writable.readdirSync(i))}catch{}try{r=r.concat(this.readable.readdirSync(i).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}async deletePath(i){this._deletedFiles.add(i),await this.updateLog(`d${i}
|
|
4
|
+
`)}async updateLog(i){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this.writable.openFile(nc,M("w"));try{await n.write(Ne(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(r){this._deleteLogError=r}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let i of this._deleteLog.split(`
|
|
5
|
+
`))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==nc)throw u.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i){let n=_(i),r=[];for(;!this.writable.existsSync(n);)r.push(n),n=_(n);for(let o of r.reverse())this.writable.mkdirSync(o,this.statSync(o).mode)}async createParentDirectories(i){let n=_(i),r=[];for(;!await this.writable.exists(n);)r.push(n),n=_(n);for(let o of r.reverse()){let a=await this.stat(o);await this.writable.mkdir(o,a.mode)}}operateOnWritable(i){if(!this.existsSync(i))throw u.With("ENOENT",i,"operateOnWriteable");this.writable.existsSync(i)||this.copyToWritableSync(i)}async operateOnWritableAsync(i){if(!await this.exists(i))throw u.With("ENOENT",i,"operateOnWritable");if(!await this.writable.exists(i))return this.copyToWritable(i)}copyToWritableSync(i){let n=this.statSync(i);if(n.isDirectory()){this.writable.mkdirSync(i,n.mode);return}let r=new Uint8Array(n.size),o=this.readable.openFileSync(i,M("r"));o.readSync(r),o.closeSync();let a=this.writable.openFileSync(i,M("w"));a.writeSync(r),a.closeSync()}async copyToWritable(i){let n=await this.stat(i);if(n.isDirectory()){await this.writable.mkdir(i,n.mode);return}let r=new Uint8Array(n.size),o=await this.readable.openFile(i,M("r"));await o.read(r),await o.close();let a=await this.writable.openFile(i,M("w"));await a.write(r),await a.close()}};s(rc,"UnmutexedOverlayFS");var no=rc,oc=class oc extends ec(no){};s(oc,"OverlayFS");var Wn=oc,tE={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function(e){return new Wn(e)},"create")},iE=tE;function nE(e){let i=class i extends e{async exists(r){return this.existsSync(r)}async rename(r,o){return this.renameSync(r,o)}async stat(r){return this.statSync(r)}async createFile(r,o,a){return this.createFileSync(r,o,a)}async openFile(r,o){return this.openFileSync(r,o)}async unlink(r){return this.unlinkSync(r)}async rmdir(r){return this.rmdirSync(r)}async mkdir(r,o){return this.mkdirSync(r,o)}async readdir(r){return this.readdirSync(r)}async link(r,o){return this.linkSync(r,o)}async sync(r,o,a){return this.syncSync(r,o,a)}};s(i,"SyncFS");let t=i;return t}s(nE,"Sync");var rE=Cn;return Yh(oE);})();
|
|
5
6
|
/*! Bundled license information:
|
|
6
7
|
|
|
7
8
|
ieee754/index.js:
|