mega-stream-proxy 0.1.9

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 (88) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +518 -0
  3. package/android/build.gradle +31 -0
  4. package/android/src/main/AndroidManifest.xml +3 -0
  5. package/dist/Player/native.d.ts +3 -0
  6. package/dist/Player/native.js +3 -0
  7. package/dist/Player/playerAndroid/MegaVideoPlayerAndroid.d.ts +47 -0
  8. package/dist/Player/playerAndroid/MegaVideoPlayerAndroid.js +624 -0
  9. package/dist/Player/playerAndroid/PlayerControlsAndroid.d.ts +54 -0
  10. package/dist/Player/playerAndroid/PlayerControlsAndroid.js +370 -0
  11. package/dist/Player/playerAndroid/SubtitleDisplayAndroid.d.ts +21 -0
  12. package/dist/Player/playerAndroid/SubtitleDisplayAndroid.js +55 -0
  13. package/dist/Player/playerAndroid/index.d.ts +3 -0
  14. package/dist/Player/playerAndroid/index.js +3 -0
  15. package/dist/Player/playerweb/MegaVideoPlayer.d.ts +92 -0
  16. package/dist/Player/playerweb/MegaVideoPlayer.js +368 -0
  17. package/dist/Player/playerweb/PlayerControls.d.ts +52 -0
  18. package/dist/Player/playerweb/PlayerControls.js +346 -0
  19. package/dist/Player/playerweb/SubtitleDisplay.d.ts +15 -0
  20. package/dist/Player/playerweb/SubtitleDisplay.js +32 -0
  21. package/dist/Player/playerweb/index.d.ts +3 -0
  22. package/dist/Player/playerweb/index.js +3 -0
  23. package/dist/Player/web.d.ts +3 -0
  24. package/dist/Player/web.js +3 -0
  25. package/dist/accounts/async-storage.d.ts +10 -0
  26. package/dist/accounts/async-storage.js +46 -0
  27. package/dist/accounts/index.d.ts +4 -0
  28. package/dist/accounts/index.js +3 -0
  29. package/dist/accounts/local-storage.d.ts +3 -0
  30. package/dist/accounts/local-storage.js +63 -0
  31. package/dist/accounts/manager.d.ts +39 -0
  32. package/dist/accounts/manager.js +149 -0
  33. package/dist/accounts/types.d.ts +35 -0
  34. package/dist/accounts/types.js +1 -0
  35. package/dist/index.d.ts +5 -0
  36. package/dist/index.js +4 -0
  37. package/dist/megaFile.d.ts +7 -0
  38. package/dist/megaFile.js +31 -0
  39. package/dist/proxy/native.d.ts +25 -0
  40. package/dist/proxy/native.js +336 -0
  41. package/dist/proxy/sw/bundle.d.ts +21 -0
  42. package/dist/proxy/sw/bundle.js +32 -0
  43. package/dist/proxy/sw/megajs.browser.js +27 -0
  44. package/dist/proxy/sw/sw.js +212 -0
  45. package/dist/proxy/types.d.ts +15 -0
  46. package/dist/proxy/types.js +2 -0
  47. package/dist/proxy/web.d.ts +24 -0
  48. package/dist/proxy/web.js +231 -0
  49. package/dist/ranges.d.ts +30 -0
  50. package/dist/ranges.js +63 -0
  51. package/dist/stream.d.ts +9 -0
  52. package/dist/stream.js +100 -0
  53. package/dist/subtitles/index.d.ts +9 -0
  54. package/dist/subtitles/index.js +2 -0
  55. package/dist/subtitles/load.d.ts +18 -0
  56. package/dist/subtitles/load.js +58 -0
  57. package/dist/subtitles/parse.d.ts +19 -0
  58. package/dist/subtitles/parse.js +95 -0
  59. package/dist/swDefine.d.ts +5 -0
  60. package/dist/swDefine.js +5 -0
  61. package/package.json +112 -0
  62. package/src/Player/playerAndroid/MegaVideoPlayerAndroid.tsx +825 -0
  63. package/src/Player/playerAndroid/PlayerControlsAndroid.tsx +824 -0
  64. package/src/Player/playerAndroid/SubtitleDisplayAndroid.tsx +80 -0
  65. package/src/Player/playerAndroid/index.ts +7 -0
  66. package/src/Player/playerweb/MegaVideoPlayer.tsx +551 -0
  67. package/src/Player/playerweb/PlayerControls.tsx +798 -0
  68. package/src/Player/playerweb/SubtitleDisplay.tsx +48 -0
  69. package/src/Player/playerweb/index.ts +3 -0
  70. package/src/accounts/async-storage.ts +55 -0
  71. package/src/accounts/index.ts +9 -0
  72. package/src/accounts/local-storage.ts +66 -0
  73. package/src/accounts/manager.ts +174 -0
  74. package/src/accounts/types.ts +38 -0
  75. package/src/index.ts +10 -0
  76. package/src/megaFile.ts +48 -0
  77. package/src/proxy/native.ts +396 -0
  78. package/src/proxy/sw/bundle.ts +37 -0
  79. package/src/proxy/sw/megajs.browser.js +27 -0
  80. package/src/proxy/sw/sw.js +212 -0
  81. package/src/proxy/types.ts +17 -0
  82. package/src/proxy/web.ts +266 -0
  83. package/src/ranges.ts +72 -0
  84. package/src/stream.ts +117 -0
  85. package/src/subtitles/index.ts +15 -0
  86. package/src/subtitles/load.ts +83 -0
  87. package/src/subtitles/parse.ts +105 -0
  88. package/src/swDefine.ts +5 -0
