@zenfs/core 0.1.0 → 0.2.0

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.
Files changed (44) hide show
  1. package/dist/ApiError.d.ts +51 -14
  2. package/dist/ApiError.js +60 -34
  3. package/dist/FileIndex.d.ts +32 -35
  4. package/dist/FileIndex.js +93 -109
  5. package/dist/backends/AsyncMirror.d.ts +42 -43
  6. package/dist/backends/AsyncMirror.js +146 -133
  7. package/dist/backends/AsyncStore.d.ts +29 -28
  8. package/dist/backends/AsyncStore.js +139 -189
  9. package/dist/backends/InMemory.d.ts +16 -13
  10. package/dist/backends/InMemory.js +29 -14
  11. package/dist/backends/Locked.d.ts +8 -28
  12. package/dist/backends/Locked.js +44 -148
  13. package/dist/backends/OverlayFS.d.ts +26 -34
  14. package/dist/backends/OverlayFS.js +208 -371
  15. package/dist/backends/SyncStore.d.ts +54 -72
  16. package/dist/backends/SyncStore.js +159 -161
  17. package/dist/backends/backend.d.ts +45 -29
  18. package/dist/backends/backend.js +83 -13
  19. package/dist/backends/index.d.ts +6 -7
  20. package/dist/backends/index.js +5 -6
  21. package/dist/browser.min.js +5 -7
  22. package/dist/browser.min.js.map +4 -4
  23. package/dist/emulation/callbacks.d.ts +36 -67
  24. package/dist/emulation/callbacks.js +90 -46
  25. package/dist/emulation/constants.js +1 -1
  26. package/dist/emulation/promises.d.ts +228 -129
  27. package/dist/emulation/promises.js +414 -172
  28. package/dist/emulation/shared.d.ts +10 -10
  29. package/dist/emulation/shared.js +18 -20
  30. package/dist/emulation/sync.d.ts +25 -25
  31. package/dist/emulation/sync.js +187 -73
  32. package/dist/file.d.ts +166 -170
  33. package/dist/file.js +199 -218
  34. package/dist/filesystem.d.ts +68 -241
  35. package/dist/filesystem.js +59 -383
  36. package/dist/index.d.ts +7 -44
  37. package/dist/index.js +13 -52
  38. package/dist/inode.d.ts +37 -28
  39. package/dist/inode.js +123 -65
  40. package/dist/stats.d.ts +21 -19
  41. package/dist/stats.js +35 -56
  42. package/dist/utils.d.ts +26 -9
  43. package/dist/utils.js +73 -102
  44. package/package.json +4 -3
@@ -1,10 +1,8 @@
1
- var ZenFS=(()=>{var tu=Object.create;var cr=Object.defineProperty;var ru=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var nu=Object.getPrototypeOf,ou=Object.prototype.hasOwnProperty;var s=(r,e)=>cr(r,"name",{value:e,configurable:!0});var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ir=(r,e)=>{for(var t in e)cr(r,t,{get:e[t],enumerable:!0})},is=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of iu(e))!ou.call(r,n)&&n!==t&&cr(r,n,{get:()=>e[n],enumerable:!(i=ru(e,n))||i.enumerable});return r};var su=(r,e,t)=>(t=r!=null?tu(nu(r)):{},is(e||!r||!r.__esModule?cr(t,"default",{value:r,enumerable:!0}):t,r)),au=r=>is(cr({},"__esModule",{value:!0}),r);var ws=T(Zr=>{"use strict";Zr.byteLength=kd;Zr.toByteArray=Fd;Zr.fromByteArray=Nd;var Ae=[],ge=[],vd=typeof Uint8Array<"u"?Uint8Array:Array,Pn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(mt=0,bs=Pn.length;mt<bs;++mt)Ae[mt]=Pn[mt],ge[Pn.charCodeAt(mt)]=mt;var mt,bs;ge["-".charCodeAt(0)]=62;ge["_".charCodeAt(0)]=63;function gs(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}s(gs,"getLens");function kd(r){var e=gs(r),t=e[0],i=e[1];return(t+i)*3/4-i}s(kd,"byteLength");function Ad(r,e,t){return(e+t)*3/4-t}s(Ad,"_byteLength");function Fd(r){var e,t=gs(r),i=t[0],n=t[1],o=new vd(Ad(r,i,n)),a=0,l=n>0?i-4:i,c;for(c=0;c<l;c+=4)e=ge[r.charCodeAt(c)]<<18|ge[r.charCodeAt(c+1)]<<12|ge[r.charCodeAt(c+2)]<<6|ge[r.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=ge[r.charCodeAt(c)]<<2|ge[r.charCodeAt(c+1)]>>4,o[a++]=e&255),n===1&&(e=ge[r.charCodeAt(c)]<<10|ge[r.charCodeAt(c+1)]<<4|ge[r.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Fd,"toByteArray");function Td(r){return Ae[r>>18&63]+Ae[r>>12&63]+Ae[r>>6&63]+Ae[r&63]}s(Td,"tripletToBase64");function Cd(r,e,t){for(var i,n=[],o=e;o<t;o+=3)i=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),n.push(Td(i));return n.join("")}s(Cd,"encodeChunk");function Nd(r){for(var e,t=r.length,i=t%3,n=[],o=16383,a=0,l=t-i;a<l;a+=o)n.push(Cd(r,a,a+o>l?l:a+o));return i===1?(e=r[t-1],n.push(Ae[e>>2]+Ae[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(Ae[e>>10]+Ae[e>>4&63]+Ae[e<<2&63]+"=")),n.join("")}s(Nd,"fromByteArray")});var Ss=T(In=>{In.read=function(r,e,t,i,n){var o,a,l=n*8-i-1,c=(1<<l)-1,u=c>>1,h=-7,d=t?n-1:0,b=t?-1:1,m=r[e+d];for(d+=b,o=m&(1<<-h)-1,m>>=-h,h+=l;h>0;o=o*256+r[e+d],d+=b,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=i;h>0;a=a*256+r[e+d],d+=b,h-=8);if(o===0)o=1-u;else{if(o===c)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-u}return(m?-1:1)*a*Math.pow(2,o-i)};In.write=function(r,e,t,i,n,o){var a,l,c,u=o*8-n-1,h=(1<<u)-1,d=h>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:o-1,g=i?1:-1,y=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=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+d>=1?e+=b/c:e+=b*Math.pow(2,1-d),e*c>=2&&(a++,c/=2),a+d>=h?(l=0,a=h):a+d>=1?(l=(e*c-1)*Math.pow(2,n),a=a+d):(l=e*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;r[t+m]=l&255,m+=g,l/=256,n-=8);for(a=a<<n|l,u+=n;u>0;r[t+m]=a&255,m+=g,a/=256,u-=8);r[t+m-g]|=y*128}});var We=T($t=>{"use strict";var Ln=ws(),qt=Ss(),_s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$t.Buffer=p;$t.SlowBuffer=Dd;$t.INSPECT_MAX_BYTES=50;var Qr=2147483647;$t.kMaxLength=Qr;p.TYPED_ARRAY_SUPPORT=Pd();!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 Pd(){try{let r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}s(Pd,"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 Me(r){if(r>Qr)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,p.prototype),e}s(Me,"createBuffer");function p(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Bn(r)}return ks(r,e,t)}s(p,"Buffer");p.poolSize=8192;function ks(r,e,t){if(typeof r=="string")return Ld(r,e);if(ArrayBuffer.isView(r))return Rd(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Fe(r,ArrayBuffer)||r&&Fe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Fe(r,SharedArrayBuffer)||r&&Fe(r.buffer,SharedArrayBuffer)))return On(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return p.from(i,e,t);let n=Od(r);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return p.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}s(ks,"from");p.from=function(r,e,t){return ks(r,e,t)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function As(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}s(As,"assertSize");function Id(r,e,t){return As(r),r<=0?Me(r):e!==void 0?typeof t=="string"?Me(r).fill(e,t):Me(r).fill(e):Me(r)}s(Id,"alloc");p.alloc=function(r,e,t){return Id(r,e,t)};function Bn(r){return As(r),Me(r<0?0:Un(r)|0)}s(Bn,"allocUnsafe");p.allocUnsafe=function(r){return Bn(r)};p.allocUnsafeSlow=function(r){return Bn(r)};function Ld(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Fs(r,e)|0,i=Me(t),n=i.write(r,e);return n!==t&&(i=i.slice(0,n)),i}s(Ld,"fromString");function Rn(r){let e=r.length<0?0:Un(r.length)|0,t=Me(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}s(Rn,"fromArrayLike");function Rd(r){if(Fe(r,Uint8Array)){let e=new Uint8Array(r);return On(e.buffer,e.byteOffset,e.byteLength)}return Rn(r)}s(Rd,"fromArrayView");function On(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,p.prototype),i}s(On,"fromArrayBuffer");function Od(r){if(p.isBuffer(r)){let e=Un(r.length)|0,t=Me(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Wn(r.length)?Me(0):Rn(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Rn(r.data)}s(Od,"fromObject");function Un(r){if(r>=Qr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Qr.toString(16)+" bytes");return r|0}s(Un,"checked");function Dd(r){return+r!=r&&(r=0),p.alloc(+r)}s(Dd,"SlowBuffer");p.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=s(function(e,t){if(Fe(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Fe(t,Uint8Array)&&(t=p.from(t,t.offset,t.byteLength)),!p.isBuffer(e)||!p.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,n=t.length;for(let o=0,a=Math.min(i,n);o<a;++o)if(e[o]!==t[o]){i=e[o],n=t[o];break}return i<n?-1:n<i?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,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;let n=p.allocUnsafe(t),o=0;for(i=0;i<e.length;++i){let a=e[i];if(Fe(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 Fs(r,e){if(p.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Fe(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Dn(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ds(r).length;default:if(n)return i?-1:Dn(r).length;e=(""+e).toLowerCase(),n=!0}}s(Fs,"byteLength");p.byteLength=Fs;function Bd(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Hd(this,e,t);case"utf8":case"utf-8":return Cs(this,e,t);case"ascii":return zd(this,e,t);case"latin1":case"binary":return Kd(this,e,t);case"base64":return $d(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yd(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}s(Bd,"slowToString");p.prototype._isBuffer=!0;function bt(r,e,t){let i=r[e];r[e]=r[t],r[t]=i}s(bt,"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 t=0;t<e;t+=2)bt(this,t,t+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 t=0;t<e;t+=4)bt(this,t,t+3),bt(this,t+1,t+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 t=0;t<e;t+=8)bt(this,t,t+7),bt(this,t+1,t+6),bt(this,t+2,t+5),bt(this,t+3,t+4);return this},"swap64");p.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?Cs(this,0,e):Bd.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="",t=$t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},"inspect");_s&&(p.prototype[_s]=p.prototype.inspect);p.prototype.compare=s(function(e,t,i,n,o){if(Fe(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(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,l=i-t,c=Math.min(a,l),u=this.slice(n,o),h=e.slice(t,i);for(let d=0;d<c;++d)if(u[d]!==h[d]){a=u[d],l=h[d];break}return a<l?-1:l<a?1:0},"compare");function Ts(r,e,t,i,n){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Wn(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof e=="string"&&(e=p.from(e,i)),p.isBuffer(e))return e.length===0?-1:Es(r,e,t,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Es(r,[e],t,i,n);throw new TypeError("val must be string, number or Buffer")}s(Ts,"bidirectionalIndexOf");function Es(r,e,t,i,n){let o=1,a=r.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;o=2,a/=2,l/=2,t/=2}function c(h,d){return o===1?h[d]:h.readUInt16BE(d*o)}s(c,"read");let u;if(n){let h=-1;for(u=t;u<a;u++)if(c(r,u)===c(e,h===-1?0:u-h)){if(h===-1&&(h=u),u-h+1===l)return h*o}else h!==-1&&(u-=u-h),h=-1}else for(t+l>a&&(t=a-l),u=t;u>=0;u--){let h=!0;for(let d=0;d<l;d++)if(c(r,u+d)!==c(e,d)){h=!1;break}if(h)return u}return-1}s(Es,"arrayIndexOf");p.prototype.includes=s(function(e,t,i){return this.indexOf(e,t,i)!==-1},"includes");p.prototype.indexOf=s(function(e,t,i){return Ts(this,e,t,i,!0)},"indexOf");p.prototype.lastIndexOf=s(function(e,t,i){return Ts(this,e,t,i,!1)},"lastIndexOf");function Ud(r,e,t,i){t=Number(t)||0;let n=r.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let a;for(a=0;a<i;++a){let l=parseInt(e.substr(a*2,2),16);if(Wn(l))return a;r[t+a]=l}return a}s(Ud,"hexWrite");function Md(r,e,t,i){return ei(Dn(e,r.length-t),r,t,i)}s(Md,"utf8Write");function Wd(r,e,t,i){return ei(Zd(e),r,t,i)}s(Wd,"asciiWrite");function qd(r,e,t,i){return ei(Ds(e),r,t,i)}s(qd,"base64Write");function jd(r,e,t,i){return ei(Qd(e,r.length-t),r,t,i)}s(jd,"ucs2Write");p.prototype.write=s(function(e,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return Ud(this,e,t,i);case"utf8":case"utf-8":return Md(this,e,t,i);case"ascii":case"latin1":case"binary":return Wd(this,e,t,i);case"base64":return qd(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jd(this,e,t,i);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 $d(r,e,t){return e===0&&t===r.length?Ln.fromByteArray(r):Ln.fromByteArray(r.slice(e,t))}s($d,"base64Slice");function Cs(r,e,t){t=Math.min(r.length,t);let i=[],n=e;for(;n<t;){let o=r[n],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=t){let c,u,h,d;switch(l){case 1:o<128&&(a=o);break;case 2:c=r[n+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(a=d));break;case 3:c=r[n+1],u=r[n+2],(c&192)===128&&(u&192)===128&&(d=(o&15)<<12|(c&63)<<6|u&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:c=r[n+1],u=r[n+2],h=r[n+3],(c&192)===128&&(u&192)===128&&(h&192)===128&&(d=(o&15)<<18|(c&63)<<12|(u&63)<<6|h&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=l}return Vd(i)}s(Cs,"utf8Slice");var xs=4096;function Vd(r){let e=r.length;if(e<=xs)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=xs));return t}s(Vd,"decodeCodePointsArray");function zd(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]&127);return i}s(zd,"asciiSlice");function Kd(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]);return i}s(Kd,"latin1Slice");function Hd(r,e,t){let i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let n="";for(let o=e;o<t;++o)n+=eh[r[o]];return n}s(Hd,"hexSlice");function Yd(r,e,t){let i=r.slice(e,t),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}s(Yd,"utf16leSlice");p.prototype.slice=s(function(e,t){let i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,p.prototype),n},"slice");function G(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}s(G,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=s(function(e,t,i){e=e>>>0,t=t>>>0,i||G(e,t,this.length);let n=this[e],o=1,a=0;for(;++a<t&&(o*=256);)n+=this[e+a]*o;return n},"readUIntLE");p.prototype.readUintBE=p.prototype.readUIntBE=s(function(e,t,i){e=e>>>0,t=t>>>0,i||G(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},"readUIntBE");p.prototype.readUint8=p.prototype.readUInt8=s(function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=s(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");p.prototype.readUint16BE=p.prototype.readUInt16BE=s(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");p.prototype.readUint32LE=p.prototype.readUInt32LE=s(function(e,t){return e=e>>>0,t||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=s(function(e,t){return e=e>>>0,t||G(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,jt(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&pr(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));p.prototype.readBigUInt64BE=lt(s(function(e){e=e>>>0,jt(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&pr(e,this.length-8);let n=t*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+i;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));p.prototype.readIntLE=s(function(e,t,i){e=e>>>0,t=t>>>0,i||G(e,t,this.length);let n=this[e],o=1,a=0;for(;++a<t&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},"readIntLE");p.prototype.readIntBE=s(function(e,t,i){e=e>>>0,t=t>>>0,i||G(e,t,this.length);let n=t,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*t)),a},"readIntBE");p.prototype.readInt8=s(function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");p.prototype.readInt16LE=s(function(e,t){e=e>>>0,t||G(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},"readInt16LE");p.prototype.readInt16BE=s(function(e,t){e=e>>>0,t||G(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},"readInt16BE");p.prototype.readInt32LE=s(function(e,t){return e=e>>>0,t||G(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,t){return e=e>>>0,t||G(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,jt(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&pr(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));p.prototype.readBigInt64BE=lt(s(function(e){e=e>>>0,jt(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&pr(e,this.length-8);let n=(t<<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+i)},"readBigInt64BE"));p.prototype.readFloatLE=s(function(e,t){return e=e>>>0,t||G(e,4,this.length),qt.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=s(function(e,t){return e=e>>>0,t||G(e,4,this.length),qt.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=s(function(e,t){return e=e>>>0,t||G(e,8,this.length),qt.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=s(function(e,t){return e=e>>>0,t||G(e,8,this.length),qt.read(this,e,!1,52,8)},"readDoubleBE");function ce(r,e,t,i,n,o){if(!p.isBuffer(r))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(t+i>r.length)throw new RangeError("Index out of range")}s(ce,"checkInt");p.prototype.writeUintLE=p.prototype.writeUIntLE=s(function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;ce(this,e,t,i,l,0)}let o=1,a=0;for(this[t]=e&255;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i},"writeUIntLE");p.prototype.writeUintBE=p.prototype.writeUIntBE=s(function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;ce(this,e,t,i,l,0)}let o=i-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i},"writeUIntBE");p.prototype.writeUint8=p.prototype.writeUInt8=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");p.prototype.writeUint16LE=p.prototype.writeUInt16LE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");p.prototype.writeUint16BE=p.prototype.writeUInt16BE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");p.prototype.writeUint32LE=p.prototype.writeUInt32LE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},"writeUInt32LE");p.prototype.writeUint32BE=p.prototype.writeUInt32BE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function Ns(r,e,t,i,n){Os(e,i,n,r,t,7);let o=Number(e&BigInt(4294967295));r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]=a,t}s(Ns,"wrtBigUInt64LE");function Ps(r,e,t,i,n){Os(e,i,n,r,t,7);let o=Number(e&BigInt(4294967295));r[t+7]=o,o=o>>8,r[t+6]=o,o=o>>8,r[t+5]=o,o=o>>8,r[t+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=a,a=a>>8,r[t+2]=a,a=a>>8,r[t+1]=a,a=a>>8,r[t]=a,t+8}s(Ps,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=lt(s(function(e,t=0){return Ns(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=lt(s(function(e,t=0){return Ps(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));p.prototype.writeIntLE=s(function(e,t,i,n){if(e=+e,t=t>>>0,!n){let c=Math.pow(2,8*i-1);ce(this,e,t,i,c-1,-c)}let o=0,a=1,l=0;for(this[t]=e&255;++o<i&&(a*=256);)e<0&&l===0&&this[t+o-1]!==0&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+i},"writeIntLE");p.prototype.writeIntBE=s(function(e,t,i,n){if(e=+e,t=t>>>0,!n){let c=Math.pow(2,8*i-1);ce(this,e,t,i,c-1,-c)}let o=i-1,a=1,l=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[t+o+1]!==0&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+i},"writeIntBE");p.prototype.writeInt8=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");p.prototype.writeInt16LE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE");p.prototype.writeInt16BE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");p.prototype.writeInt32LE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");p.prototype.writeInt32BE=s(function(e,t,i){return e=+e,t=t>>>0,i||ce(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");p.prototype.writeBigInt64LE=lt(s(function(e,t=0){return Ns(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=lt(s(function(e,t=0){return Ps(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Is(r,e,t,i,n,o){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}s(Is,"checkIEEE754");function Ls(r,e,t,i,n){return e=+e,t=t>>>0,n||Is(r,e,t,4,34028234663852886e22,-34028234663852886e22),qt.write(r,e,t,i,23,4),t+4}s(Ls,"writeFloat");p.prototype.writeFloatLE=s(function(e,t,i){return Ls(this,e,t,!0,i)},"writeFloatLE");p.prototype.writeFloatBE=s(function(e,t,i){return Ls(this,e,t,!1,i)},"writeFloatBE");function Rs(r,e,t,i,n){return e=+e,t=t>>>0,n||Is(r,e,t,8,17976931348623157e292,-17976931348623157e292),qt.write(r,e,t,i,52,8),t+8}s(Rs,"writeDouble");p.prototype.writeDoubleLE=s(function(e,t,i){return Rs(this,e,t,!0,i)},"writeDoubleLE");p.prototype.writeDoubleBE=s(function(e,t,i){return Rs(this,e,t,!1,i)},"writeDoubleBE");p.prototype.copy=s(function(e,t,i,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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-t<n-i&&(n=e.length-t+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),o},"copy");p.prototype.fill=s(function(e,t,i,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=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(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o<i;++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<i-t;++o)this[o+t]=a[o%l]}return this},"fill");var Wt={};function Mn(r,e,t){Wt[r]=s(class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}},"NodeError")}s(Mn,"E");Mn("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Mn("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError);Mn("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=vs(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=vs(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function vs(r){let e="",t=r.length,i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}s(vs,"addNumericalSeparator");function Gd(r,e,t){jt(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&pr(e,r.length-(t+1))}s(Gd,"checkBounds");function Os(r,e,t,i,n,o){if(r>t||r<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 <= ${t}${a}`,new Wt.ERR_OUT_OF_RANGE("value",l,r)}Gd(i,n,o)}s(Os,"checkIntBI");function jt(r,e){if(typeof r!="number")throw new Wt.ERR_INVALID_ARG_TYPE(e,"number",r)}s(jt,"validateNumber");function pr(r,e,t){throw Math.floor(r)!==r?(jt(r,t),new Wt.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Wt.ERR_BUFFER_OUT_OF_BOUNDS:new Wt.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}s(pr,"boundsError");var Xd=/[^+/0-9A-Za-z-_]/g;function Jd(r){if(r=r.split("=")[0],r=r.trim().replace(Xd,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}s(Jd,"base64clean");function Dn(r,e){e=e||1/0;let t,i=r.length,n=null,o=[];for(let a=0;a<i;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}s(Dn,"utf8ToBytes");function Zd(r){let e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}s(Zd,"asciiToBytes");function Qd(r,e){let t,i,n,o=[];for(let a=0;a<r.length&&!((e-=2)<0);++a)t=r.charCodeAt(a),i=t>>8,n=t%256,o.push(n),o.push(i);return o}s(Qd,"utf16leToBytes");function Ds(r){return Ln.toByteArray(Jd(r))}s(Ds,"base64ToBytes");function ei(r,e,t,i){let n;for(n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}s(ei,"blitBuffer");function Fe(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}s(Fe,"isInstance");function Wn(r){return r!==r}s(Wn,"numberIsNaN");var eh=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let n=0;n<16;++n)e[i+n]=r[t]+r[n]}return e}();function lt(r){return typeof BigInt>"u"?th:r}s(lt,"defineBigIntMethod");function th(){throw new Error("BigInt not supported")}s(th,"BufferBigIntNotDefined")});var O=T((vS,Bs)=>{"use strict";Bs.exports={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,e){return r.includes(e)},ArrayPrototypeIndexOf(r,e){return r.indexOf(e)},ArrayPrototypeJoin(r,e){return r.join(e)},ArrayPrototypeMap(r,e){return r.map(e)},ArrayPrototypePop(r,e){return r.pop(e)},ArrayPrototypePush(r,e){return r.push(e)},ArrayPrototypeSlice(r,e,t){return r.slice(e,t)},Error,FunctionPrototypeCall(r,e,...t){return r.call(e,...t)},FunctionPrototypeSymbolHasInstance(r,e){return Function.prototype[Symbol.hasInstance].call(r,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(r,e){return Object.defineProperties(r,e)},ObjectDefineProperty(r,e,t){return Object.defineProperty(r,e,t)},ObjectGetOwnPropertyDescriptor(r,e){return Object.getOwnPropertyDescriptor(r,e)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,e){return Object.setPrototypeOf(r,e)},Promise,PromisePrototypeCatch(r,e){return r.catch(e)},PromisePrototypeThen(r,e,t){return r.then(e,t)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,e){return r.test(e)},SafeSet:Set,String,StringPrototypeSlice(r,e,t){return r.slice(e,t)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.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(r,e,t){return r.set(e,t)},Boolean,Uint8Array}});var Vt=T((kS,ti)=>{"use strict";var{AbortController:Us,AbortSignal:rh}=typeof self<"u"?self:typeof window<"u"?window:void 0;ti.exports=Us;ti.exports.AbortSignal=rh;ti.exports.default=Us});var yr=T((AS,qn)=>{"use strict";var zt=typeof Reflect=="object"?Reflect:null,Ms=zt&&typeof zt.apply=="function"?zt.apply:s(function(e,t,i){return Function.prototype.apply.call(e,t,i)},"ReflectApply"),ri;zt&&typeof zt.ownKeys=="function"?ri=zt.ownKeys:Object.getOwnPropertySymbols?ri=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):ri=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function ih(r){console&&console.warn&&console.warn(r)}s(ih,"ProcessEmitWarning");var qs=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function P(){P.init.call(this)}s(P,"EventEmitter");qn.exports=P;qn.exports.once=ah;P.EventEmitter=P;P.prototype._events=void 0;P.prototype._eventsCount=0;P.prototype._maxListeners=void 0;var Ws=10;function ii(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}s(ii,"checkListener");Object.defineProperty(P,"defaultMaxListeners",{enumerable:!0,get:function(){return Ws},set:function(r){if(typeof r!="number"||r<0||qs(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ws=r}});P.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};P.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 js(r){return r._maxListeners===void 0?P.defaultMaxListeners:r._maxListeners}s(js,"_getMaxListeners");P.prototype.getMaxListeners=s(function(){return js(this)},"getMaxListeners");P.prototype.emit=s(function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);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(t.length>0&&(a=t[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")Ms(c,this,t);else for(var u=c.length,h=Hs(c,u),i=0;i<u;++i)Ms(h[i],this,t);return!0},"emit");function $s(r,e,t,i){var n,o,a;if(ii(t),o=r._events,o===void 0?(o=r._events=Object.create(null),r._eventsCount=0):(o.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),o=r._events),a=o[e]),a===void 0)a=o[e]=t,++r._eventsCount;else if(typeof a=="function"?a=o[e]=i?[t,a]:[a,t]:i?a.unshift(t):a.push(t),n=js(r),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=r,l.type=e,l.count=a.length,ih(l)}return r}s($s,"_addListener");P.prototype.addListener=s(function(e,t){return $s(this,e,t,!1)},"addListener");P.prototype.on=P.prototype.addListener;P.prototype.prependListener=s(function(e,t){return $s(this,e,t,!0)},"prependListener");function nh(){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(nh,"onceWrapper");function Vs(r,e,t){var i={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},n=nh.bind(i);return n.listener=t,i.wrapFn=n,n}s(Vs,"_onceWrap");P.prototype.once=s(function(e,t){return ii(t),this.on(e,Vs(this,e,t)),this},"once");P.prototype.prependOnceListener=s(function(e,t){return ii(t),this.prependListener(e,Vs(this,e,t)),this},"prependOnceListener");P.prototype.removeListener=s(function(e,t){var i,n,o,a,l;if(ii(t),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if(typeof i!="function"){for(o=-1,a=i.length-1;a>=0;a--)if(i[a]===t||i[a].listener===t){l=i[a].listener,o=a;break}if(o<0)return this;o===0?i.shift():oh(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this},"removeListener");P.prototype.off=P.prototype.removeListener;P.prototype.removeAllListeners=s(function(e){var t,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),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(t=i[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},"removeAllListeners");function zs(r,e,t){var i=r._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?t?[n.listener||n]:[n]:t?sh(n):Hs(n,n.length)}s(zs,"_listeners");P.prototype.listeners=s(function(e){return zs(this,e,!0)},"listeners");P.prototype.rawListeners=s(function(e){return zs(this,e,!1)},"rawListeners");P.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Ks.call(r,e)};P.prototype.listenerCount=Ks;function Ks(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}s(Ks,"listenerCount");P.prototype.eventNames=s(function(){return this._eventsCount>0?ri(this._events):[]},"eventNames");function Hs(r,e){for(var t=new Array(e),i=0;i<e;++i)t[i]=r[i];return t}s(Hs,"arrayClone");function oh(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}s(oh,"spliceOne");function sh(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}s(sh,"unwrapListeners");function ah(r,e){return new Promise(function(t,i){function n(a){r.removeListener(e,o),i(a)}s(n,"errorListener");function o(){typeof r.removeListener=="function"&&r.removeListener("error",n),t([].slice.call(arguments))}s(o,"resolver"),Ys(r,e,o,{once:!0}),e!=="error"&&lh(r,n,{once:!0})})}s(ah,"once");function lh(r,e,t){typeof r.on=="function"&&Ys(r,"error",e,t)}s(lh,"addErrorHandlerIfEventEmitter");function Ys(r,e,t,i){if(typeof r.on=="function")i.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,s(function n(o){i.once&&r.removeEventListener(e,n),t(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}s(Ys,"eventTargetAgnosticAddListener")});var re=T((TS,jn)=>{"use strict";var ch=We(),{kResistStopPropagation:uh,SymbolDispose:fh}=O(),dh=globalThis.AbortSignal||Vt().AbortSignal,hh=globalThis.AbortController||Vt().AbortController,ph=Object.getPrototypeOf(async function(){}).constructor,Gs=globalThis.Blob||ch.Blob,yh=s(typeof Gs<"u"?function(e){return e instanceof Gs}:function(e){return!1},"isBlob"),Xs=s((r,e)=>{if(r!==void 0&&(r===null||typeof r!="object"||!("aborted"in r)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",r)},"validateAbortSignal"),mh=s((r,e)=>{if(typeof r!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",r)},"validateFunction"),ni=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let t="";for(let i=0;i<e.length;i++)t+=` ${e[i].stack}
2
- `;super(t),this.name="AggregateError",this.errors=e}};s(ni,"AggregateError");jn.exports={AggregateError:ni,kEmptyObject:Object.freeze({}),once(r){let e=!1;return function(...t){e||(e=!0,r.apply(this,t))}},createDeferredPromise:function(){let r,e;return{promise:new Promise((i,n)=>{r=i,e=n}),resolve:r,reject:e}},promisify(r){return new Promise((e,t)=>{r((i,...n)=>i?t(i):e(...n))})},debuglog(){return function(){}},format(r,...e){return r.replace(/%([sdifj])/g,function(...[t,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}},types:{isAsyncFunction(r){return r instanceof ph},isArrayBufferView(r){return ArrayBuffer.isView(r)}},isBlob:yh,deprecate(r,e){return r},addAbortListener:yr().addAbortListener||s(function(e,t){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Xs(e,"signal"),mh(t,"listener");let i;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[uh]:!0}),i=s(()=>{e.removeEventListener("abort",t)},"removeEventListener")),{__proto__:null,[fh](){var n;(n=i)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:dh.any||s(function(e){if(e.length===1)return e[0];let t=new hh,i=s(()=>t.abort(),"abort");return e.forEach(n=>{Xs(n,"signals"),n.addEventListener("abort",i,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),t.signal},"AbortSignalAny")};jn.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var oe=T((NS,Qs)=>{"use strict";var{format:bh,inspect:si,AggregateError:gh}=re(),wh=globalThis.AggregateError||gh,Sh=Symbol("kIsNodeError"),_h=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Eh=/^([A-Z][a-z0-9]*)+$/,xh="__node_internal_",ai={};function gt(r,e){if(!r)throw new ai.ERR_INTERNAL_ASSERTION(e)}s(gt,"assert");function Js(r){let e="",t=r.length,i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}s(Js,"addNumericalSeparator");function vh(r,e,t){if(typeof e=="function")return gt(e.length<=t.length,`Code: ${r}; The provided arguments length (${t.length}) does not match the required ones (${e.length}).`),e(...t);let i=(e.match(/%[dfijoOs]/g)||[]).length;return gt(i===t.length,`Code: ${r}; The provided arguments length (${t.length}) does not match the required ones (${i}).`),t.length===0?e:bh(e,...t)}s(vh,"getMessage");function J(r,e,t){t||(t=Error);class i extends t{constructor(...o){super(vh(r,e,o))}toString(){return`${this.name} [${r}]: ${this.message}`}}s(i,"NodeError"),Object.defineProperties(i.prototype,{name:{value:t.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${r}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=r,i.prototype[Sh]=!0,ai[r]=i}s(J,"E");function Zs(r){let e=xh+r.name;return Object.defineProperty(r,"name",{value:e}),r}s(Zs,"hideStackFrames");function kh(r,e){if(r&&e&&r!==e){if(Array.isArray(e.errors))return e.errors.push(r),e;let t=new wh([e,r],e.message);return t.code=e.code,t}return r||e}s(kh,"aggregateTwoErrors");var oi=class extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!="object")throw new ai.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};s(oi,"AbortError");J("ERR_ASSERTION","%s",Error);J("ERR_INVALID_ARG_TYPE",(r,e,t)=>{gt(typeof r=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";r.endsWith(" argument")?i+=`${r} `:i+=`"${r}" ${r.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],a=[];for(let c of e)gt(typeof c=="string","All expected entries have to be of type string"),_h.includes(c)?n.push(c.toLowerCase()):Eh.test(c)?o.push(c):(gt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let c=n.pop();i+=`one of type ${n.join(", ")}, or ${c}`}}(o.length>0||a.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();i+=`an instance of ${o.join(", ")}, or ${c}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{let c=a.pop();i+=`one of ${a.join(", ")}, or ${c}`}}if(t==null)i+=`. Received ${t}`;else if(typeof t=="function"&&t.name)i+=`. Received function ${t.name}`;else if(typeof t=="object"){var l;if((l=t.constructor)!==null&&l!==void 0&&l.name)i+=`. Received an instance of ${t.constructor.name}`;else{let c=si(t,{depth:-1});i+=`. Received ${c}`}}else{let c=si(t,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),i+=`. Received type ${typeof t} (${c})`}return i},TypeError);J("ERR_INVALID_ARG_VALUE",(r,e,t="is invalid")=>{let i=si(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${r.includes(".")?"property":"argument"} '${r}' ${t}. Received ${i}`},TypeError);J("ERR_INVALID_RETURN_VALUE",(r,e,t)=>{var i;let n=t!=null&&(i=t.constructor)!==null&&i!==void 0&&i.name?`instance of ${t.constructor.name}`:`type ${typeof t}`;return`Expected ${r} to be returned from the "${e}" function but got ${n}.`},TypeError);J("ERR_MISSING_ARGS",(...r)=>{gt(r.length>0,"At least one arg needs to be specified");let e,t=r.length;switch(r=(Array.isArray(r)?r:[r]).map(i=>`"${i}"`).join(" or "),t){case 1:e+=`The ${r[0]} argument`;break;case 2:e+=`The ${r[0]} and ${r[1]} arguments`;break;default:{let i=r.pop();e+=`The ${r.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);J("ERR_OUT_OF_RANGE",(r,e,t)=>{gt(e,'Missing "range" argument');let i;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Js(String(t)):typeof t=="bigint"?(i=String(t),(t>2n**32n||t<-(2n**32n))&&(i=Js(i)),i+="n"):i=si(t),`The value of "${r}" is out of range. It must be ${e}. Received ${i}`},RangeError);J("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);J("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);J("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);J("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);J("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);J("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);J("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);J("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);J("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);J("ERR_STREAM_WRITE_AFTER_END","write after end",Error);J("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Qs.exports={AbortError:oi,aggregateTwoErrors:Zs(kh),hideStackFrames:Zs,codes:ai}});var Ht=T((IS,ca)=>{"use strict";var{ArrayIsArray:Vn,ArrayPrototypeIncludes:ia,ArrayPrototypeJoin:na,ArrayPrototypeMap:Ah,NumberIsInteger:zn,NumberIsNaN:Fh,NumberMAX_SAFE_INTEGER:Th,NumberMIN_SAFE_INTEGER:Ch,NumberParseInt:Nh,ObjectPrototypeHasOwnProperty:Ph,RegExpPrototypeExec:oa,String:Ih,StringPrototypeToUpperCase:Lh,StringPrototypeTrim:Rh}=O(),{hideStackFrames:we,codes:{ERR_SOCKET_BAD_PORT:Oh,ERR_INVALID_ARG_TYPE:ie,ERR_INVALID_ARG_VALUE:Kt,ERR_OUT_OF_RANGE:wt,ERR_UNKNOWN_SIGNAL:ea}}=oe(),{normalizeEncoding:Dh}=re(),{isAsyncFunction:Bh,isArrayBufferView:Uh}=re().types,ta={};function Mh(r){return r===(r|0)}s(Mh,"isInt32");function Wh(r){return r===r>>>0}s(Wh,"isUint32");var qh=/^[0-7]+$/,jh="must be a 32-bit unsigned integer or an octal string";function $h(r,e,t){if(typeof r>"u"&&(r=t),typeof r=="string"){if(oa(qh,r)===null)throw new Kt(e,r,jh);r=Nh(r,8)}return sa(r,e),r}s($h,"parseFileMode");var Vh=we((r,e,t=Ch,i=Th)=>{if(typeof r!="number")throw new ie(e,"number",r);if(!zn(r))throw new wt(e,"an integer",r);if(r<t||r>i)throw new wt(e,`>= ${t} && <= ${i}`,r)}),zh=we((r,e,t=-2147483648,i=2147483647)=>{if(typeof r!="number")throw new ie(e,"number",r);if(!zn(r))throw new wt(e,"an integer",r);if(r<t||r>i)throw new wt(e,`>= ${t} && <= ${i}`,r)}),sa=we((r,e,t=!1)=>{if(typeof r!="number")throw new ie(e,"number",r);if(!zn(r))throw new wt(e,"an integer",r);let i=t?1:0,n=4294967295;if(r<i||r>n)throw new wt(e,`>= ${i} && <= ${n}`,r)});function Kn(r,e){if(typeof r!="string")throw new ie(e,"string",r)}s(Kn,"validateString");function Kh(r,e,t=void 0,i){if(typeof r!="number")throw new ie(e,"number",r);if(t!=null&&r<t||i!=null&&r>i||(t!=null||i!=null)&&Fh(r))throw new wt(e,`${t!=null?`>= ${t}`:""}${t!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,r)}s(Kh,"validateNumber");var Hh=we((r,e,t)=>{if(!ia(t,r)){let n="must be one of: "+na(Ah(t,o=>typeof o=="string"?`'${o}'`:Ih(o)),", ");throw new Kt(e,r,n)}});function aa(r,e){if(typeof r!="boolean")throw new ie(e,"boolean",r)}s(aa,"validateBoolean");function $n(r,e,t){return r==null||!Ph(r,e)?t:r[e]}s($n,"getOwnPropertyValueOrDefault");var Yh=we((r,e,t=null)=>{let i=$n(t,"allowArray",!1),n=$n(t,"allowFunction",!1);if(!$n(t,"nullable",!1)&&r===null||!i&&Vn(r)||typeof r!="object"&&(!n||typeof r!="function"))throw new ie(e,"Object",r)}),Gh=we((r,e)=>{if(r!=null&&typeof r!="object"&&typeof r!="function")throw new ie(e,"a dictionary",r)}),li=we((r,e,t=0)=>{if(!Vn(r))throw new ie(e,"Array",r);if(r.length<t){let i=`must be longer than ${t}`;throw new Kt(e,r,i)}});function Xh(r,e){li(r,e);for(let t=0;t<r.length;t++)Kn(r[t],`${e}[${t}]`)}s(Xh,"validateStringArray");function Jh(r,e){li(r,e);for(let t=0;t<r.length;t++)aa(r[t],`${e}[${t}]`)}s(Jh,"validateBooleanArray");function Zh(r,e){li(r,e);for(let t=0;t<r.length;t++){let i=r[t],n=`${e}[${t}]`;if(i==null)throw new ie(n,"AbortSignal",i);la(i,n)}}s(Zh,"validateAbortSignalArray");function Qh(r,e="signal"){if(Kn(r,e),ta[r]===void 0)throw ta[Lh(r)]!==void 0?new ea(r+" (signals must use all capital letters)"):new ea(r)}s(Qh,"validateSignalName");var ep=we((r,e="buffer")=>{if(!Uh(r))throw new ie(e,["Buffer","TypedArray","DataView"],r)});function tp(r,e){let t=Dh(e),i=r.length;if(t==="hex"&&i%2!==0)throw new Kt("encoding",e,`is invalid for data of length ${i}`)}s(tp,"validateEncoding");function rp(r,e="Port",t=!0){if(typeof r!="number"&&typeof r!="string"||typeof r=="string"&&Rh(r).length===0||+r!==+r>>>0||r>65535||r===0&&!t)throw new Oh(e,r,t);return r|0}s(rp,"validatePort");var la=we((r,e)=>{if(r!==void 0&&(r===null||typeof r!="object"||!("aborted"in r)))throw new ie(e,"AbortSignal",r)}),ip=we((r,e)=>{if(typeof r!="function")throw new ie(e,"Function",r)}),np=we((r,e)=>{if(typeof r!="function"||Bh(r))throw new ie(e,"Function",r)}),op=we((r,e)=>{if(r!==void 0)throw new ie(e,"undefined",r)});function sp(r,e,t){if(!ia(t,r))throw new ie(e,`('${na(t,"|")}')`,r)}s(sp,"validateUnion");var ap=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ra(r,e){if(typeof r>"u"||!oa(ap,r))throw new Kt(e,r,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(ra,"validateLinkHeaderFormat");function lp(r){if(typeof r=="string")return ra(r,"hints"),r;if(Vn(r)){let e=r.length,t="";if(e===0)return t;for(let i=0;i<e;i++){let n=r[i];ra(n,"hints"),t+=n,i!==e-1&&(t+=", ")}return t}throw new Kt("hints",r,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(lp,"validateLinkHeaderValue");ca.exports={isInt32:Mh,isUint32:Wh,parseFileMode:$h,validateArray:li,validateStringArray:Xh,validateBooleanArray:Jh,validateAbortSignalArray:Zh,validateBoolean:aa,validateBuffer:ep,validateDictionary:Gh,validateEncoding:tp,validateFunction:ip,validateInt32:zh,validateInteger:Vh,validateNumber:Kh,validateObject:Yh,validateOneOf:Hh,validatePlainFunction:np,validatePort:rp,validateSignalName:Qh,validateString:Kn,validateUint32:sa,validateUndefined:op,validateUnion:sp,validateAbortSignal:la,validateLinkHeaderValue:lp}});var ct=T((RS,ha)=>{var $=ha.exports={},Te,Ce;function Hn(){throw new Error("setTimeout has not been defined")}s(Hn,"defaultSetTimout");function Yn(){throw new Error("clearTimeout has not been defined")}s(Yn,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Te=setTimeout:Te=Hn}catch{Te=Hn}try{typeof clearTimeout=="function"?Ce=clearTimeout:Ce=Yn}catch{Ce=Yn}})();function ua(r){if(Te===setTimeout)return setTimeout(r,0);if((Te===Hn||!Te)&&setTimeout)return Te=setTimeout,setTimeout(r,0);try{return Te(r,0)}catch{try{return Te.call(null,r,0)}catch{return Te.call(this,r,0)}}}s(ua,"runTimeout");function cp(r){if(Ce===clearTimeout)return clearTimeout(r);if((Ce===Yn||!Ce)&&clearTimeout)return Ce=clearTimeout,clearTimeout(r);try{return Ce(r)}catch{try{return Ce.call(null,r)}catch{return Ce.call(this,r)}}}s(cp,"runClearTimeout");var qe=[],Yt=!1,St,ci=-1;function up(){!Yt||!St||(Yt=!1,St.length?qe=St.concat(qe):ci=-1,qe.length&&fa())}s(up,"cleanUpNextTick");function fa(){if(!Yt){var r=ua(up);Yt=!0;for(var e=qe.length;e;){for(St=qe,qe=[];++ci<e;)St&&St[ci].run();ci=-1,e=qe.length}St=null,Yt=!1,cp(r)}}s(fa,"drainQueue");$.nextTick=function(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];qe.push(new da(r,e)),qe.length===1&&!Yt&&ua(fa)};function da(r,e){this.fun=r,this.array=e}s(da,"Item");da.prototype.run=function(){this.fun.apply(null,this.array)};$.title="browser";$.browser=!0;$.env={};$.argv=[];$.version="";$.versions={};function je(){}s(je,"noop");$.on=je;$.addListener=je;$.once=je;$.off=je;$.removeListener=je;$.removeAllListeners=je;$.emit=je;$.prependListener=je;$.prependOnceListener=je;$.listeners=function(r){return[]};$.binding=function(r){throw new Error("process.binding is not supported")};$.cwd=function(){return"/"};$.chdir=function(r){throw new Error("process.chdir is not supported")};$.umask=function(){return 0}});var Pe=T((DS,Ta)=>{"use strict";var{SymbolAsyncIterator:pa,SymbolIterator:ya,SymbolFor:_t}=O(),ma=_t("nodejs.stream.destroyed"),ba=_t("nodejs.stream.errored"),Gn=_t("nodejs.stream.readable"),Xn=_t("nodejs.stream.writable"),ga=_t("nodejs.stream.disturbed"),fp=_t("nodejs.webstream.isClosedPromise"),dp=_t("nodejs.webstream.controllerErrorFunction");function ui(r,e=!1){var t;return!!(r&&typeof r.pipe=="function"&&typeof r.on=="function"&&(!e||typeof r.pause=="function"&&typeof r.resume=="function")&&(!r._writableState||((t=r._readableState)===null||t===void 0?void 0:t.readable)!==!1)&&(!r._writableState||r._readableState))}s(ui,"isReadableNodeStream");function fi(r){var e;return!!(r&&typeof r.write=="function"&&typeof r.on=="function"&&(!r._readableState||((e=r._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(fi,"isWritableNodeStream");function hp(r){return!!(r&&typeof r.pipe=="function"&&r._readableState&&typeof r.on=="function"&&typeof r.write=="function")}s(hp,"isDuplexNodeStream");function Ne(r){return r&&(r._readableState||r._writableState||typeof r.write=="function"&&typeof r.on=="function"||typeof r.pipe=="function"&&typeof r.on=="function")}s(Ne,"isNodeStream");function wa(r){return!!(r&&!Ne(r)&&typeof r.pipeThrough=="function"&&typeof r.getReader=="function"&&typeof r.cancel=="function")}s(wa,"isReadableStream");function Sa(r){return!!(r&&!Ne(r)&&typeof r.getWriter=="function"&&typeof r.abort=="function")}s(Sa,"isWritableStream");function _a(r){return!!(r&&!Ne(r)&&typeof r.readable=="object"&&typeof r.writable=="object")}s(_a,"isTransformStream");function pp(r){return wa(r)||Sa(r)||_a(r)}s(pp,"isWebStream");function yp(r,e){return r==null?!1:e===!0?typeof r[pa]=="function":e===!1?typeof r[ya]=="function":typeof r[pa]=="function"||typeof r[ya]=="function"}s(yp,"isIterable");function di(r){if(!Ne(r))return null;let e=r._writableState,t=r._readableState,i=e||t;return!!(r.destroyed||r[ma]||i!=null&&i.destroyed)}s(di,"isDestroyed");function Ea(r){if(!fi(r))return null;if(r.writableEnded===!0)return!0;let e=r._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ea,"isWritableEnded");function mp(r,e){if(!fi(r))return null;if(r.writableFinished===!0)return!0;let t=r._writableState;return t!=null&&t.errored?!1:typeof t?.finished!="boolean"?null:!!(t.finished||e===!1&&t.ended===!0&&t.length===0)}s(mp,"isWritableFinished");function bp(r){if(!ui(r))return null;if(r.readableEnded===!0)return!0;let e=r._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(bp,"isReadableEnded");function xa(r,e){if(!ui(r))return null;let t=r._readableState;return t!=null&&t.errored?!1:typeof t?.endEmitted!="boolean"?null:!!(t.endEmitted||e===!1&&t.ended===!0&&t.length===0)}s(xa,"isReadableFinished");function va(r){return r&&r[Gn]!=null?r[Gn]:typeof r?.readable!="boolean"?null:di(r)?!1:ui(r)&&r.readable&&!xa(r)}s(va,"isReadable");function ka(r){return r&&r[Xn]!=null?r[Xn]:typeof r?.writable!="boolean"?null:di(r)?!1:fi(r)&&r.writable&&!Ea(r)}s(ka,"isWritable");function gp(r,e){return Ne(r)?di(r)?!0:!(e?.readable!==!1&&va(r)||e?.writable!==!1&&ka(r)):null}s(gp,"isFinished");function wp(r){var e,t;return Ne(r)?r.writableErrored?r.writableErrored:(e=(t=r._writableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}s(wp,"isWritableErrored");function Sp(r){var e,t;return Ne(r)?r.readableErrored?r.readableErrored:(e=(t=r._readableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}s(Sp,"isReadableErrored");function _p(r){if(!Ne(r))return null;if(typeof r.closed=="boolean")return r.closed;let e=r._writableState,t=r._readableState;return typeof e?.closed=="boolean"||typeof t?.closed=="boolean"?e?.closed||t?.closed:typeof r._closed=="boolean"&&Aa(r)?r._closed:null}s(_p,"isClosed");function Aa(r){return typeof r._closed=="boolean"&&typeof r._defaultKeepAlive=="boolean"&&typeof r._removedConnection=="boolean"&&typeof r._removedContLen=="boolean"}s(Aa,"isOutgoingMessage");function Fa(r){return typeof r._sent100=="boolean"&&Aa(r)}s(Fa,"isServerResponse");function Ep(r){var e;return typeof r._consuming=="boolean"&&typeof r._dumped=="boolean"&&((e=r.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(Ep,"isServerRequest");function xp(r){if(!Ne(r))return null;let e=r._writableState,t=r._readableState,i=e||t;return!i&&Fa(r)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}s(xp,"willEmitClose");function vp(r){var e;return!!(r&&((e=r[ga])!==null&&e!==void 0?e:r.readableDidRead||r.readableAborted))}s(vp,"isDisturbed");function kp(r){var e,t,i,n,o,a,l,c,u,h;return!!(r&&((e=(t=(i=(n=(o=(a=r[ba])!==null&&a!==void 0?a:r.readableErrored)!==null&&o!==void 0?o:r.writableErrored)!==null&&n!==void 0?n:(l=r._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(c=r._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&t!==void 0?t:(u=r._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((h=r._writableState)===null||h===void 0)&&h.errored))}s(kp,"isErrored");Ta.exports={isDestroyed:di,kIsDestroyed:ma,isDisturbed:vp,kIsDisturbed:ga,isErrored:kp,kIsErrored:ba,isReadable:va,kIsReadable:Gn,kIsClosedPromise:fp,kControllerErrorFunction:dp,kIsWritable:Xn,isClosed:_p,isDuplexNodeStream:hp,isFinished:gp,isIterable:yp,isReadableNodeStream:ui,isReadableStream:wa,isReadableEnded:bp,isReadableFinished:xa,isReadableErrored:Sp,isNodeStream:Ne,isWebStream:pp,isWritable:ka,isWritableNodeStream:fi,isWritableStream:Sa,isWritableEnded:Ea,isWritableFinished:mp,isWritableErrored:wp,isServerRequest:Ep,isServerResponse:Fa,willEmitClose:xp,isTransformStream:_a}});var $e=T((US,to)=>{var ut=ct(),{AbortError:Ba,codes:Ap}=oe(),{ERR_INVALID_ARG_TYPE:Fp,ERR_STREAM_PREMATURE_CLOSE:Ca}=Ap,{kEmptyObject:Zn,once:Qn}=re(),{validateAbortSignal:Tp,validateFunction:Cp,validateObject:Np,validateBoolean:Pp}=Ht(),{Promise:Ip,PromisePrototypeThen:Lp,SymbolDispose:Ua}=O(),{isClosed:Rp,isReadable:Na,isReadableNodeStream:Jn,isReadableStream:Op,isReadableFinished:Pa,isReadableErrored:Ia,isWritable:La,isWritableNodeStream:Ra,isWritableStream:Dp,isWritableFinished:Oa,isWritableErrored:Da,isNodeStream:Bp,willEmitClose:Up,kIsClosedPromise:Mp}=Pe(),Gt;function Wp(r){return r.setHeader&&typeof r.abort=="function"}s(Wp,"isRequest");var eo=s(()=>{},"nop");function Ma(r,e,t){var i,n;if(arguments.length===2?(t=e,e=Zn):e==null?e=Zn:Np(e,"options"),Cp(t,"callback"),Tp(e.signal,"options.signal"),t=Qn(t),Op(r)||Dp(r))return qp(r,e,t);if(!Bp(r))throw new Fp("stream",["ReadableStream","WritableStream","Stream"],r);let o=(i=e.readable)!==null&&i!==void 0?i:Jn(r),a=(n=e.writable)!==null&&n!==void 0?n:Ra(r),l=r._writableState,c=r._readableState,u=s(()=>{r.writable||b()},"onlegacyfinish"),h=Up(r)&&Jn(r)===o&&Ra(r)===a,d=Oa(r,!1),b=s(()=>{d=!0,r.destroyed&&(h=!1),!(h&&(!r.readable||o))&&(!o||m)&&t.call(r)},"onfinish"),m=Pa(r,!1),g=s(()=>{m=!0,r.destroyed&&(h=!1),!(h&&(!r.writable||a))&&(!a||d)&&t.call(r)},"onend"),y=s(z=>{t.call(r,z)},"onerror"),v=Rp(r),S=s(()=>{v=!0;let z=Da(r)||Ia(r);if(z&&typeof z!="boolean")return t.call(r,z);if(o&&!m&&Jn(r,!0)&&!Pa(r,!1))return t.call(r,new Ca);if(a&&!d&&!Oa(r,!1))return t.call(r,new Ca);t.call(r)},"onclose"),C=s(()=>{v=!0;let z=Da(r)||Ia(r);if(z&&typeof z!="boolean")return t.call(r,z);t.call(r)},"onclosed"),B=s(()=>{r.req.on("finish",b)},"onrequest");Wp(r)?(r.on("complete",b),h||r.on("abort",S),r.req?B():r.on("request",B)):a&&!l&&(r.on("end",u),r.on("close",u)),!h&&typeof r.aborted=="boolean"&&r.on("aborted",S),r.on("end",g),r.on("finish",b),e.error!==!1&&r.on("error",y),r.on("close",S),v?ut.nextTick(S):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?h||ut.nextTick(C):(!o&&(!h||Na(r))&&(d||La(r)===!1)||!a&&(!h||La(r))&&(m||Na(r)===!1)||c&&r.req&&r.aborted)&&ut.nextTick(C);let A=s(()=>{t=eo,r.removeListener("aborted",S),r.removeListener("complete",b),r.removeListener("abort",S),r.removeListener("request",B),r.req&&r.req.removeListener("finish",b),r.removeListener("end",u),r.removeListener("close",u),r.removeListener("finish",b),r.removeListener("end",g),r.removeListener("error",y),r.removeListener("close",S)},"cleanup");if(e.signal&&!v){let z=s(()=>{let dt=t;A(),dt.call(r,new Ba(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ut.nextTick(z);else{Gt=Gt||re().addAbortListener;let dt=Gt(e.signal,z),he=t;t=Qn((...Nt)=>{dt[Ua](),he.apply(r,Nt)})}}return A}s(Ma,"eos");function qp(r,e,t){let i=!1,n=eo;if(e.signal)if(n=s(()=>{i=!0,t.call(r,new Ba(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ut.nextTick(n);else{Gt=Gt||re().addAbortListener;let a=Gt(e.signal,n),l=t;t=Qn((...c)=>{a[Ua](),l.apply(r,c)})}let o=s((...a)=>{i||ut.nextTick(()=>t.apply(r,a))},"resolverFn");return Lp(r[Mp].promise,o,o),eo}s(qp,"eosWeb");function jp(r,e){var t;let i=!1;return e===null&&(e=Zn),(t=e)!==null&&t!==void 0&&t.cleanup&&(Pp(e.cleanup,"cleanup"),i=e.cleanup),new Ip((n,o)=>{let a=Ma(r,e,l=>{i&&a(),l?o(l):n()})})}s(jp,"finished");to.exports=Ma;to.exports.finished=jp});var Et=T((WS,Ha)=>{"use strict";var Ie=ct(),{aggregateTwoErrors:$p,codes:{ERR_MULTIPLE_CALLBACK:Vp},AbortError:zp}=oe(),{Symbol:ja}=O(),{kIsDestroyed:Kp,isDestroyed:Hp,isFinished:Yp,isServerRequest:Gp}=Pe(),$a=ja("kDestroy"),ro=ja("kConstruct");function Va(r,e,t){r&&(r.stack,e&&!e.errored&&(e.errored=r),t&&!t.errored&&(t.errored=r))}s(Va,"checkError");function Xp(r,e){let t=this._readableState,i=this._writableState,n=i||t;return i!=null&&i.destroyed||t!=null&&t.destroyed?(typeof e=="function"&&e(),this):(Va(r,i,t),i&&(i.destroyed=!0),t&&(t.destroyed=!0),n.constructed?Wa(this,r,e):this.once($a,function(o){Wa(this,$p(o,r),e)}),this)}s(Xp,"destroy");function Wa(r,e,t){let i=!1;function n(o){if(i)return;i=!0;let a=r._readableState,l=r._writableState;Va(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof t=="function"&&t(o),o?Ie.nextTick(Jp,r,o):Ie.nextTick(za,r)}s(n,"onDestroy");try{r._destroy(e||null,n)}catch(o){n(o)}}s(Wa,"_destroy");function Jp(r,e){io(r,e),za(r)}s(Jp,"emitErrorCloseNT");function za(r){let e=r._readableState,t=r._writableState;t&&(t.closeEmitted=!0),e&&(e.closeEmitted=!0),(t!=null&&t.emitClose||e!=null&&e.emitClose)&&r.emit("close")}s(za,"emitCloseNT");function io(r,e){let t=r._readableState,i=r._writableState;i!=null&&i.errorEmitted||t!=null&&t.errorEmitted||(i&&(i.errorEmitted=!0),t&&(t.errorEmitted=!0),r.emit("error",e))}s(io,"emitErrorNT");function Zp(){let r=this._readableState,e=this._writableState;r&&(r.constructed=!0,r.closed=!1,r.closeEmitted=!1,r.destroyed=!1,r.errored=null,r.errorEmitted=!1,r.reading=!1,r.ended=r.readable===!1,r.endEmitted=r.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(Zp,"undestroy");function no(r,e,t){let i=r._readableState,n=r._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?r.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),t?Ie.nextTick(io,r,e):io(r,e))}s(no,"errorOrDestroy");function Qp(r,e){if(typeof r._construct!="function")return;let t=r._readableState,i=r._writableState;t&&(t.constructed=!1),i&&(i.constructed=!1),r.once(ro,e),!(r.listenerCount(ro)>1)&&Ie.nextTick(ey,r)}s(Qp,"construct");function ey(r){let e=!1;function t(i){if(e){no(r,i??new Vp);return}e=!0;let n=r._readableState,o=r._writableState,a=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),a.destroyed?r.emit($a,i):i?no(r,i,!0):Ie.nextTick(ty,r)}s(t,"onConstruct");try{r._construct(i=>{Ie.nextTick(t,i)})}catch(i){Ie.nextTick(t,i)}}s(ey,"constructNT");function ty(r){r.emit(ro)}s(ty,"emitConstructNT");function qa(r){return r?.setHeader&&typeof r.abort=="function"}s(qa,"isRequest");function Ka(r){r.emit("close")}s(Ka,"emitCloseLegacy");function ry(r,e){r.emit("error",e),Ie.nextTick(Ka,r)}s(ry,"emitErrorCloseLegacy");function iy(r,e){!r||Hp(r)||(!e&&!Yp(r)&&(e=new zp),Gp(r)?(r.socket=null,r.destroy(e)):qa(r)?r.abort():qa(r.req)?r.req.abort():typeof r.destroy=="function"?r.destroy(e):typeof r.close=="function"?r.close():e?Ie.nextTick(ry,r,e):Ie.nextTick(Ka,r),r.destroyed||(r[Kp]=!0))}s(iy,"destroyer");Ha.exports={construct:Qp,destroyer:iy,destroy:Xp,undestroy:Zp,errorOrDestroy:no}});var yi=T((jS,Ga)=>{"use strict";var{ArrayIsArray:ny,ObjectSetPrototypeOf:Ya}=O(),{EventEmitter:hi}=yr();function pi(r){hi.call(this,r)}s(pi,"Stream");Ya(pi.prototype,hi.prototype);Ya(pi,hi);pi.prototype.pipe=function(r,e){let t=this;function i(h){r.writable&&r.write(h)===!1&&t.pause&&t.pause()}s(i,"ondata"),t.on("data",i);function n(){t.readable&&t.resume&&t.resume()}s(n,"ondrain"),r.on("drain",n),!r._isStdio&&(!e||e.end!==!1)&&(t.on("end",a),t.on("close",l));let o=!1;function a(){o||(o=!0,r.end())}s(a,"onend");function l(){o||(o=!0,typeof r.destroy=="function"&&r.destroy())}s(l,"onclose");function c(h){u(),hi.listenerCount(this,"error")===0&&this.emit("error",h)}s(c,"onerror"),oo(t,"error",c),oo(r,"error",c);function u(){t.removeListener("data",i),r.removeListener("drain",n),t.removeListener("end",a),t.removeListener("close",l),t.removeListener("error",c),r.removeListener("error",c),t.removeListener("end",u),t.removeListener("close",u),r.removeListener("close",u)}return s(u,"cleanup"),t.on("end",u),t.on("close",u),r.on("close",u),r.emit("pipe",t),r};function oo(r,e,t){if(typeof r.prependListener=="function")return r.prependListener(e,t);!r._events||!r._events[e]?r.on(e,t):ny(r._events[e])?r._events[e].unshift(t):r._events[e]=[t,r._events[e]]}s(oo,"prependListener");Ga.exports={Stream:pi,prependListener:oo}});var mr=T((VS,mi)=>{"use strict";var{SymbolDispose:oy}=O(),{AbortError:Xa,codes:sy}=oe(),{isNodeStream:Ja,isWebStream:ay,kControllerErrorFunction:ly}=Pe(),cy=$e(),{ERR_INVALID_ARG_TYPE:Za}=sy,so,uy=s((r,e)=>{if(typeof r!="object"||!("aborted"in r))throw new Za(e,"AbortSignal",r)},"validateAbortSignal");mi.exports.addAbortSignal=s(function(e,t){if(uy(e,"signal"),!Ja(t)&&!ay(t))throw new Za("stream",["ReadableStream","WritableStream","Stream"],t);return mi.exports.addAbortSignalNoValidate(e,t)},"addAbortSignal");mi.exports.addAbortSignalNoValidate=function(r,e){if(typeof r!="object"||!("aborted"in r))return e;let t=Ja(e)?()=>{e.destroy(new Xa(void 0,{cause:r.reason}))}:()=>{e[ly](new Xa(void 0,{cause:r.reason}))};if(r.aborted)t();else{so=so||re().addAbortListener;let i=so(r,t);cy(e,i[oy])}return e}});var tl=T((HS,el)=>{"use strict";var{StringPrototypeSlice:Qa,SymbolIterator:fy,TypedArrayPrototypeSet:bi,Uint8Array:dy}=O(),{Buffer:ao}=We(),{inspect:hy}=re();el.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++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 t=this.head,i=""+t.data;for(;(t=t.next)!==null;)i+=e+t.data;return i}concat(e){if(this.length===0)return ao.alloc(0);let t=ao.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)bi(t,i.data,n),n+=i.data.length,i=i.next;return t}consume(e,t){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[fy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",i=this.head,n=0;do{let o=i.data;if(e>o.length)t+=o,e-=o.length;else{e===o.length?(t+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(t+=Qa(o,0,e),this.head=i,i.data=Qa(o,e));break}++n}while((i=i.next)!==null);return this.length-=n,t}_getBuffer(e){let t=ao.allocUnsafe(e),i=e,n=this.head,o=0;do{let a=n.data;if(e>a.length)bi(t,a,i-e),e-=a.length;else{e===a.length?(bi(t,a,i-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(bi(t,new dy(a.buffer,a.byteOffset,e),i-e),this.head=n,n.data=a.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return hy(this,{...t,depth:0,customInspect:!1})}},"BufferList")});var br=T((GS,ol)=>{"use strict";var{MathFloor:py,NumberIsInteger:yy}=O(),{validateInteger:my}=Ht(),{ERR_INVALID_ARG_VALUE:by}=oe().codes,rl=16*1024,il=16;function gy(r,e,t){return r.highWaterMark!=null?r.highWaterMark:e?r[t]:null}s(gy,"highWaterMarkFrom");function nl(r){return r?il:rl}s(nl,"getDefaultHighWaterMark");function wy(r,e){my(e,"value",0),r?il=e:rl=e}s(wy,"setDefaultHighWaterMark");function Sy(r,e,t,i){let n=gy(e,i,t);if(n!=null){if(!yy(n)||n<0){let o=i?`options.${t}`:"options.highWaterMark";throw new by(o,n)}return py(n)}return nl(r.objectMode)}s(Sy,"getHighWaterMark");ol.exports={getHighWaterMark:Sy,getDefaultHighWaterMark:nl,setDefaultHighWaterMark:wy}});var ll=T((lo,al)=>{var gi=We(),Le=gi.Buffer;function sl(r,e){for(var t in r)e[t]=r[t]}s(sl,"copyProps");Le.from&&Le.alloc&&Le.allocUnsafe&&Le.allocUnsafeSlow?al.exports=gi:(sl(gi,lo),lo.Buffer=xt);function xt(r,e,t){return Le(r,e,t)}s(xt,"SafeBuffer");xt.prototype=Object.create(Le.prototype);sl(Le,xt);xt.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Le(r,e,t)};xt.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=Le(r);return e!==void 0?typeof t=="string"?i.fill(e,t):i.fill(e):i.fill(0),i};xt.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Le(r)};xt.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return gi.SlowBuffer(r)}});var fl=T(ul=>{"use strict";var uo=ll().Buffer,cl=uo.isEncoding||function(r){switch(r=""+r,r&&r.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 _y(r){if(!r)return"utf8";for(var e;;)switch(r){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 r;default:if(e)return;r=(""+r).toLowerCase(),e=!0}}s(_y,"_normalizeEncoding");function Ey(r){var e=_y(r);if(typeof e!="string"&&(uo.isEncoding===cl||!cl(r)))throw new Error("Unknown encoding: "+r);return e||r}s(Ey,"normalizeEncoding");ul.StringDecoder=gr;function gr(r){this.encoding=Ey(r);var e;switch(this.encoding){case"utf16le":this.text=Ty,this.end=Cy,e=4;break;case"utf8":this.fillLast=ky,e=4;break;case"base64":this.text=Ny,this.end=Py,e=3;break;default:this.write=Iy,this.end=Ly;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=uo.allocUnsafe(e)}s(gr,"StringDecoder");gr.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(r),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<r.length?e?e+this.text(r,t):this.text(r,t):e||""};gr.prototype.end=Fy;gr.prototype.text=Ay;gr.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};function co(r){return r<=127?0:r>>5===6?2:r>>4===14?3:r>>3===30?4:r>>6===2?-1:-2}s(co,"utf8CheckByte");function xy(r,e,t){var i=e.length-1;if(i<t)return 0;var n=co(e[i]);return n>=0?(n>0&&(r.lastNeed=n-1),n):--i<t||n===-2?0:(n=co(e[i]),n>=0?(n>0&&(r.lastNeed=n-2),n):--i<t||n===-2?0:(n=co(e[i]),n>=0?(n>0&&(n===2?n=0:r.lastNeed=n-3),n):0))}s(xy,"utf8CheckIncomplete");function vy(r,e,t){if((e[0]&192)!==128)return r.lastNeed=0,"\uFFFD";if(r.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return r.lastNeed=1,"\uFFFD";if(r.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return r.lastNeed=2,"\uFFFD"}}s(vy,"utf8CheckExtraBytes");function ky(r){var e=this.lastTotal-this.lastNeed,t=vy(this,r,e);if(t!==void 0)return t;if(this.lastNeed<=r.length)return r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length}s(ky,"utf8FillLast");function Ay(r,e){var t=xy(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var i=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,i),r.toString("utf8",e,i)}s(Ay,"utf8Text");function Fy(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e}s(Fy,"utf8End");function Ty(r,e){if((r.length-e)%2===0){var t=r.toString("utf16le",e);if(t){var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}s(Ty,"utf16Text");function Cy(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}s(Cy,"utf16End");function Ny(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}s(Ny,"base64Text");function Py(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Py,"base64End");function Iy(r){return r.toString(this.encoding)}s(Iy,"simpleWrite");function Ly(r){return r&&r.length?this.write(r):""}s(Ly,"simpleEnd")});var fo=T((e_,yl)=>{"use strict";var dl=ct(),{PromisePrototypeThen:Ry,SymbolAsyncIterator:hl,SymbolIterator:pl}=O(),{Buffer:Oy}=We(),{ERR_INVALID_ARG_TYPE:Dy,ERR_STREAM_NULL_VALUES:By}=oe().codes;function Uy(r,e,t){let i;if(typeof e=="string"||e instanceof Oy)return new r({objectMode:!0,...t,read(){this.push(e),this.push(null)}});let n;if(e&&e[hl])n=!0,i=e[hl]();else if(e&&e[pl])n=!1,i=e[pl]();else throw new Dy("iterable",["Iterable"],e);let o=new r({objectMode:!0,highWaterMark:1,...t}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(u,h){Ry(l(u),()=>dl.nextTick(h,u),d=>dl.nextTick(h,d||u))};async function l(u){let h=u!=null,d=typeof i.throw=="function";if(h&&d){let{value:b,done:m}=await i.throw(u);if(await b,m)return}if(typeof i.return=="function"){let{value:b}=await i.return();await b}}s(l,"close");async function c(){for(;;){try{let{value:u,done:h}=n?await i.next():i.next();if(h)o.push(null);else{let d=u&&typeof u.then=="function"?await u:u;if(d===null)throw a=!1,new By;if(o.push(d))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(c,"next"),o}s(Uy,"from");yl.exports=Uy});var Sr=T((r_,Ll)=>{var Ee=ct(),{ArrayPrototypeIndexOf:My,NumberIsInteger:Wy,NumberIsNaN:qy,NumberParseInt:jy,ObjectDefineProperties:So,ObjectKeys:$y,ObjectSetPrototypeOf:gl,Promise:wl,SafeSet:Vy,SymbolAsyncDispose:zy,SymbolAsyncIterator:Ky,Symbol:Hy}=O();Ll.exports=E;E.ReadableState=Ei;var{EventEmitter:Yy}=yr(),{Stream:ft,prependListener:Gy}=yi(),{Buffer:ho}=We(),{addAbortSignal:Xy}=mr(),Sl=$e(),k=re().debuglog("stream",r=>{k=r}),Jy=tl(),Zt=Et(),{getHighWaterMark:Zy,getDefaultHighWaterMark:Qy}=br(),{aggregateTwoErrors:ml,codes:{ERR_INVALID_ARG_TYPE:em,ERR_METHOD_NOT_IMPLEMENTED:tm,ERR_OUT_OF_RANGE:rm,ERR_STREAM_PUSH_AFTER_EOF:im,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:nm},AbortError:om}=oe(),{validateObject:sm}=Ht(),vt=Hy("kPaused"),{StringDecoder:_l}=fl(),am=fo();gl(E.prototype,ft.prototype);gl(E,ft);var po=s(()=>{},"nop"),{errorOrDestroy:Xt}=Zt,Jt=1<<0,lm=1<<1,El=1<<2,wr=1<<3,xl=1<<4,wi=1<<5,Si=1<<6,vl=1<<7,cm=1<<8,um=1<<9,fm=1<<10,go=1<<11,wo=1<<12,dm=1<<13,hm=1<<14,pm=1<<15,kl=1<<16,ym=1<<17,mm=1<<18;function K(r){return{enumerable:!1,get(){return(this.state&r)!==0},set(e){e?this.state|=r:this.state&=~r}}}s(K,"makeBitMapDescriptor");So(Ei.prototype,{objectMode:K(Jt),ended:K(lm),endEmitted:K(El),reading:K(wr),constructed:K(xl),sync:K(wi),needReadable:K(Si),emittedReadable:K(vl),readableListening:K(cm),resumeScheduled:K(um),errorEmitted:K(fm),emitClose:K(go),autoDestroy:K(wo),destroyed:K(dm),closed:K(hm),closeEmitted:K(pm),multiAwaitDrain:K(kl),readingMore:K(ym),dataEmitted:K(mm)});function Ei(r,e,t){typeof t!="boolean"&&(t=e instanceof Re()),this.state=go|wo|xl|wi,r&&r.objectMode&&(this.state|=Jt),t&&r&&r.readableObjectMode&&(this.state|=Jt),this.highWaterMark=r?Zy(this,r,"readableHighWaterMark",t):Qy(!1),this.buffer=new Jy,this.length=0,this.pipes=[],this.flowing=null,this[vt]=null,r&&r.emitClose===!1&&(this.state&=~go),r&&r.autoDestroy===!1&&(this.state&=~wo),this.errored=null,this.defaultEncoding=r&&r.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,r&&r.encoding&&(this.decoder=new _l(r.encoding),this.encoding=r.encoding)}s(Ei,"ReadableState");function E(r){if(!(this instanceof E))return new E(r);let e=this instanceof Re();this._readableState=new Ei(r,this,e),r&&(typeof r.read=="function"&&(this._read=r.read),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.construct=="function"&&(this._construct=r.construct),r.signal&&!e&&Xy(r.signal,this)),ft.call(this,r),Zt.construct(this,()=>{this._readableState.needReadable&&_i(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=Zt.destroy;E.prototype._undestroy=Zt.undestroy;E.prototype._destroy=function(r,e){e(r)};E.prototype[Yy.captureRejectionSymbol]=function(r){this.destroy(r)};E.prototype[zy]=function(){let r;return this.destroyed||(r=this.readableEnded?null:new om,this.destroy(r)),new wl((e,t)=>Sl(this,i=>i&&i!==r?t(i):e(null)))};E.prototype.push=function(r,e){return Al(this,r,e,!1)};E.prototype.unshift=function(r,e){return Al(this,r,e,!0)};function Al(r,e,t,i){k("readableAddChunk",e);let n=r._readableState,o;if(n.state&Jt||(typeof e=="string"?(t=t||n.defaultEncoding,n.encoding!==t&&(i&&n.encoding?e=ho.from(e,t).toString(n.encoding):(e=ho.from(e,t),t=""))):e instanceof ho?t="":ft._isUint8Array(e)?(e=ft._uint8ArrayToBuffer(e),t=""):e!=null&&(o=new em("chunk",["string","Buffer","Uint8Array"],e))),o)Xt(r,o);else if(e===null)n.state&=~wr,wm(r,n);else if(n.state&Jt||e&&e.length>0)if(i)if(n.state&El)Xt(r,new nm);else{if(n.destroyed||n.errored)return!1;yo(r,n,e,!0)}else if(n.ended)Xt(r,new im);else{if(n.destroyed||n.errored)return!1;n.state&=~wr,n.decoder&&!t?(e=n.decoder.write(e),n.objectMode||e.length!==0?yo(r,n,e,!1):_i(r,n)):yo(r,n,e,!1)}else i||(n.state&=~wr,_i(r,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}s(Al,"readableAddChunk");function yo(r,e,t,i){e.flowing&&e.length===0&&!e.sync&&r.listenerCount("data")>0?(e.state&kl?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,r.emit("data",t)):(e.length+=e.objectMode?1:t.length,i?e.buffer.unshift(t):e.buffer.push(t),e.state&Si&&xi(r)),_i(r,e)}s(yo,"addChunk");E.prototype.isPaused=function(){let r=this._readableState;return r[vt]===!0||r.flowing===!1};E.prototype.setEncoding=function(r){let e=new _l(r);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let t=this._readableState.buffer,i="";for(let n of t)i+=e.write(n);return t.clear(),i!==""&&t.push(i),this._readableState.length=i.length,this};var bm=1073741824;function gm(r){if(r>bm)throw new rm("size","<= 1GiB",r);return r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++,r}s(gm,"computeNewHighWaterMark");function bl(r,e){return r<=0||e.length===0&&e.ended?0:e.state&Jt?1:qy(r)?e.flowing&&e.length?e.buffer.first().length:e.length:r<=e.length?r:e.ended?e.length:0}s(bl,"howMuchToRead");E.prototype.read=function(r){k("read",r),r===void 0?r=NaN:Wy(r)||(r=jy(r,10));let e=this._readableState,t=r;if(r>e.highWaterMark&&(e.highWaterMark=gm(r)),r!==0&&(e.state&=~vl),r===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?mo(this):xi(this),null;if(r=bl(r,e),r===0&&e.ended)return e.length===0&&mo(this),null;let i=(e.state&Si)!==0;if(k("need readable",i),(e.length===0||e.length-r<e.highWaterMark)&&(i=!0,k("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,k("reading, ended or constructing",i);else if(i){k("do read"),e.state|=wr|wi,e.length===0&&(e.state|=Si);try{this._read(e.highWaterMark)}catch(o){Xt(this,o)}e.state&=~wi,e.reading||(r=bl(t,e))}let n;return r>0?n=Pl(r,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,r=0):(e.length-=r,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),t!==r&&e.ended&&mo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function wm(r,e){if(k("onEofChunk"),!e.ended){if(e.decoder){let t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?xi(r):(e.needReadable=!1,e.emittedReadable=!0,Fl(r))}}s(wm,"onEofChunk");function xi(r){let e=r._readableState;k("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(k("emitReadable",e.flowing),e.emittedReadable=!0,Ee.nextTick(Fl,r))}s(xi,"emitReadable");function Fl(r){let e=r._readableState;k("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(r.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Cl(r)}s(Fl,"emitReadable_");function _i(r,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ee.nextTick(Sm,r,e))}s(_i,"maybeReadMore");function Sm(r,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let t=e.length;if(k("maybeReadMore read 0"),r.read(0),t===e.length)break}e.readingMore=!1}s(Sm,"maybeReadMore_");E.prototype._read=function(r){throw new tm("_read()")};E.prototype.pipe=function(r,e){let t=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new Vy(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(r),k("pipe count=%d opts=%j",i.pipes.length,e);let o=(!e||e.end!==!1)&&r!==Ee.stdout&&r!==Ee.stderr?l:v;i.endEmitted?Ee.nextTick(o):t.once("end",o),r.on("unpipe",a);function a(S,C){k("onunpipe"),S===t&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,h())}s(a,"onunpipe");function l(){k("onend"),r.end()}s(l,"onend");let c,u=!1;function h(){k("cleanup"),r.removeListener("close",g),r.removeListener("finish",y),c&&r.removeListener("drain",c),r.removeListener("error",m),r.removeListener("unpipe",a),t.removeListener("end",l),t.removeListener("end",v),t.removeListener("data",b),u=!0,c&&i.awaitDrainWriters&&(!r._writableState||r._writableState.needDrain)&&c()}s(h,"cleanup");function d(){u||(i.pipes.length===1&&i.pipes[0]===r?(k("false write response, pause",0),i.awaitDrainWriters=r,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(r)&&(k("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(r)),t.pause()),c||(c=_m(t,r),r.on("drain",c))}s(d,"pause"),t.on("data",b);function b(S){k("ondata");let C=r.write(S);k("dest.write",C),C===!1&&d()}s(b,"ondata");function m(S){if(k("onerror",S),v(),r.removeListener("error",m),r.listenerCount("error")===0){let C=r._writableState||r._readableState;C&&!C.errorEmitted?Xt(r,S):r.emit("error",S)}}s(m,"onerror"),Gy(r,"error",m);function g(){r.removeListener("finish",y),v()}s(g,"onclose"),r.once("close",g);function y(){k("onfinish"),r.removeListener("close",g),v()}s(y,"onfinish"),r.once("finish",y);function v(){k("unpipe"),t.unpipe(r)}return s(v,"unpipe"),r.emit("pipe",t),r.writableNeedDrain===!0?d():i.flowing||(k("pipe resume"),t.resume()),r};function _m(r,e){return s(function(){let i=r._readableState;i.awaitDrainWriters===e?(k("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(k("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&r.listenerCount("data")&&r.resume()},"pipeOnDrainFunctionResult")}s(_m,"pipeOnDrain");E.prototype.unpipe=function(r){let e=this._readableState,t={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!r){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 i=My(e.pipes,r);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),r.emit("unpipe",this,t),this)};E.prototype.on=function(r,e){let t=ft.prototype.on.call(this,r,e),i=this._readableState;return r==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):r==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,k("on readable",i.length,i.reading),i.length?xi(this):i.reading||Ee.nextTick(Em,this)),t};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(r,e){let t=ft.prototype.removeListener.call(this,r,e);return r==="readable"&&Ee.nextTick(Tl,this),t};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(r){let e=ft.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&Ee.nextTick(Tl,this),e};function Tl(r){let e=r._readableState;e.readableListening=r.listenerCount("readable")>0,e.resumeScheduled&&e[vt]===!1?e.flowing=!0:r.listenerCount("data")>0?r.resume():e.readableListening||(e.flowing=null)}s(Tl,"updateReadableListening");function Em(r){k("readable nexttick read 0"),r.read(0)}s(Em,"nReadingNextTick");E.prototype.resume=function(){let r=this._readableState;return r.flowing||(k("resume"),r.flowing=!r.readableListening,xm(this,r)),r[vt]=!1,this};function xm(r,e){e.resumeScheduled||(e.resumeScheduled=!0,Ee.nextTick(vm,r,e))}s(xm,"resume");function vm(r,e){k("resume",e.reading),e.reading||r.read(0),e.resumeScheduled=!1,r.emit("resume"),Cl(r),e.flowing&&!e.reading&&r.read(0)}s(vm,"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[vt]=!0,this};function Cl(r){let e=r._readableState;for(k("flow",e.flowing);e.flowing&&r.read()!==null;);}s(Cl,"flow");E.prototype.wrap=function(r){let e=!1;r.on("data",i=>{!this.push(i)&&r.pause&&(e=!0,r.pause())}),r.on("end",()=>{this.push(null)}),r.on("error",i=>{Xt(this,i)}),r.on("close",()=>{this.destroy()}),r.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&r.resume&&(e=!1,r.resume())};let t=$y(r);for(let i=1;i<t.length;i++){let n=t[i];this[n]===void 0&&typeof r[n]=="function"&&(this[n]=r[n].bind(r))}return this};E.prototype[Ky]=function(){return Nl(this)};E.prototype.iterator=function(r){return r!==void 0&&sm(r,"options"),Nl(this,r)};function Nl(r,e){typeof r.read!="function"&&(r=E.wrap(r,{objectMode:!0}));let t=km(r,e);return t.stream=r,t}s(Nl,"streamToAsyncIterator");async function*km(r,e){let t=po;function i(a){this===r?(t(),t=po):t=a}s(i,"next"),r.on("readable",i);let n,o=Sl(r,{writable:!1},a=>{n=a?ml(n,a):null,t(),t=po});try{for(;;){let a=r.destroyed?null:r.read();if(a!==null)yield a;else{if(n)throw n;if(n===null)return;await new wl(i)}}}catch(a){throw n=ml(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||r._readableState.autoDestroy)?Zt.destroyer(r,null):(r.off("readable",i),o())}}s(km,"createAsyncIterator");So(E.prototype,{readable:{__proto__:null,get(){let r=this._readableState;return!!r&&r.readable!==!1&&!r.destroyed&&!r.errorEmitted&&!r.endEmitted},set(r){this._readableState&&(this._readableState.readable=!!r)}},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(r){this._readableState&&(this._readableState.flowing=r)}},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(r){this._readableState&&(this._readableState.destroyed=r)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});So(Ei.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[vt]!==!1},set(r){this[vt]=!!r}}});E._fromList=Pl;function Pl(r,e){if(e.length===0)return null;let t;return e.objectMode?t=e.buffer.shift():!r||r>=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.first():t=e.buffer.concat(e.length),e.buffer.clear()):t=e.buffer.consume(r,e.decoder),t}s(Pl,"fromList");function mo(r){let e=r._readableState;k("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ee.nextTick(Am,e,r))}s(mo,"endReadable");function Am(r,e){if(k("endReadableNT",r.endEmitted,r.length),!r.errored&&!r.closeEmitted&&!r.endEmitted&&r.length===0){if(r.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)Ee.nextTick(Fm,e);else if(r.autoDestroy){let t=e._writableState;(!t||t.autoDestroy&&(t.finished||t.writable===!1))&&e.destroy()}}}s(Am,"endReadableNT");function Fm(r){r.writable&&!r.writableEnded&&!r.destroyed&&r.end()}s(Fm,"endWritableNT");E.from=function(r,e){return am(E,r,e)};var bo;function Il(){return bo===void 0&&(bo={}),bo}s(Il,"lazyWebStreams");E.fromWeb=function(r,e){return Il().newStreamReadableFromReadableStream(r,e)};E.toWeb=function(r,e){return Il().newReadableStreamFromStreamReadable(r,e)};E.wrap=function(r,e){var t,i;return new E({objectMode:(t=(i=r.readableObjectMode)!==null&&i!==void 0?i:r.objectMode)!==null&&t!==void 0?t:!0,...e,destroy(n,o){Zt.destroyer(r,n),o(n)}}).wrap(r)}});var Ti=T((n_,zl)=>{var kt=ct(),{ArrayPrototypeSlice:Dl,Error:Tm,FunctionPrototypeSymbolHasInstance:Bl,ObjectDefineProperty:Ul,ObjectDefineProperties:Cm,ObjectSetPrototypeOf:Ml,StringPrototypeToLowerCase:Nm,Symbol:Pm,SymbolHasInstance:Im}=O();zl.exports=D;D.WritableState=xr;var{EventEmitter:Lm}=yr(),_r=yi().Stream,{Buffer:vi}=We(),Fi=Et(),{addAbortSignal:Rm}=mr(),{getHighWaterMark:Om,getDefaultHighWaterMark:Dm}=br(),{ERR_INVALID_ARG_TYPE:Bm,ERR_METHOD_NOT_IMPLEMENTED:Um,ERR_MULTIPLE_CALLBACK:Wl,ERR_STREAM_CANNOT_PIPE:Mm,ERR_STREAM_DESTROYED:Er,ERR_STREAM_ALREADY_FINISHED:Wm,ERR_STREAM_NULL_VALUES:qm,ERR_STREAM_WRITE_AFTER_END:jm,ERR_UNKNOWN_ENCODING:ql}=oe().codes,{errorOrDestroy:Qt}=Fi;Ml(D.prototype,_r.prototype);Ml(D,_r);function xo(){}s(xo,"nop");var er=Pm("kOnFinished");function xr(r,e,t){typeof t!="boolean"&&(t=e instanceof Re()),this.objectMode=!!(r&&r.objectMode),t&&(this.objectMode=this.objectMode||!!(r&&r.writableObjectMode)),this.highWaterMark=r?Om(this,r,"writableHighWaterMark",t):Dm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(r&&r.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=r&&r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Vm.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Ai(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!r||r.emitClose!==!1,this.autoDestroy=!r||r.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[er]=[]}s(xr,"WritableState");function Ai(r){r.buffered=[],r.bufferedIndex=0,r.allBuffers=!0,r.allNoop=!0}s(Ai,"resetBuffer");xr.prototype.getBuffer=s(function(){return Dl(this.buffered,this.bufferedIndex)},"getBuffer");Ul(xr.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function D(r){let e=this instanceof Re();if(!e&&!Bl(D,this))return new D(r);this._writableState=new xr(r,this,e),r&&(typeof r.write=="function"&&(this._write=r.write),typeof r.writev=="function"&&(this._writev=r.writev),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.final=="function"&&(this._final=r.final),typeof r.construct=="function"&&(this._construct=r.construct),r.signal&&Rm(r.signal,this)),_r.call(this,r),Fi.construct(this,()=>{let t=this._writableState;t.writing||ko(this,t),Ao(this,t)})}s(D,"Writable");Ul(D,Im,{__proto__:null,value:function(r){return Bl(this,r)?!0:this!==D?!1:r&&r._writableState instanceof xr}});D.prototype.pipe=function(){Qt(this,new Mm)};function jl(r,e,t,i){let n=r._writableState;if(typeof t=="function")i=t,t=n.defaultEncoding;else{if(!t)t=n.defaultEncoding;else if(t!=="buffer"&&!vi.isEncoding(t))throw new ql(t);typeof i!="function"&&(i=xo)}if(e===null)throw new qm;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=vi.from(e,t),t="buffer");else if(e instanceof vi)t="buffer";else if(_r._isUint8Array(e))e=_r._uint8ArrayToBuffer(e),t="buffer";else throw new Bm("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new jm:n.destroyed&&(o=new Er("write")),o?(kt.nextTick(i,o),Qt(r,o,!0),o):(n.pendingcb++,$m(r,n,e,t,i))}s(jl,"_write");D.prototype.write=function(r,e,t){return jl(this,r,e,t)===!0};D.prototype.cork=function(){this._writableState.corked++};D.prototype.uncork=function(){let r=this._writableState;r.corked&&(r.corked--,r.writing||ko(this,r))};D.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Nm(e)),!vi.isEncoding(e))throw new ql(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function $m(r,e,t,i,n){let o=e.objectMode?1:t.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:t,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==xo&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,r._write(t,i,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s($m,"writeOrBuffer");function Rl(r,e,t,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Er("write")):t?r._writev(n,e.onwrite):r._write(n,o,e.onwrite),e.sync=!1}s(Rl,"doWrite");function Ol(r,e,t,i){--e.pendingcb,i(t),vo(e),Qt(r,t)}s(Ol,"onwriteError");function Vm(r,e){let t=r._writableState,i=t.sync,n=t.writecb;if(typeof n!="function"){Qt(r,new Wl);return}t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0,e?(e.stack,t.errored||(t.errored=e),r._readableState&&!r._readableState.errored&&(r._readableState.errored=e),i?kt.nextTick(Ol,r,t,e,n):Ol(r,t,e,n)):(t.buffered.length>t.bufferedIndex&&ko(r,t),i?t.afterWriteTickInfo!==null&&t.afterWriteTickInfo.cb===n?t.afterWriteTickInfo.count++:(t.afterWriteTickInfo={count:1,cb:n,stream:r,state:t},kt.nextTick(zm,t.afterWriteTickInfo)):$l(r,t,1,n))}s(Vm,"onwrite");function zm({stream:r,state:e,count:t,cb:i}){return e.afterWriteTickInfo=null,$l(r,e,t,i)}s(zm,"afterWriteTick");function $l(r,e,t,i){for(!e.ending&&!r.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,r.emit("drain"));t-- >0;)e.pendingcb--,i();e.destroyed&&vo(e),Ao(r,e)}s($l,"afterWrite");function vo(r){if(r.writing)return;for(let n=r.bufferedIndex;n<r.buffered.length;++n){var e;let{chunk:o,callback:a}=r.buffered[n],l=r.objectMode?1:o.length;r.length-=l,a((e=r.errored)!==null&&e!==void 0?e:new Er("write"))}let t=r[er].splice(0);for(let n=0;n<t.length;n++){var i;t[n]((i=r.errored)!==null&&i!==void 0?i:new Er("end"))}Ai(r)}s(vo,"errorBuffer");function ko(r,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:t,bufferedIndex:i,objectMode:n}=e,o=t.length-i;if(!o)return;let a=i;if(e.bufferProcessing=!0,o>1&&r._writev){e.pendingcb-=o-1;let l=e.allNoop?xo:u=>{for(let h=a;h<t.length;++h)t[h].callback(u)},c=e.allNoop&&a===0?t:Dl(t,a);c.allBuffers=e.allBuffers,Rl(r,e,!0,e.length,c,"",l),Ai(e)}else{do{let{chunk:l,encoding:c,callback:u}=t[a];t[a++]=null;let h=n?1:l.length;Rl(r,e,!1,h,l,c,u)}while(a<t.length&&!e.writing);a===t.length?Ai(e):a>256?(t.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(ko,"clearBuffer");D.prototype._write=function(r,e,t){if(this._writev)this._writev([{chunk:r,encoding:e}],t);else throw new Um("_write()")};D.prototype._writev=null;D.prototype.end=function(r,e,t){let i=this._writableState;typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null);let n;if(r!=null){let o=jl(this,r,e);o instanceof Tm&&(n=o)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,Ao(this,i,!0),i.ended=!0):i.finished?n=new Wm("end"):i.destroyed&&(n=new Er("end"))),typeof t=="function"&&(n||i.finished?kt.nextTick(t,n):i[er].push(t)),this};function ki(r){return r.ending&&!r.destroyed&&r.constructed&&r.length===0&&!r.errored&&r.buffered.length===0&&!r.finished&&!r.writing&&!r.errorEmitted&&!r.closeEmitted}s(ki,"needFinish");function Km(r,e){let t=!1;function i(n){if(t){Qt(r,n??Wl());return}if(t=!0,e.pendingcb--,n){let o=e[er].splice(0);for(let a=0;a<o.length;a++)o[a](n);Qt(r,n,e.sync)}else ki(e)&&(e.prefinished=!0,r.emit("prefinish"),e.pendingcb++,kt.nextTick(Eo,r,e))}s(i,"onFinish"),e.sync=!0,e.pendingcb++;try{r._final(i)}catch(n){i(n)}e.sync=!1}s(Km,"callFinal");function Hm(r,e){!e.prefinished&&!e.finalCalled&&(typeof r._final=="function"&&!e.destroyed?(e.finalCalled=!0,Km(r,e)):(e.prefinished=!0,r.emit("prefinish")))}s(Hm,"prefinish");function Ao(r,e,t){ki(e)&&(Hm(r,e),e.pendingcb===0&&(t?(e.pendingcb++,kt.nextTick((i,n)=>{ki(n)?Eo(i,n):n.pendingcb--},r,e)):ki(e)&&(e.pendingcb++,Eo(r,e))))}s(Ao,"finishMaybe");function Eo(r,e){e.pendingcb--,e.finished=!0;let t=e[er].splice(0);for(let i=0;i<t.length;i++)t[i]();if(r.emit("finish"),e.autoDestroy){let i=r._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&r.destroy()}}s(Eo,"finish");Cm(D.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(r){this._writableState&&(this._writableState.destroyed=r)}},writable:{__proto__:null,get(){let r=this._writableState;return!!r&&r.writable!==!1&&!r.destroyed&&!r.errored&&!r.ending&&!r.ended},set(r){this._writableState&&(this._writableState.writable=!!r)}},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 r=this._writableState;return r?!r.destroyed&&!r.ending&&r.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 Ym=Fi.destroy;D.prototype.destroy=function(r,e){let t=this._writableState;return!t.destroyed&&(t.bufferedIndex<t.buffered.length||t[er].length)&&kt.nextTick(vo,t),Ym.call(this,r,e),this};D.prototype._undestroy=Fi.undestroy;D.prototype._destroy=function(r,e){e(r)};D.prototype[Lm.captureRejectionSymbol]=function(r){this.destroy(r)};var _o;function Vl(){return _o===void 0&&(_o={}),_o}s(Vl,"lazyWebStreams");D.fromWeb=function(r,e){return Vl().newStreamWritableFromWritableStream(r,e)};D.toWeb=function(r){return Vl().newWritableStreamFromStreamWritable(r)}});var sc=T((s_,oc)=>{var Fo=ct(),Gm=We(),{isReadable:Xm,isWritable:Jm,isIterable:Kl,isNodeStream:Zm,isReadableNodeStream:Hl,isWritableNodeStream:Yl,isDuplexNodeStream:Qm,isReadableStream:Gl,isWritableStream:Xl}=Pe(),Jl=$e(),{AbortError:ic,codes:{ERR_INVALID_ARG_TYPE:eb,ERR_INVALID_RETURN_VALUE:Zl}}=oe(),{destroyer:rr}=Et(),tb=Re(),nc=Sr(),rb=Ti(),{createDeferredPromise:Ql}=re(),ec=fo(),tc=globalThis.Blob||Gm.Blob,ib=s(typeof tc<"u"?function(e){return e instanceof tc}:function(e){return!1},"isBlob"),nb=globalThis.AbortController||Vt().AbortController,{FunctionPrototypeCall:rc}=O(),Ve=class extends tb{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(Ve,"Duplexify");oc.exports=s(function r(e,t){if(Qm(e))return e;if(Hl(e))return tr({readable:e});if(Yl(e))return tr({writable:e});if(Zm(e))return tr({writable:!1,readable:!1});if(Gl(e))return tr({readable:nc.fromWeb(e)});if(Xl(e))return tr({writable:rb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:o,final:a,destroy:l}=ob(e);if(Kl(n))return ec(Ve,n,{objectMode:!0,write:o,final:a,destroy:l});let c=n?.then;if(typeof c=="function"){let u,h=rc(c,n,d=>{if(d!=null)throw new Zl("nully","body",d)},d=>{rr(u,d)});return u=new Ve({objectMode:!0,readable:!1,write:o,final(d){a(async()=>{try{await h,Fo.nextTick(d,null)}catch(b){Fo.nextTick(d,b)}})},destroy:l})}throw new Zl("Iterable, AsyncIterable or AsyncFunction",t,n)}if(ib(e))return r(e.arrayBuffer());if(Kl(e))return ec(Ve,e,{objectMode:!0,writable:!1});if(Gl(e?.readable)&&Xl(e?.writable))return Ve.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?Hl(e?.readable)?e?.readable:r(e.readable):void 0,o=e!=null&&e.writable?Yl(e?.writable)?e?.writable:r(e.writable):void 0;return tr({readable:n,writable:o})}let i=e?.then;if(typeof i=="function"){let n;return rc(i,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{rr(n,o)}),n=new Ve({objectMode:!0,writable:!1,read(){}})}throw new eb(t,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function ob(r){let{promise:e,resolve:t}=Ql(),i=new nb,n=i.signal;return{value:r(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(Fo.nextTick(u),c)return;if(n.aborted)throw new ic(void 0,{cause:n.reason});({promise:e,resolve:t}=Ql()),yield l}}(),{signal:n}),write(a,l,c){let u=t;t=null,u({chunk:a,done:!1,cb:c})},final(a){let l=t;t=null,l({done:!0,cb:a})},destroy(a,l){i.abort(),l(a)}}}s(ob,"fromAsyncGen");function tr(r){let e=r.readable&&typeof r.readable.read!="function"?nc.wrap(r.readable):r.readable,t=r.writable,i=!!Xm(e),n=!!Jm(t),o,a,l,c,u;function h(d){let b=c;c=null,b?b(d):d&&u.destroy(d)}return s(h,"onfinished"),u=new Ve({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(t!=null&&t.writableObjectMode),readable:i,writable:n}),n&&(Jl(t,d=>{n=!1,d&&rr(e,d),h(d)}),u._write=function(d,b,m){t.write(d,b)?m():o=m},u._final=function(d){t.end(),a=d},t.on("drain",function(){if(o){let d=o;o=null,d()}}),t.on("finish",function(){if(a){let d=a;a=null,d()}})),i&&(Jl(e,d=>{i=!1,d&&rr(e,d),h(d)}),e.on("readable",function(){if(l){let d=l;l=null,d()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let d=e.read();if(d===null){l=u._read;return}if(!u.push(d))return}}),u._destroy=function(d,b){!d&&c!==null&&(d=new ic),l=null,o=null,a=null,c===null?b(d):(c=b,rr(t,d),rr(e,d))},u}s(tr,"_duplexify")});var Re=T((l_,cc)=>{"use strict";var{ObjectDefineProperties:sb,ObjectGetOwnPropertyDescriptor:ze,ObjectKeys:ab,ObjectSetPrototypeOf:ac}=O();cc.exports=xe;var No=Sr(),Se=Ti();ac(xe.prototype,No.prototype);ac(xe,No);{let r=ab(Se.prototype);for(let e=0;e<r.length;e++){let t=r[e];xe.prototype[t]||(xe.prototype[t]=Se.prototype[t])}}function xe(r){if(!(this instanceof xe))return new xe(r);No.call(this,r),Se.call(this,r),r?(this.allowHalfOpen=r.allowHalfOpen!==!1,r.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),r.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(xe,"Duplex");sb(xe.prototype,{writable:{__proto__:null,...ze(Se.prototype,"writable")},writableHighWaterMark:{__proto__:null,...ze(Se.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...ze(Se.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...ze(Se.prototype,"writableBuffer")},writableLength:{__proto__:null,...ze(Se.prototype,"writableLength")},writableFinished:{__proto__:null,...ze(Se.prototype,"writableFinished")},writableCorked:{__proto__:null,...ze(Se.prototype,"writableCorked")},writableEnded:{__proto__:null,...ze(Se.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...ze(Se.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(r){this._readableState&&this._writableState&&(this._readableState.destroyed=r,this._writableState.destroyed=r)}}});var To;function lc(){return To===void 0&&(To={}),To}s(lc,"lazyWebStreams");xe.fromWeb=function(r,e){return lc().newStreamDuplexFromReadableWritablePair(r,e)};xe.toWeb=function(r){return lc().newReadableWritablePairFromDuplex(r)};var Co;xe.from=function(r){return Co||(Co=sc()),Co(r,"body")}});var Lo=T((u_,fc)=>{"use strict";var{ObjectSetPrototypeOf:uc,Symbol:lb}=O();fc.exports=Ke;var{ERR_METHOD_NOT_IMPLEMENTED:cb}=oe().codes,Io=Re(),{getHighWaterMark:ub}=br();uc(Ke.prototype,Io.prototype);uc(Ke,Io);var vr=lb("kCallback");function Ke(r){if(!(this instanceof Ke))return new Ke(r);let e=r?ub(this,r,"readableHighWaterMark",!0):null;e===0&&(r={...r,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:r.writableHighWaterMark||0}),Io.call(this,r),this._readableState.sync=!1,this[vr]=null,r&&(typeof r.transform=="function"&&(this._transform=r.transform),typeof r.flush=="function"&&(this._flush=r.flush)),this.on("prefinish",fb)}s(Ke,"Transform");function Po(r){typeof this._flush=="function"&&!this.destroyed?this._flush((e,t)=>{if(e){r?r(e):this.destroy(e);return}t!=null&&this.push(t),this.push(null),r&&r()}):(this.push(null),r&&r())}s(Po,"final");function fb(){this._final!==Po&&Po.call(this)}s(fb,"prefinish");Ke.prototype._final=Po;Ke.prototype._transform=function(r,e,t){throw new cb("_transform()")};Ke.prototype._write=function(r,e,t){let i=this._readableState,n=this._writableState,o=i.length;this._transform(r,e,(a,l)=>{if(a){t(a);return}l!=null&&this.push(l),n.ended||o===i.length||i.length<i.highWaterMark?t():this[vr]=t})};Ke.prototype._read=function(){if(this[vr]){let r=this[vr];this[vr]=null,r()}}});var Oo=T((d_,hc)=>{"use strict";var{ObjectSetPrototypeOf:dc}=O();hc.exports=ir;var Ro=Lo();dc(ir.prototype,Ro.prototype);dc(ir,Ro);function ir(r){if(!(this instanceof ir))return new ir(r);Ro.call(this,r)}s(ir,"PassThrough");ir.prototype._transform=function(r,e,t){t(null,r)}});var Ii=T((p_,gc)=>{var kr=ct(),{ArrayIsArray:db,Promise:hb,SymbolAsyncIterator:pb,SymbolDispose:yb}=O(),Pi=$e(),{once:mb}=re(),bb=Et(),pc=Re(),{aggregateTwoErrors:gb,codes:{ERR_INVALID_ARG_TYPE:Vo,ERR_INVALID_RETURN_VALUE:Do,ERR_MISSING_ARGS:wb,ERR_STREAM_DESTROYED:Sb,ERR_STREAM_PREMATURE_CLOSE:_b},AbortError:Eb}=oe(),{validateFunction:xb,validateAbortSignal:vb}=Ht(),{isIterable:At,isReadable:Bo,isReadableNodeStream:Ni,isNodeStream:yc,isTransformStream:nr,isWebStream:kb,isReadableStream:Uo,isReadableFinished:Ab}=Pe(),Fb=globalThis.AbortController||Vt().AbortController,Mo,Wo,qo;function mc(r,e,t){let i=!1;r.on("close",()=>{i=!0});let n=Pi(r,{readable:e,writable:t},o=>{i=!o});return{destroy:o=>{i||(i=!0,bb.destroyer(r,o||new Sb("pipe")))},cleanup:n}}s(mc,"destroyer");function Tb(r){return xb(r[r.length-1],"streams[stream.length - 1]"),r.pop()}s(Tb,"popCallback");function jo(r){if(At(r))return r;if(Ni(r))return Cb(r);throw new Vo("val",["Readable","Iterable","AsyncIterable"],r)}s(jo,"makeAsyncIterable");async function*Cb(r){Wo||(Wo=Sr()),yield*Wo.prototype[pb].call(r)}s(Cb,"fromReadable");async function Ci(r,e,t,{end:i}){let n,o=null,a=s(u=>{if(u&&(n=u),o){let h=o;o=null,h()}},"resume"),l=s(()=>new hb((u,h)=>{n?h(n):o=s(()=>{n?h(n):u()},"onresolve")}),"wait");e.on("drain",a);let c=Pi(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of r)e.write(u)||await l();i&&(e.end(),await l()),t()}catch(u){t(n!==u?gb(n,u):u)}finally{c(),e.off("drain",a)}}s(Ci,"pumpToNode");async function $o(r,e,t,{end:i}){nr(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of r)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),t()}catch(o){try{await n.abort(o),t(o)}catch(a){t(a)}}}s($o,"pumpToWeb");function Nb(...r){return bc(r,mb(Tb(r)))}s(Nb,"pipeline");function bc(r,e,t){if(r.length===1&&db(r[0])&&(r=r[0]),r.length<2)throw new wb("streams");let i=new Fb,n=i.signal,o=t?.signal,a=[];vb(o,"options.signal");function l(){g(new Eb)}s(l,"abort"),qo=qo||re().addAbortListener;let c;o&&(c=qo(o,l));let u,h,d=[],b=0;function m(B){g(B,--b===0)}s(m,"finish");function g(B,A){var z;if(B&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=B),!(!u&&!A)){for(;d.length;)d.shift()(u);(z=c)===null||z===void 0||z[yb](),i.abort(),A&&(u||a.forEach(dt=>dt()),kr.nextTick(e,u,h))}}s(g,"finishImpl");let y;for(let B=0;B<r.length;B++){let A=r[B],z=B<r.length-1,dt=B>0,he=z||t?.end!==!1,Nt=B===r.length-1;if(yc(A)){let se=function(Be){Be&&Be.name!=="AbortError"&&Be.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Be)};var C=se;if(s(se,"onError"),he){let{destroy:Be,cleanup:Hi}=mc(A,z,dt);d.push(Be),Bo(A)&&Nt&&a.push(Hi)}A.on("error",se),Bo(A)&&Nt&&a.push(()=>{A.removeListener("error",se)})}if(B===0)if(typeof A=="function"){if(y=A({signal:n}),!At(y))throw new Do("Iterable, AsyncIterable or Stream","source",y)}else At(A)||Ni(A)||nr(A)?y=A:y=pc.from(A);else if(typeof A=="function"){if(nr(y)){var v;y=jo((v=y)===null||v===void 0?void 0:v.readable)}else y=jo(y);if(y=A(y,{signal:n}),z){if(!At(y,!0))throw new Do("AsyncIterable",`transform[${B-1}]`,y)}else{var S;Mo||(Mo=Oo());let se=new Mo({objectMode:!0}),Be=(S=y)===null||S===void 0?void 0:S.then;if(typeof Be=="function")b++,Be.call(y,Je=>{h=Je,Je!=null&&se.write(Je),he&&se.end(),kr.nextTick(m)},Je=>{se.destroy(Je),kr.nextTick(m,Je)});else if(At(y,!0))b++,Ci(y,se,m,{end:he});else if(Uo(y)||nr(y)){let Je=y.readable||y;b++,Ci(Je,se,m,{end:he})}else throw new Do("AsyncIterable or Promise","destination",y);y=se;let{destroy:Hi,cleanup:eu}=mc(y,!1,!0);d.push(Hi),Nt&&a.push(eu)}}else if(yc(A)){if(Ni(y)){b+=2;let se=Pb(y,A,m,{end:he});Bo(A)&&Nt&&a.push(se)}else if(nr(y)||Uo(y)){let se=y.readable||y;b++,Ci(se,A,m,{end:he})}else if(At(y))b++,Ci(y,A,m,{end:he});else throw new Vo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=A}else if(kb(A)){if(Ni(y))b++,$o(jo(y),A,m,{end:he});else if(Uo(y)||At(y))b++,$o(y,A,m,{end:he});else if(nr(y))b++,$o(y.readable,A,m,{end:he});else throw new Vo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=A}else y=pc.from(A)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&kr.nextTick(l),y}s(bc,"pipelineImpl");function Pb(r,e,t,{end:i}){let n=!1;if(e.on("close",()=>{n||t(new _b)}),r.pipe(e,{end:!1}),i){let a=function(){n=!0,e.end()};var o=a;s(a,"endFn"),Ab(r)?kr.nextTick(a):r.once("end",a)}else t();return Pi(r,{readable:!0,writable:!1},a=>{let l=r._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?r.once("end",t).once("error",t):t(a)}),Pi(e,{readable:!1,writable:!0},t)}s(Pb,"pipe");gc.exports={pipelineImpl:bc,pipeline:Nb}});var Ko=T((m_,vc)=>{"use strict";var{pipeline:Ib}=Ii(),Li=Re(),{destroyer:Lb}=Et(),{isNodeStream:Ri,isReadable:wc,isWritable:Sc,isWebStream:zo,isTransformStream:Ft,isWritableStream:_c,isReadableStream:Ec}=Pe(),{AbortError:Rb,codes:{ERR_INVALID_ARG_VALUE:xc,ERR_MISSING_ARGS:Ob}}=oe(),Db=$e();vc.exports=s(function(...e){if(e.length===0)throw new Ob("streams");if(e.length===1)return Li.from(e[0]);let t=[...e];if(typeof e[0]=="function"&&(e[0]=Li.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=Li.from(e[m])}for(let m=0;m<e.length;++m)if(!(!Ri(e[m])&&!zo(e[m]))){if(m<e.length-1&&!(wc(e[m])||Ec(e[m])||Ft(e[m])))throw new xc(`streams[${m}]`,t[m],"must be readable");if(m>0&&!(Sc(e[m])||_c(e[m])||Ft(e[m])))throw new xc(`streams[${m}]`,t[m],"must be writable")}let i,n,o,a,l;function c(m){let g=a;a=null,g?g(m):m?l.destroy(m):!b&&!d&&l.destroy()}s(c,"onfinished");let u=e[0],h=Ib(e,c),d=!!(Sc(u)||_c(u)||Ft(u)),b=!!(wc(h)||Ec(h)||Ft(h));if(l=new Li({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(h!=null&&h.readableObjectMode),writable:d,readable:b}),d){if(Ri(u))l._write=function(g,y,v){u.write(g,y)?v():i=v},l._final=function(g){u.end(),n=g},u.on("drain",function(){if(i){let g=i;i=null,g()}});else if(zo(u)){let y=(Ft(u)?u.writable:u).getWriter();l._write=async function(v,S,C){try{await y.ready,y.write(v).catch(()=>{}),C()}catch(B){C(B)}},l._final=async function(v){try{await y.ready,y.close().catch(()=>{}),n=v}catch(S){v(S)}}}let m=Ft(h)?h.readable:h;Db(m,()=>{if(n){let g=n;n=null,g()}})}if(b){if(Ri(h))h.on("readable",function(){if(o){let m=o;o=null,m()}}),h.on("end",function(){l.push(null)}),l._read=function(){for(;;){let m=h.read();if(m===null){o=l._read;return}if(!l.push(m))return}};else if(zo(h)){let g=(Ft(h)?h.readable:h).getReader();l._read=async function(){for(;;)try{let{value:y,done:v}=await g.read();if(!l.push(y))return;if(v){l.push(null);return}}catch{return}}}}return l._destroy=function(m,g){!m&&a!==null&&(m=new Rb),o=null,i=null,n=null,a===null?g(m):(a=g,Ri(h)&&Lb(h,m))},l},"compose")});var Rc=T((g_,Yo)=>{"use strict";var Bb=globalThis.AbortController||Vt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Ub,ERR_INVALID_ARG_TYPE:Ar,ERR_MISSING_ARGS:Mb,ERR_OUT_OF_RANGE:Wb},AbortError:Oe}=oe(),{validateAbortSignal:Tt,validateInteger:kc,validateObject:Ct}=Ht(),qb=O().Symbol("kWeak"),jb=O().Symbol("kResistStopPropagation"),{finished:$b}=$e(),Vb=Ko(),{addAbortSignalNoValidate:zb}=mr(),{isWritable:Kb,isNodeStream:Hb}=Pe(),{deprecate:Yb}=re(),{ArrayPrototypePush:Gb,Boolean:Xb,MathFloor:Ac,Number:Jb,NumberIsNaN:Zb,Promise:Fc,PromiseReject:Tc,PromiseResolve:Qb,PromisePrototypeThen:Cc,Symbol:Pc}=O(),Di=Pc("kEmpty"),Nc=Pc("kEof");function eg(r,e){if(e!=null&&Ct(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),Hb(r)&&!Kb(r))throw new Ub("stream",r,"must be writable");let t=Vb(this,r);return e!=null&&e.signal&&zb(e.signal,t),t}s(eg,"compose");function Bi(r,e){if(typeof r!="function")throw new Ar("fn",["Function","AsyncFunction"],r);e!=null&&Ct(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal");let t=1;e?.concurrency!=null&&(t=Ac(e.concurrency));let i=t-1;return e?.highWaterMark!=null&&(i=Ac(e.highWaterMark)),kc(t,"options.concurrency",1),kc(i,"options.highWaterMark",0),i+=t,s(async function*(){let o=re().AbortSignalAny([e?.signal].filter(Xb)),a=this,l=[],c={signal:o},u,h,d=!1,b=0;function m(){d=!0,g()}s(m,"onCatch");function g(){b-=1,y()}s(g,"afterItemProcessed");function y(){h&&!d&&b<t&&l.length<i&&(h(),h=null)}s(y,"maybeResume");async function v(){try{for await(let S of a){if(d)return;if(o.aborted)throw new Oe;try{if(S=r(S,c),S===Di)continue;S=Qb(S)}catch(C){S=Tc(C)}b+=1,Cc(S,g,m),l.push(S),u&&(u(),u=null),!d&&(l.length>=i||b>=t)&&await new Fc(C=>{h=C})}l.push(Nc)}catch(S){let C=Tc(S);Cc(C,g,m),l.push(C)}finally{d=!0,u&&(u(),u=null)}}s(v,"pump"),v();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===Nc)return;if(o.aborted)throw new Oe;S!==Di&&(yield S),l.shift(),y()}await new Fc(S=>{u=S})}}finally{d=!0,h&&(h(),h=null)}},"map").call(this)}s(Bi,"map");function tg(r=void 0){return r!=null&&Ct(r,"options"),r?.signal!=null&&Tt(r.signal,"options.signal"),s(async function*(){let t=0;for await(let n of this){var i;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted)throw new Oe({cause:r.signal.reason});yield[t++,n]}},"asIndexedPairs").call(this)}s(tg,"asIndexedPairs");async function Ic(r,e=void 0){for await(let t of Ho.call(this,r,e))return!0;return!1}s(Ic,"some");async function rg(r,e=void 0){if(typeof r!="function")throw new Ar("fn",["Function","AsyncFunction"],r);return!await Ic.call(this,async(...t)=>!await r(...t),e)}s(rg,"every");async function ig(r,e){for await(let t of Ho.call(this,r,e))return t}s(ig,"find");async function ng(r,e){if(typeof r!="function")throw new Ar("fn",["Function","AsyncFunction"],r);async function t(i,n){return await r(i,n),Di}s(t,"forEachFn");for await(let i of Bi.call(this,t,e));}s(ng,"forEach");function Ho(r,e){if(typeof r!="function")throw new Ar("fn",["Function","AsyncFunction"],r);async function t(i,n){return await r(i,n)?i:Di}return s(t,"filterFn"),Bi.call(this,t,e)}s(Ho,"filter");var Oi=class extends Mb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(Oi,"ReduceAwareErrMissingArgs");async function og(r,e,t){var i;if(typeof r!="function")throw new Ar("reducer",["Function","AsyncFunction"],r);t!=null&&Ct(t,"options"),t?.signal!=null&&Tt(t.signal,"options.signal");let n=arguments.length>1;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted){let u=new Oe(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await $b(this.destroy(u)),u}let o=new Bb,a=o.signal;if(t!=null&&t.signal){let u={once:!0,[qb]:this,[jb]:!0};t.signal.addEventListener("abort",()=>o.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,t!=null&&(c=t.signal)!==null&&c!==void 0&&c.aborted)throw new Oe;n?e=await r(e,u,{signal:a}):(e=u,n=!0)}if(!l&&!n)throw new Oi}finally{o.abort()}return e}s(og,"reduce");async function sg(r){r!=null&&Ct(r,"options"),r?.signal!=null&&Tt(r.signal,"options.signal");let e=[];for await(let i of this){var t;if(r!=null&&(t=r.signal)!==null&&t!==void 0&&t.aborted)throw new Oe(void 0,{cause:r.signal.reason});Gb(e,i)}return e}s(sg,"toArray");function ag(r,e){let t=Bi.call(this,r,e);return s(async function*(){for await(let n of t)yield*n},"flatMap").call(this)}s(ag,"flatMap");function Lc(r){if(r=Jb(r),Zb(r))return 0;if(r<0)throw new Wb("number",">= 0",r);return r}s(Lc,"toIntegerOrInfinity");function lg(r,e=void 0){return e!=null&&Ct(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),r=Lc(r),s(async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Oe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;r--<=0&&(yield o)}},"drop").call(this)}s(lg,"drop");function cg(r,e=void 0){return e!=null&&Ct(e,"options"),e?.signal!=null&&Tt(e.signal,"options.signal"),r=Lc(r),s(async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Oe;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;if(r-- >0&&(yield o),r<=0)return}},"take").call(this)}s(cg,"take");Yo.exports.streamReturningOperators={asIndexedPairs:Yb(tg,"readable.asIndexedPairs will be removed in a future version."),drop:lg,filter:Ho,flatMap:ag,map:Bi,take:cg,compose:eg};Yo.exports.promiseReturningOperators={every:rg,forEach:ng,reduce:og,toArray:sg,some:Ic,find:ig}});var Go=T((S_,Oc)=>{"use strict";var{ArrayPrototypePop:ug,Promise:fg}=O(),{isIterable:dg,isNodeStream:hg,isWebStream:pg}=Pe(),{pipelineImpl:yg}=Ii(),{finished:mg}=$e();Xo();function bg(...r){return new fg((e,t)=>{let i,n,o=r[r.length-1];if(o&&typeof o=="object"&&!hg(o)&&!dg(o)&&!pg(o)){let a=ug(r);i=a.signal,n=a.end}yg(r,(a,l)=>{a?t(a):e(l)},{signal:i,end:n})})}s(bg,"pipeline");Oc.exports={finished:mg,pipeline:bg}});var Xo=T((E_,Vc)=>{var{Buffer:gg}=We(),{ObjectDefineProperty:He,ObjectKeys:Uc,ReflectApply:Mc}=O(),{promisify:{custom:Wc}}=re(),{streamReturningOperators:Dc,promiseReturningOperators:Bc}=Rc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:qc}}=oe(),wg=Ko(),{setDefaultHighWaterMark:Sg,getDefaultHighWaterMark:_g}=br(),{pipeline:jc}=Ii(),{destroyer:Eg}=Et(),$c=$e(),Jo=Go(),Fr=Pe(),I=Vc.exports=yi().Stream;I.isDestroyed=Fr.isDestroyed;I.isDisturbed=Fr.isDisturbed;I.isErrored=Fr.isErrored;I.isReadable=Fr.isReadable;I.isWritable=Fr.isWritable;I.Readable=Sr();for(let r of Uc(Dc)){let t=function(...i){if(new.target)throw qc();return I.Readable.from(Mc(e,this,i))};vg=t,s(t,"fn");let e=Dc[r];He(t,"name",{__proto__:null,value:e.name}),He(t,"length",{__proto__:null,value:e.length}),He(I.Readable.prototype,r,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}var vg;for(let r of Uc(Bc)){let t=function(...n){if(new.target)throw qc();return Mc(e,this,n)};vg=t,s(t,"fn");let e=Bc[r];He(t,"name",{__proto__:null,value:e.name}),He(t,"length",{__proto__:null,value:e.length}),He(I.Readable.prototype,r,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}var vg;I.Writable=Ti();I.Duplex=Re();I.Transform=Lo();I.PassThrough=Oo();I.pipeline=jc;var{addAbortSignal:xg}=mr();I.addAbortSignal=xg;I.finished=$c;I.destroy=Eg;I.compose=wg;I.setDefaultHighWaterMark=Sg;I.getDefaultHighWaterMark=_g;He(I,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Jo}});He(jc,Wc,{__proto__:null,enumerable:!0,get(){return Jo.pipeline}});He($c,Wc,{__proto__:null,enumerable:!0,get(){return Jo.finished}});I.Stream=I;I._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");I._uint8ArrayToBuffer=s(function(e){return gg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var zc=T((v_,V)=>{"use strict";var H=Xo(),kg=Go(),Ag=H.Readable.destroy;V.exports=H.Readable;V.exports._uint8ArrayToBuffer=H._uint8ArrayToBuffer;V.exports._isUint8Array=H._isUint8Array;V.exports.isDisturbed=H.isDisturbed;V.exports.isErrored=H.isErrored;V.exports.isReadable=H.isReadable;V.exports.Readable=H.Readable;V.exports.Writable=H.Writable;V.exports.Duplex=H.Duplex;V.exports.Transform=H.Transform;V.exports.PassThrough=H.PassThrough;V.exports.addAbortSignal=H.addAbortSignal;V.exports.finished=H.finished;V.exports.destroy=H.destroy;V.exports.destroy=Ag;V.exports.pipeline=H.pipeline;V.exports.compose=H.compose;Object.defineProperty(H,"promises",{configurable:!0,enumerable:!0,get(){return kg}});V.exports.Stream=H.Stream;V.exports.default=V.exports});var Pg={};Ir(Pg,{ActionType:()=>Wr,ApiError:()=>f,AsyncKeyValueFile:()=>ar,AsyncKeyValueFileSystem:()=>Ki,AsyncMirror:()=>Ye,BaseFile:()=>fr,BaseFileSystem:()=>ye,BigIntStats:()=>te,Cred:()=>U,ErrorCode:()=>Q,ErrorStrings:()=>Ji,FileFlag:()=>F,FileIndex:()=>lr,FileSystem:()=>rt,FileType:()=>R,FolderAdapter:()=>ve,InMemory:()=>me,IndexDirInode:()=>Xe,IndexFileInode:()=>Pr,NoSyncFile:()=>Mr,OverlayFS:()=>De,PreloadFile:()=>ue,ROOT_NODE_ID:()=>pe,SimpleSyncRWTransaction:()=>Bt,Stats:()=>L,StatsCommon:()=>Ot,SyncKeyValueFile:()=>Ut,SyncKeyValueFileSystem:()=>Mt,SynchronousFileSystem:()=>it,backends:()=>Vi,checkOptions:()=>Xi,configure:()=>Cg,decode:()=>X,default:()=>Ng,encode:()=>x,fs:()=>qi,getFileSystem:()=>Qc,initialize:()=>Zc,isIndexDirInode:()=>ts,isIndexFileInode:()=>Xc,mkdirpSync:()=>ss,randomUUID:()=>pt,registerBackend:()=>Gc,setImmediate:()=>hu,toPromise:()=>du,wait:()=>fu});var Zo={};Ir(Zo,{BigIntStats:()=>te,Dir:()=>Vr,Dirent:()=>at,ReadStream:()=>Ui,Stats:()=>L,WriteStream:()=>Mi,_toUnixTimestamp:()=>ls,access:()=>dd,accessSync:()=>gf,appendFile:()=>jf,appendFileSync:()=>Gu,chmod:()=>ad,chmodSync:()=>pf,chown:()=>od,chownSync:()=>df,close:()=>Vf,closeSync:()=>Ju,constants:()=>ur,copyFile:()=>Sd,copyFileSync:()=>_f,createReadStream:()=>md,createWriteStream:()=>bd,exists:()=>Rf,existsSync:()=>ds,fchmod:()=>Jf,fchmodSync:()=>of,fchown:()=>Xf,fchownSync:()=>nf,fdatasync:()=>Hf,fdatasyncSync:()=>ef,fstat:()=>$f,fstatSync:()=>Xu,fsync:()=>Kf,fsyncSync:()=>Qu,ftruncate:()=>zf,ftruncateSync:()=>Zu,futimes:()=>Zf,futimesSync:()=>sf,getMount:()=>Dt,getMounts:()=>us,initialize:()=>fs,lchmod:()=>ld,lchmodSync:()=>yf,lchown:()=>sd,lchownSync:()=>hf,link:()=>rd,linkSync:()=>cf,lstat:()=>Df,lstatSync:()=>Ku,lutimes:()=>ud,lutimesSync:()=>bf,mkdir:()=>ed,mkdirSync:()=>lf,mkdtemp:()=>wd,mkdtempSync:()=>Sf,mount:()=>$r,open:()=>Mf,openSync:()=>Yu,opendir:()=>xd,opendirSync:()=>vf,promises:()=>Jr,read:()=>Gf,readFile:()=>Wf,readFileSync:()=>ys,readSync:()=>rf,readdir:()=>td,readdirSync:()=>rn,readlink:()=>nd,readlinkSync:()=>ff,readv:()=>_d,readvSync:()=>Ef,realpath:()=>fd,realpathSync:()=>nn,rename:()=>Lf,renameSync:()=>zu,rm:()=>gd,rmSync:()=>wf,rmdir:()=>Qf,rmdirSync:()=>af,stat:()=>Of,statSync:()=>hs,symlink:()=>id,symlinkSync:()=>uf,truncate:()=>Bf,truncateSync:()=>Hu,umount:()=>tn,unlink:()=>Uf,unlinkSync:()=>ps,unwatchFile:()=>pd,utimes:()=>cd,utimesSync:()=>mf,watch:()=>yd,watchFile:()=>hd,write:()=>Yf,writeFile:()=>qf,writeFileSync:()=>ms,writeSync:()=>tf,writev:()=>Ed,writevSync:()=>xf});var lu="/",ht="/";function Ze(r,e){if(typeof r!="string")throw new TypeError(`"${e}" is not a string`)}s(Ze,"validateString");function ns(r,e){let t="",i=0,n=-1,o=0,a="\0";for(let l=0;l<=r.length;++l){if(l<r.length)a=r[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(n===l-1||o===1))if(o===2){if(t.length<2||i!==2||t.at(-1)!=="."||t.at(-2)!=="."){if(t.length>2){let c=t.lastIndexOf("/");c===-1?(t="",i=0):(t=t.slice(0,c),i=t.length-1-t.lastIndexOf("/")),n=l,o=0;continue}else if(t.length!==0){t="",i=0,n=l,o=0;continue}}e&&(t+=t.length>0?"/..":"..",i=2)}else t.length>0?t+="/"+r.slice(n+1,l):t=r.slice(n+1,l),i=l-n-1;n=l,o=0}else a==="."&&o!==-1?++o:o=-1}return t}s(ns,"normalizeString");function Z(...r){let e="",t=!1;for(let i=r.length-1;i>=-1&&!t;i--){let n=i>=0?r[i]:lu;Ze(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,t=n[0]==="/")}return e=ns(e,!t),t?`/${e}`:e.length>0?e:"."}s(Z,"resolve");function cu(r){if(Ze(r,"path"),r.length===0)return".";let e=r[0]==="/",t=r.at(-1)==="/";return r=ns(r,!e),r.length===0?e?"/":t?"./":".":(t&&(r+="/"),e?`/${r}`:r)}s(cu,"normalize");function Y(...r){if(r.length===0)return".";let e;for(let t=0;t<r.length;++t){let i=r[t];Ze(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":cu(e)}s(Y,"join");function os(r,e){if(Ze(r,"from"),Ze(e,"to"),r===e||(r=Z(r),e=Z(e),r===e))return"";let t=1,i=r.length,n=i-t,o=1,a=e.length-o,l=n<a?n:a,c=-1,u=0;for(;u<l;u++){let d=r[t+u];if(d!==e[o+u])break;d==="/"&&(c=u)}if(u===l)if(a>l){if(e[o+u]==="/")return e.slice(o+u+1);if(u===0)return e.slice(o+u)}else n>l&&(r[t+u]==="/"?c=u:u===0&&(c=0));let h="";for(u=t+c+1;u<=i;++u)(u===i||r[u]==="/")&&(h+=h.length===0?"..":"/..");return`${h}${e.slice(o+c)}`}s(os,"relative");function N(r){if(Ze(r,"path"),r.length===0)return".";let e=r[0]==="/",t=-1,i=!0;for(let n=r.length-1;n>=1;--n)if(r[n]==="/"){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":r.slice(0,t)}s(N,"dirname");function ne(r,e){e!==void 0&&Ze(e,"ext"),Ze(r,"path");let t=0,i=-1,n=!0;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e===r)return"";let o=e.length-1,a=-1;for(let l=r.length-1;l>=0;--l)if(r[l]==="/"){if(!n){t=l+1;break}}else a===-1&&(n=!1,a=l+1),o>=0&&(r[l]===e[o]?--o===-1&&(i=l):(o=-1,i=a));return t===i?i=a:i===-1&&(i=r.length),r.slice(t,i)}for(let o=r.length-1;o>=0;--o)if(r[o]==="/"){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":r.slice(t,i)}s(ne,"basename");function ss(r,e,t,i){i.existsSync(r,t)||(ss(N(r),e,t,i),i.mkdirSync(r,e,t))}s(ss,"mkdirpSync");function Lr(r,e,t,i,n){return Math.min(r+1,e+1,t+1,i===n?e:e+1)}s(Lr,"_min");function uu(r,e){if(r===e)return 0;r.length>e.length&&([r,e]=[e,r]);let t=r.length,i=e.length;for(;t>0&&r.charCodeAt(t-1)===e.charCodeAt(i-1);)t--,i--;let n=0;for(;n<t&&r.charCodeAt(n)===e.charCodeAt(n);)n++;if(t-=n,i-=n,t===0||i===1)return i;let o=new Array(t<<1);for(let b=0;b<t;)o[t+b]=r.charCodeAt(n+b),o[b]=++b;let a,l,c,u,h;for(a=0;a+3<i;){let b=e.charCodeAt(n+(l=a)),m=e.charCodeAt(n+(c=a+1)),g=e.charCodeAt(n+(u=a+2)),y=e.charCodeAt(n+(h=a+3)),v=a+=4;for(let S=0;S<t;){let C=o[t+S],B=o[S];l=Lr(B,l,c,b,C),c=Lr(l,c,u,m,C),u=Lr(c,u,h,g,C),v=Lr(u,h,v,y,C),o[S++]=v,h=u,u=c,c=l,l=B}}let d=0;for(;a<i;){let b=e.charCodeAt(n+(l=a));d=++a;for(let m=0;m<t;m++){let g=o[m];o[m]=d=g<l||d<l?g>d?d+1:g+1:b===o[t+m]?l:l+1,l=g}}return d}s(uu,"levenshtein");async function Xi(r,e){let t=r.Options,i=r.Name,n=0,o=!1,a=!1;for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)){let c=t[l],u=e&&e[l];if(u==null){if(!c.optional){let h=Object.keys(e).filter(d=>!(d in t)).map(d=>({str:d,distance:uu(l,d)})).filter(d=>d.distance<5).sort((d,b)=>d.distance-b.distance);if(o)return;throw o=!0,new f(22,`[${i}] Required option '${l}' not provided.${h.length>0?` You provided unrecognized option '${h[0].str}'; perhaps you meant to type '${l}'.`:""}
3
- Option description: ${c.description}`)}}else{let h=!1;if(Array.isArray(c.type)?h=c.type.indexOf(typeof u)!==-1:h=typeof u===c.type,h){if(c.validator){n++;try{await c.validator(u)}catch(d){if(!o){if(d)throw o=!0,d;if(n--,n===0&&a)return}}}}else{if(o)return;throw o=!0,new f(22,`[${i}] Value provided for option ${l} is not the proper type. Expected ${Array.isArray(c.type)?`one of {${c.type.join(", ")}}`:c.type}, but received ${typeof u}
4
- Option description: ${c.description}`)}}}a=!0}s(Xi,"checkOptions");function fu(r){return new Promise(e=>{setTimeout(e,r)})}s(fu,"wait");function du(r){return function(...e){return new Promise((t,i)=>{e.push((n,...o)=>{n?i(n):t(o[0])}),r(...e)})}}s(du,"toPromise");var hu=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:r=>setTimeout(r,0),pe="/",Gi=new Map,pu=new globalThis.TextEncoder;function x(r,e="utf8"){return pu.encode(r)}s(x,"encode");function X(r,e="utf8"){if(!Gi.has(e)){let t=new globalThis.TextDecoder(e);Gi.set(e,t.decode.bind(t))}return Gi.get(e)(r)}s(X,"decode");function pt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}s(pt,"randomUUID");var Q=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EIO=5]="EIO",y[y.EBADF=9]="EBADF",y[y.EACCES=13]="EACCES",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.EROFS=30]="EROFS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ENOTSUP=95]="ENOTSUP",y))(Q||{}),Ji={[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.",[39]:"Directory is not empty.",[95]:"Operation is not supported."},f=class extends Error{constructor(t,i=Ji[t],n){super(i);this.syscall="";this.errno=t,this.code=Q[t],this.path=n,this.message=`Error: ${this.code}: ${i}${this.path?`, '${this.path}'`:""}`}static fromJSON(t){let i=new f(t.errno,t.message,t.path);return i.code=t.code,i.stack=t.stack,i}static Derserialize(t,i=0){let n=new DataView("buffer"in t?t.buffer:t),o=X(n.buffer.slice(i+4,i+4+n.getUint32(i,!0)));return f.fromJSON(JSON.parse(o))}static FileError(t,i){return new f(t,Ji[t],i)}static EACCES(t){return this.FileError(13,t)}static ENOENT(t){return this.FileError(2,t)}static EEXIST(t){return this.FileError(17,t)}static EISDIR(t){return this.FileError(21,t)}static ENOTDIR(t){return this.FileError(20,t)}static EPERM(t){return this.FileError(1,t)}static ENOTEMPTY(t){return this.FileError(39,t)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}}serialize(t=new Uint8Array(this.bufferSize()),i=0){let n=new DataView("buffer"in t?t.buffer:t),o=new Uint8Array(n.buffer),a=x(JSON.stringify(this.toJSON()));return o.set(a),n.setUint32(i,a.byteLength,!0),o}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(f,"ApiError");var Zi=class{constructor(e,t,i,n,o,a){this.uid=e;this.gid=t;this.suid=i;this.sgid=n;this.euid=o;this.egid=a}},U=Zi;s(U,"Cred"),U.Root=new Zi(0,0,0,0,0,0);var ur={};Ir(ur,{COPYFILE_EXCL:()=>bu,COPYFILE_FICLONE:()=>gu,COPYFILE_FICLONE_FORCE:()=>wu,F_OK:()=>yu,O_APPEND:()=>Rt,O_CREAT:()=>ke,O_DIRECT:()=>Au,O_DIRECTORY:()=>_u,O_DSYNC:()=>vu,O_EXCL:()=>It,O_NOATIME:()=>Eu,O_NOCTTY:()=>Su,O_NOFOLLOW:()=>xu,O_NONBLOCK:()=>Fu,O_RDONLY:()=>Rr,O_RDWR:()=>et,O_SYMLINK:()=>ku,O_SYNC:()=>Or,O_TRUNC:()=>Lt,O_WRONLY:()=>Pt,R_OK:()=>Ue,S_IFBLK:()=>Cu,S_IFCHR:()=>Tu,S_IFDIR:()=>Br,S_IFIFO:()=>Nu,S_IFLNK:()=>Ur,S_IFMT:()=>ee,S_IFREG:()=>Dr,S_IFSOCK:()=>Pu,S_IRGRP:()=>Bu,S_IROTH:()=>qu,S_IRUSR:()=>Lu,S_IRWXG:()=>Du,S_IRWXO:()=>Wu,S_IRWXU:()=>Iu,S_IWGRP:()=>Uu,S_IWOTH:()=>ju,S_IWUSR:()=>Ru,S_IXGRP:()=>Mu,S_IXOTH:()=>$u,S_IXUSR:()=>Ou,W_OK:()=>Qe,X_OK:()=>mu});var yu=0,Ue=4,Qe=2,mu=1,bu=1,gu=2,wu=4,Rr=0,Pt=1,et=2,ke=64,It=128,Su=256,Lt=512,Rt=1024,_u=65536,Eu=262144,xu=131072,Or=1052672,vu=4096,ku=32768,Au=16384,Fu=2048,ee=61440,Dr=32768,Br=16384,Tu=8192,Cu=24576,Nu=4096,Ur=40960,Pu=49152,Iu=448,Lu=256,Ru=128,Ou=64,Du=56,Bu=32,Uu=16,Mu=8,Wu=7,qu=4,ju=2,$u=1;var R=(i=>(i[i.FILE=32768]="FILE",i[i.DIRECTORY=16384]="DIRECTORY",i[i.SYMLINK=40960]="SYMLINK",i))(R||{}),Ot=class{constructor(e=R.FILE,t=-1,i,n,o,a,l,c,u){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);this.fileData=null;let h=Date.now(),d=s((b,m)=>typeof b==this._typename?b:this._convert(typeof b==this._typename_inverse?b:m),"resolveT");if(this.atimeMs=d(n,h),this.mtimeMs=d(o,h),this.ctimeMs=d(a,h),this.birthtimeMs=d(u,h),this.uid=d(l,0),this.gid=d(c,0),this.size=this._convert(t),i)this.mode=this._convert(i);else switch(e){case R.FILE:this.mode=this._convert(420);break;case R.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(t)/512)),this.mode&61440||(this.mode=this.mode|this._convert(e))}static Deserialize(e){throw new ReferenceError("Called static abstract method: StatsCommon.Deserialize()")}get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}get atime(){return new Date(Number(this.atimeMs))}get mtime(){return new Date(Number(this.mtimeMs))}get ctime(){return new Date(Number(this.ctimeMs))}get birthtime(){return new Date(Number(this.birthtimeMs))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}hasAccess(e,t){if(t.euid===0||t.egid===0)return!0;let i=this.mode&-61441,n=15,o=15,a=15;if(t.euid==this.uid){let u=(3840&i)>>8;n=(e^u)&e}if(t.egid==this.gid){let u=(240&i)>>4;o=(e^u)&e}let l=15&i;return a=(e^l)&e,!(n&o&a)}getCred(e=Number(this.uid),t=Number(this.gid)){return new U(e,t,Number(this.uid),Number(this.gid),e,t)}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,t){e=Number(e),t=Number(t),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(t)&&0<=t&&t<2**32&&(this.gid=this._convert(t))}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}};s(Ot,"StatsCommon");var L=class extends Ot{constructor(){super(...arguments);this._isBigint=!1}static clone(t){return new L(t.mode&61440,t.size,t.mode&-61441,t.atimeMs,t.mtimeMs,t.ctimeMs,t.uid,t.gid,t.birthtimeMs)}static Deserialize(t){let i=new DataView("buffer"in t?t.buffer:t),n=i.getUint32(0,!0),o=i.getUint32(4,!0),a=i.getFloat64(8,!0),l=i.getFloat64(16,!0),c=i.getFloat64(24,!0),u=i.getUint32(32,!0),h=i.getUint32(36,!0);return new L(o&61440,n,o&-61441,a,l,c,u,h)}serialize(){let t=new Uint8Array(32),i=new DataView(t.buffer);return i.setUint32(0,this.size,!0),i.setUint32(4,this.mode,!0),i.setFloat64(8,this.atime.getTime(),!0),i.setFloat64(16,this.mtime.getTime(),!0),i.setFloat64(24,this.ctime.getTime(),!0),i.setUint32(32,this.uid,!0),i.setUint32(36,this.gid,!0),t}};s(L,"Stats");var te=class extends Ot{constructor(){super(...arguments);this._isBigint=!0}static clone(t){return new te(Number(t.mode)&61440,BigInt(t.size),BigInt(t.mode)&BigInt(-61441),BigInt(t.atimeMs),BigInt(t.mtimeMs),BigInt(t.ctimeMs),BigInt(t.uid),BigInt(t.gid),BigInt(t.birthtimeMs))}static Deserialize(t){let i=new DataView("buffer"in t?t.buffer:t),n=i.getBigUint64(0,!0),o=i.getBigUint64(4,!0),a=i.getFloat64(8,!0),l=i.getFloat64(16,!0),c=i.getFloat64(24,!0),u=i.getBigUint64(32,!0),h=i.getBigUint64(36,!0);return new L(Number(o)&61440,n,o&BigInt(-61441),a,l,c,u,h)}serialize(){let t=new Uint8Array(32),i=new DataView(t.buffer);return i.setBigUint64(0,this.size,!0),i.setBigUint64(4,this.mode,!0),i.setFloat64(8,this.atime.getTime(),!0),i.setFloat64(16,this.mtime.getTime(),!0),i.setFloat64(24,this.ctime.getTime(),!0),i.setBigUint64(32,this.uid,!0),i.setBigUint64(36,this.gid,!0),t}};s(te,"BigIntStats");var Wr=(n=>(n[n.NOP=0]="NOP",n[n.THROW_EXCEPTION=1]="THROW_EXCEPTION",n[n.TRUNCATE_FILE=2]="TRUNCATE_FILE",n[n.CREATE_FILE=3]="CREATE_FILE",n))(Wr||{}),tt=class{static getFileFlag(e){return tt.flagCache.has(e)||tt.flagCache.set(e,new tt(e)),tt.flagCache.get(e)}constructor(e){if(typeof e=="number"&&(e=tt.StringFromNumber(e)),tt.validFlagStrs.indexOf(e)<0)throw new f(22,"Invalid flag string: "+e);this.flagStr=e}static StringFromNumber(e){switch(e){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new f(22,"Invalid flag number: "+e)}}getFlagString(){return this.flagStr}getMode(){let e=0;return e<<=1,e+=+this.isReadable(),e<<=1,e+=+this.isWriteable(),e<<=1,e}isReadable(){return this.flagStr.indexOf("r")!==-1||this.flagStr.indexOf("+")!==-1}isWriteable(){return this.flagStr.indexOf("w")!==-1||this.flagStr.indexOf("a")!==-1||this.flagStr.indexOf("+")!==-1}isTruncating(){return this.flagStr.indexOf("w")!==-1}isAppendable(){return this.flagStr.indexOf("a")!==-1}isSynchronous(){return this.flagStr.indexOf("s")!==-1}isExclusive(){return this.flagStr.indexOf("x")!==-1}pathExistsAction(){return this.isExclusive()?1:this.isTruncating()?2:0}pathNotExistsAction(){return(this.isWriteable()||this.isAppendable())&&this.flagStr!=="r+"?3:1}},F=tt;s(F,"FileFlag"),F.flagCache=new Map,F.validFlagStrs=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];var fr=class{async sync(){throw new f(95)}syncSync(){throw new f(95)}async datasync(){return this.sync()}datasyncSync(){return this.syncSync()}async chown(e,t){throw new f(95)}chownSync(e,t){throw new f(95)}async chmod(e){throw new f(95)}chmodSync(e){throw new f(95)}async utimes(e,t){throw new f(95)}utimesSync(e,t){throw new f(95)}};s(fr,"BaseFile");var ue=class extends fr{constructor(t,i,n,o,a){super();this._pos=0;this._dirty=!1;if(this._fs=t,this._path=i,this._flag=n,this._stat=o,this._buffer=a||new Uint8Array(0),this._stat.size!==this._buffer.length&&this._flag.isReadable())throw new Error(`Invalid buffer: Uint8Array is ${this._buffer.length} long, yet Stats object specifies that file is ${this._stat.size} long.`)}getBuffer(){return this._buffer}getStats(){return this._stat}getFlag(){return this._flag}getPath(){return this._path}getPos(){return this._flag.isAppendable()?this._stat.size:this._pos}advancePos(t){return this._pos+=t}setPos(t){return this._pos=t}async sync(){this.syncSync()}syncSync(){throw new f(95)}async close(){this.closeSync()}closeSync(){throw new f(95)}async stat(){return L.clone(this._stat)}statSync(){return L.clone(this._stat)}truncate(t){if(this.truncateSync(t),this._flag.isSynchronous()&&!Dt("/").metadata.synchronous)return this.sync()}truncateSync(t){if(this._dirty=!0,!this._flag.isWriteable())throw new f(1,"File not opened with a writeable mode.");if(this._stat.mtimeMs=Date.now(),t>this._buffer.length){let i=new Uint8Array(t-this._buffer.length);this.writeSync(i,0,i.length,this._buffer.length),this._flag.isSynchronous()&&Dt("/").metadata.synchronous&&this.syncSync();return}this._stat.size=t,this._buffer=this._buffer.subarray(0,t),this._flag.isSynchronous()&&Dt("/").metadata.synchronous&&this.syncSync()}async write(t,i,n,o){return this.writeSync(t,i,n,o)}writeSync(t,i,n,o){if(this._dirty=!0,o==null&&(o=this.getPos()),!this._flag.isWriteable())throw new f(1,"File not opened with a writeable mode.");let a=o+n;if(a>this._stat.size&&(this._stat.size=a,a>this._buffer.length)){let c=new Uint8Array(a);c.set(this._buffer),this._buffer=c}this._buffer.set(t.slice(i,i+n),o);let l=this._buffer.length;return this._stat.mtimeMs=Date.now(),this._flag.isSynchronous()?(this.syncSync(),l):(this.setPos(o+l),l)}async read(t,i,n,o){return{bytesRead:this.readSync(t,i,n,o),buffer:t}}readSync(t,i,n,o){if(!this._flag.isReadable())throw new f(1,"File not opened with a readable mode.");return o==null&&(o=this.getPos()),o+n>this._stat.size&&(n=this._stat.size-o),this._buffer.set(t.slice(i,i+n),o),this._stat.atimeMs=Date.now(),this._pos=o+n,this._buffer.length}async chmod(t){this.chmodSync(t)}chmodSync(t){if(!this._fs.metadata.supportsProperties)throw new f(95);this._dirty=!0,this._stat.chmod(t),this.syncSync()}async chown(t,i){this.chownSync(t,i)}chownSync(t,i){if(!this._fs.metadata.supportsProperties)throw new f(95);this._dirty=!0,this._stat.chown(t,i),this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}};s(ue,"PreloadFile");var Mr=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(Mr,"NoSyncFile");var rt=class{constructor(e){}};s(rt,"FileSystem");var Qi=class extends rt{constructor(t){super();this._ready=Promise.resolve(this)}get metadata(){return{name:this.constructor.name,readonly:!1,synchronous:!1,supportsProperties:!1,supportsLinks:!1,totalSpace:0,freeSpace:0}}whenReady(){return this._ready}async openFile(t,i,n){throw new f(95)}async createFile(t,i,n,o){throw new f(95)}async open(t,i,n,o){try{let a=await this.stat(t,o);switch(i.pathExistsAction()){case 1:throw f.EEXIST(t);case 2:let l=await this.openFile(t,i,o);if(!l)throw new Error("BFS has reached an impossible code path; please file a bug.");return await l.truncate(0),await l.sync(),l;case 0:return this.openFile(t,i,o);default:throw new f(22,"Invalid FileFlag object.")}}catch{switch(i.pathNotExistsAction()){case 3:let l=await this.stat(N(t),o);if(l&&!l.isDirectory())throw f.ENOTDIR(N(t));return this.createFile(t,i,n,o);case 1:throw f.ENOENT(t);default:throw new f(22,"Invalid FileFlag object.")}}}async access(t,i,n){throw new f(95)}accessSync(t,i,n){throw new f(95)}async rename(t,i,n){throw new f(95)}renameSync(t,i,n){throw new f(95)}async stat(t,i){throw new f(95)}statSync(t,i){throw new f(95)}openFileSync(t,i,n){throw new f(95)}createFileSync(t,i,n,o){throw new f(95)}openSync(t,i,n,o){let a;try{a=this.statSync(t,o)}catch{switch(i.pathNotExistsAction()){case 3:if(!this.statSync(N(t),o).isDirectory())throw f.ENOTDIR(N(t));return this.createFileSync(t,i,n,o);case 1:throw f.ENOENT(t);default:throw new f(22,"Invalid FileFlag object.")}}if(!a.hasAccess(n,o))throw f.EACCES(t);switch(i.pathExistsAction()){case 1:throw f.EEXIST(t);case 2:return this.unlinkSync(t,o),this.createFileSync(t,i,a.mode,o);case 0:return this.openFileSync(t,i,o);default:throw new f(22,"Invalid FileFlag object.")}}async unlink(t,i){throw new f(95)}unlinkSync(t,i){throw new f(95)}async rmdir(t,i){throw new f(95)}rmdirSync(t,i){throw new f(95)}async mkdir(t,i,n){throw new f(95)}mkdirSync(t,i,n){throw new f(95)}async readdir(t,i){throw new f(95)}readdirSync(t,i){throw new f(95)}async exists(t,i){try{return await this.stat(t,i),!0}catch{return!1}}existsSync(t,i){try{return this.statSync(t,i),!0}catch{return!1}}async realpath(t,i){if(this.metadata.supportsLinks){let n=t.split(ht);for(let o=0;o<n.length;o++){let a=n.slice(0,o+1);n[o]=Y(...a)}return n.join(ht)}else{if(!await this.exists(t,i))throw f.ENOENT(t);return t}}realpathSync(t,i){if(this.metadata.supportsLinks){let n=t.split(ht);for(let o=0;o<n.length;o++){let a=n.slice(0,o+1);n[o]=Y(...a)}return n.join(ht)}else{if(this.existsSync(t,i))return t;throw f.ENOENT(t)}}async truncate(t,i,n){let o=await this.open(t,F.getFileFlag("r+"),420,n);try{await o.truncate(i)}finally{await o.close()}}truncateSync(t,i,n){let o=this.openSync(t,F.getFileFlag("r+"),420,n);try{o.truncateSync(i)}finally{o.closeSync()}}async readFile(t,i,n){let o=await this.open(t,i,420,n);try{let a=await o.stat(),l=new Uint8Array(a.size);return await o.read(l,0,a.size,0),await o.close(),l}finally{await o.close()}}readFileSync(t,i,n){let o=this.openSync(t,i,420,n);try{let a=o.statSync(),l=new Uint8Array(a.size);return o.readSync(l,0,a.size,0),o.closeSync(),l}finally{o.closeSync()}}async writeFile(t,i,n,o,a){let l=await this.open(t,n,o,a);try{typeof i=="string"&&(i=x(i)),await l.write(i,0,i.length,0)}finally{await l.close()}}writeFileSync(t,i,n,o,a){let l=this.openSync(t,n,o,a);try{typeof i=="string"&&(i=x(i)),l.writeSync(i,0,i.length,0)}finally{l.closeSync()}}async appendFile(t,i,n,o,a){let l=await this.open(t,n,o,a);try{typeof i=="string"&&(i=x(i)),await l.write(i,0,i.length,null)}finally{await l.close()}}appendFileSync(t,i,n,o,a){let l=this.openSync(t,n,o,a);try{typeof i=="string"&&(i=x(i)),l.writeSync(i,0,i.length,null)}finally{l.closeSync()}}async chmod(t,i,n){throw new f(95)}chmodSync(t,i,n){throw new f(95)}async chown(t,i,n,o){throw new f(95)}chownSync(t,i,n,o){throw new f(95)}async utimes(t,i,n,o){throw new f(95)}utimesSync(t,i,n,o){throw new f(95)}async link(t,i,n){throw new f(95)}linkSync(t,i,n){throw new f(95)}async symlink(t,i,n,o){throw new f(95)}symlinkSync(t,i,n,o){throw new f(95)}async readlink(t,i){throw new f(95)}readlinkSync(t,i){throw new f(95)}},ye=Qi;s(ye,"BaseFileSystem"),ye.Name=Qi.name;var it=class extends ye{get metadata(){return{...super.metadata,synchronous:!0}}async access(e,t,i){return this.accessSync(e,t,i)}async rename(e,t,i){return this.renameSync(e,t,i)}async stat(e,t){return this.statSync(e,t)}async open(e,t,i,n){return this.openSync(e,t,i,n)}async unlink(e,t){return this.unlinkSync(e,t)}async rmdir(e,t){return this.rmdirSync(e,t)}async mkdir(e,t,i){return this.mkdirSync(e,t,i)}async readdir(e,t){return this.readdirSync(e,t)}async chmod(e,t,i){return this.chmodSync(e,t,i)}async chown(e,t,i,n){return this.chownSync(e,t,i,n)}async utimes(e,t,i,n){return this.utimesSync(e,t,i,n)}async link(e,t,i){return this.linkSync(e,t,i)}async symlink(e,t,i,n){return this.symlinkSync(e,t,i,n)}async readlink(e,t){return this.readlinkSync(e,t)}};s(it,"SynchronousFileSystem");var ae=class{constructor(e,t,i,n,o,a,l,c){this.id=e;this.size=t;this.mode=i;this.atime=n;this.mtime=o;this.ctime=a;this.uid=l;this.gid=c}static Deserialize(e){let t=new DataView("buffer"in e?e.buffer:e);return new ae(X(t.buffer.slice(38)),t.getUint32(0,!0),t.getUint16(4,!0),t.getFloat64(6,!0),t.getFloat64(14,!0),t.getFloat64(22,!0),t.getUint32(30,!0),t.getUint32(34,!0))}toStats(){return new L((this.mode&61440)===R.DIRECTORY?R.DIRECTORY:R.FILE,this.size,this.mode,this.atime,this.mtime,this.ctime,this.uid,this.gid)}getSize(){return 38+this.id.length}serialize(e=new Uint8Array(this.getSize())){let t=new DataView("buffer"in e?e.buffer:e);t.setUint32(0,this.size,!0),t.setUint16(4,this.mode,!0),t.setFloat64(6,this.atime,!0),t.setFloat64(14,this.mtime,!0),t.setFloat64(22,this.ctime,!0),t.setUint32(30,this.uid,!0),t.setUint32(34,this.gid,!0);let i=new Uint8Array(t.buffer);return i.set(x(this.id),38),i}update(e){let t=!1;this.size!==e.size&&(this.size=e.size,t=!0),this.mode!==e.mode&&(this.mode=e.mode,t=!0);let i=e.atime.getTime();this.atime!==i&&(this.atime=i,t=!0);let n=e.mtime.getTime();this.mtime!==n&&(this.mtime=n,t=!0);let o=e.ctime.getTime();return this.ctime!==o&&(this.ctime=o,t=!0),this.uid!==e.uid&&(this.uid=e.uid,t=!0),this.uid!==e.uid&&(this.uid=e.uid,t=!0),t}isFile(){return(this.mode&61440)===R.FILE}isDirectory(){return(this.mode&61440)===R.DIRECTORY}};s(ae,"Inode");var Bt=class{constructor(e){this.store=e;this.originalData={};this.modifiedKeys=[]}get(e){let t=this.store.get(e);return this.stashOldValue(e,t),t}put(e,t,i){return this.markModified(e),this.store.put(e,t,i)}del(e){this.markModified(e),this.store.del(e)}commit(){}abort(){for(let e of this.modifiedKeys){let t=this.originalData[e];t?this.store.put(e,t,!0):this.store.del(e)}}_has(e){return Object.prototype.hasOwnProperty.call(this.originalData,e)}stashOldValue(e,t){this._has(e)||(this.originalData[e]=t)}markModified(e){this.modifiedKeys.indexOf(e)===-1&&(this.modifiedKeys.push(e),this._has(e)||(this.originalData[e]=this.store.get(e)))}};s(Bt,"SimpleSyncRWTransaction");var Ut=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}syncSync(){this.isDirty()&&(this._fs._syncSync(this.getPath(),this.getBuffer(),this.getStats()),this.resetDirty())}closeSync(){this.syncSync()}};s(Ut,"SyncKeyValueFile");var Mt=class extends it{constructor(t){super();this.store=t.store,this.makeRootDirectory()}static isAvailable(){return!0}getName(){return this.store.name()}isReadOnly(){return!1}supportsSymlinks(){return!1}supportsProps(){return!0}supportsSynch(){return!0}empty(){this.store.clear(),this.makeRootDirectory()}accessSync(t,i,n){let o=this.store.beginTransaction("readonly");if(!this.findINode(o,t).toStats().hasAccess(i,n))throw f.EACCES(t)}renameSync(t,i,n){let o=this.store.beginTransaction("readwrite"),a=N(t),l=ne(t),c=N(i),u=ne(i),h=this.findINode(o,a),d=this.getDirListing(o,a,h);if(!h.toStats().hasAccess(2,n))throw f.EACCES(t);if(!d[l])throw f.ENOENT(t);let b=d[l];if(delete d[l],(c+"/").indexOf(t+"/")===0)throw new f(16,a);let m,g;if(c===a?(m=h,g=d):(m=this.findINode(o,c),g=this.getDirListing(o,c,m)),g[u]){let y=this.getINode(o,i,g[u]);if(y.isFile())try{o.del(y.id),o.del(g[u])}catch(v){throw o.abort(),v}else throw f.EPERM(i)}g[u]=b;try{o.put(h.id,x(JSON.stringify(d)),!0),o.put(m.id,x(JSON.stringify(g)),!0)}catch(y){throw o.abort(),y}o.commit()}statSync(t,i){let n=this.findINode(this.store.beginTransaction("readonly"),t).toStats();if(!n.hasAccess(4,i))throw f.EACCES(t);return n}createFileSync(t,i,n,o){let a=this.store.beginTransaction("readwrite"),l=new Uint8Array(0),c=this.commitNewFile(a,t,R.FILE,n,o,l);return new Ut(this,t,i,c.toStats(),l)}openFileSync(t,i,n){let o=this.store.beginTransaction("readonly"),a=this.findINode(o,t),l=o.get(a.id);if(!a.toStats().hasAccess(i.getMode(),n))throw f.EACCES(t);if(l===void 0)throw f.ENOENT(t);return new Ut(this,t,i,a.toStats(),l)}unlinkSync(t,i){this.removeEntry(t,!1,i)}rmdirSync(t,i){if(this.readdirSync(t,i).length>0)throw f.ENOTEMPTY(t);this.removeEntry(t,!0,i)}mkdirSync(t,i,n){let o=this.store.beginTransaction("readwrite"),a=x("{}");this.commitNewFile(o,t,R.DIRECTORY,i,n,a)}readdirSync(t,i){let n=this.store.beginTransaction("readonly"),o=this.findINode(n,t);if(!o.toStats().hasAccess(4,i))throw f.EACCES(t);return Object.keys(this.getDirListing(n,t,o))}chmodSync(t,i,n){this.openFileSync(t,F.getFileFlag("r+"),n).chmodSync(i)}chownSync(t,i,n,o){this.openFileSync(t,F.getFileFlag("r+"),o).chownSync(i,n)}_syncSync(t,i,n){let o=this.store.beginTransaction("readwrite"),a=this._findINode(o,N(t),ne(t)),l=this.getINode(o,t,a),c=l.update(n);try{o.put(l.id,i,!0),c&&o.put(a,l.serialize(),!0)}catch(u){throw o.abort(),u}o.commit()}makeRootDirectory(){let t=this.store.beginTransaction("readwrite");if(t.get(pe)===void 0){let i=new Date().getTime(),n=new ae(pt(),4096,511|R.DIRECTORY,i,i,i,0,0);t.put(n.id,x("{}"),!1),t.put(pe,n.serialize(),!1),t.commit()}}_findINode(t,i,n,o=new Set){let a=Y(i,n);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);o.add(a);let l=s(c=>{let u=this.getDirListing(t,i,c);if(u[n])return u[n];throw f.ENOENT(Z(i,n))},"readDirectory");return i==="/"?n===""?pe:l(this.getINode(t,i,pe)):l(this.getINode(t,i+ht+n,this._findINode(t,N(i),ne(i),o)))}findINode(t,i){return this.getINode(t,i,this._findINode(t,N(i),ne(i)))}getINode(t,i,n){let o=t.get(n);if(o===void 0)throw f.ENOENT(i);return ae.Deserialize(o)}getDirListing(t,i,n){if(!n.isDirectory())throw f.ENOTDIR(i);let o=t.get(n.id);if(o===void 0)throw f.ENOENT(i);return JSON.parse(X(o))}addNewNode(t,i){let o;for(;0<5;)try{return o=pt(),t.put(o,i,!1),o}catch{}throw new f(5,"Unable to commit data to key-value store.")}commitNewFile(t,i,n,o,a,l){let c=N(i),u=ne(i),h=this.findINode(t,c),d=this.getDirListing(t,c,h),b=new Date().getTime();if(!h.toStats().hasAccess(4,a))throw f.EACCES(i);if(i==="/")throw f.EEXIST(i);if(d[u])throw f.EEXIST(i);let m;try{let g=this.addNewNode(t,l);m=new ae(g,l.length,o|n,b,b,b,a.uid,a.gid);let y=this.addNewNode(t,m.serialize());d[u]=y,t.put(h.id,x(JSON.stringify(d)),!0)}catch(g){throw t.abort(),g}return t.commit(),m}removeEntry(t,i,n){let o=this.store.beginTransaction("readwrite"),a=N(t),l=this.findINode(o,a),c=this.getDirListing(o,a,l),u=ne(t);if(!c[u])throw f.ENOENT(t);let h=c[u],d=this.getINode(o,t,h);if(!d.toStats().hasAccess(2,n))throw f.EACCES(t);if(delete c[u],!i&&d.isDirectory())throw f.EISDIR(t);if(i&&!d.isDirectory())throw f.ENOTDIR(t);try{o.del(d.id),o.del(h),o.put(l.id,x(JSON.stringify(c)),!0)}catch(b){throw o.abort(),b}o.commit()}};s(Mt,"SyncKeyValueFileSystem");function nt(r,e){e=typeof r=="function"?r:e,Xi(this,r);let t=new this(typeof r=="function"?{}:r);if(typeof e!="function")return t.whenReady();t.whenReady().then(i=>e(null,i)).catch(i=>e(i))}s(nt,"CreateBackend");var qr=class{constructor(){this.store=new Map}name(){return me.Name}clear(){this.store.clear()}beginTransaction(e){return new Bt(this)}get(e){return this.store.get(e)}put(e,t,i){return!i&&this.store.has(e)?!1:(this.store.set(e,t),!0)}del(e){this.store.delete(e)}};s(qr,"InMemoryStore");var en=class extends Mt{constructor(){super({store:new qr})}},me=en;s(me,"InMemoryFileSystem"),me.Name="InMemory",me.Create=nt.bind(en),me.Options={};function ls(r){if(typeof r=="number")return r;if(r instanceof Date)return r.getTime()/1e3;throw new Error("Cannot parse time: "+r)}s(ls,"_toUnixTimestamp");function fe(r,e){switch(typeof r){case"number":return r;case"string":let t=parseInt(r,8);return isNaN(t)?e:t;default:return e}}s(fe,"normalizeMode");function le(r){if(r instanceof Date)return r;if(typeof r=="number")return new Date(r*1e3);throw new f(22,"Invalid time.")}s(le,"normalizeTime");function W(r){if(r.indexOf("\0")>=0)throw new f(22,"Path must be a string without null bytes.");if(r==="")throw new f(22,"Path must not be empty.");return r=r.replaceAll(/\/+/g,"/"),Z(r)}s(W,"normalizePath");function ot(r,e,t,i){switch(r===null?"null":typeof r){case"object":return{encoding:typeof r.encoding<"u"?r.encoding:e,flag:typeof r.flag<"u"?r.flag:t,mode:fe(r.mode,i)};case"string":return{encoding:r,flag:t,mode:i};case"null":case"undefined":case"function":return{encoding:e,flag:t,mode:i};default:throw new TypeError(`"options" must be a string or an object, got ${typeof r} instead.`)}}s(ot,"normalizeOptions");function _(){}s(_,"nop");var w=U.Root;function cs(r){w=r}s(cs,"setCred");var yt=new Map,Vu=100;function jr(r){let e=Vu++;return yt.set(e,r),e}s(jr,"getFdForFile");function M(r){if(!yt.has(r))throw new f(9,"Invalid file descriptor.");return yt.get(r)}s(M,"fd2file");var _e=new Map;me.Create().then(r=>$r("/",r));function Dt(r){return _e.get(r)}s(Dt,"getMount");function us(){return Object.fromEntries(_e.entries())}s(us,"getMounts");function $r(r,e){if(r[0]!=="/"&&(r="/"+r),r=Z(r),_e.has(r))throw new f(22,"Mount point "+r+" is already in use.");_e.set(r,e)}s($r,"mount");function tn(r){if(r[0]!=="/"&&(r=`/${r}`),r=Z(r),!_e.has(r))throw new f(22,"Mount point "+r+" is already unmounted.");_e.delete(r)}s(tn,"umount");function be(r){let e=[..._e].sort((t,i)=>t[0].length>i[0].length?-1:1);for(let[t,i]of e)if(t.length<=r.length&&r.startsWith(t))return r=r.slice(t.length>1?t.length:0),r===""&&(r="/"),{fs:i,path:r,mountPoint:t};throw new f(5,"ZenFS not initialized with a file system")}s(be,"resolveFS");function as(r,e){for(let[t,i]of Object.entries(e))r=r?.replaceAll(t,i);return r}s(as,"fixPaths");function st(r,e){return typeof r.stack=="string"&&(r.stack=as(r.stack,e)),r.message=as(r.message,e),r}s(st,"fixError");function fs(r){r["/"]&&tn("/");for(let[e,t]of Object.entries(r)){if(!t.constructor.isAvailable())throw new f(22,`Can not mount "${e}" since the filesystem is unavailable.`);$r(e,t)}}s(fs,"initialize");var Jr={};Ir(Jr,{access:()=>Nn,appendFile:()=>cn,chmod:()=>An,chown:()=>vn,close:()=>fn,constants:()=>ur,copyFile:()=>If,createReadStream:()=>Tf,createWriteStream:()=>Cf,exists:()=>zr,fchmod:()=>bn,fchown:()=>mn,fdatasync:()=>pn,fstat:()=>un,fsync:()=>hn,ftruncate:()=>dn,futimes:()=>gn,lchmod:()=>Fn,lchown:()=>kn,link:()=>_n,lstat:()=>sn,lutimes:()=>Cn,mkdir:()=>Sn,mkdtemp:()=>Pf,open:()=>ln,read:()=>yn,readFile:()=>Yr,readdir:()=>dr,readlink:()=>xn,realpath:()=>hr,rename:()=>on,rm:()=>Nf,rmdir:()=>wn,stat:()=>Kr,symlink:()=>En,truncate:()=>an,unlink:()=>Hr,unwatchFile:()=>Af,utimes:()=>Tn,watch:()=>Ff,watchFile:()=>kf,write:()=>Xr,writeFile:()=>Gr});function q(...[r,e,t,...i]){t=W(t);let{fs:n,path:o}=be(e&&ds(t)?nn(t):t);try{return n[r](o,...i)}catch(a){throw st(a,{[o]:t})}}s(q,"doOp");function zu(r,e){r=W(r),e=W(e);let t=be(r),i=be(e),n={[t.path]:r,[i.path]:e};try{if(t===i)return t.fs.renameSync(t.path,i.path,w);let o=ys(r);ms(e,o),ps(r)}catch(o){throw st(o,n)}}s(zu,"renameSync");function ds(r){r=W(r);try{let{fs:e,path:t}=be(r);return e.existsSync(t,w)}catch(e){if(e.errno==2)return!1;throw e}}s(ds,"existsSync");function hs(r,e){let t=q("statSync",!0,r,w);return e?.bigint?te.clone(t):t}s(hs,"statSync");function Ku(r,e){let t=q("statSync",!1,r,w);return e?.bigint?te.clone(t):t}s(Ku,"lstatSync");function Hu(r,e=0){if(e<0)throw new f(22);return q("truncateSync",!0,r,e,w)}s(Hu,"truncateSync");function ps(r){return q("unlinkSync",!1,r,w)}s(ps,"unlinkSync");function Yu(r,e,t=420){let i=q("openSync",!0,r,F.getFileFlag(e),fe(t,420),w);return jr(i)}s(Yu,"openSync");function ys(r,e={}){let t=ot(e,null,"r",null),i=F.getFileFlag(t.flag);if(!i.isReadable())throw new f(22,"Flag passed to readFile must allow for reading.");let n=q("readFileSync",!0,r,i,w);switch(t.encoding){case"utf8":case"utf-8":return X(n);default:return n}}s(ys,"readFileSync");function ms(r,e,t){let i=ot(t,"utf8","w",420),n=F.getFileFlag(i.flag);if(!n.isWriteable())throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!i.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?x(e):e;return q("writeFileSync",!0,r,o,n,i.mode,w)}s(ms,"writeFileSync");function Gu(r,e,t){let i=ot(t,"utf8","a",420),n=F.getFileFlag(i.flag);if(!n.isAppendable())throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?x(e):e;return q("appendFileSync",!0,r,o,n,i.mode,w)}s(Gu,"appendFileSync");function Xu(r,e){let t=M(r).statSync();return e?.bigint?te.clone(t):t}s(Xu,"fstatSync");function Ju(r){M(r).closeSync(),yt.delete(r)}s(Ju,"closeSync");function Zu(r,e=0){let t=M(r);if(e<0)throw new f(22);t.truncateSync(e)}s(Zu,"ftruncateSync");function Qu(r){M(r).syncSync()}s(Qu,"fsyncSync");function ef(r){M(r).datasyncSync()}s(ef,"fdatasyncSync");function tf(r,e,t,i,n){let o,a=0,l,c;if(typeof e=="string"){c=typeof t=="number"?t:null;let h=typeof i=="string"?i:"utf8";a=0,o=x(e),l=o.length}else o=e,a=t,l=i,c=typeof n=="number"?n:null;let u=M(r);return c==null&&(c=u.getPos()),u.writeSync(o,a,l,c)}s(tf,"writeSync");function rf(r,e,t,i,n){let o=M(r),a=t;return typeof t=="object"&&({offset:a,length:i,position:n}=t),isNaN(+n)&&(n=o.getPos()),o.readSync(e,a,i,n)}s(rf,"readSync");function nf(r,e,t){M(r).chownSync(e,t)}s(nf,"fchownSync");function of(r,e){let t=typeof e=="string"?parseInt(e,8):e;M(r).chmodSync(t)}s(of,"fchmodSync");function sf(r,e,t){M(r).utimesSync(le(e),le(t))}s(sf,"futimesSync");function af(r){return q("rmdirSync",!0,r,w)}s(af,"rmdirSync");function lf(r,e){let t=typeof e=="number"||typeof e=="string"?e:e?.mode,i=typeof e=="object"&&e?.recursive;q("mkdirSync",!0,r,fe(t,511),w)}s(lf,"mkdirSync");function rn(r,e){r=W(r);let t=q("readdirSync",!0,r,w);for(let i of _e.keys()){if(!i.startsWith(r))continue;let n=i.slice(r.length);n.includes("/")||n.length==0||t.push(n)}return t.map(i=>typeof e=="object"&&e?.withFileTypes?new at(i,hs(Y(r,i))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?x(i):i)}s(rn,"readdirSync");function cf(r,e){return e=W(e),q("linkSync",!1,r,e,w)}s(cf,"linkSync");function uf(r,e,t){if(!["file","dir","junction"].includes(t))throw new f(22,"Invalid type: "+t);return e=W(e),q("symlinkSync",!1,r,e,t,w)}s(uf,"symlinkSync");function ff(r,e){let t=q("readlinkSync",!1,r,w);return x(t,typeof e=="object"?e.encoding:e)}s(ff,"readlinkSync");function df(r,e,t){q("chownSync",!0,r,e,t,w)}s(df,"chownSync");function hf(r,e,t){q("chownSync",!1,r,e,t,w)}s(hf,"lchownSync");function pf(r,e){let t=fe(e,-1);if(t<0)throw new f(22,"Invalid mode.");q("chmodSync",!0,r,t,w)}s(pf,"chmodSync");function yf(r,e){let t=fe(e,-1);if(t<1)throw new f(22,"Invalid mode.");q("chmodSync",!1,r,t,w)}s(yf,"lchmodSync");function mf(r,e,t){q("utimesSync",!0,r,le(e),le(t),w)}s(mf,"utimesSync");function bf(r,e,t){q("utimesSync",!1,r,le(e),le(t),w)}s(bf,"lutimesSync");function nn(r,e){r=W(r);let{fs:t,path:i,mountPoint:n}=be(r);try{if(!t.statSync(i,w).isSymbolicLink())return r;let a=W(n+t.readlinkSync(i,w));return nn(a)}catch(o){throw st(o,{[i]:r})}}s(nn,"realpathSync");function gf(r,e=384){return q("accessSync",!0,r,e,w)}s(gf,"accessSync");function wf(r){throw new f(95)}s(wf,"rmSync");function Sf(r,e){throw new f(95)}s(Sf,"mkdtempSync");function _f(r,e,t){throw new f(95)}s(_f,"copyFileSync");function Ef(r,e,t){throw new f(95)}s(Ef,"readvSync");function xf(r,e,t){throw new f(95)}s(xf,"writevSync");function vf(r,e){throw new f(95)}s(vf,"opendirSync");var at=class{constructor(e,t){this.name=e;this.stats=t}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(at,"Dirent");var Vr=class{constructor(e){this.path=e;this.closed=!1}checkClosed(){if(this.closed)throw new f(9,"Can not use closed Dir")}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await dr(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(t=>e(null,t))}readSync(){return this._entries||(this._entries=rn(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 t=await e._read();return t!=null?{done:!1,value:t}:(await e.close(),{done:!0,value:void 0})}}}};s(Vr,"Dir");async function j(...[r,e,t,...i]){t=W(t);let{fs:n,path:o}=be(e&&await zr(t)?await hr(t):t);try{return n[r](o,...i)}catch(a){throw st(a,{[o]:t})}}s(j,"doOp");async function on(r,e){r=W(r),e=W(e);let t=be(r),i=be(e),n={[t.path]:r,[i.path]:e};try{if(t===i)return t.fs.rename(t.path,i.path,w);let o=await Yr(r);await Gr(e,o),await Hr(r)}catch(o){throw st(o,n)}}s(on,"rename");async function zr(r){r=W(r);try{let{fs:e,path:t}=be(r);return e.exists(t,w)}catch(e){if(e.errno==2)return!1;throw e}}s(zr,"exists");async function Kr(r,e){let t=await j("stat",!0,r,w);return e?.bigint?te.clone(t):t}s(Kr,"stat");async function sn(r,e){let t=await j("stat",!1,r,w);return e?.bigint?te.clone(t):t}s(sn,"lstat");async function an(r,e=0){if(e<0)throw new f(22);return j("truncate",!0,r,e,w)}s(an,"truncate");async function Hr(r){return j("unlink",!1,r,w)}s(Hr,"unlink");async function ln(r,e,t=420){let i=await j("open",!0,r,F.getFileFlag(e),fe(t,420),w);return jr(i)}s(ln,"open");async function Yr(r,e={}){let t=ot(e,null,"r",null),i=F.getFileFlag(t.flag);if(!i.isReadable())throw new f(22,"Flag passed to readFile must allow for reading.");let n=await j("readFile",!0,r,i,w);switch(t.encoding){case"utf8":case"utf-8":return X(n);default:return n}}s(Yr,"readFile");async function Gr(r,e,t){let i=ot(t,"utf8","w",420),n=F.getFileFlag(i.flag);if(!n.isWriteable())throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!i.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?x(e):e;return j("writeFile",!0,r,o,n,i.mode,w)}s(Gr,"writeFile");async function cn(r,e,t){let i=ot(t,"utf8","a",420),n=F.getFileFlag(i.flag);if(!n.isAppendable())throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!i.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?x(e):e;return j("appendFile",!0,r,o,n,i.mode,w)}s(cn,"appendFile");async function un(r,e){let t=await M(r).stat();return e?.bigint?te.clone(t):t}s(un,"fstat");async function fn(r){await M(r).close(),yt.delete(r)}s(fn,"close");async function dn(r,e=0){let t=M(r);if(e<0)throw new f(22);return t.truncate(e)}s(dn,"ftruncate");async function hn(r){return M(r).sync()}s(hn,"fsync");async function pn(r){return M(r).datasync()}s(pn,"fdatasync");async function Xr(r,e,t,i,n){let o,a=0,l,c;if(typeof e=="string"){c=typeof t=="number"?t:null;let h=typeof i=="string"?i:"utf8";a=0,o=x(e,h),l=o.length}else o=e,a=t,l=i,c=typeof n=="number"?n:null;let u=M(r);return c==null&&(c=u.getPos()),u.write(o,a,l,c)}s(Xr,"write");async function yn(r,e,t,i,n){let o=M(r);return isNaN(+n)&&(n=o.getPos()),o.read(e,t,i,n)}s(yn,"read");async function mn(r,e,t){return M(r).chown(e,t)}s(mn,"fchown");async function bn(r,e){let t=typeof e=="string"?parseInt(e,8):e;return M(r).chmod(t)}s(bn,"fchmod");async function gn(r,e,t){return M(r).utimes(le(e),le(t))}s(gn,"futimes");async function wn(r){return j("rmdir",!0,r,w)}s(wn,"rmdir");async function Sn(r,e){return j("mkdir",!0,r,fe(e,511),w)}s(Sn,"mkdir");async function dr(r,e){r=W(r);let t=await j("readdir",!0,r,w),i=[..._e.keys()];for(let o of i)if(o.startsWith(r)){let a=o.slice(r.length);if(a.includes("/")||a.length==0)continue;t.push(a)}let n=[];for(let o of t)n.push(e?.withFileTypes?new at(o,await Kr(Y(r,o))):o);return n}s(dr,"readdir");async function _n(r,e){return e=W(e),j("link",!1,r,e,w)}s(_n,"link");async function En(r,e,t="file"){if(!["file","dir","junction"].includes(t))throw new f(22,"Invalid type: "+t);return e=W(e),j("symlink",!1,r,e,t,w)}s(En,"symlink");async function xn(r,e){let t=await j("readlink",!1,r,w);return x(t,typeof e=="object"?e.encoding:e)}s(xn,"readlink");async function vn(r,e,t){return j("chown",!0,r,e,t,w)}s(vn,"chown");async function kn(r,e,t){return j("chown",!1,r,e,t,w)}s(kn,"lchown");async function An(r,e){let t=fe(e,-1);if(t<0)throw new f(22,"Invalid mode.");return j("chmod",!0,r,t,w)}s(An,"chmod");async function Fn(r,e){let t=fe(e,-1);if(t<1)throw new f(22,"Invalid mode.");return j("chmod",!1,W(r),t,w)}s(Fn,"lchmod");async function Tn(r,e,t){return j("utimes",!0,r,le(e),le(t),w)}s(Tn,"utimes");async function Cn(r,e,t){return j("utimes",!1,r,le(e),le(t),w)}s(Cn,"lutimes");async function hr(r,e){r=W(r);let{fs:t,path:i,mountPoint:n}=be(r);try{if(!(await t.stat(i,w)).isSymbolicLink())return r;let a=n+W(await t.readlink(i,w));return hr(a)}catch(o){throw st(o,{[i]:r})}}s(hr,"realpath");async function kf(r,e,t=_){throw new f(95)}s(kf,"watchFile");async function Af(r,e=_){throw new f(95)}s(Af,"unwatchFile");async function Ff(r,e,t=_){throw new f(95)}s(Ff,"watch");async function Nn(r,e=384){return j("access",!0,r,e,w)}s(Nn,"access");async function Tf(r,e){throw new f(95)}s(Tf,"createReadStream");async function Cf(r,e){throw new f(95)}s(Cf,"createWriteStream");async function Nf(r){throw new f(95)}s(Nf,"rm");async function Pf(r){throw new f(95)}s(Pf,"mkdtemp");async function If(r){throw new f(95)}s(If,"copyFile");function Lf(r,e,t=_){on(r,e).then(()=>t()).catch(t)}s(Lf,"rename");function Rf(r,e=_){zr(r).then(e).catch(()=>e(!1))}s(Rf,"exists");function Of(r,e,t=_){t=typeof e=="function"?e:t,Kr(r,typeof e!="function"?e:{}).then(i=>t(null,i)).catch(t)}s(Of,"stat");function Df(r,e,t=_){t=typeof e=="function"?e:t,sn(r,typeof e!="function"?e:{}).then(i=>t(null,i)).catch(t)}s(Df,"lstat");function Bf(r,e=0,t=_){t=typeof e=="function"?e:t,an(r,typeof e=="number"?e:0).then(()=>t()).catch(t)}s(Bf,"truncate");function Uf(r,e=_){Hr(r).then(()=>e()).catch(e)}s(Uf,"unlink");function Mf(r,e,t,i=_){let n=fe(t,420);i=typeof t=="function"?t:i,ln(r,e,n).then(o=>i(null,o)).catch(i)}s(Mf,"open");function Wf(r,e={},t=_){t=typeof e=="function"?e:t,Yr(r,typeof e=="function"?null:e)}s(Wf,"readFile");function qf(r,e,t={},i=_){i=typeof t=="function"?t:i,Gr(r,e,typeof t=="function"?void 0:t)}s(qf,"writeFile");function jf(r,e,t,i=_){i=typeof t=="function"?t:i,cn(r,e,typeof t=="function"?null:t)}s(jf,"appendFile");function $f(r,e,t=_){t=typeof e=="function"?e:t,un(r,typeof e!="function"?e:{}).then(i=>t(null,i)).catch(t)}s($f,"fstat");function Vf(r,e=_){fn(r).then(()=>e()).catch(e)}s(Vf,"close");function zf(r,e,t=_){let i=typeof e=="number"?e:0;t=typeof e=="function"?e:t,dn(r,i)}s(zf,"ftruncate");function Kf(r,e=_){hn(r).then(()=>e()).catch(e)}s(Kf,"fsync");function Hf(r,e=_){pn(r).then(()=>e()).catch(e)}s(Hf,"fdatasync");function Yf(r,e,t,i,n,o=_){let a,l,c,u=null,h;if(typeof e=="string"){switch(h="utf8",typeof t){case"function":o=t;break;case"number":u=t,h=typeof i=="string"?i:"utf8",o=typeof n=="function"?n:o;break;default:o=typeof i=="function"?i:typeof n=="function"?n:o,o(new f(22,"Invalid arguments."));return}a=x(e),l=0,c=a.length;let d=o;Xr(r,a,l,c,u).then(b=>d(null,b,X(a))).catch(d)}else{a=e,l=t,c=i,u=typeof n=="number"?n:null;let d=typeof n=="function"?n:o;Xr(r,a,l,c,u).then(b=>d(null,b,a)).catch(d)}}s(Yf,"write");function Gf(r,e,t,i,n,o=_){yn(r,e,t,i,n).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(Gf,"read");function Xf(r,e,t,i=_){mn(r,e,t).then(()=>i()).catch(i)}s(Xf,"fchown");function Jf(r,e,t){bn(r,e).then(()=>t()).catch(t)}s(Jf,"fchmod");function Zf(r,e,t,i=_){gn(r,e,t).then(()=>i()).catch(i)}s(Zf,"futimes");function Qf(r,e=_){wn(r).then(()=>e()).catch(e)}s(Qf,"rmdir");function ed(r,e,t=_){Sn(r,e).then(()=>t()).catch(t)}s(ed,"mkdir");function td(r,e,t=_){t=typeof e=="function"?e:t,dr(r,typeof e!="function"?e:{}).then(n=>t(null,n)).catch(t)}s(td,"readdir");function rd(r,e,t=_){_n(r,e).then(()=>t()).catch(t)}s(rd,"link");function id(r,e,t,i=_){let n=typeof t=="string"?t:"file";i=typeof t=="function"?t:i,En(r,e,typeof t=="function"?null:t).then(()=>i()).catch(i)}s(id,"symlink");function nd(r,e,t=_){t=typeof e=="function"?e:t,xn(r).then(i=>t(null,i)).catch(t)}s(nd,"readlink");function od(r,e,t,i=_){vn(r,e,t).then(()=>i()).catch(i)}s(od,"chown");function sd(r,e,t,i=_){kn(r,e,t).then(()=>i()).catch(i)}s(sd,"lchown");function ad(r,e,t=_){An(r,e).then(()=>t()).catch(t)}s(ad,"chmod");function ld(r,e,t=_){Fn(r,e).then(()=>t()).catch(t)}s(ld,"lchmod");function cd(r,e,t,i=_){Tn(r,e,t).then(()=>i()).catch(i)}s(cd,"utimes");function ud(r,e,t,i=_){Cn(r,e,t).then(()=>i()).catch(i)}s(ud,"lutimes");function fd(r,e,t=_){t=typeof e=="function"?e:t,hr(r,typeof e=="function"?null:e).then(i=>t(null,i)).catch(t)}s(fd,"realpath");function dd(r,e,t=_){let i=typeof e=="number"?e:4;t=typeof e=="function"?e:t,Nn(r,typeof e=="function"?null:e).then(()=>t()).catch(t)}s(dd,"access");function hd(r,e,t=_){throw new f(95)}s(hd,"watchFile");function pd(r,e=_){throw new f(95)}s(pd,"unwatchFile");function yd(r,e,t=_){throw new f(95)}s(yd,"watch");function md(r,e){throw new f(95)}s(md,"createReadStream");function bd(r,e){throw new f(95)}s(bd,"createWriteStream");function gd(r){new f(95)}s(gd,"rm");function wd(r){new f(95)}s(wd,"mkdtemp");function Sd(r,e,t,i){new f(95)}s(Sd,"copyFile");function _d(r){new f(95)}s(_d,"readv");function Ed(r,e,t,i){throw new f(95)}s(Ed,"writev");function xd(r){throw new f(95)}s(xd,"opendir");var Wi=su(zc(),1);var Ui=class extends Wi.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(i)}}addListener(t,i){return super.addListener(t,i)}on(t,i){return super.on(t,i)}once(t,i){return super.once(t,i)}prependListener(t,i){return super.prependListener(t,i)}prependOnceListener(t,i){return super.prependOnceListener(t,i)}};s(Ui,"ReadStream");var Mi=class extends Wi.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(i)}}addListener(t,i){return super.addListener(t,i)}on(t,i){return super.on(t,i)}once(t,i){return super.once(t,i)}prependListener(t,i){return super.prependListener(t,i)}prependOnceListener(t,i){return super.prependOnceListener(t,i)}};s(Mi,"WriteStream");var Fg=Zo,qi=Fg;var ji=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}syncSync(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())}closeSync(){this.syncSync()}};s(ji,"MirrorFile");var $i=class extends it{constructor({sync:t,async:i}){super();this._queue=[];this._queueRunning=!1;this._isInitialized=!1;this._initializeCallbacks=[];this._sync=t,this._async=i,this._ready=this._initialize()}static isAvailable(){return!0}get metadata(){return{...super.metadata,name:$i.Name,synchronous:!0,supportsProperties:this._sync.metadata.supportsProperties&&this._async.metadata.supportsProperties}}_syncSync(t){let i=t.getStats();this._sync.writeFileSync(t.getPath(),t.getBuffer(),F.getFileFlag("w"),i.mode,i.getCred(0,0)),this.enqueueOp({apiMethod:"writeFile",arguments:[t.getPath(),t.getBuffer(),t.getFlag(),i.mode,i.getCred(0,0)]})}renameSync(t,i,n){this._sync.renameSync(t,i,n),this.enqueueOp({apiMethod:"rename",arguments:[t,i,n]})}statSync(t,i){return this._sync.statSync(t,i)}openSync(t,i,n,o){return this._sync.openSync(t,i,n,o).closeSync(),new ji(this,t,i,this._sync.statSync(t,o),this._sync.readFileSync(t,F.getFileFlag("r"),o))}unlinkSync(t,i){this._sync.unlinkSync(t,i),this.enqueueOp({apiMethod:"unlink",arguments:[t,i]})}rmdirSync(t,i){this._sync.rmdirSync(t,i),this.enqueueOp({apiMethod:"rmdir",arguments:[t,i]})}mkdirSync(t,i,n){this._sync.mkdirSync(t,i,n),this.enqueueOp({apiMethod:"mkdir",arguments:[t,i,n]})}readdirSync(t,i){return this._sync.readdirSync(t,i)}existsSync(t,i){return this._sync.existsSync(t,i)}chmodSync(t,i,n){this._sync.chmodSync(t,i,n),this.enqueueOp({apiMethod:"chmod",arguments:[t,i,n]})}chownSync(t,i,n,o){this._sync.chownSync(t,i,n,o),this.enqueueOp({apiMethod:"chown",arguments:[t,i,n,o]})}utimesSync(t,i,n,o){this._sync.utimesSync(t,i,n,o),this.enqueueOp({apiMethod:"utimes",arguments:[t,i,n,o]})}async _initialize(){if(!this._isInitialized){let t=s(async(o,a)=>{if(o!=="/"){let c=await this._async.stat(o,U.Root);this._sync.mkdirSync(o,a,c.getCred())}let l=await this._async.readdir(o,U.Root);for(let c of l)await n(Y(o,c))},"copyDirectory"),i=s(async(o,a)=>{let l=await this._async.readFile(o,F.getFileFlag("r"),U.Root);this._sync.writeFileSync(o,l,F.getFileFlag("w"),a,U.Root)},"copyFile"),n=s(async o=>{let a=await this._async.stat(o,U.Root);a.isDirectory()?await t(o,a.mode):await i(o,a.mode)},"copyItem");try{await t("/",0),this._isInitialized=!0}catch(o){throw this._isInitialized=!1,o}}return this}enqueueOp(t){if(this._queue.push(t),!this._queueRunning){this._queueRunning=!0;let i=s(n=>{if(n)throw new Error(`WARNING: File system has desynchronized. Received following error: ${n}
5
- $`);if(this._queue.length>0){let o=this._queue.shift();o.arguments.push(i),this._async[o.apiMethod].apply(this._async,o.arguments)}else this._queueRunning=!1},"doNextOp");i()}}},Ye=$i;s(Ye,"AsyncMirror"),Ye.Name="AsyncMirror",Ye.Create=nt.bind($i),Ye.Options={sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if(!t?.metadata.synchronous)throw new f(22,"'sync' option must be a file system that supports synchronous operations")}},async:{type:"object",description:"The asynchronous file system to mirror."}};var Qo=class extends ye{constructor({folder:t,wrapped:i}){super();this._folder=t,this._wrapped=i,this._ready=this._initialize()}static isAvailable(){return!0}get metadata(){return{...super.metadata,...this._wrapped.metadata,supportsLinks:!1}}async _initialize(){if(!await this._wrapped.exists(this._folder,U.Root)&&this._wrapped.metadata.readonly)throw f.ENOENT(this._folder);return await this._wrapped.mkdir(this._folder,511,U.Root),this}},ve=Qo;s(ve,"FolderAdapter"),ve.Name="FolderAdapter",ve.Create=nt.bind(Qo),ve.Options={folder:{type:"string",description:"The folder to use as the root directory"},wrapped:{type:"object",description:"The file system to wrap"}};function Kc(r,e){if(e!==null&&typeof e=="object"){let t=e,i=t.path;i&&(i="/"+os(r,i),t.message=t.message.replace(t.path,i),t.path=i)}return e}s(Kc,"translateError");function Tg(r,e){return typeof e=="function"?function(t){arguments.length>0&&(arguments[0]=Kc(r,t)),e.apply(null,arguments)}:e}s(Tg,"wrapCallback");function Hc(r,e,t){return r.slice(r.length-4)!=="Sync"?function(){return arguments.length>0&&(e&&(arguments[0]=Y(this._folder,arguments[0])),t&&(arguments[1]=Y(this._folder,arguments[1])),arguments[arguments.length-1]=Tg(this._folder,arguments[arguments.length-1])),this._wrapped[r].apply(this._wrapped,arguments)}:function(){try{return e&&(arguments[0]=Y(this._folder,arguments[0])),t&&(arguments[1]=Y(this._folder,arguments[1])),this._wrapped[r].apply(this._wrapped,arguments)}catch(i){throw Kc(this._folder,i)}}}s(Hc,"wrapFunction");["diskSpace","stat","statSync","open","openSync","unlink","unlinkSync","rmdir","rmdirSync","mkdir","mkdirSync","readdir","readdirSync","exists","existsSync","realpath","realpathSync","truncate","truncateSync","readFile","readFileSync","writeFile","writeFileSync","appendFile","appendFileSync","chmod","chmodSync","chown","chownSync","utimes","utimesSync","readlink","readlinkSync"].forEach(r=>{ve.prototype[r]=Hc(r,!0,!1)});["rename","renameSync","link","linkSync","symlink","symlinkSync"].forEach(r=>{ve.prototype[r]=Hc(r,!0,!0)});var or=class{constructor(){this._locks=new Map}lock(e){return new Promise(t=>{this._locks.has(e)?this._locks.get(e).push(t):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let t=this._locks.get(e).shift();if(t){setTimeout(t,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(or,"Mutex");var sr=class{constructor(e){this._ready=Promise.resolve(this);this._fs=e,this._mu=new or}whenReady(){return this._ready}get metadata(){return{...this._fs.metadata,name:"LockedFS<"+this._fs.metadata.name+">"}}get fs(){return this._fs}async rename(e,t,i){await this._mu.lock(e),await this._fs.rename(e,t,i),this._mu.unlock(e)}renameSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.renameSync(e,t,i)}async stat(e,t){await this._mu.lock(e);let i=await this._fs.stat(e,t);return this._mu.unlock(e),i}statSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.statSync(e,t)}async access(e,t,i){await this._mu.lock(e),await this._fs.access(e,t,i),this._mu.unlock(e)}accessSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.accessSync(e,t,i)}async open(e,t,i,n){await this._mu.lock(e);let o=await this._fs.open(e,t,i,n);return this._mu.unlock(e),o}openSync(e,t,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.openSync(e,t,i,n)}async unlink(e,t){await this._mu.lock(e),await this._fs.unlink(e,t),this._mu.unlock(e)}unlinkSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.unlinkSync(e,t)}async rmdir(e,t){await this._mu.lock(e),await this._fs.rmdir(e,t),this._mu.unlock(e)}rmdirSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.rmdirSync(e,t)}async mkdir(e,t,i){await this._mu.lock(e),await this._fs.mkdir(e,t,i),this._mu.unlock(e)}mkdirSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.mkdirSync(e,t,i)}async readdir(e,t){await this._mu.lock(e);let i=await this._fs.readdir(e,t);return this._mu.unlock(e),i}readdirSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.readdirSync(e,t)}async exists(e,t){await this._mu.lock(e);let i=await this._fs.exists(e,t);return this._mu.unlock(e),i}existsSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.existsSync(e,t)}async realpath(e,t){await this._mu.lock(e);let i=await this._fs.realpath(e,t);return this._mu.unlock(e),i}realpathSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.realpathSync(e,t)}async truncate(e,t,i){await this._mu.lock(e),await this._fs.truncate(e,t,i),this._mu.unlock(e)}truncateSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.truncateSync(e,t,i)}async readFile(e,t,i){await this._mu.lock(e);let n=await this._fs.readFile(e,t,i);return this._mu.unlock(e),n}readFileSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.readFileSync(e,t,i)}async writeFile(e,t,i,n,o){await this._mu.lock(e),await this._fs.writeFile(e,t,i,n,o),this._mu.unlock(e)}writeFileSync(e,t,i,n,o){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.writeFileSync(e,t,i,n,o)}async appendFile(e,t,i,n,o){await this._mu.lock(e),await this._fs.appendFile(e,t,i,n,o),this._mu.unlock(e)}appendFileSync(e,t,i,n,o){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.appendFileSync(e,t,i,n,o)}async chmod(e,t,i){await this._mu.lock(e),await this._fs.chmod(e,t,i),this._mu.unlock(e)}chmodSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.chmodSync(e,t,i)}async chown(e,t,i,n){await this._mu.lock(e),await this._fs.chown(e,t,i,n),this._mu.unlock(e)}chownSync(e,t,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.chownSync(e,t,i,n)}async utimes(e,t,i,n){await this._mu.lock(e),await this._fs.utimes(e,t,i,n),this._mu.unlock(e)}utimesSync(e,t,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.utimesSync(e,t,i,n)}async link(e,t,i){await this._mu.lock(e),await this._fs.link(e,t,i),this._mu.unlock(e)}linkSync(e,t,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.linkSync(e,t,i)}async symlink(e,t,i,n){await this._mu.lock(e),await this._fs.symlink(e,t,i,n),this._mu.unlock(e)}symlinkSync(e,t,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.symlinkSync(e,t,i,n)}async readlink(e,t){await this._mu.lock(e);let i=await this._fs.readlink(e,t);return this._mu.unlock(e),i}readlinkSync(e,t){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this._fs.readlinkSync(e,t)}};s(sr,"LockedFS");var Ge="/.deletedFiles.log";function Yc(r){return 146|r}s(Yc,"makeModeWritable");function de(r){return F.getFileFlag(r)}s(de,"getFlag");var Tr=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}async sync(){this.isDirty()&&(await this._fs._syncAsync(this),this.resetDirty())}syncSync(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())}async close(){await this.sync()}closeSync(){this.syncSync()}};s(Tr,"OverlayFile");var Cr=class extends ye{constructor({writable:t,readable:i}){super();this._isInitialized=!1;this._deletedFiles={};this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;this._deleteLogError=null;if(this._writable=t,this._readable=i,this._writable.metadata.readonly)throw new f(22,"Writable file system must be writable.")}static isAvailable(){return!0}get metadata(){return{...super.metadata,name:De.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 _syncAsync(t){let i=t.getStats();return await this.createParentDirectoriesAsync(t.getPath(),i.getCred(0,0)),this._writable.writeFile(t.getPath(),t.getBuffer(),de("w"),i.mode,i.getCred(0,0))}_syncSync(t){let i=t.getStats();this.createParentDirectories(t.getPath(),i.getCred(0,0)),this._writable.writeFileSync(t.getPath(),t.getBuffer(),de("w"),i.mode,i.getCred(0,0))}async _initialize(){if(!this._isInitialized){try{let t=await this._writable.readFile(Ge,de("r"),U.Root);this._deleteLog=X(t)}catch(t){if(t.errno!==2)throw t}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(t,i){this._deleteLog=t,this._reparseDeletionLog(),this.updateLog("",i)}async rename(t,i,n){if(this.checkInitialized(),this.checkPath(t),this.checkPath(i),t===Ge||i===Ge)throw f.EPERM("Cannot rename deletion log.");let o=await this.stat(t,n);if(o.isDirectory()){if(t===i)return;let a=511;if(await this.exists(i,n)){let l=await this.stat(i,n);if(a=l.mode,l.isDirectory()){if((await this.readdir(i,n)).length>0)throw f.ENOTEMPTY(i)}else throw f.ENOTDIR(i)}if(await this._writable.exists(t,n)?await this._writable.rename(t,i,n):await this._writable.exists(i,n)||await this._writable.mkdir(i,a,n),await this._readable.exists(t,n))for(let l of await this._readable.readdir(t,n))await this.rename(Z(t,l),Z(i,l),n)}else{if(await this.exists(i,n)&&(await this.stat(i,n)).isDirectory())throw f.EISDIR(i);await this.writeFile(i,await this.readFile(t,de("r"),n),de("w"),o.mode,n)}t!==i&&await this.exists(t,n)&&await this.unlink(t,n)}renameSync(t,i,n){if(this.checkInitialized(),this.checkPath(t),this.checkPath(i),t===Ge||i===Ge)throw f.EPERM("Cannot rename deletion log.");let o=this.statSync(t,n);if(o.isDirectory()){if(t===i)return;let a=511;if(this.existsSync(i,n)){let l=this.statSync(i,n);if(a=l.mode,l.isDirectory()){if(this.readdirSync(i,n).length>0)throw f.ENOTEMPTY(i)}else throw f.ENOTDIR(i)}this._writable.existsSync(t,n)?this._writable.renameSync(t,i,n):this._writable.existsSync(i,n)||this._writable.mkdirSync(i,a,n),this._readable.existsSync(t,n)&&this._readable.readdirSync(t,n).forEach(l=>{this.renameSync(Z(t,l),Z(i,l),n)})}else{if(this.existsSync(i,n)&&this.statSync(i,n).isDirectory())throw f.EISDIR(i);this.writeFileSync(i,this.readFileSync(t,de("r"),n),de("w"),o.mode,n)}t!==i&&this.existsSync(t,n)&&this.unlinkSync(t,n)}async stat(t,i){this.checkInitialized();try{return this._writable.stat(t,i)}catch{if(this._deletedFiles[t])throw f.ENOENT(t);let o=L.clone(await this._readable.stat(t,i));return o.mode=Yc(o.mode),o}}statSync(t,i){this.checkInitialized();try{return this._writable.statSync(t,i)}catch{if(this._deletedFiles[t])throw f.ENOENT(t);let o=L.clone(this._readable.statSync(t,i));return o.mode=Yc(o.mode),o}}async open(t,i,n,o){if(this.checkInitialized(),this.checkPath(t),t===Ge)throw f.EPERM("Cannot open deletion log.");if(await this.exists(t,o))switch(i.pathExistsAction()){case 2:return await this.createParentDirectoriesAsync(t,o),this._writable.open(t,i,n,o);case 0:if(await this._writable.exists(t,o))return this._writable.open(t,i,n,o);{let a=await this._readable.readFile(t,de("r"),o),l=L.clone(await this._readable.stat(t,o));return l.mode=n,new Tr(this,t,i,l,a)}default:throw f.EEXIST(t)}else switch(i.pathNotExistsAction()){case 3:return await this.createParentDirectoriesAsync(t,o),this._writable.open(t,i,n,o);default:throw f.ENOENT(t)}}openSync(t,i,n,o){if(this.checkInitialized(),this.checkPath(t),t===Ge)throw f.EPERM("Cannot open deletion log.");if(this.existsSync(t,o))switch(i.pathExistsAction()){case 2:return this.createParentDirectories(t,o),this._writable.openSync(t,i,n,o);case 0:if(this._writable.existsSync(t,o))return this._writable.openSync(t,i,n,o);{let a=this._readable.readFileSync(t,de("r"),o),l=L.clone(this._readable.statSync(t,o));return l.mode=n,new Tr(this,t,i,l,a)}default:throw f.EEXIST(t)}else switch(i.pathNotExistsAction()){case 3:return this.createParentDirectories(t,o),this._writable.openSync(t,i,n,o);default:throw f.ENOENT(t)}}async unlink(t,i){if(this.checkInitialized(),this.checkPath(t),await this.exists(t,i))await this._writable.exists(t,i)&&await this._writable.unlink(t,i),await this.exists(t,i)&&this.deletePath(t,i);else throw f.ENOENT(t)}unlinkSync(t,i){if(this.checkInitialized(),this.checkPath(t),this.existsSync(t,i))this._writable.existsSync(t,i)&&this._writable.unlinkSync(t,i),this.existsSync(t,i)&&this.deletePath(t,i);else throw f.ENOENT(t)}async rmdir(t,i){if(this.checkInitialized(),await this.exists(t,i)){if(await this._writable.exists(t,i)&&await this._writable.rmdir(t,i),await this.exists(t,i)){if((await this.readdir(t,i)).length>0)throw f.ENOTEMPTY(t);this.deletePath(t,i)}}else throw f.ENOENT(t)}rmdirSync(t,i){if(this.checkInitialized(),this.existsSync(t,i)){if(this._writable.existsSync(t,i)&&this._writable.rmdirSync(t,i),this.existsSync(t,i)){if(this.readdirSync(t,i).length>0)throw f.ENOTEMPTY(t);this.deletePath(t,i)}}else throw f.ENOENT(t)}async mkdir(t,i,n){if(this.checkInitialized(),await this.exists(t,n))throw f.EEXIST(t);await this.createParentDirectoriesAsync(t,n),await this._writable.mkdir(t,i,n)}mkdirSync(t,i,n){if(this.checkInitialized(),this.existsSync(t,n))throw f.EEXIST(t);this.createParentDirectories(t,n),this._writable.mkdirSync(t,i,n)}async readdir(t,i){if(this.checkInitialized(),!(await this.stat(t,i)).isDirectory())throw f.ENOTDIR(t);let o=[];try{o=o.concat(await this._writable.readdir(t,i))}catch{}try{o=o.concat((await this._readable.readdir(t,i)).filter(l=>!this._deletedFiles[`${t}/${l}`]))}catch{}let a={};return o.filter(l=>{let c=!a[l];return a[l]=!0,c})}readdirSync(t,i){if(this.checkInitialized(),!this.statSync(t,i).isDirectory())throw f.ENOTDIR(t);let o=[];try{o=o.concat(this._writable.readdirSync(t,i))}catch{}try{o=o.concat(this._readable.readdirSync(t,i).filter(l=>!this._deletedFiles[`${t}/${l}`]))}catch{}let a={};return o.filter(l=>{let c=!a[l];return a[l]=!0,c})}async exists(t,i){return this.checkInitialized(),await this._writable.exists(t,i)||await this._readable.exists(t,i)&&this._deletedFiles[t]!==!0}existsSync(t,i){return this.checkInitialized(),this._writable.existsSync(t,i)||this._readable.existsSync(t,i)&&this._deletedFiles[t]!==!0}async chmod(t,i,n){this.checkInitialized(),await this.operateOnWritableAsync(t,n),await this._writable.chmod(t,i,n)}chmodSync(t,i,n){this.checkInitialized(),this.operateOnWritable(t,n),this._writable.chmodSync(t,i,n)}async chown(t,i,n,o){this.checkInitialized(),await this.operateOnWritableAsync(t,o),await this._writable.chown(t,i,n,o)}chownSync(t,i,n,o){this.checkInitialized(),this.operateOnWritable(t,o),this._writable.chownSync(t,i,n,o)}async utimes(t,i,n,o){this.checkInitialized(),await this.operateOnWritableAsync(t,o),await this._writable.utimes(t,i,n,o)}utimesSync(t,i,n,o){this.checkInitialized(),this.operateOnWritable(t,o),this._writable.utimesSync(t,i,n,o)}deletePath(t,i){this._deletedFiles[t]=!0,this.updateLog(`d${t}
6
- `,i)}updateLog(t,i){this._deleteLog+=t,this._deleteLogUpdatePending?this._deleteLogUpdateNeeded=!0:(this._deleteLogUpdatePending=!0,this._writable.writeFile(Ge,x(this._deleteLog),F.getFileFlag("w"),420,i).then(()=>{this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}).catch(n=>{this._deleteLogError=n}).finally(()=>{this._deleteLogUpdatePending=!1}))}_reparseDeletionLog(){this._deletedFiles={},this._deleteLog.split(`
7
- `).forEach(t=>{this._deletedFiles[t.slice(1)]=t.slice(0,1)==="d"})}checkInitialized(){if(this._isInitialized){if(this._deleteLogError!==null){let t=this._deleteLogError;throw this._deleteLogError=null,t}}else throw new f(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.")}checkPath(t){if(t===Ge)throw f.EPERM(t)}createParentDirectories(t,i){let n=N(t),o=[];for(;!this._writable.existsSync(n,i);)o.push(n),n=N(n);o=o.reverse();for(let a of o)this._writable.mkdirSync(a,this.statSync(a,i).mode,i)}async createParentDirectoriesAsync(t,i){let n=N(t),o=[];for(;!await this._writable.exists(n,i);)o.push(n),n=N(n);o=o.reverse();for(let a of o){let l=await this.stat(a,i);await this._writable.mkdir(a,l.mode,i)}}operateOnWritable(t,i){if(!this.existsSync(t,i))throw f.ENOENT(t);this._writable.existsSync(t,i)||this.copyToWritable(t,i)}async operateOnWritableAsync(t,i){if(!await this.exists(t,i))throw f.ENOENT(t);if(!await this._writable.exists(t,i))return this.copyToWritableAsync(t,i)}copyToWritable(t,i){let n=this.statSync(t,i);n.isDirectory()?this._writable.mkdirSync(t,n.mode,i):this.writeFileSync(t,this._readable.readFileSync(t,de("r"),i),de("w"),n.mode,i)}async copyToWritableAsync(t,i){let n=await this.stat(t,i);n.isDirectory()?await this._writable.mkdir(t,n.mode,i):await this.writeFile(t,await this._readable.readFile(t,de("r"),i),de("w"),n.mode,i)}};s(Cr,"UnlockedOverlayFS");var es=class extends sr{static isAvailable(){return Cr.isAvailable()}constructor(e){super(new Cr(e)),this._ready=this._initialize()}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}async _initialize(){return await super.fs._initialize(),this}},De=es;s(De,"OverlayFS"),De.Name="OverlayFS",De.Create=nt.bind(es),De.Options={writable:{type:"object",description:"The file system to write modified files to."},readable:{type:"object",description:"The file system that initially populates this file system."}};var Vi={};function Gc(...r){for(let e of r)Vi[e.Name]=e}s(Gc,"registerBackend");Gc(Ye,ve,me,De);var Nr=class{constructor(e,t){this.key=e;this.value=t;this.prev=null;this.next=null}};s(Nr,"LRUNode");var zi=class{constructor(e){this.limit=e;this.size=0;this.map={};this.head=null;this.tail=null}set(e,t){let i=new Nr(e,t);this.map[e]?(this.map[e].value=i.value,this.remove(i.key)):this.size>=this.limit&&(delete this.map[this.tail.key],this.size--,this.tail=this.tail.prev,this.tail.next=null),this.setHead(i)}get(e){if(this.map[e]){let t=this.map[e].value,i=new Nr(e,t);return this.remove(e),this.setHead(i),t}else return null}remove(e){let t=this.map[e];t&&(t.prev!==null?t.prev.next=t.next:this.head=t.next,t.next!==null?t.next.prev=t.prev:this.tail=t.prev,delete this.map[e],this.size--)}removeAll(){this.size=0,this.map={},this.head=null,this.tail=null}setHead(e){e.next=this.head,e.prev=null,this.head!==null&&(this.head.prev=e),this.head=e,this.tail===null&&(this.tail=e),this.size++,this.map[e.key]=e}};s(zi,"LRUCache");var ar=class extends ue{constructor(e,t,i,n,o){super(e,t,i,n,o)}async sync(){this.isDirty()&&(await this._fs._sync(this.getPath(),this.getBuffer(),this.getStats()),this.resetDirty())}async close(){this.sync()}};s(ar,"AsyncKeyValueFile");var Ki=class extends ye{constructor(t){super();this._cache=null;t>0&&(this._cache=new zi(t))}static isAvailable(){return!0}async init(t){this.store=t,await this.makeRootDirectory()}getName(){return this.store.name()}isReadOnly(){return!1}supportsSymlinks(){return!1}supportsProps(){return!0}supportsSynch(){return!1}async empty(){this._cache&&this._cache.removeAll(),await this.store.clear(),await this.makeRootDirectory()}async access(t,i,n){let o=this.store.beginTransaction("readonly"),a=await this.findINode(o,t);if(!a)throw f.ENOENT(t);if(!a.toStats().hasAccess(i,n))throw f.EACCES(t)}async rename(t,i,n){let o=this._cache;this._cache&&(this._cache=null,o.removeAll());try{let a=this.store.beginTransaction("readwrite"),l=N(t),c=ne(t),u=N(i),h=ne(i),d=await this.findINode(a,l),b=await this.getDirListing(a,l,d);if(!d.toStats().hasAccess(2,n))throw f.EACCES(t);if(!b[c])throw f.ENOENT(t);let m=b[c];if(delete b[c],(u+"/").indexOf(t+"/")===0)throw new f(16,l);let g,y;if(u===l?(g=d,y=b):(g=await this.findINode(a,u),y=await this.getDirListing(a,u,g)),y[h]){let v=await this.getINode(a,i,y[h]);if(v.isFile())try{await a.del(v.id),await a.del(y[h])}catch(S){throw await a.abort(),S}else throw f.EPERM(i)}y[h]=m;try{await a.put(d.id,x(JSON.stringify(b)),!0),await a.put(g.id,x(JSON.stringify(y)),!0)}catch(v){throw await a.abort(),v}await a.commit()}finally{o&&(this._cache=o)}}async stat(t,i){let n=this.store.beginTransaction("readonly"),a=(await this.findINode(n,t)).toStats();if(!a.hasAccess(4,i))throw f.EACCES(t);return a}async createFile(t,i,n,o){let a=this.store.beginTransaction("readwrite"),l=new Uint8Array(0),c=await this.commitNewFile(a,t,R.FILE,n,o,l);return new ar(this,t,i,c.toStats(),l)}async openFile(t,i,n){let o=this.store.beginTransaction("readonly"),a=await this.findINode(o,t),l=await o.get(a.id);if(!a.toStats().hasAccess(i.getMode(),n))throw f.EACCES(t);if(l===void 0)throw f.ENOENT(t);return new ar(this,t,i,a.toStats(),l)}async unlink(t,i){return this.removeEntry(t,!1,i)}async rmdir(t,i){if((await this.readdir(t,i)).length>0)throw f.ENOTEMPTY(t);await this.removeEntry(t,!0,i)}async mkdir(t,i,n){let o=this.store.beginTransaction("readwrite"),a=x("{}");await this.commitNewFile(o,t,R.DIRECTORY,i,n,a)}async readdir(t,i){let n=this.store.beginTransaction("readonly"),o=await this.findINode(n,t);if(!o.toStats().hasAccess(4,i))throw f.EACCES(t);return Object.keys(await this.getDirListing(n,t,o))}async chmod(t,i,n){await(await this.openFile(t,F.getFileFlag("r+"),n)).chmod(i)}async chown(t,i,n,o){await(await this.openFile(t,F.getFileFlag("r+"),o)).chown(i,n)}async _sync(t,i,n){let o=this.store.beginTransaction("readwrite"),a=await this._findINode(o,N(t),ne(t)),l=await this.getINode(o,t,a),c=l.update(n);try{await o.put(l.id,i,!0),c&&await o.put(a,l.serialize(),!0)}catch(u){throw await o.abort(),u}await o.commit()}async makeRootDirectory(){let t=this.store.beginTransaction("readwrite");if(await t.get(pe)===void 0){let i=new Date().getTime(),n=new ae(pt(),4096,511|R.DIRECTORY,i,i,i,0,0);await t.put(n.id,x("{}"),!1),await t.put(pe,n.serialize(),!1),await t.commit()}}async _findINode(t,i,n,o=new Set){let a=Y(i,n);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),this._cache){let l=this._cache.get(a);if(l)return l}if(i==="/"){if(n==="")return this._cache&&this._cache.set(a,pe),pe;{let l=await this.getINode(t,i,pe),c=await this.getDirListing(t,i,l);if(c[n]){let u=c[n];return this._cache&&this._cache.set(a,u),u}else throw f.ENOENT(Z(i,n))}}else{let l=await this.findINode(t,i,o),c=await this.getDirListing(t,i,l);if(c[n]){let u=c[n];return this._cache&&this._cache.set(a,u),u}else throw f.ENOENT(Z(i,n))}}async findINode(t,i,n=new Set){let o=await this._findINode(t,N(i),ne(i),n);return this.getINode(t,i,o)}async getINode(t,i,n){let o=await t.get(n);if(!o)throw f.ENOENT(i);return ae.Deserialize(o)}async getDirListing(t,i,n){if(!n.isDirectory())throw f.ENOTDIR(i);let o=await t.get(n.id);try{return JSON.parse(X(o))}catch{throw f.ENOENT(i)}}async addNewNode(t,i){let n=0,o=s(async()=>{if(++n===5)throw new f(5,"Unable to commit data to key-value store.");{let a=pt();return await t.put(a,i,!1)?a:o()}},"reroll");return o()}async commitNewFile(t,i,n,o,a,l){let c=N(i),u=ne(i),h=await this.findINode(t,c),d=await this.getDirListing(t,c,h),b=new Date().getTime();if(!h.toStats().hasAccess(2,a))throw f.EACCES(i);if(i==="/")throw f.EEXIST(i);if(d[u])throw await t.abort(),f.EEXIST(i);try{let m=await this.addNewNode(t,l),g=new ae(m,l.length,o|n,b,b,b,a.uid,a.gid),y=await this.addNewNode(t,g.serialize());return d[u]=y,await t.put(h.id,x(JSON.stringify(d)),!0),await t.commit(),g}catch(m){throw t.abort(),m}}async removeEntry(t,i,n){this._cache&&this._cache.remove(t);let o=this.store.beginTransaction("readwrite"),a=N(t),l=await this.findINode(o,a),c=await this.getDirListing(o,a,l),u=ne(t);if(!c[u])throw f.ENOENT(t);let h=c[u],d=await this.getINode(o,t,h);if(!d.toStats().hasAccess(2,n))throw f.EACCES(t);if(delete c[u],!i&&d.isDirectory())throw f.EISDIR(t);if(i&&!d.isDirectory())throw f.ENOTDIR(t);try{await o.del(d.id),await o.del(h),await o.put(l.id,x(JSON.stringify(c)),!0)}catch(b){throw await o.abort(),b}await o.commit()}};s(Ki,"AsyncKeyValueFileSystem");var lr=class{static fromListing(e){let t=new lr,i=new Xe;t._index["/"]=i;let n=[["",e,i]];for(;n.length>0;){let o,a=n.pop(),l=a[0],c=a[1],u=a[2];for(let h in c)if(Object.prototype.hasOwnProperty.call(c,h)){let d=c[h],b=`${l}/${h}`;d?(t._index[b]=o=new Xe,n.push([b,d,o])):o=new Pr(new L(R.FILE,-1,365)),u&&(u._ls[h]=o)}}return t}constructor(){this._index={},this.addPath("/",new Xe)}fileIterator(e){for(let t in this._index)if(Object.prototype.hasOwnProperty.call(this._index,t)){let i=this._index[t],n=i.getListing();for(let o of n){let a=i.getItem(o);Xc(a)&&e(a.getData())}}}addPath(e,t){if(!t)throw new Error("Inode must be specified");if(e[0]!=="/")throw new Error("Path must be absolute, got: "+e);if(Object.prototype.hasOwnProperty.call(this._index,e))return this._index[e]===t;let i=this._split_path(e),n=i[0],o=i[1],a=this._index[n];return a===void 0&&e!=="/"&&(a=new Xe,!this.addPath(n,a))||e!=="/"&&!a.addItem(o,t)?!1:(ts(t)&&(this._index[e]=t),!0)}addPathFast(e,t){let i=e.lastIndexOf("/"),n=i===0?"/":e.substring(0,i),o=e.substring(i+1),a=this._index[n];return a===void 0&&(a=new Xe,this.addPathFast(n,a)),a.addItem(o,t)?(t.isDir()&&(this._index[e]=t),!0):!1}removePath(e){let t=this._split_path(e),i=t[0],n=t[1],o=this._index[i];if(o===void 0)return null;let a=o.remItem(n);if(a===null)return null;if(ts(a)){let l=a.getListing();for(let c of l)this.removePath(e+"/"+c);e!=="/"&&delete this._index[e]}return a}ls(e){let t=this._index[e];return t===void 0?null:t.getListing()}getInode(e){let t=this._split_path(e),i=t[0],n=t[1],o=this._index[i];return o===void 0?null:i===e?o:o.getItem(n)}_split_path(e){let t=N(e),i=e.slice(t.length+(t==="/"?0:1));return[t,i]}};s(lr,"FileIndex");var Pr=class{constructor(e){this.data=e}isFile(){return!0}isDir(){return!1}getData(){return this.data}setData(e){this.data=e}toStats(){return new L(R.FILE,4096,438)}};s(Pr,"IndexFileInode");var Xe=class{constructor(e=null){this.data=e;this._ls={}}isFile(){return!1}isDir(){return!0}getData(){return this.data}getStats(){return new L(R.DIRECTORY,4096,365)}toStats(){return this.getStats()}getListing(){return Object.keys(this._ls)}getItem(e){let t=this._ls[e];return t||null}addItem(e,t){return e in this._ls?!1:(this._ls[e]=t,!0)}remItem(e){let t=this._ls[e];return t===void 0?null:(delete this._ls[e],t)}};s(Xe,"IndexDirInode");function Xc(r){return!!r&&r.isFile()}s(Xc,"isIndexFileInode");function ts(r){return!!r&&r.isDir()}s(ts,"isIndexDirInode");function Zc(r,e=0,t=0){return cs(new U(e,t,e,t,e,t)),qi.initialize(r)}s(Zc,"initialize");async function Jc(r){("fs"in r||r instanceof rt)&&(r={"/":r});for(let[e,t]of Object.entries(r))typeof t!="number"&&(t instanceof rt||(typeof t=="string"&&(t={fs:t}),r[e]=await Qc(t)));return Zc(r)}s(Jc,"_configure");function Cg(r,e){if(typeof e!="function")return Jc(r);Jc(r).then(()=>e()).catch(t=>e(t))}s(Cg,"configure");async function rs({fs:r,options:e={}}){if(!r)throw new f(1,'Missing "fs" property on configuration object.');if(typeof e!="object"||e===null)throw new f(22,'Invalid "options" property on configuration object.');let t=Object.keys(e).filter(n=>n!="fs");for(let n of t){let o=e[n];if(o===null||typeof o!="object"||!("fs"in o))continue;let a=await rs(o);e[n]=a}let i=Vi[r];if(i)return i.Create(e);throw new f(1,`File system ${r} is not available in ZenFS.`)}s(rs,"_getFileSystem");function Qc(r,e){if(typeof e!="function")return rs(r);rs(r).then(t=>e(null,t)).catch(t=>e(t))}s(Qc,"getFileSystem");var Ng=qi;return au(Pg);})();
1
+ var ZenFS=(()=>{var Zc=Object.create;var At=Object.defineProperty;var eu=Object.getOwnPropertyDescriptor;var tu=Object.getOwnPropertyNames;var iu=Object.getPrototypeOf,ru=Object.prototype.hasOwnProperty;var nu=(t,e,i)=>e in t?At(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var o=(t,e)=>At(t,"name",{value:e,configurable:!0});var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qi=(t,e)=>{for(var i in e)At(t,i,{get:e[i],enumerable:!0})},ss=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of tu(e))!ru.call(t,n)&&n!==i&&At(t,n,{get:()=>e[n],enumerable:!(r=eu(e,n))||r.enumerable});return t};var ou=(t,e,i)=>(i=t!=null?Zc(iu(t)):{},ss(e||!t||!t.__esModule?At(i,"default",{value:t,enumerable:!0}):i,t)),su=t=>ss(At({},"__esModule",{value:!0}),t);var Ye=(t,e,i)=>(nu(t,typeof e!="symbol"?e+"":e,i),i);var xs=N(sr=>{"use strict";sr.byteLength=Nd;sr.toByteArray=Fd;sr.fromByteArray=Ld;var ke=[],he=[],kd=typeof Uint8Array<"u"?Uint8Array:Array,On="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ut=0,_s=On.length;ut<_s;++ut)ke[ut]=On[ut],he[On.charCodeAt(ut)]=ut;var ut,_s;he["-".charCodeAt(0)]=62;he["_".charCodeAt(0)]=63;function Es(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(Es,"getLens");function Nd(t){var e=Es(t),i=e[0],r=e[1];return(i+r)*3/4-r}o(Nd,"byteLength");function Td(t,e,i){return(e+i)*3/4-i}o(Td,"_byteLength");function Fd(t){var e,i=Es(t),r=i[0],n=i[1],s=new kd(Td(t,r,n)),a=0,l=n>0?r-4:r,c;for(c=0;c<l;c+=4)e=he[t.charCodeAt(c)]<<18|he[t.charCodeAt(c+1)]<<12|he[t.charCodeAt(c+2)]<<6|he[t.charCodeAt(c+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=he[t.charCodeAt(c)]<<2|he[t.charCodeAt(c+1)]>>4,s[a++]=e&255),n===1&&(e=he[t.charCodeAt(c)]<<10|he[t.charCodeAt(c+1)]<<4|he[t.charCodeAt(c+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}o(Fd,"toByteArray");function Id(t){return ke[t>>18&63]+ke[t>>12&63]+ke[t>>6&63]+ke[t&63]}o(Id,"tripletToBase64");function Pd(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(Id(r));return n.join("")}o(Pd,"encodeChunk");function Ld(t){for(var e,i=t.length,r=i%3,n=[],s=16383,a=0,l=i-r;a<l;a+=s)n.push(Pd(t,a,a+s>l?l:a+s));return r===1?(e=t[i-1],n.push(ke[e>>2]+ke[e<<4&63]+"==")):r===2&&(e=(t[i-2]<<8)+t[i-1],n.push(ke[e>>10]+ke[e>>4&63]+ke[e<<2&63]+"=")),n.join("")}o(Ld,"fromByteArray")});var vs=N(Bn=>{Bn.read=function(t,e,i,r,n){var s,a,l=n*8-r-1,c=(1<<l)-1,u=c>>1,d=-7,h=i?n-1:0,b=i?-1:1,m=t[e+h];for(h+=b,s=m&(1<<-d)-1,m>>=-d,d+=l;d>0;s=s*256+t[e+h],h+=b,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=r;d>0;a=a*256+t[e+h],h+=b,d-=8);if(s===0)s=1-u;else{if(s===c)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-u}return(m?-1:1)*a*Math.pow(2,s-r)};Bn.write=function(t,e,i,r,n,s){var a,l,c,u=s*8-n-1,d=(1<<u)-1,h=d>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:s-1,g=r?1:-1,y=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*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=b/c:e+=b*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-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+m]=l&255,m+=g,l/=256,n-=8);for(a=a<<n|l,u+=n;u>0;t[i+m]=a&255,m+=g,a/=256,u-=8);t[i+m-g]|=y*128}});var Me=N(zt=>{"use strict";var Dn=xs(),$t=vs(),As=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;zt.Buffer=p;zt.SlowBuffer=Md;zt.INSPECT_MAX_BYTES=50;var ar=2147483647;zt.kMaxLength=ar;p.TYPED_ARRAY_SUPPORT=Cd();!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 Cd(){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(Cd,"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 De(t){if(t>ar)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}o(De,"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 Fs(t,e,i)}o(p,"Buffer");p.poolSize=8192;function Fs(t,e,i){if(typeof t=="string")return Od(t,e);if(ArrayBuffer.isView(t))return Bd(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(Ne(t,ArrayBuffer)||t&&Ne(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ne(t,SharedArrayBuffer)||t&&Ne(t.buffer,SharedArrayBuffer)))return Un(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=Dd(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(Fs,"from");p.from=function(t,e,i){return Fs(t,e,i)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function Is(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(Is,"assertSize");function Rd(t,e,i){return Is(t),t<=0?De(t):e!==void 0?typeof i=="string"?De(t).fill(e,i):De(t).fill(e):De(t)}o(Rd,"alloc");p.alloc=function(t,e,i){return Rd(t,e,i)};function qn(t){return Is(t),De(t<0?0:$n(t)|0)}o(qn,"allocUnsafe");p.allocUnsafe=function(t){return qn(t)};p.allocUnsafeSlow=function(t){return qn(t)};function Od(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=Ps(t,e)|0,r=De(i),n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}o(Od,"fromString");function Mn(t){let e=t.length<0?0:$n(t.length)|0,i=De(e);for(let r=0;r<e;r+=1)i[r]=t[r]&255;return i}o(Mn,"fromArrayLike");function Bd(t){if(Ne(t,Uint8Array)){let e=new Uint8Array(t);return Un(e.buffer,e.byteOffset,e.byteLength)}return Mn(t)}o(Bd,"fromArrayView");function Un(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(Un,"fromArrayBuffer");function Dd(t){if(p.isBuffer(t)){let e=$n(t.length)|0,i=De(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||zn(t.length)?De(0):Mn(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Mn(t.data)}o(Dd,"fromObject");function $n(t){if(t>=ar)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ar.toString(16)+" bytes");return t|0}o($n,"checked");function Md(t){return+t!=t&&(t=0),p.alloc(+t)}o(Md,"SlowBuffer");p.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype},"isBuffer");p.compare=o(function(e,i){if(Ne(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),Ne(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(Ne(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 Ps(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ne(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 Wn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Ws(t).length;default:if(n)return r?-1:Wn(t).length;e=(""+e).toLowerCase(),n=!0}}o(Ps,"byteLength");p.byteLength=Ps;function Ud(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 Gd(this,e,i);case"utf8":case"utf-8":return Cs(this,e,i);case"ascii":return Kd(this,e,i);case"latin1":case"binary":return Yd(this,e,i);case"base64":return Vd(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xd(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}o(Ud,"slowToString");p.prototype._isBuffer=!0;function ft(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}o(ft,"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)ft(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)ft(this,i,i+3),ft(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)ft(this,i,i+7),ft(this,i+1,i+6),ft(this,i+2,i+5),ft(this,i+3,i+4);return this},"swap64");p.prototype.toString=o(function(){let e=this.length;return e===0?"":arguments.length===0?Cs(this,0,e):Ud.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=zt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");As&&(p.prototype[As]=p.prototype.inspect);p.prototype.compare=o(function(e,i,r,n,s){if(Ne(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,c=Math.min(a,l),u=this.slice(n,s),d=e.slice(i,r);for(let h=0;h<c;++h)if(u[h]!==d[h]){a=u[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function Ls(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,zn(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:ks(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):ks(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}o(Ls,"bidirectionalIndexOf");function ks(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 c(d,h){return s===1?d[h]:d.readUInt16BE(h*s)}o(c,"read");let u;if(n){let d=-1;for(u=i;u<a;u++)if(c(t,u)===c(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===l)return d*s}else d!==-1&&(u-=u-d),d=-1}else for(i+l>a&&(i=a-l),u=i;u>=0;u--){let d=!0;for(let h=0;h<l;h++)if(c(t,u+h)!==c(e,h)){d=!1;break}if(d)return u}return-1}o(ks,"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 Ls(this,e,i,r,!0)},"indexOf");p.prototype.lastIndexOf=o(function(e,i,r){return Ls(this,e,i,r,!1)},"lastIndexOf");function Wd(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(zn(l))return a;t[i+a]=l}return a}o(Wd,"hexWrite");function qd(t,e,i,r){return lr(Wn(e,t.length-i),t,i,r)}o(qd,"utf8Write");function $d(t,e,i,r){return lr(eh(e),t,i,r)}o($d,"asciiWrite");function jd(t,e,i,r){return lr(Ws(e),t,i,r)}o(jd,"base64Write");function zd(t,e,i,r){return lr(th(e,t.length-i),t,i,r)}o(zd,"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 Wd(this,e,i,r);case"utf8":case"utf-8":return qd(this,e,i,r);case"ascii":case"latin1":case"binary":return $d(this,e,i,r);case"base64":return jd(this,e,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zd(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 Vd(t,e,i){return e===0&&i===t.length?Dn.fromByteArray(t):Dn.fromByteArray(t.slice(e,i))}o(Vd,"base64Slice");function Cs(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 c,u,d,h;switch(l){case 1:s<128&&(a=s);break;case 2:c=t[n+1],(c&192)===128&&(h=(s&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[n+1],u=t[n+2],(c&192)===128&&(u&192)===128&&(h=(s&15)<<12|(c&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[n+1],u=t[n+2],d=t[n+3],(c&192)===128&&(u&192)===128&&(d&192)===128&&(h=(s&15)<<18|(c&63)<<12|(u&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 Hd(r)}o(Cs,"utf8Slice");var Ns=4096;function Hd(t){let e=t.length;if(e<=Ns)return String.fromCharCode.apply(String,t);let i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=Ns));return i}o(Hd,"decodeCodePointsArray");function Kd(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(Kd,"asciiSlice");function Yd(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(Yd,"latin1Slice");function Gd(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+=ih[t[s]];return n}o(Gd,"hexSlice");function Xd(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(Xd,"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 K(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(K,"checkOffset");p.prototype.readUintLE=p.prototype.readUIntLE=o(function(e,i,r){e=e>>>0,i=i>>>0,r||K(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||K(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||K(e,1,this.length),this[e]},"readUInt8");p.prototype.readUint16LE=p.prototype.readUInt16LE=o(function(e,i){return e=e>>>0,i||K(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||K(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||K(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||K(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");p.prototype.readBigUInt64LE=it(o(function(e){e=e>>>0,jt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&vi(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=it(o(function(e){e=e>>>0,jt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&vi(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||K(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||K(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||K(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||K(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||K(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||K(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||K(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");p.prototype.readBigInt64LE=it(o(function(e){e=e>>>0,jt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&vi(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=it(o(function(e){e=e>>>0,jt(e,"offset");let i=this[e],r=this[e+7];(i===void 0||r===void 0)&&vi(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||K(e,4,this.length),$t.read(this,e,!0,23,4)},"readFloatLE");p.prototype.readFloatBE=o(function(e,i){return e=e>>>0,i||K(e,4,this.length),$t.read(this,e,!1,23,4)},"readFloatBE");p.prototype.readDoubleLE=o(function(e,i){return e=e>>>0,i||K(e,8,this.length),$t.read(this,e,!0,52,8)},"readDoubleLE");p.prototype.readDoubleBE=o(function(e,i){return e=e>>>0,i||K(e,8,this.length),$t.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 Rs(t,e,i,r,n){Us(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(Rs,"wrtBigUInt64LE");function Os(t,e,i,r,n){Us(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(Os,"wrtBigUInt64BE");p.prototype.writeBigUInt64LE=it(o(function(e,i=0){return Rs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));p.prototype.writeBigUInt64BE=it(o(function(e,i=0){return Os(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 c=Math.pow(2,8*r-1);ne(this,e,i,r,c-1,-c)}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 c=Math.pow(2,8*r-1);ne(this,e,i,r,c-1,-c)}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=it(o(function(e,i=0){return Rs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));p.prototype.writeBigInt64BE=it(o(function(e,i=0){return Os(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Bs(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(Bs,"checkIEEE754");function Ds(t,e,i,r,n){return e=+e,i=i>>>0,n||Bs(t,e,i,4,34028234663852886e22,-34028234663852886e22),$t.write(t,e,i,r,23,4),i+4}o(Ds,"writeFloat");p.prototype.writeFloatLE=o(function(e,i,r){return Ds(this,e,i,!0,r)},"writeFloatLE");p.prototype.writeFloatBE=o(function(e,i,r){return Ds(this,e,i,!1,r)},"writeFloatBE");function Ms(t,e,i,r,n){return e=+e,i=i>>>0,n||Bs(t,e,i,8,17976931348623157e292,-17976931348623157e292),$t.write(t,e,i,r,52,8),i+8}o(Ms,"writeDouble");p.prototype.writeDoubleLE=o(function(e,i,r){return Ms(this,e,i,!0,r)},"writeDoubleLE");p.prototype.writeDoubleBE=o(function(e,i,r){return Ms(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 qt={};function jn(t,e,i){qt[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(jn,"E");jn("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);jn("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);jn("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=Ts(String(i)):typeof i=="bigint"&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=Ts(n)),n+="n"),r+=` It must be ${e}. Received ${n}`,r},RangeError);function Ts(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(Ts,"addNumericalSeparator");function Jd(t,e,i){jt(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&vi(e,t.length-(i+1))}o(Jd,"checkBounds");function Us(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 qt.ERR_OUT_OF_RANGE("value",l,t)}Jd(r,n,s)}o(Us,"checkIntBI");function jt(t,e){if(typeof t!="number")throw new qt.ERR_INVALID_ARG_TYPE(e,"number",t)}o(jt,"validateNumber");function vi(t,e,i){throw Math.floor(t)!==t?(jt(t,i),new qt.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new qt.ERR_BUFFER_OUT_OF_BOUNDS:new qt.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}o(vi,"boundsError");var Qd=/[^+/0-9A-Za-z-_]/g;function Zd(t){if(t=t.split("=")[0],t=t.trim().replace(Qd,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}o(Zd,"base64clean");function Wn(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(Wn,"utf8ToBytes");function eh(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}o(eh,"asciiToBytes");function th(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(th,"utf16leToBytes");function Ws(t){return Dn.toByteArray(Zd(t))}o(Ws,"base64ToBytes");function lr(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(lr,"blitBuffer");function Ne(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}o(Ne,"isInstance");function zn(t){return t!==t}o(zn,"numberIsNaN");var ih=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 it(t){return typeof BigInt>"u"?rh:t}o(it,"defineBigIntMethod");function rh(){throw new Error("BigInt not supported")}o(rh,"BufferBigIntNotDefined")});var R=N((AS,qs)=>{"use strict";qs.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 Vt=N((kS,cr)=>{"use strict";var{AbortController:$s,AbortSignal:nh}=typeof self<"u"?self:typeof window<"u"?window:void 0;cr.exports=$s;cr.exports.AbortSignal=nh;cr.exports.default=$s});var Ai=N((NS,Vn)=>{"use strict";var Ht=typeof Reflect=="object"?Reflect:null,js=Ht&&typeof Ht.apply=="function"?Ht.apply:o(function(e,i,r){return Function.prototype.apply.call(e,i,r)},"ReflectApply"),ur;Ht&&typeof Ht.ownKeys=="function"?ur=Ht.ownKeys:Object.getOwnPropertySymbols?ur=o(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):ur=o(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function oh(t){console&&console.warn&&console.warn(t)}o(oh,"ProcessEmitWarning");var Vs=Number.isNaN||o(function(e){return e!==e},"NumberIsNaN");function P(){P.init.call(this)}o(P,"EventEmitter");Vn.exports=P;Vn.exports.once=ch;P.EventEmitter=P;P.prototype._events=void 0;P.prototype._eventsCount=0;P.prototype._maxListeners=void 0;var zs=10;function fr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}o(fr,"checkListener");Object.defineProperty(P,"defaultMaxListeners",{enumerable:!0,get:function(){return zs},set:function(t){if(typeof t!="number"||t<0||Vs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");zs=t}});P.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};P.prototype.setMaxListeners=o(function(e){if(typeof e!="number"||e<0||Vs(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 Hs(t){return t._maxListeners===void 0?P.defaultMaxListeners:t._maxListeners}o(Hs,"_getMaxListeners");P.prototype.getMaxListeners=o(function(){return Hs(this)},"getMaxListeners");P.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 c=s[e];if(c===void 0)return!1;if(typeof c=="function")js(c,this,i);else for(var u=c.length,d=Js(c,u),r=0;r<u;++r)js(d[r],this,i);return!0},"emit");function Ks(t,e,i,r){var n,s,a;if(fr(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=Hs(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,oh(l)}return t}o(Ks,"_addListener");P.prototype.addListener=o(function(e,i){return Ks(this,e,i,!1)},"addListener");P.prototype.on=P.prototype.addListener;P.prototype.prependListener=o(function(e,i){return Ks(this,e,i,!0)},"prependListener");function sh(){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(sh,"onceWrapper");function Ys(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=sh.bind(r);return n.listener=i,r.wrapFn=n,n}o(Ys,"_onceWrap");P.prototype.once=o(function(e,i){return fr(i),this.on(e,Ys(this,e,i)),this},"once");P.prototype.prependOnceListener=o(function(e,i){return fr(i),this.prependListener(e,Ys(this,e,i)),this},"prependOnceListener");P.prototype.removeListener=o(function(e,i){var r,n,s,a,l;if(fr(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():ah(r,s),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");P.prototype.off=P.prototype.removeListener;P.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 Gs(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?lh(n):Js(n,n.length)}o(Gs,"_listeners");P.prototype.listeners=o(function(e){return Gs(this,e,!0)},"listeners");P.prototype.rawListeners=o(function(e){return Gs(this,e,!1)},"rawListeners");P.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Xs.call(t,e)};P.prototype.listenerCount=Xs;function Xs(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(Xs,"listenerCount");P.prototype.eventNames=o(function(){return this._eventsCount>0?ur(this._events):[]},"eventNames");function Js(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}o(Js,"arrayClone");function ah(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}o(ah,"spliceOne");function lh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}o(lh,"unwrapListeners");function ch(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"),Qs(t,e,s,{once:!0}),e!=="error"&&uh(t,n,{once:!0})})}o(ch,"once");function uh(t,e,i){typeof t.on=="function"&&Qs(t,"error",e,i)}o(uh,"addErrorHandlerIfEventEmitter");function Qs(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(Qs,"eventTargetAgnosticAddListener")});var Q=N((FS,Hn)=>{"use strict";var fh=Me(),{kResistStopPropagation:dh,SymbolDispose:hh}=R(),ph=globalThis.AbortSignal||Vt().AbortSignal,yh=globalThis.AbortController||Vt().AbortController,mh=Object.getPrototypeOf(async function(){}).constructor,Zs=globalThis.Blob||fh.Blob,bh=o(typeof Zs<"u"?function(e){return e instanceof Zs}:function(e){return!1},"isBlob"),ea=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"),gh=o((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),dr=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(dr,"AggregateError");Hn.exports={AggregateError:dr,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 mh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:bh,deprecate(t,e){return t},addAbortListener:Ai().addAbortListener||o(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);ea(e,"signal"),gh(i,"listener");let r;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[dh]:!0}),r=o(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[hh](){var n;(n=r)===null||n===void 0||n()}}},"addAbortListener"),AbortSignalAny:ph.any||o(function(e){if(e.length===1)return e[0];let i=new yh,r=o(()=>i.abort(),"abort");return e.forEach(n=>{ea(n,"signals"),n.addEventListener("abort",r,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",r))},{once:!0}),i.signal},"AbortSignalAny")};Hn.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var te=N((PS,ra)=>{"use strict";var{format:wh,inspect:pr,AggregateError:Sh}=Q(),_h=globalThis.AggregateError||Sh,Eh=Symbol("kIsNodeError"),xh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],vh=/^([A-Z][a-z0-9]*)+$/,Ah="__node_internal_",yr={};function dt(t,e){if(!t)throw new yr.ERR_INTERNAL_ASSERTION(e)}o(dt,"assert");function ta(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(ta,"addNumericalSeparator");function kh(t,e,i){if(typeof e=="function")return dt(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 dt(r===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r}).`),i.length===0?e:wh(e,...i)}o(kh,"getMessage");function X(t,e,i){i||(i=Error);class r extends i{constructor(...s){super(kh(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[Eh]=!0,yr[t]=r}o(X,"E");function ia(t){let e=Ah+t.name;return Object.defineProperty(t,"name",{value:e}),t}o(ia,"hideStackFrames");function Nh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new _h([e,t],e.message);return i.code=e.code,i}return t||e}o(Nh,"aggregateTwoErrors");var hr=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new yr.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};o(hr,"AbortError");X("ERR_ASSERTION","%s",Error);X("ERR_INVALID_ARG_TYPE",(t,e,i)=>{dt(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 c of e)dt(typeof c=="string","All expected entries have to be of type string"),xh.includes(c)?n.push(c.toLowerCase()):vh.test(c)?s.push(c):(dt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(s.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,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 c=n.pop();r+=`one of type ${n.join(", ")}, or ${c}`}}(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 c=s.pop();r+=`an instance of ${s.join(", ")}, or ${c}`}}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 c=a.pop();r+=`one of ${a.join(", ")}, or ${c}`}}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 c=pr(i,{depth:-1});r+=`. Received ${c}`}}else{let c=pr(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),r+=`. Received type ${typeof i} (${c})`}return r},TypeError);X("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let r=pr(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)=>{dt(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)=>{dt(e,'Missing "range" argument');let r;return Number.isInteger(i)&&Math.abs(i)>2**32?r=ta(String(i)):typeof i=="bigint"?(r=String(i),(i>2n**32n||i<-(2n**32n))&&(r=ta(r)),r+="n"):r=pr(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);ra.exports={AbortError:hr,aggregateTwoErrors:ia(Nh),hideStackFrames:ia,codes:yr}});var Yt=N((CS,ha)=>{"use strict";var{ArrayIsArray:Yn,ArrayPrototypeIncludes:aa,ArrayPrototypeJoin:la,ArrayPrototypeMap:Th,NumberIsInteger:Gn,NumberIsNaN:Fh,NumberMAX_SAFE_INTEGER:Ih,NumberMIN_SAFE_INTEGER:Ph,NumberParseInt:Lh,ObjectPrototypeHasOwnProperty:Ch,RegExpPrototypeExec:ca,String:Rh,StringPrototypeToUpperCase:Oh,StringPrototypeTrim:Bh}=R(),{hideStackFrames:pe,codes:{ERR_SOCKET_BAD_PORT:Dh,ERR_INVALID_ARG_TYPE:Z,ERR_INVALID_ARG_VALUE:Kt,ERR_OUT_OF_RANGE:ht,ERR_UNKNOWN_SIGNAL:na}}=te(),{normalizeEncoding:Mh}=Q(),{isAsyncFunction:Uh,isArrayBufferView:Wh}=Q().types,oa={};function qh(t){return t===(t|0)}o(qh,"isInt32");function $h(t){return t===t>>>0}o($h,"isUint32");var jh=/^[0-7]+$/,zh="must be a 32-bit unsigned integer or an octal string";function Vh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(ca(jh,t)===null)throw new Kt(e,t,zh);t=Lh(t,8)}return ua(t,e),t}o(Vh,"parseFileMode");var Hh=pe((t,e,i=Ph,r=Ih)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!Gn(t))throw new ht(e,"an integer",t);if(t<i||t>r)throw new ht(e,`>= ${i} && <= ${r}`,t)}),Kh=pe((t,e,i=-2147483648,r=2147483647)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!Gn(t))throw new ht(e,"an integer",t);if(t<i||t>r)throw new ht(e,`>= ${i} && <= ${r}`,t)}),ua=pe((t,e,i=!1)=>{if(typeof t!="number")throw new Z(e,"number",t);if(!Gn(t))throw new ht(e,"an integer",t);let r=i?1:0,n=4294967295;if(t<r||t>n)throw new ht(e,`>= ${r} && <= ${n}`,t)});function Xn(t,e){if(typeof t!="string")throw new Z(e,"string",t)}o(Xn,"validateString");function Yh(t,e,i=void 0,r){if(typeof t!="number")throw new Z(e,"number",t);if(i!=null&&t<i||r!=null&&t>r||(i!=null||r!=null)&&Fh(t))throw new ht(e,`${i!=null?`>= ${i}`:""}${i!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,t)}o(Yh,"validateNumber");var Gh=pe((t,e,i)=>{if(!aa(i,t)){let n="must be one of: "+la(Th(i,s=>typeof s=="string"?`'${s}'`:Rh(s)),", ");throw new Kt(e,t,n)}});function fa(t,e){if(typeof t!="boolean")throw new Z(e,"boolean",t)}o(fa,"validateBoolean");function Kn(t,e,i){return t==null||!Ch(t,e)?i:t[e]}o(Kn,"getOwnPropertyValueOrDefault");var Xh=pe((t,e,i=null)=>{let r=Kn(i,"allowArray",!1),n=Kn(i,"allowFunction",!1);if(!Kn(i,"nullable",!1)&&t===null||!r&&Yn(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new Z(e,"Object",t)}),Jh=pe((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Z(e,"a dictionary",t)}),mr=pe((t,e,i=0)=>{if(!Yn(t))throw new Z(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new Kt(e,t,r)}});function Qh(t,e){mr(t,e);for(let i=0;i<t.length;i++)Xn(t[i],`${e}[${i}]`)}o(Qh,"validateStringArray");function Zh(t,e){mr(t,e);for(let i=0;i<t.length;i++)fa(t[i],`${e}[${i}]`)}o(Zh,"validateBooleanArray");function ep(t,e){mr(t,e);for(let i=0;i<t.length;i++){let r=t[i],n=`${e}[${i}]`;if(r==null)throw new Z(n,"AbortSignal",r);da(r,n)}}o(ep,"validateAbortSignalArray");function tp(t,e="signal"){if(Xn(t,e),oa[t]===void 0)throw oa[Oh(t)]!==void 0?new na(t+" (signals must use all capital letters)"):new na(t)}o(tp,"validateSignalName");var ip=pe((t,e="buffer")=>{if(!Wh(t))throw new Z(e,["Buffer","TypedArray","DataView"],t)});function rp(t,e){let i=Mh(e),r=t.length;if(i==="hex"&&r%2!==0)throw new Kt("encoding",e,`is invalid for data of length ${r}`)}o(rp,"validateEncoding");function np(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Bh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Dh(e,t,i);return t|0}o(np,"validatePort");var da=pe((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Z(e,"AbortSignal",t)}),op=pe((t,e)=>{if(typeof t!="function")throw new Z(e,"Function",t)}),sp=pe((t,e)=>{if(typeof t!="function"||Uh(t))throw new Z(e,"Function",t)}),ap=pe((t,e)=>{if(t!==void 0)throw new Z(e,"undefined",t)});function lp(t,e,i){if(!aa(i,t))throw new Z(e,`('${la(i,"|")}')`,t)}o(lp,"validateUnion");var cp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function sa(t,e){if(typeof t>"u"||!ca(cp,t))throw new Kt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(sa,"validateLinkHeaderFormat");function up(t){if(typeof t=="string")return sa(t,"hints"),t;if(Yn(t)){let e=t.length,i="";if(e===0)return i;for(let r=0;r<e;r++){let n=t[r];sa(n,"hints"),i+=n,r!==e-1&&(i+=", ")}return i}throw new Kt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(up,"validateLinkHeaderValue");ha.exports={isInt32:qh,isUint32:$h,parseFileMode:Vh,validateArray:mr,validateStringArray:Qh,validateBooleanArray:Zh,validateAbortSignalArray:ep,validateBoolean:fa,validateBuffer:ip,validateDictionary:Jh,validateEncoding:rp,validateFunction:op,validateInt32:Kh,validateInteger:Hh,validateNumber:Yh,validateObject:Xh,validateOneOf:Gh,validatePlainFunction:sp,validatePort:np,validateSignalName:tp,validateString:Xn,validateUint32:ua,validateUndefined:ap,validateUnion:lp,validateAbortSignal:da,validateLinkHeaderValue:up}});var rt=N((OS,ba)=>{var W=ba.exports={},Te,Fe;function Jn(){throw new Error("setTimeout has not been defined")}o(Jn,"defaultSetTimout");function Qn(){throw new Error("clearTimeout has not been defined")}o(Qn,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Te=setTimeout:Te=Jn}catch{Te=Jn}try{typeof clearTimeout=="function"?Fe=clearTimeout:Fe=Qn}catch{Fe=Qn}})();function pa(t){if(Te===setTimeout)return setTimeout(t,0);if((Te===Jn||!Te)&&setTimeout)return Te=setTimeout,setTimeout(t,0);try{return Te(t,0)}catch{try{return Te.call(null,t,0)}catch{return Te.call(this,t,0)}}}o(pa,"runTimeout");function fp(t){if(Fe===clearTimeout)return clearTimeout(t);if((Fe===Qn||!Fe)&&clearTimeout)return Fe=clearTimeout,clearTimeout(t);try{return Fe(t)}catch{try{return Fe.call(null,t)}catch{return Fe.call(this,t)}}}o(fp,"runClearTimeout");var Ue=[],Gt=!1,pt,br=-1;function dp(){!Gt||!pt||(Gt=!1,pt.length?Ue=pt.concat(Ue):br=-1,Ue.length&&ya())}o(dp,"cleanUpNextTick");function ya(){if(!Gt){var t=pa(dp);Gt=!0;for(var e=Ue.length;e;){for(pt=Ue,Ue=[];++br<e;)pt&&pt[br].run();br=-1,e=Ue.length}pt=null,Gt=!1,fp(t)}}o(ya,"drainQueue");W.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];Ue.push(new ma(t,e)),Ue.length===1&&!Gt&&pa(ya)};function ma(t,e){this.fun=t,this.array=e}o(ma,"Item");ma.prototype.run=function(){this.fun.apply(null,this.array)};W.title="browser";W.browser=!0;W.env={};W.argv=[];W.version="";W.versions={};function We(){}o(We,"noop");W.on=We;W.addListener=We;W.once=We;W.off=We;W.removeListener=We;W.removeAllListeners=We;W.emit=We;W.prependListener=We;W.prependOnceListener=We;W.listeners=function(t){return[]};W.binding=function(t){throw new Error("process.binding is not supported")};W.cwd=function(){return"/"};W.chdir=function(t){throw new Error("process.chdir is not supported")};W.umask=function(){return 0}});var Pe=N((DS,La)=>{"use strict";var{SymbolAsyncIterator:ga,SymbolIterator:wa,SymbolFor:yt}=R(),Sa=yt("nodejs.stream.destroyed"),_a=yt("nodejs.stream.errored"),Zn=yt("nodejs.stream.readable"),eo=yt("nodejs.stream.writable"),Ea=yt("nodejs.stream.disturbed"),hp=yt("nodejs.webstream.isClosedPromise"),pp=yt("nodejs.webstream.controllerErrorFunction");function gr(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(gr,"isReadableNodeStream");function wr(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(wr,"isWritableNodeStream");function yp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}o(yp,"isDuplexNodeStream");function Ie(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}o(Ie,"isNodeStream");function xa(t){return!!(t&&!Ie(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}o(xa,"isReadableStream");function va(t){return!!(t&&!Ie(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}o(va,"isWritableStream");function Aa(t){return!!(t&&!Ie(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}o(Aa,"isTransformStream");function mp(t){return xa(t)||va(t)||Aa(t)}o(mp,"isWebStream");function bp(t,e){return t==null?!1:e===!0?typeof t[ga]=="function":e===!1?typeof t[wa]=="function":typeof t[ga]=="function"||typeof t[wa]=="function"}o(bp,"isIterable");function Sr(t){if(!Ie(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!!(t.destroyed||t[Sa]||r!=null&&r.destroyed)}o(Sr,"isDestroyed");function ka(t){if(!wr(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(ka,"isWritableEnded");function gp(t,e){if(!wr(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(gp,"isWritableFinished");function wp(t){if(!gr(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(wp,"isReadableEnded");function Na(t,e){if(!gr(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(Na,"isReadableFinished");function Ta(t){return t&&t[Zn]!=null?t[Zn]:typeof t?.readable!="boolean"?null:Sr(t)?!1:gr(t)&&t.readable&&!Na(t)}o(Ta,"isReadable");function Fa(t){return t&&t[eo]!=null?t[eo]:typeof t?.writable!="boolean"?null:Sr(t)?!1:wr(t)&&t.writable&&!ka(t)}o(Fa,"isWritable");function Sp(t,e){return Ie(t)?Sr(t)?!0:!(e?.readable!==!1&&Ta(t)||e?.writable!==!1&&Fa(t)):null}o(Sp,"isFinished");function _p(t){var e,i;return Ie(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(_p,"isWritableErrored");function Ep(t){var e,i;return Ie(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(Ep,"isReadableErrored");function xp(t){if(!Ie(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"&&Ia(t)?t._closed:null}o(xp,"isClosed");function Ia(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}o(Ia,"isOutgoingMessage");function Pa(t){return typeof t._sent100=="boolean"&&Ia(t)}o(Pa,"isServerResponse");function vp(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(vp,"isServerRequest");function Ap(t){if(!Ie(t))return null;let e=t._writableState,i=t._readableState,r=e||i;return!r&&Pa(t)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}o(Ap,"willEmitClose");function kp(t){var e;return!!(t&&((e=t[Ea])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}o(kp,"isDisturbed");function Np(t){var e,i,r,n,s,a,l,c,u,d;return!!(t&&((e=(i=(r=(n=(s=(a=t[_a])!==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:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}o(Np,"isErrored");La.exports={isDestroyed:Sr,kIsDestroyed:Sa,isDisturbed:kp,kIsDisturbed:Ea,isErrored:Np,kIsErrored:_a,isReadable:Ta,kIsReadable:Zn,kIsClosedPromise:hp,kControllerErrorFunction:pp,kIsWritable:eo,isClosed:xp,isDuplexNodeStream:yp,isFinished:Sp,isIterable:bp,isReadableNodeStream:gr,isReadableStream:xa,isReadableEnded:wp,isReadableFinished:Na,isReadableErrored:Ep,isNodeStream:Ie,isWebStream:mp,isWritable:Fa,isWritableNodeStream:wr,isWritableStream:va,isWritableEnded:ka,isWritableFinished:gp,isWritableErrored:_p,isServerRequest:vp,isServerResponse:Pa,willEmitClose:Ap,isTransformStream:Aa}});var qe=N((US,oo)=>{var nt=rt(),{AbortError:qa,codes:Tp}=te(),{ERR_INVALID_ARG_TYPE:Fp,ERR_STREAM_PREMATURE_CLOSE:Ca}=Tp,{kEmptyObject:io,once:ro}=Q(),{validateAbortSignal:Ip,validateFunction:Pp,validateObject:Lp,validateBoolean:Cp}=Yt(),{Promise:Rp,PromisePrototypeThen:Op,SymbolDispose:$a}=R(),{isClosed:Bp,isReadable:Ra,isReadableNodeStream:to,isReadableStream:Dp,isReadableFinished:Oa,isReadableErrored:Ba,isWritable:Da,isWritableNodeStream:Ma,isWritableStream:Mp,isWritableFinished:Ua,isWritableErrored:Wa,isNodeStream:Up,willEmitClose:Wp,kIsClosedPromise:qp}=Pe(),Xt;function $p(t){return t.setHeader&&typeof t.abort=="function"}o($p,"isRequest");var no=o(()=>{},"nop");function ja(t,e,i){var r,n;if(arguments.length===2?(i=e,e=io):e==null?e=io:Lp(e,"options"),Pp(i,"callback"),Ip(e.signal,"options.signal"),i=ro(i),Dp(t)||Mp(t))return jp(t,e,i);if(!Up(t))throw new Fp("stream",["ReadableStream","WritableStream","Stream"],t);let s=(r=e.readable)!==null&&r!==void 0?r:to(t),a=(n=e.writable)!==null&&n!==void 0?n:Ma(t),l=t._writableState,c=t._readableState,u=o(()=>{t.writable||b()},"onlegacyfinish"),d=Wp(t)&&to(t)===s&&Ma(t)===a,h=Ua(t,!1),b=o(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||m)&&i.call(t)},"onfinish"),m=Oa(t,!1),g=o(()=>{m=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),y=o($=>{i.call(t,$)},"onerror"),k=Bp(t),w=o(()=>{k=!0;let $=Wa(t)||Ba(t);if($&&typeof $!="boolean")return i.call(t,$);if(s&&!m&&to(t,!0)&&!Oa(t,!1))return i.call(t,new Ca);if(a&&!h&&!Ua(t,!1))return i.call(t,new Ca);i.call(t)},"onclose"),F=o(()=>{k=!0;let $=Wa(t)||Ba(t);if($&&typeof $!="boolean")return i.call(t,$);i.call(t)},"onclosed"),B=o(()=>{t.req.on("finish",b)},"onrequest");$p(t)?(t.on("complete",b),d||t.on("abort",w),t.req?B():t.on("request",B)):a&&!l&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",w),t.on("end",g),t.on("finish",b),e.error!==!1&&t.on("error",y),t.on("close",w),k?nt.nextTick(w):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||nt.nextTick(F):(!s&&(!d||Ra(t))&&(h||Da(t)===!1)||!a&&(!d||Da(t))&&(m||Ra(t)===!1)||c&&t.req&&t.aborted)&&nt.nextTick(F);let A=o(()=>{i=no,t.removeListener("aborted",w),t.removeListener("complete",b),t.removeListener("abort",w),t.removeListener("request",B),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",g),t.removeListener("error",y),t.removeListener("close",w)},"cleanup");if(e.signal&&!k){let $=o(()=>{let st=i;A(),st.call(t,new qa(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)nt.nextTick($);else{Xt=Xt||Q().addAbortListener;let st=Xt(e.signal,$),ce=i;i=ro((...vt)=>{st[$a](),ce.apply(t,vt)})}}return A}o(ja,"eos");function jp(t,e,i){let r=!1,n=no;if(e.signal)if(n=o(()=>{r=!0,i.call(t,new qa(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)nt.nextTick(n);else{Xt=Xt||Q().addAbortListener;let a=Xt(e.signal,n),l=i;i=ro((...c)=>{a[$a](),l.apply(t,c)})}let s=o((...a)=>{r||nt.nextTick(()=>i.apply(t,a))},"resolverFn");return Op(t[qp].promise,s,s),no}o(jp,"eosWeb");function zp(t,e){var i;let r=!1;return e===null&&(e=io),(i=e)!==null&&i!==void 0&&i.cleanup&&(Cp(e.cleanup,"cleanup"),r=e.cleanup),new Rp((n,s)=>{let a=ja(t,e,l=>{r&&a(),l?s(l):n()})})}o(zp,"finished");oo.exports=ja;oo.exports.finished=zp});var mt=N((qS,Ja)=>{"use strict";var Le=rt(),{aggregateTwoErrors:Vp,codes:{ERR_MULTIPLE_CALLBACK:Hp},AbortError:Kp}=te(),{Symbol:Ha}=R(),{kIsDestroyed:Yp,isDestroyed:Gp,isFinished:Xp,isServerRequest:Jp}=Pe(),Ka=Ha("kDestroy"),so=Ha("kConstruct");function Ya(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}o(Ya,"checkError");function Qp(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):(Ya(t,r,i),r&&(r.destroyed=!0),i&&(i.destroyed=!0),n.constructed?za(this,t,e):this.once(Ka,function(s){za(this,Vp(s,t),e)}),this)}o(Qp,"destroy");function za(t,e,i){let r=!1;function n(s){if(r)return;r=!0;let a=t._readableState,l=t._writableState;Ya(s,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(s),s?Le.nextTick(Zp,t,s):Le.nextTick(Ga,t)}o(n,"onDestroy");try{t._destroy(e||null,n)}catch(s){n(s)}}o(za,"_destroy");function Zp(t,e){ao(t,e),Ga(t)}o(Zp,"emitErrorCloseNT");function Ga(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(Ga,"emitCloseNT");function ao(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(ao,"emitErrorNT");function ey(){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(ey,"undestroy");function lo(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?Le.nextTick(ao,t,e):ao(t,e))}o(lo,"errorOrDestroy");function ty(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(so,e),!(t.listenerCount(so)>1)&&Le.nextTick(iy,t)}o(ty,"construct");function iy(t){let e=!1;function i(r){if(e){lo(t,r??new Hp);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(Ka,r):r?lo(t,r,!0):Le.nextTick(ry,t)}o(i,"onConstruct");try{t._construct(r=>{Le.nextTick(i,r)})}catch(r){Le.nextTick(i,r)}}o(iy,"constructNT");function ry(t){t.emit(so)}o(ry,"emitConstructNT");function Va(t){return t?.setHeader&&typeof t.abort=="function"}o(Va,"isRequest");function Xa(t){t.emit("close")}o(Xa,"emitCloseLegacy");function ny(t,e){t.emit("error",e),Le.nextTick(Xa,t)}o(ny,"emitErrorCloseLegacy");function oy(t,e){!t||Gp(t)||(!e&&!Xp(t)&&(e=new Kp),Jp(t)?(t.socket=null,t.destroy(e)):Va(t)?t.abort():Va(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Le.nextTick(ny,t,e):Le.nextTick(Xa,t),t.destroyed||(t[Yp]=!0))}o(oy,"destroyer");Ja.exports={construct:ty,destroyer:oy,destroy:Qp,undestroy:ey,errorOrDestroy:lo}});var xr=N((jS,Za)=>{"use strict";var{ArrayIsArray:sy,ObjectSetPrototypeOf:Qa}=R(),{EventEmitter:_r}=Ai();function Er(t){_r.call(this,t)}o(Er,"Stream");Qa(Er.prototype,_r.prototype);Qa(Er,_r);Er.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 c(d){u(),_r.listenerCount(this,"error")===0&&this.emit("error",d)}o(c,"onerror"),co(i,"error",c),co(t,"error",c);function u(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",u),i.removeListener("close",u),t.removeListener("close",u)}return o(u,"cleanup"),i.on("end",u),i.on("close",u),t.on("close",u),t.emit("pipe",i),t};function co(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):sy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}o(co,"prependListener");Za.exports={Stream:Er,prependListener:co}});var ki=N((VS,vr)=>{"use strict";var{SymbolDispose:ay}=R(),{AbortError:el,codes:ly}=te(),{isNodeStream:tl,isWebStream:cy,kControllerErrorFunction:uy}=Pe(),fy=qe(),{ERR_INVALID_ARG_TYPE:il}=ly,uo,dy=o((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new il(e,"AbortSignal",t)},"validateAbortSignal");vr.exports.addAbortSignal=o(function(e,i){if(dy(e,"signal"),!tl(i)&&!cy(i))throw new il("stream",["ReadableStream","WritableStream","Stream"],i);return vr.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");vr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=tl(e)?()=>{e.destroy(new el(void 0,{cause:t.reason}))}:()=>{e[uy](new el(void 0,{cause:t.reason}))};if(t.aborted)i();else{uo=uo||Q().addAbortListener;let r=uo(t,i);fy(e,r[ay])}return e}});var ol=N((YS,nl)=>{"use strict";var{StringPrototypeSlice:rl,SymbolIterator:hy,TypedArrayPrototypeSet:Ar,Uint8Array:py}=R(),{Buffer:fo}=Me(),{inspect:yy}=Q();nl.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 fo.alloc(0);let i=fo.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)Ar(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}*[hy](){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+=rl(s,0,e),this.head=r,r.data=rl(s,e));break}++n}while((r=r.next)!==null);return this.length-=n,i}_getBuffer(e){let i=fo.allocUnsafe(e),r=e,n=this.head,s=0;do{let a=n.data;if(e>a.length)Ar(i,a,r-e),e-=a.length;else{e===a.length?(Ar(i,a,r-e),++s,n.next?this.head=n.next:this.head=this.tail=null):(Ar(i,new py(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 yy(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var Ni=N((XS,cl)=>{"use strict";var{MathFloor:my,NumberIsInteger:by}=R(),{validateInteger:gy}=Yt(),{ERR_INVALID_ARG_VALUE:wy}=te().codes,sl=16*1024,al=16;function Sy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}o(Sy,"highWaterMarkFrom");function ll(t){return t?al:sl}o(ll,"getDefaultHighWaterMark");function _y(t,e){gy(e,"value",0),t?al=e:sl=e}o(_y,"setDefaultHighWaterMark");function Ey(t,e,i,r){let n=Sy(e,r,i);if(n!=null){if(!by(n)||n<0){let s=r?`options.${i}`:"options.highWaterMark";throw new wy(s,n)}return my(n)}return ll(t.objectMode)}o(Ey,"getHighWaterMark");cl.exports={getHighWaterMark:Ey,getDefaultHighWaterMark:ll,setDefaultHighWaterMark:_y}});var dl=N((ho,fl)=>{var kr=Me(),Ce=kr.Buffer;function ul(t,e){for(var i in t)e[i]=t[i]}o(ul,"copyProps");Ce.from&&Ce.alloc&&Ce.allocUnsafe&&Ce.allocUnsafeSlow?fl.exports=kr:(ul(kr,ho),ho.Buffer=bt);function bt(t,e,i){return Ce(t,e,i)}o(bt,"SafeBuffer");bt.prototype=Object.create(Ce.prototype);ul(Ce,bt);bt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ce(t,e,i)};bt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=Ce(t);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};bt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ce(t)};bt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return kr.SlowBuffer(t)}});var yl=N(pl=>{"use strict";var yo=dl().Buffer,hl=yo.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 xy(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(xy,"_normalizeEncoding");function vy(t){var e=xy(t);if(typeof e!="string"&&(yo.isEncoding===hl||!hl(t)))throw new Error("Unknown encoding: "+t);return e||t}o(vy,"normalizeEncoding");pl.StringDecoder=Ti;function Ti(t){this.encoding=vy(t);var e;switch(this.encoding){case"utf16le":this.text=Iy,this.end=Py,e=4;break;case"utf8":this.fillLast=Ny,e=4;break;case"base64":this.text=Ly,this.end=Cy,e=3;break;default:this.write=Ry,this.end=Oy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=yo.allocUnsafe(e)}o(Ti,"StringDecoder");Ti.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||""};Ti.prototype.end=Fy;Ti.prototype.text=Ty;Ti.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 po(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}o(po,"utf8CheckByte");function Ay(t,e,i){var r=e.length-1;if(r<i)return 0;var n=po(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||n===-2?0:(n=po(e[r]),n>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||n===-2?0:(n=po(e[r]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}o(Ay,"utf8CheckIncomplete");function ky(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(ky,"utf8CheckExtraBytes");function Ny(t){var e=this.lastTotal-this.lastNeed,i=ky(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(Ny,"utf8FillLast");function Ty(t,e){var i=Ay(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(Ty,"utf8Text");function Fy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}o(Fy,"utf8End");function Iy(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(Iy,"utf16Text");function Py(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(Py,"utf16End");function Ly(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(Ly,"base64Text");function Cy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}o(Cy,"base64End");function Ry(t){return t.toString(this.encoding)}o(Ry,"simpleWrite");function Oy(t){return t&&t.length?this.write(t):""}o(Oy,"simpleEnd")});var mo=N((t_,wl)=>{"use strict";var ml=rt(),{PromisePrototypeThen:By,SymbolAsyncIterator:bl,SymbolIterator:gl}=R(),{Buffer:Dy}=Me(),{ERR_INVALID_ARG_TYPE:My,ERR_STREAM_NULL_VALUES:Uy}=te().codes;function Wy(t,e,i){let r;if(typeof e=="string"||e instanceof Dy)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let n;if(e&&e[bl])n=!0,r=e[bl]();else if(e&&e[gl])n=!1,r=e[gl]();else throw new My("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;s._read=function(){a||(a=!0,c())},s._destroy=function(u,d){By(l(u),()=>ml.nextTick(d,u),h=>ml.nextTick(d,h||u))};async function l(u){let d=u!=null,h=typeof r.throw=="function";if(d&&h){let{value:b,done:m}=await r.throw(u);if(await b,m)return}if(typeof r.return=="function"){let{value:b}=await r.return();await b}}o(l,"close");async function c(){for(;;){try{let{value:u,done:d}=n?await r.next():r.next();if(d)s.push(null);else{let h=u&&typeof u.then=="function"?await u:u;if(h===null)throw a=!1,new Uy;if(s.push(h))continue;a=!1}}catch(u){s.destroy(u)}break}}return o(c,"next"),s}o(Wy,"from");wl.exports=Wy});var Ii=N((r_,Dl)=>{var _e=rt(),{ArrayPrototypeIndexOf:qy,NumberIsInteger:$y,NumberIsNaN:jy,NumberParseInt:zy,ObjectDefineProperties:vo,ObjectKeys:Vy,ObjectSetPrototypeOf:El,Promise:xl,SafeSet:Hy,SymbolAsyncDispose:Ky,SymbolAsyncIterator:Yy,Symbol:Gy}=R();Dl.exports=_;_.ReadableState=Ir;var{EventEmitter:Xy}=Ai(),{Stream:ot,prependListener:Jy}=xr(),{Buffer:bo}=Me(),{addAbortSignal:Qy}=ki(),vl=qe(),E=Q().debuglog("stream",t=>{E=t}),Zy=ol(),Zt=mt(),{getHighWaterMark:em,getDefaultHighWaterMark:tm}=Ni(),{aggregateTwoErrors:Sl,codes:{ERR_INVALID_ARG_TYPE:im,ERR_METHOD_NOT_IMPLEMENTED:rm,ERR_OUT_OF_RANGE:nm,ERR_STREAM_PUSH_AFTER_EOF:om,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:sm},AbortError:am}=te(),{validateObject:lm}=Yt(),gt=Gy("kPaused"),{StringDecoder:Al}=yl(),cm=mo();El(_.prototype,ot.prototype);El(_,ot);var go=o(()=>{},"nop"),{errorOrDestroy:Jt}=Zt,Qt=1<<0,um=1<<1,kl=1<<2,Fi=1<<3,Nl=1<<4,Nr=1<<5,Tr=1<<6,Tl=1<<7,fm=1<<8,dm=1<<9,hm=1<<10,Eo=1<<11,xo=1<<12,pm=1<<13,ym=1<<14,mm=1<<15,Fl=1<<16,bm=1<<17,gm=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(Ir.prototype,{objectMode:V(Qt),ended:V(um),endEmitted:V(kl),reading:V(Fi),constructed:V(Nl),sync:V(Nr),needReadable:V(Tr),emittedReadable:V(Tl),readableListening:V(fm),resumeScheduled:V(dm),errorEmitted:V(hm),emitClose:V(Eo),autoDestroy:V(xo),destroyed:V(pm),closed:V(ym),closeEmitted:V(mm),multiAwaitDrain:V(Fl),readingMore:V(bm),dataEmitted:V(gm)});function Ir(t,e,i){typeof i!="boolean"&&(i=e instanceof Re()),this.state=Eo|xo|Nl|Nr,t&&t.objectMode&&(this.state|=Qt),i&&t&&t.readableObjectMode&&(this.state|=Qt),this.highWaterMark=t?em(this,t,"readableHighWaterMark",i):tm(!1),this.buffer=new Zy,this.length=0,this.pipes=[],this.flowing=null,this[gt]=null,t&&t.emitClose===!1&&(this.state&=~Eo),t&&t.autoDestroy===!1&&(this.state&=~xo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Al(t.encoding),this.encoding=t.encoding)}o(Ir,"ReadableState");function _(t){if(!(this instanceof _))return new _(t);let e=this instanceof Re();this._readableState=new Ir(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&&Qy(t.signal,this)),ot.call(this,t),Zt.construct(this,()=>{this._readableState.needReadable&&Fr(this,this._readableState)})}o(_,"Readable");_.prototype.destroy=Zt.destroy;_.prototype._undestroy=Zt.undestroy;_.prototype._destroy=function(t,e){e(t)};_.prototype[Xy.captureRejectionSymbol]=function(t){this.destroy(t)};_.prototype[Ky]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new am,this.destroy(t)),new xl((e,i)=>vl(this,r=>r&&r!==t?i(r):e(null)))};_.prototype.push=function(t,e){return Il(this,t,e,!1)};_.prototype.unshift=function(t,e){return Il(this,t,e,!0)};function Il(t,e,i,r){E("readableAddChunk",e);let n=t._readableState,s;if(n.state&Qt||(typeof e=="string"?(i=i||n.defaultEncoding,n.encoding!==i&&(r&&n.encoding?e=bo.from(e,i).toString(n.encoding):(e=bo.from(e,i),i=""))):e instanceof bo?i="":ot._isUint8Array(e)?(e=ot._uint8ArrayToBuffer(e),i=""):e!=null&&(s=new im("chunk",["string","Buffer","Uint8Array"],e))),s)Jt(t,s);else if(e===null)n.state&=~Fi,_m(t,n);else if(n.state&Qt||e&&e.length>0)if(r)if(n.state&kl)Jt(t,new sm);else{if(n.destroyed||n.errored)return!1;wo(t,n,e,!0)}else if(n.ended)Jt(t,new om);else{if(n.destroyed||n.errored)return!1;n.state&=~Fi,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?wo(t,n,e,!1):Fr(t,n)):wo(t,n,e,!1)}else r||(n.state&=~Fi,Fr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}o(Il,"readableAddChunk");function wo(t,e,i,r){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Fl?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&Tr&&Pr(t)),Fr(t,e)}o(wo,"addChunk");_.prototype.isPaused=function(){let t=this._readableState;return t[gt]===!0||t.flowing===!1};_.prototype.setEncoding=function(t){let e=new Al(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 wm=1073741824;function Sm(t){if(t>wm)throw new nm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}o(Sm,"computeNewHighWaterMark");function _l(t,e){return t<=0||e.length===0&&e.ended?0:e.state&Qt?1:jy(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}o(_l,"howMuchToRead");_.prototype.read=function(t){E("read",t),t===void 0?t=NaN:$y(t)||(t=zy(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Sm(t)),t!==0&&(e.state&=~Tl),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return E("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?So(this):Pr(this),null;if(t=_l(t,e),t===0&&e.ended)return e.length===0&&So(this),null;let r=(e.state&Tr)!==0;if(E("need readable",r),(e.length===0||e.length-t<e.highWaterMark)&&(r=!0,E("length less than watermark",r)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)r=!1,E("reading, ended or constructing",r);else if(r){E("do read"),e.state|=Fi|Nr,e.length===0&&(e.state|=Tr);try{this._read(e.highWaterMark)}catch(s){Jt(this,s)}e.state&=~Nr,e.reading||(t=_l(i,e))}let n;return t>0?n=Ol(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&&So(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function _m(t,e){if(E("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?Pr(t):(e.needReadable=!1,e.emittedReadable=!0,Pl(t))}}o(_m,"onEofChunk");function Pr(t){let e=t._readableState;E("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(E("emitReadable",e.flowing),e.emittedReadable=!0,_e.nextTick(Pl,t))}o(Pr,"emitReadable");function Pl(t){let e=t._readableState;E("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,Cl(t)}o(Pl,"emitReadable_");function Fr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,_e.nextTick(Em,t,e))}o(Fr,"maybeReadMore");function Em(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(E("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}o(Em,"maybeReadMore_");_.prototype._read=function(t){throw new rm("_read()")};_.prototype.pipe=function(t,e){let i=this,r=this._readableState;r.pipes.length===1&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new Hy(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(t),E("pipe count=%d opts=%j",r.pipes.length,e);let s=(!e||e.end!==!1)&&t!==_e.stdout&&t!==_e.stderr?l:k;r.endEmitted?_e.nextTick(s):i.once("end",s),t.on("unpipe",a);function a(w,F){E("onunpipe"),w===i&&F&&F.hasUnpiped===!1&&(F.hasUnpiped=!0,d())}o(a,"onunpipe");function l(){E("onend"),t.end()}o(l,"onend");let c,u=!1;function d(){E("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),c&&t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",k),i.removeListener("data",b),u=!0,c&&r.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}o(d,"cleanup");function h(){u||(r.pipes.length===1&&r.pipes[0]===t?(E("false write response, pause",0),r.awaitDrainWriters=t,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(t)&&(E("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(t)),i.pause()),c||(c=xm(i,t),t.on("drain",c))}o(h,"pause"),i.on("data",b);function b(w){E("ondata");let F=t.write(w);E("dest.write",F),F===!1&&h()}o(b,"ondata");function m(w){if(E("onerror",w),k(),t.removeListener("error",m),t.listenerCount("error")===0){let F=t._writableState||t._readableState;F&&!F.errorEmitted?Jt(t,w):t.emit("error",w)}}o(m,"onerror"),Jy(t,"error",m);function g(){t.removeListener("finish",y),k()}o(g,"onclose"),t.once("close",g);function y(){E("onfinish"),t.removeListener("close",g),k()}o(y,"onfinish"),t.once("finish",y);function k(){E("unpipe"),i.unpipe(t)}return o(k,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():r.flowing||(E("pipe resume"),i.resume()),t};function xm(t,e){return o(function(){let r=t._readableState;r.awaitDrainWriters===e?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}o(xm,"pipeOnDrain");_.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=qy(e.pipes,t);return r===-1?this:(e.pipes.splice(r,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};_.prototype.on=function(t,e){let i=ot.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,E("on readable",r.length,r.reading),r.length?Pr(this):r.reading||_e.nextTick(vm,this)),i};_.prototype.addListener=_.prototype.on;_.prototype.removeListener=function(t,e){let i=ot.prototype.removeListener.call(this,t,e);return t==="readable"&&_e.nextTick(Ll,this),i};_.prototype.off=_.prototype.removeListener;_.prototype.removeAllListeners=function(t){let e=ot.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&_e.nextTick(Ll,this),e};function Ll(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[gt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}o(Ll,"updateReadableListening");function vm(t){E("readable nexttick read 0"),t.read(0)}o(vm,"nReadingNextTick");_.prototype.resume=function(){let t=this._readableState;return t.flowing||(E("resume"),t.flowing=!t.readableListening,Am(this,t)),t[gt]=!1,this};function Am(t,e){e.resumeScheduled||(e.resumeScheduled=!0,_e.nextTick(km,t,e))}o(Am,"resume");function km(t,e){E("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Cl(t),e.flowing&&!e.reading&&t.read(0)}o(km,"resume_");_.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[gt]=!0,this};function Cl(t){let e=t._readableState;for(E("flow",e.flowing);e.flowing&&t.read()!==null;);}o(Cl,"flow");_.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=>{Jt(this,r)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=Vy(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};_.prototype[Yy]=function(){return Rl(this)};_.prototype.iterator=function(t){return t!==void 0&&lm(t,"options"),Rl(this,t)};function Rl(t,e){typeof t.read!="function"&&(t=_.wrap(t,{objectMode:!0}));let i=Nm(t,e);return i.stream=t,i}o(Rl,"streamToAsyncIterator");async function*Nm(t,e){let i=go;function r(a){this===t?(i(),i=go):i=a}o(r,"next"),t.on("readable",r);let n,s=vl(t,{writable:!1},a=>{n=a?Sl(n,a):null,i(),i=go});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 xl(r)}}}catch(a){throw n=Sl(n,a),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?Zt.destroyer(t,null):(t.off("readable",r),s())}}o(Nm,"createAsyncIterator");vo(_.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(Ir.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[gt]!==!1},set(t){this[gt]=!!t}}});_._fromList=Ol;function Ol(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(Ol,"fromList");function So(t){let e=t._readableState;E("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,_e.nextTick(Tm,e,t))}o(So,"endReadable");function Tm(t,e){if(E("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)_e.nextTick(Fm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}o(Tm,"endReadableNT");function Fm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}o(Fm,"endWritableNT");_.from=function(t,e){return cm(_,t,e)};var _o;function Bl(){return _o===void 0&&(_o={}),_o}o(Bl,"lazyWebStreams");_.fromWeb=function(t,e){return Bl().newStreamReadableFromReadableStream(t,e)};_.toWeb=function(t,e){return Bl().newReadableStreamFromStreamReadable(t,e)};_.wrap=function(t,e){var i,r;return new _({objectMode:(i=(r=t.readableObjectMode)!==null&&r!==void 0?r:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(n,s){Zt.destroyer(t,n),s(n)}}).wrap(t)}});var Br=N((o_,Gl)=>{var wt=rt(),{ArrayPrototypeSlice:Wl,Error:Im,FunctionPrototypeSymbolHasInstance:ql,ObjectDefineProperty:$l,ObjectDefineProperties:Pm,ObjectSetPrototypeOf:jl,StringPrototypeToLowerCase:Lm,Symbol:Cm,SymbolHasInstance:Rm}=R();Gl.exports=O;O.WritableState=Ci;var{EventEmitter:Om}=Ai(),Pi=xr().Stream,{Buffer:Lr}=Me(),Or=mt(),{addAbortSignal:Bm}=ki(),{getHighWaterMark:Dm,getDefaultHighWaterMark:Mm}=Ni(),{ERR_INVALID_ARG_TYPE:Um,ERR_METHOD_NOT_IMPLEMENTED:Wm,ERR_MULTIPLE_CALLBACK:zl,ERR_STREAM_CANNOT_PIPE:qm,ERR_STREAM_DESTROYED:Li,ERR_STREAM_ALREADY_FINISHED:$m,ERR_STREAM_NULL_VALUES:jm,ERR_STREAM_WRITE_AFTER_END:zm,ERR_UNKNOWN_ENCODING:Vl}=te().codes,{errorOrDestroy:ei}=Or;jl(O.prototype,Pi.prototype);jl(O,Pi);function No(){}o(No,"nop");var ti=Cm("kOnFinished");function Ci(t,e,i){typeof i!="boolean"&&(i=e instanceof Re()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Dm(this,t,"writableHighWaterMark",i):Mm(!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=Hm.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Rr(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[ti]=[]}o(Ci,"WritableState");function Rr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}o(Rr,"resetBuffer");Ci.prototype.getBuffer=o(function(){return Wl(this.buffered,this.bufferedIndex)},"getBuffer");$l(Ci.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(t){let e=this instanceof Re();if(!e&&!ql(O,this))return new O(t);this._writableState=new Ci(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&&Bm(t.signal,this)),Pi.call(this,t),Or.construct(this,()=>{let i=this._writableState;i.writing||Fo(this,i),Io(this,i)})}o(O,"Writable");$l(O,Rm,{__proto__:null,value:function(t){return ql(this,t)?!0:this!==O?!1:t&&t._writableState instanceof Ci}});O.prototype.pipe=function(){ei(this,new qm)};function Hl(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"&&!Lr.isEncoding(i))throw new Vl(i);typeof r!="function"&&(r=No)}if(e===null)throw new jm;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=Lr.from(e,i),i="buffer");else if(e instanceof Lr)i="buffer";else if(Pi._isUint8Array(e))e=Pi._uint8ArrayToBuffer(e),i="buffer";else throw new Um("chunk",["string","Buffer","Uint8Array"],e);let s;return n.ending?s=new zm:n.destroyed&&(s=new Li("write")),s?(wt.nextTick(r,s),ei(t,s,!0),s):(n.pendingcb++,Vm(t,n,e,i,r))}o(Hl,"_write");O.prototype.write=function(t,e,i){return Hl(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||Fo(this,t))};O.prototype.setDefaultEncoding=o(function(e){if(typeof e=="string"&&(e=Lm(e)),!Lr.isEncoding(e))throw new Vl(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function Vm(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!==No&&(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(Vm,"writeOrBuffer");function Ml(t,e,i,r,n,s,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Li("write")):i?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}o(Ml,"doWrite");function Ul(t,e,i,r){--e.pendingcb,r(i),To(e),ei(t,i)}o(Ul,"onwriteError");function Hm(t,e){let i=t._writableState,r=i.sync,n=i.writecb;if(typeof n!="function"){ei(t,new zl);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?wt.nextTick(Ul,t,i,e,n):Ul(t,i,e,n)):(i.buffered.length>i.bufferedIndex&&Fo(t,i),r?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===n?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:n,stream:t,state:i},wt.nextTick(Km,i.afterWriteTickInfo)):Kl(t,i,1,n))}o(Hm,"onwrite");function Km({stream:t,state:e,count:i,cb:r}){return e.afterWriteTickInfo=null,Kl(t,e,i,r)}o(Km,"afterWriteTick");function Kl(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&&To(e),Io(t,e)}o(Kl,"afterWrite");function To(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 Li("write"))}let i=t[ti].splice(0);for(let n=0;n<i.length;n++){var r;i[n]((r=t.errored)!==null&&r!==void 0?r:new Li("end"))}Rr(t)}o(To,"errorBuffer");function Fo(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?No:u=>{for(let d=a;d<i.length;++d)i[d].callback(u)},c=e.allNoop&&a===0?i:Wl(i,a);c.allBuffers=e.allBuffers,Ml(t,e,!0,e.length,c,"",l),Rr(e)}else{do{let{chunk:l,encoding:c,callback:u}=i[a];i[a++]=null;let d=n?1:l.length;Ml(t,e,!1,d,l,c,u)}while(a<i.length&&!e.writing);a===i.length?Rr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}o(Fo,"clearBuffer");O.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new Wm("_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=Hl(this,t,e);s instanceof Im&&(n=s)}return r.corked&&(r.corked=1,this.uncork()),n||(!r.errored&&!r.ending?(r.ending=!0,Io(this,r,!0),r.ended=!0):r.finished?n=new $m("end"):r.destroyed&&(n=new Li("end"))),typeof i=="function"&&(n||r.finished?wt.nextTick(i,n):r[ti].push(i)),this};function Cr(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(Cr,"needFinish");function Ym(t,e){let i=!1;function r(n){if(i){ei(t,n??zl());return}if(i=!0,e.pendingcb--,n){let s=e[ti].splice(0);for(let a=0;a<s.length;a++)s[a](n);ei(t,n,e.sync)}else Cr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,wt.nextTick(ko,t,e))}o(r,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(r)}catch(n){r(n)}e.sync=!1}o(Ym,"callFinal");function Gm(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Ym(t,e)):(e.prefinished=!0,t.emit("prefinish")))}o(Gm,"prefinish");function Io(t,e,i){Cr(e)&&(Gm(t,e),e.pendingcb===0&&(i?(e.pendingcb++,wt.nextTick((r,n)=>{Cr(n)?ko(r,n):n.pendingcb--},t,e)):Cr(e)&&(e.pendingcb++,ko(t,e))))}o(Io,"finishMaybe");function ko(t,e){e.pendingcb--,e.finished=!0;let i=e[ti].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(ko,"finish");Pm(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 Xm=Or.destroy;O.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[ti].length)&&wt.nextTick(To,i),Xm.call(this,t,e),this};O.prototype._undestroy=Or.undestroy;O.prototype._destroy=function(t,e){e(t)};O.prototype[Om.captureRejectionSymbol]=function(t){this.destroy(t)};var Ao;function Yl(){return Ao===void 0&&(Ao={}),Ao}o(Yl,"lazyWebStreams");O.fromWeb=function(t,e){return Yl().newStreamWritableFromWritableStream(t,e)};O.toWeb=function(t){return Yl().newWritableStreamFromStreamWritable(t)}});var uc=N((a_,cc)=>{var Po=rt(),Jm=Me(),{isReadable:Qm,isWritable:Zm,isIterable:Xl,isNodeStream:eb,isReadableNodeStream:Jl,isWritableNodeStream:Ql,isDuplexNodeStream:tb,isReadableStream:Zl,isWritableStream:ec}=Pe(),tc=qe(),{AbortError:ac,codes:{ERR_INVALID_ARG_TYPE:ib,ERR_INVALID_RETURN_VALUE:ic}}=te(),{destroyer:ri}=mt(),rb=Re(),lc=Ii(),nb=Br(),{createDeferredPromise:rc}=Q(),nc=mo(),oc=globalThis.Blob||Jm.Blob,ob=o(typeof oc<"u"?function(e){return e instanceof oc}:function(e){return!1},"isBlob"),sb=globalThis.AbortController||Vt().AbortController,{FunctionPrototypeCall:sc}=R(),$e=class extends rb{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($e,"Duplexify");cc.exports=o(function t(e,i){if(tb(e))return e;if(Jl(e))return ii({readable:e});if(Ql(e))return ii({writable:e});if(eb(e))return ii({writable:!1,readable:!1});if(Zl(e))return ii({readable:lc.fromWeb(e)});if(ec(e))return ii({writable:nb.fromWeb(e)});if(typeof e=="function"){let{value:n,write:s,final:a,destroy:l}=ab(e);if(Xl(n))return nc($e,n,{objectMode:!0,write:s,final:a,destroy:l});let c=n?.then;if(typeof c=="function"){let u,d=sc(c,n,h=>{if(h!=null)throw new ic("nully","body",h)},h=>{ri(u,h)});return u=new $e({objectMode:!0,readable:!1,write:s,final(h){a(async()=>{try{await d,Po.nextTick(h,null)}catch(b){Po.nextTick(h,b)}})},destroy:l})}throw new ic("Iterable, AsyncIterable or AsyncFunction",i,n)}if(ob(e))return t(e.arrayBuffer());if(Xl(e))return nc($e,e,{objectMode:!0,writable:!1});if(Zl(e?.readable)&&ec(e?.writable))return $e.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?Jl(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?Ql(e?.writable)?e?.writable:t(e.writable):void 0;return ii({readable:n,writable:s})}let r=e?.then;if(typeof r=="function"){let n;return sc(r,e,s=>{s!=null&&n.push(s),n.push(null)},s=>{ri(n,s)}),n=new $e({objectMode:!0,writable:!1,read(){}})}throw new ib(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function ab(t){let{promise:e,resolve:i}=rc(),r=new sb,n=r.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(Po.nextTick(u),c)return;if(n.aborted)throw new ac(void 0,{cause:n.reason});({promise:e,resolve:i}=rc()),yield l}}(),{signal:n}),write(a,l,c){let u=i;i=null,u({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){r.abort(),l(a)}}}o(ab,"fromAsyncGen");function ii(t){let e=t.readable&&typeof t.readable.read!="function"?lc.wrap(t.readable):t.readable,i=t.writable,r=!!Qm(e),n=!!Zm(i),s,a,l,c,u;function d(h){let b=c;c=null,b?b(h):h&&u.destroy(h)}return o(d,"onfinished"),u=new $e({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:r,writable:n}),n&&(tc(i,h=>{n=!1,h&&ri(e,h),d(h)}),u._write=function(h,b,m){i.write(h,b)?m():s=m},u._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&&(tc(e,h=>{r=!1,h&&ri(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let h=e.read();if(h===null){l=u._read;return}if(!u.push(h))return}}),u._destroy=function(h,b){!h&&c!==null&&(h=new ac),l=null,s=null,a=null,c===null?b(h):(c=b,ri(i,h),ri(e,h))},u}o(ii,"_duplexify")});var Re=N((c_,hc)=>{"use strict";var{ObjectDefineProperties:lb,ObjectGetOwnPropertyDescriptor:je,ObjectKeys:cb,ObjectSetPrototypeOf:fc}=R();hc.exports=Ee;var Ro=Ii(),ye=Br();fc(Ee.prototype,Ro.prototype);fc(Ee,Ro);{let t=cb(ye.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ee.prototype[i]||(Ee.prototype[i]=ye.prototype[i])}}function Ee(t){if(!(this instanceof Ee))return new Ee(t);Ro.call(this,t),ye.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(Ee,"Duplex");lb(Ee.prototype,{writable:{__proto__:null,...je(ye.prototype,"writable")},writableHighWaterMark:{__proto__:null,...je(ye.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...je(ye.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...je(ye.prototype,"writableBuffer")},writableLength:{__proto__:null,...je(ye.prototype,"writableLength")},writableFinished:{__proto__:null,...je(ye.prototype,"writableFinished")},writableCorked:{__proto__:null,...je(ye.prototype,"writableCorked")},writableEnded:{__proto__:null,...je(ye.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...je(ye.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 Lo;function dc(){return Lo===void 0&&(Lo={}),Lo}o(dc,"lazyWebStreams");Ee.fromWeb=function(t,e){return dc().newStreamDuplexFromReadableWritablePair(t,e)};Ee.toWeb=function(t){return dc().newReadableWritablePairFromDuplex(t)};var Co;Ee.from=function(t){return Co||(Co=uc()),Co(t,"body")}});var Do=N((f_,yc)=>{"use strict";var{ObjectSetPrototypeOf:pc,Symbol:ub}=R();yc.exports=ze;var{ERR_METHOD_NOT_IMPLEMENTED:fb}=te().codes,Bo=Re(),{getHighWaterMark:db}=Ni();pc(ze.prototype,Bo.prototype);pc(ze,Bo);var Ri=ub("kCallback");function ze(t){if(!(this instanceof ze))return new ze(t);let e=t?db(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Bo.call(this,t),this._readableState.sync=!1,this[Ri]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",hb)}o(ze,"Transform");function Oo(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(Oo,"final");function hb(){this._final!==Oo&&Oo.call(this)}o(hb,"prefinish");ze.prototype._final=Oo;ze.prototype._transform=function(t,e,i){throw new fb("_transform()")};ze.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[Ri]=i})};ze.prototype._read=function(){if(this[Ri]){let t=this[Ri];this[Ri]=null,t()}}});var Uo=N((h_,bc)=>{"use strict";var{ObjectSetPrototypeOf:mc}=R();bc.exports=ni;var Mo=Do();mc(ni.prototype,Mo.prototype);mc(ni,Mo);function ni(t){if(!(this instanceof ni))return new ni(t);Mo.call(this,t)}o(ni,"PassThrough");ni.prototype._transform=function(t,e,i){i(null,t)}});var Wr=N((y_,Ec)=>{var Oi=rt(),{ArrayIsArray:pb,Promise:yb,SymbolAsyncIterator:mb,SymbolDispose:bb}=R(),Ur=qe(),{once:gb}=Q(),wb=mt(),gc=Re(),{aggregateTwoErrors:Sb,codes:{ERR_INVALID_ARG_TYPE:Yo,ERR_INVALID_RETURN_VALUE:Wo,ERR_MISSING_ARGS:_b,ERR_STREAM_DESTROYED:Eb,ERR_STREAM_PREMATURE_CLOSE:xb},AbortError:vb}=te(),{validateFunction:Ab,validateAbortSignal:kb}=Yt(),{isIterable:St,isReadable:qo,isReadableNodeStream:Mr,isNodeStream:wc,isTransformStream:oi,isWebStream:Nb,isReadableStream:$o,isReadableFinished:Tb}=Pe(),Fb=globalThis.AbortController||Vt().AbortController,jo,zo,Vo;function Sc(t,e,i){let r=!1;t.on("close",()=>{r=!0});let n=Ur(t,{readable:e,writable:i},s=>{r=!s});return{destroy:s=>{r||(r=!0,wb.destroyer(t,s||new Eb("pipe")))},cleanup:n}}o(Sc,"destroyer");function Ib(t){return Ab(t[t.length-1],"streams[stream.length - 1]"),t.pop()}o(Ib,"popCallback");function Ho(t){if(St(t))return t;if(Mr(t))return Pb(t);throw new Yo("val",["Readable","Iterable","AsyncIterable"],t)}o(Ho,"makeAsyncIterable");async function*Pb(t){zo||(zo=Ii()),yield*zo.prototype[mb].call(t)}o(Pb,"fromReadable");async function Dr(t,e,i,{end:r}){let n,s=null,a=o(u=>{if(u&&(n=u),s){let d=s;s=null,d()}},"resume"),l=o(()=>new yb((u,d)=>{n?d(n):s=o(()=>{n?d(n):u()},"onresolve")}),"wait");e.on("drain",a);let c=Ur(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of t)e.write(u)||await l();r&&(e.end(),await l()),i()}catch(u){i(n!==u?Sb(n,u):u)}finally{c(),e.off("drain",a)}}o(Dr,"pumpToNode");async function Ko(t,e,i,{end:r}){oi(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(Ko,"pumpToWeb");function Lb(...t){return _c(t,gb(Ib(t)))}o(Lb,"pipeline");function _c(t,e,i){if(t.length===1&&pb(t[0])&&(t=t[0]),t.length<2)throw new _b("streams");let r=new Fb,n=r.signal,s=i?.signal,a=[];kb(s,"options.signal");function l(){g(new vb)}o(l,"abort"),Vo=Vo||Q().addAbortListener;let c;s&&(c=Vo(s,l));let u,d,h=[],b=0;function m(B){g(B,--b===0)}o(m,"finish");function g(B,A){var $;if(B&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=B),!(!u&&!A)){for(;h.length;)h.shift()(u);($=c)===null||$===void 0||$[bb](),r.abort(),A&&(u||a.forEach(st=>st()),Oi.nextTick(e,u,d))}}o(g,"finishImpl");let y;for(let B=0;B<t.length;B++){let A=t[B],$=B<t.length-1,st=B>0,ce=$||i?.end!==!1,vt=B===t.length-1;if(wc(A)){let ie=function(Be){Be&&Be.name!=="AbortError"&&Be.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(Be)};var F=ie;if(o(ie,"onError"),ce){let{destroy:Be,cleanup:tn}=Sc(A,$,st);h.push(Be),qo(A)&&vt&&a.push(tn)}A.on("error",ie),qo(A)&&vt&&a.push(()=>{A.removeListener("error",ie)})}if(B===0)if(typeof A=="function"){if(y=A({signal:n}),!St(y))throw new Wo("Iterable, AsyncIterable or Stream","source",y)}else St(A)||Mr(A)||oi(A)?y=A:y=gc.from(A);else if(typeof A=="function"){if(oi(y)){var k;y=Ho((k=y)===null||k===void 0?void 0:k.readable)}else y=Ho(y);if(y=A(y,{signal:n}),$){if(!St(y,!0))throw new Wo("AsyncIterable",`transform[${B-1}]`,y)}else{var w;jo||(jo=Uo());let ie=new jo({objectMode:!0}),Be=(w=y)===null||w===void 0?void 0:w.then;if(typeof Be=="function")b++,Be.call(y,Ke=>{d=Ke,Ke!=null&&ie.write(Ke),ce&&ie.end(),Oi.nextTick(m)},Ke=>{ie.destroy(Ke),Oi.nextTick(m,Ke)});else if(St(y,!0))b++,Dr(y,ie,m,{end:ce});else if($o(y)||oi(y)){let Ke=y.readable||y;b++,Dr(Ke,ie,m,{end:ce})}else throw new Wo("AsyncIterable or Promise","destination",y);y=ie;let{destroy:tn,cleanup:Qc}=Sc(y,!1,!0);h.push(tn),vt&&a.push(Qc)}}else if(wc(A)){if(Mr(y)){b+=2;let ie=Cb(y,A,m,{end:ce});qo(A)&&vt&&a.push(ie)}else if(oi(y)||$o(y)){let ie=y.readable||y;b++,Dr(ie,A,m,{end:ce})}else if(St(y))b++,Dr(y,A,m,{end:ce});else throw new Yo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=A}else if(Nb(A)){if(Mr(y))b++,Ko(Ho(y),A,m,{end:ce});else if($o(y)||St(y))b++,Ko(y,A,m,{end:ce});else if(oi(y))b++,Ko(y.readable,A,m,{end:ce});else throw new Yo("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],y);y=A}else y=gc.from(A)}return(n!=null&&n.aborted||s!=null&&s.aborted)&&Oi.nextTick(l),y}o(_c,"pipelineImpl");function Cb(t,e,i,{end:r}){let n=!1;if(e.on("close",()=>{n||i(new xb)}),t.pipe(e,{end:!1}),r){let a=function(){n=!0,e.end()};var s=a;o(a,"endFn"),Tb(t)?Oi.nextTick(a):t.once("end",a)}else i();return Ur(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)}),Ur(e,{readable:!1,writable:!0},i)}o(Cb,"pipe");Ec.exports={pipelineImpl:_c,pipeline:Lb}});var Xo=N((b_,Tc)=>{"use strict";var{pipeline:Rb}=Wr(),qr=Re(),{destroyer:Ob}=mt(),{isNodeStream:$r,isReadable:xc,isWritable:vc,isWebStream:Go,isTransformStream:_t,isWritableStream:Ac,isReadableStream:kc}=Pe(),{AbortError:Bb,codes:{ERR_INVALID_ARG_VALUE:Nc,ERR_MISSING_ARGS:Db}}=te(),Mb=qe();Tc.exports=o(function(...e){if(e.length===0)throw new Db("streams");if(e.length===1)return qr.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=qr.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=qr.from(e[m])}for(let m=0;m<e.length;++m)if(!(!$r(e[m])&&!Go(e[m]))){if(m<e.length-1&&!(xc(e[m])||kc(e[m])||_t(e[m])))throw new Nc(`streams[${m}]`,i[m],"must be readable");if(m>0&&!(vc(e[m])||Ac(e[m])||_t(e[m])))throw new Nc(`streams[${m}]`,i[m],"must be writable")}let r,n,s,a,l;function c(m){let g=a;a=null,g?g(m):m?l.destroy(m):!b&&!h&&l.destroy()}o(c,"onfinished");let u=e[0],d=Rb(e,c),h=!!(vc(u)||Ac(u)||_t(u)),b=!!(xc(d)||kc(d)||_t(d));if(l=new qr({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if($r(u))l._write=function(g,y,k){u.write(g,y)?k():r=k},l._final=function(g){u.end(),n=g},u.on("drain",function(){if(r){let g=r;r=null,g()}});else if(Go(u)){let y=(_t(u)?u.writable:u).getWriter();l._write=async function(k,w,F){try{await y.ready,y.write(k).catch(()=>{}),F()}catch(B){F(B)}},l._final=async function(k){try{await y.ready,y.close().catch(()=>{}),n=k}catch(w){k(w)}}}let m=_t(d)?d.readable:d;Mb(m,()=>{if(n){let g=n;n=null,g()}})}if(b){if($r(d))d.on("readable",function(){if(s){let m=s;s=null,m()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let m=d.read();if(m===null){s=l._read;return}if(!l.push(m))return}};else if(Go(d)){let g=(_t(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:y,done:k}=await g.read();if(!l.push(y))return;if(k){l.push(null);return}}catch{return}}}}return l._destroy=function(m,g){!m&&a!==null&&(m=new Bb),s=null,r=null,n=null,a===null?g(m):(a=g,$r(d)&&Ob(d,m))},l},"compose")});var Mc=N((w_,Qo)=>{"use strict";var Ub=globalThis.AbortController||Vt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Wb,ERR_INVALID_ARG_TYPE:Bi,ERR_MISSING_ARGS:qb,ERR_OUT_OF_RANGE:$b},AbortError:Oe}=te(),{validateAbortSignal:Et,validateInteger:Fc,validateObject:xt}=Yt(),jb=R().Symbol("kWeak"),zb=R().Symbol("kResistStopPropagation"),{finished:Vb}=qe(),Hb=Xo(),{addAbortSignalNoValidate:Kb}=ki(),{isWritable:Yb,isNodeStream:Gb}=Pe(),{deprecate:Xb}=Q(),{ArrayPrototypePush:Jb,Boolean:Qb,MathFloor:Ic,Number:Zb,NumberIsNaN:eg,Promise:Pc,PromiseReject:Lc,PromiseResolve:tg,PromisePrototypeThen:Cc,Symbol:Oc}=R(),zr=Oc("kEmpty"),Rc=Oc("kEof");function ig(t,e){if(e!=null&&xt(e,"options"),e?.signal!=null&&Et(e.signal,"options.signal"),Gb(t)&&!Yb(t))throw new Wb("stream",t,"must be writable");let i=Hb(this,t);return e!=null&&e.signal&&Kb(e.signal,i),i}o(ig,"compose");function Vr(t,e){if(typeof t!="function")throw new Bi("fn",["Function","AsyncFunction"],t);e!=null&&xt(e,"options"),e?.signal!=null&&Et(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=Ic(e.concurrency));let r=i-1;return e?.highWaterMark!=null&&(r=Ic(e.highWaterMark)),Fc(i,"options.concurrency",1),Fc(r,"options.highWaterMark",0),r+=i,o(async function*(){let s=Q().AbortSignalAny([e?.signal].filter(Qb)),a=this,l=[],c={signal:s},u,d,h=!1,b=0;function m(){h=!0,g()}o(m,"onCatch");function g(){b-=1,y()}o(g,"afterItemProcessed");function y(){d&&!h&&b<i&&l.length<r&&(d(),d=null)}o(y,"maybeResume");async function k(){try{for await(let w of a){if(h)return;if(s.aborted)throw new Oe;try{if(w=t(w,c),w===zr)continue;w=tg(w)}catch(F){w=Lc(F)}b+=1,Cc(w,g,m),l.push(w),u&&(u(),u=null),!h&&(l.length>=r||b>=i)&&await new Pc(F=>{d=F})}l.push(Rc)}catch(w){let F=Lc(w);Cc(F,g,m),l.push(F)}finally{h=!0,u&&(u(),u=null)}}o(k,"pump"),k();try{for(;;){for(;l.length>0;){let w=await l[0];if(w===Rc)return;if(s.aborted)throw new Oe;w!==zr&&(yield w),l.shift(),y()}await new Pc(w=>{u=w})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}o(Vr,"map");function rg(t=void 0){return t!=null&&xt(t,"options"),t?.signal!=null&&Et(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 Oe({cause:t.signal.reason});yield[i++,n]}},"asIndexedPairs").call(this)}o(rg,"asIndexedPairs");async function Bc(t,e=void 0){for await(let i of Jo.call(this,t,e))return!0;return!1}o(Bc,"some");async function ng(t,e=void 0){if(typeof t!="function")throw new Bi("fn",["Function","AsyncFunction"],t);return!await Bc.call(this,async(...i)=>!await t(...i),e)}o(ng,"every");async function og(t,e){for await(let i of Jo.call(this,t,e))return i}o(og,"find");async function sg(t,e){if(typeof t!="function")throw new Bi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n),zr}o(i,"forEachFn");for await(let r of Vr.call(this,i,e));}o(sg,"forEach");function Jo(t,e){if(typeof t!="function")throw new Bi("fn",["Function","AsyncFunction"],t);async function i(r,n){return await t(r,n)?r:zr}return o(i,"filterFn"),Vr.call(this,i,e)}o(Jo,"filter");var jr=class extends qb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};o(jr,"ReduceAwareErrMissingArgs");async function ag(t,e,i){var r;if(typeof t!="function")throw new Bi("reducer",["Function","AsyncFunction"],t);i!=null&&xt(i,"options"),i?.signal!=null&&Et(i.signal,"options.signal");let n=arguments.length>1;if(i!=null&&(r=i.signal)!==null&&r!==void 0&&r.aborted){let u=new Oe(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Vb(this.destroy(u)),u}let s=new Ub,a=s.signal;if(i!=null&&i.signal){let u={once:!0,[jb]:this,[zb]:!0};i.signal.addEventListener("abort",()=>s.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new Oe;n?e=await t(e,u,{signal:a}):(e=u,n=!0)}if(!l&&!n)throw new jr}finally{s.abort()}return e}o(ag,"reduce");async function lg(t){t!=null&&xt(t,"options"),t?.signal!=null&&Et(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 Oe(void 0,{cause:t.signal.reason});Jb(e,r)}return e}o(lg,"toArray");function cg(t,e){let i=Vr.call(this,t,e);return o(async function*(){for await(let n of i)yield*n},"flatMap").call(this)}o(cg,"flatMap");function Dc(t){if(t=Zb(t),eg(t))return 0;if(t<0)throw new $b("number",">= 0",t);return t}o(Dc,"toIntegerOrInfinity");function ug(t,e=void 0){return e!=null&&xt(e,"options"),e?.signal!=null&&Et(e.signal,"options.signal"),t=Dc(t),o(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Oe;for await(let s of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;t--<=0&&(yield s)}},"drop").call(this)}o(ug,"drop");function fg(t,e=void 0){return e!=null&&xt(e,"options"),e?.signal!=null&&Et(e.signal,"options.signal"),t=Dc(t),o(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Oe;for await(let s of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Oe;if(t-- >0&&(yield s),t<=0)return}},"take").call(this)}o(fg,"take");Qo.exports.streamReturningOperators={asIndexedPairs:Xb(rg,"readable.asIndexedPairs will be removed in a future version."),drop:ug,filter:Jo,flatMap:cg,map:Vr,take:fg,compose:ig};Qo.exports.promiseReturningOperators={every:ng,forEach:sg,reduce:ag,toArray:lg,some:Bc,find:og}});var Zo=N((__,Uc)=>{"use strict";var{ArrayPrototypePop:dg,Promise:hg}=R(),{isIterable:pg,isNodeStream:yg,isWebStream:mg}=Pe(),{pipelineImpl:bg}=Wr(),{finished:gg}=qe();es();function wg(...t){return new hg((e,i)=>{let r,n,s=t[t.length-1];if(s&&typeof s=="object"&&!yg(s)&&!pg(s)&&!mg(s)){let a=dg(t);r=a.signal,n=a.end}bg(t,(a,l)=>{a?i(a):e(l)},{signal:r,end:n})})}o(wg,"pipeline");Uc.exports={finished:gg,pipeline:wg}});var es=N((x_,Yc)=>{var{Buffer:Sg}=Me(),{ObjectDefineProperty:Ve,ObjectKeys:$c,ReflectApply:jc}=R(),{promisify:{custom:zc}}=Q(),{streamReturningOperators:Wc,promiseReturningOperators:qc}=Mc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Vc}}=te(),_g=Xo(),{setDefaultHighWaterMark:Eg,getDefaultHighWaterMark:xg}=Ni(),{pipeline:Hc}=Wr(),{destroyer:vg}=mt(),Kc=qe(),ts=Zo(),Di=Pe(),C=Yc.exports=xr().Stream;C.isDestroyed=Di.isDestroyed;C.isDisturbed=Di.isDisturbed;C.isErrored=Di.isErrored;C.isReadable=Di.isReadable;C.isWritable=Di.isWritable;C.Readable=Ii();for(let t of $c(Wc)){let i=function(...r){if(new.target)throw Vc();return C.Readable.from(jc(e,this,r))};kg=i,o(i,"fn");let e=Wc[t];Ve(i,"name",{__proto__:null,value:e.name}),Ve(i,"length",{__proto__:null,value:e.length}),Ve(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var kg;for(let t of $c(qc)){let i=function(...n){if(new.target)throw Vc();return jc(e,this,n)};kg=i,o(i,"fn");let e=qc[t];Ve(i,"name",{__proto__:null,value:e.name}),Ve(i,"length",{__proto__:null,value:e.length}),Ve(C.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var kg;C.Writable=Br();C.Duplex=Re();C.Transform=Do();C.PassThrough=Uo();C.pipeline=Hc;var{addAbortSignal:Ag}=ki();C.addAbortSignal=Ag;C.finished=Kc;C.destroy=vg;C.compose=_g;C.setDefaultHighWaterMark=Eg;C.getDefaultHighWaterMark=xg;Ve(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return ts}});Ve(Hc,zc,{__proto__:null,enumerable:!0,get(){return ts.pipeline}});Ve(Kc,zc,{__proto__:null,enumerable:!0,get(){return ts.finished}});C.Stream=C;C._isUint8Array=o(function(e){return e instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=o(function(e){return Sg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Gc=N((A_,q)=>{"use strict";var H=es(),Ng=Zo(),Tg=H.Readable.destroy;q.exports=H.Readable;q.exports._uint8ArrayToBuffer=H._uint8ArrayToBuffer;q.exports._isUint8Array=H._isUint8Array;q.exports.isDisturbed=H.isDisturbed;q.exports.isErrored=H.isErrored;q.exports.isReadable=H.isReadable;q.exports.Readable=H.Readable;q.exports.Writable=H.Writable;q.exports.Duplex=H.Duplex;q.exports.Transform=H.Transform;q.exports.PassThrough=H.PassThrough;q.exports.addAbortSignal=H.addAbortSignal;q.exports.finished=H.finished;q.exports.destroy=H.destroy;q.exports.destroy=Tg;q.exports.pipeline=H.pipeline;q.exports.compose=H.compose;Object.defineProperty(H,"promises",{configurable:!0,enumerable:!0,get(){return Ng}});q.exports.Stream=H.Stream;q.exports.default=q.exports});var Lg={};qi(Lg,{ActionType:()=>Xi,ApiError:()=>f,AsyncFile:()=>ci,AsyncFileSystem:()=>Ct,AsyncMirror:()=>is,AsyncStoreFileSystem:()=>en,BigIntStats:()=>G,Cred:()=>j,ErrorCode:()=>J,ErrorStrings:()=>rn,File:()=>hi,FileFlag:()=>I,FileIndex:()=>ui,FileSystem:()=>be,FileType:()=>L,InMemory:()=>gi,IndexDirInode:()=>He,IndexFileInode:()=>Wi,IndexInode:()=>fi,Inode:()=>ue,NoSyncFile:()=>Gi,Overlay:()=>ns,PreloadFile:()=>re,SimpleSyncRWTransaction:()=>Rt,Stats:()=>D,StatsCommon:()=>It,SyncFile:()=>Yi,SyncFileSystem:()=>Je,SyncStoreFile:()=>yi,SyncStoreFileSystem:()=>at,backends:()=>Qr,configure:()=>Ig,decode:()=>ee,decodeDirListing:()=>pi,default:()=>Pg,encode:()=>M,encodeDirListing:()=>se,fs:()=>Gr,initialize:()=>Jc,isIndexDirInode:()=>os,isIndexFileInode:()=>Fg,levenshtein:()=>on,mkdirpSync:()=>fs,randomIno:()=>Lt,registerBackend:()=>Xc,rootIno:()=>fe,setImmediate:()=>Wu,size_max:()=>Ki,toPromise:()=>Uu,wait:()=>Mu});var Gr={};qi(Gr,{BigIntStats:()=>G,Dir:()=>tr,Dirent:()=>tt,ReadStream:()=>Hr,Stats:()=>D,WriteStream:()=>Kr,_toUnixTimestamp:()=>ps,access:()=>pd,accessSync:()=>hf,appendFile:()=>zf,appendFileSync:()=>Gu,chmod:()=>cd,chmodSync:()=>cf,chown:()=>ad,chownSync:()=>af,close:()=>Hf,closeSync:()=>et,constants:()=>di,copyFile:()=>Ed,copyFileSync:()=>mf,createReadStream:()=>gd,createWriteStream:()=>wd,exists:()=>Bf,existsSync:()=>un,fchmod:()=>Zf,fchmodSync:()=>yn,fchown:()=>Qf,fchownSync:()=>pn,fdatasync:()=>Gf,fdatasyncSync:()=>Qu,fstat:()=>Vf,fstatSync:()=>Xu,fsync:()=>Yf,fsyncSync:()=>Ju,ftruncate:()=>Kf,ftruncateSync:()=>Ss,futimes:()=>ed,futimesSync:()=>mn,getMount:()=>ms,getMounts:()=>bs,initialize:()=>Zi,lchmod:()=>ud,lchmodSync:()=>uf,lchown:()=>ld,lchownSync:()=>lf,link:()=>nd,linkSync:()=>nf,lopenSync:()=>er,lstat:()=>Mf,lstatSync:()=>Vu,lutimes:()=>dd,lutimesSync:()=>df,mkdir:()=>id,mkdirSync:()=>rf,mkdtemp:()=>_d,mkdtempSync:()=>yf,mount:()=>Qi,open:()=>qf,openSync:()=>wi,opendir:()=>Ad,opendirSync:()=>wf,promises:()=>or,read:()=>Jf,readFile:()=>$f,readFileSync:()=>ws,readSync:()=>ef,readdir:()=>rd,readdirSync:()=>bn,readlink:()=>sd,readlinkSync:()=>sf,readv:()=>xd,readvSync:()=>bf,realpath:()=>hd,realpathSync:()=>gn,rename:()=>Of,renameSync:()=>zu,rm:()=>Sd,rmSync:()=>pf,rmdir:()=>td,rmdirSync:()=>tf,stat:()=>Df,statSync:()=>fn,symlink:()=>od,symlinkSync:()=>of,truncate:()=>Uf,truncateSync:()=>Hu,umount:()=>cn,unlink:()=>Wf,unlinkSync:()=>gs,unwatchFile:()=>md,utimes:()=>fd,utimesSync:()=>ff,watch:()=>bd,watchFile:()=>yd,write:()=>Xf,writeFile:()=>jf,writeFileSync:()=>hn,writeSync:()=>Zu,writev:()=>vd,writevSync:()=>gf});var J=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EIO=5]="EIO",y[y.EBADF=9]="EBADF",y[y.EACCES=13]="EACCES",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.EROFS=30]="EROFS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ENOTSUP=95]="ENOTSUP",y))(J||{}),rn={[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.",[39]:"Directory is not empty.",[95]:"Operation is not supported."},f=class extends Error{constructor(i,r=rn[i],n){super(r);this.errno=i;this.path=n;this.code=J[i],this.message=`${this.code}: ${r}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let r=new f(i.errno,i.message,i.path);return r.code=i.code,r.stack=i.stack,r}static OnPath(i,r){return new f(i,rn[i],r)}static EACCES(i){return this.OnPath(13,i)}static ENOENT(i){return this.OnPath(2,i)}static EEXIST(i){return this.OnPath(17,i)}static EISDIR(i){return this.OnPath(21,i)}static ENOTDIR(i){return this.OnPath(20,i)}static EPERM(i){return this.OnPath(1,i)}static ENOTEMPTY(i){return this.OnPath(39,i)}code;syscall="";stack;toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};o(f,"ApiError");var nn=class{constructor(e,i,r,n,s,a){this.uid=e;this.gid=i;this.suid=r;this.sgid=n;this.euid=s;this.egid=a}},j=nn;o(j,"Cred"),Ye(j,"Root",new nn(0,0,0,0,0,0));var di={};qi(di,{COPYFILE_EXCL:()=>cu,COPYFILE_FICLONE:()=>uu,COPYFILE_FICLONE_FORCE:()=>fu,F_OK:()=>au,O_APPEND:()=>Ft,O_CREAT:()=>xe,O_DIRECT:()=>gu,O_DIRECTORY:()=>hu,O_DSYNC:()=>mu,O_EXCL:()=>Nt,O_NOATIME:()=>pu,O_NOCTTY:()=>du,O_NOFOLLOW:()=>yu,O_NONBLOCK:()=>wu,O_RDONLY:()=>$i,O_RDWR:()=>Ge,O_SYMLINK:()=>bu,O_SYNC:()=>ji,O_TRUNC:()=>Tt,O_WRONLY:()=>kt,R_OK:()=>me,S_IFBLK:()=>_u,S_IFCHR:()=>Su,S_IFDIR:()=>Vi,S_IFIFO:()=>Eu,S_IFLNK:()=>Hi,S_IFMT:()=>Y,S_IFREG:()=>zi,S_IFSOCK:()=>xu,S_IRGRP:()=>Fu,S_IROTH:()=>Cu,S_IRUSR:()=>Au,S_IRWXG:()=>Tu,S_IRWXO:()=>Lu,S_IRWXU:()=>vu,S_IWGRP:()=>Iu,S_IWOTH:()=>Ru,S_IWUSR:()=>ku,S_IXGRP:()=>Pu,S_IXOTH:()=>Ou,S_IXUSR:()=>Nu,W_OK:()=>oe,X_OK:()=>lu});var au=0,me=4,oe=2,lu=1,cu=1,uu=2,fu=4,$i=0,kt=1,Ge=2,xe=64,Nt=128,du=256,Tt=512,Ft=1024,hu=65536,pu=262144,yu=131072,ji=1052672,mu=4096,bu=32768,gu=16384,wu=2048,Y=61440,zi=32768,Vi=16384,Su=8192,_u=24576,Eu=4096,Hi=40960,xu=49152,vu=448,Au=256,ku=128,Nu=64,Tu=56,Fu=32,Iu=16,Pu=8,Lu=7,Cu=4,Ru=2,Ou=1;var L=(r=>(r[r.FILE=32768]="FILE",r[r.DIRECTORY=16384]="DIRECTORY",r[r.SYMLINK=40960]="SYMLINK",r))(L||{}),It=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(e=L.FILE,i=-1,r,n,s,a,l,c,u){let d=Date.now(),h=o((b,m)=>typeof b==this._typename?b:this._convert(typeof b==this._typename_inverse?b:m),"resolveT");if(this.atimeMs=h(n,d),this.mtimeMs=h(s,d),this.ctimeMs=h(a,d),this.birthtimeMs=h(u,d),this.uid=h(l,0),this.gid=h(c,0),this.size=this._convert(i),r)this.mode=this._convert(r);else switch(e){case L.FILE:this.mode=this._convert(420);break;case L.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(i)/512)),this.mode&61440||(this.mode=this.mode|this._convert(e))}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=this.mode&-61441,n=15,s=15,a=15;if(i.euid==this.uid){let u=(3840&r)>>8;n=(e^u)&e}if(i.egid==this.gid){let u=(240&r)>>4;s=(e^u)&e}let l=15&r;return a=(e^l)&e,!(n&s&a)}getCred(e=Number(this.uid),i=Number(this.gid)){return new j(e,i,Number(this.uid),Number(this.gid),e,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(It,"StatsCommon");var D=class extends It{_isBigint=!1;static clone(e){return new D(e.mode&61440,e.size,e.mode&-61441,e.atimeMs,e.mtimeMs,e.ctimeMs,e.uid,e.gid,e.birthtimeMs)}};o(D,"Stats");var G=class extends It{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new G(Number(e.mode)&61440,BigInt(e.size),BigInt(e.mode)&BigInt(-61441),BigInt(e.atimeMs),BigInt(e.mtimeMs),BigInt(e.ctimeMs),BigInt(e.uid),BigInt(e.gid),BigInt(e.birthtimeMs))}};o(G,"BigIntStats");var Bu="/",as="/";function Pt(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}o(Pt,"validateString");function ls(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 c=i.lastIndexOf("/");c===-1?(i="",r=0):(i=i.slice(0,c),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(ls,"normalizeString");function ve(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){let n=r>=0?t[r]:Bu;Pt(n,`paths[${r}]`),n.length!==0&&(e=`${n}/${e}`,i=n[0]==="/")}return e=ls(e,!i),i?`/${e}`:e.length>0?e:"."}o(ve,"resolve");function Du(t){if(Pt(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=ls(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}o(Du,"normalize");function Ae(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let r=t[i];Pt(r,"path"),r.length>0&&(e===void 0?e=r:e+=`/${r}`)}return e===void 0?".":Du(e)}o(Ae,"join");function v(t){if(Pt(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(v,"dirname");function z(t,e){e!==void 0&&Pt(e,"ext"),Pt(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(z,"basename");var Ki=2**32-1,fe=0n;function us(){return Math.round(Math.random()*2**32).toString(16)}o(us,"_random");function Lt(){return BigInt("0x"+us()+us())}o(Lt,"randomIno");var ue=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(50),this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Lt(),this.nlink=1,this.size=4096;let r=Date.now();this.atime=r,this.mtime=r,this.ctime=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 atime(){return this.view.getFloat64(26,!0)}set atime(e){this.view.setFloat64(26,e,!0)}get mtime(){return this.view.getFloat64(34,!0)}set mtime(e){this.view.setFloat64(34,e,!0)}get ctime(){return this.view.getFloat64(42,!0)}set ctime(e){this.view.setFloat64(42,e,!0)}toStats(){return new D((this.mode&61440)===L.DIRECTORY?L.DIRECTORY:L.FILE,this.size,this.mode,this.atime,this.mtime,this.ctime,this.uid,this.gid)}sizeof(){return this.buffer.byteLength}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.atime!==e.atimeMs&&(this.atime=e.atimeMs,i=!0),this.mtime!==e.mtimeMs&&(this.mtime=e.mtimeMs,i=!0),this.ctime!==e.ctimeMs&&(this.ctime=e.ctimeMs,i=!0),i}};o(ue,"Inode");var Xi=(n=>(n[n.NOP=0]="NOP",n[n.THROW=1]="THROW",n[n.TRUNCATE=2]="TRUNCATE",n[n.CREATE=3]="CREATE",n))(Xi||{}),Xe=class{static FromString(e){return Xe.flagCache.has(e)||Xe.flagCache.set(e,new Xe(e)),Xe.flagCache.get(e)}flagStr;constructor(e){if(typeof e=="number"&&(e=Xe.NumberToString(e)),Xe.validFlagStrs.indexOf(e)<0)throw new f(22,"Invalid flag string: "+e);this.flagStr=e}static NumberToString(e){switch(e){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new f(22,"Invalid flag number: "+e)}}toString(){return this.flagStr}get mode(){let e=0;return e<<=1,e+=+this.isReadable(),e<<=1,e+=+this.isWriteable(),e<<=1,e}isReadable(){return this.flagStr.indexOf("r")!==-1||this.flagStr.indexOf("+")!==-1}isWriteable(){return this.flagStr.indexOf("w")!==-1||this.flagStr.indexOf("a")!==-1||this.flagStr.indexOf("+")!==-1}isTruncating(){return this.flagStr.indexOf("w")!==-1}isAppendable(){return this.flagStr.indexOf("a")!==-1}isSynchronous(){return this.flagStr.indexOf("s")!==-1}isExclusive(){return this.flagStr.indexOf("x")!==-1}pathExistsAction(){return this.isExclusive()?1:this.isTruncating()?2:0}pathNotExistsAction(){return(this.isWriteable()||this.isAppendable())&&this.flagStr!=="r+"?3:1}},I=Xe;o(I,"FileFlag"),Ye(I,"flagCache",new Map),Ye(I,"validFlagStrs",["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"]);var hi=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};o(hi,"File");var re=class extends hi{constructor(i,r,n,s,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:Ki}))){super();this.fs=i;this.path=r;this.flag=n;this.stats=s;this._buffer=a;if(this.stats.size!=a.byteLength){if(this.flag.isReadable())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 this.flag.isAppendable()?this.stats.size:this._position}set position(i){this._position=i}async stat(){return D.clone(this.stats)}statSync(){return D.clone(this.stats)}truncate(i){if(this.truncateSync(i),this.flag.isSynchronous()&&!this.fs.metadata.synchronous)return this.sync()}truncateSync(i){if(this._dirty=!0,!this.flag.isWriteable())throw new f(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),this.flag.isSynchronous()&&this.fs.metadata.synchronous&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),this.flag.isSynchronous()&&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,!this.flag.isWriteable())throw new f(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 c=new Uint8Array(new ArrayBuffer(a,{maxByteLength:Ki}));c.set(this._buffer),this._buffer=c}this._buffer.set(i.slice(r,r+n),s);let l=this._buffer.byteOffset;return this.stats.mtimeMs=Date.now(),this.flag.isSynchronous()?(this.syncSync(),l):(this.position=s+l,l)}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(!this.flag.isReadable())throw new f(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||i.set(this._buffer.slice(s,a),r),l}async chmod(i){this.chmodSync(i)}chmodSync(i){if(!this.fs.metadata.supportsProperties)throw new f(95);this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,r){this.chownSync(i,r)}chownSync(i,r){if(!this.fs.metadata.supportsProperties)throw new f(95);this._dirty=!0,this.stats.chown(i,r),this.syncSync()}async utimes(i,r){this.utimesSync(i,r)}utimesSync(i,r){if(!this.fs.metadata.supportsProperties)throw new f(95);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 Yi=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(Yi,"SyncFile");var Gi=class extends re{constructor(e,i,r,n,s){super(e,i,r,n,s)}async sync(){}syncSync(){}async close(){}closeSync(){}};o(Gi,"NoSyncFile");var be=class{static get Name(){return this.name}get 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(be,"FileSystem");var Je=class extends be{get metadata(){return{...super.metadata,synchronous:!0}}async ready(){return this}async rename(e,i,r){return this.renameSync(e,i,r)}async stat(e,i){return this.statSync(e,i)}async createFile(e,i,r,n){return this.createFileSync(e,i,r,n)}async openFile(e,i,r){return this.openFileSync(e,i,r)}async unlink(e,i){return this.unlinkSync(e,i)}async rmdir(e,i){return this.rmdirSync(e,i)}async mkdir(e,i,r){return this.mkdirSync(e,i,r)}async readdir(e,i){return this.readdirSync(e,i)}async link(e,i,r){return this.linkSync(e,i,r)}async sync(e,i,r){return this.syncSync(e,i,r)}};o(Je,"SyncFileSystem");var Ct=class extends be{renameSync(e,i,r){throw new f(95)}statSync(e,i){throw new f(95)}createFileSync(e,i,r,n){throw new f(95)}openSync(e,i,r,n){throw new f(95)}openFileSync(e,i,r){throw new f(95)}unlinkSync(e,i){throw new f(95)}rmdirSync(e,i){throw new f(95)}mkdirSync(e,i,r){throw new f(95)}readdirSync(e,i){throw new f(95)}linkSync(e,i,r){throw new f(95)}syncSync(e,i,r){throw new f(95)}};o(Ct,"AsyncFileSystem");function fs(t,e,i,r){r.existsSync(t,i)||(fs(v(t),e,i,r),r.mkdirSync(t,e,i))}o(fs,"mkdirpSync");function Ji(t,e,i,r,n){return Math.min(t+1,e+1,i+1,r===n?e:e+1)}o(Ji,"_min");function on(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 b=0;b<i;)s[i+b]=t.charCodeAt(n+b),s[b]=++b;let a,l,c,u,d;for(a=0;a+3<r;){let b=e.charCodeAt(n+(l=a)),m=e.charCodeAt(n+(c=a+1)),g=e.charCodeAt(n+(u=a+2)),y=e.charCodeAt(n+(d=a+3)),k=a+=4;for(let w=0;w<i;){let F=s[i+w],B=s[w];l=Ji(B,l,c,b,F),c=Ji(l,c,u,m,F),u=Ji(c,u,d,g,F),k=Ji(u,d,k,y,F),s[w++]=k,d=u,u=c,c=l,l=B}}let h=0;for(;a<r;){let b=e.charCodeAt(n+(l=a));h=++a;for(let m=0;m<i;m++){let g=s[m];s[m]=h=g<l||h<l?g>h?h+1:g+1:b===s[i+m]?l:l+1,l=g}}return h}o(on,"levenshtein");function Mu(t){return new Promise(e=>{setTimeout(e,t)})}o(Mu,"wait");function Uu(t){return function(...e){return new Promise((i,r)=>{e.push((n,...s)=>{n?r(n):i(s[0])}),t(...e)})}}o(Uu,"toPromise");var Wu=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function M(t,e="utf8"){switch(e){case"ascii":return new TextEncoder().encode(t).map(i=>i&127);case"latin1":case"binary":case"utf8":case"utf-8":case"base64":case"base64url":case"hex":return new TextEncoder().encode(t);case"utf16le":case"ucs2":case"ucs-2":return new TextEncoder().encode(t).slice(0,-1);default:throw new f(22,"Invalid encoding: "+e)}}o(M,"encode");function ee(t,e="utf8"){switch(e){case"ascii":case"utf8":case"utf-8":return new TextDecoder().decode(t);case"latin1":case"binary":return new TextDecoder("latin1").decode(t);case"utf16le":case"ucs2":case"ucs-2":let i="";for(let r=0;r<t.length;r+=2){let n=t[r]|t[r+1]<<8;i+=String.fromCharCode(n)}return i;case"base64":return btoa(Array.from(t).map(r=>String.fromCharCode(r)).join(""));case"base64url":return ee(t,"base64").replace("/","_").replace("+","-");case"hex":return Array.from(t).map(r=>r.toString(16)).join("");default:throw new f(22,"Invalid encoding: "+e)}}o(ee,"decode");function pi(t){return JSON.parse(ee(t),(e,i)=>e==""?i:BigInt(i))}o(pi,"decodeDirListing");function se(t){return M(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}o(se,"encodeDirListing");var Rt=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(Rt,"SimpleSyncRWTransaction");var yi=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(yi,"SyncStoreFile");var at=class extends Je{store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}get metadata(){return{name:this.store.name,readonly:!1,supportsProperties:!0,synchronous:!0,freeSpace:0,totalSpace:0}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=v(e),a=z(e),l=v(i),c=z(i),u=this.findINode(n,s),d=this.getDirListing(n,u,s);if(!u.toStats().hasAccess(2,r))throw f.EACCES(e);if(!d[a])throw f.ENOENT(e);let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new f(16,s);let b,m;if(l===s?(b=u,m=d):(b=this.findINode(n,l),m=this.getDirListing(n,b,l)),m[c]){let g=this.getINode(n,m[c],i);if(g.toStats().isFile())try{n.remove(g.ino),n.remove(m[c])}catch(y){throw n.abort(),y}else throw f.EPERM(i)}m[c]=h;try{n.put(u.ino,se(d),!0),n.put(b.ino,se(m),!0)}catch(g){throw n.abort(),g}n.commit()}statSync(e,i){let r=this.findINode(this.store.beginTransaction("readonly"),e).toStats();if(!r.hasAccess(4,i))throw f.EACCES(e);return r}createFileSync(e,i,r,n){return this.commitNewFile(e,L.FILE,r,n),this.openFileSync(e,i,n)}openFileSync(e,i,r){let n=this.store.beginTransaction("readonly"),s=this.findINode(n,e),a=n.get(s.ino);if(!s.toStats().hasAccess(i.mode,r))throw f.EACCES(e);if(a===null)throw f.ENOENT(e);return new yi(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 f.ENOTEMPTY(e);this.removeEntry(e,!0,i)}mkdirSync(e,i,r){this.commitNewFile(e,L.DIRECTORY,i,r,M("{}"))}readdirSync(e,i){let r=this.store.beginTransaction("readonly"),n=this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw f.EACCES(e);return Object.keys(this.getDirListing(r,n,e))}syncSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=this._findINode(n,v(e),z(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(c){throw n.abort(),c}n.commit()}linkSync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=v(e);if(!this.findINode(n,s).toStats().hasAccess(4,r))throw f.EACCES(s);let l=v(i),c=this.findINode(n,l),u=this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw f.EACCES(l);let d=this._findINode(n,s,z(e)),h=this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw f.EACCES(i);h.nlink++,u[z(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,se(u),!0)}catch(b){throw n.abort(),b}n.commit()}makeRootDirectory(){let e=this.store.beginTransaction("readwrite");if(e.get(fe))return;let i=new ue;i.mode=511|L.DIRECTORY,e.put(i.ino,M("{}"),!1),e.put(fe,i.data,!1),e.commit()}_findINode(e,i,r,n=new Set){let s=Ae(i,r);if(n.has(s))throw new f(5,"Infinite loop detected while finding inode",s);if(n.add(s),i!="/"){let a=this._findINode(e,v(i),z(i),n),l=this.getDirListing(e,this.getINode(e,a,i+as+r),i);if(!(r in l))throw f.ENOENT(ve(i,r));return l[r]}if(r!=""){let a=this.getDirListing(e,this.getINode(e,fe,i),i);if(!(r in a))throw f.ENOENT(ve(i,r));return a[r]}return fe}findINode(e,i){let r=this._findINode(e,v(i),z(i));return this.getINode(e,r,i)}getINode(e,i,r){let n=e.get(i);if(!n)throw f.ENOENT(r);return new ue(n.buffer)}getDirListing(e,i,r){if(!i.toStats().isDirectory())throw f.ENOTDIR(r);let n=e.get(i.ino);if(!n)throw f.ENOENT(r);return pi(n)}addNewNode(e,i){let n;for(;0<5;)try{return n=Lt(),e.put(n,i,!1),n}catch{}throw new f(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,r,n,s=new Uint8Array){let a=this.store.beginTransaction("readwrite"),l=v(e),c=z(e),u=this.findINode(a,l),d=this.getDirListing(a,u,l);if(!u.toStats().hasAccess(2,n))throw f.EACCES(e);if(e==="/")throw f.EEXIST(e);if(d[c])throw f.EEXIST(e);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[c]=this.addNewNode(a,h.data),a.put(u.ino,se(d),!0)}catch(b){throw a.abort(),b}return a.commit(),h}removeEntry(e,i,r){let n=this.store.beginTransaction("readwrite"),s=v(e),a=this.findINode(n,s),l=this.getDirListing(n,a,s),c=z(e),u=l[c];if(!u)throw f.ENOENT(e);let d=this.getINode(n,u,e);if(!d.toStats().hasAccess(2,r))throw f.EACCES(e);if(delete l[c],!i&&d.toStats().isDirectory())throw f.EISDIR(e);if(i&&!d.toStats().isDirectory())throw f.ENOTDIR(e);try{n.put(a.ino,se(l),!0),--d.nlink<1&&(n.remove(d.ino),n.remove(u))}catch(h){throw n.abort(),h}n.commit()}};o(at,"SyncStoreFileSystem");function sn(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}o(sn,"isBackend");async function qu(t,e){if(typeof e!="object"||e===null)throw new f(22,"Invalid options");for(let[i,r]of Object.entries(t.options)){let n=e&&r;if(n==null){if(!r.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:on(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new f(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 f(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}
3
+ Option description: ${r.description}`);r.validator&&await r.validator(n)}}o(qu,"checkOptions");function ds(t,e){return qu(t,e),t.create(e).ready()}o(ds,"createBackend");function $u(t){return t!=null&&typeof t=="object"&&"backend"in t}o($u,"isBackendConfig");async function an(t){let{backend:e}=t;if(!e)throw new f(1,"Missing backend");if(typeof t!="object"||t==null)throw new f(22,"Invalid options on configuration object.");let i=Object.keys(t).filter(r=>r!="backend");for(let r of i){let n=t[r];sn(n)&&(n={backend:n}),$u(n)&&(t[r]=await an(n))}if(!e)throw new f(1,`Backend "${e}" is not available`);return e.create(t)}o(an,"resolveBackendConfig");var bi=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new Rt(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(bi,"InMemoryStore");var gi={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",description:"The name of the store"}},create({name:t}){return new at({store:new bi(t)})}},ln=class extends at{static isAvailable(){return!0}constructor(){super({store:new bi})}},mi=ln;o(mi,"_InMemory"),Ye(mi,"create",ds.bind(ln)),Ye(mi,"options",{});function ps(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(ps,"_toUnixTimestamp");function we(t,e){switch(typeof t){case"number":return t;case"string":let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new f(22,"Invalid mode: "+t?.toString())}o(we,"normalizeMode");function Ot(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 f(22,"Invalid time.")}o(Ot,"normalizeTime");function U(t){if(t.indexOf("\0")>=0)throw new f(22,"Path must be a string without null bytes.");if(t==="")throw new f(22,"Path must not be empty.");return t=t.replaceAll(/\/+/g,"/"),ve(t)}o(U,"normalizePath");function Qe(t,e,i,r){switch(t===null?"null":typeof t){case"object":return{encoding:typeof t.encoding<"u"?t.encoding:e,flag:typeof t.flag<"u"?t.flag:i,mode:we(t.mode,r)};case"string":return{encoding:t,flag:i,mode:r};case"null":case"undefined":case"function":return{encoding:e,flag:i,mode:r};default:throw new TypeError(`"options" must be a string or an object, got ${typeof t} instead.`)}}o(Qe,"normalizeOptions");function S(){}o(S,"nop");var x=j.Root;function ys(t){x=t}o(ys,"setCred");var lt=new Map,ju=100;function Bt(t){let e=ju++;return lt.set(e,t),e}o(Bt,"getFdForFile");function T(t){if(!lt.has(t))throw new f(9);return lt.get(t)}o(T,"fd2file");var ge=new Map;Qi("/",gi.create({name:"root"}));function ms(t){return ge.get(t)}o(ms,"getMount");function bs(){return Object.fromEntries(ge.entries())}o(bs,"getMounts");function Qi(t,e){if(t[0]!=="/"&&(t="/"+t),t=ve(t),ge.has(t))throw new f(22,"Mount point "+t+" is already in use.");ge.set(t,e)}o(Qi,"mount");function cn(t){if(t[0]!=="/"&&(t=`/${t}`),t=ve(t),!ge.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");ge.delete(t)}o(cn,"umount");function de(t){t=U(t);let e=[...ge].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 f(5,"ZenFS not initialized with a file system")}o(de,"resolveFS");function hs(t,e){for(let[i,r]of Object.entries(e))t=t?.replaceAll(i,r);return t}o(hs,"fixPaths");function Ze(t,e){return typeof t.stack=="string"&&(t.stack=hs(t.stack,e)),t.message=hs(t.message,e),t}o(Ze,"fixError");function Zi(t){"/"in t&&cn("/");for(let[e,i]of Object.entries(t))Qi(e,i)}o(Zi,"initialize");var or={};qi(or,{FileHandle:()=>le,access:()=>Rn,appendFile:()=>nr,chmod:()=>In,chown:()=>Tn,constants:()=>di,copyFile:()=>Rf,createReadStream:()=>If,createWriteStream:()=>Pf,exists:()=>_i,fchmod:()=>Af,fchown:()=>vf,futimes:()=>kf,lchmod:()=>Pn,lchown:()=>Fn,link:()=>An,lopen:()=>rr,lstat:()=>Sn,lutimes:()=>Cn,mkdir:()=>vn,mkdtemp:()=>Cf,open:()=>ct,read:()=>xf,readFile:()=>Ei,readdir:()=>Si,readlink:()=>Nn,realpath:()=>xi,rename:()=>wn,rm:()=>Lf,rmdir:()=>xn,stat:()=>Mt,symlink:()=>kn,truncate:()=>_n,unlink:()=>ir,unwatchFile:()=>Tf,utimes:()=>Ln,watch:()=>Ff,watchFile:()=>Nf,write:()=>Ef,writeFile:()=>Wt});function ae(...[t,e,i,...r]){i=U(i);let{fs:n,path:s}=de(e&&un(i)?gn(i):i);try{return n[t](s,...r)}catch(a){throw Ze(a,{[s]:i})}}o(ae,"doOp");function zu(t,e){t=U(t),e=U(e);let i=de(t),r=de(e),n={[i.path]:t,[r.path]:e};try{if(i===r)return i.fs.renameSync(i.path,r.path,x);let s=ws(t);hn(e,s),gs(t)}catch(s){throw Ze(s,n)}}o(zu,"renameSync");function un(t){t=U(t);try{let{fs:e,path:i}=de(t);return e.existsSync(i,x)}catch(e){if(e.errno==2)return!1;throw e}}o(un,"existsSync");function fn(t,e){let i=ae("statSync",!0,t,x);return e?.bigint?G.clone(i):i}o(fn,"statSync");function Vu(t,e){let i=ae("statSync",!1,t,x);return e?.bigint?G.clone(i):i}o(Vu,"lstatSync");function Hu(t,e=0){let i=wi(t,"r+");try{Ss(i,e)}finally{et(i)}}o(Hu,"truncateSync");function gs(t){return ae("unlinkSync",!1,t,x)}o(gs,"unlinkSync");function Dt(t,e,i,r){let n=U(t),s=we(i,420),a=I.FromString(e),l;try{l=ae("statSync",r,n,x)}catch{switch(a.pathNotExistsAction()){case 3:if(!ae("statSync",r,v(n),x).isDirectory())throw f.ENOTDIR(v(n));return ae("createFileSync",r,n,a,s,x);case 1:throw f.ENOENT(n);default:throw new f(22,"Invalid FileFlag object.")}}if(!l.hasAccess(s,x))throw f.EACCES(n);switch(a.pathExistsAction()){case 1:throw f.EEXIST(n);case 2:return ae("unlinkSync",r,n,x),ae("createFileSync",r,n,a,l.mode,x);case 0:return ae("openFileSync",r,n,a,x);default:throw new f(22,"Invalid FileFlag object.")}}o(Dt,"_openSync");function wi(t,e,i){return Bt(Dt(t,e,i,!0))}o(wi,"openSync");function er(t,e,i){return Bt(Dt(t,e,i,!1))}o(er,"lopenSync");function dn(t,e,i){let r=Dt(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(dn,"_readFileSync");function ws(t,e={}){let i=Qe(e,null,"r",420);if(!I.FromString(i.flag).isReadable())throw new f(22,"Flag passed to readFile must allow for reading.");let n=dn(t,i.flag,!0);return i.encoding?ee(n,i.encoding):n}o(ws,"readFileSync");function Ku(t,e,i,r,n){let s=Dt(t,i,r,n);try{s.writeSync(e,0,e.length,0)}finally{s.closeSync()}}o(Ku,"_writeFileSync");function hn(t,e,i){let r=Qe(i,"utf8","w",420);if(!I.FromString(r.flag).isWriteable())throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let s=typeof e=="string"?M(e,r.encoding):e;if(s===void 0)throw new f(22,"Data not specified");Ku(t,s,r.flag,r.mode,!0)}o(hn,"writeFileSync");function Yu(t,e,i,r,n){let s=Dt(t,i,r,n);try{s.writeSync(e,0,e.length,null)}finally{s.closeSync()}}o(Yu,"_appendFileSync");function Gu(t,e,i){let r=Qe(i,"utf8","a",420);if(!I.FromString(r.flag).isAppendable())throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let s=typeof e=="string"?M(e):e;Yu(t,s,r.flag,r.mode,!0)}o(Gu,"appendFileSync");function Xu(t,e){let i=T(t).statSync();return e?.bigint?G.clone(i):i}o(Xu,"fstatSync");function et(t){T(t).closeSync(),lt.delete(t)}o(et,"closeSync");function Ss(t,e=0){if(e<0)throw new f(22);T(t).truncateSync(e)}o(Ss,"ftruncateSync");function Ju(t){T(t).syncSync()}o(Ju,"fsyncSync");function Qu(t){T(t).datasyncSync()}o(Qu,"fdatasyncSync");function Zu(t,e,i,r,n){let s,a=0,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof r=="string"?r:"utf8";a=0,s=M(e,d),l=s.length}else s=e,a=i,l=r,c=typeof n=="number"?n:null;let u=T(t);return c==null&&(c=u.position),u.writeSync(s,a,l,c)}o(Zu,"writeSync");function ef(t,e,i,r,n){let s=T(t),a=i;return typeof i=="object"&&({offset:a,length:r,position:n}=i),isNaN(+n)&&(n=s.position),s.readSync(e,a,r,n)}o(ef,"readSync");function pn(t,e,i){T(t).chownSync(e,i)}o(pn,"fchownSync");function yn(t,e){let i=we(e,-1);if(i<0)throw new f(22,"Invalid mode.");T(t).chmodSync(i)}o(yn,"fchmodSync");function mn(t,e,i){T(t).utimesSync(Ot(e),Ot(i))}o(mn,"futimesSync");function tf(t){return ae("rmdirSync",!0,t,x)}o(tf,"rmdirSync");function rf(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,r=typeof e=="object"&&e?.recursive;ae("mkdirSync",!0,t,we(i,511),x)}o(rf,"mkdirSync");function bn(t,e){t=U(t);let i=ae("readdirSync",!0,t,x);for(let r of ge.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 tt(r,fn(Ae(t,r))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?M(r):r)}o(bn,"readdirSync");function nf(t,e){return e=U(e),ae("linkSync",!1,t,e,x)}o(nf,"linkSync");function of(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(un(e))throw f.EEXIST(e);hn(e,t),Dt(e,"r+",420,!1)._setTypeSync(L.SYMLINK)}o(of,"symlinkSync");function sf(t,e){let i=dn(t,"r",!1),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:ee(i,r)}o(sf,"readlinkSync");function af(t,e,i){let r=wi(t,"r+");pn(r,e,i),et(r)}o(af,"chownSync");function lf(t,e,i){let r=er(t,"r+");pn(r,e,i),et(r)}o(lf,"lchownSync");function cf(t,e){let i=wi(t,"r+");yn(i,e),et(i)}o(cf,"chmodSync");function uf(t,e){let i=er(t,"r+");yn(i,e),et(i)}o(uf,"lchmodSync");function ff(t,e,i){let r=wi(t,"r+");mn(r,e,i),et(r)}o(ff,"utimesSync");function df(t,e,i){let r=er(t,"r+");mn(r,e,i),et(r)}o(df,"lutimesSync");function gn(t,e){t=U(t);let{fs:i,path:r,mountPoint:n}=de(t);try{if(!i.statSync(r,x).isSymbolicLink())return t;let a=U(n+ee(dn(r,"r+",!1)));return gn(a)}catch(s){throw Ze(s,{[r]:t})}}o(gn,"realpathSync");function hf(t,e=384){if(!fn(t).hasAccess(e,x))throw new f(13)}o(hf,"accessSync");function pf(t){throw new f(95)}o(pf,"rmSync");function yf(t,e){throw new f(95)}o(yf,"mkdtempSync");function mf(t,e,i){throw new f(95)}o(mf,"copyFileSync");function bf(t,e,i){throw new f(95)}o(bf,"readvSync");function gf(t,e,i){throw new f(95)}o(gf,"writevSync");function wf(t,e){throw new f(95)}o(wf,"opendirSync");var tt=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()}};o(tt,"Dirent");var tr=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new f(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 Si(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=bn(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(tr,"Dir");var le=class{constructor(e){this.fd=e}chown(e,i){return T(this.fd).chown(e,i)}chmod(e){let i=we(e,-1);if(i<0)throw new f(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 f(22);return T(this.fd).truncate(e)}utimes(e,i){return T(this.fd).utimes(Ot(e),Ot(i))}appendFile(e,i){return nr(T(this.fd).path,e,i)}read(e,i,r,n){return isNaN(+n)&&(n=T(this.fd).position),T(this.fd).read(e,i,r,n)}readFile(e){return Ei(T(this.fd).path,e)}stat(e){return Mt(T(this.fd).path,e)}async write(e,i,r,n){let s,a=0,l;if(typeof e=="string"){n=typeof i=="number"?i:null;let u=typeof r=="string"?r:"utf8";a=0,s=M(e,u),l=s.length}else s=e,a=i,l=r,n=typeof n=="number"?n:null;n??=T(this.fd).position;let c=await T(this.fd).write(s,a,l,n);return{buffer:s,bytesWritten:c}}writeFile(e,i){return Wt(T(this.fd).path,e,i)}writev(e,i){throw new f(95)}readv(e,i){throw new f(95)}async close(){await T(this.fd).close(),lt.delete(this.fd)}};o(le,"FileHandle");async function Se(...[t,e,i,...r]){i=U(i);let{fs:n,path:s}=de(e&&await _i(i)?await xi(i):i);try{return n[t](s,...r)}catch(a){throw Ze(a,{[s]:i})}}o(Se,"doOp");async function wn(t,e){t=U(t),e=U(e);let{path:i}=de(t),{fs:r,path:n}=de(e);try{let s=await Ei(t);await Wt(e,s),await ir(t)}catch(s){throw Ze(s,{[i]:t,[n]:e})}}o(wn,"rename");async function _i(t){try{let{fs:e,path:i}=de(t);return e.exists(i,x)}catch(e){if(e.errno==2)return!1;throw e}}o(_i,"exists");async function Mt(t,e){let i=await Se("stat",!0,t,x);return e?.bigint?G.clone(i):i}o(Mt,"stat");async function Sn(t,e){let i=await Se("stat",!1,t,x);return e?.bigint?G.clone(i):i}o(Sn,"lstat");async function _n(t,e=0){let i=await ct(t,"r+");try{await i.truncate(e)}finally{await i.close()}}o(_n,"truncate");async function ir(t){return Se("unlink",!1,t,x)}o(ir,"unlink");async function Ut(t,e,i=420,r){let n=U(t),s=we(i,420),a=I.FromString(e);try{switch(a.pathExistsAction()){case 1:throw f.EEXIST(n);case 2:let l=await Se("openFile",r,n,a,x);if(!l)throw new f(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await Se("openFile",r,n,a,x);default:throw new f(22,"Invalid file flag")}}catch{switch(a.pathNotExistsAction()){case 3:let c=await Se("stat",r,v(n),x);if(c&&!c.isDirectory())throw f.ENOTDIR(v(n));return await Se("createFile",r,n,a,s,x);case 1:throw f.ENOENT(n);default:throw new f(22,"Invalid file flag")}}}o(Ut,"_open");async function ct(t,e,i=420){let r=await Ut(t,e,i,!0);return new le(Bt(r))}o(ct,"open");async function rr(t,e,i=420){let r=await Ut(t,e,i,!1);return new le(Bt(r))}o(rr,"lopen");async function En(t,e,i){let r=await Ut(U(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}finally{await r.close()}}o(En,"_readFile");async function Ei(t,e){let i=Qe(e,null,"r",null);if(!I.FromString(i.flag).isReadable())throw new f(22,"Flag passed must allow for reading.");let n=await En(t,i.flag,!0);return i.encoding?ee(n,i.encoding):n}o(Ei,"readFile");async function Sf(t,e,i,r,n){let s=await Ut(t,i,r,n);try{await s.write(e,0,e.length,0)}finally{await s.close()}}o(Sf,"_writeFile");async function Wt(t,e,i){let r=Qe(i,"utf8","w",420);if(!I.FromString(r.flag).isWriteable())throw new f(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let s=typeof e=="string"?M(e,r.encoding):e;await Sf(t,s,r.flag,r.mode,!0)}o(Wt,"writeFile");async function _f(t,e,i,r,n){let s=await Ut(t,i,r,n);try{await s.write(e,0,e.length,null)}finally{await s.close()}}o(_f,"_appendFile");async function nr(t,e,i){let r=Qe(i,"utf8","a",420);if(!I.FromString(r.flag).isAppendable())throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!r.encoding)throw new f(22,"Encoding not specified");let s=typeof e=="string"?M(e):e;await _f(t,s,r.flag,r.mode,!0)}o(nr,"appendFile");function Ef(t,e,i,r,n){return t.write(e,i,r,n)}o(Ef,"write");function xf(t,e,i,r,n){return t.read(e,i,r,n)}o(xf,"read");function vf(t,e,i){return t.chown(e,i)}o(vf,"fchown");function Af(t,e){return t.chmod(e)}o(Af,"fchmod");function kf(t,e,i){return t.utimes(e,i)}o(kf,"futimes");async function xn(t){return Se("rmdir",!0,t,x)}o(xn,"rmdir");async function vn(t,e){await Se("mkdir",!0,t,we(typeof e=="object"?e?.mode:e,511),x)}o(vn,"mkdir");async function Si(t,e){t=U(t);let i=await Se("readdir",!0,t,x),r=[...ge.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 tt(s,await Mt(Ae(t,s))):s);return n}o(Si,"readdir");async function An(t,e){return e=U(e),Se("link",!1,t,e,x)}o(An,"link");async function kn(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await _i(e))throw f.EEXIST(e);await Wt(e,t),await(await Ut(e,"r+",420,!1))._setType(L.SYMLINK)}o(kn,"symlink");async function Nn(t,e){let i=await En(t,"r",!1),r=typeof e=="object"?e.encoding:e;return r=="buffer"?i:ee(i,r)}o(Nn,"readlink");async function Tn(t,e,i){let r=await ct(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}o(Tn,"chown");async function Fn(t,e,i){let r=await rr(t,"r+");try{await r.chown(e,i)}finally{await r.close()}}o(Fn,"lchown");async function In(t,e){let i=await ct(t,"r+");try{await i.chmod(e)}finally{await i.close()}}o(In,"chmod");async function Pn(t,e){let i=await rr(t,"r+");try{await i.chmod(e)}finally{await i.close()}}o(Pn,"lchmod");async function Ln(t,e,i){let r=await ct(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}o(Ln,"utimes");async function Cn(t,e,i){let r=await rr(t,"r+");try{await r.utimes(e,i)}finally{await r.close()}}o(Cn,"lutimes");async function xi(t,e){t=U(t);let{fs:i,path:r,mountPoint:n}=de(t);try{if(!(await i.stat(r,x)).isSymbolicLink())return t;let a=n+U(ee(await En(r,"r+",!1)));return xi(a)}catch(s){throw Ze(s,{[r]:t})}}o(xi,"realpath");async function Nf(t,e,i=S){throw new f(95)}o(Nf,"watchFile");async function Tf(t,e=S){throw new f(95)}o(Tf,"unwatchFile");async function Ff(t,e,i=S){throw new f(95)}o(Ff,"watch");async function Rn(t,e=384){if(!(await Mt(t)).hasAccess(e,x))throw new f(13)}o(Rn,"access");async function If(t,e){throw new f(95)}o(If,"createReadStream");async function Pf(t,e){throw new f(95)}o(Pf,"createWriteStream");async function Lf(t){throw new f(95)}o(Lf,"rm");async function Cf(t){throw new f(95)}o(Cf,"mkdtemp");async function Rf(t){throw new f(95)}o(Rf,"copyFile");function Of(t,e,i=S){wn(t,e).then(()=>i()).catch(i)}o(Of,"rename");function Bf(t,e=S){_i(t).then(e).catch(()=>e(!1))}o(Bf,"exists");function Df(t,e,i=S){i=typeof e=="function"?e:i,Mt(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}o(Df,"stat");function Mf(t,e,i=S){i=typeof e=="function"?e:i,Sn(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}o(Mf,"lstat");function Uf(t,e=0,i=S){i=typeof e=="function"?e:i,_n(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}o(Uf,"truncate");function Wf(t,e=S){ir(t).then(()=>e()).catch(e)}o(Wf,"unlink");function qf(t,e,i,r=S){let n=we(i,420);r=typeof i=="function"?i:r,ct(t,e,n).then(s=>r(null,s.fd)).catch(r)}o(qf,"open");function $f(t,e,i=S){i=typeof e=="function"?e:i,Ei(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o($f,"readFile");function jf(t,e,i,r=S){r=typeof i=="function"?i:r,Wt(t,e,typeof i!="function"?i:null).then(()=>r(null)).catch(r)}o(jf,"writeFile");function zf(t,e,i,r=S){r=typeof i=="function"?i:r,nr(t,e,typeof i=="function"?null:i)}o(zf,"appendFile");function Vf(t,e,i=S){i=typeof e=="function"?e:i,T(t).stat().then(r=>i(null,typeof e=="object"&&e?.bigint?G.clone(r):r)).catch(i)}o(Vf,"fstat");function Hf(t,e=S){new le(t).close().then(()=>e()).catch(e)}o(Hf,"close");function Kf(t,e,i=S){let r=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let n=T(t);if(r<0)throw new f(22);n.truncate(r).then(()=>i()).catch(i)}o(Kf,"ftruncate");function Yf(t,e=S){T(t).sync().then(()=>e()).catch(e)}o(Yf,"fsync");function Gf(t,e=S){T(t).datasync().then(()=>e()).catch(e)}o(Gf,"fdatasync");function Xf(t,e,i,r,n,s=S){let a,l,c,u=null,d,h=new le(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":s=i;break;case"number":u=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 f(22,"Invalid arguments."));return}a=M(e),l=0,c=a.length;let b=s;h.write(a,l,c,u).then(({bytesWritten:m})=>b(null,m,ee(a))).catch(b)}else{a=e,l=i,c=r,u=typeof n=="number"?n:null;let b=typeof n=="function"?n:s;h.write(a,l,c,u).then(({bytesWritten:m})=>b(null,m,a)).catch(b)}}o(Xf,"write");function Jf(t,e,i,r,n,s=S){new le(t).read(e,i,r,n).then(({bytesRead:a,buffer:l})=>s(null,a,l)).catch(s)}o(Jf,"read");function Qf(t,e,i,r=S){new le(t).chown(e,i).then(()=>r()).catch(r)}o(Qf,"fchown");function Zf(t,e,i){new le(t).chmod(e).then(()=>i()).catch(i)}o(Zf,"fchmod");function ed(t,e,i,r=S){new le(t).utimes(e,i).then(()=>r()).catch(r)}o(ed,"futimes");function td(t,e=S){xn(t).then(()=>e()).catch(e)}o(td,"rmdir");function id(t,e,i=S){vn(t,e).then(()=>i()).catch(i)}o(id,"mkdir");function rd(t,e,i=S){i=typeof e=="function"?e:i,Si(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}o(rd,"readdir");function nd(t,e,i=S){An(t,e).then(()=>i()).catch(i)}o(nd,"link");function od(t,e,i,r=S){let n=typeof i=="string"?i:"file";r=typeof i=="function"?i:r,kn(t,e,n).then(()=>r()).catch(r)}o(od,"symlink");function sd(t,e,i=S){i=typeof e=="function"?e:i,Nn(t).then(r=>i(null,r)).catch(i)}o(sd,"readlink");function ad(t,e,i,r=S){Tn(t,e,i).then(()=>r()).catch(r)}o(ad,"chown");function ld(t,e,i,r=S){Fn(t,e,i).then(()=>r()).catch(r)}o(ld,"lchown");function cd(t,e,i=S){In(t,e).then(()=>i()).catch(i)}o(cd,"chmod");function ud(t,e,i=S){Pn(t,e).then(()=>i()).catch(i)}o(ud,"lchmod");function fd(t,e,i,r=S){Ln(t,e,i).then(()=>r()).catch(r)}o(fd,"utimes");function dd(t,e,i,r=S){Cn(t,e,i).then(()=>r()).catch(r)}o(dd,"lutimes");function hd(t,e,i=S){i=typeof e=="function"?e:i,xi(t,typeof e=="function"?null:e).then(r=>i(null,r)).catch(i)}o(hd,"realpath");function pd(t,e,i=S){let r=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Rn(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}o(pd,"access");function yd(t,e,i=S){throw new f(95)}o(yd,"watchFile");function md(t,e=S){throw new f(95)}o(md,"unwatchFile");function bd(t,e,i=S){throw new f(95)}o(bd,"watch");function gd(t,e){throw new f(95)}o(gd,"createReadStream");function wd(t,e){throw new f(95)}o(wd,"createWriteStream");function Sd(t){new f(95)}o(Sd,"rm");function _d(t){new f(95)}o(_d,"mkdtemp");function Ed(t,e,i,r){new f(95)}o(Ed,"copyFile");function xd(t){new f(95)}o(xd,"readv");function vd(t,e,i,r){throw new f(95)}o(vd,"writev");function Ad(t){throw new f(95)}o(Ad,"opendir");var Yr=ou(Gc(),1);var Hr=class extends Yr.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(Hr,"ReadStream");var Kr=class extends Yr.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(Kr,"WriteStream");var Xr=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(Xr,"MirrorFile");var si=class extends Je{_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()}get metadata(){return{...super.metadata,name:si.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 Xr(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,j.Root);this._sync.mkdirSync(e,i,n.getCred())}let r=await this._async.readdir(e,j.Root);for(let n of r)await this.crossCopy(Ae(e,n))}async crossCopyFile(e,i){let r=await this._async.openFile(e,I.FromString("r"),j.Root),n=this._sync.createFileSync(e,I.FromString("w"),i,j.Root);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,j.Root);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 f(5,"AsyncMirror desync: "+i)}await this._next()}enqueue(e){this._queue.push(e),!this._queueRunning&&(this._queueRunning=!0,this._next())}};o(si,"AsyncMirrorFS");var is={name:"AsyncMirror",options:{sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:async t=>{if(!t?.metadata.synchronous)throw new f(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 si(t)}};var ai=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(ai,"Mutex");var li=class{constructor(e){this.fs=e}_mu=new ai;async ready(){return await this.fs.ready(),this}get 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(li,"LockedFS");var rs="/.deleted",Mi=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(Mi,"OverlayFile");var Jr=class extends be{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 f(22,"Writable file system must be writable.");this._ready=this._initialize()}get metadata(){return{...super.metadata,name:Ui.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.getCred(0,0);await this.createParentDirectories(e,n),await this._writable.sync(e,i,r)}syncSync(e,i,r){let n=r.getCred(0,0);this.createParentDirectoriesSync(e,n),this._writable.syncSync(e,i,r)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(rs,I.FromString("r"),j.Root),{size:i}=await e.stat(),{buffer:r}=await e.read(new Uint8Array(i));this._deleteLog=ee(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 f.ENOENT(e)}}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 f.ENOENT(e)}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw f.ENOENT(e);let n=D.clone(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 f.ENOENT(e);let n=D.clone(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,I.FromString("r"),r),s=D.clone(await n.stat()),{buffer:a}=await n.read(new Uint8Array(s.size));return new Mi(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,I.FromString("r"),r),s=D.clone(n.statSync()),a=new Uint8Array(s.size);return n.readSync(a),new Mi(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 f.ENOENT(e);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 f.ENOENT(e);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 f.ENOENT(e);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 f.ENOTEMPTY(e);this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw f.ENOENT(e);if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw f.ENOTEMPTY(e);this.deletePath(e,i)}}async mkdir(e,i,r){if(this.checkInitialized(),await this.exists(e,r))throw f.EEXIST(e);await this.createParentDirectories(e,r),await this._writable.mkdir(e,i,r)}mkdirSync(e,i,r){if(this.checkInitialized(),this.existsSync(e,r))throw f.EEXIST(e);this.createParentDirectoriesSync(e,r),this._writable.mkdirSync(e,i,r)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw f.ENOTDIR(e);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 f.ENOTDIR(e);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}
4
+ `,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let r=await this._writable.openFile(rs,I.FromString("w"),i);try{await r.write(M(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(`
5
+ `))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new f(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==rs)throw f.EPERM(e)}createParentDirectoriesSync(e,i){let r=v(e),n=[];for(;!this._writable.existsSync(r,i);)n.push(r),r=v(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=v(e),n=[];for(;!await this._writable.exists(r,i);)n.push(r),r=v(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 f.ENOENT(e);this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw f.ENOENT(e);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,I.FromString("r"),i);s.readSync(n),s.closeSync();let a=this._writable.openFileSync(e,I.FromString("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,I.FromString("r"),i);await s.read(n),await s.close();let a=await this._writable.openFile(e,I.FromString("w"),i);await a.write(n),await a.close()}};o(Jr,"UnlockedOverlayFS");var Ui=class extends li{async ready(){return await super.ready(),this}constructor(e){super(new Jr(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};o(Ui,"OverlayFS");var ns={name:"Overlay",options:{writable:{type:"object",description:"The file system to write modified files to."},readable:{type:"object",description:"The file system that initially populates this file system."}},isAvailable(){return!0},create(t){return new Ui(t)}};var Qr={};function Xc(...t){for(let e of t)Qr[e.name]=e}o(Xc,"registerBackend");Xc(is,gi,ns);var Zr=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(Zr,"LRUCache");var ci=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 f(95)}async close(){this.sync()}closeSync(){throw new f(95)}};o(ci,"AsyncFile");var en=class extends Ct{store;_cache;_ready;ready(){return this._ready}constructor(e){super(),e>0&&(this._cache=new Zr(e))}async init(e){this.store=e,await this.makeRootDirectory()}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("readwrite"),a=v(e),l=z(e),c=v(i),u=z(i),d=await this.findINode(s,a),h=await this.getDirListing(s,d,a);if(!d.toStats().hasAccess(2,r))throw f.EACCES(e);if(!h[l])throw f.ENOENT(e);let b=h[l];if(delete h[l],(c+"/").indexOf(e+"/")===0)throw new f(16,a);let m,g;if(c===a?(m=d,g=h):(m=await this.findINode(s,c),g=await this.getDirListing(s,m,c)),g[u]){let y=await this.getINode(s,g[u],i);if(y.toStats().isFile())try{await s.remove(y.ino),await s.remove(g[u])}catch(k){throw await s.abort(),k}else throw f.EPERM(i)}g[u]=b;try{await s.put(d.ino,se(h),!0),await s.put(m.ino,se(g),!0)}catch(y){throw await s.abort(),y}await s.commit()}finally{n&&(this._cache=n)}}async stat(e,i){let r=this.store.beginTransaction("readonly"),n=await this.findINode(r,e);if(!n)throw f.ENOENT(e);let s=n.toStats();if(!s.hasAccess(4,i))throw f.EACCES(e);return s}async createFile(e,i,r,n){let s=this.store.beginTransaction("readwrite"),a=new Uint8Array(0),l=await this.commitNewFile(s,e,L.FILE,r,n,a);return new ci(this,e,i,l.toStats(),a)}async openFile(e,i,r){let n=this.store.beginTransaction("readonly"),s=await this.findINode(n,e),a=await n.get(s.ino);if(!s.toStats().hasAccess(i.mode,r))throw f.EACCES(e);if(!a)throw f.ENOENT(e);return new ci(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 f.ENOTEMPTY(e);await this.removeEntry(e,!0,i)}async mkdir(e,i,r){let n=this.store.beginTransaction("readwrite"),s=M("{}");await this.commitNewFile(n,e,L.DIRECTORY,i,r,s)}async readdir(e,i){let r=this.store.beginTransaction("readonly"),n=await this.findINode(r,e);if(!n.toStats().hasAccess(4,i))throw f.EACCES(e);return Object.keys(await this.getDirListing(r,n,e))}async sync(e,i,r){let n=this.store.beginTransaction("readwrite"),s=await this._findINode(n,v(e),z(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(c){throw await n.abort(),c}await n.commit()}async link(e,i,r){let n=this.store.beginTransaction("readwrite"),s=v(e);if(!(await this.findINode(n,s)).toStats().hasAccess(4,r))throw f.EACCES(s);let l=v(i),c=await this.findINode(n,l),u=await this.getDirListing(n,c,l);if(!c.toStats().hasAccess(2,r))throw f.EACCES(l);let d=await this._findINode(n,s,z(e)),h=await this.getINode(n,d,e);if(!h.toStats().hasAccess(2,r))throw f.EACCES(i);h.nlink++,u[z(i)]=d;try{n.put(d,h.data,!0),n.put(c.ino,se(u),!0)}catch(b){throw n.abort(),b}n.commit()}async makeRootDirectory(){let e=this.store.beginTransaction("readwrite");if(await e.get(fe)===void 0){let i=new ue;i.mode=511|L.DIRECTORY,await e.put(i.ino,M("{}"),!1),await e.put(fe,i.data,!1),await e.commit()}}async _findINode(e,i,r,n=new Set){let s=Ae(i,r);if(n.has(s))throw new f(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 c=l[r];return this._cache&&this._cache.set(s,c),c}else throw f.ENOENT(ve(i,r))}}else{let a=await this.findINode(e,i,n),l=await this.getDirListing(e,a,i);if(l[r]){let c=l[r];return this._cache&&this._cache.set(s,c),c}else throw f.ENOENT(ve(i,r))}}async findINode(e,i,r=new Set){let n=await this._findINode(e,v(i),z(i),r);return this.getINode(e,n,i)}async getINode(e,i,r){let n=await e.get(i);if(!n)throw f.ENOENT(r);return new ue(n.buffer)}async getDirListing(e,i,r){if(!i.toStats().isDirectory())throw f.ENOTDIR(r);let n=await e.get(i.ino);if(!n)throw f.ENOENT(r);return pi(n)}async addNewNode(e,i){let r=0,n=o(async()=>{if(++r===5)throw new f(5,"Unable to commit data to key-value store.");{let s=Lt();return await e.put(s,i,!1)?s:n()}},"reroll");return n()}async commitNewFile(e,i,r,n,s,a){let l=v(i),c=z(i),u=await this.findINode(e,l),d=await this.getDirListing(e,u,l);if(!u.toStats().hasAccess(2,s))throw f.EACCES(i);if(i==="/")throw f.EEXIST(i);if(d[c])throw await e.abort(),f.EEXIST(i);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[c]=await this.addNewNode(e,h.data),await e.put(u.ino,se(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("readwrite"),s=v(e),a=await this.findINode(n,s),l=await this.getDirListing(n,a,s),c=z(e);if(!l[c])throw f.ENOENT(e);let u=l[c],d=await this.getINode(n,u,e);if(!d.toStats().hasAccess(2,r))throw f.EACCES(e);if(delete l[c],!i&&d.toStats().isDirectory())throw f.EISDIR(e);if(i&&!d.toStats().isDirectory())throw f.ENOTDIR(e);try{await n.put(a.ino,se(l),!0),--d.nlink<1&&(await n.remove(d.ino),await n.remove(u))}catch(h){throw await n.abort(),h}await n.commit()}};o(en,"AsyncStoreFileSystem");var ui=class{static fromListing(e){let i=new ui,r=new He;i._index.set("/",r);let n=[{pwd:"",tree:e,parent:r}];for(;n.length>0;){let s,{tree:a,pwd:l,parent:c}=n.pop();for(let u in a){if(!Object.hasOwn(a,u))continue;let d=a[u];if(d){let h=`${l}/${u}`;s=new He,i._index.set(h,s),n.push({pwd:h,tree:d,parent:s})}else s=new Wi(new D(L.FILE,-1,365));c&&c._listing.set(u,s)}}return i}_index=new Map;constructor(){this.addPath("/",new He)}forEachFile(e){for(let i of this._index.values())for(let r of i.listing){let n=i.get(r);n?.isFile()&&e(n.data)}}addPath(e,i){if(!i)throw new Error("Inode must be specified");if(e[0]!=="/")throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let r=this.splitPath(e),n=r[0],s=r[1],a=this._index.get(n);return!a&&e!=="/"&&(a=new He,!this.addPath(n,a))||e!=="/"&&!a.add(s,i)?!1:(os(i)&&(this._index[e]=i),!0)}addPathFast(e,i){let r=e.lastIndexOf("/"),n=r===0?"/":e.substring(0,r),s=e.substring(r+1),a=this._index.get(n);return a||(a=new He,this.addPathFast(n,a)),a.add(s,i)?(i.isDir()&&(this._index[e]=i),!0):!1}removePath(e){let i=this.splitPath(e),r=i[0],n=i[1],s=this._index[r];if(!s)return;let a=s.remove(n);if(!a)return;if(!os(a))return a;let l=a.listing;for(let c of l)this.removePath(e+"/"+c);e!=="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}getInode(e){let[i,r]=this.splitPath(e),n=this._index.get(i);return i===e?n:n?.get(r)}splitPath(e){let i=v(e),r=e.slice(i.length+(i==="/"?0:1));return[i,r]}};o(ui,"FileIndex");var fi=class{constructor(e){this.data=e}};o(fi,"IndexInode");var Wi=class extends fi{isFile(){return!0}isDir(){return!1}toStats(){return new D(L.FILE,4096,438)}};o(Wi,"IndexFileInode");var He=class extends fi{_listing=new Map;isFile(){return!1}isDir(){return!0}get stats(){return new D(L.DIRECTORY,4096,365)}toStats(){return this.stats}get listing(){return Object.keys(this._listing)}get(e){let i=this._listing[e];return i||null}add(e,i){return e in this._listing?!1:(this._listing[e]=i,!0)}remove(e){let i=this._listing[e];return i===void 0?null:(delete this._listing[e],i)}};o(He,"IndexDirInode");function Fg(t){return t?.isFile()}o(Fg,"isIndexFileInode");function os(t){return t?.isDir()}o(os,"isIndexDirInode");function Jc(t,e=0,i=0){return ys(new j(e,i,e,i,e,i)),Zi(t)}o(Jc,"initialize");async function Ig(t){("backend"in t||t instanceof be)&&(t={"/":t});for(let[e,i]of Object.entries(t))typeof i!="number"&&(i instanceof be||(typeof i=="string"&&(i={backend:Qr[i]}),sn(i)&&(i={backend:i}),t[e]=await an(i)));return Jc(t)}o(Ig,"configure");var Pg=Gr;return su(Lg);})();
8
6
  /*! Bundled license information:
9
7
 
10
8
  ieee754/index.js: