@zenfs/core 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- var ZenFS=(()=>{var ou=Object.create;var yi=Object.defineProperty;var su=Object.getOwnPropertyDescriptor;var au=Object.getOwnPropertyNames;var lu=Object.getPrototypeOf,cu=Object.prototype.hasOwnProperty;var s=(t,e)=>yi(t,"name",{value:e,configurable:!0});var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),er=(t,e)=>{for(var i in e)yi(t,i,{get:e[i],enumerable:!0})},hs=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of au(e))!cu.call(t,n)&&n!==i&&yi(t,n,{get:()=>e[n],enumerable:!(r=su(e,n))||r.enumerable});return t};var uu=(t,e,i)=>(i=t!=null?ou(lu(t)):{},hs(e||!t||!t.__esModule?yi(i,"default",{value:t,enumerable:!0}):i,t)),fu=t=>hs(yi({},"__esModule",{value:!0}),t);var Fs=N(mr=>{"use strict";mr.byteLength=Ud;mr.toByteArray=qd;mr.fromByteArray=zd;var Ce=[],be=[],Md=typeof Uint8Array<"u"?Uint8Array:Array,Hn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(bt=0,Ts=Hn.length;bt<Ts;++bt)Ce[bt]=Hn[bt],be[Hn.charCodeAt(bt)]=bt;var bt,Ts;be["-".charCodeAt(0)]=62;be["_".charCodeAt(0)]=63;function Is(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var r=i===e?0:4-i%4;return[i,r]}s(Is,"getLens");function Ud(t){var e=Is(t),i=e[0],r=e[1];return(i+r)*3/4-r}s(Ud,"byteLength");function Wd(t,e,i){return(e+i)*3/4-i}s(Wd,"_byteLength");function qd(t){var e,i=Is(t),r=i[0],n=i[1],o=new Md(Wd(t,r,n)),a=0,l=n>0?r-4:r,u;for(u=0;u<l;u+=4)e=be[t.charCodeAt(u)]<<18|be[t.charCodeAt(u+1)]<<12|be[t.charCodeAt(u+2)]<<6|be[t.charCodeAt(u+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=be[t.charCodeAt(u)]<<2|be[t.charCodeAt(u+1)]>>4,o[a++]=e&255),n===1&&(e=be[t.charCodeAt(u)]<<10|be[t.charCodeAt(u+1)]<<4|be[t.charCodeAt(u+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(qd,"toByteArray");function jd(t){return Ce[t>>18&63]+Ce[t>>12&63]+Ce[t>>6&63]+Ce[t&63]}s(jd,"tripletToBase64");function $d(t,e,i){for(var r,n=[],o=e;o<i;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(jd(r));return n.join("")}s($d,"encodeChunk");function zd(t){for(var e,i=t.length,r=i%3,n=[],o=16383,a=0,l=i-r;a<l;a+=o)n.push($d(t,a,a+o>l?l:a+o));return r===1?(e=t[i-1],n.push(Ce[e>>2]+Ce[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(Ce[e>>10]+Ce[e>>4&63]+Ce[e<<2&63]+"=")),n.join("")}s(zd,"fromByteArray")});var Ps=N(Kn=>{Kn.read=function(t,e,i,r,n){var o,a,l=n*8-r-1,u=(1<<l)-1,f=u>>1,d=-7,h=i?n-1:0,m=i?-1:1,y=t[e+h];for(h+=m,o=y&(1<<-d)-1,y>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=m,d-=8);if(o===0)o=1-f;else{if(o===u)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-f}return(y?-1:1)*a*Math.pow(2,o-r)};Kn.write=function(t,e,i,r,n,o){var a,l,u,f=o*8-n-1,d=(1<<f)-1,h=d>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:o-1,w=r?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+h>=1?e+=m/u:e+=m*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*u-1)*Math.pow(2,n),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+y]=l&255,y+=w,l/=256,n-=8);for(a=a<<n|l,f+=n;f>0;t[i+y]=a&255,y+=w,a/=256,f-=8);t[i+y-w]|=b*128}});var He=N(Jt=>{"use strict";var Gn=Fs(),Yt=Ps(),Ls=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Jt.Buffer=p;Jt.SlowBuffer=Xd;Jt.INSPECT_MAX_BYTES=50;var br=2147483647;Jt.kMaxLength=br;p.TYPED_ARRAY_SUPPORT=Vd();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Vd(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Vd,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function Ve(t){if(t>br)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}s(Ve,"createBuffer");function p(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Qn(t)}return Bs(t,e,i)}s(p,"Buffer");p.poolSize=8192;function Bs(t,e,i){if(typeof t=="string")return Kd(t,e);if(ArrayBuffer.isView(t))return Gd(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Re(t,ArrayBuffer)||t&&Re(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Re(t,SharedArrayBuffer)||t&&Re(t.buffer,SharedArrayBuffer)))return Xn(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return p.from(r,e,i);let n=Yd(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(Bs,"from");p.from=function(t,e,i){return Bs(t,e,i)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function Ds(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(Ds,"assertSize");function Hd(t,e,i){return Ds(t),t<=0?Ve(t):e!==void 0?typeof i=="string"?Ve(t).fill(e,i):Ve(t).fill(e):Ve(t)}s(Hd,"alloc");p.alloc=function(t,e,i){return Hd(t,e,i)};function Qn(t){return Ds(t),Ve(t<0?0:Zn(t)|0)}s(Qn,"allocUnsafe");p.allocUnsafe=function(t){return Qn(t)};p.allocUnsafeSlow=function(t){return Qn(t)};function Kd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=Ms(t,e)|0,r=Ve(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}s(Kd,"fromString");function Yn(t){let e=t.length<0?0:Zn(t.length)|0,i=Ve(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}s(Yn,"fromArrayLike");function Gd(t){if(Re(t,Uint8Array)){let e=new Uint8Array(t);return Xn(e.buffer,e.byteOffset,e.byteLength)}return Yn(t)}s(Gd,"fromArrayView");function Xn(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&i===void 0?r=new Uint8Array(t):i===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,i),Object.setPrototypeOf(r,p.prototype),r}s(Xn,"fromArrayBuffer");function Yd(t){if(p.isBuffer(t)){let e=Zn(t.length)|0,i=Ve(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||to(t.length)?Ve(0):Yn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Yn(t.data)}s(Yd,"fromObject");function Zn(t){if(t>=br)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+br.toString(16)+" bytes");return t|0}s(Zn,"checked");function Xd(t){return+t!=t&&(t=0),p.alloc(+t)}s(Xd,"SlowBuffer");p.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=s(function(e,i){if(Re(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Re(i,Uint8Array)&&(i=p.from(i,i.offset,i.byteLength)),!p.isBuffer(e)||!p.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let r=e.length,n=i.length;for(let o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==i[o]){r=e[o],n=i[o];break}return r<n?-1:n<r?1:0},"compare");p.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");p.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=p.allocUnsafe(i),o=0;for(r=0;r<e.length;++r){let a=e[r];if(Re(a,Uint8Array))o+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(p.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n},"concat");function Ms(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Re(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&i===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Jn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Ks(t).length;default:if(n)return r?-1:Jn(t).length;e=(""+e).toLowerCase(),n=!0}}s(Ms,"byteLength");p.byteLength=Ms;function Jd(t,e,i){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return ah(this,e,i);case"utf8":case"utf-8":return Ws(this,e,i);case"ascii":return oh(this,e,i);case"latin1":case"binary":return sh(this,e,i);case"base64":return rh(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lh(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}s(Jd,"slowToString");p.prototype._isBuffer=!0;function gt(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}s(gt,"swap");p.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)gt(this,i,i+1);return this},"swap16");p.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)gt(this,i,i+3),gt(this,i+1,i+2);return this},"swap32");p.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)gt(this,i,i+7),gt(this,i+1,i+6),gt(this,i+2,i+5),gt(this,i+3,i+4);return this},"swap64");p.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?Ws(this,0,e):Jd.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=s(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=s(function(){let e="",i=Jt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Ls&&(p.prototype[Ls]=p.prototype.inspect);p.prototype.compare=s(function(e,i,r,n,o){if(Re(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),i<0||r>e.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===e)return 0;let a=o-n,l=r-i,u=Math.min(a,l),f=this.slice(n,o),d=e.slice(i,r);for(let h=0;h<u;++h)if(f[h]!==d[h]){a=f[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function Us(t,e,i,r,n){if(t.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,to(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof e=="string"&&(e=p.from(e,r)),p.isBuffer(e))return e.length===0?-1:Cs(t,e,i,r,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):Cs(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}s(Us,"bidirectionalIndexOf");function Cs(t,e,i,r,n){let o=1,a=t.length,l=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function u(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(u,"read");let f;if(n){let d=-1;for(f=i;f<a;f++)if(u(t,f)===u(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===l)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+l>a&&(i=a-l),f=i;f>=0;f--){let d=!0;for(let h=0;h<l;h++)if(u(t,f+h)!==u(e,h)){d=!1;break}if(d)return f}return-1}s(Cs,"arrayIndexOf");p.prototype.includes=s(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");p.prototype.indexOf=s(function(e,i,r){return Us(this,e,i,r,!0)},"indexOf");p.prototype.lastIndexOf=s(function(e,i,r){return Us(this,e,i,r,!1)},"lastIndexOf");function Qd(t,e,i,r){i=Number(i)||0;let n=t.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let o=e.length;r>o/2&&(r=o/2);let a;for(a=0;a<r;++a){let l=parseInt(e.substr(a*2,2),16);if(to(l))return a;t[i+a]=l}return a}s(Qd,"hexWrite");function Zd(t,e,i,r){return gr(Jn(e,t.length-i),t,i,r)}s(Zd,"utf8Write");function eh(t,e,i,r){return gr(dh(e),t,i,r)}s(eh,"asciiWrite");function th(t,e,i,r){return gr(Ks(e),t,i,r)}s(th,"base64Write");function ih(t,e,i,r){return gr(hh(e,t.length-i),t,i,r)}s(ih,"ucs2Write");p.prototype.write=s(function(e,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),e.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 Qd(this,e,i,r);case"utf8":case"utf-8":return Zd(this,e,i,r);case"ascii":case"latin1":case"binary":return eh(this,e,i,r);case"base64":return th(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ih(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function rh(t,e,i){return e===0&&i===t.length?Gn.fromByteArray(t):Gn.fromByteArray(t.slice(e,i))}s(rh,"base64Slice");function Ws(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let o=t[n],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=i){let u,f,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:u=t[n+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(a=h));break;case 3:u=t[n+1],f=t[n+2],(u&192)===128&&(f&192)===128&&(h=(o&15)<<12|(u&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:u=t[n+1],f=t[n+2],d=t[n+3],(u&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(u&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=l}return nh(r)}s(Ws,"utf8Slice");var Rs=4096;function nh(t){let e=t.length;if(e<=Rs)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=Rs));return i}s(nh,"decodeCodePointsArray");function oh(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]&127);return r}s(oh,"asciiSlice");function sh(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}s(sh,"latin1Slice");function ah(t,e,i){let r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let o=e;o<i;++o)n+=ph[t[o]];return n}s(ah,"hexSlice");function lh(t,e,i){let r=t.slice(e,i),n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}s(lh,"utf16leSlice");p.prototype.slice=s(function(e,i){let r=this.length;e=~~e,i=i===void 0?r:~~i,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<e&&(i=e);let n=this.subarray(e,i);return Object.setPrototypeOf(n,p.prototype),n},"slice");function Y(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(Y,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||Y(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||Y(e,i,this.length);let n=this[e+--i],o=1;for(;i>0&&(o*=256);)n+=this[e+--i]*o;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||Y(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||Y(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||Y(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Mi(e,this.length-8);let n=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Mi(e,this.length-8);let n=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));p.prototype.readIntLE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||Y(e,i,this.length);let n=this[e],o=1,a=0;for(;++a<i&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*i)),n},"readIntLE");p.prototype.readIntBE=s(function(e,i,r){e=e>>>0,i=i>>>0,r||Y(e,i,this.length);let n=i,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");p.prototype.readInt8=s(function(e,i){return e=e>>>0,i||Y(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||Y(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");p.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||Y(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");p.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Mi(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=lt(s(function(e){e=e>>>0,Xt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Mi(e,this.length-8);let n=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)},"readBigInt64BE"));p.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),Yt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),Yt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||Y(e,8,this.length),Yt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||Y(e,8,this.length),Yt.read(this,e,!1,52,8)},"readDoubleBE");function se(t,e,i,r,n,o){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}s(se,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;se(this,e,i,r,l,0)}let o=1,a=0;for(this[i]=e&255;++a<r&&(o*=256);)this[i+a]=e/o&255;return i+r},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;se(this,e,i,r,l,0)}let o=r-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+r},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function qs(t,e,i,r,n){Hs(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(qs,"wrtBigUInt64LE");function js(t,e,i,r,n){Hs(e,r,n,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(js,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=lt(s(function(e,i=0){return qs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=lt(s(function(e,i=0){return js(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let u=Math.pow(2,8*r-1);se(this,e,i,r,u-1,-u)}let o=0,a=1,l=0;for(this[i]=e&255;++o<r&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+r},"writeIntLE");p.prototype.writeIntBE=s(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let u=Math.pow(2,8*r-1);se(this,e,i,r,u-1,-u)}let o=r-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+r},"writeIntBE");p.prototype.writeInt8=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");p.prototype.writeInt16LE=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");p.prototype.writeInt16BE=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");p.prototype.writeInt32LE=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");p.prototype.writeInt32BE=s(function(e,i,r){return e=+e,i=i>>>0,r||se(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");p.prototype.writeBigInt64LE=lt(s(function(e,i=0){return qs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=lt(s(function(e,i=0){return js(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function $s(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s($s,"checkIEEE754");function zs(t,e,i,r,n){return e=+e,i=i>>>0,n||$s(t,e,i,4,34028234663852886e22,-34028234663852886e22),Yt.write(t,e,i,r,23,4),i+4}s(zs,"writeFloat");p.prototype.writeFloatLE=s(function(e,i,r){return zs(this,e,i,!0,r)},"writeFloatLE");p.prototype.writeFloatBE=s(function(e,i,r){return zs(this,e,i,!1,r)},"writeFloatBE");function Vs(t,e,i,r,n){return e=+e,i=i>>>0,n||$s(t,e,i,8,17976931348623157e292,-17976931348623157e292),Yt.write(t,e,i,r,52,8),i+8}s(Vs,"writeDouble");p.prototype.writeDoubleLE=s(function(e,i,r){return Vs(this,e,i,!0,r)},"writeDoubleLE");p.prototype.writeDoubleBE=s(function(e,i,r){return Vs(this,e,i,!1,r)},"writeDoubleBE");p.prototype.copy=s(function(e,i,r,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=e.length&&(i=e.length),i||(i=0),n>0&&n<r&&(n=r),n===r||e.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),e.length-i<n-r&&(n=e.length-i+r);let o=n-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),i),o},"copy");p.prototype.fill=s(function(e,i,r,n){if(typeof e=="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"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(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,e||(e=0);let o;if(typeof e=="number")for(o=i;o<r;++o)this[o]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-i;++o)this[o+i]=a[o%l]}return this},"fill");var Gt={};function eo(t,e,i){Gt[t]=s(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(eo,"E");eo("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);eo("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);eo("ERR_OUT_OF_RANGE",function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Os(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=Os(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function Os(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Os,"addNumericalSeparator");function ch(t,e,i){Xt(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Mi(e,t.length-(i+1))}s(ch,"checkBounds");function Hs(t,e,i,r,n,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new Gt.ERR_OUT_OF_RANGE("value",l,t)}ch(r,n,o)}s(Hs,"checkIntBI");function Xt(t,e){if(typeof t!="number")throw new Gt.ERR_INVALID_ARG_TYPE(e,"number",t)}s(Xt,"validateNumber");function Mi(t,e,i){throw Math.floor(t)!==t?(Xt(t,i),new Gt.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new Gt.ERR_BUFFER_OUT_OF_BOUNDS:new Gt.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Mi,"boundsError");var uh=/[^+/0-9A-Za-z-_]/g;function fh(t){if(t=t.split("=")[0],t=t.trim().replace(uh,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(fh,"base64clean");function Jn(t,e){e=e||1/0;let i,r=t.length,n=null,o=[];for(let a=0;a<r;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=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(Jn,"utf8ToBytes");function dh(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(dh,"asciiToBytes");function hh(t,e){let i,r,n,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}s(hh,"utf16leToBytes");function Ks(t){return Gn.toByteArray(fh(t))}s(Ks,"base64ToBytes");function gr(t,e,i,r){let n;for(n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}s(gr,"blitBuffer");function Re(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(Re,"isInstance");function to(t){return t!==t}s(to,"numberIsNaN");var ph=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let r=i*16;for(let n=0;n<16;++n)e[r+n]=t[i]+t[n]}return e}();function lt(t){return typeof BigInt>"u"?yh:t}s(lt,"defineBigIntMethod");function yh(){throw new Error("BigInt not supported")}s(yh,"BufferBigIntNotDefined")});var O=N((b_,Gs)=>{"use strict";Gs.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var Qt=N((g_,wr)=>{"use strict";var{AbortController:Ys,AbortSignal:mh}=typeof self<"u"?self:typeof window<"u"?window:void 0;wr.exports=Ys;wr.exports.AbortSignal=mh;wr.exports.default=Ys});var Ui=N((w_,io)=>{"use strict";var Zt=typeof Reflect=="object"?Reflect:null,Xs=Zt&&typeof Zt.apply=="function"?Zt.apply:s(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),Sr;Zt&&typeof Zt.ownKeys=="function"?Sr=Zt.ownKeys:Object.getOwnPropertySymbols?Sr=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Sr=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function bh(t){console&&console.warn&&console.warn(t)}s(bh,"ProcessEmitWarning");var Qs=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function F(){F.init.call(this)}s(F,"EventEmitter");io.exports=F;io.exports.once=_h;F.EventEmitter=F;F.prototype._events=void 0;F.prototype._eventsCount=0;F.prototype._maxListeners=void 0;var Js=10;function _r(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(_r,"checkListener");Object.defineProperty(F,"defaultMaxListeners",{enumerable:!0,get:function(){return Js},set:function(t){if(typeof t!="number"||t<0||Qs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Js=t}});F.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};F.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Qs(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function Zs(t){return t._maxListeners===void 0?F.defaultMaxListeners:t._maxListeners}s(Zs,"_getMaxListeners");F.prototype.getMaxListeners=s(function(){return Zs(this)},"getMaxListeners");F.prototype.emit=s(function(e){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var u=o[e];if(u===void 0)return!1;if(typeof u=="function")Xs(u,this,i);else for(var f=u.length,d=na(u,f),r=0;r<f;++r)Xs(d[r],this,i);return!0},"emit");function ea(t,e,i,r){var n,o,a;if(_r(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=Zs(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,bh(l)}return t}s(ea,"_addListener");F.prototype.addListener=s(function(e,i){return ea(this,e,i,!1)},"addListener");F.prototype.on=F.prototype.addListener;F.prototype.prependListener=s(function(e,i){return ea(this,e,i,!0)},"prependListener");function gh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}s(gh,"onceWrapper");function ta(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=gh.bind(r);return n.listener=i,r.wrapFn=n,n}s(ta,"_onceWrap");F.prototype.once=s(function(e,i){return _r(i),this.on(e,ta(this,e,i)),this},"once");F.prototype.prependOnceListener=s(function(e,i){return _r(i),this.prependListener(e,ta(this,e,i)),this},"prependOnceListener");F.prototype.removeListener=s(function(e,i){var r,n,o,a,l;if(_r(i),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===i||r.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,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){l=r[a].listener,o=a;break}if(o<0)return this;o===0?r.shift():wh(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");F.prototype.off=F.prototype.removeListener;F.prototype.removeAllListeners=s(function(e){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[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),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[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(n=i.length-1;n>=0;n--)this.removeListener(e,i[n]);return this},"removeAllListeners");function ia(t,e,i){var r=t._events;if(r===void 0)return[];var n=r[e];return n===void 0?[]:typeof n=="function"?i?[n.listener||n]:[n]:i?Sh(n):na(n,n.length)}s(ia,"_listeners");F.prototype.listeners=s(function(e){return ia(this,e,!0)},"listeners");F.prototype.rawListeners=s(function(e){return ia(this,e,!1)},"rawListeners");F.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ra.call(t,e)};F.prototype.listenerCount=ra;function ra(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(ra,"listenerCount");F.prototype.eventNames=s(function(){return this._eventsCount>0?Sr(this._events):[]},"eventNames");function na(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}s(na,"arrayClone");function wh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(wh,"spliceOne");function Sh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(Sh,"unwrapListeners");function _h(t,e){return new Promise(function(i,r){function n(a){t.removeListener(e,o),r(a)}s(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),i([].slice.call(arguments))}s(o,"resolver"),oa(t,e,o,{once:!0}),e!=="error"&&Eh(t,n,{once:!0})})}s(_h,"once");function Eh(t,e,i){typeof t.on=="function"&&oa(t,"error",e,i)}s(Eh,"addErrorHandlerIfEventEmitter");function oa(t,e,i,r){if(typeof t.on=="function")r.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function n(o){r.once&&t.removeEventListener(e,n),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(oa,"eventTargetAgnosticAddListener")});var Z=N((__,ro)=>{"use strict";var xh=He(),{kResistStopPropagation:vh,SymbolDispose:Ah}=O(),kh=globalThis.AbortSignal||Qt().AbortSignal,Nh=globalThis.AbortController||Qt().AbortController,Th=Object.getPrototypeOf(async function(){}).constructor,sa=globalThis.Blob||xh.Blob,Ih=s(typeof sa<"u"?function(e){return e instanceof sa}:function(e){return!1},"isBlob"),aa=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Fh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),Er=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let r=0;r<e.length;r++)i+=` ${e[r].stack}
2
- `;super(i),this.name="AggregateError",this.errors=e}};s(Er,"AggregateError");ro.exports={AggregateError:Er,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,r]){let n=e.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()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof Th},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Ih,deprecate(t,e){return t},addAbortListener:Ui().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);aa(e,"signal"),Fh(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[vh]:!0}),r=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Ah](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:kh.any||s(function(e){if(e.length===1)return e[0];let i=new Nh,r=s(()=>i.abort(),"abort");return e.forEach(n=>{aa(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};ro.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var te=N((x_,ua)=>{"use strict";var{format:Ph,inspect:vr,AggregateError:Lh}=Z(),Ch=globalThis.AggregateError||Lh,Rh=Symbol("kIsNodeError"),Oh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Bh=/^([A-Z][a-z0-9]*)+$/,Dh="__node_internal_",Ar={};function wt(t,e){if(!t)throw new Ar.ERR_INTERNAL_ASSERTION(e)}s(wt,"assert");function la(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(la,"addNumericalSeparator");function Mh(t,e,i){if(typeof e=="function")return wt(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let r=(e.match(/%[dfijoOs]/g)||[]).length;return wt(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:Ph(e,...i)}s(Mh,"getMessage");function Q(t,e,i){i||(i=Error);class r extends i{constructor(...o){super(Mh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(r,"NodeError"),Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[Rh]=!0,Ar[t]=r}s(Q,"E");function ca(t){let e=Dh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(ca,"hideStackFrames");function Uh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new Ch([e,t],e.message);return i.code=e.code,i}return t||e}s(Uh,"aggregateTwoErrors");var xr=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Ar.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};s(xr,"AbortError");Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,i)=>{wt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";t.endsWith(" argument")?r+=`${t} `:r+=`"${t}" ${t.includes(".")?"property":"argument"} `,r+="must be ";let n=[],o=[],a=[];for(let u of e)wt(typeof u=="string","All expected entries have to be of type string"),Oh.includes(u)?n.push(u.toLowerCase()):Bh.test(u)?o.push(u):(wt(u!=="object",'The value "object" should be written as "Object"'),a.push(u));if(o.length>0){let u=n.indexOf("object");u!==-1&&(n.splice(n,u,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:r+=`of type ${n[0]}`;break;case 2:r+=`one of type ${n[0]} or ${n[1]}`;break;default:{let u=n.pop();r+=`one of type ${n.join(", ")}, or ${u}`}}(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 u=o.pop();r+=`an instance of ${o.join(", ")}, or ${u}`}}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 u=a.pop();r+=`one of ${a.join(", ")}, or ${u}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)r+=`. Received an instance of ${i.constructor.name}`;else{let u=vr(i,{depth:-1});r+=`. Received ${u}`}}else{let u=vr(i,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),r+=`. Received type ${typeof i} (${u})`}return r},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=vr(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);Q("ERR_INVALID_RETURN_VALUE",(t,e,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 ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);Q("ERR_MISSING_ARGS",(...t)=>{wt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(r=>`"${r}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let r=t.pop();e+=`The ${t.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);Q("ERR_OUT_OF_RANGE",(t,e,i)=>{wt(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=la(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=la(r)),r+="n"):r=vr(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);ua.exports={AbortError:xr,aggregateTwoErrors:ca(Uh),hideStackFrames:ca,codes:Ar}});var ti=N((A_,Sa)=>{"use strict";var{ArrayIsArray:oo,ArrayPrototypeIncludes:pa,ArrayPrototypeJoin:ya,ArrayPrototypeMap:Wh,NumberIsInteger:so,NumberIsNaN:qh,NumberMAX_SAFE_INTEGER:jh,NumberMIN_SAFE_INTEGER:$h,NumberParseInt:zh,ObjectPrototypeHasOwnProperty:Vh,RegExpPrototypeExec:ma,String:Hh,StringPrototypeToUpperCase:Kh,StringPrototypeTrim:Gh}=O(),{hideStackFrames:ge,codes:{ERR_SOCKET_BAD_PORT:Yh,ERR_INVALID_ARG_TYPE:ee,ERR_INVALID_ARG_VALUE:ei,ERR_OUT_OF_RANGE:St,ERR_UNKNOWN_SIGNAL:fa}}=te(),{normalizeEncoding:Xh}=Z(),{isAsyncFunction:Jh,isArrayBufferView:Qh}=Z().types,da={};function Zh(t){return t===(t|0)}s(Zh,"isInt32");function ep(t){return t===t>>>0}s(ep,"isUint32");var tp=/^[0-7]+$/,ip="must be a 32-bit unsigned integer or an octal string";function rp(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(ma(tp,t)===null)throw new ei(e,t,ip);t=zh(t,8)}return ba(t,e),t}s(rp,"parseFileMode");var np=ge((t,e,i=$h,r=jh)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!so(t))throw new St(e,"an integer",t);if(t<i||t>r)throw new St(e,`>= ${i} && <= ${r}`,t)}),op=ge((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!so(t))throw new St(e,"an integer",t);if(t<i||t>r)throw new St(e,`>= ${i} && <= ${r}`,t)}),ba=ge((t,e,i=!1)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!so(t))throw new St(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new St(e,`>= ${r} && <= ${n}`,t)});function ao(t,e){if(typeof t!="string")throw new ee(e,"string",t)}s(ao,"validateString");function sp(t,e,i=void 0,r){if(typeof t!="number")throw new ee(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&qh(t))throw new St(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}s(sp,"validateNumber");var ap=ge((t,e,i)=>{if(!pa(i,t)){let n="must be one of: "+ya(Wh(i,o=>typeof o=="string"?`'${o}'`:Hh(o)),", ");throw new ei(e,t,n)}});function ga(t,e){if(typeof t!="boolean")throw new ee(e,"boolean",t)}s(ga,"validateBoolean");function no(t,e,i){return t==null||!Vh(t,e)?i:t[e]}s(no,"getOwnPropertyValueOrDefault");var lp=ge((t,e,i=null)=>{let r=no(i,"allowArray",!1),n=no(i,"allowFunction",!1);if(!no(i,"nullable",!1)&&t===null||!r&&oo(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new ee(e,"Object",t)}),cp=ge((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ee(e,"a dictionary",t)}),kr=ge((t,e,i=0)=>{if(!oo(t))throw new ee(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new ei(e,t,r)}});function up(t,e){kr(t,e);for(let i=0;i<t.length;i++)ao(t[i],`${e}[${i}]`)}s(up,"validateStringArray");function fp(t,e){kr(t,e);for(let i=0;i<t.length;i++)ga(t[i],`${e}[${i}]`)}s(fp,"validateBooleanArray");function dp(t,e){kr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new ee(n,"AbortSignal",r);wa(r,n)}}s(dp,"validateAbortSignalArray");function hp(t,e="signal"){if(ao(t,e),da[t]===void 0)throw da[Kh(t)]!==void 0?new fa(t+" (signals must use all capital letters)"):new fa(t)}s(hp,"validateSignalName");var pp=ge((t,e="buffer")=>{if(!Qh(t))throw new ee(e,["Buffer","TypedArray","DataView"],t)});function yp(t,e){let i=Xh(e),r=t.length;if(i==="hex"&&r%2!==0)throw new ei("encoding",e,`is invalid for data of length ${r}`)}s(yp,"validateEncoding");function mp(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Gh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Yh(e,t,i);return t|0}s(mp,"validatePort");var wa=ge((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ee(e,"AbortSignal",t)}),bp=ge((t,e)=>{if(typeof t!="function")throw new ee(e,"Function",t)}),gp=ge((t,e)=>{if(typeof t!="function"||Jh(t))throw new ee(e,"Function",t)}),wp=ge((t,e)=>{if(t!==void 0)throw new ee(e,"undefined",t)});function Sp(t,e,i){if(!pa(i,t))throw new ee(e,`('${ya(i,"|")}')`,t)}s(Sp,"validateUnion");var _p=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ha(t,e){if(typeof t>"u"||!ma(_p,t))throw new ei(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(ha,"validateLinkHeaderFormat");function Ep(t){if(typeof t=="string")return ha(t,"hints"),t;if(oo(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];ha(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new ei("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Ep,"validateLinkHeaderValue");Sa.exports={isInt32:Zh,isUint32:ep,parseFileMode:rp,validateArray:kr,validateStringArray:up,validateBooleanArray:fp,validateAbortSignalArray:dp,validateBoolean:ga,validateBuffer:pp,validateDictionary:cp,validateEncoding:yp,validateFunction:bp,validateInt32:op,validateInteger:np,validateNumber:sp,validateObject:lp,validateOneOf:ap,validatePlainFunction:gp,validatePort:mp,validateSignalName:hp,validateString:ao,validateUint32:ba,validateUndefined:wp,validateUnion:Sp,validateAbortSignal:wa,validateLinkHeaderValue:Ep}});var ct=N((N_,va)=>{var q=va.exports={},Oe,Be;function lo(){throw new Error("setTimeout has not been defined")}s(lo,"defaultSetTimout");function co(){throw new Error("clearTimeout has not been defined")}s(co,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Oe=setTimeout:Oe=lo}catch{Oe=lo}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=co}catch{Be=co}})();function _a(t){if(Oe===setTimeout)return setTimeout(t,0);if((Oe===lo||!Oe)&&setTimeout)return Oe=setTimeout,setTimeout(t,0);try{return Oe(t,0)}catch{try{return Oe.call(null,t,0)}catch{return Oe.call(this,t,0)}}}s(_a,"runTimeout");function xp(t){if(Be===clearTimeout)return clearTimeout(t);if((Be===co||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(t);try{return Be(t)}catch{try{return Be.call(null,t)}catch{return Be.call(this,t)}}}s(xp,"runClearTimeout");var Ke=[],ii=!1,_t,Nr=-1;function vp(){!ii||!_t||(ii=!1,_t.length?Ke=_t.concat(Ke):Nr=-1,Ke.length&&Ea())}s(vp,"cleanUpNextTick");function Ea(){if(!ii){var t=_a(vp);ii=!0;for(var e=Ke.length;e;){for(_t=Ke,Ke=[];++Nr<e;)_t&&_t[Nr].run();Nr=-1,e=Ke.length}_t=null,ii=!1,xp(t)}}s(Ea,"drainQueue");q.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];Ke.push(new xa(t,e)),Ke.length===1&&!ii&&_a(Ea)};function xa(t,e){this.fun=t,this.array=e}s(xa,"Item");xa.prototype.run=function(){this.fun.apply(null,this.array)};q.title="browser";q.browser=!0;q.env={};q.argv=[];q.version="";q.versions={};function Ge(){}s(Ge,"noop");q.on=Ge;q.addListener=Ge;q.once=Ge;q.off=Ge;q.removeListener=Ge;q.removeAllListeners=Ge;q.emit=Ge;q.prependListener=Ge;q.prependOnceListener=Ge;q.listeners=function(t){return[]};q.binding=function(t){throw new Error("process.binding is not supported")};q.cwd=function(){return"/"};q.chdir=function(t){throw new Error("process.chdir is not supported")};q.umask=function(){return 0}});var Me=N((I_,Ua)=>{"use strict";var{SymbolAsyncIterator:Aa,SymbolIterator:ka,SymbolFor:Et}=O(),Na=Et("nodejs.stream.destroyed"),Ta=Et("nodejs.stream.errored"),uo=Et("nodejs.stream.readable"),fo=Et("nodejs.stream.writable"),Ia=Et("nodejs.stream.disturbed"),Ap=Et("nodejs.webstream.isClosedPromise"),kp=Et("nodejs.webstream.controllerErrorFunction");function Tr(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s(Tr,"isReadableNodeStream");function Ir(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(Ir,"isWritableNodeStream");function Np(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(Np,"isDuplexNodeStream");function De(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(De,"isNodeStream");function Fa(t){return!!(t&&!De(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(Fa,"isReadableStream");function Pa(t){return!!(t&&!De(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(Pa,"isWritableStream");function La(t){return!!(t&&!De(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(La,"isTransformStream");function Tp(t){return Fa(t)||Pa(t)||La(t)}s(Tp,"isWebStream");function Ip(t,e){return t==null?!1:e===!0?typeof t[Aa]=="function":e===!1?typeof t[ka]=="function":typeof t[Aa]=="function"||typeof t[ka]=="function"}s(Ip,"isIterable");function Fr(t){if(!De(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[Na]||r!=null&&r.destroyed)}s(Fr,"isDestroyed");function Ca(t){if(!Ir(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ca,"isWritableEnded");function Fp(t,e){if(!Ir(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(Fp,"isWritableFinished");function Pp(t){if(!Tr(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Pp,"isReadableEnded");function Ra(t,e){if(!Tr(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(Ra,"isReadableFinished");function Oa(t){return t&&t[uo]!=null?t[uo]:typeof t?.readable!="boolean"?null:Fr(t)?!1:Tr(t)&&t.readable&&!Ra(t)}s(Oa,"isReadable");function Ba(t){return t&&t[fo]!=null?t[fo]:typeof t?.writable!="boolean"?null:Fr(t)?!1:Ir(t)&&t.writable&&!Ca(t)}s(Ba,"isWritable");function Lp(t,e){return De(t)?Fr(t)?!0:!(e?.readable!==!1&&Oa(t)||e?.writable!==!1&&Ba(t)):null}s(Lp,"isFinished");function Cp(t){var e,i;return De(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Cp,"isWritableErrored");function Rp(t){var e,i;return De(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Rp,"isReadableErrored");function Op(t){if(!De(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&Da(t)?t._closed:null}s(Op,"isClosed");function Da(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(Da,"isOutgoingMessage");function Ma(t){return typeof t._sent100=="boolean"&&Da(t)}s(Ma,"isServerResponse");function Bp(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(Bp,"isServerRequest");function Dp(t){if(!De(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Ma(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}s(Dp,"willEmitClose");function Mp(t){var e;return!!(t&&((e=t[Ia])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Mp,"isDisturbed");function Up(t){var e,i,r,n,o,a,l,u,f,d;return!!(t&&((e=(i=(r=(n=(o=(a=t[Ta])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(Up,"isErrored");Ua.exports={isDestroyed:Fr,kIsDestroyed:Na,isDisturbed:Mp,kIsDisturbed:Ia,isErrored:Up,kIsErrored:Ta,isReadable:Oa,kIsReadable:uo,kIsClosedPromise:Ap,kControllerErrorFunction:kp,kIsWritable:fo,isClosed:Op,isDuplexNodeStream:Np,isFinished:Lp,isIterable:Ip,isReadableNodeStream:Tr,isReadableStream:Fa,isReadableEnded:Pp,isReadableFinished:Ra,isReadableErrored:Rp,isNodeStream:De,isWebStream:Tp,isWritable:Ba,isWritableNodeStream:Ir,isWritableStream:Pa,isWritableEnded:Ca,isWritableFinished:Fp,isWritableErrored:Cp,isServerRequest:Bp,isServerResponse:Ma,willEmitClose:Dp,isTransformStream:La}});var Ye=N((P_,bo)=>{var ut=ct(),{AbortError:Ga,codes:Wp}=te(),{ERR_INVALID_ARG_TYPE:qp,ERR_STREAM_PREMATURE_CLOSE:Wa}=Wp,{kEmptyObject:po,once:yo}=Z(),{validateAbortSignal:jp,validateFunction:$p,validateObject:zp,validateBoolean:Vp}=ti(),{Promise:Hp,PromisePrototypeThen:Kp,SymbolDispose:Ya}=O(),{isClosed:Gp,isReadable:qa,isReadableNodeStream:ho,isReadableStream:Yp,isReadableFinished:ja,isReadableErrored:$a,isWritable:za,isWritableNodeStream:Va,isWritableStream:Xp,isWritableFinished:Ha,isWritableErrored:Ka,isNodeStream:Jp,willEmitClose:Qp,kIsClosedPromise:Zp}=Me(),ri;function ey(t){return t.setHeader&&typeof t.abort=="function"}s(ey,"isRequest");var mo=s(()=>{},"nop");function Xa(t,e,i){var r,n;if(arguments.length===2?(i=e,e=po):e==null?e=po:zp(e,"options"),$p(i,"callback"),jp(e.signal,"options.signal"),i=yo(i),Yp(t)||Xp(t))return ty(t,e,i);if(!Jp(t))throw new qp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(r=e.readable)!==null&&r!==void 0?r:ho(t),a=(n=e.writable)!==null&&n!==void 0?n:Va(t),l=t._writableState,u=t._readableState,f=s(()=>{t.writable||m()},"onlegacyfinish"),d=Qp(t)&&ho(t)===o&&Va(t)===a,h=Ha(t,!1),m=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||y)&&i.call(t)},"onfinish"),y=ja(t,!1),w=s(()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),b=s($=>{i.call(t,$)},"onerror"),g=Gp(t),S=s(()=>{g=!0;let $=Ka(t)||$a(t);if($&&typeof $!="boolean")return i.call(t,$);if(o&&!y&&ho(t,!0)&&!ja(t,!1))return i.call(t,new Wa);if(a&&!h&&!Ha(t,!1))return i.call(t,new Wa);i.call(t)},"onclose"),I=s(()=>{g=!0;let $=Ka(t)||$a(t);if($&&typeof $!="boolean")return i.call(t,$);i.call(t)},"onclosed"),D=s(()=>{t.req.on("finish",m)},"onrequest");ey(t)?(t.on("complete",m),d||t.on("abort",S),t.req?D():t.on("request",D)):a&&!l&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",b),t.on("close",S),g?ut.nextTick(S):l!=null&&l.errorEmitted||u!=null&&u.errorEmitted?d||ut.nextTick(I):(!o&&(!d||qa(t))&&(h||za(t)===!1)||!a&&(!d||za(t))&&(y||qa(t)===!1)||u&&t.req&&t.aborted)&&ut.nextTick(I);let k=s(()=>{i=mo,t.removeListener("aborted",S),t.removeListener("complete",m),t.removeListener("abort",S),t.removeListener("request",D),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",b),t.removeListener("close",S)},"cleanup");if(e.signal&&!g){let $=s(()=>{let dt=i;k(),dt.call(t,new Ga(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ut.nextTick($);else{ri=ri||Z().addAbortListener;let dt=ri(e.signal,$),fe=i;i=yo((...Lt)=>{dt[Ya](),fe.apply(t,Lt)})}}return k}s(Xa,"eos");function ty(t,e,i){let r=!1,n=mo;if(e.signal)if(n=s(()=>{r=!0,i.call(t,new Ga(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ut.nextTick(n);else{ri=ri||Z().addAbortListener;let a=ri(e.signal,n),l=i;i=yo((...u)=>{a[Ya](),l.apply(t,u)})}let o=s((...a)=>{r||ut.nextTick(()=>i.apply(t,a))},"resolverFn");return Kp(t[Zp].promise,o,o),mo}s(ty,"eosWeb");function iy(t,e){var i;let r=!1;return e===null&&(e=po),(i=e)!==null&&i!==void 0&&i.cleanup&&(Vp(e.cleanup,"cleanup"),r=e.cleanup),new Hp((n,o)=>{let a=Xa(t,e,l=>{r&&a(),l?o(l):n()})})}s(iy,"finished");bo.exports=Xa;bo.exports.finished=iy});var xt=N((C_,nl)=>{"use strict";var Ue=ct(),{aggregateTwoErrors:ry,codes:{ERR_MULTIPLE_CALLBACK:ny},AbortError:oy}=te(),{Symbol:Za}=O(),{kIsDestroyed:sy,isDestroyed:ay,isFinished:ly,isServerRequest:cy}=Me(),el=Za("kDestroy"),go=Za("kConstruct");function tl(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(tl,"checkError");function uy(t,e){let i=this._readableState,r=this._writableState,n=r||i;return r!=null&&r.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(tl(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?Ja(this,t,e):this.once(el,function(o){Ja(this,ry(o,t),e)}),this)}s(uy,"destroy");function Ja(t,e,i){let r=!1;function n(o){if(r)return;r=!0;let a=t._readableState,l=t._writableState;tl(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ue.nextTick(fy,t,o):Ue.nextTick(il,t)}s(n,"onDestroy");try{t._destroy(e||null,n)}catch(o){n(o)}}s(Ja,"_destroy");function fy(t,e){wo(t,e),il(t)}s(fy,"emitErrorCloseNT");function il(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(il,"emitCloseNT");function wo(t,e){let i=t._readableState,r=t._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(wo,"emitErrorNT");function dy(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(dy,"undestroy");function So(t,e,i){let r=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),r&&!r.errored&&(r.errored=e),i?Ue.nextTick(wo,t,e):wo(t,e))}s(So,"errorOrDestroy");function hy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,r=t._writableState;i&&(i.constructed=!1),r&&(r.constructed=!1),t.once(go,e),!(t.listenerCount(go)>1)&&Ue.nextTick(py,t)}s(hy,"construct");function py(t){let e=!1;function i(r){if(e){So(t,r??new ny);return}e=!0;let n=t._readableState,o=t._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(el,r):r?So(t,r,!0):Ue.nextTick(yy,t)}s(i,"onConstruct");try{t._construct(r=>{Ue.nextTick(i,r)})}catch(r){Ue.nextTick(i,r)}}s(py,"constructNT");function yy(t){t.emit(go)}s(yy,"emitConstructNT");function Qa(t){return t?.setHeader&&typeof t.abort=="function"}s(Qa,"isRequest");function rl(t){t.emit("close")}s(rl,"emitCloseLegacy");function my(t,e){t.emit("error",e),Ue.nextTick(rl,t)}s(my,"emitErrorCloseLegacy");function by(t,e){!t||ay(t)||(!e&&!ly(t)&&(e=new oy),cy(t)?(t.socket=null,t.destroy(e)):Qa(t)?t.abort():Qa(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ue.nextTick(my,t,e):Ue.nextTick(rl,t),t.destroyed||(t[sy]=!0))}s(by,"destroyer");nl.exports={construct:hy,destroyer:by,destroy:uy,undestroy:dy,errorOrDestroy:So}});var Cr=N((O_,sl)=>{"use strict";var{ArrayIsArray:gy,ObjectSetPrototypeOf:ol}=O(),{EventEmitter:Pr}=Ui();function Lr(t){Pr.call(this,t)}s(Lr,"Stream");ol(Lr.prototype,Pr.prototype);ol(Lr,Pr);Lr.prototype.pipe=function(t,e){let i=this;function r(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}s(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}s(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function u(d){f(),Pr.listenerCount(this,"error")===0&&this.emit("error",d)}s(u,"onerror"),_o(i,"error",u),_o(t,"error",u);function f(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",u),t.removeListener("error",u),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function _o(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):gy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(_o,"prependListener");sl.exports={Stream:Lr,prependListener:_o}});var Wi=N((D_,Rr)=>{"use strict";var{SymbolDispose:wy}=O(),{AbortError:al,codes:Sy}=te(),{isNodeStream:ll,isWebStream:_y,kControllerErrorFunction:Ey}=Me(),xy=Ye(),{ERR_INVALID_ARG_TYPE:cl}=Sy,Eo,vy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new cl(e,"AbortSignal",t)},"validateAbortSignal");Rr.exports.addAbortSignal=s(function(e,i){if(vy(e,"signal"),!ll(i)&&!_y(i))throw new cl("stream",["ReadableStream","WritableStream","Stream"],i);return Rr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");Rr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=ll(e)?()=>{e.destroy(new al(void 0,{cause:t.reason}))}:()=>{e[Ey](new al(void 0,{cause:t.reason}))};if(t.aborted)i();else{Eo=Eo||Z().addAbortListener;let r=Eo(t,i);xy(e,r[wy])}return e}});var dl=N((W_,fl)=>{"use strict";var{StringPrototypeSlice:ul,SymbolIterator:Ay,TypedArrayPrototypeSet:Or,Uint8Array:ky}=O(),{Buffer:xo}=He(),{inspect:Ny}=Z();fl.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=e+i.data;return r}concat(e){if(this.length===0)return xo.alloc(0);let i=xo.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)Or(i,r.data,n),n+=r.data.length,r=r.next;return i}consume(e,i){let r=this.head.data;if(e<r.length){let n=r.slice(0,e);return this.head.data=r.slice(e),n}return e===r.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Ay](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",r=this.head,n=0;do{let o=r.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=ul(o,0,e),this.head=r,r.data=ul(o,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=xo.allocUnsafe(e),r=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)Or(i,a,r-e),e-=a.length;else{e===a.length?(Or(i,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Or(i,new ky(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return Ny(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var qi=N((j_,ml)=>{"use strict";var{MathFloor:Ty,NumberIsInteger:Iy}=O(),{validateInteger:Fy}=ti(),{ERR_INVALID_ARG_VALUE:Py}=te().codes,hl=16*1024,pl=16;function Ly(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(Ly,"highWaterMarkFrom");function yl(t){return t?pl:hl}s(yl,"getDefaultHighWaterMark");function Cy(t,e){Fy(e,"value",0),t?pl=e:hl=e}s(Cy,"setDefaultHighWaterMark");function Ry(t,e,i,r){let n=Ly(e,r,i);if(n!=null){if(!Iy(n)||n<0){let o=r?`options.${i}`:"options.highWaterMark";throw new Py(o,n)}return Ty(n)}return yl(t.objectMode)}s(Ry,"getHighWaterMark");ml.exports={getHighWaterMark:Ry,getDefaultHighWaterMark:yl,setDefaultHighWaterMark:Cy}});var wl=N((vo,gl)=>{var Br=He(),We=Br.Buffer;function bl(t,e){for(var i in t)e[i]=t[i]}s(bl,"copyProps");We.from&&We.alloc&&We.allocUnsafe&&We.allocUnsafeSlow?gl.exports=Br:(bl(Br,vo),vo.Buffer=vt);function vt(t,e,i){return We(t,e,i)}s(vt,"SafeBuffer");vt.prototype=Object.create(We.prototype);bl(We,vt);vt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return We(t,e,i)};vt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=We(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};vt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return We(t)};vt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Br.SlowBuffer(t)}});var El=N(_l=>{"use strict";var ko=wl().Buffer,Sl=ko.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Oy(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Oy,"_normalizeEncoding");function By(t){var e=Oy(t);if(typeof e!="string"&&(ko.isEncoding===Sl||!Sl(t)))throw new Error("Unknown encoding: "+t);return e||t}s(By,"normalizeEncoding");_l.StringDecoder=ji;function ji(t){this.encoding=By(t);var e;switch(this.encoding){case"utf16le":this.text=jy,this.end=$y,e=4;break;case"utf8":this.fillLast=Uy,e=4;break;case"base64":this.text=zy,this.end=Vy,e=3;break;default:this.write=Hy,this.end=Ky;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ko.allocUnsafe(e)}s(ji,"StringDecoder");ji.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};ji.prototype.end=qy;ji.prototype.text=Wy;ji.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ao(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Ao,"utf8CheckByte");function Dy(t,e,i){var r=e.length-1;if(r<i)return 0;var n=Ao(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=Ao(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=Ao(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}s(Dy,"utf8CheckIncomplete");function My(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s(My,"utf8CheckExtraBytes");function Uy(t){var e=this.lastTotal-this.lastNeed,i=My(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Uy,"utf8FillLast");function Wy(t,e){var i=Dy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}s(Wy,"utf8Text");function qy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(qy,"utf8End");function jy(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(jy,"utf16Text");function $y(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s($y,"utf16End");function zy(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(zy,"base64Text");function Vy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Vy,"base64End");function Hy(t){return t.toString(this.encoding)}s(Hy,"simpleWrite");function Ky(t){return t&&t.length?this.write(t):""}s(Ky,"simpleEnd")});var No=N((K_,kl)=>{"use strict";var xl=ct(),{PromisePrototypeThen:Gy,SymbolAsyncIterator:vl,SymbolIterator:Al}=O(),{Buffer:Yy}=He(),{ERR_INVALID_ARG_TYPE:Xy,ERR_STREAM_NULL_VALUES:Jy}=te().codes;function Qy(t,e,i){let r;if(typeof e=="string"||e instanceof Yy)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let n;if(e&&e[vl])n=!0,r=e[vl]();else if(e&&e[Al])n=!1,r=e[Al]();else throw new Xy("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,u())},o._destroy=function(f,d){Gy(l(f),()=>xl.nextTick(d,f),h=>xl.nextTick(d,h||f))};async function l(f){let d=f!=null,h=typeof r.throw=="function";if(d&&h){let{value:m,done:y}=await r.throw(f);if(await m,y)return}if(typeof r.return=="function"){let{value:m}=await r.return();await m}}s(l,"close");async function u(){for(;;){try{let{value:f,done:d}=n?await r.next():r.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Jy;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(u,"next"),o}s(Qy,"from");kl.exports=Qy});var zi=N((Y_,zl)=>{var ke=ct(),{ArrayPrototypeIndexOf:Zy,NumberIsInteger:em,NumberIsNaN:tm,NumberParseInt:im,ObjectDefineProperties:Oo,ObjectKeys:rm,ObjectSetPrototypeOf:Il,Promise:Fl,SafeSet:nm,SymbolAsyncDispose:om,SymbolAsyncIterator:sm,Symbol:am}=O();zl.exports=E;E.ReadableState=Wr;var{EventEmitter:lm}=Ui(),{Stream:ft,prependListener:cm}=Cr(),{Buffer:To}=He(),{addAbortSignal:um}=Wi(),Pl=Ye(),A=Z().debuglog("stream",t=>{A=t}),fm=dl(),si=xt(),{getHighWaterMark:dm,getDefaultHighWaterMark:hm}=qi(),{aggregateTwoErrors:Nl,codes:{ERR_INVALID_ARG_TYPE:pm,ERR_METHOD_NOT_IMPLEMENTED:ym,ERR_OUT_OF_RANGE:mm,ERR_STREAM_PUSH_AFTER_EOF:bm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:gm},AbortError:wm}=te(),{validateObject:Sm}=ti(),At=am("kPaused"),{StringDecoder:Ll}=El(),_m=No();Il(E.prototype,ft.prototype);Il(E,ft);var Io=s(()=>{},"nop"),{errorOrDestroy:ni}=si,oi=1<<0,Em=1<<1,Cl=1<<2,$i=1<<3,Rl=1<<4,Dr=1<<5,Mr=1<<6,Ol=1<<7,xm=1<<8,vm=1<<9,Am=1<<10,Co=1<<11,Ro=1<<12,km=1<<13,Nm=1<<14,Tm=1<<15,Bl=1<<16,Im=1<<17,Fm=1<<18;function V(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(V,"makeBitMapDescriptor");Oo(Wr.prototype,{objectMode:V(oi),ended:V(Em),endEmitted:V(Cl),reading:V($i),constructed:V(Rl),sync:V(Dr),needReadable:V(Mr),emittedReadable:V(Ol),readableListening:V(xm),resumeScheduled:V(vm),errorEmitted:V(Am),emitClose:V(Co),autoDestroy:V(Ro),destroyed:V(km),closed:V(Nm),closeEmitted:V(Tm),multiAwaitDrain:V(Bl),readingMore:V(Im),dataEmitted:V(Fm)});function Wr(t,e,i){typeof i!="boolean"&&(i=e instanceof qe()),this.state=Co|Ro|Rl|Dr,t&&t.objectMode&&(this.state|=oi),i&&t&&t.readableObjectMode&&(this.state|=oi),this.highWaterMark=t?dm(this,t,"readableHighWaterMark",i):hm(!1),this.buffer=new fm,this.length=0,this.pipes=[],this.flowing=null,this[At]=null,t&&t.emitClose===!1&&(this.state&=~Co),t&&t.autoDestroy===!1&&(this.state&=~Ro),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Ll(t.encoding),this.encoding=t.encoding)}s(Wr,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof qe();this._readableState=new Wr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&um(t.signal,this)),ft.call(this,t),si.construct(this,()=>{this._readableState.needReadable&&Ur(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=si.destroy;E.prototype._undestroy=si.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[lm.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[om]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new wm,this.destroy(t)),new Fl((e,i)=>Pl(this,r=>r&&r!==t?i(r):e(null)))};E.prototype.push=function(t,e){return Dl(this,t,e,!1)};E.prototype.unshift=function(t,e){return Dl(this,t,e,!0)};function Dl(t,e,i,r){A("readableAddChunk",e);let n=t._readableState,o;if(n.state&oi||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=To.from(e,i).toString(n.encoding):(e=To.from(e,i),i=""))):e instanceof To?i="":ft._isUint8Array(e)?(e=ft._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new pm("chunk",["string","Buffer","Uint8Array"],e))),o)ni(t,o);else if(e===null)n.state&=~$i,Cm(t,n);else if(n.state&oi||e&&e.length>0)if(r)if(n.state&Cl)ni(t,new gm);else{if(n.destroyed||n.errored)return!1;Fo(t,n,e,!0)}else if(n.ended)ni(t,new bm);else{if(n.destroyed||n.errored)return!1;n.state&=~$i,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?Fo(t,n,e,!1):Ur(t,n)):Fo(t,n,e,!1)}else r||(n.state&=~$i,Ur(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Dl,"readableAddChunk");function Fo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Bl?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.state&Mr&&qr(t)),Ur(t,e)}s(Fo,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[At]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new Ll(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,r="";for(let n of i)r+=e.write(n);return i.clear(),r!==""&&i.push(r),this._readableState.length=r.length,this};var Pm=1073741824;function Lm(t){if(t>Pm)throw new mm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Lm,"computeNewHighWaterMark");function Tl(t,e){return t<=0||e.length===0&&e.ended?0:e.state&oi?1:tm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(Tl,"howMuchToRead");E.prototype.read=function(t){A("read",t),t===void 0?t=NaN:em(t)||(t=im(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Lm(t)),t!==0&&(e.state&=~Ol),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return A("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Po(this):qr(this),null;if(t=Tl(t,e),t===0&&e.ended)return e.length===0&&Po(this),null;let r=(e.state&Mr)!==0;if(A("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,A("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,A("reading, ended or constructing",r);else if(r){A("do read"),e.state|=$i|Dr,e.length===0&&(e.state|=Mr);try{this._read(e.highWaterMark)}catch(o){ni(this,o)}e.state&=~Dr,e.reading||(t=Tl(i,e))}let n;return t>0?n=jl(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&Po(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Cm(t,e){if(A("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?qr(t):(e.needReadable=!1,e.emittedReadable=!0,Ml(t))}}s(Cm,"onEofChunk");function qr(t){let e=t._readableState;A("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(A("emitReadable",e.flowing),e.emittedReadable=!0,ke.nextTick(Ml,t))}s(qr,"emitReadable");function Ml(t){let e=t._readableState;A("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Wl(t)}s(Ml,"emitReadable_");function Ur(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ke.nextTick(Rm,t,e))}s(Ur,"maybeReadMore");function Rm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(A("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(Rm,"maybeReadMore_");E.prototype._read=function(t){throw new ym("_read()")};E.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new nm(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),A("pipe count=%d opts=%j",r.pipes.length,e);let o=(!e||e.end!==!1)&&t!==ke.stdout&&t!==ke.stderr?l:g;r.endEmitted?ke.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(S,I){A("onunpipe"),S===i&&I&&I.hasUnpiped===!1&&(I.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){A("onend"),t.end()}s(l,"onend");let u,f=!1;function d(){A("cleanup"),t.removeListener("close",w),t.removeListener("finish",b),u&&t.removeListener("drain",u),t.removeListener("error",y),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",g),i.removeListener("data",m),f=!0,u&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&u()}s(d,"cleanup");function h(){f||(r.pipes.length===1&&r.pipes[0]===t?(A("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(A("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),u||(u=Om(i,t),t.on("drain",u))}s(h,"pause"),i.on("data",m);function m(S){A("ondata");let I=t.write(S);A("dest.write",I),I===!1&&h()}s(m,"ondata");function y(S){if(A("onerror",S),g(),t.removeListener("error",y),t.listenerCount("error")===0){let I=t._writableState||t._readableState;I&&!I.errorEmitted?ni(t,S):t.emit("error",S)}}s(y,"onerror"),cm(t,"error",y);function w(){t.removeListener("finish",b),g()}s(w,"onclose"),t.once("close",w);function b(){A("onfinish"),t.removeListener("close",w),g()}s(b,"onfinish"),t.once("finish",b);function g(){A("unpipe"),i.unpipe(t)}return s(g,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(A("pipe resume"),i.resume()),t};function Om(t,e){return s(function(){let r=t._readableState;r.awaitDrainWriters===e?(A("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(A("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Om,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let r=Zy(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=ft.prototype.on.call(this,t,e),r=this._readableState;return t==="data"?(r.readableListening=this.listenerCount("readable")>0,r.flowing!==!1&&this.resume()):t==="readable"&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,A("on readable",r.length,r.reading),r.length?qr(this):r.reading||ke.nextTick(Bm,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=ft.prototype.removeListener.call(this,t,e);return t==="readable"&&ke.nextTick(Ul,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=ft.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ke.nextTick(Ul,this),e};function Ul(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[At]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(Ul,"updateReadableListening");function Bm(t){A("readable nexttick read 0"),t.read(0)}s(Bm,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(A("resume"),t.flowing=!t.readableListening,Dm(this,t)),t[At]=!1,this};function Dm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ke.nextTick(Mm,t,e))}s(Dm,"resume");function Mm(t,e){A("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Wl(t),e.flowing&&!e.reading&&t.read(0)}s(Mm,"resume_");E.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(A("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[At]=!0,this};function Wl(t){let e=t._readableState;for(A("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Wl,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",r=>{!this.push(r)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",r=>{ni(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=rm(t);for(let r=1;r<i.length;r++){let n=i[r];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};E.prototype[sm]=function(){return ql(this)};E.prototype.iterator=function(t){return t!==void 0&&Sm(t,"options"),ql(this,t)};function ql(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=Um(t,e);return i.stream=t,i}s(ql,"streamToAsyncIterator");async function*Um(t,e){let i=Io;function r(a){this===t?(i(),i=Io):i=a}s(r,"next"),t.on("readable",r);let n,o=Pl(t,{writable:!1},a=>{n=a?Nl(n,a):null,i(),i=Io});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new Fl(r)}}}catch(a){throw n=Nl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?si.destroyer(t,null):(t.off("readable",r),o())}}s(Um,"createAsyncIterator");Oo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Oo(Wr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[At]!==!1},set(t){this[At]=!!t}}});E._fromList=jl;function jl(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(jl,"fromList");function Po(t){let e=t._readableState;A("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ke.nextTick(Wm,e,t))}s(Po,"endReadable");function Wm(t,e){if(A("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ke.nextTick(qm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Wm,"endReadableNT");function qm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(qm,"endWritableNT");E.from=function(t,e){return _m(E,t,e)};var Lo;function $l(){return Lo===void 0&&(Lo={}),Lo}s($l,"lazyWebStreams");E.fromWeb=function(t,e){return $l().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return $l().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,r;return new E({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(n,o){si.destroyer(t,n),o(n)}}).wrap(t)}});var Hr=N((J_,ic)=>{var kt=ct(),{ArrayPrototypeSlice:Kl,Error:jm,FunctionPrototypeSymbolHasInstance:Gl,ObjectDefineProperty:Yl,ObjectDefineProperties:$m,ObjectSetPrototypeOf:Xl,StringPrototypeToLowerCase:zm,Symbol:Vm,SymbolHasInstance:Hm}=O();ic.exports=B;B.WritableState=Ki;var{EventEmitter:Km}=Ui(),Vi=Cr().Stream,{Buffer:jr}=He(),Vr=xt(),{addAbortSignal:Gm}=Wi(),{getHighWaterMark:Ym,getDefaultHighWaterMark:Xm}=qi(),{ERR_INVALID_ARG_TYPE:Jm,ERR_METHOD_NOT_IMPLEMENTED:Qm,ERR_MULTIPLE_CALLBACK:Jl,ERR_STREAM_CANNOT_PIPE:Zm,ERR_STREAM_DESTROYED:Hi,ERR_STREAM_ALREADY_FINISHED:eb,ERR_STREAM_NULL_VALUES:tb,ERR_STREAM_WRITE_AFTER_END:ib,ERR_UNKNOWN_ENCODING:Ql}=te().codes,{errorOrDestroy:ai}=Vr;Xl(B.prototype,Vi.prototype);Xl(B,Vi);function Mo(){}s(Mo,"nop");var li=Vm("kOnFinished");function Ki(t,e,i){typeof i!="boolean"&&(i=e instanceof qe()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Ym(this,t,"writableHighWaterMark",i):Xm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let r=!!(t&&t.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=nb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,zr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[li]=[]}s(Ki,"WritableState");function zr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(zr,"resetBuffer");Ki.prototype.getBuffer=s(function(){return Kl(this.buffered,this.bufferedIndex)},"getBuffer");Yl(Ki.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function B(t){let e=this instanceof qe();if(!e&&!Gl(B,this))return new B(t);this._writableState=new Ki(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Gm(t.signal,this)),Vi.call(this,t),Vr.construct(this,()=>{let i=this._writableState;i.writing||Wo(this,i),qo(this,i)})}s(B,"Writable");Yl(B,Hm,{__proto__:null,value:function(t){return Gl(this,t)?!0:this!==B?!1:t&&t._writableState instanceof Ki}});B.prototype.pipe=function(){ai(this,new Zm)};function Zl(t,e,i,r){let n=t._writableState;if(typeof i=="function")r=i,i=n.defaultEncoding;else{if(!i)i=n.defaultEncoding;else if(i!=="buffer"&&!jr.isEncoding(i))throw new Ql(i);typeof r!="function"&&(r=Mo)}if(e===null)throw new tb;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=jr.from(e,i),i="buffer");else if(e instanceof jr)i="buffer";else if(Vi._isUint8Array(e))e=Vi._uint8ArrayToBuffer(e),i="buffer";else throw new Jm("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new ib:n.destroyed&&(o=new Hi("write")),o?(kt.nextTick(r,o),ai(t,o,!0),o):(n.pendingcb++,rb(t,n,e,i,r))}s(Zl,"_write");B.prototype.write=function(t,e,i){return Zl(this,t,e,i)===!0};B.prototype.cork=function(){this._writableState.corked++};B.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Wo(this,t))};B.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=zm(e)),!jr.isEncoding(e))throw new Ql(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function rb(t,e,i,r,n){let o=e.objectMode?1:i.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:r,callback:n}),e.allBuffers&&r!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Mo&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(i,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(rb,"writeOrBuffer");function Vl(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Hi("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}s(Vl,"doWrite");function Hl(t,e,i,r){--e.pendingcb,r(i),Uo(e),ai(t,i)}s(Hl,"onwriteError");function nb(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){ai(t,new Jl);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),r?kt.nextTick(Hl,t,i,e,n):Hl(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Wo(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},kt.nextTick(ob,i.afterWriteTickInfo)):ec(t,i,1,n))}s(nb,"onwrite");function ob({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,ec(t,e,i,r)}s(ob,"afterWriteTick");function ec(t,e,i,r){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,r();e.destroyed&&Uo(e),qo(t,e)}s(ec,"afterWrite");function Uo(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:a}=t.buffered[n],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Hi("write"))}let i=t[li].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new Hi("end"))}zr(t)}s(Uo,"errorBuffer");function Wo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=e,o=i.length-r;if(!o)return;let a=r;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Mo:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},u=e.allNoop&&a===0?i:Kl(i,a);u.allBuffers=e.allBuffers,Vl(t,e,!0,e.length,u,"",l),zr(e)}else{do{let{chunk:l,encoding:u,callback:f}=i[a];i[a++]=null;let d=n?1:l.length;Vl(t,e,!1,d,l,u,f)}while(a<i.length&&!e.writing);a===i.length?zr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Wo,"clearBuffer");B.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new Qm("_write()")};B.prototype._writev=null;B.prototype.end=function(t,e,i){let r=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let n;if(t!=null){let o=Zl(this,t,e);o instanceof jm&&(n=o)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,qo(this,r,!0),r.ended=!0):r.finished?n=new eb("end"):r.destroyed&&(n=new Hi("end"))),typeof i=="function"&&(n||r.finished?kt.nextTick(i,n):r[li].push(i)),this};function $r(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s($r,"needFinish");function sb(t,e){let i=!1;function r(n){if(i){ai(t,n??Jl());return}if(i=!0,e.pendingcb--,n){let o=e[li].splice(0);for(let a=0;a<o.length;a++)o[a](n);ai(t,n,e.sync)}else $r(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,kt.nextTick(Do,t,e))}s(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}s(sb,"callFinal");function ab(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,sb(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(ab,"prefinish");function qo(t,e,i){$r(e)&&(ab(t,e),e.pendingcb===0&&(i?(e.pendingcb++,kt.nextTick((r,n)=>{$r(n)?Do(r,n):n.pendingcb--},t,e)):$r(e)&&(e.pendingcb++,Do(t,e))))}s(qo,"finishMaybe");function Do(t,e){e.pendingcb--,e.finished=!0;let i=e[li].splice(0);for(let r=0;r<i.length;r++)i[r]();if(t.emit("finish"),e.autoDestroy){let r=t._readableState;(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))&&t.destroy()}}s(Do,"finish");$m(B.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var lb=Vr.destroy;B.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[li].length)&&kt.nextTick(Uo,i),lb.call(this,t,e),this};B.prototype._undestroy=Vr.undestroy;B.prototype._destroy=function(t,e){e(t)};B.prototype[Km.captureRejectionSymbol]=function(t){this.destroy(t)};var Bo;function tc(){return Bo===void 0&&(Bo={}),Bo}s(tc,"lazyWebStreams");B.fromWeb=function(t,e){return tc().newStreamWritableFromWritableStream(t,e)};B.toWeb=function(t){return tc().newWritableStreamFromStreamWritable(t)}});var bc=N((Z_,mc)=>{var jo=ct(),cb=He(),{isReadable:ub,isWritable:fb,isIterable:rc,isNodeStream:db,isReadableNodeStream:nc,isWritableNodeStream:oc,isDuplexNodeStream:hb,isReadableStream:sc,isWritableStream:ac}=Me(),lc=Ye(),{AbortError:pc,codes:{ERR_INVALID_ARG_TYPE:pb,ERR_INVALID_RETURN_VALUE:cc}}=te(),{destroyer:ui}=xt(),yb=qe(),yc=zi(),mb=Hr(),{createDeferredPromise:uc}=Z(),fc=No(),dc=globalThis.Blob||cb.Blob,bb=s(typeof dc<"u"?function(e){return e instanceof dc}:function(e){return!1},"isBlob"),gb=globalThis.AbortController||Qt().AbortController,{FunctionPrototypeCall:hc}=O(),Xe=class extends yb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(Xe,"Duplexify");mc.exports=s(function t(e,i){if(hb(e))return e;if(nc(e))return ci({readable:e});if(oc(e))return ci({writable:e});if(db(e))return ci({writable:!1,readable:!1});if(sc(e))return ci({readable:yc.fromWeb(e)});if(ac(e))return ci({writable:mb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:l}=wb(e);if(rc(n))return fc(Xe,n,{objectMode:!0,write:o,final:a,destroy:l});let u=n?.then;if(typeof u=="function"){let f,d=hc(u,n,h=>{if(h!=null)throw new cc("nully","body",h)},h=>{ui(f,h)});return f=new Xe({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,jo.nextTick(h,null)}catch(m){jo.nextTick(h,m)}})},destroy:l})}throw new cc("Iterable, AsyncIterable or AsyncFunction",i,n)}if(bb(e))return t(e.arrayBuffer());if(rc(e))return fc(Xe,e,{objectMode:!0,writable:!1});if(sc(e?.readable)&&ac(e?.writable))return Xe.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?nc(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?oc(e?.writable)?e?.writable:t(e.writable):void 0;return ci({readable:n,writable:o})}let r=e?.then;if(typeof r=="function"){let n;return hc(r,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{ui(n,o)}),n=new Xe({objectMode:!0,writable:!1,read(){}})}throw new pb(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function wb(t){let{promise:e,resolve:i}=uc(),r=new gb,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:u,cb:f}=await a;if(jo.nextTick(f),u)return;if(n.aborted)throw new pc(void 0,{cause:n.reason});({promise:e,resolve:i}=uc()),yield l}}(),{signal:n}),write(a,l,u){let f=i;i=null,f({chunk:a,done:!1,cb:u})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){r.abort(),l(a)}}}s(wb,"fromAsyncGen");function ci(t){let e=t.readable&&typeof t.readable.read!="function"?yc.wrap(t.readable):t.readable,i=t.writable,r=!!ub(e),n=!!fb(i),o,a,l,u,f;function d(h){let m=u;u=null,m?m(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Xe({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(lc(i,h=>{n=!1,h&&ui(e,h),d(h)}),f._write=function(h,m,y){i.write(h,m)?y():o=y},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),r&&(lc(e,h=>{r=!1,h&&ui(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){l=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,m){!h&&u!==null&&(h=new pc),l=null,o=null,a=null,u===null?m(h):(u=m,ui(i,h),ui(e,h))},f}s(ci,"_duplexify")});var qe=N((t0,Sc)=>{"use strict";var{ObjectDefineProperties:Sb,ObjectGetOwnPropertyDescriptor:Je,ObjectKeys:_b,ObjectSetPrototypeOf:gc}=O();Sc.exports=Ne;var Vo=zi(),we=Hr();gc(Ne.prototype,Vo.prototype);gc(Ne,Vo);{let t=_b(we.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ne.prototype[i]||(Ne.prototype[i]=we.prototype[i])}}function Ne(t){if(!(this instanceof Ne))return new Ne(t);Vo.call(this,t),we.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Ne,"Duplex");Sb(Ne.prototype,{writable:{__proto__:null,...Je(we.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Je(we.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Je(we.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Je(we.prototype,"writableBuffer")},writableLength:{__proto__:null,...Je(we.prototype,"writableLength")},writableFinished:{__proto__:null,...Je(we.prototype,"writableFinished")},writableCorked:{__proto__:null,...Je(we.prototype,"writableCorked")},writableEnded:{__proto__:null,...Je(we.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Je(we.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var $o;function wc(){return $o===void 0&&($o={}),$o}s(wc,"lazyWebStreams");Ne.fromWeb=function(t,e){return wc().newStreamDuplexFromReadableWritablePair(t,e)};Ne.toWeb=function(t){return wc().newReadableWritablePairFromDuplex(t)};var zo;Ne.from=function(t){return zo||(zo=bc()),zo(t,"body")}});var Go=N((r0,Ec)=>{"use strict";var{ObjectSetPrototypeOf:_c,Symbol:Eb}=O();Ec.exports=Qe;var{ERR_METHOD_NOT_IMPLEMENTED:xb}=te().codes,Ko=qe(),{getHighWaterMark:vb}=qi();_c(Qe.prototype,Ko.prototype);_c(Qe,Ko);var Gi=Eb("kCallback");function Qe(t){if(!(this instanceof Qe))return new Qe(t);let e=t?vb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Ko.call(this,t),this._readableState.sync=!1,this[Gi]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Ab)}s(Qe,"Transform");function Ho(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(Ho,"final");function Ab(){this._final!==Ho&&Ho.call(this)}s(Ab,"prefinish");Qe.prototype._final=Ho;Qe.prototype._transform=function(t,e,i){throw new xb("_transform()")};Qe.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,o=r.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),n.ended||o===r.length||r.length<r.highWaterMark?i():this[Gi]=i})};Qe.prototype._read=function(){if(this[Gi]){let t=this[Gi];this[Gi]=null,t()}}});var Xo=N((o0,vc)=>{"use strict";var{ObjectSetPrototypeOf:xc}=O();vc.exports=fi;var Yo=Go();xc(fi.prototype,Yo.prototype);xc(fi,Yo);function fi(t){if(!(this instanceof fi))return new fi(t);Yo.call(this,t)}s(fi,"PassThrough");fi.prototype._transform=function(t,e,i){i(null,t)}});var Xr=N((a0,Ic)=>{var Yi=ct(),{ArrayIsArray:kb,Promise:Nb,SymbolAsyncIterator:Tb,SymbolDispose:Ib}=O(),Yr=Ye(),{once:Fb}=Z(),Pb=xt(),Ac=qe(),{aggregateTwoErrors:Lb,codes:{ERR_INVALID_ARG_TYPE:os,ERR_INVALID_RETURN_VALUE:Jo,ERR_MISSING_ARGS:Cb,ERR_STREAM_DESTROYED:Rb,ERR_STREAM_PREMATURE_CLOSE:Ob},AbortError:Bb}=te(),{validateFunction:Db,validateAbortSignal:Mb}=ti(),{isIterable:Nt,isReadable:Qo,isReadableNodeStream:Gr,isNodeStream:kc,isTransformStream:di,isWebStream:Ub,isReadableStream:Zo,isReadableFinished:Wb}=Me(),qb=globalThis.AbortController||Qt().AbortController,es,ts,is;function Nc(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=Yr(t,{readable:e,writable:i},o=>{r=!o});return{destroy:o=>{r||(r=!0,Pb.destroyer(t,o||new Rb("pipe")))},cleanup:n}}s(Nc,"destroyer");function jb(t){return Db(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(jb,"popCallback");function rs(t){if(Nt(t))return t;if(Gr(t))return $b(t);throw new os("val",["Readable","Iterable","AsyncIterable"],t)}s(rs,"makeAsyncIterable");async function*$b(t){ts||(ts=zi()),yield*ts.prototype[Tb].call(t)}s($b,"fromReadable");async function Kr(t,e,i,{end:r}){let n,o=null,a=s(f=>{if(f&&(n=f),o){let d=o;o=null,d()}},"resume"),l=s(()=>new Nb((f,d)=>{n?d(n):o=s(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let u=Yr(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let f of t)e.write(f)||await l();r&&(e.end(),await l()),i()}catch(f){i(n!==f?Lb(n,f):f)}finally{u(),e.off("drain",a)}}s(Kr,"pumpToNode");async function ns(t,e,i,{end:r}){di(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(o){try{await n.abort(o),i(o)}catch(a){i(a)}}}s(ns,"pumpToWeb");function zb(...t){return Tc(t,Fb(jb(t)))}s(zb,"pipeline");function Tc(t,e,i){if(t.length===1&&kb(t[0])&&(t=t[0]),t.length<2)throw new Cb("streams");let r=new qb,n=r.signal,o=i?.signal,a=[];Mb(o,"options.signal");function l(){w(new Bb)}s(l,"abort"),is=is||Z().addAbortListener;let u;o&&(u=is(o,l));let f,d,h=[],m=0;function y(D){w(D,--m===0)}s(y,"finish");function w(D,k){var $;if(D&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=D),!(!f&&!k)){for(;h.length;)h.shift()(f);($=u)===null||$===void 0||$[Ib](),r.abort(),k&&(f||a.forEach(dt=>dt()),Yi.nextTick(e,f,d))}}s(w,"finishImpl");let b;for(let D=0;D<t.length;D++){let k=t[D],$=D<t.length-1,dt=D>0,fe=$||i?.end!==!1,Lt=D===t.length-1;if(kc(k)){let ie=function($e){$e&&$e.name!=="AbortError"&&$e.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y($e)};var I=ie;if(s(ie,"onError"),fe){let{destroy:$e,cleanup:ln}=Nc(k,$,dt);h.push($e),Qo(k)&&Lt&&a.push(ln)}k.on("error",ie),Qo(k)&&Lt&&a.push(()=>{k.removeListener("error",ie)})}if(D===0)if(typeof k=="function"){if(b=k({signal:n}),!Nt(b))throw new Jo("Iterable, AsyncIterable or Stream","source",b)}else Nt(k)||Gr(k)||di(k)?b=k:b=Ac.from(k);else if(typeof k=="function"){if(di(b)){var g;b=rs((g=b)===null||g===void 0?void 0:g.readable)}else b=rs(b);if(b=k(b,{signal:n}),$){if(!Nt(b,!0))throw new Jo("AsyncIterable",`transform[${D-1}]`,b)}else{var S;es||(es=Xo());let ie=new es({objectMode:!0}),$e=(S=b)===null||S===void 0?void 0:S.then;if(typeof $e=="function")m++,$e.call(b,tt=>{d=tt,tt!=null&&ie.write(tt),fe&&ie.end(),Yi.nextTick(y)},tt=>{ie.destroy(tt),Yi.nextTick(y,tt)});else if(Nt(b,!0))m++,Kr(b,ie,y,{end:fe});else if(Zo(b)||di(b)){let tt=b.readable||b;m++,Kr(tt,ie,y,{end:fe})}else throw new Jo("AsyncIterable or Promise","destination",b);b=ie;let{destroy:ln,cleanup:nu}=Nc(b,!1,!0);h.push(ln),Lt&&a.push(nu)}}else if(kc(k)){if(Gr(b)){m+=2;let ie=Vb(b,k,y,{end:fe});Qo(k)&&Lt&&a.push(ie)}else if(di(b)||Zo(b)){let ie=b.readable||b;m++,Kr(ie,k,y,{end:fe})}else if(Nt(b))m++,Kr(b,k,y,{end:fe});else throw new os("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=k}else if(Ub(k)){if(Gr(b))m++,ns(rs(b),k,y,{end:fe});else if(Zo(b)||Nt(b))m++,ns(b,k,y,{end:fe});else if(di(b))m++,ns(b.readable,k,y,{end:fe});else throw new os("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=k}else b=Ac.from(k)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Yi.nextTick(l),b}s(Tc,"pipelineImpl");function Vb(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new Ob)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Wb(t)?Yi.nextTick(a):t.once("end",a)}else i();return Yr(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),Yr(e,{readable:!1,writable:!0},i)}s(Vb,"pipe");Ic.exports={pipelineImpl:Tc,pipeline:zb}});var as=N((c0,Oc)=>{"use strict";var{pipeline:Hb}=Xr(),Jr=qe(),{destroyer:Kb}=xt(),{isNodeStream:Qr,isReadable:Fc,isWritable:Pc,isWebStream:ss,isTransformStream:Tt,isWritableStream:Lc,isReadableStream:Cc}=Me(),{AbortError:Gb,codes:{ERR_INVALID_ARG_VALUE:Rc,ERR_MISSING_ARGS:Yb}}=te(),Xb=Ye();Oc.exports=s(function(...e){if(e.length===0)throw new Yb("streams");if(e.length===1)return Jr.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=Jr.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=Jr.from(e[y])}for(let y=0;y<e.length;++y)if(!(!Qr(e[y])&&!ss(e[y]))){if(y<e.length-1&&!(Fc(e[y])||Cc(e[y])||Tt(e[y])))throw new Rc(`streams[${y}]`,i[y],"must be readable");if(y>0&&!(Pc(e[y])||Lc(e[y])||Tt(e[y])))throw new Rc(`streams[${y}]`,i[y],"must be writable")}let r,n,o,a,l;function u(y){let w=a;a=null,w?w(y):y?l.destroy(y):!m&&!h&&l.destroy()}s(u,"onfinished");let f=e[0],d=Hb(e,u),h=!!(Pc(f)||Lc(f)||Tt(f)),m=!!(Fc(d)||Cc(d)||Tt(d));if(l=new Jr({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(Qr(f))l._write=function(w,b,g){f.write(w,b)?g():r=g},l._final=function(w){f.end(),n=w},f.on("drain",function(){if(r){let w=r;r=null,w()}});else if(ss(f)){let b=(Tt(f)?f.writable:f).getWriter();l._write=async function(g,S,I){try{await b.ready,b.write(g).catch(()=>{}),I()}catch(D){I(D)}},l._final=async function(g){try{await b.ready,b.close().catch(()=>{}),n=g}catch(S){g(S)}}}let y=Tt(d)?d.readable:d;Xb(y,()=>{if(n){let w=n;n=null,w()}})}if(m){if(Qr(d))d.on("readable",function(){if(o){let y=o;o=null,y()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let y=d.read();if(y===null){o=l._read;return}if(!l.push(y))return}};else if(ss(d)){let w=(Tt(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:b,done:g}=await w.read();if(!l.push(b))return;if(g){l.push(null);return}}catch{return}}}}return l._destroy=function(y,w){!y&&a!==null&&(y=new Gb),o=null,r=null,n=null,a===null?w(y):(a=w,Qr(d)&&Kb(d,y))},l},"compose")});var Vc=N((f0,cs)=>{"use strict";var Jb=globalThis.AbortController||Qt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Qb,ERR_INVALID_ARG_TYPE:Xi,ERR_MISSING_ARGS:Zb,ERR_OUT_OF_RANGE:eg},AbortError:je}=te(),{validateAbortSignal:It,validateInteger:Bc,validateObject:Ft}=ti(),tg=O().Symbol("kWeak"),ig=O().Symbol("kResistStopPropagation"),{finished:rg}=Ye(),ng=as(),{addAbortSignalNoValidate:og}=Wi(),{isWritable:sg,isNodeStream:ag}=Me(),{deprecate:lg}=Z(),{ArrayPrototypePush:cg,Boolean:ug,MathFloor:Dc,Number:fg,NumberIsNaN:dg,Promise:Mc,PromiseReject:Uc,PromiseResolve:hg,PromisePrototypeThen:Wc,Symbol:jc}=O(),en=jc("kEmpty"),qc=jc("kEof");function pg(t,e){if(e!=null&&Ft(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),ag(t)&&!sg(t))throw new Qb("stream",t,"must be writable");let i=ng(this,t);return e!=null&&e.signal&&og(e.signal,i),i}s(pg,"compose");function tn(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);e!=null&&Ft(e,"options"),e?.signal!=null&&It(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Dc(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=Dc(e.highWaterMark)),Bc(i,"options.concurrency",1),Bc(r,"options.highWaterMark",0),r+=i,s(async function*(){let o=Z().AbortSignalAny([e?.signal].filter(ug)),a=this,l=[],u={signal:o},f,d,h=!1,m=0;function y(){h=!0,w()}s(y,"onCatch");function w(){m-=1,b()}s(w,"afterItemProcessed");function b(){d&&!h&&m<i&&l.length<r&&(d(),d=null)}s(b,"maybeResume");async function g(){try{for await(let S of a){if(h)return;if(o.aborted)throw new je;try{if(S=t(S,u),S===en)continue;S=hg(S)}catch(I){S=Uc(I)}m+=1,Wc(S,w,y),l.push(S),f&&(f(),f=null),!h&&(l.length>=r||m>=i)&&await new Mc(I=>{d=I})}l.push(qc)}catch(S){let I=Uc(S);Wc(I,w,y),l.push(I)}finally{h=!0,f&&(f(),f=null)}}s(g,"pump"),g();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===qc)return;if(o.aborted)throw new je;S!==en&&(yield S),l.shift(),b()}await new Mc(S=>{f=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(tn,"map");function yg(t=void 0){return t!=null&&Ft(t,"options"),t?.signal!=null&&It(t.signal,"options.signal"),s(async function*(){let i=0;for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new je({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}s(yg,"asIndexedPairs");async function $c(t,e=void 0){for await(let i of ls.call(this,t,e))return!0;return!1}s($c,"some");async function mg(t,e=void 0){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);return!await $c.call(this,async(...i)=>!await t(...i),e)}s(mg,"every");async function bg(t,e){for await(let i of ls.call(this,t,e))return i}s(bg,"find");async function gg(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),en}s(i,"forEachFn");for await(let r of tn.call(this,i,e));}s(gg,"forEach");function ls(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:en}return s(i,"filterFn"),tn.call(this,i,e)}s(ls,"filter");var Zr=class extends Zb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(Zr,"ReduceAwareErrMissingArgs");async function wg(t,e,i){var r;if(typeof t!="function")throw new Xi("reducer",["Function","AsyncFunction"],t);i!=null&&Ft(i,"options"),i?.signal!=null&&It(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new je(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await rg(this.destroy(f)),f}let o=new Jb,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[tg]:this,[ig]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let l=!1;try{for await(let f of this){var u;if(l=!0,i!=null&&(u=i.signal)!==null&&u!==void 0&&u.aborted)throw new je;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!l&&!n)throw new Zr}finally{o.abort()}return e}s(wg,"reduce");async function Sg(t){t!=null&&Ft(t,"options"),t?.signal!=null&&It(t.signal,"options.signal");let e=[];for await(let r of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new je(void 0,{cause:t.signal.reason});cg(e,r)}return e}s(Sg,"toArray");function _g(t,e){let i=tn.call(this,t,e);return s(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}s(_g,"flatMap");function zc(t){if(t=fg(t),dg(t))return 0;if(t<0)throw new eg("number",">= 0",t);return t}s(zc,"toIntegerOrInfinity");function Eg(t,e=void 0){return e!=null&&Ft(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),t=zc(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;t--<=0&&(yield o)}},"drop").call(this)}s(Eg,"drop");function xg(t,e=void 0){return e!=null&&Ft(e,"options"),e?.signal!=null&&It(e.signal,"options.signal"),t=zc(t),s(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new je;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(xg,"take");cs.exports.streamReturningOperators={asIndexedPairs:lg(yg,"readable.asIndexedPairs will be removed in a future version."),drop:Eg,filter:ls,flatMap:_g,map:tn,take:xg,compose:pg};cs.exports.promiseReturningOperators={every:mg,forEach:gg,reduce:wg,toArray:Sg,some:$c,find:bg}});var us=N((h0,Hc)=>{"use strict";var{ArrayPrototypePop:vg,Promise:Ag}=O(),{isIterable:kg,isNodeStream:Ng,isWebStream:Tg}=Me(),{pipelineImpl:Ig}=Xr(),{finished:Fg}=Ye();fs();function Pg(...t){return new Ag((e,i)=>{let r,n,o=t[t.length-1];if(o&&typeof o=="object"&&!Ng(o)&&!kg(o)&&!Tg(o)){let a=vg(t);r=a.signal,n=a.end}Ig(t,(a,l)=>{a?i(a):e(l)},{signal:r,end:n})})}s(Pg,"pipeline");Hc.exports={finished:Fg,pipeline:Pg}});var fs=N((y0,tu)=>{var{Buffer:Lg}=He(),{ObjectDefineProperty:Ze,ObjectKeys:Yc,ReflectApply:Xc}=O(),{promisify:{custom:Jc}}=Z(),{streamReturningOperators:Kc,promiseReturningOperators:Gc}=Vc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Qc}}=te(),Cg=as(),{setDefaultHighWaterMark:Rg,getDefaultHighWaterMark:Og}=qi(),{pipeline:Zc}=Xr(),{destroyer:Bg}=xt(),eu=Ye(),ds=us(),Ji=Me(),L=tu.exports=Cr().Stream;L.isDestroyed=Ji.isDestroyed;L.isDisturbed=Ji.isDisturbed;L.isErrored=Ji.isErrored;L.isReadable=Ji.isReadable;L.isWritable=Ji.isWritable;L.Readable=zi();for(let t of Yc(Kc)){let i=function(...r){if(new.target)throw Qc();return L.Readable.from(Xc(e,this,r))};Mg=i,s(i,"fn");let e=Kc[t];Ze(i,"name",{__proto__:null,value:e.name}),Ze(i,"length",{__proto__:null,value:e.length}),Ze(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Mg;for(let t of Yc(Gc)){let i=function(...n){if(new.target)throw Qc();return Xc(e,this,n)};Mg=i,s(i,"fn");let e=Gc[t];Ze(i,"name",{__proto__:null,value:e.name}),Ze(i,"length",{__proto__:null,value:e.length}),Ze(L.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Mg;L.Writable=Hr();L.Duplex=qe();L.Transform=Go();L.PassThrough=Xo();L.pipeline=Zc;var{addAbortSignal:Dg}=Wi();L.addAbortSignal=Dg;L.finished=eu;L.destroy=Bg;L.compose=Cg;L.setDefaultHighWaterMark=Rg;L.getDefaultHighWaterMark=Og;Ze(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return ds}});Ze(Zc,Jc,{__proto__:null,enumerable:!0,get(){return ds.pipeline}});Ze(eu,Jc,{__proto__:null,enumerable:!0,get(){return ds.finished}});L.Stream=L;L._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");L._uint8ArrayToBuffer=s(function(e){return Lg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var iu=N((b0,j)=>{"use strict";var H=fs(),Ug=us(),Wg=H.Readable.destroy;j.exports=H.Readable;j.exports._uint8ArrayToBuffer=H._uint8ArrayToBuffer;j.exports._isUint8Array=H._isUint8Array;j.exports.isDisturbed=H.isDisturbed;j.exports.isErrored=H.isErrored;j.exports.isReadable=H.isReadable;j.exports.Readable=H.Readable;j.exports.Writable=H.Writable;j.exports.Duplex=H.Duplex;j.exports.Transform=H.Transform;j.exports.PassThrough=H.PassThrough;j.exports.addAbortSignal=H.addAbortSignal;j.exports.finished=H.finished;j.exports.destroy=H.destroy;j.exports.destroy=Wg;j.exports.pipeline=H.pipeline;j.exports.compose=H.compose;Object.defineProperty(H,"promises",{configurable:!0,enumerable:!0,get(){return Ug}});j.exports.Stream=H.Stream;j.exports.default=j.exports});var $g={};er($g,{ActionType:()=>or,ApiError:()=>c,Async:()=>gi,AsyncFile:()=>Mt,AsyncFileIndexFS:()=>an,AsyncMirror:()=>ef,AsyncMirrorFS:()=>yt,AsyncStoreFS:()=>ar,BigIntStats:()=>G,ErrorCode:()=>z,ErrorStrings:()=>cn,File:()=>vi,FileIndex:()=>Pt,FileIndexFS:()=>pi,FileSystem:()=>J,FileType:()=>U,InMemory:()=>bn,InMemoryStore:()=>Ii,IndexDirInode:()=>et,IndexFileInode:()=>Zi,IndexInode:()=>hi,Inode:()=>he,LockedFS:()=>jt,MirrorFile:()=>Ni,Mutex:()=>qt,NoSyncFile:()=>pt,Overlay:()=>tf,OverlayFS:()=>zt,OverlayFile:()=>$t,PreloadFile:()=>oe,Readonly:()=>dn,SimpleSyncTransaction:()=>Ut,Stats:()=>M,StatsCommon:()=>Bt,Sync:()=>ht,SyncFile:()=>nr,SyncFileIndexFS:()=>sn,SyncStoreFS:()=>Wt,SyncStoreFile:()=>Ti,UnlockedOverlayFS:()=>Fi,checkOptions:()=>fn,configure:()=>qg,createBackend:()=>mu,decode:()=>X,decodeDirListing:()=>mi,default:()=>jg,encode:()=>R,encodeDirListing:()=>ae,flagToMode:()=>it,flagToNumber:()=>Zu,flagToString:()=>ws,fs:()=>Qi,initialize:()=>ru,isAppendable:()=>rt,isBackend:()=>bi,isBackendConfig:()=>bs,isBlockDevice:()=>Yu,isCharacterDevice:()=>Xu,isDirectory:()=>Hu,isExclusive:()=>_s,isFIFO:()=>Ju,isFile:()=>Vu,isReadable:()=>ze,isSocket:()=>Gu,isSymbolicLink:()=>Ku,isSynchronous:()=>xi,isTruncating:()=>Ss,isWriteable:()=>ye,levenshtein:()=>un,mkdirpSync:()=>ms,parseFlag:()=>P,pathExistsAction:()=>Ai,pathNotExistsAction:()=>ki,randomIno:()=>Dt,resolveBackend:()=>ir,rootCred:()=>_e,rootIno:()=>pe,setImmediate:()=>yu,size_max:()=>rr,wait:()=>pu});var z=(g=>(g[g.EPERM=1]="EPERM",g[g.ENOENT=2]="ENOENT",g[g.EIO=5]="EIO",g[g.EBADF=9]="EBADF",g[g.EACCES=13]="EACCES",g[g.EBUSY=16]="EBUSY",g[g.EEXIST=17]="EEXIST",g[g.ENOTDIR=20]="ENOTDIR",g[g.EISDIR=21]="EISDIR",g[g.EINVAL=22]="EINVAL",g[g.EFBIG=27]="EFBIG",g[g.ENOSPC=28]="ENOSPC",g[g.EROFS=30]="EROFS",g[g.EDEADLK=35]="EDEADLK",g[g.ENOTEMPTY=39]="ENOTEMPTY",g[g.ENOTSUP=95]="ENOTSUP",g))(z||{}),cn={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[35]:"Resource deadlock would occur",[39]:"Directory is not empty.",[95]:"Operation is not supported."},c=class extends Error{constructor(i,r=cn[i],n,o=""){super(r);this.errno=i;this.path=n;this.syscall=o;this.code=z[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let r=new c(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 c(z[i],cn[z[i]],r,n)}code;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(c,"ApiError");var du="/",ps="/";function Ct(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(Ct,"validateString");function ys(t,e){let i="",r=0,n=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||o===1))if(o===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let u=i.lastIndexOf("/");u===-1?(i="",r=0):(i=i.slice(0,u),r=i.length-1-i.lastIndexOf("/")),n=l,o=0;continue}else if(i.length!==0){i="",r=0,n=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,l):i=t.slice(n+1,l),r=l-n-1;n=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(ys,"normalizeString");function Te(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){let n=r>=0?t[r]:du;Ct(n,`paths[${r}]`),n.length!==0&&(e=`${n}/${e}`,i=n[0]==="/")}return e=ys(e,!i),i?`/${e}`:e.length>0?e:"."}s(Te,"resolve");function hu(t){if(Ct(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=ys(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}s(hu,"normalize");function de(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let r=t[i];Ct(r,"path"),r.length>0&&(e===void 0?e=r:e+=`/${r}`)}return e===void 0?".":hu(e)}s(de,"join");function x(t){if(Ct(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,r=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(x,"dirname");function C(t,e){e!==void 0&&Ct(e,"ext"),Ct(t,"path");let i=0,r=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!n){i=l+1;break}}else a===-1&&(n=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(r=l):(o=-1,r=a));return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":t.slice(i,r)}s(C,"basename");function ms(t,e,i,r){r.existsSync(t,i)||(ms(x(t),e,i,r),r.mkdirSync(t,e,i))}s(ms,"mkdirpSync");function tr(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}s(tr,"_min");function un(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,r=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(r-1);)i--,r--;let n=0;for(;n<i&&t.charCodeAt(n)===e.charCodeAt(n);)n++;if(i-=n,r-=n,i===0||r===1)return r;let o=new Array(i<<1);for(let m=0;m<i;)o[i+m]=t.charCodeAt(n+m),o[m]=++m;let a,l,u,f,d;for(a=0;a+3<r;){let m=e.charCodeAt(n+(l=a)),y=e.charCodeAt(n+(u=a+1)),w=e.charCodeAt(n+(f=a+2)),b=e.charCodeAt(n+(d=a+3)),g=a+=4;for(let S=0;S<i;){let I=o[i+S],D=o[S];l=tr(D,l,u,m,I),u=tr(l,u,f,y,I),f=tr(u,f,d,w,I),g=tr(f,d,g,b,I),o[S++]=g,d=f,f=u,u=l,l=D}}let h=0;for(;a<r;){let m=e.charCodeAt(n+(l=a));h=++a;for(let y=0;y<i;y++){let w=o[y];o[y]=h=w<l||h<l?w>h?h+1:w+1:m===o[i+y]?l:l+1,l=w}}return h}s(un,"levenshtein");function pu(t){return new Promise(e=>{setTimeout(e,t)})}s(pu,"wait");var yu=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function R(t,e="utf8"){if(typeof t!="string")throw new c(22,"Can not encode a non-string");switch(e){case"ascii":return new Uint8Array(Array.from(t).map(r=>r.charCodeAt(0)&127));case"latin1":case"binary":return new Uint8Array(Array.from(t).map(r=>r.charCodeAt(0)));case"utf8":case"utf-8":return new Uint8Array(Array.from(t).flatMap(r=>{let n=r.charCodeAt(0);if(n<128)return n;let o=n&63|128;if(n<2048)return[n>>6|192,o];let a=n>>6&63|128;return n<65536?[n>>12|224,a,o]:[n>>18|240,n>>12&63|128,a,o]}));case"base64":return R(atob(t),"binary");case"base64url":return R(t.replace("_","/").replace("-","+"),"base64");case"hex":return new Uint8Array(t.match(/.{1,2}/g).map(r=>parseInt(r,16)));case"utf16le":case"ucs2":case"ucs-2":let i=new Uint16Array(new ArrayBuffer(t.length*2));for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return new Uint8Array(i.buffer);default:throw new c(22,"Invalid encoding: "+e)}}s(R,"encode");function X(t,e="utf8"){if(!(t instanceof Uint8Array))throw new c(22,"Can not decode a non-Uint8Array");switch(e){case"ascii":return Array.from(t).map(n=>String.fromCharCode(n&127)).join("");case"latin1":case"binary":return Array.from(t).map(n=>String.fromCharCode(n)).join("");case"utf8":case"utf-8":let i="";for(let n=0;n<t.length;n++){let o;t[n]<128?o=t[n]:t[n]<224?o=(t[n]&31)<<6|t[++n]&63:t[n]<240?o=(t[n]&15)<<12|(t[++n]&63)<<6|t[++n]&63:o=(t[n]&7)<<18|(t[++n]&63)<<12|(t[++n]&63)<<6|t[++n]&63,i+=String.fromCharCode(o)}return i;case"utf16le":case"ucs2":case"ucs-2":let r="";for(let n=0;n<t.length;n+=2){let o=t[n]|t[n+1]<<8;r+=String.fromCharCode(o)}return r;case"base64":return btoa(X(t,"binary"));case"base64url":return X(t,"base64").replace("/","_").replace("+","-");case"hex":return Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("");default:throw new c(22,"Invalid encoding: "+e)}}s(X,"decode");function mi(t){return JSON.parse(X(t),(e,i)=>e==""?i:BigInt(i))}s(mi,"decodeDirListing");function ae(t){return R(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(ae,"encodeDirListing");function bi(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(bi,"isBackend");async function fn(t,e){if(typeof e!="object"||e===null)throw new c(22,"Invalid options");for(let[i,r]of Object.entries(t.options)){let n=e?.[i];if(n==null){if(!r.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:un(i,l)})).filter(l=>l.distance<5).sort((l,u)=>l.distance-u.distance);throw new c(22,`${t.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 c(22,`${t.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(fn,"checkOptions");function mu(t,e){return fn(t,e),t.create(e).ready()}s(mu,"createBackend");function bs(t){return t!=null&&typeof t=="object"&&"backend"in t}s(bs,"isBackendConfig");async function ir(t,e=0){if(typeof t!="object"||t==null)throw new c(22,"Invalid options on configuration object.");let{backend:i}=t;if(!bi(i))throw new c(22,"Missing or invalid backend");let r=Object.keys(t).filter(o=>o!="backend");for(let o of r){let a=t[o];if(bi(a)&&(a={backend:a}),bs(a)){if(e>10)throw new c(22,"Invalid configuration, too deep and possibly infinite");t[o]=await ir(a,++e)}}if(!await i.isAvailable())throw new c(1,"Backend not available: "+i);fn(i,t);let n=i.create(t);return await n.ready(),n}s(ir,"resolveBackend");var J=class{metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};s(J,"FileSystem");function ht(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!0}}async ready(){return this}async exists(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 s(e,"_SyncFileSystem"),e}s(ht,"Sync");function gi(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!1}}renameSync(r,n,o){throw new c(95)}statSync(r,n){throw new c(95)}createFileSync(r,n,o,a){throw new c(95)}openFileSync(r,n,o){throw new c(95)}unlinkSync(r,n){throw new c(95)}rmdirSync(r,n){throw new c(95)}mkdirSync(r,n,o){throw new c(95)}readdirSync(r,n){throw new c(95)}linkSync(r,n,o){throw new c(95)}syncSync(r,n,o){throw new c(95)}}return s(e,"_AsyncFileSystem"),e}s(gi,"Async");function dn(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(r,n,o){throw new c(30)}renameSync(r,n,o){throw new c(30)}async createFile(r,n,o,a){throw new c(30)}createFileSync(r,n,o,a){throw new c(30)}async unlink(r,n){throw new c(30)}unlinkSync(r,n){throw new c(30)}async rmdir(r,n){throw new c(30)}rmdirSync(r,n){throw new c(30)}async mkdir(r,n,o){throw new c(30)}mkdirSync(r,n,o){throw new c(30)}async link(r,n,o){throw new c(30)}linkSync(r,n,o){throw new c(30)}async sync(r,n,o){throw new c(30)}syncSync(r,n,o){throw new c(30)}}return s(e,"_ReadonlyFileSystem"),e}s(dn,"Readonly");var Ei={};er(Ei,{COPYFILE_EXCL:()=>gu,COPYFILE_FICLONE:()=>wu,COPYFILE_FICLONE_FORCE:()=>Su,F_OK:()=>hn,O_APPEND:()=>Le,O_CREAT:()=>K,O_DIRECT:()=>Nu,O_DIRECTORY:()=>Eu,O_DSYNC:()=>Au,O_EXCL:()=>Fe,O_NOATIME:()=>xu,O_NOCTTY:()=>_u,O_NOFOLLOW:()=>vu,O_NONBLOCK:()=>Tu,O_RDONLY:()=>Rt,O_RDWR:()=>re,O_SYMLINK:()=>ku,O_SYNC:()=>Ot,O_TRUNC:()=>Pe,O_WRONLY:()=>Ie,R_OK:()=>Se,S_IFBLK:()=>Fu,S_IFCHR:()=>Pu,S_IFDIR:()=>_i,S_IFIFO:()=>Lu,S_IFLNK:()=>wi,S_IFMT:()=>ne,S_IFREG:()=>Si,S_IFSOCK:()=>Iu,S_IRGRP:()=>Uu,S_IROTH:()=>ju,S_IRUSR:()=>Bu,S_IRWXG:()=>yn,S_IRWXO:()=>mn,S_IRWXU:()=>pn,S_ISGID:()=>Ru,S_ISUID:()=>Cu,S_ISVTX:()=>Ou,S_IWGRP:()=>Wu,S_IWOTH:()=>$u,S_IWUSR:()=>Du,S_IXGRP:()=>qu,S_IXOTH:()=>zu,S_IXUSR:()=>Mu,W_OK:()=>le,X_OK:()=>bu});var hn=0,Se=4,le=2,bu=1,gu=1,wu=2,Su=4,Rt=0,Ie=1,re=2,K=64,Fe=128,_u=256,Pe=512,Le=1024,Eu=65536,xu=262144,vu=131072,Ot=1052672,Au=4096,ku=32768,Nu=16384,Tu=2048,ne=61440,Iu=49152,wi=40960,Si=32768,Fu=24576,_i=16384,Pu=8192,Lu=4096,Cu=2048,Ru=1024,Ou=512,pn=448,Bu=256,Du=128,Mu=64,yn=56,Uu=32,Wu=16,qu=8,mn=7,ju=4,$u=2,zu=1;var U=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(U||{}),Bt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:i,ctimeMs:r,birthtimeMs:n,uid:o,gid:a,size:l,mode:u}={}){let f=Date.now(),d=s((m,y)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:y),"resolveT");this.atimeMs=d(e,f),this.mtimeMs=d(i,f),this.ctimeMs=d(r,f),this.birthtimeMs=d(n,f),this.uid=d(o,0),this.gid=d(a,0),this.size=this._convert(l);let h=Number(u)&61440||U.FILE;if(u)this.mode=this._convert(u);else switch(h){case U.FILE:this.mode=this._convert(420);break;case U.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(h))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,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(e&this.mode&r)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}};s(Bt,"StatsCommon");var M=class extends Bt{_isBigint=!1;static clone(e){return new M(e)}};s(M,"Stats");var G=class extends Bt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new G(e)}};s(G,"BigIntStats");function Vu(t){return(Number(t.mode)&61440)===32768}s(Vu,"isFile");function Hu(t){return(Number(t.mode)&61440)===16384}s(Hu,"isDirectory");function Ku(t){return(Number(t.mode)&61440)===40960}s(Ku,"isSymbolicLink");function Gu(){return!1}s(Gu,"isSocket");function Yu(){return!1}s(Yu,"isBlockDevice");function Xu(){return!1}s(Xu,"isCharacterDevice");function Ju(){return!1}s(Ju,"isFIFO");var rr=2**32-1,pe=0n;function gs(){return Math.round(Math.random()*2**32).toString(16)}s(gs,"_random");function Dt(){return BigInt("0x"+gs()+gs())}s(Dt,"randomIno");var he=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Dt(),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(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new M(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};s(he,"Inode");var or=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(or||{}),Qu=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function P(t){if(typeof t=="number")return ws(t);if(!Qu.includes(t))throw new Error("Invalid flag string: "+t);return t}s(P,"parseFlag");function ws(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}s(ws,"flagToString");function Zu(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}s(Zu,"flagToNumber");function it(t){let e=0;return e<<=1,e+=+ze(t),e<<=1,e+=+ye(t),e<<=1,e}s(it,"flagToMode");function ze(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(ze,"isReadable");function ye(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(ye,"isWriteable");function Ss(t){return t.indexOf("w")!==-1}s(Ss,"isTruncating");function rt(t){return t.indexOf("a")!==-1}s(rt,"isAppendable");function xi(t){return t.indexOf("s")!==-1}s(xi,"isSynchronous");function _s(t){return t.indexOf("x")!==-1}s(_s,"isExclusive");function Ai(t){return _s(t)?1:Ss(t)?2:0}s(Ai,"pathExistsAction");function ki(t){return(ye(t)||rt(t))&&t!=="r+"?3:1}s(ki,"pathNotExistsAction");var vi=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(vi,"File");var oe=class extends vi{constructor(i,r,n,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:rr}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(ze(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return rt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async stat(){return new M(this.stats)}statSync(){return new M(this.stats)}truncate(i){if(this.truncateSync(i),xi(this.flag)&&!this.fs.metadata().synchronous)return this.sync()}truncateSync(i){if(this._dirty=!0,!ye(this.flag))throw new c(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),xi(this.flag)&&this.fs.metadata().synchronous&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),xi(this.flag)&&this.fs.metadata().synchronous&&this.syncSync()}async write(i,r=0,n=this.stats.size,o=0){return this.writeSync(i,r,n,o)}writeSync(i,r=0,n=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!ye(this.flag))throw new c(1,"File not opened with a writeable mode.");let a=o+n;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let f=new Uint8Array(new ArrayBuffer(a,{maxByteLength:rr}));f.set(this._buffer),this._buffer=f}let l=i.slice(r,r+n);this._buffer.set(l,o);let u=l.byteLength;return this.stats.mtimeMs=Date.now(),xi(this.flag)?(this.syncSync(),u):(this.position=o+u,u)}async read(i,r=0,n=this.stats.size,o=0){return{bytesRead:this.readSync(i,r,n,o),buffer:i}}readSync(i,r=0,n=this.stats.size,o=0){if(!ze(this.flag))throw new c(1,"File not opened with a readable mode.");o??=this.position;let a=o+n;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-o;return l==0||i.set(this._buffer.slice(o,a),r),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.chownSync(i,r)}chownSync(i,r){this._dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.utimesSync(i,r)}utimesSync(i,r){this._dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};s(oe,"PreloadFile");var nr=class extends oe{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(nr,"SyncFile");var pt=class extends oe{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(pt,"NoSyncFile");var _e={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Ni=class extends oe{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(Ni,"MirrorFile");var yt=class extends ht(J){_queue=[];_queueRunning=!1;_sync;_async;_isInitialized=!1;_ready;async ready(){return await this._ready,this}constructor({sync:e,async:i}){super(),this._sync=e,this._async=i,this._ready=this._initialize()}metadata(){return{...super.metadata(),name:yt.name,synchronous:!0,supportsProperties:this._sync.metadata().supportsProperties&&this._async.metadata().supportsProperties}}syncSync(e,i,r){this._sync.syncSync(e,i,r),this.enqueue({apiMethod:"sync",arguments:[e,i,r]})}openFileSync(e,i,r){return this._sync.openFileSync(e,i,r)}createFileSync(e,i,r,n){let o=this._sync.createFileSync(e,i,r,n);this.enqueue({apiMethod:"createFile",arguments:[e,i,r,n]});let a=o.statSync(),l=new Uint8Array(a.size);return o.readSync(l),new Ni(this,e,i,a,l)}linkSync(e,i,r){this._sync.linkSync(e,i,r),this.enqueue({apiMethod:"link",arguments:[e,i,r]})}renameSync(e,i,r){this._sync.renameSync(e,i,r),this.enqueue({apiMethod:"rename",arguments:[e,i,r]})}statSync(e,i){return this._sync.statSync(e,i)}unlinkSync(e,i){this._sync.unlinkSync(e,i),this.enqueue({apiMethod:"unlink",arguments:[e,i]})}rmdirSync(e,i){this._sync.rmdirSync(e,i),this.enqueue({apiMethod:"rmdir",arguments:[e,i]})}mkdirSync(e,i,r){this._sync.mkdirSync(e,i,r),this.enqueue({apiMethod:"mkdir",arguments:[e,i,r]})}readdirSync(e,i){return this._sync.readdirSync(e,i)}existsSync(e,i){return this._sync.existsSync(e,i)}async crossCopyDirectory(e,i){if(e!=="/"){let n=await this._async.stat(e,_e);this._sync.mkdirSync(e,i,n.cred())}let r=await this._async.readdir(e,_e);for(let n of r)await this.crossCopy(de(e,n))}async crossCopyFile(e,i){let r=await this._async.openFile(e,P("r"),_e),n=this._sync.createFileSync(e,P("w"),i,_e);try{let{size:o}=await r.stat(),a=new Uint8Array(o);await r.read(a),n.writeSync(a)}finally{await r.close(),n.closeSync()}}async crossCopy(e){let i=await this._async.stat(e,_e);i.isDirectory()?await this.crossCopyDirectory(e,i.mode):await this.crossCopyFile(e,i.mode)}async _initialize(){if(!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let e=this._queue.shift();try{await this._async[e.apiMethod](...e.arguments)}catch(i){throw new c(5,"AsyncMirror desync: "+i)}await this._next()}enqueue(e){this._queue.push(e),!this._queueRunning&&(this._queueRunning=!0,this._next())}};s(yt,"AsyncMirrorFS");var ef={name:"AsyncMirror",options:{sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if("metadata"in t&&!t.metadata().synchronous)throw new c(22,'"sync" option must be a file system that supports synchronous operations')}},async:{type:"object",description:"The asynchronous file system to mirror."}},isAvailable(){return!0},create(t){return new yt(t)}};var sr=class{constructor(e){this.limit=e}cache=[];set(e,i){let r=this.cache.findIndex(n=>n.key===e);r!=-1?this.cache.splice(r,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(r=>r.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(r=>r.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};s(sr,"LRUCache");var Mt=class extends oe{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this.resetDirty())}syncSync(){throw new c(95)}async close(){this.sync()}closeSync(){throw new c(95)}};s(Mt,"AsyncFile");var ar=class extends gi(J){store;_cache;_ready;ready(){return this._ready}metadata(){return{...super.metadata(),name:this.store.name}}constructor({store:e,cacheSize:i}){super(),i>0&&(this._cache=new sr(i)),this._ready=this._initialize(e)}async _initialize(e){return this.store=await e,await this.makeRootDirectory(),this}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(e,i,r){let n=this._cache;this._cache&&(this._cache=null,n.reset());try{let o=this.store.beginTransaction(),a=x(e),l=C(e),u=x(i),f=C(i),d=await this.findINode(o,a),h=await this.getDirListing(o,d,a);if(!d.toStats().hasAccess(2,r))throw c.With("EACCES",e,"rename");if(!h[l])throw c.With("ENOENT",e,"rename");let m=h[l];if(delete h[l],(u+"/").indexOf(e+"/")===0)throw new c(16,a);let y,w;if(u===a?(y=d,w=h):(y=await this.findINode(o,u),w=await this.getDirListing(o,y,u)),w[f]){let b=await this.getINode(o,w[f],i);if(b.toStats().isFile())try{await o.remove(b.ino),await o.remove(w[f])}catch(g){throw await o.abort(),g}else throw c.With("EPERM",i,"rename")}w[f]=m;try{await o.put(d.ino,ae(h),!0),await o.put(y.ino,ae(w),!0)}catch(b){throw await o.abort(),b}await o.commit()}finally{n&&(this._cache=n)}}async stat(e,i){let r=this.store.beginTransaction(),n=await this.findINode(r,e);if(!n)throw c.With("ENOENT",e,"stat");let o=n.toStats();if(!o.hasAccess(4,i))throw c.With("EACCES",e,"stat");return o}async createFile(e,i,r,n){let o=this.store.beginTransaction(),a=new Uint8Array(0),l=await this.commitNewFile(o,e,U.FILE,r,n,a);return new Mt(this,e,i,l.toStats(),a)}async openFile(e,i,r){let n=this.store.beginTransaction(),o=await this.findINode(n,e),a=await n.get(o.ino);if(!o.toStats().hasAccess(it(i),r))throw c.With("EACCES",e,"openFile");if(!a)throw c.With("ENOENT",e,"openFile");return new Mt(this,e,i,o.toStats(),a)}async unlink(e,i){return this.removeEntry(e,!1,i)}async rmdir(e,i){if((await this.readdir(e,i)).length>0)throw c.With("ENOTEMPTY",e,"rmdir");await this.removeEntry(e,!0,i)}async mkdir(e,i,r){let n=this.store.beginTransaction(),o=R("{}");await this.commitNewFile(n,e,U.DIRECTORY,i,r,o)}async readdir(e,i){let r=this.store.beginTransaction(),n=await this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw c.With("EACCES",e,"readdur");return Object.keys(await this.getDirListing(r,n,e))}async sync(e,i,r){let n=this.store.beginTransaction(),o=await this._findINode(n,x(e),C(e)),a=await this.getINode(n,o,e),l=a.update(r);try{await n.put(a.ino,i,!0),l&&await n.put(o,a.data,!0)}catch(u){throw await n.abort(),u}await n.commit()}async link(e,i,r){let n=this.store.beginTransaction(),o=x(e);if(!(await this.findINode(n,o)).toStats().hasAccess(4,r))throw c.With("EACCES",o,"link");let l=x(i),u=await this.findINode(n,l),f=await this.getDirListing(n,u,l);if(!u.toStats().hasAccess(2,r))throw c.With("EACCES",l,"link");let d=await this._findINode(n,o,C(e)),h=await this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw c.With("EACCES",i,"link");h.nlink++,f[C(i)]=d;try{n.put(d,h.data,!0),n.put(u.ino,ae(f),!0)}catch(m){throw n.abort(),m}n.commit()}async makeRootDirectory(){let e=this.store.beginTransaction();if(await e.get(pe)===void 0){let i=new he;i.mode=511|U.DIRECTORY,await e.put(i.ino,R("{}"),!1),await e.put(pe,i.data,!1),await e.commit()}}async _findINode(e,i,r,n=new Set){let o=de(i,r);if(n.has(o))throw new c(5,"Infinite loop detected while finding inode",o);if(n.add(o),this._cache){let a=this._cache.get(o);if(a)return a}if(i==="/"){if(r==="")return this._cache&&this._cache.set(o,pe),pe;{let a=await this.getINode(e,pe,i),l=await this.getDirListing(e,a,i);if(l[r]){let u=l[r];return this._cache&&this._cache.set(o,u),u}else throw c.With("ENOENT",Te(i,r),"_findINode")}}else{let a=await this.findINode(e,i,n),l=await this.getDirListing(e,a,i);if(l[r]){let u=l[r];return this._cache&&this._cache.set(o,u),u}else throw c.With("ENOENT",Te(i,r),"_findINode")}}async findINode(e,i,r=new Set){let n=await this._findINode(e,x(i),C(i),r);return this.getINode(e,n,i)}async getINode(e,i,r){let n=await e.get(i);if(!n)throw c.With("ENOENT",r,"getINode");return new he(n.buffer)}async getDirListing(e,i,r){if(!i.toStats().isDirectory())throw c.With("ENOTDIR",r,"getDirListing");let n=await e.get(i.ino);if(!n)throw c.With("ENOENT",r,"getDirListing");return mi(n)}async addNewNode(e,i,r=5){if(r<=0)throw new c(5,"Unable to commit data to key-value store.");let n=Dt();return await e.put(n,i,!1)?n:await this.addNewNode(e,i,--r)}async commitNewFile(e,i,r,n,o,a){let l=x(i),u=C(i),f=await this.findINode(e,l),d=await this.getDirListing(e,f,l);if(!f.toStats().hasAccess(2,o))throw c.With("EACCES",i,"commitNewFile");if(i==="/")throw c.With("EEXIST",i,"commitNewFile");if(d[u])throw await e.abort(),c.With("EEXIST",i,"commitNewFile");try{let h=new he;return h.ino=await this.addNewNode(e,a),h.mode=n|r,h.uid=o.uid,h.gid=o.gid,h.size=a.length,d[u]=await this.addNewNode(e,h.data),await e.put(f.ino,ae(d),!0),await e.commit(),h}catch(h){throw e.abort(),h}}async removeEntry(e,i,r){this._cache&&this._cache.remove(e);let n=this.store.beginTransaction(),o=x(e),a=await this.findINode(n,o),l=await this.getDirListing(n,a,o),u=C(e);if(!l[u])throw c.With("ENOENT",e,"removeEntry");let f=l[u],d=await this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw c.With("EACCES",e,"removeEntry");if(delete l[u],!i&&d.toStats().isDirectory())throw c.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw c.With("ENOTDIR",e,"removeEntry");try{await n.put(a.ino,ae(l),!0),--d.nlink<1&&(await n.remove(d.ino),await n.remove(f))}catch(h){throw await n.abort(),h}await n.commit()}};s(ar,"AsyncStoreFS");var Ut=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,r){return this.markModified(e),this.store.put(e,i,r)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(Ut,"SimpleSyncTransaction");var Ti=class extends oe{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};s(Ti,"SyncStoreFile");var Wt=class extends ht(J){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,r){let n=this.store.beginTransaction(),o=x(e),a=C(e),l=x(i),u=C(i),f=this.findINode(n,o),d=this.getDirListing(n,f,o);if(!f.toStats().hasAccess(2,r))throw c.With("EACCES",e,"renameSync");if(!d[a])throw c.With("ENOENT",e,"renameSync");let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new c(16,o);let m,y;if(l===o?(m=f,y=d):(m=this.findINode(n,l),y=this.getDirListing(n,m,l)),y[u]){let w=this.getINode(n,y[u],i);if(w.toStats().isFile())try{n.remove(w.ino),n.remove(y[u])}catch(b){throw n.abort(),b}else throw c.With("EPERM",i,"renameSync")}y[u]=h;try{n.put(f.ino,ae(d),!0),n.put(m.ino,ae(y),!0)}catch(w){throw n.abort(),w}n.commit()}statSync(e,i){let r=this.findINode(this.store.beginTransaction(),e).toStats();if(!r.hasAccess(4,i))throw c.With("EACCES",e,"statSync");return r}createFileSync(e,i,r,n){return this.commitNewFile(e,U.FILE,r,n),this.openFileSync(e,i,n)}openFileSync(e,i,r){let n=this.store.beginTransaction(),o=this.findINode(n,e),a=n.get(o.ino);if(!o.toStats().hasAccess(it(i),r))throw c.With("EACCES",e,"openFileSync");if(a===null)throw c.With("ENOENT",e,"openFileSync");return new Ti(this,e,i,o.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw c.With("ENOTEMPTY",e,"rmdirSync");this.removeEntry(e,!0,i)}mkdirSync(e,i,r){this.commitNewFile(e,U.DIRECTORY,i,r,R("{}"))}readdirSync(e,i){let r=this.store.beginTransaction(),n=this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw c.With("EACCES",e,"readdirSync");return Object.keys(this.getDirListing(r,n,e))}syncSync(e,i,r){let n=this.store.beginTransaction(),o=this._findINode(n,x(e),C(e)),a=this.getINode(n,o,e),l=a.update(r);try{n.put(a.ino,i,!0),l&&n.put(o,a.data,!0)}catch(u){throw n.abort(),u}n.commit()}linkSync(e,i,r){let n=this.store.beginTransaction(),o=x(e);if(!this.findINode(n,o).toStats().hasAccess(4,r))throw c.With("EACCES",o,"linkSync");let l=x(i),u=this.findINode(n,l),f=this.getDirListing(n,u,l);if(!u.toStats().hasAccess(2,r))throw c.With("EACCES",l,"linkSync");let d=this._findINode(n,o,C(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw c.With("EACCES",i,"linkSync");h.nlink++,f[C(i)]=d;try{n.put(d,h.data,!0),n.put(u.ino,ae(f),!0)}catch(m){throw n.abort(),m}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(pe))return;let i=new he;i.mode=511|U.DIRECTORY,e.put(i.ino,R("{}"),!1),e.put(pe,i.data,!1),e.commit()}_findINode(e,i,r,n=new Set){let o=de(i,r);if(n.has(o))throw new c(5,"Infinite loop detected while finding inode",o);if(n.add(o),i!="/"){let a=this._findINode(e,x(i),C(i),n),l=this.getDirListing(e,this.getINode(e,a,i+ps+r),i);if(!(r in l))throw c.With("ENOENT",Te(i,r),"_findINode");return l[r]}if(r!=""){let a=this.getDirListing(e,this.getINode(e,pe,i),i);if(!(r in a))throw c.With("ENOENT",Te(i,r),"_findINode");return a[r]}return pe}findINode(e,i){let r=this._findINode(e,x(i),C(i));return this.getINode(e,r,i)}getINode(e,i,r){let n=e.get(i);if(!n)throw c.With("ENOENT",r,"getINode");return new he(n.buffer)}getDirListing(e,i,r){if(!i.toStats().isDirectory())throw c.With("ENOTDIR",r,"getDirListing");let n=e.get(i.ino);if(!n)throw c.With("ENOENT",r,"getDirListing");return mi(n)}addNewNode(e,i,r=5){for(let n=0;n<r;n++){let o=Dt();if(e.put(o,i,!1))return o}throw new c(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,r,n,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),u=C(e),f=this.findINode(a,l),d=this.getDirListing(a,f,l);if(!f.toStats().hasAccess(2,n))throw c.With("EACCES",e,"commitNewFile");if(e==="/")throw c.With("EEXIST",e,"commitNewFile");if(d[u])throw c.With("EEXIST",e,"commitNewFile");let h=new he;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=r|i,h.uid=n.uid,h.gid=n.gid,d[u]=this.addNewNode(a,h.data),a.put(f.ino,ae(d),!0)}catch(m){throw a.abort(),m}return a.commit(),h}removeEntry(e,i,r){let n=this.store.beginTransaction(),o=x(e),a=this.findINode(n,o),l=this.getDirListing(n,a,o),u=C(e),f=l[u];if(!f)throw c.With("ENOENT",e,"removeEntry");let d=this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw c.With("EACCES",e,"removeEntry");if(delete l[u],!i&&d.toStats().isDirectory())throw c.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw c.With("ENOTDIR",e,"removeEntry");try{n.put(a.ino,ae(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(f))}catch(h){throw n.abort(),h}n.commit()}};s(Wt,"SyncStoreFS");var Ii=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new Ut(this)}get(e){return this.store.get(e)}put(e,i,r){return!r&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};s(Ii,"InMemoryStore");var bn={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",description:"The name of the store"}},create({name:t}){return new Wt({store:new Ii(t)})}};var qt=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(qt,"Mutex");var jt=class{constructor(e){this.fs=e}_mu=new qt;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,r){await this._mu.lock(e),await this.fs.rename(e,i,r),this._mu.unlock(e)}renameSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,r)}async stat(e,i){await this._mu.lock(e);let r=await this.fs.stat(e,i);return this._mu.unlock(e),r}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,r){await this._mu.lock(e);let n=await this.fs.openFile(e,i,r);return this._mu.unlock(e),n}openFileSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,r)}async createFile(e,i,r,n){await this._mu.lock(e);let o=await this.fs.createFile(e,i,r,n);return this._mu.unlock(e),o}createFileSync(e,i,r,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,r,n)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,r){await this._mu.lock(e),await this.fs.mkdir(e,i,r),this._mu.unlock(e)}mkdirSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,r)}async readdir(e,i){await this._mu.lock(e);let r=await this.fs.readdir(e,i);return this._mu.unlock(e),r}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let r=await this.fs.exists(e,i);return this._mu.unlock(e),r}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,r){await this._mu.lock(e),await this.fs.link(e,i,r),this._mu.unlock(e)}linkSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,r)}async sync(e,i,r){await this._mu.lock(e),await this.fs.sync(e,i,r),this._mu.unlock(e)}syncSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,r)}};s(jt,"LockedFS");var gn="/.deleted",$t=class extends oe{constructor(e,i,r,n,o){super(e,i,r,n,o)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this.buffer,this.stats),this.resetDirty())}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this.buffer,this.stats),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};s($t,"OverlayFile");var Fi=class extends J{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata().readonly)throw new c(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:zt.name,synchronous:this._readable.metadata().synchronous&&this._writable.metadata().synchronous,supportsProperties:this._readable.metadata().supportsProperties&&this._writable.metadata().supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,r){let n=r.cred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,i,r)}syncSync(e,i,r){let n=r.cred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,i,r)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(gn,P("r"),_e),{size:i}=await e.stat(),{buffer:r}=await e.read(new Uint8Array(i));this._deleteLog=X(r)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,r)}catch{if(this._deletedFiles.has(e))throw c.With("ENOENT",e,"rename")}}renameSync(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,r)}catch{if(this._deletedFiles.has(e))throw c.With("ENOENT",e,"renameSync")}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw c.With("ENOENT",e,"stat");let n=new M(await this._readable.stat(e,i));return n.mode|=146,n}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw c.With("ENOENT",e,"statSync");let n=new M(this._readable.statSync(e,i));return n.mode|=146,n}}async openFile(e,i,r){if(await this._writable.exists(e,r))return this._writable.openFile(e,i,r);let n=await this._readable.openFile(e,P("r"),r),o=new M(await n.stat()),{buffer:a}=await n.read(new Uint8Array(o.size));return new $t(this,e,i,o,a)}openFileSync(e,i,r){if(this._writable.existsSync(e,r))return this._writable.openFileSync(e,i,r);let n=this._readable.openFileSync(e,P("r"),r),o=M.clone(n.statSync()),a=new Uint8Array(o.size);return n.readSync(a),new $t(this,e,i,o,a)}async createFile(e,i,r,n){return this.checkInitialized(),await this._writable.createFile(e,i,r,n),this.openFile(e,i,n)}createFileSync(e,i,r,n){return this.checkInitialized(),this._writable.createFileSync(e,i,r,n),this.openFileSync(e,i,n)}async link(e,i,r){this.checkInitialized(),await this._writable.link(e,i,r)}linkSync(e,i,r){this.checkInitialized(),this._writable.linkSync(e,i,r)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw c.With("ENOENT",e,"unlink");await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw c.With("ENOENT",e,"unlinkSync");this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw c.With("ENOENT",e,"rmdir");if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw c.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw c.With("ENOENT",e,"rmdirSync");if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw c.With("ENOTEMPTY",e,"rmdirSync");this.deletePath(e,i)}}async mkdir(e,i,r){if(this.checkInitialized(),await this.exists(e,r))throw c.With("EEXIST",e,"mkdir");await this.createParentDirectories(e,r),await this._writable.mkdir(e,i,r)}mkdirSync(e,i,r){if(this.checkInitialized(),this.existsSync(e,r))throw c.With("EEXIST",e,"mkdirSync");this.createParentDirectoriesSync(e,r),this._writable.mkdirSync(e,i,r)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw c.With("ENOTDIR",e,"readdir");let n=[];try{n.push(...await this._writable.readdir(e,i))}catch{}try{n.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw c.With("ENOTDIR",e,"readdirSync");let n=[];try{n=n.concat(this._writable.readdirSync(e,i))}catch{}try{n=n.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return n.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
3
- `,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let r=await this._writable.openFile(gn,P("w"),i);try{await r.write(R(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}catch(n){this._deleteLogError=n}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let e of this._deleteLog.split(`
4
- `))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new c(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==gn)throw c.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e,i){let r=x(e),n=[];for(;!this._writable.existsSync(r,i);)n.push(r),r=x(r);n=n.reverse();for(let o of n)this._writable.mkdirSync(o,this.statSync(o,i).mode,i)}async createParentDirectories(e,i){let r=x(e),n=[];for(;!await this._writable.exists(r,i);)n.push(r),r=x(r);n=n.reverse();for(let o of n){let a=await this.stat(o,i);await this._writable.mkdir(o,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw c.With("ENOENT",e,"operateOnWriteable");this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw c.With("ENOENT",e,"operateOnWritableAsync");if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let r=this.statSync(e,i);if(r.isDirectory()){this._writable.mkdirSync(e,r.mode,i);return}let n=new Uint8Array(r.size),o=this._readable.openFileSync(e,P("r"),i);o.readSync(n),o.closeSync();let a=this._writable.openFileSync(e,P("w"),i);a.writeSync(n),a.closeSync()}async copyToWritable(e,i){let r=await this.stat(e,i);if(r.isDirectory()){await this._writable.mkdir(e,r.mode,i);return}let n=new Uint8Array(r.size),o=await this._readable.openFile(e,P("r"),i);await o.read(n),await o.close();let a=await this._writable.openFile(e,P("w"),i);await a.write(n),await a.close()}};s(Fi,"UnlockedOverlayFS");var zt=class extends jt{async ready(){return await super.ready(),this}constructor(e){super(new Fi(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(zt,"OverlayFS");var tf={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new zt(t)}};var Qi={};er(Qi,{BigIntStats:()=>G,Dir:()=>fr,Dirent:()=>st,ReadStream:()=>rn,Stats:()=>M,WriteStream:()=>nn,_toUnixTimestamp:()=>xs,access:()=>kd,accessSync:()=>kf,appendFile:()=>id,appendFileSync:()=>cf,chmod:()=>_d,chmodSync:()=>Ef,chown:()=>wd,chownSync:()=>Sf,close:()=>nd,closeSync:()=>ot,constants:()=>Ei,copyFile:()=>Rd,copyFileSync:()=>If,createReadStream:()=>Fd,createWriteStream:()=>Pd,exists:()=>Gf,existsSync:()=>Sn,fchmod:()=>fd,fchmodSync:()=>An,fchown:()=>ud,fchownSync:()=>vn,fdatasync:()=>ad,fdatasyncSync:()=>df,fstat:()=>rd,fstatSync:()=>uf,fsync:()=>sd,fsyncSync:()=>ff,ftruncate:()=>od,ftruncateSync:()=>Ns,futimes:()=>dd,futimesSync:()=>kn,initialize:()=>cr,lchmod:()=>Ed,lchmodSync:()=>xf,lchown:()=>Sd,lchownSync:()=>_f,link:()=>md,linkSync:()=>bf,lopenSync:()=>ur,lstat:()=>Xf,lstatSync:()=>of,lutimes:()=>vd,lutimesSync:()=>Af,mkdir:()=>pd,mkdirSync:()=>mf,mkdtemp:()=>Cd,mkdtempSync:()=>Tf,mount:()=>lr,mounts:()=>Ee,open:()=>Zf,openSync:()=>Pi,opendir:()=>Dd,opendirSync:()=>Lf,promises:()=>yr,read:()=>cd,readFile:()=>ed,readFileSync:()=>ks,readSync:()=>pf,readdir:()=>yd,readdirSync:()=>Nn,readlink:()=>gd,readlinkSync:()=>wf,readv:()=>Od,readvSync:()=>Ff,realpath:()=>Ad,realpathSync:()=>Tn,rename:()=>Kf,renameSync:()=>nf,rm:()=>Ld,rmSync:()=>Nf,rmdir:()=>hd,rmdirSync:()=>yf,stat:()=>Yf,statSync:()=>_n,symlink:()=>bd,symlinkSync:()=>gf,truncate:()=>Jf,truncateSync:()=>sf,umount:()=>wn,unlink:()=>Qf,unlinkSync:()=>As,unwatchFile:()=>Td,utimes:()=>xd,utimesSync:()=>vf,watch:()=>Id,watchFile:()=>Nd,write:()=>ld,writeFile:()=>td,writeFileSync:()=>xn,writeSync:()=>hf,writev:()=>Bd,writevSync:()=>Pf});function xs(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(xs,"_toUnixTimestamp");function xe(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new c(22,"Invalid mode: "+t?.toString())}s(xe,"normalizeMode");function Vt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new c(22,"Invalid time.")}s(Vt,"normalizeTime");function W(t){if(t.includes("\0"))throw new c(22,"Path must be a string without null bytes.");if(t.length==0)throw new c(22,"Path must not be empty.");return Te(t.replaceAll(/[/\\]+/g,"/"))}s(W,"normalizePath");function ve(t,e="utf8",i,r=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e,flag:i,mode:r}:{encoding:typeof t?.encoding=="string"?t.encoding:e,flag:typeof t?.flag=="string"?t.flag:i,mode:xe("mode"in t?t?.mode:null,r)}}s(ve,"normalizeOptions");function _(){}s(_,"nop");var v=_e;function vs(t){v=t}s(vs,"setCred");var mt=new Map,rf=100;function Ht(t){let e=rf++;return mt.set(e,t),e}s(Ht,"getFdForFile");function T(t){if(!mt.has(t))throw new c(9);return mt.get(t)}s(T,"fd2file");var Ee=new Map;lr("/",bn.create({name:"root"}));function lr(t,e){if(t[0]!=="/"&&(t="/"+t),t=Te(t),Ee.has(t))throw new c(22,"Mount point "+t+" is already in use.");Ee.set(t,e)}s(lr,"mount");function wn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Te(t),!Ee.has(t))throw new c(22,"Mount point "+t+" is already unmounted.");Ee.delete(t)}s(wn,"umount");function me(t){t=W(t);let e=[...Ee].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:r,path:t,mountPoint:i};throw new c(5,"ZenFS not initialized with a file system")}s(me,"resolveFS");function Es(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}s(Es,"fixPaths");function nt(t,e){return typeof t.stack=="string"&&(t.stack=Es(t.stack,e)),t.message=Es(t.message,e),t}s(nt,"fixError");function cr(t){"/"in t&&wn("/");for(let[e,i]of Object.entries(t))lr(e,i)}s(cr,"initialize");var yr={};er(yr,{FileHandle:()=>ue,access:()=>Vn,appendFile:()=>Cn,chmod:()=>qn,chown:()=>Un,constants:()=>Ei,copyFile:()=>Hf,createReadStream:()=>jf,createWriteStream:()=>$f,exists:()=>Ci,fchmod:()=>Df,fchown:()=>Bf,futimes:()=>Mf,lchmod:()=>jn,lchown:()=>Wn,link:()=>Bn,lopen:()=>hr,lstat:()=>Fn,lutimes:()=>zn,mkdir:()=>On,mkdtemp:()=>Vf,open:()=>at,read:()=>Of,readFile:()=>pr,readdir:()=>Li,readlink:()=>Mn,realpath:()=>Di,rename:()=>In,rm:()=>zf,rmdir:()=>Rn,stat:()=>Ri,symlink:()=>Dn,truncate:()=>Pn,unlink:()=>dr,unwatchFile:()=>Wf,utimes:()=>$n,watch:()=>qf,watchFile:()=>Uf,write:()=>Rf,writeFile:()=>Bi});function ce(...[t,e,i,...r]){i=W(i);let{fs:n,path:o}=me(e&&Sn(i)?Tn(i):i);try{return n[t](o,...r)}catch(a){throw nt(a,{[o]:i})}}s(ce,"doOp");function nf(t,e){t=W(t),e=W(e);let i=me(t),r=me(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,v);xn(e,ks(t)),As(t)}catch(o){throw nt(o,n)}}s(nf,"renameSync");function Sn(t){t=W(t);try{let{fs:e,path:i}=me(t);return e.existsSync(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(Sn,"existsSync");function _n(t,e){let i=ce("statSync",!0,t,v);return e?.bigint?new G(i):i}s(_n,"statSync");function of(t,e){let i=ce("statSync",!1,t,v);return e?.bigint?new G(i):i}s(of,"lstatSync");function sf(t,e=0){let i=Pi(t,"r+");try{Ns(i,e)}finally{ot(i)}}s(sf,"truncateSync");function As(t){return ce("unlinkSync",!1,t,v)}s(As,"unlinkSync");function Kt(t,e,i,r){let n=W(t),o=xe(i,420),a=P(e),l;try{l=ce("statSync",r,n,v)}catch{switch(ki(a)){case 3:if(!ce("statSync",r,x(n),v).isDirectory())throw c.With("ENOTDIR",x(n),"_openSync");return ce("createFileSync",r,n,a,o,v);case 1:throw c.With("ENOENT",n,"_openSync");default:throw new c(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,v))throw c.With("EACCES",n,"_openSync");switch(Ai(a)){case 1:throw c.With("EEXIST",n,"_openSync");case 2:return ce("unlinkSync",r,n,v),ce("createFileSync",r,n,a,l.mode,v);case 0:return ce("openFileSync",r,n,a,v);default:throw new c(22,"Invalid FileFlag object.")}}s(Kt,"_openSync");function Pi(t,e,i){return Ht(Kt(t,e,i,!0))}s(Pi,"openSync");function ur(t,e,i){return Ht(Kt(t,e,i,!1))}s(ur,"lopenSync");function En(t,e,i){let r=Kt(t,e,420,i);try{let n=r.statSync(),o=new Uint8Array(n.size);return r.readSync(o,0,n.size,0),r.closeSync(),o}finally{r.closeSync()}}s(En,"_readFileSync");function ks(t,e={}){let i=ve(e,null,"r",420),r=P(i.flag);if(!ze(r))throw new c(22,"Flag passed to readFile must allow for reading.");let n=En(t,i.flag,!0);return i.encoding?X(n,i.encoding):n}s(ks,"readFileSync");function af(t,e,i,r,n){let o=Kt(t,i,r,n);try{o.writeSync(e,0,e.length,0)}finally{o.closeSync()}}s(af,"_writeFileSync");function xn(t,e,i){let r=ve(i,"utf8","w",420),n=P(r.flag);if(!ye(n))throw new c(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e,r.encoding):e;if(o===void 0)throw new c(22,"Data not specified");af(t,o,r.flag,r.mode,!0)}s(xn,"writeFileSync");function lf(t,e,i,r,n){let o=Kt(t,i,r,n);try{o.writeSync(e,0,e.length,null)}finally{o.closeSync()}}s(lf,"_appendFileSync");function cf(t,e,i){let r=ve(i,"utf8","a",420),n=P(r.flag);if(!rt(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;lf(t,o,r.flag,r.mode,!0)}s(cf,"appendFileSync");function uf(t,e){let i=T(t).statSync();return e?.bigint?new G(i):i}s(uf,"fstatSync");function ot(t){T(t).closeSync(),mt.delete(t)}s(ot,"closeSync");function Ns(t,e=0){if(e<0)throw new c(22);T(t).truncateSync(e)}s(Ns,"ftruncateSync");function ff(t){T(t).syncSync()}s(ff,"fsyncSync");function df(t){T(t).datasyncSync()}s(df,"fdatasyncSync");function hf(t,e,i,r,n){let o,a=0,l,u;if(typeof e=="string"){u=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,o=R(e,d),l=o.length}else o=e,a=i,l=r,u=typeof n=="number"?n:null;let f=T(t);return u==null&&(u=f.position),f.writeSync(o,a,l,u)}s(hf,"writeSync");function pf(t,e,i,r,n){let o=T(t),a=i;return typeof i=="object"&&({offset:a,length:r,position:n}=i),isNaN(+n)&&(n=o.position),o.readSync(e,a,r,n)}s(pf,"readSync");function vn(t,e,i){T(t).chownSync(e,i)}s(vn,"fchownSync");function An(t,e){let i=xe(e,-1);if(i<0)throw new c(22,"Invalid mode.");T(t).chmodSync(i)}s(An,"fchmodSync");function kn(t,e,i){T(t).utimesSync(Vt(e),Vt(i))}s(kn,"futimesSync");function yf(t){return ce("rmdirSync",!0,t,v)}s(yf,"rmdirSync");function mf(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,r=typeof e=="object"&&e?.recursive;ce("mkdirSync",!0,t,xe(i,511),v)}s(mf,"mkdirSync");function Nn(t,e){t=W(t);let i=ce("readdirSync",!0,t,v);for(let r of Ee.keys()){if(!r.startsWith(t))continue;let n=r.slice(t.length);n.includes("/")||n.length==0||i.push(n)}return i.map(r=>typeof e=="object"&&e?.withFileTypes?new st(r,_n(de(t,r))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?R(r):r)}s(Nn,"readdirSync");function bf(t,e){return e=W(e),ce("linkSync",!1,t,e,v)}s(bf,"linkSync");function gf(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new c(22,"Invalid type: "+i);if(Sn(e))throw c.With("EEXIST",e,"symlinkSync");xn(e,t),Kt(e,"r+",420,!1)._setTypeSync(U.SYMLINK)}s(gf,"symlinkSync");function wf(t,e){let i=En(t,"r",!1),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:X(i,r)}s(wf,"readlinkSync");function Sf(t,e,i){let r=Pi(t,"r+");vn(r,e,i),ot(r)}s(Sf,"chownSync");function _f(t,e,i){let r=ur(t,"r+");vn(r,e,i),ot(r)}s(_f,"lchownSync");function Ef(t,e){let i=Pi(t,"r+");An(i,e),ot(i)}s(Ef,"chmodSync");function xf(t,e){let i=ur(t,"r+");An(i,e),ot(i)}s(xf,"lchmodSync");function vf(t,e,i){let r=Pi(t,"r+");kn(r,e,i),ot(r)}s(vf,"utimesSync");function Af(t,e,i){let r=ur(t,"r+");kn(r,e,i),ot(r)}s(Af,"lutimesSync");function Tn(t,e){t=W(t);let{fs:i,path:r,mountPoint:n}=me(t);try{if(!i.statSync(r,v).isSymbolicLink())return t;let a=W(n+X(En(r,"r+",!1)));return Tn(a)}catch(o){throw nt(o,{[r]:t})}}s(Tn,"realpathSync");function kf(t,e=384){if(!_n(t).hasAccess(e,v))throw new c(13)}s(kf,"accessSync");function Nf(t){throw new c(95)}s(Nf,"rmSync");function Tf(t,e){throw new c(95)}s(Tf,"mkdtempSync");function If(t,e,i){throw new c(95)}s(If,"copyFileSync");function Ff(t,e,i){throw new c(95)}s(Ff,"readvSync");function Pf(t,e,i){throw new c(95)}s(Pf,"writevSync");function Lf(t,e){throw new c(95)}s(Lf,"opendirSync");var st=class{constructor(e,i){this.name=e;this.stats=i}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(st,"Dirent");var fr=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new c(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Li(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=Nn(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};s(fr,"Dir");var ue=class{constructor(e){this.fd=e}chown(e,i){return T(this.fd).chown(e,i)}chmod(e){let i=xe(e,-1);if(i<0)throw new c(22,"Invalid mode.");return T(this.fd).chmod(i)}datasync(){return T(this.fd).datasync()}sync(){return T(this.fd).sync()}truncate(e){if(e<0)throw new c(22);return T(this.fd).truncate(e)}utimes(e,i){return T(this.fd).utimes(Vt(e),Vt(i))}async appendFile(e,i){let r=ve(i,"utf8","a",420),n=P(r.flag);if(!rt(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;await T(this.fd).write(o,0,o.length,null)}read(e,i,r,n){return isNaN(+n)&&(n=T(this.fd).position),T(this.fd).read(e,i,r,n)}async readFile(e){let i=ve(e,null,"r",292),r=P(i.flag);if(!ze(r))throw new c(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),o=new Uint8Array(n);return await T(this.fd).read(o,0,n,0),i.encoding?X(o,i.encoding):o}async stat(e){let i=await T(this.fd).stat();return e?.bigint?new G(i):i}async write(e,i,r,n){let o,a=0,l;if(typeof e=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,o=R(e,f),l=o.length}else o=e,a=i,l=r,n=typeof n=="number"?n:null;n??=T(this.fd).position;let u=await T(this.fd).write(o,a,l,n);return{buffer:o,bytesWritten:u}}async writeFile(e,i){let r=ve(i,"utf8","w",420),n=P(r.flag);if(!ye(n))throw new c(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e,r.encoding):e;await T(this.fd).write(o,0,o.length,0)}writev(e,i){throw new c(95)}readv(e,i){throw new c(95)}async close(){await T(this.fd).close(),mt.delete(this.fd)}};s(ue,"FileHandle");async function Ae(...[t,e,i,...r]){i=W(i);let{fs:n,path:o}=me(e&&await Ci(i)?await Di(i):i);try{return n[t](o,...r)}catch(a){throw nt(a,{[o]:i})}}s(Ae,"doOp");async function In(t,e){t=W(t),e=W(e);let i=me(t),r=me(e);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,v);return}await Bi(e,await pr(t)),await dr(t)}catch(n){throw nt(n,{[i.path]:t,[r.path]:e})}}s(In,"rename");async function Ci(t){try{let{fs:e,path:i}=me(t);return e.exists(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(Ci,"exists");async function Ri(t,e){let i=await Ae("stat",!0,t,v);return e?.bigint?new G(i):i}s(Ri,"stat");async function Fn(t,e){let i=await Ae("stat",!1,t,v);return e?.bigint?new G(i):i}s(Fn,"lstat");async function Pn(t,e=0){let i=await at(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(Pn,"truncate");async function dr(t){return Ae("unlink",!1,t,v)}s(dr,"unlink");async function Oi(t,e,i=420,r){let n=W(t),o=xe(i,420),a=P(e);try{switch(Ai(a)){case 1:throw c.With("EEXIST",n,"_open");case 2:let l=await Ae("openFile",r,n,a,v);if(!l)throw new c(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await Ae("openFile",r,n,a,v);default:throw new c(22,"Invalid file flag")}}catch{switch(ki(a)){case 3:let u=await Ae("stat",r,x(n),v);if(u&&!u.isDirectory())throw c.With("ENOTDIR",x(n),"_open");return await Ae("createFile",r,n,a,o,v);case 1:throw c.With("ENOENT",n,"_open");default:throw new c(22,"Invalid file flag")}}}s(Oi,"_open");async function at(t,e,i=420){let r=await Oi(t,e,i,!0);return new ue(Ht(r))}s(at,"open");async function hr(t,e,i=420){let r=await Oi(t,e,i,!1);return new ue(Ht(r))}s(hr,"lopen");async function Ln(t,e,i){let r=await Oi(W(t),e,420,i);try{let n=await r.stat(),o=new Uint8Array(n.size);return await r.read(o,0,n.size,0),await r.close(),o}catch(n){throw await r.close(),n}}s(Ln,"_readFile");async function pr(t,e){let i=ve(e,null,"r",null),r=P(i.flag);if(!ze(r))throw new c(22,"Flag passed must allow for reading.");let n=await Ln(t,i.flag,!0);return i.encoding?X(n,i.encoding):n}s(pr,"readFile");async function Bi(t,e,i){let r=ve(i,"utf8","w",420),n=await at(t,r.flag,r.mode);try{await n.writeFile(e,r)}finally{await n.close()}}s(Bi,"writeFile");async function Cf(t,e,i,r,n){let o=await Oi(t,i,r,n);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(Cf,"_appendFile");async function Cn(t,e,i){let r=ve(i,"utf8","a",420),n=P(r.flag);if(!rt(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let o=typeof e=="string"?R(e):e;await Cf(t,o,r.flag,r.mode,!0)}s(Cn,"appendFile");function Rf(t,e,i,r,n){return t.write(e,i,r,n)}s(Rf,"write");function Of(t,e,i,r,n){return t.read(e,i,r,n)}s(Of,"read");function Bf(t,e,i){return t.chown(e,i)}s(Bf,"fchown");function Df(t,e){return t.chmod(e)}s(Df,"fchmod");function Mf(t,e,i){return t.utimes(e,i)}s(Mf,"futimes");async function Rn(t){return Ae("rmdir",!0,t,v)}s(Rn,"rmdir");async function On(t,e){await Ae("mkdir",!0,t,xe(typeof e=="object"?e?.mode:e,511),v)}s(On,"mkdir");async function Li(t,e){t=W(t);let i=await Ae("readdir",!0,t,v),r=[...Ee.keys()];for(let o of r)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let n=[];for(let o of i)n.push(typeof e=="object"&&e?.withFileTypes?new st(o,await Ri(de(t,o))):o);return n}s(Li,"readdir");async function Bn(t,e){return e=W(e),Ae("link",!1,t,e,v)}s(Bn,"link");async function Dn(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new c(22,"Invalid symlink type: "+i);if(await Ci(e))throw c.With("EEXIST",e,"symlink");await Bi(e,t),await(await Oi(e,"r+",420,!1))._setType(U.SYMLINK)}s(Dn,"symlink");async function Mn(t,e){let i=await Ln(t,"r",!1),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:X(i,r)}s(Mn,"readlink");async function Un(t,e,i){let r=await at(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}s(Un,"chown");async function Wn(t,e,i){let r=await hr(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}s(Wn,"lchown");async function qn(t,e){let i=await at(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(qn,"chmod");async function jn(t,e){let i=await hr(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(jn,"lchmod");async function $n(t,e,i){let r=await at(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}s($n,"utimes");async function zn(t,e,i){let r=await hr(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}s(zn,"lutimes");async function Di(t,e){t=W(t);let{fs:i,path:r,mountPoint:n}=me(t);try{if(!(await i.stat(r,v)).isSymbolicLink())return t;let a=n+W(X(await Ln(r,"r+",!1)));return Di(a)}catch(o){throw nt(o,{[r]:t})}}s(Di,"realpath");async function Uf(t,e,i=_){throw new c(95)}s(Uf,"watchFile");async function Wf(t,e=_){throw new c(95)}s(Wf,"unwatchFile");async function qf(t,e,i=_){throw new c(95)}s(qf,"watch");async function Vn(t,e=0){if(!(await Ri(t)).hasAccess(e,v))throw new c(13)}s(Vn,"access");async function jf(t,e){throw new c(95)}s(jf,"createReadStream");async function $f(t,e){throw new c(95)}s($f,"createWriteStream");async function zf(t){throw new c(95)}s(zf,"rm");async function Vf(t){throw new c(95)}s(Vf,"mkdtemp");async function Hf(t){throw new c(95)}s(Hf,"copyFile");function Kf(t,e,i=_){In(t,e).then(()=>i()).catch(i)}s(Kf,"rename");function Gf(t,e=_){Ci(t).then(e).catch(()=>e(!1))}s(Gf,"exists");function Yf(t,e,i=_){i=typeof e=="function"?e:i,Ri(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(Yf,"stat");function Xf(t,e,i=_){i=typeof e=="function"?e:i,Fn(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(Xf,"lstat");function Jf(t,e=0,i=_){i=typeof e=="function"?e:i,Pn(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(Jf,"truncate");function Qf(t,e=_){dr(t).then(()=>e()).catch(e)}s(Qf,"unlink");function Zf(t,e,i,r=_){let n=xe(i,420);r=typeof i=="function"?i:r,at(t,e,n).then(o=>r(null,o.fd)).catch(r)}s(Zf,"open");function ed(t,e,i=_){i=typeof e=="function"?e:i,pr(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(ed,"readFile");function td(t,e,i,r=_){r=typeof i=="function"?i:r,Bi(t,e,typeof i!="function"?i:null).then(()=>r(null)).catch(r)}s(td,"writeFile");function id(t,e,i,r=_){r=typeof i=="function"?i:r,Cn(t,e,typeof i=="function"?null:i)}s(id,"appendFile");function rd(t,e,i=_){i=typeof e=="function"?e:i,T(t).stat().then(r=>i(null,typeof e=="object"&&e?.bigint?new G(r):r)).catch(i)}s(rd,"fstat");function nd(t,e=_){new ue(t).close().then(()=>e()).catch(e)}s(nd,"close");function od(t,e,i=_){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=T(t);if(r<0)throw new c(22);n.truncate(r).then(()=>i()).catch(i)}s(od,"ftruncate");function sd(t,e=_){T(t).sync().then(()=>e()).catch(e)}s(sd,"fsync");function ad(t,e=_){T(t).datasync().then(()=>e()).catch(e)}s(ad,"fdatasync");function ld(t,e,i,r,n,o=_){let a,l,u,f=null,d,h=new ue(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=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 c(22,"Invalid arguments."));return}a=R(e),l=0,u=a.length;let m=o;h.write(a,l,u,f).then(({bytesWritten:y})=>m(null,y,X(a))).catch(m)}else{a=e,l=i,u=r,f=typeof n=="number"?n:null;let m=typeof n=="function"?n:o;h.write(a,l,u,f).then(({bytesWritten:y})=>m(null,y,a)).catch(m)}}s(ld,"write");function cd(t,e,i,r,n,o=_){new ue(t).read(e,i,r,n).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(cd,"read");function ud(t,e,i,r=_){new ue(t).chown(e,i).then(()=>r()).catch(r)}s(ud,"fchown");function fd(t,e,i){new ue(t).chmod(e).then(()=>i()).catch(i)}s(fd,"fchmod");function dd(t,e,i,r=_){new ue(t).utimes(e,i).then(()=>r()).catch(r)}s(dd,"futimes");function hd(t,e=_){Rn(t).then(()=>e()).catch(e)}s(hd,"rmdir");function pd(t,e,i=_){On(t,e).then(()=>i()).catch(i)}s(pd,"mkdir");function yd(t,e,i=_){i=typeof e=="function"?e:i,Li(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(yd,"readdir");function md(t,e,i=_){Bn(t,e).then(()=>i()).catch(i)}s(md,"link");function bd(t,e,i,r=_){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Dn(t,e,n).then(()=>r()).catch(r)}s(bd,"symlink");function gd(t,e,i=_){i=typeof e=="function"?e:i,Mn(t).then(r=>i(null,r)).catch(i)}s(gd,"readlink");function wd(t,e,i,r=_){Un(t,e,i).then(()=>r()).catch(r)}s(wd,"chown");function Sd(t,e,i,r=_){Wn(t,e,i).then(()=>r()).catch(r)}s(Sd,"lchown");function _d(t,e,i=_){qn(t,e).then(()=>i()).catch(i)}s(_d,"chmod");function Ed(t,e,i=_){jn(t,e).then(()=>i()).catch(i)}s(Ed,"lchmod");function xd(t,e,i,r=_){$n(t,e,i).then(()=>r()).catch(r)}s(xd,"utimes");function vd(t,e,i,r=_){zn(t,e,i).then(()=>r()).catch(r)}s(vd,"lutimes");function Ad(t,e,i=_){i=typeof e=="function"?e:i,Di(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}s(Ad,"realpath");function kd(t,e,i=_){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Vn(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(kd,"access");function Nd(t,e,i=_){throw new c(95)}s(Nd,"watchFile");function Td(t,e=_){throw new c(95)}s(Td,"unwatchFile");function Id(t,e,i=_){throw new c(95)}s(Id,"watch");function Fd(t,e){throw new c(95)}s(Fd,"createReadStream");function Pd(t,e){throw new c(95)}s(Pd,"createWriteStream");function Ld(t){new c(95)}s(Ld,"rm");function Cd(t){new c(95)}s(Cd,"mkdtemp");function Rd(t,e,i,r){new c(95)}s(Rd,"copyFile");function Od(t){new c(95)}s(Od,"readv");function Bd(t,e,i,r){throw new c(95)}s(Bd,"writev");function Dd(t){throw new c(95)}s(Dd,"opendir");var on=uu(iu(),1);var rn=class extends on.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(rn,"ReadStream");var nn=class extends on.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(nn,"WriteStream");function ru(t,e=0,i=0){vs({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i}),cr(t)}s(ru,"initialize");async function qg(t){("backend"in t||t instanceof J)&&(t={"/":t});for(let[e,i]of Object.entries(t))typeof i!="number"&&(i instanceof J||(bi(i)&&(i={backend:i}),t[e]=await ir(i)));ru(t)}s(qg,"configure");var Pt=class{static FromListing(e){let i=new Pt,r=new et;i._index.set("/",r);let n=[{pwd:"",tree:e,parent:r}];for(;n.length>0;){let o,{tree:a,pwd:l,parent:u}=n.pop();for(let f in a){if(!Object.hasOwn(a,f))continue;let d=a[f];if(d){let h=l+"/"+f;o=new et,i._index.set(h,o),n.push({pwd:h,tree:d,parent:o})}else o=new Zi(new M({mode:U.FILE|365}));u&&u._listing.set(f,o)}}return i}_index=new Map;constructor(){this.add("/",new et)}files(){let e=[];for(let i of this._index.values())for(let r of i.listing){let n=i.get(r);n?.isFile()&&e.push(n)}return e}add(e,i){if(!i)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let r=x(e),n=this._index.get(r);return!n&&e!="/"&&(n=new et,!this.add(r,n))||e!="/"&&!n.add(C(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let r=x(e),n=C(e),o=this._index.get(r);return o||(o=new et,this.addFast(r,o)),o.add(n,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=x(e),r=this._index.get(i);if(!r)return;let n=r.remove(C(e));if(!n)return;if(!n.isDirectory())return n;let o=n.listing;for(let a of o)this.remove(de(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=x(e),r=this._index.get(i);return i==e?r:r?.get(C(e))}};s(Pt,"FileIndex");var hi=class{constructor(e){this.data=e}};s(hi,"IndexInode");var Zi=class extends hi{isFile(){return!0}isDirectory(){return!1}toStats(){return new M({mode:U.FILE|438,size:4096})}};s(Zi,"IndexFileInode");var et=class extends hi{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new M({mode:U.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,i){return this._listing.has(e)?!1:(this._listing.set(e,i),!0)}remove(e){let i=this._listing.get(e);if(i)return this._listing.delete(e),i}};s(et,"IndexDirInode");var pi=class extends dn(J){_index;constructor(e){super(),this._index=Pt.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw c.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new c(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw c.With("ENOENT",e,"statSync");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new c(22,"Invalid inode.")}async openFile(e,i,r){if(ye(i))throw new c(1,e);let n=this._index.get(e);if(!n)throw c.With("ENOENT",e,"openFile");if(!n.toStats().hasAccess(it(i),r))throw c.With("EACCESS",e,"openFile");if(n.isDirectory()){let o=n.stats;return new pt(this,e,i,o,o.fileData)}return this.openFileInode(n,e,i)}openFileSync(e,i,r){if(ye(i))throw new c(1,e);let n=this._index.get(e);if(!n)throw c.With("ENOENT",e,"openFileSync");if(!n.toStats().hasAccess(it(i),r))throw c.With("EACCES",e,"openFileSync");if(n.isDirectory()){let o=n.stats;return new pt(this,e,i,o,o.fileData)}return this.openFileInodeSync(n,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw c.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw c.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw c.With("ENOENT",e,"readdirSync");if(i.isDirectory())return i.listing;throw c.With("ENOTDIR",e,"readdirSync")}};s(pi,"FileIndexFS");var sn=class extends ht(pi){async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,r){return this.openFileInodeSync(e,i,r)}};s(sn,"SyncFileIndexFS");var an=class extends gi(pi){statFileInodeSync(){throw new c(95)}openFileInodeSync(){throw new c(95)}};s(an,"AsyncFileIndexFS");var jg=Qi;return fu($g);})();
1
+ var ZenFS=(()=>{var yu=Object.create;var mi=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var gu=Object.getPrototypeOf,wu=Object.prototype.hasOwnProperty;var o=(t,e)=>mi(t,"name",{value:e,configurable:!0});var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qi=(t,e)=>{for(var i in e)mi(t,i,{get:e[i],enumerable:!0})},Es=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of bu(e))!wu.call(t,n)&&n!==i&&mi(t,n,{get:()=>e[n],enumerable:!(r=mu(e,n))||r.enumerable});return t};var xs=(t,e,i)=>(i=t!=null?yu(gu(t)):{},Es(e||!t||!t.__esModule?mi(i,"default",{value:t,enumerable:!0}):i,t)),Su=t=>Es(mi({},"__esModule",{value:!0}),t);var Os=A(fr=>{"use strict";fr.byteLength=af;fr.toByteArray=cf;fr.fromByteArray=df;var Ce=[],he=[],sf=typeof Uint8Array<"u"?Uint8Array:Array,En="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(mt=0,Cs=En.length;mt<Cs;++mt)Ce[mt]=En[mt],he[En.charCodeAt(mt)]=mt;var mt,Cs;he["-".charCodeAt(0)]=62;he["_".charCodeAt(0)]=63;function Ls(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var r=i===e?0:4-i%4;return[i,r]}o(Ls,"getLens");function af(t){var e=Ls(t),i=e[0],r=e[1];return(i+r)*3/4-r}o(af,"byteLength");function lf(t,e,i){return(e+i)*3/4-i}o(lf,"_byteLength");function cf(t){var e,i=Ls(t),r=i[0],n=i[1],s=new sf(lf(t,r,n)),a=0,l=n>0?r-4:r,u;for(u=0;u<l;u+=4)e=he[t.charCodeAt(u)]<<18|he[t.charCodeAt(u+1)]<<12|he[t.charCodeAt(u+2)]<<6|he[t.charCodeAt(u+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=he[t.charCodeAt(u)]<<2|he[t.charCodeAt(u+1)]>>4,s[a++]=e&255),n===1&&(e=he[t.charCodeAt(u)]<<10|he[t.charCodeAt(u+1)]<<4|he[t.charCodeAt(u+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}o(cf,"toByteArray");function uf(t){return Ce[t>>18&63]+Ce[t>>12&63]+Ce[t>>6&63]+Ce[t&63]}o(uf,"tripletToBase64");function ff(t,e,i){for(var r,n=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(uf(r));return n.join("")}o(ff,"encodeChunk");function df(t){for(var e,i=t.length,r=i%3,n=[],s=16383,a=0,l=i-r;a<l;a+=s)n.push(ff(t,a,a+s>l?l:a+s));return r===1?(e=t[i-1],n.push(Ce[e>>2]+Ce[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(Ce[e>>10]+Ce[e>>4&63]+Ce[e<<2&63]+"=")),n.join("")}o(df,"fromByteArray")});var Rs=A(xn=>{xn.read=function(t,e,i,r,n){var s,a,l=n*8-r-1,u=(1<<l)-1,f=u>>1,d=-7,h=i?n-1:0,m=i?-1:1,y=t[e+h];for(h+=m,s=y&(1<<-d)-1,y>>=-d,d+=l;d>0;s=s*256+t[e+h],h+=m,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=m,d-=8);if(s===0)s=1-f;else{if(s===u)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-f}return(y?-1:1)*a*Math.pow(2,s-r)};xn.write=function(t,e,i,r,n,s){var a,l,u,f=s*8-n-1,d=(1<<f)-1,h=d>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:s-1,w=r?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+h>=1?e+=m/u:e+=m*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*u-1)*Math.pow(2,n),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+y]=l&255,y+=w,l/=256,n-=8);for(a=a<<n|l,f+=n;f>0;t[i+y]=a&255,y+=w,a/=256,f-=8);t[i+y-w]|=b*128}});var Oe=A(Yt=>{"use strict";var vn=Os(),Kt=Rs(),Bs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Yt.Buffer=p;Yt.SlowBuffer=gf;Yt.INSPECT_MAX_BYTES=50;var dr=2147483647;Yt.kMaxLength=dr;p.TYPED_ARRAY_SUPPORT=hf();!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function hf(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}o(hf,"typedArraySupport");Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function ze(t){if(t>dr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}o(ze,"createBuffer");function p(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Fn(t)}return Ws(t,e,i)}o(p,"Buffer");p.poolSize=8192;function Ws(t,e,i){if(typeof t=="string")return yf(t,e);if(ArrayBuffer.isView(t))return mf(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Le(t,ArrayBuffer)||t&&Le(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Le(t,SharedArrayBuffer)||t&&Le(t.buffer,SharedArrayBuffer)))return Nn(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return p.from(r,e,i);let n=bf(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}o(Ws,"from");p.from=function(t,e,i){return Ws(t,e,i)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function qs(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}o(qs,"assertSize");function pf(t,e,i){return qs(t),t<=0?ze(t):e!==void 0?typeof i=="string"?ze(t).fill(e,i):ze(t).fill(e):ze(t)}o(pf,"alloc");p.alloc=function(t,e,i){return pf(t,e,i)};function Fn(t){return qs(t),ze(t<0?0:Tn(t)|0)}o(Fn,"allocUnsafe");p.allocUnsafe=function(t){return Fn(t)};p.allocUnsafeSlow=function(t){return Fn(t)};function yf(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=js(t,e)|0,r=ze(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}o(yf,"fromString");function kn(t){let e=t.length<0?0:Tn(t.length)|0,i=ze(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}o(kn,"fromArrayLike");function mf(t){if(Le(t,Uint8Array)){let e=new Uint8Array(t);return Nn(e.buffer,e.byteOffset,e.byteLength)}return kn(t)}o(mf,"fromArrayView");function Nn(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&i===void 0?r=new Uint8Array(t):i===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,i),Object.setPrototypeOf(r,p.prototype),r}o(Nn,"fromArrayBuffer");function bf(t){if(p.isBuffer(t)){let e=Tn(t.length)|0,i=ze(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||Pn(t.length)?ze(0):kn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return kn(t.data)}o(bf,"fromObject");function Tn(t){if(t>=dr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+dr.toString(16)+" bytes");return t|0}o(Tn,"checked");function gf(t){return+t!=t&&(t=0),p.alloc(+t)}o(gf,"SlowBuffer");p.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=o(function(e,i){if(Le(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Le(i,Uint8Array)&&(i=p.from(i,i.offset,i.byteLength)),!p.isBuffer(e)||!p.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let r=e.length,n=i.length;for(let s=0,a=Math.min(r,n);s<a;++s)if(e[s]!==i[s]){r=e[s],n=i[s];break}return r<n?-1:n<r?1:0},"compare");p.isEncoding=o(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");p.concat=o(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let r;if(i===void 0)for(i=0,r=0;r<e.length;++r)i+=e[r].length;let n=p.allocUnsafe(i),s=0;for(r=0;r<e.length;++r){let a=e[r];if(Le(a,Uint8Array))s+a.length>n.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,s)):Uint8Array.prototype.set.call(n,a,s);else if(p.isBuffer(a))a.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length}return n},"concat");function js(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Le(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&i===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return An(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Js(t).length;default:if(n)return r?-1:An(t).length;e=(""+e).toLowerCase(),n=!0}}o(js,"byteLength");p.byteLength=js;function wf(t,e,i){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Tf(this,e,i);case"utf8":case"utf-8":return Vs(this,e,i);case"ascii":return Af(this,e,i);case"latin1":case"binary":return Ff(this,e,i);case"base64":return kf(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return If(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}o(wf,"slowToString");p.prototype._isBuffer=!0;function bt(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}o(bt,"swap");p.prototype.swap16=o(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)bt(this,i,i+1);return this},"swap16");p.prototype.swap32=o(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)bt(this,i,i+3),bt(this,i+1,i+2);return this},"swap32");p.prototype.swap64=o(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)bt(this,i,i+7),bt(this,i+1,i+6),bt(this,i+2,i+5),bt(this,i+3,i+4);return this},"swap64");p.prototype.toString=o(function(){let e=this.length;return e===0?"":arguments.length===0?Vs(this,0,e):wf.apply(this,arguments)},"toString");p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=o(function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0},"equals");p.prototype.inspect=o(function(){let e="",i=Yt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Bs&&(p.prototype[Bs]=p.prototype.inspect);p.prototype.compare=o(function(e,i,r,n,s){if(Le(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),i<0||r>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&i>=r)return 0;if(n>=s)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;let a=s-n,l=r-i,u=Math.min(a,l),f=this.slice(n,s),d=e.slice(i,r);for(let h=0;h<u;++h)if(f[h]!==d[h]){a=f[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function $s(t,e,i,r,n){if(t.length===0)return-1;if(typeof i=="string"?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Pn(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0)if(n)i=0;else return-1;if(typeof e=="string"&&(e=p.from(e,r)),p.isBuffer(e))return e.length===0?-1:Ds(t,e,i,r,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):Ds(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}o($s,"bidirectionalIndexOf");function Ds(t,e,i,r,n){let s=1,a=t.length,l=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,i/=2}function u(d,h){return s===1?d[h]:d.readUInt16BE(h*s)}o(u,"read");let f;if(n){let d=-1;for(f=i;f<a;f++)if(u(t,f)===u(e,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===l)return d*s}else d!==-1&&(f-=f-d),d=-1}else for(i+l>a&&(i=a-l),f=i;f>=0;f--){let d=!0;for(let h=0;h<l;h++)if(u(t,f+h)!==u(e,h)){d=!1;break}if(d)return f}return-1}o(Ds,"arrayIndexOf");p.prototype.includes=o(function(e,i,r){return this.indexOf(e,i,r)!==-1},"includes");p.prototype.indexOf=o(function(e,i,r){return $s(this,e,i,r,!0)},"indexOf");p.prototype.lastIndexOf=o(function(e,i,r){return $s(this,e,i,r,!1)},"lastIndexOf");function Sf(t,e,i,r){i=Number(i)||0;let n=t.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;let s=e.length;r>s/2&&(r=s/2);let a;for(a=0;a<r;++a){let l=parseInt(e.substr(a*2,2),16);if(Pn(l))return a;t[i+a]=l}return a}o(Sf,"hexWrite");function _f(t,e,i,r){return hr(An(e,t.length-i),t,i,r)}o(_f,"utf8Write");function Ef(t,e,i,r){return hr(Of(e),t,i,r)}o(Ef,"asciiWrite");function xf(t,e,i,r){return hr(Js(e),t,i,r)}o(xf,"base64Write");function vf(t,e,i,r){return hr(Rf(e,t.length-i),t,i,r)}o(vf,"ucs2Write");p.prototype.write=o(function(e,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 s=this.length-i;if((r===void 0||r>s)&&(r=s),e.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 Sf(this,e,i,r);case"utf8":case"utf-8":return _f(this,e,i,r);case"ascii":case"latin1":case"binary":return Ef(this,e,i,r);case"base64":return xf(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vf(this,e,i,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},"write");p.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function kf(t,e,i){return e===0&&i===t.length?vn.fromByteArray(t):vn.fromByteArray(t.slice(e,i))}o(kf,"base64Slice");function Vs(t,e,i){i=Math.min(t.length,i);let r=[],n=e;for(;n<i;){let s=t[n],a=null,l=s>239?4:s>223?3:s>191?2:1;if(n+l<=i){let u,f,d,h;switch(l){case 1:s<128&&(a=s);break;case 2:u=t[n+1],(u&192)===128&&(h=(s&31)<<6|u&63,h>127&&(a=h));break;case 3:u=t[n+1],f=t[n+2],(u&192)===128&&(f&192)===128&&(h=(s&15)<<12|(u&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:u=t[n+1],f=t[n+2],d=t[n+3],(u&192)===128&&(f&192)===128&&(d&192)===128&&(h=(s&15)<<18|(u&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),n+=l}return Nf(r)}o(Vs,"utf8Slice");var Ms=4096;function Nf(t){let e=t.length;if(e<=Ms)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=Ms));return i}o(Nf,"decodeCodePointsArray");function Af(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]&127);return r}o(Af,"asciiSlice");function Ff(t,e,i){let r="";i=Math.min(t.length,i);for(let n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}o(Ff,"latin1Slice");function Tf(t,e,i){let r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);let n="";for(let s=e;s<i;++s)n+=Bf[t[s]];return n}o(Tf,"hexSlice");function If(t,e,i){let r=t.slice(e,i),n="";for(let s=0;s<r.length-1;s+=2)n+=String.fromCharCode(r[s]+r[s+1]*256);return n}o(If,"utf16leSlice");p.prototype.slice=o(function(e,i){let r=this.length;e=~~e,i=i===void 0?r:~~i,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),i<0?(i+=r,i<0&&(i=0)):i>r&&(i=r),i<e&&(i=e);let n=this.subarray(e,i);return Object.setPrototypeOf(n,p.prototype),n},"slice");function G(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}o(G,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e],s=1,a=0;for(;++a<i&&(s*=256);)n+=this[e+a]*s;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e+--i],s=1;for(;i>0&&(s*=256);)n+=this[e+--i]*s;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=o(function(e,i){return e=e>>>0,i||G(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=o(function(e,i){return e=e>>>0,i||G(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=o(function(e,i){return e=e>>>0,i||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=o(function(e,i){return e=e>>>0,i||G(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");p.prototype.readUint32BE=p.prototype.readUInt32BE=o(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=nt(o(function(e){e=e>>>0,Gt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Ti(e,this.length-8);let n=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=nt(o(function(e){e=e>>>0,Gt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Ti(e,this.length-8);let n=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<<BigInt(32))+BigInt(s)},"readBigUInt64BE"));p.prototype.readIntLE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=this[e],s=1,a=0;for(;++a<i&&(s*=256);)n+=this[e+a]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*i)),n},"readIntLE");p.prototype.readIntBE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||G(e,i,this.length);let n=i,s=1,a=this[e+--n];for(;n>0&&(s*=256);)a+=this[e+--n]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*i)),a},"readIntBE");p.prototype.readInt8=o(function(e,i){return e=e>>>0,i||G(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=o(function(e,i){e=e>>>0,i||G(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},"readInt16LE");p.prototype.readInt16BE=o(function(e,i){e=e>>>0,i||G(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},"readInt16BE");p.prototype.readInt32LE=o(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");p.prototype.readInt32BE=o(function(e,i){return e=e>>>0,i||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=nt(o(function(e){e=e>>>0,Gt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Ti(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=nt(o(function(e){e=e>>>0,Gt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&Ti(e,this.length-8);let n=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)},"readBigInt64BE"));p.prototype.readFloatLE=o(function(e,i){return e=e>>>0,i||G(e,4,this.length),Kt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=o(function(e,i){return e=e>>>0,i||G(e,4,this.length),Kt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=o(function(e,i){return e=e>>>0,i||G(e,8,this.length),Kt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=o(function(e,i){return e=e>>>0,i||G(e,8,this.length),Kt.read(this,e,!1,52,8)},"readDoubleBE");function ne(t,e,i,r,n,s){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}o(ne,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=o(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;ne(this,e,i,r,l,0)}let s=1,a=0;for(this[i]=e&255;++a<r&&(s*=256);)this[i+a]=e/s&255;return i+r},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=o(function(e,i,r,n){if(e=+e,i=i>>>0,r=r>>>0,!n){let l=Math.pow(2,8*r)-1;ne(this,e,i,r,l,0)}let s=r-1,a=1;for(this[i+s]=e&255;--s>=0&&(a*=256);)this[i+s]=e/a&255;return i+r},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function zs(t,e,i,r,n){Xs(e,r,n,t,i,7);let s=Number(e&BigInt(4294967295));t[i++]=s,s=s>>8,t[i++]=s,s=s>>8,t[i++]=s,s=s>>8,t[i++]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}o(zs,"wrtBigUInt64LE");function Hs(t,e,i,r,n){Xs(e,r,n,t,i,7);let s=Number(e&BigInt(4294967295));t[i+7]=s,s=s>>8,t[i+6]=s,s=s>>8,t[i+5]=s,s=s>>8,t[i+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}o(Hs,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=nt(o(function(e,i=0){return zs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=nt(o(function(e,i=0){return Hs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=o(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let u=Math.pow(2,8*r-1);ne(this,e,i,r,u-1,-u)}let s=0,a=1,l=0;for(this[i]=e&255;++s<r&&(a*=256);)e<0&&l===0&&this[i+s-1]!==0&&(l=1),this[i+s]=(e/a>>0)-l&255;return i+r},"writeIntLE");p.prototype.writeIntBE=o(function(e,i,r,n){if(e=+e,i=i>>>0,!n){let u=Math.pow(2,8*r-1);ne(this,e,i,r,u-1,-u)}let s=r-1,a=1,l=0;for(this[i+s]=e&255;--s>=0&&(a*=256);)e<0&&l===0&&this[i+s+1]!==0&&(l=1),this[i+s]=(e/a>>0)-l&255;return i+r},"writeIntBE");p.prototype.writeInt8=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");p.prototype.writeInt16LE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");p.prototype.writeInt16BE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");p.prototype.writeInt32LE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");p.prototype.writeInt32BE=o(function(e,i,r){return e=+e,i=i>>>0,r||ne(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");p.prototype.writeBigInt64LE=nt(o(function(e,i=0){return zs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=nt(o(function(e,i=0){return Hs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Ks(t,e,i,r,n,s){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}o(Ks,"checkIEEE754");function Gs(t,e,i,r,n){return e=+e,i=i>>>0,n||Ks(t,e,i,4,34028234663852886e22,-34028234663852886e22),Kt.write(t,e,i,r,23,4),i+4}o(Gs,"writeFloat");p.prototype.writeFloatLE=o(function(e,i,r){return Gs(this,e,i,!0,r)},"writeFloatLE");p.prototype.writeFloatBE=o(function(e,i,r){return Gs(this,e,i,!1,r)},"writeFloatBE");function Ys(t,e,i,r,n){return e=+e,i=i>>>0,n||Ks(t,e,i,8,17976931348623157e292,-17976931348623157e292),Kt.write(t,e,i,r,52,8),i+8}o(Ys,"writeDouble");p.prototype.writeDoubleLE=o(function(e,i,r){return Ys(this,e,i,!0,r)},"writeDoubleLE");p.prototype.writeDoubleBE=o(function(e,i,r){return Ys(this,e,i,!1,r)},"writeDoubleBE");p.prototype.copy=o(function(e,i,r,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),i>=e.length&&(i=e.length),i||(i=0),n>0&&n<r&&(n=r),n===r||e.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),e.length-i<n-r&&(n=e.length-i+r);let s=n-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),i),s},"copy");p.prototype.fill=o(function(e,i,r,n){if(typeof e=="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"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(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,e||(e=0);let s;if(typeof e=="number")for(s=i;s<r;++s)this[s]=e;else{let a=p.isBuffer(e)?e:p.from(e,n),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-i;++s)this[s+i]=a[s%l]}return this},"fill");var Ht={};function In(t,e,i){Ht[t]=o(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}o(In,"E");In("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);In("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);In("ERR_OUT_OF_RANGE",function(t,e,i){let r=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Us(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=Us(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function Us(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}o(Us,"addNumericalSeparator");function Pf(t,e,i){Gt(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Ti(e,t.length-(i+1))}o(Pf,"checkBounds");function Xs(t,e,i,r,n,s){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw s>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:l=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new Ht.ERR_OUT_OF_RANGE("value",l,t)}Pf(r,n,s)}o(Xs,"checkIntBI");function Gt(t,e){if(typeof t!="number")throw new Ht.ERR_INVALID_ARG_TYPE(e,"number",t)}o(Gt,"validateNumber");function Ti(t,e,i){throw Math.floor(t)!==t?(Gt(t,i),new Ht.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new Ht.ERR_BUFFER_OUT_OF_BOUNDS:new Ht.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}o(Ti,"boundsError");var Cf=/[^+/0-9A-Za-z-_]/g;function Lf(t){if(t=t.split("=")[0],t=t.trim().replace(Cf,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}o(Lf,"base64clean");function An(t,e){e=e||1/0;let i,r=t.length,n=null,s=[];for(let a=0;a<r;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===r){(e-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return s}o(An,"utf8ToBytes");function Of(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}o(Of,"asciiToBytes");function Rf(t,e){let i,r,n,s=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),r=i>>8,n=i%256,s.push(n),s.push(r);return s}o(Rf,"utf16leToBytes");function Js(t){return vn.toByteArray(Lf(t))}o(Js,"base64ToBytes");function hr(t,e,i,r){let n;for(n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}o(hr,"blitBuffer");function Le(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}o(Le,"isInstance");function Pn(t){return t!==t}o(Pn,"numberIsNaN");var Bf=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let r=i*16;for(let n=0;n<16;++n)e[r+n]=t[i]+t[n]}return e}();function nt(t){return typeof BigInt>"u"?Df:t}o(nt,"defineBigIntMethod");function Df(){throw new Error("BigInt not supported")}o(Df,"BufferBigIntNotDefined")});var L=A((u_,na)=>{"use strict";na.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var Zt=A((f_,Er)=>{"use strict";var{AbortController:oa,AbortSignal:dh}=typeof self<"u"?self:typeof window<"u"?window:void 0;Er.exports=oa;Er.exports.AbortSignal=dh;Er.exports.default=oa});var Di=A((d_,fo)=>{"use strict";var ei=typeof Reflect=="object"?Reflect:null,sa=ei&&typeof ei.apply=="function"?ei.apply:o(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),xr;ei&&typeof ei.ownKeys=="function"?xr=ei.ownKeys:Object.getOwnPropertySymbols?xr=o(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):xr=o(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function hh(t){console&&console.warn&&console.warn(t)}o(hh,"ProcessEmitWarning");var la=Number.isNaN||o(function(e){return e!==e},"NumberIsNaN");function T(){T.init.call(this)}o(T,"EventEmitter");fo.exports=T;fo.exports.once=bh;T.EventEmitter=T;T.prototype._events=void 0;T.prototype._eventsCount=0;T.prototype._maxListeners=void 0;var aa=10;function vr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}o(vr,"checkListener");Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return aa},set:function(t){if(typeof t!="number"||t<0||la(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");aa=t}});T.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};T.prototype.setMaxListeners=o(function(e){if(typeof e!="number"||e<0||la(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function ca(t){return t._maxListeners===void 0?T.defaultMaxListeners:t._maxListeners}o(ca,"_getMaxListeners");T.prototype.getMaxListeners=o(function(){return ca(this)},"getMaxListeners");T.prototype.emit=o(function(e){for(var i=[],r=1;r<arguments.length;r++)i.push(arguments[r]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.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 l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var u=s[e];if(u===void 0)return!1;if(typeof u=="function")sa(u,this,i);else for(var f=u.length,d=pa(u,f),r=0;r<f;++r)sa(d[r],this,i);return!0},"emit");function ua(t,e,i,r){var n,s,a;if(vr(i),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),a=s[e]),a===void 0)a=s[e]=i,++t._eventsCount;else if(typeof a=="function"?a=s[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),n=ca(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,hh(l)}return t}o(ua,"_addListener");T.prototype.addListener=o(function(e,i){return ua(this,e,i,!1)},"addListener");T.prototype.on=T.prototype.addListener;T.prototype.prependListener=o(function(e,i){return ua(this,e,i,!0)},"prependListener");function ph(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}o(ph,"onceWrapper");function fa(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=ph.bind(r);return n.listener=i,r.wrapFn=n,n}o(fa,"_onceWrap");T.prototype.once=o(function(e,i){return vr(i),this.on(e,fa(this,e,i)),this},"once");T.prototype.prependOnceListener=o(function(e,i){return vr(i),this.prependListener(e,fa(this,e,i)),this},"prependOnceListener");T.prototype.removeListener=o(function(e,i){var r,n,s,a,l;if(vr(i),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===i||r.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||i));else if(typeof r!="function"){for(s=-1,a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){l=r[a].listener,s=a;break}if(s<0)return this;s===0?r.shift():yh(r,s),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");T.prototype.off=T.prototype.removeListener;T.prototype.removeAllListeners=o(function(e){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[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var s=Object.keys(r),a;for(n=0;n<s.length;++n)a=s[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=r[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(n=i.length-1;n>=0;n--)this.removeListener(e,i[n]);return this},"removeAllListeners");function da(t,e,i){var r=t._events;if(r===void 0)return[];var n=r[e];return n===void 0?[]:typeof n=="function"?i?[n.listener||n]:[n]:i?mh(n):pa(n,n.length)}o(da,"_listeners");T.prototype.listeners=o(function(e){return da(this,e,!0)},"listeners");T.prototype.rawListeners=o(function(e){return da(this,e,!1)},"rawListeners");T.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ha.call(t,e)};T.prototype.listenerCount=ha;function ha(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}o(ha,"listenerCount");T.prototype.eventNames=o(function(){return this._eventsCount>0?xr(this._events):[]},"eventNames");function pa(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}o(pa,"arrayClone");function yh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}o(yh,"spliceOne");function mh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}o(mh,"unwrapListeners");function bh(t,e){return new Promise(function(i,r){function n(a){t.removeListener(e,s),r(a)}o(n,"errorListener");function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),i([].slice.call(arguments))}o(s,"resolver"),ya(t,e,s,{once:!0}),e!=="error"&&gh(t,n,{once:!0})})}o(bh,"once");function gh(t,e,i){typeof t.on=="function"&&ya(t,"error",e,i)}o(gh,"addErrorHandlerIfEventEmitter");function ya(t,e,i,r){if(typeof t.on=="function")r.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,o(function n(s){r.once&&t.removeEventListener(e,n),i(s)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}o(ya,"eventTargetAgnosticAddListener")});var J=A((p_,ho)=>{"use strict";var wh=Oe(),{kResistStopPropagation:Sh,SymbolDispose:_h}=L(),Eh=globalThis.AbortSignal||Zt().AbortSignal,xh=globalThis.AbortController||Zt().AbortController,vh=Object.getPrototypeOf(async function(){}).constructor,ma=globalThis.Blob||wh.Blob,kh=o(typeof ma<"u"?function(e){return e instanceof ma}:function(e){return!1},"isBlob"),ba=o((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),Nh=o((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),kr=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let r=0;r<e.length;r++)i+=` ${e[r].stack}
2
+ `;super(i),this.name="AggregateError",this.errors=e}};o(kr,"AggregateError");ho.exports={AggregateError:kr,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((r,...n)=>r?i(r):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,r]){let n=e.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()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof vh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:kh,deprecate(t,e){return t},addAbortListener:Di().addAbortListener||o(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);ba(e,"signal"),Nh(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[Sh]:!0}),r=o(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[_h](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:Eh.any||o(function(e){if(e.length===1)return e[0];let i=new xh,r=o(()=>i.abort(),"abort");return e.forEach(n=>{ba(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};ho.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ee=A((m_,Sa)=>{"use strict";var{format:Ah,inspect:Ar,AggregateError:Fh}=J(),Th=globalThis.AggregateError||Fh,Ih=Symbol("kIsNodeError"),Ph=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Ch=/^([A-Z][a-z0-9]*)+$/,Lh="__node_internal_",Fr={};function wt(t,e){if(!t)throw new Fr.ERR_INTERNAL_ASSERTION(e)}o(wt,"assert");function ga(t){let e="",i=t.length,r=t[0]==="-"?1:0;for(;i>=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}o(ga,"addNumericalSeparator");function Oh(t,e,i){if(typeof e=="function")return wt(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let r=(e.match(/%[dfijoOs]/g)||[]).length;return wt(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:Ah(e,...i)}o(Oh,"getMessage");function X(t,e,i){i||(i=Error);class r extends i{constructor(...s){super(Oh(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}o(r,"NodeError"),Object.defineProperties(r.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=t,r.prototype[Ih]=!0,Fr[t]=r}o(X,"E");function wa(t){let e=Lh+t.name;return Object.defineProperty(t,"name",{value:e}),t}o(wa,"hideStackFrames");function Rh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new Th([e,t],e.message);return i.code=e.code,i}return t||e}o(Rh,"aggregateTwoErrors");var Nr=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Fr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};o(Nr,"AbortError");X("ERR_ASSERTION","%s",Error);X("ERR_INVALID_ARG_TYPE",(t,e,i)=>{wt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";t.endsWith(" argument")?r+=`${t} `:r+=`"${t}" ${t.includes(".")?"property":"argument"} `,r+="must be ";let n=[],s=[],a=[];for(let u of e)wt(typeof u=="string","All expected entries have to be of type string"),Ph.includes(u)?n.push(u.toLowerCase()):Ch.test(u)?s.push(u):(wt(u!=="object",'The value "object" should be written as "Object"'),a.push(u));if(s.length>0){let u=n.indexOf("object");u!==-1&&(n.splice(n,u,1),s.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 u=n.pop();r+=`one of type ${n.join(", ")}, or ${u}`}}(s.length>0||a.length>0)&&(r+=" or ")}if(s.length>0){switch(s.length){case 1:r+=`an instance of ${s[0]}`;break;case 2:r+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let u=s.pop();r+=`an instance of ${s.join(", ")}, or ${u}`}}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 u=a.pop();r+=`one of ${a.join(", ")}, or ${u}`}}if(i==null)r+=`. Received ${i}`;else if(typeof i=="function"&&i.name)r+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)r+=`. Received an instance of ${i.constructor.name}`;else{let u=Ar(i,{depth:-1});r+=`. Received ${u}`}}else{let u=Ar(i,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),r+=`. Received type ${typeof i} (${u})`}return r},TypeError);X("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=Ar(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${r}`},TypeError);X("ERR_INVALID_RETURN_VALUE",(t,e,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 ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);X("ERR_MISSING_ARGS",(...t)=>{wt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(r=>`"${r}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let r=t.pop();e+=`The ${t.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);X("ERR_OUT_OF_RANGE",(t,e,i)=>{wt(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=ga(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=ga(r)),r+="n"):r=Ar(i),`The value of "${t}" is out of range. It must be ${e}. Received ${r}`},RangeError);X("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);X("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);X("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);X("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);X("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);X("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);X("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);X("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);X("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);X("ERR_STREAM_WRITE_AFTER_END","write after end",Error);X("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Sa.exports={AbortError:Nr,aggregateTwoErrors:wa(Rh),hideStackFrames:wa,codes:Fr}});var ii=A((g_,Ia)=>{"use strict";var{ArrayIsArray:yo,ArrayPrototypeIncludes:va,ArrayPrototypeJoin:ka,ArrayPrototypeMap:Bh,NumberIsInteger:mo,NumberIsNaN:Dh,NumberMAX_SAFE_INTEGER:Mh,NumberMIN_SAFE_INTEGER:Uh,NumberParseInt:Wh,ObjectPrototypeHasOwnProperty:qh,RegExpPrototypeExec:Na,String:jh,StringPrototypeToUpperCase:$h,StringPrototypeTrim:Vh}=L(),{hideStackFrames:ye,codes:{ERR_SOCKET_BAD_PORT:zh,ERR_INVALID_ARG_TYPE:Q,ERR_INVALID_ARG_VALUE:ti,ERR_OUT_OF_RANGE:St,ERR_UNKNOWN_SIGNAL:_a}}=ee(),{normalizeEncoding:Hh}=J(),{isAsyncFunction:Kh,isArrayBufferView:Gh}=J().types,Ea={};function Yh(t){return t===(t|0)}o(Yh,"isInt32");function Xh(t){return t===t>>>0}o(Xh,"isUint32");var Jh=/^[0-7]+$/,Qh="must be a 32-bit unsigned integer or an octal string";function Zh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(Na(Jh,t)===null)throw new ti(e,t,Qh);t=Wh(t,8)}return Aa(t,e),t}o(Zh,"parseFileMode");var ep=ye((t,e,i=Uh,r=Mh)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!mo(t))throw new St(e,"an integer",t);if(t<i||t>r)throw new St(e,`>= ${i} && <= ${r}`,t)}),tp=ye((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!mo(t))throw new St(e,"an integer",t);if(t<i||t>r)throw new St(e,`>= ${i} && <= ${r}`,t)}),Aa=ye((t,e,i=!1)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!mo(t))throw new St(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new St(e,`>= ${r} && <= ${n}`,t)});function bo(t,e){if(typeof t!="string")throw new Q(e,"string",t)}o(bo,"validateString");function ip(t,e,i=void 0,r){if(typeof t!="number")throw new Q(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&Dh(t))throw new St(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}o(ip,"validateNumber");var rp=ye((t,e,i)=>{if(!va(i,t)){let n="must be one of: "+ka(Bh(i,s=>typeof s=="string"?`'${s}'`:jh(s)),", ");throw new ti(e,t,n)}});function Fa(t,e){if(typeof t!="boolean")throw new Q(e,"boolean",t)}o(Fa,"validateBoolean");function po(t,e,i){return t==null||!qh(t,e)?i:t[e]}o(po,"getOwnPropertyValueOrDefault");var np=ye((t,e,i=null)=>{let r=po(i,"allowArray",!1),n=po(i,"allowFunction",!1);if(!po(i,"nullable",!1)&&t===null||!r&&yo(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new Q(e,"Object",t)}),op=ye((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Q(e,"a dictionary",t)}),Tr=ye((t,e,i=0)=>{if(!yo(t))throw new Q(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new ti(e,t,r)}});function sp(t,e){Tr(t,e);for(let i=0;i<t.length;i++)bo(t[i],`${e}[${i}]`)}o(sp,"validateStringArray");function ap(t,e){Tr(t,e);for(let i=0;i<t.length;i++)Fa(t[i],`${e}[${i}]`)}o(ap,"validateBooleanArray");function lp(t,e){Tr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new Q(n,"AbortSignal",r);Ta(r,n)}}o(lp,"validateAbortSignalArray");function cp(t,e="signal"){if(bo(t,e),Ea[t]===void 0)throw Ea[$h(t)]!==void 0?new _a(t+" (signals must use all capital letters)"):new _a(t)}o(cp,"validateSignalName");var up=ye((t,e="buffer")=>{if(!Gh(t))throw new Q(e,["Buffer","TypedArray","DataView"],t)});function fp(t,e){let i=Hh(e),r=t.length;if(i==="hex"&&r%2!==0)throw new ti("encoding",e,`is invalid for data of length ${r}`)}o(fp,"validateEncoding");function dp(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Vh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new zh(e,t,i);return t|0}o(dp,"validatePort");var Ta=ye((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Q(e,"AbortSignal",t)}),hp=ye((t,e)=>{if(typeof t!="function")throw new Q(e,"Function",t)}),pp=ye((t,e)=>{if(typeof t!="function"||Kh(t))throw new Q(e,"Function",t)}),yp=ye((t,e)=>{if(t!==void 0)throw new Q(e,"undefined",t)});function mp(t,e,i){if(!va(i,t))throw new Q(e,`('${ka(i,"|")}')`,t)}o(mp,"validateUnion");var bp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function xa(t,e){if(typeof t>"u"||!Na(bp,t))throw new ti(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(xa,"validateLinkHeaderFormat");function gp(t){if(typeof t=="string")return xa(t,"hints"),t;if(yo(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];xa(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new ti("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(gp,"validateLinkHeaderValue");Ia.exports={isInt32:Yh,isUint32:Xh,parseFileMode:Zh,validateArray:Tr,validateStringArray:sp,validateBooleanArray:ap,validateAbortSignalArray:lp,validateBoolean:Fa,validateBuffer:up,validateDictionary:op,validateEncoding:fp,validateFunction:hp,validateInt32:tp,validateInteger:ep,validateNumber:ip,validateObject:np,validateOneOf:rp,validatePlainFunction:pp,validatePort:dp,validateSignalName:cp,validateString:bo,validateUint32:Aa,validateUndefined:yp,validateUnion:mp,validateAbortSignal:Ta,validateLinkHeaderValue:gp}});var ct=A((S_,Oa)=>{var U=Oa.exports={},Re,Be;function go(){throw new Error("setTimeout has not been defined")}o(go,"defaultSetTimout");function wo(){throw new Error("clearTimeout has not been defined")}o(wo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Re=setTimeout:Re=go}catch{Re=go}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=wo}catch{Be=wo}})();function Pa(t){if(Re===setTimeout)return setTimeout(t,0);if((Re===go||!Re)&&setTimeout)return Re=setTimeout,setTimeout(t,0);try{return Re(t,0)}catch{try{return Re.call(null,t,0)}catch{return Re.call(this,t,0)}}}o(Pa,"runTimeout");function wp(t){if(Be===clearTimeout)return clearTimeout(t);if((Be===wo||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(t);try{return Be(t)}catch{try{return Be.call(null,t)}catch{return Be.call(this,t)}}}o(wp,"runClearTimeout");var Ke=[],ri=!1,_t,Ir=-1;function Sp(){!ri||!_t||(ri=!1,_t.length?Ke=_t.concat(Ke):Ir=-1,Ke.length&&Ca())}o(Sp,"cleanUpNextTick");function Ca(){if(!ri){var t=Pa(Sp);ri=!0;for(var e=Ke.length;e;){for(_t=Ke,Ke=[];++Ir<e;)_t&&_t[Ir].run();Ir=-1,e=Ke.length}_t=null,ri=!1,wp(t)}}o(Ca,"drainQueue");U.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];Ke.push(new La(t,e)),Ke.length===1&&!ri&&Pa(Ca)};function La(t,e){this.fun=t,this.array=e}o(La,"Item");La.prototype.run=function(){this.fun.apply(null,this.array)};U.title="browser";U.browser=!0;U.env={};U.argv=[];U.version="";U.versions={};function Ge(){}o(Ge,"noop");U.on=Ge;U.addListener=Ge;U.once=Ge;U.off=Ge;U.removeListener=Ge;U.removeAllListeners=Ge;U.emit=Ge;U.prependListener=Ge;U.prependOnceListener=Ge;U.listeners=function(t){return[]};U.binding=function(t){throw new Error("process.binding is not supported")};U.cwd=function(){return"/"};U.chdir=function(t){throw new Error("process.chdir is not supported")};U.umask=function(){return 0}});var Me=A((E_,Ya)=>{"use strict";var{SymbolAsyncIterator:Ra,SymbolIterator:Ba,SymbolFor:Et}=L(),Da=Et("nodejs.stream.destroyed"),Ma=Et("nodejs.stream.errored"),So=Et("nodejs.stream.readable"),_o=Et("nodejs.stream.writable"),Ua=Et("nodejs.stream.disturbed"),_p=Et("nodejs.webstream.isClosedPromise"),Ep=Et("nodejs.webstream.controllerErrorFunction");function Pr(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}o(Pr,"isReadableNodeStream");function Cr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}o(Cr,"isWritableNodeStream");function xp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}o(xp,"isDuplexNodeStream");function De(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}o(De,"isNodeStream");function Wa(t){return!!(t&&!De(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}o(Wa,"isReadableStream");function qa(t){return!!(t&&!De(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}o(qa,"isWritableStream");function ja(t){return!!(t&&!De(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}o(ja,"isTransformStream");function vp(t){return Wa(t)||qa(t)||ja(t)}o(vp,"isWebStream");function kp(t,e){return t==null?!1:e===!0?typeof t[Ra]=="function":e===!1?typeof t[Ba]=="function":typeof t[Ra]=="function"||typeof t[Ba]=="function"}o(kp,"isIterable");function Lr(t){if(!De(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[Da]||r!=null&&r.destroyed)}o(Lr,"isDestroyed");function $a(t){if(!Cr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}o($a,"isWritableEnded");function Np(t,e){if(!Cr(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}o(Np,"isWritableFinished");function Ap(t){if(!Pr(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}o(Ap,"isReadableEnded");function Va(t,e){if(!Pr(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}o(Va,"isReadableFinished");function za(t){return t&&t[So]!=null?t[So]:typeof t?.readable!="boolean"?null:Lr(t)?!1:Pr(t)&&t.readable&&!Va(t)}o(za,"isReadable");function Ha(t){return t&&t[_o]!=null?t[_o]:typeof t?.writable!="boolean"?null:Lr(t)?!1:Cr(t)&&t.writable&&!$a(t)}o(Ha,"isWritable");function Fp(t,e){return De(t)?Lr(t)?!0:!(e?.readable!==!1&&za(t)||e?.writable!==!1&&Ha(t)):null}o(Fp,"isFinished");function Tp(t){var e,i;return De(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}o(Tp,"isWritableErrored");function Ip(t){var e,i;return De(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}o(Ip,"isReadableErrored");function Pp(t){if(!De(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&Ka(t)?t._closed:null}o(Pp,"isClosed");function Ka(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}o(Ka,"isOutgoingMessage");function Ga(t){return typeof t._sent100=="boolean"&&Ka(t)}o(Ga,"isServerResponse");function Cp(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}o(Cp,"isServerRequest");function Lp(t){if(!De(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Ga(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}o(Lp,"willEmitClose");function Op(t){var e;return!!(t&&((e=t[Ua])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}o(Op,"isDisturbed");function Rp(t){var e,i,r,n,s,a,l,u,f,d;return!!(t&&((e=(i=(r=(n=(s=(a=t[Ma])!==null&&a!==void 0?a:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&n!==void 0?n:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&i!==void 0?i:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}o(Rp,"isErrored");Ya.exports={isDestroyed:Lr,kIsDestroyed:Da,isDisturbed:Op,kIsDisturbed:Ua,isErrored:Rp,kIsErrored:Ma,isReadable:za,kIsReadable:So,kIsClosedPromise:_p,kControllerErrorFunction:Ep,kIsWritable:_o,isClosed:Pp,isDuplexNodeStream:xp,isFinished:Fp,isIterable:kp,isReadableNodeStream:Pr,isReadableStream:Wa,isReadableEnded:Ap,isReadableFinished:Va,isReadableErrored:Ip,isNodeStream:De,isWebStream:vp,isWritable:Ha,isWritableNodeStream:Cr,isWritableStream:qa,isWritableEnded:$a,isWritableFinished:Np,isWritableErrored:Tp,isServerRequest:Cp,isServerResponse:Ga,willEmitClose:Lp,isTransformStream:ja}});var Ye=A((v_,No)=>{var ut=ct(),{AbortError:nl,codes:Bp}=ee(),{ERR_INVALID_ARG_TYPE:Dp,ERR_STREAM_PREMATURE_CLOSE:Xa}=Bp,{kEmptyObject:xo,once:vo}=J(),{validateAbortSignal:Mp,validateFunction:Up,validateObject:Wp,validateBoolean:qp}=ii(),{Promise:jp,PromisePrototypeThen:$p,SymbolDispose:ol}=L(),{isClosed:Vp,isReadable:Ja,isReadableNodeStream:Eo,isReadableStream:zp,isReadableFinished:Qa,isReadableErrored:Za,isWritable:el,isWritableNodeStream:tl,isWritableStream:Hp,isWritableFinished:il,isWritableErrored:rl,isNodeStream:Kp,willEmitClose:Gp,kIsClosedPromise:Yp}=Me(),ni;function Xp(t){return t.setHeader&&typeof t.abort=="function"}o(Xp,"isRequest");var ko=o(()=>{},"nop");function sl(t,e,i){var r,n;if(arguments.length===2?(i=e,e=xo):e==null?e=xo:Wp(e,"options"),Up(i,"callback"),Mp(e.signal,"options.signal"),i=vo(i),zp(t)||Hp(t))return Jp(t,e,i);if(!Kp(t))throw new Dp("stream",["ReadableStream","WritableStream","Stream"],t);let s=(r=e.readable)!==null&&r!==void 0?r:Eo(t),a=(n=e.writable)!==null&&n!==void 0?n:tl(t),l=t._writableState,u=t._readableState,f=o(()=>{t.writable||m()},"onlegacyfinish"),d=Gp(t)&&Eo(t)===s&&tl(t)===a,h=il(t,!1),m=o(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||y)&&i.call(t)},"onfinish"),y=Qa(t,!1),w=o(()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),b=o(q=>{i.call(t,q)},"onerror"),g=Vp(t),S=o(()=>{g=!0;let q=rl(t)||Za(t);if(q&&typeof q!="boolean")return i.call(t,q);if(s&&!y&&Eo(t,!0)&&!Qa(t,!1))return i.call(t,new Xa);if(a&&!h&&!il(t,!1))return i.call(t,new Xa);i.call(t)},"onclose"),F=o(()=>{g=!0;let q=rl(t)||Za(t);if(q&&typeof q!="boolean")return i.call(t,q);i.call(t)},"onclosed"),R=o(()=>{t.req.on("finish",m)},"onrequest");Xp(t)?(t.on("complete",m),d||t.on("abort",S),t.req?R():t.on("request",R)):a&&!l&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",b),t.on("close",S),g?ut.nextTick(S):l!=null&&l.errorEmitted||u!=null&&u.errorEmitted?d||ut.nextTick(F):(!s&&(!d||Ja(t))&&(h||el(t)===!1)||!a&&(!d||el(t))&&(y||Ja(t)===!1)||u&&t.req&&t.aborted)&&ut.nextTick(F);let N=o(()=>{i=ko,t.removeListener("aborted",S),t.removeListener("complete",m),t.removeListener("abort",S),t.removeListener("request",R),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",b),t.removeListener("close",S)},"cleanup");if(e.signal&&!g){let q=o(()=>{let dt=i;N(),dt.call(t,new nl(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ut.nextTick(q);else{ni=ni||J().addAbortListener;let dt=ni(e.signal,q),le=i;i=vo((...Ct)=>{dt[ol](),le.apply(t,Ct)})}}return N}o(sl,"eos");function Jp(t,e,i){let r=!1,n=ko;if(e.signal)if(n=o(()=>{r=!0,i.call(t,new nl(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ut.nextTick(n);else{ni=ni||J().addAbortListener;let a=ni(e.signal,n),l=i;i=vo((...u)=>{a[ol](),l.apply(t,u)})}let s=o((...a)=>{r||ut.nextTick(()=>i.apply(t,a))},"resolverFn");return $p(t[Yp].promise,s,s),ko}o(Jp,"eosWeb");function Qp(t,e){var i;let r=!1;return e===null&&(e=xo),(i=e)!==null&&i!==void 0&&i.cleanup&&(qp(e.cleanup,"cleanup"),r=e.cleanup),new jp((n,s)=>{let a=sl(t,e,l=>{r&&a(),l?s(l):n()})})}o(Qp,"finished");No.exports=sl;No.exports.finished=Qp});var xt=A((N_,pl)=>{"use strict";var Ue=ct(),{aggregateTwoErrors:Zp,codes:{ERR_MULTIPLE_CALLBACK:ey},AbortError:ty}=ee(),{Symbol:cl}=L(),{kIsDestroyed:iy,isDestroyed:ry,isFinished:ny,isServerRequest:oy}=Me(),ul=cl("kDestroy"),Ao=cl("kConstruct");function fl(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}o(fl,"checkError");function sy(t,e){let i=this._readableState,r=this._writableState,n=r||i;return r!=null&&r.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(fl(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?al(this,t,e):this.once(ul,function(s){al(this,Zp(s,t),e)}),this)}o(sy,"destroy");function al(t,e,i){let r=!1;function n(s){if(r)return;r=!0;let a=t._readableState,l=t._writableState;fl(s,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(s),s?Ue.nextTick(ay,t,s):Ue.nextTick(dl,t)}o(n,"onDestroy");try{t._destroy(e||null,n)}catch(s){n(s)}}o(al,"_destroy");function ay(t,e){Fo(t,e),dl(t)}o(ay,"emitErrorCloseNT");function dl(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}o(dl,"emitCloseNT");function Fo(t,e){let i=t._readableState,r=t._writableState;r!=null&&r.errorEmitted||i!=null&&i.errorEmitted||(r&&(r.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}o(Fo,"emitErrorNT");function ly(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}o(ly,"undestroy");function To(t,e,i){let r=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),r&&!r.errored&&(r.errored=e),i?Ue.nextTick(Fo,t,e):Fo(t,e))}o(To,"errorOrDestroy");function cy(t,e){if(typeof t._construct!="function")return;let i=t._readableState,r=t._writableState;i&&(i.constructed=!1),r&&(r.constructed=!1),t.once(Ao,e),!(t.listenerCount(Ao)>1)&&Ue.nextTick(uy,t)}o(cy,"construct");function uy(t){let e=!1;function i(r){if(e){To(t,r??new ey);return}e=!0;let n=t._readableState,s=t._writableState,a=s||n;n&&(n.constructed=!0),s&&(s.constructed=!0),a.destroyed?t.emit(ul,r):r?To(t,r,!0):Ue.nextTick(fy,t)}o(i,"onConstruct");try{t._construct(r=>{Ue.nextTick(i,r)})}catch(r){Ue.nextTick(i,r)}}o(uy,"constructNT");function fy(t){t.emit(Ao)}o(fy,"emitConstructNT");function ll(t){return t?.setHeader&&typeof t.abort=="function"}o(ll,"isRequest");function hl(t){t.emit("close")}o(hl,"emitCloseLegacy");function dy(t,e){t.emit("error",e),Ue.nextTick(hl,t)}o(dy,"emitErrorCloseLegacy");function hy(t,e){!t||ry(t)||(!e&&!ny(t)&&(e=new ty),oy(t)?(t.socket=null,t.destroy(e)):ll(t)?t.abort():ll(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ue.nextTick(dy,t,e):Ue.nextTick(hl,t),t.destroyed||(t[iy]=!0))}o(hy,"destroyer");pl.exports={construct:cy,destroyer:hy,destroy:sy,undestroy:ly,errorOrDestroy:To}});var Br=A((F_,ml)=>{"use strict";var{ArrayIsArray:py,ObjectSetPrototypeOf:yl}=L(),{EventEmitter:Or}=Di();function Rr(t){Or.call(this,t)}o(Rr,"Stream");yl(Rr.prototype,Or.prototype);yl(Rr,Or);Rr.prototype.pipe=function(t,e){let i=this;function r(d){t.writable&&t.write(d)===!1&&i.pause&&i.pause()}o(r,"ondata"),i.on("data",r);function n(){i.readable&&i.resume&&i.resume()}o(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let s=!1;function a(){s||(s=!0,t.end())}o(a,"onend");function l(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}o(l,"onclose");function u(d){f(),Or.listenerCount(this,"error")===0&&this.emit("error",d)}o(u,"onerror"),Io(i,"error",u),Io(t,"error",u);function f(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",u),t.removeListener("error",u),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return o(f,"cleanup"),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t};function Io(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):py(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}o(Io,"prependListener");ml.exports={Stream:Rr,prependListener:Io}});var Mi=A((I_,Dr)=>{"use strict";var{SymbolDispose:yy}=L(),{AbortError:bl,codes:my}=ee(),{isNodeStream:gl,isWebStream:by,kControllerErrorFunction:gy}=Me(),wy=Ye(),{ERR_INVALID_ARG_TYPE:wl}=my,Po,Sy=o((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new wl(e,"AbortSignal",t)},"validateAbortSignal");Dr.exports.addAbortSignal=o(function(e,i){if(Sy(e,"signal"),!gl(i)&&!by(i))throw new wl("stream",["ReadableStream","WritableStream","Stream"],i);return Dr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");Dr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=gl(e)?()=>{e.destroy(new bl(void 0,{cause:t.reason}))}:()=>{e[gy](new bl(void 0,{cause:t.reason}))};if(t.aborted)i();else{Po=Po||J().addAbortListener;let r=Po(t,i);wy(e,r[yy])}return e}});var El=A((L_,_l)=>{"use strict";var{StringPrototypeSlice:Sl,SymbolIterator:_y,TypedArrayPrototypeSet:Mr,Uint8Array:Ey}=L(),{Buffer:Co}=Oe(),{inspect:xy}=J();_l.exports=o(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,r=""+i.data;for(;(i=i.next)!==null;)r+=e+i.data;return r}concat(e){if(this.length===0)return Co.alloc(0);let i=Co.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)Mr(i,r.data,n),n+=r.data.length,r=r.next;return i}consume(e,i){let r=this.head.data;if(e<r.length){let n=r.slice(0,e);return this.head.data=r.slice(e),n}return e===r.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[_y](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",r=this.head,n=0;do{let s=r.data;if(e>s.length)i+=s,e-=s.length;else{e===s.length?(i+=s,++n,r.next?this.head=r.next:this.head=this.tail=null):(i+=Sl(s,0,e),this.head=r,r.data=Sl(s,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=Co.allocUnsafe(e),r=e,n=this.head,s=0;do{let a=n.data;if(e>a.length)Mr(i,a,r-e),e-=a.length;else{e===a.length?(Mr(i,a,r-e),++s,n.next?this.head=n.next:this.head=this.tail=null):(Mr(i,new Ey(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}++s}while((n=n.next)!==null);return this.length-=s,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return xy(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var Ui=A((R_,Nl)=>{"use strict";var{MathFloor:vy,NumberIsInteger:ky}=L(),{validateInteger:Ny}=ii(),{ERR_INVALID_ARG_VALUE:Ay}=ee().codes,xl=16*1024,vl=16;function Fy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}o(Fy,"highWaterMarkFrom");function kl(t){return t?vl:xl}o(kl,"getDefaultHighWaterMark");function Ty(t,e){Ny(e,"value",0),t?vl=e:xl=e}o(Ty,"setDefaultHighWaterMark");function Iy(t,e,i,r){let n=Fy(e,r,i);if(n!=null){if(!ky(n)||n<0){let s=r?`options.${i}`:"options.highWaterMark";throw new Ay(s,n)}return vy(n)}return kl(t.objectMode)}o(Iy,"getHighWaterMark");Nl.exports={getHighWaterMark:Iy,getDefaultHighWaterMark:kl,setDefaultHighWaterMark:Ty}});var Tl=A((Lo,Fl)=>{var Ur=Oe(),We=Ur.Buffer;function Al(t,e){for(var i in t)e[i]=t[i]}o(Al,"copyProps");We.from&&We.alloc&&We.allocUnsafe&&We.allocUnsafeSlow?Fl.exports=Ur:(Al(Ur,Lo),Lo.Buffer=vt);function vt(t,e,i){return We(t,e,i)}o(vt,"SafeBuffer");vt.prototype=Object.create(We.prototype);Al(We,vt);vt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return We(t,e,i)};vt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=We(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};vt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return We(t)};vt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ur.SlowBuffer(t)}});var Cl=A(Pl=>{"use strict";var Ro=Tl().Buffer,Il=Ro.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Py(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}o(Py,"_normalizeEncoding");function Cy(t){var e=Py(t);if(typeof e!="string"&&(Ro.isEncoding===Il||!Il(t)))throw new Error("Unknown encoding: "+t);return e||t}o(Cy,"normalizeEncoding");Pl.StringDecoder=Wi;function Wi(t){this.encoding=Cy(t);var e;switch(this.encoding){case"utf16le":this.text=My,this.end=Uy,e=4;break;case"utf8":this.fillLast=Ry,e=4;break;case"base64":this.text=Wy,this.end=qy,e=3;break;default:this.write=jy,this.end=$y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ro.allocUnsafe(e)}o(Wi,"StringDecoder");Wi.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};Wi.prototype.end=Dy;Wi.prototype.text=By;Wi.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Oo(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}o(Oo,"utf8CheckByte");function Ly(t,e,i){var r=e.length-1;if(r<i)return 0;var n=Oo(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=Oo(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=Oo(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}o(Ly,"utf8CheckIncomplete");function Oy(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}o(Oy,"utf8CheckExtraBytes");function Ry(t){var e=this.lastTotal-this.lastNeed,i=Oy(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}o(Ry,"utf8FillLast");function By(t,e){var i=Ly(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}o(By,"utf8Text");function Dy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}o(Dy,"utf8End");function My(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}o(My,"utf16Text");function Uy(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}o(Uy,"utf16End");function Wy(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}o(Wy,"base64Text");function qy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}o(qy,"base64End");function jy(t){return t.toString(this.encoding)}o(jy,"simpleWrite");function $y(t){return t&&t.length?this.write(t):""}o($y,"simpleEnd")});var Bo=A((W_,Bl)=>{"use strict";var Ll=ct(),{PromisePrototypeThen:Vy,SymbolAsyncIterator:Ol,SymbolIterator:Rl}=L(),{Buffer:zy}=Oe(),{ERR_INVALID_ARG_TYPE:Hy,ERR_STREAM_NULL_VALUES:Ky}=ee().codes;function Gy(t,e,i){let r;if(typeof e=="string"||e instanceof zy)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let n;if(e&&e[Ol])n=!0,r=e[Ol]();else if(e&&e[Rl])n=!1,r=e[Rl]();else throw new Hy("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;s._read=function(){a||(a=!0,u())},s._destroy=function(f,d){Vy(l(f),()=>Ll.nextTick(d,f),h=>Ll.nextTick(d,h||f))};async function l(f){let d=f!=null,h=typeof r.throw=="function";if(d&&h){let{value:m,done:y}=await r.throw(f);if(await m,y)return}if(typeof r.return=="function"){let{value:m}=await r.return();await m}}o(l,"close");async function u(){for(;;){try{let{value:f,done:d}=n?await r.next():r.next();if(d)s.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new Ky;if(s.push(h))continue;a=!1}}catch(f){s.destroy(f)}break}}return o(u,"next"),s}o(Gy,"from");Bl.exports=Gy});var ji=A((j_,ec)=>{var ve=ct(),{ArrayPrototypeIndexOf:Yy,NumberIsInteger:Xy,NumberIsNaN:Jy,NumberParseInt:Qy,ObjectDefineProperties:Vo,ObjectKeys:Zy,ObjectSetPrototypeOf:Ul,Promise:Wl,SafeSet:em,SymbolAsyncDispose:tm,SymbolAsyncIterator:im,Symbol:rm}=L();ec.exports=E;E.ReadableState=$r;var{EventEmitter:nm}=Di(),{Stream:ft,prependListener:om}=Br(),{Buffer:Do}=Oe(),{addAbortSignal:sm}=Mi(),ql=Ye(),k=J().debuglog("stream",t=>{k=t}),am=El(),ai=xt(),{getHighWaterMark:lm,getDefaultHighWaterMark:cm}=Ui(),{aggregateTwoErrors:Dl,codes:{ERR_INVALID_ARG_TYPE:um,ERR_METHOD_NOT_IMPLEMENTED:fm,ERR_OUT_OF_RANGE:dm,ERR_STREAM_PUSH_AFTER_EOF:hm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:pm},AbortError:ym}=ee(),{validateObject:mm}=ii(),kt=rm("kPaused"),{StringDecoder:jl}=Cl(),bm=Bo();Ul(E.prototype,ft.prototype);Ul(E,ft);var Mo=o(()=>{},"nop"),{errorOrDestroy:oi}=ai,si=1<<0,gm=1<<1,$l=1<<2,qi=1<<3,Vl=1<<4,Wr=1<<5,qr=1<<6,zl=1<<7,wm=1<<8,Sm=1<<9,_m=1<<10,jo=1<<11,$o=1<<12,Em=1<<13,xm=1<<14,vm=1<<15,Hl=1<<16,km=1<<17,Nm=1<<18;function V(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}o(V,"makeBitMapDescriptor");Vo($r.prototype,{objectMode:V(si),ended:V(gm),endEmitted:V($l),reading:V(qi),constructed:V(Vl),sync:V(Wr),needReadable:V(qr),emittedReadable:V(zl),readableListening:V(wm),resumeScheduled:V(Sm),errorEmitted:V(_m),emitClose:V(jo),autoDestroy:V($o),destroyed:V(Em),closed:V(xm),closeEmitted:V(vm),multiAwaitDrain:V(Hl),readingMore:V(km),dataEmitted:V(Nm)});function $r(t,e,i){typeof i!="boolean"&&(i=e instanceof qe()),this.state=jo|$o|Vl|Wr,t&&t.objectMode&&(this.state|=si),i&&t&&t.readableObjectMode&&(this.state|=si),this.highWaterMark=t?lm(this,t,"readableHighWaterMark",i):cm(!1),this.buffer=new am,this.length=0,this.pipes=[],this.flowing=null,this[kt]=null,t&&t.emitClose===!1&&(this.state&=~jo),t&&t.autoDestroy===!1&&(this.state&=~$o),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new jl(t.encoding),this.encoding=t.encoding)}o($r,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof qe();this._readableState=new $r(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&sm(t.signal,this)),ft.call(this,t),ai.construct(this,()=>{this._readableState.needReadable&&jr(this,this._readableState)})}o(E,"Readable");E.prototype.destroy=ai.destroy;E.prototype._undestroy=ai.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[nm.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[tm]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new ym,this.destroy(t)),new Wl((e,i)=>ql(this,r=>r&&r!==t?i(r):e(null)))};E.prototype.push=function(t,e){return Kl(this,t,e,!1)};E.prototype.unshift=function(t,e){return Kl(this,t,e,!0)};function Kl(t,e,i,r){k("readableAddChunk",e);let n=t._readableState,s;if(n.state&si||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=Do.from(e,i).toString(n.encoding):(e=Do.from(e,i),i=""))):e instanceof Do?i="":ft._isUint8Array(e)?(e=ft._uint8ArrayToBuffer(e),i=""):e!=null&&(s=new um("chunk",["string","Buffer","Uint8Array"],e))),s)oi(t,s);else if(e===null)n.state&=~qi,Tm(t,n);else if(n.state&si||e&&e.length>0)if(r)if(n.state&$l)oi(t,new pm);else{if(n.destroyed||n.errored)return!1;Uo(t,n,e,!0)}else if(n.ended)oi(t,new hm);else{if(n.destroyed||n.errored)return!1;n.state&=~qi,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?Uo(t,n,e,!1):jr(t,n)):Uo(t,n,e,!1)}else r||(n.state&=~qi,jr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}o(Kl,"readableAddChunk");function Uo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Hl?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.state&qr&&Vr(t)),jr(t,e)}o(Uo,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[kt]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new jl(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,r="";for(let n of i)r+=e.write(n);return i.clear(),r!==""&&i.push(r),this._readableState.length=r.length,this};var Am=1073741824;function Fm(t){if(t>Am)throw new dm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}o(Fm,"computeNewHighWaterMark");function Ml(t,e){return t<=0||e.length===0&&e.ended?0:e.state&si?1:Jy(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}o(Ml,"howMuchToRead");E.prototype.read=function(t){k("read",t),t===void 0?t=NaN:Xy(t)||(t=Qy(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Fm(t)),t!==0&&(e.state&=~zl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return k("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Wo(this):Vr(this),null;if(t=Ml(t,e),t===0&&e.ended)return e.length===0&&Wo(this),null;let r=(e.state&qr)!==0;if(k("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,k("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,k("reading, ended or constructing",r);else if(r){k("do read"),e.state|=qi|Wr,e.length===0&&(e.state|=qr);try{this._read(e.highWaterMark)}catch(s){oi(this,s)}e.state&=~Wr,e.reading||(t=Ml(i,e))}let n;return t>0?n=Ql(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&Wo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Tm(t,e){if(k("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?Vr(t):(e.needReadable=!1,e.emittedReadable=!0,Gl(t))}}o(Tm,"onEofChunk");function Vr(t){let e=t._readableState;k("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(k("emitReadable",e.flowing),e.emittedReadable=!0,ve.nextTick(Gl,t))}o(Vr,"emitReadable");function Gl(t){let e=t._readableState;k("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Xl(t)}o(Gl,"emitReadable_");function jr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ve.nextTick(Im,t,e))}o(jr,"maybeReadMore");function Im(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(k("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}o(Im,"maybeReadMore_");E.prototype._read=function(t){throw new fm("_read()")};E.prototype.pipe=function(t,e){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(t),k("pipe count=%d opts=%j",r.pipes.length,e);let s=(!e||e.end!==!1)&&t!==ve.stdout&&t!==ve.stderr?l:g;r.endEmitted?ve.nextTick(s):i.once("end",s),t.on("unpipe",a);function a(S,F){k("onunpipe"),S===i&&F&&F.hasUnpiped===!1&&(F.hasUnpiped=!0,d())}o(a,"onunpipe");function l(){k("onend"),t.end()}o(l,"onend");let u,f=!1;function d(){k("cleanup"),t.removeListener("close",w),t.removeListener("finish",b),u&&t.removeListener("drain",u),t.removeListener("error",y),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",g),i.removeListener("data",m),f=!0,u&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&u()}o(d,"cleanup");function h(){f||(r.pipes.length===1&&r.pipes[0]===t?(k("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(k("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),u||(u=Pm(i,t),t.on("drain",u))}o(h,"pause"),i.on("data",m);function m(S){k("ondata");let F=t.write(S);k("dest.write",F),F===!1&&h()}o(m,"ondata");function y(S){if(k("onerror",S),g(),t.removeListener("error",y),t.listenerCount("error")===0){let F=t._writableState||t._readableState;F&&!F.errorEmitted?oi(t,S):t.emit("error",S)}}o(y,"onerror"),om(t,"error",y);function w(){t.removeListener("finish",b),g()}o(w,"onclose"),t.once("close",w);function b(){k("onfinish"),t.removeListener("close",w),g()}o(b,"onfinish"),t.once("finish",b);function g(){k("unpipe"),i.unpipe(t)}return o(g,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(k("pipe resume"),i.resume()),t};function Pm(t,e){return o(function(){let r=t._readableState;r.awaitDrainWriters===e?(k("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(k("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}o(Pm,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let s=0;s<n.length;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}let r=Yy(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=ft.prototype.on.call(this,t,e),r=this._readableState;return t==="data"?(r.readableListening=this.listenerCount("readable")>0,r.flowing!==!1&&this.resume()):t==="readable"&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,k("on readable",r.length,r.reading),r.length?Vr(this):r.reading||ve.nextTick(Cm,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=ft.prototype.removeListener.call(this,t,e);return t==="readable"&&ve.nextTick(Yl,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=ft.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ve.nextTick(Yl,this),e};function Yl(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[kt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}o(Yl,"updateReadableListening");function Cm(t){k("readable nexttick read 0"),t.read(0)}o(Cm,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(k("resume"),t.flowing=!t.readableListening,Lm(this,t)),t[kt]=!1,this};function Lm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ve.nextTick(Om,t,e))}o(Lm,"resume");function Om(t,e){k("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Xl(t),e.flowing&&!e.reading&&t.read(0)}o(Om,"resume_");E.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[kt]=!0,this};function Xl(t){let e=t._readableState;for(k("flow",e.flowing);e.flowing&&t.read()!==null;);}o(Xl,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",r=>{!this.push(r)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",r=>{oi(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=Zy(t);for(let r=1;r<i.length;r++){let n=i[r];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};E.prototype[im]=function(){return Jl(this)};E.prototype.iterator=function(t){return t!==void 0&&mm(t,"options"),Jl(this,t)};function Jl(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=Rm(t,e);return i.stream=t,i}o(Jl,"streamToAsyncIterator");async function*Rm(t,e){let i=Mo;function r(a){this===t?(i(),i=Mo):i=a}o(r,"next"),t.on("readable",r);let n,s=ql(t,{writable:!1},a=>{n=a?Dl(n,a):null,i(),i=Mo});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new Wl(r)}}}catch(a){throw n=Dl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?ai.destroyer(t,null):(t.off("readable",r),s())}}o(Rm,"createAsyncIterator");Vo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Vo($r.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[kt]!==!1},set(t){this[kt]=!!t}}});E._fromList=Ql;function Ql(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}o(Ql,"fromList");function Wo(t){let e=t._readableState;k("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ve.nextTick(Bm,e,t))}o(Wo,"endReadable");function Bm(t,e){if(k("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ve.nextTick(Dm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}o(Bm,"endReadableNT");function Dm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}o(Dm,"endWritableNT");E.from=function(t,e){return bm(E,t,e)};var qo;function Zl(){return qo===void 0&&(qo={}),qo}o(Zl,"lazyWebStreams");E.fromWeb=function(t,e){return Zl().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return Zl().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,r;return new E({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(n,s){ai.destroyer(t,n),s(n)}}).wrap(t)}});var Yr=A((V_,dc)=>{var Nt=ct(),{ArrayPrototypeSlice:rc,Error:Mm,FunctionPrototypeSymbolHasInstance:nc,ObjectDefineProperty:oc,ObjectDefineProperties:Um,ObjectSetPrototypeOf:sc,StringPrototypeToLowerCase:Wm,Symbol:qm,SymbolHasInstance:jm}=L();dc.exports=O;O.WritableState=zi;var{EventEmitter:$m}=Di(),$i=Br().Stream,{Buffer:zr}=Oe(),Gr=xt(),{addAbortSignal:Vm}=Mi(),{getHighWaterMark:zm,getDefaultHighWaterMark:Hm}=Ui(),{ERR_INVALID_ARG_TYPE:Km,ERR_METHOD_NOT_IMPLEMENTED:Gm,ERR_MULTIPLE_CALLBACK:ac,ERR_STREAM_CANNOT_PIPE:Ym,ERR_STREAM_DESTROYED:Vi,ERR_STREAM_ALREADY_FINISHED:Xm,ERR_STREAM_NULL_VALUES:Jm,ERR_STREAM_WRITE_AFTER_END:Qm,ERR_UNKNOWN_ENCODING:lc}=ee().codes,{errorOrDestroy:li}=Gr;sc(O.prototype,$i.prototype);sc(O,$i);function Ko(){}o(Ko,"nop");var ci=qm("kOnFinished");function zi(t,e,i){typeof i!="boolean"&&(i=e instanceof qe()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?zm(this,t,"writableHighWaterMark",i):Hm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let r=!!(t&&t.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=eb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Kr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ci]=[]}o(zi,"WritableState");function Kr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}o(Kr,"resetBuffer");zi.prototype.getBuffer=o(function(){return rc(this.buffered,this.bufferedIndex)},"getBuffer");oc(zi.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(t){let e=this instanceof qe();if(!e&&!nc(O,this))return new O(t);this._writableState=new zi(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Vm(t.signal,this)),$i.call(this,t),Gr.construct(this,()=>{let i=this._writableState;i.writing||Yo(this,i),Xo(this,i)})}o(O,"Writable");oc(O,jm,{__proto__:null,value:function(t){return nc(this,t)?!0:this!==O?!1:t&&t._writableState instanceof zi}});O.prototype.pipe=function(){li(this,new Ym)};function cc(t,e,i,r){let n=t._writableState;if(typeof i=="function")r=i,i=n.defaultEncoding;else{if(!i)i=n.defaultEncoding;else if(i!=="buffer"&&!zr.isEncoding(i))throw new lc(i);typeof r!="function"&&(r=Ko)}if(e===null)throw new Jm;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=zr.from(e,i),i="buffer");else if(e instanceof zr)i="buffer";else if($i._isUint8Array(e))e=$i._uint8ArrayToBuffer(e),i="buffer";else throw new Km("chunk",["string","Buffer","Uint8Array"],e);let s;return n.ending?s=new Qm:n.destroyed&&(s=new Vi("write")),s?(Nt.nextTick(r,s),li(t,s,!0),s):(n.pendingcb++,Zm(t,n,e,i,r))}o(cc,"_write");O.prototype.write=function(t,e,i){return cc(this,t,e,i)===!0};O.prototype.cork=function(){this._writableState.corked++};O.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Yo(this,t))};O.prototype.setDefaultEncoding=o(function(e){if(typeof e=="string"&&(e=Wm(e)),!zr.isEncoding(e))throw new lc(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function Zm(t,e,i,r,n){let s=e.objectMode?1:i.length;e.length+=s;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:r,callback:n}),e.allBuffers&&r!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Ko&&(e.allNoop=!1)):(e.writelen=s,e.writecb=n,e.writing=!0,e.sync=!0,t._write(i,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}o(Zm,"writeOrBuffer");function tc(t,e,i,r,n,s,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Vi("write")):i?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}o(tc,"doWrite");function ic(t,e,i,r){--e.pendingcb,r(i),Go(e),li(t,i)}o(ic,"onwriteError");function eb(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){li(t,new ac);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),r?Nt.nextTick(ic,t,i,e,n):ic(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Yo(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},Nt.nextTick(tb,i.afterWriteTickInfo)):uc(t,i,1,n))}o(eb,"onwrite");function tb({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,uc(t,e,i,r)}o(tb,"afterWriteTick");function uc(t,e,i,r){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,r();e.destroyed&&Go(e),Xo(t,e)}o(uc,"afterWrite");function Go(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:s,callback:a}=t.buffered[n],l=t.objectMode?1:s.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Vi("write"))}let i=t[ci].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new Vi("end"))}Kr(t)}o(Go,"errorBuffer");function Yo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:r,objectMode:n}=e,s=i.length-r;if(!s)return;let a=r;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let l=e.allNoop?Ko:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},u=e.allNoop&&a===0?i:rc(i,a);u.allBuffers=e.allBuffers,tc(t,e,!0,e.length,u,"",l),Kr(e)}else{do{let{chunk:l,encoding:u,callback:f}=i[a];i[a++]=null;let d=n?1:l.length;tc(t,e,!1,d,l,u,f)}while(a<i.length&&!e.writing);a===i.length?Kr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}o(Yo,"clearBuffer");O.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new Gm("_write()")};O.prototype._writev=null;O.prototype.end=function(t,e,i){let r=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let n;if(t!=null){let s=cc(this,t,e);s instanceof Mm&&(n=s)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Xo(this,r,!0),r.ended=!0):r.finished?n=new Xm("end"):r.destroyed&&(n=new Vi("end"))),typeof i=="function"&&(n||r.finished?Nt.nextTick(i,n):r[ci].push(i)),this};function Hr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}o(Hr,"needFinish");function ib(t,e){let i=!1;function r(n){if(i){li(t,n??ac());return}if(i=!0,e.pendingcb--,n){let s=e[ci].splice(0);for(let a=0;a<s.length;a++)s[a](n);li(t,n,e.sync)}else Hr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Nt.nextTick(Ho,t,e))}o(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}o(ib,"callFinal");function rb(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,ib(t,e)):(e.prefinished=!0,t.emit("prefinish")))}o(rb,"prefinish");function Xo(t,e,i){Hr(e)&&(rb(t,e),e.pendingcb===0&&(i?(e.pendingcb++,Nt.nextTick((r,n)=>{Hr(n)?Ho(r,n):n.pendingcb--},t,e)):Hr(e)&&(e.pendingcb++,Ho(t,e))))}o(Xo,"finishMaybe");function Ho(t,e){e.pendingcb--,e.finished=!0;let i=e[ci].splice(0);for(let r=0;r<i.length;r++)i[r]();if(t.emit("finish"),e.autoDestroy){let r=t._readableState;(!r||r.autoDestroy&&(r.endEmitted||r.readable===!1))&&t.destroy()}}o(Ho,"finish");Um(O.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var nb=Gr.destroy;O.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[ci].length)&&Nt.nextTick(Go,i),nb.call(this,t,e),this};O.prototype._undestroy=Gr.undestroy;O.prototype._destroy=function(t,e){e(t)};O.prototype[$m.captureRejectionSymbol]=function(t){this.destroy(t)};var zo;function fc(){return zo===void 0&&(zo={}),zo}o(fc,"lazyWebStreams");O.fromWeb=function(t,e){return fc().newStreamWritableFromWritableStream(t,e)};O.toWeb=function(t){return fc().newWritableStreamFromStreamWritable(t)}});var Ac=A((H_,Nc)=>{var Jo=ct(),ob=Oe(),{isReadable:sb,isWritable:ab,isIterable:hc,isNodeStream:lb,isReadableNodeStream:pc,isWritableNodeStream:yc,isDuplexNodeStream:cb,isReadableStream:mc,isWritableStream:bc}=Me(),gc=Ye(),{AbortError:vc,codes:{ERR_INVALID_ARG_TYPE:ub,ERR_INVALID_RETURN_VALUE:wc}}=ee(),{destroyer:fi}=xt(),fb=qe(),kc=ji(),db=Yr(),{createDeferredPromise:Sc}=J(),_c=Bo(),Ec=globalThis.Blob||ob.Blob,hb=o(typeof Ec<"u"?function(e){return e instanceof Ec}:function(e){return!1},"isBlob"),pb=globalThis.AbortController||Zt().AbortController,{FunctionPrototypeCall:xc}=L(),Xe=class extends fb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};o(Xe,"Duplexify");Nc.exports=o(function t(e,i){if(cb(e))return e;if(pc(e))return ui({readable:e});if(yc(e))return ui({writable:e});if(lb(e))return ui({writable:!1,readable:!1});if(mc(e))return ui({readable:kc.fromWeb(e)});if(bc(e))return ui({writable:db.fromWeb(e)});if(typeof e=="function"){let{value:n,write:s,final:a,destroy:l}=yb(e);if(hc(n))return _c(Xe,n,{objectMode:!0,write:s,final:a,destroy:l});let u=n?.then;if(typeof u=="function"){let f,d=xc(u,n,h=>{if(h!=null)throw new wc("nully","body",h)},h=>{fi(f,h)});return f=new Xe({objectMode:!0,readable:!1,write:s,final(h){a(async()=>{try{await d,Jo.nextTick(h,null)}catch(m){Jo.nextTick(h,m)}})},destroy:l})}throw new wc("Iterable, AsyncIterable or AsyncFunction",i,n)}if(hb(e))return t(e.arrayBuffer());if(hc(e))return _c(Xe,e,{objectMode:!0,writable:!1});if(mc(e?.readable)&&bc(e?.writable))return Xe.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?pc(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?yc(e?.writable)?e?.writable:t(e.writable):void 0;return ui({readable:n,writable:s})}let r=e?.then;if(typeof r=="function"){let n;return xc(r,e,s=>{s!=null&&n.push(s),n.push(null)},s=>{fi(n,s)}),n=new Xe({objectMode:!0,writable:!1,read(){}})}throw new ub(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function yb(t){let{promise:e,resolve:i}=Sc(),r=new pb,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:u,cb:f}=await a;if(Jo.nextTick(f),u)return;if(n.aborted)throw new vc(void 0,{cause:n.reason});({promise:e,resolve:i}=Sc()),yield l}}(),{signal:n}),write(a,l,u){let f=i;i=null,f({chunk:a,done:!1,cb:u})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){r.abort(),l(a)}}}o(yb,"fromAsyncGen");function ui(t){let e=t.readable&&typeof t.readable.read!="function"?kc.wrap(t.readable):t.readable,i=t.writable,r=!!sb(e),n=!!ab(i),s,a,l,u,f;function d(h){let m=u;u=null,m?m(h):h&&f.destroy(h)}return o(d,"onfinished"),f=new Xe({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(gc(i,h=>{n=!1,h&&fi(e,h),d(h)}),f._write=function(h,m,y){i.write(h,m)?y():s=y},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(s){let h=s;s=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),r&&(gc(e,h=>{r=!1,h&&fi(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){l=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,m){!h&&u!==null&&(h=new vc),l=null,s=null,a=null,u===null?m(h):(u=m,fi(i,h),fi(e,h))},f}o(ui,"_duplexify")});var qe=A((G_,Ic)=>{"use strict";var{ObjectDefineProperties:mb,ObjectGetOwnPropertyDescriptor:Je,ObjectKeys:bb,ObjectSetPrototypeOf:Fc}=L();Ic.exports=ke;var es=ji(),me=Yr();Fc(ke.prototype,es.prototype);Fc(ke,es);{let t=bb(me.prototype);for(let e=0;e<t.length;e++){let i=t[e];ke.prototype[i]||(ke.prototype[i]=me.prototype[i])}}function ke(t){if(!(this instanceof ke))return new ke(t);es.call(this,t),me.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}o(ke,"Duplex");mb(ke.prototype,{writable:{__proto__:null,...Je(me.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Je(me.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Je(me.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Je(me.prototype,"writableBuffer")},writableLength:{__proto__:null,...Je(me.prototype,"writableLength")},writableFinished:{__proto__:null,...Je(me.prototype,"writableFinished")},writableCorked:{__proto__:null,...Je(me.prototype,"writableCorked")},writableEnded:{__proto__:null,...Je(me.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Je(me.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Qo;function Tc(){return Qo===void 0&&(Qo={}),Qo}o(Tc,"lazyWebStreams");ke.fromWeb=function(t,e){return Tc().newStreamDuplexFromReadableWritablePair(t,e)};ke.toWeb=function(t){return Tc().newReadableWritablePairFromDuplex(t)};var Zo;ke.from=function(t){return Zo||(Zo=Ac()),Zo(t,"body")}});var rs=A((X_,Cc)=>{"use strict";var{ObjectSetPrototypeOf:Pc,Symbol:gb}=L();Cc.exports=Qe;var{ERR_METHOD_NOT_IMPLEMENTED:wb}=ee().codes,is=qe(),{getHighWaterMark:Sb}=Ui();Pc(Qe.prototype,is.prototype);Pc(Qe,is);var Hi=gb("kCallback");function Qe(t){if(!(this instanceof Qe))return new Qe(t);let e=t?Sb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),is.call(this,t),this._readableState.sync=!1,this[Hi]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",_b)}o(Qe,"Transform");function ts(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}o(ts,"final");function _b(){this._final!==ts&&ts.call(this)}o(_b,"prefinish");Qe.prototype._final=ts;Qe.prototype._transform=function(t,e,i){throw new wb("_transform()")};Qe.prototype._write=function(t,e,i){let r=this._readableState,n=this._writableState,s=r.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),n.ended||s===r.length||r.length<r.highWaterMark?i():this[Hi]=i})};Qe.prototype._read=function(){if(this[Hi]){let t=this[Hi];this[Hi]=null,t()}}});var os=A((Q_,Oc)=>{"use strict";var{ObjectSetPrototypeOf:Lc}=L();Oc.exports=di;var ns=rs();Lc(di.prototype,ns.prototype);Lc(di,ns);function di(t){if(!(this instanceof di))return new di(t);ns.call(this,t)}o(di,"PassThrough");di.prototype._transform=function(t,e,i){i(null,t)}});var Zr=A((e0,Uc)=>{var Ki=ct(),{ArrayIsArray:Eb,Promise:xb,SymbolAsyncIterator:vb,SymbolDispose:kb}=L(),Qr=Ye(),{once:Nb}=J(),Ab=xt(),Rc=qe(),{aggregateTwoErrors:Fb,codes:{ERR_INVALID_ARG_TYPE:ps,ERR_INVALID_RETURN_VALUE:ss,ERR_MISSING_ARGS:Tb,ERR_STREAM_DESTROYED:Ib,ERR_STREAM_PREMATURE_CLOSE:Pb},AbortError:Cb}=ee(),{validateFunction:Lb,validateAbortSignal:Ob}=ii(),{isIterable:At,isReadable:as,isReadableNodeStream:Jr,isNodeStream:Bc,isTransformStream:hi,isWebStream:Rb,isReadableStream:ls,isReadableFinished:Bb}=Me(),Db=globalThis.AbortController||Zt().AbortController,cs,us,fs;function Dc(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=Qr(t,{readable:e,writable:i},s=>{r=!s});return{destroy:s=>{r||(r=!0,Ab.destroyer(t,s||new Ib("pipe")))},cleanup:n}}o(Dc,"destroyer");function Mb(t){return Lb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}o(Mb,"popCallback");function ds(t){if(At(t))return t;if(Jr(t))return Ub(t);throw new ps("val",["Readable","Iterable","AsyncIterable"],t)}o(ds,"makeAsyncIterable");async function*Ub(t){us||(us=ji()),yield*us.prototype[vb].call(t)}o(Ub,"fromReadable");async function Xr(t,e,i,{end:r}){let n,s=null,a=o(f=>{if(f&&(n=f),s){let d=s;s=null,d()}},"resume"),l=o(()=>new xb((f,d)=>{n?d(n):s=o(()=>{n?d(n):f()},"onresolve")}),"wait");e.on("drain",a);let u=Qr(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let f of t)e.write(f)||await l();r&&(e.end(),await l()),i()}catch(f){i(n!==f?Fb(n,f):f)}finally{u(),e.off("drain",a)}}o(Xr,"pumpToNode");async function hs(t,e,i,{end:r}){hi(e)&&(e=e.writable);let n=e.getWriter();try{for await(let s of t)await n.ready,n.write(s).catch(()=>{});await n.ready,r&&await n.close(),i()}catch(s){try{await n.abort(s),i(s)}catch(a){i(a)}}}o(hs,"pumpToWeb");function Wb(...t){return Mc(t,Nb(Mb(t)))}o(Wb,"pipeline");function Mc(t,e,i){if(t.length===1&&Eb(t[0])&&(t=t[0]),t.length<2)throw new Tb("streams");let r=new Db,n=r.signal,s=i?.signal,a=[];Ob(s,"options.signal");function l(){w(new Cb)}o(l,"abort"),fs=fs||J().addAbortListener;let u;s&&(u=fs(s,l));let f,d,h=[],m=0;function y(R){w(R,--m===0)}o(y,"finish");function w(R,N){var q;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!N)){for(;h.length;)h.shift()(f);(q=u)===null||q===void 0||q[kb](),r.abort(),N&&(f||a.forEach(dt=>dt()),Ki.nextTick(e,f,d))}}o(w,"finishImpl");let b;for(let R=0;R<t.length;R++){let N=t[R],q=R<t.length-1,dt=R>0,le=q||i?.end!==!1,Ct=R===t.length-1;if(Bc(N)){let te=function($e){$e&&$e.name!=="AbortError"&&$e.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y($e)};var F=te;if(o(te,"onError"),le){let{destroy:$e,cleanup:fn}=Dc(N,q,dt);h.push($e),as(N)&&Ct&&a.push(fn)}N.on("error",te),as(N)&&Ct&&a.push(()=>{N.removeListener("error",te)})}if(R===0)if(typeof N=="function"){if(b=N({signal:n}),!At(b))throw new ss("Iterable, AsyncIterable or Stream","source",b)}else At(N)||Jr(N)||hi(N)?b=N:b=Rc.from(N);else if(typeof N=="function"){if(hi(b)){var g;b=ds((g=b)===null||g===void 0?void 0:g.readable)}else b=ds(b);if(b=N(b,{signal:n}),q){if(!At(b,!0))throw new ss("AsyncIterable",`transform[${R-1}]`,b)}else{var S;cs||(cs=os());let te=new cs({objectMode:!0}),$e=(S=b)===null||S===void 0?void 0:S.then;if(typeof $e=="function")m++,$e.call(b,tt=>{d=tt,tt!=null&&te.write(tt),le&&te.end(),Ki.nextTick(y)},tt=>{te.destroy(tt),Ki.nextTick(y,tt)});else if(At(b,!0))m++,Xr(b,te,y,{end:le});else if(ls(b)||hi(b)){let tt=b.readable||b;m++,Xr(tt,te,y,{end:le})}else throw new ss("AsyncIterable or Promise","destination",b);b=te;let{destroy:fn,cleanup:pu}=Dc(b,!1,!0);h.push(fn),Ct&&a.push(pu)}}else if(Bc(N)){if(Jr(b)){m+=2;let te=qb(b,N,y,{end:le});as(N)&&Ct&&a.push(te)}else if(hi(b)||ls(b)){let te=b.readable||b;m++,Xr(te,N,y,{end:le})}else if(At(b))m++,Xr(b,N,y,{end:le});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=N}else if(Rb(N)){if(Jr(b))m++,hs(ds(b),N,y,{end:le});else if(ls(b)||At(b))m++,hs(b,N,y,{end:le});else if(hi(b))m++,hs(b.readable,N,y,{end:le});else throw new ps("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);b=N}else b=Rc.from(N)}return(n!=null&&n.aborted||s!=null&&s.aborted)&&Ki.nextTick(l),b}o(Mc,"pipelineImpl");function qb(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new Pb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var s=a;o(a,"endFn"),Bb(t)?Ki.nextTick(a):t.once("end",a)}else i();return Qr(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),Qr(e,{readable:!1,writable:!0},i)}o(qb,"pipe");Uc.exports={pipelineImpl:Mc,pipeline:Wb}});var ms=A((i0,zc)=>{"use strict";var{pipeline:jb}=Zr(),en=qe(),{destroyer:$b}=xt(),{isNodeStream:tn,isReadable:Wc,isWritable:qc,isWebStream:ys,isTransformStream:Ft,isWritableStream:jc,isReadableStream:$c}=Me(),{AbortError:Vb,codes:{ERR_INVALID_ARG_VALUE:Vc,ERR_MISSING_ARGS:zb}}=ee(),Hb=Ye();zc.exports=o(function(...e){if(e.length===0)throw new zb("streams");if(e.length===1)return en.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=en.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=en.from(e[y])}for(let y=0;y<e.length;++y)if(!(!tn(e[y])&&!ys(e[y]))){if(y<e.length-1&&!(Wc(e[y])||$c(e[y])||Ft(e[y])))throw new Vc(`streams[${y}]`,i[y],"must be readable");if(y>0&&!(qc(e[y])||jc(e[y])||Ft(e[y])))throw new Vc(`streams[${y}]`,i[y],"must be writable")}let r,n,s,a,l;function u(y){let w=a;a=null,w?w(y):y?l.destroy(y):!m&&!h&&l.destroy()}o(u,"onfinished");let f=e[0],d=jb(e,u),h=!!(qc(f)||jc(f)||Ft(f)),m=!!(Wc(d)||$c(d)||Ft(d));if(l=new en({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(tn(f))l._write=function(w,b,g){f.write(w,b)?g():r=g},l._final=function(w){f.end(),n=w},f.on("drain",function(){if(r){let w=r;r=null,w()}});else if(ys(f)){let b=(Ft(f)?f.writable:f).getWriter();l._write=async function(g,S,F){try{await b.ready,b.write(g).catch(()=>{}),F()}catch(R){F(R)}},l._final=async function(g){try{await b.ready,b.close().catch(()=>{}),n=g}catch(S){g(S)}}}let y=Ft(d)?d.readable:d;Hb(y,()=>{if(n){let w=n;n=null,w()}})}if(m){if(tn(d))d.on("readable",function(){if(s){let y=s;s=null,y()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let y=d.read();if(y===null){s=l._read;return}if(!l.push(y))return}};else if(ys(d)){let w=(Ft(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:b,done:g}=await w.read();if(!l.push(b))return;if(g){l.push(null);return}}catch{return}}}}return l._destroy=function(y,w){!y&&a!==null&&(y=new Vb),s=null,r=null,n=null,a===null?w(y):(a=w,tn(d)&&$b(d,y))},l},"compose")});var tu=A((n0,gs)=>{"use strict";var Kb=globalThis.AbortController||Zt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Gb,ERR_INVALID_ARG_TYPE:Gi,ERR_MISSING_ARGS:Yb,ERR_OUT_OF_RANGE:Xb},AbortError:je}=ee(),{validateAbortSignal:Tt,validateInteger:Hc,validateObject:It}=ii(),Jb=L().Symbol("kWeak"),Qb=L().Symbol("kResistStopPropagation"),{finished:Zb}=Ye(),eg=ms(),{addAbortSignalNoValidate:tg}=Mi(),{isWritable:ig,isNodeStream:rg}=Me(),{deprecate:ng}=J(),{ArrayPrototypePush:og,Boolean:sg,MathFloor:Kc,Number:ag,NumberIsNaN:lg,Promise:Gc,PromiseReject:Yc,PromiseResolve:cg,PromisePrototypeThen:Xc,Symbol:Qc}=L(),nn=Qc("kEmpty"),Jc=Qc("kEof");function ug(t,e){if(e!=null&&It(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),rg(t)&&!ig(t))throw new Gb("stream",t,"must be writable");let i=eg(this,t);return e!=null&&e.signal&&tg(e.signal,i),i}o(ug,"compose");function on(t,e){if(typeof t!="function")throw new Gi("fn",["Function","AsyncFunction"],t);e!=null&&It(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Kc(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=Kc(e.highWaterMark)),Hc(i,"options.concurrency",1),Hc(r,"options.highWaterMark",0),r+=i,o(async function*(){let s=J().AbortSignalAny([e?.signal].filter(sg)),a=this,l=[],u={signal:s},f,d,h=!1,m=0;function y(){h=!0,w()}o(y,"onCatch");function w(){m-=1,b()}o(w,"afterItemProcessed");function b(){d&&!h&&m<i&&l.length<r&&(d(),d=null)}o(b,"maybeResume");async function g(){try{for await(let S of a){if(h)return;if(s.aborted)throw new je;try{if(S=t(S,u),S===nn)continue;S=cg(S)}catch(F){S=Yc(F)}m+=1,Xc(S,w,y),l.push(S),f&&(f(),f=null),!h&&(l.length>=r||m>=i)&&await new Gc(F=>{d=F})}l.push(Jc)}catch(S){let F=Yc(S);Xc(F,w,y),l.push(F)}finally{h=!0,f&&(f(),f=null)}}o(g,"pump"),g();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===Jc)return;if(s.aborted)throw new je;S!==nn&&(yield S),l.shift(),b()}await new Gc(S=>{f=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}o(on,"map");function fg(t=void 0){return t!=null&&It(t,"options"),t?.signal!=null&&Tt(t.signal,"options.signal"),o(async function*(){let i=0;for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new je({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}o(fg,"asIndexedPairs");async function Zc(t,e=void 0){for await(let i of bs.call(this,t,e))return!0;return!1}o(Zc,"some");async function dg(t,e=void 0){if(typeof t!="function")throw new Gi("fn",["Function","AsyncFunction"],t);return!await Zc.call(this,async(...i)=>!await t(...i),e)}o(dg,"every");async function hg(t,e){for await(let i of bs.call(this,t,e))return i}o(hg,"find");async function pg(t,e){if(typeof t!="function")throw new Gi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),nn}o(i,"forEachFn");for await(let r of on.call(this,i,e));}o(pg,"forEach");function bs(t,e){if(typeof t!="function")throw new Gi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:nn}return o(i,"filterFn"),on.call(this,i,e)}o(bs,"filter");var rn=class extends Yb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};o(rn,"ReduceAwareErrMissingArgs");async function yg(t,e,i){var r;if(typeof t!="function")throw new Gi("reducer",["Function","AsyncFunction"],t);i!=null&&It(i,"options"),i?.signal!=null&&Tt(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let f=new je(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Zb(this.destroy(f)),f}let s=new Kb,a=s.signal;if(i!=null&&i.signal){let f={once:!0,[Jb]:this,[Qb]:!0};i.signal.addEventListener("abort",()=>s.abort(),f)}let l=!1;try{for await(let f of this){var u;if(l=!0,i!=null&&(u=i.signal)!==null&&u!==void 0&&u.aborted)throw new je;n?e=await t(e,f,{signal:a}):(e=f,n=!0)}if(!l&&!n)throw new rn}finally{s.abort()}return e}o(yg,"reduce");async function mg(t){t!=null&&It(t,"options"),t?.signal!=null&&Tt(t.signal,"options.signal");let e=[];for await(let r of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new je(void 0,{cause:t.signal.reason});og(e,r)}return e}o(mg,"toArray");function bg(t,e){let i=on.call(this,t,e);return o(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}o(bg,"flatMap");function eu(t){if(t=ag(t),lg(t))return 0;if(t<0)throw new Xb("number",">= 0",t);return t}o(eu,"toIntegerOrInfinity");function gg(t,e=void 0){return e!=null&&It(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),t=eu(t),o(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new je;for await(let s of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;t--<=0&&(yield s)}},"drop").call(this)}o(gg,"drop");function wg(t,e=void 0){return e!=null&&It(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),t=eu(t),o(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new je;for await(let s of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new je;if(t-- >0&&(yield s),t<=0)return}},"take").call(this)}o(wg,"take");gs.exports.streamReturningOperators={asIndexedPairs:ng(fg,"readable.asIndexedPairs will be removed in a future version."),drop:gg,filter:bs,flatMap:bg,map:on,take:wg,compose:ug};gs.exports.promiseReturningOperators={every:dg,forEach:pg,reduce:yg,toArray:mg,some:Zc,find:hg}});var ws=A((s0,iu)=>{"use strict";var{ArrayPrototypePop:Sg,Promise:_g}=L(),{isIterable:Eg,isNodeStream:xg,isWebStream:vg}=Me(),{pipelineImpl:kg}=Zr(),{finished:Ng}=Ye();Ss();function Ag(...t){return new _g((e,i)=>{let r,n,s=t[t.length-1];if(s&&typeof s=="object"&&!xg(s)&&!Eg(s)&&!vg(s)){let a=Sg(t);r=a.signal,n=a.end}kg(t,(a,l)=>{a?i(a):e(l)},{signal:r,end:n})})}o(Ag,"pipeline");iu.exports={finished:Ng,pipeline:Ag}});var Ss=A((l0,fu)=>{var{Buffer:Fg}=Oe(),{ObjectDefineProperty:Ze,ObjectKeys:ou,ReflectApply:su}=L(),{promisify:{custom:au}}=J(),{streamReturningOperators:ru,promiseReturningOperators:nu}=tu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:lu}}=ee(),Tg=ms(),{setDefaultHighWaterMark:Ig,getDefaultHighWaterMark:Pg}=Ui(),{pipeline:cu}=Zr(),{destroyer:Cg}=xt(),uu=Ye(),_s=ws(),Yi=Me(),C=fu.exports=Br().Stream;C.isDestroyed=Yi.isDestroyed;C.isDisturbed=Yi.isDisturbed;C.isErrored=Yi.isErrored;C.isReadable=Yi.isReadable;C.isWritable=Yi.isWritable;C.Readable=ji();for(let t of ou(ru)){let i=function(...r){if(new.target)throw lu();return C.Readable.from(su(e,this,r))};Og=i,o(i,"fn");let e=ru[t];Ze(i,"name",{__proto__:null,value:e.name}),Ze(i,"length",{__proto__:null,value:e.length}),Ze(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Og;for(let t of ou(nu)){let i=function(...n){if(new.target)throw lu();return su(e,this,n)};Og=i,o(i,"fn");let e=nu[t];Ze(i,"name",{__proto__:null,value:e.name}),Ze(i,"length",{__proto__:null,value:e.length}),Ze(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Og;C.Writable=Yr();C.Duplex=qe();C.Transform=rs();C.PassThrough=os();C.pipeline=cu;var{addAbortSignal:Lg}=Mi();C.addAbortSignal=Lg;C.finished=uu;C.destroy=Cg;C.compose=Tg;C.setDefaultHighWaterMark=Ig;C.getDefaultHighWaterMark=Pg;Ze(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return _s}});Ze(cu,au,{__proto__:null,enumerable:!0,get(){return _s.pipeline}});Ze(uu,au,{__proto__:null,enumerable:!0,get(){return _s.finished}});C.Stream=C;C._isUint8Array=o(function(e){return e instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=o(function(e){return Fg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var du=A((u0,W)=>{"use strict";var z=Ss(),Rg=ws(),Bg=z.Readable.destroy;W.exports=z.Readable;W.exports._uint8ArrayToBuffer=z._uint8ArrayToBuffer;W.exports._isUint8Array=z._isUint8Array;W.exports.isDisturbed=z.isDisturbed;W.exports.isErrored=z.isErrored;W.exports.isReadable=z.isReadable;W.exports.Readable=z.Readable;W.exports.Writable=z.Writable;W.exports.Duplex=z.Duplex;W.exports.Transform=z.Transform;W.exports.PassThrough=z.PassThrough;W.exports.addAbortSignal=z.addAbortSignal;W.exports.finished=z.finished;W.exports.destroy=z.destroy;W.exports.destroy=Bg;W.exports.pipeline=z.pipeline;W.exports.compose=z.compose;Object.defineProperty(z,"promises",{configurable:!0,enumerable:!0,get(){return Rg}});W.exports.Stream=z.Stream;W.exports.default=W.exports});var Ug={};Qi(Ug,{ActionType:()=>lr,ApiError:()=>c,Async:()=>wi,AsyncFile:()=>Ut,AsyncFileIndexFS:()=>un,AsyncMirror:()=>nf,AsyncMirrorFS:()=>yt,AsyncStoreFS:()=>ur,BigIntStats:()=>K,BigIntStatsFs:()=>or,ErrorCode:()=>$,ErrorStrings:()=>dn,File:()=>Ei,FileIndex:()=>Pt,FileIndexFS:()=>yi,FileSystem:()=>Y,FileType:()=>D,InMemory:()=>Sn,InMemoryStore:()=>Ai,IndexDirInode:()=>et,IndexFileInode:()=>Ji,IndexInode:()=>pi,Inode:()=>ue,LockedFS:()=>$t,MirrorFile:()=>ki,Mutex:()=>jt,NoSyncFile:()=>pt,Overlay:()=>of,OverlayFS:()=>zt,OverlayFile:()=>Vt,PreloadFile:()=>re,Readonly:()=>yn,SimpleSyncTransaction:()=>Wt,Stats:()=>B,StatsCommon:()=>Bt,StatsFs:()=>Dt,Sync:()=>ht,SyncFile:()=>ar,SyncFileIndexFS:()=>cn,SyncStoreFS:()=>qt,SyncStoreFile:()=>Ni,UnlockedOverlayFS:()=>Fi,checkOptions:()=>pn,configure:()=>Dg,createBackend:()=>ku,decode:()=>er,decodeDirListing:()=>bi,default:()=>Mg,encode:()=>Ae,encodeDirListing:()=>oe,flagToMode:()=>it,flagToNumber:()=>rf,flagToString:()=>Ts,fs:()=>Xi,initialize:()=>hu,isAppendable:()=>rt,isBackend:()=>gi,isBackendConfig:()=>As,isExclusive:()=>Ps,isReadable:()=>Ve,isSynchronous:()=>_i,isTruncating:()=>Is,isWriteable:()=>de,levenshtein:()=>hn,mkdirpSync:()=>Ns,parseFlag:()=>P,pathExistsAction:()=>xi,pathNotExistsAction:()=>vi,randomIno:()=>Mt,resolveBackend:()=>tr,rootCred:()=>we,rootIno:()=>fe,setImmediate:()=>vu,size_max:()=>sr,wait:()=>xu});var $=(g=>(g[g.EPERM=1]="EPERM",g[g.ENOENT=2]="ENOENT",g[g.EIO=5]="EIO",g[g.EBADF=9]="EBADF",g[g.EACCES=13]="EACCES",g[g.EBUSY=16]="EBUSY",g[g.EEXIST=17]="EEXIST",g[g.ENOTDIR=20]="ENOTDIR",g[g.EISDIR=21]="EISDIR",g[g.EINVAL=22]="EINVAL",g[g.EFBIG=27]="EFBIG",g[g.ENOSPC=28]="ENOSPC",g[g.EROFS=30]="EROFS",g[g.EDEADLK=35]="EDEADLK",g[g.ENOTEMPTY=39]="ENOTEMPTY",g[g.ENOTSUP=95]="ENOTSUP",g))($||{}),dn={[1]:"Operation not permitted.",[2]:"No such file or directory.",[5]:"Input/output error.",[9]:"Bad file descriptor.",[13]:"Permission denied.",[16]:"Resource busy or locked.",[17]:"File exists.",[20]:"File is not a directory.",[21]:"File is a directory.",[22]:"Invalid argument.",[27]:"File is too big.",[28]:"No space left on disk.",[30]:"Cannot modify a read-only file system.",[35]:"Resource deadlock would occur",[39]:"Directory is not empty.",[95]:"Operation is not supported."},c=class extends Error{constructor(i,r=dn[i],n,s=""){super(r);this.errno=i;this.path=n;this.syscall=s;this.code=$[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let r=new c(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 c($[i],dn[$[i]],r,n)}code;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}};o(c,"ApiError");var _u="/",vs="/";function Lt(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}o(Lt,"validateString");function ks(t,e){let i="",r=0,n=-1,s=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||s===1))if(s===2){if(i.length<2||r!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let u=i.lastIndexOf("/");u===-1?(i="",r=0):(i=i.slice(0,u),r=i.length-1-i.lastIndexOf("/")),n=l,s=0;continue}else if(i.length!==0){i="",r=0,n=l,s=0;continue}}e&&(i+=i.length>0?"/..":"..",r=2)}else i.length>0?i+="/"+t.slice(n+1,l):i=t.slice(n+1,l),r=l-n-1;n=l,s=0}else a==="."&&s!==-1?++s:s=-1}return i}o(ks,"normalizeString");function Ne(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){let n=r>=0?t[r]:_u;Lt(n,`paths[${r}]`),n.length!==0&&(e=`${n}/${e}`,i=n[0]==="/")}return e=ks(e,!i),i?`/${e}`:e.length>0?e:"."}o(Ne,"resolve");function Eu(t){if(Lt(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=ks(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}o(Eu,"normalize");function ce(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let r=t[i];Lt(r,"path"),r.length>0&&(e===void 0?e=r:e+=`/${r}`)}return e===void 0?".":Eu(e)}o(ce,"join");function x(t){if(Lt(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,r=!0;for(let n=t.length-1;n>=1;--n)if(t[n]==="/"){if(!r){i=n;break}}else r=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}o(x,"dirname");function I(t,e){e!==void 0&&Lt(e,"ext"),Lt(t,"path");let i=0,r=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let s=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!n){i=l+1;break}}else a===-1&&(n=!1,a=l+1),s>=0&&(t[l]===e[s]?--s===-1&&(r=l):(s=-1,r=a));return i===r?r=a:r===-1&&(r=t.length),t.slice(i,r)}for(let s=t.length-1;s>=0;--s)if(t[s]==="/"){if(!n){i=s+1;break}}else r===-1&&(n=!1,r=s+1);return r===-1?"":t.slice(i,r)}o(I,"basename");function Ns(t,e,i,r){r.existsSync(t,i)||(Ns(x(t),e,i,r),r.mkdirSync(t,e,i))}o(Ns,"mkdirpSync");function Zi(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}o(Zi,"_min");function hn(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,r=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(r-1);)i--,r--;let n=0;for(;n<i&&t.charCodeAt(n)===e.charCodeAt(n);)n++;if(i-=n,r-=n,i===0||r===1)return r;let s=new Array(i<<1);for(let m=0;m<i;)s[i+m]=t.charCodeAt(n+m),s[m]=++m;let a,l,u,f,d;for(a=0;a+3<r;){let m=e.charCodeAt(n+(l=a)),y=e.charCodeAt(n+(u=a+1)),w=e.charCodeAt(n+(f=a+2)),b=e.charCodeAt(n+(d=a+3)),g=a+=4;for(let S=0;S<i;){let F=s[i+S],R=s[S];l=Zi(R,l,u,m,F),u=Zi(l,u,f,y,F),f=Zi(u,f,d,w,F),g=Zi(f,d,g,b,F),s[S++]=g,d=f,f=u,u=l,l=R}}let h=0;for(;a<r;){let m=e.charCodeAt(n+(l=a));h=++a;for(let y=0;y<i;y++){let w=s[y];s[y]=h=w<l||h<l?w>h?h+1:w+1:m===s[i+y]?l:l+1,l=w}}return h}o(hn,"levenshtein");function xu(t){return new Promise(e=>{setTimeout(e,t)})}o(xu,"wait");var vu=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Ae(t){if(typeof t!="string")throw new c(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}o(Ae,"encode");function er(t){if(!(t instanceof Uint8Array))throw new c(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}o(er,"decode");function bi(t){return JSON.parse(er(t),(e,i)=>e==""?i:BigInt(i))}o(bi,"decodeDirListing");function oe(t){return Ae(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}o(oe,"encodeDirListing");function gi(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}o(gi,"isBackend");async function pn(t,e){if(typeof e!="object"||e===null)throw new c(22,"Invalid options");for(let[i,r]of Object.entries(t.options)){let n=e?.[i];if(n==null){if(!r.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:hn(i,l)})).filter(l=>l.distance<5).sort((l,u)=>l.distance-u.distance);throw new c(22,`${t.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 c(22,`${t.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)}}o(pn,"checkOptions");function ku(t,e){return pn(t,e),t.create(e).ready()}o(ku,"createBackend");function As(t){return t!=null&&typeof t=="object"&&"backend"in t}o(As,"isBackendConfig");async function tr(t,e=0){if(typeof t!="object"||t==null)throw new c(22,"Invalid options on configuration object.");let{backend:i}=t;if(!gi(i))throw new c(22,"Missing or invalid backend");let r=Object.keys(t).filter(s=>s!="backend");for(let s of r){let a=t[s];if(gi(a)&&(a={backend:a}),As(a)){if(e>10)throw new c(22,"Invalid configuration, too deep and possibly infinite");t[s]=await tr(a,++e)}}if(!await i.isAvailable())throw new c(1,"Backend not available: "+i);pn(i,t);let n=i.create(t);return await n.ready(),n}o(tr,"resolveBackend");var Y=class{metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};o(Y,"FileSystem");function ht(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!0}}async ready(){return this}async exists(r,n){return this.existsSync(r,n)}async rename(r,n,s){return this.renameSync(r,n,s)}async stat(r,n){return this.statSync(r,n)}async createFile(r,n,s,a){return this.createFileSync(r,n,s,a)}async openFile(r,n,s){return this.openFileSync(r,n,s)}async unlink(r,n){return this.unlinkSync(r,n)}async rmdir(r,n){return this.rmdirSync(r,n)}async mkdir(r,n,s){return this.mkdirSync(r,n,s)}async readdir(r,n){return this.readdirSync(r,n)}async link(r,n,s){return this.linkSync(r,n,s)}async sync(r,n,s){return this.syncSync(r,n,s)}}return o(e,"_SyncFileSystem"),e}o(ht,"Sync");function wi(t){class e extends t{metadata(){return{...super.metadata(),synchronous:!1}}renameSync(r,n,s){throw new c(95)}statSync(r,n){throw new c(95)}createFileSync(r,n,s,a){throw new c(95)}openFileSync(r,n,s){throw new c(95)}unlinkSync(r,n){throw new c(95)}rmdirSync(r,n){throw new c(95)}mkdirSync(r,n,s){throw new c(95)}readdirSync(r,n){throw new c(95)}linkSync(r,n,s){throw new c(95)}syncSync(r,n,s){throw new c(95)}}return o(e,"_AsyncFileSystem"),e}o(wi,"Async");function yn(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(r,n,s){throw new c(30)}renameSync(r,n,s){throw new c(30)}async createFile(r,n,s,a){throw new c(30)}createFileSync(r,n,s,a){throw new c(30)}async unlink(r,n){throw new c(30)}unlinkSync(r,n){throw new c(30)}async rmdir(r,n){throw new c(30)}rmdirSync(r,n){throw new c(30)}async mkdir(r,n,s){throw new c(30)}mkdirSync(r,n,s){throw new c(30)}async link(r,n,s){throw new c(30)}linkSync(r,n,s){throw new c(30)}async sync(r,n,s){throw new c(30)}syncSync(r,n,s){throw new c(30)}}return o(e,"_ReadonlyFileSystem"),e}o(yn,"Readonly");var Si={};Qi(Si,{COPYFILE_EXCL:()=>Au,COPYFILE_FICLONE:()=>Fu,COPYFILE_FICLONE_FORCE:()=>Tu,F_OK:()=>mn,O_APPEND:()=>Pe,O_CREAT:()=>H,O_DIRECT:()=>Bu,O_DIRECTORY:()=>Pu,O_DSYNC:()=>Ou,O_EXCL:()=>Te,O_NOATIME:()=>Cu,O_NOCTTY:()=>Iu,O_NOFOLLOW:()=>Lu,O_NONBLOCK:()=>Du,O_RDONLY:()=>Ot,O_RDWR:()=>ie,O_SYMLINK:()=>Ru,O_SYNC:()=>Rt,O_TRUNC:()=>Ie,O_WRONLY:()=>Fe,R_OK:()=>be,S_IFBLK:()=>Uu,S_IFCHR:()=>Wu,S_IFDIR:()=>nr,S_IFIFO:()=>qu,S_IFLNK:()=>ir,S_IFMT:()=>ge,S_IFREG:()=>rr,S_IFSOCK:()=>Mu,S_IRGRP:()=>Gu,S_IROTH:()=>Ju,S_IRUSR:()=>zu,S_IRWXG:()=>gn,S_IRWXO:()=>wn,S_IRWXU:()=>bn,S_ISGID:()=>$u,S_ISUID:()=>ju,S_ISVTX:()=>Vu,S_IWGRP:()=>Yu,S_IWOTH:()=>Qu,S_IWUSR:()=>Hu,S_IXGRP:()=>Xu,S_IXOTH:()=>Zu,S_IXUSR:()=>Ku,UV_FS_O_FILEMAP:()=>ef,W_OK:()=>se,X_OK:()=>Nu});var mn=0,be=4,se=2,Nu=1,Au=1,Fu=2,Tu=4,Ot=0,Fe=1,ie=2,H=64,Te=128,Iu=256,Ie=512,Pe=1024,Pu=65536,Cu=262144,Lu=131072,Rt=1052672,Ou=4096,Ru=32768,Bu=16384,Du=2048,ge=61440,Mu=49152,ir=40960,rr=32768,Uu=24576,nr=16384,Wu=8192,qu=4096,ju=2048,$u=1024,Vu=512,bn=448,zu=256,Hu=128,Ku=64,gn=56,Gu=32,Yu=16,Xu=8,wn=7,Ju=4,Qu=2,Zu=1,ef=0;var D=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(D||{}),Bt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:i,ctimeMs:r,birthtimeMs:n,uid:s,gid:a,size:l,mode:u}={}){let f=Date.now(),d=o((m,y)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:y),"resolveT");this.atimeMs=d(e,f),this.mtimeMs=d(i,f),this.ctimeMs=d(r,f),this.birthtimeMs=d(n,f),this.uid=d(s,0),this.gid=d(a,0),this.size=this._convert(l);let h=Number(u)&61440||D.FILE;if(u)this.mode=this._convert(u);else switch(h){case D.FILE:this.mode=this._convert(420);break;case D.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(h))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,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(e&this.mode&r)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}};o(Bt,"StatsCommon");var B=class extends Bt{_isBigint=!1;static clone(e){return new B(e)}};o(B,"Stats");var K=class extends Bt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new K(e)}};o(K,"BigIntStats");var Dt=class{type;bsize;blocks;bfree;bavail;files;ffree};o(Dt,"StatsFs");var or=class{type;bsize;blocks;bfree;bavail;files;ffree};o(or,"BigIntStatsFs");var sr=2**32-1,fe=0n;function Fs(){return Math.round(Math.random()*2**32).toString(16)}o(Fs,"_random");function Mt(){return BigInt("0x"+Fs()+Fs())}o(Mt,"randomIno");var ue=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Mt(),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(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new B(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};o(ue,"Inode");var lr=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(lr||{}),tf=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function P(t){if(typeof t=="number")return Ts(t);if(!tf.includes(t))throw new Error("Invalid flag string: "+t);return t}o(P,"parseFlag");function Ts(t){switch(t){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+t)}}o(Ts,"flagToString");function rf(t){switch(t){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+t)}}o(rf,"flagToNumber");function it(t){let e=0;return e<<=1,e+=+Ve(t),e<<=1,e+=+de(t),e<<=1,e}o(it,"flagToMode");function Ve(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}o(Ve,"isReadable");function de(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}o(de,"isWriteable");function Is(t){return t.indexOf("w")!==-1}o(Is,"isTruncating");function rt(t){return t.indexOf("a")!==-1}o(rt,"isAppendable");function _i(t){return t.indexOf("s")!==-1}o(_i,"isSynchronous");function Ps(t){return t.indexOf("x")!==-1}o(Ps,"isExclusive");function xi(t){return Ps(t)?1:Is(t)?2:0}o(xi,"pathExistsAction");function vi(t){return(de(t)||rt(t))&&t!=="r+"?3:1}o(vi,"pathNotExistsAction");var Ei=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};o(Ei,"File");var re=class extends Ei{constructor(i,r,n,s,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:sr}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=s;this._buffer=a;if(this.stats.size!=a.byteLength){if(Ve(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return rt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async stat(){return new B(this.stats)}statSync(){return new B(this.stats)}truncate(i){if(this.truncateSync(i),_i(this.flag)&&!this.fs.metadata().synchronous)return this.sync()}truncateSync(i){if(this._dirty=!0,!de(this.flag))throw new c(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),_i(this.flag)&&this.fs.metadata().synchronous&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),_i(this.flag)&&this.fs.metadata().synchronous&&this.syncSync()}async write(i,r=0,n=this.stats.size,s=0){return this.writeSync(i,r,n,s)}writeSync(i,r=0,n=this.stats.size,s=0){if(this._dirty=!0,s??=this.position,!de(this.flag))throw new c(1,"File not opened with a writeable mode.");let a=s+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 f=new Uint8Array(new ArrayBuffer(a,{maxByteLength:sr}));f.set(this._buffer),this._buffer=f}let l=i.slice(r,r+n);this._buffer.set(l,s);let u=l.byteLength;return this.stats.mtimeMs=Date.now(),_i(this.flag)?(this.syncSync(),u):(this.position=s+u,u)}async read(i,r=0,n=this.stats.size,s=0){return{bytesRead:this.readSync(i,r,n,s),buffer:i}}readSync(i,r=0,n=this.stats.size,s=0){if(!Ve(this.flag))throw new c(1,"File not opened with a readable mode.");s??=this.position;let a=s+n;a>this.stats.size&&(a=s+Math.max(this.stats.size-s,0)),this.stats.atimeMs=Date.now(),this._position=a;let l=a-s;return l==0||new Uint8Array(i.buffer).set(this._buffer.slice(s,a),r),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.chownSync(i,r)}chownSync(i,r){this._dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.utimesSync(i,r)}utimesSync(i,r){this._dirty=!0,this.stats.atime=i,this.stats.mtime=r,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};o(re,"PreloadFile");var ar=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o(ar,"SyncFile");var pt=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){}syncSync(){}async close(){}closeSync(){}};o(pt,"NoSyncFile");var we={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var ki=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o(ki,"MirrorFile");var yt=class extends ht(Y){_queue=[];_queueRunning=!1;_sync;_async;_isInitialized=!1;_ready;async ready(){return await this._ready,this}constructor({sync:e,async:i}){super(),this._sync=e,this._async=i,this._ready=this._initialize()}metadata(){return{...super.metadata(),name:yt.name,synchronous:!0,supportsProperties:this._sync.metadata().supportsProperties&&this._async.metadata().supportsProperties}}syncSync(e,i,r){this._sync.syncSync(e,i,r),this.enqueue({apiMethod:"sync",arguments:[e,i,r]})}openFileSync(e,i,r){return this._sync.openFileSync(e,i,r)}createFileSync(e,i,r,n){let s=this._sync.createFileSync(e,i,r,n);this.enqueue({apiMethod:"createFile",arguments:[e,i,r,n]});let a=s.statSync(),l=new Uint8Array(a.size);return s.readSync(l),new ki(this,e,i,a,l)}linkSync(e,i,r){this._sync.linkSync(e,i,r),this.enqueue({apiMethod:"link",arguments:[e,i,r]})}renameSync(e,i,r){this._sync.renameSync(e,i,r),this.enqueue({apiMethod:"rename",arguments:[e,i,r]})}statSync(e,i){return this._sync.statSync(e,i)}unlinkSync(e,i){this._sync.unlinkSync(e,i),this.enqueue({apiMethod:"unlink",arguments:[e,i]})}rmdirSync(e,i){this._sync.rmdirSync(e,i),this.enqueue({apiMethod:"rmdir",arguments:[e,i]})}mkdirSync(e,i,r){this._sync.mkdirSync(e,i,r),this.enqueue({apiMethod:"mkdir",arguments:[e,i,r]})}readdirSync(e,i){return this._sync.readdirSync(e,i)}existsSync(e,i){return this._sync.existsSync(e,i)}async crossCopyDirectory(e,i){if(e!=="/"){let n=await this._async.stat(e,we);this._sync.mkdirSync(e,i,n.cred())}let r=await this._async.readdir(e,we);for(let n of r)await this.crossCopy(ce(e,n))}async crossCopyFile(e,i){let r=await this._async.openFile(e,P("r"),we),n=this._sync.createFileSync(e,P("w"),i,we);try{let{size:s}=await r.stat(),a=new Uint8Array(s);await r.read(a),n.writeSync(a)}finally{await r.close(),n.closeSync()}}async crossCopy(e){let i=await this._async.stat(e,we);i.isDirectory()?await this.crossCopyDirectory(e,i.mode):await this.crossCopyFile(e,i.mode)}async _initialize(){if(!this._isInitialized)try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let e=this._queue.shift();try{await this._async[e.apiMethod](...e.arguments)}catch(i){throw new c(5,"AsyncMirror desync: "+i)}await this._next()}enqueue(e){this._queue.push(e),!this._queueRunning&&(this._queueRunning=!0,this._next())}};o(yt,"AsyncMirrorFS");var nf={name:"AsyncMirror",options:{sync:{type:"object",required:!0,description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if("metadata"in t&&!t.metadata().synchronous)throw new c(22,'"sync" option must be a file system that supports synchronous operations')}},async:{type:"object",required:!0,description:"The asynchronous file system to mirror."}},isAvailable(){return!0},create(t){return new yt(t)}};var cr=class{constructor(e){this.limit=e}cache=[];set(e,i){let r=this.cache.findIndex(n=>n.key===e);r!=-1?this.cache.splice(r,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(r=>r.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(r=>r.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};o(cr,"LRUCache");var Ut=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this.resetDirty())}syncSync(){throw new c(95)}async close(){this.sync()}closeSync(){throw new c(95)}};o(Ut,"AsyncFile");var ur=class extends wi(Y){store;_cache;_ready;ready(){return this._ready}metadata(){return{...super.metadata(),name:this.store.name}}constructor({store:e,cacheSize:i}){super(),i>0&&(this._cache=new cr(i)),this._ready=this._initialize(e)}async _initialize(e){return this.store=await e,await this.makeRootDirectory(),this}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(e,i,r){let n=this._cache;this._cache&&(this._cache=null,n.reset());try{let s=this.store.beginTransaction(),a=x(e),l=I(e),u=x(i),f=I(i),d=await this.findINode(s,a),h=await this.getDirListing(s,d,a);if(!d.toStats().hasAccess(2,r))throw c.With("EACCES",e,"rename");if(!h[l])throw c.With("ENOENT",e,"rename");let m=h[l];if(delete h[l],(u+"/").indexOf(e+"/")===0)throw new c(16,a);let y,w;if(u===a?(y=d,w=h):(y=await this.findINode(s,u),w=await this.getDirListing(s,y,u)),w[f]){let b=await this.getINode(s,w[f],i);if(b.toStats().isFile())try{await s.remove(b.ino),await s.remove(w[f])}catch(g){throw await s.abort(),g}else throw c.With("EPERM",i,"rename")}w[f]=m;try{await s.put(d.ino,oe(h),!0),await s.put(y.ino,oe(w),!0)}catch(b){throw await s.abort(),b}await s.commit()}finally{n&&(this._cache=n)}}async stat(e,i){let r=this.store.beginTransaction(),n=await this.findINode(r,e);if(!n)throw c.With("ENOENT",e,"stat");let s=n.toStats();if(!s.hasAccess(4,i))throw c.With("EACCES",e,"stat");return s}async createFile(e,i,r,n){let s=this.store.beginTransaction(),a=new Uint8Array(0),l=await this.commitNewFile(s,e,D.FILE,r,n,a);return new Ut(this,e,i,l.toStats(),a)}async openFile(e,i,r){let n=this.store.beginTransaction(),s=await this.findINode(n,e),a=await n.get(s.ino);if(!s.toStats().hasAccess(it(i),r))throw c.With("EACCES",e,"openFile");if(!a)throw c.With("ENOENT",e,"openFile");return new Ut(this,e,i,s.toStats(),a)}async unlink(e,i){return this.removeEntry(e,!1,i)}async rmdir(e,i){if((await this.readdir(e,i)).length>0)throw c.With("ENOTEMPTY",e,"rmdir");await this.removeEntry(e,!0,i)}async mkdir(e,i,r){let n=this.store.beginTransaction(),s=Ae("{}");await this.commitNewFile(n,e,D.DIRECTORY,i,r,s)}async readdir(e,i){let r=this.store.beginTransaction(),n=await this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw c.With("EACCES",e,"readdur");return Object.keys(await this.getDirListing(r,n,e))}async sync(e,i,r){let n=this.store.beginTransaction(),s=await this._findINode(n,x(e),I(e)),a=await this.getINode(n,s,e),l=a.update(r);try{await n.put(a.ino,i,!0),l&&await n.put(s,a.data,!0)}catch(u){throw await n.abort(),u}await n.commit()}async link(e,i,r){let n=this.store.beginTransaction(),s=x(e);if(!(await this.findINode(n,s)).toStats().hasAccess(4,r))throw c.With("EACCES",s,"link");let l=x(i),u=await this.findINode(n,l),f=await this.getDirListing(n,u,l);if(!u.toStats().hasAccess(2,r))throw c.With("EACCES",l,"link");let d=await this._findINode(n,s,I(e)),h=await this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw c.With("EACCES",i,"link");h.nlink++,f[I(i)]=d;try{n.put(d,h.data,!0),n.put(u.ino,oe(f),!0)}catch(m){throw n.abort(),m}n.commit()}async makeRootDirectory(){let e=this.store.beginTransaction();if(await e.get(fe)===void 0){let i=new ue;i.mode=511|D.DIRECTORY,await e.put(i.ino,Ae("{}"),!1),await e.put(fe,i.data,!1),await e.commit()}}async _findINode(e,i,r,n=new Set){let s=ce(i,r);if(n.has(s))throw new c(5,"Infinite loop detected while finding inode",s);if(n.add(s),this._cache){let a=this._cache.get(s);if(a)return a}if(i==="/"){if(r==="")return this._cache&&this._cache.set(s,fe),fe;{let a=await this.getINode(e,fe,i),l=await this.getDirListing(e,a,i);if(l[r]){let u=l[r];return this._cache&&this._cache.set(s,u),u}else throw c.With("ENOENT",Ne(i,r),"_findINode")}}else{let a=await this.findINode(e,i,n),l=await this.getDirListing(e,a,i);if(l[r]){let u=l[r];return this._cache&&this._cache.set(s,u),u}else throw c.With("ENOENT",Ne(i,r),"_findINode")}}async findINode(e,i,r=new Set){let n=await this._findINode(e,x(i),I(i),r);return this.getINode(e,n,i)}async getINode(e,i,r){let n=await e.get(i);if(!n)throw c.With("ENOENT",r,"getINode");return new ue(n.buffer)}async getDirListing(e,i,r){if(!i.toStats().isDirectory())throw c.With("ENOTDIR",r,"getDirListing");let n=await e.get(i.ino);if(!n)throw c.With("ENOENT",r,"getDirListing");return bi(n)}async addNewNode(e,i,r=5){if(r<=0)throw new c(5,"Unable to commit data to key-value store.");let n=Mt();return await e.put(n,i,!1)?n:await this.addNewNode(e,i,--r)}async commitNewFile(e,i,r,n,s,a){let l=x(i),u=I(i),f=await this.findINode(e,l),d=await this.getDirListing(e,f,l);if(!f.toStats().hasAccess(2,s))throw c.With("EACCES",i,"commitNewFile");if(i==="/")throw c.With("EEXIST",i,"commitNewFile");if(d[u])throw await e.abort(),c.With("EEXIST",i,"commitNewFile");try{let h=new ue;return h.ino=await this.addNewNode(e,a),h.mode=n|r,h.uid=s.uid,h.gid=s.gid,h.size=a.length,d[u]=await this.addNewNode(e,h.data),await e.put(f.ino,oe(d),!0),await e.commit(),h}catch(h){throw e.abort(),h}}async removeEntry(e,i,r){this._cache&&this._cache.remove(e);let n=this.store.beginTransaction(),s=x(e),a=await this.findINode(n,s),l=await this.getDirListing(n,a,s),u=I(e);if(!l[u])throw c.With("ENOENT",e,"removeEntry");let f=l[u],d=await this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw c.With("EACCES",e,"removeEntry");if(delete l[u],!i&&d.toStats().isDirectory())throw c.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw c.With("ENOTDIR",e,"removeEntry");try{await n.put(a.ino,oe(l),!0),--d.nlink<1&&(await n.remove(d.ino),await n.remove(f))}catch(h){throw await n.abort(),h}await n.commit()}};o(ur,"AsyncStoreFS");var Wt=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,r){return this.markModified(e),this.store.put(e,i,r)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};o(Wt,"SimpleSyncTransaction");var Ni=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.syncSync()}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.resetDirty())}async close(){this.closeSync()}closeSync(){this.syncSync()}};o(Ni,"SyncStoreFile");var qt=class extends ht(Y){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,r){let n=this.store.beginTransaction(),s=x(e),a=I(e),l=x(i),u=I(i),f=this.findINode(n,s),d=this.getDirListing(n,f,s);if(!f.toStats().hasAccess(2,r))throw c.With("EACCES",e,"renameSync");if(!d[a])throw c.With("ENOENT",e,"renameSync");let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new c(16,s);let m,y;if(l===s?(m=f,y=d):(m=this.findINode(n,l),y=this.getDirListing(n,m,l)),y[u]){let w=this.getINode(n,y[u],i);if(w.toStats().isFile())try{n.remove(w.ino),n.remove(y[u])}catch(b){throw n.abort(),b}else throw c.With("EPERM",i,"renameSync")}y[u]=h;try{n.put(f.ino,oe(d),!0),n.put(m.ino,oe(y),!0)}catch(w){throw n.abort(),w}n.commit()}statSync(e,i){let r=this.findINode(this.store.beginTransaction(),e).toStats();if(!r.hasAccess(4,i))throw c.With("EACCES",e,"statSync");return r}createFileSync(e,i,r,n){return this.commitNewFile(e,D.FILE,r,n),this.openFileSync(e,i,n)}openFileSync(e,i,r){let n=this.store.beginTransaction(),s=this.findINode(n,e),a=n.get(s.ino);if(!s.toStats().hasAccess(it(i),r))throw c.With("EACCES",e,"openFileSync");if(a===null)throw c.With("ENOENT",e,"openFileSync");return new Ni(this,e,i,s.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw c.With("ENOTEMPTY",e,"rmdirSync");this.removeEntry(e,!0,i)}mkdirSync(e,i,r){this.commitNewFile(e,D.DIRECTORY,i,r,Ae("{}"))}readdirSync(e,i){let r=this.store.beginTransaction(),n=this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw c.With("EACCES",e,"readdirSync");return Object.keys(this.getDirListing(r,n,e))}syncSync(e,i,r){let n=this.store.beginTransaction(),s=this._findINode(n,x(e),I(e)),a=this.getINode(n,s,e),l=a.update(r);try{n.put(a.ino,i,!0),l&&n.put(s,a.data,!0)}catch(u){throw n.abort(),u}n.commit()}linkSync(e,i,r){let n=this.store.beginTransaction(),s=x(e);if(!this.findINode(n,s).toStats().hasAccess(4,r))throw c.With("EACCES",s,"linkSync");let l=x(i),u=this.findINode(n,l),f=this.getDirListing(n,u,l);if(!u.toStats().hasAccess(2,r))throw c.With("EACCES",l,"linkSync");let d=this._findINode(n,s,I(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw c.With("EACCES",i,"linkSync");h.nlink++,f[I(i)]=d;try{n.put(d,h.data,!0),n.put(u.ino,oe(f),!0)}catch(m){throw n.abort(),m}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(fe))return;let i=new ue;i.mode=511|D.DIRECTORY,e.put(i.ino,Ae("{}"),!1),e.put(fe,i.data,!1),e.commit()}_findINode(e,i,r,n=new Set){let s=ce(i,r);if(n.has(s))throw new c(5,"Infinite loop detected while finding inode",s);if(n.add(s),i!="/"){let a=this._findINode(e,x(i),I(i),n),l=this.getDirListing(e,this.getINode(e,a,i+vs+r),i);if(!(r in l))throw c.With("ENOENT",Ne(i,r),"_findINode");return l[r]}if(r!=""){let a=this.getDirListing(e,this.getINode(e,fe,i),i);if(!(r in a))throw c.With("ENOENT",Ne(i,r),"_findINode");return a[r]}return fe}findINode(e,i){let r=this._findINode(e,x(i),I(i));return this.getINode(e,r,i)}getINode(e,i,r){let n=e.get(i);if(!n)throw c.With("ENOENT",r,"getINode");return new ue(n.buffer)}getDirListing(e,i,r){if(!i.toStats().isDirectory())throw c.With("ENOTDIR",r,"getDirListing");let n=e.get(i.ino);if(!n)throw c.With("ENOENT",r,"getDirListing");return bi(n)}addNewNode(e,i,r=5){for(let n=0;n<r;n++){let s=Mt();if(e.put(s,i,!1))return s}throw new c(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,r,n,s=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),u=I(e),f=this.findINode(a,l),d=this.getDirListing(a,f,l);if(!f.toStats().hasAccess(2,n))throw c.With("EACCES",e,"commitNewFile");if(e==="/")throw c.With("EEXIST",e,"commitNewFile");if(d[u])throw c.With("EEXIST",e,"commitNewFile");let h=new ue;try{h.ino=this.addNewNode(a,s),h.size=s.length,h.mode=r|i,h.uid=n.uid,h.gid=n.gid,d[u]=this.addNewNode(a,h.data),a.put(f.ino,oe(d),!0)}catch(m){throw a.abort(),m}return a.commit(),h}removeEntry(e,i,r){let n=this.store.beginTransaction(),s=x(e),a=this.findINode(n,s),l=this.getDirListing(n,a,s),u=I(e),f=l[u];if(!f)throw c.With("ENOENT",e,"removeEntry");let d=this.getINode(n,f,e);if(!d.toStats().hasAccess(2,r))throw c.With("EACCES",e,"removeEntry");if(delete l[u],!i&&d.toStats().isDirectory())throw c.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw c.With("ENOTDIR",e,"removeEntry");try{n.put(a.ino,oe(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(f))}catch(h){throw n.abort(),h}n.commit()}};o(qt,"SyncStoreFS");var Ai=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new Wt(this)}get(e){return this.store.get(e)}put(e,i,r){return!r&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};o(Ai,"InMemoryStore");var Sn={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",required:!1,description:"The name of the store"}},create({name:t}){return new qt({store:new Ai(t)})}};var jt=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};o(jt,"Mutex");var $t=class{constructor(e){this.fs=e}_mu=new jt;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,r){await this._mu.lock(e),await this.fs.rename(e,i,r),this._mu.unlock(e)}renameSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,r)}async stat(e,i){await this._mu.lock(e);let r=await this.fs.stat(e,i);return this._mu.unlock(e),r}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,r){await this._mu.lock(e);let n=await this.fs.openFile(e,i,r);return this._mu.unlock(e),n}openFileSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,r)}async createFile(e,i,r,n){await this._mu.lock(e);let s=await this.fs.createFile(e,i,r,n);return this._mu.unlock(e),s}createFileSync(e,i,r,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,r,n)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,r){await this._mu.lock(e),await this.fs.mkdir(e,i,r),this._mu.unlock(e)}mkdirSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,r)}async readdir(e,i){await this._mu.lock(e);let r=await this.fs.readdir(e,i);return this._mu.unlock(e),r}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let r=await this.fs.exists(e,i);return this._mu.unlock(e),r}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,r){await this._mu.lock(e),await this.fs.link(e,i,r),this._mu.unlock(e)}linkSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,r)}async sync(e,i,r){await this._mu.lock(e),await this.fs.sync(e,i,r),this._mu.unlock(e)}syncSync(e,i,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,r)}};o($t,"LockedFS");var _n="/.deleted",Vt=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this.buffer,this.stats),this.resetDirty())}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this.buffer,this.stats),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};o(Vt,"OverlayFile");var Fi=class extends Y{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata().readonly)throw new c(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:zt.name,synchronous:this._readable.metadata().synchronous&&this._writable.metadata().synchronous,supportsProperties:this._readable.metadata().supportsProperties&&this._writable.metadata().supportsProperties}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,r){let n=r.cred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,i,r)}syncSync(e,i,r){let n=r.cred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,i,r)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(_n,P("r"),we),{size:i}=await e.stat(),{buffer:r}=await e.read(new Uint8Array(i));this._deleteLog=er(r)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,r)}catch{if(this._deletedFiles.has(e))throw c.With("ENOENT",e,"rename")}}renameSync(e,i,r){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,r)}catch{if(this._deletedFiles.has(e))throw c.With("ENOENT",e,"renameSync")}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw c.With("ENOENT",e,"stat");let n=new B(await this._readable.stat(e,i));return n.mode|=146,n}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw c.With("ENOENT",e,"statSync");let n=new B(this._readable.statSync(e,i));return n.mode|=146,n}}async openFile(e,i,r){if(await this._writable.exists(e,r))return this._writable.openFile(e,i,r);let n=await this._readable.openFile(e,P("r"),r),s=new B(await n.stat()),{buffer:a}=await n.read(new Uint8Array(s.size));return new Vt(this,e,i,s,a)}openFileSync(e,i,r){if(this._writable.existsSync(e,r))return this._writable.openFileSync(e,i,r);let n=this._readable.openFileSync(e,P("r"),r),s=B.clone(n.statSync()),a=new Uint8Array(s.size);return n.readSync(a),new Vt(this,e,i,s,a)}async createFile(e,i,r,n){return this.checkInitialized(),await this._writable.createFile(e,i,r,n),this.openFile(e,i,n)}createFileSync(e,i,r,n){return this.checkInitialized(),this._writable.createFileSync(e,i,r,n),this.openFileSync(e,i,n)}async link(e,i,r){this.checkInitialized(),await this._writable.link(e,i,r)}linkSync(e,i,r){this.checkInitialized(),this._writable.linkSync(e,i,r)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw c.With("ENOENT",e,"unlink");await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw c.With("ENOENT",e,"unlinkSync");this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw c.With("ENOENT",e,"rmdir");if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw c.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw c.With("ENOENT",e,"rmdirSync");if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw c.With("ENOTEMPTY",e,"rmdirSync");this.deletePath(e,i)}}async mkdir(e,i,r){if(this.checkInitialized(),await this.exists(e,r))throw c.With("EEXIST",e,"mkdir");await this.createParentDirectories(e,r),await this._writable.mkdir(e,i,r)}mkdirSync(e,i,r){if(this.checkInitialized(),this.existsSync(e,r))throw c.With("EEXIST",e,"mkdirSync");this.createParentDirectoriesSync(e,r),this._writable.mkdirSync(e,i,r)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw c.With("ENOTDIR",e,"readdir");let n=[];try{n.push(...await this._writable.readdir(e,i))}catch{}try{n.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let s={};return n.filter(a=>{let l=!s[a];return s[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw c.With("ENOTDIR",e,"readdirSync");let n=[];try{n=n.concat(this._writable.readdirSync(e,i))}catch{}try{n=n.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let s={};return n.filter(a=>{let l=!s[a];return s[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
3
+ `,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let r=await this._writable.openFile(_n,P("w"),i);try{await r.write(Ae(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}catch(n){this._deleteLogError=n}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let e of this._deleteLog.split(`
4
+ `))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new c(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==_n)throw c.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e,i){let r=x(e),n=[];for(;!this._writable.existsSync(r,i);)n.push(r),r=x(r);n=n.reverse();for(let s of n)this._writable.mkdirSync(s,this.statSync(s,i).mode,i)}async createParentDirectories(e,i){let r=x(e),n=[];for(;!await this._writable.exists(r,i);)n.push(r),r=x(r);n=n.reverse();for(let s of n){let a=await this.stat(s,i);await this._writable.mkdir(s,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw c.With("ENOENT",e,"operateOnWriteable");this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw c.With("ENOENT",e,"operateOnWritableAsync");if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let r=this.statSync(e,i);if(r.isDirectory()){this._writable.mkdirSync(e,r.mode,i);return}let n=new Uint8Array(r.size),s=this._readable.openFileSync(e,P("r"),i);s.readSync(n),s.closeSync();let a=this._writable.openFileSync(e,P("w"),i);a.writeSync(n),a.closeSync()}async copyToWritable(e,i){let r=await this.stat(e,i);if(r.isDirectory()){await this._writable.mkdir(e,r.mode,i);return}let n=new Uint8Array(r.size),s=await this._readable.openFile(e,P("r"),i);await s.read(n),await s.close();let a=await this._writable.openFile(e,P("w"),i);await a.write(n),await a.close()}};o(Fi,"UnlockedOverlayFS");var zt=class extends $t{async ready(){return await super.ready(),this}constructor(e){super(new Fi(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};o(zt,"OverlayFS");var of={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new zt(t)}};var Xi={};Qi(Xi,{BigIntStats:()=>K,Dir:()=>br,Dirent:()=>at,ReadStream:()=>sn,Stats:()=>B,StatsFs:()=>Dt,WriteStream:()=>an,_toUnixTimestamp:()=>Zs,access:()=>Jd,accessSync:()=>ad,appendFile:()=>Ad,appendFileSync:()=>Vf,chmod:()=>Hd,chmodSync:()=>rd,chown:()=>Vd,chownSync:()=>td,close:()=>Td,closeSync:()=>st,constants:()=>Si,copyFile:()=>oh,copyFileSync:()=>ud,cp:()=>ch,cpSync:()=>pd,createReadStream:()=>th,createWriteStream:()=>ih,exists:()=>wd,existsSync:()=>Ln,fchmod:()=>Bd,fchmodSync:()=>Mn,fchown:()=>Rd,fchownSync:()=>Dn,fdatasync:()=>Cd,fdatasyncSync:()=>Kf,fstat:()=>Fd,fstatSync:()=>zf,fsync:()=>Pd,fsyncSync:()=>Hf,ftruncate:()=>Id,ftruncateSync:()=>ra,futimes:()=>Dd,futimesSync:()=>Un,initialize:()=>yr,lchmod:()=>Kd,lchmodSync:()=>nd,lchown:()=>zd,lchownSync:()=>id,link:()=>qd,linkSync:()=>Qf,lopenSync:()=>mr,lstat:()=>_d,lstatSync:()=>Wf,lutimes:()=>Yd,lutimesSync:()=>sd,mkdir:()=>Ud,mkdirSync:()=>Jf,mkdtemp:()=>nh,mkdtempSync:()=>cd,mount:()=>pr,mounts:()=>Se,open:()=>vd,openAsBlob:()=>fh,openSync:()=>Ii,opendir:()=>lh,opendirSync:()=>hd,promises:()=>_r,read:()=>Od,readFile:()=>kd,readFileSync:()=>ia,readSync:()=>Yf,readdir:()=>Wd,readdirSync:()=>Wn,readlink:()=>$d,readlinkSync:()=>ed,readv:()=>sh,readvSync:()=>fd,realpath:()=>Xd,realpathSync:()=>qn,rename:()=>gd,renameSync:()=>Uf,rm:()=>rh,rmSync:()=>ld,rmdir:()=>Md,rmdirSync:()=>Xf,stat:()=>Sd,statSync:()=>On,statfs:()=>uh,statfsSync:()=>yd,symlink:()=>jd,symlinkSync:()=>Zf,truncate:()=>Ed,truncateSync:()=>qf,umount:()=>Cn,unlink:()=>xd,unlinkSync:()=>ta,unwatchFile:()=>Zd,utimes:()=>Gd,utimesSync:()=>od,watch:()=>eh,watchFile:()=>Qd,write:()=>Ld,writeFile:()=>Nd,writeFileSync:()=>Bn,writeSync:()=>Gf,writev:()=>ah,writevSync:()=>dd});var _r={};Qi(_r,{FileHandle:()=>Z,access:()=>no,appendFile:()=>Hn,chmod:()=>eo,chown:()=>Qn,constants:()=>Si,copyFile:()=>ao,cp:()=>co,exists:()=>Ci,lchmod:()=>to,lchown:()=>Zn,link:()=>Yn,lopen:()=>wr,lstat:()=>$n,lutimes:()=>ro,mkdir:()=>Gn,mkdtemp:()=>so,open:()=>lt,opendir:()=>lo,readFile:()=>Sr,readdir:()=>Pi,readlink:()=>Jn,realpath:()=>Bi,rename:()=>jn,rm:()=>oo,rmdir:()=>Kn,stat:()=>Li,statfs:()=>uo,symlink:()=>Xn,truncate:()=>Vn,unlink:()=>gr,utimes:()=>io,watch:()=>bd,writeFile:()=>Ri});var He=xs(Oe(),1);function Zs(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}o(Zs,"_toUnixTimestamp");function _e(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new c(22,"Invalid mode: "+t?.toString())}o(_e,"normalizeMode");function Xt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new c(22,"Invalid time.")}o(Xt,"normalizeTime");function M(t){if(t.includes("\0"))throw new c(22,"Path must be a string without null bytes.");if(t.length==0)throw new c(22,"Path must not be empty.");return Ne(t.replaceAll(/[/\\]+/g,"/"))}o(M,"normalizePath");function Ee(t,e="utf8",i,r=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e,flag:i,mode:r}:{encoding:typeof t?.encoding=="string"?t.encoding:e,flag:typeof t?.flag=="string"?t.flag:i,mode:_e("mode"in t?t?.mode:null,r)}}o(Ee,"normalizeOptions");function _(){}o(_,"nop");var v=we;function ea(t){v=t}o(ea,"setCred");var gt=new Map,Mf=100;function Jt(t){let e=Mf++;return gt.set(e,t),e}o(Jt,"getFdForFile");function j(t){if(!gt.has(t))throw new c(9);return gt.get(t)}o(j,"fd2file");var Se=new Map;pr("/",Sn.create({name:"root"}));function pr(t,e){if(t[0]!=="/"&&(t="/"+t),t=Ne(t),Se.has(t))throw new c(22,"Mount point "+t+" is already in use.");Se.set(t,e)}o(pr,"mount");function Cn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Ne(t),!Se.has(t))throw new c(22,"Mount point "+t+" is already unmounted.");Se.delete(t)}o(Cn,"umount");function pe(t){t=M(t);let e=[...Se].sort((i,r)=>i[0].length>r[0].length?-1:1);for(let[i,r]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:r,path:t,mountPoint:i};throw new c(5,"ZenFS not initialized with a file system")}o(pe,"resolveFS");function Qs(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}o(Qs,"fixPaths");function ot(t,e){return typeof t.stack=="string"&&(t.stack=Qs(t.stack,e)),t.message=Qs(t.message,e),t}o(ot,"fixError");function yr(t){"/"in t&&Cn("/");for(let[e,i]of Object.entries(t))pr(e,i)}o(yr,"initialize");function ae(...[t,e,i,...r]){i=M(i);let{fs:n,path:s}=pe(e&&Ln(i)?qn(i):i);try{return n[t](s,...r)}catch(a){throw ot(a,{[s]:i})}}o(ae,"doOp");function Uf(t,e){t=M(t),e=M(e);let i=pe(t),r=pe(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,v);Bn(e,ia(t)),ta(t)}catch(s){throw ot(s,n)}}o(Uf,"renameSync");function Ln(t){t=M(t);try{let{fs:e,path:i}=pe(t);return e.existsSync(i,v)}catch(e){if(e.errno==2)return!1;throw e}}o(Ln,"existsSync");function On(t,e){let i=ae("statSync",!0,t,v);return e?.bigint?new K(i):i}o(On,"statSync");function Wf(t,e){let i=ae("statSync",!1,t,v);return e?.bigint?new K(i):i}o(Wf,"lstatSync");function qf(t,e=0){let i=Ii(t,"r+");try{ra(i,e)}finally{st(i)}}o(qf,"truncateSync");function ta(t){return ae("unlinkSync",!1,t,v)}o(ta,"unlinkSync");function Qt(t,e,i,r){let n=M(t),s=_e(i,420),a=P(e),l;try{l=ae("statSync",r,n,v)}catch{switch(vi(a)){case 3:if(!ae("statSync",r,x(n),v).isDirectory())throw c.With("ENOTDIR",x(n),"_openSync");return ae("createFileSync",r,n,a,s,v);case 1:throw c.With("ENOENT",n,"_openSync");default:throw new c(22,"Invalid FileFlag object.")}}if(!l.hasAccess(s,v))throw c.With("EACCES",n,"_openSync");switch(xi(a)){case 1:throw c.With("EEXIST",n,"_openSync");case 2:return ae("unlinkSync",r,n,v),ae("createFileSync",r,n,a,l.mode,v);case 0:return ae("openFileSync",r,n,a,v);default:throw new c(22,"Invalid FileFlag object.")}}o(Qt,"_openSync");function Ii(t,e,i){return Jt(Qt(t,e,i,!0))}o(Ii,"openSync");function mr(t,e,i){return Jt(Qt(t,e,i,!1))}o(mr,"lopenSync");function Rn(t,e,i){let r=Qt(t,e,420,i);try{let n=r.statSync(),s=new Uint8Array(n.size);return r.readSync(s,0,n.size,0),r.closeSync(),s}finally{r.closeSync()}}o(Rn,"_readFileSync");function ia(t,e={}){let i=Ee(e,null,"r",420),r=P(i.flag);if(!Ve(r))throw new c(22,"Flag passed to readFile must allow for reading.");let n=Buffer.from(Rn(t,i.flag,!0));return i.encoding?n.toString(i.encoding):n}o(ia,"readFileSync");function jf(t,e,i,r,n){let s=Qt(t,i,r,n);try{s.writeSync(e,0,e.length,0)}finally{s.closeSync()}}o(jf,"_writeFileSync");function Bn(t,e,i){let r=Ee(i,"utf8","w",420),n=P(r.flag);if(!de(n))throw new c(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let s=typeof e=="string"?Buffer.from(e,r.encoding):e;if(s===void 0)throw new c(22,"Data not specified");jf(t,s,r.flag,r.mode,!0)}o(Bn,"writeFileSync");function $f(t,e,i,r,n){let s=Qt(t,i,r,n);try{s.writeSync(e,0,e.length,null)}finally{s.closeSync()}}o($f,"_appendFileSync");function Vf(t,e,i){let r=Ee(i,"utf8","a",420),n=P(r.flag);if(!rt(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let s=typeof e=="string"?Buffer.from(e,r.encoding):e;$f(t,s,r.flag,r.mode,!0)}o(Vf,"appendFileSync");function zf(t,e){let i=j(t).statSync();return e?.bigint?new K(i):i}o(zf,"fstatSync");function st(t){j(t).closeSync(),gt.delete(t)}o(st,"closeSync");function ra(t,e=0){if(e<0)throw new c(22);j(t).truncateSync(e)}o(ra,"ftruncateSync");function Hf(t){j(t).syncSync()}o(Hf,"fsyncSync");function Kf(t){j(t).datasyncSync()}o(Kf,"fdatasyncSync");function Gf(t,e,i,r,n){let s,a=0,l,u;if(typeof e=="string"){u=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,s=Buffer.from(e,d),l=s.length}else s=e,a=i,l=r,u=typeof n=="number"?n:null;let f=j(t);return u==null&&(u=f.position),f.writeSync(s,a,l,u)}o(Gf,"writeSync");function Yf(t,e,i,r,n){let s=j(t),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(r=i.length,n=i.position),n=Number(n),isNaN(n)&&(n=s.position),s.readSync(e,a,r,n)}o(Yf,"readSync");function Dn(t,e,i){j(t).chownSync(e,i)}o(Dn,"fchownSync");function Mn(t,e){let i=_e(e,-1);if(i<0)throw new c(22,"Invalid mode.");j(t).chmodSync(i)}o(Mn,"fchmodSync");function Un(t,e,i){j(t).utimesSync(Xt(e),Xt(i))}o(Un,"futimesSync");function Xf(t){return ae("rmdirSync",!0,t,v)}o(Xf,"rmdirSync");function Jf(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,r=typeof e=="object"&&e?.recursive;ae("mkdirSync",!0,t,_e(i,511),v)}o(Jf,"mkdirSync");function Wn(t,e){t=M(t);let i=ae("readdirSync",!0,t,v);for(let r of Se.keys()){if(!r.startsWith(t))continue;let n=r.slice(t.length);n.includes("/")||n.length==0||i.push(n)}return i.map(r=>typeof e=="object"&&e?.withFileTypes?new at(r,On(ce(t,r))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?Buffer.from(r):r)}o(Wn,"readdirSync");function Qf(t,e){return e=M(e),ae("linkSync",!1,t,e,v)}o(Qf,"linkSync");function Zf(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new c(22,"Invalid type: "+i);if(Ln(e))throw c.With("EEXIST",e,"symlinkSync");Bn(e,t),Qt(e,"r+",420,!1)._setTypeSync(D.SYMLINK)}o(Zf,"symlinkSync");function ed(t,e){let i=Buffer.from(Rn(t,"r",!1)),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:i.toString(r)}o(ed,"readlinkSync");function td(t,e,i){let r=Ii(t,"r+");Dn(r,e,i),st(r)}o(td,"chownSync");function id(t,e,i){let r=mr(t,"r+");Dn(r,e,i),st(r)}o(id,"lchownSync");function rd(t,e){let i=Ii(t,"r+");Mn(i,e),st(i)}o(rd,"chmodSync");function nd(t,e){let i=mr(t,"r+");Mn(i,e),st(i)}o(nd,"lchmodSync");function od(t,e,i){let r=Ii(t,"r+");Un(r,e,i),st(r)}o(od,"utimesSync");function sd(t,e,i){let r=mr(t,"r+");Un(r,e,i),st(r)}o(sd,"lutimesSync");function qn(t,e){t=M(t);let{fs:i,path:r,mountPoint:n}=pe(t);try{if(!i.statSync(r,v).isSymbolicLink())return t;let a=M(n+Buffer.from(Rn(r,"r+",!1)).toString());return qn(a)}catch(s){throw ot(s,{[r]:t})}}o(qn,"realpathSync");function ad(t,e=384){if(!On(t).hasAccess(e,v))throw new c(13)}o(ad,"accessSync");function ld(t){throw c.With("ENOTSUP",t,"rmSync")}o(ld,"rmSync");function cd(t,e){throw c.With("ENOTSUP",t,"mkdtempSync")}o(cd,"mkdtempSync");function ud(t,e,i){throw c.With("ENOTSUP",t,"copyFileSync")}o(ud,"copyFileSync");function fd(t,e,i){throw c.With("ENOTSUP",j(t).path,"readvSync")}o(fd,"readvSync");function dd(t,e,i){throw c.With("ENOTSUP",j(t).path,"writevSync")}o(dd,"writevSync");function hd(t,e){throw c.With("ENOTSUP",t,"opendirSync")}o(hd,"opendirSync");function pd(t,e,i){throw c.With("ENOTSUP",t,"cpSync")}o(pd,"cpSync");function yd(t,e){throw c.With("ENOTSUP",t,"statfsSync")}o(yd,"statfsSync");var at=class{constructor(e,i){this.path=e;this.stats=i}get name(){return I(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()}};o(at,"Dirent");var br=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new c(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Pi(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=Wn(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};o(br,"Dir");var Z=class{constructor(e){this.fd=e}get file(){return j(this.fd)}get path(){return this.file.path}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=_e(e,-1);if(i<0)throw new c(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e<0)throw new c(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Xt(e),Xt(i))}async appendFile(e,i){let r=Ee(i,"utf8","a",420),n=P(r.flag);if(!rt(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let s=typeof e=="string"?He.Buffer.from(e,r.encoding):e;await this.file.write(s,0,s.length,null)}read(e,i,r,n){return isNaN(+n)&&(n=this.file.position),this.file.read(e,i,r,n)}async readFile(e){let i=Ee(e,null,"r",292),r=P(i.flag);if(!Ve(r))throw new c(22,"Flag passed must allow for reading.");let{size:n}=await this.stat(),s=new Uint8Array(n);await this.file.read(s,0,n,0);let a=He.Buffer.from(s);return i.encoding?a.toString(i.encoding):a}readableWebStream(e){throw c.With("ENOTSUP",this.path,"FileHandle.readableWebStream")}readLines(e){throw c.With("ENOTSUP",this.path,"FileHandle.readLines")}[Symbol.asyncDispose](){throw c.With("ENOTSUP",this.path,"FileHandle.@@asyncDispose")}async stat(e){let i=await this.file.stat();return e?.bigint?new K(i):i}async write(e,i,r,n){let s,a=0,l;if(typeof e=="string"){n=typeof i=="number"?i:null;let f=typeof r=="string"?r:"utf8";a=0,s=He.Buffer.from(e,f),l=s.length}else s=e,a=i,l=r,n=typeof n=="number"?n:null;n??=this.file.position;let u=await this.file.write(s,a,l,n);return{buffer:s,bytesWritten:u}}async writeFile(e,i){let r=Ee(i,"utf8","w",420),n=P(r.flag);if(!de(n))throw new c(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let s=typeof e=="string"?He.Buffer.from(e,r.encoding):e;await this.file.write(s,0,s.length,0)}async close(){await this.file.close(),gt.delete(this.fd)}writev(e,i){throw c.With("ENOTSUP",this.path,"FileHandle.writev")}readv(e,i){throw c.With("ENOTSUP",this.path,"FileHandle.readv")}createReadStream(e){throw c.With("ENOTSUP",this.path,"createReadStream")}createWriteStream(e){throw c.With("ENOTSUP",this.path,"createWriteStream")}};o(Z,"FileHandle");async function xe(...[t,e,i,...r]){i=M(i);let{fs:n,path:s}=pe(e&&await Ci(i)?await Bi(i):i);try{return n[t](s,...r)}catch(a){throw ot(a,{[s]:i})}}o(xe,"doOp");async function jn(t,e){t=M(t),e=M(e);let i=pe(t),r=pe(e);try{if(i.mountPoint==r.mountPoint){await i.fs.rename(i.path,r.path,v);return}await Ri(e,await Sr(t)),await gr(t)}catch(n){throw ot(n,{[i.path]:t,[r.path]:e})}}o(jn,"rename");async function Ci(t){try{let{fs:e,path:i}=pe(t);return e.exists(i,v)}catch(e){if(e.errno==2)return!1;throw e}}o(Ci,"exists");async function Li(t,e){let i=await xe("stat",!0,t,v);return e?.bigint?new K(i):i}o(Li,"stat");async function $n(t,e){let i=await xe("stat",!1,t,v);return e?.bigint?new K(i):i}o($n,"lstat");async function Vn(t,e=0){let i=await lt(t,"r+");try{await i.truncate(e)}finally{await i.close()}}o(Vn,"truncate");async function gr(t){return xe("unlink",!1,t,v)}o(gr,"unlink");async function Oi(t,e,i=420,r){let n=M(t),s=_e(i,420),a=P(e);try{switch(xi(a)){case 1:throw c.With("EEXIST",n,"_open");case 2:let l=await xe("openFile",r,n,a,v);if(!l)throw new c(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await xe("openFile",r,n,a,v);default:throw new c(22,"Invalid file flag")}}catch{switch(vi(a)){case 3:let u=await xe("stat",r,x(n),v);if(u&&!u.isDirectory())throw c.With("ENOTDIR",x(n),"_open");return await xe("createFile",r,n,a,s,v);case 1:throw c.With("ENOENT",n,"_open");default:throw new c(22,"Invalid file flag")}}}o(Oi,"_open");async function lt(t,e,i=420){let r=await Oi(t,e,i,!0);return new Z(Jt(r))}o(lt,"open");async function wr(t,e,i=420){let r=await Oi(t,e,i,!1);return new Z(Jt(r))}o(wr,"lopen");async function zn(t,e,i){let r=await Oi(M(t),e,420,i);try{let n=await r.stat(),s=new Uint8Array(n.size);return await r.read(s,0,n.size,0),await r.close(),s}catch(n){throw await r.close(),n}}o(zn,"_readFile");async function Sr(t,e){let i=Ee(e,null,"r",null),r=P(i.flag);if(!Ve(r))throw new c(22,"Flag passed must allow for reading.");let n=He.Buffer.from(await zn(t,i.flag,!0));return i.encoding?n.toString(i.encoding):n}o(Sr,"readFile");async function Ri(t,e,i){let r=Ee(i,"utf8","w",420),n=await lt(t,r.flag,r.mode);try{await n.writeFile(e,r)}finally{await n.close()}}o(Ri,"writeFile");async function md(t,e,i,r,n){let s=await Oi(t,i,r,n);try{await s.write(e,0,e.length,null)}finally{await s.close()}}o(md,"_appendFile");async function Hn(t,e,i){let r=Ee(i,"utf8","a",420),n=P(r.flag);if(!rt(n))throw new c(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new c(22,"Encoding not specified");let s=typeof e=="string"?He.Buffer.from(e,r.encoding):e;await md(t,s,r.flag,r.mode,!0)}o(Hn,"appendFile");async function Kn(t){return xe("rmdir",!0,t,v)}o(Kn,"rmdir");async function Gn(t,e){await xe("mkdir",!0,t,_e(typeof e=="object"?e?.mode:e,511),v)}o(Gn,"mkdir");async function Pi(t,e){t=M(t);let i=await xe("readdir",!0,t,v),r=[...Se.keys()];for(let s of r)if(s.startsWith(t)){let a=s.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let n=[];for(let s of i)n.push(typeof e=="object"&&e?.withFileTypes?new at(s,await Li(ce(t,s))):s);return n}o(Pi,"readdir");async function Yn(t,e){return e=M(e),xe("link",!1,t,e,v)}o(Yn,"link");async function Xn(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new c(22,"Invalid symlink type: "+i);if(await Ci(e))throw c.With("EEXIST",e,"symlink");await Ri(e,t),await(await Oi(e,"r+",420,!1))._setType(D.SYMLINK)}o(Xn,"symlink");async function Jn(t,e){let i=He.Buffer.from(await zn(t,"r",!1)),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:i.toString(r)}o(Jn,"readlink");async function Qn(t,e,i){let r=await lt(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}o(Qn,"chown");async function Zn(t,e,i){let r=await wr(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}o(Zn,"lchown");async function eo(t,e){let i=await lt(t,"r+");try{await i.chmod(e)}finally{await i.close()}}o(eo,"chmod");async function to(t,e){let i=await wr(t,"r+");try{await i.chmod(e)}finally{await i.close()}}o(to,"lchmod");async function io(t,e,i){let r=await lt(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}o(io,"utimes");async function ro(t,e,i){let r=await wr(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}o(ro,"lutimes");async function Bi(t,e){t=M(t);let{fs:i,path:r,mountPoint:n}=pe(t);try{if(!(await i.stat(r,v)).isSymbolicLink())return t;let a=n+M(He.Buffer.from(await zn(r,"r+",!1)).toString());return Bi(a)}catch(s){throw ot(s,{[r]:t})}}o(Bi,"realpath");function bd(t,e){throw c.With("ENOTSUP",t,"watch")}o(bd,"watch");async function no(t,e=0){if(!(await Li(t)).hasAccess(e,v))throw new c(13)}o(no,"access");async function oo(t,e){throw c.With("ENOTSUP",t,"rm")}o(oo,"rm");async function so(t,e){throw c.With("ENOTSUP",t,"mkdtemp")}o(so,"mkdtemp");async function ao(t,e,i){throw c.With("ENOTSUP",t,"copyFile")}o(ao,"copyFile");async function lo(t,e){throw c.With("ENOTSUP",t,"opendir")}o(lo,"opendir");async function co(t,e,i){throw c.With("ENOTSUP",t,"cp")}o(co,"cp");async function uo(t,e){throw c.With("ENOTSUP",t,"statfs")}o(uo,"statfs");function gd(t,e,i=_){jn(t,e).then(()=>i()).catch(i)}o(gd,"rename");function wd(t,e=_){Ci(t).then(e).catch(()=>e(!1))}o(wd,"exists");function Sd(t,e,i=_){i=typeof e=="function"?e:i,Li(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}o(Sd,"stat");function _d(t,e,i=_){i=typeof e=="function"?e:i,$n(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}o(_d,"lstat");function Ed(t,e=0,i=_){i=typeof e=="function"?e:i,Vn(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}o(Ed,"truncate");function xd(t,e=_){gr(t).then(()=>e()).catch(e)}o(xd,"unlink");function vd(t,e,i,r=_){let n=_e(i,420);r=typeof i=="function"?i:r,lt(t,e,n).then(s=>r(null,s.fd)).catch(r)}o(vd,"open");function kd(t,e,i=_){i=typeof e=="function"?e:i,Sr(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(kd,"readFile");function Nd(t,e,i,r=_){r=typeof i=="function"?i:r,Ri(t,e,typeof i!="function"?i:null).then(()=>r(null)).catch(r)}o(Nd,"writeFile");function Ad(t,e,i,r=_){r=typeof i=="function"?i:r,Hn(t,e,typeof i=="function"?null:i).then(()=>r()).catch(r)}o(Ad,"appendFile");function Fd(t,e,i=_){i=typeof e=="function"?e:i,j(t).stat().then(r=>i(null,typeof e=="object"&&e?.bigint?new K(r):r)).catch(i)}o(Fd,"fstat");function Td(t,e=_){new Z(t).close().then(()=>e()).catch(e)}o(Td,"close");function Id(t,e,i=_){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=j(t);if(r<0)throw new c(22);n.truncate(r).then(()=>i()).catch(i)}o(Id,"ftruncate");function Pd(t,e=_){j(t).sync().then(()=>e()).catch(e)}o(Pd,"fsync");function Cd(t,e=_){j(t).datasync().then(()=>e()).catch(e)}o(Cd,"fdatasync");function Ld(t,e,i,r,n,s=_){let a,l,u,f=null,d,h=new Z(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":s=i;break;case"number":f=i,d=typeof r=="string"?r:"utf8",s=typeof n=="function"?n:s;break;default:s=typeof r=="function"?r:typeof n=="function"?n:s,s(new c(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,u=a.length;let m=s;h.write(a,l,u,f).then(({bytesWritten:y})=>m(null,y,a.toString(d))).catch(m)}else{a=Buffer.from(e),l=i,u=r,f=typeof n=="number"?n:null;let m=typeof n=="function"?n:s;h.write(a,l,u,f).then(({bytesWritten:y})=>m(null,y,a)).catch(m)}}o(Ld,"write");function Od(t,e,i,r,n,s=_){new Z(t).read(e,i,r,n).then(({bytesRead:a,buffer:l})=>s(null,a,l)).catch(s)}o(Od,"read");function Rd(t,e,i,r=_){new Z(t).chown(e,i).then(()=>r()).catch(r)}o(Rd,"fchown");function Bd(t,e,i){new Z(t).chmod(e).then(()=>i()).catch(i)}o(Bd,"fchmod");function Dd(t,e,i,r=_){new Z(t).utimes(e,i).then(()=>r()).catch(r)}o(Dd,"futimes");function Md(t,e=_){Kn(t).then(()=>e()).catch(e)}o(Md,"rmdir");function Ud(t,e,i=_){Gn(t,e).then(()=>i()).catch(i)}o(Ud,"mkdir");function Wd(t,e,i=_){i=typeof e=="function"?e:i,Pi(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}o(Wd,"readdir");function qd(t,e,i=_){Yn(t,e).then(()=>i()).catch(i)}o(qd,"link");function jd(t,e,i,r=_){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,Xn(t,e,n).then(()=>r()).catch(r)}o(jd,"symlink");function $d(t,e,i=_){i=typeof e=="function"?e:i,Jn(t).then(r=>i(null,r)).catch(i)}o($d,"readlink");function Vd(t,e,i,r=_){Qn(t,e,i).then(()=>r()).catch(r)}o(Vd,"chown");function zd(t,e,i,r=_){Zn(t,e,i).then(()=>r()).catch(r)}o(zd,"lchown");function Hd(t,e,i=_){eo(t,e).then(()=>i()).catch(i)}o(Hd,"chmod");function Kd(t,e,i=_){to(t,e).then(()=>i()).catch(i)}o(Kd,"lchmod");function Gd(t,e,i,r=_){io(t,e,i).then(()=>r()).catch(r)}o(Gd,"utimes");function Yd(t,e,i,r=_){ro(t,e,i).then(()=>r()).catch(r)}o(Yd,"lutimes");function Xd(t,e,i=_){i=typeof e=="function"?e:i,Bi(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(Xd,"realpath");function Jd(t,e,i=_){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,no(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}o(Jd,"access");function Qd(t,e,i=_){throw c.With("ENOTSUP",t,"watchFile")}o(Qd,"watchFile");function Zd(t,e=_){throw c.With("ENOTSUP",t,"unwatchFile")}o(Zd,"unwatchFile");function eh(t,e,i=_){throw c.With("ENOTSUP",t,"watch")}o(eh,"watch");function th(t,e){throw c.With("ENOTSUP",t,"createReadStream")}o(th,"createReadStream");function ih(t,e){throw c.With("ENOTSUP",t,"createWriteStream")}o(ih,"createWriteStream");function rh(t,e,i=_){i=typeof e=="function"?e:i,oo(t,typeof e=="function"?null:e).then(()=>i(null)).catch(i)}o(rh,"rm");function nh(t,e,i=_){i=typeof e=="function"?e:i,so(t,typeof e!="function"?e:null).then(r=>i(null,r)).catch(i)}o(nh,"mkdtemp");function oh(t,e,i,r){r=typeof i=="function"?i:r,ao(t,e,typeof i=="function"?null:i).then(()=>r(null)).catch(r)}o(oh,"copyFile");function sh(t,e,i,r=_){r=typeof i=="function"?i:r,new Z(t).readv(e,typeof i=="function"?null:i).then(({buffers:n,bytesRead:s})=>r(null,s,n)).catch(r)}o(sh,"readv");function ah(t,e,i,r=_){r=typeof i=="function"?i:r,new Z(t).writev(e,typeof i=="function"?null:i).then(({buffers:n,bytesWritten:s})=>r(null,s,n)).catch(r)}o(ah,"writev");function lh(t,e,i=_){i=typeof e=="function"?e:i,lo(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(lh,"opendir");function ch(t,e,i,r){r=typeof i=="function"?i:r,co(t,e,typeof i=="function"?null:i).then(()=>r(null)).catch(r)}o(ch,"cp");function uh(t,e,i=_){i=typeof e=="function"?e:i,uo(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(uh,"statfs");function fh(t,e){throw c.With("ENOTSUP",t,"openAsBlob")}o(fh,"openAsBlob");var ln=xs(du(),1);var sn=class extends ln.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};o(sn,"ReadStream");var an=class extends ln.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};o(an,"WriteStream");function hu(t,e=0,i=0){ea({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i}),yr(t)}o(hu,"initialize");async function Dg(t){("backend"in t||t instanceof Y)&&(t={"/":t});for(let[e,i]of Object.entries(t))typeof i!="number"&&(i instanceof Y||(gi(i)&&(i={backend:i}),t[e]=await tr(i)));hu(t)}o(Dg,"configure");var Pt=class{static FromListing(e){let i=new Pt,r=new et;i._index.set("/",r);let n=[{pwd:"",tree:e,parent:r}];for(;n.length>0;){let s,{tree:a,pwd:l,parent:u}=n.pop();for(let f in a){if(!Object.hasOwn(a,f))continue;let d=a[f];if(d){let h=l+"/"+f;s=new et,i._index.set(h,s),n.push({pwd:h,tree:d,parent:s})}else s=new Ji(new B({mode:D.FILE|365}));u&&u._listing.set(f,s)}}return i}_index=new Map;constructor(){this.add("/",new et)}files(){let e=[];for(let i of this._index.values())for(let r of i.listing){let n=i.get(r);n?.isFile()&&e.push(n)}return e}add(e,i){if(!i)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let r=x(e),n=this._index.get(r);return!n&&e!="/"&&(n=new et,!this.add(r,n))||e!="/"&&!n.add(I(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let r=x(e),n=I(e),s=this._index.get(r);return s||(s=new et,this.addFast(r,s)),s.add(n,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=x(e),r=this._index.get(i);if(!r)return;let n=r.remove(I(e));if(!n)return;if(!n.isDirectory())return n;let s=n.listing;for(let a of s)this.remove(ce(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=x(e),r=this._index.get(i);return i==e?r:r?.get(I(e))}};o(Pt,"FileIndex");var pi=class{constructor(e){this.data=e}};o(pi,"IndexInode");var Ji=class extends pi{isFile(){return!0}isDirectory(){return!1}toStats(){return new B({mode:D.FILE|438,size:4096})}};o(Ji,"IndexFileInode");var et=class extends pi{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new B({mode:D.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,i){return this._listing.has(e)?!1:(this._listing.set(e,i),!0)}remove(e){let i=this._listing.get(e);if(i)return this._listing.delete(e),i}};o(et,"IndexDirInode");var yi=class extends yn(Y){_index;constructor(e){super(),this._index=Pt.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw c.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new c(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw c.With("ENOENT",e,"statSync");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new c(22,"Invalid inode.")}async openFile(e,i,r){if(de(i))throw new c(1,e);let n=this._index.get(e);if(!n)throw c.With("ENOENT",e,"openFile");if(!n.toStats().hasAccess(it(i),r))throw c.With("EACCESS",e,"openFile");if(n.isDirectory()){let s=n.stats;return new pt(this,e,i,s,s.fileData)}return this.openFileInode(n,e,i)}openFileSync(e,i,r){if(de(i))throw new c(1,e);let n=this._index.get(e);if(!n)throw c.With("ENOENT",e,"openFileSync");if(!n.toStats().hasAccess(it(i),r))throw c.With("EACCES",e,"openFileSync");if(n.isDirectory()){let s=n.stats;return new pt(this,e,i,s,s.fileData)}return this.openFileInodeSync(n,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw c.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw c.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw c.With("ENOENT",e,"readdirSync");if(i.isDirectory())return i.listing;throw c.With("ENOTDIR",e,"readdirSync")}};o(yi,"FileIndexFS");var cn=class extends ht(yi){async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,r){return this.openFileInodeSync(e,i,r)}};o(cn,"SyncFileIndexFS");var un=class extends wi(yi){statFileInodeSync(){throw new c(95)}openFileInodeSync(){throw new c(95)}};o(un,"AsyncFileIndexFS");var Mg=Xi;return Su(Ug);})();
5
5
  /*! Bundled license information:
6
6
 
7
7
  ieee754/index.js: