1(self.webpackChunkweb3_onboarding_starter_kits=self.webpackChunkweb3_onboarding_starter_kits||[]).push([[346],{566:(e,t,n)=>{"use strict";const{AbortError:r,codes:i}=n(31693),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:s}=n(8515),l=n(84288),{ERR_INVALID_ARG_TYPE:d}=i;e.exports.addAbortSignal=function(t,n){if(((e,t)=>{if("object"!==typeof e||!("aborted"in e))throw new d(t,"AbortSignal",e)})(t,"signal"),!o(n)&&!a(n))throw new d("stream",["ReadableStream","WritableStream","Stream"],n);return e.exports.addAbortSignalNoValidate(t,n)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!==typeof e||!("aborted"in e))return t;const n=o(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[s](new r(void 0,{cause:e.reason}))};return e.aborted?n():(e.addEventListener("abort",n),l(t,(()=>e.removeEventListener("abort",n)))),t}},93282:(e,t,n)=>{"use strict";const{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:a}=n(81981),{Buffer:s}=n(19778),{inspect:l}=n(10224);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?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(0===this.length)return"";let t=this.head,n=""+t.data;for(;null!==(t=t.next);)n+=e+t.data;return n}concat(e){if(0===this.length)return s.alloc(0);const t=s.allocUnsafe(e>>>0);let n=this.head,r=0;for(;n;)o(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){const n=this.head.data;if(e<n.length){const t=n.slice(0,e);return this.head.data=n.slice(e),t}return e===n.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{const o=n.data;if(!(e>o.length)){e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}t+=o,e-=o.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){const t=s.allocUnsafe(e),n=e;let r=this.head,i=0;do{const s=r.data;if(!(e>s.length)){e===s.length?(o(t,s,n-e),++i,r.next?this.head=r.next:this.head=this.tail=null):(o(t,new a(s.buffer,s.byteOffset,e),n-e),this.head=r,r.data=s.slice(e));break}o(t,s,n-e),e-=s.length,++i}while(null!==(r=r.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},30775:(e,t,n)=>{"use strict";const{pipeline:r}=n(33887),i=n(76531),{destroyer:o}=n(48506),{isNodeStream:a,isReadable:s,isWritable:l,isWebStream:d,isTransformStream:c,isWritableStream:u,isReadableStream:h}=n(8515),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:b}}=n(31693),g=n(84288);e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new b("streams");if(1===t.length)return i.from(t[0]);const y=[...t];if("function"===typeof t[0]&&(t[0]=i.from(t[0])),"function"===typeof t[t.length-1]){const e=t.length-1;t[e]=i.from(t[e])}for(let r=0;r<t.length;++r)if(a(t[r])||d(t[r])){if(r<t.length-1&&!(s(t[r])||h(t[r])||c(t[r])))throw new p(`streams[${r}]`,y[r],"must be readable");if(r>0&&!(l(t[r])||u(t[r])||c(t[r])))throw new p(`streams[${r}]`,y[r],"must be writable")}let w,_,m,v,S;const E=t[0],R=r(t,(function(e){const t=v;v=null,t?t(e):e?S.destroy(e):T||A||S.destroy()})),A=!!(l(E)||u(E)||c(E)),T=!!(s(R)||h(R)||c(R));if(S=new i({writableObjectMode:!(null===E||void 0===E||!E.writableObjectMode),readableObjectMode:!(null===R||void 0===R||!R.writableObjectMode),writable:A,readable:T}),A){if(a(E))S._write=function(e,t,n){E.write(e,t)?n():w=n},S._final=function(e){E.end(),_=e},E.on("drain",(function(){if(w){const e=w;w=null,e()}}));else if(d(E)){const e=(c(E)?E.writable:E).getWriter();S._write=async function(t,n,r){try{await e.ready,e.write(t).catch((()=>{})),r()}catch(i){r(i)}},S._final=async function(t){try{await e.ready,e.close().catch((()=>{})),_=t}catch(n){t(n)}}}const e=c(R)?R.readable:R;g(e,(()=>{if(_){const e=_;_=null,e()}}))}if(T)if(a(R))R.on("readable",(function(){if(m){const e=m;m=null,e()}})),R.on("end",(function(){S.push(null)})),S._read=function(){for(;;){const e=R.read();if(null===e)return void(m=S._read);if(!S.push(e))return}};
1else if(d(R)){const e=(c(R)?R.readable:R).getReader();S._read=async function(){for(;;)try{const{value:t,done:n}=await e.read();if(!S.push(t))return;if(n)return void S.push(null)}catch{return}}}return S._destroy=function(e,t){e||null===v||(e=new f),m=null,w=null,_=null,null===v?t(e):(v=t,a(R)&&o(R,e))},S}},48506:(e,t,n)=>{"use strict";const r=n(1426),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:a}=n(31693),{Symbol:s}=n(81981),{kDestroyed:l,isDestroyed:d,isFinished:c,isServerRequest:u}=n(8515),h=s("kDestroy"),f=s("kConstruct");function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function b(e,t,n){let i=!1;function o(t){if(i)return;i=!0;const o=e._readableState,a=e._writableState;p(t,a,o),a&&(a.closed=!0),o&&(o.closed=!0),"function"===typeof n&&n(t),t?r.nextTick(g,e,t):r.nextTick(y,e)}try{e._destroy(t||null,o)}catch(t){o(t)}}function g(e,t){w(e,t),y(e)}function y(e){const t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!==n&&void 0!==n&&n.emitClose||null!==t&&void 0!==t&&t.emitClose)&&e.emit("close")}function w(e,t){const n=e._readableState,r=e._writableState;null!==r&&void 0!==r&&r.errorEmitted||null!==n&&void 0!==n&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit("error",t))}function _(e,t,n){const i=e._readableState,o=e._writableState;if(null!==o&&void 0!==o&&o.destroyed||null!==i&&void 0!==i&&i.destroyed)return this;null!==i&&void 0!==i&&i.autoDestroy||null!==o&&void 0!==o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(w,e,t):w(e,t))}function m(e){let t=!1;
1function n(n){if(t)return void _(e,null!==n&&void 0!==n?n:new o);t=!0;const i=e._readableState,a=e._writableState,s=a||i;i&&(i.constructed=!0),a&&(a.constructed=!0),s.destroyed?e.emit(h,n):n?_(e,n,!0):r.nextTick(v,e)}try{e._construct((e=>{r.nextTick(n,e)}))}catch(i){r.nextTick(n,i)}}function v(e){e.emit(f)}function S(e){return(null===e||void 0===e?void 0:e.setHeader)&&"function"===typeof e.abort}function E(e){e.emit("close")}function R(e,t){e.emit("error",t),r.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!==typeof e._construct)return;const n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(f,t),e.listenerCount(f)>1||r.nextTick(m,e)},destroyer:function(e,t){e&&!d(e)&&(t||c(e)||(t=new a),u(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"===typeof e.destroy?e.destroy(t):"function"===typeof e.close?e.close():t?r.nextTick(R,e,t):r.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const n=this._readableState,r=this._writableState,o=r||n;return null!==r&&void 0!==r&&r.destroyed||null!==n&&void 0!==n&&n.destroyed?("function"===typeof t&&t(),this):(p(e,r,n),r&&(r.destroyed=!0),n&&(n.destroyed=!0),o.constructed?b(this,e,t):this.once(h,(function(n){b(this,i(n,e),t)})),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:_}},76531:(e,t,n)=>{"use strict";const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:a}=n(81981);e.exports=d;const s=n(12716),l=n(24213);a(d.prototype,s.prototype),a(d,s);{const e=o(l.prototype);for(let t=0;t<e.length;t++){const n=e[t];d.prototype[n]||(d.prototype[n]=l.prototype[n])}}function d(e){if(!(this instanceof d))return new d(e);s.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let c,u;function h(){return void 0===c&&(c={}),c}r(d.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),d.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},d.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},d.from=function(e){return u||(u=n(41290)),u(e,"body")}},41290:(e,t,n)=>{const r=n(1426),i=n(19778),{isReadable:o,isWritable:a,isIterable:s,isNodeStream:l,isReadableNodeStream:d,isWritableNodeStream:c,isDuplexNodeStream:u}=n(8515),h=n(84288),{AbortError:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:b}}=n(31693),{destroyer:g}=n(48506),y=n(76531),w=n(12716),{createDeferredPromise:_}=n(10224),m=n(44741),v=globalThis.Blob||i.Blob,S="undefined"!==typeof v?function(e){return e instanceof v}:function(e){return!1},E=globalThis.AbortController||n(35935).AbortController,{FunctionPrototypeCall:R}=n(81981);class A extends y{constructor(e){super(e),!1===(null===e||void 0===e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null===e||void 0===e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!==typeof e.readable.read?w.wrap(e.readable):e.readable,n=e.writable;let r,i,s,l,d,c=!!o(t),u=!!a(n);function p(e){const t=l;l=null,t?t(e):e&&d.destroy(e)}return d=new A({readableObjectMode:!(null===t||void 0===t||!t.readableObjectMode),writableObjectMode:!(null===n||void 0===n||!n.writableObjectMode),readable:c,writable:u}),u&&(h(n,(e=>{u=!1,e&&g(t,e),p(e)})),d._write=function(e,t,i){n.write(e,t)?i():r=i},d._final=function(e){n.end(),i=e},n.on("drain",(function(){if(r){const e=r;r=null,e()}})),n.on("finish",(function(){if(i){const e=i;i=null,e()}}))),c&&(h(t,(e=>{c=!1,e&&g(t,e),p(e)})),t.on("readable",(function(){if(s){const e=s;s=null,e()}})),t.on("end",(function(){d.push(null)})),d._read=function(){for(;;){const e=t.read();if(null===e)return void(s=d._read);if(!d.push(e))return}}),d._destroy=function(e,o){e||null===l||(e=new f),s=null,r=null,i=null,null===l?o(e):(l=o,g(n,e),g(t,e))},d}e.exports=function e(t,n){if(u(t))return t;if(d(t))return T({readable:t});if(c(t))return T({writable:t});if(l(t))return T({writable:!1,readable:!1});if("function"===typeof t){const{value:e,write:i,final:o,destroy:a}=function(e){let{promise:t,resolve:n}=_();const i=new E,o=i.signal,a=e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:a,cb:s}=await e;if(r.nextTick(s),a)return;if(o.aborted)throw new f(void 0,{cause:o.reason});({promise:t,resolve:n}=_()),yield i}}(),{signal:o});return{value:a,write(e,t,r){const i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){const t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return m(A,e,{objectMode:!0,write:i,final:o,destroy:a});const l=null===e||void 0===e?void 0:e.then;if("function"===typeof l){let t;const n=R(l,e,(e=>{if(null!=e)throw new b("nully","body",e)}),(e=>{g(t,e)}));return t=new A({objectMode:!0,readable:!1,write:i,final(e){o((async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}}))},destroy:a})}throw new b("Iterable, AsyncIterable or AsyncFunction",n,e)}if(S(t))return e(t.arrayBuffer());if(s(t))return m(A,t,{objectMode:!0,writable:!1});if("object"===typeof(null===t||void 0===t?void 0:t.writable)||"object"===typeof(null===t||void 0===t?void 0:t.readable)){return T({readable:null!==t&&void 0!==t&&t.readable?d(null===t||void 0===t?void 0:t.readable)?null===t||void 0===t?void 0:t.readable:e(t.readable):void 0,writable:null!==t&&void 0!==t&&t.writable?c(null===t||void 0===t?void 0:t.writable)?null===t||void 0===t?void 0:t.writable:e(t.writable):void 0})}const i=null===t||void 0===t?void 0:t.then;if("function"===typeof i){let e;return R(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{g(e,t)})),e=new A({objectMode:!0,writable:!1,read(){}})}throw new p(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}}
1,84288:(e,t,n)=>{const r=n(1426),{AbortError:i,codes:o}=n(31693),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=o,{kEmptyObject:l,once:d}=n(10224),{validateAbortSignal:c,validateFunction:u,validateObject:h,validateBoolean:f}=n(96168),{Promise:p,PromisePrototypeThen:b}=n(81981),{isClosed:g,isReadable:y,isReadableNodeStream:w,isReadableStream:_,isReadableFinished:m,isReadableErrored:v,isWritable:S,isWritableNodeStream:E,isWritableStream:R,isWritableFinished:A,isWritableErrored:T,isNodeStream:I,willEmitClose:k,kIsClosedPromise:N}=n(8515);const O=()=>{};function P(e,t,n){var o,f;if(2===arguments.length?(n=t,t=l):null==t?t=l:h(t,"options"),u(n,"callback"),c(t.signal,"options.signal"),n=d(n),_(e)||R(e))return function(e,t,n){let o=!1,a=O;if(t.signal)if(a=()=>{o=!0,n.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)r.nextTick(a);else{const r=n;n=d((function(){t.signal.removeEventListener("abort",a);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];r.apply(e,i)})),t.signal.addEventListener("abort",a)}const s=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];o||r.nextTick((()=>n.apply(e,i)))};return b(e[N].promise,s,s),O}(e,t,n);if(!I(e))throw new a("stream",["ReadableStream","WritableStream","Stream"],e);const p=null!==(o=t.readable)&&void 0!==o?o:w(e),P=null!==(f=t.writable)&&void 0!==f?f:E(e),L=e._writableState,x=e._readableState,C=()=>{e.writable||j()};let M=k(e)&&w(e)===p&&E(e)===P,D=A(e,!1);const j=()=>{D=!0,e.destroyed&&(M=!1),(!M||e.readable&&!p)&&(p&&!W||n.call(e))};let W=m(e,!1);const $=()=>{W=!0,e.destroyed&&(M=!1),(!M||e.writable&&!P)&&(P&&!D||n.call(e))},U=t=>{n.call(e,t)};let F=g(e);const B=()=>{F=!0;const t=T(e)||v(e);return t&&"boolean"!==typeof t?n.call(e,t):p&&!W&&w(e,!0)&&!m(e,!1)?n.call(e,new s):!P||D||A(e,!1)?void n.call(e):n.call(e,new s)},H=()=>{F=!0;const t=T(e)||v(e);if(t&&"boolean"!==typeof t)return n.call(e,t);n.call(e)},q=()=>{e.req.on("finish",j)};!function(e){return e.setHeader&&"function"===typeof e.abort}(e)?P&&!L&&(e.on("end",C),e.on("close",C)):(e.on("complete",j),M||e.on("abort",B),e.req?q():e.on("request",q)),M||"boolean"!==typeof e.aborted||e.on("aborted",B),e.on("end",$),e.on("finish",j),!1!==t.error&&e.on("error",U),e.on("close",B),F?r.nextTick(B):null!==L&&void 0!==L&&L.errorEmitted||null!==x&&void 0!==x&&x.errorEmitted?M||r.nextTick(H):(p||M&&!y(e)||!D&&!1!==S(e))&&(P||M&&!S(e)||!W&&!1!==y(e))?x&&e.req&&e.aborted&&r.nextTick(H):r.nextTick(H);const G=()=>{n=O,e.removeListener("aborted",B),e.removeListener("complete",j),e.removeListener("abort",B),e.removeListener("request",q),e.req&&e.req.removeListener("finish",j),e.removeListener("end",C),e.removeListener("close",C),e.removeListener("finish",j),e.removeListener("end",$),e.removeListener("error",U),e.removeListener("close",B)};if(t.signal&&!F){const o=()=>{const r=n;G(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)r.nextTick(o);else{const r=n;n=d((function(){t.signal.removeEventListener("abort",o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];r.apply(e,i)})),t.signal.addEventListener("abort",o)}}return G}e.exports=P,e.exports.finished=function(e,t){var n;let r=!1;return null===t&&(t=l),null!==(n=t)&&void 0!==n&&n.cleanup&&(f(t.cleanup,"cleanup"),r=t.cleanup),new p(((n,i)=>{const o=P(e,t,(e=>{r&&o(),e?i(e):n()}))}))}},44741:(e,t,n)=>{"use strict";const r=n(1426),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:a}=n(81981),{Buffer:s}=n(19778),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:d}=n(31693).codes;e.exports=function(e,t,n){let c,u;if("string"===typeof t||t instanceof s)return new e({objectMode:!0,...n,read(){this.push(t),this.push(null)}});if(t&&t[o])u=!0,c=t[o]();else{if(!t||!t[a])throw new l("iterable",["Iterable"],t);u=!1,c=t[a]()}const h=new e({objectMode:!0,highWaterMark:1,...n});let f=!1;return h._read=function(){f||(f=!0,async function(){for(;;){try{const{value:e,done:t}=u?await c.next():c.next();if(t)h.push(null);else{const t=e&&"function"===typeof e.then?await e:e;if(null===t)throw f=!1,new d;if(h.push(t))continue;f=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=void 0!==e&&null!==e,n="function"===typeof c.throw;if(t&&n){const{value:t,done:n}=await c.throw(e);if(await t,n)return}if("function"===typeof c.return){const{value:e}=await c.return();await e}}(e),(()=>r.nextTick(t,e)),(n=>r.nextTick(t,n||e)))},h}}
1,46514:(e,t,n)=>{"use strict";const{ArrayIsArray:r,ObjectSetPrototypeOf:i}=n(81981),{EventEmitter:o}=n(47465);function a(e){o.call(this,e)}function s(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}i(a.prototype,o.prototype),i(a,o),a.prototype.pipe=function(e,t){const n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",l),n.on("close",d));let a=!1;function l(){a||(a=!0,e.end())}function d(){a||(a=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){u(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function u(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",l),n.removeListener("close",d),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return s(n,"error",c),s(e,"error",c),n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e},e.exports={Stream:a,prependListener:s}},96553:(e,t,n)=>{"use strict";const r=globalThis.AbortController||n(35935).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:l}=n(31693),{validateAbortSignal:d,validateInteger:c,validateObject:u}=n(96168),h=n(81981).Symbol("kWeak"),{finished:f}=n(84288),p=n(30775),{addAbortSignalNoValidate:b}=n(566),{isWritable:g,isNodeStream:y}=n(8515),{ArrayPrototypePush:w,MathFloor:_,Number:m,NumberIsNaN:v,Promise:S,PromiseReject:E,PromisePrototypeThen:R,Symbol:A}=n(81981),T=A("kEmpty"),I=A("kEof");function k(e,t){if("function"!==typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&u(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&d(t.signal,"options.signal");let n=1;return null!=(null===t||void 0===t?void 0:t.concurrency)&&(n=_(t.concurrency)),c(n,"concurrency",1),async function*(){var i,o;const a=new r,s=this,d=[],c=a.signal,u={signal:c},h=()=>a.abort();let f,p;null!==t&&void 0!==t&&null!==(i=t.signal)&&void 0!==i&&i.aborted&&h(),null===t||void 0===t||null===(o=t.signal)||void 0===o||o.addEventListener("abort",h);let b=!1;function g(){b=!0}!async function(){try{for await(let t of s){var r;if(b)return;if(c.aborted)throw new l;try{t=e(t,u)}catch(o){t=E(o)}t!==T&&("function"===typeof(null===(r=t)||void 0===r?void 0:r.catch)&&t.catch(g),d.push(t),f&&(f(),f=null),!b&&d.length&&d.length>=n&&await new S((e=>{p=e})))}d.push(I)}catch(o){const e=E(o);R(e,void 0,g),d.push(e)}finally{var i;b=!0,f&&(f(),f=null),null===t||void 0===t||null===(i=t.signal)||void 0===i||i.removeEventListener("abort",h)}}();try{for(;;){for(;d.length>0;){const e=await d[0];if(e===I)return;if(c.aborted)throw new l;e!==T&&(yield e),d.shift(),p&&(p(),p=null)}await new S((e=>{f=e}))}}finally{a.abort(),b=!0,p&&(p(),p=null)}}.call(this)}async function N(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;for await(const n of O.call(this,e,t))return!0;return!1}function O(e,t){if("function"!==typeof e)throw new o("fn",["Function","AsyncFunction"],e);return k.call(this,(async function(t,n){return await e(t,n)?t:T}),t)}class P extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function L(e){if(e=m(e),v(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return null!=e&&u(e,"options"),null!=(null===e||void 0===e?void 0:e.signal)&&d(e.signal,"options.signal"),async function*(){let t=0;for await(const r of this){var n;if(null!==e&&void 0!==e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l({cause:e.signal.reason});yield[t++,r]}}.call(this)},drop:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return null!=t&&u(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&d(t.signal,"options.signal"),e=L(e),async function*(){var n;if(null!==t&&void 0!==t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const i of this){var r;if(null!==t&&void 0!==t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;e--<=0&&(yield i)}}.call(this)},filter:O,flatMap:function(e,t){const n=k.call(this,e,t);return async function*(){for await(const e of n)yield*e}.call(this)},map:k,take:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return null!=t&&u(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&d(t.signal,"options.signal"),e=L(e),async function*(){var n;if(null!==t&&void 0!==t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const i of this){var r;if(null!==t&&void 0!==t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;if(!(e-- >0))return;yield i}}.call(this)},compose:function(e,t){if(null!=t&&u(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&d(t.signal,"options.signal"),y(e)&&!g(e))throw new i("stream",e,"must be writable");const n=p(this,e);return null!==t&&void 0!==t&&t.signal&&b(t.signal,n),n}},e.exports.promiseReturningOperators={every:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;
1if("function"!==typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await N.call(this,(async function(){return!await e(...arguments)}),t)},forEach:async function(e,t){if("function"!==typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const n of k.call(this,(async function(t,n){return await e(t,n),T}),t));},reduce:async function(e,t,n){var i;if("function"!==typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=n&&u(n,"options"),null!=(null===n||void 0===n?void 0:n.signal)&&d(n.signal,"options.signal");let a=arguments.length>1;if(null!==n&&void 0!==n&&null!==(i=n.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await f(this.destroy(e)),e}const s=new r,c=s.signal;if(null!==n&&void 0!==n&&n.signal){const e={once:!0,[h]:this};n.signal.addEventListener("abort",(()=>s.abort()),e)}let p=!1;try{for await(const r of this){var b;if(p=!0,null!==n&&void 0!==n&&null!==(b=n.signal)&&void 0!==b&&b.aborted)throw new l;a?t=await e(t,r,{signal:c}):(t=r,a=!0)}if(!p&&!a)throw new P}finally{s.abort()}return t},toArray:async function(e){null!=e&&u(e,"options"),null!=(null===e||void 0===e?void 0:e.signal)&&d(e.signal,"options.signal");const t=[];for await(const r of this){var n;if(null!==e&&void 0!==e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,r)}return t},some:N,find:async function(e,t){for await(const n of O.call(this,e,t))return n}}},2708:(e,t,n)=>{"use strict";const{ObjectSetPrototypeOf:r}=n(81981);e.exports=o;const i=n(87782);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}r(o.prototype,i.prototype),r(o,i),o.prototype._transform=function(e,t,n){n(null,e)}},33887:(e,t,n)=>{const r=n(1426),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:a}=n(81981),s=n(84288),{once:l}=n(10224),d=n(48506),c=n(76531),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:f,ERR_MISSING_ARGS:p,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:y}=n(31693),{validateFunction:w,validateAbortSignal:_}=n(96168),{isIterable:m,isReadable:v,isReadableNodeStream:S,isNodeStream:E,isTransformStream:R,isWebStream:A,isReadableStream:T,isReadableEnded:I}=n(8515),k=globalThis.AbortController||n(35935).AbortController;let N,O;function P(e,t,n){let r=!1;e.on("close",(()=>{r=!0}));return{destroy:t=>{r||(r=!0,d.destroyer(e,t||new b("pipe")))},cleanup:s(e,{readable:t,writable:n},(e=>{r=!e}))}}function L(e){if(m(e))return e;if(S(e))return async function*(e){O||(O=n(12716));yield*O.prototype[a].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function x(e,t,n,r){let i,{end:a}=r,l=null;const d=e=>{if(e&&(i=e),l){const e=l;l=null,e()}},c=()=>new o(((e,t)=>{i?t(i):l=()=>{i?t(i):e()}}));t.on("drain",d);const h=s(t,{readable:!1},d);try{t.writableNeedDrain&&await c();for await(const n of e)t.write(n)||await c();a&&t.end(),await c(),n()}catch(f){n(i!==f?u(i,f):f)}finally{h(),t.off("drain",d)}}async function C(e,t,n,r){let{end:i}=r;R(t)&&(t=t.writable);const o=t.getWriter();try{for await(const t of e)await o.ready,o.write(t).catch((()=>{}));await o.ready,i&&await o.close(),n()}catch(a){try{await o.abort(a),n(a)}catch(a){n(a)}}}function M(e,t,o){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new p("streams");const a=new k,s=a.signal,l=null===o||void 0===o?void 0:o.signal,d=[];function u(){j(new y)}let b,g;_(l,"options.signal"),null===l||void 0===l||l.addEventListener("abort",u);const w=[];let I,O=0;function M(e){j(e,0===--O)}function j(e,n){if(!e||b&&"ERR_STREAM_PREMATURE_CLOSE"!==b.code||(b=e),b||n){for(;w.length;)w.shift()(b);null===l||void 0===l||l.removeEventListener("abort",u),a.abort(),n&&(b||d.forEach((e=>e())),r.nextTick(t,b,g))}}for(let F=0;F<e.length;F++){const B=e[F],H=F<e.length-1,q=F>0,G=H||!1!==(null===o||void 0===o?void 0:o.end),Z=F===e.length-1;if(E(B)){if(G){const{destroy:V,cleanup:K}=P(B,H,q);w.push(V),v(B)&&Z&&d.push(K)}function W(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&M(e)}B.on("error",W),v(B)&&Z&&d.push((()=>{B.removeListener("error",W)}))}if(0===F)if("function"===typeof B){if(I=B({signal:s}),!m(I))throw new f("Iterable, AsyncIterable or Stream","source",I)}else I=m(B)||S(B)||R(B)?B:c.from(B);else if("function"===typeof B){var $;if(R(I))I=L(null===($=I)||void 0===$?void 0:$.readable);else I=L(I);if(I=B(I,{signal:s}),H){if(!m(I,!0))throw new f("AsyncIterable",`transform[${F-1}]`,I)}else{var U;N||(N=n(2708));const z=new N({objectMode:!0}),Y=null===(U=I)||void 0===U?void 0:U.then;if("function"===typeof Y)O++,Y.call(I,(e=>{g=e,null!=e&&z.write(e),G&&z.end(),r.nextTick(M)}),(e=>{z.destroy(e),r.nextTick(M,e)}));else if(m(I,!0))O++,x(I,z,M,{end:G});else{if(!T(I)&&!R(I))throw new f("AsyncIterable or Promise","destination",I);{const Q=I.readable||I;O++,x(Q,z,M,{end:G})}}I=z;const{destroy:J,cleanup:X}=P(I,!1,!0);w.push(J),Z&&d.push(X)}}else if(E(B)){if(S(I)){O+=2;const ee=D(I,B,M,{end:G});v(B)&&Z&&d.push(ee)}else if(R(I)||T(I)){const te=I.readable||I;O++,x(te,B,M,{end:G})}else{if(!m(I))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],I);O++,x(I,B,M,{end:G})}I=B}else if(A(B)){if(S(I))O++,C(L(I),B,M,{end:G});else if(T(I)||m(I))O++,C(I,B,M,{end:G});else{if(!R(I))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],I);O++,C(I.readable,B,M,{end:G})}I=B}else I=c.from(B)}return(null!==s&&void 0!==s&&s.aborted||null!==l&&void 0!==l&&l.aborted)&&r.nextTick(u),I}function D(e,t,n,i){let{end:o}=i,a=!1;if(t.on("close",(()=>{a||n(new g)})),e.pipe(t,{end:!1}),o){function l(){a=!0,t.end()}I(e)?r.nextTick(l):e.once("end",l)}else n();return s(e,{readable:!0,writable:!1},(t=>{const r=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&r&&r.ended&&!r.errored&&!r.errorEmitted?e.once("end",n).once("error",n):n(t)})),s(t,{readable:!1,writable:!0},n)}
1e.exports={pipelineImpl:M,pipeline:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return M(t,l(function(e){return w(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(t)))}}},12716:(e,t,n)=>{const r=n(1426),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:l,ObjectKeys:d,ObjectSetPrototypeOf:c,Promise:u,SafeSet:h,SymbolAsyncIterator:f,Symbol:p}=n(81981);e.exports=$,$.ReadableState=W;const{EventEmitter:b}=n(47465),{Stream:g,prependListener:y}=n(46514),{Buffer:w}=n(19778),{addAbortSignal:_}=n(566),m=n(84288);let v=n(10224).debuglog("stream",(e=>{v=e}));const S=n(93282),E=n(48506),{getHighWaterMark:R,getDefaultHighWaterMark:A}=n(43427),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:I,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_OUT_OF_RANGE:N,ERR_STREAM_PUSH_AFTER_EOF:O,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:P}}=n(31693),{validateObject:L}=n(96168),x=p("kPaused"),{StringDecoder:C}=n(15948),M=n(44741);c($.prototype,g.prototype),c($,g);const D=()=>{},{errorOrDestroy:j}=E;function W(e,t,r){"boolean"!==typeof r&&(r=t instanceof n(76531)),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.readableObjectMode)),this.highWaterMark=e?R(this,e,"readableHighWaterMark",r):A(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[x]=null,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new C(e.encoding),this.encoding=e.encoding)}function $(e){if(!(this instanceof $))return new $(e);const t=this instanceof n(76531);this._readableState=new W(e,this,t),e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&_(e.signal,this)),g.call(this,e),E.construct(this,(()=>{this._readableState.needReadable&&G(this,this._readableState)}))}function U(e,t,n,r){v("readableAddChunk",t);const i=e._readableState;let o;if(i.objectMode||("string"===typeof t?(n=n||i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=w.from(t,n).toString(i.encoding):(t=w.from(t,n),n=""))):t instanceof w?n="":g._isUint8Array(t)?(t=g._uint8ArrayToBuffer(t),n=""):null!=t&&(o=new I("chunk",["string","Buffer","Uint8Array"],t))),o)j(e,o);else if(null===t)i.reading=!1,function(e,t){if(v("onEofChunk"),t.ended)return;if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?H(e):(t.needReadable=!1,t.emittedReadable=!0,q(e))}(e,i);else if(i.objectMode||t&&t.length>0)if(r)if(i.endEmitted)j(e,new P);else{if(i.destroyed||i.errored)return!1;F(e,i,t,!0)}else if(i.ended)j(e,new O);else{if(i.destroyed||i.errored)return!1;i.reading=!1,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?F(e,i,t,!1):G(e,i)):F(e,i,t,!1)}else r||(i.reading=!1,G(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function F(e,t,n,r){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&H(e)),G(e,t)}$.prototype.destroy=E.destroy,$.prototype._undestroy=E.undestroy,$.prototype._destroy=function(e,t){t(e)},$.prototype[b.captureRejectionSymbol]=function(e){this.destroy(e)},$.prototype.push=function(e,t){return U(this,e,t,!1)},$.prototype.unshift=function(e,t){return U(this,e,t,!0)},$.prototype.isPaused=function(){const e=this._readableState;return!0===e[x]||!1===e.flowing},$.prototype.setEncoding=function(e){const t=new C(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let r="";for(const i of n)r+=t.write(i);return n.clear(),""!==r&&n.push(r),this._readableState.length=r.length,this};function B(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:a(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function H(e){const t=e._readableState;v("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(v("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(q,e))}function q(e){const t=e._readableState;v("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Y(e)}function G(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(Z,e,t))}function Z(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const n=t.length;if(v("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function V(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[x]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function K(e){v("readable nexttick read 0"),e.read(0)}function z(e,t){v("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Y(e),t.flowing&&!t.reading&&e.read(0)}function Y(e){const t=e._readableState;for(v("flow",t.flowing);t.flowing&&null!==e.read(););}function J(e,t){"function"!==typeof e.read&&(e=$.wrap(e,{objectMode:!0}));const n=async function*(e,t){let n,r=D;function i(t){this===e?(r(),r=D):r=t}
1e.on("readable",i);const o=m(e,{writable:!1},(e=>{n=e?T(n,e):null,r(),r=D}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(n)throw n;if(null===n)return;await new u(i)}}}catch(a){throw n=T(n,a),n}finally{!n&&!1===(null===t||void 0===t?void 0:t.destroyOnReturn)||void 0!==n&&!e._readableState.autoDestroy?(e.off("readable",i),o()):E.destroyer(e,null)}}(e,t);return n.stream=e,n}function X(e,t){if(0===t.length)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function Q(e){const t=e._readableState;v("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(ee,t,e))}function ee(e,t){if(v("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(te,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function te(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ne;function re(){return void 0===ne&&(ne={}),ne}$.prototype.read=function(e){v("read",e),void 0===e?e=NaN:o(e)||(e=s(e,10));const t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new N("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return v("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Q(this):H(this),null;if(0===(e=B(e,t))&&t.ended)return 0===t.length&&Q(this),null;let r,i=t.needReadable;if(v("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,v("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,v("reading, ended or constructing",i);else if(i){v("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0);try{this._read(t.highWaterMark)}catch(a){j(this,a)}t.sync=!1,t.reading||(e=B(n,t))}return r=e>0?X(e,t):null,null===r?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&Q(this)),null===r||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",r)),r},$.prototype._read=function(e){throw new k("_read()")},$.prototype.pipe=function(e,t){const n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),v("pipe count=%d opts=%j",i.pipes.length,t);const o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?s:g;function a(t,r){v("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,function(){v("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),l&&e.removeListener("drain",l);e.removeListener("error",f),e.removeListener("unpipe",a),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",u),d=!0,l&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}())}function s(){v("onend"),e.end()}let l;i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",a);let d=!1;function c(){d||(1===i.pipes.length&&i.pipes[0]===e?(v("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(v("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),l||(l=function(e,t){return function(){const n=e._readableState;
1n.awaitDrainWriters===t?(v("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(v("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(n,e),e.on("drain",l))}function u(t){v("ondata");const n=e.write(t);v("dest.write",n),!1===n&&c()}function f(t){if(v("onerror",t),g(),e.removeListener("error",f),0===e.listenerCount("error")){const n=e._writableState||e._readableState;n&&!n.errorEmitted?j(e,t):e.emit("error",t)}}function p(){e.removeListener("finish",b),g()}function b(){v("onfinish"),e.removeListener("close",p),g()}function g(){v("unpipe"),n.unpipe(e)}return n.on("data",u),y(e,"error",f),e.once("close",p),e.once("finish",b),e.emit("pipe",n),!0===e.writableNeedDrain?i.flowing&&c():i.flowing||(v("pipe resume"),n.resume()),e},$.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const n=i(t.pipes,e);return-1===n||(t.pipes.splice(n,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},$.prototype.on=function(e,t){const n=g.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,v("on readable",i.length,i.reading),i.length?H(this):i.reading||r.nextTick(K,this))),n},$.prototype.addListener=$.prototype.on,$.prototype.removeListener=function(e,t){const n=g.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(V,this),n},$.prototype.off=$.prototype.removeListener,$.prototype.removeAllListeners=function(e){const t=g.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(V,this),t},$.prototype.resume=function(){const e=this._readableState;return e.flowing||(v("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(z,e,t))}(this,e)),e[x]=!1,this},$.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[x]=!0,this},$.prototype.wrap=function(e){let t=!1;e.on("data",(n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{j(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const n=d(e);for(let r=1;r<n.length;r++){const t=n[r];void 0===this[t]&&"function"===typeof e[t]&&(this[t]=e[t].bind(e))}return this},$.prototype[f]=function(){return J(this)},$.prototype.iterator=function(e){return void 0!==e&&L(e,"options"),J(this,e)},l($.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!!e&&!1!==e.readable&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!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(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},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}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(W.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[x]},set(e){this[x]=!!e}}}),$._fromList=X,$.from=function(e,t){return M($,e,t)},$.fromWeb=function(e,t){return re().newStreamReadableFromReadableStream(e,t)},$.toWeb=function(e,t){return re().newReadableStreamFromStreamReadable(e,t)},$.wrap=function(e,t){var n,r;return new $({objectMode:null===(n=null!==(r=e.readableObjectMode)&&void 0!==r?r:e.objectMode)||void 0===n||n,...t,destroy(t,n){E.destroyer(e,t),n(t)}}).wrap(e)}},43427:(e,t,n)=>{"use strict";const{MathFloor:r,NumberIsInteger:i}=n(81981),{ERR_INVALID_ARG_VALUE:o}=n(31693).codes;function a(e){return e?16:16384}e.exports={getHighWaterMark:function(e,t,n,s){const l=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,s,n);if(null!=l){if(!i(l)||l<0){throw new o(s?`options.${n}`:"options.highWaterMark",l)}return r(l)}return a(e.objectMode)},getDefaultHighWaterMark:a}},87782:(e,t,n)=>{"use strict";
1const{ObjectSetPrototypeOf:r,Symbol:i}=n(81981);e.exports=d;const{ERR_METHOD_NOT_IMPLEMENTED:o}=n(31693).codes,a=n(76531),{getHighWaterMark:s}=n(43427);r(d.prototype,a.prototype),r(d,a);const l=i("kCallback");function d(e){if(!(this instanceof d))return new d(e);const t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),a.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"===typeof e.transform&&(this._transform=e.transform),"function"===typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function c(e){"function"!==typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,n)=>{t?e?e(t):this.destroy(t):(null!=n&&this.push(n),this.push(null),e&&e())}))}function u(){this._final!==c&&c.call(this)}d.prototype._final=c,d.prototype._transform=function(e,t,n){throw new o("_transform()")},d.prototype._write=function(e,t,n){const r=this._readableState,i=this._writableState,o=r.length;this._transform(e,t,((e,t)=>{e?n(e):(null!=t&&this.push(t),i.ended||o===r.length||r.length<r.highWaterMark?n():this[l]=n)}))},d.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},8515:(e,t,n)=>{"use strict";const{Symbol:r,SymbolAsyncIterator:i,SymbolIterator:o,SymbolFor:a}=n(81981),s=r("kDestroyed"),l=r("kIsErrored"),d=r("kIsReadable"),c=r("kIsDisturbed"),u=a("nodejs.webstream.isClosedPromise"),h=a("nodejs.webstream.controllerErrorFunction");function f(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var n;return!(!e||"function"!==typeof e.pipe||"function"!==typeof e.on||t&&("function"!==typeof e.pause||"function"!==typeof e.resume)||e._writableState&&!1===(null===(n=e._readableState)||void 0===n?void 0:n.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!==typeof e.write||"function"!==typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function b(e){return e&&(e._readableState||e._writableState||"function"===typeof e.write&&"function"===typeof e.on||"function"===typeof e.pipe&&"function"===typeof e.on)}function g(e){return!(!e||b(e)||"function"!==typeof e.pipeThrough||"function"!==typeof e.getReader||"function"!==typeof e.cancel)}function y(e){return!(!e||b(e)||"function"!==typeof e.getWriter||"function"!==typeof e.abort)}function w(e){return!(!e||b(e)||"object"!==typeof e.readable||"object"!==typeof e.writable)}function _(e){if(!b(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[s]||null!==r&&void 0!==r&&r.destroyed)}function m(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null===t||void 0===t||!t.errored)&&("boolean"!==typeof(null===t||void 0===t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!f(e))return null;const n=e._readableState;return(null===n||void 0===n||!n.errored)&&("boolean"!==typeof(null===n||void 0===n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===t&&!0===n.ended&&0===n.length))}function S(e){return e&&null!=e[d]?e[d]:"boolean"!==typeof(null===e||void 0===e?void 0:e.readable)?null:!_(e)&&(f(e)&&e.readable&&!v(e))}function E(e){return"boolean"!==typeof(null===e||void 0===e?void 0:e.writable)?null:!_(e)&&(p(e)&&e.writable&&!m(e))}function R(e){return"boolean"===typeof e._closed&&"boolean"===typeof e._defaultKeepAlive&&"boolean"===typeof e._removedConnection&&"boolean"===typeof e._removedContLen}function A(e){return"boolean"===typeof e._sent100&&R(e)}e.exports={kDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[c])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:c,isErrored:function(e){var t,n,r,i,o,a,s,d,c,u;return!(!e||!(null!==(t=null!==(n=null!==(r=null!==(i=null!==(o=null!==(a=e[l])&&void 0!==a?a:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(s=e._readableState)||void 0===s?void 0:s.errorEmitted)&&void 0!==r?r:null===(d=e._writableState)||void 0===d?void 0:d.errorEmitted)&&void 0!==n?n:null===(c=e._readableState)||void 0===c?void 0:c.errored)&&void 0!==t?t:null===(u=e._writableState)||void 0===u?void 0:u.errored))},kIsErrored:l,isReadable:S,kIsReadable:d,kIsClosedPromise:u,kControllerErrorFunction:h,isClosed:function(e){if(!b(e))return null;if("boolean"===typeof e.closed)return e.closed;const t=e._writableState,n=e._readableState;return"boolean"===typeof(null===t||void 0===t?void 0:t.closed)||"boolean"===typeof(null===n||void 0===n?void 0:n.closed)?(null===t||void 0===t?void 0:t.closed)||(null===n||void 0===n?void 0:n.closed):"boolean"===typeof e._closed&&R(e)?e._closed:null}
1,isDestroyed:_,isDuplexNodeStream:function(e){return!(!e||"function"!==typeof e.pipe||!e._readableState||"function"!==typeof e.on||"function"!==typeof e.write)},isFinished:function(e,t){return b(e)?!!_(e)||(!1===(null===t||void 0===t?void 0:t.readable)||!S(e))&&(!1===(null===t||void 0===t?void 0:t.writable)||!E(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"===typeof e[i]:!1===t?"function"===typeof e[o]:"function"===typeof e[i]||"function"===typeof e[o])},isReadableNodeStream:f,isReadableStream:g,isReadableEnded:function(e){if(!f(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!==typeof(null===t||void 0===t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,n;return b(e)?e.readableErrored?e.readableErrored:null!==(t=null===(n=e._readableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isNodeStream:b,isWebStream:function(e){return g(e)||y(e)||w(e)},isWritable:E,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:m,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const n=e._writableState;return(null===n||void 0===n||!n.errored)&&("boolean"!==typeof(null===n||void 0===n?void 0:n.finished)?null:!!(n.finished||!1===t&&!0===n.ended&&0===n.length))},isWritableErrored:function(e){var t,n;return b(e)?e.writableErrored?e.writableErrored:null!==(t=null===(n=e._writableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"===typeof e._consuming&&"boolean"===typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:A,willEmitClose:function(e){if(!b(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!r&&A(e)||!!(r&&r.autoDestroy&&r.emitClose&&!1===r.closed)},isTransformStream:w}},24213:(e,t,n)=>{const r=n(1426),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:l,ObjectSetPrototypeOf:d,StringPrototypeToLowerCase:c,Symbol:u,SymbolHasInstance:h}=n(81981);e.exports=C,C.WritableState=L;const{EventEmitter:f}=n(47465),p=n(46514).Stream,{Buffer:b}=n(19778),g=n(48506),{addAbortSignal:y}=n(566),{getHighWaterMark:w,getDefaultHighWaterMark:_}=n(43427),{ERR_INVALID_ARG_TYPE:m,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:R,ERR_STREAM_ALREADY_FINISHED:A,ERR_STREAM_NULL_VALUES:T,ERR_STREAM_WRITE_AFTER_END:I,ERR_UNKNOWN_ENCODING:k}=n(31693).codes,{errorOrDestroy:N}=g;function O(){}d(C.prototype,p.prototype),d(C,p);const P=u("kOnFinished");function L(e,t,r){"boolean"!==typeof r&&(r=t instanceof n(76531)),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?w(this,e,"writableHighWaterMark",r):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=W.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,x(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[P]=[]}function x(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function C(e){const t=this instanceof n(76531);if(!t&&!a(C,this))return new C(e);this._writableState=new L(e,this,t),e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final),"function"===typeof e.construct&&(this._construct=e.construct),e.signal&&y(e.signal,this)),p.call(this,e),g.construct(this,(()=>{const e=this._writableState;e.writing||B(this,e),G(this,e)}))}function M(e,t,n,i){const o=e._writableState;if("function"===typeof n)i=n,n=o.defaultEncoding;else{if(n){if("buffer"!==n&&!b.isEncoding(n))throw new k(n)}else n=o.defaultEncoding;"function"!==typeof i&&(i=O)}if(null===t)throw new T;if(!o.objectMode)if("string"===typeof t)!1!==o.decodeStrings&&(t=b.from(t,n),n="buffer");else if(t instanceof b)n="buffer";
1else{if(!p._isUint8Array(t))throw new m("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),n="buffer"}let a;return o.ending?a=new I:o.destroyed&&(a=new R("write")),a?(r.nextTick(i,a),N(e,a,!0),a):(o.pendingcb++,function(e,t,n,r,i){const o=t.objectMode?1:n.length;t.length+=o;const a=t.length<t.highWaterMark;a||(t.needDrain=!0);t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:n,encoding:r,callback:i}),t.allBuffers&&"buffer"!==r&&(t.allBuffers=!1),t.allNoop&&i!==O&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(n,r,t.onwrite),t.sync=!1);return a&&!t.errored&&!t.destroyed}(e,o,t,n,i))}function D(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new R("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function j(e,t,n,r){--t.pendingcb,r(n),F(t),N(e,n)}function W(e,t){const n=e._writableState,i=n.sync,o=n.writecb;"function"===typeof o?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(j,e,n,t,o):j(e,n,t,o)):(n.buffered.length>n.bufferedIndex&&B(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:e,state:n},r.nextTick($,n.afterWriteTickInfo)):U(e,n,1,o))):N(e,new S)}function $(e){let{stream:t,state:n,count:r,cb:i}=e;return n.afterWriteTickInfo=null,U(t,n,r,i)}function U(e,t,n,r){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));n-- >0;)t.pendingcb--,r();t.destroyed&&F(t),G(e,t)}function F(e){if(e.writing)return;for(let i=e.bufferedIndex;i<e.buffered.length;++i){var t;const{chunk:n,callback:r}=e.buffered[i],o=e.objectMode?1:n.length;e.length-=o,r(null!==(t=e.errored)&&void 0!==t?t:new R("write"))}const n=e[P].splice(0);for(let i=0;i<n.length;i++){var r;n[i](null!==(r=e.errored)&&void 0!==r?r:new R("end"))}x(e)}function B(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:n,bufferedIndex:r,objectMode:o}=t,a=n.length-r;if(!a)return;let s=r;if(t.bufferProcessing=!0,a>1&&e._writev){t.pendingcb-=a-1;const r=t.allNoop?O:e=>{for(let t=s;t<n.length;++t)n[t].callback(e)},o=t.allNoop&&0===s?n:i(n,s);o.allBuffers=t.allBuffers,D(e,t,!0,t.length,o,"",r),x(t)}else{do{const{chunk:r,encoding:i,callback:a}=n[s];n[s++]=null;D(e,t,!1,o?1:r.length,r,i,a)}while(s<n.length&&!t.writing);s===n.length?x(t):s>256?(n.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}function H(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function q(e,t){t.prefinished||t.finalCalled||("function"!==typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)N(e,null!==i&&void 0!==i?i:S());else if(n=!0,t.pendingcb--,i){const n=t[P].splice(0);for(let e=0;e<n.length;e++)n[e](i);N(e,i,t.sync)}else H(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(Z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(o){i(o)}t.sync=!1}(e,t)))}function G(e,t,n){H(t)&&(q(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick(((e,t)=>{H(t)?Z(e,t):t.pendingcb--}),e,t)):H(t)&&(t.pendingcb++,Z(e,t))))}function Z(e,t){t.pendingcb--,t.finished=!0;const n=t[P].splice(0);for(let r=0;r<n.length;r++)n[r]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}L.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},s(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(C,h,{__proto__:null,value:function(e){return!!a(this,e)||this===C&&(e&&e._writableState instanceof L)}}),C.prototype.pipe=function(){N(this,new E)},C.prototype.write=function(e,t,n){return!0===M(this,e,t,n)},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||B(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"===typeof e&&(e=c(e)),!b.isEncoding(e))throw new k(e);return this._writableState.defaultEncoding=e,this},C.prototype._write=function(e,t,n){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],n)},C.prototype._writev=null,C.prototype.end=function(e,t,n){const i=this._writableState;let a;if("function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e){const n=M(this,e,t);n instanceof o&&(a=n)}return i.corked&&(i.corked=1,this.uncork()),a||(i.errored||i.ending?i.finished?a=new A("end"):i.destroyed&&(a=new R("end")):(i.ending=!0,G(this,i,!0),i.ended=!0)),"function"===typeof n&&(a||i.finished?r.nextTick(n,a):i[P].push(n)),this},l(C.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!!e&&!1!==e.writable&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&(!e.destroyed&&!e.ending&&e.needDrain)}},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!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const V=g.destroy;let K;function z(){return void 0===K&&(K={}),K}C.prototype.destroy=function(e,t){const n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[P].length)&&r.nextTick(F,n),V.call(this,e,t),this},C.prototype._undestroy=g.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype[f.captureRejectionSymbol]=function(e){this.destroy(e)},C.fromWeb=function(e,t){return z().newStreamWritableFromWritableStream(e,t)},C.toWeb=function(e){return z().newWritableStreamFromStreamWritable(e)}},96168:(e,t,n)=>{"use strict";const{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:d,NumberMIN_SAFE_INTEGER:c,NumberParseInt:u,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:b,StringPrototypeTrim:g}=n(81981),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:w,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:m,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=n(31693),{normalizeEncoding:E}
1=n(10224),{isAsyncFunction:R,isArrayBufferView:A}=n(10224).types,T={};const I=/^[0-7]+$/;const k=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d;if("number"!==typeof e)throw new _(t,"number",e);if(!s(e))throw new v(t,"an integer",e);if(e<n||e>r)throw new v(t,`>= ${n} && <= ${r}`,e)})),N=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-2147483648,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2147483647;if("number"!==typeof e)throw new _(t,"number",e);if(!s(e))throw new v(t,"an integer",e);if(e<n||e>r)throw new v(t,`>= ${n} && <= ${r}`,e)})),O=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!==typeof e)throw new _(t,"number",e);if(!s(e))throw new v(t,"an integer",e);const r=n?1:0,i=4294967295;if(e<r||e>i)throw new v(t,`>= ${r} && <= ${i}`,e)}));function P(e,t){if("string"!==typeof e)throw new _(t,"string",e)}const L=y(((e,t,n)=>{if(!i(n,e)){const r=o(a(n,(e=>"string"===typeof e?`'${e}'`:p(e))),", ");throw new m(t,e,"must be one of: "+r)}}));function x(e,t){if("boolean"!==typeof e)throw new _(t,"boolean",e)}function C(e,t,n){return null!=e&&h(e,t)?e[t]:n}const M=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const i=C(n,"allowArray",!1),o=C(n,"allowFunction",!1);if(!C(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!==typeof e&&(!o||"function"!==typeof e))throw new _(t,"Object",e)})),D=y(((e,t)=>{if(null!=e&&"object"!==typeof e&&"function"!==typeof e)throw new _(t,"a dictionary",e)})),j=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!r(e))throw new _(t,"Array",e);if(e.length<n){throw new m(t,e,`must be longer than ${n}`)}}));const W=y((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"buffer";if(!A(e))throw new _(t,["Buffer","TypedArray","DataView"],e)}));const $=y(((e,t)=>{if(void 0!==e&&(null===e||"object"!==typeof e||!("aborted"in e)))throw new _(t,"AbortSignal",e)})),U=y(((e,t)=>{if("function"!==typeof e)throw new _(t,"Function",e)})),F=y(((e,t)=>{if("function"!==typeof e||R(e))throw new _(t,"Function",e)})),B=y(((e,t)=>{if(void 0!==e)throw new _(t,"undefined",e)}));const H=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function q(e,t){if("undefined"===typeof e||!f(H,e))throw new m(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,n){if("undefined"===typeof e&&(e=n),"string"===typeof e){if(null===f(I,e))throw new m(t,e,"must be a 32-bit unsigned integer or an octal string");e=u(e,8)}return O(e,t),e},validateArray:j,validateStringArray:function(e,t){j(e,t);for(let n=0;n<e.length;n++)P(e[n],`${t}[${n}]`)},validateBooleanArray:function(e,t){j(e,t);for(let n=0;n<e.length;n++)x(e[n],`${t}[${n}]`)},validateBoolean:x,validateBuffer:W,validateDictionary:D,validateEncoding:function(e,t){const n=E(t),r=e.length;if("hex"===n&&r%2!==0)throw new m("encoding",t,`is invalid for data of length ${r}`)},validateFunction:U,validateInt32:N,validateInteger:k,validateNumber:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("number"!==typeof e)throw new _(t,"number",e);if(null!=n&&e<n||null!=r&&e>r||(null!=n||null!=r)&&l(e))throw new v(t,`${null!=n?`>= ${n}`:""}${null!=n&&null!=r?" && ":""}${null!=r?`<= ${r}`:""}`,e)},validateObject:M,validateOneOf:L,validatePlainFunction:F,validatePort:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Port",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("number"!==typeof e&&"string"!==typeof e||"string"===typeof e&&0===g(e).length||+e!==+e>>>0||e>65535||0===e&&!n)throw new w(t,e,n);return 0|e},validateSignalName:function(e){if(P(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"signal"),void 0===T[e]){if(void 0!==T[b(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}}
1,validateString:P,validateUint32:O,validateUndefined:B,validateUnion:function(e,t,n){if(!i(n,e))throw new _(t,`('${o(n,"|")}')`,e)},validateAbortSignal:$,validateLinkHeaderValue:function(e){if("string"===typeof e)return q(e,"hints"),e;if(r(e)){const t=e.length;let n="";if(0===t)return n;for(let r=0;r<t;r++){const i=e[r];q(i,"hints"),n+=i,r!==t-1&&(n+=", ")}return n}throw new m("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},35954:(e,t,n)=>{"use strict";const r=n(88162),i=n(3e3),o=r.Readable.destroy;e.exports=r.Readable,e.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,e.exports._isUint8Array=r._isUint8Array,e.exports.isDisturbed=r.isDisturbed,e.exports.isErrored=r.isErrored,e.exports.isReadable=r.isReadable,e.exports.Readable=r.Readable,e.exports.Writable=r.Writable,e.exports.Duplex=r.Duplex,e.exports.Transform=r.Transform,e.exports.PassThrough=r.PassThrough,e.exports.addAbortSignal=r.addAbortSignal,e.exports.finished=r.finished,e.exports.destroy=r.destroy,e.exports.destroy=o,e.exports.pipeline=r.pipeline,e.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=r.Stream,e.exports.default=e.exports},31693:(e,t,n)=>{"use strict";const{format:r,inspect:i,AggregateError:o}=n(10224),a=globalThis.AggregateError||o,s=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],d=/^([A-Z][a-z0-9]*)+$/,c={};function u(e,t){if(!e)throw new c.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function f(e,t,n){n||(n=Error);class i extends n{constructor(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];super(function(e,t,n){if("function"===typeof t)return u(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);const i=(t.match(/%[dfijoOs]/g)||[]).length;return u(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,i))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,c[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class b extends Error{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"The operation was aborted",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(void 0!==t&&"object"!==typeof t)throw new c.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",((e,t,n)=>{u("string"===typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let r="The ";e.endsWith(" argument")?r+=`${e} `:r+=`"${e}" ${e.includes(".")?"property":"argument"} `,r+="must be ";const o=[],a=[],s=[];for(const i of t)u("string"===typeof i,"All expected entries have to be of type string"),l.includes(i)?o.push(i.toLowerCase()):d.test(i)?a.push(i):(u("object"!==i,'The value "object" should be written as "Object"'),s.push(i));if(a.length>0){const e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),a.push("Object"))}if(o.length>0){switch(o.length){case 1:r+=`of type ${o[0]}`;break;case 2:r+=`one of type ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();r+=`one of type ${o.join(", ")}, or ${e}`}}(a.length>0||s.length>0)&&(r+=" or ")}if(a.length>0){switch(a.length){case 1:r+=`an instance of ${a[0]}`;break;case 2:r+=`an instance of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();r+=`an instance of ${a.join(", ")}, or ${e}`}}s.length>0&&(r+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(r+="an "),r+=`${s[0]}`;break;case 2:r+=`one of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();r+=`one of ${s.join(", ")}, or ${e}`}}if(null==n)r+=`. Received ${n}`;else if("function"===typeof n&&n.name)r+=`. Received function ${n.name}`;else if("object"===typeof n){var c;if(null!==(c=n.constructor)&&void 0!==c&&c.name)r+=`. Received an instance of ${n.constructor.name}`;else{r+=`. Received ${i(n,{depth:-1})}`}}else{let e=i(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),r+=`. Received type ${typeof n} (${e})`}return r}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(e,t){let n=arguments.length>
12&&void 0!==arguments[2]?arguments[2]:"is invalid",r=i(t);r.length>128&&(r=r.slice(0,128)+"...");return`The ${e.includes(".")?"property":"argument"} '${e}' ${n}. Received ${r}`}),TypeError),f("ERR_INVALID_RETURN_VALUE",((e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${null!==n&&void 0!==n&&null!==(r=n.constructor)&&void 0!==r&&r.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r;u(t.length>0,"At least one arg needs to be specified");const i=t.length;switch(t=(Array.isArray(t)?t:[t]).map((e=>`"${e}"`)).join(" or "),i){case 1:r+=`The ${t[0]} argument`;break;case 2:r+=`The ${t[0]} and ${t[1]} arguments`;break;default:{const e=t.pop();r+=`The ${t.join(", ")}, and ${e} arguments`}}return`${r} must be specified`}),TypeError),f("ERR_OUT_OF_RANGE",((e,t,n)=>{let r;return u(t,'Missing "range" argument'),Number.isInteger(n)&&Math.abs(n)>2**32?r=h(String(n)):"bigint"===typeof n?(r=String(n),(n>2n**32n||n<-(2n**32n))&&(r=h(r)),r+="n"):r=i(n),`The value of "${e}" is out of range. It must be ${t}. Received ${r}`}),RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:b,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const n=new a([t,e],t.message);return n.code=t.code,n}return e||t})),hideStackFrames:p,codes:c}},81981:e=>{"use strict";e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,n)=>e.slice(t,n),Error:Error,FunctionPrototypeCall(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.call(t,...r)},FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number: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:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,n)=>Object.defineProperty(e,t,n),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise:Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,n)=>e.then(t,n),PromiseReject:e=>Promise.reject(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String:String,StringPrototypeSlice:(e,t,n)=>e.slice(t,n),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol:Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet:(e,t,n)=>e.set(t,n),Uint8Array:Uint8Array}},10224:(e,t,n)=>{"use strict";const r=n(19778),i=Object.getPrototypeOf((async function(){})).constructor,o=globalThis.Blob||r.Blob,a="undefined"!==typeof o?function(e){return e instanceof o}:function(e){return!1};class s extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let n=0;n<e.length;n++)t+=` ${e[n].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}},promisify:e=>new Promise(((t,n)=>{e((function(e){if(e)return n(e);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t(...i)}))})),debuglog:()=>function(){},format(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.replace(/%([sdifj])/g,(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];let[i,o]=t;const a=n.shift();if("f"===o)return a.toFixed(6);if("j"===o)return JSON.stringify(a);if("s"===o&&"object"===typeof a){return`${a.constructor!==Object?a.constructor.name:""} {}`.trim()}return a.toString()}))}
1,inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof i,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:a},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},88162:(e,t,n)=>{const{Buffer:r}=n(19778),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:a}=n(81981),{promisify:{custom:s}}=n(10224),{streamReturningOperators:l,promiseReturningOperators:d}=n(96553),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=n(31693),u=n(30775),{pipeline:h}=n(33887),{destroyer:f}=n(48506),p=n(84288),b=n(3e3),g=n(8515),y=e.exports=n(46514).Stream;y.isDisturbed=g.isDisturbed,y.isErrored=g.isErrored,y.isReadable=g.isReadable,y.Readable=n(12716);for(const m of o(l)){const v=l[m];function w(){if(new.target)throw c();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.Readable.from(a(v,this,t))}i(w,"name",{__proto__:null,value:v.name}),i(w,"length",{__proto__:null,value:v.length}),i(y.Readable.prototype,m,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(const S of o(d)){const E=d[S];function w(){if(new.target)throw c();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E,this,t)}i(w,"name",{__proto__:null,value:E.name}),i(w,"length",{__proto__:null,value:E.length}),i(y.Readable.prototype,S,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}y.Writable=n(24213),y.Duplex=n(76531),y.Transform=n(87782),y.PassThrough=n(2708),y.pipeline=h;const{addAbortSignal:_}=n(566);y.addAbortSignal=_,y.finished=p,y.destroy=f,y.compose=u,i(y,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>b}),i(h,s,{__proto__:null,enumerable:!0,get:()=>b.pipeline}),i(p,s,{__proto__:null,enumerable:!0,get:()=>b.finished}),y.Stream=y,y._isUint8Array=function(e){return e instanceof Uint8Array},y._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}},3e3:(e,t,n)=>{"use strict";const{ArrayPrototypePop:r,Promise:i}=n(81981),{isIterable:o,isNodeStream:a,isWebStream:s}=n(8515),{pipelineImpl:l}=n(33887),{finished:d}=n(84288);n(88162),e.exports={finished:d,pipeline:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new i(((e,n)=>{let i,d;const c=t[t.length-1];if(c&&"object"===typeof c&&!a(c)&&!o(c)&&!s(c)){const e=r(t);i=e.signal,d=e.end}l(t,((t,r)=>{t?n(t):e(r)}),{signal:i,end:d})}))}}},36346:(e,t,n)=>{"use strict";n.d(t,{SolanaWalletAdapter:()=>De});var r=n(1413),i=n(64572),o=n(66544),a=n(3997),s=(n(57381),n(62895)),l=n.n(s);const d=l().getLogger("http-helpers");d.setLevel(s.levels.INFO);let c="torus-default";function u(e){c=e}var h=n(35954),f=n(47465),p=n(11053),b=n.n(p),g=n(93137),y=n(69578),w=n.n(y),_=n(14876),m=n.n(_),v=n(99306),S=n.n(v);function E(){}const R="ACK";class A extends h.Duplex{constructor(e){let{name:t,target:n,targetWindow:r=window,targetOrigin:o="*"}=e;if(super({objectMode:!0}),(0,i.Z)(this,"_init",void 0),(0,i.Z)(this,"_haveSyn",void 0),(0,i.Z)(this,"_name",void 0),(0,i.Z)(this,"_target",void 0),(0,i.Z)(this,"_targetWindow",void 0),(0,i.Z)(this,"_targetOrigin",void 0),(0,i.Z)(this,"_onMessage",void 0),(0,i.Z)(this,"_synIntervalId",void 0),!t||!n)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=t,this._target=n,this._targetWindow=r,this._targetOrigin=o,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write("BRK",null,E),this._haveSyn=!1,this._init=!1}_handShake(){this._write("SYN",null,E),this.cork()}_onData(e){if(this._init)if("BRK"===e)this._break();else try{this.push(e)}catch(t){this.emit("error",t)}else"SYN"===e?(this._haveSyn=!0,this._write(R,null,E)):e===R&&(this._init=!0,this._haveSyn||this._write(R,null,E),this.uncork())}_postMessage(e){const t=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:e},t)}onMessage(e){const t=e.data;"*"!==this._targetOrigin&&e.origin!==this._targetOrigin||e.source!==this._targetWindow||"object"!==typeof t||t.target!==this._name||!t.data||this._onData(t.data)}_read(){}_write(e,t,n){this._postMessage(e),n()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function T(e,t,n){try{Reflect.apply(e,t,n)}catch(r){setTimeout((()=>{throw r}))}}class I extends f.EventEmitter{emit(e){let t="error"===e;const n=this._events;if(void 0!==n)t=t&&void 0===n.error;else if(!t)return!1;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(t){let e;if(i.length>0&&([e]=i),e instanceof Error)throw e;const t=new Error("Unhandled error."+(e?` (${e.message})`:""));throw t.context=e,t}const a=n[e];if(void 0===a)return!1;if("function"===typeof a)T(a,this,i);else{const e=a.length,t=function(e){const t=e.length,n=new Array(t);for(let r=0;r<t;r+=1)n[r]=e[r];return n}(a);for(let n=0;n<e;n+=1)T(t[n],this,i)}return!0}}
1class k extends Error{constructor(e){let{code:t,message:n,data:r}=e;if(!Number.isInteger(t))throw new Error("code must be an integer");if(!n||"string"!==typeof n)throw new Error("message must be string");super(n),(0,i.Z)(this,"code",void 0),(0,i.Z)(this,"data",void 0),this.code=t,void 0!==r&&(this.data=r)}toString(){return b()({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const N=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(r,i)=>{r||i.error?t(r||i.error):!n||Array.isArray(i)?e(i):e(i.result)}};function O(){const e={};const t=new I;const n=new h.Duplex({objectMode:!0,read:function(){return!1},write:function(n,r,i){let o;try{!n.id?function(e){t.emit("notification",e)}(n):function(t){const n=e[t.id];if(!n)throw new Error(`StreamMiddleware - Unknown response id "${t.id}"`);delete e[t.id],Object.assign(n.res,t),setTimeout(n.end)}(n)}catch(a){o=a}i(o)}});return{events:t,middleware:(t,r,i,o)=>{n.push(t),e[t.id]={req:t,res:r,next:i,end:o}},stream:n}}class P extends I{constructor(){super(),(0,i.Z)(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(e,t,n){const r=[];let i=null,o=!1;for(const a of n)if([i,o]=await P._runMiddleware(e,t,a,r),o)break;return[i,o,r.reverse()]}static _runMiddleware(e,t,n,r){return new Promise((i=>{const o=e=>{const n=e||t.error;n&&(t.error=(0,g.Xy)(n)),i([n,!0])},a=e=>{t.error?o(t.error):(e&&("function"!==typeof e&&o(new k({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),r.push(e)),i([null,!1]))};try{n(e,t,a,o)}catch(s){o(s)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,n)=>{t((t=>t?n(t):e()))}))}static _checkForCompletion(e,t,n){if(!("result"in t)&&!("error"in t))throw new k({code:-32603,message:"Response has no error or result for request"});if(!n)throw new k({code:-32603,message:"Nothing ended request"})}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!==typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,n,r)=>{try{const[i,o,a]=await P._runAllMiddleware(e,t,this._middleware);return o?(await P._runReturnHandlers(a),r(i)):n((async e=>{try{await P._runReturnHandlers(a)}catch(t){return e(t)}return e()}))}catch(i){return r(i)}}}async _handleBatch(e,t){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,n):n}catch(n){if(t)return t(n);throw n}}_promiseHandle(e){return new Promise((t=>{this._handle(e,((e,n)=>{t(n)}))}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!==typeof e){const e=new k({code:-32603,message:"request must be plain object"});return t(e,{id:void 0,jsonrpc:"2.0",error:e})}if("string"!==typeof e.method){const n=new k({code:-32603,message:"method must be string"});return t(n,{id:e.id,jsonrpc:"2.0",error:n})}const n=(0,r.Z)({},e),i={id:n.id,jsonrpc:n.jsonrpc};let o=null;try{await this._processRequest(n,i)}catch(a){o=a}return o&&(delete i.result,i.error||(i.error=(0,g.Xy)(o))),t(o,i)}async _processRequest(e,t){const[n,r,i]=await P._runAllMiddleware(e,t,this._middleware);if(P._checkForCompletion(e,t,r),await P._runReturnHandlers(i),n)throw n}}class L extends h.Duplex{constructor(e){let{parent:t,name:n}=e;super({objectMode:!0}),(0,i.Z)(this,"_parent",void 0),(0,i.Z)(this,"_name",void 0),this._parent=t,this._name=n}_read(){}_write(e,t,n){this._parent.push({name:this._name,data:e}),n()}}const x=Symbol("IGNORE_SUBSTREAM");class C extends h.Duplex{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super((0,r.Z)((0,r.Z)({},e),{},{objectMode:!0})),(0,i.Z)(this,"_substreams",void 0),(0,i.Z)(this,"getStream",void 0),this._substreams={}}createStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);const t=new L({parent:this,name:e});return this._substreams[e]=t,function(e,t){const n=m()(t);w()(e,{readable:!1},n),w()(e,{writable:!1},n)}(this,(e=>t.destroy(e||void 0))),t}ignoreStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=x}_read(){}_write(e,t,n){const{name:r,data:i}=e;if(!r)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),n();const o=this._substreams[r];return o?(o!==x&&o.push(i),n()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${r}"`),n())}}var M=n(27037),D=n(78262),j=n.n(D),W=n(19778).Buffer;function $(e){return null!==e&&"object"===typeof e&&"function"===typeof e.pipe}function U(e){return function(e){return $(e)&&!1!==e.writable&&"function"===typeof e._write&&"object"===typeof e._writableState}(e)&&function(e){return $(e)&&!1!==e.readable&&"function"===typeof e._read&&"object"===typeof e._readableState}(e)}var F={disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:e=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${e}
1 without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:e=>`Invalid options. Received: { maxEventListeners: ${e}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},B={connected:e=>`Torus: Connected to chain with ID "${e}".`};const H={PRODUCTION:"production",DEVELOPMENT:"development",TESTING:"testing"},q={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"};var G={supportedVerifierList:["google","reddit","discord"],api:"https://api.tor.us",translations:{en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies ben\xf6tigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"\u7d99\u7d9a\u3059\u308b",actionRequired:"\u8a8d\u8a3c\u304c\u5fc5\u8981\u3067\u3059",pendingAction:"\u7d9a\u884c\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u7d9a\u884c\u3057\u307e\u3059",cookiesRequired:"\u5fc5\u8981\u306a\u30af\u30c3\u30ad\u30fc",enableCookies:"Torus\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u8a2d\u5b9a\u3067Cookie\u3092\u6709\u52b9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",clickHere:"\u8a73\u3057\u304f\u306f"}},ko:{embed:{continue:"\uacc4\uc18d\ud558\ub2e4",actionRequired:"\uc2b9\uc778 \ud544\uc694",pendingAction:"\ud31d\uc5c5\uc5d0\uc11c \uc694\uccad\uc744 \uc9c4\ud589\ud558\ub824\uba74 \uacc4\uc18d\uc744 \ud074\ub9ad\ud558\uc2ed\uc2dc\uc624.",cookiesRequired:"\ucfe0\ud0a4 \ud544\uc694",enableCookies:"\ube0c\ub77c\uc6b0\uc800 \ud658\uacbd \uc124\uc815\uc5d0\uc11c \ucfe0\ud0a4\ub97c \ud65c\uc131\ud654\ud558\uc5ec Torus\uc5d0 \uc561\uc138\uc2a4\ud558\uc2ed\uc2dc\uc624.",clickHere:"\ub354 \ub9ce\uc740 \uc815\ubcf4"}},zh:{embed:{continue:"\u7ee7\u7eed",actionRequired:"\u9700\u8981\u6388\u6743",pendingAction:"\u5355\u51fb\u7ee7\u7eed\u4ee5\u5728\u5f39\u51fa\u7a97\u53e3\u4e2d\u7ee7\u7eed\u60a8\u7684\u8bf7\u6c42",cookiesRequired:"\u5fc5\u586bCookie",enableCookies:"\u8bf7\u5728\u60a8\u7684\u6d4f\u89c8\u5668\u9996\u9009\u9879\u4e2d\u542f\u7528cookie\u4ee5\u8bbf\u95eeTorus\u3002",clickHere:"\u66f4\u591a\u4fe1\u606f"}}},prodTorusUrl:"",localStorageKeyPrefix:"torus-"},Z=l().getLogger("solana-embed");const V=()=>Math.random().toString(36).slice(2),K=async e=>{let t,n;switch(e){case"testing":t="https://solana-testing.tor.us",n="debug";break;case"development":t="http://localhost:8080",n="debug";break;default:t="https://solana.tor.us",n="error"}return{torusUrl:t,logLevel:n}},z={height:660,width:375},Y={height:740,width:1315},J={height:700,width:1200},X={height:600,width:400};function Q(e){let{width:t,height:n}=e;const r=void 0!==window.screenLeft?window.screenLeft:window.screenX,i=void 0!==window.screenTop?window.screenTop:window.screenY,o=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,s=Math.abs((o-t)/2/1+r);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${n/1},width=${t/1},top=${Math.abs((a-n)/2/1+i)},left=${s}`}class ee extends I{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:r="provider"}=t;if(super(),(0,i.Z)(this,"isTorus",void 0),(0,i.Z)(this,"_rpcEngine",void 0),(0,i.Z)(this,"jsonRpcConnectionEvents",void 0),(0,i.Z)(this,"_state",void 0),!U(e))throw new Error(F.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(n),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this);const o=new C;
1S()(e,o,e,this._handleStreamDisconnect.bind(this,"Torus")),o.ignoreStream("phishing");const s=O();S()(s.stream,o.createStream(r),s.stream,this._handleStreamDisconnect.bind(this,"Torus RpcProvider"));const l=new P;l.push(((e,t,n,r)=>{const i=e.id,o=Math.random().toString(36).slice(2);e.id=o,t.id=o,n((n=>{e.id=i,t.id=i,n()}))})),l.push(((e,t,n)=>{"string"===typeof e.method&&e.method||(t.error=M.Sy.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),n((e=>{const{error:n}=t;return n?(Z.error(`Torus - RPC Error: ${n.message}`,n),e()):e()}))})),l.push((0,a.yh)({origin:location.origin})),l.push(s.middleware),this._rpcEngine=l,this.jsonRpcConnectionEvents=s.events}async request(e){if(!e||"object"!==typeof e||Array.isArray(e))throw M.Sy.rpc.invalidRequest({message:F.invalidRequestArgs(),data:e});const{method:t,params:n}=e;if("string"!==typeof t||0===t.length)throw M.Sy.rpc.invalidRequest({message:F.invalidRequestMethod(),data:e});if(void 0!==n&&!Array.isArray(n)&&("object"!==typeof n||null===n))throw M.Sy.rpc.invalidRequest({message:F.invalidRequestParams(),data:e});return new Promise(((e,r)=>{this._rpcRequest({method:t,params:n},N(e,r))}))}send(e,t){this._rpcRequest(e,t)}sendAsync(e){return new Promise(((t,n)=>{this._rpcRequest(e,N(t,n))}))}_handleStreamDisconnect(e,t){!function(e,t,n){let r=`Torus: Lost connection to "${e}".`;null!==t&&void 0!==t&&t.stack&&(r+=`\n${t.stack}`),Z.warn(r),n&&n.listenerCount("error")>0&&n.emit("error",r)}(e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}}const te=e=>{const t=window.document.createElement("template"),n=e.trim();return t.innerHTML=n,t.content.firstChild};function ne(e){return void 0===e.version}class re extends I{constructor(e){let{url:t,target:n,features:r,timeout:o=3e4}=e;super(),(0,i.Z)(this,"url",void 0),(0,i.Z)(this,"target",void 0),(0,i.Z)(this,"features",void 0),(0,i.Z)(this,"window",void 0),(0,i.Z)(this,"windowTimer",void 0),(0,i.Z)(this,"iClosedWindow",void 0),(0,i.Z)(this,"timeout",void 0),this.url=t,this.target=n||"_blank",this.features=r||Q(J),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this.timeout=o,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval((()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),setTimeout((()=>{this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0}),this.timeout)),void 0===this.window&&clearInterval(this.windowTimer)}),500))}open(){var e;return this.window=window.open(this.url.href,this.target,this.features),null!==(e=this.window)&&void 0!==e&&e.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(e){e?window.location.replace(this.url.href):window.location.href=this.url.href}}class ie extends ee{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:o="provider"}=t;super(e,{maxEventListeners:n,jsonRpcStreamName:o}),(0,i.Z)(this,"embedTranslations",void 0),(0,i.Z)(this,"torusUrl",void 0),(0,i.Z)(this,"dappStorageKey",void 0),(0,i.Z)(this,"windowRefs",void 0),(0,i.Z)(this,"tryWindowHandle",void 0),(0,i.Z)(this,"torusAlertContainer",void 0),(0,i.Z)(this,"torusIframe",void 0),this._state=(0,r.Z)({},ie._defaultState),this.torusUrl="",this.dappStorageKey="";const s=G.translations[(()=>{let e=window.navigator.language||"en-US";const t=e.split("-");return e=Object.prototype.hasOwnProperty.call(G.translations,t[0])?t[0]:"en",e})()];this.embedTranslations=s.embed,this.windowRefs={},this.on("connect",(()=>{this._state.isConnected=!0}));this.jsonRpcConnectionEvents.on("notification",(e=>{const{method:t,params:n}=e;if(t===a.Nb.IFRAME_STATUS){const{isFullScreen:e,rid:t}=n;this._displayIframe({isFull:e,rid:t})}else if(t===a.Nb.CREATE_WINDOW){const{windowId:e,url:t}=n;this._createPopupBlockAlert(e,t)}else if(t===a.Nb.CLOSE_WINDOW)this._handleCloseWindow(n);else if(t===a.Nb.USER_LOGGED_IN){const{currentLoginProvider:e}=n;this._state.isLoggedIn=!0,this._state.currentLoginProvider=e}else t===a.Nb.USER_LOGGED_OUT&&(this._state.isLoggedIn=!1,this._state.currentLoginProvider=null,this._displayIframe())}
1))}get isLoggedIn(){return this._state.isLoggedIn}get isIFrameFullScreen(){return this._state.isIFrameFullScreen}isConnected(){return this._state.isConnected}async _initializeState(e){try{const{torusUrl:t,dappStorageKey:n,torusAlertContainer:r,torusIframe:i}=e;this.torusUrl=t,this.dappStorageKey=n,this.torusAlertContainer=r,this.torusIframe=i,this.torusIframe.addEventListener("load",(()=>{this._state.isIFrameFullScreen||this._displayIframe()}));const{currentLoginProvider:o,isLoggedIn:s}=await this.request({method:a.vU.GET_PROVIDER_STATE,params:[]});this._handleConnect(o,s)}catch(t){Z.error("Torus: Failed to get initial state. Please report this bug.",t)}finally{Z.info("initialized communication state"),this._state.initialized=!0,this.emit("_initialized")}}_handleWindow(e){let{url:t,target:n,features:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new URL(t||`${this.torusUrl}/redirect?windowId=${e}`);this.dappStorageKey&&(i.hash?i.hash+=`&dappStorageKey=${this.dappStorageKey}`:i.hash=`#dappStorageKey=${this.dappStorageKey}`);const o=new re({url:i,target:n,features:r});o.open(),o.window?(this.windowRefs[e]=o,this.request({method:a.vU.OPENED_WINDOW,params:{windowId:e}}),o.once("close",(()=>{delete this.windowRefs[e],this.request({method:a.vU.CLOSED_WINDOW,params:{windowId:e}})}))):this._createPopupBlockAlert(e,i.href)}_displayIframe(){let{isFull:e=!1,rid:t=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n={};if(e)n.display="block",n.width="100%",n.height="100%",n.top="0px",n.right="0px",n.left="0px",n.bottom="0px";else switch(n.display=this._state.torusWidgetVisibility?"block":"none",n.height="70px",n.width="70px",this._state.buttonPosition){case q.TOP_LEFT:n.top="0px",n.left="0px",n.right="auto",n.bottom="auto";break;case q.TOP_RIGHT:n.top="0px",n.right="0px",n.left="auto",n.bottom="auto";break;case q.BOTTOM_RIGHT:n.bottom="0px",n.right="0px",n.top="auto",n.left="auto";break;case q.BOTTOM_LEFT:default:n.bottom="0px",n.left="0px",n.top="auto",n.right="auto"}Object.assign(this.torusIframe.style,n),this._state.isIFrameFullScreen=e,this.request({method:a.vU.IFRAME_STATUS,params:{isIFrameFullScreen:e,rid:t}})}hideTorusButton(){this._state.torusWidgetVisibility=!1,this._displayIframe()}showTorusButton(){this._state.torusWidgetVisibility=!0,this._displayIframe()}_rpcRequest(e,t){const n=t,r=e;Array.isArray(r)||r.jsonrpc||(r.jsonrpc="2.0"),this.tryWindowHandle(r,n)}_handleConnect(e,t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{currentLoginProvider:e,isLoggedIn:t}),Z.debug(B.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let n;this._state.isConnected=!1,e?(n=new M.Cg(1013,t||F.disconnected()),Z.debug(n)):(n=new M.Cg(1011,t||F.permanentlyDisconnected()),Z.error(n),this._state.currentLoginProvider=null,this._state.isLoggedIn=!1,this._state.torusWidgetVisibility=!1,this._state.isIFrameFullScreen=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleCloseWindow(e){const{windowId:t}=e;this.windowRefs[t]&&(this.windowRefs[t].close(),delete this.windowRefs[t])}async _createPopupBlockAlert(e,t){const n=this.getLogoUrl(),r=te(`<div id="torusAlert" class="torus-alert--v2"><div id="torusAlert__logo"><img src="${n}" /></div><div><h1 id="torusAlert__title">${this.embedTranslations.actionRequired}</h1><p id="torusAlert__desc">${this.embedTranslations.pendingAction}</p></div></div>`),i=te(`<div><a id="torusAlert__btn">${this.embedTranslations.continue}</a></div>`),o=te('<div id="torusAlert__btn-container"></div>');o.appendChild(i),r.appendChild(o);(()=>{this.torusAlertContainer.appendChild(r)})(),(()=>{i.addEventListener("click",(()=>{this._handleWindow(e,{url:t,target:"_blank",features:Q(X)}),r.remove(),0===this.torusAlertContainer.children.length&&(this.torusAlertContainer.style.display="none")}))})(),this.torusAlertContainer.style.display="block"}getLogoUrl(){return`${this.torusUrl}/images/torus_icon-blue.svg`}}(0,i.Z)(ie,"_defaultState",{buttonPosition:"bottom-left",currentLoginProvider:null,isIFrameFullScreen:!1,hasEmittedConnection:!1,torusWidgetVisibility:!1,initialized:!1,isLoggedIn:!1,isPermanentlyDisconnected:!1,isConnected:!1});class oe extends ee{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:o="provider"}=t;super(e,{maxEventListeners:n,jsonRpcStreamName:o}),(0,i.Z)(this,"chainId",void 0),(0,i.Z)(this,"selectedAddress",void 0),(0,i.Z)(this,"tryWindowHandle",void 0),this._state=(0,r.Z)({},oe._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this.on("connect",(()=>{this._state.isConnected=!0}));this.jsonRpcConnectionEvents.on("notification",(e=>{const{method:t,params:n}=e;t===a.zK.ACCOUNTS_CHANGED?this._handleAccountsChanged(n):t===a.zK.UNLOCK_STATE_CHANGED?this._handleUnlockStateChanged(n):t===a.zK.CHAIN_CHANGED&&this._handleChainChanged(n)}))}isConnected(){return this._state.isConnected}async _initializeState(){try{const{accounts:e,chainId:t,isUnlocked:n}=await this.request({method:a.GA.GET_PROVIDER_STATE,params:[]});
1this.emit("connect",{chainId:t}),this._handleChainChanged({chainId:t}),this._handleUnlockStateChanged({accounts:e,isUnlocked:n}),this._handleAccountsChanged(e)}catch(e){Z.error("Torus: Failed to get initial state. Please report this bug.",e)}finally{Z.info("initialized provider state"),this._state.initialized=!0,this.emit("_initialized")}}_rpcRequest(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t;const i=e;if(!Array.isArray(i))if(i.jsonrpc||(i.jsonrpc="2.0"),"solana_accounts"===i.method||"solana_requestAccounts"===i.method)r=(e,r)=>{this._handleAccountsChanged(r.result||[],"solana_accounts"===i.method,n),t(e,r)};else if("wallet_getProviderState"===i.method)return void this._rpcEngine.handle(e,r);this.tryWindowHandle(i,r)}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),Z.debug(B.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){let n;this._state.isConnected=!1,e?(n=new M.Cg(1013,t||F.disconnected()),Z.debug(n)):(n=new M.Cg(1011,t||F.permanentlyDisconnected()),Z.error(n),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleAccountsChanged(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e;Array.isArray(r)||(Z.error("Torus: Received non-array accounts parameter. Please report this bug.",r),r=[]);for(const i of e)if("string"!==typeof i){Z.error("Torus: Received non-string account. Please report this bug.",e),r=[];break}j()(this._state.accounts,r)||(t&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!n&&Z.error('Torus: "solana_accounts" unexpectedly updated accounts. Please report this bug.',r),this._state.accounts=r,this.emit("accountsChanged",r)),this.selectedAddress!==r[0]&&(this.selectedAddress=r[0]||null)}_handleChainChanged(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e?"loading"===e?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId))):Z.error("Torus: Received invalid network parameters. Please report this bug.",{chainId:e})}_handleUnlockStateChanged(){let{accounts:e,isUnlocked:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"boolean"===typeof t?t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[])):Z.error("Torus: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:t})}}function ae(e){return new Promise(((t,n)=>{try{const n=document.createElement("img");n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e}catch(r){n(r)}}))}(0,i.Z)(oe,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});const se=e=>{const{document:t}=e,n=t.querySelector('head > meta[property="og:site_name"]');if(n)return n.content;const r=t.querySelector('head > meta[name="title"]');return r?r.content:t.title&&t.title.length>0?t.title:e.location.hostname};async function le(e){try{const{document:t}=e;let n=t.querySelector('head > link[rel="shortcut icon"]');return n&&await ae(n.href)?n.href:(n=Array.from(t.querySelectorAll('head > link[rel="icon"]')).find((e=>Boolean(e.href))),n&&await ae(n.href)?n.href:"")}catch(t){return""}}const de=["send_transaction","sign_transaction","sign_all_transactions","sign_message","connect"],ce=[a.vU.SET_PROVIDER],ue=function(e){let t;try{t=window[e];const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(n){const e=n;return e&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length}}("localStorage");!async function(){try{if("undefined"===typeof document)return;const e=document.createElement("link"),{torusUrl:t}=await K("production");e.href=`${t}/frame`,e.crossOrigin="anonymous",e.type="text/html",e.rel="prefetch",e.relList&&e.relList.supports&&e.relList.supports("prefetch")&&document.head.appendChild(e)}catch(e){Z.warn(e)}}();class he{constructor(){let{modalZIndex:e=99999}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.Z)(this,"isInitialized",void 0),(0,i.Z)(this,"torusAlert",void 0),(0,i.Z)(this,"modalZIndex",void 0),(0,i.Z)(this,"alertZIndex",void 0),(0,i.Z)(this,"requestedLoginProvider",void 0),(0,i.Z)(this,"provider",void 0),(0,i.Z)(this,"communicationProvider",void 0),(0,i.Z)(this,"dappStorageKey",void 0),(0,i.Z)(this,"isTopupHidden",!1),(0,i.Z)(this,"torusAlertContainer",void 0),(0,i.Z)(this,"torusUrl",void 0),(0,i.Z)(this,"torusIframe",void 0),(0,i.Z)(this,"styleLink",void 0),this.torusUrl="",this.isInitialized=!1,this.requestedLoginProvider=null,this.modalZIndex=e,this.alertZIndex=e+1e3,this.dappStorageKey=""}get isLoggedIn(){return!!this.communicationProvider&&this.communicationProvider.isLoggedIn}
1async init(){let{buildEnv:e=H.PRODUCTION,enableLogging:t=!1,network:n,showTorusButton:r=!1,useLocalStorage:i=!1,buttonPosition:o=q.BOTTOM_LEFT,apiKey:a="torus-default",extraParams:s={},whiteLabel:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.isInitialized)throw new Error("Already initialized");u(a);const{torusUrl:d,logLevel:c}=await K(e);Z.enableAll(),Z.info(d,"url loaded"),Z.info("Solana Embed Version :2.0.0"),this.torusUrl=d,Z.setDefaultLevel(c),t?Z.enableAll():Z.disableAll();const h=this.handleDappStorageKey(i),f=new URL(d);f.pathname.endsWith("/")?f.pathname+="frame":f.pathname+="/frame";const p=new URLSearchParams;return h&&p.append("dappStorageKey",h),p.append("origin",window.location.origin),f.hash=p.toString(),this.torusIframe=te(`<iframe\n id="torusIframe"\n class="torusIframe"\n src="${f.href}"\n style="display: none; position: fixed; top: 0; right: 0; width: 100%;\n height: 100%; border: none; border-radius: 0; z-index: ${this.modalZIndex.toString()}"\n ></iframe>`),this.torusAlertContainer=te(`<div id="torusAlertContainer" style="display:none; z-index: ${this.alertZIndex.toString()}"></div>`),this.styleLink=te(`<link href="${d}/css/widget.css" rel="stylesheet" type="text/css">`),new Promise(((e,t)=>{try{this.torusIframe.addEventListener("load",(async()=>{const t=await(async()=>({name:se(window),icon:await le(window)}))();this.torusIframe.contentWindow.postMessage({buttonPosition:o,apiKey:a,network:n,dappMetadata:t,extraParams:s,whiteLabel:l},f.origin),await this._setupWeb3({torusUrl:d}),r&&this.showTorusButton(),null!==l&&void 0!==l&&l.topupHide?this.isTopupHidden=l.topupHide:this.hideTorusButton(),this.isInitialized=!0,window.torus=this,e()})),window.document.head.appendChild(this.styleLink),window.document.body.appendChild(this.torusIframe),window.document.body.appendChild(this.torusAlertContainer)}catch(i){t(i)}}))}async login(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isInitialized)throw new Error("Call init() first");try{this.requestedLoginProvider=e.loginProvider||null,this.requestedLoginProvider||this.communicationProvider._displayIframe({isFull:!0});const t=await new Promise(((t,n)=>{this.provider._rpcRequest({method:"solana_requestAccounts",params:[this.requestedLoginProvider,e.login_hint]},N(t,n))}));if(Array.isArray(t)&&t.length>0)return t;throw new Error("Login failed")}catch(t){throw Z.error("login failed",t),t}finally{this.communicationProvider.isIFrameFullScreen&&this.communicationProvider._displayIframe()}}async loginWithPrivateKey(e){if(!this.isInitialized)throw new Error("Call init() first");const{privateKey:t,userInfo:n}=e,{success:r}=await this.communicationProvider.request({method:"login_with_private_key",params:{privateKey:t,userInfo:n}});if(!r)throw new Error("Login Failed")}async logout(){if(!this.communicationProvider.isLoggedIn)throw new Error("Not logged in");await this.communicationProvider.request({method:a.vU.LOGOUT,params:[]}),this.requestedLoginProvider=null}async cleanUp(){this.communicationProvider.isLoggedIn&&await this.logout(),this.clearInit()}clearInit(){function e(e){return e instanceof Element||e instanceof Document}e(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink=void 0),e(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe=void 0),e(this.torusAlertContainer)&&window.document.body.contains(this.torusAlertContainer)&&(this.torusAlert=void 0,this.torusAlertContainer.remove(),this.torusAlertContainer=void 0),this.isInitialized=!1}hideTorusButton(){this.communicationProvider.hideTorusButton()}showTorusButton(){this.communicationProvider.showTorusButton()}async setProvider(e){await this.communicationProvider.request({method:a.vU.SET_PROVIDER,params:(0,r.Z)({},e)})}async showWallet(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await this.communicationProvider.request({method:a.vU.WALLET_INSTANCE_ID,params:[]}),r=e?`/${e}`:"",i=new URL(`${this.torusUrl}/wallet${r}`);i.searchParams.append("instanceId",n),Object.keys(t).forEach((e=>{i.searchParams.append(e,t[e])})),this.dappStorageKey&&(i.hash=`#dappStorageKey=${this.dappStorageKey}`);new re({url:i,features:Q(Y)}).open()}async getUserInfo(){return await this.communicationProvider.request({method:a.vU.USER_INFO,params:[]})}async initiateTopup(e,t){if(!this.isInitialized)throw new Error("Torus is not initialized");const n=V();this.communicationProvider._handleWindow(n);return await this.communicationProvider.request({method:a.vU.TOPUP,params:{provider:e,params:t,windowId:n}})}async getAccounts(){return await this.provider.request({method:"getAccounts",params:[]})}async sendTransaction(e){const t=ne(e),n=t?e.serialize({requireAllSignatures:!1}).toString("hex"):W.from(e.serialize()).toString("hex");return await this.provider.request({method:"send_transaction",params:{message:n,isLegacyTransaction:t}})}async signAndSendTransaction(e,t){const n=ne(e),r=n?e.serialize({requireAllSignatures:!1}).toString("hex"):W.from(e.serialize()).toString("hex");return{signature:await this.provider.request({method:"send_transaction",params:{message:r,options:t,isLegacyTransaction:n}})}}async signTransaction(e){const t=ne(e),n=t?e.serializeMessage().toString("hex"):W.from(e.message.serialize()).toString("hex"),r=await this.provider.request({method:"sign_transaction",params:{message:n,messageOnly:!0,isLegacyTransaction:t}}),i=JSON.parse(r),a={publicKey:new o.nh(i.publicKey),signature:W.from(i.signature,"hex")};return e.addSignature(a.publicKey,a.signature),e}async signAllTransactions(e){let t;const n=e.map((e=>(t=ne(e),t?e.serializeMessage().toString("hex"):W.from(e.message.serialize()).toString("hex")))),r=(await this.provider.request({method:"sign_all_transactions",params:{message:n,messageOnly:!0,isLegacyTransaction:t}})).map((e=>{const t=JSON.parse(e);return{publicKey:new o.nh(t.publicKey),signature:W.from(t.signature,"hex")}}));return e.forEach(((e,t)=>(e.addSignature(r[t].publicKey,r[t].signature),e))),e}async signMessage(e){return await this.provider.request({method:"sign_message",params:{data:e}})}async getGaslessPublicKey(){return await this.provider.request({method:"get_gasless_public_key",params:[]})}handleDappStorageKey(e){const t=`${G.localStorageKeyPrefix}${window.location.hostname}`;let n="";if(ue&&e){const e=window.localStorage.getItem(t);if(e)n=e;else{const e=`torus-app-${V()}`;window.localStorage.setItem(t,e),n=e}}return this.dappStorageKey=n,n}async _setupWeb3(e){Z.info("setupWeb3 running");const t=new A({name:"embed_torus",target:"iframe_torus",targetWindow:this.torusIframe.contentWindow}),n=new A({name:"embed_communication",target:"iframe_communication",targetWindow:this.torusIframe.contentWindow}),i=new oe(t,{}),o=new ie(n,{});i.tryWindowHandle=(e,t)=>
1{const n=e;if(!Array.isArray(n)&&de.includes(n.method)){if(!this.communicationProvider.isLoggedIn)throw new Error("User Not Logged In");const e=V();o._handleWindow(e,{target:"_blank",features:Q(X)}),n.windowId=e}i._rpcEngine.handle(n,t)},o.tryWindowHandle=(e,t)=>{const n=e;if(!Array.isArray(n)&&ce.includes(n.method)){const e=V();o._handleWindow(e,{target:"_blank",features:Q(z)}),n.params.windowId=e}o._rpcEngine.handle(n,t)};const a=e=>{const t=i[e],n=this;i[e]=function(e,r){const{method:i,params:o=[]}=e;if("solana_requestAccounts"===i){if(!r)return n.login({loginProvider:o[0]});n.login({loginProvider:o[0]}).then((e=>r(null,e))).catch((e=>r(e)))}return t.apply(this,[e,r])}};a("request"),a("sendAsync"),a("send");const s=new Proxy(i,{deleteProperty:()=>!0}),l=new Proxy(o,{deleteProperty:()=>!0});this.provider=s,this.communicationProvider=l,await Promise.all([i._initializeState(),o._initializeState((0,r.Z)((0,r.Z)({},e),{},{dappStorageKey:this.dappStorageKey,torusAlertContainer:this.torusAlertContainer,torusIframe:this.torusIframe}))]),Z.debug("Torus - injected provider")}}n(95898);Symbol("IGNORE_SUBSTREAM");n(1827);var fe=n(79392);function pe(e){let t,n=!1,r=0;try{t=window[e],n=!0,r=t.length;const i="__storage_test__";return t.setItem(i,i),t.removeItem(i),!0}catch(i){const e=i;return e&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n&&0!==r}}class be{constructor(){(0,i.Z)(this,"store",{})}getItem(e){return this.store[e]||null}setItem(e,t){this.store[e]=t}}(0,i.Z)(class{constructor(e,t){(0,i.Z)(this,"storage",void 0),(0,i.Z)(this,"_storeKey",void 0),this.storage=t,this._storeKey=e;try{t.getItem(e)||this.resetStore()}catch(n){}}static getInstance(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(!this.instance){let n;n="local"===t&&pe("localStorage")?window.localStorage:"session"===t&&pe("sessionStorage")?window.sessionStorage:new be,this.instance=new this(e,n)}return this.instance}toJSON(){return this.storage.getItem(this._storeKey)}resetStore(){const e=this.getStore();return this.storage.setItem(this._storeKey,JSON.stringify({})),e}getStore(){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")}get(e){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")[e]}set(e,t){const n=JSON.parse(this.storage.getItem(this._storeKey)||"{}");n[e]=t,this.storage.setItem(this._storeKey,JSON.stringify(n))}},"instance",void 0);(0,r.Z)((0,r.Z)({},fe.X_),fe.Ad);var ge=n(688);const ye=l().getLogger("http-helpers");ye.setLevel(s.levels.INFO);class we extends Error{}we.prototype.name="InvalidTokenError";const _e="solana",me="solana";class ve extends ge.s{constructor(e,t){super(t),(0,i.Z)(this,"code",void 0),(0,i.Z)(this,"message",void 0),this.code=e,this.message=t||"",Object.defineProperty(this,"name",{value:"Web3AuthError"})}toJSON(){return{name:this.name,code:this.code,message:this.message}}toString(){return JSON.stringify(this.toJSON())}}class Se extends ve{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{value:"WalletInitializationError"})}static fromCode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new Se(e,`${Se.messages[e]}, ${t}`)}static notFound(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5001,e)}static notInstalled(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5002,e)}static notReady(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5003,e)}static windowBlocked(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5004,e)}static windowClosed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5005,e)}static incompatibleChainNameSpace(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5006,e)}static duplicateAdapterError(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5007,e)}static invalidProviderConfigError(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5008,e)}static providerNotReadyError(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5009,e)}static rpcConnectionError(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5010,e)}
1static invalidParams(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5011,e)}static invalidNetwork(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Se.fromCode(5013,e)}}(0,i.Z)(Se,"messages",{5e3:"Custom",5001:"Wallet is not found",5002:"Wallet is not installed",5003:"Wallet is not ready yet",5004:"Wallet window is blocked",5005:"Wallet window has been closed by the user",5006:"Incompatible chain namespace provided",5007:"Adapter has already been included",5008:"Invalid provider Config",5009:"Provider is not ready yet",5010:"Failed to connect with rpc url",5011:"Invalid params passed in",5013:"Invalid network provided"});class Ee extends ve{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{value:"WalletLoginError"})}static fromCode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new Ee(e,`${Ee.messages[e]}. ${t}`)}static connectionError(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5111,e)}static disconnectionError(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5112,e)}static notConnectedError(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5113,e)}static popupClosed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5114,e)}static mfaEnabled(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5115,e)}static chainConfigNotAdded(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5116,e)}static unsupportedOperation(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5117,e)}static coreKitKeyNotFound(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5118,e)}static userNotLoggedIn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ee.fromCode(5119,e)}}(0,i.Z)(Ee,"messages",{5e3:"Custom",5111:"Failed to connect with wallet",5112:"Failed to disconnect from wallet",5113:"Wallet is not connected",5114:"Wallet popup has been closed by the user",5115:"User has already enabled mfa, please use the @web3auth/web3auth-web sdk for login with mfa",5116:"Chain config has not been added. Please add the chain config before calling switchChain",5117:"Unsupported operation",5118:"useCoreKitKey flag is enabled but coreKitKey is not available",5119:"User not logged in."});class Re extends ve{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{value:"WalletOperationsError"})}static fromCode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new Re(e,`${Re.messages[e]}, ${t}`)}static chainIDNotAllowed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Re.fromCode(5201,e)}static operationNotAllowed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Re.fromCode(5202,e)}static chainNamespaceNotAllowed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Re.fromCode(5203,e)}}(0,i.Z)(Re,"messages",{5e3:"Custom",5201:"Provided chainId is not allowed",5202:"This operation is not allowed"});class Ae extends ve{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{value:"WalletProviderError"})}static fromCode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new Re(e,`${Ae.messages[e]}, ${t}`)}static invalidRequestArgs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Re.fromCode(5301,e)}static invalidRequestMethod(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Re.fromCode(5302,e)}static invalidRequestParams(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Re.fromCode(5303,e)}}(0,i.Z)(Ae,"messages",{5e3:"Custom",5301:"Expected a single, non-array, object argument.",5302:"'args.method' must be a non-empty string.",5303:"'args.params' must be an object or array if provided."});const Te={OPENLOGIN:"openlogin",WALLET_CONNECT_V2:"wallet-connect-v2"},Ie=(0,r.Z)({TORUS_SOLANA:"torus-solana",PHANTOM:"phantom",SOLFLARE:"solflare",SLOPE:"slope"},Te),ke=(0,r.Z)({TORUS_EVM:"torus-evm",METAMASK:"metamask",COINBASE:"coinbase"},Te),Ne=(0,r.Z)((0,r.Z)({},ke),Ie),Oe=(Ie.TORUS_SOLANA,Ie.PHANTOM,Ie.SOLFLARE,Ie.SLOPE,ke.TORUS_EVM,ke.METAMASK,ke.COINBASE,"external"),Pe={NOT_READY:"not_ready",READY:"ready",CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected",ERRORED:"errored"},Le=(0,r.Z)((0,r.Z)({},Pe),{},{ADAPTER_DATA_UPDATED:"adapter_data_updated",CACHE_CLEAR:"cache_clear"});var xe=l().getLogger("web3auth-logger");var Ce=n(30862),Me=n(31339);class De extends Ce.v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(e),(0,i.Z)(this,"name",Ne.TORUS_SOLANA),(0,i.Z)(this,"adapterNamespace",me),(0,i.Z)(this,"currentChainNamespace",_e),(0,i.Z)(this,"type",Oe),(0,i.Z)(this,"status",Pe.NOT_READY),(0,i.Z)(this,"torusInstance",null),(0,i.Z)(this,"torusWalletOptions",void 0),(0,i.Z)(this,"initParams",void 0),(0,i.Z)(this,"loginSettings",{}
1),(0,i.Z)(this,"solanaProvider",null),this.torusWalletOptions=e.adapterSettings||{},this.initParams=e.initParams||{},this.loginSettings=e.loginSettings||{}}get provider(){return this.status!==Pe.NOT_READY&&this.solanaProvider?this.solanaProvider:null}set provider(e){throw new Error("Not implemented")}async init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await super.init(e),super.checkInitializationRequirements();const{chainId:t,blockExplorer:n,displayName:i,rpcTarget:o,ticker:a,tickerName:s}=this.chainConfig,l={chainId:t,rpcTarget:o,blockExplorerUrl:n,displayName:i,tickerName:s,ticker:a,logo:""};this.torusInstance=new he(this.torusWalletOptions),xe.debug("initializing torus solana adapter init"),await this.torusInstance.init((0,r.Z)((0,r.Z)({showTorusButton:!1},this.initParams),{},{network:l})),this.solanaProvider=new Me.Os({config:{chainConfig:this.chainConfig}}),this.status=Pe.READY,this.emit(Le.READY,Ne.TORUS_SOLANA);try{xe.debug("initializing torus solana adapter"),e.autoConnect&&(this.rehydrated=!0,await this.connect())}catch(d){xe.error("Failed to connect with cached torus solana provider",d),this.emit(Le.ERRORED,d)}}async connect(){if(super.checkConnectionRequirements(),!this.torusInstance)throw Se.notReady("Torus wallet is not initialized");if(!this.solanaProvider)throw Se.notReady("Torus wallet is not initialized");this.status=Pe.CONNECTING,this.emit(Le.CONNECTING,{adapter:Ne.TORUS_SOLANA});try{await this.torusInstance.login(this.loginSettings);try{const e=this.torusInstance.provider;e.sendTransaction=this.torusInstance.sendTransaction.bind(this.torusInstance),e.signAllTransactions=this.torusInstance.signAllTransactions.bind(this.torusInstance),e.signMessage=this.torusInstance.signMessage.bind(this.torusInstance),e.signTransaction=this.torusInstance.signTransaction.bind(this.torusInstance),await this.solanaProvider.setupProvider(e)}catch(e){if(!(e instanceof ve&&5010===e.code))throw e;{const{chainId:e,blockExplorer:t,displayName:n,rpcTarget:r,ticker:i,tickerName:o}=this.chainConfig,a={chainId:e,rpcTarget:r,blockExplorerUrl:t,displayName:n,tickerName:o,ticker:i,logo:""};await this.torusInstance.setProvider(a)}}return this.status=Pe.CONNECTED,this.torusInstance.showTorusButton(),this.emit(Pe.CONNECTED,{adapter:Ne.TORUS_SOLANA,reconnected:this.rehydrated}),this.provider}catch(e){if(this.status=Pe.READY,this.rehydrated=!1,this.emit(Le.ERRORED,e),e instanceof ve)throw e;throw Ee.connectionError("Failed to login with torus solana wallet")}}async disconnect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cleanup:!1};if(await super.disconnectSession(),!this.torusInstance)throw Se.notReady("Torus wallet is not initialized");await this.torusInstance.logout(),e.cleanup?(this.status=Pe.NOT_READY,this.torusInstance=null,this.solanaProvider=null):this.status=Pe.READY,await super.disconnect()}async getUserInfo(){if(this.status!==Pe.CONNECTED)throw Ee.notConnectedError("Not connected with wallet");if(!this.torusInstance)throw Se.notReady("Torus wallet is not initialized");return await this.torusInstance.getUserInfo()}async addChain(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.checkAddChainRequirements(e,t),this.addChainConfig(e)}async switchChain(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.checkSwitchChainRequirements(e,n);const r=this.getChainConfig(e.chainId);await(null===(t=this.torusInstance)||void 0===t?void 0:t.setProvider({rpcTarget:r.rpcTarget,chainId:r.chainId,displayName:r.displayName,blockExplorerUrl:r.blockExplorer,ticker:r.ticker,tickerName:r.tickerName,logo:"https://images.web3auth.io/login-torus-solana.svg"})),this.setAdapterSettings({chainConfig:this.getChainConfig(e.chainId)})}}},81206:(e,t,n)=>{"use strict";const{AbortError:r,codes:i}=n(82860),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:s}=n(84289),l=n(19406),{ERR_INVALID_ARG_TYPE:d}=i;e.exports.addAbortSignal=function(t,n){if(((e,t)=>{if("object"!==typeof e||!("aborted"in e))throw new d(t,"AbortSignal",e)})(t,"signal"),!o(n)&&!a(n))throw new d("stream",["ReadableStream","WritableStream","Stream"],n);return e.exports.addAbortSignalNoValidate(t,n)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!==typeof e||!("aborted"in e))return t;const n=o(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[s](new r(void 0,{cause:e.reason}))};return e.aborted?n():(e.addEventListener("abort",n),l(t,(()=>e.removeEventListener("abort",n)))),t}}
1,74789:(e,t,n)=>{"use strict";const{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:a}=n(96918),{Buffer:s}=n(19778),{inspect:l}=n(40670);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?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(0===this.length)return"";let t=this.head,n=""+t.data;for(;null!==(t=t.next);)n+=e+t.data;return n}concat(e){if(0===this.length)return s.alloc(0);const t=s.allocUnsafe(e>>>0);let n=this.head,r=0;for(;n;)o(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){const n=this.head.data;if(e<n.length){const t=n.slice(0,e);return this.head.data=n.slice(e),t}return e===n.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{const o=n.data;if(!(e>o.length)){e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}t+=o,e-=o.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){const t=s.allocUnsafe(e),n=e;let r=this.head,i=0;do{const s=r.data;if(!(e>s.length)){e===s.length?(o(t,s,n-e),++i,r.next?this.head=r.next:this.head=this.tail=null):(o(t,new a(s.buffer,s.byteOffset,e),n-e),this.head=r,r.data=s.slice(e));break}o(t,s,n-e),e-=s.length,++i}while(null!==(r=r.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},60089:(e,t,n)=>{"use strict";const{pipeline:r}=n(86622),i=n(38120),{destroyer:o}=n(2832),{isNodeStream:a,isReadable:s,isWritable:l,isWebStream:d,isTransformStream:c,isWritableStream:u,isReadableStream:h}=n(84289),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:b}}=n(82860),g=n(19406);e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new b("streams");if(1===t.length)return i.from(t[0]);const y=[...t];if("function"===typeof t[0]&&(t[0]=i.from(t[0])),"function"===typeof t[t.length-1]){const e=t.length-1;t[e]=i.from(t[e])}for(let r=0;r<t.length;++r)if(a(t[r])||d(t[r])){if(r<t.length-1&&!(s(t[r])||h(t[r])||c(t[r])))throw new p(`streams[${r}]`,y[r],"must be readable");if(r>0&&!(l(t[r])||u(t[r])||c(t[r])))throw new p(`streams[${r}]`,y[r],"must be writable")}let w,_,m,v,S;const E=t[0],R=r(t,(function(e){const t=v;v=null,t?t(e):e?S.destroy(e):T||A||S.destroy()})),A=!!(l(E)||u(E)||c(E)),T=!!(s(R)||h(R)||c(R));if(S=new i({writableObjectMode:!(null===E||void 0===E||!E.writableObjectMode),readableObjectMode:!(null===R||void 0===R||!R.writableObjectMode),writable:A,readable:T}),A){if(a(E))S._write=function(e,t,n){E.write(e,t)?n():w=n},S._final=function(e){E.end(),_=e},E.on("drain",(function(){if(w){const e=w;w=null,e()}}));else if(d(E)){const e=(c(E)?E.writable:E).getWriter();S._write=async function(t,n,r){try{await e.ready,e.write(t).catch((()=>{})),r()}catch(i){r(i)}},S._final=async function(t){try{await e.ready,e.close().catch((()=>{})),_=t}catch(n){t(n)}}}const e=c(R)?R.readable:R;g(e,(()=>{if(_){const e=_;_=null,e()}}))}if(T)if(a(R))R.on("readable",(function(){if(m){const e=m;m=null,e()}})),R.on("end",(function(){S.push(null)})),S._read=function(){for(;;){const e=R.read();if(null===e)return void(m=S._read);if(!S.push(e))return}};else if(d(R)){const e=(c(R)?R.readable:R).getReader();S._read=async function(){for(;;)try{const{value:t,done:n}=await e.read();if(!S.push(t))return;if(n)return void S.push(null)}catch{return}}}return S._destroy=function(e,t){e||null===v||(e=new f),m=null,w=null,_=null,null===v?t(e):(v=t,a(R)&&o(R,e))},S}},2832:(e,t,n)=>{"use strict";const r=n(1426),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:a}=n(82860),{Symbol:s}=n(96918),{kDestroyed:l,isDestroyed:d,isFinished:c,isServerRequest:u}=n(84289),h=s("kDestroy"),f=s("kConstruct");function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function b(e,t,n){let i=!1;function o(t){if(i)return;i=!0;const o=e._readableState,a=e._writableState;p(t,a,o),a&&(a.closed=!0),o&&(o.closed=!0),"function"===typeof n&&n(t),t?r.nextTick(g,e,t):r.nextTick(y,e)}try{e._destroy(t||null,o)}catch(t){o(t)}}function g(e,t){w(e,t),y(e)}function y(e){const t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!==n&&void 0!==n&&n.emitClose||null!==t&&void 0!==t&&t.emitClose)&&e.emit("close")}function w(e,t){const n=e._readableState,r=e._writableState;null!==r&&void 0!==r&&r.errorEmitted||null!==n&&void 0!==n&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit("error",t))}function _(e,t,n){const i=e._readableState,o=e._writableState;if(null!==o&&void 0!==o&&o.destroyed||null!==i&&void 0!==i&&i.destroyed)return this;null!==i&&void 0!==i&&i.autoDestroy||null!==o&&void 0!==o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(w,e,t):w(e,t))}function m(e){let t=!1;
1function n(n){if(t)return void _(e,null!==n&&void 0!==n?n:new o);t=!0;const i=e._readableState,a=e._writableState,s=a||i;i&&(i.constructed=!0),a&&(a.constructed=!0),s.destroyed?e.emit(h,n):n?_(e,n,!0):r.nextTick(v,e)}try{e._construct((e=>{r.nextTick(n,e)}))}catch(i){r.nextTick(n,i)}}function v(e){e.emit(f)}function S(e){return(null===e||void 0===e?void 0:e.setHeader)&&"function"===typeof e.abort}function E(e){e.emit("close")}function R(e,t){e.emit("error",t),r.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!==typeof e._construct)return;const n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(f,t),e.listenerCount(f)>1||r.nextTick(m,e)},destroyer:function(e,t){e&&!d(e)&&(t||c(e)||(t=new a),u(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"===typeof e.destroy?e.destroy(t):"function"===typeof e.close?e.close():t?r.nextTick(R,e,t):r.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const n=this._readableState,r=this._writableState,o=r||n;return null!==r&&void 0!==r&&r.destroyed||null!==n&&void 0!==n&&n.destroyed?("function"===typeof t&&t(),this):(p(e,r,n),r&&(r.destroyed=!0),n&&(n.destroyed=!0),o.constructed?b(this,e,t):this.once(h,(function(n){b(this,i(n,e),t)})),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:_}},38120:(e,t,n)=>{"use strict";const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:a}=n(96918);e.exports=d;const s=n(5146),l=n(63654);a(d.prototype,s.prototype),a(d,s);{const e=o(l.prototype);for(let t=0;t<e.length;t++){const n=e[t];d.prototype[n]||(d.prototype[n]=l.prototype[n])}}function d(e){if(!(this instanceof d))return new d(e);s.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let c,u;function h(){return void 0===c&&(c={}),c}r(d.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),d.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},d.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},d.from=function(e){return u||(u=n(77416)),u(e,"body")}},77416:(e,t,n)=>{const r=n(1426),i=n(19778),{isReadable:o,isWritable:a,isIterable:s,isNodeStream:l,isReadableNodeStream:d,isWritableNodeStream:c,isDuplexNodeStream:u}=n(84289),h=n(19406),{AbortError:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:b}}=n(82860),{destroyer:g}=n(2832),y=n(38120),w=n(5146),{createDeferredPromise:_}=n(40670),m=n(36691),v=globalThis.Blob||i.Blob,S="undefined"!==typeof v?function(e){return e instanceof v}:function(e){return!1},E=globalThis.AbortController||n(35935).AbortController,{FunctionPrototypeCall:R}=n(96918);class A extends y{constructor(e){super(e),!1===(null===e||void 0===e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null===e||void 0===e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!==typeof e.readable.read?w.wrap(e.readable):e.readable,n=e.writable;let r,i,s,l,d,c=!!o(t),u=!!a(n);function p(e){const t=l;l=null,t?t(e):e&&d.destroy(e)}return d=new A({readableObjectMode:!(null===t||void 0===t||!t.readableObjectMode),writableObjectMode:!(null===n||void 0===n||!n.writableObjectMode),readable:c,writable:u}),u&&(h(n,(e=>{u=!1,e&&g(t,e),p(e)})),d._write=function(e,t,i){n.write(e,t)?i():r=i},d._final=function(e){n.end(),i=e},n.on("drain",(function(){if(r){const e=r;r=null,e()}})),n.on("finish",(function(){if(i){const e=i;i=null,e()}}))),c&&(h(t,(e=>{c=!1,e&&g(t,e),p(e)})),t.on("readable",(function(){if(s){const e=s;s=null,e()}})),t.on("end",(function(){d.push(null)})),d._read=function(){for(;;){const e=t.read();if(null===e)return void(s=d._read);if(!d.push(e))return}}),d._destroy=function(e,o){e||null===l||(e=new f),s=null,r=null,i=null,null===l?o(e):(l=o,g(n,e),g(t,e))},d}e.exports=function e(t,n){if(u(t))return t;if(d(t))return T({readable:t});if(c(t))return T({writable:t});if(l(t))return T({writable:!1,readable:!1});if("function"===typeof t){const{value:e,write:i,final:o,destroy:a}=function(e){let{promise:t,resolve:n}=_();const i=new E,o=i.signal,a=e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:a,cb:s}=await e;if(r.nextTick(s),a)return;if(o.aborted)throw new f(void 0,{cause:o.reason});({promise:t,resolve:n}=_()),yield i}}(),{signal:o});return{value:a,write(e,t,r){const i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){const t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return m(A,e,{objectMode:!0,write:i,final:o,destroy:a});const l=null===e||void 0===e?void 0:e.then;if("function"===typeof l){let t;const n=R(l,e,(e=>{if(null!=e)throw new b("nully","body",e)}),(e=>{g(t,e)}));return t=new A({objectMode:!0,readable:!1,write:i,final(e){o((async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}}))},destroy:a})}throw new b("Iterable, AsyncIterable or AsyncFunction",n,e)}if(S(t))return e(t.arrayBuffer());if(s(t))return m(A,t,{objectMode:!0,writable:!1});if("object"===typeof(null===t||void 0===t?void 0:t.writable)||"object"===typeof(null===t||void 0===t?void 0:t.readable)){return T({readable:null!==t&&void 0!==t&&t.readable?d(null===t||void 0===t?void 0:t.readable)?null===t||void 0===t?void 0:t.readable:e(t.readable):void 0,writable:null!==t&&void 0!==t&&t.writable?c(null===t||void 0===t?void 0:t.writable)?null===t||void 0===t?void 0:t.writable:e(t.writable):void 0})}const i=null===t||void 0===t?void 0:t.then;if("function"===typeof i){let e;return R(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{g(e,t)})),e=new A({objectMode:!0,writable:!1,read(){}})}throw new p(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},19406:(e,t,n)=>{const r=n(1426),{AbortError:i,codes:o}=n(82860),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=o,{kEmptyObject:l,once:d}=n(40670),{validateAbortSignal:c,validateFunction:u,validateObject:h,validateBoolean:f}=n(78924),{Promise:p,PromisePrototypeThen:b}
1=n(96918),{isClosed:g,isReadable:y,isReadableNodeStream:w,isReadableStream:_,isReadableFinished:m,isReadableErrored:v,isWritable:S,isWritableNodeStream:E,isWritableStream:R,isWritableFinished:A,isWritableErrored:T,isNodeStream:I,willEmitClose:k,kIsClosedPromise:N}=n(84289);const O=()=>{};function P(e,t,n){var o,f;if(2===arguments.length?(n=t,t=l):null==t?t=l:h(t,"options"),u(n,"callback"),c(t.signal,"options.signal"),n=d(n),_(e)||R(e))return function(e,t,n){let o=!1,a=O;if(t.signal)if(a=()=>{o=!0,n.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)r.nextTick(a);else{const r=n;n=d((function(){t.signal.removeEventListener("abort",a);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];r.apply(e,i)})),t.signal.addEventListener("abort",a)}const s=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];o||r.nextTick((()=>n.apply(e,i)))};return b(e[N].promise,s,s),O}(e,t,n);if(!I(e))throw new a("stream",["ReadableStream","WritableStream","Stream"],e);const p=null!==(o=t.readable)&&void 0!==o?o:w(e),P=null!==(f=t.writable)&&void 0!==f?f:E(e),L=e._writableState,x=e._readableState,C=()=>{e.writable||j()};let M=k(e)&&w(e)===p&&E(e)===P,D=A(e,!1);const j=()=>{D=!0,e.destroyed&&(M=!1),(!M||e.readable&&!p)&&(p&&!W||n.call(e))};let W=m(e,!1);const $=()=>{W=!0,e.destroyed&&(M=!1),(!M||e.writable&&!P)&&(P&&!D||n.call(e))},U=t=>{n.call(e,t)};let F=g(e);const B=()=>{F=!0;const t=T(e)||v(e);return t&&"boolean"!==typeof t?n.call(e,t):p&&!W&&w(e,!0)&&!m(e,!1)?n.call(e,new s):!P||D||A(e,!1)?void n.call(e):n.call(e,new s)},H=()=>{F=!0;const t=T(e)||v(e);if(t&&"boolean"!==typeof t)return n.call(e,t);n.call(e)},q=()=>{e.req.on("finish",j)};!function(e){return e.setHeader&&"function"===typeof e.abort}(e)?P&&!L&&(e.on("end",C),e.on("close",C)):(e.on("complete",j),M||e.on("abort",B),e.req?q():e.on("request",q)),M||"boolean"!==typeof e.aborted||e.on("aborted",B),e.on("end",$),e.on("finish",j),!1!==t.error&&e.on("error",U),e.on("close",B),F?r.nextTick(B):null!==L&&void 0!==L&&L.errorEmitted||null!==x&&void 0!==x&&x.errorEmitted?M||r.nextTick(H):(p||M&&!y(e)||!D&&!1!==S(e))&&(P||M&&!S(e)||!W&&!1!==y(e))?x&&e.req&&e.aborted&&r.nextTick(H):r.nextTick(H);const G=()=>{n=O,e.removeListener("aborted",B),e.removeListener("complete",j),e.removeListener("abort",B),e.removeListener("request",q),e.req&&e.req.removeListener("finish",j),e.removeListener("end",C),e.removeListener("close",C),e.removeListener("finish",j),e.removeListener("end",$),e.removeListener("error",U),e.removeListener("close",B)};if(t.signal&&!F){const o=()=>{const r=n;G(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)r.nextTick(o);else{const r=n;n=d((function(){t.signal.removeEventListener("abort",o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];r.apply(e,i)})),t.signal.addEventListener("abort",o)}}return G}e.exports=P,e.exports.finished=function(e,t){var n;let r=!1;return null===t&&(t=l),null!==(n=t)&&void 0!==n&&n.cleanup&&(f(t.cleanup,"cleanup"),r=t.cleanup),new p(((n,i)=>{const o=P(e,t,(e=>{r&&o(),e?i(e):n()}))}))}},36691:(e,t,n)=>{"use strict";const r=n(1426),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:a}=n(96918),{Buffer:s}=n(19778),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:d}=n(82860).codes;e.exports=function(e,t,n){let c,u;if("string"===typeof t||t instanceof s)return new e({objectMode:!0,...n,read(){this.push(t),this.push(null)}});if(t&&t[o])u=!0,c=t[o]();else{if(!t||!t[a])throw new l("iterable",["Iterable"],t);u=!1,c=t[a]()}const h=new e({objectMode:!0,highWaterMark:1,...n});let f=!1;return h._read=function(){f||(f=!0,async function(){for(;;){try{const{value:e,done:t}=u?await c.next():c.next();if(t)h.push(null);else{const t=e&&"function"===typeof e.then?await e:e;if(null===t)throw f=!1,new d;if(h.push(t))continue;f=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=void 0!==e&&null!==e,n="function"===typeof c.throw;if(t&&n){const{value:t,done:n}=await c.throw(e);if(await t,n)return}if("function"===typeof c.return){const{value:e}=await c.return();await e}}(e),(()=>r.nextTick(t,e)),(n=>r.nextTick(t,n||e)))},h}}
1,91672:(e,t,n)=>{"use strict";const{ArrayIsArray:r,ObjectSetPrototypeOf:i}=n(96918),{EventEmitter:o}=n(47465);function a(e){o.call(this,e)}function s(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}i(a.prototype,o.prototype),i(a,o),a.prototype.pipe=function(e,t){const n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",l),n.on("close",d));let a=!1;function l(){a||(a=!0,e.end())}function d(){a||(a=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){u(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function u(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",l),n.removeListener("close",d),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return s(n,"error",c),s(e,"error",c),n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e},e.exports={Stream:a,prependListener:s}},40034:(e,t,n)=>{"use strict";const r=globalThis.AbortController||n(35935).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:l}=n(82860),{validateAbortSignal:d,validateInteger:c,validateObject:u}=n(78924),h=n(96918).Symbol("kWeak"),{finished:f}=n(19406),p=n(60089),{addAbortSignalNoValidate:b}=n(81206),{isWritable:g,isNodeStream:y}=n(84289),{ArrayPrototypePush:w,MathFloor:_,Number:m,NumberIsNaN:v,Promise:S,PromiseReject:E,PromisePrototypeThen:R,Symbol:A}=n(96918),T=A("kEmpty"),I=A("kEof");function k(e,t){if("function"!==typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&u(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&d(t.signal,"options.signal");let n=1;return null!=(null===t||void 0===t?void 0:t.concurrency)&&(n=_(t.concurrency)),c(n,"concurrency",1),async function*(){var i,o;const a=new r,s=this,d=[],c=a.signal,u={signal:c},h=()=>a.abort();let f,p;null!==t&&void 0!==t&&null!==(i=t.signal)&&void 0!==i&&i.aborted&&h(),null===t||void 0===t||null===(o=t.signal)||void 0===o||o.addEventListener("abort",h);let b=!1;function g(){b=!0}!async function(){try{for await(let t of s){var r;if(b)return;if(c.aborted)throw new l;try{t=e(t,u)}catch(o){t=E(o)}t!==T&&("function"===typeof(null===(r=t)||void 0===r?void 0:r.catch)&&t.catch(g),d.push(t),f&&(f(),f=null),!b&&d.length&&d.length>=n&&await new S((e=>{p=e})))}d.push(I)}catch(o){const e=E(o);R(e,void 0,g),d.push(e)}finally{var i;b=!0,f&&(f(),f=null),null===t||void 0===t||null===(i=t.signal)||void 0===i||i.removeEventListener("abort",h)}}();try{for(;;){for(;d.length>0;){const e=await d[0];if(e===I)return;if(c.aborted)throw new l;e!==T&&(yield e),d.shift(),p&&(p(),p=null)}await new S((e=>{f=e}))}}finally{a.abort(),b=!0,p&&(p(),p=null)}}.call(this)}async function N(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;for await(const n of O.call(this,e,t))return!0;return!1}function O(e,t){if("function"!==typeof e)throw new o("fn",["Function","AsyncFunction"],e);return k.call(this,(async function(t,n){return await e(t,n)?t:T}),t)}class P extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function L(e){if(e=m(e),v(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return null!=e&&u(e,"options"),null!=(null===e||void 0===e?void 0:e.signal)&&d(e.signal,"options.signal"),async function*(){let t=0;for await(const r of this){var n;if(null!==e&&void 0!==e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l({cause:e.signal.reason});yield[t++,r]}}.call(this)},drop:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return null!=t&&u(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&d(t.signal,"options.signal"),e=L(e),async function*(){var n;if(null!==t&&void 0!==t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const i of this){var r;if(null!==t&&void 0!==t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;e--<=0&&(yield i)}}.call(this)},filter:O,flatMap:function(e,t){const n=k.call(this,e,t);return async function*(){for await(const e of n)yield*e}.call(this)},map:k,take:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return null!=t&&u(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&d(t.signal,"options.signal"),e=L(e),async function*(){var n;if(null!==t&&void 0!==t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const i of this){var r;if(null!==t&&void 0!==t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;if(!(e-- >0))return;yield i}}.call(this)},compose:function(e,t){if(null!=t&&u(t,"options"),null!=(null===t||void 0===t?void 0:t.signal)&&d(t.signal,"options.signal"),y(e)&&!g(e))throw new i("stream",e,"must be writable");const n=p(this,e);return null!==t&&void 0!==t&&t.signal&&b(t.signal,n),n}},e.exports.promiseReturningOperators={every:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;
1if("function"!==typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await N.call(this,(async function(){return!await e(...arguments)}),t)},forEach:async function(e,t){if("function"!==typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const n of k.call(this,(async function(t,n){return await e(t,n),T}),t));},reduce:async function(e,t,n){var i;if("function"!==typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=n&&u(n,"options"),null!=(null===n||void 0===n?void 0:n.signal)&&d(n.signal,"options.signal");let a=arguments.length>1;if(null!==n&&void 0!==n&&null!==(i=n.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await f(this.destroy(e)),e}const s=new r,c=s.signal;if(null!==n&&void 0!==n&&n.signal){const e={once:!0,[h]:this};n.signal.addEventListener("abort",(()=>s.abort()),e)}let p=!1;try{for await(const r of this){var b;if(p=!0,null!==n&&void 0!==n&&null!==(b=n.signal)&&void 0!==b&&b.aborted)throw new l;a?t=await e(t,r,{signal:c}):(t=r,a=!0)}if(!p&&!a)throw new P}finally{s.abort()}return t},toArray:async function(e){null!=e&&u(e,"options"),null!=(null===e||void 0===e?void 0:e.signal)&&d(e.signal,"options.signal");const t=[];for await(const r of this){var n;if(null!==e&&void 0!==e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,r)}return t},some:N,find:async function(e,t){for await(const n of O.call(this,e,t))return n}}},22727:(e,t,n)=>{"use strict";const{ObjectSetPrototypeOf:r}=n(96918);e.exports=o;const i=n(96859);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}r(o.prototype,i.prototype),r(o,i),o.prototype._transform=function(e,t,n){n(null,e)}},86622:(e,t,n)=>{const r=n(1426),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:a}=n(96918),s=n(19406),{once:l}=n(40670),d=n(2832),c=n(38120),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:f,ERR_MISSING_ARGS:p,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:y}=n(82860),{validateFunction:w,validateAbortSignal:_}=n(78924),{isIterable:m,isReadable:v,isReadableNodeStream:S,isNodeStream:E,isTransformStream:R,isWebStream:A,isReadableStream:T,isReadableEnded:I}=n(84289),k=globalThis.AbortController||n(35935).AbortController;let N,O;function P(e,t,n){let r=!1;e.on("close",(()=>{r=!0}));return{destroy:t=>{r||(r=!0,d.destroyer(e,t||new b("pipe")))},cleanup:s(e,{readable:t,writable:n},(e=>{r=!e}))}}function L(e){if(m(e))return e;if(S(e))return async function*(e){O||(O=n(5146));yield*O.prototype[a].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function x(e,t,n,r){let i,{end:a}=r,l=null;const d=e=>{if(e&&(i=e),l){const e=l;l=null,e()}},c=()=>new o(((e,t)=>{i?t(i):l=()=>{i?t(i):e()}}));t.on("drain",d);const h=s(t,{readable:!1},d);try{t.writableNeedDrain&&await c();for await(const n of e)t.write(n)||await c();a&&t.end(),await c(),n()}catch(f){n(i!==f?u(i,f):f)}finally{h(),t.off("drain",d)}}async function C(e,t,n,r){let{end:i}=r;R(t)&&(t=t.writable);const o=t.getWriter();try{for await(const t of e)await o.ready,o.write(t).catch((()=>{}));await o.ready,i&&await o.close(),n()}catch(a){try{await o.abort(a),n(a)}catch(a){n(a)}}}function M(e,t,o){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new p("streams");const a=new k,s=a.signal,l=null===o||void 0===o?void 0:o.signal,d=[];function u(){j(new y)}let b,g;_(l,"options.signal"),null===l||void 0===l||l.addEventListener("abort",u);const w=[];let I,O=0;function M(e){j(e,0===--O)}function j(e,n){if(!e||b&&"ERR_STREAM_PREMATURE_CLOSE"!==b.code||(b=e),b||n){for(;w.length;)w.shift()(b);null===l||void 0===l||l.removeEventListener("abort",u),a.abort(),n&&(b||d.forEach((e=>e())),r.nextTick(t,b,g))}}for(let F=0;F<e.length;F++){const B=e[F],H=F<e.length-1,q=F>0,G=H||!1!==(null===o||void 0===o?void 0:o.end),Z=F===e.length-1;if(E(B)){if(G){const{destroy:V,cleanup:K}=P(B,H,q);w.push(V),v(B)&&Z&&d.push(K)}function W(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&M(e)}B.on("error",W),v(B)&&Z&&d.push((()=>{B.removeListener("error",W)}))}if(0===F)if("function"===typeof B){if(I=B({signal:s}),!m(I))throw new f("Iterable, AsyncIterable or Stream","source",I)}else I=m(B)||S(B)||R(B)?B:c.from(B);else if("function"===typeof B){var $;if(R(I))I=L(null===($=I)||void 0===$?void 0:$.readable);else I=L(I);if(I=B(I,{signal:s}),H){if(!m(I,!0))throw new f("AsyncIterable",`transform[${F-1}]`,I)}else{var U;N||(N=n(22727));const z=new N({objectMode:!0}),Y=null===(U=I)||void 0===U?void 0:U.then;if("function"===typeof Y)O++,Y.call(I,(e=>{g=e,null!=e&&z.write(e),G&&z.end(),r.nextTick(M)}),(e=>{z.destroy(e),r.nextTick(M,e)}));else if(m(I,!0))O++,x(I,z,M,{end:G});else{if(!T(I)&&!R(I))throw new f("AsyncIterable or Promise","destination",I);{const Q=I.readable||I;O++,x(Q,z,M,{end:G})}}I=z;const{destroy:J,cleanup:X}=P(I,!1,!0);w.push(J),Z&&d.push(X)}}else if(E(B)){if(S(I)){O+=2;const ee=D(I,B,M,{end:G});v(B)&&Z&&d.push(ee)}else if(R(I)||T(I)){const te=I.readable||I;O++,x(te,B,M,{end:G})}else{if(!m(I))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],I);O++,x(I,B,M,{end:G})}I=B}else if(A(B)){if(S(I))O++,C(L(I),B,M,{end:G});else if(T(I)||m(I))O++,C(I,B,M,{end:G});else{if(!R(I))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],I);O++,C(I.readable,B,M,{end:G})}I=B}else I=c.from(B)}return(null!==s&&void 0!==s&&s.aborted||null!==l&&void 0!==l&&l.aborted)&&r.nextTick(u),I}function D(e,t,n,i){let{end:o}=i,a=!1;if(t.on("close",(()=>{a||n(new g)})),e.pipe(t,{end:!1}),o){function l(){a=!0,t.end()}I(e)?r.nextTick(l):e.once("end",l)}else n();return s(e,{readable:!0,writable:!1},(t=>{const r=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&r&&r.ended&&!r.errored&&!r.errorEmitted?e.once("end",n).once("error",n):n(t)})),s(t,{readable:!1,writable:!0},n)}
1e.exports={pipelineImpl:M,pipeline:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return M(t,l(function(e){return w(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(t)))}}},5146:(e,t,n)=>{const r=n(1426),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:l,ObjectKeys:d,ObjectSetPrototypeOf:c,Promise:u,SafeSet:h,SymbolAsyncIterator:f,Symbol:p}=n(96918);e.exports=$,$.ReadableState=W;const{EventEmitter:b}=n(47465),{Stream:g,prependListener:y}=n(91672),{Buffer:w}=n(19778),{addAbortSignal:_}=n(81206),m=n(19406);let v=n(40670).debuglog("stream",(e=>{v=e}));const S=n(74789),E=n(2832),{getHighWaterMark:R,getDefaultHighWaterMark:A}=n(33330),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:I,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_OUT_OF_RANGE:N,ERR_STREAM_PUSH_AFTER_EOF:O,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:P}}=n(82860),{validateObject:L}=n(78924),x=p("kPaused"),{StringDecoder:C}=n(15948),M=n(36691);c($.prototype,g.prototype),c($,g);const D=()=>{},{errorOrDestroy:j}=E;function W(e,t,r){"boolean"!==typeof r&&(r=t instanceof n(38120)),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.readableObjectMode)),this.highWaterMark=e?R(this,e,"readableHighWaterMark",r):A(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[x]=null,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new C(e.encoding),this.encoding=e.encoding)}function $(e){if(!(this instanceof $))return new $(e);const t=this instanceof n(38120);this._readableState=new W(e,this,t),e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&_(e.signal,this)),g.call(this,e),E.construct(this,(()=>{this._readableState.needReadable&&G(this,this._readableState)}))}function U(e,t,n,r){v("readableAddChunk",t);const i=e._readableState;let o;if(i.objectMode||("string"===typeof t?(n=n||i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=w.from(t,n).toString(i.encoding):(t=w.from(t,n),n=""))):t instanceof w?n="":g._isUint8Array(t)?(t=g._uint8ArrayToBuffer(t),n=""):null!=t&&(o=new I("chunk",["string","Buffer","Uint8Array"],t))),o)j(e,o);else if(null===t)i.reading=!1,function(e,t){if(v("onEofChunk"),t.ended)return;if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?H(e):(t.needReadable=!1,t.emittedReadable=!0,q(e))}(e,i);else if(i.objectMode||t&&t.length>0)if(r)if(i.endEmitted)j(e,new P);else{if(i.destroyed||i.errored)return!1;F(e,i,t,!0)}else if(i.ended)j(e,new O);else{if(i.destroyed||i.errored)return!1;i.reading=!1,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?F(e,i,t,!1):G(e,i)):F(e,i,t,!1)}else r||(i.reading=!1,G(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function F(e,t,n,r){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&H(e)),G(e,t)}$.prototype.destroy=E.destroy,$.prototype._undestroy=E.undestroy,$.prototype._destroy=function(e,t){t(e)},$.prototype[b.captureRejectionSymbol]=function(e){this.destroy(e)},$.prototype.push=function(e,t){return U(this,e,t,!1)},$.prototype.unshift=function(e,t){return U(this,e,t,!0)},$.prototype.isPaused=function(){const e=this._readableState;return!0===e[x]||!1===e.flowing},$.prototype.setEncoding=function(e){const t=new C(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let r="";for(const i of n)r+=t.write(i);return n.clear(),""!==r&&n.push(r),this._readableState.length=r.length,this};function B(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:a(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function H(e){const t=e._readableState;v("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(v("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(q,e))}function q(e){const t=e._readableState;v("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Y(e)}function G(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(Z,e,t))}function Z(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const n=t.length;if(v("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function V(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[x]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function K(e){v("readable nexttick read 0"),e.read(0)}function z(e,t){v("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Y(e),t.flowing&&!t.reading&&e.read(0)}function Y(e){const t=e._readableState;for(v("flow",t.flowing);t.flowing&&null!==e.read(););}function J(e,t){"function"!==typeof e.read&&(e=$.wrap(e,{objectMode:!0}));const n=async function*(e,t){let n,r=D;function i(t){this===e?(r(),r=D):r=t}
1e.on("readable",i);const o=m(e,{writable:!1},(e=>{n=e?T(n,e):null,r(),r=D}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(n)throw n;if(null===n)return;await new u(i)}}}catch(a){throw n=T(n,a),n}finally{!n&&!1===(null===t||void 0===t?void 0:t.destroyOnReturn)||void 0!==n&&!e._readableState.autoDestroy?(e.off("readable",i),o()):E.destroyer(e,null)}}(e,t);return n.stream=e,n}function X(e,t){if(0===t.length)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function Q(e){const t=e._readableState;v("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(ee,t,e))}function ee(e,t){if(v("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(te,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function te(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ne;function re(){return void 0===ne&&(ne={}),ne}$.prototype.read=function(e){v("read",e),void 0===e?e=NaN:o(e)||(e=s(e,10));const t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new N("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return v("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Q(this):H(this),null;if(0===(e=B(e,t))&&t.ended)return 0===t.length&&Q(this),null;let r,i=t.needReadable;if(v("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,v("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,v("reading, ended or constructing",i);else if(i){v("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0);try{this._read(t.highWaterMark)}catch(a){j(this,a)}t.sync=!1,t.reading||(e=B(n,t))}return r=e>0?X(e,t):null,null===r?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&Q(this)),null===r||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",r)),r},$.prototype._read=function(e){throw new k("_read()")},$.prototype.pipe=function(e,t){const n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),v("pipe count=%d opts=%j",i.pipes.length,t);const o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?s:g;function a(t,r){v("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,function(){v("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),l&&e.removeListener("drain",l);e.removeListener("error",f),e.removeListener("unpipe",a),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",u),d=!0,l&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}())}function s(){v("onend"),e.end()}let l;i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",a);let d=!1;function c(){d||(1===i.pipes.length&&i.pipes[0]===e?(v("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(v("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),l||(l=function(e,t){return function(){const n=e._readableState;
1n.awaitDrainWriters===t?(v("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(v("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(n,e),e.on("drain",l))}function u(t){v("ondata");const n=e.write(t);v("dest.write",n),!1===n&&c()}function f(t){if(v("onerror",t),g(),e.removeListener("error",f),0===e.listenerCount("error")){const n=e._writableState||e._readableState;n&&!n.errorEmitted?j(e,t):e.emit("error",t)}}function p(){e.removeListener("finish",b),g()}function b(){v("onfinish"),e.removeListener("close",p),g()}function g(){v("unpipe"),n.unpipe(e)}return n.on("data",u),y(e,"error",f),e.once("close",p),e.once("finish",b),e.emit("pipe",n),!0===e.writableNeedDrain?i.flowing&&c():i.flowing||(v("pipe resume"),n.resume()),e},$.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const n=i(t.pipes,e);return-1===n||(t.pipes.splice(n,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},$.prototype.on=function(e,t){const n=g.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,v("on readable",i.length,i.reading),i.length?H(this):i.reading||r.nextTick(K,this))),n},$.prototype.addListener=$.prototype.on,$.prototype.removeListener=function(e,t){const n=g.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(V,this),n},$.prototype.off=$.prototype.removeListener,$.prototype.removeAllListeners=function(e){const t=g.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(V,this),t},$.prototype.resume=function(){const e=this._readableState;return e.flowing||(v("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(z,e,t))}(this,e)),e[x]=!1,this},$.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[x]=!0,this},$.prototype.wrap=function(e){let t=!1;e.on("data",(n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{j(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const n=d(e);for(let r=1;r<n.length;r++){const t=n[r];void 0===this[t]&&"function"===typeof e[t]&&(this[t]=e[t].bind(e))}return this},$.prototype[f]=function(){return J(this)},$.prototype.iterator=function(e){return void 0!==e&&L(e,"options"),J(this,e)},l($.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!!e&&!1!==e.readable&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!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(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},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}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(W.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[x]},set(e){this[x]=!!e}}}),$._fromList=X,$.from=function(e,t){return M($,e,t)},$.fromWeb=function(e,t){return re().newStreamReadableFromReadableStream(e,t)},$.toWeb=function(e,t){return re().newReadableStreamFromStreamReadable(e,t)},$.wrap=function(e,t){var n,r;return new $({objectMode:null===(n=null!==(r=e.readableObjectMode)&&void 0!==r?r:e.objectMode)||void 0===n||n,...t,destroy(t,n){E.destroyer(e,t),n(t)}}).wrap(e)}},33330:(e,t,n)=>{"use strict";const{MathFloor:r,NumberIsInteger:i}=n(96918),{ERR_INVALID_ARG_VALUE:o}=n(82860).codes;function a(e){return e?16:16384}e.exports={getHighWaterMark:function(e,t,n,s){const l=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,s,n);if(null!=l){if(!i(l)||l<0){throw new o(s?`options.${n}`:"options.highWaterMark",l)}return r(l)}return a(e.objectMode)},getDefaultHighWaterMark:a}},96859:(e,t,n)=>{"use strict";
1const{ObjectSetPrototypeOf:r,Symbol:i}=n(96918);e.exports=d;const{ERR_METHOD_NOT_IMPLEMENTED:o}=n(82860).codes,a=n(38120),{getHighWaterMark:s}=n(33330);r(d.prototype,a.prototype),r(d,a);const l=i("kCallback");function d(e){if(!(this instanceof d))return new d(e);const t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),a.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"===typeof e.transform&&(this._transform=e.transform),"function"===typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function c(e){"function"!==typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,n)=>{t?e?e(t):this.destroy(t):(null!=n&&this.push(n),this.push(null),e&&e())}))}function u(){this._final!==c&&c.call(this)}d.prototype._final=c,d.prototype._transform=function(e,t,n){throw new o("_transform()")},d.prototype._write=function(e,t,n){const r=this._readableState,i=this._writableState,o=r.length;this._transform(e,t,((e,t)=>{e?n(e):(null!=t&&this.push(t),i.ended||o===r.length||r.length<r.highWaterMark?n():this[l]=n)}))},d.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},84289:(e,t,n)=>{"use strict";const{Symbol:r,SymbolAsyncIterator:i,SymbolIterator:o,SymbolFor:a}=n(96918),s=r("kDestroyed"),l=r("kIsErrored"),d=r("kIsReadable"),c=r("kIsDisturbed"),u=a("nodejs.webstream.isClosedPromise"),h=a("nodejs.webstream.controllerErrorFunction");function f(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var n;return!(!e||"function"!==typeof e.pipe||"function"!==typeof e.on||t&&("function"!==typeof e.pause||"function"!==typeof e.resume)||e._writableState&&!1===(null===(n=e._readableState)||void 0===n?void 0:n.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!==typeof e.write||"function"!==typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function b(e){return e&&(e._readableState||e._writableState||"function"===typeof e.write&&"function"===typeof e.on||"function"===typeof e.pipe&&"function"===typeof e.on)}function g(e){return!(!e||b(e)||"function"!==typeof e.pipeThrough||"function"!==typeof e.getReader||"function"!==typeof e.cancel)}function y(e){return!(!e||b(e)||"function"!==typeof e.getWriter||"function"!==typeof e.abort)}function w(e){return!(!e||b(e)||"object"!==typeof e.readable||"object"!==typeof e.writable)}function _(e){if(!b(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[s]||null!==r&&void 0!==r&&r.destroyed)}function m(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null===t||void 0===t||!t.errored)&&("boolean"!==typeof(null===t||void 0===t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!f(e))return null;const n=e._readableState;return(null===n||void 0===n||!n.errored)&&("boolean"!==typeof(null===n||void 0===n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===t&&!0===n.ended&&0===n.length))}function S(e){return e&&null!=e[d]?e[d]:"boolean"!==typeof(null===e||void 0===e?void 0:e.readable)?null:!_(e)&&(f(e)&&e.readable&&!v(e))}function E(e){return"boolean"!==typeof(null===e||void 0===e?void 0:e.writable)?null:!_(e)&&(p(e)&&e.writable&&!m(e))}function R(e){return"boolean"===typeof e._closed&&"boolean"===typeof e._defaultKeepAlive&&"boolean"===typeof e._removedConnection&&"boolean"===typeof e._removedContLen}function A(e){return"boolean"===typeof e._sent100&&R(e)}e.exports={kDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[c])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:c,isErrored:function(e){var t,n,r,i,o,a,s,d,c,u;return!(!e||!(null!==(t=null!==(n=null!==(r=null!==(i=null!==(o=null!==(a=e[l])&&void 0!==a?a:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(s=e._readableState)||void 0===s?void 0:s.errorEmitted)&&void 0!==r?r:null===(d=e._writableState)||void 0===d?void 0:d.errorEmitted)&&void 0!==n?n:null===(c=e._readableState)||void 0===c?void 0:c.errored)&&void 0!==t?t:null===(u=e._writableState)||void 0===u?void 0:u.errored))},kIsErrored:l,isReadable:S,kIsReadable:d,kIsClosedPromise:u,kControllerErrorFunction:h,isClosed:function(e){if(!b(e))return null;if("boolean"===typeof e.closed)return e.closed;const t=e._writableState,n=e._readableState;return"boolean"===typeof(null===t||void 0===t?void 0:t.closed)||"boolean"===typeof(null===n||void 0===n?void 0:n.closed)?(null===t||void 0===t?void 0:t.closed)||(null===n||void 0===n?void 0:n.closed):"boolean"===typeof e._closed&&R(e)?e._closed:null}
1,isDestroyed:_,isDuplexNodeStream:function(e){return!(!e||"function"!==typeof e.pipe||!e._readableState||"function"!==typeof e.on||"function"!==typeof e.write)},isFinished:function(e,t){return b(e)?!!_(e)||(!1===(null===t||void 0===t?void 0:t.readable)||!S(e))&&(!1===(null===t||void 0===t?void 0:t.writable)||!E(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"===typeof e[i]:!1===t?"function"===typeof e[o]:"function"===typeof e[i]||"function"===typeof e[o])},isReadableNodeStream:f,isReadableStream:g,isReadableEnded:function(e){if(!f(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!==typeof(null===t||void 0===t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,n;return b(e)?e.readableErrored?e.readableErrored:null!==(t=null===(n=e._readableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isNodeStream:b,isWebStream:function(e){return g(e)||y(e)||w(e)},isWritable:E,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:m,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const n=e._writableState;return(null===n||void 0===n||!n.errored)&&("boolean"!==typeof(null===n||void 0===n?void 0:n.finished)?null:!!(n.finished||!1===t&&!0===n.ended&&0===n.length))},isWritableErrored:function(e){var t,n;return b(e)?e.writableErrored?e.writableErrored:null!==(t=null===(n=e._writableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"===typeof e._consuming&&"boolean"===typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:A,willEmitClose:function(e){if(!b(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!r&&A(e)||!!(r&&r.autoDestroy&&r.emitClose&&!1===r.closed)},isTransformStream:w}},63654:(e,t,n)=>{const r=n(1426),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:l,ObjectSetPrototypeOf:d,StringPrototypeToLowerCase:c,Symbol:u,SymbolHasInstance:h}=n(96918);e.exports=C,C.WritableState=L;const{EventEmitter:f}=n(47465),p=n(91672).Stream,{Buffer:b}=n(19778),g=n(2832),{addAbortSignal:y}=n(81206),{getHighWaterMark:w,getDefaultHighWaterMark:_}=n(33330),{ERR_INVALID_ARG_TYPE:m,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:R,ERR_STREAM_ALREADY_FINISHED:A,ERR_STREAM_NULL_VALUES:T,ERR_STREAM_WRITE_AFTER_END:I,ERR_UNKNOWN_ENCODING:k}=n(82860).codes,{errorOrDestroy:N}=g;function O(){}d(C.prototype,p.prototype),d(C,p);const P=u("kOnFinished");function L(e,t,r){"boolean"!==typeof r&&(r=t instanceof n(38120)),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?w(this,e,"writableHighWaterMark",r):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=W.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,x(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[P]=[]}function x(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function C(e){const t=this instanceof n(38120);if(!t&&!a(C,this))return new C(e);this._writableState=new L(e,this,t),e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final),"function"===typeof e.construct&&(this._construct=e.construct),e.signal&&y(e.signal,this)),p.call(this,e),g.construct(this,(()=>{const e=this._writableState;e.writing||B(this,e),G(this,e)}))}function M(e,t,n,i){const o=e._writableState;if("function"===typeof n)i=n,n=o.defaultEncoding;else{if(n){if("buffer"!==n&&!b.isEncoding(n))throw new k(n)}else n=o.defaultEncoding;"function"!==typeof i&&(i=O)}if(null===t)throw new T;if(!o.objectMode)if("string"===typeof t)!1!==o.decodeStrings&&(t=b.from(t,n),n="buffer");else if(t instanceof b)n="buffer";
1else{if(!p._isUint8Array(t))throw new m("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),n="buffer"}let a;return o.ending?a=new I:o.destroyed&&(a=new R("write")),a?(r.nextTick(i,a),N(e,a,!0),a):(o.pendingcb++,function(e,t,n,r,i){const o=t.objectMode?1:n.length;t.length+=o;const a=t.length<t.highWaterMark;a||(t.needDrain=!0);t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:n,encoding:r,callback:i}),t.allBuffers&&"buffer"!==r&&(t.allBuffers=!1),t.allNoop&&i!==O&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(n,r,t.onwrite),t.sync=!1);return a&&!t.errored&&!t.destroyed}(e,o,t,n,i))}function D(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new R("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function j(e,t,n,r){--t.pendingcb,r(n),F(t),N(e,n)}function W(e,t){const n=e._writableState,i=n.sync,o=n.writecb;"function"===typeof o?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(j,e,n,t,o):j(e,n,t,o)):(n.buffered.length>n.bufferedIndex&&B(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:e,state:n},r.nextTick($,n.afterWriteTickInfo)):U(e,n,1,o))):N(e,new S)}function $(e){let{stream:t,state:n,count:r,cb:i}=e;return n.afterWriteTickInfo=null,U(t,n,r,i)}function U(e,t,n,r){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));n-- >0;)t.pendingcb--,r();t.destroyed&&F(t),G(e,t)}function F(e){if(e.writing)return;for(let i=e.bufferedIndex;i<e.buffered.length;++i){var t;const{chunk:n,callback:r}=e.buffered[i],o=e.objectMode?1:n.length;e.length-=o,r(null!==(t=e.errored)&&void 0!==t?t:new R("write"))}const n=e[P].splice(0);for(let i=0;i<n.length;i++){var r;n[i](null!==(r=e.errored)&&void 0!==r?r:new R("end"))}x(e)}function B(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:n,bufferedIndex:r,objectMode:o}=t,a=n.length-r;if(!a)return;let s=r;if(t.bufferProcessing=!0,a>1&&e._writev){t.pendingcb-=a-1;const r=t.allNoop?O:e=>{for(let t=s;t<n.length;++t)n[t].callback(e)},o=t.allNoop&&0===s?n:i(n,s);o.allBuffers=t.allBuffers,D(e,t,!0,t.length,o,"",r),x(t)}else{do{const{chunk:r,encoding:i,callback:a}=n[s];n[s++]=null;D(e,t,!1,o?1:r.length,r,i,a)}while(s<n.length&&!t.writing);s===n.length?x(t):s>256?(n.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}function H(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function q(e,t){t.prefinished||t.finalCalled||("function"!==typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)N(e,null!==i&&void 0!==i?i:S());else if(n=!0,t.pendingcb--,i){const n=t[P].splice(0);for(let e=0;e<n.length;e++)n[e](i);N(e,i,t.sync)}else H(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(Z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(o){i(o)}t.sync=!1}(e,t)))}function G(e,t,n){H(t)&&(q(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick(((e,t)=>{H(t)?Z(e,t):t.pendingcb--}),e,t)):H(t)&&(t.pendingcb++,Z(e,t))))}function Z(e,t){t.pendingcb--,t.finished=!0;const n=t[P].splice(0);for(let r=0;r<n.length;r++)n[r]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}L.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},s(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(C,h,{__proto__:null,value:function(e){return!!a(this,e)||this===C&&(e&&e._writableState instanceof L)}}),C.prototype.pipe=function(){N(this,new E)},C.prototype.write=function(e,t,n){return!0===M(this,e,t,n)},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||B(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"===typeof e&&(e=c(e)),!b.isEncoding(e))throw new k(e);return this._writableState.defaultEncoding=e,this},C.prototype._write=function(e,t,n){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],n)},C.prototype._writev=null,C.prototype.end=function(e,t,n){const i=this._writableState;let a;if("function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e){const n=M(this,e,t);n instanceof o&&(a=n)}return i.corked&&(i.corked=1,this.uncork()),a||(i.errored||i.ending?i.finished?a=new A("end"):i.destroyed&&(a=new R("end")):(i.ending=!0,G(this,i,!0),i.ended=!0)),"function"===typeof n&&(a||i.finished?r.nextTick(n,a):i[P].push(n)),this},l(C.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!!e&&!1!==e.writable&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&(!e.destroyed&&!e.ending&&e.needDrain)}},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!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const V=g.destroy;let K;function z(){return void 0===K&&(K={}),K}C.prototype.destroy=function(e,t){const n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[P].length)&&r.nextTick(F,n),V.call(this,e,t),this},C.prototype._undestroy=g.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype[f.captureRejectionSymbol]=function(e){this.destroy(e)},C.fromWeb=function(e,t){return z().newStreamWritableFromWritableStream(e,t)},C.toWeb=function(e){return z().newWritableStreamFromStreamWritable(e)}},78924:(e,t,n)=>{"use strict";const{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:d,NumberMIN_SAFE_INTEGER:c,NumberParseInt:u,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:b,StringPrototypeTrim:g}=n(96918),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:w,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:m,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=n(82860),{normalizeEncoding:E}=n(40670),{isAsyncFunction:R,isArrayBufferView:A}=n(40670).types,T={};const I=/^[0-7]+$/;const k=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d;if("number"!==typeof e)throw new _(t,"number",e);if(!s(e))throw new v(t,"an integer",e);if(e<n||e>r)throw new v(t,`>= ${n} && <= ${r}`,e)})),N=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-2147483648,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2147483647;if("number"!==typeof e)throw new _(t,"number",e);if(!s(e))throw new v(t,"an integer",e);if(e<n||e>r)throw new v(t,`>= ${n} && <= ${r}`,e)})),O=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!==typeof e)throw new _(t,"number",e);if(!s(e))throw new v(t,"an integer",e);const r=n?1:0,i=4294967295;if(e<r||e>i)throw new v(t,`>= ${r} && <= ${i}`,e)}));function P(e,t){if("string"!==typeof e)throw new _(t,"string",e)}const L=y(((e,t,n)=>{if(!i(n,e)){const r=o(a(n,(e=>"string"===typeof e?`'${e}'`:p(e))),", ");
1throw new m(t,e,"must be one of: "+r)}}));function x(e,t){if("boolean"!==typeof e)throw new _(t,"boolean",e)}function C(e,t,n){return null!=e&&h(e,t)?e[t]:n}const M=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const i=C(n,"allowArray",!1),o=C(n,"allowFunction",!1);if(!C(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!==typeof e&&(!o||"function"!==typeof e))throw new _(t,"Object",e)})),D=y(((e,t)=>{if(null!=e&&"object"!==typeof e&&"function"!==typeof e)throw new _(t,"a dictionary",e)})),j=y((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!r(e))throw new _(t,"Array",e);if(e.length<n){throw new m(t,e,`must be longer than ${n}`)}}));const W=y((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"buffer";if(!A(e))throw new _(t,["Buffer","TypedArray","DataView"],e)}));const $=y(((e,t)=>{if(void 0!==e&&(null===e||"object"!==typeof e||!("aborted"in e)))throw new _(t,"AbortSignal",e)})),U=y(((e,t)=>{if("function"!==typeof e)throw new _(t,"Function",e)})),F=y(((e,t)=>{if("function"!==typeof e||R(e))throw new _(t,"Function",e)})),B=y(((e,t)=>{if(void 0!==e)throw new _(t,"undefined",e)}));const H=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function q(e,t){if("undefined"===typeof e||!f(H,e))throw new m(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,n){if("undefined"===typeof e&&(e=n),"string"===typeof e){if(null===f(I,e))throw new m(t,e,"must be a 32-bit unsigned integer or an octal string");e=u(e,8)}return O(e,t),e},validateArray:j,validateStringArray:function(e,t){j(e,t);for(let n=0;n<e.length;n++)P(e[n],`${t}[${n}]`)},validateBooleanArray:function(e,t){j(e,t);for(let n=0;n<e.length;n++)x(e[n],`${t}[${n}]`)},validateBoolean:x,validateBuffer:W,validateDictionary:D,validateEncoding:function(e,t){const n=E(t),r=e.length;if("hex"===n&&r%2!==0)throw new m("encoding",t,`is invalid for data of length ${r}`)},validateFunction:U,validateInt32:N,validateInteger:k,validateNumber:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("number"!==typeof e)throw new _(t,"number",e);if(null!=n&&e<n||null!=r&&e>r||(null!=n||null!=r)&&l(e))throw new v(t,`${null!=n?`>= ${n}`:""}${null!=n&&null!=r?" && ":""}${null!=r?`<= ${r}`:""}`,e)},validateObject:M,validateOneOf:L,validatePlainFunction:F,validatePort:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Port",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("number"!==typeof e&&"string"!==typeof e||"string"===typeof e&&0===g(e).length||+e!==+e>>>0||e>65535||0===e&&!n)throw new w(t,e,n);return 0|e},validateSignalName:function(e){if(P(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"signal"),void 0===T[e]){if(void 0!==T[b(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}},validateString:P,validateUint32:O,validateUndefined:B,validateUnion:function(e,t,n){if(!i(n,e))throw new _(t,`('${o(n,"|")}')`,e)},validateAbortSignal:$,validateLinkHeaderValue:function(e){if("string"===typeof e)return q(e,"hints"),e;if(r(e)){const t=e.length;let n="";if(0===t)return n;for(let r=0;r<t;r++){const i=e[r];q(i,"hints"),n+=i,r!==t-1&&(n+=", ")}return n}throw new m("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},95898:(e,t,n)=>{"use strict";const r=n(51831),i=n(57653),o=r.Readable.destroy;e.exports=r.Readable,e.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,e.exports._isUint8Array=r._isUint8Array,e.exports.isDisturbed=r.isDisturbed,e.exports.isErrored=r.isErrored,e.exports.isReadable=r.isReadable,e.exports.Readable=r.Readable,e.exports.Writable=r.Writable,e.exports.Duplex=r.Duplex,e.exports.Transform=r.Transform,e.exports.PassThrough=r.PassThrough,e.exports.addAbortSignal=r.addAbortSignal,e.exports.finished=r.finished,e.exports.destroy=r.destroy,e.exports.destroy=o,e.exports.pipeline=r.pipeline,e.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=r.Stream,e.exports.default=e.exports},82860:(e,t,n)=>{"use strict";const{format:r,inspect:i,AggregateError:o}=n(40670),a=globalThis.AggregateError||o,s=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],d=/^([A-Z][a-z0-9]*)+$/,c={};function u(e,t){if(!e)throw new c.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function f(e,t,n){n||(n=Error);class i extends n{constructor(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];super(function(e,t,n){if("function"===typeof t)return u(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);const i=(t.match(/%[dfijoOs]/g)||[]).length;return u(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,i))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,
1configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,c[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class b extends Error{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"The operation was aborted",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(void 0!==t&&"object"!==typeof t)throw new c.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",((e,t,n)=>{u("string"===typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let r="The ";e.endsWith(" argument")?r+=`${e} `:r+=`"${e}" ${e.includes(".")?"property":"argument"} `,r+="must be ";const o=[],a=[],s=[];for(const i of t)u("string"===typeof i,"All expected entries have to be of type string"),l.includes(i)?o.push(i.toLowerCase()):d.test(i)?a.push(i):(u("object"!==i,'The value "object" should be written as "Object"'),s.push(i));if(a.length>0){const e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),a.push("Object"))}if(o.length>0){switch(o.length){case 1:r+=`of type ${o[0]}`;break;case 2:r+=`one of type ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();r+=`one of type ${o.join(", ")}, or ${e}`}}(a.length>0||s.length>0)&&(r+=" or ")}if(a.length>0){switch(a.length){case 1:r+=`an instance of ${a[0]}`;break;case 2:r+=`an instance of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();r+=`an instance of ${a.join(", ")}, or ${e}`}}s.length>0&&(r+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(r+="an "),r+=`${s[0]}`;break;case 2:r+=`one of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();r+=`one of ${s.join(", ")}, or ${e}`}}if(null==n)r+=`. Received ${n}`;else if("function"===typeof n&&n.name)r+=`. Received function ${n.name}`;else if("object"===typeof n){var c;if(null!==(c=n.constructor)&&void 0!==c&&c.name)r+=`. Received an instance of ${n.constructor.name}`;else{r+=`. Received ${i(n,{depth:-1})}`}}else{let e=i(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),r+=`. Received type ${typeof n} (${e})`}return r}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid",r=i(t);r.length>128&&(r=r.slice(0,128)+"...");return`The ${e.includes(".")?"property":"argument"} '${e}' ${n}. Received ${r}`}),TypeError),f("ERR_INVALID_RETURN_VALUE",((e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${null!==n&&void 0!==n&&null!==(r=n.constructor)&&void 0!==r&&r.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r;u(t.length>0,"At least one arg needs to be specified");const i=t.length;switch(t=(Array.isArray(t)?t:[t]).map((e=>`"${e}"`)).join(" or "),i){case 1:r+=`The ${t[0]} argument`;break;case 2:r+=`The ${t[0]} and ${t[1]} arguments`;break;default:{const e=t.pop();r+=`The ${t.join(", ")}, and ${e} arguments`}}return`${r} must be specified`}),TypeError),f("ERR_OUT_OF_RANGE",((e,t,n)=>{let r;return u(t,'Missing "range" argument'),Number.isInteger(n)&&Math.abs(n)>2**32?r=h(String(n)):"bigint"===typeof n?(r=String(n),(n>2n**32n||n<-(2n**32n))&&(r=h(r)),r+="n"):r=i(n),`The value of "${e}" is out of range. It must be ${t}. Received ${r}`}),RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:b,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const n=new a([t,e],t.message);return n.code=t.code,n}return e||t})),hideStackFrames:p,codes:c}},96918:e=>{"use strict";e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,n)=>e.slice(t,n),Error:Error,FunctionPrototypeCall(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.call(t,...r)},FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number: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:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,n)=>Object.defineProperty(e,t,n),ObjectGetOwnPropertyDescriptor:(e,t)=>
1Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise:Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,n)=>e.then(t,n),PromiseReject:e=>Promise.reject(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String:String,StringPrototypeSlice:(e,t,n)=>e.slice(t,n),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol:Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet:(e,t,n)=>e.set(t,n),Uint8Array:Uint8Array}},40670:(e,t,n)=>{"use strict";const r=n(19778),i=Object.getPrototypeOf((async function(){})).constructor,o=globalThis.Blob||r.Blob,a="undefined"!==typeof o?function(e){return e instanceof o}:function(e){return!1};class s extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let n=0;n<e.length;n++)t+=` ${e[n].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}},promisify:e=>new Promise(((t,n)=>{e((function(e){if(e)return n(e);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t(...i)}))})),debuglog:()=>function(){},format(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.replace(/%([sdifj])/g,(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];let[i,o]=t;const a=n.shift();if("f"===o)return a.toFixed(6);if("j"===o)return JSON.stringify(a);if("s"===o&&"object"===typeof a){return`${a.constructor!==Object?a.constructor.name:""} {}`.trim()}return a.toString()}))},inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof i,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:a},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},51831:(e,t,n)=>{const{Buffer:r}=n(19778),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:a}=n(96918),{promisify:{custom:s}}=n(40670),{streamReturningOperators:l,promiseReturningOperators:d}=n(40034),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=n(82860),u=n(60089),{pipeline:h}=n(86622),{destroyer:f}=n(2832),p=n(19406),b=n(57653),g=n(84289),y=e.exports=n(91672).Stream;y.isDisturbed=g.isDisturbed,y.isErrored=g.isErrored,y.isReadable=g.isReadable,y.Readable=n(5146);for(const m of o(l)){const v=l[m];function w(){if(new.target)throw c();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.Readable.from(a(v,this,t))}i(w,"name",{__proto__:null,value:v.name}),i(w,"length",{__proto__:null,value:v.length}),i(y.Readable.prototype,m,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(const S of o(d)){const E=d[S];function w(){if(new.target)throw c();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E,this,t)}i(w,"name",{__proto__:null,value:E.name}),i(w,"length",{__proto__:null,value:E.length}),i(y.Readable.prototype,S,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}y.Writable=n(63654),y.Duplex=n(38120),y.Transform=n(96859),y.PassThrough=n(22727),y.pipeline=h;const{addAbortSignal:_}=n(81206);y.addAbortSignal=_,y.finished=p,y.destroy=f,y.compose=u,i(y,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>b}),i(h,s,{__proto__:null,enumerable:!0,get:()=>b.pipeline}),i(p,s,{__proto__:null,enumerable:!0,get:()=>b.finished}),y.Stream=y,y._isUint8Array=function(e){return e instanceof Uint8Array},y._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}},57653:(e,t,n)=>{"use strict";const{ArrayPrototypePop:r,Promise:i}
1=n(96918),{isIterable:o,isNodeStream:a,isWebStream:s}=n(84289),{pipelineImpl:l}=n(86622),{finished:d}=n(19406);n(51831),e.exports={finished:d,pipeline:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new i(((e,n)=>{let i,d;const c=t[t.length-1];if(c&&"object"===typeof c&&!a(c)&&!o(c)&&!s(c)){const e=r(t);i=e.signal,d=e.end}l(t,((t,r)=>{t?n(t):e(r)}),{signal:i,end:d})}))}}},78262:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!==i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}}}]); 2//# sourceMappingURL=346.0efbe337.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.