diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 749b398..fb5c9fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -231,6 +231,33 @@ jobs: run: | echo "NODE_AUTH_TOKEN is set: ${NODE_AUTH_TOKEN:+yes}" + test-alpine-container: + strategy: + fail-fast: false + matrix: + version: [latest, alpha] + runs-on: ubuntu-latest + container: + image: alpine:3.21 + steps: + - name: Install Alpine dependencies + run: apk add --no-cache bash curl gcompat libstdc++ + + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + + - name: Setup Vite+ (${{ matrix.version }}) + uses: ./ + with: + version: ${{ matrix.version }} + run-install: false + cache: false + + - name: Verify installation + run: vp --version + + - name: Verify vp exec works + run: vp exec node -e "console.log('vp exec works in Alpine')" + build: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 92c4040..c6606c4 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,22 @@ steps: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} ``` +### Alpine Container + +Alpine Linux uses musl libc instead of glibc. Install compatibility packages before using the action: + +```yaml +jobs: + build: + runs-on: ubuntu-latest + container: + image: alpine:3.21 + steps: + - run: apk add --no-cache bash curl gcompat libstdc++ + - uses: actions/checkout@v6 + - uses: voidzero-dev/setup-vp@v1 +``` + ### Matrix Testing with Multiple Node.js Versions ```yaml diff --git a/dist/index.mjs b/dist/index.mjs index bd13d1d..595bb58 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1,5 +1,5 @@ import{createRequire as e}from"node:module";import{basename as t,dirname as n,isAbsolute as r,join as i,resolve as a}from"node:path";import{existsSync as o,readFileSync as s,readdirSync as c,statSync as l,writeFileSync as u}from"node:fs";import{EOL as d,arch as f,homedir as p,platform as m}from"node:os";var h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,v=Object.prototype.hasOwnProperty,y=(e,t)=>()=>(e&&(t=e(e=0)),t),b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),x=(e,t)=>{let n={};for(var r in e)h(n,r,{get:e[r],enumerable:!0});return t||h(n,Symbol.toStringTag,{value:`Module`}),n},S=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=_(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=g(t,s))||r.enumerable});return e},C=e=>v.call(e,`module.exports`)?e[`module.exports`]:S(h({},`__esModule`,{value:!0}),e),w=e(import.meta.url),T=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.toCommandProperties=e.toCommandValue=void 0;function t(e){return e==null?``:typeof e==`string`||e instanceof String?e:JSON.stringify(e)}e.toCommandValue=t;function n(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}}e.toCommandProperties=n})),E=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.issue=e.issueCommand=void 0;let i=r(w(`os`)),a=T();function o(e,t,n){let r=new c(e,t,n);process.stdout.write(r.toString()+i.EOL)}e.issueCommand=o;function s(e,t=``){o(e,{},t)}e.issue=s;var c=class{constructor(e,t,n){e||=`missing.command`,this.command=e,this.properties=t,this.message=n}toString(){let e=`::`+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=` `;let t=!0;for(let n in this.properties)if(this.properties.hasOwnProperty(n)){let r=this.properties[n];r&&(t?t=!1:e+=`,`,e+=`${n}=${u(r)}`)}}return e+=`::${l(this.message)}`,e}};function l(e){return(0,a.toCommandValue)(e).replace(/%/g,`%25`).replace(/\r/g,`%0D`).replace(/\n/g,`%0A`)}function u(e){return(0,a.toCommandValue)(e).replace(/%/g,`%25`).replace(/\r/g,`%0D`).replace(/\n/g,`%0A`).replace(/:/g,`%3A`).replace(/,/g,`%2C`)}})),D=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.prepareKeyValueMessage=e.issueFileCommand=void 0;let i=r(w(`crypto`)),a=r(w(`fs`)),o=r(w(`os`)),s=T();function c(e,t){let n=process.env[`GITHUB_${e}`];if(!n)throw Error(`Unable to find environment variable for file command ${e}`);if(!a.existsSync(n))throw Error(`Missing file at path: ${n}`);a.appendFileSync(n,`${(0,s.toCommandValue)(t)}${o.EOL}`,{encoding:`utf8`})}e.issueFileCommand=c;function l(e,t){let n=`ghadelimiter_${i.randomUUID()}`,r=(0,s.toCommandValue)(t);if(e.includes(n))throw Error(`Unexpected input: name should not contain the delimiter "${n}"`);if(r.includes(n))throw Error(`Unexpected input: value should not contain the delimiter "${n}"`);return`${e}<<${n}${o.EOL}${r}${o.EOL}${n}`}e.prepareKeyValueMessage=l})),O=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkBypass=e.getProxyUrl=void 0;function t(e){let t=e.protocol===`https:`;if(n(e))return;let r=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new i(r)}catch{if(!r.startsWith(`http://`)&&!r.startsWith(`https://`))return new i(`http://${r}`)}else return}e.getProxyUrl=t;function n(e){if(!e.hostname)return!1;let t=e.hostname;if(r(t))return!0;let n=process.env.no_proxy||process.env.NO_PROXY||``;if(!n)return!1;let i;e.port?i=Number(e.port):e.protocol===`http:`?i=80:e.protocol===`https:`&&(i=443);let a=[e.hostname.toUpperCase()];typeof i==`number`&&a.push(`${a[0]}:${i}`);for(let e of n.split(`,`).map(e=>e.trim().toUpperCase()).filter(e=>e))if(e===`*`||a.some(t=>t===e||t.endsWith(`.${e}`)||e.startsWith(`.`)&&t.endsWith(`${e}`)))return!0;return!1}e.checkBypass=n;function r(e){let t=e.toLowerCase();return t===`localhost`||t.startsWith(`127.`)||t.startsWith(`[::1]`)||t.startsWith(`[0:0:0:0:0:0:0:1]`)}var i=class extends URL{constructor(e,t){super(e,t),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}})),k=b((e=>{w(`net`);var t=w(`tls`),n=w(`http`),r=w(`https`),i=w(`events`);w(`assert`);var a=w(`util`);e.httpOverHttp=o,e.httpsOverHttp=s,e.httpOverHttps=c,e.httpsOverHttps=l;function o(e){var t=new u(e);return t.request=n.request,t}function s(e){var t=new u(e);return t.request=n.request,t.createSocket=d,t.defaultPort=443,t}function c(e){var t=new u(e);return t.request=r.request,t}function l(e){var t=new u(e);return t.request=r.request,t.createSocket=d,t.defaultPort=443,t}function u(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||n.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on(`free`,function(e,n,r,i){for(var a=f(n,r,i),o=0,s=t.requests.length;o=this.maxSockets){i.requests.push(a);return}i.createSocket(a,function(t){t.on(`free`,n),t.on(`close`,r),t.on(`agentRemove`,r),e.onSocket(t);function n(){i.emit(`free`,t,a)}function r(e){i.removeSocket(t),t.removeListener(`free`,n),t.removeListener(`close`,r),t.removeListener(`agentRemove`,r)}})},u.prototype.createSocket=function(e,t){var n=this,r={};n.sockets.push(r);var i=p({},n.proxyOptions,{method:`CONNECT`,path:e.host+`:`+e.port,agent:!1,headers:{host:e.host+`:`+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers[`Proxy-Authorization`]=`Basic `+new Buffer(i.proxyAuth).toString(`base64`)),m(`making CONNECT request`);var a=n.request(i);a.useChunkedEncodingByDefault=!1,a.once(`response`,o),a.once(`upgrade`,s),a.once(`connect`,c),a.once(`error`,l),a.end();function o(e){e.upgrade=!0}function s(e,t,n){process.nextTick(function(){c(e,t,n)})}function c(i,o,s){if(a.removeAllListeners(),o.removeAllListeners(),i.statusCode!==200){m(`tunneling socket could not be established, statusCode=%d`,i.statusCode),o.destroy();var c=Error(`tunneling socket could not be established, statusCode=`+i.statusCode);c.code=`ECONNRESET`,e.request.emit(`error`,c),n.removeSocket(r);return}if(s.length>0){m(`got illegal response body from proxy`),o.destroy();var c=Error(`got illegal response body from proxy`);c.code=`ECONNRESET`,e.request.emit(`error`,c),n.removeSocket(r);return}return m(`tunneling connection has established`),n.sockets[n.sockets.indexOf(r)]=o,t(o)}function l(t){a.removeAllListeners(),m(`tunneling socket could not be established, cause=%s -`,t.message,t.stack);var i=Error(`tunneling socket could not be established, cause=`+t.message);i.code=`ECONNRESET`,e.request.emit(`error`,i),n.removeSocket(r)}},u.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(t!==-1){this.sockets.splice(t,1);var n=this.requests.shift();n&&this.createSocket(n,function(e){n.request.onSocket(e)})}};function d(e,n){var r=this;u.prototype.createSocket.call(r,e,function(i){var a=e.request.getHeader(`host`),o=p({},r.options,{socket:i,servername:a?a.replace(/:.*$/,``):e.host}),s=t.connect(0,o);r.sockets[r.sockets.indexOf(i)]=s,n(s)})}function f(e,t,n){return typeof e==`string`?{host:e,port:t,localAddress:n}:e}function p(e){for(var t=1,n=arguments.length;t{t.exports=k()})),j=b(((e,t)=>{t.exports={kClose:Symbol(`close`),kDestroy:Symbol(`destroy`),kDispatch:Symbol(`dispatch`),kUrl:Symbol(`url`),kWriting:Symbol(`writing`),kResuming:Symbol(`resuming`),kQueue:Symbol(`queue`),kConnect:Symbol(`connect`),kConnecting:Symbol(`connecting`),kHeadersList:Symbol(`headers list`),kKeepAliveDefaultTimeout:Symbol(`default keep alive timeout`),kKeepAliveMaxTimeout:Symbol(`max keep alive timeout`),kKeepAliveTimeoutThreshold:Symbol(`keep alive timeout threshold`),kKeepAliveTimeoutValue:Symbol(`keep alive timeout`),kKeepAlive:Symbol(`keep alive`),kHeadersTimeout:Symbol(`headers timeout`),kBodyTimeout:Symbol(`body timeout`),kServerName:Symbol(`server name`),kLocalAddress:Symbol(`local address`),kHost:Symbol(`host`),kNoRef:Symbol(`no ref`),kBodyUsed:Symbol(`used`),kRunning:Symbol(`running`),kBlocking:Symbol(`blocking`),kPending:Symbol(`pending`),kSize:Symbol(`size`),kBusy:Symbol(`busy`),kQueued:Symbol(`queued`),kFree:Symbol(`free`),kConnected:Symbol(`connected`),kClosed:Symbol(`closed`),kNeedDrain:Symbol(`need drain`),kReset:Symbol(`reset`),kDestroyed:Symbol.for(`nodejs.stream.destroyed`),kMaxHeadersSize:Symbol(`max headers size`),kRunningIdx:Symbol(`running index`),kPendingIdx:Symbol(`pending index`),kError:Symbol(`error`),kClients:Symbol(`clients`),kClient:Symbol(`client`),kParser:Symbol(`parser`),kOnDestroyed:Symbol(`destroy callbacks`),kPipelining:Symbol(`pipelining`),kSocket:Symbol(`socket`),kHostHeader:Symbol(`host header`),kConnector:Symbol(`connector`),kStrictContentLength:Symbol(`strict content length`),kMaxRedirections:Symbol(`maxRedirections`),kMaxRequests:Symbol(`maxRequestsPerClient`),kProxy:Symbol(`proxy agent options`),kCounter:Symbol(`socket request counter`),kInterceptors:Symbol(`dispatch interceptors`),kMaxResponseSize:Symbol(`max response size`),kHTTP2Session:Symbol(`http2Session`),kHTTP2SessionState:Symbol(`http2Session state`),kHTTP2BuildRequest:Symbol(`http2 build request`),kHTTP1BuildRequest:Symbol(`http1 build request`),kHTTP2CopyHeaders:Symbol(`http2 copy headers`),kHTTPConnVersion:Symbol(`http connection version`),kRetryHandlerDefaultRetry:Symbol(`retry agent default retry`),kConstruct:Symbol(`constructable`)}})),M=b(((e,t)=>{var n=class extends Error{constructor(e){super(e),this.name=`UndiciError`,this.code=`UND_ERR`}},r=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ConnectTimeoutError`,this.message=t||`Connect Timeout Error`,this.code=`UND_ERR_CONNECT_TIMEOUT`}},i=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`HeadersTimeoutError`,this.message=t||`Headers Timeout Error`,this.code=`UND_ERR_HEADERS_TIMEOUT`}},a=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`HeadersOverflowError`,this.message=t||`Headers Overflow Error`,this.code=`UND_ERR_HEADERS_OVERFLOW`}},o=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`BodyTimeoutError`,this.message=t||`Body Timeout Error`,this.code=`UND_ERR_BODY_TIMEOUT`}},s=class e extends n{constructor(t,n,r,i){super(t),Error.captureStackTrace(this,e),this.name=`ResponseStatusCodeError`,this.message=t||`Response Status Code Error`,this.code=`UND_ERR_RESPONSE_STATUS_CODE`,this.body=i,this.status=n,this.statusCode=n,this.headers=r}},c=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`InvalidArgumentError`,this.message=t||`Invalid Argument Error`,this.code=`UND_ERR_INVALID_ARG`}},l=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`InvalidReturnValueError`,this.message=t||`Invalid Return Value Error`,this.code=`UND_ERR_INVALID_RETURN_VALUE`}},u=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`AbortError`,this.message=t||`Request aborted`,this.code=`UND_ERR_ABORTED`}},d=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`InformationalError`,this.message=t||`Request information`,this.code=`UND_ERR_INFO`}},f=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`RequestContentLengthMismatchError`,this.message=t||`Request body length does not match content-length header`,this.code=`UND_ERR_REQ_CONTENT_LENGTH_MISMATCH`}},p=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ResponseContentLengthMismatchError`,this.message=t||`Response body length does not match content-length header`,this.code=`UND_ERR_RES_CONTENT_LENGTH_MISMATCH`}},m=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ClientDestroyedError`,this.message=t||`The client is destroyed`,this.code=`UND_ERR_DESTROYED`}},h=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ClientClosedError`,this.message=t||`The client is closed`,this.code=`UND_ERR_CLOSED`}},g=class e extends n{constructor(t,n){super(t),Error.captureStackTrace(this,e),this.name=`SocketError`,this.message=t||`Socket error`,this.code=`UND_ERR_SOCKET`,this.socket=n}},_=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`NotSupportedError`,this.message=t||`Not supported error`,this.code=`UND_ERR_NOT_SUPPORTED`}},v=class extends n{constructor(e){super(e),Error.captureStackTrace(this,_),this.name=`MissingUpstreamError`,this.message=e||`No upstream has been added to the BalancedPool`,this.code=`UND_ERR_BPL_MISSING_UPSTREAM`}};t.exports={HTTPParserError:class e extends Error{constructor(t,n,r){super(t),Error.captureStackTrace(this,e),this.name=`HTTPParserError`,this.code=n?`HPE_${n}`:void 0,this.data=r?r.toString():void 0}},UndiciError:n,HeadersTimeoutError:i,HeadersOverflowError:a,BodyTimeoutError:o,RequestContentLengthMismatchError:f,ConnectTimeoutError:r,ResponseStatusCodeError:s,InvalidArgumentError:c,InvalidReturnValueError:l,RequestAbortedError:u,ClientDestroyedError:m,ClientClosedError:h,InformationalError:d,SocketError:g,NotSupportedError:_,ResponseContentLengthMismatchError:p,BalancedPoolMissingUpstreamError:v,ResponseExceededMaxSizeError:class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ResponseExceededMaxSizeError`,this.message=t||`Response content exceeded max size`,this.code=`UND_ERR_RES_EXCEEDED_MAX_SIZE`}},RequestRetryError:class e extends n{constructor(t,n,{headers:r,data:i}){super(t),Error.captureStackTrace(this,e),this.name=`RequestRetryError`,this.message=t||`Request retry error`,this.code=`UND_ERR_REQ_RETRY`,this.statusCode=n,this.data=i,this.headers=r}}}})),N=b(((e,t)=>{let n={},r=`Accept.Accept-Encoding.Accept-Language.Accept-Ranges.Access-Control-Allow-Credentials.Access-Control-Allow-Headers.Access-Control-Allow-Methods.Access-Control-Allow-Origin.Access-Control-Expose-Headers.Access-Control-Max-Age.Access-Control-Request-Headers.Access-Control-Request-Method.Age.Allow.Alt-Svc.Alt-Used.Authorization.Cache-Control.Clear-Site-Data.Connection.Content-Disposition.Content-Encoding.Content-Language.Content-Length.Content-Location.Content-Range.Content-Security-Policy.Content-Security-Policy-Report-Only.Content-Type.Cookie.Cross-Origin-Embedder-Policy.Cross-Origin-Opener-Policy.Cross-Origin-Resource-Policy.Date.Device-Memory.Downlink.ECT.ETag.Expect.Expect-CT.Expires.Forwarded.From.Host.If-Match.If-Modified-Since.If-None-Match.If-Range.If-Unmodified-Since.Keep-Alive.Last-Modified.Link.Location.Max-Forwards.Origin.Permissions-Policy.Pragma.Proxy-Authenticate.Proxy-Authorization.RTT.Range.Referer.Referrer-Policy.Refresh.Retry-After.Sec-WebSocket-Accept.Sec-WebSocket-Extensions.Sec-WebSocket-Key.Sec-WebSocket-Protocol.Sec-WebSocket-Version.Server.Server-Timing.Service-Worker-Allowed.Service-Worker-Navigation-Preload.Set-Cookie.SourceMap.Strict-Transport-Security.Supports-Loading-Mode.TE.Timing-Allow-Origin.Trailer.Transfer-Encoding.Upgrade.Upgrade-Insecure-Requests.User-Agent.Vary.Via.WWW-Authenticate.X-Content-Type-Options.X-DNS-Prefetch-Control.X-Frame-Options.X-Permitted-Cross-Domain-Policies.X-Powered-By.X-Requested-With.X-XSS-Protection`.split(`.`);for(let e=0;e{let n=w(`assert`),{kDestroyed:r,kBodyUsed:i}=j(),{IncomingMessage:a}=w(`http`),o=w(`stream`),s=w(`net`),{InvalidArgumentError:c}=M(),{Blob:l}=w(`buffer`),u=w(`util`),{stringify:d}=w(`querystring`),{headerNameLowerCasedRecord:f}=N(),[p,m]=process.versions.node.split(`.`).map(e=>Number(e));function h(){}function g(e){return e&&typeof e==`object`&&typeof e.pipe==`function`&&typeof e.on==`function`}function _(e){return l&&e instanceof l||e&&typeof e==`object`&&(typeof e.stream==`function`||typeof e.arrayBuffer==`function`)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function v(e,t){if(e.includes(`?`)||e.includes(`#`))throw Error(`Query params cannot be passed when url already contains "?" or "#".`);let n=d(t);return n&&(e+=`?`+n),e}function y(e){if(typeof e==`string`){if(e=new URL(e),!/^https?:/.test(e.origin||e.protocol))throw new c("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e}if(!e||typeof e!=`object`)throw new c(`Invalid URL: The URL argument must be a non-null object.`);if(!/^https?:/.test(e.origin||e.protocol))throw new c("Invalid URL protocol: the URL must start with `http:` or `https:`.");if(!(e instanceof URL)){if(e.port!=null&&e.port!==``&&!Number.isFinite(parseInt(e.port)))throw new c(`Invalid URL: port must be a valid integer or a string representation of an integer.`);if(e.path!=null&&typeof e.path!=`string`)throw new c(`Invalid URL path: the path must be a string or null/undefined.`);if(e.pathname!=null&&typeof e.pathname!=`string`)throw new c(`Invalid URL pathname: the pathname must be a string or null/undefined.`);if(e.hostname!=null&&typeof e.hostname!=`string`)throw new c(`Invalid URL hostname: the hostname must be a string or null/undefined.`);if(e.origin!=null&&typeof e.origin!=`string`)throw new c(`Invalid URL origin: the origin must be a string or null/undefined.`);let t=e.port==null?e.protocol===`https:`?443:80:e.port,n=e.origin==null?`${e.protocol}//${e.hostname}:${t}`:e.origin,r=e.path==null?`${e.pathname||``}${e.search||``}`:e.path;n.endsWith(`/`)&&(n=n.substring(0,n.length-1)),r&&!r.startsWith(`/`)&&(r=`/${r}`),e=new URL(n+r)}return e}function b(e){if(e=y(e),e.pathname!==`/`||e.search||e.hash)throw new c(`invalid url`);return e}function x(e){if(e[0]===`[`){let t=e.indexOf(`]`);return n(t!==-1),e.substring(1,t)}let t=e.indexOf(`:`);return t===-1?e:e.substring(0,t)}function S(e){if(!e)return null;n.strictEqual(typeof e,`string`);let t=x(e);return s.isIP(t)?``:t}function C(e){return JSON.parse(JSON.stringify(e))}function T(e){return e!=null&&typeof e[Symbol.asyncIterator]==`function`}function E(e){return e!=null&&(typeof e[Symbol.iterator]==`function`||typeof e[Symbol.asyncIterator]==`function`)}function D(e){if(e==null)return 0;if(g(e)){let t=e._readableState;return t&&t.objectMode===!1&&t.ended===!0&&Number.isFinite(t.length)?t.length:null}else if(_(e))return e.size==null?null:e.size;else if(z(e))return e.byteLength;return null}function O(e){return!e||!!(e.destroyed||e[r])}function k(e){let t=e&&e._readableState;return O(e)&&t&&!t.endEmitted}function A(e,t){e==null||!g(e)||O(e)||(typeof e.destroy==`function`?(Object.getPrototypeOf(e).constructor===a&&(e.socket=null),e.destroy(t)):t&&process.nextTick((e,t)=>{e.emit(`error`,t)},e,t),e.destroyed!==!0&&(e[r]=!0))}let P=/timeout=(\d+)/;function F(e){let t=e.toString().match(P);return t?parseInt(t[1],10)*1e3:null}function I(e){return f[e]||e.toLowerCase()}function L(e,t={}){if(!Array.isArray(e))return e;for(let n=0;ne.toString(`utf8`)):t[r]=e[n+1].toString(`utf8`)}return`content-length`in t&&`content-disposition`in t&&(t[`content-disposition`]=Buffer.from(t[`content-disposition`]).toString(`latin1`)),t}function R(e){let t=[],n=!1,r=-1;for(let i=0;i{e.close()});else{let t=Buffer.isBuffer(r)?r:Buffer.from(r);e.enqueue(new Uint8Array(t))}return e.desiredSize>0},async cancel(e){await t.return()}},0)}function G(e){return e&&typeof e==`object`&&typeof e.append==`function`&&typeof e.delete==`function`&&typeof e.get==`function`&&typeof e.getAll==`function`&&typeof e.has==`function`&&typeof e.set==`function`&&e[Symbol.toStringTag]===`FormData`}function K(e){if(e){if(typeof e.throwIfAborted==`function`)e.throwIfAborted();else if(e.aborted){let e=Error(`The operation was aborted`);throw e.name=`AbortError`,e}}}function re(e,t){return`addEventListener`in e?(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)):(e.addListener(`abort`,t),()=>e.removeListener(`abort`,t))}let q=!!String.prototype.toWellFormed;function J(e){return q?`${e}`.toWellFormed():u.toUSVString?u.toUSVString(e):`${e}`}function ie(e){if(e==null||e===``)return{start:0,end:null,size:null};let t=e?e.match(/^bytes (\d+)-(\d+)\/(\d+)?$/):null;return t?{start:parseInt(t[1]),end:t[2]?parseInt(t[2]):null,size:t[3]?parseInt(t[3]):null}:null}let ae=Object.create(null);ae.enumerable=!0,t.exports={kEnumerableProperty:ae,nop:h,isDisturbed:V,isErrored:ee,isReadable:te,toUSVString:J,isReadableAborted:k,isBlobLike:_,parseOrigin:b,parseURL:y,getServerName:S,isStream:g,isIterable:E,isAsyncIterable:T,isDestroyed:O,headerNameToString:I,parseRawHeaders:R,parseHeaders:L,parseKeepAliveTimeout:F,destroy:A,bodyLength:D,deepClone:C,ReadableStreamFrom:W,isBuffer:z,validateHandler:B,getSocketInfo:ne,isFormDataLike:G,buildURL:v,throwIfAborted:K,addAbortListener:re,parseRangeHeader:ie,nodeMajor:p,nodeMinor:m,nodeHasAutoSelectFamily:p>18||p===18&&m>=13,safeHTTPMethods:[`GET`,`HEAD`,`OPTIONS`,`TRACE`]}})),F=b(((e,t)=>{let n=Date.now(),r,i=[];function a(){n=Date.now();let e=i.length,t=0;for(;t0&&n>=r.state&&(r.state=-1,r.callback(r.opaque)),r.state===-1?(r.state=-2,t===e-1?i.pop():i[t]=i.pop(),--e):t+=1}i.length>0&&o()}function o(){r&&r.refresh?r.refresh():(clearTimeout(r),r=setTimeout(a,1e3),r.unref&&r.unref())}var s=class{constructor(e,t,n){this.callback=e,this.delay=t,this.opaque=n,this.state=-2,this.refresh()}refresh(){this.state===-2&&(i.push(this),(!r||i.length===1)&&o()),this.state=0}clear(){this.state=-1}};t.exports={setTimeout(e,t,n){return t<1e3?setTimeout(e,t,n):new s(e,t,n)},clearTimeout(e){e instanceof s?e.clear():clearTimeout(e)}}})),I=b(((e,t)=>{let n=w(`node:events`).EventEmitter,r=w(`node:util`).inherits;function i(e){if(typeof e==`string`&&(e=Buffer.from(e)),!Buffer.isBuffer(e))throw TypeError(`The needle has to be a String or a Buffer.`);let t=e.length;if(t===0)throw Error(`The needle cannot be an empty String/Buffer.`);if(t>256)throw Error(`The needle cannot have a length bigger than 256.`);this.maxMatches=1/0,this.matches=0,this._occ=Array(256).fill(t),this._lookbehind_size=0,this._needle=e,this._bufpos=0,this._lookbehind=Buffer.alloc(t);for(var n=0;n=0)this.emit(`info`,!1,this._lookbehind,0,this._lookbehind_size),this._lookbehind_size=0;else{let n=this._lookbehind_size+a;return n>0&&this.emit(`info`,!1,this._lookbehind,0,n),this._lookbehind.copy(this._lookbehind,0,n,this._lookbehind_size-n),this._lookbehind_size-=n,e.copy(this._lookbehind,this._lookbehind_size),this._lookbehind_size+=t,this._bufpos=t,t}}if(a+=(a>=0)*this._bufpos,e.indexOf(n,a)!==-1)return a=e.indexOf(n,a),++this.matches,a>0?this.emit(`info`,!0,e,this._bufpos,a):this.emit(`info`,!0),this._bufpos=a+r;for(a=t-r;a0&&this.emit(`info`,!1,e,this._bufpos,a{let n=w(`node:util`).inherits,r=w(`node:stream`).Readable;function i(e){r.call(this,e)}n(i,r),i.prototype._read=function(e){},t.exports=i})),R=b(((e,t)=>{t.exports=function(e,t,n){if(!e||e[t]===void 0||e[t]===null)return n;if(typeof e[t]!=`number`||isNaN(e[t]))throw TypeError(`Limit `+t+` is not a valid number`);return e[t]}})),z=b(((e,t)=>{let n=w(`node:events`).EventEmitter,r=w(`node:util`).inherits,i=R(),a=I(),o=Buffer.from(`\r +`,t.message,t.stack);var i=Error(`tunneling socket could not be established, cause=`+t.message);i.code=`ECONNRESET`,e.request.emit(`error`,i),n.removeSocket(r)}},u.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(t!==-1){this.sockets.splice(t,1);var n=this.requests.shift();n&&this.createSocket(n,function(e){n.request.onSocket(e)})}};function d(e,n){var r=this;u.prototype.createSocket.call(r,e,function(i){var a=e.request.getHeader(`host`),o=p({},r.options,{socket:i,servername:a?a.replace(/:.*$/,``):e.host}),s=t.connect(0,o);r.sockets[r.sockets.indexOf(i)]=s,n(s)})}function f(e,t,n){return typeof e==`string`?{host:e,port:t,localAddress:n}:e}function p(e){for(var t=1,n=arguments.length;t{t.exports=k()})),j=b(((e,t)=>{t.exports={kClose:Symbol(`close`),kDestroy:Symbol(`destroy`),kDispatch:Symbol(`dispatch`),kUrl:Symbol(`url`),kWriting:Symbol(`writing`),kResuming:Symbol(`resuming`),kQueue:Symbol(`queue`),kConnect:Symbol(`connect`),kConnecting:Symbol(`connecting`),kHeadersList:Symbol(`headers list`),kKeepAliveDefaultTimeout:Symbol(`default keep alive timeout`),kKeepAliveMaxTimeout:Symbol(`max keep alive timeout`),kKeepAliveTimeoutThreshold:Symbol(`keep alive timeout threshold`),kKeepAliveTimeoutValue:Symbol(`keep alive timeout`),kKeepAlive:Symbol(`keep alive`),kHeadersTimeout:Symbol(`headers timeout`),kBodyTimeout:Symbol(`body timeout`),kServerName:Symbol(`server name`),kLocalAddress:Symbol(`local address`),kHost:Symbol(`host`),kNoRef:Symbol(`no ref`),kBodyUsed:Symbol(`used`),kRunning:Symbol(`running`),kBlocking:Symbol(`blocking`),kPending:Symbol(`pending`),kSize:Symbol(`size`),kBusy:Symbol(`busy`),kQueued:Symbol(`queued`),kFree:Symbol(`free`),kConnected:Symbol(`connected`),kClosed:Symbol(`closed`),kNeedDrain:Symbol(`need drain`),kReset:Symbol(`reset`),kDestroyed:Symbol.for(`nodejs.stream.destroyed`),kMaxHeadersSize:Symbol(`max headers size`),kRunningIdx:Symbol(`running index`),kPendingIdx:Symbol(`pending index`),kError:Symbol(`error`),kClients:Symbol(`clients`),kClient:Symbol(`client`),kParser:Symbol(`parser`),kOnDestroyed:Symbol(`destroy callbacks`),kPipelining:Symbol(`pipelining`),kSocket:Symbol(`socket`),kHostHeader:Symbol(`host header`),kConnector:Symbol(`connector`),kStrictContentLength:Symbol(`strict content length`),kMaxRedirections:Symbol(`maxRedirections`),kMaxRequests:Symbol(`maxRequestsPerClient`),kProxy:Symbol(`proxy agent options`),kCounter:Symbol(`socket request counter`),kInterceptors:Symbol(`dispatch interceptors`),kMaxResponseSize:Symbol(`max response size`),kHTTP2Session:Symbol(`http2Session`),kHTTP2SessionState:Symbol(`http2Session state`),kHTTP2BuildRequest:Symbol(`http2 build request`),kHTTP1BuildRequest:Symbol(`http1 build request`),kHTTP2CopyHeaders:Symbol(`http2 copy headers`),kHTTPConnVersion:Symbol(`http connection version`),kRetryHandlerDefaultRetry:Symbol(`retry agent default retry`),kConstruct:Symbol(`constructable`)}})),M=b(((e,t)=>{var n=class extends Error{constructor(e){super(e),this.name=`UndiciError`,this.code=`UND_ERR`}},r=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ConnectTimeoutError`,this.message=t||`Connect Timeout Error`,this.code=`UND_ERR_CONNECT_TIMEOUT`}},i=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`HeadersTimeoutError`,this.message=t||`Headers Timeout Error`,this.code=`UND_ERR_HEADERS_TIMEOUT`}},a=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`HeadersOverflowError`,this.message=t||`Headers Overflow Error`,this.code=`UND_ERR_HEADERS_OVERFLOW`}},o=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`BodyTimeoutError`,this.message=t||`Body Timeout Error`,this.code=`UND_ERR_BODY_TIMEOUT`}},s=class e extends n{constructor(t,n,r,i){super(t),Error.captureStackTrace(this,e),this.name=`ResponseStatusCodeError`,this.message=t||`Response Status Code Error`,this.code=`UND_ERR_RESPONSE_STATUS_CODE`,this.body=i,this.status=n,this.statusCode=n,this.headers=r}},c=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`InvalidArgumentError`,this.message=t||`Invalid Argument Error`,this.code=`UND_ERR_INVALID_ARG`}},l=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`InvalidReturnValueError`,this.message=t||`Invalid Return Value Error`,this.code=`UND_ERR_INVALID_RETURN_VALUE`}},u=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`AbortError`,this.message=t||`Request aborted`,this.code=`UND_ERR_ABORTED`}},d=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`InformationalError`,this.message=t||`Request information`,this.code=`UND_ERR_INFO`}},f=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`RequestContentLengthMismatchError`,this.message=t||`Request body length does not match content-length header`,this.code=`UND_ERR_REQ_CONTENT_LENGTH_MISMATCH`}},p=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ResponseContentLengthMismatchError`,this.message=t||`Response body length does not match content-length header`,this.code=`UND_ERR_RES_CONTENT_LENGTH_MISMATCH`}},m=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ClientDestroyedError`,this.message=t||`The client is destroyed`,this.code=`UND_ERR_DESTROYED`}},h=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ClientClosedError`,this.message=t||`The client is closed`,this.code=`UND_ERR_CLOSED`}},g=class e extends n{constructor(t,n){super(t),Error.captureStackTrace(this,e),this.name=`SocketError`,this.message=t||`Socket error`,this.code=`UND_ERR_SOCKET`,this.socket=n}},_=class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`NotSupportedError`,this.message=t||`Not supported error`,this.code=`UND_ERR_NOT_SUPPORTED`}};t.exports={HTTPParserError:class e extends Error{constructor(t,n,r){super(t),Error.captureStackTrace(this,e),this.name=`HTTPParserError`,this.code=n?`HPE_${n}`:void 0,this.data=r?r.toString():void 0}},UndiciError:n,HeadersTimeoutError:i,HeadersOverflowError:a,BodyTimeoutError:o,RequestContentLengthMismatchError:f,ConnectTimeoutError:r,ResponseStatusCodeError:s,InvalidArgumentError:c,InvalidReturnValueError:l,RequestAbortedError:u,ClientDestroyedError:m,ClientClosedError:h,InformationalError:d,SocketError:g,NotSupportedError:_,ResponseContentLengthMismatchError:p,BalancedPoolMissingUpstreamError:class extends n{constructor(e){super(e),Error.captureStackTrace(this,_),this.name=`MissingUpstreamError`,this.message=e||`No upstream has been added to the BalancedPool`,this.code=`UND_ERR_BPL_MISSING_UPSTREAM`}},ResponseExceededMaxSizeError:class e extends n{constructor(t){super(t),Error.captureStackTrace(this,e),this.name=`ResponseExceededMaxSizeError`,this.message=t||`Response content exceeded max size`,this.code=`UND_ERR_RES_EXCEEDED_MAX_SIZE`}},RequestRetryError:class e extends n{constructor(t,n,{headers:r,data:i}){super(t),Error.captureStackTrace(this,e),this.name=`RequestRetryError`,this.message=t||`Request retry error`,this.code=`UND_ERR_REQ_RETRY`,this.statusCode=n,this.data=i,this.headers=r}}}})),N=b(((e,t)=>{let n={},r=`Accept.Accept-Encoding.Accept-Language.Accept-Ranges.Access-Control-Allow-Credentials.Access-Control-Allow-Headers.Access-Control-Allow-Methods.Access-Control-Allow-Origin.Access-Control-Expose-Headers.Access-Control-Max-Age.Access-Control-Request-Headers.Access-Control-Request-Method.Age.Allow.Alt-Svc.Alt-Used.Authorization.Cache-Control.Clear-Site-Data.Connection.Content-Disposition.Content-Encoding.Content-Language.Content-Length.Content-Location.Content-Range.Content-Security-Policy.Content-Security-Policy-Report-Only.Content-Type.Cookie.Cross-Origin-Embedder-Policy.Cross-Origin-Opener-Policy.Cross-Origin-Resource-Policy.Date.Device-Memory.Downlink.ECT.ETag.Expect.Expect-CT.Expires.Forwarded.From.Host.If-Match.If-Modified-Since.If-None-Match.If-Range.If-Unmodified-Since.Keep-Alive.Last-Modified.Link.Location.Max-Forwards.Origin.Permissions-Policy.Pragma.Proxy-Authenticate.Proxy-Authorization.RTT.Range.Referer.Referrer-Policy.Refresh.Retry-After.Sec-WebSocket-Accept.Sec-WebSocket-Extensions.Sec-WebSocket-Key.Sec-WebSocket-Protocol.Sec-WebSocket-Version.Server.Server-Timing.Service-Worker-Allowed.Service-Worker-Navigation-Preload.Set-Cookie.SourceMap.Strict-Transport-Security.Supports-Loading-Mode.TE.Timing-Allow-Origin.Trailer.Transfer-Encoding.Upgrade.Upgrade-Insecure-Requests.User-Agent.Vary.Via.WWW-Authenticate.X-Content-Type-Options.X-DNS-Prefetch-Control.X-Frame-Options.X-Permitted-Cross-Domain-Policies.X-Powered-By.X-Requested-With.X-XSS-Protection`.split(`.`);for(let e=0;e{let n=w(`assert`),{kDestroyed:r,kBodyUsed:i}=j(),{IncomingMessage:a}=w(`http`),o=w(`stream`),s=w(`net`),{InvalidArgumentError:c}=M(),{Blob:l}=w(`buffer`),u=w(`util`),{stringify:d}=w(`querystring`),{headerNameLowerCasedRecord:f}=N(),[p,m]=process.versions.node.split(`.`).map(e=>Number(e));function h(){}function g(e){return e&&typeof e==`object`&&typeof e.pipe==`function`&&typeof e.on==`function`}function _(e){return l&&e instanceof l||e&&typeof e==`object`&&(typeof e.stream==`function`||typeof e.arrayBuffer==`function`)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function v(e,t){if(e.includes(`?`)||e.includes(`#`))throw Error(`Query params cannot be passed when url already contains "?" or "#".`);let n=d(t);return n&&(e+=`?`+n),e}function y(e){if(typeof e==`string`){if(e=new URL(e),!/^https?:/.test(e.origin||e.protocol))throw new c("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e}if(!e||typeof e!=`object`)throw new c(`Invalid URL: The URL argument must be a non-null object.`);if(!/^https?:/.test(e.origin||e.protocol))throw new c("Invalid URL protocol: the URL must start with `http:` or `https:`.");if(!(e instanceof URL)){if(e.port!=null&&e.port!==``&&!Number.isFinite(parseInt(e.port)))throw new c(`Invalid URL: port must be a valid integer or a string representation of an integer.`);if(e.path!=null&&typeof e.path!=`string`)throw new c(`Invalid URL path: the path must be a string or null/undefined.`);if(e.pathname!=null&&typeof e.pathname!=`string`)throw new c(`Invalid URL pathname: the pathname must be a string or null/undefined.`);if(e.hostname!=null&&typeof e.hostname!=`string`)throw new c(`Invalid URL hostname: the hostname must be a string or null/undefined.`);if(e.origin!=null&&typeof e.origin!=`string`)throw new c(`Invalid URL origin: the origin must be a string or null/undefined.`);let t=e.port==null?e.protocol===`https:`?443:80:e.port,n=e.origin==null?`${e.protocol}//${e.hostname}:${t}`:e.origin,r=e.path==null?`${e.pathname||``}${e.search||``}`:e.path;n.endsWith(`/`)&&(n=n.substring(0,n.length-1)),r&&!r.startsWith(`/`)&&(r=`/${r}`),e=new URL(n+r)}return e}function b(e){if(e=y(e),e.pathname!==`/`||e.search||e.hash)throw new c(`invalid url`);return e}function x(e){if(e[0]===`[`){let t=e.indexOf(`]`);return n(t!==-1),e.substring(1,t)}let t=e.indexOf(`:`);return t===-1?e:e.substring(0,t)}function S(e){if(!e)return null;n.strictEqual(typeof e,`string`);let t=x(e);return s.isIP(t)?``:t}function C(e){return JSON.parse(JSON.stringify(e))}function T(e){return e!=null&&typeof e[Symbol.asyncIterator]==`function`}function E(e){return e!=null&&(typeof e[Symbol.iterator]==`function`||typeof e[Symbol.asyncIterator]==`function`)}function D(e){if(e==null)return 0;if(g(e)){let t=e._readableState;return t&&t.objectMode===!1&&t.ended===!0&&Number.isFinite(t.length)?t.length:null}else if(_(e))return e.size==null?null:e.size;else if(z(e))return e.byteLength;return null}function O(e){return!e||!!(e.destroyed||e[r])}function k(e){let t=e&&e._readableState;return O(e)&&t&&!t.endEmitted}function A(e,t){e==null||!g(e)||O(e)||(typeof e.destroy==`function`?(Object.getPrototypeOf(e).constructor===a&&(e.socket=null),e.destroy(t)):t&&process.nextTick((e,t)=>{e.emit(`error`,t)},e,t),e.destroyed!==!0&&(e[r]=!0))}let P=/timeout=(\d+)/;function F(e){let t=e.toString().match(P);return t?parseInt(t[1],10)*1e3:null}function I(e){return f[e]||e.toLowerCase()}function L(e,t={}){if(!Array.isArray(e))return e;for(let n=0;ne.toString(`utf8`)):t[r]=e[n+1].toString(`utf8`)}return`content-length`in t&&`content-disposition`in t&&(t[`content-disposition`]=Buffer.from(t[`content-disposition`]).toString(`latin1`)),t}function R(e){let t=[],n=!1,r=-1;for(let i=0;i{e.close()});else{let t=Buffer.isBuffer(r)?r:Buffer.from(r);e.enqueue(new Uint8Array(t))}return e.desiredSize>0},async cancel(e){await t.return()}},0)}function G(e){return e&&typeof e==`object`&&typeof e.append==`function`&&typeof e.delete==`function`&&typeof e.get==`function`&&typeof e.getAll==`function`&&typeof e.has==`function`&&typeof e.set==`function`&&e[Symbol.toStringTag]===`FormData`}function K(e){if(e){if(typeof e.throwIfAborted==`function`)e.throwIfAborted();else if(e.aborted){let e=Error(`The operation was aborted`);throw e.name=`AbortError`,e}}}function re(e,t){return`addEventListener`in e?(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)):(e.addListener(`abort`,t),()=>e.removeListener(`abort`,t))}let q=!!String.prototype.toWellFormed;function J(e){return q?`${e}`.toWellFormed():u.toUSVString?u.toUSVString(e):`${e}`}function ie(e){if(e==null||e===``)return{start:0,end:null,size:null};let t=e?e.match(/^bytes (\d+)-(\d+)\/(\d+)?$/):null;return t?{start:parseInt(t[1]),end:t[2]?parseInt(t[2]):null,size:t[3]?parseInt(t[3]):null}:null}let ae=Object.create(null);ae.enumerable=!0,t.exports={kEnumerableProperty:ae,nop:h,isDisturbed:V,isErrored:ee,isReadable:te,toUSVString:J,isReadableAborted:k,isBlobLike:_,parseOrigin:b,parseURL:y,getServerName:S,isStream:g,isIterable:E,isAsyncIterable:T,isDestroyed:O,headerNameToString:I,parseRawHeaders:R,parseHeaders:L,parseKeepAliveTimeout:F,destroy:A,bodyLength:D,deepClone:C,ReadableStreamFrom:W,isBuffer:z,validateHandler:B,getSocketInfo:ne,isFormDataLike:G,buildURL:v,throwIfAborted:K,addAbortListener:re,parseRangeHeader:ie,nodeMajor:p,nodeMinor:m,nodeHasAutoSelectFamily:p>18||p===18&&m>=13,safeHTTPMethods:[`GET`,`HEAD`,`OPTIONS`,`TRACE`]}})),F=b(((e,t)=>{let n=Date.now(),r,i=[];function a(){n=Date.now();let e=i.length,t=0;for(;t0&&n>=r.state&&(r.state=-1,r.callback(r.opaque)),r.state===-1?(r.state=-2,t===e-1?i.pop():i[t]=i.pop(),--e):t+=1}i.length>0&&o()}function o(){r&&r.refresh?r.refresh():(clearTimeout(r),r=setTimeout(a,1e3),r.unref&&r.unref())}var s=class{constructor(e,t,n){this.callback=e,this.delay=t,this.opaque=n,this.state=-2,this.refresh()}refresh(){this.state===-2&&(i.push(this),(!r||i.length===1)&&o()),this.state=0}clear(){this.state=-1}};t.exports={setTimeout(e,t,n){return t<1e3?setTimeout(e,t,n):new s(e,t,n)},clearTimeout(e){e instanceof s?e.clear():clearTimeout(e)}}})),I=b(((e,t)=>{let n=w(`node:events`).EventEmitter,r=w(`node:util`).inherits;function i(e){if(typeof e==`string`&&(e=Buffer.from(e)),!Buffer.isBuffer(e))throw TypeError(`The needle has to be a String or a Buffer.`);let t=e.length;if(t===0)throw Error(`The needle cannot be an empty String/Buffer.`);if(t>256)throw Error(`The needle cannot have a length bigger than 256.`);this.maxMatches=1/0,this.matches=0,this._occ=Array(256).fill(t),this._lookbehind_size=0,this._needle=e,this._bufpos=0,this._lookbehind=Buffer.alloc(t);for(var n=0;n=0)this.emit(`info`,!1,this._lookbehind,0,this._lookbehind_size),this._lookbehind_size=0;else{let n=this._lookbehind_size+a;return n>0&&this.emit(`info`,!1,this._lookbehind,0,n),this._lookbehind.copy(this._lookbehind,0,n,this._lookbehind_size-n),this._lookbehind_size-=n,e.copy(this._lookbehind,this._lookbehind_size),this._lookbehind_size+=t,this._bufpos=t,t}}if(a+=(a>=0)*this._bufpos,e.indexOf(n,a)!==-1)return a=e.indexOf(n,a),++this.matches,a>0?this.emit(`info`,!0,e,this._bufpos,a):this.emit(`info`,!0),this._bufpos=a+r;for(a=t-r;a0&&this.emit(`info`,!1,e,this._bufpos,a{let n=w(`node:util`).inherits,r=w(`node:stream`).Readable;function i(e){r.call(this,e)}n(i,r),i.prototype._read=function(e){},t.exports=i})),R=b(((e,t)=>{t.exports=function(e,t,n){if(!e||e[t]===void 0||e[t]===null)return n;if(typeof e[t]!=`number`||isNaN(e[t]))throw TypeError(`Limit `+t+` is not a valid number`);return e[t]}})),z=b(((e,t)=>{let n=w(`node:events`).EventEmitter,r=w(`node:util`).inherits,i=R(),a=I(),o=Buffer.from(`\r \r `),s=/\r\n/g,c=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function l(e){n.call(this),e||={};let t=this;this.nread=0,this.maxed=!1,this.npairs=0,this.maxHeaderPairs=i(e,`maxHeaderPairs`,2e3),this.maxHeaderSize=i(e,`maxHeaderSize`,80*1024),this.buffer=``,this.header={},this.finished=!1,this.ss=new a(o),this.ss.on(`info`,function(e,n,r,i){n&&!t.maxed&&(t.nread+i-r>=t.maxHeaderSize?(i=t.maxHeaderSize-t.nread+r,t.nread=t.maxHeaderSize,t.maxed=!0):t.nread+=i-r,t.buffer+=n.toString(`binary`,r,i)),e&&t._finish()})}r(l,n),l.prototype.push=function(e){let t=this.ss.push(e);if(this.finished)return t},l.prototype.reset=function(){this.finished=!1,this.buffer=``,this.header={},this.ss.reset()},l.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let e=this.header;this.header={},this.buffer=``,this.finished=!0,this.nread=this.npairs=0,this.maxed=!1,this.emit(`header`,e)},l.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let e=this.buffer.split(s),t=e.length,n,r;for(var i=0;i{let n=w(`node:stream`).Writable,r=w(`node:util`).inherits,i=I(),a=L(),o=z(),s=Buffer.from(`-`),c=Buffer.from(`\r `),l=function(){};function u(e){if(!(this instanceof u))return new u(e);if(n.call(this,e),!e||!e.headerFirst&&typeof e.boundary!=`string`)throw TypeError(`Boundary required`);typeof e.boundary==`string`?this.setBoundary(e.boundary):this._bparser=void 0,this._headerFirst=e.headerFirst,this._dashes=0,this._parts=0,this._finished=!1,this._realFinish=!1,this._isPreamble=!0,this._justMatched=!1,this._firstWrite=!0,this._inHeader=!0,this._part=void 0,this._cb=void 0,this._ignoreData=!1,this._partOpts={highWaterMark:e.partHwm},this._pause=!1;let t=this;this._hparser=new o(e),this._hparser.on(`header`,function(e){t._inHeader=!1,t._part.emit(`header`,e)})}r(u,n),u.prototype.emit=function(e){if(e===`finish`&&!this._realFinish){if(!this._finished){let e=this;process.nextTick(function(){if(e.emit(`error`,Error(`Unexpected end of multipart data`)),e._part&&!e._ignoreData){let t=e._isPreamble?`Preamble`:`Part`;e._part.emit(`error`,Error(t+` terminated early due to unexpected end of multipart data`)),e._part.push(null),process.nextTick(function(){e._realFinish=!0,e.emit(`finish`),e._realFinish=!1});return}e._realFinish=!0,e.emit(`finish`),e._realFinish=!1})}}else n.prototype.emit.apply(this,arguments)},u.prototype._write=function(e,t,n){if(!this._hparser&&!this._bparser)return n();if(this._headerFirst&&this._isPreamble){this._part||(this._part=new a(this._partOpts),this.listenerCount(`preamble`)===0?this._ignore():this.emit(`preamble`,this._part));let t=this._hparser.push(e);if(!this._inHeader&&t!==void 0&&t{let{kProxy:n,kClose:r,kDestroy:i,kInterceptors:a}=j(),{URL:o}=w(`url`),s=Te(),c=Se(),l=ue(),{InvalidArgumentError:u,RequestAbortedError:d}=M(),f=de(),p=Symbol(`proxy agent`),m=Symbol(`proxy client`),h=Symbol(`proxy headers`),g=Symbol(`request tls settings`),_=Symbol(`proxy tls settings`),v=Symbol(`connect endpoint function`);function y(e){return e===`https:`?443:80}function b(e){if(typeof e==`string`&&(e={uri:e}),!e||!e.uri)throw new u(`Proxy opts.uri is mandatory`);return{uri:e.uri,protocol:e.protocol||`https`}}function x(e,t){return new c(e,t)}var S=class extends l{constructor(e){if(super(e),this[n]=b(e),this[p]=new s(e),this[a]=e.interceptors&&e.interceptors.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],typeof e==`string`&&(e={uri:e}),!e||!e.uri)throw new u(`Proxy opts.uri is mandatory`);let{clientFactory:t=x}=e;if(typeof t!=`function`)throw new u(`Proxy opts.clientFactory must be a function.`);this[g]=e.requestTls,this[_]=e.proxyTls,this[h]=e.headers||{};let r=new o(e.uri),{origin:i,port:c,host:l,username:S,password:C}=r;if(e.auth&&e.token)throw new u(`opts.auth cannot be used in combination with opts.token`);e.auth?this[h][`proxy-authorization`]=`Basic ${e.auth}`:e.token?this[h][`proxy-authorization`]=e.token:S&&C&&(this[h][`proxy-authorization`]=`Basic ${Buffer.from(`${decodeURIComponent(S)}:${decodeURIComponent(C)}`).toString(`base64`)}`);let w=f({...e.proxyTls});this[v]=f({...e.requestTls}),this[m]=t(r,{connect:w}),this[p]=new s({...e,connect:async(e,t)=>{let n=e.host;e.port||(n+=`:${y(e.protocol)}`);try{let{socket:r,statusCode:a}=await this[m].connect({origin:i,port:c,path:n,signal:e.signal,headers:{...this[h],host:l}});if(a!==200&&(r.on(`error`,()=>{}).destroy(),t(new d(`Proxy response (${a}) !== 200 when HTTP Tunneling`))),e.protocol!==`https:`){t(null,r);return}let o;o=this[g]?this[g].servername:e.servername,this[v]({...e,servername:o,httpSocket:r},t)}catch(e){t(e)}}})}dispatch(e,t){let{host:n}=new o(e.origin),r=C(e.headers);return T(r),this[p].dispatch({...e,headers:{...r,host:n}},t)}async[r](){await this[p].close(),await this[m].close()}async[i](){await this[p].destroy(),await this[m].destroy()}};function C(e){if(Array.isArray(e)){let t={};for(let n=0;ne.toLowerCase()===`proxy-authorization`))throw new u(`Proxy-Authorization should be sent in ProxyAgent constructor`)}t.exports=S})),Ge=b(((e,t)=>{let n=w(`assert`),{kRetryHandlerDefaultRetry:r}=j(),{RequestRetryError:i}=M(),{isDisturbed:a,parseHeaders:o,parseRangeHeader:s}=P();function c(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:c,minTimeout:l,timeoutFactor:u,methods:d,errorCodes:f,retryAfter:p,statusCodes:m}=i??{};this.dispatch=n.dispatch,this.handler=n.handler,this.opts=a,this.abort=null,this.aborted=!1,this.retryOpts={retry:o??e[r],retryAfter:p??!0,maxTimeout:c??30*1e3,timeout:l??500,timeoutFactor:u??2,maxRetries:s??5,methods:d??[`GET`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`TRACE`],statusCodes:m??[500,502,503,504,429],errorCodes:f??[`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`]},this.retryCount=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:l}=n,{maxRetries:u,timeout:d,maxTimeout:f,timeoutFactor:p,statusCodes:m,errorCodes:h,methods:g}=l,{counter:_,currentTimeout:v}=t;if(v=v!=null&&v>0?v:d,a&&a!==`UND_ERR_REQ_RETRY`&&a!==`UND_ERR_SOCKET`&&!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 y=o!=null&&o[`retry-after`];y&&=(y=Number(y),isNaN(y)?c(y):y*1e3);let b=y>0?Math.min(y,f):Math.min(v*p**_,f);t.currentTimeout=b,setTimeout(()=>r(null),b)}onHeaders(e,t,r,a){let c=o(t);if(this.retryCount+=1,e>=300)return this.abort(new i(`Request failed`,e,{headers:c,count:this.retryCount})),!1;if(this.resume!=null){if(this.resume=null,e!==206)return!0;let t=s(c[`content-range`]);if(!t)return this.abort(new i(`Content-Range mismatch`,e,{headers:c,count:this.retryCount})),!1;if(this.etag!=null&&this.etag!==c.etag)return this.abort(new i(`ETag mismatch`,e,{headers:c,count:this.retryCount})),!1;let{start:a,size:o,end:l=o}=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}=i;n(o!=null&&Number.isFinite(o)&&this.start!==o,`content-range mismatch`),n(Number.isFinite(o)),n(u!=null&&Number.isFinite(u)&&this.end!==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)}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.handler.onHeaders(e,t,r,a)}let l=new i(`Request failed`,e,{headers:c,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.retryOpts.retry(e,{state:{counter:this.retryCount++,currentTimeout:this.retryAfter},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);this.start!==0&&(this.opts={...this.opts,headers:{...this.opts.headers,range:`bytes=${this.start}-${this.end??``}`}});try{this.dispatch(this.opts,this)}catch(e){this.handler.onError(e)}}}}})),Ke=b(((e,t)=>{let n=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:r}=M(),i=Te();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}})),qe=b(((e,t)=>{t.exports=class{constructor(e){this.handler=e}onConnect(...e){return this.handler.onConnect(...e)}onError(...e){return this.handler.onError(...e)}onUpgrade(...e){return this.handler.onUpgrade(...e)}onHeaders(...e){return this.handler.onHeaders(...e)}onData(...e){return this.handler.onData(...e)}onComplete(...e){return this.handler.onComplete(...e)}onBodySent(...e){return this.handler.onBodySent(...e)}}})),Je=b(((e,t)=>{let{kHeadersList:n,kConstruct:r}=j(),{kGuard:i}=q(),{kEnumerableProperty:a}=P(),{makeIterator:o,isValidHeaderName:s,isValidHeaderValue:c}=re(),l=w(`util`),{webidl:u}=J(),d=w(`assert`),f=Symbol(`headers map`),p=Symbol(`headers map sorted`);function m(e){return e===10||e===13||e===9||e===32}function h(e){let t=0,n=e.length;for(;n>t&&m(e.charCodeAt(n-1));)--n;for(;n>t&&m(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function g(e,t){if(Array.isArray(t))for(let n=0;n>`,`record`]})}function _(e,t,r){if(r=h(r),!s(t))throw u.errors.invalidArgument({prefix:`Headers.append`,value:t,type:`header name`});if(!c(r))throw u.errors.invalidArgument({prefix:`Headers.append`,value:r,type:`header value`});if(e[i]===`immutable`)throw TypeError(`immutable`);return e[i],e[n].append(t,r)}var v=class e{cookies=null;constructor(t){t instanceof e?(this[f]=new Map(t[f]),this[p]=t[p],this.cookies=t.cookies===null?null:[...t.cookies]):(this[f]=new Map(t),this[p]=null)}contains(e){return e=e.toLowerCase(),this[f].has(e)}clear(){this[f].clear(),this[p]=null,this.cookies=null}append(e,t){this[p]=null;let n=e.toLowerCase(),r=this[f].get(n);if(r){let e=n===`cookie`?`; `:`, `;this[f].set(n,{name:r.name,value:`${r.value}${e}${t}`})}else this[f].set(n,{name:e,value:t});n===`set-cookie`&&(this.cookies??=[],this.cookies.push(t))}set(e,t){this[p]=null;let n=e.toLowerCase();n===`set-cookie`&&(this.cookies=[t]),this[f].set(n,{name:e,value:t})}delete(e){this[p]=null,e=e.toLowerCase(),e===`set-cookie`&&(this.cookies=null),this[f].delete(e)}get(e){let t=this[f].get(e.toLowerCase());return t===void 0?null:t.value}*[Symbol.iterator](){for(let[e,{value:t}]of this[f])yield[e,t]}get entries(){let e={};if(this[f].size)for(let{name:t,value:n}of this[f].values())e[t]=n;return e}},y=class e{constructor(e=void 0){e!==r&&(this[n]=new v,this[i]=`none`,e!==void 0&&(e=u.converters.HeadersInit(e),g(this,e)))}append(t,n){return u.brandCheck(this,e),u.argumentLengthCheck(arguments,2,{header:`Headers.append`}),t=u.converters.ByteString(t),n=u.converters.ByteString(n),_(this,t,n)}delete(t){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`Headers.delete`}),t=u.converters.ByteString(t),!s(t))throw u.errors.invalidArgument({prefix:`Headers.delete`,value:t,type:`header name`});if(this[i]===`immutable`)throw TypeError(`immutable`);this[i],this[n].contains(t)&&this[n].delete(t)}get(t){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`Headers.get`}),t=u.converters.ByteString(t),!s(t))throw u.errors.invalidArgument({prefix:`Headers.get`,value:t,type:`header name`});return this[n].get(t)}has(t){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`Headers.has`}),t=u.converters.ByteString(t),!s(t))throw u.errors.invalidArgument({prefix:`Headers.has`,value:t,type:`header name`});return this[n].contains(t)}set(t,r){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,2,{header:`Headers.set`}),t=u.converters.ByteString(t),r=u.converters.ByteString(r),r=h(r),!s(t))throw u.errors.invalidArgument({prefix:`Headers.set`,value:t,type:`header name`});if(!c(r))throw u.errors.invalidArgument({prefix:`Headers.set`,value:r,type:`header value`});if(this[i]===`immutable`)throw TypeError(`immutable`);this[i],this[n].set(t,r)}getSetCookie(){u.brandCheck(this,e);let t=this[n].cookies;return t?[...t]:[]}get[p](){if(this[n][p])return this[n][p];let e=[],t=[...this[n]].sort((e,t)=>e[0]e,`Headers`,`key`)}return o(()=>[...this[p].values()],`Headers`,`key`)}values(){if(u.brandCheck(this,e),this[i]===`immutable`){let e=this[p];return o(()=>e,`Headers`,`value`)}return o(()=>[...this[p].values()],`Headers`,`value`)}entries(){if(u.brandCheck(this,e),this[i]===`immutable`){let e=this[p];return o(()=>e,`Headers`,`key+value`)}return o(()=>[...this[p].values()],`Headers`,`key+value`)}forEach(t,n=globalThis){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`Headers.forEach`}),typeof t!=`function`)throw TypeError(`Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.`);for(let[e,r]of this)t.apply(n,[r,e,this])}[Symbol.for(`nodejs.util.inspect.custom`)](){return u.brandCheck(this,e),this[n]}};y.prototype[Symbol.iterator]=y.prototype.entries,Object.defineProperties(y.prototype,{append:a,delete:a,get:a,has:a,set:a,getSetCookie:a,keys:a,values:a,entries:a,forEach:a,[Symbol.iterator]:{enumerable:!1},[Symbol.toStringTag]:{value:`Headers`,configurable:!0},[l.inspect.custom]:{enumerable:!1}}),u.converters.HeadersInit=function(e){if(u.util.Type(e)===`Object`)return e[Symbol.iterator]?u.converters[`sequence>`](e):u.converters[`record`](e);throw u.errors.conversionFailed({prefix:`Headers constructor`,argument:`Argument 1`,types:[`sequence>`,`record`]})},t.exports={fill:g,Headers:y,HeadersList:v}})),Ye=b(((e,t)=>{let{Headers:n,HeadersList:r,fill:i}=Je(),{extractBody:a,cloneBody:o,mixinBody:s}=se(),c=P(),{kEnumerableProperty:l}=c,{isValidReasonPhrase:u,isCancelled:d,isAborted:f,isBlobLike:p,serializeJavascriptValueToJSONString:m,isErrorLike:h,isomorphicEncode:g}=re(),{redirectStatusSet:_,nullBodyStatus:v,DOMException:y}=G(),{kState:b,kHeaders:x,kGuard:S,kRealm:C}=q(),{webidl:T}=J(),{FormData:E}=oe(),{getGlobalOrigin:D}=K(),{URLSerializer:O}=ie(),{kHeadersList:k,kConstruct:A}=j(),M=w(`assert`),{types:N}=w(`util`),F=globalThis.ReadableStream||w(`stream/web`).ReadableStream,I=new TextEncoder(`utf-8`);var L=class e{static error(){let t={settingsObject:{}},n=new e;return n[b]=B(),n[C]=t,n[x][k]=n[b].headersList,n[x][S]=`immutable`,n[x][C]=t,n}static json(t,n={}){T.argumentLengthCheck(arguments,1,{header:`Response.json`}),n!==null&&(n=T.converters.ResponseInit(n));let r=a(I.encode(m(t))),i={settingsObject:{}},o=new e;return o[C]=i,o[x][S]=`response`,o[x][C]=i,ne(o,n,{body:r[0],type:`application/json`}),o}static redirect(t,n=302){let r={settingsObject:{}};T.argumentLengthCheck(arguments,1,{header:`Response.redirect`}),t=T.converters.USVString(t),n=T.converters[`unsigned short`](n);let i;try{i=new URL(t,D())}catch(e){throw Object.assign(TypeError(`Failed to parse URL from `+t),{cause:e})}if(!_.has(n))throw RangeError(`Invalid status code `+n);let a=new e;a[C]=r,a[x][S]=`immutable`,a[x][C]=r,a[b].status=n;let o=g(O(i));return a[b].headersList.append(`location`,o),a}constructor(e=null,t={}){e!==null&&(e=T.converters.BodyInit(e)),t=T.converters.ResponseInit(t),this[C]={settingsObject:{}},this[b]=z({}),this[x]=new n(A),this[x][S]=`response`,this[x][k]=this[b].headersList,this[x][C]=this[C];let r=null;if(e!=null){let[t,n]=a(e);r={body:t,type:n}}ne(this,t,r)}get type(){return T.brandCheck(this,e),this[b].type}get url(){T.brandCheck(this,e);let t=this[b].urlList,n=t[t.length-1]??null;return n===null?``:O(n,!0)}get redirected(){return T.brandCheck(this,e),this[b].urlList.length>1}get status(){return T.brandCheck(this,e),this[b].status}get ok(){return T.brandCheck(this,e),this[b].status>=200&&this[b].status<=299}get statusText(){return T.brandCheck(this,e),this[b].statusText}get headers(){return T.brandCheck(this,e),this[x]}get body(){return T.brandCheck(this,e),this[b].body?this[b].body.stream:null}get bodyUsed(){return T.brandCheck(this,e),!!this[b].body&&c.isDisturbed(this[b].body.stream)}clone(){if(T.brandCheck(this,e),this.bodyUsed||this.body&&this.body.locked)throw T.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let t=R(this[b]),n=new e;return n[b]=t,n[C]=this[C],n[x][k]=t.headersList,n[x][S]=this[x][S],n[x][C]=this[x][C],n}};s(L),Object.defineProperties(L.prototype,{type:l,url:l,status:l,ok:l,redirected:l,statusText:l,headers:l,clone:l,body:l,bodyUsed:l,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(L,{json:l,redirect:l,error:l});function R(e){if(e.internalResponse)return ee(R(e.internalResponse),e.type);let t=z({...e,body:null});return e.body!=null&&(t.body=o(e.body)),t}function z(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 B(e){return z({type:`error`,status:0,error:h(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function V(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 M(!(n in t)),e[n]=r,!0}})}function ee(e,t){if(t===`basic`)return V(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return V(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return V(e,{type:`opaque`,urlList:Object.freeze([]),status:0,statusText:``,body:null});if(t===`opaqueredirect`)return V(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});M(!1)}function te(e,t=null){return M(d(e)),f(e)?B(Object.assign(new y(`The operation was aborted.`,`AbortError`),{cause:t})):B(Object.assign(new y(`Request was cancelled.`),{cause:t}))}function ne(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&&!u(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(e[b].status=t.status),`statusText`in t&&t.statusText!=null&&(e[b].statusText=t.statusText),`headers`in t&&t.headers!=null&&i(e[x],t.headers),n){if(v.includes(e.status))throw T.errors.exception({header:`Response constructor`,message:`Invalid response status code `+e.status});e[b].body=n.body,n.type!=null&&!e[b].headersList.contains(`Content-Type`)&&e[b].headersList.append(`content-type`,n.type)}}T.converters.ReadableStream=T.interfaceConverter(F),T.converters.FormData=T.interfaceConverter(E),T.converters.URLSearchParams=T.interfaceConverter(URLSearchParams),T.converters.XMLHttpRequestBodyInit=function(e){return typeof e==`string`?T.converters.USVString(e):p(e)?T.converters.Blob(e,{strict:!1}):N.isArrayBuffer(e)||N.isTypedArray(e)||N.isDataView(e)?T.converters.BufferSource(e):c.isFormDataLike(e)?T.converters.FormData(e,{strict:!1}):e instanceof URLSearchParams?T.converters.URLSearchParams(e):T.converters.DOMString(e)},T.converters.BodyInit=function(e){return e instanceof F?T.converters.ReadableStream(e):e?.[Symbol.asyncIterator]?e:T.converters.XMLHttpRequestBodyInit(e)},T.converters.ResponseInit=T.dictionaryConverter([{key:`status`,converter:T.converters[`unsigned short`],defaultValue:200},{key:`statusText`,converter:T.converters.ByteString,defaultValue:``},{key:`headers`,converter:T.converters.HeadersInit}]),t.exports={makeNetworkError:B,makeResponse:z,makeAppropriateNetworkError:te,filterResponse:ee,Response:L,cloneResponse:R}})),Xe=b(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i}=se(),{Headers:a,fill:o,HeadersList:s}=Je(),{FinalizationRegistry:c}=we()(),l=P(),{isValidHTTPToken:u,sameOrigin:d,normalizeMethod:f,makePolicyContainer:p,normalizeMethodRecord:m}=re(),{forbiddenMethodsSet:h,corsSafeListedMethodsSet:g,referrerPolicy:_,requestRedirect:v,requestMode:y,requestCredentials:b,requestCache:x,requestDuplex:S}=G(),{kEnumerableProperty:C}=l,{kHeaders:T,kSignal:E,kState:D,kGuard:O,kRealm:k}=q(),{webidl:A}=J(),{getGlobalOrigin:M}=K(),{URLSerializer:N}=ie(),{kHeadersList:F,kConstruct:I}=j(),L=w(`assert`),{getMaxListeners:R,setMaxListeners:z,getEventListeners:B,defaultMaxListeners:V}=w(`events`),ee=globalThis.TransformStream,te=Symbol(`abortController`),ne=new c(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)});var H=class e{constructor(t,r={}){if(t===I)return;A.argumentLengthCheck(arguments,1,{header:`Request constructor`}),t=A.converters.RequestInfo(t),r=A.converters.RequestInit(r),this[k]={settingsObject:{baseUrl:M(),get origin(){return this.baseUrl?.origin},policyContainer:p()}};let i=null,c=null,_=this[k].settingsObject.baseUrl,v=null;if(typeof t==`string`){let e;try{e=new URL(t,_)}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);i=U({urlList:[e]}),c=`cors`}else L(t instanceof e),i=t[D],v=t[E];let y=this[k].settingsObject.origin,b=`client`;if(i.window?.constructor?.name===`EnvironmentSettingsObject`&&d(i.window,y)&&(b=i.window),r.window!=null)throw TypeError(`'window' option '${b}' must be null`);`window`in r&&(b=`no-window`),i=U({method:i.method,headersList:i.headersList,unsafeRequest:i.unsafeRequest,client:this[k].settingsObject,window:b,priority:i.priority,origin:i.origin,referrer:i.referrer,referrerPolicy:i.referrerPolicy,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,integrity:i.integrity,keepalive:i.keepalive,reloadNavigation:i.reloadNavigation,historyNavigation:i.historyNavigation,urlList:[...i.urlList]});let x=Object.keys(r).length!==0;if(x&&(i.mode===`navigate`&&(i.mode=`same-origin`),i.reloadNavigation=!1,i.historyNavigation=!1,i.origin=`client`,i.referrer=`client`,i.referrerPolicy=``,i.url=i.urlList[i.urlList.length-1],i.urlList=[i.url]),r.referrer!==void 0){let e=r.referrer;if(e===``)i.referrer=`no-referrer`;else{let t;try{t=new URL(e,_)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||y&&!d(t,this[k].settingsObject.baseUrl)?i.referrer=`client`:i.referrer=t}}r.referrerPolicy!==void 0&&(i.referrerPolicy=r.referrerPolicy);let S;if(S=r.mode===void 0?c:r.mode,S===`navigate`)throw A.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(S!=null&&(i.mode=S),r.credentials!==void 0&&(i.credentials=r.credentials),r.cache!==void 0&&(i.cache=r.cache),i.cache===`only-if-cached`&&i.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(r.redirect!==void 0&&(i.redirect=r.redirect),r.integrity!=null&&(i.integrity=String(r.integrity)),r.keepalive!==void 0&&(i.keepalive=!!r.keepalive),r.method!==void 0){let e=r.method;if(!u(e))throw TypeError(`'${e}' is not a valid HTTP method.`);if(h.has(e.toUpperCase()))throw TypeError(`'${e}' HTTP method is unsupported.`);e=m[e]??f(e),i.method=e}r.signal!==void 0&&(v=r.signal),this[D]=i;let C=new AbortController;if(this[E]=C.signal,this[E][k]=this[k],v!=null){if(!v||typeof v.aborted!=`boolean`||typeof v.addEventListener!=`function`)throw TypeError(`Failed to construct 'Request': member signal is not of type AbortSignal.`);if(v.aborted)C.abort(v.reason);else{this[te]=C;let e=new WeakRef(C),t=function(){let t=e.deref();t!==void 0&&t.abort(this.reason)};try{(typeof R==`function`&&R(v)===V||B(v,`abort`).length>=V)&&z(100,v)}catch{}l.addAbortListener(v,t),ne.register(C,{signal:v,abort:t})}}if(this[T]=new a(I),this[T][F]=i.headersList,this[T][O]=`request`,this[T][k]=this[k],S===`no-cors`){if(!g.has(i.method))throw TypeError(`'${i.method} is unsupported in no-cors mode.`);this[T][O]=`request-no-cors`}if(x){let e=this[T][F],t=r.headers===void 0?new s(e):r.headers;if(e.clear(),t instanceof s){for(let[n,r]of t)e.append(n,r);e.cookies=t.cookies}else o(this[T],t)}let j=t instanceof e?t[D].body:null;if((r.body!=null||j!=null)&&(i.method===`GET`||i.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let N=null;if(r.body!=null){let[e,t]=n(r.body,i.keepalive);N=e,t&&!this[T][F].contains(`content-type`)&&this[T].append(`content-type`,t)}let P=N??j;if(P!=null&&P.source==null){if(N!=null&&r.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(i.mode!==`same-origin`&&i.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);i.useCORSPreflightFlag=!0}let H=P;if(N==null&&j!=null){if(l.isDisturbed(j.stream)||j.stream.locked)throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);ee||=w(`stream/web`).TransformStream;let e=new ee;j.stream.pipeThrough(e),H={source:j.source,length:j.length,stream:e.readable}}this[D].body=H}get method(){return A.brandCheck(this,e),this[D].method}get url(){return A.brandCheck(this,e),N(this[D].url)}get headers(){return A.brandCheck(this,e),this[T]}get destination(){return A.brandCheck(this,e),this[D].destination}get referrer(){return A.brandCheck(this,e),this[D].referrer===`no-referrer`?``:this[D].referrer===`client`?`about:client`:this[D].referrer.toString()}get referrerPolicy(){return A.brandCheck(this,e),this[D].referrerPolicy}get mode(){return A.brandCheck(this,e),this[D].mode}get credentials(){return this[D].credentials}get cache(){return A.brandCheck(this,e),this[D].cache}get redirect(){return A.brandCheck(this,e),this[D].redirect}get integrity(){return A.brandCheck(this,e),this[D].integrity}get keepalive(){return A.brandCheck(this,e),this[D].keepalive}get isReloadNavigation(){return A.brandCheck(this,e),this[D].reloadNavigation}get isHistoryNavigation(){return A.brandCheck(this,e),this[D].historyNavigation}get signal(){return A.brandCheck(this,e),this[E]}get body(){return A.brandCheck(this,e),this[D].body?this[D].body.stream:null}get bodyUsed(){return A.brandCheck(this,e),!!this[D].body&&l.isDisturbed(this[D].body.stream)}get duplex(){return A.brandCheck(this,e),`half`}clone(){if(A.brandCheck(this,e),this.bodyUsed||this.body?.locked)throw TypeError(`unusable`);let t=W(this[D]),n=new e(I);n[D]=t,n[k]=this[k],n[T]=new a(I),n[T][F]=t.headersList,n[T][O]=this[T][O],n[T][k]=this[T][k];let r=new AbortController;return this.signal.aborted?r.abort(this.signal.reason):l.addAbortListener(this.signal,()=>{r.abort(this.signal.reason)}),n[E]=r.signal,n}};r(H);function U(e){let t={method:`GET`,localURLsOnly:!1,unsafeRequest:!1,body:null,client:null,reservedClient:null,replacesClientId:``,window:`client`,keepalive:!1,serviceWorkers:`all`,initiator:``,destination:``,priority:null,origin:`client`,policyContainer:`client`,referrer:`client`,referrerPolicy:``,mode:`no-cors`,useCORSPreflightFlag:!1,credentials:`same-origin`,useCredentials:!1,cache:`default`,redirect:`follow`,integrity:``,cryptoGraphicsNonceMetadata:``,parserMetadata:``,reloadNavigation:!1,historyNavigation:!1,userActivation:!1,taintedOrigin:!1,redirectCount:0,responseTainting:`basic`,preventNoCacheCacheControlHeaderModification:!1,done:!1,timingAllowFailed:!1,...e,headersList:e.headersList?new s(e.headersList):new s};return t.url=t.urlList[0],t}function W(e){let t=U({...e,body:null});return e.body!=null&&(t.body=i(e.body)),t}Object.defineProperties(H.prototype,{method:C,url:C,headers:C,redirect:C,clone:C,signal:C,duplex:C,destination:C,body:C,bodyUsed:C,isHistoryNavigation:C,isReloadNavigation:C,keepalive:C,integrity:C,cache:C,credentials:C,attribute:C,referrerPolicy:C,referrer:C,mode:C,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),A.converters.Request=A.interfaceConverter(H),A.converters.RequestInfo=function(e){return typeof e==`string`?A.converters.USVString(e):e instanceof H?A.converters.Request(e):A.converters.USVString(e)},A.converters.AbortSignal=A.interfaceConverter(AbortSignal),A.converters.RequestInit=A.dictionaryConverter([{key:`method`,converter:A.converters.ByteString},{key:`headers`,converter:A.converters.HeadersInit},{key:`body`,converter:A.nullableConverter(A.converters.BodyInit)},{key:`referrer`,converter:A.converters.USVString},{key:`referrerPolicy`,converter:A.converters.DOMString,allowedValues:_},{key:`mode`,converter:A.converters.DOMString,allowedValues:y},{key:`credentials`,converter:A.converters.DOMString,allowedValues:b},{key:`cache`,converter:A.converters.DOMString,allowedValues:x},{key:`redirect`,converter:A.converters.DOMString,allowedValues:v},{key:`integrity`,converter:A.converters.DOMString},{key:`keepalive`,converter:A.converters.boolean},{key:`signal`,converter:A.nullableConverter(e=>A.converters.AbortSignal(e,{strict:!1}))},{key:`window`,converter:A.converters.any},{key:`duplex`,converter:A.converters.DOMString,allowedValues:S}]),t.exports={Request:H,makeRequest:U}})),Ze=b(((e,t)=>{let{Response:n,makeNetworkError:r,makeAppropriateNetworkError:i,filterResponse:a,makeResponse:o}=Ye(),{Headers:s}=Je(),{Request:c,makeRequest:l}=Xe(),u=w(`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:T,determineRequestsReferrer:E,coarsenedSharedCurrentTime:D,createDeferredPromise:O,isBlobLike:k,sameOrigin:A,isCancelled:M,isAborted:N,isErrorLike:F,fullyReadBody:I,readableStreamClose:L,isomorphicEncode:R,urlIsLocal:z,urlIsHttpHttpsScheme:B,urlHasHttpsScheme:V}=re(),{kState:ee,kHeaders:te,kGuard:ne,kRealm:H}=q(),U=w(`assert`),{safelyExtractBody:W}=se(),{redirectStatusSet:K,nullBodyStatus:ae,safeMethodsSet:oe,requestBodyHeader:ce,subresourceSet:le,DOMException:ue}=G(),{kHeadersList:de}=j(),fe=w(`events`),{Readable:pe,pipeline:me}=w(`stream`),{addAbortListener:he,isErrored:ge,isReadable:_e,nodeMajor:ve,nodeMinor:ye}=P(),{dataURLProcessor:be,serializeAMimeType:xe}=ie(),{TransformStream:Se}=w(`stream/web`),{getGlobalDispatcher:Ce}=Ke(),{webidl:we}=J(),{STATUS_CODES:Te}=w(`http`),Ee=[`GET`,`HEAD`],De,Oe=globalThis.ReadableStream;var ke=class extends fe{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state=`ongoing`,this.setMaxListeners(21)}terminate(e){this.state===`ongoing`&&(this.state=`terminated`,this.connection?.destroy(e),this.emit(`terminated`,e))}abort(e){this.state===`ongoing`&&(this.state=`aborted`,e||=new ue(`The operation was aborted.`,`AbortError`),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit(`terminated`,e))}};function Ae(e,t={}){we.argumentLengthCheck(arguments,1,{header:`globalThis.fetch`});let r=O(),i;try{i=new c(e,t)}catch(e){return r.reject(e),r.promise}let a=i[ee];if(i.signal.aborted)return Ne(r,a,null,i.signal.reason),r.promise;a.client.globalObject?.constructor?.name===`ServiceWorkerGlobalScope`&&(a.serviceWorkers=`none`);let o=null,s=!1,l=null;return he(i.signal,()=>{s=!0,U(l!=null),l.abort(i.signal.reason),Ne(r,a,o,i.signal.reason)}),l=Pe({request:a,processResponseEndOfBody:e=>je(e,`fetch`),processResponse:e=>{if(s)return Promise.resolve();if(e.aborted)return Ne(r,a,o,l.serializedAbortReason),Promise.resolve();if(e.type===`error`)return r.reject(Object.assign(TypeError(`fetch failed`),{cause:e.error})),Promise.resolve();o=new n,o[ee]=e,o[H]=null,o[te][de]=e.headersList,o[te][ne]=`immutable`,o[te][H]=null,r.resolve(o)},dispatcher:t.dispatcher??Ce()}),r.promise}function je(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;B(n)&&r!==null&&(e.timingAllowPassed||(r=x({startTime:r.startTime}),i=``),r.endTime=D(),e.timingInfo=r,Me(r,n,t,globalThis,i))}function Me(e,t,n,r,i){(ve>18||ve===18&&ye>=2)&&performance.markResourceTiming(e,t.href,n,r,i)}function Ne(e,t,n,r){if(r||=new ue(`The operation was aborted.`,`AbortError`),e.reject(r),t.body!=null&&_e(t.body?.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let i=n[ee];i.body!=null&&_e(i.body?.stream)&&i.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e})}function Pe({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s}){let c=null,l=!1;e.client!=null&&(c=e.client.globalObject,l=e.client.crossOriginIsolatedCapability);let u=x({startTime:D(l)}),d={controller:new ke(s),request:e,timingInfo:u,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:l};return U(!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`)||e.headersList.append(`accept`,`*/*`),e.headersList.contains(`accept-language`)||e.headersList.append(`accept-language`,`*`),e.priority,le.has(e.destination),Fe(d).catch(e=>{d.controller.terminate(e)}),d.controller}async function Fe(e,t=!1){let n=e.request,i=null;if(n.localURLsOnly&&!z(v(n))&&(i=r(`local URLs only`)),b(n),m(n)===`blocked`&&(i=r(`bad port`)),n.referrerPolicy===``&&(n.referrerPolicy=n.policyContainer.referrerPolicy),n.referrer!==`no-referrer`&&(n.referrer=E(n)),i===null&&(i=await(async()=>{let t=v(n);return A(t,n.url)&&n.responseTainting===`basic`||t.protocol===`data:`||n.mode===`navigate`||n.mode===`websocket`?(n.responseTainting=`basic`,await Ie(e)):n.mode===`same-origin`?r(`request mode cannot be "same-origin"`):n.mode===`no-cors`?n.redirect===`follow`?(n.responseTainting=`opaque`,await Ie(e)):r(`redirect mode cannot be "follow" for "no-cors" request`):B(v(n))?(n.responseTainting=`cors`,await ze(e)):r(`URL scheme must be a HTTP(S) scheme`)})()),t)return i;i.status!==0&&!i.internalResponse&&(n.responseTainting,n.responseTainting===`basic`?i=a(i,`basic`):n.responseTainting===`cors`?i=a(i,`cors`):n.responseTainting===`opaque`?i=a(i,`opaque`):U(!1));let o=i.status===0?i:i.internalResponse;if(o.urlList.length===0&&o.urlList.push(...n.urlList),n.timingAllowFailed||(i.timingAllowPassed=!0),i.type===`opaque`&&o.status===206&&o.rangeRequested&&!n.headers.contains(`range`)&&(i=o=r()),i.status!==0&&(n.method===`HEAD`||n.method===`CONNECT`||ae.includes(o.status))&&(o.body=null,e.controller.dump=!0),n.integrity){let t=t=>Re(e,r(t));if(n.responseTainting===`opaque`||i.body==null){t(i.error);return}await I(i.body,r=>{if(!d(r,n.integrity)){t(`integrity mismatch`);return}i.body=W(r)[0],Re(e,i)},t)}else Re(e,i)}function Ie(e){if(M(e)&&e.request.redirectCount===0)return Promise.resolve(i(e));let{request:t}=e,{protocol:n}=v(t);switch(n){case`about:`:return Promise.resolve(r(`about scheme is not supported`));case`blob:`:{De||=w(`buffer`).resolveObjectURL;let e=v(t);if(e.search.length!==0)return Promise.resolve(r(`NetworkError when attempting to fetch resource.`));let n=De(e.toString());if(t.method!==`GET`||!k(n))return Promise.resolve(r(`invalid method`));let i=W(n),a=i[0],s=R(`${a.length}`),c=i[1]??``,l=o({statusText:`OK`,headersList:[[`content-length`,{name:`Content-Length`,value:s}],[`content-type`,{name:`Content-Type`,value:c}]]});return l.body=a,Promise.resolve(l)}case`data:`:{let e=be(v(t));if(e===`failure`)return Promise.resolve(r(`failed to fetch the data URL`));let n=xe(e.mimeType);return Promise.resolve(o({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:n}]],body:W(e.body)[0]}))}case`file:`:return Promise.resolve(r(`not implemented... yet...`));case`http:`:case`https:`:return ze(e).catch(e=>r(e));default:return Promise.resolve(r(`unknown scheme`))}}function Le(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function Re(e,t){t.type===`error`&&(t.urlList=[e.request.urlList[0]],t.timingInfo=x({startTime:e.timingInfo.startTime}));let n=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t))};if(e.processResponse!=null&&queueMicrotask(()=>e.processResponse(t)),t.body==null)n();else{let e=new Se({start(){},transform:(e,t)=>{t.enqueue(e)},flush:n},{size(){return 1}},{size(){return 1}});t.body={stream:t.body.stream.pipeThrough(e)}}if(e.processResponseConsumeBody!=null){let n=n=>e.processResponseConsumeBody(t,n),r=n=>e.processResponseConsumeBody(t,n);if(t.body==null)queueMicrotask(()=>n(null));else return I(t.body,n,r);return Promise.resolve()}}async function ze(e){let t=e.request,n=null,i=null,a=e.timingInfo;if(t.serviceWorkers,n===null){if(t.redirect===`follow`&&(t.serviceWorkers=`none`),i=n=await Ve(e),t.responseTainting===`cors`&&C(t,n)===`failure`)return r(`cors failure`);h(t,n)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||n.type===`opaque`)&&T(t.origin,t.client,t.destination,i)===`blocked`?r(`blocked`):(K.has(i.status)&&(t.redirect!==`manual`&&e.controller.connection.destroy(),t.redirect===`error`?n=r(`unexpected redirect`):t.redirect===`manual`?n=i:t.redirect===`follow`?n=await Be(e,n):U(!1)),n.timingInfo=a,n)}function Be(e,t){let n=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=_(i,v(n).hash),a==null)return t}catch(e){return Promise.resolve(r(e))}if(!B(a))return Promise.resolve(r(`URL scheme must be a HTTP(S) scheme`));if(n.redirectCount===20)return Promise.resolve(r(`redirect count exceeded`));if(n.redirectCount+=1,n.mode===`cors`&&(a.username||a.password)&&!A(n,a))return Promise.resolve(r(`cross origin not allowed for request mode "cors"`));if(n.responseTainting===`cors`&&(a.username||a.password))return Promise.resolve(r(`URL cannot contain credentials for request mode "cors"`));if(i.status!==303&&n.body!=null&&n.body.source==null)return Promise.resolve(r());if([301,302].includes(i.status)&&n.method===`POST`||i.status===303&&!Ee.includes(n.method)){n.method=`GET`,n.body=null;for(let e of ce)n.headersList.delete(e)}A(v(n),a)||(n.headersList.delete(`authorization`),n.headersList.delete(`proxy-authorization`,!0),n.headersList.delete(`cookie`),n.headersList.delete(`host`)),n.body!=null&&(U(n.body.source!=null),n.body=W(n.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=D(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),n.urlList.push(a),y(n,i),Fe(e,!0)}async function Ve(e,t=!1,n=!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=R(`${d}`)),f!=null&&s.headersList.append(`content-length`,f),d!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append(`referer`,R(s.referrer.href)),g(s),S(s),s.headersList.contains(`user-agent`)||s.headersList.append(`user-agent`,typeof esbuildDetection>`u`?`undici`:`node`),s.cache===`default`&&(s.headersList.contains(`if-modified-since`)||s.headersList.contains(`if-none-match`)||s.headersList.contains(`if-unmodified-since`)||s.headersList.contains(`if-match`)||s.headersList.contains(`if-range`))&&(s.cache=`no-store`),s.cache===`no-cache`&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains(`cache-control`)&&s.headersList.append(`cache-control`,`max-age=0`),(s.cache===`no-store`||s.cache===`reload`)&&(s.headersList.contains(`pragma`)||s.headersList.append(`pragma`,`no-cache`),s.headersList.contains(`cache-control`)||s.headersList.append(`cache-control`,`no-cache`)),s.headersList.contains(`range`)&&s.headersList.append(`accept-encoding`,`identity`),s.headersList.contains(`accept-encoding`)||(V(v(s))?s.headersList.append(`accept-encoding`,`br, gzip, deflate`):s.headersList.append(`accept-encoding`,`gzip, deflate`)),s.headersList.delete(`host`),s.cache=`no-store`,s.mode!==`no-store`&&s.mode,c==null){if(s.mode===`only-if-cached`)return r(`only if cached`);let e=await He(o,u,n);!oe.has(s.method)&&e.status>=200&&e.status,c??=e}if(c.urlList=[...s.urlList],s.headersList.contains(`range`)&&(c.rangeRequested=!0),c.requestIncludesCredentials=u,c.status===407)return a.window===`no-window`?r():M(e)?i(e):r(`proxy authentication required`);if(c.status===421&&!n&&(a.body==null||a.body.source!=null)){if(M(e))return i(e);e.controller.connection.destroy(),c=await Ve(e,t,!0)}return c}async function He(e,t=!1,n=!1){U(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e){this.destroyed||(this.destroyed=!0,this.abort?.(e??new ue(`The operation was aborted.`,`AbortError`)))}};let a=e.request,c=null,l=e.timingInfo;a.cache=`no-store`,a.mode;let d=null;if(a.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(a.body!=null){let t=async function*(t){M(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},n=()=>{M(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{M(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};d=(async function*(){try{for await(let e of a.body.stream)yield*t(e);n()}catch(e){r(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:a}=await g({body:d});if(a)c=o({status:n,statusText:r,headersList:i,socket:a});else{let a=t[Symbol.asyncIterator]();e.controller.next=()=>a.next(),c=o({status:n,statusText:r,headersList:i})}}catch(t){return t.name===`AbortError`?(e.controller.connection.destroy(),i(e,t)):r(t)}let f=()=>{e.controller.resume()},p=t=>{e.controller.abort(t)};Oe||=w(`stream/web`).ReadableStream;let m=new Oe({async start(t){e.controller.controller=t},async pull(e){await f(e)},async cancel(e){await p(e)}},{highWaterMark:0,size(){return 1}});c.body={stream:m},e.controller.on(`terminated`,h),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(N(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){L(e.controller.controller),Le(e,c);return}if(l.decodedBodySize+=t?.byteLength??0,n){e.controller.terminate(t);return}if(e.controller.controller.enqueue(new Uint8Array(t)),ge(m)){e.controller.terminate();return}if(!e.controller.controller.desiredSize)return}};function h(t){N(e)?(c.aborted=!0,_e(m)&&e.controller.controller.error(e.controller.serializedAbortReason)):_e(m)&&e.controller.controller.error(TypeError(`terminated`,{cause:F(t)?t:void 0})),e.controller.connection.destroy()}return c;async function g({body:t}){let n=v(a),r=e.controller.dispatcher;return new Promise((i,o)=>r.dispatch({path:n.pathname+n.search,origin:n.origin,method:a.method,body:e.controller.dispatcher.isMockActive?a.body&&(a.body.source||a.body.stream):t,headers:a.headersList.entries,maxRedirections:0,upgrade:a.mode===`websocket`?`websocket`:void 0},{body:null,abort:null,onConnect(t){let{connection:n}=e.controller;n.destroyed?t(new ue(`The operation was aborted.`,`AbortError`)):(e.controller.on(`terminated`,t),this.abort=n.abort=t)},onHeaders(e,t,n,r){if(e<200)return;let o=[],c=``,l=new s;if(Array.isArray(t))for(let e=0;ee.trim()):n.toLowerCase()===`location`&&(c=r),l[de].append(n,r)}else{let e=Object.keys(t);for(let n of e){let e=t[n];n.toLowerCase()===`content-encoding`?o=e.toLowerCase().split(`,`).map(e=>e.trim()).reverse():n.toLowerCase()===`location`&&(c=e),l[de].append(n,e)}}this.body=new pe({read:n});let d=[],f=a.redirect===`follow`&&c&&K.has(e);if(a.method!==`HEAD`&&a.method!==`CONNECT`&&!ae.includes(e)&&!f)for(let e of o)if(e===`x-gzip`||e===`gzip`)d.push(u.createGunzip({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(e===`deflate`)d.push(u.createInflate());else if(e===`br`)d.push(u.createBrotliDecompress());else{d.length=0;break}return i({status:e,statusText:r,headersList:l[de],body:d.length?me(this.body,...d,()=>{}):this.body.on(`error`,()=>{})}),!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.ended=!0,this.body.push(null)},onError(t){this.abort&&e.controller.off(`terminated`,this.abort),this.body?.destroy(t),e.controller.terminate(t),o(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`)}})),$e=b(((e,t)=>{let{webidl:n}=J(),r=Symbol(`ProgressEvent state`);var i=class e extends Event{constructor(e,t={}){e=n.converters.DOMString(e),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}})),et=b(((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}})),tt=b(((e,t)=>{let{kState:n,kError:r,kResult:i,kAborted:a,kLastProgressEventFired:o}=Qe(),{ProgressEvent:s}=$e(),{getEncoding:c}=et(),{DOMException:l}=G(),{serializeAMimeType:u,parseMIMEType:d}=ie(),{types:f}=w(`util`),{StringDecoder:p}=w(`string_decoder`),{btoa:m}=w(`buffer`),h={enumerable:!0,writable:!1,configurable:!1};function g(e,t,s,c){if(e[n]===`loading`)throw new l(`Invalid state`,`InvalidStateError`);e[n]=`loading`,e[i]=null,e[r]=null;let u=t.stream().getReader(),d=[],p=u.read(),m=!0;(async()=>{for(;!e[a];)try{let{done:l,value:h}=await p;if(m&&!e[a]&&queueMicrotask(()=>{_(`loadstart`,e)}),m=!1,!l&&f.isUint8Array(h))d.push(h),(e[o]===void 0||Date.now()-e[o]>=50)&&!e[a]&&(e[o]=Date.now(),queueMicrotask(()=>{_(`progress`,e)})),p=u.read();else if(l){queueMicrotask(()=>{e[n]=`done`;try{let n=v(d,s,t.type,c);if(e[a])return;e[i]=n,_(`load`,e)}catch(t){e[r]=t,_(`error`,e)}e[n]!==`loading`&&_(`loadend`,e)});break}}catch(t){if(e[a])return;queueMicrotask(()=>{e[n]=`done`,e[r]=t,_(`error`,e),e[n]!==`loading`&&_(`loadend`,e)});break}})()}function _(e,t){let n=new s(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function v(e,t,n,r){switch(t){case`DataURL`:{let t=`data:`,r=d(n||`application/octet-stream`);r!==`failure`&&(t+=u(r)),t+=`;base64,`;let i=new p(`latin1`);for(let n of e)t+=m(i.write(n));return t+=m(i.end()),t}case`Text`:{let t=`failure`;if(r&&(t=c(r)),t===`failure`&&n){let e=d(n);e!==`failure`&&(t=c(e.parameters.get(`charset`)))}return t===`failure`&&(t=`UTF-8`),y(e,t)}case`ArrayBuffer`:return x(e).buffer;case`BinaryString`:{let t=``,n=new p(`latin1`);for(let r of e)t+=n.write(r);return t+=n.end(),t}}}function y(e,t){let n=x(e),r=b(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 b(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 x(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:h,readOperation:g,fireAProgressEvent:_}})),nt=b(((e,t)=>{let{staticPropertyDescriptors:n,readOperation:r,fireAProgressEvent:i}=tt(),{kState:a,kError:o,kResult:s,kEvents:c,kAborted:l}=Qe(),{webidl:u}=J(),{kEnumerableProperty:d}=P();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,{header:`FileReader.readAsArrayBuffer`}),t=u.converters.Blob(t,{strict:!1}),r(this,t,`ArrayBuffer`)}readAsBinaryString(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`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,{header:`FileReader.readAsText`}),t=u.converters.Blob(t,{strict:!1}),n!==void 0&&(n=u.converters.DOMString(n)),r(this,t,`Text`,n)}readAsDataURL(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`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}})),rt=b(((e,t)=>{t.exports={kConstruct:j().kConstruct}})),it=b(((e,t)=>{let n=w(`assert`),{URLSerializer:r}=ie(),{isValidHeaderName:i}=re();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(),n.length&&i(n)&&t.push(n);return t}t.exports={urlEquals:a,fieldValues:o}})),at=b(((e,t)=>{let{kConstruct:n}=rt(),{urlEquals:r,fieldValues:i}=it(),{kEnumerableProperty:a,isDisturbed:o}=P(),{kHeadersList:s}=j(),{webidl:c}=J(),{Response:l,cloneResponse:u}=Ye(),{Request:d}=Xe(),{kState:f,kHeaders:p,kGuard:m,kRealm:h}=q(),{fetching:g}=Ze(),{urlIsHttpHttpsScheme:_,createDeferredPromise:v,readAllBytes:y}=re(),b=w(`assert`),{getGlobalDispatcher:x}=Ke();var S=class e{#e;constructor(){arguments[0]!==n&&c.illegalConstructor(),this.#e=arguments[1]}async match(t,n={}){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,{header:`Cache.match`}),t=c.converters.RequestInfo(t),n=c.converters.CacheQueryOptions(n);let r=await this.matchAll(t,n);if(r.length!==0)return r[0]}async matchAll(t=void 0,n={}){c.brandCheck(this,e),t!==void 0&&(t=c.converters.RequestInfo(t)),n=c.converters.CacheQueryOptions(n);let r=null;if(t!==void 0)if(t instanceof d){if(r=t[f],r.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(r=new d(t)[f]);let i=[];if(t===void 0)for(let e of this.#e)i.push(e[1]);else{let e=this.#n(r,n);for(let t of e)i.push(t[1])}let a=[];for(let e of i){let t=new l(e.body?.source??null),n=t[f].body;t[f]=e,t[f].body=n,t[p][s]=e.headersList,t[p][m]=`immutable`,a.push(t)}return Object.freeze(a)}async add(t){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,{header:`Cache.add`}),t=c.converters.RequestInfo(t);let n=[t];return await this.addAll(n)}async addAll(t){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,{header:`Cache.addAll`}),t=c.converters[`sequence`](t);let n=[],r=[];for(let e of t){if(typeof e==`string`)continue;let t=e[f];if(!_(t.url)||t.method!==`GET`)throw c.errors.exception({header:`Cache.addAll`,message:`Expected http/s scheme when method is not GET.`})}let a=[];for(let e of t){let t=new d(e)[f];if(!_(t.url))throw c.errors.exception({header:`Cache.addAll`,message:`Expected http/s scheme.`});t.initiator=`fetch`,t.destination=`subresource`,r.push(t);let o=v();a.push(g({request:t,dispatcher:x(),processResponse(e){if(e.type===`error`||e.status===206||e.status<200||e.status>299)o.reject(c.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===`*`){o.reject(c.errors.exception({header:`Cache.addAll`,message:`invalid vary field value`}));for(let e of a)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){o.reject(new DOMException(`aborted`,`AbortError`));return}o.resolve(e)}})),n.push(o.promise)}let o=await Promise.all(n),s=[],l=0;for(let e of o){let t={type:`put`,request:r[l],response:e};s.push(t),l++}let u=v(),p=null;try{this.#t(s)}catch(e){p=e}return queueMicrotask(()=>{p===null?u.resolve(void 0):u.reject(p)}),u.promise}async put(t,n){c.brandCheck(this,e),c.argumentLengthCheck(arguments,2,{header:`Cache.put`}),t=c.converters.RequestInfo(t),n=c.converters.Response(n);let r=null;if(r=t instanceof d?t[f]:new d(t)[f],!_(r.url)||r.method!==`GET`)throw c.errors.exception({header:`Cache.put`,message:`Expected an http/s scheme when method is not GET`});let a=n[f];if(a.status===206)throw c.errors.exception({header:`Cache.put`,message:`Got 206 status`});if(a.headersList.contains(`vary`)){let e=i(a.headersList.get(`vary`));for(let t of e)if(t===`*`)throw c.errors.exception({header:`Cache.put`,message:`Got * vary field value`})}if(a.body&&(o(a.body.stream)||a.body.stream.locked))throw c.errors.exception({header:`Cache.put`,message:`Response body is locked or disturbed`});let s=u(a),l=v();a.body==null?l.resolve(void 0):y(a.body.stream.getReader()).then(l.resolve,l.reject);let p=[],m={type:`put`,request:r,response:s};p.push(m);let h=await l.promise;s.body!=null&&(s.body.source=h);let g=v(),b=null;try{this.#t(p)}catch(e){b=e}return queueMicrotask(()=>{b===null?g.resolve():g.reject(b)}),g.promise}async delete(t,n={}){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,{header:`Cache.delete`}),t=c.converters.RequestInfo(t),n=c.converters.CacheQueryOptions(n);let r=null;if(t instanceof d){if(r=t[f],r.method!==`GET`&&!n.ignoreMethod)return!1}else b(typeof t==`string`),r=new d(t)[f];let i=[],a={type:`delete`,request:r,options:n};i.push(a);let o=v(),s=null,l;try{l=this.#t(i)}catch(e){s=e}return queueMicrotask(()=>{s===null?o.resolve(!!l?.length):o.reject(s)}),o.promise}async keys(t=void 0,n={}){c.brandCheck(this,e),t!==void 0&&(t=c.converters.RequestInfo(t)),n=c.converters.CacheQueryOptions(n);let r=null;if(t!==void 0)if(t instanceof d){if(r=t[f],r.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(r=new d(t)[f]);let i=v(),a=[];if(t===void 0)for(let e of this.#e)a.push(e[0]);else{let e=this.#n(r,n);for(let t of e)a.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of a){let n=new d(`https://a`);n[f]=t,n[p][s]=t.headersList,n[p][m]=`immutable`,n[h]=t.client,e.push(n)}i.resolve(Object.freeze(e))}),i.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 c.errors.exception({header:`Cache.#batchCacheOperations`,message:`operation type does not match "delete" or "put"`});if(n.type===`delete`&&n.response!=null)throw c.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);b(e!==-1),t.splice(e,1)}}else if(n.type===`put`){if(n.response==null)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`put operation should have an associated response`});let i=n.request;if(!_(i.url))throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`expected http or https scheme`});if(i.method!==`GET`)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`not get method`});if(n.options!=null)throw c.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);b(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}};Object.defineProperties(S.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:a,matchAll:a,add:a,addAll:a,put:a,delete:a,keys:a});let C=[{key:`ignoreSearch`,converter:c.converters.boolean,defaultValue:!1},{key:`ignoreMethod`,converter:c.converters.boolean,defaultValue:!1},{key:`ignoreVary`,converter:c.converters.boolean,defaultValue:!1}];c.converters.CacheQueryOptions=c.dictionaryConverter(C),c.converters.MultiCacheQueryOptions=c.dictionaryConverter([...C,{key:`cacheName`,converter:c.converters.DOMString}]),c.converters.Response=c.interfaceConverter(l),c.converters[`sequence`]=c.sequenceConverter(c.converters.RequestInfo),t.exports={Cache:S}})),ot=b(((e,t)=>{let{kConstruct:n}=rt(),{Cache:r}=at(),{webidl:i}=J(),{kEnumerableProperty:a}=P();var o=class e{#e=new Map;constructor(){arguments[0]!==n&&i.illegalConstructor()}async match(t,a={}){if(i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,{header:`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){return i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,{header:`CacheStorage.has`}),t=i.converters.DOMString(t),this.#e.has(t)}async open(t){if(i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,{header:`CacheStorage.open`}),t=i.converters.DOMString(t),this.#e.has(t))return new r(n,this.#e.get(t));let a=[];return this.#e.set(t,a),new r(n,a)}async delete(t){return i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,{header:`CacheStorage.delete`}),t=i.converters.DOMString(t),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}})),st=b(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),ct=b(((e,t)=>{function n(e){if(e.length===0)return!1;for(let t of e){let e=t.charCodeAt(0);if(e>=0||e<=8||e>=10||e<=31||e===127)return!1}}function r(e){for(let t of e){let e=t.charCodeAt(0);if(e<=32||e>127||t===`(`||t===`)`||t===`>`||t===`<`||t===`@`||t===`,`||t===`;`||t===`:`||t===`\\`||t===`"`||t===`/`||t===`[`||t===`]`||t===`?`||t===`=`||t===`{`||t===`}`)throw Error(`Invalid cookie name`)}}function i(e){for(let t of e){let e=t.charCodeAt(0);if(e<33||e===34||e===44||e===59||e===92||e>126)throw Error(`Invalid header value`)}}function a(e){for(let t of e)if(t.charCodeAt(0)<33||t===`;`)throw Error(`Invalid cookie path`)}function o(e){if(e.startsWith(`-`)||e.endsWith(`.`)||e.endsWith(`-`))throw Error(`Invalid cookie domain`)}function s(e){return typeof e==`number`&&(e=new Date(e)),`${[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`][e.getUTCDay()]}, ${e.getUTCDate().toString().padStart(2,`0`)} ${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][e.getUTCMonth()]} ${e.getUTCFullYear()} ${e.getUTCHours().toString().padStart(2,`0`)}:${e.getUTCMinutes().toString().padStart(2,`0`)}:${e.getUTCSeconds().toString().padStart(2,`0`)} GMT`}function c(e){if(e<0)throw Error(`Invalid cookie max-age`)}function l(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`&&(c(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=${s(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:s,stringify:l}})),lt=b(((e,t)=>{let{maxNameValuePairSize:n,maxAttributeValueSize:r}=st(),{isCTLExcludingHtab:i}=ct(),{collectASequenceOfCodePointsFast:a}=ie(),o=w(`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}})),ut=b(((e,t)=>{let{parseSetCookie:n}=lt(),{stringify:r}=ct(),{webidl:i}=J(),{Headers:a}=Je();function o(e){i.argumentLengthCheck(arguments,1,{header:`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.argumentLengthCheck(arguments,2,{header:`deleteCookie`}),i.brandCheck(e,a,{strict:!1}),t=i.converters.DOMString(t),n=i.converters.DeleteCookieAttributes(n),l(e,{name:t,value:``,expires:new Date(0),...n})}function c(e){i.argumentLengthCheck(arguments,1,{header:`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,{header:`setCookie`}),i.brandCheck(e,a,{strict:!1}),t=i.converters.Cookie(t),r(t)&&e.append(`Set-Cookie`,r(t))}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}})),dt=b(((e,t)=>{t.exports={uid:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,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)}})),ft=b(((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`)}})),pt=b(((e,t)=>{let{webidl:n}=J(),{kEnumerableProperty:r}=P(),{MessagePort:i}=w(`worker_threads`);var a=class e extends Event{#e;constructor(e,t={}){n.argumentLengthCheck(arguments,1,{header:`MessageEvent constructor`}),e=n.converters.DOMString(e),t=n.converters.MessageEventInit(t),super(e,t),this.#e=t}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,{header:`MessageEvent.initMessageEvent`}),new e(t,{bubbles:r,cancelable:i,data:a,origin:o,lastEventId:s,source:c,ports:l})}},o=class e extends Event{#e;constructor(e,t={}){n.argumentLengthCheck(arguments,1,{header:`CloseEvent constructor`}),e=n.converters.DOMString(e),t=n.converters.CloseEventInit(t),super(e,t),this.#e=t}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}},s=class e extends Event{#e;constructor(e,t){n.argumentLengthCheck(arguments,1,{header:`ErrorEvent constructor`}),super(e,t),e=n.converters.DOMString(e),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(a.prototype,{[Symbol.toStringTag]:{value:`MessageEvent`,configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`CloseEvent`,configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(s.prototype,{[Symbol.toStringTag]:{value:`ErrorEvent`,configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),n.converters.MessagePort=n.interfaceConverter(i),n.converters[`sequence`]=n.sequenceConverter(n.converters.MessagePort);let c=[{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([...c,{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`],get defaultValue(){return[]}}]),n.converters.CloseEventInit=n.dictionaryConverter([...c,{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([...c,{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:a,CloseEvent:o,ErrorEvent:s}})),mt=b(((e,t)=>{let{kReadyState:n,kController:r,kResponse:i,kBinaryType:a,kWebSocketURL:o}=ft(),{states:s,opcodes:c}=dt(),{MessageEvent:l,ErrorEvent:u}=pt();function d(e){return e[n]===s.OPEN}function f(e){return e[n]===s.CLOSING}function p(e){return e[n]===s.CLOSED}function m(e,t,n=Event,r){let i=new n(e,r);t.dispatchEvent(i)}function h(e,t,r){if(e[n]!==s.OPEN)return;let i;if(t===c.TEXT)try{i=new TextDecoder(`utf-8`,{fatal:!0}).decode(r)}catch{v(e,`Received invalid UTF-8 in text frame.`);return}else t===c.BINARY&&(i=e[a]===`blob`?new Blob([r]):new Uint8Array(r).buffer);m(`message`,e,l,{origin:e[o].origin,data:i})}function g(e){if(e.length===0)return!1;for(let t of e){let e=t.charCodeAt(0);if(e<33||e>126||t===`(`||t===`)`||t===`<`||t===`>`||t===`@`||t===`,`||t===`;`||t===`:`||t===`\\`||t===`"`||t===`/`||t===`[`||t===`]`||t===`?`||t===`=`||t===`{`||t===`}`||e===32||e===9)return!1}return!0}function _(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function v(e,t){let{[r]:n,[i]:a}=e;n.abort(),a?.socket&&!a.socket.destroyed&&a.socket.destroy(),t&&m(`error`,e,u,{error:Error(t)})}t.exports={isEstablished:d,isClosing:f,isClosed:p,fireEvent:m,isValidSubprotocol:g,isValidStatusCode:_,failWebsocketConnection:v,websocketMessageReceived:h}})),ht=b(((e,t)=>{let n=w(`diagnostics_channel`),{uid:r,states:i}=dt(),{kReadyState:a,kSentClose:o,kByteParser:s,kReceivedClose:c}=ft(),{fireEvent:l,failWebsocketConnection:u}=mt(),{CloseEvent:d}=pt(),{makeRequest:f}=Xe(),{fetching:p}=Ze(),{Headers:m}=Je(),{getGlobalDispatcher:h}=Ke(),{kHeadersList:g}=j(),_={};_.open=n.channel(`undici:websocket:open`),_.close=n.channel(`undici:websocket:close`),_.socketError=n.channel(`undici:websocket:socket_error`);let v;try{v=w(`crypto`)}catch{}function y(e,t,n,i,a){let o=e;o.protocol=e.protocol===`ws:`?`http:`:`https:`;let s=f({urlList:[o],serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`});a.headers&&(s.headersList=new m(a.headers)[g]);let c=v.randomBytes(16).toString(`base64`);s.headersList.append(`sec-websocket-key`,c),s.headersList.append(`sec-websocket-version`,`13`);for(let e of t)s.headersList.append(`sec-websocket-protocol`,e);return p({request:s,useParallelQueue:!0,dispatcher:a.dispatcher??h(),processResponse(e){if(e.type===`error`||e.status!==101){u(n,`Received network error or non-101 status code.`);return}if(t.length!==0&&!e.headersList.get(`Sec-WebSocket-Protocol`)){u(n,`Server did not respond with sent protocols.`);return}if(e.headersList.get(`Upgrade`)?.toLowerCase()!==`websocket`){u(n,`Server did not set Upgrade header to "websocket".`);return}if(e.headersList.get(`Connection`)?.toLowerCase()!==`upgrade`){u(n,`Server did not set Connection header to "upgrade".`);return}if(e.headersList.get(`Sec-WebSocket-Accept`)!==v.createHash(`sha1`).update(c+r).digest(`base64`)){u(n,`Incorrect hash received in Sec-WebSocket-Accept header.`);return}let a=e.headersList.get(`Sec-WebSocket-Extensions`);if(a!==null&&a!==``){u(n,`Received different permessage-deflate than the one set.`);return}let o=e.headersList.get(`Sec-WebSocket-Protocol`);if(o!==null&&o!==s.headersList.get(`Sec-WebSocket-Protocol`)){u(n,`Protocol was not set in the opening handshake.`);return}e.socket.on(`data`,b),e.socket.on(`close`,x),e.socket.on(`error`,S),_.open.hasSubscribers&&_.open.publish({address:e.socket.address(),protocol:o,extensions:a}),i(e)}})}function b(e){this.ws[s].write(e)||this.pause()}function x(){let{ws:e}=this,t=e[o]&&e[c],n=1005,r=``,u=e[s].closingInfo;u?(n=u.code??1005,r=u.reason):e[o]||(n=1006),e[a]=i.CLOSED,l(`close`,e,d,{wasClean:t,code:n,reason:r}),_.close.hasSubscribers&&_.close.publish({websocket:e,code:n,reason:r})}function S(e){let{ws:t}=this;t[a]=i.CLOSING,_.socketError.hasSubscribers&&_.socketError.publish(e),this.destroy()}t.exports={establishWebSocketConnection:y}})),gt=b(((e,t)=>{let{maxUnsigned16Bit:n}=dt(),r;try{r=w(`crypto`)}catch{}t.exports={WebsocketFrameSend:class{constructor(e){this.frameData=e,this.maskKey=r.randomBytes(4)}createFrame(e){let t=this.frameData?.byteLength??0,r=t,i=6;t>n?(i+=8,r=127):t>125&&(i+=2,r=126);let a=Buffer.allocUnsafe(t+i);a[0]=a[1]=0,a[0]|=128,a[0]=(a[0]&240)+e,a[i-4]=this.maskKey[0],a[i-3]=this.maskKey[1],a[i-2]=this.maskKey[2],a[i-1]=this.maskKey[3],a[1]=r,r===126?a.writeUInt16BE(t,2):r===127&&(a[2]=a[3]=0,a.writeUIntBE(t,4,6)),a[1]|=128;for(let e=0;e{let{Writable:n}=w(`stream`),r=w(`diagnostics_channel`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s}=dt(),{kReadyState:c,kSentClose:l,kResponse:u,kReceivedClose:d}=ft(),{isValidStatusCode:f,failWebsocketConnection:p,websocketMessageReceived:m}=mt(),{WebsocketFrameSend:h}=gt(),g={};g.ping=r.channel(`undici:websocket:ping`),g.pong=r.channel(`undici:websocket:pong`),t.exports={ByteParser:class extends n{#e=[];#t=0;#n=i.INFO;#r={};#i=[];constructor(e){super(),this.ws=e}_write(e,t,n){this.#e.push(e),this.#t+=e.length,this.run(n)}run(e){for(;;){if(this.#n===i.INFO){if(this.#t<2)return e();let t=this.consume(2);if(this.#r.fin=(t[0]&128)!=0,this.#r.opcode=t[0]&15,this.#r.originalOpcode??=this.#r.opcode,this.#r.fragmented=!this.#r.fin&&this.#r.opcode!==a.CONTINUATION,this.#r.fragmented&&this.#r.opcode!==a.BINARY&&this.#r.opcode!==a.TEXT){p(this.ws,`Invalid frame type was fragmented.`);return}let n=t[1]&127;if(n<=125?(this.#r.payloadLength=n,this.#n=i.READ_DATA):n===126?this.#n=i.PAYLOADLENGTH_16:n===127&&(this.#n=i.PAYLOADLENGTH_64),this.#r.fragmented&&n>125){p(this.ws,`Fragmented frame exceeded 125 bytes.`);return}else if((this.#r.opcode===a.PING||this.#r.opcode===a.PONG||this.#r.opcode===a.CLOSE)&&n>125){p(this.ws,`Payload length for control frame exceeded 125 bytes.`);return}else if(this.#r.opcode===a.CLOSE){if(n===1){p(this.ws,`Received close frame with a 1-byte body.`);return}let e=this.consume(n);if(this.#r.closeInfo=this.parseCloseBody(!1,e),!this.ws[l]){let e=Buffer.allocUnsafe(2);e.writeUInt16BE(this.#r.closeInfo.code,0);let t=new h(e);this.ws[u].socket.write(t.createFrame(a.CLOSE),e=>{e||(this.ws[l]=!0)})}this.ws[c]=o.CLOSING,this.ws[d]=!0,this.end();return}else if(this.#r.opcode===a.PING){let t=this.consume(n);if(!this.ws[d]){let e=new h(t);this.ws[u].socket.write(e.createFrame(a.PONG)),g.ping.hasSubscribers&&g.ping.publish({payload:t})}if(this.#n=i.INFO,this.#t>0)continue;e();return}else if(this.#r.opcode===a.PONG){let t=this.consume(n);if(g.pong.hasSubscribers&&g.pong.publish({payload:t}),this.#t>0)continue;e();return}}else if(this.#n===i.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#r.payloadLength=t.readUInt16BE(0),this.#n=i.READ_DATA}else if(this.#n===i.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),n=t.readUInt32BE(0);if(n>2**31-1){p(this.ws,`Received payload length > 2^31 bytes.`);return}let r=t.readUInt32BE(4);this.#r.payloadLength=(n<<8)+r,this.#n=i.READ_DATA}else if(this.#n===i.READ_DATA){if(this.#t=this.#r.payloadLength){let e=this.consume(this.#r.payloadLength);if(this.#i.push(e),!this.#r.fragmented||this.#r.fin&&this.#r.opcode===a.CONTINUATION){let e=Buffer.concat(this.#i);m(this.ws,this.#r.originalOpcode,e),this.#r={},this.#i.length=0}this.#n=i.INFO}}if(!(this.#t>0)){e();break}}}consume(e){if(e>this.#t)return null;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,t){let n;if(t.length>=2&&(n=t.readUInt16BE(0)),e)return f(n)?{code:n}:null;let r=t.subarray(2);if(r[0]===239&&r[1]===187&&r[2]===191&&(r=r.subarray(3)),n!==void 0&&!f(n))return null;try{r=new TextDecoder(`utf-8`,{fatal:!0}).decode(r)}catch{return null}return{code:n,reason:r}}get closingInfo(){return this.#r.closeInfo}}}})),vt=b(((e,t)=>{let{webidl:n}=J(),{DOMException:r}=G(),{URLSerializer:i}=ie(),{getGlobalOrigin:a}=K(),{staticPropertyDescriptors:o,states:s,opcodes:c,emptyBuffer:l}=dt(),{kWebSocketURL:u,kReadyState:d,kController:f,kBinaryType:p,kResponse:m,kSentClose:h,kByteParser:g}=ft(),{isEstablished:_,isClosing:v,isValidSubprotocol:y,failWebsocketConnection:b,fireEvent:x}=mt(),{establishWebSocketConnection:S}=ht(),{WebsocketFrameSend:C}=gt(),{ByteParser:T}=_t(),{kEnumerableProperty:E,isBlobLike:D}=P(),{getGlobalDispatcher:O}=Ke(),{types:k}=w(`util`),A=!1;var j=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;constructor(t,i=[]){super(),n.argumentLengthCheck(arguments,1,{header:`WebSocket constructor`}),A||(A=!0,process.emitWarning(`WebSockets are experimental, expect them to change at any time.`,{code:`UNDICI-WS`}));let o=n.converters[`DOMString or sequence or WebSocketInit`](i);t=n.converters.USVString(t),i=o.protocols;let s=a(),c;try{c=new URL(t,s)}catch(e){throw new r(e,`SyntaxError`)}if(c.protocol===`http:`?c.protocol=`ws:`:c.protocol===`https:`&&(c.protocol=`wss:`),c.protocol!==`ws:`&&c.protocol!==`wss:`)throw new r(`Expected a ws: or wss: protocol, got ${c.protocol}`,`SyntaxError`);if(c.hash||c.href.endsWith(`#`))throw new r(`Got fragment`,`SyntaxError`);if(typeof i==`string`&&(i=[i]),i.length!==new Set(i.map(e=>e.toLowerCase())).size||i.length>0&&!i.every(e=>y(e)))throw new r(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this[u]=new URL(c.href),this[f]=S(c,i,this,e=>this.#i(e),o),this[d]=e.CONNECTING,this[p]=`blob`}close(t=void 0,i=void 0){if(n.brandCheck(this,e),t!==void 0&&(t=n.converters[`unsigned short`](t,{clamp:!0})),i!==void 0&&(i=n.converters.USVString(i)),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new r(`invalid code`,`InvalidAccessError`);let a=0;if(i!==void 0&&(a=Buffer.byteLength(i),a>123))throw new r(`Reason must be less than 123 bytes; received ${a}`,`SyntaxError`);if(!(this[d]===e.CLOSING||this[d]===e.CLOSED))if(!_(this))b(this,`Connection was closed before it was established.`),this[d]=e.CLOSING;else if(v(this))this[d]=e.CLOSING;else{let e=new C;t!==void 0&&i===void 0?(e.frameData=Buffer.allocUnsafe(2),e.frameData.writeUInt16BE(t,0)):t!==void 0&&i!==void 0?(e.frameData=Buffer.allocUnsafe(2+a),e.frameData.writeUInt16BE(t,0),e.frameData.write(i,2,`utf-8`)):e.frameData=l,this[m].socket.write(e.createFrame(c.CLOSE),e=>{e||(this[h]=!0)}),this[d]=s.CLOSING}}send(t){if(n.brandCheck(this,e),n.argumentLengthCheck(arguments,1,{header:`WebSocket.send`}),t=n.converters.WebSocketSendData(t),this[d]===e.CONNECTING)throw new r(`Sent before connected.`,`InvalidStateError`);if(!_(this)||v(this))return;let i=this[m].socket;if(typeof t==`string`){let e=Buffer.from(t),n=new C(e).createFrame(c.TEXT);this.#t+=e.byteLength,i.write(n,()=>{this.#t-=e.byteLength})}else if(k.isArrayBuffer(t)){let e=Buffer.from(t),n=new C(e).createFrame(c.BINARY);this.#t+=e.byteLength,i.write(n,()=>{this.#t-=e.byteLength})}else if(ArrayBuffer.isView(t)){let e=Buffer.from(t,t.byteOffset,t.byteLength),n=new C(e).createFrame(c.BINARY);this.#t+=e.byteLength,i.write(n,()=>{this.#t-=e.byteLength})}else if(D(t)){let e=new C;t.arrayBuffer().then(t=>{let n=Buffer.from(t);e.frameData=n;let r=e.createFrame(c.BINARY);this.#t+=n.byteLength,i.write(r,()=>{this.#t-=n.byteLength})})}}get readyState(){return n.brandCheck(this,e),this[d]}get bufferedAmount(){return n.brandCheck(this,e),this.#t}get url(){return n.brandCheck(this,e),i(this[u])}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[p]}set binaryType(t){n.brandCheck(this,e),t!==`blob`&&t!==`arraybuffer`?this[p]=`blob`:this[p]=t}#i(e){this[m]=e;let t=new T(this);t.on(`drain`,function(){this.ws[m].socket.resume()}),e.socket.ws=this,this[g]=t,this[d]=s.OPEN;let n=e.headersList.get(`sec-websocket-extensions`);n!==null&&(this.#r=n);let r=e.headersList.get(`sec-websocket-protocol`);r!==null&&(this.#n=r),x(`open`,this)}};j.CONNECTING=j.prototype.CONNECTING=s.CONNECTING,j.OPEN=j.prototype.OPEN=s.OPEN,j.CLOSING=j.prototype.CLOSING=s.CLOSING,j.CLOSED=j.prototype.CLOSED=s.CLOSED,Object.defineProperties(j.prototype,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o,url:E,readyState:E,bufferedAmount:E,onopen:E,onerror:E,onclose:E,close:E,onmessage:E,binaryType:E,send:E,extensions:E,protocol:E,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(j,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o}),n.converters[`sequence`]=n.sequenceConverter(n.converters.DOMString),n.converters[`DOMString or sequence`]=function(e){return n.util.Type(e)===`Object`&&Symbol.iterator in e?n.converters[`sequence`](e):n.converters.DOMString(e)},n.converters.WebSocketInit=n.dictionaryConverter([{key:`protocols`,converter:n.converters[`DOMString or sequence`],get defaultValue(){return[]}},{key:`dispatcher`,converter:e=>e,get defaultValue(){return O()}},{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(D(e))return n.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||k.isAnyArrayBuffer(e))return n.converters.BufferSource(e)}return n.converters.USVString(e)},t.exports={WebSocket:j}})),yt=b(((e,t)=>{let n=ve(),r=le(),i=M(),a=Se(),o=Ce(),s=Te(),c=P(),{InvalidArgumentError:l}=i,u=Pe(),d=de(),f=ze(),p=Ue(),m=Be(),h=Fe(),g=We(),_=Ge(),{getGlobalDispatcher:v,setGlobalDispatcher:y}=Ke(),b=qe(),x=me(),S=he(),C;try{w(`crypto`),C=!0}catch{C=!1}Object.assign(r.prototype,u),t.exports.Dispatcher=r,t.exports.Client=n,t.exports.Pool=a,t.exports.BalancedPool=o,t.exports.Agent=s,t.exports.ProxyAgent=g,t.exports.RetryHandler=_,t.exports.DecoratorHandler=b,t.exports.RedirectHandler=x,t.exports.createRedirectInterceptor=S,t.exports.buildConnector=d,t.exports.errors=i;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 l(`invalid url`);if(n!=null&&typeof n!=`object`)throw new l(`invalid opts`);if(n&&n.path!=null){if(typeof n.path!=`string`)throw new l(`invalid opts.path`);let e=n.path;n.path.startsWith(`/`)||(e=`/${e}`),t=new URL(c.parseOrigin(t).origin+e)}else n||=typeof t==`object`?t:{},t=c.parseURL(t);let{agent:i,dispatcher:a=v()}=n;if(i)throw new l(`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)}}if(t.exports.setGlobalDispatcher=y,t.exports.getGlobalDispatcher=v,c.nodeMajor>16||c.nodeMajor===16&&c.nodeMinor>=8){let e=null;t.exports.fetch=async function(t){e||=Ze().fetch;try{return await e(...arguments)}catch(e){throw typeof e==`object`&&Error.captureStackTrace(e,this),e}},t.exports.Headers=Je().Headers,t.exports.Response=Ye().Response,t.exports.Request=Xe().Request,t.exports.FormData=oe().FormData,t.exports.File=ae().File,t.exports.FileReader=nt().FileReader;let{setGlobalOrigin:n,getGlobalOrigin:r}=K();t.exports.setGlobalOrigin=n,t.exports.getGlobalOrigin=r;let{CacheStorage:i}=ot(),{kConstruct:a}=rt();t.exports.caches=new i(a)}if(c.nodeMajor>=16){let{deleteCookie:e,getCookies:n,getSetCookies:r,setCookie:i}=ut();t.exports.deleteCookie=e,t.exports.getCookies=n,t.exports.getSetCookies=r,t.exports.setCookie=i;let{parseMIMEType:a,serializeAMimeType:o}=ie();t.exports.parseMIMEType=a,t.exports.serializeAMimeType=o}if(c.nodeMajor>=18&&C){let{WebSocket:e}=vt();t.exports.WebSocket=e}t.exports.request=T(u.request),t.exports.stream=T(u.stream),t.exports.pipeline=T(u.pipeline),t.exports.connect=T(u.connect),t.exports.upgrade=T(u.upgrade),t.exports.MockClient=f,t.exports.MockPool=m,t.exports.MockAgent=p,t.exports.mockErrors=h})),bt=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.HttpClient=e.isHttps=e.HttpClientResponse=e.HttpClientError=e.getProxyUrl=e.MediaTypes=e.Headers=e.HttpCodes=void 0;let a=r(w(`http`)),o=r(w(`https`)),s=r(O()),c=r(A()),l=yt();var u;(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`})(u||(e.HttpCodes=u={}));var d;(function(e){e.Accept=`accept`,e.ContentType=`content-type`})(d||(e.Headers=d={}));var f;(function(e){e.ApplicationJson=`application/json`})(f||(e.MediaTypes=f={}));function p(e){let t=s.getProxyUrl(new URL(e));return t?t.href:``}e.getProxyUrl=p;let m=[u.MovedPermanently,u.ResourceMoved,u.SeeOther,u.TemporaryRedirect,u.PermanentRedirect],h=[u.BadGateway,u.ServiceUnavailable,u.GatewayTimeout],g=[`OPTIONS`,`GET`,`DELETE`,`HEAD`];var _=class e extends Error{constructor(t,n){super(t),this.name=`HttpClientError`,this.statusCode=n,Object.setPrototypeOf(this,e.prototype)}};e.HttpClientError=_;var v=class{constructor(e){this.message=e}readBody(){return i(this,void 0,void 0,function*(){return new Promise(e=>i(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 i(this,void 0,void 0,function*(){return new Promise(e=>i(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}};e.HttpClientResponse=v;function y(e){return new URL(e).protocol===`https:`}e.isHttps=y,e.HttpClient=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=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 i(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return i(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return i(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return i(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return i(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e,t={}){return i(this,void 0,void 0,function*(){t[d.Accept]=this._getExistingOrDefaultHeader(t,d.Accept,f.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t,n={}){return i(this,void 0,void 0,function*(){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,f.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t,n={}){return i(this,void 0,void 0,function*(){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,f.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t,n={}){return i(this,void 0,void 0,function*(){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,f.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return i(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&&g.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===u.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&&m.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||!h.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 v(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=s.getProxyUrl(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?o:a;let s=i?443:80;if(r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):s,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({},b(this.requestOptions.headers),b(e||{})):b(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;return this.requestOptions&&this.requestOptions.headers&&(r=b(this.requestOptions.headers)[t]),e[t]||r||n}_getAgent(e){let t,n=s.getProxyUrl(e),r=n&&n.hostname;if(this._keepAlive&&r&&(t=this._proxyAgent),r||(t=this._agent),t)return t;let i=e.protocol===`https:`,l=100;if(this.requestOptions&&(l=this.requestOptions.maxSockets||a.globalAgent.maxSockets),n&&n.hostname){let e={maxSockets:l,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},r,a=n.protocol===`https:`;r=i?a?c.httpsOverHttps:c.httpsOverHttp:a?c.httpOverHttps:c.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:l};t=i?new o.Agent(e):new a.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 l.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}_performExponentialBackoff(e){return i(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 i(this,void 0,void 0,function*(){return new Promise((n,r)=>i(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===u.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 _(e,i);t.result=a.result,r(t)}else n(a)}))})}};let b=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{})})),xt=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.PersonalAccessTokenCredentialHandler=e.BearerCredentialHandler=e.BasicCredentialHandler=void 0,e.BasicCredentialHandler=class{constructor(e,t){this.username=e,this.password=t}prepareRequest(e){if(!e.headers)throw Error(`The request has no headers`);e.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString(`base64`)}`}canHandleAuthentication(){return!1}handleAuthentication(){return t(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},e.BearerCredentialHandler=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 t(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},e.PersonalAccessTokenCredentialHandler=class{constructor(e){this.token=e}prepareRequest(e){if(!e.headers)throw Error(`The request has no headers`);e.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString(`base64`)}`}canHandleAuthentication(){return!1}handleAuthentication(){return t(this,void 0,void 0,function*(){throw Error(`not implemented`)})}}})),St=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.OidcClient=void 0;let n=bt(),r=xt(),i=At();e.OidcClient=class e{static createHttpClient(t=!0,i=10){let a={allowRetries:t,maxRetries:i};return new n.HttpClient(`actions/oidc-client`,[new r.BearerCredentialHandler(e.getRequestToken())],a)}static getRequestToken(){let e=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!e)throw Error(`Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable`);return e}static getIDTokenUrl(){let e=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!e)throw Error(`Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable`);return e}static getCall(n){return t(this,void 0,void 0,function*(){let t=(yield e.createHttpClient().getJson(n).catch(e=>{throw Error(`Failed to get ID Token. \n +`.trim())}}})),We=b(((e,t)=>{let{kProxy:n,kClose:r,kDestroy:i,kInterceptors:a}=j(),{URL:o}=w(`url`),s=Te(),c=Se(),l=ue(),{InvalidArgumentError:u,RequestAbortedError:d}=M(),f=de(),p=Symbol(`proxy agent`),m=Symbol(`proxy client`),h=Symbol(`proxy headers`),g=Symbol(`request tls settings`),_=Symbol(`proxy tls settings`),v=Symbol(`connect endpoint function`);function y(e){return e===`https:`?443:80}function b(e){if(typeof e==`string`&&(e={uri:e}),!e||!e.uri)throw new u(`Proxy opts.uri is mandatory`);return{uri:e.uri,protocol:e.protocol||`https`}}function x(e,t){return new c(e,t)}var S=class extends l{constructor(e){if(super(e),this[n]=b(e),this[p]=new s(e),this[a]=e.interceptors&&e.interceptors.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],typeof e==`string`&&(e={uri:e}),!e||!e.uri)throw new u(`Proxy opts.uri is mandatory`);let{clientFactory:t=x}=e;if(typeof t!=`function`)throw new u(`Proxy opts.clientFactory must be a function.`);this[g]=e.requestTls,this[_]=e.proxyTls,this[h]=e.headers||{};let r=new o(e.uri),{origin:i,port:c,host:l,username:S,password:C}=r;if(e.auth&&e.token)throw new u(`opts.auth cannot be used in combination with opts.token`);e.auth?this[h][`proxy-authorization`]=`Basic ${e.auth}`:e.token?this[h][`proxy-authorization`]=e.token:S&&C&&(this[h][`proxy-authorization`]=`Basic ${Buffer.from(`${decodeURIComponent(S)}:${decodeURIComponent(C)}`).toString(`base64`)}`);let w=f({...e.proxyTls});this[v]=f({...e.requestTls}),this[m]=t(r,{connect:w}),this[p]=new s({...e,connect:async(e,t)=>{let n=e.host;e.port||(n+=`:${y(e.protocol)}`);try{let{socket:r,statusCode:a}=await this[m].connect({origin:i,port:c,path:n,signal:e.signal,headers:{...this[h],host:l}});if(a!==200&&(r.on(`error`,()=>{}).destroy(),t(new d(`Proxy response (${a}) !== 200 when HTTP Tunneling`))),e.protocol!==`https:`){t(null,r);return}let o;o=this[g]?this[g].servername:e.servername,this[v]({...e,servername:o,httpSocket:r},t)}catch(e){t(e)}}})}dispatch(e,t){let{host:n}=new o(e.origin),r=C(e.headers);return T(r),this[p].dispatch({...e,headers:{...r,host:n}},t)}async[r](){await this[p].close(),await this[m].close()}async[i](){await this[p].destroy(),await this[m].destroy()}};function C(e){if(Array.isArray(e)){let t={};for(let n=0;ne.toLowerCase()===`proxy-authorization`))throw new u(`Proxy-Authorization should be sent in ProxyAgent constructor`)}t.exports=S})),Ge=b(((e,t)=>{let n=w(`assert`),{kRetryHandlerDefaultRetry:r}=j(),{RequestRetryError:i}=M(),{isDisturbed:a,parseHeaders:o,parseRangeHeader:s}=P();function c(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:c,minTimeout:l,timeoutFactor:u,methods:d,errorCodes:f,retryAfter:p,statusCodes:m}=i??{};this.dispatch=n.dispatch,this.handler=n.handler,this.opts=a,this.abort=null,this.aborted=!1,this.retryOpts={retry:o??e[r],retryAfter:p??!0,maxTimeout:c??30*1e3,timeout:l??500,timeoutFactor:u??2,maxRetries:s??5,methods:d??[`GET`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`TRACE`],statusCodes:m??[500,502,503,504,429],errorCodes:f??[`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`]},this.retryCount=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:l}=n,{maxRetries:u,timeout:d,maxTimeout:f,timeoutFactor:p,statusCodes:m,errorCodes:h,methods:g}=l,{counter:_,currentTimeout:v}=t;if(v=v!=null&&v>0?v:d,a&&a!==`UND_ERR_REQ_RETRY`&&a!==`UND_ERR_SOCKET`&&!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 y=o!=null&&o[`retry-after`];y&&=(y=Number(y),isNaN(y)?c(y):y*1e3);let b=Math.min(y>0?y:v*p**_,f);t.currentTimeout=b,setTimeout(()=>r(null),b)}onHeaders(e,t,r,a){let c=o(t);if(this.retryCount+=1,e>=300)return this.abort(new i(`Request failed`,e,{headers:c,count:this.retryCount})),!1;if(this.resume!=null){if(this.resume=null,e!==206)return!0;let t=s(c[`content-range`]);if(!t)return this.abort(new i(`Content-Range mismatch`,e,{headers:c,count:this.retryCount})),!1;if(this.etag!=null&&this.etag!==c.etag)return this.abort(new i(`ETag mismatch`,e,{headers:c,count:this.retryCount})),!1;let{start:a,size:o,end:l=o}=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}=i;n(o!=null&&Number.isFinite(o)&&this.start!==o,`content-range mismatch`),n(Number.isFinite(o)),n(u!=null&&Number.isFinite(u)&&this.end!==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)}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.handler.onHeaders(e,t,r,a)}let l=new i(`Request failed`,e,{headers:c,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.retryOpts.retry(e,{state:{counter:this.retryCount++,currentTimeout:this.retryAfter},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);this.start!==0&&(this.opts={...this.opts,headers:{...this.opts.headers,range:`bytes=${this.start}-${this.end??``}`}});try{this.dispatch(this.opts,this)}catch(e){this.handler.onError(e)}}}}})),Ke=b(((e,t)=>{let n=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:r}=M(),i=Te();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}})),qe=b(((e,t)=>{t.exports=class{constructor(e){this.handler=e}onConnect(...e){return this.handler.onConnect(...e)}onError(...e){return this.handler.onError(...e)}onUpgrade(...e){return this.handler.onUpgrade(...e)}onHeaders(...e){return this.handler.onHeaders(...e)}onData(...e){return this.handler.onData(...e)}onComplete(...e){return this.handler.onComplete(...e)}onBodySent(...e){return this.handler.onBodySent(...e)}}})),Je=b(((e,t)=>{let{kHeadersList:n,kConstruct:r}=j(),{kGuard:i}=q(),{kEnumerableProperty:a}=P(),{makeIterator:o,isValidHeaderName:s,isValidHeaderValue:c}=re(),l=w(`util`),{webidl:u}=J(),d=w(`assert`),f=Symbol(`headers map`),p=Symbol(`headers map sorted`);function m(e){return e===10||e===13||e===9||e===32}function h(e){let t=0,n=e.length;for(;n>t&&m(e.charCodeAt(n-1));)--n;for(;n>t&&m(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function g(e,t){if(Array.isArray(t))for(let n=0;n>`,`record`]})}function _(e,t,r){if(r=h(r),!s(t))throw u.errors.invalidArgument({prefix:`Headers.append`,value:t,type:`header name`});if(!c(r))throw u.errors.invalidArgument({prefix:`Headers.append`,value:r,type:`header value`});if(e[i]===`immutable`)throw TypeError(`immutable`);return e[i],e[n].append(t,r)}var v=class e{cookies=null;constructor(t){t instanceof e?(this[f]=new Map(t[f]),this[p]=t[p],this.cookies=t.cookies===null?null:[...t.cookies]):(this[f]=new Map(t),this[p]=null)}contains(e){return e=e.toLowerCase(),this[f].has(e)}clear(){this[f].clear(),this[p]=null,this.cookies=null}append(e,t){this[p]=null;let n=e.toLowerCase(),r=this[f].get(n);if(r){let e=n===`cookie`?`; `:`, `;this[f].set(n,{name:r.name,value:`${r.value}${e}${t}`})}else this[f].set(n,{name:e,value:t});n===`set-cookie`&&(this.cookies??=[],this.cookies.push(t))}set(e,t){this[p]=null;let n=e.toLowerCase();n===`set-cookie`&&(this.cookies=[t]),this[f].set(n,{name:e,value:t})}delete(e){this[p]=null,e=e.toLowerCase(),e===`set-cookie`&&(this.cookies=null),this[f].delete(e)}get(e){let t=this[f].get(e.toLowerCase());return t===void 0?null:t.value}*[Symbol.iterator](){for(let[e,{value:t}]of this[f])yield[e,t]}get entries(){let e={};if(this[f].size)for(let{name:t,value:n}of this[f].values())e[t]=n;return e}},y=class e{constructor(e=void 0){e!==r&&(this[n]=new v,this[i]=`none`,e!==void 0&&(e=u.converters.HeadersInit(e),g(this,e)))}append(t,n){return u.brandCheck(this,e),u.argumentLengthCheck(arguments,2,{header:`Headers.append`}),t=u.converters.ByteString(t),n=u.converters.ByteString(n),_(this,t,n)}delete(t){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`Headers.delete`}),t=u.converters.ByteString(t),!s(t))throw u.errors.invalidArgument({prefix:`Headers.delete`,value:t,type:`header name`});if(this[i]===`immutable`)throw TypeError(`immutable`);this[i],this[n].contains(t)&&this[n].delete(t)}get(t){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`Headers.get`}),t=u.converters.ByteString(t),!s(t))throw u.errors.invalidArgument({prefix:`Headers.get`,value:t,type:`header name`});return this[n].get(t)}has(t){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`Headers.has`}),t=u.converters.ByteString(t),!s(t))throw u.errors.invalidArgument({prefix:`Headers.has`,value:t,type:`header name`});return this[n].contains(t)}set(t,r){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,2,{header:`Headers.set`}),t=u.converters.ByteString(t),r=u.converters.ByteString(r),r=h(r),!s(t))throw u.errors.invalidArgument({prefix:`Headers.set`,value:t,type:`header name`});if(!c(r))throw u.errors.invalidArgument({prefix:`Headers.set`,value:r,type:`header value`});if(this[i]===`immutable`)throw TypeError(`immutable`);this[i],this[n].set(t,r)}getSetCookie(){u.brandCheck(this,e);let t=this[n].cookies;return t?[...t]:[]}get[p](){if(this[n][p])return this[n][p];let e=[],t=[...this[n]].sort((e,t)=>e[0]e,`Headers`,`key`)}return o(()=>[...this[p].values()],`Headers`,`key`)}values(){if(u.brandCheck(this,e),this[i]===`immutable`){let e=this[p];return o(()=>e,`Headers`,`value`)}return o(()=>[...this[p].values()],`Headers`,`value`)}entries(){if(u.brandCheck(this,e),this[i]===`immutable`){let e=this[p];return o(()=>e,`Headers`,`key+value`)}return o(()=>[...this[p].values()],`Headers`,`key+value`)}forEach(t,n=globalThis){if(u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`Headers.forEach`}),typeof t!=`function`)throw TypeError(`Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.`);for(let[e,r]of this)t.apply(n,[r,e,this])}[Symbol.for(`nodejs.util.inspect.custom`)](){return u.brandCheck(this,e),this[n]}};y.prototype[Symbol.iterator]=y.prototype.entries,Object.defineProperties(y.prototype,{append:a,delete:a,get:a,has:a,set:a,getSetCookie:a,keys:a,values:a,entries:a,forEach:a,[Symbol.iterator]:{enumerable:!1},[Symbol.toStringTag]:{value:`Headers`,configurable:!0},[l.inspect.custom]:{enumerable:!1}}),u.converters.HeadersInit=function(e){if(u.util.Type(e)===`Object`)return e[Symbol.iterator]?u.converters[`sequence>`](e):u.converters[`record`](e);throw u.errors.conversionFailed({prefix:`Headers constructor`,argument:`Argument 1`,types:[`sequence>`,`record`]})},t.exports={fill:g,Headers:y,HeadersList:v}})),Ye=b(((e,t)=>{let{Headers:n,HeadersList:r,fill:i}=Je(),{extractBody:a,cloneBody:o,mixinBody:s}=se(),c=P(),{kEnumerableProperty:l}=c,{isValidReasonPhrase:u,isCancelled:d,isAborted:f,isBlobLike:p,serializeJavascriptValueToJSONString:m,isErrorLike:h,isomorphicEncode:g}=re(),{redirectStatusSet:_,nullBodyStatus:v,DOMException:y}=G(),{kState:b,kHeaders:x,kGuard:S,kRealm:C}=q(),{webidl:T}=J(),{FormData:E}=oe(),{getGlobalOrigin:D}=K(),{URLSerializer:O}=ie(),{kHeadersList:k,kConstruct:A}=j(),M=w(`assert`),{types:N}=w(`util`),F=globalThis.ReadableStream||w(`stream/web`).ReadableStream,I=new TextEncoder(`utf-8`);var L=class e{static error(){let t={settingsObject:{}},n=new e;return n[b]=B(),n[C]=t,n[x][k]=n[b].headersList,n[x][S]=`immutable`,n[x][C]=t,n}static json(t,n={}){T.argumentLengthCheck(arguments,1,{header:`Response.json`}),n!==null&&(n=T.converters.ResponseInit(n));let r=a(I.encode(m(t))),i={settingsObject:{}},o=new e;return o[C]=i,o[x][S]=`response`,o[x][C]=i,ne(o,n,{body:r[0],type:`application/json`}),o}static redirect(t,n=302){let r={settingsObject:{}};T.argumentLengthCheck(arguments,1,{header:`Response.redirect`}),t=T.converters.USVString(t),n=T.converters[`unsigned short`](n);let i;try{i=new URL(t,D())}catch(e){throw Object.assign(TypeError(`Failed to parse URL from `+t),{cause:e})}if(!_.has(n))throw RangeError(`Invalid status code `+n);let a=new e;a[C]=r,a[x][S]=`immutable`,a[x][C]=r,a[b].status=n;let o=g(O(i));return a[b].headersList.append(`location`,o),a}constructor(e=null,t={}){e!==null&&(e=T.converters.BodyInit(e)),t=T.converters.ResponseInit(t),this[C]={settingsObject:{}},this[b]=z({}),this[x]=new n(A),this[x][S]=`response`,this[x][k]=this[b].headersList,this[x][C]=this[C];let r=null;if(e!=null){let[t,n]=a(e);r={body:t,type:n}}ne(this,t,r)}get type(){return T.brandCheck(this,e),this[b].type}get url(){T.brandCheck(this,e);let t=this[b].urlList,n=t[t.length-1]??null;return n===null?``:O(n,!0)}get redirected(){return T.brandCheck(this,e),this[b].urlList.length>1}get status(){return T.brandCheck(this,e),this[b].status}get ok(){return T.brandCheck(this,e),this[b].status>=200&&this[b].status<=299}get statusText(){return T.brandCheck(this,e),this[b].statusText}get headers(){return T.brandCheck(this,e),this[x]}get body(){return T.brandCheck(this,e),this[b].body?this[b].body.stream:null}get bodyUsed(){return T.brandCheck(this,e),!!this[b].body&&c.isDisturbed(this[b].body.stream)}clone(){if(T.brandCheck(this,e),this.bodyUsed||this.body&&this.body.locked)throw T.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let t=R(this[b]),n=new e;return n[b]=t,n[C]=this[C],n[x][k]=t.headersList,n[x][S]=this[x][S],n[x][C]=this[x][C],n}};s(L),Object.defineProperties(L.prototype,{type:l,url:l,status:l,ok:l,redirected:l,statusText:l,headers:l,clone:l,body:l,bodyUsed:l,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(L,{json:l,redirect:l,error:l});function R(e){if(e.internalResponse)return ee(R(e.internalResponse),e.type);let t=z({...e,body:null});return e.body!=null&&(t.body=o(e.body)),t}function z(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 B(e){return z({type:`error`,status:0,error:h(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function V(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 M(!(n in t)),e[n]=r,!0}})}function ee(e,t){if(t===`basic`)return V(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return V(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return V(e,{type:`opaque`,urlList:Object.freeze([]),status:0,statusText:``,body:null});if(t===`opaqueredirect`)return V(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});M(!1)}function te(e,t=null){return M(d(e)),f(e)?B(Object.assign(new y(`The operation was aborted.`,`AbortError`),{cause:t})):B(Object.assign(new y(`Request was cancelled.`),{cause:t}))}function ne(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&&!u(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(e[b].status=t.status),`statusText`in t&&t.statusText!=null&&(e[b].statusText=t.statusText),`headers`in t&&t.headers!=null&&i(e[x],t.headers),n){if(v.includes(e.status))throw T.errors.exception({header:`Response constructor`,message:`Invalid response status code `+e.status});e[b].body=n.body,n.type!=null&&!e[b].headersList.contains(`Content-Type`)&&e[b].headersList.append(`content-type`,n.type)}}T.converters.ReadableStream=T.interfaceConverter(F),T.converters.FormData=T.interfaceConverter(E),T.converters.URLSearchParams=T.interfaceConverter(URLSearchParams),T.converters.XMLHttpRequestBodyInit=function(e){return typeof e==`string`?T.converters.USVString(e):p(e)?T.converters.Blob(e,{strict:!1}):N.isArrayBuffer(e)||N.isTypedArray(e)||N.isDataView(e)?T.converters.BufferSource(e):c.isFormDataLike(e)?T.converters.FormData(e,{strict:!1}):e instanceof URLSearchParams?T.converters.URLSearchParams(e):T.converters.DOMString(e)},T.converters.BodyInit=function(e){return e instanceof F?T.converters.ReadableStream(e):e?.[Symbol.asyncIterator]?e:T.converters.XMLHttpRequestBodyInit(e)},T.converters.ResponseInit=T.dictionaryConverter([{key:`status`,converter:T.converters[`unsigned short`],defaultValue:200},{key:`statusText`,converter:T.converters.ByteString,defaultValue:``},{key:`headers`,converter:T.converters.HeadersInit}]),t.exports={makeNetworkError:B,makeResponse:z,makeAppropriateNetworkError:te,filterResponse:ee,Response:L,cloneResponse:R}})),Xe=b(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i}=se(),{Headers:a,fill:o,HeadersList:s}=Je(),{FinalizationRegistry:c}=we()(),l=P(),{isValidHTTPToken:u,sameOrigin:d,normalizeMethod:f,makePolicyContainer:p,normalizeMethodRecord:m}=re(),{forbiddenMethodsSet:h,corsSafeListedMethodsSet:g,referrerPolicy:_,requestRedirect:v,requestMode:y,requestCredentials:b,requestCache:x,requestDuplex:S}=G(),{kEnumerableProperty:C}=l,{kHeaders:T,kSignal:E,kState:D,kGuard:O,kRealm:k}=q(),{webidl:A}=J(),{getGlobalOrigin:M}=K(),{URLSerializer:N}=ie(),{kHeadersList:F,kConstruct:I}=j(),L=w(`assert`),{getMaxListeners:R,setMaxListeners:z,getEventListeners:B,defaultMaxListeners:V}=w(`events`),ee=globalThis.TransformStream,te=Symbol(`abortController`),ne=new c(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)});var H=class e{constructor(t,r={}){if(t===I)return;A.argumentLengthCheck(arguments,1,{header:`Request constructor`}),t=A.converters.RequestInfo(t),r=A.converters.RequestInit(r),this[k]={settingsObject:{baseUrl:M(),get origin(){return this.baseUrl?.origin},policyContainer:p()}};let i=null,c=null,_=this[k].settingsObject.baseUrl,v=null;if(typeof t==`string`){let e;try{e=new URL(t,_)}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);i=U({urlList:[e]}),c=`cors`}else L(t instanceof e),i=t[D],v=t[E];let y=this[k].settingsObject.origin,b=`client`;if(i.window?.constructor?.name===`EnvironmentSettingsObject`&&d(i.window,y)&&(b=i.window),r.window!=null)throw TypeError(`'window' option '${b}' must be null`);`window`in r&&(b=`no-window`),i=U({method:i.method,headersList:i.headersList,unsafeRequest:i.unsafeRequest,client:this[k].settingsObject,window:b,priority:i.priority,origin:i.origin,referrer:i.referrer,referrerPolicy:i.referrerPolicy,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,integrity:i.integrity,keepalive:i.keepalive,reloadNavigation:i.reloadNavigation,historyNavigation:i.historyNavigation,urlList:[...i.urlList]});let x=Object.keys(r).length!==0;if(x&&(i.mode===`navigate`&&(i.mode=`same-origin`),i.reloadNavigation=!1,i.historyNavigation=!1,i.origin=`client`,i.referrer=`client`,i.referrerPolicy=``,i.url=i.urlList[i.urlList.length-1],i.urlList=[i.url]),r.referrer!==void 0){let e=r.referrer;if(e===``)i.referrer=`no-referrer`;else{let t;try{t=new URL(e,_)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||y&&!d(t,this[k].settingsObject.baseUrl)?i.referrer=`client`:i.referrer=t}}r.referrerPolicy!==void 0&&(i.referrerPolicy=r.referrerPolicy);let S;if(S=r.mode===void 0?c:r.mode,S===`navigate`)throw A.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(S!=null&&(i.mode=S),r.credentials!==void 0&&(i.credentials=r.credentials),r.cache!==void 0&&(i.cache=r.cache),i.cache===`only-if-cached`&&i.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(r.redirect!==void 0&&(i.redirect=r.redirect),r.integrity!=null&&(i.integrity=String(r.integrity)),r.keepalive!==void 0&&(i.keepalive=!!r.keepalive),r.method!==void 0){let e=r.method;if(!u(e))throw TypeError(`'${e}' is not a valid HTTP method.`);if(h.has(e.toUpperCase()))throw TypeError(`'${e}' HTTP method is unsupported.`);e=m[e]??f(e),i.method=e}r.signal!==void 0&&(v=r.signal),this[D]=i;let C=new AbortController;if(this[E]=C.signal,this[E][k]=this[k],v!=null){if(!v||typeof v.aborted!=`boolean`||typeof v.addEventListener!=`function`)throw TypeError(`Failed to construct 'Request': member signal is not of type AbortSignal.`);if(v.aborted)C.abort(v.reason);else{this[te]=C;let e=new WeakRef(C),t=function(){let t=e.deref();t!==void 0&&t.abort(this.reason)};try{(typeof R==`function`&&R(v)===V||B(v,`abort`).length>=V)&&z(100,v)}catch{}l.addAbortListener(v,t),ne.register(C,{signal:v,abort:t})}}if(this[T]=new a(I),this[T][F]=i.headersList,this[T][O]=`request`,this[T][k]=this[k],S===`no-cors`){if(!g.has(i.method))throw TypeError(`'${i.method} is unsupported in no-cors mode.`);this[T][O]=`request-no-cors`}if(x){let e=this[T][F],t=r.headers===void 0?new s(e):r.headers;if(e.clear(),t instanceof s){for(let[n,r]of t)e.append(n,r);e.cookies=t.cookies}else o(this[T],t)}let j=t instanceof e?t[D].body:null;if((r.body!=null||j!=null)&&(i.method===`GET`||i.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let N=null;if(r.body!=null){let[e,t]=n(r.body,i.keepalive);N=e,t&&!this[T][F].contains(`content-type`)&&this[T].append(`content-type`,t)}let P=N??j;if(P!=null&&P.source==null){if(N!=null&&r.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(i.mode!==`same-origin`&&i.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);i.useCORSPreflightFlag=!0}let H=P;if(N==null&&j!=null){if(l.isDisturbed(j.stream)||j.stream.locked)throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);ee||=w(`stream/web`).TransformStream;let e=new ee;j.stream.pipeThrough(e),H={source:j.source,length:j.length,stream:e.readable}}this[D].body=H}get method(){return A.brandCheck(this,e),this[D].method}get url(){return A.brandCheck(this,e),N(this[D].url)}get headers(){return A.brandCheck(this,e),this[T]}get destination(){return A.brandCheck(this,e),this[D].destination}get referrer(){return A.brandCheck(this,e),this[D].referrer===`no-referrer`?``:this[D].referrer===`client`?`about:client`:this[D].referrer.toString()}get referrerPolicy(){return A.brandCheck(this,e),this[D].referrerPolicy}get mode(){return A.brandCheck(this,e),this[D].mode}get credentials(){return this[D].credentials}get cache(){return A.brandCheck(this,e),this[D].cache}get redirect(){return A.brandCheck(this,e),this[D].redirect}get integrity(){return A.brandCheck(this,e),this[D].integrity}get keepalive(){return A.brandCheck(this,e),this[D].keepalive}get isReloadNavigation(){return A.brandCheck(this,e),this[D].reloadNavigation}get isHistoryNavigation(){return A.brandCheck(this,e),this[D].historyNavigation}get signal(){return A.brandCheck(this,e),this[E]}get body(){return A.brandCheck(this,e),this[D].body?this[D].body.stream:null}get bodyUsed(){return A.brandCheck(this,e),!!this[D].body&&l.isDisturbed(this[D].body.stream)}get duplex(){return A.brandCheck(this,e),`half`}clone(){if(A.brandCheck(this,e),this.bodyUsed||this.body?.locked)throw TypeError(`unusable`);let t=W(this[D]),n=new e(I);n[D]=t,n[k]=this[k],n[T]=new a(I),n[T][F]=t.headersList,n[T][O]=this[T][O],n[T][k]=this[T][k];let r=new AbortController;return this.signal.aborted?r.abort(this.signal.reason):l.addAbortListener(this.signal,()=>{r.abort(this.signal.reason)}),n[E]=r.signal,n}};r(H);function U(e){let t={method:`GET`,localURLsOnly:!1,unsafeRequest:!1,body:null,client:null,reservedClient:null,replacesClientId:``,window:`client`,keepalive:!1,serviceWorkers:`all`,initiator:``,destination:``,priority:null,origin:`client`,policyContainer:`client`,referrer:`client`,referrerPolicy:``,mode:`no-cors`,useCORSPreflightFlag:!1,credentials:`same-origin`,useCredentials:!1,cache:`default`,redirect:`follow`,integrity:``,cryptoGraphicsNonceMetadata:``,parserMetadata:``,reloadNavigation:!1,historyNavigation:!1,userActivation:!1,taintedOrigin:!1,redirectCount:0,responseTainting:`basic`,preventNoCacheCacheControlHeaderModification:!1,done:!1,timingAllowFailed:!1,...e,headersList:e.headersList?new s(e.headersList):new s};return t.url=t.urlList[0],t}function W(e){let t=U({...e,body:null});return e.body!=null&&(t.body=i(e.body)),t}Object.defineProperties(H.prototype,{method:C,url:C,headers:C,redirect:C,clone:C,signal:C,duplex:C,destination:C,body:C,bodyUsed:C,isHistoryNavigation:C,isReloadNavigation:C,keepalive:C,integrity:C,cache:C,credentials:C,attribute:C,referrerPolicy:C,referrer:C,mode:C,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),A.converters.Request=A.interfaceConverter(H),A.converters.RequestInfo=function(e){return typeof e==`string`?A.converters.USVString(e):e instanceof H?A.converters.Request(e):A.converters.USVString(e)},A.converters.AbortSignal=A.interfaceConverter(AbortSignal),A.converters.RequestInit=A.dictionaryConverter([{key:`method`,converter:A.converters.ByteString},{key:`headers`,converter:A.converters.HeadersInit},{key:`body`,converter:A.nullableConverter(A.converters.BodyInit)},{key:`referrer`,converter:A.converters.USVString},{key:`referrerPolicy`,converter:A.converters.DOMString,allowedValues:_},{key:`mode`,converter:A.converters.DOMString,allowedValues:y},{key:`credentials`,converter:A.converters.DOMString,allowedValues:b},{key:`cache`,converter:A.converters.DOMString,allowedValues:x},{key:`redirect`,converter:A.converters.DOMString,allowedValues:v},{key:`integrity`,converter:A.converters.DOMString},{key:`keepalive`,converter:A.converters.boolean},{key:`signal`,converter:A.nullableConverter(e=>A.converters.AbortSignal(e,{strict:!1}))},{key:`window`,converter:A.converters.any},{key:`duplex`,converter:A.converters.DOMString,allowedValues:S}]),t.exports={Request:H,makeRequest:U}})),Ze=b(((e,t)=>{let{Response:n,makeNetworkError:r,makeAppropriateNetworkError:i,filterResponse:a,makeResponse:o}=Ye(),{Headers:s}=Je(),{Request:c,makeRequest:l}=Xe(),u=w(`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:T,determineRequestsReferrer:E,coarsenedSharedCurrentTime:D,createDeferredPromise:O,isBlobLike:k,sameOrigin:A,isCancelled:M,isAborted:N,isErrorLike:F,fullyReadBody:I,readableStreamClose:L,isomorphicEncode:R,urlIsLocal:z,urlIsHttpHttpsScheme:B,urlHasHttpsScheme:V}=re(),{kState:ee,kHeaders:te,kGuard:ne,kRealm:H}=q(),U=w(`assert`),{safelyExtractBody:W}=se(),{redirectStatusSet:K,nullBodyStatus:ae,safeMethodsSet:oe,requestBodyHeader:ce,subresourceSet:le,DOMException:ue}=G(),{kHeadersList:de}=j(),fe=w(`events`),{Readable:pe,pipeline:me}=w(`stream`),{addAbortListener:he,isErrored:ge,isReadable:_e,nodeMajor:ve,nodeMinor:ye}=P(),{dataURLProcessor:be,serializeAMimeType:xe}=ie(),{TransformStream:Se}=w(`stream/web`),{getGlobalDispatcher:Ce}=Ke(),{webidl:we}=J(),{STATUS_CODES:Te}=w(`http`),Ee=[`GET`,`HEAD`],De,Oe=globalThis.ReadableStream;var ke=class extends fe{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state=`ongoing`,this.setMaxListeners(21)}terminate(e){this.state===`ongoing`&&(this.state=`terminated`,this.connection?.destroy(e),this.emit(`terminated`,e))}abort(e){this.state===`ongoing`&&(this.state=`aborted`,e||=new ue(`The operation was aborted.`,`AbortError`),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit(`terminated`,e))}};function Ae(e,t={}){we.argumentLengthCheck(arguments,1,{header:`globalThis.fetch`});let r=O(),i;try{i=new c(e,t)}catch(e){return r.reject(e),r.promise}let a=i[ee];if(i.signal.aborted)return Ne(r,a,null,i.signal.reason),r.promise;a.client.globalObject?.constructor?.name===`ServiceWorkerGlobalScope`&&(a.serviceWorkers=`none`);let o=null,s=!1,l=null;return he(i.signal,()=>{s=!0,U(l!=null),l.abort(i.signal.reason),Ne(r,a,o,i.signal.reason)}),l=Pe({request:a,processResponseEndOfBody:e=>je(e,`fetch`),processResponse:e=>{if(s)return Promise.resolve();if(e.aborted)return Ne(r,a,o,l.serializedAbortReason),Promise.resolve();if(e.type===`error`)return r.reject(Object.assign(TypeError(`fetch failed`),{cause:e.error})),Promise.resolve();o=new n,o[ee]=e,o[H]=null,o[te][de]=e.headersList,o[te][ne]=`immutable`,o[te][H]=null,r.resolve(o)},dispatcher:t.dispatcher??Ce()}),r.promise}function je(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;B(n)&&r!==null&&(e.timingAllowPassed||(r=x({startTime:r.startTime}),i=``),r.endTime=D(),e.timingInfo=r,Me(r,n,t,globalThis,i))}function Me(e,t,n,r,i){(ve>18||ve===18&&ye>=2)&&performance.markResourceTiming(e,t.href,n,r,i)}function Ne(e,t,n,r){if(r||=new ue(`The operation was aborted.`,`AbortError`),e.reject(r),t.body!=null&&_e(t.body?.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let i=n[ee];i.body!=null&&_e(i.body?.stream)&&i.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e})}function Pe({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s}){let c=null,l=!1;e.client!=null&&(c=e.client.globalObject,l=e.client.crossOriginIsolatedCapability);let u=x({startTime:D(l)}),d={controller:new ke(s),request:e,timingInfo:u,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:l};return U(!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`)||e.headersList.append(`accept`,`*/*`),e.headersList.contains(`accept-language`)||e.headersList.append(`accept-language`,`*`),e.priority,le.has(e.destination),Fe(d).catch(e=>{d.controller.terminate(e)}),d.controller}async function Fe(e,t=!1){let n=e.request,i=null;if(n.localURLsOnly&&!z(v(n))&&(i=r(`local URLs only`)),b(n),m(n)===`blocked`&&(i=r(`bad port`)),n.referrerPolicy===``&&(n.referrerPolicy=n.policyContainer.referrerPolicy),n.referrer!==`no-referrer`&&(n.referrer=E(n)),i===null&&(i=await(async()=>{let t=v(n);return A(t,n.url)&&n.responseTainting===`basic`||t.protocol===`data:`||n.mode===`navigate`||n.mode===`websocket`?(n.responseTainting=`basic`,await Ie(e)):n.mode===`same-origin`?r(`request mode cannot be "same-origin"`):n.mode===`no-cors`?n.redirect===`follow`?(n.responseTainting=`opaque`,await Ie(e)):r(`redirect mode cannot be "follow" for "no-cors" request`):B(v(n))?(n.responseTainting=`cors`,await ze(e)):r(`URL scheme must be a HTTP(S) scheme`)})()),t)return i;i.status!==0&&!i.internalResponse&&(n.responseTainting,n.responseTainting===`basic`?i=a(i,`basic`):n.responseTainting===`cors`?i=a(i,`cors`):n.responseTainting===`opaque`?i=a(i,`opaque`):U(!1));let o=i.status===0?i:i.internalResponse;if(o.urlList.length===0&&o.urlList.push(...n.urlList),n.timingAllowFailed||(i.timingAllowPassed=!0),i.type===`opaque`&&o.status===206&&o.rangeRequested&&!n.headers.contains(`range`)&&(i=o=r()),i.status!==0&&(n.method===`HEAD`||n.method===`CONNECT`||ae.includes(o.status))&&(o.body=null,e.controller.dump=!0),n.integrity){let t=t=>Re(e,r(t));if(n.responseTainting===`opaque`||i.body==null){t(i.error);return}await I(i.body,r=>{if(!d(r,n.integrity)){t(`integrity mismatch`);return}i.body=W(r)[0],Re(e,i)},t)}else Re(e,i)}function Ie(e){if(M(e)&&e.request.redirectCount===0)return Promise.resolve(i(e));let{request:t}=e,{protocol:n}=v(t);switch(n){case`about:`:return Promise.resolve(r(`about scheme is not supported`));case`blob:`:{De||=w(`buffer`).resolveObjectURL;let e=v(t);if(e.search.length!==0)return Promise.resolve(r(`NetworkError when attempting to fetch resource.`));let n=De(e.toString());if(t.method!==`GET`||!k(n))return Promise.resolve(r(`invalid method`));let i=W(n),a=i[0],s=R(`${a.length}`),c=i[1]??``,l=o({statusText:`OK`,headersList:[[`content-length`,{name:`Content-Length`,value:s}],[`content-type`,{name:`Content-Type`,value:c}]]});return l.body=a,Promise.resolve(l)}case`data:`:{let e=be(v(t));if(e===`failure`)return Promise.resolve(r(`failed to fetch the data URL`));let n=xe(e.mimeType);return Promise.resolve(o({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:n}]],body:W(e.body)[0]}))}case`file:`:return Promise.resolve(r(`not implemented... yet...`));case`http:`:case`https:`:return ze(e).catch(e=>r(e));default:return Promise.resolve(r(`unknown scheme`))}}function Le(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function Re(e,t){t.type===`error`&&(t.urlList=[e.request.urlList[0]],t.timingInfo=x({startTime:e.timingInfo.startTime}));let n=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t))};if(e.processResponse!=null&&queueMicrotask(()=>e.processResponse(t)),t.body==null)n();else{let e=new Se({start(){},transform:(e,t)=>{t.enqueue(e)},flush:n},{size(){return 1}},{size(){return 1}});t.body={stream:t.body.stream.pipeThrough(e)}}if(e.processResponseConsumeBody!=null){let n=n=>e.processResponseConsumeBody(t,n),r=n=>e.processResponseConsumeBody(t,n);if(t.body==null)queueMicrotask(()=>n(null));else return I(t.body,n,r);return Promise.resolve()}}async function ze(e){let t=e.request,n=null,i=null,a=e.timingInfo;if(t.serviceWorkers,n===null){if(t.redirect===`follow`&&(t.serviceWorkers=`none`),i=n=await Ve(e),t.responseTainting===`cors`&&C(t,n)===`failure`)return r(`cors failure`);h(t,n)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||n.type===`opaque`)&&T(t.origin,t.client,t.destination,i)===`blocked`?r(`blocked`):(K.has(i.status)&&(t.redirect!==`manual`&&e.controller.connection.destroy(),t.redirect===`error`?n=r(`unexpected redirect`):t.redirect===`manual`?n=i:t.redirect===`follow`?n=await Be(e,n):U(!1)),n.timingInfo=a,n)}function Be(e,t){let n=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=_(i,v(n).hash),a==null)return t}catch(e){return Promise.resolve(r(e))}if(!B(a))return Promise.resolve(r(`URL scheme must be a HTTP(S) scheme`));if(n.redirectCount===20)return Promise.resolve(r(`redirect count exceeded`));if(n.redirectCount+=1,n.mode===`cors`&&(a.username||a.password)&&!A(n,a))return Promise.resolve(r(`cross origin not allowed for request mode "cors"`));if(n.responseTainting===`cors`&&(a.username||a.password))return Promise.resolve(r(`URL cannot contain credentials for request mode "cors"`));if(i.status!==303&&n.body!=null&&n.body.source==null)return Promise.resolve(r());if([301,302].includes(i.status)&&n.method===`POST`||i.status===303&&!Ee.includes(n.method)){n.method=`GET`,n.body=null;for(let e of ce)n.headersList.delete(e)}A(v(n),a)||(n.headersList.delete(`authorization`),n.headersList.delete(`proxy-authorization`,!0),n.headersList.delete(`cookie`),n.headersList.delete(`host`)),n.body!=null&&(U(n.body.source!=null),n.body=W(n.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=D(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),n.urlList.push(a),y(n,i),Fe(e,!0)}async function Ve(e,t=!1,n=!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=R(`${d}`)),f!=null&&s.headersList.append(`content-length`,f),d!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append(`referer`,R(s.referrer.href)),g(s),S(s),s.headersList.contains(`user-agent`)||s.headersList.append(`user-agent`,typeof esbuildDetection>`u`?`undici`:`node`),s.cache===`default`&&(s.headersList.contains(`if-modified-since`)||s.headersList.contains(`if-none-match`)||s.headersList.contains(`if-unmodified-since`)||s.headersList.contains(`if-match`)||s.headersList.contains(`if-range`))&&(s.cache=`no-store`),s.cache===`no-cache`&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains(`cache-control`)&&s.headersList.append(`cache-control`,`max-age=0`),(s.cache===`no-store`||s.cache===`reload`)&&(s.headersList.contains(`pragma`)||s.headersList.append(`pragma`,`no-cache`),s.headersList.contains(`cache-control`)||s.headersList.append(`cache-control`,`no-cache`)),s.headersList.contains(`range`)&&s.headersList.append(`accept-encoding`,`identity`),s.headersList.contains(`accept-encoding`)||(V(v(s))?s.headersList.append(`accept-encoding`,`br, gzip, deflate`):s.headersList.append(`accept-encoding`,`gzip, deflate`)),s.headersList.delete(`host`),s.cache=`no-store`,s.mode!==`no-store`&&s.mode,c==null){if(s.mode===`only-if-cached`)return r(`only if cached`);let e=await He(o,u,n);!oe.has(s.method)&&e.status>=200&&e.status,c??=e}if(c.urlList=[...s.urlList],s.headersList.contains(`range`)&&(c.rangeRequested=!0),c.requestIncludesCredentials=u,c.status===407)return a.window===`no-window`?r():M(e)?i(e):r(`proxy authentication required`);if(c.status===421&&!n&&(a.body==null||a.body.source!=null)){if(M(e))return i(e);e.controller.connection.destroy(),c=await Ve(e,t,!0)}return c}async function He(e,t=!1,n=!1){U(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e){this.destroyed||(this.destroyed=!0,this.abort?.(e??new ue(`The operation was aborted.`,`AbortError`)))}};let a=e.request,c=null,l=e.timingInfo;a.cache=`no-store`,a.mode;let d=null;if(a.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(a.body!=null){let t=async function*(t){M(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},n=()=>{M(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{M(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};d=(async function*(){try{for await(let e of a.body.stream)yield*t(e);n()}catch(e){r(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:a}=await g({body:d});if(a)c=o({status:n,statusText:r,headersList:i,socket:a});else{let a=t[Symbol.asyncIterator]();e.controller.next=()=>a.next(),c=o({status:n,statusText:r,headersList:i})}}catch(t){return t.name===`AbortError`?(e.controller.connection.destroy(),i(e,t)):r(t)}let f=()=>{e.controller.resume()},p=t=>{e.controller.abort(t)};Oe||=w(`stream/web`).ReadableStream;let m=new Oe({async start(t){e.controller.controller=t},async pull(e){await f(e)},async cancel(e){await p(e)}},{highWaterMark:0,size(){return 1}});c.body={stream:m},e.controller.on(`terminated`,h),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(N(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){L(e.controller.controller),Le(e,c);return}if(l.decodedBodySize+=t?.byteLength??0,n){e.controller.terminate(t);return}if(e.controller.controller.enqueue(new Uint8Array(t)),ge(m)){e.controller.terminate();return}if(!e.controller.controller.desiredSize)return}};function h(t){N(e)?(c.aborted=!0,_e(m)&&e.controller.controller.error(e.controller.serializedAbortReason)):_e(m)&&e.controller.controller.error(TypeError(`terminated`,{cause:F(t)?t:void 0})),e.controller.connection.destroy()}return c;async function g({body:t}){let n=v(a),r=e.controller.dispatcher;return new Promise((i,o)=>r.dispatch({path:n.pathname+n.search,origin:n.origin,method:a.method,body:e.controller.dispatcher.isMockActive?a.body&&(a.body.source||a.body.stream):t,headers:a.headersList.entries,maxRedirections:0,upgrade:a.mode===`websocket`?`websocket`:void 0},{body:null,abort:null,onConnect(t){let{connection:n}=e.controller;n.destroyed?t(new ue(`The operation was aborted.`,`AbortError`)):(e.controller.on(`terminated`,t),this.abort=n.abort=t)},onHeaders(e,t,n,r){if(e<200)return;let o=[],c=``,l=new s;if(Array.isArray(t))for(let e=0;ee.trim()):n.toLowerCase()===`location`&&(c=r),l[de].append(n,r)}else{let e=Object.keys(t);for(let n of e){let e=t[n];n.toLowerCase()===`content-encoding`?o=e.toLowerCase().split(`,`).map(e=>e.trim()).reverse():n.toLowerCase()===`location`&&(c=e),l[de].append(n,e)}}this.body=new pe({read:n});let d=[],f=a.redirect===`follow`&&c&&K.has(e);if(a.method!==`HEAD`&&a.method!==`CONNECT`&&!ae.includes(e)&&!f)for(let e of o)if(e===`x-gzip`||e===`gzip`)d.push(u.createGunzip({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(e===`deflate`)d.push(u.createInflate());else if(e===`br`)d.push(u.createBrotliDecompress());else{d.length=0;break}return i({status:e,statusText:r,headersList:l[de],body:d.length?me(this.body,...d,()=>{}):this.body.on(`error`,()=>{})}),!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.ended=!0,this.body.push(null)},onError(t){this.abort&&e.controller.off(`terminated`,this.abort),this.body?.destroy(t),e.controller.terminate(t),o(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`)}})),$e=b(((e,t)=>{let{webidl:n}=J(),r=Symbol(`ProgressEvent state`);var i=class e extends Event{constructor(e,t={}){e=n.converters.DOMString(e),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}})),et=b(((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}})),tt=b(((e,t)=>{let{kState:n,kError:r,kResult:i,kAborted:a,kLastProgressEventFired:o}=Qe(),{ProgressEvent:s}=$e(),{getEncoding:c}=et(),{DOMException:l}=G(),{serializeAMimeType:u,parseMIMEType:d}=ie(),{types:f}=w(`util`),{StringDecoder:p}=w(`string_decoder`),{btoa:m}=w(`buffer`),h={enumerable:!0,writable:!1,configurable:!1};function g(e,t,s,c){if(e[n]===`loading`)throw new l(`Invalid state`,`InvalidStateError`);e[n]=`loading`,e[i]=null,e[r]=null;let u=t.stream().getReader(),d=[],p=u.read(),m=!0;(async()=>{for(;!e[a];)try{let{done:l,value:h}=await p;if(m&&!e[a]&&queueMicrotask(()=>{_(`loadstart`,e)}),m=!1,!l&&f.isUint8Array(h))d.push(h),(e[o]===void 0||Date.now()-e[o]>=50)&&!e[a]&&(e[o]=Date.now(),queueMicrotask(()=>{_(`progress`,e)})),p=u.read();else if(l){queueMicrotask(()=>{e[n]=`done`;try{let n=v(d,s,t.type,c);if(e[a])return;e[i]=n,_(`load`,e)}catch(t){e[r]=t,_(`error`,e)}e[n]!==`loading`&&_(`loadend`,e)});break}}catch(t){if(e[a])return;queueMicrotask(()=>{e[n]=`done`,e[r]=t,_(`error`,e),e[n]!==`loading`&&_(`loadend`,e)});break}})()}function _(e,t){let n=new s(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function v(e,t,n,r){switch(t){case`DataURL`:{let t=`data:`,r=d(n||`application/octet-stream`);r!==`failure`&&(t+=u(r)),t+=`;base64,`;let i=new p(`latin1`);for(let n of e)t+=m(i.write(n));return t+=m(i.end()),t}case`Text`:{let t=`failure`;if(r&&(t=c(r)),t===`failure`&&n){let e=d(n);e!==`failure`&&(t=c(e.parameters.get(`charset`)))}return t===`failure`&&(t=`UTF-8`),y(e,t)}case`ArrayBuffer`:return x(e).buffer;case`BinaryString`:{let t=``,n=new p(`latin1`);for(let r of e)t+=n.write(r);return t+=n.end(),t}}}function y(e,t){let n=x(e),r=b(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 b(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 x(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:h,readOperation:g,fireAProgressEvent:_}})),nt=b(((e,t)=>{let{staticPropertyDescriptors:n,readOperation:r,fireAProgressEvent:i}=tt(),{kState:a,kError:o,kResult:s,kEvents:c,kAborted:l}=Qe(),{webidl:u}=J(),{kEnumerableProperty:d}=P();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,{header:`FileReader.readAsArrayBuffer`}),t=u.converters.Blob(t,{strict:!1}),r(this,t,`ArrayBuffer`)}readAsBinaryString(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`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,{header:`FileReader.readAsText`}),t=u.converters.Blob(t,{strict:!1}),n!==void 0&&(n=u.converters.DOMString(n)),r(this,t,`Text`,n)}readAsDataURL(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,{header:`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}})),rt=b(((e,t)=>{t.exports={kConstruct:j().kConstruct}})),it=b(((e,t)=>{let n=w(`assert`),{URLSerializer:r}=ie(),{isValidHeaderName:i}=re();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(),n.length&&i(n)&&t.push(n);return t}t.exports={urlEquals:a,fieldValues:o}})),at=b(((e,t)=>{let{kConstruct:n}=rt(),{urlEquals:r,fieldValues:i}=it(),{kEnumerableProperty:a,isDisturbed:o}=P(),{kHeadersList:s}=j(),{webidl:c}=J(),{Response:l,cloneResponse:u}=Ye(),{Request:d}=Xe(),{kState:f,kHeaders:p,kGuard:m,kRealm:h}=q(),{fetching:g}=Ze(),{urlIsHttpHttpsScheme:_,createDeferredPromise:v,readAllBytes:y}=re(),b=w(`assert`),{getGlobalDispatcher:x}=Ke();var S=class e{#e;constructor(){arguments[0]!==n&&c.illegalConstructor(),this.#e=arguments[1]}async match(t,n={}){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,{header:`Cache.match`}),t=c.converters.RequestInfo(t),n=c.converters.CacheQueryOptions(n);let r=await this.matchAll(t,n);if(r.length!==0)return r[0]}async matchAll(t=void 0,n={}){c.brandCheck(this,e),t!==void 0&&(t=c.converters.RequestInfo(t)),n=c.converters.CacheQueryOptions(n);let r=null;if(t!==void 0)if(t instanceof d){if(r=t[f],r.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(r=new d(t)[f]);let i=[];if(t===void 0)for(let e of this.#e)i.push(e[1]);else{let e=this.#n(r,n);for(let t of e)i.push(t[1])}let a=[];for(let e of i){let t=new l(e.body?.source??null),n=t[f].body;t[f]=e,t[f].body=n,t[p][s]=e.headersList,t[p][m]=`immutable`,a.push(t)}return Object.freeze(a)}async add(t){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,{header:`Cache.add`}),t=c.converters.RequestInfo(t);let n=[t];return await this.addAll(n)}async addAll(t){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,{header:`Cache.addAll`}),t=c.converters[`sequence`](t);let n=[],r=[];for(let e of t){if(typeof e==`string`)continue;let t=e[f];if(!_(t.url)||t.method!==`GET`)throw c.errors.exception({header:`Cache.addAll`,message:`Expected http/s scheme when method is not GET.`})}let a=[];for(let e of t){let t=new d(e)[f];if(!_(t.url))throw c.errors.exception({header:`Cache.addAll`,message:`Expected http/s scheme.`});t.initiator=`fetch`,t.destination=`subresource`,r.push(t);let o=v();a.push(g({request:t,dispatcher:x(),processResponse(e){if(e.type===`error`||e.status===206||e.status<200||e.status>299)o.reject(c.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===`*`){o.reject(c.errors.exception({header:`Cache.addAll`,message:`invalid vary field value`}));for(let e of a)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){o.reject(new DOMException(`aborted`,`AbortError`));return}o.resolve(e)}})),n.push(o.promise)}let o=await Promise.all(n),s=[],l=0;for(let e of o){let t={type:`put`,request:r[l],response:e};s.push(t),l++}let u=v(),p=null;try{this.#t(s)}catch(e){p=e}return queueMicrotask(()=>{p===null?u.resolve(void 0):u.reject(p)}),u.promise}async put(t,n){c.brandCheck(this,e),c.argumentLengthCheck(arguments,2,{header:`Cache.put`}),t=c.converters.RequestInfo(t),n=c.converters.Response(n);let r=null;if(r=t instanceof d?t[f]:new d(t)[f],!_(r.url)||r.method!==`GET`)throw c.errors.exception({header:`Cache.put`,message:`Expected an http/s scheme when method is not GET`});let a=n[f];if(a.status===206)throw c.errors.exception({header:`Cache.put`,message:`Got 206 status`});if(a.headersList.contains(`vary`)){let e=i(a.headersList.get(`vary`));for(let t of e)if(t===`*`)throw c.errors.exception({header:`Cache.put`,message:`Got * vary field value`})}if(a.body&&(o(a.body.stream)||a.body.stream.locked))throw c.errors.exception({header:`Cache.put`,message:`Response body is locked or disturbed`});let s=u(a),l=v();a.body==null?l.resolve(void 0):y(a.body.stream.getReader()).then(l.resolve,l.reject);let p=[],m={type:`put`,request:r,response:s};p.push(m);let h=await l.promise;s.body!=null&&(s.body.source=h);let g=v(),b=null;try{this.#t(p)}catch(e){b=e}return queueMicrotask(()=>{b===null?g.resolve():g.reject(b)}),g.promise}async delete(t,n={}){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,{header:`Cache.delete`}),t=c.converters.RequestInfo(t),n=c.converters.CacheQueryOptions(n);let r=null;if(t instanceof d){if(r=t[f],r.method!==`GET`&&!n.ignoreMethod)return!1}else b(typeof t==`string`),r=new d(t)[f];let i=[],a={type:`delete`,request:r,options:n};i.push(a);let o=v(),s=null,l;try{l=this.#t(i)}catch(e){s=e}return queueMicrotask(()=>{s===null?o.resolve(!!l?.length):o.reject(s)}),o.promise}async keys(t=void 0,n={}){c.brandCheck(this,e),t!==void 0&&(t=c.converters.RequestInfo(t)),n=c.converters.CacheQueryOptions(n);let r=null;if(t!==void 0)if(t instanceof d){if(r=t[f],r.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(r=new d(t)[f]);let i=v(),a=[];if(t===void 0)for(let e of this.#e)a.push(e[0]);else{let e=this.#n(r,n);for(let t of e)a.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of a){let n=new d(`https://a`);n[f]=t,n[p][s]=t.headersList,n[p][m]=`immutable`,n[h]=t.client,e.push(n)}i.resolve(Object.freeze(e))}),i.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 c.errors.exception({header:`Cache.#batchCacheOperations`,message:`operation type does not match "delete" or "put"`});if(n.type===`delete`&&n.response!=null)throw c.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);b(e!==-1),t.splice(e,1)}}else if(n.type===`put`){if(n.response==null)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`put operation should have an associated response`});let i=n.request;if(!_(i.url))throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`expected http or https scheme`});if(i.method!==`GET`)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`not get method`});if(n.options!=null)throw c.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);b(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}};Object.defineProperties(S.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:a,matchAll:a,add:a,addAll:a,put:a,delete:a,keys:a});let C=[{key:`ignoreSearch`,converter:c.converters.boolean,defaultValue:!1},{key:`ignoreMethod`,converter:c.converters.boolean,defaultValue:!1},{key:`ignoreVary`,converter:c.converters.boolean,defaultValue:!1}];c.converters.CacheQueryOptions=c.dictionaryConverter(C),c.converters.MultiCacheQueryOptions=c.dictionaryConverter([...C,{key:`cacheName`,converter:c.converters.DOMString}]),c.converters.Response=c.interfaceConverter(l),c.converters[`sequence`]=c.sequenceConverter(c.converters.RequestInfo),t.exports={Cache:S}})),ot=b(((e,t)=>{let{kConstruct:n}=rt(),{Cache:r}=at(),{webidl:i}=J(),{kEnumerableProperty:a}=P();var o=class e{#e=new Map;constructor(){arguments[0]!==n&&i.illegalConstructor()}async match(t,a={}){if(i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,{header:`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){return i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,{header:`CacheStorage.has`}),t=i.converters.DOMString(t),this.#e.has(t)}async open(t){if(i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,{header:`CacheStorage.open`}),t=i.converters.DOMString(t),this.#e.has(t))return new r(n,this.#e.get(t));let a=[];return this.#e.set(t,a),new r(n,a)}async delete(t){return i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,{header:`CacheStorage.delete`}),t=i.converters.DOMString(t),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}})),st=b(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),ct=b(((e,t)=>{function n(e){if(e.length===0)return!1;for(let t of e){let e=t.charCodeAt(0);if(e>=0||e<=8||e>=10||e<=31||e===127)return!1}}function r(e){for(let t of e){let e=t.charCodeAt(0);if(e<=32||e>127||t===`(`||t===`)`||t===`>`||t===`<`||t===`@`||t===`,`||t===`;`||t===`:`||t===`\\`||t===`"`||t===`/`||t===`[`||t===`]`||t===`?`||t===`=`||t===`{`||t===`}`)throw Error(`Invalid cookie name`)}}function i(e){for(let t of e){let e=t.charCodeAt(0);if(e<33||e===34||e===44||e===59||e===92||e>126)throw Error(`Invalid header value`)}}function a(e){for(let t of e)if(t.charCodeAt(0)<33||t===`;`)throw Error(`Invalid cookie path`)}function o(e){if(e.startsWith(`-`)||e.endsWith(`.`)||e.endsWith(`-`))throw Error(`Invalid cookie domain`)}function s(e){return typeof e==`number`&&(e=new Date(e)),`${[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`][e.getUTCDay()]}, ${e.getUTCDate().toString().padStart(2,`0`)} ${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][e.getUTCMonth()]} ${e.getUTCFullYear()} ${e.getUTCHours().toString().padStart(2,`0`)}:${e.getUTCMinutes().toString().padStart(2,`0`)}:${e.getUTCSeconds().toString().padStart(2,`0`)} GMT`}function c(e){if(e<0)throw Error(`Invalid cookie max-age`)}function l(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`&&(c(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=${s(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:s,stringify:l}})),lt=b(((e,t)=>{let{maxNameValuePairSize:n,maxAttributeValueSize:r}=st(),{isCTLExcludingHtab:i}=ct(),{collectASequenceOfCodePointsFast:a}=ie(),o=w(`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}})),ut=b(((e,t)=>{let{parseSetCookie:n}=lt(),{stringify:r}=ct(),{webidl:i}=J(),{Headers:a}=Je();function o(e){i.argumentLengthCheck(arguments,1,{header:`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.argumentLengthCheck(arguments,2,{header:`deleteCookie`}),i.brandCheck(e,a,{strict:!1}),t=i.converters.DOMString(t),n=i.converters.DeleteCookieAttributes(n),l(e,{name:t,value:``,expires:new Date(0),...n})}function c(e){i.argumentLengthCheck(arguments,1,{header:`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,{header:`setCookie`}),i.brandCheck(e,a,{strict:!1}),t=i.converters.Cookie(t),r(t)&&e.append(`Set-Cookie`,r(t))}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}})),dt=b(((e,t)=>{t.exports={uid:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,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)}})),ft=b(((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`)}})),pt=b(((e,t)=>{let{webidl:n}=J(),{kEnumerableProperty:r}=P(),{MessagePort:i}=w(`worker_threads`);var a=class e extends Event{#e;constructor(e,t={}){n.argumentLengthCheck(arguments,1,{header:`MessageEvent constructor`}),e=n.converters.DOMString(e),t=n.converters.MessageEventInit(t),super(e,t),this.#e=t}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,{header:`MessageEvent.initMessageEvent`}),new e(t,{bubbles:r,cancelable:i,data:a,origin:o,lastEventId:s,source:c,ports:l})}},o=class e extends Event{#e;constructor(e,t={}){n.argumentLengthCheck(arguments,1,{header:`CloseEvent constructor`}),e=n.converters.DOMString(e),t=n.converters.CloseEventInit(t),super(e,t),this.#e=t}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}},s=class e extends Event{#e;constructor(e,t){n.argumentLengthCheck(arguments,1,{header:`ErrorEvent constructor`}),super(e,t),e=n.converters.DOMString(e),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(a.prototype,{[Symbol.toStringTag]:{value:`MessageEvent`,configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`CloseEvent`,configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(s.prototype,{[Symbol.toStringTag]:{value:`ErrorEvent`,configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),n.converters.MessagePort=n.interfaceConverter(i),n.converters[`sequence`]=n.sequenceConverter(n.converters.MessagePort);let c=[{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([...c,{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`],get defaultValue(){return[]}}]),n.converters.CloseEventInit=n.dictionaryConverter([...c,{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([...c,{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:a,CloseEvent:o,ErrorEvent:s}})),mt=b(((e,t)=>{let{kReadyState:n,kController:r,kResponse:i,kBinaryType:a,kWebSocketURL:o}=ft(),{states:s,opcodes:c}=dt(),{MessageEvent:l,ErrorEvent:u}=pt();function d(e){return e[n]===s.OPEN}function f(e){return e[n]===s.CLOSING}function p(e){return e[n]===s.CLOSED}function m(e,t,n=Event,r){let i=new n(e,r);t.dispatchEvent(i)}function h(e,t,r){if(e[n]!==s.OPEN)return;let i;if(t===c.TEXT)try{i=new TextDecoder(`utf-8`,{fatal:!0}).decode(r)}catch{v(e,`Received invalid UTF-8 in text frame.`);return}else t===c.BINARY&&(i=e[a]===`blob`?new Blob([r]):new Uint8Array(r).buffer);m(`message`,e,l,{origin:e[o].origin,data:i})}function g(e){if(e.length===0)return!1;for(let t of e){let e=t.charCodeAt(0);if(e<33||e>126||t===`(`||t===`)`||t===`<`||t===`>`||t===`@`||t===`,`||t===`;`||t===`:`||t===`\\`||t===`"`||t===`/`||t===`[`||t===`]`||t===`?`||t===`=`||t===`{`||t===`}`||e===32||e===9)return!1}return!0}function _(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function v(e,t){let{[r]:n,[i]:a}=e;n.abort(),a?.socket&&!a.socket.destroyed&&a.socket.destroy(),t&&m(`error`,e,u,{error:Error(t)})}t.exports={isEstablished:d,isClosing:f,isClosed:p,fireEvent:m,isValidSubprotocol:g,isValidStatusCode:_,failWebsocketConnection:v,websocketMessageReceived:h}})),ht=b(((e,t)=>{let n=w(`diagnostics_channel`),{uid:r,states:i}=dt(),{kReadyState:a,kSentClose:o,kByteParser:s,kReceivedClose:c}=ft(),{fireEvent:l,failWebsocketConnection:u}=mt(),{CloseEvent:d}=pt(),{makeRequest:f}=Xe(),{fetching:p}=Ze(),{Headers:m}=Je(),{getGlobalDispatcher:h}=Ke(),{kHeadersList:g}=j(),_={};_.open=n.channel(`undici:websocket:open`),_.close=n.channel(`undici:websocket:close`),_.socketError=n.channel(`undici:websocket:socket_error`);let v;try{v=w(`crypto`)}catch{}function y(e,t,n,i,a){let o=e;o.protocol=e.protocol===`ws:`?`http:`:`https:`;let s=f({urlList:[o],serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`});a.headers&&(s.headersList=new m(a.headers)[g]);let c=v.randomBytes(16).toString(`base64`);s.headersList.append(`sec-websocket-key`,c),s.headersList.append(`sec-websocket-version`,`13`);for(let e of t)s.headersList.append(`sec-websocket-protocol`,e);return p({request:s,useParallelQueue:!0,dispatcher:a.dispatcher??h(),processResponse(e){if(e.type===`error`||e.status!==101){u(n,`Received network error or non-101 status code.`);return}if(t.length!==0&&!e.headersList.get(`Sec-WebSocket-Protocol`)){u(n,`Server did not respond with sent protocols.`);return}if(e.headersList.get(`Upgrade`)?.toLowerCase()!==`websocket`){u(n,`Server did not set Upgrade header to "websocket".`);return}if(e.headersList.get(`Connection`)?.toLowerCase()!==`upgrade`){u(n,`Server did not set Connection header to "upgrade".`);return}if(e.headersList.get(`Sec-WebSocket-Accept`)!==v.createHash(`sha1`).update(c+r).digest(`base64`)){u(n,`Incorrect hash received in Sec-WebSocket-Accept header.`);return}let a=e.headersList.get(`Sec-WebSocket-Extensions`);if(a!==null&&a!==``){u(n,`Received different permessage-deflate than the one set.`);return}let o=e.headersList.get(`Sec-WebSocket-Protocol`);if(o!==null&&o!==s.headersList.get(`Sec-WebSocket-Protocol`)){u(n,`Protocol was not set in the opening handshake.`);return}e.socket.on(`data`,b),e.socket.on(`close`,x),e.socket.on(`error`,S),_.open.hasSubscribers&&_.open.publish({address:e.socket.address(),protocol:o,extensions:a}),i(e)}})}function b(e){this.ws[s].write(e)||this.pause()}function x(){let{ws:e}=this,t=e[o]&&e[c],n=1005,r=``,u=e[s].closingInfo;u?(n=u.code??1005,r=u.reason):e[o]||(n=1006),e[a]=i.CLOSED,l(`close`,e,d,{wasClean:t,code:n,reason:r}),_.close.hasSubscribers&&_.close.publish({websocket:e,code:n,reason:r})}function S(e){let{ws:t}=this;t[a]=i.CLOSING,_.socketError.hasSubscribers&&_.socketError.publish(e),this.destroy()}t.exports={establishWebSocketConnection:y}})),gt=b(((e,t)=>{let{maxUnsigned16Bit:n}=dt(),r;try{r=w(`crypto`)}catch{}t.exports={WebsocketFrameSend:class{constructor(e){this.frameData=e,this.maskKey=r.randomBytes(4)}createFrame(e){let t=this.frameData?.byteLength??0,r=t,i=6;t>n?(i+=8,r=127):t>125&&(i+=2,r=126);let a=Buffer.allocUnsafe(t+i);a[0]=a[1]=0,a[0]|=128,a[0]=(a[0]&240)+e,a[i-4]=this.maskKey[0],a[i-3]=this.maskKey[1],a[i-2]=this.maskKey[2],a[i-1]=this.maskKey[3],a[1]=r,r===126?a.writeUInt16BE(t,2):r===127&&(a[2]=a[3]=0,a.writeUIntBE(t,4,6)),a[1]|=128;for(let e=0;e{let{Writable:n}=w(`stream`),r=w(`diagnostics_channel`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s}=dt(),{kReadyState:c,kSentClose:l,kResponse:u,kReceivedClose:d}=ft(),{isValidStatusCode:f,failWebsocketConnection:p,websocketMessageReceived:m}=mt(),{WebsocketFrameSend:h}=gt(),g={};g.ping=r.channel(`undici:websocket:ping`),g.pong=r.channel(`undici:websocket:pong`),t.exports={ByteParser:class extends n{#e=[];#t=0;#n=i.INFO;#r={};#i=[];constructor(e){super(),this.ws=e}_write(e,t,n){this.#e.push(e),this.#t+=e.length,this.run(n)}run(e){for(;;){if(this.#n===i.INFO){if(this.#t<2)return e();let t=this.consume(2);if(this.#r.fin=(t[0]&128)!=0,this.#r.opcode=t[0]&15,this.#r.originalOpcode??=this.#r.opcode,this.#r.fragmented=!this.#r.fin&&this.#r.opcode!==a.CONTINUATION,this.#r.fragmented&&this.#r.opcode!==a.BINARY&&this.#r.opcode!==a.TEXT){p(this.ws,`Invalid frame type was fragmented.`);return}let n=t[1]&127;if(n<=125?(this.#r.payloadLength=n,this.#n=i.READ_DATA):n===126?this.#n=i.PAYLOADLENGTH_16:n===127&&(this.#n=i.PAYLOADLENGTH_64),this.#r.fragmented&&n>125){p(this.ws,`Fragmented frame exceeded 125 bytes.`);return}else if((this.#r.opcode===a.PING||this.#r.opcode===a.PONG||this.#r.opcode===a.CLOSE)&&n>125){p(this.ws,`Payload length for control frame exceeded 125 bytes.`);return}else if(this.#r.opcode===a.CLOSE){if(n===1){p(this.ws,`Received close frame with a 1-byte body.`);return}let e=this.consume(n);if(this.#r.closeInfo=this.parseCloseBody(!1,e),!this.ws[l]){let e=Buffer.allocUnsafe(2);e.writeUInt16BE(this.#r.closeInfo.code,0);let t=new h(e);this.ws[u].socket.write(t.createFrame(a.CLOSE),e=>{e||(this.ws[l]=!0)})}this.ws[c]=o.CLOSING,this.ws[d]=!0,this.end();return}else if(this.#r.opcode===a.PING){let t=this.consume(n);if(!this.ws[d]){let e=new h(t);this.ws[u].socket.write(e.createFrame(a.PONG)),g.ping.hasSubscribers&&g.ping.publish({payload:t})}if(this.#n=i.INFO,this.#t>0)continue;e();return}else if(this.#r.opcode===a.PONG){let t=this.consume(n);if(g.pong.hasSubscribers&&g.pong.publish({payload:t}),this.#t>0)continue;e();return}}else if(this.#n===i.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#r.payloadLength=t.readUInt16BE(0),this.#n=i.READ_DATA}else if(this.#n===i.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),n=t.readUInt32BE(0);if(n>2**31-1){p(this.ws,`Received payload length > 2^31 bytes.`);return}let r=t.readUInt32BE(4);this.#r.payloadLength=(n<<8)+r,this.#n=i.READ_DATA}else if(this.#n===i.READ_DATA){if(this.#t=this.#r.payloadLength){let e=this.consume(this.#r.payloadLength);if(this.#i.push(e),!this.#r.fragmented||this.#r.fin&&this.#r.opcode===a.CONTINUATION){let e=Buffer.concat(this.#i);m(this.ws,this.#r.originalOpcode,e),this.#r={},this.#i.length=0}this.#n=i.INFO}}if(!(this.#t>0)){e();break}}}consume(e){if(e>this.#t)return null;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,t){let n;if(t.length>=2&&(n=t.readUInt16BE(0)),e)return f(n)?{code:n}:null;let r=t.subarray(2);if(r[0]===239&&r[1]===187&&r[2]===191&&(r=r.subarray(3)),n!==void 0&&!f(n))return null;try{r=new TextDecoder(`utf-8`,{fatal:!0}).decode(r)}catch{return null}return{code:n,reason:r}}get closingInfo(){return this.#r.closeInfo}}}})),vt=b(((e,t)=>{let{webidl:n}=J(),{DOMException:r}=G(),{URLSerializer:i}=ie(),{getGlobalOrigin:a}=K(),{staticPropertyDescriptors:o,states:s,opcodes:c,emptyBuffer:l}=dt(),{kWebSocketURL:u,kReadyState:d,kController:f,kBinaryType:p,kResponse:m,kSentClose:h,kByteParser:g}=ft(),{isEstablished:_,isClosing:v,isValidSubprotocol:y,failWebsocketConnection:b,fireEvent:x}=mt(),{establishWebSocketConnection:S}=ht(),{WebsocketFrameSend:C}=gt(),{ByteParser:T}=_t(),{kEnumerableProperty:E,isBlobLike:D}=P(),{getGlobalDispatcher:O}=Ke(),{types:k}=w(`util`),A=!1;var j=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;constructor(t,i=[]){super(),n.argumentLengthCheck(arguments,1,{header:`WebSocket constructor`}),A||(A=!0,process.emitWarning(`WebSockets are experimental, expect them to change at any time.`,{code:`UNDICI-WS`}));let o=n.converters[`DOMString or sequence or WebSocketInit`](i);t=n.converters.USVString(t),i=o.protocols;let s=a(),c;try{c=new URL(t,s)}catch(e){throw new r(e,`SyntaxError`)}if(c.protocol===`http:`?c.protocol=`ws:`:c.protocol===`https:`&&(c.protocol=`wss:`),c.protocol!==`ws:`&&c.protocol!==`wss:`)throw new r(`Expected a ws: or wss: protocol, got ${c.protocol}`,`SyntaxError`);if(c.hash||c.href.endsWith(`#`))throw new r(`Got fragment`,`SyntaxError`);if(typeof i==`string`&&(i=[i]),i.length!==new Set(i.map(e=>e.toLowerCase())).size||i.length>0&&!i.every(e=>y(e)))throw new r(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this[u]=new URL(c.href),this[f]=S(c,i,this,e=>this.#i(e),o),this[d]=e.CONNECTING,this[p]=`blob`}close(t=void 0,i=void 0){if(n.brandCheck(this,e),t!==void 0&&(t=n.converters[`unsigned short`](t,{clamp:!0})),i!==void 0&&(i=n.converters.USVString(i)),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new r(`invalid code`,`InvalidAccessError`);let a=0;if(i!==void 0&&(a=Buffer.byteLength(i),a>123))throw new r(`Reason must be less than 123 bytes; received ${a}`,`SyntaxError`);if(!(this[d]===e.CLOSING||this[d]===e.CLOSED))if(!_(this))b(this,`Connection was closed before it was established.`),this[d]=e.CLOSING;else if(v(this))this[d]=e.CLOSING;else{let e=new C;t!==void 0&&i===void 0?(e.frameData=Buffer.allocUnsafe(2),e.frameData.writeUInt16BE(t,0)):t!==void 0&&i!==void 0?(e.frameData=Buffer.allocUnsafe(2+a),e.frameData.writeUInt16BE(t,0),e.frameData.write(i,2,`utf-8`)):e.frameData=l,this[m].socket.write(e.createFrame(c.CLOSE),e=>{e||(this[h]=!0)}),this[d]=s.CLOSING}}send(t){if(n.brandCheck(this,e),n.argumentLengthCheck(arguments,1,{header:`WebSocket.send`}),t=n.converters.WebSocketSendData(t),this[d]===e.CONNECTING)throw new r(`Sent before connected.`,`InvalidStateError`);if(!_(this)||v(this))return;let i=this[m].socket;if(typeof t==`string`){let e=Buffer.from(t),n=new C(e).createFrame(c.TEXT);this.#t+=e.byteLength,i.write(n,()=>{this.#t-=e.byteLength})}else if(k.isArrayBuffer(t)){let e=Buffer.from(t),n=new C(e).createFrame(c.BINARY);this.#t+=e.byteLength,i.write(n,()=>{this.#t-=e.byteLength})}else if(ArrayBuffer.isView(t)){let e=Buffer.from(t,t.byteOffset,t.byteLength),n=new C(e).createFrame(c.BINARY);this.#t+=e.byteLength,i.write(n,()=>{this.#t-=e.byteLength})}else if(D(t)){let e=new C;t.arrayBuffer().then(t=>{let n=Buffer.from(t);e.frameData=n;let r=e.createFrame(c.BINARY);this.#t+=n.byteLength,i.write(r,()=>{this.#t-=n.byteLength})})}}get readyState(){return n.brandCheck(this,e),this[d]}get bufferedAmount(){return n.brandCheck(this,e),this.#t}get url(){return n.brandCheck(this,e),i(this[u])}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[p]}set binaryType(t){n.brandCheck(this,e),t!==`blob`&&t!==`arraybuffer`?this[p]=`blob`:this[p]=t}#i(e){this[m]=e;let t=new T(this);t.on(`drain`,function(){this.ws[m].socket.resume()}),e.socket.ws=this,this[g]=t,this[d]=s.OPEN;let n=e.headersList.get(`sec-websocket-extensions`);n!==null&&(this.#r=n);let r=e.headersList.get(`sec-websocket-protocol`);r!==null&&(this.#n=r),x(`open`,this)}};j.CONNECTING=j.prototype.CONNECTING=s.CONNECTING,j.OPEN=j.prototype.OPEN=s.OPEN,j.CLOSING=j.prototype.CLOSING=s.CLOSING,j.CLOSED=j.prototype.CLOSED=s.CLOSED,Object.defineProperties(j.prototype,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o,url:E,readyState:E,bufferedAmount:E,onopen:E,onerror:E,onclose:E,close:E,onmessage:E,binaryType:E,send:E,extensions:E,protocol:E,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(j,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o}),n.converters[`sequence`]=n.sequenceConverter(n.converters.DOMString),n.converters[`DOMString or sequence`]=function(e){return n.util.Type(e)===`Object`&&Symbol.iterator in e?n.converters[`sequence`](e):n.converters.DOMString(e)},n.converters.WebSocketInit=n.dictionaryConverter([{key:`protocols`,converter:n.converters[`DOMString or sequence`],get defaultValue(){return[]}},{key:`dispatcher`,converter:e=>e,get defaultValue(){return O()}},{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(D(e))return n.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||k.isAnyArrayBuffer(e))return n.converters.BufferSource(e)}return n.converters.USVString(e)},t.exports={WebSocket:j}})),yt=b(((e,t)=>{let n=ve(),r=le(),i=M(),a=Se(),o=Ce(),s=Te(),c=P(),{InvalidArgumentError:l}=i,u=Pe(),d=de(),f=ze(),p=Ue(),m=Be(),h=Fe(),g=We(),_=Ge(),{getGlobalDispatcher:v,setGlobalDispatcher:y}=Ke(),b=qe(),x=me(),S=he(),C;try{w(`crypto`),C=!0}catch{C=!1}Object.assign(r.prototype,u),t.exports.Dispatcher=r,t.exports.Client=n,t.exports.Pool=a,t.exports.BalancedPool=o,t.exports.Agent=s,t.exports.ProxyAgent=g,t.exports.RetryHandler=_,t.exports.DecoratorHandler=b,t.exports.RedirectHandler=x,t.exports.createRedirectInterceptor=S,t.exports.buildConnector=d,t.exports.errors=i;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 l(`invalid url`);if(n!=null&&typeof n!=`object`)throw new l(`invalid opts`);if(n&&n.path!=null){if(typeof n.path!=`string`)throw new l(`invalid opts.path`);let e=n.path;n.path.startsWith(`/`)||(e=`/${e}`),t=new URL(c.parseOrigin(t).origin+e)}else n||=typeof t==`object`?t:{},t=c.parseURL(t);let{agent:i,dispatcher:a=v()}=n;if(i)throw new l(`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)}}if(t.exports.setGlobalDispatcher=y,t.exports.getGlobalDispatcher=v,c.nodeMajor>16||c.nodeMajor===16&&c.nodeMinor>=8){let e=null;t.exports.fetch=async function(t){e||=Ze().fetch;try{return await e(...arguments)}catch(e){throw typeof e==`object`&&Error.captureStackTrace(e,this),e}},t.exports.Headers=Je().Headers,t.exports.Response=Ye().Response,t.exports.Request=Xe().Request,t.exports.FormData=oe().FormData,t.exports.File=ae().File,t.exports.FileReader=nt().FileReader;let{setGlobalOrigin:n,getGlobalOrigin:r}=K();t.exports.setGlobalOrigin=n,t.exports.getGlobalOrigin=r;let{CacheStorage:i}=ot(),{kConstruct:a}=rt();t.exports.caches=new i(a)}if(c.nodeMajor>=16){let{deleteCookie:e,getCookies:n,getSetCookies:r,setCookie:i}=ut();t.exports.deleteCookie=e,t.exports.getCookies=n,t.exports.getSetCookies=r,t.exports.setCookie=i;let{parseMIMEType:a,serializeAMimeType:o}=ie();t.exports.parseMIMEType=a,t.exports.serializeAMimeType=o}if(c.nodeMajor>=18&&C){let{WebSocket:e}=vt();t.exports.WebSocket=e}t.exports.request=T(u.request),t.exports.stream=T(u.stream),t.exports.pipeline=T(u.pipeline),t.exports.connect=T(u.connect),t.exports.upgrade=T(u.upgrade),t.exports.MockClient=f,t.exports.MockPool=m,t.exports.MockAgent=p,t.exports.mockErrors=h})),bt=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.HttpClient=e.isHttps=e.HttpClientResponse=e.HttpClientError=e.getProxyUrl=e.MediaTypes=e.Headers=e.HttpCodes=void 0;let a=r(w(`http`)),o=r(w(`https`)),s=r(O()),c=r(A()),l=yt();var u;(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`})(u||(e.HttpCodes=u={}));var d;(function(e){e.Accept=`accept`,e.ContentType=`content-type`})(d||(e.Headers=d={}));var f;(function(e){e.ApplicationJson=`application/json`})(f||(e.MediaTypes=f={}));function p(e){let t=s.getProxyUrl(new URL(e));return t?t.href:``}e.getProxyUrl=p;let m=[u.MovedPermanently,u.ResourceMoved,u.SeeOther,u.TemporaryRedirect,u.PermanentRedirect],h=[u.BadGateway,u.ServiceUnavailable,u.GatewayTimeout],g=[`OPTIONS`,`GET`,`DELETE`,`HEAD`];var _=class e extends Error{constructor(t,n){super(t),this.name=`HttpClientError`,this.statusCode=n,Object.setPrototypeOf(this,e.prototype)}};e.HttpClientError=_;var v=class{constructor(e){this.message=e}readBody(){return i(this,void 0,void 0,function*(){return new Promise(e=>i(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 i(this,void 0,void 0,function*(){return new Promise(e=>i(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}};e.HttpClientResponse=v;function y(e){return new URL(e).protocol===`https:`}e.isHttps=y,e.HttpClient=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=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 i(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return i(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return i(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return i(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return i(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e,t={}){return i(this,void 0,void 0,function*(){t[d.Accept]=this._getExistingOrDefaultHeader(t,d.Accept,f.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t,n={}){return i(this,void 0,void 0,function*(){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,f.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t,n={}){return i(this,void 0,void 0,function*(){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,f.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t,n={}){return i(this,void 0,void 0,function*(){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,f.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return i(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&&g.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===u.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&&m.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||!h.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 v(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=s.getProxyUrl(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?o:a;let s=i?443:80;if(r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):s,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({},b(this.requestOptions.headers),b(e||{})):b(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;return this.requestOptions&&this.requestOptions.headers&&(r=b(this.requestOptions.headers)[t]),e[t]||r||n}_getAgent(e){let t,n=s.getProxyUrl(e),r=n&&n.hostname;if(this._keepAlive&&r&&(t=this._proxyAgent),r||(t=this._agent),t)return t;let i=e.protocol===`https:`,l=100;if(this.requestOptions&&(l=this.requestOptions.maxSockets||a.globalAgent.maxSockets),n&&n.hostname){let e={maxSockets:l,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},r,a=n.protocol===`https:`;r=i?a?c.httpsOverHttps:c.httpsOverHttp:a?c.httpOverHttps:c.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:l};t=i?new o.Agent(e):new a.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 l.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}_performExponentialBackoff(e){return i(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 i(this,void 0,void 0,function*(){return new Promise((n,r)=>i(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===u.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 _(e,i);t.result=a.result,r(t)}else n(a)}))})}};let b=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{})})),xt=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.PersonalAccessTokenCredentialHandler=e.BearerCredentialHandler=e.BasicCredentialHandler=void 0,e.BasicCredentialHandler=class{constructor(e,t){this.username=e,this.password=t}prepareRequest(e){if(!e.headers)throw Error(`The request has no headers`);e.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString(`base64`)}`}canHandleAuthentication(){return!1}handleAuthentication(){return t(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},e.BearerCredentialHandler=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 t(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},e.PersonalAccessTokenCredentialHandler=class{constructor(e){this.token=e}prepareRequest(e){if(!e.headers)throw Error(`The request has no headers`);e.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString(`base64`)}`}canHandleAuthentication(){return!1}handleAuthentication(){return t(this,void 0,void 0,function*(){throw Error(`not implemented`)})}}})),St=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.OidcClient=void 0;let n=bt(),r=xt(),i=At();e.OidcClient=class e{static createHttpClient(t=!0,i=10){let a={allowRetries:t,maxRetries:i};return new n.HttpClient(`actions/oidc-client`,[new r.BearerCredentialHandler(e.getRequestToken())],a)}static getRequestToken(){let e=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!e)throw Error(`Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable`);return e}static getIDTokenUrl(){let e=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!e)throw Error(`Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable`);return e}static getCall(n){return t(this,void 0,void 0,function*(){let t=(yield e.createHttpClient().getJson(n).catch(e=>{throw Error(`Failed to get ID Token. \n Error Code : ${e.statusCode}\n Error Message: ${e.message}`)})).result?.value;if(!t)throw Error(`Response json body do not have ID Token field`);return t})}static getIDToken(n){return t(this,void 0,void 0,function*(){try{let t=e.getIDTokenUrl();n&&(t=`${t}&audience=${encodeURIComponent(n)}`),(0,i.debug)(`ID token url is ${t}`);let r=yield e.getCall(t);return(0,i.setSecret)(r),r}catch(e){throw Error(`Error message: ${e.message}`)}})}}})),Ct=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.summary=e.markdownSummary=e.SUMMARY_DOCS_URL=e.SUMMARY_ENV_VAR=void 0;let n=w(`os`),r=w(`fs`),{access:i,appendFile:a,writeFile:o}=r.promises;e.SUMMARY_ENV_VAR=`GITHUB_STEP_SUMMARY`,e.SUMMARY_DOCS_URL=`https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary`;let s=new class{constructor(){this._buffer=``}filePath(){return t(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[e.SUMMARY_ENV_VAR];if(!t)throw Error(`Unable to find environment variable for $${e.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield i(t,r.constants.R_OK|r.constants.W_OK)}catch{throw Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,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 t(this,void 0,void 0,function*(){let t=!!e?.overwrite,n=yield this.filePath();return yield(t?o:a)(n,this._buffer,{encoding:`utf8`}),this.emptyBuffer()})}clear(){return t(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(n.EOL)}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()}};e.markdownSummary=s,e.summary=s})),wt=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.toPlatformPath=e.toWin32Path=e.toPosixPath=void 0;let i=r(w(`path`));function a(e){return e.replace(/[\\]/g,`/`)}e.toPosixPath=a;function o(e){return e.replace(/[/]/g,`\\`)}e.toWin32Path=o;function s(e){return e.replace(/[/\\]/g,i.sep)}e.toPlatformPath=s})),Tt=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})},a;Object.defineProperty(e,`__esModule`,{value:!0}),e.getCmdPath=e.tryGetExecutablePath=e.isRooted=e.isDirectory=e.exists=e.READONLY=e.UV_FS_O_EXLOCK=e.IS_WINDOWS=e.unlink=e.symlink=e.stat=e.rmdir=e.rm=e.rename=e.readlink=e.readdir=e.open=e.mkdir=e.lstat=e.copyFile=e.chmod=void 0;let o=r(w(`fs`)),s=r(w(`path`));a=o.promises,e.chmod=a.chmod,e.copyFile=a.copyFile,e.lstat=a.lstat,e.mkdir=a.mkdir,e.open=a.open,e.readdir=a.readdir,e.readlink=a.readlink,e.rename=a.rename,e.rm=a.rm,e.rmdir=a.rmdir,e.stat=a.stat,e.symlink=a.symlink,e.unlink=a.unlink,e.IS_WINDOWS=process.platform===`win32`,e.UV_FS_O_EXLOCK=268435456,e.READONLY=o.constants.O_RDONLY;function c(t){return i(this,void 0,void 0,function*(){try{yield e.stat(t)}catch(e){if(e.code===`ENOENT`)return!1;throw e}return!0})}e.exists=c;function l(t,n=!1){return i(this,void 0,void 0,function*(){return(n?yield e.stat(t):yield e.lstat(t)).isDirectory()})}e.isDirectory=l;function u(t){if(t=f(t),!t)throw Error(`isRooted() parameter "p" cannot be empty`);return e.IS_WINDOWS?t.startsWith(`\\`)||/^[A-Z]:/i.test(t):t.startsWith(`/`)}e.isRooted=u;function d(t,n){return i(this,void 0,void 0,function*(){let r;try{r=yield e.stat(t)}catch(e){e.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${t}': ${e}`)}if(r&&r.isFile()){if(e.IS_WINDOWS){let e=s.extname(t).toUpperCase();if(n.some(t=>t.toUpperCase()===e))return t}else if(p(r))return t}let i=t;for(let a of n){t=i+a,r=void 0;try{r=yield e.stat(t)}catch(e){e.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${t}': ${e}`)}if(r&&r.isFile()){if(e.IS_WINDOWS){try{let n=s.dirname(t),r=s.basename(t).toUpperCase();for(let i of yield e.readdir(n))if(r===i.toUpperCase()){t=s.join(n,i);break}}catch(e){console.log(`Unexpected error attempting to determine the actual case of the file '${t}': ${e}`)}return t}else if(p(r))return t}}return``})}e.tryGetExecutablePath=d;function f(t){return t||=``,e.IS_WINDOWS?(t=t.replace(/\//g,`\\`),t.replace(/\\\\+/g,`\\`)):t.replace(/\/\/+/g,`/`)}function p(e){return(e.mode&1)>0||(e.mode&8)>0&&e.gid===process.getgid()||(e.mode&64)>0&&e.uid===process.getuid()}function m(){return process.env.COMSPEC??`cmd.exe`}e.getCmdPath=m})),Et=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.findInPath=e.which=e.mkdirP=e.rmRF=e.mv=e.cp=void 0;let a=w(`assert`),o=r(w(`path`)),s=r(Tt());function c(e,t,n={}){return i(this,void 0,void 0,function*(){let{force:r,recursive:i,copySourceDirectory:a}=m(n),c=(yield s.exists(t))?yield s.stat(t):null;if(c&&c.isFile()&&!r)return;let l=c&&c.isDirectory()&&a?o.join(t,o.basename(e)):t;if(!(yield s.exists(e)))throw Error(`no such file or directory: ${e}`);if((yield s.stat(e)).isDirectory())if(i)yield h(e,l,0,r);else throw Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`);else{if(o.relative(e,l)===``)throw Error(`'${l}' and '${e}' are the same file`);yield g(e,l,r)}})}e.cp=c;function l(e,t,n={}){return i(this,void 0,void 0,function*(){if(yield s.exists(t)){let r=!0;if((yield s.isDirectory(t))&&(t=o.join(t,o.basename(e)),r=yield s.exists(t)),r)if(n.force==null||n.force)yield u(t);else throw Error(`Destination already exists`)}yield d(o.dirname(t)),yield s.rename(e,t)})}e.mv=l;function u(e){return i(this,void 0,void 0,function*(){if(s.IS_WINDOWS&&/[*"<>|]/.test(e))throw Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield s.rm(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(e){throw Error(`File was unable to be removed ${e}`)}})}e.rmRF=u;function d(e){return i(this,void 0,void 0,function*(){a.ok(e,`a path argument must be provided`),yield s.mkdir(e,{recursive:!0})})}e.mkdirP=d;function f(e,t){return i(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);if(t){let t=yield f(e,!1);if(!t)throw s.IS_WINDOWS?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 p(e);return n&&n.length>0?n[0]:``})}e.which=f;function p(e){return i(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);let t=[];if(s.IS_WINDOWS&&process.env.PATHEXT)for(let e of process.env.PATHEXT.split(o.delimiter))e&&t.push(e);if(s.isRooted(e)){let n=yield s.tryGetExecutablePath(e,t);return n?[n]:[]}if(e.includes(o.sep))return[];let n=[];if(process.env.PATH)for(let e of process.env.PATH.split(o.delimiter))e&&n.push(e);let r=[];for(let i of n){let n=yield s.tryGetExecutablePath(o.join(i,e),t);n&&r.push(n)}return r})}e.findInPath=p;function m(e){return{force:e.force==null?!0:e.force,recursive:!!e.recursive,copySourceDirectory:e.copySourceDirectory==null?!0:!!e.copySourceDirectory}}function h(e,t,n,r){return i(this,void 0,void 0,function*(){if(n>=255)return;n++,yield d(t);let i=yield s.readdir(e);for(let a of i){let i=`${e}/${a}`,o=`${t}/${a}`;(yield s.lstat(i)).isDirectory()?yield h(i,o,n,r):yield g(i,o,r)}yield s.chmod(t,(yield s.stat(e)).mode)})}function g(e,t,n){return i(this,void 0,void 0,function*(){if((yield s.lstat(e)).isSymbolicLink()){try{yield s.lstat(t),yield s.unlink(t)}catch(e){e.code===`EPERM`&&(yield s.chmod(t,`0666`),yield s.unlink(t))}let n=yield s.readlink(e);yield s.symlink(n,t,s.IS_WINDOWS?`junction`:null)}else (!(yield s.exists(t))||n)&&(yield s.copyFile(e,t))})}})),Dt=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.argStringToArray=e.ToolRunner=void 0;let a=r(w(`os`)),o=r(w(`events`)),s=r(w(`child_process`)),c=r(w(`path`)),l=r(Et()),u=r(Tt()),d=w(`timers`),f=process.platform===`win32`;e.ToolRunner=class extends o.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(f)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,n){try{let r=t+e.toString(),i=r.indexOf(a.EOL);for(;i>-1;)n(r.substring(0,i)),r=r.substring(i+a.EOL.length),i=r.indexOf(a.EOL);return r}catch(e){return this._debug(`error processing line. Failed with error ${e}`),``}}_getSpawnFileName(){return f&&this._isCmdFile()?process.env.COMSPEC||`cmd.exe`:this.toolPath}_getSpawnArgs(e){if(f&&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 i(this,void 0,void 0,function*(){return!u.isRooted(this.toolPath)&&(this.toolPath.includes(`/`)||f&&this.toolPath.includes(`\\`))&&(this.toolPath=c.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield l.which(this.toolPath,!0),new Promise((e,t)=>i(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 n=this._cloneExecOptions(this.options);!n.silent&&n.outStream&&n.outStream.write(this._getCommandString(n)+a.EOL);let r=new m(n,this.toolPath);if(r.on(`debug`,e=>{this._debug(e)}),this.options.cwd&&!(yield u.exists(this.options.cwd)))return t(Error(`The cwd: ${this.options.cwd} does not exist!`));let i=this._getSpawnFileName(),o=s.spawn(i,this._getSpawnArgs(n),this._getSpawnOptions(this.options,i)),c=``;o.stdout&&o.stdout.on(`data`,e=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(e),!n.silent&&n.outStream&&n.outStream.write(e),c=this._processLineBuffer(e,c,e=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(e)})});let l=``;if(o.stderr&&o.stderr.on(`data`,e=>{r.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(e),!n.silent&&n.errStream&&n.outStream&&(n.failOnStdErr?n.errStream:n.outStream).write(e),l=this._processLineBuffer(e,l,e=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(e)})}),o.on(`error`,e=>{r.processError=e.message,r.processExited=!0,r.processClosed=!0,r.CheckComplete()}),o.on(`exit`,e=>{r.processExitCode=e,r.processExited=!0,this._debug(`Exit code ${e} received from tool '${this.toolPath}'`),r.CheckComplete()}),o.on(`close`,e=>{r.processExitCode=e,r.processExited=!0,r.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),r.CheckComplete()}),r.on(`done`,(n,r)=>{c.length>0&&this.emit(`stdline`,c),l.length>0&&this.emit(`errline`,l),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 p(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}e.argStringToArray=p;var m=class e extends o.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=d.setTimeout(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()}}}})),Ot=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.getExecOutput=e.exec=void 0;let a=w(`string_decoder`),o=r(Dt());function s(e,t,n){return i(this,void 0,void 0,function*(){let r=o.argStringToArray(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 o.ToolRunner(i,t,n).exec()})}e.exec=s;function c(e,t,n){return i(this,void 0,void 0,function*(){let r=``,i=``,o=new a.StringDecoder(`utf8`),c=new a.StringDecoder(`utf8`),l=n?.listeners?.stdout,u=n?.listeners?.stderr,d=Object.assign(Object.assign({},n?.listeners),{stdout:e=>{r+=o.write(e),l&&l(e)},stderr:e=>{i+=c.write(e),u&&u(e)}}),f=yield s(e,t,Object.assign(Object.assign({},n),{listeners:d}));return r+=o.end(),i+=c.end(),{exitCode:f,stdout:r,stderr:i}})}e.getExecOutput=c})),kt=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})},a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.getDetails=e.isLinux=e.isMacOS=e.isWindows=e.arch=e.platform=void 0;let o=a(w(`os`)),s=r(Ot()),c=()=>i(void 0,void 0,void 0,function*(){let{stdout:e}=yield s.getExecOutput(`powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"`,void 0,{silent:!0}),{stdout:t}=yield s.getExecOutput(`powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"`,void 0,{silent:!0});return{name:t.trim(),version:e.trim()}}),l=()=>i(void 0,void 0,void 0,function*(){let{stdout:e}=yield s.getExecOutput(`sw_vers`,void 0,{silent:!0}),t=e.match(/ProductVersion:\s*(.+)/)?.[1]??``;return{name:e.match(/ProductName:\s*(.+)/)?.[1]??``,version:t}}),u=()=>i(void 0,void 0,void 0,function*(){let{stdout:e}=yield s.getExecOutput(`lsb_release`,[`-i`,`-r`,`-s`],{silent:!0}),[t,n]=e.trim().split(` `);return{name:t,version:n}});e.platform=o.default.platform(),e.arch=o.default.arch(),e.isWindows=e.platform===`win32`,e.isMacOS=e.platform===`darwin`,e.isLinux=e.platform===`linux`;function d(){return i(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield e.isWindows?c():e.isMacOS?l():u()),{platform:e.platform,arch:e.arch,isWindows:e.isWindows,isMacOS:e.isMacOS,isLinux:e.isLinux})})}e.getDetails=d})),At=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.platform=e.toPlatformPath=e.toWin32Path=e.toPosixPath=e.markdownSummary=e.summary=e.getIDToken=e.getState=e.saveState=e.group=e.endGroup=e.startGroup=e.info=e.notice=e.warning=e.error=e.debug=e.isDebug=e.setFailed=e.setCommandEcho=e.setOutput=e.getBooleanInput=e.getMultilineInput=e.getInput=e.addPath=e.setSecret=e.exportVariable=e.ExitCode=void 0;let a=E(),o=D(),s=T(),c=r(w(`os`)),l=r(w(`path`)),u=St();var d;(function(e){e[e.Success=0]=`Success`,e[e.Failure=1]=`Failure`})(d||(e.ExitCode=d={}));function f(e,t){let n=(0,s.toCommandValue)(t);if(process.env[e]=n,process.env.GITHUB_ENV)return(0,o.issueFileCommand)(`ENV`,(0,o.prepareKeyValueMessage)(e,t));(0,a.issueCommand)(`set-env`,{name:e},n)}e.exportVariable=f;function p(e){(0,a.issueCommand)(`add-mask`,{},e)}e.setSecret=p;function m(e){process.env.GITHUB_PATH?(0,o.issueFileCommand)(`PATH`,e):(0,a.issueCommand)(`add-path`,{},e),process.env.PATH=`${e}${l.delimiter}${process.env.PATH}`}e.addPath=m;function h(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()}e.getInput=h;function g(e,t){let n=h(e,t).split(` @@ -52,7 +52,7 @@ ${e.format(t)} $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${g}`),i=!1,a=r(u,!0);p!==`folded`&&o!==t.Scalar.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let c=n.foldFlowLines(`${T}${e}${b}`,g,n.FOLD_BLOCK,a);if(!i)return`>${E}\n${g}${c}`}return s=s.replace(/\n+/g,`$&${g}`),`|${E}\n${g}${T}${s}${b}`}function d(e,a,o,s){let{type:l,value:d}=e,{actualString:f,implicitKey:p,indent:m,indentStep:h,inFlow:g}=a;if(p&&d.includes(` `)||g&&/[[\]{},]/.test(d))return c(d,a);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(d))return p||g||!d.includes(` `)?c(d,a):u(e,a,o,s);if(!p&&!g&&l!==t.Scalar.PLAIN&&d.includes(` -`))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}function f(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}e.stringifyString=f})),Gt=b((e=>{var t=Pt(),n=jt(),r=Ht(),i=Wt();function a(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}}function o(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function s(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}function c(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let c,l=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>c=e});c??=o(t.doc.schema.tags,l);let u=s(l,c,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);let d=typeof c.stringify==`function`?c.stringify(l,t,r,a):n.isScalar(l)?i.stringifyString(l,t,r,a):l.toString(t,r,a);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}e.createStringifyContext=a,e.stringify=c})),Kt=b((e=>{var t=jt(),n=zt(),r=Gt(),i=Ht();function a({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:m,simpleKeys:h}}=o,g=t.isNode(e)&&e.comment||null;if(h){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!h&&(!e||g&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!_&&(h||!l),indent:d+f});let v=!1,y=!1,b=r.stringify(e,o,()=>v=!0,()=>y=!0);if(!_&&!o.inFlow&&b.length>1024){if(h)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(o.inFlow){if(l||a==null)return v&&s&&s(),b===``?`?`:_?`? ${b}`:b}else if(l&&!h||a==null&&_)return b=`? ${b}`,g&&!v?b+=i.lineComment(b,o.indent,p(g)):y&&c&&c(),b;v&&(g=null),_?(g&&(b+=i.lineComment(b,o.indent,p(g))),b=`? ${b}\n${d}:`):(b=`${b}:`,g&&(b+=i.lineComment(b,o.indent,p(g))));let x,S,C;t.isNode(a)?(x=!!a.spaceBefore,S=a.commentBefore,C=a.comment):(x=!1,S=null,C=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!_&&!g&&t.isScalar(a)&&(o.indentAtStart=b.length+1),y=!1,!m&&f.length>=2&&!o.inFlow&&!_&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let w=!1,T=r.stringify(a,o,()=>w=!0,()=>y=!0),E=` `;if(g||x||S){if(E=x?` +`))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}function f(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}e.stringifyString=f})),Gt=b((e=>{var t=Pt(),n=jt(),r=Ht(),i=Wt();function a(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}}function o(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function s(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}function c(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let c,l=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>c=e});c??=o(t.doc.schema.tags,l);let u=s(l,c,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);let d=typeof c.stringify==`function`?c.stringify(l,t,r,a):n.isScalar(l)?i.stringifyString(l,t,r,a):l.toString(t,r,a);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}e.createStringifyContext=a,e.stringify=c})),Kt=b((e=>{var t=jt(),n=zt(),r=Gt(),i=Ht();function a({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:m,simpleKeys:h}}=o,g=t.isNode(e)&&e.comment||null;if(h){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!h&&(!e||g&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!_&&(h||!l),indent:d+f});let v=!1,y=!1,b=r.stringify(e,o,()=>v=!0,()=>y=!0);if(!_&&!o.inFlow&&b.length>1024){if(h)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(o.inFlow){if(l||a==null)return v&&s&&s(),b===``?`?`:_?`? ${b}`:b}else if(l&&!h||a==null&&_)return b=`? ${b}`,g&&!v?b+=i.lineComment(b,o.indent,p(g)):y&&c&&c(),b;v&&(g=null),_?(g&&(b+=i.lineComment(b,o.indent,p(g))),b=`? ${b}\n${d}:`):(b=`${b}:`,g&&(b+=i.lineComment(b,o.indent,p(g))));let x,S,C;t.isNode(a)?(x=!!a.spaceBefore,S=a.commentBefore,C=a.comment):(x=!1,S=null,C=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!_&&!g&&t.isScalar(a)&&(o.indentAtStart=b.length+1),y=!1,!m&&f.length>=2&&!o.inFlow&&!_&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let w=!1,T=r.stringify(a,o,()=>w=!0,()=>y=!0),E=` `;if(g||x||S){if(E=x?` `:``,S){let e=p(S);E+=`\n${i.indentComment(e,o.indent)}`}T===``&&!o.inFlow?E===` `&&C&&(E=` @@ -60,8 +60,8 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ `),n=t!==-1,r=o.inFlow??a.flow??a.items.length===0;if(n||!r){let r=!1;if(n&&(e===`&`||e===`!`)){let n=T.indexOf(` `);e===`&`&&n!==-1&&n{var t=w(`process`);function n(e,...t){e===`debug`&&console.log(...t)}function r(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}e.debug=n,e.warn=r})),Jt=b((e=>{var t=jt(),n=zt();let r={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(`<<`)),{addToJSMap:a}),stringify:()=>`<<`},i=(e,i)=>(r.identify(i)||t.isScalar(i)&&(!i.type||i.type===n.Scalar.PLAIN)&&r.identify(i.value))&&e?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default);function a(e,n,r){if(r=e&&t.isAlias(r)?r.resolve(e.doc):r,t.isSeq(r))for(let t of r.items)o(e,n,t);else if(Array.isArray(r))for(let t of r)o(e,n,t);else o(e,n,r)}function o(e,n,r){let i=e&&t.isAlias(r)?r.resolve(e.doc):r;if(!t.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,t]of a)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}e.addMergeToJSMap=a,e.isMergeKey=i,e.merge=r})),Yt=b((e=>{var t=qt(),n=Jt(),r=Gt(),i=jt(),a=It();function o(e,t,{key:r,value:o}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,o);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=s(r,n,e),c=a.toJS(o,i,e);i in t?Object.defineProperty(t,i,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[i]=c}}return t}function s(e,n,a){if(n===null)return``;if(typeof n!=`object`)return String(n);if(i.isNode(e)&&a?.doc){let n=r.createStringifyContext(a.doc,{});n.anchors=new Set;for(let e of a.anchors.keys())n.anchors.add(e.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(n)}e.addPairToJSMap=o})),Xt=b((e=>{var t=Bt(),n=Kt(),r=Yt(),i=jt();function a(e,n,r){return new o(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var o=class e{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return i.isNode(n)&&(n=n.clone(t)),i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=o,e.createPair=a})),Zt=b((e=>{var t=jt(),n=Gt(),r=Ht();function i(e,t,n){return(t.inFlow??e.flow?o:a)(e,t,n)}function a({comment:e,items:i},a,{blockItemPrefix:o,flowChars:c,itemIndent:l,onChompKeep:u,onComment:d}){let{indent:f,options:{commentString:p}}=a,m=Object.assign({},a,{indent:l,type:null}),h=!1,g=[];for(let e=0;eu=null,()=>h=!0);u&&(d+=r.lineComment(d,l,p(u))),h&&u&&(h=!1),g.push(o+d)}let _;if(g.length===0)_=c.start+c.end;else{_=g[0];for(let e=1;el=null);am||u.includes(` -`))&&(p=!0),h.push(u),m=h.length}let{start:g,end:_}=a;if(h.length===0)return g+_;if(!p){let e=h.reduce((e,t)=>e+t.length+2,2);p=i.options.lineWidth>0&&e>i.options.lineWidth}if(p){let e=g;for(let t of h)e+=t?`\n${l}${c}${t}`:` +`+r.indentComment(p(e),f),d&&d()):h&&u&&u(),_}function o({items:e},i,{flowChars:a,itemIndent:o}){let{indent:c,indentStep:l,flowCollectionPadding:u,options:{commentString:d}}=i;o+=l;let f=Object.assign({},i,{indent:o,inFlow:!0,type:null}),p=!1,m=0,h=[];for(let a=0;al=null);p||=h.length>m||u.includes(` +`),a0&&(p||=h.reduce((e,t)=>e+t.length+2,2)+(u.length+2)>i.options.lineWidth),p&&(u+=`,`)),l&&(u+=r.lineComment(u,o,d(l))),h.push(u),m=h.length}let{start:g,end:_}=a;if(h.length===0)return g+_;if(!p){let e=h.reduce((e,t)=>e+t.length+2,2);p=i.options.lineWidth>0&&e>i.options.lineWidth}if(p){let e=g;for(let t of h)e+=t?`\n${l}${c}${t}`:` `;return`${e}\n${c}${_}`}else return`${g}${u}${h.join(` `)}${u}${_}`}function s({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=i})),Qt=b((e=>{var t=Zt(),n=Yt(),r=Vt(),i=jt(),a=Xt(),o=zt();function s(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),s=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)s(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))s(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=s(this.items,n.key),c=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(c){let e=this.items.findIndex(e=>c(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=s(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=s(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!s(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=s})),$t=b((e=>{var t=jt(),n=Qt();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),en=b((e=>{var t=Bt(),n=Zt(),r=Vt(),i=jt(),a=zt(),o=It(),s=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=c(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=c(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=c(e);return typeof t==`number`&&t=0?t:null}e.YAMLSeq=s})),tn=b((e=>{var t=jt(),n=en();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),nn=b((e=>{var t=Wt();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),rn=b((e=>{var t=zt();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),an=b((e=>{var t=zt();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),on=b((e=>{function t({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}e.stringifyNumber=t})),sn=b((e=>{var t=zt(),n=on();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),cn=b((e=>{var t=on();let n=e=>typeof e==`bigint`||Number.isInteger(e),r=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function i(e,r,i){let{value:a}=e;return n(a)&&a>=0?i+a.toString(r):t.stringifyNumber(e)}e.int={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)},e.intOct={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>r(e,2,8,n),stringify:e=>i(e,8,`0o`)}})),ln=b((e=>{var t=$t(),n=rn(),r=tn(),i=nn(),a=an(),o=sn(),s=cn();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),un=b((e=>{var t=zt(),n=$t(),r=tn();function i(e){return typeof e==`bigint`||Number.isInteger(e)}let a=({value:e})=>JSON.stringify(e),o=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:a},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:a},{identify:i,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>i(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}];e.schema=[n.map,r.seq].concat(o,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),dn=b((e=>{var t=w(`buffer`),n=zt(),r=Wt();e.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,n){if(typeof t.Buffer==`function`)return t.Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e{var t=jt(),n=Xt(),r=zt(),i=en();function a(e,i){if(t.isSeq(e))for(let a=0;a1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function o(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e))if(e.length===2)i=e[0],c=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let s={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:a,createNode:o};e.createPairs=o,e.pairs=s,e.resolvePairs=a})),pn=b((e=>{var t=jt(),n=It(),r=Qt(),i=en(),a=fn(),o=class e extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),mn=b((e=>{var t=zt();function n({value:e,source:t},n){return t&&(e?r:i).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let r={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:n},i={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t.Scalar(!1),stringify:n};e.falseTag=i,e.trueTag=r})),hn=b((e=>{var t=zt(),n=on();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),gn=b((e=>{var t=on();let n=e=>typeof e==`bigint`||Number.isInteger(e);function r(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function i(e,r,i){let{value:a}=e;if(n(a)){let e=a.toString(r);return a<0?`-`+i+e.substr(1):i+e}return t.stringifyNumber(e)}let a={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>i(e,2,`0b`)},o={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>i(e,8,`0`)},s={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)};e.int=s,e.intBin=a,e.intHex=c,e.intOct=o})),_n=b((e=>{var t=jt(),n=Xt(),r=Qt(),i=class e extends r.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),vn=b((e=>{var t=on();function n(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function r(e){let{value:n}=e,r=e=>e;if(typeof n==`bigint`)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let i=``;n<0&&(i=`-`,n*=r(-1));let a=r(60),o=[n%a];return n<60?o.unshift(0):(n=(n-o[0])/a,o.unshift(n%a),n>=60&&(n=(n-o[0])/a,o.unshift(n))),i+o.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let i={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:r},a={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:r},o={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(o.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,r,i,a,s,c,l]=t.map(Number),u=t[7]?Number((t[7]+`00`).substr(1,3)):0,d=Date.UTC(r,i-1,a,s||0,c||0,l||0,u),f=t[8];if(f&&f!==`Z`){let e=n(f,!1);Math.abs(e)<30&&(e*=60),d-=6e4*e}return new Date(d)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=a,e.intTime=i,e.timestamp=o})),yn=b((e=>{var t=$t(),n=rn(),r=tn(),i=nn(),a=dn(),o=mn(),s=hn(),c=gn(),l=Jt(),u=pn(),d=fn(),f=_n(),p=vn();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),bn=b((e=>{var t=$t(),n=rn(),r=tn(),i=nn(),a=an(),o=sn(),s=cn(),c=ln(),l=un(),u=dn(),d=Jt(),f=pn(),p=fn(),m=yn(),h=_n(),g=vn();let _=new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,m.schema],[`yaml-1.1`,m.schema]]),v={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:g.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:g.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:h.set,timestamp:g.timestamp},y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":g.timestamp};function b(e,t,n){let r=_.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?v[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(v).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}e.coreKnownTags=y,e.getTags=b})),xn=b((e=>{var t=jt(),n=$t(),r=tn(),i=nn(),a=bn();let o=(e,t)=>e.keyt.key?1:0;e.Schema=class e{constructor({compat:e,customTags:s,merge:c,resolveKnownTags:l,schema:u,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof u==`string`&&u||`core`,this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(s,this.name,c),this.toStringOptions=f??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof d==`function`?d:d===!0?o:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}})),Sn=b((e=>{var t=jt(),n=Gt(),r=Ht();function i(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd)if(e.comment){let t=c(e.comment);t.includes(` `)?(a.push(`...`),a.push(r.indentComment(t,``))):a.push(`... ${t}`)}else a.push(`...`);else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,``)),t&&((!l||u)&&a[a.length-1]!==``&&a.push(``),a.push(r.indentComment(c(t),``)))}return a.join(` @@ -104,7 +104,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ `);)r===` `&&(n+=` `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}let l={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:` -`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function u(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}e.resolveFlowScalar=r})),In=b((e=>{var t=jt(),n=zt(),r=Pn(),i=Fn();function a(e,a,c,l){let{value:u,type:d,comment:f,range:p}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,l):i.resolveFlowScalar(a,e.options.strict,l),m=c?e.directives.tagName(c.source,e=>l(c,`TAG_RESOLVE_FAILED`,e)):null,h;h=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:m?o(e.schema,u,m,c,l):a.type===`scalar`?s(e,u,a,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??a,`TAG_RESOLVE_FAILED`,e),e.options);g=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);l(c??a,`TAG_RESOLVE_FAILED`,t),g=new n.Scalar(u)}return g.range=p,g.source=u,d&&(g.type=d),m&&(g.tag=m),h.format&&(g.format=h.format),f&&(g.comment=f),g}function o(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(t.default&&t.test)o.push(t);else return t;for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function s({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=a})),Ln=b((e=>{function t(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}e.emptyScalarPosition=t})),Rn=b((e=>{var t=Rt(),n=jt(),r=Nn(),i=In(),a=jn(),o=Ln();let s={composeNode:c,composeEmptyNode:l};function c(e,t,a,o){let c=e.atKey,{spaceBefore:d,comment:f,anchor:p,tag:m}=a,h,g=!0;switch(t.type){case`alias`:h=u(e,t,o),(p||m)&&o(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:h=i.composeScalar(e,t,m,o),p&&(h.anchor=p.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1));break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),h=l(e,t.offset,void 0,null,a,o),g=!1}return p&&h.anchor===``&&o(p,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(h)||typeof h.value!=`string`||h.tag&&h.tag!==`tag:yaml.org,2002:str`)&&o(m??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),d&&(h.spaceBefore=!0),f&&(t.type===`scalar`&&t.source===``?h.comment=f:h.commentBefore=f),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function l(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function u({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=l,e.composeNode=c})),zn=b((e=>{var t=Cn(),n=Rn(),r=jn(),i=Tn();function a(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!m.hasNewline&&u(m.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,m,u):n.composeEmptyNode(p,m.end,s,null,m,u);let h=f.contents.range[2],g=r.resolveEnd(l,h,!1,u);return g.comment&&(f.comment=g.comment),f.range=[o,h,g.offset],f}e.composeDoc=a})),Bn=b((e=>{var t=w(`process`),n=Nt(),r=Cn(),i=wn(),a=jt(),o=zn(),s=jn();function c(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function l(e){let t=``,n=!1,r=!1;for(let i=0;i{var t=jt(),n=zt(),r=Pn(),i=Fn();function a(e,a,c,l){let{value:u,type:d,comment:f,range:p}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,l):i.resolveFlowScalar(a,e.options.strict,l),m=c?e.directives.tagName(c.source,e=>l(c,`TAG_RESOLVE_FAILED`,e)):null,h;h=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:m?o(e.schema,u,m,c,l):a.type===`scalar`?s(e,u,a,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??a,`TAG_RESOLVE_FAILED`,e),e.options);g=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);l(c??a,`TAG_RESOLVE_FAILED`,t),g=new n.Scalar(u)}return g.range=p,g.source=u,d&&(g.type=d),m&&(g.tag=m),h.format&&(g.format=h.format),f&&(g.comment=f),g}function o(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(t.default&&t.test)o.push(t);else return t;for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function s({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=a})),Ln=b((e=>{function t(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}e.emptyScalarPosition=t})),Rn=b((e=>{var t=Rt(),n=jt(),r=Nn(),i=In(),a=jn(),o=Ln();let s={composeNode:c,composeEmptyNode:l};function c(e,t,a,o){let c=e.atKey,{spaceBefore:d,comment:f,anchor:p,tag:m}=a,h,g=!0;switch(t.type){case`alias`:h=u(e,t,o),(p||m)&&o(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:h=i.composeScalar(e,t,m,o),p&&(h.anchor=p.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1))}catch(e){o(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),g=!1}return h??=l(e,t.offset,void 0,null,a,o),p&&h.anchor===``&&o(p,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(h)||typeof h.value!=`string`||h.tag&&h.tag!==`tag:yaml.org,2002:str`)&&o(m??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),d&&(h.spaceBefore=!0),f&&(t.type===`scalar`&&t.source===``?h.comment=f:h.commentBefore=f),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function l(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function u({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=l,e.composeNode=c})),zn=b((e=>{var t=Cn(),n=Rn(),r=jn(),i=Tn();function a(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!m.hasNewline&&u(m.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,m,u):n.composeEmptyNode(p,m.end,s,null,m,u);let h=f.contents.range[2],g=r.resolveEnd(l,h,!1,u);return g.comment&&(f.comment=g.comment),f.range=[o,h,g.offset],f}e.composeDoc=a})),Bn=b((e=>{var t=w(`process`),n=Nt(),r=Cn(),i=wn(),a=jt(),o=zn(),s=jn();function c(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function l(e){let t=``,n=!1,r=!1;for(let i=0;i{let a=c(e);r?this.warnings.push(new i.YAMLWarning(a,t,n)):this.errors.push(new i.YAMLParseError(a,t,n))},this.directives=new n.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=l(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(a.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];a.isPair(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:l(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(t.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=c(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=o.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=s.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),n=new r.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),Vn=b((e=>{var t=Pn(),n=Fn(),r=wn(),i=Wt();function a(e,i=!0,a){if(e){let o=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,o);case`block-scalar`:return t.resolveBlockScalar({options:{strict:i}},e,o)}}return null}function o(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:`newline`,offset:-1,indent:r,source:` @@ -184,7 +184,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ `),d=r.computeHMACSHA256(u);return{sasQueryParameters:new a.SASQueryParameters(e.version,d,l,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,o,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,r.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId,e.encryptionScope),stringToSign:u}}function _(e,r){if(e=y(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let o=`c`,c=e.snapshotTime;e.blobName&&(o=`b`,e.snapshotTime?o=`bs`:e.versionId&&(o=`bv`,c=e.versionId));let l;e.permissions&&(l=e.blobName?t.BlobSASPermissions.parse(e.permissions.toString()).toString():n.ContainerSASPermissions.parse(e.permissions.toString()).toString());let u=[l||``,e.startsOn?(0,s.truncatedISO8061Date)(e.startsOn,!1):``,e.expiresOn?(0,s.truncatedISO8061Date)(e.expiresOn,!1):``,v(r.accountName,e.containerName,e.blobName),r.userDelegationKey.signedObjectId,r.userDelegationKey.signedTenantId,r.userDelegationKey.signedStartsOn?(0,s.truncatedISO8061Date)(r.userDelegationKey.signedStartsOn,!1):``,r.userDelegationKey.signedExpiresOn?(0,s.truncatedISO8061Date)(r.userDelegationKey.signedExpiresOn,!1):``,r.userDelegationKey.signedService,r.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,void 0,e.delegatedUserObjectId,e.ipRange?(0,i.ipRangeToString)(e.ipRange):``,e.protocol?e.protocol:``,e.version,o,c,e.encryptionScope,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` `),d=r.computeHMACSHA256(u);return{sasQueryParameters:new a.SASQueryParameters(e.version,d,l,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,o,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,r.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId,e.encryptionScope,e.delegatedUserObjectId),stringToSign:u}}function v(e,t,n){let r=[`/blob/${e}/${t}`];return n&&r.push(`/${n}`),r.join(``)}function y(e){let t=e.version?e.version:o.SERVICE_VERSION;if(e.snapshotTime&&t<`2018-11-09`)throw RangeError(`'version' must be >= '2018-11-09' when providing 'snapshotTime'.`);if(e.blobName===void 0&&e.snapshotTime)throw RangeError(`Must provide 'blobName' when providing 'snapshotTime'.`);if(e.versionId&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'versionId'.`);if(e.blobName===void 0&&e.versionId)throw RangeError(`Must provide 'blobName' when providing 'versionId'.`);if(e.permissions&&e.permissions.setImmutabilityPolicy&&t<`2020-08-04`)throw RangeError(`'version' must be >= '2020-08-04' when provided 'i' permission.`);if(e.permissions&&e.permissions.deleteVersion&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'x' permission.`);if(e.permissions&&e.permissions.permanentDelete&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'y' permission.`);if(e.permissions&&e.permissions.tag&&t<`2019-12-12`)throw RangeError(`'version' must be >= '2019-12-12' when providing 't' permission.`);if(t<`2020-02-10`&&e.permissions&&(e.permissions.move||e.permissions.execute))throw RangeError(`'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.`);if(t<`2021-04-10`&&e.permissions&&e.permissions.filterByTags)throw RangeError(`'version' must be >= '2021-04-10' when providing the 'f' permission.`);if(t<`2020-02-10`&&(e.preauthorizedAgentObjectId||e.correlationId))throw RangeError(`'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.`);if(e.encryptionScope&&t<`2020-12-06`)throw RangeError(`'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.`);return e.version=t,e}})),nu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobLeaseClient=void 0;let t=zs(),n=El(),r=Xl(),i=Jl();e.BlobLeaseClient=class{_leaseId;_url;_containerOrBlobOperation;_isContainer;get leaseId(){return this._leaseId}get url(){return this._url}constructor(e,n){let r=e.storageClientContext;this._url=e.url,e.name===void 0?(this._isContainer=!0,this._containerOrBlobOperation=r.container):(this._isContainer=!1,this._containerOrBlobOperation=r.blob),n||=(0,t.randomUUID)(),this._leaseId=n}async acquireLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==n.ETagNone||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==n.ETagNone||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return r.tracingClient.withSpan(`BlobLeaseClient-acquireLease`,t,async n=>(0,i.assertResponse)(await this._containerOrBlobOperation.acquireLease({abortSignal:t.abortSignal,duration:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},proposedLeaseId:this._leaseId,tracingOptions:n.tracingOptions})))}async changeLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==n.ETagNone||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==n.ETagNone||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return r.tracingClient.withSpan(`BlobLeaseClient-changeLease`,t,async n=>{let r=(0,i.assertResponse)(await this._containerOrBlobOperation.changeLease(this._leaseId,e,{abortSignal:t.abortSignal,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions}));return this._leaseId=e,r})}async releaseLease(e={}){if(this._isContainer&&(e.conditions?.ifMatch&&e.conditions?.ifMatch!==n.ETagNone||e.conditions?.ifNoneMatch&&e.conditions?.ifNoneMatch!==n.ETagNone||e.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return r.tracingClient.withSpan(`BlobLeaseClient-releaseLease`,e,async t=>(0,i.assertResponse)(await this._containerOrBlobOperation.releaseLease(this._leaseId,{abortSignal:e.abortSignal,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async renewLease(e={}){if(this._isContainer&&(e.conditions?.ifMatch&&e.conditions?.ifMatch!==n.ETagNone||e.conditions?.ifNoneMatch&&e.conditions?.ifNoneMatch!==n.ETagNone||e.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return r.tracingClient.withSpan(`BlobLeaseClient-renewLease`,e,async t=>this._containerOrBlobOperation.renewLease(this._leaseId,{abortSignal:e.abortSignal,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions}))}async breakLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==n.ETagNone||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==n.ETagNone||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return r.tracingClient.withSpan(`BlobLeaseClient-breakLease`,t,async n=>{let r={abortSignal:t.abortSignal,breakPeriod:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions};return(0,i.assertResponse)(await this._containerOrBlobOperation.breakLease(r))})}}})),ru=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RetriableReadableStream=void 0;let t=Ps(),n=w(`node:stream`);e.RetriableReadableStream=class extends n.Readable{start;offset;end;getter;source;retries=0;maxRetryRequests;onProgress;options;constructor(e,t,n,r,i={}){super({highWaterMark:i.highWaterMark}),this.getter=t,this.source=e,this.start=n,this.offset=n,this.end=n+r-1,this.maxRetryRequests=i.maxRetryRequests&&i.maxRetryRequests>=0?i.maxRetryRequests:0,this.onProgress=i.onProgress,this.options=i,this.setSourceEventHandlers()}_read(){this.source.resume()}setSourceEventHandlers(){this.source.on(`data`,this.sourceDataHandler),this.source.on(`end`,this.sourceErrorOrEndHandler),this.source.on(`error`,this.sourceErrorOrEndHandler),this.source.on(`aborted`,this.sourceAbortedHandler)}removeSourceEventHandlers(){this.source.removeListener(`data`,this.sourceDataHandler),this.source.removeListener(`end`,this.sourceErrorOrEndHandler),this.source.removeListener(`error`,this.sourceErrorOrEndHandler),this.source.removeListener(`aborted`,this.sourceAbortedHandler)}sourceDataHandler=e=>{if(this.options.doInjectErrorOnce){this.options.doInjectErrorOnce=void 0,this.source.pause(),this.sourceErrorOrEndHandler(),this.source.destroy();return}this.offset+=e.length,this.onProgress&&this.onProgress({loadedBytes:this.offset-this.start}),this.push(e)||this.source.pause()};sourceAbortedHandler=()=>{let e=new t.AbortError(`The operation was aborted.`);this.destroy(e)};sourceErrorOrEndHandler=e=>{if(e&&e.name===`AbortError`){this.destroy(e);return}this.removeSourceEventHandlers(),this.offset-1===this.end?this.push(null):this.offset<=this.end?this.retries{this.source=e,this.setSourceEventHandlers()}).catch(e=>{this.destroy(e)})):this.destroy(Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset-1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`)):this.destroy(Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset-1}`))};_destroy(e,t){this.removeSourceEventHandlers(),this.source.destroy(),t(e===null?void 0:e)}}})),iu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobDownloadResponse=void 0;let t=zs(),n=ru();e.BlobDownloadResponse=class{get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){return this.originalResponse.copyCompletedOn}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get tagCount(){return this.originalResponse.tagCount}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get lastAccessed(){return this.originalResponse.lastAccessed}get createdOn(){return this.originalResponse.createdOn}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get versionId(){return this.originalResponse.versionId}get isCurrentVersion(){return this.originalResponse.isCurrentVersion}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get objectReplicationDestinationPolicyId(){return this.originalResponse.objectReplicationDestinationPolicyId}get objectReplicationSourceProperties(){return this.originalResponse.objectReplicationSourceProperties}get isSealed(){return this.originalResponse.isSealed}get immutabilityPolicyExpiresOn(){return this.originalResponse.immutabilityPolicyExpiresOn}get immutabilityPolicyMode(){return this.originalResponse.immutabilityPolicyMode}get legalHold(){return this.originalResponse.legalHold}get contentAsBlob(){return this.originalResponse.blobBody}get readableStreamBody(){return t.isNodeLike?this.blobDownloadStream:void 0}get _response(){return this.originalResponse._response}originalResponse;blobDownloadStream;constructor(e,t,r,i,a={}){this.originalResponse=e,this.blobDownloadStream=new n.RetriableReadableStream(this.originalResponse.readableStreamBody,t,r,i,a)}}})),au=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AVRO_SCHEMA_KEY=e.AVRO_CODEC_KEY=e.AVRO_INIT_BYTES=e.AVRO_SYNC_MARKER_SIZE=void 0,e.AVRO_SYNC_MARKER_SIZE=16,e.AVRO_INIT_BYTES=new Uint8Array([79,98,106,1]),e.AVRO_CODEC_KEY=`avro.codec`,e.AVRO_SCHEMA_KEY=`avro.schema`})),ou=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AvroType=e.AvroParser=void 0;var t=class e{static async readFixedBytes(e,t,n={}){let r=await e.read(t,{abortSignal:n.abortSignal});if(r.length!==t)throw Error(`Hit stream end.`);return r}static async readByte(t,n={}){return(await e.readFixedBytes(t,1,n))[0]}static async readZigZagLong(t,n={}){let r=0,i=0,a,o,s;do a=await e.readByte(t,n),o=a&128,r|=(a&127)<2**53-1)throw Error(`Integer overflow.`);return i}return r>>1^-(r&1)}static async readLong(t,n={}){return e.readZigZagLong(t,n)}static async readInt(t,n={}){return e.readZigZagLong(t,n)}static async readNull(){return null}static async readBoolean(t,n={}){let r=await e.readByte(t,n);if(r===1)return!0;if(r===0)return!1;throw Error(`Byte was not a boolean.`)}static async readFloat(t,n={}){let r=await e.readFixedBytes(t,4,n);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,!0)}static async readDouble(t,n={}){let r=await e.readFixedBytes(t,8,n);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,!0)}static async readBytes(t,n={}){let r=await e.readLong(t,n);if(r<0)throw Error(`Bytes size was negative.`);return t.read(r,{abortSignal:n.abortSignal})}static async readString(t,n={}){let r=await e.readBytes(t,n);return new TextDecoder().decode(r)}static async readMapPair(t,n,r={}){return{key:await e.readString(t,r),value:await n(t,r)}}static async readMap(t,n,r={}){let i=await e.readArray(t,(t,r={})=>e.readMapPair(t,n,r),r),a={};for(let e of i)a[e.key]=e.value;return a}static async readArray(t,n,r={}){let i=[];for(let a=await e.readLong(t,r);a!==0;a=await e.readLong(t,r))for(a<0&&(await e.readLong(t,r),a=-a);a--;){let e=await n(t,r);i.push(e)}return i}};e.AvroParser=t;var n;(function(e){e.RECORD=`record`,e.ENUM=`enum`,e.ARRAY=`array`,e.MAP=`map`,e.UNION=`union`,e.FIXED=`fixed`})(n||={});var r;(function(e){e.NULL=`null`,e.BOOLEAN=`boolean`,e.INT=`int`,e.LONG=`long`,e.FLOAT=`float`,e.DOUBLE=`double`,e.BYTES=`bytes`,e.STRING=`string`})(r||={});var i=class e{static fromSchema(t){return typeof t==`string`?e.fromStringSchema(t):Array.isArray(t)?e.fromArraySchema(t):e.fromObjectSchema(t)}static fromStringSchema(e){switch(e){case r.NULL:case r.BOOLEAN:case r.INT:case r.LONG:case r.FLOAT:case r.DOUBLE:case r.BYTES:case r.STRING:return new a(e);default:throw Error(`Unexpected Avro type ${e}`)}}static fromArraySchema(t){return new s(t.map(e.fromSchema))}static fromObjectSchema(t){let r=t.type;try{return e.fromStringSchema(r)}catch{}switch(r){case n.RECORD:if(t.aliases)throw Error(`aliases currently is not supported, schema: ${t}`);if(!t.name)throw Error(`Required attribute 'name' doesn't exist on schema: ${t}`);let i={};if(!t.fields)throw Error(`Required attribute 'fields' doesn't exist on schema: ${t}`);for(let n of t.fields)i[n.name]=e.fromSchema(n.type);return new l(i,t.name);case n.ENUM:if(t.aliases)throw Error(`aliases currently is not supported, schema: ${t}`);if(!t.symbols)throw Error(`Required attribute 'symbols' doesn't exist on schema: ${t}`);return new o(t.symbols);case n.MAP:if(!t.values)throw Error(`Required attribute 'values' doesn't exist on schema: ${t}`);return new c(e.fromSchema(t.values));case n.ARRAY:case n.FIXED:default:throw Error(`Unexpected Avro type ${r} in ${t}`)}}};e.AvroType=i;var a=class extends i{_primitive;constructor(e){super(),this._primitive=e}read(e,n={}){switch(this._primitive){case r.NULL:return t.readNull();case r.BOOLEAN:return t.readBoolean(e,n);case r.INT:return t.readInt(e,n);case r.LONG:return t.readLong(e,n);case r.FLOAT:return t.readFloat(e,n);case r.DOUBLE:return t.readDouble(e,n);case r.BYTES:return t.readBytes(e,n);case r.STRING:return t.readString(e,n);default:throw Error(`Unknown Avro Primitive`)}}},o=class extends i{_symbols;constructor(e){super(),this._symbols=e}async read(e,n={}){let r=await t.readInt(e,n);return this._symbols[r]}},s=class extends i{_types;constructor(e){super(),this._types=e}async read(e,n={}){let r=await t.readInt(e,n);return this._types[r].read(e,n)}},c=class extends i{_itemType;constructor(e){super(),this._itemType=e}read(e,n={}){return t.readMap(e,(e,t)=>this._itemType.read(e,t),n)}},l=class extends i{_name;_fields;constructor(e,t){super(),this._fields=e,this._name=t}async read(e,t={}){let n={};n.$schema=this._name;for(let r in this._fields)Object.prototype.hasOwnProperty.call(this._fields,r)&&(n[r]=await this._fields[r].read(e,t));return n}}})),su=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.arraysEqual=t;function t(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n{Object.defineProperty(e,`__esModule`,{value:!0}),e.AvroReader=void 0;let t=au(),n=ou(),r=su();e.AvroReader=class{_dataStream;_headerStream;_syncMarker;_metadata;_itemType;_itemsRemainingInBlock;_initialBlockOffset;_blockOffset;get blockOffset(){return this._blockOffset}_objectIndex;get objectIndex(){return this._objectIndex}_initialized;constructor(e,t,n,r){this._dataStream=e,this._headerStream=t||e,this._initialized=!1,this._blockOffset=n||0,this._objectIndex=r||0,this._initialBlockOffset=n||0}async initialize(e={}){let i=await n.AvroParser.readFixedBytes(this._headerStream,t.AVRO_INIT_BYTES.length,{abortSignal:e.abortSignal});if(!(0,r.arraysEqual)(i,t.AVRO_INIT_BYTES))throw Error(`Stream is not an Avro file.`);this._metadata=await n.AvroParser.readMap(this._headerStream,n.AvroParser.readString,{abortSignal:e.abortSignal});let a=this._metadata[t.AVRO_CODEC_KEY];if(!(a==null||a===`null`))throw Error(`Codecs are not supported`);this._syncMarker=await n.AvroParser.readFixedBytes(this._headerStream,t.AVRO_SYNC_MARKER_SIZE,{abortSignal:e.abortSignal});let o=JSON.parse(this._metadata[t.AVRO_SCHEMA_KEY]);if(this._itemType=n.AvroType.fromSchema(o),this._blockOffset===0&&(this._blockOffset=this._initialBlockOffset+this._dataStream.position),this._itemsRemainingInBlock=await n.AvroParser.readLong(this._dataStream,{abortSignal:e.abortSignal}),await n.AvroParser.readLong(this._dataStream,{abortSignal:e.abortSignal}),this._initialized=!0,this._objectIndex&&this._objectIndex>0)for(let t=0;t0}async*parseObjects(e={}){for(this._initialized||await this.initialize(e);this.hasNext();){let i=await this._itemType.read(this._dataStream,{abortSignal:e.abortSignal});if(this._itemsRemainingInBlock--,this._objectIndex++,this._itemsRemainingInBlock===0){let i=await n.AvroParser.readFixedBytes(this._dataStream,t.AVRO_SYNC_MARKER_SIZE,{abortSignal:e.abortSignal});if(this._blockOffset=this._initialBlockOffset+this._dataStream.position,this._objectIndex=0,!(0,r.arraysEqual)(this._syncMarker,i))throw Error(`Stream is not a valid Avro file.`);try{this._itemsRemainingInBlock=await n.AvroParser.readLong(this._dataStream,{abortSignal:e.abortSignal})}catch{this._itemsRemainingInBlock=0}this._itemsRemainingInBlock>0&&await n.AvroParser.readLong(this._dataStream,{abortSignal:e.abortSignal})}yield i}}}})),lu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AvroReadable=void 0,e.AvroReadable=class{}})),uu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AvroReadableFromStream=void 0;let t=lu(),n=Ps(),r=w(`buffer`),i=new n.AbortError(`Reading from the avro stream was aborted.`);e.AvroReadableFromStream=class extends t.AvroReadable{_position;_readable;toUint8Array(e){return typeof e==`string`?r.Buffer.from(e):e}constructor(e){super(),this._readable=e,this._position=0}get position(){return this._position}async read(e,t={}){if(t.abortSignal?.aborted)throw i;if(e<0)throw Error(`size parameter should be positive: ${e}`);if(e===0)return new Uint8Array;if(!this._readable.readable)throw Error(`Stream no longer readable.`);let n=this._readable.read(e);return n?(this._position+=n.length,this.toUint8Array(n)):new Promise((n,r)=>{let a=()=>{this._readable.removeListener(`readable`,o),this._readable.removeListener(`error`,s),this._readable.removeListener(`end`,s),this._readable.removeListener(`close`,s),t.abortSignal&&t.abortSignal.removeEventListener(`abort`,c)},o=()=>{let t=this._readable.read(e);t&&(this._position+=t.length,a(),n(this.toUint8Array(t)))},s=()=>{a(),r()},c=()=>{a(),r(i)};this._readable.on(`readable`,o),this._readable.once(`error`,s),this._readable.once(`end`,s),this._readable.once(`close`,s),t.abortSignal&&t.abortSignal.addEventListener(`abort`,c)})}}})),du=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AvroReadableFromStream=e.AvroReadable=e.AvroReader=void 0;var t=cu();Object.defineProperty(e,`AvroReader`,{enumerable:!0,get:function(){return t.AvroReader}});var n=lu();Object.defineProperty(e,`AvroReadable`,{enumerable:!0,get:function(){return n.AvroReadable}});var r=uu();Object.defineProperty(e,`AvroReadableFromStream`,{enumerable:!0,get:function(){return r.AvroReadableFromStream}})})),fu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobQuickQueryStream=void 0;let t=w(`node:stream`),n=du();e.BlobQuickQueryStream=class extends t.Readable{source;avroReader;avroIter;avroPaused=!0;onProgress;onError;constructor(e,t={}){super(),this.source=e,this.onProgress=t.onProgress,this.onError=t.onError,this.avroReader=new n.AvroReader(new n.AvroReadableFromStream(this.source)),this.avroIter=this.avroReader.parseObjects({abortSignal:t.abortSignal})}_read(){this.avroPaused&&this.readInternal().catch(e=>{this.emit(`error`,e)})}async readInternal(){this.avroPaused=!1;let e;do{if(e=await this.avroIter.next(),e.done)break;let t=e.value,n=t.$schema;if(typeof n!=`string`)throw Error(`Missing schema in avro record.`);switch(n){case`com.microsoft.azure.storage.queryBlobContents.resultData`:{let e=t.data;if(!(e instanceof Uint8Array))throw Error(`Invalid data in avro result record.`);this.push(Buffer.from(e))||(this.avroPaused=!0)}break;case`com.microsoft.azure.storage.queryBlobContents.progress`:{let e=t.bytesScanned;if(typeof e!=`number`)throw Error(`Invalid bytesScanned in avro progress record.`);this.onProgress&&this.onProgress({loadedBytes:e})}break;case`com.microsoft.azure.storage.queryBlobContents.end`:if(this.onProgress){let e=t.totalBytes;if(typeof e!=`number`)throw Error(`Invalid totalBytes in avro end record.`);this.onProgress({loadedBytes:e})}this.push(null);break;case`com.microsoft.azure.storage.queryBlobContents.error`:if(this.onError){let e=t.fatal;if(typeof e!=`boolean`)throw Error(`Invalid fatal in avro error record.`);let n=t.name;if(typeof n!=`string`)throw Error(`Invalid name in avro error record.`);let r=t.description;if(typeof r!=`string`)throw Error(`Invalid description in avro error record.`);let i=t.position;if(typeof i!=`number`)throw Error(`Invalid position in avro error record.`);this.onError({position:i,name:n,isFatal:e,description:r})}break;default:throw Error(`Unknown schema ${n} in avro progress record.`)}}while(!e.done&&!this.avroPaused)}}})),pu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobQueryResponse=void 0;let t=zs(),n=fu();e.BlobQueryResponse=class{get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get blobBody(){}get readableStreamBody(){return t.isNodeLike?this.blobDownloadStream:void 0}get _response(){return this.originalResponse._response}originalResponse;blobDownloadStream;constructor(e,t={}){this.originalResponse=e,this.blobDownloadStream=new n.BlobQuickQueryStream(this.originalResponse.readableStreamBody,t)}}})),mu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.StorageBlobAudience=e.PremiumPageBlobTier=e.BlockBlobTier=void 0,e.toAccessTier=i,e.ensureCpkIfSpecified=a,e.getBlobServiceAccountAudience=s;let t=El();var n;(function(e){e.Hot=`Hot`,e.Cool=`Cool`,e.Cold=`Cold`,e.Archive=`Archive`})(n||(e.BlockBlobTier=n={}));var r;(function(e){e.P4=`P4`,e.P6=`P6`,e.P10=`P10`,e.P15=`P15`,e.P20=`P20`,e.P30=`P30`,e.P40=`P40`,e.P50=`P50`,e.P60=`P60`,e.P70=`P70`,e.P80=`P80`})(r||(e.PremiumPageBlobTier=r={}));function i(e){if(e!==void 0)return e}function a(e,n){if(e&&!n)throw RangeError(`Customer-provided encryption key must be used over HTTPS.`);e&&!e.encryptionAlgorithm&&(e.encryptionAlgorithm=t.EncryptionAlgorithmAES25)}var o;(function(e){e.StorageOAuthScopes=`https://storage.azure.com/.default`,e.DiskComputeOAuthScopes=`https://disk.compute.azure.com/.default`})(o||(e.StorageBlobAudience=o={}));function s(e){return`https://${e}.blob.core.windows.net/.default`}})),hu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.rangeResponseFromModel=t;function t(e){let t=(e._response.parsedBody.pageRange||[]).map(e=>({offset:e.start,count:e.end-e.start})),n=(e._response.parsedBody.clearRange||[]).map(e=>({offset:e.start,count:e.end-e.start}));return{...e,pageRange:t,clearRange:n,_response:{...e._response,parsedBody:{pageRange:t,clearRange:n}}}}})),gu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.logger=void 0,e.logger=(0,vs().createClientLogger)(`core-lro`)})),_u=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.terminalStates=e.POLL_INTERVAL_IN_MS=void 0,e.POLL_INTERVAL_IN_MS=2e3,e.terminalStates=[`succeeded`,`canceled`,`failed`]})),vu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.pollOperation=e.initOperation=e.deserializeState=void 0;let t=gu(),n=_u();function r(e){try{return JSON.parse(e).state}catch{throw Error(`Unable to deserialize input state: ${e}`)}}e.deserializeState=r;function i(e){let{state:t,stateProxy:n,isOperationError:r}=e;return e=>{throw r(e)&&(n.setError(t,e),n.setFailed(t)),e}}function a(e,t){let n=e;return n.slice(-1)!==`.`&&(n+=`.`),n+` `+t}function o(e){let t=e.message,n=e.code,r=e;for(;r.innererror;)r=r.innererror,n=r.code,t=a(t,r.message);return{code:n,message:t}}function s(e){let{state:n,stateProxy:r,status:i,isDone:a,processResult:s,getError:l,response:u,setErrorAsResult:d}=e;switch(i){case`succeeded`:r.setSucceeded(n);break;case`failed`:{let e=l?.(u),i=``;if(e){let{code:t,message:n}=o(e);i=`. ${t}. ${n}`}let a=`The long-running operation has failed${i}`;r.setError(n,Error(a)),r.setFailed(n),t.logger.warning(a);break}case`canceled`:r.setCanceled(n);break}(a?.(u,n)||a===void 0&&[`succeeded`,`canceled`].concat(d?[]:[`failed`]).includes(i))&&r.setResult(n,c({response:u,state:n,processResult:s}))}function c(e){let{processResult:t,response:n,state:r}=e;return t?t(n,r):n}async function l(e){let{init:n,stateProxy:r,processResult:i,getOperationStatus:a,withOperationLocation:o,setErrorAsResult:c}=e,{operationLocation:l,resourceLocation:u,metadata:d,response:f}=await n();l&&o?.(l,!1);let p={metadata:d,operationLocation:l,resourceLocation:u};t.logger.verbose(`LRO: Operation description:`,p);let m=r.initState(p);return s({state:m,status:a({response:f,state:m,operationLocation:l}),stateProxy:r,response:f,setErrorAsResult:c,processResult:i}),m}e.initOperation=l;async function u(e){let{poll:r,state:a,stateProxy:o,operationLocation:s,getOperationStatus:c,getResourceLocation:l,isOperationError:u,options:d}=e,f=await r(s,d).catch(i({state:a,stateProxy:o,isOperationError:u})),p=c(f,a);if(t.logger.verbose(`LRO: Status:\n\tPolling from: ${a.config.operationLocation}\n\tOperation status: ${p}\n\tPolling status: ${n.terminalStates.includes(p)?`Stopped`:`Running`}`),p===`succeeded`){let e=l(f,a);if(e!==void 0)return{response:await r(e).catch(i({state:a,stateProxy:o,isOperationError:u})),status:p}}return{response:f,status:p}}async function d(e){let{poll:t,state:r,stateProxy:i,options:a,getOperationStatus:o,getResourceLocation:c,getOperationLocation:l,isOperationError:d,withOperationLocation:f,getPollingInterval:p,processResult:m,getError:h,updateState:g,setDelay:_,isDone:v,setErrorAsResult:y}=e,{operationLocation:b}=r.config;if(b!==void 0){let{response:e,status:x}=await u({poll:t,getOperationStatus:o,state:r,stateProxy:i,operationLocation:b,getResourceLocation:c,isOperationError:d,options:a});if(s({status:x,response:e,state:r,stateProxy:i,isDone:v,processResult:m,getError:h,setErrorAsResult:y}),!n.terminalStates.includes(x)){let t=p?.(e);t&&_(t);let n=l?.(e,r);if(n!==void 0){let e=b!==n;r.config.operationLocation=n,f?.(n,e)}else f?.(b,!1)}g?.(r,e)}}e.pollOperation=d})),yu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.pollHttpOperation=e.isOperationError=e.getResourceLocation=e.getOperationStatus=e.getOperationLocation=e.initHttpOperation=e.getStatusFromInitialResponse=e.getErrorFromResponse=e.parseRetryAfter=e.inferLroMode=void 0;let t=vu(),n=gu();function r(e){let{azureAsyncOperation:t,operationLocation:n}=e;return n??t}function i(e){return e.headers.location}function a(e){return e.headers[`operation-location`]}function o(e){return e.headers[`azure-asyncoperation`]}function s(e){let{location:t,requestMethod:n,requestPath:r,resourceLocationConfig:i}=e;switch(n){case`PUT`:return r;case`DELETE`:return;case`PATCH`:return a()??r;default:return a()}function a(){switch(i){case`azure-async-operation`:return;case`original-uri`:return r;default:return t}}}function c(e){let{rawResponse:t,requestMethod:n,requestPath:c,resourceLocationConfig:l}=e,u=r({operationLocation:a(t),azureAsyncOperation:o(t)}),d=i(t),f=n?.toLocaleUpperCase();if(u!==void 0)return{mode:`OperationLocation`,operationLocation:u,resourceLocation:s({requestMethod:f,location:d,requestPath:c,resourceLocationConfig:l})};if(d!==void 0)return{mode:`ResourceLocation`,operationLocation:d};if(f===`PUT`&&c)return{mode:`Body`,operationLocation:c}}e.inferLroMode=c;function l(e){let{status:t,statusCode:r}=e;if(typeof t!=`string`&&t!==void 0)throw Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${t}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`);switch(t?.toLocaleLowerCase()){case void 0:return f(r);case`succeeded`:return`succeeded`;case`failed`:return`failed`;case`running`:case`accepted`:case`started`:case`canceling`:case`cancelling`:return`running`;case`canceled`:case`cancelled`:return`canceled`;default:return n.logger.verbose(`LRO: unrecognized operation status: ${t}`),t}}function u(e){let{status:t}=e.body??{};return l({status:t,statusCode:e.statusCode})}function d(e){let{properties:t,provisioningState:n}=e.body??{};return l({status:t?.provisioningState??n,statusCode:e.statusCode})}function f(e){return e===202?`running`:e<300?`succeeded`:`failed`}function p({rawResponse:e}){let t=e.headers[`retry-after`];if(t!==void 0){let e=parseInt(t);return isNaN(e)?h(new Date(t)):e*1e3}}e.parseRetryAfter=p;function m(e){let t=b(e,`error`);if(!t){n.logger.warning(`The long-running operation failed but there is no error property in the response's body`);return}if(!t.code||!t.message){n.logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`);return}return t}e.getErrorFromResponse=m;function h(e){let t=Math.floor(new Date().getTime()),n=e.getTime();if(t{let e=await a.sendInitialRequest(),t=c({rawResponse:e.rawResponse,requestPath:a.requestPath,requestMethod:a.requestMethod,resourceLocationConfig:r});return Object.assign({response:e,operationLocation:t?.operationLocation,resourceLocation:t?.resourceLocation},t?.mode?{metadata:{mode:t.mode}}:{})},stateProxy:n,processResult:i?({flatResponse:e},t)=>i(e,t):({flatResponse:e})=>e,getOperationStatus:g,setErrorAsResult:o})}e.initHttpOperation=_;function v({rawResponse:e},t){switch(t.config.metadata?.mode){case`OperationLocation`:return r({operationLocation:a(e),azureAsyncOperation:o(e)});case`ResourceLocation`:return i(e);default:return}}e.getOperationLocation=v;function y({rawResponse:e},t){let n=t.config.metadata?.mode;switch(n){case`OperationLocation`:return u(e);case`ResourceLocation`:return f(e.statusCode);case`Body`:return d(e);default:throw Error(`Internal error: Unexpected operation mode: ${n}`)}}e.getOperationStatus=y;function b({flatResponse:e,rawResponse:t},n){return e?.[n]??t.body?.[n]}function x(e,t){let n=b(e,`resourceLocation`);return n&&typeof n==`string`&&(t.config.resourceLocation=n),t.config.resourceLocation}e.getResourceLocation=x;function S(e){return e.name===`RestError`}e.isOperationError=S;async function C(e){let{lro:n,stateProxy:r,options:i,processResult:a,updateState:o,setDelay:s,state:c,setErrorAsResult:l}=e;return(0,t.pollOperation)({state:c,stateProxy:r,setDelay:s,processResult:a?({flatResponse:e},t)=>a(e,t):({flatResponse:e})=>e,getError:m,updateState:o,getPollingInterval:p,getOperationLocation:v,getOperationStatus:y,isOperationError:S,getResourceLocation:x,options:i,poll:async(e,t)=>n.sendPollRequest(e,t),setErrorAsResult:l})}e.pollHttpOperation=C})),bu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.buildCreatePoller=void 0;let t=vu(),n=_u(),r=zs(),i=()=>({initState:e=>({status:`running`,config:e}),setCanceled:e=>e.status=`canceled`,setError:(e,t)=>e.error=t,setResult:(e,t)=>e.result=t,setRunning:e=>e.status=`running`,setSucceeded:e=>e.status=`succeeded`,setFailed:e=>e.status=`failed`,getError:e=>e.error,getResult:e=>e.result,isCanceled:e=>e.status===`canceled`,isFailed:e=>e.status===`failed`,isRunning:e=>e.status===`running`,isSucceeded:e=>e.status===`succeeded`});function a(e){let{getOperationLocation:a,getStatusFromInitialResponse:o,getStatusFromPollResponse:s,isOperationError:c,getResourceLocation:l,getPollingInterval:u,getError:d,resolveOnUnsuccessful:f}=e;return async({init:e,poll:p},m)=>{let{processResult:h,updateState:g,withOperationLocation:_,intervalInMs:v=n.POLL_INTERVAL_IN_MS,restoreFrom:y}=m||{},b=i(),x=_?(()=>{let e=!1;return(t,n)=>{n?_(t):e||_(t),e=!0}})():void 0,S=y?(0,t.deserializeState)(y):await(0,t.initOperation)({init:e,stateProxy:b,processResult:h,getOperationStatus:o,withOperationLocation:x,setErrorAsResult:!f}),C,w=new AbortController,T=new Map,E=async()=>T.forEach(e=>e(S)),D=`Operation was canceled`,O=v,k={getOperationState:()=>S,getResult:()=>S.result,isDone:()=>[`succeeded`,`failed`,`canceled`].includes(S.status),isStopped:()=>C===void 0,stopPolling:()=>{w.abort()},toString:()=>JSON.stringify({state:S}),onProgress:e=>{let t=Symbol();return T.set(t,e),()=>T.delete(t)},pollUntilDone:e=>C??=(async()=>{let{abortSignal:t}=e||{};function n(){w.abort()}let i=w.signal;t?.aborted?w.abort():i.aborted||t?.addEventListener(`abort`,n,{once:!0});try{if(!k.isDone())for(await k.poll({abortSignal:i});!k.isDone();)await(0,r.delay)(O,{abortSignal:i}),await k.poll({abortSignal:i})}finally{t?.removeEventListener(`abort`,n)}if(f)return k.getResult();switch(S.status){case`succeeded`:return k.getResult();case`canceled`:throw Error(D);case`failed`:throw S.error;case`notStarted`:case`running`:throw Error(`Polling completed without succeeding or failing`)}})().finally(()=>{C=void 0}),async poll(e){if(f){if(k.isDone())return}else switch(S.status){case`succeeded`:return;case`canceled`:throw Error(D);case`failed`:throw S.error}if(await(0,t.pollOperation)({poll:p,state:S,stateProxy:b,getOperationLocation:a,isOperationError:c,withOperationLocation:x,getPollingInterval:u,getOperationStatus:s,getResourceLocation:l,processResult:h,getError:d,updateState:g,options:e,setDelay:e=>{O=e},setErrorAsResult:!f}),await E(),!f)switch(S.status){case`canceled`:throw Error(D);case`failed`:throw S.error}}};return k}}e.buildCreatePoller=a})),xu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createHttpPoller=void 0;let t=yu(),n=bu();async function r(e,r){let{resourceLocationConfig:i,intervalInMs:a,processResult:o,restoreFrom:s,updateState:c,withOperationLocation:l,resolveOnUnsuccessful:u=!1}=r||{};return(0,n.buildCreatePoller)({getStatusFromInitialResponse:t.getStatusFromInitialResponse,getStatusFromPollResponse:t.getOperationStatus,isOperationError:t.isOperationError,getOperationLocation:t.getOperationLocation,getResourceLocation:t.getResourceLocation,getPollingInterval:t.parseRetryAfter,getError:t.getErrorFromResponse,resolveOnUnsuccessful:u})({init:async()=>{let n=await e.sendInitialRequest(),r=(0,t.inferLroMode)({rawResponse:n.rawResponse,requestPath:e.requestPath,requestMethod:e.requestMethod,resourceLocationConfig:i});return Object.assign({response:n,operationLocation:r?.operationLocation,resourceLocation:r?.resourceLocation},r?.mode?{metadata:{mode:r.mode}}:{})},poll:e.sendPollRequest},{intervalInMs:a,withOperationLocation:l,restoreFrom:s,updateState:c,processResult:o?({flatResponse:e},t)=>o(e,t):({flatResponse:e})=>e})}e.createHttpPoller=r})),Su=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GenericPollOperation=void 0;let t=yu(),n=gu(),r=()=>({initState:e=>({config:e,isStarted:!0}),setCanceled:e=>e.isCancelled=!0,setError:(e,t)=>e.error=t,setResult:(e,t)=>e.result=t,setRunning:e=>e.isStarted=!0,setSucceeded:e=>e.isCompleted=!0,setFailed:()=>{},getError:e=>e.error,getResult:e=>e.result,isCanceled:e=>!!e.isCancelled,isFailed:e=>!!e.error,isRunning:e=>!!e.isStarted,isSucceeded:e=>!!(e.isCompleted&&!e.isCancelled&&!e.error)});e.GenericPollOperation=class{constructor(e,t,n,r,i,a,o){this.state=e,this.lro=t,this.setErrorAsResult=n,this.lroResourceLocationConfig=r,this.processResult=i,this.updateState=a,this.isDone=o}setPollerConfig(e){this.pollerConfig=e}async update(e){var n;let i=r();this.state.isStarted||(this.state=Object.assign(Object.assign({},this.state),await(0,t.initHttpOperation)({lro:this.lro,stateProxy:i,resourceLocationConfig:this.lroResourceLocationConfig,processResult:this.processResult,setErrorAsResult:this.setErrorAsResult})));let a=this.updateState,o=this.isDone;return!this.state.isCompleted&&this.state.error===void 0&&await(0,t.pollHttpOperation)({lro:this.lro,state:this.state,stateProxy:i,processResult:this.processResult,updateState:a?(e,{rawResponse:t})=>a(e,t):void 0,isDone:o?({flatResponse:e},t)=>o(e,t):void 0,options:e,setDelay:e=>{this.pollerConfig.intervalInMs=e},setErrorAsResult:this.setErrorAsResult}),(n=e?.fireProgress)==null||n.call(e,this.state),this}async cancel(){return n.logger.error("`cancelOperation` is deprecated because it wasn't implemented"),this}toString(){return JSON.stringify({state:this.state})}}})),Cu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Poller=e.PollerCancelledError=e.PollerStoppedError=void 0;var t=class e extends Error{constructor(t){super(t),this.name=`PollerStoppedError`,Object.setPrototypeOf(this,e.prototype)}};e.PollerStoppedError=t;var n=class e extends Error{constructor(t){super(t),this.name=`PollerCancelledError`,Object.setPrototypeOf(this,e.prototype)}};e.PollerCancelledError=n,e.Poller=class{constructor(e){this.resolveOnUnsuccessful=!1,this.stopped=!0,this.pollProgressCallbacks=[],this.operation=e,this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t}),this.promise.catch(()=>{})}async startPolling(e={}){for(this.stopped&&=!1;!this.isStopped()&&!this.isDone();)await this.poll(e),await this.delay()}async pollOnce(e={}){this.isDone()||(this.operation=await this.operation.update({abortSignal:e.abortSignal,fireProgress:this.fireProgress.bind(this)})),this.processUpdatedState()}fireProgress(e){for(let t of this.pollProgressCallbacks)t(e)}async cancelOnce(e={}){this.operation=await this.operation.cancel(e)}poll(e={}){if(!this.pollOncePromise){this.pollOncePromise=this.pollOnce(e);let t=()=>{this.pollOncePromise=void 0};this.pollOncePromise.then(t,t).catch(this.reject)}return this.pollOncePromise}processUpdatedState(){if(this.operation.state.error&&(this.stopped=!0,!this.resolveOnUnsuccessful))throw this.reject(this.operation.state.error),this.operation.state.error;if(this.operation.state.isCancelled&&(this.stopped=!0,!this.resolveOnUnsuccessful)){let e=new n(`Operation was canceled`);throw this.reject(e),e}this.isDone()&&this.resolve&&this.resolve(this.getResult())}async pollUntilDone(e={}){return this.stopped&&this.startPolling(e).catch(this.reject),this.processUpdatedState(),this.promise}onProgress(e){return this.pollProgressCallbacks.push(e),()=>{this.pollProgressCallbacks=this.pollProgressCallbacks.filter(t=>t!==e)}}isDone(){let e=this.operation.state;return!!(e.isCompleted||e.isCancelled||e.error)}stopPolling(){this.stopped||(this.stopped=!0,this.reject&&this.reject(new t(`This poller is already stopped`)))}isStopped(){return this.stopped}cancelOperation(e={}){if(!this.cancelPromise)this.cancelPromise=this.cancelOnce(e);else if(e.abortSignal)throw Error(`A cancel request is currently pending`);return this.cancelPromise}getOperationState(){return this.operation.state}getResult(){return this.operation.state.result}toString(){return this.operation.toString()}}})),wu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LroEngine=void 0;let t=Su(),n=_u(),r=Cu(),i=vu();e.LroEngine=class extends r.Poller{constructor(e,r){let{intervalInMs:a=n.POLL_INTERVAL_IN_MS,resumeFrom:o,resolveOnUnsuccessful:s=!1,isDone:c,lroResourceLocationConfig:l,processResult:u,updateState:d}=r||{},f=o?(0,i.deserializeState)(o):{},p=new t.GenericPollOperation(f,e,!s,l,u,d,c);super(p),this.resolveOnUnsuccessful=s,this.config={intervalInMs:a},p.setPollerConfig(this.config)}delay(){return new Promise(e=>setTimeout(()=>e(),this.config.intervalInMs))}}})),Tu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LroEngine=void 0;var t=wu();Object.defineProperty(e,`LroEngine`,{enumerable:!0,get:function(){return t.LroEngine}})})),Eu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Du=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createHttpPoller=void 0;let t=(ro(),C(ya));var n=xu();Object.defineProperty(e,`createHttpPoller`,{enumerable:!0,get:function(){return n.createHttpPoller}}),t.__exportStar(Tu(),e),t.__exportStar(Cu(),e),t.__exportStar(Eu(),e)})),Ou=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobBeginCopyFromUrlPoller=void 0;let t=zs(),n=Du();e.BlobBeginCopyFromUrlPoller=class extends n.Poller{intervalInMs;constructor(e){let{blobClient:t,copySource:n,intervalInMs:r=15e3,onProgress:i,resumeFrom:a,startCopyFromURLOptions:s}=e,c;a&&(c=JSON.parse(a).state);let l=o({...c,blobClient:t,copySource:n,startCopyFromURLOptions:s});super(l),typeof i==`function`&&this.onProgress(i),this.intervalInMs=r}delay(){return(0,t.delay)(this.intervalInMs)}};let r=async function(e={}){let t=this.state,{copyId:n}=t;return t.isCompleted?o(t):n?(await t.blobClient.abortCopyFromURL(n,{abortSignal:e.abortSignal}),t.isCancelled=!0,o(t)):(t.isCancelled=!0,o(t))},i=async function(e={}){let t=this.state,{blobClient:n,copySource:r,startCopyFromURLOptions:i}=t;if(!t.isStarted){t.isStarted=!0;let e=await n.startCopyFromURL(r,i);t.copyId=e.copyId,e.copyStatus===`success`&&(t.result=e,t.isCompleted=!0)}else if(!t.isCompleted)try{let n=await t.blobClient.getProperties({abortSignal:e.abortSignal}),{copyStatus:r,copyProgress:i}=n,a=t.copyProgress;i&&(t.copyProgress=i),r===`pending`&&i!==a&&typeof e.fireProgress==`function`?e.fireProgress(t):r===`success`?(t.result=n,t.isCompleted=!0):r===`failed`&&(t.error=Error(`Blob copy failed with reason: "${n.copyStatusDescription||`unknown`}"`),t.isCompleted=!0)}catch(e){t.error=e,t.isCompleted=!0}return o(t)},a=function(){return JSON.stringify({state:this.state},(e,t)=>{if(e!==`blobClient`)return t})};function o(e){return{state:{...e},cancel:r,toString:a,update:i}}})),ku=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.rangeToString=t;function t(e){if(e.offset<0)throw RangeError(`Range.offset cannot be smaller than 0.`);if(e.count&&e.count<=0)throw RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`);return e.count?`bytes=${e.offset}-${e.offset+e.count-1}`:`bytes=${e.offset}-`}})),Au=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Batch=void 0;let t=w(`events`);var n;(function(e){e[e.Good=0]=`Good`,e[e.Error=1]=`Error`})(n||={}),e.Batch=class{concurrency;actives=0;completed=0;offset=0;operations=[];state=n.Good;emitter;constructor(e=5){if(e<1)throw RangeError(`concurrency must be larger than 0`);this.concurrency=e,this.emitter=new t.EventEmitter}addOperation(e){this.operations.push(async()=>{try{this.actives++,await e(),this.actives--,this.completed++,this.parallelExecute()}catch(e){this.emitter.emit(`error`,e)}})}async do(){return this.operations.length===0?Promise.resolve():(this.parallelExecute(),new Promise((e,t)=>{this.emitter.on(`finish`,e),this.emitter.on(`error`,e=>{this.state=n.Error,t(e)})}))}nextOperation(){return this.offset=this.operations.length){this.emitter.emit(`finish`);return}for(;this.actives{Object.defineProperty(e,`__esModule`,{value:!0}),e.fsCreateReadStream=e.fsStat=void 0,e.streamToBuffer=a,e.streamToBuffer2=o,e.streamToBuffer3=s,e.readStreamToLocalFile=c;let t=(ro(),C(ya)),n=t.__importDefault(w(`node:fs`)),r=t.__importDefault(w(`node:util`)),i=El();async function a(e,t,n,r,a){let o=0,s=r-n;return new Promise((r,c)=>{let l=setTimeout(()=>c(Error(`The operation cannot be completed in timeout.`)),i.REQUEST_TIMEOUT);e.on(`readable`,()=>{if(o>=s){clearTimeout(l),r();return}let i=e.read();if(!i)return;typeof i==`string`&&(i=Buffer.from(i,a));let c=o+i.length>s?s-o:i.length;t.fill(i.slice(0,c),n+o,n+o+c),o+=c}),e.on(`end`,()=>{clearTimeout(l),o{clearTimeout(l),c(e)})})}async function o(e,t,n){let r=0,i=t.length;return new Promise((a,o)=>{e.on(`readable`,()=>{let a=e.read();if(a){if(typeof a==`string`&&(a=Buffer.from(a,n)),r+a.length>i){o(Error(`Stream exceeds buffer size. Buffer size: ${i}`));return}t.fill(a,r,r+a.length),r+=a.length}}),e.on(`end`,()=>{a(r)}),e.on(`error`,o)})}async function s(e,t){return new Promise((n,r)=>{let i=[];e.on(`data`,e=>{i.push(typeof e==`string`?Buffer.from(e,t):e)}),e.on(`end`,()=>{n(Buffer.concat(i))}),e.on(`error`,r)})}async function c(e,t){return new Promise((r,i)=>{let a=n.default.createWriteStream(t);e.on(`error`,e=>{i(e)}),a.on(`error`,e=>{i(e)}),a.on(`close`,r),e.pipe(a)})}e.fsStat=r.default.promisify(n.default.stat),e.fsCreateReadStream=n.default.createReadStream})),Mu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PageBlobClient=e.BlockBlobClient=e.AppendBlobClient=e.BlobClient=void 0;let t=gc(),n=Sc(),r=zs(),i=zs(),a=iu(),o=pu(),s=Tl(),c=mu(),l=hu(),u=Dl(),d=Ou(),f=ku(),p=Yl(),m=Au(),h=Tl(),g=El(),_=Xl(),v=Jl(),y=ju(),b=tu(),x=nu();var S=class e extends p.StorageClient{blobContext;_name;_containerName;_versionId;_snapshot;get name(){return this._name}get containerName(){return this._containerName}constructor(e,i,a,o){o||={};let c,l;if((0,u.isPipelineLike)(i))l=e,c=i;else if(r.isNodeLike&&i instanceof s.StorageSharedKeyCredential||i instanceof s.AnonymousCredential||(0,n.isTokenCredential)(i))l=e,o=a,c=(0,u.newPipeline)(i,o);else if(!i&&typeof i!=`string`)l=e,a&&typeof a!=`string`&&(o=a),c=(0,u.newPipeline)(new s.AnonymousCredential,o);else if(i&&typeof i==`string`&&a&&typeof a==`string`){let n=i,d=a,f=(0,v.extractConnectionStringParts)(e);if(f.kind===`AccountConnString`)if(r.isNodeLike){let e=new s.StorageSharedKeyCredential(f.accountName,f.accountKey);l=(0,v.appendToURLPath)((0,v.appendToURLPath)(f.url,encodeURIComponent(n)),encodeURIComponent(d)),o.proxyOptions||=(0,t.getDefaultProxySettings)(f.proxyUri),c=(0,u.newPipeline)(e,o)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(f.kind===`SASConnString`)l=(0,v.appendToURLPath)((0,v.appendToURLPath)(f.url,encodeURIComponent(n)),encodeURIComponent(d))+`?`+f.accountSas,c=(0,u.newPipeline)(new s.AnonymousCredential,o);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(l,c),{blobName:this._name,containerName:this._containerName}=this.getBlobAndContainerNamesFromUrl(),this.blobContext=this.storageClientContext.blob,this._snapshot=(0,v.getURLParameter)(this.url,g.URLConstants.Parameters.SNAPSHOT),this._versionId=(0,v.getURLParameter)(this.url,g.URLConstants.Parameters.VERSIONID)}withSnapshot(t){return new e((0,v.setURLParameter)(this.url,g.URLConstants.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}withVersion(t){return new e((0,v.setURLParameter)(this.url,g.URLConstants.Parameters.VERSIONID,t.length===0?void 0:t),this.pipeline)}getAppendBlobClient(){return new C(this.url,this.pipeline)}getBlockBlobClient(){return new w(this.url,this.pipeline)}getPageBlobClient(){return new T(this.url,this.pipeline)}async download(e=0,t,n={}){return n.conditions=n.conditions||{},n.conditions=n.conditions||{},(0,c.ensureCpkIfSpecified)(n.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlobClient-download`,n,async i=>{let o=(0,v.assertResponse)(await this.blobContext.download({abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onDownloadProgress:r.isNodeLike?void 0:n.onProgress},range:e===0&&!t?void 0:(0,f.rangeToString)({offset:e,count:t}),rangeGetContentMD5:n.rangeGetContentMD5,rangeGetContentCRC64:n.rangeGetContentCrc64,snapshot:n.snapshot,cpkInfo:n.customerProvidedKey,tracingOptions:i.tracingOptions})),s={...o,_response:o._response,objectReplicationDestinationPolicyId:o.objectReplicationPolicyId,objectReplicationSourceProperties:(0,v.parseObjectReplicationRecord)(o.objectReplicationRules)};if(!r.isNodeLike)return s;if((n.maxRetryRequests===void 0||n.maxRetryRequests<0)&&(n.maxRetryRequests=g.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS),o.contentLength===void 0)throw RangeError(`File download response doesn't contain valid content length header`);if(!o.etag)throw RangeError(`File download response doesn't contain valid etag header`);return new a.BlobDownloadResponse(s,async t=>{let r={leaseAccessConditions:n.conditions,modifiedAccessConditions:{ifMatch:n.conditions.ifMatch||o.etag,ifModifiedSince:n.conditions.ifModifiedSince,ifNoneMatch:n.conditions.ifNoneMatch,ifUnmodifiedSince:n.conditions.ifUnmodifiedSince,ifTags:n.conditions?.tagConditions},range:(0,f.rangeToString)({count:e+o.contentLength-t,offset:t}),rangeGetContentMD5:n.rangeGetContentMD5,rangeGetContentCRC64:n.rangeGetContentCrc64,snapshot:n.snapshot,cpkInfo:n.customerProvidedKey};return(await this.blobContext.download({abortSignal:n.abortSignal,...r})).readableStreamBody},e,o.contentLength,{maxRetryRequests:n.maxRetryRequests,onProgress:n.onProgress})})}async exists(e={}){return _.tracingClient.withSpan(`BlobClient-exists`,e,async t=>{try{return(0,c.ensureCpkIfSpecified)(e.customerProvidedKey,this.isHttps),await this.getProperties({abortSignal:e.abortSignal,customerProvidedKey:e.customerProvidedKey,conditions:e.conditions,tracingOptions:t.tracingOptions}),!0}catch(e){if(e.statusCode===404)return!1;if(e.statusCode===409&&(e.details.errorCode===g.BlobUsesCustomerSpecifiedEncryptionMsg||e.details.errorCode===g.BlobDoesNotUseCustomerSpecifiedEncryption))return!0;throw e}})}async getProperties(e={}){return e.conditions=e.conditions||{},(0,c.ensureCpkIfSpecified)(e.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlobClient-getProperties`,e,async t=>{let n=(0,v.assertResponse)(await this.blobContext.getProperties({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,tracingOptions:t.tracingOptions}));return{...n,_response:n._response,objectReplicationDestinationPolicyId:n.objectReplicationPolicyId,objectReplicationSourceProperties:(0,v.parseObjectReplicationRecord)(n.objectReplicationRules)}})}async delete(e={}){return e.conditions=e.conditions||{},_.tracingClient.withSpan(`BlobClient-delete`,e,async t=>(0,v.assertResponse)(await this.blobContext.delete({abortSignal:e.abortSignal,deleteSnapshots:e.deleteSnapshots,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async deleteIfExists(e={}){return _.tracingClient.withSpan(`BlobClient-deleteIfExists`,e,async e=>{try{let t=(0,v.assertResponse)(await this.delete(e));return{succeeded:!0,...t,_response:t._response}}catch(e){if(e.details?.errorCode===`BlobNotFound`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async undelete(e={}){return _.tracingClient.withSpan(`BlobClient-undelete`,e,async t=>(0,v.assertResponse)(await this.blobContext.undelete({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async setHTTPHeaders(e,t={}){return t.conditions=t.conditions||{},(0,c.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlobClient-setHTTPHeaders`,t,async n=>(0,v.assertResponse)(await this.blobContext.setHttpHeaders({abortSignal:t.abortSignal,blobHttpHeaders:e,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions})))}async setMetadata(e,t={}){return t.conditions=t.conditions||{},(0,c.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlobClient-setMetadata`,t,async n=>(0,v.assertResponse)(await this.blobContext.setMetadata({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,tracingOptions:n.tracingOptions})))}async setTags(e,t={}){return _.tracingClient.withSpan(`BlobClient-setTags`,t,async n=>(0,v.assertResponse)(await this.blobContext.setTags({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},blobModifiedAccessConditions:t.conditions,tracingOptions:n.tracingOptions,tags:(0,v.toBlobTags)(e)})))}async getTags(e={}){return _.tracingClient.withSpan(`BlobClient-getTags`,e,async t=>{let n=(0,v.assertResponse)(await this.blobContext.getTags({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},blobModifiedAccessConditions:e.conditions,tracingOptions:t.tracingOptions}));return{...n,_response:n._response,tags:(0,v.toTags)({blobTagSet:n.blobTagSet})||{}}})}getBlobLeaseClient(e){return new x.BlobLeaseClient(this,e)}async createSnapshot(e={}){return e.conditions=e.conditions||{},(0,c.ensureCpkIfSpecified)(e.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlobClient-createSnapshot`,e,async t=>(0,v.assertResponse)(await this.blobContext.createSnapshot({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,tracingOptions:t.tracingOptions})))}async beginCopyFromURL(e,t={}){let n=new d.BlobBeginCopyFromUrlPoller({blobClient:{abortCopyFromURL:(...e)=>this.abortCopyFromURL(...e),getProperties:(...e)=>this.getProperties(...e),startCopyFromURL:(...e)=>this.startCopyFromURL(...e)},copySource:e,intervalInMs:t.intervalInMs,onProgress:t.onProgress,resumeFrom:t.resumeFrom,startCopyFromURLOptions:t});return await n.poll(),n}async abortCopyFromURL(e,t={}){return _.tracingClient.withSpan(`BlobClient-abortCopyFromURL`,t,async n=>(0,v.assertResponse)(await this.blobContext.abortCopyFromURL(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,tracingOptions:n.tracingOptions})))}async syncCopyFromURL(e,t={}){return t.conditions=t.conditions||{},t.sourceConditions=t.sourceConditions||{},_.tracingClient.withSpan(`BlobClient-syncCopyFromURL`,t,async n=>(0,v.assertResponse)(await this.blobContext.copyFromURL(e,{abortSignal:t.abortSignal,metadata:t.metadata,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions?.ifMatch,sourceIfModifiedSince:t.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions?.ifUnmodifiedSince},sourceContentMD5:t.sourceContentMD5,copySourceAuthorization:(0,v.httpAuthorizationToString)(t.sourceAuthorization),tier:(0,c.toAccessTier)(t.tier),blobTagsString:(0,v.toBlobTagsString)(t.tags),immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,encryptionScope:t.encryptionScope,copySourceTags:t.copySourceTags,fileRequestIntent:t.sourceShareTokenIntent,tracingOptions:n.tracingOptions})))}async setAccessTier(e,t={}){return _.tracingClient.withSpan(`BlobClient-setAccessTier`,t,async n=>(0,v.assertResponse)(await this.blobContext.setTier((0,c.toAccessTier)(e),{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},rehydratePriority:t.rehydratePriority,tracingOptions:n.tracingOptions})))}async downloadToBuffer(e,t,n,r={}){let i,a=0,o=0,s=r;e instanceof Buffer?(i=e,a=t||0,o=typeof n==`number`?n:0):(a=typeof e==`number`?e:0,o=typeof t==`number`?t:0,s=n||{});let c=s.blockSize??0;if(c<0)throw RangeError(`blockSize option must be >= 0`);if(c===0&&(c=g.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES),a<0)throw RangeError(`offset option must be >= 0`);if(o&&o<=0)throw RangeError(`count option must be greater than 0`);return s.conditions||={},_.tracingClient.withSpan(`BlobClient-downloadToBuffer`,s,async e=>{if(!o){let t=await this.getProperties({...s,tracingOptions:e.tracingOptions});if(o=t.contentLength-a,o<0)throw RangeError(`offset ${a} shouldn't be larger than blob size ${t.contentLength}`)}if(!i)try{i=Buffer.alloc(o)}catch(e){throw Error(`Unable to allocate the buffer of size: ${o}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ${e.message}`)}if(i.length{let n=a+o;r+c{let a=await this.download(t,n,{...r,tracingOptions:i.tracingOptions});return a.readableStreamBody&&await(0,y.readStreamToLocalFile)(a.readableStreamBody,e),a.blobDownloadStream=void 0,a})}getBlobAndContainerNamesFromUrl(){let e,t;try{let n=new URL(this.url);if(n.host.split(`.`)[1]===`blob`){let r=n.pathname.match(`/([^/]*)(/(.*))?`);e=r[1],t=r[3]}else if((0,v.isIpEndpointStyle)(n)){let r=n.pathname.match(`/([^/]*)/([^/]*)(/(.*))?`);e=r[2],t=r[4]}else{let r=n.pathname.match(`/([^/]*)(/(.*))?`);e=r[1],t=r[3]}if(e=decodeURIComponent(e),t=decodeURIComponent(t),t=t.replace(/\\/g,`/`),!e)throw Error(`Provided containerName is invalid.`);return{blobName:t,containerName:e}}catch{throw Error(`Unable to extract blobName and containerName with provided information.`)}}async startCopyFromURL(e,t={}){return _.tracingClient.withSpan(`BlobClient-startCopyFromURL`,t,async n=>(t.conditions=t.conditions||{},t.sourceConditions=t.sourceConditions||{},(0,v.assertResponse)(await this.blobContext.startCopyFromURL(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince,sourceIfTags:t.sourceConditions.tagConditions},immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,rehydratePriority:t.rehydratePriority,tier:(0,c.toAccessTier)(t.tier),blobTagsString:(0,v.toBlobTagsString)(t.tags),sealBlob:t.sealBlob,tracingOptions:n.tracingOptions}))))}generateSasUrl(e){return new Promise(t=>{if(!(this.credential instanceof s.StorageSharedKeyCredential))throw RangeError(`Can only generate the SAS when the client is initialized with a shared key credential`);let n=(0,b.generateBlobSASQueryParameters)({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},this.credential).toString();t((0,v.appendToURLQuery)(this.url,n))})}generateSasStringToSign(e){if(!(this.credential instanceof s.StorageSharedKeyCredential))throw RangeError(`Can only generate the SAS when the client is initialized with a shared key credential`);return(0,b.generateBlobSASQueryParametersInternal)({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},this.credential).stringToSign}generateUserDelegationSasUrl(e,t){return new Promise(n=>{let r=(0,b.generateBlobSASQueryParameters)({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},t,this.accountName).toString();n((0,v.appendToURLQuery)(this.url,r))})}generateUserDelegationSasStringToSign(e,t){return(0,b.generateBlobSASQueryParametersInternal)({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},t,this.accountName).stringToSign}async deleteImmutabilityPolicy(e={}){return _.tracingClient.withSpan(`BlobClient-deleteImmutabilityPolicy`,e,async e=>(0,v.assertResponse)(await this.blobContext.deleteImmutabilityPolicy({tracingOptions:e.tracingOptions})))}async setImmutabilityPolicy(e,t={}){return _.tracingClient.withSpan(`BlobClient-setImmutabilityPolicy`,t,async t=>(0,v.assertResponse)(await this.blobContext.setImmutabilityPolicy({immutabilityPolicyExpiry:e.expiriesOn,immutabilityPolicyMode:e.policyMode,tracingOptions:t.tracingOptions})))}async setLegalHold(e,t={}){return _.tracingClient.withSpan(`BlobClient-setLegalHold`,t,async t=>(0,v.assertResponse)(await this.blobContext.setLegalHold(e,{tracingOptions:t.tracingOptions})))}async getAccountInfo(e={}){return _.tracingClient.withSpan(`BlobClient-getAccountInfo`,e,async t=>(0,v.assertResponse)(await this.blobContext.getAccountInfo({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}};e.BlobClient=S;var C=class e extends S{appendBlobContext;constructor(e,i,a,o){let c,l;if(o||={},(0,u.isPipelineLike)(i))l=e,c=i;else if(r.isNodeLike&&i instanceof s.StorageSharedKeyCredential||i instanceof s.AnonymousCredential||(0,n.isTokenCredential)(i))l=e,o=a,c=(0,u.newPipeline)(i,o);else if(!i&&typeof i!=`string`)l=e,c=(0,u.newPipeline)(new s.AnonymousCredential,o);else if(i&&typeof i==`string`&&a&&typeof a==`string`){let n=i,d=a,f=(0,v.extractConnectionStringParts)(e);if(f.kind===`AccountConnString`)if(r.isNodeLike){let e=new s.StorageSharedKeyCredential(f.accountName,f.accountKey);l=(0,v.appendToURLPath)((0,v.appendToURLPath)(f.url,encodeURIComponent(n)),encodeURIComponent(d)),o.proxyOptions||=(0,t.getDefaultProxySettings)(f.proxyUri),c=(0,u.newPipeline)(e,o)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(f.kind===`SASConnString`)l=(0,v.appendToURLPath)((0,v.appendToURLPath)(f.url,encodeURIComponent(n)),encodeURIComponent(d))+`?`+f.accountSas,c=(0,u.newPipeline)(new s.AnonymousCredential,o);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(l,c),this.appendBlobContext=this.storageClientContext.appendBlob}withSnapshot(t){return new e((0,v.setURLParameter)(this.url,g.URLConstants.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async create(e={}){return e.conditions=e.conditions||{},(0,c.ensureCpkIfSpecified)(e.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`AppendBlobClient-create`,e,async t=>(0,v.assertResponse)(await this.appendBlobContext.create(0,{abortSignal:e.abortSignal,blobHttpHeaders:e.blobHTTPHeaders,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,immutabilityPolicyExpiry:e.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:e.immutabilityPolicy?.policyMode,legalHold:e.legalHold,blobTagsString:(0,v.toBlobTagsString)(e.tags),tracingOptions:t.tracingOptions})))}async createIfNotExists(e={}){let t={ifNoneMatch:g.ETagAny};return _.tracingClient.withSpan(`AppendBlobClient-createIfNotExists`,e,async e=>{try{let n=(0,v.assertResponse)(await this.create({...e,conditions:t}));return{succeeded:!0,...n,_response:n._response}}catch(e){if(e.details?.errorCode===`BlobAlreadyExists`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async seal(e={}){return e.conditions=e.conditions||{},_.tracingClient.withSpan(`AppendBlobClient-seal`,e,async t=>(0,v.assertResponse)(await this.appendBlobContext.seal({abortSignal:e.abortSignal,appendPositionAccessConditions:e.conditions,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async appendBlock(e,t,n={}){return n.conditions=n.conditions||{},(0,c.ensureCpkIfSpecified)(n.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`AppendBlobClient-appendBlock`,n,async r=>(0,v.assertResponse)(await this.appendBlobContext.appendBlock(t,e,{abortSignal:n.abortSignal,appendPositionAccessConditions:n.conditions,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onUploadProgress:n.onProgress},transactionalContentMD5:n.transactionalContentMD5,transactionalContentCrc64:n.transactionalContentCrc64,cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,tracingOptions:r.tracingOptions})))}async appendBlockFromURL(e,t,n,r={}){return r.conditions=r.conditions||{},r.sourceConditions=r.sourceConditions||{},(0,c.ensureCpkIfSpecified)(r.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`AppendBlobClient-appendBlockFromURL`,r,async i=>(0,v.assertResponse)(await this.appendBlobContext.appendBlockFromUrl(e,0,{abortSignal:r.abortSignal,sourceRange:(0,f.rangeToString)({offset:t,count:n}),sourceContentMD5:r.sourceContentMD5,sourceContentCrc64:r.sourceContentCrc64,leaseAccessConditions:r.conditions,appendPositionAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:r.sourceConditions?.ifMatch,sourceIfModifiedSince:r.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:r.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:r.sourceConditions?.ifUnmodifiedSince},copySourceAuthorization:(0,v.httpAuthorizationToString)(r.sourceAuthorization),cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,fileRequestIntent:r.sourceShareTokenIntent,tracingOptions:i.tracingOptions})))}};e.AppendBlobClient=C;var w=class e extends S{_blobContext;blockBlobContext;constructor(e,i,a,o){let c,l;if(o||={},(0,u.isPipelineLike)(i))l=e,c=i;else if(r.isNodeLike&&i instanceof s.StorageSharedKeyCredential||i instanceof s.AnonymousCredential||(0,n.isTokenCredential)(i))l=e,o=a,c=(0,u.newPipeline)(i,o);else if(!i&&typeof i!=`string`)l=e,a&&typeof a!=`string`&&(o=a),c=(0,u.newPipeline)(new s.AnonymousCredential,o);else if(i&&typeof i==`string`&&a&&typeof a==`string`){let n=i,d=a,f=(0,v.extractConnectionStringParts)(e);if(f.kind===`AccountConnString`)if(r.isNodeLike){let e=new s.StorageSharedKeyCredential(f.accountName,f.accountKey);l=(0,v.appendToURLPath)((0,v.appendToURLPath)(f.url,encodeURIComponent(n)),encodeURIComponent(d)),o.proxyOptions||=(0,t.getDefaultProxySettings)(f.proxyUri),c=(0,u.newPipeline)(e,o)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(f.kind===`SASConnString`)l=(0,v.appendToURLPath)((0,v.appendToURLPath)(f.url,encodeURIComponent(n)),encodeURIComponent(d))+`?`+f.accountSas,c=(0,u.newPipeline)(new s.AnonymousCredential,o);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(l,c),this.blockBlobContext=this.storageClientContext.blockBlob,this._blobContext=this.storageClientContext.blob}withSnapshot(t){return new e((0,v.setURLParameter)(this.url,g.URLConstants.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async query(e,t={}){if((0,c.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),!r.isNodeLike)throw Error(`This operation currently is only supported in Node.js.`);return _.tracingClient.withSpan(`BlockBlobClient-query`,t,async n=>{let r=(0,v.assertResponse)(await this._blobContext.query({abortSignal:t.abortSignal,queryRequest:{queryType:`SQL`,expression:e,inputSerialization:(0,v.toQuerySerialization)(t.inputTextConfiguration),outputSerialization:(0,v.toQuerySerialization)(t.outputTextConfiguration)},leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,tracingOptions:n.tracingOptions}));return new o.BlobQueryResponse(r,{abortSignal:t.abortSignal,onProgress:t.onProgress,onError:t.onError})})}async upload(e,t,n={}){return n.conditions=n.conditions||{},(0,c.ensureCpkIfSpecified)(n.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlockBlobClient-upload`,n,async r=>(0,v.assertResponse)(await this.blockBlobContext.upload(t,e,{abortSignal:n.abortSignal,blobHttpHeaders:n.blobHTTPHeaders,leaseAccessConditions:n.conditions,metadata:n.metadata,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onUploadProgress:n.onProgress},cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,immutabilityPolicyExpiry:n.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:n.immutabilityPolicy?.policyMode,legalHold:n.legalHold,tier:(0,c.toAccessTier)(n.tier),blobTagsString:(0,v.toBlobTagsString)(n.tags),tracingOptions:r.tracingOptions})))}async syncUploadFromURL(e,t={}){return t.conditions=t.conditions||{},(0,c.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlockBlobClient-syncUploadFromURL`,t,async n=>(0,v.assertResponse)(await this.blockBlobContext.putBlobFromUrl(0,e,{...t,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions?.ifMatch,sourceIfModifiedSince:t.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions?.ifUnmodifiedSince,sourceIfTags:t.sourceConditions?.tagConditions},cpkInfo:t.customerProvidedKey,copySourceAuthorization:(0,v.httpAuthorizationToString)(t.sourceAuthorization),tier:(0,c.toAccessTier)(t.tier),blobTagsString:(0,v.toBlobTagsString)(t.tags),copySourceTags:t.copySourceTags,fileRequestIntent:t.sourceShareTokenIntent,tracingOptions:n.tracingOptions})))}async stageBlock(e,t,n,r={}){return(0,c.ensureCpkIfSpecified)(r.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlockBlobClient-stageBlock`,r,async i=>(0,v.assertResponse)(await this.blockBlobContext.stageBlock(e,n,t,{abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,requestOptions:{onUploadProgress:r.onProgress},transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions})))}async stageBlockFromURL(e,t,n=0,r,i={}){return(0,c.ensureCpkIfSpecified)(i.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlockBlobClient-stageBlockFromURL`,i,async a=>(0,v.assertResponse)(await this.blockBlobContext.stageBlockFromURL(e,0,t,{abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,sourceContentMD5:i.sourceContentMD5,sourceContentCrc64:i.sourceContentCrc64,sourceRange:n===0&&!r?void 0:(0,f.rangeToString)({offset:n,count:r}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,copySourceAuthorization:(0,v.httpAuthorizationToString)(i.sourceAuthorization),fileRequestIntent:i.sourceShareTokenIntent,tracingOptions:a.tracingOptions})))}async commitBlockList(e,t={}){return t.conditions=t.conditions||{},(0,c.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`BlockBlobClient-commitBlockList`,t,async n=>(0,v.assertResponse)(await this.blockBlobContext.commitBlockList({latest:e},{abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,tier:(0,c.toAccessTier)(t.tier),blobTagsString:(0,v.toBlobTagsString)(t.tags),tracingOptions:n.tracingOptions})))}async getBlockList(e,t={}){return _.tracingClient.withSpan(`BlockBlobClient-getBlockList`,t,async n=>{let r=(0,v.assertResponse)(await this.blockBlobContext.getBlockList(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions}));return r.committedBlocks||=[],r.uncommittedBlocks||=[],r})}async uploadData(e,t={}){return _.tracingClient.withSpan(`BlockBlobClient-uploadData`,t,async t=>{if(r.isNodeLike){let n;return e instanceof Buffer?n=e:e instanceof ArrayBuffer?n=Buffer.from(e):(e=e,n=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.byteLength,t)}else{let n=new Blob([e]);return this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.size,t)}})}async uploadBrowserData(e,t={}){return _.tracingClient.withSpan(`BlockBlobClient-uploadBrowserData`,t,async t=>{let n=new Blob([e]);return this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.size,t)})}async uploadSeekableInternal(e,t,n={}){let r=n.blockSize??0;if(r<0||r>g.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES)throw RangeError(`blockSize option must be >= 0 and <= ${g.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`);let a=n.maxSingleShotSize??g.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;if(a<0||a>g.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES)throw RangeError(`maxSingleShotSize option must be >= 0 and <= ${g.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`);if(r===0){if(t>g.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES*g.BLOCK_BLOB_MAX_BLOCKS)throw RangeError(`${t} is too larger to upload to a block blob.`);t>a&&(r=Math.ceil(t/g.BLOCK_BLOB_MAX_BLOCKS),r{if(t<=a)return(0,v.assertResponse)(await this.upload(e(0,t),t,o));let s=Math.floor((t-1)/r)+1;if(s>g.BLOCK_BLOB_MAX_BLOCKS)throw RangeError(`The buffer's size is too big or the BlockSize is too small;the number of blocks must be <= ${g.BLOCK_BLOB_MAX_BLOCKS}`);let c=[],l=(0,i.randomUUID)(),u=0,d=new m.Batch(n.concurrency);for(let i=0;i{let a=(0,v.generateBlockID)(l,i),d=r*i,f=(i===s-1?t:d+r)-d;c.push(a),await this.stageBlock(a,e(d,f),f,{abortSignal:n.abortSignal,conditions:n.conditions,encryptionScope:n.encryptionScope,tracingOptions:o.tracingOptions}),u+=f,n.onProgress&&n.onProgress({loadedBytes:u})});return await d.do(),this.commitBlockList(c,o)})}async uploadFile(e,t={}){return _.tracingClient.withSpan(`BlockBlobClient-uploadFile`,t,async n=>{let r=(await(0,y.fsStat)(e)).size;return this.uploadSeekableInternal((t,n)=>()=>(0,y.fsCreateReadStream)(e,{autoClose:!0,end:n?t+n-1:1/0,start:t}),r,{...t,tracingOptions:n.tracingOptions})})}async uploadStream(e,t=g.DEFAULT_BLOCK_BUFFER_SIZE_BYTES,n=5,r={}){return r.blobHTTPHeaders||={},r.conditions||={},_.tracingClient.withSpan(`BlockBlobClient-uploadStream`,r,async a=>{let o=0,s=(0,i.randomUUID)(),c=0,l=[];return await new h.BufferScheduler(e,t,n,async(e,t)=>{let n=(0,v.generateBlockID)(s,o);l.push(n),o++,await this.stageBlock(n,e,t,{customerProvidedKey:r.customerProvidedKey,conditions:r.conditions,encryptionScope:r.encryptionScope,tracingOptions:a.tracingOptions}),c+=t,r.onProgress&&r.onProgress({loadedBytes:c})},Math.ceil(n/4*3)).do(),(0,v.assertResponse)(await this.commitBlockList(l,{...r,tracingOptions:a.tracingOptions}))})}};e.BlockBlobClient=w;var T=class e extends S{pageBlobContext;constructor(e,i,a,o){let c,l;if(o||={},(0,u.isPipelineLike)(i))l=e,c=i;else if(r.isNodeLike&&i instanceof s.StorageSharedKeyCredential||i instanceof s.AnonymousCredential||(0,n.isTokenCredential)(i))l=e,o=a,c=(0,u.newPipeline)(i,o);else if(!i&&typeof i!=`string`)l=e,c=(0,u.newPipeline)(new s.AnonymousCredential,o);else if(i&&typeof i==`string`&&a&&typeof a==`string`){let n=i,d=a,f=(0,v.extractConnectionStringParts)(e);if(f.kind===`AccountConnString`)if(r.isNodeLike){let e=new s.StorageSharedKeyCredential(f.accountName,f.accountKey);l=(0,v.appendToURLPath)((0,v.appendToURLPath)(f.url,encodeURIComponent(n)),encodeURIComponent(d)),o.proxyOptions||=(0,t.getDefaultProxySettings)(f.proxyUri),c=(0,u.newPipeline)(e,o)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(f.kind===`SASConnString`)l=(0,v.appendToURLPath)((0,v.appendToURLPath)(f.url,encodeURIComponent(n)),encodeURIComponent(d))+`?`+f.accountSas,c=(0,u.newPipeline)(new s.AnonymousCredential,o);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(l,c),this.pageBlobContext=this.storageClientContext.pageBlob}withSnapshot(t){return new e((0,v.setURLParameter)(this.url,g.URLConstants.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async create(e,t={}){return t.conditions=t.conditions||{},(0,c.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`PageBlobClient-create`,t,async n=>(0,v.assertResponse)(await this.pageBlobContext.create(0,e,{abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,blobSequenceNumber:t.blobSequenceNumber,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,tier:(0,c.toAccessTier)(t.tier),blobTagsString:(0,v.toBlobTagsString)(t.tags),tracingOptions:n.tracingOptions})))}async createIfNotExists(e,t={}){return _.tracingClient.withSpan(`PageBlobClient-createIfNotExists`,t,async n=>{try{let r={ifNoneMatch:g.ETagAny},i=(0,v.assertResponse)(await this.create(e,{...t,conditions:r,tracingOptions:n.tracingOptions}));return{succeeded:!0,...i,_response:i._response}}catch(e){if(e.details?.errorCode===`BlobAlreadyExists`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async uploadPages(e,t,n,r={}){return r.conditions=r.conditions||{},(0,c.ensureCpkIfSpecified)(r.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`PageBlobClient-uploadPages`,r,async i=>(0,v.assertResponse)(await this.pageBlobContext.uploadPages(n,e,{abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},requestOptions:{onUploadProgress:r.onProgress},range:(0,f.rangeToString)({offset:t,count:n}),sequenceNumberAccessConditions:r.conditions,transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions})))}async uploadPagesFromURL(e,t,n,r,i={}){return i.conditions=i.conditions||{},i.sourceConditions=i.sourceConditions||{},(0,c.ensureCpkIfSpecified)(i.customerProvidedKey,this.isHttps),_.tracingClient.withSpan(`PageBlobClient-uploadPagesFromURL`,i,async a=>(0,v.assertResponse)(await this.pageBlobContext.uploadPagesFromURL(e,(0,f.rangeToString)({offset:t,count:r}),0,(0,f.rangeToString)({offset:n,count:r}),{abortSignal:i.abortSignal,sourceContentMD5:i.sourceContentMD5,sourceContentCrc64:i.sourceContentCrc64,leaseAccessConditions:i.conditions,sequenceNumberAccessConditions:i.conditions,modifiedAccessConditions:{...i.conditions,ifTags:i.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:i.sourceConditions?.ifMatch,sourceIfModifiedSince:i.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:i.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:i.sourceConditions?.ifUnmodifiedSince},cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,copySourceAuthorization:(0,v.httpAuthorizationToString)(i.sourceAuthorization),fileRequestIntent:i.sourceShareTokenIntent,tracingOptions:a.tracingOptions})))}async clearPages(e=0,t,n={}){return n.conditions=n.conditions||{},_.tracingClient.withSpan(`PageBlobClient-clearPages`,n,async r=>(0,v.assertResponse)(await this.pageBlobContext.clearPages(0,{abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},range:(0,f.rangeToString)({offset:e,count:t}),sequenceNumberAccessConditions:n.conditions,cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,tracingOptions:r.tracingOptions})))}async getPageRanges(e=0,t,n={}){return n.conditions=n.conditions||{},_.tracingClient.withSpan(`PageBlobClient-getPageRanges`,n,async r=>{let i=(0,v.assertResponse)(await this.pageBlobContext.getPageRanges({abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},range:(0,f.rangeToString)({offset:e,count:t}),tracingOptions:r.tracingOptions}));return(0,l.rangeResponseFromModel)(i)})}async listPageRangesSegment(e=0,t,n,r={}){return _.tracingClient.withSpan(`PageBlobClient-getPageRangesSegment`,r,async i=>(0,v.assertResponse)(await this.pageBlobContext.getPageRanges({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},range:(0,f.rangeToString)({offset:e,count:t}),marker:n,maxPageSize:r.maxPageSize,tracingOptions:i.tracingOptions})))}async*listPageRangeItemSegments(e=0,t,n,r={}){let i;if(n||n===void 0)do i=await this.listPageRangesSegment(e,t,n,r),n=i.continuationToken,yield await i;while(n)}async*listPageRangeItems(e=0,t,n={}){for await(let r of this.listPageRangeItemSegments(e,t,void 0,n))yield*(0,v.ExtractPageRangeInfoItems)(r)}listPageRanges(e=0,t,n={}){n.conditions=n.conditions||{};let r=this.listPageRangeItems(e,t,n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(r={})=>this.listPageRangeItemSegments(e,t,r.continuationToken,{maxPageSize:r.maxPageSize,...n})}}async getPageRangesDiff(e,t,n,r={}){return r.conditions=r.conditions||{},_.tracingClient.withSpan(`PageBlobClient-getPageRangesDiff`,r,async i=>{let a=(0,v.assertResponse)(await this.pageBlobContext.getPageRangesDiff({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},prevsnapshot:n,range:(0,f.rangeToString)({offset:e,count:t}),tracingOptions:i.tracingOptions}));return(0,l.rangeResponseFromModel)(a)})}async listPageRangesDiffSegment(e,t,n,r,i={}){return _.tracingClient.withSpan(`PageBlobClient-getPageRangesDiffSegment`,i,async a=>(0,v.assertResponse)(await this.pageBlobContext.getPageRangesDiff({abortSignal:i?.abortSignal,leaseAccessConditions:i?.conditions,modifiedAccessConditions:{...i?.conditions,ifTags:i?.conditions?.tagConditions},prevsnapshot:n,range:(0,f.rangeToString)({offset:e,count:t}),marker:r,maxPageSize:i?.maxPageSize,tracingOptions:a.tracingOptions})))}async*listPageRangeDiffItemSegments(e,t,n,r,i){let a;if(r||r===void 0)do a=await this.listPageRangesDiffSegment(e,t,n,r,i),r=a.continuationToken,yield await a;while(r)}async*listPageRangeDiffItems(e,t,n,r){for await(let i of this.listPageRangeDiffItemSegments(e,t,n,void 0,r))yield*(0,v.ExtractPageRangeInfoItems)(i)}listPageRangesDiff(e,t,n,r={}){r.conditions=r.conditions||{};let i=this.listPageRangeDiffItems(e,t,n,{...r});return{next(){return i.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.listPageRangeDiffItemSegments(e,t,n,i.continuationToken,{maxPageSize:i.maxPageSize,...r})}}async getPageRangesDiffForManagedDisks(e,t,n,r={}){return r.conditions=r.conditions||{},_.tracingClient.withSpan(`PageBlobClient-GetPageRangesDiffForManagedDisks`,r,async i=>{let a=(0,v.assertResponse)(await this.pageBlobContext.getPageRangesDiff({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},prevSnapshotUrl:n,range:(0,f.rangeToString)({offset:e,count:t}),tracingOptions:i.tracingOptions}));return(0,l.rangeResponseFromModel)(a)})}async resize(e,t={}){return t.conditions=t.conditions||{},_.tracingClient.withSpan(`PageBlobClient-resize`,t,async n=>(0,v.assertResponse)(await this.pageBlobContext.resize(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},encryptionScope:t.encryptionScope,tracingOptions:n.tracingOptions})))}async updateSequenceNumber(e,t,n={}){return n.conditions=n.conditions||{},_.tracingClient.withSpan(`PageBlobClient-updateSequenceNumber`,n,async r=>(0,v.assertResponse)(await this.pageBlobContext.updateSequenceNumber(e,{abortSignal:n.abortSignal,blobSequenceNumber:t,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},tracingOptions:r.tracingOptions})))}async startCopyIncremental(e,t={}){return _.tracingClient.withSpan(`PageBlobClient-startCopyIncremental`,t,async n=>(0,v.assertResponse)(await this.pageBlobContext.copyIncremental(e,{abortSignal:t.abortSignal,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions})))}};e.PageBlobClient=T})),Nu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getBodyAsText=r,e.utf8ByteLength=i;let t=ju(),n=El();async function r(e){let r=Buffer.alloc(n.BATCH_MAX_PAYLOAD_IN_BYTES),i=await(0,t.streamToBuffer2)(e.readableStreamBody,r);return r=r.slice(0,i),r.toString()}function i(e){return Buffer.byteLength(e)}})),Pu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BatchResponseParser=void 0;let t=gc(),n=Kc(),r=El(),i=Nu(),a=Zc();e.BatchResponseParser=class{batchResponse;responseBatchBoundary;perResponsePrefix;batchResponseEnding;subRequests;constructor(e,t){if(!e||!e.contentType)throw RangeError(`batchResponse is malformed or doesn't contain valid content-type.`);if(!t||t.size===0)throw RangeError(`Invalid state: subRequests is not provided or size is 0.`);this.batchResponse=e,this.subRequests=t,this.responseBatchBoundary=this.batchResponse.contentType.split(`=`)[1],this.perResponsePrefix=`--${this.responseBatchBoundary}${r.HTTP_LINE_ENDING}`,this.batchResponseEnding=`--${this.responseBatchBoundary}--`}async parseBatchResponse(){if(this.batchResponse._response.status!==r.HTTPURLConnection.HTTP_ACCEPTED)throw Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`);let e=(await(0,i.getBodyAsText)(this.batchResponse)).split(this.batchResponseEnding)[0].split(this.perResponsePrefix).slice(1),o=e.length;if(o!==this.subRequests.size&&o!==1)throw Error(`Invalid state: sub responses' count is not equal to sub requests' count.`);let s=Array(o),c=0,l=0;for(let i=0;i=0&&h{Object.defineProperty(e,`__esModule`,{value:!0}),e.Mutex=void 0;var t;(function(e){e[e.LOCKED=0]=`LOCKED`,e[e.UNLOCKED=1]=`UNLOCKED`})(t||={}),e.Mutex=class{static async lock(e){return new Promise(n=>{this.keys[e]===void 0||this.keys[e]===t.UNLOCKED?(this.keys[e]=t.LOCKED,n()):this.onUnlockEvent(e,()=>{this.keys[e]=t.LOCKED,n()})})}static async unlock(e){return new Promise(n=>{this.keys[e]===t.LOCKED&&this.emitUnlockEvent(e),delete this.keys[e],n()})}static keys={};static listeners={};static onUnlockEvent(e,t){this.listeners[e]===void 0?this.listeners[e]=[t]:this.listeners[e].push(t)}static emitUnlockEvent(e){if(this.listeners[e]!==void 0&&this.listeners[e].length>0){let t=this.listeners[e].shift();setImmediate(()=>{t.call(this)})}}}})),Iu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobBatch=void 0;let t=zs(),n=Sc(),r=gc(),i=zs(),a=Tl(),o=Mu(),s=Fu(),c=Dl(),l=Jl(),u=Xc(),d=El(),f=Xl(),p=Bc();e.BlobBatch=class{batchRequest;batch=`batch`;batchType;constructor(){this.batchRequest=new m}getMultiPartContentType(){return this.batchRequest.getMultipartContentType()}getHttpRequestBody(){return this.batchRequest.getHttpRequestBody()}getSubRequests(){return this.batchRequest.getSubRequests()}async addSubRequestInternal(e,t){await s.Mutex.lock(this.batch);try{this.batchRequest.preAddSubRequest(e),await t(),this.batchRequest.postAddSubRequest(e)}finally{await s.Mutex.unlock(this.batch)}}setBatchType(e){if(this.batchType||=e,this.batchType!==e)throw RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`)}async deleteBlob(e,t,r){let s,c;if(typeof e==`string`&&(i.isNodeLike&&t instanceof a.StorageSharedKeyCredential||t instanceof a.AnonymousCredential||(0,n.isTokenCredential)(t)))s=e,c=t;else if(e instanceof o.BlobClient)s=e.url,c=e.credential,r=t;else throw RangeError(`Invalid arguments. Either url and credential, or BlobClient need be provided.`);return r||={},f.tracingClient.withSpan(`BatchDeleteRequest-addSubRequest`,r,async e=>{this.setBatchType(`delete`),await this.addSubRequestInternal({url:s,credential:c},async()=>{await new o.BlobClient(s,this.batchRequest.createPipeline(c)).delete(e)})})}async setBlobAccessTier(e,t,r,s){let c,l,u;if(typeof e==`string`&&(i.isNodeLike&&t instanceof a.StorageSharedKeyCredential||t instanceof a.AnonymousCredential||(0,n.isTokenCredential)(t)))c=e,l=t,u=r;else if(e instanceof o.BlobClient)c=e.url,l=e.credential,u=t,s=r;else throw RangeError(`Invalid arguments. Either url and credential, or BlobClient need be provided.`);return s||={},f.tracingClient.withSpan(`BatchSetTierRequest-addSubRequest`,s,async e=>{this.setBatchType(`setAccessTier`),await this.addSubRequestInternal({url:c,credential:l},async()=>{await new o.BlobClient(c,this.batchRequest.createPipeline(l)).setAccessTier(u,e)})})}};var m=class{operationCount;body;subRequests;boundary;subRequestPrefix;multipartContentType;batchRequestEnding;constructor(){this.operationCount=0,this.body=``,this.boundary=`batch_${(0,t.randomUUID)()}`,this.subRequestPrefix=`--${this.boundary}${d.HTTP_LINE_ENDING}${d.HeaderConstants.CONTENT_TYPE}: application/http${d.HTTP_LINE_ENDING}${d.HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`,this.multipartContentType=`multipart/mixed; boundary=${this.boundary}`,this.batchRequestEnding=`--${this.boundary}--`,this.subRequests=new Map}createPipeline(e){let t=(0,r.createEmptyPipeline)();t.addPolicy((0,p.serializationPolicy)({stringifyXML:u.stringifyXML,serializerOptions:{xml:{xmlCharKey:`#`}}}),{phase:`Serialize`}),t.addPolicy(g()),t.addPolicy(h(this),{afterPhase:`Sign`}),(0,n.isTokenCredential)(e)?t.addPolicy((0,r.bearerTokenAuthenticationPolicy)({credential:e,scopes:d.StorageOAuthScopes,challengeCallbacks:{authorizeRequestOnChallenge:p.authorizeRequestOnTenantChallenge}}),{phase:`Sign`}):e instanceof a.StorageSharedKeyCredential&&t.addPolicy((0,a.storageSharedKeyCredentialPolicy)({accountName:e.accountName,accountKey:e.accountKey}),{phase:`Sign`});let i=new c.Pipeline([]);return i._credential=e,i._corePipeline=t,i}appendSubRequestToBody(e){this.body+=[this.subRequestPrefix,`${d.HeaderConstants.CONTENT_ID}: ${this.operationCount}`,``,`${e.method.toString()} ${(0,l.getURLPathAndQuery)(e.url)} ${d.HTTP_VERSION_1_1}${d.HTTP_LINE_ENDING}`].join(d.HTTP_LINE_ENDING);for(let[t,n]of e.headers)this.body+=`${t}: ${n}${d.HTTP_LINE_ENDING}`;this.body+=d.HTTP_LINE_ENDING}preAddSubRequest(e){if(this.operationCount>=d.BATCH_MAX_REQUEST)throw RangeError(`Cannot exceed ${d.BATCH_MAX_REQUEST} sub requests in a single batch`);let t=(0,l.getURLPath)(e.url);if(!t||t===``)throw RangeError(`Invalid url for sub request: '${e.url}'`)}postAddSubRequest(e){this.subRequests.set(this.operationCount,e),this.operationCount++}getHttpRequestBody(){return`${this.body}${this.batchRequestEnding}${d.HTTP_LINE_ENDING}`}getMultipartContentType(){return this.multipartContentType}getSubRequests(){return this.subRequests}};function h(e){return{name:`batchRequestAssemblePolicy`,async sendRequest(t){return e.appendSubRequestToBody(t),{request:t,status:200,headers:(0,r.createHttpHeaders)()}}}}function g(){return{name:`batchHeaderFilterPolicy`,async sendRequest(e,t){let n=``;for(let[t]of e.headers)(0,l.iEqual)(t,d.HeaderConstants.X_MS_VERSION)&&(n=t);return n!==``&&e.headers.delete(n),t(e)}}}})),Lu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobBatchClient=void 0;let t=Pu(),n=Nu(),r=Iu(),i=Xl(),a=Tl(),o=ql(),s=Dl(),c=Jl();e.BlobBatchClient=class{serviceOrContainerContext;constructor(e,t,n){let r;r=(0,s.isPipelineLike)(t)?t:t?(0,s.newPipeline)(t,n):(0,s.newPipeline)(new a.AnonymousCredential,n);let i=new o.StorageContextClient(e,(0,s.getCoreClientOptions)(r)),l=(0,c.getURLPath)(e);l&&l!==`/`?this.serviceOrContainerContext=i.container:this.serviceOrContainerContext=i.service}createBatch(){return new r.BlobBatch}async deleteBlobs(e,t,n){let i=new r.BlobBatch;for(let r of e)typeof r==`string`?await i.deleteBlob(r,t,n):await i.deleteBlob(r,t);return this.submitBatch(i)}async setBlobsAccessTier(e,t,n,i){let a=new r.BlobBatch;for(let r of e)typeof r==`string`?await a.setBlobAccessTier(r,t,n,i):await a.setBlobAccessTier(r,t,n);return this.submitBatch(a)}async submitBatch(e,r={}){if(!e||e.getSubRequests().size===0)throw RangeError(`Batch request should contain one or more sub requests.`);return i.tracingClient.withSpan(`BlobBatchClient-submitBatch`,r,async r=>{let i=e.getHttpRequestBody(),a=(0,c.assertResponse)(await this.serviceOrContainerContext.submitBatch((0,n.utf8ByteLength)(i),e.getMultiPartContentType(),i,{...r})),o=await new t.BatchResponseParser(a,e.getSubRequests()).parseBatchResponse();return{_response:a._response,contentType:a.contentType,errorCode:a.errorCode,requestId:a.requestId,clientRequestId:a.clientRequestId,version:a.version,subResponses:o.subResponses,subResponsesSucceededCount:o.subResponsesSucceededCount,subResponsesFailedCount:o.subResponsesFailedCount}})}}})),Ru=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ContainerClient=void 0;let t=gc(),n=zs(),r=Sc(),i=Tl(),a=Dl(),o=Yl(),s=Xl(),c=Jl(),l=tu(),u=nu(),d=Mu(),f=Lu();e.ContainerClient=class extends o.StorageClient{containerContext;_containerName;get containerName(){return this._containerName}constructor(e,o,s){let l,u;if(s||={},(0,a.isPipelineLike)(o))u=e,l=o;else if(n.isNodeLike&&o instanceof i.StorageSharedKeyCredential||o instanceof i.AnonymousCredential||(0,r.isTokenCredential)(o))u=e,l=(0,a.newPipeline)(o,s);else if(!o&&typeof o!=`string`)u=e,l=(0,a.newPipeline)(new i.AnonymousCredential,s);else if(o&&typeof o==`string`){let r=o,d=(0,c.extractConnectionStringParts)(e);if(d.kind===`AccountConnString`)if(n.isNodeLike){let e=new i.StorageSharedKeyCredential(d.accountName,d.accountKey);u=(0,c.appendToURLPath)(d.url,encodeURIComponent(r)),s.proxyOptions||=(0,t.getDefaultProxySettings)(d.proxyUri),l=(0,a.newPipeline)(e,s)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(d.kind===`SASConnString`)u=(0,c.appendToURLPath)(d.url,encodeURIComponent(r))+`?`+d.accountSas,l=(0,a.newPipeline)(new i.AnonymousCredential,s);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName parameter`);super(u,l),this._containerName=this.getContainerNameFromUrl(),this.containerContext=this.storageClientContext.container}async create(e={}){return s.tracingClient.withSpan(`ContainerClient-create`,e,async e=>(0,c.assertResponse)(await this.containerContext.create(e)))}async createIfNotExists(e={}){return s.tracingClient.withSpan(`ContainerClient-createIfNotExists`,e,async e=>{try{let t=await this.create(e);return{succeeded:!0,...t,_response:t._response}}catch(e){if(e.details?.errorCode===`ContainerAlreadyExists`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async exists(e={}){return s.tracingClient.withSpan(`ContainerClient-exists`,e,async t=>{try{return await this.getProperties({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions}),!0}catch(e){if(e.statusCode===404)return!1;throw e}})}getBlobClient(e){return new d.BlobClient((0,c.appendToURLPath)(this.url,(0,c.EscapePath)(e)),this.pipeline)}getAppendBlobClient(e){return new d.AppendBlobClient((0,c.appendToURLPath)(this.url,(0,c.EscapePath)(e)),this.pipeline)}getBlockBlobClient(e){return new d.BlockBlobClient((0,c.appendToURLPath)(this.url,(0,c.EscapePath)(e)),this.pipeline)}getPageBlobClient(e){return new d.PageBlobClient((0,c.appendToURLPath)(this.url,(0,c.EscapePath)(e)),this.pipeline)}async getProperties(e={}){return e.conditions||={},s.tracingClient.withSpan(`ContainerClient-getProperties`,e,async t=>(0,c.assertResponse)(await this.containerContext.getProperties({abortSignal:e.abortSignal,...e.conditions,tracingOptions:t.tracingOptions})))}async delete(e={}){return e.conditions||={},s.tracingClient.withSpan(`ContainerClient-delete`,e,async t=>(0,c.assertResponse)(await this.containerContext.delete({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:e.conditions,tracingOptions:t.tracingOptions})))}async deleteIfExists(e={}){return s.tracingClient.withSpan(`ContainerClient-deleteIfExists`,e,async e=>{try{let t=await this.delete(e);return{succeeded:!0,...t,_response:t._response}}catch(e){if(e.details?.errorCode===`ContainerNotFound`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async setMetadata(e,t={}){if(t.conditions||={},t.conditions.ifUnmodifiedSince)throw RangeError(`the IfUnmodifiedSince must have their default values because they are ignored by the blob service`);return s.tracingClient.withSpan(`ContainerClient-setMetadata`,t,async n=>(0,c.assertResponse)(await this.containerContext.setMetadata({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:e,modifiedAccessConditions:t.conditions,tracingOptions:n.tracingOptions})))}async getAccessPolicy(e={}){return e.conditions||={},s.tracingClient.withSpan(`ContainerClient-getAccessPolicy`,e,async t=>{let n=(0,c.assertResponse)(await this.containerContext.getAccessPolicy({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,tracingOptions:t.tracingOptions})),r={_response:n._response,blobPublicAccess:n.blobPublicAccess,date:n.date,etag:n.etag,errorCode:n.errorCode,lastModified:n.lastModified,requestId:n.requestId,clientRequestId:n.clientRequestId,signedIdentifiers:[],version:n.version};for(let e of n){let t;e.accessPolicy&&(t={permissions:e.accessPolicy.permissions},e.accessPolicy.expiresOn&&(t.expiresOn=new Date(e.accessPolicy.expiresOn)),e.accessPolicy.startsOn&&(t.startsOn=new Date(e.accessPolicy.startsOn))),r.signedIdentifiers.push({accessPolicy:t,id:e.id})}return r})}async setAccessPolicy(e,t,n={}){return n.conditions=n.conditions||{},s.tracingClient.withSpan(`ContainerClient-setAccessPolicy`,n,async r=>{let i=[];for(let e of t||[])i.push({accessPolicy:{expiresOn:e.accessPolicy.expiresOn?(0,c.truncatedISO8061Date)(e.accessPolicy.expiresOn):``,permissions:e.accessPolicy.permissions,startsOn:e.accessPolicy.startsOn?(0,c.truncatedISO8061Date)(e.accessPolicy.startsOn):``},id:e.id});return(0,c.assertResponse)(await this.containerContext.setAccessPolicy({abortSignal:n.abortSignal,access:e,containerAcl:i,leaseAccessConditions:n.conditions,modifiedAccessConditions:n.conditions,tracingOptions:r.tracingOptions}))})}getBlobLeaseClient(e){return new u.BlobLeaseClient(this,e)}async uploadBlockBlob(e,t,n,r={}){return s.tracingClient.withSpan(`ContainerClient-uploadBlockBlob`,r,async r=>{let i=this.getBlockBlobClient(e);return{blockBlobClient:i,response:await i.upload(t,n,r)}})}async deleteBlob(e,t={}){return s.tracingClient.withSpan(`ContainerClient-deleteBlob`,t,async n=>{let r=this.getBlobClient(e);return t.versionId&&(r=r.withVersion(t.versionId)),r.delete(n)})}async listBlobFlatSegment(e,t={}){return s.tracingClient.withSpan(`ContainerClient-listBlobFlatSegment`,t,async n=>{let r=(0,c.assertResponse)(await this.containerContext.listBlobFlatSegment({marker:e,...t,tracingOptions:n.tracingOptions}));return{...r,_response:{...r._response,parsedBody:(0,c.ConvertInternalResponseOfListBlobFlat)(r._response.parsedBody)},segment:{...r.segment,blobItems:r.segment.blobItems.map(e=>({...e,name:(0,c.BlobNameToString)(e.name),tags:(0,c.toTags)(e.blobTags),objectReplicationSourceProperties:(0,c.parseObjectReplicationRecord)(e.objectReplicationMetadata)}))}}})}async listBlobHierarchySegment(e,t,n={}){return s.tracingClient.withSpan(`ContainerClient-listBlobHierarchySegment`,n,async r=>{let i=(0,c.assertResponse)(await this.containerContext.listBlobHierarchySegment(e,{marker:t,...n,tracingOptions:r.tracingOptions}));return{...i,_response:{...i._response,parsedBody:(0,c.ConvertInternalResponseOfListBlobHierarchy)(i._response.parsedBody)},segment:{...i.segment,blobItems:i.segment.blobItems.map(e=>({...e,name:(0,c.BlobNameToString)(e.name),tags:(0,c.toTags)(e.blobTags),objectReplicationSourceProperties:(0,c.parseObjectReplicationRecord)(e.objectReplicationMetadata)})),blobPrefixes:i.segment.blobPrefixes?.map(e=>({...e,name:(0,c.BlobNameToString)(e.name)}))}}})}async*listSegments(e,t={}){let n;if(e||e===void 0)do n=await this.listBlobFlatSegment(e,t),e=n.continuationToken,yield await n;while(e)}async*listItems(e={}){for await(let t of this.listSegments(void 0,e))yield*t.segment.blobItems}listBlobsFlat(e={}){let t=[];e.includeCopy&&t.push(`copy`),e.includeDeleted&&t.push(`deleted`),e.includeMetadata&&t.push(`metadata`),e.includeSnapshots&&t.push(`snapshots`),e.includeVersions&&t.push(`versions`),e.includeUncommitedBlobs&&t.push(`uncommittedblobs`),e.includeTags&&t.push(`tags`),e.includeDeletedWithVersions&&t.push(`deletedwithversions`),e.includeImmutabilityPolicy&&t.push(`immutabilitypolicy`),e.includeLegalHold&&t.push(`legalhold`),e.prefix===``&&(e.prefix=void 0);let n={...e,...t.length>0?{include:t}:{}},r=this.listItems(n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(e={})=>this.listSegments(e.continuationToken,{maxPageSize:e.maxPageSize,...n})}}async*listHierarchySegments(e,t,n={}){let r;if(t||t===void 0)do r=await this.listBlobHierarchySegment(e,t,n),t=r.continuationToken,yield await r;while(t)}async*listItemsByHierarchy(e,t={}){for await(let n of this.listHierarchySegments(e,void 0,t)){let e=n.segment;if(e.blobPrefixes)for(let t of e.blobPrefixes)yield{kind:`prefix`,...t};for(let t of e.blobItems)yield{kind:`blob`,...t}}}listBlobsByHierarchy(e,t={}){if(e===``)throw RangeError(`delimiter should contain one or more characters`);let n=[];t.includeCopy&&n.push(`copy`),t.includeDeleted&&n.push(`deleted`),t.includeMetadata&&n.push(`metadata`),t.includeSnapshots&&n.push(`snapshots`),t.includeVersions&&n.push(`versions`),t.includeUncommitedBlobs&&n.push(`uncommittedblobs`),t.includeTags&&n.push(`tags`),t.includeDeletedWithVersions&&n.push(`deletedwithversions`),t.includeImmutabilityPolicy&&n.push(`immutabilitypolicy`),t.includeLegalHold&&n.push(`legalhold`),t.prefix===``&&(t.prefix=void 0);let r={...t,...n.length>0?{include:n}:{}},i=this.listItemsByHierarchy(e,r);return{async next(){return i.next()},[Symbol.asyncIterator](){return this},byPage:(t={})=>this.listHierarchySegments(e,t.continuationToken,{maxPageSize:t.maxPageSize,...r})}}async findBlobsByTagsSegment(e,t,n={}){return s.tracingClient.withSpan(`ContainerClient-findBlobsByTagsSegment`,n,async r=>{let i=(0,c.assertResponse)(await this.containerContext.filterBlobs({abortSignal:n.abortSignal,where:e,marker:t,maxPageSize:n.maxPageSize,tracingOptions:r.tracingOptions}));return{...i,_response:i._response,blobs:i.blobs.map(e=>{let t=``;return e.tags?.blobTagSet.length===1&&(t=e.tags.blobTagSet[0].value),{...e,tags:(0,c.toTags)(e.tags),tagValue:t}})}})}async*findBlobsByTagsSegments(e,t,n={}){let r;if(t||t===void 0)do r=await this.findBlobsByTagsSegment(e,t,n),r.blobs=r.blobs||[],t=r.continuationToken,yield r;while(t)}async*findBlobsByTagsItems(e,t={}){for await(let n of this.findBlobsByTagsSegments(e,void 0,t))yield*n.blobs}findBlobsByTags(e,t={}){let n={...t},r=this.findBlobsByTagsItems(e,n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(t={})=>this.findBlobsByTagsSegments(e,t.continuationToken,{maxPageSize:t.maxPageSize,...n})}}async getAccountInfo(e={}){return s.tracingClient.withSpan(`ContainerClient-getAccountInfo`,e,async t=>(0,c.assertResponse)(await this.containerContext.getAccountInfo({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}getContainerNameFromUrl(){let e;try{let t=new URL(this.url);if(e=t.hostname.split(`.`)[1]===`blob`?t.pathname.split(`/`)[1]:(0,c.isIpEndpointStyle)(t)?t.pathname.split(`/`)[2]:t.pathname.split(`/`)[1],e=decodeURIComponent(e),!e)throw Error(`Provided containerName is invalid.`);return e}catch{throw Error(`Unable to extract containerName with provided information.`)}}generateSasUrl(e){return new Promise(t=>{if(!(this.credential instanceof i.StorageSharedKeyCredential))throw RangeError(`Can only generate the SAS when the client is initialized with a shared key credential`);let n=(0,l.generateBlobSASQueryParameters)({containerName:this._containerName,...e},this.credential).toString();t((0,c.appendToURLQuery)(this.url,n))})}generateSasStringToSign(e){if(!(this.credential instanceof i.StorageSharedKeyCredential))throw RangeError(`Can only generate the SAS when the client is initialized with a shared key credential`);return(0,l.generateBlobSASQueryParametersInternal)({containerName:this._containerName,...e},this.credential).stringToSign}generateUserDelegationSasUrl(e,t){return new Promise(n=>{let r=(0,l.generateBlobSASQueryParameters)({containerName:this._containerName,...e},t,this.accountName).toString();n((0,c.appendToURLQuery)(this.url,r))})}generateUserDelegationSasStringToSign(e,t){return(0,l.generateBlobSASQueryParametersInternal)({containerName:this._containerName,...e},t,this.accountName).stringToSign}getBlobBatchClient(){return new f.BlobBatchClient(this.url,this.pipeline)}}})),zu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AccountSASPermissions=void 0,e.AccountSASPermissions=class e{static parse(t){let n=new e;for(let e of t)switch(e){case`r`:n.read=!0;break;case`w`:n.write=!0;break;case`d`:n.delete=!0;break;case`x`:n.deleteVersion=!0;break;case`l`:n.list=!0;break;case`a`:n.add=!0;break;case`c`:n.create=!0;break;case`u`:n.update=!0;break;case`p`:n.process=!0;break;case`t`:n.tag=!0;break;case`f`:n.filter=!0;break;case`i`:n.setImmutabilityPolicy=!0;break;case`y`:n.permanentDelete=!0;break;default:throw RangeError(`Invalid permission character: ${e}`)}return n}static from(t){let n=new e;return t.read&&(n.read=!0),t.write&&(n.write=!0),t.delete&&(n.delete=!0),t.deleteVersion&&(n.deleteVersion=!0),t.filter&&(n.filter=!0),t.tag&&(n.tag=!0),t.list&&(n.list=!0),t.add&&(n.add=!0),t.create&&(n.create=!0),t.update&&(n.update=!0),t.process&&(n.process=!0),t.setImmutabilityPolicy&&(n.setImmutabilityPolicy=!0),t.permanentDelete&&(n.permanentDelete=!0),n}read=!1;write=!1;delete=!1;deleteVersion=!1;list=!1;add=!1;create=!1;update=!1;process=!1;tag=!1;filter=!1;setImmutabilityPolicy=!1;permanentDelete=!1;toString(){let e=[];return this.read&&e.push(`r`),this.write&&e.push(`w`),this.delete&&e.push(`d`),this.deleteVersion&&e.push(`x`),this.filter&&e.push(`f`),this.tag&&e.push(`t`),this.list&&e.push(`l`),this.add&&e.push(`a`),this.create&&e.push(`c`),this.update&&e.push(`u`),this.process&&e.push(`p`),this.setImmutabilityPolicy&&e.push(`i`),this.permanentDelete&&e.push(`y`),e.join(``)}}})),Bu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AccountSASResourceTypes=void 0,e.AccountSASResourceTypes=class e{static parse(t){let n=new e;for(let e of t)switch(e){case`s`:n.service=!0;break;case`c`:n.container=!0;break;case`o`:n.object=!0;break;default:throw RangeError(`Invalid resource type: ${e}`)}return n}service=!1;container=!1;object=!1;toString(){let e=[];return this.service&&e.push(`s`),this.container&&e.push(`c`),this.object&&e.push(`o`),e.join(``)}}})),Vu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AccountSASServices=void 0,e.AccountSASServices=class e{static parse(t){let n=new e;for(let e of t)switch(e){case`b`:n.blob=!0;break;case`f`:n.file=!0;break;case`q`:n.queue=!0;break;case`t`:n.table=!0;break;default:throw RangeError(`Invalid service character: ${e}`)}return n}blob=!1;file=!1;queue=!1;table=!1;toString(){let e=[];return this.blob&&e.push(`b`),this.table&&e.push(`t`),this.queue&&e.push(`q`),this.file&&e.push(`f`),e.join(``)}}})),Hu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.generateAccountSASQueryParameters=c,e.generateAccountSASQueryParametersInternal=l;let t=zu(),n=Bu(),r=Vu(),i=$l(),a=eu(),o=El(),s=Jl();function c(e,t){return l(e,t).sasQueryParameters}function l(e,c){let l=e.version?e.version:o.SERVICE_VERSION;if(e.permissions&&e.permissions.setImmutabilityPolicy&&l<`2020-08-04`)throw RangeError(`'version' must be >= '2020-08-04' when provided 'i' permission.`);if(e.permissions&&e.permissions.deleteVersion&&l<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when provided 'x' permission.`);if(e.permissions&&e.permissions.permanentDelete&&l<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when provided 'y' permission.`);if(e.permissions&&e.permissions.tag&&l<`2019-12-12`)throw RangeError(`'version' must be >= '2019-12-12' when provided 't' permission.`);if(e.permissions&&e.permissions.filter&&l<`2019-12-12`)throw RangeError(`'version' must be >= '2019-12-12' when provided 'f' permission.`);if(e.encryptionScope&&l<`2020-12-06`)throw RangeError(`'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.`);let u=t.AccountSASPermissions.parse(e.permissions.toString()),d=r.AccountSASServices.parse(e.services).toString(),f=n.AccountSASResourceTypes.parse(e.resourceTypes).toString(),p;p=l>=`2020-12-06`?[c.accountName,u,d,f,e.startsOn?(0,s.truncatedISO8061Date)(e.startsOn,!1):``,(0,s.truncatedISO8061Date)(e.expiresOn,!1),e.ipRange?(0,i.ipRangeToString)(e.ipRange):``,e.protocol?e.protocol:``,l,e.encryptionScope?e.encryptionScope:``,``].join(` `):[c.accountName,u,d,f,e.startsOn?(0,s.truncatedISO8061Date)(e.startsOn,!1):``,(0,s.truncatedISO8061Date)(e.expiresOn,!1),e.ipRange?(0,i.ipRangeToString)(e.ipRange):``,e.protocol?e.protocol:``,l,``].join(` -`);let m=c.computeHMACSHA256(p);return{sasQueryParameters:new a.SASQueryParameters(l,m,u.toString(),d,f,e.protocol,e.startsOn,e.expiresOn,e.ipRange,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,e.encryptionScope),stringToSign:p}}})),Uu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobServiceClient=void 0;let t=Sc(),n=gc(),r=zs(),i=Dl(),a=Ru(),o=Jl(),s=Tl(),c=Jl(),l=Xl(),u=Lu(),d=Yl(),f=zu(),p=Hu(),m=Vu();e.BlobServiceClient=class e extends d.StorageClient{serviceContext;static fromConnectionString(t,a){a||={};let c=(0,o.extractConnectionStringParts)(t);if(c.kind===`AccountConnString`)if(r.isNodeLike){let t=new s.StorageSharedKeyCredential(c.accountName,c.accountKey);a.proxyOptions||=(0,n.getDefaultProxySettings)(c.proxyUri);let r=(0,i.newPipeline)(t,a);return new e(c.url,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`){let t=(0,i.newPipeline)(new s.AnonymousCredential,a);return new e(c.url+`?`+c.accountSas,t)}else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}constructor(e,n,a){let o;o=(0,i.isPipelineLike)(n)?n:r.isNodeLike&&n instanceof s.StorageSharedKeyCredential||n instanceof s.AnonymousCredential||(0,t.isTokenCredential)(n)?(0,i.newPipeline)(n,a):(0,i.newPipeline)(new s.AnonymousCredential,a),super(e,o),this.serviceContext=this.storageClientContext.service}getContainerClient(e){return new a.ContainerClient((0,o.appendToURLPath)(this.url,encodeURIComponent(e)),this.pipeline)}async createContainer(e,t={}){return l.tracingClient.withSpan(`BlobServiceClient-createContainer`,t,async t=>{let n=this.getContainerClient(e);return{containerClient:n,containerCreateResponse:await n.create(t)}})}async deleteContainer(e,t={}){return l.tracingClient.withSpan(`BlobServiceClient-deleteContainer`,t,async t=>this.getContainerClient(e).delete(t))}async undeleteContainer(e,t,n={}){return l.tracingClient.withSpan(`BlobServiceClient-undeleteContainer`,n,async r=>{let i=this.getContainerClient(n.destinationContainerName||e),a=i.storageClientContext.container;return{containerClient:i,containerUndeleteResponse:(0,c.assertResponse)(await a.restore({deletedContainerName:e,deletedContainerVersion:t,tracingOptions:r.tracingOptions}))}})}async getProperties(e={}){return l.tracingClient.withSpan(`BlobServiceClient-getProperties`,e,async t=>(0,c.assertResponse)(await this.serviceContext.getProperties({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async setProperties(e,t={}){return l.tracingClient.withSpan(`BlobServiceClient-setProperties`,t,async n=>(0,c.assertResponse)(await this.serviceContext.setProperties(e,{abortSignal:t.abortSignal,tracingOptions:n.tracingOptions})))}async getStatistics(e={}){return l.tracingClient.withSpan(`BlobServiceClient-getStatistics`,e,async t=>(0,c.assertResponse)(await this.serviceContext.getStatistics({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async getAccountInfo(e={}){return l.tracingClient.withSpan(`BlobServiceClient-getAccountInfo`,e,async t=>(0,c.assertResponse)(await this.serviceContext.getAccountInfo({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async listContainersSegment(e,t={}){return l.tracingClient.withSpan(`BlobServiceClient-listContainersSegment`,t,async n=>(0,c.assertResponse)(await this.serviceContext.listContainersSegment({abortSignal:t.abortSignal,marker:e,...t,include:typeof t.include==`string`?[t.include]:t.include,tracingOptions:n.tracingOptions})))}async findBlobsByTagsSegment(e,t,n={}){return l.tracingClient.withSpan(`BlobServiceClient-findBlobsByTagsSegment`,n,async r=>{let i=(0,c.assertResponse)(await this.serviceContext.filterBlobs({abortSignal:n.abortSignal,where:e,marker:t,maxPageSize:n.maxPageSize,tracingOptions:r.tracingOptions}));return{...i,_response:i._response,blobs:i.blobs.map(e=>{let t=``;return e.tags?.blobTagSet.length===1&&(t=e.tags.blobTagSet[0].value),{...e,tags:(0,o.toTags)(e.tags),tagValue:t}})}})}async*findBlobsByTagsSegments(e,t,n={}){let r;if(t||t===void 0)do r=await this.findBlobsByTagsSegment(e,t,n),r.blobs=r.blobs||[],t=r.continuationToken,yield r;while(t)}async*findBlobsByTagsItems(e,t={}){for await(let n of this.findBlobsByTagsSegments(e,void 0,t))yield*n.blobs}findBlobsByTags(e,t={}){let n={...t},r=this.findBlobsByTagsItems(e,n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(t={})=>this.findBlobsByTagsSegments(e,t.continuationToken,{maxPageSize:t.maxPageSize,...n})}}async*listSegments(e,t={}){let n;if(e||e===void 0)do n=await this.listContainersSegment(e,t),n.containerItems=n.containerItems||[],e=n.continuationToken,yield await n;while(e)}async*listItems(e={}){for await(let t of this.listSegments(void 0,e))yield*t.containerItems}listContainers(e={}){e.prefix===``&&(e.prefix=void 0);let t=[];e.includeDeleted&&t.push(`deleted`),e.includeMetadata&&t.push(`metadata`),e.includeSystem&&t.push(`system`);let n={...e,...t.length>0?{include:t}:{}},r=this.listItems(n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(e={})=>this.listSegments(e.continuationToken,{maxPageSize:e.maxPageSize,...n})}}async getUserDelegationKey(e,t,n={}){return l.tracingClient.withSpan(`BlobServiceClient-getUserDelegationKey`,n,async r=>{let i=(0,c.assertResponse)(await this.serviceContext.getUserDelegationKey({startsOn:(0,c.truncatedISO8061Date)(e,!1),expiresOn:(0,c.truncatedISO8061Date)(t,!1)},{abortSignal:n.abortSignal,tracingOptions:r.tracingOptions})),a={signedObjectId:i.signedObjectId,signedTenantId:i.signedTenantId,signedStartsOn:new Date(i.signedStartsOn),signedExpiresOn:new Date(i.signedExpiresOn),signedService:i.signedService,signedVersion:i.signedVersion,value:i.value};return{_response:i._response,requestId:i.requestId,clientRequestId:i.clientRequestId,version:i.version,date:i.date,errorCode:i.errorCode,...a}})}getBlobBatchClient(){return new u.BlobBatchClient(this.url,this.pipeline)}generateAccountSasUrl(e,t=f.AccountSASPermissions.parse(`r`),n=`sco`,r={}){if(!(this.credential instanceof s.StorageSharedKeyCredential))throw RangeError(`Can only generate the account SAS when the client is initialized with a shared key credential`);if(e===void 0){let t=new Date;e=new Date(t.getTime()+3600*1e3)}let i=(0,p.generateAccountSASQueryParameters)({permissions:t,expiresOn:e,resourceTypes:n,services:m.AccountSASServices.parse(`b`).toString(),...r},this.credential).toString();return(0,o.appendToURLQuery)(this.url,i)}generateSasStringToSign(e,t=f.AccountSASPermissions.parse(`r`),n=`sco`,r={}){if(!(this.credential instanceof s.StorageSharedKeyCredential))throw RangeError(`Can only generate the account SAS when the client is initialized with a shared key credential`);if(e===void 0){let t=new Date;e=new Date(t.getTime()+3600*1e3)}return(0,p.generateAccountSASQueryParametersInternal)({permissions:t,expiresOn:e,resourceTypes:n,services:m.AccountSASServices.parse(`b`).toString(),...r},this.credential).stringToSign}}})),Wu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Gu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.KnownEncryptionAlgorithmType=void 0;var t;(function(e){e.AES256=`AES256`})(t||(e.KnownEncryptionAlgorithmType=t={}))})),Ku=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.logger=e.RestError=e.StorageBrowserPolicyFactory=e.StorageBrowserPolicy=e.StorageSharedKeyCredentialPolicy=e.StorageSharedKeyCredential=e.StorageRetryPolicyFactory=e.StorageRetryPolicy=e.StorageRetryPolicyType=e.Credential=e.CredentialPolicy=e.BaseRequestPolicy=e.AnonymousCredentialPolicy=e.AnonymousCredential=e.StorageOAuthScopes=e.newPipeline=e.isPipelineLike=e.Pipeline=e.getBlobServiceAccountAudience=e.StorageBlobAudience=e.PremiumPageBlobTier=e.BlockBlobTier=e.generateBlobSASQueryParameters=e.generateAccountSASQueryParameters=void 0;let t=(ro(),C(ya)),n=gc();Object.defineProperty(e,`RestError`,{enumerable:!0,get:function(){return n.RestError}}),t.__exportStar(Uu(),e),t.__exportStar(Mu(),e),t.__exportStar(Ru(),e),t.__exportStar(nu(),e),t.__exportStar(zu(),e),t.__exportStar(Bu(),e),t.__exportStar(Vu(),e);var r=Hu();Object.defineProperty(e,`generateAccountSASQueryParameters`,{enumerable:!0,get:function(){return r.generateAccountSASQueryParameters}}),t.__exportStar(Iu(),e),t.__exportStar(Lu(),e),t.__exportStar(Wu(),e),t.__exportStar(Zl(),e);var i=tu();Object.defineProperty(e,`generateBlobSASQueryParameters`,{enumerable:!0,get:function(){return i.generateBlobSASQueryParameters}}),t.__exportStar(Ql(),e);var a=mu();Object.defineProperty(e,`BlockBlobTier`,{enumerable:!0,get:function(){return a.BlockBlobTier}}),Object.defineProperty(e,`PremiumPageBlobTier`,{enumerable:!0,get:function(){return a.PremiumPageBlobTier}}),Object.defineProperty(e,`StorageBlobAudience`,{enumerable:!0,get:function(){return a.StorageBlobAudience}}),Object.defineProperty(e,`getBlobServiceAccountAudience`,{enumerable:!0,get:function(){return a.getBlobServiceAccountAudience}});var o=Dl();Object.defineProperty(e,`Pipeline`,{enumerable:!0,get:function(){return o.Pipeline}}),Object.defineProperty(e,`isPipelineLike`,{enumerable:!0,get:function(){return o.isPipelineLike}}),Object.defineProperty(e,`newPipeline`,{enumerable:!0,get:function(){return o.newPipeline}}),Object.defineProperty(e,`StorageOAuthScopes`,{enumerable:!0,get:function(){return o.StorageOAuthScopes}});var s=Tl();Object.defineProperty(e,`AnonymousCredential`,{enumerable:!0,get:function(){return s.AnonymousCredential}}),Object.defineProperty(e,`AnonymousCredentialPolicy`,{enumerable:!0,get:function(){return s.AnonymousCredentialPolicy}}),Object.defineProperty(e,`BaseRequestPolicy`,{enumerable:!0,get:function(){return s.BaseRequestPolicy}}),Object.defineProperty(e,`CredentialPolicy`,{enumerable:!0,get:function(){return s.CredentialPolicy}}),Object.defineProperty(e,`Credential`,{enumerable:!0,get:function(){return s.Credential}}),Object.defineProperty(e,`StorageRetryPolicyType`,{enumerable:!0,get:function(){return s.StorageRetryPolicyType}}),Object.defineProperty(e,`StorageRetryPolicy`,{enumerable:!0,get:function(){return s.StorageRetryPolicy}}),Object.defineProperty(e,`StorageRetryPolicyFactory`,{enumerable:!0,get:function(){return s.StorageRetryPolicyFactory}}),Object.defineProperty(e,`StorageSharedKeyCredential`,{enumerable:!0,get:function(){return s.StorageSharedKeyCredential}}),Object.defineProperty(e,`StorageSharedKeyCredentialPolicy`,{enumerable:!0,get:function(){return s.StorageSharedKeyCredentialPolicy}}),Object.defineProperty(e,`StorageBrowserPolicy`,{enumerable:!0,get:function(){return s.StorageBrowserPolicy}}),Object.defineProperty(e,`StorageBrowserPolicyFactory`,{enumerable:!0,get:function(){return s.StorageBrowserPolicyFactory}}),t.__exportStar(eu(),e),t.__exportStar(Gu(),e);var c=Zc();Object.defineProperty(e,`logger`,{enumerable:!0,get:function(){return c.logger}})})),qu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.UsageError=e.NetworkError=e.GHESNotSupportedError=e.CacheNotFoundError=e.InvalidResponseError=e.FilesNotFoundError=void 0,e.FilesNotFoundError=class extends Error{constructor(e=[]){let t=`No files were found to upload`;e.length>0&&(t+=`: ${e.join(`, `)}`),super(t),this.files=e,this.name=`FilesNotFoundError`}},e.InvalidResponseError=class extends Error{constructor(e){super(e),this.name=`InvalidResponseError`}},e.CacheNotFoundError=class extends Error{constructor(e=`Cache not found`){super(e),this.name=`CacheNotFoundError`}},e.GHESNotSupportedError=class extends Error{constructor(e=`@actions/cache v4.1.4+, actions/cache/save@v4+ and actions/cache/restore@v4+ are not currently supported on GHES.`){super(e),this.name=`GHESNotSupportedError`}};var t=class extends Error{constructor(e){let t=`Unable to make request: ${e}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(t),this.code=e,this.name=`NetworkError`}};e.NetworkError=t,t.isNetworkErrorCode=e=>e?[`ECONNRESET`,`ENOTFOUND`,`ETIMEDOUT`,`ECONNREFUSED`,`EHOSTUNREACH`].includes(e):!1;var n=class extends Error{constructor(){super(`Cache storage quota has been hit. Unable to upload any new cache entries. Usage is recalculated every 6-12 hours. +`);let m=c.computeHMACSHA256(p);return{sasQueryParameters:new a.SASQueryParameters(l,m,u.toString(),d,f,e.protocol,e.startsOn,e.expiresOn,e.ipRange,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,e.encryptionScope),stringToSign:p}}})),Uu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BlobServiceClient=void 0;let t=Sc(),n=gc(),r=zs(),i=Dl(),a=Ru(),o=Jl(),s=Tl(),c=Jl(),l=Xl(),u=Lu(),d=Yl(),f=zu(),p=Hu(),m=Vu();e.BlobServiceClient=class e extends d.StorageClient{serviceContext;static fromConnectionString(t,a){a||={};let c=(0,o.extractConnectionStringParts)(t);if(c.kind===`AccountConnString`)if(r.isNodeLike){let t=new s.StorageSharedKeyCredential(c.accountName,c.accountKey);a.proxyOptions||=(0,n.getDefaultProxySettings)(c.proxyUri);let r=(0,i.newPipeline)(t,a);return new e(c.url,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`){let t=(0,i.newPipeline)(new s.AnonymousCredential,a);return new e(c.url+`?`+c.accountSas,t)}else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}constructor(e,n,a){let o;o=(0,i.isPipelineLike)(n)?n:r.isNodeLike&&n instanceof s.StorageSharedKeyCredential||n instanceof s.AnonymousCredential||(0,t.isTokenCredential)(n)?(0,i.newPipeline)(n,a):(0,i.newPipeline)(new s.AnonymousCredential,a),super(e,o),this.serviceContext=this.storageClientContext.service}getContainerClient(e){return new a.ContainerClient((0,o.appendToURLPath)(this.url,encodeURIComponent(e)),this.pipeline)}async createContainer(e,t={}){return l.tracingClient.withSpan(`BlobServiceClient-createContainer`,t,async t=>{let n=this.getContainerClient(e);return{containerClient:n,containerCreateResponse:await n.create(t)}})}async deleteContainer(e,t={}){return l.tracingClient.withSpan(`BlobServiceClient-deleteContainer`,t,async t=>this.getContainerClient(e).delete(t))}async undeleteContainer(e,t,n={}){return l.tracingClient.withSpan(`BlobServiceClient-undeleteContainer`,n,async r=>{let i=this.getContainerClient(n.destinationContainerName||e),a=i.storageClientContext.container;return{containerClient:i,containerUndeleteResponse:(0,c.assertResponse)(await a.restore({deletedContainerName:e,deletedContainerVersion:t,tracingOptions:r.tracingOptions}))}})}async getProperties(e={}){return l.tracingClient.withSpan(`BlobServiceClient-getProperties`,e,async t=>(0,c.assertResponse)(await this.serviceContext.getProperties({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async setProperties(e,t={}){return l.tracingClient.withSpan(`BlobServiceClient-setProperties`,t,async n=>(0,c.assertResponse)(await this.serviceContext.setProperties(e,{abortSignal:t.abortSignal,tracingOptions:n.tracingOptions})))}async getStatistics(e={}){return l.tracingClient.withSpan(`BlobServiceClient-getStatistics`,e,async t=>(0,c.assertResponse)(await this.serviceContext.getStatistics({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async getAccountInfo(e={}){return l.tracingClient.withSpan(`BlobServiceClient-getAccountInfo`,e,async t=>(0,c.assertResponse)(await this.serviceContext.getAccountInfo({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async listContainersSegment(e,t={}){return l.tracingClient.withSpan(`BlobServiceClient-listContainersSegment`,t,async n=>(0,c.assertResponse)(await this.serviceContext.listContainersSegment({abortSignal:t.abortSignal,marker:e,...t,include:typeof t.include==`string`?[t.include]:t.include,tracingOptions:n.tracingOptions})))}async findBlobsByTagsSegment(e,t,n={}){return l.tracingClient.withSpan(`BlobServiceClient-findBlobsByTagsSegment`,n,async r=>{let i=(0,c.assertResponse)(await this.serviceContext.filterBlobs({abortSignal:n.abortSignal,where:e,marker:t,maxPageSize:n.maxPageSize,tracingOptions:r.tracingOptions}));return{...i,_response:i._response,blobs:i.blobs.map(e=>{let t=``;return e.tags?.blobTagSet.length===1&&(t=e.tags.blobTagSet[0].value),{...e,tags:(0,o.toTags)(e.tags),tagValue:t}})}})}async*findBlobsByTagsSegments(e,t,n={}){let r;if(t||t===void 0)do r=await this.findBlobsByTagsSegment(e,t,n),r.blobs=r.blobs||[],t=r.continuationToken,yield r;while(t)}async*findBlobsByTagsItems(e,t={}){for await(let n of this.findBlobsByTagsSegments(e,void 0,t))yield*n.blobs}findBlobsByTags(e,t={}){let n={...t},r=this.findBlobsByTagsItems(e,n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(t={})=>this.findBlobsByTagsSegments(e,t.continuationToken,{maxPageSize:t.maxPageSize,...n})}}async*listSegments(e,t={}){let n;if(e||e===void 0)do n=await this.listContainersSegment(e,t),n.containerItems=n.containerItems||[],e=n.continuationToken,yield await n;while(e)}async*listItems(e={}){for await(let t of this.listSegments(void 0,e))yield*t.containerItems}listContainers(e={}){e.prefix===``&&(e.prefix=void 0);let t=[];e.includeDeleted&&t.push(`deleted`),e.includeMetadata&&t.push(`metadata`),e.includeSystem&&t.push(`system`);let n={...e,...t.length>0?{include:t}:{}},r=this.listItems(n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(e={})=>this.listSegments(e.continuationToken,{maxPageSize:e.maxPageSize,...n})}}async getUserDelegationKey(e,t,n={}){return l.tracingClient.withSpan(`BlobServiceClient-getUserDelegationKey`,n,async r=>{let i=(0,c.assertResponse)(await this.serviceContext.getUserDelegationKey({startsOn:(0,c.truncatedISO8061Date)(e,!1),expiresOn:(0,c.truncatedISO8061Date)(t,!1)},{abortSignal:n.abortSignal,tracingOptions:r.tracingOptions})),a={signedObjectId:i.signedObjectId,signedTenantId:i.signedTenantId,signedStartsOn:new Date(i.signedStartsOn),signedExpiresOn:new Date(i.signedExpiresOn),signedService:i.signedService,signedVersion:i.signedVersion,value:i.value};return{_response:i._response,requestId:i.requestId,clientRequestId:i.clientRequestId,version:i.version,date:i.date,errorCode:i.errorCode,...a}})}getBlobBatchClient(){return new u.BlobBatchClient(this.url,this.pipeline)}generateAccountSasUrl(e,t=f.AccountSASPermissions.parse(`r`),n=`sco`,r={}){if(!(this.credential instanceof s.StorageSharedKeyCredential))throw RangeError(`Can only generate the account SAS when the client is initialized with a shared key credential`);e===void 0&&(e=new Date(new Date().getTime()+3600*1e3));let i=(0,p.generateAccountSASQueryParameters)({permissions:t,expiresOn:e,resourceTypes:n,services:m.AccountSASServices.parse(`b`).toString(),...r},this.credential).toString();return(0,o.appendToURLQuery)(this.url,i)}generateSasStringToSign(e,t=f.AccountSASPermissions.parse(`r`),n=`sco`,r={}){if(!(this.credential instanceof s.StorageSharedKeyCredential))throw RangeError(`Can only generate the account SAS when the client is initialized with a shared key credential`);return e===void 0&&(e=new Date(new Date().getTime()+3600*1e3)),(0,p.generateAccountSASQueryParametersInternal)({permissions:t,expiresOn:e,resourceTypes:n,services:m.AccountSASServices.parse(`b`).toString(),...r},this.credential).stringToSign}}})),Wu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Gu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.KnownEncryptionAlgorithmType=void 0;var t;(function(e){e.AES256=`AES256`})(t||(e.KnownEncryptionAlgorithmType=t={}))})),Ku=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.logger=e.RestError=e.StorageBrowserPolicyFactory=e.StorageBrowserPolicy=e.StorageSharedKeyCredentialPolicy=e.StorageSharedKeyCredential=e.StorageRetryPolicyFactory=e.StorageRetryPolicy=e.StorageRetryPolicyType=e.Credential=e.CredentialPolicy=e.BaseRequestPolicy=e.AnonymousCredentialPolicy=e.AnonymousCredential=e.StorageOAuthScopes=e.newPipeline=e.isPipelineLike=e.Pipeline=e.getBlobServiceAccountAudience=e.StorageBlobAudience=e.PremiumPageBlobTier=e.BlockBlobTier=e.generateBlobSASQueryParameters=e.generateAccountSASQueryParameters=void 0;let t=(ro(),C(ya)),n=gc();Object.defineProperty(e,`RestError`,{enumerable:!0,get:function(){return n.RestError}}),t.__exportStar(Uu(),e),t.__exportStar(Mu(),e),t.__exportStar(Ru(),e),t.__exportStar(nu(),e),t.__exportStar(zu(),e),t.__exportStar(Bu(),e),t.__exportStar(Vu(),e);var r=Hu();Object.defineProperty(e,`generateAccountSASQueryParameters`,{enumerable:!0,get:function(){return r.generateAccountSASQueryParameters}}),t.__exportStar(Iu(),e),t.__exportStar(Lu(),e),t.__exportStar(Wu(),e),t.__exportStar(Zl(),e);var i=tu();Object.defineProperty(e,`generateBlobSASQueryParameters`,{enumerable:!0,get:function(){return i.generateBlobSASQueryParameters}}),t.__exportStar(Ql(),e);var a=mu();Object.defineProperty(e,`BlockBlobTier`,{enumerable:!0,get:function(){return a.BlockBlobTier}}),Object.defineProperty(e,`PremiumPageBlobTier`,{enumerable:!0,get:function(){return a.PremiumPageBlobTier}}),Object.defineProperty(e,`StorageBlobAudience`,{enumerable:!0,get:function(){return a.StorageBlobAudience}}),Object.defineProperty(e,`getBlobServiceAccountAudience`,{enumerable:!0,get:function(){return a.getBlobServiceAccountAudience}});var o=Dl();Object.defineProperty(e,`Pipeline`,{enumerable:!0,get:function(){return o.Pipeline}}),Object.defineProperty(e,`isPipelineLike`,{enumerable:!0,get:function(){return o.isPipelineLike}}),Object.defineProperty(e,`newPipeline`,{enumerable:!0,get:function(){return o.newPipeline}}),Object.defineProperty(e,`StorageOAuthScopes`,{enumerable:!0,get:function(){return o.StorageOAuthScopes}});var s=Tl();Object.defineProperty(e,`AnonymousCredential`,{enumerable:!0,get:function(){return s.AnonymousCredential}}),Object.defineProperty(e,`AnonymousCredentialPolicy`,{enumerable:!0,get:function(){return s.AnonymousCredentialPolicy}}),Object.defineProperty(e,`BaseRequestPolicy`,{enumerable:!0,get:function(){return s.BaseRequestPolicy}}),Object.defineProperty(e,`CredentialPolicy`,{enumerable:!0,get:function(){return s.CredentialPolicy}}),Object.defineProperty(e,`Credential`,{enumerable:!0,get:function(){return s.Credential}}),Object.defineProperty(e,`StorageRetryPolicyType`,{enumerable:!0,get:function(){return s.StorageRetryPolicyType}}),Object.defineProperty(e,`StorageRetryPolicy`,{enumerable:!0,get:function(){return s.StorageRetryPolicy}}),Object.defineProperty(e,`StorageRetryPolicyFactory`,{enumerable:!0,get:function(){return s.StorageRetryPolicyFactory}}),Object.defineProperty(e,`StorageSharedKeyCredential`,{enumerable:!0,get:function(){return s.StorageSharedKeyCredential}}),Object.defineProperty(e,`StorageSharedKeyCredentialPolicy`,{enumerable:!0,get:function(){return s.StorageSharedKeyCredentialPolicy}}),Object.defineProperty(e,`StorageBrowserPolicy`,{enumerable:!0,get:function(){return s.StorageBrowserPolicy}}),Object.defineProperty(e,`StorageBrowserPolicyFactory`,{enumerable:!0,get:function(){return s.StorageBrowserPolicyFactory}}),t.__exportStar(eu(),e),t.__exportStar(Gu(),e);var c=Zc();Object.defineProperty(e,`logger`,{enumerable:!0,get:function(){return c.logger}})})),qu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.UsageError=e.NetworkError=e.GHESNotSupportedError=e.CacheNotFoundError=e.InvalidResponseError=e.FilesNotFoundError=void 0,e.FilesNotFoundError=class extends Error{constructor(e=[]){let t=`No files were found to upload`;e.length>0&&(t+=`: ${e.join(`, `)}`),super(t),this.files=e,this.name=`FilesNotFoundError`}},e.InvalidResponseError=class extends Error{constructor(e){super(e),this.name=`InvalidResponseError`}},e.CacheNotFoundError=class extends Error{constructor(e=`Cache not found`){super(e),this.name=`CacheNotFoundError`}},e.GHESNotSupportedError=class extends Error{constructor(e=`@actions/cache v4.1.4+, actions/cache/save@v4+ and actions/cache/restore@v4+ are not currently supported on GHES.`){super(e),this.name=`GHESNotSupportedError`}};var t=class extends Error{constructor(e){let t=`Unable to make request: ${e}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(t),this.code=e,this.name=`NetworkError`}};e.NetworkError=t,t.isNetworkErrorCode=e=>e?[`ECONNRESET`,`ENOTFOUND`,`ETIMEDOUT`,`ECONNREFUSED`,`EHOSTUNREACH`].includes(e):!1;var n=class extends Error{constructor(){super(`Cache storage quota has been hit. Unable to upload any new cache entries. Usage is recalculated every 6-12 hours. More info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`),this.name=`UsageError`}};e.UsageError=n,n.isUsageErrorMessage=e=>e?e.includes(`insufficient usage`):!1})),Ju=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.uploadCacheArchiveSDK=e.UploadProgress=void 0;let a=r(At()),o=Ku(),s=qu();var c=class{constructor(e){this.contentLength=e,this.sentBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}setSentBytes(e){this.sentBytes=e}getTransferredBytes(){return this.sentBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.sentBytes,t=(100*(e/this.contentLength)).toFixed(1),n=Date.now()-this.startTime,r=(e/(1024*1024)/(n/1e3)).toFixed(1);a.info(`Sent ${e} of ${this.contentLength} (${t}%), ${r} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setSentBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let t=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(t,e))};this.timeoutHandle=setTimeout(t,e)}stopDisplayTimer(){this.timeoutHandle&&=(clearTimeout(this.timeoutHandle),void 0),this.display()}};e.UploadProgress=c;function l(e,t,n){return i(this,void 0,void 0,function*(){let r=new o.BlobClient(e),i=r.getBlockBlobClient(),l=new c(n?.archiveSizeBytes??0),u={blockSize:n?.uploadChunkSize,concurrency:n?.uploadConcurrency,maxSingleShotSize:128*1024*1024,onProgress:l.onProgress()};try{l.startDisplayTimer(),a.debug(`BlobClient: ${r.name}:${r.accountName}:${r.containerName}`);let e=yield i.uploadFile(t,u);if(e._response.status>=400)throw new s.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${e._response.status}`);return e}catch(e){throw a.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${e.message}`),e}finally{l.stopDisplayTimer()}})}e.uploadCacheArchiveSDK=l})),Yu=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.retryHttpClientResponse=e.retryTypedResponse=e.retry=e.isRetryableStatusCode=e.isServerErrorStatusCode=e.isSuccessStatusCode=void 0;let a=r(At()),o=bt(),s=_a();function c(e){return e?e>=200&&e<300:!1}e.isSuccessStatusCode=c;function l(e){return e?e>=500:!0}e.isServerErrorStatusCode=l;function u(e){return e?[o.HttpCodes.BadGateway,o.HttpCodes.ServiceUnavailable,o.HttpCodes.GatewayTimeout].includes(e):!1}e.isRetryableStatusCode=u;function d(e){return i(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}function f(e,t,n,r=s.DefaultRetryAttempts,o=s.DefaultRetryDelay,c=void 0){return i(this,void 0,void 0,function*(){let i=``,s=1;for(;s<=r;){let f,p,m=!1;try{f=yield t()}catch(e){c&&(f=c(e)),m=!0,i=e.message}if(f&&(p=n(f),!l(p)))return f;if(p&&(m=u(p),i=`Cache service responded with ${p}`),a.debug(`${e} - Attempt ${s} of ${r} failed with error: ${i}`),!m){a.debug(`${e} - Error is not retryable`);break}yield d(o),s++}throw Error(`${e} failed: ${i}`)})}e.retry=f;function p(e,t,n=s.DefaultRetryAttempts,r=s.DefaultRetryDelay){return i(this,void 0,void 0,function*(){return yield f(e,t,e=>e.statusCode,n,r,e=>{if(e instanceof o.HttpClientError)return{statusCode:e.statusCode,result:null,headers:{},error:e}})})}e.retryTypedResponse=p;function m(e,t,n=s.DefaultRetryAttempts,r=s.DefaultRetryDelay){return i(this,void 0,void 0,function*(){return yield f(e,t,e=>e.message.statusCode,n,r)})}e.retryHttpClientResponse=m})),Xu=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=new WeakMap,n=new WeakMap;var r=class e{constructor(){this.onabort=null,t.set(this,[]),n.set(this,!1)}get aborted(){if(!n.has(this))throw TypeError("Expected `this` to be an instance of AbortSignal.");return n.get(this)}static get none(){return new e}addEventListener(e,n){if(!t.has(this))throw TypeError("Expected `this` to be an instance of AbortSignal.");t.get(this).push(n)}removeEventListener(e,n){if(!t.has(this))throw TypeError("Expected `this` to be an instance of AbortSignal.");let r=t.get(this),i=r.indexOf(n);i>-1&&r.splice(i,1)}dispatchEvent(e){throw Error(`This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes.`)}};function i(e){if(e.aborted)return;e.onabort&&e.onabort.call(e);let r=t.get(e);r&&r.slice().forEach(t=>{t.call(e,{type:`abort`})}),n.set(e,!0)}var a=class extends Error{constructor(e){super(e),this.name=`AbortError`}};e.AbortController=class{constructor(e){if(this._signal=new r,e){Array.isArray(e)||(e=arguments);for(let t of e)t.aborted?this.abort():t.addEventListener(`abort`,()=>{this.abort()})}}get signal(){return this._signal}abort(){i(this._signal)}static timeout(e){let t=new r,n=setTimeout(i,e,t);return typeof n.unref==`function`&&n.unref(),t}},e.AbortError=a,e.AbortSignal=r})),Zu=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.downloadCacheStorageSDK=e.downloadCacheHttpClientConcurrent=e.downloadCacheHttpClient=e.DownloadProgress=void 0;let a=r(At()),o=bt(),s=Ku(),c=r(w(`buffer`)),l=r(w(`fs`)),u=r(w(`stream`)),d=r(w(`util`)),f=r(va()),p=_a(),m=Yu(),h=Xu();function g(e,t){return i(this,void 0,void 0,function*(){yield d.promisify(u.pipeline)(e.message,t)})}var _=class{constructor(e){this.contentLength=e,this.segmentIndex=0,this.segmentSize=0,this.segmentOffset=0,this.receivedBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}nextSegment(e){this.segmentOffset+=this.segmentSize,this.segmentIndex+=1,this.segmentSize=e,this.receivedBytes=0,a.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`)}setReceivedBytes(e){this.receivedBytes=e}getTransferredBytes(){return this.segmentOffset+this.receivedBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.segmentOffset+this.receivedBytes,t=(100*(e/this.contentLength)).toFixed(1),n=Date.now()-this.startTime,r=(e/(1024*1024)/(n/1e3)).toFixed(1);a.info(`Received ${e} of ${this.contentLength} (${t}%), ${r} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setReceivedBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let t=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(t,e))};this.timeoutHandle=setTimeout(t,e)}stopDisplayTimer(){this.timeoutHandle&&=(clearTimeout(this.timeoutHandle),void 0),this.display()}};e.DownloadProgress=_;function v(e,t){return i(this,void 0,void 0,function*(){let n=l.createWriteStream(t),r=new o.HttpClient(`actions/cache`),s=yield(0,m.retryHttpClientResponse)(`downloadCache`,()=>i(this,void 0,void 0,function*(){return r.get(e)}));s.message.socket.setTimeout(p.SocketTimeout,()=>{s.message.destroy(),a.debug(`Aborting download, socket timed out after ${p.SocketTimeout} ms`)}),yield g(s,n);let c=s.message.headers[`content-length`];if(c){let e=parseInt(c),n=f.getArchiveFileSizeInBytes(t);if(n!==e)throw Error(`Incomplete download. Expected file size: ${e}, actual file size: ${n}`)}else a.debug(`Unable to validate download, no Content-Length header`)})}e.downloadCacheHttpClient=v;function y(e,t,n){return i(this,void 0,void 0,function*(){let r=yield l.promises.open(t,`w`),a=new o.HttpClient(`actions/cache`,void 0,{socketTimeout:n.timeoutInMs,keepAlive:!0});try{let t=(yield(0,m.retryHttpClientResponse)(`downloadCacheMetadata`,()=>i(this,void 0,void 0,function*(){return yield a.request(`HEAD`,e,null,{})}))).message.headers[`content-length`];if(t==null)throw Error(`Content-Length not found on blob response`);let o=parseInt(t);if(Number.isNaN(o))throw Error(`Could not interpret Content-Length: ${o}`);let s=[],c=4*1024*1024;for(let t=0;ti(this,void 0,void 0,function*(){return yield b(a,e,t,n)})})}s.reverse();let l=0,u=0,d=new _(o);d.startDisplayTimer();let f=d.onProgress(),p=[],h,g=()=>i(this,void 0,void 0,function*(){let e=yield Promise.race(Object.values(p));yield r.write(e.buffer,0,e.count,e.offset),l--,delete p[e.offset],u+=e.count,f({loadedBytes:u})});for(;h=s.pop();)p[h.offset]=h.promiseGetter(),l++,l>=(n.downloadConcurrency??10)&&(yield g());for(;l>0;)yield g()}finally{a.dispose(),yield r.close()}})}e.downloadCacheHttpClientConcurrent=y;function b(e,t,n,r){return i(this,void 0,void 0,function*(){let i=0;for(;;)try{let i=yield C(3e4,x(e,t,n,r));if(typeof i==`string`)throw Error(`downloadSegmentRetry failed due to timeout`);return i}catch(e){if(i>=5)throw e;i++}})}function x(e,t,n,r){return i(this,void 0,void 0,function*(){let a=yield(0,m.retryHttpClientResponse)(`downloadCachePart`,()=>i(this,void 0,void 0,function*(){return yield e.get(t,{Range:`bytes=${n}-${n+r-1}`})}));if(!a.readBodyBuffer)throw Error(`Expected HttpClientResponse to implement readBodyBuffer`);return{offset:n,count:r,buffer:yield a.readBodyBuffer()}})}function S(e,t,n){return i(this,void 0,void 0,function*(){let r=new s.BlockBlobClient(e,void 0,{retryOptions:{tryTimeoutInMs:n.timeoutInMs}}),i=(yield r.getProperties()).contentLength??-1;if(i<0)a.debug(`Unable to determine content length, downloading file with http-client...`),yield v(e,t);else{let e=Math.min(134217728,c.constants.MAX_LENGTH),a=new _(i),o=l.openSync(t,`w`);try{a.startDisplayTimer();let t=new h.AbortController,s=t.signal;for(;!a.isDone();){let c=a.segmentOffset+a.segmentSize,u=Math.min(e,i-c);a.nextSegment(u);let d=yield C(n.segmentTimeoutInMs||36e5,r.downloadToBuffer(c,u,{abortSignal:s,concurrency:n.downloadConcurrency,onProgress:a.onProgress()}));if(d===`timeout`)throw t.abort(),Error(`Aborting cache download as the download time exceeded the timeout.`);Buffer.isBuffer(d)&&l.writeFileSync(o,d)}}finally{a.stopDisplayTimer(),l.closeSync(o)}}})}e.downloadCacheStorageSDK=S;let C=(e,t)=>i(void 0,void 0,void 0,function*(){let n,r=new Promise(t=>{n=setTimeout(()=>t(`timeout`),e)});return Promise.race([t,r]).then(e=>(clearTimeout(n),e))})})),Qu=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.getDownloadOptions=e.getUploadOptions=void 0;let i=r(At());function a(e){let t={useAzureSdk:!1,uploadConcurrency:4,uploadChunkSize:32*1024*1024};return e&&(typeof e.useAzureSdk==`boolean`&&(t.useAzureSdk=e.useAzureSdk),typeof e.uploadConcurrency==`number`&&(t.uploadConcurrency=e.uploadConcurrency),typeof e.uploadChunkSize==`number`&&(t.uploadChunkSize=e.uploadChunkSize)),t.uploadConcurrency=isNaN(Number(process.env.CACHE_UPLOAD_CONCURRENCY))?t.uploadConcurrency:Math.min(32,Number(process.env.CACHE_UPLOAD_CONCURRENCY)),t.uploadChunkSize=isNaN(Number(process.env.CACHE_UPLOAD_CHUNK_SIZE))?t.uploadChunkSize:Math.min(128*1024*1024,Number(process.env.CACHE_UPLOAD_CHUNK_SIZE)*1024*1024),i.debug(`Use Azure SDK: ${t.useAzureSdk}`),i.debug(`Upload concurrency: ${t.uploadConcurrency}`),i.debug(`Upload chunk size: ${t.uploadChunkSize}`),t}e.getUploadOptions=a;function o(e){let t={useAzureSdk:!1,concurrentBlobDownloads:!0,downloadConcurrency:8,timeoutInMs:3e4,segmentTimeoutInMs:6e5,lookupOnly:!1};e&&(typeof e.useAzureSdk==`boolean`&&(t.useAzureSdk=e.useAzureSdk),typeof e.concurrentBlobDownloads==`boolean`&&(t.concurrentBlobDownloads=e.concurrentBlobDownloads),typeof e.downloadConcurrency==`number`&&(t.downloadConcurrency=e.downloadConcurrency),typeof e.timeoutInMs==`number`&&(t.timeoutInMs=e.timeoutInMs),typeof e.segmentTimeoutInMs==`number`&&(t.segmentTimeoutInMs=e.segmentTimeoutInMs),typeof e.lookupOnly==`boolean`&&(t.lookupOnly=e.lookupOnly));let n=process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS;return n&&!isNaN(Number(n))&&isFinite(Number(n))&&(t.segmentTimeoutInMs=Number(n)*60*1e3),i.debug(`Use Azure SDK: ${t.useAzureSdk}`),i.debug(`Download concurrency: ${t.downloadConcurrency}`),i.debug(`Request timeout (ms): ${t.timeoutInMs}`),i.debug(`Cache segment download timeout mins env var: ${process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS}`),i.debug(`Segment download timeout (ms): ${t.segmentTimeoutInMs}`),i.debug(`Lookup only: ${t.lookupOnly}`),t}e.getDownloadOptions=o})),$u=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getCacheServiceURL=e.getCacheServiceVersion=e.isGhes=void 0;function t(){let e=new URL(process.env.GITHUB_SERVER_URL||`https://github.com`).hostname.trimEnd().toUpperCase(),t=e===`GITHUB.COM`,n=e.endsWith(`.GHE.COM`),r=e.endsWith(`.LOCALHOST`);return!t&&!n&&!r}e.isGhes=t;function n(){return t()?`v1`:process.env.ACTIONS_CACHE_SERVICE_V2?`v2`:`v1`}e.getCacheServiceVersion=n;function r(){let e=n();switch(e){case`v1`:return process.env.ACTIONS_CACHE_URL||process.env.ACTIONS_RESULTS_URL||``;case`v2`:return process.env.ACTIONS_RESULTS_URL||``;default:throw Error(`Unsupported cache service version: ${e}`)}}e.getCacheServiceURL=r})),ed=b(((e,t)=>{t.exports={name:`@actions/cache`,version:`4.1.0`,preview:!0,description:`Actions cache lib`,keywords:[`github`,`actions`,`cache`],homepage:`https://github.com/actions/toolkit/tree/main/packages/cache`,license:`MIT`,main:`lib/cache.js`,types:`lib/cache.d.ts`,directories:{lib:`lib`,test:`__tests__`},files:[`lib`,`!.DS_Store`],publishConfig:{access:`public`},repository:{type:`git`,url:`git+https://github.com/actions/toolkit.git`,directory:`packages/cache`},scripts:{"audit-moderate":`npm install && npm audit --json --audit-level=moderate > audit.json`,test:`echo "Error: run tests from root" && exit 1`,tsc:`tsc`},bugs:{url:`https://github.com/actions/toolkit/issues`},dependencies:{"@actions/core":`^1.11.1`,"@actions/exec":`^1.0.1`,"@actions/glob":`^0.1.0`,"@protobuf-ts/runtime-rpc":`^2.11.1`,"@actions/http-client":`^2.1.1`,"@actions/io":`^1.0.1`,"@azure/abort-controller":`^1.1.0`,"@azure/ms-rest-js":`^2.6.0`,"@azure/storage-blob":`^12.13.0`,semver:`^6.3.1`},devDependencies:{"@types/node":`^22.13.9`,"@types/semver":`^6.0.0`,"@protobuf-ts/plugin":`^2.9.4`,typescript:`^5.2.2`}}})),td=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getUserAgentString=void 0;let t=ed();function n(){return`@actions/cache-${t.version}`}e.getUserAgentString=n})),nd=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.saveCache=e.reserveCache=e.downloadCache=e.getCacheEntry=void 0;let a=r(At()),o=bt(),s=xt(),c=r(w(`fs`)),l=w(`url`),u=r(va()),d=Ju(),f=Zu(),p=Qu(),m=Yu(),h=$u(),g=td();function _(e){let t=(0,h.getCacheServiceURL)();if(!t)throw Error(`Cache Service Url not found, unable to restore cache.`);let n=`${t}_apis/artifactcache/${e}`;return a.debug(`Resource Url: ${n}`),n}function v(e,t){return`${e};api-version=${t}`}function y(){return{headers:{Accept:v(`application/json`,`6.0-preview.1`)}}}function b(){let e=process.env.ACTIONS_RUNTIME_TOKEN||``,t=new s.BearerCredentialHandler(e);return new o.HttpClient((0,g.getUserAgentString)(),[t],y())}function x(e,t,n){return i(this,void 0,void 0,function*(){let r=b(),o=u.getCacheVersion(t,n?.compressionMethod,n?.enableCrossOsArchive),s=`cache?keys=${encodeURIComponent(e.join(`,`))}&version=${o}`,c=yield(0,m.retryTypedResponse)(`getCacheEntry`,()=>i(this,void 0,void 0,function*(){return r.getJson(_(s))}));if(c.statusCode===204)return a.isDebug()&&(yield S(e[0],r,o)),null;if(!(0,m.isSuccessStatusCode)(c.statusCode))throw Error(`Cache service responded with ${c.statusCode}`);let l=c.result,d=l?.archiveLocation;if(!d)throw Error(`Cache not found.`);return a.setSecret(d),a.debug(`Cache Result:`),a.debug(JSON.stringify(l)),l})}e.getCacheEntry=x;function S(e,t,n){return i(this,void 0,void 0,function*(){let r=`caches?key=${encodeURIComponent(e)}`,o=yield(0,m.retryTypedResponse)(`listCache`,()=>i(this,void 0,void 0,function*(){return t.getJson(_(r))}));if(o.statusCode===200){let t=o.result,r=t?.totalCount;if(r&&r>0){a.debug(`No matching cache found for cache key '${e}', version '${n} and scope ${process.env.GITHUB_REF}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key \nOther caches with similar key:`);for(let e of t?.artifactCaches||[])a.debug(`Cache Key: ${e?.cacheKey}, Cache Version: ${e?.cacheVersion}, Cache Scope: ${e?.scope}, Cache Created: ${e?.creationTime}`)}}})}function C(e,t,n){return i(this,void 0,void 0,function*(){let r=new l.URL(e),i=(0,p.getDownloadOptions)(n);r.hostname.endsWith(`.blob.core.windows.net`)?i.useAzureSdk?yield(0,f.downloadCacheStorageSDK)(e,t,i):i.concurrentBlobDownloads?yield(0,f.downloadCacheHttpClientConcurrent)(e,t,i):yield(0,f.downloadCacheHttpClient)(e,t):yield(0,f.downloadCacheHttpClient)(e,t)})}e.downloadCache=C;function T(e,t,n){return i(this,void 0,void 0,function*(){let r=b(),a={key:e,version:u.getCacheVersion(t,n?.compressionMethod,n?.enableCrossOsArchive),cacheSize:n?.cacheSize};return yield(0,m.retryTypedResponse)(`reserveCache`,()=>i(this,void 0,void 0,function*(){return r.postJson(_(`caches`),a)}))})}e.reserveCache=T;function E(e,t){return`bytes ${e}-${t}/*`}function D(e,t,n,r,o){return i(this,void 0,void 0,function*(){a.debug(`Uploading chunk of size ${o-r+1} bytes at offset ${r} with content range: ${E(r,o)}`);let s={"Content-Type":`application/octet-stream`,"Content-Range":E(r,o)},c=yield(0,m.retryHttpClientResponse)(`uploadChunk (start: ${r}, end: ${o})`,()=>i(this,void 0,void 0,function*(){return e.sendStream(`PATCH`,t,n(),s)}));if(!(0,m.isSuccessStatusCode)(c.message.statusCode))throw Error(`Cache service responded with ${c.message.statusCode} during upload chunk.`)})}function O(e,t,n,r){return i(this,void 0,void 0,function*(){let o=u.getArchiveFileSizeInBytes(n),s=_(`caches/${t.toString()}`),l=c.openSync(n,`r`),d=(0,p.getUploadOptions)(r),f=u.assertDefined(`uploadConcurrency`,d.uploadConcurrency),m=u.assertDefined(`uploadChunkSize`,d.uploadChunkSize),h=[...Array(f).keys()];a.debug(`Awaiting all uploads`);let g=0;try{yield Promise.all(h.map(()=>i(this,void 0,void 0,function*(){for(;gc.createReadStream(n,{fd:l,start:r,end:i,autoClose:!1}).on(`error`,e=>{throw Error(`Cache upload failed because file read failed with ${e.message}`)}),r,i)}})))}finally{c.closeSync(l)}})}function k(e,t,n){return i(this,void 0,void 0,function*(){let r={size:n};return yield(0,m.retryTypedResponse)(`commitCache`,()=>i(this,void 0,void 0,function*(){return e.postJson(_(`caches/${t.toString()}`),r)}))})}function A(e,t,n,r){return i(this,void 0,void 0,function*(){if((0,p.getUploadOptions)(r).useAzureSdk){if(!n)throw Error(`Azure Storage SDK can only be used when a signed URL is provided.`);yield(0,d.uploadCacheArchiveSDK)(n,t,r)}else{let n=b();a.debug(`Upload cache`),yield O(n,e,t,r),a.debug(`Commiting cache`);let i=u.getArchiveFileSizeInBytes(t);a.info(`Cache Size: ~${Math.round(i/(1024*1024))} MB (${i} B)`);let o=yield k(n,e,i);if(!(0,m.isSuccessStatusCode)(o.statusCode))throw Error(`Cache service responded with ${o.statusCode} during commit cache.`);a.info(`Cache saved successfully`)}})}e.saveCache=A})),rd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isJsonObject=e.typeofJsonValue=void 0;function t(e){let t=typeof e;if(t==`object`){if(Array.isArray(e))return`array`;if(e===null)return`null`}return t}e.typeofJsonValue=t;function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}e.isJsonObject=n})),id=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.base64encode=e.base64decode=void 0;let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),n=[];for(let e=0;e>4,s=o,a=2;break;case 2:r[i++]=(s&15)<<4|(o&60)>>2,s=o,a=3;break;case 3:r[i++]=(s&3)<<6|o,a=0;break}}if(a==1)throw Error(`invalid base64 string.`);return r.subarray(0,i)}e.base64decode=r;function i(e){let n=``,r=0,i,a=0;for(let o=0;o>2],a=(i&3)<<4,r=1;break;case 1:n+=t[a|i>>4],a=(i&15)<<2,r=2;break;case 2:n+=t[a|i>>6],n+=t[i&63],r=0;break}return r&&(n+=t[a],n+=`=`,r==1&&(n+=`=`)),n}e.base64encode=i})),ad=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.utf8read=void 0;let t=e=>String.fromCharCode.apply(String,e);function n(e){if(e.length<1)return``;let n=0,r=[],i=[],a=0,o,s=e.length;for(;n191&&o<224?i[a++]=(o&31)<<6|e[n++]&63:o>239&&o<365?(o=((o&7)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,i[a++]=55296+(o>>10),i[a++]=56320+(o&1023)):i[a++]=(o&15)<<12|(e[n++]&63)<<6|e[n++]&63,a>8191&&(r.push(t(i)),a=0);return r.length?(a&&r.push(t(i.slice(0,a))),r.join(``)):t(i.slice(0,a))}e.utf8read=n})),od=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WireType=e.mergeBinaryOptions=e.UnknownFieldHandler=void 0,(function(e){e.symbol=Symbol.for(`protobuf-ts/unknown`),e.onRead=(n,r,i,a,o)=>{(t(r)?r[e.symbol]:r[e.symbol]=[]).push({no:i,wireType:a,data:o})},e.onWrite=(t,n,r)=>{for(let{no:t,wireType:i,data:a}of e.list(n))r.tag(t,i).raw(a)},e.list=(n,r)=>{if(t(n)){let t=n[e.symbol];return r?t.filter(e=>e.no==r):t}return[]},e.last=(t,n)=>e.list(t,n).slice(-1)[0];let t=t=>t&&Array.isArray(t[e.symbol])})(e.UnknownFieldHandler||={});function t(e,t){return Object.assign(Object.assign({},e),t)}e.mergeBinaryOptions=t,(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(e.WireType||={})})),sd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.varint32read=e.varint32write=e.int64toString=e.int64fromString=e.varint64write=e.varint64read=void 0;function t(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}e.varint64write=n;let r=65536*65536;function i(e){let t=e[0]==`-`;t&&(e=e.slice(1));let n=1e6,i=0,a=0;function o(t,o){let s=Number(e.slice(t,o));a*=n,i=i*n+s,i>=r&&(a+=i/r|0,i%=r)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[t,i,a]}e.int64fromString=i;function a(e,t){if(t>>>0<=2097151)return``+(r*t+(e>>>0));let n=e&16777215,i=(e>>>24|t<<8)>>>0&16777215,a=t>>16&65535,o=n+i*6777216+a*6710656,s=i+a*8147497,c=a*2,l=1e7;o>=l&&(s+=Math.floor(o/l),o%=l),s>=l&&(c+=Math.floor(s/l),s%=l);function u(e,t){let n=e?String(e):``;return t?`0000000`.slice(n.length)+n:n}return u(c,0)+u(s,c)+u(o,1)}e.int64toString=a;function o(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}e.varint32write=o;function s(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}e.varint32read=s})),cd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PbLong=e.PbULong=e.detectBi=void 0;let t=sd(),n;function r(){let e=new DataView(new ArrayBuffer(8));n=globalThis.BigInt!==void 0&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`?{MIN:BigInt(`-9223372036854775808`),MAX:BigInt(`9223372036854775807`),UMIN:BigInt(`0`),UMAX:BigInt(`18446744073709551615`),C:BigInt,V:e}:void 0}e.detectBi=r,r();function i(e){if(!e)throw Error(`BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support`)}let a=/^-?[0-9]+$/,o=4294967296,s=2147483648;var c=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*o+(this.lo>>>0);if(!Number.isSafeInteger(e))throw Error(`cannot convert to safe number`);return e}},l=class e extends c{static from(r){if(n)switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r==``)throw Error(`string is no integer`);r=n.C(r);case`number`:if(r===0)return this.ZERO;r=n.C(r);case`bigint`:if(!r)return this.ZERO;if(rn.UMAX)throw Error(`ulong too large`);return n.V.setBigUint64(0,r,!0),new e(n.V.getInt32(0,!0),n.V.getInt32(4,!0))}else switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r=r.trim(),!a.test(r))throw Error(`string is no integer`);let[n,i,s]=t.int64fromString(r);if(n)throw Error(`signed value for ulong`);return new e(i,s);case`number`:if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw Error(`number is no integer`);if(r<0)throw Error(`signed value for ulong`);return new e(r,r/o)}throw Error(`unknown value `+typeof r)}toString(){return n?this.toBigInt().toString():t.int64toString(this.lo,this.hi)}toBigInt(){return i(n),n.V.setInt32(0,this.lo,!0),n.V.setInt32(4,this.hi,!0),n.V.getBigUint64(0,!0)}};e.PbULong=l,l.ZERO=new l(0,0);var u=class e extends c{static from(r){if(n)switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r==``)throw Error(`string is no integer`);r=n.C(r);case`number`:if(r===0)return this.ZERO;r=n.C(r);case`bigint`:if(!r)return this.ZERO;if(rn.MAX)throw Error(`signed long too large`);return n.V.setBigInt64(0,r,!0),new e(n.V.getInt32(0,!0),n.V.getInt32(4,!0))}else switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r=r.trim(),!a.test(r))throw Error(`string is no integer`);let[n,i,c]=t.int64fromString(r);if(n){if(c>s||c==s&&i!=0)throw Error(`signed long too small`)}else if(c>=s)throw Error(`signed long too large`);let l=new e(i,c);return n?l.negate():l;case`number`:if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw Error(`number is no integer`);return r>0?new e(r,r/o):new e(-r,-r/o).negate()}throw Error(`unknown value `+typeof r)}isNegative(){return(this.hi&s)!==0}negate(){let t=~this.hi,n=this.lo;return n?n=~n+1:t+=1,new e(n,t)}toString(){if(n)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return`-`+t.int64toString(e.lo,e.hi)}return t.int64toString(this.lo,this.hi)}toBigInt(){return i(n),n.V.setInt32(0,this.lo,!0),n.V.setInt32(4,this.hi,!0),n.V.getBigInt64(0,!0)}};e.PbLong=u,u.ZERO=new u(0,0)})),ld=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BinaryReader=e.binaryReadOptions=void 0;let t=od(),n=cd(),r=sd(),i={readUnknownField:!0,readerFactory:e=>new o(e)};function a(e){return e?Object.assign(Object.assign({},i),e):i}e.binaryReadOptions=a;var o=class{constructor(e,t){this.varint64=r.varint64read,this.uint32=r.varint32read,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n]}skip(e){let n=this.pos;switch(e){case t.WireType.Varint:for(;this.buf[this.pos++]&128;);break;case t.WireType.Bit64:this.pos+=4;case t.WireType.Bit32:this.pos+=4;break;case t.WireType.LengthDelimited:let n=this.uint32();this.pos+=n;break;case t.WireType.StartGroup:let r;for(;(r=this.tag()[1])!==t.WireType.EndGroup;)this.skip(r);break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return new n.PbLong(...this.varint64())}uint64(){return new n.PbULong(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,new n.PbLong(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new n.PbULong(this.sfixed32(),this.sfixed32())}sfixed64(){return new n.PbLong(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}};e.BinaryReader=o})),ud=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assertFloat32=e.assertUInt32=e.assertInt32=e.assertNever=e.assert=void 0;function t(e,t){if(!e)throw Error(t)}e.assert=t;function n(e,t){throw Error(t??`Unexpected object: `+e)}e.assertNever=n;function r(e){if(typeof e!=`number`)throw Error(`invalid int 32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int 32: `+e)}e.assertInt32=r;function i(e){if(typeof e!=`number`)throw Error(`invalid uint 32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint 32: `+e)}e.assertUInt32=i;function a(e){if(typeof e!=`number`)throw Error(`invalid float 32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float 32: `+e)}e.assertFloat32=a})),dd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BinaryWriter=e.binaryWriteOptions=void 0;let t=cd(),n=sd(),r=ud(),i={writeUnknownFields:!0,writerFactory:()=>new o};function a(e){return e?Object.assign(Object.assign({},i),e):i}e.binaryWriteOptions=a;var o=class{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let t=0;t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(r.assertUInt32(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return r.assertInt32(e),n.varint32write(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){r.assertFloat32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){r.assertUInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){r.assertInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return r.assertInt32(e),e=(e<<1^e>>31)>>>0,n.varint32write(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=t.PbLong.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=t.PbULong.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(e){let r=t.PbLong.from(e);return n.varint64write(r.lo,r.hi,this.buf),this}sint64(e){let r=t.PbLong.from(e),i=r.hi>>31,a=r.lo<<1^i,o=(r.hi<<1|r.lo>>>31)^i;return n.varint64write(a,o,this.buf),this}uint64(e){let r=t.PbULong.from(e);return n.varint64write(r.lo,r.hi,this.buf),this}};e.BinaryWriter=o})),fd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeJsonOptions=e.jsonWriteOptions=e.jsonReadOptions=void 0;let t={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},n={ignoreUnknownFields:!1};function r(e){return e?Object.assign(Object.assign({},n),e):n}e.jsonReadOptions=r;function i(e){return e?Object.assign(Object.assign({},t),e):t}e.jsonWriteOptions=i;function a(e,t){let n=Object.assign(Object.assign({},e),t);return n.typeRegistry=[...e?.typeRegistry??[],...t?.typeRegistry??[]],n}e.mergeJsonOptions=a})),pd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MESSAGE_TYPE=void 0,e.MESSAGE_TYPE=Symbol.for(`protobuf-ts/message-type`)})),md=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.lowerCamelCase=void 0;function t(e){let t=!1,n=[];for(let r=0;r{Object.defineProperty(e,`__esModule`,{value:!0}),e.readMessageOption=e.readFieldOption=e.readFieldOptions=e.normalizeFieldInfo=e.RepeatType=e.LongType=e.ScalarType=void 0;let t=md();(function(e){e[e.DOUBLE=1]=`DOUBLE`,e[e.FLOAT=2]=`FLOAT`,e[e.INT64=3]=`INT64`,e[e.UINT64=4]=`UINT64`,e[e.INT32=5]=`INT32`,e[e.FIXED64=6]=`FIXED64`,e[e.FIXED32=7]=`FIXED32`,e[e.BOOL=8]=`BOOL`,e[e.STRING=9]=`STRING`,e[e.BYTES=12]=`BYTES`,e[e.UINT32=13]=`UINT32`,e[e.SFIXED32=15]=`SFIXED32`,e[e.SFIXED64=16]=`SFIXED64`,e[e.SINT32=17]=`SINT32`,e[e.SINT64=18]=`SINT64`})(e.ScalarType||={}),(function(e){e[e.BIGINT=0]=`BIGINT`,e[e.STRING=1]=`STRING`,e[e.NUMBER=2]=`NUMBER`})(e.LongType||={});var n;(function(e){e[e.NO=0]=`NO`,e[e.PACKED=1]=`PACKED`,e[e.UNPACKED=2]=`UNPACKED`})(n=e.RepeatType||={});function r(e){return e.localName=e.localName??t.lowerCamelCase(e.name),e.jsonName=e.jsonName??t.lowerCamelCase(e.name),e.repeat=e.repeat??n.NO,e.opt=e.opt??(e.repeat||e.oneof?!1:e.kind==`message`),e}e.normalizeFieldInfo=r;function i(e,t,n,r){let i=e.fields.find((e,n)=>e.localName==t||n==t)?.options;return i&&i[n]?r.fromJson(i[n]):void 0}e.readFieldOptions=i;function a(e,t,n,r){let i=e.fields.find((e,n)=>e.localName==t||n==t)?.options;if(!i)return;let a=i[n];return a===void 0?a:r?r.fromJson(a):a}e.readFieldOption=a;function o(e,t,n){let r=e.options[t];return r===void 0?r:n?n.fromJson(r):r}e.readMessageOption=o})),gd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSelectedOneofValue=e.clearOneofValue=e.setUnknownOneofValue=e.setOneofValue=e.getOneofValue=e.isOneofGroup=void 0;function t(e){if(typeof e!=`object`||!e||!e.hasOwnProperty(`oneofKind`))return!1;switch(typeof e.oneofKind){case`string`:return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case`undefined`:return Object.keys(e).length==1;default:return!1}}e.isOneofGroup=t;function n(e,t){return e[t]}e.getOneofValue=n;function r(e,t,n){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=t,n!==void 0&&(e[t]=n)}e.setOneofValue=r;function i(e,t,n){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=t,n!==void 0&&t!==void 0&&(e[t]=n)}e.setUnknownOneofValue=i;function a(e){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=void 0}e.clearOneofValue=a;function o(e){if(e.oneofKind!==void 0)return e[e.oneofKind]}e.getSelectedOneofValue=o})),_d=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionTypeCheck=void 0;let t=hd(),n=gd();e.ReflectionTypeCheck=class{constructor(e){this.fields=e.fields??[]}prepare(){if(this.data)return;let e=[],t=[],n=[];for(let r of this.fields)if(r.oneof)n.includes(r.oneof)||(n.push(r.oneof),e.push(r.oneof),t.push(r.oneof));else switch(t.push(r.localName),r.kind){case`scalar`:case`enum`:(!r.opt||r.repeat)&&e.push(r.localName);break;case`message`:r.repeat&&e.push(r.localName);break;case`map`:e.push(r.localName);break}this.data={req:e,known:t,oneofs:Object.values(n)}}is(e,t,r=!1){if(t<0)return!0;if(typeof e!=`object`||!e)return!1;this.prepare();let i=Object.keys(e),a=this.data;if(i.length!i.includes(e))||!r&&i.some(e=>!a.known.includes(e)))return!1;if(t<1)return!0;for(let i of a.oneofs){let a=e[i];if(!n.isOneofGroup(a))return!1;if(a.oneofKind===void 0)continue;let o=this.fields.find(e=>e.localName===a.oneofKind);if(!o||!this.field(a[a.oneofKind],o,r,t))return!1}for(let n of this.fields)if(n.oneof===void 0&&!this.field(e[n.localName],n,r,t))return!1;return!0}field(e,n,r,i){let a=n.repeat;switch(n.kind){case`scalar`:return e===void 0?n.opt:a?this.scalars(e,n.T,i,n.L):this.scalar(e,n.T,n.L);case`enum`:return e===void 0?n.opt:a?this.scalars(e,t.ScalarType.INT32,i):this.scalar(e,t.ScalarType.INT32);case`message`:return e===void 0?!0:a?this.messages(e,n.T(),r,i):this.message(e,n.T(),r,i);case`map`:if(typeof e!=`object`||!e)return!1;if(i<2)return!0;if(!this.mapKeys(e,n.K,i))return!1;switch(n.V.kind){case`scalar`:return this.scalars(Object.values(e),n.V.T,i,n.V.L);case`enum`:return this.scalars(Object.values(e),t.ScalarType.INT32,i);case`message`:return this.messages(Object.values(e),n.V.T(),r,i)}break}return!0}message(e,t,n,r){return n?t.isAssignable(e,r):t.is(e,r)}messages(e,t,n,r){if(!Array.isArray(e))return!1;if(r<2)return!0;if(n){for(let n=0;nparseInt(e)),n,r);case t.ScalarType.BOOL:return this.scalars(i.slice(0,r).map(e=>e==`true`?!0:e==`false`?!1:e),n,r);default:return this.scalars(i,n,r,t.LongType.STRING)}}}})),vd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionLongConvert=void 0;let t=hd();function n(e,n){switch(n){case t.LongType.BIGINT:return e.toBigInt();case t.LongType.NUMBER:return e.toNumber();default:return e.toString()}}e.reflectionLongConvert=n})),yd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionJsonReader=void 0;let t=rd(),n=id(),r=hd(),i=cd(),a=ud(),o=vd();e.ReflectionJsonReader=class{constructor(e){this.info=e}prepare(){if(this.fMap===void 0){this.fMap={};let e=this.info.fields??[];for(let t of e)this.fMap[t.name]=t,this.fMap[t.jsonName]=t,this.fMap[t.localName]=t}}assert(e,n,r){if(!e){let e=t.typeofJsonValue(r);throw(e==`number`||e==`boolean`)&&(e=r.toString()),Error(`Cannot parse JSON ${e} for ${this.info.typeName}#${n}`)}}read(e,n,i){this.prepare();let a=[];for(let[o,s]of Object.entries(e)){let e=this.fMap[o];if(!e){if(!i.ignoreUnknownFields)throw Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}let c=e.localName,l;if(e.oneof){if(s===null&&(e.kind!==`enum`||e.T()[0]!==`google.protobuf.NullValue`))continue;if(a.includes(e.oneof))throw Error(`Multiple members of the oneof group "${e.oneof}" of ${this.info.typeName} are present in JSON.`);a.push(e.oneof),l=n[e.oneof]={oneofKind:c}}else l=n;if(e.kind==`map`){if(s===null)continue;this.assert(t.isJsonObject(s),e.name,s);let n=l[c];for(let[t,a]of Object.entries(s)){this.assert(a!==null,e.name+` map value`,null);let o;switch(e.V.kind){case`message`:o=e.V.T().internalJsonRead(a,i);break;case`enum`:if(o=this.enum(e.V.T(),a,e.name,i.ignoreUnknownFields),o===!1)continue;break;case`scalar`:o=this.scalar(a,e.V.T,e.V.L,e.name);break}this.assert(o!==void 0,e.name+` map value`,a);let s=t;e.K==r.ScalarType.BOOL&&(s=s==`true`?!0:s==`false`?!1:s),s=this.scalar(s,e.K,r.LongType.STRING,e.name).toString(),n[s]=o}}else if(e.repeat){if(s===null)continue;this.assert(Array.isArray(s),e.name,s);let t=l[c];for(let n of s){this.assert(n!==null,e.name,null);let r;switch(e.kind){case`message`:r=e.T().internalJsonRead(n,i);break;case`enum`:if(r=this.enum(e.T(),n,e.name,i.ignoreUnknownFields),r===!1)continue;break;case`scalar`:r=this.scalar(n,e.T,e.L,e.name);break}this.assert(r!==void 0,e.name,s),t.push(r)}}else switch(e.kind){case`message`:if(s===null&&e.T().typeName!=`google.protobuf.Value`){this.assert(e.oneof===void 0,e.name+` (oneof member)`,null);continue}l[c]=e.T().internalJsonRead(s,i,l[c]);break;case`enum`:if(s===null)continue;let t=this.enum(e.T(),s,e.name,i.ignoreUnknownFields);if(t===!1)continue;l[c]=t;break;case`scalar`:if(s===null)continue;l[c]=this.scalar(s,e.T,e.L,e.name);break}}}enum(e,t,n,r){if(e[0]==`google.protobuf.NullValue`&&a.assert(t===null||t===`NULL_VALUE`,`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case`number`:return a.assert(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`),t;case`string`:let i=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(i=t.substring(e[2].length));let o=e[1][i];return o===void 0&&r?!1:(a.assert(typeof o==`number`,`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`),o)}a.assert(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,s,c){let l;try{switch(t){case r.ScalarType.DOUBLE:case r.ScalarType.FLOAT:if(e===null)return 0;if(e===`NaN`)return NaN;if(e===`Infinity`)return 1/0;if(e===`-Infinity`)return-1/0;if(e===``){l=`empty string`;break}if(typeof e==`string`&&e.trim().length!==e.length){l=`extra whitespace`;break}if(typeof e!=`string`&&typeof e!=`number`)break;let c=Number(e);if(Number.isNaN(c)){l=`not a number`;break}if(!Number.isFinite(c)){l=`too large or small`;break}return t==r.ScalarType.FLOAT&&a.assertFloat32(c),c;case r.ScalarType.INT32:case r.ScalarType.FIXED32:case r.ScalarType.SFIXED32:case r.ScalarType.SINT32:case r.ScalarType.UINT32:if(e===null)return 0;let u;if(typeof e==`number`?u=e:e===``?l=`empty string`:typeof e==`string`&&(e.trim().length===e.length?u=Number(e):l=`extra whitespace`),u===void 0)break;return t==r.ScalarType.UINT32?a.assertUInt32(u):a.assertInt32(u),u;case r.ScalarType.INT64:case r.ScalarType.SFIXED64:case r.ScalarType.SINT64:if(e===null)return o.reflectionLongConvert(i.PbLong.ZERO,s);if(typeof e!=`number`&&typeof e!=`string`)break;return o.reflectionLongConvert(i.PbLong.from(e),s);case r.ScalarType.FIXED64:case r.ScalarType.UINT64:if(e===null)return o.reflectionLongConvert(i.PbULong.ZERO,s);if(typeof e!=`number`&&typeof e!=`string`)break;return o.reflectionLongConvert(i.PbULong.from(e),s);case r.ScalarType.BOOL:if(e===null)return!1;if(typeof e!=`boolean`)break;return e;case r.ScalarType.STRING:if(e===null)return``;if(typeof e!=`string`){l=`extra whitespace`;break}return e;case r.ScalarType.BYTES:if(e===null||e===``)return new Uint8Array;if(typeof e!=`string`)break;return n.base64decode(e)}}catch(e){l=e.message}this.assert(!1,c+(l?` - `+l:``),e)}}})),bd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionJsonWriter=void 0;let t=id(),n=cd(),r=hd(),i=ud();e.ReflectionJsonWriter=class{constructor(e){this.fields=e.fields??[]}write(e,t){let n={},r=e;for(let e of this.fields){if(!e.oneof){let i=this.field(e,r[e.localName],t);i!==void 0&&(n[t.useProtoFieldName?e.name:e.jsonName]=i);continue}let a=r[e.oneof];if(a.oneofKind!==e.localName)continue;let o=e.kind==`scalar`||e.kind==`enum`?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,s=this.field(e,a[e.localName],o);i.assert(s!==void 0),n[t.useProtoFieldName?e.name:e.jsonName]=s}return n}field(e,t,n){let r;if(e.kind==`map`){i.assert(typeof t==`object`&&!!t);let a={};switch(e.V.kind){case`scalar`:for(let[n,r]of Object.entries(t)){let t=this.scalar(e.V.T,r,e.name,!1,!0);i.assert(t!==void 0),a[n.toString()]=t}break;case`message`:let r=e.V.T();for(let[o,s]of Object.entries(t)){let t=this.message(r,s,e.name,n);i.assert(t!==void 0),a[o.toString()]=t}break;case`enum`:let o=e.V.T();for(let[r,s]of Object.entries(t)){i.assert(s===void 0||typeof s==`number`);let t=this.enum(o,s,e.name,!1,!0,n.enumAsInteger);i.assert(t!==void 0),a[r.toString()]=t}break}(n.emitDefaultValues||Object.keys(a).length>0)&&(r=a)}else if(e.repeat){i.assert(Array.isArray(t));let a=[];switch(e.kind){case`scalar`:for(let n=0;n0||n.emitDefaultValues)&&(r=a)}else switch(e.kind){case`scalar`:r=this.scalar(e.T,t,e.name,e.opt,n.emitDefaultValues);break;case`enum`:r=this.enum(e.T(),t,e.name,e.opt,n.emitDefaultValues,n.enumAsInteger);break;case`message`:r=this.message(e.T(),t,e.name,n);break}return r}enum(e,t,n,r,a,o){if(e[0]==`google.protobuf.NullValue`)return!a&&!r?void 0:null;if(t===void 0){i.assert(r);return}if(!(t===0&&!a&&!r))return i.assert(typeof t==`number`),i.assert(Number.isInteger(t)),o||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,n,r){return t===void 0?r.emitDefaultValues?null:void 0:e.internalJsonWrite(t,r)}scalar(e,a,o,s,c){if(a===void 0){i.assert(s);return}let l=c||s;switch(e){case r.ScalarType.INT32:case r.ScalarType.SFIXED32:case r.ScalarType.SINT32:return a===0?l?0:void 0:(i.assertInt32(a),a);case r.ScalarType.FIXED32:case r.ScalarType.UINT32:return a===0?l?0:void 0:(i.assertUInt32(a),a);case r.ScalarType.FLOAT:i.assertFloat32(a);case r.ScalarType.DOUBLE:return a===0?l?0:void 0:(i.assert(typeof a==`number`),Number.isNaN(a)?`NaN`:a===1/0?`Infinity`:a===-1/0?`-Infinity`:a);case r.ScalarType.STRING:return a===``?l?``:void 0:(i.assert(typeof a==`string`),a);case r.ScalarType.BOOL:return a===!1?l?!1:void 0:(i.assert(typeof a==`boolean`),a);case r.ScalarType.UINT64:case r.ScalarType.FIXED64:i.assert(typeof a==`number`||typeof a==`string`||typeof a==`bigint`);let e=n.PbULong.from(a);return e.isZero()&&!l?void 0:e.toString();case r.ScalarType.INT64:case r.ScalarType.SFIXED64:case r.ScalarType.SINT64:i.assert(typeof a==`number`||typeof a==`string`||typeof a==`bigint`);let o=n.PbLong.from(a);return o.isZero()&&!l?void 0:o.toString();case r.ScalarType.BYTES:return i.assert(a instanceof Uint8Array),a.byteLength?t.base64encode(a):l?``:void 0}}}})),xd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionScalarDefault=void 0;let t=hd(),n=vd(),r=cd();function i(e,i=t.LongType.STRING){switch(e){case t.ScalarType.BOOL:return!1;case t.ScalarType.UINT64:case t.ScalarType.FIXED64:return n.reflectionLongConvert(r.PbULong.ZERO,i);case t.ScalarType.INT64:case t.ScalarType.SFIXED64:case t.ScalarType.SINT64:return n.reflectionLongConvert(r.PbLong.ZERO,i);case t.ScalarType.DOUBLE:case t.ScalarType.FLOAT:return 0;case t.ScalarType.BYTES:return new Uint8Array;case t.ScalarType.STRING:return``;default:return 0}}e.reflectionScalarDefault=i})),Sd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionBinaryReader=void 0;let t=od(),n=hd(),r=vd(),i=xd();e.ReflectionBinaryReader=class{constructor(e){this.info=e}prepare(){if(!this.fieldNoToField){let e=this.info.fields??[];this.fieldNoToField=new Map(e.map(e=>[e.no,e]))}}read(e,r,i,a){this.prepare();let o=a===void 0?e.len:e.pos+a;for(;e.pos{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionBinaryWriter=void 0;let t=od(),n=hd(),r=ud(),i=cd();e.ReflectionBinaryWriter=class{constructor(e){this.info=e}prepare(){this.fields||=(this.info.fields?this.info.fields.concat():[]).sort((e,t)=>e.no-t.no)}write(e,i,a){this.prepare();for(let t of this.fields){let o,s,c=t.repeat,l=t.localName;if(t.oneof){let n=e[t.oneof];if(n.oneofKind!==l)continue;o=n[l],s=!0}else o=e[l],s=!1;switch(t.kind){case`scalar`:case`enum`:let e=t.kind==`enum`?n.ScalarType.INT32:t.T;if(c)if(r.assert(Array.isArray(o)),c==n.RepeatType.PACKED)this.packed(i,e,t.no,o);else for(let n of o)this.scalar(i,e,t.no,n,!0);else o===void 0?r.assert(t.opt):this.scalar(i,e,t.no,o,s||t.opt);break;case`message`:if(c){r.assert(Array.isArray(o));for(let e of o)this.message(i,a,t.T(),t.no,e)}else this.message(i,a,t.T(),t.no,o);break;case`map`:r.assert(typeof o==`object`&&!!o);for(let[e,n]of Object.entries(o))this.mapEntry(i,a,t,e,n);break}}let o=a.writeUnknownFields;o!==!1&&(o===!0?t.UnknownFieldHandler.onWrite:o)(this.info.typeName,e,i)}mapEntry(e,i,a,o,s){e.tag(a.no,t.WireType.LengthDelimited),e.fork();let c=o;switch(a.K){case n.ScalarType.INT32:case n.ScalarType.FIXED32:case n.ScalarType.UINT32:case n.ScalarType.SFIXED32:case n.ScalarType.SINT32:c=Number.parseInt(o);break;case n.ScalarType.BOOL:r.assert(o==`true`||o==`false`),c=o==`true`;break}switch(this.scalar(e,a.K,1,c,!0),a.V.kind){case`scalar`:this.scalar(e,a.V.T,2,s,!0);break;case`enum`:this.scalar(e,n.ScalarType.INT32,2,s,!0);break;case`message`:this.message(e,i,a.V.T(),2,s);break}e.join()}message(e,n,r,i,a){a!==void 0&&(r.internalBinaryWrite(a,e.tag(i,t.WireType.LengthDelimited).fork(),n),e.join())}scalar(e,t,n,r,i){let[a,o,s]=this.scalarInfo(t,r);(!s||i)&&(e.tag(n,a),e[o](r))}packed(e,i,a,o){if(!o.length)return;r.assert(i!==n.ScalarType.BYTES&&i!==n.ScalarType.STRING),e.tag(a,t.WireType.LengthDelimited),e.fork();let[,s]=this.scalarInfo(i);for(let t=0;t{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionCreate=void 0;let t=xd(),n=pd();function r(e){let r=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},n.MESSAGE_TYPE,{value:e});for(let n of e.fields){let e=n.localName;if(!n.opt)if(n.oneof)r[n.oneof]={oneofKind:void 0};else if(n.repeat)r[e]=[];else switch(n.kind){case`scalar`:r[e]=t.reflectionScalarDefault(n.T,n.L);break;case`enum`:r[e]=0;break;case`map`:r[e]={};break}}return r}e.reflectionCreate=r})),Td=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionMergePartial=void 0;function t(e,t,n){let r,i=n,a;for(let n of e.fields){let e=n.localName;if(n.oneof){let o=i[n.oneof];if(o?.oneofKind==null)continue;if(r=o[e],a=t[n.oneof],a.oneofKind=o.oneofKind,r==null){delete a[e];continue}}else if(r=i[e],a=t,r==null)continue;switch(n.repeat&&(a[e].length=r.length),n.kind){case`scalar`:case`enum`:if(n.repeat)for(let t=0;t{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionEquals=void 0;let t=hd();function n(e,n,s){if(n===s)return!0;if(!n||!s)return!1;for(let c of e.fields){let e=c.localName,l=c.oneof?n[c.oneof][e]:n[e],u=c.oneof?s[c.oneof][e]:s[e];switch(c.kind){case`enum`:case`scalar`:let e=c.kind==`enum`?t.ScalarType.INT32:c.T;if(!(c.repeat?a(e,l,u):i(e,l,u)))return!1;break;case`map`:if(!(c.V.kind==`message`?o(c.V.T(),r(l),r(u)):a(c.V.kind==`enum`?t.ScalarType.INT32:c.V.T,r(l),r(u))))return!1;break;case`message`:let n=c.T();if(!(c.repeat?o(n,l,u):n.equals(l,u)))return!1;break}}return!0}e.reflectionEquals=n;let r=Object.values;function i(e,n,r){if(n===r)return!0;if(e!==t.ScalarType.BYTES)return!1;let i=n,a=r;if(i.length!==a.length)return!1;for(let e=0;e{Object.defineProperty(e,`__esModule`,{value:!0}),e.MessageType=void 0;let t=pd(),n=hd(),r=_d(),i=yd(),a=bd(),o=Sd(),s=Cd(),c=wd(),l=Td(),u=rd(),d=fd(),f=Ed(),p=dd(),m=ld(),h=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),g=h[t.MESSAGE_TYPE]={};e.MessageType=class{constructor(e,t,c){this.defaultCheckDepth=16,this.typeName=e,this.fields=t.map(n.normalizeFieldInfo),this.options=c??{},g.value=this,this.messagePrototype=Object.create(null,h),this.refTypeCheck=new r.ReflectionTypeCheck(this),this.refJsonReader=new i.ReflectionJsonReader(this),this.refJsonWriter=new a.ReflectionJsonWriter(this),this.refBinReader=new o.ReflectionBinaryReader(this),this.refBinWriter=new s.ReflectionBinaryWriter(this)}create(e){let t=c.reflectionCreate(this);return e!==void 0&&l.reflectionMergePartial(this,t,e),t}clone(e){let t=this.create();return l.reflectionMergePartial(this,t,e),t}equals(e,t){return f.reflectionEquals(this,e,t)}is(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!1)}isAssignable(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!0)}mergePartial(e,t){l.reflectionMergePartial(this,e,t)}fromBinary(e,t){let n=m.binaryReadOptions(t);return this.internalBinaryRead(n.readerFactory(e),e.byteLength,n)}fromJson(e,t){return this.internalJsonRead(e,d.jsonReadOptions(t))}fromJsonString(e,t){let n=JSON.parse(e);return this.fromJson(n,t)}toJson(e,t){return this.internalJsonWrite(e,d.jsonWriteOptions(t))}toJsonString(e,t){let n=this.toJson(e,t);return JSON.stringify(n,null,t?.prettySpaces??0)}toBinary(e,t){let n=p.binaryWriteOptions(t);return this.internalBinaryWrite(e,n.writerFactory(),n).finish()}internalJsonRead(e,t,n){if(typeof e==`object`&&e&&!Array.isArray(e)){let r=n??this.create();return this.refJsonReader.read(e,r,t),r}throw Error(`Unable to parse message ${this.typeName} from JSON ${u.typeofJsonValue(e)}.`)}internalJsonWrite(e,t){return this.refJsonWriter.write(e,t)}internalBinaryWrite(e,t,n){return this.refBinWriter.write(e,t,n),t}internalBinaryRead(e,t,n,r){let i=r??this.create();return this.refBinReader.read(e,i,n,t),i}}})),Od=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.containsMessageType=void 0;let t=pd();function n(e){return e[t.MESSAGE_TYPE]!=null}e.containsMessageType=n})),kd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.listEnumNumbers=e.listEnumNames=e.listEnumValues=e.isEnumObject=void 0;function t(e){if(typeof e!=`object`||!e||!e.hasOwnProperty(0))return!1;for(let t of Object.keys(e)){let n=parseInt(t);if(Number.isNaN(n)){let n=e[t];if(n===void 0||typeof n!=`number`||e[n]===void 0)return!1}else{let t=e[n];if(t===void 0||e[t]!==n)return!1}}return!0}e.isEnumObject=t;function n(e){if(!t(e))throw Error(`not a typescript enum object`);let n=[];for(let[t,r]of Object.entries(e))typeof r==`number`&&n.push({name:t,number:r});return n}e.listEnumValues=n;function r(e){return n(e).map(e=>e.name)}e.listEnumNames=r;function i(e){return n(e).map(e=>e.number).filter((e,t,n)=>n.indexOf(e)==t)}e.listEnumNumbers=i})),Ad=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=rd();Object.defineProperty(e,`typeofJsonValue`,{enumerable:!0,get:function(){return t.typeofJsonValue}}),Object.defineProperty(e,`isJsonObject`,{enumerable:!0,get:function(){return t.isJsonObject}});var n=id();Object.defineProperty(e,`base64decode`,{enumerable:!0,get:function(){return n.base64decode}}),Object.defineProperty(e,`base64encode`,{enumerable:!0,get:function(){return n.base64encode}});var r=ad();Object.defineProperty(e,`utf8read`,{enumerable:!0,get:function(){return r.utf8read}});var i=od();Object.defineProperty(e,`WireType`,{enumerable:!0,get:function(){return i.WireType}}),Object.defineProperty(e,`mergeBinaryOptions`,{enumerable:!0,get:function(){return i.mergeBinaryOptions}}),Object.defineProperty(e,`UnknownFieldHandler`,{enumerable:!0,get:function(){return i.UnknownFieldHandler}});var a=ld();Object.defineProperty(e,`BinaryReader`,{enumerable:!0,get:function(){return a.BinaryReader}}),Object.defineProperty(e,`binaryReadOptions`,{enumerable:!0,get:function(){return a.binaryReadOptions}});var o=dd();Object.defineProperty(e,`BinaryWriter`,{enumerable:!0,get:function(){return o.BinaryWriter}}),Object.defineProperty(e,`binaryWriteOptions`,{enumerable:!0,get:function(){return o.binaryWriteOptions}});var s=cd();Object.defineProperty(e,`PbLong`,{enumerable:!0,get:function(){return s.PbLong}}),Object.defineProperty(e,`PbULong`,{enumerable:!0,get:function(){return s.PbULong}});var c=fd();Object.defineProperty(e,`jsonReadOptions`,{enumerable:!0,get:function(){return c.jsonReadOptions}}),Object.defineProperty(e,`jsonWriteOptions`,{enumerable:!0,get:function(){return c.jsonWriteOptions}}),Object.defineProperty(e,`mergeJsonOptions`,{enumerable:!0,get:function(){return c.mergeJsonOptions}});var l=pd();Object.defineProperty(e,`MESSAGE_TYPE`,{enumerable:!0,get:function(){return l.MESSAGE_TYPE}});var u=Dd();Object.defineProperty(e,`MessageType`,{enumerable:!0,get:function(){return u.MessageType}});var d=hd();Object.defineProperty(e,`ScalarType`,{enumerable:!0,get:function(){return d.ScalarType}}),Object.defineProperty(e,`LongType`,{enumerable:!0,get:function(){return d.LongType}}),Object.defineProperty(e,`RepeatType`,{enumerable:!0,get:function(){return d.RepeatType}}),Object.defineProperty(e,`normalizeFieldInfo`,{enumerable:!0,get:function(){return d.normalizeFieldInfo}}),Object.defineProperty(e,`readFieldOptions`,{enumerable:!0,get:function(){return d.readFieldOptions}}),Object.defineProperty(e,`readFieldOption`,{enumerable:!0,get:function(){return d.readFieldOption}}),Object.defineProperty(e,`readMessageOption`,{enumerable:!0,get:function(){return d.readMessageOption}});var f=_d();Object.defineProperty(e,`ReflectionTypeCheck`,{enumerable:!0,get:function(){return f.ReflectionTypeCheck}});var p=wd();Object.defineProperty(e,`reflectionCreate`,{enumerable:!0,get:function(){return p.reflectionCreate}});var m=xd();Object.defineProperty(e,`reflectionScalarDefault`,{enumerable:!0,get:function(){return m.reflectionScalarDefault}});var h=Td();Object.defineProperty(e,`reflectionMergePartial`,{enumerable:!0,get:function(){return h.reflectionMergePartial}});var g=Ed();Object.defineProperty(e,`reflectionEquals`,{enumerable:!0,get:function(){return g.reflectionEquals}});var _=Sd();Object.defineProperty(e,`ReflectionBinaryReader`,{enumerable:!0,get:function(){return _.ReflectionBinaryReader}});var v=Cd();Object.defineProperty(e,`ReflectionBinaryWriter`,{enumerable:!0,get:function(){return v.ReflectionBinaryWriter}});var y=yd();Object.defineProperty(e,`ReflectionJsonReader`,{enumerable:!0,get:function(){return y.ReflectionJsonReader}});var b=bd();Object.defineProperty(e,`ReflectionJsonWriter`,{enumerable:!0,get:function(){return b.ReflectionJsonWriter}});var x=Od();Object.defineProperty(e,`containsMessageType`,{enumerable:!0,get:function(){return x.containsMessageType}});var S=gd();Object.defineProperty(e,`isOneofGroup`,{enumerable:!0,get:function(){return S.isOneofGroup}}),Object.defineProperty(e,`setOneofValue`,{enumerable:!0,get:function(){return S.setOneofValue}}),Object.defineProperty(e,`getOneofValue`,{enumerable:!0,get:function(){return S.getOneofValue}}),Object.defineProperty(e,`clearOneofValue`,{enumerable:!0,get:function(){return S.clearOneofValue}}),Object.defineProperty(e,`getSelectedOneofValue`,{enumerable:!0,get:function(){return S.getSelectedOneofValue}});var C=kd();Object.defineProperty(e,`listEnumValues`,{enumerable:!0,get:function(){return C.listEnumValues}}),Object.defineProperty(e,`listEnumNames`,{enumerable:!0,get:function(){return C.listEnumNames}}),Object.defineProperty(e,`listEnumNumbers`,{enumerable:!0,get:function(){return C.listEnumNumbers}}),Object.defineProperty(e,`isEnumObject`,{enumerable:!0,get:function(){return C.isEnumObject}});var w=md();Object.defineProperty(e,`lowerCamelCase`,{enumerable:!0,get:function(){return w.lowerCamelCase}});var T=ud();Object.defineProperty(e,`assert`,{enumerable:!0,get:function(){return T.assert}}),Object.defineProperty(e,`assertNever`,{enumerable:!0,get:function(){return T.assertNever}}),Object.defineProperty(e,`assertInt32`,{enumerable:!0,get:function(){return T.assertInt32}}),Object.defineProperty(e,`assertUInt32`,{enumerable:!0,get:function(){return T.assertUInt32}}),Object.defineProperty(e,`assertFloat32`,{enumerable:!0,get:function(){return T.assertFloat32}})})),jd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readServiceOption=e.readMethodOption=e.readMethodOptions=e.normalizeMethodInfo=void 0;let t=Ad();function n(e,n){let r=e;return r.service=n,r.localName=r.localName??t.lowerCamelCase(r.name),r.serverStreaming=!!r.serverStreaming,r.clientStreaming=!!r.clientStreaming,r.options=r.options??{},r.idempotency=r.idempotency??void 0,r}e.normalizeMethodInfo=n;function r(e,t,n,r){let i=e.methods.find((e,n)=>e.localName===t||n===t)?.options;return i&&i[n]?r.fromJson(i[n]):void 0}e.readMethodOptions=r;function i(e,t,n,r){let i=e.methods.find((e,n)=>e.localName===t||n===t)?.options;if(!i)return;let a=i[n];return a===void 0?a:r?r.fromJson(a):a}e.readMethodOption=i;function a(e,t,n){let r=e.options;if(!r)return;let i=r[t];return i===void 0?i:n?n.fromJson(i):i}e.readServiceOption=a})),Md=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ServiceType=void 0;let t=jd();e.ServiceType=class{constructor(e,n,r){this.typeName=e,this.methods=n.map(e=>t.normalizeMethodInfo(e,this)),this.options=r??{}}}})),Nd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RpcError=void 0,e.RpcError=class extends Error{constructor(e,t=`UNKNOWN`,n){super(e),this.name=`RpcError`,Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.meta=n??{}}toString(){let e=[this.name+`: `+this.message];this.code&&(e.push(``),e.push(`Code: `+this.code)),this.serviceName&&this.methodName&&e.push(`Method: `+this.serviceName+`/`+this.methodName);let t=Object.entries(this.meta);if(t.length){e.push(``),e.push(`Meta:`);for(let[n,r]of t)e.push(` ${n}: ${r}`)}return e.join(` `)}}})),Pd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeRpcOptions=void 0;let t=Ad();function n(e,n){if(!n)return e;let i={};r(e,i),r(n,i);for(let a of Object.keys(n)){let o=n[a];switch(a){case`jsonOptions`:i.jsonOptions=t.mergeJsonOptions(e.jsonOptions,i.jsonOptions);break;case`binaryOptions`:i.binaryOptions=t.mergeBinaryOptions(e.binaryOptions,i.binaryOptions);break;case`meta`:i.meta={},r(e.meta,i.meta),r(n.meta,i.meta);break;case`interceptors`:i.interceptors=e.interceptors?e.interceptors.concat(o):o.concat();break}}return i}e.mergeRpcOptions=n;function r(e,t){if(!e)return;let n=t;for(let[t,r]of Object.entries(e))r instanceof Date?n[t]=new Date(r.getTime()):Array.isArray(r)?n[t]=r.concat():n[t]=r}})),Fd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Deferred=e.DeferredState=void 0;var t;(function(e){e[e.PENDING=0]=`PENDING`,e[e.REJECTED=1]=`REJECTED`,e[e.RESOLVED=2]=`RESOLVED`})(t=e.DeferredState||={}),e.Deferred=class{constructor(e=!0){this._state=t.PENDING,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),e&&this._promise.catch(e=>{})}get state(){return this._state}get promise(){return this._promise}resolve(e){if(this.state!==t.PENDING)throw Error(`cannot resolve ${t[this.state].toLowerCase()}`);this._resolve(e),this._state=t.RESOLVED}reject(e){if(this.state!==t.PENDING)throw Error(`cannot reject ${t[this.state].toLowerCase()}`);this._reject(e),this._state=t.REJECTED}resolvePending(e){this._state===t.PENDING&&this.resolve(e)}rejectPending(e){this._state===t.PENDING&&this.reject(e)}}})),Id=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RpcOutputStreamController=void 0;let t=Fd(),n=Ad();e.RpcOutputStreamController=class{constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]},this._closed=!1,this._itState={q:[]}}onNext(e){return this.addLis(e,this._lis.nxt)}onMessage(e){return this.addLis(e,this._lis.msg)}onError(e){return this.addLis(e,this._lis.err)}onComplete(e){return this.addLis(e,this._lis.cmp)}addLis(e,t){return t.push(e),()=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}}clearLis(){for(let e of Object.values(this._lis))e.splice(0,e.length)}get closed(){return this._closed!==!1}notifyNext(e,t,r){n.assert((e?1:0)+(t?1:0)+(r?1:0)<=1,`only one emission at a time`),e&&this.notifyMessage(e),t&&this.notifyError(t),r&&this.notifyComplete()}notifyMessage(e){n.assert(!this.closed,`stream is closed`),this.pushIt({value:e,done:!1}),this._lis.msg.forEach(t=>t(e)),this._lis.nxt.forEach(t=>t(e,void 0,!1))}notifyError(e){n.assert(!this.closed,`stream is closed`),this._closed=e,this.pushIt(e),this._lis.err.forEach(t=>t(e)),this._lis.nxt.forEach(t=>t(void 0,e,!1)),this.clearLis()}notifyComplete(){n.assert(!this.closed,`stream is closed`),this._closed=!0,this.pushIt({value:null,done:!0}),this._lis.cmp.forEach(e=>e()),this._lis.nxt.forEach(e=>e(void 0,void 0,!0)),this.clearLis()}[Symbol.asyncIterator](){return this._closed===!0?this.pushIt({value:null,done:!0}):this._closed!==!1&&this.pushIt(this._closed),{next:()=>{let e=this._itState;n.assert(e,`bad state`),n.assert(!e.p,`iterator contract broken`);let r=e.q.shift();return r?`value`in r?Promise.resolve(r):Promise.reject(r):(e.p=new t.Deferred,e.p.promise)}}}pushIt(e){let r=this._itState;if(r.p){let i=r.p;n.assert(i.state==t.DeferredState.PENDING,`iterator contract broken`),`value`in e?i.resolve(e):i.reject(e),delete r.p}else r.q.push(e)}}})),Ld=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.UnaryCall=void 0,e.UnaryCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=r,this.response=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n,r]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,response:t,status:n,trailers:r}})}}})),Rd=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ServerStreamingCall=void 0,e.ServerStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=r,this.responses=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,status:t,trailers:n}})}}})),zd=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ClientStreamingCall=void 0,e.ClientStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.requests=n,this.headers=r,this.response=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n,r]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:e,response:t,status:n,trailers:r}})}}})),Bd=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.DuplexStreamingCall=void 0,e.DuplexStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.requests=n,this.headers=r,this.responses=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:e,status:t,trailers:n}})}}})),Vd=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.TestTransport=void 0;let n=Nd(),r=Ad(),i=Id(),a=Pd(),o=Ld(),s=Rd(),c=zd(),l=Bd();var u=class e{constructor(e){this.suppressUncaughtRejections=!0,this.headerDelay=10,this.responseDelay=50,this.betweenResponseDelay=10,this.afterResponseDelay=10,this.data=e??{}}get sentMessages(){return this.lastInput instanceof f?this.lastInput.sent:typeof this.lastInput==`object`?[this.lastInput.single]:[]}get sendComplete(){return this.lastInput instanceof f?this.lastInput.completed:typeof this.lastInput==`object`}promiseHeaders(){let t=this.data.headers??e.defaultHeaders;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}promiseSingleResponse(e){if(this.data.response instanceof n.RpcError)return Promise.reject(this.data.response);let t;return Array.isArray(this.data.response)?(r.assert(this.data.response.length>0),t=this.data.response[0]):t=this.data.response===void 0?e.O.create():this.data.response,r.assert(e.O.is(t)),Promise.resolve(t)}streamResponses(e,i,a){return t(this,void 0,void 0,function*(){let t=[];if(this.data.response===void 0)t.push(e.O.create());else if(Array.isArray(this.data.response))for(let n of this.data.response)r.assert(e.O.is(n)),t.push(n);else this.data.response instanceof n.RpcError||(r.assert(e.O.is(this.data.response)),t.push(this.data.response));try{yield d(this.responseDelay,a)(void 0)}catch(e){i.notifyError(e);return}if(this.data.response instanceof n.RpcError){i.notifyError(this.data.response);return}for(let e of t){i.notifyMessage(e);try{yield d(this.betweenResponseDelay,a)(void 0)}catch(e){i.notifyError(e);return}}if(this.data.status instanceof n.RpcError){i.notifyError(this.data.status);return}if(this.data.trailers instanceof n.RpcError){i.notifyError(this.data.trailers);return}i.notifyComplete()})}promiseStatus(){let t=this.data.status??e.defaultStatus;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}promiseTrailers(){let t=this.data.trailers??e.defaultTrailers;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}maybeSuppressUncaught(...e){if(this.suppressUncaughtRejections)for(let t of e)t.catch(()=>{})}mergeOptions(e){return a.mergeRpcOptions({},e)}unary(e,t,n){let r=n.meta??{},i=this.promiseHeaders().then(d(this.headerDelay,n.abort)),a=i.catch(e=>{}).then(d(this.responseDelay,n.abort)).then(t=>this.promiseSingleResponse(e)),s=a.catch(e=>{}).then(d(this.afterResponseDelay,n.abort)).then(e=>this.promiseStatus()),c=a.catch(e=>{}).then(d(this.afterResponseDelay,n.abort)).then(e=>this.promiseTrailers());return this.maybeSuppressUncaught(s,c),this.lastInput={single:t},new o.UnaryCall(e,r,t,i,a,s,c)}serverStreaming(e,t,n){let r=n.meta??{},a=this.promiseHeaders().then(d(this.headerDelay,n.abort)),o=new i.RpcOutputStreamController,c=a.then(d(this.responseDelay,n.abort)).catch(()=>{}).then(()=>this.streamResponses(e,o,n.abort)).then(d(this.afterResponseDelay,n.abort)),l=c.then(()=>this.promiseStatus()),u=c.then(()=>this.promiseTrailers());return this.maybeSuppressUncaught(l,u),this.lastInput={single:t},new s.ServerStreamingCall(e,r,t,a,o,l,u)}clientStreaming(e,t){let n=t.meta??{},r=this.promiseHeaders().then(d(this.headerDelay,t.abort)),i=r.catch(e=>{}).then(d(this.responseDelay,t.abort)).then(t=>this.promiseSingleResponse(e)),a=i.catch(e=>{}).then(d(this.afterResponseDelay,t.abort)).then(e=>this.promiseStatus()),o=i.catch(e=>{}).then(d(this.afterResponseDelay,t.abort)).then(e=>this.promiseTrailers());return this.maybeSuppressUncaught(a,o),this.lastInput=new f(this.data,t.abort),new c.ClientStreamingCall(e,n,this.lastInput,r,i,a,o)}duplex(e,t){let n=t.meta??{},r=this.promiseHeaders().then(d(this.headerDelay,t.abort)),a=new i.RpcOutputStreamController,o=r.then(d(this.responseDelay,t.abort)).catch(()=>{}).then(()=>this.streamResponses(e,a,t.abort)).then(d(this.afterResponseDelay,t.abort)),s=o.then(()=>this.promiseStatus()),c=o.then(()=>this.promiseTrailers());return this.maybeSuppressUncaught(s,c),this.lastInput=new f(this.data,t.abort),new l.DuplexStreamingCall(e,n,this.lastInput,r,a,s,c)}};e.TestTransport=u,u.defaultHeaders={responseHeader:`test`},u.defaultStatus={code:`OK`,detail:`all good`},u.defaultTrailers={responseTrailer:`test`};function d(e,t){return r=>new Promise((i,a)=>{if(t?.aborted)a(new n.RpcError(`user cancel`,`CANCELLED`));else{let o=setTimeout(()=>i(r),e);t&&t.addEventListener(`abort`,e=>{clearTimeout(o),a(new n.RpcError(`user cancel`,`CANCELLED`))})}})}var f=class{constructor(e,t){this._completed=!1,this._sent=[],this.data=e,this.abort=t}get sent(){return this._sent}get completed(){return this._completed}send(e){if(this.data.inputMessage instanceof n.RpcError)return Promise.reject(this.data.inputMessage);let t=this.data.inputMessage===void 0?10:this.data.inputMessage;return Promise.resolve(void 0).then(()=>{this._sent.push(e)}).then(d(t,this.abort))}complete(){if(this.data.inputComplete instanceof n.RpcError)return Promise.reject(this.data.inputComplete);let e=this.data.inputComplete===void 0?10:this.data.inputComplete;return Promise.resolve(void 0).then(()=>{this._completed=!0}).then(d(e,this.abort))}}})),Hd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.stackDuplexStreamingInterceptors=e.stackClientStreamingInterceptors=e.stackServerStreamingInterceptors=e.stackUnaryInterceptors=e.stackIntercept=void 0;let t=Ad();function n(e,n,r,i,a){if(e==`unary`){let e=(e,t,r)=>n.unary(e,t,r);for(let t of(i.interceptors??[]).filter(e=>e.interceptUnary).reverse()){let n=e;e=(e,r,i)=>t.interceptUnary(n,e,r,i)}return e(r,a,i)}if(e==`serverStreaming`){let e=(e,t,r)=>n.serverStreaming(e,t,r);for(let t of(i.interceptors??[]).filter(e=>e.interceptServerStreaming).reverse()){let n=e;e=(e,r,i)=>t.interceptServerStreaming(n,e,r,i)}return e(r,a,i)}if(e==`clientStreaming`){let e=(e,t)=>n.clientStreaming(e,t);for(let t of(i.interceptors??[]).filter(e=>e.interceptClientStreaming).reverse()){let n=e;e=(e,r)=>t.interceptClientStreaming(n,e,r)}return e(r,i)}if(e==`duplex`){let e=(e,t)=>n.duplex(e,t);for(let t of(i.interceptors??[]).filter(e=>e.interceptDuplex).reverse()){let n=e;e=(e,r)=>t.interceptDuplex(n,e,r)}return e(r,i)}t.assertNever(e)}e.stackIntercept=n;function r(e,t,r,i){return n(`unary`,e,t,i,r)}e.stackUnaryInterceptors=r;function i(e,t,r,i){return n(`serverStreaming`,e,t,i,r)}e.stackServerStreamingInterceptors=i;function a(e,t,r){return n(`clientStreaming`,e,t,r)}e.stackClientStreamingInterceptors=a;function o(e,t,r){return n(`duplex`,e,t,r)}e.stackDuplexStreamingInterceptors=o})),Ud=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ServerCallContextController=void 0,e.ServerCallContextController=class{constructor(e,t,n,r,i={code:`OK`,detail:``}){this._cancelled=!1,this._listeners=[],this.method=e,this.headers=t,this.deadline=n,this.trailers={},this._sendRH=r,this.status=i}notifyCancelled(){if(!this._cancelled){this._cancelled=!0;for(let e of this._listeners)e()}}sendResponseHeaders(e){this._sendRH(e)}get cancelled(){return this._cancelled}onCancel(e){let t=this._listeners;return t.push(e),()=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}}}})),Wd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Md();Object.defineProperty(e,`ServiceType`,{enumerable:!0,get:function(){return t.ServiceType}});var n=jd();Object.defineProperty(e,`readMethodOptions`,{enumerable:!0,get:function(){return n.readMethodOptions}}),Object.defineProperty(e,`readMethodOption`,{enumerable:!0,get:function(){return n.readMethodOption}}),Object.defineProperty(e,`readServiceOption`,{enumerable:!0,get:function(){return n.readServiceOption}});var r=Nd();Object.defineProperty(e,`RpcError`,{enumerable:!0,get:function(){return r.RpcError}});var i=Pd();Object.defineProperty(e,`mergeRpcOptions`,{enumerable:!0,get:function(){return i.mergeRpcOptions}});var a=Id();Object.defineProperty(e,`RpcOutputStreamController`,{enumerable:!0,get:function(){return a.RpcOutputStreamController}});var o=Vd();Object.defineProperty(e,`TestTransport`,{enumerable:!0,get:function(){return o.TestTransport}});var s=Fd();Object.defineProperty(e,`Deferred`,{enumerable:!0,get:function(){return s.Deferred}}),Object.defineProperty(e,`DeferredState`,{enumerable:!0,get:function(){return s.DeferredState}});var c=Bd();Object.defineProperty(e,`DuplexStreamingCall`,{enumerable:!0,get:function(){return c.DuplexStreamingCall}});var l=zd();Object.defineProperty(e,`ClientStreamingCall`,{enumerable:!0,get:function(){return l.ClientStreamingCall}});var u=Rd();Object.defineProperty(e,`ServerStreamingCall`,{enumerable:!0,get:function(){return u.ServerStreamingCall}});var d=Ld();Object.defineProperty(e,`UnaryCall`,{enumerable:!0,get:function(){return d.UnaryCall}});var f=Hd();Object.defineProperty(e,`stackIntercept`,{enumerable:!0,get:function(){return f.stackIntercept}}),Object.defineProperty(e,`stackDuplexStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackDuplexStreamingInterceptors}}),Object.defineProperty(e,`stackClientStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackClientStreamingInterceptors}}),Object.defineProperty(e,`stackServerStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackServerStreamingInterceptors}}),Object.defineProperty(e,`stackUnaryInterceptors`,{enumerable:!0,get:function(){return f.stackUnaryInterceptors}});var p=Ud();Object.defineProperty(e,`ServerCallContextController`,{enumerable:!0,get:function(){return p.ServerCallContextController}})})),Gd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CacheScope=void 0;let t=Ad(),n=Ad(),r=Ad(),i=Ad(),a=Ad();e.CacheScope=new class extends a.MessageType{constructor(){super(`github.actions.results.entities.v1.CacheScope`,[{no:1,name:`scope`,kind:`scalar`,T:9},{no:2,name:`permission`,kind:`scalar`,T:3}])}create(e){let t={scope:``,permission:`0`};return globalThis.Object.defineProperty(t,i.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,r.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,r,i){let a=i??this.create(),o=e.pos+t;for(;e.pos{Object.defineProperty(e,`__esModule`,{value:!0}),e.CacheMetadata=void 0;let t=Ad(),n=Ad(),r=Ad(),i=Ad(),a=Ad(),o=Gd();e.CacheMetadata=new class extends a.MessageType{constructor(){super(`github.actions.results.entities.v1.CacheMetadata`,[{no:1,name:`repository_id`,kind:`scalar`,T:3},{no:2,name:`scope`,kind:`message`,repeat:1,T:()=>o.CacheScope}])}create(e){let t={repositoryId:`0`,scope:[]};return globalThis.Object.defineProperty(t,i.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,r.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,r,i){let a=i??this.create(),s=e.pos+t;for(;e.pos{Object.defineProperty(e,`__esModule`,{value:!0}),e.CacheService=e.GetCacheEntryDownloadURLResponse=e.GetCacheEntryDownloadURLRequest=e.FinalizeCacheEntryUploadResponse=e.FinalizeCacheEntryUploadRequest=e.CreateCacheEntryResponse=e.CreateCacheEntryRequest=void 0;let t=Wd(),n=Ad(),r=Ad(),i=Ad(),a=Ad(),o=Ad(),s=Kd();e.CreateCacheEntryRequest=new class extends o.MessageType{constructor(){super(`github.actions.results.api.v1.CreateCacheEntryRequest`,[{no:1,name:`metadata`,kind:`message`,T:()=>s.CacheMetadata},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,version:``};return globalThis.Object.defineProperty(t,a.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,i.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,i){let a=i??this.create(),o=e.pos+t;for(;e.poss.CacheMetadata},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`size_bytes`,kind:`scalar`,T:3},{no:4,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,sizeBytes:`0`,version:``};return globalThis.Object.defineProperty(t,a.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,i.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,i){let a=i??this.create(),o=e.pos+t;for(;e.poss.CacheMetadata},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`restore_keys`,kind:`scalar`,repeat:2,T:9},{no:4,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,restoreKeys:[],version:``};return globalThis.Object.defineProperty(t,a.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,i.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,i){let a=i??this.create(),o=e.pos+t;for(;e.pos{Object.defineProperty(e,`__esModule`,{value:!0}),e.CacheServiceClientProtobuf=e.CacheServiceClientJSON=void 0;let t=qd();e.CacheServiceClientJSON=class{constructor(e){this.rpc=e,this.CreateCacheEntry.bind(this),this.FinalizeCacheEntryUpload.bind(this),this.GetCacheEntryDownloadURL.bind(this)}CreateCacheEntry(e){let n=t.CreateCacheEntryRequest.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.CacheService`,`CreateCacheEntry`,`application/json`,n).then(e=>t.CreateCacheEntryResponse.fromJson(e,{ignoreUnknownFields:!0}))}FinalizeCacheEntryUpload(e){let n=t.FinalizeCacheEntryUploadRequest.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.CacheService`,`FinalizeCacheEntryUpload`,`application/json`,n).then(e=>t.FinalizeCacheEntryUploadResponse.fromJson(e,{ignoreUnknownFields:!0}))}GetCacheEntryDownloadURL(e){let n=t.GetCacheEntryDownloadURLRequest.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.CacheService`,`GetCacheEntryDownloadURL`,`application/json`,n).then(e=>t.GetCacheEntryDownloadURLResponse.fromJson(e,{ignoreUnknownFields:!0}))}},e.CacheServiceClientProtobuf=class{constructor(e){this.rpc=e,this.CreateCacheEntry.bind(this),this.FinalizeCacheEntryUpload.bind(this),this.GetCacheEntryDownloadURL.bind(this)}CreateCacheEntry(e){let n=t.CreateCacheEntryRequest.toBinary(e);return this.rpc.request(`github.actions.results.api.v1.CacheService`,`CreateCacheEntry`,`application/protobuf`,n).then(e=>t.CreateCacheEntryResponse.fromBinary(e))}FinalizeCacheEntryUpload(e){let n=t.FinalizeCacheEntryUploadRequest.toBinary(e);return this.rpc.request(`github.actions.results.api.v1.CacheService`,`FinalizeCacheEntryUpload`,`application/protobuf`,n).then(e=>t.FinalizeCacheEntryUploadResponse.fromBinary(e))}GetCacheEntryDownloadURL(e){let n=t.GetCacheEntryDownloadURLRequest.toBinary(e);return this.rpc.request(`github.actions.results.api.v1.CacheService`,`GetCacheEntryDownloadURL`,`application/protobuf`,n).then(e=>t.GetCacheEntryDownloadURLResponse.fromBinary(e))}}})),Yd=b((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.maskSecretUrls=e.maskSigUrl=void 0;let t=At();function n(e){if(e)try{let n=new URL(e).searchParams.get(`sig`);n&&((0,t.setSecret)(n),(0,t.setSecret)(encodeURIComponent(n)))}catch(n){(0,t.debug)(`Failed to parse URL: ${e} ${n instanceof Error?n.message:String(n)}`)}}e.maskSigUrl=n;function r(e){if(typeof e!=`object`||!e){(0,t.debug)(`body is not an object or is null`);return}`signed_upload_url`in e&&typeof e.signed_upload_url==`string`&&n(e.signed_upload_url),`signed_download_url`in e&&typeof e.signed_download_url==`string`&&n(e.signed_download_url)}e.maskSecretUrls=r})),Xd=b((e=>{var t=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.internalCacheTwirpClient=void 0;let n=At(),r=td(),i=qu(),a=$u(),o=va(),s=xt(),c=bt(),l=Jd(),u=Yd();var d=class{constructor(e,t,n,r){this.maxAttempts=5,this.baseRetryIntervalMilliseconds=3e3,this.retryMultiplier=1.5;let i=(0,o.getRuntimeToken)();this.baseUrl=(0,a.getCacheServiceURL)(),t&&(this.maxAttempts=t),n&&(this.baseRetryIntervalMilliseconds=n),r&&(this.retryMultiplier=r),this.httpClient=new c.HttpClient(e,[new s.BearerCredentialHandler(i)])}request(e,r,i,a){return t(this,void 0,void 0,function*(){let o=new URL(`/twirp/${e}/${r}`,this.baseUrl).href;(0,n.debug)(`[Request] ${r} ${o}`);let s={"Content-Type":i};try{let{body:e}=yield this.retryableRequest(()=>t(this,void 0,void 0,function*(){return this.httpClient.post(o,JSON.stringify(a),s)}));return e}catch(e){throw Error(`Failed to ${r}: ${e.message}`)}})}retryableRequest(e){return t(this,void 0,void 0,function*(){let t=0,r=``,a=``;for(;t=200&&e<300:!1}isRetryableHttpStatusCode(e){return e?[c.HttpCodes.BadGateway,c.HttpCodes.GatewayTimeout,c.HttpCodes.InternalServerError,c.HttpCodes.ServiceUnavailable,c.HttpCodes.TooManyRequests].includes(e):!1}sleep(e){return t(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}getExponentialRetryTimeMilliseconds(e){if(e<0)throw Error(`attempt should be a positive integer`);if(e===0)return this.baseRetryIntervalMilliseconds;let t=this.baseRetryIntervalMilliseconds*this.retryMultiplier**+e,n=t*this.retryMultiplier;return Math.trunc(Math.random()*(n-t)+t)}};function f(e){let t=new d((0,r.getUserAgentString)(),e?.maxAttempts,e?.retryIntervalMs,e?.retryMultiplier);return new l.CacheServiceClientJSON(t)}e.internalCacheTwirpClient=f})),Zd=b((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||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())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.createTar=e.extractTar=e.listTar=void 0;let a=Ot(),o=r(Et()),s=w(`fs`),c=r(w(`path`)),l=r(va()),u=_a(),d=process.platform===`win32`;function f(){return i(this,void 0,void 0,function*(){switch(process.platform){case`win32`:{let e=yield l.getGnuTarPathOnWindows(),t=u.SystemTarPathOnWindows;if(e)return{path:e,type:u.ArchiveToolType.GNU};if((0,s.existsSync)(t))return{path:t,type:u.ArchiveToolType.BSD};break}case`darwin`:{let e=yield o.which(`gtar`,!1);return e?{path:e,type:u.ArchiveToolType.GNU}:{path:yield o.which(`tar`,!0),type:u.ArchiveToolType.BSD}}default:break}return{path:yield o.which(`tar`,!0),type:u.ArchiveToolType.GNU}})}function p(e,t,n,r=``){return i(this,void 0,void 0,function*(){let i=[`"${e.path}"`],a=l.getCacheFileName(t),o=`cache.tar`,s=h(),f=e.type===u.ArchiveToolType.BSD&&t!==u.CompressionMethod.Gzip&&d;switch(n){case`create`:i.push(`--posix`,`-cf`,f?o:a.replace(RegExp(`\\${c.sep}`,`g`),`/`),`--exclude`,f?o:a.replace(RegExp(`\\${c.sep}`,`g`),`/`),`-P`,`-C`,s.replace(RegExp(`\\${c.sep}`,`g`),`/`),`--files-from`,u.ManifestFilename);break;case`extract`:i.push(`-xf`,f?o:r.replace(RegExp(`\\${c.sep}`,`g`),`/`),`-P`,`-C`,s.replace(RegExp(`\\${c.sep}`,`g`),`/`));break;case`list`:i.push(`-tf`,f?o:r.replace(RegExp(`\\${c.sep}`,`g`),`/`),`-P`);break}if(e.type===u.ArchiveToolType.GNU)switch(process.platform){case`win32`:i.push(`--force-local`);break;case`darwin`:i.push(`--delay-directory-restore`);break}return i})}function m(e,t,n=``){return i(this,void 0,void 0,function*(){let r,i=yield f(),a=yield p(i,e,t,n),o=t===`create`?yield _(i,e):yield g(i,e,n),s=i.type===u.ArchiveToolType.BSD&&e!==u.CompressionMethod.Gzip&&d;return r=s&&t!==`create`?[[...o].join(` `),[...a].join(` `)]:[[...a].join(` `),[...o].join(` `)],s?r:[r.join(` `)]})}function h(){return process.env.GITHUB_WORKSPACE??process.cwd()}function g(e,t,n){return i(this,void 0,void 0,function*(){let r=e.type===u.ArchiveToolType.BSD&&t!==u.CompressionMethod.Gzip&&d;switch(t){case u.CompressionMethod.Zstd:return r?[`zstd -d --long=30 --force -o`,u.TarFilename,n.replace(RegExp(`\\${c.sep}`,`g`),`/`)]:[`--use-compress-program`,d?`"zstd -d --long=30"`:`unzstd --long=30`];case u.CompressionMethod.ZstdWithoutLong:return r?[`zstd -d --force -o`,u.TarFilename,n.replace(RegExp(`\\${c.sep}`,`g`),`/`)]:[`--use-compress-program`,d?`"zstd -d"`:`unzstd`];default:return[`-z`]}})}function _(e,t){return i(this,void 0,void 0,function*(){let n=l.getCacheFileName(t),r=e.type===u.ArchiveToolType.BSD&&t!==u.CompressionMethod.Gzip&&d;switch(t){case u.CompressionMethod.Zstd:return r?[`zstd -T0 --long=30 --force -o`,n.replace(RegExp(`\\${c.sep}`,`g`),`/`),u.TarFilename]:[`--use-compress-program`,d?`"zstd -T0 --long=30"`:`zstdmt --long=30`];case u.CompressionMethod.ZstdWithoutLong:return r?[`zstd -T0 --force -o`,n.replace(RegExp(`\\${c.sep}`,`g`),`/`),u.TarFilename]:[`--use-compress-program`,d?`"zstd -T0"`:`zstdmt`];default:return[`-z`]}})}function v(e,t){return i(this,void 0,void 0,function*(){for(let n of e)try{yield(0,a.exec)(n,void 0,{cwd:t,env:Object.assign(Object.assign({},process.env),{MSYS:`winsymlinks:nativestrict`})})}catch(e){throw Error(`${n.split(` `)[0]} failed with error: ${e?.message}`)}})}function y(e,t){return i(this,void 0,void 0,function*(){yield v(yield m(t,`list`,e))})}e.listTar=y;function b(e,t){return i(this,void 0,void 0,function*(){let n=h();yield o.mkdirP(n),yield v(yield m(t,`extract`,e))})}e.extractTar=b;function x(e,t,n){return i(this,void 0,void 0,function*(){(0,s.writeFileSync)(c.join(e,u.ManifestFilename),t.join(` @@ -198,7 +198,7 @@ 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[T]&&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 ye(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[U]()}catch(t){e(t)}}async function be(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[U]()}catch(t){e(t)}}async function xe(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[M]?t(a[M]):l=e});a.on(`close`,u).on(`drain`,u);let f=new Se({abort:e,socket:a,request:i,contentLength:o,client:r,expectsPayload:c,header:s});try{for await(let e of t){if(a[M])throw a[M];f.write(e)||await d()}f.end()}catch(e){f.destroy(e)}finally{a.off(`close`,u).off(`drain`,u)}}var Se=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[T]=!0}write(e){let{socket:t,request:n,contentLength:r,client:i,bytesWritten:a,expectsPayload:s,header:c}=this;if(t[M])throw t[M];if(t.destroyed)return!1;let l=Buffer.byteLength(e);if(!l)return!0;if(r!==null&&a+l>r){if(i[V])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[T]=!1,e[M])throw e[M];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[V])throw new o;process.emitWarning(new o)}e[y].timeout&&e[y].timeoutType===3&&e[y].timeout.refresh&&e[y].timeout.refresh(),n[U]()}}destroy(e){let{socket:t,client:r,abort:i}=this;t[T]=!1,e&&(n(r[x]<=1,`pipeline should only contain this request`),i(e))}};t.exports=me})),Af=b(((e,t)=>{let n=w(`node:assert`),{pipeline:r}=w(`node:stream`),i=cf(),{RequestContentLengthMismatchError:a,RequestAbortedError:o,SocketError:s,InformationalError:c}=af(),{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:T,kHTTPContext:E}=rf(),D=Symbol(`open streams`),O,k=!1,A;try{A=w(`node:http2`)}catch{A={constants:{}}}let{constants:{HTTP2_HEADER_AUTHORITY:j,HTTP2_HEADER_METHOD:M,HTTP2_HEADER_PATH:N,HTTP2_HEADER_SCHEME:P,HTTP2_HEADER_CONTENT_LENGTH:F,HTTP2_HEADER_EXPECT:I,HTTP2_HEADER_STATUS:L}}=A;function R(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 z(e,t){e[v]=t,k||(k=!0,process.emitWarning(`H2 support is experimental, expect them to change at any time.`,{code:`UNDICI-H2`}));let r=A.connect(e[l],{createConnection:()=>t,peerMaxConcurrentStreams:e[x]});r[D]=0,r[d]=e,r[v]=t,i.addListener(r,`error`,V),i.addListener(r,`frameError`,ee),i.addListener(r,`end`,te),i.addListener(r,`goaway`,ne),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 U(e,...t)},resume(){B(e)},destroy(e,n){a?queueMicrotask(n):t.destroy(e).on(`close`,n)},get destroyed(){return t.destroyed},busy(){return!1}}}function B(e){let t=e[v];t?.destroyed===!1&&(e[T]===0&&e[x]===0?(t.unref(),e[S].unref()):(t.ref(),e[S].ref()))}function V(e){n(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`),this[v][_]=e,this[d][b](e)}function ee(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 te(){let e=new s(`other side closed`,i.getSocketInfo(this[v]));this.destroy(e),i.destroy(this[v],e)}function ne(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[E]=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(A)}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[D],e[m][e[g]++]=null):T.once(`ready`,()=>{t.onUpgrade(null,null,T),++r[D],e[m][e[g]++]=null}),T.once(`close`,()=>{--r[D],r[D]===0&&r.unref()}),!0;w[N]=u,w[P]=`https`;let z=s===`PUT`||s===`POST`||s===`PATCH`;x&&typeof x.read==`function`&&x.read(0);let B=i.bodyLength(x);if(i.isFormDataLike(x)){O??=Of().extractBody;let[e,t]=O(x);w[`content-type`]=t,x=e.stream,B=e.length}if(B??=t.contentLength,(B===0||!z)&&(B=null),H(s)&&B>0&&t.contentLength!=null&&t.contentLength!==B){if(e[y])return i.errorRequest(e,t,new a),!1;process.emitWarning(new a)}B!=null&&(n(x,`no body must not have content length`),w[F]=`${B}`),r.ref();let V=s===`GET`||s===`HEAD`||x===null;return p?(w[I]=`100-continue`,T=r.request(w,{endStream:V,signal:_}),T.once(`continue`,ee)):(T=r.request(w,{endStream:V,signal:_}),ee()),++r[D],T.once(`response`,n=>{let{[L]: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),R(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[D]===0&&r.unref(),A(new c(`HTTP/2: stream half-closed (remote)`)),e[m][e[g]++]=null,e[h]=e[g],e[C]()}),T.once(`close`,()=>{--r[D],r[D]===0&&r.unref()}),T.once(`error`,function(e){A(e)}),T.once(`frameError`,(e,t)=>{A(new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`))}),!0;function ee(){!x||B===0?W(A,T,null,e,t,e[v],B,z):i.isBuffer(x)?W(A,T,x,e,t,e[v],B,z):i.isBlobLike(x)?typeof x.stream==`function`?re(A,T,x.stream(),e,t,e[v],B,z):K(A,T,x,e,t,e[v],B,z):i.isStream(x)?G(A,e[v],z,T,x,e,t,B):i.isIterable(x)?re(A,T,x,e,t,e[v],B,z):n(!1)}}function W(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 G(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 K(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 re(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=z})),jf=b(((e,t)=>{let n=cf(),{kBodyUsed:r}=rf(),i=w(`node:assert`),{InvalidArgumentError:a}=af(),o=w(`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=jf();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})),Nf=b(((e,t)=>{let n=w(`node:assert`),r=w(`node:net`),i=w(`node:http`),a=cf(),{channels:o}=lf(),s=uf(),c=ff(),{InvalidArgumentError:l,InformationalError:u,ClientDestroyedError:d}=af(),f=mf(),{kUrl:p,kServerName:m,kClient:h,kBusy:g,kConnect:_,kResuming:v,kRunning:y,kPending:b,kSize:x,kQueue:S,kConnected:C,kConnecting:T,kNeedDrain:E,kKeepAliveDefaultTimeout:D,kHostHeader:O,kPendingIdx:k,kRunningIdx:A,kError:j,kPipelining:M,kKeepAliveTimeoutValue:N,kMaxHeadersSize:P,kKeepAliveMaxTimeout:F,kKeepAliveTimeoutThreshold:I,kHeadersTimeout:L,kBodyTimeout:R,kStrictContentLength:z,kConnector:B,kMaxRedirections:V,kMaxRequests:ee,kCounter:te,kClose:ne,kDestroy:H,kDispatch:U,kInterceptors:W,kLocalAddress:G,kMaxResponseSize:K,kOnError:re,kHTTPContext:q,kMaxConcurrentStreams:J,kResume:ie}=rf(),ae=kf(),oe=Af(),se=!1,ce=Symbol(`kClosedResolve`),le=()=>{};function ue(e){return e[M]??e[q]?.defaultPipelining??1}var de=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:T,strictContentLength:j,maxCachedSessions:te,maxRedirections:ne,connect:H,maxRequestsPerClient:U,localAddress:ae,maxResponseSize:oe,autoSelectFamily:le,autoSelectFamilyAttemptTimeout:ue,maxConcurrentStreams:de,allowH2:me}={}){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(H!=null&&typeof H!=`function`&&typeof H!=`object`)throw new l(`connect must be a function or an object`);if(ne!=null&&(!Number.isInteger(ne)||ne<0))throw new l(`maxRedirections must be a positive number`);if(U!=null&&(!Number.isInteger(U)||U<0))throw new l(`maxRequestsPerClient must be a positive number`);if(ae!=null&&(typeof ae!=`string`||r.isIP(ae)===0))throw new l(`localAddress must be valid string IP address`);if(oe!=null&&(!Number.isInteger(oe)||oe<-1))throw new l(`maxResponseSize must be a positive number`);if(ue!=null&&(!Number.isInteger(ue)||ue<-1))throw new l(`autoSelectFamilyAttemptTimeout must be a positive number`);if(me!=null&&typeof me!=`boolean`)throw new l(`allowH2 must be a valid boolean value`);if(de!=null&&(typeof de!=`number`||de<1))throw new l(`maxConcurrentStreams must be a positive integer, greater than 0`);typeof H!=`function`&&(H=f({...T,maxCachedSessions:te,allowH2:me,socketPath:C,timeout:u,...le?{autoSelectFamily:le,autoSelectFamilyAttemptTimeout:ue}:void 0,...H})),t?.Client&&Array.isArray(t.Client)?(this[W]=t.Client,se||(se=!0,process.emitWarning(`Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.`,{code:`UNDICI-CLIENT-INTERCEPTOR-DEPRECATED`}))):this[W]=[fe({maxRedirections:ne})],this[p]=a.parseOrigin(e),this[B]=H,this[M]=w??1,this[P]=n||i.maxHeaderSize,this[D]=_??4e3,this[F]=b??6e5,this[I]=x??2e3,this[N]=this[D],this[m]=null,this[G]=ae??null,this[v]=0,this[E]=0,this[O]=`host: ${this[p].hostname}${this[p].port?`:${this[p].port}`:``}\r\n`,this[R]=d??3e5,this[L]=o??3e5,this[z]=j??!0,this[V]=ne,this[ee]=U,this[ce]=null,this[K]=oe>-1?oe:-1,this[J]=de??100,this[q]=null,this[S]=[],this[A]=0,this[k]=0,this[ie]=e=>ge(this,e),this[re]=e=>pe(this,e)}get pipelining(){return this[M]}set pipelining(e){this[M]=e,this[ie](!0)}get[b](){return this[S].length-this[k]}get[y](){return this[k]-this[A]}get[x](){return this[S].length-this[A]}get[C](){return!!this[q]&&!this[T]&&!this[q].destroyed}get[g](){return!!(this[q]?.busy(null)||this[x]>=(ue(this)||1)||this[b]>0)}[_](e){me(this),this.once(`connect`,e)}[U](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(()=>ge(this))):this[ie](!0)),this[v]&&this[E]!==2&&this[g]&&(this[E]=2),this[E]<2}async[ne](){return new Promise(e=>{this[x]?this[ce]=e:e(null)})}async[H](e){return new Promise(t=>{let n=this[S].splice(this[k]);for(let t=0;t{this[ce]&&(this[ce](),this[ce]=null),t(null)};this[q]?(this[q].destroy(e,r),this[q]=null):queueMicrotask(r),this[ie]()})}};let fe=Mf();function pe(e,t){if(e[y]===0&&t.code!==`UND_ERR_INFO`&&t.code!==`UND_ERR_SOCKET`){n(e[k]===e[A]);let r=e[S].splice(e[A]);for(let n=0;n{e[B]({host:t,hostname:i,protocol:s,port:c,servername:e[m],localAddress:e[G]},(e,t)=>{e?r(e):n(t)})});if(e.destroyed){a.destroy(r.on(`error`,le),new d);return}n(r);try{e[q]=r.alpnProtocol===`h2`?await oe(e,r):await ae(e,r)}catch(e){throw r.destroy().on(`error`,le),e}e[T]=!1,r[te]=0,r[ee]=e[ee],r[h]=e,r[j]=null,o.connected.hasSubscribers&&o.connected.publish({connectParams:{host:t,hostname:i,protocol:s,port:c,version:e[q]?.version,servername:e[m],localAddress:e[G]},connector:e[B],socket:r}),e.emit(`connect`,e[p],[e])}catch(r){if(e.destroyed)return;if(e[T]=!1,o.connectError.hasSubscribers&&o.connectError.publish({connectParams:{host:t,hostname:i,protocol:s,port:c,version:e[q]?.version,servername:e[m],localAddress:e[G]},connector:e[B],error:r}),r.code===`ERR_TLS_CERT_ALTNAME_INVALID`)for(n(e[y]===0);e[b]>0&&e[S][e[k]].servername===e[m];){let t=e[S][e[k]++];a.errorRequest(e,t,r)}else pe(e,r);e.emit(`connectionError`,e[p],[e],r)}e[ie]()}function he(e){e[E]=0,e.emit(`drain`,e[p],[e])}function ge(e,t){e[v]!==2&&(e[v]=2,_e(e,t),e[v]=0,e[A]>256&&(e[S].splice(0,e[A]),e[k]-=e[A],e[A]=0))}function _e(e,t){for(;;){if(e.destroyed){n(e[b]===0);return}if(e[ce]&&!e[x]){e[ce](),e[ce]=null;return}if(e[q]&&e[q].resume(),e[g])e[E]=2;else if(e[E]===2){t?(e[E]=1,queueMicrotask(()=>he(e))):he(e);continue}if(e[b]===0||e[y]>=(ue(e)||1))return;let r=e[S][e[k]];if(e[p].protocol===`https:`&&e[m]!==r.servername){if(e[y]>0)return;e[m]=r.servername,e[q]?.destroy(new u(`servername changed`),()=>{e[q]=null,ge(e)})}if(e[T])return;if(!e[q]){me(e);return}if(e[q].destroyed||e[q].busy(r))return;!r.aborted&&e[q].write(r)?e[k]++:e[S].splice(e[k],1)}}t.exports=de})),Pf=b(((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}}})),Ff=b(((e,t)=>{let{kFree:n,kConnected:r,kPending:i,kQueued:a,kRunning:o,kSize:s}=rf(),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]}}})),If=b(((e,t)=>{let n=ff(),r=Pf(),{kConnected:i,kSize:a,kRunning:o,kPending:s,kQueued:c,kBusy:l,kFree:u,kUrl:d,kClose:f,kDestroy:p,kDispatch:m}=rf(),h=Ff(),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}})),Lf=b(((e,t)=>{let{PoolBase:n,kClients:r,kNeedDrain:i,kAddClient:a,kGetDispatcher:o}=If(),s=Nf(),{InvalidArgumentError:c}=af(),l=cf(),{kUrl:u,kInterceptors:d}=rf(),f=mf(),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}=af(),{PoolBase:i,kClients:a,kNeedDrain:o,kAddClient:s,kRemoveClient:c,kGetDispatcher:l}=If(),u=Lf(),{kUrl:d,kInterceptors:f}=rf(),{parseOrigin:p}=cf(),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]}}})),zf=b(((e,t)=>{let{InvalidArgumentError:n}=af(),{kClients:r,kRunning:i,kClose:a,kDestroy:o,kDispatch:s,kInterceptors:c}=rf(),l=ff(),u=Lf(),d=Nf(),f=cf(),p=Mf(),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)}}})),Bf=b(((e,t)=>{let{kProxy:n,kClose:r,kDestroy:i,kDispatch:a,kInterceptors:o}=rf(),{URL:s}=w(`node:url`),c=zf(),l=Lf(),u=ff(),{InvalidArgumentError:d,RequestAbortedError:f,SecureProxyConnectionError:p}=af(),m=mf(),h=Nf(),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 T(e,t){return new l(e,t)}let E=()=>{};function D(e,t){return t.connections===1?new h(e,t):new l(e,t)}var O=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)}},k=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=T}=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:w,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:w&&k&&(this[v][`proxy-authorization`]=`Basic ${Buffer.from(`${decodeURIComponent(w)}:${decodeURIComponent(k)}`).toString(`base64`)}`);let j=m({...e.proxyTls});this[x]=m({...e.requestTls});let M=e.factory||D,N=(e,t)=>{let{protocol:r}=new s(e);return!this[S]&&r===`http:`&&this[n].protocol===`http:`?new O(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`,E).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=A(e.headers);if(j(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 A(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=k})),Vf=b(((e,t)=>{let n=ff(),{kClose:r,kDestroy:i,kClosed:a,kDestroyed:o,kDispatch:s,kNoProxyAgent:c,kHttpProxyAgent:l,kHttpsProxyAgent:u}=rf(),d=Bf(),f=zf(),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=w(`node:assert`),{kRetryHandlerDefaultRetry:r}=rf(),{RequestRetryError:i}=af(),{isDisturbed:a,parseHeaders:o,parseRangeHeader:s,wrapRequestBody:c}=cf();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)}}}}})),Uf=b(((e,t)=>{let n=df(),r=Hf();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()}}})),Wf=b(((e,t)=>{let n=w(`node:assert`),{Readable:r}=w(`node:stream`),{RequestAbortedError:i,NotSupportedError:a,InvalidArgumentError:o,AbortError:s}=af(),c=cf(),{ReadableStreamFrom:l}=cf(),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?(E(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){D(this[u],e)}).on(`close`,function(){this[u].body!==null&&D(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=w(`node:assert`),{ResponseStatusCodeError:r}=af(),{chunksDecode:i}=Wf();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}})),Kf=b(((e,t)=>{let n=w(`node:assert`),{Readable:r}=Wf(),{InvalidArgumentError:i,RequestAbortedError:a}=af(),o=cf(),{getResolveErrorBodyCallback:s}=Gf(),{AsyncResource:c}=w(`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})),qf=b(((e,t)=>{let{addAbortListener:n}=cf(),{RequestAbortedError:r}=af(),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}})),Jf=b(((e,t)=>{let n=w(`node:assert`),{finished:r,PassThrough:i}=w(`node:stream`),{InvalidArgumentError:a,InvalidReturnValueError:o}=af(),s=cf(),{getResolveErrorBodyCallback:c}=Gf(),{AsyncResource:l}=w(`node:async_hooks`),{addSignal:u,removeSignal:d}=qf();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})),Yf=b(((e,t)=>{let{Readable:n,Duplex:r,PassThrough:i}=w(`node:stream`),{InvalidArgumentError:a,InvalidReturnValueError:o,RequestAbortedError:s}=af(),c=cf(),{AsyncResource:l}=w(`node:async_hooks`),{addSignal:u,removeSignal:d}=qf(),f=w(`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=_})),Xf=b(((e,t)=>{let{InvalidArgumentError:n,SocketError:r}=af(),{AsyncResource:i}=w(`node:async_hooks`),a=cf(),{addSignal:o,removeSignal:s}=qf(),c=w(`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})),Zf=b(((e,t)=>{let n=w(`node:assert`),{AsyncResource:r}=w(`node:async_hooks`),{InvalidArgumentError:i,SocketError:a}=af(),o=cf(),{addSignal:s,removeSignal:c}=qf();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})),Qf=b(((e,t)=>{t.exports.request=Kf(),t.exports.stream=Jf(),t.exports.pipeline=Yf(),t.exports.upgrade=Xf(),t.exports.connect=Zf()})),$f=b(((e,t)=>{let{UndiciError:n}=af(),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}}})),ep=b(((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`)}})),tp=b(((e,t)=>{let{MockNotMatchedError:n}=$f(),{kDispatches:r,kMockAgent:i,kOriginalDispatch:a,kOrigin:o,kGetNetConnect:s}=ep(),{buildURL:c}=cf(),{STATUS_CODES:l}=w(`node:http`),{types:{isPromise:u}}=w(`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,_,T(a)),t.onData?.(Buffer.from(f)),t.onComplete?.(h),x(r,n)}function _(){}return!0}function O(){let e=this[i],t=this[o],r=this[a];return function(i,a){if(e.isMockActive)try{D.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(k(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 k(e,t){let n=new URL(t);return e===!0?!0:!!(Array.isArray(e)&&e.some(e=>d(e,n.host)))}function A(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:E,getStatusText:T,mockDispatch:D,buildMockDispatch:O,checkNetConnect:k,buildMockOptions:A,getHeaderByName:p,buildHeadersFromArray:m}})),np=b(((e,t)=>{let{getResponseData:n,buildKey:r,addMockDispatch:i}=tp(),{kDispatches:a,kDispatchKey:o,kDefaultHeaders:s,kDefaultTrailers:c,kContentLength:l,kMockDispatch:u}=ep(),{InvalidArgumentError:d}=af(),{buildURL:f}=cf();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})),rp=b(((e,t)=>{let{promisify:n}=w(`node:util`),r=Nf(),{buildMockDispatch:i}=tp(),{kDispatches:a,kMockAgent:o,kClose:s,kOriginalClose:c,kOrigin:l,kOriginalDispatch:u,kConnected:d}=ep(),{MockInterceptor:f}=np(),p=rf(),{InvalidArgumentError:m}=af();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])}}})),ip=b(((e,t)=>{let{promisify:n}=w(`node:util`),r=Lf(),{buildMockDispatch:i}=tp(),{kDispatches:a,kMockAgent:o,kClose:s,kOriginalClose:c,kOrigin:l,kOriginalDispatch:u,kConnected:d}=ep(),{MockInterceptor:f}=np(),p=rf(),{InvalidArgumentError:m}=af();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])}}})),ap=b(((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}}}})),op=b(((e,t)=>{let{Transform:n}=w(`node:stream`),{Console:r}=w(`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()}}})),sp=b(((e,t)=>{let{kClients:n}=rf(),r=zf(),{kAgent:i,kMockAgentSet:a,kMockAgentGet:o,kDispatches:s,kIsMockActive:c,kNetConnect:l,kGetNetConnect:u,kOptions:d,kFactory:f}=ep(),p=rp(),m=ip(),{matchValue:h,buildMockOptions:g}=tp(),{InvalidArgumentError:_,UndiciError:v}=af(),y=df(),b=ap(),x=op();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[V])throw new o;process.emitWarning(new o)}e[y].timeout&&e[y].timeoutType===3&&e[y].timeout.refresh&&e[y].timeout.refresh(),n[U]()}}destroy(e){let{socket:t,client:r,abort:i}=this;t[T]=!1,e&&(n(r[x]<=1,`pipeline should only contain this request`),i(e))}};t.exports=me})),Af=b(((e,t)=>{let n=w(`node:assert`),{pipeline:r}=w(`node:stream`),i=cf(),{RequestContentLengthMismatchError:a,RequestAbortedError:o,SocketError:s,InformationalError:c}=af(),{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:T,kHTTPContext:E}=rf(),D=Symbol(`open streams`),O,k=!1,A;try{A=w(`node:http2`)}catch{A={constants:{}}}let{constants:{HTTP2_HEADER_AUTHORITY:j,HTTP2_HEADER_METHOD:M,HTTP2_HEADER_PATH:N,HTTP2_HEADER_SCHEME:P,HTTP2_HEADER_CONTENT_LENGTH:F,HTTP2_HEADER_EXPECT:I,HTTP2_HEADER_STATUS:L}}=A;function R(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 z(e,t){e[v]=t,k||(k=!0,process.emitWarning(`H2 support is experimental, expect them to change at any time.`,{code:`UNDICI-H2`}));let r=A.connect(e[l],{createConnection:()=>t,peerMaxConcurrentStreams:e[x]});r[D]=0,r[d]=e,r[v]=t,i.addListener(r,`error`,V),i.addListener(r,`frameError`,ee),i.addListener(r,`end`,te),i.addListener(r,`goaway`,ne),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 U(e,...t)},resume(){B(e)},destroy(e,n){a?queueMicrotask(n):t.destroy(e).on(`close`,n)},get destroyed(){return t.destroyed},busy(){return!1}}}function B(e){let t=e[v];t?.destroyed===!1&&(e[T]===0&&e[x]===0?(t.unref(),e[S].unref()):(t.ref(),e[S].ref()))}function V(e){n(e.code!==`ERR_TLS_CERT_ALTNAME_INVALID`),this[v][_]=e,this[d][b](e)}function ee(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 te(){let e=new s(`other side closed`,i.getSocketInfo(this[v]));this.destroy(e),i.destroy(this[v],e)}function ne(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[E]=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(A)}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[D],e[m][e[g]++]=null):T.once(`ready`,()=>{t.onUpgrade(null,null,T),++r[D],e[m][e[g]++]=null}),T.once(`close`,()=>{--r[D],r[D]===0&&r.unref()}),!0;w[N]=u,w[P]=`https`;let z=s===`PUT`||s===`POST`||s===`PATCH`;x&&typeof x.read==`function`&&x.read(0);let B=i.bodyLength(x);if(i.isFormDataLike(x)){O??=Of().extractBody;let[e,t]=O(x);w[`content-type`]=t,x=e.stream,B=e.length}if(B??=t.contentLength,(B===0||!z)&&(B=null),H(s)&&B>0&&t.contentLength!=null&&t.contentLength!==B){if(e[y])return i.errorRequest(e,t,new a),!1;process.emitWarning(new a)}B!=null&&(n(x,`no body must not have content length`),w[F]=`${B}`),r.ref();let V=s===`GET`||s===`HEAD`||x===null;return p?(w[I]=`100-continue`,T=r.request(w,{endStream:V,signal:_}),T.once(`continue`,ee)):(T=r.request(w,{endStream:V,signal:_}),ee()),++r[D],T.once(`response`,n=>{let{[L]: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),R(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[D]===0&&r.unref(),A(new c(`HTTP/2: stream half-closed (remote)`)),e[m][e[g]++]=null,e[h]=e[g],e[C]()}),T.once(`close`,()=>{--r[D],r[D]===0&&r.unref()}),T.once(`error`,function(e){A(e)}),T.once(`frameError`,(e,t)=>{A(new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`))}),!0;function ee(){!x||B===0?W(A,T,null,e,t,e[v],B,z):i.isBuffer(x)?W(A,T,x,e,t,e[v],B,z):i.isBlobLike(x)?typeof x.stream==`function`?re(A,T,x.stream(),e,t,e[v],B,z):K(A,T,x,e,t,e[v],B,z):i.isStream(x)?G(A,e[v],z,T,x,e,t,B):i.isIterable(x)?re(A,T,x,e,t,e[v],B,z):n(!1)}}function W(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 G(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 K(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 re(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=z})),jf=b(((e,t)=>{let n=cf(),{kBodyUsed:r}=rf(),i=w(`node:assert`),{InvalidArgumentError:a}=af(),o=w(`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=jf();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})),Nf=b(((e,t)=>{let n=w(`node:assert`),r=w(`node:net`),i=w(`node:http`),a=cf(),{channels:o}=lf(),s=uf(),c=ff(),{InvalidArgumentError:l,InformationalError:u,ClientDestroyedError:d}=af(),f=mf(),{kUrl:p,kServerName:m,kClient:h,kBusy:g,kConnect:_,kResuming:v,kRunning:y,kPending:b,kSize:x,kQueue:S,kConnected:C,kConnecting:T,kNeedDrain:E,kKeepAliveDefaultTimeout:D,kHostHeader:O,kPendingIdx:k,kRunningIdx:A,kError:j,kPipelining:M,kKeepAliveTimeoutValue:N,kMaxHeadersSize:P,kKeepAliveMaxTimeout:F,kKeepAliveTimeoutThreshold:I,kHeadersTimeout:L,kBodyTimeout:R,kStrictContentLength:z,kConnector:B,kMaxRedirections:V,kMaxRequests:ee,kCounter:te,kClose:ne,kDestroy:H,kDispatch:U,kInterceptors:W,kLocalAddress:G,kMaxResponseSize:K,kOnError:re,kHTTPContext:q,kMaxConcurrentStreams:J,kResume:ie}=rf(),ae=kf(),oe=Af(),se=!1,ce=Symbol(`kClosedResolve`),le=()=>{};function ue(e){return e[M]??e[q]?.defaultPipelining??1}var de=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:T,strictContentLength:j,maxCachedSessions:te,maxRedirections:ne,connect:H,maxRequestsPerClient:U,localAddress:ae,maxResponseSize:oe,autoSelectFamily:le,autoSelectFamilyAttemptTimeout:ue,maxConcurrentStreams:de,allowH2:me}={}){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(H!=null&&typeof H!=`function`&&typeof H!=`object`)throw new l(`connect must be a function or an object`);if(ne!=null&&(!Number.isInteger(ne)||ne<0))throw new l(`maxRedirections must be a positive number`);if(U!=null&&(!Number.isInteger(U)||U<0))throw new l(`maxRequestsPerClient must be a positive number`);if(ae!=null&&(typeof ae!=`string`||r.isIP(ae)===0))throw new l(`localAddress must be valid string IP address`);if(oe!=null&&(!Number.isInteger(oe)||oe<-1))throw new l(`maxResponseSize must be a positive number`);if(ue!=null&&(!Number.isInteger(ue)||ue<-1))throw new l(`autoSelectFamilyAttemptTimeout must be a positive number`);if(me!=null&&typeof me!=`boolean`)throw new l(`allowH2 must be a valid boolean value`);if(de!=null&&(typeof de!=`number`||de<1))throw new l(`maxConcurrentStreams must be a positive integer, greater than 0`);typeof H!=`function`&&(H=f({...T,maxCachedSessions:te,allowH2:me,socketPath:C,timeout:u,...le?{autoSelectFamily:le,autoSelectFamilyAttemptTimeout:ue}:void 0,...H})),t?.Client&&Array.isArray(t.Client)?(this[W]=t.Client,se||(se=!0,process.emitWarning(`Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.`,{code:`UNDICI-CLIENT-INTERCEPTOR-DEPRECATED`}))):this[W]=[fe({maxRedirections:ne})],this[p]=a.parseOrigin(e),this[B]=H,this[M]=w??1,this[P]=n||i.maxHeaderSize,this[D]=_??4e3,this[F]=b??6e5,this[I]=x??2e3,this[N]=this[D],this[m]=null,this[G]=ae??null,this[v]=0,this[E]=0,this[O]=`host: ${this[p].hostname}${this[p].port?`:${this[p].port}`:``}\r\n`,this[R]=d??3e5,this[L]=o??3e5,this[z]=j??!0,this[V]=ne,this[ee]=U,this[ce]=null,this[K]=oe>-1?oe:-1,this[J]=de??100,this[q]=null,this[S]=[],this[A]=0,this[k]=0,this[ie]=e=>ge(this,e),this[re]=e=>pe(this,e)}get pipelining(){return this[M]}set pipelining(e){this[M]=e,this[ie](!0)}get[b](){return this[S].length-this[k]}get[y](){return this[k]-this[A]}get[x](){return this[S].length-this[A]}get[C](){return!!this[q]&&!this[T]&&!this[q].destroyed}get[g](){return!!(this[q]?.busy(null)||this[x]>=(ue(this)||1)||this[b]>0)}[_](e){me(this),this.once(`connect`,e)}[U](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(()=>ge(this))):this[ie](!0)),this[v]&&this[E]!==2&&this[g]&&(this[E]=2),this[E]<2}async[ne](){return new Promise(e=>{this[x]?this[ce]=e:e(null)})}async[H](e){return new Promise(t=>{let n=this[S].splice(this[k]);for(let t=0;t{this[ce]&&(this[ce](),this[ce]=null),t(null)};this[q]?(this[q].destroy(e,r),this[q]=null):queueMicrotask(r),this[ie]()})}};let fe=Mf();function pe(e,t){if(e[y]===0&&t.code!==`UND_ERR_INFO`&&t.code!==`UND_ERR_SOCKET`){n(e[k]===e[A]);let r=e[S].splice(e[A]);for(let n=0;n{e[B]({host:t,hostname:i,protocol:s,port:c,servername:e[m],localAddress:e[G]},(e,t)=>{e?r(e):n(t)})});if(e.destroyed){a.destroy(r.on(`error`,le),new d);return}n(r);try{e[q]=r.alpnProtocol===`h2`?await oe(e,r):await ae(e,r)}catch(e){throw r.destroy().on(`error`,le),e}e[T]=!1,r[te]=0,r[ee]=e[ee],r[h]=e,r[j]=null,o.connected.hasSubscribers&&o.connected.publish({connectParams:{host:t,hostname:i,protocol:s,port:c,version:e[q]?.version,servername:e[m],localAddress:e[G]},connector:e[B],socket:r}),e.emit(`connect`,e[p],[e])}catch(r){if(e.destroyed)return;if(e[T]=!1,o.connectError.hasSubscribers&&o.connectError.publish({connectParams:{host:t,hostname:i,protocol:s,port:c,version:e[q]?.version,servername:e[m],localAddress:e[G]},connector:e[B],error:r}),r.code===`ERR_TLS_CERT_ALTNAME_INVALID`)for(n(e[y]===0);e[b]>0&&e[S][e[k]].servername===e[m];){let t=e[S][e[k]++];a.errorRequest(e,t,r)}else pe(e,r);e.emit(`connectionError`,e[p],[e],r)}e[ie]()}function he(e){e[E]=0,e.emit(`drain`,e[p],[e])}function ge(e,t){e[v]!==2&&(e[v]=2,_e(e,t),e[v]=0,e[A]>256&&(e[S].splice(0,e[A]),e[k]-=e[A],e[A]=0))}function _e(e,t){for(;;){if(e.destroyed){n(e[b]===0);return}if(e[ce]&&!e[x]){e[ce](),e[ce]=null;return}if(e[q]&&e[q].resume(),e[g])e[E]=2;else if(e[E]===2){t?(e[E]=1,queueMicrotask(()=>he(e))):he(e);continue}if(e[b]===0||e[y]>=(ue(e)||1))return;let r=e[S][e[k]];if(e[p].protocol===`https:`&&e[m]!==r.servername){if(e[y]>0)return;e[m]=r.servername,e[q]?.destroy(new u(`servername changed`),()=>{e[q]=null,ge(e)})}if(e[T])return;if(!e[q]){me(e);return}if(e[q].destroyed||e[q].busy(r))return;!r.aborted&&e[q].write(r)?e[k]++:e[S].splice(e[k],1)}}t.exports=de})),Pf=b(((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}}})),Ff=b(((e,t)=>{let{kFree:n,kConnected:r,kPending:i,kQueued:a,kRunning:o,kSize:s}=rf(),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]}}})),If=b(((e,t)=>{let n=ff(),r=Pf(),{kConnected:i,kSize:a,kRunning:o,kPending:s,kQueued:c,kBusy:l,kFree:u,kUrl:d,kClose:f,kDestroy:p,kDispatch:m}=rf(),h=Ff(),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}})),Lf=b(((e,t)=>{let{PoolBase:n,kClients:r,kNeedDrain:i,kAddClient:a,kGetDispatcher:o}=If(),s=Nf(),{InvalidArgumentError:c}=af(),l=cf(),{kUrl:u,kInterceptors:d}=rf(),f=mf(),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}=af(),{PoolBase:i,kClients:a,kNeedDrain:o,kAddClient:s,kRemoveClient:c,kGetDispatcher:l}=If(),u=Lf(),{kUrl:d,kInterceptors:f}=rf(),{parseOrigin:p}=cf(),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]}}})),zf=b(((e,t)=>{let{InvalidArgumentError:n}=af(),{kClients:r,kRunning:i,kClose:a,kDestroy:o,kDispatch:s,kInterceptors:c}=rf(),l=ff(),u=Lf(),d=Nf(),f=cf(),p=Mf(),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)}}})),Bf=b(((e,t)=>{let{kProxy:n,kClose:r,kDestroy:i,kDispatch:a,kInterceptors:o}=rf(),{URL:s}=w(`node:url`),c=zf(),l=Lf(),u=ff(),{InvalidArgumentError:d,RequestAbortedError:f,SecureProxyConnectionError:p}=af(),m=mf(),h=Nf(),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 T(e,t){return new l(e,t)}let E=()=>{};function D(e,t){return t.connections===1?new h(e,t):new l(e,t)}var O=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)}},k=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=T}=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:w,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:w&&k&&(this[v][`proxy-authorization`]=`Basic ${Buffer.from(`${decodeURIComponent(w)}:${decodeURIComponent(k)}`).toString(`base64`)}`);let j=m({...e.proxyTls});this[x]=m({...e.requestTls});let M=e.factory||D,N=(e,t)=>{let{protocol:r}=new s(e);return!this[S]&&r===`http:`&&this[n].protocol===`http:`?new O(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`,E).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=A(e.headers);if(j(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 A(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=k})),Vf=b(((e,t)=>{let n=ff(),{kClose:r,kDestroy:i,kClosed:a,kDestroyed:o,kDispatch:s,kNoProxyAgent:c,kHttpProxyAgent:l,kHttpsProxyAgent:u}=rf(),d=Bf(),f=zf(),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=w(`node:assert`),{kRetryHandlerDefaultRetry:r}=rf(),{RequestRetryError:i}=af(),{isDisturbed:a,parseHeaders:o,parseRangeHeader:s,wrapRequestBody:c}=cf();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)}}}}})),Uf=b(((e,t)=>{let n=df(),r=Hf();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()}}})),Wf=b(((e,t)=>{let n=w(`node:assert`),{Readable:r}=w(`node:stream`),{RequestAbortedError:i,NotSupportedError:a,InvalidArgumentError:o,AbortError:s}=af(),c=cf(),{ReadableStreamFrom:l}=cf(),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?(E(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){D(this[u],e)}).on(`close`,function(){this[u].body!==null&&D(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=w(`node:assert`),{ResponseStatusCodeError:r}=af(),{chunksDecode:i}=Wf();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}})),Kf=b(((e,t)=>{let n=w(`node:assert`),{Readable:r}=Wf(),{InvalidArgumentError:i,RequestAbortedError:a}=af(),o=cf(),{getResolveErrorBodyCallback:s}=Gf(),{AsyncResource:c}=w(`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})),qf=b(((e,t)=>{let{addAbortListener:n}=cf(),{RequestAbortedError:r}=af(),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}})),Jf=b(((e,t)=>{let n=w(`node:assert`),{finished:r,PassThrough:i}=w(`node:stream`),{InvalidArgumentError:a,InvalidReturnValueError:o}=af(),s=cf(),{getResolveErrorBodyCallback:c}=Gf(),{AsyncResource:l}=w(`node:async_hooks`),{addSignal:u,removeSignal:d}=qf();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})),Yf=b(((e,t)=>{let{Readable:n,Duplex:r,PassThrough:i}=w(`node:stream`),{InvalidArgumentError:a,InvalidReturnValueError:o,RequestAbortedError:s}=af(),c=cf(),{AsyncResource:l}=w(`node:async_hooks`),{addSignal:u,removeSignal:d}=qf(),f=w(`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=_})),Xf=b(((e,t)=>{let{InvalidArgumentError:n,SocketError:r}=af(),{AsyncResource:i}=w(`node:async_hooks`),a=cf(),{addSignal:o,removeSignal:s}=qf(),c=w(`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})),Zf=b(((e,t)=>{let n=w(`node:assert`),{AsyncResource:r}=w(`node:async_hooks`),{InvalidArgumentError:i,SocketError:a}=af(),o=cf(),{addSignal:s,removeSignal:c}=qf();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})),Qf=b(((e,t)=>{t.exports.request=Kf(),t.exports.stream=Jf(),t.exports.pipeline=Yf(),t.exports.upgrade=Xf(),t.exports.connect=Zf()})),$f=b(((e,t)=>{let{UndiciError:n}=af(),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}}})),ep=b(((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`)}})),tp=b(((e,t)=>{let{MockNotMatchedError:n}=$f(),{kDispatches:r,kMockAgent:i,kOriginalDispatch:a,kOrigin:o,kGetNetConnect:s}=ep(),{buildURL:c}=cf(),{STATUS_CODES:l}=w(`node:http`),{types:{isPromise:u}}=w(`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,_,T(a)),t.onData?.(Buffer.from(f)),t.onComplete?.(h),x(r,n)}function _(){}return!0}function O(){let e=this[i],t=this[o],r=this[a];return function(i,a){if(e.isMockActive)try{D.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(k(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 k(e,t){let n=new URL(t);return e===!0?!0:!!(Array.isArray(e)&&e.some(e=>d(e,n.host)))}function A(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:E,getStatusText:T,mockDispatch:D,buildMockDispatch:O,checkNetConnect:k,buildMockOptions:A,getHeaderByName:p,buildHeadersFromArray:m}})),np=b(((e,t)=>{let{getResponseData:n,buildKey:r,addMockDispatch:i}=tp(),{kDispatches:a,kDispatchKey:o,kDefaultHeaders:s,kDefaultTrailers:c,kContentLength:l,kMockDispatch:u}=ep(),{InvalidArgumentError:d}=af(),{buildURL:f}=cf();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})),rp=b(((e,t)=>{let{promisify:n}=w(`node:util`),r=Nf(),{buildMockDispatch:i}=tp(),{kDispatches:a,kMockAgent:o,kClose:s,kOriginalClose:c,kOrigin:l,kOriginalDispatch:u,kConnected:d}=ep(),{MockInterceptor:f}=np(),p=rf(),{InvalidArgumentError:m}=af();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])}}})),ip=b(((e,t)=>{let{promisify:n}=w(`node:util`),r=Lf(),{buildMockDispatch:i}=tp(),{kDispatches:a,kMockAgent:o,kClose:s,kOriginalClose:c,kOrigin:l,kOriginalDispatch:u,kConnected:d}=ep(),{MockInterceptor:f}=np(),p=rf(),{InvalidArgumentError:m}=af();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])}}})),ap=b(((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}}}})),op=b(((e,t)=>{let{Transform:n}=w(`node:stream`),{Console:r}=w(`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()}}})),sp=b(((e,t)=>{let{kClients:n}=rf(),r=zf(),{kAgent:i,kMockAgentSet:a,kMockAgentGet:o,kDispatches:s,kIsMockActive:c,kNetConnect:l,kGetNetConnect:u,kOptions:d,kFactory:f}=ep(),p=rp(),m=ip(),{matchValue:h,buildMockOptions:g}=tp(),{InvalidArgumentError:_,UndiciError:v}=af(),y=df(),b=ap(),x=op();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)} diff --git a/renovate.json b/renovate.json index 5db72dd..22a9943 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,4 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended" - ] + "extends": ["config:recommended"] }