@zenfs/core 0.17.0 → 0.17.1
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/browser.min.js +4 -4
- package/dist/browser.min.js.map +4 -4
- package/dist/emulation/async.d.ts +1 -1
- package/dist/emulation/async.js +3 -2
- package/dist/filesystem.d.ts +4 -4
- package/dist/filesystem.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mixins/index.d.ts +4 -0
- package/dist/mixins/index.js +4 -0
- package/dist/mixins/readonly.d.ts +3 -3
- package/dist/utils.d.ts +0 -5
- package/dist/utils.js +0 -7
- package/package.json +3 -2
- package/src/emulation/async.ts +5 -3
- package/src/filesystem.ts +4 -4
- package/src/index.ts +1 -0
- package/src/mixins/index.ts +4 -0
- package/src/mixins/readonly.ts +3 -3
- package/src/mixins/sync.ts +3 -3
- package/src/utils.ts +0 -8
package/dist/browser.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var ZenFS=(()=>{var yd=Object.create;var Oi=Object.defineProperty;var md=Object.getOwnPropertyDescriptor;var bd=Object.getOwnPropertyNames;var gd=Object.getPrototypeOf,wd=Object.prototype.hasOwnProperty;var Ks=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ys=e=>{throw TypeError(e)};var s=(e,t)=>Oi(e,"name",{value:t,configurable:!0});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xr=(e,t)=>{for(var i in t)Oi(e,i,{get:t[i],enumerable:!0})},Xs=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of bd(t))!wd.call(e,n)&&n!==i&&Oi(e,n,{get:()=>t[n],enumerable:!(r=md(t,n))||r.enumerable});return e};var Ci=(e,t,i)=>(i=e!=null?yd(gd(e)):{},Xs(t||!e||!e.__esModule?Oi(i,"default",{value:e,enumerable:!0}):i,e)),Sd=e=>Xs(Oi({},"__esModule",{value:!0}),e);var S=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Ys("Object expected");var r;i&&(r=t[Ks("asyncDispose")]),r===void 0&&(r=t[Ks("dispose")]),typeof r!="function"&&Ys("Object not disposable"),e.push([i,r,t])}else i&&e.push([i]);return t},E=(e,t,i)=>{var r=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},n=a=>t=i?new r(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=>(n(l),o()))}catch(l){n(l)}if(i)throw t};return o()};var ca=C(Ar=>{"use strict";Ar.byteLength=tp;Ar.toByteArray=rp;Ar.fromByteArray=sp;var $e=[],ke=[],ep=typeof Uint8Array<"u"?Uint8Array:Array,Gn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Rt=0,sa=Gn.length;Rt<sa;++Rt)$e[Rt]=Gn[Rt],ke[Gn.charCodeAt(Rt)]=Rt;var Rt,sa;ke[45]=62;ke[95]=63;function aa(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 r=i===t?0:4-i%4;return[i,r]}s(aa,"getLens");function tp(e){var t=aa(e),i=t[0],r=t[1];return(i+r)*3/4-r}s(tp,"byteLength");function ip(e,t,i){return(t+i)*3/4-i}s(ip,"_byteLength");function rp(e){var t,i=aa(e),r=i[0],n=i[1],o=new ep(ip(e,r,n)),a=0,c=n>0?r-4:r,l;for(l=0;l<c;l+=4)t=ke[e.charCodeAt(l)]<<18|ke[e.charCodeAt(l+1)]<<12|ke[e.charCodeAt(l+2)]<<6|ke[e.charCodeAt(l+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return n===2&&(t=ke[e.charCodeAt(l)]<<2|ke[e.charCodeAt(l+1)]>>4,o[a++]=t&255),n===1&&(t=ke[e.charCodeAt(l)]<<10|ke[e.charCodeAt(l+1)]<<4|ke[e.charCodeAt(l+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}s(rp,"toByteArray");function np(e){return $e[e>>18&63]+$e[e>>12&63]+$e[e>>6&63]+$e[e&63]}s(np,"tripletToBase64");function op(e,t,i){for(var r,n=[],o=t;o<i;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(np(r));return n.join("")}s(op,"encodeChunk");function sp(e){for(var t,i=e.length,r=i%3,n=[],o=16383,a=0,c=i-r;a<c;a+=o)n.push(op(e,a,a+o>c?c:a+o));return r===1?(t=e[i-1],n.push($e[t>>2]+$e[t<<4&63]+"==")):r===2&&(t=(e[i-2]<<8)+e[i-1],n.push($e[t>>10]+$e[t>>4&63]+$e[t<<2&63]+"=")),n.join("")}s(sp,"fromByteArray")});var la=C(Kn=>{Kn.read=function(e,t,i,r,n){var o,a,c=n*8-r-1,l=(1<<c)-1,f=l>>1,u=-7,p=i?n-1:0,b=i?-1:1,m=e[t+p];for(p+=b,o=m&(1<<-u)-1,m>>=-u,u+=c;u>0;o=o*256+e[t+p],p+=b,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=a*256+e[t+p],p+=b,u-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-f}return(m?-1:1)*a*Math.pow(2,o-r)};Kn.write=function(e,t,i,r,n,o){var a,c,l,f=o*8-n-1,u=(1<<f)-1,p=u>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,w=r?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=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=b/l:t+=b*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=u?(c=0,a=u):a+p>=1?(c=(t*l-1)*Math.pow(2,n),a=a+p):(c=t*Math.pow(2,p-1)*Math.pow(2,n),a=0));n>=8;e[i+m]=c&255,m+=w,c/=256,n-=8);for(a=a<<n|c,f+=n;f>0;e[i+m]=a&255,m+=w,a/=256,f-=8);e[i+m-w]|=g*128}});var ve=C(ci=>{"use strict";var Yn=ca(),si=la(),fa=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ci.Buffer=y;ci.SlowBuffer=dp;ci.INSPECT_MAX_BYTES=50;var Tr=2147483647;ci.kMaxLength=Tr;y.TYPED_ARRAY_SUPPORT=ap();!y.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 ap(){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(ap,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.buffer},"get")});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function at(e){if(e>Tr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,y.prototype),t}s(at,"createBuffer");function y(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 Zn(e)}return ha(e,t,i)}s(y,"Buffer");y.poolSize=8192;function ha(e,t,i){if(typeof e=="string")return lp(e,t);if(ArrayBuffer.isView(e))return fp(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(ze(e,ArrayBuffer)||e&&ze(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ze(e,SharedArrayBuffer)||e&&ze(e.buffer,SharedArrayBuffer)))return Jn(e,t,i);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return y.from(r,t,i);let n=up(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return y.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(ha,"from");y.from=function(e,t,i){return ha(e,t,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function ya(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(ya,"assertSize");function cp(e,t,i){return ya(e),e<=0?at(e):t!==void 0?typeof i=="string"?at(e).fill(t,i):at(e).fill(t):at(e)}s(cp,"alloc");y.alloc=function(e,t,i){return cp(e,t,i)};function Zn(e){return ya(e),at(e<0?0:eo(e)|0)}s(Zn,"allocUnsafe");y.allocUnsafe=function(e){return Zn(e)};y.allocUnsafeSlow=function(e){return Zn(e)};function lp(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!y.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let i=ma(e,t)|0,r=at(i),n=r.write(e,t);return n!==i&&(r=r.slice(0,n)),r}s(lp,"fromString");function Xn(e){let t=e.length<0?0:eo(e.length)|0,i=at(t);for(let r=0;r<t;r+=1)i[r]=e[r]&255;return i}s(Xn,"fromArrayLike");function fp(e){if(ze(e,Uint8Array)){let t=new Uint8Array(e);return Jn(t.buffer,t.byteOffset,t.byteLength)}return Xn(e)}s(fp,"fromArrayView");function Jn(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 r;return t===void 0&&i===void 0?r=new Uint8Array(e):i===void 0?r=new Uint8Array(e,t):r=new Uint8Array(e,t,i),Object.setPrototypeOf(r,y.prototype),r}s(Jn,"fromArrayBuffer");function up(e){if(y.isBuffer(e)){let t=eo(e.length)|0,i=at(t);return i.length===0||e.copy(i,0,0,t),i}if(e.length!==void 0)return typeof e.length!="number"||io(e.length)?at(0):Xn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Xn(e.data)}s(up,"fromObject");function eo(e){if(e>=Tr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tr.toString(16)+" bytes");return e|0}s(eo,"checked");function dp(e){return+e!=e&&(e=0),y.alloc(+e)}s(dp,"SlowBuffer");y.isBuffer=s(function(t){return t!=null&&t._isBuffer===!0&&t!==y.prototype},"isBuffer");y.compare=s(function(t,i){if(ze(t,Uint8Array)&&(t=y.from(t,t.offset,t.byteLength)),ze(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(t)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===i)return 0;let r=t.length,n=i.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==i[o]){r=t[o],n=i[o];break}return r<n?-1:n<r?1:0},"compare");y.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");y.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 y.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<t.length;++r)i+=t[r].length;let n=y.allocUnsafe(i),o=0;for(r=0;r<t.length;++r){let a=t[r];if(ze(a,Uint8Array))o+a.length>n.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(y.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function ma(e,t){if(y.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ze(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,r=arguments.length>2&&arguments[2]===!0;if(!r&&i===0)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Qn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return va(e).length;default:if(n)return r?-1:Qn(e).length;t=(""+t).toLowerCase(),n=!0}}s(ma,"byteLength");y.byteLength=ma;function pp(e,t,i){let r=!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 xp(this,t,i);case"utf8":case"utf-8":return ga(this,t,i);case"ascii":return Ep(this,t,i);case"latin1":case"binary":return _p(this,t,i);case"base64":return wp(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kp(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}s(pp,"slowToString");y.prototype._isBuffer=!0;function Nt(e,t,i){let r=e[t];e[t]=e[i],e[i]=r}s(Nt,"swap");y.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)Nt(this,i,i+1);return this},"swap16");y.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)Nt(this,i,i+3),Nt(this,i+1,i+2);return this},"swap32");y.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)Nt(this,i,i+7),Nt(this,i+1,i+6),Nt(this,i+2,i+5),Nt(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let t=this.length;return t===0?"":arguments.length===0?ga(this,0,t):pp.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(t){if(!y.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:y.compare(this,t)===0},"equals");y.prototype.inspect=s(function(){let t="",i=ci.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},"inspect");fa&&(y.prototype[fa]=y.prototype.inspect);y.prototype.compare=s(function(t,i,r,n,o){if(ze(t,Uint8Array)&&(t=y.from(t,t.offset,t.byteLength)),!y.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),r===void 0&&(r=t?t.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),i<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&i>=r)return 0;if(n>=o)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;let a=o-n,c=r-i,l=Math.min(a,c),f=this.slice(n,o),u=t.slice(i,r);for(let p=0;p<l;++p)if(f[p]!==u[p]){a=f[p],c=u[p];break}return a<c?-1:c<a?1:0},"compare");function ba(e,t,i,r,n){if(e.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,io(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof t=="string"&&(t=y.from(t,r)),y.isBuffer(t))return t.length===0?-1:ua(e,t,i,r,n);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):ua(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}s(ba,"bidirectionalIndexOf");function ua(e,t,i,r,n){let o=1,a=e.length,c=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(u,p){return o===1?u[p]:u.readUInt16BE(p*o)}s(l,"read");let f;if(n){let u=-1;for(f=i;f<a;f++)if(l(e,f)===l(t,u===-1?0:f-u)){if(u===-1&&(u=f),f-u+1===c)return u*o}else u!==-1&&(f-=f-u),u=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let u=!0;for(let p=0;p<c;p++)if(l(e,f+p)!==l(t,p)){u=!1;break}if(u)return f}return-1}s(ua,"arrayIndexOf");y.prototype.includes=s(function(t,i,r){return this.indexOf(t,i,r)!==-1},"includes");y.prototype.indexOf=s(function(t,i,r){return ba(this,t,i,r,!0)},"indexOf");y.prototype.lastIndexOf=s(function(t,i,r){return ba(this,t,i,r,!1)},"lastIndexOf");function hp(e,t,i,r){i=Number(i)||0;let n=e.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let o=t.length;r>o/2&&(r=o/2);let a;for(a=0;a<r;++a){let c=parseInt(t.substr(a*2,2),16);if(io(c))return a;e[i+a]=c}return a}s(hp,"hexWrite");function yp(e,t,i,r){return Or(Qn(t,e.length-i),e,i,r)}s(yp,"utf8Write");function mp(e,t,i,r){return Or(Pp(t),e,i,r)}s(mp,"asciiWrite");function bp(e,t,i,r){return Or(va(t),e,i,r)}s(bp,"base64Write");function gp(e,t,i,r){return Or(Ap(t,e.length-i),e,i,r)}s(gp,"ucs2Write");y.prototype.write=s(function(t,i,r,n){if(i===void 0)n="utf8",r=this.length,i=0;else if(r===void 0&&typeof i=="string")n=i,r=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return hp(this,t,i,r);case"utf8":case"utf-8":return yp(this,t,i,r);case"ascii":case"latin1":case"binary":return mp(this,t,i,r);case"base64":return bp(this,t,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gp(this,t,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function wp(e,t,i){return t===0&&i===e.length?Yn.fromByteArray(e):Yn.fromByteArray(e.slice(t,i))}s(wp,"base64Slice");function ga(e,t,i){i=Math.min(e.length,i);let r=[],n=t;for(;n<i;){let o=e[n],a=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=i){let l,f,u,p;switch(c){case 1:o<128&&(a=o);break;case 2:l=e[n+1],(l&192)===128&&(p=(o&31)<<6|l&63,p>127&&(a=p));break;case 3:l=e[n+1],f=e[n+2],(l&192)===128&&(f&192)===128&&(p=(o&15)<<12|(l&63)<<6|f&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:l=e[n+1],f=e[n+2],u=e[n+3],(l&192)===128&&(f&192)===128&&(u&192)===128&&(p=(o&15)<<18|(l&63)<<12|(f&63)<<6|u&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=c}return Sp(r)}s(ga,"utf8Slice");var da=4096;function Sp(e){let t=e.length;if(t<=da)return String.fromCharCode.apply(String,e);let i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=da));return i}s(Sp,"decodeCodePointsArray");function Ep(e,t,i){let r="";i=Math.min(e.length,i);for(let n=t;n<i;++n)r+=String.fromCharCode(e[n]&127);return r}s(Ep,"asciiSlice");function _p(e,t,i){let r="";i=Math.min(e.length,i);for(let n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}s(_p,"latin1Slice");function xp(e,t,i){let r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);let n="";for(let o=t;o<i;++o)n+=Tp[e[o]];return n}s(xp,"hexSlice");function kp(e,t,i){let r=e.slice(t,i),n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}s(kp,"utf16leSlice");y.prototype.slice=s(function(t,i){let r=this.length;t=~~t,i=i===void 0?r:~~i,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<t&&(i=t);let n=this.subarray(t,i);return Object.setPrototypeOf(n,y.prototype),n},"slice");function ee(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(ee,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(t,i,r){t=t>>>0,i=i>>>0,r||ee(t,i,this.length);let n=this[t],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[t+a]*o;return n},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(t,i,r){t=t>>>0,i=i>>>0,r||ee(t,i,this.length);let n=this[t+--i],o=1;for(;i>0&&(o*=256);)n+=this[t+--i]*o;return n},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(t,i){return t=t>>>0,i||ee(t,1,this.length),this[t]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(t,i){return t=t>>>0,i||ee(t,2,this.length),this[t]|this[t+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(t,i){return t=t>>>0,i||ee(t,2,this.length),this[t]<<8|this[t+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},"readUInt32BE");y.prototype.readBigUInt64LE=bt(s(function(t){t=t>>>0,ai(t,"offset");let i=this[t],r=this[t+7];(i===void 0||r===void 0)&&Yi(t,this.length-8);let n=i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=bt(s(function(t){t=t>>>0,ai(t,"offset");let i=this[t],r=this[t+7];(i===void 0||r===void 0)&&Yi(t,this.length-8);let n=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+r;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(t,i,r){t=t>>>0,i=i>>>0,r||ee(t,i,this.length);let n=this[t],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[t+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*i)),n},"readIntLE");y.prototype.readIntBE=s(function(t,i,r){t=t>>>0,i=i>>>0,r||ee(t,i,this.length);let n=i,o=1,a=this[t+--n];for(;n>0&&(o*=256);)a+=this[t+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");y.prototype.readInt8=s(function(t,i){return t=t>>>0,i||ee(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},"readInt8");y.prototype.readInt16LE=s(function(t,i){t=t>>>0,i||ee(t,2,this.length);let r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");y.prototype.readInt16BE=s(function(t,i){t=t>>>0,i||ee(t,2,this.length);let r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r},"readInt16BE");y.prototype.readInt32LE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},"readInt32BE");y.prototype.readBigInt64LE=bt(s(function(t){t=t>>>0,ai(t,"offset");let i=this[t],r=this[t+7];(i===void 0||r===void 0)&&Yi(t,this.length-8);let n=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=bt(s(function(t){t=t>>>0,ai(t,"offset");let i=this[t],r=this[t+7];(i===void 0||r===void 0)&&Yi(t,this.length-8);let n=(i<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+r)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),si.read(this,t,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),si.read(this,t,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(t,i){return t=t>>>0,i||ee(t,8,this.length),si.read(this,t,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(t,i){return t=t>>>0,i||ee(t,8,this.length),si.read(this,t,!1,52,8)},"readDoubleBE");function pe(e,t,i,r,n,o){if(!y.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}s(pe,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(t,i,r,n){if(t=+t,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;pe(this,t,i,r,c,0)}let o=1,a=0;for(this[i]=t&255;++a<r&&(o*=256);)this[i+a]=t/o&255;return i+r},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(t,i,r,n){if(t=+t,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;pe(this,t,i,r,c,0)}let o=r-1,a=1;for(this[i+o]=t&255;--o>=0&&(a*=256);)this[i+o]=t/a&255;return i+r},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,1,255,0),this[i]=t&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,2,65535,0),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,2,65535,0),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(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");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(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 wa(e,t,i,r,n){ka(t,r,n,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(wa,"wrtBigUInt64LE");function Sa(e,t,i,r,n){ka(t,r,n,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(Sa,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=bt(s(function(t,i=0){return wa(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=bt(s(function(t,i=0){return Sa(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(t,i,r,n){if(t=+t,i=i>>>0,!n){let l=Math.pow(2,8*r-1);pe(this,t,i,r,l-1,-l)}let o=0,a=1,c=0;for(this[i]=t&255;++o<r&&(a*=256);)t<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+r},"writeIntLE");y.prototype.writeIntBE=s(function(t,i,r,n){if(t=+t,i=i>>>0,!n){let l=Math.pow(2,8*r-1);pe(this,t,i,r,l-1,-l)}let o=r-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+r},"writeIntBE");y.prototype.writeInt8=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,1,127,-128),t<0&&(t=255+t+1),this[i]=t&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,2,32767,-32768),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,2,32767,-32768),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(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");y.prototype.writeInt32BE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(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");y.prototype.writeBigInt64LE=bt(s(function(t,i=0){return wa(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=bt(s(function(t,i=0){return Sa(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Ea(e,t,i,r,n,o){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(Ea,"checkIEEE754");function _a(e,t,i,r,n){return t=+t,i=i>>>0,n||Ea(e,t,i,4,34028234663852886e22,-34028234663852886e22),si.write(e,t,i,r,23,4),i+4}s(_a,"writeFloat");y.prototype.writeFloatLE=s(function(t,i,r){return _a(this,t,i,!0,r)},"writeFloatLE");y.prototype.writeFloatBE=s(function(t,i,r){return _a(this,t,i,!1,r)},"writeFloatBE");function xa(e,t,i,r,n){return t=+t,i=i>>>0,n||Ea(e,t,i,8,17976931348623157e292,-17976931348623157e292),si.write(e,t,i,r,52,8),i+8}s(xa,"writeDouble");y.prototype.writeDoubleLE=s(function(t,i,r){return xa(this,t,i,!0,r)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(t,i,r){return xa(this,t,i,!1,r)},"writeDoubleBE");y.prototype.copy=s(function(t,i,r,n){if(!y.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=t.length&&(i=t.length),i||(i=0),n>0&&n<r&&(n=r),n===r||t.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-i<n-r&&(n=t.length-i+r);let o=n-r;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),i),o},"copy");y.prototype.fill=s(function(t,i,r,n){if(typeof t=="string"){if(typeof i=="string"?(n=i,i=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(t.length===1){let a=t.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(i<0||this.length<i||this.length<r)throw new RangeError("Out of range index");if(r<=i)return this;i=i>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);let o;if(typeof t=="number")for(o=i;o<r;++o)this[o]=t;else{let a=y.isBuffer(t)?t:y.from(t,n),c=a.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%c]}return this},"fill");var oi={};function to(e,t,i){oi[e]=class extends i{static{s(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}s(to,"E");to("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);to("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);to("ERR_OUT_OF_RANGE",function(e,t,i){let r=`The value of "${e}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=pa(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=pa(n)),n+="n"),r+=` It must be ${t}. Received ${n}`,r},RangeError);function pa(e){let t="",i=e.length,r=e[0]==="-"?1:0;for(;i>=r+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(pa,"addNumericalSeparator");function vp(e,t,i){ai(t,"offset"),(e[t]===void 0||e[t+i]===void 0)&&Yi(t,e.length-(i+1))}s(vp,"checkBounds");function ka(e,t,i,r,n,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 oi.ERR_OUT_OF_RANGE("value",c,e)}vp(r,n,o)}s(ka,"checkIntBI");function ai(e,t){if(typeof e!="number")throw new oi.ERR_INVALID_ARG_TYPE(t,"number",e)}s(ai,"validateNumber");function Yi(e,t,i){throw Math.floor(e)!==e?(ai(e,i),new oi.ERR_OUT_OF_RANGE(i||"offset","an integer",e)):t<0?new oi.ERR_BUFFER_OUT_OF_BOUNDS:new oi.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}s(Yi,"boundsError");var Fp=/[^+/0-9A-Za-z-_]/g;function Ip(e){if(e=e.split("=")[0],e=e.trim().replace(Fp,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}s(Ip,"base64clean");function Qn(e,t){t=t||1/0;let i,r=e.length,n=null,o=[];for(let a=0;a<r;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=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(Qn,"utf8ToBytes");function Pp(e){let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i)&255);return t}s(Pp,"asciiToBytes");function Ap(e,t){let i,r,n,o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}s(Ap,"utf16leToBytes");function va(e){return Yn.toByteArray(Ip(e))}s(va,"base64ToBytes");function Or(e,t,i,r){let n;for(n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}s(Or,"blitBuffer");function ze(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}s(ze,"isInstance");function io(e){return e!==e}s(io,"numberIsNaN");var Tp=function(){let e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){let r=i*16;for(let n=0;n<16;++n)t[r+n]=e[i]+e[n]}return t}();function bt(e){return typeof BigInt>"u"?Op:e}s(bt,"defineBigIntMethod");function Op(){throw new Error("BigInt not supported")}s(Op,"BufferBigIntNotDefined")});var j=C((rE,Ja)=>{"use strict";Ja.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 ui=C((oE,Wr)=>{"use strict";var{AbortController:Qa,AbortSignal:Rp}=typeof self<"u"?self:typeof window<"u"?window:void 0;Wr.exports=Qa;Wr.exports.AbortSignal=Rp;Wr.exports.default=Qa});var ir=C((sE,fo)=>{"use strict";var di=typeof Reflect=="object"?Reflect:null,Za=di&&typeof di.apply=="function"?di.apply:s(function(t,i,r){return Function.prototype.apply.call(t,i,r)},"ReflectApply"),Ur;di&&typeof di.ownKeys=="function"?Ur=di.ownKeys:Object.getOwnPropertySymbols?Ur=s(function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))},"ReflectOwnKeys"):Ur=s(function(t){return Object.getOwnPropertyNames(t)},"ReflectOwnKeys");function Np(e){console&&console.warn&&console.warn(e)}s(Np,"ProcessEmitWarning");var tc=Number.isNaN||s(function(t){return t!==t},"NumberIsNaN");function L(){L.init.call(this)}s(L,"EventEmitter");fo.exports=L;fo.exports.once=Mp;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount=0;L.prototype._maxListeners=void 0;var ec=10;function jr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}s(jr,"checkListener");Object.defineProperty(L,"defaultMaxListeners",{enumerable:!0,get:s(function(){return ec},"get"),set:s(function(e){if(typeof e!="number"||e<0||tc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ec=e},"set")});L.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};L.prototype.setMaxListeners=s(function(t){if(typeof t!="number"||t<0||tc(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 ic(e){return e._maxListeners===void 0?L.defaultMaxListeners:e._maxListeners}s(ic,"_getMaxListeners");L.prototype.getMaxListeners=s(function(){return ic(this)},"getMaxListeners");L.prototype.emit=s(function(t){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=t==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){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")Za(l,this,i);else for(var f=l.length,u=ac(l,f),r=0;r<f;++r)Za(u[r],this,i);return!0},"emit");function rc(e,t,i,r){var n,o,a;if(jr(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]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=ic(e),n>0&&a.length>n&&!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,Np(c)}return e}s(rc,"_addListener");L.prototype.addListener=s(function(t,i){return rc(this,t,i,!1)},"addListener");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=s(function(t,i){return rc(this,t,i,!0)},"prependListener");function Lp(){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(Lp,"onceWrapper");function nc(e,t,i){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},n=Lp.bind(r);return n.listener=i,r.wrapFn=n,n}s(nc,"_onceWrap");L.prototype.once=s(function(t,i){return jr(i),this.on(t,nc(this,t,i)),this},"once");L.prototype.prependOnceListener=s(function(t,i){return jr(i),this.prependListener(t,nc(this,t,i)),this},"prependOnceListener");L.prototype.removeListener=s(function(t,i){var r,n,o,a,c;if(jr(i),n=this._events,n===void 0)return this;if(r=n[t],r===void 0)return this;if(r===i||r.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||i));else if(typeof r!="function"){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){c=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():Bp(r,o),r.length===1&&(n[t]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",t,c||i)}return this},"removeListener");L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners=s(function(t){var i,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var o=Object.keys(r),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=r[t],typeof i=="function")this.removeListener(t,i);else if(i!==void 0)for(n=i.length-1;n>=0;n--)this.removeListener(t,i[n]);return this},"removeAllListeners");function oc(e,t,i){var r=e._events;if(r===void 0)return[];var n=r[t];return n===void 0?[]:typeof n=="function"?i?[n.listener||n]:[n]:i?Dp(n):ac(n,n.length)}s(oc,"_listeners");L.prototype.listeners=s(function(t){return oc(this,t,!0)},"listeners");L.prototype.rawListeners=s(function(t){return oc(this,t,!1)},"rawListeners");L.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):sc.call(e,t)};L.prototype.listenerCount=sc;function sc(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(sc,"listenerCount");L.prototype.eventNames=s(function(){return this._eventsCount>0?Ur(this._events):[]},"eventNames");function ac(e,t){for(var i=new Array(t),r=0;r<t;++r)i[r]=e[r];return i}s(ac,"arrayClone");function Bp(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}s(Bp,"spliceOne");function Dp(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}s(Dp,"unwrapListeners");function Mp(e,t){return new Promise(function(i,r){function n(a){e.removeListener(t,o),r(a)}s(n,"errorListener");function o(){typeof e.removeListener=="function"&&e.removeListener("error",n),i([].slice.call(arguments))}s(o,"resolver"),cc(e,t,o,{once:!0}),t!=="error"&&Wp(e,n,{once:!0})})}s(Mp,"once");function Wp(e,t,i){typeof e.on=="function"&&cc(e,"error",t,i)}s(Wp,"addErrorHandlerIfEventEmitter");function cc(e,t,i,r){if(typeof e.on=="function")r.once?e.once(t,i):e.on(t,i);else if(typeof e.addEventListener=="function")e.addEventListener(t,s(function n(o){r.once&&e.removeEventListener(t,n),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}s(cc,"eventTargetAgnosticAddListener")});var ie=C((cE,po)=>{"use strict";var Up=ve(),{kResistStopPropagation:jp,SymbolDispose:qp}=j(),$p=globalThis.AbortSignal||ui().AbortSignal,zp=globalThis.AbortController||ui().AbortController,Vp=Object.getPrototypeOf(async function(){}).constructor,lc=globalThis.Blob||Up.Blob,Hp=s(typeof lc<"u"?function(t){return t instanceof lc}:function(t){return!1},"isBlob"),fc=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"),Gp=s((e,t)=>{if(typeof e!="function")throw new ERR_INVALID_ARG_TYPE(t,"Function",e)},"validateFunction"),uo=class extends Error{static{s(this,"AggregateError")}constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let i="";for(let r=0;r<t.length;r++)i+=` ${t[r].stack}
|
|
2
|
-
`;super(i),this.name="AggregateError",this.errors=t}};po.exports={AggregateError:uo,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((r,n)=>{e=r,t=n}),resolve:e,reject:t}},"createDeferredPromise"),promisify:s(function(e){return new Promise((t,i)=>{e((r,...n)=>r?i(r):t(...n))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(e,...t){return e.replace(/%([sdifj])/g,function(...[i,r]){let n=t.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.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 Vp},"isAsyncFunction"),isArrayBufferView:s(function(e){return ArrayBuffer.isView(e)},"isArrayBufferView")},isBlob:Hp,deprecate:s(function(e,t){return e},"deprecate"),addAbortListener:ir().addAbortListener||s(function(t,i){if(t===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);fc(t,"signal"),Gp(i,"listener");let r;return t.aborted?queueMicrotask(()=>i()):(t.addEventListener("abort",i,{__proto__:null,once:!0,[jp]:!0}),r=s(()=>{t.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[qp](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:$p.any||s(function(t){if(t.length===1)return t[0];let i=new zp,r=s(()=>i.abort(),"abort");return t.forEach(n=>{fc(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{t.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};po.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var se=C((fE,pc)=>{"use strict";var{format:Kp,inspect:qr,AggregateError:Yp}=ie(),Xp=globalThis.AggregateError||Yp,Jp=Symbol("kIsNodeError"),Qp=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Zp=/^([A-Z][a-z0-9]*)+$/,eh="__node_internal_",$r={};function Wt(e,t){if(!e)throw new $r.ERR_INTERNAL_ASSERTION(t)}s(Wt,"assert");function uc(e){let t="",i=e.length,r=e[0]==="-"?1:0;for(;i>=r+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(uc,"addNumericalSeparator");function th(e,t,i){if(typeof t=="function")return Wt(t.length<=i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${t.length}).`),t(...i);let r=(t.match(/%[dfijoOs]/g)||[]).length;return Wt(r===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?t:Kp(t,...i)}s(th,"getMessage");function te(e,t,i){i||(i=Error);class r extends i{static{s(this,"NodeError")}constructor(...o){super(th(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(r.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}}),r.prototype.code=e,r.prototype[Jp]=!0,$r[e]=r}s(te,"E");function dc(e){let t=eh+e.name;return Object.defineProperty(e,"name",{value:t}),e}s(dc,"hideStackFrames");function ih(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let i=new Xp([t,e],t.message);return i.code=t.code,i}return e||t}s(ih,"aggregateTwoErrors");var ho=class extends Error{static{s(this,"AbortError")}constructor(t="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new $r.ERR_INVALID_ARG_TYPE("options","Object",i);super(t,i),this.code="ABORT_ERR",this.name="AbortError"}};te("ERR_ASSERTION","%s",Error);te("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Wt(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let r="The ";e.endsWith(" argument")?r+=`${e} `:r+=`"${e}" ${e.includes(".")?"property":"argument"} `,r+="must be ";let n=[],o=[],a=[];for(let l of t)Wt(typeof l=="string","All expected entries have to be of type string"),Qp.includes(l)?n.push(l.toLowerCase()):Zp.test(l)?o.push(l):(Wt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();r+=`one of type ${n.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();r+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();r+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${i.constructor.name}`;else{let l=qr(i,{depth:-1});r+=`. Received ${l}`}}else{let l=qr(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),r+=`. Received type ${typeof i} (${l})`}return r},TypeError);te("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let r=qr(t);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${r}`},TypeError);te("ERR_INVALID_RETURN_VALUE",(e,t,i)=>{var r;let n=i!=null&&(r=i.constructor)!==null&&r!==void 0&&r.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${e} to be returned from the "${t}" function but got ${n}.`},TypeError);te("ERR_MISSING_ARGS",(...e)=>{Wt(e.length>0,"At least one arg needs to be specified");let t,i=e.length;switch(e=(Array.isArray(e)?e:[e]).map(r=>`"${r}"`).join(" or "),i){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}break}return`${t} must be specified`},TypeError);te("ERR_OUT_OF_RANGE",(e,t,i)=>{Wt(t,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=uc(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=uc(r)),r+="n"):r=qr(i),`The value of "${e}" is out of range. It must be ${t}. Received ${r}`},RangeError);te("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);te("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);te("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);te("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);te("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);te("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);te("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);te("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);te("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);te("ERR_STREAM_WRITE_AFTER_END","write after end",Error);te("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);pc.exports={AbortError:ho,aggregateTwoErrors:dc(ih),hideStackFrames:dc,codes:$r}});var hi=C((dE,xc)=>{"use strict";var{ArrayIsArray:mo,ArrayPrototypeIncludes:bc,ArrayPrototypeJoin:gc,ArrayPrototypeMap:rh,NumberIsInteger:bo,NumberIsNaN:nh,NumberMAX_SAFE_INTEGER:oh,NumberMIN_SAFE_INTEGER:sh,NumberParseInt:ah,ObjectPrototypeHasOwnProperty:ch,RegExpPrototypeExec:wc,String:lh,StringPrototypeToUpperCase:fh,StringPrototypeTrim:uh}=j(),{hideStackFrames:Ie,codes:{ERR_SOCKET_BAD_PORT:dh,ERR_INVALID_ARG_TYPE:re,ERR_INVALID_ARG_VALUE:pi,ERR_OUT_OF_RANGE:Ut,ERR_UNKNOWN_SIGNAL:hc}}=se(),{normalizeEncoding:ph}=ie(),{isAsyncFunction:hh,isArrayBufferView:yh}=ie().types,yc={};function mh(e){return e===(e|0)}s(mh,"isInt32");function bh(e){return e===e>>>0}s(bh,"isUint32");var gh=/^[0-7]+$/,wh="must be a 32-bit unsigned integer or an octal string";function Sh(e,t,i){if(typeof e>"u"&&(e=i),typeof e=="string"){if(wc(gh,e)===null)throw new pi(t,e,wh);e=ah(e,8)}return Sc(e,t),e}s(Sh,"parseFileMode");var Eh=Ie((e,t,i=sh,r=oh)=>{if(typeof e!="number")throw new re(t,"number",e);if(!bo(e))throw new Ut(t,"an integer",e);if(e<i||e>r)throw new Ut(t,`>= ${i} && <= ${r}`,e)}),_h=Ie((e,t,i=-2147483648,r=2147483647)=>{if(typeof e!="number")throw new re(t,"number",e);if(!bo(e))throw new Ut(t,"an integer",e);if(e<i||e>r)throw new Ut(t,`>= ${i} && <= ${r}`,e)}),Sc=Ie((e,t,i=!1)=>{if(typeof e!="number")throw new re(t,"number",e);if(!bo(e))throw new Ut(t,"an integer",e);let r=i?1:0,n=4294967295;if(e<r||e>n)throw new Ut(t,`>= ${r} && <= ${n}`,e)});function go(e,t){if(typeof e!="string")throw new re(t,"string",e)}s(go,"validateString");function xh(e,t,i=void 0,r){if(typeof e!="number")throw new re(t,"number",e);if(i!=null&&e<i||r!=null&&e>r||(i!=null||r!=null)&&nh(e))throw new Ut(t,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,e)}s(xh,"validateNumber");var kh=Ie((e,t,i)=>{if(!bc(i,e)){let n="must be one of: "+gc(rh(i,o=>typeof o=="string"?`'${o}'`:lh(o)),", ");throw new pi(t,e,n)}});function Ec(e,t){if(typeof e!="boolean")throw new re(t,"boolean",e)}s(Ec,"validateBoolean");function yo(e,t,i){return e==null||!ch(e,t)?i:e[t]}s(yo,"getOwnPropertyValueOrDefault");var vh=Ie((e,t,i=null)=>{let r=yo(i,"allowArray",!1),n=yo(i,"allowFunction",!1);if(!yo(i,"nullable",!1)&&e===null||!r&&mo(e)||typeof e!="object"&&(!n||typeof e!="function"))throw new re(t,"Object",e)}),Fh=Ie((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new re(t,"a dictionary",e)}),zr=Ie((e,t,i=0)=>{if(!mo(e))throw new re(t,"Array",e);if(e.length<i){let r=`must be longer than ${i}`;throw new pi(t,e,r)}});function Ih(e,t){zr(e,t);for(let i=0;i<e.length;i++)go(e[i],`${t}[${i}]`)}s(Ih,"validateStringArray");function Ph(e,t){zr(e,t);for(let i=0;i<e.length;i++)Ec(e[i],`${t}[${i}]`)}s(Ph,"validateBooleanArray");function Ah(e,t){zr(e,t);for(let i=0;i<e.length;i++){let r=e[i],n=`${t}[${i}]`;if(r==null)throw new re(n,"AbortSignal",r);_c(r,n)}}s(Ah,"validateAbortSignalArray");function Th(e,t="signal"){if(go(e,t),yc[e]===void 0)throw yc[fh(e)]!==void 0?new hc(e+" (signals must use all capital letters)"):new hc(e)}s(Th,"validateSignalName");var Oh=Ie((e,t="buffer")=>{if(!yh(e))throw new re(t,["Buffer","TypedArray","DataView"],e)});function Ch(e,t){let i=ph(t),r=e.length;if(i==="hex"&&r%2!==0)throw new pi("encoding",t,`is invalid for data of length ${r}`)}s(Ch,"validateEncoding");function Rh(e,t="Port",i=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&uh(e).length===0||+e!==+e>>>0||e>65535||e===0&&!i)throw new dh(t,e,i);return e|0}s(Rh,"validatePort");var _c=Ie((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new re(t,"AbortSignal",e)}),Nh=Ie((e,t)=>{if(typeof e!="function")throw new re(t,"Function",e)}),Lh=Ie((e,t)=>{if(typeof e!="function"||hh(e))throw new re(t,"Function",e)}),Bh=Ie((e,t)=>{if(e!==void 0)throw new re(t,"undefined",e)});function Dh(e,t,i){if(!bc(i,e))throw new re(t,`('${gc(i,"|")}')`,e)}s(Dh,"validateUnion");var Mh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function mc(e,t){if(typeof e>"u"||!wc(Mh,e))throw new pi(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(mc,"validateLinkHeaderFormat");function Wh(e){if(typeof e=="string")return mc(e,"hints"),e;if(mo(e)){let t=e.length,i="";if(t===0)return i;for(let r=0;r<t;r++){let n=e[r];mc(n,"hints"),i+=n,r!==t-1&&(i+=", ")}return i}throw new pi("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Wh,"validateLinkHeaderValue");xc.exports={isInt32:mh,isUint32:bh,parseFileMode:Sh,validateArray:zr,validateStringArray:Ih,validateBooleanArray:Ph,validateAbortSignalArray:Ah,validateBoolean:Ec,validateBuffer:Oh,validateDictionary:Fh,validateEncoding:Ch,validateFunction:Nh,validateInt32:_h,validateInteger:Eh,validateNumber:xh,validateObject:vh,validateOneOf:kh,validatePlainFunction:Lh,validatePort:Rh,validateSignalName:Th,validateString:go,validateUint32:Sc,validateUndefined:Bh,validateUnion:Dh,validateAbortSignal:_c,validateLinkHeaderValue:Wh}});var _t=C((hE,Ic)=>{var V=Ic.exports={},Ge,Ke;function wo(){throw new Error("setTimeout has not been defined")}s(wo,"defaultSetTimout");function So(){throw new Error("clearTimeout has not been defined")}s(So,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ge=setTimeout:Ge=wo}catch{Ge=wo}try{typeof clearTimeout=="function"?Ke=clearTimeout:Ke=So}catch{Ke=So}})();function kc(e){if(Ge===setTimeout)return setTimeout(e,0);if((Ge===wo||!Ge)&&setTimeout)return Ge=setTimeout,setTimeout(e,0);try{return Ge(e,0)}catch{try{return Ge.call(null,e,0)}catch{return Ge.call(this,e,0)}}}s(kc,"runTimeout");function Uh(e){if(Ke===clearTimeout)return clearTimeout(e);if((Ke===So||!Ke)&&clearTimeout)return Ke=clearTimeout,clearTimeout(e);try{return Ke(e)}catch{try{return Ke.call(null,e)}catch{return Ke.call(this,e)}}}s(Uh,"runClearTimeout");var ct=[],yi=!1,jt,Vr=-1;function jh(){!yi||!jt||(yi=!1,jt.length?ct=jt.concat(ct):Vr=-1,ct.length&&vc())}s(jh,"cleanUpNextTick");function vc(){if(!yi){var e=kc(jh);yi=!0;for(var t=ct.length;t;){for(jt=ct,ct=[];++Vr<t;)jt&&jt[Vr].run();Vr=-1,t=ct.length}jt=null,yi=!1,Uh(e)}}s(vc,"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];ct.push(new Fc(e,t)),ct.length===1&&!yi&&kc(vc)};function Fc(e,t){this.fun=e,this.array=t}s(Fc,"Item");Fc.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function lt(){}s(lt,"noop");V.on=lt;V.addListener=lt;V.once=lt;V.off=lt;V.removeListener=lt;V.removeAllListeners=lt;V.emit=lt;V.prependListener=lt;V.prependOnceListener=lt;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 Xe=C((mE,qc)=>{"use strict";var{SymbolAsyncIterator:Pc,SymbolIterator:Ac,SymbolFor:qt}=j(),Tc=qt("nodejs.stream.destroyed"),Oc=qt("nodejs.stream.errored"),Eo=qt("nodejs.stream.readable"),_o=qt("nodejs.stream.writable"),Cc=qt("nodejs.stream.disturbed"),qh=qt("nodejs.webstream.isClosedPromise"),$h=qt("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 Gr(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(Gr,"isWritableNodeStream");function zh(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}s(zh,"isDuplexNodeStream");function Ye(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}s(Ye,"isNodeStream");function Rc(e){return!!(e&&!Ye(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}s(Rc,"isReadableStream");function Nc(e){return!!(e&&!Ye(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}s(Nc,"isWritableStream");function Lc(e){return!!(e&&!Ye(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}s(Lc,"isTransformStream");function Vh(e){return Rc(e)||Nc(e)||Lc(e)}s(Vh,"isWebStream");function Hh(e,t){return e==null?!1:t===!0?typeof e[Pc]=="function":t===!1?typeof e[Ac]=="function":typeof e[Pc]=="function"||typeof e[Ac]=="function"}s(Hh,"isIterable");function Kr(e){if(!Ye(e))return null;let t=e._writableState,i=e._readableState,r=t||i;return!!(e.destroyed||e[Tc]||r!=null&&r.destroyed)}s(Kr,"isDestroyed");function Bc(e){if(!Gr(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(Bc,"isWritableEnded");function Gh(e,t){if(!Gr(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(Gh,"isWritableFinished");function Kh(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(Kh,"isReadableEnded");function Dc(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(Dc,"isReadableFinished");function Mc(e){return e&&e[Eo]!=null?e[Eo]:typeof e?.readable!="boolean"?null:Kr(e)?!1:Hr(e)&&e.readable&&!Dc(e)}s(Mc,"isReadable");function Wc(e){return e&&e[_o]!=null?e[_o]:typeof e?.writable!="boolean"?null:Kr(e)?!1:Gr(e)&&e.writable&&!Bc(e)}s(Wc,"isWritable");function Yh(e,t){return Ye(e)?Kr(e)?!0:!(t?.readable!==!1&&Mc(e)||t?.writable!==!1&&Wc(e)):null}s(Yh,"isFinished");function Xh(e){var t,i;return Ye(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(Xh,"isWritableErrored");function Jh(e){var t,i;return Ye(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(Jh,"isReadableErrored");function Qh(e){if(!Ye(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"&&Uc(e)?e._closed:null}s(Qh,"isClosed");function Uc(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}s(Uc,"isOutgoingMessage");function jc(e){return typeof e._sent100=="boolean"&&Uc(e)}s(jc,"isServerResponse");function Zh(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(Zh,"isServerRequest");function ey(e){if(!Ye(e))return null;let t=e._writableState,i=e._readableState,r=t||i;return!r&&jc(e)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(ey,"willEmitClose");function ty(e){var t;return!!(e&&((t=e[Cc])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}s(ty,"isDisturbed");function iy(e){var t,i,r,n,o,a,c,l,f,u;return!!(e&&((t=(i=(r=(n=(o=(a=e[Oc])!==null&&a!==void 0?a:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&n!==void 0?n:(c=e._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(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:!((u=e._writableState)===null||u===void 0)&&u.errored))}s(iy,"isErrored");qc.exports={isDestroyed:Kr,kIsDestroyed:Tc,isDisturbed:ty,kIsDisturbed:Cc,isErrored:iy,kIsErrored:Oc,isReadable:Mc,kIsReadable:Eo,kIsClosedPromise:qh,kControllerErrorFunction:$h,kIsWritable:_o,isClosed:Qh,isDuplexNodeStream:zh,isFinished:Yh,isIterable:Hh,isReadableNodeStream:Hr,isReadableStream:Rc,isReadableEnded:Kh,isReadableFinished:Dc,isReadableErrored:Jh,isNodeStream:Ye,isWebStream:Vh,isWritable:Wc,isWritableNodeStream:Gr,isWritableStream:Nc,isWritableEnded:Bc,isWritableFinished:Gh,isWritableErrored:Xh,isServerRequest:Zh,isServerResponse:jc,willEmitClose:ey,isTransformStream:Lc}});var ft=C((gE,Io)=>{var xt=_t(),{AbortError:Jc,codes:ry}=se(),{ERR_INVALID_ARG_TYPE:ny,ERR_STREAM_PREMATURE_CLOSE:$c}=ry,{kEmptyObject:ko,once:vo}=ie(),{validateAbortSignal:oy,validateFunction:sy,validateObject:ay,validateBoolean:cy}=hi(),{Promise:ly,PromisePrototypeThen:fy,SymbolDispose:Qc}=j(),{isClosed:uy,isReadable:zc,isReadableNodeStream:xo,isReadableStream:dy,isReadableFinished:Vc,isReadableErrored:Hc,isWritable:Gc,isWritableNodeStream:Kc,isWritableStream:py,isWritableFinished:Yc,isWritableErrored:Xc,isNodeStream:hy,willEmitClose:yy,kIsClosedPromise:my}=Xe(),mi;function by(e){return e.setHeader&&typeof e.abort=="function"}s(by,"isRequest");var Fo=s(()=>{},"nop");function Zc(e,t,i){var r,n;if(arguments.length===2?(i=t,t=ko):t==null?t=ko:ay(t,"options"),sy(i,"callback"),oy(t.signal,"options.signal"),i=vo(i),dy(e)||py(e))return gy(e,t,i);if(!hy(e))throw new ny("stream",["ReadableStream","WritableStream","Stream"],e);let o=(r=t.readable)!==null&&r!==void 0?r:xo(e),a=(n=t.writable)!==null&&n!==void 0?n:Kc(e),c=e._writableState,l=e._readableState,f=s(()=>{e.writable||b()},"onlegacyfinish"),u=yy(e)&&xo(e)===o&&Kc(e)===a,p=Yc(e,!1),b=s(()=>{p=!0,e.destroyed&&(u=!1),!(u&&(!e.readable||o))&&(!o||m)&&i.call(e)},"onfinish"),m=Vc(e,!1),w=s(()=>{m=!0,e.destroyed&&(u=!1),!(u&&(!e.writable||a))&&(!a||p)&&i.call(e)},"onend"),g=s(G=>{i.call(e,G)},"onerror"),k=uy(e),_=s(()=>{k=!0;let G=Xc(e)||Hc(e);if(G&&typeof G!="boolean")return i.call(e,G);if(o&&!m&&xo(e,!0)&&!Vc(e,!1))return i.call(e,new $c);if(a&&!p&&!Yc(e,!1))return i.call(e,new $c);i.call(e)},"onclose"),O=s(()=>{k=!0;let G=Xc(e)||Hc(e);if(G&&typeof G!="boolean")return i.call(e,G);i.call(e)},"onclosed"),R=s(()=>{e.req.on("finish",b)},"onrequest");by(e)?(e.on("complete",b),u||e.on("abort",_),e.req?R():e.on("request",R)):a&&!c&&(e.on("end",f),e.on("close",f)),!u&&typeof e.aborted=="boolean"&&e.on("aborted",_),e.on("end",w),e.on("finish",b),t.error!==!1&&e.on("error",g),e.on("close",_),k?xt.nextTick(_):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?u||xt.nextTick(O):(!o&&(!u||zc(e))&&(p||Gc(e)===!1)||!a&&(!u||Gc(e))&&(m||zc(e)===!1)||l&&e.req&&e.aborted)&&xt.nextTick(O);let P=s(()=>{i=Fo,e.removeListener("aborted",_),e.removeListener("complete",b),e.removeListener("abort",_),e.removeListener("request",R),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",_)},"cleanup");if(t.signal&&!k){let G=s(()=>{let Pt=i;P(),Pt.call(e,new Jc(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)xt.nextTick(G);else{mi=mi||ie().addAbortListener;let Pt=mi(t.signal,G),ge=i;i=vo((...Qt)=>{Pt[Qc](),ge.apply(e,Qt)})}}return P}s(Zc,"eos");function gy(e,t,i){let r=!1,n=Fo;if(t.signal)if(n=s(()=>{r=!0,i.call(e,new Jc(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)xt.nextTick(n);else{mi=mi||ie().addAbortListener;let a=mi(t.signal,n),c=i;i=vo((...l)=>{a[Qc](),c.apply(e,l)})}let o=s((...a)=>{r||xt.nextTick(()=>i.apply(e,a))},"resolverFn");return fy(e[my].promise,o,o),Fo}s(gy,"eosWeb");function wy(e,t){var i;let r=!1;return t===null&&(t=ko),(i=t)!==null&&i!==void 0&&i.cleanup&&(cy(t.cleanup,"cleanup"),r=t.cleanup),new ly((n,o)=>{let a=Zc(e,t,c=>{r&&a(),c?o(c):n()})})}s(wy,"finished");Io.exports=Zc;Io.exports.finished=wy});var $t=C((SE,al)=>{"use strict";var Je=_t(),{aggregateTwoErrors:Sy,codes:{ERR_MULTIPLE_CALLBACK:Ey},AbortError:_y}=se(),{Symbol:il}=j(),{kIsDestroyed:xy,isDestroyed:ky,isFinished:vy,isServerRequest:Fy}=Xe(),rl=il("kDestroy"),Po=il("kConstruct");function nl(e,t,i){e&&(e.stack,t&&!t.errored&&(t.errored=e),i&&!i.errored&&(i.errored=e))}s(nl,"checkError");function Iy(e,t){let i=this._readableState,r=this._writableState,n=r||i;return r!=null&&r.destroyed||i!=null&&i.destroyed?(typeof t=="function"&&t(),this):(nl(e,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?el(this,e,t):this.once(rl,function(o){el(this,Sy(o,e),t)}),this)}s(Iy,"destroy");function el(e,t,i){let r=!1;function n(o){if(r)return;r=!0;let a=e._readableState,c=e._writableState;nl(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Je.nextTick(Py,e,o):Je.nextTick(ol,e)}s(n,"onDestroy");try{e._destroy(t||null,n)}catch(o){n(o)}}s(el,"_destroy");function Py(e,t){Ao(e,t),ol(e)}s(Py,"emitErrorCloseNT");function ol(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(ol,"emitCloseNT");function Ao(e,t){let i=e._readableState,r=e._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),e.emit("error",t))}s(Ao,"emitErrorNT");function Ay(){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(Ay,"undestroy");function To(e,t,i){let r=e._readableState,n=e._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?e.destroy(t):t&&(t.stack,n&&!n.errored&&(n.errored=t),r&&!r.errored&&(r.errored=t),i?Je.nextTick(Ao,e,t):Ao(e,t))}s(To,"errorOrDestroy");function Ty(e,t){if(typeof e._construct!="function")return;let i=e._readableState,r=e._writableState;i&&(i.constructed=!1),r&&(r.constructed=!1),e.once(Po,t),!(e.listenerCount(Po)>1)&&Je.nextTick(Oy,e)}s(Ty,"construct");function Oy(e){let t=!1;function i(r){if(t){To(e,r??new Ey);return}t=!0;let n=e._readableState,o=e._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(rl,r):r?To(e,r,!0):Je.nextTick(Cy,e)}s(i,"onConstruct");try{e._construct(r=>{Je.nextTick(i,r)})}catch(r){Je.nextTick(i,r)}}s(Oy,"constructNT");function Cy(e){e.emit(Po)}s(Cy,"emitConstructNT");function tl(e){return e?.setHeader&&typeof e.abort=="function"}s(tl,"isRequest");function sl(e){e.emit("close")}s(sl,"emitCloseLegacy");function Ry(e,t){e.emit("error",t),Je.nextTick(sl,e)}s(Ry,"emitErrorCloseLegacy");function Ny(e,t){!e||ky(e)||(!t&&!vy(e)&&(t=new _y),Fy(e)?(e.socket=null,e.destroy(t)):tl(e)?e.abort():tl(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Je.nextTick(Ry,e,t):Je.nextTick(sl,e),e.destroyed||(e[xy]=!0))}s(Ny,"destroyer");al.exports={construct:Ty,destroyer:Ny,destroy:Iy,undestroy:Ay,errorOrDestroy:To}});var Jr=C((_E,ll)=>{"use strict";var{ArrayIsArray:Ly,ObjectSetPrototypeOf:cl}=j(),{EventEmitter:Yr}=ir();function Xr(e){Yr.call(this,e)}s(Xr,"Stream");cl(Xr.prototype,Yr.prototype);cl(Xr,Yr);Xr.prototype.pipe=function(e,t){let i=this;function r(u){e.writable&&e.write(u)===!1&&i.pause&&i.pause()}s(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}s(n,"ondrain"),e.on("drain",n),!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(u){f(),Yr.listenerCount(this,"error")===0&&this.emit("error",u)}s(l,"onerror"),Oo(i,"error",l),Oo(e,"error",l);function f(){i.removeListener("data",r),e.removeListener("drain",n),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 Oo(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):Ly(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}s(Oo,"prependListener");ll.exports={Stream:Xr,prependListener:Oo}});var rr=C((kE,Qr)=>{"use strict";var{SymbolDispose:By}=j(),{AbortError:fl,codes:Dy}=se(),{isNodeStream:ul,isWebStream:My,kControllerErrorFunction:Wy}=Xe(),Uy=ft(),{ERR_INVALID_ARG_TYPE:dl}=Dy,Co,jy=s((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new dl(t,"AbortSignal",e)},"validateAbortSignal");Qr.exports.addAbortSignal=s(function(t,i){if(jy(t,"signal"),!ul(i)&&!My(i))throw new dl("stream",["ReadableStream","WritableStream","Stream"],i);return Qr.exports.addAbortSignalNoValidate(t,i)},"addAbortSignal");Qr.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let i=ul(t)?()=>{t.destroy(new fl(void 0,{cause:e.reason}))}:()=>{t[Wy](new fl(void 0,{cause:e.reason}))};if(e.aborted)i();else{Co=Co||ie().addAbortListener;let r=Co(e,i);Uy(t,r[By])}return t}});var yl=C((IE,hl)=>{"use strict";var{StringPrototypeSlice:pl,SymbolIterator:qy,TypedArrayPrototypeSet:Zr,Uint8Array:$y}=j(),{Buffer:Ro}=ve(),{inspect:zy}=ie();hl.exports=class{static{s(this,"BufferList")}constructor(){this.head=null,this.tail=null,this.length=0}push(t){let i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(t){let i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=t+i.data;return r}concat(t){if(this.length===0)return Ro.alloc(0);let i=Ro.allocUnsafe(t>>>0),r=this.head,n=0;for(;r;)Zr(i,r.data,n),n+=r.data.length,r=r.next;return i}consume(t,i){let r=this.head.data;if(t<r.length){let n=r.slice(0,t);return this.head.data=r.slice(t),n}return t===r.length?this.shift():i?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[qy](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let i="",r=this.head,n=0;do{let o=r.data;if(t>o.length)i+=o,t-=o.length;else{t===o.length?(i+=o,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=pl(o,0,t),this.head=r,r.data=pl(o,t));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(t){let i=Ro.allocUnsafe(t),r=t,n=this.head,o=0;do{let a=n.data;if(t>a.length)Zr(i,a,r-t),t-=a.length;else{t===a.length?(Zr(i,a,r-t),++o,n.next?this.head=n.next:this.head=this.tail=null):(Zr(i,new $y(a.buffer,a.byteOffset,t),r-t),this.head=n,n.data=a.slice(t));break}++o}while((n=n.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](t,i){return zy(this,{...i,depth:0,customInspect:!1})}}});var nr=C((AE,wl)=>{"use strict";var{MathFloor:Vy,NumberIsInteger:Hy}=j(),{validateInteger:Gy}=hi(),{ERR_INVALID_ARG_VALUE:Ky}=se().codes,ml=16*1024,bl=16;function Yy(e,t,i){return e.highWaterMark!=null?e.highWaterMark:t?e[i]:null}s(Yy,"highWaterMarkFrom");function gl(e){return e?bl:ml}s(gl,"getDefaultHighWaterMark");function Xy(e,t){Gy(t,"value",0),e?bl=t:ml=t}s(Xy,"setDefaultHighWaterMark");function Jy(e,t,i,r){let n=Yy(t,r,i);if(n!=null){if(!Hy(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new Ky(o,n)}return Vy(n)}return gl(e.objectMode)}s(Jy,"getHighWaterMark");wl.exports={getHighWaterMark:Jy,getDefaultHighWaterMark:gl,setDefaultHighWaterMark:Xy}});var _l=C((No,El)=>{var en=ve(),Qe=en.Buffer;function Sl(e,t){for(var i in e)t[i]=e[i]}s(Sl,"copyProps");Qe.from&&Qe.alloc&&Qe.allocUnsafe&&Qe.allocUnsafeSlow?El.exports=en:(Sl(en,No),No.Buffer=zt);function zt(e,t,i){return Qe(e,t,i)}s(zt,"SafeBuffer");zt.prototype=Object.create(Qe.prototype);Sl(Qe,zt);zt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Qe(e,t,i)};zt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var r=Qe(e);return t!==void 0?typeof i=="string"?r.fill(t,i):r.fill(t):r.fill(0),r};zt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Qe(e)};zt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return en.SlowBuffer(e)}});var vl=C(kl=>{"use strict";var Bo=_l().Buffer,xl=Bo.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 Qy(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(Qy,"_normalizeEncoding");function Zy(e){var t=Qy(e);if(typeof t!="string"&&(Bo.isEncoding===xl||!xl(e)))throw new Error("Unknown encoding: "+e);return t||e}s(Zy,"normalizeEncoding");kl.StringDecoder=or;function or(e){this.encoding=Zy(e);var t;switch(this.encoding){case"utf16le":this.text=om,this.end=sm,t=4;break;case"utf8":this.fillLast=im,t=4;break;case"base64":this.text=am,this.end=cm,t=3;break;default:this.write=lm,this.end=fm;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bo.allocUnsafe(t)}s(or,"StringDecoder");or.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||""};or.prototype.end=nm;or.prototype.text=rm;or.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 Lo(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}s(Lo,"utf8CheckByte");function em(e,t,i){var r=t.length-1;if(r<i)return 0;var n=Lo(t[r]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--r<i||n===-2?0:(n=Lo(t[r]),n>=0?(n>0&&(e.lastNeed=n-2),n):--r<i||n===-2?0:(n=Lo(t[r]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}s(em,"utf8CheckIncomplete");function tm(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(tm,"utf8CheckExtraBytes");function im(e){var t=this.lastTotal-this.lastNeed,i=tm(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(im,"utf8FillLast");function rm(e,t){var i=em(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var r=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}s(rm,"utf8Text");function nm(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}s(nm,"utf8End");function om(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=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(om,"utf16Text");function sm(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(sm,"utf16End");function am(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(am,"base64Text");function cm(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}s(cm,"base64End");function lm(e){return e.toString(this.encoding)}s(lm,"simpleWrite");function fm(e){return e&&e.length?this.write(e):""}s(fm,"simpleEnd")});var Do=C((NE,Al)=>{"use strict";var Fl=_t(),{PromisePrototypeThen:um,SymbolAsyncIterator:Il,SymbolIterator:Pl}=j(),{Buffer:dm}=ve(),{ERR_INVALID_ARG_TYPE:pm,ERR_STREAM_NULL_VALUES:hm}=se().codes;function ym(e,t,i){let r;if(typeof t=="string"||t instanceof dm)return new e({objectMode:!0,...i,read:s(function(){this.push(t),this.push(null)},"read")});let n;if(t&&t[Il])n=!0,r=t[Il]();else if(t&&t[Pl])n=!1,r=t[Pl]();else throw new pm("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,u){um(c(f),()=>Fl.nextTick(u,f),p=>Fl.nextTick(u,p||f))};async function c(f){let u=f!=null,p=typeof r.throw=="function";if(u&&p){let{value:b,done:m}=await r.throw(f);if(await b,m)return}if(typeof r.return=="function"){let{value:b}=await r.return();await b}}s(c,"close");async function l(){for(;;){try{let{value:f,done:u}=n?await r.next():r.next();if(u)o.push(null);else{let p=f&&typeof f.then=="function"?await f:f;if(p===null)throw a=!1,new hm;if(o.push(p))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(ym,"from");Al.exports=ym});var ar=C((BE,Gl)=>{var Oe=_t(),{ArrayPrototypeIndexOf:mm,NumberIsInteger:bm,NumberIsNaN:gm,NumberParseInt:wm,ObjectDefineProperties:Vo,ObjectKeys:Sm,ObjectSetPrototypeOf:Cl,Promise:Rl,SafeSet:Em,SymbolAsyncDispose:_m,SymbolAsyncIterator:xm,Symbol:km}=j();Gl.exports=I;I.ReadableState=on;var{EventEmitter:vm}=ir(),{Stream:kt,prependListener:Fm}=Jr(),{Buffer:Mo}=ve(),{addAbortSignal:Im}=rr(),Nl=ft(),T=ie().debuglog("stream",e=>{T=e}),Pm=yl(),wi=$t(),{getHighWaterMark:Am,getDefaultHighWaterMark:Tm}=nr(),{aggregateTwoErrors:Tl,codes:{ERR_INVALID_ARG_TYPE:Om,ERR_METHOD_NOT_IMPLEMENTED:Cm,ERR_OUT_OF_RANGE:Rm,ERR_STREAM_PUSH_AFTER_EOF:Nm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Lm},AbortError:Bm}=se(),{validateObject:Dm}=hi(),Vt=km("kPaused"),{StringDecoder:Ll}=vl(),Mm=Do();Cl(I.prototype,kt.prototype);Cl(I,kt);var Wo=s(()=>{},"nop"),{errorOrDestroy:bi}=wi,gi=1,Wm=2,Bl=4,sr=8,Dl=16,tn=32,rn=64,Ml=128,Um=256,jm=512,qm=1024,$o=2048,zo=4096,$m=8192,zm=16384,Vm=32768,Wl=65536,Hm=1<<17,Gm=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");Vo(on.prototype,{objectMode:J(gi),ended:J(Wm),endEmitted:J(Bl),reading:J(sr),constructed:J(Dl),sync:J(tn),needReadable:J(rn),emittedReadable:J(Ml),readableListening:J(Um),resumeScheduled:J(jm),errorEmitted:J(qm),emitClose:J($o),autoDestroy:J(zo),destroyed:J($m),closed:J(zm),closeEmitted:J(Vm),multiAwaitDrain:J(Wl),readingMore:J(Hm),dataEmitted:J(Gm)});function on(e,t,i){typeof i!="boolean"&&(i=t instanceof Ze()),this.state=$o|zo|Dl|tn,e&&e.objectMode&&(this.state|=gi),i&&e&&e.readableObjectMode&&(this.state|=gi),this.highWaterMark=e?Am(this,e,"readableHighWaterMark",i):Tm(!1),this.buffer=new Pm,this.length=0,this.pipes=[],this.flowing=null,this[Vt]=null,e&&e.emitClose===!1&&(this.state&=~$o),e&&e.autoDestroy===!1&&(this.state&=~zo),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new Ll(e.encoding),this.encoding=e.encoding)}s(on,"ReadableState");function I(e){if(!(this instanceof I))return new I(e);let t=this instanceof Ze();this._readableState=new on(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&&Im(e.signal,this)),kt.call(this,e),wi.construct(this,()=>{this._readableState.needReadable&&nn(this,this._readableState)})}s(I,"Readable");I.prototype.destroy=wi.destroy;I.prototype._undestroy=wi.undestroy;I.prototype._destroy=function(e,t){t(e)};I.prototype[vm.captureRejectionSymbol]=function(e){this.destroy(e)};I.prototype[_m]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new Bm,this.destroy(e)),new Rl((t,i)=>Nl(this,r=>r&&r!==e?i(r):t(null)))};I.prototype.push=function(e,t){return Ul(this,e,t,!1)};I.prototype.unshift=function(e,t){return Ul(this,e,t,!0)};function Ul(e,t,i,r){T("readableAddChunk",t);let n=e._readableState,o;if(n.state&gi||(typeof t=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?t=Mo.from(t,i).toString(n.encoding):(t=Mo.from(t,i),i=""))):t instanceof Mo?i="":kt._isUint8Array(t)?(t=kt._uint8ArrayToBuffer(t),i=""):t!=null&&(o=new Om("chunk",["string","Buffer","Uint8Array"],t))),o)bi(e,o);else if(t===null)n.state&=~sr,Xm(e,n);else if(n.state&gi||t&&t.length>0)if(r)if(n.state&Bl)bi(e,new Lm);else{if(n.destroyed||n.errored)return!1;Uo(e,n,t,!0)}else if(n.ended)bi(e,new Nm);else{if(n.destroyed||n.errored)return!1;n.state&=~sr,n.decoder&&!i?(t=n.decoder.write(t),n.objectMode||t.length!==0?Uo(e,n,t,!1):nn(e,n)):Uo(e,n,t,!1)}else r||(n.state&=~sr,nn(e,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Ul,"readableAddChunk");function Uo(e,t,i,r){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&Wl?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,r?t.buffer.unshift(i):t.buffer.push(i),t.state&rn&&sn(e)),nn(e,t)}s(Uo,"addChunk");I.prototype.isPaused=function(){let e=this._readableState;return e[Vt]===!0||e.flowing===!1};I.prototype.setEncoding=function(e){let t=new Ll(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,r="";for(let n of i)r+=t.write(n);return i.clear(),r!==""&&i.push(r),this._readableState.length=r.length,this};var Km=1073741824;function Ym(e){if(e>Km)throw new Rm("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}s(Ym,"computeNewHighWaterMark");function Ol(e,t){return e<=0||t.length===0&&t.ended?0:t.state&gi?1:gm(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}s(Ol,"howMuchToRead");I.prototype.read=function(e){T("read",e),e===void 0?e=NaN:bm(e)||(e=wm(e,10));let t=this._readableState,i=e;if(e>t.highWaterMark&&(t.highWaterMark=Ym(e)),e!==0&&(t.state&=~Ml),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return T("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?jo(this):sn(this),null;if(e=Ol(e,t),e===0&&t.ended)return t.length===0&&jo(this),null;let r=(t.state&rn)!==0;if(T("need readable",r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,T("length less than watermark",r)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)r=!1,T("reading, ended or constructing",r);else if(r){T("do read"),t.state|=sr|tn,t.length===0&&(t.state|=rn);try{this._read(t.highWaterMark)}catch(o){bi(this,o)}t.state&=~tn,t.reading||(e=Ol(i,t))}let n;return e>0?n=Vl(e,t):n=null,n===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&&jo(this)),n!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n};function Xm(e,t){if(T("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?sn(e):(t.needReadable=!1,t.emittedReadable=!0,jl(e))}}s(Xm,"onEofChunk");function sn(e){let t=e._readableState;T("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(T("emitReadable",t.flowing),t.emittedReadable=!0,Oe.nextTick(jl,e))}s(sn,"emitReadable");function jl(e){let t=e._readableState;T("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,$l(e)}s(jl,"emitReadable_");function nn(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Oe.nextTick(Jm,e,t))}s(nn,"maybeReadMore");function Jm(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let i=t.length;if(T("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}s(Jm,"maybeReadMore_");I.prototype._read=function(e){throw new Cm("_read()")};I.prototype.pipe=function(e,t){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new Em(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(e),T("pipe count=%d opts=%j",r.pipes.length,t);let o=(!t||t.end!==!1)&&e!==Oe.stdout&&e!==Oe.stderr?c:k;r.endEmitted?Oe.nextTick(o):i.once("end",o),e.on("unpipe",a);function a(_,O){T("onunpipe"),_===i&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,u())}s(a,"onunpipe");function c(){T("onend"),e.end()}s(c,"onend");let l,f=!1;function u(){T("cleanup"),e.removeListener("close",w),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",k),i.removeListener("data",b),f=!0,l&&r.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}s(u,"cleanup");function p(){f||(r.pipes.length===1&&r.pipes[0]===e?(T("false write response, pause",0),r.awaitDrainWriters=e,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(e)&&(T("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(e)),i.pause()),l||(l=Qm(i,e),e.on("drain",l))}s(p,"pause"),i.on("data",b);function b(_){T("ondata");let O=e.write(_);T("dest.write",O),O===!1&&p()}s(b,"ondata");function m(_){if(T("onerror",_),k(),e.removeListener("error",m),e.listenerCount("error")===0){let O=e._writableState||e._readableState;O&&!O.errorEmitted?bi(e,_):e.emit("error",_)}}s(m,"onerror"),Fm(e,"error",m);function w(){e.removeListener("finish",g),k()}s(w,"onclose"),e.once("close",w);function g(){T("onfinish"),e.removeListener("close",w),k()}s(g,"onfinish"),e.once("finish",g);function k(){T("unpipe"),i.unpipe(e)}return s(k,"unpipe"),e.emit("pipe",i),e.writableNeedDrain===!0?p():r.flowing||(T("pipe resume"),i.resume()),e};function Qm(e,t){return s(function(){let r=e._readableState;r.awaitDrainWriters===t?(T("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(T("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()},"pipeOnDrainFunctionResult")}s(Qm,"pipeOnDrain");I.prototype.unpipe=function(e){let t=this._readableState,i={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let n=t.pipes;t.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let r=mm(t.pipes,e);return r===-1?this:(t.pipes.splice(r,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,i),this)};I.prototype.on=function(e,t){let i=kt.prototype.on.call(this,e,t),r=this._readableState;return e==="data"?(r.readableListening=this.listenerCount("readable")>0,r.flowing!==!1&&this.resume()):e==="readable"&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,T("on readable",r.length,r.reading),r.length?sn(this):r.reading||Oe.nextTick(Zm,this)),i};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(e,t){let i=kt.prototype.removeListener.call(this,e,t);return e==="readable"&&Oe.nextTick(ql,this),i};I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=function(e){let t=kt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Oe.nextTick(ql,this),t};function ql(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[Vt]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}s(ql,"updateReadableListening");function Zm(e){T("readable nexttick read 0"),e.read(0)}s(Zm,"nReadingNextTick");I.prototype.resume=function(){let e=this._readableState;return e.flowing||(T("resume"),e.flowing=!e.readableListening,eb(this,e)),e[Vt]=!1,this};function eb(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Oe.nextTick(tb,e,t))}s(eb,"resume");function tb(e,t){T("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),$l(e),t.flowing&&!t.reading&&e.read(0)}s(tb,"resume_");I.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Vt]=!0,this};function $l(e){let t=e._readableState;for(T("flow",t.flowing);t.flowing&&e.read()!==null;);}s($l,"flow");I.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",r=>{bi(this,r)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let i=Sm(e);for(let r=1;r<i.length;r++){let n=i[r];this[n]===void 0&&typeof e[n]=="function"&&(this[n]=e[n].bind(e))}return this};I.prototype[xm]=function(){return zl(this)};I.prototype.iterator=function(e){return e!==void 0&&Dm(e,"options"),zl(this,e)};function zl(e,t){typeof e.read!="function"&&(e=I.wrap(e,{objectMode:!0}));let i=ib(e,t);return i.stream=e,i}s(zl,"streamToAsyncIterator");async function*ib(e,t){let i=Wo;function r(a){this===e?(i(),i=Wo):i=a}s(r,"next"),e.on("readable",r);let n,o=Nl(e,{writable:!1},a=>{n=a?Tl(n,a):null,i(),i=Wo});try{for(;;){let a=e.destroyed?null:e.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new Rl(r)}}}catch(a){throw n=Tl(n,a),n}finally{(n||t?.destroyOnReturn!==!1)&&(n===void 0||e._readableState.autoDestroy)?wi.destroyer(e,null):(e.off("readable",r),o())}}s(ib,"createAsyncIterator");Vo(I.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")}});Vo(on.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Vt]!==!1},"get"),set:s(function(e){this[Vt]=!!e},"set")}});I._fromList=Vl;function Vl(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(Vl,"fromList");function jo(e){let t=e._readableState;T("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Oe.nextTick(rb,t,e))}s(jo,"endReadable");function rb(e,t){if(T("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)Oe.nextTick(nb,t);else if(e.autoDestroy){let i=t._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&t.destroy()}}}s(rb,"endReadableNT");function nb(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}s(nb,"endWritableNT");I.from=function(e,t){return Mm(I,e,t)};var qo;function Hl(){return qo===void 0&&(qo={}),qo}s(Hl,"lazyWebStreams");I.fromWeb=function(e,t){return Hl().newStreamReadableFromReadableStream(e,t)};I.toWeb=function(e,t){return Hl().newReadableStreamFromStreamReadable(e,t)};I.wrap=function(e,t){var i,r;return new I({objectMode:(i=(r=e.readableObjectMode)!==null&&r!==void 0?r:e.objectMode)!==null&&i!==void 0?i:!0,...t,destroy:s(function(n,o){wi.destroyer(e,n),o(n)},"destroy")}).wrap(e)}});var un=C((ME,sf)=>{var Ht=_t(),{ArrayPrototypeSlice:Xl,Error:ob,FunctionPrototypeSymbolHasInstance:Jl,ObjectDefineProperty:Ql,ObjectDefineProperties:sb,ObjectSetPrototypeOf:Zl,StringPrototypeToLowerCase:ab,Symbol:cb,SymbolHasInstance:lb}=j();sf.exports=q;q.WritableState=fr;var{EventEmitter:fb}=ir(),cr=Jr().Stream,{Buffer:an}=ve(),fn=$t(),{addAbortSignal:ub}=rr(),{getHighWaterMark:db,getDefaultHighWaterMark:pb}=nr(),{ERR_INVALID_ARG_TYPE:hb,ERR_METHOD_NOT_IMPLEMENTED:yb,ERR_MULTIPLE_CALLBACK:ef,ERR_STREAM_CANNOT_PIPE:mb,ERR_STREAM_DESTROYED:lr,ERR_STREAM_ALREADY_FINISHED:bb,ERR_STREAM_NULL_VALUES:gb,ERR_STREAM_WRITE_AFTER_END:wb,ERR_UNKNOWN_ENCODING:tf}=se().codes,{errorOrDestroy:Si}=fn;Zl(q.prototype,cr.prototype);Zl(q,cr);function Ko(){}s(Ko,"nop");var Ei=cb("kOnFinished");function fr(e,t,i){typeof i!="boolean"&&(i=t instanceof Ze()),this.objectMode=!!(e&&e.objectMode),i&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?db(this,e,"writableHighWaterMark",i):pb(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let r=!!(e&&e.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Eb.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ln(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[Ei]=[]}s(fr,"WritableState");function ln(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}s(ln,"resetBuffer");fr.prototype.getBuffer=s(function(){return Xl(this.buffered,this.bufferedIndex)},"getBuffer");Ql(fr.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function q(e){let t=this instanceof Ze();if(!t&&!Jl(q,this))return new q(e);this._writableState=new fr(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&&ub(e.signal,this)),cr.call(this,e),fn.construct(this,()=>{let i=this._writableState;i.writing||Xo(this,i),Jo(this,i)})}s(q,"Writable");Ql(q,lb,{__proto__:null,value:s(function(e){return Jl(this,e)?!0:this!==q?!1:e&&e._writableState instanceof fr},"value")});q.prototype.pipe=function(){Si(this,new mb)};function rf(e,t,i,r){let n=e._writableState;if(typeof i=="function")r=i,i=n.defaultEncoding;else{if(!i)i=n.defaultEncoding;else if(i!=="buffer"&&!an.isEncoding(i))throw new tf(i);typeof r!="function"&&(r=Ko)}if(t===null)throw new gb;if(!n.objectMode)if(typeof t=="string")n.decodeStrings!==!1&&(t=an.from(t,i),i="buffer");else if(t instanceof an)i="buffer";else if(cr._isUint8Array(t))t=cr._uint8ArrayToBuffer(t),i="buffer";else throw new hb("chunk",["string","Buffer","Uint8Array"],t);let o;return n.ending?o=new wb:n.destroyed&&(o=new lr("write")),o?(Ht.nextTick(r,o),Si(e,o,!0),o):(n.pendingcb++,Sb(e,n,t,i,r))}s(rf,"_write");q.prototype.write=function(e,t,i){return rf(this,e,t,i)===!0};q.prototype.cork=function(){this._writableState.corked++};q.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||Xo(this,e))};q.prototype.setDefaultEncoding=s(function(t){if(typeof t=="string"&&(t=ab(t)),!an.isEncoding(t))throw new tf(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function Sb(e,t,i,r,n){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:r,callback:n}),t.allBuffers&&r!=="buffer"&&(t.allBuffers=!1),t.allNoop&&n!==Ko&&(t.allNoop=!1)):(t.writelen=o,t.writecb=n,t.writing=!0,t.sync=!0,e._write(i,r,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}s(Sb,"writeOrBuffer");function Kl(e,t,i,r,n,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new lr("write")):i?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}s(Kl,"doWrite");function Yl(e,t,i,r){--t.pendingcb,r(i),Yo(t),Si(e,i)}s(Yl,"onwriteError");function Eb(e,t){let i=e._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){Si(e,new ef);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),r?Ht.nextTick(Yl,e,i,t,n):Yl(e,i,t,n)):(i.buffered.length>i.bufferedIndex&&Xo(e,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:e,state:i},Ht.nextTick(_b,i.afterWriteTickInfo)):nf(e,i,1,n))}s(Eb,"onwrite");function _b({stream:e,state:t,count:i,cb:r}){return t.afterWriteTickInfo=null,nf(e,t,i,r)}s(_b,"afterWriteTick");function nf(e,t,i,r){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));i-- >0;)t.pendingcb--,r();t.destroyed&&Yo(t),Jo(e,t)}s(nf,"afterWrite");function Yo(e){if(e.writing)return;for(let n=e.bufferedIndex;n<e.buffered.length;++n){var t;let{chunk:o,callback:a}=e.buffered[n],c=e.objectMode?1:o.length;e.length-=c,a((t=e.errored)!==null&&t!==void 0?t:new lr("write"))}let i=e[Ei].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=e.errored)!==null&&r!==void 0?r:new lr("end"))}ln(e)}s(Yo,"errorBuffer");function Xo(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=t,o=i.length-r;if(!o)return;let a=r;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let c=t.allNoop?Ko:f=>{for(let u=a;u<i.length;++u)i[u].callback(f)},l=t.allNoop&&a===0?i:Xl(i,a);l.allBuffers=t.allBuffers,Kl(e,t,!0,t.length,l,"",c),ln(t)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let u=n?1:c.length;Kl(e,t,!1,u,c,l,f)}while(a<i.length&&!t.writing);a===i.length?ln(t):a>256?(i.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}s(Xo,"clearBuffer");q.prototype._write=function(e,t,i){if(this._writev)this._writev([{chunk:e,encoding:t}],i);else throw new yb("_write()")};q.prototype._writev=null;q.prototype.end=function(e,t,i){let r=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null);let n;if(e!=null){let o=rf(this,e,t);o instanceof ob&&(n=o)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Jo(this,r,!0),r.ended=!0):r.finished?n=new bb("end"):r.destroyed&&(n=new lr("end"))),typeof i=="function"&&(n||r.finished?Ht.nextTick(i,n):r[Ei].push(i)),this};function cn(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(cn,"needFinish");function xb(e,t){let i=!1;function r(n){if(i){Si(e,n??ef());return}if(i=!0,t.pendingcb--,n){let o=t[Ei].splice(0);for(let a=0;a<o.length;a++)o[a](n);Si(e,n,t.sync)}else cn(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,Ht.nextTick(Go,e,t))}s(r,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(r)}catch(n){r(n)}t.sync=!1}s(xb,"callFinal");function kb(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,xb(e,t)):(t.prefinished=!0,e.emit("prefinish")))}s(kb,"prefinish");function Jo(e,t,i){cn(t)&&(kb(e,t),t.pendingcb===0&&(i?(t.pendingcb++,Ht.nextTick((r,n)=>{cn(n)?Go(r,n):n.pendingcb--},e,t)):cn(t)&&(t.pendingcb++,Go(e,t))))}s(Jo,"finishMaybe");function Go(e,t){t.pendingcb--,t.finished=!0;let i=t[Ei].splice(0);for(let r=0;r<i.length;r++)i[r]();if(e.emit("finish"),t.autoDestroy){let r=e._readableState;(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))&&e.destroy()}}s(Go,"finish");sb(q.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 vb=fn.destroy;q.prototype.destroy=function(e,t){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ei].length)&&Ht.nextTick(Yo,i),vb.call(this,e,t),this};q.prototype._undestroy=fn.undestroy;q.prototype._destroy=function(e,t){t(e)};q.prototype[fb.captureRejectionSymbol]=function(e){this.destroy(e)};var Ho;function of(){return Ho===void 0&&(Ho={}),Ho}s(of,"lazyWebStreams");q.fromWeb=function(e,t){return of().newStreamWritableFromWritableStream(e,t)};q.toWeb=function(e){return of().newWritableStreamFromStreamWritable(e)}});var Ef=C((UE,Sf)=>{var Qo=_t(),Fb=ve(),{isReadable:Ib,isWritable:Pb,isIterable:af,isNodeStream:Ab,isReadableNodeStream:cf,isWritableNodeStream:lf,isDuplexNodeStream:Tb,isReadableStream:ff,isWritableStream:uf}=Xe(),df=ft(),{AbortError:gf,codes:{ERR_INVALID_ARG_TYPE:Ob,ERR_INVALID_RETURN_VALUE:pf}}=se(),{destroyer:xi}=$t(),Cb=Ze(),wf=ar(),Rb=un(),{createDeferredPromise:hf}=ie(),yf=Do(),mf=globalThis.Blob||Fb.Blob,Nb=s(typeof mf<"u"?function(t){return t instanceof mf}:function(t){return!1},"isBlob"),Lb=globalThis.AbortController||ui().AbortController,{FunctionPrototypeCall:bf}=j(),vt=class extends Cb{static{s(this,"Duplexify")}constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Sf.exports=s(function e(t,i){if(Tb(t))return t;if(cf(t))return _i({readable:t});if(lf(t))return _i({writable:t});if(Ab(t))return _i({writable:!1,readable:!1});if(ff(t))return _i({readable:wf.fromWeb(t)});if(uf(t))return _i({writable:Rb.fromWeb(t)});if(typeof t=="function"){let{value:n,write:o,final:a,destroy:c}=Bb(t);if(af(n))return yf(vt,n,{objectMode:!0,write:o,final:a,destroy:c});let l=n?.then;if(typeof l=="function"){let f,u=bf(l,n,p=>{if(p!=null)throw new pf("nully","body",p)},p=>{xi(f,p)});return f=new vt({objectMode:!0,readable:!1,write:o,final:s(function(p){a(async()=>{try{await u,Qo.nextTick(p,null)}catch(b){Qo.nextTick(p,b)}})},"final"),destroy:c})}throw new pf("Iterable, AsyncIterable or AsyncFunction",i,n)}if(Nb(t))return e(t.arrayBuffer());if(af(t))return yf(vt,t,{objectMode:!0,writable:!1});if(ff(t?.readable)&&uf(t?.writable))return vt.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let n=t!=null&&t.readable?cf(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?lf(t?.writable)?t?.writable:e(t.writable):void 0;return _i({readable:n,writable:o})}let r=t?.then;if(typeof r=="function"){let n;return bf(r,t,o=>{o!=null&&n.push(o),n.push(null)},o=>{xi(n,o)}),n=new vt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new Ob(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function Bb(e){let{promise:t,resolve:i}=hf(),r=new Lb,n=r.signal;return{value:e(async function*(){for(;;){let a=t;t=null;let{chunk:c,done:l,cb:f}=await a;if(Qo.nextTick(f),l)return;if(n.aborted)throw new gf(void 0,{cause:n.reason});({promise:t,resolve:i}=hf()),yield c}}(),{signal:n}),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){r.abort(),c(a)},"destroy")}}s(Bb,"fromAsyncGen");function _i(e){let t=e.readable&&typeof e.readable.read!="function"?wf.wrap(e.readable):e.readable,i=e.writable,r=!!Ib(t),n=!!Pb(i),o,a,c,l,f;function u(p){let b=l;l=null,b?b(p):p&&f.destroy(p)}return s(u,"onfinished"),f=new vt({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(df(i,p=>{n=!1,p&&xi(t,p),u(p)}),f._write=function(p,b,m){i.write(p,b)?m():o=m},f._final=function(p){i.end(),a=p},i.on("drain",function(){if(o){let p=o;o=null,p()}}),i.on("finish",function(){if(a){let p=a;a=null,p()}})),r&&(df(t,p=>{r=!1,p&&xi(t,p),u(p)}),t.on("readable",function(){if(c){let p=c;c=null,p()}}),t.on("end",function(){f.push(null)}),f._read=function(){for(;;){let p=t.read();if(p===null){c=f._read;return}if(!f.push(p))return}}),f._destroy=function(p,b){!p&&l!==null&&(p=new gf),c=null,o=null,a=null,l===null?b(p):(l=b,xi(i,p),xi(t,p))},f}s(_i,"_duplexify")});var Ze=C((qE,kf)=>{"use strict";var{ObjectDefineProperties:Db,ObjectGetOwnPropertyDescriptor:ut,ObjectKeys:Mb,ObjectSetPrototypeOf:_f}=j();kf.exports=Ce;var ts=ar(),Pe=un();_f(Ce.prototype,ts.prototype);_f(Ce,ts);{let e=Mb(Pe.prototype);for(let t=0;t<e.length;t++){let i=e[t];Ce.prototype[i]||(Ce.prototype[i]=Pe.prototype[i])}}function Ce(e){if(!(this instanceof Ce))return new Ce(e);ts.call(this,e),Pe.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(Ce,"Duplex");Db(Ce.prototype,{writable:{__proto__:null,...ut(Pe.prototype,"writable")},writableHighWaterMark:{__proto__:null,...ut(Pe.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...ut(Pe.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...ut(Pe.prototype,"writableBuffer")},writableLength:{__proto__:null,...ut(Pe.prototype,"writableLength")},writableFinished:{__proto__:null,...ut(Pe.prototype,"writableFinished")},writableCorked:{__proto__:null,...ut(Pe.prototype,"writableCorked")},writableEnded:{__proto__:null,...ut(Pe.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...ut(Pe.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 Zo;function xf(){return Zo===void 0&&(Zo={}),Zo}s(xf,"lazyWebStreams");Ce.fromWeb=function(e,t){return xf().newStreamDuplexFromReadableWritablePair(e,t)};Ce.toWeb=function(e){return xf().newReadableWritablePairFromDuplex(e)};var es;Ce.from=function(e){return es||(es=Ef()),es(e,"body")}});var ns=C((zE,Ff)=>{"use strict";var{ObjectSetPrototypeOf:vf,Symbol:Wb}=j();Ff.exports=dt;var{ERR_METHOD_NOT_IMPLEMENTED:Ub}=se().codes,rs=Ze(),{getHighWaterMark:jb}=nr();vf(dt.prototype,rs.prototype);vf(dt,rs);var ur=Wb("kCallback");function dt(e){if(!(this instanceof dt))return new dt(e);let t=e?jb(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),rs.call(this,e),this._readableState.sync=!1,this[ur]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",qb)}s(dt,"Transform");function is(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,i)=>{if(t){e?e(t):this.destroy(t);return}i!=null&&this.push(i),this.push(null),e&&e()}):(this.push(null),e&&e())}s(is,"final");function qb(){this._final!==is&&is.call(this)}s(qb,"prefinish");dt.prototype._final=is;dt.prototype._transform=function(e,t,i){throw new Ub("_transform()")};dt.prototype._write=function(e,t,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(e,t,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),n.ended||o===r.length||r.length<r.highWaterMark?i():this[ur]=i})};dt.prototype._read=function(){if(this[ur]){let e=this[ur];this[ur]=null,e()}}});var ss=C((HE,Pf)=>{"use strict";var{ObjectSetPrototypeOf:If}=j();Pf.exports=ki;var os=ns();If(ki.prototype,os.prototype);If(ki,os);function ki(e){if(!(this instanceof ki))return new ki(e);os.call(this,e)}s(ki,"PassThrough");ki.prototype._transform=function(e,t,i){i(null,e)}});var yn=C((KE,Rf)=>{var dr=_t(),{ArrayIsArray:$b,Promise:zb,SymbolAsyncIterator:Vb,SymbolDispose:Hb}=j(),hn=ft(),{once:Gb}=ie(),Kb=$t(),Af=Ze(),{aggregateTwoErrors:Yb,codes:{ERR_INVALID_ARG_TYPE:ys,ERR_INVALID_RETURN_VALUE:as,ERR_MISSING_ARGS:Xb,ERR_STREAM_DESTROYED:Jb,ERR_STREAM_PREMATURE_CLOSE:Qb},AbortError:Zb}=se(),{validateFunction:eg,validateAbortSignal:tg}=hi(),{isIterable:Gt,isReadable:cs,isReadableNodeStream:pn,isNodeStream:Tf,isTransformStream:vi,isWebStream:ig,isReadableStream:ls,isReadableFinished:rg}=Xe(),ng=globalThis.AbortController||ui().AbortController,fs,us,ds;function Of(e,t,i){let r=!1;e.on("close",()=>{r=!0});let n=hn(e,{readable:t,writable:i},o=>{r=!o});return{destroy:s(o=>{r||(r=!0,Kb.destroyer(e,o||new Jb("pipe")))},"destroy"),cleanup:n}}s(Of,"destroyer");function og(e){return eg(e[e.length-1],"streams[stream.length - 1]"),e.pop()}s(og,"popCallback");function ps(e){if(Gt(e))return e;if(pn(e))return sg(e);throw new ys("val",["Readable","Iterable","AsyncIterable"],e)}s(ps,"makeAsyncIterable");async function*sg(e){us||(us=ar()),yield*us.prototype[Vb].call(e)}s(sg,"fromReadable");async function dn(e,t,i,{end:r}){let n,o=null,a=s(f=>{if(f&&(n=f),o){let u=o;o=null,u()}},"resume"),c=s(()=>new zb((f,u)=>{n?u(n):o=s(()=>{n?u(n):f()},"onresolve")}),"wait");t.on("drain",a);let l=hn(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(let f of e)t.write(f)||await c();r&&(t.end(),await c()),i()}catch(f){i(n!==f?Yb(n,f):f)}finally{l(),t.off("drain",a)}}s(dn,"pumpToNode");async function hs(e,t,i,{end:r}){vi(t)&&(t=t.writable);let n=t.getWriter();try{for await(let o of e)await n.ready,n.write(o).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(o){try{await n.abort(o),i(o)}catch(a){i(a)}}}s(hs,"pumpToWeb");function ag(...e){return Cf(e,Gb(og(e)))}s(ag,"pipeline");function Cf(e,t,i){if(e.length===1&&$b(e[0])&&(e=e[0]),e.length<2)throw new Xb("streams");let r=new ng,n=r.signal,o=i?.signal,a=[];tg(o,"options.signal");function c(){w(new Zb)}s(c,"abort"),ds=ds||ie().addAbortListener;let l;o&&(l=ds(o,c));let f,u,p=[],b=0;function m(R){w(R,--b===0)}s(m,"finish");function w(R,P){var G;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!P)){for(;p.length;)p.shift()(f);(G=l)===null||G===void 0||G[Hb](),r.abort(),P&&(f||a.forEach(Pt=>Pt()),dr.nextTick(t,f,u))}}s(w,"finishImpl");let g;for(let R=0;R<e.length;R++){let P=e[R],G=R<e.length-1,Pt=R>0,ge=G||i?.end!==!1,Qt=R===e.length-1;if(Tf(P)){let ce=function(tt){tt&&tt.name!=="AbortError"&&tt.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(tt)};var O=ce;if(s(ce,"onError"),ge){let{destroy:tt,cleanup:Nn}=Of(P,G,Pt);p.push(tt),cs(P)&&Qt&&a.push(Nn)}P.on("error",ce),cs(P)&&Qt&&a.push(()=>{P.removeListener("error",ce)})}if(R===0)if(typeof P=="function"){if(g=P({signal:n}),!Gt(g))throw new as("Iterable, AsyncIterable or Stream","source",g)}else Gt(P)||pn(P)||vi(P)?g=P:g=Af.from(P);else if(typeof P=="function"){if(vi(g)){var k;g=ps((k=g)===null||k===void 0?void 0:k.readable)}else g=ps(g);if(g=P(g,{signal:n}),G){if(!Gt(g,!0))throw new as("AsyncIterable",`transform[${R-1}]`,g)}else{var _;fs||(fs=ss());let ce=new fs({objectMode:!0}),tt=(_=g)===null||_===void 0?void 0:_.then;if(typeof tt=="function")b++,tt.call(g,ht=>{u=ht,ht!=null&&ce.write(ht),ge&&ce.end(),dr.nextTick(m)},ht=>{ce.destroy(ht),dr.nextTick(m,ht)});else if(Gt(g,!0))b++,dn(g,ce,m,{end:ge});else if(ls(g)||vi(g)){let ht=g.readable||g;b++,dn(ht,ce,m,{end:ge})}else throw new as("AsyncIterable or Promise","destination",g);g=ce;let{destroy:Nn,cleanup:hd}=Of(g,!1,!0);p.push(Nn),Qt&&a.push(hd)}}else if(Tf(P)){if(pn(g)){b+=2;let ce=cg(g,P,m,{end:ge});cs(P)&&Qt&&a.push(ce)}else if(vi(g)||ls(g)){let ce=g.readable||g;b++,dn(ce,P,m,{end:ge})}else if(Gt(g))b++,dn(g,P,m,{end:ge});else throw new ys("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=P}else if(ig(P)){if(pn(g))b++,hs(ps(g),P,m,{end:ge});else if(ls(g)||Gt(g))b++,hs(g,P,m,{end:ge});else if(vi(g))b++,hs(g.readable,P,m,{end:ge});else throw new ys("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=P}else g=Af.from(P)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&dr.nextTick(c),g}s(Cf,"pipelineImpl");function cg(e,t,i,{end:r}){let n=!1;if(t.on("close",()=>{n||i(new Qb)}),e.pipe(t,{end:!1}),r){let a=function(){n=!0,t.end()};var o=a;s(a,"endFn"),rg(e)?dr.nextTick(a):e.once("end",a)}else i();return hn(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)}),hn(t,{readable:!1,writable:!0},i)}s(cg,"pipe");Rf.exports={pipelineImpl:Cf,pipeline:ag}});var bs=C((XE,Wf)=>{"use strict";var{pipeline:lg}=yn(),mn=Ze(),{destroyer:fg}=$t(),{isNodeStream:bn,isReadable:Nf,isWritable:Lf,isWebStream:ms,isTransformStream:Kt,isWritableStream:Bf,isReadableStream:Df}=Xe(),{AbortError:ug,codes:{ERR_INVALID_ARG_VALUE:Mf,ERR_MISSING_ARGS:dg}}=se(),pg=ft();Wf.exports=s(function(...t){if(t.length===0)throw new dg("streams");if(t.length===1)return mn.from(t[0]);let i=[...t];if(typeof t[0]=="function"&&(t[0]=mn.from(t[0])),typeof t[t.length-1]=="function"){let m=t.length-1;t[m]=mn.from(t[m])}for(let m=0;m<t.length;++m)if(!(!bn(t[m])&&!ms(t[m]))){if(m<t.length-1&&!(Nf(t[m])||Df(t[m])||Kt(t[m])))throw new Mf(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(Lf(t[m])||Bf(t[m])||Kt(t[m])))throw new Mf(`streams[${m}]`,i[m],"must be writable")}let r,n,o,a,c;function l(m){let w=a;a=null,w?w(m):m?c.destroy(m):!b&&!p&&c.destroy()}s(l,"onfinished");let f=t[0],u=lg(t,l),p=!!(Lf(f)||Bf(f)||Kt(f)),b=!!(Nf(u)||Df(u)||Kt(u));if(c=new mn({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(u!=null&&u.readableObjectMode),writable:p,readable:b}),p){if(bn(f))c._write=function(w,g,k){f.write(w,g)?k():r=k},c._final=function(w){f.end(),n=w},f.on("drain",function(){if(r){let w=r;r=null,w()}});else if(ms(f)){let g=(Kt(f)?f.writable:f).getWriter();c._write=async function(k,_,O){try{await g.ready,g.write(k).catch(()=>{}),O()}catch(R){O(R)}},c._final=async function(k){try{await g.ready,g.close().catch(()=>{}),n=k}catch(_){k(_)}}}let m=Kt(u)?u.readable:u;pg(m,()=>{if(n){let w=n;n=null,w()}})}if(b){if(bn(u))u.on("readable",function(){if(o){let m=o;o=null,m()}}),u.on("end",function(){c.push(null)}),c._read=function(){for(;;){let m=u.read();if(m===null){o=c._read;return}if(!c.push(m))return}};else if(ms(u)){let w=(Kt(u)?u.readable:u).getReader();c._read=async function(){for(;;)try{let{value:g,done:k}=await w.read();if(!c.push(g))return;if(k){c.push(null);return}}catch{return}}}}return c._destroy=function(m,w){!m&&a!==null&&(m=new ug),o=null,r=null,n=null,a===null?w(m):(a=w,bn(u)&&fg(u,m))},c},"compose")});var Yf=C((QE,Ss)=>{"use strict";var hg=globalThis.AbortController||ui().AbortController,{codes:{ERR_INVALID_ARG_VALUE:yg,ERR_INVALID_ARG_TYPE:pr,ERR_MISSING_ARGS:mg,ERR_OUT_OF_RANGE:bg},AbortError:et}=se(),{validateAbortSignal:Yt,validateInteger:Uf,validateObject:Xt}=hi(),gg=j().Symbol("kWeak"),wg=j().Symbol("kResistStopPropagation"),{finished:Sg}=ft(),Eg=bs(),{addAbortSignalNoValidate:_g}=rr(),{isWritable:xg,isNodeStream:kg}=Xe(),{deprecate:vg}=ie(),{ArrayPrototypePush:Fg,Boolean:Ig,MathFloor:jf,Number:Pg,NumberIsNaN:Ag,Promise:qf,PromiseReject:$f,PromiseResolve:Tg,PromisePrototypeThen:zf,Symbol:Hf}=j(),gn=Hf("kEmpty"),Vf=Hf("kEof");function Og(e,t){if(t!=null&&Xt(t,"options"),t?.signal!=null&&Yt(t.signal,"options.signal"),kg(e)&&!xg(e))throw new yg("stream",e,"must be writable");let i=Eg(this,e);return t!=null&&t.signal&&_g(t.signal,i),i}s(Og,"compose");function wn(e,t){if(typeof e!="function")throw new pr("fn",["Function","AsyncFunction"],e);t!=null&&Xt(t,"options"),t?.signal!=null&&Yt(t.signal,"options.signal");let i=1;t?.concurrency!=null&&(i=jf(t.concurrency));let r=i-1;return t?.highWaterMark!=null&&(r=jf(t.highWaterMark)),Uf(i,"options.concurrency",1),Uf(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=ie().AbortSignalAny([t?.signal].filter(Ig)),a=this,c=[],l={signal:o},f,u,p=!1,b=0;function m(){p=!0,w()}s(m,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){u&&!p&&b<i&&c.length<r&&(u(),u=null)}s(g,"maybeResume");async function k(){try{for await(let _ of a){if(p)return;if(o.aborted)throw new et;try{if(_=e(_,l),_===gn)continue;_=Tg(_)}catch(O){_=$f(O)}b+=1,zf(_,w,m),c.push(_),f&&(f(),f=null),!p&&(c.length>=r||b>=i)&&await new qf(O=>{u=O})}c.push(Vf)}catch(_){let O=$f(_);zf(O,w,m),c.push(O)}finally{p=!0,f&&(f(),f=null)}}s(k,"pump"),k();try{for(;;){for(;c.length>0;){let _=await c[0];if(_===Vf)return;if(o.aborted)throw new et;_!==gn&&(yield _),c.shift(),g()}await new qf(_=>{f=_})}}finally{p=!0,u&&(u(),u=null)}},"map").call(this)}s(wn,"map");function Cg(e=void 0){return e!=null&&Xt(e,"options"),e?.signal!=null&&Yt(e.signal,"options.signal"),s(async function*(){let i=0;for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new et({cause:e.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(Cg,"asIndexedPairs");async function Gf(e,t=void 0){for await(let i of ws.call(this,e,t))return!0;return!1}s(Gf,"some");async function Rg(e,t=void 0){if(typeof e!="function")throw new pr("fn",["Function","AsyncFunction"],e);return!await Gf.call(this,async(...i)=>!await e(...i),t)}s(Rg,"every");async function Ng(e,t){for await(let i of ws.call(this,e,t))return i}s(Ng,"find");async function Lg(e,t){if(typeof e!="function")throw new pr("fn",["Function","AsyncFunction"],e);async function i(r,n){return await e(r,n),gn}s(i,"forEachFn");for await(let r of wn.call(this,i,t));}s(Lg,"forEach");function ws(e,t){if(typeof e!="function")throw new pr("fn",["Function","AsyncFunction"],e);async function i(r,n){return await e(r,n)?r:gn}return s(i,"filterFn"),wn.call(this,i,t)}s(ws,"filter");var gs=class extends mg{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Bg(e,t,i){var r;if(typeof e!="function")throw new pr("reducer",["Function","AsyncFunction"],e);i!=null&&Xt(i,"options"),i?.signal!=null&&Yt(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new et(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Sg(this.destroy(f)),f}let o=new hg,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[gg]:this,[wg]:!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 et;n?t=await e(t,f,{signal:a}):(t=f,n=!0)}if(!c&&!n)throw new gs}finally{o.abort()}return t}s(Bg,"reduce");async function Dg(e){e!=null&&Xt(e,"options"),e?.signal!=null&&Yt(e.signal,"options.signal");let t=[];for await(let r of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new et(void 0,{cause:e.signal.reason});Fg(t,r)}return t}s(Dg,"toArray");function Mg(e,t){let i=wn.call(this,e,t);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(Mg,"flatMap");function Kf(e){if(e=Pg(e),Ag(e))return 0;if(e<0)throw new bg("number",">= 0",e);return e}s(Kf,"toIntegerOrInfinity");function Wg(e,t=void 0){return t!=null&&Xt(t,"options"),t?.signal!=null&&Yt(t.signal,"options.signal"),e=Kf(e),s(async function*(){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new et;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new et;e--<=0&&(yield o)}},"drop").call(this)}s(Wg,"drop");function Ug(e,t=void 0){return t!=null&&Xt(t,"options"),t?.signal!=null&&Yt(t.signal,"options.signal"),e=Kf(e),s(async function*(){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new et;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new et;if(e-- >0&&(yield o),e<=0)return}},"take").call(this)}s(Ug,"take");Ss.exports.streamReturningOperators={asIndexedPairs:vg(Cg,"readable.asIndexedPairs will be removed in a future version."),drop:Wg,filter:ws,flatMap:Mg,map:wn,take:Ug,compose:Og};Ss.exports.promiseReturningOperators={every:Rg,forEach:Lg,reduce:Bg,toArray:Dg,some:Gf,find:Ng}});var Es=C((e_,Xf)=>{"use strict";var{ArrayPrototypePop:jg,Promise:qg}=j(),{isIterable:$g,isNodeStream:zg,isWebStream:Vg}=Xe(),{pipelineImpl:Hg}=yn(),{finished:Gg}=ft();_s();function Kg(...e){return new qg((t,i)=>{let r,n,o=e[e.length-1];if(o&&typeof o=="object"&&!zg(o)&&!$g(o)&&!Vg(o)){let a=jg(e);r=a.signal,n=a.end}Hg(e,(a,c)=>{a?i(a):t(c)},{signal:r,end:n})})}s(Kg,"pipeline");Xf.exports={finished:Gg,pipeline:Kg}});var _s=C((i_,ou)=>{var{Buffer:Yg}=ve(),{ObjectDefineProperty:pt,ObjectKeys:Zf,ReflectApply:eu}=j(),{promisify:{custom:tu}}=ie(),{streamReturningOperators:Jf,promiseReturningOperators:Qf}=Yf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:iu}}=se(),Xg=bs(),{setDefaultHighWaterMark:Jg,getDefaultHighWaterMark:Qg}=nr(),{pipeline:ru}=yn(),{destroyer:Zg}=$t(),nu=ft(),xs=Es(),hr=Xe(),B=ou.exports=Jr().Stream;B.isDestroyed=hr.isDestroyed;B.isDisturbed=hr.isDisturbed;B.isErrored=hr.isErrored;B.isReadable=hr.isReadable;B.isWritable=hr.isWritable;B.Readable=ar();for(let e of Zf(Jf)){let i=function(...r){if(new.target)throw iu();return B.Readable.from(eu(t,this,r))};ks=i,s(i,"fn");let t=Jf[e];pt(i,"name",{__proto__:null,value:t.name}),pt(i,"length",{__proto__:null,value:t.length}),pt(B.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var ks;for(let e of Zf(Qf)){let i=function(...n){if(new.target)throw iu();return eu(t,this,n)};ks=i,s(i,"fn");let t=Qf[e];pt(i,"name",{__proto__:null,value:t.name}),pt(i,"length",{__proto__:null,value:t.length}),pt(B.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var ks;B.Writable=un();B.Duplex=Ze();B.Transform=ns();B.PassThrough=ss();B.pipeline=ru;var{addAbortSignal:ew}=rr();B.addAbortSignal=ew;B.finished=nu;B.destroy=Zg;B.compose=Xg;B.setDefaultHighWaterMark=Jg;B.getDefaultHighWaterMark=Qg;pt(B,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return xs},"get")});pt(ru,tu,{__proto__:null,enumerable:!0,get:s(function(){return xs.pipeline},"get")});pt(nu,tu,{__proto__:null,enumerable:!0,get:s(function(){return xs.finished},"get")});B.Stream=B;B._isUint8Array=s(function(t){return t instanceof Uint8Array},"isUint8Array");B._uint8ArrayToBuffer=s(function(t){return Yg.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var su=C((n_,H)=>{"use strict";var Q=_s(),tw=Es(),iw=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=iw;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return tw},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var cu=C((l_,vs)=>{"use strict";var rw=Object.prototype.hasOwnProperty,ae="~";function yr(){}s(yr,"Events");Object.create&&(yr.prototype=Object.create(null),new yr().__proto__||(ae=!1));function nw(e,t,i){this.fn=e,this.context=t,this.once=i||!1}s(nw,"EE");function au(e,t,i,r,n){if(typeof i!="function")throw new TypeError("The listener must be a function");var o=new nw(i,r||e,n),a=ae?ae+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(au,"addListener");function En(e,t){--e._eventsCount===0?e._events=new yr:delete e._events[t]}s(En,"clearEvent");function ne(){this._events=new yr,this._eventsCount=0}s(ne,"EventEmitter");ne.prototype.eventNames=s(function(){var t=[],i,r;if(this._eventsCount===0)return t;for(r in i=this._events)rw.call(i,r)&&t.push(ae?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(i)):t},"eventNames");ne.prototype.listeners=s(function(t){var i=ae?ae+t:t,r=this._events[i];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},"listeners");ne.prototype.listenerCount=s(function(t){var i=ae?ae+t:t,r=this._events[i];return r?r.fn?1:r.length:0},"listenerCount");ne.prototype.emit=s(function(t,i,r,n,o,a){var c=ae?ae+t:t;if(!this._events[c])return!1;var l=this._events[c],f=arguments.length,u,p;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,r),!0;case 4:return l.fn.call(l.context,i,r,n),!0;case 5:return l.fn.call(l.context,i,r,n,o),!0;case 6:return l.fn.call(l.context,i,r,n,o,a),!0}for(p=1,u=new Array(f-1);p<f;p++)u[p-1]=arguments[p];l.fn.apply(l.context,u)}else{var b=l.length,m;for(p=0;p<b;p++)switch(l[p].once&&this.removeListener(t,l[p].fn,void 0,!0),f){case 1:l[p].fn.call(l[p].context);break;case 2:l[p].fn.call(l[p].context,i);break;case 3:l[p].fn.call(l[p].context,i,r);break;case 4:l[p].fn.call(l[p].context,i,r,n);break;default:if(!u)for(m=1,u=new Array(f-1);m<f;m++)u[m-1]=arguments[m];l[p].fn.apply(l[p].context,u)}}return!0},"emit");ne.prototype.on=s(function(t,i,r){return au(this,t,i,r,!1)},"on");ne.prototype.once=s(function(t,i,r){return au(this,t,i,r,!0)},"once");ne.prototype.removeListener=s(function(t,i,r,n){var o=ae?ae+t:t;if(!this._events[o])return this;if(!i)return En(this,o),this;var a=this._events[o];if(a.fn)a.fn===i&&(!n||a.once)&&(!r||a.context===r)&&En(this,o);else{for(var c=0,l=[],f=a.length;c<f;c++)(a[c].fn!==i||n&&!a[c].once||r&&a[c].context!==r)&&l.push(a[c]);l.length?this._events[o]=l.length===1?l[0]:l:En(this,o)}return this},"removeListener");ne.prototype.removeAllListeners=s(function(t){var i;return t?(i=ae?ae+t:t,this._events[i]&&En(this,i)):(this._events=new yr,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=ae;ne.EventEmitter=ne;typeof vs<"u"&&(vs.exports=ne)});var Sw={};xr(Sw,{AsyncTransaction:()=>jn,BigIntStats:()=>he,BigIntStatsFs:()=>Di,Dir:()=>Et,Dirent:()=>St,Errno:()=>M,ErrnoError:()=>d,Fetch:()=>mw,FetchFS:()=>Cn,File:()=>Tt,FileSystem:()=>de,InMemory:()=>zi,InMemoryStore:()=>Ir,Index:()=>On,IndexFS:()=>Er,Inode:()=>Ue,NoSyncFile:()=>ti,Overlay:()=>gw,OverlayFS:()=>_r,Port:()=>lw,PortFS:()=>Tn,PortFile:()=>Vi,PreloadFile:()=>me,ReadStream:()=>Ft,SimpleAsyncStore:()=>qn,SimpleTransaction:()=>ri,Stats:()=>X,StatsCommon:()=>Li,StatsFs:()=>Bi,StoreFS:()=>ji,SyncTransaction:()=>$i,Transaction:()=>qi,UnmutexedOverlayFS:()=>Rn,WriteStream:()=>It,ZenFsType:()=>Wn,_InMemory:()=>ra,_Port:()=>sd,_toUnixTimestamp:()=>Jd,access:()=>qu,accessSync:()=>Va,appendFile:()=>gu,appendFileSync:()=>Oa,attachFS:()=>od,checkOptions:()=>Hn,chmod:()=>Du,chmodSync:()=>qa,chown:()=>Lu,chownSync:()=>Ua,close:()=>Su,closeSync:()=>wt,configure:()=>aw,configureSingle:()=>sw,constants:()=>At,copyFile:()=>Xu,copyFileSync:()=>co,cp:()=>ed,cpSync:()=>lo,createReadStream:()=>Hu,createWriteStream:()=>Gu,decode:()=>ii,decodeDirListing:()=>Fr,default:()=>ww,detachFS:()=>cw,encode:()=>Te,encodeDirListing:()=>Ee,errorMessages:()=>Ln,exists:()=>fu,existsSync:()=>He,fchmod:()=>Iu,fchmodSync:()=>Br,fchown:()=>Fu,fchownSync:()=>Lr,fdatasync:()=>xu,fdatasyncSync:()=>La,flagToMode:()=>Ot,flagToNumber:()=>Hd,flagToString:()=>Qs,fs:()=>Sr,fstat:()=>wu,fstatSync:()=>Ca,fsync:()=>_u,fsyncSync:()=>Na,ftruncate:()=>Eu,ftruncateSync:()=>Ra,futimes:()=>Pu,futimesSync:()=>Dr,handleRequest:()=>Hi,isAppendable:()=>st,isBackend:()=>Gi,isBackendConfig:()=>Ki,isExclusive:()=>Ui,isReadable:()=>yt,isSynchronous:()=>Gd,isTruncating:()=>Wi,isWriteable:()=>ye,lchmod:()=>Mu,lchmodSync:()=>$a,lchown:()=>Bu,lchownSync:()=>ja,levenshtein:()=>Un,link:()=>Cu,linkSync:()=>Ma,lopenSync:()=>er,lstat:()=>du,lstatSync:()=>ro,lutimes:()=>Uu,lutimesSync:()=>za,mkdir:()=>Tu,mkdirSync:()=>Mr,mkdirpSync:()=>ta,mkdtemp:()=>Yu,mkdtempSync:()=>Ha,mount:()=>Bt,mountObject:()=>Ji,mounts:()=>Fe,nop:()=>x,normalizeMode:()=>_e,normalizeOptions:()=>xe,normalizePath:()=>v,normalizeTime:()=>Ct,open:()=>yu,openAsBlob:()=>id,openSync:()=>Zi,opendir:()=>Zu,opendirSync:()=>Ya,parseFlag:()=>D,promises:()=>wr,randomIno:()=>Mi,read:()=>vu,readFile:()=>mu,readFileSync:()=>Nr,readSync:()=>Da,readdir:()=>Ou,readdirSync:()=>fi,readlink:()=>Nu,readlinkSync:()=>oo,readv:()=>Ju,readvSync:()=>Ga,realpath:()=>ju,realpathSync:()=>Ve,rename:()=>lu,renameSync:()=>Pa,resolveMountConfig:()=>Ti,resolveRemoteMount:()=>fw,rm:()=>Ku,rmSync:()=>ao,rmdir:()=>Au,rmdirSync:()=>no,rootCred:()=>qe,rootIno:()=>je,setImmediate:()=>Xd,size_max:()=>Se,stat:()=>uu,statSync:()=>Qi,statfs:()=>td,statfsSync:()=>Xa,symlink:()=>Ru,symlinkSync:()=>Wa,truncate:()=>pu,truncateSync:()=>Aa,umount:()=>li,unlink:()=>hu,unlinkSync:()=>Rr,unwatchFile:()=>zu,utimes:()=>Wu,utimesSync:()=>so,version:()=>Vs,watch:()=>Vu,watchFile:()=>$u,write:()=>ku,writeFile:()=>bu,writeFileSync:()=>tr,writeSync:()=>Ba,writev:()=>Qu,writevSync:()=>Ka});var M=(h=>(h[h.EPERM=1]="EPERM",h[h.ENOENT=2]="ENOENT",h[h.EINTR=4]="EINTR",h[h.EIO=5]="EIO",h[h.ENXIO=6]="ENXIO",h[h.EBADF=9]="EBADF",h[h.EAGAIN=11]="EAGAIN",h[h.ENOMEM=12]="ENOMEM",h[h.EACCES=13]="EACCES",h[h.EFAULT=14]="EFAULT",h[h.ENOTBLK=15]="ENOTBLK",h[h.EBUSY=16]="EBUSY",h[h.EEXIST=17]="EEXIST",h[h.EXDEV=18]="EXDEV",h[h.ENODEV=19]="ENODEV",h[h.ENOTDIR=20]="ENOTDIR",h[h.EISDIR=21]="EISDIR",h[h.EINVAL=22]="EINVAL",h[h.ENFILE=23]="ENFILE",h[h.EMFILE=24]="EMFILE",h[h.ETXTBSY=26]="ETXTBSY",h[h.EFBIG=27]="EFBIG",h[h.ENOSPC=28]="ENOSPC",h[h.ESPIPE=29]="ESPIPE",h[h.EROFS=30]="EROFS",h[h.EMLINK=31]="EMLINK",h[h.EPIPE=32]="EPIPE",h[h.EDOM=33]="EDOM",h[h.ERANGE=34]="ERANGE",h[h.EDEADLK=35]="EDEADLK",h[h.ENAMETOOLONG=36]="ENAMETOOLONG",h[h.ENOLCK=37]="ENOLCK",h[h.ENOSYS=38]="ENOSYS",h[h.ENOTEMPTY=39]="ENOTEMPTY",h[h.ELOOP=40]="ELOOP",h[h.ENOMSG=42]="ENOMSG",h[h.EBADE=52]="EBADE",h[h.EBADR=53]="EBADR",h[h.EXFULL=54]="EXFULL",h[h.ENOANO=55]="ENOANO",h[h.EBADRQC=56]="EBADRQC",h[h.ENOSTR=60]="ENOSTR",h[h.ENODATA=61]="ENODATA",h[h.ETIME=62]="ETIME",h[h.ENOSR=63]="ENOSR",h[h.ENONET=64]="ENONET",h[h.EREMOTE=66]="EREMOTE",h[h.ENOLINK=67]="ENOLINK",h[h.ECOMM=70]="ECOMM",h[h.EPROTO=71]="EPROTO",h[h.EBADMSG=74]="EBADMSG",h[h.EOVERFLOW=75]="EOVERFLOW",h[h.EBADFD=77]="EBADFD",h[h.ESTRPIPE=86]="ESTRPIPE",h[h.ENOTSOCK=88]="ENOTSOCK",h[h.EDESTADDRREQ=89]="EDESTADDRREQ",h[h.EMSGSIZE=90]="EMSGSIZE",h[h.EPROTOTYPE=91]="EPROTOTYPE",h[h.ENOPROTOOPT=92]="ENOPROTOOPT",h[h.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",h[h.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",h[h.ENOTSUP=95]="ENOTSUP",h[h.ENETDOWN=100]="ENETDOWN",h[h.ENETUNREACH=101]="ENETUNREACH",h[h.ENETRESET=102]="ENETRESET",h[h.ETIMEDOUT=110]="ETIMEDOUT",h[h.ECONNREFUSED=111]="ECONNREFUSED",h[h.EHOSTDOWN=112]="EHOSTDOWN",h[h.EHOSTUNREACH=113]="EHOSTUNREACH",h[h.EALREADY=114]="EALREADY",h[h.EINPROGRESS=115]="EINPROGRESS",h[h.ESTALE=116]="ESTALE",h[h.EREMOTEIO=121]="EREMOTEIO",h[h.EDQUOT=122]="EDQUOT",h))(M||{}),Ln={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"},d=class e extends Error{constructor(i,r=Ln[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=M[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let r=new e(i.errno,i.message,i.path,i.syscall);return r.code=i.code,r.stack=i.stack,r}static With(i,r,n){return new e(M[i],Ln[M[i]],r,n)}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 At={};xr(At,{COPYFILE_EXCL:()=>Ni,COPYFILE_FICLONE:()=>_d,COPYFILE_FICLONE_FORCE:()=>xd,F_OK:()=>Ri,O_APPEND:()=>We,O_CREAT:()=>Z,O_DIRECT:()=>Td,O_DIRECTORY:()=>vd,O_DSYNC:()=>Pd,O_EXCL:()=>De,O_NOATIME:()=>Fd,O_NOCTTY:()=>kd,O_NOFOLLOW:()=>Id,O_NONBLOCK:()=>Od,O_RDONLY:()=>Zt,O_RDWR:()=>le,O_SYMLINK:()=>Ad,O_SYNC:()=>ei,O_TRUNC:()=>Me,O_WRONLY:()=>Be,R_OK:()=>Le,S_IFBLK:()=>rt,S_IFCHR:()=>nt,S_IFDIR:()=>ue,S_IFIFO:()=>ot,S_IFLNK:()=>Ae,S_IFMT:()=>K,S_IFREG:()=>fe,S_IFSOCK:()=>it,S_IRGRP:()=>Md,S_IROTH:()=>jd,S_IRUSR:()=>Ld,S_IRWXG:()=>Dn,S_IRWXO:()=>Mn,S_IRWXU:()=>Bn,S_ISGID:()=>Rd,S_ISUID:()=>Cd,S_ISVTX:()=>Nd,S_IWGRP:()=>Wd,S_IWOTH:()=>qd,S_IWUSR:()=>Bd,S_IXGRP:()=>Ud,S_IXOTH:()=>$d,S_IXUSR:()=>Dd,UV_FS_O_FILEMAP:()=>zd,W_OK:()=>we,X_OK:()=>Ed});var Ri=0,Le=4,we=2,Ed=1,Ni=1,_d=2,xd=4,Zt=0,Be=1,le=2,Z=64,De=128,kd=256,Me=512,We=1024,vd=65536,Fd=262144,Id=131072,ei=1052672,Pd=4096,Ad=32768,Td=16384,Od=2048,K=61440,it=49152,Ae=40960,fe=32768,rt=24576,ue=16384,nt=8192,ot=4096,Cd=2048,Rd=1024,Nd=512,Bn=448,Ld=256,Bd=128,Dd=64,Dn=56,Md=32,Wd=16,Ud=8,Mn=7,jd=4,qd=2,$d=1,zd=0;var Li=class{constructor({atimeMs:t,mtimeMs:i,ctimeMs:r,birthtimeMs:n,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 u=Date.now();this.atimeMs=this._convert(t??u),this.mtimeMs=this._convert(i??u),this.ctimeMs=this._convert(r??u),this.birthtimeMs=this._convert(n??u),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}static{s(this,"StatsCommon")}_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(t,i){if(i.euid===0||i.egid===0)return!0;let r=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(t&this.mode&r)==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}},X=class extends Li{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}},he=class extends Li{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}},Wn=525687744115,Bi=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Se;this.ffree=Se}static{s(this,"StatsFs")}},Di=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Se);this.ffree=BigInt(Se)}static{s(this,"BigIntStatsFs")}};var Se=2**32-1,je=0n;function Js(){return Math.round(Math.random()*2**32).toString(16)}s(Js,"_random");function Mi(){return BigInt("0x"+Js()+Js())}s(Mi,"randomIno");var W={ino:0,size:8,mode:12,nlink:14,uid:18,gid:22,atime:26,birthtime:34,mtime:42,ctime:50,end:58};var Ue=class{static{s(this,"Inode")}get data(){return new Uint8Array(this.buffer)}constructor(t){let i=!t;if(t??=new ArrayBuffer(W.end),t?.byteLength<W.end)throw new RangeError(`Can not create an inode from a buffer less than ${W.end} bytes`);if(this.view=new DataView(t),this.buffer=t,!i)return;this.ino=Mi(),this.nlink=1,this.size=4096;let r=Date.now();this.atimeMs=r,this.mtimeMs=r,this.ctimeMs=r,this.birthtimeMs=r}get ino(){return this.view.getBigUint64(W.ino,!0)}set ino(t){this.view.setBigUint64(W.ino,t,!0)}get size(){return this.view.getUint32(W.size,!0)}set size(t){this.view.setUint32(W.size,t,!0)}get mode(){return this.view.getUint16(W.mode,!0)}set mode(t){this.view.setUint16(W.mode,t,!0)}get nlink(){return this.view.getUint32(W.nlink,!0)}set nlink(t){this.view.setUint32(W.nlink,t,!0)}get uid(){return this.view.getUint32(W.uid,!0)}set uid(t){this.view.setUint32(W.uid,t,!0)}get gid(){return this.view.getUint32(W.gid,!0)}set gid(t){this.view.setUint32(W.gid,t,!0)}get atimeMs(){return this.view.getFloat64(W.atime,!0)}set atimeMs(t){this.view.setFloat64(W.atime,t,!0)}get birthtimeMs(){return this.view.getFloat64(W.birthtime,!0)}set birthtimeMs(t){this.view.setFloat64(W.birthtime,t,!0)}get mtimeMs(){return this.view.getFloat64(W.mtime,!0)}set mtimeMs(t){this.view.setFloat64(W.mtime,t,!0)}get ctimeMs(){return this.view.getFloat64(W.ctime,!0)}set ctimeMs(t){this.view.setFloat64(W.ctime,t,!0)}toStats(){return new X(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}};Promise.withResolvers??=function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Vd=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function D(e){if(typeof e=="number")return Qs(e);if(!Vd.includes(e))throw new Error("Invalid flag string: "+e);return e}s(D,"parseFlag");function Qs(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(Qs,"flagToString");function Hd(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(Hd,"flagToNumber");function Ot(e){let t=0;return t<<=1,t+=+yt(e),t<<=1,t+=+ye(e),t<<=1,t}s(Ot,"flagToMode");function yt(e){return e.indexOf("r")!==-1||e.indexOf("+")!==-1}s(yt,"isReadable");function ye(e){return e.indexOf("w")!==-1||e.indexOf("a")!==-1||e.indexOf("+")!==-1}s(ye,"isWriteable");function Wi(e){return e.indexOf("w")!==-1}s(Wi,"isTruncating");function st(e){return e.indexOf("a")!==-1}s(st,"isAppendable");function Gd(e){return e.indexOf("s")!==-1}s(Gd,"isSynchronous");function Ui(e){return e.indexOf("x")!==-1}s(Ui,"isExclusive");var Tt=class{static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},me=class extends Tt{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:Se}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;this.closed=!1;if(this.stats.size!=a.byteLength){if(yt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return st(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){if(this.closed)throw d.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 d.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 d.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw d.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(i){if(this.closed)throw d.With("EBADF",this.path,"File.dispose");if(this.dirty&&!i)throw d.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw d.With("EBADF",this.path,"File.stat");return Promise.resolve(new X(this.stats))}statSync(){if(this.closed)throw d.With("EBADF",this.path,"File.stat");return new X(this.stats)}_truncate(i){if(this.closed)throw d.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!ye(this.flag))throw new d(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let r=new Uint8Array(i-this._buffer.length);this.writeSync(r,0,r.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,r=0,n=this.stats.size,o=this.position){if(this.closed)throw d.With("EBADF",this.path,"File.write");if(this.dirty=!0,!ye(this.flag))throw new d(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:Se}));l.set(this._buffer),this._buffer=l}let c=i.slice(r,r+n);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,r,n,o){let a=this._write(i,r,n,o);return await this.sync(),a}writeSync(i,r=0,n=this.stats.size,o=this.position){let a=this._write(i,r,n,o);return this.syncSync(),a}_read(i,r=0,n=this.stats.size,o){if(this.closed)throw d.With("EBADF",this.path,"File.read");if(!yt(this.flag))throw new d(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,r,n).set(this._buffer.slice(o,a)),c}async read(i,r,n,o){let a=this._read(i,r,n,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,r,n,o){let a=this._read(i,r,n,o);return this.statSync(),a}async chmod(i){if(this.closed)throw d.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){if(this.closed)throw d.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){if(this.closed)throw d.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,r),await this.sync()}chownSync(i,r){if(this.closed)throw d.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){if(this.closed)throw d.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=r,await this.sync()}utimesSync(i,r){if(this.closed)throw d.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}async _setType(i){if(this.closed)throw d.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 d.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()}},ti=class extends me{static{s(this,"NoSyncFile")}constructor(t,i,r,n,o){super(t,i,r,n,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};var de=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Wn}}constructor(...t){}async ready(){}async exists(t,i){try{return await this.stat(t,i),!0}catch(r){return r.code!="ENOENT"}}existsSync(t,i){try{return this.statSync(t,i),!0}catch(r){return r.code!="ENOENT"}}};var qe={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Kd="/";function Zs(e,t){let i="",r=0,n=-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(!(n===c-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",r=0):(i=i.slice(0,l),r=i.length-1-i.lastIndexOf("/")),n=c,o=0;continue}else if(i.length!==0){i="",r=0,n=c,o=0;continue}}t&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+e.slice(n+1,c):i=e.slice(n+1,c),r=c-n-1;n=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Zs,"normalizeString");function mt(...e){let t="";for(let r of[...e.reverse(),Kd])if(r.length&&(t=`${r}/${t}`,r.startsWith("/")))break;let i=t.startsWith("/");return t=Zs(t,!i),i?`/${t}`:t.length?t:"/"}s(mt,"resolve");function Yd(e){if(!e.length)return".";let t=e.startsWith("/"),i=e.endsWith("/");return e=Zs(e,!t),e.length?(i&&(e+="/"),t?`/${e}`:e):t?"/":i?"./":"."}s(Yd,"normalize");function $(...e){if(!e.length)return".";let t=e.join("/");return t?.length?Yd(t):"."}s($,"join");function A(e){if(e.length===0)return".";let t=e[0]==="/",i=-1,r=!0;for(let n=e.length-1;n>=1;--n)if(e[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?t?"/":".":t&&i===1?"//":e.slice(0,i)}s(A,"dirname");function z(e,t){let i=0,r=-1,n=!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(!n){i=c+1;break}}else a===-1&&(n=!1,a=c+1),o>=0&&(e[c]===t[o]?--o===-1&&(r=c):(o=-1,r=a));return i===r?r=a:r===-1&&(r=e.length),e.slice(i,r)}for(let o=e.length-1;o>=0;--o)if(e[o]==="/"){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":e.slice(i,r)}s(z,"basename");function kr(e){let t=e.startsWith("/"),i={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(e.length===0)return i;let r=t?1:0,n=-1,o=0,a=-1,c=!0,l=e.length-1,f=0;for(;l>=r;--l){if(e[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),e[l]==="."?n===-1?n=l:f!==1&&(f=1):n!==-1&&(f=-1)}if(a!==-1){let u=o===0&&t?1:o;n===-1||f===0||f===1&&n===a-1&&n===o+1?i.base=i.name=e.slice(u,a):(i.name=e.slice(u,n),i.base=e.slice(u,a),i.ext=e.slice(n,a))}return o>0?i.dir=e.slice(0,o-1):t&&(i.dir="/"),i}s(kr,"parse");function ea(e){class t extends e{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{s(this,"AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(n=>{let o=s(()=>this._queueRunning?setTimeout(o):n(),"check");o()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}}}checkSync(n,o){if(this._disableSync)throw new d(95,"Sync caching has been disabled for this async file system",n,o);if(!this._sync)throw new d(95,"No sync cache is attached to this async file system",n,o)}renameSync(n,o,a){this.checkSync(n,"rename"),this._sync.renameSync(n,o,a),this.queue("rename",n,o,a)}statSync(n,o){return this.checkSync(n,"stat"),this._sync.statSync(n,o)}createFileSync(n,o,a,c){return this.checkSync(n,"createFile"),this._sync.createFileSync(n,o,a,c),this.queue("createFile",n,o,a,c),this.openFileSync(n,o,c)}openFileSync(n,o,a){this.checkSync(n,"openFile");let c=this._sync.openFileSync(n,o,a),l=c.statSync(),f=new Uint8Array(l.size);return c.readSync(f),new me(this,n,o,l,f)}unlinkSync(n,o){this.checkSync(n,"unlinkSync"),this._sync.unlinkSync(n,o),this.queue("unlink",n,o)}rmdirSync(n,o){this.checkSync(n,"rmdir"),this._sync.rmdirSync(n,o),this.queue("rmdir",n,o)}mkdirSync(n,o,a){this.checkSync(n,"mkdir"),this._sync.mkdirSync(n,o,a),this.queue("mkdir",n,o,a)}readdirSync(n,o){return this.checkSync(n,"readdir"),this._sync.readdirSync(n,o)}linkSync(n,o,a){this.checkSync(n,"link"),this._sync.linkSync(n,o,a),this.queue("link",n,o,a)}syncSync(n,o,a){this.checkSync(n,"sync"),this._sync.syncSync(n,o,a),this.queue("sync",n,o,a)}existsSync(n,o){return this.checkSync(n,"exists"),this._sync.existsSync(n,o)}async crossCopy(n){this.checkSync(n,"crossCopy");let o=await this.stat(n,qe);if(o.isDirectory()){if(n!=="/"){let b=await this.stat(n,qe);this._sync.mkdirSync(n,b.mode,b.cred())}let p=await this.readdir(n,qe);for(let b of p)await this.crossCopy($(n,b))}else{var a=[];try{let p=S(a,await this.openFile(n,D("r"),qe),!0);let b=S(a,this._sync.createFileSync(n,D("w"),o.mode,o.cred()));let m=new Uint8Array(o.size);await p.read(m);b.writeSync(m,0,o.size)}catch(c){var l=c,f=!0}finally{var u=E(a,l,f);u&&await u}}}async _next(){if(!this._queueRunning)return;let[n,...o]=this._queue.shift();await this[n](...o),await this._next()}queue(...n){this._queue.push(n),this._next()}}return t}s(ea,"Async");function ta(e,t,i,r){r.existsSync(e,i)||(ta(A(e),t,i,r),r.mkdirSync(e,t,i))}s(ta,"mkdirpSync");function vr(e,t,i,r,n){return Math.min(e+1,t+1,i+1,r===n?t:t+1)}s(vr,"_min");function Un(e,t){if(e===t)return 0;e.length>t.length&&([e,t]=[t,e]);let i=e.length,r=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(r-1);)i--,r--;let n=0;for(;n<i&&e.charCodeAt(n)===t.charCodeAt(n);)n++;if(i-=n,r-=n,i===0||r===1)return r;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=e.charCodeAt(n+b),o[b]=++b;let a,c,l,f,u;for(a=0;a+3<r;){let b=t.charCodeAt(n+(c=a)),m=t.charCodeAt(n+(l=a+1)),w=t.charCodeAt(n+(f=a+2)),g=t.charCodeAt(n+(u=a+3)),k=a+=4;for(let _=0;_<i;){let O=o[i+_],R=o[_];c=vr(R,c,l,b,O),l=vr(c,l,f,m,O),f=vr(l,f,u,w,O),k=vr(f,u,k,g,O),o[_++]=k,u=f,f=l,l=c,c=R}}let p=0;for(;a<r;){let b=t.charCodeAt(n+(c=a));p=++a;for(let m=0;m<i;m++){let w=o[m];o[m]=p=w<c||p<c?w>p?p+1:w+1:b===o[i+m]?c:c+1,c=w}}return p}s(Un,"levenshtein");var Xd=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:e=>setTimeout(e,0);function Te(e){if(typeof e!="string")throw new d(22,"Can not encode a non-string");return new Uint8Array(Array.from(e).map(t=>t.charCodeAt(0)))}s(Te,"encode");function ii(e){if(!(e instanceof Uint8Array))throw new d(22,"Can not decode a non-Uint8Array");return Array.from(e).map(t=>String.fromCharCode(t)).join("")}s(ii,"decode");function Fr(e){return JSON.parse(ii(e),(t,i)=>t==""?i:BigInt(i))}s(Fr,"decodeDirListing");function Ee(e){return Te(JSON.stringify(e,(t,i)=>t==""?i:i.toString()))}s(Ee,"encodeDirListing");function Jd(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(Jd,"_toUnixTimestamp");function _e(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 d(22,"Invalid mode: "+e?.toString())}s(_e,"normalizeMode");function Ct(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 d(22,"Invalid time.")}s(Ct,"normalizeTime");function v(e){if(e=e.toString(),e.includes("\0"))throw new d(22,"Path can not contain null character");if(e.length==0)throw new d(22,"Path can not be empty");return mt(e.replaceAll(/[/\\]+/g,"/"))}s(v,"normalizePath");function xe(e,t="utf8",i,r=0){return typeof e!="object"||e===null?{encoding:typeof e=="string"?e:t??null,flag:i,mode:r}:{encoding:typeof e?.encoding=="string"?e.encoding:t??null,flag:typeof e?.flag=="string"?e.flag:i,mode:_e("mode"in e?e?.mode:null,r)}}s(xe,"normalizeOptions");function x(){}s(x,"nop");var ia=5,ji=class extends de{constructor(i){super();this.store=i;this._initialized=!1}static{s(this,"StoreFS")}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,r,n){var g=[];try{let o=S(g,this.store.transaction(),!0);let a=A(i),c=z(i),l=A(r),f=z(r),u=await this.findINode(o,a),p=await this.getDirListing(o,u,a);if(!u.toStats().hasAccess(2,n))throw d.With("EACCES",i,"rename");if(!p[c])throw d.With("ENOENT",i,"rename");let b=p[c];delete p[c];if((l+"/").indexOf(i+"/")===0)throw new d(16,a);let m,w;l===a?(m=u,w=p):(m=await this.findINode(o,l),w=await this.getDirListing(o,m,l));if(w[f]){let P=await this.getINode(o,w[f],r);if(P.toStats().isFile())await o.remove(P.ino),await o.remove(w[f]);else throw d.With("EPERM",r,"rename")}w[f]=b;await o.set(u.ino,Ee(p));await o.set(m.ino,Ee(w));await o.commit()}catch(k){var _=k,O=!0}finally{var R=E(g,_,O);R&&await R}}renameSync(i,r,n){var g=[];try{let o=S(g,this.store.transaction());let a=A(i),c=z(i),l=A(r),f=z(r),u=this.findINodeSync(o,a),p=this.getDirListingSync(o,u,a);if(!u.toStats().hasAccess(2,n))throw d.With("EACCES",i,"rename");if(!p[c])throw d.With("ENOENT",i,"rename");let b=p[c];delete p[c];if((l+"/").indexOf(i+"/")==0)throw new d(16,a);let m,w;l===a?(m=u,w=p):(m=this.findINodeSync(o,l),w=this.getDirListingSync(o,m,l));if(w[f]){let R=this.getINodeSync(o,w[f],r);if(R.toStats().isFile())o.removeSync(R.ino),o.removeSync(w[f]);else throw d.With("EPERM",r,"rename")}w[f]=b;o.setSync(u.ino,Ee(p));o.setSync(m.ino,Ee(w));o.commitSync()}catch(k){var _=k,O=!0}finally{E(g,_,O)}}async stat(i,r){var c=[];try{let n=S(c,this.store.transaction(),!0);let o=await this.findINode(n,i);if(!o)throw d.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,r))throw d.With("EACCES",i,"stat");return a}catch(l){var f=l,u=!0}finally{var p=E(c,f,u);p&&await p}}statSync(i,r){var a=[];try{let n=S(a,this.store.transaction());let o=this.findINodeSync(n,i).toStats();if(!o.hasAccess(4,r))throw d.With("EACCES",i,"stat");return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async createFile(i,r,n,o){let a=await this.commitNew(i,32768,n,o,new Uint8Array(0));return new me(this,i,r,a.toStats(),new Uint8Array(0))}createFileSync(i,r,n,o){return this.commitNewSync(i,32768,n,o),this.openFileSync(i,r,o)}async openFile(i,r,n){var l=[];try{let o=S(l,this.store.transaction(),!0);let a=await this.findINode(o,i),c=await o.get(a.ino);if(!a.toStats().hasAccess(Ot(r),n))throw d.With("EACCES",i,"openFile");if(!c)throw d.With("ENOENT",i,"openFile");return new me(this,i,r,a.toStats(),c)}catch(f){var u=f,p=!0}finally{var b=E(l,u,p);b&&await b}}openFileSync(i,r,n){var l=[];try{let o=S(l,this.store.transaction());let a=this.findINodeSync(o,i),c=o.getSync(a.ino);if(!a.toStats().hasAccess(Ot(r),n))throw d.With("EACCES",i,"openFile");if(!c)throw d.With("ENOENT",i,"openFile");return new me(this,i,r,a.toStats(),c)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async unlink(i,r){return this.remove(i,!1,r)}unlinkSync(i,r){this.removeSync(i,!1,r)}async rmdir(i,r){if((await this.readdir(i,r)).length>0)throw d.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0,r)}rmdirSync(i,r){if(this.readdirSync(i,r).length>0)throw d.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0,r)}async mkdir(i,r,n){await this.commitNew(i,16384,r,n,Te("{}"))}mkdirSync(i,r,n){this.commitNewSync(i,16384,r,n,Te("{}"))}async readdir(i,r){var a=[];try{let n=S(a,this.store.transaction(),!0);let o=await this.findINode(n,i);if(!o.toStats().hasAccess(4,r))throw d.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(n,o,i))}catch(c){var l=c,f=!0}finally{var u=E(a,l,f);u&&await u}}readdirSync(i,r){var a=[];try{let n=S(a,this.store.transaction());let o=this.findINodeSync(n,i);if(!o.toStats().hasAccess(4,r))throw d.With("EACCES",i,"readdir");return Object.keys(this.getDirListingSync(n,o,i))}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async sync(i,r,n){var f=[];try{let o=S(f,this.store.transaction(),!0);let a=await this._findINode(o,A(i),z(i)),c=await this.getINode(o,a,i),l=c.update(n);await o.set(c.ino,r);l&&await o.set(a,c.data);await o.commit()}catch(u){var p=u,b=!0}finally{var m=E(f,p,b);m&&await m}}syncSync(i,r,n){var f=[];try{let o=S(f,this.store.transaction());let a=this._findINodeSync(o,A(i),z(i)),c=this.getINodeSync(o,a,i),l=c.update(n);o.setSync(c.ino,r);l&&o.setSync(a,c.data);o.commitSync()}catch(u){var p=u,b=!0}finally{E(f,p,b)}}async link(i,r,n){var m=[];try{let o=S(m,this.store.transaction(),!0);let a=A(i),c=await this.findINode(o,a);if(!c.toStats().hasAccess(4,n))throw d.With("EACCES",a,"link");let l=A(r),f=await this.findINode(o,l),u=await this.getDirListing(o,f,l);if(!f.toStats().hasAccess(2,n))throw d.With("EACCES",l,"link");let p=await this._findINode(o,a,z(i));let b=await this.getINode(o,p,i);if(!b.toStats().hasAccess(2,n))throw d.With("EACCES",r,"link");b.nlink++;u[z(r)]=p;o.setSync(p,b.data);o.setSync(f.ino,Ee(u));o.commitSync()}catch(w){var g=w,k=!0}finally{var _=E(m,g,k);_&&await _}}linkSync(i,r,n){var m=[];try{let o=S(m,this.store.transaction());let a=A(i),c=this.findINodeSync(o,a);if(!c.toStats().hasAccess(4,n))throw d.With("EACCES",a,"link");let l=A(r),f=this.findINodeSync(o,l),u=this.getDirListingSync(o,f,l);if(!f.toStats().hasAccess(2,n))throw d.With("EACCES",l,"link");let p=this._findINodeSync(o,a,z(i));let b=this.getINodeSync(o,p,i);if(!b.toStats().hasAccess(2,n))throw d.With("EACCES",r,"link");b.nlink++;u[z(r)]=p;o.setSync(p,b.data);o.setSync(f.ino,Ee(u));o.commitSync()}catch(w){var g=w,k=!0}finally{E(m,g,k)}}async checkRoot(){var n=[];try{let i=S(n,this.store.transaction(),!0);if(await i.get(je))return;let r=new Ue;r.mode=16895;await i.set(r.ino,Te("{}"));await i.set(je,r.data);await i.commit()}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}checkRootSync(){var n=[];try{let i=S(n,this.store.transaction());if(i.getSync(je))return;let r=new Ue;r.mode=16895;i.setSync(r.ino,Te("{}"));i.setSync(je,r.data);i.commitSync()}catch(o){var a=o,c=!0}finally{E(n,a,c)}}async _findINode(i,r,n,o=new Set){let a=$(r,n);if(o.has(a))throw new d(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return je;let c=r=="/"?await this.getINode(i,je,r):await this.findINode(i,r,o),l=await this.getDirListing(i,c,r);if(!(n in l))throw d.With("ENOENT",mt(r,n),"_findINode");return l[n]}_findINodeSync(i,r,n,o=new Set){let a=$(r,n);if(o.has(a))throw new d(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return je;let c=r=="/"?this.getINodeSync(i,je,r):this.findINodeSync(i,r,o),l=this.getDirListingSync(i,c,r);if(!(n in l))throw d.With("ENOENT",mt(r,n),"_findINode");return l[n]}async findINode(i,r,n=new Set){let o=await this._findINode(i,A(r),z(r),n);return this.getINode(i,o,r)}findINodeSync(i,r,n=new Set){let o=this._findINodeSync(i,A(r),z(r),n);return this.getINodeSync(i,o,r)}async getINode(i,r,n){let o=await i.get(r);if(!o)throw d.With("ENOENT",n,"getINode");return new Ue(o.buffer)}getINodeSync(i,r,n){let o=i.getSync(r);if(!o)throw d.With("ENOENT",n,"getINode");return new Ue(o.buffer)}async getDirListing(i,r,n){if(!r.toStats().isDirectory())throw d.With("ENOTDIR",n,"getDirListing");let o=await i.get(r.ino);if(!o)throw d.With("ENOENT",n,"getDirListing");return Fr(o)}getDirListingSync(i,r,n){if(!r.toStats().isDirectory())throw d.With("ENOTDIR",n,"getDirListing");let o=i.getSync(r.ino);if(!o)throw d.With("ENOENT",n,"getDirListing");return Fr(o)}async addNew(i,r,n){for(let o=0;o<ia;o++){let a=Mi();if(!await i.get(a))return await i.set(a,r),a}throw new d(28,"No inode IDs available",n,"addNewNode")}addNewSync(i,r,n){for(let o=0;o<ia;o++){let a=Mi();if(!i.getSync(a))return i.setSync(a,r),a}throw new d(28,"No inode IDs available",n,"addNewNode")}async commitNew(i,r,n,o,a){var m=[];try{let c=S(m,this.store.transaction(),!0);let l=A(i),f=await this.findINode(c,l);if(!f.toStats().hasAccess(2,o))throw d.With("EACCES",i,"commitNewFile");let u=z(i),p=await this.getDirListing(c,f,l);if(i==="/")throw d.With("EEXIST",i,"commitNewFile");if(p[u])throw await c.abort(),d.With("EEXIST",i,"commitNewFile");let b=new Ue;b.ino=await this.addNew(c,a,i);b.mode=n|r;b.uid=o.uid;b.gid=o.gid;b.size=a.length;p[u]=await this.addNew(c,b.data,i);await c.set(f.ino,Ee(p));await c.commit();return b}catch(w){var g=w,k=!0}finally{var _=E(m,g,k);_&&await _}}commitNewSync(i,r,n,o,a=new Uint8Array){var m=[];try{let c=S(m,this.store.transaction());let l=A(i),f=this.findINodeSync(c,l);if(!f.toStats().hasAccess(2,o))throw d.With("EACCES",i,"commitNewFile");let u=z(i),p=this.getDirListingSync(c,f,l);if(i==="/")throw d.With("EEXIST",i,"commitNewFile");if(p[u])throw d.With("EEXIST",i,"commitNewFile");let b=new Ue;b.ino=this.addNewSync(c,a,i);b.size=a.length;b.mode=n|r;b.uid=o.uid;b.gid=o.gid;p[u]=this.addNewSync(c,b.data,i);c.setSync(f.ino,Ee(p));c.commitSync();return b}catch(w){var g=w,k=!0}finally{E(m,g,k)}}async remove(i,r,n){var b=[];try{let o=S(b,this.store.transaction(),!0);let a=A(i),c=await this.findINode(o,a),l=await this.getDirListing(o,c,a),f=z(i);if(!l[f])throw d.With("ENOENT",i,"removeEntry");let u=l[f];let p=await this.getINode(o,u,i);if(!p.toStats().hasAccess(2,n))throw d.With("EACCES",i,"removeEntry");delete l[f];if(!r&&p.toStats().isDirectory())throw d.With("EISDIR",i,"removeEntry");if(r&&!p.toStats().isDirectory())throw d.With("ENOTDIR",i,"removeEntry");await o.set(c.ino,Ee(l));--p.nlink<1&&(await o.remove(p.ino),await o.remove(u));await o.commit()}catch(m){var w=m,g=!0}finally{var k=E(b,w,g);k&&await k}}removeSync(i,r,n){var b=[];try{let o=S(b,this.store.transaction());let a=A(i),c=this.findINodeSync(o,a),l=this.getDirListingSync(o,c,a),f=z(i),u=l[f];if(!u)throw d.With("ENOENT",i,"removeEntry");let p=this.getINodeSync(o,u,i);if(!p.toStats().hasAccess(2,n))throw d.With("EACCES",i,"removeEntry");delete l[f];if(!r&&p.toStats().isDirectory())throw d.With("EISDIR",i,"removeEntry");if(r&&!p.toStats().isDirectory())throw d.With("ENOTDIR",i,"removeEntry");o.setSync(c.ino,Ee(l));--p.nlink<1&&(o.removeSync(p.ino),o.removeSync(u));o.commitSync()}catch(m){var w=m,g=!0}finally{E(b,w,g)}}};var qi=class{constructor(t){this.store=t;this.done=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}},$i=class extends qi{static{s(this,"SyncTransaction")}async get(t){return this.getSync(t)}async set(t,i){return this.setSync(t,i)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},jn=class extends qi{static{s(this,"AsyncTransaction")}getSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};var qn=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}get(t){return this.cache.get(t)}set(t,i){this.cache.set(t,i),this.queue.add(this._set(t,i))}delete(t){this.cache.delete(t),this.queue.add(this._delete(t))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[t,i]of await this.entries())this.cache.has(t)||this.cache.set(t,i);for(let t of this.queue)await t}transaction(){return new ri(this)}},ri=class extends $i{constructor(i){super(i);this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let r=this.store.get(i);return this.stashOldValue(i,r),r}setSync(i,r){return this.markModified(i),this.store.set(i,r)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){this.done=!0}abortSync(){if(this.done){for(let i of this.modifiedKeys){let r=this.originalData.get(i);r?this.store.set(i,r):this.store.delete(i)}this.done=!0}}stashOldValue(i,r){this.originalData.has(i)||this.originalData.set(i,r)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var Ir=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new ri(this)}},ra={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 ji(new Ir(e));return t.checkRootSync(),t},"create")},zi=ra;function Qd(e){return typeof e=="object"&&e!=null&&"fd"in e&&"path"in e&&"position"in e}s(Qd,"isFileData");function $n(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}s($n,"isMessage");var ni=new Map;function zn(e,{port:t,timeout:i=1e3,fs:r}={}){let n=new Error().stack.slice(6);if(!t)throw d.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);ni.set(c,{resolve:o,reject:a,fs:r}),t.postMessage({...e,_zenfs:!0,id:c,stack:n});let l=setTimeout(()=>{let f=new d(5,"RPC Failed");f.stack+=n,a(f),typeof l=="object"&&l.unref()},i)})}s(zn,"request");function na(e){if(!$n(e))return;let{id:t,value:i,error:r,stack:n}=e;if(!ni.has(t)){let l=new d(5,"Invalid RPC id:"+t);throw l.stack+=n,l}let{resolve:o,reject:a,fs:c}=ni.get(t);if(r){let l=typeof i=="string"?new Error(i):d.fromJSON(i);l.stack+=n,a(l),ni.delete(t);return}if(Qd(i)){let{fd:l,path:f,position:u}=i,p=new Vi(c,l,f,u);o(p),ni.delete(t);return}o(i),ni.delete(t)}s(na,"handleResponse");function Pr(e,t){if(!e)throw d.With("EINVAL");e["on"in e?"on":"addEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Pr,"attach");function Vn(e,t){if(!e)throw d.With("EINVAL");e["off"in e?"off":"removeEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Vn,"detach");function oa(e){let t=[],i=t.push.bind(t);return Pr(e,i),function(r){Vn(e,i);for(let n of t){let o="data"in n?n.data:n;Hi(e,r,o)}}}s(oa,"catchMessages");function Gi(e){return e!=null&&typeof e=="object"&&"isAvailable"in e&&typeof e.isAvailable=="function"&&"create"in e&&typeof e.create=="function"}s(Gi,"isBackend");async function Hn(e,t){if(typeof t!="object"||t===null)throw new d(22,"Invalid options");for(let[i,r]of Object.entries(e.options)){let n=t?.[i];if(n==null){if(!r.required)continue;let a=Object.keys(t).filter(c=>!(c in e.options)).map(c=>({str:c,distance:Un(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new d(22,`${e.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(r.type)?r.type.indexOf(typeof n)!=-1:typeof n==r.type))throw new d(22,`${e.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(r.type)?`one of {${r.type.join(", ")}}`:r.type}, but received ${typeof n}`);r.validator&&await r.validator(n)}}s(Hn,"checkOptions");function Ki(e){return e!=null&&typeof e=="object"&&"backend"in e&&Gi(e.backend)}s(Ki,"isBackendConfig");var Sr={};xr(Sr,{BigIntStatsFs:()=>Di,Dir:()=>Et,Dirent:()=>St,ReadStream:()=>Ft,Stats:()=>X,StatsFs:()=>Bi,WriteStream:()=>It,access:()=>qu,accessSync:()=>Va,appendFile:()=>gu,appendFileSync:()=>Oa,chmod:()=>Du,chmodSync:()=>qa,chown:()=>Lu,chownSync:()=>Ua,close:()=>Su,closeSync:()=>wt,constants:()=>At,copyFile:()=>Xu,copyFileSync:()=>co,cp:()=>ed,cpSync:()=>lo,createReadStream:()=>Hu,createWriteStream:()=>Gu,exists:()=>fu,existsSync:()=>He,fchmod:()=>Iu,fchmodSync:()=>Br,fchown:()=>Fu,fchownSync:()=>Lr,fdatasync:()=>xu,fdatasyncSync:()=>La,fstat:()=>wu,fstatSync:()=>Ca,fsync:()=>_u,fsyncSync:()=>Na,ftruncate:()=>Eu,ftruncateSync:()=>Ra,futimes:()=>Pu,futimesSync:()=>Dr,lchmod:()=>Mu,lchmodSync:()=>$a,lchown:()=>Bu,lchownSync:()=>ja,link:()=>Cu,linkSync:()=>Ma,lopenSync:()=>er,lstat:()=>du,lstatSync:()=>ro,lutimes:()=>Uu,lutimesSync:()=>za,mkdir:()=>Tu,mkdirSync:()=>Mr,mkdtemp:()=>Yu,mkdtempSync:()=>Ha,mount:()=>Bt,mountObject:()=>Ji,mounts:()=>Fe,open:()=>yu,openAsBlob:()=>id,openSync:()=>Zi,opendir:()=>Zu,opendirSync:()=>Ya,promises:()=>wr,read:()=>vu,readFile:()=>mu,readFileSync:()=>Nr,readSync:()=>Da,readdir:()=>Ou,readdirSync:()=>fi,readlink:()=>Nu,readlinkSync:()=>oo,readv:()=>Ju,readvSync:()=>Ga,realpath:()=>ju,realpathSync:()=>Ve,rename:()=>lu,renameSync:()=>Pa,rm:()=>Ku,rmSync:()=>ao,rmdir:()=>Au,rmdirSync:()=>no,stat:()=>uu,statSync:()=>Qi,statfs:()=>td,statfsSync:()=>Xa,symlink:()=>Ru,symlinkSync:()=>Wa,truncate:()=>pu,truncateSync:()=>Aa,umount:()=>li,unlink:()=>hu,unlinkSync:()=>Rr,unwatchFile:()=>zu,utimes:()=>Wu,utimesSync:()=>so,watch:()=>Vu,watchFile:()=>$u,write:()=>ku,writeFile:()=>bu,writeFileSync:()=>tr,writeSync:()=>Ba,writev:()=>Qu,writevSync:()=>Ka});var qs=Ci(ve(),1);var wr={};xr(wr,{FileHandle:()=>oe,access:()=>Ms,appendFile:()=>Ts,chmod:()=>Ls,chown:()=>Rs,constants:()=>At,copyFile:()=>In,cp:()=>Pn,exists:()=>Ne,lchmod:()=>Bs,lchown:()=>Ns,link:()=>Os,lstat:()=>_n,lutimes:()=>Ds,mkdir:()=>gr,mkdtemp:()=>Ws,open:()=>be,opendir:()=>Us,readFile:()=>br,readdir:()=>Mt,readlink:()=>kn,realpath:()=>Re,rename:()=>Ps,rm:()=>Fn,rmdir:()=>xn,stat:()=>Ii,statfs:()=>js,symlink:()=>Cs,truncate:()=>As,unlink:()=>mr,utimes:()=>vn,watch:()=>ow,writeFile:()=>Ai});var Jt=Ci(ve(),1);var gt=Ci(ve(),1);var F=qe;function Ia(e){F=e}s(Ia,"setCred");var Lt=new Map,Cp=100;function Xi(e){let t=Cp++;return Lt.set(t,e),t}s(Xi,"file2fd");function U(e){if(!Lt.has(e))throw new d(9);return Lt.get(e)}s(U,"fd2file");var Fe=new Map;Bt("/",zi.create({name:"root"}));function Bt(e,t){if(e[0]!=="/"&&(e="/"+e),e=mt(e),Fe.has(e))throw new d(22,"Mount point "+e+" is already in use.");Fe.set(e,t)}s(Bt,"mount");function li(e){if(e[0]!=="/"&&(e=`/${e}`),e=mt(e),!Fe.has(e))throw new d(22,"Mount point "+e+" is already unmounted.");Fe.delete(e)}s(li,"umount");function N(e){e=v(e);let t=[...Fe].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of t)if(i.length<=e.length&&e.startsWith(i))return e=e.slice(i.length>1?i.length:0),e===""&&(e="/"),{fs:r,path:e,mountPoint:i};throw new d(5,"ZenFS not initialized with a file system")}s(N,"resolveMount");function Fa(e,t){for(let[i,r]of Object.entries(t))e=e?.replaceAll(i,r);return e}s(Fa,"fixPaths");function Y(e,t){return typeof e.stack=="string"&&(e.stack=Fa(e.stack,t)),e.message=Fa(e.message,t),e}s(Y,"fixError");function Ji(e){"/"in e&&li("/");for(let[t,i]of Object.entries(e))Bt(t,i)}s(Ji,"mountObject");function Cr(e,t){let i=e.metadata(),r=i.blockSize||4096;return{type:(t?BigInt:Number)(i.type),bsize:(t?BigInt:Number)(r),ffree:(t?BigInt:Number)(i.freeNodes||Se),files:(t?BigInt:Number)(i.totalNodes||Se),bavail:(t?BigInt:Number)(i.freeSpace/r),bfree:(t?BigInt:Number)(i.freeSpace/r),blocks:(t?BigInt:Number)(i.totalSpace/r)}}s(Cr,"_statfs");function Pa(e,t){e=v(e),t=v(t);let i=N(e),r=N(t),n={[i.path]:e,[r.path]:t};try{if(i===r)return i.fs.renameSync(i.path,r.path,F);tr(t,Nr(e)),Rr(e)}catch(o){throw Y(o,n)}}s(Pa,"renameSync");function He(e){e=v(e);try{let{fs:t,path:i}=N(Ve(e));return t.existsSync(i,F)}catch(t){if(t.errno==2)return!1;throw t}}s(He,"existsSync");function Qi(e,t){e=v(e);let{fs:i,path:r}=N(He(e)?Ve(e):e);try{let n=i.statSync(r,F);return t?.bigint?new he(n):n}catch(n){throw Y(n,{[r]:e})}}s(Qi,"statSync");function ro(e,t){e=v(e);let{fs:i,path:r}=N(e);try{let n=i.statSync(r,F);return t?.bigint?new he(n):n}catch(n){throw Y(n,{[r]:e})}}s(ro,"lstatSync");function Aa(e,t=0){var r=[];try{let i=S(r,Dt(e,"r+"));t||=0;if(t<0)throw new d(22);i.truncateSync(t)}catch(n){var o=n,a=!0}finally{E(r,o,a)}}s(Aa,"truncateSync");function Rr(e){e=v(e);let{fs:t,path:i}=N(e);try{return t.unlinkSync(i,F)}catch(r){throw Y(r,{[i]:e})}}s(Rr,"unlinkSync");function Dt(e,t,i,r=!0){e=v(e);let n=_e(i,420),o=D(t);e=r&&He(e)?Ve(e):e;let{fs:a,path:c}=N(e);if(!a.existsSync(c,F)){if(!ye(o)&&!st(o)||o=="r+")throw d.With("ENOENT",e,"_open");if(!a.statSync(A(c),F).isDirectory())throw d.With("ENOTDIR",A(e),"_open");return a.createFileSync(c,o,n,F)}let l=a.statSync(c,F);if(!l.hasAccess(n,F))throw d.With("EACCES",e,"_open");if(Ui(o))throw d.With("EEXIST",e,"_open");return Wi(o)?(a.unlinkSync(c,F),a.createFileSync(c,o,l.mode,F)):a.openFileSync(c,o,F)}s(Dt,"_openSync");function Zi(e,t,i=0){return Xi(Dt(e,t,i,!0))}s(Zi,"openSync");function er(e,t,i){return Xi(Dt(e,t,i,!1))}s(er,"lopenSync");function Ta(e,t,i){var a=[];try{let r=S(a,Dt(e,t,420,i));let n=r.statSync();let o=new Uint8Array(n.size);r.readSync(o,0,n.size,0);return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}s(Ta,"_readFileSync");function Nr(e,t={}){let i=xe(t,null,"r",420),r=D(i.flag);if(!yt(r))throw new d(22,"Flag passed to readFile must allow for reading.");let n=gt.Buffer.from(Ta(typeof e=="number"?U(e).path:e.toString(),i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(Nr,"readFileSync");function tr(e,t,i={}){var c=[];try{let r=xe(i,"utf8","w+",420);let n=D(r.flag);if(!ye(n))throw new d(22,"Flag passed to writeFile must allow for writing.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?gt.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new d(22,"Data not specified");let a=S(c,Dt(typeof e=="number"?U(e).path:e.toString(),n,r.mode,!0));a.writeSync(o,0,o.byteLength,0)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}s(tr,"writeFileSync");function Oa(e,t,i={}){var c=[];try{let r=xe(i,"utf8","a",420);let n=D(r.flag);if(!st(n))throw new d(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?gt.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,Dt(typeof e=="number"?U(e).path:e.toString(),n,r.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}s(Oa,"appendFileSync");function Ca(e,t){let i=U(e).statSync();return t?.bigint?new he(i):i}s(Ca,"fstatSync");function wt(e){U(e).closeSync(),Lt.delete(e)}s(wt,"closeSync");function Ra(e,t=0){if(t||=0,t<0)throw new d(22);U(e).truncateSync(t)}s(Ra,"ftruncateSync");function Na(e){U(e).syncSync()}s(Na,"fsyncSync");function La(e){U(e).datasyncSync()}s(La,"fdatasyncSync");function Ba(e,t,i,r,n){let o,a,c,l;if(typeof t=="string"){l=typeof i=="number"?i:null;let u=typeof r=="string"?r:"utf8";a=0,o=gt.Buffer.from(t,u),c=o.byteLength}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=r,l=typeof n=="number"?n:null;let f=U(e);return l??=f.position,f.writeSync(o,a,c,l)}s(Ba,"writeSync");function Da(e,t,i,r,n){let o=U(e),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(r=i.length,n=i.position),n=Number(n),isNaN(n)&&(n=o.position),o.readSync(t,a,r,n)}s(Da,"readSync");function Lr(e,t,i){U(e).chownSync(t,i)}s(Lr,"fchownSync");function Br(e,t){let i=_e(t,-1);if(i<0)throw new d(22,"Invalid mode.");U(e).chmodSync(i)}s(Br,"fchmodSync");function Dr(e,t,i){U(e).utimesSync(Ct(t),Ct(i))}s(Dr,"futimesSync");function no(e){e=v(e);let{fs:t,path:i}=N(He(e)?Ve(e):e);try{t.rmdirSync(i,F)}catch(r){throw Y(r,{[i]:e})}}s(no,"rmdirSync");function Mr(e,t){t=typeof t=="object"?t:{mode:t};let i=_e(t?.mode,511);e=v(e),e=He(e)?Ve(e):e;let{fs:r,path:n}=N(e),o={[n]:e};try{if(!t?.recursive)return r.mkdirSync(n,i,F);let a=[];for(let c=n,l=e;!r.existsSync(c,F);c=A(c),l=A(l))a.unshift(c),o[c]=l;for(let c of a)r.mkdirSync(c,i,F);return a[0]}catch(a){throw Y(a,o)}}s(Mr,"mkdirSync");function fi(e,t){e=v(e);let{fs:i,path:r}=N(He(e)?Ve(e):e),n;try{n=i.readdirSync(r,F)}catch(o){throw Y(o,{[r]:e})}for(let o of Fe.keys()){if(!o.startsWith(e))continue;let a=o.slice(e.length);a.includes("/")||a.length==0||n.push(a)}return n.map(o=>typeof t=="object"&&t?.withFileTypes?new St(o,Qi($(e.toString(),o))):t=="buffer"||typeof t=="object"&&t?.encoding=="buffer"?gt.Buffer.from(o):o)}s(fi,"readdirSync");function Ma(e,t){e=v(e),t=v(t);let{fs:i,path:r}=N(e);try{return i.linkSync(r,t,F)}catch(n){throw Y(n,{[r]:e})}}s(Ma,"linkSync");function Wa(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new d(22,"Invalid type: "+i);if(He(t))throw d.With("EEXIST",t.toString(),"symlink");tr(t,e.toString()),Dt(t,"r+",420,!1)._setTypeSync(40960)}s(Wa,"symlinkSync");function oo(e,t){let i=gt.Buffer.from(Ta(e.toString(),"r",!1)),r=typeof t=="object"?t?.encoding:t;return r=="buffer"?i:i.toString(r)}s(oo,"readlinkSync");function Ua(e,t,i){let r=Zi(e,"r+");Lr(r,t,i),wt(r)}s(Ua,"chownSync");function ja(e,t,i){let r=er(e,"r+");Lr(r,t,i),wt(r)}s(ja,"lchownSync");function qa(e,t){let i=Zi(e,"r+");Br(i,t),wt(i)}s(qa,"chmodSync");function $a(e,t){let i=er(e,"r+");Br(i,t),wt(i)}s($a,"lchmodSync");function so(e,t,i){let r=Zi(e,"r+");Dr(r,t,i),wt(r)}s(so,"utimesSync");function za(e,t,i){let r=er(e,"r+");Dr(r,t,i),wt(r)}s(za,"lutimesSync");function Ve(e,t){e=v(e);let{base:i,dir:r}=kr(e),n=$(r=="/"?"/":Ve(r),i),{fs:o,path:a,mountPoint:c}=N(n);try{return o.statSync(a,F).isSymbolicLink()?Ve(c+oo(n,t).toString()):n}catch(l){throw Y(l,{[a]:n})}}s(Ve,"realpathSync");function Va(e,t=384){if(!Qi(e).hasAccess(t,F))throw new d(13)}s(Va,"accessSync");function ao(e,t){switch(e=v(e),Qi(e).mode&61440){case 16384:if(t?.recursive)for(let r of fi(e))ao($(e,r),t);no(e);return;case 32768:case 40960:Rr(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new d(1,"File type not supported",e,"rm")}}s(ao,"rmSync");function Ha(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",n="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Mr(n),i=="buffer"?gt.Buffer.from(n):n}s(Ha,"mkdtempSync");function co(e,t,i){if(e=v(e),t=v(t),i&&i&1&&He(t))throw new d(17,"Destination file already exists.",t,"copyFile");tr(t,Nr(e))}s(co,"copyFileSync");function Ga(e,t,i){let r=U(e),n=0;for(let o of t)n+=r.readSync(o,0,o.byteLength,i+n);return n}s(Ga,"readvSync");function Ka(e,t,i){let r=U(e),n=0;for(let o of t)n+=r.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+n);return n}s(Ka,"writevSync");function Ya(e,t){return e=v(e),new Et(e)}s(Ya,"opendirSync");function lo(e,t,i){e=v(e),t=v(t);let r=ro(e);if(i?.errorOnExist&&He(t))throw new d(17,"Destination file or directory already exists.",t,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new d(21,e+" is a directory (not copied)",e,"cp");Mr(t,{recursive:!0});for(let n of fi(e,{withFileTypes:!0}))i.filter&&!i.filter($(e,n.name),$(t,n.name))||lo($(e,n.name),$(t,n.name),i);break;case 32768:case 40960:co(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new d(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&so(t,r.atime,r.mtime)}s(lo,"cpSync");function Xa(e,t){e=v(e);let{fs:i}=N(e);return Cr(i,t?.bigint)}s(Xa,"statfsSync");var St=class{constructor(t,i){this.path=t;this.stats=i}static{s(this,"Dirent")}get name(){return z(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()}},Et=class{constructor(t){this.path=t;this.closed=!1;this._entries=[]}static{s(this,"Dir")}checkClosed(){if(this.closed)throw new d(9,"Can not use closed Dir")}async _loadEntries(){this._entries??=await Mt(this.path,{withFileTypes:!0})}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return await this._loadEntries(),this._entries.length&&this._entries.shift()||null}read(t){if(!t)return this._read();this._read().then(i=>t(void 0,i))}readSync(){return this._entries??=fi(this.path,{withFileTypes:!0}),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let t=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],next:s(async function(){let i=await t._read();return i!=null?{done:!1,value:i}:(await t.close(),{done:!0,value:void 0})},"next")}}};var Sn=Ci(su(),1);var Ft=class extends Sn.Readable{static{s(this,"ReadStream")}close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new d(5,i.toString()))}}},It=class extends Sn.Writable{static{s(this,"WriteStream")}close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new d(5,i.toString()))}}};var Fs=Ci(cu(),1);var Is=class extends Fs.default{static{s(this,"Watcher")}off(t,i,r,n){return super.off(t,i,r,n)}removeListener(t,i,r,n){return super.removeListener(t,i,r,n)}setMaxListeners(){throw d.With("ENOTSUP")}getMaxListeners(){throw d.With("ENOTSUP")}prependListener(){throw d.With("ENOTSUP")}prependOnceListener(){throw d.With("ENOTSUP")}rawListeners(){throw d.With("ENOTSUP")}ref(){return this}unref(){return this}},Fi=class extends Is{constructor(i){super();this.options=i}static{s(this,"FSWatcher")}close(){}};var oe=class{static{s(this,"FileHandle")}constructor(t){let i=typeof t!="number";this.fd=i?Xi(t):t,this.file=i?t:U(t)}chown(t,i){return this.file.chown(t,i)}chmod(t){let i=_e(t,-1);if(i<0)throw new d(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(t){if(t||=0,t<0)throw new d(22);return this.file.truncate(t)}utimes(t,i){return this.file.utimes(Ct(t),Ct(i))}async appendFile(t,i={}){let r=xe(i,"utf8","a",420),n=D(r.flag);if(!st(n))throw new d(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?Jt.Buffer.from(t,r.encoding):t;await this.file.write(o,0,o.length)}read(t,i,r,n){return isNaN(+n)&&(n=this.file.position),this.file.read(t,i,r,n)}async readFile(t){let i=xe(t,null,"r",292),r=D(i.flag);if(!yt(r))throw new d(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(n),0,n,0),a=Jt.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(t={}){let i=s(async n=>{try{let c=0,l=0,f=NaN;for(;f>0;){let u=await this.read(new Uint8Array(65536),0,65536,l);if(!u.bytesRead){n.close();return}if(n.enqueue(u.buffer.slice(0,u.bytesRead)),l+=u.bytesRead,++c>=1e7)throw new d(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=u.bytesRead}}catch(o){n.error(o)}},"start"),r=globalThis;if(!("ReadableStream"in r))throw new d(38,"ReadableStream is missing on globalThis");return new r.ReadableStream({start:i,type:t.type})}readLines(t){throw d.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){let i=await this.file.stat();return t?.bigint?new he(i):i}async write(t,i,r,n){let o,a,c;if(typeof t=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,o=Jt.Buffer.from(t,f),c=o.length}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=r,n=typeof n=="number"?n:null;n??=this.file.position;let l=await this.file.write(o,a,c,n);return{buffer:o,bytesWritten:l}}async writeFile(t,i={}){let r=xe(i,"utf8","w",420),n=D(r.flag);if(!ye(n))throw new d(22,"Flag passed must allow for writing.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?Jt.Buffer.from(t,r.encoding):t;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Lt.delete(this.fd)}async writev(t,i){let r=0;for(let n of t)r+=(await this.write(n,0,n.length,i+r)).bytesWritten;return{bytesWritten:r,buffers:t}}async readv(t,i){let r=0;for(let n of t)r+=(await this.read(n,0,n.byteLength,i+r)).bytesRead;return{bytesRead:r,buffers:t}}createReadStream(t){let i=new Ft({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:s(async r=>{try{let n=await this.read(new Uint8Array(r),0,r,this.file.position);i.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(n){i.destroy(n)}},"read")});return i.path=this.file.path,i}createWriteStream(t){let i={highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:s(async(n,o,a)=>{try{let{bytesWritten:c}=await this.write(n,null,o);a(c==n.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},r=new It(i);return r.path=this.file.path,r}};async function Ps(e,t){e=v(e),t=v(t);let i=N(e),r=N(t);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,F);return}await Ai(t,await br(e)),await mr(e)}catch(n){throw Y(n,{[i.path]:e,[r.path]:t})}}s(Ps,"rename");async function Ne(e){try{let{fs:t,path:i}=N(await Re(e));return await t.exists(i,F)}catch(t){if(t instanceof d&&t.code=="ENOENT")return!1;throw t}}s(Ne,"exists");async function Ii(e,t){e=v(e);let{fs:i,path:r}=N(await Ne(e)?await Re(e):e);try{let n=await i.stat(r,F);return t?.bigint?new he(n):n}catch(n){throw Y(n,{[r]:e})}}s(Ii,"stat");async function _n(e,t){e=v(e);let{fs:i,path:r}=N(e);try{let n=await i.stat(r,F);return t?.bigint?new he(n):n}catch(n){throw Y(n,{[r]:e})}}s(_n,"lstat");async function As(e,t=0){var r=[];try{let i=S(r,await be(e,"r+"),!0);await i.truncate(t)}catch(n){var o=n,a=!0}finally{var c=E(r,o,a);c&&await c}}s(As,"truncate");async function mr(e){e=v(e);let{fs:t,path:i}=N(e);try{await t.unlink(i,F)}catch(r){throw Y(r,{[i]:e})}}s(mr,"unlink");async function Pi(e,t,i=420,r){e=v(e);let n=_e(i,420),o=D(t);e=r&&await Ne(e)?await Re(e):e;let{fs:a,path:c}=N(e);if(!await a.exists(c,F)){if(!ye(o)&&!st(o)||o=="r+")throw d.With("ENOENT",e,"_open");let f=await a.stat(A(c),F);if(f&&!f.isDirectory())throw d.With("ENOTDIR",A(e),"_open");return new oe(await a.createFile(c,o,n,F))}if(Ui(o))throw d.With("EEXIST",e,"_open");if(!Wi(o))return new oe(await a.openFile(c,o,F));let l=await a.openFile(c,o,F);return await l.truncate(0),await l.sync(),new oe(l)}s(Pi,"_open");async function be(e,t="r",i=420){return await Pi(e,t,i,!0)}s(be,"open");async function br(e,t){var n=[];try{let i=xe(t,null,"r",420);let r=S(n,typeof e=="object"&&"fd"in e?e:await be(e,i.flag,i.mode),!0);return await r.readFile(i)}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(br,"readFile");async function Ai(e,t,i){var a=[];try{let r=xe(i,"utf8","w+",420);let n=S(a,e instanceof oe?e:await be(e.toString(),r.flag,r.mode),!0);let o=t;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new d(22,"Iterables and streams not supported",n.file.path,"writeFile");await n.writeFile(o,r)}catch(c){var l=c,f=!0}finally{var u=E(a,l,f);u&&await u}}s(Ai,"writeFile");async function Ts(e,t,i){var c=[];try{let r=xe(i,"utf8","a",420);let n=D(r.flag);if(!st(n))throw new d(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?Jt.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,typeof e=="object"&&"fd"in e?e:await be(e,r.flag,r.mode),!0);await a.appendFile(o,r)}catch(l){var f=l,u=!0}finally{var p=E(c,f,u);p&&await p}}s(Ts,"appendFile");async function xn(e){e=v(e),e=await Ne(e)?await Re(e):e;let{fs:t,path:i}=N(e);try{await t.rmdir(i,F)}catch(r){throw Y(r,{[i]:e})}}s(xn,"rmdir");async function gr(e,t){t=typeof t=="object"?t:{mode:t};let i=_e(t?.mode,511);e=v(e),e=await Ne(e)?await Re(e):e;let{fs:r,path:n}=N(e),o={[n]:e};try{t?.recursive||await r.mkdir(n,i,F);let a=[];for(let c=n,l=e;!await r.exists(c,F);c=A(c),l=A(l))a.unshift(c),o[c]=l;for(let c of a)await r.mkdir(c,i,F);return a[0]}catch(a){throw Y(a,o)}}s(gr,"mkdir");async function Mt(e,t){e=v(e),e=await Ne(e)?await Re(e):e;let{fs:i,path:r}=N(e),n;try{n=await i.readdir(r,F)}catch(a){throw Y(a,{[r]:e})}for(let a of Fe.keys())if(a.startsWith(e)){let c=a.slice(e.length);if(c.includes("/")||c.length==0)continue;n.push(c)}let o=[];for(let a of n)o.push(typeof t=="object"&&t?.withFileTypes?new St(a,await Ii($(e,a))):a);return o}s(Mt,"readdir");async function Os(e,t){e=v(e),t=v(t);let{fs:i,path:r}=N(t);try{return await i.link(e,t,F)}catch(n){throw Y(n,{[r]:t})}}s(Os,"link");async function Cs(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new d(22,"Invalid symlink type: "+i);if(await Ne(t))throw d.With("EEXIST",t.toString(),"symlink");await Ai(t,e.toString()),await(await Pi(t,"r+",420,!1)).file._setType(40960)}s(Cs,"symlink");async function kn(e,t){var o=[];try{let i=S(o,await Pi(v(e),"r",420,!1),!0);let r=await i.readFile();let n=typeof t=="object"?t?.encoding:t;return n=="buffer"?r:r.toString(n)}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}s(kn,"readlink");async function Rs(e,t,i){var n=[];try{let r=S(n,await be(e,"r+"),!0);await r.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(Rs,"chown");async function Ns(e,t,i){var n=[];try{let r=S(n,await Pi(e,"r+",420,!1),!0);await r.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(Ns,"lchown");async function Ls(e,t){var r=[];try{let i=S(r,await be(e,"r+"),!0);await i.chmod(t)}catch(n){var o=n,a=!0}finally{var c=E(r,o,a);c&&await c}}s(Ls,"chmod");async function Bs(e,t){var r=[];try{let i=S(r,await Pi(e,"r+",420,!1),!0);await i.chmod(t)}catch(n){var o=n,a=!0}finally{var c=E(r,o,a);c&&await c}}s(Bs,"lchmod");async function vn(e,t,i){var n=[];try{let r=S(n,await be(e,"r+"),!0);await r.utimes(t,i)}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(vn,"utimes");async function Ds(e,t,i){var n=[];try{let r=S(n,await Pi(e,"r+",420,!1),!0);await r.utimes(new Date(t),new Date(i))}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(Ds,"lutimes");async function Re(e,t){e=v(e);let{base:i,dir:r}=kr(e),n=$(r=="/"?"/":await Re(r),i),{fs:o,path:a,mountPoint:c}=N(n);try{return(await o.stat(a,F)).isSymbolicLink()?Re(c+await kn(n)):n}catch(l){throw Y(l,{[a]:n})}}s(Re,"realpath");function ow(e,t={}){return{[Symbol.asyncIterator](){let i=new Fi(typeof t!="string"?t:{encoding:t});function r(n){return function(){let o=Promise.withResolvers();return i.on("change",(a,c)=>{o.resolve({value:{eventType:a,filename:c},done:n})}),o.promise}}return s(r,"withDone"),{next:r(!1),return:r(!0),throw:r(!0)}}}}s(ow,"watch");async function Ms(e,t=0){if(!(await Ii(e)).hasAccess(t,F))throw new d(13)}s(Ms,"access");async function Fn(e,t){switch(e=v(e),(await Ii(e)).mode&61440){case 16384:if(t?.recursive)for(let r of await Mt(e))await Fn($(e,r),t);await xn(e);return;case 32768:case 40960:await mr(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new d(1,"File type not supported",e,"rm")}}s(Fn,"rm");async function Ws(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",n="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await gr(n),i=="buffer"?Jt.Buffer.from(n):n}s(Ws,"mkdtemp");async function In(e,t,i){if(e=v(e),t=v(t),i&&i&1&&await Ne(t))throw new d(17,"Destination file already exists.",t,"copyFile");await Ai(t,await br(e))}s(In,"copyFile");async function Us(e,t){e=v(e);let i=new Et(e);return await i._loadEntries(),i}s(Us,"opendir");async function Pn(e,t,i){e=v(e),t=v(t);let r=await _n(e);if(i?.errorOnExist&&await Ne(t))throw new d(17,"Destination file or directory already exists.",t,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new d(21,e+" is a directory (not copied)",e,"cp");await gr(t,{recursive:!0});for(let n of await Mt(e,{withFileTypes:!0}))i.filter&&!i.filter($(e,n.name),$(t,n.name))||await Pn($(e,n.name),$(t,n.name),i);break;case 32768:case 40960:await In(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new d(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&await vn(t,r.atime,r.mtime)}s(Pn,"cp");async function js(e,t){e=v(e);let{fs:i}=N(e);return Cr(i,t?.bigint)}s(js,"statfs");function lu(e,t,i=x){Ps(e,t).then(()=>i()).catch(i)}s(lu,"rename");function fu(e,t=x){Ne(e).then(t).catch(()=>t(!1))}s(fu,"exists");function uu(e,t,i=x){i=typeof t=="function"?t:i,Ii(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(uu,"stat");function du(e,t,i=x){i=typeof t=="function"?t:i,_n(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(du,"lstat");function pu(e,t=0,i=x){i=typeof t=="function"?t:i,As(e,typeof t=="number"?t:0).then(()=>i()).catch(i)}s(pu,"truncate");function hu(e,t=x){mr(e).then(()=>t()).catch(t)}s(hu,"unlink");function yu(e,t,i,r=x){let n=_e(i,420);r=typeof i=="function"?i:r,be(e,t,n).then(o=>r(void 0,o.fd)).catch(r)}s(yu,"open");function mu(e,t,i=x){i=typeof t=="function"?t:i,br(e,typeof t=="function"?null:t).then(r=>i(void 0,r)).catch(i)}s(mu,"readFile");function bu(e,t,i,r=x){r=typeof i=="function"?i:r,Ai(e,t,typeof i!="function"?i:null).then(()=>r(void 0)).catch(r)}s(bu,"writeFile");function gu(e,t,i,r=x){let n=typeof i!="function"?i:void 0;r=typeof i=="function"?i:r,Ts(e,t,n).then(()=>r()).catch(r)}s(gu,"appendFile");function wu(e,t,i=x){i=typeof t=="function"?t:i,U(e).stat().then(r=>i(void 0,typeof t=="object"&&t?.bigint?new he(r):r)).catch(i)}s(wu,"fstat");function Su(e,t=x){new oe(e).close().then(()=>t()).catch(t)}s(Su,"close");function Eu(e,t,i=x){let r=typeof t=="number"?t:0;i=typeof t=="function"?t:i;let n=U(e);if(r<0)throw new d(22);n.truncate(r).then(()=>i()).catch(i)}s(Eu,"ftruncate");function _u(e,t=x){U(e).sync().then(()=>t()).catch(t)}s(_u,"fsync");function xu(e,t=x){U(e).datasync().then(()=>t()).catch(t)}s(xu,"fdatasync");function ku(e,t,i,r,n,o=x){let a,c,l,f,u,p=new oe(e);if(typeof t=="string"){switch(u="utf8",typeof i){case"function":o=i;break;case"number":f=i,u=typeof r=="string"?r:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof r=="function"?r:typeof n=="function"?n:o,o(new d(22,"Invalid arguments."));return}a=qs.Buffer.from(t),c=0,l=a.length;let b=o;p.write(a,c,l,f).then(({bytesWritten:m})=>b(void 0,m,a.toString(u))).catch(b)}else{a=qs.Buffer.from(t.buffer),c=i,l=r,f=typeof n=="number"?n:null;let b=typeof n=="function"?n:o;p.write(a,c,l,f).then(({bytesWritten:m})=>b(void 0,m,a)).catch(b)}}s(ku,"write");function vu(e,t,i,r,n,o=x){new oe(e).read(t,i,r,n).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(vu,"read");function Fu(e,t,i,r=x){new oe(e).chown(t,i).then(()=>r()).catch(r)}s(Fu,"fchown");function Iu(e,t,i){new oe(e).chmod(t).then(()=>i()).catch(i)}s(Iu,"fchmod");function Pu(e,t,i,r=x){new oe(e).utimes(t,i).then(()=>r()).catch(r)}s(Pu,"futimes");function Au(e,t=x){xn(e).then(()=>t()).catch(t)}s(Au,"rmdir");function Tu(e,t,i=x){gr(e,t).then(()=>i()).catch(i)}s(Tu,"mkdir");function Ou(e,t,i=x){i=typeof t=="function"?t:i,Mt(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(Ou,"readdir");function Cu(e,t,i=x){Os(e,t).then(()=>i()).catch(i)}s(Cu,"link");function Ru(e,t,i,r=x){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Cs(e,t,n).then(()=>r()).catch(r)}s(Ru,"symlink");function Nu(e,t,i=x){i=typeof t=="function"?t:i,kn(e).then(r=>i(void 0,r)).catch(i)}s(Nu,"readlink");function Lu(e,t,i,r=x){Rs(e,t,i).then(()=>r()).catch(r)}s(Lu,"chown");function Bu(e,t,i,r=x){Ns(e,t,i).then(()=>r()).catch(r)}s(Bu,"lchown");function Du(e,t,i=x){Ls(e,t).then(()=>i()).catch(i)}s(Du,"chmod");function Mu(e,t,i=x){Bs(e,t).then(()=>i()).catch(i)}s(Mu,"lchmod");function Wu(e,t,i,r=x){vn(e,t,i).then(()=>r()).catch(r)}s(Wu,"utimes");function Uu(e,t,i,r=x){Ds(e,t,i).then(()=>r()).catch(r)}s(Uu,"lutimes");function ju(e,t,i=x){i=typeof t=="function"?t:i,Re(e,typeof t=="function"?null:t).then(r=>i(void 0,r)).catch(i)}s(ju,"realpath");function qu(e,t,i=x){let r=typeof t=="number"?t:4;i=typeof t=="function"?t:i,Ms(e,r).then(()=>i()).catch(i)}s(qu,"access");function $u(e,t,i=x){throw d.With("ENOSYS",e.toString(),"watchFile")}s($u,"watchFile");function zu(e,t=x){throw d.With("ENOSYS",e.toString(),"unwatchFile")}s(zu,"unwatchFile");function Vu(e,t,i){let r=new Fi(typeof t=="object"?t:{});return i=typeof t=="function"?t:i,r.on("change",i||x),r}s(Vu,"watch");function Hu(e,t){let i=typeof t=="object"?t:{encoding:t},r,n=new Ft({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{r||=await be(e,"r",i?.mode);let a=await r.read(new Uint8Array(o),0,o,r.file.position);n.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),r.file.position+=a.bytesRead,a.bytesRead||await r.close()}catch(a){await r?.close(),n.destroy(a)}},"read"),destroy:s(function(o,a){r?.close().then(()=>a(o)).catch(a)},"destroy")});return n.path=e.toString(),n}s(Hu,"createReadStream");function Gu(e,t){let i=typeof t=="object"?t:{encoding:t},r,n=new It({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{r||=await be(e,"w",i?.mode||438),await r.write(o,0,a),c(void 0)}catch(l){await r?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),r?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){r?.close().then(()=>o()).catch(o)},"final")});return n.path=e.toString(),n}s(Gu,"createWriteStream");function Ku(e,t,i=x){i=typeof t=="function"?t:i,Fn(e,typeof t=="function"?void 0:t).then(()=>i(void 0)).catch(i)}s(Ku,"rm");function Yu(e,t,i=x){i=typeof t=="function"?t:i,Ws(e,typeof t!="function"?t:null).then(r=>i(void 0,r)).catch(i)}s(Yu,"mkdtemp");function Xu(e,t,i,r=x){r=typeof i=="function"?i:r,In(e,t,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(Xu,"copyFile");function Ju(e,t,i,r=x){r=typeof i=="function"?i:r,new oe(e).readv(t,typeof i=="function"?void 0:i).then(({buffers:n,bytesRead:o})=>r(void 0,o,n)).catch(r)}s(Ju,"readv");function Qu(e,t,i,r=x){r=typeof i=="function"?i:r,new oe(e).writev(t,typeof i=="function"?void 0:i).then(({buffers:n,bytesWritten:o})=>r(void 0,o,n)).catch(r)}s(Qu,"writev");function Zu(e,t,i=x){i=typeof t=="function"?t:i,Us(e,typeof t=="function"?void 0:t).then(r=>i(void 0,r)).catch(i)}s(Zu,"opendir");function ed(e,t,i,r=x){r=typeof i=="function"?i:r,Pn(e,t,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(ed,"cp");function td(e,t,i=x){i=typeof t=="function"?t:i,js(e,typeof t=="function"?void 0:t).then(r=>i(void 0,r)).catch(i)}s(td,"statfs");async function id(e,t){let i=await be(e.toString(),"r"),r=await i.readFile();return await i.close(),new Blob([r],t)}s(id,"openAsBlob");function rd(e){return Ki(e)||Gi(e)||e instanceof de}s(rd,"isMountConfig");async function Ti(e,t=0){if(typeof e!="object"||e==null)throw new d(22,"Invalid options on mount configuration");if(!rd(e))throw new d(22,"Invalid mount configuration");if(e instanceof de)return e;Gi(e)&&(e={backend:e});for(let[n,o]of Object.entries(e))if(n!="backend"&&rd(o)){if(t>10)throw new d(22,"Invalid configuration, too deep and possibly infinite");e[n]=await Ti(o,++t)}let{backend:i}=e;if(!await i.isAvailable())throw new d(1,"Backend not available: "+i.name);await Hn(i,e);let r=await i.create(e);return r._disableSync=e.disableAsyncCache||!1,await r.ready(),r}s(Ti,"resolveMountConfig");async function sw(e){if(!Ki(e))throw new TypeError("Invalid single mount point configuration");let t=await Ti(e);li("/"),Bt("/",t)}s(sw,"configureSingle");async function aw(e){let t="uid"in e&&e.uid||0,i="gid"in e&&e.gid||0;if(Ia({uid:t,gid:i,suid:t,sgid:i,euid:t,egid:i}),!!e.mounts){for(let[r,n]of Object.entries(e.mounts)){if(!r.startsWith("/"))throw new d(22,"Mount points must have absolute paths");Ki(n)&&(n.disableAsyncCache??=e.disableAsyncCache||!1),e.mounts[r]=await Ti(n)}Ji(e.mounts)}}s(aw,"configure");var Vi=class extends Tt{constructor(i,r,n,o){super();this.fs=i;this.fd=r;this.path=n;this.position=o}static{s(this,"PortFile")}rpc(i,...r){return zn({scope:"file",fd:this.fd,method:i,args:r},this.fs.options)}_throwNoSync(i){throw new d(95,"Syncrohnous operations not support on PortFile",this.path,i)}stat(){return this.rpc("stat")}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,r,n,o){return this.rpc("write",i,r,n,o)}writeSync(){this._throwNoSync("write")}async read(i,r,n,o){return await this.rpc("read",i,r,n,o)}readSync(){this._throwNoSync("read")}chown(i,r){return this.rpc("chown",i,r)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,r){return this.rpc("utimes",i,r)}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")}},Tn=class extends ea(de){constructor(i){super();this.options=i;this._sync=zi.create({name:"port-tmpfs"});this.port=i.port,Pr(this.port,na)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...r){return zn({scope:"fs",method:i,args:r},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,r,n){return this.rpc("rename",i,r,n)}async stat(i,r){return new X(await this.rpc("stat",i,r))}sync(i,r,n){return this.rpc("sync",i,r,n)}openFile(i,r,n){return this.rpc("openFile",i,r,n)}createFile(i,r,n,o){return this.rpc("createFile",i,r,n,o)}unlink(i,r){return this.rpc("unlink",i,r)}rmdir(i,r){return this.rpc("rmdir",i,r)}mkdir(i,r,n){return this.rpc("mkdir",i,r,n)}readdir(i,r){return this.rpc("readdir",i,r)}exists(i,r){return this.rpc("exists",i,r)}link(i,r,n){return this.rpc("link",i,r,n)}},nd=0,An=new Map;async function Hi(e,t,i){if(!$n(i))return;let{method:r,args:n,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await t[r](...n),l instanceof Tt&&(An.set(++nd,l),l={fd:nd,path:l.path,position:l.position});break;case"file":let{fd:u}=i;if(!An.has(u))throw new d(9);l=await An.get(u)[r](...n),r=="close"&&An.delete(u);break;default:return}}catch(u){l=u instanceof d?u.toJSON():u.toString(),f=!0}e.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:r,stack:c,value:l})}s(Hi,"handleRequest");function od(e,t){Pr(e,i=>Hi(e,t,i))}s(od,"attachFS");function cw(e,t){Vn(e,i=>Hi(e,t,i))}s(cw,"detachFS");var sd={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 d(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 Tn(e)},"create")},lw=sd;async function fw(e,t,i=0){let r=oa(e),n=await Ti(t,i);return od(e,n),r(n),n}s(fw,"resolveRemoteMount");function ad(e){try{return JSON.parse(e),!0}catch{return!1}}s(ad,"isJSON");function $s(e){return e.at(0).toUpperCase()+e.slice(1)}s($s,"capitalize");var zs=Symbol("struct_init"),uw=Symbol("struct");var cd=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],ld=[...cd,...cd.map(e=>$s(e)),"char"];function fd(e,t){return function(i,r){let n=typeof r=="object"?r.name:r;if(typeof n=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+n.toString()),n=n.toString()),!n)throw new ReferenceError("Invalid name for struct member");if(typeof i!="object")throw new TypeError("Invalid member for struct field");if(!("constructor"in i))throw new TypeError("Invalid member for struct field");let o=i.constructor;o[zs]||=[],o[zs].push({name:n,type:e,length:t})}}s(fd,"member");function hw(e){function t(i,r){return typeof i=="number"?fd(e,i):fd(e)(i,r)}return s(t,"_"),t}s(hw,"_member");var kx=Object.fromEntries(ld.map(e=>[e,hw(e)]));function ud(e){class t extends e{static{s(this,"ReadonlyFS")}metadata(){return{...super.metadata(),readonly:!0}}async rename(r,n,o){throw new d(30)}renameSync(r,n,o){throw new d(30)}async createFile(r,n,o,a){throw new d(30)}createFileSync(r,n,o,a){throw new d(30)}async unlink(r,n){throw new d(30)}unlinkSync(r,n){throw new d(30)}async rmdir(r,n){throw new d(30)}rmdirSync(r,n){throw new d(30)}async mkdir(r,n,o){throw new d(30)}mkdirSync(r,n,o){throw new d(30)}async link(r,n,o){throw new d(30)}linkSync(r,n,o){throw new d(30)}async sync(r,n,o){throw new d(30)}syncSync(r,n,o){throw new d(30)}}return t}s(ud,"Readonly");var Vs=1,On=class e extends Map{static{s(this,"Index")}files(){let t=new Map;for(let[i,r]of this)r.isFile()&&t.set(i,r);return t}toJSON(){return{version:Vs,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(t){let i=[];for(let r of this.keys())A(r)==t&&i.push(z(r));return i}fromJSON(t){if(t.version!=Vs)throw new d(22,"Index version mismatch");this.clear();for(let[i,r]of Object.entries(t.entries)){let n=new X(r);n.isDirectory()&&(n.fileData=Te(JSON.stringify(this.dirEntries(i)))),this.set(i,n)}}static parse(t){if(!ad(t))throw new d(22,"Invalid JSON");let i=JSON.parse(t),r=new e;return r.fromJSON(i),r}},Er=class extends ud(de){constructor(i){super();this.indexData=i;this.index=new On;this._isInitialized=!1}static{s(this,"IndexFS")}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=await this.getData(i,r)}reloadFilesSync(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=this.getDataSync(i,r)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw d.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,r,n){if(ye(r))throw new d(1,i);let o=this.index.get(i);if(!o)throw d.With("ENOENT",i,"openFile");if(!o.hasAccess(Ot(r),n))throw d.With("EACCES",i,"openFile");return new ti(this,i,r,o,o.isDirectory()?o.fileData:await this.getData(i,o))}openFileSync(i,r,n){if(ye(r))throw new d(1,i);let o=this.index.get(i);if(!o)throw d.With("ENOENT",i,"openFile");if(!o.hasAccess(Ot(r),n))throw d.With("EACCES",i,"openFile");return new ti(this,i,r,o,o.isDirectory()?o.fileData:this.getDataSync(i,o))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let r=this.index.get(i);if(!r)throw d.With("ENOENT",i,"readdir");if(!r.isDirectory())throw d.With("ENOTDIR",i,"readdir");let n=JSON.parse(ii(r.fileData));if(!Array.isArray(n))throw d.With("ENODATA",i,"readdir");if(!n.every(o=>typeof o=="string"))throw d.With("ENODATA",i,"readdir");return n}};async function dd(e,t){let i=await fetch(e).catch(r=>{throw new d(5,r.message)});if(!i.ok)throw new d(5,"fetch failed: response returned code "+i.status);switch(t){case"buffer":{let r=await i.arrayBuffer().catch(n=>{throw new d(5,n.message)});return new Uint8Array(r)}case"json":return i.json().catch(r=>{throw new d(5,r.message)});default:throw new d(22,"Invalid download type: "+t)}}s(dd,"fetchFile");var Cn=class e extends Er{static{s(this,"FetchFS")}async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[t,i]of this.index.files())await this.getData(t,i)}constructor({index:t="index.json",baseUrl:i=""}){super(typeof t!="string"?t:dd(t,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:e.name,readonly:!0}}preload(t,i){let r=this.index.get(t);if(!r)throw d.With("ENOENT",t,"preloadFile");if(!r.isFile())throw d.With("EISDIR",t,"preloadFile");r.size=i.length,r.fileData=i}async getData(t,i){if(i.fileData)return i.fileData;let r=await dd(this.baseUrl+(t.startsWith("/")?t.slice(1):t),"buffer");return i.fileData=r,r}getDataSync(t,i){if(i.fileData)return i.fileData;throw new d(61,"",t,"getData")}},yw={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 Cn(e)},"create")},mw=yw;var Hs=class{constructor(t,i){this.path=t;this.previous=i;this.current=Promise.withResolvers();this._isLocked=!0}static{s(this,"MutexLock")}get isLocked(){return this._isLocked}async done(){await this.previous?.done(),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}};function pd(e){class t extends e{constructor(){super(...arguments);this.locks=new Map}static{s(this,"MutexedFS")}addLock(n){let o=this.locks.get(n),a=new Hs(n,o?.isLocked?o:void 0);return this.locks.set(n,a),a}async lock(n){let o=this.locks.get(n),a=this.addLock(n);return await o?.done(),a}lockSync(n){if(this.locks.has(n))throw d.With("EBUSY",n,"lockSync");return this.addLock(n)}isLocked(n){return!!this.locks.get(n)?.isLocked}async rename(n,o,a){var l=[];try{let c=S(l,await this.lock(n));await super.rename(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}renameSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.renameSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async stat(n,o){var c=[];try{let a=S(c,await this.lock(n));return await super.stat(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}statSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.statSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async openFile(n,o,a){var l=[];try{let c=S(l,await this.lock(n));return await super.openFile(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}openFileSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.openFileSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async createFile(n,o,a,c){var f=[];try{let l=S(f,await this.lock(n));return await super.createFile(n,o,a,c)}catch(u){var p=u,b=!0}finally{E(f,p,b)}}createFileSync(n,o,a,c){var f=[];try{let l=S(f,this.lockSync(n));return super.createFileSync(n,o,a,c)}catch(u){var p=u,b=!0}finally{E(f,p,b)}}async unlink(n,o){var c=[];try{let a=S(c,await this.lock(n));await super.unlink(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}unlinkSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.unlinkSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async rmdir(n,o){var c=[];try{let a=S(c,await this.lock(n));await super.rmdir(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}rmdirSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.rmdirSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async mkdir(n,o,a){var l=[];try{let c=S(l,await this.lock(n));await super.mkdir(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}mkdirSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.mkdirSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async readdir(n,o){var c=[];try{let a=S(c,await this.lock(n));return await super.readdir(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}readdirSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.readdirSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async exists(n,o){var c=[];try{let a=S(c,await this.lock(n));return await super.exists(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}existsSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.existsSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async link(n,o,a){var l=[];try{let c=S(l,await this.lock(n));await super.link(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}linkSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.linkSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async sync(n,o,a){var l=[];try{let c=S(l,await this.lock(n));await super.sync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}syncSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.syncSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}}return t}s(pd,"Mutexed");var Gs="/.deleted",Rn=class extends de{constructor({writable:i,readable:r}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this.writable=i,this.readable=r,this.writable.metadata().readonly)throw new d(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnmutexedOverlayFS")}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:_r.name}}async sync(i,r,n){let o=n.cred(0,0);await this.createParentDirectories(i,o),await this.writable.exists(i,o)||await this.writable.createFile(i,"w",420,o),await this.writable.sync(i,r,n)}syncSync(i,r,n){let o=n.cred(0,0);this.createParentDirectoriesSync(i,o),this.writable.syncSync(i,r,n)}async _initialize(){if(!this._isInitialized){try{let i=await this.writable.openFile(Gs,D("r"),qe),{size:r}=await i.stat(),{buffer:n}=await i.read(new Uint8Array(r));this._deleteLog=ii(n)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i,r){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("",r)}async rename(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{await this.writable.rename(i,r,n)}catch{if(this._deletedFiles.has(i))throw d.With("ENOENT",i,"rename")}}renameSync(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{this.writable.renameSync(i,r,n)}catch{if(this._deletedFiles.has(i))throw d.With("ENOENT",i,"rename")}}async stat(i,r){this.checkInitialized();try{return await this.writable.stat(i,r)}catch{if(this._deletedFiles.has(i))throw d.With("ENOENT",i,"stat");let o=new X(await this.readable.stat(i,r));return o.mode|=146,o}}statSync(i,r){this.checkInitialized();try{return this.writable.statSync(i,r)}catch{if(this._deletedFiles.has(i))throw d.With("ENOENT",i,"stat");let o=new X(this.readable.statSync(i,r));return o.mode|=146,o}}async openFile(i,r,n){if(await this.writable.exists(i,n))return this.writable.openFile(i,r,n);let o=await this.readable.openFile(i,D("r"),n),a=new X(await o.stat()),{buffer:c}=await o.read(new Uint8Array(a.size));return new me(this,i,r,a,c)}openFileSync(i,r,n){if(this.writable.existsSync(i,n))return this.writable.openFileSync(i,r,n);let o=this.readable.openFileSync(i,D("r"),n),a=new X(o.statSync()),c=new Uint8Array(a.size);return o.readSync(c),new me(this,i,r,a,c)}async createFile(i,r,n,o){return this.checkInitialized(),await this.writable.createFile(i,r,n,o),this.openFile(i,r,o)}createFileSync(i,r,n,o){return this.checkInitialized(),this.writable.createFileSync(i,r,n,o),this.openFileSync(i,r,o)}async link(i,r,n){this.checkInitialized(),await this.writable.link(i,r,n)}linkSync(i,r,n){this.checkInitialized(),this.writable.linkSync(i,r,n)}async unlink(i,r){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i,r))throw d.With("ENOENT",i,"unlink");await this.writable.exists(i,r)&&await this.writable.unlink(i,r),await this.exists(i,r)&&await this.deletePath(i,r)}unlinkSync(i,r){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i,r))throw d.With("ENOENT",i,"unlink");this.writable.existsSync(i,r)&&this.writable.unlinkSync(i,r),this.existsSync(i,r)&&this.deletePath(i,r)}async rmdir(i,r){if(this.checkInitialized(),!await this.exists(i,r))throw d.With("ENOENT",i,"rmdir");if(await this.writable.exists(i,r)&&await this.writable.rmdir(i,r),await this.exists(i,r)){if((await this.readdir(i,r)).length>0)throw d.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i,r)}}rmdirSync(i,r){if(this.checkInitialized(),!this.existsSync(i,r))throw d.With("ENOENT",i,"rmdir");if(this.writable.existsSync(i,r)&&this.writable.rmdirSync(i,r),this.existsSync(i,r)){if(this.readdirSync(i,r).length>0)throw d.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,r)}}async mkdir(i,r,n){if(this.checkInitialized(),await this.exists(i,n))throw d.With("EEXIST",i,"mkdir");await this.createParentDirectories(i,n),await this.writable.mkdir(i,r,n)}mkdirSync(i,r,n){if(this.checkInitialized(),this.existsSync(i,n))throw d.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i,n),this.writable.mkdirSync(i,r,n)}async readdir(i,r){if(this.checkInitialized(),!(await this.stat(i,r)).isDirectory())throw d.With("ENOTDIR",i,"readdir");let o=[];try{o.push(...await this.writable.readdir(i,r))}catch{}try{o.push(...(await this.readable.readdir(i,r)).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}readdirSync(i,r){if(this.checkInitialized(),!this.statSync(i,r).isDirectory())throw d.With("ENOTDIR",i,"readdir");let o=[];try{o=o.concat(this.writable.readdirSync(i,r))}catch{}try{o=o.concat(this.readable.readdirSync(i,r).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}async deletePath(i,r){this._deletedFiles.add(i),await this.updateLog(`d${i}
|
|
3
|
-
`,r)}async updateLog(i,r){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this.writable.openFile(
|
|
4
|
-
`))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new d(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==
|
|
1
|
+
"use strict";var ZenFS=(()=>{var yd=Object.create;var Oi=Object.defineProperty;var md=Object.getOwnPropertyDescriptor;var bd=Object.getOwnPropertyNames;var gd=Object.getPrototypeOf,wd=Object.prototype.hasOwnProperty;var Js=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Qs=e=>{throw TypeError(e)};var s=(e,t)=>Oi(e,"name",{value:t,configurable:!0});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xr=(e,t)=>{for(var i in t)Oi(e,i,{get:t[i],enumerable:!0})},Zs=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of bd(t))!wd.call(e,n)&&n!==i&&Oi(e,n,{get:()=>t[n],enumerable:!(r=md(t,n))||r.enumerable});return e};var Ci=(e,t,i)=>(i=e!=null?yd(gd(e)):{},Zs(t||!e||!e.__esModule?Oi(i,"default",{value:e,enumerable:!0}):i,e)),Sd=e=>Zs(Oi({},"__esModule",{value:!0}),e);var S=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Qs("Object expected");var r;i&&(r=t[Js("asyncDispose")]),r===void 0&&(r=t[Js("dispose")]),typeof r!="function"&&Qs("Object not disposable"),e.push([i,r,t])}else i&&e.push([i]);return t},E=(e,t,i)=>{var r=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},n=a=>t=i?new r(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=>(n(l),o()))}catch(l){n(l)}if(i)throw t};return o()};var fa=C(Ar=>{"use strict";Ar.byteLength=tp;Ar.toByteArray=rp;Ar.fromByteArray=sp;var $e=[],ke=[],ep=typeof Uint8Array<"u"?Uint8Array:Array,Yn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Rt=0,ca=Yn.length;Rt<ca;++Rt)$e[Rt]=Yn[Rt],ke[Yn.charCodeAt(Rt)]=Rt;var Rt,ca;ke[45]=62;ke[95]=63;function la(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 r=i===t?0:4-i%4;return[i,r]}s(la,"getLens");function tp(e){var t=la(e),i=t[0],r=t[1];return(i+r)*3/4-r}s(tp,"byteLength");function ip(e,t,i){return(t+i)*3/4-i}s(ip,"_byteLength");function rp(e){var t,i=la(e),r=i[0],n=i[1],o=new ep(ip(e,r,n)),a=0,c=n>0?r-4:r,l;for(l=0;l<c;l+=4)t=ke[e.charCodeAt(l)]<<18|ke[e.charCodeAt(l+1)]<<12|ke[e.charCodeAt(l+2)]<<6|ke[e.charCodeAt(l+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return n===2&&(t=ke[e.charCodeAt(l)]<<2|ke[e.charCodeAt(l+1)]>>4,o[a++]=t&255),n===1&&(t=ke[e.charCodeAt(l)]<<10|ke[e.charCodeAt(l+1)]<<4|ke[e.charCodeAt(l+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}s(rp,"toByteArray");function np(e){return $e[e>>18&63]+$e[e>>12&63]+$e[e>>6&63]+$e[e&63]}s(np,"tripletToBase64");function op(e,t,i){for(var r,n=[],o=t;o<i;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(np(r));return n.join("")}s(op,"encodeChunk");function sp(e){for(var t,i=e.length,r=i%3,n=[],o=16383,a=0,c=i-r;a<c;a+=o)n.push(op(e,a,a+o>c?c:a+o));return r===1?(t=e[i-1],n.push($e[t>>2]+$e[t<<4&63]+"==")):r===2&&(t=(e[i-2]<<8)+e[i-1],n.push($e[t>>10]+$e[t>>4&63]+$e[t<<2&63]+"=")),n.join("")}s(sp,"fromByteArray")});var ua=C(Xn=>{Xn.read=function(e,t,i,r,n){var o,a,c=n*8-r-1,l=(1<<c)-1,f=l>>1,u=-7,p=i?n-1:0,b=i?-1:1,m=e[t+p];for(p+=b,o=m&(1<<-u)-1,m>>=-u,u+=c;u>0;o=o*256+e[t+p],p+=b,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=a*256+e[t+p],p+=b,u-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-f}return(m?-1:1)*a*Math.pow(2,o-r)};Xn.write=function(e,t,i,r,n,o){var a,c,l,f=o*8-n-1,u=(1<<f)-1,p=u>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,w=r?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=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=b/l:t+=b*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=u?(c=0,a=u):a+p>=1?(c=(t*l-1)*Math.pow(2,n),a=a+p):(c=t*Math.pow(2,p-1)*Math.pow(2,n),a=0));n>=8;e[i+m]=c&255,m+=w,c/=256,n-=8);for(a=a<<n|c,f+=n;f>0;e[i+m]=a&255,m+=w,a/=256,f-=8);e[i+m-w]|=g*128}});var ve=C(ci=>{"use strict";var Jn=fa(),si=ua(),da=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ci.Buffer=y;ci.SlowBuffer=dp;ci.INSPECT_MAX_BYTES=50;var Tr=2147483647;ci.kMaxLength=Tr;y.TYPED_ARRAY_SUPPORT=ap();!y.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 ap(){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(ap,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.buffer},"get")});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:s(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function at(e){if(e>Tr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,y.prototype),t}s(at,"createBuffer");function y(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 to(e)}return ma(e,t,i)}s(y,"Buffer");y.poolSize=8192;function ma(e,t,i){if(typeof e=="string")return lp(e,t);if(ArrayBuffer.isView(e))return fp(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(ze(e,ArrayBuffer)||e&&ze(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ze(e,SharedArrayBuffer)||e&&ze(e.buffer,SharedArrayBuffer)))return Zn(e,t,i);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return y.from(r,t,i);let n=up(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return y.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(ma,"from");y.from=function(e,t,i){return ma(e,t,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function ba(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(ba,"assertSize");function cp(e,t,i){return ba(e),e<=0?at(e):t!==void 0?typeof i=="string"?at(e).fill(t,i):at(e).fill(t):at(e)}s(cp,"alloc");y.alloc=function(e,t,i){return cp(e,t,i)};function to(e){return ba(e),at(e<0?0:io(e)|0)}s(to,"allocUnsafe");y.allocUnsafe=function(e){return to(e)};y.allocUnsafeSlow=function(e){return to(e)};function lp(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!y.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let i=ga(e,t)|0,r=at(i),n=r.write(e,t);return n!==i&&(r=r.slice(0,n)),r}s(lp,"fromString");function Qn(e){let t=e.length<0?0:io(e.length)|0,i=at(t);for(let r=0;r<t;r+=1)i[r]=e[r]&255;return i}s(Qn,"fromArrayLike");function fp(e){if(ze(e,Uint8Array)){let t=new Uint8Array(e);return Zn(t.buffer,t.byteOffset,t.byteLength)}return Qn(e)}s(fp,"fromArrayView");function Zn(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 r;return t===void 0&&i===void 0?r=new Uint8Array(e):i===void 0?r=new Uint8Array(e,t):r=new Uint8Array(e,t,i),Object.setPrototypeOf(r,y.prototype),r}s(Zn,"fromArrayBuffer");function up(e){if(y.isBuffer(e)){let t=io(e.length)|0,i=at(t);return i.length===0||e.copy(i,0,0,t),i}if(e.length!==void 0)return typeof e.length!="number"||no(e.length)?at(0):Qn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Qn(e.data)}s(up,"fromObject");function io(e){if(e>=Tr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tr.toString(16)+" bytes");return e|0}s(io,"checked");function dp(e){return+e!=e&&(e=0),y.alloc(+e)}s(dp,"SlowBuffer");y.isBuffer=s(function(t){return t!=null&&t._isBuffer===!0&&t!==y.prototype},"isBuffer");y.compare=s(function(t,i){if(ze(t,Uint8Array)&&(t=y.from(t,t.offset,t.byteLength)),ze(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(t)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===i)return 0;let r=t.length,n=i.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==i[o]){r=t[o],n=i[o];break}return r<n?-1:n<r?1:0},"compare");y.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");y.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 y.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<t.length;++r)i+=t[r].length;let n=y.allocUnsafe(i),o=0;for(r=0;r<t.length;++r){let a=t[r];if(ze(a,Uint8Array))o+a.length>n.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(y.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function ga(e,t){if(y.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ze(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,r=arguments.length>2&&arguments[2]===!0;if(!r&&i===0)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return eo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Ia(e).length;default:if(n)return r?-1:eo(e).length;t=(""+t).toLowerCase(),n=!0}}s(ga,"byteLength");y.byteLength=ga;function pp(e,t,i){let r=!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 xp(this,t,i);case"utf8":case"utf-8":return Sa(this,t,i);case"ascii":return Ep(this,t,i);case"latin1":case"binary":return _p(this,t,i);case"base64":return wp(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kp(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}s(pp,"slowToString");y.prototype._isBuffer=!0;function Nt(e,t,i){let r=e[t];e[t]=e[i],e[i]=r}s(Nt,"swap");y.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)Nt(this,i,i+1);return this},"swap16");y.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)Nt(this,i,i+3),Nt(this,i+1,i+2);return this},"swap32");y.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)Nt(this,i,i+7),Nt(this,i+1,i+6),Nt(this,i+2,i+5),Nt(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let t=this.length;return t===0?"":arguments.length===0?Sa(this,0,t):pp.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(t){if(!y.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:y.compare(this,t)===0},"equals");y.prototype.inspect=s(function(){let t="",i=ci.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},"inspect");da&&(y.prototype[da]=y.prototype.inspect);y.prototype.compare=s(function(t,i,r,n,o){if(ze(t,Uint8Array)&&(t=y.from(t,t.offset,t.byteLength)),!y.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),r===void 0&&(r=t?t.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),i<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&i>=r)return 0;if(n>=o)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;let a=o-n,c=r-i,l=Math.min(a,c),f=this.slice(n,o),u=t.slice(i,r);for(let p=0;p<l;++p)if(f[p]!==u[p]){a=f[p],c=u[p];break}return a<c?-1:c<a?1:0},"compare");function wa(e,t,i,r,n){if(e.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,no(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof t=="string"&&(t=y.from(t,r)),y.isBuffer(t))return t.length===0?-1:pa(e,t,i,r,n);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):pa(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}s(wa,"bidirectionalIndexOf");function pa(e,t,i,r,n){let o=1,a=e.length,c=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(u,p){return o===1?u[p]:u.readUInt16BE(p*o)}s(l,"read");let f;if(n){let u=-1;for(f=i;f<a;f++)if(l(e,f)===l(t,u===-1?0:f-u)){if(u===-1&&(u=f),f-u+1===c)return u*o}else u!==-1&&(f-=f-u),u=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let u=!0;for(let p=0;p<c;p++)if(l(e,f+p)!==l(t,p)){u=!1;break}if(u)return f}return-1}s(pa,"arrayIndexOf");y.prototype.includes=s(function(t,i,r){return this.indexOf(t,i,r)!==-1},"includes");y.prototype.indexOf=s(function(t,i,r){return wa(this,t,i,r,!0)},"indexOf");y.prototype.lastIndexOf=s(function(t,i,r){return wa(this,t,i,r,!1)},"lastIndexOf");function hp(e,t,i,r){i=Number(i)||0;let n=e.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let o=t.length;r>o/2&&(r=o/2);let a;for(a=0;a<r;++a){let c=parseInt(t.substr(a*2,2),16);if(no(c))return a;e[i+a]=c}return a}s(hp,"hexWrite");function yp(e,t,i,r){return Or(eo(t,e.length-i),e,i,r)}s(yp,"utf8Write");function mp(e,t,i,r){return Or(Pp(t),e,i,r)}s(mp,"asciiWrite");function bp(e,t,i,r){return Or(Ia(t),e,i,r)}s(bp,"base64Write");function gp(e,t,i,r){return Or(Ap(t,e.length-i),e,i,r)}s(gp,"ucs2Write");y.prototype.write=s(function(t,i,r,n){if(i===void 0)n="utf8",r=this.length,i=0;else if(r===void 0&&typeof i=="string")n=i,r=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return hp(this,t,i,r);case"utf8":case"utf-8":return yp(this,t,i,r);case"ascii":case"latin1":case"binary":return mp(this,t,i,r);case"base64":return bp(this,t,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gp(this,t,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function wp(e,t,i){return t===0&&i===e.length?Jn.fromByteArray(e):Jn.fromByteArray(e.slice(t,i))}s(wp,"base64Slice");function Sa(e,t,i){i=Math.min(e.length,i);let r=[],n=t;for(;n<i;){let o=e[n],a=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=i){let l,f,u,p;switch(c){case 1:o<128&&(a=o);break;case 2:l=e[n+1],(l&192)===128&&(p=(o&31)<<6|l&63,p>127&&(a=p));break;case 3:l=e[n+1],f=e[n+2],(l&192)===128&&(f&192)===128&&(p=(o&15)<<12|(l&63)<<6|f&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:l=e[n+1],f=e[n+2],u=e[n+3],(l&192)===128&&(f&192)===128&&(u&192)===128&&(p=(o&15)<<18|(l&63)<<12|(f&63)<<6|u&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=c}return Sp(r)}s(Sa,"utf8Slice");var ha=4096;function Sp(e){let t=e.length;if(t<=ha)return String.fromCharCode.apply(String,e);let i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=ha));return i}s(Sp,"decodeCodePointsArray");function Ep(e,t,i){let r="";i=Math.min(e.length,i);for(let n=t;n<i;++n)r+=String.fromCharCode(e[n]&127);return r}s(Ep,"asciiSlice");function _p(e,t,i){let r="";i=Math.min(e.length,i);for(let n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}s(_p,"latin1Slice");function xp(e,t,i){let r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);let n="";for(let o=t;o<i;++o)n+=Tp[e[o]];return n}s(xp,"hexSlice");function kp(e,t,i){let r=e.slice(t,i),n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}s(kp,"utf16leSlice");y.prototype.slice=s(function(t,i){let r=this.length;t=~~t,i=i===void 0?r:~~i,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<t&&(i=t);let n=this.subarray(t,i);return Object.setPrototypeOf(n,y.prototype),n},"slice");function ee(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(ee,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(t,i,r){t=t>>>0,i=i>>>0,r||ee(t,i,this.length);let n=this[t],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[t+a]*o;return n},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(t,i,r){t=t>>>0,i=i>>>0,r||ee(t,i,this.length);let n=this[t+--i],o=1;for(;i>0&&(o*=256);)n+=this[t+--i]*o;return n},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(t,i){return t=t>>>0,i||ee(t,1,this.length),this[t]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(t,i){return t=t>>>0,i||ee(t,2,this.length),this[t]|this[t+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(t,i){return t=t>>>0,i||ee(t,2,this.length),this[t]<<8|this[t+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},"readUInt32BE");y.prototype.readBigUInt64LE=bt(s(function(t){t=t>>>0,ai(t,"offset");let i=this[t],r=this[t+7];(i===void 0||r===void 0)&&Yi(t,this.length-8);let n=i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=bt(s(function(t){t=t>>>0,ai(t,"offset");let i=this[t],r=this[t+7];(i===void 0||r===void 0)&&Yi(t,this.length-8);let n=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+r;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(t,i,r){t=t>>>0,i=i>>>0,r||ee(t,i,this.length);let n=this[t],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[t+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*i)),n},"readIntLE");y.prototype.readIntBE=s(function(t,i,r){t=t>>>0,i=i>>>0,r||ee(t,i,this.length);let n=i,o=1,a=this[t+--n];for(;n>0&&(o*=256);)a+=this[t+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");y.prototype.readInt8=s(function(t,i){return t=t>>>0,i||ee(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},"readInt8");y.prototype.readInt16LE=s(function(t,i){t=t>>>0,i||ee(t,2,this.length);let r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");y.prototype.readInt16BE=s(function(t,i){t=t>>>0,i||ee(t,2,this.length);let r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r},"readInt16BE");y.prototype.readInt32LE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},"readInt32BE");y.prototype.readBigInt64LE=bt(s(function(t){t=t>>>0,ai(t,"offset");let i=this[t],r=this[t+7];(i===void 0||r===void 0)&&Yi(t,this.length-8);let n=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=bt(s(function(t){t=t>>>0,ai(t,"offset");let i=this[t],r=this[t+7];(i===void 0||r===void 0)&&Yi(t,this.length-8);let n=(i<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+r)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),si.read(this,t,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(t,i){return t=t>>>0,i||ee(t,4,this.length),si.read(this,t,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(t,i){return t=t>>>0,i||ee(t,8,this.length),si.read(this,t,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(t,i){return t=t>>>0,i||ee(t,8,this.length),si.read(this,t,!1,52,8)},"readDoubleBE");function pe(e,t,i,r,n,o){if(!y.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}s(pe,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(t,i,r,n){if(t=+t,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;pe(this,t,i,r,c,0)}let o=1,a=0;for(this[i]=t&255;++a<r&&(o*=256);)this[i+a]=t/o&255;return i+r},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(t,i,r,n){if(t=+t,i=i>>>0,r=r>>>0,!n){let c=Math.pow(2,8*r)-1;pe(this,t,i,r,c,0)}let o=r-1,a=1;for(this[i+o]=t&255;--o>=0&&(a*=256);)this[i+o]=t/a&255;return i+r},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,1,255,0),this[i]=t&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,2,65535,0),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,2,65535,0),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(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");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(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 Ea(e,t,i,r,n){Fa(t,r,n,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(Ea,"wrtBigUInt64LE");function _a(e,t,i,r,n){Fa(t,r,n,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(_a,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=bt(s(function(t,i=0){return Ea(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=bt(s(function(t,i=0){return _a(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(t,i,r,n){if(t=+t,i=i>>>0,!n){let l=Math.pow(2,8*r-1);pe(this,t,i,r,l-1,-l)}let o=0,a=1,c=0;for(this[i]=t&255;++o<r&&(a*=256);)t<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+r},"writeIntLE");y.prototype.writeIntBE=s(function(t,i,r,n){if(t=+t,i=i>>>0,!n){let l=Math.pow(2,8*r-1);pe(this,t,i,r,l-1,-l)}let o=r-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+r},"writeIntBE");y.prototype.writeInt8=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,1,127,-128),t<0&&(t=255+t+1),this[i]=t&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,2,32767,-32768),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(this,t,i,2,32767,-32768),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(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");y.prototype.writeInt32BE=s(function(t,i,r){return t=+t,i=i>>>0,r||pe(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");y.prototype.writeBigInt64LE=bt(s(function(t,i=0){return Ea(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=bt(s(function(t,i=0){return _a(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function xa(e,t,i,r,n,o){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(xa,"checkIEEE754");function ka(e,t,i,r,n){return t=+t,i=i>>>0,n||xa(e,t,i,4,34028234663852886e22,-34028234663852886e22),si.write(e,t,i,r,23,4),i+4}s(ka,"writeFloat");y.prototype.writeFloatLE=s(function(t,i,r){return ka(this,t,i,!0,r)},"writeFloatLE");y.prototype.writeFloatBE=s(function(t,i,r){return ka(this,t,i,!1,r)},"writeFloatBE");function va(e,t,i,r,n){return t=+t,i=i>>>0,n||xa(e,t,i,8,17976931348623157e292,-17976931348623157e292),si.write(e,t,i,r,52,8),i+8}s(va,"writeDouble");y.prototype.writeDoubleLE=s(function(t,i,r){return va(this,t,i,!0,r)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(t,i,r){return va(this,t,i,!1,r)},"writeDoubleBE");y.prototype.copy=s(function(t,i,r,n){if(!y.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=t.length&&(i=t.length),i||(i=0),n>0&&n<r&&(n=r),n===r||t.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-i<n-r&&(n=t.length-i+r);let o=n-r;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),i),o},"copy");y.prototype.fill=s(function(t,i,r,n){if(typeof t=="string"){if(typeof i=="string"?(n=i,i=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(t.length===1){let a=t.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(i<0||this.length<i||this.length<r)throw new RangeError("Out of range index");if(r<=i)return this;i=i>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);let o;if(typeof t=="number")for(o=i;o<r;++o)this[o]=t;else{let a=y.isBuffer(t)?t:y.from(t,n),c=a.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%c]}return this},"fill");var oi={};function ro(e,t,i){oi[e]=class extends i{static{s(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}s(ro,"E");ro("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);ro("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);ro("ERR_OUT_OF_RANGE",function(e,t,i){let r=`The value of "${e}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=ya(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=ya(n)),n+="n"),r+=` It must be ${t}. Received ${n}`,r},RangeError);function ya(e){let t="",i=e.length,r=e[0]==="-"?1:0;for(;i>=r+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(ya,"addNumericalSeparator");function vp(e,t,i){ai(t,"offset"),(e[t]===void 0||e[t+i]===void 0)&&Yi(t,e.length-(i+1))}s(vp,"checkBounds");function Fa(e,t,i,r,n,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 oi.ERR_OUT_OF_RANGE("value",c,e)}vp(r,n,o)}s(Fa,"checkIntBI");function ai(e,t){if(typeof e!="number")throw new oi.ERR_INVALID_ARG_TYPE(t,"number",e)}s(ai,"validateNumber");function Yi(e,t,i){throw Math.floor(e)!==e?(ai(e,i),new oi.ERR_OUT_OF_RANGE(i||"offset","an integer",e)):t<0?new oi.ERR_BUFFER_OUT_OF_BOUNDS:new oi.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}s(Yi,"boundsError");var Fp=/[^+/0-9A-Za-z-_]/g;function Ip(e){if(e=e.split("=")[0],e=e.trim().replace(Fp,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}s(Ip,"base64clean");function eo(e,t){t=t||1/0;let i,r=e.length,n=null,o=[];for(let a=0;a<r;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=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(eo,"utf8ToBytes");function Pp(e){let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i)&255);return t}s(Pp,"asciiToBytes");function Ap(e,t){let i,r,n,o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}s(Ap,"utf16leToBytes");function Ia(e){return Jn.toByteArray(Ip(e))}s(Ia,"base64ToBytes");function Or(e,t,i,r){let n;for(n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}s(Or,"blitBuffer");function ze(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}s(ze,"isInstance");function no(e){return e!==e}s(no,"numberIsNaN");var Tp=function(){let e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){let r=i*16;for(let n=0;n<16;++n)t[r+n]=e[i]+e[n]}return t}();function bt(e){return typeof BigInt>"u"?Op:e}s(bt,"defineBigIntMethod");function Op(){throw new Error("BigInt not supported")}s(Op,"BufferBigIntNotDefined")});var j=C((nE,Za)=>{"use strict";Za.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 ui=C((sE,Wr)=>{"use strict";var{AbortController:ec,AbortSignal:Rp}=typeof self<"u"?self:typeof window<"u"?window:void 0;Wr.exports=ec;Wr.exports.AbortSignal=Rp;Wr.exports.default=ec});var ir=C((aE,po)=>{"use strict";var di=typeof Reflect=="object"?Reflect:null,tc=di&&typeof di.apply=="function"?di.apply:s(function(t,i,r){return Function.prototype.apply.call(t,i,r)},"ReflectApply"),Ur;di&&typeof di.ownKeys=="function"?Ur=di.ownKeys:Object.getOwnPropertySymbols?Ur=s(function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))},"ReflectOwnKeys"):Ur=s(function(t){return Object.getOwnPropertyNames(t)},"ReflectOwnKeys");function Np(e){console&&console.warn&&console.warn(e)}s(Np,"ProcessEmitWarning");var rc=Number.isNaN||s(function(t){return t!==t},"NumberIsNaN");function L(){L.init.call(this)}s(L,"EventEmitter");po.exports=L;po.exports.once=Mp;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount=0;L.prototype._maxListeners=void 0;var ic=10;function jr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}s(jr,"checkListener");Object.defineProperty(L,"defaultMaxListeners",{enumerable:!0,get:s(function(){return ic},"get"),set:s(function(e){if(typeof e!="number"||e<0||rc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ic=e},"set")});L.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};L.prototype.setMaxListeners=s(function(t){if(typeof t!="number"||t<0||rc(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 nc(e){return e._maxListeners===void 0?L.defaultMaxListeners:e._maxListeners}s(nc,"_getMaxListeners");L.prototype.getMaxListeners=s(function(){return nc(this)},"getMaxListeners");L.prototype.emit=s(function(t){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=t==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){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")tc(l,this,i);else for(var f=l.length,u=lc(l,f),r=0;r<f;++r)tc(u[r],this,i);return!0},"emit");function oc(e,t,i,r){var n,o,a;if(jr(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]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=nc(e),n>0&&a.length>n&&!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,Np(c)}return e}s(oc,"_addListener");L.prototype.addListener=s(function(t,i){return oc(this,t,i,!1)},"addListener");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=s(function(t,i){return oc(this,t,i,!0)},"prependListener");function Lp(){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(Lp,"onceWrapper");function sc(e,t,i){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},n=Lp.bind(r);return n.listener=i,r.wrapFn=n,n}s(sc,"_onceWrap");L.prototype.once=s(function(t,i){return jr(i),this.on(t,sc(this,t,i)),this},"once");L.prototype.prependOnceListener=s(function(t,i){return jr(i),this.prependListener(t,sc(this,t,i)),this},"prependOnceListener");L.prototype.removeListener=s(function(t,i){var r,n,o,a,c;if(jr(i),n=this._events,n===void 0)return this;if(r=n[t],r===void 0)return this;if(r===i||r.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||i));else if(typeof r!="function"){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){c=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():Bp(r,o),r.length===1&&(n[t]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",t,c||i)}return this},"removeListener");L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners=s(function(t){var i,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var o=Object.keys(r),a;for(n=0;n<o.length;++n)a=o[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=r[t],typeof i=="function")this.removeListener(t,i);else if(i!==void 0)for(n=i.length-1;n>=0;n--)this.removeListener(t,i[n]);return this},"removeAllListeners");function ac(e,t,i){var r=e._events;if(r===void 0)return[];var n=r[t];return n===void 0?[]:typeof n=="function"?i?[n.listener||n]:[n]:i?Dp(n):lc(n,n.length)}s(ac,"_listeners");L.prototype.listeners=s(function(t){return ac(this,t,!0)},"listeners");L.prototype.rawListeners=s(function(t){return ac(this,t,!1)},"rawListeners");L.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):cc.call(e,t)};L.prototype.listenerCount=cc;function cc(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(cc,"listenerCount");L.prototype.eventNames=s(function(){return this._eventsCount>0?Ur(this._events):[]},"eventNames");function lc(e,t){for(var i=new Array(t),r=0;r<t;++r)i[r]=e[r];return i}s(lc,"arrayClone");function Bp(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}s(Bp,"spliceOne");function Dp(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}s(Dp,"unwrapListeners");function Mp(e,t){return new Promise(function(i,r){function n(a){e.removeListener(t,o),r(a)}s(n,"errorListener");function o(){typeof e.removeListener=="function"&&e.removeListener("error",n),i([].slice.call(arguments))}s(o,"resolver"),fc(e,t,o,{once:!0}),t!=="error"&&Wp(e,n,{once:!0})})}s(Mp,"once");function Wp(e,t,i){typeof e.on=="function"&&fc(e,"error",t,i)}s(Wp,"addErrorHandlerIfEventEmitter");function fc(e,t,i,r){if(typeof e.on=="function")r.once?e.once(t,i):e.on(t,i);else if(typeof e.addEventListener=="function")e.addEventListener(t,s(function n(o){r.once&&e.removeEventListener(t,n),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}s(fc,"eventTargetAgnosticAddListener")});var ie=C((lE,yo)=>{"use strict";var Up=ve(),{kResistStopPropagation:jp,SymbolDispose:qp}=j(),$p=globalThis.AbortSignal||ui().AbortSignal,zp=globalThis.AbortController||ui().AbortController,Vp=Object.getPrototypeOf(async function(){}).constructor,uc=globalThis.Blob||Up.Blob,Hp=s(typeof uc<"u"?function(t){return t instanceof uc}:function(t){return!1},"isBlob"),dc=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"),Gp=s((e,t)=>{if(typeof e!="function")throw new ERR_INVALID_ARG_TYPE(t,"Function",e)},"validateFunction"),ho=class extends Error{static{s(this,"AggregateError")}constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let i="";for(let r=0;r<t.length;r++)i+=` ${t[r].stack}
|
|
2
|
+
`;super(i),this.name="AggregateError",this.errors=t}};yo.exports={AggregateError:ho,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((r,n)=>{e=r,t=n}),resolve:e,reject:t}},"createDeferredPromise"),promisify:s(function(e){return new Promise((t,i)=>{e((r,...n)=>r?i(r):t(...n))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(e,...t){return e.replace(/%([sdifj])/g,function(...[i,r]){let n=t.shift();return r==="f"?n.toFixed(6):r==="j"?JSON.stringify(n):r==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.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 Vp},"isAsyncFunction"),isArrayBufferView:s(function(e){return ArrayBuffer.isView(e)},"isArrayBufferView")},isBlob:Hp,deprecate:s(function(e,t){return e},"deprecate"),addAbortListener:ir().addAbortListener||s(function(t,i){if(t===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);dc(t,"signal"),Gp(i,"listener");let r;return t.aborted?queueMicrotask(()=>i()):(t.addEventListener("abort",i,{__proto__:null,once:!0,[jp]:!0}),r=s(()=>{t.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[qp](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:$p.any||s(function(t){if(t.length===1)return t[0];let i=new zp,r=s(()=>i.abort(),"abort");return t.forEach(n=>{dc(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{t.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};yo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var se=C((uE,yc)=>{"use strict";var{format:Kp,inspect:qr,AggregateError:Yp}=ie(),Xp=globalThis.AggregateError||Yp,Jp=Symbol("kIsNodeError"),Qp=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Zp=/^([A-Z][a-z0-9]*)+$/,eh="__node_internal_",$r={};function Wt(e,t){if(!e)throw new $r.ERR_INTERNAL_ASSERTION(t)}s(Wt,"assert");function pc(e){let t="",i=e.length,r=e[0]==="-"?1:0;for(;i>=r+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(pc,"addNumericalSeparator");function th(e,t,i){if(typeof t=="function")return Wt(t.length<=i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${t.length}).`),t(...i);let r=(t.match(/%[dfijoOs]/g)||[]).length;return Wt(r===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?t:Kp(t,...i)}s(th,"getMessage");function te(e,t,i){i||(i=Error);class r extends i{static{s(this,"NodeError")}constructor(...o){super(th(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(r.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}}),r.prototype.code=e,r.prototype[Jp]=!0,$r[e]=r}s(te,"E");function hc(e){let t=eh+e.name;return Object.defineProperty(e,"name",{value:t}),e}s(hc,"hideStackFrames");function ih(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let i=new Xp([t,e],t.message);return i.code=t.code,i}return e||t}s(ih,"aggregateTwoErrors");var mo=class extends Error{static{s(this,"AbortError")}constructor(t="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new $r.ERR_INVALID_ARG_TYPE("options","Object",i);super(t,i),this.code="ABORT_ERR",this.name="AbortError"}};te("ERR_ASSERTION","%s",Error);te("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Wt(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let r="The ";e.endsWith(" argument")?r+=`${e} `:r+=`"${e}" ${e.includes(".")?"property":"argument"} `,r+="must be ";let n=[],o=[],a=[];for(let l of t)Wt(typeof l=="string","All expected entries have to be of type string"),Qp.includes(l)?n.push(l.toLowerCase()):Zp.test(l)?o.push(l):(Wt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();r+=`one of type ${n.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();r+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();r+=`one of ${a.join(", ")}, or ${l}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${i.constructor.name}`;else{let l=qr(i,{depth:-1});r+=`. Received ${l}`}}else{let l=qr(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),r+=`. Received type ${typeof i} (${l})`}return r},TypeError);te("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let r=qr(t);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${r}`},TypeError);te("ERR_INVALID_RETURN_VALUE",(e,t,i)=>{var r;let n=i!=null&&(r=i.constructor)!==null&&r!==void 0&&r.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${e} to be returned from the "${t}" function but got ${n}.`},TypeError);te("ERR_MISSING_ARGS",(...e)=>{Wt(e.length>0,"At least one arg needs to be specified");let t,i=e.length;switch(e=(Array.isArray(e)?e:[e]).map(r=>`"${r}"`).join(" or "),i){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}break}return`${t} must be specified`},TypeError);te("ERR_OUT_OF_RANGE",(e,t,i)=>{Wt(t,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=pc(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=pc(r)),r+="n"):r=qr(i),`The value of "${e}" is out of range. It must be ${t}. Received ${r}`},RangeError);te("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);te("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);te("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);te("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);te("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);te("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);te("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);te("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);te("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);te("ERR_STREAM_WRITE_AFTER_END","write after end",Error);te("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);yc.exports={AbortError:mo,aggregateTwoErrors:hc(ih),hideStackFrames:hc,codes:$r}});var hi=C((pE,vc)=>{"use strict";var{ArrayIsArray:go,ArrayPrototypeIncludes:wc,ArrayPrototypeJoin:Sc,ArrayPrototypeMap:rh,NumberIsInteger:wo,NumberIsNaN:nh,NumberMAX_SAFE_INTEGER:oh,NumberMIN_SAFE_INTEGER:sh,NumberParseInt:ah,ObjectPrototypeHasOwnProperty:ch,RegExpPrototypeExec:Ec,String:lh,StringPrototypeToUpperCase:fh,StringPrototypeTrim:uh}=j(),{hideStackFrames:Ie,codes:{ERR_SOCKET_BAD_PORT:dh,ERR_INVALID_ARG_TYPE:re,ERR_INVALID_ARG_VALUE:pi,ERR_OUT_OF_RANGE:Ut,ERR_UNKNOWN_SIGNAL:mc}}=se(),{normalizeEncoding:ph}=ie(),{isAsyncFunction:hh,isArrayBufferView:yh}=ie().types,bc={};function mh(e){return e===(e|0)}s(mh,"isInt32");function bh(e){return e===e>>>0}s(bh,"isUint32");var gh=/^[0-7]+$/,wh="must be a 32-bit unsigned integer or an octal string";function Sh(e,t,i){if(typeof e>"u"&&(e=i),typeof e=="string"){if(Ec(gh,e)===null)throw new pi(t,e,wh);e=ah(e,8)}return _c(e,t),e}s(Sh,"parseFileMode");var Eh=Ie((e,t,i=sh,r=oh)=>{if(typeof e!="number")throw new re(t,"number",e);if(!wo(e))throw new Ut(t,"an integer",e);if(e<i||e>r)throw new Ut(t,`>= ${i} && <= ${r}`,e)}),_h=Ie((e,t,i=-2147483648,r=2147483647)=>{if(typeof e!="number")throw new re(t,"number",e);if(!wo(e))throw new Ut(t,"an integer",e);if(e<i||e>r)throw new Ut(t,`>= ${i} && <= ${r}`,e)}),_c=Ie((e,t,i=!1)=>{if(typeof e!="number")throw new re(t,"number",e);if(!wo(e))throw new Ut(t,"an integer",e);let r=i?1:0,n=4294967295;if(e<r||e>n)throw new Ut(t,`>= ${r} && <= ${n}`,e)});function So(e,t){if(typeof e!="string")throw new re(t,"string",e)}s(So,"validateString");function xh(e,t,i=void 0,r){if(typeof e!="number")throw new re(t,"number",e);if(i!=null&&e<i||r!=null&&e>r||(i!=null||r!=null)&&nh(e))throw new Ut(t,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,e)}s(xh,"validateNumber");var kh=Ie((e,t,i)=>{if(!wc(i,e)){let n="must be one of: "+Sc(rh(i,o=>typeof o=="string"?`'${o}'`:lh(o)),", ");throw new pi(t,e,n)}});function xc(e,t){if(typeof e!="boolean")throw new re(t,"boolean",e)}s(xc,"validateBoolean");function bo(e,t,i){return e==null||!ch(e,t)?i:e[t]}s(bo,"getOwnPropertyValueOrDefault");var vh=Ie((e,t,i=null)=>{let r=bo(i,"allowArray",!1),n=bo(i,"allowFunction",!1);if(!bo(i,"nullable",!1)&&e===null||!r&&go(e)||typeof e!="object"&&(!n||typeof e!="function"))throw new re(t,"Object",e)}),Fh=Ie((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new re(t,"a dictionary",e)}),zr=Ie((e,t,i=0)=>{if(!go(e))throw new re(t,"Array",e);if(e.length<i){let r=`must be longer than ${i}`;throw new pi(t,e,r)}});function Ih(e,t){zr(e,t);for(let i=0;i<e.length;i++)So(e[i],`${t}[${i}]`)}s(Ih,"validateStringArray");function Ph(e,t){zr(e,t);for(let i=0;i<e.length;i++)xc(e[i],`${t}[${i}]`)}s(Ph,"validateBooleanArray");function Ah(e,t){zr(e,t);for(let i=0;i<e.length;i++){let r=e[i],n=`${t}[${i}]`;if(r==null)throw new re(n,"AbortSignal",r);kc(r,n)}}s(Ah,"validateAbortSignalArray");function Th(e,t="signal"){if(So(e,t),bc[e]===void 0)throw bc[fh(e)]!==void 0?new mc(e+" (signals must use all capital letters)"):new mc(e)}s(Th,"validateSignalName");var Oh=Ie((e,t="buffer")=>{if(!yh(e))throw new re(t,["Buffer","TypedArray","DataView"],e)});function Ch(e,t){let i=ph(t),r=e.length;if(i==="hex"&&r%2!==0)throw new pi("encoding",t,`is invalid for data of length ${r}`)}s(Ch,"validateEncoding");function Rh(e,t="Port",i=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&uh(e).length===0||+e!==+e>>>0||e>65535||e===0&&!i)throw new dh(t,e,i);return e|0}s(Rh,"validatePort");var kc=Ie((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new re(t,"AbortSignal",e)}),Nh=Ie((e,t)=>{if(typeof e!="function")throw new re(t,"Function",e)}),Lh=Ie((e,t)=>{if(typeof e!="function"||hh(e))throw new re(t,"Function",e)}),Bh=Ie((e,t)=>{if(e!==void 0)throw new re(t,"undefined",e)});function Dh(e,t,i){if(!wc(i,e))throw new re(t,`('${Sc(i,"|")}')`,e)}s(Dh,"validateUnion");var Mh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function gc(e,t){if(typeof e>"u"||!Ec(Mh,e))throw new pi(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(gc,"validateLinkHeaderFormat");function Wh(e){if(typeof e=="string")return gc(e,"hints"),e;if(go(e)){let t=e.length,i="";if(t===0)return i;for(let r=0;r<t;r++){let n=e[r];gc(n,"hints"),i+=n,r!==t-1&&(i+=", ")}return i}throw new pi("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Wh,"validateLinkHeaderValue");vc.exports={isInt32:mh,isUint32:bh,parseFileMode:Sh,validateArray:zr,validateStringArray:Ih,validateBooleanArray:Ph,validateAbortSignalArray:Ah,validateBoolean:xc,validateBuffer:Oh,validateDictionary:Fh,validateEncoding:Ch,validateFunction:Nh,validateInt32:_h,validateInteger:Eh,validateNumber:xh,validateObject:vh,validateOneOf:kh,validatePlainFunction:Lh,validatePort:Rh,validateSignalName:Th,validateString:So,validateUint32:_c,validateUndefined:Bh,validateUnion:Dh,validateAbortSignal:kc,validateLinkHeaderValue:Wh}});var _t=C((yE,Ac)=>{var V=Ac.exports={},Ge,Ke;function Eo(){throw new Error("setTimeout has not been defined")}s(Eo,"defaultSetTimout");function _o(){throw new Error("clearTimeout has not been defined")}s(_o,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ge=setTimeout:Ge=Eo}catch{Ge=Eo}try{typeof clearTimeout=="function"?Ke=clearTimeout:Ke=_o}catch{Ke=_o}})();function Fc(e){if(Ge===setTimeout)return setTimeout(e,0);if((Ge===Eo||!Ge)&&setTimeout)return Ge=setTimeout,setTimeout(e,0);try{return Ge(e,0)}catch{try{return Ge.call(null,e,0)}catch{return Ge.call(this,e,0)}}}s(Fc,"runTimeout");function Uh(e){if(Ke===clearTimeout)return clearTimeout(e);if((Ke===_o||!Ke)&&clearTimeout)return Ke=clearTimeout,clearTimeout(e);try{return Ke(e)}catch{try{return Ke.call(null,e)}catch{return Ke.call(this,e)}}}s(Uh,"runClearTimeout");var ct=[],yi=!1,jt,Vr=-1;function jh(){!yi||!jt||(yi=!1,jt.length?ct=jt.concat(ct):Vr=-1,ct.length&&Ic())}s(jh,"cleanUpNextTick");function Ic(){if(!yi){var e=Fc(jh);yi=!0;for(var t=ct.length;t;){for(jt=ct,ct=[];++Vr<t;)jt&&jt[Vr].run();Vr=-1,t=ct.length}jt=null,yi=!1,Uh(e)}}s(Ic,"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];ct.push(new Pc(e,t)),ct.length===1&&!yi&&Fc(Ic)};function Pc(e,t){this.fun=e,this.array=t}s(Pc,"Item");Pc.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function lt(){}s(lt,"noop");V.on=lt;V.addListener=lt;V.once=lt;V.off=lt;V.removeListener=lt;V.removeAllListeners=lt;V.emit=lt;V.prependListener=lt;V.prependOnceListener=lt;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 Xe=C((bE,zc)=>{"use strict";var{SymbolAsyncIterator:Tc,SymbolIterator:Oc,SymbolFor:qt}=j(),Cc=qt("nodejs.stream.destroyed"),Rc=qt("nodejs.stream.errored"),xo=qt("nodejs.stream.readable"),ko=qt("nodejs.stream.writable"),Nc=qt("nodejs.stream.disturbed"),qh=qt("nodejs.webstream.isClosedPromise"),$h=qt("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 Gr(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(Gr,"isWritableNodeStream");function zh(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}s(zh,"isDuplexNodeStream");function Ye(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}s(Ye,"isNodeStream");function Lc(e){return!!(e&&!Ye(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}s(Lc,"isReadableStream");function Bc(e){return!!(e&&!Ye(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}s(Bc,"isWritableStream");function Dc(e){return!!(e&&!Ye(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}s(Dc,"isTransformStream");function Vh(e){return Lc(e)||Bc(e)||Dc(e)}s(Vh,"isWebStream");function Hh(e,t){return e==null?!1:t===!0?typeof e[Tc]=="function":t===!1?typeof e[Oc]=="function":typeof e[Tc]=="function"||typeof e[Oc]=="function"}s(Hh,"isIterable");function Kr(e){if(!Ye(e))return null;let t=e._writableState,i=e._readableState,r=t||i;return!!(e.destroyed||e[Cc]||r!=null&&r.destroyed)}s(Kr,"isDestroyed");function Mc(e){if(!Gr(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(Mc,"isWritableEnded");function Gh(e,t){if(!Gr(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(Gh,"isWritableFinished");function Kh(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(Kh,"isReadableEnded");function Wc(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(Wc,"isReadableFinished");function Uc(e){return e&&e[xo]!=null?e[xo]:typeof e?.readable!="boolean"?null:Kr(e)?!1:Hr(e)&&e.readable&&!Wc(e)}s(Uc,"isReadable");function jc(e){return e&&e[ko]!=null?e[ko]:typeof e?.writable!="boolean"?null:Kr(e)?!1:Gr(e)&&e.writable&&!Mc(e)}s(jc,"isWritable");function Yh(e,t){return Ye(e)?Kr(e)?!0:!(t?.readable!==!1&&Uc(e)||t?.writable!==!1&&jc(e)):null}s(Yh,"isFinished");function Xh(e){var t,i;return Ye(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(Xh,"isWritableErrored");function Jh(e){var t,i;return Ye(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(Jh,"isReadableErrored");function Qh(e){if(!Ye(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"&&qc(e)?e._closed:null}s(Qh,"isClosed");function qc(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}s(qc,"isOutgoingMessage");function $c(e){return typeof e._sent100=="boolean"&&qc(e)}s($c,"isServerResponse");function Zh(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(Zh,"isServerRequest");function ey(e){if(!Ye(e))return null;let t=e._writableState,i=e._readableState,r=t||i;return!r&&$c(e)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(ey,"willEmitClose");function ty(e){var t;return!!(e&&((t=e[Nc])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}s(ty,"isDisturbed");function iy(e){var t,i,r,n,o,a,c,l,f,u;return!!(e&&((t=(i=(r=(n=(o=(a=e[Rc])!==null&&a!==void 0?a:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&n!==void 0?n:(c=e._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(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:!((u=e._writableState)===null||u===void 0)&&u.errored))}s(iy,"isErrored");zc.exports={isDestroyed:Kr,kIsDestroyed:Cc,isDisturbed:ty,kIsDisturbed:Nc,isErrored:iy,kIsErrored:Rc,isReadable:Uc,kIsReadable:xo,kIsClosedPromise:qh,kControllerErrorFunction:$h,kIsWritable:ko,isClosed:Qh,isDuplexNodeStream:zh,isFinished:Yh,isIterable:Hh,isReadableNodeStream:Hr,isReadableStream:Lc,isReadableEnded:Kh,isReadableFinished:Wc,isReadableErrored:Jh,isNodeStream:Ye,isWebStream:Vh,isWritable:jc,isWritableNodeStream:Gr,isWritableStream:Bc,isWritableEnded:Mc,isWritableFinished:Gh,isWritableErrored:Xh,isServerRequest:Zh,isServerResponse:$c,willEmitClose:ey,isTransformStream:Dc}});var ft=C((wE,Ao)=>{var xt=_t(),{AbortError:Zc,codes:ry}=se(),{ERR_INVALID_ARG_TYPE:ny,ERR_STREAM_PREMATURE_CLOSE:Vc}=ry,{kEmptyObject:Fo,once:Io}=ie(),{validateAbortSignal:oy,validateFunction:sy,validateObject:ay,validateBoolean:cy}=hi(),{Promise:ly,PromisePrototypeThen:fy,SymbolDispose:el}=j(),{isClosed:uy,isReadable:Hc,isReadableNodeStream:vo,isReadableStream:dy,isReadableFinished:Gc,isReadableErrored:Kc,isWritable:Yc,isWritableNodeStream:Xc,isWritableStream:py,isWritableFinished:Jc,isWritableErrored:Qc,isNodeStream:hy,willEmitClose:yy,kIsClosedPromise:my}=Xe(),mi;function by(e){return e.setHeader&&typeof e.abort=="function"}s(by,"isRequest");var Po=s(()=>{},"nop");function tl(e,t,i){var r,n;if(arguments.length===2?(i=t,t=Fo):t==null?t=Fo:ay(t,"options"),sy(i,"callback"),oy(t.signal,"options.signal"),i=Io(i),dy(e)||py(e))return gy(e,t,i);if(!hy(e))throw new ny("stream",["ReadableStream","WritableStream","Stream"],e);let o=(r=t.readable)!==null&&r!==void 0?r:vo(e),a=(n=t.writable)!==null&&n!==void 0?n:Xc(e),c=e._writableState,l=e._readableState,f=s(()=>{e.writable||b()},"onlegacyfinish"),u=yy(e)&&vo(e)===o&&Xc(e)===a,p=Jc(e,!1),b=s(()=>{p=!0,e.destroyed&&(u=!1),!(u&&(!e.readable||o))&&(!o||m)&&i.call(e)},"onfinish"),m=Gc(e,!1),w=s(()=>{m=!0,e.destroyed&&(u=!1),!(u&&(!e.writable||a))&&(!a||p)&&i.call(e)},"onend"),g=s(G=>{i.call(e,G)},"onerror"),x=uy(e),_=s(()=>{x=!0;let G=Qc(e)||Kc(e);if(G&&typeof G!="boolean")return i.call(e,G);if(o&&!m&&vo(e,!0)&&!Gc(e,!1))return i.call(e,new Vc);if(a&&!p&&!Jc(e,!1))return i.call(e,new Vc);i.call(e)},"onclose"),O=s(()=>{x=!0;let G=Qc(e)||Kc(e);if(G&&typeof G!="boolean")return i.call(e,G);i.call(e)},"onclosed"),R=s(()=>{e.req.on("finish",b)},"onrequest");by(e)?(e.on("complete",b),u||e.on("abort",_),e.req?R():e.on("request",R)):a&&!c&&(e.on("end",f),e.on("close",f)),!u&&typeof e.aborted=="boolean"&&e.on("aborted",_),e.on("end",w),e.on("finish",b),t.error!==!1&&e.on("error",g),e.on("close",_),x?xt.nextTick(_):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?u||xt.nextTick(O):(!o&&(!u||Hc(e))&&(p||Yc(e)===!1)||!a&&(!u||Yc(e))&&(m||Hc(e)===!1)||l&&e.req&&e.aborted)&&xt.nextTick(O);let P=s(()=>{i=Po,e.removeListener("aborted",_),e.removeListener("complete",b),e.removeListener("abort",_),e.removeListener("request",R),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",_)},"cleanup");if(t.signal&&!x){let G=s(()=>{let Pt=i;P(),Pt.call(e,new Zc(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)xt.nextTick(G);else{mi=mi||ie().addAbortListener;let Pt=mi(t.signal,G),ge=i;i=Io((...Qt)=>{Pt[el](),ge.apply(e,Qt)})}}return P}s(tl,"eos");function gy(e,t,i){let r=!1,n=Po;if(t.signal)if(n=s(()=>{r=!0,i.call(e,new Zc(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)xt.nextTick(n);else{mi=mi||ie().addAbortListener;let a=mi(t.signal,n),c=i;i=Io((...l)=>{a[el](),c.apply(e,l)})}let o=s((...a)=>{r||xt.nextTick(()=>i.apply(e,a))},"resolverFn");return fy(e[my].promise,o,o),Po}s(gy,"eosWeb");function wy(e,t){var i;let r=!1;return t===null&&(t=Fo),(i=t)!==null&&i!==void 0&&i.cleanup&&(cy(t.cleanup,"cleanup"),r=t.cleanup),new ly((n,o)=>{let a=tl(e,t,c=>{r&&a(),c?o(c):n()})})}s(wy,"finished");Ao.exports=tl;Ao.exports.finished=wy});var $t=C((EE,ll)=>{"use strict";var Je=_t(),{aggregateTwoErrors:Sy,codes:{ERR_MULTIPLE_CALLBACK:Ey},AbortError:_y}=se(),{Symbol:nl}=j(),{kIsDestroyed:xy,isDestroyed:ky,isFinished:vy,isServerRequest:Fy}=Xe(),ol=nl("kDestroy"),To=nl("kConstruct");function sl(e,t,i){e&&(e.stack,t&&!t.errored&&(t.errored=e),i&&!i.errored&&(i.errored=e))}s(sl,"checkError");function Iy(e,t){let i=this._readableState,r=this._writableState,n=r||i;return r!=null&&r.destroyed||i!=null&&i.destroyed?(typeof t=="function"&&t(),this):(sl(e,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?il(this,e,t):this.once(ol,function(o){il(this,Sy(o,e),t)}),this)}s(Iy,"destroy");function il(e,t,i){let r=!1;function n(o){if(r)return;r=!0;let a=e._readableState,c=e._writableState;sl(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Je.nextTick(Py,e,o):Je.nextTick(al,e)}s(n,"onDestroy");try{e._destroy(t||null,n)}catch(o){n(o)}}s(il,"_destroy");function Py(e,t){Oo(e,t),al(e)}s(Py,"emitErrorCloseNT");function al(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(al,"emitCloseNT");function Oo(e,t){let i=e._readableState,r=e._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),e.emit("error",t))}s(Oo,"emitErrorNT");function Ay(){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(Ay,"undestroy");function Co(e,t,i){let r=e._readableState,n=e._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?e.destroy(t):t&&(t.stack,n&&!n.errored&&(n.errored=t),r&&!r.errored&&(r.errored=t),i?Je.nextTick(Oo,e,t):Oo(e,t))}s(Co,"errorOrDestroy");function Ty(e,t){if(typeof e._construct!="function")return;let i=e._readableState,r=e._writableState;i&&(i.constructed=!1),r&&(r.constructed=!1),e.once(To,t),!(e.listenerCount(To)>1)&&Je.nextTick(Oy,e)}s(Ty,"construct");function Oy(e){let t=!1;function i(r){if(t){Co(e,r??new Ey);return}t=!0;let n=e._readableState,o=e._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(ol,r):r?Co(e,r,!0):Je.nextTick(Cy,e)}s(i,"onConstruct");try{e._construct(r=>{Je.nextTick(i,r)})}catch(r){Je.nextTick(i,r)}}s(Oy,"constructNT");function Cy(e){e.emit(To)}s(Cy,"emitConstructNT");function rl(e){return e?.setHeader&&typeof e.abort=="function"}s(rl,"isRequest");function cl(e){e.emit("close")}s(cl,"emitCloseLegacy");function Ry(e,t){e.emit("error",t),Je.nextTick(cl,e)}s(Ry,"emitErrorCloseLegacy");function Ny(e,t){!e||ky(e)||(!t&&!vy(e)&&(t=new _y),Fy(e)?(e.socket=null,e.destroy(t)):rl(e)?e.abort():rl(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Je.nextTick(Ry,e,t):Je.nextTick(cl,e),e.destroyed||(e[xy]=!0))}s(Ny,"destroyer");ll.exports={construct:Ty,destroyer:Ny,destroy:Iy,undestroy:Ay,errorOrDestroy:Co}});var Jr=C((xE,ul)=>{"use strict";var{ArrayIsArray:Ly,ObjectSetPrototypeOf:fl}=j(),{EventEmitter:Yr}=ir();function Xr(e){Yr.call(this,e)}s(Xr,"Stream");fl(Xr.prototype,Yr.prototype);fl(Xr,Yr);Xr.prototype.pipe=function(e,t){let i=this;function r(u){e.writable&&e.write(u)===!1&&i.pause&&i.pause()}s(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}s(n,"ondrain"),e.on("drain",n),!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(u){f(),Yr.listenerCount(this,"error")===0&&this.emit("error",u)}s(l,"onerror"),Ro(i,"error",l),Ro(e,"error",l);function f(){i.removeListener("data",r),e.removeListener("drain",n),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 Ro(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):Ly(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}s(Ro,"prependListener");ul.exports={Stream:Xr,prependListener:Ro}});var rr=C((vE,Qr)=>{"use strict";var{SymbolDispose:By}=j(),{AbortError:dl,codes:Dy}=se(),{isNodeStream:pl,isWebStream:My,kControllerErrorFunction:Wy}=Xe(),Uy=ft(),{ERR_INVALID_ARG_TYPE:hl}=Dy,No,jy=s((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new hl(t,"AbortSignal",e)},"validateAbortSignal");Qr.exports.addAbortSignal=s(function(t,i){if(jy(t,"signal"),!pl(i)&&!My(i))throw new hl("stream",["ReadableStream","WritableStream","Stream"],i);return Qr.exports.addAbortSignalNoValidate(t,i)},"addAbortSignal");Qr.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let i=pl(t)?()=>{t.destroy(new dl(void 0,{cause:e.reason}))}:()=>{t[Wy](new dl(void 0,{cause:e.reason}))};if(e.aborted)i();else{No=No||ie().addAbortListener;let r=No(e,i);Uy(t,r[By])}return t}});var bl=C((PE,ml)=>{"use strict";var{StringPrototypeSlice:yl,SymbolIterator:qy,TypedArrayPrototypeSet:Zr,Uint8Array:$y}=j(),{Buffer:Lo}=ve(),{inspect:zy}=ie();ml.exports=class{static{s(this,"BufferList")}constructor(){this.head=null,this.tail=null,this.length=0}push(t){let i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(t){let i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=t+i.data;return r}concat(t){if(this.length===0)return Lo.alloc(0);let i=Lo.allocUnsafe(t>>>0),r=this.head,n=0;for(;r;)Zr(i,r.data,n),n+=r.data.length,r=r.next;return i}consume(t,i){let r=this.head.data;if(t<r.length){let n=r.slice(0,t);return this.head.data=r.slice(t),n}return t===r.length?this.shift():i?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[qy](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let i="",r=this.head,n=0;do{let o=r.data;if(t>o.length)i+=o,t-=o.length;else{t===o.length?(i+=o,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=yl(o,0,t),this.head=r,r.data=yl(o,t));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(t){let i=Lo.allocUnsafe(t),r=t,n=this.head,o=0;do{let a=n.data;if(t>a.length)Zr(i,a,r-t),t-=a.length;else{t===a.length?(Zr(i,a,r-t),++o,n.next?this.head=n.next:this.head=this.tail=null):(Zr(i,new $y(a.buffer,a.byteOffset,t),r-t),this.head=n,n.data=a.slice(t));break}++o}while((n=n.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](t,i){return zy(this,{...i,depth:0,customInspect:!1})}}});var nr=C((TE,El)=>{"use strict";var{MathFloor:Vy,NumberIsInteger:Hy}=j(),{validateInteger:Gy}=hi(),{ERR_INVALID_ARG_VALUE:Ky}=se().codes,gl=16*1024,wl=16;function Yy(e,t,i){return e.highWaterMark!=null?e.highWaterMark:t?e[i]:null}s(Yy,"highWaterMarkFrom");function Sl(e){return e?wl:gl}s(Sl,"getDefaultHighWaterMark");function Xy(e,t){Gy(t,"value",0),e?wl=t:gl=t}s(Xy,"setDefaultHighWaterMark");function Jy(e,t,i,r){let n=Yy(t,r,i);if(n!=null){if(!Hy(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new Ky(o,n)}return Vy(n)}return Sl(e.objectMode)}s(Jy,"getHighWaterMark");El.exports={getHighWaterMark:Jy,getDefaultHighWaterMark:Sl,setDefaultHighWaterMark:Xy}});var kl=C((Bo,xl)=>{var en=ve(),Qe=en.Buffer;function _l(e,t){for(var i in e)t[i]=e[i]}s(_l,"copyProps");Qe.from&&Qe.alloc&&Qe.allocUnsafe&&Qe.allocUnsafeSlow?xl.exports=en:(_l(en,Bo),Bo.Buffer=zt);function zt(e,t,i){return Qe(e,t,i)}s(zt,"SafeBuffer");zt.prototype=Object.create(Qe.prototype);_l(Qe,zt);zt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Qe(e,t,i)};zt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var r=Qe(e);return t!==void 0?typeof i=="string"?r.fill(t,i):r.fill(t):r.fill(0),r};zt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Qe(e)};zt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return en.SlowBuffer(e)}});var Il=C(Fl=>{"use strict";var Mo=kl().Buffer,vl=Mo.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 Qy(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(Qy,"_normalizeEncoding");function Zy(e){var t=Qy(e);if(typeof t!="string"&&(Mo.isEncoding===vl||!vl(e)))throw new Error("Unknown encoding: "+e);return t||e}s(Zy,"normalizeEncoding");Fl.StringDecoder=or;function or(e){this.encoding=Zy(e);var t;switch(this.encoding){case"utf16le":this.text=om,this.end=sm,t=4;break;case"utf8":this.fillLast=im,t=4;break;case"base64":this.text=am,this.end=cm,t=3;break;default:this.write=lm,this.end=fm;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Mo.allocUnsafe(t)}s(or,"StringDecoder");or.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||""};or.prototype.end=nm;or.prototype.text=rm;or.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 Do(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}s(Do,"utf8CheckByte");function em(e,t,i){var r=t.length-1;if(r<i)return 0;var n=Do(t[r]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--r<i||n===-2?0:(n=Do(t[r]),n>=0?(n>0&&(e.lastNeed=n-2),n):--r<i||n===-2?0:(n=Do(t[r]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}s(em,"utf8CheckIncomplete");function tm(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(tm,"utf8CheckExtraBytes");function im(e){var t=this.lastTotal-this.lastNeed,i=tm(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(im,"utf8FillLast");function rm(e,t){var i=em(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var r=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}s(rm,"utf8Text");function nm(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}s(nm,"utf8End");function om(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=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(om,"utf16Text");function sm(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(sm,"utf16End");function am(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(am,"base64Text");function cm(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}s(cm,"base64End");function lm(e){return e.toString(this.encoding)}s(lm,"simpleWrite");function fm(e){return e&&e.length?this.write(e):""}s(fm,"simpleEnd")});var Wo=C((LE,Ol)=>{"use strict";var Pl=_t(),{PromisePrototypeThen:um,SymbolAsyncIterator:Al,SymbolIterator:Tl}=j(),{Buffer:dm}=ve(),{ERR_INVALID_ARG_TYPE:pm,ERR_STREAM_NULL_VALUES:hm}=se().codes;function ym(e,t,i){let r;if(typeof t=="string"||t instanceof dm)return new e({objectMode:!0,...i,read:s(function(){this.push(t),this.push(null)},"read")});let n;if(t&&t[Al])n=!0,r=t[Al]();else if(t&&t[Tl])n=!1,r=t[Tl]();else throw new pm("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,u){um(c(f),()=>Pl.nextTick(u,f),p=>Pl.nextTick(u,p||f))};async function c(f){let u=f!=null,p=typeof r.throw=="function";if(u&&p){let{value:b,done:m}=await r.throw(f);if(await b,m)return}if(typeof r.return=="function"){let{value:b}=await r.return();await b}}s(c,"close");async function l(){for(;;){try{let{value:f,done:u}=n?await r.next():r.next();if(u)o.push(null);else{let p=f&&typeof f.then=="function"?await f:f;if(p===null)throw a=!1,new hm;if(o.push(p))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(ym,"from");Ol.exports=ym});var ar=C((DE,Yl)=>{var Oe=_t(),{ArrayPrototypeIndexOf:mm,NumberIsInteger:bm,NumberIsNaN:gm,NumberParseInt:wm,ObjectDefineProperties:Go,ObjectKeys:Sm,ObjectSetPrototypeOf:Nl,Promise:Ll,SafeSet:Em,SymbolAsyncDispose:_m,SymbolAsyncIterator:xm,Symbol:km}=j();Yl.exports=I;I.ReadableState=on;var{EventEmitter:vm}=ir(),{Stream:kt,prependListener:Fm}=Jr(),{Buffer:Uo}=ve(),{addAbortSignal:Im}=rr(),Bl=ft(),T=ie().debuglog("stream",e=>{T=e}),Pm=bl(),wi=$t(),{getHighWaterMark:Am,getDefaultHighWaterMark:Tm}=nr(),{aggregateTwoErrors:Cl,codes:{ERR_INVALID_ARG_TYPE:Om,ERR_METHOD_NOT_IMPLEMENTED:Cm,ERR_OUT_OF_RANGE:Rm,ERR_STREAM_PUSH_AFTER_EOF:Nm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Lm},AbortError:Bm}=se(),{validateObject:Dm}=hi(),Vt=km("kPaused"),{StringDecoder:Dl}=Il(),Mm=Wo();Nl(I.prototype,kt.prototype);Nl(I,kt);var jo=s(()=>{},"nop"),{errorOrDestroy:bi}=wi,gi=1,Wm=2,Ml=4,sr=8,Wl=16,tn=32,rn=64,Ul=128,Um=256,jm=512,qm=1024,Vo=2048,Ho=4096,$m=8192,zm=16384,Vm=32768,jl=65536,Hm=1<<17,Gm=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");Go(on.prototype,{objectMode:J(gi),ended:J(Wm),endEmitted:J(Ml),reading:J(sr),constructed:J(Wl),sync:J(tn),needReadable:J(rn),emittedReadable:J(Ul),readableListening:J(Um),resumeScheduled:J(jm),errorEmitted:J(qm),emitClose:J(Vo),autoDestroy:J(Ho),destroyed:J($m),closed:J(zm),closeEmitted:J(Vm),multiAwaitDrain:J(jl),readingMore:J(Hm),dataEmitted:J(Gm)});function on(e,t,i){typeof i!="boolean"&&(i=t instanceof Ze()),this.state=Vo|Ho|Wl|tn,e&&e.objectMode&&(this.state|=gi),i&&e&&e.readableObjectMode&&(this.state|=gi),this.highWaterMark=e?Am(this,e,"readableHighWaterMark",i):Tm(!1),this.buffer=new Pm,this.length=0,this.pipes=[],this.flowing=null,this[Vt]=null,e&&e.emitClose===!1&&(this.state&=~Vo),e&&e.autoDestroy===!1&&(this.state&=~Ho),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new Dl(e.encoding),this.encoding=e.encoding)}s(on,"ReadableState");function I(e){if(!(this instanceof I))return new I(e);let t=this instanceof Ze();this._readableState=new on(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&&Im(e.signal,this)),kt.call(this,e),wi.construct(this,()=>{this._readableState.needReadable&&nn(this,this._readableState)})}s(I,"Readable");I.prototype.destroy=wi.destroy;I.prototype._undestroy=wi.undestroy;I.prototype._destroy=function(e,t){t(e)};I.prototype[vm.captureRejectionSymbol]=function(e){this.destroy(e)};I.prototype[_m]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new Bm,this.destroy(e)),new Ll((t,i)=>Bl(this,r=>r&&r!==e?i(r):t(null)))};I.prototype.push=function(e,t){return ql(this,e,t,!1)};I.prototype.unshift=function(e,t){return ql(this,e,t,!0)};function ql(e,t,i,r){T("readableAddChunk",t);let n=e._readableState,o;if(n.state&gi||(typeof t=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?t=Uo.from(t,i).toString(n.encoding):(t=Uo.from(t,i),i=""))):t instanceof Uo?i="":kt._isUint8Array(t)?(t=kt._uint8ArrayToBuffer(t),i=""):t!=null&&(o=new Om("chunk",["string","Buffer","Uint8Array"],t))),o)bi(e,o);else if(t===null)n.state&=~sr,Xm(e,n);else if(n.state&gi||t&&t.length>0)if(r)if(n.state&Ml)bi(e,new Lm);else{if(n.destroyed||n.errored)return!1;qo(e,n,t,!0)}else if(n.ended)bi(e,new Nm);else{if(n.destroyed||n.errored)return!1;n.state&=~sr,n.decoder&&!i?(t=n.decoder.write(t),n.objectMode||t.length!==0?qo(e,n,t,!1):nn(e,n)):qo(e,n,t,!1)}else r||(n.state&=~sr,nn(e,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(ql,"readableAddChunk");function qo(e,t,i,r){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&jl?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,r?t.buffer.unshift(i):t.buffer.push(i),t.state&rn&&sn(e)),nn(e,t)}s(qo,"addChunk");I.prototype.isPaused=function(){let e=this._readableState;return e[Vt]===!0||e.flowing===!1};I.prototype.setEncoding=function(e){let t=new Dl(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,r="";for(let n of i)r+=t.write(n);return i.clear(),r!==""&&i.push(r),this._readableState.length=r.length,this};var Km=1073741824;function Ym(e){if(e>Km)throw new Rm("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}s(Ym,"computeNewHighWaterMark");function Rl(e,t){return e<=0||t.length===0&&t.ended?0:t.state&gi?1:gm(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}s(Rl,"howMuchToRead");I.prototype.read=function(e){T("read",e),e===void 0?e=NaN:bm(e)||(e=wm(e,10));let t=this._readableState,i=e;if(e>t.highWaterMark&&(t.highWaterMark=Ym(e)),e!==0&&(t.state&=~Ul),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return T("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?$o(this):sn(this),null;if(e=Rl(e,t),e===0&&t.ended)return t.length===0&&$o(this),null;let r=(t.state&rn)!==0;if(T("need readable",r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,T("length less than watermark",r)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)r=!1,T("reading, ended or constructing",r);else if(r){T("do read"),t.state|=sr|tn,t.length===0&&(t.state|=rn);try{this._read(t.highWaterMark)}catch(o){bi(this,o)}t.state&=~tn,t.reading||(e=Rl(i,t))}let n;return e>0?n=Gl(e,t):n=null,n===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&&$o(this)),n!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n};function Xm(e,t){if(T("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?sn(e):(t.needReadable=!1,t.emittedReadable=!0,$l(e))}}s(Xm,"onEofChunk");function sn(e){let t=e._readableState;T("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(T("emitReadable",t.flowing),t.emittedReadable=!0,Oe.nextTick($l,e))}s(sn,"emitReadable");function $l(e){let t=e._readableState;T("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,Vl(e)}s($l,"emitReadable_");function nn(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Oe.nextTick(Jm,e,t))}s(nn,"maybeReadMore");function Jm(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let i=t.length;if(T("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}s(Jm,"maybeReadMore_");I.prototype._read=function(e){throw new Cm("_read()")};I.prototype.pipe=function(e,t){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new Em(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(e),T("pipe count=%d opts=%j",r.pipes.length,t);let o=(!t||t.end!==!1)&&e!==Oe.stdout&&e!==Oe.stderr?c:x;r.endEmitted?Oe.nextTick(o):i.once("end",o),e.on("unpipe",a);function a(_,O){T("onunpipe"),_===i&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,u())}s(a,"onunpipe");function c(){T("onend"),e.end()}s(c,"onend");let l,f=!1;function u(){T("cleanup"),e.removeListener("close",w),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",x),i.removeListener("data",b),f=!0,l&&r.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}s(u,"cleanup");function p(){f||(r.pipes.length===1&&r.pipes[0]===e?(T("false write response, pause",0),r.awaitDrainWriters=e,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(e)&&(T("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(e)),i.pause()),l||(l=Qm(i,e),e.on("drain",l))}s(p,"pause"),i.on("data",b);function b(_){T("ondata");let O=e.write(_);T("dest.write",O),O===!1&&p()}s(b,"ondata");function m(_){if(T("onerror",_),x(),e.removeListener("error",m),e.listenerCount("error")===0){let O=e._writableState||e._readableState;O&&!O.errorEmitted?bi(e,_):e.emit("error",_)}}s(m,"onerror"),Fm(e,"error",m);function w(){e.removeListener("finish",g),x()}s(w,"onclose"),e.once("close",w);function g(){T("onfinish"),e.removeListener("close",w),x()}s(g,"onfinish"),e.once("finish",g);function x(){T("unpipe"),i.unpipe(e)}return s(x,"unpipe"),e.emit("pipe",i),e.writableNeedDrain===!0?p():r.flowing||(T("pipe resume"),i.resume()),e};function Qm(e,t){return s(function(){let r=e._readableState;r.awaitDrainWriters===t?(T("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(T("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()},"pipeOnDrainFunctionResult")}s(Qm,"pipeOnDrain");I.prototype.unpipe=function(e){let t=this._readableState,i={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let n=t.pipes;t.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let r=mm(t.pipes,e);return r===-1?this:(t.pipes.splice(r,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,i),this)};I.prototype.on=function(e,t){let i=kt.prototype.on.call(this,e,t),r=this._readableState;return e==="data"?(r.readableListening=this.listenerCount("readable")>0,r.flowing!==!1&&this.resume()):e==="readable"&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,T("on readable",r.length,r.reading),r.length?sn(this):r.reading||Oe.nextTick(Zm,this)),i};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(e,t){let i=kt.prototype.removeListener.call(this,e,t);return e==="readable"&&Oe.nextTick(zl,this),i};I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=function(e){let t=kt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Oe.nextTick(zl,this),t};function zl(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[Vt]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}s(zl,"updateReadableListening");function Zm(e){T("readable nexttick read 0"),e.read(0)}s(Zm,"nReadingNextTick");I.prototype.resume=function(){let e=this._readableState;return e.flowing||(T("resume"),e.flowing=!e.readableListening,eb(this,e)),e[Vt]=!1,this};function eb(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Oe.nextTick(tb,e,t))}s(eb,"resume");function tb(e,t){T("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Vl(e),t.flowing&&!t.reading&&e.read(0)}s(tb,"resume_");I.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Vt]=!0,this};function Vl(e){let t=e._readableState;for(T("flow",t.flowing);t.flowing&&e.read()!==null;);}s(Vl,"flow");I.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",r=>{bi(this,r)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let i=Sm(e);for(let r=1;r<i.length;r++){let n=i[r];this[n]===void 0&&typeof e[n]=="function"&&(this[n]=e[n].bind(e))}return this};I.prototype[xm]=function(){return Hl(this)};I.prototype.iterator=function(e){return e!==void 0&&Dm(e,"options"),Hl(this,e)};function Hl(e,t){typeof e.read!="function"&&(e=I.wrap(e,{objectMode:!0}));let i=ib(e,t);return i.stream=e,i}s(Hl,"streamToAsyncIterator");async function*ib(e,t){let i=jo;function r(a){this===e?(i(),i=jo):i=a}s(r,"next"),e.on("readable",r);let n,o=Bl(e,{writable:!1},a=>{n=a?Cl(n,a):null,i(),i=jo});try{for(;;){let a=e.destroyed?null:e.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new Ll(r)}}}catch(a){throw n=Cl(n,a),n}finally{(n||t?.destroyOnReturn!==!1)&&(n===void 0||e._readableState.autoDestroy)?wi.destroyer(e,null):(e.off("readable",r),o())}}s(ib,"createAsyncIterator");Go(I.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")}});Go(on.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Vt]!==!1},"get"),set:s(function(e){this[Vt]=!!e},"set")}});I._fromList=Gl;function Gl(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(Gl,"fromList");function $o(e){let t=e._readableState;T("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Oe.nextTick(rb,t,e))}s($o,"endReadable");function rb(e,t){if(T("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)Oe.nextTick(nb,t);else if(e.autoDestroy){let i=t._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&t.destroy()}}}s(rb,"endReadableNT");function nb(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}s(nb,"endWritableNT");I.from=function(e,t){return Mm(I,e,t)};var zo;function Kl(){return zo===void 0&&(zo={}),zo}s(Kl,"lazyWebStreams");I.fromWeb=function(e,t){return Kl().newStreamReadableFromReadableStream(e,t)};I.toWeb=function(e,t){return Kl().newReadableStreamFromStreamReadable(e,t)};I.wrap=function(e,t){var i,r;return new I({objectMode:(i=(r=e.readableObjectMode)!==null&&r!==void 0?r:e.objectMode)!==null&&i!==void 0?i:!0,...t,destroy:s(function(n,o){wi.destroyer(e,n),o(n)},"destroy")}).wrap(e)}});var un=C((WE,cf)=>{var Ht=_t(),{ArrayPrototypeSlice:Ql,Error:ob,FunctionPrototypeSymbolHasInstance:Zl,ObjectDefineProperty:ef,ObjectDefineProperties:sb,ObjectSetPrototypeOf:tf,StringPrototypeToLowerCase:ab,Symbol:cb,SymbolHasInstance:lb}=j();cf.exports=q;q.WritableState=fr;var{EventEmitter:fb}=ir(),cr=Jr().Stream,{Buffer:an}=ve(),fn=$t(),{addAbortSignal:ub}=rr(),{getHighWaterMark:db,getDefaultHighWaterMark:pb}=nr(),{ERR_INVALID_ARG_TYPE:hb,ERR_METHOD_NOT_IMPLEMENTED:yb,ERR_MULTIPLE_CALLBACK:rf,ERR_STREAM_CANNOT_PIPE:mb,ERR_STREAM_DESTROYED:lr,ERR_STREAM_ALREADY_FINISHED:bb,ERR_STREAM_NULL_VALUES:gb,ERR_STREAM_WRITE_AFTER_END:wb,ERR_UNKNOWN_ENCODING:nf}=se().codes,{errorOrDestroy:Si}=fn;tf(q.prototype,cr.prototype);tf(q,cr);function Xo(){}s(Xo,"nop");var Ei=cb("kOnFinished");function fr(e,t,i){typeof i!="boolean"&&(i=t instanceof Ze()),this.objectMode=!!(e&&e.objectMode),i&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?db(this,e,"writableHighWaterMark",i):pb(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let r=!!(e&&e.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Eb.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ln(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[Ei]=[]}s(fr,"WritableState");function ln(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}s(ln,"resetBuffer");fr.prototype.getBuffer=s(function(){return Ql(this.buffered,this.bufferedIndex)},"getBuffer");ef(fr.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function q(e){let t=this instanceof Ze();if(!t&&!Zl(q,this))return new q(e);this._writableState=new fr(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&&ub(e.signal,this)),cr.call(this,e),fn.construct(this,()=>{let i=this._writableState;i.writing||Qo(this,i),Zo(this,i)})}s(q,"Writable");ef(q,lb,{__proto__:null,value:s(function(e){return Zl(this,e)?!0:this!==q?!1:e&&e._writableState instanceof fr},"value")});q.prototype.pipe=function(){Si(this,new mb)};function of(e,t,i,r){let n=e._writableState;if(typeof i=="function")r=i,i=n.defaultEncoding;else{if(!i)i=n.defaultEncoding;else if(i!=="buffer"&&!an.isEncoding(i))throw new nf(i);typeof r!="function"&&(r=Xo)}if(t===null)throw new gb;if(!n.objectMode)if(typeof t=="string")n.decodeStrings!==!1&&(t=an.from(t,i),i="buffer");else if(t instanceof an)i="buffer";else if(cr._isUint8Array(t))t=cr._uint8ArrayToBuffer(t),i="buffer";else throw new hb("chunk",["string","Buffer","Uint8Array"],t);let o;return n.ending?o=new wb:n.destroyed&&(o=new lr("write")),o?(Ht.nextTick(r,o),Si(e,o,!0),o):(n.pendingcb++,Sb(e,n,t,i,r))}s(of,"_write");q.prototype.write=function(e,t,i){return of(this,e,t,i)===!0};q.prototype.cork=function(){this._writableState.corked++};q.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||Qo(this,e))};q.prototype.setDefaultEncoding=s(function(t){if(typeof t=="string"&&(t=ab(t)),!an.isEncoding(t))throw new nf(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function Sb(e,t,i,r,n){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:r,callback:n}),t.allBuffers&&r!=="buffer"&&(t.allBuffers=!1),t.allNoop&&n!==Xo&&(t.allNoop=!1)):(t.writelen=o,t.writecb=n,t.writing=!0,t.sync=!0,e._write(i,r,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}s(Sb,"writeOrBuffer");function Xl(e,t,i,r,n,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new lr("write")):i?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}s(Xl,"doWrite");function Jl(e,t,i,r){--t.pendingcb,r(i),Jo(t),Si(e,i)}s(Jl,"onwriteError");function Eb(e,t){let i=e._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){Si(e,new rf);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),r?Ht.nextTick(Jl,e,i,t,n):Jl(e,i,t,n)):(i.buffered.length>i.bufferedIndex&&Qo(e,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:e,state:i},Ht.nextTick(_b,i.afterWriteTickInfo)):sf(e,i,1,n))}s(Eb,"onwrite");function _b({stream:e,state:t,count:i,cb:r}){return t.afterWriteTickInfo=null,sf(e,t,i,r)}s(_b,"afterWriteTick");function sf(e,t,i,r){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));i-- >0;)t.pendingcb--,r();t.destroyed&&Jo(t),Zo(e,t)}s(sf,"afterWrite");function Jo(e){if(e.writing)return;for(let n=e.bufferedIndex;n<e.buffered.length;++n){var t;let{chunk:o,callback:a}=e.buffered[n],c=e.objectMode?1:o.length;e.length-=c,a((t=e.errored)!==null&&t!==void 0?t:new lr("write"))}let i=e[Ei].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=e.errored)!==null&&r!==void 0?r:new lr("end"))}ln(e)}s(Jo,"errorBuffer");function Qo(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=t,o=i.length-r;if(!o)return;let a=r;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let c=t.allNoop?Xo:f=>{for(let u=a;u<i.length;++u)i[u].callback(f)},l=t.allNoop&&a===0?i:Ql(i,a);l.allBuffers=t.allBuffers,Xl(e,t,!0,t.length,l,"",c),ln(t)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let u=n?1:c.length;Xl(e,t,!1,u,c,l,f)}while(a<i.length&&!t.writing);a===i.length?ln(t):a>256?(i.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}s(Qo,"clearBuffer");q.prototype._write=function(e,t,i){if(this._writev)this._writev([{chunk:e,encoding:t}],i);else throw new yb("_write()")};q.prototype._writev=null;q.prototype.end=function(e,t,i){let r=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null);let n;if(e!=null){let o=of(this,e,t);o instanceof ob&&(n=o)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Zo(this,r,!0),r.ended=!0):r.finished?n=new bb("end"):r.destroyed&&(n=new lr("end"))),typeof i=="function"&&(n||r.finished?Ht.nextTick(i,n):r[Ei].push(i)),this};function cn(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(cn,"needFinish");function xb(e,t){let i=!1;function r(n){if(i){Si(e,n??rf());return}if(i=!0,t.pendingcb--,n){let o=t[Ei].splice(0);for(let a=0;a<o.length;a++)o[a](n);Si(e,n,t.sync)}else cn(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,Ht.nextTick(Yo,e,t))}s(r,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(r)}catch(n){r(n)}t.sync=!1}s(xb,"callFinal");function kb(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,xb(e,t)):(t.prefinished=!0,e.emit("prefinish")))}s(kb,"prefinish");function Zo(e,t,i){cn(t)&&(kb(e,t),t.pendingcb===0&&(i?(t.pendingcb++,Ht.nextTick((r,n)=>{cn(n)?Yo(r,n):n.pendingcb--},e,t)):cn(t)&&(t.pendingcb++,Yo(e,t))))}s(Zo,"finishMaybe");function Yo(e,t){t.pendingcb--,t.finished=!0;let i=t[Ei].splice(0);for(let r=0;r<i.length;r++)i[r]();if(e.emit("finish"),t.autoDestroy){let r=e._readableState;(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))&&e.destroy()}}s(Yo,"finish");sb(q.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 vb=fn.destroy;q.prototype.destroy=function(e,t){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ei].length)&&Ht.nextTick(Jo,i),vb.call(this,e,t),this};q.prototype._undestroy=fn.undestroy;q.prototype._destroy=function(e,t){t(e)};q.prototype[fb.captureRejectionSymbol]=function(e){this.destroy(e)};var Ko;function af(){return Ko===void 0&&(Ko={}),Ko}s(af,"lazyWebStreams");q.fromWeb=function(e,t){return af().newStreamWritableFromWritableStream(e,t)};q.toWeb=function(e){return af().newWritableStreamFromStreamWritable(e)}});var xf=C((jE,_f)=>{var es=_t(),Fb=ve(),{isReadable:Ib,isWritable:Pb,isIterable:lf,isNodeStream:Ab,isReadableNodeStream:ff,isWritableNodeStream:uf,isDuplexNodeStream:Tb,isReadableStream:df,isWritableStream:pf}=Xe(),hf=ft(),{AbortError:Sf,codes:{ERR_INVALID_ARG_TYPE:Ob,ERR_INVALID_RETURN_VALUE:yf}}=se(),{destroyer:xi}=$t(),Cb=Ze(),Ef=ar(),Rb=un(),{createDeferredPromise:mf}=ie(),bf=Wo(),gf=globalThis.Blob||Fb.Blob,Nb=s(typeof gf<"u"?function(t){return t instanceof gf}:function(t){return!1},"isBlob"),Lb=globalThis.AbortController||ui().AbortController,{FunctionPrototypeCall:wf}=j(),vt=class extends Cb{static{s(this,"Duplexify")}constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};_f.exports=s(function e(t,i){if(Tb(t))return t;if(ff(t))return _i({readable:t});if(uf(t))return _i({writable:t});if(Ab(t))return _i({writable:!1,readable:!1});if(df(t))return _i({readable:Ef.fromWeb(t)});if(pf(t))return _i({writable:Rb.fromWeb(t)});if(typeof t=="function"){let{value:n,write:o,final:a,destroy:c}=Bb(t);if(lf(n))return bf(vt,n,{objectMode:!0,write:o,final:a,destroy:c});let l=n?.then;if(typeof l=="function"){let f,u=wf(l,n,p=>{if(p!=null)throw new yf("nully","body",p)},p=>{xi(f,p)});return f=new vt({objectMode:!0,readable:!1,write:o,final:s(function(p){a(async()=>{try{await u,es.nextTick(p,null)}catch(b){es.nextTick(p,b)}})},"final"),destroy:c})}throw new yf("Iterable, AsyncIterable or AsyncFunction",i,n)}if(Nb(t))return e(t.arrayBuffer());if(lf(t))return bf(vt,t,{objectMode:!0,writable:!1});if(df(t?.readable)&&pf(t?.writable))return vt.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let n=t!=null&&t.readable?ff(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?uf(t?.writable)?t?.writable:e(t.writable):void 0;return _i({readable:n,writable:o})}let r=t?.then;if(typeof r=="function"){let n;return wf(r,t,o=>{o!=null&&n.push(o),n.push(null)},o=>{xi(n,o)}),n=new vt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new Ob(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function Bb(e){let{promise:t,resolve:i}=mf(),r=new Lb,n=r.signal;return{value:e(async function*(){for(;;){let a=t;t=null;let{chunk:c,done:l,cb:f}=await a;if(es.nextTick(f),l)return;if(n.aborted)throw new Sf(void 0,{cause:n.reason});({promise:t,resolve:i}=mf()),yield c}}(),{signal:n}),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){r.abort(),c(a)},"destroy")}}s(Bb,"fromAsyncGen");function _i(e){let t=e.readable&&typeof e.readable.read!="function"?Ef.wrap(e.readable):e.readable,i=e.writable,r=!!Ib(t),n=!!Pb(i),o,a,c,l,f;function u(p){let b=l;l=null,b?b(p):p&&f.destroy(p)}return s(u,"onfinished"),f=new vt({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(hf(i,p=>{n=!1,p&&xi(t,p),u(p)}),f._write=function(p,b,m){i.write(p,b)?m():o=m},f._final=function(p){i.end(),a=p},i.on("drain",function(){if(o){let p=o;o=null,p()}}),i.on("finish",function(){if(a){let p=a;a=null,p()}})),r&&(hf(t,p=>{r=!1,p&&xi(t,p),u(p)}),t.on("readable",function(){if(c){let p=c;c=null,p()}}),t.on("end",function(){f.push(null)}),f._read=function(){for(;;){let p=t.read();if(p===null){c=f._read;return}if(!f.push(p))return}}),f._destroy=function(p,b){!p&&l!==null&&(p=new Sf),c=null,o=null,a=null,l===null?b(p):(l=b,xi(i,p),xi(t,p))},f}s(_i,"_duplexify")});var Ze=C(($E,Ff)=>{"use strict";var{ObjectDefineProperties:Db,ObjectGetOwnPropertyDescriptor:ut,ObjectKeys:Mb,ObjectSetPrototypeOf:kf}=j();Ff.exports=Ce;var rs=ar(),Pe=un();kf(Ce.prototype,rs.prototype);kf(Ce,rs);{let e=Mb(Pe.prototype);for(let t=0;t<e.length;t++){let i=e[t];Ce.prototype[i]||(Ce.prototype[i]=Pe.prototype[i])}}function Ce(e){if(!(this instanceof Ce))return new Ce(e);rs.call(this,e),Pe.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(Ce,"Duplex");Db(Ce.prototype,{writable:{__proto__:null,...ut(Pe.prototype,"writable")},writableHighWaterMark:{__proto__:null,...ut(Pe.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...ut(Pe.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...ut(Pe.prototype,"writableBuffer")},writableLength:{__proto__:null,...ut(Pe.prototype,"writableLength")},writableFinished:{__proto__:null,...ut(Pe.prototype,"writableFinished")},writableCorked:{__proto__:null,...ut(Pe.prototype,"writableCorked")},writableEnded:{__proto__:null,...ut(Pe.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...ut(Pe.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 ts;function vf(){return ts===void 0&&(ts={}),ts}s(vf,"lazyWebStreams");Ce.fromWeb=function(e,t){return vf().newStreamDuplexFromReadableWritablePair(e,t)};Ce.toWeb=function(e){return vf().newReadableWritablePairFromDuplex(e)};var is;Ce.from=function(e){return is||(is=xf()),is(e,"body")}});var ss=C((VE,Pf)=>{"use strict";var{ObjectSetPrototypeOf:If,Symbol:Wb}=j();Pf.exports=dt;var{ERR_METHOD_NOT_IMPLEMENTED:Ub}=se().codes,os=Ze(),{getHighWaterMark:jb}=nr();If(dt.prototype,os.prototype);If(dt,os);var ur=Wb("kCallback");function dt(e){if(!(this instanceof dt))return new dt(e);let t=e?jb(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),os.call(this,e),this._readableState.sync=!1,this[ur]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",qb)}s(dt,"Transform");function ns(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(ns,"final");function qb(){this._final!==ns&&ns.call(this)}s(qb,"prefinish");dt.prototype._final=ns;dt.prototype._transform=function(e,t,i){throw new Ub("_transform()")};dt.prototype._write=function(e,t,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(e,t,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),n.ended||o===r.length||r.length<r.highWaterMark?i():this[ur]=i})};dt.prototype._read=function(){if(this[ur]){let e=this[ur];this[ur]=null,e()}}});var cs=C((GE,Tf)=>{"use strict";var{ObjectSetPrototypeOf:Af}=j();Tf.exports=ki;var as=ss();Af(ki.prototype,as.prototype);Af(ki,as);function ki(e){if(!(this instanceof ki))return new ki(e);as.call(this,e)}s(ki,"PassThrough");ki.prototype._transform=function(e,t,i){i(null,e)}});var yn=C((YE,Lf)=>{var dr=_t(),{ArrayIsArray:$b,Promise:zb,SymbolAsyncIterator:Vb,SymbolDispose:Hb}=j(),hn=ft(),{once:Gb}=ie(),Kb=$t(),Of=Ze(),{aggregateTwoErrors:Yb,codes:{ERR_INVALID_ARG_TYPE:bs,ERR_INVALID_RETURN_VALUE:ls,ERR_MISSING_ARGS:Xb,ERR_STREAM_DESTROYED:Jb,ERR_STREAM_PREMATURE_CLOSE:Qb},AbortError:Zb}=se(),{validateFunction:eg,validateAbortSignal:tg}=hi(),{isIterable:Gt,isReadable:fs,isReadableNodeStream:pn,isNodeStream:Cf,isTransformStream:vi,isWebStream:ig,isReadableStream:us,isReadableFinished:rg}=Xe(),ng=globalThis.AbortController||ui().AbortController,ds,ps,hs;function Rf(e,t,i){let r=!1;e.on("close",()=>{r=!0});let n=hn(e,{readable:t,writable:i},o=>{r=!o});return{destroy:s(o=>{r||(r=!0,Kb.destroyer(e,o||new Jb("pipe")))},"destroy"),cleanup:n}}s(Rf,"destroyer");function og(e){return eg(e[e.length-1],"streams[stream.length - 1]"),e.pop()}s(og,"popCallback");function ys(e){if(Gt(e))return e;if(pn(e))return sg(e);throw new bs("val",["Readable","Iterable","AsyncIterable"],e)}s(ys,"makeAsyncIterable");async function*sg(e){ps||(ps=ar()),yield*ps.prototype[Vb].call(e)}s(sg,"fromReadable");async function dn(e,t,i,{end:r}){let n,o=null,a=s(f=>{if(f&&(n=f),o){let u=o;o=null,u()}},"resume"),c=s(()=>new zb((f,u)=>{n?u(n):o=s(()=>{n?u(n):f()},"onresolve")}),"wait");t.on("drain",a);let l=hn(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(let f of e)t.write(f)||await c();r&&(t.end(),await c()),i()}catch(f){i(n!==f?Yb(n,f):f)}finally{l(),t.off("drain",a)}}s(dn,"pumpToNode");async function ms(e,t,i,{end:r}){vi(t)&&(t=t.writable);let n=t.getWriter();try{for await(let o of e)await n.ready,n.write(o).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(o){try{await n.abort(o),i(o)}catch(a){i(a)}}}s(ms,"pumpToWeb");function ag(...e){return Nf(e,Gb(og(e)))}s(ag,"pipeline");function Nf(e,t,i){if(e.length===1&&$b(e[0])&&(e=e[0]),e.length<2)throw new Xb("streams");let r=new ng,n=r.signal,o=i?.signal,a=[];tg(o,"options.signal");function c(){w(new Zb)}s(c,"abort"),hs=hs||ie().addAbortListener;let l;o&&(l=hs(o,c));let f,u,p=[],b=0;function m(R){w(R,--b===0)}s(m,"finish");function w(R,P){var G;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!P)){for(;p.length;)p.shift()(f);(G=l)===null||G===void 0||G[Hb](),r.abort(),P&&(f||a.forEach(Pt=>Pt()),dr.nextTick(t,f,u))}}s(w,"finishImpl");let g;for(let R=0;R<e.length;R++){let P=e[R],G=R<e.length-1,Pt=R>0,ge=G||i?.end!==!1,Qt=R===e.length-1;if(Cf(P)){let ce=function(tt){tt&&tt.name!=="AbortError"&&tt.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(tt)};var O=ce;if(s(ce,"onError"),ge){let{destroy:tt,cleanup:Ln}=Rf(P,G,Pt);p.push(tt),fs(P)&&Qt&&a.push(Ln)}P.on("error",ce),fs(P)&&Qt&&a.push(()=>{P.removeListener("error",ce)})}if(R===0)if(typeof P=="function"){if(g=P({signal:n}),!Gt(g))throw new ls("Iterable, AsyncIterable or Stream","source",g)}else Gt(P)||pn(P)||vi(P)?g=P:g=Of.from(P);else if(typeof P=="function"){if(vi(g)){var x;g=ys((x=g)===null||x===void 0?void 0:x.readable)}else g=ys(g);if(g=P(g,{signal:n}),G){if(!Gt(g,!0))throw new ls("AsyncIterable",`transform[${R-1}]`,g)}else{var _;ds||(ds=cs());let ce=new ds({objectMode:!0}),tt=(_=g)===null||_===void 0?void 0:_.then;if(typeof tt=="function")b++,tt.call(g,ht=>{u=ht,ht!=null&&ce.write(ht),ge&&ce.end(),dr.nextTick(m)},ht=>{ce.destroy(ht),dr.nextTick(m,ht)});else if(Gt(g,!0))b++,dn(g,ce,m,{end:ge});else if(us(g)||vi(g)){let ht=g.readable||g;b++,dn(ht,ce,m,{end:ge})}else throw new ls("AsyncIterable or Promise","destination",g);g=ce;let{destroy:Ln,cleanup:hd}=Rf(g,!1,!0);p.push(Ln),Qt&&a.push(hd)}}else if(Cf(P)){if(pn(g)){b+=2;let ce=cg(g,P,m,{end:ge});fs(P)&&Qt&&a.push(ce)}else if(vi(g)||us(g)){let ce=g.readable||g;b++,dn(ce,P,m,{end:ge})}else if(Gt(g))b++,dn(g,P,m,{end:ge});else throw new bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=P}else if(ig(P)){if(pn(g))b++,ms(ys(g),P,m,{end:ge});else if(us(g)||Gt(g))b++,ms(g,P,m,{end:ge});else if(vi(g))b++,ms(g.readable,P,m,{end:ge});else throw new bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=P}else g=Of.from(P)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&dr.nextTick(c),g}s(Nf,"pipelineImpl");function cg(e,t,i,{end:r}){let n=!1;if(t.on("close",()=>{n||i(new Qb)}),e.pipe(t,{end:!1}),r){let a=function(){n=!0,t.end()};var o=a;s(a,"endFn"),rg(e)?dr.nextTick(a):e.once("end",a)}else i();return hn(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)}),hn(t,{readable:!1,writable:!0},i)}s(cg,"pipe");Lf.exports={pipelineImpl:Nf,pipeline:ag}});var ws=C((JE,jf)=>{"use strict";var{pipeline:lg}=yn(),mn=Ze(),{destroyer:fg}=$t(),{isNodeStream:bn,isReadable:Bf,isWritable:Df,isWebStream:gs,isTransformStream:Kt,isWritableStream:Mf,isReadableStream:Wf}=Xe(),{AbortError:ug,codes:{ERR_INVALID_ARG_VALUE:Uf,ERR_MISSING_ARGS:dg}}=se(),pg=ft();jf.exports=s(function(...t){if(t.length===0)throw new dg("streams");if(t.length===1)return mn.from(t[0]);let i=[...t];if(typeof t[0]=="function"&&(t[0]=mn.from(t[0])),typeof t[t.length-1]=="function"){let m=t.length-1;t[m]=mn.from(t[m])}for(let m=0;m<t.length;++m)if(!(!bn(t[m])&&!gs(t[m]))){if(m<t.length-1&&!(Bf(t[m])||Wf(t[m])||Kt(t[m])))throw new Uf(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(Df(t[m])||Mf(t[m])||Kt(t[m])))throw new Uf(`streams[${m}]`,i[m],"must be writable")}let r,n,o,a,c;function l(m){let w=a;a=null,w?w(m):m?c.destroy(m):!b&&!p&&c.destroy()}s(l,"onfinished");let f=t[0],u=lg(t,l),p=!!(Df(f)||Mf(f)||Kt(f)),b=!!(Bf(u)||Wf(u)||Kt(u));if(c=new mn({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(u!=null&&u.readableObjectMode),writable:p,readable:b}),p){if(bn(f))c._write=function(w,g,x){f.write(w,g)?x():r=x},c._final=function(w){f.end(),n=w},f.on("drain",function(){if(r){let w=r;r=null,w()}});else if(gs(f)){let g=(Kt(f)?f.writable:f).getWriter();c._write=async function(x,_,O){try{await g.ready,g.write(x).catch(()=>{}),O()}catch(R){O(R)}},c._final=async function(x){try{await g.ready,g.close().catch(()=>{}),n=x}catch(_){x(_)}}}let m=Kt(u)?u.readable:u;pg(m,()=>{if(n){let w=n;n=null,w()}})}if(b){if(bn(u))u.on("readable",function(){if(o){let m=o;o=null,m()}}),u.on("end",function(){c.push(null)}),c._read=function(){for(;;){let m=u.read();if(m===null){o=c._read;return}if(!c.push(m))return}};else if(gs(u)){let w=(Kt(u)?u.readable:u).getReader();c._read=async function(){for(;;)try{let{value:g,done:x}=await w.read();if(!c.push(g))return;if(x){c.push(null);return}}catch{return}}}}return c._destroy=function(m,w){!m&&a!==null&&(m=new ug),o=null,r=null,n=null,a===null?w(m):(a=w,bn(u)&&fg(u,m))},c},"compose")});var Jf=C((ZE,_s)=>{"use strict";var hg=globalThis.AbortController||ui().AbortController,{codes:{ERR_INVALID_ARG_VALUE:yg,ERR_INVALID_ARG_TYPE:pr,ERR_MISSING_ARGS:mg,ERR_OUT_OF_RANGE:bg},AbortError:et}=se(),{validateAbortSignal:Yt,validateInteger:qf,validateObject:Xt}=hi(),gg=j().Symbol("kWeak"),wg=j().Symbol("kResistStopPropagation"),{finished:Sg}=ft(),Eg=ws(),{addAbortSignalNoValidate:_g}=rr(),{isWritable:xg,isNodeStream:kg}=Xe(),{deprecate:vg}=ie(),{ArrayPrototypePush:Fg,Boolean:Ig,MathFloor:$f,Number:Pg,NumberIsNaN:Ag,Promise:zf,PromiseReject:Vf,PromiseResolve:Tg,PromisePrototypeThen:Hf,Symbol:Kf}=j(),gn=Kf("kEmpty"),Gf=Kf("kEof");function Og(e,t){if(t!=null&&Xt(t,"options"),t?.signal!=null&&Yt(t.signal,"options.signal"),kg(e)&&!xg(e))throw new yg("stream",e,"must be writable");let i=Eg(this,e);return t!=null&&t.signal&&_g(t.signal,i),i}s(Og,"compose");function wn(e,t){if(typeof e!="function")throw new pr("fn",["Function","AsyncFunction"],e);t!=null&&Xt(t,"options"),t?.signal!=null&&Yt(t.signal,"options.signal");let i=1;t?.concurrency!=null&&(i=$f(t.concurrency));let r=i-1;return t?.highWaterMark!=null&&(r=$f(t.highWaterMark)),qf(i,"options.concurrency",1),qf(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=ie().AbortSignalAny([t?.signal].filter(Ig)),a=this,c=[],l={signal:o},f,u,p=!1,b=0;function m(){p=!0,w()}s(m,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){u&&!p&&b<i&&c.length<r&&(u(),u=null)}s(g,"maybeResume");async function x(){try{for await(let _ of a){if(p)return;if(o.aborted)throw new et;try{if(_=e(_,l),_===gn)continue;_=Tg(_)}catch(O){_=Vf(O)}b+=1,Hf(_,w,m),c.push(_),f&&(f(),f=null),!p&&(c.length>=r||b>=i)&&await new zf(O=>{u=O})}c.push(Gf)}catch(_){let O=Vf(_);Hf(O,w,m),c.push(O)}finally{p=!0,f&&(f(),f=null)}}s(x,"pump"),x();try{for(;;){for(;c.length>0;){let _=await c[0];if(_===Gf)return;if(o.aborted)throw new et;_!==gn&&(yield _),c.shift(),g()}await new zf(_=>{f=_})}}finally{p=!0,u&&(u(),u=null)}},"map").call(this)}s(wn,"map");function Cg(e=void 0){return e!=null&&Xt(e,"options"),e?.signal!=null&&Yt(e.signal,"options.signal"),s(async function*(){let i=0;for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new et({cause:e.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(Cg,"asIndexedPairs");async function Yf(e,t=void 0){for await(let i of Es.call(this,e,t))return!0;return!1}s(Yf,"some");async function Rg(e,t=void 0){if(typeof e!="function")throw new pr("fn",["Function","AsyncFunction"],e);return!await Yf.call(this,async(...i)=>!await e(...i),t)}s(Rg,"every");async function Ng(e,t){for await(let i of Es.call(this,e,t))return i}s(Ng,"find");async function Lg(e,t){if(typeof e!="function")throw new pr("fn",["Function","AsyncFunction"],e);async function i(r,n){return await e(r,n),gn}s(i,"forEachFn");for await(let r of wn.call(this,i,t));}s(Lg,"forEach");function Es(e,t){if(typeof e!="function")throw new pr("fn",["Function","AsyncFunction"],e);async function i(r,n){return await e(r,n)?r:gn}return s(i,"filterFn"),wn.call(this,i,t)}s(Es,"filter");var Ss=class extends mg{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Bg(e,t,i){var r;if(typeof e!="function")throw new pr("reducer",["Function","AsyncFunction"],e);i!=null&&Xt(i,"options"),i?.signal!=null&&Yt(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new et(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Sg(this.destroy(f)),f}let o=new hg,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[gg]:this,[wg]:!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 et;n?t=await e(t,f,{signal:a}):(t=f,n=!0)}if(!c&&!n)throw new Ss}finally{o.abort()}return t}s(Bg,"reduce");async function Dg(e){e!=null&&Xt(e,"options"),e?.signal!=null&&Yt(e.signal,"options.signal");let t=[];for await(let r of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new et(void 0,{cause:e.signal.reason});Fg(t,r)}return t}s(Dg,"toArray");function Mg(e,t){let i=wn.call(this,e,t);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(Mg,"flatMap");function Xf(e){if(e=Pg(e),Ag(e))return 0;if(e<0)throw new bg("number",">= 0",e);return e}s(Xf,"toIntegerOrInfinity");function Wg(e,t=void 0){return t!=null&&Xt(t,"options"),t?.signal!=null&&Yt(t.signal,"options.signal"),e=Xf(e),s(async function*(){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new et;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new et;e--<=0&&(yield o)}},"drop").call(this)}s(Wg,"drop");function Ug(e,t=void 0){return t!=null&&Xt(t,"options"),t?.signal!=null&&Yt(t.signal,"options.signal"),e=Xf(e),s(async function*(){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new et;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new et;if(e-- >0&&(yield o),e<=0)return}},"take").call(this)}s(Ug,"take");_s.exports.streamReturningOperators={asIndexedPairs:vg(Cg,"readable.asIndexedPairs will be removed in a future version."),drop:Wg,filter:Es,flatMap:Mg,map:wn,take:Ug,compose:Og};_s.exports.promiseReturningOperators={every:Rg,forEach:Lg,reduce:Bg,toArray:Dg,some:Yf,find:Ng}});var xs=C((t_,Qf)=>{"use strict";var{ArrayPrototypePop:jg,Promise:qg}=j(),{isIterable:$g,isNodeStream:zg,isWebStream:Vg}=Xe(),{pipelineImpl:Hg}=yn(),{finished:Gg}=ft();ks();function Kg(...e){return new qg((t,i)=>{let r,n,o=e[e.length-1];if(o&&typeof o=="object"&&!zg(o)&&!$g(o)&&!Vg(o)){let a=jg(e);r=a.signal,n=a.end}Hg(e,(a,c)=>{a?i(a):t(c)},{signal:r,end:n})})}s(Kg,"pipeline");Qf.exports={finished:Gg,pipeline:Kg}});var ks=C((r_,au)=>{var{Buffer:Yg}=ve(),{ObjectDefineProperty:pt,ObjectKeys:tu,ReflectApply:iu}=j(),{promisify:{custom:ru}}=ie(),{streamReturningOperators:Zf,promiseReturningOperators:eu}=Jf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:nu}}=se(),Xg=ws(),{setDefaultHighWaterMark:Jg,getDefaultHighWaterMark:Qg}=nr(),{pipeline:ou}=yn(),{destroyer:Zg}=$t(),su=ft(),vs=xs(),hr=Xe(),B=au.exports=Jr().Stream;B.isDestroyed=hr.isDestroyed;B.isDisturbed=hr.isDisturbed;B.isErrored=hr.isErrored;B.isReadable=hr.isReadable;B.isWritable=hr.isWritable;B.Readable=ar();for(let e of tu(Zf)){let i=function(...r){if(new.target)throw nu();return B.Readable.from(iu(t,this,r))};Fs=i,s(i,"fn");let t=Zf[e];pt(i,"name",{__proto__:null,value:t.name}),pt(i,"length",{__proto__:null,value:t.length}),pt(B.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fs;for(let e of tu(eu)){let i=function(...n){if(new.target)throw nu();return iu(t,this,n)};Fs=i,s(i,"fn");let t=eu[e];pt(i,"name",{__proto__:null,value:t.name}),pt(i,"length",{__proto__:null,value:t.length}),pt(B.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fs;B.Writable=un();B.Duplex=Ze();B.Transform=ss();B.PassThrough=cs();B.pipeline=ou;var{addAbortSignal:ew}=rr();B.addAbortSignal=ew;B.finished=su;B.destroy=Zg;B.compose=Xg;B.setDefaultHighWaterMark=Jg;B.getDefaultHighWaterMark=Qg;pt(B,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return vs},"get")});pt(ou,ru,{__proto__:null,enumerable:!0,get:s(function(){return vs.pipeline},"get")});pt(su,ru,{__proto__:null,enumerable:!0,get:s(function(){return vs.finished},"get")});B.Stream=B;B._isUint8Array=s(function(t){return t instanceof Uint8Array},"isUint8Array");B._uint8ArrayToBuffer=s(function(t){return Yg.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var cu=C((o_,H)=>{"use strict";var Q=ks(),tw=xs(),iw=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=iw;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return tw},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var fu=C((f_,Is)=>{"use strict";var rw=Object.prototype.hasOwnProperty,ae="~";function yr(){}s(yr,"Events");Object.create&&(yr.prototype=Object.create(null),new yr().__proto__||(ae=!1));function nw(e,t,i){this.fn=e,this.context=t,this.once=i||!1}s(nw,"EE");function lu(e,t,i,r,n){if(typeof i!="function")throw new TypeError("The listener must be a function");var o=new nw(i,r||e,n),a=ae?ae+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(lu,"addListener");function En(e,t){--e._eventsCount===0?e._events=new yr:delete e._events[t]}s(En,"clearEvent");function ne(){this._events=new yr,this._eventsCount=0}s(ne,"EventEmitter");ne.prototype.eventNames=s(function(){var t=[],i,r;if(this._eventsCount===0)return t;for(r in i=this._events)rw.call(i,r)&&t.push(ae?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(i)):t},"eventNames");ne.prototype.listeners=s(function(t){var i=ae?ae+t:t,r=this._events[i];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},"listeners");ne.prototype.listenerCount=s(function(t){var i=ae?ae+t:t,r=this._events[i];return r?r.fn?1:r.length:0},"listenerCount");ne.prototype.emit=s(function(t,i,r,n,o,a){var c=ae?ae+t:t;if(!this._events[c])return!1;var l=this._events[c],f=arguments.length,u,p;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,r),!0;case 4:return l.fn.call(l.context,i,r,n),!0;case 5:return l.fn.call(l.context,i,r,n,o),!0;case 6:return l.fn.call(l.context,i,r,n,o,a),!0}for(p=1,u=new Array(f-1);p<f;p++)u[p-1]=arguments[p];l.fn.apply(l.context,u)}else{var b=l.length,m;for(p=0;p<b;p++)switch(l[p].once&&this.removeListener(t,l[p].fn,void 0,!0),f){case 1:l[p].fn.call(l[p].context);break;case 2:l[p].fn.call(l[p].context,i);break;case 3:l[p].fn.call(l[p].context,i,r);break;case 4:l[p].fn.call(l[p].context,i,r,n);break;default:if(!u)for(m=1,u=new Array(f-1);m<f;m++)u[m-1]=arguments[m];l[p].fn.apply(l[p].context,u)}}return!0},"emit");ne.prototype.on=s(function(t,i,r){return lu(this,t,i,r,!1)},"on");ne.prototype.once=s(function(t,i,r){return lu(this,t,i,r,!0)},"once");ne.prototype.removeListener=s(function(t,i,r,n){var o=ae?ae+t:t;if(!this._events[o])return this;if(!i)return En(this,o),this;var a=this._events[o];if(a.fn)a.fn===i&&(!n||a.once)&&(!r||a.context===r)&&En(this,o);else{for(var c=0,l=[],f=a.length;c<f;c++)(a[c].fn!==i||n&&!a[c].once||r&&a[c].context!==r)&&l.push(a[c]);l.length?this._events[o]=l.length===1?l[0]:l:En(this,o)}return this},"removeListener");ne.prototype.removeAllListeners=s(function(t){var i;return t?(i=ae?ae+t:t,this._events[i]&&En(this,i)):(this._events=new yr,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=ae;ne.EventEmitter=ne;typeof Is<"u"&&(Is.exports=ne)});var Ew={};xr(Ew,{Async:()=>jn,AsyncTransaction:()=>$n,BigIntStats:()=>he,BigIntStatsFs:()=>Di,Dir:()=>Et,Dirent:()=>St,Errno:()=>M,ErrnoError:()=>d,Fetch:()=>mw,FetchFS:()=>Cn,File:()=>Tt,FileSystem:()=>de,InMemory:()=>zi,InMemoryStore:()=>Ir,Index:()=>On,IndexFS:()=>Er,Inode:()=>Ue,MutexLock:()=>Rn,Mutexed:()=>Ys,NoSyncFile:()=>ti,Overlay:()=>gw,OverlayFS:()=>_r,Port:()=>lw,PortFS:()=>Tn,PortFile:()=>Vi,PreloadFile:()=>me,ReadStream:()=>Ft,Readonly:()=>Gs,SimpleAsyncStore:()=>zn,SimpleTransaction:()=>ri,Stats:()=>X,StatsCommon:()=>Li,StatsFs:()=>Bi,StoreFS:()=>ji,Sync:()=>ww,SyncTransaction:()=>$i,Transaction:()=>qi,UnmutexedOverlayFS:()=>Nn,WriteStream:()=>It,ZenFsType:()=>Un,_InMemory:()=>oa,_Port:()=>cd,_toUnixTimestamp:()=>Jd,access:()=>zu,accessSync:()=>Ga,appendFile:()=>Su,appendFileSync:()=>Ra,attachFS:()=>ad,checkOptions:()=>Kn,chmod:()=>Wu,chmodSync:()=>za,chown:()=>Du,chownSync:()=>qa,close:()=>_u,closeSync:()=>wt,configure:()=>aw,configureSingle:()=>sw,constants:()=>At,copyFile:()=>Qu,copyFileSync:()=>fo,cp:()=>id,cpSync:()=>uo,createReadStream:()=>Ku,createWriteStream:()=>Yu,decode:()=>ii,decodeDirListing:()=>Fr,default:()=>Sw,detachFS:()=>cw,encode:()=>Te,encodeDirListing:()=>Ee,errorMessages:()=>Bn,exists:()=>du,existsSync:()=>He,fchmod:()=>Au,fchmodSync:()=>Br,fchown:()=>Pu,fchownSync:()=>Lr,fdatasync:()=>vu,fdatasyncSync:()=>Da,flagToMode:()=>Ot,flagToNumber:()=>Hd,flagToString:()=>ta,fs:()=>Sr,fstat:()=>Eu,fstatSync:()=>Na,fsync:()=>ku,fsyncSync:()=>Ba,ftruncate:()=>xu,ftruncateSync:()=>La,futimes:()=>Tu,futimesSync:()=>Dr,handleRequest:()=>Hi,isAppendable:()=>st,isBackend:()=>Gi,isBackendConfig:()=>Ki,isExclusive:()=>Ui,isReadable:()=>yt,isSynchronous:()=>Gd,isTruncating:()=>Wi,isWriteable:()=>ye,lchmod:()=>Uu,lchmodSync:()=>Va,lchown:()=>Mu,lchownSync:()=>$a,levenshtein:()=>qn,link:()=>Nu,linkSync:()=>Ua,lopenSync:()=>er,lstat:()=>hu,lstatSync:()=>oo,lutimes:()=>qu,lutimesSync:()=>Ha,mkdir:()=>Cu,mkdirSync:()=>Mr,mkdirpSync:()=>ra,mkdtemp:()=>Ju,mkdtempSync:()=>Ka,mount:()=>Bt,mountObject:()=>Ji,mounts:()=>Fe,normalizeMode:()=>_e,normalizeOptions:()=>xe,normalizePath:()=>k,normalizeTime:()=>Ct,open:()=>bu,openAsBlob:()=>nd,openSync:()=>Zi,opendir:()=>td,opendirSync:()=>Ja,parseFlag:()=>D,promises:()=>wr,randomIno:()=>Mi,read:()=>Iu,readFile:()=>gu,readFileSync:()=>Nr,readSync:()=>Wa,readdir:()=>Ru,readdirSync:()=>fi,readlink:()=>Bu,readlinkSync:()=>ao,readv:()=>Zu,readvSync:()=>Ya,realpath:()=>$u,realpathSync:()=>Ve,rename:()=>uu,renameSync:()=>Ta,resolveMountConfig:()=>Ti,resolveRemoteMount:()=>fw,rm:()=>Xu,rmSync:()=>lo,rmdir:()=>Ou,rmdirSync:()=>so,rootCred:()=>qe,rootIno:()=>je,setImmediate:()=>Xd,size_max:()=>Se,stat:()=>pu,statSync:()=>Qi,statfs:()=>rd,statfsSync:()=>Qa,symlink:()=>Lu,symlinkSync:()=>ja,truncate:()=>yu,truncateSync:()=>Oa,umount:()=>li,unlink:()=>mu,unlinkSync:()=>Rr,unwatchFile:()=>Hu,utimes:()=>ju,utimesSync:()=>co,version:()=>Ks,watch:()=>Gu,watchFile:()=>Vu,write:()=>Fu,writeFile:()=>wu,writeFileSync:()=>tr,writeSync:()=>Ma,writev:()=>ed,writevSync:()=>Xa});var M=(h=>(h[h.EPERM=1]="EPERM",h[h.ENOENT=2]="ENOENT",h[h.EINTR=4]="EINTR",h[h.EIO=5]="EIO",h[h.ENXIO=6]="ENXIO",h[h.EBADF=9]="EBADF",h[h.EAGAIN=11]="EAGAIN",h[h.ENOMEM=12]="ENOMEM",h[h.EACCES=13]="EACCES",h[h.EFAULT=14]="EFAULT",h[h.ENOTBLK=15]="ENOTBLK",h[h.EBUSY=16]="EBUSY",h[h.EEXIST=17]="EEXIST",h[h.EXDEV=18]="EXDEV",h[h.ENODEV=19]="ENODEV",h[h.ENOTDIR=20]="ENOTDIR",h[h.EISDIR=21]="EISDIR",h[h.EINVAL=22]="EINVAL",h[h.ENFILE=23]="ENFILE",h[h.EMFILE=24]="EMFILE",h[h.ETXTBSY=26]="ETXTBSY",h[h.EFBIG=27]="EFBIG",h[h.ENOSPC=28]="ENOSPC",h[h.ESPIPE=29]="ESPIPE",h[h.EROFS=30]="EROFS",h[h.EMLINK=31]="EMLINK",h[h.EPIPE=32]="EPIPE",h[h.EDOM=33]="EDOM",h[h.ERANGE=34]="ERANGE",h[h.EDEADLK=35]="EDEADLK",h[h.ENAMETOOLONG=36]="ENAMETOOLONG",h[h.ENOLCK=37]="ENOLCK",h[h.ENOSYS=38]="ENOSYS",h[h.ENOTEMPTY=39]="ENOTEMPTY",h[h.ELOOP=40]="ELOOP",h[h.ENOMSG=42]="ENOMSG",h[h.EBADE=52]="EBADE",h[h.EBADR=53]="EBADR",h[h.EXFULL=54]="EXFULL",h[h.ENOANO=55]="ENOANO",h[h.EBADRQC=56]="EBADRQC",h[h.ENOSTR=60]="ENOSTR",h[h.ENODATA=61]="ENODATA",h[h.ETIME=62]="ETIME",h[h.ENOSR=63]="ENOSR",h[h.ENONET=64]="ENONET",h[h.EREMOTE=66]="EREMOTE",h[h.ENOLINK=67]="ENOLINK",h[h.ECOMM=70]="ECOMM",h[h.EPROTO=71]="EPROTO",h[h.EBADMSG=74]="EBADMSG",h[h.EOVERFLOW=75]="EOVERFLOW",h[h.EBADFD=77]="EBADFD",h[h.ESTRPIPE=86]="ESTRPIPE",h[h.ENOTSOCK=88]="ENOTSOCK",h[h.EDESTADDRREQ=89]="EDESTADDRREQ",h[h.EMSGSIZE=90]="EMSGSIZE",h[h.EPROTOTYPE=91]="EPROTOTYPE",h[h.ENOPROTOOPT=92]="ENOPROTOOPT",h[h.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",h[h.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",h[h.ENOTSUP=95]="ENOTSUP",h[h.ENETDOWN=100]="ENETDOWN",h[h.ENETUNREACH=101]="ENETUNREACH",h[h.ENETRESET=102]="ENETRESET",h[h.ETIMEDOUT=110]="ETIMEDOUT",h[h.ECONNREFUSED=111]="ECONNREFUSED",h[h.EHOSTDOWN=112]="EHOSTDOWN",h[h.EHOSTUNREACH=113]="EHOSTUNREACH",h[h.EALREADY=114]="EALREADY",h[h.EINPROGRESS=115]="EINPROGRESS",h[h.ESTALE=116]="ESTALE",h[h.EREMOTEIO=121]="EREMOTEIO",h[h.EDQUOT=122]="EDQUOT",h))(M||{}),Bn={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"},d=class e extends Error{constructor(i,r=Bn[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=M[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let r=new e(i.errno,i.message,i.path,i.syscall);return r.code=i.code,r.stack=i.stack,r}static With(i,r,n){return new e(M[i],Bn[M[i]],r,n)}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 At={};xr(At,{COPYFILE_EXCL:()=>Ni,COPYFILE_FICLONE:()=>_d,COPYFILE_FICLONE_FORCE:()=>xd,F_OK:()=>Ri,O_APPEND:()=>We,O_CREAT:()=>Z,O_DIRECT:()=>Td,O_DIRECTORY:()=>vd,O_DSYNC:()=>Pd,O_EXCL:()=>De,O_NOATIME:()=>Fd,O_NOCTTY:()=>kd,O_NOFOLLOW:()=>Id,O_NONBLOCK:()=>Od,O_RDONLY:()=>Zt,O_RDWR:()=>le,O_SYMLINK:()=>Ad,O_SYNC:()=>ei,O_TRUNC:()=>Me,O_WRONLY:()=>Be,R_OK:()=>Le,S_IFBLK:()=>rt,S_IFCHR:()=>nt,S_IFDIR:()=>ue,S_IFIFO:()=>ot,S_IFLNK:()=>Ae,S_IFMT:()=>K,S_IFREG:()=>fe,S_IFSOCK:()=>it,S_IRGRP:()=>Md,S_IROTH:()=>jd,S_IRUSR:()=>Ld,S_IRWXG:()=>Mn,S_IRWXO:()=>Wn,S_IRWXU:()=>Dn,S_ISGID:()=>Rd,S_ISUID:()=>Cd,S_ISVTX:()=>Nd,S_IWGRP:()=>Wd,S_IWOTH:()=>qd,S_IWUSR:()=>Bd,S_IXGRP:()=>Ud,S_IXOTH:()=>$d,S_IXUSR:()=>Dd,UV_FS_O_FILEMAP:()=>zd,W_OK:()=>we,X_OK:()=>Ed});var Ri=0,Le=4,we=2,Ed=1,Ni=1,_d=2,xd=4,Zt=0,Be=1,le=2,Z=64,De=128,kd=256,Me=512,We=1024,vd=65536,Fd=262144,Id=131072,ei=1052672,Pd=4096,Ad=32768,Td=16384,Od=2048,K=61440,it=49152,Ae=40960,fe=32768,rt=24576,ue=16384,nt=8192,ot=4096,Cd=2048,Rd=1024,Nd=512,Dn=448,Ld=256,Bd=128,Dd=64,Mn=56,Md=32,Wd=16,Ud=8,Wn=7,jd=4,qd=2,$d=1,zd=0;var Li=class{constructor({atimeMs:t,mtimeMs:i,ctimeMs:r,birthtimeMs:n,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 u=Date.now();this.atimeMs=this._convert(t??u),this.mtimeMs=this._convert(i??u),this.ctimeMs=this._convert(r??u),this.birthtimeMs=this._convert(n??u),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}static{s(this,"StatsCommon")}_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(t,i){if(i.euid===0||i.egid===0)return!0;let r=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(t&this.mode&r)==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}},X=class extends Li{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}},he=class extends Li{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}},Un=525687744115,Bi=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Se;this.ffree=Se}static{s(this,"StatsFs")}},Di=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Se);this.ffree=BigInt(Se)}static{s(this,"BigIntStatsFs")}};var Se=2**32-1,je=0n;function ea(){return Math.round(Math.random()*2**32).toString(16)}s(ea,"_random");function Mi(){return BigInt("0x"+ea()+ea())}s(Mi,"randomIno");var W={ino:0,size:8,mode:12,nlink:14,uid:18,gid:22,atime:26,birthtime:34,mtime:42,ctime:50,end:58};var Ue=class{static{s(this,"Inode")}get data(){return new Uint8Array(this.buffer)}constructor(t){let i=!t;if(t??=new ArrayBuffer(W.end),t?.byteLength<W.end)throw new RangeError(`Can not create an inode from a buffer less than ${W.end} bytes`);if(this.view=new DataView(t),this.buffer=t,!i)return;this.ino=Mi(),this.nlink=1,this.size=4096;let r=Date.now();this.atimeMs=r,this.mtimeMs=r,this.ctimeMs=r,this.birthtimeMs=r}get ino(){return this.view.getBigUint64(W.ino,!0)}set ino(t){this.view.setBigUint64(W.ino,t,!0)}get size(){return this.view.getUint32(W.size,!0)}set size(t){this.view.setUint32(W.size,t,!0)}get mode(){return this.view.getUint16(W.mode,!0)}set mode(t){this.view.setUint16(W.mode,t,!0)}get nlink(){return this.view.getUint32(W.nlink,!0)}set nlink(t){this.view.setUint32(W.nlink,t,!0)}get uid(){return this.view.getUint32(W.uid,!0)}set uid(t){this.view.setUint32(W.uid,t,!0)}get gid(){return this.view.getUint32(W.gid,!0)}set gid(t){this.view.setUint32(W.gid,t,!0)}get atimeMs(){return this.view.getFloat64(W.atime,!0)}set atimeMs(t){this.view.setFloat64(W.atime,t,!0)}get birthtimeMs(){return this.view.getFloat64(W.birthtime,!0)}set birthtimeMs(t){this.view.setFloat64(W.birthtime,t,!0)}get mtimeMs(){return this.view.getFloat64(W.mtime,!0)}set mtimeMs(t){this.view.setFloat64(W.mtime,t,!0)}get ctimeMs(){return this.view.getFloat64(W.ctime,!0)}set ctimeMs(t){this.view.setFloat64(W.ctime,t,!0)}toStats(){return new X(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}};Promise.withResolvers??=function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Vd=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function D(e){if(typeof e=="number")return ta(e);if(!Vd.includes(e))throw new Error("Invalid flag string: "+e);return e}s(D,"parseFlag");function ta(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(ta,"flagToString");function Hd(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(Hd,"flagToNumber");function Ot(e){let t=0;return t<<=1,t+=+yt(e),t<<=1,t+=+ye(e),t<<=1,t}s(Ot,"flagToMode");function yt(e){return e.indexOf("r")!==-1||e.indexOf("+")!==-1}s(yt,"isReadable");function ye(e){return e.indexOf("w")!==-1||e.indexOf("a")!==-1||e.indexOf("+")!==-1}s(ye,"isWriteable");function Wi(e){return e.indexOf("w")!==-1}s(Wi,"isTruncating");function st(e){return e.indexOf("a")!==-1}s(st,"isAppendable");function Gd(e){return e.indexOf("s")!==-1}s(Gd,"isSynchronous");function Ui(e){return e.indexOf("x")!==-1}s(Ui,"isExclusive");var Tt=class{static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},me=class extends Tt{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:Se}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;this.closed=!1;if(this.stats.size!=a.byteLength){if(yt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return st(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){if(this.closed)throw d.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 d.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 d.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw d.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(i){if(this.closed)throw d.With("EBADF",this.path,"File.dispose");if(this.dirty&&!i)throw d.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw d.With("EBADF",this.path,"File.stat");return Promise.resolve(new X(this.stats))}statSync(){if(this.closed)throw d.With("EBADF",this.path,"File.stat");return new X(this.stats)}_truncate(i){if(this.closed)throw d.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!ye(this.flag))throw new d(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let r=new Uint8Array(i-this._buffer.length);this.writeSync(r,0,r.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,r=0,n=this.stats.size,o=this.position){if(this.closed)throw d.With("EBADF",this.path,"File.write");if(this.dirty=!0,!ye(this.flag))throw new d(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:Se}));l.set(this._buffer),this._buffer=l}let c=i.slice(r,r+n);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,r,n,o){let a=this._write(i,r,n,o);return await this.sync(),a}writeSync(i,r=0,n=this.stats.size,o=this.position){let a=this._write(i,r,n,o);return this.syncSync(),a}_read(i,r=0,n=this.stats.size,o){if(this.closed)throw d.With("EBADF",this.path,"File.read");if(!yt(this.flag))throw new d(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,r,n).set(this._buffer.slice(o,a)),c}async read(i,r,n,o){let a=this._read(i,r,n,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,r,n,o){let a=this._read(i,r,n,o);return this.statSync(),a}async chmod(i){if(this.closed)throw d.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){if(this.closed)throw d.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){if(this.closed)throw d.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,r),await this.sync()}chownSync(i,r){if(this.closed)throw d.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){if(this.closed)throw d.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=r,await this.sync()}utimesSync(i,r){if(this.closed)throw d.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}async _setType(i){if(this.closed)throw d.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 d.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()}},ti=class extends me{static{s(this,"NoSyncFile")}constructor(t,i,r,n,o){super(t,i,r,n,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};var de=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Un}}constructor(...t){}async ready(){}async exists(t,i){try{return await this.stat(t,i),!0}catch(r){return r.code!="ENOENT"}}existsSync(t,i){try{return this.statSync(t,i),!0}catch(r){return r.code!="ENOENT"}}};var qe={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Kd="/";function ia(e,t){let i="",r=0,n=-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(!(n===c-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",r=0):(i=i.slice(0,l),r=i.length-1-i.lastIndexOf("/")),n=c,o=0;continue}else if(i.length!==0){i="",r=0,n=c,o=0;continue}}t&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+e.slice(n+1,c):i=e.slice(n+1,c),r=c-n-1;n=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(ia,"normalizeString");function mt(...e){let t="";for(let r of[...e.reverse(),Kd])if(r.length&&(t=`${r}/${t}`,r.startsWith("/")))break;let i=t.startsWith("/");return t=ia(t,!i),i?`/${t}`:t.length?t:"/"}s(mt,"resolve");function Yd(e){if(!e.length)return".";let t=e.startsWith("/"),i=e.endsWith("/");return e=ia(e,!t),e.length?(i&&(e+="/"),t?`/${e}`:e):t?"/":i?"./":"."}s(Yd,"normalize");function $(...e){if(!e.length)return".";let t=e.join("/");return t?.length?Yd(t):"."}s($,"join");function A(e){if(e.length===0)return".";let t=e[0]==="/",i=-1,r=!0;for(let n=e.length-1;n>=1;--n)if(e[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?t?"/":".":t&&i===1?"//":e.slice(0,i)}s(A,"dirname");function z(e,t){let i=0,r=-1,n=!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(!n){i=c+1;break}}else a===-1&&(n=!1,a=c+1),o>=0&&(e[c]===t[o]?--o===-1&&(r=c):(o=-1,r=a));return i===r?r=a:r===-1&&(r=e.length),e.slice(i,r)}for(let o=e.length-1;o>=0;--o)if(e[o]==="/"){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":e.slice(i,r)}s(z,"basename");function kr(e){let t=e.startsWith("/"),i={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(e.length===0)return i;let r=t?1:0,n=-1,o=0,a=-1,c=!0,l=e.length-1,f=0;for(;l>=r;--l){if(e[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),e[l]==="."?n===-1?n=l:f!==1&&(f=1):n!==-1&&(f=-1)}if(a!==-1){let u=o===0&&t?1:o;n===-1||f===0||f===1&&n===a-1&&n===o+1?i.base=i.name=e.slice(u,a):(i.name=e.slice(u,n),i.base=e.slice(u,a),i.ext=e.slice(n,a))}return o>0?i.dir=e.slice(0,o-1):t&&(i.dir="/"),i}s(kr,"parse");function jn(e){class t extends e{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{s(this,"AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(n=>{let o=s(()=>this._queueRunning?setTimeout(o):n(),"check");o()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}}}checkSync(n,o){if(this._disableSync)throw new d(95,"Sync caching has been disabled for this async file system",n,o);if(!this._sync)throw new d(95,"No sync cache is attached to this async file system",n,o)}renameSync(n,o,a){this.checkSync(n,"rename"),this._sync.renameSync(n,o,a),this.queue("rename",n,o,a)}statSync(n,o){return this.checkSync(n,"stat"),this._sync.statSync(n,o)}createFileSync(n,o,a,c){return this.checkSync(n,"createFile"),this._sync.createFileSync(n,o,a,c),this.queue("createFile",n,o,a,c),this.openFileSync(n,o,c)}openFileSync(n,o,a){this.checkSync(n,"openFile");let c=this._sync.openFileSync(n,o,a),l=c.statSync(),f=new Uint8Array(l.size);return c.readSync(f),new me(this,n,o,l,f)}unlinkSync(n,o){this.checkSync(n,"unlinkSync"),this._sync.unlinkSync(n,o),this.queue("unlink",n,o)}rmdirSync(n,o){this.checkSync(n,"rmdir"),this._sync.rmdirSync(n,o),this.queue("rmdir",n,o)}mkdirSync(n,o,a){this.checkSync(n,"mkdir"),this._sync.mkdirSync(n,o,a),this.queue("mkdir",n,o,a)}readdirSync(n,o){return this.checkSync(n,"readdir"),this._sync.readdirSync(n,o)}linkSync(n,o,a){this.checkSync(n,"link"),this._sync.linkSync(n,o,a),this.queue("link",n,o,a)}syncSync(n,o,a){this.checkSync(n,"sync"),this._sync.syncSync(n,o,a),this.queue("sync",n,o,a)}existsSync(n,o){return this.checkSync(n,"exists"),this._sync.existsSync(n,o)}async crossCopy(n){this.checkSync(n,"crossCopy");let o=await this.stat(n,qe);if(o.isDirectory()){if(n!=="/"){let b=await this.stat(n,qe);this._sync.mkdirSync(n,b.mode,b.cred())}let p=await this.readdir(n,qe);for(let b of p)await this.crossCopy($(n,b))}else{var a=[];try{let p=S(a,await this.openFile(n,D("r"),qe),!0);let b=S(a,this._sync.createFileSync(n,D("w"),o.mode,o.cred()));let m=new Uint8Array(o.size);await p.read(m);b.writeSync(m,0,o.size)}catch(c){var l=c,f=!0}finally{var u=E(a,l,f);u&&await u}}}async _next(){if(!this._queueRunning)return;let[n,...o]=this._queue.shift();await this[n](...o),await this._next()}queue(...n){this._queue.push(n),this._next()}}return t}s(jn,"Async");function ra(e,t,i,r){r.existsSync(e,i)||(ra(A(e),t,i,r),r.mkdirSync(e,t,i))}s(ra,"mkdirpSync");function vr(e,t,i,r,n){return Math.min(e+1,t+1,i+1,r===n?t:t+1)}s(vr,"_min");function qn(e,t){if(e===t)return 0;e.length>t.length&&([e,t]=[t,e]);let i=e.length,r=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(r-1);)i--,r--;let n=0;for(;n<i&&e.charCodeAt(n)===t.charCodeAt(n);)n++;if(i-=n,r-=n,i===0||r===1)return r;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=e.charCodeAt(n+b),o[b]=++b;let a,c,l,f,u;for(a=0;a+3<r;){let b=t.charCodeAt(n+(c=a)),m=t.charCodeAt(n+(l=a+1)),w=t.charCodeAt(n+(f=a+2)),g=t.charCodeAt(n+(u=a+3)),x=a+=4;for(let _=0;_<i;){let O=o[i+_],R=o[_];c=vr(R,c,l,b,O),l=vr(c,l,f,m,O),f=vr(l,f,u,w,O),x=vr(f,u,x,g,O),o[_++]=x,u=f,f=l,l=c,c=R}}let p=0;for(;a<r;){let b=t.charCodeAt(n+(c=a));p=++a;for(let m=0;m<i;m++){let w=o[m];o[m]=p=w<c||p<c?w>p?p+1:w+1:b===o[i+m]?c:c+1,c=w}}return p}s(qn,"levenshtein");var Xd=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:e=>setTimeout(e,0);function Te(e){if(typeof e!="string")throw new d(22,"Can not encode a non-string");return new Uint8Array(Array.from(e).map(t=>t.charCodeAt(0)))}s(Te,"encode");function ii(e){if(!(e instanceof Uint8Array))throw new d(22,"Can not decode a non-Uint8Array");return Array.from(e).map(t=>String.fromCharCode(t)).join("")}s(ii,"decode");function Fr(e){return JSON.parse(ii(e),(t,i)=>t==""?i:BigInt(i))}s(Fr,"decodeDirListing");function Ee(e){return Te(JSON.stringify(e,(t,i)=>t==""?i:i.toString()))}s(Ee,"encodeDirListing");function Jd(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(Jd,"_toUnixTimestamp");function _e(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 d(22,"Invalid mode: "+e?.toString())}s(_e,"normalizeMode");function Ct(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 d(22,"Invalid time.")}s(Ct,"normalizeTime");function k(e){if(e=e.toString(),e.includes("\0"))throw new d(22,"Path can not contain null character");if(e.length==0)throw new d(22,"Path can not be empty");return mt(e.replaceAll(/[/\\]+/g,"/"))}s(k,"normalizePath");function xe(e,t="utf8",i,r=0){return typeof e!="object"||e===null?{encoding:typeof e=="string"?e:t??null,flag:i,mode:r}:{encoding:typeof e?.encoding=="string"?e.encoding:t??null,flag:typeof e?.flag=="string"?e.flag:i,mode:_e("mode"in e?e?.mode:null,r)}}s(xe,"normalizeOptions");var na=5,ji=class extends de{constructor(i){super();this.store=i;this._initialized=!1}static{s(this,"StoreFS")}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,r,n){var g=[];try{let o=S(g,this.store.transaction(),!0);let a=A(i),c=z(i),l=A(r),f=z(r),u=await this.findINode(o,a),p=await this.getDirListing(o,u,a);if(!u.toStats().hasAccess(2,n))throw d.With("EACCES",i,"rename");if(!p[c])throw d.With("ENOENT",i,"rename");let b=p[c];delete p[c];if((l+"/").indexOf(i+"/")===0)throw new d(16,a);let m,w;l===a?(m=u,w=p):(m=await this.findINode(o,l),w=await this.getDirListing(o,m,l));if(w[f]){let P=await this.getINode(o,w[f],r);if(P.toStats().isFile())await o.remove(P.ino),await o.remove(w[f]);else throw d.With("EPERM",r,"rename")}w[f]=b;await o.set(u.ino,Ee(p));await o.set(m.ino,Ee(w));await o.commit()}catch(x){var _=x,O=!0}finally{var R=E(g,_,O);R&&await R}}renameSync(i,r,n){var g=[];try{let o=S(g,this.store.transaction());let a=A(i),c=z(i),l=A(r),f=z(r),u=this.findINodeSync(o,a),p=this.getDirListingSync(o,u,a);if(!u.toStats().hasAccess(2,n))throw d.With("EACCES",i,"rename");if(!p[c])throw d.With("ENOENT",i,"rename");let b=p[c];delete p[c];if((l+"/").indexOf(i+"/")==0)throw new d(16,a);let m,w;l===a?(m=u,w=p):(m=this.findINodeSync(o,l),w=this.getDirListingSync(o,m,l));if(w[f]){let R=this.getINodeSync(o,w[f],r);if(R.toStats().isFile())o.removeSync(R.ino),o.removeSync(w[f]);else throw d.With("EPERM",r,"rename")}w[f]=b;o.setSync(u.ino,Ee(p));o.setSync(m.ino,Ee(w));o.commitSync()}catch(x){var _=x,O=!0}finally{E(g,_,O)}}async stat(i,r){var c=[];try{let n=S(c,this.store.transaction(),!0);let o=await this.findINode(n,i);if(!o)throw d.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,r))throw d.With("EACCES",i,"stat");return a}catch(l){var f=l,u=!0}finally{var p=E(c,f,u);p&&await p}}statSync(i,r){var a=[];try{let n=S(a,this.store.transaction());let o=this.findINodeSync(n,i).toStats();if(!o.hasAccess(4,r))throw d.With("EACCES",i,"stat");return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async createFile(i,r,n,o){let a=await this.commitNew(i,32768,n,o,new Uint8Array(0));return new me(this,i,r,a.toStats(),new Uint8Array(0))}createFileSync(i,r,n,o){return this.commitNewSync(i,32768,n,o),this.openFileSync(i,r,o)}async openFile(i,r,n){var l=[];try{let o=S(l,this.store.transaction(),!0);let a=await this.findINode(o,i),c=await o.get(a.ino);if(!a.toStats().hasAccess(Ot(r),n))throw d.With("EACCES",i,"openFile");if(!c)throw d.With("ENOENT",i,"openFile");return new me(this,i,r,a.toStats(),c)}catch(f){var u=f,p=!0}finally{var b=E(l,u,p);b&&await b}}openFileSync(i,r,n){var l=[];try{let o=S(l,this.store.transaction());let a=this.findINodeSync(o,i),c=o.getSync(a.ino);if(!a.toStats().hasAccess(Ot(r),n))throw d.With("EACCES",i,"openFile");if(!c)throw d.With("ENOENT",i,"openFile");return new me(this,i,r,a.toStats(),c)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async unlink(i,r){return this.remove(i,!1,r)}unlinkSync(i,r){this.removeSync(i,!1,r)}async rmdir(i,r){if((await this.readdir(i,r)).length>0)throw d.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0,r)}rmdirSync(i,r){if(this.readdirSync(i,r).length>0)throw d.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0,r)}async mkdir(i,r,n){await this.commitNew(i,16384,r,n,Te("{}"))}mkdirSync(i,r,n){this.commitNewSync(i,16384,r,n,Te("{}"))}async readdir(i,r){var a=[];try{let n=S(a,this.store.transaction(),!0);let o=await this.findINode(n,i);if(!o.toStats().hasAccess(4,r))throw d.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(n,o,i))}catch(c){var l=c,f=!0}finally{var u=E(a,l,f);u&&await u}}readdirSync(i,r){var a=[];try{let n=S(a,this.store.transaction());let o=this.findINodeSync(n,i);if(!o.toStats().hasAccess(4,r))throw d.With("EACCES",i,"readdir");return Object.keys(this.getDirListingSync(n,o,i))}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async sync(i,r,n){var f=[];try{let o=S(f,this.store.transaction(),!0);let a=await this._findINode(o,A(i),z(i)),c=await this.getINode(o,a,i),l=c.update(n);await o.set(c.ino,r);l&&await o.set(a,c.data);await o.commit()}catch(u){var p=u,b=!0}finally{var m=E(f,p,b);m&&await m}}syncSync(i,r,n){var f=[];try{let o=S(f,this.store.transaction());let a=this._findINodeSync(o,A(i),z(i)),c=this.getINodeSync(o,a,i),l=c.update(n);o.setSync(c.ino,r);l&&o.setSync(a,c.data);o.commitSync()}catch(u){var p=u,b=!0}finally{E(f,p,b)}}async link(i,r,n){var m=[];try{let o=S(m,this.store.transaction(),!0);let a=A(i),c=await this.findINode(o,a);if(!c.toStats().hasAccess(4,n))throw d.With("EACCES",a,"link");let l=A(r),f=await this.findINode(o,l),u=await this.getDirListing(o,f,l);if(!f.toStats().hasAccess(2,n))throw d.With("EACCES",l,"link");let p=await this._findINode(o,a,z(i));let b=await this.getINode(o,p,i);if(!b.toStats().hasAccess(2,n))throw d.With("EACCES",r,"link");b.nlink++;u[z(r)]=p;o.setSync(p,b.data);o.setSync(f.ino,Ee(u));o.commitSync()}catch(w){var g=w,x=!0}finally{var _=E(m,g,x);_&&await _}}linkSync(i,r,n){var m=[];try{let o=S(m,this.store.transaction());let a=A(i),c=this.findINodeSync(o,a);if(!c.toStats().hasAccess(4,n))throw d.With("EACCES",a,"link");let l=A(r),f=this.findINodeSync(o,l),u=this.getDirListingSync(o,f,l);if(!f.toStats().hasAccess(2,n))throw d.With("EACCES",l,"link");let p=this._findINodeSync(o,a,z(i));let b=this.getINodeSync(o,p,i);if(!b.toStats().hasAccess(2,n))throw d.With("EACCES",r,"link");b.nlink++;u[z(r)]=p;o.setSync(p,b.data);o.setSync(f.ino,Ee(u));o.commitSync()}catch(w){var g=w,x=!0}finally{E(m,g,x)}}async checkRoot(){var n=[];try{let i=S(n,this.store.transaction(),!0);if(await i.get(je))return;let r=new Ue;r.mode=16895;await i.set(r.ino,Te("{}"));await i.set(je,r.data);await i.commit()}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}checkRootSync(){var n=[];try{let i=S(n,this.store.transaction());if(i.getSync(je))return;let r=new Ue;r.mode=16895;i.setSync(r.ino,Te("{}"));i.setSync(je,r.data);i.commitSync()}catch(o){var a=o,c=!0}finally{E(n,a,c)}}async _findINode(i,r,n,o=new Set){let a=$(r,n);if(o.has(a))throw new d(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return je;let c=r=="/"?await this.getINode(i,je,r):await this.findINode(i,r,o),l=await this.getDirListing(i,c,r);if(!(n in l))throw d.With("ENOENT",mt(r,n),"_findINode");return l[n]}_findINodeSync(i,r,n,o=new Set){let a=$(r,n);if(o.has(a))throw new d(5,"Infinite loop detected while finding inode",a);if(o.add(a),r=="/"&&n==="")return je;let c=r=="/"?this.getINodeSync(i,je,r):this.findINodeSync(i,r,o),l=this.getDirListingSync(i,c,r);if(!(n in l))throw d.With("ENOENT",mt(r,n),"_findINode");return l[n]}async findINode(i,r,n=new Set){let o=await this._findINode(i,A(r),z(r),n);return this.getINode(i,o,r)}findINodeSync(i,r,n=new Set){let o=this._findINodeSync(i,A(r),z(r),n);return this.getINodeSync(i,o,r)}async getINode(i,r,n){let o=await i.get(r);if(!o)throw d.With("ENOENT",n,"getINode");return new Ue(o.buffer)}getINodeSync(i,r,n){let o=i.getSync(r);if(!o)throw d.With("ENOENT",n,"getINode");return new Ue(o.buffer)}async getDirListing(i,r,n){if(!r.toStats().isDirectory())throw d.With("ENOTDIR",n,"getDirListing");let o=await i.get(r.ino);if(!o)throw d.With("ENOENT",n,"getDirListing");return Fr(o)}getDirListingSync(i,r,n){if(!r.toStats().isDirectory())throw d.With("ENOTDIR",n,"getDirListing");let o=i.getSync(r.ino);if(!o)throw d.With("ENOENT",n,"getDirListing");return Fr(o)}async addNew(i,r,n){for(let o=0;o<na;o++){let a=Mi();if(!await i.get(a))return await i.set(a,r),a}throw new d(28,"No inode IDs available",n,"addNewNode")}addNewSync(i,r,n){for(let o=0;o<na;o++){let a=Mi();if(!i.getSync(a))return i.setSync(a,r),a}throw new d(28,"No inode IDs available",n,"addNewNode")}async commitNew(i,r,n,o,a){var m=[];try{let c=S(m,this.store.transaction(),!0);let l=A(i),f=await this.findINode(c,l);if(!f.toStats().hasAccess(2,o))throw d.With("EACCES",i,"commitNewFile");let u=z(i),p=await this.getDirListing(c,f,l);if(i==="/")throw d.With("EEXIST",i,"commitNewFile");if(p[u])throw await c.abort(),d.With("EEXIST",i,"commitNewFile");let b=new Ue;b.ino=await this.addNew(c,a,i);b.mode=n|r;b.uid=o.uid;b.gid=o.gid;b.size=a.length;p[u]=await this.addNew(c,b.data,i);await c.set(f.ino,Ee(p));await c.commit();return b}catch(w){var g=w,x=!0}finally{var _=E(m,g,x);_&&await _}}commitNewSync(i,r,n,o,a=new Uint8Array){var m=[];try{let c=S(m,this.store.transaction());let l=A(i),f=this.findINodeSync(c,l);if(!f.toStats().hasAccess(2,o))throw d.With("EACCES",i,"commitNewFile");let u=z(i),p=this.getDirListingSync(c,f,l);if(i==="/")throw d.With("EEXIST",i,"commitNewFile");if(p[u])throw d.With("EEXIST",i,"commitNewFile");let b=new Ue;b.ino=this.addNewSync(c,a,i);b.size=a.length;b.mode=n|r;b.uid=o.uid;b.gid=o.gid;p[u]=this.addNewSync(c,b.data,i);c.setSync(f.ino,Ee(p));c.commitSync();return b}catch(w){var g=w,x=!0}finally{E(m,g,x)}}async remove(i,r,n){var b=[];try{let o=S(b,this.store.transaction(),!0);let a=A(i),c=await this.findINode(o,a),l=await this.getDirListing(o,c,a),f=z(i);if(!l[f])throw d.With("ENOENT",i,"removeEntry");let u=l[f];let p=await this.getINode(o,u,i);if(!p.toStats().hasAccess(2,n))throw d.With("EACCES",i,"removeEntry");delete l[f];if(!r&&p.toStats().isDirectory())throw d.With("EISDIR",i,"removeEntry");if(r&&!p.toStats().isDirectory())throw d.With("ENOTDIR",i,"removeEntry");await o.set(c.ino,Ee(l));--p.nlink<1&&(await o.remove(p.ino),await o.remove(u));await o.commit()}catch(m){var w=m,g=!0}finally{var x=E(b,w,g);x&&await x}}removeSync(i,r,n){var b=[];try{let o=S(b,this.store.transaction());let a=A(i),c=this.findINodeSync(o,a),l=this.getDirListingSync(o,c,a),f=z(i),u=l[f];if(!u)throw d.With("ENOENT",i,"removeEntry");let p=this.getINodeSync(o,u,i);if(!p.toStats().hasAccess(2,n))throw d.With("EACCES",i,"removeEntry");delete l[f];if(!r&&p.toStats().isDirectory())throw d.With("EISDIR",i,"removeEntry");if(r&&!p.toStats().isDirectory())throw d.With("ENOTDIR",i,"removeEntry");o.setSync(c.ino,Ee(l));--p.nlink<1&&(o.removeSync(p.ino),o.removeSync(u));o.commitSync()}catch(m){var w=m,g=!0}finally{E(b,w,g)}}};var qi=class{constructor(t){this.store=t;this.done=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}},$i=class extends qi{static{s(this,"SyncTransaction")}async get(t){return this.getSync(t)}async set(t,i){return this.setSync(t,i)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},$n=class extends qi{static{s(this,"AsyncTransaction")}getSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw d.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};var zn=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}get(t){return this.cache.get(t)}set(t,i){this.cache.set(t,i),this.queue.add(this._set(t,i))}delete(t){this.cache.delete(t),this.queue.add(this._delete(t))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[t,i]of await this.entries())this.cache.has(t)||this.cache.set(t,i);for(let t of this.queue)await t}transaction(){return new ri(this)}},ri=class extends $i{constructor(i){super(i);this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let r=this.store.get(i);return this.stashOldValue(i,r),r}setSync(i,r){return this.markModified(i),this.store.set(i,r)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){this.done=!0}abortSync(){if(this.done){for(let i of this.modifiedKeys){let r=this.originalData.get(i);r?this.store.set(i,r):this.store.delete(i)}this.done=!0}}stashOldValue(i,r){this.originalData.has(i)||this.originalData.set(i,r)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var Ir=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new ri(this)}},oa={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 ji(new Ir(e));return t.checkRootSync(),t},"create")},zi=oa;function Qd(e){return typeof e=="object"&&e!=null&&"fd"in e&&"path"in e&&"position"in e}s(Qd,"isFileData");function Vn(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}s(Vn,"isMessage");var ni=new Map;function Hn(e,{port:t,timeout:i=1e3,fs:r}={}){let n=new Error().stack.slice(6);if(!t)throw d.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);ni.set(c,{resolve:o,reject:a,fs:r}),t.postMessage({...e,_zenfs:!0,id:c,stack:n});let l=setTimeout(()=>{let f=new d(5,"RPC Failed");f.stack+=n,a(f),typeof l=="object"&&l.unref()},i)})}s(Hn,"request");function sa(e){if(!Vn(e))return;let{id:t,value:i,error:r,stack:n}=e;if(!ni.has(t)){let l=new d(5,"Invalid RPC id:"+t);throw l.stack+=n,l}let{resolve:o,reject:a,fs:c}=ni.get(t);if(r){let l=typeof i=="string"?new Error(i):d.fromJSON(i);l.stack+=n,a(l),ni.delete(t);return}if(Qd(i)){let{fd:l,path:f,position:u}=i,p=new Vi(c,l,f,u);o(p),ni.delete(t);return}o(i),ni.delete(t)}s(sa,"handleResponse");function Pr(e,t){if(!e)throw d.With("EINVAL");e["on"in e?"on":"addEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Pr,"attach");function Gn(e,t){if(!e)throw d.With("EINVAL");e["off"in e?"off":"removeEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Gn,"detach");function aa(e){let t=[],i=t.push.bind(t);return Pr(e,i),function(r){Gn(e,i);for(let n of t){let o="data"in n?n.data:n;Hi(e,r,o)}}}s(aa,"catchMessages");function Gi(e){return e!=null&&typeof e=="object"&&"isAvailable"in e&&typeof e.isAvailable=="function"&&"create"in e&&typeof e.create=="function"}s(Gi,"isBackend");async function Kn(e,t){if(typeof t!="object"||t===null)throw new d(22,"Invalid options");for(let[i,r]of Object.entries(e.options)){let n=t?.[i];if(n==null){if(!r.required)continue;let a=Object.keys(t).filter(c=>!(c in e.options)).map(c=>({str:c,distance:qn(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new d(22,`${e.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(r.type)?r.type.indexOf(typeof n)!=-1:typeof n==r.type))throw new d(22,`${e.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(r.type)?`one of {${r.type.join(", ")}}`:r.type}, but received ${typeof n}`);r.validator&&await r.validator(n)}}s(Kn,"checkOptions");function Ki(e){return e!=null&&typeof e=="object"&&"backend"in e&&Gi(e.backend)}s(Ki,"isBackendConfig");var Sr={};xr(Sr,{BigIntStatsFs:()=>Di,Dir:()=>Et,Dirent:()=>St,ReadStream:()=>Ft,Stats:()=>X,StatsFs:()=>Bi,WriteStream:()=>It,access:()=>zu,accessSync:()=>Ga,appendFile:()=>Su,appendFileSync:()=>Ra,chmod:()=>Wu,chmodSync:()=>za,chown:()=>Du,chownSync:()=>qa,close:()=>_u,closeSync:()=>wt,constants:()=>At,copyFile:()=>Qu,copyFileSync:()=>fo,cp:()=>id,cpSync:()=>uo,createReadStream:()=>Ku,createWriteStream:()=>Yu,exists:()=>du,existsSync:()=>He,fchmod:()=>Au,fchmodSync:()=>Br,fchown:()=>Pu,fchownSync:()=>Lr,fdatasync:()=>vu,fdatasyncSync:()=>Da,fstat:()=>Eu,fstatSync:()=>Na,fsync:()=>ku,fsyncSync:()=>Ba,ftruncate:()=>xu,ftruncateSync:()=>La,futimes:()=>Tu,futimesSync:()=>Dr,lchmod:()=>Uu,lchmodSync:()=>Va,lchown:()=>Mu,lchownSync:()=>$a,link:()=>Nu,linkSync:()=>Ua,lopenSync:()=>er,lstat:()=>hu,lstatSync:()=>oo,lutimes:()=>qu,lutimesSync:()=>Ha,mkdir:()=>Cu,mkdirSync:()=>Mr,mkdtemp:()=>Ju,mkdtempSync:()=>Ka,mount:()=>Bt,mountObject:()=>Ji,mounts:()=>Fe,open:()=>bu,openAsBlob:()=>nd,openSync:()=>Zi,opendir:()=>td,opendirSync:()=>Ja,promises:()=>wr,read:()=>Iu,readFile:()=>gu,readFileSync:()=>Nr,readSync:()=>Wa,readdir:()=>Ru,readdirSync:()=>fi,readlink:()=>Bu,readlinkSync:()=>ao,readv:()=>Zu,readvSync:()=>Ya,realpath:()=>$u,realpathSync:()=>Ve,rename:()=>uu,renameSync:()=>Ta,rm:()=>Xu,rmSync:()=>lo,rmdir:()=>Ou,rmdirSync:()=>so,stat:()=>pu,statSync:()=>Qi,statfs:()=>rd,statfsSync:()=>Qa,symlink:()=>Lu,symlinkSync:()=>ja,truncate:()=>yu,truncateSync:()=>Oa,umount:()=>li,unlink:()=>mu,unlinkSync:()=>Rr,unwatchFile:()=>Hu,utimes:()=>ju,utimesSync:()=>co,watch:()=>Gu,watchFile:()=>Vu,write:()=>Fu,writeFile:()=>wu,writeFileSync:()=>tr,writeSync:()=>Ma,writev:()=>ed,writevSync:()=>Xa});var zs=Ci(ve(),1);var wr={};xr(wr,{FileHandle:()=>oe,access:()=>Us,appendFile:()=>Cs,chmod:()=>Ds,chown:()=>Ls,constants:()=>At,copyFile:()=>In,cp:()=>Pn,exists:()=>Ne,lchmod:()=>Ms,lchown:()=>Bs,link:()=>Rs,lstat:()=>_n,lutimes:()=>Ws,mkdir:()=>gr,mkdtemp:()=>js,open:()=>be,opendir:()=>qs,readFile:()=>br,readdir:()=>Mt,readlink:()=>kn,realpath:()=>Re,rename:()=>Ts,rm:()=>Fn,rmdir:()=>xn,stat:()=>Ii,statfs:()=>$s,symlink:()=>Ns,truncate:()=>Os,unlink:()=>mr,utimes:()=>vn,watch:()=>ow,writeFile:()=>Ai});var Jt=Ci(ve(),1);var gt=Ci(ve(),1);var F=qe;function Aa(e){F=e}s(Aa,"setCred");var Lt=new Map,Cp=100;function Xi(e){let t=Cp++;return Lt.set(t,e),t}s(Xi,"file2fd");function U(e){if(!Lt.has(e))throw new d(9);return Lt.get(e)}s(U,"fd2file");var Fe=new Map;Bt("/",zi.create({name:"root"}));function Bt(e,t){if(e[0]!=="/"&&(e="/"+e),e=mt(e),Fe.has(e))throw new d(22,"Mount point "+e+" is already in use.");Fe.set(e,t)}s(Bt,"mount");function li(e){if(e[0]!=="/"&&(e=`/${e}`),e=mt(e),!Fe.has(e))throw new d(22,"Mount point "+e+" is already unmounted.");Fe.delete(e)}s(li,"umount");function N(e){e=k(e);let t=[...Fe].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of t)if(i.length<=e.length&&e.startsWith(i))return e=e.slice(i.length>1?i.length:0),e===""&&(e="/"),{fs:r,path:e,mountPoint:i};throw new d(5,"ZenFS not initialized with a file system")}s(N,"resolveMount");function Pa(e,t){for(let[i,r]of Object.entries(t))e=e?.replaceAll(i,r);return e}s(Pa,"fixPaths");function Y(e,t){return typeof e.stack=="string"&&(e.stack=Pa(e.stack,t)),e.message=Pa(e.message,t),e}s(Y,"fixError");function Ji(e){"/"in e&&li("/");for(let[t,i]of Object.entries(e))Bt(t,i)}s(Ji,"mountObject");function Cr(e,t){let i=e.metadata(),r=i.blockSize||4096;return{type:(t?BigInt:Number)(i.type),bsize:(t?BigInt:Number)(r),ffree:(t?BigInt:Number)(i.freeNodes||Se),files:(t?BigInt:Number)(i.totalNodes||Se),bavail:(t?BigInt:Number)(i.freeSpace/r),bfree:(t?BigInt:Number)(i.freeSpace/r),blocks:(t?BigInt:Number)(i.totalSpace/r)}}s(Cr,"_statfs");function Ta(e,t){e=k(e),t=k(t);let i=N(e),r=N(t),n={[i.path]:e,[r.path]:t};try{if(i===r)return i.fs.renameSync(i.path,r.path,F);tr(t,Nr(e)),Rr(e)}catch(o){throw Y(o,n)}}s(Ta,"renameSync");function He(e){e=k(e);try{let{fs:t,path:i}=N(Ve(e));return t.existsSync(i,F)}catch(t){if(t.errno==2)return!1;throw t}}s(He,"existsSync");function Qi(e,t){e=k(e);let{fs:i,path:r}=N(He(e)?Ve(e):e);try{let n=i.statSync(r,F);return t?.bigint?new he(n):n}catch(n){throw Y(n,{[r]:e})}}s(Qi,"statSync");function oo(e,t){e=k(e);let{fs:i,path:r}=N(e);try{let n=i.statSync(r,F);return t?.bigint?new he(n):n}catch(n){throw Y(n,{[r]:e})}}s(oo,"lstatSync");function Oa(e,t=0){var r=[];try{let i=S(r,Dt(e,"r+"));t||=0;if(t<0)throw new d(22);i.truncateSync(t)}catch(n){var o=n,a=!0}finally{E(r,o,a)}}s(Oa,"truncateSync");function Rr(e){e=k(e);let{fs:t,path:i}=N(e);try{return t.unlinkSync(i,F)}catch(r){throw Y(r,{[i]:e})}}s(Rr,"unlinkSync");function Dt(e,t,i,r=!0){e=k(e);let n=_e(i,420),o=D(t);e=r&&He(e)?Ve(e):e;let{fs:a,path:c}=N(e);if(!a.existsSync(c,F)){if(!ye(o)&&!st(o)||o=="r+")throw d.With("ENOENT",e,"_open");if(!a.statSync(A(c),F).isDirectory())throw d.With("ENOTDIR",A(e),"_open");return a.createFileSync(c,o,n,F)}let l=a.statSync(c,F);if(!l.hasAccess(n,F))throw d.With("EACCES",e,"_open");if(Ui(o))throw d.With("EEXIST",e,"_open");return Wi(o)?(a.unlinkSync(c,F),a.createFileSync(c,o,l.mode,F)):a.openFileSync(c,o,F)}s(Dt,"_openSync");function Zi(e,t,i=0){return Xi(Dt(e,t,i,!0))}s(Zi,"openSync");function er(e,t,i){return Xi(Dt(e,t,i,!1))}s(er,"lopenSync");function Ca(e,t,i){var a=[];try{let r=S(a,Dt(e,t,420,i));let n=r.statSync();let o=new Uint8Array(n.size);r.readSync(o,0,n.size,0);return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}s(Ca,"_readFileSync");function Nr(e,t={}){let i=xe(t,null,"r",420),r=D(i.flag);if(!yt(r))throw new d(22,"Flag passed to readFile must allow for reading.");let n=gt.Buffer.from(Ca(typeof e=="number"?U(e).path:e.toString(),i.flag,!0));return i.encoding?n.toString(i.encoding):n}s(Nr,"readFileSync");function tr(e,t,i={}){var c=[];try{let r=xe(i,"utf8","w+",420);let n=D(r.flag);if(!ye(n))throw new d(22,"Flag passed to writeFile must allow for writing.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?gt.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new d(22,"Data not specified");let a=S(c,Dt(typeof e=="number"?U(e).path:e.toString(),n,r.mode,!0));a.writeSync(o,0,o.byteLength,0)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}s(tr,"writeFileSync");function Ra(e,t,i={}){var c=[];try{let r=xe(i,"utf8","a",420);let n=D(r.flag);if(!st(n))throw new d(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?gt.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,Dt(typeof e=="number"?U(e).path:e.toString(),n,r.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}s(Ra,"appendFileSync");function Na(e,t){let i=U(e).statSync();return t?.bigint?new he(i):i}s(Na,"fstatSync");function wt(e){U(e).closeSync(),Lt.delete(e)}s(wt,"closeSync");function La(e,t=0){if(t||=0,t<0)throw new d(22);U(e).truncateSync(t)}s(La,"ftruncateSync");function Ba(e){U(e).syncSync()}s(Ba,"fsyncSync");function Da(e){U(e).datasyncSync()}s(Da,"fdatasyncSync");function Ma(e,t,i,r,n){let o,a,c,l;if(typeof t=="string"){l=typeof i=="number"?i:null;let u=typeof r=="string"?r:"utf8";a=0,o=gt.Buffer.from(t,u),c=o.byteLength}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=r,l=typeof n=="number"?n:null;let f=U(e);return l??=f.position,f.writeSync(o,a,c,l)}s(Ma,"writeSync");function Wa(e,t,i,r,n){let o=U(e),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(r=i.length,n=i.position),n=Number(n),isNaN(n)&&(n=o.position),o.readSync(t,a,r,n)}s(Wa,"readSync");function Lr(e,t,i){U(e).chownSync(t,i)}s(Lr,"fchownSync");function Br(e,t){let i=_e(t,-1);if(i<0)throw new d(22,"Invalid mode.");U(e).chmodSync(i)}s(Br,"fchmodSync");function Dr(e,t,i){U(e).utimesSync(Ct(t),Ct(i))}s(Dr,"futimesSync");function so(e){e=k(e);let{fs:t,path:i}=N(He(e)?Ve(e):e);try{t.rmdirSync(i,F)}catch(r){throw Y(r,{[i]:e})}}s(so,"rmdirSync");function Mr(e,t){t=typeof t=="object"?t:{mode:t};let i=_e(t?.mode,511);e=k(e),e=He(e)?Ve(e):e;let{fs:r,path:n}=N(e),o={[n]:e};try{if(!t?.recursive)return r.mkdirSync(n,i,F);let a=[];for(let c=n,l=e;!r.existsSync(c,F);c=A(c),l=A(l))a.unshift(c),o[c]=l;for(let c of a)r.mkdirSync(c,i,F);return a[0]}catch(a){throw Y(a,o)}}s(Mr,"mkdirSync");function fi(e,t){e=k(e);let{fs:i,path:r}=N(He(e)?Ve(e):e),n;try{n=i.readdirSync(r,F)}catch(o){throw Y(o,{[r]:e})}for(let o of Fe.keys()){if(!o.startsWith(e))continue;let a=o.slice(e.length);a.includes("/")||a.length==0||n.push(a)}return n.map(o=>typeof t=="object"&&t?.withFileTypes?new St(o,Qi($(e.toString(),o))):t=="buffer"||typeof t=="object"&&t?.encoding=="buffer"?gt.Buffer.from(o):o)}s(fi,"readdirSync");function Ua(e,t){e=k(e),t=k(t);let{fs:i,path:r}=N(e);try{return i.linkSync(r,t,F)}catch(n){throw Y(n,{[r]:e})}}s(Ua,"linkSync");function ja(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new d(22,"Invalid type: "+i);if(He(t))throw d.With("EEXIST",t.toString(),"symlink");tr(t,e.toString()),Dt(t,"r+",420,!1)._setTypeSync(40960)}s(ja,"symlinkSync");function ao(e,t){let i=gt.Buffer.from(Ca(e.toString(),"r",!1)),r=typeof t=="object"?t?.encoding:t;return r=="buffer"?i:i.toString(r)}s(ao,"readlinkSync");function qa(e,t,i){let r=Zi(e,"r+");Lr(r,t,i),wt(r)}s(qa,"chownSync");function $a(e,t,i){let r=er(e,"r+");Lr(r,t,i),wt(r)}s($a,"lchownSync");function za(e,t){let i=Zi(e,"r+");Br(i,t),wt(i)}s(za,"chmodSync");function Va(e,t){let i=er(e,"r+");Br(i,t),wt(i)}s(Va,"lchmodSync");function co(e,t,i){let r=Zi(e,"r+");Dr(r,t,i),wt(r)}s(co,"utimesSync");function Ha(e,t,i){let r=er(e,"r+");Dr(r,t,i),wt(r)}s(Ha,"lutimesSync");function Ve(e,t){e=k(e);let{base:i,dir:r}=kr(e),n=$(r=="/"?"/":Ve(r),i),{fs:o,path:a,mountPoint:c}=N(n);try{return o.statSync(a,F).isSymbolicLink()?Ve(c+ao(n,t).toString()):n}catch(l){throw Y(l,{[a]:n})}}s(Ve,"realpathSync");function Ga(e,t=384){if(!Qi(e).hasAccess(t,F))throw new d(13)}s(Ga,"accessSync");function lo(e,t){switch(e=k(e),Qi(e).mode&61440){case 16384:if(t?.recursive)for(let r of fi(e))lo($(e,r),t);so(e);return;case 32768:case 40960:Rr(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new d(1,"File type not supported",e,"rm")}}s(lo,"rmSync");function Ka(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",n="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Mr(n),i=="buffer"?gt.Buffer.from(n):n}s(Ka,"mkdtempSync");function fo(e,t,i){if(e=k(e),t=k(t),i&&i&1&&He(t))throw new d(17,"Destination file already exists.",t,"copyFile");tr(t,Nr(e))}s(fo,"copyFileSync");function Ya(e,t,i){let r=U(e),n=0;for(let o of t)n+=r.readSync(o,0,o.byteLength,i+n);return n}s(Ya,"readvSync");function Xa(e,t,i){let r=U(e),n=0;for(let o of t)n+=r.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+n);return n}s(Xa,"writevSync");function Ja(e,t){return e=k(e),new Et(e)}s(Ja,"opendirSync");function uo(e,t,i){e=k(e),t=k(t);let r=oo(e);if(i?.errorOnExist&&He(t))throw new d(17,"Destination file or directory already exists.",t,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new d(21,e+" is a directory (not copied)",e,"cp");Mr(t,{recursive:!0});for(let n of fi(e,{withFileTypes:!0}))i.filter&&!i.filter($(e,n.name),$(t,n.name))||uo($(e,n.name),$(t,n.name),i);break;case 32768:case 40960:fo(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new d(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&co(t,r.atime,r.mtime)}s(uo,"cpSync");function Qa(e,t){e=k(e);let{fs:i}=N(e);return Cr(i,t?.bigint)}s(Qa,"statfsSync");var St=class{constructor(t,i){this.path=t;this.stats=i}static{s(this,"Dirent")}get name(){return z(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()}},Et=class{constructor(t){this.path=t;this.closed=!1;this._entries=[]}static{s(this,"Dir")}checkClosed(){if(this.closed)throw new d(9,"Can not use closed Dir")}async _loadEntries(){this._entries??=await Mt(this.path,{withFileTypes:!0})}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return await this._loadEntries(),this._entries.length&&this._entries.shift()||null}read(t){if(!t)return this._read();this._read().then(i=>t(void 0,i))}readSync(){return this._entries??=fi(this.path,{withFileTypes:!0}),this._entries.length&&this._entries.shift()||null}[Symbol.asyncIterator](){let t=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],next:s(async function(){let i=await t._read();return i!=null?{done:!1,value:i}:(await t.close(),{done:!0,value:void 0})},"next")}}};var Sn=Ci(cu(),1);var Ft=class extends Sn.Readable{static{s(this,"ReadStream")}close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new d(5,i.toString()))}}},It=class extends Sn.Writable{static{s(this,"WriteStream")}close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new d(5,i.toString()))}}};var Ps=Ci(fu(),1);var As=class extends Ps.default{static{s(this,"Watcher")}off(t,i,r,n){return super.off(t,i,r,n)}removeListener(t,i,r,n){return super.removeListener(t,i,r,n)}setMaxListeners(){throw d.With("ENOTSUP")}getMaxListeners(){throw d.With("ENOTSUP")}prependListener(){throw d.With("ENOTSUP")}prependOnceListener(){throw d.With("ENOTSUP")}rawListeners(){throw d.With("ENOTSUP")}ref(){return this}unref(){return this}},Fi=class extends As{constructor(i){super();this.options=i}static{s(this,"FSWatcher")}close(){}};var oe=class{static{s(this,"FileHandle")}constructor(t){let i=typeof t!="number";this.fd=i?Xi(t):t,this.file=i?t:U(t)}chown(t,i){return this.file.chown(t,i)}chmod(t){let i=_e(t,-1);if(i<0)throw new d(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(t){if(t||=0,t<0)throw new d(22);return this.file.truncate(t)}utimes(t,i){return this.file.utimes(Ct(t),Ct(i))}async appendFile(t,i={}){let r=xe(i,"utf8","a",420),n=D(r.flag);if(!st(n))throw new d(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?Jt.Buffer.from(t,r.encoding):t;await this.file.write(o,0,o.length)}read(t,i,r,n){return isNaN(+n)&&(n=this.file.position),this.file.read(t,i,r,n)}async readFile(t){let i=xe(t,null,"r",292),r=D(i.flag);if(!yt(r))throw new d(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(n),0,n,0),a=Jt.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(t={}){let i=s(async n=>{try{let c=0,l=0,f=NaN;for(;f>0;){let u=await this.read(new Uint8Array(65536),0,65536,l);if(!u.bytesRead){n.close();return}if(n.enqueue(u.buffer.slice(0,u.bytesRead)),l+=u.bytesRead,++c>=1e7)throw new d(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=u.bytesRead}}catch(o){n.error(o)}},"start"),r=globalThis;if(!("ReadableStream"in r))throw new d(38,"ReadableStream is missing on globalThis");return new r.ReadableStream({start:i,type:t.type})}readLines(t){throw d.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){let i=await this.file.stat();return t?.bigint?new he(i):i}async write(t,i,r,n){let o,a,c;if(typeof t=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,o=Jt.Buffer.from(t,f),c=o.length}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=r,n=typeof n=="number"?n:null;n??=this.file.position;let l=await this.file.write(o,a,c,n);return{buffer:o,bytesWritten:l}}async writeFile(t,i={}){let r=xe(i,"utf8","w",420),n=D(r.flag);if(!ye(n))throw new d(22,"Flag passed must allow for writing.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?Jt.Buffer.from(t,r.encoding):t;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Lt.delete(this.fd)}async writev(t,i){let r=0;for(let n of t)r+=(await this.write(n,0,n.length,i+r)).bytesWritten;return{bytesWritten:r,buffers:t}}async readv(t,i){let r=0;for(let n of t)r+=(await this.read(n,0,n.byteLength,i+r)).bytesRead;return{bytesRead:r,buffers:t}}createReadStream(t){let i=new Ft({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:s(async r=>{try{let n=await this.read(new Uint8Array(r),0,r,this.file.position);i.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(n){i.destroy(n)}},"read")});return i.path=this.file.path,i}createWriteStream(t){let i={highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:s(async(n,o,a)=>{try{let{bytesWritten:c}=await this.write(n,null,o);a(c==n.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},r=new It(i);return r.path=this.file.path,r}};async function Ts(e,t){e=k(e),t=k(t);let i=N(e),r=N(t);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,F);return}await Ai(t,await br(e)),await mr(e)}catch(n){throw Y(n,{[i.path]:e,[r.path]:t})}}s(Ts,"rename");async function Ne(e){try{let{fs:t,path:i}=N(await Re(e));return await t.exists(i,F)}catch(t){if(t instanceof d&&t.code=="ENOENT")return!1;throw t}}s(Ne,"exists");async function Ii(e,t){e=k(e);let{fs:i,path:r}=N(await Ne(e)?await Re(e):e);try{let n=await i.stat(r,F);return t?.bigint?new he(n):n}catch(n){throw Y(n,{[r]:e})}}s(Ii,"stat");async function _n(e,t){e=k(e);let{fs:i,path:r}=N(e);try{let n=await i.stat(r,F);return t?.bigint?new he(n):n}catch(n){throw Y(n,{[r]:e})}}s(_n,"lstat");async function Os(e,t=0){var r=[];try{let i=S(r,await be(e,"r+"),!0);await i.truncate(t)}catch(n){var o=n,a=!0}finally{var c=E(r,o,a);c&&await c}}s(Os,"truncate");async function mr(e){e=k(e);let{fs:t,path:i}=N(e);try{await t.unlink(i,F)}catch(r){throw Y(r,{[i]:e})}}s(mr,"unlink");async function Pi(e,t,i=420,r){e=k(e);let n=_e(i,420),o=D(t);e=r&&await Ne(e)?await Re(e):e;let{fs:a,path:c}=N(e);if(!await a.exists(c,F)){if(!ye(o)&&!st(o)||o=="r+")throw d.With("ENOENT",e,"_open");let f=await a.stat(A(c),F);if(f&&!f.isDirectory())throw d.With("ENOTDIR",A(e),"_open");return new oe(await a.createFile(c,o,n,F))}if(Ui(o))throw d.With("EEXIST",e,"_open");if(!Wi(o))return new oe(await a.openFile(c,o,F));let l=await a.openFile(c,o,F);return await l.truncate(0),await l.sync(),new oe(l)}s(Pi,"_open");async function be(e,t="r",i=420){return await Pi(e,t,i,!0)}s(be,"open");async function br(e,t){var n=[];try{let i=xe(t,null,"r",420);let r=S(n,typeof e=="object"&&"fd"in e?e:await be(e,i.flag,i.mode),!0);return await r.readFile(i)}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(br,"readFile");async function Ai(e,t,i){var a=[];try{let r=xe(i,"utf8","w+",420);let n=S(a,e instanceof oe?e:await be(e.toString(),r.flag,r.mode),!0);let o=t;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new d(22,"Iterables and streams not supported",n.file.path,"writeFile");await n.writeFile(o,r)}catch(c){var l=c,f=!0}finally{var u=E(a,l,f);u&&await u}}s(Ai,"writeFile");async function Cs(e,t,i){var c=[];try{let r=xe(i,"utf8","a",420);let n=D(r.flag);if(!st(n))throw new d(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!r.encoding)throw new d(22,"Encoding not specified");let o=typeof t=="string"?Jt.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,typeof e=="object"&&"fd"in e?e:await be(e,r.flag,r.mode),!0);await a.appendFile(o,r)}catch(l){var f=l,u=!0}finally{var p=E(c,f,u);p&&await p}}s(Cs,"appendFile");async function xn(e){e=k(e),e=await Ne(e)?await Re(e):e;let{fs:t,path:i}=N(e);try{await t.rmdir(i,F)}catch(r){throw Y(r,{[i]:e})}}s(xn,"rmdir");async function gr(e,t){t=typeof t=="object"?t:{mode:t};let i=_e(t?.mode,511);e=k(e),e=await Ne(e)?await Re(e):e;let{fs:r,path:n}=N(e),o={[n]:e};try{t?.recursive||await r.mkdir(n,i,F);let a=[];for(let c=n,l=e;!await r.exists(c,F);c=A(c),l=A(l))a.unshift(c),o[c]=l;for(let c of a)await r.mkdir(c,i,F);return a[0]}catch(a){throw Y(a,o)}}s(gr,"mkdir");async function Mt(e,t){e=k(e),e=await Ne(e)?await Re(e):e;let{fs:i,path:r}=N(e),n;try{n=await i.readdir(r,F)}catch(a){throw Y(a,{[r]:e})}for(let a of Fe.keys())if(a.startsWith(e)){let c=a.slice(e.length);if(c.includes("/")||c.length==0)continue;n.push(c)}let o=[];for(let a of n)o.push(typeof t=="object"&&t?.withFileTypes?new St(a,await Ii($(e,a))):a);return o}s(Mt,"readdir");async function Rs(e,t){e=k(e),t=k(t);let{fs:i,path:r}=N(t);try{return await i.link(e,t,F)}catch(n){throw Y(n,{[r]:t})}}s(Rs,"link");async function Ns(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new d(22,"Invalid symlink type: "+i);if(await Ne(t))throw d.With("EEXIST",t.toString(),"symlink");await Ai(t,e.toString()),await(await Pi(t,"r+",420,!1)).file._setType(40960)}s(Ns,"symlink");async function kn(e,t){var o=[];try{let i=S(o,await Pi(k(e),"r",420,!1),!0);let r=await i.readFile();let n=typeof t=="object"?t?.encoding:t;return n=="buffer"?r:r.toString(n)}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}s(kn,"readlink");async function Ls(e,t,i){var n=[];try{let r=S(n,await be(e,"r+"),!0);await r.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(Ls,"chown");async function Bs(e,t,i){var n=[];try{let r=S(n,await Pi(e,"r+",420,!1),!0);await r.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(Bs,"lchown");async function Ds(e,t){var r=[];try{let i=S(r,await be(e,"r+"),!0);await i.chmod(t)}catch(n){var o=n,a=!0}finally{var c=E(r,o,a);c&&await c}}s(Ds,"chmod");async function Ms(e,t){var r=[];try{let i=S(r,await Pi(e,"r+",420,!1),!0);await i.chmod(t)}catch(n){var o=n,a=!0}finally{var c=E(r,o,a);c&&await c}}s(Ms,"lchmod");async function vn(e,t,i){var n=[];try{let r=S(n,await be(e,"r+"),!0);await r.utimes(t,i)}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(vn,"utimes");async function Ws(e,t,i){var n=[];try{let r=S(n,await Pi(e,"r+",420,!1),!0);await r.utimes(new Date(t),new Date(i))}catch(o){var a=o,c=!0}finally{var l=E(n,a,c);l&&await l}}s(Ws,"lutimes");async function Re(e,t){e=k(e);let{base:i,dir:r}=kr(e),n=$(r=="/"?"/":await Re(r),i),{fs:o,path:a,mountPoint:c}=N(n);try{return(await o.stat(a,F)).isSymbolicLink()?Re(c+await kn(n)):n}catch(l){throw Y(l,{[a]:n})}}s(Re,"realpath");function ow(e,t={}){return{[Symbol.asyncIterator](){let i=new Fi(typeof t!="string"?t:{encoding:t});function r(n){return function(){let o=Promise.withResolvers();return i.on("change",(a,c)=>{o.resolve({value:{eventType:a,filename:c},done:n})}),o.promise}}return s(r,"withDone"),{next:r(!1),return:r(!0),throw:r(!0)}}}}s(ow,"watch");async function Us(e,t=0){if(!(await Ii(e)).hasAccess(t,F))throw new d(13)}s(Us,"access");async function Fn(e,t){switch(e=k(e),(await Ii(e)).mode&61440){case 16384:if(t?.recursive)for(let r of await Mt(e))await Fn($(e,r),t);await xn(e);return;case 32768:case 40960:await mr(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new d(1,"File type not supported",e,"rm")}}s(Fn,"rm");async function js(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",n="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await gr(n),i=="buffer"?Jt.Buffer.from(n):n}s(js,"mkdtemp");async function In(e,t,i){if(e=k(e),t=k(t),i&&i&1&&await Ne(t))throw new d(17,"Destination file already exists.",t,"copyFile");await Ai(t,await br(e))}s(In,"copyFile");async function qs(e,t){e=k(e);let i=new Et(e);return await i._loadEntries(),i}s(qs,"opendir");async function Pn(e,t,i){e=k(e),t=k(t);let r=await _n(e);if(i?.errorOnExist&&await Ne(t))throw new d(17,"Destination file or directory already exists.",t,"cp");switch(r.mode&61440){case 16384:if(!i?.recursive)throw new d(21,e+" is a directory (not copied)",e,"cp");await gr(t,{recursive:!0});for(let n of await Mt(e,{withFileTypes:!0}))i.filter&&!i.filter($(e,n.name),$(t,n.name))||await Pn($(e,n.name),$(t,n.name),i);break;case 32768:case 40960:await In(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new d(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&await vn(t,r.atime,r.mtime)}s(Pn,"cp");async function $s(e,t){e=k(e);let{fs:i}=N(e);return Cr(i,t?.bigint)}s($s,"statfs");var v=s(()=>{},"nop");function uu(e,t,i=v){Ts(e,t).then(()=>i()).catch(i)}s(uu,"rename");function du(e,t=v){Ne(e).then(t).catch(()=>t(!1))}s(du,"exists");function pu(e,t,i=v){i=typeof t=="function"?t:i,Ii(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(pu,"stat");function hu(e,t,i=v){i=typeof t=="function"?t:i,_n(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(hu,"lstat");function yu(e,t=0,i=v){i=typeof t=="function"?t:i,Os(e,typeof t=="number"?t:0).then(()=>i()).catch(i)}s(yu,"truncate");function mu(e,t=v){mr(e).then(()=>t()).catch(t)}s(mu,"unlink");function bu(e,t,i,r=v){let n=_e(i,420);r=typeof i=="function"?i:r,be(e,t,n).then(o=>r(void 0,o.fd)).catch(r)}s(bu,"open");function gu(e,t,i=v){i=typeof t=="function"?t:i,br(e,typeof t=="function"?null:t).then(r=>i(void 0,r)).catch(i)}s(gu,"readFile");function wu(e,t,i,r=v){r=typeof i=="function"?i:r,Ai(e,t,typeof i!="function"?i:null).then(()=>r(void 0)).catch(r)}s(wu,"writeFile");function Su(e,t,i,r=v){let n=typeof i!="function"?i:void 0;r=typeof i=="function"?i:r,Cs(e,t,n).then(()=>r()).catch(r)}s(Su,"appendFile");function Eu(e,t,i=v){i=typeof t=="function"?t:i,U(e).stat().then(r=>i(void 0,typeof t=="object"&&t?.bigint?new he(r):r)).catch(i)}s(Eu,"fstat");function _u(e,t=v){new oe(e).close().then(()=>t()).catch(t)}s(_u,"close");function xu(e,t,i=v){let r=typeof t=="number"?t:0;i=typeof t=="function"?t:i;let n=U(e);if(r<0)throw new d(22);n.truncate(r).then(()=>i()).catch(i)}s(xu,"ftruncate");function ku(e,t=v){U(e).sync().then(()=>t()).catch(t)}s(ku,"fsync");function vu(e,t=v){U(e).datasync().then(()=>t()).catch(t)}s(vu,"fdatasync");function Fu(e,t,i,r,n,o=v){let a,c,l,f,u,p=new oe(e);if(typeof t=="string"){switch(u="utf8",typeof i){case"function":o=i;break;case"number":f=i,u=typeof r=="string"?r:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof r=="function"?r:typeof n=="function"?n:o,o(new d(22,"Invalid arguments."));return}a=zs.Buffer.from(t),c=0,l=a.length;let b=o;p.write(a,c,l,f).then(({bytesWritten:m})=>b(void 0,m,a.toString(u))).catch(b)}else{a=zs.Buffer.from(t.buffer),c=i,l=r,f=typeof n=="number"?n:null;let b=typeof n=="function"?n:o;p.write(a,c,l,f).then(({bytesWritten:m})=>b(void 0,m,a)).catch(b)}}s(Fu,"write");function Iu(e,t,i,r,n,o=v){new oe(e).read(t,i,r,n).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(Iu,"read");function Pu(e,t,i,r=v){new oe(e).chown(t,i).then(()=>r()).catch(r)}s(Pu,"fchown");function Au(e,t,i){new oe(e).chmod(t).then(()=>i()).catch(i)}s(Au,"fchmod");function Tu(e,t,i,r=v){new oe(e).utimes(t,i).then(()=>r()).catch(r)}s(Tu,"futimes");function Ou(e,t=v){xn(e).then(()=>t()).catch(t)}s(Ou,"rmdir");function Cu(e,t,i=v){gr(e,t).then(()=>i()).catch(i)}s(Cu,"mkdir");function Ru(e,t,i=v){i=typeof t=="function"?t:i,Mt(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(Ru,"readdir");function Nu(e,t,i=v){Rs(e,t).then(()=>i()).catch(i)}s(Nu,"link");function Lu(e,t,i,r=v){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Ns(e,t,n).then(()=>r()).catch(r)}s(Lu,"symlink");function Bu(e,t,i=v){i=typeof t=="function"?t:i,kn(e).then(r=>i(void 0,r)).catch(i)}s(Bu,"readlink");function Du(e,t,i,r=v){Ls(e,t,i).then(()=>r()).catch(r)}s(Du,"chown");function Mu(e,t,i,r=v){Bs(e,t,i).then(()=>r()).catch(r)}s(Mu,"lchown");function Wu(e,t,i=v){Ds(e,t).then(()=>i()).catch(i)}s(Wu,"chmod");function Uu(e,t,i=v){Ms(e,t).then(()=>i()).catch(i)}s(Uu,"lchmod");function ju(e,t,i,r=v){vn(e,t,i).then(()=>r()).catch(r)}s(ju,"utimes");function qu(e,t,i,r=v){Ws(e,t,i).then(()=>r()).catch(r)}s(qu,"lutimes");function $u(e,t,i=v){i=typeof t=="function"?t:i,Re(e,typeof t=="function"?null:t).then(r=>i(void 0,r)).catch(i)}s($u,"realpath");function zu(e,t,i=v){let r=typeof t=="number"?t:4;i=typeof t=="function"?t:i,Us(e,r).then(()=>i()).catch(i)}s(zu,"access");function Vu(e,t,i=v){throw d.With("ENOSYS",e.toString(),"watchFile")}s(Vu,"watchFile");function Hu(e,t=v){throw d.With("ENOSYS",e.toString(),"unwatchFile")}s(Hu,"unwatchFile");function Gu(e,t,i){let r=new Fi(typeof t=="object"?t:{});return i=typeof t=="function"?t:i,r.on("change",i||v),r}s(Gu,"watch");function Ku(e,t){let i=typeof t=="object"?t:{encoding:t},r,n=new Ft({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{r||=await be(e,"r",i?.mode);let a=await r.read(new Uint8Array(o),0,o,r.file.position);n.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),r.file.position+=a.bytesRead,a.bytesRead||await r.close()}catch(a){await r?.close(),n.destroy(a)}},"read"),destroy:s(function(o,a){r?.close().then(()=>a(o)).catch(a)},"destroy")});return n.path=e.toString(),n}s(Ku,"createReadStream");function Yu(e,t){let i=typeof t=="object"?t:{encoding:t},r,n=new It({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{r||=await be(e,"w",i?.mode||438),await r.write(o,0,a),c(void 0)}catch(l){await r?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),r?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){r?.close().then(()=>o()).catch(o)},"final")});return n.path=e.toString(),n}s(Yu,"createWriteStream");function Xu(e,t,i=v){i=typeof t=="function"?t:i,Fn(e,typeof t=="function"?void 0:t).then(()=>i(void 0)).catch(i)}s(Xu,"rm");function Ju(e,t,i=v){i=typeof t=="function"?t:i,js(e,typeof t!="function"?t:null).then(r=>i(void 0,r)).catch(i)}s(Ju,"mkdtemp");function Qu(e,t,i,r=v){r=typeof i=="function"?i:r,In(e,t,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(Qu,"copyFile");function Zu(e,t,i,r=v){r=typeof i=="function"?i:r,new oe(e).readv(t,typeof i=="function"?void 0:i).then(({buffers:n,bytesRead:o})=>r(void 0,o,n)).catch(r)}s(Zu,"readv");function ed(e,t,i,r=v){r=typeof i=="function"?i:r,new oe(e).writev(t,typeof i=="function"?void 0:i).then(({buffers:n,bytesWritten:o})=>r(void 0,o,n)).catch(r)}s(ed,"writev");function td(e,t,i=v){i=typeof t=="function"?t:i,qs(e,typeof t=="function"?void 0:t).then(r=>i(void 0,r)).catch(i)}s(td,"opendir");function id(e,t,i,r=v){r=typeof i=="function"?i:r,Pn(e,t,typeof i=="function"?void 0:i).then(()=>r(void 0)).catch(r)}s(id,"cp");function rd(e,t,i=v){i=typeof t=="function"?t:i,$s(e,typeof t=="function"?void 0:t).then(r=>i(void 0,r)).catch(i)}s(rd,"statfs");async function nd(e,t){let i=await be(e.toString(),"r"),r=await i.readFile();return await i.close(),new Blob([r],t)}s(nd,"openAsBlob");function od(e){return Ki(e)||Gi(e)||e instanceof de}s(od,"isMountConfig");async function Ti(e,t=0){if(typeof e!="object"||e==null)throw new d(22,"Invalid options on mount configuration");if(!od(e))throw new d(22,"Invalid mount configuration");if(e instanceof de)return e;Gi(e)&&(e={backend:e});for(let[n,o]of Object.entries(e))if(n!="backend"&&od(o)){if(t>10)throw new d(22,"Invalid configuration, too deep and possibly infinite");e[n]=await Ti(o,++t)}let{backend:i}=e;if(!await i.isAvailable())throw new d(1,"Backend not available: "+i.name);await Kn(i,e);let r=await i.create(e);return r._disableSync=e.disableAsyncCache||!1,await r.ready(),r}s(Ti,"resolveMountConfig");async function sw(e){if(!Ki(e))throw new TypeError("Invalid single mount point configuration");let t=await Ti(e);li("/"),Bt("/",t)}s(sw,"configureSingle");async function aw(e){let t="uid"in e&&e.uid||0,i="gid"in e&&e.gid||0;if(Aa({uid:t,gid:i,suid:t,sgid:i,euid:t,egid:i}),!!e.mounts){for(let[r,n]of Object.entries(e.mounts)){if(!r.startsWith("/"))throw new d(22,"Mount points must have absolute paths");Ki(n)&&(n.disableAsyncCache??=e.disableAsyncCache||!1),e.mounts[r]=await Ti(n)}Ji(e.mounts)}}s(aw,"configure");var Vi=class extends Tt{constructor(i,r,n,o){super();this.fs=i;this.fd=r;this.path=n;this.position=o}static{s(this,"PortFile")}rpc(i,...r){return Hn({scope:"file",fd:this.fd,method:i,args:r},this.fs.options)}_throwNoSync(i){throw new d(95,"Syncrohnous operations not support on PortFile",this.path,i)}stat(){return this.rpc("stat")}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,r,n,o){return this.rpc("write",i,r,n,o)}writeSync(){this._throwNoSync("write")}async read(i,r,n,o){return await this.rpc("read",i,r,n,o)}readSync(){this._throwNoSync("read")}chown(i,r){return this.rpc("chown",i,r)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,r){return this.rpc("utimes",i,r)}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")}},Tn=class extends jn(de){constructor(i){super();this.options=i;this._sync=zi.create({name:"port-tmpfs"});this.port=i.port,Pr(this.port,sa)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...r){return Hn({scope:"fs",method:i,args:r},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,r,n){return this.rpc("rename",i,r,n)}async stat(i,r){return new X(await this.rpc("stat",i,r))}sync(i,r,n){return this.rpc("sync",i,r,n)}openFile(i,r,n){return this.rpc("openFile",i,r,n)}createFile(i,r,n,o){return this.rpc("createFile",i,r,n,o)}unlink(i,r){return this.rpc("unlink",i,r)}rmdir(i,r){return this.rpc("rmdir",i,r)}mkdir(i,r,n){return this.rpc("mkdir",i,r,n)}readdir(i,r){return this.rpc("readdir",i,r)}exists(i,r){return this.rpc("exists",i,r)}link(i,r,n){return this.rpc("link",i,r,n)}},sd=0,An=new Map;async function Hi(e,t,i){if(!Vn(i))return;let{method:r,args:n,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await t[r](...n),l instanceof Tt&&(An.set(++sd,l),l={fd:sd,path:l.path,position:l.position});break;case"file":let{fd:u}=i;if(!An.has(u))throw new d(9);l=await An.get(u)[r](...n),r=="close"&&An.delete(u);break;default:return}}catch(u){l=u instanceof d?u.toJSON():u.toString(),f=!0}e.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:r,stack:c,value:l})}s(Hi,"handleRequest");function ad(e,t){Pr(e,i=>Hi(e,t,i))}s(ad,"attachFS");function cw(e,t){Gn(e,i=>Hi(e,t,i))}s(cw,"detachFS");var cd={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 d(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 Tn(e)},"create")},lw=cd;async function fw(e,t,i=0){let r=aa(e),n=await Ti(t,i);return ad(e,n),r(n),n}s(fw,"resolveRemoteMount");function ld(e){try{return JSON.parse(e),!0}catch{return!1}}s(ld,"isJSON");function Vs(e){return e.at(0).toUpperCase()+e.slice(1)}s(Vs,"capitalize");var Hs=Symbol("struct_init"),uw=Symbol("struct");var fd=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],ud=[...fd,...fd.map(e=>Vs(e)),"char"];function dd(e,t){return function(i,r){let n=typeof r=="object"?r.name:r;if(typeof n=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+n.toString()),n=n.toString()),!n)throw new ReferenceError("Invalid name for struct member");if(typeof i!="object")throw new TypeError("Invalid member for struct field");if(!("constructor"in i))throw new TypeError("Invalid member for struct field");let o=i.constructor;o[Hs]||=[],o[Hs].push({name:n,type:e,length:t})}}s(dd,"member");function hw(e){function t(i,r){return typeof i=="number"?dd(e,i):dd(e)(i,r)}return s(t,"_"),t}s(hw,"_member");var vx=Object.fromEntries(ud.map(e=>[e,hw(e)]));function Gs(e){class t extends e{static{s(this,"ReadonlyFS")}metadata(){return{...super.metadata(),readonly:!0}}async rename(r,n,o){throw new d(30)}renameSync(r,n,o){throw new d(30)}async createFile(r,n,o,a){throw new d(30)}createFileSync(r,n,o,a){throw new d(30)}async unlink(r,n){throw new d(30)}unlinkSync(r,n){throw new d(30)}async rmdir(r,n){throw new d(30)}rmdirSync(r,n){throw new d(30)}async mkdir(r,n,o){throw new d(30)}mkdirSync(r,n,o){throw new d(30)}async link(r,n,o){throw new d(30)}linkSync(r,n,o){throw new d(30)}async sync(r,n,o){throw new d(30)}syncSync(r,n,o){throw new d(30)}}return t}s(Gs,"Readonly");var Ks=1,On=class e extends Map{static{s(this,"Index")}files(){let t=new Map;for(let[i,r]of this)r.isFile()&&t.set(i,r);return t}toJSON(){return{version:Ks,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(t){let i=[];for(let r of this.keys())A(r)==t&&i.push(z(r));return i}fromJSON(t){if(t.version!=Ks)throw new d(22,"Index version mismatch");this.clear();for(let[i,r]of Object.entries(t.entries)){let n=new X(r);n.isDirectory()&&(n.fileData=Te(JSON.stringify(this.dirEntries(i)))),this.set(i,n)}}static parse(t){if(!ld(t))throw new d(22,"Invalid JSON");let i=JSON.parse(t),r=new e;return r.fromJSON(i),r}},Er=class extends Gs(de){constructor(i){super();this.indexData=i;this.index=new On;this._isInitialized=!1}static{s(this,"IndexFS")}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=await this.getData(i,r)}reloadFilesSync(){for(let[i,r]of this.index.files())delete r.fileData,r.fileData=this.getDataSync(i,r)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw d.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,r,n){if(ye(r))throw new d(1,i);let o=this.index.get(i);if(!o)throw d.With("ENOENT",i,"openFile");if(!o.hasAccess(Ot(r),n))throw d.With("EACCES",i,"openFile");return new ti(this,i,r,o,o.isDirectory()?o.fileData:await this.getData(i,o))}openFileSync(i,r,n){if(ye(r))throw new d(1,i);let o=this.index.get(i);if(!o)throw d.With("ENOENT",i,"openFile");if(!o.hasAccess(Ot(r),n))throw d.With("EACCES",i,"openFile");return new ti(this,i,r,o,o.isDirectory()?o.fileData:this.getDataSync(i,o))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let r=this.index.get(i);if(!r)throw d.With("ENOENT",i,"readdir");if(!r.isDirectory())throw d.With("ENOTDIR",i,"readdir");let n=JSON.parse(ii(r.fileData));if(!Array.isArray(n))throw d.With("ENODATA",i,"readdir");if(!n.every(o=>typeof o=="string"))throw d.With("ENODATA",i,"readdir");return n}};async function pd(e,t){let i=await fetch(e).catch(r=>{throw new d(5,r.message)});if(!i.ok)throw new d(5,"fetch failed: response returned code "+i.status);switch(t){case"buffer":{let r=await i.arrayBuffer().catch(n=>{throw new d(5,n.message)});return new Uint8Array(r)}case"json":return i.json().catch(r=>{throw new d(5,r.message)});default:throw new d(22,"Invalid download type: "+t)}}s(pd,"fetchFile");var Cn=class e extends Er{static{s(this,"FetchFS")}async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[t,i]of this.index.files())await this.getData(t,i)}constructor({index:t="index.json",baseUrl:i=""}){super(typeof t!="string"?t:pd(t,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:e.name,readonly:!0}}preload(t,i){let r=this.index.get(t);if(!r)throw d.With("ENOENT",t,"preloadFile");if(!r.isFile())throw d.With("EISDIR",t,"preloadFile");r.size=i.length,r.fileData=i}async getData(t,i){if(i.fileData)return i.fileData;let r=await pd(this.baseUrl+(t.startsWith("/")?t.slice(1):t),"buffer");return i.fileData=r,r}getDataSync(t,i){if(i.fileData)return i.fileData;throw new d(61,"",t,"getData")}},yw={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 Cn(e)},"create")},mw=yw;var Rn=class{constructor(t,i){this.path=t;this.previous=i;this.current=Promise.withResolvers();this._isLocked=!0}static{s(this,"MutexLock")}get isLocked(){return this._isLocked}async done(){await this.previous?.done(),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}};function Ys(e){class t extends e{constructor(){super(...arguments);this.locks=new Map}static{s(this,"MutexedFS")}addLock(n){let o=this.locks.get(n),a=new Rn(n,o?.isLocked?o:void 0);return this.locks.set(n,a),a}async lock(n){let o=this.locks.get(n),a=this.addLock(n);return await o?.done(),a}lockSync(n){if(this.locks.has(n))throw d.With("EBUSY",n,"lockSync");return this.addLock(n)}isLocked(n){return!!this.locks.get(n)?.isLocked}async rename(n,o,a){var l=[];try{let c=S(l,await this.lock(n));await super.rename(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}renameSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.renameSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async stat(n,o){var c=[];try{let a=S(c,await this.lock(n));return await super.stat(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}statSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.statSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async openFile(n,o,a){var l=[];try{let c=S(l,await this.lock(n));return await super.openFile(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}openFileSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.openFileSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async createFile(n,o,a,c){var f=[];try{let l=S(f,await this.lock(n));return await super.createFile(n,o,a,c)}catch(u){var p=u,b=!0}finally{E(f,p,b)}}createFileSync(n,o,a,c){var f=[];try{let l=S(f,this.lockSync(n));return super.createFileSync(n,o,a,c)}catch(u){var p=u,b=!0}finally{E(f,p,b)}}async unlink(n,o){var c=[];try{let a=S(c,await this.lock(n));await super.unlink(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}unlinkSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.unlinkSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async rmdir(n,o){var c=[];try{let a=S(c,await this.lock(n));await super.rmdir(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}rmdirSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.rmdirSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async mkdir(n,o,a){var l=[];try{let c=S(l,await this.lock(n));await super.mkdir(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}mkdirSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.mkdirSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async readdir(n,o){var c=[];try{let a=S(c,await this.lock(n));return await super.readdir(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}readdirSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.readdirSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async exists(n,o){var c=[];try{let a=S(c,await this.lock(n));return await super.exists(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}existsSync(n,o){var c=[];try{let a=S(c,this.lockSync(n));return super.existsSync(n,o)}catch(l){var f=l,u=!0}finally{E(c,f,u)}}async link(n,o,a){var l=[];try{let c=S(l,await this.lock(n));await super.link(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}linkSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.linkSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}async sync(n,o,a){var l=[];try{let c=S(l,await this.lock(n));await super.sync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}syncSync(n,o,a){var l=[];try{let c=S(l,this.lockSync(n));return super.syncSync(n,o,a)}catch(f){var u=f,p=!0}finally{E(l,u,p)}}}return t}s(Ys,"Mutexed");var Xs="/.deleted",Nn=class extends de{constructor({writable:i,readable:r}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this.writable=i,this.readable=r,this.writable.metadata().readonly)throw new d(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnmutexedOverlayFS")}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:_r.name}}async sync(i,r,n){let o=n.cred(0,0);await this.createParentDirectories(i,o),await this.writable.exists(i,o)||await this.writable.createFile(i,"w",420,o),await this.writable.sync(i,r,n)}syncSync(i,r,n){let o=n.cred(0,0);this.createParentDirectoriesSync(i,o),this.writable.syncSync(i,r,n)}async _initialize(){if(!this._isInitialized){try{let i=await this.writable.openFile(Xs,D("r"),qe),{size:r}=await i.stat(),{buffer:n}=await i.read(new Uint8Array(r));this._deleteLog=ii(n)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i,r){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("",r)}async rename(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{await this.writable.rename(i,r,n)}catch{if(this._deletedFiles.has(i))throw d.With("ENOENT",i,"rename")}}renameSync(i,r,n){this.checkInitialized(),this.checkPath(i),this.checkPath(r);try{this.writable.renameSync(i,r,n)}catch{if(this._deletedFiles.has(i))throw d.With("ENOENT",i,"rename")}}async stat(i,r){this.checkInitialized();try{return await this.writable.stat(i,r)}catch{if(this._deletedFiles.has(i))throw d.With("ENOENT",i,"stat");let o=new X(await this.readable.stat(i,r));return o.mode|=146,o}}statSync(i,r){this.checkInitialized();try{return this.writable.statSync(i,r)}catch{if(this._deletedFiles.has(i))throw d.With("ENOENT",i,"stat");let o=new X(this.readable.statSync(i,r));return o.mode|=146,o}}async openFile(i,r,n){if(await this.writable.exists(i,n))return this.writable.openFile(i,r,n);let o=await this.readable.openFile(i,D("r"),n),a=new X(await o.stat()),{buffer:c}=await o.read(new Uint8Array(a.size));return new me(this,i,r,a,c)}openFileSync(i,r,n){if(this.writable.existsSync(i,n))return this.writable.openFileSync(i,r,n);let o=this.readable.openFileSync(i,D("r"),n),a=new X(o.statSync()),c=new Uint8Array(a.size);return o.readSync(c),new me(this,i,r,a,c)}async createFile(i,r,n,o){return this.checkInitialized(),await this.writable.createFile(i,r,n,o),this.openFile(i,r,o)}createFileSync(i,r,n,o){return this.checkInitialized(),this.writable.createFileSync(i,r,n,o),this.openFileSync(i,r,o)}async link(i,r,n){this.checkInitialized(),await this.writable.link(i,r,n)}linkSync(i,r,n){this.checkInitialized(),this.writable.linkSync(i,r,n)}async unlink(i,r){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i,r))throw d.With("ENOENT",i,"unlink");await this.writable.exists(i,r)&&await this.writable.unlink(i,r),await this.exists(i,r)&&await this.deletePath(i,r)}unlinkSync(i,r){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i,r))throw d.With("ENOENT",i,"unlink");this.writable.existsSync(i,r)&&this.writable.unlinkSync(i,r),this.existsSync(i,r)&&this.deletePath(i,r)}async rmdir(i,r){if(this.checkInitialized(),!await this.exists(i,r))throw d.With("ENOENT",i,"rmdir");if(await this.writable.exists(i,r)&&await this.writable.rmdir(i,r),await this.exists(i,r)){if((await this.readdir(i,r)).length>0)throw d.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i,r)}}rmdirSync(i,r){if(this.checkInitialized(),!this.existsSync(i,r))throw d.With("ENOENT",i,"rmdir");if(this.writable.existsSync(i,r)&&this.writable.rmdirSync(i,r),this.existsSync(i,r)){if(this.readdirSync(i,r).length>0)throw d.With("ENOTEMPTY",i,"rmdir");this.deletePath(i,r)}}async mkdir(i,r,n){if(this.checkInitialized(),await this.exists(i,n))throw d.With("EEXIST",i,"mkdir");await this.createParentDirectories(i,n),await this.writable.mkdir(i,r,n)}mkdirSync(i,r,n){if(this.checkInitialized(),this.existsSync(i,n))throw d.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i,n),this.writable.mkdirSync(i,r,n)}async readdir(i,r){if(this.checkInitialized(),!(await this.stat(i,r)).isDirectory())throw d.With("ENOTDIR",i,"readdir");let o=[];try{o.push(...await this.writable.readdir(i,r))}catch{}try{o.push(...(await this.readable.readdir(i,r)).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}readdirSync(i,r){if(this.checkInitialized(),!this.statSync(i,r).isDirectory())throw d.With("ENOTDIR",i,"readdir");let o=[];try{o=o.concat(this.writable.readdirSync(i,r))}catch{}try{o=o.concat(this.readable.readdirSync(i,r).filter(c=>!this._deletedFiles.has(`${i}/${c}`)))}catch{}let a={};return o.filter(c=>{let l=!a[c];return a[c]=!0,l})}async deletePath(i,r){this._deletedFiles.add(i),await this.updateLog(`d${i}
|
|
3
|
+
`,r)}async updateLog(i,r){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this.writable.openFile(Xs,D("w"),r);try{await n.write(Te(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog("",r))}catch(o){this._deleteLogError=o}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let i of this._deleteLog.split(`
|
|
4
|
+
`))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new d(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==Xs)throw d.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i,r){let n=A(i),o=[];for(;!this.writable.existsSync(n,r);)o.push(n),n=A(n);o=o.reverse();for(let a of o)this.writable.mkdirSync(a,this.statSync(a,r).mode,r)}async createParentDirectories(i,r){let n=A(i),o=[];for(;!await this.writable.exists(n,r);)o.push(n),n=A(n);o=o.reverse();for(let a of o){let c=await this.stat(a,r);await this.writable.mkdir(a,c.mode,r)}}operateOnWritable(i,r){if(!this.existsSync(i,r))throw d.With("ENOENT",i,"operateOnWriteable");this.writable.existsSync(i,r)||this.copyToWritableSync(i,r)}async operateOnWritableAsync(i,r){if(!await this.exists(i,r))throw d.With("ENOENT",i,"operateOnWritable");if(!await this.writable.exists(i,r))return this.copyToWritable(i,r)}copyToWritableSync(i,r){let n=this.statSync(i,r);if(n.isDirectory()){this.writable.mkdirSync(i,n.mode,r);return}let o=new Uint8Array(n.size),a=this.readable.openFileSync(i,D("r"),r);a.readSync(o),a.closeSync();let c=this.writable.openFileSync(i,D("w"),r);c.writeSync(o),c.closeSync()}async copyToWritable(i,r){let n=await this.stat(i,r);if(n.isDirectory()){await this.writable.mkdir(i,n.mode,r);return}let o=new Uint8Array(n.size),a=await this.readable.openFile(i,D("r"),r);await a.read(o),await a.close();let c=await this.writable.openFile(i,D("w"),r);await c.write(o),await c.close()}},_r=class extends Ys(Nn){static{s(this,"OverlayFS")}},bw={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 _r(e)},"create")},gw=bw;function ww(e){class t extends e{static{s(this,"SyncFS")}async exists(r,n){return this.existsSync(r,n)}async rename(r,n,o){return this.renameSync(r,n,o)}async stat(r,n){return this.statSync(r,n)}async createFile(r,n,o,a){return this.createFileSync(r,n,o,a)}async openFile(r,n,o){return this.openFileSync(r,n,o)}async unlink(r,n){return this.unlinkSync(r,n)}async rmdir(r,n){return this.rmdirSync(r,n)}async mkdir(r,n,o){return this.mkdirSync(r,n,o)}async readdir(r,n){return this.readdirSync(r,n)}async link(r,n,o){return this.linkSync(r,n,o)}async sync(r,n,o){return this.syncSync(r,n,o)}}return t}s(ww,"Sync");var Sw=Sr;return Sd(Ew);})();
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
ieee754/index.js:
|