From 64dc7a1487e2416b35f4a843cac60589bf874a97 Mon Sep 17 00:00:00 2001 From: "fro-bot[bot]" <109017866+fro-bot[bot]@users.noreply.github.com> Date: Sat, 28 Mar 2026 13:46:09 +0000 Subject: [PATCH] build(dev): update dependency tsdown to v0.21.5 --- dist/{cache-CqdRyjOf.js => cache-H1aH1Xpr.js} | 6 +- dist/main.js | 2 +- dist/post.js | 2 +- package.json | 2 +- pnpm-lock.yaml | 377 +++++++++++++----- 5 files changed, 281 insertions(+), 108 deletions(-) rename dist/{cache-CqdRyjOf.js => cache-H1aH1Xpr.js} (91%) diff --git a/dist/cache-CqdRyjOf.js b/dist/cache-H1aH1Xpr.js similarity index 91% rename from dist/cache-CqdRyjOf.js rename to dist/cache-H1aH1Xpr.js index 4893f567..36891389 100644 --- a/dist/cache-CqdRyjOf.js +++ b/dist/cache-H1aH1Xpr.js @@ -9,11 +9,11 @@ Content-Type: ${c.type||`application/octet-stream`}\r\n\r\n`);a.push(e,c,o),type `,Array.isArray(h))for(let e=0;e{t.removeListener(`error`,g)}),!d){let e=new c;queueMicrotask(()=>g(e))}},g=function(e){if(!d){if(d=!0,n(o.destroyed||o[w]&&i[x]<=1),o.off(`drain`,m).off(`error`,g),t.removeListener(`data`,p).removeListener(`end`,g).removeListener(`close`,h),!e)try{f.end()}catch(t){e=t}f.destroy(e),e&&(e.code!==`UND_ERR_INFO`||e.message!==`reset`)?r.destroy(t,e):r.destroy(t)}};t.on(`data`,p).on(`end`,g).on(`error`,g).on(`close`,h),t.resume&&t.resume(),o.on(`drain`,m).on(`error`,g),t.errorEmitted??t.errored?setImmediate(()=>g(t.errored)):(t.endEmitted??t.readableEnded)&&setImmediate(()=>g(null)),(t.closeEmitted??t.closed)&&setImmediate(h)}function je(e,t,i,a,o,s,c,l){try{t?r.isBuffer(t)&&(n(s===t.byteLength,`buffer body must have content length`),o.cork(),o.write(`${c}content-length: ${s}\r\n\r\n`,`latin1`),o.write(t),o.uncork(),a.onBodySent(t),!l&&a.reset!==!1&&(o[_]=!0)):s===0?o.write(`${c}content-length: 0\r\n\r\n`,`latin1`):(n(s===null,`no body must not have content length`),o.write(`${c}\r\n`,`latin1`)),a.onRequestSent(),i[le]()}catch(t){e(t)}}async function Ne(e,t,r,i,a,s,c,l){n(s===t.size,`blob body must have content length`);try{if(s!=null&&s!==t.size)throw new o;let e=Buffer.from(await t.arrayBuffer());a.cork(),a.write(`${c}content-length: ${s}\r\n\r\n`,`latin1`),a.write(e),a.uncork(),i.onBodySent(e),i.onRequestSent(),!l&&i.reset!==!1&&(a[_]=!0),r[le]()}catch(t){e(t)}}async function Pe(e,t,r,i,a,o,s,c){n(o!==0||r[x]===0,`iterator body cannot be pipelined`);let l=null;function u(){if(l){let e=l;l=null,e()}}let d=()=>new Promise((e,t)=>{n(l===null),a[j]?t(a[j]):l=e});a.on(`close`,u).on(`drain`,u);let f=new Fe({abort:e,socket:a,request:i,contentLength:o,client:r,expectsPayload:c,header:s});try{for await(let e of t){if(a[j])throw a[j];f.write(e)||await d()}f.end()}catch(e){f.destroy(e)}finally{a.off(`close`,u).off(`drain`,u)}}var Fe=class{constructor({abort:e,socket:t,request:n,contentLength:r,client:i,expectsPayload:a,header:o}){this.socket=t,this.request=n,this.contentLength=r,this.client=i,this.bytesWritten=0,this.expectsPayload=a,this.header=o,this.abort=e,t[w]=!0}write(e){let{socket:t,request:n,contentLength:r,client:i,bytesWritten:a,expectsPayload:s,header:c}=this;if(t[j])throw t[j];if(t.destroyed)return!1;let l=Buffer.byteLength(e);if(!l)return!0;if(r!==null&&a+l>r){if(i[ie])throw new o;process.emitWarning(new o)}t.cork(),a===0&&(!s&&n.reset!==!1&&(t[_]=!0),r===null?t.write(`${c}transfer-encoding: chunked\r\n`,`latin1`):t.write(`${c}content-length: ${r}\r\n\r\n`,`latin1`)),r===null&&t.write(`\r\n${l.toString(16)}\r\n`,`latin1`),this.bytesWritten+=l;let u=t.write(e);return t.uncork(),n.onBodySent(e),u||t[y].timeout&&t[y].timeoutType===3&&t[y].timeout.refresh&&t[y].timeout.refresh(),u}end(){let{socket:e,contentLength:t,client:n,bytesWritten:r,expectsPayload:i,header:a,request:s}=this;if(s.onRequestSent(),e[w]=!1,e[j])throw e[j];if(!e.destroyed){if(r===0?i?e.write(`${a}content-length: 0\r\n\r\n`,`latin1`):e.write(`${a}\r\n`,`latin1`):t===null&&e.write(`\r 0\r \r -`,`latin1`),t!==null&&r!==t){if(n[ie])throw new o;process.emitWarning(new o)}e[y].timeout&&e[y].timeoutType===3&&e[y].timeout.refresh&&e[y].timeout.refresh(),n[le]()}}destroy(e){let{socket:t,client:r,abort:i}=this;t[w]=!1,e&&(n(r[x]<=1,`pipeline should only contain this request`),i(e))}};t.exports=Te})),$e=I(((e,t)=>{let n=L(`node:assert`),{pipeline:r}=L(`node:stream`),i=z(),{RequestContentLengthMismatchError:a,RequestAbortedError:o,SocketError:s,InformationalError:c}=R(),{kUrl:l,kReset:u,kClient:d,kRunning:f,kPending:p,kQueue:m,kPendingIdx:h,kRunningIdx:g,kError:_,kSocket:v,kStrictContentLength:y,kOnError:b,kMaxConcurrentStreams:x,kHTTP2Session:S,kResume:C,kSize:w,kHTTPContext:T}=ke(),E=Symbol(`open streams`),D,O=!1,k;try{k=L(`node:http2`)}catch{k={constants:{}}}let{constants:{HTTP2_HEADER_AUTHORITY:A,HTTP2_HEADER_METHOD:j,HTTP2_HEADER_PATH:M,HTTP2_HEADER_SCHEME:N,HTTP2_HEADER_CONTENT_LENGTH:P,HTTP2_HEADER_EXPECT:ee,HTTP2_HEADER_STATUS:te}}=k;function ne(e){let t=[];for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.push(Buffer.from(n),Buffer.from(e));else t.push(Buffer.from(n),Buffer.from(r));return t}async function F(e,t){e[v]=t,O||(O=!0,process.emitWarning(`H2 support is experimental, expect them to change at any time.`,{code:`UNDICI-H2`}));let r=k.connect(e[l],{createConnection:()=>t,peerMaxConcurrentStreams:e[x]});r[E]=0,r[d]=e,r[v]=t,i.addListener(r,`error`,ie),i.addListener(r,`frameError`,ae),i.addListener(r,`end`,oe),i.addListener(r,`goaway`,se),i.addListener(r,`close`,function(){let{[d]:e}=this,{[v]:t}=e,r=this[v][_]||this[_]||new s(`closed`,i.getSocketInfo(t));if(e[S]=null,e.destroyed){n(e[p]===0);let t=e[m].splice(e[g]);for(let n=0;n{a=!0}),{version:`h2`,defaultPipelining:1/0,write(...t){return le(e,...t)},resume(){re(e)},destroy(e,n){a?queueMicrotask(n):t.destroy(e).on(`close`,n)},get destroyed(){return t.destroyed},busy(){return!1}}}function re(e){let t=e[v];t?.destroyed===!1&&(e[w]===0&&e[x]===0?(t.unref(),e[S].unref()):(t.ref(),e[S].ref()))}function ie(e){n(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`),this[v][_]=e,this[d][b](e)}function ae(e,t,n){if(n===0){let n=new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`);this[v][_]=n,this[d][b](n)}}function oe(){let e=new s(`other side closed`,i.getSocketInfo(this[v]));this.destroy(e),i.destroy(this[v],e)}function se(e){let t=this[_]||new s(`HTTP/2: "GOAWAY" frame received with code ${e}`,i.getSocketInfo(this)),r=this[d];if(r[v]=null,r[T]=null,this[S]!=null&&(this[S].destroy(t),this[S]=null),i.destroy(this[v],t),r[g]{t.aborted||t.completed||(n||=new o,i.errorRequest(e,t,n),T!=null&&i.destroy(T,n),i.destroy(x,n),e[m][e[g]++]=null,e[C]())};try{t.onConnect(F)}catch(n){i.errorRequest(e,t,n)}if(t.aborted)return!1;if(s===`CONNECT`)return r.ref(),T=r.request(w,{endStream:!1,signal:_}),T.id&&!T.pending?(t.onUpgrade(null,null,T),++r[E],e[m][e[g]++]=null):T.once(`ready`,()=>{t.onUpgrade(null,null,T),++r[E],e[m][e[g]++]=null}),T.once(`close`,()=>{--r[E],r[E]===0&&r.unref()}),!0;w[M]=u,w[N]=`https`;let re=s===`PUT`||s===`POST`||s===`PATCH`;x&&typeof x.read==`function`&&x.read(0);let ie=i.bodyLength(x);if(i.isFormDataLike(x)){D??=Ze().extractBody;let[e,t]=D(x);w[`content-type`]=t,x=e.stream,ie=e.length}if(ie??=t.contentLength,(ie===0||!re)&&(ie=null),ce(s)&&ie>0&&t.contentLength!=null&&t.contentLength!==ie){if(e[y])return i.errorRequest(e,t,new a),!1;process.emitWarning(new a)}ie!=null&&(n(x,`no body must not have content length`),w[P]=`${ie}`),r.ref();let ae=s===`GET`||s===`HEAD`||x===null;return p?(w[ee]=`100-continue`,T=r.request(w,{endStream:ae,signal:_}),T.once(`continue`,oe)):(T=r.request(w,{endStream:ae,signal:_}),oe()),++r[E],T.once(`response`,n=>{let{[te]:r,...a}=n;if(t.onResponseStarted(),t.aborted){let n=new o;i.errorRequest(e,t,n),i.destroy(T,n);return}t.onHeaders(Number(r),ne(a),T.resume.bind(T),``)===!1&&T.pause(),T.on(`data`,e=>{t.onData(e)===!1&&T.pause()})}),T.once(`end`,()=>{(T.state?.state==null||T.state.state<6)&&t.onComplete([]),r[E]===0&&r.unref(),F(new c(`HTTP/2: stream half-closed (remote)`)),e[m][e[g]++]=null,e[h]=e[g],e[C]()}),T.once(`close`,()=>{--r[E],r[E]===0&&r.unref()}),T.once(`error`,function(e){F(e)}),T.once(`frameError`,(e,t)=>{F(new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`))}),!0;function oe(){!x||ie===0?ue(F,T,null,e,t,e[v],ie,re):i.isBuffer(x)?ue(F,T,x,e,t,e[v],ie,re):i.isBlobLike(x)?typeof x.stream==`function`?fe(F,T,x.stream(),e,t,e[v],ie,re):I(F,T,x,e,t,e[v],ie,re):i.isStream(x)?de(F,e[v],re,T,x,e,t,ie):i.isIterable(x)?fe(F,T,x,e,t,e[v],ie,re):n(!1)}}function ue(e,t,r,a,o,s,c,l){try{r!=null&&i.isBuffer(r)&&(n(c===r.byteLength,`buffer body must have content length`),t.cork(),t.write(r),t.uncork(),t.end(),o.onBodySent(r)),l||(s[u]=!0),o.onRequestSent(),a[C]()}catch(t){e(t)}}function de(e,t,a,o,s,c,l,d){n(d!==0||c[f]===0,`stream body cannot be pipelined`);let p=r(s,o,n=>{n?(i.destroy(p,n),e(n)):(i.removeAllListeners(p),l.onRequestSent(),a||(t[u]=!0),c[C]())});i.addListener(p,`data`,m);function m(e){l.onBodySent(e)}}async function I(e,t,r,i,o,s,c,l){n(c===r.size,`blob body must have content length`);try{if(c!=null&&c!==r.size)throw new a;let e=Buffer.from(await r.arrayBuffer());t.cork(),t.write(e),t.uncork(),t.end(),o.onBodySent(e),o.onRequestSent(),l||(s[u]=!0),i[C]()}catch(t){e(t)}}async function fe(e,t,r,i,a,o,s,c){n(s!==0||i[f]===0,`iterator body cannot be pipelined`);let l=null;function d(){if(l){let e=l;l=null,e()}}let p=()=>new Promise((e,t)=>{n(l===null),o[_]?t(o[_]):l=e});t.on(`close`,d).on(`drain`,d);try{for await(let e of r){if(o[_])throw o[_];let n=t.write(e);a.onBodySent(e),n||await p()}t.end(),a.onRequestSent(),c||(o[u]=!0),i[C]()}catch(t){e(t)}finally{t.off(`close`,d).off(`drain`,d)}}t.exports=F})),et=I(((e,t)=>{let n=z(),{kBodyUsed:r}=ke(),i=L(`node:assert`),{InvalidArgumentError:a}=R(),o=L(`node:events`),s=[300,301,302,303,307,308],c=Symbol(`body`);var l=class{constructor(e){this[c]=e,this[r]=!1}async*[Symbol.asyncIterator](){i(!this[r],`disturbed`),this[r]=!0,yield*this[c]}},u=class{constructor(e,t,s,c){if(t!=null&&(!Number.isInteger(t)||t<0))throw new a(`maxRedirections must be a positive number`);n.validateHandler(c,s.method,s.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...s,maxRedirections:0},this.maxRedirections=t,this.handler=c,this.history=[],this.redirectionLimitReached=!1,n.isStream(this.opts.body)?(n.bodyLength(this.opts.body)===0&&this.opts.body.on(`data`,function(){i(!1)}),typeof this.opts.body.readableDidRead!=`boolean`&&(this.opts.body[r]=!1,o.prototype.on.call(this.opts.body,`data`,function(){this[r]=!0}))):(this.opts.body&&typeof this.opts.body.pipeTo==`function`||this.opts.body&&typeof this.opts.body!=`string`&&!ArrayBuffer.isView(this.opts.body)&&n.isIterable(this.opts.body))&&(this.opts.body=new l(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,t,n){this.handler.onUpgrade(e,t,n)}onError(e){this.handler.onError(e)}onHeaders(e,t,r,i){if(this.location=this.history.length>=this.maxRedirections||n.isDisturbed(this.opts.body)?null:d(e,t),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(Error(`max redirects`)),this.redirectionLimitReached=!0,this.abort(Error(`max redirects`));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,t,r,i);let{origin:a,pathname:o,search:s}=n.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),c=s?`${o}${s}`:o;this.opts.headers=p(this.opts.headers,e===303,this.opts.origin!==a),this.opts.path=c,this.opts.origin=a,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!==`HEAD`&&(this.opts.method=`GET`,this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function d(e,t){if(s.indexOf(e)===-1)return null;for(let e=0;e{let n=et();function r({maxRedirections:e}){return t=>function(r,i){let{maxRedirections:a=e}=r;if(!a)return t(r,i);let o=new n(t,a,r,i);return r={...r,maxRedirections:0},t(r,o)}}t.exports=r})),nt=I(((e,t)=>{let n=L(`node:assert`),r=L(`node:net`),i=L(`node:http`),a=z(),{channels:o}=Me(),s=Ne(),c=Fe(),{InvalidArgumentError:l,InformationalError:u,ClientDestroyedError:d}=R(),f=Le(),{kUrl:p,kServerName:m,kClient:h,kBusy:g,kConnect:_,kResuming:v,kRunning:y,kPending:b,kSize:x,kQueue:S,kConnected:C,kConnecting:w,kNeedDrain:T,kKeepAliveDefaultTimeout:E,kHostHeader:D,kPendingIdx:O,kRunningIdx:k,kError:A,kPipelining:j,kKeepAliveTimeoutValue:M,kMaxHeadersSize:N,kKeepAliveMaxTimeout:P,kKeepAliveTimeoutThreshold:ee,kHeadersTimeout:te,kBodyTimeout:ne,kStrictContentLength:F,kConnector:re,kMaxRedirections:ie,kMaxRequests:ae,kCounter:oe,kClose:se,kDestroy:ce,kDispatch:le,kInterceptors:ue,kLocalAddress:de,kMaxResponseSize:I,kOnError:fe,kHTTPContext:pe,kMaxConcurrentStreams:me,kResume:he}=ke(),ge=Qe(),_e=$e(),ve=!1,ye=Symbol(`kClosedResolve`),be=()=>{};function xe(e){return e[j]??e[pe]?.defaultPipelining??1}var Se=class extends c{constructor(e,{interceptors:t,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:u,bodyTimeout:d,idleTimeout:h,keepAlive:g,keepAliveTimeout:_,maxKeepAliveTimeout:y,keepAliveMaxTimeout:b,keepAliveTimeoutThreshold:x,socketPath:C,pipelining:w,tls:A,strictContentLength:oe,maxCachedSessions:se,maxRedirections:ce,connect:le,maxRequestsPerClient:L,localAddress:ge,maxResponseSize:_e,autoSelectFamily:be,autoSelectFamilyAttemptTimeout:xe,maxConcurrentStreams:Se,allowH2:Te}={}){if(super(),g!==void 0)throw new l(`unsupported keepAlive, use pipelining=0 instead`);if(s!==void 0)throw new l(`unsupported socketTimeout, use headersTimeout & bodyTimeout instead`);if(c!==void 0)throw new l(`unsupported requestTimeout, use headersTimeout & bodyTimeout instead`);if(h!==void 0)throw new l(`unsupported idleTimeout, use keepAliveTimeout instead`);if(y!==void 0)throw new l(`unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead`);if(n!=null&&!Number.isFinite(n))throw new l(`invalid maxHeaderSize`);if(C!=null&&typeof C!=`string`)throw new l(`invalid socketPath`);if(u!=null&&(!Number.isFinite(u)||u<0))throw new l(`invalid connectTimeout`);if(_!=null&&(!Number.isFinite(_)||_<=0))throw new l(`invalid keepAliveTimeout`);if(b!=null&&(!Number.isFinite(b)||b<=0))throw new l(`invalid keepAliveMaxTimeout`);if(x!=null&&!Number.isFinite(x))throw new l(`invalid keepAliveTimeoutThreshold`);if(o!=null&&(!Number.isInteger(o)||o<0))throw new l(`headersTimeout must be a positive integer or zero`);if(d!=null&&(!Number.isInteger(d)||d<0))throw new l(`bodyTimeout must be a positive integer or zero`);if(le!=null&&typeof le!=`function`&&typeof le!=`object`)throw new l(`connect must be a function or an object`);if(ce!=null&&(!Number.isInteger(ce)||ce<0))throw new l(`maxRedirections must be a positive number`);if(L!=null&&(!Number.isInteger(L)||L<0))throw new l(`maxRequestsPerClient must be a positive number`);if(ge!=null&&(typeof ge!=`string`||r.isIP(ge)===0))throw new l(`localAddress must be valid string IP address`);if(_e!=null&&(!Number.isInteger(_e)||_e<-1))throw new l(`maxResponseSize must be a positive number`);if(xe!=null&&(!Number.isInteger(xe)||xe<-1))throw new l(`autoSelectFamilyAttemptTimeout must be a positive number`);if(Te!=null&&typeof Te!=`boolean`)throw new l(`allowH2 must be a valid boolean value`);if(Se!=null&&(typeof Se!=`number`||Se<1))throw new l(`maxConcurrentStreams must be a positive integer, greater than 0`);typeof le!=`function`&&(le=f({...A,maxCachedSessions:se,allowH2:Te,socketPath:C,timeout:u,...be?{autoSelectFamily:be,autoSelectFamilyAttemptTimeout:xe}:void 0,...le})),t?.Client&&Array.isArray(t.Client)?(this[ue]=t.Client,ve||(ve=!0,process.emitWarning(`Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.`,{code:`UNDICI-CLIENT-INTERCEPTOR-DEPRECATED`}))):this[ue]=[Ce({maxRedirections:ce})],this[p]=a.parseOrigin(e),this[re]=le,this[j]=w??1,this[N]=n||i.maxHeaderSize,this[E]=_??4e3,this[P]=b??6e5,this[ee]=x??2e3,this[M]=this[E],this[m]=null,this[de]=ge??null,this[v]=0,this[T]=0,this[D]=`host: ${this[p].hostname}${this[p].port?`:${this[p].port}`:``}\r\n`,this[ne]=d??3e5,this[te]=o??3e5,this[F]=oe??!0,this[ie]=ce,this[ae]=L,this[ye]=null,this[I]=_e>-1?_e:-1,this[me]=Se??100,this[pe]=null,this[S]=[],this[k]=0,this[O]=0,this[he]=e=>De(this,e),this[fe]=e=>we(this,e)}get pipelining(){return this[j]}set pipelining(e){this[j]=e,this[he](!0)}get[b](){return this[S].length-this[O]}get[y](){return this[O]-this[k]}get[x](){return this[S].length-this[k]}get[C](){return!!this[pe]&&!this[w]&&!this[pe].destroyed}get[g](){return!!(this[pe]?.busy(null)||this[x]>=(xe(this)||1)||this[b]>0)}[_](e){Te(this),this.once(`connect`,e)}[le](e,t){let n=new s(e.origin||this[p].origin,e,t);return this[S].push(n),this[v]||(a.bodyLength(n.body)==null&&a.isIterable(n.body)?(this[v]=1,queueMicrotask(()=>De(this))):this[he](!0)),this[v]&&this[T]!==2&&this[g]&&(this[T]=2),this[T]<2}async[se](){return new Promise(e=>{this[x]?this[ye]=e:e(null)})}async[ce](e){return new Promise(t=>{let n=this[S].splice(this[O]);for(let t=0;t{this[ye]&&(this[ye](),this[ye]=null),t(null)};this[pe]?(this[pe].destroy(e,r),this[pe]=null):queueMicrotask(r),this[he]()})}};let Ce=tt();function we(e,t){if(e[y]===0&&t.code!==`UND_ERR_INFO`&&t.code!==`UND_ERR_SOCKET`){n(e[O]===e[k]);let r=e[S].splice(e[k]);for(let n=0;n{e[re]({host:t,hostname:i,protocol:s,port:c,servername:e[m],localAddress:e[de]},(e,t)=>{e?r(e):n(t)})});if(e.destroyed){a.destroy(r.on(`error`,be),new d);return}n(r);try{e[pe]=r.alpnProtocol===`h2`?await _e(e,r):await ge(e,r)}catch(e){throw r.destroy().on(`error`,be),e}e[w]=!1,r[oe]=0,r[ae]=e[ae],r[h]=e,r[A]=null,o.connected.hasSubscribers&&o.connected.publish({connectParams:{host:t,hostname:i,protocol:s,port:c,version:e[pe]?.version,servername:e[m],localAddress:e[de]},connector:e[re],socket:r}),e.emit(`connect`,e[p],[e])}catch(r){if(e.destroyed)return;if(e[w]=!1,o.connectError.hasSubscribers&&o.connectError.publish({connectParams:{host:t,hostname:i,protocol:s,port:c,version:e[pe]?.version,servername:e[m],localAddress:e[de]},connector:e[re],error:r}),r.code===`ERR_TLS_CERT_ALTNAME_INVALID`)for(n(e[y]===0);e[b]>0&&e[S][e[O]].servername===e[m];){let t=e[S][e[O]++];a.errorRequest(e,t,r)}else we(e,r);e.emit(`connectionError`,e[p],[e],r)}e[he]()}function Ee(e){e[T]=0,e.emit(`drain`,e[p],[e])}function De(e,t){e[v]!==2&&(e[v]=2,Oe(e,t),e[v]=0,e[k]>256&&(e[S].splice(0,e[k]),e[O]-=e[k],e[k]=0))}function Oe(e,t){for(;;){if(e.destroyed){n(e[b]===0);return}if(e[ye]&&!e[x]){e[ye](),e[ye]=null;return}if(e[pe]&&e[pe].resume(),e[g])e[T]=2;else if(e[T]===2){t?(e[T]=1,queueMicrotask(()=>Ee(e))):Ee(e);continue}if(e[b]===0||e[y]>=(xe(e)||1))return;let r=e[S][e[O]];if(e[p].protocol===`https:`&&e[m]!==r.servername){if(e[y]>0)return;e[m]=r.servername,e[pe]?.destroy(new u(`servername changed`),()=>{e[pe]=null,De(e)})}if(e[w])return;if(!e[pe]){Te(e);return}if(e[pe].destroyed||e[pe].busy(r))return;!r.aborted&&e[pe].write(r)?e[O]++:e[S].splice(e[O],1)}}t.exports=Se})),rt=I(((e,t)=>{let n=2048,r=n-1;var i=class{constructor(){this.bottom=0,this.top=0,this.list=Array(n),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&r)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&r}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&r,e)}};t.exports=class{constructor(){this.head=this.tail=new i}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new i),this.head.push(e)}shift(){let e=this.tail,t=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),t}}})),it=I(((e,t)=>{let{kFree:n,kConnected:r,kPending:i,kQueued:a,kRunning:o,kSize:s}=ke(),c=Symbol(`pool`);t.exports=class{constructor(e){this[c]=e}get connected(){return this[c][r]}get free(){return this[c][n]}get pending(){return this[c][i]}get queued(){return this[c][a]}get running(){return this[c][o]}get size(){return this[c][s]}}})),at=I(((e,t)=>{let n=Fe(),r=rt(),{kConnected:i,kSize:a,kRunning:o,kPending:s,kQueued:c,kBusy:l,kFree:u,kUrl:d,kClose:f,kDestroy:p,kDispatch:m}=ke(),h=it(),g=Symbol(`clients`),_=Symbol(`needDrain`),v=Symbol(`queue`),y=Symbol(`closed resolve`),b=Symbol(`onDrain`),x=Symbol(`onConnect`),S=Symbol(`onDisconnect`),C=Symbol(`onConnectionError`),w=Symbol(`get dispatcher`),T=Symbol(`add client`),E=Symbol(`remove client`),D=Symbol(`stats`);t.exports={PoolBase:class extends n{constructor(){super(),this[v]=new r,this[g]=[],this[c]=0;let e=this;this[b]=function(t,n){let r=e[v],i=!1;for(;!i;){let t=r.shift();if(!t)break;e[c]--,i=!this.dispatch(t.opts,t.handler)}this[_]=i,!this[_]&&e[_]&&(e[_]=!1,e.emit(`drain`,t,[e,...n])),e[y]&&r.isEmpty()&&Promise.all(e[g].map(e=>e.close())).then(e[y])},this[x]=(t,n)=>{e.emit(`connect`,t,[e,...n])},this[S]=(t,n,r)=>{e.emit(`disconnect`,t,[e,...n],r)},this[C]=(t,n,r)=>{e.emit(`connectionError`,t,[e,...n],r)},this[D]=new h(this)}get[l](){return this[_]}get[i](){return this[g].filter(e=>e[i]).length}get[u](){return this[g].filter(e=>e[i]&&!e[_]).length}get[s](){let e=this[c];for(let{[s]:t}of this[g])e+=t;return e}get[o](){let e=0;for(let{[o]:t}of this[g])e+=t;return e}get[a](){let e=this[c];for(let{[a]:t}of this[g])e+=t;return e}get stats(){return this[D]}async[f](){this[v].isEmpty()?await Promise.all(this[g].map(e=>e.close())):await new Promise(e=>{this[y]=e})}async[p](e){for(;;){let t=this[v].shift();if(!t)break;t.handler.onError(e)}await Promise.all(this[g].map(t=>t.destroy(e)))}[m](e,t){let n=this[w]();return n?n.dispatch(e,t)||(n[_]=!0,this[_]=!this[w]()):(this[_]=!0,this[v].push({opts:e,handler:t}),this[c]++),!this[_]}[T](e){return e.on(`drain`,this[b]).on(`connect`,this[x]).on(`disconnect`,this[S]).on(`connectionError`,this[C]),this[g].push(e),this[_]&&queueMicrotask(()=>{this[_]&&this[b](e[d],[this,e])}),this}[E](e){e.close(()=>{let t=this[g].indexOf(e);t!==-1&&this[g].splice(t,1)}),this[_]=this[g].some(e=>!e[_]&&e.closed!==!0&&e.destroyed!==!0)}},kClients:g,kNeedDrain:_,kAddClient:T,kRemoveClient:E,kGetDispatcher:w}})),ot=I(((e,t)=>{let{PoolBase:n,kClients:r,kNeedDrain:i,kAddClient:a,kGetDispatcher:o}=at(),s=nt(),{InvalidArgumentError:c}=R(),l=z(),{kUrl:u,kInterceptors:d}=ke(),f=Le(),p=Symbol(`options`),m=Symbol(`connections`),h=Symbol(`factory`);function g(e,t){return new s(e,t)}t.exports=class extends n{constructor(e,{connections:t,factory:n=g,connect:i,connectTimeout:a,tls:o,maxCachedSessions:s,socketPath:_,autoSelectFamily:v,autoSelectFamilyAttemptTimeout:y,allowH2:b,...x}={}){if(super(),t!=null&&(!Number.isFinite(t)||t<0))throw new c(`invalid connections`);if(typeof n!=`function`)throw new c(`factory must be a function.`);if(i!=null&&typeof i!=`function`&&typeof i!=`object`)throw new c(`connect must be a function or an object`);typeof i!=`function`&&(i=f({...o,maxCachedSessions:s,allowH2:b,socketPath:_,timeout:a,...v?{autoSelectFamily:v,autoSelectFamilyAttemptTimeout:y}:void 0,...i})),this[d]=x.interceptors?.Pool&&Array.isArray(x.interceptors.Pool)?x.interceptors.Pool:[],this[m]=t||null,this[u]=l.parseOrigin(e),this[p]={...l.deepClone(x),connect:i,allowH2:b},this[p].interceptors=x.interceptors?{...x.interceptors}:void 0,this[h]=n,this.on(`connectionError`,(e,t,n)=>{for(let e of t){let t=this[r].indexOf(e);t!==-1&&this[r].splice(t,1)}})}[o](){for(let e of this[r])if(!e[i])return e;if(!this[m]||this[r].length{let{BalancedPoolMissingUpstreamError:n,InvalidArgumentError:r}=R(),{PoolBase:i,kClients:a,kNeedDrain:o,kAddClient:s,kRemoveClient:c,kGetDispatcher:l}=at(),u=ot(),{kUrl:d,kInterceptors:f}=ke(),{parseOrigin:p}=z(),m=Symbol(`factory`),h=Symbol(`options`),g=Symbol(`kGreatestCommonDivisor`),_=Symbol(`kCurrentWeight`),v=Symbol(`kIndex`),y=Symbol(`kWeight`),b=Symbol(`kMaxWeightPerServer`),x=Symbol(`kErrorPenalty`);function S(e,t){if(e===0)return t;for(;t!==0;){let n=t;t=e%t,e=n}return e}function C(e,t){return new u(e,t)}t.exports=class extends i{constructor(e=[],{factory:t=C,...n}={}){if(super(),this[h]=n,this[v]=-1,this[_]=0,this[b]=this[h].maxWeightPerServer||100,this[x]=this[h].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof t!=`function`)throw new r(`factory must be a function.`);this[f]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[m]=t;for(let t of e)this.addUpstream(t);this._updateBalancedPoolStats()}addUpstream(e){let t=p(e).origin;if(this[a].find(e=>e[d].origin===t&&e.closed!==!0&&e.destroyed!==!0))return this;let n=this[m](t,Object.assign({},this[h]));this[s](n),n.on(`connect`,()=>{n[y]=Math.min(this[b],n[y]+this[x])}),n.on(`connectionError`,()=>{n[y]=Math.max(1,n[y]-this[x]),this._updateBalancedPoolStats()}),n.on(`disconnect`,(...e)=>{let t=e[2];t&&t.code===`UND_ERR_SOCKET`&&(n[y]=Math.max(1,n[y]-this[x]),this._updateBalancedPoolStats())});for(let e of this[a])e[y]=this[b];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let t=0;te[d].origin===t&&e.closed!==!0&&e.destroyed!==!0);return n&&this[c](n),this}get upstreams(){return this[a].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[d].origin)}[l](){if(this[a].length===0)throw new n;if(!this[a].find(e=>!e[o]&&e.closed!==!0&&e.destroyed!==!0)||this[a].map(e=>e[o]).reduce((e,t)=>e&&t,!0))return;let e=0,t=this[a].findIndex(e=>!e[o]);for(;e++this[a][t][y]&&!e[o]&&(t=this[v]),this[v]===0&&(this[_]=this[_]-this[g],this[_]<=0&&(this[_]=this[b])),e[y]>=this[_]&&!e[o])return e}return this[_]=this[a][t][y],this[v]=t,this[a][t]}}})),ct=I(((e,t)=>{let{InvalidArgumentError:n}=R(),{kClients:r,kRunning:i,kClose:a,kDestroy:o,kDispatch:s,kInterceptors:c}=ke(),l=Fe(),u=ot(),d=nt(),f=z(),p=tt(),m=Symbol(`onConnect`),h=Symbol(`onDisconnect`),g=Symbol(`onConnectionError`),_=Symbol(`maxRedirections`),v=Symbol(`onDrain`),y=Symbol(`factory`),b=Symbol(`options`);function x(e,t){return t&&t.connections===1?new d(e,t):new u(e,t)}t.exports=class extends l{constructor({factory:e=x,maxRedirections:t=0,connect:i,...a}={}){if(super(),typeof e!=`function`)throw new n(`factory must be a function.`);if(i!=null&&typeof i!=`function`&&typeof i!=`object`)throw new n(`connect must be a function or an object`);if(!Number.isInteger(t)||t<0)throw new n(`maxRedirections must be a positive number`);i&&typeof i!=`function`&&(i={...i}),this[c]=a.interceptors?.Agent&&Array.isArray(a.interceptors.Agent)?a.interceptors.Agent:[p({maxRedirections:t})],this[b]={...f.deepClone(a),connect:i},this[b].interceptors=a.interceptors?{...a.interceptors}:void 0,this[_]=t,this[y]=e,this[r]=new Map,this[v]=(e,t)=>{this.emit(`drain`,e,[this,...t])},this[m]=(e,t)=>{this.emit(`connect`,e,[this,...t])},this[h]=(e,t,n)=>{this.emit(`disconnect`,e,[this,...t],n)},this[g]=(e,t,n)=>{this.emit(`connectionError`,e,[this,...t],n)}}get[i](){let e=0;for(let t of this[r].values())e+=t[i];return e}[s](e,t){let i;if(e.origin&&(typeof e.origin==`string`||e.origin instanceof URL))i=String(e.origin);else throw new n(`opts.origin must be a non-empty string or URL.`);let a=this[r].get(i);return a||(a=this[y](e.origin,this[b]).on(`drain`,this[v]).on(`connect`,this[m]).on(`disconnect`,this[h]).on(`connectionError`,this[g]),this[r].set(i,a)),a.dispatch(e,t)}async[a](){let e=[];for(let t of this[r].values())e.push(t.close());this[r].clear(),await Promise.all(e)}async[o](e){let t=[];for(let n of this[r].values())t.push(n.destroy(e));this[r].clear(),await Promise.all(t)}}})),lt=I(((e,t)=>{let{kProxy:n,kClose:r,kDestroy:i,kDispatch:a,kInterceptors:o}=ke(),{URL:s}=L(`node:url`),c=ct(),l=ot(),u=Fe(),{InvalidArgumentError:d,RequestAbortedError:f,SecureProxyConnectionError:p}=R(),m=Le(),h=nt(),g=Symbol(`proxy agent`),_=Symbol(`proxy client`),v=Symbol(`proxy headers`),y=Symbol(`request tls settings`),b=Symbol(`proxy tls settings`),x=Symbol(`connect endpoint function`),S=Symbol(`tunnel proxy`);function C(e){return e===`https:`?443:80}function w(e,t){return new l(e,t)}let T=()=>{};function E(e,t){return t.connections===1?new h(e,t):new l(e,t)}var D=class extends u{#e;constructor(e,{headers:t={},connect:n,factory:r}){if(super(),!e)throw new d(`Proxy URL is mandatory`);this[v]=t,r?this.#e=r(e,{connect:n}):this.#e=new h(e,{connect:n})}[a](e,t){let n=t.onHeaders;t.onHeaders=function(e,r,i){if(e===407){typeof t.onError==`function`&&t.onError(new d(`Proxy Authentication Required (407)`));return}n&&n.call(this,e,r,i)};let{origin:r,path:i=`/`,headers:o={}}=e;if(e.path=r+i,!(`host`in o)&&!(`Host`in o)){let{host:e}=new s(r);o.host=e}return e.headers={...this[v],...o},this.#e[a](e,t)}async[r](){return this.#e.close()}async[i](e){return this.#e.destroy(e)}},O=class extends u{constructor(e){if(super(),!e||typeof e==`object`&&!(e instanceof s)&&!e.uri)throw new d(`Proxy uri is mandatory`);let{clientFactory:t=w}=e;if(typeof t!=`function`)throw new d(`Proxy opts.clientFactory must be a function.`);let{proxyTunnel:r=!0}=e,i=this.#e(e),{href:a,origin:l,port:u,protocol:h,username:O,password:k,hostname:A}=i;if(this[n]={uri:a,protocol:h},this[o]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[y]=e.requestTls,this[b]=e.proxyTls,this[v]=e.headers||{},this[S]=r,e.auth&&e.token)throw new d(`opts.auth cannot be used in combination with opts.token`);e.auth?this[v][`proxy-authorization`]=`Basic ${e.auth}`:e.token?this[v][`proxy-authorization`]=e.token:O&&k&&(this[v][`proxy-authorization`]=`Basic ${Buffer.from(`${decodeURIComponent(O)}:${decodeURIComponent(k)}`).toString(`base64`)}`);let j=m({...e.proxyTls});this[x]=m({...e.requestTls});let M=e.factory||E,N=(e,t)=>{let{protocol:r}=new s(e);return!this[S]&&r===`http:`&&this[n].protocol===`http:`?new D(this[n].uri,{headers:this[v],connect:j,factory:M}):M(e,t)};this[_]=t(i,{connect:j}),this[g]=new c({...e,factory:N,connect:async(e,t)=>{let n=e.host;e.port||(n+=`:${C(e.protocol)}`);try{let{socket:r,statusCode:i}=await this[_].connect({origin:l,port:u,path:n,signal:e.signal,headers:{...this[v],host:e.host},servername:this[b]?.servername||A});if(i!==200&&(r.on(`error`,T).destroy(),t(new f(`Proxy response (${i}) !== 200 when HTTP Tunneling`))),e.protocol!==`https:`){t(null,r);return}let a;a=this[y]?this[y].servername:e.servername,this[x]({...e,servername:a,httpSocket:r},t)}catch(e){e.code===`ERR_TLS_CERT_ALTNAME_INVALID`?t(new p(e)):t(e)}}})}dispatch(e,t){let n=k(e.headers);if(A(n),n&&!(`host`in n)&&!(`Host`in n)){let{host:t}=new s(e.origin);n.host=t}return this[g].dispatch({...e,headers:n},t)}#e(e){return typeof e==`string`?new s(e):e instanceof s?e:new s(e.uri)}async[r](){await this[g].close(),await this[_].close()}async[i](){await this[g].destroy(),await this[_].destroy()}};function k(e){if(Array.isArray(e)){let t={};for(let n=0;ne.toLowerCase()===`proxy-authorization`))throw new d(`Proxy-Authorization should be sent in ProxyAgent constructor`)}t.exports=O})),ut=I(((e,t)=>{let n=Fe(),{kClose:r,kDestroy:i,kClosed:a,kDestroyed:o,kDispatch:s,kNoProxyAgent:c,kHttpProxyAgent:l,kHttpsProxyAgent:u}=ke(),d=lt(),f=ct(),p={"http:":80,"https:":443},m=!1;t.exports=class extends n{#e=null;#t=null;#n=null;constructor(e={}){super(),this.#n=e,m||(m=!0,process.emitWarning(`EnvHttpProxyAgent is experimental, expect them to change at any time.`,{code:`UNDICI-EHPA`}));let{httpProxy:t,httpsProxy:n,noProxy:r,...i}=e;this[c]=new f(i);let a=t??process.env.http_proxy??process.env.HTTP_PROXY;a?this[l]=new d({...i,uri:a}):this[l]=this[c];let o=n??process.env.https_proxy??process.env.HTTPS_PROXY;o?this[u]=new d({...i,uri:o}):this[u]=this[l],this.#a()}[s](e,t){let n=new URL(e.origin);return this.#r(n).dispatch(e,t)}async[r](){await this[c].close(),this[l][a]||await this[l].close(),this[u][a]||await this[u].close()}async[i](e){await this[c].destroy(e),this[l][o]||await this[l].destroy(e),this[u][o]||await this[u].destroy(e)}#r(e){let{protocol:t,host:n,port:r}=e;return n=n.replace(/:\d*$/,``).toLowerCase(),r=Number.parseInt(r,10)||p[t]||0,this.#i(n,r)?t===`https:`?this[u]:this[l]:this[c]}#i(e,t){if(this.#o&&this.#a(),this.#t.length===0)return!0;if(this.#e===`*`)return!1;for(let n=0;n{let n=L(`node:assert`),{kRetryHandlerDefaultRetry:r}=ke(),{RequestRetryError:i}=R(),{isDisturbed:a,parseHeaders:o,parseRangeHeader:s,wrapRequestBody:c}=z();function l(e){let t=Date.now();return new Date(e).getTime()-t}t.exports=class e{constructor(t,n){let{retryOptions:i,...a}=t,{retry:o,maxRetries:s,maxTimeout:l,minTimeout:u,timeoutFactor:d,methods:f,errorCodes:p,retryAfter:m,statusCodes:h}=i??{};this.dispatch=n.dispatch,this.handler=n.handler,this.opts={...a,body:c(t.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:o??e[r],retryAfter:m??!0,maxTimeout:l??30*1e3,minTimeout:u??500,timeoutFactor:d??2,maxRetries:s??5,methods:f??[`GET`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`TRACE`],statusCodes:h??[500,502,503,504,429],errorCodes:p??[`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`,`UND_ERR_SOCKET`]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(e=>{this.aborted=!0,this.abort?this.abort(e):this.reason=e})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,t,n){this.handler.onUpgrade&&this.handler.onUpgrade(e,t,n)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[r](e,{state:t,opts:n},r){let{statusCode:i,code:a,headers:o}=e,{method:s,retryOptions:c}=n,{maxRetries:u,minTimeout:d,maxTimeout:f,timeoutFactor:p,statusCodes:m,errorCodes:h,methods:g}=c,{counter:_}=t;if(a&&a!==`UND_ERR_REQ_RETRY`&&!h.includes(a)){r(e);return}if(Array.isArray(g)&&!g.includes(s)){r(e);return}if(i!=null&&Array.isArray(m)&&!m.includes(i)){r(e);return}if(_>u){r(e);return}let v=o?.[`retry-after`];v&&=(v=Number(v),Number.isNaN(v)?l(v):v*1e3);let y=v>0?Math.min(v,f):Math.min(d*p**(_-1),f);setTimeout(()=>r(null),y)}onHeaders(e,t,r,a){let c=o(t);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,t,r,a):(this.abort(new i(`Request failed`,e,{headers:c,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new i(`server does not support the range header and the payload was partially consumed`,e,{headers:c,data:{count:this.retryCount}})),!1;let t=s(c[`content-range`]);if(!t)return this.abort(new i(`Content-Range mismatch`,e,{headers:c,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==c.etag)return this.abort(new i(`ETag mismatch`,e,{headers:c,data:{count:this.retryCount}})),!1;let{start:a,size:o,end:l=o-1}=t;return n(this.start===a,`content-range mismatch`),n(this.end==null||this.end===l,`content-range mismatch`),this.resume=r,!0}if(this.end==null){if(e===206){let i=s(c[`content-range`]);if(i==null)return this.handler.onHeaders(e,t,r,a);let{start:o,size:l,end:u=l-1}=i;n(o!=null&&Number.isFinite(o),`content-range mismatch`),n(u!=null&&Number.isFinite(u),`invalid content-length`),this.start=o,this.end=u}if(this.end==null){let e=c[`content-length`];this.end=e==null?null:Number(e)-1}return n(Number.isFinite(this.start)),n(this.end==null||Number.isFinite(this.end),`invalid content-length`),this.resume=r,this.etag=c.etag==null?null:c.etag,this.etag!=null&&this.etag.startsWith(`W/`)&&(this.etag=null),this.handler.onHeaders(e,t,r,a)}let l=new i(`Request failed`,e,{headers:c,data:{count:this.retryCount}});return this.abort(l),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||a(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},t.bind(this));function t(e){if(e!=null||this.aborted||a(this.opts.body))return this.handler.onError(e);if(this.start!==0){let e={range:`bytes=${this.start}-${this.end??``}`};this.etag!=null&&(e[`if-match`]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...e}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(e){this.handler.onError(e)}}}}})),ft=I(((e,t)=>{let n=Pe(),r=dt();t.exports=class extends n{#e=null;#t=null;constructor(e,t={}){super(t),this.#e=e,this.#t=t}dispatch(e,t){let n=new r({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:t});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}}})),pt=I(((e,t)=>{let n=L(`node:assert`),{Readable:r}=L(`node:stream`),{RequestAbortedError:i,NotSupportedError:a,InvalidArgumentError:o,AbortError:s}=R(),c=z(),{ReadableStreamFrom:l}=z(),u=Symbol(`kConsume`),d=Symbol(`kReading`),f=Symbol(`kBody`),p=Symbol(`kAbort`),m=Symbol(`kContentType`),h=Symbol(`kContentLength`),g=()=>{};var _=class extends r{constructor({resume:e,abort:t,contentType:n=``,contentLength:r,highWaterMark:i=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:i}),this._readableState.dataEmitted=!1,this[p]=t,this[u]=null,this[f]=null,this[m]=n,this[h]=r,this[d]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new i),e&&this[p](),super.destroy(e)}_destroy(e,t){this[d]?t(e):setImmediate(()=>{t(e)})}on(e,...t){return(e===`data`||e===`readable`)&&(this[d]=!0),super.on(e,...t)}addListener(e,...t){return this.on(e,...t)}off(e,...t){let n=super.off(e,...t);return(e===`data`||e===`readable`)&&(this[d]=this.listenerCount(`data`)>0||this.listenerCount(`readable`)>0),n}removeListener(e,...t){return this.off(e,...t)}push(e){return this[u]&&e!==null?(T(this[u],e),this[d]?super.push(e):!0):super.push(e)}async text(){return b(this,`text`)}async json(){return b(this,`json`)}async blob(){return b(this,`blob`)}async bytes(){return b(this,`bytes`)}async arrayBuffer(){return b(this,`arrayBuffer`)}async formData(){throw new a}get bodyUsed(){return c.isDisturbed(this)}get body(){return this[f]||(this[f]=l(this),this[u]&&(this[f].getReader(),n(this[f].locked))),this[f]}async dump(e){let t=Number.isFinite(e?.limit)?e.limit:128*1024,n=e?.signal;if(n!=null&&(typeof n!=`object`||!(`aborted`in n)))throw new o(`signal must be an AbortSignal`);return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((e,r)=>{this[h]>t&&this.destroy(new s);let i=()=>{this.destroy(n.reason??new s)};n?.addEventListener(`abort`,i),this.on(`close`,function(){n?.removeEventListener(`abort`,i),n?.aborted?r(n.reason??new s):e(null)}).on(`error`,g).on(`data`,function(e){t-=e.length,t<=0&&this.destroy()}).resume()})}};function v(e){return e[f]&&e[f].locked===!0||e[u]}function y(e){return c.isDisturbed(e)||v(e)}async function b(e,t){return n(!e[u]),new Promise((n,r)=>{if(y(e)){let t=e._readableState;t.destroyed&&t.closeEmitted===!1?e.on(`error`,e=>{r(e)}).on(`close`,()=>{r(TypeError(`unusable`))}):r(t.errored??TypeError(`unusable`))}else queueMicrotask(()=>{e[u]={type:t,stream:e,resolve:n,reject:r,length:0,body:[]},e.on(`error`,function(e){E(this[u],e)}).on(`close`,function(){this[u].body!==null&&E(this[u],new i)}),x(e[u])})})}function x(e){if(e.body===null)return;let{_readableState:t}=e.stream;if(t.bufferIndex){let n=t.bufferIndex,r=t.buffer.length;for(let i=n;i2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return n.utf8Slice(i,r)}function C(e,t){if(e.length===0||t===0)return new Uint8Array;if(e.length===1)return new Uint8Array(e[0]);let n=new Uint8Array(Buffer.allocUnsafeSlow(t).buffer),r=0;for(let t=0;t{let n=L(`node:assert`),{ResponseStatusCodeError:r}=R(),{chunksDecode:i}=pt();async function a({callback:e,body:t,contentType:a,statusCode:c,statusMessage:l,headers:u}){n(t);let d=[],f=0;try{for await(let e of t)if(d.push(e),f+=e.length,f>131072){d=[],f=0;break}}catch{d=[],f=0}let p=`Response status code ${c}${l?`: ${l}`:``}`;if(c===204||!a||!f){queueMicrotask(()=>e(new r(p,c,u)));return}let m=Error.stackTraceLimit;Error.stackTraceLimit=0;let h;try{o(a)?h=JSON.parse(i(d,f)):s(a)&&(h=i(d,f))}catch{}finally{Error.stackTraceLimit=m}queueMicrotask(()=>e(new r(p,c,u,h)))}let o=e=>e.length>15&&e[11]===`/`&&e[0]===`a`&&e[1]===`p`&&e[2]===`p`&&e[3]===`l`&&e[4]===`i`&&e[5]===`c`&&e[6]===`a`&&e[7]===`t`&&e[8]===`i`&&e[9]===`o`&&e[10]===`n`&&e[12]===`j`&&e[13]===`s`&&e[14]===`o`&&e[15]===`n`,s=e=>e.length>4&&e[4]===`/`&&e[0]===`t`&&e[1]===`e`&&e[2]===`x`&&e[3]===`t`;t.exports={getResolveErrorBodyCallback:a,isContentTypeApplicationJson:o,isContentTypeText:s}})),ht=I(((e,t)=>{let n=L(`node:assert`),{Readable:r}=pt(),{InvalidArgumentError:i,RequestAbortedError:a}=R(),o=z(),{getResolveErrorBodyCallback:s}=mt(),{AsyncResource:c}=L(`node:async_hooks`);var l=class extends c{constructor(e,t){if(!e||typeof e!=`object`)throw new i(`invalid opts`);let{signal:n,method:r,opaque:s,body:c,onInfo:l,responseHeaders:u,throwOnError:d,highWaterMark:f}=e;try{if(typeof t!=`function`)throw new i(`invalid callback`);if(f&&(typeof f!=`number`||f<0))throw new i(`invalid highWaterMark`);if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new i(`signal must be an EventEmitter or EventTarget`);if(r===`CONNECT`)throw new i(`invalid method`);if(l&&typeof l!=`function`)throw new i(`invalid onInfo callback`);super(`UNDICI_REQUEST`)}catch(e){throw o.isStream(c)&&o.destroy(c.on(`error`,o.nop),e),e}this.method=r,this.responseHeaders=u||null,this.opaque=s||null,this.callback=t,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.throwOnError=d,this.highWaterMark=f,this.signal=n,this.reason=null,this.removeAbortListener=null,o.isStream(c)&&c.on(`error`,e=>{this.onError(e)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new a:this.removeAbortListener=o.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new a,this.res?o.destroy(this.res.on(`error`,o.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&=(this.res?.off(`close`,this.removeAbortListener),this.removeAbortListener(),null)}))}onConnect(e,t){if(this.reason){e(this.reason);return}n(this.callback),this.abort=e,this.context=t}onHeaders(e,t,n,i){let{callback:a,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,p=d===`raw`?o.parseRawHeaders(t):o.parseHeaders(t);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:p});return}let m=d===`raw`?o.parseHeaders(t):p,h=m[`content-type`],g=m[`content-length`],_=new r({resume:n,abort:l,contentType:h,contentLength:this.method!==`HEAD`&&g?Number(g):null,highWaterMark:f});this.removeAbortListener&&_.on(`close`,this.removeAbortListener),this.callback=null,this.res=_,a!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(s,null,{callback:a,body:_,contentType:h,statusCode:e,statusMessage:i,headers:p}):this.runInAsyncScope(a,null,null,{statusCode:e,headers:p,trailers:this.trailers,opaque:c,body:_,context:u}))}onData(e){return this.res.push(e)}onComplete(e){o.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:t,callback:n,body:r,opaque:i}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:i})})),t&&(this.res=null,queueMicrotask(()=>{o.destroy(t,e)})),r&&(this.body=null,o.destroy(r,e)),this.removeAbortListener&&=(t?.off(`close`,this.removeAbortListener),this.removeAbortListener(),null)}};function u(e,t){if(t===void 0)return new Promise((t,n)=>{u.call(this,e,(e,r)=>e?n(e):t(r))});try{this.dispatch(e,new l(e,t))}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}t.exports=u,t.exports.RequestHandler=l})),gt=I(((e,t)=>{let{addAbortListener:n}=z(),{RequestAbortedError:r}=R(),i=Symbol(`kListener`),a=Symbol(`kSignal`);function o(e){e.abort?e.abort(e[a]?.reason):e.reason=e[a]?.reason??new r,c(e)}function s(e,t){if(e.reason=null,e[a]=null,e[i]=null,t){if(t.aborted){o(e);return}e[a]=t,e[i]=()=>{o(e)},n(e[a],e[i])}}function c(e){e[a]&&(`removeEventListener`in e[a]?e[a].removeEventListener(`abort`,e[i]):e[a].removeListener(`abort`,e[i]),e[a]=null,e[i]=null)}t.exports={addSignal:s,removeSignal:c}})),_t=I(((e,t)=>{let n=L(`node:assert`),{finished:r,PassThrough:i}=L(`node:stream`),{InvalidArgumentError:a,InvalidReturnValueError:o}=R(),s=z(),{getResolveErrorBodyCallback:c}=mt(),{AsyncResource:l}=L(`node:async_hooks`),{addSignal:u,removeSignal:d}=gt();var f=class extends l{constructor(e,t,n){if(!e||typeof e!=`object`)throw new a(`invalid opts`);let{signal:r,method:i,opaque:o,body:c,onInfo:l,responseHeaders:d,throwOnError:f}=e;try{if(typeof n!=`function`)throw new a(`invalid callback`);if(typeof t!=`function`)throw new a(`invalid factory`);if(r&&typeof r.on!=`function`&&typeof r.addEventListener!=`function`)throw new a(`signal must be an EventEmitter or EventTarget`);if(i===`CONNECT`)throw new a(`invalid method`);if(l&&typeof l!=`function`)throw new a(`invalid onInfo callback`);super(`UNDICI_STREAM`)}catch(e){throw s.isStream(c)&&s.destroy(c.on(`error`,s.nop),e),e}this.responseHeaders=d||null,this.opaque=o||null,this.factory=t,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=c,this.onInfo=l||null,this.throwOnError=f||!1,s.isStream(c)&&c.on(`error`,e=>{this.onError(e)}),u(this,r)}onConnect(e,t){if(this.reason){e(this.reason);return}n(this.callback),this.abort=e,this.context=t}onHeaders(e,t,n,a){let{factory:l,opaque:u,context:d,callback:f,responseHeaders:p}=this,m=p===`raw`?s.parseRawHeaders(t):s.parseHeaders(t);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:m});return}this.factory=null;let h;if(this.throwOnError&&e>=400){let n=(p===`raw`?s.parseHeaders(t):m)[`content-type`];h=new i,this.callback=null,this.runInAsyncScope(c,null,{callback:f,body:h,contentType:n,statusCode:e,statusMessage:a,headers:m})}else{if(l===null)return;if(h=this.runInAsyncScope(l,null,{statusCode:e,headers:m,opaque:u,context:d}),!h||typeof h.write!=`function`||typeof h.end!=`function`||typeof h.on!=`function`)throw new o(`expected Writable`);r(h,{readable:!1},e=>{let{callback:t,res:n,opaque:r,trailers:i,abort:a}=this;this.res=null,(e||!n.readable)&&s.destroy(n,e),this.callback=null,this.runInAsyncScope(t,null,e||null,{opaque:r,trailers:i}),e&&a()})}return h.on(`drain`,n),this.res=h,(h.writableNeedDrain===void 0?h._writableState?.needDrain:h.writableNeedDrain)!==!0}onData(e){let{res:t}=this;return t?t.write(e):!0}onComplete(e){let{res:t}=this;d(this),t&&(this.trailers=s.parseHeaders(e),t.end())}onError(e){let{res:t,callback:n,opaque:r,body:i}=this;d(this),this.factory=null,t?(this.res=null,s.destroy(t,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:r})})),i&&(this.body=null,s.destroy(i,e))}};function p(e,t,n){if(n===void 0)return new Promise((n,r)=>{p.call(this,e,t,(e,t)=>e?r(e):n(t))});try{this.dispatch(e,new f(e,t,n))}catch(t){if(typeof n!=`function`)throw t;let r=e?.opaque;queueMicrotask(()=>n(t,{opaque:r}))}}t.exports=p})),vt=I(((e,t)=>{let{Readable:n,Duplex:r,PassThrough:i}=L(`node:stream`),{InvalidArgumentError:a,InvalidReturnValueError:o,RequestAbortedError:s}=R(),c=z(),{AsyncResource:l}=L(`node:async_hooks`),{addSignal:u,removeSignal:d}=gt(),f=L(`node:assert`),p=Symbol(`resume`);var m=class extends n{constructor(){super({autoDestroy:!0}),this[p]=null}_read(){let{[p]:e}=this;e&&(this[p]=null,e())}_destroy(e,t){this._read(),t(e)}},h=class extends n{constructor(e){super({autoDestroy:!0}),this[p]=e}_read(){this[p]()}_destroy(e,t){!e&&!this._readableState.endEmitted&&(e=new s),t(e)}},g=class extends l{constructor(e,t){if(!e||typeof e!=`object`)throw new a(`invalid opts`);if(typeof t!=`function`)throw new a(`invalid handler`);let{signal:n,method:i,opaque:o,onInfo:l,responseHeaders:f}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new a(`signal must be an EventEmitter or EventTarget`);if(i===`CONNECT`)throw new a(`invalid method`);if(l&&typeof l!=`function`)throw new a(`invalid onInfo callback`);super(`UNDICI_PIPELINE`),this.opaque=o||null,this.responseHeaders=f||null,this.handler=t,this.abort=null,this.context=null,this.onInfo=l||null,this.req=new m().on(`error`,c.nop),this.ret=new r({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{let{body:e}=this;e?.resume&&e.resume()},write:(e,t,n)=>{let{req:r}=this;r.push(e,t)||r._readableState.destroyed?n():r[p]=n},destroy:(e,t)=>{let{body:n,req:r,res:i,ret:a,abort:o}=this;!e&&!a._readableState.endEmitted&&(e=new s),o&&e&&o(),c.destroy(n,e),c.destroy(r,e),c.destroy(i,e),d(this),t(e)}}).on(`prefinish`,()=>{let{req:e}=this;e.push(null)}),this.res=null,u(this,n)}onConnect(e,t){let{ret:n,res:r}=this;if(this.reason){e(this.reason);return}f(!r,`pipeline cannot be retried`),f(!n.destroyed),this.abort=e,this.context=t}onHeaders(e,t,n){let{opaque:r,handler:i,context:a}=this;if(e<200){if(this.onInfo){let n=this.responseHeaders===`raw`?c.parseRawHeaders(t):c.parseHeaders(t);this.onInfo({statusCode:e,headers:n})}return}this.res=new h(n);let l;try{this.handler=null;let n=this.responseHeaders===`raw`?c.parseRawHeaders(t):c.parseHeaders(t);l=this.runInAsyncScope(i,null,{statusCode:e,headers:n,opaque:r,body:this.res,context:a})}catch(e){throw this.res.on(`error`,c.nop),e}if(!l||typeof l.on!=`function`)throw new o(`expected Readable`);l.on(`data`,e=>{let{ret:t,body:n}=this;!t.push(e)&&n.pause&&n.pause()}).on(`error`,e=>{let{ret:t}=this;c.destroy(t,e)}).on(`end`,()=>{let{ret:e}=this;e.push(null)}).on(`close`,()=>{let{ret:e}=this;e._readableState.ended||c.destroy(e,new s)}),this.body=l}onData(e){let{res:t}=this;return t.push(e)}onComplete(e){let{res:t}=this;t.push(null)}onError(e){let{ret:t}=this;this.handler=null,c.destroy(t,e)}};function _(e,t){try{let n=new g(e,t);return this.dispatch({...e,body:n.req},n),n.ret}catch(e){return new i().destroy(e)}}t.exports=_})),yt=I(((e,t)=>{let{InvalidArgumentError:n,SocketError:r}=R(),{AsyncResource:i}=L(`node:async_hooks`),a=z(),{addSignal:o,removeSignal:s}=gt(),c=L(`node:assert`);var l=class extends i{constructor(e,t){if(!e||typeof e!=`object`)throw new n(`invalid opts`);if(typeof t!=`function`)throw new n(`invalid callback`);let{signal:r,opaque:i,responseHeaders:a}=e;if(r&&typeof r.on!=`function`&&typeof r.addEventListener!=`function`)throw new n(`signal must be an EventEmitter or EventTarget`);super(`UNDICI_UPGRADE`),this.responseHeaders=a||null,this.opaque=i||null,this.callback=t,this.abort=null,this.context=null,o(this,r)}onConnect(e,t){if(this.reason){e(this.reason);return}c(this.callback),this.abort=e,this.context=null}onHeaders(){throw new r(`bad upgrade`,null)}onUpgrade(e,t,n){c(e===101);let{callback:r,opaque:i,context:o}=this;s(this),this.callback=null;let l=this.responseHeaders===`raw`?a.parseRawHeaders(t):a.parseHeaders(t);this.runInAsyncScope(r,null,null,{headers:l,socket:n,opaque:i,context:o})}onError(e){let{callback:t,opaque:n}=this;s(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:n})}))}};function u(e,t){if(t===void 0)return new Promise((t,n)=>{u.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new l(e,t);this.dispatch({...e,method:e.method||`GET`,upgrade:e.protocol||`Websocket`},n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}t.exports=u})),bt=I(((e,t)=>{let n=L(`node:assert`),{AsyncResource:r}=L(`node:async_hooks`),{InvalidArgumentError:i,SocketError:a}=R(),o=z(),{addSignal:s,removeSignal:c}=gt();var l=class extends r{constructor(e,t){if(!e||typeof e!=`object`)throw new i(`invalid opts`);if(typeof t!=`function`)throw new i(`invalid callback`);let{signal:n,opaque:r,responseHeaders:a}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new i(`signal must be an EventEmitter or EventTarget`);super(`UNDICI_CONNECT`),this.opaque=r||null,this.responseHeaders=a||null,this.callback=t,this.abort=null,s(this,n)}onConnect(e,t){if(this.reason){e(this.reason);return}n(this.callback),this.abort=e,this.context=t}onHeaders(){throw new a(`bad connect`,null)}onUpgrade(e,t,n){let{callback:r,opaque:i,context:a}=this;c(this),this.callback=null;let s=t;s!=null&&(s=this.responseHeaders===`raw`?o.parseRawHeaders(t):o.parseHeaders(t)),this.runInAsyncScope(r,null,null,{statusCode:e,headers:s,socket:n,opaque:i,context:a})}onError(e){let{callback:t,opaque:n}=this;c(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:n})}))}};function u(e,t){if(t===void 0)return new Promise((t,n)=>{u.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new l(e,t);this.dispatch({...e,method:`CONNECT`},n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}t.exports=u})),xt=I(((e,t)=>{t.exports.request=ht(),t.exports.stream=_t(),t.exports.pipeline=vt(),t.exports.upgrade=yt(),t.exports.connect=bt()})),St=I(((e,t)=>{let{UndiciError:n}=R(),r=Symbol.for(`undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED`);t.exports={MockNotMatchedError:class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`MockNotMatchedError`,this.message=t||`The request does not match any registered mock dispatches`,this.code=`UND_MOCK_ERR_MOCK_NOT_MATCHED`}static[Symbol.hasInstance](e){return e&&e[r]===!0}[r]=!0}}})),Ct=I(((e,t)=>{t.exports={kAgent:Symbol(`agent`),kOptions:Symbol(`options`),kFactory:Symbol(`factory`),kDispatches:Symbol(`dispatches`),kDispatchKey:Symbol(`dispatch key`),kDefaultHeaders:Symbol(`default headers`),kDefaultTrailers:Symbol(`default trailers`),kContentLength:Symbol(`content length`),kMockAgent:Symbol(`mock agent`),kMockAgentSet:Symbol(`mock agent set`),kMockAgentGet:Symbol(`mock agent get`),kMockDispatch:Symbol(`mock dispatch`),kClose:Symbol(`close`),kOriginalClose:Symbol(`original agent close`),kOrigin:Symbol(`origin`),kIsMockActive:Symbol(`is mock active`),kNetConnect:Symbol(`net connect`),kGetNetConnect:Symbol(`get net connect`),kConnected:Symbol(`connected`)}})),wt=I(((e,t)=>{let{MockNotMatchedError:n}=St(),{kDispatches:r,kMockAgent:i,kOriginalDispatch:a,kOrigin:o,kGetNetConnect:s}=Ct(),{buildURL:c}=z(),{STATUS_CODES:l}=L(`node:http`),{types:{isPromise:u}}=L(`node:util`);function d(e,t){return typeof e==`string`?e===t:e instanceof RegExp?e.test(t):typeof e==`function`?e(t)===!0:!1}function f(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.toLocaleLowerCase(),t]))}function p(e,t){if(Array.isArray(e)){for(let n=0;n!e).filter(({path:e})=>d(g(e),i));if(a.length===0)throw new n(`Mock dispatch not matched for path '${i}'`);if(a=a.filter(({method:e})=>d(e,t.method)),a.length===0)throw new n(`Mock dispatch not matched for method '${t.method}' on path '${i}'`);if(a=a.filter(({body:e})=>e===void 0?!0:d(e,t.body)),a.length===0)throw new n(`Mock dispatch not matched for body '${t.body}' on path '${i}'`);if(a=a.filter(e=>h(e,t.headers)),a.length===0)throw new n(`Mock dispatch not matched for headers '${typeof t.headers==`object`?JSON.stringify(t.headers):t.headers}' on path '${i}'`);return a[0]}function b(e,t,n){let r={timesInvoked:0,times:1,persist:!1,consumed:!1},i=typeof n==`function`?{callback:n}:{...n},a={...r,...t,pending:!0,data:{error:null,...i}};return e.push(a),a}function x(e,t){let n=e.findIndex(e=>e.consumed?_(e,t):!1);n!==-1&&e.splice(n,1)}function S(e){let{path:t,method:n,body:r,headers:i,query:a}=e;return{path:t,method:n,body:r,headers:i,query:a}}function C(e){let t=Object.keys(e),n=[];for(let r=0;r=h,i.pending=p0?setTimeout(()=>{g(this[r])},d):g(this[r]);function g(r,i=o){let l=Array.isArray(e.headers)?m(e.headers):e.headers,d=typeof i==`function`?i({...e,headers:l}):i;if(u(d)){d.then(e=>g(r,e));return}let f=v(d),p=C(s),h=C(c);t.onConnect?.(e=>t.onError(e),null),t.onHeaders?.(a,p,_,w(a)),t.onData?.(Buffer.from(f)),t.onComplete?.(h),x(r,n)}function _(){}return!0}function D(){let e=this[i],t=this[o],r=this[a];return function(i,a){if(e.isMockActive)try{E.call(this,i,a)}catch(o){if(o instanceof n){let c=e[s]();if(c===!1)throw new n(`${o.message}: subsequent request to origin ${t} was not allowed (net.connect disabled)`);if(O(c,t))r.call(this,i,a);else throw new n(`${o.message}: subsequent request to origin ${t} was not allowed (net.connect is not enabled for this origin)`)}else throw o}else r.call(this,i,a)}}function O(e,t){let n=new URL(t);return e===!0?!0:!!(Array.isArray(e)&&e.some(e=>d(e,n.host)))}function k(e){if(e){let{agent:t,...n}=e;return n}}t.exports={getResponseData:v,getMockDispatch:y,addMockDispatch:b,deleteMockDispatch:x,buildKey:S,generateKeyValues:C,matchValue:d,getResponse:T,getStatusText:w,mockDispatch:E,buildMockDispatch:D,checkNetConnect:O,buildMockOptions:k,getHeaderByName:p,buildHeadersFromArray:m}})),Tt=I(((e,t)=>{let{getResponseData:n,buildKey:r,addMockDispatch:i}=wt(),{kDispatches:a,kDispatchKey:o,kDefaultHeaders:s,kDefaultTrailers:c,kContentLength:l,kMockDispatch:u}=Ct(),{InvalidArgumentError:d}=R(),{buildURL:f}=z();var p=class{constructor(e){this[u]=e}delay(e){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw new d(`waitInMs must be a valid integer > 0`);return this[u].delay=e,this}persist(){return this[u].persist=!0,this}times(e){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw new d(`repeatTimes must be a valid integer > 0`);return this[u].times=e,this}},m=class{constructor(e,t){if(typeof e!=`object`)throw new d(`opts must be an object`);if(e.path===void 0)throw new d(`opts.path must be defined`);if(e.method===void 0&&(e.method=`GET`),typeof e.path==`string`)if(e.query)e.path=f(e.path,e.query);else{let t=new URL(e.path,`data://`);e.path=t.pathname+t.search}typeof e.method==`string`&&(e.method=e.method.toUpperCase()),this[o]=r(e),this[a]=t,this[s]={},this[c]={},this[l]=!1}createMockScopeDispatchData({statusCode:e,data:t,responseOptions:r}){let i=n(t),a=this[l]?{"content-length":i.length}:{};return{statusCode:e,data:t,headers:{...this[s],...a,...r.headers},trailers:{...this[c],...r.trailers}}}validateReplyParameters(e){if(e.statusCode===void 0)throw new d(`statusCode must be defined`);if(typeof e.responseOptions!=`object`||e.responseOptions===null)throw new d(`responseOptions must be an object`)}reply(e){if(typeof e==`function`)return new p(i(this[a],this[o],t=>{let n=e(t);if(typeof n!=`object`||!n)throw new d(`reply options callback must return an object`);let r={data:``,responseOptions:{},...n};return this.validateReplyParameters(r),{...this.createMockScopeDispatchData(r)}}));let t={statusCode:e,data:arguments[1]===void 0?``:arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(t);let n=this.createMockScopeDispatchData(t);return new p(i(this[a],this[o],n))}replyWithError(e){if(e===void 0)throw new d(`error must be defined`);return new p(i(this[a],this[o],{error:e}))}defaultReplyHeaders(e){if(e===void 0)throw new d(`headers must be defined`);return this[s]=e,this}defaultReplyTrailers(e){if(e===void 0)throw new d(`trailers must be defined`);return this[c]=e,this}replyContentLength(){return this[l]=!0,this}};t.exports.MockInterceptor=m,t.exports.MockScope=p})),Et=I(((e,t)=>{let{promisify:n}=L(`node:util`),r=nt(),{buildMockDispatch:i}=wt(),{kDispatches:a,kMockAgent:o,kClose:s,kOriginalClose:c,kOrigin:l,kOriginalDispatch:u,kConnected:d}=Ct(),{MockInterceptor:f}=Tt(),p=ke(),{InvalidArgumentError:m}=R();t.exports=class extends r{constructor(e,t){if(super(e,t),!t||!t.agent||typeof t.agent.dispatch!=`function`)throw new m(`Argument opts.agent must implement Agent`);this[o]=t.agent,this[l]=e,this[a]=[],this[d]=1,this[u]=this.dispatch,this[c]=this.close.bind(this),this.dispatch=i.call(this),this.close=this[s]}get[p.kConnected](){return this[d]}intercept(e){return new f(e,this[a])}async[s](){await n(this[c])(),this[d]=0,this[o][p.kClients].delete(this[l])}}})),Dt=I(((e,t)=>{let{promisify:n}=L(`node:util`),r=ot(),{buildMockDispatch:i}=wt(),{kDispatches:a,kMockAgent:o,kClose:s,kOriginalClose:c,kOrigin:l,kOriginalDispatch:u,kConnected:d}=Ct(),{MockInterceptor:f}=Tt(),p=ke(),{InvalidArgumentError:m}=R();t.exports=class extends r{constructor(e,t){if(super(e,t),!t||!t.agent||typeof t.agent.dispatch!=`function`)throw new m(`Argument opts.agent must implement Agent`);this[o]=t.agent,this[l]=e,this[a]=[],this[d]=1,this[u]=this.dispatch,this[c]=this.close.bind(this),this.dispatch=i.call(this),this.close=this[s]}get[p.kConnected](){return this[d]}intercept(e){return new f(e,this[a])}async[s](){await n(this[c])(),this[d]=0,this[o][p.kClients].delete(this[l])}}})),Ot=I(((e,t)=>{let n={pronoun:`it`,is:`is`,was:`was`,this:`this`},r={pronoun:`they`,is:`are`,was:`were`,this:`these`};t.exports=class{constructor(e,t){this.singular=e,this.plural=t}pluralize(e){let t=e===1,i=t?n:r,a=t?this.singular:this.plural;return{...i,count:e,noun:a}}}})),kt=I(((e,t)=>{let{Transform:n}=L(`node:stream`),{Console:r}=L(`node:console`),i=process.versions.icu?`✅`:`Y `,a=process.versions.icu?`❌`:`N `;t.exports=class{constructor({disableColors:e}={}){this.transform=new n({transform(e,t,n){n(null,e)}}),this.logger=new r({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let t=e.map(({method:e,path:t,data:{statusCode:n},persist:r,times:o,timesInvoked:s,origin:c})=>({Method:e,Origin:c,Path:t,"Status code":n,Persistent:r?i:a,Invocations:s,Remaining:r?1/0:o-s}));return this.logger.table(t),this.transform.read().toString()}}})),At=I(((e,t)=>{let{kClients:n}=ke(),r=ct(),{kAgent:i,kMockAgentSet:a,kMockAgentGet:o,kDispatches:s,kIsMockActive:c,kNetConnect:l,kGetNetConnect:u,kOptions:d,kFactory:f}=Ct(),p=Et(),m=Dt(),{matchValue:h,buildMockOptions:g}=wt(),{InvalidArgumentError:_,UndiciError:v}=R(),y=Pe(),b=Ot(),x=kt();t.exports=class extends y{constructor(e){if(super(e),this[l]=!0,this[c]=!0,e?.agent&&typeof e.agent.dispatch!=`function`)throw new _(`Argument opts.agent must implement Agent`);let t=e?.agent?e.agent:new r(e);this[i]=t,this[n]=t[n],this[d]=g(e)}get(e){let t=this[o](e);return t||(t=this[f](e),this[a](e,t)),t}dispatch(e,t){return this.get(e.origin),this[i].dispatch(e,t)}async close(){await this[i].close(),this[n].clear()}deactivate(){this[c]=!1}activate(){this[c]=!0}enableNetConnect(e){if(typeof e==`string`||typeof e==`function`||e instanceof RegExp)Array.isArray(this[l])?this[l].push(e):this[l]=[e];else if(e===void 0)this[l]=!0;else throw new _(`Unsupported matcher. Must be one of String|Function|RegExp.`)}disableNetConnect(){this[l]=!1}get isMockActive(){return this[c]}[a](e,t){this[n].set(e,t)}[f](e){let t=Object.assign({agent:this},this[d]);return this[d]&&this[d].connections===1?new p(e,t):new m(e,t)}[o](e){let t=this[n].get(e);if(t)return t;if(typeof e!=`string`){let t=this[f](`http://localhost:9999`);return this[a](e,t),t}for(let[t,r]of Array.from(this[n]))if(r&&typeof t!=`string`&&h(t,e)){let t=this[f](e);return this[a](e,t),t[s]=r[s],t}}[u](){return this[l]}pendingInterceptors(){let e=this[n];return Array.from(e.entries()).flatMap(([e,t])=>t[s].map(t=>({...t,origin:e}))).filter(({pending:e})=>e)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new x}={}){let t=this.pendingInterceptors();if(t.length===0)return;let n=new b(`interceptor`,`interceptors`).pluralize(t.length);throw new v(` +`,`latin1`),t!==null&&r!==t){if(n[ie])throw new o;process.emitWarning(new o)}e[y].timeout&&e[y].timeoutType===3&&e[y].timeout.refresh&&e[y].timeout.refresh(),n[le]()}}destroy(e){let{socket:t,client:r,abort:i}=this;t[w]=!1,e&&(n(r[x]<=1,`pipeline should only contain this request`),i(e))}};t.exports=Te})),$e=I(((e,t)=>{let n=L(`node:assert`),{pipeline:r}=L(`node:stream`),i=z(),{RequestContentLengthMismatchError:a,RequestAbortedError:o,SocketError:s,InformationalError:c}=R(),{kUrl:l,kReset:u,kClient:d,kRunning:f,kPending:p,kQueue:m,kPendingIdx:h,kRunningIdx:g,kError:_,kSocket:v,kStrictContentLength:y,kOnError:b,kMaxConcurrentStreams:x,kHTTP2Session:S,kResume:C,kSize:w,kHTTPContext:T}=ke(),E=Symbol(`open streams`),D,O=!1,k;try{k=L(`node:http2`)}catch{k={constants:{}}}let{constants:{HTTP2_HEADER_AUTHORITY:A,HTTP2_HEADER_METHOD:j,HTTP2_HEADER_PATH:M,HTTP2_HEADER_SCHEME:N,HTTP2_HEADER_CONTENT_LENGTH:P,HTTP2_HEADER_EXPECT:ee,HTTP2_HEADER_STATUS:te}}=k;function ne(e){let t=[];for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.push(Buffer.from(n),Buffer.from(e));else t.push(Buffer.from(n),Buffer.from(r));return t}async function F(e,t){e[v]=t,O||(O=!0,process.emitWarning(`H2 support is experimental, expect them to change at any time.`,{code:`UNDICI-H2`}));let r=k.connect(e[l],{createConnection:()=>t,peerMaxConcurrentStreams:e[x]});r[E]=0,r[d]=e,r[v]=t,i.addListener(r,`error`,ie),i.addListener(r,`frameError`,ae),i.addListener(r,`end`,oe),i.addListener(r,`goaway`,se),i.addListener(r,`close`,function(){let{[d]:e}=this,{[v]:t}=e,r=this[v][_]||this[_]||new s(`closed`,i.getSocketInfo(t));if(e[S]=null,e.destroyed){n(e[p]===0);let t=e[m].splice(e[g]);for(let n=0;n{a=!0}),{version:`h2`,defaultPipelining:1/0,write(...t){return le(e,...t)},resume(){re(e)},destroy(e,n){a?queueMicrotask(n):t.destroy(e).on(`close`,n)},get destroyed(){return t.destroyed},busy(){return!1}}}function re(e){let t=e[v];t?.destroyed===!1&&(e[w]===0&&e[x]===0?(t.unref(),e[S].unref()):(t.ref(),e[S].ref()))}function ie(e){n(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`),this[v][_]=e,this[d][b](e)}function ae(e,t,n){if(n===0){let n=new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`);this[v][_]=n,this[d][b](n)}}function oe(){let e=new s(`other side closed`,i.getSocketInfo(this[v]));this.destroy(e),i.destroy(this[v],e)}function se(e){let t=this[_]||new s(`HTTP/2: "GOAWAY" frame received with code ${e}`,i.getSocketInfo(this)),r=this[d];if(r[v]=null,r[T]=null,this[S]!=null&&(this[S].destroy(t),this[S]=null),i.destroy(this[v],t),r[g]{t.aborted||t.completed||(n||=new o,i.errorRequest(e,t,n),T!=null&&i.destroy(T,n),i.destroy(x,n),e[m][e[g]++]=null,e[C]())};try{t.onConnect(F)}catch(n){i.errorRequest(e,t,n)}if(t.aborted)return!1;if(s===`CONNECT`)return r.ref(),T=r.request(w,{endStream:!1,signal:_}),T.id&&!T.pending?(t.onUpgrade(null,null,T),++r[E],e[m][e[g]++]=null):T.once(`ready`,()=>{t.onUpgrade(null,null,T),++r[E],e[m][e[g]++]=null}),T.once(`close`,()=>{--r[E],r[E]===0&&r.unref()}),!0;w[M]=u,w[N]=`https`;let re=s===`PUT`||s===`POST`||s===`PATCH`;x&&typeof x.read==`function`&&x.read(0);let ie=i.bodyLength(x);if(i.isFormDataLike(x)){D??=Ze().extractBody;let[e,t]=D(x);w[`content-type`]=t,x=e.stream,ie=e.length}if(ie??=t.contentLength,(ie===0||!re)&&(ie=null),ce(s)&&ie>0&&t.contentLength!=null&&t.contentLength!==ie){if(e[y])return i.errorRequest(e,t,new a),!1;process.emitWarning(new a)}ie!=null&&(n(x,`no body must not have content length`),w[P]=`${ie}`),r.ref();let ae=s===`GET`||s===`HEAD`||x===null;return p?(w[ee]=`100-continue`,T=r.request(w,{endStream:ae,signal:_}),T.once(`continue`,oe)):(T=r.request(w,{endStream:ae,signal:_}),oe()),++r[E],T.once(`response`,n=>{let{[te]:r,...a}=n;if(t.onResponseStarted(),t.aborted){let n=new o;i.errorRequest(e,t,n),i.destroy(T,n);return}t.onHeaders(Number(r),ne(a),T.resume.bind(T),``)===!1&&T.pause(),T.on(`data`,e=>{t.onData(e)===!1&&T.pause()})}),T.once(`end`,()=>{(T.state?.state==null||T.state.state<6)&&t.onComplete([]),r[E]===0&&r.unref(),F(new c(`HTTP/2: stream half-closed (remote)`)),e[m][e[g]++]=null,e[h]=e[g],e[C]()}),T.once(`close`,()=>{--r[E],r[E]===0&&r.unref()}),T.once(`error`,function(e){F(e)}),T.once(`frameError`,(e,t)=>{F(new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`))}),!0;function oe(){!x||ie===0?ue(F,T,null,e,t,e[v],ie,re):i.isBuffer(x)?ue(F,T,x,e,t,e[v],ie,re):i.isBlobLike(x)?typeof x.stream==`function`?fe(F,T,x.stream(),e,t,e[v],ie,re):I(F,T,x,e,t,e[v],ie,re):i.isStream(x)?de(F,e[v],re,T,x,e,t,ie):i.isIterable(x)?fe(F,T,x,e,t,e[v],ie,re):n(!1)}}function ue(e,t,r,a,o,s,c,l){try{r!=null&&i.isBuffer(r)&&(n(c===r.byteLength,`buffer body must have content length`),t.cork(),t.write(r),t.uncork(),t.end(),o.onBodySent(r)),l||(s[u]=!0),o.onRequestSent(),a[C]()}catch(t){e(t)}}function de(e,t,a,o,s,c,l,d){n(d!==0||c[f]===0,`stream body cannot be pipelined`);let p=r(s,o,n=>{n?(i.destroy(p,n),e(n)):(i.removeAllListeners(p),l.onRequestSent(),a||(t[u]=!0),c[C]())});i.addListener(p,`data`,m);function m(e){l.onBodySent(e)}}async function I(e,t,r,i,o,s,c,l){n(c===r.size,`blob body must have content length`);try{if(c!=null&&c!==r.size)throw new a;let e=Buffer.from(await r.arrayBuffer());t.cork(),t.write(e),t.uncork(),t.end(),o.onBodySent(e),o.onRequestSent(),l||(s[u]=!0),i[C]()}catch(t){e(t)}}async function fe(e,t,r,i,a,o,s,c){n(s!==0||i[f]===0,`iterator body cannot be pipelined`);let l=null;function d(){if(l){let e=l;l=null,e()}}let p=()=>new Promise((e,t)=>{n(l===null),o[_]?t(o[_]):l=e});t.on(`close`,d).on(`drain`,d);try{for await(let e of r){if(o[_])throw o[_];let n=t.write(e);a.onBodySent(e),n||await p()}t.end(),a.onRequestSent(),c||(o[u]=!0),i[C]()}catch(t){e(t)}finally{t.off(`close`,d).off(`drain`,d)}}t.exports=F})),et=I(((e,t)=>{let n=z(),{kBodyUsed:r}=ke(),i=L(`node:assert`),{InvalidArgumentError:a}=R(),o=L(`node:events`),s=[300,301,302,303,307,308],c=Symbol(`body`);var l=class{constructor(e){this[c]=e,this[r]=!1}async*[Symbol.asyncIterator](){i(!this[r],`disturbed`),this[r]=!0,yield*this[c]}},u=class{constructor(e,t,s,c){if(t!=null&&(!Number.isInteger(t)||t<0))throw new a(`maxRedirections must be a positive number`);n.validateHandler(c,s.method,s.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...s,maxRedirections:0},this.maxRedirections=t,this.handler=c,this.history=[],this.redirectionLimitReached=!1,n.isStream(this.opts.body)?(n.bodyLength(this.opts.body)===0&&this.opts.body.on(`data`,function(){i(!1)}),typeof this.opts.body.readableDidRead!=`boolean`&&(this.opts.body[r]=!1,o.prototype.on.call(this.opts.body,`data`,function(){this[r]=!0}))):(this.opts.body&&typeof this.opts.body.pipeTo==`function`||this.opts.body&&typeof this.opts.body!=`string`&&!ArrayBuffer.isView(this.opts.body)&&n.isIterable(this.opts.body))&&(this.opts.body=new l(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,t,n){this.handler.onUpgrade(e,t,n)}onError(e){this.handler.onError(e)}onHeaders(e,t,r,i){if(this.location=this.history.length>=this.maxRedirections||n.isDisturbed(this.opts.body)?null:d(e,t),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(Error(`max redirects`)),this.redirectionLimitReached=!0,this.abort(Error(`max redirects`));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,t,r,i);let{origin:a,pathname:o,search:s}=n.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),c=s?`${o}${s}`:o;this.opts.headers=p(this.opts.headers,e===303,this.opts.origin!==a),this.opts.path=c,this.opts.origin=a,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!==`HEAD`&&(this.opts.method=`GET`,this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function d(e,t){if(s.indexOf(e)===-1)return null;for(let e=0;e{let n=et();function r({maxRedirections:e}){return t=>function(r,i){let{maxRedirections:a=e}=r;if(!a)return t(r,i);let o=new n(t,a,r,i);return r={...r,maxRedirections:0},t(r,o)}}t.exports=r})),nt=I(((e,t)=>{let n=L(`node:assert`),r=L(`node:net`),i=L(`node:http`),a=z(),{channels:o}=Me(),s=Ne(),c=Fe(),{InvalidArgumentError:l,InformationalError:u,ClientDestroyedError:d}=R(),f=Le(),{kUrl:p,kServerName:m,kClient:h,kBusy:g,kConnect:_,kResuming:v,kRunning:y,kPending:b,kSize:x,kQueue:S,kConnected:C,kConnecting:w,kNeedDrain:T,kKeepAliveDefaultTimeout:E,kHostHeader:D,kPendingIdx:O,kRunningIdx:k,kError:A,kPipelining:j,kKeepAliveTimeoutValue:M,kMaxHeadersSize:N,kKeepAliveMaxTimeout:P,kKeepAliveTimeoutThreshold:ee,kHeadersTimeout:te,kBodyTimeout:ne,kStrictContentLength:F,kConnector:re,kMaxRedirections:ie,kMaxRequests:ae,kCounter:oe,kClose:se,kDestroy:ce,kDispatch:le,kInterceptors:ue,kLocalAddress:de,kMaxResponseSize:I,kOnError:fe,kHTTPContext:pe,kMaxConcurrentStreams:me,kResume:he}=ke(),ge=Qe(),_e=$e(),ve=!1,ye=Symbol(`kClosedResolve`),be=()=>{};function xe(e){return e[j]??e[pe]?.defaultPipelining??1}var Se=class extends c{constructor(e,{interceptors:t,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:u,bodyTimeout:d,idleTimeout:h,keepAlive:g,keepAliveTimeout:_,maxKeepAliveTimeout:y,keepAliveMaxTimeout:b,keepAliveTimeoutThreshold:x,socketPath:C,pipelining:w,tls:A,strictContentLength:oe,maxCachedSessions:se,maxRedirections:ce,connect:le,maxRequestsPerClient:L,localAddress:ge,maxResponseSize:_e,autoSelectFamily:be,autoSelectFamilyAttemptTimeout:xe,maxConcurrentStreams:Se,allowH2:Te}={}){if(super(),g!==void 0)throw new l(`unsupported keepAlive, use pipelining=0 instead`);if(s!==void 0)throw new l(`unsupported socketTimeout, use headersTimeout & bodyTimeout instead`);if(c!==void 0)throw new l(`unsupported requestTimeout, use headersTimeout & bodyTimeout instead`);if(h!==void 0)throw new l(`unsupported idleTimeout, use keepAliveTimeout instead`);if(y!==void 0)throw new l(`unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead`);if(n!=null&&!Number.isFinite(n))throw new l(`invalid maxHeaderSize`);if(C!=null&&typeof C!=`string`)throw new l(`invalid socketPath`);if(u!=null&&(!Number.isFinite(u)||u<0))throw new l(`invalid connectTimeout`);if(_!=null&&(!Number.isFinite(_)||_<=0))throw new l(`invalid keepAliveTimeout`);if(b!=null&&(!Number.isFinite(b)||b<=0))throw new l(`invalid keepAliveMaxTimeout`);if(x!=null&&!Number.isFinite(x))throw new l(`invalid keepAliveTimeoutThreshold`);if(o!=null&&(!Number.isInteger(o)||o<0))throw new l(`headersTimeout must be a positive integer or zero`);if(d!=null&&(!Number.isInteger(d)||d<0))throw new l(`bodyTimeout must be a positive integer or zero`);if(le!=null&&typeof le!=`function`&&typeof le!=`object`)throw new l(`connect must be a function or an object`);if(ce!=null&&(!Number.isInteger(ce)||ce<0))throw new l(`maxRedirections must be a positive number`);if(L!=null&&(!Number.isInteger(L)||L<0))throw new l(`maxRequestsPerClient must be a positive number`);if(ge!=null&&(typeof ge!=`string`||r.isIP(ge)===0))throw new l(`localAddress must be valid string IP address`);if(_e!=null&&(!Number.isInteger(_e)||_e<-1))throw new l(`maxResponseSize must be a positive number`);if(xe!=null&&(!Number.isInteger(xe)||xe<-1))throw new l(`autoSelectFamilyAttemptTimeout must be a positive number`);if(Te!=null&&typeof Te!=`boolean`)throw new l(`allowH2 must be a valid boolean value`);if(Se!=null&&(typeof Se!=`number`||Se<1))throw new l(`maxConcurrentStreams must be a positive integer, greater than 0`);typeof le!=`function`&&(le=f({...A,maxCachedSessions:se,allowH2:Te,socketPath:C,timeout:u,...be?{autoSelectFamily:be,autoSelectFamilyAttemptTimeout:xe}:void 0,...le})),t?.Client&&Array.isArray(t.Client)?(this[ue]=t.Client,ve||(ve=!0,process.emitWarning(`Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.`,{code:`UNDICI-CLIENT-INTERCEPTOR-DEPRECATED`}))):this[ue]=[Ce({maxRedirections:ce})],this[p]=a.parseOrigin(e),this[re]=le,this[j]=w??1,this[N]=n||i.maxHeaderSize,this[E]=_??4e3,this[P]=b??6e5,this[ee]=x??2e3,this[M]=this[E],this[m]=null,this[de]=ge??null,this[v]=0,this[T]=0,this[D]=`host: ${this[p].hostname}${this[p].port?`:${this[p].port}`:``}\r\n`,this[ne]=d??3e5,this[te]=o??3e5,this[F]=oe??!0,this[ie]=ce,this[ae]=L,this[ye]=null,this[I]=_e>-1?_e:-1,this[me]=Se??100,this[pe]=null,this[S]=[],this[k]=0,this[O]=0,this[he]=e=>De(this,e),this[fe]=e=>we(this,e)}get pipelining(){return this[j]}set pipelining(e){this[j]=e,this[he](!0)}get[b](){return this[S].length-this[O]}get[y](){return this[O]-this[k]}get[x](){return this[S].length-this[k]}get[C](){return!!this[pe]&&!this[w]&&!this[pe].destroyed}get[g](){return!!(this[pe]?.busy(null)||this[x]>=(xe(this)||1)||this[b]>0)}[_](e){Te(this),this.once(`connect`,e)}[le](e,t){let n=new s(e.origin||this[p].origin,e,t);return this[S].push(n),this[v]||(a.bodyLength(n.body)==null&&a.isIterable(n.body)?(this[v]=1,queueMicrotask(()=>De(this))):this[he](!0)),this[v]&&this[T]!==2&&this[g]&&(this[T]=2),this[T]<2}async[se](){return new Promise(e=>{this[x]?this[ye]=e:e(null)})}async[ce](e){return new Promise(t=>{let n=this[S].splice(this[O]);for(let t=0;t{this[ye]&&(this[ye](),this[ye]=null),t(null)};this[pe]?(this[pe].destroy(e,r),this[pe]=null):queueMicrotask(r),this[he]()})}};let Ce=tt();function we(e,t){if(e[y]===0&&t.code!==`UND_ERR_INFO`&&t.code!==`UND_ERR_SOCKET`){n(e[O]===e[k]);let r=e[S].splice(e[k]);for(let n=0;n{e[re]({host:t,hostname:i,protocol:s,port:c,servername:e[m],localAddress:e[de]},(e,t)=>{e?r(e):n(t)})});if(e.destroyed){a.destroy(r.on(`error`,be),new d);return}n(r);try{e[pe]=r.alpnProtocol===`h2`?await _e(e,r):await ge(e,r)}catch(e){throw r.destroy().on(`error`,be),e}e[w]=!1,r[oe]=0,r[ae]=e[ae],r[h]=e,r[A]=null,o.connected.hasSubscribers&&o.connected.publish({connectParams:{host:t,hostname:i,protocol:s,port:c,version:e[pe]?.version,servername:e[m],localAddress:e[de]},connector:e[re],socket:r}),e.emit(`connect`,e[p],[e])}catch(r){if(e.destroyed)return;if(e[w]=!1,o.connectError.hasSubscribers&&o.connectError.publish({connectParams:{host:t,hostname:i,protocol:s,port:c,version:e[pe]?.version,servername:e[m],localAddress:e[de]},connector:e[re],error:r}),r.code===`ERR_TLS_CERT_ALTNAME_INVALID`)for(n(e[y]===0);e[b]>0&&e[S][e[O]].servername===e[m];){let t=e[S][e[O]++];a.errorRequest(e,t,r)}else we(e,r);e.emit(`connectionError`,e[p],[e],r)}e[he]()}function Ee(e){e[T]=0,e.emit(`drain`,e[p],[e])}function De(e,t){e[v]!==2&&(e[v]=2,Oe(e,t),e[v]=0,e[k]>256&&(e[S].splice(0,e[k]),e[O]-=e[k],e[k]=0))}function Oe(e,t){for(;;){if(e.destroyed){n(e[b]===0);return}if(e[ye]&&!e[x]){e[ye](),e[ye]=null;return}if(e[pe]&&e[pe].resume(),e[g])e[T]=2;else if(e[T]===2){t?(e[T]=1,queueMicrotask(()=>Ee(e))):Ee(e);continue}if(e[b]===0||e[y]>=(xe(e)||1))return;let r=e[S][e[O]];if(e[p].protocol===`https:`&&e[m]!==r.servername){if(e[y]>0)return;e[m]=r.servername,e[pe]?.destroy(new u(`servername changed`),()=>{e[pe]=null,De(e)})}if(e[w])return;if(!e[pe]){Te(e);return}if(e[pe].destroyed||e[pe].busy(r))return;!r.aborted&&e[pe].write(r)?e[O]++:e[S].splice(e[O],1)}}t.exports=Se})),rt=I(((e,t)=>{let n=2048,r=n-1;var i=class{constructor(){this.bottom=0,this.top=0,this.list=Array(n),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&r)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&r}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&r,e)}};t.exports=class{constructor(){this.head=this.tail=new i}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new i),this.head.push(e)}shift(){let e=this.tail,t=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),t}}})),it=I(((e,t)=>{let{kFree:n,kConnected:r,kPending:i,kQueued:a,kRunning:o,kSize:s}=ke(),c=Symbol(`pool`);t.exports=class{constructor(e){this[c]=e}get connected(){return this[c][r]}get free(){return this[c][n]}get pending(){return this[c][i]}get queued(){return this[c][a]}get running(){return this[c][o]}get size(){return this[c][s]}}})),at=I(((e,t)=>{let n=Fe(),r=rt(),{kConnected:i,kSize:a,kRunning:o,kPending:s,kQueued:c,kBusy:l,kFree:u,kUrl:d,kClose:f,kDestroy:p,kDispatch:m}=ke(),h=it(),g=Symbol(`clients`),_=Symbol(`needDrain`),v=Symbol(`queue`),y=Symbol(`closed resolve`),b=Symbol(`onDrain`),x=Symbol(`onConnect`),S=Symbol(`onDisconnect`),C=Symbol(`onConnectionError`),w=Symbol(`get dispatcher`),T=Symbol(`add client`),E=Symbol(`remove client`),D=Symbol(`stats`);t.exports={PoolBase:class extends n{constructor(){super(),this[v]=new r,this[g]=[],this[c]=0;let e=this;this[b]=function(t,n){let r=e[v],i=!1;for(;!i;){let t=r.shift();if(!t)break;e[c]--,i=!this.dispatch(t.opts,t.handler)}this[_]=i,!this[_]&&e[_]&&(e[_]=!1,e.emit(`drain`,t,[e,...n])),e[y]&&r.isEmpty()&&Promise.all(e[g].map(e=>e.close())).then(e[y])},this[x]=(t,n)=>{e.emit(`connect`,t,[e,...n])},this[S]=(t,n,r)=>{e.emit(`disconnect`,t,[e,...n],r)},this[C]=(t,n,r)=>{e.emit(`connectionError`,t,[e,...n],r)},this[D]=new h(this)}get[l](){return this[_]}get[i](){return this[g].filter(e=>e[i]).length}get[u](){return this[g].filter(e=>e[i]&&!e[_]).length}get[s](){let e=this[c];for(let{[s]:t}of this[g])e+=t;return e}get[o](){let e=0;for(let{[o]:t}of this[g])e+=t;return e}get[a](){let e=this[c];for(let{[a]:t}of this[g])e+=t;return e}get stats(){return this[D]}async[f](){this[v].isEmpty()?await Promise.all(this[g].map(e=>e.close())):await new Promise(e=>{this[y]=e})}async[p](e){for(;;){let t=this[v].shift();if(!t)break;t.handler.onError(e)}await Promise.all(this[g].map(t=>t.destroy(e)))}[m](e,t){let n=this[w]();return n?n.dispatch(e,t)||(n[_]=!0,this[_]=!this[w]()):(this[_]=!0,this[v].push({opts:e,handler:t}),this[c]++),!this[_]}[T](e){return e.on(`drain`,this[b]).on(`connect`,this[x]).on(`disconnect`,this[S]).on(`connectionError`,this[C]),this[g].push(e),this[_]&&queueMicrotask(()=>{this[_]&&this[b](e[d],[this,e])}),this}[E](e){e.close(()=>{let t=this[g].indexOf(e);t!==-1&&this[g].splice(t,1)}),this[_]=this[g].some(e=>!e[_]&&e.closed!==!0&&e.destroyed!==!0)}},kClients:g,kNeedDrain:_,kAddClient:T,kRemoveClient:E,kGetDispatcher:w}})),ot=I(((e,t)=>{let{PoolBase:n,kClients:r,kNeedDrain:i,kAddClient:a,kGetDispatcher:o}=at(),s=nt(),{InvalidArgumentError:c}=R(),l=z(),{kUrl:u,kInterceptors:d}=ke(),f=Le(),p=Symbol(`options`),m=Symbol(`connections`),h=Symbol(`factory`);function g(e,t){return new s(e,t)}t.exports=class extends n{constructor(e,{connections:t,factory:n=g,connect:i,connectTimeout:a,tls:o,maxCachedSessions:s,socketPath:_,autoSelectFamily:v,autoSelectFamilyAttemptTimeout:y,allowH2:b,...x}={}){if(super(),t!=null&&(!Number.isFinite(t)||t<0))throw new c(`invalid connections`);if(typeof n!=`function`)throw new c(`factory must be a function.`);if(i!=null&&typeof i!=`function`&&typeof i!=`object`)throw new c(`connect must be a function or an object`);typeof i!=`function`&&(i=f({...o,maxCachedSessions:s,allowH2:b,socketPath:_,timeout:a,...v?{autoSelectFamily:v,autoSelectFamilyAttemptTimeout:y}:void 0,...i})),this[d]=x.interceptors?.Pool&&Array.isArray(x.interceptors.Pool)?x.interceptors.Pool:[],this[m]=t||null,this[u]=l.parseOrigin(e),this[p]={...l.deepClone(x),connect:i,allowH2:b},this[p].interceptors=x.interceptors?{...x.interceptors}:void 0,this[h]=n,this.on(`connectionError`,(e,t,n)=>{for(let e of t){let t=this[r].indexOf(e);t!==-1&&this[r].splice(t,1)}})}[o](){for(let e of this[r])if(!e[i])return e;if(!this[m]||this[r].length{let{BalancedPoolMissingUpstreamError:n,InvalidArgumentError:r}=R(),{PoolBase:i,kClients:a,kNeedDrain:o,kAddClient:s,kRemoveClient:c,kGetDispatcher:l}=at(),u=ot(),{kUrl:d,kInterceptors:f}=ke(),{parseOrigin:p}=z(),m=Symbol(`factory`),h=Symbol(`options`),g=Symbol(`kGreatestCommonDivisor`),_=Symbol(`kCurrentWeight`),v=Symbol(`kIndex`),y=Symbol(`kWeight`),b=Symbol(`kMaxWeightPerServer`),x=Symbol(`kErrorPenalty`);function S(e,t){if(e===0)return t;for(;t!==0;){let n=t;t=e%t,e=n}return e}function C(e,t){return new u(e,t)}t.exports=class extends i{constructor(e=[],{factory:t=C,...n}={}){if(super(),this[h]=n,this[v]=-1,this[_]=0,this[b]=this[h].maxWeightPerServer||100,this[x]=this[h].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof t!=`function`)throw new r(`factory must be a function.`);this[f]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[m]=t;for(let t of e)this.addUpstream(t);this._updateBalancedPoolStats()}addUpstream(e){let t=p(e).origin;if(this[a].find(e=>e[d].origin===t&&e.closed!==!0&&e.destroyed!==!0))return this;let n=this[m](t,Object.assign({},this[h]));this[s](n),n.on(`connect`,()=>{n[y]=Math.min(this[b],n[y]+this[x])}),n.on(`connectionError`,()=>{n[y]=Math.max(1,n[y]-this[x]),this._updateBalancedPoolStats()}),n.on(`disconnect`,(...e)=>{let t=e[2];t&&t.code===`UND_ERR_SOCKET`&&(n[y]=Math.max(1,n[y]-this[x]),this._updateBalancedPoolStats())});for(let e of this[a])e[y]=this[b];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let t=0;te[d].origin===t&&e.closed!==!0&&e.destroyed!==!0);return n&&this[c](n),this}get upstreams(){return this[a].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[d].origin)}[l](){if(this[a].length===0)throw new n;if(!this[a].find(e=>!e[o]&&e.closed!==!0&&e.destroyed!==!0)||this[a].map(e=>e[o]).reduce((e,t)=>e&&t,!0))return;let e=0,t=this[a].findIndex(e=>!e[o]);for(;e++this[a][t][y]&&!e[o]&&(t=this[v]),this[v]===0&&(this[_]=this[_]-this[g],this[_]<=0&&(this[_]=this[b])),e[y]>=this[_]&&!e[o])return e}return this[_]=this[a][t][y],this[v]=t,this[a][t]}}})),ct=I(((e,t)=>{let{InvalidArgumentError:n}=R(),{kClients:r,kRunning:i,kClose:a,kDestroy:o,kDispatch:s,kInterceptors:c}=ke(),l=Fe(),u=ot(),d=nt(),f=z(),p=tt(),m=Symbol(`onConnect`),h=Symbol(`onDisconnect`),g=Symbol(`onConnectionError`),_=Symbol(`maxRedirections`),v=Symbol(`onDrain`),y=Symbol(`factory`),b=Symbol(`options`);function x(e,t){return t&&t.connections===1?new d(e,t):new u(e,t)}t.exports=class extends l{constructor({factory:e=x,maxRedirections:t=0,connect:i,...a}={}){if(super(),typeof e!=`function`)throw new n(`factory must be a function.`);if(i!=null&&typeof i!=`function`&&typeof i!=`object`)throw new n(`connect must be a function or an object`);if(!Number.isInteger(t)||t<0)throw new n(`maxRedirections must be a positive number`);i&&typeof i!=`function`&&(i={...i}),this[c]=a.interceptors?.Agent&&Array.isArray(a.interceptors.Agent)?a.interceptors.Agent:[p({maxRedirections:t})],this[b]={...f.deepClone(a),connect:i},this[b].interceptors=a.interceptors?{...a.interceptors}:void 0,this[_]=t,this[y]=e,this[r]=new Map,this[v]=(e,t)=>{this.emit(`drain`,e,[this,...t])},this[m]=(e,t)=>{this.emit(`connect`,e,[this,...t])},this[h]=(e,t,n)=>{this.emit(`disconnect`,e,[this,...t],n)},this[g]=(e,t,n)=>{this.emit(`connectionError`,e,[this,...t],n)}}get[i](){let e=0;for(let t of this[r].values())e+=t[i];return e}[s](e,t){let i;if(e.origin&&(typeof e.origin==`string`||e.origin instanceof URL))i=String(e.origin);else throw new n(`opts.origin must be a non-empty string or URL.`);let a=this[r].get(i);return a||(a=this[y](e.origin,this[b]).on(`drain`,this[v]).on(`connect`,this[m]).on(`disconnect`,this[h]).on(`connectionError`,this[g]),this[r].set(i,a)),a.dispatch(e,t)}async[a](){let e=[];for(let t of this[r].values())e.push(t.close());this[r].clear(),await Promise.all(e)}async[o](e){let t=[];for(let n of this[r].values())t.push(n.destroy(e));this[r].clear(),await Promise.all(t)}}})),lt=I(((e,t)=>{let{kProxy:n,kClose:r,kDestroy:i,kDispatch:a,kInterceptors:o}=ke(),{URL:s}=L(`node:url`),c=ct(),l=ot(),u=Fe(),{InvalidArgumentError:d,RequestAbortedError:f,SecureProxyConnectionError:p}=R(),m=Le(),h=nt(),g=Symbol(`proxy agent`),_=Symbol(`proxy client`),v=Symbol(`proxy headers`),y=Symbol(`request tls settings`),b=Symbol(`proxy tls settings`),x=Symbol(`connect endpoint function`),S=Symbol(`tunnel proxy`);function C(e){return e===`https:`?443:80}function w(e,t){return new l(e,t)}let T=()=>{};function E(e,t){return t.connections===1?new h(e,t):new l(e,t)}var D=class extends u{#e;constructor(e,{headers:t={},connect:n,factory:r}){if(super(),!e)throw new d(`Proxy URL is mandatory`);this[v]=t,r?this.#e=r(e,{connect:n}):this.#e=new h(e,{connect:n})}[a](e,t){let n=t.onHeaders;t.onHeaders=function(e,r,i){if(e===407){typeof t.onError==`function`&&t.onError(new d(`Proxy Authentication Required (407)`));return}n&&n.call(this,e,r,i)};let{origin:r,path:i=`/`,headers:o={}}=e;if(e.path=r+i,!(`host`in o)&&!(`Host`in o)){let{host:e}=new s(r);o.host=e}return e.headers={...this[v],...o},this.#e[a](e,t)}async[r](){return this.#e.close()}async[i](e){return this.#e.destroy(e)}},O=class extends u{constructor(e){if(super(),!e||typeof e==`object`&&!(e instanceof s)&&!e.uri)throw new d(`Proxy uri is mandatory`);let{clientFactory:t=w}=e;if(typeof t!=`function`)throw new d(`Proxy opts.clientFactory must be a function.`);let{proxyTunnel:r=!0}=e,i=this.#e(e),{href:a,origin:l,port:u,protocol:h,username:O,password:k,hostname:A}=i;if(this[n]={uri:a,protocol:h},this[o]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[y]=e.requestTls,this[b]=e.proxyTls,this[v]=e.headers||{},this[S]=r,e.auth&&e.token)throw new d(`opts.auth cannot be used in combination with opts.token`);e.auth?this[v][`proxy-authorization`]=`Basic ${e.auth}`:e.token?this[v][`proxy-authorization`]=e.token:O&&k&&(this[v][`proxy-authorization`]=`Basic ${Buffer.from(`${decodeURIComponent(O)}:${decodeURIComponent(k)}`).toString(`base64`)}`);let j=m({...e.proxyTls});this[x]=m({...e.requestTls});let M=e.factory||E,N=(e,t)=>{let{protocol:r}=new s(e);return!this[S]&&r===`http:`&&this[n].protocol===`http:`?new D(this[n].uri,{headers:this[v],connect:j,factory:M}):M(e,t)};this[_]=t(i,{connect:j}),this[g]=new c({...e,factory:N,connect:async(e,t)=>{let n=e.host;e.port||(n+=`:${C(e.protocol)}`);try{let{socket:r,statusCode:i}=await this[_].connect({origin:l,port:u,path:n,signal:e.signal,headers:{...this[v],host:e.host},servername:this[b]?.servername||A});if(i!==200&&(r.on(`error`,T).destroy(),t(new f(`Proxy response (${i}) !== 200 when HTTP Tunneling`))),e.protocol!==`https:`){t(null,r);return}let a;a=this[y]?this[y].servername:e.servername,this[x]({...e,servername:a,httpSocket:r},t)}catch(e){e.code===`ERR_TLS_CERT_ALTNAME_INVALID`?t(new p(e)):t(e)}}})}dispatch(e,t){let n=k(e.headers);if(A(n),n&&!(`host`in n)&&!(`Host`in n)){let{host:t}=new s(e.origin);n.host=t}return this[g].dispatch({...e,headers:n},t)}#e(e){return typeof e==`string`?new s(e):e instanceof s?e:new s(e.uri)}async[r](){await this[g].close(),await this[_].close()}async[i](){await this[g].destroy(),await this[_].destroy()}};function k(e){if(Array.isArray(e)){let t={};for(let n=0;ne.toLowerCase()===`proxy-authorization`))throw new d(`Proxy-Authorization should be sent in ProxyAgent constructor`)}t.exports=O})),ut=I(((e,t)=>{let n=Fe(),{kClose:r,kDestroy:i,kClosed:a,kDestroyed:o,kDispatch:s,kNoProxyAgent:c,kHttpProxyAgent:l,kHttpsProxyAgent:u}=ke(),d=lt(),f=ct(),p={"http:":80,"https:":443},m=!1;t.exports=class extends n{#e=null;#t=null;#n=null;constructor(e={}){super(),this.#n=e,m||(m=!0,process.emitWarning(`EnvHttpProxyAgent is experimental, expect them to change at any time.`,{code:`UNDICI-EHPA`}));let{httpProxy:t,httpsProxy:n,noProxy:r,...i}=e;this[c]=new f(i);let a=t??process.env.http_proxy??process.env.HTTP_PROXY;a?this[l]=new d({...i,uri:a}):this[l]=this[c];let o=n??process.env.https_proxy??process.env.HTTPS_PROXY;o?this[u]=new d({...i,uri:o}):this[u]=this[l],this.#a()}[s](e,t){let n=new URL(e.origin);return this.#r(n).dispatch(e,t)}async[r](){await this[c].close(),this[l][a]||await this[l].close(),this[u][a]||await this[u].close()}async[i](e){await this[c].destroy(e),this[l][o]||await this[l].destroy(e),this[u][o]||await this[u].destroy(e)}#r(e){let{protocol:t,host:n,port:r}=e;return n=n.replace(/:\d*$/,``).toLowerCase(),r=Number.parseInt(r,10)||p[t]||0,this.#i(n,r)?t===`https:`?this[u]:this[l]:this[c]}#i(e,t){if(this.#o&&this.#a(),this.#t.length===0)return!0;if(this.#e===`*`)return!1;for(let n=0;n{let n=L(`node:assert`),{kRetryHandlerDefaultRetry:r}=ke(),{RequestRetryError:i}=R(),{isDisturbed:a,parseHeaders:o,parseRangeHeader:s,wrapRequestBody:c}=z();function l(e){let t=Date.now();return new Date(e).getTime()-t}t.exports=class e{constructor(t,n){let{retryOptions:i,...a}=t,{retry:o,maxRetries:s,maxTimeout:l,minTimeout:u,timeoutFactor:d,methods:f,errorCodes:p,retryAfter:m,statusCodes:h}=i??{};this.dispatch=n.dispatch,this.handler=n.handler,this.opts={...a,body:c(t.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:o??e[r],retryAfter:m??!0,maxTimeout:l??30*1e3,minTimeout:u??500,timeoutFactor:d??2,maxRetries:s??5,methods:f??[`GET`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`TRACE`],statusCodes:h??[500,502,503,504,429],errorCodes:p??[`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`,`UND_ERR_SOCKET`]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(e=>{this.aborted=!0,this.abort?this.abort(e):this.reason=e})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,t,n){this.handler.onUpgrade&&this.handler.onUpgrade(e,t,n)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[r](e,{state:t,opts:n},r){let{statusCode:i,code:a,headers:o}=e,{method:s,retryOptions:c}=n,{maxRetries:u,minTimeout:d,maxTimeout:f,timeoutFactor:p,statusCodes:m,errorCodes:h,methods:g}=c,{counter:_}=t;if(a&&a!==`UND_ERR_REQ_RETRY`&&!h.includes(a)){r(e);return}if(Array.isArray(g)&&!g.includes(s)){r(e);return}if(i!=null&&Array.isArray(m)&&!m.includes(i)){r(e);return}if(_>u){r(e);return}let v=o?.[`retry-after`];v&&=(v=Number(v),Number.isNaN(v)?l(v):v*1e3);let y=Math.min(v>0?v:d*p**(_-1),f);setTimeout(()=>r(null),y)}onHeaders(e,t,r,a){let c=o(t);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,t,r,a):(this.abort(new i(`Request failed`,e,{headers:c,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new i(`server does not support the range header and the payload was partially consumed`,e,{headers:c,data:{count:this.retryCount}})),!1;let t=s(c[`content-range`]);if(!t)return this.abort(new i(`Content-Range mismatch`,e,{headers:c,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==c.etag)return this.abort(new i(`ETag mismatch`,e,{headers:c,data:{count:this.retryCount}})),!1;let{start:a,size:o,end:l=o-1}=t;return n(this.start===a,`content-range mismatch`),n(this.end==null||this.end===l,`content-range mismatch`),this.resume=r,!0}if(this.end==null){if(e===206){let i=s(c[`content-range`]);if(i==null)return this.handler.onHeaders(e,t,r,a);let{start:o,size:l,end:u=l-1}=i;n(o!=null&&Number.isFinite(o),`content-range mismatch`),n(u!=null&&Number.isFinite(u),`invalid content-length`),this.start=o,this.end=u}if(this.end==null){let e=c[`content-length`];this.end=e==null?null:Number(e)-1}return n(Number.isFinite(this.start)),n(this.end==null||Number.isFinite(this.end),`invalid content-length`),this.resume=r,this.etag=c.etag==null?null:c.etag,this.etag!=null&&this.etag.startsWith(`W/`)&&(this.etag=null),this.handler.onHeaders(e,t,r,a)}let l=new i(`Request failed`,e,{headers:c,data:{count:this.retryCount}});return this.abort(l),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||a(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},t.bind(this));function t(e){if(e!=null||this.aborted||a(this.opts.body))return this.handler.onError(e);if(this.start!==0){let e={range:`bytes=${this.start}-${this.end??``}`};this.etag!=null&&(e[`if-match`]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...e}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(e){this.handler.onError(e)}}}}})),ft=I(((e,t)=>{let n=Pe(),r=dt();t.exports=class extends n{#e=null;#t=null;constructor(e,t={}){super(t),this.#e=e,this.#t=t}dispatch(e,t){let n=new r({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:t});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}}})),pt=I(((e,t)=>{let n=L(`node:assert`),{Readable:r}=L(`node:stream`),{RequestAbortedError:i,NotSupportedError:a,InvalidArgumentError:o,AbortError:s}=R(),c=z(),{ReadableStreamFrom:l}=z(),u=Symbol(`kConsume`),d=Symbol(`kReading`),f=Symbol(`kBody`),p=Symbol(`kAbort`),m=Symbol(`kContentType`),h=Symbol(`kContentLength`),g=()=>{};var _=class extends r{constructor({resume:e,abort:t,contentType:n=``,contentLength:r,highWaterMark:i=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:i}),this._readableState.dataEmitted=!1,this[p]=t,this[u]=null,this[f]=null,this[m]=n,this[h]=r,this[d]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new i),e&&this[p](),super.destroy(e)}_destroy(e,t){this[d]?t(e):setImmediate(()=>{t(e)})}on(e,...t){return(e===`data`||e===`readable`)&&(this[d]=!0),super.on(e,...t)}addListener(e,...t){return this.on(e,...t)}off(e,...t){let n=super.off(e,...t);return(e===`data`||e===`readable`)&&(this[d]=this.listenerCount(`data`)>0||this.listenerCount(`readable`)>0),n}removeListener(e,...t){return this.off(e,...t)}push(e){return this[u]&&e!==null?(T(this[u],e),this[d]?super.push(e):!0):super.push(e)}async text(){return b(this,`text`)}async json(){return b(this,`json`)}async blob(){return b(this,`blob`)}async bytes(){return b(this,`bytes`)}async arrayBuffer(){return b(this,`arrayBuffer`)}async formData(){throw new a}get bodyUsed(){return c.isDisturbed(this)}get body(){return this[f]||(this[f]=l(this),this[u]&&(this[f].getReader(),n(this[f].locked))),this[f]}async dump(e){let t=Number.isFinite(e?.limit)?e.limit:128*1024,n=e?.signal;if(n!=null&&(typeof n!=`object`||!(`aborted`in n)))throw new o(`signal must be an AbortSignal`);return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((e,r)=>{this[h]>t&&this.destroy(new s);let i=()=>{this.destroy(n.reason??new s)};n?.addEventListener(`abort`,i),this.on(`close`,function(){n?.removeEventListener(`abort`,i),n?.aborted?r(n.reason??new s):e(null)}).on(`error`,g).on(`data`,function(e){t-=e.length,t<=0&&this.destroy()}).resume()})}};function v(e){return e[f]&&e[f].locked===!0||e[u]}function y(e){return c.isDisturbed(e)||v(e)}async function b(e,t){return n(!e[u]),new Promise((n,r)=>{if(y(e)){let t=e._readableState;t.destroyed&&t.closeEmitted===!1?e.on(`error`,e=>{r(e)}).on(`close`,()=>{r(TypeError(`unusable`))}):r(t.errored??TypeError(`unusable`))}else queueMicrotask(()=>{e[u]={type:t,stream:e,resolve:n,reject:r,length:0,body:[]},e.on(`error`,function(e){E(this[u],e)}).on(`close`,function(){this[u].body!==null&&E(this[u],new i)}),x(e[u])})})}function x(e){if(e.body===null)return;let{_readableState:t}=e.stream;if(t.bufferIndex){let n=t.bufferIndex,r=t.buffer.length;for(let i=n;i2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return n.utf8Slice(i,r)}function C(e,t){if(e.length===0||t===0)return new Uint8Array;if(e.length===1)return new Uint8Array(e[0]);let n=new Uint8Array(Buffer.allocUnsafeSlow(t).buffer),r=0;for(let t=0;t{let n=L(`node:assert`),{ResponseStatusCodeError:r}=R(),{chunksDecode:i}=pt();async function a({callback:e,body:t,contentType:a,statusCode:c,statusMessage:l,headers:u}){n(t);let d=[],f=0;try{for await(let e of t)if(d.push(e),f+=e.length,f>131072){d=[],f=0;break}}catch{d=[],f=0}let p=`Response status code ${c}${l?`: ${l}`:``}`;if(c===204||!a||!f){queueMicrotask(()=>e(new r(p,c,u)));return}let m=Error.stackTraceLimit;Error.stackTraceLimit=0;let h;try{o(a)?h=JSON.parse(i(d,f)):s(a)&&(h=i(d,f))}catch{}finally{Error.stackTraceLimit=m}queueMicrotask(()=>e(new r(p,c,u,h)))}let o=e=>e.length>15&&e[11]===`/`&&e[0]===`a`&&e[1]===`p`&&e[2]===`p`&&e[3]===`l`&&e[4]===`i`&&e[5]===`c`&&e[6]===`a`&&e[7]===`t`&&e[8]===`i`&&e[9]===`o`&&e[10]===`n`&&e[12]===`j`&&e[13]===`s`&&e[14]===`o`&&e[15]===`n`,s=e=>e.length>4&&e[4]===`/`&&e[0]===`t`&&e[1]===`e`&&e[2]===`x`&&e[3]===`t`;t.exports={getResolveErrorBodyCallback:a,isContentTypeApplicationJson:o,isContentTypeText:s}})),ht=I(((e,t)=>{let n=L(`node:assert`),{Readable:r}=pt(),{InvalidArgumentError:i,RequestAbortedError:a}=R(),o=z(),{getResolveErrorBodyCallback:s}=mt(),{AsyncResource:c}=L(`node:async_hooks`);var l=class extends c{constructor(e,t){if(!e||typeof e!=`object`)throw new i(`invalid opts`);let{signal:n,method:r,opaque:s,body:c,onInfo:l,responseHeaders:u,throwOnError:d,highWaterMark:f}=e;try{if(typeof t!=`function`)throw new i(`invalid callback`);if(f&&(typeof f!=`number`||f<0))throw new i(`invalid highWaterMark`);if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new i(`signal must be an EventEmitter or EventTarget`);if(r===`CONNECT`)throw new i(`invalid method`);if(l&&typeof l!=`function`)throw new i(`invalid onInfo callback`);super(`UNDICI_REQUEST`)}catch(e){throw o.isStream(c)&&o.destroy(c.on(`error`,o.nop),e),e}this.method=r,this.responseHeaders=u||null,this.opaque=s||null,this.callback=t,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.throwOnError=d,this.highWaterMark=f,this.signal=n,this.reason=null,this.removeAbortListener=null,o.isStream(c)&&c.on(`error`,e=>{this.onError(e)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new a:this.removeAbortListener=o.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new a,this.res?o.destroy(this.res.on(`error`,o.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&=(this.res?.off(`close`,this.removeAbortListener),this.removeAbortListener(),null)}))}onConnect(e,t){if(this.reason){e(this.reason);return}n(this.callback),this.abort=e,this.context=t}onHeaders(e,t,n,i){let{callback:a,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,p=d===`raw`?o.parseRawHeaders(t):o.parseHeaders(t);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:p});return}let m=d===`raw`?o.parseHeaders(t):p,h=m[`content-type`],g=m[`content-length`],_=new r({resume:n,abort:l,contentType:h,contentLength:this.method!==`HEAD`&&g?Number(g):null,highWaterMark:f});this.removeAbortListener&&_.on(`close`,this.removeAbortListener),this.callback=null,this.res=_,a!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(s,null,{callback:a,body:_,contentType:h,statusCode:e,statusMessage:i,headers:p}):this.runInAsyncScope(a,null,null,{statusCode:e,headers:p,trailers:this.trailers,opaque:c,body:_,context:u}))}onData(e){return this.res.push(e)}onComplete(e){o.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:t,callback:n,body:r,opaque:i}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:i})})),t&&(this.res=null,queueMicrotask(()=>{o.destroy(t,e)})),r&&(this.body=null,o.destroy(r,e)),this.removeAbortListener&&=(t?.off(`close`,this.removeAbortListener),this.removeAbortListener(),null)}};function u(e,t){if(t===void 0)return new Promise((t,n)=>{u.call(this,e,(e,r)=>e?n(e):t(r))});try{this.dispatch(e,new l(e,t))}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}t.exports=u,t.exports.RequestHandler=l})),gt=I(((e,t)=>{let{addAbortListener:n}=z(),{RequestAbortedError:r}=R(),i=Symbol(`kListener`),a=Symbol(`kSignal`);function o(e){e.abort?e.abort(e[a]?.reason):e.reason=e[a]?.reason??new r,c(e)}function s(e,t){if(e.reason=null,e[a]=null,e[i]=null,t){if(t.aborted){o(e);return}e[a]=t,e[i]=()=>{o(e)},n(e[a],e[i])}}function c(e){e[a]&&(`removeEventListener`in e[a]?e[a].removeEventListener(`abort`,e[i]):e[a].removeListener(`abort`,e[i]),e[a]=null,e[i]=null)}t.exports={addSignal:s,removeSignal:c}})),_t=I(((e,t)=>{let n=L(`node:assert`),{finished:r,PassThrough:i}=L(`node:stream`),{InvalidArgumentError:a,InvalidReturnValueError:o}=R(),s=z(),{getResolveErrorBodyCallback:c}=mt(),{AsyncResource:l}=L(`node:async_hooks`),{addSignal:u,removeSignal:d}=gt();var f=class extends l{constructor(e,t,n){if(!e||typeof e!=`object`)throw new a(`invalid opts`);let{signal:r,method:i,opaque:o,body:c,onInfo:l,responseHeaders:d,throwOnError:f}=e;try{if(typeof n!=`function`)throw new a(`invalid callback`);if(typeof t!=`function`)throw new a(`invalid factory`);if(r&&typeof r.on!=`function`&&typeof r.addEventListener!=`function`)throw new a(`signal must be an EventEmitter or EventTarget`);if(i===`CONNECT`)throw new a(`invalid method`);if(l&&typeof l!=`function`)throw new a(`invalid onInfo callback`);super(`UNDICI_STREAM`)}catch(e){throw s.isStream(c)&&s.destroy(c.on(`error`,s.nop),e),e}this.responseHeaders=d||null,this.opaque=o||null,this.factory=t,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=c,this.onInfo=l||null,this.throwOnError=f||!1,s.isStream(c)&&c.on(`error`,e=>{this.onError(e)}),u(this,r)}onConnect(e,t){if(this.reason){e(this.reason);return}n(this.callback),this.abort=e,this.context=t}onHeaders(e,t,n,a){let{factory:l,opaque:u,context:d,callback:f,responseHeaders:p}=this,m=p===`raw`?s.parseRawHeaders(t):s.parseHeaders(t);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:m});return}this.factory=null;let h;if(this.throwOnError&&e>=400){let n=(p===`raw`?s.parseHeaders(t):m)[`content-type`];h=new i,this.callback=null,this.runInAsyncScope(c,null,{callback:f,body:h,contentType:n,statusCode:e,statusMessage:a,headers:m})}else{if(l===null)return;if(h=this.runInAsyncScope(l,null,{statusCode:e,headers:m,opaque:u,context:d}),!h||typeof h.write!=`function`||typeof h.end!=`function`||typeof h.on!=`function`)throw new o(`expected Writable`);r(h,{readable:!1},e=>{let{callback:t,res:n,opaque:r,trailers:i,abort:a}=this;this.res=null,(e||!n.readable)&&s.destroy(n,e),this.callback=null,this.runInAsyncScope(t,null,e||null,{opaque:r,trailers:i}),e&&a()})}return h.on(`drain`,n),this.res=h,(h.writableNeedDrain===void 0?h._writableState?.needDrain:h.writableNeedDrain)!==!0}onData(e){let{res:t}=this;return t?t.write(e):!0}onComplete(e){let{res:t}=this;d(this),t&&(this.trailers=s.parseHeaders(e),t.end())}onError(e){let{res:t,callback:n,opaque:r,body:i}=this;d(this),this.factory=null,t?(this.res=null,s.destroy(t,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:r})})),i&&(this.body=null,s.destroy(i,e))}};function p(e,t,n){if(n===void 0)return new Promise((n,r)=>{p.call(this,e,t,(e,t)=>e?r(e):n(t))});try{this.dispatch(e,new f(e,t,n))}catch(t){if(typeof n!=`function`)throw t;let r=e?.opaque;queueMicrotask(()=>n(t,{opaque:r}))}}t.exports=p})),vt=I(((e,t)=>{let{Readable:n,Duplex:r,PassThrough:i}=L(`node:stream`),{InvalidArgumentError:a,InvalidReturnValueError:o,RequestAbortedError:s}=R(),c=z(),{AsyncResource:l}=L(`node:async_hooks`),{addSignal:u,removeSignal:d}=gt(),f=L(`node:assert`),p=Symbol(`resume`);var m=class extends n{constructor(){super({autoDestroy:!0}),this[p]=null}_read(){let{[p]:e}=this;e&&(this[p]=null,e())}_destroy(e,t){this._read(),t(e)}},h=class extends n{constructor(e){super({autoDestroy:!0}),this[p]=e}_read(){this[p]()}_destroy(e,t){!e&&!this._readableState.endEmitted&&(e=new s),t(e)}},g=class extends l{constructor(e,t){if(!e||typeof e!=`object`)throw new a(`invalid opts`);if(typeof t!=`function`)throw new a(`invalid handler`);let{signal:n,method:i,opaque:o,onInfo:l,responseHeaders:f}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new a(`signal must be an EventEmitter or EventTarget`);if(i===`CONNECT`)throw new a(`invalid method`);if(l&&typeof l!=`function`)throw new a(`invalid onInfo callback`);super(`UNDICI_PIPELINE`),this.opaque=o||null,this.responseHeaders=f||null,this.handler=t,this.abort=null,this.context=null,this.onInfo=l||null,this.req=new m().on(`error`,c.nop),this.ret=new r({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{let{body:e}=this;e?.resume&&e.resume()},write:(e,t,n)=>{let{req:r}=this;r.push(e,t)||r._readableState.destroyed?n():r[p]=n},destroy:(e,t)=>{let{body:n,req:r,res:i,ret:a,abort:o}=this;!e&&!a._readableState.endEmitted&&(e=new s),o&&e&&o(),c.destroy(n,e),c.destroy(r,e),c.destroy(i,e),d(this),t(e)}}).on(`prefinish`,()=>{let{req:e}=this;e.push(null)}),this.res=null,u(this,n)}onConnect(e,t){let{ret:n,res:r}=this;if(this.reason){e(this.reason);return}f(!r,`pipeline cannot be retried`),f(!n.destroyed),this.abort=e,this.context=t}onHeaders(e,t,n){let{opaque:r,handler:i,context:a}=this;if(e<200){if(this.onInfo){let n=this.responseHeaders===`raw`?c.parseRawHeaders(t):c.parseHeaders(t);this.onInfo({statusCode:e,headers:n})}return}this.res=new h(n);let l;try{this.handler=null;let n=this.responseHeaders===`raw`?c.parseRawHeaders(t):c.parseHeaders(t);l=this.runInAsyncScope(i,null,{statusCode:e,headers:n,opaque:r,body:this.res,context:a})}catch(e){throw this.res.on(`error`,c.nop),e}if(!l||typeof l.on!=`function`)throw new o(`expected Readable`);l.on(`data`,e=>{let{ret:t,body:n}=this;!t.push(e)&&n.pause&&n.pause()}).on(`error`,e=>{let{ret:t}=this;c.destroy(t,e)}).on(`end`,()=>{let{ret:e}=this;e.push(null)}).on(`close`,()=>{let{ret:e}=this;e._readableState.ended||c.destroy(e,new s)}),this.body=l}onData(e){let{res:t}=this;return t.push(e)}onComplete(e){let{res:t}=this;t.push(null)}onError(e){let{ret:t}=this;this.handler=null,c.destroy(t,e)}};function _(e,t){try{let n=new g(e,t);return this.dispatch({...e,body:n.req},n),n.ret}catch(e){return new i().destroy(e)}}t.exports=_})),yt=I(((e,t)=>{let{InvalidArgumentError:n,SocketError:r}=R(),{AsyncResource:i}=L(`node:async_hooks`),a=z(),{addSignal:o,removeSignal:s}=gt(),c=L(`node:assert`);var l=class extends i{constructor(e,t){if(!e||typeof e!=`object`)throw new n(`invalid opts`);if(typeof t!=`function`)throw new n(`invalid callback`);let{signal:r,opaque:i,responseHeaders:a}=e;if(r&&typeof r.on!=`function`&&typeof r.addEventListener!=`function`)throw new n(`signal must be an EventEmitter or EventTarget`);super(`UNDICI_UPGRADE`),this.responseHeaders=a||null,this.opaque=i||null,this.callback=t,this.abort=null,this.context=null,o(this,r)}onConnect(e,t){if(this.reason){e(this.reason);return}c(this.callback),this.abort=e,this.context=null}onHeaders(){throw new r(`bad upgrade`,null)}onUpgrade(e,t,n){c(e===101);let{callback:r,opaque:i,context:o}=this;s(this),this.callback=null;let l=this.responseHeaders===`raw`?a.parseRawHeaders(t):a.parseHeaders(t);this.runInAsyncScope(r,null,null,{headers:l,socket:n,opaque:i,context:o})}onError(e){let{callback:t,opaque:n}=this;s(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:n})}))}};function u(e,t){if(t===void 0)return new Promise((t,n)=>{u.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new l(e,t);this.dispatch({...e,method:e.method||`GET`,upgrade:e.protocol||`Websocket`},n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}t.exports=u})),bt=I(((e,t)=>{let n=L(`node:assert`),{AsyncResource:r}=L(`node:async_hooks`),{InvalidArgumentError:i,SocketError:a}=R(),o=z(),{addSignal:s,removeSignal:c}=gt();var l=class extends r{constructor(e,t){if(!e||typeof e!=`object`)throw new i(`invalid opts`);if(typeof t!=`function`)throw new i(`invalid callback`);let{signal:n,opaque:r,responseHeaders:a}=e;if(n&&typeof n.on!=`function`&&typeof n.addEventListener!=`function`)throw new i(`signal must be an EventEmitter or EventTarget`);super(`UNDICI_CONNECT`),this.opaque=r||null,this.responseHeaders=a||null,this.callback=t,this.abort=null,s(this,n)}onConnect(e,t){if(this.reason){e(this.reason);return}n(this.callback),this.abort=e,this.context=t}onHeaders(){throw new a(`bad connect`,null)}onUpgrade(e,t,n){let{callback:r,opaque:i,context:a}=this;c(this),this.callback=null;let s=t;s!=null&&(s=this.responseHeaders===`raw`?o.parseRawHeaders(t):o.parseHeaders(t)),this.runInAsyncScope(r,null,null,{statusCode:e,headers:s,socket:n,opaque:i,context:a})}onError(e){let{callback:t,opaque:n}=this;c(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,e,{opaque:n})}))}};function u(e,t){if(t===void 0)return new Promise((t,n)=>{u.call(this,e,(e,r)=>e?n(e):t(r))});try{let n=new l(e,t);this.dispatch({...e,method:`CONNECT`},n)}catch(n){if(typeof t!=`function`)throw n;let r=e?.opaque;queueMicrotask(()=>t(n,{opaque:r}))}}t.exports=u})),xt=I(((e,t)=>{t.exports.request=ht(),t.exports.stream=_t(),t.exports.pipeline=vt(),t.exports.upgrade=yt(),t.exports.connect=bt()})),St=I(((e,t)=>{let{UndiciError:n}=R(),r=Symbol.for(`undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED`);t.exports={MockNotMatchedError:class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`MockNotMatchedError`,this.message=t||`The request does not match any registered mock dispatches`,this.code=`UND_MOCK_ERR_MOCK_NOT_MATCHED`}static[Symbol.hasInstance](e){return e&&e[r]===!0}[r]=!0}}})),Ct=I(((e,t)=>{t.exports={kAgent:Symbol(`agent`),kOptions:Symbol(`options`),kFactory:Symbol(`factory`),kDispatches:Symbol(`dispatches`),kDispatchKey:Symbol(`dispatch key`),kDefaultHeaders:Symbol(`default headers`),kDefaultTrailers:Symbol(`default trailers`),kContentLength:Symbol(`content length`),kMockAgent:Symbol(`mock agent`),kMockAgentSet:Symbol(`mock agent set`),kMockAgentGet:Symbol(`mock agent get`),kMockDispatch:Symbol(`mock dispatch`),kClose:Symbol(`close`),kOriginalClose:Symbol(`original agent close`),kOrigin:Symbol(`origin`),kIsMockActive:Symbol(`is mock active`),kNetConnect:Symbol(`net connect`),kGetNetConnect:Symbol(`get net connect`),kConnected:Symbol(`connected`)}})),wt=I(((e,t)=>{let{MockNotMatchedError:n}=St(),{kDispatches:r,kMockAgent:i,kOriginalDispatch:a,kOrigin:o,kGetNetConnect:s}=Ct(),{buildURL:c}=z(),{STATUS_CODES:l}=L(`node:http`),{types:{isPromise:u}}=L(`node:util`);function d(e,t){return typeof e==`string`?e===t:e instanceof RegExp?e.test(t):typeof e==`function`?e(t)===!0:!1}function f(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.toLocaleLowerCase(),t]))}function p(e,t){if(Array.isArray(e)){for(let n=0;n!e).filter(({path:e})=>d(g(e),i));if(a.length===0)throw new n(`Mock dispatch not matched for path '${i}'`);if(a=a.filter(({method:e})=>d(e,t.method)),a.length===0)throw new n(`Mock dispatch not matched for method '${t.method}' on path '${i}'`);if(a=a.filter(({body:e})=>e===void 0?!0:d(e,t.body)),a.length===0)throw new n(`Mock dispatch not matched for body '${t.body}' on path '${i}'`);if(a=a.filter(e=>h(e,t.headers)),a.length===0)throw new n(`Mock dispatch not matched for headers '${typeof t.headers==`object`?JSON.stringify(t.headers):t.headers}' on path '${i}'`);return a[0]}function b(e,t,n){let r={timesInvoked:0,times:1,persist:!1,consumed:!1},i=typeof n==`function`?{callback:n}:{...n},a={...r,...t,pending:!0,data:{error:null,...i}};return e.push(a),a}function x(e,t){let n=e.findIndex(e=>e.consumed?_(e,t):!1);n!==-1&&e.splice(n,1)}function S(e){let{path:t,method:n,body:r,headers:i,query:a}=e;return{path:t,method:n,body:r,headers:i,query:a}}function C(e){let t=Object.keys(e),n=[];for(let r=0;r=h,i.pending=p0?setTimeout(()=>{g(this[r])},d):g(this[r]);function g(r,i=o){let l=Array.isArray(e.headers)?m(e.headers):e.headers,d=typeof i==`function`?i({...e,headers:l}):i;if(u(d)){d.then(e=>g(r,e));return}let f=v(d),p=C(s),h=C(c);t.onConnect?.(e=>t.onError(e),null),t.onHeaders?.(a,p,_,w(a)),t.onData?.(Buffer.from(f)),t.onComplete?.(h),x(r,n)}function _(){}return!0}function D(){let e=this[i],t=this[o],r=this[a];return function(i,a){if(e.isMockActive)try{E.call(this,i,a)}catch(o){if(o instanceof n){let c=e[s]();if(c===!1)throw new n(`${o.message}: subsequent request to origin ${t} was not allowed (net.connect disabled)`);if(O(c,t))r.call(this,i,a);else throw new n(`${o.message}: subsequent request to origin ${t} was not allowed (net.connect is not enabled for this origin)`)}else throw o}else r.call(this,i,a)}}function O(e,t){let n=new URL(t);return e===!0?!0:!!(Array.isArray(e)&&e.some(e=>d(e,n.host)))}function k(e){if(e){let{agent:t,...n}=e;return n}}t.exports={getResponseData:v,getMockDispatch:y,addMockDispatch:b,deleteMockDispatch:x,buildKey:S,generateKeyValues:C,matchValue:d,getResponse:T,getStatusText:w,mockDispatch:E,buildMockDispatch:D,checkNetConnect:O,buildMockOptions:k,getHeaderByName:p,buildHeadersFromArray:m}})),Tt=I(((e,t)=>{let{getResponseData:n,buildKey:r,addMockDispatch:i}=wt(),{kDispatches:a,kDispatchKey:o,kDefaultHeaders:s,kDefaultTrailers:c,kContentLength:l,kMockDispatch:u}=Ct(),{InvalidArgumentError:d}=R(),{buildURL:f}=z();var p=class{constructor(e){this[u]=e}delay(e){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw new d(`waitInMs must be a valid integer > 0`);return this[u].delay=e,this}persist(){return this[u].persist=!0,this}times(e){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw new d(`repeatTimes must be a valid integer > 0`);return this[u].times=e,this}},m=class{constructor(e,t){if(typeof e!=`object`)throw new d(`opts must be an object`);if(e.path===void 0)throw new d(`opts.path must be defined`);if(e.method===void 0&&(e.method=`GET`),typeof e.path==`string`)if(e.query)e.path=f(e.path,e.query);else{let t=new URL(e.path,`data://`);e.path=t.pathname+t.search}typeof e.method==`string`&&(e.method=e.method.toUpperCase()),this[o]=r(e),this[a]=t,this[s]={},this[c]={},this[l]=!1}createMockScopeDispatchData({statusCode:e,data:t,responseOptions:r}){let i=n(t),a=this[l]?{"content-length":i.length}:{};return{statusCode:e,data:t,headers:{...this[s],...a,...r.headers},trailers:{...this[c],...r.trailers}}}validateReplyParameters(e){if(e.statusCode===void 0)throw new d(`statusCode must be defined`);if(typeof e.responseOptions!=`object`||e.responseOptions===null)throw new d(`responseOptions must be an object`)}reply(e){if(typeof e==`function`)return new p(i(this[a],this[o],t=>{let n=e(t);if(typeof n!=`object`||!n)throw new d(`reply options callback must return an object`);let r={data:``,responseOptions:{},...n};return this.validateReplyParameters(r),{...this.createMockScopeDispatchData(r)}}));let t={statusCode:e,data:arguments[1]===void 0?``:arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(t);let n=this.createMockScopeDispatchData(t);return new p(i(this[a],this[o],n))}replyWithError(e){if(e===void 0)throw new d(`error must be defined`);return new p(i(this[a],this[o],{error:e}))}defaultReplyHeaders(e){if(e===void 0)throw new d(`headers must be defined`);return this[s]=e,this}defaultReplyTrailers(e){if(e===void 0)throw new d(`trailers must be defined`);return this[c]=e,this}replyContentLength(){return this[l]=!0,this}};t.exports.MockInterceptor=m,t.exports.MockScope=p})),Et=I(((e,t)=>{let{promisify:n}=L(`node:util`),r=nt(),{buildMockDispatch:i}=wt(),{kDispatches:a,kMockAgent:o,kClose:s,kOriginalClose:c,kOrigin:l,kOriginalDispatch:u,kConnected:d}=Ct(),{MockInterceptor:f}=Tt(),p=ke(),{InvalidArgumentError:m}=R();t.exports=class extends r{constructor(e,t){if(super(e,t),!t||!t.agent||typeof t.agent.dispatch!=`function`)throw new m(`Argument opts.agent must implement Agent`);this[o]=t.agent,this[l]=e,this[a]=[],this[d]=1,this[u]=this.dispatch,this[c]=this.close.bind(this),this.dispatch=i.call(this),this.close=this[s]}get[p.kConnected](){return this[d]}intercept(e){return new f(e,this[a])}async[s](){await n(this[c])(),this[d]=0,this[o][p.kClients].delete(this[l])}}})),Dt=I(((e,t)=>{let{promisify:n}=L(`node:util`),r=ot(),{buildMockDispatch:i}=wt(),{kDispatches:a,kMockAgent:o,kClose:s,kOriginalClose:c,kOrigin:l,kOriginalDispatch:u,kConnected:d}=Ct(),{MockInterceptor:f}=Tt(),p=ke(),{InvalidArgumentError:m}=R();t.exports=class extends r{constructor(e,t){if(super(e,t),!t||!t.agent||typeof t.agent.dispatch!=`function`)throw new m(`Argument opts.agent must implement Agent`);this[o]=t.agent,this[l]=e,this[a]=[],this[d]=1,this[u]=this.dispatch,this[c]=this.close.bind(this),this.dispatch=i.call(this),this.close=this[s]}get[p.kConnected](){return this[d]}intercept(e){return new f(e,this[a])}async[s](){await n(this[c])(),this[d]=0,this[o][p.kClients].delete(this[l])}}})),Ot=I(((e,t)=>{let n={pronoun:`it`,is:`is`,was:`was`,this:`this`},r={pronoun:`they`,is:`are`,was:`were`,this:`these`};t.exports=class{constructor(e,t){this.singular=e,this.plural=t}pluralize(e){let t=e===1,i=t?n:r,a=t?this.singular:this.plural;return{...i,count:e,noun:a}}}})),kt=I(((e,t)=>{let{Transform:n}=L(`node:stream`),{Console:r}=L(`node:console`),i=process.versions.icu?`✅`:`Y `,a=process.versions.icu?`❌`:`N `;t.exports=class{constructor({disableColors:e}={}){this.transform=new n({transform(e,t,n){n(null,e)}}),this.logger=new r({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let t=e.map(({method:e,path:t,data:{statusCode:n},persist:r,times:o,timesInvoked:s,origin:c})=>({Method:e,Origin:c,Path:t,"Status code":n,Persistent:r?i:a,Invocations:s,Remaining:r?1/0:o-s}));return this.logger.table(t),this.transform.read().toString()}}})),At=I(((e,t)=>{let{kClients:n}=ke(),r=ct(),{kAgent:i,kMockAgentSet:a,kMockAgentGet:o,kDispatches:s,kIsMockActive:c,kNetConnect:l,kGetNetConnect:u,kOptions:d,kFactory:f}=Ct(),p=Et(),m=Dt(),{matchValue:h,buildMockOptions:g}=wt(),{InvalidArgumentError:_,UndiciError:v}=R(),y=Pe(),b=Ot(),x=kt();t.exports=class extends y{constructor(e){if(super(e),this[l]=!0,this[c]=!0,e?.agent&&typeof e.agent.dispatch!=`function`)throw new _(`Argument opts.agent must implement Agent`);let t=e?.agent?e.agent:new r(e);this[i]=t,this[n]=t[n],this[d]=g(e)}get(e){let t=this[o](e);return t||(t=this[f](e),this[a](e,t)),t}dispatch(e,t){return this.get(e.origin),this[i].dispatch(e,t)}async close(){await this[i].close(),this[n].clear()}deactivate(){this[c]=!1}activate(){this[c]=!0}enableNetConnect(e){if(typeof e==`string`||typeof e==`function`||e instanceof RegExp)Array.isArray(this[l])?this[l].push(e):this[l]=[e];else if(e===void 0)this[l]=!0;else throw new _(`Unsupported matcher. Must be one of String|Function|RegExp.`)}disableNetConnect(){this[l]=!1}get isMockActive(){return this[c]}[a](e,t){this[n].set(e,t)}[f](e){let t=Object.assign({agent:this},this[d]);return this[d]&&this[d].connections===1?new p(e,t):new m(e,t)}[o](e){let t=this[n].get(e);if(t)return t;if(typeof e!=`string`){let t=this[f](`http://localhost:9999`);return this[a](e,t),t}for(let[t,r]of Array.from(this[n]))if(r&&typeof t!=`string`&&h(t,e)){let t=this[f](e);return this[a](e,t),t[s]=r[s],t}}[u](){return this[l]}pendingInterceptors(){let e=this[n];return Array.from(e.entries()).flatMap(([e,t])=>t[s].map(t=>({...t,origin:e}))).filter(({pending:e})=>e)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new x}={}){let t=this.pendingInterceptors();if(t.length===0)return;let n=new b(`interceptor`,`interceptors`).pluralize(t.length);throw new v(` ${n.count} ${n.noun} ${n.is} pending: ${e.format(t)} -`.trim())}}})),jt=I(((e,t)=>{let n=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:r}=R(),i=ct();o()===void 0&&a(new i);function a(e){if(!e||typeof e.dispatch!=`function`)throw new r(`Argument agent must implement Agent`);Object.defineProperty(globalThis,n,{value:e,writable:!0,enumerable:!1,configurable:!1})}function o(){return globalThis[n]}t.exports={setGlobalDispatcher:a,getGlobalDispatcher:o}})),Mt=I(((e,t)=>{t.exports=class{#e;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`handler must be an object`);this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}})),Nt=I(((e,t)=>{let n=et();t.exports=e=>{let t=e?.maxRedirections;return e=>function(r,i){let{maxRedirections:a=t,...o}=r;return a?e(o,new n(e,a,r,i)):e(r,i)}}})),Pt=I(((e,t)=>{let n=dt();t.exports=e=>t=>function(r,i){return t(r,new n({...r,retryOptions:{...e,...r.retryOptions}},{handler:i,dispatch:t}))}})),Ft=I(((e,t)=>{let n=z(),{InvalidArgumentError:r,RequestAbortedError:i}=R(),a=Mt();var o=class extends a{#e=1024*1024;#t=null;#n=!1;#r=!1;#i=0;#a=null;#o=null;constructor({maxSize:e},t){if(super(t),e!=null&&(!Number.isFinite(e)||e<1))throw new r(`maxSize must be a number greater than 0`);this.#e=e??this.#e,this.#o=t}onConnect(e){this.#t=e,this.#o.onConnect(this.#s.bind(this))}#s(e){this.#r=!0,this.#a=e}onHeaders(e,t,r,a){let o=n.parseHeaders(t)[`content-length`];if(o!=null&&o>this.#e)throw new i(`Response size (${o}) larger than maxSize (${this.#e})`);return this.#r?!0:this.#o.onHeaders(e,t,r,a)}onError(e){this.#n||(e=this.#a??e,this.#o.onError(e))}onData(e){return this.#i+=e.length,this.#i>=this.#e&&(this.#n=!0,this.#r?this.#o.onError(this.#a):this.#o.onComplete([])),!0}onComplete(e){if(!this.#n){if(this.#r){this.#o.onError(this.reason);return}this.#o.onComplete(e)}}};function s({maxSize:e}={maxSize:1024*1024}){return t=>function(n,r){let{dumpMaxSize:i=e}=n;return t(n,new o({maxSize:i},r))}}t.exports=s})),It=I(((e,t)=>{let{isIP:n}=L(`node:net`),{lookup:r}=L(`node:dns`),i=Mt(),{InvalidArgumentError:a,InformationalError:o}=R(),s=2**31-1;var c=class{#e=0;#t=0;#n=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#i}get full(){return this.#n.size===this.#t}runLookup(e,t,n){let r=this.#n.get(e.hostname);if(r==null&&this.full){n(null,e.origin);return}let i={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(e,i,(t,r)=>{if(t||r==null||r.length===0){n(t??new o(`No DNS entries found`));return}this.setRecords(e,r);let a=this.#n.get(e.hostname),s=this.pick(e,a,i.affinity),c;c=typeof s.port==`number`?`:${s.port}`:e.port===``?``:`:${e.port}`,n(null,`${e.protocol}//${s.family===6?`[${s.address}]`:s.address}${c}`)});else{let a=this.pick(e,r,i.affinity);if(a==null){this.#n.delete(e.hostname),this.runLookup(e,t,n);return}let o;o=typeof a.port==`number`?`:${a.port}`:e.port===``?``:`:${e.port}`,n(null,`${e.protocol}//${a.family===6?`[${a.address}]`:a.address}${o}`)}}#r(e,t,n){r(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:`ipv4first`},(e,t)=>{if(e)return n(e);let r=new Map;for(let e of t)r.set(`${e.address}:${e.family}`,e);n(null,r.values())})}#i(e,t,n){let r=null,{records:i,offset:a}=t,o;if(this.dualStack?(n??(a==null||a===s?(t.offset=0,n=4):(t.offset++,n=(t.offset&1)==1?6:4)),o=i[n]!=null&&i[n].ips.length>0?i[n]:i[n===4?6:4]):o=i[n],o==null||o.ips.length===0)return r;o.offset==null||o.offset===s?o.offset=0:o.offset++;let c=o.offset%o.ips.length;return r=o.ips[c]??null,r==null?r:Date.now()-r.timestamp>r.ttl?(o.ips.splice(c,1),this.pick(e,t,n)):r}setRecords(e,t){let n=Date.now(),r={records:{4:null,6:null}};for(let e of t){e.timestamp=n,typeof e.ttl==`number`?e.ttl=Math.min(e.ttl,this.#e):e.ttl=this.#e;let t=r.records[e.family]??{ips:[]};t.ips.push(e),r.records[e.family]=t}this.#n.set(e.hostname,r)}getHandler(e,t){return new l(this,e,t)}},l=class extends i{#e=null;#t=null;#n=null;#r=null;#i=null;constructor(e,{origin:t,handler:n,dispatch:r},i){super(n),this.#i=t,this.#r=n,this.#t={...i},this.#e=e,this.#n=r}onError(e){switch(e.code){case`ETIMEDOUT`:case`ECONNREFUSED`:if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(e,t)=>{if(e)return this.#r.onError(e);let n={...this.#t,origin:t};this.#n(n,this)});return}this.#r.onError(e);return;case`ENOTFOUND`:this.#e.deleteRecord(this.#i);default:this.#r.onError(e);break}}};t.exports=e=>{if(e?.maxTTL!=null&&(typeof e?.maxTTL!=`number`||e?.maxTTL<0))throw new a(`Invalid maxTTL. Must be a positive number`);if(e?.maxItems!=null&&(typeof e?.maxItems!=`number`||e?.maxItems<1))throw new a(`Invalid maxItems. Must be a positive number and greater than zero`);if(e?.affinity!=null&&e?.affinity!==4&&e?.affinity!==6)throw new a(`Invalid affinity. Must be either 4 or 6`);if(e?.dualStack!=null&&typeof e?.dualStack!=`boolean`)throw new a(`Invalid dualStack. Must be a boolean`);if(e?.lookup!=null&&typeof e?.lookup!=`function`)throw new a(`Invalid lookup. Must be a function`);if(e?.pick!=null&&typeof e?.pick!=`function`)throw new a(`Invalid pick. Must be a function`);let t=e?.dualStack??!0,r;r=t?e?.affinity??null:e?.affinity??4;let i=new c({maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:r,maxItems:e?.maxItems??1/0});return e=>function(t,r){let a=t.origin.constructor===URL?t.origin:new URL(t.origin);return n(a.hostname)===0?(i.runLookup(a,t,(n,o)=>{if(n)return r.onError(n);let s=null;s={...t,servername:a.hostname,origin:o,headers:{host:a.hostname,...t.headers}},e(s,i.getHandler({origin:a,dispatch:e,handler:r},t))}),!0):e(t,r)}}})),Lt=I(((e,t)=>{let{kConstruct:n}=ke(),{kEnumerableProperty:r}=z(),{iteratorMixin:i,isValidHeaderName:a,isValidHeaderValue:o}=Ke(),{webidl:s}=Ge(),c=L(`node:assert`),l=L(`node:util`),u=Symbol(`headers map`),d=Symbol(`headers map sorted`);function f(e){return e===10||e===13||e===9||e===32}function p(e){let t=0,n=e.length;for(;n>t&&f(e.charCodeAt(n-1));)--n;for(;n>t&&f(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function m(e,t){if(Array.isArray(t))for(let n=0;n>`,`record`]})}function h(e,t,n){if(n=p(n),!a(t))throw s.errors.invalidArgument({prefix:`Headers.append`,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:`Headers.append`,value:n,type:`header value`});if(y(e)===`immutable`)throw TypeError(`immutable`);return x(e).append(t,n,!1)}function g(e,t){return e[0]>1),t[s][0]<=l[0]?o=s+1:a=s;if(r!==s){for(i=r;i>o;)t[i]=t[--i];t[o]=l}}if(!n.next().done)throw TypeError(`Unreachable`);return t}else{let e=0;for(let{0:n,1:{value:r}}of this[u])t[e++]=[n,r],c(r!==null);return t.sort(g)}}},v=class e{#e;#t;constructor(e=void 0){s.util.markAsUncloneable(this),e!==n&&(this.#t=new _,this.#e=`none`,e!==void 0&&(e=s.converters.HeadersInit(e,`Headers contructor`,`init`),m(this,e)))}append(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.append`);let r=`Headers.append`;return t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),h(this,t,n)}delete(t){if(s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.delete`),t=s.converters.ByteString(t,`Headers.delete`,`name`),!a(t))throw s.errors.invalidArgument({prefix:`Headers.delete`,value:t,type:`header name`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.contains(t,!1)&&this.#t.delete(t,!1)}get(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.get`);let n=`Headers.get`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.get(t,!1)}has(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.has`);let n=`Headers.has`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.contains(t,!1)}set(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.set`);let r=`Headers.set`;if(t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),n=p(n),!a(t))throw s.errors.invalidArgument({prefix:r,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:r,value:n,type:`header value`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.set(t,n,!1)}getSetCookie(){s.brandCheck(this,e);let t=this.#t.cookies;return t?[...t]:[]}get[d](){if(this.#t[d])return this.#t[d];let e=[],t=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[d]=t;for(let r=0;r>`](e,t,n,r.bind(e)):s.converters[`record`](e,t,n)}throw s.errors.conversionFailed({prefix:`Headers constructor`,argument:`Argument 1`,types:[`sequence>`,`record`]})},t.exports={fill:m,compareHeaderName:g,Headers:v,HeadersList:_,getHeadersGuard:y,setHeadersGuard:b,setHeadersList:S,getHeadersList:x}})),Rt=I(((e,t)=>{let{Headers:n,HeadersList:r,fill:i,getHeadersGuard:a,setHeadersGuard:o,setHeadersList:s}=Lt(),{extractBody:c,cloneBody:l,mixinBody:u,hasFinalizationRegistry:d,streamRegistry:f,bodyUnusable:p}=Ze(),m=z(),h=L(`node:util`),{kEnumerableProperty:g}=m,{isValidReasonPhrase:_,isCancelled:v,isAborted:y,isBlobLike:b,serializeJavascriptValueToJSONString:x,isErrorLike:S,isomorphicEncode:C,environmentSettingsObject:w}=Ke(),{redirectStatusSet:T,nullBodyStatus:E}=He(),{kState:D,kHeaders:O}=qe(),{webidl:k}=Ge(),{FormData:A}=Ye(),{URLSerializer:j}=We(),{kConstruct:M}=ke(),N=L(`node:assert`),{types:P}=L(`node:util`),ee=new TextEncoder(`utf-8`);var te=class e{static error(){return le(re(),`immutable`)}static json(e,t={}){k.argumentLengthCheck(arguments,1,`Response.json`),t!==null&&(t=k.converters.ResponseInit(t));let n=c(ee.encode(x(e))),r=le(F({}),`response`);return ce(r,t,{body:n[0],type:`application/json`}),r}static redirect(e,t=302){k.argumentLengthCheck(arguments,1,`Response.redirect`),e=k.converters.USVString(e),t=k.converters[`unsigned short`](t);let n;try{n=new URL(e,w.settingsObject.baseUrl)}catch(t){throw TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!T.has(t))throw RangeError(`Invalid status code ${t}`);let r=le(F({}),`immutable`);r[D].status=t;let i=C(j(n));return r[D].headersList.append(`location`,i,!0),r}constructor(e=null,t={}){if(k.util.markAsUncloneable(this),e===M)return;e!==null&&(e=k.converters.BodyInit(e)),t=k.converters.ResponseInit(t),this[D]=F({}),this[O]=new n(M),o(this[O],`response`),s(this[O],this[D].headersList);let r=null;if(e!=null){let[t,n]=c(e);r={body:t,type:n}}ce(this,t,r)}get type(){return k.brandCheck(this,e),this[D].type}get url(){k.brandCheck(this,e);let t=this[D].urlList,n=t[t.length-1]??null;return n===null?``:j(n,!0)}get redirected(){return k.brandCheck(this,e),this[D].urlList.length>1}get status(){return k.brandCheck(this,e),this[D].status}get ok(){return k.brandCheck(this,e),this[D].status>=200&&this[D].status<=299}get statusText(){return k.brandCheck(this,e),this[D].statusText}get headers(){return k.brandCheck(this,e),this[O]}get body(){return k.brandCheck(this,e),this[D].body?this[D].body.stream:null}get bodyUsed(){return k.brandCheck(this,e),!!this[D].body&&m.isDisturbed(this[D].body.stream)}clone(){if(k.brandCheck(this,e),p(this))throw k.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let t=ne(this[D]);return d&&this[D].body?.stream&&f.register(this,new WeakRef(this[D].body.stream)),le(t,a(this[O]))}[h.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${h.formatWithOptions(t,n)}`}};u(te),Object.defineProperties(te.prototype,{type:g,url:g,status:g,ok:g,redirected:g,statusText:g,headers:g,clone:g,body:g,bodyUsed:g,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(te,{json:g,redirect:g,error:g});function ne(e){if(e.internalResponse)return oe(ne(e.internalResponse),e.type);let t=F({...e,body:null});return e.body!=null&&(t.body=l(t,e.body)),t}function F(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:`default`,status:200,timingInfo:null,cacheState:``,statusText:``,...e,headersList:e?.headersList?new r(e?.headersList):new r,urlList:e?.urlList?[...e.urlList]:[]}}function re(e){return F({type:`error`,status:0,error:S(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function ie(e){return e.type===`error`&&e.status===0}function ae(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(e,n){return n in t?t[n]:e[n]},set(e,n,r){return N(!(n in t)),e[n]=r,!0}})}function oe(e,t){if(t===`basic`)return ae(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return ae(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return ae(e,{type:`opaque`,urlList:Object.freeze([]),status:0,statusText:``,body:null});if(t===`opaqueredirect`)return ae(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});N(!1)}function se(e,t=null){return N(v(e)),y(e)?re(Object.assign(new DOMException(`The operation was aborted.`,`AbortError`),{cause:t})):re(Object.assign(new DOMException(`Request was cancelled.`),{cause:t}))}function ce(e,t,n){if(t.status!==null&&(t.status<200||t.status>599))throw RangeError(`init["status"] must be in the range of 200 to 599, inclusive.`);if(`statusText`in t&&t.statusText!=null&&!_(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(e[D].status=t.status),`statusText`in t&&t.statusText!=null&&(e[D].statusText=t.statusText),`headers`in t&&t.headers!=null&&i(e[O],t.headers),n){if(E.includes(e.status))throw k.errors.exception({header:`Response constructor`,message:`Invalid response status code ${e.status}`});e[D].body=n.body,n.type!=null&&!e[D].headersList.contains(`content-type`,!0)&&e[D].headersList.append(`content-type`,n.type,!0)}}function le(e,t){let r=new te(M);return r[D]=e,r[O]=new n(M),s(r[O],e.headersList),o(r[O],t),d&&e.body?.stream&&f.register(r,new WeakRef(e.body.stream)),r}k.converters.ReadableStream=k.interfaceConverter(ReadableStream),k.converters.FormData=k.interfaceConverter(A),k.converters.URLSearchParams=k.interfaceConverter(URLSearchParams),k.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e==`string`?k.converters.USVString(e,t,n):b(e)?k.converters.Blob(e,t,n,{strict:!1}):ArrayBuffer.isView(e)||P.isArrayBuffer(e)?k.converters.BufferSource(e,t,n):m.isFormDataLike(e)?k.converters.FormData(e,t,n,{strict:!1}):e instanceof URLSearchParams?k.converters.URLSearchParams(e,t,n):k.converters.DOMString(e,t,n)},k.converters.BodyInit=function(e,t,n){return e instanceof ReadableStream?k.converters.ReadableStream(e,t,n):e?.[Symbol.asyncIterator]?e:k.converters.XMLHttpRequestBodyInit(e,t,n)},k.converters.ResponseInit=k.dictionaryConverter([{key:`status`,converter:k.converters[`unsigned short`],defaultValue:()=>200},{key:`statusText`,converter:k.converters.ByteString,defaultValue:()=>``},{key:`headers`,converter:k.converters.HeadersInit}]),t.exports={isNetworkError:ie,makeNetworkError:re,makeResponse:F,makeAppropriateNetworkError:se,filterResponse:oe,Response:te,cloneResponse:ne,fromInnerResponse:le}})),zt=I(((e,t)=>{let{kConnected:n,kSize:r}=ke();var i=class{constructor(e){this.value=e}deref(){return this.value[n]===0&&this.value[r]===0?void 0:this.value}},a=class{constructor(e){this.finalizer=e}register(e,t){e.on&&e.on(`disconnect`,()=>{e[n]===0&&e[r]===0&&this.finalizer(t)})}unregister(e){}};t.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith(`v18`)?(process._rawDebug(`Using compatibility WeakRef and FinalizationRegistry`),{WeakRef:i,FinalizationRegistry:a}):{WeakRef,FinalizationRegistry}}})),Bt=I(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i,bodyUnusable:a}=Ze(),{Headers:o,fill:s,HeadersList:c,setHeadersGuard:l,getHeadersGuard:u,setHeadersList:d,getHeadersList:f}=Lt(),{FinalizationRegistry:p}=zt()(),m=z(),h=L(`node:util`),{isValidHTTPToken:g,sameOrigin:_,environmentSettingsObject:v}=Ke(),{forbiddenMethodsSet:y,corsSafeListedMethodsSet:b,referrerPolicy:x,requestRedirect:S,requestMode:C,requestCredentials:w,requestCache:T,requestDuplex:E}=He(),{kEnumerableProperty:D,normalizedMethodRecordsBase:O,normalizedMethodRecords:k}=m,{kHeaders:A,kSignal:j,kState:M,kDispatcher:N}=qe(),{webidl:P}=Ge(),{URLSerializer:ee}=We(),{kConstruct:te}=ke(),ne=L(`node:assert`),{getMaxListeners:F,setMaxListeners:re,getEventListeners:ie,defaultMaxListeners:ae}=L(`node:events`),oe=Symbol(`abortController`),se=new p(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)}),ce=new WeakMap;function le(e){return t;function t(){let n=e.deref();if(n!==void 0){se.unregister(t),this.removeEventListener(`abort`,t),n.abort(this.reason);let e=ce.get(n.signal);if(e!==void 0){if(e.size!==0){for(let t of e){let e=t.deref();e!==void 0&&e.abort(this.reason)}e.clear()}ce.delete(n.signal)}}}}let ue=!1;var de=class e{constructor(t,r={}){if(P.util.markAsUncloneable(this),t===te)return;let i=`Request constructor`;P.argumentLengthCheck(arguments,1,i),t=P.converters.RequestInfo(t,i,`input`),r=P.converters.RequestInit(r,i,`init`);let u=null,p=null,h=v.settingsObject.baseUrl,x=null;if(typeof t==`string`){this[N]=r.dispatcher;let e;try{e=new URL(t,h)}catch(e){throw TypeError(`Failed to parse URL from `+t,{cause:e})}if(e.username||e.password)throw TypeError(`Request cannot be constructed from a URL that includes credentials: `+t);u=I({urlList:[e]}),p=`cors`}else this[N]=r.dispatcher||t[N],ne(t instanceof e),u=t[M],x=t[j];let S=v.settingsObject.origin,C=`client`;if(u.window?.constructor?.name===`EnvironmentSettingsObject`&&_(u.window,S)&&(C=u.window),r.window!=null)throw TypeError(`'window' option '${C}' must be null`);`window`in r&&(C=`no-window`),u=I({method:u.method,headersList:u.headersList,unsafeRequest:u.unsafeRequest,client:v.settingsObject,window:C,priority:u.priority,origin:u.origin,referrer:u.referrer,referrerPolicy:u.referrerPolicy,mode:u.mode,credentials:u.credentials,cache:u.cache,redirect:u.redirect,integrity:u.integrity,keepalive:u.keepalive,reloadNavigation:u.reloadNavigation,historyNavigation:u.historyNavigation,urlList:[...u.urlList]});let w=Object.keys(r).length!==0;if(w&&(u.mode===`navigate`&&(u.mode=`same-origin`),u.reloadNavigation=!1,u.historyNavigation=!1,u.origin=`client`,u.referrer=`client`,u.referrerPolicy=``,u.url=u.urlList[u.urlList.length-1],u.urlList=[u.url]),r.referrer!==void 0){let e=r.referrer;if(e===``)u.referrer=`no-referrer`;else{let t;try{t=new URL(e,h)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||S&&!_(t,v.settingsObject.baseUrl)?u.referrer=`client`:u.referrer=t}}r.referrerPolicy!==void 0&&(u.referrerPolicy=r.referrerPolicy);let T;if(T=r.mode===void 0?p:r.mode,T===`navigate`)throw P.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(T!=null&&(u.mode=T),r.credentials!==void 0&&(u.credentials=r.credentials),r.cache!==void 0&&(u.cache=r.cache),u.cache===`only-if-cached`&&u.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(r.redirect!==void 0&&(u.redirect=r.redirect),r.integrity!=null&&(u.integrity=String(r.integrity)),r.keepalive!==void 0&&(u.keepalive=!!r.keepalive),r.method!==void 0){let e=r.method,t=k[e];if(t!==void 0)u.method=t;else{if(!g(e))throw TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(y.has(t))throw TypeError(`'${e}' HTTP method is unsupported.`);e=O[t]??e,u.method=e}!ue&&u.method===`patch`&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:`UNDICI-FETCH-patch`}),ue=!0)}r.signal!==void 0&&(x=r.signal),this[M]=u;let E=new AbortController;if(this[j]=E.signal,x!=null){if(!x||typeof x.aborted!=`boolean`||typeof x.addEventListener!=`function`)throw TypeError(`Failed to construct 'Request': member signal is not of type AbortSignal.`);if(x.aborted)E.abort(x.reason);else{this[oe]=E;let e=le(new WeakRef(E));try{(typeof F==`function`&&F(x)===ae||ie(x,`abort`).length>=ae)&&re(1500,x)}catch{}m.addAbortListener(x,e),se.register(E,{signal:x,abort:e},e)}}if(this[A]=new o(te),d(this[A],u.headersList),l(this[A],`request`),T===`no-cors`){if(!b.has(u.method))throw TypeError(`'${u.method} is unsupported in no-cors mode.`);l(this[A],`request-no-cors`)}if(w){let e=f(this[A]),t=r.headers===void 0?new c(e):r.headers;if(e.clear(),t instanceof c){for(let{name:n,value:r}of t.rawValues())e.append(n,r,!1);e.cookies=t.cookies}else s(this[A],t)}let D=t instanceof e?t[M].body:null;if((r.body!=null||D!=null)&&(u.method===`GET`||u.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let ee=null;if(r.body!=null){let[e,t]=n(r.body,u.keepalive);ee=e,t&&!f(this[A]).contains(`content-type`,!0)&&this[A].append(`content-type`,t)}let ce=ee??D;if(ce!=null&&ce.source==null){if(ee!=null&&r.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(u.mode!==`same-origin`&&u.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);u.useCORSPreflightFlag=!0}let de=ce;if(ee==null&&D!=null){if(a(t))throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);let e=new TransformStream;D.stream.pipeThrough(e),de={source:D.source,length:D.length,stream:e.readable}}this[M].body=de}get method(){return P.brandCheck(this,e),this[M].method}get url(){return P.brandCheck(this,e),ee(this[M].url)}get headers(){return P.brandCheck(this,e),this[A]}get destination(){return P.brandCheck(this,e),this[M].destination}get referrer(){return P.brandCheck(this,e),this[M].referrer===`no-referrer`?``:this[M].referrer===`client`?`about:client`:this[M].referrer.toString()}get referrerPolicy(){return P.brandCheck(this,e),this[M].referrerPolicy}get mode(){return P.brandCheck(this,e),this[M].mode}get credentials(){return this[M].credentials}get cache(){return P.brandCheck(this,e),this[M].cache}get redirect(){return P.brandCheck(this,e),this[M].redirect}get integrity(){return P.brandCheck(this,e),this[M].integrity}get keepalive(){return P.brandCheck(this,e),this[M].keepalive}get isReloadNavigation(){return P.brandCheck(this,e),this[M].reloadNavigation}get isHistoryNavigation(){return P.brandCheck(this,e),this[M].historyNavigation}get signal(){return P.brandCheck(this,e),this[j]}get body(){return P.brandCheck(this,e),this[M].body?this[M].body.stream:null}get bodyUsed(){return P.brandCheck(this,e),!!this[M].body&&m.isDisturbed(this[M].body.stream)}get duplex(){return P.brandCheck(this,e),`half`}clone(){if(P.brandCheck(this,e),a(this))throw TypeError(`unusable`);let t=fe(this[M]),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let e=ce.get(this.signal);e===void 0&&(e=new Set,ce.set(this.signal,e));let t=new WeakRef(n);e.add(t),m.addAbortListener(n.signal,le(t))}return pe(t,n.signal,u(this[A]))}[h.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${h.formatWithOptions(t,n)}`}};r(de);function I(e){return{method:e.method??`GET`,localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??``,window:e.window??`client`,keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??`all`,initiator:e.initiator??``,destination:e.destination??``,priority:e.priority??null,origin:e.origin??`client`,policyContainer:e.policyContainer??`client`,referrer:e.referrer??`client`,referrerPolicy:e.referrerPolicy??``,mode:e.mode??`no-cors`,useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??`same-origin`,useCredentials:e.useCredentials??!1,cache:e.cache??`default`,redirect:e.redirect??`follow`,integrity:e.integrity??``,cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??``,parserMetadata:e.parserMetadata??``,reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??`basic`,preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new c(e.headersList):new c}}function fe(e){let t=I({...e,body:null});return e.body!=null&&(t.body=i(t,e.body)),t}function pe(e,t,n){let r=new de(te);return r[M]=e,r[j]=t,r[A]=new o(te),d(r[A],e.headersList),l(r[A],n),r}Object.defineProperties(de.prototype,{method:D,url:D,headers:D,redirect:D,clone:D,signal:D,duplex:D,destination:D,body:D,bodyUsed:D,isHistoryNavigation:D,isReloadNavigation:D,keepalive:D,integrity:D,cache:D,credentials:D,attribute:D,referrerPolicy:D,referrer:D,mode:D,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),P.converters.Request=P.interfaceConverter(de),P.converters.RequestInfo=function(e,t,n){return typeof e==`string`?P.converters.USVString(e,t,n):e instanceof de?P.converters.Request(e,t,n):P.converters.USVString(e,t,n)},P.converters.AbortSignal=P.interfaceConverter(AbortSignal),P.converters.RequestInit=P.dictionaryConverter([{key:`method`,converter:P.converters.ByteString},{key:`headers`,converter:P.converters.HeadersInit},{key:`body`,converter:P.nullableConverter(P.converters.BodyInit)},{key:`referrer`,converter:P.converters.USVString},{key:`referrerPolicy`,converter:P.converters.DOMString,allowedValues:x},{key:`mode`,converter:P.converters.DOMString,allowedValues:C},{key:`credentials`,converter:P.converters.DOMString,allowedValues:w},{key:`cache`,converter:P.converters.DOMString,allowedValues:T},{key:`redirect`,converter:P.converters.DOMString,allowedValues:S},{key:`integrity`,converter:P.converters.DOMString},{key:`keepalive`,converter:P.converters.boolean},{key:`signal`,converter:P.nullableConverter(e=>P.converters.AbortSignal(e,`RequestInit`,`signal`,{strict:!1}))},{key:`window`,converter:P.converters.any},{key:`duplex`,converter:P.converters.DOMString,allowedValues:E},{key:`dispatcher`,converter:P.converters.any}]),t.exports={Request:de,makeRequest:I,fromInnerRequest:pe,cloneRequest:fe}})),Vt=I(((e,t)=>{let{makeNetworkError:n,makeAppropriateNetworkError:r,filterResponse:i,makeResponse:a,fromInnerResponse:o}=Rt(),{HeadersList:s}=Lt(),{Request:c,cloneRequest:l}=Bt(),u=L(`node:zlib`),{bytesMatch:d,makePolicyContainer:f,clonePolicyContainer:p,requestBadPort:m,TAOCheck:h,appendRequestOriginHeader:g,responseLocationURL:_,requestCurrentURL:v,setRequestReferrerPolicyOnRedirect:y,tryUpgradeRequestToAPotentiallyTrustworthyURL:b,createOpaqueTimingInfo:x,appendFetchMetadata:S,corsCheck:C,crossOriginResourcePolicyCheck:w,determineRequestsReferrer:T,coarsenedSharedCurrentTime:E,createDeferredPromise:D,isBlobLike:O,sameOrigin:k,isCancelled:A,isAborted:j,isErrorLike:M,fullyReadBody:N,readableStreamClose:P,isomorphicEncode:ee,urlIsLocal:te,urlIsHttpHttpsScheme:ne,urlHasHttpsScheme:F,clampAndCoarsenConnectionTimingInfo:re,simpleRangeHeaderValue:ie,buildContentRange:ae,createInflate:oe,extractMimeType:se}=Ke(),{kState:ce,kDispatcher:le}=qe(),ue=L(`node:assert`),{safelyExtractBody:de,extractBody:I}=Ze(),{redirectStatusSet:fe,nullBodyStatus:pe,safeMethodsSet:me,requestBodyHeader:he,subresourceSet:ge}=He(),_e=L(`node:events`),{Readable:ve,pipeline:ye,finished:be}=L(`node:stream`),{addAbortListener:xe,isErrored:Se,isReadable:Ce,bufferToLowerCasedHeaderName:we}=z(),{dataURLProcessor:Te,serializeAMimeType:Ee,minimizeSupportedMimeType:De}=We(),{getGlobalDispatcher:Oe}=jt(),{webidl:ke}=Ge(),{STATUS_CODES:R}=L(`node:http`),Ae=[`GET`,`HEAD`],je=typeof __UNDICI_IS_NODE__<`u`||typeof esbuildDetection<`u`?`node`:`undici`,Me;var Ne=class extends _e{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state=`ongoing`}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||=new DOMException(`The operation was aborted.`,`AbortError`),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit(`terminated`,e))}};function Pe(e){Ie(e,`fetch`)}function Fe(e,t=void 0){ke.argumentLengthCheck(arguments,1,`globalThis.fetch`);let n=D(),r;try{r=new c(e,t)}catch(e){return n.reject(e),n.promise}let i=r[ce];if(r.signal.aborted)return Re(n,i,null,r.signal.reason),n.promise;i.client.globalObject?.constructor?.name===`ServiceWorkerGlobalScope`&&(i.serviceWorkers=`none`);let a=null,s=!1,l=null;return xe(r.signal,()=>{s=!0,ue(l!=null),l.abort(r.signal.reason);let e=a?.deref();Re(n,i,e,r.signal.reason)}),l=ze({request:i,processResponseEndOfBody:Pe,processResponse:e=>{if(!s){if(e.aborted){Re(n,i,a,l.serializedAbortReason);return}if(e.type===`error`){n.reject(TypeError(`fetch failed`,{cause:e.error}));return}a=new WeakRef(o(e,`immutable`)),n.resolve(a.deref()),n=null}},dispatcher:r[le]}),n.promise}function Ie(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;ne(n)&&r!==null&&(e.timingAllowPassed||(r=x({startTime:r.startTime}),i=``),r.endTime=E(),e.timingInfo=r,Le(r,n.href,t,globalThis,i))}let Le=performance.markResourceTiming;function Re(e,t,n,r){if(e&&e.reject(r),t.body!=null&&Ce(t.body?.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let i=n[ce];i.body!=null&&Ce(i.body?.stream)&&i.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e})}function ze({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s=Oe()}){ue(s);let c=null,l=!1;e.client!=null&&(c=e.client.globalObject,l=e.client.crossOriginIsolatedCapability);let u=x({startTime:E(l)}),d={controller:new Ne(s),request:e,timingInfo:u,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:l};return ue(!e.body||e.body.stream),e.window===`client`&&(e.window=e.client?.globalObject?.constructor?.name===`Window`?e.client:`no-window`),e.origin===`client`&&(e.origin=e.client.origin),e.policyContainer===`client`&&(e.client==null?e.policyContainer=f():e.policyContainer=p(e.client.policyContainer)),e.headersList.contains(`accept`,!0)||e.headersList.append(`accept`,`*/*`,!0),e.headersList.contains(`accept-language`,!0)||e.headersList.append(`accept-language`,`*`,!0),e.priority,ge.has(e.destination),Be(d).catch(e=>{d.controller.terminate(e)}),d.controller}async function Be(e,t=!1){let r=e.request,a=null;if(r.localURLsOnly&&!te(v(r))&&(a=n(`local URLs only`)),b(r),m(r)===`blocked`&&(a=n(`bad port`)),r.referrerPolicy===``&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!==`no-referrer`&&(r.referrer=T(r)),a===null&&(a=await(async()=>{let t=v(r);return k(t,r.url)&&r.responseTainting===`basic`||t.protocol===`data:`||r.mode===`navigate`||r.mode===`websocket`?(r.responseTainting=`basic`,await Ve(e)):r.mode===`same-origin`?n(`request mode cannot be "same-origin"`):r.mode===`no-cors`?r.redirect===`follow`?(r.responseTainting=`opaque`,await Ve(e)):n(`redirect mode cannot be "follow" for "no-cors" request`):ne(v(r))?(r.responseTainting=`cors`,await Ye(e)):n(`URL scheme must be a HTTP(S) scheme`)})()),t)return a;a.status!==0&&!a.internalResponse&&(r.responseTainting,r.responseTainting===`basic`?a=i(a,`basic`):r.responseTainting===`cors`?a=i(a,`cors`):r.responseTainting===`opaque`?a=i(a,`opaque`):ue(!1));let o=a.status===0?a:a.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(a.timingAllowPassed=!0),a.type===`opaque`&&o.status===206&&o.rangeRequested&&!r.headers.contains(`range`,!0)&&(a=o=n()),a.status!==0&&(r.method===`HEAD`||r.method===`CONNECT`||pe.includes(o.status))&&(o.body=null,e.controller.dump=!0),r.integrity){let t=t=>Je(e,n(t));if(r.responseTainting===`opaque`||a.body==null){t(a.error);return}await N(a.body,n=>{if(!d(n,r.integrity)){t(`integrity mismatch`);return}a.body=de(n)[0],Je(e,a)},t)}else Je(e,a)}function Ve(e){if(A(e)&&e.request.redirectCount===0)return Promise.resolve(r(e));let{request:t}=e,{protocol:i}=v(t);switch(i){case`about:`:return Promise.resolve(n(`about scheme is not supported`));case`blob:`:{Me||=L(`node:buffer`).resolveObjectURL;let e=v(t);if(e.search.length!==0)return Promise.resolve(n(`NetworkError when attempting to fetch resource.`));let r=Me(e.toString());if(t.method!==`GET`||!O(r))return Promise.resolve(n(`invalid method`));let i=a(),o=r.size,s=ee(`${o}`),c=r.type;if(t.headersList.contains(`range`,!0)){i.rangeRequested=!0;let e=ie(t.headersList.get(`range`,!0),!0);if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let{rangeStartValue:a,rangeEndValue:s}=e;if(a===null)a=o-s,s=a+s-1;else{if(a>=o)return Promise.resolve(n(`Range start is greater than the blob's size.`));(s===null||s>=o)&&(s=o-1)}let l=r.slice(a,s,c);i.body=I(l)[0];let u=ee(`${l.size}`),d=ae(a,s,o);i.status=206,i.statusText=`Partial Content`,i.headersList.set(`content-length`,u,!0),i.headersList.set(`content-type`,c,!0),i.headersList.set(`content-range`,d,!0)}else{let e=I(r);i.statusText=`OK`,i.body=e[0],i.headersList.set(`content-length`,s,!0),i.headersList.set(`content-type`,c,!0)}return Promise.resolve(i)}case`data:`:{let e=Te(v(t));if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let r=Ee(e.mimeType);return Promise.resolve(a({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:r}]],body:de(e.body)[0]}))}case`file:`:return Promise.resolve(n(`not implemented... yet...`));case`http:`:case`https:`:return Ye(e).catch(e=>n(e));default:return Promise.resolve(n(`unknown scheme`))}}function Ue(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function Je(e,t){let n=e.timingInfo,r=()=>{let r=Date.now();e.request.destination===`document`&&(e.controller.fullTimingInfo=n),e.controller.reportTimingSteps=()=>{if(e.request.url.protocol!==`https:`)return;n.endTime=r;let i=t.cacheState,a=t.bodyInfo;t.timingAllowPassed||(n=x(n),i=``);let o=0;if(e.request.mode!==`navigator`||!t.hasCrossOriginRedirects){o=t.status;let e=se(t.headersList);e!==`failure`&&(a.contentType=De(e))}e.request.initiatorType!=null&&Le(n,e.request.url.href,e.request.initiatorType,globalThis,i,a,o)};let i=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>i())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let i=t.type===`error`?t:t.internalResponse??t;i.body==null?r():be(i.body.stream,()=>{r()})}async function Ye(e){let t=e.request,r=null,i=null,a=e.timingInfo;if(t.serviceWorkers,r===null){if(t.redirect===`follow`&&(t.serviceWorkers=`none`),i=r=await Qe(e),t.responseTainting===`cors`&&C(t,r)===`failure`)return n(`cors failure`);h(t,r)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||r.type===`opaque`)&&w(t.origin,t.client,t.destination,i)===`blocked`?n(`blocked`):(fe.has(i.status)&&(t.redirect!==`manual`&&e.controller.connection.destroy(void 0,!1),t.redirect===`error`?r=n(`unexpected redirect`):t.redirect===`manual`?r=i:t.redirect===`follow`?r=await Xe(e,r):ue(!1)),r.timingInfo=a,r)}function Xe(e,t){let r=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=_(i,v(r).hash),a==null)return t}catch(e){return Promise.resolve(n(e))}if(!ne(a))return Promise.resolve(n(`URL scheme must be a HTTP(S) scheme`));if(r.redirectCount===20)return Promise.resolve(n(`redirect count exceeded`));if(r.redirectCount+=1,r.mode===`cors`&&(a.username||a.password)&&!k(r,a))return Promise.resolve(n(`cross origin not allowed for request mode "cors"`));if(r.responseTainting===`cors`&&(a.username||a.password))return Promise.resolve(n(`URL cannot contain credentials for request mode "cors"`));if(i.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(n());if([301,302].includes(i.status)&&r.method===`POST`||i.status===303&&!Ae.includes(r.method)){r.method=`GET`,r.body=null;for(let e of he)r.headersList.delete(e)}k(v(r),a)||(r.headersList.delete(`authorization`,!0),r.headersList.delete(`proxy-authorization`,!0),r.headersList.delete(`cookie`,!0),r.headersList.delete(`host`,!0)),r.body!=null&&(ue(r.body.source!=null),r.body=de(r.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=E(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),r.urlList.push(a),y(r,i),Be(e,!0)}async function Qe(e,t=!1,i=!1){let a=e.request,o=null,s=null,c=null;a.window===`no-window`&&a.redirect===`error`?(o=e,s=a):(s=l(a),o={...e},o.request=s);let u=a.credentials===`include`||a.credentials===`same-origin`&&a.responseTainting===`basic`,d=s.body?s.body.length:null,f=null;if(s.body==null&&[`POST`,`PUT`].includes(s.method)&&(f=`0`),d!=null&&(f=ee(`${d}`)),f!=null&&s.headersList.append(`content-length`,f,!0),d!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append(`referer`,ee(s.referrer.href),!0),g(s),S(s),s.headersList.contains(`user-agent`,!0)||s.headersList.append(`user-agent`,je),s.cache===`default`&&(s.headersList.contains(`if-modified-since`,!0)||s.headersList.contains(`if-none-match`,!0)||s.headersList.contains(`if-unmodified-since`,!0)||s.headersList.contains(`if-match`,!0)||s.headersList.contains(`if-range`,!0))&&(s.cache=`no-store`),s.cache===`no-cache`&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains(`cache-control`,!0)&&s.headersList.append(`cache-control`,`max-age=0`,!0),(s.cache===`no-store`||s.cache===`reload`)&&(s.headersList.contains(`pragma`,!0)||s.headersList.append(`pragma`,`no-cache`,!0),s.headersList.contains(`cache-control`,!0)||s.headersList.append(`cache-control`,`no-cache`,!0)),s.headersList.contains(`range`,!0)&&s.headersList.append(`accept-encoding`,`identity`,!0),s.headersList.contains(`accept-encoding`,!0)||(F(v(s))?s.headersList.append(`accept-encoding`,`br, gzip, deflate`,!0):s.headersList.append(`accept-encoding`,`gzip, deflate`,!0)),s.headersList.delete(`host`,!0),s.cache=`no-store`,s.cache!==`no-store`&&s.cache,c==null){if(s.cache===`only-if-cached`)return n(`only if cached`);let e=await $e(o,u,i);!me.has(s.method)&&e.status>=200&&e.status,c??=e}if(c.urlList=[...s.urlList],s.headersList.contains(`range`,!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=u,c.status===407)return a.window===`no-window`?n():A(e)?r(e):n(`proxy authentication required`);if(c.status===421&&!i&&(a.body==null||a.body.source!=null)){if(A(e))return r(e);e.controller.connection.destroy(),c=await Qe(e,t,!0)}return c}async function $e(e,t=!1,i=!1){ue(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e,t=!0){this.destroyed||(this.destroyed=!0,t&&this.abort?.(e??new DOMException(`The operation was aborted.`,`AbortError`)))}};let o=e.request,c=null,l=e.timingInfo;o.cache=`no-store`,o.mode;let d=null;if(o.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(o.body!=null){let t=async function*(t){A(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},n=()=>{A(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{A(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};d=(async function*(){try{for await(let e of o.body.stream)yield*t(e);n()}catch(e){r(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:o}=await g({body:d});if(o)c=a({status:n,statusText:r,headersList:i,socket:o});else{let o=t[Symbol.asyncIterator]();e.controller.next=()=>o.next(),c=a({status:n,statusText:r,headersList:i})}}catch(t){return t.name===`AbortError`?(e.controller.connection.destroy(),r(e,t)):n(t)}let f=async()=>{await e.controller.resume()},p=t=>{A(e)||e.controller.abort(t)},m=new ReadableStream({async start(t){e.controller.controller=t},async pull(e){await f(e)},async cancel(e){await p(e)},type:`bytes`});c.body={stream:m,source:null,length:null},e.controller.onAborted=h,e.controller.on(`terminated`,h),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(j(e))break;t=n?void 0:r}catch(r){e.controller.ended&&!l.encodedBodySize?t=void 0:(t=r,n=!0)}if(t===void 0){P(e.controller.controller),Ue(e,c);return}if(l.decodedBodySize+=t?.byteLength??0,n){e.controller.terminate(t);return}let r=new Uint8Array(t);if(r.byteLength&&e.controller.controller.enqueue(r),Se(m)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function h(t){j(e)?(c.aborted=!0,Ce(m)&&e.controller.controller.error(e.controller.serializedAbortReason)):Ce(m)&&e.controller.controller.error(TypeError(`terminated`,{cause:M(t)?t:void 0})),e.controller.connection.destroy()}return c;function g({body:t}){let n=v(o),r=e.controller.dispatcher;return new Promise((i,a)=>r.dispatch({path:n.pathname+n.search,origin:n.origin,method:o.method,body:r.isMockActive?o.body&&(o.body.source||o.body.stream):t,headers:o.headersList.entries,maxRedirections:0,upgrade:o.mode===`websocket`?`websocket`:void 0},{body:null,abort:null,onConnect(t){let{connection:n}=e.controller;l.finalConnectionTimingInfo=re(void 0,l.postRedirectStartTime,e.crossOriginIsolatedCapability),n.destroyed?t(new DOMException(`The operation was aborted.`,`AbortError`)):(e.controller.on(`terminated`,t),this.abort=n.abort=t),l.finalNetworkRequestStartTime=E(e.crossOriginIsolatedCapability)},onResponseStarted(){l.finalNetworkResponseStartTime=E(e.crossOriginIsolatedCapability)},onHeaders(e,t,n,r){if(e<200)return;let c=``,l=new s;for(let e=0;e5)return a(Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`)),!0;for(let e=t.length-1;e>=0;--e){let n=t[e].trim();if(n===`x-gzip`||n===`gzip`)d.push(u.createGunzip({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(n===`deflate`)d.push(oe({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(n===`br`)d.push(u.createBrotliDecompress({flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH}));else{d.length=0;break}}}let p=this.onError.bind(this);return i({status:e,statusText:r,headersList:l,body:d.length?ye(this.body,...d,e=>{e&&this.onError(e)}).on(`error`,p):this.body.on(`error`,p)}),!0},onData(t){if(e.controller.dump)return;let n=t;return l.encodedBodySize+=n.byteLength,this.body.push(n)},onComplete(){this.abort&&e.controller.off(`terminated`,this.abort),e.controller.onAborted&&e.controller.off(`terminated`,e.controller.onAborted),e.controller.ended=!0,this.body.push(null)},onError(t){this.abort&&e.controller.off(`terminated`,this.abort),this.body?.destroy(t),e.controller.terminate(t),a(t)},onUpgrade(e,t,n){if(e!==101)return;let r=new s;for(let e=0;e{t.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`)}})),Ut=I(((e,t)=>{let{webidl:n}=Ge(),r=Symbol(`ProgressEvent state`);var i=class e extends Event{constructor(e,t={}){e=n.converters.DOMString(e,`ProgressEvent constructor`,`type`),t=n.converters.ProgressEventInit(t??{}),super(e,t),this[r]={lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}get lengthComputable(){return n.brandCheck(this,e),this[r].lengthComputable}get loaded(){return n.brandCheck(this,e),this[r].loaded}get total(){return n.brandCheck(this,e),this[r].total}};n.converters.ProgressEventInit=n.dictionaryConverter([{key:`lengthComputable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`loaded`,converter:n.converters[`unsigned long long`],defaultValue:()=>0},{key:`total`,converter:n.converters[`unsigned long long`],defaultValue:()=>0},{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}]),t.exports={ProgressEvent:i}})),Wt=I(((e,t)=>{function n(e){if(!e)return`failure`;switch(e.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`}}t.exports={getEncoding:n}})),Gt=I(((e,t)=>{let{kState:n,kError:r,kResult:i,kAborted:a,kLastProgressEventFired:o}=Ht(),{ProgressEvent:s}=Ut(),{getEncoding:c}=Wt(),{serializeAMimeType:l,parseMIMEType:u}=We(),{types:d}=L(`node:util`),{StringDecoder:f}=L(`string_decoder`),{btoa:p}=L(`node:buffer`),m={enumerable:!0,writable:!1,configurable:!1};function h(e,t,s,c){if(e[n]===`loading`)throw new DOMException(`Invalid state`,`InvalidStateError`);e[n]=`loading`,e[i]=null,e[r]=null;let l=t.stream().getReader(),u=[],f=l.read(),p=!0;(async()=>{for(;!e[a];)try{let{done:m,value:h}=await f;if(p&&!e[a]&&queueMicrotask(()=>{g(`loadstart`,e)}),p=!1,!m&&d.isUint8Array(h))u.push(h),(e[o]===void 0||Date.now()-e[o]>=50)&&!e[a]&&(e[o]=Date.now(),queueMicrotask(()=>{g(`progress`,e)})),f=l.read();else if(m){queueMicrotask(()=>{e[n]=`done`;try{let n=_(u,s,t.type,c);if(e[a])return;e[i]=n,g(`load`,e)}catch(t){e[r]=t,g(`error`,e)}e[n]!==`loading`&&g(`loadend`,e)});break}}catch(t){if(e[a])return;queueMicrotask(()=>{e[n]=`done`,e[r]=t,g(`error`,e),e[n]!==`loading`&&g(`loadend`,e)});break}})()}function g(e,t){let n=new s(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function _(e,t,n,r){switch(t){case`DataURL`:{let t=`data:`,r=u(n||`application/octet-stream`);r!==`failure`&&(t+=l(r)),t+=`;base64,`;let i=new f(`latin1`);for(let n of e)t+=p(i.write(n));return t+=p(i.end()),t}case`Text`:{let t=`failure`;if(r&&(t=c(r)),t===`failure`&&n){let e=u(n);e!==`failure`&&(t=c(e.parameters.get(`charset`)))}return t===`failure`&&(t=`UTF-8`),v(e,t)}case`ArrayBuffer`:return b(e).buffer;case`BinaryString`:{let t=``,n=new f(`latin1`);for(let r of e)t+=n.write(r);return t+=n.end(),t}}}function v(e,t){let n=b(e),r=y(n),i=0;r!==null&&(t=r,i=r===`UTF-8`?3:2);let a=n.slice(i);return new TextDecoder(t).decode(a)}function y(e){let[t,n,r]=e;return t===239&&n===187&&r===191?`UTF-8`:t===254&&n===255?`UTF-16BE`:t===255&&n===254?`UTF-16LE`:null}function b(e){let t=e.reduce((e,t)=>e+t.byteLength,0),n=0;return e.reduce((e,t)=>(e.set(t,n),n+=t.byteLength,e),new Uint8Array(t))}t.exports={staticPropertyDescriptors:m,readOperation:h,fireAProgressEvent:g}})),Kt=I(((e,t)=>{let{staticPropertyDescriptors:n,readOperation:r,fireAProgressEvent:i}=Gt(),{kState:a,kError:o,kResult:s,kEvents:c,kAborted:l}=Ht(),{webidl:u}=Ge(),{kEnumerableProperty:d}=z();var f=class e extends EventTarget{constructor(){super(),this[a]=`empty`,this[s]=null,this[o]=null,this[c]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsArrayBuffer`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`ArrayBuffer`)}readAsBinaryString(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsBinaryString`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`BinaryString`)}readAsText(t,n=void 0){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsText`),t=u.converters.Blob(t,{strict:!1}),n!==void 0&&(n=u.converters.DOMString(n,`FileReader.readAsText`,`encoding`)),r(this,t,`Text`,n)}readAsDataURL(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsDataURL`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`DataURL`)}abort(){if(this[a]===`empty`||this[a]===`done`){this[s]=null;return}this[a]===`loading`&&(this[a]=`done`,this[s]=null),this[l]=!0,i(`abort`,this),this[a]!==`loading`&&i(`loadend`,this)}get readyState(){switch(u.brandCheck(this,e),this[a]){case`empty`:return this.EMPTY;case`loading`:return this.LOADING;case`done`:return this.DONE}}get result(){return u.brandCheck(this,e),this[s]}get error(){return u.brandCheck(this,e),this[o]}get onloadend(){return u.brandCheck(this,e),this[c].loadend}set onloadend(t){u.brandCheck(this,e),this[c].loadend&&this.removeEventListener(`loadend`,this[c].loadend),typeof t==`function`?(this[c].loadend=t,this.addEventListener(`loadend`,t)):this[c].loadend=null}get onerror(){return u.brandCheck(this,e),this[c].error}set onerror(t){u.brandCheck(this,e),this[c].error&&this.removeEventListener(`error`,this[c].error),typeof t==`function`?(this[c].error=t,this.addEventListener(`error`,t)):this[c].error=null}get onloadstart(){return u.brandCheck(this,e),this[c].loadstart}set onloadstart(t){u.brandCheck(this,e),this[c].loadstart&&this.removeEventListener(`loadstart`,this[c].loadstart),typeof t==`function`?(this[c].loadstart=t,this.addEventListener(`loadstart`,t)):this[c].loadstart=null}get onprogress(){return u.brandCheck(this,e),this[c].progress}set onprogress(t){u.brandCheck(this,e),this[c].progress&&this.removeEventListener(`progress`,this[c].progress),typeof t==`function`?(this[c].progress=t,this.addEventListener(`progress`,t)):this[c].progress=null}get onload(){return u.brandCheck(this,e),this[c].load}set onload(t){u.brandCheck(this,e),this[c].load&&this.removeEventListener(`load`,this[c].load),typeof t==`function`?(this[c].load=t,this.addEventListener(`load`,t)):this[c].load=null}get onabort(){return u.brandCheck(this,e),this[c].abort}set onabort(t){u.brandCheck(this,e),this[c].abort&&this.removeEventListener(`abort`,this[c].abort),typeof t==`function`?(this[c].abort=t,this.addEventListener(`abort`,t)):this[c].abort=null}};f.EMPTY=f.prototype.EMPTY=0,f.LOADING=f.prototype.LOADING=1,f.DONE=f.prototype.DONE=2,Object.defineProperties(f.prototype,{EMPTY:n,LOADING:n,DONE:n,readAsArrayBuffer:d,readAsBinaryString:d,readAsText:d,readAsDataURL:d,abort:d,readyState:d,result:d,error:d,onloadstart:d,onprogress:d,onload:d,onabort:d,onerror:d,onloadend:d,[Symbol.toStringTag]:{value:`FileReader`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(f,{EMPTY:n,LOADING:n,DONE:n}),t.exports={FileReader:f}})),qt=I(((e,t)=>{t.exports={kConstruct:ke().kConstruct}})),Jt=I(((e,t)=>{let n=L(`node:assert`),{URLSerializer:r}=We(),{isValidHeaderName:i}=Ke();function a(e,t,n=!1){return r(e,n)===r(t,n)}function o(e){n(e!==null);let t=[];for(let n of e.split(`,`))n=n.trim(),i(n)&&t.push(n);return t}t.exports={urlEquals:a,getFieldValues:o}})),Yt=I(((e,t)=>{let{kConstruct:n}=qt(),{urlEquals:r,getFieldValues:i}=Jt(),{kEnumerableProperty:a,isDisturbed:o}=z(),{webidl:s}=Ge(),{Response:c,cloneResponse:l,fromInnerResponse:u}=Rt(),{Request:d,fromInnerRequest:f}=Bt(),{kState:p}=qe(),{fetching:m}=Vt(),{urlIsHttpHttpsScheme:h,createDeferredPromise:g,readAllBytes:_}=Ke(),v=L(`node:assert`);var y=class e{#e;constructor(){arguments[0]!==n&&s.illegalConstructor(),s.util.markAsUncloneable(this),this.#e=arguments[1]}async match(t,n={}){s.brandCheck(this,e);let r=`Cache.match`;s.argumentLengthCheck(arguments,1,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.CacheQueryOptions(n,r,`options`);let i=this.#i(t,n,1);if(i.length!==0)return i[0]}async matchAll(t=void 0,n={}){s.brandCheck(this,e);let r=`Cache.matchAll`;return t!==void 0&&(t=s.converters.RequestInfo(t,r,`request`)),n=s.converters.CacheQueryOptions(n,r,`options`),this.#i(t,n)}async add(t){s.brandCheck(this,e);let n=`Cache.add`;s.argumentLengthCheck(arguments,1,n),t=s.converters.RequestInfo(t,n,`request`);let r=[t];return await this.addAll(r)}async addAll(t){s.brandCheck(this,e);let n=`Cache.addAll`;s.argumentLengthCheck(arguments,1,n);let r=[],a=[];for(let e of t){if(e===void 0)throw s.errors.conversionFailed({prefix:n,argument:`Argument 1`,types:[`undefined is not allowed`]});if(e=s.converters.RequestInfo(e),typeof e==`string`)continue;let t=e[p];if(!h(t.url)||t.method!==`GET`)throw s.errors.exception({header:n,message:`Expected http/s scheme when method is not GET.`})}let o=[];for(let e of t){let t=new d(e)[p];if(!h(t.url))throw s.errors.exception({header:n,message:`Expected http/s scheme.`});t.initiator=`fetch`,t.destination=`subresource`,a.push(t);let c=g();o.push(m({request:t,processResponse(e){if(e.type===`error`||e.status===206||e.status<200||e.status>299)c.reject(s.errors.exception({header:`Cache.addAll`,message:`Received an invalid status code or the request failed.`}));else if(e.headersList.contains(`vary`)){let t=i(e.headersList.get(`vary`));for(let e of t)if(e===`*`){c.reject(s.errors.exception({header:`Cache.addAll`,message:`invalid vary field value`}));for(let e of o)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){c.reject(new DOMException(`aborted`,`AbortError`));return}c.resolve(e)}})),r.push(c.promise)}let c=await Promise.all(r),l=[],u=0;for(let e of c){let t={type:`put`,request:a[u],response:e};l.push(t),u++}let f=g(),_=null;try{this.#t(l)}catch(e){_=e}return queueMicrotask(()=>{_===null?f.resolve(void 0):f.reject(_)}),f.promise}async put(t,n){s.brandCheck(this,e);let r=`Cache.put`;s.argumentLengthCheck(arguments,2,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.Response(n,r,`response`);let a=null;if(a=t instanceof d?t[p]:new d(t)[p],!h(a.url)||a.method!==`GET`)throw s.errors.exception({header:r,message:`Expected an http/s scheme when method is not GET`});let c=n[p];if(c.status===206)throw s.errors.exception({header:r,message:`Got 206 status`});if(c.headersList.contains(`vary`)){let e=i(c.headersList.get(`vary`));for(let t of e)if(t===`*`)throw s.errors.exception({header:r,message:`Got * vary field value`})}if(c.body&&(o(c.body.stream)||c.body.stream.locked))throw s.errors.exception({header:r,message:`Response body is locked or disturbed`});let u=l(c),f=g();c.body==null?f.resolve(void 0):_(c.body.stream.getReader()).then(f.resolve,f.reject);let m=[],v={type:`put`,request:a,response:u};m.push(v);let y=await f.promise;u.body!=null&&(u.body.source=y);let b=g(),x=null;try{this.#t(m)}catch(e){x=e}return queueMicrotask(()=>{x===null?b.resolve():b.reject(x)}),b.promise}async delete(t,n={}){s.brandCheck(this,e);let r=`Cache.delete`;s.argumentLengthCheck(arguments,1,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.CacheQueryOptions(n,r,`options`);let i=null;if(t instanceof d){if(i=t[p],i.method!==`GET`&&!n.ignoreMethod)return!1}else v(typeof t==`string`),i=new d(t)[p];let a=[],o={type:`delete`,request:i,options:n};a.push(o);let c=g(),l=null,u;try{u=this.#t(a)}catch(e){l=e}return queueMicrotask(()=>{l===null?c.resolve(!!u?.length):c.reject(l)}),c.promise}async keys(t=void 0,n={}){s.brandCheck(this,e);let r=`Cache.keys`;t!==void 0&&(t=s.converters.RequestInfo(t,r,`request`)),n=s.converters.CacheQueryOptions(n,r,`options`);let i=null;if(t!==void 0)if(t instanceof d){if(i=t[p],i.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(i=new d(t)[p]);let a=g(),o=[];if(t===void 0)for(let e of this.#e)o.push(e[0]);else{let e=this.#n(i,n);for(let t of e)o.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of o){let n=f(t,new AbortController().signal,`immutable`);e.push(n)}a.resolve(Object.freeze(e))}),a.promise}#t(e){let t=this.#e,n=[...t],r=[],i=[];try{for(let n of e){if(n.type!==`delete`&&n.type!==`put`)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`operation type does not match "delete" or "put"`});if(n.type===`delete`&&n.response!=null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`delete operation should not have an associated response`});if(this.#n(n.request,n.options,r).length)throw new DOMException(`???`,`InvalidStateError`);let e;if(n.type===`delete`){if(e=this.#n(n.request,n.options),e.length===0)return[];for(let n of e){let e=t.indexOf(n);v(e!==-1),t.splice(e,1)}}else if(n.type===`put`){if(n.response==null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`put operation should have an associated response`});let i=n.request;if(!h(i.url))throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`expected http or https scheme`});if(i.method!==`GET`)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`not get method`});if(n.options!=null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`options must not be defined`});e=this.#n(n.request);for(let n of e){let e=t.indexOf(n);v(e!==-1),t.splice(e,1)}t.push([n.request,n.response]),r.push([n.request,n.response])}i.push([n.request,n.response])}return i}catch(e){throw this.#e.length=0,this.#e=n,e}}#n(e,t,n){let r=[],i=n??this.#e;for(let n of i){let[i,a]=n;this.#r(e,i,a,t)&&r.push(n)}return r}#r(e,t,n=null,a){let o=new URL(e.url),s=new URL(t.url);if(a?.ignoreSearch&&(s.search=``,o.search=``),!r(o,s,!0))return!1;if(n==null||a?.ignoreVary||!n.headersList.contains(`vary`))return!0;let c=i(n.headersList.get(`vary`));for(let n of c)if(n===`*`||t.headersList.get(n)!==e.headersList.get(n))return!1;return!0}#i(e,t,n=1/0){let r=null;if(e!==void 0)if(e instanceof d){if(r=e[p],r.method!==`GET`&&!t.ignoreMethod)return[]}else typeof e==`string`&&(r=new d(e)[p]);let i=[];if(e===void 0)for(let e of this.#e)i.push(e[1]);else{let e=this.#n(r,t);for(let t of e)i.push(t[1])}let a=[];for(let e of i){let t=u(e,`immutable`);if(a.push(t.clone()),a.length>=n)break}return Object.freeze(a)}};Object.defineProperties(y.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:a,matchAll:a,add:a,addAll:a,put:a,delete:a,keys:a});let b=[{key:`ignoreSearch`,converter:s.converters.boolean,defaultValue:()=>!1},{key:`ignoreMethod`,converter:s.converters.boolean,defaultValue:()=>!1},{key:`ignoreVary`,converter:s.converters.boolean,defaultValue:()=>!1}];s.converters.CacheQueryOptions=s.dictionaryConverter(b),s.converters.MultiCacheQueryOptions=s.dictionaryConverter([...b,{key:`cacheName`,converter:s.converters.DOMString}]),s.converters.Response=s.interfaceConverter(c),s.converters[`sequence`]=s.sequenceConverter(s.converters.RequestInfo),t.exports={Cache:y}})),Xt=I(((e,t)=>{let{kConstruct:n}=qt(),{Cache:r}=Yt(),{webidl:i}=Ge(),{kEnumerableProperty:a}=z();var o=class e{#e=new Map;constructor(){arguments[0]!==n&&i.illegalConstructor(),i.util.markAsUncloneable(this)}async match(t,a={}){if(i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,`CacheStorage.match`),t=i.converters.RequestInfo(t),a=i.converters.MultiCacheQueryOptions(a),a.cacheName!=null){if(this.#e.has(a.cacheName))return await new r(n,this.#e.get(a.cacheName)).match(t,a)}else for(let e of this.#e.values()){let i=await new r(n,e).match(t,a);if(i!==void 0)return i}}async has(t){i.brandCheck(this,e);let n=`CacheStorage.has`;return i.argumentLengthCheck(arguments,1,n),t=i.converters.DOMString(t,n,`cacheName`),this.#e.has(t)}async open(t){i.brandCheck(this,e);let a=`CacheStorage.open`;if(i.argumentLengthCheck(arguments,1,a),t=i.converters.DOMString(t,a,`cacheName`),this.#e.has(t))return new r(n,this.#e.get(t));let o=[];return this.#e.set(t,o),new r(n,o)}async delete(t){i.brandCheck(this,e);let n=`CacheStorage.delete`;return i.argumentLengthCheck(arguments,1,n),t=i.converters.DOMString(t,n,`cacheName`),this.#e.delete(t)}async keys(){return i.brandCheck(this,e),[...this.#e.keys()]}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`CacheStorage`,configurable:!0},match:a,has:a,open:a,delete:a,keys:a}),t.exports={CacheStorage:o}})),Zt=I(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),Qt=I(((e,t)=>{function n(e){for(let t=0;t=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function r(e){for(let t=0;t126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw Error(`Invalid cookie name`)}}function i(e){let t=e.length,n=0;if(e[0]===`"`){if(t===1||e[t-1]!==`"`)throw Error(`Invalid cookie value`);--t,++n}for(;n126||t===34||t===44||t===59||t===92)throw Error(`Invalid cookie value`)}}function a(e){for(let t=0;tt.toString().padStart(2,`0`));function u(e){return typeof e==`number`&&(e=new Date(e)),`${s[e.getUTCDay()]}, ${l[e.getUTCDate()]} ${c[e.getUTCMonth()]} ${e.getUTCFullYear()} ${l[e.getUTCHours()]}:${l[e.getUTCMinutes()]}:${l[e.getUTCSeconds()]} GMT`}function d(e){if(e<0)throw Error(`Invalid cookie max-age`)}function f(e){if(e.name.length===0)return null;r(e.name),i(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith(`__Secure-`)&&(e.secure=!0),e.name.startsWith(`__Host-`)&&(e.secure=!0,e.domain=null,e.path=`/`),e.secure&&t.push(`Secure`),e.httpOnly&&t.push(`HttpOnly`),typeof e.maxAge==`number`&&(d(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(o(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(a(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!==`Invalid Date`&&t.push(`Expires=${u(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let n of e.unparsed){if(!n.includes(`=`))throw Error(`Invalid unparsed`);let[e,...r]=n.split(`=`);t.push(`${e.trim()}=${r.join(`=`)}`)}return t.join(`; `)}t.exports={isCTLExcludingHtab:n,validateCookieName:r,validateCookiePath:a,validateCookieValue:i,toIMFDate:u,stringify:f}})),$t=I(((e,t)=>{let{maxNameValuePairSize:n,maxAttributeValueSize:r}=Zt(),{isCTLExcludingHtab:i}=Qt(),{collectASequenceOfCodePointsFast:a}=We(),o=L(`node:assert`);function s(e){if(i(e))return null;let t=``,r=``,o=``,s=``;if(e.includes(`;`)){let n={position:0};t=a(`;`,e,n),r=e.slice(n.position)}else t=e;if(!t.includes(`=`))s=t;else{let e={position:0};o=a(`=`,t,e),s=t.slice(e.position+1)}return o=o.trim(),s=s.trim(),o.length+s.length>n?null:{name:o,value:s,...c(r)}}function c(e,t={}){if(e.length===0)return t;o(e[0]===`;`),e=e.slice(1);let n=``;e.includes(`;`)?(n=a(`;`,e,{position:0}),e=e.slice(n.length)):(n=e,e=``);let i=``,s=``;if(n.includes(`=`)){let e={position:0};i=a(`=`,n,e),s=n.slice(e.position+1)}else i=n;if(i=i.trim(),s=s.trim(),s.length>r)return c(e,t);let l=i.toLowerCase();if(l===`expires`)t.expires=new Date(s);else if(l===`max-age`){let n=s.charCodeAt(0);if((n<48||n>57)&&s[0]!==`-`||!/^\d+$/.test(s))return c(e,t);t.maxAge=Number(s)}else if(l===`domain`){let e=s;e[0]===`.`&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if(l===`path`){let e=``;e=s.length===0||s[0]!==`/`?`/`:s,t.path=e}else if(l===`secure`)t.secure=!0;else if(l===`httponly`)t.httpOnly=!0;else if(l===`samesite`){let e=`Default`,n=s.toLowerCase();n.includes(`none`)&&(e=`None`),n.includes(`strict`)&&(e=`Strict`),n.includes(`lax`)&&(e=`Lax`),t.sameSite=e}else t.unparsed??=[],t.unparsed.push(`${i}=${s}`);return c(e,t)}t.exports={parseSetCookie:s,parseUnparsedAttributes:c}})),en=I(((e,t)=>{let{parseSetCookie:n}=$t(),{stringify:r}=Qt(),{webidl:i}=Ge(),{Headers:a}=Lt();function o(e){i.argumentLengthCheck(arguments,1,`getCookies`),i.brandCheck(e,a,{strict:!1});let t=e.get(`cookie`),n={};if(!t)return n;for(let e of t.split(`;`)){let[t,...r]=e.split(`=`);n[t.trim()]=r.join(`=`)}return n}function s(e,t,n){i.brandCheck(e,a,{strict:!1});let r=`deleteCookie`;i.argumentLengthCheck(arguments,2,r),t=i.converters.DOMString(t,r,`name`),n=i.converters.DeleteCookieAttributes(n),l(e,{name:t,value:``,expires:new Date(0),...n})}function c(e){i.argumentLengthCheck(arguments,1,`getSetCookies`),i.brandCheck(e,a,{strict:!1});let t=e.getSetCookie();return t?t.map(e=>n(e)):[]}function l(e,t){i.argumentLengthCheck(arguments,2,`setCookie`),i.brandCheck(e,a,{strict:!1}),t=i.converters.Cookie(t);let n=r(t);n&&e.append(`Set-Cookie`,n)}i.converters.DeleteCookieAttributes=i.dictionaryConverter([{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null}]),i.converters.Cookie=i.dictionaryConverter([{converter:i.converters.DOMString,key:`name`},{converter:i.converters.DOMString,key:`value`},{converter:i.nullableConverter(e=>typeof e==`number`?i.converters[`unsigned long long`](e):new Date(e)),key:`expires`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters[`long long`]),key:`maxAge`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`secure`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`httpOnly`,defaultValue:()=>null},{converter:i.converters.USVString,key:`sameSite`,allowedValues:[`Strict`,`Lax`,`None`]},{converter:i.sequenceConverter(i.converters.DOMString),key:`unparsed`,defaultValue:()=>[]}]),t.exports={getCookies:o,deleteCookie:s,getSetCookies:c,setCookie:l}})),tn=I(((e,t)=>{let{webidl:n}=Ge(),{kEnumerableProperty:r}=z(),{kConstruct:i}=ke(),{MessagePort:a}=L(`node:worker_threads`);var o=class e extends Event{#e;constructor(e,t={}){if(e===i){super(arguments[1],arguments[2]),n.util.markAsUncloneable(this);return}let r=`MessageEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.MessageEventInit(t,r,`eventInitDict`),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get data(){return n.brandCheck(this,e),this.#e.data}get origin(){return n.brandCheck(this,e),this.#e.origin}get lastEventId(){return n.brandCheck(this,e),this.#e.lastEventId}get source(){return n.brandCheck(this,e),this.#e.source}get ports(){return n.brandCheck(this,e),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(t,r=!1,i=!1,a=null,o=``,s=``,c=null,l=[]){return n.brandCheck(this,e),n.argumentLengthCheck(arguments,1,`MessageEvent.initMessageEvent`),new e(t,{bubbles:r,cancelable:i,data:a,origin:o,lastEventId:s,source:c,ports:l})}static createFastMessageEvent(t,n){let r=new e(i,t,n);return r.#e=n,r.#e.data??=null,r.#e.origin??=``,r.#e.lastEventId??=``,r.#e.source??=null,r.#e.ports??=[],r}};let{createFastMessageEvent:s}=o;delete o.createFastMessageEvent;var c=class e extends Event{#e;constructor(e,t={}){let r=`CloseEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.CloseEventInit(t),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get wasClean(){return n.brandCheck(this,e),this.#e.wasClean}get code(){return n.brandCheck(this,e),this.#e.code}get reason(){return n.brandCheck(this,e),this.#e.reason}},l=class e extends Event{#e;constructor(e,t){let r=`ErrorEvent constructor`;n.argumentLengthCheck(arguments,1,r),super(e,t),n.util.markAsUncloneable(this),e=n.converters.DOMString(e,r,`type`),t=n.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return n.brandCheck(this,e),this.#e.message}get filename(){return n.brandCheck(this,e),this.#e.filename}get lineno(){return n.brandCheck(this,e),this.#e.lineno}get colno(){return n.brandCheck(this,e),this.#e.colno}get error(){return n.brandCheck(this,e),this.#e.error}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`MessageEvent`,configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(c.prototype,{[Symbol.toStringTag]:{value:`CloseEvent`,configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(l.prototype,{[Symbol.toStringTag]:{value:`ErrorEvent`,configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),n.converters.MessagePort=n.interfaceConverter(a),n.converters[`sequence`]=n.sequenceConverter(n.converters.MessagePort);let u=[{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}];n.converters.MessageEventInit=n.dictionaryConverter([...u,{key:`data`,converter:n.converters.any,defaultValue:()=>null},{key:`origin`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lastEventId`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`source`,converter:n.nullableConverter(n.converters.MessagePort),defaultValue:()=>null},{key:`ports`,converter:n.converters[`sequence`],defaultValue:()=>[]}]),n.converters.CloseEventInit=n.dictionaryConverter([...u,{key:`wasClean`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`code`,converter:n.converters[`unsigned short`],defaultValue:()=>0},{key:`reason`,converter:n.converters.USVString,defaultValue:()=>``}]),n.converters.ErrorEventInit=n.dictionaryConverter([...u,{key:`message`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`filename`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lineno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`colno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`error`,converter:n.converters.any}]),t.exports={MessageEvent:o,CloseEvent:c,ErrorEvent:l,createFastMessageEvent:s}})),nn=I(((e,t)=>{t.exports={uid:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,sentCloseFrameState:{NOT_SENT:0,PROCESSING:1,SENT:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:2**16-1,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:Buffer.allocUnsafe(0),sendHints:{string:1,typedArray:2,arrayBuffer:3,blob:4}}})),rn=I(((e,t)=>{t.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`)}})),an=I(((e,t)=>{let{kReadyState:n,kController:r,kResponse:i,kBinaryType:a,kWebSocketURL:o}=rn(),{states:s,opcodes:c}=nn(),{ErrorEvent:l,createFastMessageEvent:u}=tn(),{isUtf8:d}=L(`node:buffer`),{collectASequenceOfCodePointsFast:f,removeHTTPWhitespace:p}=We();function m(e){return e[n]===s.CONNECTING}function h(e){return e[n]===s.OPEN}function g(e){return e[n]===s.CLOSING}function _(e){return e[n]===s.CLOSED}function v(e,t,n=(e,t)=>new Event(e,t),r={}){let i=n(e,r);t.dispatchEvent(i)}function y(e,t,r){if(e[n]!==s.OPEN)return;let i;if(t===c.TEXT)try{i=M(r)}catch{C(e,`Received invalid UTF-8 in text frame.`);return}else t===c.BINARY&&(i=e[a]===`blob`?new Blob([r]):b(r));v(`message`,e,u,{origin:e[o].origin,data:i})}function b(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function x(e){if(e.length===0)return!1;for(let t=0;t126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function S(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function C(e,t){let{[r]:n,[i]:a}=e;n.abort(),a?.socket&&!a.socket.destroyed&&a.socket.destroy(),t&&v(`error`,e,(e,t)=>new l(e,t),{error:Error(t),message:t})}function w(e){return e===c.CLOSE||e===c.PING||e===c.PONG}function T(e){return e===c.CONTINUATION}function E(e){return e===c.TEXT||e===c.BINARY}function D(e){return E(e)||T(e)||w(e)}function O(e){let t={position:0},n=new Map;for(;t.position57)return!1}let t=Number.parseInt(e,10);return t>=8&&t<=15}let A=typeof process.versions.icu==`string`,j=A?new TextDecoder(`utf-8`,{fatal:!0}):void 0,M=A?j.decode.bind(j):function(e){if(d(e))return e.toString(`utf-8`);throw TypeError(`Invalid utf-8 received.`)};t.exports={isConnecting:m,isEstablished:h,isClosing:g,isClosed:_,fireEvent:v,isValidSubprotocol:x,isValidStatusCode:S,failWebsocketConnection:C,websocketMessageReceived:y,utf8Decode:M,isControlFrame:w,isContinuationFrame:T,isTextBinaryFrame:E,isValidOpcode:D,parseExtensions:O,isValidClientWindowBits:k}})),on=I(((e,t)=>{let{maxUnsigned16Bit:n}=nn(),r=16386,i,a=null,o=r;try{i=L(`node:crypto`)}catch{i={randomFillSync:function(e,t,n){for(let t=0;tn?(o+=8,a=127):i>125&&(o+=2,a=126);let c=Buffer.allocUnsafe(i+o);c[0]=c[1]=0,c[0]|=128,c[0]=(c[0]&240)+e,c[o-4]=r[0],c[o-3]=r[1],c[o-2]=r[2],c[o-1]=r[3],c[1]=a,a===126?c.writeUInt16BE(i,2):a===127&&(c[2]=c[3]=0,c.writeUIntBE(i,4,6)),c[1]|=128;for(let e=0;e{let{uid:n,states:r,sentCloseFrameState:i,emptyBuffer:a,opcodes:o}=nn(),{kReadyState:s,kSentClose:c,kByteParser:l,kReceivedClose:u,kResponse:d}=rn(),{fireEvent:f,failWebsocketConnection:p,isClosing:m,isClosed:h,isEstablished:g,parseExtensions:_}=an(),{channels:v}=Me(),{CloseEvent:y}=tn(),{makeRequest:b}=Bt(),{fetching:x}=Vt(),{Headers:S,getHeadersList:C}=Lt(),{getDecodeSplit:w}=Ke(),{WebsocketFrameSend:T}=on(),E;try{E=L(`node:crypto`)}catch{}function D(e,t,r,i,a,o){let s=e;s.protocol=e.protocol===`ws:`?`http:`:`https:`;let c=b({urlList:[s],client:r,serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`});o.headers&&(c.headersList=C(new S(o.headers)));let l=E.randomBytes(16).toString(`base64`);c.headersList.append(`sec-websocket-key`,l),c.headersList.append(`sec-websocket-version`,`13`);for(let e of t)c.headersList.append(`sec-websocket-protocol`,e);return c.headersList.append(`sec-websocket-extensions`,`permessage-deflate; client_max_window_bits`),x({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(e){if(e.type===`error`||e.status!==101){p(i,`Received network error or non-101 status code.`);return}if(t.length!==0&&!e.headersList.get(`Sec-WebSocket-Protocol`)){p(i,`Server did not respond with sent protocols.`);return}if(e.headersList.get(`Upgrade`)?.toLowerCase()!==`websocket`){p(i,`Server did not set Upgrade header to "websocket".`);return}if(e.headersList.get(`Connection`)?.toLowerCase()!==`upgrade`){p(i,`Server did not set Connection header to "upgrade".`);return}if(e.headersList.get(`Sec-WebSocket-Accept`)!==E.createHash(`sha1`).update(l+n).digest(`base64`)){p(i,`Incorrect hash received in Sec-WebSocket-Accept header.`);return}let r=e.headersList.get(`Sec-WebSocket-Extensions`),o;if(r!==null&&(o=_(r),!o.has(`permessage-deflate`))){p(i,`Sec-WebSocket-Extensions header does not match.`);return}let s=e.headersList.get(`Sec-WebSocket-Protocol`);if(s!==null&&!w(`sec-websocket-protocol`,c.headersList).includes(s)){p(i,`Protocol was not set in the opening handshake.`);return}e.socket.on(`data`,k),e.socket.on(`close`,A),e.socket.on(`error`,j),v.open.hasSubscribers&&v.open.publish({address:e.socket.address(),protocol:s,extensions:r}),a(e,o)}})}function O(e,t,n,l){if(!(m(e)||h(e)))if(!g(e))p(e,`Connection was closed before it was established.`),e[s]=r.CLOSING;else if(e[c]===i.NOT_SENT){e[c]=i.PROCESSING;let u=new T;t!==void 0&&n===void 0?(u.frameData=Buffer.allocUnsafe(2),u.frameData.writeUInt16BE(t,0)):t!==void 0&&n!==void 0?(u.frameData=Buffer.allocUnsafe(2+l),u.frameData.writeUInt16BE(t,0),u.frameData.write(n,2,`utf-8`)):u.frameData=a,e[d].socket.write(u.createFrame(o.CLOSE)),e[c]=i.SENT,e[s]=r.CLOSING}else e[s]=r.CLOSING}function k(e){this.ws[l].write(e)||this.pause()}function A(){let{ws:e}=this,{[d]:t}=e;t.socket.off(`data`,k),t.socket.off(`close`,A),t.socket.off(`error`,j);let n=e[c]===i.SENT&&e[u],a=1005,o=``,p=e[l].closingInfo;p&&!p.error?(a=p.code??1005,o=p.reason):e[u]||(a=1006),e[s]=r.CLOSED,f(`close`,e,(e,t)=>new y(e,t),{wasClean:n,code:a,reason:o}),v.close.hasSubscribers&&v.close.publish({websocket:e,code:a,reason:o})}function j(e){let{ws:t}=this;t[s]=r.CLOSING,v.socketError.hasSubscribers&&v.socketError.publish(e),this.destroy()}t.exports={establishWebSocketConnection:D,closeWebSocketConnection:O}})),cn=I(((e,t)=>{let{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:r}=L(`node:zlib`),{isValidClientWindowBits:i}=an(),{MessageSizeExceededError:a}=R(),o=Buffer.from([0,0,255,255]),s=Symbol(`kBuffer`),c=Symbol(`kLength`);t.exports={PerMessageDeflate:class{#e;#t={};#n=!1;#r=null;constructor(e){this.#t.serverNoContextTakeover=e.has(`server_no_context_takeover`),this.#t.serverMaxWindowBits=e.get(`server_max_window_bits`)}decompress(e,t,l){if(this.#n){l(new a);return}if(!this.#e){let e=r;if(this.#t.serverMaxWindowBits){if(!i(this.#t.serverMaxWindowBits)){l(Error(`Invalid server_max_window_bits`));return}e=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=n({windowBits:e})}catch(e){l(e);return}this.#e[s]=[],this.#e[c]=0,this.#e.on(`data`,e=>{if(!this.#n){if(this.#e[c]+=e.length,this.#e[c]>4194304){if(this.#n=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#r){let e=this.#r;this.#r=null,e(new a)}return}this.#e[s].push(e)}}),this.#e.on(`error`,e=>{this.#e=null,l(e)})}this.#r=l,this.#e.write(e),t&&this.#e.write(o),this.#e.flush(()=>{if(this.#n||!this.#e)return;let e=Buffer.concat(this.#e[s],this.#e[c]);this.#e[s].length=0,this.#e[c]=0,this.#r=null,l(null,e)})}}}})),ln=I(((e,t)=>{let{Writable:n}=L(`node:stream`),r=L(`node:assert`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s,sentCloseFrameState:c}=nn(),{kReadyState:l,kSentClose:u,kResponse:d,kReceivedClose:f}=rn(),{channels:p}=Me(),{isValidStatusCode:m,isValidOpcode:h,failWebsocketConnection:g,websocketMessageReceived:_,utf8Decode:v,isControlFrame:y,isTextBinaryFrame:b,isContinuationFrame:x}=an(),{WebsocketFrameSend:S}=on(),{closeWebSocketConnection:C}=sn(),{PerMessageDeflate:w}=cn();t.exports={ByteParser:class extends n{#e=[];#t=0;#n=!1;#r=i.INFO;#i={};#a=[];#o;constructor(e,t){super(),this.ws=e,this.#o=t??new Map,this.#o.has(`permessage-deflate`)&&this.#o.set(`permessage-deflate`,new w(t))}_write(e,t,n){this.#e.push(e),this.#t+=e.length,this.#n=!0,this.run(n)}run(e){for(;this.#n;)if(this.#r===i.INFO){if(this.#t<2)return e();let t=this.consume(2),n=(t[0]&128)!=0,r=t[0]&15,o=(t[1]&128)==128,s=!n&&r!==a.CONTINUATION,c=t[1]&127,l=t[0]&64,u=t[0]&32,d=t[0]&16;if(!h(r))return g(this.ws,`Invalid opcode received`),e();if(o)return g(this.ws,`Frame cannot be masked`),e();if(l!==0&&!this.#o.has(`permessage-deflate`)){g(this.ws,`Expected RSV1 to be clear.`);return}if(u!==0||d!==0){g(this.ws,`RSV1, RSV2, RSV3 must be clear`);return}if(s&&!b(r)){g(this.ws,`Invalid frame type was fragmented.`);return}if(b(r)&&this.#a.length>0){g(this.ws,`Expected continuation frame`);return}if(this.#i.fragmented&&s){g(this.ws,`Fragmented frame exceeded 125 bytes.`);return}if((c>125||s)&&y(r)){g(this.ws,`Control frame either too large or fragmented`);return}if(x(r)&&this.#a.length===0&&!this.#i.compressed){g(this.ws,`Unexpected continuation frame`);return}c<=125?(this.#i.payloadLength=c,this.#r=i.READ_DATA):c===126?this.#r=i.PAYLOADLENGTH_16:c===127&&(this.#r=i.PAYLOADLENGTH_64),b(r)&&(this.#i.binaryType=r,this.#i.compressed=l!==0),this.#i.opcode=r,this.#i.masked=o,this.#i.fin=n,this.#i.fragmented=s}else if(this.#r===i.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#i.payloadLength=t.readUInt16BE(0),this.#r=i.READ_DATA}else if(this.#r===i.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),n=t.readUInt32BE(0),r=t.readUInt32BE(4);if(n!==0||r>2**31-1){g(this.ws,`Received payload length > 2^31 bytes.`);return}this.#i.payloadLength=r,this.#r=i.READ_DATA}else if(this.#r===i.READ_DATA){if(this.#t{if(t){g(this.ws,t.message);return}if(this.#a.push(n),!this.#i.fin){this.#r=i.INFO,this.#n=!0,this.run(e);return}_(this.ws,this.#i.binaryType,Buffer.concat(this.#a)),this.#n=!0,this.#r=i.INFO,this.#a.length=0,this.run(e)}),this.#n=!1;break}else{if(this.#a.push(t),!this.#i.fragmented&&this.#i.fin){let e=Buffer.concat(this.#a);_(this.ws,this.#i.binaryType,e),this.#a.length=0}this.#r=i.INFO}}}consume(e){if(e>this.#t)throw Error(`Called consume() before buffers satiated.`);if(e===0)return s;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let t=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let r=this.#e[0],{length:i}=r;if(i+n===e){t.set(this.#e.shift(),n);break}else if(i+n>e){t.set(r.subarray(0,e-n),n),this.#e[0]=r.subarray(e-n);break}else t.set(this.#e.shift(),n),n+=r.length}return this.#t-=e,t}parseCloseBody(e){r(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!m(t))return{code:1002,reason:`Invalid status code`,error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=v(n)}catch{return{code:1007,reason:`Invalid UTF-8`,error:!0}}return{code:t,reason:n,error:!1}}parseControlFrame(e){let{opcode:t,payloadLength:n}=this.#i;if(t===a.CLOSE){if(n===1)return g(this.ws,`Received close frame with a 1-byte body.`),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:e,reason:t}=this.#i.closeInfo;return C(this.ws,e,t,t.length),g(this.ws,t),!1}if(this.ws[u]!==c.SENT){let e=s;this.#i.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#i.closeInfo.code,0));let t=new S(e);this.ws[d].socket.write(t.createFrame(a.CLOSE),e=>{e||(this.ws[u]=c.SENT)})}return this.ws[l]=o.CLOSING,this.ws[f]=!0,!1}else if(t===a.PING){if(!this.ws[f]){let t=new S(e);this.ws[d].socket.write(t.createFrame(a.PONG)),p.ping.hasSubscribers&&p.ping.publish({payload:e})}}else t===a.PONG&&p.pong.hasSubscribers&&p.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}}}})),un=I(((e,t)=>{let{WebsocketFrameSend:n}=on(),{opcodes:r,sendHints:i}=nn(),a=rt(),o=Buffer[Symbol.species];var s=class{#e=new a;#t=!1;#n;constructor(e){this.#n=e}add(e,t,n){if(n!==i.blob){let r=c(e,n);if(!this.#t)this.#n.write(r,t);else{let e={promise:null,callback:t,frame:r};this.#e.push(e)}return}let r={promise:e.arrayBuffer().then(e=>{r.promise=null,r.frame=c(e,n)}),callback:t,frame:null};this.#e.push(r),this.#t||this.#r()}async#r(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let t=e.shift();t.promise!==null&&await t.promise,this.#n.write(t.frame,t.callback),t.callback=t.frame=null}this.#t=!1}};function c(e,t){return new n(l(e,t)).createFrame(t===i.string?r.TEXT:r.BINARY)}function l(e,t){switch(t){case i.string:return Buffer.from(e);case i.arrayBuffer:case i.blob:return new o(e);case i.typedArray:return new o(e.buffer,e.byteOffset,e.byteLength)}}t.exports={SendQueue:s}})),dn=I(((e,t)=>{let{webidl:n}=Ge(),{URLSerializer:r}=We(),{environmentSettingsObject:i}=Ke(),{staticPropertyDescriptors:a,states:o,sentCloseFrameState:s,sendHints:c}=nn(),{kWebSocketURL:l,kReadyState:u,kController:d,kBinaryType:f,kResponse:p,kSentClose:m,kByteParser:h}=rn(),{isConnecting:g,isEstablished:_,isClosing:v,isValidSubprotocol:y,fireEvent:b}=an(),{establishWebSocketConnection:x,closeWebSocketConnection:S}=sn(),{ByteParser:C}=ln(),{kEnumerableProperty:w,isBlobLike:T}=z(),{getGlobalDispatcher:E}=jt(),{types:D}=L(`node:util`),{ErrorEvent:O,CloseEvent:k}=tn(),{SendQueue:A}=un();var j=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;#i;constructor(t,r=[]){super(),n.util.markAsUncloneable(this);let a=`WebSocket constructor`;n.argumentLengthCheck(arguments,1,a);let o=n.converters[`DOMString or sequence or WebSocketInit`](r,a,`options`);t=n.converters.USVString(t,a,`url`),r=o.protocols;let c=i.settingsObject.baseUrl,p;try{p=new URL(t,c)}catch(e){throw new DOMException(e,`SyntaxError`)}if(p.protocol===`http:`?p.protocol=`ws:`:p.protocol===`https:`&&(p.protocol=`wss:`),p.protocol!==`ws:`&&p.protocol!==`wss:`)throw new DOMException(`Expected a ws: or wss: protocol, got ${p.protocol}`,`SyntaxError`);if(p.hash||p.href.endsWith(`#`))throw new DOMException(`Got fragment`,`SyntaxError`);if(typeof r==`string`&&(r=[r]),r.length!==new Set(r.map(e=>e.toLowerCase())).size||r.length>0&&!r.every(e=>y(e)))throw new DOMException(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this[l]=new URL(p.href);let h=i.settingsObject;this[d]=x(p,r,h,this,(e,t)=>this.#a(e,t),o),this[u]=e.CONNECTING,this[m]=s.NOT_SENT,this[f]=`blob`}close(t=void 0,r=void 0){n.brandCheck(this,e);let i=`WebSocket.close`;if(t!==void 0&&(t=n.converters[`unsigned short`](t,i,`code`,{clamp:!0})),r!==void 0&&(r=n.converters.USVString(r,i,`reason`)),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new DOMException(`invalid code`,`InvalidAccessError`);let a=0;if(r!==void 0&&(a=Buffer.byteLength(r),a>123))throw new DOMException(`Reason must be less than 123 bytes; received ${a}`,`SyntaxError`);S(this,t,r,a)}send(t){n.brandCheck(this,e);let r=`WebSocket.send`;if(n.argumentLengthCheck(arguments,1,r),t=n.converters.WebSocketSendData(t,r,`data`),g(this))throw new DOMException(`Sent before connected.`,`InvalidStateError`);if(!(!_(this)||v(this)))if(typeof t==`string`){let e=Buffer.byteLength(t);this.#t+=e,this.#i.add(t,()=>{this.#t-=e},c.string)}else D.isArrayBuffer(t)?(this.#t+=t.byteLength,this.#i.add(t,()=>{this.#t-=t.byteLength},c.arrayBuffer)):ArrayBuffer.isView(t)?(this.#t+=t.byteLength,this.#i.add(t,()=>{this.#t-=t.byteLength},c.typedArray)):T(t)&&(this.#t+=t.size,this.#i.add(t,()=>{this.#t-=t.size},c.blob))}get readyState(){return n.brandCheck(this,e),this[u]}get bufferedAmount(){return n.brandCheck(this,e),this.#t}get url(){return n.brandCheck(this,e),r(this[l])}get extensions(){return n.brandCheck(this,e),this.#r}get protocol(){return n.brandCheck(this,e),this.#n}get onopen(){return n.brandCheck(this,e),this.#e.open}set onopen(t){n.brandCheck(this,e),this.#e.open&&this.removeEventListener(`open`,this.#e.open),typeof t==`function`?(this.#e.open=t,this.addEventListener(`open`,t)):this.#e.open=null}get onerror(){return n.brandCheck(this,e),this.#e.error}set onerror(t){n.brandCheck(this,e),this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof t==`function`?(this.#e.error=t,this.addEventListener(`error`,t)):this.#e.error=null}get onclose(){return n.brandCheck(this,e),this.#e.close}set onclose(t){n.brandCheck(this,e),this.#e.close&&this.removeEventListener(`close`,this.#e.close),typeof t==`function`?(this.#e.close=t,this.addEventListener(`close`,t)):this.#e.close=null}get onmessage(){return n.brandCheck(this,e),this.#e.message}set onmessage(t){n.brandCheck(this,e),this.#e.message&&this.removeEventListener(`message`,this.#e.message),typeof t==`function`?(this.#e.message=t,this.addEventListener(`message`,t)):this.#e.message=null}get binaryType(){return n.brandCheck(this,e),this[f]}set binaryType(t){n.brandCheck(this,e),t!==`blob`&&t!==`arraybuffer`?this[f]=`blob`:this[f]=t}#a(e,t){this[p]=e;let n=new C(this,t);n.on(`drain`,M),n.on(`error`,N.bind(this)),e.socket.ws=this,this[h]=n,this.#i=new A(e.socket),this[u]=o.OPEN;let r=e.headersList.get(`sec-websocket-extensions`);r!==null&&(this.#r=r);let i=e.headersList.get(`sec-websocket-protocol`);i!==null&&(this.#n=i),b(`open`,this)}};j.CONNECTING=j.prototype.CONNECTING=o.CONNECTING,j.OPEN=j.prototype.OPEN=o.OPEN,j.CLOSING=j.prototype.CLOSING=o.CLOSING,j.CLOSED=j.prototype.CLOSED=o.CLOSED,Object.defineProperties(j.prototype,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a,url:w,readyState:w,bufferedAmount:w,onopen:w,onerror:w,onclose:w,close:w,onmessage:w,binaryType:w,send:w,extensions:w,protocol:w,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(j,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a}),n.converters[`sequence`]=n.sequenceConverter(n.converters.DOMString),n.converters[`DOMString or sequence`]=function(e,t,r){return n.util.Type(e)===`Object`&&Symbol.iterator in e?n.converters[`sequence`](e):n.converters.DOMString(e,t,r)},n.converters.WebSocketInit=n.dictionaryConverter([{key:`protocols`,converter:n.converters[`DOMString or sequence`],defaultValue:()=>[]},{key:`dispatcher`,converter:n.converters.any,defaultValue:()=>E()},{key:`headers`,converter:n.nullableConverter(n.converters.HeadersInit)}]),n.converters[`DOMString or sequence or WebSocketInit`]=function(e){return n.util.Type(e)===`Object`&&!(Symbol.iterator in e)?n.converters.WebSocketInit(e):{protocols:n.converters[`DOMString or sequence`](e)}},n.converters.WebSocketSendData=function(e){if(n.util.Type(e)===`Object`){if(T(e))return n.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||D.isArrayBuffer(e))return n.converters.BufferSource(e)}return n.converters.USVString(e)};function M(){this.ws[p].socket.resume()}function N(e){let t,n;e instanceof k?(t=e.reason,n=e.code):t=e.message,b(`error`,this,()=>new O(`error`,{error:e,message:t})),S(this,n)}t.exports={WebSocket:j}})),fn=I(((e,t)=>{function n(e){return e.indexOf(`\0`)===-1}function r(e){if(e.length===0)return!1;for(let t=0;t57)return!1;return!0}function i(e){return new Promise(t=>{setTimeout(t,e).unref()})}t.exports={isValidLastEventId:n,isASCIINumber:r,delay:i}})),pn=I(((e,t)=>{let{Transform:n}=L(`node:stream`),{isASCIINumber:r,isValidLastEventId:i}=fn(),a=[239,187,191];t.exports={EventSourceStream:class extends n{state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,t,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===a[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===a[0]&&this.buffer[1]===a[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===a[0]&&this.buffer[1]===a[1]&&this.buffer[2]===a[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===a[0]&&this.buffer[1]===a[1]&&this.buffer[2]===a[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(t[a]=o);break}}processEvent(e){e.retry&&r(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&i(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||`message`,options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}}}})),mn=I(((e,t)=>{let{pipeline:n}=L(`node:stream`),{fetching:r}=Vt(),{makeRequest:i}=Bt(),{webidl:a}=Ge(),{EventSourceStream:o}=pn(),{parseMIMEType:s}=We(),{createFastMessageEvent:c}=tn(),{isNetworkError:l}=Rt(),{delay:u}=fn(),{kEnumerableProperty:d}=z(),{environmentSettingsObject:f}=Ke(),p=!1,m=3e3;var h=class e extends EventTarget{#e={open:null,error:null,message:null};#t=null;#n=!1;#r=0;#i=null;#a=null;#o;#s;constructor(e,t={}){super(),a.util.markAsUncloneable(this);let n=`EventSource constructor`;a.argumentLengthCheck(arguments,1,n),p||(p=!0,process.emitWarning(`EventSource is experimental, expect them to change at any time.`,{code:`UNDICI-ES`})),e=a.converters.USVString(e,n,`url`),t=a.converters.EventSourceInitDict(t,n,`eventSourceInitDict`),this.#o=t.dispatcher,this.#s={lastEventId:``,reconnectionTime:m};let r=f,o;try{o=new URL(e,r.settingsObject.baseUrl),this.#s.origin=o.origin}catch(e){throw new DOMException(e,`SyntaxError`)}this.#t=o.href;let s=`anonymous`;t.withCredentials&&(s=`use-credentials`,this.#n=!0);let c={redirect:`follow`,keepalive:!0,mode:`cors`,credentials:s===`anonymous`?`same-origin`:`omit`,referrer:`no-referrer`};c.client=f.settingsObject,c.headersList=[[`accept`,{name:`accept`,value:`text/event-stream`}]],c.cache=`no-store`,c.initiator=`other`,c.urlList=[new URL(this.#t)],this.#i=i(c),this.#c()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#n}#c(){if(this.#r===2)return;this.#r=0;let e={request:this.#i,dispatcher:this.#o};e.processResponseEndOfBody=e=>{l(e)&&(this.dispatchEvent(new Event(`error`)),this.close()),this.#l()},e.processResponse=e=>{if(l(e))if(e.aborted){this.close(),this.dispatchEvent(new Event(`error`));return}else{this.#l();return}let t=e.headersList.get(`content-type`,!0),r=t===null?`failure`:s(t),i=r!==`failure`&&r.essence===`text/event-stream`;if(e.status!==200||i===!1){this.close(),this.dispatchEvent(new Event(`error`));return}this.#r=1,this.dispatchEvent(new Event(`open`)),this.#s.origin=e.urlList[e.urlList.length-1].origin;let a=new o({eventSourceSettings:this.#s,push:e=>{this.dispatchEvent(c(e.type,e.options))}});n(e.body.stream,a,e=>{e?.aborted===!1&&(this.close(),this.dispatchEvent(new Event(`error`)))})},this.#a=r(e)}async#l(){this.#r!==2&&(this.#r=0,this.dispatchEvent(new Event(`error`)),await u(this.#s.reconnectionTime),this.#r===0&&(this.#s.lastEventId.length&&this.#i.headersList.set(`last-event-id`,this.#s.lastEventId,!0),this.#c()))}close(){a.brandCheck(this,e),this.#r!==2&&(this.#r=2,this.#a.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){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 onmessage(){return this.#e.message}set onmessage(e){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 onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof e==`function`?(this.#e.error=e,this.addEventListener(`error`,e)):this.#e.error=null}};let g={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(h,g),Object.defineProperties(h.prototype,g),Object.defineProperties(h.prototype,{close:d,onerror:d,onmessage:d,onopen:d,readyState:d,url:d,withCredentials:d}),a.converters.EventSourceInitDict=a.dictionaryConverter([{key:`withCredentials`,converter:a.converters.boolean,defaultValue:()=>!1},{key:`dispatcher`,converter:a.converters.any}]),t.exports={EventSource:h,defaultReconnectionTime:m}})),hn=I(((e,t)=>{let n=nt(),r=Pe(),i=ot(),a=st(),o=ct(),s=lt(),c=ut(),l=ft(),u=R(),d=z(),{InvalidArgumentError:f}=u,p=xt(),m=Le(),h=Et(),g=At(),_=Dt(),v=St(),y=dt(),{getGlobalDispatcher:b,setGlobalDispatcher:x}=jt(),S=Mt(),C=et(),w=tt();Object.assign(r.prototype,p),t.exports.Dispatcher=r,t.exports.Client=n,t.exports.Pool=i,t.exports.BalancedPool=a,t.exports.Agent=o,t.exports.ProxyAgent=s,t.exports.EnvHttpProxyAgent=c,t.exports.RetryAgent=l,t.exports.RetryHandler=y,t.exports.DecoratorHandler=S,t.exports.RedirectHandler=C,t.exports.createRedirectInterceptor=w,t.exports.interceptors={redirect:Nt(),retry:Pt(),dump:Ft(),dns:It()},t.exports.buildConnector=m,t.exports.errors=u,t.exports.util={parseHeaders:d.parseHeaders,headerNameToString:d.headerNameToString};function T(e){return(t,n,r)=>{if(typeof n==`function`&&(r=n,n=null),!t||typeof t!=`string`&&typeof t!=`object`&&!(t instanceof URL))throw new f(`invalid url`);if(n!=null&&typeof n!=`object`)throw new f(`invalid opts`);if(n&&n.path!=null){if(typeof n.path!=`string`)throw new f(`invalid opts.path`);let e=n.path;n.path.startsWith(`/`)||(e=`/${e}`),t=new URL(d.parseOrigin(t).origin+e)}else n||=typeof t==`object`?t:{},t=d.parseURL(t);let{agent:i,dispatcher:a=b()}=n;if(i)throw new f(`unsupported opts.agent. Did you mean opts.client?`);return e.call(a,{...n,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?`PUT`:`GET`)},r)}}t.exports.setGlobalDispatcher=x,t.exports.getGlobalDispatcher=b;let E=Vt().fetch;t.exports.fetch=async function(e,t=void 0){try{return await E(e,t)}catch(e){throw e&&typeof e==`object`&&Error.captureStackTrace(e),e}},t.exports.Headers=Lt().Headers,t.exports.Response=Rt().Response,t.exports.Request=Bt().Request,t.exports.FormData=Ye().FormData,t.exports.File=globalThis.File??L(`node:buffer`).File,t.exports.FileReader=Kt().FileReader;let{setGlobalOrigin:D,getGlobalOrigin:O}=Ue();t.exports.setGlobalOrigin=D,t.exports.getGlobalOrigin=O;let{CacheStorage:k}=Xt(),{kConstruct:A}=qt();t.exports.caches=new k(A);let{deleteCookie:j,getCookies:M,getSetCookies:N,setCookie:P}=en();t.exports.deleteCookie=j,t.exports.getCookies=M,t.exports.getSetCookies=N,t.exports.setCookie=P;let{parseMIMEType:ee,serializeAMimeType:te}=We();t.exports.parseMIMEType=ee,t.exports.serializeAMimeType=te;let{CloseEvent:ne,ErrorEvent:F,MessageEvent:re}=tn();t.exports.WebSocket=dn().WebSocket,t.exports.CloseEvent=ne,t.exports.ErrorEvent=F,t.exports.MessageEvent=re,t.exports.request=T(p.request),t.exports.stream=T(p.stream),t.exports.pipeline=T(p.pipeline),t.exports.connect=T(p.connect),t.exports.upgrade=T(p.upgrade),t.exports.MockClient=h,t.exports.MockPool=_,t.exports.MockAgent=g,t.exports.mockErrors=v;let{EventSource:ie}=mn();t.exports.EventSource=ie})),gn=me(Oe(),1),_n=hn(),vn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},yn;(function(e){e[e.OK=200]=`OK`,e[e.MultipleChoices=300]=`MultipleChoices`,e[e.MovedPermanently=301]=`MovedPermanently`,e[e.ResourceMoved=302]=`ResourceMoved`,e[e.SeeOther=303]=`SeeOther`,e[e.NotModified=304]=`NotModified`,e[e.UseProxy=305]=`UseProxy`,e[e.SwitchProxy=306]=`SwitchProxy`,e[e.TemporaryRedirect=307]=`TemporaryRedirect`,e[e.PermanentRedirect=308]=`PermanentRedirect`,e[e.BadRequest=400]=`BadRequest`,e[e.Unauthorized=401]=`Unauthorized`,e[e.PaymentRequired=402]=`PaymentRequired`,e[e.Forbidden=403]=`Forbidden`,e[e.NotFound=404]=`NotFound`,e[e.MethodNotAllowed=405]=`MethodNotAllowed`,e[e.NotAcceptable=406]=`NotAcceptable`,e[e.ProxyAuthenticationRequired=407]=`ProxyAuthenticationRequired`,e[e.RequestTimeout=408]=`RequestTimeout`,e[e.Conflict=409]=`Conflict`,e[e.Gone=410]=`Gone`,e[e.TooManyRequests=429]=`TooManyRequests`,e[e.InternalServerError=500]=`InternalServerError`,e[e.NotImplemented=501]=`NotImplemented`,e[e.BadGateway=502]=`BadGateway`,e[e.ServiceUnavailable=503]=`ServiceUnavailable`,e[e.GatewayTimeout=504]=`GatewayTimeout`})(yn||={});var bn;(function(e){e.Accept=`accept`,e.ContentType=`content-type`})(bn||={});var xn;(function(e){e.ApplicationJson=`application/json`})(xn||={});const Sn=[yn.MovedPermanently,yn.ResourceMoved,yn.SeeOther,yn.TemporaryRedirect,yn.PermanentRedirect],Cn=[yn.BadGateway,yn.ServiceUnavailable,yn.GatewayTimeout],wn=[`OPTIONS`,`GET`,`DELETE`,`HEAD`];var Tn=class e extends Error{constructor(t,n){super(t),this.name=`HttpClientError`,this.statusCode=n,Object.setPrototypeOf(this,e.prototype)}},En=class{constructor(e){this.message=e}readBody(){return vn(this,void 0,void 0,function*(){return new Promise(e=>vn(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on(`data`,e=>{t=Buffer.concat([t,e])}),this.message.on(`end`,()=>{e(t.toString())})}))})}readBodyBuffer(){return vn(this,void 0,void 0,function*(){return new Promise(e=>vn(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}},Dn=class{constructor(e,t,n){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=this._getUserAgentWithOrchestrationId(e),this.handlers=t||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}options(e,t){return vn(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return vn(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return vn(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return vn(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return vn(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return vn(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return vn(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return vn(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e){return vn(this,arguments,void 0,function*(e,t={}){t[bn.Accept]=this._getExistingOrDefaultHeader(t,bn.Accept,xn.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t){return vn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[bn.Accept]=this._getExistingOrDefaultHeader(n,bn.Accept,xn.ApplicationJson),n[bn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,xn.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t){return vn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[bn.Accept]=this._getExistingOrDefaultHeader(n,bn.Accept,xn.ApplicationJson),n[bn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,xn.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t){return vn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[bn.Accept]=this._getExistingOrDefaultHeader(n,bn.Accept,xn.ApplicationJson),n[bn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,xn.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return vn(this,void 0,void 0,function*(){if(this._disposed)throw Error(`Client has already been disposed.`);let i=new URL(t),a=this._prepareRequest(e,i,r),o=this._allowRetries&&wn.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===yn.Unauthorized){let e;for(let t of this.handlers)if(t.canHandleAuthentication(c)){e=t;break}return e?e.handleAuthentication(this,a,n):c}let t=this._maxRedirects;for(;c.message.statusCode&&Sn.includes(c.message.statusCode)&&this._allowRedirects&&t>0;){let o=c.message.headers.location;if(!o)break;let s=new URL(o);if(i.protocol===`https:`&&i.protocol!==s.protocol&&!this._allowRedirectDowngrade)throw 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(),s.hostname!==i.hostname)for(let e in r)e.toLowerCase()===`authorization`&&delete r[e];a=this._prepareRequest(e,s,r),c=yield this.requestRaw(a,n),t--}if(!c.message.statusCode||!Cn.includes(c.message.statusCode))return c;s+=1,s{function i(e,t){e?r(e):t?n(t):r(Error(`Unknown error`))}this.requestRawWithCallback(e,t,i)})})}requestRawWithCallback(e,t,n){typeof t==`string`&&(e.options.headers||(e.options.headers={}),e.options.headers[`Content-Length`]=Buffer.byteLength(t,`utf8`));let r=!1;function i(e,t){r||(r=!0,n(e,t))}let a=e.httpModule.request(e.options,e=>{i(void 0,new En(e))}),o;a.on(`socket`,e=>{o=e}),a.setTimeout(this._socketTimeout||3*6e4,()=>{o&&o.end(),i(Error(`Request timeout: ${e.options.path}`))}),a.on(`error`,function(e){i(e)}),t&&typeof t==`string`&&a.write(t,`utf8`),t&&typeof t!=`string`?(t.on(`close`,function(){a.end()}),t.pipe(a)):a.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),n=Ce(t);if(n&&n.hostname)return this._getProxyAgentDispatcher(t,n)}_prepareRequest(e,t,n){let r={};r.parsedUrl=t;let i=r.parsedUrl.protocol===`https:`;r.httpModule=i?p:f;let a=i?443:80;if(r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):a,r.options.path=(r.parsedUrl.pathname||``)+(r.parsedUrl.search||``),r.options.method=e,r.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(r.options.headers[`user-agent`]=this.userAgent),r.options.agent=this._getAgent(r.parsedUrl),this.handlers)for(let e of this.handlers)e.prepareRequest(r.options);return r}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},On(this.requestOptions.headers),On(e||{})):On(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){let e=On(this.requestOptions.headers)[t];e&&(r=typeof e==`number`?e.toString():e)}let i=e[t];return i===void 0?r===void 0?n:r:typeof i==`number`?i.toString():i}_getExistingOrDefaultContentTypeHeader(e,t){let n;if(this.requestOptions&&this.requestOptions.headers){let e=On(this.requestOptions.headers)[bn.ContentType];e&&(n=typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):e)}let r=e[bn.ContentType];return r===void 0?n===void 0?t:n:typeof r==`number`?String(r):Array.isArray(r)?r.join(`, `):r}_getAgent(e){let t,n=Ce(e),r=n&&n.hostname;if(this._keepAlive&&r&&(t=this._proxyAgent),r||(t=this._agent),t)return t;let i=e.protocol===`https:`,a=100;if(this.requestOptions&&(a=this.requestOptions.maxSockets||f.globalAgent.maxSockets),n&&n.hostname){let e={maxSockets:a,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},r,o=n.protocol===`https:`;r=i?o?gn.httpsOverHttps:gn.httpsOverHttp:o?gn.httpOverHttps:gn.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:a};t=i?new p.Agent(e):new f.Agent(e),this._agent=t}return i&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_getProxyAgentDispatcher(e,t){let n;if(this._keepAlive&&(n=this._proxyAgentDispatcher),n)return n;let r=e.protocol===`https:`;return n=new _n.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(t.username||t.password)&&{token:`Basic ${Buffer.from(`${t.username}:${t.password}`).toString(`base64`)}`})),this._proxyAgentDispatcher=n,r&&this._ignoreSslError&&(n.options=Object.assign(n.options.requestTls||{},{rejectUnauthorized:!1})),n}_getUserAgentWithOrchestrationId(e){let t=e||`actions/http-client`,n=process.env.ACTIONS_ORCHESTRATION_ID;return n?`${t} actions_orchestration_id/${n.replace(/[^a-z0-9_.-]/gi,`_`)}`:t}_performExponentialBackoff(e){return vn(this,void 0,void 0,function*(){e=Math.min(10,e);let t=5*2**e;return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return vn(this,void 0,void 0,function*(){return new Promise((n,r)=>vn(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===yn.NotFound&&n(a);function o(e,t){if(typeof t==`string`){let e=new Date(t);if(!isNaN(e.valueOf()))return e}return t}let s,c;try{c=yield e.readBody(),c&&c.length>0&&(s=t&&t.deserializeDates?JSON.parse(c,o):JSON.parse(c),a.result=s),a.headers=e.message.headers}catch{}if(i>299){let e;e=s&&s.message?s.message:c&&c.length>0?c:`Failed request: (${i})`;let t=new Tn(e,i);t.result=a.result,r(t)}else n(a)}))})}};const On=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{});var kn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},An=class{constructor(e){this.token=e}prepareRequest(e){if(!e.headers)throw Error(`The request has no headers`);e.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return kn(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},jn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const{access:Mn,appendFile:Nn,writeFile:Pn}=l,Fn=`GITHUB_STEP_SUMMARY`,In=new class{constructor(){this._buffer=``}filePath(){return jn(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[Fn];if(!e)throw Error(`Unable to find environment variable for $${Fn}. Check if your runtime environment supports job summaries.`);try{yield Mn(e,s.R_OK|s.W_OK)}catch{throw Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,t,n={}){let r=Object.entries(n).map(([e,t])=>` ${e}="${t}"`).join(``);return t?`<${e}${r}>${t}`:`<${e}${r}>`}write(e){return jn(this,void 0,void 0,function*(){let t=!!e?.overwrite,n=yield this.filePath();return yield(t?Pn:Nn)(n,this._buffer,{encoding:`utf8`}),this.emptyBuffer()})}clear(){return jn(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer=``,this}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(i)}addCodeBlock(e,t){let n=Object.assign({},t&&{lang:t}),r=this.wrap(`pre`,this.wrap(`code`,e),n);return this.addRaw(r).addEOL()}addList(e,t=!1){let n=t?`ol`:`ul`,r=e.map(e=>this.wrap(`li`,e)).join(``),i=this.wrap(n,r);return this.addRaw(i).addEOL()}addTable(e){let t=e.map(e=>{let t=e.map(e=>{if(typeof e==`string`)return this.wrap(`td`,e);let{header:t,data:n,colspan:r,rowspan:i}=e,a=t?`th`:`td`,o=Object.assign(Object.assign({},r&&{colspan:r}),i&&{rowspan:i});return this.wrap(a,n,o)}).join(``);return this.wrap(`tr`,t)}).join(``),n=this.wrap(`table`,t);return this.addRaw(n).addEOL()}addDetails(e,t){let n=this.wrap(`details`,this.wrap(`summary`,e)+t);return this.addRaw(n).addEOL()}addImage(e,t,n){let{width:r,height:i}=n||{},a=Object.assign(Object.assign({},r&&{width:r}),i&&{height:i}),o=this.wrap(`img`,null,Object.assign({src:e,alt:t},a));return this.addRaw(o).addEOL()}addHeading(e,t){let n=`h${t}`,r=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`].includes(n)?n:`h1`,i=this.wrap(r,e);return this.addRaw(i).addEOL()}addSeparator(){let e=this.wrap(`hr`,null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap(`br`,null);return this.addRaw(e).addEOL()}addQuote(e,t){let n=Object.assign({},t&&{cite:t}),r=this.wrap(`blockquote`,e,n);return this.addRaw(r).addEOL()}addLink(e,t){let n=this.wrap(`a`,e,{href:t});return this.addRaw(n).addEOL()}};var Ln=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const{chmod:Rn,copyFile:zn,lstat:Bn,mkdir:Vn,open:Hn,readdir:Un,rename:Wn,rm:Gn,rmdir:Kn,stat:qn,symlink:Jn,unlink:Yn}=o.promises,Xn=process.platform===`win32`;function Zn(e){return Ln(this,void 0,void 0,function*(){let t=yield o.promises.readlink(e);return Xn&&!t.endsWith(`\\`)?`${t}\\`:t})}o.constants.O_RDONLY;function Qn(e){return Ln(this,void 0,void 0,function*(){try{yield qn(e)}catch(e){if(e.code===`ENOENT`)return!1;throw e}return!0})}function $n(e){if(e=tr(e),!e)throw Error(`isRooted() parameter "p" cannot be empty`);return Xn?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function er(e,t){return Ln(this,void 0,void 0,function*(){let n;try{n=yield qn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Xn){let n=d.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===n))return e}else if(nr(n))return e}let r=e;for(let i of t){e=r+i,n=void 0;try{n=yield qn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Xn){try{let t=d.dirname(e),n=d.basename(e).toUpperCase();for(let r of yield Un(t))if(n===r.toUpperCase()){e=d.join(t,r);break}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else if(nr(n))return e}}return``})}function tr(e){return e||=``,Xn?(e=e.replace(/\//g,`\\`),e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function nr(e){return(e.mode&1)>0||(e.mode&8)>0&&process.getgid!==void 0&&e.gid===process.getgid()||(e.mode&64)>0&&process.getuid!==void 0&&e.uid===process.getuid()}var rr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function ir(e,t){return rr(this,arguments,void 0,function*(e,t,n={}){let{force:r,recursive:i,copySourceDirectory:a}=lr(n),o=(yield Qn(t))?yield qn(t):null;if(o&&o.isFile()&&!r)return;let s=o&&o.isDirectory()&&a?d.join(t,d.basename(e)):t;if(!(yield Qn(e)))throw Error(`no such file or directory: ${e}`);if((yield qn(e)).isDirectory())if(i)yield ur(e,s,0,r);else throw Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`);else{if(d.relative(e,s)===``)throw Error(`'${s}' and '${e}' are the same file`);yield dr(e,s,r)}})}function ar(e){return rr(this,void 0,void 0,function*(){if(Xn&&/[*"<>|]/.test(e))throw Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield Gn(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(e){throw Error(`File was unable to be removed ${e}`)}})}function or(e){return rr(this,void 0,void 0,function*(){_(e,`a path argument must be provided`),yield Vn(e,{recursive:!0})})}function sr(e,t){return rr(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);if(t){let t=yield sr(e,!1);if(!t)throw Xn?Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`):Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);return t}let n=yield cr(e);return n&&n.length>0?n[0]:``})}function cr(e){return rr(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);let t=[];if(Xn&&process.env.PATHEXT)for(let e of process.env.PATHEXT.split(d.delimiter))e&&t.push(e);if($n(e)){let n=yield er(e,t);return n?[n]:[]}if(e.includes(d.sep))return[];let n=[];if(process.env.PATH)for(let e of process.env.PATH.split(d.delimiter))e&&n.push(e);let r=[];for(let i of n){let n=yield er(d.join(i,e),t);n&&r.push(n)}return r})}function lr(e){return{force:e.force==null?!0:e.force,recursive:!!e.recursive,copySourceDirectory:e.copySourceDirectory==null?!0:!!e.copySourceDirectory}}function ur(e,t,n,r){return rr(this,void 0,void 0,function*(){if(n>=255)return;n++,yield or(t);let i=yield Un(e);for(let a of i){let i=`${e}/${a}`,o=`${t}/${a}`;(yield Bn(i)).isDirectory()?yield ur(i,o,n,r):yield dr(i,o,r)}yield Rn(t,(yield qn(e)).mode)})}function dr(e,t,n){return rr(this,void 0,void 0,function*(){if((yield Bn(e)).isSymbolicLink()){try{yield Bn(t),yield Yn(t)}catch(e){e.code===`EPERM`&&(yield Rn(t,`0666`),yield Yn(t))}yield Jn(yield Zn(e),t,Xn?`junction`:null)}else (!(yield Qn(t))||n)&&(yield zn(e,t))})}var fr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const pr=process.platform===`win32`;var mr=class extends m.EventEmitter{constructor(e,t,n){if(super(),!e)throw Error(`Parameter 'toolPath' cannot be null or empty.`);this.toolPath=e,this.args=t||[],this.options=n||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){let n=this._getSpawnFileName(),r=this._getSpawnArgs(e),i=t?``:`[command]`;if(pr)if(this._isCmdFile()){i+=n;for(let e of r)i+=` ${e}`}else if(e.windowsVerbatimArguments){i+=`"${n}"`;for(let e of r)i+=` ${e}`}else{i+=this._windowsQuoteCmdArg(n);for(let e of r)i+=` ${this._windowsQuoteCmdArg(e)}`}else{i+=n;for(let e of r)i+=` ${e}`}return i}_processLineBuffer(e,t,r){try{let i=t+e.toString(),a=i.indexOf(n.EOL);for(;a>-1;)r(i.substring(0,a)),i=i.substring(a+n.EOL.length),a=i.indexOf(n.EOL);return i}catch(e){return this._debug(`error processing line. Failed with error ${e}`),``}}_getSpawnFileName(){return pr&&this._isCmdFile()?process.env.COMSPEC||`cmd.exe`:this.toolPath}_getSpawnArgs(e){if(pr&&this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let n of this.args)t+=` `,t+=e.windowsVerbatimArguments?n:this._windowsQuoteCmdArg(n);return t+=`"`,[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){let e=this.toolPath.toUpperCase();return this._endsWith(e,`.CMD`)||this._endsWith(e,`.BAT`)}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return`""`;let t=[` `,` `,`&`,`(`,`)`,`[`,`]`,`{`,`}`,`^`,`=`,`;`,`!`,`'`,`+`,`,`,"`",`~`,`|`,`<`,`>`,`"`],n=!1;for(let r of e)if(t.some(e=>e===r)){n=!0;break}if(!n)return e;let r=`"`,i=!0;for(let t=e.length;t>0;t--)r+=e[t-1],i&&e[t-1]===`\\`?r+=`\\`:e[t-1]===`"`?(i=!0,r+=`"`):i=!1;return r+=`"`,r.split(``).reverse().join(``)}_uvQuoteCmdArg(e){if(!e)return`""`;if(!e.includes(` `)&&!e.includes(` `)&&!e.includes(`"`))return e;if(!e.includes(`"`)&&!e.includes(`\\`))return`"${e}"`;let t=`"`,n=!0;for(let r=e.length;r>0;r--)t+=e[r-1],n&&e[r-1]===`\\`?t+=`\\`:e[r-1]===`"`?(n=!0,t+=`\\`):n=!1;return t+=`"`,t.split(``).reverse().join(``)}_cloneExecOptions(e){e||={};let t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){e||={};let n={};return n.cwd=e.cwd,n.env=e.env,n.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(n.argv0=`"${t}"`),n}exec(){return fr(this,void 0,void 0,function*(){return!$n(this.toolPath)&&(this.toolPath.includes(`/`)||pr&&this.toolPath.includes(`\\`))&&(this.toolPath=d.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield sr(this.toolPath,!0),new Promise((e,t)=>fr(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug(`arguments:`);for(let e of this.args)this._debug(` ${e}`);let r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+n.EOL);let i=new gr(r,this.toolPath);if(i.on(`debug`,e=>{this._debug(e)}),this.options.cwd&&!(yield Qn(this.options.cwd)))return t(Error(`The cwd: ${this.options.cwd} does not exist!`));let a=this._getSpawnFileName(),o=O.spawn(a,this._getSpawnArgs(r),this._getSpawnOptions(this.options,a)),s=``;o.stdout&&o.stdout.on(`data`,e=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(e),!r.silent&&r.outStream&&r.outStream.write(e),s=this._processLineBuffer(e,s,e=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(e)})});let c=``;if(o.stderr&&o.stderr.on(`data`,e=>{i.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(e),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(e),c=this._processLineBuffer(e,c,e=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(e)})}),o.on(`error`,e=>{i.processError=e.message,i.processExited=!0,i.processClosed=!0,i.CheckComplete()}),o.on(`exit`,e=>{i.processExitCode=e,i.processExited=!0,this._debug(`Exit code ${e} received from tool '${this.toolPath}'`),i.CheckComplete()}),o.on(`close`,e=>{i.processExitCode=e,i.processExited=!0,i.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),i.CheckComplete()}),i.on(`done`,(n,r)=>{s.length>0&&this.emit(`stdline`,s),c.length>0&&this.emit(`errline`,c),o.removeAllListeners(),n?t(n):e(r)}),this.options.input){if(!o.stdin)throw Error(`child process missing stdin`);o.stdin.end(this.options.input)}}))})}};function hr(e){let t=[],n=!1,r=!1,i=``;function a(e){r&&e!==`"`&&(i+=`\\`),i+=e,r=!1}for(let o=0;o0&&(t.push(i),i=``);continue}a(s)}return i.length>0&&t.push(i.trim()),t}var gr=class e extends m.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError=``,this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw Error(`toolPath must not be empty`);this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=k(e.HandleTimeout,this.delay,this)))}_debug(e){this.emit(`debug`,e)}_setResult(){let e;this.processExited&&(this.processError?e=Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?e=Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(e=Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&=(clearTimeout(this.timeout),null),this.done=!0,this.emit(`done`,e,this.processExitCode)}static HandleTimeout(e){if(!e.done){if(!e.processClosed&&e.processExited){let t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}},_r=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function vr(e,t,n){return _r(this,void 0,void 0,function*(){let r=hr(e);if(r.length===0)throw Error(`Parameter 'commandLine' cannot be null or empty.`);let i=r[0];return t=r.slice(1).concat(t||[]),new mr(i,t,n).exec()})}function yr(e,t,n){return _r(this,void 0,void 0,function*(){let r=``,i=``,a=new D(`utf8`),o=new D(`utf8`),s=n?.listeners?.stdout,c=n?.listeners?.stderr,l=Object.assign(Object.assign({},n?.listeners),{stdout:e=>{r+=a.write(e),s&&s(e)},stderr:e=>{i+=o.write(e),c&&c(e)}}),u=yield vr(e,t,Object.assign(Object.assign({},n),{listeners:l}));return r+=a.end(),i+=o.end(),{exitCode:u,stdout:r,stderr:i}})}r.platform(),r.arch();var br;(function(e){e[e.Success=0]=`Success`,e[e.Failure=1]=`Failure`})(br||={});function xr(e,t){let n=he(t);if(process.env[e]=n,process.env.GITHUB_ENV)return xe(`ENV`,Se(e,t));_e(`set-env`,{name:e},n)}function Sr(e){_e(`add-mask`,{},e)}function Cr(e){process.env.GITHUB_PATH?xe(`PATH`,e):_e(`add-path`,{},e),process.env.PATH=`${e}${d.delimiter}${process.env.PATH}`}function wr(e,t){let n=process.env[`INPUT_${e.replace(/ /g,`_`).toUpperCase()}`]||``;if(t&&t.required&&!n)throw Error(`Input required and not supplied: ${e}`);return t&&t.trimWhitespace===!1?n:n.trim()}function Tr(e,t){if(process.env.GITHUB_OUTPUT)return xe(`OUTPUT`,Se(e,t));process.stdout.write(n.EOL),_e(`set-output`,{name:e},he(t))}function Er(e){process.exitCode=br.Failure,Or(e)}function Dr(){return process.env.RUNNER_DEBUG===`1`}function B(e){_e(`debug`,{},e)}function Or(e,t={}){_e(`error`,ge(t),e instanceof Error?e.toString():e)}function kr(e,t={}){_e(`warning`,ge(t),e instanceof Error?e.toString():e)}function Ar(e){process.stdout.write(e+n.EOL)}function jr(e,t){if(process.env.GITHUB_STATE)return xe(`STATE`,Se(e,t));_e(`save-state`,{name:e},he(t))}function Mr(e){return process.env[`STATE_${e}`]||``}function Nr(e){return e instanceof Error?e.message:String(e)}const Pr=[`token`,`password`,`secret`,`key`,`auth`,`credential`,`bearer`,`apikey`,`api_key`,`access_token`,`refresh_token`,`private`];function Fr(e,t){let n=e.toLowerCase();return t.some(e=>n.includes(e.toLowerCase()))}function Ir(e,t=Pr){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Ir(e,t));let n={};for(let[r,i]of Object.entries(e))Fr(r,t)&&typeof i==`string`?n[r]=`[REDACTED]`:typeof i==`object`&&i?n[r]=Ir(i,t):n[r]=i;return n}function Lr(e,t,n,r){let i=Ir({...n,...r}),a={timestamp:new Date().toISOString(),level:e,message:t,...i};if(r!=null&&`error`in r&&r.error instanceof Error){let e=r.error;a.error={message:e.message,name:e.name,stack:e.stack}}return JSON.stringify(a)}function Rr(e){return{debug:(t,n)=>{B(Lr(`debug`,t,e,n))},info:(t,n)=>{Ar(Lr(`info`,t,e,n))},warning:(t,n)=>{kr(Lr(`warning`,t,e,n))},error:(t,n)=>{Or(Lr(`error`,t,e,n))}}}const zr={SHOULD_SAVE_CACHE:`shouldSaveCache`,SESSION_ID:`sessionId`,CACHE_SAVED:`cacheSaved`,OPENCODE_VERSION:`opencodeVersion`},Br=`sisyphus`,Vr=18e5,Hr={providerID:`opencode`,modelID:`big-pickle`},Ur=`1.3.3`,Wr=`1.3.11`,Gr=`3.14.0`,Kr=`opencode-storage`,qr=`opencode-tools`,Jr=6e5,Yr=`fro-bot-dedup-v1`;function Xr(){let e=t.env.XDG_DATA_HOME;return e!=null&&e.trim().length>0?e:j.join(M.homedir(),`.local`,`share`)}function Zr(){return j.join(Xr(),`opencode`,`storage`)}function Qr(){return j.join(Xr(),`opencode`,`auth.json`)}function $r(){return j.join(Xr(),`opencode`,`log`)}function ei(){let e=t.env.OPENCODE_PROMPT_ARTIFACT;return e===`true`||e===`1`}function ti(){let e=t.env.RUNNER_OS;if(e!=null&&e.trim().length>0)return e;switch(M.platform()){case`darwin`:return`macOS`;case`win32`:return`Windows`;case`aix`:case`android`:case`freebsd`:case`haiku`:case`linux`:case`openbsd`:case`sunos`:case`cygwin`:case`netbsd`:return`Linux`}}function ni(){let e=t.env.GITHUB_REPOSITORY;return e!=null&&e.trim().length>0?e:`unknown/unknown`}function ri(){let e=t.env.GITHUB_REF_NAME;return e!=null&&e.trim().length>0?e:`main`}function ii(){let e=t.env.GITHUB_RUN_ID;return e!=null&&e.trim().length>0?Number(e):0}function ai(){let e=t.env.GITHUB_WORKSPACE;return e!=null&&e.trim().length>0?e:t.cwd()}var oi=I(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),si=I(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),ci=I(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=oi(),a=si();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),li=I(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),ui=I(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:er(t,e)}})),di=I(((e,t)=>{let n=si(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=oi(),{safeRe:a,t:o}=ci(),s=li(),{compareIdentifiers:c}=ui();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&tt.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),fi=I(((e,t)=>{let n=di();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),pi=I(((e,t)=>{let n=fi();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),mi=I(((e,t)=>{let n=fi();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),hi=I(((e,t)=>{let n=di();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),gi=I(((e,t)=>{let n=fi();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),_i=I(((e,t)=>{let n=di();t.exports=(e,t)=>new n(e,t).major})),vi=I(((e,t)=>{let n=di();t.exports=(e,t)=>new n(e,t).minor})),yi=I(((e,t)=>{let n=di();t.exports=(e,t)=>new n(e,t).patch})),bi=I(((e,t)=>{let n=fi();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),xi=I(((e,t)=>{let n=di();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Si=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(t,e,r)})),Ci=I(((e,t)=>{let n=xi();t.exports=(e,t)=>n(e,t,!0)})),wi=I(((e,t)=>{let n=di();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Ti=I(((e,t)=>{let n=wi();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ei=I(((e,t)=>{let n=wi();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Di=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)>0})),Oi=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)<0})),ki=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)===0})),Ai=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)!==0})),ji=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)>=0})),Mi=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)<=0})),Ni=I(((e,t)=>{let n=ki(),r=Ai(),i=Di(),a=ji(),o=Oi(),s=Mi();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),Pi=I(((e,t)=>{let n=di(),r=fi(),{safeRe:i,t:a}=ci();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),Fi=I(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),Ii=I(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,O(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>D(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=E(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>T(e,t)).join(` `)),T=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},E=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),D=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),O=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),k=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Li=I(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=li(),{safeRe:i,t:a}=ci(),o=Ni(),s=si(),c=di(),l=Ii()})),Ri=I(((e,t)=>{let n=Ii();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),zi=I(((e,t)=>{let n=Ii();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Bi=I(((e,t)=>{let n=di(),r=Ii();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),Vi=I(((e,t)=>{let n=di(),r=Ii();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Hi=I(((e,t)=>{let n=di(),r=Ii(),i=Di();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),Ui=I(((e,t)=>{let n=Ii();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),Wi=I(((e,t)=>{let n=di(),r=Li(),{ANY:i}=r,a=Ii(),o=Ri(),s=Di(),c=Oi(),l=Mi(),u=ji();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),Gi=I(((e,t)=>{let n=Wi();t.exports=(e,t,r)=>n(e,t,`>`,r)})),Ki=I(((e,t)=>{let n=Wi();t.exports=(e,t,r)=>n(e,t,`<`,r)})),qi=I(((e,t)=>{let n=Ii();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),Ji=I(((e,t)=>{let n=Ri(),r=xi();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length{let n=Ii(),r=Li(),{ANY:i}=r,a=Ri(),o=xi(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),Xi=I(((e,t)=>{let n=ci(),r=oi(),i=di(),a=ui();t.exports={parse:fi(),valid:pi(),clean:mi(),inc:hi(),diff:gi(),major:_i(),minor:vi(),patch:yi(),prerelease:bi(),compare:xi(),rcompare:Si(),compareLoose:Ci(),compareBuild:wi(),sort:Ti(),rsort:Ei(),gt:Di(),lt:Oi(),eq:ki(),neq:Ai(),gte:ji(),lte:Mi(),cmp:Ni(),coerce:Pi(),Comparator:Li(),Range:Ii(),satisfies:Ri(),toComparators:zi(),maxSatisfying:Bi(),minSatisfying:Vi(),minVersion:Hi(),validRange:Ui(),outside:Wi(),gtr:Gi(),ltr:Ki(),intersects:qi(),simplifyRange:Ji(),subset:Yi(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}));function Zi(e){let t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0,excludeHiddenFiles:!1};return e&&(typeof e.followSymbolicLinks==`boolean`&&(t.followSymbolicLinks=e.followSymbolicLinks,B(`followSymbolicLinks '${t.followSymbolicLinks}'`)),typeof e.implicitDescendants==`boolean`&&(t.implicitDescendants=e.implicitDescendants,B(`implicitDescendants '${t.implicitDescendants}'`)),typeof e.matchDirectories==`boolean`&&(t.matchDirectories=e.matchDirectories,B(`matchDirectories '${t.matchDirectories}'`)),typeof e.omitBrokenSymbolicLinks==`boolean`&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,B(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`)),typeof e.excludeHiddenFiles==`boolean`&&(t.excludeHiddenFiles=e.excludeHiddenFiles,B(`excludeHiddenFiles '${t.excludeHiddenFiles}'`))),t}const Qi=process.platform===`win32`;function $i(e){if(e=ia(e),Qi&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;let t=d.dirname(e);return Qi&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=ia(t)),t}function ea(e,t){if(g(e,`ensureAbsoluteRoot parameter 'root' must not be empty`),g(t,`ensureAbsoluteRoot parameter 'itemPath' must not be empty`),ta(t))return t;if(Qi){if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return g(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),t[0].toUpperCase()===e[0].toUpperCase()?t.length===2?`${t[0]}:\\${e.substr(3)}`:(e.endsWith(`\\`)||(e+=`\\`),`${t[0]}:\\${e.substr(3)}${t.substr(2)}`):`${t[0]}:\\${t.substr(2)}`}else if(ra(t).match(/^\\$|^\\[^\\]/)){let e=process.cwd();return g(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`}}return g(ta(e),`ensureAbsoluteRoot parameter 'root' must have an absolute root`),e.endsWith(`/`)||Qi&&e.endsWith(`\\`)||(e+=d.sep),e+t}function ta(e){return g(e,`hasAbsoluteRoot parameter 'itemPath' must not be empty`),e=ra(e),Qi?e.startsWith(`\\\\`)||/^[A-Z]:\\/i.test(e):e.startsWith(`/`)}function na(e){return g(e,`isRooted parameter 'itemPath' must not be empty`),e=ra(e),Qi?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function ra(e){return e||=``,Qi?(e=e.replace(/\//g,`\\`),(/^\\\\+[^\\]/.test(e)?`\\`:``)+e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function ia(e){return e?(e=ra(e),!e.endsWith(d.sep)||e===d.sep||Qi&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1)):``}var aa;(function(e){e[e.None=0]=`None`,e[e.Directory=1]=`Directory`,e[e.File=2]=`File`,e[e.All=3]=`All`})(aa||={});const oa=process.platform===`win32`;function sa(e){e=e.filter(e=>!e.negate);let t={};for(let n of e){let e=oa?n.searchPath.toUpperCase():n.searchPath;t[e]=`candidate`}let n=[];for(let r of e){let e=oa?r.searchPath.toUpperCase():r.searchPath;if(t[e]===`included`)continue;let i=!1,a=e,o=$i(a);for(;o!==a;){if(t[o]){i=!0;break}a=o,o=$i(a)}i||(n.push(r.searchPath),t[e]=`included`)}return n}function ca(e,t){let n=aa.None;for(let r of e)r.negate?n&=~r.match(t):n|=r.match(t);return n}function la(e,t){return e.some(e=>!e.negate&&e.partialMatch(t))}var ua=I(((e,t)=>{t.exports=function(e,t){for(var r=[],i=0;i{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i=0?c:l;r.length&&(s=[a,o])}return s}})),fa=I(((e,t)=>{var n=ua(),r=da();t.exports=p;var i=`\0SLASH`+Math.random()+`\0`,a=`\0OPEN`+Math.random()+`\0`,o=`\0CLOSE`+Math.random()+`\0`,s=`\0COMMA`+Math.random()+`\0`,c=`\0PERIOD`+Math.random()+`\0`;function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function u(e){return e.split(`\\\\`).join(i).split(`\\{`).join(a).split(`\\}`).join(o).split(`\\,`).join(s).split(`\\.`).join(c)}function d(e){return e.split(i).join(`\\`).split(a).join(`{`).split(o).join(`}`).split(s).join(`,`).split(c).join(`.`)}function f(e){if(!e)return[``];var t=[],n=r(`{`,`}`,e);if(!n)return e.split(`,`);var i=n.pre,a=n.body,o=n.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=f(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function p(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),v(u(e),!0).map(d)):[]}function m(e){return`{`+e+`}`}function h(e){return/^-?0\d/.test(e)}function g(e,t){return e<=t}function _(e,t){return e>=t}function v(e,t){var i=[],a=r(`{`,`}`,e);if(!a||/\$$/.test(a.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),u=s||c,d=a.body.indexOf(`,`)>=0;if(!u&&!d)return a.post.match(/,(?!,).*\}/)?(e=a.pre+`{`+a.body+o+a.post,v(e)):[e];var p;if(u)p=a.body.split(/\.\./);else if(p=f(a.body),p.length===1&&(p=v(p[0],!1).map(m),p.length===1)){var y=a.post.length?v(a.post,!1):[``];return y.map(function(e){return a.pre+p[0]+e})}var b=a.pre,y=a.post.length?v(a.post,!1):[``],x;if(u){var S=l(p[0]),C=l(p[1]),w=Math.max(p[0].length,p[1].length),T=p.length==3?Math.abs(l(p[2])):1,E=g;C0){var j=Array(A+1).join(`0`);k=O<0?`-`+j+k.slice(1):j+k}}x.push(k)}}else x=n(p,function(e){return v(e,!1)});for(var M=0;M{t.exports=h,h.Minimatch=g;var n=function(){try{return L(`path`)}catch{}}()||{sep:`/`};h.sep=n.sep;var r=h.GLOBSTAR=g.GLOBSTAR={},i=fa(),a={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},o=`[^/]`,s=o+`*?`,c=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,l=`(?:(?!(?:\\/|^)\\.).)*?`,u=d(`().*{}+?[]^$\\!`);function d(e){return e.split(``).reduce(function(e,t){return e[t]=!0,e},{})}var f=/\/+/;h.filter=p;function p(e,t){return t||={},function(n,r,i){return h(n,e,t)}}function m(e,t){t||={};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}h.defaults=function(e){if(!e||typeof e!=`object`||!Object.keys(e).length)return h;var t=h,n=function(n,r,i){return t(n,r,m(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,m(e,r))},n.Minimatch.defaults=function(n){return t.defaults(m(e,n)).Minimatch},n.filter=function(n,r){return t.filter(n,m(e,r))},n.defaults=function(n){return t.defaults(m(e,n))},n.makeRe=function(n,r){return t.makeRe(n,m(e,r))},n.braceExpand=function(n,r){return t.braceExpand(n,m(e,r))},n.match=function(n,r,i){return t.match(n,r,m(e,i))},n},g.defaults=function(e){return h.defaults(e).Minimatch};function h(e,t,n){return x(t),n||={},!n.nocomment&&t.charAt(0)===`#`?!1:new g(t,n).match(e)}function g(e,t){if(!(this instanceof g))return new g(e,t);x(e),t||={},e=e.trim(),!t.allowWindowsEscape&&n.sep!==`/`&&(e=e.split(n.sep).join(`/`)),this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion===void 0?200:t.maxGlobstarRecursion,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}g.prototype.debug=function(){},g.prototype.make=_;function _(){var e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(f)}),this.debug(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return e.indexOf(!1)===-1}),this.debug(this.pattern,n),this.set=n}g.prototype.parseNegate=v;function v(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;ib)throw TypeError(`pattern is too long`)};g.prototype.parse=C;var S={};function C(e,t){x(e);var n=this.options;if(e===`**`)if(n.noglobstar)e=`*`;else return r;if(e===``)return``;var i=``,c=!!n.nocase,l=!1,d=[],f=[],p,m=!1,h=-1,g=-1,_=e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,v=this;function y(){if(p){switch(p){case`*`:i+=s,c=!0;break;case`?`:i+=o,c=!0;break;default:i+=`\\`+p;break}v.debug(`clearStateChar %j %j`,p,i),p=!1}}for(var b=0,C=e.length,w;b{let n=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:r}=R(),i=ct();o()===void 0&&a(new i);function a(e){if(!e||typeof e.dispatch!=`function`)throw new r(`Argument agent must implement Agent`);Object.defineProperty(globalThis,n,{value:e,writable:!0,enumerable:!1,configurable:!1})}function o(){return globalThis[n]}t.exports={setGlobalDispatcher:a,getGlobalDispatcher:o}})),Mt=I(((e,t)=>{t.exports=class{#e;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`handler must be an object`);this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}})),Nt=I(((e,t)=>{let n=et();t.exports=e=>{let t=e?.maxRedirections;return e=>function(r,i){let{maxRedirections:a=t,...o}=r;return a?e(o,new n(e,a,r,i)):e(r,i)}}})),Pt=I(((e,t)=>{let n=dt();t.exports=e=>t=>function(r,i){return t(r,new n({...r,retryOptions:{...e,...r.retryOptions}},{handler:i,dispatch:t}))}})),Ft=I(((e,t)=>{let n=z(),{InvalidArgumentError:r,RequestAbortedError:i}=R(),a=Mt();var o=class extends a{#e=1024*1024;#t=null;#n=!1;#r=!1;#i=0;#a=null;#o=null;constructor({maxSize:e},t){if(super(t),e!=null&&(!Number.isFinite(e)||e<1))throw new r(`maxSize must be a number greater than 0`);this.#e=e??this.#e,this.#o=t}onConnect(e){this.#t=e,this.#o.onConnect(this.#s.bind(this))}#s(e){this.#r=!0,this.#a=e}onHeaders(e,t,r,a){let o=n.parseHeaders(t)[`content-length`];if(o!=null&&o>this.#e)throw new i(`Response size (${o}) larger than maxSize (${this.#e})`);return this.#r?!0:this.#o.onHeaders(e,t,r,a)}onError(e){this.#n||(e=this.#a??e,this.#o.onError(e))}onData(e){return this.#i+=e.length,this.#i>=this.#e&&(this.#n=!0,this.#r?this.#o.onError(this.#a):this.#o.onComplete([])),!0}onComplete(e){if(!this.#n){if(this.#r){this.#o.onError(this.reason);return}this.#o.onComplete(e)}}};function s({maxSize:e}={maxSize:1024*1024}){return t=>function(n,r){let{dumpMaxSize:i=e}=n;return t(n,new o({maxSize:i},r))}}t.exports=s})),It=I(((e,t)=>{let{isIP:n}=L(`node:net`),{lookup:r}=L(`node:dns`),i=Mt(),{InvalidArgumentError:a,InformationalError:o}=R(),s=2**31-1;var c=class{#e=0;#t=0;#n=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#i}get full(){return this.#n.size===this.#t}runLookup(e,t,n){let r=this.#n.get(e.hostname);if(r==null&&this.full){n(null,e.origin);return}let i={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(e,i,(t,r)=>{if(t||r==null||r.length===0){n(t??new o(`No DNS entries found`));return}this.setRecords(e,r);let a=this.#n.get(e.hostname),s=this.pick(e,a,i.affinity),c;c=typeof s.port==`number`?`:${s.port}`:e.port===``?``:`:${e.port}`,n(null,`${e.protocol}//${s.family===6?`[${s.address}]`:s.address}${c}`)});else{let a=this.pick(e,r,i.affinity);if(a==null){this.#n.delete(e.hostname),this.runLookup(e,t,n);return}let o;o=typeof a.port==`number`?`:${a.port}`:e.port===``?``:`:${e.port}`,n(null,`${e.protocol}//${a.family===6?`[${a.address}]`:a.address}${o}`)}}#r(e,t,n){r(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:`ipv4first`},(e,t)=>{if(e)return n(e);let r=new Map;for(let e of t)r.set(`${e.address}:${e.family}`,e);n(null,r.values())})}#i(e,t,n){let r=null,{records:i,offset:a}=t,o;if(this.dualStack?(n??(a==null||a===s?(t.offset=0,n=4):(t.offset++,n=(t.offset&1)==1?6:4)),o=i[n]!=null&&i[n].ips.length>0?i[n]:i[n===4?6:4]):o=i[n],o==null||o.ips.length===0)return r;o.offset==null||o.offset===s?o.offset=0:o.offset++;let c=o.offset%o.ips.length;return r=o.ips[c]??null,r==null?r:Date.now()-r.timestamp>r.ttl?(o.ips.splice(c,1),this.pick(e,t,n)):r}setRecords(e,t){let n=Date.now(),r={records:{4:null,6:null}};for(let e of t){e.timestamp=n,typeof e.ttl==`number`?e.ttl=Math.min(e.ttl,this.#e):e.ttl=this.#e;let t=r.records[e.family]??{ips:[]};t.ips.push(e),r.records[e.family]=t}this.#n.set(e.hostname,r)}getHandler(e,t){return new l(this,e,t)}},l=class extends i{#e=null;#t=null;#n=null;#r=null;#i=null;constructor(e,{origin:t,handler:n,dispatch:r},i){super(n),this.#i=t,this.#r=n,this.#t={...i},this.#e=e,this.#n=r}onError(e){switch(e.code){case`ETIMEDOUT`:case`ECONNREFUSED`:if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(e,t)=>{if(e)return this.#r.onError(e);let n={...this.#t,origin:t};this.#n(n,this)});return}this.#r.onError(e);return;case`ENOTFOUND`:this.#e.deleteRecord(this.#i);default:this.#r.onError(e);break}}};t.exports=e=>{if(e?.maxTTL!=null&&(typeof e?.maxTTL!=`number`||e?.maxTTL<0))throw new a(`Invalid maxTTL. Must be a positive number`);if(e?.maxItems!=null&&(typeof e?.maxItems!=`number`||e?.maxItems<1))throw new a(`Invalid maxItems. Must be a positive number and greater than zero`);if(e?.affinity!=null&&e?.affinity!==4&&e?.affinity!==6)throw new a(`Invalid affinity. Must be either 4 or 6`);if(e?.dualStack!=null&&typeof e?.dualStack!=`boolean`)throw new a(`Invalid dualStack. Must be a boolean`);if(e?.lookup!=null&&typeof e?.lookup!=`function`)throw new a(`Invalid lookup. Must be a function`);if(e?.pick!=null&&typeof e?.pick!=`function`)throw new a(`Invalid pick. Must be a function`);let t=e?.dualStack??!0,r;r=t?e?.affinity??null:e?.affinity??4;let i=new c({maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:r,maxItems:e?.maxItems??1/0});return e=>function(t,r){let a=t.origin.constructor===URL?t.origin:new URL(t.origin);return n(a.hostname)===0?(i.runLookup(a,t,(n,o)=>{if(n)return r.onError(n);let s=null;s={...t,servername:a.hostname,origin:o,headers:{host:a.hostname,...t.headers}},e(s,i.getHandler({origin:a,dispatch:e,handler:r},t))}),!0):e(t,r)}}})),Lt=I(((e,t)=>{let{kConstruct:n}=ke(),{kEnumerableProperty:r}=z(),{iteratorMixin:i,isValidHeaderName:a,isValidHeaderValue:o}=Ke(),{webidl:s}=Ge(),c=L(`node:assert`),l=L(`node:util`),u=Symbol(`headers map`),d=Symbol(`headers map sorted`);function f(e){return e===10||e===13||e===9||e===32}function p(e){let t=0,n=e.length;for(;n>t&&f(e.charCodeAt(n-1));)--n;for(;n>t&&f(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function m(e,t){if(Array.isArray(t))for(let n=0;n>`,`record`]})}function h(e,t,n){if(n=p(n),!a(t))throw s.errors.invalidArgument({prefix:`Headers.append`,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:`Headers.append`,value:n,type:`header value`});if(y(e)===`immutable`)throw TypeError(`immutable`);return x(e).append(t,n,!1)}function g(e,t){return e[0]>1),t[s][0]<=l[0]?o=s+1:a=s;if(r!==s){for(i=r;i>o;)t[i]=t[--i];t[o]=l}}if(!n.next().done)throw TypeError(`Unreachable`);return t}else{let e=0;for(let{0:n,1:{value:r}}of this[u])t[e++]=[n,r],c(r!==null);return t.sort(g)}}},v=class e{#e;#t;constructor(e=void 0){s.util.markAsUncloneable(this),e!==n&&(this.#t=new _,this.#e=`none`,e!==void 0&&(e=s.converters.HeadersInit(e,`Headers contructor`,`init`),m(this,e)))}append(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.append`);let r=`Headers.append`;return t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),h(this,t,n)}delete(t){if(s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.delete`),t=s.converters.ByteString(t,`Headers.delete`,`name`),!a(t))throw s.errors.invalidArgument({prefix:`Headers.delete`,value:t,type:`header name`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.contains(t,!1)&&this.#t.delete(t,!1)}get(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.get`);let n=`Headers.get`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.get(t,!1)}has(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.has`);let n=`Headers.has`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.contains(t,!1)}set(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.set`);let r=`Headers.set`;if(t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),n=p(n),!a(t))throw s.errors.invalidArgument({prefix:r,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:r,value:n,type:`header value`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.set(t,n,!1)}getSetCookie(){s.brandCheck(this,e);let t=this.#t.cookies;return t?[...t]:[]}get[d](){if(this.#t[d])return this.#t[d];let e=[],t=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[d]=t;for(let r=0;r>`](e,t,n,r.bind(e)):s.converters[`record`](e,t,n)}throw s.errors.conversionFailed({prefix:`Headers constructor`,argument:`Argument 1`,types:[`sequence>`,`record`]})},t.exports={fill:m,compareHeaderName:g,Headers:v,HeadersList:_,getHeadersGuard:y,setHeadersGuard:b,setHeadersList:S,getHeadersList:x}})),Rt=I(((e,t)=>{let{Headers:n,HeadersList:r,fill:i,getHeadersGuard:a,setHeadersGuard:o,setHeadersList:s}=Lt(),{extractBody:c,cloneBody:l,mixinBody:u,hasFinalizationRegistry:d,streamRegistry:f,bodyUnusable:p}=Ze(),m=z(),h=L(`node:util`),{kEnumerableProperty:g}=m,{isValidReasonPhrase:_,isCancelled:v,isAborted:y,isBlobLike:b,serializeJavascriptValueToJSONString:x,isErrorLike:S,isomorphicEncode:C,environmentSettingsObject:w}=Ke(),{redirectStatusSet:T,nullBodyStatus:E}=He(),{kState:D,kHeaders:O}=qe(),{webidl:k}=Ge(),{FormData:A}=Ye(),{URLSerializer:j}=We(),{kConstruct:M}=ke(),N=L(`node:assert`),{types:P}=L(`node:util`),ee=new TextEncoder(`utf-8`);var te=class e{static error(){return le(re(),`immutable`)}static json(e,t={}){k.argumentLengthCheck(arguments,1,`Response.json`),t!==null&&(t=k.converters.ResponseInit(t));let n=c(ee.encode(x(e))),r=le(F({}),`response`);return ce(r,t,{body:n[0],type:`application/json`}),r}static redirect(e,t=302){k.argumentLengthCheck(arguments,1,`Response.redirect`),e=k.converters.USVString(e),t=k.converters[`unsigned short`](t);let n;try{n=new URL(e,w.settingsObject.baseUrl)}catch(t){throw TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!T.has(t))throw RangeError(`Invalid status code ${t}`);let r=le(F({}),`immutable`);r[D].status=t;let i=C(j(n));return r[D].headersList.append(`location`,i,!0),r}constructor(e=null,t={}){if(k.util.markAsUncloneable(this),e===M)return;e!==null&&(e=k.converters.BodyInit(e)),t=k.converters.ResponseInit(t),this[D]=F({}),this[O]=new n(M),o(this[O],`response`),s(this[O],this[D].headersList);let r=null;if(e!=null){let[t,n]=c(e);r={body:t,type:n}}ce(this,t,r)}get type(){return k.brandCheck(this,e),this[D].type}get url(){k.brandCheck(this,e);let t=this[D].urlList,n=t[t.length-1]??null;return n===null?``:j(n,!0)}get redirected(){return k.brandCheck(this,e),this[D].urlList.length>1}get status(){return k.brandCheck(this,e),this[D].status}get ok(){return k.brandCheck(this,e),this[D].status>=200&&this[D].status<=299}get statusText(){return k.brandCheck(this,e),this[D].statusText}get headers(){return k.brandCheck(this,e),this[O]}get body(){return k.brandCheck(this,e),this[D].body?this[D].body.stream:null}get bodyUsed(){return k.brandCheck(this,e),!!this[D].body&&m.isDisturbed(this[D].body.stream)}clone(){if(k.brandCheck(this,e),p(this))throw k.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let t=ne(this[D]);return d&&this[D].body?.stream&&f.register(this,new WeakRef(this[D].body.stream)),le(t,a(this[O]))}[h.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${h.formatWithOptions(t,n)}`}};u(te),Object.defineProperties(te.prototype,{type:g,url:g,status:g,ok:g,redirected:g,statusText:g,headers:g,clone:g,body:g,bodyUsed:g,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(te,{json:g,redirect:g,error:g});function ne(e){if(e.internalResponse)return oe(ne(e.internalResponse),e.type);let t=F({...e,body:null});return e.body!=null&&(t.body=l(t,e.body)),t}function F(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:`default`,status:200,timingInfo:null,cacheState:``,statusText:``,...e,headersList:e?.headersList?new r(e?.headersList):new r,urlList:e?.urlList?[...e.urlList]:[]}}function re(e){return F({type:`error`,status:0,error:S(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function ie(e){return e.type===`error`&&e.status===0}function ae(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(e,n){return n in t?t[n]:e[n]},set(e,n,r){return N(!(n in t)),e[n]=r,!0}})}function oe(e,t){if(t===`basic`)return ae(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return ae(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return ae(e,{type:`opaque`,urlList:Object.freeze([]),status:0,statusText:``,body:null});if(t===`opaqueredirect`)return ae(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});N(!1)}function se(e,t=null){return N(v(e)),y(e)?re(Object.assign(new DOMException(`The operation was aborted.`,`AbortError`),{cause:t})):re(Object.assign(new DOMException(`Request was cancelled.`),{cause:t}))}function ce(e,t,n){if(t.status!==null&&(t.status<200||t.status>599))throw RangeError(`init["status"] must be in the range of 200 to 599, inclusive.`);if(`statusText`in t&&t.statusText!=null&&!_(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(e[D].status=t.status),`statusText`in t&&t.statusText!=null&&(e[D].statusText=t.statusText),`headers`in t&&t.headers!=null&&i(e[O],t.headers),n){if(E.includes(e.status))throw k.errors.exception({header:`Response constructor`,message:`Invalid response status code ${e.status}`});e[D].body=n.body,n.type!=null&&!e[D].headersList.contains(`content-type`,!0)&&e[D].headersList.append(`content-type`,n.type,!0)}}function le(e,t){let r=new te(M);return r[D]=e,r[O]=new n(M),s(r[O],e.headersList),o(r[O],t),d&&e.body?.stream&&f.register(r,new WeakRef(e.body.stream)),r}k.converters.ReadableStream=k.interfaceConverter(ReadableStream),k.converters.FormData=k.interfaceConverter(A),k.converters.URLSearchParams=k.interfaceConverter(URLSearchParams),k.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e==`string`?k.converters.USVString(e,t,n):b(e)?k.converters.Blob(e,t,n,{strict:!1}):ArrayBuffer.isView(e)||P.isArrayBuffer(e)?k.converters.BufferSource(e,t,n):m.isFormDataLike(e)?k.converters.FormData(e,t,n,{strict:!1}):e instanceof URLSearchParams?k.converters.URLSearchParams(e,t,n):k.converters.DOMString(e,t,n)},k.converters.BodyInit=function(e,t,n){return e instanceof ReadableStream?k.converters.ReadableStream(e,t,n):e?.[Symbol.asyncIterator]?e:k.converters.XMLHttpRequestBodyInit(e,t,n)},k.converters.ResponseInit=k.dictionaryConverter([{key:`status`,converter:k.converters[`unsigned short`],defaultValue:()=>200},{key:`statusText`,converter:k.converters.ByteString,defaultValue:()=>``},{key:`headers`,converter:k.converters.HeadersInit}]),t.exports={isNetworkError:ie,makeNetworkError:re,makeResponse:F,makeAppropriateNetworkError:se,filterResponse:oe,Response:te,cloneResponse:ne,fromInnerResponse:le}})),zt=I(((e,t)=>{let{kConnected:n,kSize:r}=ke();var i=class{constructor(e){this.value=e}deref(){return this.value[n]===0&&this.value[r]===0?void 0:this.value}},a=class{constructor(e){this.finalizer=e}register(e,t){e.on&&e.on(`disconnect`,()=>{e[n]===0&&e[r]===0&&this.finalizer(t)})}unregister(e){}};t.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith(`v18`)?(process._rawDebug(`Using compatibility WeakRef and FinalizationRegistry`),{WeakRef:i,FinalizationRegistry:a}):{WeakRef,FinalizationRegistry}}})),Bt=I(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i,bodyUnusable:a}=Ze(),{Headers:o,fill:s,HeadersList:c,setHeadersGuard:l,getHeadersGuard:u,setHeadersList:d,getHeadersList:f}=Lt(),{FinalizationRegistry:p}=zt()(),m=z(),h=L(`node:util`),{isValidHTTPToken:g,sameOrigin:_,environmentSettingsObject:v}=Ke(),{forbiddenMethodsSet:y,corsSafeListedMethodsSet:b,referrerPolicy:x,requestRedirect:S,requestMode:C,requestCredentials:w,requestCache:T,requestDuplex:E}=He(),{kEnumerableProperty:D,normalizedMethodRecordsBase:O,normalizedMethodRecords:k}=m,{kHeaders:A,kSignal:j,kState:M,kDispatcher:N}=qe(),{webidl:P}=Ge(),{URLSerializer:ee}=We(),{kConstruct:te}=ke(),ne=L(`node:assert`),{getMaxListeners:F,setMaxListeners:re,getEventListeners:ie,defaultMaxListeners:ae}=L(`node:events`),oe=Symbol(`abortController`),se=new p(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)}),ce=new WeakMap;function le(e){return t;function t(){let n=e.deref();if(n!==void 0){se.unregister(t),this.removeEventListener(`abort`,t),n.abort(this.reason);let e=ce.get(n.signal);if(e!==void 0){if(e.size!==0){for(let t of e){let e=t.deref();e!==void 0&&e.abort(this.reason)}e.clear()}ce.delete(n.signal)}}}}let ue=!1;var de=class e{constructor(t,r={}){if(P.util.markAsUncloneable(this),t===te)return;let i=`Request constructor`;P.argumentLengthCheck(arguments,1,i),t=P.converters.RequestInfo(t,i,`input`),r=P.converters.RequestInit(r,i,`init`);let u=null,p=null,h=v.settingsObject.baseUrl,x=null;if(typeof t==`string`){this[N]=r.dispatcher;let e;try{e=new URL(t,h)}catch(e){throw TypeError(`Failed to parse URL from `+t,{cause:e})}if(e.username||e.password)throw TypeError(`Request cannot be constructed from a URL that includes credentials: `+t);u=I({urlList:[e]}),p=`cors`}else this[N]=r.dispatcher||t[N],ne(t instanceof e),u=t[M],x=t[j];let S=v.settingsObject.origin,C=`client`;if(u.window?.constructor?.name===`EnvironmentSettingsObject`&&_(u.window,S)&&(C=u.window),r.window!=null)throw TypeError(`'window' option '${C}' must be null`);`window`in r&&(C=`no-window`),u=I({method:u.method,headersList:u.headersList,unsafeRequest:u.unsafeRequest,client:v.settingsObject,window:C,priority:u.priority,origin:u.origin,referrer:u.referrer,referrerPolicy:u.referrerPolicy,mode:u.mode,credentials:u.credentials,cache:u.cache,redirect:u.redirect,integrity:u.integrity,keepalive:u.keepalive,reloadNavigation:u.reloadNavigation,historyNavigation:u.historyNavigation,urlList:[...u.urlList]});let w=Object.keys(r).length!==0;if(w&&(u.mode===`navigate`&&(u.mode=`same-origin`),u.reloadNavigation=!1,u.historyNavigation=!1,u.origin=`client`,u.referrer=`client`,u.referrerPolicy=``,u.url=u.urlList[u.urlList.length-1],u.urlList=[u.url]),r.referrer!==void 0){let e=r.referrer;if(e===``)u.referrer=`no-referrer`;else{let t;try{t=new URL(e,h)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||S&&!_(t,v.settingsObject.baseUrl)?u.referrer=`client`:u.referrer=t}}r.referrerPolicy!==void 0&&(u.referrerPolicy=r.referrerPolicy);let T;if(T=r.mode===void 0?p:r.mode,T===`navigate`)throw P.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(T!=null&&(u.mode=T),r.credentials!==void 0&&(u.credentials=r.credentials),r.cache!==void 0&&(u.cache=r.cache),u.cache===`only-if-cached`&&u.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(r.redirect!==void 0&&(u.redirect=r.redirect),r.integrity!=null&&(u.integrity=String(r.integrity)),r.keepalive!==void 0&&(u.keepalive=!!r.keepalive),r.method!==void 0){let e=r.method,t=k[e];if(t!==void 0)u.method=t;else{if(!g(e))throw TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(y.has(t))throw TypeError(`'${e}' HTTP method is unsupported.`);e=O[t]??e,u.method=e}!ue&&u.method===`patch`&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:`UNDICI-FETCH-patch`}),ue=!0)}r.signal!==void 0&&(x=r.signal),this[M]=u;let E=new AbortController;if(this[j]=E.signal,x!=null){if(!x||typeof x.aborted!=`boolean`||typeof x.addEventListener!=`function`)throw TypeError(`Failed to construct 'Request': member signal is not of type AbortSignal.`);if(x.aborted)E.abort(x.reason);else{this[oe]=E;let e=le(new WeakRef(E));try{(typeof F==`function`&&F(x)===ae||ie(x,`abort`).length>=ae)&&re(1500,x)}catch{}m.addAbortListener(x,e),se.register(E,{signal:x,abort:e},e)}}if(this[A]=new o(te),d(this[A],u.headersList),l(this[A],`request`),T===`no-cors`){if(!b.has(u.method))throw TypeError(`'${u.method} is unsupported in no-cors mode.`);l(this[A],`request-no-cors`)}if(w){let e=f(this[A]),t=r.headers===void 0?new c(e):r.headers;if(e.clear(),t instanceof c){for(let{name:n,value:r}of t.rawValues())e.append(n,r,!1);e.cookies=t.cookies}else s(this[A],t)}let D=t instanceof e?t[M].body:null;if((r.body!=null||D!=null)&&(u.method===`GET`||u.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let ee=null;if(r.body!=null){let[e,t]=n(r.body,u.keepalive);ee=e,t&&!f(this[A]).contains(`content-type`,!0)&&this[A].append(`content-type`,t)}let ce=ee??D;if(ce!=null&&ce.source==null){if(ee!=null&&r.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(u.mode!==`same-origin`&&u.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);u.useCORSPreflightFlag=!0}let de=ce;if(ee==null&&D!=null){if(a(t))throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);let e=new TransformStream;D.stream.pipeThrough(e),de={source:D.source,length:D.length,stream:e.readable}}this[M].body=de}get method(){return P.brandCheck(this,e),this[M].method}get url(){return P.brandCheck(this,e),ee(this[M].url)}get headers(){return P.brandCheck(this,e),this[A]}get destination(){return P.brandCheck(this,e),this[M].destination}get referrer(){return P.brandCheck(this,e),this[M].referrer===`no-referrer`?``:this[M].referrer===`client`?`about:client`:this[M].referrer.toString()}get referrerPolicy(){return P.brandCheck(this,e),this[M].referrerPolicy}get mode(){return P.brandCheck(this,e),this[M].mode}get credentials(){return this[M].credentials}get cache(){return P.brandCheck(this,e),this[M].cache}get redirect(){return P.brandCheck(this,e),this[M].redirect}get integrity(){return P.brandCheck(this,e),this[M].integrity}get keepalive(){return P.brandCheck(this,e),this[M].keepalive}get isReloadNavigation(){return P.brandCheck(this,e),this[M].reloadNavigation}get isHistoryNavigation(){return P.brandCheck(this,e),this[M].historyNavigation}get signal(){return P.brandCheck(this,e),this[j]}get body(){return P.brandCheck(this,e),this[M].body?this[M].body.stream:null}get bodyUsed(){return P.brandCheck(this,e),!!this[M].body&&m.isDisturbed(this[M].body.stream)}get duplex(){return P.brandCheck(this,e),`half`}clone(){if(P.brandCheck(this,e),a(this))throw TypeError(`unusable`);let t=fe(this[M]),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let e=ce.get(this.signal);e===void 0&&(e=new Set,ce.set(this.signal,e));let t=new WeakRef(n);e.add(t),m.addAbortListener(n.signal,le(t))}return pe(t,n.signal,u(this[A]))}[h.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${h.formatWithOptions(t,n)}`}};r(de);function I(e){return{method:e.method??`GET`,localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??``,window:e.window??`client`,keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??`all`,initiator:e.initiator??``,destination:e.destination??``,priority:e.priority??null,origin:e.origin??`client`,policyContainer:e.policyContainer??`client`,referrer:e.referrer??`client`,referrerPolicy:e.referrerPolicy??``,mode:e.mode??`no-cors`,useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??`same-origin`,useCredentials:e.useCredentials??!1,cache:e.cache??`default`,redirect:e.redirect??`follow`,integrity:e.integrity??``,cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??``,parserMetadata:e.parserMetadata??``,reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??`basic`,preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new c(e.headersList):new c}}function fe(e){let t=I({...e,body:null});return e.body!=null&&(t.body=i(t,e.body)),t}function pe(e,t,n){let r=new de(te);return r[M]=e,r[j]=t,r[A]=new o(te),d(r[A],e.headersList),l(r[A],n),r}Object.defineProperties(de.prototype,{method:D,url:D,headers:D,redirect:D,clone:D,signal:D,duplex:D,destination:D,body:D,bodyUsed:D,isHistoryNavigation:D,isReloadNavigation:D,keepalive:D,integrity:D,cache:D,credentials:D,attribute:D,referrerPolicy:D,referrer:D,mode:D,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),P.converters.Request=P.interfaceConverter(de),P.converters.RequestInfo=function(e,t,n){return typeof e==`string`?P.converters.USVString(e,t,n):e instanceof de?P.converters.Request(e,t,n):P.converters.USVString(e,t,n)},P.converters.AbortSignal=P.interfaceConverter(AbortSignal),P.converters.RequestInit=P.dictionaryConverter([{key:`method`,converter:P.converters.ByteString},{key:`headers`,converter:P.converters.HeadersInit},{key:`body`,converter:P.nullableConverter(P.converters.BodyInit)},{key:`referrer`,converter:P.converters.USVString},{key:`referrerPolicy`,converter:P.converters.DOMString,allowedValues:x},{key:`mode`,converter:P.converters.DOMString,allowedValues:C},{key:`credentials`,converter:P.converters.DOMString,allowedValues:w},{key:`cache`,converter:P.converters.DOMString,allowedValues:T},{key:`redirect`,converter:P.converters.DOMString,allowedValues:S},{key:`integrity`,converter:P.converters.DOMString},{key:`keepalive`,converter:P.converters.boolean},{key:`signal`,converter:P.nullableConverter(e=>P.converters.AbortSignal(e,`RequestInit`,`signal`,{strict:!1}))},{key:`window`,converter:P.converters.any},{key:`duplex`,converter:P.converters.DOMString,allowedValues:E},{key:`dispatcher`,converter:P.converters.any}]),t.exports={Request:de,makeRequest:I,fromInnerRequest:pe,cloneRequest:fe}})),Vt=I(((e,t)=>{let{makeNetworkError:n,makeAppropriateNetworkError:r,filterResponse:i,makeResponse:a,fromInnerResponse:o}=Rt(),{HeadersList:s}=Lt(),{Request:c,cloneRequest:l}=Bt(),u=L(`node:zlib`),{bytesMatch:d,makePolicyContainer:f,clonePolicyContainer:p,requestBadPort:m,TAOCheck:h,appendRequestOriginHeader:g,responseLocationURL:_,requestCurrentURL:v,setRequestReferrerPolicyOnRedirect:y,tryUpgradeRequestToAPotentiallyTrustworthyURL:b,createOpaqueTimingInfo:x,appendFetchMetadata:S,corsCheck:C,crossOriginResourcePolicyCheck:w,determineRequestsReferrer:T,coarsenedSharedCurrentTime:E,createDeferredPromise:D,isBlobLike:O,sameOrigin:k,isCancelled:A,isAborted:j,isErrorLike:M,fullyReadBody:N,readableStreamClose:P,isomorphicEncode:ee,urlIsLocal:te,urlIsHttpHttpsScheme:ne,urlHasHttpsScheme:F,clampAndCoarsenConnectionTimingInfo:re,simpleRangeHeaderValue:ie,buildContentRange:ae,createInflate:oe,extractMimeType:se}=Ke(),{kState:ce,kDispatcher:le}=qe(),ue=L(`node:assert`),{safelyExtractBody:de,extractBody:I}=Ze(),{redirectStatusSet:fe,nullBodyStatus:pe,safeMethodsSet:me,requestBodyHeader:he,subresourceSet:ge}=He(),_e=L(`node:events`),{Readable:ve,pipeline:ye,finished:be}=L(`node:stream`),{addAbortListener:xe,isErrored:Se,isReadable:Ce,bufferToLowerCasedHeaderName:we}=z(),{dataURLProcessor:Te,serializeAMimeType:Ee,minimizeSupportedMimeType:De}=We(),{getGlobalDispatcher:Oe}=jt(),{webidl:ke}=Ge(),{STATUS_CODES:R}=L(`node:http`),Ae=[`GET`,`HEAD`],je=typeof __UNDICI_IS_NODE__<`u`||typeof esbuildDetection<`u`?`node`:`undici`,Me;var Ne=class extends _e{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state=`ongoing`}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||=new DOMException(`The operation was aborted.`,`AbortError`),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit(`terminated`,e))}};function Pe(e){Ie(e,`fetch`)}function Fe(e,t=void 0){ke.argumentLengthCheck(arguments,1,`globalThis.fetch`);let n=D(),r;try{r=new c(e,t)}catch(e){return n.reject(e),n.promise}let i=r[ce];if(r.signal.aborted)return Re(n,i,null,r.signal.reason),n.promise;i.client.globalObject?.constructor?.name===`ServiceWorkerGlobalScope`&&(i.serviceWorkers=`none`);let a=null,s=!1,l=null;return xe(r.signal,()=>{s=!0,ue(l!=null),l.abort(r.signal.reason);let e=a?.deref();Re(n,i,e,r.signal.reason)}),l=ze({request:i,processResponseEndOfBody:Pe,processResponse:e=>{if(!s){if(e.aborted){Re(n,i,a,l.serializedAbortReason);return}if(e.type===`error`){n.reject(TypeError(`fetch failed`,{cause:e.error}));return}a=new WeakRef(o(e,`immutable`)),n.resolve(a.deref()),n=null}},dispatcher:r[le]}),n.promise}function Ie(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;ne(n)&&r!==null&&(e.timingAllowPassed||(r=x({startTime:r.startTime}),i=``),r.endTime=E(),e.timingInfo=r,Le(r,n.href,t,globalThis,i))}let Le=performance.markResourceTiming;function Re(e,t,n,r){if(e&&e.reject(r),t.body!=null&&Ce(t.body?.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let i=n[ce];i.body!=null&&Ce(i.body?.stream)&&i.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e})}function ze({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s=Oe()}){ue(s);let c=null,l=!1;e.client!=null&&(c=e.client.globalObject,l=e.client.crossOriginIsolatedCapability);let u=x({startTime:E(l)}),d={controller:new Ne(s),request:e,timingInfo:u,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:l};return ue(!e.body||e.body.stream),e.window===`client`&&(e.window=e.client?.globalObject?.constructor?.name===`Window`?e.client:`no-window`),e.origin===`client`&&(e.origin=e.client.origin),e.policyContainer===`client`&&(e.client==null?e.policyContainer=f():e.policyContainer=p(e.client.policyContainer)),e.headersList.contains(`accept`,!0)||e.headersList.append(`accept`,`*/*`,!0),e.headersList.contains(`accept-language`,!0)||e.headersList.append(`accept-language`,`*`,!0),e.priority,ge.has(e.destination),Be(d).catch(e=>{d.controller.terminate(e)}),d.controller}async function Be(e,t=!1){let r=e.request,a=null;if(r.localURLsOnly&&!te(v(r))&&(a=n(`local URLs only`)),b(r),m(r)===`blocked`&&(a=n(`bad port`)),r.referrerPolicy===``&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!==`no-referrer`&&(r.referrer=T(r)),a===null&&(a=await(async()=>{let t=v(r);return k(t,r.url)&&r.responseTainting===`basic`||t.protocol===`data:`||r.mode===`navigate`||r.mode===`websocket`?(r.responseTainting=`basic`,await Ve(e)):r.mode===`same-origin`?n(`request mode cannot be "same-origin"`):r.mode===`no-cors`?r.redirect===`follow`?(r.responseTainting=`opaque`,await Ve(e)):n(`redirect mode cannot be "follow" for "no-cors" request`):ne(v(r))?(r.responseTainting=`cors`,await Ye(e)):n(`URL scheme must be a HTTP(S) scheme`)})()),t)return a;a.status!==0&&!a.internalResponse&&(r.responseTainting,r.responseTainting===`basic`?a=i(a,`basic`):r.responseTainting===`cors`?a=i(a,`cors`):r.responseTainting===`opaque`?a=i(a,`opaque`):ue(!1));let o=a.status===0?a:a.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(a.timingAllowPassed=!0),a.type===`opaque`&&o.status===206&&o.rangeRequested&&!r.headers.contains(`range`,!0)&&(a=o=n()),a.status!==0&&(r.method===`HEAD`||r.method===`CONNECT`||pe.includes(o.status))&&(o.body=null,e.controller.dump=!0),r.integrity){let t=t=>Je(e,n(t));if(r.responseTainting===`opaque`||a.body==null){t(a.error);return}await N(a.body,n=>{if(!d(n,r.integrity)){t(`integrity mismatch`);return}a.body=de(n)[0],Je(e,a)},t)}else Je(e,a)}function Ve(e){if(A(e)&&e.request.redirectCount===0)return Promise.resolve(r(e));let{request:t}=e,{protocol:i}=v(t);switch(i){case`about:`:return Promise.resolve(n(`about scheme is not supported`));case`blob:`:{Me||=L(`node:buffer`).resolveObjectURL;let e=v(t);if(e.search.length!==0)return Promise.resolve(n(`NetworkError when attempting to fetch resource.`));let r=Me(e.toString());if(t.method!==`GET`||!O(r))return Promise.resolve(n(`invalid method`));let i=a(),o=r.size,s=ee(`${o}`),c=r.type;if(t.headersList.contains(`range`,!0)){i.rangeRequested=!0;let e=ie(t.headersList.get(`range`,!0),!0);if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let{rangeStartValue:a,rangeEndValue:s}=e;if(a===null)a=o-s,s=a+s-1;else{if(a>=o)return Promise.resolve(n(`Range start is greater than the blob's size.`));(s===null||s>=o)&&(s=o-1)}let l=r.slice(a,s,c);i.body=I(l)[0];let u=ee(`${l.size}`),d=ae(a,s,o);i.status=206,i.statusText=`Partial Content`,i.headersList.set(`content-length`,u,!0),i.headersList.set(`content-type`,c,!0),i.headersList.set(`content-range`,d,!0)}else{let e=I(r);i.statusText=`OK`,i.body=e[0],i.headersList.set(`content-length`,s,!0),i.headersList.set(`content-type`,c,!0)}return Promise.resolve(i)}case`data:`:{let e=Te(v(t));if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let r=Ee(e.mimeType);return Promise.resolve(a({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:r}]],body:de(e.body)[0]}))}case`file:`:return Promise.resolve(n(`not implemented... yet...`));case`http:`:case`https:`:return Ye(e).catch(e=>n(e));default:return Promise.resolve(n(`unknown scheme`))}}function Ue(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function Je(e,t){let n=e.timingInfo,r=()=>{let r=Date.now();e.request.destination===`document`&&(e.controller.fullTimingInfo=n),e.controller.reportTimingSteps=()=>{if(e.request.url.protocol!==`https:`)return;n.endTime=r;let i=t.cacheState,a=t.bodyInfo;t.timingAllowPassed||(n=x(n),i=``);let o=0;if(e.request.mode!==`navigator`||!t.hasCrossOriginRedirects){o=t.status;let e=se(t.headersList);e!==`failure`&&(a.contentType=De(e))}e.request.initiatorType!=null&&Le(n,e.request.url.href,e.request.initiatorType,globalThis,i,a,o)};let i=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>i())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let i=t.type===`error`?t:t.internalResponse??t;i.body==null?r():be(i.body.stream,()=>{r()})}async function Ye(e){let t=e.request,r=null,i=null,a=e.timingInfo;if(t.serviceWorkers,r===null){if(t.redirect===`follow`&&(t.serviceWorkers=`none`),i=r=await Qe(e),t.responseTainting===`cors`&&C(t,r)===`failure`)return n(`cors failure`);h(t,r)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||r.type===`opaque`)&&w(t.origin,t.client,t.destination,i)===`blocked`?n(`blocked`):(fe.has(i.status)&&(t.redirect!==`manual`&&e.controller.connection.destroy(void 0,!1),t.redirect===`error`?r=n(`unexpected redirect`):t.redirect===`manual`?r=i:t.redirect===`follow`?r=await Xe(e,r):ue(!1)),r.timingInfo=a,r)}function Xe(e,t){let r=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=_(i,v(r).hash),a==null)return t}catch(e){return Promise.resolve(n(e))}if(!ne(a))return Promise.resolve(n(`URL scheme must be a HTTP(S) scheme`));if(r.redirectCount===20)return Promise.resolve(n(`redirect count exceeded`));if(r.redirectCount+=1,r.mode===`cors`&&(a.username||a.password)&&!k(r,a))return Promise.resolve(n(`cross origin not allowed for request mode "cors"`));if(r.responseTainting===`cors`&&(a.username||a.password))return Promise.resolve(n(`URL cannot contain credentials for request mode "cors"`));if(i.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(n());if([301,302].includes(i.status)&&r.method===`POST`||i.status===303&&!Ae.includes(r.method)){r.method=`GET`,r.body=null;for(let e of he)r.headersList.delete(e)}k(v(r),a)||(r.headersList.delete(`authorization`,!0),r.headersList.delete(`proxy-authorization`,!0),r.headersList.delete(`cookie`,!0),r.headersList.delete(`host`,!0)),r.body!=null&&(ue(r.body.source!=null),r.body=de(r.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=E(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),r.urlList.push(a),y(r,i),Be(e,!0)}async function Qe(e,t=!1,i=!1){let a=e.request,o=null,s=null,c=null;a.window===`no-window`&&a.redirect===`error`?(o=e,s=a):(s=l(a),o={...e},o.request=s);let u=a.credentials===`include`||a.credentials===`same-origin`&&a.responseTainting===`basic`,d=s.body?s.body.length:null,f=null;if(s.body==null&&[`POST`,`PUT`].includes(s.method)&&(f=`0`),d!=null&&(f=ee(`${d}`)),f!=null&&s.headersList.append(`content-length`,f,!0),d!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append(`referer`,ee(s.referrer.href),!0),g(s),S(s),s.headersList.contains(`user-agent`,!0)||s.headersList.append(`user-agent`,je),s.cache===`default`&&(s.headersList.contains(`if-modified-since`,!0)||s.headersList.contains(`if-none-match`,!0)||s.headersList.contains(`if-unmodified-since`,!0)||s.headersList.contains(`if-match`,!0)||s.headersList.contains(`if-range`,!0))&&(s.cache=`no-store`),s.cache===`no-cache`&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains(`cache-control`,!0)&&s.headersList.append(`cache-control`,`max-age=0`,!0),(s.cache===`no-store`||s.cache===`reload`)&&(s.headersList.contains(`pragma`,!0)||s.headersList.append(`pragma`,`no-cache`,!0),s.headersList.contains(`cache-control`,!0)||s.headersList.append(`cache-control`,`no-cache`,!0)),s.headersList.contains(`range`,!0)&&s.headersList.append(`accept-encoding`,`identity`,!0),s.headersList.contains(`accept-encoding`,!0)||(F(v(s))?s.headersList.append(`accept-encoding`,`br, gzip, deflate`,!0):s.headersList.append(`accept-encoding`,`gzip, deflate`,!0)),s.headersList.delete(`host`,!0),s.cache=`no-store`,s.cache!==`no-store`&&s.cache,c==null){if(s.cache===`only-if-cached`)return n(`only if cached`);let e=await $e(o,u,i);!me.has(s.method)&&e.status>=200&&e.status,c??=e}if(c.urlList=[...s.urlList],s.headersList.contains(`range`,!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=u,c.status===407)return a.window===`no-window`?n():A(e)?r(e):n(`proxy authentication required`);if(c.status===421&&!i&&(a.body==null||a.body.source!=null)){if(A(e))return r(e);e.controller.connection.destroy(),c=await Qe(e,t,!0)}return c}async function $e(e,t=!1,i=!1){ue(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e,t=!0){this.destroyed||(this.destroyed=!0,t&&this.abort?.(e??new DOMException(`The operation was aborted.`,`AbortError`)))}};let o=e.request,c=null,l=e.timingInfo;o.cache=`no-store`,o.mode;let d=null;if(o.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(o.body!=null){let t=async function*(t){A(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},n=()=>{A(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{A(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};d=(async function*(){try{for await(let e of o.body.stream)yield*t(e);n()}catch(e){r(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:o}=await g({body:d});if(o)c=a({status:n,statusText:r,headersList:i,socket:o});else{let o=t[Symbol.asyncIterator]();e.controller.next=()=>o.next(),c=a({status:n,statusText:r,headersList:i})}}catch(t){return t.name===`AbortError`?(e.controller.connection.destroy(),r(e,t)):n(t)}let f=async()=>{await e.controller.resume()},p=t=>{A(e)||e.controller.abort(t)},m=new ReadableStream({async start(t){e.controller.controller=t},async pull(e){await f(e)},async cancel(e){await p(e)},type:`bytes`});c.body={stream:m,source:null,length:null},e.controller.onAborted=h,e.controller.on(`terminated`,h),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(j(e))break;t=n?void 0:r}catch(r){e.controller.ended&&!l.encodedBodySize?t=void 0:(t=r,n=!0)}if(t===void 0){P(e.controller.controller),Ue(e,c);return}if(l.decodedBodySize+=t?.byteLength??0,n){e.controller.terminate(t);return}let r=new Uint8Array(t);if(r.byteLength&&e.controller.controller.enqueue(r),Se(m)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function h(t){j(e)?(c.aborted=!0,Ce(m)&&e.controller.controller.error(e.controller.serializedAbortReason)):Ce(m)&&e.controller.controller.error(TypeError(`terminated`,{cause:M(t)?t:void 0})),e.controller.connection.destroy()}return c;function g({body:t}){let n=v(o),r=e.controller.dispatcher;return new Promise((i,a)=>r.dispatch({path:n.pathname+n.search,origin:n.origin,method:o.method,body:r.isMockActive?o.body&&(o.body.source||o.body.stream):t,headers:o.headersList.entries,maxRedirections:0,upgrade:o.mode===`websocket`?`websocket`:void 0},{body:null,abort:null,onConnect(t){let{connection:n}=e.controller;l.finalConnectionTimingInfo=re(void 0,l.postRedirectStartTime,e.crossOriginIsolatedCapability),n.destroyed?t(new DOMException(`The operation was aborted.`,`AbortError`)):(e.controller.on(`terminated`,t),this.abort=n.abort=t),l.finalNetworkRequestStartTime=E(e.crossOriginIsolatedCapability)},onResponseStarted(){l.finalNetworkResponseStartTime=E(e.crossOriginIsolatedCapability)},onHeaders(e,t,n,r){if(e<200)return;let c=``,l=new s;for(let e=0;e5)return a(Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`)),!0;for(let e=t.length-1;e>=0;--e){let n=t[e].trim();if(n===`x-gzip`||n===`gzip`)d.push(u.createGunzip({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(n===`deflate`)d.push(oe({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(n===`br`)d.push(u.createBrotliDecompress({flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH}));else{d.length=0;break}}}let p=this.onError.bind(this);return i({status:e,statusText:r,headersList:l,body:d.length?ye(this.body,...d,e=>{e&&this.onError(e)}).on(`error`,p):this.body.on(`error`,p)}),!0},onData(t){if(e.controller.dump)return;let n=t;return l.encodedBodySize+=n.byteLength,this.body.push(n)},onComplete(){this.abort&&e.controller.off(`terminated`,this.abort),e.controller.onAborted&&e.controller.off(`terminated`,e.controller.onAborted),e.controller.ended=!0,this.body.push(null)},onError(t){this.abort&&e.controller.off(`terminated`,this.abort),this.body?.destroy(t),e.controller.terminate(t),a(t)},onUpgrade(e,t,n){if(e!==101)return;let r=new s;for(let e=0;e{t.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`)}})),Ut=I(((e,t)=>{let{webidl:n}=Ge(),r=Symbol(`ProgressEvent state`);var i=class e extends Event{constructor(e,t={}){e=n.converters.DOMString(e,`ProgressEvent constructor`,`type`),t=n.converters.ProgressEventInit(t??{}),super(e,t),this[r]={lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}get lengthComputable(){return n.brandCheck(this,e),this[r].lengthComputable}get loaded(){return n.brandCheck(this,e),this[r].loaded}get total(){return n.brandCheck(this,e),this[r].total}};n.converters.ProgressEventInit=n.dictionaryConverter([{key:`lengthComputable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`loaded`,converter:n.converters[`unsigned long long`],defaultValue:()=>0},{key:`total`,converter:n.converters[`unsigned long long`],defaultValue:()=>0},{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}]),t.exports={ProgressEvent:i}})),Wt=I(((e,t)=>{function n(e){if(!e)return`failure`;switch(e.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`}}t.exports={getEncoding:n}})),Gt=I(((e,t)=>{let{kState:n,kError:r,kResult:i,kAborted:a,kLastProgressEventFired:o}=Ht(),{ProgressEvent:s}=Ut(),{getEncoding:c}=Wt(),{serializeAMimeType:l,parseMIMEType:u}=We(),{types:d}=L(`node:util`),{StringDecoder:f}=L(`string_decoder`),{btoa:p}=L(`node:buffer`),m={enumerable:!0,writable:!1,configurable:!1};function h(e,t,s,c){if(e[n]===`loading`)throw new DOMException(`Invalid state`,`InvalidStateError`);e[n]=`loading`,e[i]=null,e[r]=null;let l=t.stream().getReader(),u=[],f=l.read(),p=!0;(async()=>{for(;!e[a];)try{let{done:m,value:h}=await f;if(p&&!e[a]&&queueMicrotask(()=>{g(`loadstart`,e)}),p=!1,!m&&d.isUint8Array(h))u.push(h),(e[o]===void 0||Date.now()-e[o]>=50)&&!e[a]&&(e[o]=Date.now(),queueMicrotask(()=>{g(`progress`,e)})),f=l.read();else if(m){queueMicrotask(()=>{e[n]=`done`;try{let n=_(u,s,t.type,c);if(e[a])return;e[i]=n,g(`load`,e)}catch(t){e[r]=t,g(`error`,e)}e[n]!==`loading`&&g(`loadend`,e)});break}}catch(t){if(e[a])return;queueMicrotask(()=>{e[n]=`done`,e[r]=t,g(`error`,e),e[n]!==`loading`&&g(`loadend`,e)});break}})()}function g(e,t){let n=new s(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function _(e,t,n,r){switch(t){case`DataURL`:{let t=`data:`,r=u(n||`application/octet-stream`);r!==`failure`&&(t+=l(r)),t+=`;base64,`;let i=new f(`latin1`);for(let n of e)t+=p(i.write(n));return t+=p(i.end()),t}case`Text`:{let t=`failure`;if(r&&(t=c(r)),t===`failure`&&n){let e=u(n);e!==`failure`&&(t=c(e.parameters.get(`charset`)))}return t===`failure`&&(t=`UTF-8`),v(e,t)}case`ArrayBuffer`:return b(e).buffer;case`BinaryString`:{let t=``,n=new f(`latin1`);for(let r of e)t+=n.write(r);return t+=n.end(),t}}}function v(e,t){let n=b(e),r=y(n),i=0;r!==null&&(t=r,i=r===`UTF-8`?3:2);let a=n.slice(i);return new TextDecoder(t).decode(a)}function y(e){let[t,n,r]=e;return t===239&&n===187&&r===191?`UTF-8`:t===254&&n===255?`UTF-16BE`:t===255&&n===254?`UTF-16LE`:null}function b(e){let t=e.reduce((e,t)=>e+t.byteLength,0),n=0;return e.reduce((e,t)=>(e.set(t,n),n+=t.byteLength,e),new Uint8Array(t))}t.exports={staticPropertyDescriptors:m,readOperation:h,fireAProgressEvent:g}})),Kt=I(((e,t)=>{let{staticPropertyDescriptors:n,readOperation:r,fireAProgressEvent:i}=Gt(),{kState:a,kError:o,kResult:s,kEvents:c,kAborted:l}=Ht(),{webidl:u}=Ge(),{kEnumerableProperty:d}=z();var f=class e extends EventTarget{constructor(){super(),this[a]=`empty`,this[s]=null,this[o]=null,this[c]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsArrayBuffer`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`ArrayBuffer`)}readAsBinaryString(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsBinaryString`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`BinaryString`)}readAsText(t,n=void 0){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsText`),t=u.converters.Blob(t,{strict:!1}),n!==void 0&&(n=u.converters.DOMString(n,`FileReader.readAsText`,`encoding`)),r(this,t,`Text`,n)}readAsDataURL(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsDataURL`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`DataURL`)}abort(){if(this[a]===`empty`||this[a]===`done`){this[s]=null;return}this[a]===`loading`&&(this[a]=`done`,this[s]=null),this[l]=!0,i(`abort`,this),this[a]!==`loading`&&i(`loadend`,this)}get readyState(){switch(u.brandCheck(this,e),this[a]){case`empty`:return this.EMPTY;case`loading`:return this.LOADING;case`done`:return this.DONE}}get result(){return u.brandCheck(this,e),this[s]}get error(){return u.brandCheck(this,e),this[o]}get onloadend(){return u.brandCheck(this,e),this[c].loadend}set onloadend(t){u.brandCheck(this,e),this[c].loadend&&this.removeEventListener(`loadend`,this[c].loadend),typeof t==`function`?(this[c].loadend=t,this.addEventListener(`loadend`,t)):this[c].loadend=null}get onerror(){return u.brandCheck(this,e),this[c].error}set onerror(t){u.brandCheck(this,e),this[c].error&&this.removeEventListener(`error`,this[c].error),typeof t==`function`?(this[c].error=t,this.addEventListener(`error`,t)):this[c].error=null}get onloadstart(){return u.brandCheck(this,e),this[c].loadstart}set onloadstart(t){u.brandCheck(this,e),this[c].loadstart&&this.removeEventListener(`loadstart`,this[c].loadstart),typeof t==`function`?(this[c].loadstart=t,this.addEventListener(`loadstart`,t)):this[c].loadstart=null}get onprogress(){return u.brandCheck(this,e),this[c].progress}set onprogress(t){u.brandCheck(this,e),this[c].progress&&this.removeEventListener(`progress`,this[c].progress),typeof t==`function`?(this[c].progress=t,this.addEventListener(`progress`,t)):this[c].progress=null}get onload(){return u.brandCheck(this,e),this[c].load}set onload(t){u.brandCheck(this,e),this[c].load&&this.removeEventListener(`load`,this[c].load),typeof t==`function`?(this[c].load=t,this.addEventListener(`load`,t)):this[c].load=null}get onabort(){return u.brandCheck(this,e),this[c].abort}set onabort(t){u.brandCheck(this,e),this[c].abort&&this.removeEventListener(`abort`,this[c].abort),typeof t==`function`?(this[c].abort=t,this.addEventListener(`abort`,t)):this[c].abort=null}};f.EMPTY=f.prototype.EMPTY=0,f.LOADING=f.prototype.LOADING=1,f.DONE=f.prototype.DONE=2,Object.defineProperties(f.prototype,{EMPTY:n,LOADING:n,DONE:n,readAsArrayBuffer:d,readAsBinaryString:d,readAsText:d,readAsDataURL:d,abort:d,readyState:d,result:d,error:d,onloadstart:d,onprogress:d,onload:d,onabort:d,onerror:d,onloadend:d,[Symbol.toStringTag]:{value:`FileReader`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(f,{EMPTY:n,LOADING:n,DONE:n}),t.exports={FileReader:f}})),qt=I(((e,t)=>{t.exports={kConstruct:ke().kConstruct}})),Jt=I(((e,t)=>{let n=L(`node:assert`),{URLSerializer:r}=We(),{isValidHeaderName:i}=Ke();function a(e,t,n=!1){return r(e,n)===r(t,n)}function o(e){n(e!==null);let t=[];for(let n of e.split(`,`))n=n.trim(),i(n)&&t.push(n);return t}t.exports={urlEquals:a,getFieldValues:o}})),Yt=I(((e,t)=>{let{kConstruct:n}=qt(),{urlEquals:r,getFieldValues:i}=Jt(),{kEnumerableProperty:a,isDisturbed:o}=z(),{webidl:s}=Ge(),{Response:c,cloneResponse:l,fromInnerResponse:u}=Rt(),{Request:d,fromInnerRequest:f}=Bt(),{kState:p}=qe(),{fetching:m}=Vt(),{urlIsHttpHttpsScheme:h,createDeferredPromise:g,readAllBytes:_}=Ke(),v=L(`node:assert`);var y=class e{#e;constructor(){arguments[0]!==n&&s.illegalConstructor(),s.util.markAsUncloneable(this),this.#e=arguments[1]}async match(t,n={}){s.brandCheck(this,e);let r=`Cache.match`;s.argumentLengthCheck(arguments,1,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.CacheQueryOptions(n,r,`options`);let i=this.#i(t,n,1);if(i.length!==0)return i[0]}async matchAll(t=void 0,n={}){s.brandCheck(this,e);let r=`Cache.matchAll`;return t!==void 0&&(t=s.converters.RequestInfo(t,r,`request`)),n=s.converters.CacheQueryOptions(n,r,`options`),this.#i(t,n)}async add(t){s.brandCheck(this,e);let n=`Cache.add`;s.argumentLengthCheck(arguments,1,n),t=s.converters.RequestInfo(t,n,`request`);let r=[t];return await this.addAll(r)}async addAll(t){s.brandCheck(this,e);let n=`Cache.addAll`;s.argumentLengthCheck(arguments,1,n);let r=[],a=[];for(let e of t){if(e===void 0)throw s.errors.conversionFailed({prefix:n,argument:`Argument 1`,types:[`undefined is not allowed`]});if(e=s.converters.RequestInfo(e),typeof e==`string`)continue;let t=e[p];if(!h(t.url)||t.method!==`GET`)throw s.errors.exception({header:n,message:`Expected http/s scheme when method is not GET.`})}let o=[];for(let e of t){let t=new d(e)[p];if(!h(t.url))throw s.errors.exception({header:n,message:`Expected http/s scheme.`});t.initiator=`fetch`,t.destination=`subresource`,a.push(t);let c=g();o.push(m({request:t,processResponse(e){if(e.type===`error`||e.status===206||e.status<200||e.status>299)c.reject(s.errors.exception({header:`Cache.addAll`,message:`Received an invalid status code or the request failed.`}));else if(e.headersList.contains(`vary`)){let t=i(e.headersList.get(`vary`));for(let e of t)if(e===`*`){c.reject(s.errors.exception({header:`Cache.addAll`,message:`invalid vary field value`}));for(let e of o)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){c.reject(new DOMException(`aborted`,`AbortError`));return}c.resolve(e)}})),r.push(c.promise)}let c=await Promise.all(r),l=[],u=0;for(let e of c){let t={type:`put`,request:a[u],response:e};l.push(t),u++}let f=g(),_=null;try{this.#t(l)}catch(e){_=e}return queueMicrotask(()=>{_===null?f.resolve(void 0):f.reject(_)}),f.promise}async put(t,n){s.brandCheck(this,e);let r=`Cache.put`;s.argumentLengthCheck(arguments,2,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.Response(n,r,`response`);let a=null;if(a=t instanceof d?t[p]:new d(t)[p],!h(a.url)||a.method!==`GET`)throw s.errors.exception({header:r,message:`Expected an http/s scheme when method is not GET`});let c=n[p];if(c.status===206)throw s.errors.exception({header:r,message:`Got 206 status`});if(c.headersList.contains(`vary`)){let e=i(c.headersList.get(`vary`));for(let t of e)if(t===`*`)throw s.errors.exception({header:r,message:`Got * vary field value`})}if(c.body&&(o(c.body.stream)||c.body.stream.locked))throw s.errors.exception({header:r,message:`Response body is locked or disturbed`});let u=l(c),f=g();c.body==null?f.resolve(void 0):_(c.body.stream.getReader()).then(f.resolve,f.reject);let m=[],v={type:`put`,request:a,response:u};m.push(v);let y=await f.promise;u.body!=null&&(u.body.source=y);let b=g(),x=null;try{this.#t(m)}catch(e){x=e}return queueMicrotask(()=>{x===null?b.resolve():b.reject(x)}),b.promise}async delete(t,n={}){s.brandCheck(this,e);let r=`Cache.delete`;s.argumentLengthCheck(arguments,1,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.CacheQueryOptions(n,r,`options`);let i=null;if(t instanceof d){if(i=t[p],i.method!==`GET`&&!n.ignoreMethod)return!1}else v(typeof t==`string`),i=new d(t)[p];let a=[],o={type:`delete`,request:i,options:n};a.push(o);let c=g(),l=null,u;try{u=this.#t(a)}catch(e){l=e}return queueMicrotask(()=>{l===null?c.resolve(!!u?.length):c.reject(l)}),c.promise}async keys(t=void 0,n={}){s.brandCheck(this,e);let r=`Cache.keys`;t!==void 0&&(t=s.converters.RequestInfo(t,r,`request`)),n=s.converters.CacheQueryOptions(n,r,`options`);let i=null;if(t!==void 0)if(t instanceof d){if(i=t[p],i.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(i=new d(t)[p]);let a=g(),o=[];if(t===void 0)for(let e of this.#e)o.push(e[0]);else{let e=this.#n(i,n);for(let t of e)o.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of o){let n=f(t,new AbortController().signal,`immutable`);e.push(n)}a.resolve(Object.freeze(e))}),a.promise}#t(e){let t=this.#e,n=[...t],r=[],i=[];try{for(let n of e){if(n.type!==`delete`&&n.type!==`put`)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`operation type does not match "delete" or "put"`});if(n.type===`delete`&&n.response!=null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`delete operation should not have an associated response`});if(this.#n(n.request,n.options,r).length)throw new DOMException(`???`,`InvalidStateError`);let e;if(n.type===`delete`){if(e=this.#n(n.request,n.options),e.length===0)return[];for(let n of e){let e=t.indexOf(n);v(e!==-1),t.splice(e,1)}}else if(n.type===`put`){if(n.response==null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`put operation should have an associated response`});let i=n.request;if(!h(i.url))throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`expected http or https scheme`});if(i.method!==`GET`)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`not get method`});if(n.options!=null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`options must not be defined`});e=this.#n(n.request);for(let n of e){let e=t.indexOf(n);v(e!==-1),t.splice(e,1)}t.push([n.request,n.response]),r.push([n.request,n.response])}i.push([n.request,n.response])}return i}catch(e){throw this.#e.length=0,this.#e=n,e}}#n(e,t,n){let r=[],i=n??this.#e;for(let n of i){let[i,a]=n;this.#r(e,i,a,t)&&r.push(n)}return r}#r(e,t,n=null,a){let o=new URL(e.url),s=new URL(t.url);if(a?.ignoreSearch&&(s.search=``,o.search=``),!r(o,s,!0))return!1;if(n==null||a?.ignoreVary||!n.headersList.contains(`vary`))return!0;let c=i(n.headersList.get(`vary`));for(let n of c)if(n===`*`||t.headersList.get(n)!==e.headersList.get(n))return!1;return!0}#i(e,t,n=1/0){let r=null;if(e!==void 0)if(e instanceof d){if(r=e[p],r.method!==`GET`&&!t.ignoreMethod)return[]}else typeof e==`string`&&(r=new d(e)[p]);let i=[];if(e===void 0)for(let e of this.#e)i.push(e[1]);else{let e=this.#n(r,t);for(let t of e)i.push(t[1])}let a=[];for(let e of i){let t=u(e,`immutable`);if(a.push(t.clone()),a.length>=n)break}return Object.freeze(a)}};Object.defineProperties(y.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:a,matchAll:a,add:a,addAll:a,put:a,delete:a,keys:a});let b=[{key:`ignoreSearch`,converter:s.converters.boolean,defaultValue:()=>!1},{key:`ignoreMethod`,converter:s.converters.boolean,defaultValue:()=>!1},{key:`ignoreVary`,converter:s.converters.boolean,defaultValue:()=>!1}];s.converters.CacheQueryOptions=s.dictionaryConverter(b),s.converters.MultiCacheQueryOptions=s.dictionaryConverter([...b,{key:`cacheName`,converter:s.converters.DOMString}]),s.converters.Response=s.interfaceConverter(c),s.converters[`sequence`]=s.sequenceConverter(s.converters.RequestInfo),t.exports={Cache:y}})),Xt=I(((e,t)=>{let{kConstruct:n}=qt(),{Cache:r}=Yt(),{webidl:i}=Ge(),{kEnumerableProperty:a}=z();var o=class e{#e=new Map;constructor(){arguments[0]!==n&&i.illegalConstructor(),i.util.markAsUncloneable(this)}async match(t,a={}){if(i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,`CacheStorage.match`),t=i.converters.RequestInfo(t),a=i.converters.MultiCacheQueryOptions(a),a.cacheName!=null){if(this.#e.has(a.cacheName))return await new r(n,this.#e.get(a.cacheName)).match(t,a)}else for(let e of this.#e.values()){let i=await new r(n,e).match(t,a);if(i!==void 0)return i}}async has(t){i.brandCheck(this,e);let n=`CacheStorage.has`;return i.argumentLengthCheck(arguments,1,n),t=i.converters.DOMString(t,n,`cacheName`),this.#e.has(t)}async open(t){i.brandCheck(this,e);let a=`CacheStorage.open`;if(i.argumentLengthCheck(arguments,1,a),t=i.converters.DOMString(t,a,`cacheName`),this.#e.has(t))return new r(n,this.#e.get(t));let o=[];return this.#e.set(t,o),new r(n,o)}async delete(t){i.brandCheck(this,e);let n=`CacheStorage.delete`;return i.argumentLengthCheck(arguments,1,n),t=i.converters.DOMString(t,n,`cacheName`),this.#e.delete(t)}async keys(){return i.brandCheck(this,e),[...this.#e.keys()]}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`CacheStorage`,configurable:!0},match:a,has:a,open:a,delete:a,keys:a}),t.exports={CacheStorage:o}})),Zt=I(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),Qt=I(((e,t)=>{function n(e){for(let t=0;t=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function r(e){for(let t=0;t126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw Error(`Invalid cookie name`)}}function i(e){let t=e.length,n=0;if(e[0]===`"`){if(t===1||e[t-1]!==`"`)throw Error(`Invalid cookie value`);--t,++n}for(;n126||t===34||t===44||t===59||t===92)throw Error(`Invalid cookie value`)}}function a(e){for(let t=0;tt.toString().padStart(2,`0`));function u(e){return typeof e==`number`&&(e=new Date(e)),`${s[e.getUTCDay()]}, ${l[e.getUTCDate()]} ${c[e.getUTCMonth()]} ${e.getUTCFullYear()} ${l[e.getUTCHours()]}:${l[e.getUTCMinutes()]}:${l[e.getUTCSeconds()]} GMT`}function d(e){if(e<0)throw Error(`Invalid cookie max-age`)}function f(e){if(e.name.length===0)return null;r(e.name),i(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith(`__Secure-`)&&(e.secure=!0),e.name.startsWith(`__Host-`)&&(e.secure=!0,e.domain=null,e.path=`/`),e.secure&&t.push(`Secure`),e.httpOnly&&t.push(`HttpOnly`),typeof e.maxAge==`number`&&(d(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(o(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(a(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!==`Invalid Date`&&t.push(`Expires=${u(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let n of e.unparsed){if(!n.includes(`=`))throw Error(`Invalid unparsed`);let[e,...r]=n.split(`=`);t.push(`${e.trim()}=${r.join(`=`)}`)}return t.join(`; `)}t.exports={isCTLExcludingHtab:n,validateCookieName:r,validateCookiePath:a,validateCookieValue:i,toIMFDate:u,stringify:f}})),$t=I(((e,t)=>{let{maxNameValuePairSize:n,maxAttributeValueSize:r}=Zt(),{isCTLExcludingHtab:i}=Qt(),{collectASequenceOfCodePointsFast:a}=We(),o=L(`node:assert`);function s(e){if(i(e))return null;let t=``,r=``,o=``,s=``;if(e.includes(`;`)){let n={position:0};t=a(`;`,e,n),r=e.slice(n.position)}else t=e;if(!t.includes(`=`))s=t;else{let e={position:0};o=a(`=`,t,e),s=t.slice(e.position+1)}return o=o.trim(),s=s.trim(),o.length+s.length>n?null:{name:o,value:s,...c(r)}}function c(e,t={}){if(e.length===0)return t;o(e[0]===`;`),e=e.slice(1);let n=``;e.includes(`;`)?(n=a(`;`,e,{position:0}),e=e.slice(n.length)):(n=e,e=``);let i=``,s=``;if(n.includes(`=`)){let e={position:0};i=a(`=`,n,e),s=n.slice(e.position+1)}else i=n;if(i=i.trim(),s=s.trim(),s.length>r)return c(e,t);let l=i.toLowerCase();if(l===`expires`)t.expires=new Date(s);else if(l===`max-age`){let n=s.charCodeAt(0);if((n<48||n>57)&&s[0]!==`-`||!/^\d+$/.test(s))return c(e,t);t.maxAge=Number(s)}else if(l===`domain`){let e=s;e[0]===`.`&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if(l===`path`){let e=``;e=s.length===0||s[0]!==`/`?`/`:s,t.path=e}else if(l===`secure`)t.secure=!0;else if(l===`httponly`)t.httpOnly=!0;else if(l===`samesite`){let e=`Default`,n=s.toLowerCase();n.includes(`none`)&&(e=`None`),n.includes(`strict`)&&(e=`Strict`),n.includes(`lax`)&&(e=`Lax`),t.sameSite=e}else t.unparsed??=[],t.unparsed.push(`${i}=${s}`);return c(e,t)}t.exports={parseSetCookie:s,parseUnparsedAttributes:c}})),en=I(((e,t)=>{let{parseSetCookie:n}=$t(),{stringify:r}=Qt(),{webidl:i}=Ge(),{Headers:a}=Lt();function o(e){i.argumentLengthCheck(arguments,1,`getCookies`),i.brandCheck(e,a,{strict:!1});let t=e.get(`cookie`),n={};if(!t)return n;for(let e of t.split(`;`)){let[t,...r]=e.split(`=`);n[t.trim()]=r.join(`=`)}return n}function s(e,t,n){i.brandCheck(e,a,{strict:!1});let r=`deleteCookie`;i.argumentLengthCheck(arguments,2,r),t=i.converters.DOMString(t,r,`name`),n=i.converters.DeleteCookieAttributes(n),l(e,{name:t,value:``,expires:new Date(0),...n})}function c(e){i.argumentLengthCheck(arguments,1,`getSetCookies`),i.brandCheck(e,a,{strict:!1});let t=e.getSetCookie();return t?t.map(e=>n(e)):[]}function l(e,t){i.argumentLengthCheck(arguments,2,`setCookie`),i.brandCheck(e,a,{strict:!1}),t=i.converters.Cookie(t);let n=r(t);n&&e.append(`Set-Cookie`,n)}i.converters.DeleteCookieAttributes=i.dictionaryConverter([{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null}]),i.converters.Cookie=i.dictionaryConverter([{converter:i.converters.DOMString,key:`name`},{converter:i.converters.DOMString,key:`value`},{converter:i.nullableConverter(e=>typeof e==`number`?i.converters[`unsigned long long`](e):new Date(e)),key:`expires`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters[`long long`]),key:`maxAge`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`secure`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`httpOnly`,defaultValue:()=>null},{converter:i.converters.USVString,key:`sameSite`,allowedValues:[`Strict`,`Lax`,`None`]},{converter:i.sequenceConverter(i.converters.DOMString),key:`unparsed`,defaultValue:()=>[]}]),t.exports={getCookies:o,deleteCookie:s,getSetCookies:c,setCookie:l}})),tn=I(((e,t)=>{let{webidl:n}=Ge(),{kEnumerableProperty:r}=z(),{kConstruct:i}=ke(),{MessagePort:a}=L(`node:worker_threads`);var o=class e extends Event{#e;constructor(e,t={}){if(e===i){super(arguments[1],arguments[2]),n.util.markAsUncloneable(this);return}let r=`MessageEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.MessageEventInit(t,r,`eventInitDict`),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get data(){return n.brandCheck(this,e),this.#e.data}get origin(){return n.brandCheck(this,e),this.#e.origin}get lastEventId(){return n.brandCheck(this,e),this.#e.lastEventId}get source(){return n.brandCheck(this,e),this.#e.source}get ports(){return n.brandCheck(this,e),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(t,r=!1,i=!1,a=null,o=``,s=``,c=null,l=[]){return n.brandCheck(this,e),n.argumentLengthCheck(arguments,1,`MessageEvent.initMessageEvent`),new e(t,{bubbles:r,cancelable:i,data:a,origin:o,lastEventId:s,source:c,ports:l})}static createFastMessageEvent(t,n){let r=new e(i,t,n);return r.#e=n,r.#e.data??=null,r.#e.origin??=``,r.#e.lastEventId??=``,r.#e.source??=null,r.#e.ports??=[],r}};let{createFastMessageEvent:s}=o;delete o.createFastMessageEvent;var c=class e extends Event{#e;constructor(e,t={}){let r=`CloseEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.CloseEventInit(t),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get wasClean(){return n.brandCheck(this,e),this.#e.wasClean}get code(){return n.brandCheck(this,e),this.#e.code}get reason(){return n.brandCheck(this,e),this.#e.reason}},l=class e extends Event{#e;constructor(e,t){let r=`ErrorEvent constructor`;n.argumentLengthCheck(arguments,1,r),super(e,t),n.util.markAsUncloneable(this),e=n.converters.DOMString(e,r,`type`),t=n.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return n.brandCheck(this,e),this.#e.message}get filename(){return n.brandCheck(this,e),this.#e.filename}get lineno(){return n.brandCheck(this,e),this.#e.lineno}get colno(){return n.brandCheck(this,e),this.#e.colno}get error(){return n.brandCheck(this,e),this.#e.error}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`MessageEvent`,configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(c.prototype,{[Symbol.toStringTag]:{value:`CloseEvent`,configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(l.prototype,{[Symbol.toStringTag]:{value:`ErrorEvent`,configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),n.converters.MessagePort=n.interfaceConverter(a),n.converters[`sequence`]=n.sequenceConverter(n.converters.MessagePort);let u=[{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}];n.converters.MessageEventInit=n.dictionaryConverter([...u,{key:`data`,converter:n.converters.any,defaultValue:()=>null},{key:`origin`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lastEventId`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`source`,converter:n.nullableConverter(n.converters.MessagePort),defaultValue:()=>null},{key:`ports`,converter:n.converters[`sequence`],defaultValue:()=>[]}]),n.converters.CloseEventInit=n.dictionaryConverter([...u,{key:`wasClean`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`code`,converter:n.converters[`unsigned short`],defaultValue:()=>0},{key:`reason`,converter:n.converters.USVString,defaultValue:()=>``}]),n.converters.ErrorEventInit=n.dictionaryConverter([...u,{key:`message`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`filename`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lineno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`colno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`error`,converter:n.converters.any}]),t.exports={MessageEvent:o,CloseEvent:c,ErrorEvent:l,createFastMessageEvent:s}})),nn=I(((e,t)=>{t.exports={uid:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,sentCloseFrameState:{NOT_SENT:0,PROCESSING:1,SENT:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:2**16-1,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:Buffer.allocUnsafe(0),sendHints:{string:1,typedArray:2,arrayBuffer:3,blob:4}}})),rn=I(((e,t)=>{t.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`)}})),an=I(((e,t)=>{let{kReadyState:n,kController:r,kResponse:i,kBinaryType:a,kWebSocketURL:o}=rn(),{states:s,opcodes:c}=nn(),{ErrorEvent:l,createFastMessageEvent:u}=tn(),{isUtf8:d}=L(`node:buffer`),{collectASequenceOfCodePointsFast:f,removeHTTPWhitespace:p}=We();function m(e){return e[n]===s.CONNECTING}function h(e){return e[n]===s.OPEN}function g(e){return e[n]===s.CLOSING}function _(e){return e[n]===s.CLOSED}function v(e,t,n=(e,t)=>new Event(e,t),r={}){let i=n(e,r);t.dispatchEvent(i)}function y(e,t,r){if(e[n]!==s.OPEN)return;let i;if(t===c.TEXT)try{i=M(r)}catch{C(e,`Received invalid UTF-8 in text frame.`);return}else t===c.BINARY&&(i=e[a]===`blob`?new Blob([r]):b(r));v(`message`,e,u,{origin:e[o].origin,data:i})}function b(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function x(e){if(e.length===0)return!1;for(let t=0;t126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function S(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function C(e,t){let{[r]:n,[i]:a}=e;n.abort(),a?.socket&&!a.socket.destroyed&&a.socket.destroy(),t&&v(`error`,e,(e,t)=>new l(e,t),{error:Error(t),message:t})}function w(e){return e===c.CLOSE||e===c.PING||e===c.PONG}function T(e){return e===c.CONTINUATION}function E(e){return e===c.TEXT||e===c.BINARY}function D(e){return E(e)||T(e)||w(e)}function O(e){let t={position:0},n=new Map;for(;t.position57)return!1}let t=Number.parseInt(e,10);return t>=8&&t<=15}let A=typeof process.versions.icu==`string`,j=A?new TextDecoder(`utf-8`,{fatal:!0}):void 0,M=A?j.decode.bind(j):function(e){if(d(e))return e.toString(`utf-8`);throw TypeError(`Invalid utf-8 received.`)};t.exports={isConnecting:m,isEstablished:h,isClosing:g,isClosed:_,fireEvent:v,isValidSubprotocol:x,isValidStatusCode:S,failWebsocketConnection:C,websocketMessageReceived:y,utf8Decode:M,isControlFrame:w,isContinuationFrame:T,isTextBinaryFrame:E,isValidOpcode:D,parseExtensions:O,isValidClientWindowBits:k}})),on=I(((e,t)=>{let{maxUnsigned16Bit:n}=nn(),r=16386,i,a=null,o=r;try{i=L(`node:crypto`)}catch{i={randomFillSync:function(e,t,n){for(let t=0;tn?(o+=8,a=127):i>125&&(o+=2,a=126);let c=Buffer.allocUnsafe(i+o);c[0]=c[1]=0,c[0]|=128,c[0]=(c[0]&240)+e,c[o-4]=r[0],c[o-3]=r[1],c[o-2]=r[2],c[o-1]=r[3],c[1]=a,a===126?c.writeUInt16BE(i,2):a===127&&(c[2]=c[3]=0,c.writeUIntBE(i,4,6)),c[1]|=128;for(let e=0;e{let{uid:n,states:r,sentCloseFrameState:i,emptyBuffer:a,opcodes:o}=nn(),{kReadyState:s,kSentClose:c,kByteParser:l,kReceivedClose:u,kResponse:d}=rn(),{fireEvent:f,failWebsocketConnection:p,isClosing:m,isClosed:h,isEstablished:g,parseExtensions:_}=an(),{channels:v}=Me(),{CloseEvent:y}=tn(),{makeRequest:b}=Bt(),{fetching:x}=Vt(),{Headers:S,getHeadersList:C}=Lt(),{getDecodeSplit:w}=Ke(),{WebsocketFrameSend:T}=on(),E;try{E=L(`node:crypto`)}catch{}function D(e,t,r,i,a,o){let s=e;s.protocol=e.protocol===`ws:`?`http:`:`https:`;let c=b({urlList:[s],client:r,serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`});o.headers&&(c.headersList=C(new S(o.headers)));let l=E.randomBytes(16).toString(`base64`);c.headersList.append(`sec-websocket-key`,l),c.headersList.append(`sec-websocket-version`,`13`);for(let e of t)c.headersList.append(`sec-websocket-protocol`,e);return c.headersList.append(`sec-websocket-extensions`,`permessage-deflate; client_max_window_bits`),x({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(e){if(e.type===`error`||e.status!==101){p(i,`Received network error or non-101 status code.`);return}if(t.length!==0&&!e.headersList.get(`Sec-WebSocket-Protocol`)){p(i,`Server did not respond with sent protocols.`);return}if(e.headersList.get(`Upgrade`)?.toLowerCase()!==`websocket`){p(i,`Server did not set Upgrade header to "websocket".`);return}if(e.headersList.get(`Connection`)?.toLowerCase()!==`upgrade`){p(i,`Server did not set Connection header to "upgrade".`);return}if(e.headersList.get(`Sec-WebSocket-Accept`)!==E.createHash(`sha1`).update(l+n).digest(`base64`)){p(i,`Incorrect hash received in Sec-WebSocket-Accept header.`);return}let r=e.headersList.get(`Sec-WebSocket-Extensions`),o;if(r!==null&&(o=_(r),!o.has(`permessage-deflate`))){p(i,`Sec-WebSocket-Extensions header does not match.`);return}let s=e.headersList.get(`Sec-WebSocket-Protocol`);if(s!==null&&!w(`sec-websocket-protocol`,c.headersList).includes(s)){p(i,`Protocol was not set in the opening handshake.`);return}e.socket.on(`data`,k),e.socket.on(`close`,A),e.socket.on(`error`,j),v.open.hasSubscribers&&v.open.publish({address:e.socket.address(),protocol:s,extensions:r}),a(e,o)}})}function O(e,t,n,l){if(!(m(e)||h(e)))if(!g(e))p(e,`Connection was closed before it was established.`),e[s]=r.CLOSING;else if(e[c]===i.NOT_SENT){e[c]=i.PROCESSING;let u=new T;t!==void 0&&n===void 0?(u.frameData=Buffer.allocUnsafe(2),u.frameData.writeUInt16BE(t,0)):t!==void 0&&n!==void 0?(u.frameData=Buffer.allocUnsafe(2+l),u.frameData.writeUInt16BE(t,0),u.frameData.write(n,2,`utf-8`)):u.frameData=a,e[d].socket.write(u.createFrame(o.CLOSE)),e[c]=i.SENT,e[s]=r.CLOSING}else e[s]=r.CLOSING}function k(e){this.ws[l].write(e)||this.pause()}function A(){let{ws:e}=this,{[d]:t}=e;t.socket.off(`data`,k),t.socket.off(`close`,A),t.socket.off(`error`,j);let n=e[c]===i.SENT&&e[u],a=1005,o=``,p=e[l].closingInfo;p&&!p.error?(a=p.code??1005,o=p.reason):e[u]||(a=1006),e[s]=r.CLOSED,f(`close`,e,(e,t)=>new y(e,t),{wasClean:n,code:a,reason:o}),v.close.hasSubscribers&&v.close.publish({websocket:e,code:a,reason:o})}function j(e){let{ws:t}=this;t[s]=r.CLOSING,v.socketError.hasSubscribers&&v.socketError.publish(e),this.destroy()}t.exports={establishWebSocketConnection:D,closeWebSocketConnection:O}})),cn=I(((e,t)=>{let{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:r}=L(`node:zlib`),{isValidClientWindowBits:i}=an(),{MessageSizeExceededError:a}=R(),o=Buffer.from([0,0,255,255]),s=Symbol(`kBuffer`),c=Symbol(`kLength`);t.exports={PerMessageDeflate:class{#e;#t={};#n=!1;#r=null;constructor(e){this.#t.serverNoContextTakeover=e.has(`server_no_context_takeover`),this.#t.serverMaxWindowBits=e.get(`server_max_window_bits`)}decompress(e,t,l){if(this.#n){l(new a);return}if(!this.#e){let e=r;if(this.#t.serverMaxWindowBits){if(!i(this.#t.serverMaxWindowBits)){l(Error(`Invalid server_max_window_bits`));return}e=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=n({windowBits:e})}catch(e){l(e);return}this.#e[s]=[],this.#e[c]=0,this.#e.on(`data`,e=>{if(!this.#n){if(this.#e[c]+=e.length,this.#e[c]>4194304){if(this.#n=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#r){let e=this.#r;this.#r=null,e(new a)}return}this.#e[s].push(e)}}),this.#e.on(`error`,e=>{this.#e=null,l(e)})}this.#r=l,this.#e.write(e),t&&this.#e.write(o),this.#e.flush(()=>{if(this.#n||!this.#e)return;let e=Buffer.concat(this.#e[s],this.#e[c]);this.#e[s].length=0,this.#e[c]=0,this.#r=null,l(null,e)})}}}})),ln=I(((e,t)=>{let{Writable:n}=L(`node:stream`),r=L(`node:assert`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s,sentCloseFrameState:c}=nn(),{kReadyState:l,kSentClose:u,kResponse:d,kReceivedClose:f}=rn(),{channels:p}=Me(),{isValidStatusCode:m,isValidOpcode:h,failWebsocketConnection:g,websocketMessageReceived:_,utf8Decode:v,isControlFrame:y,isTextBinaryFrame:b,isContinuationFrame:x}=an(),{WebsocketFrameSend:S}=on(),{closeWebSocketConnection:C}=sn(),{PerMessageDeflate:w}=cn();t.exports={ByteParser:class extends n{#e=[];#t=0;#n=!1;#r=i.INFO;#i={};#a=[];#o;constructor(e,t){super(),this.ws=e,this.#o=t??new Map,this.#o.has(`permessage-deflate`)&&this.#o.set(`permessage-deflate`,new w(t))}_write(e,t,n){this.#e.push(e),this.#t+=e.length,this.#n=!0,this.run(n)}run(e){for(;this.#n;)if(this.#r===i.INFO){if(this.#t<2)return e();let t=this.consume(2),n=(t[0]&128)!=0,r=t[0]&15,o=(t[1]&128)==128,s=!n&&r!==a.CONTINUATION,c=t[1]&127,l=t[0]&64,u=t[0]&32,d=t[0]&16;if(!h(r))return g(this.ws,`Invalid opcode received`),e();if(o)return g(this.ws,`Frame cannot be masked`),e();if(l!==0&&!this.#o.has(`permessage-deflate`)){g(this.ws,`Expected RSV1 to be clear.`);return}if(u!==0||d!==0){g(this.ws,`RSV1, RSV2, RSV3 must be clear`);return}if(s&&!b(r)){g(this.ws,`Invalid frame type was fragmented.`);return}if(b(r)&&this.#a.length>0){g(this.ws,`Expected continuation frame`);return}if(this.#i.fragmented&&s){g(this.ws,`Fragmented frame exceeded 125 bytes.`);return}if((c>125||s)&&y(r)){g(this.ws,`Control frame either too large or fragmented`);return}if(x(r)&&this.#a.length===0&&!this.#i.compressed){g(this.ws,`Unexpected continuation frame`);return}c<=125?(this.#i.payloadLength=c,this.#r=i.READ_DATA):c===126?this.#r=i.PAYLOADLENGTH_16:c===127&&(this.#r=i.PAYLOADLENGTH_64),b(r)&&(this.#i.binaryType=r,this.#i.compressed=l!==0),this.#i.opcode=r,this.#i.masked=o,this.#i.fin=n,this.#i.fragmented=s}else if(this.#r===i.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#i.payloadLength=t.readUInt16BE(0),this.#r=i.READ_DATA}else if(this.#r===i.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),n=t.readUInt32BE(0),r=t.readUInt32BE(4);if(n!==0||r>2**31-1){g(this.ws,`Received payload length > 2^31 bytes.`);return}this.#i.payloadLength=r,this.#r=i.READ_DATA}else if(this.#r===i.READ_DATA){if(this.#t{if(t){g(this.ws,t.message);return}if(this.#a.push(n),!this.#i.fin){this.#r=i.INFO,this.#n=!0,this.run(e);return}_(this.ws,this.#i.binaryType,Buffer.concat(this.#a)),this.#n=!0,this.#r=i.INFO,this.#a.length=0,this.run(e)}),this.#n=!1;break}else{if(this.#a.push(t),!this.#i.fragmented&&this.#i.fin){let e=Buffer.concat(this.#a);_(this.ws,this.#i.binaryType,e),this.#a.length=0}this.#r=i.INFO}}}consume(e){if(e>this.#t)throw Error(`Called consume() before buffers satiated.`);if(e===0)return s;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let t=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let r=this.#e[0],{length:i}=r;if(i+n===e){t.set(this.#e.shift(),n);break}else if(i+n>e){t.set(r.subarray(0,e-n),n),this.#e[0]=r.subarray(e-n);break}else t.set(this.#e.shift(),n),n+=r.length}return this.#t-=e,t}parseCloseBody(e){r(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!m(t))return{code:1002,reason:`Invalid status code`,error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=v(n)}catch{return{code:1007,reason:`Invalid UTF-8`,error:!0}}return{code:t,reason:n,error:!1}}parseControlFrame(e){let{opcode:t,payloadLength:n}=this.#i;if(t===a.CLOSE){if(n===1)return g(this.ws,`Received close frame with a 1-byte body.`),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:e,reason:t}=this.#i.closeInfo;return C(this.ws,e,t,t.length),g(this.ws,t),!1}if(this.ws[u]!==c.SENT){let e=s;this.#i.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#i.closeInfo.code,0));let t=new S(e);this.ws[d].socket.write(t.createFrame(a.CLOSE),e=>{e||(this.ws[u]=c.SENT)})}return this.ws[l]=o.CLOSING,this.ws[f]=!0,!1}else if(t===a.PING){if(!this.ws[f]){let t=new S(e);this.ws[d].socket.write(t.createFrame(a.PONG)),p.ping.hasSubscribers&&p.ping.publish({payload:e})}}else t===a.PONG&&p.pong.hasSubscribers&&p.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}}}})),un=I(((e,t)=>{let{WebsocketFrameSend:n}=on(),{opcodes:r,sendHints:i}=nn(),a=rt(),o=Buffer[Symbol.species];var s=class{#e=new a;#t=!1;#n;constructor(e){this.#n=e}add(e,t,n){if(n!==i.blob){let r=c(e,n);if(!this.#t)this.#n.write(r,t);else{let e={promise:null,callback:t,frame:r};this.#e.push(e)}return}let r={promise:e.arrayBuffer().then(e=>{r.promise=null,r.frame=c(e,n)}),callback:t,frame:null};this.#e.push(r),this.#t||this.#r()}async#r(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let t=e.shift();t.promise!==null&&await t.promise,this.#n.write(t.frame,t.callback),t.callback=t.frame=null}this.#t=!1}};function c(e,t){return new n(l(e,t)).createFrame(t===i.string?r.TEXT:r.BINARY)}function l(e,t){switch(t){case i.string:return Buffer.from(e);case i.arrayBuffer:case i.blob:return new o(e);case i.typedArray:return new o(e.buffer,e.byteOffset,e.byteLength)}}t.exports={SendQueue:s}})),dn=I(((e,t)=>{let{webidl:n}=Ge(),{URLSerializer:r}=We(),{environmentSettingsObject:i}=Ke(),{staticPropertyDescriptors:a,states:o,sentCloseFrameState:s,sendHints:c}=nn(),{kWebSocketURL:l,kReadyState:u,kController:d,kBinaryType:f,kResponse:p,kSentClose:m,kByteParser:h}=rn(),{isConnecting:g,isEstablished:_,isClosing:v,isValidSubprotocol:y,fireEvent:b}=an(),{establishWebSocketConnection:x,closeWebSocketConnection:S}=sn(),{ByteParser:C}=ln(),{kEnumerableProperty:w,isBlobLike:T}=z(),{getGlobalDispatcher:E}=jt(),{types:D}=L(`node:util`),{ErrorEvent:O,CloseEvent:k}=tn(),{SendQueue:A}=un();var j=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;#i;constructor(t,r=[]){super(),n.util.markAsUncloneable(this);let a=`WebSocket constructor`;n.argumentLengthCheck(arguments,1,a);let o=n.converters[`DOMString or sequence or WebSocketInit`](r,a,`options`);t=n.converters.USVString(t,a,`url`),r=o.protocols;let c=i.settingsObject.baseUrl,p;try{p=new URL(t,c)}catch(e){throw new DOMException(e,`SyntaxError`)}if(p.protocol===`http:`?p.protocol=`ws:`:p.protocol===`https:`&&(p.protocol=`wss:`),p.protocol!==`ws:`&&p.protocol!==`wss:`)throw new DOMException(`Expected a ws: or wss: protocol, got ${p.protocol}`,`SyntaxError`);if(p.hash||p.href.endsWith(`#`))throw new DOMException(`Got fragment`,`SyntaxError`);if(typeof r==`string`&&(r=[r]),r.length!==new Set(r.map(e=>e.toLowerCase())).size||r.length>0&&!r.every(e=>y(e)))throw new DOMException(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this[l]=new URL(p.href);let h=i.settingsObject;this[d]=x(p,r,h,this,(e,t)=>this.#a(e,t),o),this[u]=e.CONNECTING,this[m]=s.NOT_SENT,this[f]=`blob`}close(t=void 0,r=void 0){n.brandCheck(this,e);let i=`WebSocket.close`;if(t!==void 0&&(t=n.converters[`unsigned short`](t,i,`code`,{clamp:!0})),r!==void 0&&(r=n.converters.USVString(r,i,`reason`)),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new DOMException(`invalid code`,`InvalidAccessError`);let a=0;if(r!==void 0&&(a=Buffer.byteLength(r),a>123))throw new DOMException(`Reason must be less than 123 bytes; received ${a}`,`SyntaxError`);S(this,t,r,a)}send(t){n.brandCheck(this,e);let r=`WebSocket.send`;if(n.argumentLengthCheck(arguments,1,r),t=n.converters.WebSocketSendData(t,r,`data`),g(this))throw new DOMException(`Sent before connected.`,`InvalidStateError`);if(!(!_(this)||v(this)))if(typeof t==`string`){let e=Buffer.byteLength(t);this.#t+=e,this.#i.add(t,()=>{this.#t-=e},c.string)}else D.isArrayBuffer(t)?(this.#t+=t.byteLength,this.#i.add(t,()=>{this.#t-=t.byteLength},c.arrayBuffer)):ArrayBuffer.isView(t)?(this.#t+=t.byteLength,this.#i.add(t,()=>{this.#t-=t.byteLength},c.typedArray)):T(t)&&(this.#t+=t.size,this.#i.add(t,()=>{this.#t-=t.size},c.blob))}get readyState(){return n.brandCheck(this,e),this[u]}get bufferedAmount(){return n.brandCheck(this,e),this.#t}get url(){return n.brandCheck(this,e),r(this[l])}get extensions(){return n.brandCheck(this,e),this.#r}get protocol(){return n.brandCheck(this,e),this.#n}get onopen(){return n.brandCheck(this,e),this.#e.open}set onopen(t){n.brandCheck(this,e),this.#e.open&&this.removeEventListener(`open`,this.#e.open),typeof t==`function`?(this.#e.open=t,this.addEventListener(`open`,t)):this.#e.open=null}get onerror(){return n.brandCheck(this,e),this.#e.error}set onerror(t){n.brandCheck(this,e),this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof t==`function`?(this.#e.error=t,this.addEventListener(`error`,t)):this.#e.error=null}get onclose(){return n.brandCheck(this,e),this.#e.close}set onclose(t){n.brandCheck(this,e),this.#e.close&&this.removeEventListener(`close`,this.#e.close),typeof t==`function`?(this.#e.close=t,this.addEventListener(`close`,t)):this.#e.close=null}get onmessage(){return n.brandCheck(this,e),this.#e.message}set onmessage(t){n.brandCheck(this,e),this.#e.message&&this.removeEventListener(`message`,this.#e.message),typeof t==`function`?(this.#e.message=t,this.addEventListener(`message`,t)):this.#e.message=null}get binaryType(){return n.brandCheck(this,e),this[f]}set binaryType(t){n.brandCheck(this,e),t!==`blob`&&t!==`arraybuffer`?this[f]=`blob`:this[f]=t}#a(e,t){this[p]=e;let n=new C(this,t);n.on(`drain`,M),n.on(`error`,N.bind(this)),e.socket.ws=this,this[h]=n,this.#i=new A(e.socket),this[u]=o.OPEN;let r=e.headersList.get(`sec-websocket-extensions`);r!==null&&(this.#r=r);let i=e.headersList.get(`sec-websocket-protocol`);i!==null&&(this.#n=i),b(`open`,this)}};j.CONNECTING=j.prototype.CONNECTING=o.CONNECTING,j.OPEN=j.prototype.OPEN=o.OPEN,j.CLOSING=j.prototype.CLOSING=o.CLOSING,j.CLOSED=j.prototype.CLOSED=o.CLOSED,Object.defineProperties(j.prototype,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a,url:w,readyState:w,bufferedAmount:w,onopen:w,onerror:w,onclose:w,close:w,onmessage:w,binaryType:w,send:w,extensions:w,protocol:w,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(j,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a}),n.converters[`sequence`]=n.sequenceConverter(n.converters.DOMString),n.converters[`DOMString or sequence`]=function(e,t,r){return n.util.Type(e)===`Object`&&Symbol.iterator in e?n.converters[`sequence`](e):n.converters.DOMString(e,t,r)},n.converters.WebSocketInit=n.dictionaryConverter([{key:`protocols`,converter:n.converters[`DOMString or sequence`],defaultValue:()=>[]},{key:`dispatcher`,converter:n.converters.any,defaultValue:()=>E()},{key:`headers`,converter:n.nullableConverter(n.converters.HeadersInit)}]),n.converters[`DOMString or sequence or WebSocketInit`]=function(e){return n.util.Type(e)===`Object`&&!(Symbol.iterator in e)?n.converters.WebSocketInit(e):{protocols:n.converters[`DOMString or sequence`](e)}},n.converters.WebSocketSendData=function(e){if(n.util.Type(e)===`Object`){if(T(e))return n.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||D.isArrayBuffer(e))return n.converters.BufferSource(e)}return n.converters.USVString(e)};function M(){this.ws[p].socket.resume()}function N(e){let t,n;e instanceof k?(t=e.reason,n=e.code):t=e.message,b(`error`,this,()=>new O(`error`,{error:e,message:t})),S(this,n)}t.exports={WebSocket:j}})),fn=I(((e,t)=>{function n(e){return e.indexOf(`\0`)===-1}function r(e){if(e.length===0)return!1;for(let t=0;t57)return!1;return!0}function i(e){return new Promise(t=>{setTimeout(t,e).unref()})}t.exports={isValidLastEventId:n,isASCIINumber:r,delay:i}})),pn=I(((e,t)=>{let{Transform:n}=L(`node:stream`),{isASCIINumber:r,isValidLastEventId:i}=fn(),a=[239,187,191];t.exports={EventSourceStream:class extends n{state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,t,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===a[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===a[0]&&this.buffer[1]===a[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===a[0]&&this.buffer[1]===a[1]&&this.buffer[2]===a[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===a[0]&&this.buffer[1]===a[1]&&this.buffer[2]===a[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(t[a]=o);break}}processEvent(e){e.retry&&r(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&i(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||`message`,options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}}}})),mn=I(((e,t)=>{let{pipeline:n}=L(`node:stream`),{fetching:r}=Vt(),{makeRequest:i}=Bt(),{webidl:a}=Ge(),{EventSourceStream:o}=pn(),{parseMIMEType:s}=We(),{createFastMessageEvent:c}=tn(),{isNetworkError:l}=Rt(),{delay:u}=fn(),{kEnumerableProperty:d}=z(),{environmentSettingsObject:f}=Ke(),p=!1,m=3e3;var h=class e extends EventTarget{#e={open:null,error:null,message:null};#t=null;#n=!1;#r=0;#i=null;#a=null;#o;#s;constructor(e,t={}){super(),a.util.markAsUncloneable(this);let n=`EventSource constructor`;a.argumentLengthCheck(arguments,1,n),p||(p=!0,process.emitWarning(`EventSource is experimental, expect them to change at any time.`,{code:`UNDICI-ES`})),e=a.converters.USVString(e,n,`url`),t=a.converters.EventSourceInitDict(t,n,`eventSourceInitDict`),this.#o=t.dispatcher,this.#s={lastEventId:``,reconnectionTime:m};let r=f,o;try{o=new URL(e,r.settingsObject.baseUrl),this.#s.origin=o.origin}catch(e){throw new DOMException(e,`SyntaxError`)}this.#t=o.href;let s=`anonymous`;t.withCredentials&&(s=`use-credentials`,this.#n=!0);let c={redirect:`follow`,keepalive:!0,mode:`cors`,credentials:s===`anonymous`?`same-origin`:`omit`,referrer:`no-referrer`};c.client=f.settingsObject,c.headersList=[[`accept`,{name:`accept`,value:`text/event-stream`}]],c.cache=`no-store`,c.initiator=`other`,c.urlList=[new URL(this.#t)],this.#i=i(c),this.#c()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#n}#c(){if(this.#r===2)return;this.#r=0;let e={request:this.#i,dispatcher:this.#o};e.processResponseEndOfBody=e=>{l(e)&&(this.dispatchEvent(new Event(`error`)),this.close()),this.#l()},e.processResponse=e=>{if(l(e))if(e.aborted){this.close(),this.dispatchEvent(new Event(`error`));return}else{this.#l();return}let t=e.headersList.get(`content-type`,!0),r=t===null?`failure`:s(t),i=r!==`failure`&&r.essence===`text/event-stream`;if(e.status!==200||i===!1){this.close(),this.dispatchEvent(new Event(`error`));return}this.#r=1,this.dispatchEvent(new Event(`open`)),this.#s.origin=e.urlList[e.urlList.length-1].origin;let a=new o({eventSourceSettings:this.#s,push:e=>{this.dispatchEvent(c(e.type,e.options))}});n(e.body.stream,a,e=>{e?.aborted===!1&&(this.close(),this.dispatchEvent(new Event(`error`)))})},this.#a=r(e)}async#l(){this.#r!==2&&(this.#r=0,this.dispatchEvent(new Event(`error`)),await u(this.#s.reconnectionTime),this.#r===0&&(this.#s.lastEventId.length&&this.#i.headersList.set(`last-event-id`,this.#s.lastEventId,!0),this.#c()))}close(){a.brandCheck(this,e),this.#r!==2&&(this.#r=2,this.#a.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){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 onmessage(){return this.#e.message}set onmessage(e){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 onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof e==`function`?(this.#e.error=e,this.addEventListener(`error`,e)):this.#e.error=null}};let g={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(h,g),Object.defineProperties(h.prototype,g),Object.defineProperties(h.prototype,{close:d,onerror:d,onmessage:d,onopen:d,readyState:d,url:d,withCredentials:d}),a.converters.EventSourceInitDict=a.dictionaryConverter([{key:`withCredentials`,converter:a.converters.boolean,defaultValue:()=>!1},{key:`dispatcher`,converter:a.converters.any}]),t.exports={EventSource:h,defaultReconnectionTime:m}})),hn=I(((e,t)=>{let n=nt(),r=Pe(),i=ot(),a=st(),o=ct(),s=lt(),c=ut(),l=ft(),u=R(),d=z(),{InvalidArgumentError:f}=u,p=xt(),m=Le(),h=Et(),g=At(),_=Dt(),v=St(),y=dt(),{getGlobalDispatcher:b,setGlobalDispatcher:x}=jt(),S=Mt(),C=et(),w=tt();Object.assign(r.prototype,p),t.exports.Dispatcher=r,t.exports.Client=n,t.exports.Pool=i,t.exports.BalancedPool=a,t.exports.Agent=o,t.exports.ProxyAgent=s,t.exports.EnvHttpProxyAgent=c,t.exports.RetryAgent=l,t.exports.RetryHandler=y,t.exports.DecoratorHandler=S,t.exports.RedirectHandler=C,t.exports.createRedirectInterceptor=w,t.exports.interceptors={redirect:Nt(),retry:Pt(),dump:Ft(),dns:It()},t.exports.buildConnector=m,t.exports.errors=u,t.exports.util={parseHeaders:d.parseHeaders,headerNameToString:d.headerNameToString};function T(e){return(t,n,r)=>{if(typeof n==`function`&&(r=n,n=null),!t||typeof t!=`string`&&typeof t!=`object`&&!(t instanceof URL))throw new f(`invalid url`);if(n!=null&&typeof n!=`object`)throw new f(`invalid opts`);if(n&&n.path!=null){if(typeof n.path!=`string`)throw new f(`invalid opts.path`);let e=n.path;n.path.startsWith(`/`)||(e=`/${e}`),t=new URL(d.parseOrigin(t).origin+e)}else n||=typeof t==`object`?t:{},t=d.parseURL(t);let{agent:i,dispatcher:a=b()}=n;if(i)throw new f(`unsupported opts.agent. Did you mean opts.client?`);return e.call(a,{...n,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?`PUT`:`GET`)},r)}}t.exports.setGlobalDispatcher=x,t.exports.getGlobalDispatcher=b;let E=Vt().fetch;t.exports.fetch=async function(e,t=void 0){try{return await E(e,t)}catch(e){throw e&&typeof e==`object`&&Error.captureStackTrace(e),e}},t.exports.Headers=Lt().Headers,t.exports.Response=Rt().Response,t.exports.Request=Bt().Request,t.exports.FormData=Ye().FormData,t.exports.File=globalThis.File??L(`node:buffer`).File,t.exports.FileReader=Kt().FileReader;let{setGlobalOrigin:D,getGlobalOrigin:O}=Ue();t.exports.setGlobalOrigin=D,t.exports.getGlobalOrigin=O;let{CacheStorage:k}=Xt(),{kConstruct:A}=qt();t.exports.caches=new k(A);let{deleteCookie:j,getCookies:M,getSetCookies:N,setCookie:P}=en();t.exports.deleteCookie=j,t.exports.getCookies=M,t.exports.getSetCookies=N,t.exports.setCookie=P;let{parseMIMEType:ee,serializeAMimeType:te}=We();t.exports.parseMIMEType=ee,t.exports.serializeAMimeType=te;let{CloseEvent:ne,ErrorEvent:F,MessageEvent:re}=tn();t.exports.WebSocket=dn().WebSocket,t.exports.CloseEvent=ne,t.exports.ErrorEvent=F,t.exports.MessageEvent=re,t.exports.request=T(p.request),t.exports.stream=T(p.stream),t.exports.pipeline=T(p.pipeline),t.exports.connect=T(p.connect),t.exports.upgrade=T(p.upgrade),t.exports.MockClient=h,t.exports.MockPool=_,t.exports.MockAgent=g,t.exports.mockErrors=v;let{EventSource:ie}=mn();t.exports.EventSource=ie})),gn=me(Oe(),1),_n=hn(),vn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},yn;(function(e){e[e.OK=200]=`OK`,e[e.MultipleChoices=300]=`MultipleChoices`,e[e.MovedPermanently=301]=`MovedPermanently`,e[e.ResourceMoved=302]=`ResourceMoved`,e[e.SeeOther=303]=`SeeOther`,e[e.NotModified=304]=`NotModified`,e[e.UseProxy=305]=`UseProxy`,e[e.SwitchProxy=306]=`SwitchProxy`,e[e.TemporaryRedirect=307]=`TemporaryRedirect`,e[e.PermanentRedirect=308]=`PermanentRedirect`,e[e.BadRequest=400]=`BadRequest`,e[e.Unauthorized=401]=`Unauthorized`,e[e.PaymentRequired=402]=`PaymentRequired`,e[e.Forbidden=403]=`Forbidden`,e[e.NotFound=404]=`NotFound`,e[e.MethodNotAllowed=405]=`MethodNotAllowed`,e[e.NotAcceptable=406]=`NotAcceptable`,e[e.ProxyAuthenticationRequired=407]=`ProxyAuthenticationRequired`,e[e.RequestTimeout=408]=`RequestTimeout`,e[e.Conflict=409]=`Conflict`,e[e.Gone=410]=`Gone`,e[e.TooManyRequests=429]=`TooManyRequests`,e[e.InternalServerError=500]=`InternalServerError`,e[e.NotImplemented=501]=`NotImplemented`,e[e.BadGateway=502]=`BadGateway`,e[e.ServiceUnavailable=503]=`ServiceUnavailable`,e[e.GatewayTimeout=504]=`GatewayTimeout`})(yn||={});var bn;(function(e){e.Accept=`accept`,e.ContentType=`content-type`})(bn||={});var xn;(function(e){e.ApplicationJson=`application/json`})(xn||={});const Sn=[yn.MovedPermanently,yn.ResourceMoved,yn.SeeOther,yn.TemporaryRedirect,yn.PermanentRedirect],Cn=[yn.BadGateway,yn.ServiceUnavailable,yn.GatewayTimeout],wn=[`OPTIONS`,`GET`,`DELETE`,`HEAD`];var Tn=class e extends Error{constructor(t,n){super(t),this.name=`HttpClientError`,this.statusCode=n,Object.setPrototypeOf(this,e.prototype)}},En=class{constructor(e){this.message=e}readBody(){return vn(this,void 0,void 0,function*(){return new Promise(e=>vn(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on(`data`,e=>{t=Buffer.concat([t,e])}),this.message.on(`end`,()=>{e(t.toString())})}))})}readBodyBuffer(){return vn(this,void 0,void 0,function*(){return new Promise(e=>vn(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}},Dn=class{constructor(e,t,n){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=this._getUserAgentWithOrchestrationId(e),this.handlers=t||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}options(e,t){return vn(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return vn(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return vn(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return vn(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return vn(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return vn(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return vn(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return vn(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e){return vn(this,arguments,void 0,function*(e,t={}){t[bn.Accept]=this._getExistingOrDefaultHeader(t,bn.Accept,xn.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t){return vn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[bn.Accept]=this._getExistingOrDefaultHeader(n,bn.Accept,xn.ApplicationJson),n[bn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,xn.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t){return vn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[bn.Accept]=this._getExistingOrDefaultHeader(n,bn.Accept,xn.ApplicationJson),n[bn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,xn.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t){return vn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[bn.Accept]=this._getExistingOrDefaultHeader(n,bn.Accept,xn.ApplicationJson),n[bn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,xn.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return vn(this,void 0,void 0,function*(){if(this._disposed)throw Error(`Client has already been disposed.`);let i=new URL(t),a=this._prepareRequest(e,i,r),o=this._allowRetries&&wn.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===yn.Unauthorized){let e;for(let t of this.handlers)if(t.canHandleAuthentication(c)){e=t;break}return e?e.handleAuthentication(this,a,n):c}let t=this._maxRedirects;for(;c.message.statusCode&&Sn.includes(c.message.statusCode)&&this._allowRedirects&&t>0;){let o=c.message.headers.location;if(!o)break;let s=new URL(o);if(i.protocol===`https:`&&i.protocol!==s.protocol&&!this._allowRedirectDowngrade)throw 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(),s.hostname!==i.hostname)for(let e in r)e.toLowerCase()===`authorization`&&delete r[e];a=this._prepareRequest(e,s,r),c=yield this.requestRaw(a,n),t--}if(!c.message.statusCode||!Cn.includes(c.message.statusCode))return c;s+=1,s{function i(e,t){e?r(e):t?n(t):r(Error(`Unknown error`))}this.requestRawWithCallback(e,t,i)})})}requestRawWithCallback(e,t,n){typeof t==`string`&&(e.options.headers||(e.options.headers={}),e.options.headers[`Content-Length`]=Buffer.byteLength(t,`utf8`));let r=!1;function i(e,t){r||(r=!0,n(e,t))}let a=e.httpModule.request(e.options,e=>{i(void 0,new En(e))}),o;a.on(`socket`,e=>{o=e}),a.setTimeout(this._socketTimeout||3*6e4,()=>{o&&o.end(),i(Error(`Request timeout: ${e.options.path}`))}),a.on(`error`,function(e){i(e)}),t&&typeof t==`string`&&a.write(t,`utf8`),t&&typeof t!=`string`?(t.on(`close`,function(){a.end()}),t.pipe(a)):a.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),n=Ce(t);if(n&&n.hostname)return this._getProxyAgentDispatcher(t,n)}_prepareRequest(e,t,n){let r={};r.parsedUrl=t;let i=r.parsedUrl.protocol===`https:`;r.httpModule=i?p:f;let a=i?443:80;if(r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):a,r.options.path=(r.parsedUrl.pathname||``)+(r.parsedUrl.search||``),r.options.method=e,r.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(r.options.headers[`user-agent`]=this.userAgent),r.options.agent=this._getAgent(r.parsedUrl),this.handlers)for(let e of this.handlers)e.prepareRequest(r.options);return r}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},On(this.requestOptions.headers),On(e||{})):On(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){let e=On(this.requestOptions.headers)[t];e&&(r=typeof e==`number`?e.toString():e)}let i=e[t];return i===void 0?r===void 0?n:r:typeof i==`number`?i.toString():i}_getExistingOrDefaultContentTypeHeader(e,t){let n;if(this.requestOptions&&this.requestOptions.headers){let e=On(this.requestOptions.headers)[bn.ContentType];e&&(n=typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):e)}let r=e[bn.ContentType];return r===void 0?n===void 0?t:n:typeof r==`number`?String(r):Array.isArray(r)?r.join(`, `):r}_getAgent(e){let t,n=Ce(e),r=n&&n.hostname;if(this._keepAlive&&r&&(t=this._proxyAgent),r||(t=this._agent),t)return t;let i=e.protocol===`https:`,a=100;if(this.requestOptions&&(a=this.requestOptions.maxSockets||f.globalAgent.maxSockets),n&&n.hostname){let e={maxSockets:a,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},r,o=n.protocol===`https:`;r=i?o?gn.httpsOverHttps:gn.httpsOverHttp:o?gn.httpOverHttps:gn.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:a};t=i?new p.Agent(e):new f.Agent(e),this._agent=t}return i&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_getProxyAgentDispatcher(e,t){let n;if(this._keepAlive&&(n=this._proxyAgentDispatcher),n)return n;let r=e.protocol===`https:`;return n=new _n.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(t.username||t.password)&&{token:`Basic ${Buffer.from(`${t.username}:${t.password}`).toString(`base64`)}`})),this._proxyAgentDispatcher=n,r&&this._ignoreSslError&&(n.options=Object.assign(n.options.requestTls||{},{rejectUnauthorized:!1})),n}_getUserAgentWithOrchestrationId(e){let t=e||`actions/http-client`,n=process.env.ACTIONS_ORCHESTRATION_ID;return n?`${t} actions_orchestration_id/${n.replace(/[^a-z0-9_.-]/gi,`_`)}`:t}_performExponentialBackoff(e){return vn(this,void 0,void 0,function*(){e=Math.min(10,e);let t=5*2**e;return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return vn(this,void 0,void 0,function*(){return new Promise((n,r)=>vn(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===yn.NotFound&&n(a);function o(e,t){if(typeof t==`string`){let e=new Date(t);if(!isNaN(e.valueOf()))return e}return t}let s,c;try{c=yield e.readBody(),c&&c.length>0&&(s=t&&t.deserializeDates?JSON.parse(c,o):JSON.parse(c),a.result=s),a.headers=e.message.headers}catch{}if(i>299){let e;e=s&&s.message?s.message:c&&c.length>0?c:`Failed request: (${i})`;let t=new Tn(e,i);t.result=a.result,r(t)}else n(a)}))})}};const On=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{});var kn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},An=class{constructor(e){this.token=e}prepareRequest(e){if(!e.headers)throw Error(`The request has no headers`);e.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return kn(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},jn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const{access:Mn,appendFile:Nn,writeFile:Pn}=l,Fn=`GITHUB_STEP_SUMMARY`,In=new class{constructor(){this._buffer=``}filePath(){return jn(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[Fn];if(!e)throw Error(`Unable to find environment variable for $${Fn}. Check if your runtime environment supports job summaries.`);try{yield Mn(e,s.R_OK|s.W_OK)}catch{throw Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,t,n={}){let r=Object.entries(n).map(([e,t])=>` ${e}="${t}"`).join(``);return t?`<${e}${r}>${t}`:`<${e}${r}>`}write(e){return jn(this,void 0,void 0,function*(){let t=!!e?.overwrite,n=yield this.filePath();return yield(t?Pn:Nn)(n,this._buffer,{encoding:`utf8`}),this.emptyBuffer()})}clear(){return jn(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer=``,this}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(i)}addCodeBlock(e,t){let n=Object.assign({},t&&{lang:t}),r=this.wrap(`pre`,this.wrap(`code`,e),n);return this.addRaw(r).addEOL()}addList(e,t=!1){let n=t?`ol`:`ul`,r=e.map(e=>this.wrap(`li`,e)).join(``),i=this.wrap(n,r);return this.addRaw(i).addEOL()}addTable(e){let t=e.map(e=>{let t=e.map(e=>{if(typeof e==`string`)return this.wrap(`td`,e);let{header:t,data:n,colspan:r,rowspan:i}=e,a=t?`th`:`td`,o=Object.assign(Object.assign({},r&&{colspan:r}),i&&{rowspan:i});return this.wrap(a,n,o)}).join(``);return this.wrap(`tr`,t)}).join(``),n=this.wrap(`table`,t);return this.addRaw(n).addEOL()}addDetails(e,t){let n=this.wrap(`details`,this.wrap(`summary`,e)+t);return this.addRaw(n).addEOL()}addImage(e,t,n){let{width:r,height:i}=n||{},a=Object.assign(Object.assign({},r&&{width:r}),i&&{height:i}),o=this.wrap(`img`,null,Object.assign({src:e,alt:t},a));return this.addRaw(o).addEOL()}addHeading(e,t){let n=`h${t}`,r=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`].includes(n)?n:`h1`,i=this.wrap(r,e);return this.addRaw(i).addEOL()}addSeparator(){let e=this.wrap(`hr`,null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap(`br`,null);return this.addRaw(e).addEOL()}addQuote(e,t){let n=Object.assign({},t&&{cite:t}),r=this.wrap(`blockquote`,e,n);return this.addRaw(r).addEOL()}addLink(e,t){let n=this.wrap(`a`,e,{href:t});return this.addRaw(n).addEOL()}};var Ln=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const{chmod:Rn,copyFile:zn,lstat:Bn,mkdir:Vn,open:Hn,readdir:Un,rename:Wn,rm:Gn,rmdir:Kn,stat:qn,symlink:Jn,unlink:Yn}=o.promises,Xn=process.platform===`win32`;function Zn(e){return Ln(this,void 0,void 0,function*(){let t=yield o.promises.readlink(e);return Xn&&!t.endsWith(`\\`)?`${t}\\`:t})}o.constants.O_RDONLY;function Qn(e){return Ln(this,void 0,void 0,function*(){try{yield qn(e)}catch(e){if(e.code===`ENOENT`)return!1;throw e}return!0})}function $n(e){if(e=tr(e),!e)throw Error(`isRooted() parameter "p" cannot be empty`);return Xn?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function er(e,t){return Ln(this,void 0,void 0,function*(){let n;try{n=yield qn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Xn){let n=d.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===n))return e}else if(nr(n))return e}let r=e;for(let i of t){e=r+i,n=void 0;try{n=yield qn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Xn){try{let t=d.dirname(e),n=d.basename(e).toUpperCase();for(let r of yield Un(t))if(n===r.toUpperCase()){e=d.join(t,r);break}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else if(nr(n))return e}}return``})}function tr(e){return e||=``,Xn?(e=e.replace(/\//g,`\\`),e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function nr(e){return(e.mode&1)>0||(e.mode&8)>0&&process.getgid!==void 0&&e.gid===process.getgid()||(e.mode&64)>0&&process.getuid!==void 0&&e.uid===process.getuid()}var rr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function ir(e,t){return rr(this,arguments,void 0,function*(e,t,n={}){let{force:r,recursive:i,copySourceDirectory:a}=lr(n),o=(yield Qn(t))?yield qn(t):null;if(o&&o.isFile()&&!r)return;let s=o&&o.isDirectory()&&a?d.join(t,d.basename(e)):t;if(!(yield Qn(e)))throw Error(`no such file or directory: ${e}`);if((yield qn(e)).isDirectory())if(i)yield ur(e,s,0,r);else throw Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`);else{if(d.relative(e,s)===``)throw Error(`'${s}' and '${e}' are the same file`);yield dr(e,s,r)}})}function ar(e){return rr(this,void 0,void 0,function*(){if(Xn&&/[*"<>|]/.test(e))throw Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield Gn(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(e){throw Error(`File was unable to be removed ${e}`)}})}function or(e){return rr(this,void 0,void 0,function*(){_(e,`a path argument must be provided`),yield Vn(e,{recursive:!0})})}function sr(e,t){return rr(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);if(t){let t=yield sr(e,!1);if(!t)throw Error(Xn?`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`:`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);return t}let n=yield cr(e);return n&&n.length>0?n[0]:``})}function cr(e){return rr(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);let t=[];if(Xn&&process.env.PATHEXT)for(let e of process.env.PATHEXT.split(d.delimiter))e&&t.push(e);if($n(e)){let n=yield er(e,t);return n?[n]:[]}if(e.includes(d.sep))return[];let n=[];if(process.env.PATH)for(let e of process.env.PATH.split(d.delimiter))e&&n.push(e);let r=[];for(let i of n){let n=yield er(d.join(i,e),t);n&&r.push(n)}return r})}function lr(e){return{force:e.force==null?!0:e.force,recursive:!!e.recursive,copySourceDirectory:e.copySourceDirectory==null?!0:!!e.copySourceDirectory}}function ur(e,t,n,r){return rr(this,void 0,void 0,function*(){if(n>=255)return;n++,yield or(t);let i=yield Un(e);for(let a of i){let i=`${e}/${a}`,o=`${t}/${a}`;(yield Bn(i)).isDirectory()?yield ur(i,o,n,r):yield dr(i,o,r)}yield Rn(t,(yield qn(e)).mode)})}function dr(e,t,n){return rr(this,void 0,void 0,function*(){if((yield Bn(e)).isSymbolicLink()){try{yield Bn(t),yield Yn(t)}catch(e){e.code===`EPERM`&&(yield Rn(t,`0666`),yield Yn(t))}yield Jn(yield Zn(e),t,Xn?`junction`:null)}else (!(yield Qn(t))||n)&&(yield zn(e,t))})}var fr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const pr=process.platform===`win32`;var mr=class extends m.EventEmitter{constructor(e,t,n){if(super(),!e)throw Error(`Parameter 'toolPath' cannot be null or empty.`);this.toolPath=e,this.args=t||[],this.options=n||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){let n=this._getSpawnFileName(),r=this._getSpawnArgs(e),i=t?``:`[command]`;if(pr)if(this._isCmdFile()){i+=n;for(let e of r)i+=` ${e}`}else if(e.windowsVerbatimArguments){i+=`"${n}"`;for(let e of r)i+=` ${e}`}else{i+=this._windowsQuoteCmdArg(n);for(let e of r)i+=` ${this._windowsQuoteCmdArg(e)}`}else{i+=n;for(let e of r)i+=` ${e}`}return i}_processLineBuffer(e,t,r){try{let i=t+e.toString(),a=i.indexOf(n.EOL);for(;a>-1;)r(i.substring(0,a)),i=i.substring(a+n.EOL.length),a=i.indexOf(n.EOL);return i}catch(e){return this._debug(`error processing line. Failed with error ${e}`),``}}_getSpawnFileName(){return pr&&this._isCmdFile()?process.env.COMSPEC||`cmd.exe`:this.toolPath}_getSpawnArgs(e){if(pr&&this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let n of this.args)t+=` `,t+=e.windowsVerbatimArguments?n:this._windowsQuoteCmdArg(n);return t+=`"`,[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){let e=this.toolPath.toUpperCase();return this._endsWith(e,`.CMD`)||this._endsWith(e,`.BAT`)}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return`""`;let t=[` `,` `,`&`,`(`,`)`,`[`,`]`,`{`,`}`,`^`,`=`,`;`,`!`,`'`,`+`,`,`,"`",`~`,`|`,`<`,`>`,`"`],n=!1;for(let r of e)if(t.some(e=>e===r)){n=!0;break}if(!n)return e;let r=`"`,i=!0;for(let t=e.length;t>0;t--)r+=e[t-1],i&&e[t-1]===`\\`?r+=`\\`:e[t-1]===`"`?(i=!0,r+=`"`):i=!1;return r+=`"`,r.split(``).reverse().join(``)}_uvQuoteCmdArg(e){if(!e)return`""`;if(!e.includes(` `)&&!e.includes(` `)&&!e.includes(`"`))return e;if(!e.includes(`"`)&&!e.includes(`\\`))return`"${e}"`;let t=`"`,n=!0;for(let r=e.length;r>0;r--)t+=e[r-1],n&&e[r-1]===`\\`?t+=`\\`:e[r-1]===`"`?(n=!0,t+=`\\`):n=!1;return t+=`"`,t.split(``).reverse().join(``)}_cloneExecOptions(e){e||={};let t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){e||={};let n={};return n.cwd=e.cwd,n.env=e.env,n.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(n.argv0=`"${t}"`),n}exec(){return fr(this,void 0,void 0,function*(){return!$n(this.toolPath)&&(this.toolPath.includes(`/`)||pr&&this.toolPath.includes(`\\`))&&(this.toolPath=d.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield sr(this.toolPath,!0),new Promise((e,t)=>fr(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug(`arguments:`);for(let e of this.args)this._debug(` ${e}`);let r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+n.EOL);let i=new gr(r,this.toolPath);if(i.on(`debug`,e=>{this._debug(e)}),this.options.cwd&&!(yield Qn(this.options.cwd)))return t(Error(`The cwd: ${this.options.cwd} does not exist!`));let a=this._getSpawnFileName(),o=O.spawn(a,this._getSpawnArgs(r),this._getSpawnOptions(this.options,a)),s=``;o.stdout&&o.stdout.on(`data`,e=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(e),!r.silent&&r.outStream&&r.outStream.write(e),s=this._processLineBuffer(e,s,e=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(e)})});let c=``;if(o.stderr&&o.stderr.on(`data`,e=>{i.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(e),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(e),c=this._processLineBuffer(e,c,e=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(e)})}),o.on(`error`,e=>{i.processError=e.message,i.processExited=!0,i.processClosed=!0,i.CheckComplete()}),o.on(`exit`,e=>{i.processExitCode=e,i.processExited=!0,this._debug(`Exit code ${e} received from tool '${this.toolPath}'`),i.CheckComplete()}),o.on(`close`,e=>{i.processExitCode=e,i.processExited=!0,i.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),i.CheckComplete()}),i.on(`done`,(n,r)=>{s.length>0&&this.emit(`stdline`,s),c.length>0&&this.emit(`errline`,c),o.removeAllListeners(),n?t(n):e(r)}),this.options.input){if(!o.stdin)throw Error(`child process missing stdin`);o.stdin.end(this.options.input)}}))})}};function hr(e){let t=[],n=!1,r=!1,i=``;function a(e){r&&e!==`"`&&(i+=`\\`),i+=e,r=!1}for(let o=0;o0&&(t.push(i),i=``);continue}a(s)}return i.length>0&&t.push(i.trim()),t}var gr=class e extends m.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError=``,this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw Error(`toolPath must not be empty`);this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=k(e.HandleTimeout,this.delay,this)))}_debug(e){this.emit(`debug`,e)}_setResult(){let e;this.processExited&&(this.processError?e=Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?e=Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(e=Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&=(clearTimeout(this.timeout),null),this.done=!0,this.emit(`done`,e,this.processExitCode)}static HandleTimeout(e){if(!e.done){if(!e.processClosed&&e.processExited){let t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}},_r=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function vr(e,t,n){return _r(this,void 0,void 0,function*(){let r=hr(e);if(r.length===0)throw Error(`Parameter 'commandLine' cannot be null or empty.`);let i=r[0];return t=r.slice(1).concat(t||[]),new mr(i,t,n).exec()})}function yr(e,t,n){return _r(this,void 0,void 0,function*(){let r=``,i=``,a=new D(`utf8`),o=new D(`utf8`),s=n?.listeners?.stdout,c=n?.listeners?.stderr,l=Object.assign(Object.assign({},n?.listeners),{stdout:e=>{r+=a.write(e),s&&s(e)},stderr:e=>{i+=o.write(e),c&&c(e)}}),u=yield vr(e,t,Object.assign(Object.assign({},n),{listeners:l}));return r+=a.end(),i+=o.end(),{exitCode:u,stdout:r,stderr:i}})}r.platform(),r.arch();var br;(function(e){e[e.Success=0]=`Success`,e[e.Failure=1]=`Failure`})(br||={});function xr(e,t){let n=he(t);if(process.env[e]=n,process.env.GITHUB_ENV)return xe(`ENV`,Se(e,t));_e(`set-env`,{name:e},n)}function Sr(e){_e(`add-mask`,{},e)}function Cr(e){process.env.GITHUB_PATH?xe(`PATH`,e):_e(`add-path`,{},e),process.env.PATH=`${e}${d.delimiter}${process.env.PATH}`}function wr(e,t){let n=process.env[`INPUT_${e.replace(/ /g,`_`).toUpperCase()}`]||``;if(t&&t.required&&!n)throw Error(`Input required and not supplied: ${e}`);return t&&t.trimWhitespace===!1?n:n.trim()}function Tr(e,t){if(process.env.GITHUB_OUTPUT)return xe(`OUTPUT`,Se(e,t));process.stdout.write(n.EOL),_e(`set-output`,{name:e},he(t))}function Er(e){process.exitCode=br.Failure,Or(e)}function Dr(){return process.env.RUNNER_DEBUG===`1`}function B(e){_e(`debug`,{},e)}function Or(e,t={}){_e(`error`,ge(t),e instanceof Error?e.toString():e)}function kr(e,t={}){_e(`warning`,ge(t),e instanceof Error?e.toString():e)}function Ar(e){process.stdout.write(e+n.EOL)}function jr(e,t){if(process.env.GITHUB_STATE)return xe(`STATE`,Se(e,t));_e(`save-state`,{name:e},he(t))}function Mr(e){return process.env[`STATE_${e}`]||``}function Nr(e){return e instanceof Error?e.message:String(e)}const Pr=[`token`,`password`,`secret`,`key`,`auth`,`credential`,`bearer`,`apikey`,`api_key`,`access_token`,`refresh_token`,`private`];function Fr(e,t){let n=e.toLowerCase();return t.some(e=>n.includes(e.toLowerCase()))}function Ir(e,t=Pr){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Ir(e,t));let n={};for(let[r,i]of Object.entries(e))Fr(r,t)&&typeof i==`string`?n[r]=`[REDACTED]`:typeof i==`object`&&i?n[r]=Ir(i,t):n[r]=i;return n}function Lr(e,t,n,r){let i=Ir({...n,...r}),a={timestamp:new Date().toISOString(),level:e,message:t,...i};if(r!=null&&`error`in r&&r.error instanceof Error){let e=r.error;a.error={message:e.message,name:e.name,stack:e.stack}}return JSON.stringify(a)}function Rr(e){return{debug:(t,n)=>{B(Lr(`debug`,t,e,n))},info:(t,n)=>{Ar(Lr(`info`,t,e,n))},warning:(t,n)=>{kr(Lr(`warning`,t,e,n))},error:(t,n)=>{Or(Lr(`error`,t,e,n))}}}const zr={SHOULD_SAVE_CACHE:`shouldSaveCache`,SESSION_ID:`sessionId`,CACHE_SAVED:`cacheSaved`,OPENCODE_VERSION:`opencodeVersion`},Br=`sisyphus`,Vr=18e5,Hr={providerID:`opencode`,modelID:`big-pickle`},Ur=`1.3.3`,Wr=`1.3.11`,Gr=`3.14.0`,Kr=`opencode-storage`,qr=`opencode-tools`,Jr=6e5,Yr=`fro-bot-dedup-v1`;function Xr(){let e=t.env.XDG_DATA_HOME;return e!=null&&e.trim().length>0?e:j.join(M.homedir(),`.local`,`share`)}function Zr(){return j.join(Xr(),`opencode`,`storage`)}function Qr(){return j.join(Xr(),`opencode`,`auth.json`)}function $r(){return j.join(Xr(),`opencode`,`log`)}function ei(){let e=t.env.OPENCODE_PROMPT_ARTIFACT;return e===`true`||e===`1`}function ti(){let e=t.env.RUNNER_OS;if(e!=null&&e.trim().length>0)return e;switch(M.platform()){case`darwin`:return`macOS`;case`win32`:return`Windows`;case`aix`:case`android`:case`freebsd`:case`haiku`:case`linux`:case`openbsd`:case`sunos`:case`cygwin`:case`netbsd`:return`Linux`}}function ni(){let e=t.env.GITHUB_REPOSITORY;return e!=null&&e.trim().length>0?e:`unknown/unknown`}function ri(){let e=t.env.GITHUB_REF_NAME;return e!=null&&e.trim().length>0?e:`main`}function ii(){let e=t.env.GITHUB_RUN_ID;return e!=null&&e.trim().length>0?Number(e):0}function ai(){let e=t.env.GITHUB_WORKSPACE;return e!=null&&e.trim().length>0?e:t.cwd()}var oi=I(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),si=I(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),ci=I(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=oi(),a=si();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),li=I(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),ui=I(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:er(t,e)}})),di=I(((e,t)=>{let n=si(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=oi(),{safeRe:a,t:o}=ci(),s=li(),{compareIdentifiers:c}=ui();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&tt.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),fi=I(((e,t)=>{let n=di();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),pi=I(((e,t)=>{let n=fi();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),mi=I(((e,t)=>{let n=fi();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),hi=I(((e,t)=>{let n=di();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),gi=I(((e,t)=>{let n=fi();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),_i=I(((e,t)=>{let n=di();t.exports=(e,t)=>new n(e,t).major})),vi=I(((e,t)=>{let n=di();t.exports=(e,t)=>new n(e,t).minor})),yi=I(((e,t)=>{let n=di();t.exports=(e,t)=>new n(e,t).patch})),bi=I(((e,t)=>{let n=fi();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),xi=I(((e,t)=>{let n=di();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Si=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(t,e,r)})),Ci=I(((e,t)=>{let n=xi();t.exports=(e,t)=>n(e,t,!0)})),wi=I(((e,t)=>{let n=di();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Ti=I(((e,t)=>{let n=wi();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ei=I(((e,t)=>{let n=wi();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Di=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)>0})),Oi=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)<0})),ki=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)===0})),Ai=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)!==0})),ji=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)>=0})),Mi=I(((e,t)=>{let n=xi();t.exports=(e,t,r)=>n(e,t,r)<=0})),Ni=I(((e,t)=>{let n=ki(),r=Ai(),i=Di(),a=ji(),o=Oi(),s=Mi();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),Pi=I(((e,t)=>{let n=di(),r=fi(),{safeRe:i,t:a}=ci();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),Fi=I(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),Ii=I(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,O(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>D(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=E(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>T(e,t)).join(` `)),T=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},E=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),D=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),O=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),k=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Li=I(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=li(),{safeRe:i,t:a}=ci(),o=Ni(),s=si(),c=di(),l=Ii()})),Ri=I(((e,t)=>{let n=Ii();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),zi=I(((e,t)=>{let n=Ii();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Bi=I(((e,t)=>{let n=di(),r=Ii();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),Vi=I(((e,t)=>{let n=di(),r=Ii();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Hi=I(((e,t)=>{let n=di(),r=Ii(),i=Di();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),Ui=I(((e,t)=>{let n=Ii();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),Wi=I(((e,t)=>{let n=di(),r=Li(),{ANY:i}=r,a=Ii(),o=Ri(),s=Di(),c=Oi(),l=Mi(),u=ji();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),Gi=I(((e,t)=>{let n=Wi();t.exports=(e,t,r)=>n(e,t,`>`,r)})),Ki=I(((e,t)=>{let n=Wi();t.exports=(e,t,r)=>n(e,t,`<`,r)})),qi=I(((e,t)=>{let n=Ii();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),Ji=I(((e,t)=>{let n=Ri(),r=xi();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length{let n=Ii(),r=Li(),{ANY:i}=r,a=Ri(),o=xi(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),Xi=I(((e,t)=>{let n=ci(),r=oi(),i=di(),a=ui();t.exports={parse:fi(),valid:pi(),clean:mi(),inc:hi(),diff:gi(),major:_i(),minor:vi(),patch:yi(),prerelease:bi(),compare:xi(),rcompare:Si(),compareLoose:Ci(),compareBuild:wi(),sort:Ti(),rsort:Ei(),gt:Di(),lt:Oi(),eq:ki(),neq:Ai(),gte:ji(),lte:Mi(),cmp:Ni(),coerce:Pi(),Comparator:Li(),Range:Ii(),satisfies:Ri(),toComparators:zi(),maxSatisfying:Bi(),minSatisfying:Vi(),minVersion:Hi(),validRange:Ui(),outside:Wi(),gtr:Gi(),ltr:Ki(),intersects:qi(),simplifyRange:Ji(),subset:Yi(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}));function Zi(e){let t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0,excludeHiddenFiles:!1};return e&&(typeof e.followSymbolicLinks==`boolean`&&(t.followSymbolicLinks=e.followSymbolicLinks,B(`followSymbolicLinks '${t.followSymbolicLinks}'`)),typeof e.implicitDescendants==`boolean`&&(t.implicitDescendants=e.implicitDescendants,B(`implicitDescendants '${t.implicitDescendants}'`)),typeof e.matchDirectories==`boolean`&&(t.matchDirectories=e.matchDirectories,B(`matchDirectories '${t.matchDirectories}'`)),typeof e.omitBrokenSymbolicLinks==`boolean`&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,B(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`)),typeof e.excludeHiddenFiles==`boolean`&&(t.excludeHiddenFiles=e.excludeHiddenFiles,B(`excludeHiddenFiles '${t.excludeHiddenFiles}'`))),t}const Qi=process.platform===`win32`;function $i(e){if(e=ia(e),Qi&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;let t=d.dirname(e);return Qi&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=ia(t)),t}function ea(e,t){if(g(e,`ensureAbsoluteRoot parameter 'root' must not be empty`),g(t,`ensureAbsoluteRoot parameter 'itemPath' must not be empty`),ta(t))return t;if(Qi){if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return g(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),t[0].toUpperCase()===e[0].toUpperCase()?t.length===2?`${t[0]}:\\${e.substr(3)}`:(e.endsWith(`\\`)||(e+=`\\`),`${t[0]}:\\${e.substr(3)}${t.substr(2)}`):`${t[0]}:\\${t.substr(2)}`}else if(ra(t).match(/^\\$|^\\[^\\]/)){let e=process.cwd();return g(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`}}return g(ta(e),`ensureAbsoluteRoot parameter 'root' must have an absolute root`),e.endsWith(`/`)||Qi&&e.endsWith(`\\`)||(e+=d.sep),e+t}function ta(e){return g(e,`hasAbsoluteRoot parameter 'itemPath' must not be empty`),e=ra(e),Qi?e.startsWith(`\\\\`)||/^[A-Z]:\\/i.test(e):e.startsWith(`/`)}function na(e){return g(e,`isRooted parameter 'itemPath' must not be empty`),e=ra(e),Qi?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function ra(e){return e||=``,Qi?(e=e.replace(/\//g,`\\`),(/^\\\\+[^\\]/.test(e)?`\\`:``)+e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function ia(e){return e?(e=ra(e),!e.endsWith(d.sep)||e===d.sep||Qi&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1)):``}var aa;(function(e){e[e.None=0]=`None`,e[e.Directory=1]=`Directory`,e[e.File=2]=`File`,e[e.All=3]=`All`})(aa||={});const oa=process.platform===`win32`;function sa(e){e=e.filter(e=>!e.negate);let t={};for(let n of e){let e=oa?n.searchPath.toUpperCase():n.searchPath;t[e]=`candidate`}let n=[];for(let r of e){let e=oa?r.searchPath.toUpperCase():r.searchPath;if(t[e]===`included`)continue;let i=!1,a=e,o=$i(a);for(;o!==a;){if(t[o]){i=!0;break}a=o,o=$i(a)}i||(n.push(r.searchPath),t[e]=`included`)}return n}function ca(e,t){let n=aa.None;for(let r of e)r.negate?n&=~r.match(t):n|=r.match(t);return n}function la(e,t){return e.some(e=>!e.negate&&e.partialMatch(t))}var ua=I(((e,t)=>{t.exports=function(e,t){for(var r=[],i=0;i{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i=0?c:l;r.length&&(s=[a,o])}return s}})),fa=I(((e,t)=>{var n=ua(),r=da();t.exports=p;var i=`\0SLASH`+Math.random()+`\0`,a=`\0OPEN`+Math.random()+`\0`,o=`\0CLOSE`+Math.random()+`\0`,s=`\0COMMA`+Math.random()+`\0`,c=`\0PERIOD`+Math.random()+`\0`;function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function u(e){return e.split(`\\\\`).join(i).split(`\\{`).join(a).split(`\\}`).join(o).split(`\\,`).join(s).split(`\\.`).join(c)}function d(e){return e.split(i).join(`\\`).split(a).join(`{`).split(o).join(`}`).split(s).join(`,`).split(c).join(`.`)}function f(e){if(!e)return[``];var t=[],n=r(`{`,`}`,e);if(!n)return e.split(`,`);var i=n.pre,a=n.body,o=n.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=f(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function p(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),v(u(e),!0).map(d)):[]}function m(e){return`{`+e+`}`}function h(e){return/^-?0\d/.test(e)}function g(e,t){return e<=t}function _(e,t){return e>=t}function v(e,t){var i=[],a=r(`{`,`}`,e);if(!a||/\$$/.test(a.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),u=s||c,d=a.body.indexOf(`,`)>=0;if(!u&&!d)return a.post.match(/,(?!,).*\}/)?(e=a.pre+`{`+a.body+o+a.post,v(e)):[e];var p;if(u)p=a.body.split(/\.\./);else if(p=f(a.body),p.length===1&&(p=v(p[0],!1).map(m),p.length===1)){var y=a.post.length?v(a.post,!1):[``];return y.map(function(e){return a.pre+p[0]+e})}var b=a.pre,y=a.post.length?v(a.post,!1):[``],x;if(u){var S=l(p[0]),C=l(p[1]),w=Math.max(p[0].length,p[1].length),T=p.length==3?Math.abs(l(p[2])):1,E=g;C0){var j=Array(A+1).join(`0`);k=O<0?`-`+j+k.slice(1):j+k}}x.push(k)}}else x=n(p,function(e){return v(e,!1)});for(var M=0;M{t.exports=h,h.Minimatch=g;var n=function(){try{return L(`path`)}catch{}}()||{sep:`/`};h.sep=n.sep;var r=h.GLOBSTAR=g.GLOBSTAR={},i=fa(),a={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},o=`[^/]`,s=o+`*?`,c=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,l=`(?:(?!(?:\\/|^)\\.).)*?`,u=d(`().*{}+?[]^$\\!`);function d(e){return e.split(``).reduce(function(e,t){return e[t]=!0,e},{})}var f=/\/+/;h.filter=p;function p(e,t){return t||={},function(n,r,i){return h(n,e,t)}}function m(e,t){t||={};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}h.defaults=function(e){if(!e||typeof e!=`object`||!Object.keys(e).length)return h;var t=h,n=function(n,r,i){return t(n,r,m(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,m(e,r))},n.Minimatch.defaults=function(n){return t.defaults(m(e,n)).Minimatch},n.filter=function(n,r){return t.filter(n,m(e,r))},n.defaults=function(n){return t.defaults(m(e,n))},n.makeRe=function(n,r){return t.makeRe(n,m(e,r))},n.braceExpand=function(n,r){return t.braceExpand(n,m(e,r))},n.match=function(n,r,i){return t.match(n,r,m(e,i))},n},g.defaults=function(e){return h.defaults(e).Minimatch};function h(e,t,n){return x(t),n||={},!n.nocomment&&t.charAt(0)===`#`?!1:new g(t,n).match(e)}function g(e,t){if(!(this instanceof g))return new g(e,t);x(e),t||={},e=e.trim(),!t.allowWindowsEscape&&n.sep!==`/`&&(e=e.split(n.sep).join(`/`)),this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion===void 0?200:t.maxGlobstarRecursion,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}g.prototype.debug=function(){},g.prototype.make=_;function _(){var e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(f)}),this.debug(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return e.indexOf(!1)===-1}),this.debug(this.pattern,n),this.set=n}g.prototype.parseNegate=v;function v(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;ib)throw TypeError(`pattern is too long`)};g.prototype.parse=C;var S={};function C(e,t){x(e);var n=this.options;if(e===`**`)if(n.noglobstar)e=`*`;else return r;if(e===``)return``;var i=``,c=!!n.nocase,l=!1,d=[],f=[],p,m=!1,h=-1,g=-1,_=e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,v=this;function y(){if(p){switch(p){case`*`:i+=s,c=!0;break;case`?`:i+=o,c=!0;break;default:i+=`\\`+p;break}v.debug(`clearStateChar %j %j`,p,i),p=!1}}for(var b=0,C=e.length,w;b-1;M--){var N=f[M],P=i.slice(0,N.reStart),ee=i.slice(N.reStart,N.reEnd-8),te=i.slice(N.reEnd-8,N.reEnd),ne=i.slice(N.reEnd);te+=ne;var F=P.split(`(`).length-1,re=ne;for(b=0;b=0&&(a=e[o],!a);o--);for(o=0;o=0;o--)if(t[o]===r){c=o;break}var l=t.slice(a,s),u=n?t.slice(s+1):t.slice(s+1,c),d=n?[]:t.slice(c+1);if(l.length){var f=e.slice(i,i+l.length);if(!this._matchOne(f,l,n,0,0))return!1;i+=l.length}var p=0;if(d.length){if(d.length+i>e.length)return!1;var m=e.length-d.length;if(this._matchOne(e,d,n,m,0))p=d.length;else{if(e[e.length-1]!==``||i+d.length===e.length||(m--,!this._matchOne(e,d,n,m,0)))return!1;p=d.length+1}}if(!u.length){var h=!!p;for(o=i;o0,`Parameter 'itemPath' must not be an empty array`);for(let t=0;te.getLiteral(t)).filter(e=>!o&&!(o=e===``));this.searchPath=new ha(s).toString(),this.rootRegExp=new RegExp(e.regExpEscape(s[0]),_a?`i`:``),this.isImplicitPattern=n;let c={dot:!0,nobrace:!0,nocase:_a,nocomment:!0,noext:!0,nonegate:!0};a=_a?a.replace(/\\/g,`/`):a,this.minimatch=new ga(a,c)}match(e){return this.segments[this.segments.length-1]===`**`?(e=ra(e),!e.endsWith(d.sep)&&this.isImplicitPattern===!1&&(e=`${e}${d.sep}`)):e=ia(e),this.minimatch.match(e)?this.trailingSeparator?aa.Directory:aa.All:aa.None}partialMatch(e){return e=ia(e),$i(e)===e?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(_a?/\\+/:/\/+/),this.minimatch.set[0],!0)}static globEscape(e){return(_a?e:e.replace(/\\/g,`\\\\`)).replace(/(\[)(?=[^/]+\])/g,`[[]`).replace(/\?/g,`[?]`).replace(/\*/g,`[*]`)}static fixupPattern(t,r){g(t,`pattern cannot be empty`);let i=new ha(t).segments.map(t=>e.getLiteral(t));if(g(i.every((e,t)=>(e!==`.`||t===0)&&e!==`..`),`Invalid pattern '${t}'. Relative pathing '.' and '..' is not allowed.`),g(!na(t)||i[0],`Invalid pattern '${t}'. Root segment must not contain globs.`),t=ra(t),t===`.`||t.startsWith(`.${d.sep}`))t=e.globEscape(process.cwd())+t.substr(1);else if(t===`~`||t.startsWith(`~${d.sep}`))r||=n.homedir(),g(r,`Unable to determine HOME directory`),g(ta(r),`Expected HOME directory to be a rooted path. Actual '${r}'`),t=e.globEscape(r)+t.substr(1);else if(_a&&(t.match(/^[A-Z]:$/i)||t.match(/^[A-Z]:[^\\]/i))){let n=ea(`C:\\dummy-root`,t.substr(0,2));t.length>2&&!n.endsWith(`\\`)&&(n+=`\\`),t=e.globEscape(n)+t.substr(2)}else if(_a&&(t===`\\`||t.match(/^\\[^\\]/))){let n=ea(`C:\\dummy-root`,`\\`);n.endsWith(`\\`)||(n+=`\\`),t=e.globEscape(n)+t.substr(1)}else t=ea(e.globEscape(process.cwd()),t);return ra(t)}static getLiteral(e){let t=``;for(let n=0;n=0){if(r.length>1)return``;if(r){t+=r,n=i;continue}}}t+=r}return t}static regExpEscape(e){return e.replace(/[[\\^$.|?*+()]/g,`\\$&`)}},ya=class{constructor(e,t){this.path=e,this.level=t}},ba=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},xa=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Sa=function(e){return this instanceof Sa?(this.v=e,this):new Sa(e)},Ca=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Sa?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};const wa=process.platform===`win32`;var Ta=class e{constructor(e){this.patterns=[],this.searchPaths=[],this.options=Zi(e)}getSearchPaths(){return this.searchPaths.slice()}glob(){return ba(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=xa(this.globGenerator()),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}globGenerator(){return Ca(this,arguments,function*(){let t=Zi(this.options),n=[];for(let e of this.patterns)n.push(e),t.implicitDescendants&&(e.trailingSeparator||e.segments[e.segments.length-1]!==`**`)&&n.push(new va(e.negate,!0,e.segments.concat(`**`)));let r=[];for(let e of sa(n)){B(`Search path '${e}'`);try{yield Sa(o.promises.lstat(e))}catch(e){if(e.code===`ENOENT`)continue;throw e}r.unshift(new ya(e,1))}let i=[];for(;r.length;){let a=r.pop(),s=ca(n,a.path),c=!!s||la(n,a.path);if(!s&&!c)continue;let l=yield Sa(e.stat(a,t,i));if(l&&!(t.excludeHiddenFiles&&d.basename(a.path).match(/^\./)))if(l.isDirectory()){if(s&aa.Directory&&t.matchDirectories)yield yield Sa(a.path);else if(!c)continue;let e=a.level+1,n=(yield Sa(o.promises.readdir(a.path))).map(t=>new ya(d.join(a.path,t),e));r.push(...n.reverse())}else s&aa.File&&(yield yield Sa(a.path))}})}static create(t,n){return ba(this,void 0,void 0,function*(){let r=new e(n);wa&&(t=t.replace(/\r\n/g,` `),t=t.replace(/\r/g,` `));let i=t.split(` @@ -34,7 +34,7 @@ ${e.format(t)} \r `,`utf-8`)],i=cc(r);i&&e.headers.set(`Content-Length`,i),e.body=await ic(r)}const uc=`multipartPolicy`,dc=new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`);function fc(e){if(e.length>70)throw Error(`Multipart boundary "${e}" exceeds maximum length of 70 characters`);if(Array.from(e).some(e=>!dc.has(e)))throw Error(`Multipart boundary "${e}" contains invalid characters`)}function pc(){return{name:uc,async sendRequest(e,t){if(!e.multipartBody)return t(e);if(e.body)throw Error(`multipartBody and regular body cannot be set at the same time`);let n=e.multipartBody.boundary,r=e.headers.get(`Content-Type`)??`multipart/mixed`,i=r.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!i)throw Error(`Got multipart request body, but content-type header was not multipart: ${r}`);let[,a,o]=i;if(o&&n&&o!==n)throw Error(`Multipart boundary was specified as ${o} in the header, but got ${n} in the request body`);return n??=o,n?fc(n):n=ac(),e.headers.set(`Content-Type`,`${a}; boundary=${n}`),await lc(e,e.multipartBody.parts,n),e.multipartBody=void 0,t(e)}}}function mc(){return ko()}const hc=_o({logLevelEnvVarName:`AZURE_LOG_LEVEL`,namespace:`azure`});hc.logger;function gc(e){return hc.createClientLogger(e)}const _c=gc(`core-rest-pipeline`);function vc(e={}){return es({logger:_c.info,...e})}function yc(e={}){return ns(e)}function bc(){return`User-Agent`}async function xc(e){if(t&&t.versions){let n=`${N.type()} ${N.release()}; ${N.arch()}`,r=t.versions;r.bun?e.set(`Bun`,`${r.bun} (${n})`):r.deno?e.set(`Deno`,`${r.deno} (${n})`):r.node&&e.set(`Node`,`${r.node} (${n})`)}}const Sc=`1.22.3`;function Cc(e){let t=[];for(let[n,r]of e){let e=r?`${n}/${r}`:n;t.push(e)}return t.join(` `)}function wc(){return bc()}async function Tc(e){let t=new Map;t.set(`core-rest-pipeline`,Sc),await xc(t);let n=Cc(t);return e?`${e} ${n}`:n}const Ec=wc();function Dc(e={}){let t=Tc(e.userAgentPrefix);return{name:`userAgentPolicy`,async sendRequest(e,n){return e.headers.has(Ec)||e.headers.set(Ec,await t),n(e)}}}var Oc=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function kc(e,t){let{cleanupBeforeAbort:n,abortSignal:r,abortErrorMsg:i}=t??{};return new Promise((t,a)=>{function o(){a(new Oc(i??`The operation was aborted.`))}function s(){r?.removeEventListener(`abort`,c)}function c(){n?.(),s(),o()}if(r?.aborted)return o();try{e(e=>{s(),t(e)},e=>{s(),a(e)})}catch(e){a(e)}r?.addEventListener(`abort`,c)})}function Ac(e,t){let n,{abortSignal:r,abortErrorMsg:i}=t??{};return kc(t=>{n=setTimeout(t,e)},{cleanupBeforeAbort:()=>clearTimeout(n),abortSignal:r,abortErrorMsg:i??`The delay was aborted.`})}function jc(e){if(jo(e))return e.message;{let t;try{t=typeof e==`object`&&e?JSON.stringify(e):String(e)}catch{t=`[unable to stringify input]`}return`Unknown error ${t}`}}function Mc(e){return jo(e)}function Nc(){return wo()}const Pc=bs,Fc=Symbol(`rawContent`);function Ic(e){return typeof e[Fc]==`function`}function Lc(e){return Ic(e)?e[Fc]():e}const Rc=uc;function zc(){let e=pc();return{name:Rc,sendRequest:async(t,n)=>{if(t.multipartBody)for(let e of t.multipartBody.parts)Ic(e.body)&&(e.body=Lc(e.body));return e.sendRequest(t,n)}}}function Bc(){return is()}function Vc(e={}){return ys(e)}function Hc(){return Ss()}function Uc(e){return Ks(e)}function Wc(e,t){return Xs(e,t)}function Gc(e=`x-ms-client-request-id`){return{name:`setClientRequestIdPolicy`,async sendRequest(t,n){return t.headers.has(e)||t.headers.set(e,t.requestId),n(t)}}}function Kc(e){return Zs(e)}function qc(e){return Qs(e)}const Jc={span:Symbol.for(`@azure/core-tracing span`),namespace:Symbol.for(`@azure/core-tracing namespace`)};function Yc(e={}){let t=new Xc(e.parentContext);return e.span&&(t=t.setValue(Jc.span,e.span)),e.namespace&&(t=t.setValue(Jc.namespace,e.namespace)),t}var Xc=class e{_contextMap;constructor(t){this._contextMap=t instanceof e?new Map(t._contextMap):new Map}setValue(t,n){let r=new e(this);return r._contextMap.set(t,n),r}getValue(e){return this._contextMap.get(e)}deleteValue(t){let n=new e(this);return n._contextMap.delete(t),n}};const Zc=I((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.state=void 0,e.state={instrumenterImplementation:void 0}}))().state;function Qc(){return{end:()=>{},isRecording:()=>!1,recordException:()=>{},setAttribute:()=>{},setStatus:()=>{},addEvent:()=>{}}}function $c(){return{createRequestHeaders:()=>({}),parseTraceparentHeader:()=>{},startSpan:(e,t)=>({span:Qc(),tracingContext:Yc({parentContext:t.tracingContext})}),withContext(e,t,...n){return t(...n)}}}function el(){return Zc.instrumenterImplementation||=$c(),Zc.instrumenterImplementation}function tl(e){let{namespace:t,packageName:n,packageVersion:r}=e;function i(e,i,a){let o=el().startSpan(e,{...a,packageName:n,packageVersion:r,tracingContext:i?.tracingOptions?.tracingContext}),s=o.tracingContext,c=o.span;return s.getValue(Jc.namespace)||(s=s.setValue(Jc.namespace,t)),c.setAttribute(`az.namespace`,s.getValue(Jc.namespace)),{span:c,updatedOptions:Object.assign({},i,{tracingOptions:{...i?.tracingOptions,tracingContext:s}})}}async function a(e,t,n,r){let{span:a,updatedOptions:s}=i(e,t,r);try{let e=await o(s.tracingOptions.tracingContext,()=>Promise.resolve(n(s,a)));return a.setStatus({status:`success`}),e}catch(e){throw a.setStatus({status:`error`,error:e}),e}finally{a.end()}}function o(e,t,...n){return el().withContext(e,t,...n)}function s(e){return el().parseTraceparentHeader(e)}function c(e){return el().createRequestHeaders(e)}return{startSpan:i,withSpan:a,withContext:o,parseTraceparentHeader:s,createRequestHeaders:c}}const nl=Ro;function rl(e){return zo(e)}function il(e={}){let t=Tc(e.userAgentPrefix),n=new Io({additionalAllowedQueryParameters:e.additionalAllowedQueryParameters}),r=al();return{name:`tracingPolicy`,async sendRequest(e,i){if(!r)return i(e);let a=await t,o={"http.url":n.sanitizeUrl(e.url),"http.method":e.method,"http.user_agent":a,requestId:e.requestId};a&&(o[`http.user_agent`]=a);let{span:s,tracingContext:c}=ol(r,e,o)??{};if(!s||!c)return i(e);try{let t=await r.withContext(c,i,e);return cl(s,t),t}catch(e){throw sl(s,e),e}}}}function al(){try{return tl({namespace:``,packageName:`@azure/core-rest-pipeline`,packageVersion:Sc})}catch(e){_c.warning(`Error when creating the TracingClient: ${jc(e)}`);return}}function ol(e,t,n){try{let{span:r,updatedOptions:i}=e.startSpan(`HTTP ${t.method}`,{tracingOptions:t.tracingOptions},{spanKind:`client`,spanAttributes:n});if(!r.isRecording()){r.end();return}let a=e.createRequestHeaders(i.tracingOptions.tracingContext);for(let[e,n]of Object.entries(a))t.headers.set(e,n);return{span:r,tracingContext:i.tracingOptions.tracingContext}}catch(e){_c.warning(`Skipping creating a tracing span due to an error: ${jc(e)}`);return}}function sl(e,t){try{e.setStatus({status:`error`,error:Mc(t)?t:void 0}),rl(t)&&t.statusCode&&e.setAttribute(`http.status_code`,t.statusCode),e.end()}catch(e){_c.warning(`Skipping tracing span processing due to an error: ${jc(e)}`)}}function cl(e,t){try{e.setAttribute(`http.status_code`,t.status);let n=t.headers.get(`x-ms-request-id`);n&&e.setAttribute(`serviceRequestId`,n),t.status>=400&&e.setStatus({status:`error`}),e.end()}catch(e){_c.warning(`Skipping tracing span processing due to an error: ${jc(e)}`)}}function ll(e){if(e instanceof AbortSignal)return{abortSignal:e};if(e.aborted)return{abortSignal:AbortSignal.abort(e.reason)};let t=new AbortController,n=!0;function r(){n&&=(e.removeEventListener(`abort`,i),!1)}function i(){t.abort(e.reason),r()}return e.addEventListener(`abort`,i),{abortSignal:t.signal,cleanup:r}}function ul(){return{name:`wrapAbortSignalLikePolicy`,sendRequest:async(e,t)=>{if(!e.abortSignal)return t(e);let{abortSignal:n,cleanup:r}=ll(e.abortSignal);e.abortSignal=n;try{return await t(e)}finally{r?.()}}}}function dl(e){let t=mc();return Pc&&(e.agent&&t.addPolicy(Kc(e.agent)),e.tlsOptions&&t.addPolicy(qc(e.tlsOptions)),t.addPolicy(Wc(e.proxyOptions)),t.addPolicy(Bc())),t.addPolicy(ul()),t.addPolicy(Hc(),{beforePolicies:[Rc]}),t.addPolicy(Dc(e.userAgentOptions)),t.addPolicy(Gc(e.telemetryOptions?.clientRequestIdHeaderName)),t.addPolicy(zc(),{afterPhase:`Deserialize`}),t.addPolicy(Vc(e.retryOptions),{phase:`Retry`}),t.addPolicy(il({...e.userAgentOptions,...e.loggingOptions}),{afterPhase:`Retry`}),Pc&&t.addPolicy(yc(e.redirectOptions),{afterPhase:`Retry`}),t.addPolicy(vc(e.loggingOptions),{afterPhase:`Sign`}),t}function fl(){let e=$o();return{async sendRequest(t){let{abortSignal:n,cleanup:r}=t.abortSignal?ll(t.abortSignal):{};try{return t.abortSignal=n,await e.sendRequest(t)}finally{r?.()}}}}function pl(e){return Co(e)}function ml(e){return Eo(e)}const hl={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function gl(e,t,n){async function r(){if(Date.now()e.getToken(t,s),a.retryIntervalInMs,r?.expiresOnTimestamp??Date.now()).then(e=>(n=null,r=e,i=s.tenantId,r)).catch(e=>{throw n=null,r=null,i=void 0,e})),n}return async(e,t)=>{let n=!!t.claims,a=i!==t.tenantId;return n&&(r=null),a||n||o.mustRefresh?s(e,t):(o.shouldRefresh&&s(e,t),r)}}async function vl(e,t){try{return[await t(e),void 0]}catch(e){if(rl(e)&&e.response)return[e.response,e];throw e}}async function yl(e){let{scopes:t,getAccessToken:n,request:r}=e,i=await n(t,{abortSignal:r.abortSignal,tracingOptions:r.tracingOptions,enableCae:!0});i&&e.request.headers.set(`Authorization`,`Bearer ${i.token}`)}function bl(e){return e.status===401&&e.headers.has(`WWW-Authenticate`)}async function xl(e,t){let{scopes:n}=e,r=await e.getAccessToken(n,{enableCae:!0,claims:t});return r?(e.request.headers.set(`Authorization`,`${r.tokenType??`Bearer`} ${r.token}`),!0):!1}function Sl(e){let{credential:t,scopes:n,challengeCallbacks:r}=e,i=e.logger||_c,a={authorizeRequest:r?.authorizeRequest?.bind(r)??yl,authorizeRequestOnChallenge:r?.authorizeRequestOnChallenge?.bind(r)},o=t?_l(t):()=>Promise.resolve(null);return{name:`bearerTokenAuthenticationPolicy`,async sendRequest(e,t){if(!e.url.toLowerCase().startsWith(`https://`))throw Error(`Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.`);await a.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:e,getAccessToken:o,logger:i});let r,s,c;if([r,s]=await vl(e,t),bl(r)){let l=wl(r.headers.get(`WWW-Authenticate`));if(l){let a;try{a=atob(l)}catch{return i.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${l}`),r}c=await xl({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await vl(e,t))}else if(a.authorizeRequestOnChallenge&&(c=await a.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:e,response:r,getAccessToken:o,logger:i}),c&&([r,s]=await vl(e,t)),bl(r)&&(l=wl(r.headers.get(`WWW-Authenticate`)),l))){let a;try{a=atob(l)}catch{return i.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${l}`),r}c=await xl({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await vl(e,t))}}if(s)throw s;return r}}}function Cl(e){let t=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,n=/(\w+)="([^"]*)"/g,r=[],i;for(;(i=t.exec(e))!==null;){let e=i[1],t=i[2],a={},o;for(;(o=n.exec(t))!==null;)a[o[1]]=o[2];r.push({scheme:e,params:a})}return r}function wl(e){if(e)return Cl(e).find(e=>e.scheme===`Bearer`&&e.params.claims&&e.params.error===`insufficient_claims`)?.params.claims}function Tl(e){let t=e;return t&&typeof t.getToken==`function`&&(t.signRequest===void 0||t.getToken.length>0)}const El=`DisableKeepAlivePolicy`;function Dl(){return{name:El,async sendRequest(e,t){return e.disableKeepAlive=!0,t(e)}}}function Ol(e){return e.getOrderedPolicies().some(e=>e.name===El)}function kl(e){return(e instanceof Buffer?e:Buffer.from(e.buffer)).toString(`base64`)}function Al(e){return Buffer.from(e,`base64`)}function jl(e,t){return t!==`Composite`&&t!==`Dictionary`&&(typeof e==`string`||typeof e==`number`||typeof e==`boolean`||t?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||e==null)}const Ml=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Nl(e){return Ml.test(e)}const Pl=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;function Fl(e){return Pl.test(e)}function Il(e){let t={...e.headers,...e.body};return e.hasNullableType&&Object.getOwnPropertyNames(t).length===0?e.shouldWrapBody?{body:null}:null:e.shouldWrapBody?{...e.headers,body:e.body}:t}function Ll(e,t){let n=e.parsedHeaders;if(e.request.method===`HEAD`)return{...n,body:e.parsedBody};let r=t&&t.bodyMapper,i=!!r?.nullable,a=r?.type.name;if(a===`Stream`)return{...n,blobBody:e.blobBody,readableStreamBody:e.readableStreamBody};let o=a===`Composite`&&r.type.modelProperties||{},s=Object.keys(o).some(e=>o[e].serializedName===``);if(a===`Sequence`||s){let t=e.parsedBody??[];for(let n of Object.keys(o))o[n].serializedName&&(t[n]=e.parsedBody?.[n]);if(n)for(let e of Object.keys(n))t[e]=n[e];return i&&!e.parsedBody&&!n&&Object.getOwnPropertyNames(o).length===0?null:t}return Il({body:e.parsedBody,headers:n,hasNullableType:i,shouldWrapBody:jl(e.parsedBody,a)})}var Rl=class{modelMappers;isXML;constructor(e={},t=!1){this.modelMappers=e,this.isXML=t}validateConstraints(e,t,n){let r=(e,r)=>{throw Error(`"${n}" with value "${t}" should satisfy the constraint "${e}": ${r}.`)};if(e.constraints&&t!=null){let{ExclusiveMaximum:n,ExclusiveMinimum:i,InclusiveMaximum:a,InclusiveMinimum:o,MaxItems:s,MaxLength:c,MinItems:l,MinLength:u,MultipleOf:d,Pattern:f,UniqueItems:p}=e.constraints;if(n!==void 0&&t>=n&&r(`ExclusiveMaximum`,n),i!==void 0&&t<=i&&r(`ExclusiveMinimum`,i),a!==void 0&&t>a&&r(`InclusiveMaximum`,a),o!==void 0&&ts&&r(`MaxItems`,s),c!==void 0&&t.length>c&&r(`MaxLength`,c),l!==void 0&&t.lengthn.indexOf(e)!==t)&&r(`UniqueItems`,p)}}serialize(e,t,n,r={xml:{}}){let i={xml:{rootName:r.xml.rootName??``,includeRoot:r.xml.includeRoot??!1,xmlCharKey:r.xml.xmlCharKey??`_`}},a={},o=e.type.name;n||=e.serializedName,o.match(/^Sequence$/i)!==null&&(a=[]),e.isConstant&&(t=e.defaultValue);let{required:s,nullable:c}=e;if(s&&c&&t===void 0)throw Error(`${n} cannot be undefined.`);if(s&&!c&&t==null)throw Error(`${n} cannot be null or undefined.`);if(!s&&c===!1&&t===null)throw Error(`${n} cannot be null.`);return t==null?a=t:o.match(/^any$/i)===null?o.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)===null?o.match(/^Enum$/i)===null?o.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)===null?o.match(/^ByteArray$/i)===null?o.match(/^Base64Url$/i)===null?o.match(/^Sequence$/i)===null?o.match(/^Dictionary$/i)===null?o.match(/^Composite$/i)!==null&&(a=nu(this,e,t,n,!!this.isXML,i)):a=Ql(this,e,t,n,!!this.isXML,i):a=Zl(this,e,t,n,!!this.isXML,i):a=Yl(n,t):a=Jl(n,t):a=Xl(o,t,n):a=ql(n,e.type.allowedValues,t):a=Kl(o,n,t):a=t,a}deserialize(e,t,n,r={xml:{}}){let i={xml:{rootName:r.xml.rootName??``,includeRoot:r.xml.includeRoot??!1,xmlCharKey:r.xml.xmlCharKey??`_`},ignoreUnknownProperties:r.ignoreUnknownProperties??!1};if(t==null)return this.isXML&&e.type.name===`Sequence`&&!e.xmlIsWrapped&&(t=[]),e.defaultValue!==void 0&&(t=e.defaultValue),t;let a,o=e.type.name;if(n||=e.serializedName,o.match(/^Composite$/i)!==null)a=au(this,e,t,n,i);else{if(this.isXML){let e=i.xml.xmlCharKey;t.$!==void 0&&t[e]!==void 0&&(t=t[e])}o.match(/^Number$/i)===null?o.match(/^Boolean$/i)===null?o.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)===null?o.match(/^(Date|DateTime|DateTimeRfc1123)$/i)===null?o.match(/^UnixTime$/i)===null?o.match(/^ByteArray$/i)===null?o.match(/^Base64Url$/i)===null?o.match(/^Sequence$/i)===null?o.match(/^Dictionary$/i)!==null&&(a=ou(this,e,t,n,i)):a=su(this,e,t,n,i):a=Hl(t):a=Al(t):a=Gl(t):a=new Date(t):a=t:a=t===`true`?!0:t===`false`?!1:t:(a=parseFloat(t),isNaN(a)&&(a=t))}return e.isConstant&&(a=e.defaultValue),a}};function zl(e={},t=!1){return new Rl(e,t)}function Bl(e,t){let n=e.length;for(;n-1>=0&&e[n-1]===t;)--n;return e.substr(0,n)}function Vl(e){if(e){if(!(e instanceof Uint8Array))throw Error(`Please provide an input of type Uint8Array for converting to Base64Url.`);return Bl(kl(e),`=`).replace(/\+/g,`-`).replace(/\//g,`_`)}}function Hl(e){if(e){if(e&&typeof e.valueOf()!=`string`)throw Error(`Please provide an input of type string for converting to Uint8Array`);return e=e.replace(/-/g,`+`).replace(/_/g,`/`),Al(e)}}function Ul(e){let t=[],n=``;if(e){let r=e.split(`.`);for(let e of r)e.charAt(e.length-1)===`\\`?n+=e.substr(0,e.length-1)+`.`:(n+=e,t.push(n),n=``)}return t}function Wl(e){if(e)return typeof e.valueOf()==`string`&&(e=new Date(e)),Math.floor(e.getTime()/1e3)}function Gl(e){if(e)return new Date(e*1e3)}function Kl(e,t,n){if(n!=null){if(e.match(/^Number$/i)!==null){if(typeof n!=`number`)throw Error(`${t} with value ${n} must be of type number.`)}else if(e.match(/^String$/i)!==null){if(typeof n.valueOf()!=`string`)throw Error(`${t} with value "${n}" must be of type string.`)}else if(e.match(/^Uuid$/i)!==null){if(!(typeof n.valueOf()==`string`&&Fl(n)))throw Error(`${t} with value "${n}" must be of type string and a valid uuid.`)}else if(e.match(/^Boolean$/i)!==null){if(typeof n!=`boolean`)throw Error(`${t} with value ${n} must be of type boolean.`)}else if(e.match(/^Stream$/i)!==null){let e=typeof n;if(e!==`string`&&typeof n.pipe!=`function`&&typeof n.tee!=`function`&&!(n instanceof ArrayBuffer)&&!ArrayBuffer.isView(n)&&!((typeof Blob==`function`||typeof Blob==`object`)&&n instanceof Blob)&&e!==`function`)throw Error(`${t} must be a string, Blob, ArrayBuffer, ArrayBufferView, ReadableStream, or () => ReadableStream.`)}}return n}function ql(e,t,n){if(!t)throw Error(`Please provide a set of allowedValues to validate ${e} as an Enum Type.`);if(!t.some(e=>typeof e.valueOf()==`string`?e.toLowerCase()===n.toLowerCase():e===n))throw Error(`${n} is not a valid value for ${e}. The valid values are: ${JSON.stringify(t)}.`);return n}function Jl(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=kl(t)}return t}function Yl(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=Vl(t)}return t}function Xl(e,t,n){if(t!=null){if(e.match(/^Date$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10)}else if(e.match(/^DateTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString():new Date(t).toISOString()}else if(e.match(/^DateTimeRfc1123$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in RFC-1123 format.`);t=t instanceof Date?t.toUTCString():new Date(t).toUTCString()}else if(e.match(/^UnixTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`);t=Wl(t)}else if(e.match(/^TimeSpan$/i)!==null&&!Nl(t))throw Error(`${n} must be a string in ISO 8601 format. Instead was "${t}".`)}return t}function Zl(e,t,n,r,i,a){if(!Array.isArray(n))throw Error(`${r} must be of type Array.`);let o=t.type.element;if(!o||typeof o!=`object`)throw Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${r}.`);o.type.name===`Composite`&&o.type.className&&(o=e.modelMappers[o.type.className]??o);let s=[];for(let t=0;te!==i)&&(o[i]=e.serialize(c,n[i],r+`["`+i+`"]`,a))}return o}return n}function ru(e,t,n,r){if(!n||!e.xmlNamespace)return t;let i={[e.xmlNamespacePrefix?`xmlns:${e.xmlNamespacePrefix}`:`xmlns`]:e.xmlNamespace};if([`Composite`].includes(e.type.name)){if(t.$)return t;{let e={...t};return e.$=i,e}}let a={};return a[r.xml.xmlCharKey]=t,a.$=i,a}function iu(e,t){return[`$`,t.xml.xmlCharKey].includes(e)}function au(e,t,n,r,i){let a=i.xml.xmlCharKey??`_`;uu(e,t)&&(t=lu(e,t,n,`serializedName`));let o=tu(e,t,r),s={},c=[];for(let l of Object.keys(o)){let u=o[l],d=Ul(o[l].serializedName);c.push(d[0]);let{serializedName:f,xmlName:p,xmlElementName:m}=u,h=r;f!==``&&f!==void 0&&(h=r+`.`+f);let g=u.headerCollectionPrefix;if(g){let t={};for(let r of Object.keys(n))r.startsWith(g)&&(t[r.substring(g.length)]=e.deserialize(u.type.value,n[r],h,i)),c.push(r);s[l]=t}else if(e.isXML)if(u.xmlIsAttribute&&n.$)s[l]=e.deserialize(u,n.$[p],h,i);else if(u.xmlIsMsText)n[a]===void 0?typeof n==`string`&&(s[l]=n):s[l]=n[a];else{let t=m||p||f;if(u.xmlIsWrapped){let t=n[p]?.[m]??[];s[l]=e.deserialize(u,t,h,i),c.push(p)}else{let r=n[t];s[l]=e.deserialize(u,r,h,i),c.push(t)}}else{let r,a=n,c=0;for(let e of d){if(!a)break;c++,a=a[e]}a===null&&c{for(let t in o)if(Ul(o[t].serializedName)[0]===e)return!1;return!0};for(let a in n)t(a)&&(s[a]=e.deserialize(l,n[a],r+`["`+a+`"]`,i))}else if(n&&!i.ignoreUnknownProperties)for(let e of Object.keys(n))s[e]===void 0&&!c.includes(e)&&!iu(e,i)&&(s[e]=n[e]);return s}function ou(e,t,n,r,i){let a=t.type.value;if(!a||typeof a!=`object`)throw Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${r}`);if(n){let t={};for(let o of Object.keys(n))t[o]=e.deserialize(a,n[o],r,i);return t}return n}function su(e,t,n,r,i){let a=t.type.element;if(!a||typeof a!=`object`)throw Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${r}`);if(n){Array.isArray(n)||(n=[n]),a.type.name===`Composite`&&a.type.className&&(a=e.modelMappers[a.type.className]??a);let t=[];for(let o=0;o{Object.defineProperty(e,`__esModule`,{value:!0}),e.state=void 0,e.state={operationRequestMap:new WeakMap}}))().state;function mu(e,t,n){let r=t.parameterPath,i=t.mapper,a;if(typeof r==`string`&&(r=[r]),Array.isArray(r)){if(r.length>0)if(i.isConstant)a=i.defaultValue;else{let t=hu(e,r);!t.propertyFound&&n&&(t=hu(n,r));let o=!1;t.propertyFound||(o=i.required||r[0]===`options`&&r.length===2),a=o?i.defaultValue:t.propertyValue}}else{i.required&&(a={});for(let t in r){let o=i.type.modelProperties[t],s=r[t],c=mu(e,{parameterPath:s,mapper:o},n);c!==void 0&&(a||={},a[t]=c)}}return a}function hu(e,t){let n={propertyFound:!1},r=0;for(;r=200&&n.status<300);s.headersMapper&&(a.parsedHeaders=o.serializer.deserialize(s.headersMapper,a.headers.toJSON(),`operationRes.parsedHeaders`,{xml:{},ignoreUnknownProperties:!0}))}return a}function Tu(e){let t=Object.keys(e.responses);return t.length===0||t.length===1&&t[0]===`default`}function Eu(e,t,n,r){let i=200<=e.status&&e.status<300;if(Tu(t)?i:n)if(n){if(!n.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let a=n??t.responses.default,o=new nl(e.request.streamResponseStatusCodes?.has(e.status)?`Unexpected status code: ${e.status}`:e.bodyAsText,{statusCode:e.status,request:e.request,response:e});if(!a&&!(e.parsedBody?.error?.code&&e.parsedBody?.error?.message))throw o;let s=a?.bodyMapper,c=a?.headersMapper;try{if(e.parsedBody){let n=e.parsedBody,i;if(s){let e=n;if(t.isXML&&s.type.name===fu.Sequence){e=[];let t=s.xmlElementName;typeof n==`object`&&t&&(e=n[t])}i=t.serializer.deserialize(s,e,`error.response.parsedBody`,r)}let a=n.error||i||n;o.code=a.code,a.message&&(o.message=a.message),s&&(o.response.parsedBody=i)}e.headers&&c&&(o.response.parsedHeaders=t.serializer.deserialize(c,e.headers.toJSON(),`operationRes.parsedHeaders`))}catch(t){o.message=`Error "${t.message}" occurred in deserializing the responseBody - "${e.bodyAsText}" for the default response.`}return{error:o,shouldReturnResponse:!1}}async function Du(e,t,n,r,i){if(!n.request.streamResponseStatusCodes?.has(n.status)&&n.bodyAsText){let a=n.bodyAsText,o=n.headers.get(`Content-Type`)||``,s=o?o.split(`;`).map(e=>e.toLowerCase()):[];try{if(s.length===0||s.some(t=>e.indexOf(t)!==-1))return n.parsedBody=JSON.parse(a),n;if(s.some(e=>t.indexOf(e)!==-1)){if(!i)throw Error(`Parsing XML not supported.`);return n.parsedBody=await i(a,r.xml),n}}catch(e){throw new nl(`Error "${e}" occurred while parsing the response body - ${n.bodyAsText}.`,{code:e.code||nl.PARSE_ERROR,statusCode:n.status,request:n.request,response:n})}}return n}function Ou(e){let t=new Set;for(let n in e.responses){let r=e.responses[n];r.bodyMapper&&r.bodyMapper.type.name===fu.Stream&&t.add(Number(n))}return t}function ku(e){let{parameterPath:t,mapper:n}=e,r;return r=typeof t==`string`?t:Array.isArray(t)?t.join(`.`):n.serializedName,r}function Au(e={}){let t=e.stringifyXML;return{name:`serializationPolicy`,async sendRequest(e,n){let r=vu(e),i=r?.operationSpec,a=r?.operationArguments;return i&&a&&(ju(e,a,i),Mu(e,a,i,t)),n(e)}}}function ju(e,t,n){if(n.headerParameters)for(let r of n.headerParameters){let i=mu(t,r);if(i!=null||r.mapper.required){i=n.serializer.serialize(r.mapper,i,ku(r));let t=r.mapper.headerCollectionPrefix;if(t)for(let n of Object.keys(i))e.headers.set(t+n,i[n]);else e.headers.set(r.mapper.serializedName||ku(r),i)}}let r=t.options?.requestOptions?.customHeaders;if(r)for(let t of Object.keys(r))e.headers.set(t,r[t])}function Mu(e,t,n,r=function(){throw Error(`XML serialization unsupported!`)}){let i=t.options?.serializerOptions,a={xml:{rootName:i?.xml.rootName??``,includeRoot:i?.xml.includeRoot??!1,xmlCharKey:i?.xml.xmlCharKey??`_`}},o=a.xml.xmlCharKey;if(n.requestBody&&n.requestBody.mapper){e.body=mu(t,n.requestBody);let i=n.requestBody.mapper,{required:s,serializedName:c,xmlName:l,xmlElementName:u,xmlNamespace:d,xmlNamespacePrefix:f,nullable:p}=i,m=i.type.name;try{if(e.body!==void 0&&e.body!==null||p&&e.body===null||s){let t=ku(n.requestBody);e.body=n.serializer.serialize(i,e.body,t,a);let s=m===fu.Stream;if(n.isXML){let t=f?`xmlns:${f}`:`xmlns`,n=Nu(d,t,m,e.body,a);m===fu.Sequence?e.body=r(Pu(n,u||l||c,t,d),{rootName:l||c,xmlCharKey:o}):s||(e.body=r(n,{rootName:l||c,xmlCharKey:o}))}else if(m===fu.String&&(n.contentType?.match(`text/plain`)||n.mediaType===`text`))return;else s||(e.body=JSON.stringify(e.body))}}catch(e){throw Error(`Error "${e.message}" occurred in serializing the payload - ${JSON.stringify(c,void 0,` `)}.`)}}else if(n.formDataParameters&&n.formDataParameters.length>0){e.formData={};for(let r of n.formDataParameters){let i=mu(t,r);if(i!=null){let t=r.mapper.serializedName||ku(r);e.formData[t]=n.serializer.serialize(r.mapper,i,ku(r),a)}}}}function Nu(e,t,n,r,i){if(e&&![`Composite`,`Sequence`,`Dictionary`].includes(n)){let n={};return n[i.xml.xmlCharKey]=r,n.$={[t]:e},n}return r}function Pu(e,t,n,r){if(Array.isArray(e)||(e=[e]),!n||!r)return{[t]:e};let i={[t]:e};return i.$={[n]:r},i}function Fu(e={}){let t=dl(e??{});return e.credentialOptions&&t.addPolicy(Sl({credential:e.credentialOptions.credential,scopes:e.credentialOptions.credentialScopes})),t.addPolicy(Au(e.serializationOptions),{phase:`Serialize`}),t.addPolicy(xu(e.deserializationOptions),{phase:`Deserialize`}),t}let Iu;function Lu(){return Iu||=fl(),Iu}const Ru={CSV:`,`,SSV:` `,Multi:`Multi`,TSV:` `,Pipes:`|`};function zu(e,t,n,r){let i=Vu(t,n,r),a=!1,o=Bu(e,i);if(t.path){let e=Bu(t.path,i);t.path===`/{nextLink}`&&e.startsWith(`/`)&&(e=e.substring(1)),Hu(e)?(o=e,a=!0):o=Uu(o,e)}let{queryParams:s,sequenceParams:c}=Wu(t,n,r);return o=Ku(o,s,c,a),o}function Bu(e,t){let n=e;for(let[e,r]of t)n=n.split(e).join(r);return n}function Vu(e,t,n){let r=new Map;if(e.urlParameters?.length)for(let i of e.urlParameters){let a=mu(t,i,n),o=ku(i);a=e.serializer.serialize(i.mapper,a,o),i.skipEncoding||(a=encodeURIComponent(a)),r.set(`{${i.mapper.serializedName||o}}`,a)}return r}function Hu(e){return e.includes(`://`)}function Uu(e,t){if(!t)return e;let n=new URL(e),r=n.pathname;r.endsWith(`/`)||(r=`${r}/`),t.startsWith(`/`)&&(t=t.substring(1));let i=t.indexOf(`?`);if(i!==-1){let e=t.substring(0,i),a=t.substring(i+1);r+=e,a&&(n.search=n.search?`${n.search}&${a}`:a)}else r+=t;return n.pathname=r,n.toString()}function Wu(e,t,n){let r=new Map,i=new Set;if(e.queryParameters?.length)for(let a of e.queryParameters){a.mapper.type.name===`Sequence`&&a.mapper.serializedName&&i.add(a.mapper.serializedName);let o=mu(t,a,n);if(o!=null||a.mapper.required){o=e.serializer.serialize(a.mapper,o,ku(a));let t=a.collectionFormat?Ru[a.collectionFormat]:``;if(Array.isArray(o)&&(o=o.map(e=>e??``)),a.collectionFormat===`Multi`&&o.length===0)continue;Array.isArray(o)&&(a.collectionFormat===`SSV`||a.collectionFormat===`TSV`)&&(o=o.join(t)),a.skipEncoding||(o=Array.isArray(o)?o.map(e=>encodeURIComponent(e)):encodeURIComponent(o)),Array.isArray(o)&&(a.collectionFormat===`CSV`||a.collectionFormat===`Pipes`)&&(o=o.join(t)),r.set(a.mapper.serializedName||ku(a),o)}}return{queryParams:r,sequenceParams:i}}function Gu(e){let t=new Map;if(!e||e[0]!==`?`)return t;e=e.slice(1);let n=e.split(`&`);for(let e of n){let[n,r]=e.split(`=`,2),i=t.get(n);i?Array.isArray(i)?i.push(r):t.set(n,[i,r]):t.set(n,r)}return t}function Ku(e,t,n,r=!1){if(t.size===0)return e;let i=new URL(e),a=Gu(i.search);for(let[e,i]of t){let t=a.get(e);if(Array.isArray(t))if(Array.isArray(i)){t.push(...i);let n=new Set(t);a.set(e,Array.from(n))}else t.push(i);else t?(Array.isArray(i)?i.unshift(t):n.has(e)&&a.set(e,[t,i]),r||a.set(e,i)):a.set(e,i)}let o=[];for(let[e,t]of a)if(typeof t==`string`)o.push(`${e}=${t}`);else if(Array.isArray(t))for(let n of t)o.push(`${e}=${n}`);else o.push(`${e}=${t}`);return i.search=o.length?`?${o.join(`&`)}`:``,i.toString()}const qu=gc(`core-client`);var Ju=class{_endpoint;_requestContentType;_allowInsecureConnection;_httpClient;pipeline;constructor(e={}){if(this._requestContentType=e.requestContentType,this._endpoint=e.endpoint??e.baseUri,e.baseUri&&qu.warning(`The baseUri option for SDK Clients has been deprecated, please use endpoint instead.`),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Lu(),this.pipeline=e.pipeline||Yu(e),e.additionalPolicies?.length)for(let{policy:t,position:n}of e.additionalPolicies){let e=n===`perRetry`?`Sign`:void 0;this.pipeline.addPolicy(t,{afterPhase:e})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,t){let n=t.baseUrl||this._endpoint;if(!n)throw Error(`If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.`);let r=ml({url:zu(n,t,e,this)});r.method=t.httpMethod;let i=vu(r);i.operationSpec=t,i.operationArguments=e;let a=t.contentType||this._requestContentType;a&&t.requestBody&&r.headers.set(`Content-Type`,a);let o=e.options;if(o){let e=o.requestOptions;e&&(e.timeout&&(r.timeout=e.timeout),e.onUploadProgress&&(r.onUploadProgress=e.onUploadProgress),e.onDownloadProgress&&(r.onDownloadProgress=e.onDownloadProgress),e.shouldDeserialize!==void 0&&(i.shouldDeserialize=e.shouldDeserialize),e.allowInsecureConnection&&(r.allowInsecureConnection=!0)),o.abortSignal&&(r.abortSignal=o.abortSignal),o.tracingOptions&&(r.tracingOptions=o.tracingOptions)}this._allowInsecureConnection&&(r.allowInsecureConnection=!0),r.streamResponseStatusCodes===void 0&&(r.streamResponseStatusCodes=Ou(t));try{let e=await this.sendRequest(r),n=Ll(e,t.responses[e.status]);return o?.onResponse&&o.onResponse(e,n),n}catch(e){if(typeof e==`object`&&e?.response){let n=e.response,r=Ll(n,t.responses[e.statusCode]||t.responses.default);e.details=r,o?.onResponse&&o.onResponse(n,r,e)}throw e}}};function Yu(e){let t=Xu(e),n=e.credential&&t?{credentialScopes:t,credential:e.credential}:void 0;return Fu({...e,credentialOptions:n})}function Xu(e){if(e.credentialScopes)return e.credentialScopes;if(e.endpoint)return`${e.endpoint}/.default`;if(e.baseUri)return`${e.baseUri}/.default`;if(e.credential&&!e.credentialScopes)throw Error(`When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy`)}const Zu={DefaultScope:`/.default`,HeaderConstants:{AUTHORIZATION:`authorization`}};function Qu(e){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(e)}const $u=async e=>{let t=id(e.request),n=nd(e.response);if(n){let r=rd(n),i=td(e,r),a=ed(r);if(!a)return!1;let o=await e.getAccessToken(i,{...t,tenantId:a});return o?(e.request.headers.set(Zu.HeaderConstants.AUTHORIZATION,`${o.tokenType??`Bearer`} ${o.token}`),!0):!1}return!1};function ed(e){let t=new URL(e.authorization_uri).pathname.split(`/`)[1];if(t&&Qu(t))return t}function td(e,t){if(!t.resource_id)return e.scopes;let n=new URL(t.resource_id);n.pathname=Zu.DefaultScope;let r=n.toString();return r===`https://disk.azure.com/.default`&&(r=`https://disk.azure.com//.default`),[r]}function nd(e){let t=e.headers.get(`WWW-Authenticate`);if(e.status===401&&t)return t}function rd(e){return`${e.slice(7).trim()} `.split(` `).filter(e=>e).map(e=>(([e,t])=>({[e]:t}))(e.trim().split(`=`))).reduce((e,t)=>({...e,...t}),{})}function id(e){return{abortSignal:e.abortSignal,requestOptions:{timeout:e.timeout},tracingOptions:e.tracingOptions}}const ad=Symbol(`Original PipelineRequest`),od=Symbol.for(`@azure/core-client original request`);function sd(e,t={}){let n=e[ad],r=pl(e.headers.toJson({preserveCase:!0}));if(n)return n.headers=r,n;{let n=ml({url:e.url,method:e.method,headers:r,withCredentials:e.withCredentials,timeout:e.timeout,requestId:e.requestId,abortSignal:e.abortSignal,body:e.body,formData:e.formData,disableKeepAlive:!!e.keepAlive,onDownloadProgress:e.onDownloadProgress,onUploadProgress:e.onUploadProgress,proxySettings:e.proxySettings,streamResponseStatusCodes:e.streamResponseStatusCodes,agent:e.agent,requestOverrides:e.requestOverrides});return t.originalRequest&&(n[od]=t.originalRequest),n}}function cd(e,t){let n=t?.originalRequest??e,r={url:e.url,method:e.method,headers:ld(e.headers),withCredentials:e.withCredentials,timeout:e.timeout,requestId:e.headers.get(`x-ms-client-request-id`)||e.requestId,abortSignal:e.abortSignal,body:e.body,formData:e.formData,keepAlive:!!e.disableKeepAlive,onDownloadProgress:e.onDownloadProgress,onUploadProgress:e.onUploadProgress,proxySettings:e.proxySettings,streamResponseStatusCodes:e.streamResponseStatusCodes,agent:e.agent,requestOverrides:e.requestOverrides,clone(){throw Error(`Cannot clone a non-proxied WebResourceLike`)},prepare(){throw Error(`WebResourceLike.prepare() is not supported by @azure/core-http-compat`)},validateRequestProperties(){}};return t?.createProxy?new Proxy(r,{get(t,i,a){return i===ad?e:i===`clone`?()=>cd(sd(r,{originalRequest:n}),{createProxy:!0,originalRequest:n}):Reflect.get(t,i,a)},set(t,n,r,i){return n===`keepAlive`&&(e.disableKeepAlive=!r),typeof n==`string`&&[`url`,`method`,`withCredentials`,`timeout`,`requestId`,`abortSignal`,`body`,`formData`,`onDownloadProgress`,`onUploadProgress`,`proxySettings`,`streamResponseStatusCodes`,`agent`,`requestOverrides`].includes(n)&&(e[n]=r),Reflect.set(t,n,r,i)}}):r}function ld(e){return new dd(e.toJSON({preserveCase:!0}))}function ud(e){return e.toLowerCase()}var dd=class e{_headersMap;constructor(e){if(this._headersMap={},e)for(let t in e)this.set(t,e[t])}set(e,t){this._headersMap[ud(e)]={name:e,value:t.toString()}}get(e){let t=this._headersMap[ud(e)];return t?t.value:void 0}contains(e){return!!this._headersMap[ud(e)]}remove(e){let t=this.contains(e);return delete this._headersMap[ud(e)],t}rawHeaders(){return this.toJson({preserveCase:!0})}headersArray(){let e=[];for(let t in this._headersMap)e.push(this._headersMap[t]);return e}headerNames(){let e=[],t=this.headersArray();for(let n=0;nmd(await e.sendRequest(cd(t,{createProxy:!0})))}}const bd=`:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD`;bd+``,``+bd;const xd=RegExp(`^[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function Sd(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e`&&e[a]!==` `&&e[a]!==` `&&e[a]!==` `&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!zd(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,Ld(`InvalidTag`,t,Bd(e,a))}let l=Md(e,a);if(l===!1)return Ld(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,Bd(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=Pd(u,t);if(i===!0)r=!0;else return Ld(i.err.code,i.err.msg,Bd(e,n+i.err.line))}else if(s){if(!l.tagClosed)return Ld(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,Bd(e,a));if(u.trim().length>0)return Ld(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,Bd(e,o));if(n.length===0)return Ld(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,Bd(e,o));{let t=n.pop();if(c!==t.tagName){let n=Bd(e,t.tagStartPos);return Ld(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,Bd(e,o))}n.length==0&&(i=!0)}}else{let s=Pd(u,t);if(s!==!0)return Ld(s.err.code,s.err.msg,Bd(e,a-u.length+s.err.line));if(i===!0)return Ld(`InvalidXml`,`Multiple possible root nodes found.`,Bd(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a0?Ld(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):!0:Ld(`InvalidXml`,`Start tag expected.`,1)}function kd(e){return e===` `||e===` `||e===` -`||e===`\r`}function Ad(e,t){let n=t;for(;t5&&r===`xml`)return Ld(`InvalidXml`,`XML declaration allowed only at the start of the document.`,Bd(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function jd(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t`){t+=2;break}}return t}function Md(e,t){let n=``,r=``,i=!1;for(;t`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}const Nd=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function Pd(e,t){let n=Sd(e,Nd),r={};for(let e=0;eTd.includes(e)?`__`+e:e,Ud={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Hd};function Wd(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(Td.some(e=>n===e.toLowerCase())||Ed.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Gd(e){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??100),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:Gd(!0)}const Kd=function(e){let t=Object.assign({},Ud,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&Wd(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=Hd),t.processEntities=Gd(t.processEntities),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t};let qd;qd=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var Jd=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][qd]={startIndex:t})}static getMetaDataSymbol(){return qd}},Yd=class{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let i=1,a=!1,o=!1,s=``;for(;t=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);let e=i.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n[i]={regx:RegExp(`&${e};`,`g`),val:a},r++}}else if(a&&Zd(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&Zd(e,`!ATTLIST`,t))t+=8;else if(a&&Zd(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(Zd(e,`!--`,t))o=!0;else throw Error(`Invalid DOCTYPE`);i++,s=``}else if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];if(i!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}readEntityExp(e,t){t=Xd(e,t);let n=t;for(;tthis.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,i,t]}readNotationExp(e,t){t=Xd(e,t);let n=t;for(;t{for(;t1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}const rf=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function af(e,t,n){if(!n.eNotation)return e;let r=t.match(rf);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e}else return e}function of(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function sf(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function cf(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}function lf(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var uf=class{constructor(e,t={}){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n0){let e=this.path[this.path.length-1];e.values=void 0}let r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);let i=this.siblingStacks[r],a=n?`${n}:${e}`:e,o=i.get(a)||0,s=0;for(let e of i.values())s+=e;i.set(a,o+1);let c={tag:e,position:s,counter:o};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--){let a=e===this.path.length-1;if(this._matchSegment(r,this.path[e],a)){t=e-1,n--,i=!0;break}}if(!i)return!1}else{let e=t===this.path.length-1;if(!this._matchSegment(r,this.path[t],e))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace)return!1;if(e.attrName!==void 0){if(!n||!t.values||!(e.attrName in t.values))return!1;if(e.attrValue!==void 0){let n=t.values[e.attrName];if(String(n)!==String(e.attrValue))return!1}}if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){let e=this;return new Proxy(e,{get(e,t,n){if(df.has(t))return()=>{throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};let r=Reflect.get(e,t,n);return t===`path`||t===`siblingStacks`?Object.freeze(Array.isArray(r)?r.map(e=>e instanceof Map?Object.freeze(new Map(e)):Object.freeze({...e})):r):typeof r==`function`?r.bind(e):r},set(e,t){throw TypeError(`Cannot set property '${String(t)}' on a read-only Matcher.`)},deleteProperty(e,t){throw TypeError(`Cannot delete property '${String(t)}' from a read-only Matcher.`)}})}};function pf(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function mf(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}var hf=class{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>jf(t,10,`&#`)},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>jf(t,16,`&#x`)}},this.addExternalEntities=gf,this.parseXml=xf,this.parseTextData=_f,this.resolveNameSpace=vf,this.buildAttributesMap=bf,this.isItStopNode=Tf,this.replaceEntitiesValue=Cf,this.readStopNodeData=kf,this.saveTextToParentTag=wf,this.addChild=Sf,this.ignoreAttributesFn=lf(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new ff,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let e=0;e0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=this.options.jPath?n.toString():n,s=this.options.tagValueProcessor(t,e,r,i,a);return s==null?e:typeof s!=typeof e||s!==e?s:this.options.trimValues||e.trim()===e?Af(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function vf(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}const yf=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function bf(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let r=Sd(e,yf),i=r.length,a={},o={};for(let e=0;e0&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(o);for(let e=0;e5&&r===`xml`)return Ld(`InvalidXml`,`XML declaration allowed only at the start of the document.`,Bd(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function jd(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t`){t+=2;break}}return t}function Md(e,t){let n=``,r=``,i=!1;for(;t`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}const Nd=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function Pd(e,t){let n=Sd(e,Nd),r={};for(let e=0;eTd.includes(e)?`__`+e:e,Ud={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Hd};function Wd(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(Td.some(e=>n===e.toLowerCase())||Ed.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Gd(e){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??100),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:Gd(!0)}const Kd=function(e){let t=Object.assign({},Ud,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&Wd(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=Hd),t.processEntities=Gd(t.processEntities),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t};let qd;qd=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var Jd=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][qd]={startIndex:t})}static getMetaDataSymbol(){return qd}},Yd=class{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let i=1,a=!1,o=!1,s=``;for(;t=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);let e=i.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n[i]={regx:RegExp(`&${e};`,`g`),val:a},r++}}else if(a&&Zd(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&Zd(e,`!ATTLIST`,t))t+=8;else if(a&&Zd(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(Zd(e,`!--`,t))o=!0;else throw Error(`Invalid DOCTYPE`);i++,s=``}else if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];if(i!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}readEntityExp(e,t){t=Xd(e,t);let n=t;for(;tthis.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,i,t]}readNotationExp(e,t){t=Xd(e,t);let n=t;for(;t{for(;t1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}const rf=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function af(e,t,n){if(!n.eNotation)return e;let r=t.match(rf);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e}else return e}function of(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function sf(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function cf(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}function lf(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var uf=class{constructor(e,t={}){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n0){let e=this.path[this.path.length-1];e.values=void 0}let r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);let i=this.siblingStacks[r],a=n?`${n}:${e}`:e,o=i.get(a)||0,s=0;for(let e of i.values())s+=e;i.set(a,o+1);let c={tag:e,position:s,counter:o};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--){let a=e===this.path.length-1;if(this._matchSegment(r,this.path[e],a)){t=e-1,n--,i=!0;break}}if(!i)return!1}else{let e=t===this.path.length-1;if(!this._matchSegment(r,this.path[t],e))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace)return!1;if(e.attrName!==void 0){if(!n||!t.values||!(e.attrName in t.values))return!1;if(e.attrValue!==void 0){let n=t.values[e.attrName];if(String(n)!==String(e.attrValue))return!1}}if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){return new Proxy(this,{get(e,t,n){if(df.has(t))return()=>{throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};let r=Reflect.get(e,t,n);return t===`path`||t===`siblingStacks`?Object.freeze(Array.isArray(r)?r.map(e=>e instanceof Map?Object.freeze(new Map(e)):Object.freeze({...e})):r):typeof r==`function`?r.bind(e):r},set(e,t){throw TypeError(`Cannot set property '${String(t)}' on a read-only Matcher.`)},deleteProperty(e,t){throw TypeError(`Cannot delete property '${String(t)}' from a read-only Matcher.`)}})}};function pf(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function mf(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}var hf=class{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>jf(t,10,`&#`)},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>jf(t,16,`&#x`)}},this.addExternalEntities=gf,this.parseXml=xf,this.parseTextData=_f,this.resolveNameSpace=vf,this.buildAttributesMap=bf,this.isItStopNode=Tf,this.replaceEntitiesValue=Cf,this.readStopNodeData=kf,this.saveTextToParentTag=wf,this.addChild=Sf,this.ignoreAttributesFn=lf(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new ff,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let e=0;e0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=this.options.jPath?n.toString():n,s=this.options.tagValueProcessor(t,e,r,i,a);return s==null?e:typeof s!=typeof e||s!==e?s:this.options.trimValues||e.trim()===e?Af(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function vf(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}const yf=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function bf(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let r=Sd(e,yf),i=r.length,a={},o={};for(let e=0;e0&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(o);for(let e=0;e`,a,`Closing Tag is not closed.`),i=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){let e=i.indexOf(`:`);e!==-1&&(i=i.substr(e+1))}i=Mf(this.options.transformTagName,i,``,this.options).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(i&&this.options.unpairedTags.indexOf(i)!==-1)throw Error(`Unpaired tag can not be used as closing tag: `);o&&this.options.unpairedTags.indexOf(o)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,a=t}else if(e[a+1]===`?`){let t=Of(e,a,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);if(r=this.saveTextToParentTag(r,n,this.readonlyMatcher),!(this.options.ignoreDeclaration&&t.tagName===`?xml`||this.options.ignorePiTags)){let e=new Jd(t.tagName);e.add(this.options.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[`:@`]=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName)),this.addChild(n,e,this.readonlyMatcher,a)}a=t.closeIndex+1}else if(e.substr(a+1,3)===`!--`){let t=Df(e,`-->`,a+4,`Comment is not closed.`);if(this.options.commentPropName){let i=e.substring(a+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=t}else if(e.substr(a+1,2)===`!D`){let t=i.readDocType(e,a);this.docTypeEntities=t.entities,a=t.i}else if(e.substr(a+1,2)===`![`){let t=Df(e,`]]>`,a,`CDATA is not closed.`)-2,i=e.substring(a+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(i,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??=``,this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,o),a=t+2}else{let i=Of(e,a,this.options.removeNSPrefix);if(!i){let t=e.substring(Math.max(0,a-50),Math.min(e.length,a+50));throw Error(`readTagExp returned undefined at position ${a}. Context: "${t}"`)}let o=i.tagName,s=i.rawTagName,c=i.tagExp,l=i.attrExpPresent,u=i.closeIndex;if({tagName:o,tagExp:c}=Mf(this.options.transformTagName,o,c,this.options),this.options.strictReservedNames&&(o===this.options.commentPropName||o===this.options.cdataPropName||o===this.options.textNodeName||o===this.options.attributesGroupName))throw Error(`Invalid tag name: ${o}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let d=n;d&&this.options.unpairedTags.indexOf(d.tagname)!==-1&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let f=!1;c.length>0&&c.lastIndexOf(`/`)===c.length-1&&(f=!0,o[o.length-1]===`/`?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),l=o!==c);let p=null,m;m=mf(s),o!==t.tagname&&this.matcher.push(o,{},m),o!==c&&l&&(p=this.buildAttributesMap(c,this.matcher,o),p&&pf(p,this.options)),o!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));let h=a;if(this.isCurrentNodeStopNode){let t=``;if(f)a=i.closeIndex;else if(this.options.unpairedTags.indexOf(o)!==-1)a=i.closeIndex;else{let n=this.readStopNodeData(e,s,u+1);if(!n)throw Error(`Unexpected end of ${s}`);a=n.i,t=n.tagContent}let r=new Jd(o);p&&(r[`:@`]=p),r.add(this.options.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,h)}else{if(f){({tagName:o,tagExp:c}=Mf(this.options.transformTagName,o,c,this.options));let e=new Jd(o);p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(this.options.unpairedTags.indexOf(o)!==-1){let e=new Jd(o);p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=i.closeIndex;continue}else{let e=new Jd(o);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),n=e}r=``,a=u}}else r+=e[a];return t.child};function Sf(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);a===!1||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function Cf(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}for(let t of Object.keys(this.docTypeEntities)){let n=this.docTypeEntities[t],i=e.match(n.regx);if(i){if(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions)throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);let t=e.length;if(e=e.replace(n.regx,n.val),r.maxExpandedLength&&(this.currentExpandedLength+=e.length-t,this.currentExpandedLength>r.maxExpandedLength))throw Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${r.maxExpandedLength}`)}}for(let t of Object.keys(this.lastEntities)){let n=this.lastEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}if(e.indexOf(`&`)===-1)return e;if(this.options.htmlEntities)for(let t of Object.keys(this.htmlEntities)){let n=this.htmlEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}return e=e.replace(this.ampEntity.regex,this.ampEntity.val),e}function wf(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function Tf(e,t){if(!e||e.length===0)return!1;for(let n=0;n`){let r,i=``;for(let a=t;a`){let i=Ef(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function kf(e,t,n){let r=n,i=1;for(;n`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(e[n+1]===`?`)n=Df(e,`?>`,n+1,`StopNode is not closed.`);else if(e.substr(n+1,3)===`!--`)n=Df(e,`-->`,n+3,`StopNode is not closed.`);else if(e.substr(n+1,2)===`![`)n=Df(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=Of(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}function Af(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:nf(e,n)}else if(wd(e))return e;else return``}function jf(e,t,n){let r=Number.parseInt(e,t);return r>=0&&r<=1114111?String.fromCodePoint(r):n+e+`;`}function Mf(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return t=Nf(t,r),{tagName:t,tagExp:n}}function Nf(e,t){if(Ed.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return Td.includes(e)?t.onDangerousProperty(e):e}const Pf=Jd.getMetaDataSymbol();function Ff(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)if(r.startsWith(t)){let i=r.substring(t.length);n[i]=e[r]}else n[r]=e[r];return n}function If(e,t,n,r){return Lf(e,t,n,r)}function Lf(e,t,n,r){let i,a={};for(let o=0;o0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function Rf(e){let t=Object.keys(e);for(let e=0;e0&&(n=` `);let r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let e=0;et.maxNestedTags)throw Error(`Maximum nested tags exceeded`);if(!Array.isArray(e)){if(e!=null){let n=e.toString();return n=Xf(n,t),n}return``}for(let s=0;s`,o=!1,r.pop();continue}else if(l===t.commentPropName){a+=n+``,o=!0,r.pop();continue}else if(l[0]===`?`){let e=Jf(c[`:@`],t,d),i=l===`?xml`?``:n,s=c[l][0][t.textNodeName];s=s.length===0?``:` `+s,a+=i+`<${l}${s}${e}?>`,o=!0,r.pop();continue}let f=n;f!==``&&(f+=t.indentBy);let p=n+`<${l}${Jf(c[`:@`],t,d)}`,m;m=d?Gf(c[l],t):Uf(c[l],t,f,r,i),t.unpairedTags.indexOf(l)===-1?(!m||m.length===0)&&t.suppressEmptyNode?a+=p+`/>`:m&&m.endsWith(`>`)?a+=p+`>${m}${n}`:(a+=p+`>`,m&&n!==``&&(m.includes(`/>`)||m.includes(``):t.suppressUnpairedNode?a+=p+`>`:a+=p+`/>`,o=!0,r.pop()}return a}function Wf(e,t){if(!e||t.ignoreAttributes)return null;let n={},r=!1;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let a=i.startsWith(t.attributeNamePrefix)?i.substr(t.attributeNamePrefix.length):i;n[a]=e[i],r=!0}return r?n:null}function Gf(e,t){if(!Array.isArray(e))return e==null?``:e.toString();let n=``;for(let r=0;r`:n+=`<${a}${e}>${r}`}}return n}function Kf(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];i===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function qf(e){let t=Object.keys(e);for(let n=0;n0&&t.processEntities)for(let n=0;n{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}const Qf={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&`},{regex:RegExp(`>`,`g`),val:`>`},{regex:RegExp(`<`,`g`),val:`<`},{regex:RegExp(`'`,`g`),val:`'`},{regex:RegExp(`"`,`g`),val:`"`}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function $f(e){if(this.options=Object.assign({},Qf,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e `,this.newLine=` diff --git a/dist/main.js b/dist/main.js index 5e8af93a..b86b561c 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1,4 +1,4 @@ -import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,N as f,O as p,P as m,R as h,S as g,T as _,U as v,V as y,W as b,X as x,Y as S,Z as C,_ as w,a as T,b as E,c as D,d as O,f as k,g as ee,h as te,i as ne,j as A,k as j,l as re,m as ie,n as ae,o as oe,p as se,q as ce,r as le,s as ue,t as de,u as fe,v as pe,w as me,x as he,y as ge,z as M}from"./cache-CqdRyjOf.js";import N from"node:process";import*as _e from"os";import{EOL as ve}from"os";import*as ye from"crypto";import*as P from"fs";import{existsSync as be,readFileSync as xe}from"fs";import*as F from"path";import{ok as Se}from"assert";import*as Ce from"util";import{Buffer as we}from"node:buffer";import*as Te from"node:crypto";import{createHash as Ee}from"node:crypto";import{pathToFileURL as De}from"node:url";import*as I from"node:fs/promises";import Oe from"node:fs/promises";import*as L from"node:path";import ke,{join as Ae}from"node:path";import{spawn as je}from"node:child_process";import*as Me from"node:os";import Ne,{homedir as Pe}from"node:os";import*as Fe from"stream";function Ie(e){switch(e){case`hit`:return`✅ hit`;case`miss`:return`🆕 miss`;case`corrupted`:return`⚠️ corrupted (clean start)`}}function Le(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}async function Re(e,t){let{eventType:n,repo:i,ref:a,runId:s,runUrl:c,metrics:l,agent:u}=e;try{if(o.addHeading(`Fro Bot Agent Run`,2).addTable([[{data:`Field`,header:!0},{data:`Value`,header:!0}],[`Event`,n],[`Repository`,i],[`Ref`,a],[`Run ID`,`[${s}](${c})`],[`Agent`,u],[`Cache Status`,Ie(l.cacheStatus)],[`Duration`,l.duration==null?`N/A`:Le(l.duration)]]),(l.sessionsUsed.length>0||l.sessionsCreated.length>0)&&(o.addHeading(`Sessions`,3),l.sessionsUsed.length>0&&o.addRaw(`**Used:** ${l.sessionsUsed.join(`, `)}\n`),l.sessionsCreated.length>0&&o.addRaw(`**Created:** ${l.sessionsCreated.join(`, `)}\n`)),l.tokenUsage!=null&&(o.addHeading(`Token Usage`,3),o.addTable([[{data:`Metric`,header:!0},{data:`Count`,header:!0}],[`Input`,l.tokenUsage.input.toLocaleString()],[`Output`,l.tokenUsage.output.toLocaleString()],[`Reasoning`,l.tokenUsage.reasoning.toLocaleString()],[`Cache Read`,l.tokenUsage.cache.read.toLocaleString()],[`Cache Write`,l.tokenUsage.cache.write.toLocaleString()]]),l.model!=null&&o.addRaw(`**Model:** ${l.model}\n`),l.cost!=null&&o.addRaw(`**Cost:** $${l.cost.toFixed(4)}\n`)),(l.prsCreated.length>0||l.commitsCreated.length>0||l.commentsPosted>0)&&(o.addHeading(`Created Artifacts`,3),l.prsCreated.length>0&&o.addList([...l.prsCreated]),l.commitsCreated.length>0&&o.addList(l.commitsCreated.map(e=>`Commit \`${e.slice(0,7)}\``)),l.commentsPosted>0&&o.addRaw(`**Comments Posted:** ${l.commentsPosted}\n`)),l.errors.length>0){o.addHeading(`Errors`,3);for(let e of l.errors){let t=e.recoverable?`🔄 Recovered`:`❌ Failed`;o.addRaw(`- **${e.type}** (${t}): ${e.message}\n`)}}await o.write(),t.debug(`Wrote job summary`)}catch(e){let n=r(e);t.warning(`Failed to write job summary`,{error:n}),h(`Failed to write job summary: ${n}`)}}function ze(){let e=0,t=null,n=`miss`,r=[],i=[],a=[],o=[],s=0,c=null,l=null,u=null,d=[];return{start(){e=Date.now()},end(){t=Date.now()},setCacheStatus(e){n=e},addSessionUsed(e){r.includes(e)||r.push(e)},addSessionCreated(e){i.includes(e)||i.push(e)},addPRCreated(e){a.includes(e)||a.push(e)},addCommitCreated(e){o.includes(e)||o.push(e)},incrementComments(){s++},setTokenUsage(e,t,n){c=e,l=t,u=n},recordError(e,t,n){d.push({timestamp:new Date().toISOString(),type:e,message:t,recoverable:n})},getMetrics(){let f=t==null?Date.now()-e:t-e;return Object.freeze({startTime:e,endTime:t,duration:f,cacheStatus:n,sessionsUsed:Object.freeze([...r]),sessionsCreated:Object.freeze([...i]),prsCreated:Object.freeze([...a]),commitsCreated:Object.freeze([...o]),commentsPosted:s,tokenUsage:c,model:l,cost:u,errors:Object.freeze([...d])})}}}function Be(e){d(`session-id`,e.sessionId??``),d(`cache-status`,e.cacheStatus),d(`duration`,e.duration)}function R(e){let[t,n]=e.split(`/`);if(t==null||n==null||t.length===0||n.length===0)throw Error(`Invalid repository string: ${e}`);return{owner:t,repo:n}}async function Ve(e,t,n,i,a){try{let{owner:r,repo:o}=R(t),{data:s}=await e.rest.reactions.createForIssueComment({owner:r,repo:o,comment_id:n,content:i});return a.debug(`Created comment reaction`,{commentId:n,content:i,reactionId:s.id}),{id:s.id}}catch(e){return a.warning(`Failed to create comment reaction`,{commentId:n,content:i,error:r(e)}),null}}async function He(e,t,n,i){try{let{owner:r,repo:i}=R(t),{data:a}=await e.rest.reactions.listForIssueComment({owner:r,repo:i,comment_id:n,per_page:100});return a.map(e=>({id:e.id,content:e.content,userLogin:e.user?.login??null}))}catch(e){return i.warning(`Failed to list comment reactions`,{commentId:n,error:r(e)}),[]}}async function Ue(e,t,n,i,a){try{let{owner:r,repo:o}=R(t);return await e.rest.reactions.deleteForIssueComment({owner:r,repo:o,comment_id:n,reaction_id:i}),a.debug(`Deleted comment reaction`,{commentId:n,reactionId:i}),!0}catch(e){return a.warning(`Failed to delete comment reaction`,{commentId:n,reactionId:i,error:r(e)}),!1}}async function We(e,t,n,i,a,o){let{owner:s,repo:c}=R(t);try{return await e.rest.issues.createLabel({owner:s,repo:c,name:n,color:i,description:a}),o.debug(`Created label`,{name:n,color:i}),!0}catch(e){return e instanceof Error&&`status`in e&&e.status===422?(o.debug(`Label already exists`,{name:n}),!0):(o.warning(`Failed to create label`,{name:n,error:r(e)}),!1)}}async function Ge(e,t,n,i,a){try{let{owner:r,repo:o}=R(t);return await e.rest.issues.addLabels({owner:r,repo:o,issue_number:n,labels:[...i]}),a.debug(`Added labels to issue`,{issueNumber:n,labels:i}),!0}catch(e){return a.warning(`Failed to add labels to issue`,{issueNumber:n,labels:i,error:r(e)}),!1}}async function Ke(e,t,n,i,a){try{let{owner:r,repo:o}=R(t);return await e.rest.issues.removeLabel({owner:r,repo:o,issue_number:n,name:i}),a.debug(`Removed label from issue`,{issueNumber:n,label:i}),!0}catch(e){return e instanceof Error&&`status`in e&&e.status===404?(a.debug(`Label was not present on issue`,{issueNumber:n,label:i}),!0):(a.warning(`Failed to remove label from issue`,{issueNumber:n,label:i,error:r(e)}),!1)}}async function qe(e,t,n){try{let{owner:n,repo:r}=R(t),{data:i}=await e.rest.repos.get({owner:n,repo:r});return i.default_branch}catch(e){return n.warning(`Failed to get default branch`,{repo:t,error:r(e)}),`main`}}const Je={admin:`OWNER`,maintain:`MEMBER`,write:`COLLABORATOR`,triage:`COLLABORATOR`};async function Ye(e,t,n,i,a){try{let{data:r}=await e.rest.repos.getCollaboratorPermissionLevel({owner:t,repo:n,username:i}),o=Je[r.permission]??null;return a.debug(`Resolved sender permission`,{username:i,permission:r.permission,association:o}),o}catch(e){return a.warning(`Failed to resolve sender permission`,{username:i,error:r(e)}),null}}async function Xe(e,t,n){try{let{data:n}=await e.rest.users.getByUsername({username:t});return{id:n.id,login:n.login}}catch(e){return n.debug(`Failed to get user by username`,{username:t,error:r(e)}),null}}const Ze={maxComments:50,maxCommits:100,maxFiles:100,maxReviews:100,maxBodyBytes:10*1024,maxTotalBytes:100*1024},Qe=`…[truncated]`;function $e(e,t){if(e.length===0)return{text:``,truncated:!1};let n=new TextEncoder,r=n.encode(e);if(r.length<=t)return{text:e,truncated:!1};let i=t-n.encode(Qe).length;if(i<=0)return{text:Qe,truncated:!0};let a=r.slice(0,i),o=new TextDecoder(`utf-8`,{fatal:!1}).decode(a);for(;o.length>0&&o.charCodeAt(o.length-1)===65533;)a=a.slice(0,-1),o=new TextDecoder(`utf-8`,{fatal:!1}).decode(a);return{text:o+Qe,truncated:!0}}function et(e){return e.length===0?``:`**Labels:** ${e.map(e=>`\`${e.name}\``).join(`, `)}\n`}function tt(e){return e.length===0?``:`**Assignees:** ${e.map(e=>`@${e.login}`).join(`, `)}\n`}function nt(e){let t=[];t.push(`## Issue #${e.number}`),t.push(``),t.push(`**Title:** ${e.title}`),t.push(`**State:** ${e.state}`),t.push(`**Author:** ${e.author??`unknown`}`),t.push(`**Created:** ${e.createdAt}`);let n=et(e.labels);n.length>0&&t.push(n.trimEnd());let r=tt(e.assignees);if(r.length>0&&t.push(r.trimEnd()),t.push(``),t.push(`### Body`),t.push(``),t.push(e.body),e.bodyTruncated&&(t.push(``),t.push(`*Note: Body was truncated due to size limits.*`)),e.comments.length>0){t.push(``),t.push(`### Comments (${e.comments.length}${e.commentsTruncated?` of ${e.totalComments}`:``})`),e.commentsTruncated&&(t.push(``),t.push(`*Note: Comments were truncated due to limits.*`)),t.push(``);for(let n of e.comments)t.push(`**${n.author??`unknown`}** (${n.createdAt}):`),t.push(n.body),t.push(``)}return t.join(` +import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,N as f,O as p,P as m,R as h,S as g,T as _,U as v,V as y,W as b,X as x,Y as S,Z as C,_ as w,a as T,b as E,c as D,d as O,f as k,g as ee,h as te,i as ne,j as A,k as j,l as re,m as ie,n as ae,o as oe,p as se,q as ce,r as le,s as ue,t as de,u as fe,v as pe,w as me,x as he,y as ge,z as M}from"./cache-H1aH1Xpr.js";import N from"node:process";import*as _e from"os";import{EOL as ve}from"os";import*as ye from"crypto";import*as P from"fs";import{existsSync as be,readFileSync as xe}from"fs";import*as F from"path";import{ok as Se}from"assert";import*as Ce from"util";import{Buffer as we}from"node:buffer";import*as Te from"node:crypto";import{createHash as Ee}from"node:crypto";import{pathToFileURL as De}from"node:url";import*as I from"node:fs/promises";import Oe from"node:fs/promises";import*as L from"node:path";import ke,{join as Ae}from"node:path";import{spawn as je}from"node:child_process";import*as Me from"node:os";import Ne,{homedir as Pe}from"node:os";import*as Fe from"stream";function Ie(e){switch(e){case`hit`:return`✅ hit`;case`miss`:return`🆕 miss`;case`corrupted`:return`⚠️ corrupted (clean start)`}}function Le(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}async function Re(e,t){let{eventType:n,repo:i,ref:a,runId:s,runUrl:c,metrics:l,agent:u}=e;try{if(o.addHeading(`Fro Bot Agent Run`,2).addTable([[{data:`Field`,header:!0},{data:`Value`,header:!0}],[`Event`,n],[`Repository`,i],[`Ref`,a],[`Run ID`,`[${s}](${c})`],[`Agent`,u],[`Cache Status`,Ie(l.cacheStatus)],[`Duration`,l.duration==null?`N/A`:Le(l.duration)]]),(l.sessionsUsed.length>0||l.sessionsCreated.length>0)&&(o.addHeading(`Sessions`,3),l.sessionsUsed.length>0&&o.addRaw(`**Used:** ${l.sessionsUsed.join(`, `)}\n`),l.sessionsCreated.length>0&&o.addRaw(`**Created:** ${l.sessionsCreated.join(`, `)}\n`)),l.tokenUsage!=null&&(o.addHeading(`Token Usage`,3),o.addTable([[{data:`Metric`,header:!0},{data:`Count`,header:!0}],[`Input`,l.tokenUsage.input.toLocaleString()],[`Output`,l.tokenUsage.output.toLocaleString()],[`Reasoning`,l.tokenUsage.reasoning.toLocaleString()],[`Cache Read`,l.tokenUsage.cache.read.toLocaleString()],[`Cache Write`,l.tokenUsage.cache.write.toLocaleString()]]),l.model!=null&&o.addRaw(`**Model:** ${l.model}\n`),l.cost!=null&&o.addRaw(`**Cost:** $${l.cost.toFixed(4)}\n`)),(l.prsCreated.length>0||l.commitsCreated.length>0||l.commentsPosted>0)&&(o.addHeading(`Created Artifacts`,3),l.prsCreated.length>0&&o.addList([...l.prsCreated]),l.commitsCreated.length>0&&o.addList(l.commitsCreated.map(e=>`Commit \`${e.slice(0,7)}\``)),l.commentsPosted>0&&o.addRaw(`**Comments Posted:** ${l.commentsPosted}\n`)),l.errors.length>0){o.addHeading(`Errors`,3);for(let e of l.errors){let t=e.recoverable?`🔄 Recovered`:`❌ Failed`;o.addRaw(`- **${e.type}** (${t}): ${e.message}\n`)}}await o.write(),t.debug(`Wrote job summary`)}catch(e){let n=r(e);t.warning(`Failed to write job summary`,{error:n}),h(`Failed to write job summary: ${n}`)}}function ze(){let e=0,t=null,n=`miss`,r=[],i=[],a=[],o=[],s=0,c=null,l=null,u=null,d=[];return{start(){e=Date.now()},end(){t=Date.now()},setCacheStatus(e){n=e},addSessionUsed(e){r.includes(e)||r.push(e)},addSessionCreated(e){i.includes(e)||i.push(e)},addPRCreated(e){a.includes(e)||a.push(e)},addCommitCreated(e){o.includes(e)||o.push(e)},incrementComments(){s++},setTokenUsage(e,t,n){c=e,l=t,u=n},recordError(e,t,n){d.push({timestamp:new Date().toISOString(),type:e,message:t,recoverable:n})},getMetrics(){let f=t==null?Date.now()-e:t-e;return Object.freeze({startTime:e,endTime:t,duration:f,cacheStatus:n,sessionsUsed:Object.freeze([...r]),sessionsCreated:Object.freeze([...i]),prsCreated:Object.freeze([...a]),commitsCreated:Object.freeze([...o]),commentsPosted:s,tokenUsage:c,model:l,cost:u,errors:Object.freeze([...d])})}}}function Be(e){d(`session-id`,e.sessionId??``),d(`cache-status`,e.cacheStatus),d(`duration`,e.duration)}function R(e){let[t,n]=e.split(`/`);if(t==null||n==null||t.length===0||n.length===0)throw Error(`Invalid repository string: ${e}`);return{owner:t,repo:n}}async function Ve(e,t,n,i,a){try{let{owner:r,repo:o}=R(t),{data:s}=await e.rest.reactions.createForIssueComment({owner:r,repo:o,comment_id:n,content:i});return a.debug(`Created comment reaction`,{commentId:n,content:i,reactionId:s.id}),{id:s.id}}catch(e){return a.warning(`Failed to create comment reaction`,{commentId:n,content:i,error:r(e)}),null}}async function He(e,t,n,i){try{let{owner:r,repo:i}=R(t),{data:a}=await e.rest.reactions.listForIssueComment({owner:r,repo:i,comment_id:n,per_page:100});return a.map(e=>({id:e.id,content:e.content,userLogin:e.user?.login??null}))}catch(e){return i.warning(`Failed to list comment reactions`,{commentId:n,error:r(e)}),[]}}async function Ue(e,t,n,i,a){try{let{owner:r,repo:o}=R(t);return await e.rest.reactions.deleteForIssueComment({owner:r,repo:o,comment_id:n,reaction_id:i}),a.debug(`Deleted comment reaction`,{commentId:n,reactionId:i}),!0}catch(e){return a.warning(`Failed to delete comment reaction`,{commentId:n,reactionId:i,error:r(e)}),!1}}async function We(e,t,n,i,a,o){let{owner:s,repo:c}=R(t);try{return await e.rest.issues.createLabel({owner:s,repo:c,name:n,color:i,description:a}),o.debug(`Created label`,{name:n,color:i}),!0}catch(e){return e instanceof Error&&`status`in e&&e.status===422?(o.debug(`Label already exists`,{name:n}),!0):(o.warning(`Failed to create label`,{name:n,error:r(e)}),!1)}}async function Ge(e,t,n,i,a){try{let{owner:r,repo:o}=R(t);return await e.rest.issues.addLabels({owner:r,repo:o,issue_number:n,labels:[...i]}),a.debug(`Added labels to issue`,{issueNumber:n,labels:i}),!0}catch(e){return a.warning(`Failed to add labels to issue`,{issueNumber:n,labels:i,error:r(e)}),!1}}async function Ke(e,t,n,i,a){try{let{owner:r,repo:o}=R(t);return await e.rest.issues.removeLabel({owner:r,repo:o,issue_number:n,name:i}),a.debug(`Removed label from issue`,{issueNumber:n,label:i}),!0}catch(e){return e instanceof Error&&`status`in e&&e.status===404?(a.debug(`Label was not present on issue`,{issueNumber:n,label:i}),!0):(a.warning(`Failed to remove label from issue`,{issueNumber:n,label:i,error:r(e)}),!1)}}async function qe(e,t,n){try{let{owner:n,repo:r}=R(t),{data:i}=await e.rest.repos.get({owner:n,repo:r});return i.default_branch}catch(e){return n.warning(`Failed to get default branch`,{repo:t,error:r(e)}),`main`}}const Je={admin:`OWNER`,maintain:`MEMBER`,write:`COLLABORATOR`,triage:`COLLABORATOR`};async function Ye(e,t,n,i,a){try{let{data:r}=await e.rest.repos.getCollaboratorPermissionLevel({owner:t,repo:n,username:i}),o=Je[r.permission]??null;return a.debug(`Resolved sender permission`,{username:i,permission:r.permission,association:o}),o}catch(e){return a.warning(`Failed to resolve sender permission`,{username:i,error:r(e)}),null}}async function Xe(e,t,n){try{let{data:n}=await e.rest.users.getByUsername({username:t});return{id:n.id,login:n.login}}catch(e){return n.debug(`Failed to get user by username`,{username:t,error:r(e)}),null}}const Ze={maxComments:50,maxCommits:100,maxFiles:100,maxReviews:100,maxBodyBytes:10*1024,maxTotalBytes:100*1024},Qe=`…[truncated]`;function $e(e,t){if(e.length===0)return{text:``,truncated:!1};let n=new TextEncoder,r=n.encode(e);if(r.length<=t)return{text:e,truncated:!1};let i=t-n.encode(Qe).length;if(i<=0)return{text:Qe,truncated:!0};let a=r.slice(0,i),o=new TextDecoder(`utf-8`,{fatal:!1}).decode(a);for(;o.length>0&&o.charCodeAt(o.length-1)===65533;)a=a.slice(0,-1),o=new TextDecoder(`utf-8`,{fatal:!1}).decode(a);return{text:o+Qe,truncated:!0}}function et(e){return e.length===0?``:`**Labels:** ${e.map(e=>`\`${e.name}\``).join(`, `)}\n`}function tt(e){return e.length===0?``:`**Assignees:** ${e.map(e=>`@${e.login}`).join(`, `)}\n`}function nt(e){let t=[];t.push(`## Issue #${e.number}`),t.push(``),t.push(`**Title:** ${e.title}`),t.push(`**State:** ${e.state}`),t.push(`**Author:** ${e.author??`unknown`}`),t.push(`**Created:** ${e.createdAt}`);let n=et(e.labels);n.length>0&&t.push(n.trimEnd());let r=tt(e.assignees);if(r.length>0&&t.push(r.trimEnd()),t.push(``),t.push(`### Body`),t.push(``),t.push(e.body),e.bodyTruncated&&(t.push(``),t.push(`*Note: Body was truncated due to size limits.*`)),e.comments.length>0){t.push(``),t.push(`### Comments (${e.comments.length}${e.commentsTruncated?` of ${e.totalComments}`:``})`),e.commentsTruncated&&(t.push(``),t.push(`*Note: Comments were truncated due to limits.*`)),t.push(``);for(let n of e.comments)t.push(`**${n.author??`unknown`}** (${n.createdAt}):`),t.push(n.body),t.push(``)}return t.join(` `)}function rt(e){let t=[];t.push(`## Pull Request #${e.number}`),t.push(``),t.push(`**Title:** ${e.title}`),t.push(`**State:** ${e.state}`),t.push(`**Author:** ${e.author??`unknown`}`),t.push(`**Created:** ${e.createdAt}`),t.push(`**Base:** ${e.baseBranch} ← **Head:** ${e.headBranch}`),e.isFork&&t.push(`**Fork:** Yes (external contributor)`);let n=et(e.labels);n.length>0&&t.push(n.trimEnd());let r=tt(e.assignees);if(r.length>0&&t.push(r.trimEnd()),t.push(``),t.push(`### Description`),t.push(``),t.push(e.body),e.bodyTruncated&&(t.push(``),t.push(`*Note: Description was truncated due to size limits.*`)),e.files.length>0){t.push(``),t.push(`### Files Changed (${e.files.length}${e.filesTruncated?` of ${e.totalFiles}`:``})`),t.push(``),t.push(`| File | +/- |`),t.push(`|------|-----|`);for(let n of e.files)t.push(`| \`${n.path}\` | +${n.additions}/-${n.deletions} |`)}if(e.commits.length>0){t.push(``),t.push(`### Commits (${e.commits.length}${e.commitsTruncated?` of ${e.totalCommits}`:``})`),t.push(``);for(let n of e.commits){let e=n.oid.slice(0,7);t.push(`- \`${e}\` ${n.message.split(` `)[0]}`)}}if(e.reviews.length>0){t.push(``),t.push(`### Reviews (${e.reviews.length}${e.reviewsTruncated?` of ${e.totalReviews}`:``})`),t.push(``);for(let n of e.reviews)t.push(`**${n.author??`unknown`}** - ${n.state}`),n.body.length>0&&t.push(n.body),t.push(``)}if(e.comments.length>0){t.push(``),t.push(`### Comments (${e.comments.length}${e.commentsTruncated?` of ${e.totalComments}`:``})`),t.push(``);for(let n of e.comments)t.push(`**${n.author??`unknown`}** (${n.createdAt}):`),t.push(n.body),t.push(``)}return t.join(` `)}function it(e){return e.type===`issue`?nt(e):rt(e)}async function at(e,t,n,i,a,o){try{let[r,o]=await Promise.all([e.rest.issues.get({owner:t,repo:n,issue_number:i}),e.rest.issues.listComments({owner:t,repo:n,issue_number:i,per_page:a.maxComments})]),s=r.data,c=$e(s.body??``,a.maxBodyBytes),l=o.data.slice(0,a.maxComments).map(e=>({id:e.node_id??String(e.id),author:e.user?.login??null,body:e.body??``,createdAt:e.created_at,authorAssociation:e.author_association,isMinimized:!1})),u=(s.labels??[]).filter(e=>typeof e==`object`&&!!e&&`name`in e).map(e=>({name:e.name??``,color:e.color})),d=(s.assignees??[]).map(e=>({login:e?.login??``}));return{type:`issue`,number:s.number,title:s.title,body:c.text,bodyTruncated:c.truncated,state:s.state,author:s.user?.login??null,createdAt:s.created_at,labels:u,assignees:d,comments:l,commentsTruncated:o.data.length>=a.maxComments,totalComments:o.data.length}}catch(e){return o.warning(`REST issue fallback failed`,{owner:t,repo:n,number:i,error:r(e)}),null}}async function ot(e,t,n,i,a,o){try{let[s,c,l,u,d]=await Promise.all([e.rest.pulls.get({owner:t,repo:n,pull_number:i}),e.rest.pulls.listCommits({owner:t,repo:n,pull_number:i,per_page:a.maxCommits}),e.rest.pulls.listFiles({owner:t,repo:n,pull_number:i,per_page:a.maxFiles}),e.rest.pulls.listReviews({owner:t,repo:n,pull_number:i,per_page:a.maxReviews}),e.rest.issues.listComments({owner:t,repo:n,issue_number:i,per_page:a.maxComments})]),f=await e.rest.pulls.listRequestedReviewers({owner:t,repo:n,pull_number:i}).catch(e=>(o.warning(`Failed to fetch requested reviewers, defaulting to empty`,{owner:t,repo:n,number:i,error:r(e)}),{data:{users:[],teams:[]}})),p=s.data,m=$e(p.body??``,a.maxBodyBytes),h=p.base.repo?.owner.login,g=p.head.repo?.owner.login,_=g==null||h!==g,v=d.data.slice(0,a.maxComments).map(e=>({id:e.node_id??String(e.id),author:e.user?.login??null,body:e.body??``,createdAt:e.created_at,authorAssociation:e.author_association,isMinimized:!1})),y=c.data.slice(0,a.maxCommits).map(e=>({oid:e.sha,message:e.commit.message,author:e.commit.author?.name??null})),b=l.data.slice(0,a.maxFiles).map(e=>({path:e.filename,additions:e.additions,deletions:e.deletions,status:e.status})),x=u.data.slice(0,a.maxReviews).map(e=>({author:e.user?.login??null,state:e.state,body:e.body??``,createdAt:e.submitted_at??``,comments:[]})),S=(p.labels??[]).map(e=>({name:e.name??``,color:e.color})),C=(p.assignees??[]).map(e=>({login:e?.login??``})),w=(f.data.users??[]).map(e=>e.login),T=(f.data.teams??[]).map(e=>e.name);return{type:`pull_request`,number:p.number,title:p.title,body:m.text,bodyTruncated:m.truncated,state:p.state,author:p.user?.login??null,createdAt:p.created_at,baseBranch:p.base.ref,headBranch:p.head.ref,isFork:_,labels:S,assignees:C,comments:v,commentsTruncated:d.data.length>=a.maxComments,totalComments:d.data.length,commits:y,commitsTruncated:c.data.length>=a.maxCommits,totalCommits:c.data.length,files:b,filesTruncated:l.data.length>=a.maxFiles,totalFiles:l.data.length,reviews:x,reviewsTruncated:u.data.length>=a.maxReviews,totalReviews:u.data.length,authorAssociation:p.author_association,requestedReviewers:w,requestedReviewerTeams:T}}catch(e){return o.warning(`REST pull request fallback failed`,{owner:t,repo:n,number:i,error:r(e)}),null}}async function st(e,t,n,i,a,o){try{return await e.graphql(` diff --git a/dist/post.js b/dist/post.js index 83b402f4..da209ed4 100644 --- a/dist/post.js +++ b/dist/post.js @@ -1 +1 @@ -import{D as e,E as t,M as n,T as r,c as i,f as a,i as o,t as s,u as c}from"./cache-CqdRyjOf.js";async function l(l={}){let u=l.logger??t({phase:`post`}),d=n(r.SHOULD_SAVE_CACHE),f=n(r.CACHE_SAVED),p=n(r.SESSION_ID)||null,m=n(r.OPENCODE_VERSION)||null;if(u.debug(`Post-action state`,{shouldSaveCache:d,cacheSaved:f,sessionId:p,opencodeVersion:m}),d!==`true`){u.info(`Skipping post-action: event was not processed`,{shouldSaveCache:d});return}if(f===`true`){u.info(`Skipping post-action: cache already saved by main action`,{cacheSaved:f});return}try{await s({components:o(),runId:i(),logger:u,storagePath:a(),authPath:c(),opencodeVersion:m})?u.info(`Post-action cache saved`,{sessionId:p}):u.info(`Post-action: no cache content to save`,{sessionId:p})}catch(t){u.warning(`Post-action cache save failed (non-fatal)`,{error:e(t)})}}await l();export{}; \ No newline at end of file +import{D as e,E as t,M as n,T as r,c as i,f as a,i as o,t as s,u as c}from"./cache-H1aH1Xpr.js";async function l(l={}){let u=l.logger??t({phase:`post`}),d=n(r.SHOULD_SAVE_CACHE),f=n(r.CACHE_SAVED),p=n(r.SESSION_ID)||null,m=n(r.OPENCODE_VERSION)||null;if(u.debug(`Post-action state`,{shouldSaveCache:d,cacheSaved:f,sessionId:p,opencodeVersion:m}),d!==`true`){u.info(`Skipping post-action: event was not processed`,{shouldSaveCache:d});return}if(f===`true`){u.info(`Skipping post-action: cache already saved by main action`,{cacheSaved:f});return}try{await s({components:o(),runId:i(),logger:u,storagePath:a(),authPath:c(),opencodeVersion:m})?u.info(`Post-action cache saved`,{sessionId:p}):u.info(`Post-action: no cache content to save`,{sessionId:p})}catch(t){u.warning(`Post-action cache save failed (non-fatal)`,{error:e(t)})}}await l();export{}; \ No newline at end of file diff --git a/package.json b/package.json index b0125b51..d3e75328 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "read-package-up": "12.0.0", "semantic-release": "25.0.3", "simple-git-hooks": "2.13.1", - "tsdown": "0.21.4", + "tsdown": "0.21.5", "typescript": "5.9.3", "vitest": "4.1.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 46e45a26..fa35c8e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,8 +100,8 @@ importers: specifier: 2.13.1 version: 2.13.1 tsdown: - specifier: 0.21.4 - version: 0.21.4(synckit@0.11.12)(typescript@5.9.3) + specifier: 0.21.5 + version: 0.21.5(synckit@0.11.12)(typescript@5.9.3) typescript: specifier: 5.9.3 version: 5.9.3 @@ -709,8 +709,8 @@ packages: resolution: {integrity: sha512-XRO0zi2NIUKq2lUk3T1ecFSld1fMWRKE6naRFGkgkdeosx7IslyUKNv5Dcb5PJTja9tHJoFu0v/7yEpAkrkrTg==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@oxc-project/types@0.115.0': - resolution: {integrity: sha512-4n91DKnebUS4yjUHl2g3/b2T+IUdCfmoZGhmwsovZCDaJSs+QkVAM+0AqqTxHSsHfeiMuueT75cZaZcT/m0pSw==} + '@oxc-project/types@0.122.0': + resolution: {integrity: sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==} '@pkgr/core@0.2.9': resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} @@ -737,103 +737,201 @@ packages: '@quansync/fs@1.0.0': resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} - '@rolldown/binding-android-arm64@1.0.0-rc.9': - resolution: {integrity: sha512-lcJL0bN5hpgJfSIz/8PIf02irmyL43P+j1pTCfbD1DbLkmGRuFIA4DD3B3ZOvGqG0XiVvRznbKtN0COQVaKUTg==} + '@rolldown/binding-android-arm64@1.0.0-rc.11': + resolution: {integrity: sha512-SJ+/g+xNnOh6NqYxD0V3uVN4W3VfnrGsC9/hoglicgTNfABFG9JjISvkkU0dNY84MNHLWyOgxP9v9Y9pX4S7+A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.0.0-rc.9': - resolution: {integrity: sha512-J7Zk3kLYFsLtuH6U+F4pS2sYVzac0qkjcO5QxHS7OS7yZu2LRs+IXo+uvJ/mvpyUljDJ3LROZPoQfgBIpCMhdQ==} + '@rolldown/binding-android-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-rc.11': + resolution: {integrity: sha512-7WQgR8SfOPwmDZGFkThUvsmd/nwAWv91oCO4I5LS7RKrssPZmOt7jONN0cW17ydGC1n/+puol1IpoieKqQidmg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-rc.9': - resolution: {integrity: sha512-iwtmmghy8nhfRGeNAIltcNXzD0QMNaaA5U/NyZc1Ia4bxrzFByNMDoppoC+hl7cDiUq5/1CnFthpT9n+UtfFyg==} + '@rolldown/binding-darwin-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-rc.11': + resolution: {integrity: sha512-39Ks6UvIHq4rEogIfQBoBRusj0Q0nPVWIvqmwBLaT6aqQGIakHdESBVOPRRLacy4WwUPIx4ZKzfZ9PMW+IeyUQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-rc.12': + resolution: {integrity: sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.0.0-rc.9': - resolution: {integrity: sha512-DLFYI78SCiZr5VvdEplsVC2Vx53lnA4/Ga5C65iyldMVaErr86aiqCoNBLl92PXPfDtUYjUh+xFFor40ueNs4Q==} + '@rolldown/binding-freebsd-x64@1.0.0-rc.11': + resolution: {integrity: sha512-jfsm0ZHfhiqrvWjJAmzsqiIFPz5e7mAoCOPBNTcNgkiid/LaFKiq92+0ojH+nmJmKYkre4t71BWXUZDNp7vsag==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-freebsd-x64@1.0.0-rc.12': + resolution: {integrity: sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.9': - resolution: {integrity: sha512-CsjTmTwd0Hri6iTw/DRMK7kOZ7FwAkrO4h8YWKoX/kcj833e4coqo2wzIFywtch/8Eb5enQ/lwLM7w6JX1W5RQ==} + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.11': + resolution: {integrity: sha512-zjQaUtSyq1nVe3nxmlSCuR96T1LPlpvmJ0SZy0WJFEsV4kFbXcq2u68L4E6O0XeFj4aex9bEauqjW8UQBeAvfQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.12': + resolution: {integrity: sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.9': - resolution: {integrity: sha512-2x9O2JbSPxpxMDhP9Z74mahAStibTlrBMW0520+epJH5sac7/LwZW5Bmg/E6CXuEF53JJFW509uP+lSedaUNxg==} + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.11': + resolution: {integrity: sha512-WMW1yE6IOnehTcFE9eipFkm3XN63zypWlrJQ2iF7NrQ9b2LDRjumFoOGJE8RJJTJCTBAdmLMnJ8uVitACUUo1Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.9': - resolution: {integrity: sha512-JA1QRW31ogheAIRhIg9tjMfsYbglXXYGNPLdPEYrwFxdbkQCAzvpSCSHCDWNl4hTtrol8WeboCSEpjdZK8qrCg==} + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.11': + resolution: {integrity: sha512-jfndI9tsfm4APzjNt6QdBkYwre5lRPUgHeDHoI7ydKUuJvz3lZeCfMsI56BZj+7BYqiKsJm7cfd/6KYV7ubrBg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.12': + resolution: {integrity: sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.9': - resolution: {integrity: sha512-aOKU9dJheda8Kj8Y3w9gnt9QFOO+qKPAl8SWd7JPHP+Cu0EuDAE5wokQubLzIDQWg2myXq2XhTpOVS07qqvT+w==} + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.11': + resolution: {integrity: sha512-ZlFgw46NOAGMgcdvdYwAGu2Q+SLFA9LzbJLW+iyMOJyhj5wk6P3KEE9Gct4xWwSzFoPI7JCdYmYMzVtlgQ+zfw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.9': - resolution: {integrity: sha512-OalO94fqj7IWRn3VdXWty75jC5dk4C197AWEuMhIpvVv2lw9fiPhud0+bW2ctCxb3YoBZor71QHbY+9/WToadA==} + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.11': + resolution: {integrity: sha512-hIOYmuT6ofM4K04XAZd3OzMySEO4K0/nc9+jmNcxNAxRi6c5UWpqfw3KMFV4MVFWL+jQsSh+bGw2VqmaPMTLyw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.9': - resolution: {integrity: sha512-cVEl1vZtBsBZna3YMjGXNvnYYrOJ7RzuWvZU0ffvJUexWkukMaDuGhUXn0rjnV0ptzGVkvc+vW9Yqy6h8YX4pg==} + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.11': + resolution: {integrity: sha512-qXBQQO9OvkjjQPLdUVr7Nr2t3QTZI7s4KZtfw7HzBgjbmAPSFwSv4rmET9lLSgq3rH/ndA3ngv3Qb8l2njoPNA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.0.0-rc.9': - resolution: {integrity: sha512-UzYnKCIIc4heAKgI4PZ3dfBGUZefGCJ1TPDuLHoCzgrMYPb5Rv6TLFuYtyM4rWyHM7hymNdsg5ik2C+UD9VDbA==} + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.11': + resolution: {integrity: sha512-/tpFfoSTzUkH9LPY+cYbqZBDyyX62w5fICq9qzsHLL8uTI6BHip3Q9Uzft0wylk/i8OOwKik8OxW+QAhDmzwmg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@rolldown/binding-openharmony-arm64@1.0.0-rc.9': - resolution: {integrity: sha512-+6zoiF+RRyf5cdlFQP7nm58mq7+/2PFaY2DNQeD4B87N36JzfF/l9mdBkkmTvSYcYPE8tMh/o3cRlsx1ldLfog==} + '@rolldown/binding-linux-x64-musl@1.0.0-rc.12': + resolution: {integrity: sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.11': + resolution: {integrity: sha512-mcp3Rio2w72IvdZG0oQ4bM2c2oumtwHfUfKncUM6zGgz0KgPz4YmDPQfnXEiY5t3+KD/i8HG2rOB/LxdmieK2g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-wasm32-wasi@1.0.0-rc.9': - resolution: {integrity: sha512-rgFN6sA/dyebil3YTlL2evvi/M+ivhfnyxec7AccTpRPccno/rPoNlqybEZQBkcbZu8Hy+eqNJCqfBR8P7Pg8g==} + '@rolldown/binding-openharmony-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.11': + resolution: {integrity: sha512-LXk5Hii1Ph9asuGRjBuz8TUxdc1lWzB7nyfdoRgI0WGPZKmCxvlKk8KfYysqtr4MfGElu/f/pEQRh8fcEgkrWw==} engines: {node: '>=14.0.0'} cpu: [wasm32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.9': - resolution: {integrity: sha512-lHVNUG/8nlF1IQk1C0Ci574qKYyty2goMiPlRqkC5R+3LkXDkL5Dhx8ytbxq35m+pkHVIvIxviD+TWLdfeuadA==} + '@rolldown/binding-wasm32-wasi@1.0.0-rc.12': + resolution: {integrity: sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.11': + resolution: {integrity: sha512-dDwf5otnx0XgRY1yqxOC4ITizcdzS/8cQ3goOWv3jFAo4F+xQYni+hnMuO6+LssHHdJW7+OCVL3CoU4ycnh35Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.9': - resolution: {integrity: sha512-G0oA4+w1iY5AGi5HcDTxWsoxF509hrFIPB2rduV5aDqS9FtDg1CAfa7V34qImbjfhIcA8C+RekocJZA96EarwQ==} + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.12': + resolution: {integrity: sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.11': + resolution: {integrity: sha512-LN4/skhSggybX71ews7dAj6r2geaMJfm3kMbK2KhFMg9B10AZXnKoLCVVgzhMHL0S+aKtr4p8QbAW8k+w95bAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.12': + resolution: {integrity: sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] - '@rolldown/pluginutils@1.0.0-rc.9': - resolution: {integrity: sha512-w6oiRWgEBl04QkFZgmW+jnU1EC9b57Oihi2ot3HNWIQRqgHp5PnYDia5iZ5FF7rpa4EQdiqMDXjlqKGXBhsoXw==} + '@rolldown/pluginutils@1.0.0-rc.11': + resolution: {integrity: sha512-xQO9vbwBecJRv9EUcQ/y0dzSTJgA7Q6UVN7xp6B81+tBGSLVAK03yJ9NkJaUA7JFD91kbjxRSC/mDnmvXzbHoQ==} + + '@rolldown/pluginutils@1.0.0-rc.12': + resolution: {integrity: sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw==} '@rollup/rollup-android-arm-eabi@4.59.0': resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} @@ -3189,8 +3287,8 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.3: - resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} pify@3.0.0: @@ -3382,8 +3480,13 @@ packages: vue-tsc: optional: true - rolldown@1.0.0-rc.9: - resolution: {integrity: sha512-9EbgWge7ZH+yqb4d2EnELAntgPTWbfL8ajiTW+SyhJEC4qhBbkCKbqFV4Ge4zmu5ziQuVbWxb/XwLZ+RIO7E8Q==} + rolldown@1.0.0-rc.11: + resolution: {integrity: sha512-NRjoKMusSjfRbSYiH3VSumlkgFe7kYAa3pzVOsVYVFY3zb5d7nS+a3KGQ7hJKXuYWbzJKPVQ9Wxq2UvyK+ENpw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + rolldown@1.0.0-rc.12: + resolution: {integrity: sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -3692,17 +3795,17 @@ packages: peerDependencies: typescript: '>=4.0.0' - tsdown@0.21.4: - resolution: {integrity: sha512-Q/kBi8SXkr4X6JI/NAZKZY1UuiEcbuXtIskL4tZCsgpDiEPM/2W6lC+OonNA31S+V3KsWedFvbFDBs23hvt+Aw==} + tsdown@0.21.5: + resolution: {integrity: sha512-TlgNhfPioAD6ECCUnZsxcUsXXuPPR4Rrxz3az741kL/M3oGIET4a9GajSNRNRx+jIva73TYUKQybrEPkDYN+fQ==} engines: {node: '>=20.19.0'} hasBin: true peerDependencies: '@arethetypeswrong/core': ^0.18.1 - '@tsdown/css': 0.21.4 - '@tsdown/exe': 0.21.4 + '@tsdown/css': 0.21.5 + '@tsdown/exe': 0.21.5 '@vitejs/devtools': '*' publint: ^0.3.0 - typescript: ^5.0.0 + typescript: ^5.0.0 || ^6.0.0 unplugin-unused: ^0.5.0 peerDependenciesMeta: '@arethetypeswrong/core': @@ -3841,8 +3944,8 @@ packages: unrs-resolver@1.11.1: resolution: {integrity: sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==} - unrun@0.2.32: - resolution: {integrity: sha512-opd3z6791rf281JdByf0RdRQrpcc7WyzqittqIXodM/5meNWdTwrVxeyzbaCp4/Rgls/um14oUaif1gomO8YGg==} + unrun@0.2.34: + resolution: {integrity: sha512-LyaghRBR++r7svhDK6tnDz2XaYHWdneBOA0jbS8wnRsHerI9MFljX4fIiTgbbNbEVzZ0C9P1OjWLLe1OqoaaEw==} engines: {node: '>=20.19.0'} hasBin: true peerDependencies: @@ -4764,7 +4867,7 @@ snapshots: '@ota-meshi/ast-token-store@0.3.0': {} - '@oxc-project/types@0.115.0': {} + '@oxc-project/types@0.122.0': {} '@pkgr/core@0.2.9': {} @@ -4790,54 +4893,103 @@ snapshots: dependencies: quansync: 1.0.0 - '@rolldown/binding-android-arm64@1.0.0-rc.9': + '@rolldown/binding-android-arm64@1.0.0-rc.11': optional: true - '@rolldown/binding-darwin-arm64@1.0.0-rc.9': + '@rolldown/binding-android-arm64@1.0.0-rc.12': optional: true - '@rolldown/binding-darwin-x64@1.0.0-rc.9': + '@rolldown/binding-darwin-arm64@1.0.0-rc.11': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-rc.9': + '@rolldown/binding-darwin-arm64@1.0.0-rc.12': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.9': + '@rolldown/binding-darwin-x64@1.0.0-rc.11': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.9': + '@rolldown/binding-darwin-x64@1.0.0-rc.12': optional: true - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.9': + '@rolldown/binding-freebsd-x64@1.0.0-rc.11': optional: true - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.9': + '@rolldown/binding-freebsd-x64@1.0.0-rc.12': optional: true - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.9': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.11': optional: true - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.9': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.12': optional: true - '@rolldown/binding-linux-x64-musl@1.0.0-rc.9': + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.11': optional: true - '@rolldown/binding-openharmony-arm64@1.0.0-rc.9': + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.12': optional: true - '@rolldown/binding-wasm32-wasi@1.0.0-rc.9': + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.11': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.11': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.11': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.11': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.11': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.12': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.11': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.11': + dependencies: + '@napi-rs/wasm-runtime': 1.1.1 + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.12': dependencies: '@napi-rs/wasm-runtime': 1.1.1 optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.9': + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.11': optional: true - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.9': + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.12': optional: true - '@rolldown/pluginutils@1.0.0-rc.9': {} + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.11': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.12': + optional: true + + '@rolldown/pluginutils@1.0.0-rc.11': {} + + '@rolldown/pluginutils@1.0.0-rc.12': {} '@rollup/rollup-android-arm-eabi@4.59.0': optional: true @@ -5068,7 +5220,7 @@ snapshots: eslint-visitor-keys: 4.2.1 espree: 10.4.0 estraverse: 5.3.0 - picomatch: 4.0.3 + picomatch: 4.0.4 '@tufjs/canonical-json@2.0.0': {} @@ -6213,9 +6365,9 @@ snapshots: dependencies: format: 0.2.2 - fdir@6.5.0(picomatch@4.0.3): + fdir@6.5.0(picomatch@4.0.4): optionalDependencies: - picomatch: 4.0.3 + picomatch: 4.0.4 figures@2.0.0: dependencies: @@ -6593,7 +6745,7 @@ snapshots: dependencies: commander: 14.0.3 listr2: 9.0.5 - picomatch: 4.0.3 + picomatch: 4.0.4 string-argv: 0.3.2 tinyexec: 1.0.4 yaml: 2.8.2 @@ -7375,7 +7527,7 @@ snapshots: picomatch@2.3.1: {} - picomatch@4.0.3: {} + picomatch@4.0.4: {} pify@3.0.0: {} @@ -7544,7 +7696,7 @@ snapshots: rfdc@1.4.1: {} - rolldown-plugin-dts@0.22.5(rolldown@1.0.0-rc.9)(typescript@5.9.3): + rolldown-plugin-dts@0.22.5(rolldown@1.0.0-rc.11)(typescript@5.9.3): dependencies: '@babel/generator': 8.0.0-rc.2 '@babel/helper-validator-identifier': 8.0.0-rc.2 @@ -7555,32 +7707,53 @@ snapshots: dts-resolver: 2.1.3 get-tsconfig: 4.13.6 obug: 2.1.1 - rolldown: 1.0.0-rc.9 + rolldown: 1.0.0-rc.11 optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: - oxc-resolver - rolldown@1.0.0-rc.9: + rolldown@1.0.0-rc.11: dependencies: - '@oxc-project/types': 0.115.0 - '@rolldown/pluginutils': 1.0.0-rc.9 + '@oxc-project/types': 0.122.0 + '@rolldown/pluginutils': 1.0.0-rc.11 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-rc.11 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.11 + '@rolldown/binding-darwin-x64': 1.0.0-rc.11 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.11 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.11 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.11 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.11 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.11 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.11 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.11 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.11 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.11 + '@rolldown/binding-wasm32-wasi': 1.0.0-rc.11 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.11 + '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.11 + + rolldown@1.0.0-rc.12: + dependencies: + '@oxc-project/types': 0.122.0 + '@rolldown/pluginutils': 1.0.0-rc.12 optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-rc.9 - '@rolldown/binding-darwin-arm64': 1.0.0-rc.9 - '@rolldown/binding-darwin-x64': 1.0.0-rc.9 - '@rolldown/binding-freebsd-x64': 1.0.0-rc.9 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.9 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.9 - '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.9 - '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.9 - '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.9 - '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.9 - '@rolldown/binding-linux-x64-musl': 1.0.0-rc.9 - '@rolldown/binding-openharmony-arm64': 1.0.0-rc.9 - '@rolldown/binding-wasm32-wasi': 1.0.0-rc.9 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.9 - '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.9 + '@rolldown/binding-android-arm64': 1.0.0-rc.12 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.12 + '@rolldown/binding-darwin-x64': 1.0.0-rc.12 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.12 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.12 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.12 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.12 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.12 + '@rolldown/binding-wasm32-wasi': 1.0.0-rc.12 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.12 + '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.12 rollup@4.59.0: dependencies: @@ -7896,8 +8069,8 @@ snapshots: tinyglobby@0.2.15: dependencies: - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 tinyrainbow@3.1.0: {} @@ -7928,10 +8101,10 @@ snapshots: ts-declaration-location@1.0.7(typescript@5.9.3): dependencies: - picomatch: 4.0.3 + picomatch: 4.0.4 typescript: 5.9.3 - tsdown@0.21.4(synckit@0.11.12)(typescript@5.9.3): + tsdown@0.21.5(synckit@0.11.12)(typescript@5.9.3): dependencies: ansis: 4.2.0 cac: 7.0.0 @@ -7940,15 +8113,15 @@ snapshots: hookable: 6.1.0 import-without-cache: 0.2.5 obug: 2.1.1 - picomatch: 4.0.3 - rolldown: 1.0.0-rc.9 - rolldown-plugin-dts: 0.22.5(rolldown@1.0.0-rc.9)(typescript@5.9.3) + picomatch: 4.0.4 + rolldown: 1.0.0-rc.11 + rolldown-plugin-dts: 0.22.5(rolldown@1.0.0-rc.11)(typescript@5.9.3) semver: 7.7.4 tinyexec: 1.0.4 tinyglobby: 0.2.15 tree-kill: 1.2.2 unconfig-core: 7.5.0 - unrun: 0.2.32(synckit@0.11.12) + unrun: 0.2.34(synckit@0.11.12) optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: @@ -8086,9 +8259,9 @@ snapshots: '@unrs/resolver-binding-win32-ia32-msvc': 1.11.1 '@unrs/resolver-binding-win32-x64-msvc': 1.11.1 - unrun@0.2.32(synckit@0.11.12): + unrun@0.2.34(synckit@0.11.12): dependencies: - rolldown: 1.0.0-rc.9 + rolldown: 1.0.0-rc.12 optionalDependencies: synckit: 0.11.12 @@ -8116,8 +8289,8 @@ snapshots: vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2): dependencies: esbuild: 0.27.4 - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 postcss: 8.5.8 rollup: 4.59.0 tinyglobby: 0.2.15 @@ -8141,7 +8314,7 @@ snapshots: magic-string: 0.30.21 obug: 2.1.1 pathe: 2.0.3 - picomatch: 4.0.3 + picomatch: 4.0.4 std-env: 4.0.0 tinybench: 2.9.0 tinyexec: 1.0.4