UNPKG

next

Version:

The React Framework

8 lines • 467 kB
(()=>{var A={7282:A=>{ /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */ A.exports=function isBuffer(A){return A!=null&&A.constructor!=null&&typeof A.constructor.isBuffer==="function"&&A.constructor.isBuffer(A)}},566:A=>{var e=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var __export=(A,t)=>{for(var r in t)e(A,r,{get:t[r],enumerable:true})};var __copyProps=(A,n,o,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let a of r(n))if(!s.call(A,a)&&a!==o)e(A,a,{get:()=>n[a],enumerable:!(i=t(n,a))||i.enumerable})}return A};var __toCommonJS=A=>__copyProps(e({},"__esModule",{value:true}),A);var n={};__export(n,{isNodeProcess:()=>isNodeProcess});A.exports=__toCommonJS(n);function isNodeProcess(){if(typeof navigator!=="undefined"&&navigator.product==="ReactNative"){return true}if(typeof process!=="undefined"){const A=process.type;if(A==="renderer"||A==="worker"){return false}return!!(process.versions&&process.versions.node)}return false}0&&0},3526:A=>{function throttle(A,e){if(typeof A!=="function"){throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof A}\`.`)}let t;let r=0;return function throttled(...s){clearTimeout(t);const n=Date.now();const o=n-r;const i=e-o;if(i<=0){r=n;A.apply(this,s)}else{t=setTimeout((()=>{r=Date.now();A.apply(this,s)}),i)}}}A.exports=throttle},4906:(A,e,t)=>{"use strict";const r=t(979);const s=t(7029);const n=t(9610);const o=t(7475);const i=t(7823);const a=t(826);const c=t(2935);const g=t(5308);const l=t(5933);const Q=t(7662);const{InvalidArgumentError:E}=l;const B=t(3797);const C=t(46);const I=t(6899);const h=t(2527);const u=t(7226);const d=t(2863);const f=t(1450);const{getGlobalDispatcher:p,setGlobalDispatcher:w}=t(8707);const y=t(801);const D=t(1932);const m=t(7958);Object.assign(s.prototype,B);A.exports.Dispatcher=s;A.exports.Client=r;A.exports.Pool=n;A.exports.BalancedPool=o;A.exports.Agent=i;A.exports.ProxyAgent=a;A.exports.EnvHttpProxyAgent=c;A.exports.RetryAgent=g;A.exports.RetryHandler=f;A.exports.DecoratorHandler=y;A.exports.RedirectHandler=D;A.exports.createRedirectInterceptor=m;A.exports.interceptors={redirect:t(3184),retry:t(5904),dump:t(4166),dns:t(4289)};A.exports.buildConnector=C;A.exports.errors=l;A.exports.util={parseHeaders:Q.parseHeaders,headerNameToString:Q.headerNameToString};function makeDispatcher(A){return(e,t,r)=>{if(typeof t==="function"){r=t;t=null}if(!e||typeof e!=="string"&&typeof e!=="object"&&!(e instanceof URL)){throw new E("invalid url")}if(t!=null&&typeof t!=="object"){throw new E("invalid opts")}if(t&&t.path!=null){if(typeof t.path!=="string"){throw new E("invalid opts.path")}let A=t.path;if(!t.path.startsWith("/")){A=`/${A}`}e=new URL(Q.parseOrigin(e).origin+A)}else{if(!t){t=typeof e==="object"?e:{}}e=Q.parseURL(e)}const{agent:s,dispatcher:n=p()}=t;if(s){throw new E("unsupported opts.agent. Did you mean opts.client?")}return A.call(n,{...t,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:t.method||(t.body?"PUT":"GET")},r)}}A.exports.setGlobalDispatcher=w;A.exports.getGlobalDispatcher=p;const R=t(224).fetch;A.exports.fetch=async function fetch(A,e=undefined){try{return await R(A,e)}catch(A){if(A&&typeof A==="object"){Error.captureStackTrace(A)}throw A}};A.exports.Headers=t(8146).Headers;A.exports.Response=t(2873).Response;A.exports.Request=t(557).Request;A.exports.FormData=t(8932).FormData;A.exports.File=globalThis.File??t(4573).File;A.exports.FileReader=t(7669).FileReader;const{setGlobalOrigin:k,getGlobalOrigin:b}=t(777);A.exports.setGlobalOrigin=k;A.exports.getGlobalOrigin=b;const{CacheStorage:F}=t(4215);const{kConstruct:S}=t(7747);A.exports.caches=new F(S);const{deleteCookie:N,getCookies:M,getSetCookies:U,setCookie:L}=t(8659);A.exports.deleteCookie=N;A.exports.getCookies=M;A.exports.getSetCookies=U;A.exports.setCookie=L;const{parseMIMEType:T,serializeAMimeType:Y}=t(8394);A.exports.parseMIMEType=T;A.exports.serializeAMimeType=Y;const{CloseEvent:G,ErrorEvent:H,MessageEvent:v}=t(7690);A.exports.WebSocket=t(7836).WebSocket;A.exports.CloseEvent=G;A.exports.ErrorEvent=H;A.exports.MessageEvent=v;A.exports.request=makeDispatcher(B.request);A.exports.stream=makeDispatcher(B.stream);A.exports.pipeline=makeDispatcher(B.pipeline);A.exports.connect=makeDispatcher(B.connect);A.exports.upgrade=makeDispatcher(B.upgrade);A.exports.MockClient=I;A.exports.MockPool=u;A.exports.MockAgent=h;A.exports.mockErrors=d;const{EventSource:J}=t(3276);A.exports.EventSource=J},6756:(A,e,t)=>{const{addAbortListener:r}=t(7662);const{RequestAbortedError:s}=t(5933);const n=Symbol("kListener");const o=Symbol("kSignal");function abort(A){if(A.abort){A.abort(A[o]?.reason)}else{A.reason=A[o]?.reason??new s}removeSignal(A)}function addSignal(A,e){A.reason=null;A[o]=null;A[n]=null;if(!e){return}if(e.aborted){abort(A);return}A[o]=e;A[n]=()=>{abort(A)};r(A[o],A[n])}function removeSignal(A){if(!A[o]){return}if("removeEventListener"in A[o]){A[o].removeEventListener("abort",A[n])}else{A[o].removeListener("abort",A[n])}A[o]=null;A[n]=null}A.exports={addSignal:addSignal,removeSignal:removeSignal}},7530:(A,e,t)=>{"use strict";const r=t(4589);const{AsyncResource:s}=t(6698);const{InvalidArgumentError:n,SocketError:o}=t(5933);const i=t(7662);const{addSignal:a,removeSignal:c}=t(6756);class ConnectHandler extends s{constructor(A,e){if(!A||typeof A!=="object"){throw new n("invalid opts")}if(typeof e!=="function"){throw new n("invalid callback")}const{signal:t,opaque:r,responseHeaders:s}=A;if(t&&typeof t.on!=="function"&&typeof t.addEventListener!=="function"){throw new n("signal must be an EventEmitter or EventTarget")}super("UNDICI_CONNECT");this.opaque=r||null;this.responseHeaders=s||null;this.callback=e;this.abort=null;a(this,t)}onConnect(A,e){if(this.reason){A(this.reason);return}r(this.callback);this.abort=A;this.context=e}onHeaders(){throw new o("bad connect",null)}onUpgrade(A,e,t){const{callback:r,opaque:s,context:n}=this;c(this);this.callback=null;let o=e;if(o!=null){o=this.responseHeaders==="raw"?i.parseRawHeaders(e):i.parseHeaders(e)}this.runInAsyncScope(r,null,null,{statusCode:A,headers:o,socket:t,opaque:s,context:n})}onError(A){const{callback:e,opaque:t}=this;c(this);if(e){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(e,null,A,{opaque:t})}))}}}function connect(A,e){if(e===undefined){return new Promise(((e,t)=>{connect.call(this,A,((A,r)=>A?t(A):e(r)))}))}try{const t=new ConnectHandler(A,e);this.dispatch({...A,method:"CONNECT"},t)}catch(t){if(typeof e!=="function"){throw t}const r=A?.opaque;queueMicrotask((()=>e(t,{opaque:r})))}}A.exports=connect},8656:(A,e,t)=>{"use strict";const{Readable:r,Duplex:s,PassThrough:n}=t(7075);const{InvalidArgumentError:o,InvalidReturnValueError:i,RequestAbortedError:a}=t(5933);const c=t(7662);const{AsyncResource:g}=t(6698);const{addSignal:l,removeSignal:Q}=t(6756);const E=t(4589);const B=Symbol("resume");class PipelineRequest extends r{constructor(){super({autoDestroy:true});this[B]=null}_read(){const{[B]:A}=this;if(A){this[B]=null;A()}}_destroy(A,e){this._read();e(A)}}class PipelineResponse extends r{constructor(A){super({autoDestroy:true});this[B]=A}_read(){this[B]()}_destroy(A,e){if(!A&&!this._readableState.endEmitted){A=new a}e(A)}}class PipelineHandler extends g{constructor(A,e){if(!A||typeof A!=="object"){throw new o("invalid opts")}if(typeof e!=="function"){throw new o("invalid handler")}const{signal:t,method:r,opaque:n,onInfo:i,responseHeaders:g}=A;if(t&&typeof t.on!=="function"&&typeof t.addEventListener!=="function"){throw new o("signal must be an EventEmitter or EventTarget")}if(r==="CONNECT"){throw new o("invalid method")}if(i&&typeof i!=="function"){throw new o("invalid onInfo callback")}super("UNDICI_PIPELINE");this.opaque=n||null;this.responseHeaders=g||null;this.handler=e;this.abort=null;this.context=null;this.onInfo=i||null;this.req=(new PipelineRequest).on("error",c.nop);this.ret=new s({readableObjectMode:A.objectMode,autoDestroy:true,read:()=>{const{body:A}=this;if(A?.resume){A.resume()}},write:(A,e,t)=>{const{req:r}=this;if(r.push(A,e)||r._readableState.destroyed){t()}else{r[B]=t}},destroy:(A,e)=>{const{body:t,req:r,res:s,ret:n,abort:o}=this;if(!A&&!n._readableState.endEmitted){A=new a}if(o&&A){o()}c.destroy(t,A);c.destroy(r,A);c.destroy(s,A);Q(this);e(A)}}).on("prefinish",(()=>{const{req:A}=this;A.push(null)}));this.res=null;l(this,t)}onConnect(A,e){const{ret:t,res:r}=this;if(this.reason){A(this.reason);return}E(!r,"pipeline cannot be retried");E(!t.destroyed);this.abort=A;this.context=e}onHeaders(A,e,t){const{opaque:r,handler:s,context:n}=this;if(A<200){if(this.onInfo){const t=this.responseHeaders==="raw"?c.parseRawHeaders(e):c.parseHeaders(e);this.onInfo({statusCode:A,headers:t})}return}this.res=new PipelineResponse(t);let o;try{this.handler=null;const t=this.responseHeaders==="raw"?c.parseRawHeaders(e):c.parseHeaders(e);o=this.runInAsyncScope(s,null,{statusCode:A,headers:t,opaque:r,body:this.res,context:n})}catch(A){this.res.on("error",c.nop);throw A}if(!o||typeof o.on!=="function"){throw new i("expected Readable")}o.on("data",(A=>{const{ret:e,body:t}=this;if(!e.push(A)&&t.pause){t.pause()}})).on("error",(A=>{const{ret:e}=this;c.destroy(e,A)})).on("end",(()=>{const{ret:A}=this;A.push(null)})).on("close",(()=>{const{ret:A}=this;if(!A._readableState.ended){c.destroy(A,new a)}}));this.body=o}onData(A){const{res:e}=this;return e.push(A)}onComplete(A){const{res:e}=this;e.push(null)}onError(A){const{ret:e}=this;this.handler=null;c.destroy(e,A)}}function pipeline(A,e){try{const t=new PipelineHandler(A,e);this.dispatch({...A,body:t.req},t);return t.ret}catch(A){return(new n).destroy(A)}}A.exports=pipeline},7157:(A,e,t)=>{"use strict";const r=t(4589);const{Readable:s}=t(2797);const{InvalidArgumentError:n,RequestAbortedError:o}=t(5933);const i=t(7662);const{getResolveErrorBodyCallback:a}=t(3877);const{AsyncResource:c}=t(6698);class RequestHandler extends c{constructor(A,e){if(!A||typeof A!=="object"){throw new n("invalid opts")}const{signal:t,method:r,opaque:s,body:a,onInfo:c,responseHeaders:g,throwOnError:l,highWaterMark:Q}=A;try{if(typeof e!=="function"){throw new n("invalid callback")}if(Q&&(typeof Q!=="number"||Q<0)){throw new n("invalid highWaterMark")}if(t&&typeof t.on!=="function"&&typeof t.addEventListener!=="function"){throw new n("signal must be an EventEmitter or EventTarget")}if(r==="CONNECT"){throw new n("invalid method")}if(c&&typeof c!=="function"){throw new n("invalid onInfo callback")}super("UNDICI_REQUEST")}catch(A){if(i.isStream(a)){i.destroy(a.on("error",i.nop),A)}throw A}this.method=r;this.responseHeaders=g||null;this.opaque=s||null;this.callback=e;this.res=null;this.abort=null;this.body=a;this.trailers={};this.context=null;this.onInfo=c||null;this.throwOnError=l;this.highWaterMark=Q;this.signal=t;this.reason=null;this.removeAbortListener=null;if(i.isStream(a)){a.on("error",(A=>{this.onError(A)}))}if(this.signal){if(this.signal.aborted){this.reason=this.signal.reason??new o}else{this.removeAbortListener=i.addAbortListener(this.signal,(()=>{this.reason=this.signal.reason??new o;if(this.res){i.destroy(this.res.on("error",i.nop),this.reason)}else if(this.abort){this.abort(this.reason)}if(this.removeAbortListener){this.res?.off("close",this.removeAbortListener);this.removeAbortListener();this.removeAbortListener=null}}))}}}onConnect(A,e){if(this.reason){A(this.reason);return}r(this.callback);this.abort=A;this.context=e}onHeaders(A,e,t,r){const{callback:n,opaque:o,abort:c,context:g,responseHeaders:l,highWaterMark:Q}=this;const E=l==="raw"?i.parseRawHeaders(e):i.parseHeaders(e);if(A<200){if(this.onInfo){this.onInfo({statusCode:A,headers:E})}return}const B=l==="raw"?i.parseHeaders(e):E;const C=B["content-type"];const I=B["content-length"];const h=new s({resume:t,abort:c,contentType:C,contentLength:this.method!=="HEAD"&&I?Number(I):null,highWaterMark:Q});if(this.removeAbortListener){h.on("close",this.removeAbortListener)}this.callback=null;this.res=h;if(n!==null){if(this.throwOnError&&A>=400){this.runInAsyncScope(a,null,{callback:n,body:h,contentType:C,statusCode:A,statusMessage:r,headers:E})}else{this.runInAsyncScope(n,null,null,{statusCode:A,headers:E,trailers:this.trailers,opaque:o,body:h,context:g})}}}onData(A){return this.res.push(A)}onComplete(A){i.parseHeaders(A,this.trailers);this.res.push(null)}onError(A){const{res:e,callback:t,body:r,opaque:s}=this;if(t){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(t,null,A,{opaque:s})}))}if(e){this.res=null;queueMicrotask((()=>{i.destroy(e,A)}))}if(r){this.body=null;i.destroy(r,A)}if(this.removeAbortListener){e?.off("close",this.removeAbortListener);this.removeAbortListener();this.removeAbortListener=null}}}function request(A,e){if(e===undefined){return new Promise(((e,t)=>{request.call(this,A,((A,r)=>A?t(A):e(r)))}))}try{this.dispatch(A,new RequestHandler(A,e))}catch(t){if(typeof e!=="function"){throw t}const r=A?.opaque;queueMicrotask((()=>e(t,{opaque:r})))}}A.exports=request;A.exports.RequestHandler=RequestHandler},3718:(A,e,t)=>{"use strict";const r=t(4589);const{finished:s,PassThrough:n}=t(7075);const{InvalidArgumentError:o,InvalidReturnValueError:i}=t(5933);const a=t(7662);const{getResolveErrorBodyCallback:c}=t(3877);const{AsyncResource:g}=t(6698);const{addSignal:l,removeSignal:Q}=t(6756);class StreamHandler extends g{constructor(A,e,t){if(!A||typeof A!=="object"){throw new o("invalid opts")}const{signal:r,method:s,opaque:n,body:i,onInfo:c,responseHeaders:g,throwOnError:Q}=A;try{if(typeof t!=="function"){throw new o("invalid callback")}if(typeof e!=="function"){throw new o("invalid factory")}if(r&&typeof r.on!=="function"&&typeof r.addEventListener!=="function"){throw new o("signal must be an EventEmitter or EventTarget")}if(s==="CONNECT"){throw new o("invalid method")}if(c&&typeof c!=="function"){throw new o("invalid onInfo callback")}super("UNDICI_STREAM")}catch(A){if(a.isStream(i)){a.destroy(i.on("error",a.nop),A)}throw A}this.responseHeaders=g||null;this.opaque=n||null;this.factory=e;this.callback=t;this.res=null;this.abort=null;this.context=null;this.trailers=null;this.body=i;this.onInfo=c||null;this.throwOnError=Q||false;if(a.isStream(i)){i.on("error",(A=>{this.onError(A)}))}l(this,r)}onConnect(A,e){if(this.reason){A(this.reason);return}r(this.callback);this.abort=A;this.context=e}onHeaders(A,e,t,r){const{factory:o,opaque:g,context:l,callback:Q,responseHeaders:E}=this;const B=E==="raw"?a.parseRawHeaders(e):a.parseHeaders(e);if(A<200){if(this.onInfo){this.onInfo({statusCode:A,headers:B})}return}this.factory=null;let C;if(this.throwOnError&&A>=400){const t=E==="raw"?a.parseHeaders(e):B;const s=t["content-type"];C=new n;this.callback=null;this.runInAsyncScope(c,null,{callback:Q,body:C,contentType:s,statusCode:A,statusMessage:r,headers:B})}else{if(o===null){return}C=this.runInAsyncScope(o,null,{statusCode:A,headers:B,opaque:g,context:l});if(!C||typeof C.write!=="function"||typeof C.end!=="function"||typeof C.on!=="function"){throw new i("expected Writable")}s(C,{readable:false},(A=>{const{callback:e,res:t,opaque:r,trailers:s,abort:n}=this;this.res=null;if(A||!t.readable){a.destroy(t,A)}this.callback=null;this.runInAsyncScope(e,null,A||null,{opaque:r,trailers:s});if(A){n()}}))}C.on("drain",t);this.res=C;const I=C.writableNeedDrain!==undefined?C.writableNeedDrain:C._writableState?.needDrain;return I!==true}onData(A){const{res:e}=this;return e?e.write(A):true}onComplete(A){const{res:e}=this;Q(this);if(!e){return}this.trailers=a.parseHeaders(A);e.end()}onError(A){const{res:e,callback:t,opaque:r,body:s}=this;Q(this);this.factory=null;if(e){this.res=null;a.destroy(e,A)}else if(t){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(t,null,A,{opaque:r})}))}if(s){this.body=null;a.destroy(s,A)}}}function stream(A,e,t){if(t===undefined){return new Promise(((t,r)=>{stream.call(this,A,e,((A,e)=>A?r(A):t(e)))}))}try{this.dispatch(A,new StreamHandler(A,e,t))}catch(e){if(typeof t!=="function"){throw e}const r=A?.opaque;queueMicrotask((()=>t(e,{opaque:r})))}}A.exports=stream},9764:(A,e,t)=>{"use strict";const{InvalidArgumentError:r,SocketError:s}=t(5933);const{AsyncResource:n}=t(6698);const o=t(7662);const{addSignal:i,removeSignal:a}=t(6756);const c=t(4589);class UpgradeHandler extends n{constructor(A,e){if(!A||typeof A!=="object"){throw new r("invalid opts")}if(typeof e!=="function"){throw new r("invalid callback")}const{signal:t,opaque:s,responseHeaders:n}=A;if(t&&typeof t.on!=="function"&&typeof t.addEventListener!=="function"){throw new r("signal must be an EventEmitter or EventTarget")}super("UNDICI_UPGRADE");this.responseHeaders=n||null;this.opaque=s||null;this.callback=e;this.abort=null;this.context=null;i(this,t)}onConnect(A,e){if(this.reason){A(this.reason);return}c(this.callback);this.abort=A;this.context=null}onHeaders(){throw new s("bad upgrade",null)}onUpgrade(A,e,t){c(A===101);const{callback:r,opaque:s,context:n}=this;a(this);this.callback=null;const i=this.responseHeaders==="raw"?o.parseRawHeaders(e):o.parseHeaders(e);this.runInAsyncScope(r,null,null,{headers:i,socket:t,opaque:s,context:n})}onError(A){const{callback:e,opaque:t}=this;a(this);if(e){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(e,null,A,{opaque:t})}))}}}function upgrade(A,e){if(e===undefined){return new Promise(((e,t)=>{upgrade.call(this,A,((A,r)=>A?t(A):e(r)))}))}try{const t=new UpgradeHandler(A,e);this.dispatch({...A,method:A.method||"GET",upgrade:A.protocol||"Websocket"},t)}catch(t){if(typeof e!=="function"){throw t}const r=A?.opaque;queueMicrotask((()=>e(t,{opaque:r})))}}A.exports=upgrade},3797:(A,e,t)=>{"use strict";A.exports.request=t(7157);A.exports.stream=t(3718);A.exports.pipeline=t(8656);A.exports.upgrade=t(9764);A.exports.connect=t(7530)},2797:(A,e,t)=>{"use strict";const r=t(4589);const{Readable:s}=t(7075);const{RequestAbortedError:n,NotSupportedError:o,InvalidArgumentError:i,AbortError:a}=t(5933);const c=t(7662);const{ReadableStreamFrom:g}=t(7662);const l=Symbol("kConsume");const Q=Symbol("kReading");const E=Symbol("kBody");const B=Symbol("kAbort");const C=Symbol("kContentType");const I=Symbol("kContentLength");const noop=()=>{};class BodyReadable extends s{constructor({resume:A,abort:e,contentType:t="",contentLength:r,highWaterMark:s=64*1024}){super({autoDestroy:true,read:A,highWaterMark:s});this._readableState.dataEmitted=false;this[B]=e;this[l]=null;this[E]=null;this[C]=t;this[I]=r;this[Q]=false}destroy(A){if(!A&&!this._readableState.endEmitted){A=new n}if(A){this[B]()}return super.destroy(A)}_destroy(A,e){if(!this[Q]){setImmediate((()=>{e(A)}))}else{e(A)}}on(A,...e){if(A==="data"||A==="readable"){this[Q]=true}return super.on(A,...e)}addListener(A,...e){return this.on(A,...e)}off(A,...e){const t=super.off(A,...e);if(A==="data"||A==="readable"){this[Q]=this.listenerCount("data")>0||this.listenerCount("readable")>0}return t}removeListener(A,...e){return this.off(A,...e)}push(A){if(this[l]&&A!==null){consumePush(this[l],A);return this[Q]?super.push(A):true}return super.push(A)}async text(){return consume(this,"text")}async json(){return consume(this,"json")}async blob(){return consume(this,"blob")}async bytes(){return consume(this,"bytes")}async arrayBuffer(){return consume(this,"arrayBuffer")}async formData(){throw new o}get bodyUsed(){return c.isDisturbed(this)}get body(){if(!this[E]){this[E]=g(this);if(this[l]){this[E].getReader();r(this[E].locked)}}return this[E]}async dump(A){let e=Number.isFinite(A?.limit)?A.limit:128*1024;const t=A?.signal;if(t!=null&&(typeof t!=="object"||!("aborted"in t))){throw new i("signal must be an AbortSignal")}t?.throwIfAborted();if(this._readableState.closeEmitted){return null}return await new Promise(((A,r)=>{if(this[I]>e){this.destroy(new a)}const onAbort=()=>{this.destroy(t.reason??new a)};t?.addEventListener("abort",onAbort);this.on("close",(function(){t?.removeEventListener("abort",onAbort);if(t?.aborted){r(t.reason??new a)}else{A(null)}})).on("error",noop).on("data",(function(A){e-=A.length;if(e<=0){this.destroy()}})).resume()}))}}function isLocked(A){return A[E]&&A[E].locked===true||A[l]}function isUnusable(A){return c.isDisturbed(A)||isLocked(A)}async function consume(A,e){r(!A[l]);return new Promise(((t,r)=>{if(isUnusable(A)){const e=A._readableState;if(e.destroyed&&e.closeEmitted===false){A.on("error",(A=>{r(A)})).on("close",(()=>{r(new TypeError("unusable"))}))}else{r(e.errored??new TypeError("unusable"))}}else{queueMicrotask((()=>{A[l]={type:e,stream:A,resolve:t,reject:r,length:0,body:[]};A.on("error",(function(A){consumeFinish(this[l],A)})).on("close",(function(){if(this[l].body!==null){consumeFinish(this[l],new n)}}));consumeStart(A[l])}))}}))}function consumeStart(A){if(A.body===null){return}const{_readableState:e}=A.stream;if(e.bufferIndex){const t=e.bufferIndex;const r=e.buffer.length;for(let s=t;s<r;s++){consumePush(A,e.buffer[s])}}else{for(const t of e.buffer){consumePush(A,t)}}if(e.endEmitted){consumeEnd(this[l])}else{A.stream.on("end",(function(){consumeEnd(this[l])}))}A.stream.resume();while(A.stream.read()!=null){}}function chunksDecode(A,e){if(A.length===0||e===0){return""}const t=A.length===1?A[0]:Buffer.concat(A,e);const r=t.length;const s=r>2&&t[0]===239&&t[1]===187&&t[2]===191?3:0;return t.utf8Slice(s,r)}function chunksConcat(A,e){if(A.length===0||e===0){return new Uint8Array(0)}if(A.length===1){return new Uint8Array(A[0])}const t=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer);let r=0;for(let e=0;e<A.length;++e){const s=A[e];t.set(s,r);r+=s.length}return t}function consumeEnd(A){const{type:e,body:t,resolve:r,stream:s,length:n}=A;try{if(e==="text"){r(chunksDecode(t,n))}else if(e==="json"){r(JSON.parse(chunksDecode(t,n)))}else if(e==="arrayBuffer"){r(chunksConcat(t,n).buffer)}else if(e==="blob"){r(new Blob(t,{type:s[C]}))}else if(e==="bytes"){r(chunksConcat(t,n))}consumeFinish(A)}catch(A){s.destroy(A)}}function consumePush(A,e){A.length+=e.length;A.body.push(e)}function consumeFinish(A,e){if(A.body===null){return}if(e){A.reject(e)}else{A.resolve()}A.type=null;A.stream=null;A.resolve=null;A.reject=null;A.length=0;A.body=null}A.exports={Readable:BodyReadable,chunksDecode:chunksDecode}},3877:(A,e,t)=>{const r=t(4589);const{ResponseStatusCodeError:s}=t(5933);const{chunksDecode:n}=t(2797);const o=128*1024;async function getResolveErrorBodyCallback({callback:A,body:e,contentType:t,statusCode:i,statusMessage:a,headers:c}){r(e);let g=[];let l=0;try{for await(const A of e){g.push(A);l+=A.length;if(l>o){g=[];l=0;break}}}catch{g=[];l=0}const Q=`Response status code ${i}${a?`: ${a}`:""}`;if(i===204||!t||!l){queueMicrotask((()=>A(new s(Q,i,c))));return}const E=Error.stackTraceLimit;Error.stackTraceLimit=0;let B;try{if(isContentTypeApplicationJson(t)){B=JSON.parse(n(g,l))}else if(isContentTypeText(t)){B=n(g,l)}}catch{}finally{Error.stackTraceLimit=E}queueMicrotask((()=>A(new s(Q,i,c,B))))}const isContentTypeApplicationJson=A=>A.length>15&&A[11]==="/"&&A[0]==="a"&&A[1]==="p"&&A[2]==="p"&&A[3]==="l"&&A[4]==="i"&&A[5]==="c"&&A[6]==="a"&&A[7]==="t"&&A[8]==="i"&&A[9]==="o"&&A[10]==="n"&&A[12]==="j"&&A[13]==="s"&&A[14]==="o"&&A[15]==="n";const isContentTypeText=A=>A.length>4&&A[4]==="/"&&A[0]==="t"&&A[1]==="e"&&A[2]==="x"&&A[3]==="t";A.exports={getResolveErrorBodyCallback:getResolveErrorBodyCallback,isContentTypeApplicationJson:isContentTypeApplicationJson,isContentTypeText:isContentTypeText}},46:(A,e,t)=>{"use strict";const r=t(7030);const s=t(4589);const n=t(7662);const{InvalidArgumentError:o,ConnectTimeoutError:i}=t(5933);const a=t(7797);function noop(){}let c;let g;if(global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)){g=class WeakSessionCache{constructor(A){this._maxCachedSessions=A;this._sessionCache=new Map;this._sessionRegistry=new global.FinalizationRegistry((A=>{if(this._sessionCache.size<this._maxCachedSessions){return}const e=this._sessionCache.get(A);if(e!==undefined&&e.deref()===undefined){this._sessionCache.delete(A)}}))}get(A){const e=this._sessionCache.get(A);return e?e.deref():null}set(A,e){if(this._maxCachedSessions===0){return}this._sessionCache.set(A,new WeakRef(e));this._sessionRegistry.register(e,A)}}}else{g=class SimpleSessionCache{constructor(A){this._maxCachedSessions=A;this._sessionCache=new Map}get(A){return this._sessionCache.get(A)}set(A,e){if(this._maxCachedSessions===0){return}if(this._sessionCache.size>=this._maxCachedSessions){const{value:A}=this._sessionCache.keys().next();this._sessionCache.delete(A)}this._sessionCache.set(A,e)}}}function buildConnector({allowH2:A,maxCachedSessions:e,socketPath:i,timeout:a,session:Q,...E}){if(e!=null&&(!Number.isInteger(e)||e<0)){throw new o("maxCachedSessions must be a positive integer or zero")}const B={path:i,...E};const C=new g(e==null?100:e);a=a==null?1e4:a;A=A!=null?A:false;return function connect({hostname:e,host:o,protocol:i,port:g,servername:E,localAddress:I,httpSocket:h},u){let d;if(i==="https:"){if(!c){c=t(1692)}E=E||B.servername||n.getServerName(o)||null;const r=E||e;s(r);const i=Q||C.get(r)||null;g=g||443;d=c.connect({highWaterMark:16384,...B,servername:E,session:i,localAddress:I,ALPNProtocols:A?["http/1.1","h2"]:["http/1.1"],socket:h,port:g,host:e});d.on("session",(function(A){C.set(r,A)}))}else{s(!h,"httpSocket can only be sent on TLS update");g=g||80;d=r.connect({highWaterMark:64*1024,...B,localAddress:I,port:g,host:e})}if(B.keepAlive==null||B.keepAlive){const A=B.keepAliveInitialDelay===undefined?6e4:B.keepAliveInitialDelay;d.setKeepAlive(true,A)}const f=l(new WeakRef(d),{timeout:a,hostname:e,port:g});d.setNoDelay(true).once(i==="https:"?"secureConnect":"connect",(function(){queueMicrotask(f);if(u){const A=u;u=null;A(null,this)}})).on("error",(function(A){queueMicrotask(f);if(u){const e=u;u=null;e(A)}}));return d}}const l=process.platform==="win32"?(A,e)=>{if(!e.timeout){return noop}let t=null;let r=null;const s=a.setFastTimeout((()=>{t=setImmediate((()=>{r=setImmediate((()=>onConnectTimeout(A.deref(),e)))}))}),e.timeout);return()=>{a.clearFastTimeout(s);clearImmediate(t);clearImmediate(r)}}:(A,e)=>{if(!e.timeout){return noop}let t=null;const r=a.setFastTimeout((()=>{t=setImmediate((()=>{onConnectTimeout(A.deref(),e)}))}),e.timeout);return()=>{a.clearFastTimeout(r);clearImmediate(t)}};function onConnectTimeout(A,e){if(A==null){return}let t="Connect Timeout Error";if(Array.isArray(A.autoSelectFamilyAttemptedAddresses)){t+=` (attempted addresses: ${A.autoSelectFamilyAttemptedAddresses.join(", ")},`}else{t+=` (attempted address: ${e.hostname}:${e.port},`}t+=` timeout: ${e.timeout}ms)`;n.destroy(A,new i(t))}A.exports=buildConnector},7313:A=>{"use strict";const e={};const t=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let A=0;A<t.length;++A){const r=t[A];const s=r.toLowerCase();e[r]=e[s]=s}Object.setPrototypeOf(e,null);A.exports={wellknownHeaderNames:t,headerNameLowerCasedRecord:e}},8560:(A,e,t)=>{"use strict";const r=t(3053);const s=t(7975);const n=s.debuglog("undici");const o=s.debuglog("fetch");const i=s.debuglog("websocket");let a=false;const c={beforeConnect:r.channel("undici:client:beforeConnect"),connected:r.channel("undici:client:connected"),connectError:r.channel("undici:client:connectError"),sendHeaders:r.channel("undici:client:sendHeaders"),create:r.channel("undici:request:create"),bodySent:r.channel("undici:request:bodySent"),headers:r.channel("undici:request:headers"),trailers:r.channel("undici:request:trailers"),error:r.channel("undici:request:error"),open:r.channel("undici:websocket:open"),close:r.channel("undici:websocket:close"),socketError:r.channel("undici:websocket:socket_error"),ping:r.channel("undici:websocket:ping"),pong:r.channel("undici:websocket:pong")};if(n.enabled||o.enabled){const A=o.enabled?o:n;r.channel("undici:client:beforeConnect").subscribe((e=>{const{connectParams:{version:t,protocol:r,port:s,host:n}}=e;A("connecting to %s using %s%s",`${n}${s?`:${s}`:""}`,r,t)}));r.channel("undici:client:connected").subscribe((e=>{const{connectParams:{version:t,protocol:r,port:s,host:n}}=e;A("connected to %s using %s%s",`${n}${s?`:${s}`:""}`,r,t)}));r.channel("undici:client:connectError").subscribe((e=>{const{connectParams:{version:t,protocol:r,port:s,host:n},error:o}=e;A("connection to %s using %s%s errored - %s",`${n}${s?`:${s}`:""}`,r,t,o.message)}));r.channel("undici:client:sendHeaders").subscribe((e=>{const{request:{method:t,path:r,origin:s}}=e;A("sending request to %s %s/%s",t,s,r)}));r.channel("undici:request:headers").subscribe((e=>{const{request:{method:t,path:r,origin:s},response:{statusCode:n}}=e;A("received response to %s %s/%s - HTTP %d",t,s,r,n)}));r.channel("undici:request:trailers").subscribe((e=>{const{request:{method:t,path:r,origin:s}}=e;A("trailers received from %s %s/%s",t,s,r)}));r.channel("undici:request:error").subscribe((e=>{const{request:{method:t,path:r,origin:s},error:n}=e;A("request to %s %s/%s errored - %s",t,s,r,n.message)}));a=true}if(i.enabled){if(!a){const A=n.enabled?n:i;r.channel("undici:client:beforeConnect").subscribe((e=>{const{connectParams:{version:t,protocol:r,port:s,host:n}}=e;A("connecting to %s%s using %s%s",n,s?`:${s}`:"",r,t)}));r.channel("undici:client:connected").subscribe((e=>{const{connectParams:{version:t,protocol:r,port:s,host:n}}=e;A("connected to %s%s using %s%s",n,s?`:${s}`:"",r,t)}));r.channel("undici:client:connectError").subscribe((e=>{const{connectParams:{version:t,protocol:r,port:s,host:n},error:o}=e;A("connection to %s%s using %s%s errored - %s",n,s?`:${s}`:"",r,t,o.message)}));r.channel("undici:client:sendHeaders").subscribe((e=>{const{request:{method:t,path:r,origin:s}}=e;A("sending request to %s %s/%s",t,s,r)}))}r.channel("undici:websocket:open").subscribe((A=>{const{address:{address:e,port:t}}=A;i("connection opened %s%s",e,t?`:${t}`:"")}));r.channel("undici:websocket:close").subscribe((A=>{const{websocket:e,code:t,reason:r}=A;i("closed connection to %s - %s %s",e.url,t,r)}));r.channel("undici:websocket:socket_error").subscribe((A=>{i("connection errored - %s",A.message)}));r.channel("undici:websocket:ping").subscribe((A=>{i("ping received")}));r.channel("undici:websocket:pong").subscribe((A=>{i("pong received")}))}A.exports={channels:c}},5933:A=>{"use strict";const e=Symbol.for("undici.error.UND_ERR");class UndiciError extends Error{constructor(A){super(A);this.name="UndiciError";this.code="UND_ERR"}static[Symbol.hasInstance](A){return A&&A[e]===true}[e]=true}const t=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT");class ConnectTimeoutError extends UndiciError{constructor(A){super(A);this.name="ConnectTimeoutError";this.message=A||"Connect Timeout Error";this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](A){return A&&A[t]===true}[t]=true}const r=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT");class HeadersTimeoutError extends UndiciError{constructor(A){super(A);this.name="HeadersTimeoutError";this.message=A||"Headers Timeout Error";this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](A){return A&&A[r]===true}[r]=true}const s=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW");class HeadersOverflowError extends UndiciError{constructor(A){super(A);this.name="HeadersOverflowError";this.message=A||"Headers Overflow Error";this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](A){return A&&A[s]===true}[s]=true}const n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT");class BodyTimeoutError extends UndiciError{constructor(A){super(A);this.name="BodyTimeoutError";this.message=A||"Body Timeout Error";this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](A){return A&&A[n]===true}[n]=true}const o=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE");class ResponseStatusCodeError extends UndiciError{constructor(A,e,t,r){super(A);this.name="ResponseStatusCodeError";this.message=A||"Response Status Code Error";this.code="UND_ERR_RESPONSE_STATUS_CODE";this.body=r;this.status=e;this.statusCode=e;this.headers=t}static[Symbol.hasInstance](A){return A&&A[o]===true}[o]=true}const i=Symbol.for("undici.error.UND_ERR_INVALID_ARG");class InvalidArgumentError extends UndiciError{constructor(A){super(A);this.name="InvalidArgumentError";this.message=A||"Invalid Argument Error";this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](A){return A&&A[i]===true}[i]=true}const a=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE");class InvalidReturnValueError extends UndiciError{constructor(A){super(A);this.name="InvalidReturnValueError";this.message=A||"Invalid Return Value Error";this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](A){return A&&A[a]===true}[a]=true}const c=Symbol.for("undici.error.UND_ERR_ABORT");class AbortError extends UndiciError{constructor(A){super(A);this.name="AbortError";this.message=A||"The operation was aborted";this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](A){return A&&A[c]===true}[c]=true}const g=Symbol.for("undici.error.UND_ERR_ABORTED");class RequestAbortedError extends AbortError{constructor(A){super(A);this.name="AbortError";this.message=A||"Request aborted";this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](A){return A&&A[g]===true}[g]=true}const l=Symbol.for("undici.error.UND_ERR_INFO");class InformationalError extends UndiciError{constructor(A){super(A);this.name="InformationalError";this.message=A||"Request information";this.code="UND_ERR_INFO"}static[Symbol.hasInstance](A){return A&&A[l]===true}[l]=true}const Q=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH");class RequestContentLengthMismatchError extends UndiciError{constructor(A){super(A);this.name="RequestContentLengthMismatchError";this.message=A||"Request body length does not match content-length header";this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](A){return A&&A[Q]===true}[Q]=true}const E=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH");class ResponseContentLengthMismatchError extends UndiciError{constructor(A){super(A);this.name="ResponseContentLengthMismatchError";this.message=A||"Response body length does not match content-length header";this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](A){return A&&A[E]===true}[E]=true}const B=Symbol.for("undici.error.UND_ERR_DESTROYED");class ClientDestroyedError extends UndiciError{constructor(A){super(A);this.name="ClientDestroyedError";this.message=A||"The client is destroyed";this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](A){return A&&A[B]===true}[B]=true}const C=Symbol.for("undici.error.UND_ERR_CLOSED");class ClientClosedError extends UndiciError{constructor(A){super(A);this.name="ClientClosedError";this.message=A||"The client is closed";this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](A){return A&&A[C]===true}[C]=true}const I=Symbol.for("undici.error.UND_ERR_SOCKET");class SocketError extends UndiciError{constructor(A,e){super(A);this.name="SocketError";this.message=A||"Socket error";this.code="UND_ERR_SOCKET";this.socket=e}static[Symbol.hasInstance](A){return A&&A[I]===true}[I]=true}const h=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED");class NotSupportedError extends UndiciError{constructor(A){super(A);this.name="NotSupportedError";this.message=A||"Not supported error";this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](A){return A&&A[h]===true}[h]=true}const u=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM");class BalancedPoolMissingUpstreamError extends UndiciError{constructor(A){super(A);this.name="MissingUpstreamError";this.message=A||"No upstream has been added to the BalancedPool";this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](A){return A&&A[u]===true}[u]=true}const d=Symbol.for("undici.error.UND_ERR_HTTP_PARSER");class HTTPParserError extends Error{constructor(A,e,t){super(A);this.name="HTTPParserError";this.code=e?`HPE_${e}`:undefined;this.data=t?t.toString():undefined}static[Symbol.hasInstance](A){return A&&A[d]===true}[d]=true}const f=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");class ResponseExceededMaxSizeError extends UndiciError{constructor(A){super(A);this.name="ResponseExceededMaxSizeError";this.message=A||"Response content exceeded max size";this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](A){return A&&A[f]===true}[f]=true}const p=Symbol.for("undici.error.UND_ERR_REQ_RETRY");class RequestRetryError extends UndiciError{constructor(A,e,{headers:t,data:r}){super(A);this.name="RequestRetryError";this.message=A||"Request retry error";this.code="UND_ERR_REQ_RETRY";this.statusCode=e;this.data=r;this.headers=t}static[Symbol.hasInstance](A){return A&&A[p]===true}[p]=true}const w=Symbol.for("undici.error.UND_ERR_RESPONSE");class ResponseError extends UndiciError{constructor(A,e,{headers:t,data:r}){super(A);this.name="ResponseError";this.message=A||"Response error";this.code="UND_ERR_RESPONSE";this.statusCode=e;this.data=r;this.headers=t}static[Symbol.hasInstance](A){return A&&A[w]===true}[w]=true}const y=Symbol.for("undici.error.UND_ERR_PRX_TLS");class SecureProxyConnectionError extends UndiciError{constructor(A,e,t){super(e,{cause:A,...t??{}});this.name="SecureProxyConnectionError";this.message=e||"Secure Proxy Connection failed";this.code="UND_ERR_PRX_TLS";this.cause=A}static[Symbol.hasInstance](A){return A&&A[y]===true}[y]=true}const D=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED");class MessageSizeExceededError extends UndiciError{constructor(A){super(A);this.name="MessageSizeExceededError";this.message=A||"Max decompressed message size exceeded";this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](A){return A&&A[D]===true}get[D](){return true}}A.exports={AbortError:AbortError,HTTPParserError:HTTPParserError,UndiciError:UndiciError,HeadersTimeoutError:HeadersTimeoutError,HeadersOverflowError:HeadersOverflowError,BodyTimeoutError:BodyTimeoutError,RequestContentLengthMismatchError:RequestContentLengthMismatchError,ConnectTimeoutError:ConnectTimeoutError,ResponseStatusCodeError:ResponseStatusCodeError,InvalidArgumentError:InvalidArgumentError,InvalidReturnValueError:InvalidReturnValueError,RequestAbortedError:RequestAbortedError,ClientDestroyedError:ClientDestroyedError,ClientClosedError:ClientClosedError,InformationalError:InformationalError,SocketError:SocketError,NotSupportedError:NotSupportedError,ResponseContentLengthMismatchError:ResponseContentLengthMismatchError,BalancedPoolMissingUpstreamError:BalancedPoolMissingUpstreamError,ResponseExceededMaxSizeError:ResponseExceededMaxSizeError,RequestRetryError:RequestRetryError,ResponseError:ResponseError,SecureProxyConnectionError:SecureProxyConnectionError,MessageSizeExceededError:MessageSizeExceededError}},9441:(A,e,t)=>{"use strict";const{InvalidArgumentError:r,NotSupportedError:s}=t(5933);const n=t(4589);const{isValidHTTPToken:o,isValidHeaderValue:i,isStream:a,destroy:c,isBuffer:g,isFormDataLike:l,isIterable:Q,isBlobLike:E,buildURL:B,validateHandler:C,getServerName:I,normalizedMethodRecords:h}=t(7662);const{channels:u}=t(8560);const{headerNameLowerCasedRecord:d}=t(7313);const f=/[^\u0021-\u00ff]/;const p=Symbol("handler");class Request{constructor(A,{path:e,method:t,body:s,headers:n,query:d,idempotent:w,blocking:y,upgrade:D,headersTimeout:m,bodyTimeout:R,reset:k,throwOnError:b,expectContinue:F,servername:S},N){if(typeof e!=="string"){throw new r("path must be a string")}else if(e[0]!=="/"&&!(e.startsWith("http://")||e.startsWith("https://"))&&t!=="CONNECT"){throw new r("path must be an absolute URL or start with a slash")}else if(f.test(e)){throw new r("invalid request path")}if(typeof t!=="string"){throw new r("method must be a string")}else if(h[t]===undefined&&!o(t)){throw new r("invalid request method")}if(D&&typeof D!=="string"){throw new r("upgrade must be a string")}if(D&&!i(D)){throw new r("invalid upgrade header")}if(m!=null&&(!Number.isFinite(m)||m<0)){throw new r("invalid headersTimeout")}if(R!=null&&(!Number.isFinite(R)||R<0)){throw new r("invalid bodyTimeout")}if(k!=null&&typeof k!=="boolean"){throw new r("invalid reset")}if(F!=null&&typeof F!=="boolean"){throw new r("invalid expectContinue")}this.headersTimeout=m;this.bodyTimeout=R;this.throwOnError=b===true;this.method=t;this.abort=null;if(s==null){this.body=null}else if(a(s)){this.body=s;const A=this.body._readableState;if(!A||!A.autoDestroy){this.endHandler=function autoDestroy(){c(this)};this.body.on("end",this.endHandler)}this.errorHandler=A=>{if(this.abort){this.abort(A)}else{this.error=A}};this.body.on("error",this.errorHandler)}else if(g(s)){this.body=s.byteLength?s:null}else if(ArrayBuffer.isView(s)){this.body=s.buffer.byteLength?Buffer.from(s.buffer,s.byteOffset,s.byteLength):null}else if(s instanceof ArrayBuffer){this.body=s.byteLength?Buffer.from(s):null}else if(typeof s==="string"){this.body=s.length?Buffer.from(s):null}else if(l(s)||Q(s)||E(s)){this.body=s}else{throw new r("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable")}this.completed=false;this.aborted=false;this.upgrade=D||null;this.path=d?B(e,d):e;this.origin=A;this.idempotent=w==null?t==="HEAD"||t==="GET":w;this.blocking=y==null?false:y;this.reset=k==null?null:k;this.host=null;this.contentLength=null;this.contentType=null;this.headers=[];this.expectContinue=F!=null?F:false;if(Array.isArray(n)){if(n.length%2!==0){throw new r("headers array must be even")}for(let A=0;A<n.length;A+=2){processHeader(this,n[A],n[A+1])}}else if(n&&typeof n==="object"){if(n[Symbol.iterator]){for(const A of n){if(!Array.isArray(A)||A.length!==2){throw new r("headers must be in key-value pair format")}processHeader(this,A[0],A[1])}}else{const A=Object.keys(n);for(let e=0;e<A.length;++e){processHeader(this,A[e],n[A[e]])}}}else if(n!=null){throw new r("headers must be an object or an array")}C(N,t,D);this.servername=S||I(this.host);this[p]=N;if(u.create.hasSubscribers){u.create.publish({request:this})}}onBodySent(A){if(this[p].onBodySent){try{return this[p].onBodySent(A)}catch(A){this.abort(A)}}}onRequestSent(){if(u.bodySent.hasSubscribers){u.bodySent.publish({request:this})}if(this[p].onRequestSent){try{return this[p].onRequestSent()}catch(A){this.abort(A)}}}onConnect(A){n(!this.aborted);n(!this.completed);if(this.error){A(this.error)}else{this.abort=A;return this[p].onConnect(A)}}onResponseStarted(){return this[p].onResponseStarted?.()}onHeaders(A,e,t,r){n(!this.aborted);n(!this.completed);if(u.headers.hasSubscribers){u.headers.publish({request:this,response:{statusCode:A,headers:e,statusText:r}})}try{return this[p].onHeaders(A,e,t,r)}catch(A){this.abort(A)}}onData(A){n(!this.aborted);n(!this.completed);try{return this[p].onData(A)}catch(A){this.abort(A);return false}}onUpgrade(A,e,t){n(!this.aborted);n(!this.completed);return this[p].onUpgrade(A,e,t)}onComplete(A){this.onFinally();n(!this.aborted);this.completed=true;if(u.trailers.hasSubscribers){u.trailers.publish({request:this,trailers:A})}try{return this[p].onComplete(A)}catch(A){this.onError(A)}}onError(A){this.onFinally();if(u.error.hasSubscribers){u.error.publish({request:this,error:A})}if(this.aborted){return}this.aborted=true;return this[p].onError(A)}onFinally(){if(this.errorHandler){this.body.off("error",this.errorHandler);this.errorHandler=null}if(this.endHandler){this.body.off("end",this.endHandler);this.endHandler=null}}addHeader(A,e){processHeader(this,A,e);return this}}function processHeader(A,e,t){if(t&&(typeof t==="object"&&!Array.isArray(t))){throw new r(`invalid ${e} header`)}else if(t===undefined){return}let n=d[e];if(n===undefined){n=e.toLowerCase();if(d[n]===undefined&&!o(n)){throw new r("invalid header key")}}if(Array.isArray(t)){const A=[];for(let s=0;s<t.length;s++){if(typeof t[s]==="string"){if(!i(t[s])){throw new r(`invalid ${e} header`)}A.push(t[s])}else if(t[s]===null){A.push("")}else if(typeof t[s]==="object"){throw new r(`invalid ${e} header`)}else{A.push(`${t[s]}`)}}t=A}else if(typeof t==="string"){if(!i(t)){throw new r(`invalid ${e} header`)}}else if(t===null){t=""}else{t=`${t}`}if(n==="host"){if(A.host!==null){throw new r("duplicate host header")}if(typeof t!=="string"){throw new r("invalid host header")}A.host=t}else if(n==="content-length"){if(A.contentLength!==null){throw new r("duplicate content-length header")}A.contentLength=parseInt(t,10);if(!Number.isFinite(A.contentLength)){throw new r("invalid content-length header")}}else if(A.contentType===null&&n==="content-type"){A.contentType=t;A.headers.push(e,t)}else if(n==="transfer-encoding"||n==="keep-alive"||n==="upgrade"){throw new r(`invalid ${n} header`)}else if(n==="connection"){const e=typeof t==="string"?t.toLowerCase():null;if(e!=="close"&&e!=="keep-alive"){throw new r("invalid connection header")}if(e==="close"){A.reset=true}}else if(n==="expect"){throw new s("expect header not supported")}else{A.headers.push(e,t)}}A.exports=Request},3373:A=>{A.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}},6338:(A,e,t)=>{"use strict";const{wellknownHeaderNames:r,headerNameLowerCasedRecord:s}=t(7313);class TstNode{value=null;left=null;middle=null;right=null;code;constructor(A,e,t){if(t===undefined||t>=A.length){throw new TypeError("Unreachable")}const r=this.code=A.charCodeAt(t);if(r>127){throw new TypeError("key must be ascii string")}if(A.length!==++t){this.middle=new TstNode(A,e,t)}else{this.value=e}}add(A,e){const t=A.length;if(t===0){throw new TypeError("Unreachable")}let r=0;let s=this;while(true){const n=A.charCodeAt(r);if(n>127){throw new TypeError("key must be ascii string")}if(s.code===n){if(t===++r){s.value=e;break}else if(s.middle!==null){s=s.middle}else{s.middle=new TstNode(A,e,r);break}}else if(s.code<n){if(s.left!==null){s=s.left}else{s.left=new TstNode(A,e,r);break}}else if(s.right!==null){s=s.right}else{s.right=new TstNode(A,e,r);break}}}search(A){const e=A.length;let t=0;let r=this;while(r!==null&&t<e){let s=A[t];if(s<=90&&s>=65){s|=32}while(r!==null){if(s===r.code){if(e===++t){return r}r=r.middle;break}r=r.code<s?r.left:r.right}}return null}}class TernarySearchTree{node=null;insert(A,e){if(this.node===null){this.node=new TstNode(A,e,0)}else{this.node.add(A,e)}}lookup(A){return this.node?.sear