@@ -0,0 +1,27 @@
1
+ var mega=(()=>{var ky=Object.create;var Fs=Object.defineProperty;var Ly=Object.getOwnPropertyDescriptor;var Cy=Object.getOwnPropertyNames;var Ny=Object.getPrototypeOf,qy=Object.prototype.hasOwnProperty;var _e=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Dy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Cy(e))!qy.call(t,i)&&i!==r&&Fs(t,i,{get:()=>e[i],enumerable:!(n=Ly(e,i))||n.enumerable});return t};var Re=(t,e,r)=>(r=t!=null?ky(Ny(t)):{},Dy(e||!t||!t.__esModule?Fs(r,"default",{value:t,enumerable:!0}):r,t));var Ws=_(nn=>{"use strict";u();nn.byteLength=jy;nn.toByteArray=Wy;nn.fromByteArray=Gy;var xe=[],he=[],Fy=typeof Uint8Array<"u"?Uint8Array:Array,ji="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ut=0,js=ji.length;ut<js;++ut)xe[ut]=ji[ut],he[ji.charCodeAt(ut)]=ut;var ut,js;he[45]=62;he[95]=63;function Us(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function jy(t){var e=Us(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Uy(t,e,r){return(e+r)*3/4-r}function Wy(t){var e,r=Us(t),n=r[0],i=r[1],o=new Fy(Uy(t,n,i)),a=0,s=i>0?n-4:n,l;for(l=0;l<s;l+=4)e=he[t.charCodeAt(l)]<<18|he[t.charCodeAt(l+1)]<<12|he[t.charCodeAt(l+2)]<<6|he[t.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=he[t.charCodeAt(l)]<<2|he[t.charCodeAt(l+1)]>>4,o[a++]=e&255),i===1&&(e=he[t.charCodeAt(l)]<<10|he[t.charCodeAt(l+1)]<<4|he[t.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function $y(t){return xe[t>>18&63]+xe[t>>12&63]+xe[t>>6&63]+xe[t&63]}function Hy(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push($y(n));return i.join("")}function Gy(t){for(var e,r=t.length,n=r%3,i=[],o=16383,a=0,s=r-n;a<s;a+=o)i.push(Hy(t,a,a+o>s?s:a+o));return n===1?(e=t[r-1],i.push(xe[e>>2]+xe[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}});var $s=_(Ui=>{u();Ui.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,d=r?i-1:0,g=r?-1:1,p=t[e+d];for(d+=g,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=o*256+t[e+d],d+=g,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+t[e+d],d+=g,c-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(p?-1:1)*a*Math.pow(2,o-n)};Ui.write=function(t,e,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,d=c>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,E=n?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?e+=g/l:e+=g*Math.pow(2,1-d),e*l>=2&&(a++,l/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(e*l-1)*Math.pow(2,i),a=a+d):(s=e*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=s&255,p+=E,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[r+p]=a&255,p+=E,a/=256,f-=8);t[r+p-E]|=m*128}});var de=_(qt=>{"use strict";u();var Wi=Ws(),Ct=$s(),Hs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;qt.Buffer=w;qt.SlowBuffer=Xy;qt.INSPECT_MAX_BYTES=50;var on=2147483647;qt.kMaxLength=on;w.TYPED_ARRAY_SUPPORT=Vy();!w.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 Vy(){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}}Object.defineProperty(w.prototype,"parent",{enumerable:!0,get:function(){if(w.isBuffer(this))return this.buffer}});Object.defineProperty(w.prototype,"offset",{enumerable:!0,get:function(){if(w.isBuffer(this))return this.byteOffset}});function Ue(t){if(t>on)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,w.prototype),e}function w(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Vi(t)}return zs(t,e,r)}w.poolSize=8192;function zs(t,e,r){if(typeof t=="string")return zy(t,e);if(ArrayBuffer.isView(t))return Yy(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(Te(t,ArrayBuffer)||t&&Te(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Te(t,SharedArrayBuffer)||t&&Te(t.buffer,SharedArrayBuffer)))return Hi(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return w.from(n,e,r);let i=Jy(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return w.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}w.from=function(t,e,r){return zs(t,e,r)};Object.setPrototypeOf(w.prototype,Uint8Array.prototype);Object.setPrototypeOf(w,Uint8Array);function Ys(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"')}function Ky(t,e,r){return Ys(t),t<=0?Ue(t):e!==void 0?typeof r=="string"?Ue(t).fill(e,r):Ue(t).fill(e):Ue(t)}w.alloc=function(t,e,r){return Ky(t,e,r)};function Vi(t){return Ys(t),Ue(t<0?0:Ki(t)|0)}w.allocUnsafe=function(t){return Vi(t)};w.allocUnsafeSlow=function(t){return Vi(t)};function zy(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!w.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Js(t,e)|0,n=Ue(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function $i(t){let e=t.length<0?0:Ki(t.length)|0,r=Ue(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Yy(t){if(Te(t,Uint8Array)){let e=new Uint8Array(t);return Hi(e.buffer,e.byteOffset,e.byteLength)}return $i(t)}function Hi(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,w.prototype),n}function Jy(t){if(w.isBuffer(t)){let e=Ki(t.length)|0,r=Ue(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Yi(t.length)?Ue(0):$i(t);if(t.type==="Buffer"&&Array.isArray(t.data))return $i(t.data)}function Ki(t){if(t>=on)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+on.toString(16)+" bytes");return t|0}function Xy(t){return+t!=t&&(t=0),w.alloc(+t)}w.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==w.prototype};w.compare=function(e,r){if(Te(e,Uint8Array)&&(e=w.from(e,e.offset,e.byteLength)),Te(r,Uint8Array)&&(r=w.from(r,r.offset,r.byteLength)),!w.isBuffer(e)||!w.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};w.isEncoding=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}};w.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return w.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=w.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let a=e[n];if(Te(a,Uint8Array))o+a.length>i.length?(w.isBuffer(a)||(a=w.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(w.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Js(t,e){if(w.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Te(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 r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Gi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ol(t).length;default:if(i)return n?-1:Gi(t).length;e=(""+e).toLowerCase(),i=!0}}w.byteLength=Js;function Qy(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return lg(this,e,r);case"utf8":case"utf-8":return Qs(this,e,r);case"ascii":return ag(this,e,r);case"latin1":case"binary":return sg(this,e,r);case"base64":return ig(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fg(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}w.prototype._isBuffer=!0;function ct(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}w.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)ct(this,r,r+1);return this};w.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)ct(this,r,r+3),ct(this,r+1,r+2);return this};w.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)ct(this,r,r+7),ct(this,r+1,r+6),ct(this,r+2,r+5),ct(this,r+3,r+4);return this};w.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Qs(this,0,e):Qy.apply(this,arguments)};w.prototype.toLocaleString=w.prototype.toString;w.prototype.equals=function(e){if(!w.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:w.compare(this,e)===0};w.prototype.inspect=function(){let e="",r=qt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Hs&&(w.prototype[Hs]=w.prototype.inspect);w.prototype.compare=function(e,r,n,i,o){if(Te(e,Uint8Array)&&(e=w.from(e,e.offset,e.byteLength)),!w.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let a=o-i,s=n-r,l=Math.min(a,s),f=this.slice(i,o),c=e.slice(r,n);for(let d=0;d<l;++d)if(f[d]!==c[d]){a=f[d],s=c[d];break}return a<s?-1:s<a?1:0};function Xs(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Yi(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=w.from(e,n)),w.isBuffer(e))return e.length===0?-1:Gs(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Gs(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Gs(t,e,r,n,i){let o=1,a=t.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,s/=2,r/=2}function l(c,d){return o===1?c[d]:c.readUInt16BE(d*o)}let f;if(i){let c=-1;for(f=r;f<a;f++)if(l(t,f)===l(e,c===-1?0:f-c)){if(c===-1&&(c=f),f-c+1===s)return c*o}else c!==-1&&(f-=f-c),c=-1}else for(r+s>a&&(r=a-s),f=r;f>=0;f--){let c=!0;for(let d=0;d<s;d++)if(l(t,f+d)!==l(e,d)){c=!1;break}if(c)return f}return-1}w.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};w.prototype.indexOf=function(e,r,n){return Xs(this,e,r,n,!0)};w.prototype.lastIndexOf=function(e,r,n){return Xs(this,e,r,n,!1)};function Zy(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let s=parseInt(e.substr(a*2,2),16);if(Yi(s))return a;t[r+a]=s}return a}function eg(t,e,r,n){return an(Gi(e,t.length-r),t,r,n)}function tg(t,e,r,n){return an(hg(e),t,r,n)}function rg(t,e,r,n){return an(ol(e),t,r,n)}function ng(t,e,r,n){return an(pg(e,t.length-r),t,r,n)}w.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return Zy(this,e,r,n);case"utf8":case"utf-8":return eg(this,e,r,n);case"ascii":case"latin1":case"binary":return tg(this,e,r,n);case"base64":return rg(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ng(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ig(t,e,r){return e===0&&r===t.length?Wi.fromByteArray(t):Wi.fromByteArray(t.slice(e,r))}function Qs(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=r){let l,f,c,d;switch(s){case 1:o<128&&(a=o);break;case 2:l=t[i+1],(l&192)===128&&(d=(o&31)<<6|l&63,d>127&&(a=d));break;case 3:l=t[i+1],f=t[i+2],(l&192)===128&&(f&192)===128&&(d=(o&15)<<12|(l&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:l=t[i+1],f=t[i+2],c=t[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(d=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return og(n)}var Vs=4096;function og(t){let e=t.length;if(e<=Vs)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Vs));return r}function ag(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function sg(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function lg(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=yg[t[o]];return i}function fg(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}w.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,w.prototype),i};function Q(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}w.prototype.readUintLE=w.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return i};w.prototype.readUintBE=w.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};w.prototype.readUint8=w.prototype.readUInt8=function(e,r){return e=e>>>0,r||Q(e,1,this.length),this[e]};w.prototype.readUint16LE=w.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Q(e,2,this.length),this[e]|this[e+1]<<8};w.prototype.readUint16BE=w.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Q(e,2,this.length),this[e]<<8|this[e+1]};w.prototype.readUint32LE=w.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};w.prototype.readUint32BE=w.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};w.prototype.readBigUInt64LE=Ze(function(e){e=e>>>0,Nt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Er(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});w.prototype.readBigUInt64BE=Ze(function(e){e=e>>>0,Nt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Er(e,this.length-8);let i=r*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+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});w.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};w.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=r,o=1,a=this[e+--i];for(;i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};w.prototype.readInt8=function(e,r){return e=e>>>0,r||Q(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};w.prototype.readInt16LE=function(e,r){e=e>>>0,r||Q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};w.prototype.readInt16BE=function(e,r){e=e>>>0,r||Q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};w.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};w.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};w.prototype.readBigInt64LE=Ze(function(e){e=e>>>0,Nt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Er(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});w.prototype.readBigInt64BE=Ze(function(e){e=e>>>0,Nt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Er(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});w.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),Ct.read(this,e,!0,23,4)};w.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),Ct.read(this,e,!1,23,4)};w.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Q(e,8,this.length),Ct.read(this,e,!0,52,8)};w.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Q(e,8,this.length),Ct.read(this,e,!1,52,8)};function fe(t,e,r,n,i,o){if(!w.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}w.prototype.writeUintLE=w.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;fe(this,e,r,n,s,0)}let o=1,a=0;for(this[r]=e&255;++a<n&&(o*=256);)this[r+a]=e/o&255;return r+n};w.prototype.writeUintBE=w.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;fe(this,e,r,n,s,0)}let o=n-1,a=1;for(this[r+o]=e&255;--o>=0&&(a*=256);)this[r+o]=e/a&255;return r+n};w.prototype.writeUint8=w.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,1,255,0),this[r]=e&255,r+1};w.prototype.writeUint16LE=w.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};w.prototype.writeUint16BE=w.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};w.prototype.writeUint32LE=w.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};w.prototype.writeUint32BE=w.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Zs(t,e,r,n,i){il(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function el(t,e,r,n,i){il(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}w.prototype.writeBigUInt64LE=Ze(function(e,r=0){return Zs(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});w.prototype.writeBigUInt64BE=Ze(function(e,r=0){return el(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});w.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);fe(this,e,r,n,l-1,-l)}let o=0,a=1,s=0;for(this[r]=e&255;++o<n&&(a*=256);)e<0&&s===0&&this[r+o-1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+n};w.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);fe(this,e,r,n,l-1,-l)}let o=n-1,a=1,s=0;for(this[r+o]=e&255;--o>=0&&(a*=256);)e<0&&s===0&&this[r+o+1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+n};w.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};w.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};w.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};w.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};w.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};w.prototype.writeBigInt64LE=Ze(function(e,r=0){return Zs(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});w.prototype.writeBigInt64BE=Ze(function(e,r=0){return el(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function tl(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function rl(t,e,r,n,i){return e=+e,r=r>>>0,i||tl(t,e,r,4,34028234663852886e22,-34028234663852886e22),Ct.write(t,e,r,n,23,4),r+4}w.prototype.writeFloatLE=function(e,r,n){return rl(this,e,r,!0,n)};w.prototype.writeFloatBE=function(e,r,n){return rl(this,e,r,!1,n)};function nl(t,e,r,n,i){return e=+e,r=r>>>0,i||tl(t,e,r,8,17976931348623157e292,-17976931348623157e292),Ct.write(t,e,r,n,52,8),r+8}w.prototype.writeDoubleLE=function(e,r,n){return nl(this,e,r,!0,n)};w.prototype.writeDoubleBE=function(e,r,n){return nl(this,e,r,!1,n)};w.prototype.copy=function(e,r,n,i){if(!w.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};w.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!w.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let a=e.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{let a=w.isBuffer(e)?e:w.from(e,i),s=a.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=a[o%s]}return this};var Lt={};function zi(t,e,r){Lt[t]=class extends r{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(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}zi("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);zi("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);zi("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Ks(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Ks(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Ks(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function ug(t,e,r){Nt(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Er(e,t.length-(r+1))}function il(t,e,r,n,i,o){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",s;throw o>3?e===0||e===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${e}${a} and <= ${r}${a}`,new Lt.ERR_OUT_OF_RANGE("value",s,t)}ug(n,i,o)}function Nt(t,e){if(typeof t!="number")throw new Lt.ERR_INVALID_ARG_TYPE(e,"number",t)}function Er(t,e,r){throw Math.floor(t)!==t?(Nt(t,r),new Lt.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Lt.ERR_BUFFER_OUT_OF_BOUNDS:new Lt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var cg=/[^+/0-9A-Za-z-_]/g;function dg(t){if(t=t.split("=")[0],t=t.trim().replace(cg,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Gi(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function hg(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function pg(t,e){let r,n,i,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function ol(t){return Wi.toByteArray(dg(t))}function an(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Te(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Yi(t){return t!==t}var yg=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Ze(t){return typeof BigInt>"u"?gg:t}function gg(){throw new Error("BigInt not supported")}});var h,y,b,u=_e(()=>{h=Re(de(),1),y={env:{},nextTick:(t,...e)=>{globalThis.setTimeout(t,0,...e)}},b=globalThis});var H=_((UR,al)=>{"use strict";u();al.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,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},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,r){return Object.defineProperty(t,e,r)},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,r){return t.then(e,r)},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,r){return t.slice(e,r)},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,r){return t.set(e,r)},Boolean,Uint8Array}});var Dt=_(($R,sn)=>{"use strict";u();var{AbortController:sl,AbortSignal:bg}=typeof self<"u"?self:typeof window<"u"?window:void 0;sn.exports=sl;sn.exports.AbortSignal=bg;sn.exports.default=sl});var Ie=_((GR,Ji)=>{"use strict";u();var Ft=typeof Reflect=="object"?Reflect:null,ll=Ft&&typeof Ft.apply=="function"?Ft.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},ln;Ft&&typeof Ft.ownKeys=="function"?ln=Ft.ownKeys:Object.getOwnPropertySymbols?ln=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ln=function(e){return Object.getOwnPropertyNames(e)};function wg(t){console&&console.warn&&console.warn(t)}var ul=Number.isNaN||function(e){return e!==e};function q(){q.init.call(this)}Ji.exports=q;Ji.exports.once=Sg;q.EventEmitter=q;q.prototype._events=void 0;q.prototype._eventsCount=0;q.prototype._maxListeners=void 0;var fl=10;function fn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(q,"defaultMaxListeners",{enumerable:!0,get:function(){return fl},set:function(t){if(typeof t!="number"||t<0||ul(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");fl=t}});q.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};q.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ul(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};function cl(t){return t._maxListeners===void 0?q.defaultMaxListeners:t._maxListeners}q.prototype.getMaxListeners=function(){return cl(this)};q.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")ll(l,this,r);else for(var f=l.length,c=gl(l,f),n=0;n<f;++n)ll(c[n],this,r);return!0};function dl(t,e,r,n){var i,o,a;if(fn(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),a===void 0)a=o[e]=r,++t._eventsCount;else if(typeof a=="function"?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),i=cl(t),i>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,wg(s)}return t}q.prototype.addListener=function(e,r){return dl(this,e,r,!1)};q.prototype.on=q.prototype.addListener;q.prototype.prependListener=function(e,r){return dl(this,e,r,!0)};function mg(){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)}function hl(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=mg.bind(n);return i.listener=r,n.wrapFn=i,i}q.prototype.once=function(e,r){return fn(r),this.on(e,hl(this,e,r)),this};q.prototype.prependOnceListener=function(e,r){return fn(r),this.prependListener(e,hl(this,e,r)),this};q.prototype.removeListener=function(e,r){var n,i,o,a,s;if(fn(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){s=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():_g(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,s||r)}return this};q.prototype.off=q.prototype.removeListener;q.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(i=0;i<o.length;++i)a=o[i],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function pl(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Eg(i):gl(i,i.length)}q.prototype.listeners=function(e){return pl(this,e,!0)};q.prototype.rawListeners=function(e){return pl(this,e,!1)};q.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):yl.call(t,e)};q.prototype.listenerCount=yl;function yl(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}q.prototype.eventNames=function(){return this._eventsCount>0?ln(this._events):[]};function gl(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function _g(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Eg(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Sg(t,e){return new Promise(function(r,n){function i(a){t.removeListener(e,o),n(a)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}bl(t,e,o,{once:!0}),e!=="error"&&Ag(t,i,{once:!0})})}function Ag(t,e,r){typeof t.on=="function"&&bl(t,"error",e,r)}function bl(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var ne=_((KR,Qi)=>{"use strict";u();var vg=de(),{kResistStopPropagation:Rg,SymbolDispose:xg}=H(),Tg=globalThis.AbortSignal||Dt().AbortSignal,Ig=globalThis.AbortController||Dt().AbortController,Og=Object.getPrototypeOf(async function(){}).constructor,wl=globalThis.Blob||vg.Blob,Pg=typeof wl<"u"?function(e){return e instanceof wl}:function(e){return!1},ml=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},Bg=(t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},Xi=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n<e.length;n++)r+=` ${e[n].stack}
2
+ `;super(r),this.name="AggregateError",this.errors=e}};Qi.exports={AggregateError:Xi,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.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 Og},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Pg,deprecate(t,e){return t},addAbortListener:Ie().addAbortListener||function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);ml(e,"signal"),Bg(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[Rg]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[xg](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Tg.any||function(e){if(e.length===1)return e[0];let r=new Ig,n=()=>r.abort();return e.forEach(i=>{ml(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};Qi.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=_((YR,Sl)=>{"use strict";u();var{format:Mg,inspect:un,AggregateError:kg}=ne(),Lg=globalThis.AggregateError||kg,Cg=Symbol("kIsNodeError"),Ng=["string","function","number","object","Function","Object","boolean","bigint","symbol"],qg=/^([A-Z][a-z0-9]*)+$/,Dg="__node_internal_",cn={};function dt(t,e){if(!t)throw new cn.ERR_INTERNAL_ASSERTION(e)}function _l(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Fg(t,e,r){if(typeof e=="function")return dt(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return dt(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:Mg(e,...r)}function te(t,e,r){r||(r=Error);class n extends r{constructor(...o){super(Fg(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[Cg]=!0,cn[t]=n}function El(t){let e=Dg+t.name;return Object.defineProperty(t,"name",{value:e}),t}function jg(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new Lg([e,t],e.message);return r.code=e.code,r}return t||e}var Zi=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new cn.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};te("ERR_ASSERTION","%s",Error);te("ERR_INVALID_ARG_TYPE",(t,e,r)=>{dt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],o=[],a=[];for(let l of e)dt(typeof l=="string","All expected entries have to be of type string"),Ng.includes(l)?i.push(l.toLowerCase()):qg.test(l)?o.push(l):(dt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();n+=`one of ${a.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var s;if((s=r.constructor)!==null&&s!==void 0&&s.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=un(r,{depth:-1});n+=`. Received ${l}`}}else{let l=un(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);te("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=un(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);te("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);te("ERR_MISSING_ARGS",(...t)=>{dt(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);te("ERR_OUT_OF_RANGE",(t,e,r)=>{dt(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=_l(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=_l(n)),n+="n"):n=un(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);te("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);te("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);te("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);te("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);te("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);te("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);te("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);te("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);te("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);te("ERR_STREAM_WRITE_AFTER_END","write after end",Error);te("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Sl.exports={AbortError:Zi,aggregateTwoErrors:El(jg),hideStackFrames:El,codes:cn}});var Ut=_((XR,Ml)=>{"use strict";u();var{ArrayIsArray:to,ArrayPrototypeIncludes:xl,ArrayPrototypeJoin:Tl,ArrayPrototypeMap:Ug,NumberIsInteger:ro,NumberIsNaN:Wg,NumberMAX_SAFE_INTEGER:$g,NumberMIN_SAFE_INTEGER:Hg,NumberParseInt:Gg,ObjectPrototypeHasOwnProperty:Vg,RegExpPrototypeExec:Il,String:Kg,StringPrototypeToUpperCase:zg,StringPrototypeTrim:Yg}=H(),{hideStackFrames:pe,codes:{ERR_SOCKET_BAD_PORT:Jg,ERR_INVALID_ARG_TYPE:ie,ERR_INVALID_ARG_VALUE:jt,ERR_OUT_OF_RANGE:ht,ERR_UNKNOWN_SIGNAL:Al}}=ae(),{normalizeEncoding:Xg}=ne(),{isAsyncFunction:Qg,isArrayBufferView:Zg}=ne().types,vl={};function eb(t){return t===(t|0)}function tb(t){return t===t>>>0}var rb=/^[0-7]+$/,nb="must be a 32-bit unsigned integer or an octal string";function ib(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Il(rb,t)===null)throw new jt(e,t,nb);t=Gg(t,8)}return Ol(t,e),t}var ob=pe((t,e,r=Hg,n=$g)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!ro(t))throw new ht(e,"an integer",t);if(t<r||t>n)throw new ht(e,`>= ${r} && <= ${n}`,t)}),ab=pe((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!ro(t))throw new ht(e,"an integer",t);if(t<r||t>n)throw new ht(e,`>= ${r} && <= ${n}`,t)}),Ol=pe((t,e,r=!1)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!ro(t))throw new ht(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new ht(e,`>= ${n} && <= ${i}`,t)});function no(t,e){if(typeof t!="string")throw new ie(e,"string",t)}function sb(t,e,r=void 0,n){if(typeof t!="number")throw new ie(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&Wg(t))throw new ht(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var lb=pe((t,e,r)=>{if(!xl(r,t)){let i="must be one of: "+Tl(Ug(r,o=>typeof o=="string"?`'${o}'`:Kg(o)),", ");throw new jt(e,t,i)}});function Pl(t,e){if(typeof t!="boolean")throw new ie(e,"boolean",t)}function eo(t,e,r){return t==null||!Vg(t,e)?r:t[e]}var fb=pe((t,e,r=null)=>{let n=eo(r,"allowArray",!1),i=eo(r,"allowFunction",!1);if(!eo(r,"nullable",!1)&&t===null||!n&&to(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new ie(e,"Object",t)}),ub=pe((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ie(e,"a dictionary",t)}),dn=pe((t,e,r=0)=>{if(!to(t))throw new ie(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new jt(e,t,n)}});function cb(t,e){dn(t,e);for(let r=0;r<t.length;r++)no(t[r],`${e}[${r}]`)}function db(t,e){dn(t,e);for(let r=0;r<t.length;r++)Pl(t[r],`${e}[${r}]`)}function hb(t,e){dn(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new ie(i,"AbortSignal",n);Bl(n,i)}}function pb(t,e="signal"){if(no(t,e),vl[t]===void 0)throw vl[zg(t)]!==void 0?new Al(t+" (signals must use all capital letters)"):new Al(t)}var yb=pe((t,e="buffer")=>{if(!Zg(t))throw new ie(e,["Buffer","TypedArray","DataView"],t)});function gb(t,e){let r=Xg(e),n=t.length;if(r==="hex"&&n%2!==0)throw new jt("encoding",e,`is invalid for data of length ${n}`)}function bb(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Yg(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Jg(e,t,r);return t|0}var Bl=pe((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ie(e,"AbortSignal",t)}),wb=pe((t,e)=>{if(typeof t!="function")throw new ie(e,"Function",t)}),mb=pe((t,e)=>{if(typeof t!="function"||Qg(t))throw new ie(e,"Function",t)}),_b=pe((t,e)=>{if(t!==void 0)throw new ie(e,"undefined",t)});function Eb(t,e,r){if(!xl(r,t))throw new ie(e,`('${Tl(r,"|")}')`,t)}var Sb=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Rl(t,e){if(typeof t>"u"||!Il(Sb,t))throw new jt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Ab(t){if(typeof t=="string")return Rl(t,"hints"),t;if(to(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];Rl(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new jt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Ml.exports={isInt32:eb,isUint32:tb,parseFileMode:ib,validateArray:dn,validateStringArray:cb,validateBooleanArray:db,validateAbortSignalArray:hb,validateBoolean:Pl,validateBuffer:yb,validateDictionary:ub,validateEncoding:gb,validateFunction:wb,validateInt32:ab,validateInteger:ob,validateNumber:sb,validateObject:fb,validateOneOf:lb,validatePlainFunction:mb,validatePort:bb,validateSignalName:pb,validateString:no,validateUint32:Ol,validateUndefined:_b,validateUnion:Eb,validateAbortSignal:Bl,validateLinkHeaderValue:Ab}});var et=_((ZR,Nl)=>{u();var K=Nl.exports={},Oe,Pe;function io(){throw new Error("setTimeout has not been defined")}function oo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Oe=setTimeout:Oe=io}catch{Oe=io}try{typeof clearTimeout=="function"?Pe=clearTimeout:Pe=oo}catch{Pe=oo}})();function kl(t){if(Oe===setTimeout)return setTimeout(t,0);if((Oe===io||!Oe)&&setTimeout)return Oe=setTimeout,setTimeout(t,0);try{return Oe(t,0)}catch{try{return Oe.call(null,t,0)}catch{return Oe.call(this,t,0)}}}function vb(t){if(Pe===clearTimeout)return clearTimeout(t);if((Pe===oo||!Pe)&&clearTimeout)return Pe=clearTimeout,clearTimeout(t);try{return Pe(t)}catch{try{return Pe.call(null,t)}catch{return Pe.call(this,t)}}}var We=[],Wt=!1,pt,hn=-1;function Rb(){!Wt||!pt||(Wt=!1,pt.length?We=pt.concat(We):hn=-1,We.length&&Ll())}function Ll(){if(!Wt){var t=kl(Rb);Wt=!0;for(var e=We.length;e;){for(pt=We,We=[];++hn<e;)pt&&pt[hn].run();hn=-1,e=We.length}pt=null,Wt=!1,vb(t)}}K.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];We.push(new Cl(t,e)),We.length===1&&!Wt&&kl(Ll)};function Cl(t,e){this.fun=t,this.array=e}Cl.prototype.run=function(){this.fun.apply(null,this.array)};K.title="browser";K.browser=!0;K.env={};K.argv=[];K.version="";K.versions={};function $e(){}K.on=$e;K.addListener=$e;K.once=$e;K.off=$e;K.removeListener=$e;K.removeAllListeners=$e;K.emit=$e;K.prependListener=$e;K.prependOnceListener=$e;K.listeners=function(t){return[]};K.binding=function(t){throw new Error("process.binding is not supported")};K.cwd=function(){return"/"};K.chdir=function(t){throw new Error("process.chdir is not supported")};K.umask=function(){return 0}});var Me=_((t1,Xl)=>{"use strict";u();var{SymbolAsyncIterator:ql,SymbolIterator:Dl,SymbolFor:yt}=H(),Fl=yt("nodejs.stream.destroyed"),jl=yt("nodejs.stream.errored"),ao=yt("nodejs.stream.readable"),so=yt("nodejs.stream.writable"),Ul=yt("nodejs.stream.disturbed"),xb=yt("nodejs.webstream.isClosedPromise"),Tb=yt("nodejs.webstream.controllerErrorFunction");function pn(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function yn(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))}function Ib(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function Be(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Wl(t){return!!(t&&!Be(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function $l(t){return!!(t&&!Be(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Hl(t){return!!(t&&!Be(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Ob(t){return Wl(t)||$l(t)||Hl(t)}function Pb(t,e){return t==null?!1:e===!0?typeof t[ql]=="function":e===!1?typeof t[Dl]=="function":typeof t[ql]=="function"||typeof t[Dl]=="function"}function gn(t){if(!Be(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Fl]||n!=null&&n.destroyed)}function Gl(t){if(!yn(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}function Bb(t,e){if(!yn(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function Mb(t){if(!pn(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}function Vl(t,e){if(!pn(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Kl(t){return t&&t[ao]!=null?t[ao]:typeof t?.readable!="boolean"?null:gn(t)?!1:pn(t)&&t.readable&&!Vl(t)}function zl(t){return t&&t[so]!=null?t[so]:typeof t?.writable!="boolean"?null:gn(t)?!1:yn(t)&&t.writable&&!Gl(t)}function kb(t,e){return Be(t)?gn(t)?!0:!(e?.readable!==!1&&Kl(t)||e?.writable!==!1&&zl(t)):null}function Lb(t){var e,r;return Be(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Cb(t){var e,r;return Be(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Nb(t){if(!Be(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Yl(t)?t._closed:null}function Yl(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Jl(t){return typeof t._sent100=="boolean"&&Yl(t)}function qb(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}function Db(t){if(!Be(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&Jl(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Fb(t){var e;return!!(t&&((e=t[Ul])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function jb(t){var e,r,n,i,o,a,s,l,f,c;return!!(t&&((e=(r=(n=(i=(o=(a=t[jl])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&i!==void 0?i:(s=t._readableState)===null||s===void 0?void 0:s.errorEmitted)!==null&&n!==void 0?n:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((c=t._writableState)===null||c===void 0)&&c.errored))}Xl.exports={isDestroyed:gn,kIsDestroyed:Fl,isDisturbed:Fb,kIsDisturbed:Ul,isErrored:jb,kIsErrored:jl,isReadable:Kl,kIsReadable:ao,kIsClosedPromise:xb,kControllerErrorFunction:Tb,kIsWritable:so,isClosed:Nb,isDuplexNodeStream:Ib,isFinished:kb,isIterable:Pb,isReadableNodeStream:pn,isReadableStream:Wl,isReadableEnded:Mb,isReadableFinished:Vl,isReadableErrored:Cb,isNodeStream:Be,isWebStream:Ob,isWritable:zl,isWritableNodeStream:yn,isWritableStream:$l,isWritableEnded:Gl,isWritableFinished:Bb,isWritableErrored:Lb,isServerRequest:qb,isServerResponse:Jl,willEmitClose:Db,isTransformStream:Hl}});var He=_((n1,ho)=>{u();var tt=et(),{AbortError:sf,codes:Ub}=ae(),{ERR_INVALID_ARG_TYPE:Wb,ERR_STREAM_PREMATURE_CLOSE:Ql}=Ub,{kEmptyObject:fo,once:uo}=ne(),{validateAbortSignal:$b,validateFunction:Hb,validateObject:Gb,validateBoolean:Vb}=Ut(),{Promise:Kb,PromisePrototypeThen:zb,SymbolDispose:lf}=H(),{isClosed:Yb,isReadable:Zl,isReadableNodeStream:lo,isReadableStream:Jb,isReadableFinished:ef,isReadableErrored:tf,isWritable:rf,isWritableNodeStream:nf,isWritableStream:Xb,isWritableFinished:of,isWritableErrored:af,isNodeStream:Qb,willEmitClose:Zb,kIsClosedPromise:ew}=Me(),$t;function tw(t){return t.setHeader&&typeof t.abort=="function"}var co=()=>{};function ff(t,e,r){var n,i;if(arguments.length===2?(r=e,e=fo):e==null?e=fo:Gb(e,"options"),Hb(r,"callback"),$b(e.signal,"options.signal"),r=uo(r),Jb(t)||Xb(t))return rw(t,e,r);if(!Qb(t))throw new Wb("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:lo(t),a=(i=e.writable)!==null&&i!==void 0?i:nf(t),s=t._writableState,l=t._readableState,f=()=>{t.writable||g()},c=Zb(t)&&lo(t)===o&&nf(t)===a,d=of(t,!1),g=()=>{d=!0,t.destroyed&&(c=!1),!(c&&(!t.readable||o))&&(!o||p)&&r.call(t)},p=ef(t,!1),E=()=>{p=!0,t.destroyed&&(c=!1),!(c&&(!t.writable||a))&&(!a||d)&&r.call(t)},m=I=>{r.call(t,I)},A=Yb(t),S=()=>{A=!0;let I=af(t)||tf(t);if(I&&typeof I!="boolean")return r.call(t,I);if(o&&!p&&lo(t,!0)&&!ef(t,!1))return r.call(t,new Ql);if(a&&!d&&!of(t,!1))return r.call(t,new Ql);r.call(t)},R=()=>{A=!0;let I=af(t)||tf(t);if(I&&typeof I!="boolean")return r.call(t,I);r.call(t)},k=()=>{t.req.on("finish",g)};tw(t)?(t.on("complete",g),c||t.on("abort",S),t.req?k():t.on("request",k)):a&&!s&&(t.on("end",f),t.on("close",f)),!c&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",E),t.on("finish",g),e.error!==!1&&t.on("error",m),t.on("close",S),A?tt.nextTick(S):s!=null&&s.errorEmitted||l!=null&&l.errorEmitted?c||tt.nextTick(R):(!o&&(!c||Zl(t))&&(d||rf(t)===!1)||!a&&(!c||rf(t))&&(p||Zl(t)===!1)||l&&t.req&&t.aborted)&&tt.nextTick(R);let v=()=>{r=co,t.removeListener("aborted",S),t.removeListener("complete",g),t.removeListener("abort",S),t.removeListener("request",k),t.req&&t.req.removeListener("finish",g),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",g),t.removeListener("end",E),t.removeListener("error",m),t.removeListener("close",S)};if(e.signal&&!A){let I=()=>{let W=r;v(),W.call(t,new sf(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)tt.nextTick(I);else{$t=$t||ne().addAbortListener;let W=$t(e.signal,I),D=r;r=uo((...X)=>{W[lf](),D.apply(t,X)})}}return v}function rw(t,e,r){let n=!1,i=co;if(e.signal)if(i=()=>{n=!0,r.call(t,new sf(void 0,{cause:e.signal.reason}))},e.signal.aborted)tt.nextTick(i);else{$t=$t||ne().addAbortListener;let a=$t(e.signal,i),s=r;r=uo((...l)=>{a[lf](),s.apply(t,l)})}let o=(...a)=>{n||tt.nextTick(()=>r.apply(t,a))};return zb(t[ew].promise,o,o),co}function nw(t,e){var r;let n=!1;return e===null&&(e=fo),(r=e)!==null&&r!==void 0&&r.cleanup&&(Vb(e.cleanup,"cleanup"),n=e.cleanup),new Kb((i,o)=>{let a=ff(t,e,s=>{n&&a(),s?o(s):i()})})}ho.exports=ff;ho.exports.finished=nw});var gt=_((o1,bf)=>{"use strict";u();var ke=et(),{aggregateTwoErrors:iw,codes:{ERR_MULTIPLE_CALLBACK:ow},AbortError:aw}=ae(),{Symbol:df}=H(),{kIsDestroyed:sw,isDestroyed:lw,isFinished:fw,isServerRequest:uw}=Me(),hf=df("kDestroy"),po=df("kConstruct");function pf(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function cw(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(pf(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?uf(this,t,e):this.once(hf,function(o){uf(this,iw(o,t),e)}),this)}function uf(t,e,r){let n=!1;function i(o){if(n)return;n=!0;let a=t._readableState,s=t._writableState;pf(o,s,a),s&&(s.closed=!0),a&&(a.closed=!0),typeof r=="function"&&r(o),o?ke.nextTick(dw,t,o):ke.nextTick(yf,t)}try{t._destroy(e||null,i)}catch(o){i(o)}}function dw(t,e){yo(t,e),yf(t)}function yf(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function yo(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function hw(){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)}function go(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?ke.nextTick(yo,t,e):yo(t,e))}function pw(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(po,e),!(t.listenerCount(po)>1)&&ke.nextTick(yw,t)}function yw(t){let e=!1;function r(n){if(e){go(t,n??new ow);return}e=!0;let i=t._readableState,o=t._writableState,a=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(hf,n):n?go(t,n,!0):ke.nextTick(gw,t)}try{t._construct(n=>{ke.nextTick(r,n)})}catch(n){ke.nextTick(r,n)}}function gw(t){t.emit(po)}function cf(t){return t?.setHeader&&typeof t.abort=="function"}function gf(t){t.emit("close")}function bw(t,e){t.emit("error",e),ke.nextTick(gf,t)}function ww(t,e){!t||lw(t)||(!e&&!fw(t)&&(e=new aw),uw(t)?(t.socket=null,t.destroy(e)):cf(t)?t.abort():cf(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ke.nextTick(bw,t,e):ke.nextTick(gf,t),t.destroyed||(t[sw]=!0))}bf.exports={construct:pw,destroyer:ww,destroy:cw,undestroy:hw,errorOrDestroy:go}});var mn=_((s1,mf)=>{"use strict";u();var{ArrayIsArray:mw,ObjectSetPrototypeOf:wf}=H(),{EventEmitter:bn}=Ie();function wn(t){bn.call(this,t)}wf(wn.prototype,bn.prototype);wf(wn,bn);wn.prototype.pipe=function(t,e){let r=this;function n(c){t.writable&&t.write(c)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",a),r.on("close",s));let o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function l(c){f(),bn.listenerCount(this,"error")===0&&this.emit("error",c)}bo(r,"error",l),bo(t,"error",l);function f(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};function bo(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):mw(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}mf.exports={Stream:wn,prependListener:bo}});var Sr=_((f1,_n)=>{"use strict";u();var{SymbolDispose:_w}=H(),{AbortError:_f,codes:Ew}=ae(),{isNodeStream:Ef,isWebStream:Sw,kControllerErrorFunction:Aw}=Me(),vw=He(),{ERR_INVALID_ARG_TYPE:Sf}=Ew,wo,Rw=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Sf(e,"AbortSignal",t)};_n.exports.addAbortSignal=function(e,r){if(Rw(e,"signal"),!Ef(r)&&!Sw(r))throw new Sf("stream",["ReadableStream","WritableStream","Stream"],r);return _n.exports.addAbortSignalNoValidate(e,r)};_n.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Ef(e)?()=>{e.destroy(new _f(void 0,{cause:t.reason}))}:()=>{e[Aw](new _f(void 0,{cause:t.reason}))};if(t.aborted)r();else{wo=wo||ne().addAbortListener;let n=wo(t,r);vw(e,n[_w])}return e}});var Rf=_((d1,vf)=>{"use strict";u();var{StringPrototypeSlice:Af,SymbolIterator:xw,TypedArrayPrototypeSet:En,Uint8Array:Tw}=H(),{Buffer:mo}=de(),{inspect:Iw}=ne();vf.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++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 r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return mo.alloc(0);let r=mo.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)En(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[xw](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",n=this.head,i=0;do{let o=n.data;if(e>o.length)r+=o,e-=o.length;else{e===o.length?(r+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=Af(o,0,e),this.head=n,n.data=Af(o,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=mo.allocUnsafe(e),n=e,i=this.head,o=0;do{let a=i.data;if(e>a.length)En(r,a,n-e),e-=a.length;else{e===a.length?(En(r,a,n-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(En(r,new Tw(a.buffer,a.byteOffset,e),n-e),this.head=i,i.data=a.slice(e));break}++o}while((i=i.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Iw(this,{...r,depth:0,customInspect:!1})}}});var Ar=_((p1,Of)=>{"use strict";u();var{MathFloor:Ow,NumberIsInteger:Pw}=H(),{validateInteger:Bw}=Ut(),{ERR_INVALID_ARG_VALUE:Mw}=ae().codes,xf=16*1024,Tf=16;function kw(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function If(t){return t?Tf:xf}function Lw(t,e){Bw(e,"value",0),t?Tf=e:xf=e}function Cw(t,e,r,n){let i=kw(e,n,r);if(i!=null){if(!Pw(i)||i<0){let o=n?`options.${r}`:"options.highWaterMark";throw new Mw(o,i)}return Ow(i)}return If(t.objectMode)}Of.exports={getHighWaterMark:Cw,getDefaultHighWaterMark:If,setDefaultHighWaterMark:Lw}});var Mf=_((_o,Bf)=>{u();var Sn=de(),Le=Sn.Buffer;function Pf(t,e){for(var r in t)e[r]=t[r]}Le.from&&Le.alloc&&Le.allocUnsafe&&Le.allocUnsafeSlow?Bf.exports=Sn:(Pf(Sn,_o),_o.Buffer=bt);function bt(t,e,r){return Le(t,e,r)}bt.prototype=Object.create(Le.prototype);Pf(Le,bt);bt.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Le(t,e,r)};bt.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Le(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};bt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Le(t)};bt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Sn.SlowBuffer(t)}});var An=_(Lf=>{"use strict";u();var So=Mf().Buffer,kf=So.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 Nw(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}}function qw(t){var e=Nw(t);if(typeof e!="string"&&(So.isEncoding===kf||!kf(t)))throw new Error("Unknown encoding: "+t);return e||t}Lf.StringDecoder=vr;function vr(t){this.encoding=qw(t);var e;switch(this.encoding){case"utf16le":this.text=$w,this.end=Hw,e=4;break;case"utf8":this.fillLast=jw,e=4;break;case"base64":this.text=Gw,this.end=Vw,e=3;break;default:this.write=Kw,this.end=zw;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=So.allocUnsafe(e)}vr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};vr.prototype.end=Ww;vr.prototype.text=Uw;vr.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 Eo(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Dw(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Eo(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Eo(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Eo(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function Fw(t,e,r){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"}}function jw(t){var e=this.lastTotal-this.lastNeed,r=Fw(this,t,e);if(r!==void 0)return r;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}function Uw(t,e){var r=Dw(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function Ww(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function $w(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Hw(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Gw(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===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-r))}function Vw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Kw(t){return t.toString(this.encoding)}function zw(t){return t&&t.length?this.write(t):""}});var Ao=_((m1,Df)=>{"use strict";u();var Cf=et(),{PromisePrototypeThen:Yw,SymbolAsyncIterator:Nf,SymbolIterator:qf}=H(),{Buffer:Jw}=de(),{ERR_INVALID_ARG_TYPE:Xw,ERR_STREAM_NULL_VALUES:Qw}=ae().codes;function Zw(t,e,r){let n;if(typeof e=="string"||e instanceof Jw)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[Nf])i=!0,n=e[Nf]();else if(e&&e[qf])i=!1,n=e[qf]();else throw new Xw("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(f,c){Yw(s(f),()=>Cf.nextTick(c,f),d=>Cf.nextTick(c,d||f))};async function s(f){let c=f!=null,d=typeof n.throw=="function";if(c&&d){let{value:g,done:p}=await n.throw(f);if(await g,p)return}if(typeof n.return=="function"){let{value:g}=await n.return();await g}}async function l(){for(;;){try{let{value:f,done:c}=i?await n.next():n.next();if(c)o.push(null);else{let d=f&&typeof f.then=="function"?await f:f;if(d===null)throw a=!1,new Qw;if(o.push(d))continue;a=!1}}catch(f){o.destroy(f)}break}}return o}Df.exports=Zw});var xr=_((E1,ru)=>{u();var Ee=et(),{ArrayPrototypeIndexOf:em,NumberIsInteger:tm,NumberIsNaN:rm,NumberParseInt:nm,ObjectDefineProperties:Bo,ObjectKeys:im,ObjectSetPrototypeOf:Uf,Promise:Wf,SafeSet:om,SymbolAsyncDispose:am,SymbolAsyncIterator:sm,Symbol:lm}=H();ru.exports=x;x.ReadableState=Tn;var{EventEmitter:fm}=Ie(),{Stream:rt,prependListener:um}=mn(),{Buffer:vo}=de(),{addAbortSignal:cm}=Sr(),$f=He(),L=ne().debuglog("stream",t=>{L=t}),dm=Rf(),Vt=gt(),{getHighWaterMark:hm,getDefaultHighWaterMark:pm}=Ar(),{aggregateTwoErrors:Ff,codes:{ERR_INVALID_ARG_TYPE:ym,ERR_METHOD_NOT_IMPLEMENTED:gm,ERR_OUT_OF_RANGE:bm,ERR_STREAM_PUSH_AFTER_EOF:wm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:mm},AbortError:_m}=ae(),{validateObject:Em}=Ut(),wt=lm("kPaused"),{StringDecoder:Hf}=An(),Sm=Ao();Uf(x.prototype,rt.prototype);Uf(x,rt);var Ro=()=>{},{errorOrDestroy:Ht}=Vt,Gt=1,Am=2,Gf=4,Rr=8,Vf=16,vn=32,Rn=64,Kf=128,vm=256,Rm=512,xm=1024,Oo=2048,Po=4096,Tm=8192,Im=16384,Om=32768,zf=65536,Pm=1<<17,Bm=1<<18;function z(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}Bo(Tn.prototype,{objectMode:z(Gt),ended:z(Am),endEmitted:z(Gf),reading:z(Rr),constructed:z(Vf),sync:z(vn),needReadable:z(Rn),emittedReadable:z(Kf),readableListening:z(vm),resumeScheduled:z(Rm),errorEmitted:z(xm),emitClose:z(Oo),autoDestroy:z(Po),destroyed:z(Tm),closed:z(Im),closeEmitted:z(Om),multiAwaitDrain:z(zf),readingMore:z(Pm),dataEmitted:z(Bm)});function Tn(t,e,r){typeof r!="boolean"&&(r=e instanceof Ce()),this.state=Oo|Po|Vf|vn,t&&t.objectMode&&(this.state|=Gt),r&&t&&t.readableObjectMode&&(this.state|=Gt),this.highWaterMark=t?hm(this,t,"readableHighWaterMark",r):pm(!1),this.buffer=new dm,this.length=0,this.pipes=[],this.flowing=null,this[wt]=null,t&&t.emitClose===!1&&(this.state&=~Oo),t&&t.autoDestroy===!1&&(this.state&=~Po),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Hf(t.encoding),this.encoding=t.encoding)}function x(t){if(!(this instanceof x))return new x(t);let e=this instanceof Ce();this._readableState=new Tn(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&&cm(t.signal,this)),rt.call(this,t),Vt.construct(this,()=>{this._readableState.needReadable&&xn(this,this._readableState)})}x.prototype.destroy=Vt.destroy;x.prototype._undestroy=Vt.undestroy;x.prototype._destroy=function(t,e){e(t)};x.prototype[fm.captureRejectionSymbol]=function(t){this.destroy(t)};x.prototype[am]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new _m,this.destroy(t)),new Wf((e,r)=>$f(this,n=>n&&n!==t?r(n):e(null)))};x.prototype.push=function(t,e){return Yf(this,t,e,!1)};x.prototype.unshift=function(t,e){return Yf(this,t,e,!0)};function Yf(t,e,r,n){L("readableAddChunk",e);let i=t._readableState,o;if((i.state&Gt)===0&&(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=vo.from(e,r).toString(i.encoding):(e=vo.from(e,r),r=""))):e instanceof vo?r="":rt._isUint8Array(e)?(e=rt._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new ym("chunk",["string","Buffer","Uint8Array"],e))),o)Ht(t,o);else if(e===null)i.state&=~Rr,Lm(t,i);else if((i.state&Gt)!==0||e&&e.length>0)if(n)if((i.state&Gf)!==0)Ht(t,new mm);else{if(i.destroyed||i.errored)return!1;xo(t,i,e,!0)}else if(i.ended)Ht(t,new wm);else{if(i.destroyed||i.errored)return!1;i.state&=~Rr,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?xo(t,i,e,!1):xn(t,i)):xo(t,i,e,!1)}else n||(i.state&=~Rr,xn(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function xo(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&zf)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),(e.state&Rn)!==0&&In(t)),xn(t,e)}x.prototype.isPaused=function(){let t=this._readableState;return t[wt]===!0||t.flowing===!1};x.prototype.setEncoding=function(t){let e=new Hf(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var Mm=1073741824;function km(t){if(t>Mm)throw new bm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function jf(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Gt)!==0?1:rm(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}x.prototype.read=function(t){L("read",t),t===void 0?t=NaN:tm(t)||(t=nm(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=km(t)),t!==0&&(e.state&=~Kf),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return L("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?To(this):In(this),null;if(t=jf(t,e),t===0&&e.ended)return e.length===0&&To(this),null;let n=(e.state&Rn)!==0;if(L("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,L("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,L("reading, ended or constructing",n);else if(n){L("do read"),e.state|=Rr|vn,e.length===0&&(e.state|=Rn);try{this._read(e.highWaterMark)}catch(o){Ht(this,o)}e.state&=~vn,e.reading||(t=jf(r,e))}let i;return t>0?i=eu(t,e):i=null,i===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),r!==t&&e.ended&&To(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function Lm(t,e){if(L("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?In(t):(e.needReadable=!1,e.emittedReadable=!0,Jf(t))}}function In(t){let e=t._readableState;L("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(L("emitReadable",e.flowing),e.emittedReadable=!0,Ee.nextTick(Jf,t))}function Jf(t){let e=t._readableState;L("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,Qf(t)}function xn(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ee.nextTick(Cm,t,e))}function Cm(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(L("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}x.prototype._read=function(t){throw new gm("_read()")};x.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new om(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),L("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ee.stdout&&t!==Ee.stderr?s:A;n.endEmitted?Ee.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(S,R){L("onunpipe"),S===r&&R&&R.hasUnpiped===!1&&(R.hasUnpiped=!0,c())}function s(){L("onend"),t.end()}let l,f=!1;function c(){L("cleanup"),t.removeListener("close",E),t.removeListener("finish",m),l&&t.removeListener("drain",l),t.removeListener("error",p),t.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",A),r.removeListener("data",g),f=!0,l&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function d(){f||(n.pipes.length===1&&n.pipes[0]===t?(L("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(L("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),l||(l=Nm(r,t),t.on("drain",l))}r.on("data",g);function g(S){L("ondata");let R=t.write(S);L("dest.write",R),R===!1&&d()}function p(S){if(L("onerror",S),A(),t.removeListener("error",p),t.listenerCount("error")===0){let R=t._writableState||t._readableState;R&&!R.errorEmitted?Ht(t,S):t.emit("error",S)}}um(t,"error",p);function E(){t.removeListener("finish",m),A()}t.once("close",E);function m(){L("onfinish"),t.removeListener("close",E),A()}t.once("finish",m);function A(){L("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?d():n.flowing||(L("pipe resume"),r.resume()),t};function Nm(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(L("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(L("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}x.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let o=0;o<i.length;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=em(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};x.prototype.on=function(t,e){let r=rt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,L("on readable",n.length,n.reading),n.length?In(this):n.reading||Ee.nextTick(qm,this)),r};x.prototype.addListener=x.prototype.on;x.prototype.removeListener=function(t,e){let r=rt.prototype.removeListener.call(this,t,e);return t==="readable"&&Ee.nextTick(Xf,this),r};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(t){let e=rt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ee.nextTick(Xf,this),e};function Xf(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[wt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function qm(t){L("readable nexttick read 0"),t.read(0)}x.prototype.resume=function(){let t=this._readableState;return t.flowing||(L("resume"),t.flowing=!t.readableListening,Dm(this,t)),t[wt]=!1,this};function Dm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ee.nextTick(Fm,t,e))}function Fm(t,e){L("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Qf(t),e.flowing&&!e.reading&&t.read(0)}x.prototype.pause=function(){return L("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(L("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[wt]=!0,this};function Qf(t){let e=t._readableState;for(L("flow",e.flowing);e.flowing&&t.read()!==null;);}x.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{Ht(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=im(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};x.prototype[sm]=function(){return Zf(this)};x.prototype.iterator=function(t){return t!==void 0&&Em(t,"options"),Zf(this,t)};function Zf(t,e){typeof t.read!="function"&&(t=x.wrap(t,{objectMode:!0}));let r=jm(t,e);return r.stream=t,r}async function*jm(t,e){let r=Ro;function n(a){this===t?(r(),r=Ro):r=a}t.on("readable",n);let i,o=$f(t,{writable:!1},a=>{i=a?Ff(i,a):null,r(),r=Ro});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(i)throw i;if(i===null)return;await new Wf(n)}}}catch(a){throw i=Ff(i,a),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?Vt.destroyer(t,null):(t.off("readable",n),o())}}Bo(x.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}}});Bo(Tn.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[wt]!==!1},set(t){this[wt]=!!t}}});x._fromList=eu;function eu(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function To(t){let e=t._readableState;L("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ee.nextTick(Um,e,t))}function Um(t,e){if(L("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)Ee.nextTick(Wm,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function Wm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}x.from=function(t,e){return Sm(x,t,e)};var Io;function tu(){return Io===void 0&&(Io={}),Io}x.fromWeb=function(t,e){return tu().newStreamReadableFromReadableStream(t,e)};x.toWeb=function(t,e){return tu().newReadableStreamFromStreamReadable(t,e)};x.wrap=function(t,e){var r,n;return new x({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,o){Vt.destroyer(t,i),o(i)}}).wrap(t)}});var kn=_((A1,pu)=>{u();var mt=et(),{ArrayPrototypeSlice:ou,Error:$m,FunctionPrototypeSymbolHasInstance:au,ObjectDefineProperty:su,ObjectDefineProperties:Hm,ObjectSetPrototypeOf:lu,StringPrototypeToLowerCase:Gm,Symbol:Vm,SymbolHasInstance:Km}=H();pu.exports=G;G.WritableState=Or;var{EventEmitter:zm}=Ie(),Tr=mn().Stream,{Buffer:On}=de(),Mn=gt(),{addAbortSignal:Ym}=Sr(),{getHighWaterMark:Jm,getDefaultHighWaterMark:Xm}=Ar(),{ERR_INVALID_ARG_TYPE:Qm,ERR_METHOD_NOT_IMPLEMENTED:Zm,ERR_MULTIPLE_CALLBACK:fu,ERR_STREAM_CANNOT_PIPE:e0,ERR_STREAM_DESTROYED:Ir,ERR_STREAM_ALREADY_FINISHED:t0,ERR_STREAM_NULL_VALUES:r0,ERR_STREAM_WRITE_AFTER_END:n0,ERR_UNKNOWN_ENCODING:uu}=ae().codes,{errorOrDestroy:Kt}=Mn;lu(G.prototype,Tr.prototype);lu(G,Tr);function Lo(){}var zt=Vm("kOnFinished");function Or(t,e,r){typeof r!="boolean"&&(r=e instanceof Ce()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Jm(this,t,"writableHighWaterMark",r):Xm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=o0.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Bn(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[zt]=[]}function Bn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Or.prototype.getBuffer=function(){return ou(this.buffered,this.bufferedIndex)};su(Or.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function G(t){let e=this instanceof Ce();if(!e&&!au(G,this))return new G(t);this._writableState=new Or(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&&Ym(t.signal,this)),Tr.call(this,t),Mn.construct(this,()=>{let r=this._writableState;r.writing||No(this,r),qo(this,r)})}su(G,Km,{__proto__:null,value:function(t){return au(this,t)?!0:this!==G?!1:t&&t._writableState instanceof Or}});G.prototype.pipe=function(){Kt(this,new e0)};function cu(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!On.isEncoding(r))throw new uu(r);typeof n!="function"&&(n=Lo)}if(e===null)throw new r0;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=On.from(e,r),r="buffer");else if(e instanceof On)r="buffer";else if(Tr._isUint8Array(e))e=Tr._uint8ArrayToBuffer(e),r="buffer";else throw new Qm("chunk",["string","Buffer","Uint8Array"],e);let o;return i.ending?o=new n0:i.destroyed&&(o=new Ir("write")),o?(mt.nextTick(n,o),Kt(t,o,!0),o):(i.pendingcb++,i0(t,i,e,r,n))}G.prototype.write=function(t,e,r){return cu(this,t,e,r)===!0};G.prototype.cork=function(){this._writableState.corked++};G.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||No(this,t))};G.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=Gm(e)),!On.isEncoding(e))throw new uu(e);return this._writableState.defaultEncoding=e,this};function i0(t,e,r,n,i){let o=e.objectMode?1:r.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:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==Lo&&(e.allNoop=!1)):(e.writelen=o,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}function nu(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Ir("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function iu(t,e,r,n){--e.pendingcb,n(r),Co(e),Kt(t,r)}function o0(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){Kt(t,new fu);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?mt.nextTick(iu,t,r,e,i):iu(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&No(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},mt.nextTick(a0,r.afterWriteTickInfo)):du(t,r,1,i))}function a0({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,du(t,e,r,n)}function du(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&Co(e),qo(t,e)}function Co(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:o,callback:a}=t.buffered[i],s=t.objectMode?1:o.length;t.length-=s,a((e=t.errored)!==null&&e!==void 0?e:new Ir("write"))}let r=t[zt].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new Ir("end"))}Bn(t)}function No(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,o=r.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let s=e.allNoop?Lo:f=>{for(let c=a;c<r.length;++c)r[c].callback(f)},l=e.allNoop&&a===0?r:ou(r,a);l.allBuffers=e.allBuffers,nu(t,e,!0,e.length,l,"",s),Bn(e)}else{do{let{chunk:s,encoding:l,callback:f}=r[a];r[a++]=null;let c=i?1:s.length;nu(t,e,!1,c,s,l,f)}while(a<r.length&&!e.writing);a===r.length?Bn(e):a>256?(r.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}G.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Zm("_write()")};G.prototype._writev=null;G.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let o=cu(this,t,e);o instanceof $m&&(i=o)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,qo(this,n,!0),n.ended=!0):n.finished?i=new t0("end"):n.destroyed&&(i=new Ir("end"))),typeof r=="function"&&(i||n.finished?mt.nextTick(r,i):n[zt].push(r)),this};function Pn(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}function s0(t,e){let r=!1;function n(i){if(r){Kt(t,i??fu());return}if(r=!0,e.pendingcb--,i){let o=e[zt].splice(0);for(let a=0;a<o.length;a++)o[a](i);Kt(t,i,e.sync)}else Pn(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,mt.nextTick(ko,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function l0(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,s0(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function qo(t,e,r){Pn(e)&&(l0(t,e),e.pendingcb===0&&(r?(e.pendingcb++,mt.nextTick((n,i)=>{Pn(i)?ko(n,i):i.pendingcb--},t,e)):Pn(e)&&(e.pendingcb++,ko(t,e))))}function ko(t,e){e.pendingcb--,e.finished=!0;let r=e[zt].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}Hm(G.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 f0=Mn.destroy;G.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[zt].length)&&mt.nextTick(Co,r),f0.call(this,t,e),this};G.prototype._undestroy=Mn.undestroy;G.prototype._destroy=function(t,e){e(t)};G.prototype[zm.captureRejectionSymbol]=function(t){this.destroy(t)};var Mo;function hu(){return Mo===void 0&&(Mo={}),Mo}G.fromWeb=function(t,e){return hu().newStreamWritableFromWritableStream(t,e)};G.toWeb=function(t){return hu().newWritableStreamFromStreamWritable(t)}});var Ou=_((R1,Iu)=>{u();var Do=et(),u0=de(),{isReadable:c0,isWritable:d0,isIterable:yu,isNodeStream:h0,isReadableNodeStream:gu,isWritableNodeStream:bu,isDuplexNodeStream:p0,isReadableStream:wu,isWritableStream:mu}=Me(),_u=He(),{AbortError:xu,codes:{ERR_INVALID_ARG_TYPE:y0,ERR_INVALID_RETURN_VALUE:Eu}}=ae(),{destroyer:Jt}=gt(),g0=Ce(),Tu=xr(),b0=kn(),{createDeferredPromise:Su}=ne(),Au=Ao(),vu=globalThis.Blob||u0.Blob,w0=typeof vu<"u"?function(e){return e instanceof vu}:function(e){return!1},m0=globalThis.AbortController||Dt().AbortController,{FunctionPrototypeCall:Ru}=H(),nt=class extends g0{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)}};Iu.exports=function t(e,r){if(p0(e))return e;if(gu(e))return Yt({readable:e});if(bu(e))return Yt({writable:e});if(h0(e))return Yt({writable:!1,readable:!1});if(wu(e))return Yt({readable:Tu.fromWeb(e)});if(mu(e))return Yt({writable:b0.fromWeb(e)});if(typeof e=="function"){let{value:i,write:o,final:a,destroy:s}=_0(e);if(yu(i))return Au(nt,i,{objectMode:!0,write:o,final:a,destroy:s});let l=i?.then;if(typeof l=="function"){let f,c=Ru(l,i,d=>{if(d!=null)throw new Eu("nully","body",d)},d=>{Jt(f,d)});return f=new nt({objectMode:!0,readable:!1,write:o,final(d){a(async()=>{try{await c,Do.nextTick(d,null)}catch(g){Do.nextTick(d,g)}})},destroy:s})}throw new Eu("Iterable, AsyncIterable or AsyncFunction",r,i)}if(w0(e))return t(e.arrayBuffer());if(yu(e))return Au(nt,e,{objectMode:!0,writable:!1});if(wu(e?.readable)&&mu(e?.writable))return nt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?gu(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?bu(e?.writable)?e?.writable:t(e.writable):void 0;return Yt({readable:i,writable:o})}let n=e?.then;if(typeof n=="function"){let i;return Ru(n,e,o=>{o!=null&&i.push(o),i.push(null)},o=>{Jt(i,o)}),i=new nt({objectMode:!0,writable:!1,read(){}})}throw new y0(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function _0(t){let{promise:e,resolve:r}=Su(),n=new m0,i=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:s,done:l,cb:f}=await a;if(Do.nextTick(f),l)return;if(i.aborted)throw new xu(void 0,{cause:i.reason});({promise:e,resolve:r}=Su()),yield s}}(),{signal:i}),write(a,s,l){let f=r;r=null,f({chunk:a,done:!1,cb:l})},final(a){let s=r;r=null,s({done:!0,cb:a})},destroy(a,s){n.abort(),s(a)}}}function Yt(t){let e=t.readable&&typeof t.readable.read!="function"?Tu.wrap(t.readable):t.readable,r=t.writable,n=!!c0(e),i=!!d0(r),o,a,s,l,f;function c(d){let g=l;l=null,g?g(d):d&&f.destroy(d)}return f=new nt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(_u(r,d=>{i=!1,d&&Jt(e,d),c(d)}),f._write=function(d,g,p){r.write(d,g)?p():o=p},f._final=function(d){r.end(),a=d},r.on("drain",function(){if(o){let d=o;o=null,d()}}),r.on("finish",function(){if(a){let d=a;a=null,d()}})),n&&(_u(e,d=>{n=!1,d&&Jt(e,d),c(d)}),e.on("readable",function(){if(s){let d=s;s=null,d()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let d=e.read();if(d===null){s=f._read;return}if(!f.push(d))return}}),f._destroy=function(d,g){!d&&l!==null&&(d=new xu),s=null,o=null,a=null,l===null?g(d):(l=g,Jt(r,d),Jt(e,d))},f}});var Ce=_((T1,Mu)=>{"use strict";u();var{ObjectDefineProperties:E0,ObjectGetOwnPropertyDescriptor:Ge,ObjectKeys:S0,ObjectSetPrototypeOf:Pu}=H();Mu.exports=Se;var Uo=xr(),ye=kn();Pu(Se.prototype,Uo.prototype);Pu(Se,Uo);{let t=S0(ye.prototype);for(let e=0;e<t.length;e++){let r=t[e];Se.prototype[r]||(Se.prototype[r]=ye.prototype[r])}}function Se(t){if(!(this instanceof Se))return new Se(t);Uo.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}E0(Se.prototype,{writable:{__proto__:null,...Ge(ye.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Ge(ye.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Ge(ye.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Ge(ye.prototype,"writableBuffer")},writableLength:{__proto__:null,...Ge(ye.prototype,"writableLength")},writableFinished:{__proto__:null,...Ge(ye.prototype,"writableFinished")},writableCorked:{__proto__:null,...Ge(ye.prototype,"writableCorked")},writableEnded:{__proto__:null,...Ge(ye.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Ge(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 Fo;function Bu(){return Fo===void 0&&(Fo={}),Fo}Se.fromWeb=function(t,e){return Bu().newStreamDuplexFromReadableWritablePair(t,e)};Se.toWeb=function(t){return Bu().newReadableWritablePairFromDuplex(t)};var jo;Se.from=function(t){return jo||(jo=Ou()),jo(t,"body")}});var Ho=_((O1,Lu)=>{"use strict";u();var{ObjectSetPrototypeOf:ku,Symbol:A0}=H();Lu.exports=Ve;var{ERR_METHOD_NOT_IMPLEMENTED:v0}=ae().codes,$o=Ce(),{getHighWaterMark:R0}=Ar();ku(Ve.prototype,$o.prototype);ku(Ve,$o);var Pr=A0("kCallback");function Ve(t){if(!(this instanceof Ve))return new Ve(t);let e=t?R0(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),$o.call(this,t),this._readableState.sync=!1,this[Pr]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",x0)}function Wo(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function x0(){this._final!==Wo&&Wo.call(this)}Ve.prototype._final=Wo;Ve.prototype._transform=function(t,e,r){throw new v0("_transform()")};Ve.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(t,e,(a,s)=>{if(a){r(a);return}s!=null&&this.push(s),i.ended||o===n.length||n.length<n.highWaterMark?r():this[Pr]=r})};Ve.prototype._read=function(){if(this[Pr]){let t=this[Pr];this[Pr]=null,t()}}});var Vo=_((B1,Nu)=>{"use strict";u();var{ObjectSetPrototypeOf:Cu}=H();Nu.exports=Xt;var Go=Ho();Cu(Xt.prototype,Go.prototype);Cu(Xt,Go);function Xt(t){if(!(this instanceof Xt))return new Xt(t);Go.call(this,t)}Xt.prototype._transform=function(t,e,r){r(null,t)}});var qn=_((k1,Uu)=>{u();var Br=et(),{ArrayIsArray:T0,Promise:I0,SymbolAsyncIterator:O0,SymbolDispose:P0}=H(),Nn=He(),{once:B0}=ne(),M0=gt(),qu=Ce(),{aggregateTwoErrors:k0,codes:{ERR_INVALID_ARG_TYPE:ta,ERR_INVALID_RETURN_VALUE:Ko,ERR_MISSING_ARGS:L0,ERR_STREAM_DESTROYED:C0,ERR_STREAM_PREMATURE_CLOSE:N0},AbortError:q0}=ae(),{validateFunction:D0,validateAbortSignal:F0}=Ut(),{isIterable:_t,isReadable:zo,isReadableNodeStream:Cn,isNodeStream:Du,isTransformStream:Qt,isWebStream:j0,isReadableStream:Yo,isReadableFinished:U0}=Me(),W0=globalThis.AbortController||Dt().AbortController,Jo,Xo,Qo;function Fu(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Nn(t,{readable:e,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,M0.destroyer(t,o||new C0("pipe")))},cleanup:i}}function $0(t){return D0(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Zo(t){if(_t(t))return t;if(Cn(t))return H0(t);throw new ta("val",["Readable","Iterable","AsyncIterable"],t)}async function*H0(t){Xo||(Xo=xr()),yield*Xo.prototype[O0].call(t)}async function Ln(t,e,r,{end:n}){let i,o=null,a=f=>{if(f&&(i=f),o){let c=o;o=null,c()}},s=()=>new I0((f,c)=>{i?c(i):o=()=>{i?c(i):f()}});e.on("drain",a);let l=Nn(e,{readable:!1},a);try{e.writableNeedDrain&&await s();for await(let f of t)e.write(f)||await s();n&&(e.end(),await s()),r()}catch(f){r(i!==f?k0(i,f):f)}finally{l(),e.off("drain",a)}}async function ea(t,e,r,{end:n}){Qt(e)&&(e=e.writable);let i=e.getWriter();try{for await(let o of t)await i.ready,i.write(o).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(a){r(a)}}}function G0(...t){return ju(t,B0($0(t)))}function ju(t,e,r){if(t.length===1&&T0(t[0])&&(t=t[0]),t.length<2)throw new L0("streams");let n=new W0,i=n.signal,o=r?.signal,a=[];F0(o,"options.signal");function s(){E(new q0)}Qo=Qo||ne().addAbortListener;let l;o&&(l=Qo(o,s));let f,c,d=[],g=0;function p(k){E(k,--g===0)}function E(k,v){var I;if(k&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=k),!(!f&&!v)){for(;d.length;)d.shift()(f);(I=l)===null||I===void 0||I[P0](),n.abort(),v&&(f||a.forEach(W=>W()),Br.nextTick(e,f,c))}}let m;for(let k=0;k<t.length;k++){let v=t[k],I=k<t.length-1,W=k>0,D=I||r?.end!==!1,X=k===t.length-1;if(Du(v)){let j=function(ee){ee&&ee.name!=="AbortError"&&ee.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(ee)};var R=j;if(D){let{destroy:ee,cleanup:je}=Fu(v,I,W);d.push(ee),zo(v)&&X&&a.push(je)}v.on("error",j),zo(v)&&X&&a.push(()=>{v.removeListener("error",j)})}if(k===0)if(typeof v=="function"){if(m=v({signal:i}),!_t(m))throw new Ko("Iterable, AsyncIterable or Stream","source",m)}else _t(v)||Cn(v)||Qt(v)?m=v:m=qu.from(v);else if(typeof v=="function"){if(Qt(m)){var A;m=Zo((A=m)===null||A===void 0?void 0:A.readable)}else m=Zo(m);if(m=v(m,{signal:i}),I){if(!_t(m,!0))throw new Ko("AsyncIterable",`transform[${k-1}]`,m)}else{var S;Jo||(Jo=Vo());let j=new Jo({objectMode:!0}),ee=(S=m)===null||S===void 0?void 0:S.then;if(typeof ee=="function")g++,ee.call(m,F=>{c=F,F!=null&&j.write(F),D&&j.end(),Br.nextTick(p)},F=>{j.destroy(F),Br.nextTick(p,F)});else if(_t(m,!0))g++,Ln(m,j,p,{end:D});else if(Yo(m)||Qt(m)){let F=m.readable||m;g++,Ln(F,j,p,{end:D})}else throw new Ko("AsyncIterable or Promise","destination",m);m=j;let{destroy:je,cleanup:C}=Fu(m,!1,!0);d.push(je),X&&a.push(C)}}else if(Du(v)){if(Cn(m)){g+=2;let j=V0(m,v,p,{end:D});zo(v)&&X&&a.push(j)}else if(Qt(m)||Yo(m)){let j=m.readable||m;g++,Ln(j,v,p,{end:D})}else if(_t(m))g++,Ln(m,v,p,{end:D});else throw new ta("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],m);m=v}else if(j0(v)){if(Cn(m))g++,ea(Zo(m),v,p,{end:D});else if(Yo(m)||_t(m))g++,ea(m,v,p,{end:D});else if(Qt(m))g++,ea(m.readable,v,p,{end:D});else throw new ta("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],m);m=v}else m=qu.from(v)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&Br.nextTick(s),m}function V0(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new N0)}),t.pipe(e,{end:!1}),n){let a=function(){i=!0,e.end()};var o=a;U0(t)?Br.nextTick(a):t.once("end",a)}else r();return Nn(t,{readable:!0,writable:!1},a=>{let s=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&s&&s.ended&&!s.errored&&!s.errorEmitted?t.once("end",r).once("error",r):r(a)}),Nn(e,{readable:!1,writable:!0},r)}Uu.exports={pipelineImpl:ju,pipeline:G0}});var na=_((C1,Ku)=>{"use strict";u();var{pipeline:K0}=qn(),Dn=Ce(),{destroyer:z0}=gt(),{isNodeStream:Fn,isReadable:Wu,isWritable:$u,isWebStream:ra,isTransformStream:Et,isWritableStream:Hu,isReadableStream:Gu}=Me(),{AbortError:Y0,codes:{ERR_INVALID_ARG_VALUE:Vu,ERR_MISSING_ARGS:J0}}=ae(),X0=He();Ku.exports=function(...e){if(e.length===0)throw new J0("streams");if(e.length===1)return Dn.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Dn.from(e[0])),typeof e[e.length-1]=="function"){let p=e.length-1;e[p]=Dn.from(e[p])}for(let p=0;p<e.length;++p)if(!(!Fn(e[p])&&!ra(e[p]))){if(p<e.length-1&&!(Wu(e[p])||Gu(e[p])||Et(e[p])))throw new Vu(`streams[${p}]`,r[p],"must be readable");if(p>0&&!($u(e[p])||Hu(e[p])||Et(e[p])))throw new Vu(`streams[${p}]`,r[p],"must be writable")}let n,i,o,a,s;function l(p){let E=a;a=null,E?E(p):p?s.destroy(p):!g&&!d&&s.destroy()}let f=e[0],c=K0(e,l),d=!!($u(f)||Hu(f)||Et(f)),g=!!(Wu(c)||Gu(c)||Et(c));if(s=new Dn({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(c!=null&&c.readableObjectMode),writable:d,readable:g}),d){if(Fn(f))s._write=function(E,m,A){f.write(E,m)?A():n=A},s._final=function(E){f.end(),i=E},f.on("drain",function(){if(n){let E=n;n=null,E()}});else if(ra(f)){let m=(Et(f)?f.writable:f).getWriter();s._write=async function(A,S,R){try{await m.ready,m.write(A).catch(()=>{}),R()}catch(k){R(k)}},s._final=async function(A){try{await m.ready,m.close().catch(()=>{}),i=A}catch(S){A(S)}}}let p=Et(c)?c.readable:c;X0(p,()=>{if(i){let E=i;i=null,E()}})}if(g){if(Fn(c))c.on("readable",function(){if(o){let p=o;o=null,p()}}),c.on("end",function(){s.push(null)}),s._read=function(){for(;;){let p=c.read();if(p===null){o=s._read;return}if(!s.push(p))return}};else if(ra(c)){let E=(Et(c)?c.readable:c).getReader();s._read=async function(){for(;;)try{let{value:m,done:A}=await E.read();if(!s.push(m))return;if(A){s.push(null);return}}catch{return}}}}return s._destroy=function(p,E){!p&&a!==null&&(p=new Y0),o=null,n=null,i=null,a===null?E(p):(a=E,Fn(c)&&z0(c,p))},s}});var nc=_((q1,aa)=>{"use strict";u();var Q0=globalThis.AbortController||Dt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Z0,ERR_INVALID_ARG_TYPE:Mr,ERR_MISSING_ARGS:e_,ERR_OUT_OF_RANGE:t_},AbortError:Ne}=ae(),{validateAbortSignal:St,validateInteger:zu,validateObject:At}=Ut(),r_=H().Symbol("kWeak"),n_=H().Symbol("kResistStopPropagation"),{finished:i_}=He(),o_=na(),{addAbortSignalNoValidate:a_}=Sr(),{isWritable:s_,isNodeStream:l_}=Me(),{deprecate:f_}=ne(),{ArrayPrototypePush:u_,Boolean:c_,MathFloor:Yu,Number:d_,NumberIsNaN:h_,Promise:Ju,PromiseReject:Xu,PromiseResolve:p_,PromisePrototypeThen:Qu,Symbol:ec}=H(),jn=ec("kEmpty"),Zu=ec("kEof");function y_(t,e){if(e!=null&&At(e,"options"),e?.signal!=null&&St(e.signal,"options.signal"),l_(t)&&!s_(t))throw new Z0("stream",t,"must be writable");let r=o_(this,t);return e!=null&&e.signal&&a_(e.signal,r),r}function Un(t,e){if(typeof t!="function")throw new Mr("fn",["Function","AsyncFunction"],t);e!=null&&At(e,"options"),e?.signal!=null&&St(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=Yu(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=Yu(e.highWaterMark)),zu(r,"options.concurrency",1),zu(n,"options.highWaterMark",0),n+=r,async function*(){let o=ne().AbortSignalAny([e?.signal].filter(c_)),a=this,s=[],l={signal:o},f,c,d=!1,g=0;function p(){d=!0,E()}function E(){g-=1,m()}function m(){c&&!d&&g<r&&s.length<n&&(c(),c=null)}async function A(){try{for await(let S of a){if(d)return;if(o.aborted)throw new Ne;try{if(S=t(S,l),S===jn)continue;S=p_(S)}catch(R){S=Xu(R)}g+=1,Qu(S,E,p),s.push(S),f&&(f(),f=null),!d&&(s.length>=n||g>=r)&&await new Ju(R=>{c=R})}s.push(Zu)}catch(S){let R=Xu(S);Qu(R,E,p),s.push(R)}finally{d=!0,f&&(f(),f=null)}}A();try{for(;;){for(;s.length>0;){let S=await s[0];if(S===Zu)return;if(o.aborted)throw new Ne;S!==jn&&(yield S),s.shift(),m()}await new Ju(S=>{f=S})}}finally{d=!0,c&&(c(),c=null)}}.call(this)}function g_(t=void 0){return t!=null&&At(t,"options"),t?.signal!=null&&St(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ne({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function tc(t,e=void 0){for await(let r of oa.call(this,t,e))return!0;return!1}async function b_(t,e=void 0){if(typeof t!="function")throw new Mr("fn",["Function","AsyncFunction"],t);return!await tc.call(this,async(...r)=>!await t(...r),e)}async function w_(t,e){for await(let r of oa.call(this,t,e))return r}async function m_(t,e){if(typeof t!="function")throw new Mr("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),jn}for await(let n of Un.call(this,r,e));}function oa(t,e){if(typeof t!="function")throw new Mr("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:jn}return Un.call(this,r,e)}var ia=class extends e_{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function __(t,e,r){var n;if(typeof t!="function")throw new Mr("reducer",["Function","AsyncFunction"],t);r!=null&&At(r,"options"),r?.signal!=null&&St(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let f=new Ne(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await i_(this.destroy(f)),f}let o=new Q0,a=o.signal;if(r!=null&&r.signal){let f={once:!0,[r_]:this,[n_]:!0};r.signal.addEventListener("abort",()=>o.abort(),f)}let s=!1;try{for await(let f of this){var l;if(s=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new Ne;i?e=await t(e,f,{signal:a}):(e=f,i=!0)}if(!s&&!i)throw new ia}finally{o.abort()}return e}async function E_(t){t!=null&&At(t,"options"),t?.signal!=null&&St(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new Ne(void 0,{cause:t.signal.reason});u_(e,n)}return e}function S_(t,e){let r=Un.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function rc(t){if(t=d_(t),h_(t))return 0;if(t<0)throw new t_("number",">= 0",t);return t}function A_(t,e=void 0){return e!=null&&At(e,"options"),e?.signal!=null&&St(e.signal,"options.signal"),t=rc(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ne;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Ne;t--<=0&&(yield o)}}.call(this)}function v_(t,e=void 0){return e!=null&&At(e,"options"),e?.signal!=null&&St(e.signal,"options.signal"),t=rc(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ne;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Ne;if(t-- >0&&(yield o),t<=0)return}}.call(this)}aa.exports.streamReturningOperators={asIndexedPairs:f_(g_,"readable.asIndexedPairs will be removed in a future version."),drop:A_,filter:oa,flatMap:S_,map:Un,take:v_,compose:y_};aa.exports.promiseReturningOperators={every:b_,forEach:m_,reduce:__,toArray:E_,some:tc,find:w_}});var sa=_((F1,ic)=>{"use strict";u();var{ArrayPrototypePop:R_,Promise:x_}=H(),{isIterable:T_,isNodeStream:I_,isWebStream:O_}=Me(),{pipelineImpl:P_}=qn(),{finished:B_}=He();la();function M_(...t){return new x_((e,r)=>{let n,i,o=t[t.length-1];if(o&&typeof o=="object"&&!I_(o)&&!T_(o)&&!O_(o)){let a=R_(t);n=a.signal,i=a.end}P_(t,(a,s)=>{a?r(a):e(s)},{signal:n,end:i})})}ic.exports={finished:B_,pipeline:M_}});var la=_((U1,hc)=>{u();var{Buffer:k_}=de(),{ObjectDefineProperty:Ke,ObjectKeys:sc,ReflectApply:lc}=H(),{promisify:{custom:fc}}=ne(),{streamReturningOperators:oc,promiseReturningOperators:ac}=nc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:uc}}=ae(),L_=na(),{setDefaultHighWaterMark:C_,getDefaultHighWaterMark:N_}=Ar(),{pipeline:cc}=qn(),{destroyer:q_}=gt(),dc=He(),fa=sa(),kr=Me(),$=hc.exports=mn().Stream;$.isDestroyed=kr.isDestroyed;$.isDisturbed=kr.isDisturbed;$.isErrored=kr.isErrored;$.isReadable=kr.isReadable;$.isWritable=kr.isWritable;$.Readable=xr();for(let t of sc(oc)){let r=function(...n){if(new.target)throw uc();return $.Readable.from(lc(e,this,n))};ua=r;let e=oc[t];Ke(r,"name",{__proto__:null,value:e.name}),Ke(r,"length",{__proto__:null,value:e.length}),Ke($.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var ua;for(let t of sc(ac)){let r=function(...i){if(new.target)throw uc();return lc(e,this,i)};ua=r;let e=ac[t];Ke(r,"name",{__proto__:null,value:e.name}),Ke(r,"length",{__proto__:null,value:e.length}),Ke($.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var ua;$.Writable=kn();$.Duplex=Ce();$.Transform=Ho();$.PassThrough=Vo();$.pipeline=cc;var{addAbortSignal:D_}=Sr();$.addAbortSignal=D_;$.finished=dc;$.destroy=q_;$.compose=L_;$.setDefaultHighWaterMark=C_;$.getDefaultHighWaterMark=N_;Ke($,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return fa}});Ke(cc,fc,{__proto__:null,enumerable:!0,get(){return fa.pipeline}});Ke(dc,fc,{__proto__:null,enumerable:!0,get(){return fa.finished}});$.Stream=$;$._isUint8Array=function(e){return e instanceof Uint8Array};$._uint8ArrayToBuffer=function(e){return k_.from(e.buffer,e.byteOffset,e.byteLength)}});var vt=_(($1,O)=>{"use strict";u();var Y=vt();if(Y&&y.env.READABLE_STREAM==="disable"){let t=Y.promises;O.exports._uint8ArrayToBuffer=Y._uint8ArrayToBuffer,O.exports._isUint8Array=Y._isUint8Array,O.exports.isDisturbed=Y.isDisturbed,O.exports.isErrored=Y.isErrored,O.exports.isReadable=Y.isReadable,O.exports.Readable=Y.Readable,O.exports.Writable=Y.Writable,O.exports.Duplex=Y.Duplex,O.exports.Transform=Y.Transform,O.exports.PassThrough=Y.PassThrough,O.exports.addAbortSignal=Y.addAbortSignal,O.exports.finished=Y.finished,O.exports.destroy=Y.destroy,O.exports.pipeline=Y.pipeline,O.exports.compose=Y.compose,Object.defineProperty(Y,"promises",{configurable:!0,enumerable:!0,get(){return t}}),O.exports.Stream=Y.Stream}else{let t=la(),e=sa(),r=t.Readable.destroy;O.exports=t.Readable,O.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,O.exports._isUint8Array=t._isUint8Array,O.exports.isDisturbed=t.isDisturbed,O.exports.isErrored=t.isErrored,O.exports.isReadable=t.isReadable,O.exports.Readable=t.Readable,O.exports.Writable=t.Writable,O.exports.Duplex=t.Duplex,O.exports.Transform=t.Transform,O.exports.PassThrough=t.PassThrough,O.exports.addAbortSignal=t.addAbortSignal,O.exports.finished=t.finished,O.exports.destroy=t.destroy,O.exports.destroy=r,O.exports.pipeline=t.pipeline,O.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return e}}),O.exports.Stream=t.Stream}O.exports.default=O.exports});var gc=_((G1,yc)=>{u();yc.exports=pc;function pc(t,e){if(t&&e)return pc(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){r[n]=t[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=t.apply(this,n),a=n[n.length-1];return typeof o=="function"&&o!==a&&Object.keys(a).forEach(function(s){o[s]=a[s]}),o}}});var da=_((K1,ca)=>{u();var bc=gc();ca.exports=bc(Wn);ca.exports.strict=bc(wc);Wn.proto=Wn(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Wn(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return wc(this)},configurable:!0})});function Wn(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function wc(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var ha=_((Y1,_c)=>{u();var F_=da(),j_=function(){},U_=function(t){return t.setHeader&&typeof t.abort=="function"},W_=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},mc=function(t,e,r){if(typeof e=="function")return mc(t,null,e);e||(e={}),r=F_(r||j_);var n=t._writableState,i=t._readableState,o=e.readable||e.readable!==!1&&t.readable,a=e.writable||e.writable!==!1&&t.writable,s=!1,l=function(){t.writable||f()},f=function(){a=!1,o||r.call(t)},c=function(){o=!1,a||r.call(t)},d=function(A){r.call(t,A?new Error("exited with error code: "+A):null)},g=function(A){r.call(t,A)},p=function(){y.nextTick(E)},E=function(){if(!s){if(o&&!(i&&i.ended&&!i.destroyed))return r.call(t,new Error("premature close"));if(a&&!(n&&n.ended&&!n.destroyed))return r.call(t,new Error("premature close"))}},m=function(){t.req.on("finish",f)};return U_(t)?(t.on("complete",f),t.on("abort",p),t.req?m():t.on("request",m)):a&&!n&&(t.on("end",l),t.on("close",l)),W_(t)&&t.on("exit",d),t.on("end",c),t.on("finish",f),e.error!==!1&&t.on("error",g),t.on("close",p),function(){s=!0,t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",m),t.req&&t.req.removeListener("finish",f),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",f),t.removeListener("exit",d),t.removeListener("end",c),t.removeListener("error",g),t.removeListener("close",p)}};_c.exports=mc});var Ec=_(()=>{u()});var vc=_((ex,Ac)=>{u();var $_=da(),H_=ha(),pa=Ec(),Lr=function(){},G_=/^v?\.0/.test(y.version),$n=function(t){return typeof t=="function"},V_=function(t){return!G_||!pa?!1:(t instanceof(pa.ReadStream||Lr)||t instanceof(pa.WriteStream||Lr))&&$n(t.close)},K_=function(t){return t.setHeader&&$n(t.abort)},z_=function(t,e,r,n){n=$_(n);var i=!1;t.on("close",function(){i=!0}),H_(t,{readable:e,writable:r},function(a){if(a)return n(a);i=!0,n()});var o=!1;return function(a){if(!i&&!o){if(o=!0,V_(t))return t.close(Lr);if(K_(t))return t.abort();if($n(t.destroy))return t.destroy();n(a||new Error("stream was destroyed"))}}},Sc=function(t){t()},Y_=function(t,e){return t.pipe(e)},J_=function(){var t=Array.prototype.slice.call(arguments),e=$n(t[t.length-1]||Lr)&&t.pop()||Lr;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r,n=t.map(function(i,o){var a=o<t.length-1,s=o>0;return z_(i,a,s,function(l){r||(r=l),l&&n.forEach(Sc),!a&&(n.forEach(Sc),e(r))})});return t.reduce(Y_)};Ac.exports=J_});var ze=_((rx,ya)=>{u();typeof Object.create=="function"?ya.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ya.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var ga=_((ix,Rc)=>{u();Rc.exports=Ie().EventEmitter});var ba=_(()=>{u()});var Bc=_((fx,Pc)=>{"use strict";u();function xc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Tc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xc(Object(r),!0).forEach(function(n){X_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function X_(t,e,r){return e=Oc(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ic(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Oc(n.key),n)}}function Z_(t,e,r){return e&&Ic(t.prototype,e),r&&Ic(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Oc(t){var e=eE(t,"string");return typeof e=="symbol"?e:String(e)}function eE(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tE=de(),Hn=tE.Buffer,rE=ba(),wa=rE.inspect,nE=wa&&wa.custom||"inspect";function iE(t,e,r){Hn.prototype.copy.call(t,e,r)}Pc.exports=function(){function t(){Q_(this,t),this.head=null,this.tail=null,this.length=0}return Z_(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Hn.alloc(0);for(var n=Hn.allocUnsafe(r>>>0),i=this.head,o=0;i;)iE(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var a=n.data,s=r>a.length?a.length:r;if(s===a.length?o+=a:o+=a.slice(0,r),r-=s,r===0){s===a.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=Hn.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var a=i.data,s=r>a.length?a.length:r;if(a.copy(n,n.length-r,0,s),r-=s,r===0){s===a.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++o}return this.length-=o,n}},{key:nE,value:function(r,n){return wa(this,Tc(Tc({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var _a=_((cx,kc)=>{"use strict";u();function oE(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,y.nextTick(ma,this,t)):y.nextTick(ma,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?y.nextTick(Gn,r):(r._writableState.errorEmitted=!0,y.nextTick(Mc,r,o)):y.nextTick(Mc,r,o):e?(y.nextTick(Gn,r),e(o)):y.nextTick(Gn,r)}),this)}function Mc(t,e){ma(t,e),Gn(t)}function Gn(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function aE(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function ma(t,e){t.emit("error",e)}function sE(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}kc.exports={destroy:oE,undestroy:aE,errorOrDestroy:sE}});var Rt=_((hx,Nc)=>{"use strict";u();function lE(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Cc={};function ge(t,e,r){r||(r=Error);function n(o,a,s){return typeof e=="string"?e:e(o,a,s)}var i=function(o){lE(a,o);function a(s,l,f){return o.call(this,n(s,l,f))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=t,Cc[t]=i}function Lc(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function fE(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function uE(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function cE(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}ge("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);ge("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&fE(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(uE(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Lc(e,"type"));else{var o=cE(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(o," ").concat(n," ").concat(Lc(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);ge("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ge("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});ge("ERR_STREAM_PREMATURE_CLOSE","Premature close");ge("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});ge("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ge("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ge("ERR_STREAM_WRITE_AFTER_END","write after end");ge("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ge("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);ge("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Nc.exports.codes=Cc});var Ea=_((yx,qc)=>{"use strict";u();var dE=Rt().codes.ERR_INVALID_OPT_VALUE;function hE(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function pE(t,e,r,n){var i=hE(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new dE(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}qc.exports={getHighWaterMark:pE}});var Fc=_((bx,Dc)=>{u();Dc.exports=yE;function yE(t,e){if(Sa("noDeprecation"))return t;var r=!1;function n(){if(!r){if(Sa("throwDeprecation"))throw new Error(e);Sa("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function Sa(t){try{if(!b.localStorage)return!1}catch{return!1}var e=b.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var Ra=_((mx,Gc)=>{"use strict";u();Gc.exports=V;function Uc(t){var e=this;this.next=null,this.entry=null,this.finish=function(){WE(e,t)}}var Zt;V.WritableState=Nr;var gE={deprecate:Fc()},Wc=ga(),Kn=de().Buffer,bE=(typeof b<"u"?b:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function wE(t){return Kn.from(t)}function mE(t){return Kn.isBuffer(t)||t instanceof bE}var va=_a(),_E=Ea(),EE=_E.getHighWaterMark,it=Rt().codes,SE=it.ERR_INVALID_ARG_TYPE,AE=it.ERR_METHOD_NOT_IMPLEMENTED,vE=it.ERR_MULTIPLE_CALLBACK,RE=it.ERR_STREAM_CANNOT_PIPE,xE=it.ERR_STREAM_DESTROYED,TE=it.ERR_STREAM_NULL_VALUES,IE=it.ERR_STREAM_WRITE_AFTER_END,OE=it.ERR_UNKNOWN_ENCODING,er=va.errorOrDestroy;ze()(V,Wc);function PE(){}function Nr(t,e,r){Zt=Zt||xt(),t=t||{},typeof r!="boolean"&&(r=e instanceof Zt),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=EE(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){qE(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Uc(this)}Nr.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Nr.prototype,"buffer",{get:gE.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Vn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Vn=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(e){return Vn.call(this,e)?!0:this!==V?!1:e&&e._writableState instanceof Nr}})):Vn=function(e){return e instanceof this};function V(t){Zt=Zt||xt();var e=this instanceof Zt;if(!e&&!Vn.call(V,this))return new V(t);this._writableState=new Nr(t,this,e),this.writable=!0,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)),Wc.call(this)}V.prototype.pipe=function(){er(this,new RE)};function BE(t,e){var r=new IE;er(t,r),y.nextTick(e,r)}function ME(t,e,r,n){var i;return r===null?i=new TE:typeof r!="string"&&!e.objectMode&&(i=new SE("chunk",["string","Buffer"],r)),i?(er(t,i),y.nextTick(n,i),!1):!0}V.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&mE(t);return o&&!Kn.isBuffer(t)&&(t=wE(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=PE),n.ending?BE(this,r):(o||ME(this,n,t,r))&&(n.pendingcb++,i=LE(this,n,o,t,e,r)),i};V.prototype.cork=function(){this._writableState.corked++};V.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&$c(this,t))};V.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new OE(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(V.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function kE(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Kn.from(e,r)),e}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function LE(t,e,r,n,i,o){if(!r){var a=kE(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Aa(t,e,!1,s,n,i,o);return l}function Aa(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new xE("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function CE(t,e,r,n,i){--e.pendingcb,r?(y.nextTick(i,n),y.nextTick(Cr,t,e),t._writableState.errorEmitted=!0,er(t,n)):(i(n),t._writableState.errorEmitted=!0,er(t,n),Cr(t,e))}function NE(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function qE(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new vE;if(NE(r),e)CE(t,r,n,e,i);else{var o=Hc(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&$c(t,r),n?y.nextTick(jc,t,r,o,i):jc(t,r,o,i)}}function jc(t,e,r,n){r||DE(t,e),e.pendingcb--,n(),Cr(t,e)}function DE(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function $c(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;i.allBuffers=s,Aa(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Uc(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,f=r.encoding,c=r.callback,d=e.objectMode?1:l.length;if(Aa(t,e,!1,d,l,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}V.prototype._write=function(t,e,r){r(new AE("_write()"))};V.prototype._writev=null;V.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||UE(this,n,r),this};Object.defineProperty(V.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Hc(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function FE(t,e){t._final(function(r){e.pendingcb--,r&&er(t,r),e.prefinished=!0,t.emit("prefinish"),Cr(t,e)})}function jE(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,y.nextTick(FE,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Cr(t,e){var r=Hc(e);if(r&&(jE(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function UE(t,e,r){e.ending=!0,Cr(t,e),r&&(e.finished?y.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function WE(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(V.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});V.prototype.destroy=va.destroy;V.prototype._undestroy=va.undestroy;V.prototype._destroy=function(t,e){e(t)}});var xt=_((Ex,Kc)=>{"use strict";u();var $E=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Kc.exports=qe;var Vc=Ia(),Ta=Ra();ze()(qe,Vc);for(xa=$E(Ta.prototype),zn=0;zn<xa.length;zn++)Yn=xa[zn],qe.prototype[Yn]||(qe.prototype[Yn]=Ta.prototype[Yn]);var xa,Yn,zn;function qe(t){if(!(this instanceof qe))return new qe(t);Vc.call(this,t),Ta.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",HE)))}Object.defineProperty(qe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(qe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(qe.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function HE(){this._writableState.ended||y.nextTick(GE,this)}function GE(t){t.end()}Object.defineProperty(qe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Jn=_((Ax,Jc)=>{"use strict";u();var zc=Rt().codes.ERR_STREAM_PREMATURE_CLOSE;function VE(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function KE(){}function zE(t){return t.setHeader&&typeof t.abort=="function"}function Yc(t,e,r){if(typeof e=="function")return Yc(t,null,e);e||(e={}),r=VE(r||KE);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||s()},a=t._writableState&&t._writableState.finished,s=function(){i=!1,a=!0,n||r.call(t)},l=t._readableState&&t._readableState.endEmitted,f=function(){n=!1,l=!0,i||r.call(t)},c=function(E){r.call(t,E)},d=function(){var E;if(n&&!l)return(!t._readableState||!t._readableState.ended)&&(E=new zc),r.call(t,E);if(i&&!a)return(!t._writableState||!t._writableState.ended)&&(E=new zc),r.call(t,E)},g=function(){t.req.on("finish",s)};return zE(t)?(t.on("complete",s),t.on("abort",d),t.req?g():t.on("request",g)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",f),t.on("finish",s),e.error!==!1&&t.on("error",c),t.on("close",d),function(){t.removeListener("complete",s),t.removeListener("abort",d),t.removeListener("request",g),t.req&&t.req.removeListener("finish",s),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",s),t.removeListener("end",f),t.removeListener("error",c),t.removeListener("close",d)}}Jc.exports=Yc});var Qc=_((Rx,Xc)=>{"use strict";u();var Xn;function ot(t,e,r){return e=YE(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function YE(t){var e=JE(t,"string");return typeof e=="symbol"?e:String(e)}function JE(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var XE=Jn(),at=Symbol("lastResolve"),Tt=Symbol("lastReject"),qr=Symbol("error"),Qn=Symbol("ended"),It=Symbol("lastPromise"),Oa=Symbol("handlePromise"),Ot=Symbol("stream");function st(t,e){return{value:t,done:e}}function QE(t){var e=t[at];if(e!==null){var r=t[Ot].read();r!==null&&(t[It]=null,t[at]=null,t[Tt]=null,e(st(r,!1)))}}function ZE(t){y.nextTick(QE,t)}function eS(t,e){return function(r,n){t.then(function(){if(e[Qn]){r(st(void 0,!0));return}e[Oa](r,n)},n)}}var tS=Object.getPrototypeOf(function(){}),rS=Object.setPrototypeOf((Xn={get stream(){return this[Ot]},next:function(){var e=this,r=this[qr];if(r!==null)return Promise.reject(r);if(this[Qn])return Promise.resolve(st(void 0,!0));if(this[Ot].destroyed)return new Promise(function(a,s){y.nextTick(function(){e[qr]?s(e[qr]):a(st(void 0,!0))})});var n=this[It],i;if(n)i=new Promise(eS(n,this));else{var o=this[Ot].read();if(o!==null)return Promise.resolve(st(o,!1));i=new Promise(this[Oa])}return this[It]=i,i}},ot(Xn,Symbol.asyncIterator,function(){return this}),ot(Xn,"return",function(){var e=this;return new Promise(function(r,n){e[Ot].destroy(null,function(i){if(i){n(i);return}r(st(void 0,!0))})})}),Xn),tS),nS=function(e){var r,n=Object.create(rS,(r={},ot(r,Ot,{value:e,writable:!0}),ot(r,at,{value:null,writable:!0}),ot(r,Tt,{value:null,writable:!0}),ot(r,qr,{value:null,writable:!0}),ot(r,Qn,{value:e._readableState.endEmitted,writable:!0}),ot(r,Oa,{value:function(o,a){var s=n[Ot].read();s?(n[It]=null,n[at]=null,n[Tt]=null,o(st(s,!1))):(n[at]=o,n[Tt]=a)},writable:!0}),r));return n[It]=null,XE(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Tt];o!==null&&(n[It]=null,n[at]=null,n[Tt]=null,o(i)),n[qr]=i;return}var a=n[at];a!==null&&(n[It]=null,n[at]=null,n[Tt]=null,a(st(void 0,!0))),n[Qn]=!0}),e.on("readable",ZE.bind(null,n)),n};Xc.exports=nS});var ed=_((Tx,Zc)=>{u();Zc.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Ia=_((Px,ud)=>{"use strict";u();ud.exports=N;var tr;N.ReadableState=id;var Ox=Ie().EventEmitter,nd=function(e,r){return e.listeners(r).length},Fr=ga(),Zn=de().Buffer,iS=(typeof b<"u"?b:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function oS(t){return Zn.from(t)}function aS(t){return Zn.isBuffer(t)||t instanceof iS}var Pa=ba(),T;Pa&&Pa.debuglog?T=Pa.debuglog("stream"):T=function(){};var sS=Bc(),qa=_a(),lS=Ea(),fS=lS.getHighWaterMark,ei=Rt().codes,uS=ei.ERR_INVALID_ARG_TYPE,cS=ei.ERR_STREAM_PUSH_AFTER_EOF,dS=ei.ERR_METHOD_NOT_IMPLEMENTED,hS=ei.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,rr,Ba,Ma;ze()(N,Fr);var Dr=qa.errorOrDestroy,ka=["error","close","destroy","pause","resume"];function pS(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function id(t,e,r){tr=tr||xt(),t=t||{},typeof r!="boolean"&&(r=e instanceof tr),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=fS(this,t,"readableHighWaterMark",r),this.buffer=new sS,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(rr||(rr=An().StringDecoder),this.decoder=new rr(t.encoding),this.encoding=t.encoding)}function N(t){if(tr=tr||xt(),!(this instanceof N))return new N(t);var e=this instanceof tr;this._readableState=new id(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Fr.call(this)}Object.defineProperty(N.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});N.prototype.destroy=qa.destroy;N.prototype._undestroy=qa.undestroy;N.prototype._destroy=function(t,e){e(t)};N.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Zn.from(t,e),e=""),n=!0),od(this,t,e,!1,n)};N.prototype.unshift=function(t){return od(this,t,null,!0,!1)};function od(t,e,r,n,i){T("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,bS(t,o);else{var a;if(i||(a=yS(o,e)),a)Dr(t,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Zn.prototype&&(e=oS(e)),n)o.endEmitted?Dr(t,new hS):La(t,o,e,!0);else if(o.ended)Dr(t,new cS);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?La(t,o,e,!1):Na(t,o)):La(t,o,e,!1)}else n||(o.reading=!1,Na(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function La(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&ti(t)),Na(t,e)}function yS(t,e){var r;return!aS(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new uS("chunk",["string","Buffer","Uint8Array"],e)),r}N.prototype.isPaused=function(){return this._readableState.flowing===!1};N.prototype.setEncoding=function(t){rr||(rr=An().StringDecoder);var e=new rr(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var td=1073741824;function gS(t){return t>=td?t=td:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function rd(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=gS(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}N.prototype.read=function(t){T("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return T("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Ca(this):ti(this),null;if(t=rd(t,e),t===0&&e.ended)return e.length===0&&Ca(this),null;var n=e.needReadable;T("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,T("length less than watermark",n)),e.ended||e.reading?(n=!1,T("reading or ended",n)):n&&(T("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=rd(r,e)));var i;return t>0?i=ld(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Ca(this)),i!==null&&this.emit("data",i),i};function bS(t,e){if(T("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?ti(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,ad(t)))}}function ti(t){var e=t._readableState;T("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(T("emitReadable",e.flowing),e.emittedReadable=!0,y.nextTick(ad,t))}function ad(t){var e=t._readableState;T("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Da(t)}function Na(t,e){e.readingMore||(e.readingMore=!0,y.nextTick(wS,t,e))}function wS(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(T("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}N.prototype._read=function(t){Dr(this,new dS("_read()"))};N.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,T("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==y.stdout&&t!==y.stderr,o=i?s:m;n.endEmitted?y.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(A,S){T("onunpipe"),A===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,c())}function s(){T("onend"),t.end()}var l=mS(r);t.on("drain",l);var f=!1;function c(){T("cleanup"),t.removeListener("close",p),t.removeListener("finish",E),t.removeListener("drain",l),t.removeListener("error",g),t.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",d),f=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l()}r.on("data",d);function d(A){T("ondata");var S=t.write(A);T("dest.write",S),S===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&fd(n.pipes,t)!==-1)&&!f&&(T("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function g(A){T("onerror",A),m(),t.removeListener("error",g),nd(t,"error")===0&&Dr(t,A)}pS(t,"error",g);function p(){t.removeListener("finish",E),m()}t.once("close",p);function E(){T("onfinish"),t.removeListener("close",p),m()}t.once("finish",E);function m(){T("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(T("pipe resume"),r.resume()),t};function mS(t){return function(){var r=t._readableState;T("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&nd(t,"data")&&(r.flowing=!0,Da(t))}}N.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=fd(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};N.prototype.on=function(t,e){var r=Fr.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,T("on readable",n.length,n.reading),n.length?ti(this):n.reading||y.nextTick(_S,this)),r};N.prototype.addListener=N.prototype.on;N.prototype.removeListener=function(t,e){var r=Fr.prototype.removeListener.call(this,t,e);return t==="readable"&&y.nextTick(sd,this),r};N.prototype.removeAllListeners=function(t){var e=Fr.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&y.nextTick(sd,this),e};function sd(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function _S(t){T("readable nexttick read 0"),t.read(0)}N.prototype.resume=function(){var t=this._readableState;return t.flowing||(T("resume"),t.flowing=!t.readableListening,ES(this,t)),t.paused=!1,this};function ES(t,e){e.resumeScheduled||(e.resumeScheduled=!0,y.nextTick(SS,t,e))}function SS(t,e){T("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Da(t),e.flowing&&!e.reading&&t.read(0)}N.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Da(t){var e=t._readableState;for(T("flow",e.flowing);e.flowing&&t.read()!==null;);}N.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(T("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(T("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=e.push(a);s||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(s){return function(){return t[s].apply(t,arguments)}}(i));for(var o=0;o<ka.length;o++)t.on(ka[o],this.emit.bind(this,ka[o]));return this._read=function(a){T("wrapped _read",a),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(N.prototype[Symbol.asyncIterator]=function(){return Ba===void 0&&(Ba=Qc()),Ba(this)});Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(N.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(N.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});N._fromList=ld;Object.defineProperty(N.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ld(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Ca(t){var e=t._readableState;T("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,y.nextTick(AS,e,t))}function AS(t,e){if(T("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(N.from=function(t,e){return Ma===void 0&&(Ma=ed()),Ma(N,t,e)});function fd(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var Fa=_((Mx,dd)=>{"use strict";u();dd.exports=Ye;var ri=Rt().codes,vS=ri.ERR_METHOD_NOT_IMPLEMENTED,RS=ri.ERR_MULTIPLE_CALLBACK,xS=ri.ERR_TRANSFORM_ALREADY_TRANSFORMING,TS=ri.ERR_TRANSFORM_WITH_LENGTH_0,ni=xt();ze()(Ye,ni);function IS(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new RS);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ye(t){if(!(this instanceof Ye))return new Ye(t);ni.call(this,t),this._transformState={afterTransform:IS.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",OS)}function OS(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){cd(t,e,r)}):cd(this,null,null)}Ye.prototype.push=function(t,e){return this._transformState.needTransform=!1,ni.prototype.push.call(this,t,e)};Ye.prototype._transform=function(t,e,r){r(new vS("_transform()"))};Ye.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ye.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Ye.prototype._destroy=function(t,e){ni.prototype._destroy.call(this,t,function(r){e(r)})};function cd(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new TS;if(t._transformState.transforming)throw new xS;return t.push(null)}});var yd=_((Lx,pd)=>{"use strict";u();pd.exports=jr;var hd=Fa();ze()(jr,hd);function jr(t){if(!(this instanceof jr))return new jr(t);hd.call(this,t)}jr.prototype._transform=function(t,e,r){r(null,t)}});var _d=_((Nx,md)=>{"use strict";u();var ja;function PS(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var wd=Rt().codes,BS=wd.ERR_MISSING_ARGS,MS=wd.ERR_STREAM_DESTROYED;function gd(t){if(t)throw t}function kS(t){return t.setHeader&&typeof t.abort=="function"}function LS(t,e,r,n){n=PS(n);var i=!1;t.on("close",function(){i=!0}),ja===void 0&&(ja=Jn()),ja(t,{readable:e,writable:r},function(a){if(a)return n(a);i=!0,n()});var o=!1;return function(a){if(!i&&!o){if(o=!0,kS(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(a||new MS("pipe"))}}}function bd(t){t()}function CS(t,e){return t.pipe(e)}function NS(t){return!t.length||typeof t[t.length-1]!="function"?gd:t.pop()}function qS(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=NS(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new BS("streams");var i,o=e.map(function(a,s){var l=s<e.length-1,f=s>0;return LS(a,l,f,function(c){i||(i=c),c&&o.forEach(bd),!l&&(o.forEach(bd),n(i))})});return e.reduce(CS)}md.exports=qS});var Sd=_((be,Ed)=>{u();be=Ed.exports=Ia();be.Stream=be;be.Readable=be;be.Writable=Ra();be.Duplex=xt();be.Transform=Fa();be.PassThrough=yd();be.finished=Jn();be.pipeline=_d()});var vd=_((Fx,Ad)=>{u();Ad.exports=DS;function DS(t){var e=t._readableState;return e?e.objectMode||typeof t._duplexState=="number"?t.read():t.read(FS(e)):null}function FS(t){if(t.buffer.length){var e=t.bufferIndex||0;if(t.buffer.head)return t.buffer.head.data.length;if(t.buffer.length-e>0&&t.buffer[e])return t.buffer[e].length}return t.length}});var Od=_((Ux,Id)=>{u();var ii=Sd(),Rd=ha(),jS=ze(),US=vd(),xd=h.Buffer.from&&h.Buffer.from!==Uint8Array.from?h.Buffer.from([0]):new h.Buffer([0]),Ua=function(t,e){t._corked?t.once("uncork",e):e()},WS=function(t,e){t._autoDestroy&&t.destroy(e)},Td=function(t,e){return function(r){r?WS(t,r.message==="premature close"?null:r):e&&!t._ended&&t.end()}},$S=function(t,e){if(!t||t._writableState&&t._writableState.finished)return e();if(t._writableState)return t.end(e);t.end(),e()},HS=function(){},GS=function(t){return new ii.Readable({objectMode:!0,highWaterMark:16}).wrap(t)},re=function(t,e,r){if(!(this instanceof re))return new re(t,e,r);ii.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||r.autoDestroy!==!1,this._forwardDestroy=!r||r.destroy!==!1,this._forwardEnd=!r||r.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};jS(re,ii.Duplex);re.obj=function(t,e,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new re(t,e,r)};re.prototype.cork=function(){++this._corked===1&&this.emit("cork")};re.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};re.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.end();return}var e=this,r=Rd(t,{writable:!0,readable:!1},Td(this,this._forwardEnd)),n=function(){var o=e._ondrain;e._ondrain=null,o&&o()},i=function(){e._writable.removeListener("drain",n),r()};this._unwrite&&y.nextTick(n),this._writable=t,this._writable.on("drain",n),this._unwrite=i,this.uncork()};re.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.push(null),this.resume();return}var e=this,r=Rd(t,{writable:!1,readable:!0},Td(this)),n=function(){e._forward()},i=function(){e.push(null)},o=function(){e._readable2.removeListener("readable",n),e._readable2.removeListener("end",i),r()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:GS(t),this._readable2.on("readable",n),this._readable2.on("end",i),this._unread=o,this._forward()};re.prototype._read=function(){this._drained=!0,this._forward()};re.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var t;this._drained&&(t=US(this._readable2))!==null;)this.destroyed||(this._drained=this.push(t));this._forwarding=!1}};re.prototype.destroy=function(t,e){if(e||(e=HS),this.destroyed)return e(null);this.destroyed=!0;var r=this;y.nextTick(function(){r._destroy(t),e(null)})};re.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};re.prototype._write=function(t,e,r){if(!this.destroyed){if(this._corked)return Ua(this,this._write.bind(this,t,e,r));if(t===xd)return this._finish(r);if(!this._writable)return r();this._writable.write(t)===!1?this._ondrain=r:this.destroyed||r()}};re.prototype._finish=function(t){var e=this;this.emit("preend"),Ua(this,function(){$S(e._forwardEnd&&e._writable,function(){e._writableState.prefinished===!1&&(e._writableState.prefinished=!0),e.emit("prefinish"),Ua(e,t)})})};re.prototype.end=function(t,e,r){return typeof t=="function"?this.end(null,null,t):typeof e=="function"?this.end(t,null,e):(this._ended=!0,t&&this.write(t),!this._writableState.ending&&!this._writableState.destroyed&&this.write(xd),ii.Writable.prototype.end.call(this,r))};Id.exports=re});var Md=_(($x,oi)=>{u();var VS=vc(),KS=ze(),Pd=Od(),Bd=function(t){return t.length?Array.isArray(t[0])?t[0]:Array.prototype.slice.call(t):[]},Wa=function(t){var e=function(){var r=Bd(arguments);if(!(this instanceof e))return new e(r);Pd.call(this,null,null,t),r.length&&this.setPipeline(r)};return KS(e,Pd),e.prototype.setPipeline=function(){var r=Bd(arguments),n=this,i=!1,o=r[0],a=r[r.length-1];a=a.readable?a:null,o=o.writable?o:null;var s=function(){r[0].emit("error",new Error("stream was destroyed"))};if(this.on("close",s),this.on("prefinish",function(){i||n.cork()}),VS(r,function(l){if(n.removeListener("close",s),l)return n.destroy(l.message==="premature close"?null:l);i=!0,n._autoDestroy===!1&&(n._autoDestroy=!0),n.uncork()}),this.destroyed)return s();this.setWritable(o),this.setReadable(a)},e};oi.exports=Wa({autoDestroy:!1,destroy:!1});oi.exports.obj=Wa({autoDestroy:!1,destroy:!1,objectMode:!0,highWaterMark:16});oi.exports.ctor=Wa});function ai(t,e){let r=[],n;t.on("data",i=>r.push(i)),t.on("end",()=>{n||(n=!0,e(null,h.Buffer.concat(r)))}),t.on("error",i=>{n||(n=!0,e(i))})}function si(t){let e;return new $a.Transform({transform(r,n,i){e&&(r=h.Buffer.concat([e,r]));let o=Math.floor(r.length/t)*t;o?r.length>o?(e=r.slice(o),this.push(r.slice(0,o))):(e=void 0,this.push(r)):e=e?h.Buffer.concat([e,r]):r,i()},flush(r){e&&this.push(e),r()}})}function kd(t,e){let r=[],n=0;return new $a.Transform({transform(i,o,a){r.push(i),n+=i.length,a()},flush(i){e(n);function o(){for(;r.length;)if(!t.write(r.shift()))return t.once("drain",o);t.end(),i()}o()}})}function J(t){let e,r=new Promise((n,i)=>{e=(o,a)=>{o?i(o):n(a)}});return t&&r.then(n=>t(null,n),t),[e,r]}var $a,nr=_e(()=>{u();$a=Re(vt(),1)});var ir,Ld=_e(()=>{u();ir=class{constructor(e){this._tables[0][0][0]||this._precompute();let r,n,i,o,a,s=this._tables[0][4],l=this._tables[1],f=e.length,c=1;if(f!==4&&f!==6&&f!==8)throw new Error("invalid aes key size");for(this._key=[o=e.slice(0),a=[]],r=f;r<4*f+28;r++)i=o[r-1],(r%f===0||f===8&&r%f===4)&&(i=s[i>>>24]<<24^s[i>>16&255]<<16^s[i>>8&255]<<8^s[i&255],r%f===0&&(i=i<<8^i>>>24^c<<24,c=c<<1^(c>>7)*283)),o[r]=o[r-f]^i;for(n=0;r;n++,r--)i=o[n&3?r:r-4],r<=4||n<4?a[n]=i:a[n]=l[0][s[i>>>24]]^l[1][s[i>>16&255]]^l[2][s[i>>8&255]]^l[3][s[i&255]]}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],r=this._tables[1],n=e[4],i=r[4],o,a,s,l=[],f=[],c,d,g,p,E,m;for(o=0;o<256;o++)f[(l[o]=o<<1^(o>>7)*283)^o]=o;for(a=s=0;!n[a];a^=c||1,s=f[s]||1)for(p=s^s<<1^s<<2^s<<3^s<<4,p=p>>8^p&255^99,n[a]=p,i[p]=a,g=l[d=l[c=l[a]]],m=g*16843009^d*65537^c*257^a*16843008,E=l[p]*257^p*16843008,o=0;o<4;o++)e[o][a]=E=E<<24^E>>>8,r[o][p]=m=m<<24^m>>>8;for(o=0;o<5;o++)e[o]=e[o].slice(0),r[o]=r[o].slice(0)}_crypt(e,r){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[r],i=e[0]^n[0],o=e[r?3:1]^n[1],a=e[2]^n[2],s=e[r?1:3]^n[3],l,f,c,d=n.length/4-2,g,p=4,E=[0,0,0,0],m=this._tables[r],A=m[0],S=m[1],R=m[2],k=m[3],v=m[4];for(g=0;g<d;g++)l=A[i>>>24]^S[o>>16&255]^R[a>>8&255]^k[s&255]^n[p],f=A[o>>>24]^S[a>>16&255]^R[s>>8&255]^k[i&255]^n[p+1],c=A[a>>>24]^S[s>>16&255]^R[i>>8&255]^k[o&255]^n[p+2],s=A[s>>>24]^S[i>>16&255]^R[o>>8&255]^k[a&255]^n[p+3],p+=4,i=l,o=f,a=c;for(g=0;g<4;g++)E[r?3&-g:g]=v[i>>>24]<<24^v[o>>16&255]<<16^v[a>>8&255]<<8^v[s&255]^n[p++],l=i,i=o,o=a,a=s,s=l;return E}};ir.prototype._tables=[[[],[],[],[],[]],[[],[],[],[],[]]]});function Ha(t){let e,r,n,i=[2479122403,2108737444,3518906241,22203222],o=h.Buffer.alloc(Math.ceil(t.length/4)*4);for(o.set(t,0),n=65536;n--;)for(r=0;r<t.length;r+=16){let s=[0,0,0,0];for(e=0;e<16;e+=4)e+r<t.length&&(s[e/4]=o.readInt32BE(e+r));i=new ir(s).encrypt(i)}let a=h.Buffer.allocUnsafe(16);for(e=0;e<4;e++)a.writeInt32BE(i[e],e*4);return a}function Ga(t,e,r){let n=h.Buffer.from(e.s,"base64"),i=1e5,o="SHA-512";Promise.resolve().then(()=>globalThis.crypto.subtle.importKey("raw",t,"PBKDF2",!1,["deriveKey","deriveBits"])).then(a=>globalThis.crypto.subtle.deriveBits({name:"PBKDF2",salt:n,iterations:i,hash:{name:o}},a,256)).then(a=>{r(null,h.Buffer.from(a))}).catch(r)}var oe,Ur,or,Cd=_e(()=>{u();Ld();oe=class{constructor(e){if(e.length!==16)throw Error("Wrong key length. Key must be 128bit.");let r=[];for(let n=0;n<4;n++)r[n]=e.readInt32BE(n*4);this.aes=new ir(r)}encryptCBC(e){let r=[0,0,0,0],n=Array(4),i,o;for(i=0;i<e.length;i+=16){for(o=0;o<4;o++)n[o]=e.readUInt32BE(i+o*4)^r[o];for(r=this.aes.encrypt(n),o=0;o<4;o++)e.writeInt32BE(r[o],i+o*4)}}decryptCBC(e){let r=[0,0,0,0],n=Array(4),i=Array(4),o,a;for(o=0;o<e.length;o+=16){for(a=0;a<4;a++)n[a]=e.readUInt32BE(o+a*4);for(i=n,n=this.aes.decrypt(n),a=0;a<4;a++)e.writeInt32BE(n[a]^r[a],o+a*4);r=i}}stringhash(e){let r=[0,0,0,0];for(let i=0;i<e.length;i+=4)if(e.length-i<4){let o=e.length-i;r[i/4&3]^=e.readIntBE(i,o)<<(4-o)*8}else r[i/4&3]^=e.readInt32BE(i);for(let i=16384;i--;)r=this.aes.encrypt(r);let n=h.Buffer.allocUnsafe(8);return n.writeInt32BE(r[0],0),n.writeInt32BE(r[2],4),n}encryptECB(e){let r=[];for(let n=0;n<e.length;n+=16)r[0]=e.readInt32BE(n),r[1]=e.readInt32BE(n+4),r[2]=e.readInt32BE(n+8),r[3]=e.readInt32BE(n+12),r=this.aes.encrypt(r),e.writeInt32BE(r[0],n),e.writeInt32BE(r[1],n+4),e.writeInt32BE(r[2],n+8),e.writeInt32BE(r[3],n+12);return e}decryptECB(e){let r=[];for(let n=0;n<e.length;n+=16)r[0]=e.readInt32BE(n),r[1]=e.readInt32BE(n+4),r[2]=e.readInt32BE(n+8),r[3]=e.readInt32BE(n+12),r=this.aes.decrypt(r),e.writeInt32BE(r[0],n),e.writeInt32BE(r[1],n+4),e.writeInt32BE(r[2],n+8),e.writeInt32BE(r[3],n+12);return e}},Ur=class{constructor(e,r,n=0){this.aes=e,this.nonce=r.slice(0,8),this.increment=131072,this.posNext=this.increment,this.pos=0,this.ctr=h.Buffer.alloc(16),this.nonce.copy(this.ctr,0),this.incrementCTR(n/16)}encrypt(e){for(let r=0;r<e.length;r+=16){let n=this.aes.encryptECB(h.Buffer.from(this.ctr));for(let i=0;i<16;i++)e[r+i]^=n[i];this.incrementCTR()}return e}decrypt(e){for(let r=0;r<e.length;r+=16){let n=this.aes.encryptECB(h.Buffer.from(this.ctr));for(let i=0;i<16;i++)e[r+i]^=n[i];this.incrementCTR()}return e}incrementCTR(e=1){let r=this.ctr,n=15,i;for(;e!==0;)i=(e+r[n])%256,e=Math.floor((e+r[n])/256),r[n]=i,n-=1,n<0&&(n=15)}},or=class{constructor(e,r,n=0){this.aes=e,this.nonce=r.slice(0,8),this.increment=131072,this.posNext=this.increment,this.pos=0,this.mac=h.Buffer.alloc(16),this.nonce.copy(this.mac,0),this.nonce.copy(this.mac,8),this.macs=[]}condense(){this.mac&&(this.macs.push(this.mac),this.mac=void 0);let e=h.Buffer.alloc(16);for(let n=0;n<this.macs.length;n++){for(let i=0;i<16;i++)e[i]^=this.macs[n][i];this.aes.encryptECB(e)}let r=h.Buffer.allocUnsafe(8);return r.writeInt32BE(e.readInt32BE(0)^e.readInt32BE(4),0),r.writeInt32BE(e.readInt32BE(8)^e.readInt32BE(12),4),r}update(e){for(let r=0;r<e.length;r+=16){for(let n=0;n<16;n++)this.mac[n]^=e[r+n];this.aes.encryptECB(this.mac),this.checkBounding()}}checkBounding(){this.pos+=16,this.pos>=this.posNext&&(this.macs.push(h.Buffer.from(this.mac)),this.nonce.copy(this.mac,0),this.nonce.copy(this.mac,8),this.increment<1048576&&(this.increment+=131072),this.posNext+=this.increment)}}});function se(t){return typeof t=="string"?ar(t):t}function U(t){return t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ar(t){return h.Buffer.from(t,"base64")}function Ae(t){return new oe(Va(t).slice(0,16))}function ui(t,e={}){let r=e.start||0;if(r!==0)throw Error("Encryption cannot start midstream otherwise MAC verification will fail.");t=se(t),t||(t=globalThis.crypto.getRandomValues(new Uint8Array(24))),t instanceof h.Buffer||(t=h.Buffer.from(t));let n=new li.Transform({transform(s,l,f){a.update(s);let c=o.encrypt(s);f(null,h.Buffer.from(c))},flush(s){n.mac=a.condense(),n.key=zS(t,n.mac),s()}});if(t.length!==24)throw Error("Wrong key length. Key must be 192bit.");let i=new oe(t.slice(0,16)),o=new Ur(i,t.slice(16),r),a=new or(i,t.slice(16));return n=(0,fi.default)(si(16),n),n}function ci(t,e={}){let r=e.start||0;if(r!==0&&(e.disableVerification=!0),r%16!==0)throw Error("start argument of megaDecrypt must be a multiple of 16");t=se(t),t instanceof h.Buffer||(t=h.Buffer.from(t));let n=Ae(t),i=new Ur(n,t.slice(16),r),o=!e.disableVerification&&new or(n,t.slice(16)),a=new li.Transform({transform(s,l,f){let c=i.decrypt(s);o&&o.update(c),f(null,h.Buffer.from(c))},flush(s){if(o&&(a.mac=o.condense()),!e.disableVerification&&!a.mac.equals(t.slice(24))){s(Error("MAC verification failed"));return}s()}});return a=(0,fi.default)(si(16),a),a}function Nd(t){t=se(t),t instanceof h.Buffer||(t=h.Buffer.from(t));let e=new li.Transform({transform(i,o,a){n.update(i),a(null)},flush(i){if(e.mac=n.condense(),!e.mac.equals(t.slice(24))){i(Error("MAC verification failed"));return}i()}});if(t.length!==32)throw Error("Wrong key length. Key must be 256bit.");let r=Ae(t),n=new or(r,t.slice(16));return e=(0,fi.default)(si(16),e),e}function Va(t){let e=h.Buffer.alloc(32);t.copy(e);for(let r=0;r<16;r++)e.writeUInt8(e.readUInt8(r)^e.readUInt8(16+r,!0),r);return e}function zS(t,e){let r=h.Buffer.alloc(32);t.copy(r),e.copy(r,24);for(let n=0;n<16;n++)r.writeUInt8(r.readUInt8(n)^r.readUInt8(16+n),n);return r}function qd(t,e){if(t.length!==e.length)return!1;let r=t.length,n=0;for(let i=0;i<r;i++)n|=t[i]^e[i];return n===0}async function Dd(t){let[e,r,,n]=t.split(":");if(Number(e)!==1)throw Error("hashcash challenge is not version 1");let o=Number(r),a=((o&63)<<1)+1,s=(o>>6)*7+3,l=a<<s,f=ar(n),c=h.Buffer.alloc(4+262144*48);for(let d=0;d<262144;d++)c.set(f,4+d*48);for(;;){if(new DataView(await globalThis.crypto.subtle.digest("SHA-256",c)).getUint32(0)<=l)return`1:${n}:${U(c.slice(0,4))}`;let g=0;for(;c[g]++,!c[g++];);}}var li,fi,sr=_e(()=>{u();li=Re(vt(),1),fi=Re(Md(),1);nr();Cd()});function Hr(t){let e=[];for(;t-- >0;)e[t]=0;return e}function Gr(t){let e=t.length;if(t[e-1])return t;for(;e>1&&t[e-1]===0;)e--;return t.slice(0,e)}function JS(t){let e=1,r;return(r=t>>>16)!==0&&(t=r,e+=16),(r=t>>8)!==0&&(t=r,e+=8),(r=t>>4)!==0&&(t=r,e+=4),(r=t>>2)!==0&&(t=r,e+=2),(r=t>>1)!==0&&(t=r,e+=1),e}function jd(t,e){let r=t.length,n=e.length;if(r<n)return jd(e,t);let i=[],o=0,a=0;for(;a<n;a++)o+=t[a]+e[a],i[a]=o&268435455,o>>>=28;for(;a<r;a++)o+=t[a],i[a]=o&268435455,o>>>=28;return o&&(i[a]=o),i}function we(t,e){let r=t.length,n=e.length;if(n>r)return[];if(n===r){if(e[n-1]>t[n-1])return[];if(n===1)return[t[0]-e[0]]}let i=[],o=0,a;for(a=0;a<n;a++)o+=t[a]-e[a],i[a]=o&268435455,o>>=28;for(;a<r;a++)o+=t[a],i[a]=o&268435455,o>>=28;return o?[]:Gr(i)}function Ka(t,e,r,n,i){let o=r&16383,a=r>>14,s=n&16383,l=n>>14,f=a*s+l*o,c=o*s+((f&16383)<<14)+t[e]+i;return t[e]=c&268435455,i=a*l+(f>>14)+(c>>28),i}function XS(t){let e=t.length,r=2*e,n=Hr(r),i=0,o,a;for(o=0;o<e;o++){for(i=Ka(n,2*o,t[o],t[o],0),a=o+1;a<e;a++)i=Ka(n,o+a,2*t[a],t[o],i);n[o+e]=i}return Gr(n)}function lt(t,e){let r=t.length,n=e.length,i=Hr(r+n-1),o,a,s;for(a=0;a<n;a++){for(o=0,s=0;s<r;s++)o=Ka(i,a+s,t[s],e[a],o);i[a+r]=o}return Gr(i)}function Wr(t,e,r){let n=0;for(;e>=0&&r-- >0;)n=n*268435456+t[e--];return n}function Ud(t,e){let r=t.length-1,n=e.length-1,i=r-n,o,a,s,l;if(r<n||r===n&&(t[r]<e[r]||r>0&&t[r]===e[r]&&t[r-1]<e[r-1]))return Je.q=[0],Je.mod=t,Je;if(r===n&&Wr(t,n,2)/Wr(e,n,2)<4){for(o=t.concat(),a=0;s=we(o,e),s.length!==0;)o=s,a++;return Je.q=[a],Je.mod=o,Je}let f=Math.floor(Math.log(e[n])/YS)+1,c=28-f;o=t.concat();let d=e.concat();if(c){for(l=n;l>0;l--)d[l]=d[l]<<c&268435455|d[l-1]>>f;for(d[0]=d[0]<<c&268435455,o[r]&(268435455<<f&268435455)&&(o[++r]=0,i++),l=r;l>0;l--)o[l]=o[l]<<c&268435455|o[l-1]>>f;o[0]=o[0]<<c&268435455}let g,p=Hr(i+1),E=Hr(i).concat(d);for(;g=we(o,E),g.length!==0;)p[i]++,o=g;let m=d[n],A=Wr(d,n,2),S;for(l=r;l>n;l--){S=l-n-1,l>=o.length?p[S]=1:o[l]===m?p[S]=268435455:p[S]=Math.floor(Wr(o,l,2)/m);let R=Wr(o,l,3);for(;p[S]*A>R;)p[S]--;E=E.slice(1),g=we(o,lt([p[S]],E)),g.length===0&&(p[S]--,g=we(o,lt([p[S]],E))),o=g}if(c){for(l=0;l<o.length-1;l++)o[l]=o[l]>>c|o[l+1]<<f&268435455;o[o.length-1]>>=c}return Je.q=Gr(p),Je.mod=Gr(o),Je}function QS(t,e){let r=0,n;for(let i=t.length-1;i>=0;i--)n=t[i],r=((n>>14)+(r<<14))%e,r=((n&16383)+(r<<14))%e;return r}function lr(t,e){if(e.length===1){if(t.length===1)return[t[0]%e[0]];if(e[0]<16383)return[QS(t,e[0])]}return Ud(t,e).mod}function $r(t,e,r){let n=t.length-(e.length<<1);if(n>0)return $r(t.slice(0,n).concat($r(t.slice(n),e,r)),e,r);let i=e.length+1,o=e.length-1,a,s=lt(t.slice(o),r).slice(i),l=t.slice(0,i),f=lt(s,e).slice(0,i),c=we(l,f);c.length===0&&(l[i]=1,c=we(l,f));for(let d=0;a=we(c,e),a.length!==0;d++)if(c=a,d>=3)return $r(c,e,r);return c}function Fd(t,e,r){let n=t.concat(),i=e.length-1,o=r.length*2,a=Hr(o+1);for(a[o]=1,a=Ud(a,r).q,o=JS(e[i])-2;i>=0;i--){for(;o>=0;o-=1)n=$r(XS(n),r,a),e[i]&1<<o&&(n=$r(lt(n,t),r,a));o=27}return n}function ZS(t,e,r,n,i){let o=Fd(lr(t,r),lr(e,we(r,[1])),r),a=Fd(lr(t,n),lr(e,we(n,[1])),n),s=we(a,o);return s.length===0?(s=we(o,a),s=lr(lt(s,i),n),s=we(n,s)):s=lr(lt(s,i),n),jd(lt(s,r),o)}function Wd(t){let e=1,r=[0],n=0,i=256,o=t.length,a;if(o<2)return 0;let s=(o-2)*8,l=t.charCodeAt(0)*256+t.charCodeAt(1);if(l>s||l<s-8)return 0;for(let f=0;f<s;f++)(i<<=1)>255&&(i=1,a=t.charCodeAt(--o)),e>268435455&&(e=1,r[++n]=0),a&i&&(r[n]|=e),e<<=1;return r}function eA(t){let e=1,r=0,n=[0],i=1,o=0,a=t.length*28,s="",l;for(l=0;l<a;l++)t[r]&e&&(n[o]|=i),(i<<=1)>255&&(i=1,n[++o]=0),(e<<=1)>268435455&&(e=1,r++);for(;o>=0&&n[o]===0;)o--;for(l=0;l<=o;l++)s=String.fromCharCode(n[l])+s;return s}function $d(t){let e=[];for(let r=0;r<4;r++){let n=(t[0]*256+t[1]+7>>3)+2;if(e[r]=Wd(t.toString("binary").substr(0,n)),typeof e[r]=="number"){if(r!==4||t.length>=16)return!1;break}t=t.slice(n)}return e}function za(t,e){let r=Wd(t.toString("binary")),n=eA(ZS(r,e[2],e[0],e[1],e[3]));return h.Buffer.from(n,"binary")}var Je,YS,Hd=_e(()=>{u();Je={},YS=Math.log(2)});var Ya=_e(()=>{u()});function Vd(t){if(t.statusText==="Server Too Busy")return-3;if(!t.ok)throw Error(`Server returned error: ${t.statusText}`);return t.json()}function iA(t){if(t.name!=="AbortError")throw t}var Kd,Ja,Gd,tA,rA,nA,Xa,De,Vr=_e(()=>{u();Kd=Re(Ie(),1);Ya();Ya();nr();sr();Ja=4,Gd={1:"EINTERNAL (-1): An internal error has occurred. Please submit a bug report, detailing the exact circumstances in which this error occurred.",2:"EARGS (-2): You have passed invalid arguments to this command.",3:"EAGAIN (-3): A temporary congestion or server malfunction prevented your request from being processed. No data was altered. Retried "+Ja+" times.",4:"ERATELIMIT (-4): You have exceeded your command weight per time quota. Please wait a few seconds, then try again (this should never happen in sane real-life applications).",5:"EFAILED (-5): The upload failed. Please restart it from scratch.",6:"ETOOMANY (-6): Too many concurrent IP addresses are accessing this upload target URL.",7:"ERANGE (-7): The upload file packet is out of range or not starting and ending on a chunk boundary.",8:"EEXPIRED (-8): The upload target URL you are trying to access has expired. Please request a fresh one.",9:"ENOENT (-9): Object (typically, node or user) not found. Wrong password?",10:"ECIRCULAR (-10): Circular linkage attempted",11:"EACCESS (-11): Access violation (e.g., trying to write to a read-only share)",12:"EEXIST (-12): Trying to create an object that already exists",13:"EINCOMPLETE (-13): Trying to access an incomplete resource",14:"EKEY (-14): A decryption operation failed (never returned by the API)",15:"ESID (-15): Invalid or expired user session, please relogin",16:"EBLOCKED (-16): User blocked",17:"EOVERQUOTA (-17): Request over quota",18:"ETEMPUNAVAIL (-18): Resource temporarily not available, please try again later",19:"ETOOMANYCONNECTIONS (-19)",24:"EGOINGOVERQUOTA (-24)",25:"EROLLEDBACK (-25)",26:"EMFAREQUIRED (-26): Multi-Factor Authentication Required",27:"EMASTERONLY (-27)",28:"EBUSINESSPASTDUE (-28)",29:"EPAYWALL (-29): ODQ paywall state",400:"ETOOERR (-400)",401:"ESHAREROVERQUOTA (-401)"},tA="https://g.api.mega.co.nz/",rA=null,nA=null,Xa=class t extends Kd.EventEmitter{constructor(e,r={}){super(),this.keepalive=e,this.counterId=Math.random().toString().substr(2,10),this.gateway=r.gateway||tA;let n="1.3.9",i=t.getShouldAvoidUA();this.userAgent=r.userAgent===null||i?null:`${r.userAgent||""} megajs/${n}`.trim(),this.httpAgent=r.httpAgent||rA,this.httpsAgent=r.httpsAgent||nA,this.fetch=r.fetch||this.defaultFetch.bind(this),this.closed=!1}async defaultFetch(e,r){if(r||(r={}),r.agent||(r.agent=n=>n.protocol==="http:"?this.httpAgent:this.httpsAgent),this.userAgent&&(r.headers||(r.headers={}),r.headers["user-agent"]||(r.headers["user-agent"]=this.userAgent)),!t.fetchModule)if(typeof globalThis.fetch=="function")t.fetchModule=globalThis.fetch.bind(globalThis);else throw Error("globalThis.fetch not found!");return t.fetchModule(e,r)}request(e,r,n=0){let i=e.a==="sml";if(this.closed&&!i)throw Error("API is closed");let[o,a]=J(r);typeof e._hashcash!="string"&&this.counterId++;let s={id:this.counterId.toString()};this.sid&&(s.sid=this.sid),typeof e._querystring=="object"&&(Object.assign(s,e._querystring),delete e._querystring);let l={"Content-Type":"application/json"};return typeof e._hashcash=="string"&&(l["X-Hashcash"]=e._hashcash,delete e._hashcash),this.fetch(`${this.gateway}cs?${new URLSearchParams(s)}`,{method:"POST",headers:l,body:JSON.stringify([e])}).then(async f=>{let c=f.headers.get("X-Hashcash");return c?(e._hashcash=await Dd(c),-3):Vd(f)}).then(f=>{if(this.closed&&!i)return;if(!f)return o(Error("Empty response"));f.length&&(f=f[0]);let c;if(typeof f=="number"&&f<0){if(f===-3&&n<Ja)return setTimeout(()=>{this.request(e,o,n+1)},Math.pow(2,n+1)*1e3);c=Error(Gd[-f])}else this.keepalive&&f&&f.sn&&this.pull(f.sn);o(c,f)}).catch(f=>{o(f)}),a}pull(e,r=0){let n=new AbortController,i=t.handleForceHttps()?1:0;this.sn=n,this.fetch(`${this.gateway}sc?${new URLSearchParams({sn:e,ssl:i,sid:this.sid})}`,{method:"POST",signal:n.signal}).then(Vd).then(o=>{if(this.sn=void 0,!this.closed){if(typeof o=="number"&&o<0){if(o===-3&&r<Ja)return setTimeout(()=>{this.pull(e,r+1)},Math.pow(2,r+1)*1e3);this.emit("error",Error(Gd[-o]))}o.w?this.wait(o.w,e):o.sn&&(o.a&&this.emit("sc",o.a),this.pull(o.sn))}}).catch(iA).catch(o=>{this.emit("error",o)})}wait(e,r){let n=new AbortController;this.sn=n,this.fetch(e,{method:"POST",signal:n.signal}).catch(()=>{}).then(()=>{this.sn=void 0,this.pull(r)})}close(){this.sn&&this.sn.abort(),this.closed=!0}static getGlobalApi(){return t.globalApi||(t.globalApi=new t),t.globalApi}static handleForceHttps(e){return e??!!globalThis.isSecureContext}static getShouldAvoidUA(){return!!globalThis.navigator}};De=Xa});var Qa=_((pT,zd)=>{"use strict";u();zd.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}});var di=_((gT,Yd)=>{"use strict";u();var oA=Qa();Yd.exports=function(){return oA()&&!!Symbol.toStringTag}});var Za=_((wT,Jd)=>{"use strict";u();Jd.exports=Object});var Qd=_((_T,Xd)=>{"use strict";u();Xd.exports=Error});var eh=_((ST,Zd)=>{"use strict";u();Zd.exports=EvalError});var rh=_((vT,th)=>{"use strict";u();th.exports=RangeError});var ih=_((xT,nh)=>{"use strict";u();nh.exports=ReferenceError});var es=_((IT,oh)=>{"use strict";u();oh.exports=SyntaxError});var fr=_((PT,ah)=>{"use strict";u();ah.exports=TypeError});var lh=_((MT,sh)=>{"use strict";u();sh.exports=URIError});var uh=_((LT,fh)=>{"use strict";u();fh.exports=Math.abs});var dh=_((NT,ch)=>{"use strict";u();ch.exports=Math.floor});var ph=_((DT,hh)=>{"use strict";u();hh.exports=Math.max});var gh=_((jT,yh)=>{"use strict";u();yh.exports=Math.min});var wh=_((WT,bh)=>{"use strict";u();bh.exports=Math.pow});var _h=_((HT,mh)=>{"use strict";u();mh.exports=Math.round});var Sh=_((VT,Eh)=>{"use strict";u();Eh.exports=Number.isNaN||function(e){return e!==e}});var vh=_((zT,Ah)=>{"use strict";u();var aA=Sh();Ah.exports=function(e){return aA(e)||e===0?e:e<0?-1:1}});var xh=_((JT,Rh)=>{"use strict";u();Rh.exports=Object.getOwnPropertyDescriptor});var ur=_((QT,Th)=>{"use strict";u();var hi=xh();if(hi)try{hi([],"length")}catch{hi=null}Th.exports=hi});var Kr=_((eI,Ih)=>{"use strict";u();var pi=Object.defineProperty||!1;if(pi)try{pi({},"a",{value:1})}catch{pi=!1}Ih.exports=pi});var Bh=_((rI,Ph)=>{"use strict";u();var Oh=typeof Symbol<"u"&&Symbol,sA=Qa();Ph.exports=function(){return typeof Oh!="function"||typeof Symbol!="function"||typeof Oh("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sA()}});var ts=_((iI,Mh)=>{"use strict";u();Mh.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var rs=_((aI,kh)=>{"use strict";u();var lA=Za();kh.exports=lA.getPrototypeOf||null});var Nh=_((lI,Ch)=>{"use strict";u();var fA="Function.prototype.bind called on incompatible ",uA=Object.prototype.toString,cA=Math.max,dA="[object Function]",Lh=function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var o=0;o<r.length;o+=1)n[o+e.length]=r[o];return n},hA=function(e,r){for(var n=[],i=r||0,o=0;i<e.length;i+=1,o+=1)n[o]=e[i];return n},pA=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};Ch.exports=function(e){var r=this;if(typeof r!="function"||uA.apply(r)!==dA)throw new TypeError(fA+r);for(var n=hA(arguments,1),i,o=function(){if(this instanceof i){var c=r.apply(this,Lh(n,arguments));return Object(c)===c?c:this}return r.apply(e,Lh(n,arguments))},a=cA(0,r.length-n.length),s=[],l=0;l<a;l++)s[l]="$"+l;if(i=Function("binder","return function ("+pA(s,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var f=function(){};f.prototype=r.prototype,i.prototype=new f,f.prototype=null}return i}});var cr=_((uI,qh)=>{"use strict";u();var yA=Nh();qh.exports=Function.prototype.bind||yA});var yi=_((dI,Dh)=>{"use strict";u();Dh.exports=Function.prototype.call});var ns=_((pI,Fh)=>{"use strict";u();Fh.exports=Function.prototype.apply});var Uh=_((gI,jh)=>{"use strict";u();jh.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var $h=_((wI,Wh)=>{"use strict";u();var gA=cr(),bA=ns(),wA=yi(),mA=Uh();Wh.exports=mA||gA.call(wA,bA)});var Gh=_((_I,Hh)=>{"use strict";u();var _A=cr(),EA=fr(),SA=yi(),AA=$h();Hh.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new EA("a function is required");return AA(_A,SA,e)}});var Xh=_((SI,Jh)=>{"use strict";u();var vA=Gh(),Vh=ur(),zh;try{zh=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var is=!!zh&&Vh&&Vh(Object.prototype,"__proto__"),Yh=Object,Kh=Yh.getPrototypeOf;Jh.exports=is&&typeof is.get=="function"?vA([is.get]):typeof Kh=="function"?function(e){return Kh(e==null?e:Yh(e))}:!1});var rp=_((vI,tp)=>{"use strict";u();var Qh=ts(),Zh=rs(),ep=Xh();tp.exports=Qh?function(e){return Qh(e)}:Zh?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return Zh(e)}:ep?function(e){return ep(e)}:null});var ip=_((xI,np)=>{"use strict";u();var RA=Function.prototype.call,xA=Object.prototype.hasOwnProperty,TA=cr();np.exports=TA.call(RA,xA)});var wi=_((II,up)=>{"use strict";u();var P,IA=Za(),OA=Qd(),PA=eh(),BA=rh(),MA=ih(),yr=es(),pr=fr(),kA=lh(),LA=uh(),CA=dh(),NA=ph(),qA=gh(),DA=wh(),FA=_h(),jA=vh(),lp=Function,os=function(t){try{return lp('"use strict"; return ('+t+").constructor;")()}catch{}},zr=ur(),UA=Kr(),as=function(){throw new pr},WA=zr?function(){try{return arguments.callee,as}catch{try{return zr(arguments,"callee").get}catch{return as}}}():as,dr=Bh()(),Z=rp(),$A=rs(),HA=ts(),fp=ns(),Yr=yi(),hr={},GA=typeof Uint8Array>"u"||!Z?P:Z(Uint8Array),Pt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?P:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?P:ArrayBuffer,"%ArrayIteratorPrototype%":dr&&Z?Z([][Symbol.iterator]()):P,"%AsyncFromSyncIteratorPrototype%":P,"%AsyncFunction%":hr,"%AsyncGenerator%":hr,"%AsyncGeneratorFunction%":hr,"%AsyncIteratorPrototype%":hr,"%Atomics%":typeof Atomics>"u"?P:Atomics,"%BigInt%":typeof BigInt>"u"?P:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?P:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?P:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?P:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":OA,"%eval%":eval,"%EvalError%":PA,"%Float16Array%":typeof Float16Array>"u"?P:Float16Array,"%Float32Array%":typeof Float32Array>"u"?P:Float32Array,"%Float64Array%":typeof Float64Array>"u"?P:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?P:FinalizationRegistry,"%Function%":lp,"%GeneratorFunction%":hr,"%Int8Array%":typeof Int8Array>"u"?P:Int8Array,"%Int16Array%":typeof Int16Array>"u"?P:Int16Array,"%Int32Array%":typeof Int32Array>"u"?P:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":dr&&Z?Z(Z([][Symbol.iterator]())):P,"%JSON%":typeof JSON=="object"?JSON:P,"%Map%":typeof Map>"u"?P:Map,"%MapIteratorPrototype%":typeof Map>"u"||!dr||!Z?P:Z(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":IA,"%Object.getOwnPropertyDescriptor%":zr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?P:Promise,"%Proxy%":typeof Proxy>"u"?P:Proxy,"%RangeError%":BA,"%ReferenceError%":MA,"%Reflect%":typeof Reflect>"u"?P:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?P:Set,"%SetIteratorPrototype%":typeof Set>"u"||!dr||!Z?P:Z(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?P:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":dr&&Z?Z(""[Symbol.iterator]()):P,"%Symbol%":dr?Symbol:P,"%SyntaxError%":yr,"%ThrowTypeError%":WA,"%TypedArray%":GA,"%TypeError%":pr,"%Uint8Array%":typeof Uint8Array>"u"?P:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?P:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?P:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?P:Uint32Array,"%URIError%":kA,"%WeakMap%":typeof WeakMap>"u"?P:WeakMap,"%WeakRef%":typeof WeakRef>"u"?P:WeakRef,"%WeakSet%":typeof WeakSet>"u"?P:WeakSet,"%Function.prototype.call%":Yr,"%Function.prototype.apply%":fp,"%Object.defineProperty%":UA,"%Object.getPrototypeOf%":$A,"%Math.abs%":LA,"%Math.floor%":CA,"%Math.max%":NA,"%Math.min%":qA,"%Math.pow%":DA,"%Math.round%":FA,"%Math.sign%":jA,"%Reflect.getPrototypeOf%":HA};if(Z)try{null.error}catch(t){op=Z(Z(t)),Pt["%Error.prototype%"]=op}var op,VA=function t(e){var r;if(e==="%AsyncFunction%")r=os("async function () {}");else if(e==="%GeneratorFunction%")r=os("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=os("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Z&&(r=Z(i.prototype))}return Pt[e]=r,r},ap={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Jr=cr(),gi=ip(),KA=Jr.call(Yr,Array.prototype.concat),zA=Jr.call(fp,Array.prototype.splice),sp=Jr.call(Yr,String.prototype.replace),bi=Jr.call(Yr,String.prototype.slice),YA=Jr.call(Yr,RegExp.prototype.exec),JA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,XA=/\\(\\)?/g,QA=function(e){var r=bi(e,0,1),n=bi(e,-1);if(r==="%"&&n!=="%")throw new yr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new yr("invalid intrinsic syntax, expected opening `%`");var i=[];return sp(e,JA,function(o,a,s,l){i[i.length]=s?sp(l,XA,"$1"):a||o}),i},ZA=function(e,r){var n=e,i;if(gi(ap,n)&&(i=ap[n],n="%"+i[0]+"%"),gi(Pt,n)){var o=Pt[n];if(o===hr&&(o=VA(n)),typeof o>"u"&&!r)throw new pr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new yr("intrinsic "+e+" does not exist!")};up.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new pr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new pr('"allowMissing" argument must be a boolean');if(YA(/^%?[^%]*%?$/,e)===null)throw new yr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=QA(e),i=n.length>0?n[0]:"",o=ZA("%"+i+"%",r),a=o.name,s=o.value,l=!1,f=o.alias;f&&(i=f[0],zA(n,KA([0,1],f)));for(var c=1,d=!0;c<n.length;c+=1){var g=n[c],p=bi(g,0,1),E=bi(g,-1);if((p==='"'||p==="'"||p==="`"||E==='"'||E==="'"||E==="`")&&p!==E)throw new yr("property names with quotes must have matching quotes");if((g==="constructor"||!d)&&(l=!0),i+="."+g,a="%"+i+"%",gi(Pt,a))s=Pt[a];else if(s!=null){if(!(g in s)){if(!r)throw new pr("base intrinsic for "+e+" exists, but the property is not available.");return}if(zr&&c+1>=n.length){var m=zr(s,g);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[g]}else d=gi(s,g),s=s[g];d&&!l&&(Pt[a]=s)}}return s}});var pp=_((PI,hp)=>{"use strict";u();var cp=Kr(),ev=es(),gr=fr(),dp=ur();hp.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new gr("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new gr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new gr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new gr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new gr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new gr("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!dp&&dp(e,r);if(cp)cp(e,r,{configurable:a===null&&l?l.configurable:!a,enumerable:i===null&&l?l.enumerable:!i,value:n,writable:o===null&&l?l.writable:!o});else if(s||!i&&!o&&!a)e[r]=n;else throw new ev("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var bp=_((MI,gp)=>{"use strict";u();var ss=Kr(),yp=function(){return!!ss};yp.hasArrayLengthDefineBug=function(){if(!ss)return null;try{return ss([],"length",{value:1}).length!==1}catch{return!0}};gp.exports=yp});var Sp=_((LI,Ep)=>{"use strict";u();var tv=wi(),wp=pp(),rv=bp()(),mp=ur(),_p=fr(),nv=tv("%Math.floor%");Ep.exports=function(e,r){if(typeof e!="function")throw new _p("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||nv(r)!==r)throw new _p("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&mp){var a=mp(e,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!n)&&(rv?wp(e,"length",r,!0,!0):wp(e,"length",r)),e}});var fs=_((NI,mi)=>{"use strict";u();var ls=cr(),_i=wi(),iv=Sp(),ov=fr(),Rp=_i("%Function.prototype.apply%"),xp=_i("%Function.prototype.call%"),Tp=_i("%Reflect.apply%",!0)||ls.call(xp,Rp),Ap=Kr(),av=_i("%Math.max%");mi.exports=function(e){if(typeof e!="function")throw new ov("a function is required");var r=Tp(ls,xp,arguments);return iv(r,1+av(0,e.length-(arguments.length-1)),!0)};var vp=function(){return Tp(ls,Rp,arguments)};Ap?Ap(mi.exports,"apply",{value:vp}):mi.exports.apply=vp});var us=_((DI,Pp)=>{"use strict";u();var Ip=wi(),Op=fs(),sv=Op(Ip("String.prototype.indexOf"));Pp.exports=function(e,r){var n=Ip(e,!!r);return typeof n=="function"&&sv(e,".prototype.")>-1?Op(n):n}});var kp=_((jI,Mp)=>{"use strict";u();var lv=di()(),fv=us(),cs=fv("Object.prototype.toString"),Ei=function(e){return lv&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:cs(e)==="[object Arguments]"},Bp=function(e){return Ei(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&cs(e)!=="[object Array]"&&cs(e.callee)==="[object Function]"},uv=function(){return Ei(arguments)}();Ei.isLegacyArguments=Bp;Mp.exports=uv?Ei:Bp});var Np=_((WI,Cp)=>{"use strict";u();var cv=Object.prototype.toString,dv=Function.prototype.toString,hv=/^\s*(?:function)?\*/,Lp=di()(),ds=Object.getPrototypeOf,pv=function(){if(!Lp)return!1;try{return Function("return function*() {}")()}catch{}},hs;Cp.exports=function(e){if(typeof e!="function")return!1;if(hv.test(dv.call(e)))return!0;if(!Lp){var r=cv.call(e);return r==="[object GeneratorFunction]"}if(!ds)return!1;if(typeof hs>"u"){var n=pv();hs=n?ds(n):!1}return ds(e)===hs}});var jp=_((HI,Fp)=>{"use strict";u();var Dp=Function.prototype.toString,br=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ys,Si;if(typeof br=="function"&&typeof Object.defineProperty=="function")try{ys=Object.defineProperty({},"length",{get:function(){throw Si}}),Si={},br(function(){throw 42},null,ys)}catch(t){t!==Si&&(br=null)}else br=null;var yv=/^\s*class\b/,gs=function(e){try{var r=Dp.call(e);return yv.test(r)}catch{return!1}},ps=function(e){try{return gs(e)?!1:(Dp.call(e),!0)}catch{return!1}},Ai=Object.prototype.toString,gv="[object Object]",bv="[object Function]",wv="[object GeneratorFunction]",mv="[object HTMLAllCollection]",_v="[object HTML document.all class]",Ev="[object HTMLCollection]",Sv=typeof Symbol=="function"&&!!Symbol.toStringTag,Av=!(0 in[,]),bs=function(){return!1};typeof document=="object"&&(qp=document.all,Ai.call(qp)===Ai.call(document.all)&&(bs=function(e){if((Av||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Ai.call(e);return(r===mv||r===_v||r===Ev||r===gv)&&e("")==null}catch{}return!1}));var qp;Fp.exports=br?function(e){if(bs(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{br(e,null,ys)}catch(r){if(r!==Si)return!1}return!gs(e)&&ps(e)}:function(e){if(bs(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(Sv)return ps(e);if(gs(e))return!1;var r=Ai.call(e);return r!==bv&&r!==wv&&!/^\[object HTML/.test(r)?!1:ps(e)}});var $p=_((VI,Wp)=>{"use strict";u();var vv=jp(),Rv=Object.prototype.toString,Up=Object.prototype.hasOwnProperty,xv=function(e,r,n){for(var i=0,o=e.length;i<o;i++)Up.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},Tv=function(e,r,n){for(var i=0,o=e.length;i<o;i++)n==null?r(e.charAt(i),i,e):r.call(n,e.charAt(i),i,e)},Iv=function(e,r,n){for(var i in e)Up.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},Ov=function(e,r,n){if(!vv(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),Rv.call(e)==="[object Array]"?xv(e,r,i):typeof e=="string"?Tv(e,r,i):Iv(e,r,i)};Wp.exports=Ov});var Gp=_((zI,Hp)=>{"use strict";u();Hp.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var Kp=_((JI,Vp)=>{"use strict";u();var ws=Gp(),Pv=typeof globalThis>"u"?b:globalThis;Vp.exports=function(){for(var e=[],r=0;r<ws.length;r++)typeof Pv[ws[r]]=="function"&&(e[e.length]=ws[r]);return e}});var As=_((QI,Xp)=>{"use strict";u();var Ri=$p(),Bv=Kp(),zp=fs(),Es=us(),vi=ur(),Mv=Es("Object.prototype.toString"),Jp=di()(),Yp=typeof globalThis>"u"?b:globalThis,_s=Bv(),Ss=Es("String.prototype.slice"),ms=Object.getPrototypeOf,kv=Es("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n<e.length;n+=1)if(e[n]===r)return n;return-1},xi={__proto__:null};Jp&&vi&&ms?Ri(_s,function(t){var e=new Yp[t];if(Symbol.toStringTag in e){var r=ms(e),n=vi(r,Symbol.toStringTag);if(!n){var i=ms(r);n=vi(i,Symbol.toStringTag)}xi["$"+t]=zp(n.get)}}):Ri(_s,function(t){var e=new Yp[t],r=e.slice||e.set;r&&(xi["$"+t]=zp(r))});var Lv=function(e){var r=!1;return Ri(xi,function(n,i){if(!r)try{"$"+n(e)===i&&(r=Ss(i,1))}catch{}}),r},Cv=function(e){var r=!1;return Ri(xi,function(n,i){if(!r)try{n(e),r=Ss(i,1)}catch{}}),r};Xp.exports=function(e){if(!e||typeof e!="object")return!1;if(!Jp){var r=Ss(Mv(e),8,-1);return kv(_s,r)>-1?r:r!=="Object"?!1:Cv(e)}return vi?Lv(e):null}});var Zp=_((e2,Qp)=>{"use strict";u();var Nv=As();Qp.exports=function(e){return!!Nv(e)}});var hy=_(B=>{"use strict";u();var qv=kp(),Dv=Np(),ve=As(),ey=Zp();function wr(t){return t.call.bind(t)}var ty=typeof BigInt<"u",ry=typeof Symbol<"u",me=wr(Object.prototype.toString),Fv=wr(Number.prototype.valueOf),jv=wr(String.prototype.valueOf),Uv=wr(Boolean.prototype.valueOf);ty&&(ny=wr(BigInt.prototype.valueOf));var ny;ry&&(iy=wr(Symbol.prototype.valueOf));var iy;function Qr(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}B.isArgumentsObject=qv;B.isGeneratorFunction=Dv;B.isTypedArray=ey;function Wv(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"}B.isPromise=Wv;function $v(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(t):ey(t)||ay(t)}B.isArrayBufferView=$v;function Hv(t){return ve(t)==="Uint8Array"}B.isUint8Array=Hv;function Gv(t){return ve(t)==="Uint8ClampedArray"}B.isUint8ClampedArray=Gv;function Vv(t){return ve(t)==="Uint16Array"}B.isUint16Array=Vv;function Kv(t){return ve(t)==="Uint32Array"}B.isUint32Array=Kv;function zv(t){return ve(t)==="Int8Array"}B.isInt8Array=zv;function Yv(t){return ve(t)==="Int16Array"}B.isInt16Array=Yv;function Jv(t){return ve(t)==="Int32Array"}B.isInt32Array=Jv;function Xv(t){return ve(t)==="Float32Array"}B.isFloat32Array=Xv;function Qv(t){return ve(t)==="Float64Array"}B.isFloat64Array=Qv;function Zv(t){return ve(t)==="BigInt64Array"}B.isBigInt64Array=Zv;function eR(t){return ve(t)==="BigUint64Array"}B.isBigUint64Array=eR;function Ti(t){return me(t)==="[object Map]"}Ti.working=typeof Map<"u"&&Ti(new Map);function tR(t){return typeof Map>"u"?!1:Ti.working?Ti(t):t instanceof Map}B.isMap=tR;function Ii(t){return me(t)==="[object Set]"}Ii.working=typeof Set<"u"&&Ii(new Set);function rR(t){return typeof Set>"u"?!1:Ii.working?Ii(t):t instanceof Set}B.isSet=rR;function Oi(t){return me(t)==="[object WeakMap]"}Oi.working=typeof WeakMap<"u"&&Oi(new WeakMap);function nR(t){return typeof WeakMap>"u"?!1:Oi.working?Oi(t):t instanceof WeakMap}B.isWeakMap=nR;function Rs(t){return me(t)==="[object WeakSet]"}Rs.working=typeof WeakSet<"u"&&Rs(new WeakSet);function iR(t){return Rs(t)}B.isWeakSet=iR;function Pi(t){return me(t)==="[object ArrayBuffer]"}Pi.working=typeof ArrayBuffer<"u"&&Pi(new ArrayBuffer);function oy(t){return typeof ArrayBuffer>"u"?!1:Pi.working?Pi(t):t instanceof ArrayBuffer}B.isArrayBuffer=oy;function Bi(t){return me(t)==="[object DataView]"}Bi.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Bi(new DataView(new ArrayBuffer(1),0,1));function ay(t){return typeof DataView>"u"?!1:Bi.working?Bi(t):t instanceof DataView}B.isDataView=ay;var vs=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Xr(t){return me(t)==="[object SharedArrayBuffer]"}function sy(t){return typeof vs>"u"?!1:(typeof Xr.working>"u"&&(Xr.working=Xr(new vs)),Xr.working?Xr(t):t instanceof vs)}B.isSharedArrayBuffer=sy;function oR(t){return me(t)==="[object AsyncFunction]"}B.isAsyncFunction=oR;function aR(t){return me(t)==="[object Map Iterator]"}B.isMapIterator=aR;function sR(t){return me(t)==="[object Set Iterator]"}B.isSetIterator=sR;function lR(t){return me(t)==="[object Generator]"}B.isGeneratorObject=lR;function fR(t){return me(t)==="[object WebAssembly.Module]"}B.isWebAssemblyCompiledModule=fR;function ly(t){return Qr(t,Fv)}B.isNumberObject=ly;function fy(t){return Qr(t,jv)}B.isStringObject=fy;function uy(t){return Qr(t,Uv)}B.isBooleanObject=uy;function cy(t){return ty&&Qr(t,ny)}B.isBigIntObject=cy;function dy(t){return ry&&Qr(t,iy)}B.isSymbolObject=dy;function uR(t){return ly(t)||fy(t)||uy(t)||cy(t)||dy(t)}B.isBoxedPrimitive=uR;function cR(t){return typeof Uint8Array<"u"&&(oy(t)||sy(t))}B.isAnyArrayBuffer=cR;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(B,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})})});var yy=_((i2,py)=>{u();py.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var Ey=_(M=>{u();var gy=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(e,r[i]);return n},dR=/%[sdj%]/g;M.format=function(t){if(!Di(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(ft(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(dR,function(s){if(s==="%%")return"%";if(r>=i)return s;switch(s){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return s}}),a=n[r];r<i;a=n[++r])qi(a)||!mr(a)?o+=" "+a:o+=" "+ft(a);return o};M.deprecate=function(t,e){if(typeof y<"u"&&y.noDeprecation===!0)return t;if(typeof y>"u")return function(){return M.deprecate(t,e).apply(this,arguments)};var r=!1;function n(){if(!r){if(y.throwDeprecation)throw new Error(e);y.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n};var Mi={},by=/^$/;y.env.NODE_DEBUG&&(ki=y.env.NODE_DEBUG,ki=ki.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),by=new RegExp("^"+ki+"$","i"));var ki;M.debuglog=function(t){if(t=t.toUpperCase(),!Mi[t])if(by.test(t)){var e=y.pid;Mi[t]=function(){var r=M.format.apply(M,arguments);console.error("%s %d: %s",t,e,r)}}else Mi[t]=function(){};return Mi[t]};function ft(t,e){var r={seen:[],stylize:pR};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Os(e)?r.showHidden=e:e&&M._extend(r,e),Mt(r.showHidden)&&(r.showHidden=!1),Mt(r.depth)&&(r.depth=2),Mt(r.colors)&&(r.colors=!1),Mt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=hR),Ci(r,t,r.depth)}M.inspect=ft;ft.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};ft.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function hR(t,e){var r=ft.styles[e];return r?"\x1B["+ft.colors[r][0]+"m"+t+"\x1B["+ft.colors[r][1]+"m":t}function pR(t,e){return t}function yR(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Ci(t,e,r){if(t.customInspect&&e&&Li(e.inspect)&&e.inspect!==M.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return Di(n)||(n=Ci(t,n,r)),n}var i=gR(t,e);if(i)return i;var o=Object.keys(e),a=yR(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),en(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return xs(e);if(o.length===0){if(Li(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Zr(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ni(e))return t.stylize(Date.prototype.toString.call(e),"date");if(en(e))return xs(e)}var l="",f=!1,c=["{","}"];if(wy(e)&&(f=!0,c=["[","]"]),Li(e)){var d=e.name?": "+e.name:"";l=" [Function"+d+"]"}if(Zr(e)&&(l=" "+RegExp.prototype.toString.call(e)),Ni(e)&&(l=" "+Date.prototype.toUTCString.call(e)),en(e)&&(l=" "+xs(e)),o.length===0&&(!f||e.length==0))return c[0]+l+c[1];if(r<0)return Zr(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var g;return f?g=bR(t,e,r,a,o):g=o.map(function(p){return Is(t,e,r,a,p,f)}),t.seen.pop(),wR(g,l,c)}function gR(t,e){if(Mt(e))return t.stylize("undefined","undefined");if(Di(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(my(e))return t.stylize(""+e,"number");if(Os(e))return t.stylize(""+e,"boolean");if(qi(e))return t.stylize("null","null")}function xs(t){return"["+Error.prototype.toString.call(t)+"]"}function bR(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)_y(e,String(a))?o.push(Is(t,e,r,n,String(a),!0)):o.push("");return i.forEach(function(l){l.match(/^\d+$/)||o.push(Is(t,e,r,n,l,!0))}),o}function Is(t,e,r,n,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},l.get?l.set?s=t.stylize("[Getter/Setter]","special"):s=t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),_y(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(qi(r)?s=Ci(t,l.value,null):s=Ci(t,l.value,r-1),s.indexOf(`
3
+ `)>-1&&(o?s=s.split(`
4
+ `).map(function(f){return" "+f}).join(`
5
+ `).slice(2):s=`
6
+ `+s.split(`
7
+ `).map(function(f){return" "+f}).join(`
8
+ `))):s=t.stylize("[Circular]","special")),Mt(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function wR(t,e,r){var n=0,i=t.reduce(function(o,a){return n++,a.indexOf(`
9
+ `)>=0&&n++,o+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(e===""?"":e+`
10
+ `)+" "+t.join(`,
11
+ `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}M.types=hy();function wy(t){return Array.isArray(t)}M.isArray=wy;function Os(t){return typeof t=="boolean"}M.isBoolean=Os;function qi(t){return t===null}M.isNull=qi;function mR(t){return t==null}M.isNullOrUndefined=mR;function my(t){return typeof t=="number"}M.isNumber=my;function Di(t){return typeof t=="string"}M.isString=Di;function _R(t){return typeof t=="symbol"}M.isSymbol=_R;function Mt(t){return t===void 0}M.isUndefined=Mt;function Zr(t){return mr(t)&&Ps(t)==="[object RegExp]"}M.isRegExp=Zr;M.types.isRegExp=Zr;function mr(t){return typeof t=="object"&&t!==null}M.isObject=mr;function Ni(t){return mr(t)&&Ps(t)==="[object Date]"}M.isDate=Ni;M.types.isDate=Ni;function en(t){return mr(t)&&(Ps(t)==="[object Error]"||t instanceof Error)}M.isError=en;M.types.isNativeError=en;function Li(t){return typeof t=="function"}M.isFunction=Li;function ER(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}M.isPrimitive=ER;M.isBuffer=yy();function Ps(t){return Object.prototype.toString.call(t)}function Ts(t){return t<10?"0"+t.toString(10):t.toString(10)}var SR=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function AR(){var t=new Date,e=[Ts(t.getHours()),Ts(t.getMinutes()),Ts(t.getSeconds())].join(":");return[t.getDate(),SR[t.getMonth()],e].join(" ")}M.log=function(){console.log("%s - %s",AR(),M.format.apply(M,arguments))};M.inherits=ze();M._extend=function(t,e){if(!e||!mr(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};function _y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Bt=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;M.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(Bt&&e[Bt]){var r=e[Bt];if(typeof r!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,Bt,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var n,i,o=new Promise(function(l,f){n=l,i=f}),a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);a.push(function(l,f){l?i(l):n(f)});try{e.apply(this,a)}catch(l){i(l)}return o}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Bt&&Object.defineProperty(r,Bt,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,gy(e))};M.promisify.custom=Bt;function vR(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}function RR(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,r).then(function(s){y.nextTick(a.bind(null,null,s))},function(s){y.nextTick(vR.bind(null,s,a))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,gy(t)),e}M.callbackify=RR});var vy=_((l2,Ay)=>{u();var xR=vt(),TR=Ey(),Sy=xR.Transform;function tn(t){if(!(this instanceof tn))return new tn(t);this._toSkip=t.skip,Sy.call(this,t)}TR.inherits(tn,Sy);tn.prototype._transform=function(t,e,r){this._toSkip==0?this.push(t):this._toSkip>t.length?this._toSkip-=t.length:(this._toSkip!==t.length&&this.push(t.slice(this._toSkip)),this._toSkip=0),r()};Ay.exports=tn});var Ry,xy,Ty,Bs,Ms,Fe,ks=_e(()=>{u();sr();Vr();Ry=Re(Ie(),1);nr();xy=Re(vt(),1),Ty=Re(vy(),1),Bs=class t extends Ry.EventEmitter{constructor(e){if(super(),this.checkConstructorArgument(e.downloadId),this.checkConstructorArgument(e.key),this.checkConstructorArgument(e.loadedFile),this.downloadId=e.downloadId,this.key=e.key?se(e.key):null,this.type=e.directory?1:0,this.directory=!!e.directory,this.directory&&!this.children&&(this.children=[]),this.api=e.api||De.getGlobalApi(),!(this.api instanceof De))throw Error("api must be a instance of API");this.loadedFile=e.loadedFile}get createdAt(){if(typeof this.timestamp<"u")return this.timestamp*1e3}checkConstructorArgument(e){if(typeof e=="string"&&!/^[\w-]+$/.test(e))throw Error(`Invalid argument: "${e}"`)}loadMetadata(e,r){if(this.size=r.s||0,this.timestamp=r.ts||0,this.type=r.t,this.directory=!!r.t,this.owner=r.u,this.name=null,this.directory&&!this.children&&(this.children=[]),!e||!r.k)return;let n=r.k.split("/").map(i=>i.split(":"));for(let i of n)if(this.key=se(i[i.length-1]),this.key.length<=32?e.decryptECB(this.key):this.storage?this.key=this.storage.decryptRsaKey(this.key).slice(0,this.directory?16:32):this.key=null,r.a&&this.decryptAttributes(r.a))break}decryptAttributes(e){if(!this.key)return this;e=ar(e),Ae(this.key).decryptCBC(e);let r=t.unpackAttributes(e);return r?(this.parseAttributes(r),!0):!1}parseAttributes(e){this.attributes=e,this.name=e.n,this.label=Ms[e.lbl||0],this.favorited=!!e.fav}loadAttributes(e){let[r,n]=J(e),i=this.directory?{a:"f",c:1,ca:1,r:1,_querystring:{n:this.downloadId}}:{a:"g",p:this.downloadId};return this.api.request(i,(o,a)=>{if(o)return r(o);if(this.directory){let s=Object.create(null),l=a.f,f=l.find(d=>d.k&&d.k.split("/").some(g=>d.h===g.split(":")[0])),c=this.key?new oe(this.key):null;this.nodeId=f.h,this.timestamp=f.ts,s[f.h]=this;for(let d of l){if(d===f)continue;let g=new t(d,this.storage);g.loadMetadata(c,d),g.downloadId=[this.downloadId,d.h],s[d.h]=g}for(let d of l){let g=s[d.p];if(g){let p=s[d.h];g.children.push(p),p.parent=g}}if(this.loadMetadata(c,f),this.key&&!this.attributes)return r(Error("Attributes could not be decrypted with provided key."));if(this.loadedFile){let d=s[this.loadedFile];typeof d>"u"?r(Error("Node (file or folder) not found in folder")):r(null,d)}else r(null,this)}else{if(this.size=a.s,this.decryptAttributes(a.at),this.key&&!this.attributes)return r(Error("Attributes could not be decrypted with provided key."));r(null,this)}}),n}download(e,r){typeof e=="function"&&(r=e,e={}),e||(e={});let n=e.start||0,i=e.returnCiphertext?n:n-n%16,o=e.end||null,a=e.maxConnections||4,s=e.initialChunkSize||128*1024,l=e.chunkSizeIncrement||128*1024,f=e.maxChunkSize||1024*1024,d={a:"g",g:1,ssl:De.handleForceHttps(e.forceHttps)?2:0};if(this.nodeId?d.n=this.nodeId:Array.isArray(this.downloadId)?(d._querystring={n:this.downloadId[0]},d.n=this.downloadId[1]):d.p=this.downloadId,this.directory)throw Error("Can't download: folder download isn't supported");if(!this.key&&!e.returnCiphertext)throw Error("Can't download: key isn't defined");let g=this.key&&!e.returnCiphertext?ci(this.key,{start:i,disableVerification:i!==0||o!==null}):new xy.PassThrough,p=i===n?g:g.pipe(new Ty.default({skip:n-i})),E=e.handleRetries||t.defaultHandleRetries;return this.api.request(d,(m,A)=>{if(m)return p.emit("error",m);if(typeof A.g!="string"||A.g.substr(0,4)!=="http")return p.emit("error",Error("MEGA servers returned an invalid response, maybe caused by rate limit"));if(A.s===0)return p.end();if(o||(o=A.s-1),n>o)return p.emit("error",Error("You can't download past the end of the file."));function S(C){if(C.status!==200){if(C.status===509){let F=C.headers.get("x-mega-time-left"),ue=Error("Bandwidth limit reached: "+F+" seconds until it resets");ue.timeLimit=F,p.emit("error",ue);return}p.emit("error",Error("MEGA returned a "+C.status+" status code"))}}function R(C){p.emit("error",C)}let k=0;if(p.on("data",C=>{k+=C.length,p.emit("progress",{bytesLoaded:k,bytesTotal:A.s})}),a===1){let C=new AbortController;p.on("close",()=>{C.abort()}),this.api.fetch(A.g+"/"+i+"-"+o,{signal:C.signal}).then(F=>{S(F);let ue=F.body;if(ue)if(ue.pipe)F.body.pipe(g);else if(ue.getReader){let Qe=ue.getReader(),ce=({done:le,value:kt})=>{if(le)g.end();else return g.write(kt),Qe.read().then(ce)};Qe.read().then(ce)}else throw Error("Single connection streaming not supported by fetch");else throw Error("Missing response body")}).catch(R);return}let v={},I=0,W=0,D=!1,X=i,j=s;p.on("error",()=>{D=!0}),p.on("close",()=>{D=!0});let ee=()=>{if(X>o){D=!0,I===W&&g.end();return}let C=X,F=Math.min(o,C+j-1),ue=I++,Qe=0,ce=()=>{Qe++,this.api.fetch(A.g+"/"+C+"-"+F).then(le=>(S(le),le.arrayBuffer())).then(le=>{let kt=h.Buffer.from(le);v[ue]=kt,W===ue&&je()},le=>{E(Qe,le,kt=>{kt?R(kt):ce()})})};ce(),X=F+1,j<f&&(j=j+l)},je=()=>{let C;for(;;){let F=v[W];if(!F||(C=!g.write(F),delete v[W],W++,C))break}D&&I===W&&g.end(),C?g.once("drain",je):ee()};for(let C=0;C<a;C++)ee()}),r&&ai(p,r),p}downloadBuffer(e,r){let[n,i]=J(r);return this.download(e,n),i}link(e,r){arguments.length===1&&typeof e=="function"&&(r=e,e={noKey:!1});let[n,i]=J(r);typeof e=="boolean"&&(e={noKey:e});let o=`https://mega.nz/${this.directory?"folder":"file"}/${this.downloadId}`;return!e.noKey&&this.key&&(o+=`#${U(this.key)}`),!e.noKey&&this.loadedFile&&(o+=`/file/${this.loadedFile}`),n(null,o),i}find(e,r){if(!this.children)throw Error("You can only call .find on directories");if(typeof e=="string"){let n=e;e=i=>i.name===n}else if(Array.isArray(e)){let n=e;e=i=>n.includes(i.name)}if(typeof e!="function")throw Error("Query must be a file matching function, an array of valid file names or a string with a file name");return this.children.reduce((n,i)=>n||(e(i)?i:i.children&&r?i.find(e,r):null),null)}filter(e,r){if(!this.children)throw Error("You can only call .filter on directories");if(typeof e=="string"){let n=e;e=i=>i.name===n}else if(Array.isArray(e)){let n=e;e=i=>n.includes(i.name)}if(typeof e!="function")throw Error("Query must be a file matching function, an array of valid file names or a string with a file name");return this.children.reduce((n,i)=>(e(i)&&n.push(i),i.children&&r?n.concat(i.filter(e,r)):n),[])}navigate(e){if(!this.children)throw Error("You can only call .navigate on directories");if(typeof e=="string")e=e.split("/");else if(!Array.isArray(e))throw Error("Query must be an array or a string");return e.reduce((r,n)=>r&&r.children&&r.children.find(i=>i.name===n),this)}static fromURL(e,r={}){if(typeof e=="object")return new t(e);let n=new URL(e);if(n.hostname!=="mega.nz"&&n.hostname!=="mega.co.nz")throw Error("Invalid URL: wrong hostname");if(!n.hash)throw Error("Invalid URL: no hash");if(n.pathname.match(/\/(file|folder)\//)!==null){let i=n.hash.substr(1).split("/file/"),o=n.pathname.substring(n.pathname.lastIndexOf("/")+1,n.pathname.length+1),a=i[0];if(o&&!a||!o&&a)throw Error("Invalid URL: too few arguments");return new t({downloadId:o,key:a,directory:n.pathname.indexOf("/folder/")>=0,loadedFile:i[1],...r})}else{let i=n.hash.split("!");if(i[0]!=="#"&&i[0]!=="#F")throw Error("Invalid URL: format not recognized");if(i.length<=1)throw Error("Invalid URL: too few arguments");if(i.length>=(i[0]==="#"?4:5))throw Error("Invalid URL: too many arguments");return new t({downloadId:i[1],key:i[2],directory:i[0]==="#F",loadedFile:i[3],...r})}}static unpackAttributes(e){let r=0;for(;r<e.length&&e.readUInt8(r);)r++;if(e=e.slice(0,r).toString(),e.substr(0,6)==='MEGA{"')try{return JSON.parse(e.substr(4))}catch{}}static defaultHandleRetries(e,r,n){e>8?n(r):setTimeout(n,1e3*Math.pow(2,e))}},Ms=["","red","orange","yellow","green","blue","purple","grey"],Fe=Bs});function rn(t,e,r){let n=t.shareKeys;Array.isArray(e)||(e=Oy(e)),r||(r=e.map(o=>_r(n,o)).reduce((o,a)=>o.concat(a)).filter((o,a,s)=>a===s.indexOf(o)));let i=[r,e.map(o=>o.nodeId),[]];for(let o=r.length;o--;){let a=new oe(n[r[o]]);for(let s=e.length;s--;){let l=h.Buffer.from(e[s].key);l&&(l.length===32||l.length===16)&&i[2].push(o,s,U(a.encryptECB(l)))}}return i}function Oy(t){return[t].concat((t.children||[]).map(Oy).reduce((e,r)=>e.concat(r),[]))}function _r(t,e){let r=e.nodeId,n=e.parent,i=[];return t[r]&&i.push(r),n?i.concat(_r(t,n)):i}var Ls,Iy,Cs,Fi,Ns=_e(()=>{u();ks();Ls=Re(vt(),1);sr();nr();Vr();Iy={},Cs=class t extends Fe{constructor(e,r){if(super(e),this.storage=r,this.api=r.api,this.nodeId=e.h,this.timestamp=e.ts,this.type=e.t,this.directory=!!this.type,this.directory&&!this.children&&(this.children=[]),e.k){let n=e.k.split("/"),i=r.aes;for(let o of n){let a=o.split(":")[0];if(a===r.user){e.k=o;break}let s=r.shareKeys[a];if(s){e.k=o,i=Iy[a],i||(i=Iy[a]=new oe(s));break}}this.loadMetadata(i,e)}}loadAttributes(){throw Error("This is not needed for files loaded from logged in sessions")}mkdir(e,r){if(!this.directory)throw Error("node isn't a directory");let[n,i]=J(r);if(typeof e=="string"&&(e={name:e}),e.attributes||(e.attributes={}),e.name&&(e.attributes.n=e.name),!e.attributes.n)throw Error("file name is required");if(e.target||(e.target=this),e.key||(e.key=h.Buffer.from(globalThis.crypto.getRandomValues(new Uint8Array(16)))),e.key.length!==16)throw Error("wrong key length, must be 128bit");let o=e.key,a=t.packAttributes(e.attributes);Ae(o).encryptCBC(a);let s=h.Buffer.from(o);this.storage.aes.encryptECB(s);let l={a:"p",t:e.target.nodeId?e.target.nodeId:e.target,n:[{h:"xxxxxxxx",t:1,a:U(a),k:U(s)}]},f=_r(this.storage.shareKeys,this);return f.length>0&&(l.cr=rn(this.storage,[{nodeId:"xxxxxxxx",key:o}],f)),this.api.request(l,(c,d)=>{if(c)return n(c);let g=this.storage._importFile(d.f[0]);this.storage.emit("add",g),n(null,g)}),i}upload(e,r,n){if(!this.directory)throw Error("node is not a directory");arguments.length===2&&typeof r=="function"&&([n,r]=[r,null]);let[i,o]=J(n);if(typeof e=="string"&&(e={name:e}),e.attributes||(e.attributes={}),e.name&&(e.attributes.n=e.name),!e.attributes.n)throw Error("File name is required.");if(!(typeof e.size=="number"&&e.size>=0)&&!(r&&typeof r.pipe!="function"&&typeof r.length=="number")&&!e.allowUploadBuffering)throw Error("Specify a file size or set allowUploadBuffering to true");e.target||(e.target=this);let a,s=se(e.key);s||(s=globalThis.crypto.getRandomValues(new Uint8Array(24))),s instanceof h.Buffer||(s=h.Buffer.from(s));let l=e.uploadCiphertext?32:24;if(s.length!==l)throw Error("Wrong key length. Key must be 192bit");e.uploadCiphertext&&(a=s,s=Va(s).slice(0,24)),e.key=s;let f=[],c=(p,E,m,A)=>{if(p)return g(p);if(!m||m.length===0){g(Error("Server returned a invalid response while uploading"));return}let S=Number(m.toString());if(S<0){g(Error("Server returned error "+S+" while uploading"));return}if(f[E]=m,E===0&&!a&&(a=A.key),e.thumbnailImage&&!f[1]||e.previewImage&&!f[2]||!f[0])return;let R=t.packAttributes(e.attributes);Ae(a).encryptCBC(R);let k=h.Buffer.from(a);this.storage.aes.encryptECB(k);let v={h:U(f[0]),t:0,a:U(R),k:U(k)};f.length!==1&&(v.fa=f.slice(1).map((D,X)=>X+"*"+U(D)).filter(D=>D).join("/"));let I={a:"p",t:e.target.nodeId?e.target.nodeId:e.target,n:[v]},W=_r(this.storage.shareKeys,this);W.length>0&&(I.cr=rn(this.storage,[{nodeId:v.h,key:a}],W)),this.api.request(I,(D,X)=>{if(D)return g(D);let j=this.storage._importFile(X.f[0]);this.storage.emit("add",j),d.emit("complete",j),i&&i(null,j)})};e.thumbnailImage&&this._uploadAttribute(e,e.thumbnailImage,1,c),e.previewImage&&this._uploadAttribute(e,e.previewImage,2,c);let d=this._upload(e,r,0,c);function g(p){d.listenerCount("error")?d.emit("error",p):i(p)}return d.complete=o,d}_upload(e,r,n,i){let o=e.uploadCiphertext?new Ls.PassThrough:ui(e.key),a=o,s=e.size;return r&&typeof r.pipe!="function"&&(s=r.length,a.end(r)),s!=null?(s===0&&o.end(),this._uploadWithSize(a,s,o,n,e,i)):a=kd(a,l=>{this._uploadWithSize(a,l,o,n,e,i)}),r&&typeof r.pipe=="function"&&r.pipe(a),a}_uploadAttribute(e,r,n,i){let o=(a,s)=>{if(a)return i(a);let l=s.length,f=Math.ceil(l/16)*16-l;f!==0&&(s=h.Buffer.concat([s,h.Buffer.alloc(f)])),(e.handle?Ae(e.key):new oe(e.key.slice(0,16))).encryptCBC(s);let d=new Ls.PassThrough;d.end(s),this._uploadWithSize(d,s.length,d,n,e,i)};if(r instanceof h.Buffer){o(null,r);return}ai(r,o)}_uploadWithSize(e,r,n,i,o,a){let s=De.handleForceHttps(o.forceHttps)?2:0,l=i===0?{a:"u",ssl:s,s:r,ms:0,r:0,e:0,v:2}:{a:"ufa",ssl:s,s:r};o.handle&&(l.h=o.handle);let f=i===0?o.initialChunkSize||128*1024:r,c=o.chunkSizeIncrement||128*1024,d=o.maxChunkSize||1024*1024,g=o.maxConnections||4,p=o.handleRetries||Fe.defaultHandleRetries,E=f,m=0,A=!1,S=0,R,k,v,I,W,D=0,X=()=>{I=Math.min(E,r-S),k=h.Buffer.alloc(I),m++,E<d&&(E+=c),W=0,R&&(R.copy(k),W=Math.min(R.length,I),R=R.length>I?R.slice(I):null),W===I?j():(A=!0,je())},j=()=>{let C=S,F=k,ue=0,Qe=()=>{ue++,this.api.fetch(v+"/"+(i===0?C:i-1),{method:"POST",body:F,headers:{"content-length":F.length}}).then(ce=>{if(ce.status!==200)throw Error("MEGA returned a "+ce.status+" status code");return ce.arrayBuffer()}).then(ce=>{D+=F.length,e.emit("progress",{bytesLoaded:ee,bytesUploaded:D,bytesTotal:r});let le=h.Buffer.from(ce);le.length>0?(n.end(),y.nextTick(()=>{a(null,i,le,n)})):S<r&&!A&&X()},ce=>{p(ue,ce,le=>{le?e.emit("error",le):Qe()})})};Qe(),k=null,S+=I,S<r&&!A&&m<g&&X()},ee=0,je=()=>{for(;;){let C=n.read();if(C===null){n.once("readable",je);break}if(ee+=C.length,C.copy(k,W),W+=C.length,W>=I){A=!1,R=C.slice(C.length-(W-I)),j();break}}};n.on("end",()=>{r&&ee!==r&&e.emit("error",Error("Specified data size does not match: "+r+" !== "+ee))}),this.api.request(l,(C,F)=>{if(C)return a(C);v=F.p,X()})}uploadAttribute(e,r,n){let[i,o]=J(n);if(typeof e=="string"&&(e=["thumbnail","preview"].indexOf(e)),e!==0&&e!==1)throw Error("Invalid attribute type");return this._uploadAttribute({key:this.key,handle:this.nodeId},r,e+1,(a,s,l,f)=>{if(a)return i(a);let c={a:"pfa",n:this.nodeId,fa:e+"*"+U(l)};this.api.request(c,(d,g)=>{if(d)return i(d);i(null,this)})}),o}delete(e,r){return typeof e=="function"&&(r=e,e=void 0),typeof e>"u"&&(e=this.parent===this.storage.trash),e?this.api.request({a:"d",n:this.nodeId},r):this.moveTo(this.storage.trash,r)}moveTo(e,r){if(typeof e=="string"&&(e=this.storage.files[e]),!(e instanceof Fe))throw Error("target must be a folder or a nodeId");let n={a:"m",n:this.nodeId,t:e.nodeId},i=_r(this.storage.shareKeys,e);return i.length>0&&(n.cr=rn(this.storage,[this],i)),this.api.request(n,r)}copyTo(e,r){if(typeof e=="string"&&(e=this.storage.files[e]),!(e instanceof Fe))throw Error("target must be a folder or a nodeId");let n=t.packAttributes(this.attributes);Ae(this.key).encryptCBC(n);let i={a:"p",sm:1,v:3,t:e.nodeId,n:[{k:U(this.storage.aes.encryptECB(this.key)),a:U(n),h:this.nodeId,t:0}]},o=_r(this.storage.shareKeys,e);return o.length>0&&(i.cr=rn(this.storage,[{nodeId:this.nodeId,key:this.key}],o)),this.api.request(i,r)}setAttributes(e,r){let[n,i]=J(r);Object.assign(this.attributes,e);let o=t.packAttributes(this.attributes);return Ae(this.key).encryptCBC(o),this.api.request({a:"a",n:this.nodeId,at:U(o)},a=>{this.parseAttributes(this.attributes),n(a)}),i}rename(e,r){return this.setAttributes({n:e},r)}setLabel(e,r){if(typeof e=="string"&&(e=Ms.indexOf(e)),typeof e!="number"||Math.floor(e)!==e||e<0||e>7)throw Error("label must be a integer between 0 and 7 or a valid label name");return this.setAttributes({lbl:e},r)}setFavorite(e,r){return this.setAttributes({fav:e?1:0},r)}link(e,r){arguments.length===1&&typeof e=="function"&&(r=e,e={noKey:!1}),typeof e=="boolean"&&(e={noKey:e}),e||(e={});let n=e.__folderKey;if(this.directory&&!n)return this.shareFolder(e,r);let[i,o]=J(r);return this.api.request({a:"l",n:this.nodeId},(a,s)=>{if(a)return i(a);let l=`https://mega.nz/${n?"folder":"file"}/${s}`;!e.noKey&&this.key&&(l+=`#${U(n||this.key)}`),i(null,l)}),o}shareFolder(e,r){if(!this.directory)throw Error("node isn't a folder");let n=this.nodeId,i=this.storage.shareKeys[n];if(i)return this.link(Object.assign({__folderKey:i},e),r);let o=se(e.key);o||(o=globalThis.crypto.getRandomValues(new Uint8Array(16))),o instanceof h.Buffer||(o=h.Buffer.from(o));let[a,s]=J(r);if(o.length!==16)return a(Error("share key must be 16 byte / 22 characters")),s;this.storage.shareKeys[n]=o;let l=h.Buffer.from(n+n);this.storage.aes.encryptECB(l);let f={a:"s2",n,s:[{u:"EXP",r:0}],ok:U(this.storage.aes.encryptECB(h.Buffer.from(o))),ha:U(l),cr:rn(this.storage,this)};return this.api.request(f,c=>{if(c)return a(c);this.link(Object.assign({__folderKey:o},e),a)}),s}unshare(e){return this.directory?this.unshareFolder(e):this.api.request({a:"l",n:this.nodeId,d:1},e)}unshareFolder(e){if(!this.directory)throw Error("node isn't a folder");return delete this.storage.shareKeys[this.nodeId],this.api.request({a:"s2",n:this.nodeId,s:[{u:"EXP",r:""}]},e)}importFile(e,r){let[n,i]=J(r);if(!this.directory)throw Error("importFile can only be called on directories");if(typeof e=="string"&&(e=Fe.fromURL(e)),!(e instanceof Fe))throw Error("First argument of importFile should be a File or a URL string");if(!e.key)return n(Error("Can't import files without encryption keys")),i;let o=(a,s)=>{if(a)return n(a);let l=t.packAttributes(s.attributes);Ae(s.key).encryptCBC(l);let f=Array.isArray(s.downloadId)?s.downloadId[1]:s.downloadId,c={a:"p",t:this.nodeId,n:[{ph:f,t:0,a:U(l),k:U(this.storage.aes.encryptECB(s.key))}]};this.api.request(c,(d,g)=>{if(d)return n(d);let p=this.storage._importFile(g.f[0]);this.storage.emit("add",p),n(null,p)})};return e.attributes?o(null,e):e.loadAttributes(o),i}static packAttributes(e){let r=JSON.stringify(e);r=h.Buffer.from(`MEGA${r}`);let n=h.Buffer.alloc(Math.ceil(r.length/16)*16);return r.copy(n),n}};Fi=Cs});var Py,qs,IR,OR,PR,Ds,By=_e(()=>{u();sr();Hd();Vr();Py=Re(Ie(),1);Ns();nr();qs=class t extends Py.EventEmitter{constructor(e,r){super(),arguments.length===1&&typeof e=="function"&&(r=e,e={});let[n,i]=J(r);this.ready=i,e.keepalive=e.keepalive===void 0?!0:!!e.keepalive,e.autoload=e.autoload===void 0?!0:!!e.autoload,e.autologin=e.autologin===void 0?!0:!!e.autologin,this.api=new De(e.keepalive,e),this.files={},this.options=e,this.status="closed",e.autologin?this.login(n):y.nextTick(()=>{n(null,this)})}login(e){let[r,n]=J(e);if(typeof this.options.email!="string")return y.nextTick(()=>{r(Error("starting a session without credentials isn't supported"))}),n;let i=()=>{this.status="ready",r(null,this),this.emit("ready",this)},o=f=>{this.api.request({a:"ug"},(c,d)=>{if(c)return f(c);this.name=d.name,this.user=d.u,this.options.autoload?this.reload(!0,g=>{if(g)return f(g);i()}):i()})};this.email=this.options.email.toLowerCase();let a=()=>{let f=Ha(h.Buffer.from(this.options.password)),c=new oe(f),d=U(c.stringhash(h.Buffer.from(this.email))),g={a:"us",user:this.email,uh:d};l(g,c)},s=f=>{Ga(h.Buffer.from(this.options.password),f,(c,d)=>{if(c)return r(c);let g=new oe(d.slice(0,16)),p=U(d.slice(16)),E={a:"us",user:this.email,uh:p};l(E,g)})},l=(f,c)=>{delete this.options.password,this.options.secondFactorCode&&(f.mfa=this.options.secondFactorCode.toString()),this.api.request(f,(d,g)=>{if(d)return r(d);this.key=se(g.k),c.decryptECB(this.key),this.aes=new oe(this.key);let p=se(g.csid),E=this.aes.decryptECB(se(g.privk)),m=$d(E);if(!m)throw Error("invalid credentials");let A=U(za(p,m).slice(0,43));this.api.sid=this.sid=A,this.RSAPrivateKey=m,o(r)})};return this.api.request({a:"us0",user:this.email},(f,c)=>{if(f)return r(f);if(c.v===1)return a();if(c.v===2)return s(c);r(Error("Account version not supported"))}),this.status="connecting",n}reload(e,r){typeof e=="function"&&([e,r]=[r,e]);let[n,i]=J(r);return this.status==="connecting"&&!e?(this.once("ready",()=>{this.reload(e,n)}),i):(this.mounts=[],this.api.request({a:"f",c:1},(o,a)=>{if(o)return n(o);this.shareKeys=a.ok.reduce((s,l)=>{let f=l.h,c=this.aes.encryptECB(h.Buffer.from(f+f));return qd(se(l.ha),c)&&(s[f]=this.aes.decryptECB(se(l.k))),s},{});for(let s of a.f)if(s=this._importFile(s),a.ph!==void 0&&(s.shareId=a.ph.find(l=>l.h===s.nodeId)?.ph,s.shared=!!s.shareId,s.shared)){s.shareURL=`https://mega.nz/${s.directory?"folder":"file"}/${s.shareId}`;let l=s.directory?this.shareKeys[s.nodeId]:s.key;l&&(s.shareURL+="#"+U(l))}n(null,this.mounts)}),this.api.on("sc",o=>{let a={};o.forEach(s=>{if(s.a==="u"){let l=this.files[s.n];l&&(l.timestamp=s.ts,l.decryptAttributes(s.at),l.emit("update"),this.emit("update",l))}else s.a==="d"?a[s.n]=!0:s.a==="t"&&s.t.f.forEach(l=>{let f=this.files[l.h];if(f){delete a[l.h];let c=f.parent;if(c.nodeId===l.p)return;c.children.splice(c.children.indexOf(f),1),f.parent=this.files[l.p],f.parent.children.push(f),f.emit("move",c),this.emit("move",f,c)}else this.emit("add",this._importFile(l))})}),Object.keys(a).forEach(s=>{let l=this.files[s],f=l.parent;f.children.splice(f.children.indexOf(l),1),this.emit("delete",l),l.emit("delete")})}),i)}_importFile(e){if(!this.files[e.h]){let r=this.files[e.h]=new Fi(e,this);if(e.t===IR&&(this.root=r,r.name="Cloud Drive"),e.t===PR&&(this.trash=r,r.name="Rubbish Bin"),e.t===OR&&(this.inbox=r,r.name="Inbox"),e.t>1&&this.mounts.push(r),e.p){let n=this.files[e.p];n&&(n.children.push(r),r.parent=n)}}return this.files[e.h]}mkdir(e,r){if(this.status!=="ready")throw Error("storage is not ready");return this.root.mkdir(e,r)}upload(e,r,n){if(this.status!=="ready")throw Error("storage is not ready");return this.root.upload(e,r,n)}find(e,r){if(this.status!=="ready")throw Error("storage is not ready");return this.root.find(e,r)}filter(e,r){if(this.status!=="ready")throw Error("storage is not ready");return this.root.filter(e,r)}navigate(e,r){if(this.status!=="ready")throw Error("storage is not ready");return this.root.navigate(e,r)}close(e){return this.status="closed",this.api.close(),this.api.request({a:"sml"},e)}getAccountInfo(e){let[r,n]=J(e);return this.api.request({a:"uq",strg:1,xfer:1,pro:1},(i,o)=>{i&&r(i);let a={};a.type=o.utype,a.spaceUsed=o.cstrg,a.spaceTotal=o.mstrg,a.downloadBandwidthTotal=o.mxfer||Math.pow(1024,5)*10,a.downloadBandwidthUsed=o.caxfer||0,a.sharedBandwidthUsed=o.csxfer||0,a.sharedBandwidthLimit=o.srvratio,r(null,a)}),n}toJSON(){return{key:U(this.key),sid:this.sid,name:this.name,user:this.user,options:this.options}}static fromJSON(e){let r=new t(Object.assign(e.options,{autoload:!1,autologin:!1}));return r.key=ar(e.key),r.aes=new oe(r.key),r.api.sid=r.sid=e.sid,r.name=e.name,r.user=e.user,r}decryptRsaKey(e){return za(e,this.RSAPrivateKey)}},IR=2,OR=3,PR=4,Ds=qs});var BR=_((k2,My)=>{u();sr();By();Ns();ks();Vr();function Xe(t,e){return new Ds(t,e)}Xe.Storage=Ds;Xe.File=Fe;Xe.MutableFile=Fi;Xe.API=De;Xe.file=Fe.fromURL;Xe.encrypt=ui;Xe.decrypt=ci;Xe.verify=Nd;My.exports=Xe});return BR();})();
12
+ /*! Bundled license information:
13
+
14
+ ieee754/index.js:
15
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
16
+
17
+ buffer/index.js:
18
+ (*!
19
+ * The buffer module from node.js, for the browser.
20
+ *
21
+ * @author Feross Aboukhadijeh <https://feross.org>
22
+ * @license MIT
23
+ *)
24
+
25
+ safe-buffer/index.js:
26
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
27
+ */