diff --git a/dist/setup/index.js b/dist/setup/index.js index bf7ecb5..9d04288 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -198,7 +198,7 @@ ${r.count} ${r.noun} ${r.is} pending: ${e.format(t)} `.trim())}};gle.exports=EF});var Ile=E((VoA,Ble)=>{"use strict";var{kProxy:kze,kClose:Fze,kDestroy:Lze,kInterceptors:Uze}=lt(),{URL:Ele}=require("url"),Cle=Rm(),Mze=vh(),Tze=hm(),{InvalidArgumentError:km,RequestAbortedError:Oze}=WA(),Qle=Em(),vm=Symbol("proxy agent"),Ww=Symbol("proxy client"),zw=Symbol("proxy headers"),CF=Symbol("request tls settings"),Yze=Symbol("proxy tls settings"),mle=Symbol("connect endpoint function");function qze(A){return A==="https:"?443:80}function Pze(A){if(typeof A=="string"&&(A={uri:A}),!A||!A.uri)throw new km("Proxy opts.uri is mandatory");return{uri:A.uri,protocol:A.protocol||"https"}}function Hze(A,e){return new Mze(A,e)}var QF=class extends Tze{constructor(e){if(super(e),this[kze]=Pze(e),this[vm]=new Cle(e),this[Uze]=e.interceptors&&e.interceptors.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new km("Proxy opts.uri is mandatory");let{clientFactory:t=Hze}=e;if(typeof t!="function")throw new km("Proxy opts.clientFactory must be a function.");if(this[CF]=e.requestTls,this[Yze]=e.proxyTls,this[zw]=e.headers||{},e.auth&&e.token)throw new km("opts.auth cannot be used in combination with opts.token");e.auth?this[zw]["proxy-authorization"]=`Basic ${e.auth}`:e.token&&(this[zw]["proxy-authorization"]=e.token);let r=new Ele(e.uri),{origin:i,port:s,host:n}=r,a=Qle({...e.proxyTls});this[mle]=Qle({...e.requestTls}),this[Ww]=t(r,{connect:a}),this[vm]=new Cle({...e,connect:async(o,c)=>{let l=o.host;o.port||(l+=`:${qze(o.protocol)}`);try{let{socket:d,statusCode:p}=await this[Ww].connect({origin:i,port:s,path:l,signal:o.signal,headers:{...this[zw],host:n}});if(p!==200&&(d.on("error",()=>{}).destroy(),c(new Oze("Proxy response !== 200 when HTTP Tunneling"))),o.protocol!=="https:"){c(null,d);return}let u;this[CF]?u=this[CF].servername:u=o.servername,this[mle]({...o,servername:u,httpSocket:d},c)}catch(d){c(d)}}})}dispatch(e,t){let{host:r}=new Ele(e.origin),i=Gze(e.headers);return _ze(i),this[vm].dispatch({...e,headers:{...i,host:r}},t)}async[Fze](){await this[vm].close(),await this[Ww].close()}async[Lze](){await this[vm].destroy(),await this[Ww].destroy()}};function Gze(A){if(Array.isArray(A)){let e={};for(let t=0;tt.toLowerCase()==="proxy-authorization"))throw new km("Proxy-Authorization should be sent in ProxyAgent constructor")}Ble.exports=QF});var Ph=E((WoA,ble)=>{"use strict";var fle=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Jze}=WA(),Vze=Rm();wle()===void 0&&yle(new Vze);function yle(A){if(!A||typeof A.dispatch!="function")throw new Jze("Argument agent must implement Agent");Object.defineProperty(globalThis,fle,{value:A,writable:!0,enumerable:!1,configurable:!1})}function wle(){return globalThis[fle]}ble.exports={setGlobalDispatcher:yle,getGlobalDispatcher:wle}});var Dle=E((joA,Nle)=>{"use strict";Nle.exports=class{constructor(e){this.handler=e}onConnect(...e){return this.handler.onConnect(...e)}onError(...e){return this.handler.onError(...e)}onUpgrade(...e){return this.handler.onUpgrade(...e)}onHeaders(...e){return this.handler.onHeaders(...e)}onData(...e){return this.handler.onData(...e)}onComplete(...e){return this.handler.onComplete(...e)}onBodySent(...e){return this.handler.onBodySent(...e)}}});var up=E((XoA,vle)=>{"use strict";var{kHeadersList:es}=lt(),{kGuard:pp}=Xo(),{kEnumerableProperty:Xa}=aA(),{makeIterator:mF,isValidHeaderName:Fm,isValidHeaderValue:Rle}=In(),{webidl:Ve}=fi(),Wze=require("assert"),As=Symbol("headers map"),ts=Symbol("headers map sorted");function xle(A){let e=A.length;for(;/[\r\n\t ]/.test(A.charAt(--e)););return A.slice(0,e+1).replace(/^[\r\n\t ]+/,"")}function Sle(A,e){if(Array.isArray(e))for(let t of e){if(t.length!==2)throw Ve.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${t.length}.`});A.append(t[0],t[1])}else if(typeof e=="object"&&e!==null)for(let[t,r]of Object.entries(e))A.append(t,r);else throw Ve.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})}var jw=class A{cookies=null;constructor(e){e instanceof A?(this[As]=new Map(e[As]),this[ts]=e[ts],this.cookies=e.cookies):(this[As]=new Map(e),this[ts]=null)}contains(e){return e=e.toLowerCase(),this[As].has(e)}clear(){this[As].clear(),this[ts]=null,this.cookies=null}append(e,t){this[ts]=null;let r=e.toLowerCase(),i=this[As].get(r);if(i){let s=r==="cookie"?"; ":", ";this[As].set(r,{name:i.name,value:`${i.value}${s}${t}`})}else this[As].set(r,{name:e,value:t});r==="set-cookie"&&(this.cookies??=[],this.cookies.push(t))}set(e,t){this[ts]=null;let r=e.toLowerCase();return r==="set-cookie"&&(this.cookies=[t]),this[As].set(r,{name:e,value:t})}delete(e){return this[ts]=null,e=e.toLowerCase(),e==="set-cookie"&&(this.cookies=null),this[As].delete(e)}get(e){return this.contains(e)?this[As].get(e.toLowerCase())?.value??null:null}*[Symbol.iterator](){for(let[e,{value:t}]of this[As])yield[e,t]}get entries(){let e={};if(this[As].size)for(let{name:t,value:r}of this[As].values())e[t]=r;return e}},Hh=class A{constructor(e=void 0){this[es]=new jw,this[pp]="none",e!==void 0&&(e=Ve.converters.HeadersInit(e),Sle(this,e))}append(e,t){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,2,{header:"Headers.append"}),e=Ve.converters.ByteString(e),t=Ve.converters.ByteString(t),t=xle(t),Fm(e)){if(!Rle(t))throw Ve.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header value"})}else throw Ve.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(this[pp]==="immutable")throw new TypeError("immutable");return this[pp],this[es].append(e,t)}delete(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.delete"}),e=Ve.converters.ByteString(e),!Fm(e))throw Ve.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this[pp]==="immutable")throw new TypeError("immutable");if(this[pp],!!this[es].contains(e))return this[es].delete(e)}get(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.get"}),e=Ve.converters.ByteString(e),!Fm(e))throw Ve.errors.invalidArgument({prefix:"Headers.get",value:e,type:"header name"});return this[es].get(e)}has(e){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.has"}),e=Ve.converters.ByteString(e),!Fm(e))throw Ve.errors.invalidArgument({prefix:"Headers.has",value:e,type:"header name"});return this[es].contains(e)}set(e,t){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,2,{header:"Headers.set"}),e=Ve.converters.ByteString(e),t=Ve.converters.ByteString(t),t=xle(t),Fm(e)){if(!Rle(t))throw Ve.errors.invalidArgument({prefix:"Headers.set",value:t,type:"header value"})}else throw Ve.errors.invalidArgument({prefix:"Headers.set",value:e,type:"header name"});if(this[pp]==="immutable")throw new TypeError("immutable");return this[pp],this[es].set(e,t)}getSetCookie(){Ve.brandCheck(this,A);let e=this[es].cookies;return e?[...e]:[]}get[ts](){if(this[es][ts])return this[es][ts];let e=[],t=[...this[es]].sort((i,s)=>i[0][...this[ts].values()],"Headers","key")}values(){return Ve.brandCheck(this,A),mF(()=>[...this[ts].values()],"Headers","value")}entries(){return Ve.brandCheck(this,A),mF(()=>[...this[ts].values()],"Headers","key+value")}forEach(e,t=globalThis){if(Ve.brandCheck(this,A),Ve.argumentLengthCheck(arguments,1,{header:"Headers.forEach"}),typeof e!="function")throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");for(let[r,i]of this)e.apply(t,[i,r,this])}[Symbol.for("nodejs.util.inspect.custom")](){return Ve.brandCheck(this,A),this[es]}};Hh.prototype[Symbol.iterator]=Hh.prototype.entries;Object.defineProperties(Hh.prototype,{append:Xa,delete:Xa,get:Xa,has:Xa,set:Xa,getSetCookie:Xa,keys:Xa,values:Xa,entries:Xa,forEach:Xa,[Symbol.iterator]:{enumerable:!1},[Symbol.toStringTag]:{value:"Headers",configurable:!0}});Ve.converters.HeadersInit=function(A){if(Ve.util.Type(A)==="Object")return A[Symbol.iterator]?Ve.converters["sequence>"](A):Ve.converters["record"](A);throw Ve.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};vle.exports={fill:Sle,Headers:Hh,HeadersList:jw}});var $w=E((ZoA,Yle)=>{"use strict";var{Headers:zze,HeadersList:kle,fill:jze}=up(),{extractBody:Fle,cloneBody:Xze,mixinBody:Zze}=pm(),fF=aA(),{kEnumerableProperty:Ps}=fF,{isValidReasonPhrase:Kze,isCancelled:$ze,isAborted:eje,isBlobLike:Aje,serializeJavascriptValueToJSONString:tje,isErrorLike:rje,isomorphicEncode:ije}=In(),{redirectStatus:sje,nullBodyStatus:nje,DOMException:Lle}=yl(),{kState:dt,kHeaders:wr,kGuard:Gh,kRealm:qs}=Xo(),{webidl:Pe}=fi(),{FormData:aje}=pw(),{getGlobalOrigin:oje}=Ch(),{URLSerializer:Ule}=Kn(),{kHeadersList:BF}=lt(),yF=require("assert"),{types:IF}=require("util"),Tle=globalThis.ReadableStream||require("stream/web").ReadableStream,_h=class A{static error(){let e={settingsObject:{}},t=new A;return t[dt]=Zw(),t[qs]=e,t[wr][BF]=t[dt].headersList,t[wr][Gh]="immutable",t[wr][qs]=e,t}static json(e,t={}){Pe.argumentLengthCheck(arguments,1,{header:"Response.json"}),t!==null&&(t=Pe.converters.ResponseInit(t));let r=new TextEncoder("utf-8").encode(tje(e)),i=Fle(r),s={settingsObject:{}},n=new A;return n[qs]=s,n[wr][Gh]="response",n[wr][qs]=s,Mle(n,t,{body:i[0],type:"application/json"}),n}static redirect(e,t=302){let r={settingsObject:{}};Pe.argumentLengthCheck(arguments,1,{header:"Response.redirect"}),e=Pe.converters.USVString(e),t=Pe.converters["unsigned short"](t);let i;try{i=new URL(e,oje())}catch(a){throw Object.assign(new TypeError("Failed to parse URL from "+e),{cause:a})}if(!sje.includes(t))throw new RangeError("Invalid status code "+t);let s=new A;s[qs]=r,s[wr][Gh]="immutable",s[wr][qs]=r,s[dt].status=t;let n=ije(Ule(i));return s[dt].headersList.append("location",n),s}constructor(e=null,t={}){e!==null&&(e=Pe.converters.BodyInit(e)),t=Pe.converters.ResponseInit(t),this[qs]={settingsObject:{}},this[dt]=Kw({}),this[wr]=new zze,this[wr][Gh]="response",this[wr][BF]=this[dt].headersList,this[wr][qs]=this[qs];let r=null;if(e!=null){let[i,s]=Fle(e);r={body:i,type:s}}Mle(this,t,r)}get type(){return Pe.brandCheck(this,A),this[dt].type}get url(){Pe.brandCheck(this,A);let e=this[dt].urlList,t=e[e.length-1]??null;return t===null?"":Ule(t,!0)}get redirected(){return Pe.brandCheck(this,A),this[dt].urlList.length>1}get status(){return Pe.brandCheck(this,A),this[dt].status}get ok(){return Pe.brandCheck(this,A),this[dt].status>=200&&this[dt].status<=299}get statusText(){return Pe.brandCheck(this,A),this[dt].statusText}get headers(){return Pe.brandCheck(this,A),this[wr]}get body(){return Pe.brandCheck(this,A),this[dt].body?this[dt].body.stream:null}get bodyUsed(){return Pe.brandCheck(this,A),!!this[dt].body&&fF.isDisturbed(this[dt].body.stream)}clone(){if(Pe.brandCheck(this,A),this.bodyUsed||this.body&&this.body.locked)throw Pe.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=wF(this[dt]),t=new A;return t[dt]=e,t[qs]=this[qs],t[wr][BF]=e.headersList,t[wr][Gh]=this[wr][Gh],t[wr][qs]=this[wr][qs],t}};Zze(_h);Object.defineProperties(_h.prototype,{type:Ps,url:Ps,status:Ps,ok:Ps,redirected:Ps,statusText:Ps,headers:Ps,clone:Ps,body:Ps,bodyUsed:Ps,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(_h,{json:Ps,redirect:Ps,error:Ps});function wF(A){if(A.internalResponse)return Ole(wF(A.internalResponse),A.type);let e=Kw({...A,body:null});return A.body!=null&&(e.body=Xze(A.body)),e}function Kw(A){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...A,headersList:A.headersList?new kle(A.headersList):new kle,urlList:A.urlList?[...A.urlList]:[]}}function Zw(A){let e=rje(A);return Kw({type:"error",status:0,error:e?A:new Error(A&&String(A)),aborted:A&&A.name==="AbortError"})}function Xw(A,e){return e={internalResponse:A,...e},new Proxy(A,{get(t,r){return r in e?e[r]:t[r]},set(t,r,i){return yF(!(r in e)),t[r]=i,!0}})}function Ole(A,e){if(e==="basic")return Xw(A,{type:"basic",headersList:A.headersList});if(e==="cors")return Xw(A,{type:"cors",headersList:A.headersList});if(e==="opaque")return Xw(A,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return Xw(A,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});yF(!1)}function cje(A,e=null){return yF($ze(A)),eje(A)?Zw(Object.assign(new Lle("The operation was aborted.","AbortError"),{cause:e})):Zw(Object.assign(new Lle("Request was cancelled."),{cause:e}))}function Mle(A,e,t){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!Kze(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(A[dt].status=e.status),"statusText"in e&&e.statusText!=null&&(A[dt].statusText=e.statusText),"headers"in e&&e.headers!=null&&jze(A[wr],e.headers),t){if(nje.includes(A.status))throw Pe.errors.exception({header:"Response constructor",message:"Invalid response status code "+A.status});A[dt].body=t.body,t.type!=null&&!A[dt].headersList.contains("Content-Type")&&A[dt].headersList.append("content-type",t.type)}}Pe.converters.ReadableStream=Pe.interfaceConverter(Tle);Pe.converters.FormData=Pe.interfaceConverter(aje);Pe.converters.URLSearchParams=Pe.interfaceConverter(URLSearchParams);Pe.converters.XMLHttpRequestBodyInit=function(A){return typeof A=="string"?Pe.converters.USVString(A):Aje(A)?Pe.converters.Blob(A,{strict:!1}):IF.isAnyArrayBuffer(A)||IF.isTypedArray(A)||IF.isDataView(A)?Pe.converters.BufferSource(A):fF.isFormDataLike(A)?Pe.converters.FormData(A,{strict:!1}):A instanceof URLSearchParams?Pe.converters.URLSearchParams(A):Pe.converters.DOMString(A)};Pe.converters.BodyInit=function(A){return A instanceof Tle?Pe.converters.ReadableStream(A):A?.[Symbol.asyncIterator]?A:Pe.converters.XMLHttpRequestBodyInit(A)};Pe.converters.ResponseInit=Pe.dictionaryConverter([{key:"status",converter:Pe.converters["unsigned short"],defaultValue:200},{key:"statusText",converter:Pe.converters.ByteString,defaultValue:""},{key:"headers",converter:Pe.converters.HeadersInit}]);Yle.exports={makeNetworkError:Zw,makeResponse:Kw,makeAppropriateNetworkError:cje,filterResponse:Ole,Response:_h,cloneResponse:wF}});var Mm=E((KoA,Vle)=>{"use strict";var{extractBody:lje,mixinBody:dje,cloneBody:pje}=pm(),{Headers:bF,fill:uje,HeadersList:qle}=up(),{FinalizationRegistry:gje}=Uk()(),Um=aA(),{isValidHTTPToken:hje,sameOrigin:Ple,normalizeMethod:Eje,makePolicyContainer:Cje}=In(),{forbiddenMethods:Qje,corsSafeListedMethods:mje,referrerPolicy:Bje,requestRedirect:Ije,requestMode:fje,requestCredentials:yje,requestCache:wje,requestDuplex:bje}=yl(),{kEnumerableProperty:Kt}=Um,{kHeaders:br,kSignal:Lm,kState:st,kGuard:eb,kRealm:Hs}=Xo(),{webidl:Re}=fi(),{getGlobalOrigin:Nje}=Ch(),{URLSerializer:Dje}=Kn(),{kHeadersList:Ab}=lt(),Rje=require("assert"),{getMaxListeners:Hle,setMaxListeners:Gle,getEventListeners:xje,defaultMaxListeners:_le}=require("events"),NF=globalThis.TransformStream,Jle=Symbol("init"),Sje=Symbol("abortController"),vje=new gje(({signal:A,abort:e})=>{A.removeEventListener("abort",e)}),gp=class A{constructor(e,t={}){if(e===Jle)return;Re.argumentLengthCheck(arguments,1,{header:"Request constructor"}),e=Re.converters.RequestInfo(e),t=Re.converters.RequestInit(t),this[Hs]={settingsObject:{baseUrl:Nje(),get origin(){return this.baseUrl?.origin},policyContainer:Cje()}};let r=null,i=null,s=this[Hs].settingsObject.baseUrl,n=null;if(typeof e=="string"){let h;try{h=new URL(e,s)}catch(Q){throw new TypeError("Failed to parse URL from "+e,{cause:Q})}if(h.username||h.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);r=tb({urlList:[h]}),i="cors"}else Rje(e instanceof A),r=e[st],n=e[Lm];let a=this[Hs].settingsObject.origin,o="client";if(r.window?.constructor?.name==="EnvironmentSettingsObject"&&Ple(r.window,a)&&(o=r.window),t.window!=null)throw new TypeError(`'window' option '${o}' must be null`);if("window"in t&&(o="no-window"),r=tb({method:r.method,headersList:r.headersList,unsafeRequest:r.unsafeRequest,client:this[Hs].settingsObject,window:o,priority:r.priority,origin:r.origin,referrer:r.referrer,referrerPolicy:r.referrerPolicy,mode:r.mode,credentials:r.credentials,cache:r.cache,redirect:r.redirect,integrity:r.integrity,keepalive:r.keepalive,reloadNavigation:r.reloadNavigation,historyNavigation:r.historyNavigation,urlList:[...r.urlList]}),Object.keys(t).length>0&&(r.mode==="navigate"&&(r.mode="same-origin"),r.reloadNavigation=!1,r.historyNavigation=!1,r.origin="client",r.referrer="client",r.referrerPolicy="",r.url=r.urlList[r.urlList.length-1],r.urlList=[r.url]),t.referrer!==void 0){let h=t.referrer;if(h==="")r.referrer="no-referrer";else{let Q;try{Q=new URL(h,s)}catch(B){throw new TypeError(`Referrer "${h}" is not a valid URL.`,{cause:B})}Q.protocol==="about:"&&Q.hostname==="client"||a&&!Ple(Q,this[Hs].settingsObject.baseUrl)?r.referrer="client":r.referrer=Q}}t.referrerPolicy!==void 0&&(r.referrerPolicy=t.referrerPolicy);let c;if(t.mode!==void 0?c=t.mode:c=i,c==="navigate")throw Re.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(c!=null&&(r.mode=c),t.credentials!==void 0&&(r.credentials=t.credentials),t.cache!==void 0&&(r.cache=t.cache),r.cache==="only-if-cached"&&r.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(t.redirect!==void 0&&(r.redirect=t.redirect),t.integrity!==void 0&&t.integrity!=null&&(r.integrity=String(t.integrity)),t.keepalive!==void 0&&(r.keepalive=!!t.keepalive),t.method!==void 0){let h=t.method;if(!hje(t.method))throw TypeError(`'${t.method}' is not a valid HTTP method.`);if(Qje.indexOf(h.toUpperCase())!==-1)throw TypeError(`'${t.method}' HTTP method is unsupported.`);h=Eje(t.method),r.method=h}t.signal!==void 0&&(n=t.signal),this[st]=r;let l=new AbortController;if(this[Lm]=l.signal,this[Lm][Hs]=this[Hs],n!=null){if(!n||typeof n.aborted!="boolean"||typeof n.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(n.aborted)l.abort(n.reason);else{this[Sje]=l;let h=new WeakRef(l),Q=function(){let B=h.deref();B!==void 0&&B.abort(this.reason)};try{(typeof Hle=="function"&&Hle(n)===_le||xje(n,"abort").length>=_le)&&Gle(100,n)}catch{}Um.addAbortListener(n,Q),vje.register(l,{signal:n,abort:Q})}}if(this[br]=new bF,this[br][Ab]=r.headersList,this[br][eb]="request",this[br][Hs]=this[Hs],c==="no-cors"){if(!mje.includes(r.method))throw new TypeError(`'${r.method} is unsupported in no-cors mode.`);this[br][eb]="request-no-cors"}if(Object.keys(t).length!==0){let h=new bF(this[br]);if(t.headers!==void 0&&(h=t.headers),this[br][Ab].clear(),h.constructor.name==="Headers")for(let[Q,B]of h)this[br].append(Q,B);else uje(this[br],h)}let d=e instanceof A?e[st].body:null;if((t.body!=null||d!=null)&&(r.method==="GET"||r.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let p=null;if(t.body!=null){let[h,Q]=lje(t.body,r.keepalive);p=h,Q&&!this[br][Ab].contains("content-type")&&this[br].append("content-type",Q)}let u=p??d;if(u!=null&&u.source==null){if(p!=null&&t.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(r.mode!=="same-origin"&&r.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');r.useCORSPreflightFlag=!0}let g=u;if(p==null&&d!=null){if(Um.isDisturbed(d.stream)||d.stream.locked)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");NF||(NF=require("stream/web").TransformStream);let h=new NF;d.stream.pipeThrough(h),g={source:d.source,length:d.length,stream:h.readable}}this[st].body=g}get method(){return Re.brandCheck(this,A),this[st].method}get url(){return Re.brandCheck(this,A),Dje(this[st].url)}get headers(){return Re.brandCheck(this,A),this[br]}get destination(){return Re.brandCheck(this,A),this[st].destination}get referrer(){return Re.brandCheck(this,A),this[st].referrer==="no-referrer"?"":this[st].referrer==="client"?"about:client":this[st].referrer.toString()}get referrerPolicy(){return Re.brandCheck(this,A),this[st].referrerPolicy}get mode(){return Re.brandCheck(this,A),this[st].mode}get credentials(){return this[st].credentials}get cache(){return Re.brandCheck(this,A),this[st].cache}get redirect(){return Re.brandCheck(this,A),this[st].redirect}get integrity(){return Re.brandCheck(this,A),this[st].integrity}get keepalive(){return Re.brandCheck(this,A),this[st].keepalive}get isReloadNavigation(){return Re.brandCheck(this,A),this[st].reloadNavigation}get isHistoryNavigation(){return Re.brandCheck(this,A),this[st].historyNavigation}get signal(){return Re.brandCheck(this,A),this[Lm]}get body(){return Re.brandCheck(this,A),this[st].body?this[st].body.stream:null}get bodyUsed(){return Re.brandCheck(this,A),!!this[st].body&&Um.isDisturbed(this[st].body.stream)}get duplex(){return Re.brandCheck(this,A),"half"}clone(){if(Re.brandCheck(this,A),this.bodyUsed||this.body?.locked)throw new TypeError("unusable");let e=kje(this[st]),t=new A(Jle);t[st]=e,t[Hs]=this[Hs],t[br]=new bF,t[br][Ab]=e.headersList,t[br][eb]=this[br][eb],t[br][Hs]=this[br][Hs];let r=new AbortController;return this.signal.aborted?r.abort(this.signal.reason):Um.addAbortListener(this.signal,()=>{r.abort(this.signal.reason)}),t[Lm]=r.signal,t}};dje(gp);function tb(A){let e={method:"GET",localURLsOnly:!1,unsafeRequest:!1,body:null,client:null,reservedClient:null,replacesClientId:"",window:"client",keepalive:!1,serviceWorkers:"all",initiator:"",destination:"",priority:null,origin:"client",policyContainer:"client",referrer:"client",referrerPolicy:"",mode:"no-cors",useCORSPreflightFlag:!1,credentials:"same-origin",useCredentials:!1,cache:"default",redirect:"follow",integrity:"",cryptoGraphicsNonceMetadata:"",parserMetadata:"",reloadNavigation:!1,historyNavigation:!1,userActivation:!1,taintedOrigin:!1,redirectCount:0,responseTainting:"basic",preventNoCacheCacheControlHeaderModification:!1,done:!1,timingAllowFailed:!1,...A,headersList:A.headersList?new qle(A.headersList):new qle};return e.url=e.urlList[0],e}function kje(A){let e=tb({...A,body:null});return A.body!=null&&(e.body=pje(A.body)),e}Object.defineProperties(gp.prototype,{method:Kt,url:Kt,headers:Kt,redirect:Kt,clone:Kt,signal:Kt,duplex:Kt,destination:Kt,body:Kt,bodyUsed:Kt,isHistoryNavigation:Kt,isReloadNavigation:Kt,keepalive:Kt,integrity:Kt,cache:Kt,credentials:Kt,attribute:Kt,referrerPolicy:Kt,referrer:Kt,mode:Kt,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Re.converters.Request=Re.interfaceConverter(gp);Re.converters.RequestInfo=function(A){return typeof A=="string"?Re.converters.USVString(A):A instanceof gp?Re.converters.Request(A):Re.converters.USVString(A)};Re.converters.AbortSignal=Re.interfaceConverter(AbortSignal);Re.converters.RequestInit=Re.dictionaryConverter([{key:"method",converter:Re.converters.ByteString},{key:"headers",converter:Re.converters.HeadersInit},{key:"body",converter:Re.nullableConverter(Re.converters.BodyInit)},{key:"referrer",converter:Re.converters.USVString},{key:"referrerPolicy",converter:Re.converters.DOMString,allowedValues:Bje},{key:"mode",converter:Re.converters.DOMString,allowedValues:fje},{key:"credentials",converter:Re.converters.DOMString,allowedValues:yje},{key:"cache",converter:Re.converters.DOMString,allowedValues:wje},{key:"redirect",converter:Re.converters.DOMString,allowedValues:Ije},{key:"integrity",converter:Re.converters.DOMString},{key:"keepalive",converter:Re.converters.boolean},{key:"signal",converter:Re.nullableConverter(A=>Re.converters.AbortSignal(A,{strict:!1}))},{key:"window",converter:Re.converters.any},{key:"duplex",converter:Re.converters.DOMString,allowedValues:bje}]);Vle.exports={Request:gp,makeRequest:tb}});var cb=E(($oA,nde)=>{"use strict";var{Response:Fje,makeNetworkError:YA,makeAppropriateNetworkError:rb,filterResponse:DF,makeResponse:ib}=$w(),{Headers:Wle}=up(),{Request:Lje,makeRequest:Uje}=Mm(),Tm=require("zlib"),{bytesMatch:Mje,makePolicyContainer:Tje,clonePolicyContainer:Oje,requestBadPort:Yje,TAOCheck:qje,appendRequestOriginHeader:Pje,responseLocationURL:Hje,requestCurrentURL:Za,setRequestReferrerPolicyOnRedirect:Gje,tryUpgradeRequestToAPotentiallyTrustworthyURL:_je,createOpaqueTimingInfo:TF,appendFetchMetadata:Jje,corsCheck:Vje,crossOriginResourcePolicyCheck:Wje,determineRequestsReferrer:zje,coarsenedSharedCurrentTime:OF,createDeferredPromise:jje,isBlobLike:Xje,sameOrigin:FF,isCancelled:Jh,isAborted:zle,isErrorLike:Zje,fullyReadBody:Kle,readableStreamClose:Kje,isomorphicEncode:LF,urlIsLocal:$je,urlIsHttpHttpsScheme:YF,urlHasHttpsScheme:eXe}=In(),{kState:UF,kHeaders:RF,kGuard:AXe,kRealm:jle}=Xo(),Vh=require("assert"),{safelyExtractBody:sb}=pm(),{redirectStatus:$le,nullBodyStatus:ede,safeMethods:tXe,requestBodyHeader:rXe,subresource:iXe,DOMException:nb}=yl(),{kHeadersList:MF}=lt(),sXe=require("events"),{Readable:nXe,pipeline:aXe}=require("stream"),{addAbortListener:oXe,isErrored:cXe,isReadable:ab,nodeMajor:Xle,nodeMinor:lXe}=aA(),{dataURLProcessor:dXe,serializeAMimeType:pXe}=Kn(),{TransformStream:uXe}=require("stream/web"),{getGlobalDispatcher:gXe}=Ph(),{webidl:hXe}=fi(),{STATUS_CODES:EXe}=require("http"),xF,SF=globalThis.ReadableStream,ob=class extends sXe{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing",this.setMaxListeners(21)}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new nb("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function CXe(A,e={}){hXe.argumentLengthCheck(arguments,1,{header:"globalThis.fetch"});let t=jje(),r;try{r=new Lje(A,e)}catch(p){return t.reject(p),t.promise}let i=r[UF];if(r.signal.aborted)return vF(t,i,null,r.signal.reason),t.promise;i.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(i.serviceWorkers="none");let n=null,a=null,o=!1,c=null;return oXe(r.signal,()=>{o=!0,Vh(c!=null),c.abort(r.signal.reason),vF(t,i,n,r.signal.reason)}),c=tde({request:i,processResponseEndOfBody:p=>Ade(p,"fetch"),processResponse:p=>{if(o)return Promise.resolve();if(p.aborted)return vF(t,i,n,c.serializedAbortReason),Promise.resolve();if(p.type==="error")return t.reject(Object.assign(new TypeError("fetch failed"),{cause:p.error})),Promise.resolve();n=new Fje,n[UF]=p,n[jle]=a,n[RF][MF]=p.headersList,n[RF][AXe]="immutable",n[RF][jle]=a,t.resolve(n)},dispatcher:e.dispatcher??gXe()}),t.promise}function Ade(A,e="other"){if(A.type==="error"&&A.aborted||!A.urlList?.length)return;let t=A.urlList[0],r=A.timingInfo,i=A.cacheState;YF(t)&&r!==null&&(r.timingAllowPassed||(r=TF({startTime:r.startTime}),i=""),r.endTime=OF(),A.timingInfo=r,QXe(r,t,e,globalThis,i))}function QXe(A,e,t,r,i){(Xle>18||Xle===18&&lXe>=2)&&performance.markResourceTiming(A,e.href,t,r,i)}function vF(A,e,t,r){if(r||(r=new nb("The operation was aborted.","AbortError")),A.reject(r),e.body!=null&&ab(e.body?.stream)&&e.body.stream.cancel(r).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),t==null)return;let i=t[UF];i.body!=null&&ab(i.body?.stream)&&i.body.stream.cancel(r).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}function tde({request:A,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:s,useParallelQueue:n=!1,dispatcher:a}){let o=null,c=!1;A.client!=null&&(o=A.client.globalObject,c=A.client.crossOriginIsolatedCapability);let l=OF(c),d=TF({startTime:l}),p={controller:new ob(a),request:A,timingInfo:d,processRequestBodyChunkLength:e,processRequestEndOfBody:t,processResponse:r,processResponseConsumeBody:s,processResponseEndOfBody:i,taskDestination:o,crossOriginIsolatedCapability:c};return Vh(!A.body||A.body.stream),A.window==="client"&&(A.window=A.client?.globalObject?.constructor?.name==="Window"?A.client:"no-window"),A.origin==="client"&&(A.origin=A.client?.origin),A.policyContainer==="client"&&(A.client!=null?A.policyContainer=Oje(A.client.policyContainer):A.policyContainer=Tje()),A.headersList.contains("accept")||A.headersList.append("accept","*/*"),A.headersList.contains("accept-language")||A.headersList.append("accept-language","*"),A.priority,iXe.includes(A.destination),rde(p).catch(u=>{p.controller.terminate(u)}),p.controller}async function rde(A,e=!1){let t=A.request,r=null;if(t.localURLsOnly&&!$je(Za(t))&&(r=YA("local URLs only")),_je(t),Yje(t)==="blocked"&&(r=YA("bad port")),t.referrerPolicy===""&&(t.referrerPolicy=t.policyContainer.referrerPolicy),t.referrer!=="no-referrer"&&(t.referrer=zje(t)),r===null&&(r=await(async()=>{let s=Za(t);return FF(s,t.url)&&t.responseTainting==="basic"||s.protocol==="data:"||t.mode==="navigate"||t.mode==="websocket"?(t.responseTainting="basic",await Zle(A)):t.mode==="same-origin"?YA('request mode cannot be "same-origin"'):t.mode==="no-cors"?t.redirect!=="follow"?YA('redirect mode cannot be "follow" for "no-cors" request'):(t.responseTainting="opaque",await Zle(A)):YF(Za(t))?(t.responseTainting="cors",await ide(A)):YA("URL scheme must be a HTTP(S) scheme")})()),e)return r;r.status!==0&&!r.internalResponse&&(t.responseTainting,t.responseTainting==="basic"?r=DF(r,"basic"):t.responseTainting==="cors"?r=DF(r,"cors"):t.responseTainting==="opaque"?r=DF(r,"opaque"):Vh(!1));let i=r.status===0?r:r.internalResponse;if(i.urlList.length===0&&i.urlList.push(...t.urlList),t.timingAllowFailed||(r.timingAllowPassed=!0),r.type==="opaque"&&i.status===206&&i.rangeRequested&&!t.headers.contains("range")&&(r=i=YA()),r.status!==0&&(t.method==="HEAD"||t.method==="CONNECT"||ede.includes(i.status))&&(i.body=null,A.controller.dump=!0),t.integrity){let s=a=>kF(A,YA(a));if(t.responseTainting==="opaque"||r.body==null){s(r.error);return}let n=a=>{if(!Mje(a,t.integrity)){s("integrity mismatch");return}r.body=sb(a)[0],kF(A,r)};await Kle(r.body,n,s)}else kF(A,r)}function Zle(A){if(Jh(A)&&A.request.redirectCount===0)return Promise.resolve(rb(A));let{request:e}=A,{protocol:t}=Za(e);switch(t){case"about:":return Promise.resolve(YA("about scheme is not supported"));case"blob:":{xF||(xF=require("buffer").resolveObjectURL);let r=Za(e);if(r.search.length!==0)return Promise.resolve(YA("NetworkError when attempting to fetch resource."));let i=xF(r.toString());if(e.method!=="GET"||!Xje(i))return Promise.resolve(YA("invalid method"));let s=sb(i),n=s[0],a=LF(`${n.length}`),o=s[1]??"",c=ib({statusText:"OK",headersList:[["content-length",{name:"Content-Length",value:a}],["content-type",{name:"Content-Type",value:o}]]});return c.body=n,Promise.resolve(c)}case"data:":{let r=Za(e),i=dXe(r);if(i==="failure")return Promise.resolve(YA("failed to fetch the data URL"));let s=pXe(i.mimeType);return Promise.resolve(ib({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:sb(i.body)[0]}))}case"file:":return Promise.resolve(YA("not implemented... yet..."));case"http:":case"https:":return ide(A).catch(r=>YA(r));default:return Promise.resolve(YA("unknown scheme"))}}function mXe(A,e){A.request.done=!0,A.processResponseDone!=null&&queueMicrotask(()=>A.processResponseDone(e))}function kF(A,e){e.type==="error"&&(e.urlList=[A.request.urlList[0]],e.timingInfo=TF({startTime:A.timingInfo.startTime}));let t=()=>{A.request.done=!0,A.processResponseEndOfBody!=null&&queueMicrotask(()=>A.processResponseEndOfBody(e))};if(A.processResponse!=null&&queueMicrotask(()=>A.processResponse(e)),e.body==null)t();else{let r=(s,n)=>{n.enqueue(s)},i=new uXe({start(){},transform:r,flush:t},{size(){return 1}},{size(){return 1}});e.body={stream:e.body.stream.pipeThrough(i)}}if(A.processResponseConsumeBody!=null){let r=s=>A.processResponseConsumeBody(e,s),i=s=>A.processResponseConsumeBody(e,s);if(e.body==null)queueMicrotask(()=>r(null));else return Kle(e.body,r,i);return Promise.resolve()}}async function ide(A){let e=A.request,t=null,r=null,i=A.timingInfo;if(e.serviceWorkers,t===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),r=t=await sde(A),e.responseTainting==="cors"&&Vje(e,t)==="failure")return YA("cors failure");qje(e,t)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||t.type==="opaque")&&Wje(e.origin,e.client,e.destination,r)==="blocked"?YA("blocked"):($le.includes(r.status)&&(e.redirect!=="manual"&&A.controller.connection.destroy(),e.redirect==="error"?t=YA("unexpected redirect"):e.redirect==="manual"?t=r:e.redirect==="follow"?t=await BXe(A,t):Vh(!1)),t.timingInfo=i,t)}function BXe(A,e){let t=A.request,r=e.internalResponse?e.internalResponse:e,i;try{if(i=Hje(r,Za(t).hash),i==null)return e}catch(n){return Promise.resolve(YA(n))}if(!YF(i))return Promise.resolve(YA("URL scheme must be a HTTP(S) scheme"));if(t.redirectCount===20)return Promise.resolve(YA("redirect count exceeded"));if(t.redirectCount+=1,t.mode==="cors"&&(i.username||i.password)&&!FF(t,i))return Promise.resolve(YA('cross origin not allowed for request mode "cors"'));if(t.responseTainting==="cors"&&(i.username||i.password))return Promise.resolve(YA('URL cannot contain credentials for request mode "cors"'));if(r.status!==303&&t.body!=null&&t.body.source==null)return Promise.resolve(YA());if([301,302].includes(r.status)&&t.method==="POST"||r.status===303&&!["GET","HEAD"].includes(t.method)){t.method="GET",t.body=null;for(let n of rXe)t.headersList.delete(n)}FF(Za(t),i)||(t.headersList.delete("authorization"),t.headersList.delete("cookie"),t.headersList.delete("host")),t.body!=null&&(Vh(t.body.source!=null),t.body=sb(t.body.source)[0]);let s=A.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=OF(A.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),t.urlList.push(i),Gje(t,r),rde(A,!0)}async function sde(A,e=!1,t=!1){let r=A.request,i=null,s=null,n=null,a=null,o=!1;r.window==="no-window"&&r.redirect==="error"?(i=A,s=r):(s=Uje(r),i={...A},i.request=s);let c=r.credentials==="include"||r.credentials==="same-origin"&&r.responseTainting==="basic",l=s.body?s.body.length:null,d=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(d="0"),l!=null&&(d=LF(`${l}`)),d!=null&&s.headersList.append("content-length",d),l!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",LF(s.referrer.href)),Pje(s),Jje(s),s.headersList.contains("user-agent")||s.headersList.append("user-agent",typeof esbuildDetection>"u"?"undici":"node"),s.cache==="default"&&(s.headersList.contains("if-modified-since")||s.headersList.contains("if-none-match")||s.headersList.contains("if-unmodified-since")||s.headersList.contains("if-match")||s.headersList.contains("if-range"))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control")&&s.headersList.append("cache-control","max-age=0"),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma")||s.headersList.append("pragma","no-cache"),s.headersList.contains("cache-control")||s.headersList.append("cache-control","no-cache")),s.headersList.contains("range")&&s.headersList.append("accept-encoding","identity"),s.headersList.contains("accept-encoding")||(eXe(Za(s))?s.headersList.append("accept-encoding","br, gzip, deflate"):s.headersList.append("accept-encoding","gzip, deflate")),s.headersList.delete("host"),a==null&&(s.cache="no-store"),s.mode!=="no-store"&&s.mode,n==null){if(s.mode==="only-if-cached")return YA("only if cached");let p=await IXe(i,c,t);!tXe.includes(s.method)&&p.status>=200&&p.status<=399,o&&p.status,n==null&&(n=p)}if(n.urlList=[...s.urlList],s.headersList.contains("range")&&(n.rangeRequested=!0),n.requestIncludesCredentials=c,n.status===407)return r.window==="no-window"?YA():Jh(A)?rb(A):YA("proxy authentication required");if(n.status===421&&!t&&(r.body==null||r.body.source!=null)){if(Jh(A))return rb(A);A.controller.connection.destroy(),n=await sde(A,e,!0)}return n}async function IXe(A,e=!1,t=!1){Vh(!A.controller.connection||A.controller.connection.destroyed),A.controller.connection={abort:null,destroyed:!1,destroy(g){this.destroyed||(this.destroyed=!0,this.abort?.(g??new nb("The operation was aborted.","AbortError")))}};let r=A.request,i=null,s=A.timingInfo;null==null&&(r.cache="no-store");let a=t?"yes":"no";r.mode;let o=null;if(r.body==null&&A.processRequestEndOfBody)queueMicrotask(()=>A.processRequestEndOfBody());else if(r.body!=null){let g=async function*(B){Jh(A)||(yield B,A.processRequestBodyChunkLength?.(B.byteLength))},h=()=>{Jh(A)||A.processRequestEndOfBody&&A.processRequestEndOfBody()},Q=B=>{Jh(A)||(B.name==="AbortError"?A.controller.abort():A.controller.terminate(B))};o=async function*(){try{for await(let B of r.body.stream)yield*g(B);h()}catch(B){Q(B)}}()}try{let{body:g,status:h,statusText:Q,headersList:B,socket:w}=await u({body:o});if(w)i=ib({status:h,statusText:Q,headersList:B,socket:w});else{let I=g[Symbol.asyncIterator]();A.controller.next=()=>I.next(),i=ib({status:h,statusText:Q,headersList:B})}}catch(g){return g.name==="AbortError"?(A.controller.connection.destroy(),rb(A,g)):YA(g)}let c=()=>{A.controller.resume()},l=g=>{A.controller.abort(g)};SF||(SF=require("stream/web").ReadableStream);let d=new SF({async start(g){A.controller.controller=g},async pull(g){await c(g)},async cancel(g){await l(g)}},{highWaterMark:0,size(){return 1}});i.body={stream:d},A.controller.on("terminated",p),A.controller.resume=async()=>{for(;;){let g,h;try{let{done:Q,value:B}=await A.controller.next();if(zle(A))break;g=Q?void 0:B}catch(Q){A.controller.ended&&!s.encodedBodySize?g=void 0:(g=Q,h=!0)}if(g===void 0){Kje(A.controller.controller),mXe(A,i);return}if(s.decodedBodySize+=g?.byteLength??0,h){A.controller.terminate(g);return}if(A.controller.controller.enqueue(new Uint8Array(g)),cXe(d)){A.controller.terminate();return}if(!A.controller.controller.desiredSize)return}};function p(g){zle(A)?(i.aborted=!0,ab(d)&&A.controller.controller.error(A.controller.serializedAbortReason)):ab(d)&&A.controller.controller.error(new TypeError("terminated",{cause:Zje(g)?g:void 0})),A.controller.connection.destroy()}return i;async function u({body:g}){let h=Za(r),Q=A.controller.dispatcher;return new Promise((B,w)=>Q.dispatch({path:h.pathname+h.search,origin:h.origin,method:r.method,body:A.controller.dispatcher.isMockActive?r.body&&r.body.source:g,headers:r.headersList.entries,maxRedirections:0,upgrade:r.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(I){let{connection:C}=A.controller;C.destroyed?I(new nb("The operation was aborted.","AbortError")):(A.controller.on("terminated",I),this.abort=C.abort=I)},onHeaders(I,C,m,b){if(I<200)return;let R=[],y="",v=new Wle;if(Array.isArray(C))for(let x=0;xoe.trim()):F.toLowerCase()==="location"&&(y=q),v.append(F,q)}else{let x=Object.keys(C);for(let F of x){let q=C[F];F.toLowerCase()==="content-encoding"?R=q.toLowerCase().split(",").map(oe=>oe.trim()).reverse():F.toLowerCase()==="location"&&(y=q),v.append(F,q)}}this.body=new nXe({read:m});let D=[],S=r.redirect==="follow"&&y&&$le.includes(I);if(r.method!=="HEAD"&&r.method!=="CONNECT"&&!ede.includes(I)&&!S)for(let x of R)if(x==="x-gzip"||x==="gzip")D.push(Tm.createGunzip({flush:Tm.constants.Z_SYNC_FLUSH,finishFlush:Tm.constants.Z_SYNC_FLUSH}));else if(x==="deflate")D.push(Tm.createInflate());else if(x==="br")D.push(Tm.createBrotliDecompress());else{D.length=0;break}return B({status:I,statusText:b,headersList:v[MF],body:D.length?aXe(this.body,...D,()=>{}):this.body.on("error",()=>{})}),!0},onData(I){if(A.controller.dump)return;let C=I;return s.encodedBodySize+=C.byteLength,this.body.push(C)},onComplete(){this.abort&&A.controller.off("terminated",this.abort),A.controller.ended=!0,this.body.push(null)},onError(I){this.abort&&A.controller.off("terminated",this.abort),this.body?.destroy(I),A.controller.terminate(I),w(I)},onUpgrade(I,C,m){if(I!==101)return;let b=new Wle;for(let R=0;R{"use strict";ade.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var cde=E((AcA,ode)=>{"use strict";var{webidl:Gs}=fi(),lb=Symbol("ProgressEvent state"),PF=class A extends Event{constructor(e,t={}){e=Gs.converters.DOMString(e),t=Gs.converters.ProgressEventInit(t??{}),super(e,t),this[lb]={lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}get lengthComputable(){return Gs.brandCheck(this,A),this[lb].lengthComputable}get loaded(){return Gs.brandCheck(this,A),this[lb].loaded}get total(){return Gs.brandCheck(this,A),this[lb].total}};Gs.converters.ProgressEventInit=Gs.dictionaryConverter([{key:"lengthComputable",converter:Gs.converters.boolean,defaultValue:!1},{key:"loaded",converter:Gs.converters["unsigned long long"],defaultValue:0},{key:"total",converter:Gs.converters["unsigned long long"],defaultValue:0},{key:"bubbles",converter:Gs.converters.boolean,defaultValue:!1},{key:"cancelable",converter:Gs.converters.boolean,defaultValue:!1},{key:"composed",converter:Gs.converters.boolean,defaultValue:!1}]);ode.exports={ProgressEvent:PF}});var dde=E((tcA,lde)=>{"use strict";function fXe(A){if(!A)return"failure";switch(A.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}lde.exports={getEncoding:fXe}});var mde=E((rcA,Qde)=>{"use strict";var{kState:Wh,kError:HF,kResult:pde,kAborted:Om,kLastProgressEventFired:GF}=qF(),{ProgressEvent:yXe}=cde(),{getEncoding:ude}=dde(),{DOMException:wXe}=yl(),{serializeAMimeType:bXe,parseMIMEType:gde}=Kn(),{types:NXe}=require("util"),{StringDecoder:hde}=require("string_decoder"),{btoa:Ede}=require("buffer"),DXe={enumerable:!0,writable:!1,configurable:!1};function RXe(A,e,t,r){if(A[Wh]==="loading")throw new wXe("Invalid state","InvalidStateError");A[Wh]="loading",A[pde]=null,A[HF]=null;let s=e.stream().getReader(),n=[],a=s.read(),o=!0;(async()=>{for(;!A[Om];)try{let{done:c,value:l}=await a;if(o&&!A[Om]&&queueMicrotask(()=>{vl("loadstart",A)}),o=!1,!c&&NXe.isUint8Array(l))n.push(l),(A[GF]===void 0||Date.now()-A[GF]>=50)&&!A[Om]&&(A[GF]=Date.now(),queueMicrotask(()=>{vl("progress",A)})),a=s.read();else if(c){queueMicrotask(()=>{A[Wh]="done";try{let d=xXe(n,t,e.type,r);if(A[Om])return;A[pde]=d,vl("load",A)}catch(d){A[HF]=d,vl("error",A)}A[Wh]!=="loading"&&vl("loadend",A)});break}}catch(c){if(A[Om])return;queueMicrotask(()=>{A[Wh]="done",A[HF]=c,vl("error",A),A[Wh]!=="loading"&&vl("loadend",A)});break}})()}function vl(A,e){let t=new yXe(A,{bubbles:!1,cancelable:!1});e.dispatchEvent(t)}function xXe(A,e,t,r){switch(e){case"DataURL":{let i="data:",s=gde(t||"application/octet-stream");s!=="failure"&&(i+=bXe(s)),i+=";base64,";let n=new hde("latin1");for(let a of A)i+=Ede(n.write(a));return i+=Ede(n.end()),i}case"Text":{let i="failure";if(r&&(i=ude(r)),i==="failure"&&t){let s=gde(t);s!=="failure"&&(i=ude(s.parameters.get("charset")))}return i==="failure"&&(i="UTF-8"),SXe(A,i)}case"ArrayBuffer":return Cde(A).buffer;case"BinaryString":{let i="",s=new hde("latin1");for(let n of A)i+=s.write(n);return i+=s.end(),i}}}function SXe(A,e){let t=Cde(A),r=vXe(t),i=0;r!==null&&(e=r,i=r==="UTF-8"?3:2);let s=t.slice(i);return new TextDecoder(e).decode(s)}function vXe(A){let[e,t,r]=A;return e===239&&t===187&&r===191?"UTF-8":e===254&&t===255?"UTF-16BE":e===255&&t===254?"UTF-16LE":null}function Cde(A){let e=A.reduce((r,i)=>r+i.byteLength,0),t=0;return A.reduce((r,i)=>(r.set(i,t),t+=i.byteLength,r),new Uint8Array(e))}Qde.exports={staticPropertyDescriptors:DXe,readOperation:RXe,fireAProgressEvent:vl}});var yde=E((icA,fde)=>{"use strict";var{staticPropertyDescriptors:zh,readOperation:db,fireAProgressEvent:Bde}=mde(),{kState:hp,kError:Ide,kResult:pb,kEvents:gA,kAborted:kXe}=qF(),{webidl:FA}=fi(),{kEnumerableProperty:rs}=aA(),Aa=class A extends EventTarget{constructor(){super(),this[hp]="empty",this[pb]=null,this[Ide]=null,this[gA]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsArrayBuffer"}),e=FA.converters.Blob(e,{strict:!1}),db(this,e,"ArrayBuffer")}readAsBinaryString(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsBinaryString"}),e=FA.converters.Blob(e,{strict:!1}),db(this,e,"BinaryString")}readAsText(e,t=void 0){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsText"}),e=FA.converters.Blob(e,{strict:!1}),t!==void 0&&(t=FA.converters.DOMString(t)),db(this,e,"Text",t)}readAsDataURL(e){FA.brandCheck(this,A),FA.argumentLengthCheck(arguments,1,{header:"FileReader.readAsDataURL"}),e=FA.converters.Blob(e,{strict:!1}),db(this,e,"DataURL")}abort(){if(this[hp]==="empty"||this[hp]==="done"){this[pb]=null;return}this[hp]==="loading"&&(this[hp]="done",this[pb]=null),this[kXe]=!0,Bde("abort",this),this[hp]!=="loading"&&Bde("loadend",this)}get readyState(){switch(FA.brandCheck(this,A),this[hp]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return FA.brandCheck(this,A),this[pb]}get error(){return FA.brandCheck(this,A),this[Ide]}get onloadend(){return FA.brandCheck(this,A),this[gA].loadend}set onloadend(e){FA.brandCheck(this,A),this[gA].loadend&&this.removeEventListener("loadend",this[gA].loadend),typeof e=="function"?(this[gA].loadend=e,this.addEventListener("loadend",e)):this[gA].loadend=null}get onerror(){return FA.brandCheck(this,A),this[gA].error}set onerror(e){FA.brandCheck(this,A),this[gA].error&&this.removeEventListener("error",this[gA].error),typeof e=="function"?(this[gA].error=e,this.addEventListener("error",e)):this[gA].error=null}get onloadstart(){return FA.brandCheck(this,A),this[gA].loadstart}set onloadstart(e){FA.brandCheck(this,A),this[gA].loadstart&&this.removeEventListener("loadstart",this[gA].loadstart),typeof e=="function"?(this[gA].loadstart=e,this.addEventListener("loadstart",e)):this[gA].loadstart=null}get onprogress(){return FA.brandCheck(this,A),this[gA].progress}set onprogress(e){FA.brandCheck(this,A),this[gA].progress&&this.removeEventListener("progress",this[gA].progress),typeof e=="function"?(this[gA].progress=e,this.addEventListener("progress",e)):this[gA].progress=null}get onload(){return FA.brandCheck(this,A),this[gA].load}set onload(e){FA.brandCheck(this,A),this[gA].load&&this.removeEventListener("load",this[gA].load),typeof e=="function"?(this[gA].load=e,this.addEventListener("load",e)):this[gA].load=null}get onabort(){return FA.brandCheck(this,A),this[gA].abort}set onabort(e){FA.brandCheck(this,A),this[gA].abort&&this.removeEventListener("abort",this[gA].abort),typeof e=="function"?(this[gA].abort=e,this.addEventListener("abort",e)):this[gA].abort=null}};Aa.EMPTY=Aa.prototype.EMPTY=0;Aa.LOADING=Aa.prototype.LOADING=1;Aa.DONE=Aa.prototype.DONE=2;Object.defineProperties(Aa.prototype,{EMPTY:zh,LOADING:zh,DONE:zh,readAsArrayBuffer:rs,readAsBinaryString:rs,readAsText:rs,readAsDataURL:rs,abort:rs,readyState:rs,result:rs,error:rs,onloadstart:rs,onprogress:rs,onload:rs,onabort:rs,onerror:rs,onloadend:rs,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Aa,{EMPTY:zh,LOADING:zh,DONE:zh});fde.exports={FileReader:Aa}});var ub=E((scA,wde)=>{"use strict";wde.exports={kConstruct:Symbol("constructable")}});var Dde=E((ncA,Nde)=>{"use strict";var FXe=require("assert"),{URLSerializer:bde}=Kn(),{isValidHeaderName:LXe}=In();function UXe(A,e,t=!1){let r=bde(A,t),i=bde(e,t);return r===i}function MXe(A){FXe(A!==null);let e=[];for(let t of A.split(",")){if(t=t.trim(),t.length){if(!LXe(t))continue}else continue;e.push(t)}return e}Nde.exports={urlEquals:UXe,fieldValues:MXe}});var Fde=E((acA,kde)=>{"use strict";var{kConstruct:TXe}=ub(),{urlEquals:OXe,fieldValues:_F}=Dde(),{kEnumerableProperty:Ep,isDisturbed:YXe}=aA(),{kHeadersList:Rde}=lt(),{webidl:ye}=fi(),{Response:Sde,cloneResponse:qXe}=$w(),{Request:Ka}=Mm(),{kState:Ni,kHeaders:gb,kGuard:xde,kRealm:PXe}=Xo(),{fetching:HXe}=cb(),{urlIsHttpHttpsScheme:hb,createDeferredPromise:jh,readAllBytes:GXe}=In(),JF=require("assert"),{getGlobalDispatcher:_Xe}=Ph(),Eb=class A{#e;constructor(){arguments[0]!==TXe&&ye.illegalConstructor(),this.#e=arguments[1]}async match(e,t={}){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.match"}),e=ye.converters.RequestInfo(e),t=ye.converters.CacheQueryOptions(t);let r=await this.matchAll(e,t);if(r.length!==0)return r[0]}async matchAll(e=void 0,t={}){ye.brandCheck(this,A),e!==void 0&&(e=ye.converters.RequestInfo(e)),t=ye.converters.CacheQueryOptions(t);let r=null;if(e!==void 0)if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(r=new Ka(e)[Ni]);let i=[];if(e===void 0)for(let n of this.#e)i.push(n[1]);else{let n=this.#r(r,t);for(let a of n)i.push(a[1])}let s=[];for(let n of i){let a=new Sde(n.body?.source??null),o=a[Ni].body;a[Ni]=n,a[Ni].body=o,a[gb][Rde]=n.headersList,a[gb][xde]="immutable",s.push(a)}return Object.freeze(s)}async add(e){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.add"}),e=ye.converters.RequestInfo(e);let t=[e];return await this.addAll(t)}async addAll(e){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.addAll"}),e=ye.converters["sequence"](e);let t=[],r=[];for(let d of e){if(typeof d=="string")continue;let p=d[Ni];if(!hb(p.url)||p.method!=="GET")throw ye.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme when method is not GET."})}let i=[];for(let d of e){let p=new Ka(d)[Ni];if(!hb(p.url))throw ye.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme."});p.initiator="fetch",p.destination="subresource",r.push(p);let u=jh();i.push(HXe({request:p,dispatcher:_Xe(),processResponse(g){if(g.type==="error"||g.status===206||g.status<200||g.status>299)u.reject(ye.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(g.headersList.contains("vary")){let h=_F(g.headersList.get("vary"));for(let Q of h)if(Q==="*"){u.reject(ye.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let B of i)B.abort();return}}},processResponseEndOfBody(g){if(g.aborted){u.reject(new DOMException("aborted","AbortError"));return}u.resolve(g)}})),t.push(u.promise)}let n=await Promise.all(t),a=[],o=0;for(let d of n){let p={type:"put",request:r[o],response:d};a.push(p),o++}let c=jh(),l=null;try{this.#t(a)}catch(d){l=d}return queueMicrotask(()=>{l===null?c.resolve(void 0):c.reject(l)}),c.promise}async put(e,t){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,2,{header:"Cache.put"}),e=ye.converters.RequestInfo(e),t=ye.converters.Response(t);let r=null;if(e instanceof Ka?r=e[Ni]:r=new Ka(e)[Ni],!hb(r.url)||r.method!=="GET")throw ye.errors.exception({header:"Cache.put",message:"Expected an http/s scheme when method is not GET"});let i=t[Ni];if(i.status===206)throw ye.errors.exception({header:"Cache.put",message:"Got 206 status"});if(i.headersList.contains("vary")){let p=_F(i.headersList.get("vary"));for(let u of p)if(u==="*")throw ye.errors.exception({header:"Cache.put",message:"Got * vary field value"})}if(i.body&&(YXe(i.body.stream)||i.body.stream.locked))throw ye.errors.exception({header:"Cache.put",message:"Response body is locked or disturbed"});let s=qXe(i),n=jh();if(i.body!=null){let u=i.body.stream.getReader();GXe(u).then(n.resolve,n.reject)}else n.resolve(void 0);let a=[],o={type:"put",request:r,response:s};a.push(o);let c=await n.promise;s.body!=null&&(s.body.source=c);let l=jh(),d=null;try{this.#t(a)}catch(p){d=p}return queueMicrotask(()=>{d===null?l.resolve():l.reject(d)}),l.promise}async delete(e,t={}){ye.brandCheck(this,A),ye.argumentLengthCheck(arguments,1,{header:"Cache.delete"}),e=ye.converters.RequestInfo(e),t=ye.converters.CacheQueryOptions(t);let r=null;if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return!1}else JF(typeof e=="string"),r=new Ka(e)[Ni];let i=[],s={type:"delete",request:r,options:t};i.push(s);let n=jh(),a=null,o;try{o=this.#t(i)}catch(c){a=c}return queueMicrotask(()=>{a===null?n.resolve(!!o?.length):n.reject(a)}),n.promise}async keys(e=void 0,t={}){ye.brandCheck(this,A),e!==void 0&&(e=ye.converters.RequestInfo(e)),t=ye.converters.CacheQueryOptions(t);let r=null;if(e!==void 0)if(e instanceof Ka){if(r=e[Ni],r.method!=="GET"&&!t.ignoreMethod)return[]}else typeof e=="string"&&(r=new Ka(e)[Ni]);let i=jh(),s=[];if(e===void 0)for(let n of this.#e)s.push(n[0]);else{let n=this.#r(r,t);for(let a of n)s.push(a[0])}return queueMicrotask(()=>{let n=[];for(let a of s){let o=new Ka("https://a");o[Ni]=a,o[gb][Rde]=a.headersList,o[gb][xde]="immutable",o[PXe]=a.client,n.push(o)}i.resolve(Object.freeze(n))}),i.promise}#t(e){let t=this.#e,r=[...t],i=[],s=[];try{for(let n of e){if(n.type!=="delete"&&n.type!=="put")throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(n.type==="delete"&&n.response!=null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(n.request,n.options,i).length)throw new DOMException("???","InvalidStateError");let a;if(n.type==="delete"){if(a=this.#r(n.request,n.options),a.length===0)return[];for(let o of a){let c=t.indexOf(o);JF(c!==-1),t.splice(c,1)}}else if(n.type==="put"){if(n.response==null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let o=n.request;if(!hb(o.url))throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(o.method!=="GET")throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(n.options!=null)throw ye.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});a=this.#r(n.request);for(let c of a){let l=t.indexOf(c);JF(l!==-1),t.splice(l,1)}t.push([n.request,n.response]),i.push([n.request,n.response])}s.push([n.request,n.response])}return s}catch(n){throw this.#e.length=0,this.#e=r,n}}#r(e,t,r){let i=[],s=r??this.#e;for(let n of s){let[a,o]=n;this.#A(e,a,o,t)&&i.push(n)}return i}#A(e,t,r=null,i){let s=new URL(e.url),n=new URL(t.url);if(i?.ignoreSearch&&(n.search="",s.search=""),!OXe(s,n,!0))return!1;if(r==null||i?.ignoreVary||!r.headersList.contains("vary"))return!0;let a=_F(r.headersList.get("vary"));for(let o of a){if(o==="*")return!1;let c=t.headersList.get(o),l=e.headersList.get(o);if(c!==l)return!1}return!0}};Object.defineProperties(Eb.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:Ep,matchAll:Ep,add:Ep,addAll:Ep,put:Ep,delete:Ep,keys:Ep});var vde=[{key:"ignoreSearch",converter:ye.converters.boolean,defaultValue:!1},{key:"ignoreMethod",converter:ye.converters.boolean,defaultValue:!1},{key:"ignoreVary",converter:ye.converters.boolean,defaultValue:!1}];ye.converters.CacheQueryOptions=ye.dictionaryConverter(vde);ye.converters.MultiCacheQueryOptions=ye.dictionaryConverter([...vde,{key:"cacheName",converter:ye.converters.DOMString}]);ye.converters.Response=ye.interfaceConverter(Sde);ye.converters["sequence"]=ye.sequenceConverter(ye.converters.RequestInfo);kde.exports={Cache:Eb}});var Ude=E((ocA,Lde)=>{"use strict";var{kConstruct:Ym}=ub(),{Cache:Cb}=Fde(),{webidl:Di}=fi(),{kEnumerableProperty:qm}=aA(),Qb=class A{#e=new Map;constructor(){arguments[0]!==Ym&&Di.illegalConstructor()}async match(e,t={}){if(Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.match"}),e=Di.converters.RequestInfo(e),t=Di.converters.MultiCacheQueryOptions(t),t.cacheName!=null){if(this.#e.has(t.cacheName)){let r=this.#e.get(t.cacheName);return await new Cb(Ym,r).match(e,t)}}else for(let r of this.#e.values()){let s=await new Cb(Ym,r).match(e,t);if(s!==void 0)return s}}async has(e){return Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.has"}),e=Di.converters.DOMString(e),this.#e.has(e)}async open(e){if(Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.open"}),e=Di.converters.DOMString(e),this.#e.has(e)){let r=this.#e.get(e);return new Cb(Ym,r)}let t=[];return this.#e.set(e,t),new Cb(Ym,t)}async delete(e){return Di.brandCheck(this,A),Di.argumentLengthCheck(arguments,1,{header:"CacheStorage.delete"}),e=Di.converters.DOMString(e),this.#e.delete(e)}async keys(){return Di.brandCheck(this,A),[...this.#e.keys()]}};Object.defineProperties(Qb.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:qm,has:qm,open:qm,delete:qm,keys:qm});Lde.exports={CacheStorage:Qb}});var Tde=E((ccA,Mde)=>{"use strict";Mde.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var VF=E((lcA,qde)=>{"use strict";var Ode=require("assert"),{kHeadersList:Yde}=lt();function JXe(A){if(A.length===0)return!1;for(let e of A){let t=e.charCodeAt(0);if(t>=0||t<=8||t>=10||t<=31||t===127)return!1}}function VXe(A){for(let e of A){let t=e.charCodeAt(0);if(t<=32||t>127||e==="("||e===")"||e===">"||e==="<"||e==="@"||e===","||e===";"||e===":"||e==="\\"||e==='"'||e==="/"||e==="["||e==="]"||e==="?"||e==="="||e==="{"||e==="}")throw new Error("Invalid cookie name")}}function WXe(A){for(let e of A){let t=e.charCodeAt(0);if(t<33||t===34||t===44||t===59||t===92||t>126)throw new Error("Invalid header value")}}function zXe(A){for(let e of A)if(e.charCodeAt(0)<33||e===";")throw new Error("Invalid cookie path")}function jXe(A){if(A.startsWith("-")||A.endsWith(".")||A.endsWith("-"))throw new Error("Invalid cookie domain")}function XXe(A){typeof A=="number"&&(A=new Date(A));let e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=e[A.getUTCDay()],i=A.getUTCDate().toString().padStart(2,"0"),s=t[A.getUTCMonth()],n=A.getUTCFullYear(),a=A.getUTCHours().toString().padStart(2,"0"),o=A.getUTCMinutes().toString().padStart(2,"0"),c=A.getUTCSeconds().toString().padStart(2,"0");return`${r}, ${i} ${s} ${n} ${a}:${o}:${c} GMT`}function ZXe(A){if(A<0)throw new Error("Invalid cookie max-age")}function KXe(A){if(A.name.length===0)return null;VXe(A.name),WXe(A.value);let e=[`${A.name}=${A.value}`];A.name.startsWith("__Secure-")&&(A.secure=!0),A.name.startsWith("__Host-")&&(A.secure=!0,A.domain=null,A.path="/"),A.secure&&e.push("Secure"),A.httpOnly&&e.push("HttpOnly"),typeof A.maxAge=="number"&&(ZXe(A.maxAge),e.push(`Max-Age=${A.maxAge}`)),A.domain&&(jXe(A.domain),e.push(`Domain=${A.domain}`)),A.path&&(zXe(A.path),e.push(`Path=${A.path}`)),A.expires&&A.expires.toString()!=="Invalid Date"&&e.push(`Expires=${XXe(A.expires)}`),A.sameSite&&e.push(`SameSite=${A.sameSite}`);for(let t of A.unparsed){if(!t.includes("="))throw new Error("Invalid unparsed");let[r,...i]=t.split("=");e.push(`${r.trim()}=${i.join("=")}`)}return e.join("; ")}var mb;function $Xe(A){if(A[Yde])return A[Yde];mb||(mb=Object.getOwnPropertySymbols(A).find(t=>t.description==="headers list"),Ode(mb,"Headers cannot be parsed"));let e=A[mb];return Ode(e),e}qde.exports={isCTLExcludingHtab:JXe,stringify:KXe,getHeadersList:$Xe}});var Hde=E((dcA,Pde)=>{"use strict";var{maxNameValuePairSize:eZe,maxAttributeValueSize:AZe}=Tde(),{isCTLExcludingHtab:tZe}=VF(),{collectASequenceOfCodePointsFast:Bb}=Kn(),rZe=require("assert");function iZe(A){if(tZe(A))return null;let e="",t="",r="",i="";if(A.includes(";")){let s={position:0};e=Bb(";",A,s),t=A.slice(s.position)}else e=A;if(!e.includes("="))i=e;else{let s={position:0};r=Bb("=",e,s),i=e.slice(s.position+1)}return r=r.trim(),i=i.trim(),r.length+i.length>eZe?null:{name:r,value:i,...Xh(t)}}function Xh(A,e={}){if(A.length===0)return e;rZe(A[0]===";"),A=A.slice(1);let t="";A.includes(";")?(t=Bb(";",A,{position:0}),A=A.slice(t.length)):(t=A,A="");let r="",i="";if(t.includes("=")){let n={position:0};r=Bb("=",t,n),i=t.slice(n.position+1)}else r=t;if(r=r.trim(),i=i.trim(),i.length>AZe)return Xh(A,e);let s=r.toLowerCase();if(s==="expires"){let n=new Date(i);e.expires=n}else if(s==="max-age"){let n=i.charCodeAt(0);if((n<48||n>57)&&i[0]!=="-"||!/^\d+$/.test(i))return Xh(A,e);let a=Number(i);e.maxAge=a}else if(s==="domain"){let n=i;n[0]==="."&&(n=n.slice(1)),n=n.toLowerCase(),e.domain=n}else if(s==="path"){let n="";i.length===0||i[0]!=="/"?n="/":n=i,e.path=n}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let n="Default",a=i.toLowerCase();a.includes("none")&&(n="None"),a.includes("strict")&&(n="Strict"),a.includes("lax")&&(n="Lax"),e.sameSite=n}else e.unparsed??=[],e.unparsed.push(`${r}=${i}`);return Xh(A,e)}Pde.exports={parseSetCookie:iZe,parseUnparsedAttributes:Xh}});var Vde=E((pcA,Jde)=>{"use strict";var{parseSetCookie:sZe}=Hde(),{stringify:Gde,getHeadersList:nZe}=VF(),{webidl:AA}=fi(),{Headers:Ib}=up();function aZe(A){AA.argumentLengthCheck(arguments,1,{header:"getCookies"}),AA.brandCheck(A,Ib,{strict:!1});let e=A.get("cookie"),t={};if(!e)return t;for(let r of e.split(";")){let[i,...s]=r.split("=");t[i.trim()]=s.join("=")}return t}function oZe(A,e,t){AA.argumentLengthCheck(arguments,2,{header:"deleteCookie"}),AA.brandCheck(A,Ib,{strict:!1}),e=AA.converters.DOMString(e),t=AA.converters.DeleteCookieAttributes(t),_de(A,{name:e,value:"",expires:new Date(0),...t})}function cZe(A){AA.argumentLengthCheck(arguments,1,{header:"getSetCookies"}),AA.brandCheck(A,Ib,{strict:!1});let e=nZe(A).cookies;return e?e.map(t=>sZe(Array.isArray(t)?t[1]:t)):[]}function _de(A,e){AA.argumentLengthCheck(arguments,2,{header:"setCookie"}),AA.brandCheck(A,Ib,{strict:!1}),e=AA.converters.Cookie(e),Gde(e)&&A.append("Set-Cookie",Gde(e))}AA.converters.DeleteCookieAttributes=AA.dictionaryConverter([{converter:AA.nullableConverter(AA.converters.DOMString),key:"path",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"domain",defaultValue:null}]);AA.converters.Cookie=AA.dictionaryConverter([{converter:AA.converters.DOMString,key:"name"},{converter:AA.converters.DOMString,key:"value"},{converter:AA.nullableConverter(A=>typeof A=="number"?AA.converters["unsigned long long"](A):new Date(A)),key:"expires",defaultValue:null},{converter:AA.nullableConverter(AA.converters["long long"]),key:"maxAge",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"domain",defaultValue:null},{converter:AA.nullableConverter(AA.converters.DOMString),key:"path",defaultValue:null},{converter:AA.nullableConverter(AA.converters.boolean),key:"secure",defaultValue:null},{converter:AA.nullableConverter(AA.converters.boolean),key:"httpOnly",defaultValue:null},{converter:AA.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:AA.sequenceConverter(AA.converters.DOMString),key:"unparsed",defaultValue:[]}]);Jde.exports={getCookies:aZe,deleteCookie:oZe,getSetCookies:cZe,setCookie:_de}});var Zh=E((ucA,Wde)=>{"use strict";var lZe="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",dZe={enumerable:!0,writable:!1,configurable:!1},pZe={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},uZe={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},gZe=2**16-1,hZe={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},EZe=Buffer.allocUnsafe(0);Wde.exports={uid:lZe,staticPropertyDescriptors:dZe,states:pZe,opcodes:uZe,maxUnsigned16Bit:gZe,parserStates:hZe,emptyBuffer:EZe}});var Pm=E((gcA,zde)=>{"use strict";zde.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var zF=E((hcA,jde)=>{"use strict";var{webidl:we}=fi(),{kEnumerableProperty:is}=aA(),{MessagePort:CZe}=require("worker_threads"),fb=class A extends Event{#e;constructor(e,t={}){we.argumentLengthCheck(arguments,1,{header:"MessageEvent constructor"}),e=we.converters.DOMString(e),t=we.converters.MessageEventInit(t),super(e,t),this.#e=t}get data(){return we.brandCheck(this,A),this.#e.data}get origin(){return we.brandCheck(this,A),this.#e.origin}get lastEventId(){return we.brandCheck(this,A),this.#e.lastEventId}get source(){return we.brandCheck(this,A),this.#e.source}get ports(){return we.brandCheck(this,A),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,t=!1,r=!1,i=null,s="",n="",a=null,o=[]){return we.brandCheck(this,A),we.argumentLengthCheck(arguments,1,{header:"MessageEvent.initMessageEvent"}),new A(e,{bubbles:t,cancelable:r,data:i,origin:s,lastEventId:n,source:a,ports:o})}},yb=class A extends Event{#e;constructor(e,t={}){we.argumentLengthCheck(arguments,1,{header:"CloseEvent constructor"}),e=we.converters.DOMString(e),t=we.converters.CloseEventInit(t),super(e,t),this.#e=t}get wasClean(){return we.brandCheck(this,A),this.#e.wasClean}get code(){return we.brandCheck(this,A),this.#e.code}get reason(){return we.brandCheck(this,A),this.#e.reason}},wb=class A extends Event{#e;constructor(e,t){we.argumentLengthCheck(arguments,1,{header:"ErrorEvent constructor"}),super(e,t),e=we.converters.DOMString(e),t=we.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return we.brandCheck(this,A),this.#e.message}get filename(){return we.brandCheck(this,A),this.#e.filename}get lineno(){return we.brandCheck(this,A),this.#e.lineno}get colno(){return we.brandCheck(this,A),this.#e.colno}get error(){return we.brandCheck(this,A),this.#e.error}};Object.defineProperties(fb.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:is,origin:is,lastEventId:is,source:is,ports:is,initMessageEvent:is});Object.defineProperties(yb.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:is,code:is,wasClean:is});Object.defineProperties(wb.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:is,filename:is,lineno:is,colno:is,error:is});we.converters.MessagePort=we.interfaceConverter(CZe);we.converters["sequence"]=we.sequenceConverter(we.converters.MessagePort);var WF=[{key:"bubbles",converter:we.converters.boolean,defaultValue:!1},{key:"cancelable",converter:we.converters.boolean,defaultValue:!1},{key:"composed",converter:we.converters.boolean,defaultValue:!1}];we.converters.MessageEventInit=we.dictionaryConverter([...WF,{key:"data",converter:we.converters.any,defaultValue:null},{key:"origin",converter:we.converters.USVString,defaultValue:""},{key:"lastEventId",converter:we.converters.DOMString,defaultValue:""},{key:"source",converter:we.nullableConverter(we.converters.MessagePort),defaultValue:null},{key:"ports",converter:we.converters["sequence"],get defaultValue(){return[]}}]);we.converters.CloseEventInit=we.dictionaryConverter([...WF,{key:"wasClean",converter:we.converters.boolean,defaultValue:!1},{key:"code",converter:we.converters["unsigned short"],defaultValue:0},{key:"reason",converter:we.converters.USVString,defaultValue:""}]);we.converters.ErrorEventInit=we.dictionaryConverter([...WF,{key:"message",converter:we.converters.DOMString,defaultValue:""},{key:"filename",converter:we.converters.USVString,defaultValue:""},{key:"lineno",converter:we.converters["unsigned long"],defaultValue:0},{key:"colno",converter:we.converters["unsigned long"],defaultValue:0},{key:"error",converter:we.converters.any}]);jde.exports={MessageEvent:fb,CloseEvent:yb,ErrorEvent:wb}});var Db=E((EcA,Kde)=>{"use strict";var{kReadyState:bb,kController:QZe,kResponse:mZe,kBinaryType:BZe,kWebSocketURL:IZe}=Pm(),{states:Nb,opcodes:Xde}=Zh(),{MessageEvent:fZe,ErrorEvent:yZe}=zF();function wZe(A){return A[bb]===Nb.OPEN}function bZe(A){return A[bb]===Nb.CLOSING}function NZe(A){return A[bb]===Nb.CLOSED}function jF(A,e,t=Event,r){let i=new t(A,r);e.dispatchEvent(i)}function DZe(A,e,t){if(A[bb]!==Nb.OPEN)return;let r;if(e===Xde.TEXT)try{r=new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch{Zde(A,"Received invalid UTF-8 in text frame.");return}else e===Xde.BINARY&&(A[BZe]==="blob"?r=new Blob([t]):r=new Uint8Array(t).buffer);jF("message",A,fZe,{origin:A[IZe].origin,data:r})}function RZe(A){if(A.length===0)return!1;for(let e of A){let t=e.charCodeAt(0);if(t<33||t>126||e==="("||e===")"||e==="<"||e===">"||e==="@"||e===","||e===";"||e===":"||e==="\\"||e==='"'||e==="/"||e==="["||e==="]"||e==="?"||e==="="||e==="{"||e==="}"||t===32||t===9)return!1}return!0}function xZe(A){return A>=1e3&&A<1015?A!==1004&&A!==1005&&A!==1006:A>=3e3&&A<=4999}function Zde(A,e){let{[QZe]:t,[mZe]:r}=A;t.abort(),r?.socket&&!r.socket.destroyed&&r.socket.destroy(),e&&jF("error",A,yZe,{error:new Error(e)})}Kde.exports={isEstablished:wZe,isClosing:bZe,isClosed:NZe,fireEvent:jF,isValidSubprotocol:RZe,isValidStatusCode:xZe,failWebsocketConnection:Zde,websocketMessageReceived:DZe}});var ipe=E((CcA,rpe)=>{"use strict";var ZF=require("diagnostics_channel"),{uid:SZe,states:epe}=Zh(),{kReadyState:Ape,kSentClose:$de,kByteParser:tpe,kReceivedClose:vZe}=Pm(),{fireEvent:kZe,failWebsocketConnection:Cp}=Db(),{CloseEvent:FZe}=zF(),{makeRequest:LZe}=Mm(),{fetching:UZe}=cb(),{Headers:MZe}=up(),{getGlobalDispatcher:TZe}=Ph(),{kHeadersList:OZe}=lt(),sc={};sc.open=ZF.channel("undici:websocket:open");sc.close=ZF.channel("undici:websocket:close");sc.socketError=ZF.channel("undici:websocket:socket_error");var XF;try{XF=require("crypto")}catch{}function YZe(A,e,t,r,i){let s=A;s.protocol=A.protocol==="ws:"?"http:":"https:";let n=LZe({urlList:[s],serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(i.headers){let l=new MZe(i.headers)[OZe];n.headersList=l}let a=XF.randomBytes(16).toString("base64");n.headersList.append("sec-websocket-key",a),n.headersList.append("sec-websocket-version","13");for(let l of e)n.headersList.append("sec-websocket-protocol",l);let o="";return UZe({request:n,useParallelQueue:!0,dispatcher:i.dispatcher??TZe(),processResponse(l){if(l.type==="error"||l.status!==101){Cp(t,"Received network error or non-101 status code.");return}if(e.length!==0&&!l.headersList.get("Sec-WebSocket-Protocol")){Cp(t,"Server did not respond with sent protocols.");return}if(l.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Cp(t,'Server did not set Upgrade header to "websocket".');return}if(l.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Cp(t,'Server did not set Connection header to "upgrade".');return}let d=l.headersList.get("Sec-WebSocket-Accept"),p=XF.createHash("sha1").update(a+SZe).digest("base64");if(d!==p){Cp(t,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let u=l.headersList.get("Sec-WebSocket-Extensions");if(u!==null&&u!==o){Cp(t,"Received different permessage-deflate than the one set.");return}let g=l.headersList.get("Sec-WebSocket-Protocol");if(g!==null&&g!==n.headersList.get("Sec-WebSocket-Protocol")){Cp(t,"Protocol was not set in the opening handshake.");return}l.socket.on("data",qZe),l.socket.on("close",PZe),l.socket.on("error",HZe),sc.open.hasSubscribers&&sc.open.publish({address:l.socket.address(),protocol:g,extensions:u}),r(l)}})}function qZe(A){this.ws[tpe].write(A)||this.pause()}function PZe(){let{ws:A}=this,e=A[$de]&&A[vZe],t=1005,r="",i=A[tpe].closingInfo;i?(t=i.code??1005,r=i.reason):A[$de]||(t=1006),A[Ape]=epe.CLOSED,kZe("close",A,FZe,{wasClean:e,code:t,reason:r}),sc.close.hasSubscribers&&sc.close.publish({websocket:A,code:t,reason:r})}function HZe(A){let{ws:e}=this;e[Ape]=epe.CLOSING,sc.socketError.hasSubscribers&&sc.socketError.publish(A),this.destroy()}rpe.exports={establishWebSocketConnection:YZe}});var $F=E((QcA,npe)=>{"use strict";var{maxUnsigned16Bit:GZe}=Zh(),spe;try{spe=require("crypto")}catch{}var KF=class{constructor(e){this.frameData=e,this.maskKey=spe.randomBytes(4)}createFrame(e){let t=this.frameData?.byteLength??0,r=t,i=6;t>GZe?(i+=8,r=127):t>125&&(i+=2,r=126);let s=Buffer.allocUnsafe(t+i);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+e;s[i-4]=this.maskKey[0],s[i-3]=this.maskKey[1],s[i-2]=this.maskKey[2],s[i-1]=this.maskKey[3],s[1]=r,r===126?s.writeUInt16BE(t,2):r===127&&(s[2]=s[3]=0,s.writeUIntBE(t,4,6)),s[1]|=128;for(let n=0;n{"use strict";var{Writable:_Ze}=require("stream"),ppe=require("diagnostics_channel"),{parserStates:wn,opcodes:bn,states:JZe,emptyBuffer:VZe}=Zh(),{kReadyState:WZe,kSentClose:ape,kResponse:ope,kReceivedClose:cpe}=Pm(),{isValidStatusCode:lpe,failWebsocketConnection:Hm,websocketMessageReceived:zZe}=Db(),{WebsocketFrameSend:dpe}=$F(),Kh={};Kh.ping=ppe.channel("undici:websocket:ping");Kh.pong=ppe.channel("undici:websocket:pong");var e7=class extends _Ze{#e=[];#t=0;#r=wn.INFO;#A={};#i=[];constructor(e){super(),this.ws=e}_write(e,t,r){this.#e.push(e),this.#t+=e.length,this.run(r)}run(e){for(;;){if(this.#r===wn.INFO){if(this.#t<2)return e();let t=this.consume(2);if(this.#A.fin=(t[0]&128)!==0,this.#A.opcode=t[0]&15,this.#A.originalOpcode??=this.#A.opcode,this.#A.fragmented=!this.#A.fin&&this.#A.opcode!==bn.CONTINUATION,this.#A.fragmented&&this.#A.opcode!==bn.BINARY&&this.#A.opcode!==bn.TEXT){Hm(this.ws,"Invalid frame type was fragmented.");return}let r=t[1]&127;if(r<=125?(this.#A.payloadLength=r,this.#r=wn.READ_DATA):r===126?this.#r=wn.PAYLOADLENGTH_16:r===127&&(this.#r=wn.PAYLOADLENGTH_64),this.#A.fragmented&&r>125){Hm(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#A.opcode===bn.PING||this.#A.opcode===bn.PONG||this.#A.opcode===bn.CLOSE)&&r>125){Hm(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#A.opcode===bn.CLOSE){if(r===1){Hm(this.ws,"Received close frame with a 1-byte body.");return}let i=this.consume(r);if(this.#A.closeInfo=this.parseCloseBody(!1,i),!this.ws[ape]){let s=Buffer.allocUnsafe(2);s.writeUInt16BE(this.#A.closeInfo.code,0);let n=new dpe(s);this.ws[ope].socket.write(n.createFrame(bn.CLOSE),a=>{a||(this.ws[ape]=!0)})}this.ws[WZe]=JZe.CLOSING,this.ws[cpe]=!0,this.end();return}else if(this.#A.opcode===bn.PING){let i=this.consume(r);if(!this.ws[cpe]){let s=new dpe(i);this.ws[ope].socket.write(s.createFrame(bn.PONG)),Kh.ping.hasSubscribers&&Kh.ping.publish({payload:i})}if(this.#r=wn.INFO,this.#t>0)continue;e();return}else if(this.#A.opcode===bn.PONG){let i=this.consume(r);if(Kh.pong.hasSubscribers&&Kh.pong.publish({payload:i}),this.#t>0)continue;e();return}}else if(this.#r===wn.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#A.payloadLength=t.readUInt16BE(0),this.#r=wn.READ_DATA}else if(this.#r===wn.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),r=t.readUInt32BE(0);if(r>2**31-1){Hm(this.ws,"Received payload length > 2^31 bytes.");return}let i=t.readUInt32BE(4);this.#A.payloadLength=(r<<8)+i,this.#r=wn.READ_DATA}else if(this.#r===wn.READ_DATA){if(this.#t=this.#A.payloadLength){let t=this.consume(this.#A.payloadLength);if(this.#i.push(t),!this.#A.fragmented||this.#A.fin&&this.#A.opcode===bn.CONTINUATION){let r=Buffer.concat(this.#i);zZe(this.ws,this.#A.originalOpcode,r),this.#A={},this.#i.length=0}this.#r=wn.INFO}}if(!(this.#t>0)){e();break}}}consume(e){if(e>this.#t)return null;if(e===0)return VZe;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let t=Buffer.allocUnsafe(e),r=0;for(;r!==e;){let i=this.#e[0],{length:s}=i;if(s+r===e){t.set(this.#e.shift(),r);break}else if(s+r>e){t.set(i.subarray(0,e-r),r),this.#e[0]=i.subarray(e-r);break}else t.set(this.#e.shift(),r),r+=i.length}return this.#t-=e,t}parseCloseBody(e,t){let r;if(t.length>=2&&(r=t.readUInt16BE(0)),e)return lpe(r)?{code:r}:null;let i=t.subarray(2);if(i[0]===239&&i[1]===187&&i[2]===191&&(i=i.subarray(3)),r!==void 0&&!lpe(r))return null;try{i=new TextDecoder("utf-8",{fatal:!0}).decode(i)}catch{return null}return{code:r,reason:i}}get closingInfo(){return this.#A.closeInfo}};upe.exports={ByteParser:e7}});var fpe=E((BcA,Ipe)=>{"use strict";var{webidl:ke}=fi(),{DOMException:kl}=yl(),{URLSerializer:jZe}=Kn(),{getGlobalOrigin:XZe}=Ch(),{staticPropertyDescriptors:Fl,states:$h,opcodes:Gm,emptyBuffer:ZZe}=Zh(),{kWebSocketURL:hpe,kReadyState:nc,kController:KZe,kBinaryType:Rb,kResponse:xb,kSentClose:$Ze,kByteParser:eKe}=Pm(),{isEstablished:Epe,isClosing:Cpe,isValidSubprotocol:AKe,failWebsocketConnection:tKe,fireEvent:rKe}=Db(),{establishWebSocketConnection:iKe}=ipe(),{WebsocketFrameSend:_m}=$F(),{ByteParser:sKe}=gpe(),{kEnumerableProperty:Nn,isBlobLike:mpe}=aA(),{getGlobalDispatcher:nKe}=Ph(),{types:Bpe}=require("util"),Qpe=!1,_s=class A extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#r="";#A="";constructor(e,t=[]){super(),ke.argumentLengthCheck(arguments,1,{header:"WebSocket constructor"}),Qpe||(Qpe=!0,process.emitWarning("WebSockets are experimental, expect them to change at any time.",{code:"UNDICI-WS"}));let r=ke.converters["DOMString or sequence or WebSocketInit"](t);e=ke.converters.USVString(e),t=r.protocols;let i=XZe(),s;try{s=new URL(e,i)}catch(n){throw new kl(n,"SyntaxError")}if(s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),s.protocol!=="ws:"&&s.protocol!=="wss:")throw new kl(`Expected a ws: or wss: protocol, got ${s.protocol}`,"SyntaxError");if(s.hash||s.href.endsWith("#"))throw new kl("Got fragment","SyntaxError");if(typeof t=="string"&&(t=[t]),t.length!==new Set(t.map(n=>n.toLowerCase())).size)throw new kl("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(t.length>0&&!t.every(n=>AKe(n)))throw new kl("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[hpe]=new URL(s.href),this[KZe]=iKe(s,t,this,n=>this.#i(n),r),this[nc]=A.CONNECTING,this[Rb]="blob"}close(e=void 0,t=void 0){if(ke.brandCheck(this,A),e!==void 0&&(e=ke.converters["unsigned short"](e,{clamp:!0})),t!==void 0&&(t=ke.converters.USVString(t)),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new kl("invalid code","InvalidAccessError");let r=0;if(t!==void 0&&(r=Buffer.byteLength(t),r>123))throw new kl(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError");if(!(this[nc]===A.CLOSING||this[nc]===A.CLOSED))if(!Epe(this))tKe(this,"Connection was closed before it was established."),this[nc]=A.CLOSING;else if(Cpe(this))this[nc]=A.CLOSING;else{let i=new _m;e!==void 0&&t===void 0?(i.frameData=Buffer.allocUnsafe(2),i.frameData.writeUInt16BE(e,0)):e!==void 0&&t!==void 0?(i.frameData=Buffer.allocUnsafe(2+r),i.frameData.writeUInt16BE(e,0),i.frameData.write(t,2,"utf-8")):i.frameData=ZZe,this[xb].socket.write(i.createFrame(Gm.CLOSE),n=>{n||(this[$Ze]=!0)}),this[nc]=$h.CLOSING}}send(e){if(ke.brandCheck(this,A),ke.argumentLengthCheck(arguments,1,{header:"WebSocket.send"}),e=ke.converters.WebSocketSendData(e),this[nc]===A.CONNECTING)throw new kl("Sent before connected.","InvalidStateError");if(!Epe(this)||Cpe(this))return;let t=this[xb].socket;if(typeof e=="string"){let r=Buffer.from(e),s=new _m(r).createFrame(Gm.TEXT);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(Bpe.isArrayBuffer(e)){let r=Buffer.from(e),s=new _m(r).createFrame(Gm.BINARY);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(ArrayBuffer.isView(e)){let r=Buffer.from(e,e.byteOffset,e.byteLength),s=new _m(r).createFrame(Gm.BINARY);this.#t+=r.byteLength,t.write(s,()=>{this.#t-=r.byteLength})}else if(mpe(e)){let r=new _m;e.arrayBuffer().then(i=>{let s=Buffer.from(i);r.frameData=s;let n=r.createFrame(Gm.BINARY);this.#t+=s.byteLength,t.write(n,()=>{this.#t-=s.byteLength})})}}get readyState(){return ke.brandCheck(this,A),this[nc]}get bufferedAmount(){return ke.brandCheck(this,A),this.#t}get url(){return ke.brandCheck(this,A),jZe(this[hpe])}get extensions(){return ke.brandCheck(this,A),this.#A}get protocol(){return ke.brandCheck(this,A),this.#r}get onopen(){return ke.brandCheck(this,A),this.#e.open}set onopen(e){ke.brandCheck(this,A),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return ke.brandCheck(this,A),this.#e.error}set onerror(e){ke.brandCheck(this,A),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return ke.brandCheck(this,A),this.#e.close}set onclose(e){ke.brandCheck(this,A),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return ke.brandCheck(this,A),this.#e.message}set onmessage(e){ke.brandCheck(this,A),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return ke.brandCheck(this,A),this[Rb]}set binaryType(e){ke.brandCheck(this,A),e!=="blob"&&e!=="arraybuffer"?this[Rb]="blob":this[Rb]=e}#i(e){this[xb]=e;let t=new sKe(this);t.on("drain",function(){this.ws[xb].socket.resume()}),e.socket.ws=this,this[eKe]=t,this[nc]=$h.OPEN;let r=e.headersList.get("sec-websocket-extensions");r!==null&&(this.#A=r);let i=e.headersList.get("sec-websocket-protocol");i!==null&&(this.#r=i),rKe("open",this)}};_s.CONNECTING=_s.prototype.CONNECTING=$h.CONNECTING;_s.OPEN=_s.prototype.OPEN=$h.OPEN;_s.CLOSING=_s.prototype.CLOSING=$h.CLOSING;_s.CLOSED=_s.prototype.CLOSED=$h.CLOSED;Object.defineProperties(_s.prototype,{CONNECTING:Fl,OPEN:Fl,CLOSING:Fl,CLOSED:Fl,url:Nn,readyState:Nn,bufferedAmount:Nn,onopen:Nn,onerror:Nn,onclose:Nn,close:Nn,onmessage:Nn,binaryType:Nn,send:Nn,extensions:Nn,protocol:Nn,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(_s,{CONNECTING:Fl,OPEN:Fl,CLOSING:Fl,CLOSED:Fl});ke.converters["sequence"]=ke.sequenceConverter(ke.converters.DOMString);ke.converters["DOMString or sequence"]=function(A){return ke.util.Type(A)==="Object"&&Symbol.iterator in A?ke.converters["sequence"](A):ke.converters.DOMString(A)};ke.converters.WebSocketInit=ke.dictionaryConverter([{key:"protocols",converter:ke.converters["DOMString or sequence"],get defaultValue(){return[]}},{key:"dispatcher",converter:A=>A,get defaultValue(){return nKe()}},{key:"headers",converter:ke.nullableConverter(ke.converters.HeadersInit)}]);ke.converters["DOMString or sequence or WebSocketInit"]=function(A){return ke.util.Type(A)==="Object"&&!(Symbol.iterator in A)?ke.converters.WebSocketInit(A):{protocols:ke.converters["DOMString or sequence"](A)}};ke.converters.WebSocketSendData=function(A){if(ke.util.Type(A)==="Object"){if(mpe(A))return ke.converters.Blob(A,{strict:!1});if(ArrayBuffer.isView(A)||Bpe.isAnyArrayBuffer(A))return ke.converters.BufferSource(A)}return ke.converters.USVString(A)};Ipe.exports={WebSocket:_s}});var Npe=E((IcA,He)=>{"use strict";var aKe=wm(),ype=gw(),wpe=WA(),oKe=vh(),cKe=Hoe(),lKe=Rm(),Qp=aA(),{InvalidArgumentError:Sb}=wpe,eE=Fce(),dKe=Em(),pKe=cF(),uKe=hle(),gKe=pF(),hKe=Zk(),EKe=Ile(),{getGlobalDispatcher:bpe,setGlobalDispatcher:CKe}=Ph(),QKe=Dle(),mKe=ok(),BKe=Qw(),A7;try{require("crypto"),A7=!0}catch{A7=!1}Object.assign(ype.prototype,eE);He.exports.Dispatcher=ype;He.exports.Client=aKe;He.exports.Pool=oKe;He.exports.BalancedPool=cKe;He.exports.Agent=lKe;He.exports.ProxyAgent=EKe;He.exports.DecoratorHandler=QKe;He.exports.RedirectHandler=mKe;He.exports.createRedirectInterceptor=BKe;He.exports.buildConnector=dKe;He.exports.errors=wpe;function Jm(A){return(e,t,r)=>{if(typeof t=="function"&&(r=t,t=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new Sb("invalid url");if(t!=null&&typeof t!="object")throw new Sb("invalid opts");if(t&&t.path!=null){if(typeof t.path!="string")throw new Sb("invalid opts.path");let n=t.path;t.path.startsWith("/")||(n=`/${n}`),e=new URL(Qp.parseOrigin(e).origin+n)}else t||(t=typeof e=="object"?e:{}),e=Qp.parseURL(e);let{agent:i,dispatcher:s=bpe()}=t;if(i)throw new Sb("unsupported opts.agent. Did you mean opts.client?");return A.call(s,{...t,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:t.method||(t.body?"PUT":"GET")},r)}}He.exports.setGlobalDispatcher=CKe;He.exports.getGlobalDispatcher=bpe;if(Qp.nodeMajor>16||Qp.nodeMajor===16&&Qp.nodeMinor>=8){let A=null;He.exports.fetch=async function(n){A||(A=cb().fetch);try{return await A(...arguments)}catch(a){throw typeof a=="object"&&Error.captureStackTrace(a,this),a}},He.exports.Headers=up().Headers,He.exports.Response=$w().Response,He.exports.Request=Mm().Request,He.exports.FormData=pw().FormData,He.exports.File=lw().File,He.exports.FileReader=yde().FileReader;let{setGlobalOrigin:e,getGlobalOrigin:t}=Ch();He.exports.setGlobalOrigin=e,He.exports.getGlobalOrigin=t;let{CacheStorage:r}=Ude(),{kConstruct:i}=ub();He.exports.caches=new r(i)}if(Qp.nodeMajor>=16){let{deleteCookie:A,getCookies:e,getSetCookies:t,setCookie:r}=Vde();He.exports.deleteCookie=A,He.exports.getCookies=e,He.exports.getSetCookies=t,He.exports.setCookie=r;let{parseMIMEType:i,serializeAMimeType:s}=Kn();He.exports.parseMIMEType=i,He.exports.serializeAMimeType=s}if(Qp.nodeMajor>=18&&A7){let{WebSocket:A}=fpe();He.exports.WebSocket=A}He.exports.request=Jm(eE.request);He.exports.stream=Jm(eE.stream);He.exports.pipeline=Jm(eE.pipeline);He.exports.connect=Jm(eE.connect);He.exports.upgrade=Jm(eE.upgrade);He.exports.MockClient=pKe;He.exports.MockPool=gKe;He.exports.MockAgent=uKe;He.exports.mockErrors=hKe});var Dpe=E(jA=>{"use strict";var IKe=jA&&jA.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,i)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),fKe=jA&&jA.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),Mb=jA&&jA.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&IKe(e,A,t);return fKe(e,A),e},Ht=jA&&jA.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})};Object.defineProperty(jA,"__esModule",{value:!0});jA.HttpClient=jA.isHttps=jA.HttpClientResponse=jA.HttpClientError=jA.getProxyUrl=jA.MediaTypes=jA.Headers=jA.HttpCodes=void 0;var vb=Mb(require("http")),t7=Mb(require("https")),r7=Mb(cne()),kb=Mb(lE()),yKe=Npe(),Dn;(function(A){A[A.OK=200]="OK",A[A.MultipleChoices=300]="MultipleChoices",A[A.MovedPermanently=301]="MovedPermanently",A[A.ResourceMoved=302]="ResourceMoved",A[A.SeeOther=303]="SeeOther",A[A.NotModified=304]="NotModified",A[A.UseProxy=305]="UseProxy",A[A.SwitchProxy=306]="SwitchProxy",A[A.TemporaryRedirect=307]="TemporaryRedirect",A[A.PermanentRedirect=308]="PermanentRedirect",A[A.BadRequest=400]="BadRequest",A[A.Unauthorized=401]="Unauthorized",A[A.PaymentRequired=402]="PaymentRequired",A[A.Forbidden=403]="Forbidden",A[A.NotFound=404]="NotFound",A[A.MethodNotAllowed=405]="MethodNotAllowed",A[A.NotAcceptable=406]="NotAcceptable",A[A.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",A[A.RequestTimeout=408]="RequestTimeout",A[A.Conflict=409]="Conflict",A[A.Gone=410]="Gone",A[A.TooManyRequests=429]="TooManyRequests",A[A.InternalServerError=500]="InternalServerError",A[A.NotImplemented=501]="NotImplemented",A[A.BadGateway=502]="BadGateway",A[A.ServiceUnavailable=503]="ServiceUnavailable",A[A.GatewayTimeout=504]="GatewayTimeout"})(Dn||(jA.HttpCodes=Dn={}));var ai;(function(A){A.Accept="accept",A.ContentType="content-type"})(ai||(jA.Headers=ai={}));var ac;(function(A){A.ApplicationJson="application/json"})(ac||(jA.MediaTypes=ac={}));function wKe(A){let e=r7.getProxyUrl(new URL(A));return e?e.href:""}jA.getProxyUrl=wKe;var bKe=[Dn.MovedPermanently,Dn.ResourceMoved,Dn.SeeOther,Dn.TemporaryRedirect,Dn.PermanentRedirect],NKe=[Dn.BadGateway,Dn.ServiceUnavailable,Dn.GatewayTimeout],DKe=["OPTIONS","GET","DELETE","HEAD"],RKe=10,xKe=5,Lb=class A extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,A.prototype)}};jA.HttpClientError=Lb;var Ub=class{constructor(e){this.message=e}readBody(){return Ht(this,void 0,void 0,function*(){return new Promise(e=>Ht(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",r=>{t=Buffer.concat([t,r])}),this.message.on("end",()=>{e(t.toString())})}))})}readBodyBuffer(){return Ht(this,void 0,void 0,function*(){return new Promise(e=>Ht(this,void 0,void 0,function*(){let t=[];this.message.on("data",r=>{t.push(r)}),this.message.on("end",()=>{e(Buffer.concat(t))})}))})}};jA.HttpClientResponse=Ub;function SKe(A){return new URL(A).protocol==="https:"}jA.isHttps=SKe;var i7=class{constructor(e,t,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=e,this.handlers=t||[],this.requestOptions=r,r&&(r.ignoreSslError!=null&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,r.allowRedirects!=null&&(this._allowRedirects=r.allowRedirects),r.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),r.maxRedirects!=null&&(this._maxRedirects=Math.max(r.maxRedirects,0)),r.keepAlive!=null&&(this._keepAlive=r.keepAlive),r.allowRetries!=null&&(this._allowRetries=r.allowRetries),r.maxRetries!=null&&(this._maxRetries=r.maxRetries))}options(e,t){return Ht(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return Ht(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return Ht(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("POST",e,t,r||{})})}patch(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("PATCH",e,t,r||{})})}put(e,t,r){return Ht(this,void 0,void 0,function*(){return this.request("PUT",e,t,r||{})})}head(e,t){return Ht(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,r,i){return Ht(this,void 0,void 0,function*(){return this.request(e,t,r,i)})}getJson(e,t={}){return Ht(this,void 0,void 0,function*(){t[ai.Accept]=this._getExistingOrDefaultHeader(t,ai.Accept,ac.ApplicationJson);let r=yield this.get(e,t);return this._processResponse(r,this.requestOptions)})}postJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ai.Accept]=this._getExistingOrDefaultHeader(r,ai.Accept,ac.ApplicationJson),r[ai.ContentType]=this._getExistingOrDefaultHeader(r,ai.ContentType,ac.ApplicationJson);let s=yield this.post(e,i,r);return this._processResponse(s,this.requestOptions)})}putJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ai.Accept]=this._getExistingOrDefaultHeader(r,ai.Accept,ac.ApplicationJson),r[ai.ContentType]=this._getExistingOrDefaultHeader(r,ai.ContentType,ac.ApplicationJson);let s=yield this.put(e,i,r);return this._processResponse(s,this.requestOptions)})}patchJson(e,t,r={}){return Ht(this,void 0,void 0,function*(){let i=JSON.stringify(t,null,2);r[ai.Accept]=this._getExistingOrDefaultHeader(r,ai.Accept,ac.ApplicationJson),r[ai.ContentType]=this._getExistingOrDefaultHeader(r,ai.ContentType,ac.ApplicationJson);let s=yield this.patch(e,i,r);return this._processResponse(s,this.requestOptions)})}request(e,t,r,i){return Ht(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let s=new URL(t),n=this._prepareRequest(e,s,i),a=this._allowRetries&&DKe.includes(e)?this._maxRetries+1:1,o=0,c;do{if(c=yield this.requestRaw(n,r),c&&c.message&&c.message.statusCode===Dn.Unauthorized){let d;for(let p of this.handlers)if(p.canHandleAuthentication(c)){d=p;break}return d?d.handleAuthentication(this,n,r):c}let l=this._maxRedirects;for(;c.message.statusCode&&bKe.includes(c.message.statusCode)&&this._allowRedirects&&l>0;){let d=c.message.headers.location;if(!d)break;let p=new URL(d);if(s.protocol==="https:"&&s.protocol!==p.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield c.readBody(),p.hostname!==s.hostname)for(let u in i)u.toLowerCase()==="authorization"&&delete i[u];n=this._prepareRequest(e,p,i),c=yield this.requestRaw(n,r),l--}if(!c.message.statusCode||!NKe.includes(c.message.statusCode))return c;o+=1,o{function s(n,a){n?i(n):a?r(a):i(new Error("Unknown error"))}this.requestRawWithCallback(e,t,s)})})}requestRawWithCallback(e,t,r){typeof t=="string"&&(e.options.headers||(e.options.headers={}),e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let i=!1;function s(o,c){i||(i=!0,r(o,c))}let n=e.httpModule.request(e.options,o=>{let c=new Ub(o);s(void 0,c)}),a;n.on("socket",o=>{a=o}),n.setTimeout(this._socketTimeout||3*6e4,()=>{a&&a.end(),s(new Error(`Request timeout: ${e.options.path}`))}),n.on("error",function(o){s(o)}),t&&typeof t=="string"&&n.write(t,"utf8"),t&&typeof t!="string"?(t.on("close",function(){n.end()}),t.pipe(n)):n.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),r=r7.getProxyUrl(t);if(r&&r.hostname)return this._getProxyAgentDispatcher(t,r)}_prepareRequest(e,t,r){let i={};i.parsedUrl=t;let s=i.parsedUrl.protocol==="https:";i.httpModule=s?t7:vb;let n=s?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):n,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=e,i.options.headers=this._mergeHeaders(r),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(let a of this.handlers)a.prepareRequest(i.options);return i}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Fb(this.requestOptions.headers),Fb(e||{})):Fb(e||{})}_getExistingOrDefaultHeader(e,t,r){let i;return this.requestOptions&&this.requestOptions.headers&&(i=Fb(this.requestOptions.headers)[t]),e[t]||i||r}_getAgent(e){let t,r=r7.getProxyUrl(e),i=r&&r.hostname;if(this._keepAlive&&i&&(t=this._proxyAgent),this._keepAlive&&!i&&(t=this._agent),t)return t;let s=e.protocol==="https:",n=100;if(this.requestOptions&&(n=this.requestOptions.maxSockets||vb.globalAgent.maxSockets),r&&r.hostname){let a={maxSockets:n,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})},o,c=r.protocol==="https:";s?o=c?kb.httpsOverHttps:kb.httpsOverHttp:o=c?kb.httpOverHttps:kb.httpOverHttp,t=o(a),this._proxyAgent=t}if(this._keepAlive&&!t){let a={keepAlive:this._keepAlive,maxSockets:n};t=s?new t7.Agent(a):new vb.Agent(a),this._agent=t}return t||(t=s?t7.globalAgent:vb.globalAgent),s&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_getProxyAgentDispatcher(e,t){let r;if(this._keepAlive&&(r=this._proxyAgentDispatcher),r)return r;let i=e.protocol==="https:";return r=new yKe.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(t.username||t.password)&&{token:`${t.username}:${t.password}`})),this._proxyAgentDispatcher=r,i&&this._ignoreSslError&&(r.options=Object.assign(r.options.requestTls||{},{rejectUnauthorized:!1})),r}_performExponentialBackoff(e){return Ht(this,void 0,void 0,function*(){e=Math.min(RKe,e);let t=xKe*Math.pow(2,e);return new Promise(r=>setTimeout(()=>r(),t))})}_processResponse(e,t){return Ht(this,void 0,void 0,function*(){return new Promise((r,i)=>Ht(this,void 0,void 0,function*(){let s=e.message.statusCode||0,n={statusCode:s,result:null,headers:{}};s===Dn.NotFound&&r(n);function a(l,d){if(typeof d=="string"){let p=new Date(d);if(!isNaN(p.valueOf()))return p}return d}let o,c;try{c=yield e.readBody(),c&&c.length>0&&(t&&t.deserializeDates?o=JSON.parse(c,a):o=JSON.parse(c),n.result=o),n.headers=e.message.headers}catch{}if(s>299){let l;o&&o.message?l=o.message:c&&c.length>0?l=c:l=`Failed request: (${s})`;let d=new Lb(l,s);d.result=n.result,i(d)}else r(n)}))})}};jA.HttpClient=i7;var Fb=A=>Object.keys(A).reduce((e,t)=>(e[t.toLowerCase()]=A[t],e),{})});var Spe=E(Rn=>{"use strict";var vKe=Rn&&Rn.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),kKe=Rn&&Rn.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),FKe=Rn&&Rn.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&vKe(e,A,t);return kKe(e,A),e},Rpe=Rn&&Rn.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.RetryHelper=void 0;var xpe=FKe(ur()),s7=class{constructor(e,t,r){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,t){return Rpe(this,void 0,void 0,function*(){let r=1;for(;rsetTimeout(t,e*1e3))})}};Rn.RetryHelper=s7});var Ope=E(Ge=>{"use strict";var LKe=Ge&&Ge.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),UKe=Ge&&Ge.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),$a=Ge&&Ge.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&LKe(e,A,t);return UKe(e,A),e},Ri=Ge&&Ge.__awaiter||function(A,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(l){try{c(r.next(l))}catch(d){n(d)}}function o(l){try{c(r.throw(l))}catch(d){n(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,o)}c((r=r.apply(A,e||[])).next())})},MKe=Ge&&Ge.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.evaluateVersions=Ge.isExplicitVersion=Ge.findFromManifest=Ge.getManifestFromRepo=Ge.findAllVersions=Ge.find=Ge.cacheFile=Ge.cacheDir=Ge.extractZip=Ge.extractXar=Ge.extractTar=Ge.extract7z=Ge.downloadTool=Ge.HTTPError=void 0;var cA=$a(ur()),Js=$a(ZE()),xn=$a(require("fs")),TKe=$a(ane()),Wm=$a(require("os")),ta=$a(require("path")),vpe=$a(Dpe()),oc=$a(nf()),OKe=$a(require("stream")),YKe=$a(require("util")),AE=require("assert"),kpe=MKe(PR()),Ll=KE(),qKe=Spe(),Vm=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};Ge.HTTPError=Vm;var a7=process.platform==="win32",PKe=process.platform==="darwin",HKe="actions/tool-cache";function GKe(A,e,t,r){return Ri(this,void 0,void 0,function*(){e=e||ta.join(Tpe(),kpe.default()),yield Js.mkdirP(ta.dirname(e)),cA.debug(`Downloading ${A}`),cA.debug(`Destination ${e}`);let i=3,s=n7("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),n=n7("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new qKe.RetryHelper(i,s,n).execute(()=>Ri(this,void 0,void 0,function*(){return yield _Ke(A,e||"",t,r)}),o=>!(o instanceof Vm&&o.httpStatusCode&&o.httpStatusCode<500&&o.httpStatusCode!==408&&o.httpStatusCode!==429))})}Ge.downloadTool=GKe;function _Ke(A,e,t,r){return Ri(this,void 0,void 0,function*(){if(xn.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let i=new vpe.HttpClient(HKe,[],{allowRetries:!1});t&&(cA.debug("set auth"),r===void 0&&(r={}),r.authorization=t);let s=yield i.get(A,r);if(s.message.statusCode!==200){let l=new Vm(s.message.statusCode);throw cA.debug(`Failed to download from "${A}". Code(${s.message.statusCode}) Message(${s.message.statusMessage})`),l}let n=YKe.promisify(OKe.pipeline),o=n7("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>s.message)(),c=!1;try{return yield n(o,xn.createWriteStream(e)),cA.debug("download complete"),c=!0,e}finally{if(!c){cA.debug("download failed");try{yield Js.rmRF(e)}catch(l){cA.debug(`Failed to delete '${e}'. ${l.message}`)}}}})}function JKe(A,e,t){return Ri(this,void 0,void 0,function*(){AE.ok(a7,"extract7z() not supported on current OS"),AE.ok(A,'parameter "file" is required'),e=yield Tb(e);let r=process.cwd();if(process.chdir(e),t)try{let s=["x",cA.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",A],n={silent:!0};yield Ll.exec(`"${t}"`,s,n)}finally{process.chdir(r)}else{let i=ta.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),s=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),n=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${i}' -Source '${s}' -Target '${n}'`],c={silent:!0};try{let l=yield Js.which("powershell",!0);yield Ll.exec(`"${l}"`,o,c)}finally{process.chdir(r)}}return e})}Ge.extract7z=JKe;function VKe(A,e,t="xz"){return Ri(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");e=yield Tb(e),cA.debug("Checking tar --version");let r="";yield Ll.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:o=>r+=o.toString(),stderr:o=>r+=o.toString()}}),cA.debug(r.trim());let i=r.toUpperCase().includes("GNU TAR"),s;t instanceof Array?s=t:s=[t],cA.isDebug()&&!t.includes("v")&&s.push("-v");let n=e,a=A;return a7&&i&&(s.push("--force-local"),n=e.replace(/\\/g,"/"),a=A.replace(/\\/g,"/")),i&&(s.push("--warning=no-unknown-keyword"),s.push("--overwrite")),s.push("-C",n,"-f",a),yield Ll.exec("tar",s),e})}Ge.extractTar=VKe;function WKe(A,e,t=[]){return Ri(this,void 0,void 0,function*(){AE.ok(PKe,"extractXar() not supported on current OS"),AE.ok(A,'parameter "file" is required'),e=yield Tb(e);let r;t instanceof Array?r=t:r=[t],r.push("-x","-C",e,"-f",A),cA.isDebug()&&r.push("-v");let i=yield Js.which("xar",!0);return yield Ll.exec(`"${i}"`,t$e(r)),e})}Ge.extractXar=WKe;function zKe(A,e){return Ri(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");return e=yield Tb(e),a7?yield jKe(A,e):yield XKe(A,e),e})}Ge.extractZip=zKe;function jKe(A,e){return Ri(this,void 0,void 0,function*(){let t=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),r=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=yield Js.which("pwsh",!1);if(i){let n=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(" ")];cA.debug(`Using pwsh at path: ${i}`),yield Ll.exec(`"${i}"`,n)}else{let n=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`].join(" ")],a=yield Js.which("powershell",!0);cA.debug(`Using powershell at path: ${a}`),yield Ll.exec(`"${a}"`,n)}})}function XKe(A,e){return Ri(this,void 0,void 0,function*(){let t=yield Js.which("unzip",!0),r=[A];cA.isDebug()||r.unshift("-q"),r.unshift("-o"),yield Ll.exec(`"${t}"`,r,{cwd:e})})}function ZKe(A,e,t,r){return Ri(this,void 0,void 0,function*(){if(t=oc.clean(t)||t,r=r||Wm.arch(),cA.debug(`Caching tool ${e} ${t} ${r}`),cA.debug(`source dir: ${A}`),!xn.statSync(A).isDirectory())throw new Error("sourceDir is not a directory");let i=yield Lpe(e,t,r);for(let s of xn.readdirSync(A)){let n=ta.join(A,s);yield Js.cp(n,i,{recursive:!0})}return Upe(e,t,r),i})}Ge.cacheDir=ZKe;function KKe(A,e,t,r,i){return Ri(this,void 0,void 0,function*(){if(r=oc.clean(r)||r,i=i||Wm.arch(),cA.debug(`Caching tool ${t} ${r} ${i}`),cA.debug(`source file: ${A}`),!xn.statSync(A).isFile())throw new Error("sourceFile is not a file");let s=yield Lpe(t,r,i),n=ta.join(s,e);return cA.debug(`destination file ${n}`),yield Js.cp(A,n),Upe(t,r,i),s})}Ge.cacheFile=KKe;function $Ke(A,e,t){if(!A)throw new Error("toolName parameter is required");if(!e)throw new Error("versionSpec parameter is required");if(t=t||Wm.arch(),!o7(e)){let i=Fpe(A,t);e=Mpe(i,e)}let r="";if(e){e=oc.clean(e)||"";let i=ta.join(Ob(),A,e,t);cA.debug(`checking cache: ${i}`),xn.existsSync(i)&&xn.existsSync(`${i}.complete`)?(cA.debug(`Found tool in cache ${A} ${e} ${t}`),r=i):cA.debug("not found")}return r}Ge.find=$Ke;function Fpe(A,e){let t=[];e=e||Wm.arch();let r=ta.join(Ob(),A);if(xn.existsSync(r)){let i=xn.readdirSync(r);for(let s of i)if(o7(s)){let n=ta.join(r,s,e||"");xn.existsSync(n)&&xn.existsSync(`${n}.complete`)&&t.push(s)}}return t}Ge.findAllVersions=Fpe;function e$e(A,e,t,r="master"){return Ri(this,void 0,void 0,function*(){let i=[],s=`https://api.github.com/repos/${A}/${e}/git/trees/${r}`,n=new vpe.HttpClient("tool-cache"),a={};t&&(cA.debug("set auth"),a.authorization=t);let o=yield n.getJson(s,a);if(!o.result)return i;let c="";for(let d of o.result.tree)if(d.path==="versions-manifest.json"){c=d.url;break}a.accept="application/vnd.github.VERSION.raw";let l=yield(yield n.get(c,a)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{i=JSON.parse(l)}catch{cA.debug("Invalid json")}}return i})}Ge.getManifestFromRepo=e$e;function A$e(A,e,t,r=Wm.arch()){return Ri(this,void 0,void 0,function*(){return yield TKe._findMatch(A,e,t,r)})}Ge.findFromManifest=A$e;function Tb(A){return Ri(this,void 0,void 0,function*(){return A||(A=ta.join(Tpe(),kpe.default())),yield Js.mkdirP(A),A})}function Lpe(A,e,t){return Ri(this,void 0,void 0,function*(){let r=ta.join(Ob(),A,oc.clean(e)||e,t||"");cA.debug(`destination ${r}`);let i=`${r}.complete`;return yield Js.rmRF(r),yield Js.rmRF(i),yield Js.mkdirP(r),r})}function Upe(A,e,t){let i=`${ta.join(Ob(),A,oc.clean(e)||e,t||"")}.complete`;xn.writeFileSync(i,""),cA.debug("finished caching tool")}function o7(A){let e=oc.clean(A)||"";cA.debug(`isExplicit: ${e}`);let t=oc.valid(e)!=null;return cA.debug(`explicit? ${t}`),t}Ge.isExplicitVersion=o7;function Mpe(A,e){let t="";cA.debug(`evaluating ${A.length} versions`),A=A.sort((r,i)=>oc.gt(r,i)?1:-1);for(let r=A.length-1;r>=0;r--){let i=A[r];if(oc.satisfies(i,e)){t=i;break}}return t?cA.debug(`matched: ${t}`):cA.debug("match not found"),t}Ge.evaluateVersions=Mpe;function Ob(){let A=process.env.RUNNER_TOOL_CACHE||"";return AE.ok(A,"Expected RUNNER_TOOL_CACHE to be defined"),A}function Tpe(){let A=process.env.RUNNER_TEMP||"";return AE.ok(A,"Expected RUNNER_TEMP to be defined"),A}function n7(A,e){let t=global[A];return t!==void 0?t:e}function t$e(A){return Array.from(new Set(A))}});var Aue=require("node:os"),Jr=Si(ur());var Zpe=require("node:os"),nE=require("node:path"),eo=require("node:fs"),mp=Si(ur()),Hb=Si(ine()),Xm=Si(Ope()),p7=Si(KE());var zm=require("node:os"),Ype=require("node:fs"),qpe=Si(ur());function r$e(A){let{registryUrl:e,scope:t}=A,r;if(e)try{r=new URL(e)}catch{throw new Error(`Invalid registry-url: ${e}`)}let i;return t&&(i=t.startsWith("@")?t.toLocaleLowerCase():`@${t.toLocaleLowerCase()}`),r&&i?`[install.scopes]${zm.EOL}'${i}' = { token = "$BUN_AUTH_TOKEN", url = "${r}"}${zm.EOL}`:r&&!i?`[install]${zm.EOL}registry = "${r}"${zm.EOL}`:null}function Ppe(A,e){let t=r$e(e);t&&((0,qpe.info)(`Writing bunfig.toml to '${A}'.`),(0,Ype.appendFileSync)(A,t,{encoding:"utf8"}))}var Kpe=Si(ur());var tE=Si(ur()),Hpe=require("node:console"),rE=require("node:fs"),Yb=require("node:path");async function qb(A,e){let t=await fetch(A,e);if(!t.ok)throw new Error(`Failed to fetch url ${A}. (status code: ${t.status}, status text: ${t.statusText}) -${t}`);return t}function Gpe(A,e){return A.endsWith(e)?A:((0,rE.renameSync)(A,A+e),A+e)}function c7(){let A=process.platform;return A==="win32"?"windows":A}function l7(){let A=process.arch;return A==="arm64"?"aarch64":A}var i$e={"package.json":A=>JSON.parse(A).packageManager?.split("bun@")?.[1],".tool-versions":A=>A.match(/^bun\s?(?.*?)$/m)?.groups?.version,".bumrc":A=>A,".bun-version":A=>A};function _pe(A){let e=process.env.GITHUB_WORKSPACE;if(!e||!A)return;(0,tE.debug)(`Reading version from ${A}`);let t=(0,Yb.join)(e,A),r=(0,Yb.basename)(A);if(!(0,rE.existsSync)(t)){(0,tE.warning)(`File ${t} not found`);return}let i=i$e[r]??(()=>{}),s;try{if(s=i((0,rE.readFileSync)(t,"utf8"))?.trim(),!s){(0,tE.warning)(`Failed to read version from ${A}`);return}}catch(n){let{message:a}=n;(0,tE.warning)(`Failed to read ${A}: ${a}`)}finally{if(s)return(0,Hpe.info)(`Obtained version ${s} from ${A}`),s}}var d7=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,iE=A=>{if(typeof A!="string")throw new TypeError("Invalid argument expected string");let e=A.match(d7);if(!e)throw new Error(`Invalid argument not valid semver ('${A}' received)`);return e.shift(),e},Jpe=A=>A==="*"||A==="x"||A==="X",Vpe=A=>{let e=parseInt(A,10);return isNaN(e)?A:e},s$e=(A,e)=>typeof A!=typeof e?[String(A),String(e)]:[A,e],n$e=(A,e)=>{if(Jpe(A)||Jpe(e))return 0;let[t,r]=s$e(Vpe(A),Vpe(e));return t>r?1:t{for(let t=0;t{let t=iE(A),r=iE(e),i=t.pop(),s=r.pop(),n=Ul(t,r);return n!==0?n:i&&s?Ul(i.split("."),s.split(".")):i||s?i?-1:1:0};var zpe=(A,e,t)=>{a$e(t);let r=jm(A,e);return jpe[t].includes(r)},jpe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Wpe=Object.keys(jpe),a$e=A=>{if(typeof A!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof A}`);if(Wpe.indexOf(A)===-1)throw new Error(`Invalid operator, expected one of ${Wpe.join("|")}`)};var sE=(A,e)=>{if(e=e.replace(/([><=]+)\s+/g,"$1"),e.includes("||"))return e.split("||").some(Q=>sE(A,Q));if(e.includes(" - ")){let[Q,B]=e.split(" - ",2);return sE(A,`>=${Q} <=${B}`)}else if(e.includes(" "))return e.trim().replace(/\s{2,}/g," ").split(" ").every(Q=>sE(A,Q));let t=e.match(/^([<>=~^]+)/),r=t?t[1]:"=";if(r!=="^"&&r!=="~")return zpe(A,e,r);let[i,s,n,,a]=iE(A),[o,c,l,,d]=iE(e),p=[i,s??"x",n??"x"],u=[o,c??"x",l??"x"];if(d&&(!a||Ul(p,u)!==0||Ul(a.split("."),d.split("."))===-1))return!1;let g=u.findIndex(Q=>Q!=="0")+1,h=r==="~"?2:g>1?g:1;return!(Ul(p.slice(0,h),u.slice(0,h))!==0||Ul(p.slice(h),u.slice(h))===-1)};var Pb=A=>typeof A=="string"&&/^[v\d]/.test(A)&&d7.test(A);async function Xpe(A){let{customUrl:e}=A;return e?{url:e}:A.version&&/^[0-9a-f]{40}$/i.test(A.version)?await o$e(A):await c$e(A)}async function o$e(A){let e,t=1,r;for(;(e=await(await qb(`https://api.github.com/repos/oven-sh/bun/actions/workflows/ci.yml/runs?per_page=100&page=${t}`,{})).json())&&(r=e.workflow_runs.find(d=>d.head_sha===A.version),!r);)t++;let i=await(await qb(`https://api.github.com/repos/oven-sh/bun/actions/runs/${r.id}/artifacts`,{})).json(),{os:s,arch:n,avx2:a,profile:o,token:c}=A,l=`bun-${s??c7()}-${n??l7()}${a?"-baseline":""}${o?"-profile":""}`;return{url:i.artifacts.find(d=>d.name===l).archive_download_url,auth:`Bearer ${c}`}}async function c$e(A){let t=(await(await qb("https://api.github.com/repos/oven-sh/bun/git/refs/tags",{headers:{Authorization:`Bearer ${A.token}`}})).json()).filter(h=>h.ref.startsWith("refs/tags/bun-v")||h.ref==="refs/tags/canary").map(h=>h.ref.replace(/refs\/tags\/(bun-v)?/g,"")),{version:r,os:i,arch:s,avx2:n,profile:a}=A,o=t.find(h=>h===r);o?Pb(o)&&(o=`bun-v${o}`):(t=t.filter(h=>Pb(h)).sort(jm),r==="latest"?o=`bun-v${t.at(-1)}`:o=`bun-v${t.filter(h=>sE(h,r)).at(-1)}`);let c=encodeURIComponent(o??r),l=encodeURIComponent(i??c7()),d=encodeURIComponent(s??l7()),p=encodeURIComponent(n?"-baseline":""),u=encodeURIComponent(a?"-profile":""),{href:g}=new URL(`${c}/bun-${l}-${d}${p}${u}.zip`,"https://github.com/oven-sh/bun/releases/download/");return{url:g}}var $pe=async A=>{let e=(0,nE.join)(process.cwd(),"bunfig.toml");Ppe(e,A);let t=await Xpe(A),r=t.url,i=d$e(A),s=(0,nE.join)((0,Zpe.homedir)(),".bun","bin");try{(0,eo.mkdirSync)(s,{recursive:!0})}catch(p){if(p.code!=="EEXIST")throw p}(0,mp.addPath)(s);let n=p=>process.platform==="win32"?`${p}.exe`:p,a=(0,nE.join)(s,n("bun"));try{(0,eo.symlinkSync)(a,(0,nE.join)(s,n("bunx")))}catch(p){if(p.code!=="EEXIST")throw p}let o,c=!1;if(i&&await(0,Hb.restoreCache)([a],r)&&(o=await eue(a),o?(c=!0,(0,mp.info)(`Using a cached version of Bun: ${o}`)):(0,mp.warning)(`Found a cached version of Bun: ${o} (but it appears to be corrupted?)`)),c||((0,mp.info)(`Downloading a new version of Bun: ${r}`),o=await l$e(t,a)),!o)throw new Error("Downloaded a new version of Bun, but failed to check its version? Try again.");let[l]=o.split("+");return(0,Kpe.saveState)("cache",JSON.stringify({cacheEnabled:i,cacheHit:c,bunPath:a,url:r})),{version:l,revision:o,bunPath:a,url:r,cacheHit:c}};async function l$e(A,e){let t=Gpe(await(0,Xm.downloadTool)(A.url,void 0,A.auth??void 0),".zip"),r=await(0,Xm.extractZip)(t),i=await u7(r);try{(0,eo.renameSync)(i,e)}catch{(0,eo.copyFileSync)(i,e)}return await eue(e)}function d$e(A){let{customUrl:e,version:t,noCache:r}=A;return r||e||!t||/latest|canary|action/i.test(t)?!1:(0,Hb.isFeatureAvailable)()}async function u7(A){for(let e of(0,eo.readdirSync)(A,{withFileTypes:!0})){let{name:t}=e,r=(0,nE.join)(A,t);if(e.isFile()){if(t==="bun"||t==="bun.exe")return r;if(/^bun.*\.zip/.test(t)){let i=await(0,Xm.extractZip)(r);return u7(i)}}if(/^bun/.test(t)&&e.isDirectory())return u7(r)}throw new Error("Could not find executable: bun")}async function eue(A){let e=await(0,p7.getExecOutput)(A,["--revision"],{ignoreReturnCode:!0});if(e.exitCode===0&&/^\d+\.\d+\.\d+/.test(e.stdout))return e.stdout.trim();let t=await(0,p7.getExecOutput)(A,["--version"],{ignoreReturnCode:!0});if(t.exitCode===0&&/^\d+\.\d+\.\d+/.test(t.stdout))return t.stdout.trim()}process.env.RUNNER_TEMP||(process.env.RUNNER_TEMP=(0,Aue.tmpdir)());$pe({version:(0,Jr.getInput)("bun-version")||_pe((0,Jr.getInput)("bun-version-file"))||void 0,customUrl:(0,Jr.getInput)("bun-download-url")||void 0,registryUrl:(0,Jr.getInput)("registry-url")||void 0,scope:(0,Jr.getInput)("scope")||void 0,noCache:(0,Jr.getBooleanInput)("no-cache")||!1,token:(0,Jr.getInput)("token")}).then(({version:A,revision:e,bunPath:t,url:r,cacheHit:i})=>{(0,Jr.setOutput)("bun-version",A),(0,Jr.setOutput)("bun-revision",e),(0,Jr.setOutput)("bun-path",t),(0,Jr.setOutput)("bun-download-url",r),(0,Jr.setOutput)("cache-hit",i),process.exit(0)}).catch(A=>{(0,Jr.setFailed)(A),process.exit(1)}); +${t}`);return t}function Gpe(A,e){return A.endsWith(e)?A:((0,rE.renameSync)(A,A+e),A+e)}function c7(){let A=process.platform;return A==="win32"?"windows":A}function l7(){let A=process.arch;return A==="arm64"?"aarch64":A}var i$e={"package.json":A=>JSON.parse(A).packageManager?.split("bun@")?.[1],".tool-versions":A=>A.match(/^bun\s?(?.*?)$/m)?.groups?.version,".bumrc":A=>A,".bun-version":A=>A};function _pe(A){let e=process.env.GITHUB_WORKSPACE;if(!e||!A)return;(0,tE.debug)(`Reading version from ${A}`);let t=(0,Yb.join)(e,A),r=(0,Yb.basename)(A);if(!(0,rE.existsSync)(t)){(0,tE.warning)(`File ${t} not found`);return}let i=i$e[r]??(()=>{}),s;try{if(s=i((0,rE.readFileSync)(t,"utf8"))?.trim(),!s){(0,tE.warning)(`Failed to read version from ${A}`);return}}catch(n){let{message:a}=n;(0,tE.warning)(`Failed to read ${A}: ${a}`)}finally{if(s)return(0,Hpe.info)(`Obtained version ${s} from ${A}`),s}}var d7=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,iE=A=>{if(typeof A!="string")throw new TypeError("Invalid argument expected string");let e=A.match(d7);if(!e)throw new Error(`Invalid argument not valid semver ('${A}' received)`);return e.shift(),e},Jpe=A=>A==="*"||A==="x"||A==="X",Vpe=A=>{let e=parseInt(A,10);return isNaN(e)?A:e},s$e=(A,e)=>typeof A!=typeof e?[String(A),String(e)]:[A,e],n$e=(A,e)=>{if(Jpe(A)||Jpe(e))return 0;let[t,r]=s$e(Vpe(A),Vpe(e));return t>r?1:t{for(let t=0;t{let t=iE(A),r=iE(e),i=t.pop(),s=r.pop(),n=Ul(t,r);return n!==0?n:i&&s?Ul(i.split("."),s.split(".")):i||s?i?-1:1:0};var zpe=(A,e,t)=>{a$e(t);let r=jm(A,e);return jpe[t].includes(r)},jpe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Wpe=Object.keys(jpe),a$e=A=>{if(typeof A!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof A}`);if(Wpe.indexOf(A)===-1)throw new Error(`Invalid operator, expected one of ${Wpe.join("|")}`)};var sE=(A,e)=>{if(e=e.replace(/([><=]+)\s+/g,"$1"),e.includes("||"))return e.split("||").some(Q=>sE(A,Q));if(e.includes(" - ")){let[Q,B]=e.split(" - ",2);return sE(A,`>=${Q} <=${B}`)}else if(e.includes(" "))return e.trim().replace(/\s{2,}/g," ").split(" ").every(Q=>sE(A,Q));let t=e.match(/^([<>=~^]+)/),r=t?t[1]:"=";if(r!=="^"&&r!=="~")return zpe(A,e,r);let[i,s,n,,a]=iE(A),[o,c,l,,d]=iE(e),p=[i,s??"x",n??"x"],u=[o,c??"x",l??"x"];if(d&&(!a||Ul(p,u)!==0||Ul(a.split("."),d.split("."))===-1))return!1;let g=u.findIndex(Q=>Q!=="0")+1,h=r==="~"?2:g>1?g:1;return!(Ul(p.slice(0,h),u.slice(0,h))!==0||Ul(p.slice(h),u.slice(h))===-1)};var Pb=A=>typeof A=="string"&&/^[v\d]/.test(A)&&d7.test(A);async function Xpe(A){let{customUrl:e}=A;return e?{url:e}:A.version&&/^[0-9a-f]{40}$/i.test(A.version)?await o$e(A):await c$e(A)}async function o$e(A){let e,t=1,r;for(;(e=await(await qb(`https://api.github.com/repos/oven-sh/bun/actions/workflows/ci.yml/runs?per_page=100&page=${t}`,{headers:{Authorization:`Bearer ${A.token}`}})).json())&&(r=e.workflow_runs.find(p=>p.head_sha===A.version),!r);)t++;let i=await(await qb(`https://api.github.com/repos/oven-sh/bun/actions/runs/${r.id}/artifacts`,{headers:{Authorization:`Bearer ${A.token}`}})).json(),{os:s,arch:n,avx2:a,profile:o,token:c}=A,l=`bun-${s??c7()}-${n??l7()}${a?"-baseline":""}${o?"-profile":""}`,d=i.artifacts.find(p=>p.name===l);if(!d)throw new Error(`Failed to find artifact '${l}' in run '${r.id}'`);return{url:d.archive_download_url,auth:`Bearer ${c}`}}async function c$e(A){let t=(await(await qb("https://api.github.com/repos/oven-sh/bun/git/refs/tags",{headers:{Authorization:`Bearer ${A.token}`}})).json()).filter(h=>h.ref.startsWith("refs/tags/bun-v")||h.ref==="refs/tags/canary").map(h=>h.ref.replace(/refs\/tags\/(bun-v)?/g,"")),{version:r,os:i,arch:s,avx2:n,profile:a}=A,o=t.find(h=>h===r);o?Pb(o)&&(o=`bun-v${o}`):(t=t.filter(h=>Pb(h)).sort(jm),r==="latest"?o=`bun-v${t.at(-1)}`:o=`bun-v${t.filter(h=>sE(h,r)).at(-1)}`);let c=encodeURIComponent(o??r),l=encodeURIComponent(i??c7()),d=encodeURIComponent(s??l7()),p=encodeURIComponent(n?"-baseline":""),u=encodeURIComponent(a?"-profile":""),{href:g}=new URL(`${c}/bun-${l}-${d}${p}${u}.zip`,"https://github.com/oven-sh/bun/releases/download/");return{url:g}}var $pe=async A=>{let e=(0,nE.join)(process.cwd(),"bunfig.toml");Ppe(e,A);let t=await Xpe(A),r=t.url,i=d$e(A),s=(0,nE.join)((0,Zpe.homedir)(),".bun","bin");try{(0,eo.mkdirSync)(s,{recursive:!0})}catch(p){if(p.code!=="EEXIST")throw p}(0,mp.addPath)(s);let n=p=>process.platform==="win32"?`${p}.exe`:p,a=(0,nE.join)(s,n("bun"));try{(0,eo.symlinkSync)(a,(0,nE.join)(s,n("bunx")))}catch(p){if(p.code!=="EEXIST")throw p}let o,c=!1;if(i&&await(0,Hb.restoreCache)([a],r)&&(o=await eue(a),o?(c=!0,(0,mp.info)(`Using a cached version of Bun: ${o}`)):(0,mp.warning)(`Found a cached version of Bun: ${o} (but it appears to be corrupted?)`)),c||((0,mp.info)(`Downloading a new version of Bun: ${r}`),o=await l$e(t,a)),!o)throw new Error("Downloaded a new version of Bun, but failed to check its version? Try again.");let[l]=o.split("+");return(0,Kpe.saveState)("cache",JSON.stringify({cacheEnabled:i,cacheHit:c,bunPath:a,url:r})),{version:l,revision:o,bunPath:a,url:r,cacheHit:c}};async function l$e(A,e){let t=Gpe(await(0,Xm.downloadTool)(A.url,void 0,A.auth??void 0),".zip"),r=await(0,Xm.extractZip)(t),i=await u7(r);try{(0,eo.renameSync)(i,e)}catch{(0,eo.copyFileSync)(i,e)}return await eue(e)}function d$e(A){let{customUrl:e,version:t,noCache:r}=A;return r||e||!t||/latest|canary|action/i.test(t)?!1:(0,Hb.isFeatureAvailable)()}async function u7(A){for(let e of(0,eo.readdirSync)(A,{withFileTypes:!0})){let{name:t}=e,r=(0,nE.join)(A,t);if(e.isFile()){if(t==="bun"||t==="bun.exe")return r;if(/^bun.*\.zip/.test(t)){let i=await(0,Xm.extractZip)(r);return u7(i)}}if(/^bun/.test(t)&&e.isDirectory())return u7(r)}throw new Error("Could not find executable: bun")}async function eue(A){let e=await(0,p7.getExecOutput)(A,["--revision"],{ignoreReturnCode:!0});if(e.exitCode===0&&/^\d+\.\d+\.\d+/.test(e.stdout))return e.stdout.trim();let t=await(0,p7.getExecOutput)(A,["--version"],{ignoreReturnCode:!0});if(t.exitCode===0&&/^\d+\.\d+\.\d+/.test(t.stdout))return t.stdout.trim()}process.env.RUNNER_TEMP||(process.env.RUNNER_TEMP=(0,Aue.tmpdir)());$pe({version:(0,Jr.getInput)("bun-version")||_pe((0,Jr.getInput)("bun-version-file"))||void 0,customUrl:(0,Jr.getInput)("bun-download-url")||void 0,registryUrl:(0,Jr.getInput)("registry-url")||void 0,scope:(0,Jr.getInput)("scope")||void 0,noCache:(0,Jr.getBooleanInput)("no-cache")||!1,token:(0,Jr.getInput)("token")}).then(({version:A,revision:e,bunPath:t,url:r,cacheHit:i})=>{(0,Jr.setOutput)("bun-version",A),(0,Jr.setOutput)("bun-revision",e),(0,Jr.setOutput)("bun-path",t),(0,Jr.setOutput)("bun-download-url",r),(0,Jr.setOutput)("cache-hit",i),process.exit(0)}).catch(A=>{(0,Jr.setFailed)(A),process.exit(1)}); /*! Bundled license information: undici/lib/fetch/body.js: