From 754542d3ea43416991dc69f7608ffeebf6235319 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 25 Jul 2024 12:49:46 +0800 Subject: [PATCH] chore: build dist --- dist/index.cjs | 28574 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 28016 insertions(+), 558 deletions(-) diff --git a/dist/index.cjs b/dist/index.cjs index 3b352e7..3131ccf 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -1,16 +1,26118 @@ "use strict"; -const require$$0 = require("os"); -const require$$0$1 = require("path"); -const require$$0$2 = require("util"); -const require$$0$3 = require("stream"); -const require$$0$5 = require("events"); -const require$$0$4 = require("fs"); +var __defProp = Object.defineProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); +var _a; +const require$$0$1 = require("fs"); +const require$$1 = require("os"); +const require$$2$2 = require("http"); +const require$$3$1 = require("https"); +const require$$0$6 = require("net"); +const require$$1$1 = require("tls"); +const require$$0$2 = require("events"); +const require$$0$4 = require("assert"); +const require$$0$3 = require("util"); +const require$$0$5 = require("stream"); +const require$$7 = require("buffer"); +const require$$8 = require("querystring"); +const require$$13 = require("stream/web"); +const require$$0$7 = require("worker_threads"); +const require$$2$3 = require("perf_hooks"); +const require$$5 = require("util/types"); +const require$$4$1 = require("async_hooks"); +const require$$1$2 = require("console"); +const require$$1$3 = require("url"); +const require$$3$2 = require("zlib"); +const require$$2$4 = require("string_decoder"); +const require$$0$8 = require("diagnostics_channel"); +const require$$0$9 = require("path"); +const require$$7$1 = require("process"); var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; function getDefaultExportFromCjs(x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; } +function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f2 = n.default; + if (typeof f2 == "function") { + var a = function a2() { + if (this instanceof a2) { + return Reflect.construct(f2, arguments, this.constructor); + } + return f2.apply(this, arguments); + }; + a.prototype = f2.prototype; + } else a = {}; + Object.defineProperty(a, "__esModule", { value: true }); + Object.keys(n).forEach(function(k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function() { + return n[k]; + } + }); + }); + return a; +} +var github = {}; +var context = {}; +Object.defineProperty(context, "__esModule", { value: true }); +context.Context = void 0; +const fs_1 = require$$0$1; +const os_1 = require$$1; +let Context$1 = class Context { + /** + * Hydrate the context from the environment + */ + constructor() { + var _a2, _b, _c; + this.payload = {}; + if (process.env.GITHUB_EVENT_PATH) { + if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { + this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); + } else { + const path2 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path2} does not exist${os_1.EOL}`); + } + } + this.eventName = process.env.GITHUB_EVENT_NAME; + this.sha = process.env.GITHUB_SHA; + this.ref = process.env.GITHUB_REF; + this.workflow = process.env.GITHUB_WORKFLOW; + this.action = process.env.GITHUB_ACTION; + this.actor = process.env.GITHUB_ACTOR; + this.job = process.env.GITHUB_JOB; + this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); + this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); + this.apiUrl = (_a2 = process.env.GITHUB_API_URL) !== null && _a2 !== void 0 ? _a2 : `https://api.github.com`; + this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; + this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; + } + get issue() { + const payload = this.payload; + return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); + } + get repo() { + if (process.env.GITHUB_REPOSITORY) { + const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); + return { owner, repo }; + } + if (this.payload.repository) { + return { + owner: this.payload.repository.owner.login, + repo: this.payload.repository.name + }; + } + throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); + } +}; +context.Context = Context$1; +var utils$o = {}; +var utils$n = {}; +var lib$1 = {}; +var proxy = {}; +Object.defineProperty(proxy, "__esModule", { value: true }); +proxy.checkBypass = proxy.getProxyUrl = void 0; +function getProxyUrl$1(reqUrl) { + const usingSsl = reqUrl.protocol === "https:"; + if (checkBypass(reqUrl)) { + return void 0; + } + const proxyVar = (() => { + if (usingSsl) { + return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; + } else { + return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + } + })(); + if (proxyVar) { + try { + return new URL(proxyVar); + } catch (_a2) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new URL(`http://${proxyVar}`); + } + } else { + return void 0; + } +} +proxy.getProxyUrl = getProxyUrl$1; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; + } + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; + } + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { + if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { + return true; + } + } + return false; +} +proxy.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); +} +var tunnel$2 = {}; +var tls$1 = require$$1$1; +var http$2 = require$$2$2; +var https$1 = require$$3$1; +var events$1 = require$$0$2; +var util$m = require$$0$3; +tunnel$2.httpOverHttp = httpOverHttp; +tunnel$2.httpsOverHttp = httpsOverHttp; +tunnel$2.httpOverHttps = httpOverHttps; +tunnel$2.httpsOverHttps = httpsOverHttps; +function httpOverHttp(options2) { + var agent2 = new TunnelingAgent(options2); + agent2.request = http$2.request; + return agent2; +} +function httpsOverHttp(options2) { + var agent2 = new TunnelingAgent(options2); + agent2.request = http$2.request; + agent2.createSocket = createSecureSocket; + agent2.defaultPort = 443; + return agent2; +} +function httpOverHttps(options2) { + var agent2 = new TunnelingAgent(options2); + agent2.request = https$1.request; + return agent2; +} +function httpsOverHttps(options2) { + var agent2 = new TunnelingAgent(options2); + agent2.request = https$1.request; + agent2.createSocket = createSecureSocket; + agent2.defaultPort = 443; + return agent2; +} +function TunnelingAgent(options2) { + var self2 = this; + self2.options = options2 || {}; + self2.proxyOptions = self2.options.proxy || {}; + self2.maxSockets = self2.options.maxSockets || http$2.Agent.defaultMaxSockets; + self2.requests = []; + self2.sockets = []; + self2.on("free", function onFree(socket, host, port, localAddress) { + var options3 = toOptions(host, port, localAddress); + for (var i = 0, len = self2.requests.length; i < len; ++i) { + var pending = self2.requests[i]; + if (pending.host === options3.host && pending.port === options3.port) { + self2.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } + } + socket.destroy(); + self2.removeSocket(socket); + }); +} +util$m.inherits(TunnelingAgent, events$1.EventEmitter); +TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { + var self2 = this; + var options2 = mergeOptions({ request: req }, self2.options, toOptions(host, port, localAddress)); + if (self2.sockets.length >= this.maxSockets) { + self2.requests.push(options2); + return; + } + self2.createSocket(options2, function(socket) { + socket.on("free", onFree); + socket.on("close", onCloseOrRemove); + socket.on("agentRemove", onCloseOrRemove); + req.onSocket(socket); + function onFree() { + self2.emit("free", socket, options2); + } + function onCloseOrRemove(err) { + self2.removeSocket(socket); + socket.removeListener("free", onFree); + socket.removeListener("close", onCloseOrRemove); + socket.removeListener("agentRemove", onCloseOrRemove); + } + }); +}; +TunnelingAgent.prototype.createSocket = function createSocket(options2, cb) { + var self2 = this; + var placeholder = {}; + self2.sockets.push(placeholder); + var connectOptions = mergeOptions({}, self2.proxyOptions, { + method: "CONNECT", + path: options2.host + ":" + options2.port, + agent: false, + headers: { + host: options2.host + ":" + options2.port + } + }); + if (options2.localAddress) { + connectOptions.localAddress = options2.localAddress; + } + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); + } + debug$2("making CONNECT request"); + var connectReq = self2.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; + connectReq.once("response", onResponse); + connectReq.once("upgrade", onUpgrade); + connectReq.once("connect", onConnect); + connectReq.once("error", onError2); + connectReq.end(); + function onResponse(res) { + res.upgrade = true; + } + function onUpgrade(res, socket, head) { + process.nextTick(function() { + onConnect(res, socket, head); + }); + } + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); + if (res.statusCode !== 200) { + debug$2( + "tunneling socket could not be established, statusCode=%d", + res.statusCode + ); + socket.destroy(); + var error2 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); + error2.code = "ECONNRESET"; + options2.request.emit("error", error2); + self2.removeSocket(placeholder); + return; + } + if (head.length > 0) { + debug$2("got illegal response body from proxy"); + socket.destroy(); + var error2 = new Error("got illegal response body from proxy"); + error2.code = "ECONNRESET"; + options2.request.emit("error", error2); + self2.removeSocket(placeholder); + return; + } + debug$2("tunneling connection has established"); + self2.sockets[self2.sockets.indexOf(placeholder)] = socket; + return cb(socket); + } + function onError2(cause) { + connectReq.removeAllListeners(); + debug$2( + "tunneling socket could not be established, cause=%s\n", + cause.message, + cause.stack + ); + var error2 = new Error("tunneling socket could not be established, cause=" + cause.message); + error2.code = "ECONNRESET"; + options2.request.emit("error", error2); + self2.removeSocket(placeholder); + } +}; +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos2 = this.sockets.indexOf(socket); + if (pos2 === -1) { + return; + } + this.sockets.splice(pos2, 1); + var pending = this.requests.shift(); + if (pending) { + this.createSocket(pending, function(socket2) { + pending.request.onSocket(socket2); + }); + } +}; +function createSecureSocket(options2, cb) { + var self2 = this; + TunnelingAgent.prototype.createSocket.call(self2, options2, function(socket) { + var hostHeader = options2.request.getHeader("host"); + var tlsOptions = mergeOptions({}, self2.options, { + socket, + servername: hostHeader ? hostHeader.replace(/:.*$/, "") : options2.host + }); + var secureSocket = tls$1.connect(0, tlsOptions); + self2.sockets[self2.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); + }); +} +function toOptions(host, port, localAddress) { + if (typeof host === "string") { + return { + host, + port, + localAddress + }; + } + return host; +} +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === "object") { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== void 0) { + target[k] = overrides[k]; + } + } + } + } + return target; +} +var debug$2; +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug$2 = function() { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === "string") { + args[0] = "TUNNEL: " + args[0]; + } else { + args.unshift("TUNNEL:"); + } + console.error.apply(console, args); + }; +} else { + debug$2 = function() { + }; +} +tunnel$2.debug = debug$2; +var tunnel$1 = tunnel$2; +var undici = {}; +var symbols$4 = { + 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") +}; +let UndiciError$2 = class UndiciError extends Error { + constructor(message) { + super(message); + this.name = "UndiciError"; + this.code = "UND_ERR"; + } +}; +let ConnectTimeoutError$1 = class ConnectTimeoutError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, ConnectTimeoutError); + this.name = "ConnectTimeoutError"; + this.message = message || "Connect Timeout Error"; + this.code = "UND_ERR_CONNECT_TIMEOUT"; + } +}; +let HeadersTimeoutError$1 = class HeadersTimeoutError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, HeadersTimeoutError); + this.name = "HeadersTimeoutError"; + this.message = message || "Headers Timeout Error"; + this.code = "UND_ERR_HEADERS_TIMEOUT"; + } +}; +let HeadersOverflowError$1 = class HeadersOverflowError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, HeadersOverflowError); + this.name = "HeadersOverflowError"; + this.message = message || "Headers Overflow Error"; + this.code = "UND_ERR_HEADERS_OVERFLOW"; + } +}; +let BodyTimeoutError$1 = class BodyTimeoutError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, BodyTimeoutError); + this.name = "BodyTimeoutError"; + this.message = message || "Body Timeout Error"; + this.code = "UND_ERR_BODY_TIMEOUT"; + } +}; +let ResponseStatusCodeError$1 = class ResponseStatusCodeError extends UndiciError$2 { + constructor(message, statusCode, headers2, body2) { + super(message); + Error.captureStackTrace(this, ResponseStatusCodeError); + this.name = "ResponseStatusCodeError"; + this.message = message || "Response Status Code Error"; + this.code = "UND_ERR_RESPONSE_STATUS_CODE"; + this.body = body2; + this.status = statusCode; + this.statusCode = statusCode; + this.headers = headers2; + } +}; +let InvalidArgumentError$m = class InvalidArgumentError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, InvalidArgumentError); + this.name = "InvalidArgumentError"; + this.message = message || "Invalid Argument Error"; + this.code = "UND_ERR_INVALID_ARG"; + } +}; +let InvalidReturnValueError$2 = class InvalidReturnValueError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, InvalidReturnValueError); + this.name = "InvalidReturnValueError"; + this.message = message || "Invalid Return Value Error"; + this.code = "UND_ERR_INVALID_RETURN_VALUE"; + } +}; +let RequestAbortedError$9 = class RequestAbortedError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, RequestAbortedError); + this.name = "AbortError"; + this.message = message || "Request aborted"; + this.code = "UND_ERR_ABORTED"; + } +}; +let InformationalError$1 = class InformationalError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, InformationalError); + this.name = "InformationalError"; + this.message = message || "Request information"; + this.code = "UND_ERR_INFO"; + } +}; +let RequestContentLengthMismatchError$1 = class RequestContentLengthMismatchError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, RequestContentLengthMismatchError); + this.name = "RequestContentLengthMismatchError"; + this.message = message || "Request body length does not match content-length header"; + this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; + } +}; +let ResponseContentLengthMismatchError$1 = class ResponseContentLengthMismatchError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, ResponseContentLengthMismatchError); + this.name = "ResponseContentLengthMismatchError"; + this.message = message || "Response body length does not match content-length header"; + this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; + } +}; +let ClientDestroyedError$2 = class ClientDestroyedError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, ClientDestroyedError); + this.name = "ClientDestroyedError"; + this.message = message || "The client is destroyed"; + this.code = "UND_ERR_DESTROYED"; + } +}; +let ClientClosedError$1 = class ClientClosedError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, ClientClosedError); + this.name = "ClientClosedError"; + this.message = message || "The client is closed"; + this.code = "UND_ERR_CLOSED"; + } +}; +let SocketError$3 = class SocketError extends UndiciError$2 { + constructor(message, socket) { + super(message); + Error.captureStackTrace(this, SocketError); + this.name = "SocketError"; + this.message = message || "Socket error"; + this.code = "UND_ERR_SOCKET"; + this.socket = socket; + } +}; +let NotSupportedError$2 = class NotSupportedError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, NotSupportedError); + this.name = "NotSupportedError"; + this.message = message || "Not supported error"; + this.code = "UND_ERR_NOT_SUPPORTED"; + } +}; +let BalancedPoolMissingUpstreamError$1 = class BalancedPoolMissingUpstreamError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, NotSupportedError$2); + this.name = "MissingUpstreamError"; + this.message = message || "No upstream has been added to the BalancedPool"; + this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; + } +}; +let HTTPParserError$1 = class HTTPParserError extends Error { + constructor(message, code, data) { + super(message); + Error.captureStackTrace(this, HTTPParserError); + this.name = "HTTPParserError"; + this.code = code ? `HPE_${code}` : void 0; + this.data = data ? data.toString() : void 0; + } +}; +let ResponseExceededMaxSizeError$1 = class ResponseExceededMaxSizeError extends UndiciError$2 { + constructor(message) { + super(message); + Error.captureStackTrace(this, ResponseExceededMaxSizeError); + this.name = "ResponseExceededMaxSizeError"; + this.message = message || "Response content exceeded max size"; + this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; + } +}; +let RequestRetryError$1 = class RequestRetryError extends UndiciError$2 { + constructor(message, code, { headers: headers2, data }) { + super(message); + Error.captureStackTrace(this, RequestRetryError); + this.name = "RequestRetryError"; + this.message = message || "Request retry error"; + this.code = "UND_ERR_REQ_RETRY"; + this.statusCode = code; + this.data = data; + this.headers = headers2; + } +}; +var errors$4 = { + HTTPParserError: HTTPParserError$1, + UndiciError: UndiciError$2, + HeadersTimeoutError: HeadersTimeoutError$1, + HeadersOverflowError: HeadersOverflowError$1, + BodyTimeoutError: BodyTimeoutError$1, + RequestContentLengthMismatchError: RequestContentLengthMismatchError$1, + ConnectTimeoutError: ConnectTimeoutError$1, + ResponseStatusCodeError: ResponseStatusCodeError$1, + InvalidArgumentError: InvalidArgumentError$m, + InvalidReturnValueError: InvalidReturnValueError$2, + RequestAbortedError: RequestAbortedError$9, + ClientDestroyedError: ClientDestroyedError$2, + ClientClosedError: ClientClosedError$1, + InformationalError: InformationalError$1, + SocketError: SocketError$3, + NotSupportedError: NotSupportedError$2, + ResponseContentLengthMismatchError: ResponseContentLengthMismatchError$1, + BalancedPoolMissingUpstreamError: BalancedPoolMissingUpstreamError$1, + ResponseExceededMaxSizeError: ResponseExceededMaxSizeError$1, + RequestRetryError: RequestRetryError$1 +}; +const headerNameLowerCasedRecord$1 = {}; +const wellknownHeaderNames = [ + "Accept", + "Accept-Encoding", + "Accept-Language", + "Accept-Ranges", + "Access-Control-Allow-Credentials", + "Access-Control-Allow-Headers", + "Access-Control-Allow-Methods", + "Access-Control-Allow-Origin", + "Access-Control-Expose-Headers", + "Access-Control-Max-Age", + "Access-Control-Request-Headers", + "Access-Control-Request-Method", + "Age", + "Allow", + "Alt-Svc", + "Alt-Used", + "Authorization", + "Cache-Control", + "Clear-Site-Data", + "Connection", + "Content-Disposition", + "Content-Encoding", + "Content-Language", + "Content-Length", + "Content-Location", + "Content-Range", + "Content-Security-Policy", + "Content-Security-Policy-Report-Only", + "Content-Type", + "Cookie", + "Cross-Origin-Embedder-Policy", + "Cross-Origin-Opener-Policy", + "Cross-Origin-Resource-Policy", + "Date", + "Device-Memory", + "Downlink", + "ECT", + "ETag", + "Expect", + "Expect-CT", + "Expires", + "Forwarded", + "From", + "Host", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Range", + "If-Unmodified-Since", + "Keep-Alive", + "Last-Modified", + "Link", + "Location", + "Max-Forwards", + "Origin", + "Permissions-Policy", + "Pragma", + "Proxy-Authenticate", + "Proxy-Authorization", + "RTT", + "Range", + "Referer", + "Referrer-Policy", + "Refresh", + "Retry-After", + "Sec-WebSocket-Accept", + "Sec-WebSocket-Extensions", + "Sec-WebSocket-Key", + "Sec-WebSocket-Protocol", + "Sec-WebSocket-Version", + "Server", + "Server-Timing", + "Service-Worker-Allowed", + "Service-Worker-Navigation-Preload", + "Set-Cookie", + "SourceMap", + "Strict-Transport-Security", + "Supports-Loading-Mode", + "TE", + "Timing-Allow-Origin", + "Trailer", + "Transfer-Encoding", + "Upgrade", + "Upgrade-Insecure-Requests", + "User-Agent", + "Vary", + "Via", + "WWW-Authenticate", + "X-Content-Type-Options", + "X-DNS-Prefetch-Control", + "X-Frame-Options", + "X-Permitted-Cross-Domain-Policies", + "X-Powered-By", + "X-Requested-With", + "X-XSS-Protection" +]; +for (let i = 0; i < wellknownHeaderNames.length; ++i) { + const key = wellknownHeaderNames[i]; + const lowerCasedKey = key.toLowerCase(); + headerNameLowerCasedRecord$1[key] = headerNameLowerCasedRecord$1[lowerCasedKey] = lowerCasedKey; +} +Object.setPrototypeOf(headerNameLowerCasedRecord$1, null); +var constants$d = { + wellknownHeaderNames, + headerNameLowerCasedRecord: headerNameLowerCasedRecord$1 +}; +const assert$a = require$$0$4; +const { kDestroyed: kDestroyed$1, kBodyUsed: kBodyUsed$1 } = symbols$4; +const { IncomingMessage } = require$$2$2; +const stream$6 = require$$0$5; +const net$2 = require$$0$6; +const { InvalidArgumentError: InvalidArgumentError$l } = errors$4; +const { Blob: Blob$2 } = require$$7; +const nodeUtil = require$$0$3; +const { stringify: stringify$6 } = require$$8; +const { headerNameLowerCasedRecord } = constants$d; +const [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); +function nop$1() { +} +function isStream(obj) { + return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; +} +function isBlobLike(object) { + return Blob$2 && object instanceof Blob$2 || object && typeof object === "object" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]); +} +function buildURL$2(url, queryParams) { + if (url.includes("?") || url.includes("#")) { + throw new Error('Query params cannot be passed when url already contains "?" or "#".'); + } + const stringified = stringify$6(queryParams); + if (stringified) { + url += "?" + stringified; + } + return url; +} +function parseURL(url) { + if (typeof url === "string") { + url = new URL(url); + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError$l("Invalid URL protocol: the URL must start with `http:` or `https:`."); + } + return url; + } + if (!url || typeof url !== "object") { + throw new InvalidArgumentError$l("Invalid URL: The URL argument must be a non-null object."); + } + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError$l("Invalid URL protocol: the URL must start with `http:` or `https:`."); + } + if (!(url instanceof URL)) { + if (url.port != null && url.port !== "" && !Number.isFinite(parseInt(url.port))) { + throw new InvalidArgumentError$l("Invalid URL: port must be a valid integer or a string representation of an integer."); + } + if (url.path != null && typeof url.path !== "string") { + throw new InvalidArgumentError$l("Invalid URL path: the path must be a string or null/undefined."); + } + if (url.pathname != null && typeof url.pathname !== "string") { + throw new InvalidArgumentError$l("Invalid URL pathname: the pathname must be a string or null/undefined."); + } + if (url.hostname != null && typeof url.hostname !== "string") { + throw new InvalidArgumentError$l("Invalid URL hostname: the hostname must be a string or null/undefined."); + } + if (url.origin != null && typeof url.origin !== "string") { + throw new InvalidArgumentError$l("Invalid URL origin: the origin must be a string or null/undefined."); + } + const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; + let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}`; + let path2 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + if (origin.endsWith("/")) { + origin = origin.substring(0, origin.length - 1); + } + if (path2 && !path2.startsWith("/")) { + path2 = `/${path2}`; + } + url = new URL(origin + path2); + } + return url; +} +function parseOrigin$1(url) { + url = parseURL(url); + if (url.pathname !== "/" || url.search || url.hash) { + throw new InvalidArgumentError$l("invalid url"); + } + return url; +} +function getHostname(host) { + if (host[0] === "[") { + const idx2 = host.indexOf("]"); + assert$a(idx2 !== -1); + return host.substring(1, idx2); + } + const idx = host.indexOf(":"); + if (idx === -1) return host; + return host.substring(0, idx); +} +function getServerName(host) { + if (!host) { + return null; + } + assert$a.strictEqual(typeof host, "string"); + const servername = getHostname(host); + if (net$2.isIP(servername)) { + return ""; + } + return servername; +} +function deepClone(obj) { + return JSON.parse(JSON.stringify(obj)); +} +function isAsyncIterable(obj) { + return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function"); +} +function isIterable(obj) { + return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function")); +} +function bodyLength(body2) { + if (body2 == null) { + return 0; + } else if (isStream(body2)) { + const state = body2._readableState; + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null; + } else if (isBlobLike(body2)) { + return body2.size != null ? body2.size : null; + } else if (isBuffer(body2)) { + return body2.byteLength; + } + return null; +} +function isDestroyed(stream2) { + return !stream2 || !!(stream2.destroyed || stream2[kDestroyed$1]); +} +function isReadableAborted(stream2) { + const state = stream2 && stream2._readableState; + return isDestroyed(stream2) && state && !state.endEmitted; +} +function destroy(stream2, err) { + if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { + return; + } + if (typeof stream2.destroy === "function") { + if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { + stream2.socket = null; + } + stream2.destroy(err); + } else if (err) { + process.nextTick((stream3, err2) => { + stream3.emit("error", err2); + }, stream2, err); + } + if (stream2.destroyed !== true) { + stream2[kDestroyed$1] = true; + } +} +const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; +function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); + return m ? parseInt(m[1], 10) * 1e3 : null; +} +function headerNameToString(value) { + return headerNameLowerCasedRecord[value] || value.toLowerCase(); +} +function parseHeaders$1(headers2, obj = {}) { + if (!Array.isArray(headers2)) return headers2; + for (let i = 0; i < headers2.length; i += 2) { + const key = headers2[i].toString().toLowerCase(); + let val = obj[key]; + if (!val) { + if (Array.isArray(headers2[i + 1])) { + obj[key] = headers2[i + 1].map((x) => x.toString("utf8")); + } else { + obj[key] = headers2[i + 1].toString("utf8"); + } + } else { + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; + } + val.push(headers2[i + 1].toString("utf8")); + } + } + if ("content-length" in obj && "content-disposition" in obj) { + obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1"); + } + return obj; +} +function parseRawHeaders(headers2) { + const ret = []; + let hasContentLength = false; + let contentDispositionIdx = -1; + for (let n = 0; n < headers2.length; n += 2) { + const key = headers2[n + 0].toString(); + const val = headers2[n + 1].toString("utf8"); + if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { + ret.push(key, val); + hasContentLength = true; + } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { + contentDispositionIdx = ret.push(key, val) - 1; + } else { + ret.push(key, val); + } + } + if (hasContentLength && contentDispositionIdx !== -1) { + ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1"); + } + return ret; +} +function isBuffer(buffer) { + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer); +} +function validateHandler(handler2, method, upgrade2) { + if (!handler2 || typeof handler2 !== "object") { + throw new InvalidArgumentError$l("handler must be an object"); + } + if (typeof handler2.onConnect !== "function") { + throw new InvalidArgumentError$l("invalid onConnect method"); + } + if (typeof handler2.onError !== "function") { + throw new InvalidArgumentError$l("invalid onError method"); + } + if (typeof handler2.onBodySent !== "function" && handler2.onBodySent !== void 0) { + throw new InvalidArgumentError$l("invalid onBodySent method"); + } + if (upgrade2 || method === "CONNECT") { + if (typeof handler2.onUpgrade !== "function") { + throw new InvalidArgumentError$l("invalid onUpgrade method"); + } + } else { + if (typeof handler2.onHeaders !== "function") { + throw new InvalidArgumentError$l("invalid onHeaders method"); + } + if (typeof handler2.onData !== "function") { + throw new InvalidArgumentError$l("invalid onData method"); + } + if (typeof handler2.onComplete !== "function") { + throw new InvalidArgumentError$l("invalid onComplete method"); + } + } +} +function isDisturbed$1(body2) { + return !!(body2 && (stream$6.isDisturbed ? stream$6.isDisturbed(body2) || body2[kBodyUsed$1] : body2[kBodyUsed$1] || body2.readableDidRead || body2._readableState && body2._readableState.dataEmitted || isReadableAborted(body2))); +} +function isErrored(body2) { + return !!(body2 && (stream$6.isErrored ? stream$6.isErrored(body2) : /state: 'errored'/.test( + nodeUtil.inspect(body2) + ))); +} +function isReadable(body2) { + return !!(body2 && (stream$6.isReadable ? stream$6.isReadable(body2) : /state: 'readable'/.test( + nodeUtil.inspect(body2) + ))); +} +function getSocketInfo(socket) { + return { + localAddress: socket.localAddress, + localPort: socket.localPort, + remoteAddress: socket.remoteAddress, + remotePort: socket.remotePort, + remoteFamily: socket.remoteFamily, + timeout: socket.timeout, + bytesWritten: socket.bytesWritten, + bytesRead: socket.bytesRead + }; +} +async function* convertIterableToBuffer(iterable) { + for await (const chunk of iterable) { + yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); + } +} +let ReadableStream; +function ReadableStreamFrom$1(iterable) { + if (!ReadableStream) { + ReadableStream = require$$13.ReadableStream; + } + if (ReadableStream.from) { + return ReadableStream.from(convertIterableToBuffer(iterable)); + } + let iterator2; + return new ReadableStream( + { + async start() { + iterator2 = iterable[Symbol.asyncIterator](); + }, + async pull(controller) { + const { done, value } = await iterator2.next(); + if (done) { + queueMicrotask(() => { + controller.close(); + }); + } else { + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); + controller.enqueue(new Uint8Array(buf)); + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator2.return(); + } + }, + 0 + ); +} +function isFormDataLike(object) { + return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData"; +} +function throwIfAborted(signal) { + if (!signal) { + return; + } + if (typeof signal.throwIfAborted === "function") { + signal.throwIfAborted(); + } else { + if (signal.aborted) { + const err = new Error("The operation was aborted"); + err.name = "AbortError"; + throw err; + } + } +} +function addAbortListener$1(signal, listener) { + if ("addEventListener" in signal) { + signal.addEventListener("abort", listener, { once: true }); + return () => signal.removeEventListener("abort", listener); + } + signal.addListener("abort", listener); + return () => signal.removeListener("abort", listener); +} +const hasToWellFormed = !!String.prototype.toWellFormed; +function toUSVString$2(val) { + if (hasToWellFormed) { + return `${val}`.toWellFormed(); + } else if (nodeUtil.toUSVString) { + return nodeUtil.toUSVString(val); + } + return `${val}`; +} +function parseRangeHeader$1(range) { + if (range == null || range === "") return { start: 0, end: null, size: null }; + const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null; + return m ? { + start: parseInt(m[1]), + end: m[2] ? parseInt(m[2]) : null, + size: m[3] ? parseInt(m[3]) : null + } : null; +} +const kEnumerableProperty = /* @__PURE__ */ Object.create(null); +kEnumerableProperty.enumerable = true; +var util$l = { + kEnumerableProperty, + nop: nop$1, + isDisturbed: isDisturbed$1, + isErrored, + isReadable, + toUSVString: toUSVString$2, + isReadableAborted, + isBlobLike, + parseOrigin: parseOrigin$1, + parseURL, + getServerName, + isStream, + isIterable, + isAsyncIterable, + isDestroyed, + headerNameToString, + parseRawHeaders, + parseHeaders: parseHeaders$1, + parseKeepAliveTimeout, + destroy, + bodyLength, + deepClone, + ReadableStreamFrom: ReadableStreamFrom$1, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL: buildURL$2, + throwIfAborted, + addAbortListener: addAbortListener$1, + parseRangeHeader: parseRangeHeader$1, + nodeMajor, + nodeMinor, + nodeHasAutoSelectFamily: nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 13, + safeHTTPMethods: ["GET", "HEAD", "OPTIONS", "TRACE"] +}; +let fastNow = Date.now(); +let fastNowTimeout; +const fastTimers = []; +function onTimeout() { + fastNow = Date.now(); + let len = fastTimers.length; + let idx = 0; + while (idx < len) { + const timer = fastTimers[idx]; + if (timer.state === 0) { + timer.state = fastNow + timer.delay; + } else if (timer.state > 0 && fastNow >= timer.state) { + timer.state = -1; + timer.callback(timer.opaque); + } + if (timer.state === -1) { + timer.state = -2; + if (idx !== len - 1) { + fastTimers[idx] = fastTimers.pop(); + } else { + fastTimers.pop(); + } + len -= 1; + } else { + idx += 1; + } + } + if (fastTimers.length > 0) { + refreshTimeout(); + } +} +function refreshTimeout() { + if (fastNowTimeout && fastNowTimeout.refresh) { + fastNowTimeout.refresh(); + } else { + clearTimeout(fastNowTimeout); + fastNowTimeout = setTimeout(onTimeout, 1e3); + if (fastNowTimeout.unref) { + fastNowTimeout.unref(); + } + } +} +class Timeout { + constructor(callback, delay, opaque) { + this.callback = callback; + this.delay = delay; + this.opaque = opaque; + this.state = -2; + this.refresh(); + } + refresh() { + if (this.state === -2) { + fastTimers.push(this); + if (!fastNowTimeout || fastTimers.length === 1) { + refreshTimeout(); + } + } + this.state = 0; + } + clear() { + this.state = -1; + } +} +var timers$1 = { + setTimeout(callback, delay, opaque) { + return delay < 1e3 ? setTimeout(callback, delay, opaque) : new Timeout(callback, delay, opaque); + }, + clearTimeout(timeout) { + if (timeout instanceof Timeout) { + timeout.clear(); + } else { + clearTimeout(timeout); + } + } +}; +var main$1 = { exports: {} }; +const __viteBrowserExternal = {}; +const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + default: __viteBrowserExternal +}, Symbol.toStringTag, { value: "Module" })); +const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1); +var sbmh; +var hasRequiredSbmh; +function requireSbmh() { + if (hasRequiredSbmh) return sbmh; + hasRequiredSbmh = 1; + const EventEmitter2 = require$$0.EventEmitter; + const inherits = require$$0.inherits; + function SBMH(needle) { + if (typeof needle === "string") { + needle = Buffer.from(needle); + } + if (!Buffer.isBuffer(needle)) { + throw new TypeError("The needle has to be a String or a Buffer."); + } + const needleLength = needle.length; + if (needleLength === 0) { + throw new Error("The needle cannot be an empty String/Buffer."); + } + if (needleLength > 256) { + throw new Error("The needle cannot have a length bigger than 256."); + } + this.maxMatches = Infinity; + this.matches = 0; + this._occ = new Array(256).fill(needleLength); + this._lookbehind_size = 0; + this._needle = needle; + this._bufpos = 0; + this._lookbehind = Buffer.alloc(needleLength); + for (var i = 0; i < needleLength - 1; ++i) { + this._occ[needle[i]] = needleLength - 1 - i; + } + } + inherits(SBMH, EventEmitter2); + SBMH.prototype.reset = function() { + this._lookbehind_size = 0; + this.matches = 0; + this._bufpos = 0; + }; + SBMH.prototype.push = function(chunk, pos2) { + if (!Buffer.isBuffer(chunk)) { + chunk = Buffer.from(chunk, "binary"); + } + const chlen = chunk.length; + this._bufpos = pos2 || 0; + let r; + while (r !== chlen && this.matches < this.maxMatches) { + r = this._sbmh_feed(chunk); + } + return r; + }; + SBMH.prototype._sbmh_feed = function(data) { + const len = data.length; + const needle = this._needle; + const needleLength = needle.length; + const lastNeedleChar = needle[needleLength - 1]; + let pos2 = -this._lookbehind_size; + let ch; + if (pos2 < 0) { + while (pos2 < 0 && pos2 <= len - needleLength) { + ch = this._sbmh_lookup_char(data, pos2 + needleLength - 1); + if (ch === lastNeedleChar && this._sbmh_memcmp(data, pos2, needleLength - 1)) { + this._lookbehind_size = 0; + ++this.matches; + this.emit("info", true); + return this._bufpos = pos2 + needleLength; + } + pos2 += this._occ[ch]; + } + if (pos2 < 0) { + while (pos2 < 0 && !this._sbmh_memcmp(data, pos2, len - pos2)) { + ++pos2; + } + } + if (pos2 >= 0) { + this.emit("info", false, this._lookbehind, 0, this._lookbehind_size); + this._lookbehind_size = 0; + } else { + const bytesToCutOff = this._lookbehind_size + pos2; + if (bytesToCutOff > 0) { + this.emit("info", false, this._lookbehind, 0, bytesToCutOff); + } + this._lookbehind.copy( + this._lookbehind, + 0, + bytesToCutOff, + this._lookbehind_size - bytesToCutOff + ); + this._lookbehind_size -= bytesToCutOff; + data.copy(this._lookbehind, this._lookbehind_size); + this._lookbehind_size += len; + this._bufpos = len; + return len; + } + } + pos2 += (pos2 >= 0) * this._bufpos; + if (data.indexOf(needle, pos2) !== -1) { + pos2 = data.indexOf(needle, pos2); + ++this.matches; + if (pos2 > 0) { + this.emit("info", true, data, this._bufpos, pos2); + } else { + this.emit("info", true); + } + return this._bufpos = pos2 + needleLength; + } else { + pos2 = len - needleLength; + } + while (pos2 < len && (data[pos2] !== needle[0] || Buffer.compare( + data.subarray(pos2, pos2 + len - pos2), + needle.subarray(0, len - pos2) + ) !== 0)) { + ++pos2; + } + if (pos2 < len) { + data.copy(this._lookbehind, 0, pos2, pos2 + (len - pos2)); + this._lookbehind_size = len - pos2; + } + if (pos2 > 0) { + this.emit("info", false, data, this._bufpos, pos2 < len ? pos2 : len); + } + this._bufpos = len; + return len; + }; + SBMH.prototype._sbmh_lookup_char = function(data, pos2) { + return pos2 < 0 ? this._lookbehind[this._lookbehind_size + pos2] : data[pos2]; + }; + SBMH.prototype._sbmh_memcmp = function(data, pos2, len) { + for (var i = 0; i < len; ++i) { + if (this._sbmh_lookup_char(data, pos2 + i) !== this._needle[i]) { + return false; + } + } + return true; + }; + sbmh = SBMH; + return sbmh; +} +var PartStream_1; +var hasRequiredPartStream; +function requirePartStream() { + if (hasRequiredPartStream) return PartStream_1; + hasRequiredPartStream = 1; + const inherits = require$$0.inherits; + const ReadableStream2 = require$$0.Readable; + function PartStream(opts) { + ReadableStream2.call(this, opts); + } + inherits(PartStream, ReadableStream2); + PartStream.prototype._read = function(n) { + }; + PartStream_1 = PartStream; + return PartStream_1; +} +var getLimit; +var hasRequiredGetLimit; +function requireGetLimit() { + if (hasRequiredGetLimit) return getLimit; + hasRequiredGetLimit = 1; + getLimit = function getLimit2(limits, name, defaultLimit) { + if (!limits || limits[name] === void 0 || limits[name] === null) { + return defaultLimit; + } + if (typeof limits[name] !== "number" || isNaN(limits[name])) { + throw new TypeError("Limit " + name + " is not a valid number"); + } + return limits[name]; + }; + return getLimit; +} +var HeaderParser_1; +var hasRequiredHeaderParser; +function requireHeaderParser() { + if (hasRequiredHeaderParser) return HeaderParser_1; + hasRequiredHeaderParser = 1; + const EventEmitter2 = require$$0.EventEmitter; + const inherits = require$$0.inherits; + const getLimit2 = requireGetLimit(); + const StreamSearch = requireSbmh(); + const B_DCRLF = Buffer.from("\r\n\r\n"); + const RE_CRLF = /\r\n/g; + const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/; + function HeaderParser(cfg) { + EventEmitter2.call(this); + cfg = cfg || {}; + const self2 = this; + this.nread = 0; + this.maxed = false; + this.npairs = 0; + this.maxHeaderPairs = getLimit2(cfg, "maxHeaderPairs", 2e3); + this.maxHeaderSize = getLimit2(cfg, "maxHeaderSize", 80 * 1024); + this.buffer = ""; + this.header = {}; + this.finished = false; + this.ss = new StreamSearch(B_DCRLF); + this.ss.on("info", function(isMatch, data, start, end) { + if (data && !self2.maxed) { + if (self2.nread + end - start >= self2.maxHeaderSize) { + end = self2.maxHeaderSize - self2.nread + start; + self2.nread = self2.maxHeaderSize; + self2.maxed = true; + } else { + self2.nread += end - start; + } + self2.buffer += data.toString("binary", start, end); + } + if (isMatch) { + self2._finish(); + } + }); + } + inherits(HeaderParser, EventEmitter2); + HeaderParser.prototype.push = function(data) { + const r = this.ss.push(data); + if (this.finished) { + return r; + } + }; + HeaderParser.prototype.reset = function() { + this.finished = false; + this.buffer = ""; + this.header = {}; + this.ss.reset(); + }; + HeaderParser.prototype._finish = function() { + if (this.buffer) { + this._parseHeader(); + } + this.ss.matches = this.ss.maxMatches; + const header2 = this.header; + this.header = {}; + this.buffer = ""; + this.finished = true; + this.nread = this.npairs = 0; + this.maxed = false; + this.emit("header", header2); + }; + HeaderParser.prototype._parseHeader = function() { + if (this.npairs === this.maxHeaderPairs) { + return; + } + const lines = this.buffer.split(RE_CRLF); + const len = lines.length; + let m, h; + for (var i = 0; i < len; ++i) { + if (lines[i].length === 0) { + continue; + } + if (lines[i][0] === " " || lines[i][0] === " ") { + if (h) { + this.header[h][this.header[h].length - 1] += lines[i]; + continue; + } + } + const posColon = lines[i].indexOf(":"); + if (posColon === -1 || posColon === 0) { + return; + } + m = RE_HDR.exec(lines[i]); + h = m[1].toLowerCase(); + this.header[h] = this.header[h] || []; + this.header[h].push(m[2] || ""); + if (++this.npairs === this.maxHeaderPairs) { + break; + } + } + }; + HeaderParser_1 = HeaderParser; + return HeaderParser_1; +} +var Dicer_1; +var hasRequiredDicer; +function requireDicer() { + if (hasRequiredDicer) return Dicer_1; + hasRequiredDicer = 1; + const WritableStream = require$$0.Writable; + const inherits = require$$0.inherits; + const StreamSearch = requireSbmh(); + const PartStream = requirePartStream(); + const HeaderParser = requireHeaderParser(); + const DASH = 45; + const B_ONEDASH = Buffer.from("-"); + const B_CRLF = Buffer.from("\r\n"); + const EMPTY_FN = function() { + }; + function Dicer(cfg) { + if (!(this instanceof Dicer)) { + return new Dicer(cfg); + } + WritableStream.call(this, cfg); + if (!cfg || !cfg.headerFirst && typeof cfg.boundary !== "string") { + throw new TypeError("Boundary required"); + } + if (typeof cfg.boundary === "string") { + this.setBoundary(cfg.boundary); + } else { + this._bparser = void 0; + } + this._headerFirst = cfg.headerFirst; + this._dashes = 0; + this._parts = 0; + this._finished = false; + this._realFinish = false; + this._isPreamble = true; + this._justMatched = false; + this._firstWrite = true; + this._inHeader = true; + this._part = void 0; + this._cb = void 0; + this._ignoreData = false; + this._partOpts = { highWaterMark: cfg.partHwm }; + this._pause = false; + const self2 = this; + this._hparser = new HeaderParser(cfg); + this._hparser.on("header", function(header2) { + self2._inHeader = false; + self2._part.emit("header", header2); + }); + } + inherits(Dicer, WritableStream); + Dicer.prototype.emit = function(ev) { + if (ev === "finish" && !this._realFinish) { + if (!this._finished) { + const self2 = this; + process.nextTick(function() { + self2.emit("error", new Error("Unexpected end of multipart data")); + if (self2._part && !self2._ignoreData) { + const type = self2._isPreamble ? "Preamble" : "Part"; + self2._part.emit("error", new Error(type + " terminated early due to unexpected end of multipart data")); + self2._part.push(null); + process.nextTick(function() { + self2._realFinish = true; + self2.emit("finish"); + self2._realFinish = false; + }); + return; + } + self2._realFinish = true; + self2.emit("finish"); + self2._realFinish = false; + }); + } + } else { + WritableStream.prototype.emit.apply(this, arguments); + } + }; + Dicer.prototype._write = function(data, encoding2, cb) { + if (!this._hparser && !this._bparser) { + return cb(); + } + if (this._headerFirst && this._isPreamble) { + if (!this._part) { + this._part = new PartStream(this._partOpts); + if (this.listenerCount("preamble") !== 0) { + this.emit("preamble", this._part); + } else { + this._ignore(); + } + } + const r = this._hparser.push(data); + if (!this._inHeader && r !== void 0 && r < data.length) { + data = data.slice(r); + } else { + return cb(); + } + } + if (this._firstWrite) { + this._bparser.push(B_CRLF); + this._firstWrite = false; + } + this._bparser.push(data); + if (this._pause) { + this._cb = cb; + } else { + cb(); + } + }; + Dicer.prototype.reset = function() { + this._part = void 0; + this._bparser = void 0; + this._hparser = void 0; + }; + Dicer.prototype.setBoundary = function(boundary) { + const self2 = this; + this._bparser = new StreamSearch("\r\n--" + boundary); + this._bparser.on("info", function(isMatch, data, start, end) { + self2._oninfo(isMatch, data, start, end); + }); + }; + Dicer.prototype._ignore = function() { + if (this._part && !this._ignoreData) { + this._ignoreData = true; + this._part.on("error", EMPTY_FN); + this._part.resume(); + } + }; + Dicer.prototype._oninfo = function(isMatch, data, start, end) { + let buf; + const self2 = this; + let i = 0; + let r; + let shouldWriteMore = true; + if (!this._part && this._justMatched && data) { + while (this._dashes < 2 && start + i < end) { + if (data[start + i] === DASH) { + ++i; + ++this._dashes; + } else { + if (this._dashes) { + buf = B_ONEDASH; + } + this._dashes = 0; + break; + } + } + if (this._dashes === 2) { + if (start + i < end && this.listenerCount("trailer") !== 0) { + this.emit("trailer", data.slice(start + i, end)); + } + this.reset(); + this._finished = true; + if (self2._parts === 0) { + self2._realFinish = true; + self2.emit("finish"); + self2._realFinish = false; + } + } + if (this._dashes) { + return; + } + } + if (this._justMatched) { + this._justMatched = false; + } + if (!this._part) { + this._part = new PartStream(this._partOpts); + this._part._read = function(n) { + self2._unpause(); + }; + if (this._isPreamble && this.listenerCount("preamble") !== 0) { + this.emit("preamble", this._part); + } else if (this._isPreamble !== true && this.listenerCount("part") !== 0) { + this.emit("part", this._part); + } else { + this._ignore(); + } + if (!this._isPreamble) { + this._inHeader = true; + } + } + if (data && start < end && !this._ignoreData) { + if (this._isPreamble || !this._inHeader) { + if (buf) { + shouldWriteMore = this._part.push(buf); + } + shouldWriteMore = this._part.push(data.slice(start, end)); + if (!shouldWriteMore) { + this._pause = true; + } + } else if (!this._isPreamble && this._inHeader) { + if (buf) { + this._hparser.push(buf); + } + r = this._hparser.push(data.slice(start, end)); + if (!this._inHeader && r !== void 0 && r < end) { + this._oninfo(false, data, start + r, end); + } + } + } + if (isMatch) { + this._hparser.reset(); + if (this._isPreamble) { + this._isPreamble = false; + } else { + if (start !== end) { + ++this._parts; + this._part.on("end", function() { + if (--self2._parts === 0) { + if (self2._finished) { + self2._realFinish = true; + self2.emit("finish"); + self2._realFinish = false; + } else { + self2._unpause(); + } + } + }); + } + } + this._part.push(null); + this._part = void 0; + this._ignoreData = false; + this._justMatched = true; + this._dashes = 0; + } + }; + Dicer.prototype._unpause = function() { + if (!this._pause) { + return; + } + this._pause = false; + if (this._cb) { + const cb = this._cb; + this._cb = void 0; + cb(); + } + }; + Dicer_1 = Dicer; + return Dicer_1; +} +var decodeText_1; +var hasRequiredDecodeText; +function requireDecodeText() { + if (hasRequiredDecodeText) return decodeText_1; + hasRequiredDecodeText = 1; + const utf8Decoder = new TextDecoder("utf-8"); + const textDecoders = /* @__PURE__ */ new Map([ + ["utf-8", utf8Decoder], + ["utf8", utf8Decoder] + ]); + function getDecoder(charset) { + let lc; + while (true) { + switch (charset) { + case "utf-8": + case "utf8": + return decoders.utf8; + case "latin1": + case "ascii": + case "us-ascii": + case "iso-8859-1": + case "iso8859-1": + case "iso88591": + case "iso_8859-1": + case "windows-1252": + case "iso_8859-1:1987": + case "cp1252": + case "x-cp1252": + return decoders.latin1; + case "utf16le": + case "utf-16le": + case "ucs2": + case "ucs-2": + return decoders.utf16le; + case "base64": + return decoders.base64; + default: + if (lc === void 0) { + lc = true; + charset = charset.toLowerCase(); + continue; + } + return decoders.other.bind(charset); + } + } + } + const decoders = { + utf8: (data, sourceEncoding) => { + if (data.length === 0) { + return ""; + } + if (typeof data === "string") { + data = Buffer.from(data, sourceEncoding); + } + return data.utf8Slice(0, data.length); + }, + latin1: (data, sourceEncoding) => { + if (data.length === 0) { + return ""; + } + if (typeof data === "string") { + return data; + } + return data.latin1Slice(0, data.length); + }, + utf16le: (data, sourceEncoding) => { + if (data.length === 0) { + return ""; + } + if (typeof data === "string") { + data = Buffer.from(data, sourceEncoding); + } + return data.ucs2Slice(0, data.length); + }, + base64: (data, sourceEncoding) => { + if (data.length === 0) { + return ""; + } + if (typeof data === "string") { + data = Buffer.from(data, sourceEncoding); + } + return data.base64Slice(0, data.length); + }, + other: (data, sourceEncoding) => { + if (data.length === 0) { + return ""; + } + if (typeof data === "string") { + data = Buffer.from(data, sourceEncoding); + } + if (textDecoders.has(this.toString())) { + try { + return textDecoders.get(this).decode(data); + } catch { + } + } + return typeof data === "string" ? data : data.toString(); + } + }; + function decodeText(text, sourceEncoding, destEncoding) { + if (text) { + return getDecoder(destEncoding)(text, sourceEncoding); + } + return text; + } + decodeText_1 = decodeText; + return decodeText_1; +} +var parseParams_1; +var hasRequiredParseParams; +function requireParseParams() { + if (hasRequiredParseParams) return parseParams_1; + hasRequiredParseParams = 1; + const decodeText = requireDecodeText(); + const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g; + const EncodedLookup = { + "%00": "\0", + "%01": "", + "%02": "", + "%03": "", + "%04": "", + "%05": "", + "%06": "", + "%07": "\x07", + "%08": "\b", + "%09": " ", + "%0a": "\n", + "%0A": "\n", + "%0b": "\v", + "%0B": "\v", + "%0c": "\f", + "%0C": "\f", + "%0d": "\r", + "%0D": "\r", + "%0e": "", + "%0E": "", + "%0f": "", + "%0F": "", + "%10": "", + "%11": "", + "%12": "", + "%13": "", + "%14": "", + "%15": "", + "%16": "", + "%17": "", + "%18": "", + "%19": "", + "%1a": "", + "%1A": "", + "%1b": "\x1B", + "%1B": "\x1B", + "%1c": "", + "%1C": "", + "%1d": "", + "%1D": "", + "%1e": "", + "%1E": "", + "%1f": "", + "%1F": "", + "%20": " ", + "%21": "!", + "%22": '"', + "%23": "#", + "%24": "$", + "%25": "%", + "%26": "&", + "%27": "'", + "%28": "(", + "%29": ")", + "%2a": "*", + "%2A": "*", + "%2b": "+", + "%2B": "+", + "%2c": ",", + "%2C": ",", + "%2d": "-", + "%2D": "-", + "%2e": ".", + "%2E": ".", + "%2f": "/", + "%2F": "/", + "%30": "0", + "%31": "1", + "%32": "2", + "%33": "3", + "%34": "4", + "%35": "5", + "%36": "6", + "%37": "7", + "%38": "8", + "%39": "9", + "%3a": ":", + "%3A": ":", + "%3b": ";", + "%3B": ";", + "%3c": "<", + "%3C": "<", + "%3d": "=", + "%3D": "=", + "%3e": ">", + "%3E": ">", + "%3f": "?", + "%3F": "?", + "%40": "@", + "%41": "A", + "%42": "B", + "%43": "C", + "%44": "D", + "%45": "E", + "%46": "F", + "%47": "G", + "%48": "H", + "%49": "I", + "%4a": "J", + "%4A": "J", + "%4b": "K", + "%4B": "K", + "%4c": "L", + "%4C": "L", + "%4d": "M", + "%4D": "M", + "%4e": "N", + "%4E": "N", + "%4f": "O", + "%4F": "O", + "%50": "P", + "%51": "Q", + "%52": "R", + "%53": "S", + "%54": "T", + "%55": "U", + "%56": "V", + "%57": "W", + "%58": "X", + "%59": "Y", + "%5a": "Z", + "%5A": "Z", + "%5b": "[", + "%5B": "[", + "%5c": "\\", + "%5C": "\\", + "%5d": "]", + "%5D": "]", + "%5e": "^", + "%5E": "^", + "%5f": "_", + "%5F": "_", + "%60": "`", + "%61": "a", + "%62": "b", + "%63": "c", + "%64": "d", + "%65": "e", + "%66": "f", + "%67": "g", + "%68": "h", + "%69": "i", + "%6a": "j", + "%6A": "j", + "%6b": "k", + "%6B": "k", + "%6c": "l", + "%6C": "l", + "%6d": "m", + "%6D": "m", + "%6e": "n", + "%6E": "n", + "%6f": "o", + "%6F": "o", + "%70": "p", + "%71": "q", + "%72": "r", + "%73": "s", + "%74": "t", + "%75": "u", + "%76": "v", + "%77": "w", + "%78": "x", + "%79": "y", + "%7a": "z", + "%7A": "z", + "%7b": "{", + "%7B": "{", + "%7c": "|", + "%7C": "|", + "%7d": "}", + "%7D": "}", + "%7e": "~", + "%7E": "~", + "%7f": "", + "%7F": "", + "%80": "€", + "%81": "", + "%82": "‚", + "%83": "ƒ", + "%84": "„", + "%85": "…", + "%86": "†", + "%87": "‡", + "%88": "ˆ", + "%89": "‰", + "%8a": "Š", + "%8A": "Š", + "%8b": "‹", + "%8B": "‹", + "%8c": "Œ", + "%8C": "Œ", + "%8d": "", + "%8D": "", + "%8e": "Ž", + "%8E": "Ž", + "%8f": "", + "%8F": "", + "%90": "", + "%91": "‘", + "%92": "’", + "%93": "“", + "%94": "”", + "%95": "•", + "%96": "–", + "%97": "—", + "%98": "˜", + "%99": "™", + "%9a": "š", + "%9A": "š", + "%9b": "›", + "%9B": "›", + "%9c": "œ", + "%9C": "œ", + "%9d": "", + "%9D": "", + "%9e": "ž", + "%9E": "ž", + "%9f": "Ÿ", + "%9F": "Ÿ", + "%a0": " ", + "%A0": " ", + "%a1": "¡", + "%A1": "¡", + "%a2": "¢", + "%A2": "¢", + "%a3": "£", + "%A3": "£", + "%a4": "¤", + "%A4": "¤", + "%a5": "¥", + "%A5": "¥", + "%a6": "¦", + "%A6": "¦", + "%a7": "§", + "%A7": "§", + "%a8": "¨", + "%A8": "¨", + "%a9": "©", + "%A9": "©", + "%aa": "ª", + "%Aa": "ª", + "%aA": "ª", + "%AA": "ª", + "%ab": "«", + "%Ab": "«", + "%aB": "«", + "%AB": "«", + "%ac": "¬", + "%Ac": "¬", + "%aC": "¬", + "%AC": "¬", + "%ad": "­", + "%Ad": "­", + "%aD": "­", + "%AD": "­", + "%ae": "®", + "%Ae": "®", + "%aE": "®", + "%AE": "®", + "%af": "¯", + "%Af": "¯", + "%aF": "¯", + "%AF": "¯", + "%b0": "°", + "%B0": "°", + "%b1": "±", + "%B1": "±", + "%b2": "²", + "%B2": "²", + "%b3": "³", + "%B3": "³", + "%b4": "´", + "%B4": "´", + "%b5": "µ", + "%B5": "µ", + "%b6": "¶", + "%B6": "¶", + "%b7": "·", + "%B7": "·", + "%b8": "¸", + "%B8": "¸", + "%b9": "¹", + "%B9": "¹", + "%ba": "º", + "%Ba": "º", + "%bA": "º", + "%BA": "º", + "%bb": "»", + "%Bb": "»", + "%bB": "»", + "%BB": "»", + "%bc": "¼", + "%Bc": "¼", + "%bC": "¼", + "%BC": "¼", + "%bd": "½", + "%Bd": "½", + "%bD": "½", + "%BD": "½", + "%be": "¾", + "%Be": "¾", + "%bE": "¾", + "%BE": "¾", + "%bf": "¿", + "%Bf": "¿", + "%bF": "¿", + "%BF": "¿", + "%c0": "À", + "%C0": "À", + "%c1": "Á", + "%C1": "Á", + "%c2": "Â", + "%C2": "Â", + "%c3": "Ã", + "%C3": "Ã", + "%c4": "Ä", + "%C4": "Ä", + "%c5": "Å", + "%C5": "Å", + "%c6": "Æ", + "%C6": "Æ", + "%c7": "Ç", + "%C7": "Ç", + "%c8": "È", + "%C8": "È", + "%c9": "É", + "%C9": "É", + "%ca": "Ê", + "%Ca": "Ê", + "%cA": "Ê", + "%CA": "Ê", + "%cb": "Ë", + "%Cb": "Ë", + "%cB": "Ë", + "%CB": "Ë", + "%cc": "Ì", + "%Cc": "Ì", + "%cC": "Ì", + "%CC": "Ì", + "%cd": "Í", + "%Cd": "Í", + "%cD": "Í", + "%CD": "Í", + "%ce": "Î", + "%Ce": "Î", + "%cE": "Î", + "%CE": "Î", + "%cf": "Ï", + "%Cf": "Ï", + "%cF": "Ï", + "%CF": "Ï", + "%d0": "Ð", + "%D0": "Ð", + "%d1": "Ñ", + "%D1": "Ñ", + "%d2": "Ò", + "%D2": "Ò", + "%d3": "Ó", + "%D3": "Ó", + "%d4": "Ô", + "%D4": "Ô", + "%d5": "Õ", + "%D5": "Õ", + "%d6": "Ö", + "%D6": "Ö", + "%d7": "×", + "%D7": "×", + "%d8": "Ø", + "%D8": "Ø", + "%d9": "Ù", + "%D9": "Ù", + "%da": "Ú", + "%Da": "Ú", + "%dA": "Ú", + "%DA": "Ú", + "%db": "Û", + "%Db": "Û", + "%dB": "Û", + "%DB": "Û", + "%dc": "Ü", + "%Dc": "Ü", + "%dC": "Ü", + "%DC": "Ü", + "%dd": "Ý", + "%Dd": "Ý", + "%dD": "Ý", + "%DD": "Ý", + "%de": "Þ", + "%De": "Þ", + "%dE": "Þ", + "%DE": "Þ", + "%df": "ß", + "%Df": "ß", + "%dF": "ß", + "%DF": "ß", + "%e0": "à", + "%E0": "à", + "%e1": "á", + "%E1": "á", + "%e2": "â", + "%E2": "â", + "%e3": "ã", + "%E3": "ã", + "%e4": "ä", + "%E4": "ä", + "%e5": "å", + "%E5": "å", + "%e6": "æ", + "%E6": "æ", + "%e7": "ç", + "%E7": "ç", + "%e8": "è", + "%E8": "è", + "%e9": "é", + "%E9": "é", + "%ea": "ê", + "%Ea": "ê", + "%eA": "ê", + "%EA": "ê", + "%eb": "ë", + "%Eb": "ë", + "%eB": "ë", + "%EB": "ë", + "%ec": "ì", + "%Ec": "ì", + "%eC": "ì", + "%EC": "ì", + "%ed": "í", + "%Ed": "í", + "%eD": "í", + "%ED": "í", + "%ee": "î", + "%Ee": "î", + "%eE": "î", + "%EE": "î", + "%ef": "ï", + "%Ef": "ï", + "%eF": "ï", + "%EF": "ï", + "%f0": "ð", + "%F0": "ð", + "%f1": "ñ", + "%F1": "ñ", + "%f2": "ò", + "%F2": "ò", + "%f3": "ó", + "%F3": "ó", + "%f4": "ô", + "%F4": "ô", + "%f5": "õ", + "%F5": "õ", + "%f6": "ö", + "%F6": "ö", + "%f7": "÷", + "%F7": "÷", + "%f8": "ø", + "%F8": "ø", + "%f9": "ù", + "%F9": "ù", + "%fa": "ú", + "%Fa": "ú", + "%fA": "ú", + "%FA": "ú", + "%fb": "û", + "%Fb": "û", + "%fB": "û", + "%FB": "û", + "%fc": "ü", + "%Fc": "ü", + "%fC": "ü", + "%FC": "ü", + "%fd": "ý", + "%Fd": "ý", + "%fD": "ý", + "%FD": "ý", + "%fe": "þ", + "%Fe": "þ", + "%fE": "þ", + "%FE": "þ", + "%ff": "ÿ", + "%Ff": "ÿ", + "%fF": "ÿ", + "%FF": "ÿ" + }; + function encodedReplacer(match) { + return EncodedLookup[match]; + } + const STATE_KEY = 0; + const STATE_VALUE = 1; + const STATE_CHARSET = 2; + const STATE_LANG = 3; + function parseParams(str) { + const res = []; + let state = STATE_KEY; + let charset = ""; + let inquote = false; + let escaping = false; + let p = 0; + let tmp = ""; + const len = str.length; + for (var i = 0; i < len; ++i) { + const char = str[i]; + if (char === "\\" && inquote) { + if (escaping) { + escaping = false; + } else { + escaping = true; + continue; + } + } else if (char === '"') { + if (!escaping) { + if (inquote) { + inquote = false; + state = STATE_KEY; + } else { + inquote = true; + } + continue; + } else { + escaping = false; + } + } else { + if (escaping && inquote) { + tmp += "\\"; + } + escaping = false; + if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") { + if (state === STATE_CHARSET) { + state = STATE_LANG; + charset = tmp.substring(1); + } else { + state = STATE_VALUE; + } + tmp = ""; + continue; + } else if (state === STATE_KEY && (char === "*" || char === "=") && res.length) { + state = char === "*" ? STATE_CHARSET : STATE_VALUE; + res[p] = [tmp, void 0]; + tmp = ""; + continue; + } else if (!inquote && char === ";") { + state = STATE_KEY; + if (charset) { + if (tmp.length) { + tmp = decodeText( + tmp.replace(RE_ENCODED, encodedReplacer), + "binary", + charset + ); + } + charset = ""; + } else if (tmp.length) { + tmp = decodeText(tmp, "binary", "utf8"); + } + if (res[p] === void 0) { + res[p] = tmp; + } else { + res[p][1] = tmp; + } + tmp = ""; + ++p; + continue; + } else if (!inquote && (char === " " || char === " ")) { + continue; + } + } + tmp += char; + } + if (charset && tmp.length) { + tmp = decodeText( + tmp.replace(RE_ENCODED, encodedReplacer), + "binary", + charset + ); + } else if (tmp) { + tmp = decodeText(tmp, "binary", "utf8"); + } + if (res[p] === void 0) { + if (tmp) { + res[p] = tmp; + } + } else { + res[p][1] = tmp; + } + return res; + } + parseParams_1 = parseParams; + return parseParams_1; +} +var basename; +var hasRequiredBasename; +function requireBasename() { + if (hasRequiredBasename) return basename; + hasRequiredBasename = 1; + basename = function basename2(path2) { + if (typeof path2 !== "string") { + return ""; + } + for (var i = path2.length - 1; i >= 0; --i) { + switch (path2.charCodeAt(i)) { + case 47: + case 92: + path2 = path2.slice(i + 1); + return path2 === ".." || path2 === "." ? "" : path2; + } + } + return path2 === ".." || path2 === "." ? "" : path2; + }; + return basename; +} +var multipart; +var hasRequiredMultipart; +function requireMultipart() { + if (hasRequiredMultipart) return multipart; + hasRequiredMultipart = 1; + const { Readable: Readable2 } = require$$0; + const { inherits } = require$$0; + const Dicer = requireDicer(); + const parseParams = requireParseParams(); + const decodeText = requireDecodeText(); + const basename2 = requireBasename(); + const getLimit2 = requireGetLimit(); + const RE_BOUNDARY = /^boundary$/i; + const RE_FIELD = /^form-data$/i; + const RE_CHARSET = /^charset$/i; + const RE_FILENAME = /^filename$/i; + const RE_NAME = /^name$/i; + Multipart.detect = /^multipart\/form-data/i; + function Multipart(boy, cfg) { + let i; + let len; + const self2 = this; + let boundary; + const limits = cfg.limits; + const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => contentType === "application/octet-stream" || fileName !== void 0); + const parsedConType = cfg.parsedConType || []; + const defCharset = cfg.defCharset || "utf8"; + const preservePath = cfg.preservePath; + const fileOpts = { highWaterMark: cfg.fileHwm }; + for (i = 0, len = parsedConType.length; i < len; ++i) { + if (Array.isArray(parsedConType[i]) && RE_BOUNDARY.test(parsedConType[i][0])) { + boundary = parsedConType[i][1]; + break; + } + } + function checkFinished() { + if (nends === 0 && finished2 && !boy._done) { + finished2 = false; + self2.end(); + } + } + if (typeof boundary !== "string") { + throw new Error("Multipart: Boundary not found"); + } + const fieldSizeLimit = getLimit2(limits, "fieldSize", 1 * 1024 * 1024); + const fileSizeLimit = getLimit2(limits, "fileSize", Infinity); + const filesLimit = getLimit2(limits, "files", Infinity); + const fieldsLimit = getLimit2(limits, "fields", Infinity); + const partsLimit = getLimit2(limits, "parts", Infinity); + const headerPairsLimit = getLimit2(limits, "headerPairs", 2e3); + const headerSizeLimit = getLimit2(limits, "headerSize", 80 * 1024); + let nfiles = 0; + let nfields = 0; + let nends = 0; + let curFile; + let curField; + let finished2 = false; + this._needDrain = false; + this._pause = false; + this._cb = void 0; + this._nparts = 0; + this._boy = boy; + const parserCfg = { + boundary, + maxHeaderPairs: headerPairsLimit, + maxHeaderSize: headerSizeLimit, + partHwm: fileOpts.highWaterMark, + highWaterMark: cfg.highWaterMark + }; + this.parser = new Dicer(parserCfg); + this.parser.on("drain", function() { + self2._needDrain = false; + if (self2._cb && !self2._pause) { + const cb = self2._cb; + self2._cb = void 0; + cb(); + } + }).on("part", function onPart(part) { + if (++self2._nparts > partsLimit) { + self2.parser.removeListener("part", onPart); + self2.parser.on("part", skipPart); + boy.hitPartsLimit = true; + boy.emit("partsLimit"); + return skipPart(part); + } + if (curField) { + const field = curField; + field.emit("end"); + field.removeAllListeners("end"); + } + part.on("header", function(header2) { + let contype; + let fieldname; + let parsed; + let charset; + let encoding2; + let filename; + let nsize = 0; + if (header2["content-type"]) { + parsed = parseParams(header2["content-type"][0]); + if (parsed[0]) { + contype = parsed[0].toLowerCase(); + for (i = 0, len = parsed.length; i < len; ++i) { + if (RE_CHARSET.test(parsed[i][0])) { + charset = parsed[i][1].toLowerCase(); + break; + } + } + } + } + if (contype === void 0) { + contype = "text/plain"; + } + if (charset === void 0) { + charset = defCharset; + } + if (header2["content-disposition"]) { + parsed = parseParams(header2["content-disposition"][0]); + if (!RE_FIELD.test(parsed[0])) { + return skipPart(part); + } + for (i = 0, len = parsed.length; i < len; ++i) { + if (RE_NAME.test(parsed[i][0])) { + fieldname = parsed[i][1]; + } else if (RE_FILENAME.test(parsed[i][0])) { + filename = parsed[i][1]; + if (!preservePath) { + filename = basename2(filename); + } + } + } + } else { + return skipPart(part); + } + if (header2["content-transfer-encoding"]) { + encoding2 = header2["content-transfer-encoding"][0].toLowerCase(); + } else { + encoding2 = "7bit"; + } + let onData, onEnd; + if (isPartAFile(fieldname, contype, filename)) { + if (nfiles === filesLimit) { + if (!boy.hitFilesLimit) { + boy.hitFilesLimit = true; + boy.emit("filesLimit"); + } + return skipPart(part); + } + ++nfiles; + if (boy.listenerCount("file") === 0) { + self2.parser._ignore(); + return; + } + ++nends; + const file2 = new FileStream(fileOpts); + curFile = file2; + file2.on("end", function() { + --nends; + self2._pause = false; + checkFinished(); + if (self2._cb && !self2._needDrain) { + const cb = self2._cb; + self2._cb = void 0; + cb(); + } + }); + file2._read = function(n) { + if (!self2._pause) { + return; + } + self2._pause = false; + if (self2._cb && !self2._needDrain) { + const cb = self2._cb; + self2._cb = void 0; + cb(); + } + }; + boy.emit("file", fieldname, file2, filename, encoding2, contype); + onData = function(data) { + if ((nsize += data.length) > fileSizeLimit) { + const extralen = fileSizeLimit - nsize + data.length; + if (extralen > 0) { + file2.push(data.slice(0, extralen)); + } + file2.truncated = true; + file2.bytesRead = fileSizeLimit; + part.removeAllListeners("data"); + file2.emit("limit"); + return; + } else if (!file2.push(data)) { + self2._pause = true; + } + file2.bytesRead = nsize; + }; + onEnd = function() { + curFile = void 0; + file2.push(null); + }; + } else { + if (nfields === fieldsLimit) { + if (!boy.hitFieldsLimit) { + boy.hitFieldsLimit = true; + boy.emit("fieldsLimit"); + } + return skipPart(part); + } + ++nfields; + ++nends; + let buffer = ""; + let truncated = false; + curField = part; + onData = function(data) { + if ((nsize += data.length) > fieldSizeLimit) { + const extralen = fieldSizeLimit - (nsize - data.length); + buffer += data.toString("binary", 0, extralen); + truncated = true; + part.removeAllListeners("data"); + } else { + buffer += data.toString("binary"); + } + }; + onEnd = function() { + curField = void 0; + if (buffer.length) { + buffer = decodeText(buffer, "binary", charset); + } + boy.emit("field", fieldname, buffer, false, truncated, encoding2, contype); + --nends; + checkFinished(); + }; + } + part._readableState.sync = false; + part.on("data", onData); + part.on("end", onEnd); + }).on("error", function(err) { + if (curFile) { + curFile.emit("error", err); + } + }); + }).on("error", function(err) { + boy.emit("error", err); + }).on("finish", function() { + finished2 = true; + checkFinished(); + }); + } + Multipart.prototype.write = function(chunk, cb) { + const r = this.parser.write(chunk); + if (r && !this._pause) { + cb(); + } else { + this._needDrain = !r; + this._cb = cb; + } + }; + Multipart.prototype.end = function() { + const self2 = this; + if (self2.parser.writable) { + self2.parser.end(); + } else if (!self2._boy._done) { + process.nextTick(function() { + self2._boy._done = true; + self2._boy.emit("finish"); + }); + } + }; + function skipPart(part) { + part.resume(); + } + function FileStream(opts) { + Readable2.call(this, opts); + this.bytesRead = 0; + this.truncated = false; + } + inherits(FileStream, Readable2); + FileStream.prototype._read = function(n) { + }; + multipart = Multipart; + return multipart; +} +var Decoder_1; +var hasRequiredDecoder; +function requireDecoder() { + if (hasRequiredDecoder) return Decoder_1; + hasRequiredDecoder = 1; + const RE_PLUS = /\+/g; + const HEX = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]; + function Decoder() { + this.buffer = void 0; + } + Decoder.prototype.write = function(str) { + str = str.replace(RE_PLUS, " "); + let res = ""; + let i = 0; + let p = 0; + const len = str.length; + for (; i < len; ++i) { + if (this.buffer !== void 0) { + if (!HEX[str.charCodeAt(i)]) { + res += "%" + this.buffer; + this.buffer = void 0; + --i; + } else { + this.buffer += str[i]; + ++p; + if (this.buffer.length === 2) { + res += String.fromCharCode(parseInt(this.buffer, 16)); + this.buffer = void 0; + } + } + } else if (str[i] === "%") { + if (i > p) { + res += str.substring(p, i); + p = i; + } + this.buffer = ""; + ++p; + } + } + if (p < len && this.buffer === void 0) { + res += str.substring(p); + } + return res; + }; + Decoder.prototype.reset = function() { + this.buffer = void 0; + }; + Decoder_1 = Decoder; + return Decoder_1; +} +var urlencoded; +var hasRequiredUrlencoded; +function requireUrlencoded() { + if (hasRequiredUrlencoded) return urlencoded; + hasRequiredUrlencoded = 1; + const Decoder = requireDecoder(); + const decodeText = requireDecodeText(); + const getLimit2 = requireGetLimit(); + const RE_CHARSET = /^charset$/i; + UrlEncoded.detect = /^application\/x-www-form-urlencoded/i; + function UrlEncoded(boy, cfg) { + const limits = cfg.limits; + const parsedConType = cfg.parsedConType; + this.boy = boy; + this.fieldSizeLimit = getLimit2(limits, "fieldSize", 1 * 1024 * 1024); + this.fieldNameSizeLimit = getLimit2(limits, "fieldNameSize", 100); + this.fieldsLimit = getLimit2(limits, "fields", Infinity); + let charset; + for (var i = 0, len = parsedConType.length; i < len; ++i) { + if (Array.isArray(parsedConType[i]) && RE_CHARSET.test(parsedConType[i][0])) { + charset = parsedConType[i][1].toLowerCase(); + break; + } + } + if (charset === void 0) { + charset = cfg.defCharset || "utf8"; + } + this.decoder = new Decoder(); + this.charset = charset; + this._fields = 0; + this._state = "key"; + this._checkingBytes = true; + this._bytesKey = 0; + this._bytesVal = 0; + this._key = ""; + this._val = ""; + this._keyTrunc = false; + this._valTrunc = false; + this._hitLimit = false; + } + UrlEncoded.prototype.write = function(data, cb) { + if (this._fields === this.fieldsLimit) { + if (!this.boy.hitFieldsLimit) { + this.boy.hitFieldsLimit = true; + this.boy.emit("fieldsLimit"); + } + return cb(); + } + let idxeq; + let idxamp; + let i; + let p = 0; + const len = data.length; + while (p < len) { + if (this._state === "key") { + idxeq = idxamp = void 0; + for (i = p; i < len; ++i) { + if (!this._checkingBytes) { + ++p; + } + if (data[i] === 61) { + idxeq = i; + break; + } else if (data[i] === 38) { + idxamp = i; + break; + } + if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { + this._hitLimit = true; + break; + } else if (this._checkingBytes) { + ++this._bytesKey; + } + } + if (idxeq !== void 0) { + if (idxeq > p) { + this._key += this.decoder.write(data.toString("binary", p, idxeq)); + } + this._state = "val"; + this._hitLimit = false; + this._checkingBytes = true; + this._val = ""; + this._bytesVal = 0; + this._valTrunc = false; + this.decoder.reset(); + p = idxeq + 1; + } else if (idxamp !== void 0) { + ++this._fields; + let key; + const keyTrunc = this._keyTrunc; + if (idxamp > p) { + key = this._key += this.decoder.write(data.toString("binary", p, idxamp)); + } else { + key = this._key; + } + this._hitLimit = false; + this._checkingBytes = true; + this._key = ""; + this._bytesKey = 0; + this._keyTrunc = false; + this.decoder.reset(); + if (key.length) { + this.boy.emit( + "field", + decodeText(key, "binary", this.charset), + "", + keyTrunc, + false + ); + } + p = idxamp + 1; + if (this._fields === this.fieldsLimit) { + return cb(); + } + } else if (this._hitLimit) { + if (i > p) { + this._key += this.decoder.write(data.toString("binary", p, i)); + } + p = i; + if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { + this._checkingBytes = false; + this._keyTrunc = true; + } + } else { + if (p < len) { + this._key += this.decoder.write(data.toString("binary", p)); + } + p = len; + } + } else { + idxamp = void 0; + for (i = p; i < len; ++i) { + if (!this._checkingBytes) { + ++p; + } + if (data[i] === 38) { + idxamp = i; + break; + } + if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { + this._hitLimit = true; + break; + } else if (this._checkingBytes) { + ++this._bytesVal; + } + } + if (idxamp !== void 0) { + ++this._fields; + if (idxamp > p) { + this._val += this.decoder.write(data.toString("binary", p, idxamp)); + } + this.boy.emit( + "field", + decodeText(this._key, "binary", this.charset), + decodeText(this._val, "binary", this.charset), + this._keyTrunc, + this._valTrunc + ); + this._state = "key"; + this._hitLimit = false; + this._checkingBytes = true; + this._key = ""; + this._bytesKey = 0; + this._keyTrunc = false; + this.decoder.reset(); + p = idxamp + 1; + if (this._fields === this.fieldsLimit) { + return cb(); + } + } else if (this._hitLimit) { + if (i > p) { + this._val += this.decoder.write(data.toString("binary", p, i)); + } + p = i; + if (this._val === "" && this.fieldSizeLimit === 0 || (this._bytesVal = this._val.length) === this.fieldSizeLimit) { + this._checkingBytes = false; + this._valTrunc = true; + } + } else { + if (p < len) { + this._val += this.decoder.write(data.toString("binary", p)); + } + p = len; + } + } + } + cb(); + }; + UrlEncoded.prototype.end = function() { + if (this.boy._done) { + return; + } + if (this._state === "key" && this._key.length > 0) { + this.boy.emit( + "field", + decodeText(this._key, "binary", this.charset), + "", + this._keyTrunc, + false + ); + } else if (this._state === "val") { + this.boy.emit( + "field", + decodeText(this._key, "binary", this.charset), + decodeText(this._val, "binary", this.charset), + this._keyTrunc, + this._valTrunc + ); + } + this.boy._done = true; + this.boy.emit("finish"); + }; + urlencoded = UrlEncoded; + return urlencoded; +} +var hasRequiredMain; +function requireMain() { + if (hasRequiredMain) return main$1.exports; + hasRequiredMain = 1; + const WritableStream = require$$0.Writable; + const { inherits } = require$$0; + const Dicer = requireDicer(); + const MultipartParser = requireMultipart(); + const UrlencodedParser = requireUrlencoded(); + const parseParams = requireParseParams(); + function Busboy(opts) { + if (!(this instanceof Busboy)) { + return new Busboy(opts); + } + if (typeof opts !== "object") { + throw new TypeError("Busboy expected an options-Object."); + } + if (typeof opts.headers !== "object") { + throw new TypeError("Busboy expected an options-Object with headers-attribute."); + } + if (typeof opts.headers["content-type"] !== "string") { + throw new TypeError("Missing Content-Type-header."); + } + const { + headers: headers2, + ...streamOptions + } = opts; + this.opts = { + autoDestroy: false, + ...streamOptions + }; + WritableStream.call(this, this.opts); + this._done = false; + this._parser = this.getParserByHeaders(headers2); + this._finished = false; + } + inherits(Busboy, WritableStream); + Busboy.prototype.emit = function(ev) { + var _a2; + if (ev === "finish") { + if (!this._done) { + (_a2 = this._parser) == null ? void 0 : _a2.end(); + return; + } else if (this._finished) { + return; + } + this._finished = true; + } + WritableStream.prototype.emit.apply(this, arguments); + }; + Busboy.prototype.getParserByHeaders = function(headers2) { + const parsed = parseParams(headers2["content-type"]); + const cfg = { + defCharset: this.opts.defCharset, + fileHwm: this.opts.fileHwm, + headers: headers2, + highWaterMark: this.opts.highWaterMark, + isPartAFile: this.opts.isPartAFile, + limits: this.opts.limits, + parsedConType: parsed, + preservePath: this.opts.preservePath + }; + if (MultipartParser.detect.test(parsed[0])) { + return new MultipartParser(this, cfg); + } + if (UrlencodedParser.detect.test(parsed[0])) { + return new UrlencodedParser(this, cfg); + } + throw new Error("Unsupported Content-Type."); + }; + Busboy.prototype._write = function(chunk, encoding2, cb) { + this._parser.write(chunk, cb); + }; + main$1.exports = Busboy; + main$1.exports.default = Busboy; + main$1.exports.Busboy = Busboy; + main$1.exports.Dicer = Dicer; + return main$1.exports; +} +var constants$c; +var hasRequiredConstants$3; +function requireConstants$3() { + if (hasRequiredConstants$3) return constants$c; + hasRequiredConstants$3 = 1; + const { MessageChannel, receiveMessageOnPort } = require$$0$7; + const corsSafeListedMethods = ["GET", "HEAD", "POST"]; + const corsSafeListedMethodsSet = new Set(corsSafeListedMethods); + const nullBodyStatus = [101, 204, 205, 304]; + const redirectStatus = [301, 302, 303, 307, 308]; + const redirectStatusSet = new Set(redirectStatus); + const badPorts = [ + "1", + "7", + "9", + "11", + "13", + "15", + "17", + "19", + "20", + "21", + "22", + "23", + "25", + "37", + "42", + "43", + "53", + "69", + "77", + "79", + "87", + "95", + "101", + "102", + "103", + "104", + "109", + "110", + "111", + "113", + "115", + "117", + "119", + "123", + "135", + "137", + "139", + "143", + "161", + "179", + "389", + "427", + "465", + "512", + "513", + "514", + "515", + "526", + "530", + "531", + "532", + "540", + "548", + "554", + "556", + "563", + "587", + "601", + "636", + "989", + "990", + "993", + "995", + "1719", + "1720", + "1723", + "2049", + "3659", + "4045", + "5060", + "5061", + "6000", + "6566", + "6665", + "6666", + "6667", + "6668", + "6669", + "6697", + "10080" + ]; + const badPortsSet = new Set(badPorts); + const referrerPolicy = [ + "", + "no-referrer", + "no-referrer-when-downgrade", + "same-origin", + "origin", + "strict-origin", + "origin-when-cross-origin", + "strict-origin-when-cross-origin", + "unsafe-url" + ]; + const referrerPolicySet = new Set(referrerPolicy); + const requestRedirect = ["follow", "manual", "error"]; + const safeMethods = ["GET", "HEAD", "OPTIONS", "TRACE"]; + const safeMethodsSet = new Set(safeMethods); + const requestMode = ["navigate", "same-origin", "no-cors", "cors"]; + const requestCredentials = ["omit", "same-origin", "include"]; + const requestCache = [ + "default", + "no-store", + "reload", + "no-cache", + "force-cache", + "only-if-cached" + ]; + const requestBodyHeader = [ + "content-encoding", + "content-language", + "content-location", + "content-type", + // See https://github.com/nodejs/undici/issues/2021 + // 'Content-Length' is a forbidden header name, which is typically + // removed in the Headers implementation. However, undici doesn't + // filter out headers, so we add it here. + "content-length" + ]; + const requestDuplex = [ + "half" + ]; + const forbiddenMethods = ["CONNECT", "TRACE", "TRACK"]; + const forbiddenMethodsSet = new Set(forbiddenMethods); + const subresource = [ + "audio", + "audioworklet", + "font", + "image", + "manifest", + "paintworklet", + "script", + "style", + "track", + "video", + "xslt", + "" + ]; + const subresourceSet = new Set(subresource); + const DOMException2 = globalThis.DOMException ?? (() => { + try { + atob("~"); + } catch (err) { + return Object.getPrototypeOf(err).constructor; + } + })(); + let channel; + const structuredClone = globalThis.structuredClone ?? // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js + // structuredClone was added in v17.0.0, but fetch supports v16.8 + function structuredClone2(value, options2 = void 0) { + if (arguments.length === 0) { + throw new TypeError("missing argument"); + } + if (!channel) { + channel = new MessageChannel(); + } + channel.port1.unref(); + channel.port2.unref(); + channel.port1.postMessage(value, options2 == null ? void 0 : options2.transfer); + return receiveMessageOnPort(channel.port2).message; + }; + constants$c = { + DOMException: DOMException2, + structuredClone, + subresource, + forbiddenMethods, + requestBodyHeader, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + redirectStatus, + corsSafeListedMethods, + nullBodyStatus, + safeMethods, + badPorts, + requestDuplex, + subresourceSet, + badPortsSet, + redirectStatusSet, + corsSafeListedMethodsSet, + safeMethodsSet, + forbiddenMethodsSet, + referrerPolicySet + }; + return constants$c; +} +var global$2; +var hasRequiredGlobal; +function requireGlobal() { + if (hasRequiredGlobal) return global$2; + hasRequiredGlobal = 1; + const globalOrigin = Symbol.for("undici.globalOrigin.1"); + function getGlobalOrigin() { + return globalThis[globalOrigin]; + } + function setGlobalOrigin(newOrigin) { + if (newOrigin === void 0) { + Object.defineProperty(globalThis, globalOrigin, { + value: void 0, + writable: true, + enumerable: false, + configurable: false + }); + return; + } + const parsedURL = new URL(newOrigin); + if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") { + throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`); + } + Object.defineProperty(globalThis, globalOrigin, { + value: parsedURL, + writable: true, + enumerable: false, + configurable: false + }); + } + global$2 = { + getGlobalOrigin, + setGlobalOrigin + }; + return global$2; +} +var util$k; +var hasRequiredUtil$4; +function requireUtil$4() { + if (hasRequiredUtil$4) return util$k; + hasRequiredUtil$4 = 1; + const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = requireConstants$3(); + const { getGlobalOrigin } = requireGlobal(); + const { performance: performance2 } = require$$2$3; + const { isBlobLike: isBlobLike2, toUSVString: toUSVString2, ReadableStreamFrom: ReadableStreamFrom2 } = util$l; + const assert2 = require$$0$4; + const { isUint8Array } = require$$5; + let supportedHashes = []; + let crypto2; + try { + crypto2 = require("crypto"); + const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + } catch { + } + function responseURL(response2) { + const urlList = response2.urlList; + const length = urlList.length; + return length === 0 ? null : urlList[length - 1].toString(); + } + function responseLocationURL(response2, requestFragment) { + if (!redirectStatusSet.has(response2.status)) { + return null; + } + let location = response2.headersList.get("location"); + if (location !== null && isValidHeaderValue(location)) { + location = new URL(location, responseURL(response2)); + } + if (location && !location.hash) { + location.hash = requestFragment; + } + return location; + } + function requestCurrentURL(request2) { + return request2.urlList[request2.urlList.length - 1]; + } + function requestBadPort(request2) { + const url = requestCurrentURL(request2); + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { + return "blocked"; + } + return "allowed"; + } + function isErrorLike(object) { + var _a2, _b; + return object instanceof Error || (((_a2 = object == null ? void 0 : object.constructor) == null ? void 0 : _a2.name) === "Error" || ((_b = object == null ? void 0 : object.constructor) == null ? void 0 : _b.name) === "DOMException"); + } + function isValidReasonPhrase(statusText) { + for (let i = 0; i < statusText.length; ++i) { + const c = statusText.charCodeAt(i); + if (!(c === 9 || // HTAB + c >= 32 && c <= 126 || // SP / VCHAR + c >= 128 && c <= 255)) { + return false; + } + } + return true; + } + function isTokenCharCode(c) { + switch (c) { + case 34: + case 40: + case 41: + case 44: + case 47: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 91: + case 92: + case 93: + case 123: + case 125: + return false; + default: + return c >= 33 && c <= 126; + } + } + function isValidHTTPToken(characters) { + if (characters.length === 0) { + return false; + } + for (let i = 0; i < characters.length; ++i) { + if (!isTokenCharCode(characters.charCodeAt(i))) { + return false; + } + } + return true; + } + function isValidHeaderName(potentialValue) { + return isValidHTTPToken(potentialValue); + } + function isValidHeaderValue(potentialValue) { + if (potentialValue.startsWith(" ") || potentialValue.startsWith(" ") || potentialValue.endsWith(" ") || potentialValue.endsWith(" ")) { + return false; + } + if (potentialValue.includes("\0") || potentialValue.includes("\r") || potentialValue.includes("\n")) { + return false; + } + return true; + } + function setRequestReferrerPolicyOnRedirect(request2, actualResponse) { + const { headersList } = actualResponse; + const policyHeader = (headersList.get("referrer-policy") ?? "").split(","); + let policy = ""; + if (policyHeader.length > 0) { + for (let i = policyHeader.length; i !== 0; i--) { + const token = policyHeader[i - 1].trim(); + if (referrerPolicyTokens.has(token)) { + policy = token; + break; + } + } + } + if (policy !== "") { + request2.referrerPolicy = policy; + } + } + function crossOriginResourcePolicyCheck() { + return "allowed"; + } + function corsCheck() { + return "success"; + } + function TAOCheck() { + return "success"; + } + function appendFetchMetadata(httpRequest) { + let header2 = null; + header2 = httpRequest.mode; + httpRequest.headersList.set("sec-fetch-mode", header2); + } + function appendRequestOriginHeader(request2) { + let serializedOrigin = request2.origin; + if (request2.responseTainting === "cors" || request2.mode === "websocket") { + if (serializedOrigin) { + request2.headersList.append("origin", serializedOrigin); + } + } else if (request2.method !== "GET" && request2.method !== "HEAD") { + switch (request2.referrerPolicy) { + case "no-referrer": + serializedOrigin = null; + break; + case "no-referrer-when-downgrade": + case "strict-origin": + case "strict-origin-when-cross-origin": + if (request2.origin && urlHasHttpsScheme(request2.origin) && !urlHasHttpsScheme(requestCurrentURL(request2))) { + serializedOrigin = null; + } + break; + case "same-origin": + if (!sameOrigin(request2, requestCurrentURL(request2))) { + serializedOrigin = null; + } + break; + } + if (serializedOrigin) { + request2.headersList.append("origin", serializedOrigin); + } + } + } + function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { + return performance2.now(); + } + function createOpaqueTimingInfo(timingInfo) { + return { + startTime: timingInfo.startTime ?? 0, + redirectStartTime: 0, + redirectEndTime: 0, + postRedirectStartTime: timingInfo.startTime ?? 0, + finalServiceWorkerStartTime: 0, + finalNetworkResponseStartTime: 0, + finalNetworkRequestStartTime: 0, + endTime: 0, + encodedBodySize: 0, + decodedBodySize: 0, + finalConnectionTimingInfo: null + }; + } + function makePolicyContainer() { + return { + referrerPolicy: "strict-origin-when-cross-origin" + }; + } + function clonePolicyContainer(policyContainer) { + return { + referrerPolicy: policyContainer.referrerPolicy + }; + } + function determineRequestsReferrer(request2) { + const policy = request2.referrerPolicy; + assert2(policy); + let referrerSource = null; + if (request2.referrer === "client") { + const globalOrigin = getGlobalOrigin(); + if (!globalOrigin || globalOrigin.origin === "null") { + return "no-referrer"; + } + referrerSource = new URL(globalOrigin); + } else if (request2.referrer instanceof URL) { + referrerSource = request2.referrer; + } + let referrerURL = stripURLForReferrer(referrerSource); + const referrerOrigin = stripURLForReferrer(referrerSource, true); + if (referrerURL.toString().length > 4096) { + referrerURL = referrerOrigin; + } + const areSameOrigin = sameOrigin(request2, referrerURL); + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request2.url); + switch (policy) { + case "origin": + return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true); + case "unsafe-url": + return referrerURL; + case "same-origin": + return areSameOrigin ? referrerOrigin : "no-referrer"; + case "origin-when-cross-origin": + return areSameOrigin ? referrerURL : referrerOrigin; + case "strict-origin-when-cross-origin": { + const currentURL = requestCurrentURL(request2); + if (sameOrigin(referrerURL, currentURL)) { + return referrerURL; + } + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { + return "no-referrer"; + } + return referrerOrigin; + } + case "strict-origin": + case "no-referrer-when-downgrade": + default: + return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; + } + } + function stripURLForReferrer(url, originOnly) { + assert2(url instanceof URL); + if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") { + return "no-referrer"; + } + url.username = ""; + url.password = ""; + url.hash = ""; + if (originOnly) { + url.pathname = ""; + url.search = ""; + } + return url; + } + function isURLPotentiallyTrustworthy(url) { + if (!(url instanceof URL)) { + return false; + } + if (url.href === "about:blank" || url.href === "about:srcdoc") { + return true; + } + if (url.protocol === "data:") return true; + if (url.protocol === "file:") return true; + return isOriginPotentiallyTrustworthy(url.origin); + function isOriginPotentiallyTrustworthy(origin) { + if (origin == null || origin === "null") return false; + const originAsURL = new URL(origin); + if (originAsURL.protocol === "https:" || originAsURL.protocol === "wss:") { + return true; + } + if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || (originAsURL.hostname === "localhost" || originAsURL.hostname.includes("localhost.")) || originAsURL.hostname.endsWith(".localhost")) { + return true; + } + return false; + } + } + function bytesMatch(bytes, metadataList) { + if (crypto2 === void 0) { + return true; + } + const parsedMetadata = parseMetadata(metadataList); + if (parsedMetadata === "no metadata") { + return true; + } + if (parsedMetadata.length === 0) { + return true; + } + const strongest = getStrongestMetadata(parsedMetadata); + const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest); + for (const item of metadata) { + const algorithm = item.algo; + const expectedValue = item.hash; + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); + if (actualValue[actualValue.length - 1] === "=") { + if (actualValue[actualValue.length - 2] === "=") { + actualValue = actualValue.slice(0, -2); + } else { + actualValue = actualValue.slice(0, -1); + } + } + if (compareBase64Mixed(actualValue, expectedValue)) { + return true; + } + } + return false; + } + const parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i; + function parseMetadata(metadata) { + const result = []; + let empty = true; + for (const token of metadata.split(" ")) { + empty = false; + const parsedToken = parseHashWithOptions.exec(token); + if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) { + continue; + } + const algorithm = parsedToken.groups.algo.toLowerCase(); + if (supportedHashes.includes(algorithm)) { + result.push(parsedToken.groups); + } + } + if (empty === true) { + return "no metadata"; + } + return result; + } + function getStrongestMetadata(metadataList) { + let algorithm = metadataList[0].algo; + if (algorithm[3] === "5") { + return algorithm; + } + for (let i = 1; i < metadataList.length; ++i) { + const metadata = metadataList[i]; + if (metadata.algo[3] === "5") { + algorithm = "sha512"; + break; + } else if (algorithm[3] === "3") { + continue; + } else if (metadata.algo[3] === "3") { + algorithm = "sha384"; + } + } + return algorithm; + } + function filterMetadataListByAlgorithm(metadataList, algorithm) { + if (metadataList.length === 1) { + return metadataList; + } + let pos2 = 0; + for (let i = 0; i < metadataList.length; ++i) { + if (metadataList[i].algo === algorithm) { + metadataList[pos2++] = metadataList[i]; + } + } + metadataList.length = pos2; + return metadataList; + } + function compareBase64Mixed(actualValue, expectedValue) { + if (actualValue.length !== expectedValue.length) { + return false; + } + for (let i = 0; i < actualValue.length; ++i) { + if (actualValue[i] !== expectedValue[i]) { + if (actualValue[i] === "+" && expectedValue[i] === "-" || actualValue[i] === "/" && expectedValue[i] === "_") { + continue; + } + return false; + } + } + return true; + } + function tryUpgradeRequestToAPotentiallyTrustworthyURL(request2) { + } + function sameOrigin(A, B) { + if (A.origin === B.origin && A.origin === "null") { + return true; + } + if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { + return true; + } + return false; + } + function createDeferredPromise() { + let res; + let rej; + const promise2 = new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }); + return { promise: promise2, resolve: res, reject: rej }; + } + function isAborted(fetchParams) { + return fetchParams.controller.state === "aborted"; + } + function isCancelled(fetchParams) { + return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; + } + const normalizeMethodRecord = { + delete: "DELETE", + DELETE: "DELETE", + get: "GET", + GET: "GET", + head: "HEAD", + HEAD: "HEAD", + options: "OPTIONS", + OPTIONS: "OPTIONS", + post: "POST", + POST: "POST", + put: "PUT", + PUT: "PUT" + }; + Object.setPrototypeOf(normalizeMethodRecord, null); + function normalizeMethod(method) { + return normalizeMethodRecord[method.toLowerCase()] ?? method; + } + function serializeJavascriptValueToJSONString(value) { + const result = JSON.stringify(value); + if (result === void 0) { + throw new TypeError("Value is not JSON serializable"); + } + assert2(typeof result === "string"); + return result; + } + const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); + function makeIterator(iterator2, name, kind) { + const object = { + index: 0, + kind, + target: iterator2 + }; + const i = { + next() { + if (Object.getPrototypeOf(this) !== i) { + throw new TypeError( + `'next' called on an object that does not implement interface ${name} Iterator.` + ); + } + const { index, kind: kind2, target } = object; + const values = target(); + const len = values.length; + if (index >= len) { + return { value: void 0, done: true }; + } + const pair = values[index]; + object.index = index + 1; + return iteratorResult(pair, kind2); + }, + // The class string of an iterator prototype object for a given interface is the + // result of concatenating the identifier of the interface and the string " Iterator". + [Symbol.toStringTag]: `${name} Iterator` + }; + Object.setPrototypeOf(i, esIteratorPrototype); + return Object.setPrototypeOf({}, i); + } + function iteratorResult(pair, kind) { + let result; + switch (kind) { + case "key": { + result = pair[0]; + break; + } + case "value": { + result = pair[1]; + break; + } + case "key+value": { + result = pair; + break; + } + } + return { value: result, done: false }; + } + async function fullyReadBody(body2, processBody, processBodyError) { + const successSteps = processBody; + const errorSteps = processBodyError; + let reader2; + try { + reader2 = body2.stream.getReader(); + } catch (e) { + errorSteps(e); + return; + } + try { + const result = await readAllBytes(reader2); + successSteps(result); + } catch (e) { + errorSteps(e); + } + } + let ReadableStream2 = globalThis.ReadableStream; + function isReadableStreamLike(stream2) { + if (!ReadableStream2) { + ReadableStream2 = require$$13.ReadableStream; + } + return stream2 instanceof ReadableStream2 || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; + } + const MAXIMUM_ARGUMENT_LENGTH = 65535; + function isomorphicDecode(input) { + if (input.length < MAXIMUM_ARGUMENT_LENGTH) { + return String.fromCharCode(...input); + } + return input.reduce((previous, current) => previous + String.fromCharCode(current), ""); + } + function readableStreamClose(controller) { + try { + controller.close(); + } catch (err) { + if (!err.message.includes("Controller is already closed")) { + throw err; + } + } + } + function isomorphicEncode(input) { + for (let i = 0; i < input.length; i++) { + assert2(input.charCodeAt(i) <= 255); + } + return input; + } + async function readAllBytes(reader2) { + const bytes = []; + let byteLength = 0; + while (true) { + const { done, value: chunk } = await reader2.read(); + if (done) { + return Buffer.concat(bytes, byteLength); + } + if (!isUint8Array(chunk)) { + throw new TypeError("Received non-Uint8Array chunk"); + } + bytes.push(chunk); + byteLength += chunk.length; + } + } + function urlIsLocal(url) { + assert2("protocol" in url); + const protocol = url.protocol; + return protocol === "about:" || protocol === "blob:" || protocol === "data:"; + } + function urlHasHttpsScheme(url) { + if (typeof url === "string") { + return url.startsWith("https:"); + } + return url.protocol === "https:"; + } + function urlIsHttpHttpsScheme(url) { + assert2("protocol" in url); + const protocol = url.protocol; + return protocol === "http:" || protocol === "https:"; + } + const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)); + util$k = { + isAborted, + isCancelled, + createDeferredPromise, + ReadableStreamFrom: ReadableStreamFrom2, + toUSVString: toUSVString2, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike: isBlobLike2, + isURLPotentiallyTrustworthy, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + makeIterator, + isValidHeaderName, + isValidHeaderValue, + hasOwn, + isErrorLike, + fullyReadBody, + bytesMatch, + isReadableStreamLike, + readableStreamClose, + isomorphicEncode, + isomorphicDecode, + urlIsLocal, + urlHasHttpsScheme, + urlIsHttpHttpsScheme, + readAllBytes, + normalizeMethodRecord, + parseMetadata + }; + return util$k; +} +var symbols$3; +var hasRequiredSymbols$3; +function requireSymbols$3() { + if (hasRequiredSymbols$3) return symbols$3; + hasRequiredSymbols$3 = 1; + symbols$3 = { + kUrl: Symbol("url"), + kHeaders: Symbol("headers"), + kSignal: Symbol("signal"), + kState: Symbol("state"), + kGuard: Symbol("guard"), + kRealm: Symbol("realm") + }; + return symbols$3; +} +var webidl_1; +var hasRequiredWebidl; +function requireWebidl() { + if (hasRequiredWebidl) return webidl_1; + hasRequiredWebidl = 1; + const { types: types2 } = require$$0$3; + const { hasOwn, toUSVString: toUSVString2 } = requireUtil$4(); + const webidl = {}; + webidl.converters = {}; + webidl.util = {}; + webidl.errors = {}; + webidl.errors.exception = function(message) { + return new TypeError(`${message.header}: ${message.message}`); + }; + webidl.errors.conversionFailed = function(context2) { + const plural = context2.types.length === 1 ? "" : " one of"; + const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + return webidl.errors.exception({ + header: context2.prefix, + message + }); + }; + webidl.errors.invalidArgument = function(context2) { + return webidl.errors.exception({ + header: context2.prefix, + message: `"${context2.value}" is an invalid ${context2.type}.` + }); + }; + webidl.brandCheck = function(V, I, opts = void 0) { + if ((opts == null ? void 0 : opts.strict) !== false && !(V instanceof I)) { + throw new TypeError("Illegal invocation"); + } else { + return (V == null ? void 0 : V[Symbol.toStringTag]) === I.prototype[Symbol.toStringTag]; + } + }; + webidl.argumentLengthCheck = function({ length }, min, ctx) { + if (length < min) { + throw webidl.errors.exception({ + message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, + ...ctx + }); + } + }; + webidl.illegalConstructor = function() { + throw webidl.errors.exception({ + header: "TypeError", + message: "Illegal constructor" + }); + }; + webidl.util.Type = function(V) { + switch (typeof V) { + case "undefined": + return "Undefined"; + case "boolean": + return "Boolean"; + case "string": + return "String"; + case "symbol": + return "Symbol"; + case "number": + return "Number"; + case "bigint": + return "BigInt"; + case "function": + case "object": { + if (V === null) { + return "Null"; + } + return "Object"; + } + } + }; + webidl.util.ConvertToInt = function(V, bitLength, signedness, opts = {}) { + let upperBound; + let lowerBound; + if (bitLength === 64) { + upperBound = Math.pow(2, 53) - 1; + if (signedness === "unsigned") { + lowerBound = 0; + } else { + lowerBound = Math.pow(-2, 53) + 1; + } + } else if (signedness === "unsigned") { + lowerBound = 0; + upperBound = Math.pow(2, bitLength) - 1; + } else { + lowerBound = Math.pow(-2, bitLength) - 1; + upperBound = Math.pow(2, bitLength - 1) - 1; + } + let x = Number(V); + if (x === 0) { + x = 0; + } + if (opts.enforceRange === true) { + if (Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { + throw webidl.errors.exception({ + header: "Integer conversion", + message: `Could not convert ${V} to an integer.` + }); + } + x = webidl.util.IntegerPart(x); + if (x < lowerBound || x > upperBound) { + throw webidl.errors.exception({ + header: "Integer conversion", + message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` + }); + } + return x; + } + if (!Number.isNaN(x) && opts.clamp === true) { + x = Math.min(Math.max(x, lowerBound), upperBound); + if (Math.floor(x) % 2 === 0) { + x = Math.floor(x); + } else { + x = Math.ceil(x); + } + return x; + } + if (Number.isNaN(x) || x === 0 && Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { + return 0; + } + x = webidl.util.IntegerPart(x); + x = x % Math.pow(2, bitLength); + if (signedness === "signed" && x >= Math.pow(2, bitLength) - 1) { + return x - Math.pow(2, bitLength); + } + return x; + }; + webidl.util.IntegerPart = function(n) { + const r = Math.floor(Math.abs(n)); + if (n < 0) { + return -1 * r; + } + return r; + }; + webidl.sequenceConverter = function(converter) { + return (V) => { + var _a2; + if (webidl.util.Type(V) !== "Object") { + throw webidl.errors.exception({ + header: "Sequence", + message: `Value of type ${webidl.util.Type(V)} is not an Object.` + }); + } + const method = (_a2 = V == null ? void 0 : V[Symbol.iterator]) == null ? void 0 : _a2.call(V); + const seq = []; + if (method === void 0 || typeof method.next !== "function") { + throw webidl.errors.exception({ + header: "Sequence", + message: "Object is not an iterator." + }); + } + while (true) { + const { done, value } = method.next(); + if (done) { + break; + } + seq.push(converter(value)); + } + return seq; + }; + }; + webidl.recordConverter = function(keyConverter, valueConverter) { + return (O) => { + if (webidl.util.Type(O) !== "Object") { + throw webidl.errors.exception({ + header: "Record", + message: `Value of type ${webidl.util.Type(O)} is not an Object.` + }); + } + const result = {}; + if (!types2.isProxy(O)) { + const keys2 = Object.keys(O); + for (const key of keys2) { + const typedKey = keyConverter(key); + const typedValue = valueConverter(O[key]); + result[typedKey] = typedValue; + } + return result; + } + const keys = Reflect.ownKeys(O); + for (const key of keys) { + const desc = Reflect.getOwnPropertyDescriptor(O, key); + if (desc == null ? void 0 : desc.enumerable) { + const typedKey = keyConverter(key); + const typedValue = valueConverter(O[key]); + result[typedKey] = typedValue; + } + } + return result; + }; + }; + webidl.interfaceConverter = function(i) { + return (V, opts = {}) => { + if (opts.strict !== false && !(V instanceof i)) { + throw webidl.errors.exception({ + header: i.name, + message: `Expected ${V} to be an instance of ${i.name}.` + }); + } + return V; + }; + }; + webidl.dictionaryConverter = function(converters) { + return (dictionary) => { + const type = webidl.util.Type(dictionary); + const dict = {}; + if (type === "Null" || type === "Undefined") { + return dict; + } else if (type !== "Object") { + throw webidl.errors.exception({ + header: "Dictionary", + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` + }); + } + for (const options2 of converters) { + const { key, defaultValue, required, converter } = options2; + if (required === true) { + if (!hasOwn(dictionary, key)) { + throw webidl.errors.exception({ + header: "Dictionary", + message: `Missing required key "${key}".` + }); + } + } + let value = dictionary[key]; + const hasDefault = hasOwn(options2, "defaultValue"); + if (hasDefault && value !== null) { + value = value ?? defaultValue; + } + if (required || hasDefault || value !== void 0) { + value = converter(value); + if (options2.allowedValues && !options2.allowedValues.includes(value)) { + throw webidl.errors.exception({ + header: "Dictionary", + message: `${value} is not an accepted type. Expected one of ${options2.allowedValues.join(", ")}.` + }); + } + dict[key] = value; + } + } + return dict; + }; + }; + webidl.nullableConverter = function(converter) { + return (V) => { + if (V === null) { + return V; + } + return converter(V); + }; + }; + webidl.converters.DOMString = function(V, opts = {}) { + if (V === null && opts.legacyNullToEmptyString) { + return ""; + } + if (typeof V === "symbol") { + throw new TypeError("Could not convert argument of type symbol to string."); + } + return String(V); + }; + webidl.converters.ByteString = function(V) { + const x = webidl.converters.DOMString(V); + for (let index = 0; index < x.length; index++) { + if (x.charCodeAt(index) > 255) { + throw new TypeError( + `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` + ); + } + } + return x; + }; + webidl.converters.USVString = toUSVString2; + webidl.converters.boolean = function(V) { + const x = Boolean(V); + return x; + }; + webidl.converters.any = function(V) { + return V; + }; + webidl.converters["long long"] = function(V) { + const x = webidl.util.ConvertToInt(V, 64, "signed"); + return x; + }; + webidl.converters["unsigned long long"] = function(V) { + const x = webidl.util.ConvertToInt(V, 64, "unsigned"); + return x; + }; + webidl.converters["unsigned long"] = function(V) { + const x = webidl.util.ConvertToInt(V, 32, "unsigned"); + return x; + }; + webidl.converters["unsigned short"] = function(V, opts) { + const x = webidl.util.ConvertToInt(V, 16, "unsigned", opts); + return x; + }; + webidl.converters.ArrayBuffer = function(V, opts = {}) { + if (webidl.util.Type(V) !== "Object" || !types2.isAnyArrayBuffer(V)) { + throw webidl.errors.conversionFailed({ + prefix: `${V}`, + argument: `${V}`, + types: ["ArrayBuffer"] + }); + } + if (opts.allowShared === false && types2.isSharedArrayBuffer(V)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V; + }; + webidl.converters.TypedArray = function(V, T, opts = {}) { + if (webidl.util.Type(V) !== "Object" || !types2.isTypedArray(V) || V.constructor.name !== T.name) { + throw webidl.errors.conversionFailed({ + prefix: `${T.name}`, + argument: `${V}`, + types: [T.name] + }); + } + if (opts.allowShared === false && types2.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V; + }; + webidl.converters.DataView = function(V, opts = {}) { + if (webidl.util.Type(V) !== "Object" || !types2.isDataView(V)) { + throw webidl.errors.exception({ + header: "DataView", + message: "Object is not a DataView." + }); + } + if (opts.allowShared === false && types2.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V; + }; + webidl.converters.BufferSource = function(V, opts = {}) { + if (types2.isAnyArrayBuffer(V)) { + return webidl.converters.ArrayBuffer(V, opts); + } + if (types2.isTypedArray(V)) { + return webidl.converters.TypedArray(V, V.constructor); + } + if (types2.isDataView(V)) { + return webidl.converters.DataView(V, opts); + } + throw new TypeError(`Could not convert ${V} to a BufferSource.`); + }; + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.ByteString + ); + webidl.converters["sequence>"] = webidl.sequenceConverter( + webidl.converters["sequence"] + ); + webidl.converters["record"] = webidl.recordConverter( + webidl.converters.ByteString, + webidl.converters.ByteString + ); + webidl_1 = { + webidl + }; + return webidl_1; +} +var dataURL; +var hasRequiredDataURL; +function requireDataURL() { + if (hasRequiredDataURL) return dataURL; + hasRequiredDataURL = 1; + const assert2 = require$$0$4; + const { atob: atob2 } = require$$7; + const { isomorphicDecode } = requireUtil$4(); + const encoder = new TextEncoder(); + const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/; + const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/; + const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/; + function dataURLProcessor(dataURL2) { + assert2(dataURL2.protocol === "data:"); + let input = URLSerializer(dataURL2, true); + input = input.slice(5); + const position = { position: 0 }; + let mimeType = collectASequenceOfCodePointsFast( + ",", + input, + position + ); + const mimeTypeLength = mimeType.length; + mimeType = removeASCIIWhitespace(mimeType, true, true); + if (position.position >= input.length) { + return "failure"; + } + position.position++; + const encodedBody = input.slice(mimeTypeLength + 1); + let body2 = stringPercentDecode(encodedBody); + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + const stringBody = isomorphicDecode(body2); + body2 = forgivingBase64(stringBody); + if (body2 === "failure") { + return "failure"; + } + mimeType = mimeType.slice(0, -6); + mimeType = mimeType.replace(/(\u0020)+$/, ""); + mimeType = mimeType.slice(0, -1); + } + if (mimeType.startsWith(";")) { + mimeType = "text/plain" + mimeType; + } + let mimeTypeRecord = parseMIMEType(mimeType); + if (mimeTypeRecord === "failure") { + mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII"); + } + return { mimeType: mimeTypeRecord, body: body2 }; + } + function URLSerializer(url, excludeFragment = false) { + if (!excludeFragment) { + return url.href; + } + const href = url.href; + const hashLength = url.hash.length; + return hashLength === 0 ? href : href.substring(0, href.length - hashLength); + } + function collectASequenceOfCodePoints(condition, input, position) { + let result = ""; + while (position.position < input.length && condition(input[position.position])) { + result += input[position.position]; + position.position++; + } + return result; + } + function collectASequenceOfCodePointsFast(char, input, position) { + const idx = input.indexOf(char, position.position); + const start = position.position; + if (idx === -1) { + position.position = input.length; + return input.slice(start); + } + position.position = idx; + return input.slice(start, position.position); + } + function stringPercentDecode(input) { + const bytes = encoder.encode(input); + return percentDecode(bytes); + } + function percentDecode(input) { + const output = []; + for (let i = 0; i < input.length; i++) { + const byte = input[i]; + if (byte !== 37) { + output.push(byte); + } else if (byte === 37 && !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))) { + output.push(37); + } else { + const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]); + const bytePoint = Number.parseInt(nextTwoBytes, 16); + output.push(bytePoint); + i += 2; + } + } + return Uint8Array.from(output); + } + function parseMIMEType(input) { + input = removeHTTPWhitespace(input, true, true); + const position = { position: 0 }; + const type = collectASequenceOfCodePointsFast( + "/", + input, + position + ); + if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { + return "failure"; + } + if (position.position > input.length) { + return "failure"; + } + position.position++; + let subtype = collectASequenceOfCodePointsFast( + ";", + input, + position + ); + subtype = removeHTTPWhitespace(subtype, false, true); + if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { + return "failure"; + } + const typeLowercase = type.toLowerCase(); + const subtypeLowercase = subtype.toLowerCase(); + const mimeType = { + type: typeLowercase, + subtype: subtypeLowercase, + /** @type {Map} */ + parameters: /* @__PURE__ */ new Map(), + // https://mimesniff.spec.whatwg.org/#mime-type-essence + essence: `${typeLowercase}/${subtypeLowercase}` + }; + while (position.position < input.length) { + position.position++; + collectASequenceOfCodePoints( + // https://fetch.spec.whatwg.org/#http-whitespace + (char) => HTTP_WHITESPACE_REGEX.test(char), + input, + position + ); + let parameterName = collectASequenceOfCodePoints( + (char) => char !== ";" && char !== "=", + input, + position + ); + parameterName = parameterName.toLowerCase(); + if (position.position < input.length) { + if (input[position.position] === ";") { + continue; + } + position.position++; + } + if (position.position > input.length) { + break; + } + let parameterValue = null; + if (input[position.position] === '"') { + parameterValue = collectAnHTTPQuotedString(input, position, true); + collectASequenceOfCodePointsFast( + ";", + input, + position + ); + } else { + parameterValue = collectASequenceOfCodePointsFast( + ";", + input, + position + ); + parameterValue = removeHTTPWhitespace(parameterValue, false, true); + if (parameterValue.length === 0) { + continue; + } + } + if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) { + mimeType.parameters.set(parameterName, parameterValue); + } + } + return mimeType; + } + function forgivingBase64(data) { + data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, ""); + if (data.length % 4 === 0) { + data = data.replace(/=?=$/, ""); + } + if (data.length % 4 === 1) { + return "failure"; + } + if (/[^+/0-9A-Za-z]/.test(data)) { + return "failure"; + } + const binary = atob2(data); + const bytes = new Uint8Array(binary.length); + for (let byte = 0; byte < binary.length; byte++) { + bytes[byte] = binary.charCodeAt(byte); + } + return bytes; + } + function collectAnHTTPQuotedString(input, position, extractValue) { + const positionStart = position.position; + let value = ""; + assert2(input[position.position] === '"'); + position.position++; + while (true) { + value += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== "\\", + input, + position + ); + if (position.position >= input.length) { + break; + } + const quoteOrBackslash = input[position.position]; + position.position++; + if (quoteOrBackslash === "\\") { + if (position.position >= input.length) { + value += "\\"; + break; + } + value += input[position.position]; + position.position++; + } else { + assert2(quoteOrBackslash === '"'); + break; + } + } + if (extractValue) { + return value; + } + return input.slice(positionStart, position.position); + } + function serializeAMimeType(mimeType) { + assert2(mimeType !== "failure"); + const { parameters, essence } = mimeType; + let serialization = essence; + for (let [name, value] of parameters.entries()) { + serialization += ";"; + serialization += name; + serialization += "="; + if (!HTTP_TOKEN_CODEPOINTS.test(value)) { + value = value.replace(/(\\|")/g, "\\$1"); + value = '"' + value; + value += '"'; + } + serialization += value; + } + return serialization; + } + function isHTTPWhiteSpace(char) { + return char === "\r" || char === "\n" || char === " " || char === " "; + } + function removeHTTPWhitespace(str, leading = true, trailing = true) { + let lead = 0; + let trail = str.length - 1; + if (leading) { + for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++) ; + } + if (trailing) { + for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--) ; + } + return str.slice(lead, trail + 1); + } + function isASCIIWhitespace(char) { + return char === "\r" || char === "\n" || char === " " || char === "\f" || char === " "; + } + function removeASCIIWhitespace(str, leading = true, trailing = true) { + let lead = 0; + let trail = str.length - 1; + if (leading) { + for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++) ; + } + if (trailing) { + for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--) ; + } + return str.slice(lead, trail + 1); + } + dataURL = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + collectASequenceOfCodePointsFast, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString, + serializeAMimeType + }; + return dataURL; +} +var file; +var hasRequiredFile; +function requireFile() { + if (hasRequiredFile) return file; + hasRequiredFile = 1; + const { Blob: Blob2, File: NativeFile } = require$$7; + const { types: types2 } = require$$0$3; + const { kState } = requireSymbols$3(); + const { isBlobLike: isBlobLike2 } = requireUtil$4(); + const { webidl } = requireWebidl(); + const { parseMIMEType, serializeAMimeType } = requireDataURL(); + const { kEnumerableProperty: kEnumerableProperty2 } = util$l; + const encoder = new TextEncoder(); + class File extends Blob2 { + constructor(fileBits, fileName, options2 = {}) { + webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" }); + fileBits = webidl.converters["sequence"](fileBits); + fileName = webidl.converters.USVString(fileName); + options2 = webidl.converters.FilePropertyBag(options2); + const n = fileName; + let t2 = options2.type; + let d; + substep: { + if (t2) { + t2 = parseMIMEType(t2); + if (t2 === "failure") { + t2 = ""; + break substep; + } + t2 = serializeAMimeType(t2).toLowerCase(); + } + d = options2.lastModified; + } + super(processBlobParts(fileBits, options2), { type: t2 }); + this[kState] = { + name: n, + lastModified: d, + type: t2 + }; + } + get name() { + webidl.brandCheck(this, File); + return this[kState].name; + } + get lastModified() { + webidl.brandCheck(this, File); + return this[kState].lastModified; + } + get type() { + webidl.brandCheck(this, File); + return this[kState].type; + } + } + class FileLike { + constructor(blobLike, fileName, options2 = {}) { + const n = fileName; + const t2 = options2.type; + const d = options2.lastModified ?? Date.now(); + this[kState] = { + blobLike, + name: n, + type: t2, + lastModified: d + }; + } + stream(...args) { + webidl.brandCheck(this, FileLike); + return this[kState].blobLike.stream(...args); + } + arrayBuffer(...args) { + webidl.brandCheck(this, FileLike); + return this[kState].blobLike.arrayBuffer(...args); + } + slice(...args) { + webidl.brandCheck(this, FileLike); + return this[kState].blobLike.slice(...args); + } + text(...args) { + webidl.brandCheck(this, FileLike); + return this[kState].blobLike.text(...args); + } + get size() { + webidl.brandCheck(this, FileLike); + return this[kState].blobLike.size; + } + get type() { + webidl.brandCheck(this, FileLike); + return this[kState].blobLike.type; + } + get name() { + webidl.brandCheck(this, FileLike); + return this[kState].name; + } + get lastModified() { + webidl.brandCheck(this, FileLike); + return this[kState].lastModified; + } + get [Symbol.toStringTag]() { + return "File"; + } + } + Object.defineProperties(File.prototype, { + [Symbol.toStringTag]: { + value: "File", + configurable: true + }, + name: kEnumerableProperty2, + lastModified: kEnumerableProperty2 + }); + webidl.converters.Blob = webidl.interfaceConverter(Blob2); + webidl.converters.BlobPart = function(V, opts) { + if (webidl.util.Type(V) === "Object") { + if (isBlobLike2(V)) { + return webidl.converters.Blob(V, { strict: false }); + } + if (ArrayBuffer.isView(V) || types2.isAnyArrayBuffer(V)) { + return webidl.converters.BufferSource(V, opts); + } + } + return webidl.converters.USVString(V, opts); + }; + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.BlobPart + ); + webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ + { + key: "lastModified", + converter: webidl.converters["long long"], + get defaultValue() { + return Date.now(); + } + }, + { + key: "type", + converter: webidl.converters.DOMString, + defaultValue: "" + }, + { + key: "endings", + converter: (value) => { + value = webidl.converters.DOMString(value); + value = value.toLowerCase(); + if (value !== "native") { + value = "transparent"; + } + return value; + }, + defaultValue: "transparent" + } + ]); + function processBlobParts(parts, options2) { + const bytes = []; + for (const element of parts) { + if (typeof element === "string") { + let s = element; + if (options2.endings === "native") { + s = convertLineEndingsNative(s); + } + bytes.push(encoder.encode(s)); + } else if (types2.isAnyArrayBuffer(element) || types2.isTypedArray(element)) { + if (!element.buffer) { + bytes.push(new Uint8Array(element)); + } else { + bytes.push( + new Uint8Array(element.buffer, element.byteOffset, element.byteLength) + ); + } + } else if (isBlobLike2(element)) { + bytes.push(element); + } + } + return bytes; + } + function convertLineEndingsNative(s) { + let nativeLineEnding = "\n"; + if (process.platform === "win32") { + nativeLineEnding = "\r\n"; + } + return s.replace(/\r?\n/g, nativeLineEnding); + } + function isFileLike(object) { + return NativeFile && object instanceof NativeFile || object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; + } + file = { File, FileLike, isFileLike }; + return file; +} +var formdata; +var hasRequiredFormdata; +function requireFormdata() { + if (hasRequiredFormdata) return formdata; + hasRequiredFormdata = 1; + const { isBlobLike: isBlobLike2, toUSVString: toUSVString2, makeIterator } = requireUtil$4(); + const { kState } = requireSymbols$3(); + const { File: UndiciFile, FileLike, isFileLike } = requireFile(); + const { webidl } = requireWebidl(); + const { Blob: Blob2, File: NativeFile } = require$$7; + const File = NativeFile ?? UndiciFile; + class FormData { + constructor(form) { + if (form !== void 0) { + throw webidl.errors.conversionFailed({ + prefix: "FormData constructor", + argument: "Argument 1", + types: ["undefined"] + }); + } + this[kState] = []; + } + append(name, value, filename = void 0) { + webidl.brandCheck(this, FormData); + webidl.argumentLengthCheck(arguments, 2, { header: "FormData.append" }); + if (arguments.length === 3 && !isBlobLike2(value)) { + throw new TypeError( + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" + ); + } + name = webidl.converters.USVString(name); + value = isBlobLike2(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value); + filename = arguments.length === 3 ? webidl.converters.USVString(filename) : void 0; + const entry2 = makeEntry(name, value, filename); + this[kState].push(entry2); + } + delete(name) { + webidl.brandCheck(this, FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.delete" }); + name = webidl.converters.USVString(name); + this[kState] = this[kState].filter((entry2) => entry2.name !== name); + } + get(name) { + webidl.brandCheck(this, FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.get" }); + name = webidl.converters.USVString(name); + const idx = this[kState].findIndex((entry2) => entry2.name === name); + if (idx === -1) { + return null; + } + return this[kState][idx].value; + } + getAll(name) { + webidl.brandCheck(this, FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.getAll" }); + name = webidl.converters.USVString(name); + return this[kState].filter((entry2) => entry2.name === name).map((entry2) => entry2.value); + } + has(name) { + webidl.brandCheck(this, FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.has" }); + name = webidl.converters.USVString(name); + return this[kState].findIndex((entry2) => entry2.name === name) !== -1; + } + set(name, value, filename = void 0) { + webidl.brandCheck(this, FormData); + webidl.argumentLengthCheck(arguments, 2, { header: "FormData.set" }); + if (arguments.length === 3 && !isBlobLike2(value)) { + throw new TypeError( + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" + ); + } + name = webidl.converters.USVString(name); + value = isBlobLike2(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value); + filename = arguments.length === 3 ? toUSVString2(filename) : void 0; + const entry2 = makeEntry(name, value, filename); + const idx = this[kState].findIndex((entry3) => entry3.name === name); + if (idx !== -1) { + this[kState] = [ + ...this[kState].slice(0, idx), + entry2, + ...this[kState].slice(idx + 1).filter((entry3) => entry3.name !== name) + ]; + } else { + this[kState].push(entry2); + } + } + entries() { + webidl.brandCheck(this, FormData); + return makeIterator( + () => this[kState].map((pair) => [pair.name, pair.value]), + "FormData", + "key+value" + ); + } + keys() { + webidl.brandCheck(this, FormData); + return makeIterator( + () => this[kState].map((pair) => [pair.name, pair.value]), + "FormData", + "key" + ); + } + values() { + webidl.brandCheck(this, FormData); + return makeIterator( + () => this[kState].map((pair) => [pair.name, pair.value]), + "FormData", + "value" + ); + } + /** + * @param {(value: string, key: string, self: FormData) => void} callbackFn + * @param {unknown} thisArg + */ + forEach(callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, FormData); + webidl.argumentLengthCheck(arguments, 1, { header: "FormData.forEach" }); + if (typeof callbackFn !== "function") { + throw new TypeError( + "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." + ); + } + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]); + } + } + } + FormData.prototype[Symbol.iterator] = FormData.prototype.entries; + Object.defineProperties(FormData.prototype, { + [Symbol.toStringTag]: { + value: "FormData", + configurable: true + } + }); + function makeEntry(name, value, filename) { + name = Buffer.from(name).toString("utf8"); + if (typeof value === "string") { + value = Buffer.from(value).toString("utf8"); + } else { + if (!isFileLike(value)) { + value = value instanceof Blob2 ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); + } + if (filename !== void 0) { + const options2 = { + type: value.type, + lastModified: value.lastModified + }; + value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File([value], filename, options2) : new FileLike(value, filename, options2); + } + } + return { name, value }; + } + formdata = { FormData }; + return formdata; +} +var body; +var hasRequiredBody; +function requireBody() { + if (hasRequiredBody) return body; + hasRequiredBody = 1; + const Busboy = requireMain(); + const util2 = util$l; + const { + ReadableStreamFrom: ReadableStreamFrom2, + isBlobLike: isBlobLike2, + isReadableStreamLike, + readableStreamClose, + createDeferredPromise, + fullyReadBody + } = requireUtil$4(); + const { FormData } = requireFormdata(); + const { kState } = requireSymbols$3(); + const { webidl } = requireWebidl(); + const { DOMException: DOMException2, structuredClone } = requireConstants$3(); + const { Blob: Blob2, File: NativeFile } = require$$7; + const { kBodyUsed: kBodyUsed2 } = symbols$4; + const assert2 = require$$0$4; + const { isErrored: isErrored2 } = util$l; + const { isUint8Array, isArrayBuffer: isArrayBuffer2 } = require$$5; + const { File: UndiciFile } = requireFile(); + const { parseMIMEType, serializeAMimeType } = requireDataURL(); + let ReadableStream2 = globalThis.ReadableStream; + const File = NativeFile ?? UndiciFile; + const textEncoder = new TextEncoder(); + const textDecoder = new TextDecoder(); + function extractBody2(object, keepalive = false) { + if (!ReadableStream2) { + ReadableStream2 = require$$13.ReadableStream; + } + let stream2 = null; + if (object instanceof ReadableStream2) { + stream2 = object; + } else if (isBlobLike2(object)) { + stream2 = object.stream(); + } else { + stream2 = new ReadableStream2({ + async pull(controller) { + controller.enqueue( + typeof source === "string" ? textEncoder.encode(source) : source + ); + queueMicrotask(() => readableStreamClose(controller)); + }, + start() { + }, + type: void 0 + }); + } + assert2(isReadableStreamLike(stream2)); + let action = null; + let source = null; + let length = null; + let type = null; + if (typeof object === "string") { + source = object; + type = "text/plain;charset=UTF-8"; + } else if (object instanceof URLSearchParams) { + source = object.toString(); + type = "application/x-www-form-urlencoded;charset=UTF-8"; + } else if (isArrayBuffer2(object)) { + source = new Uint8Array(object.slice()); + } else if (ArrayBuffer.isView(object)) { + source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); + } else if (util2.isFormDataLike(object)) { + const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`; + const prefix = `--${boundary}\r +Content-Disposition: form-data`; + /*! formdata-polyfill. MIT License. Jimmy Wärting */ + const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); + const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); + const blobParts = []; + const rn = new Uint8Array([13, 10]); + length = 0; + let hasUnknownSizeValue = false; + for (const [name, value] of object) { + if (typeof value === "string") { + const chunk2 = textEncoder.encode(prefix + `; name="${escape(normalizeLinefeeds(name))}"\r +\r +${normalizeLinefeeds(value)}\r +`); + blobParts.push(chunk2); + length += chunk2.byteLength; + } else { + const chunk2 = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape(value.name)}"` : "") + `\r +Content-Type: ${value.type || "application/octet-stream"}\r +\r +`); + blobParts.push(chunk2, value, rn); + if (typeof value.size === "number") { + length += chunk2.byteLength + value.size + rn.byteLength; + } else { + hasUnknownSizeValue = true; + } + } + } + const chunk = textEncoder.encode(`--${boundary}--`); + blobParts.push(chunk); + length += chunk.byteLength; + if (hasUnknownSizeValue) { + length = null; + } + source = object; + action = async function* () { + for (const part of blobParts) { + if (part.stream) { + yield* part.stream(); + } else { + yield part; + } + } + }; + type = "multipart/form-data; boundary=" + boundary; + } else if (isBlobLike2(object)) { + source = object; + length = object.size; + if (object.type) { + type = object.type; + } + } else if (typeof object[Symbol.asyncIterator] === "function") { + if (keepalive) { + throw new TypeError("keepalive"); + } + if (util2.isDisturbed(object) || object.locked) { + throw new TypeError( + "Response body object should not be disturbed or locked" + ); + } + stream2 = object instanceof ReadableStream2 ? object : ReadableStreamFrom2(object); + } + if (typeof source === "string" || util2.isBuffer(source)) { + length = Buffer.byteLength(source); + } + if (action != null) { + let iterator2; + stream2 = new ReadableStream2({ + async start() { + iterator2 = action(object)[Symbol.asyncIterator](); + }, + async pull(controller) { + const { value, done } = await iterator2.next(); + if (done) { + queueMicrotask(() => { + controller.close(); + }); + } else { + if (!isErrored2(stream2)) { + controller.enqueue(new Uint8Array(value)); + } + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator2.return(); + }, + type: void 0 + }); + } + const body2 = { stream: stream2, source, length }; + return [body2, type]; + } + function safelyExtractBody(object, keepalive = false) { + if (!ReadableStream2) { + ReadableStream2 = require$$13.ReadableStream; + } + if (object instanceof ReadableStream2) { + assert2(!util2.isDisturbed(object), "The body has already been consumed."); + assert2(!object.locked, "The stream is locked."); + } + return extractBody2(object, keepalive); + } + function cloneBody(body2) { + const [out1, out2] = body2.stream.tee(); + const out2Clone = structuredClone(out2, { transfer: [out2] }); + const [, finalClone] = out2Clone.tee(); + body2.stream = out1; + return { + stream: finalClone, + length: body2.length, + source: body2.source + }; + } + async function* consumeBody(body2) { + if (body2) { + if (isUint8Array(body2)) { + yield body2; + } else { + const stream2 = body2.stream; + if (util2.isDisturbed(stream2)) { + throw new TypeError("The body has already been consumed."); + } + if (stream2.locked) { + throw new TypeError("The stream is locked."); + } + stream2[kBodyUsed2] = true; + yield* stream2; + } + } + } + function throwIfAborted2(state) { + if (state.aborted) { + throw new DOMException2("The operation was aborted.", "AbortError"); + } + } + function bodyMixinMethods(instance) { + const methods = { + blob() { + return specConsumeBody(this, (bytes) => { + let mimeType = bodyMimeType(this); + if (mimeType === "failure") { + mimeType = ""; + } else if (mimeType) { + mimeType = serializeAMimeType(mimeType); + } + return new Blob2([bytes], { type: mimeType }); + }, instance); + }, + arrayBuffer() { + return specConsumeBody(this, (bytes) => { + return new Uint8Array(bytes).buffer; + }, instance); + }, + text() { + return specConsumeBody(this, utf8DecodeBytes, instance); + }, + json() { + return specConsumeBody(this, parseJSONFromBytes, instance); + }, + async formData() { + webidl.brandCheck(this, instance); + throwIfAborted2(this[kState]); + const contentType = this.headers.get("Content-Type"); + if (/multipart\/form-data/.test(contentType)) { + const headers2 = {}; + for (const [key, value] of this.headers) headers2[key.toLowerCase()] = value; + const responseFormData = new FormData(); + let busboy; + try { + busboy = new Busboy({ + headers: headers2, + preservePath: true + }); + } catch (err) { + throw new DOMException2(`${err}`, "AbortError"); + } + busboy.on("field", (name, value) => { + responseFormData.append(name, value); + }); + busboy.on("file", (name, value, filename, encoding2, mimeType) => { + const chunks = []; + if (encoding2 === "base64" || encoding2.toLowerCase() === "base64") { + let base64chunk = ""; + value.on("data", (chunk) => { + base64chunk += chunk.toString().replace(/[\r\n]/gm, ""); + const end = base64chunk.length - base64chunk.length % 4; + chunks.push(Buffer.from(base64chunk.slice(0, end), "base64")); + base64chunk = base64chunk.slice(end); + }); + value.on("end", () => { + chunks.push(Buffer.from(base64chunk, "base64")); + responseFormData.append(name, new File(chunks, filename, { type: mimeType })); + }); + } else { + value.on("data", (chunk) => { + chunks.push(chunk); + }); + value.on("end", () => { + responseFormData.append(name, new File(chunks, filename, { type: mimeType })); + }); + } + }); + const busboyResolve = new Promise((resolve, reject) => { + busboy.on("finish", resolve); + busboy.on("error", (err) => reject(new TypeError(err))); + }); + if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk); + busboy.end(); + await busboyResolve; + return responseFormData; + } else if (/application\/x-www-form-urlencoded/.test(contentType)) { + let entries; + try { + let text = ""; + const streamingDecoder = new TextDecoder("utf-8", { ignoreBOM: true }); + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError("Expected Uint8Array chunk"); + } + text += streamingDecoder.decode(chunk, { stream: true }); + } + text += streamingDecoder.decode(); + entries = new URLSearchParams(text); + } catch (err) { + throw Object.assign(new TypeError(), { cause: err }); + } + const formData = new FormData(); + for (const [name, value] of entries) { + formData.append(name, value); + } + return formData; + } else { + await Promise.resolve(); + throwIfAborted2(this[kState]); + throw webidl.errors.exception({ + header: `${instance.name}.formData`, + message: "Could not parse content as FormData." + }); + } + } + }; + return methods; + } + function mixinBody(prototype) { + Object.assign(prototype.prototype, bodyMixinMethods(prototype)); + } + async function specConsumeBody(object, convertBytesToJSValue, instance) { + webidl.brandCheck(object, instance); + throwIfAborted2(object[kState]); + if (bodyUnusable(object[kState].body)) { + throw new TypeError("Body is unusable"); + } + const promise2 = createDeferredPromise(); + const errorSteps = (error2) => promise2.reject(error2); + const successSteps = (data) => { + try { + promise2.resolve(convertBytesToJSValue(data)); + } catch (e) { + errorSteps(e); + } + }; + if (object[kState].body == null) { + successSteps(new Uint8Array()); + return promise2.promise; + } + await fullyReadBody(object[kState].body, successSteps, errorSteps); + return promise2.promise; + } + function bodyUnusable(body2) { + return body2 != null && (body2.stream.locked || util2.isDisturbed(body2.stream)); + } + function utf8DecodeBytes(buffer) { + if (buffer.length === 0) { + return ""; + } + if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { + buffer = buffer.subarray(3); + } + const output = textDecoder.decode(buffer); + return output; + } + function parseJSONFromBytes(bytes) { + return JSON.parse(utf8DecodeBytes(bytes)); + } + function bodyMimeType(object) { + const { headersList } = object[kState]; + const contentType = headersList.get("content-type"); + if (contentType === null) { + return "failure"; + } + return parseMIMEType(contentType); + } + body = { + extractBody: extractBody2, + safelyExtractBody, + cloneBody, + mixinBody + }; + return body; +} +const { + InvalidArgumentError: InvalidArgumentError$k, + NotSupportedError: NotSupportedError$1 +} = errors$4; +const assert$9 = require$$0$4; +const { kHTTP2BuildRequest: kHTTP2BuildRequest$1, kHTTP2CopyHeaders: kHTTP2CopyHeaders$1, kHTTP1BuildRequest: kHTTP1BuildRequest$1 } = symbols$4; +const util$j = util$l; +const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; +const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; +const invalidPathRegex = /[^\u0021-\u00ff]/; +const kHandler = Symbol("handler"); +const channels$1 = {}; +let extractBody; +try { + const diagnosticsChannel = require("diagnostics_channel"); + channels$1.create = diagnosticsChannel.channel("undici:request:create"); + channels$1.bodySent = diagnosticsChannel.channel("undici:request:bodySent"); + channels$1.headers = diagnosticsChannel.channel("undici:request:headers"); + channels$1.trailers = diagnosticsChannel.channel("undici:request:trailers"); + channels$1.error = diagnosticsChannel.channel("undici:request:error"); +} catch { + channels$1.create = { hasSubscribers: false }; + channels$1.bodySent = { hasSubscribers: false }; + channels$1.headers = { hasSubscribers: false }; + channels$1.trailers = { hasSubscribers: false }; + channels$1.error = { hasSubscribers: false }; +} +let Request$1 = class Request { + constructor(origin, { + path: path2, + method, + body: body2, + headers: headers2, + query, + idempotent, + blocking, + upgrade: upgrade2, + headersTimeout, + bodyTimeout, + reset, + throwOnError, + expectContinue + }, handler2) { + if (typeof path2 !== "string") { + throw new InvalidArgumentError$k("path must be a string"); + } else if (path2[0] !== "/" && !(path2.startsWith("http://") || path2.startsWith("https://")) && method !== "CONNECT") { + throw new InvalidArgumentError$k("path must be an absolute URL or start with a slash"); + } else if (invalidPathRegex.exec(path2) !== null) { + throw new InvalidArgumentError$k("invalid request path"); + } + if (typeof method !== "string") { + throw new InvalidArgumentError$k("method must be a string"); + } else if (tokenRegExp.exec(method) === null) { + throw new InvalidArgumentError$k("invalid request method"); + } + if (upgrade2 && typeof upgrade2 !== "string") { + throw new InvalidArgumentError$k("upgrade must be a string"); + } + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError$k("invalid headersTimeout"); + } + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError$k("invalid bodyTimeout"); + } + if (reset != null && typeof reset !== "boolean") { + throw new InvalidArgumentError$k("invalid reset"); + } + if (expectContinue != null && typeof expectContinue !== "boolean") { + throw new InvalidArgumentError$k("invalid expectContinue"); + } + this.headersTimeout = headersTimeout; + this.bodyTimeout = bodyTimeout; + this.throwOnError = throwOnError === true; + this.method = method; + this.abort = null; + if (body2 == null) { + this.body = null; + } else if (util$j.isStream(body2)) { + this.body = body2; + const rState = this.body._readableState; + if (!rState || !rState.autoDestroy) { + this.endHandler = function autoDestroy() { + util$j.destroy(this); + }; + this.body.on("end", this.endHandler); + } + this.errorHandler = (err) => { + if (this.abort) { + this.abort(err); + } else { + this.error = err; + } + }; + this.body.on("error", this.errorHandler); + } else if (util$j.isBuffer(body2)) { + this.body = body2.byteLength ? body2 : null; + } else if (ArrayBuffer.isView(body2)) { + this.body = body2.buffer.byteLength ? Buffer.from(body2.buffer, body2.byteOffset, body2.byteLength) : null; + } else if (body2 instanceof ArrayBuffer) { + this.body = body2.byteLength ? Buffer.from(body2) : null; + } else if (typeof body2 === "string") { + this.body = body2.length ? Buffer.from(body2) : null; + } else if (util$j.isFormDataLike(body2) || util$j.isIterable(body2) || util$j.isBlobLike(body2)) { + this.body = body2; + } else { + throw new InvalidArgumentError$k("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); + } + this.completed = false; + this.aborted = false; + this.upgrade = upgrade2 || null; + this.path = query ? util$j.buildURL(path2, query) : path2; + this.origin = origin; + this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; + this.blocking = blocking == null ? false : blocking; + this.reset = reset == null ? null : reset; + this.host = null; + this.contentLength = null; + this.contentType = null; + this.headers = ""; + this.expectContinue = expectContinue != null ? expectContinue : false; + if (Array.isArray(headers2)) { + if (headers2.length % 2 !== 0) { + throw new InvalidArgumentError$k("headers array must be even"); + } + for (let i = 0; i < headers2.length; i += 2) { + processHeader(this, headers2[i], headers2[i + 1]); + } + } else if (headers2 && typeof headers2 === "object") { + const keys = Object.keys(headers2); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + processHeader(this, key, headers2[key]); + } + } else if (headers2 != null) { + throw new InvalidArgumentError$k("headers must be an object or an array"); + } + if (util$j.isFormDataLike(this.body)) { + if (util$j.nodeMajor < 16 || util$j.nodeMajor === 16 && util$j.nodeMinor < 8) { + throw new InvalidArgumentError$k("Form-Data bodies are only supported in node v16.8 and newer."); + } + if (!extractBody) { + extractBody = requireBody().extractBody; + } + const [bodyStream, contentType] = extractBody(body2); + if (this.contentType == null) { + this.contentType = contentType; + this.headers += `content-type: ${contentType}\r +`; + } + this.body = bodyStream.stream; + this.contentLength = bodyStream.length; + } else if (util$j.isBlobLike(body2) && this.contentType == null && body2.type) { + this.contentType = body2.type; + this.headers += `content-type: ${body2.type}\r +`; + } + util$j.validateHandler(handler2, method, upgrade2); + this.servername = util$j.getServerName(this.host); + this[kHandler] = handler2; + if (channels$1.create.hasSubscribers) { + channels$1.create.publish({ request: this }); + } + } + onBodySent(chunk) { + if (this[kHandler].onBodySent) { + try { + return this[kHandler].onBodySent(chunk); + } catch (err) { + this.abort(err); + } + } + } + onRequestSent() { + if (channels$1.bodySent.hasSubscribers) { + channels$1.bodySent.publish({ request: this }); + } + if (this[kHandler].onRequestSent) { + try { + return this[kHandler].onRequestSent(); + } catch (err) { + this.abort(err); + } + } + } + onConnect(abort2) { + assert$9(!this.aborted); + assert$9(!this.completed); + if (this.error) { + abort2(this.error); + } else { + this.abort = abort2; + return this[kHandler].onConnect(abort2); + } + } + onHeaders(statusCode, headers2, resume2, statusText) { + assert$9(!this.aborted); + assert$9(!this.completed); + if (channels$1.headers.hasSubscribers) { + channels$1.headers.publish({ request: this, response: { statusCode, headers: headers2, statusText } }); + } + try { + return this[kHandler].onHeaders(statusCode, headers2, resume2, statusText); + } catch (err) { + this.abort(err); + } + } + onData(chunk) { + assert$9(!this.aborted); + assert$9(!this.completed); + try { + return this[kHandler].onData(chunk); + } catch (err) { + this.abort(err); + return false; + } + } + onUpgrade(statusCode, headers2, socket) { + assert$9(!this.aborted); + assert$9(!this.completed); + return this[kHandler].onUpgrade(statusCode, headers2, socket); + } + onComplete(trailers) { + this.onFinally(); + assert$9(!this.aborted); + this.completed = true; + if (channels$1.trailers.hasSubscribers) { + channels$1.trailers.publish({ request: this, trailers }); + } + try { + return this[kHandler].onComplete(trailers); + } catch (err) { + this.onError(err); + } + } + onError(error2) { + this.onFinally(); + if (channels$1.error.hasSubscribers) { + channels$1.error.publish({ request: this, error: error2 }); + } + if (this.aborted) { + return; + } + this.aborted = true; + return this[kHandler].onError(error2); + } + onFinally() { + if (this.errorHandler) { + this.body.off("error", this.errorHandler); + this.errorHandler = null; + } + if (this.endHandler) { + this.body.off("end", this.endHandler); + this.endHandler = null; + } + } + // TODO: adjust to support H2 + addHeader(key, value) { + processHeader(this, key, value); + return this; + } + static [kHTTP1BuildRequest$1](origin, opts, handler2) { + return new Request(origin, opts, handler2); + } + static [kHTTP2BuildRequest$1](origin, opts, handler2) { + const headers2 = opts.headers; + opts = { ...opts, headers: null }; + const request2 = new Request(origin, opts, handler2); + request2.headers = {}; + if (Array.isArray(headers2)) { + if (headers2.length % 2 !== 0) { + throw new InvalidArgumentError$k("headers array must be even"); + } + for (let i = 0; i < headers2.length; i += 2) { + processHeader(request2, headers2[i], headers2[i + 1], true); + } + } else if (headers2 && typeof headers2 === "object") { + const keys = Object.keys(headers2); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + processHeader(request2, key, headers2[key], true); + } + } else if (headers2 != null) { + throw new InvalidArgumentError$k("headers must be an object or an array"); + } + return request2; + } + static [kHTTP2CopyHeaders$1](raw) { + const rawHeaders = raw.split("\r\n"); + const headers2 = {}; + for (const header2 of rawHeaders) { + const [key, value] = header2.split(": "); + if (value == null || value.length === 0) continue; + if (headers2[key]) headers2[key] += `,${value}`; + else headers2[key] = value; + } + return headers2; + } +}; +function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { + throw new InvalidArgumentError$k(`invalid ${key} header`); + } + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError$k(`invalid ${key} header`); + } + return skipAppend ? val : `${key}: ${val}\r +`; +} +function processHeader(request2, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { + throw new InvalidArgumentError$k(`invalid ${key} header`); + } else if (val === void 0) { + return; + } + if (request2.host === null && key.length === 4 && key.toLowerCase() === "host") { + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError$k(`invalid ${key} header`); + } + request2.host = val; + } else if (request2.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { + request2.contentLength = parseInt(val, 10); + if (!Number.isFinite(request2.contentLength)) { + throw new InvalidArgumentError$k("invalid content-length header"); + } + } else if (request2.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { + request2.contentType = val; + if (skipAppend) request2.headers[key] = processHeaderValue(key, val, skipAppend); + else request2.headers += processHeaderValue(key, val); + } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { + throw new InvalidArgumentError$k("invalid transfer-encoding header"); + } else if (key.length === 10 && key.toLowerCase() === "connection") { + const value = typeof val === "string" ? val.toLowerCase() : null; + if (value !== "close" && value !== "keep-alive") { + throw new InvalidArgumentError$k("invalid connection header"); + } else if (value === "close") { + request2.reset = true; + } + } else if (key.length === 10 && key.toLowerCase() === "keep-alive") { + throw new InvalidArgumentError$k("invalid keep-alive header"); + } else if (key.length === 7 && key.toLowerCase() === "upgrade") { + throw new InvalidArgumentError$k("invalid upgrade header"); + } else if (key.length === 6 && key.toLowerCase() === "expect") { + throw new NotSupportedError$1("expect header not supported"); + } else if (tokenRegExp.exec(key) === null) { + throw new InvalidArgumentError$k("invalid header key"); + } else { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { + if (skipAppend) { + if (request2.headers[key]) request2.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request2.headers[key] = processHeaderValue(key, val[i], skipAppend); + } else { + request2.headers += processHeaderValue(key, val[i]); + } + } + } else { + if (skipAppend) request2.headers[key] = processHeaderValue(key, val, skipAppend); + else request2.headers += processHeaderValue(key, val); + } + } +} +var request$3 = Request$1; +const EventEmitter = require$$0$2; +let Dispatcher$3 = class Dispatcher extends EventEmitter { + dispatch() { + throw new Error("not implemented"); + } + close() { + throw new Error("not implemented"); + } + destroy() { + throw new Error("not implemented"); + } +}; +var dispatcher = Dispatcher$3; +const Dispatcher$2 = dispatcher; +const { + ClientDestroyedError: ClientDestroyedError$1, + ClientClosedError: ClientClosedError2, + InvalidArgumentError: InvalidArgumentError$j +} = errors$4; +const { kDestroy: kDestroy$4, kClose: kClose$6, kDispatch: kDispatch$3, kInterceptors: kInterceptors$5 } = symbols$4; +const kDestroyed = Symbol("destroyed"); +const kClosed = Symbol("closed"); +const kOnDestroyed = Symbol("onDestroyed"); +const kOnClosed = Symbol("onClosed"); +const kInterceptedDispatch = Symbol("Intercepted Dispatch"); +let DispatcherBase$4 = class DispatcherBase extends Dispatcher$2 { + constructor() { + super(); + this[kDestroyed] = false; + this[kOnDestroyed] = null; + this[kClosed] = false; + this[kOnClosed] = []; + } + get destroyed() { + return this[kDestroyed]; + } + get closed() { + return this[kClosed]; + } + get interceptors() { + return this[kInterceptors$5]; + } + set interceptors(newInterceptors) { + if (newInterceptors) { + for (let i = newInterceptors.length - 1; i >= 0; i--) { + const interceptor = this[kInterceptors$5][i]; + if (typeof interceptor !== "function") { + throw new InvalidArgumentError$j("interceptor must be an function"); + } + } + } + this[kInterceptors$5] = newInterceptors; + } + close(callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + this.close((err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError$j("invalid callback"); + } + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError$1(), null)); + return; + } + if (this[kClosed]) { + if (this[kOnClosed]) { + this[kOnClosed].push(callback); + } else { + queueMicrotask(() => callback(null, null)); + } + return; + } + this[kClosed] = true; + this[kOnClosed].push(callback); + const onClosed = () => { + const callbacks = this[kOnClosed]; + this[kOnClosed] = null; + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null); + } + }; + this[kClose$6]().then(() => this.destroy()).then(() => { + queueMicrotask(onClosed); + }); + } + destroy(err, callback) { + if (typeof err === "function") { + callback = err; + err = null; + } + if (callback === void 0) { + return new Promise((resolve, reject) => { + this.destroy(err, (err2, data) => { + return err2 ? ( + /* istanbul ignore next: should never error */ + reject(err2) + ) : resolve(data); + }); + }); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError$j("invalid callback"); + } + if (this[kDestroyed]) { + if (this[kOnDestroyed]) { + this[kOnDestroyed].push(callback); + } else { + queueMicrotask(() => callback(null, null)); + } + return; + } + if (!err) { + err = new ClientDestroyedError$1(); + } + this[kDestroyed] = true; + this[kOnDestroyed] = this[kOnDestroyed] || []; + this[kOnDestroyed].push(callback); + const onDestroyed = () => { + const callbacks = this[kOnDestroyed]; + this[kOnDestroyed] = null; + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null); + } + }; + this[kDestroy$4](err).then(() => { + queueMicrotask(onDestroyed); + }); + } + [kInterceptedDispatch](opts, handler2) { + if (!this[kInterceptors$5] || this[kInterceptors$5].length === 0) { + this[kInterceptedDispatch] = this[kDispatch$3]; + return this[kDispatch$3](opts, handler2); + } + let dispatch = this[kDispatch$3].bind(this); + for (let i = this[kInterceptors$5].length - 1; i >= 0; i--) { + dispatch = this[kInterceptors$5][i](dispatch); + } + this[kInterceptedDispatch] = dispatch; + return dispatch(opts, handler2); + } + dispatch(opts, handler2) { + if (!handler2 || typeof handler2 !== "object") { + throw new InvalidArgumentError$j("handler must be an object"); + } + try { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError$j("opts must be an object."); + } + if (this[kDestroyed] || this[kOnDestroyed]) { + throw new ClientDestroyedError$1(); + } + if (this[kClosed]) { + throw new ClientClosedError2(); + } + return this[kInterceptedDispatch](opts, handler2); + } catch (err) { + if (typeof handler2.onError !== "function") { + throw new InvalidArgumentError$j("invalid onError method"); + } + handler2.onError(err); + return false; + } + } +}; +var dispatcherBase = DispatcherBase$4; +const net$1 = require$$0$6; +const assert$8 = require$$0$4; +const util$i = util$l; +const { InvalidArgumentError: InvalidArgumentError$i, ConnectTimeoutError: ConnectTimeoutError2 } = errors$4; +let tls; +let SessionCache; +if (commonjsGlobal.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { + SessionCache = class WeakSessionCache { + constructor(maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions; + this._sessionCache = /* @__PURE__ */ new Map(); + this._sessionRegistry = new commonjsGlobal.FinalizationRegistry((key) => { + if (this._sessionCache.size < this._maxCachedSessions) { + return; + } + const ref = this._sessionCache.get(key); + if (ref !== void 0 && ref.deref() === void 0) { + this._sessionCache.delete(key); + } + }); + } + get(sessionKey) { + const ref = this._sessionCache.get(sessionKey); + return ref ? ref.deref() : null; + } + set(sessionKey, session) { + if (this._maxCachedSessions === 0) { + return; + } + this._sessionCache.set(sessionKey, new WeakRef(session)); + this._sessionRegistry.register(session, sessionKey); + } + }; +} else { + SessionCache = class SimpleSessionCache { + constructor(maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions; + this._sessionCache = /* @__PURE__ */ new Map(); + } + get(sessionKey) { + return this._sessionCache.get(sessionKey); + } + set(sessionKey, session) { + if (this._maxCachedSessions === 0) { + return; + } + if (this._sessionCache.size >= this._maxCachedSessions) { + const { value: oldestKey } = this._sessionCache.keys().next(); + this._sessionCache.delete(oldestKey); + } + this._sessionCache.set(sessionKey, session); + } + }; +} +function buildConnector$4({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError$i("maxCachedSessions must be a positive integer or zero"); + } + const options2 = { path: socketPath, ...opts }; + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); + timeout = timeout == null ? 1e4 : timeout; + allowH2 = allowH2 != null ? allowH2 : false; + return function connect2({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket; + if (protocol === "https:") { + if (!tls) { + tls = require$$1$1; + } + servername = servername || options2.servername || util$i.getServerName(host) || null; + const sessionKey = servername || hostname; + const session = sessionCache.get(sessionKey) || null; + assert$8(sessionKey); + socket = tls.connect({ + highWaterMark: 16384, + // TLS in node can't have bigger HWM anyway... + ...options2, + servername, + session, + localAddress, + // TODO(HTTP/2): Add support for h2c + ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], + socket: httpSocket, + // upgrade socket connection + port: port || 443, + host: hostname + }); + socket.on("session", function(session2) { + sessionCache.set(sessionKey, session2); + }); + } else { + assert$8(!httpSocket, "httpSocket can only be sent on TLS update"); + socket = net$1.connect({ + highWaterMark: 64 * 1024, + // Same as nodejs fs streams. + ...options2, + localAddress, + port: port || 80, + host: hostname + }); + } + if (options2.keepAlive == null || options2.keepAlive) { + const keepAliveInitialDelay = options2.keepAliveInitialDelay === void 0 ? 6e4 : options2.keepAliveInitialDelay; + socket.setKeepAlive(true, keepAliveInitialDelay); + } + const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout); + socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { + cancelTimeout(); + if (callback) { + const cb = callback; + callback = null; + cb(null, this); + } + }).on("error", function(err) { + cancelTimeout(); + if (callback) { + const cb = callback; + callback = null; + cb(err); + } + }); + return socket; + }; +} +function setupTimeout(onConnectTimeout2, timeout) { + if (!timeout) { + return () => { + }; + } + let s1 = null; + let s2 = null; + const timeoutId = setTimeout(() => { + s1 = setImmediate(() => { + if (process.platform === "win32") { + s2 = setImmediate(() => onConnectTimeout2()); + } else { + onConnectTimeout2(); + } + }); + }, timeout); + return () => { + clearTimeout(timeoutId); + clearImmediate(s1); + clearImmediate(s2); + }; +} +function onConnectTimeout(socket) { + util$i.destroy(socket, new ConnectTimeoutError2()); +} +var connect$2 = buildConnector$4; +var constants$b = {}; +var utils$m = {}; +var hasRequiredUtils; +function requireUtils() { + if (hasRequiredUtils) return utils$m; + hasRequiredUtils = 1; + Object.defineProperty(utils$m, "__esModule", { value: true }); + utils$m.enumToMap = void 0; + function enumToMap(obj) { + const res = {}; + Object.keys(obj).forEach((key) => { + const value = obj[key]; + if (typeof value === "number") { + res[key] = value; + } + }); + return res; + } + utils$m.enumToMap = enumToMap; + return utils$m; +} +var hasRequiredConstants$2; +function requireConstants$2() { + if (hasRequiredConstants$2) return constants$b; + hasRequiredConstants$2 = 1; + (function(exports2) { + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0; + const utils_12 = requireUtils(); + (function(ERROR2) { + ERROR2[ERROR2["OK"] = 0] = "OK"; + ERROR2[ERROR2["INTERNAL"] = 1] = "INTERNAL"; + ERROR2[ERROR2["STRICT"] = 2] = "STRICT"; + ERROR2[ERROR2["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR2[ERROR2["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR2[ERROR2["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR2[ERROR2["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR2[ERROR2["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR2[ERROR2["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR2[ERROR2["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR2[ERROR2["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR2[ERROR2["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR2[ERROR2["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR2[ERROR2["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR2[ERROR2["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR2[ERROR2["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR2[ERROR2["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR2[ERROR2["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR2[ERROR2["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR2[ERROR2["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR2[ERROR2["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR2[ERROR2["PAUSED"] = 21] = "PAUSED"; + ERROR2[ERROR2["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR2[ERROR2["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR2[ERROR2["USER"] = 24] = "USER"; + })(exports2.ERROR || (exports2.ERROR = {})); + (function(TYPE2) { + TYPE2[TYPE2["BOTH"] = 0] = "BOTH"; + TYPE2[TYPE2["REQUEST"] = 1] = "REQUEST"; + TYPE2[TYPE2["RESPONSE"] = 2] = "RESPONSE"; + })(exports2.TYPE || (exports2.TYPE = {})); + (function(FLAGS) { + FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; + FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; + FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; + FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; + })(exports2.FLAGS || (exports2.FLAGS = {})); + (function(LENIENT_FLAGS) { + LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; + })(exports2.LENIENT_FLAGS || (exports2.LENIENT_FLAGS = {})); + var METHODS; + (function(METHODS2) { + METHODS2[METHODS2["DELETE"] = 0] = "DELETE"; + METHODS2[METHODS2["GET"] = 1] = "GET"; + METHODS2[METHODS2["HEAD"] = 2] = "HEAD"; + METHODS2[METHODS2["POST"] = 3] = "POST"; + METHODS2[METHODS2["PUT"] = 4] = "PUT"; + METHODS2[METHODS2["CONNECT"] = 5] = "CONNECT"; + METHODS2[METHODS2["OPTIONS"] = 6] = "OPTIONS"; + METHODS2[METHODS2["TRACE"] = 7] = "TRACE"; + METHODS2[METHODS2["COPY"] = 8] = "COPY"; + METHODS2[METHODS2["LOCK"] = 9] = "LOCK"; + METHODS2[METHODS2["MKCOL"] = 10] = "MKCOL"; + METHODS2[METHODS2["MOVE"] = 11] = "MOVE"; + METHODS2[METHODS2["PROPFIND"] = 12] = "PROPFIND"; + METHODS2[METHODS2["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS2[METHODS2["SEARCH"] = 14] = "SEARCH"; + METHODS2[METHODS2["UNLOCK"] = 15] = "UNLOCK"; + METHODS2[METHODS2["BIND"] = 16] = "BIND"; + METHODS2[METHODS2["REBIND"] = 17] = "REBIND"; + METHODS2[METHODS2["UNBIND"] = 18] = "UNBIND"; + METHODS2[METHODS2["ACL"] = 19] = "ACL"; + METHODS2[METHODS2["REPORT"] = 20] = "REPORT"; + METHODS2[METHODS2["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS2[METHODS2["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS2[METHODS2["MERGE"] = 23] = "MERGE"; + METHODS2[METHODS2["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS2[METHODS2["NOTIFY"] = 25] = "NOTIFY"; + METHODS2[METHODS2["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS2[METHODS2["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + METHODS2[METHODS2["PATCH"] = 28] = "PATCH"; + METHODS2[METHODS2["PURGE"] = 29] = "PURGE"; + METHODS2[METHODS2["MKCALENDAR"] = 30] = "MKCALENDAR"; + METHODS2[METHODS2["LINK"] = 31] = "LINK"; + METHODS2[METHODS2["UNLINK"] = 32] = "UNLINK"; + METHODS2[METHODS2["SOURCE"] = 33] = "SOURCE"; + METHODS2[METHODS2["PRI"] = 34] = "PRI"; + METHODS2[METHODS2["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS2[METHODS2["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS2[METHODS2["SETUP"] = 37] = "SETUP"; + METHODS2[METHODS2["PLAY"] = 38] = "PLAY"; + METHODS2[METHODS2["PAUSE"] = 39] = "PAUSE"; + METHODS2[METHODS2["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS2[METHODS2["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS2[METHODS2["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS2[METHODS2["REDIRECT"] = 43] = "REDIRECT"; + METHODS2[METHODS2["RECORD"] = 44] = "RECORD"; + METHODS2[METHODS2["FLUSH"] = 45] = "FLUSH"; + })(METHODS = exports2.METHODS || (exports2.METHODS = {})); + exports2.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS["M-SEARCH"], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + // TODO(indutny): should we allow it with HTTP? + METHODS.SOURCE + ]; + exports2.METHODS_ICE = [ + METHODS.SOURCE + ]; + exports2.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + // For AirPlay + METHODS.GET, + METHODS.POST + ]; + exports2.METHOD_MAP = utils_12.enumToMap(METHODS); + exports2.H_METHOD_MAP = {}; + Object.keys(exports2.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports2.H_METHOD_MAP[key] = exports2.METHOD_MAP[key]; + } + }); + (function(FINISH) { + FINISH[FINISH["SAFE"] = 0] = "SAFE"; + FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; + })(exports2.FINISH || (exports2.FINISH = {})); + exports2.ALPHA = []; + for (let i = "A".charCodeAt(0); i <= "Z".charCodeAt(0); i++) { + exports2.ALPHA.push(String.fromCharCode(i)); + exports2.ALPHA.push(String.fromCharCode(i + 32)); + } + exports2.NUM_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9 + }; + exports2.HEX_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + A: 10, + B: 11, + C: 12, + D: 13, + E: 14, + F: 15, + a: 10, + b: 11, + c: 12, + d: 13, + e: 14, + f: 15 + }; + exports2.NUM = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9" + ]; + exports2.ALPHANUM = exports2.ALPHA.concat(exports2.NUM); + exports2.MARK = ["-", "_", ".", "!", "~", "*", "'", "(", ")"]; + exports2.USERINFO_CHARS = exports2.ALPHANUM.concat(exports2.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]); + exports2.STRICT_URL_CHAR = [ + "!", + '"', + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + ":", + ";", + "<", + "=", + ">", + "@", + "[", + "\\", + "]", + "^", + "_", + "`", + "{", + "|", + "}", + "~" + ].concat(exports2.ALPHANUM); + exports2.URL_CHAR = exports2.STRICT_URL_CHAR.concat([" ", "\f"]); + for (let i = 128; i <= 255; i++) { + exports2.URL_CHAR.push(i); + } + exports2.HEX = exports2.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]); + exports2.STRICT_TOKEN = [ + "!", + "#", + "$", + "%", + "&", + "'", + "*", + "+", + "-", + ".", + "^", + "_", + "`", + "|", + "~" + ].concat(exports2.ALPHANUM); + exports2.TOKEN = exports2.STRICT_TOKEN.concat([" "]); + exports2.HEADER_CHARS = [" "]; + for (let i = 32; i <= 255; i++) { + if (i !== 127) { + exports2.HEADER_CHARS.push(i); + } + } + exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS.filter((c) => c !== 44); + exports2.MAJOR = exports2.NUM_MAP; + exports2.MINOR = exports2.MAJOR; + var HEADER_STATE; + (function(HEADER_STATE2) { + HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE2[HEADER_STATE2["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; + })(HEADER_STATE = exports2.HEADER_STATE || (exports2.HEADER_STATE = {})); + exports2.SPECIAL_HEADERS = { + "connection": HEADER_STATE.CONNECTION, + "content-length": HEADER_STATE.CONTENT_LENGTH, + "proxy-connection": HEADER_STATE.CONNECTION, + "transfer-encoding": HEADER_STATE.TRANSFER_ENCODING, + "upgrade": HEADER_STATE.UPGRADE + }; + })(constants$b); + return constants$b; +} +const util$h = util$l; +const { kBodyUsed } = symbols$4; +const assert$7 = require$$0$4; +const { InvalidArgumentError: InvalidArgumentError$h } = errors$4; +const EE$5 = require$$0$2; +const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; +const kBody$1 = Symbol("body"); +class BodyAsyncIterable { + constructor(body2) { + this[kBody$1] = body2; + this[kBodyUsed] = false; + } + async *[Symbol.asyncIterator]() { + assert$7(!this[kBodyUsed], "disturbed"); + this[kBodyUsed] = true; + yield* this[kBody$1]; + } +} +let RedirectHandler$2 = class RedirectHandler { + constructor(dispatch, maxRedirections, opts, handler2) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError$h("maxRedirections must be a positive number"); + } + util$h.validateHandler(handler2, opts.method, opts.upgrade); + this.dispatch = dispatch; + this.location = null; + this.abort = null; + this.opts = { ...opts, maxRedirections: 0 }; + this.maxRedirections = maxRedirections; + this.handler = handler2; + this.history = []; + if (util$h.isStream(this.opts.body)) { + if (util$h.bodyLength(this.opts.body) === 0) { + this.opts.body.on("data", function() { + assert$7(false); + }); + } + if (typeof this.opts.body.readableDidRead !== "boolean") { + this.opts.body[kBodyUsed] = false; + EE$5.prototype.on.call(this.opts.body, "data", function() { + this[kBodyUsed] = true; + }); + } + } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { + this.opts.body = new BodyAsyncIterable(this.opts.body); + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util$h.isIterable(this.opts.body)) { + this.opts.body = new BodyAsyncIterable(this.opts.body); + } + } + onConnect(abort2) { + this.abort = abort2; + this.handler.onConnect(abort2, { history: this.history }); + } + onUpgrade(statusCode, headers2, socket) { + this.handler.onUpgrade(statusCode, headers2, socket); + } + onError(error2) { + this.handler.onError(error2); + } + onHeaders(statusCode, headers2, resume2, statusText) { + this.location = this.history.length >= this.maxRedirections || util$h.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers2); + if (this.opts.origin) { + this.history.push(new URL(this.opts.path, this.opts.origin)); + } + if (!this.location) { + return this.handler.onHeaders(statusCode, headers2, resume2, statusText); + } + const { origin, pathname, search } = util$h.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const path2 = search ? `${pathname}${search}` : pathname; + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); + this.opts.path = path2; + this.opts.origin = origin; + this.opts.maxRedirections = 0; + this.opts.query = null; + if (statusCode === 303 && this.opts.method !== "HEAD") { + this.opts.method = "GET"; + this.opts.body = null; + } + } + onData(chunk) { + if (this.location) ; + else { + return this.handler.onData(chunk); + } + } + onComplete(trailers) { + if (this.location) { + this.location = null; + this.abort = null; + this.dispatch(this.opts, this); + } else { + this.handler.onComplete(trailers); + } + } + onBodySent(chunk) { + if (this.handler.onBodySent) { + this.handler.onBodySent(chunk); + } + } +}; +function parseLocation(statusCode, headers2) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) { + return null; + } + for (let i = 0; i < headers2.length; i += 2) { + if (headers2[i].toString().toLowerCase() === "location") { + return headers2[i + 1]; + } + } +} +function shouldRemoveHeader(header2, removeContent, unknownOrigin) { + if (header2.length === 4) { + return util$h.headerNameToString(header2) === "host"; + } + if (removeContent && util$h.headerNameToString(header2).startsWith("content-")) { + return true; + } + if (unknownOrigin && (header2.length === 13 || header2.length === 6 || header2.length === 19)) { + const name = util$h.headerNameToString(header2); + return name === "authorization" || name === "cookie" || name === "proxy-authorization"; + } + return false; +} +function cleanRequestHeaders(headers2, removeContent, unknownOrigin) { + const ret = []; + if (Array.isArray(headers2)) { + for (let i = 0; i < headers2.length; i += 2) { + if (!shouldRemoveHeader(headers2[i], removeContent, unknownOrigin)) { + ret.push(headers2[i], headers2[i + 1]); + } + } + } else if (headers2 && typeof headers2 === "object") { + for (const key of Object.keys(headers2)) { + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { + ret.push(key, headers2[key]); + } + } + } else { + assert$7(headers2 == null, "headers must be an object or an array"); + } + return ret; +} +var RedirectHandler_1 = RedirectHandler$2; +const RedirectHandler$1 = RedirectHandler_1; +function createRedirectInterceptor$3({ maxRedirections: defaultMaxRedirections }) { + return (dispatch) => { + return function Intercept(opts, handler2) { + const { maxRedirections = defaultMaxRedirections } = opts; + if (!maxRedirections) { + return dispatch(opts, handler2); + } + const redirectHandler = new RedirectHandler$1(dispatch, maxRedirections, opts, handler2); + opts = { ...opts, maxRedirections: 0 }; + return dispatch(opts, redirectHandler); + }; + }; +} +var redirectInterceptor = createRedirectInterceptor$3; +var llhttpWasm; +var hasRequiredLlhttpWasm; +function requireLlhttpWasm() { + if (hasRequiredLlhttpWasm) return llhttpWasm; + hasRequiredLlhttpWasm = 1; + llhttpWasm = "AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfw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BBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAC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AAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2A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VVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8="; + return llhttpWasm; +} +var llhttp_simdWasm; +var hasRequiredLlhttp_simdWasm; +function requireLlhttp_simdWasm() { + if (hasRequiredLlhttp_simdWasm) return llhttp_simdWasm; + hasRequiredLlhttp_simdWasm = 1; + llhttp_simdWasm = "AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21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QLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZA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LQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQ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NAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQ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NACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAA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AAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=="; + return llhttp_simdWasm; +} +const assert$6 = require$$0$4; +const net = require$$0$6; +const http$1 = require$$2$2; +const { pipeline: pipeline$1 } = require$$0$5; +const util$g = util$l; +const timers = timers$1; +const Request2 = request$3; +const DispatcherBase$3 = dispatcherBase; +const { + RequestContentLengthMismatchError: RequestContentLengthMismatchError2, + ResponseContentLengthMismatchError: ResponseContentLengthMismatchError2, + InvalidArgumentError: InvalidArgumentError$g, + RequestAbortedError: RequestAbortedError$8, + HeadersTimeoutError: HeadersTimeoutError2, + HeadersOverflowError: HeadersOverflowError2, + SocketError: SocketError$2, + InformationalError: InformationalError2, + BodyTimeoutError: BodyTimeoutError2, + HTTPParserError: HTTPParserError2, + ResponseExceededMaxSizeError: ResponseExceededMaxSizeError2, + ClientDestroyedError: ClientDestroyedError2 +} = errors$4; +const buildConnector$3 = connect$2; +const { + kUrl: kUrl$3, + kReset, + kServerName, + kClient: kClient$1, + kBusy: kBusy$1, + kParser, + kConnect, + kBlocking, + kResuming, + kRunning: kRunning$3, + kPending: kPending$2, + kSize: kSize$4, + kWriting, + kQueue: kQueue$1, + kConnected: kConnected$5, + kConnecting, + kNeedDrain: kNeedDrain$3, + kNoRef, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kSocket, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kConnector, + kMaxRedirections: kMaxRedirections$1, + kMaxRequests, + kCounter, + kClose: kClose$5, + kDestroy: kDestroy$3, + kDispatch: kDispatch$2, + kInterceptors: kInterceptors$4, + kLocalAddress, + kMaxResponseSize, + kHTTPConnVersion, + // HTTP2 + kHost, + kHTTP2Session, + kHTTP2SessionState, + kHTTP2BuildRequest, + kHTTP2CopyHeaders, + kHTTP1BuildRequest +} = symbols$4; +let http2; +try { + http2 = require("http2"); +} catch { + http2 = { constants: {} }; +} +const { + constants: { + HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_CONTENT_LENGTH, + HTTP2_HEADER_EXPECT, + HTTP2_HEADER_STATUS + } +} = http2; +let h2ExperimentalWarned = false; +const FastBuffer = Buffer[Symbol.species]; +const kClosedResolve$1 = Symbol("kClosedResolve"); +const channels = {}; +try { + const diagnosticsChannel = require("diagnostics_channel"); + channels.sendHeaders = diagnosticsChannel.channel("undici:client:sendHeaders"); + channels.beforeConnect = diagnosticsChannel.channel("undici:client:beforeConnect"); + channels.connectError = diagnosticsChannel.channel("undici:client:connectError"); + channels.connected = diagnosticsChannel.channel("undici:client:connected"); +} catch { + channels.sendHeaders = { hasSubscribers: false }; + channels.beforeConnect = { hasSubscribers: false }; + channels.connectError = { hasSubscribers: false }; + channels.connected = { hasSubscribers: false }; +} +let Client$4 = class Client extends DispatcherBase$3 { + /** + * + * @param {string|URL} url + * @param {import('../types/client').Client.Options} options + */ + constructor(url, { + interceptors, + maxHeaderSize, + headersTimeout, + socketTimeout, + requestTimeout, + connectTimeout, + bodyTimeout, + idleTimeout, + keepAlive, + keepAliveTimeout, + maxKeepAliveTimeout, + keepAliveMaxTimeout, + keepAliveTimeoutThreshold, + socketPath, + pipelining, + tls: tls2, + strictContentLength, + maxCachedSessions, + maxRedirections, + connect: connect2, + maxRequestsPerClient, + localAddress, + maxResponseSize, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + // h2 + allowH2, + maxConcurrentStreams + } = {}) { + super(); + if (keepAlive !== void 0) { + throw new InvalidArgumentError$g("unsupported keepAlive, use pipelining=0 instead"); + } + if (socketTimeout !== void 0) { + throw new InvalidArgumentError$g("unsupported socketTimeout, use headersTimeout & bodyTimeout instead"); + } + if (requestTimeout !== void 0) { + throw new InvalidArgumentError$g("unsupported requestTimeout, use headersTimeout & bodyTimeout instead"); + } + if (idleTimeout !== void 0) { + throw new InvalidArgumentError$g("unsupported idleTimeout, use keepAliveTimeout instead"); + } + if (maxKeepAliveTimeout !== void 0) { + throw new InvalidArgumentError$g("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead"); + } + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { + throw new InvalidArgumentError$g("invalid maxHeaderSize"); + } + if (socketPath != null && typeof socketPath !== "string") { + throw new InvalidArgumentError$g("invalid socketPath"); + } + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { + throw new InvalidArgumentError$g("invalid connectTimeout"); + } + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { + throw new InvalidArgumentError$g("invalid keepAliveTimeout"); + } + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { + throw new InvalidArgumentError$g("invalid keepAliveMaxTimeout"); + } + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { + throw new InvalidArgumentError$g("invalid keepAliveTimeoutThreshold"); + } + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError$g("headersTimeout must be a positive integer or zero"); + } + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError$g("bodyTimeout must be a positive integer or zero"); + } + if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { + throw new InvalidArgumentError$g("connect must be a function or an object"); + } + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError$g("maxRedirections must be a positive number"); + } + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { + throw new InvalidArgumentError$g("maxRequestsPerClient must be a positive number"); + } + if (localAddress != null && (typeof localAddress !== "string" || net.isIP(localAddress) === 0)) { + throw new InvalidArgumentError$g("localAddress must be valid string IP address"); + } + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { + throw new InvalidArgumentError$g("maxResponseSize must be a positive number"); + } + if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) { + throw new InvalidArgumentError$g("autoSelectFamilyAttemptTimeout must be a positive number"); + } + if (allowH2 != null && typeof allowH2 !== "boolean") { + throw new InvalidArgumentError$g("allowH2 must be a valid boolean value"); + } + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) { + throw new InvalidArgumentError$g("maxConcurrentStreams must be a possitive integer, greater than 0"); + } + if (typeof connect2 !== "function") { + connect2 = buildConnector$3({ + ...tls2, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...util$g.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...connect2 + }); + } + this[kInterceptors$4] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor$2({ maxRedirections })]; + this[kUrl$3] = util$g.parseOrigin(url); + this[kConnector] = connect2; + this[kSocket] = null; + this[kPipelining] = pipelining != null ? pipelining : 1; + this[kMaxHeadersSize] = maxHeaderSize || http$1.maxHeaderSize; + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold; + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]; + this[kServerName] = null; + this[kLocalAddress] = localAddress != null ? localAddress : null; + this[kResuming] = 0; + this[kNeedDrain$3] = 0; + this[kHostHeader] = `host: ${this[kUrl$3].hostname}${this[kUrl$3].port ? `:${this[kUrl$3].port}` : ""}\r +`; + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5; + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5; + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength; + this[kMaxRedirections$1] = maxRedirections; + this[kMaxRequests] = maxRequestsPerClient; + this[kClosedResolve$1] = null; + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1; + this[kHTTPConnVersion] = "h1"; + this[kHTTP2Session] = null; + this[kHTTP2SessionState] = !allowH2 ? null : { + // streams: null, // Fixed queue of streams - For future support of `push` + openStreams: 0, + // Keep track of them to decide wether or not unref the session + maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 + // Max peerConcurrentStreams for a Node h2 server + }; + this[kHost] = `${this[kUrl$3].hostname}${this[kUrl$3].port ? `:${this[kUrl$3].port}` : ""}`; + this[kQueue$1] = []; + this[kRunningIdx] = 0; + this[kPendingIdx] = 0; + } + get pipelining() { + return this[kPipelining]; + } + set pipelining(value) { + this[kPipelining] = value; + resume(this, true); + } + get [kPending$2]() { + return this[kQueue$1].length - this[kPendingIdx]; + } + get [kRunning$3]() { + return this[kPendingIdx] - this[kRunningIdx]; + } + get [kSize$4]() { + return this[kQueue$1].length - this[kRunningIdx]; + } + get [kConnected$5]() { + return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed; + } + get [kBusy$1]() { + const socket = this[kSocket]; + return socket && (socket[kReset] || socket[kWriting] || socket[kBlocking]) || this[kSize$4] >= (this[kPipelining] || 1) || this[kPending$2] > 0; + } + /* istanbul ignore: only used for test */ + [kConnect](cb) { + connect$1(this); + this.once("connect", cb); + } + [kDispatch$2](opts, handler2) { + const origin = opts.origin || this[kUrl$3].origin; + const request2 = this[kHTTPConnVersion] === "h2" ? Request2[kHTTP2BuildRequest](origin, opts, handler2) : Request2[kHTTP1BuildRequest](origin, opts, handler2); + this[kQueue$1].push(request2); + if (this[kResuming]) ; + else if (util$g.bodyLength(request2.body) == null && util$g.isIterable(request2.body)) { + this[kResuming] = 1; + process.nextTick(resume, this); + } else { + resume(this, true); + } + if (this[kResuming] && this[kNeedDrain$3] !== 2 && this[kBusy$1]) { + this[kNeedDrain$3] = 2; + } + return this[kNeedDrain$3] < 2; + } + async [kClose$5]() { + return new Promise((resolve) => { + if (!this[kSize$4]) { + resolve(null); + } else { + this[kClosedResolve$1] = resolve; + } + }); + } + async [kDestroy$3](err) { + return new Promise((resolve) => { + const requests = this[kQueue$1].splice(this[kPendingIdx]); + for (let i = 0; i < requests.length; i++) { + const request2 = requests[i]; + errorRequest(this, request2, err); + } + const callback = () => { + if (this[kClosedResolve$1]) { + this[kClosedResolve$1](); + this[kClosedResolve$1] = null; + } + resolve(); + }; + if (this[kHTTP2Session] != null) { + util$g.destroy(this[kHTTP2Session], err); + this[kHTTP2Session] = null; + this[kHTTP2SessionState] = null; + } + if (!this[kSocket]) { + queueMicrotask(callback); + } else { + util$g.destroy(this[kSocket].on("close", callback), err); + } + resume(this); + }); + } +}; +function onHttp2SessionError(err) { + assert$6(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + this[kSocket][kError] = err; + onError(this[kClient$1], err); +} +function onHttp2FrameError(type, code, id) { + const err = new InformationalError2(`HTTP/2: "frameError" received - type ${type}, code ${code}`); + if (id === 0) { + this[kSocket][kError] = err; + onError(this[kClient$1], err); + } +} +function onHttp2SessionEnd() { + util$g.destroy(this, new SocketError$2("other side closed")); + util$g.destroy(this[kSocket], new SocketError$2("other side closed")); +} +function onHTTP2GoAway(code) { + const client2 = this[kClient$1]; + const err = new InformationalError2(`HTTP/2: "GOAWAY" frame received with code ${code}`); + client2[kSocket] = null; + client2[kHTTP2Session] = null; + if (client2.destroyed) { + assert$6(this[kPending$2] === 0); + const requests = client2[kQueue$1].splice(client2[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request2 = requests[i]; + errorRequest(this, request2, err); + } + } else if (client2[kRunning$3] > 0) { + const request2 = client2[kQueue$1][client2[kRunningIdx]]; + client2[kQueue$1][client2[kRunningIdx]++] = null; + errorRequest(client2, request2, err); + } + client2[kPendingIdx] = client2[kRunningIdx]; + assert$6(client2[kRunning$3] === 0); + client2.emit( + "disconnect", + client2[kUrl$3], + [client2], + err + ); + resume(client2); +} +const constants$a = requireConstants$2(); +const createRedirectInterceptor$2 = redirectInterceptor; +const EMPTY_BUF = Buffer.alloc(0); +async function lazyllhttp() { + const llhttpWasmData = process.env.JEST_WORKER_ID ? requireLlhttpWasm() : void 0; + let mod; + try { + mod = await WebAssembly.compile(Buffer.from(requireLlhttp_simdWasm(), "base64")); + } catch (e) { + mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || requireLlhttpWasm(), "base64")); + } + return await WebAssembly.instantiate(mod, { + env: { + /* eslint-disable camelcase */ + wasm_on_url: (p, at, len) => { + return 0; + }, + wasm_on_status: (p, at, len) => { + assert$6.strictEqual(currentParser.ptr, p); + const start = at - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_message_begin: (p) => { + assert$6.strictEqual(currentParser.ptr, p); + return currentParser.onMessageBegin() || 0; + }, + wasm_on_header_field: (p, at, len) => { + assert$6.strictEqual(currentParser.ptr, p); + const start = at - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_header_value: (p, at, len) => { + assert$6.strictEqual(currentParser.ptr, p); + const start = at - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_headers_complete: (p, statusCode, upgrade2, shouldKeepAlive) => { + assert$6.strictEqual(currentParser.ptr, p); + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade2), Boolean(shouldKeepAlive)) || 0; + }, + wasm_on_body: (p, at, len) => { + assert$6.strictEqual(currentParser.ptr, p); + const start = at - currentBufferPtr + currentBufferRef.byteOffset; + return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; + }, + wasm_on_message_complete: (p) => { + assert$6.strictEqual(currentParser.ptr, p); + return currentParser.onMessageComplete() || 0; + } + /* eslint-enable camelcase */ + } + }); +} +let llhttpInstance = null; +let llhttpPromise = lazyllhttp(); +llhttpPromise.catch(); +let currentParser = null; +let currentBufferRef = null; +let currentBufferSize = 0; +let currentBufferPtr = null; +const TIMEOUT_HEADERS = 1; +const TIMEOUT_BODY = 2; +const TIMEOUT_IDLE = 3; +let Parser$1 = class Parser { + constructor(client2, socket, { exports: exports2 }) { + assert$6(Number.isFinite(client2[kMaxHeadersSize]) && client2[kMaxHeadersSize] > 0); + this.llhttp = exports2; + this.ptr = this.llhttp.llhttp_alloc(constants$a.TYPE.RESPONSE); + this.client = client2; + this.socket = socket; + this.timeout = null; + this.timeoutValue = null; + this.timeoutType = null; + this.statusCode = null; + this.statusText = ""; + this.upgrade = false; + this.headers = []; + this.headersSize = 0; + this.headersMaxSize = client2[kMaxHeadersSize]; + this.shouldKeepAlive = false; + this.paused = false; + this.resume = this.resume.bind(this); + this.bytesRead = 0; + this.keepAlive = ""; + this.contentLength = ""; + this.connection = ""; + this.maxResponseSize = client2[kMaxResponseSize]; + } + setTimeout(value, type) { + this.timeoutType = type; + if (value !== this.timeoutValue) { + timers.clearTimeout(this.timeout); + if (value) { + this.timeout = timers.setTimeout(onParserTimeout, value, this); + if (this.timeout.unref) { + this.timeout.unref(); + } + } else { + this.timeout = null; + } + this.timeoutValue = value; + } else if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + } + resume() { + if (this.socket.destroyed || !this.paused) { + return; + } + assert$6(this.ptr != null); + assert$6(currentParser == null); + this.llhttp.llhttp_resume(this.ptr); + assert$6(this.timeoutType === TIMEOUT_BODY); + if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + this.paused = false; + this.execute(this.socket.read() || EMPTY_BUF); + this.readMore(); + } + readMore() { + while (!this.paused && this.ptr) { + const chunk = this.socket.read(); + if (chunk === null) { + break; + } + this.execute(chunk); + } + } + execute(data) { + assert$6(this.ptr != null); + assert$6(currentParser == null); + assert$6(!this.paused); + const { socket, llhttp } = this; + if (data.length > currentBufferSize) { + if (currentBufferPtr) { + llhttp.free(currentBufferPtr); + } + currentBufferSize = Math.ceil(data.length / 4096) * 4096; + currentBufferPtr = llhttp.malloc(currentBufferSize); + } + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data); + try { + let ret; + try { + currentBufferRef = data; + currentParser = this; + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); + } catch (err) { + throw err; + } finally { + currentParser = null; + currentBufferRef = null; + } + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; + if (ret === constants$a.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(data.slice(offset)); + } else if (ret === constants$a.ERROR.PAUSED) { + this.paused = true; + socket.unshift(data.slice(offset)); + } else if (ret !== constants$a.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr); + let message = ""; + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); + message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; + } + throw new HTTPParserError2(message, constants$a.ERROR[ret], data.slice(offset)); + } + } catch (err) { + util$g.destroy(socket, err); + } + } + destroy() { + assert$6(this.ptr != null); + assert$6(currentParser == null); + this.llhttp.llhttp_free(this.ptr); + this.ptr = null; + timers.clearTimeout(this.timeout); + this.timeout = null; + this.timeoutValue = null; + this.timeoutType = null; + this.paused = false; + } + onStatus(buf) { + this.statusText = buf.toString(); + } + onMessageBegin() { + const { socket, client: client2 } = this; + if (socket.destroyed) { + return -1; + } + const request2 = client2[kQueue$1][client2[kRunningIdx]]; + if (!request2) { + return -1; + } + } + onHeaderField(buf) { + const len = this.headers.length; + if ((len & 1) === 0) { + this.headers.push(buf); + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); + } + this.trackHeader(buf.length); + } + onHeaderValue(buf) { + let len = this.headers.length; + if ((len & 1) === 1) { + this.headers.push(buf); + len += 1; + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); + } + const key = this.headers[len - 2]; + if (key.length === 10 && key.toString().toLowerCase() === "keep-alive") { + this.keepAlive += buf.toString(); + } else if (key.length === 10 && key.toString().toLowerCase() === "connection") { + this.connection += buf.toString(); + } else if (key.length === 14 && key.toString().toLowerCase() === "content-length") { + this.contentLength += buf.toString(); + } + this.trackHeader(buf.length); + } + trackHeader(len) { + this.headersSize += len; + if (this.headersSize >= this.headersMaxSize) { + util$g.destroy(this.socket, new HeadersOverflowError2()); + } + } + onUpgrade(head) { + const { upgrade: upgrade2, client: client2, socket, headers: headers2, statusCode } = this; + assert$6(upgrade2); + const request2 = client2[kQueue$1][client2[kRunningIdx]]; + assert$6(request2); + assert$6(!socket.destroyed); + assert$6(socket === client2[kSocket]); + assert$6(!this.paused); + assert$6(request2.upgrade || request2.method === "CONNECT"); + this.statusCode = null; + this.statusText = ""; + this.shouldKeepAlive = null; + assert$6(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + socket.unshift(head); + socket[kParser].destroy(); + socket[kParser] = null; + socket[kClient$1] = null; + socket[kError] = null; + socket.removeListener("error", onSocketError).removeListener("readable", onSocketReadable).removeListener("end", onSocketEnd).removeListener("close", onSocketClose); + client2[kSocket] = null; + client2[kQueue$1][client2[kRunningIdx]++] = null; + client2.emit("disconnect", client2[kUrl$3], [client2], new InformationalError2("upgrade")); + try { + request2.onUpgrade(statusCode, headers2, socket); + } catch (err) { + util$g.destroy(socket, err); + } + resume(client2); + } + onHeadersComplete(statusCode, upgrade2, shouldKeepAlive) { + const { client: client2, socket, headers: headers2, statusText } = this; + if (socket.destroyed) { + return -1; + } + const request2 = client2[kQueue$1][client2[kRunningIdx]]; + if (!request2) { + return -1; + } + assert$6(!this.upgrade); + assert$6(this.statusCode < 200); + if (statusCode === 100) { + util$g.destroy(socket, new SocketError$2("bad response", util$g.getSocketInfo(socket))); + return -1; + } + if (upgrade2 && !request2.upgrade) { + util$g.destroy(socket, new SocketError$2("bad upgrade", util$g.getSocketInfo(socket))); + return -1; + } + assert$6.strictEqual(this.timeoutType, TIMEOUT_HEADERS); + this.statusCode = statusCode; + this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. + request2.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; + if (this.statusCode >= 200) { + const bodyTimeout = request2.bodyTimeout != null ? request2.bodyTimeout : client2[kBodyTimeout]; + this.setTimeout(bodyTimeout, TIMEOUT_BODY); + } else if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + if (request2.method === "CONNECT") { + assert$6(client2[kRunning$3] === 1); + this.upgrade = true; + return 2; + } + if (upgrade2) { + assert$6(client2[kRunning$3] === 1); + this.upgrade = true; + return 2; + } + assert$6(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + if (this.shouldKeepAlive && client2[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util$g.parseKeepAliveTimeout(this.keepAlive) : null; + if (keepAliveTimeout != null) { + const timeout = Math.min( + keepAliveTimeout - client2[kKeepAliveTimeoutThreshold], + client2[kKeepAliveMaxTimeout] + ); + if (timeout <= 0) { + socket[kReset] = true; + } else { + client2[kKeepAliveTimeoutValue] = timeout; + } + } else { + client2[kKeepAliveTimeoutValue] = client2[kKeepAliveDefaultTimeout]; + } + } else { + socket[kReset] = true; + } + const pause = request2.onHeaders(statusCode, headers2, this.resume, statusText) === false; + if (request2.aborted) { + return -1; + } + if (request2.method === "HEAD") { + return 1; + } + if (statusCode < 200) { + return 1; + } + if (socket[kBlocking]) { + socket[kBlocking] = false; + resume(client2); + } + return pause ? constants$a.ERROR.PAUSED : 0; + } + onBody(buf) { + const { client: client2, socket, statusCode, maxResponseSize } = this; + if (socket.destroyed) { + return -1; + } + const request2 = client2[kQueue$1][client2[kRunningIdx]]; + assert$6(request2); + assert$6.strictEqual(this.timeoutType, TIMEOUT_BODY); + if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + assert$6(statusCode >= 200); + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { + util$g.destroy(socket, new ResponseExceededMaxSizeError2()); + return -1; + } + this.bytesRead += buf.length; + if (request2.onData(buf) === false) { + return constants$a.ERROR.PAUSED; + } + } + onMessageComplete() { + const { client: client2, socket, statusCode, upgrade: upgrade2, headers: headers2, contentLength, bytesRead, shouldKeepAlive } = this; + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { + return -1; + } + if (upgrade2) { + return; + } + const request2 = client2[kQueue$1][client2[kRunningIdx]]; + assert$6(request2); + assert$6(statusCode >= 100); + this.statusCode = null; + this.statusText = ""; + this.bytesRead = 0; + this.contentLength = ""; + this.keepAlive = ""; + this.connection = ""; + assert$6(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + if (statusCode < 200) { + return; + } + if (request2.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { + util$g.destroy(socket, new ResponseContentLengthMismatchError2()); + return -1; + } + request2.onComplete(headers2); + client2[kQueue$1][client2[kRunningIdx]++] = null; + if (socket[kWriting]) { + assert$6.strictEqual(client2[kRunning$3], 0); + util$g.destroy(socket, new InformationalError2("reset")); + return constants$a.ERROR.PAUSED; + } else if (!shouldKeepAlive) { + util$g.destroy(socket, new InformationalError2("reset")); + return constants$a.ERROR.PAUSED; + } else if (socket[kReset] && client2[kRunning$3] === 0) { + util$g.destroy(socket, new InformationalError2("reset")); + return constants$a.ERROR.PAUSED; + } else if (client2[kPipelining] === 1) { + setImmediate(resume, client2); + } else { + resume(client2); + } + } +}; +function onParserTimeout(parser) { + const { socket, timeoutType, client: client2 } = parser; + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client2[kRunning$3] > 1) { + assert$6(!parser.paused, "cannot be paused while waiting for headers"); + util$g.destroy(socket, new HeadersTimeoutError2()); + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!parser.paused) { + util$g.destroy(socket, new BodyTimeoutError2()); + } + } else if (timeoutType === TIMEOUT_IDLE) { + assert$6(client2[kRunning$3] === 0 && client2[kKeepAliveTimeoutValue]); + util$g.destroy(socket, new InformationalError2("socket idle timeout")); + } +} +function onSocketReadable() { + const { [kParser]: parser } = this; + if (parser) { + parser.readMore(); + } +} +function onSocketError(err) { + const { [kClient$1]: client2, [kParser]: parser } = this; + assert$6(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + if (client2[kHTTPConnVersion] !== "h2") { + if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + return; + } + } + this[kError] = err; + onError(this[kClient$1], err); +} +function onError(client2, err) { + if (client2[kRunning$3] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { + assert$6(client2[kPendingIdx] === client2[kRunningIdx]); + const requests = client2[kQueue$1].splice(client2[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request2 = requests[i]; + errorRequest(client2, request2, err); + } + assert$6(client2[kSize$4] === 0); + } +} +function onSocketEnd() { + const { [kParser]: parser, [kClient$1]: client2 } = this; + if (client2[kHTTPConnVersion] !== "h2") { + if (parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + return; + } + } + util$g.destroy(this, new SocketError$2("other side closed", util$g.getSocketInfo(this))); +} +function onSocketClose() { + const { [kClient$1]: client2, [kParser]: parser } = this; + if (client2[kHTTPConnVersion] === "h1" && parser) { + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { + parser.onMessageComplete(); + } + this[kParser].destroy(); + this[kParser] = null; + } + const err = this[kError] || new SocketError$2("closed", util$g.getSocketInfo(this)); + client2[kSocket] = null; + if (client2.destroyed) { + assert$6(client2[kPending$2] === 0); + const requests = client2[kQueue$1].splice(client2[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request2 = requests[i]; + errorRequest(client2, request2, err); + } + } else if (client2[kRunning$3] > 0 && err.code !== "UND_ERR_INFO") { + const request2 = client2[kQueue$1][client2[kRunningIdx]]; + client2[kQueue$1][client2[kRunningIdx]++] = null; + errorRequest(client2, request2, err); + } + client2[kPendingIdx] = client2[kRunningIdx]; + assert$6(client2[kRunning$3] === 0); + client2.emit("disconnect", client2[kUrl$3], [client2], err); + resume(client2); +} +async function connect$1(client2) { + assert$6(!client2[kConnecting]); + assert$6(!client2[kSocket]); + let { host, hostname, protocol, port } = client2[kUrl$3]; + if (hostname[0] === "[") { + const idx = hostname.indexOf("]"); + assert$6(idx !== -1); + const ip = hostname.substring(1, idx); + assert$6(net.isIP(ip)); + hostname = ip; + } + client2[kConnecting] = true; + if (channels.beforeConnect.hasSubscribers) { + channels.beforeConnect.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client2[kServerName], + localAddress: client2[kLocalAddress] + }, + connector: client2[kConnector] + }); + } + try { + const socket = await new Promise((resolve, reject) => { + client2[kConnector]({ + host, + hostname, + protocol, + port, + servername: client2[kServerName], + localAddress: client2[kLocalAddress] + }, (err, socket2) => { + if (err) { + reject(err); + } else { + resolve(socket2); + } + }); + }); + if (client2.destroyed) { + util$g.destroy(socket.on("error", () => { + }), new ClientDestroyedError2()); + return; + } + client2[kConnecting] = false; + assert$6(socket); + const isH2 = socket.alpnProtocol === "h2"; + if (isH2) { + if (!h2ExperimentalWarned) { + h2ExperimentalWarned = true; + process.emitWarning("H2 support is experimental, expect them to change at any time.", { + code: "UNDICI-H2" + }); + } + const session = http2.connect(client2[kUrl$3], { + createConnection: () => socket, + peerMaxConcurrentStreams: client2[kHTTP2SessionState].maxConcurrentStreams + }); + client2[kHTTPConnVersion] = "h2"; + session[kClient$1] = client2; + session[kSocket] = socket; + session.on("error", onHttp2SessionError); + session.on("frameError", onHttp2FrameError); + session.on("end", onHttp2SessionEnd); + session.on("goaway", onHTTP2GoAway); + session.on("close", onSocketClose); + session.unref(); + client2[kHTTP2Session] = session; + socket[kHTTP2Session] = session; + } else { + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise; + llhttpPromise = null; + } + socket[kNoRef] = false; + socket[kWriting] = false; + socket[kReset] = false; + socket[kBlocking] = false; + socket[kParser] = new Parser$1(client2, socket, llhttpInstance); + } + socket[kCounter] = 0; + socket[kMaxRequests] = client2[kMaxRequests]; + socket[kClient$1] = client2; + socket[kError] = null; + socket.on("error", onSocketError).on("readable", onSocketReadable).on("end", onSocketEnd).on("close", onSocketClose); + client2[kSocket] = socket; + if (channels.connected.hasSubscribers) { + channels.connected.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client2[kServerName], + localAddress: client2[kLocalAddress] + }, + connector: client2[kConnector], + socket + }); + } + client2.emit("connect", client2[kUrl$3], [client2]); + } catch (err) { + if (client2.destroyed) { + return; + } + client2[kConnecting] = false; + if (channels.connectError.hasSubscribers) { + channels.connectError.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client2[kServerName], + localAddress: client2[kLocalAddress] + }, + connector: client2[kConnector], + error: err + }); + } + if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + assert$6(client2[kRunning$3] === 0); + while (client2[kPending$2] > 0 && client2[kQueue$1][client2[kPendingIdx]].servername === client2[kServerName]) { + const request2 = client2[kQueue$1][client2[kPendingIdx]++]; + errorRequest(client2, request2, err); + } + } else { + onError(client2, err); + } + client2.emit("connectionError", client2[kUrl$3], [client2], err); + } + resume(client2); +} +function emitDrain(client2) { + client2[kNeedDrain$3] = 0; + client2.emit("drain", client2[kUrl$3], [client2]); +} +function resume(client2, sync2) { + if (client2[kResuming] === 2) { + return; + } + client2[kResuming] = 2; + _resume(client2, sync2); + client2[kResuming] = 0; + if (client2[kRunningIdx] > 256) { + client2[kQueue$1].splice(0, client2[kRunningIdx]); + client2[kPendingIdx] -= client2[kRunningIdx]; + client2[kRunningIdx] = 0; + } +} +function _resume(client2, sync2) { + while (true) { + if (client2.destroyed) { + assert$6(client2[kPending$2] === 0); + return; + } + if (client2[kClosedResolve$1] && !client2[kSize$4]) { + client2[kClosedResolve$1](); + client2[kClosedResolve$1] = null; + return; + } + const socket = client2[kSocket]; + if (socket && !socket.destroyed && socket.alpnProtocol !== "h2") { + if (client2[kSize$4] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref(); + socket[kNoRef] = true; + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref(); + socket[kNoRef] = false; + } + if (client2[kSize$4] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { + socket[kParser].setTimeout(client2[kKeepAliveTimeoutValue], TIMEOUT_IDLE); + } + } else if (client2[kRunning$3] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request3 = client2[kQueue$1][client2[kRunningIdx]]; + const headersTimeout = request3.headersTimeout != null ? request3.headersTimeout : client2[kHeadersTimeout]; + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); + } + } + } + if (client2[kBusy$1]) { + client2[kNeedDrain$3] = 2; + } else if (client2[kNeedDrain$3] === 2) { + if (sync2) { + client2[kNeedDrain$3] = 1; + process.nextTick(emitDrain, client2); + } else { + emitDrain(client2); + } + continue; + } + if (client2[kPending$2] === 0) { + return; + } + if (client2[kRunning$3] >= (client2[kPipelining] || 1)) { + return; + } + const request2 = client2[kQueue$1][client2[kPendingIdx]]; + if (client2[kUrl$3].protocol === "https:" && client2[kServerName] !== request2.servername) { + if (client2[kRunning$3] > 0) { + return; + } + client2[kServerName] = request2.servername; + if (socket && socket.servername !== request2.servername) { + util$g.destroy(socket, new InformationalError2("servername changed")); + return; + } + } + if (client2[kConnecting]) { + return; + } + if (!socket && !client2[kHTTP2Session]) { + connect$1(client2); + return; + } + if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { + return; + } + if (client2[kRunning$3] > 0 && !request2.idempotent) { + return; + } + if (client2[kRunning$3] > 0 && (request2.upgrade || request2.method === "CONNECT")) { + return; + } + if (client2[kRunning$3] > 0 && util$g.bodyLength(request2.body) !== 0 && (util$g.isStream(request2.body) || util$g.isAsyncIterable(request2.body))) { + return; + } + if (!request2.aborted && write(client2, request2)) { + client2[kPendingIdx]++; + } else { + client2[kQueue$1].splice(client2[kPendingIdx], 1); + } + } +} +function shouldSendContentLength(method) { + return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; +} +function write(client2, request2) { + if (client2[kHTTPConnVersion] === "h2") { + writeH2(client2, client2[kHTTP2Session], request2); + return; + } + const { body: body2, method, path: path2, host, upgrade: upgrade2, headers: headers2, blocking, reset } = request2; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; + if (body2 && typeof body2.read === "function") { + body2.read(0); + } + const bodyLength2 = util$g.bodyLength(body2); + let contentLength = bodyLength2; + if (contentLength === null) { + contentLength = request2.contentLength; + } + if (contentLength === 0 && !expectsPayload) { + contentLength = null; + } + if (shouldSendContentLength(method) && contentLength > 0 && request2.contentLength !== null && request2.contentLength !== contentLength) { + if (client2[kStrictContentLength]) { + errorRequest(client2, request2, new RequestContentLengthMismatchError2()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError2()); + } + const socket = client2[kSocket]; + try { + request2.onConnect((err) => { + if (request2.aborted || request2.completed) { + return; + } + errorRequest(client2, request2, err || new RequestAbortedError$8()); + util$g.destroy(socket, new InformationalError2("aborted")); + }); + } catch (err) { + errorRequest(client2, request2, err); + } + if (request2.aborted) { + return false; + } + if (method === "HEAD") { + socket[kReset] = true; + } + if (upgrade2 || method === "CONNECT") { + socket[kReset] = true; + } + if (reset != null) { + socket[kReset] = reset; + } + if (client2[kMaxRequests] && socket[kCounter]++ >= client2[kMaxRequests]) { + socket[kReset] = true; + } + if (blocking) { + socket[kBlocking] = true; + } + let header2 = `${method} ${path2} HTTP/1.1\r +`; + if (typeof host === "string") { + header2 += `host: ${host}\r +`; + } else { + header2 += client2[kHostHeader]; + } + if (upgrade2) { + header2 += `connection: upgrade\r +upgrade: ${upgrade2}\r +`; + } else if (client2[kPipelining] && !socket[kReset]) { + header2 += "connection: keep-alive\r\n"; + } else { + header2 += "connection: close\r\n"; + } + if (headers2) { + header2 += headers2; + } + if (channels.sendHeaders.hasSubscribers) { + channels.sendHeaders.publish({ request: request2, headers: header2, socket }); + } + if (!body2 || bodyLength2 === 0) { + if (contentLength === 0) { + socket.write(`${header2}content-length: 0\r +\r +`, "latin1"); + } else { + assert$6(contentLength === null, "no body must not have content length"); + socket.write(`${header2}\r +`, "latin1"); + } + request2.onRequestSent(); + } else if (util$g.isBuffer(body2)) { + assert$6(contentLength === body2.byteLength, "buffer body must have content length"); + socket.cork(); + socket.write(`${header2}content-length: ${contentLength}\r +\r +`, "latin1"); + socket.write(body2); + socket.uncork(); + request2.onBodySent(body2); + request2.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + } else if (util$g.isBlobLike(body2)) { + if (typeof body2.stream === "function") { + writeIterable({ body: body2.stream(), client: client2, request: request2, socket, contentLength, header: header2, expectsPayload }); + } else { + writeBlob({ body: body2, client: client2, request: request2, socket, contentLength, header: header2, expectsPayload }); + } + } else if (util$g.isStream(body2)) { + writeStream({ body: body2, client: client2, request: request2, socket, contentLength, header: header2, expectsPayload }); + } else if (util$g.isIterable(body2)) { + writeIterable({ body: body2, client: client2, request: request2, socket, contentLength, header: header2, expectsPayload }); + } else { + assert$6(false); + } + return true; +} +function writeH2(client2, session, request2) { + const { body: body2, method, path: path2, host, upgrade: upgrade2, expectContinue, signal, headers: reqHeaders } = request2; + let headers2; + if (typeof reqHeaders === "string") headers2 = Request2[kHTTP2CopyHeaders](reqHeaders.trim()); + else headers2 = reqHeaders; + if (upgrade2) { + errorRequest(client2, request2, new Error("Upgrade not supported for H2")); + return false; + } + try { + request2.onConnect((err) => { + if (request2.aborted || request2.completed) { + return; + } + errorRequest(client2, request2, err || new RequestAbortedError$8()); + }); + } catch (err) { + errorRequest(client2, request2, err); + } + if (request2.aborted) { + return false; + } + let stream2; + const h2State = client2[kHTTP2SessionState]; + headers2[HTTP2_HEADER_AUTHORITY] = host || client2[kHost]; + headers2[HTTP2_HEADER_METHOD] = method; + if (method === "CONNECT") { + session.ref(); + stream2 = session.request(headers2, { endStream: false, signal }); + if (stream2.id && !stream2.pending) { + request2.onUpgrade(null, null, stream2); + ++h2State.openStreams; + } else { + stream2.once("ready", () => { + request2.onUpgrade(null, null, stream2); + ++h2State.openStreams; + }); + } + stream2.once("close", () => { + h2State.openStreams -= 1; + if (h2State.openStreams === 0) session.unref(); + }); + return true; + } + headers2[HTTP2_HEADER_PATH] = path2; + headers2[HTTP2_HEADER_SCHEME] = "https"; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; + if (body2 && typeof body2.read === "function") { + body2.read(0); + } + let contentLength = util$g.bodyLength(body2); + if (contentLength == null) { + contentLength = request2.contentLength; + } + if (contentLength === 0 || !expectsPayload) { + contentLength = null; + } + if (shouldSendContentLength(method) && contentLength > 0 && request2.contentLength != null && request2.contentLength !== contentLength) { + if (client2[kStrictContentLength]) { + errorRequest(client2, request2, new RequestContentLengthMismatchError2()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError2()); + } + if (contentLength != null) { + assert$6(body2, "no body must not have content length"); + headers2[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; + } + session.ref(); + const shouldEndStream = method === "GET" || method === "HEAD"; + if (expectContinue) { + headers2[HTTP2_HEADER_EXPECT] = "100-continue"; + stream2 = session.request(headers2, { endStream: shouldEndStream, signal }); + stream2.once("continue", writeBodyH2); + } else { + stream2 = session.request(headers2, { + endStream: shouldEndStream, + signal + }); + writeBodyH2(); + } + ++h2State.openStreams; + stream2.once("response", (headers3) => { + const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers3; + if (request2.onHeaders(Number(statusCode), realHeaders, stream2.resume.bind(stream2), "") === false) { + stream2.pause(); + } + }); + stream2.once("end", () => { + request2.onComplete([]); + }); + stream2.on("data", (chunk) => { + if (request2.onData(chunk) === false) { + stream2.pause(); + } + }); + stream2.once("close", () => { + h2State.openStreams -= 1; + if (h2State.openStreams === 0) { + session.unref(); + } + }); + stream2.once("error", function(err) { + if (client2[kHTTP2Session] && !client2[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1; + util$g.destroy(stream2, err); + } + }); + stream2.once("frameError", (type, code) => { + const err = new InformationalError2(`HTTP/2: "frameError" received - type ${type}, code ${code}`); + errorRequest(client2, request2, err); + if (client2[kHTTP2Session] && !client2[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1; + util$g.destroy(stream2, err); + } + }); + return true; + function writeBodyH2() { + if (!body2) { + request2.onRequestSent(); + } else if (util$g.isBuffer(body2)) { + assert$6(contentLength === body2.byteLength, "buffer body must have content length"); + stream2.cork(); + stream2.write(body2); + stream2.uncork(); + stream2.end(); + request2.onBodySent(body2); + request2.onRequestSent(); + } else if (util$g.isBlobLike(body2)) { + if (typeof body2.stream === "function") { + writeIterable({ + client: client2, + request: request2, + contentLength, + h2stream: stream2, + expectsPayload, + body: body2.stream(), + socket: client2[kSocket], + header: "" + }); + } else { + writeBlob({ + body: body2, + client: client2, + request: request2, + contentLength, + expectsPayload, + h2stream: stream2, + header: "", + socket: client2[kSocket] + }); + } + } else if (util$g.isStream(body2)) { + writeStream({ + body: body2, + client: client2, + request: request2, + contentLength, + expectsPayload, + socket: client2[kSocket], + h2stream: stream2, + header: "" + }); + } else if (util$g.isIterable(body2)) { + writeIterable({ + body: body2, + client: client2, + request: request2, + contentLength, + expectsPayload, + header: "", + h2stream: stream2, + socket: client2[kSocket] + }); + } else { + assert$6(false); + } + } +} +function writeStream({ h2stream, body: body2, client: client2, request: request2, socket, contentLength, header: header2, expectsPayload }) { + assert$6(contentLength !== 0 || client2[kRunning$3] === 0, "stream body cannot be pipelined"); + if (client2[kHTTPConnVersion] === "h2") { + let onPipeData = function(chunk) { + request2.onBodySent(chunk); + }; + const pipe = pipeline$1( + body2, + h2stream, + (err) => { + if (err) { + util$g.destroy(body2, err); + util$g.destroy(h2stream, err); + } else { + request2.onRequestSent(); + } + } + ); + pipe.on("data", onPipeData); + pipe.once("end", () => { + pipe.removeListener("data", onPipeData); + util$g.destroy(pipe); + }); + return; + } + let finished2 = false; + const writer = new AsyncWriter({ socket, request: request2, contentLength, client: client2, expectsPayload, header: header2 }); + const onData = function(chunk) { + if (finished2) { + return; + } + try { + if (!writer.write(chunk) && this.pause) { + this.pause(); + } + } catch (err) { + util$g.destroy(this, err); + } + }; + const onDrain = function() { + if (finished2) { + return; + } + if (body2.resume) { + body2.resume(); + } + }; + const onAbort = function() { + if (finished2) { + return; + } + const err = new RequestAbortedError$8(); + queueMicrotask(() => onFinished(err)); + }; + const onFinished = function(err) { + if (finished2) { + return; + } + finished2 = true; + assert$6(socket.destroyed || socket[kWriting] && client2[kRunning$3] <= 1); + socket.off("drain", onDrain).off("error", onFinished); + body2.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort); + if (!err) { + try { + writer.end(); + } catch (er) { + err = er; + } + } + writer.destroy(err); + if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { + util$g.destroy(body2, err); + } else { + util$g.destroy(body2); + } + }; + body2.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort); + if (body2.resume) { + body2.resume(); + } + socket.on("drain", onDrain).on("error", onFinished); +} +async function writeBlob({ h2stream, body: body2, client: client2, request: request2, socket, contentLength, header: header2, expectsPayload }) { + assert$6(contentLength === body2.size, "blob body must have content length"); + const isH2 = client2[kHTTPConnVersion] === "h2"; + try { + if (contentLength != null && contentLength !== body2.size) { + throw new RequestContentLengthMismatchError2(); + } + const buffer = Buffer.from(await body2.arrayBuffer()); + if (isH2) { + h2stream.cork(); + h2stream.write(buffer); + h2stream.uncork(); + } else { + socket.cork(); + socket.write(`${header2}content-length: ${contentLength}\r +\r +`, "latin1"); + socket.write(buffer); + socket.uncork(); + } + request2.onBodySent(buffer); + request2.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + resume(client2); + } catch (err) { + util$g.destroy(isH2 ? h2stream : socket, err); + } +} +async function writeIterable({ h2stream, body: body2, client: client2, request: request2, socket, contentLength, header: header2, expectsPayload }) { + assert$6(contentLength !== 0 || client2[kRunning$3] === 0, "iterator body cannot be pipelined"); + let callback = null; + function onDrain() { + if (callback) { + const cb = callback; + callback = null; + cb(); + } + } + const waitForDrain = () => new Promise((resolve, reject) => { + assert$6(callback === null); + if (socket[kError]) { + reject(socket[kError]); + } else { + callback = resolve; + } + }); + if (client2[kHTTPConnVersion] === "h2") { + h2stream.on("close", onDrain).on("drain", onDrain); + try { + for await (const chunk of body2) { + if (socket[kError]) { + throw socket[kError]; + } + const res = h2stream.write(chunk); + request2.onBodySent(chunk); + if (!res) { + await waitForDrain(); + } + } + } catch (err) { + h2stream.destroy(err); + } finally { + request2.onRequestSent(); + h2stream.end(); + h2stream.off("close", onDrain).off("drain", onDrain); + } + return; + } + socket.on("close", onDrain).on("drain", onDrain); + const writer = new AsyncWriter({ socket, request: request2, contentLength, client: client2, expectsPayload, header: header2 }); + try { + for await (const chunk of body2) { + if (socket[kError]) { + throw socket[kError]; + } + if (!writer.write(chunk)) { + await waitForDrain(); + } + } + writer.end(); + } catch (err) { + writer.destroy(err); + } finally { + socket.off("close", onDrain).off("drain", onDrain); + } +} +class AsyncWriter { + constructor({ socket, request: request2, contentLength, client: client2, expectsPayload, header: header2 }) { + this.socket = socket; + this.request = request2; + this.contentLength = contentLength; + this.client = client2; + this.bytesWritten = 0; + this.expectsPayload = expectsPayload; + this.header = header2; + socket[kWriting] = true; + } + write(chunk) { + const { socket, request: request2, contentLength, client: client2, bytesWritten, expectsPayload, header: header2 } = this; + if (socket[kError]) { + throw socket[kError]; + } + if (socket.destroyed) { + return false; + } + const len = Buffer.byteLength(chunk); + if (!len) { + return true; + } + if (contentLength !== null && bytesWritten + len > contentLength) { + if (client2[kStrictContentLength]) { + throw new RequestContentLengthMismatchError2(); + } + process.emitWarning(new RequestContentLengthMismatchError2()); + } + socket.cork(); + if (bytesWritten === 0) { + if (!expectsPayload) { + socket[kReset] = true; + } + if (contentLength === null) { + socket.write(`${header2}transfer-encoding: chunked\r +`, "latin1"); + } else { + socket.write(`${header2}content-length: ${contentLength}\r +\r +`, "latin1"); + } + } + if (contentLength === null) { + socket.write(`\r +${len.toString(16)}\r +`, "latin1"); + } + this.bytesWritten += len; + const ret = socket.write(chunk); + socket.uncork(); + request2.onBodySent(chunk); + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh(); + } + } + } + return ret; + } + end() { + const { socket, contentLength, client: client2, bytesWritten, expectsPayload, header: header2, request: request2 } = this; + request2.onRequestSent(); + socket[kWriting] = false; + if (socket[kError]) { + throw socket[kError]; + } + if (socket.destroyed) { + return; + } + if (bytesWritten === 0) { + if (expectsPayload) { + socket.write(`${header2}content-length: 0\r +\r +`, "latin1"); + } else { + socket.write(`${header2}\r +`, "latin1"); + } + } else if (contentLength === null) { + socket.write("\r\n0\r\n\r\n", "latin1"); + } + if (contentLength !== null && bytesWritten !== contentLength) { + if (client2[kStrictContentLength]) { + throw new RequestContentLengthMismatchError2(); + } else { + process.emitWarning(new RequestContentLengthMismatchError2()); + } + } + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh(); + } + } + resume(client2); + } + destroy(err) { + const { socket, client: client2 } = this; + socket[kWriting] = false; + if (err) { + assert$6(client2[kRunning$3] <= 1, "pipeline should only contain this request"); + util$g.destroy(socket, err); + } + } +} +function errorRequest(client2, request2, err) { + try { + request2.onError(err); + assert$6(request2.aborted); + } catch (err2) { + client2.emit("error", err2); + } +} +var client = Client$4; +const kSize$3 = 2048; +const kMask = kSize$3 - 1; +class FixedCircularBuffer { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize$3); + this.next = null; + } + isEmpty() { + return this.top === this.bottom; + } + isFull() { + return (this.top + 1 & kMask) === this.bottom; + } + push(data) { + this.list[this.top] = data; + this.top = this.top + 1 & kMask; + } + shift() { + const nextItem = this.list[this.bottom]; + if (nextItem === void 0) + return null; + this.list[this.bottom] = void 0; + this.bottom = this.bottom + 1 & kMask; + return nextItem; + } +} +var fixedQueue = class FixedQueue { + constructor() { + this.head = this.tail = new FixedCircularBuffer(); + } + isEmpty() { + return this.head.isEmpty(); + } + push(data) { + if (this.head.isFull()) { + this.head = this.head.next = new FixedCircularBuffer(); + } + this.head.push(data); + } + shift() { + const tail = this.tail; + const next = tail.shift(); + if (tail.isEmpty() && tail.next !== null) { + this.tail = tail.next; + } + return next; + } +}; +const { kFree: kFree$1, kConnected: kConnected$4, kPending: kPending$1, kQueued: kQueued$1, kRunning: kRunning$2, kSize: kSize$2 } = symbols$4; +const kPool = Symbol("pool"); +let PoolStats$1 = class PoolStats { + constructor(pool2) { + this[kPool] = pool2; + } + get connected() { + return this[kPool][kConnected$4]; + } + get free() { + return this[kPool][kFree$1]; + } + get pending() { + return this[kPool][kPending$1]; + } + get queued() { + return this[kPool][kQueued$1]; + } + get running() { + return this[kPool][kRunning$2]; + } + get size() { + return this[kPool][kSize$2]; + } +}; +var poolStats = PoolStats$1; +const DispatcherBase$2 = dispatcherBase; +const FixedQueue2 = fixedQueue; +const { kConnected: kConnected$3, kSize: kSize$1, kRunning: kRunning$1, kPending, kQueued, kBusy, kFree, kUrl: kUrl$2, kClose: kClose$4, kDestroy: kDestroy$2, kDispatch: kDispatch$1 } = symbols$4; +const PoolStats2 = poolStats; +const kClients$4 = Symbol("clients"); +const kNeedDrain$2 = Symbol("needDrain"); +const kQueue = Symbol("queue"); +const kClosedResolve = Symbol("closed resolve"); +const kOnDrain$1 = Symbol("onDrain"); +const kOnConnect$1 = Symbol("onConnect"); +const kOnDisconnect$1 = Symbol("onDisconnect"); +const kOnConnectionError$1 = Symbol("onConnectionError"); +const kGetDispatcher$2 = Symbol("get dispatcher"); +const kAddClient$2 = Symbol("add client"); +const kRemoveClient$1 = Symbol("remove client"); +const kStats = Symbol("stats"); +let PoolBase$2 = class PoolBase extends DispatcherBase$2 { + constructor() { + super(); + this[kQueue] = new FixedQueue2(); + this[kClients$4] = []; + this[kQueued] = 0; + const pool2 = this; + this[kOnDrain$1] = function onDrain(origin, targets) { + const queue2 = pool2[kQueue]; + let needDrain = false; + while (!needDrain) { + const item = queue2.shift(); + if (!item) { + break; + } + pool2[kQueued]--; + needDrain = !this.dispatch(item.opts, item.handler); + } + this[kNeedDrain$2] = needDrain; + if (!this[kNeedDrain$2] && pool2[kNeedDrain$2]) { + pool2[kNeedDrain$2] = false; + pool2.emit("drain", origin, [pool2, ...targets]); + } + if (pool2[kClosedResolve] && queue2.isEmpty()) { + Promise.all(pool2[kClients$4].map((c) => c.close())).then(pool2[kClosedResolve]); + } + }; + this[kOnConnect$1] = (origin, targets) => { + pool2.emit("connect", origin, [pool2, ...targets]); + }; + this[kOnDisconnect$1] = (origin, targets, err) => { + pool2.emit("disconnect", origin, [pool2, ...targets], err); + }; + this[kOnConnectionError$1] = (origin, targets, err) => { + pool2.emit("connectionError", origin, [pool2, ...targets], err); + }; + this[kStats] = new PoolStats2(this); + } + get [kBusy]() { + return this[kNeedDrain$2]; + } + get [kConnected$3]() { + return this[kClients$4].filter((client2) => client2[kConnected$3]).length; + } + get [kFree]() { + return this[kClients$4].filter((client2) => client2[kConnected$3] && !client2[kNeedDrain$2]).length; + } + get [kPending]() { + let ret = this[kQueued]; + for (const { [kPending]: pending } of this[kClients$4]) { + ret += pending; + } + return ret; + } + get [kRunning$1]() { + let ret = 0; + for (const { [kRunning$1]: running } of this[kClients$4]) { + ret += running; + } + return ret; + } + get [kSize$1]() { + let ret = this[kQueued]; + for (const { [kSize$1]: size } of this[kClients$4]) { + ret += size; + } + return ret; + } + get stats() { + return this[kStats]; + } + async [kClose$4]() { + if (this[kQueue].isEmpty()) { + return Promise.all(this[kClients$4].map((c) => c.close())); + } else { + return new Promise((resolve) => { + this[kClosedResolve] = resolve; + }); + } + } + async [kDestroy$2](err) { + while (true) { + const item = this[kQueue].shift(); + if (!item) { + break; + } + item.handler.onError(err); + } + return Promise.all(this[kClients$4].map((c) => c.destroy(err))); + } + [kDispatch$1](opts, handler2) { + const dispatcher2 = this[kGetDispatcher$2](); + if (!dispatcher2) { + this[kNeedDrain$2] = true; + this[kQueue].push({ opts, handler: handler2 }); + this[kQueued]++; + } else if (!dispatcher2.dispatch(opts, handler2)) { + dispatcher2[kNeedDrain$2] = true; + this[kNeedDrain$2] = !this[kGetDispatcher$2](); + } + return !this[kNeedDrain$2]; + } + [kAddClient$2](client2) { + client2.on("drain", this[kOnDrain$1]).on("connect", this[kOnConnect$1]).on("disconnect", this[kOnDisconnect$1]).on("connectionError", this[kOnConnectionError$1]); + this[kClients$4].push(client2); + if (this[kNeedDrain$2]) { + process.nextTick(() => { + if (this[kNeedDrain$2]) { + this[kOnDrain$1](client2[kUrl$2], [this, client2]); + } + }); + } + return this; + } + [kRemoveClient$1](client2) { + client2.close(() => { + const idx = this[kClients$4].indexOf(client2); + if (idx !== -1) { + this[kClients$4].splice(idx, 1); + } + }); + this[kNeedDrain$2] = this[kClients$4].some((dispatcher2) => !dispatcher2[kNeedDrain$2] && dispatcher2.closed !== true && dispatcher2.destroyed !== true); + } +}; +var poolBase = { + PoolBase: PoolBase$2, + kClients: kClients$4, + kNeedDrain: kNeedDrain$2, + kAddClient: kAddClient$2, + kRemoveClient: kRemoveClient$1, + kGetDispatcher: kGetDispatcher$2 +}; +const { + PoolBase: PoolBase$1, + kClients: kClients$3, + kNeedDrain: kNeedDrain$1, + kAddClient: kAddClient$1, + kGetDispatcher: kGetDispatcher$1 +} = poolBase; +const Client$3 = client; +const { + InvalidArgumentError: InvalidArgumentError$f +} = errors$4; +const util$f = util$l; +const { kUrl: kUrl$1, kInterceptors: kInterceptors$3 } = symbols$4; +const buildConnector$2 = connect$2; +const kOptions$3 = Symbol("options"); +const kConnections = Symbol("connections"); +const kFactory$3 = Symbol("factory"); +function defaultFactory$3(origin, opts) { + return new Client$3(origin, opts); +} +let Pool$5 = class Pool extends PoolBase$1 { + constructor(origin, { + connections, + factory = defaultFactory$3, + connect: connect2, + connectTimeout, + tls: tls2, + maxCachedSessions, + socketPath, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + allowH2, + ...options2 + } = {}) { + super(); + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError$f("invalid connections"); + } + if (typeof factory !== "function") { + throw new InvalidArgumentError$f("factory must be a function."); + } + if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { + throw new InvalidArgumentError$f("connect must be a function or an object"); + } + if (typeof connect2 !== "function") { + connect2 = buildConnector$2({ + ...tls2, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...util$f.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...connect2 + }); + } + this[kInterceptors$3] = options2.interceptors && options2.interceptors.Pool && Array.isArray(options2.interceptors.Pool) ? options2.interceptors.Pool : []; + this[kConnections] = connections || null; + this[kUrl$1] = util$f.parseOrigin(origin); + this[kOptions$3] = { ...util$f.deepClone(options2), connect: connect2, allowH2 }; + this[kOptions$3].interceptors = options2.interceptors ? { ...options2.interceptors } : void 0; + this[kFactory$3] = factory; + } + [kGetDispatcher$1]() { + let dispatcher2 = this[kClients$3].find((dispatcher3) => !dispatcher3[kNeedDrain$1]); + if (dispatcher2) { + return dispatcher2; + } + if (!this[kConnections] || this[kClients$3].length < this[kConnections]) { + dispatcher2 = this[kFactory$3](this[kUrl$1], this[kOptions$3]); + this[kAddClient$1](dispatcher2); + } + return dispatcher2; + } +}; +var pool = Pool$5; +const { + BalancedPoolMissingUpstreamError: BalancedPoolMissingUpstreamError2, + InvalidArgumentError: InvalidArgumentError$e +} = errors$4; +const { + PoolBase: PoolBase2, + kClients: kClients$2, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} = poolBase; +const Pool$4 = pool; +const { kUrl, kInterceptors: kInterceptors$2 } = symbols$4; +const { parseOrigin } = util$l; +const kFactory$2 = Symbol("factory"); +const kOptions$2 = Symbol("options"); +const kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); +const kCurrentWeight = Symbol("kCurrentWeight"); +const kIndex = Symbol("kIndex"); +const kWeight = Symbol("kWeight"); +const kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); +const kErrorPenalty = Symbol("kErrorPenalty"); +function getGreatestCommonDivisor(a, b) { + if (b === 0) return a; + return getGreatestCommonDivisor(b, a % b); +} +function defaultFactory$2(origin, opts) { + return new Pool$4(origin, opts); +} +let BalancedPool$1 = class BalancedPool extends PoolBase2 { + constructor(upstreams = [], { factory = defaultFactory$2, ...opts } = {}) { + super(); + this[kOptions$2] = opts; + this[kIndex] = -1; + this[kCurrentWeight] = 0; + this[kMaxWeightPerServer] = this[kOptions$2].maxWeightPerServer || 100; + this[kErrorPenalty] = this[kOptions$2].errorPenalty || 15; + if (!Array.isArray(upstreams)) { + upstreams = [upstreams]; + } + if (typeof factory !== "function") { + throw new InvalidArgumentError$e("factory must be a function."); + } + this[kInterceptors$2] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) ? opts.interceptors.BalancedPool : []; + this[kFactory$2] = factory; + for (const upstream of upstreams) { + this.addUpstream(upstream); + } + this._updateBalancedPoolStats(); + } + addUpstream(upstream) { + const upstreamOrigin = parseOrigin(upstream).origin; + if (this[kClients$2].find((pool3) => pool3[kUrl].origin === upstreamOrigin && pool3.closed !== true && pool3.destroyed !== true)) { + return this; + } + const pool2 = this[kFactory$2](upstreamOrigin, Object.assign({}, this[kOptions$2])); + this[kAddClient](pool2); + pool2.on("connect", () => { + pool2[kWeight] = Math.min(this[kMaxWeightPerServer], pool2[kWeight] + this[kErrorPenalty]); + }); + pool2.on("connectionError", () => { + pool2[kWeight] = Math.max(1, pool2[kWeight] - this[kErrorPenalty]); + this._updateBalancedPoolStats(); + }); + pool2.on("disconnect", (...args) => { + const err = args[2]; + if (err && err.code === "UND_ERR_SOCKET") { + pool2[kWeight] = Math.max(1, pool2[kWeight] - this[kErrorPenalty]); + this._updateBalancedPoolStats(); + } + }); + for (const client2 of this[kClients$2]) { + client2[kWeight] = this[kMaxWeightPerServer]; + } + this._updateBalancedPoolStats(); + return this; + } + _updateBalancedPoolStats() { + this[kGreatestCommonDivisor] = this[kClients$2].map((p) => p[kWeight]).reduce(getGreatestCommonDivisor, 0); + } + removeUpstream(upstream) { + const upstreamOrigin = parseOrigin(upstream).origin; + const pool2 = this[kClients$2].find((pool3) => pool3[kUrl].origin === upstreamOrigin && pool3.closed !== true && pool3.destroyed !== true); + if (pool2) { + this[kRemoveClient](pool2); + } + return this; + } + get upstreams() { + return this[kClients$2].filter((dispatcher2) => dispatcher2.closed !== true && dispatcher2.destroyed !== true).map((p) => p[kUrl].origin); + } + [kGetDispatcher]() { + if (this[kClients$2].length === 0) { + throw new BalancedPoolMissingUpstreamError2(); + } + const dispatcher2 = this[kClients$2].find((dispatcher3) => !dispatcher3[kNeedDrain] && dispatcher3.closed !== true && dispatcher3.destroyed !== true); + if (!dispatcher2) { + return; + } + const allClientsBusy = this[kClients$2].map((pool2) => pool2[kNeedDrain]).reduce((a, b) => a && b, true); + if (allClientsBusy) { + return; + } + let counter = 0; + let maxWeightIndex = this[kClients$2].findIndex((pool2) => !pool2[kNeedDrain]); + while (counter++ < this[kClients$2].length) { + this[kIndex] = (this[kIndex] + 1) % this[kClients$2].length; + const pool2 = this[kClients$2][this[kIndex]]; + if (pool2[kWeight] > this[kClients$2][maxWeightIndex][kWeight] && !pool2[kNeedDrain]) { + maxWeightIndex = this[kIndex]; + } + if (this[kIndex] === 0) { + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]; + if (this[kCurrentWeight] <= 0) { + this[kCurrentWeight] = this[kMaxWeightPerServer]; + } + } + if (pool2[kWeight] >= this[kCurrentWeight] && !pool2[kNeedDrain]) { + return pool2; + } + } + this[kCurrentWeight] = this[kClients$2][maxWeightIndex][kWeight]; + this[kIndex] = maxWeightIndex; + return this[kClients$2][maxWeightIndex]; + } +}; +var balancedPool = BalancedPool$1; +const { kConnected: kConnected$2, kSize } = symbols$4; +class CompatWeakRef { + constructor(value) { + this.value = value; + } + deref() { + return this.value[kConnected$2] === 0 && this.value[kSize] === 0 ? void 0 : this.value; + } +} +class CompatFinalizer { + constructor(finalizer) { + this.finalizer = finalizer; + } + register(dispatcher2, key) { + if (dispatcher2.on) { + dispatcher2.on("disconnect", () => { + if (dispatcher2[kConnected$2] === 0 && dispatcher2[kSize] === 0) { + this.finalizer(key); + } + }); + } + } +} +var dispatcherWeakref = function() { + if (process.env.NODE_V8_COVERAGE) { + return { + WeakRef: CompatWeakRef, + FinalizationRegistry: CompatFinalizer + }; + } + return { + WeakRef: commonjsGlobal.WeakRef || CompatWeakRef, + FinalizationRegistry: commonjsGlobal.FinalizationRegistry || CompatFinalizer + }; +}; +const { InvalidArgumentError: InvalidArgumentError$d } = errors$4; +const { kClients: kClients$1, kRunning, kClose: kClose$3, kDestroy: kDestroy$1, kDispatch, kInterceptors: kInterceptors$1 } = symbols$4; +const DispatcherBase$1 = dispatcherBase; +const Pool$3 = pool; +const Client$2 = client; +const util$e = util$l; +const createRedirectInterceptor$1 = redirectInterceptor; +const { WeakRef: WeakRef$1, FinalizationRegistry } = dispatcherWeakref(); +const kOnConnect = Symbol("onConnect"); +const kOnDisconnect = Symbol("onDisconnect"); +const kOnConnectionError = Symbol("onConnectionError"); +const kMaxRedirections = Symbol("maxRedirections"); +const kOnDrain = Symbol("onDrain"); +const kFactory$1 = Symbol("factory"); +const kFinalizer = Symbol("finalizer"); +const kOptions$1 = Symbol("options"); +function defaultFactory$1(origin, opts) { + return opts && opts.connections === 1 ? new Client$2(origin, opts) : new Pool$3(origin, opts); +} +let Agent$4 = class Agent extends DispatcherBase$1 { + constructor({ factory = defaultFactory$1, maxRedirections = 0, connect: connect2, ...options2 } = {}) { + super(); + if (typeof factory !== "function") { + throw new InvalidArgumentError$d("factory must be a function."); + } + if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { + throw new InvalidArgumentError$d("connect must be a function or an object"); + } + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { + throw new InvalidArgumentError$d("maxRedirections must be a positive number"); + } + if (connect2 && typeof connect2 !== "function") { + connect2 = { ...connect2 }; + } + this[kInterceptors$1] = options2.interceptors && options2.interceptors.Agent && Array.isArray(options2.interceptors.Agent) ? options2.interceptors.Agent : [createRedirectInterceptor$1({ maxRedirections })]; + this[kOptions$1] = { ...util$e.deepClone(options2), connect: connect2 }; + this[kOptions$1].interceptors = options2.interceptors ? { ...options2.interceptors } : void 0; + this[kMaxRedirections] = maxRedirections; + this[kFactory$1] = factory; + this[kClients$1] = /* @__PURE__ */ new Map(); + this[kFinalizer] = new FinalizationRegistry( + /* istanbul ignore next: gc is undeterministic */ + (key) => { + const ref = this[kClients$1].get(key); + if (ref !== void 0 && ref.deref() === void 0) { + this[kClients$1].delete(key); + } + } + ); + const agent2 = this; + this[kOnDrain] = (origin, targets) => { + agent2.emit("drain", origin, [agent2, ...targets]); + }; + this[kOnConnect] = (origin, targets) => { + agent2.emit("connect", origin, [agent2, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + agent2.emit("disconnect", origin, [agent2, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + agent2.emit("connectionError", origin, [agent2, ...targets], err); + }; + } + get [kRunning]() { + let ret = 0; + for (const ref of this[kClients$1].values()) { + const client2 = ref.deref(); + if (client2) { + ret += client2[kRunning]; + } + } + return ret; + } + [kDispatch](opts, handler2) { + let key; + if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) { + key = String(opts.origin); + } else { + throw new InvalidArgumentError$d("opts.origin must be a non-empty string or URL."); + } + const ref = this[kClients$1].get(key); + let dispatcher2 = ref ? ref.deref() : null; + if (!dispatcher2) { + dispatcher2 = this[kFactory$1](opts.origin, this[kOptions$1]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients$1].set(key, new WeakRef$1(dispatcher2)); + this[kFinalizer].register(dispatcher2, key); + } + return dispatcher2.dispatch(opts, handler2); + } + async [kClose$3]() { + const closePromises = []; + for (const ref of this[kClients$1].values()) { + const client2 = ref.deref(); + if (client2) { + closePromises.push(client2.close()); + } + } + await Promise.all(closePromises); + } + async [kDestroy$1](err) { + const destroyPromises = []; + for (const ref of this[kClients$1].values()) { + const client2 = ref.deref(); + if (client2) { + destroyPromises.push(client2.destroy(err)); + } + } + await Promise.all(destroyPromises); + } +}; +var agent = Agent$4; +var api$1 = {}; +var apiRequest = { exports: {} }; +const assert$5 = require$$0$4; +const { Readable: Readable$2 } = require$$0$5; +const { RequestAbortedError: RequestAbortedError$7, NotSupportedError: NotSupportedError2, InvalidArgumentError: InvalidArgumentError$c } = errors$4; +const util$d = util$l; +const { ReadableStreamFrom, toUSVString: toUSVString$1 } = util$l; +let Blob$1; +const kConsume = Symbol("kConsume"); +const kReading = Symbol("kReading"); +const kBody = Symbol("kBody"); +const kAbort = Symbol("abort"); +const kContentType = Symbol("kContentType"); +const noop$3 = () => { +}; +var readable = class BodyReadable extends Readable$2 { + constructor({ + resume: resume2, + abort: abort2, + contentType = "", + highWaterMark = 64 * 1024 + // Same as nodejs fs streams. + }) { + super({ + autoDestroy: true, + read: resume2, + highWaterMark + }); + this._readableState.dataEmitted = false; + this[kAbort] = abort2; + this[kConsume] = null; + this[kBody] = null; + this[kContentType] = contentType; + this[kReading] = false; + } + destroy(err) { + if (this.destroyed) { + return this; + } + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError$7(); + } + if (err) { + this[kAbort](); + } + return super.destroy(err); + } + emit(ev, ...args) { + if (ev === "data") { + this._readableState.dataEmitted = true; + } else if (ev === "error") { + this._readableState.errorEmitted = true; + } + return super.emit(ev, ...args); + } + on(ev, ...args) { + if (ev === "data" || ev === "readable") { + this[kReading] = true; + } + return super.on(ev, ...args); + } + addListener(ev, ...args) { + return this.on(ev, ...args); + } + off(ev, ...args) { + const ret = super.off(ev, ...args); + if (ev === "data" || ev === "readable") { + this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0; + } + return ret; + } + removeListener(ev, ...args) { + return this.off(ev, ...args); + } + push(chunk) { + if (this[kConsume] && chunk !== null && this.readableLength === 0) { + consumePush(this[kConsume], chunk); + return this[kReading] ? super.push(chunk) : true; + } + return super.push(chunk); + } + // https://fetch.spec.whatwg.org/#dom-body-text + async text() { + return consume(this, "text"); + } + // https://fetch.spec.whatwg.org/#dom-body-json + async json() { + return consume(this, "json"); + } + // https://fetch.spec.whatwg.org/#dom-body-blob + async blob() { + return consume(this, "blob"); + } + // https://fetch.spec.whatwg.org/#dom-body-arraybuffer + async arrayBuffer() { + return consume(this, "arrayBuffer"); + } + // https://fetch.spec.whatwg.org/#dom-body-formdata + async formData() { + throw new NotSupportedError2(); + } + // https://fetch.spec.whatwg.org/#dom-body-bodyused + get bodyUsed() { + return util$d.isDisturbed(this); + } + // https://fetch.spec.whatwg.org/#dom-body-body + get body() { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this); + if (this[kConsume]) { + this[kBody].getReader(); + assert$5(this[kBody].locked); + } + } + return this[kBody]; + } + dump(opts) { + let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144; + const signal = opts && opts.signal; + if (signal) { + try { + if (typeof signal !== "object" || !("aborted" in signal)) { + throw new InvalidArgumentError$c("signal must be an AbortSignal"); + } + util$d.throwIfAborted(signal); + } catch (err) { + return Promise.reject(err); + } + } + if (this.closed) { + return Promise.resolve(null); + } + return new Promise((resolve, reject) => { + const signalListenerCleanup = signal ? util$d.addAbortListener(signal, () => { + this.destroy(); + }) : noop$3; + this.on("close", function() { + signalListenerCleanup(); + if (signal && signal.aborted) { + reject(signal.reason || Object.assign(new Error("The operation was aborted"), { name: "AbortError" })); + } else { + resolve(null); + } + }).on("error", noop$3).on("data", function(chunk) { + limit -= chunk.length; + if (limit <= 0) { + this.destroy(); + } + }).resume(); + }); + } +}; +function isLocked(self2) { + return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; +} +function isUnusable(self2) { + return util$d.isDisturbed(self2) || isLocked(self2); +} +async function consume(stream2, type) { + if (isUnusable(stream2)) { + throw new TypeError("unusable"); + } + assert$5(!stream2[kConsume]); + return new Promise((resolve, reject) => { + stream2[kConsume] = { + type, + stream: stream2, + resolve, + reject, + length: 0, + body: [] + }; + stream2.on("error", function(err) { + consumeFinish(this[kConsume], err); + }).on("close", function() { + if (this[kConsume].body !== null) { + consumeFinish(this[kConsume], new RequestAbortedError$7()); + } + }); + process.nextTick(consumeStart, stream2[kConsume]); + }); +} +function consumeStart(consume2) { + if (consume2.body === null) { + return; + } + const { _readableState: state } = consume2.stream; + for (const chunk of state.buffer) { + consumePush(consume2, chunk); + } + if (state.endEmitted) { + consumeEnd(this[kConsume]); + } else { + consume2.stream.on("end", function() { + consumeEnd(this[kConsume]); + }); + } + consume2.stream.resume(); + while (consume2.stream.read() != null) { + } +} +function consumeEnd(consume2) { + const { type, body: body2, resolve, stream: stream2, length } = consume2; + try { + if (type === "text") { + resolve(toUSVString$1(Buffer.concat(body2))); + } else if (type === "json") { + resolve(JSON.parse(Buffer.concat(body2))); + } else if (type === "arrayBuffer") { + const dst = new Uint8Array(length); + let pos2 = 0; + for (const buf of body2) { + dst.set(buf, pos2); + pos2 += buf.byteLength; + } + resolve(dst.buffer); + } else if (type === "blob") { + if (!Blob$1) { + Blob$1 = require("buffer").Blob; + } + resolve(new Blob$1(body2, { type: stream2[kContentType] })); + } + consumeFinish(consume2); + } catch (err) { + stream2.destroy(err); + } +} +function consumePush(consume2, chunk) { + consume2.length += chunk.length; + consume2.body.push(chunk); +} +function consumeFinish(consume2, err) { + if (consume2.body === null) { + return; + } + if (err) { + consume2.reject(err); + } else { + consume2.resolve(); + } + consume2.type = null; + consume2.stream = null; + consume2.resolve = null; + consume2.reject = null; + consume2.length = 0; + consume2.body = null; +} +const assert$4 = require$$0$4; +const { + ResponseStatusCodeError: ResponseStatusCodeError2 +} = errors$4; +const { toUSVString } = util$l; +async function getResolveErrorBodyCallback$2({ callback, body: body2, contentType, statusCode, statusMessage, headers: headers2 }) { + assert$4(body2); + let chunks = []; + let limit = 0; + for await (const chunk of body2) { + chunks.push(chunk); + limit += chunk.length; + if (limit > 128 * 1024) { + chunks = null; + break; + } + } + if (statusCode === 204 || !contentType || !chunks) { + process.nextTick(callback, new ResponseStatusCodeError2(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers2)); + return; + } + try { + if (contentType.startsWith("application/json")) { + const payload = JSON.parse(toUSVString(Buffer.concat(chunks))); + process.nextTick(callback, new ResponseStatusCodeError2(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers2, payload)); + return; + } + if (contentType.startsWith("text/")) { + const payload = toUSVString(Buffer.concat(chunks)); + process.nextTick(callback, new ResponseStatusCodeError2(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers2, payload)); + return; + } + } catch (err) { + } + process.nextTick(callback, new ResponseStatusCodeError2(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers2)); +} +var util$c = { getResolveErrorBodyCallback: getResolveErrorBodyCallback$2 }; +const { addAbortListener } = util$l; +const { RequestAbortedError: RequestAbortedError$6 } = errors$4; +const kListener = Symbol("kListener"); +const kSignal = Symbol("kSignal"); +function abort(self2) { + if (self2.abort) { + self2.abort(); + } else { + self2.onError(new RequestAbortedError$6()); + } +} +function addSignal$5(self2, signal) { + self2[kSignal] = null; + self2[kListener] = null; + if (!signal) { + return; + } + if (signal.aborted) { + abort(self2); + return; + } + self2[kSignal] = signal; + self2[kListener] = () => { + abort(self2); + }; + addAbortListener(self2[kSignal], self2[kListener]); +} +function removeSignal$5(self2) { + if (!self2[kSignal]) { + return; + } + if ("removeEventListener" in self2[kSignal]) { + self2[kSignal].removeEventListener("abort", self2[kListener]); + } else { + self2[kSignal].removeListener("abort", self2[kListener]); + } + self2[kSignal] = null; + self2[kListener] = null; +} +var abortSignal = { + addSignal: addSignal$5, + removeSignal: removeSignal$5 +}; +const Readable$1 = readable; +const { + InvalidArgumentError: InvalidArgumentError$b, + RequestAbortedError: RequestAbortedError$5 +} = errors$4; +const util$b = util$l; +const { getResolveErrorBodyCallback: getResolveErrorBodyCallback$1 } = util$c; +const { AsyncResource: AsyncResource$4 } = require$$4$1; +const { addSignal: addSignal$4, removeSignal: removeSignal$4 } = abortSignal; +class RequestHandler extends AsyncResource$4 { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError$b("invalid opts"); + } + const { signal, method, opaque, body: body2, onInfo, responseHeaders, throwOnError, highWaterMark } = opts; + try { + if (typeof callback !== "function") { + throw new InvalidArgumentError$b("invalid callback"); + } + if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) { + throw new InvalidArgumentError$b("invalid highWaterMark"); + } + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError$b("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError$b("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError$b("invalid onInfo callback"); + } + super("UNDICI_REQUEST"); + } catch (err) { + if (util$b.isStream(body2)) { + util$b.destroy(body2.on("error", util$b.nop), err); + } + throw err; + } + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.res = null; + this.abort = null; + this.body = body2; + this.trailers = {}; + this.context = null; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError; + this.highWaterMark = highWaterMark; + if (util$b.isStream(body2)) { + body2.on("error", (err) => { + this.onError(err); + }); + } + addSignal$4(this, signal); + } + onConnect(abort2, context2) { + if (!this.callback) { + throw new RequestAbortedError$5(); + } + this.abort = abort2; + this.context = context2; + } + onHeaders(statusCode, rawHeaders, resume2, statusMessage) { + const { callback, opaque, abort: abort2, context: context2, responseHeaders, highWaterMark } = this; + const headers2 = responseHeaders === "raw" ? util$b.parseRawHeaders(rawHeaders) : util$b.parseHeaders(rawHeaders); + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers: headers2 }); + } + return; + } + const parsedHeaders = responseHeaders === "raw" ? util$b.parseHeaders(rawHeaders) : headers2; + const contentType = parsedHeaders["content-type"]; + const body2 = new Readable$1({ resume: resume2, abort: abort2, contentType, highWaterMark }); + this.callback = null; + this.res = body2; + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope( + getResolveErrorBodyCallback$1, + null, + { callback, body: body2, contentType, statusCode, statusMessage, headers: headers2 } + ); + } else { + this.runInAsyncScope(callback, null, null, { + statusCode, + headers: headers2, + trailers: this.trailers, + opaque, + body: body2, + context: context2 + }); + } + } + } + onData(chunk) { + const { res } = this; + return res.push(chunk); + } + onComplete(trailers) { + const { res } = this; + removeSignal$4(this); + util$b.parseHeaders(trailers, this.trailers); + res.push(null); + } + onError(err) { + const { res, callback, body: body2, opaque } = this; + removeSignal$4(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (res) { + this.res = null; + queueMicrotask(() => { + util$b.destroy(res, err); + }); + } + if (body2) { + this.body = null; + util$b.destroy(body2, err); + } + } +} +function request$2(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + request$2.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + this.dispatch(opts, new RequestHandler(opts, callback)); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } +} +apiRequest.exports = request$2; +apiRequest.exports.RequestHandler = RequestHandler; +var apiRequestExports = apiRequest.exports; +const { finished, PassThrough: PassThrough$2 } = require$$0$5; +const { + InvalidArgumentError: InvalidArgumentError$a, + InvalidReturnValueError: InvalidReturnValueError$1, + RequestAbortedError: RequestAbortedError$4 +} = errors$4; +const util$a = util$l; +const { getResolveErrorBodyCallback } = util$c; +const { AsyncResource: AsyncResource$3 } = require$$4$1; +const { addSignal: addSignal$3, removeSignal: removeSignal$3 } = abortSignal; +class StreamHandler extends AsyncResource$3 { + constructor(opts, factory, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError$a("invalid opts"); + } + const { signal, method, opaque, body: body2, onInfo, responseHeaders, throwOnError } = opts; + try { + if (typeof callback !== "function") { + throw new InvalidArgumentError$a("invalid callback"); + } + if (typeof factory !== "function") { + throw new InvalidArgumentError$a("invalid factory"); + } + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError$a("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError$a("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError$a("invalid onInfo callback"); + } + super("UNDICI_STREAM"); + } catch (err) { + if (util$a.isStream(body2)) { + util$a.destroy(body2.on("error", util$a.nop), err); + } + throw err; + } + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.factory = factory; + this.callback = callback; + this.res = null; + this.abort = null; + this.context = null; + this.trailers = null; + this.body = body2; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError || false; + if (util$a.isStream(body2)) { + body2.on("error", (err) => { + this.onError(err); + }); + } + addSignal$3(this, signal); + } + onConnect(abort2, context2) { + if (!this.callback) { + throw new RequestAbortedError$4(); + } + this.abort = abort2; + this.context = context2; + } + onHeaders(statusCode, rawHeaders, resume2, statusMessage) { + const { factory, opaque, context: context2, callback, responseHeaders } = this; + const headers2 = responseHeaders === "raw" ? util$a.parseRawHeaders(rawHeaders) : util$a.parseHeaders(rawHeaders); + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers: headers2 }); + } + return; + } + this.factory = null; + let res; + if (this.throwOnError && statusCode >= 400) { + const parsedHeaders = responseHeaders === "raw" ? util$a.parseHeaders(rawHeaders) : headers2; + const contentType = parsedHeaders["content-type"]; + res = new PassThrough$2(); + this.callback = null; + this.runInAsyncScope( + getResolveErrorBodyCallback, + null, + { callback, body: res, contentType, statusCode, statusMessage, headers: headers2 } + ); + } else { + if (factory === null) { + return; + } + res = this.runInAsyncScope(factory, null, { + statusCode, + headers: headers2, + opaque, + context: context2 + }); + if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { + throw new InvalidReturnValueError$1("expected Writable"); + } + finished(res, { readable: false }, (err) => { + const { callback: callback2, res: res2, opaque: opaque2, trailers, abort: abort2 } = this; + this.res = null; + if (err || !res2.readable) { + util$a.destroy(res2, err); + } + this.callback = null; + this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); + if (err) { + abort2(); + } + }); + } + res.on("drain", resume2); + this.res = res; + const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState && res._writableState.needDrain; + return needDrain !== true; + } + onData(chunk) { + const { res } = this; + return res ? res.write(chunk) : true; + } + onComplete(trailers) { + const { res } = this; + removeSignal$3(this); + if (!res) { + return; + } + this.trailers = util$a.parseHeaders(trailers); + res.end(); + } + onError(err) { + const { res, callback, opaque, body: body2 } = this; + removeSignal$3(this); + this.factory = null; + if (res) { + this.res = null; + util$a.destroy(res, err); + } else if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (body2) { + this.body = null; + util$a.destroy(body2, err); + } + } +} +function stream$5(opts, factory, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + stream$5.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + this.dispatch(opts, new StreamHandler(opts, factory, callback)); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } +} +var apiStream = stream$5; +const { + Readable, + Duplex, + PassThrough: PassThrough$1 +} = require$$0$5; +const { + InvalidArgumentError: InvalidArgumentError$9, + InvalidReturnValueError: InvalidReturnValueError2, + RequestAbortedError: RequestAbortedError$3 +} = errors$4; +const util$9 = util$l; +const { AsyncResource: AsyncResource$2 } = require$$4$1; +const { addSignal: addSignal$2, removeSignal: removeSignal$2 } = abortSignal; +const assert$3 = require$$0$4; +const kResume = Symbol("resume"); +class PipelineRequest extends Readable { + constructor() { + super({ autoDestroy: true }); + this[kResume] = null; + } + _read() { + const { [kResume]: resume2 } = this; + if (resume2) { + this[kResume] = null; + resume2(); + } + } + _destroy(err, callback) { + this._read(); + callback(err); + } +} +class PipelineResponse extends Readable { + constructor(resume2) { + super({ autoDestroy: true }); + this[kResume] = resume2; + } + _read() { + this[kResume](); + } + _destroy(err, callback) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError$3(); + } + callback(err); + } +} +class PipelineHandler extends AsyncResource$2 { + constructor(opts, handler2) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError$9("invalid opts"); + } + if (typeof handler2 !== "function") { + throw new InvalidArgumentError$9("invalid handler"); + } + const { signal, method, opaque, onInfo, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError$9("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError$9("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError$9("invalid onInfo callback"); + } + super("UNDICI_PIPELINE"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.handler = handler2; + this.abort = null; + this.context = null; + this.onInfo = onInfo || null; + this.req = new PipelineRequest().on("error", util$9.nop); + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body: body2 } = this; + if (body2 && body2.resume) { + body2.resume(); + } + }, + write: (chunk, encoding2, callback) => { + const { req } = this; + if (req.push(chunk, encoding2) || req._readableState.destroyed) { + callback(); + } else { + req[kResume] = callback; + } + }, + destroy: (err, callback) => { + const { body: body2, req, res, ret, abort: abort2 } = this; + if (!err && !ret._readableState.endEmitted) { + err = new RequestAbortedError$3(); + } + if (abort2 && err) { + abort2(); + } + util$9.destroy(body2, err); + util$9.destroy(req, err); + util$9.destroy(res, err); + removeSignal$2(this); + callback(err); + } + }).on("prefinish", () => { + const { req } = this; + req.push(null); + }); + this.res = null; + addSignal$2(this, signal); + } + onConnect(abort2, context2) { + const { ret, res } = this; + assert$3(!res, "pipeline cannot be retried"); + if (ret.destroyed) { + throw new RequestAbortedError$3(); + } + this.abort = abort2; + this.context = context2; + } + onHeaders(statusCode, rawHeaders, resume2) { + const { opaque, handler: handler2, context: context2 } = this; + if (statusCode < 200) { + if (this.onInfo) { + const headers2 = this.responseHeaders === "raw" ? util$9.parseRawHeaders(rawHeaders) : util$9.parseHeaders(rawHeaders); + this.onInfo({ statusCode, headers: headers2 }); + } + return; + } + this.res = new PipelineResponse(resume2); + let body2; + try { + this.handler = null; + const headers2 = this.responseHeaders === "raw" ? util$9.parseRawHeaders(rawHeaders) : util$9.parseHeaders(rawHeaders); + body2 = this.runInAsyncScope(handler2, null, { + statusCode, + headers: headers2, + opaque, + body: this.res, + context: context2 + }); + } catch (err) { + this.res.on("error", util$9.nop); + throw err; + } + if (!body2 || typeof body2.on !== "function") { + throw new InvalidReturnValueError2("expected Readable"); + } + body2.on("data", (chunk) => { + const { ret, body: body3 } = this; + if (!ret.push(chunk) && body3.pause) { + body3.pause(); + } + }).on("error", (err) => { + const { ret } = this; + util$9.destroy(ret, err); + }).on("end", () => { + const { ret } = this; + ret.push(null); + }).on("close", () => { + const { ret } = this; + if (!ret._readableState.ended) { + util$9.destroy(ret, new RequestAbortedError$3()); + } + }); + this.body = body2; + } + onData(chunk) { + const { res } = this; + return res.push(chunk); + } + onComplete(trailers) { + const { res } = this; + res.push(null); + } + onError(err) { + const { ret } = this; + this.handler = null; + util$9.destroy(ret, err); + } +} +function pipeline(opts, handler2) { + try { + const pipelineHandler = new PipelineHandler(opts, handler2); + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); + return pipelineHandler.ret; + } catch (err) { + return new PassThrough$1().destroy(err); + } +} +var apiPipeline = pipeline; +const { InvalidArgumentError: InvalidArgumentError$8, RequestAbortedError: RequestAbortedError$2, SocketError: SocketError$1 } = errors$4; +const { AsyncResource: AsyncResource$1 } = require$$4$1; +const util$8 = util$l; +const { addSignal: addSignal$1, removeSignal: removeSignal$1 } = abortSignal; +const assert$2 = require$$0$4; +class UpgradeHandler extends AsyncResource$1 { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError$8("invalid opts"); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError$8("invalid callback"); + } + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError$8("signal must be an EventEmitter or EventTarget"); + } + super("UNDICI_UPGRADE"); + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.abort = null; + this.context = null; + addSignal$1(this, signal); + } + onConnect(abort2, context2) { + if (!this.callback) { + throw new RequestAbortedError$2(); + } + this.abort = abort2; + this.context = null; + } + onHeaders() { + throw new SocketError$1("bad upgrade", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + const { callback, opaque, context: context2 } = this; + assert$2.strictEqual(statusCode, 101); + removeSignal$1(this); + this.callback = null; + const headers2 = this.responseHeaders === "raw" ? util$8.parseRawHeaders(rawHeaders) : util$8.parseHeaders(rawHeaders); + this.runInAsyncScope(callback, null, null, { + headers: headers2, + socket, + opaque, + context: context2 + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal$1(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + } +} +function upgrade(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + upgrade.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + const upgradeHandler = new UpgradeHandler(opts, callback); + this.dispatch({ + ...opts, + method: opts.method || "GET", + upgrade: opts.protocol || "Websocket" + }, upgradeHandler); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } +} +var apiUpgrade = upgrade; +const { AsyncResource } = require$$4$1; +const { InvalidArgumentError: InvalidArgumentError$7, RequestAbortedError: RequestAbortedError$1, SocketError: SocketError2 } = errors$4; +const util$7 = util$l; +const { addSignal, removeSignal } = abortSignal; +class ConnectHandler extends AsyncResource { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError$7("invalid opts"); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError$7("invalid callback"); + } + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError$7("signal must be an EventEmitter or EventTarget"); + } + super("UNDICI_CONNECT"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.callback = callback; + this.abort = null; + addSignal(this, signal); + } + onConnect(abort2, context2) { + if (!this.callback) { + throw new RequestAbortedError$1(); + } + this.abort = abort2; + this.context = context2; + } + onHeaders() { + throw new SocketError2("bad connect", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + const { callback, opaque, context: context2 } = this; + removeSignal(this); + this.callback = null; + let headers2 = rawHeaders; + if (headers2 != null) { + headers2 = this.responseHeaders === "raw" ? util$7.parseRawHeaders(rawHeaders) : util$7.parseHeaders(rawHeaders); + } + this.runInAsyncScope(callback, null, null, { + statusCode, + headers: headers2, + socket, + opaque, + context: context2 + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + } +} +function connect(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + const connectHandler = new ConnectHandler(opts, callback); + this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } +} +var apiConnect = connect; +api$1.request = apiRequestExports; +api$1.stream = apiStream; +api$1.pipeline = apiPipeline; +api$1.upgrade = apiUpgrade; +api$1.connect = apiConnect; +const { UndiciError: UndiciError$1 } = errors$4; +let MockNotMatchedError$1 = class MockNotMatchedError extends UndiciError$1 { + constructor(message) { + super(message); + Error.captureStackTrace(this, MockNotMatchedError); + this.name = "MockNotMatchedError"; + this.message = message || "The request does not match any registered mock dispatches"; + this.code = "UND_MOCK_ERR_MOCK_NOT_MATCHED"; + } +}; +var mockErrors$1 = { + MockNotMatchedError: MockNotMatchedError$1 +}; +var mockSymbols = { + 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") +}; +const { MockNotMatchedError: MockNotMatchedError2 } = mockErrors$1; +const { + kDispatches: kDispatches$4, + kMockAgent: kMockAgent$2, + kOriginalDispatch: kOriginalDispatch$2, + kOrigin: kOrigin$2, + kGetNetConnect: kGetNetConnect$1 +} = mockSymbols; +const { buildURL: buildURL$1, nop } = util$l; +const { STATUS_CODES } = require$$2$2; +const { + types: { + isPromise + } +} = require$$0$3; +function matchValue$1(match, value) { + if (typeof match === "string") { + return match === value; + } + if (match instanceof RegExp) { + return match.test(value); + } + if (typeof match === "function") { + return match(value) === true; + } + return false; +} +function lowerCaseEntries(headers2) { + return Object.fromEntries( + Object.entries(headers2).map(([headerName, headerValue]) => { + return [headerName.toLocaleLowerCase(), headerValue]; + }) + ); +} +function getHeaderByName(headers2, key) { + if (Array.isArray(headers2)) { + for (let i = 0; i < headers2.length; i += 2) { + if (headers2[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { + return headers2[i + 1]; + } + } + return void 0; + } else if (typeof headers2.get === "function") { + return headers2.get(key); + } else { + return lowerCaseEntries(headers2)[key.toLocaleLowerCase()]; + } +} +function buildHeadersFromArray(headers2) { + const clone = headers2.slice(); + const entries = []; + for (let index = 0; index < clone.length; index += 2) { + entries.push([clone[index], clone[index + 1]]); + } + return Object.fromEntries(entries); +} +function matchHeaders(mockDispatch2, headers2) { + if (typeof mockDispatch2.headers === "function") { + if (Array.isArray(headers2)) { + headers2 = buildHeadersFromArray(headers2); + } + return mockDispatch2.headers(headers2 ? lowerCaseEntries(headers2) : {}); + } + if (typeof mockDispatch2.headers === "undefined") { + return true; + } + if (typeof headers2 !== "object" || typeof mockDispatch2.headers !== "object") { + return false; + } + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch2.headers)) { + const headerValue = getHeaderByName(headers2, matchHeaderName); + if (!matchValue$1(matchHeaderValue, headerValue)) { + return false; + } + } + return true; +} +function safeUrl(path2) { + if (typeof path2 !== "string") { + return path2; + } + const pathSegments = path2.split("?"); + if (pathSegments.length !== 2) { + return path2; + } + const qp = new URLSearchParams(pathSegments.pop()); + qp.sort(); + return [...pathSegments, qp.toString()].join("?"); +} +function matchKey(mockDispatch2, { path: path2, method, body: body2, headers: headers2 }) { + const pathMatch = matchValue$1(mockDispatch2.path, path2); + const methodMatch = matchValue$1(mockDispatch2.method, method); + const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue$1(mockDispatch2.body, body2) : true; + const headersMatch = matchHeaders(mockDispatch2, headers2); + return pathMatch && methodMatch && bodyMatch && headersMatch; +} +function getResponseData$2(data) { + if (Buffer.isBuffer(data)) { + return data; + } else if (typeof data === "object") { + return JSON.stringify(data); + } else { + return data.toString(); + } +} +function getMockDispatch(mockDispatches, key) { + const basePath = key.query ? buildURL$1(key.path, key.query) : key.path; + const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path2 }) => matchValue$1(safeUrl(path2), resolvedPath)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError2(`Mock dispatch not matched for path '${resolvedPath}'`); + } + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue$1(method, key.method)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError2(`Mock dispatch not matched for method '${key.method}'`); + } + matchedMockDispatches = matchedMockDispatches.filter(({ body: body2 }) => typeof body2 !== "undefined" ? matchValue$1(body2, key.body) : true); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError2(`Mock dispatch not matched for body '${key.body}'`); + } + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2, key.headers)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError2(`Mock dispatch not matched for headers '${typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers}'`); + } + return matchedMockDispatches[0]; +} +function addMockDispatch$1(mockDispatches, key, data) { + const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }; + const replyData = typeof data === "function" ? { callback: data } : { ...data }; + const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }; + mockDispatches.push(newMockDispatch); + return newMockDispatch; +} +function deleteMockDispatch(mockDispatches, key) { + const index = mockDispatches.findIndex((dispatch) => { + if (!dispatch.consumed) { + return false; + } + return matchKey(dispatch, key); + }); + if (index !== -1) { + mockDispatches.splice(index, 1); + } +} +function buildKey$1(opts) { + const { path: path2, method, body: body2, headers: headers2, query } = opts; + return { + path: path2, + method, + body: body2, + headers: headers2, + query + }; +} +function generateKeyValues(data) { + return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ + ...keyValuePairs, + Buffer.from(`${key}`), + Array.isArray(value) ? value.map((x) => Buffer.from(`${x}`)) : Buffer.from(`${value}`) + ], []); +} +function getStatusText(statusCode) { + return STATUS_CODES[statusCode] || "unknown"; +} +async function getResponse(body2) { + const buffers = []; + for await (const data of body2) { + buffers.push(data); + } + return Buffer.concat(buffers).toString("utf8"); +} +function mockDispatch(opts, handler2) { + const key = buildKey$1(opts); + const mockDispatch2 = getMockDispatch(this[kDispatches$4], key); + mockDispatch2.timesInvoked++; + if (mockDispatch2.data.callback) { + mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; + } + const { data: { statusCode, data, headers: headers2, trailers, error: error2 }, delay, persist } = mockDispatch2; + const { timesInvoked, times } = mockDispatch2; + mockDispatch2.consumed = !persist && timesInvoked >= times; + mockDispatch2.pending = timesInvoked < times; + if (error2 !== null) { + deleteMockDispatch(this[kDispatches$4], key); + handler2.onError(error2); + return true; + } + if (typeof delay === "number" && delay > 0) { + setTimeout(() => { + handleReply(this[kDispatches$4]); + }, delay); + } else { + handleReply(this[kDispatches$4]); + } + function handleReply(mockDispatches, _data = data) { + const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers; + const body2 = typeof _data === "function" ? _data({ ...opts, headers: optsHeaders }) : _data; + if (isPromise(body2)) { + body2.then((newData) => handleReply(mockDispatches, newData)); + return; + } + const responseData = getResponseData$2(body2); + const responseHeaders = generateKeyValues(headers2); + const responseTrailers = generateKeyValues(trailers); + handler2.abort = nop; + handler2.onHeaders(statusCode, responseHeaders, resume2, getStatusText(statusCode)); + handler2.onData(Buffer.from(responseData)); + handler2.onComplete(responseTrailers); + deleteMockDispatch(mockDispatches, key); + } + function resume2() { + } + return true; +} +function buildMockDispatch$2() { + const agent2 = this[kMockAgent$2]; + const origin = this[kOrigin$2]; + const originalDispatch = this[kOriginalDispatch$2]; + return function dispatch(opts, handler2) { + if (agent2.isMockActive) { + try { + mockDispatch.call(this, opts, handler2); + } catch (error2) { + if (error2 instanceof MockNotMatchedError2) { + const netConnect = agent2[kGetNetConnect$1](); + if (netConnect === false) { + throw new MockNotMatchedError2(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + } + if (checkNetConnect(netConnect, origin)) { + originalDispatch.call(this, opts, handler2); + } else { + throw new MockNotMatchedError2(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + } + } else { + throw error2; + } + } + } else { + originalDispatch.call(this, opts, handler2); + } + }; +} +function checkNetConnect(netConnect, origin) { + const url = new URL(origin); + if (netConnect === true) { + return true; + } else if (Array.isArray(netConnect) && netConnect.some((matcher2) => matchValue$1(matcher2, url.host))) { + return true; + } + return false; +} +function buildMockOptions$1(opts) { + if (opts) { + const { agent: agent2, ...mockOptions } = opts; + return mockOptions; + } +} +var mockUtils = { + getResponseData: getResponseData$2, + getMockDispatch, + addMockDispatch: addMockDispatch$1, + deleteMockDispatch, + buildKey: buildKey$1, + generateKeyValues, + matchValue: matchValue$1, + getResponse, + getStatusText, + mockDispatch, + buildMockDispatch: buildMockDispatch$2, + checkNetConnect, + buildMockOptions: buildMockOptions$1, + getHeaderByName +}; +var mockInterceptor = {}; +const { getResponseData: getResponseData$1, buildKey, addMockDispatch } = mockUtils; +const { + kDispatches: kDispatches$3, + kDispatchKey, + kDefaultHeaders, + kDefaultTrailers, + kContentLength, + kMockDispatch +} = mockSymbols; +const { InvalidArgumentError: InvalidArgumentError$6 } = errors$4; +const { buildURL } = util$l; +class MockScope { + constructor(mockDispatch2) { + this[kMockDispatch] = mockDispatch2; + } + /** + * Delay a reply by a set amount in ms. + */ + delay(waitInMs) { + if (typeof waitInMs !== "number" || !Number.isInteger(waitInMs) || waitInMs <= 0) { + throw new InvalidArgumentError$6("waitInMs must be a valid integer > 0"); + } + this[kMockDispatch].delay = waitInMs; + return this; + } + /** + * For a defined reply, never mark as consumed. + */ + persist() { + this[kMockDispatch].persist = true; + return this; + } + /** + * Allow one to define a reply for a set amount of matching requests. + */ + times(repeatTimes) { + if (typeof repeatTimes !== "number" || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { + throw new InvalidArgumentError$6("repeatTimes must be a valid integer > 0"); + } + this[kMockDispatch].times = repeatTimes; + return this; + } +} +let MockInterceptor$2 = class MockInterceptor { + constructor(opts, mockDispatches) { + if (typeof opts !== "object") { + throw new InvalidArgumentError$6("opts must be an object"); + } + if (typeof opts.path === "undefined") { + throw new InvalidArgumentError$6("opts.path must be defined"); + } + if (typeof opts.method === "undefined") { + opts.method = "GET"; + } + if (typeof opts.path === "string") { + if (opts.query) { + opts.path = buildURL(opts.path, opts.query); + } else { + const parsedURL = new URL(opts.path, "data://"); + opts.path = parsedURL.pathname + parsedURL.search; + } + } + if (typeof opts.method === "string") { + opts.method = opts.method.toUpperCase(); + } + this[kDispatchKey] = buildKey(opts); + this[kDispatches$3] = mockDispatches; + this[kDefaultHeaders] = {}; + this[kDefaultTrailers] = {}; + this[kContentLength] = false; + } + createMockScopeDispatchData(statusCode, data, responseOptions = {}) { + const responseData = getResponseData$1(data); + const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {}; + const headers2 = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }; + const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }; + return { statusCode, data, headers: headers2, trailers }; + } + validateReplyParameters(statusCode, data, responseOptions) { + if (typeof statusCode === "undefined") { + throw new InvalidArgumentError$6("statusCode must be defined"); + } + if (typeof data === "undefined") { + throw new InvalidArgumentError$6("data must be defined"); + } + if (typeof responseOptions !== "object") { + throw new InvalidArgumentError$6("responseOptions must be an object"); + } + } + /** + * Mock an undici request with a defined reply. + */ + reply(replyData) { + if (typeof replyData === "function") { + const wrappedDefaultsCallback = (opts) => { + const resolvedData = replyData(opts); + if (typeof resolvedData !== "object") { + throw new InvalidArgumentError$6("reply options callback must return an object"); + } + const { statusCode: statusCode2, data: data2 = "", responseOptions: responseOptions2 = {} } = resolvedData; + this.validateReplyParameters(statusCode2, data2, responseOptions2); + return { + ...this.createMockScopeDispatchData(statusCode2, data2, responseOptions2) + }; + }; + const newMockDispatch2 = addMockDispatch(this[kDispatches$3], this[kDispatchKey], wrappedDefaultsCallback); + return new MockScope(newMockDispatch2); + } + const [statusCode, data = "", responseOptions = {}] = [...arguments]; + this.validateReplyParameters(statusCode, data, responseOptions); + const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions); + const newMockDispatch = addMockDispatch(this[kDispatches$3], this[kDispatchKey], dispatchData); + return new MockScope(newMockDispatch); + } + /** + * Mock an undici request with a defined error. + */ + replyWithError(error2) { + if (typeof error2 === "undefined") { + throw new InvalidArgumentError$6("error must be defined"); + } + const newMockDispatch = addMockDispatch(this[kDispatches$3], this[kDispatchKey], { error: error2 }); + return new MockScope(newMockDispatch); + } + /** + * Set default reply headers on the interceptor for subsequent replies + */ + defaultReplyHeaders(headers2) { + if (typeof headers2 === "undefined") { + throw new InvalidArgumentError$6("headers must be defined"); + } + this[kDefaultHeaders] = headers2; + return this; + } + /** + * Set default reply trailers on the interceptor for subsequent replies + */ + defaultReplyTrailers(trailers) { + if (typeof trailers === "undefined") { + throw new InvalidArgumentError$6("trailers must be defined"); + } + this[kDefaultTrailers] = trailers; + return this; + } + /** + * Set reply content length header for replies on the interceptor + */ + replyContentLength() { + this[kContentLength] = true; + return this; + } +}; +mockInterceptor.MockInterceptor = MockInterceptor$2; +mockInterceptor.MockScope = MockScope; +const { promisify: promisify$1 } = require$$0$3; +const Client$1 = client; +const { buildMockDispatch: buildMockDispatch$1 } = mockUtils; +const { + kDispatches: kDispatches$2, + kMockAgent: kMockAgent$1, + kClose: kClose$2, + kOriginalClose: kOriginalClose$1, + kOrigin: kOrigin$1, + kOriginalDispatch: kOriginalDispatch$1, + kConnected: kConnected$1 +} = mockSymbols; +const { MockInterceptor: MockInterceptor$1 } = mockInterceptor; +const Symbols$1 = symbols$4; +const { InvalidArgumentError: InvalidArgumentError$5 } = errors$4; +let MockClient$2 = class MockClient extends Client$1 { + constructor(origin, opts) { + super(origin, opts); + if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError$5("Argument opts.agent must implement Agent"); + } + this[kMockAgent$1] = opts.agent; + this[kOrigin$1] = origin; + this[kDispatches$2] = []; + this[kConnected$1] = 1; + this[kOriginalDispatch$1] = this.dispatch; + this[kOriginalClose$1] = this.close.bind(this); + this.dispatch = buildMockDispatch$1.call(this); + this.close = this[kClose$2]; + } + get [Symbols$1.kConnected]() { + return this[kConnected$1]; + } + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept(opts) { + return new MockInterceptor$1(opts, this[kDispatches$2]); + } + async [kClose$2]() { + await promisify$1(this[kOriginalClose$1])(); + this[kConnected$1] = 0; + this[kMockAgent$1][Symbols$1.kClients].delete(this[kOrigin$1]); + } +}; +var mockClient = MockClient$2; +const { promisify } = require$$0$3; +const Pool$2 = pool; +const { buildMockDispatch } = mockUtils; +const { + kDispatches: kDispatches$1, + kMockAgent, + kClose: kClose$1, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = mockSymbols; +const { MockInterceptor: MockInterceptor2 } = mockInterceptor; +const Symbols = symbols$4; +const { InvalidArgumentError: InvalidArgumentError$4 } = errors$4; +let MockPool$2 = class MockPool extends Pool$2 { + constructor(origin, opts) { + super(origin, opts); + if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError$4("Argument opts.agent must implement Agent"); + } + this[kMockAgent] = opts.agent; + this[kOrigin] = origin; + this[kDispatches$1] = []; + this[kConnected] = 1; + this[kOriginalDispatch] = this.dispatch; + this[kOriginalClose] = this.close.bind(this); + this.dispatch = buildMockDispatch.call(this); + this.close = this[kClose$1]; + } + get [Symbols.kConnected]() { + return this[kConnected]; + } + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept(opts) { + return new MockInterceptor2(opts, this[kDispatches$1]); + } + async [kClose$1]() { + await promisify(this[kOriginalClose])(); + this[kConnected] = 0; + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); + } +}; +var mockPool = MockPool$2; +const singulars = { + pronoun: "it", + is: "is", + was: "was", + this: "this" +}; +const plurals = { + pronoun: "they", + is: "are", + was: "were", + this: "these" +}; +var pluralizer = class Pluralizer { + constructor(singular, plural) { + this.singular = singular; + this.plural = plural; + } + pluralize(count) { + const one = count === 1; + const keys = one ? singulars : plurals; + const noun = one ? this.singular : this.plural; + return { ...keys, count, noun }; + } +}; +const { Transform } = require$$0$5; +const { Console } = require$$1$2; +var pendingInterceptorsFormatter = class PendingInterceptorsFormatter { + constructor({ disableColors } = {}) { + this.transform = new Transform({ + transform(chunk, _enc, cb) { + cb(null, chunk); + } + }); + this.logger = new Console({ + stdout: this.transform, + inspectOptions: { + colors: !disableColors && !process.env.CI + } + }); + } + format(pendingInterceptors) { + const withPrettyHeaders = pendingInterceptors.map( + ({ method, path: path2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + Method: method, + Origin: origin, + Path: path2, + "Status code": statusCode, + Persistent: persist ? "✅" : "❌", + Invocations: timesInvoked, + Remaining: persist ? Infinity : times - timesInvoked + }) + ); + this.logger.table(withPrettyHeaders); + return this.transform.read().toString(); + } +}; +const { kClients } = symbols$4; +const Agent$3 = agent; +const { + kAgent: kAgent$1, + kMockAgentSet, + kMockAgentGet, + kDispatches, + kIsMockActive, + kNetConnect, + kGetNetConnect, + kOptions, + kFactory +} = mockSymbols; +const MockClient$1 = mockClient; +const MockPool$1 = mockPool; +const { matchValue, buildMockOptions } = mockUtils; +const { InvalidArgumentError: InvalidArgumentError$3, UndiciError: UndiciError2 } = errors$4; +const Dispatcher$1 = dispatcher; +const Pluralizer2 = pluralizer; +const PendingInterceptorsFormatter2 = pendingInterceptorsFormatter; +class FakeWeakRef { + constructor(value) { + this.value = value; + } + deref() { + return this.value; + } +} +let MockAgent$1 = class MockAgent extends Dispatcher$1 { + constructor(opts) { + super(opts); + this[kNetConnect] = true; + this[kIsMockActive] = true; + if (opts && opts.agent && typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError$3("Argument opts.agent must implement Agent"); + } + const agent2 = opts && opts.agent ? opts.agent : new Agent$3(opts); + this[kAgent$1] = agent2; + this[kClients] = agent2[kClients]; + this[kOptions] = buildMockOptions(opts); + } + get(origin) { + let dispatcher2 = this[kMockAgentGet](origin); + if (!dispatcher2) { + dispatcher2 = this[kFactory](origin); + this[kMockAgentSet](origin, dispatcher2); + } + return dispatcher2; + } + dispatch(opts, handler2) { + this.get(opts.origin); + return this[kAgent$1].dispatch(opts, handler2); + } + async close() { + await this[kAgent$1].close(); + this[kClients].clear(); + } + deactivate() { + this[kIsMockActive] = false; + } + activate() { + this[kIsMockActive] = true; + } + enableNetConnect(matcher2) { + if (typeof matcher2 === "string" || typeof matcher2 === "function" || matcher2 instanceof RegExp) { + if (Array.isArray(this[kNetConnect])) { + this[kNetConnect].push(matcher2); + } else { + this[kNetConnect] = [matcher2]; + } + } else if (typeof matcher2 === "undefined") { + this[kNetConnect] = true; + } else { + throw new InvalidArgumentError$3("Unsupported matcher. Must be one of String|Function|RegExp."); + } + } + disableNetConnect() { + this[kNetConnect] = false; + } + // This is required to bypass issues caused by using global symbols - see: + // https://github.com/nodejs/undici/issues/1447 + get isMockActive() { + return this[kIsMockActive]; + } + [kMockAgentSet](origin, dispatcher2) { + this[kClients].set(origin, new FakeWeakRef(dispatcher2)); + } + [kFactory](origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]); + return this[kOptions] && this[kOptions].connections === 1 ? new MockClient$1(origin, mockOptions) : new MockPool$1(origin, mockOptions); + } + [kMockAgentGet](origin) { + const ref = this[kClients].get(origin); + if (ref) { + return ref.deref(); + } + if (typeof origin !== "string") { + const dispatcher2 = this[kFactory]("http://localhost:9999"); + this[kMockAgentSet](origin, dispatcher2); + return dispatcher2; + } + for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { + const nonExplicitDispatcher = nonExplicitRef.deref(); + if (nonExplicitDispatcher && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) { + const dispatcher2 = this[kFactory](origin); + this[kMockAgentSet](origin, dispatcher2); + dispatcher2[kDispatches] = nonExplicitDispatcher[kDispatches]; + return dispatcher2; + } + } + } + [kGetNetConnect]() { + return this[kNetConnect]; + } + pendingInterceptors() { + const mockAgentClients = this[kClients]; + return Array.from(mockAgentClients.entries()).flatMap(([origin, scope]) => scope.deref()[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending }) => pending); + } + assertNoPendingInterceptors({ pendingInterceptorsFormatter: pendingInterceptorsFormatter2 = new PendingInterceptorsFormatter2() } = {}) { + const pending = this.pendingInterceptors(); + if (pending.length === 0) { + return; + } + const pluralizer2 = new Pluralizer2("interceptor", "interceptors").pluralize(pending.length); + throw new UndiciError2(` +${pluralizer2.count} ${pluralizer2.noun} ${pluralizer2.is} pending: + +${pendingInterceptorsFormatter2.format(pending)} +`.trim()); + } +}; +var mockAgent = MockAgent$1; +const { kProxy, kClose, kDestroy, kInterceptors } = symbols$4; +const { URL: URL$2 } = require$$1$3; +const Agent$2 = agent; +const Pool$1 = pool; +const DispatcherBase2 = dispatcherBase; +const { InvalidArgumentError: InvalidArgumentError$2, RequestAbortedError: RequestAbortedError2 } = errors$4; +const buildConnector$1 = connect$2; +const kAgent = Symbol("proxy agent"); +const kClient = Symbol("proxy client"); +const kProxyHeaders = Symbol("proxy headers"); +const kRequestTls = Symbol("request tls settings"); +const kProxyTls = Symbol("proxy tls settings"); +const kConnectEndpoint = Symbol("connect endpoint function"); +function defaultProtocolPort(protocol) { + return protocol === "https:" ? 443 : 80; +} +function buildProxyOptions(opts) { + if (typeof opts === "string") { + opts = { uri: opts }; + } + if (!opts || !opts.uri) { + throw new InvalidArgumentError$2("Proxy opts.uri is mandatory"); + } + return { + uri: opts.uri, + protocol: opts.protocol || "https" + }; +} +function defaultFactory(origin, opts) { + return new Pool$1(origin, opts); +} +let ProxyAgent$1 = class ProxyAgent extends DispatcherBase2 { + constructor(opts) { + super(opts); + this[kProxy] = buildProxyOptions(opts); + this[kAgent] = new Agent$2(opts); + this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : []; + if (typeof opts === "string") { + opts = { uri: opts }; + } + if (!opts || !opts.uri) { + throw new InvalidArgumentError$2("Proxy opts.uri is mandatory"); + } + const { clientFactory = defaultFactory } = opts; + if (typeof clientFactory !== "function") { + throw new InvalidArgumentError$2("Proxy opts.clientFactory must be a function."); + } + this[kRequestTls] = opts.requestTls; + this[kProxyTls] = opts.proxyTls; + this[kProxyHeaders] = opts.headers || {}; + const resolvedUrl = new URL$2(opts.uri); + const { origin, port, host, username, password } = resolvedUrl; + if (opts.auth && opts.token) { + throw new InvalidArgumentError$2("opts.auth cannot be used in combination with opts.token"); + } else if (opts.auth) { + this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`; + } else if (opts.token) { + this[kProxyHeaders]["proxy-authorization"] = opts.token; + } else if (username && password) { + this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString("base64")}`; + } + const connect2 = buildConnector$1({ ...opts.proxyTls }); + this[kConnectEndpoint] = buildConnector$1({ ...opts.requestTls }); + this[kClient] = clientFactory(resolvedUrl, { connect: connect2 }); + this[kAgent] = new Agent$2({ + ...opts, + connect: async (opts2, callback) => { + let requestedHost = opts2.host; + if (!opts2.port) { + requestedHost += `:${defaultProtocolPort(opts2.protocol)}`; + } + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedHost, + signal: opts2.signal, + headers: { + ...this[kProxyHeaders], + host + } + }); + if (statusCode !== 200) { + socket.on("error", () => { + }).destroy(); + callback(new RequestAbortedError2(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)); + } + if (opts2.protocol !== "https:") { + callback(null, socket); + return; + } + let servername; + if (this[kRequestTls]) { + servername = this[kRequestTls].servername; + } else { + servername = opts2.servername; + } + this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); + } catch (err) { + callback(err); + } + } + }); + } + dispatch(opts, handler2) { + const { host } = new URL$2(opts.origin); + const headers2 = buildHeaders(opts.headers); + throwIfProxyAuthIsSent(headers2); + return this[kAgent].dispatch( + { + ...opts, + headers: { + ...headers2, + host + } + }, + handler2 + ); + } + async [kClose]() { + await this[kAgent].close(); + await this[kClient].close(); + } + async [kDestroy]() { + await this[kAgent].destroy(); + await this[kClient].destroy(); + } +}; +function buildHeaders(headers2) { + if (Array.isArray(headers2)) { + const headersPair = {}; + for (let i = 0; i < headers2.length; i += 2) { + headersPair[headers2[i]] = headers2[i + 1]; + } + return headersPair; + } + return headers2; +} +function throwIfProxyAuthIsSent(headers2) { + const existProxyAuth = headers2 && Object.keys(headers2).find((key) => key.toLowerCase() === "proxy-authorization"); + if (existProxyAuth) { + throw new InvalidArgumentError$2("Proxy-Authorization should be sent in ProxyAgent constructor"); + } +} +var proxyAgent = ProxyAgent$1; +const assert$1 = require$$0$4; +const { kRetryHandlerDefaultRetry } = symbols$4; +const { RequestRetryError: RequestRetryError2 } = errors$4; +const { isDisturbed, parseHeaders, parseRangeHeader } = util$l; +function calculateRetryAfterHeader(retryAfter) { + const current = Date.now(); + const diff2 = new Date(retryAfter).getTime() - current; + return diff2; +} +let RetryHandler$1 = class RetryHandler { + constructor(opts, handlers) { + const { retryOptions, ...dispatchOpts } = opts; + const { + // Retry scoped + retry: retryFn, + maxRetries, + maxTimeout, + minTimeout, + timeoutFactor, + // Response scoped + methods, + errorCodes, + retryAfter, + statusCodes + } = retryOptions ?? {}; + this.dispatch = handlers.dispatch; + this.handler = handlers.handler; + this.opts = dispatchOpts; + this.abort = null; + this.aborted = false; + this.retryOpts = { + retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], + retryAfter: retryAfter ?? true, + maxTimeout: maxTimeout ?? 30 * 1e3, + // 30s, + timeout: minTimeout ?? 500, + // .5s + timeoutFactor: timeoutFactor ?? 2, + maxRetries: maxRetries ?? 5, + // What errors we should retry + methods: methods ?? ["GET", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"], + // Indicates which errors to retry + statusCodes: statusCodes ?? [500, 502, 503, 504, 429], + // List of errors to retry + errorCodes: errorCodes ?? [ + "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((reason) => { + this.aborted = true; + if (this.abort) { + this.abort(reason); + } else { + this.reason = reason; + } + }); + } + onRequestSent() { + if (this.handler.onRequestSent) { + this.handler.onRequestSent(); + } + } + onUpgrade(statusCode, headers2, socket) { + if (this.handler.onUpgrade) { + this.handler.onUpgrade(statusCode, headers2, socket); + } + } + onConnect(abort2) { + if (this.aborted) { + abort2(this.reason); + } else { + this.abort = abort2; + } + } + onBodySent(chunk) { + if (this.handler.onBodySent) return this.handler.onBodySent(chunk); + } + static [kRetryHandlerDefaultRetry](err, { state, opts }, cb) { + const { statusCode, code, headers: headers2 } = err; + const { method, retryOptions } = opts; + const { + maxRetries, + timeout, + maxTimeout, + timeoutFactor, + statusCodes, + errorCodes, + methods + } = retryOptions; + let { counter, currentTimeout } = state; + currentTimeout = currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout; + if (code && code !== "UND_ERR_REQ_RETRY" && code !== "UND_ERR_SOCKET" && !errorCodes.includes(code)) { + cb(err); + return; + } + if (Array.isArray(methods) && !methods.includes(method)) { + cb(err); + return; + } + if (statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode)) { + cb(err); + return; + } + if (counter > maxRetries) { + cb(err); + return; + } + let retryAfterHeader = headers2 != null && headers2["retry-after"]; + if (retryAfterHeader) { + retryAfterHeader = Number(retryAfterHeader); + retryAfterHeader = isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3; + } + const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout); + state.currentTimeout = retryTimeout; + setTimeout(() => cb(null), retryTimeout); + } + onHeaders(statusCode, rawHeaders, resume2, statusMessage) { + const headers2 = parseHeaders(rawHeaders); + this.retryCount += 1; + if (statusCode >= 300) { + this.abort( + new RequestRetryError2("Request failed", statusCode, { + headers: headers2, + count: this.retryCount + }) + ); + return false; + } + if (this.resume != null) { + this.resume = null; + if (statusCode !== 206) { + return true; + } + const contentRange = parseRangeHeader(headers2["content-range"]); + if (!contentRange) { + this.abort( + new RequestRetryError2("Content-Range mismatch", statusCode, { + headers: headers2, + count: this.retryCount + }) + ); + return false; + } + if (this.etag != null && this.etag !== headers2.etag) { + this.abort( + new RequestRetryError2("ETag mismatch", statusCode, { + headers: headers2, + count: this.retryCount + }) + ); + return false; + } + const { start, size, end = size } = contentRange; + assert$1(this.start === start, "content-range mismatch"); + assert$1(this.end == null || this.end === end, "content-range mismatch"); + this.resume = resume2; + return true; + } + if (this.end == null) { + if (statusCode === 206) { + const range = parseRangeHeader(headers2["content-range"]); + if (range == null) { + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume2, + statusMessage + ); + } + const { start, size, end = size } = range; + assert$1( + start != null && Number.isFinite(start) && this.start !== start, + "content-range mismatch" + ); + assert$1(Number.isFinite(start)); + assert$1( + end != null && Number.isFinite(end) && this.end !== end, + "invalid content-length" + ); + this.start = start; + this.end = end; + } + if (this.end == null) { + const contentLength = headers2["content-length"]; + this.end = contentLength != null ? Number(contentLength) : null; + } + assert$1(Number.isFinite(this.start)); + assert$1( + this.end == null || Number.isFinite(this.end), + "invalid content-length" + ); + this.resume = resume2; + this.etag = headers2.etag != null ? headers2.etag : null; + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume2, + statusMessage + ); + } + const err = new RequestRetryError2("Request failed", statusCode, { + headers: headers2, + count: this.retryCount + }); + this.abort(err); + return false; + } + onData(chunk) { + this.start += chunk.length; + return this.handler.onData(chunk); + } + onComplete(rawTrailers) { + this.retryCount = 0; + return this.handler.onComplete(rawTrailers); + } + onError(err) { + if (this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err); + } + this.retryOpts.retry( + err, + { + state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, + opts: { retryOptions: this.retryOpts, ...this.opts } + }, + onRetry.bind(this) + ); + function onRetry(err2) { + if (err2 != null || this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err2); + } + if (this.start !== 0) { + this.opts = { + ...this.opts, + headers: { + ...this.opts.headers, + range: `bytes=${this.start}-${this.end ?? ""}` + } + }; + } + try { + this.dispatch(this.opts, this); + } catch (err3) { + this.handler.onError(err3); + } + } + } +}; +var RetryHandler_1 = RetryHandler$1; +const globalDispatcher = Symbol.for("undici.globalDispatcher.1"); +const { InvalidArgumentError: InvalidArgumentError$1 } = errors$4; +const Agent$1 = agent; +if (getGlobalDispatcher$1() === void 0) { + setGlobalDispatcher$1(new Agent$1()); +} +function setGlobalDispatcher$1(agent2) { + if (!agent2 || typeof agent2.dispatch !== "function") { + throw new InvalidArgumentError$1("Argument agent must implement Agent"); + } + Object.defineProperty(globalThis, globalDispatcher, { + value: agent2, + writable: true, + enumerable: false, + configurable: false + }); +} +function getGlobalDispatcher$1() { + return globalThis[globalDispatcher]; +} +var global$1 = { + setGlobalDispatcher: setGlobalDispatcher$1, + getGlobalDispatcher: getGlobalDispatcher$1 +}; +var DecoratorHandler_1 = class DecoratorHandler { + constructor(handler2) { + this.handler = handler2; + } + onConnect(...args) { + return this.handler.onConnect(...args); + } + onError(...args) { + return this.handler.onError(...args); + } + onUpgrade(...args) { + return this.handler.onUpgrade(...args); + } + onHeaders(...args) { + return this.handler.onHeaders(...args); + } + onData(...args) { + return this.handler.onData(...args); + } + onComplete(...args) { + return this.handler.onComplete(...args); + } + onBodySent(...args) { + return this.handler.onBodySent(...args); + } +}; +var headers; +var hasRequiredHeaders; +function requireHeaders() { + if (hasRequiredHeaders) return headers; + hasRequiredHeaders = 1; + const { kHeadersList, kConstruct } = symbols$4; + const { kGuard } = requireSymbols$3(); + const { kEnumerableProperty: kEnumerableProperty2 } = util$l; + const { + makeIterator, + isValidHeaderName, + isValidHeaderValue + } = requireUtil$4(); + const { webidl } = requireWebidl(); + const assert2 = require$$0$4; + const kHeadersMap = Symbol("headers map"); + const kHeadersSortedMap = Symbol("headers map sorted"); + function isHTTPWhiteSpaceCharCode(code) { + return code === 10 || code === 13 || code === 9 || code === 32; + } + function headerValueNormalize(potentialValue) { + let i = 0; + let j = potentialValue.length; + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j; + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i; + return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j); + } + function fill2(headers2, object) { + if (Array.isArray(object)) { + for (let i = 0; i < object.length; ++i) { + const header2 = object[i]; + if (header2.length !== 2) { + throw webidl.errors.exception({ + header: "Headers constructor", + message: `expected name/value pair to be length 2, found ${header2.length}.` + }); + } + appendHeader(headers2, header2[0], header2[1]); + } + } else if (typeof object === "object" && object !== null) { + const keys = Object.keys(object); + for (let i = 0; i < keys.length; ++i) { + appendHeader(headers2, keys[i], object[keys[i]]); + } + } else { + throw webidl.errors.conversionFailed({ + prefix: "Headers constructor", + argument: "Argument 1", + types: ["sequence>", "record"] + }); + } + } + function appendHeader(headers2, name, value) { + value = headerValueNormalize(value); + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.append", + value: name, + type: "header name" + }); + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.append", + value, + type: "header value" + }); + } + if (headers2[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (headers2[kGuard] === "request-no-cors") ; + return headers2[kHeadersList].append(name, value); + } + class HeadersList { + constructor(init) { + /** @type {[string, string][]|null} */ + __publicField(this, "cookies", null); + if (init instanceof HeadersList) { + this[kHeadersMap] = new Map(init[kHeadersMap]); + this[kHeadersSortedMap] = init[kHeadersSortedMap]; + this.cookies = init.cookies === null ? null : [...init.cookies]; + } else { + this[kHeadersMap] = new Map(init); + this[kHeadersSortedMap] = null; + } + } + // https://fetch.spec.whatwg.org/#header-list-contains + contains(name) { + name = name.toLowerCase(); + return this[kHeadersMap].has(name); + } + clear() { + this[kHeadersMap].clear(); + this[kHeadersSortedMap] = null; + this.cookies = null; + } + // https://fetch.spec.whatwg.org/#concept-header-list-append + append(name, value) { + this[kHeadersSortedMap] = null; + const lowercaseName = name.toLowerCase(); + const exists = this[kHeadersMap].get(lowercaseName); + if (exists) { + const delimiter = lowercaseName === "cookie" ? "; " : ", "; + this[kHeadersMap].set(lowercaseName, { + name: exists.name, + value: `${exists.value}${delimiter}${value}` + }); + } else { + this[kHeadersMap].set(lowercaseName, { name, value }); + } + if (lowercaseName === "set-cookie") { + this.cookies ?? (this.cookies = []); + this.cookies.push(value); + } + } + // https://fetch.spec.whatwg.org/#concept-header-list-set + set(name, value) { + this[kHeadersSortedMap] = null; + const lowercaseName = name.toLowerCase(); + if (lowercaseName === "set-cookie") { + this.cookies = [value]; + } + this[kHeadersMap].set(lowercaseName, { name, value }); + } + // https://fetch.spec.whatwg.org/#concept-header-list-delete + delete(name) { + this[kHeadersSortedMap] = null; + name = name.toLowerCase(); + if (name === "set-cookie") { + this.cookies = null; + } + this[kHeadersMap].delete(name); + } + // https://fetch.spec.whatwg.org/#concept-header-list-get + get(name) { + const value = this[kHeadersMap].get(name.toLowerCase()); + return value === void 0 ? null : value.value; + } + *[Symbol.iterator]() { + for (const [name, { value }] of this[kHeadersMap]) { + yield [name, value]; + } + } + get entries() { + const headers2 = {}; + if (this[kHeadersMap].size) { + for (const { name, value } of this[kHeadersMap].values()) { + headers2[name] = value; + } + } + return headers2; + } + } + class Headers2 { + constructor(init = void 0) { + if (init === kConstruct) { + return; + } + this[kHeadersList] = new HeadersList(); + this[kGuard] = "none"; + if (init !== void 0) { + init = webidl.converters.HeadersInit(init); + fill2(this, init); + } + } + // https://fetch.spec.whatwg.org/#dom-headers-append + append(name, value) { + webidl.brandCheck(this, Headers2); + webidl.argumentLengthCheck(arguments, 2, { header: "Headers.append" }); + name = webidl.converters.ByteString(name); + value = webidl.converters.ByteString(value); + return appendHeader(this, name, value); + } + // https://fetch.spec.whatwg.org/#dom-headers-delete + delete(name) { + webidl.brandCheck(this, Headers2); + webidl.argumentLengthCheck(arguments, 1, { header: "Headers.delete" }); + name = webidl.converters.ByteString(name); + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.delete", + value: name, + type: "header name" + }); + } + if (this[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (this[kGuard] === "request-no-cors") ; + if (!this[kHeadersList].contains(name)) { + return; + } + this[kHeadersList].delete(name); + } + // https://fetch.spec.whatwg.org/#dom-headers-get + get(name) { + webidl.brandCheck(this, Headers2); + webidl.argumentLengthCheck(arguments, 1, { header: "Headers.get" }); + name = webidl.converters.ByteString(name); + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.get", + value: name, + type: "header name" + }); + } + return this[kHeadersList].get(name); + } + // https://fetch.spec.whatwg.org/#dom-headers-has + has(name) { + webidl.brandCheck(this, Headers2); + webidl.argumentLengthCheck(arguments, 1, { header: "Headers.has" }); + name = webidl.converters.ByteString(name); + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.has", + value: name, + type: "header name" + }); + } + return this[kHeadersList].contains(name); + } + // https://fetch.spec.whatwg.org/#dom-headers-set + set(name, value) { + webidl.brandCheck(this, Headers2); + webidl.argumentLengthCheck(arguments, 2, { header: "Headers.set" }); + name = webidl.converters.ByteString(name); + value = webidl.converters.ByteString(value); + value = headerValueNormalize(value); + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.set", + value: name, + type: "header name" + }); + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: "Headers.set", + value, + type: "header value" + }); + } + if (this[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (this[kGuard] === "request-no-cors") ; + this[kHeadersList].set(name, value); + } + // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie + getSetCookie() { + webidl.brandCheck(this, Headers2); + const list2 = this[kHeadersList].cookies; + if (list2) { + return [...list2]; + } + return []; + } + // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine + get [kHeadersSortedMap]() { + if (this[kHeadersList][kHeadersSortedMap]) { + return this[kHeadersList][kHeadersSortedMap]; + } + const headers2 = []; + const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1); + const cookies2 = this[kHeadersList].cookies; + for (let i = 0; i < names.length; ++i) { + const [name, value] = names[i]; + if (name === "set-cookie") { + for (let j = 0; j < cookies2.length; ++j) { + headers2.push([name, cookies2[j]]); + } + } else { + assert2(value !== null); + headers2.push([name, value]); + } + } + this[kHeadersList][kHeadersSortedMap] = headers2; + return headers2; + } + keys() { + webidl.brandCheck(this, Headers2); + if (this[kGuard] === "immutable") { + const value = this[kHeadersSortedMap]; + return makeIterator( + () => value, + "Headers", + "key" + ); + } + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + "Headers", + "key" + ); + } + values() { + webidl.brandCheck(this, Headers2); + if (this[kGuard] === "immutable") { + const value = this[kHeadersSortedMap]; + return makeIterator( + () => value, + "Headers", + "value" + ); + } + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + "Headers", + "value" + ); + } + entries() { + webidl.brandCheck(this, Headers2); + if (this[kGuard] === "immutable") { + const value = this[kHeadersSortedMap]; + return makeIterator( + () => value, + "Headers", + "key+value" + ); + } + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + "Headers", + "key+value" + ); + } + /** + * @param {(value: string, key: string, self: Headers) => void} callbackFn + * @param {unknown} thisArg + */ + forEach(callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, Headers2); + webidl.argumentLengthCheck(arguments, 1, { header: "Headers.forEach" }); + if (typeof callbackFn !== "function") { + throw new TypeError( + "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." + ); + } + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]); + } + } + [Symbol.for("nodejs.util.inspect.custom")]() { + webidl.brandCheck(this, Headers2); + return this[kHeadersList]; + } + } + Headers2.prototype[Symbol.iterator] = Headers2.prototype.entries; + Object.defineProperties(Headers2.prototype, { + append: kEnumerableProperty2, + delete: kEnumerableProperty2, + get: kEnumerableProperty2, + has: kEnumerableProperty2, + set: kEnumerableProperty2, + getSetCookie: kEnumerableProperty2, + keys: kEnumerableProperty2, + values: kEnumerableProperty2, + entries: kEnumerableProperty2, + forEach: kEnumerableProperty2, + [Symbol.iterator]: { enumerable: false }, + [Symbol.toStringTag]: { + value: "Headers", + configurable: true + } + }); + webidl.converters.HeadersInit = function(V) { + if (webidl.util.Type(V) === "Object") { + if (V[Symbol.iterator]) { + return webidl.converters["sequence>"](V); + } + return webidl.converters["record"](V); + } + throw webidl.errors.conversionFailed({ + prefix: "Headers constructor", + argument: "Argument 1", + types: ["sequence>", "record"] + }); + }; + headers = { + fill: fill2, + Headers: Headers2, + HeadersList + }; + return headers; +} +var response; +var hasRequiredResponse; +function requireResponse() { + if (hasRequiredResponse) return response; + hasRequiredResponse = 1; + const { Headers: Headers2, HeadersList, fill: fill2 } = requireHeaders(); + const { extractBody: extractBody2, cloneBody, mixinBody } = requireBody(); + const util2 = util$l; + const { kEnumerableProperty: kEnumerableProperty2 } = util2; + const { + isValidReasonPhrase, + isCancelled, + isAborted, + isBlobLike: isBlobLike2, + serializeJavascriptValueToJSONString, + isErrorLike, + isomorphicEncode + } = requireUtil$4(); + const { + redirectStatusSet, + nullBodyStatus, + DOMException: DOMException2 + } = requireConstants$3(); + const { kState, kHeaders, kGuard, kRealm } = requireSymbols$3(); + const { webidl } = requireWebidl(); + const { FormData } = requireFormdata(); + const { getGlobalOrigin } = requireGlobal(); + const { URLSerializer } = requireDataURL(); + const { kHeadersList, kConstruct } = symbols$4; + const assert2 = require$$0$4; + const { types: types2 } = require$$0$3; + const ReadableStream2 = globalThis.ReadableStream || require$$13.ReadableStream; + const textEncoder = new TextEncoder("utf-8"); + class Response { + // Creates network error Response. + static error() { + const relevantRealm = { settingsObject: {} }; + const responseObject = new Response(); + responseObject[kState] = makeNetworkError(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + return responseObject; + } + // https://fetch.spec.whatwg.org/#dom-response-json + static json(data, init = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: "Response.json" }); + if (init !== null) { + init = webidl.converters.ResponseInit(init); + } + const bytes = textEncoder.encode( + serializeJavascriptValueToJSONString(data) + ); + const body2 = extractBody2(bytes); + const relevantRealm = { settingsObject: {} }; + const responseObject = new Response(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kGuard] = "response"; + responseObject[kHeaders][kRealm] = relevantRealm; + initializeResponse(responseObject, init, { body: body2[0], type: "application/json" }); + return responseObject; + } + // Creates a redirect Response that redirects to url with status status. + static redirect(url, status = 302) { + const relevantRealm = { settingsObject: {} }; + webidl.argumentLengthCheck(arguments, 1, { header: "Response.redirect" }); + url = webidl.converters.USVString(url); + status = webidl.converters["unsigned short"](status); + let parsedURL; + try { + parsedURL = new URL(url, getGlobalOrigin()); + } catch (err) { + throw Object.assign(new TypeError("Failed to parse URL from " + url), { + cause: err + }); + } + if (!redirectStatusSet.has(status)) { + throw new RangeError("Invalid status code " + status); + } + const responseObject = new Response(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + responseObject[kState].status = status; + const value = isomorphicEncode(URLSerializer(parsedURL)); + responseObject[kState].headersList.append("location", value); + return responseObject; + } + // https://fetch.spec.whatwg.org/#dom-response + constructor(body2 = null, init = {}) { + if (body2 !== null) { + body2 = webidl.converters.BodyInit(body2); + } + init = webidl.converters.ResponseInit(init); + this[kRealm] = { settingsObject: {} }; + this[kState] = makeResponse({}); + this[kHeaders] = new Headers2(kConstruct); + this[kHeaders][kGuard] = "response"; + this[kHeaders][kHeadersList] = this[kState].headersList; + this[kHeaders][kRealm] = this[kRealm]; + let bodyWithType = null; + if (body2 != null) { + const [extractedBody, type] = extractBody2(body2); + bodyWithType = { body: extractedBody, type }; + } + initializeResponse(this, init, bodyWithType); + } + // Returns response’s type, e.g., "cors". + get type() { + webidl.brandCheck(this, Response); + return this[kState].type; + } + // Returns response’s URL, if it has one; otherwise the empty string. + get url() { + webidl.brandCheck(this, Response); + const urlList = this[kState].urlList; + const url = urlList[urlList.length - 1] ?? null; + if (url === null) { + return ""; + } + return URLSerializer(url, true); + } + // Returns whether response was obtained through a redirect. + get redirected() { + webidl.brandCheck(this, Response); + return this[kState].urlList.length > 1; + } + // Returns response’s status. + get status() { + webidl.brandCheck(this, Response); + return this[kState].status; + } + // Returns whether response’s status is an ok status. + get ok() { + webidl.brandCheck(this, Response); + return this[kState].status >= 200 && this[kState].status <= 299; + } + // Returns response’s status message. + get statusText() { + webidl.brandCheck(this, Response); + return this[kState].statusText; + } + // Returns response’s headers as Headers. + get headers() { + webidl.brandCheck(this, Response); + return this[kHeaders]; + } + get body() { + webidl.brandCheck(this, Response); + return this[kState].body ? this[kState].body.stream : null; + } + get bodyUsed() { + webidl.brandCheck(this, Response); + return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); + } + // Returns a clone of response. + clone() { + webidl.brandCheck(this, Response); + if (this.bodyUsed || this.body && this.body.locked) { + throw webidl.errors.exception({ + header: "Response.clone", + message: "Body has already been consumed." + }); + } + const clonedResponse = cloneResponse(this[kState]); + const clonedResponseObject = new Response(); + clonedResponseObject[kState] = clonedResponse; + clonedResponseObject[kRealm] = this[kRealm]; + clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList; + clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]; + clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]; + return clonedResponseObject; + } + } + mixinBody(Response); + Object.defineProperties(Response.prototype, { + type: kEnumerableProperty2, + url: kEnumerableProperty2, + status: kEnumerableProperty2, + ok: kEnumerableProperty2, + redirected: kEnumerableProperty2, + statusText: kEnumerableProperty2, + headers: kEnumerableProperty2, + clone: kEnumerableProperty2, + body: kEnumerableProperty2, + bodyUsed: kEnumerableProperty2, + [Symbol.toStringTag]: { + value: "Response", + configurable: true + } + }); + Object.defineProperties(Response, { + json: kEnumerableProperty2, + redirect: kEnumerableProperty2, + error: kEnumerableProperty2 + }); + function cloneResponse(response2) { + if (response2.internalResponse) { + return filterResponse( + cloneResponse(response2.internalResponse), + response2.type + ); + } + const newResponse = makeResponse({ ...response2, body: null }); + if (response2.body != null) { + newResponse.body = cloneBody(response2.body); + } + return newResponse; + } + function makeResponse(init) { + return { + aborted: false, + rangeRequested: false, + timingAllowPassed: false, + requestIncludesCredentials: false, + type: "default", + status: 200, + timingInfo: null, + cacheState: "", + statusText: "", + ...init, + headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList(), + urlList: init.urlList ? [...init.urlList] : [] + }; + } + function makeNetworkError(reason) { + const isError = isErrorLike(reason); + return makeResponse({ + type: "error", + status: 0, + error: isError ? reason : new Error(reason ? String(reason) : reason), + aborted: reason && reason.name === "AbortError" + }); + } + function makeFilteredResponse(response2, state) { + state = { + internalResponse: response2, + ...state + }; + return new Proxy(response2, { + get(target, p) { + return p in state ? state[p] : target[p]; + }, + set(target, p, value) { + assert2(!(p in state)); + target[p] = value; + return true; + } + }); + } + function filterResponse(response2, type) { + if (type === "basic") { + return makeFilteredResponse(response2, { + type: "basic", + headersList: response2.headersList + }); + } else if (type === "cors") { + return makeFilteredResponse(response2, { + type: "cors", + headersList: response2.headersList + }); + } else if (type === "opaque") { + return makeFilteredResponse(response2, { + type: "opaque", + urlList: Object.freeze([]), + status: 0, + statusText: "", + body: null + }); + } else if (type === "opaqueredirect") { + return makeFilteredResponse(response2, { + type: "opaqueredirect", + status: 0, + statusText: "", + headersList: [], + body: null + }); + } else { + assert2(false); + } + } + function makeAppropriateNetworkError(fetchParams, err = null) { + assert2(isCancelled(fetchParams)); + return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); + } + function initializeResponse(response2, init, body2) { + if (init.status !== null && (init.status < 200 || init.status > 599)) { + throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.'); + } + if ("statusText" in init && init.statusText != null) { + if (!isValidReasonPhrase(String(init.statusText))) { + throw new TypeError("Invalid statusText"); + } + } + if ("status" in init && init.status != null) { + response2[kState].status = init.status; + } + if ("statusText" in init && init.statusText != null) { + response2[kState].statusText = init.statusText; + } + if ("headers" in init && init.headers != null) { + fill2(response2[kHeaders], init.headers); + } + if (body2) { + if (nullBodyStatus.includes(response2.status)) { + throw webidl.errors.exception({ + header: "Response constructor", + message: "Invalid response status code " + response2.status + }); + } + response2[kState].body = body2.body; + if (body2.type != null && !response2[kState].headersList.contains("Content-Type")) { + response2[kState].headersList.append("content-type", body2.type); + } + } + } + webidl.converters.ReadableStream = webidl.interfaceConverter( + ReadableStream2 + ); + webidl.converters.FormData = webidl.interfaceConverter( + FormData + ); + webidl.converters.URLSearchParams = webidl.interfaceConverter( + URLSearchParams + ); + webidl.converters.XMLHttpRequestBodyInit = function(V) { + if (typeof V === "string") { + return webidl.converters.USVString(V); + } + if (isBlobLike2(V)) { + return webidl.converters.Blob(V, { strict: false }); + } + if (types2.isArrayBuffer(V) || types2.isTypedArray(V) || types2.isDataView(V)) { + return webidl.converters.BufferSource(V); + } + if (util2.isFormDataLike(V)) { + return webidl.converters.FormData(V, { strict: false }); + } + if (V instanceof URLSearchParams) { + return webidl.converters.URLSearchParams(V); + } + return webidl.converters.DOMString(V); + }; + webidl.converters.BodyInit = function(V) { + if (V instanceof ReadableStream2) { + return webidl.converters.ReadableStream(V); + } + if (V == null ? void 0 : V[Symbol.asyncIterator]) { + return V; + } + return webidl.converters.XMLHttpRequestBodyInit(V); + }; + webidl.converters.ResponseInit = webidl.dictionaryConverter([ + { + key: "status", + converter: webidl.converters["unsigned short"], + defaultValue: 200 + }, + { + key: "statusText", + converter: webidl.converters.ByteString, + defaultValue: "" + }, + { + key: "headers", + converter: webidl.converters.HeadersInit + } + ]); + response = { + makeNetworkError, + makeResponse, + makeAppropriateNetworkError, + filterResponse, + Response, + cloneResponse + }; + return response; +} +var request$1; +var hasRequiredRequest; +function requireRequest() { + if (hasRequiredRequest) return request$1; + hasRequiredRequest = 1; + const { extractBody: extractBody2, mixinBody, cloneBody } = requireBody(); + const { Headers: Headers2, fill: fillHeaders, HeadersList } = requireHeaders(); + const { FinalizationRegistry: FinalizationRegistry2 } = dispatcherWeakref(); + const util2 = util$l; + const { + isValidHTTPToken, + sameOrigin, + normalizeMethod, + makePolicyContainer, + normalizeMethodRecord + } = requireUtil$4(); + const { + forbiddenMethodsSet, + corsSafeListedMethodsSet, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + requestDuplex + } = requireConstants$3(); + const { kEnumerableProperty: kEnumerableProperty2 } = util2; + const { kHeaders, kSignal: kSignal2, kState, kGuard, kRealm } = requireSymbols$3(); + const { webidl } = requireWebidl(); + const { getGlobalOrigin } = requireGlobal(); + const { URLSerializer } = requireDataURL(); + const { kHeadersList, kConstruct } = symbols$4; + const assert2 = require$$0$4; + const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require$$0$2; + let TransformStream = globalThis.TransformStream; + const kAbortController = Symbol("abortController"); + const requestFinalizer = new FinalizationRegistry2(({ signal, abort: abort2 }) => { + signal.removeEventListener("abort", abort2); + }); + class Request3 { + // https://fetch.spec.whatwg.org/#dom-request + constructor(input, init = {}) { + var _a2, _b; + if (input === kConstruct) { + return; + } + webidl.argumentLengthCheck(arguments, 1, { header: "Request constructor" }); + input = webidl.converters.RequestInfo(input); + init = webidl.converters.RequestInit(init); + this[kRealm] = { + settingsObject: { + baseUrl: getGlobalOrigin(), + get origin() { + var _a3; + return (_a3 = this.baseUrl) == null ? void 0 : _a3.origin; + }, + policyContainer: makePolicyContainer() + } + }; + let request2 = null; + let fallbackMode = null; + const baseUrl = this[kRealm].settingsObject.baseUrl; + let signal = null; + if (typeof input === "string") { + let parsedURL; + try { + parsedURL = new URL(input, baseUrl); + } catch (err) { + throw new TypeError("Failed to parse URL from " + input, { cause: err }); + } + if (parsedURL.username || parsedURL.password) { + throw new TypeError( + "Request cannot be constructed from a URL that includes credentials: " + input + ); + } + request2 = makeRequest({ urlList: [parsedURL] }); + fallbackMode = "cors"; + } else { + assert2(input instanceof Request3); + request2 = input[kState]; + signal = input[kSignal2]; + } + const origin = this[kRealm].settingsObject.origin; + let window2 = "client"; + if (((_b = (_a2 = request2.window) == null ? void 0 : _a2.constructor) == null ? void 0 : _b.name) === "EnvironmentSettingsObject" && sameOrigin(request2.window, origin)) { + window2 = request2.window; + } + if (init.window != null) { + throw new TypeError(`'window' option '${window2}' must be null`); + } + if ("window" in init) { + window2 = "no-window"; + } + request2 = makeRequest({ + // URL request’s URL. + // undici implementation note: this is set as the first item in request's urlList in makeRequest + // method request’s method. + method: request2.method, + // header list A copy of request’s header list. + // undici implementation note: headersList is cloned in makeRequest + headersList: request2.headersList, + // unsafe-request flag Set. + unsafeRequest: request2.unsafeRequest, + // client This’s relevant settings object. + client: this[kRealm].settingsObject, + // window window. + window: window2, + // priority request’s priority. + priority: request2.priority, + // origin request’s origin. The propagation of the origin is only significant for navigation requests + // being handled by a service worker. In this scenario a request can have an origin that is different + // from the current client. + origin: request2.origin, + // referrer request’s referrer. + referrer: request2.referrer, + // referrer policy request’s referrer policy. + referrerPolicy: request2.referrerPolicy, + // mode request’s mode. + mode: request2.mode, + // credentials mode request’s credentials mode. + credentials: request2.credentials, + // cache mode request’s cache mode. + cache: request2.cache, + // redirect mode request’s redirect mode. + redirect: request2.redirect, + // integrity metadata request’s integrity metadata. + integrity: request2.integrity, + // keepalive request’s keepalive. + keepalive: request2.keepalive, + // reload-navigation flag request’s reload-navigation flag. + reloadNavigation: request2.reloadNavigation, + // history-navigation flag request’s history-navigation flag. + historyNavigation: request2.historyNavigation, + // URL list A clone of request’s URL list. + urlList: [...request2.urlList] + }); + const initHasKey = Object.keys(init).length !== 0; + if (initHasKey) { + if (request2.mode === "navigate") { + request2.mode = "same-origin"; + } + request2.reloadNavigation = false; + request2.historyNavigation = false; + request2.origin = "client"; + request2.referrer = "client"; + request2.referrerPolicy = ""; + request2.url = request2.urlList[request2.urlList.length - 1]; + request2.urlList = [request2.url]; + } + if (init.referrer !== void 0) { + const referrer = init.referrer; + if (referrer === "") { + request2.referrer = "no-referrer"; + } else { + let parsedReferrer; + try { + parsedReferrer = new URL(referrer, baseUrl); + } catch (err) { + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }); + } + if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) { + request2.referrer = "client"; + } else { + request2.referrer = parsedReferrer; + } + } + } + if (init.referrerPolicy !== void 0) { + request2.referrerPolicy = init.referrerPolicy; + } + let mode; + if (init.mode !== void 0) { + mode = init.mode; + } else { + mode = fallbackMode; + } + if (mode === "navigate") { + throw webidl.errors.exception({ + header: "Request constructor", + message: "invalid request mode navigate." + }); + } + if (mode != null) { + request2.mode = mode; + } + if (init.credentials !== void 0) { + request2.credentials = init.credentials; + } + if (init.cache !== void 0) { + request2.cache = init.cache; + } + if (request2.cache === "only-if-cached" && request2.mode !== "same-origin") { + throw new TypeError( + "'only-if-cached' can be set only with 'same-origin' mode" + ); + } + if (init.redirect !== void 0) { + request2.redirect = init.redirect; + } + if (init.integrity != null) { + request2.integrity = String(init.integrity); + } + if (init.keepalive !== void 0) { + request2.keepalive = Boolean(init.keepalive); + } + if (init.method !== void 0) { + let method = init.method; + if (!isValidHTTPToken(method)) { + throw new TypeError(`'${method}' is not a valid HTTP method.`); + } + if (forbiddenMethodsSet.has(method.toUpperCase())) { + throw new TypeError(`'${method}' HTTP method is unsupported.`); + } + method = normalizeMethodRecord[method] ?? normalizeMethod(method); + request2.method = method; + } + if (init.signal !== void 0) { + signal = init.signal; + } + this[kState] = request2; + const ac = new AbortController(); + this[kSignal2] = ac.signal; + this[kSignal2][kRealm] = this[kRealm]; + if (signal != null) { + if (!signal || typeof signal.aborted !== "boolean" || typeof signal.addEventListener !== "function") { + throw new TypeError( + "Failed to construct 'Request': member signal is not of type AbortSignal." + ); + } + if (signal.aborted) { + ac.abort(signal.reason); + } else { + this[kAbortController] = ac; + const acRef = new WeakRef(ac); + const abort2 = function() { + const ac2 = acRef.deref(); + if (ac2 !== void 0) { + ac2.abort(this.reason); + } + }; + try { + if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) { + setMaxListeners(100, signal); + } else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) { + setMaxListeners(100, signal); + } + } catch { + } + util2.addAbortListener(signal, abort2); + requestFinalizer.register(ac, { signal, abort: abort2 }); + } + } + this[kHeaders] = new Headers2(kConstruct); + this[kHeaders][kHeadersList] = request2.headersList; + this[kHeaders][kGuard] = "request"; + this[kHeaders][kRealm] = this[kRealm]; + if (mode === "no-cors") { + if (!corsSafeListedMethodsSet.has(request2.method)) { + throw new TypeError( + `'${request2.method} is unsupported in no-cors mode.` + ); + } + this[kHeaders][kGuard] = "request-no-cors"; + } + if (initHasKey) { + const headersList = this[kHeaders][kHeadersList]; + const headers2 = init.headers !== void 0 ? init.headers : new HeadersList(headersList); + headersList.clear(); + if (headers2 instanceof HeadersList) { + for (const [key, val] of headers2) { + headersList.append(key, val); + } + headersList.cookies = headers2.cookies; + } else { + fillHeaders(this[kHeaders], headers2); + } + } + const inputBody = input instanceof Request3 ? input[kState].body : null; + if ((init.body != null || inputBody != null) && (request2.method === "GET" || request2.method === "HEAD")) { + throw new TypeError("Request with GET/HEAD method cannot have body."); + } + let initBody = null; + if (init.body != null) { + const [extractedBody, contentType] = extractBody2( + init.body, + request2.keepalive + ); + initBody = extractedBody; + if (contentType && !this[kHeaders][kHeadersList].contains("content-type")) { + this[kHeaders].append("content-type", contentType); + } + } + const inputOrInitBody = initBody ?? inputBody; + if (inputOrInitBody != null && inputOrInitBody.source == null) { + if (initBody != null && init.duplex == null) { + throw new TypeError("RequestInit: duplex option is required when sending a body."); + } + if (request2.mode !== "same-origin" && request2.mode !== "cors") { + throw new TypeError( + 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' + ); + } + request2.useCORSPreflightFlag = true; + } + let finalBody = inputOrInitBody; + if (initBody == null && inputBody != null) { + if (util2.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + throw new TypeError( + "Cannot construct a Request with a Request object that has already been used." + ); + } + if (!TransformStream) { + TransformStream = require$$13.TransformStream; + } + const identityTransform = new TransformStream(); + inputBody.stream.pipeThrough(identityTransform); + finalBody = { + source: inputBody.source, + length: inputBody.length, + stream: identityTransform.readable + }; + } + this[kState].body = finalBody; + } + // Returns request’s HTTP method, which is "GET" by default. + get method() { + webidl.brandCheck(this, Request3); + return this[kState].method; + } + // Returns the URL of request as a string. + get url() { + webidl.brandCheck(this, Request3); + return URLSerializer(this[kState].url); + } + // Returns a Headers object consisting of the headers associated with request. + // Note that headers added in the network layer by the user agent will not + // be accounted for in this object, e.g., the "Host" header. + get headers() { + webidl.brandCheck(this, Request3); + return this[kHeaders]; + } + // Returns the kind of resource requested by request, e.g., "document" + // or "script". + get destination() { + webidl.brandCheck(this, Request3); + return this[kState].destination; + } + // Returns the referrer of request. Its value can be a same-origin URL if + // explicitly set in init, the empty string to indicate no referrer, and + // "about:client" when defaulting to the global’s default. This is used + // during fetching to determine the value of the `Referer` header of the + // request being made. + get referrer() { + webidl.brandCheck(this, Request3); + if (this[kState].referrer === "no-referrer") { + return ""; + } + if (this[kState].referrer === "client") { + return "about:client"; + } + return this[kState].referrer.toString(); + } + // Returns the referrer policy associated with request. + // This is used during fetching to compute the value of the request’s + // referrer. + get referrerPolicy() { + webidl.brandCheck(this, Request3); + return this[kState].referrerPolicy; + } + // Returns the mode associated with request, which is a string indicating + // whether the request will use CORS, or will be restricted to same-origin + // URLs. + get mode() { + webidl.brandCheck(this, Request3); + return this[kState].mode; + } + // Returns the credentials mode associated with request, + // which is a string indicating whether credentials will be sent with the + // request always, never, or only when sent to a same-origin URL. + get credentials() { + return this[kState].credentials; + } + // Returns the cache mode associated with request, + // which is a string indicating how the request will + // interact with the browser’s cache when fetching. + get cache() { + webidl.brandCheck(this, Request3); + return this[kState].cache; + } + // Returns the redirect mode associated with request, + // which is a string indicating how redirects for the + // request will be handled during fetching. A request + // will follow redirects by default. + get redirect() { + webidl.brandCheck(this, Request3); + return this[kState].redirect; + } + // Returns request’s subresource integrity metadata, which is a + // cryptographic hash of the resource being fetched. Its value + // consists of multiple hashes separated by whitespace. [SRI] + get integrity() { + webidl.brandCheck(this, Request3); + return this[kState].integrity; + } + // Returns a boolean indicating whether or not request can outlive the + // global in which it was created. + get keepalive() { + webidl.brandCheck(this, Request3); + return this[kState].keepalive; + } + // Returns a boolean indicating whether or not request is for a reload + // navigation. + get isReloadNavigation() { + webidl.brandCheck(this, Request3); + return this[kState].reloadNavigation; + } + // Returns a boolean indicating whether or not request is for a history + // navigation (a.k.a. back-foward navigation). + get isHistoryNavigation() { + webidl.brandCheck(this, Request3); + return this[kState].historyNavigation; + } + // Returns the signal associated with request, which is an AbortSignal + // object indicating whether or not request has been aborted, and its + // abort event handler. + get signal() { + webidl.brandCheck(this, Request3); + return this[kSignal2]; + } + get body() { + webidl.brandCheck(this, Request3); + return this[kState].body ? this[kState].body.stream : null; + } + get bodyUsed() { + webidl.brandCheck(this, Request3); + return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); + } + get duplex() { + webidl.brandCheck(this, Request3); + return "half"; + } + // Returns a clone of request. + clone() { + var _a2; + webidl.brandCheck(this, Request3); + if (this.bodyUsed || ((_a2 = this.body) == null ? void 0 : _a2.locked)) { + throw new TypeError("unusable"); + } + const clonedRequest = cloneRequest(this[kState]); + const clonedRequestObject = new Request3(kConstruct); + clonedRequestObject[kState] = clonedRequest; + clonedRequestObject[kRealm] = this[kRealm]; + clonedRequestObject[kHeaders] = new Headers2(kConstruct); + clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList; + clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]; + clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]; + const ac = new AbortController(); + if (this.signal.aborted) { + ac.abort(this.signal.reason); + } else { + util2.addAbortListener( + this.signal, + () => { + ac.abort(this.signal.reason); + } + ); + } + clonedRequestObject[kSignal2] = ac.signal; + return clonedRequestObject; + } + } + mixinBody(Request3); + function makeRequest(init) { + const request2 = { + method: "GET", + localURLsOnly: false, + unsafeRequest: false, + body: null, + client: null, + reservedClient: null, + replacesClientId: "", + window: "client", + keepalive: false, + serviceWorkers: "all", + initiator: "", + destination: "", + priority: null, + origin: "client", + policyContainer: "client", + referrer: "client", + referrerPolicy: "", + mode: "no-cors", + useCORSPreflightFlag: false, + credentials: "same-origin", + useCredentials: false, + cache: "default", + redirect: "follow", + integrity: "", + cryptoGraphicsNonceMetadata: "", + parserMetadata: "", + reloadNavigation: false, + historyNavigation: false, + userActivation: false, + taintedOrigin: false, + redirectCount: 0, + responseTainting: "basic", + preventNoCacheCacheControlHeaderModification: false, + done: false, + timingAllowFailed: false, + ...init, + headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList() + }; + request2.url = request2.urlList[0]; + return request2; + } + function cloneRequest(request2) { + const newRequest = makeRequest({ ...request2, body: null }); + if (request2.body != null) { + newRequest.body = cloneBody(request2.body); + } + return newRequest; + } + Object.defineProperties(Request3.prototype, { + method: kEnumerableProperty2, + url: kEnumerableProperty2, + headers: kEnumerableProperty2, + redirect: kEnumerableProperty2, + clone: kEnumerableProperty2, + signal: kEnumerableProperty2, + duplex: kEnumerableProperty2, + destination: kEnumerableProperty2, + body: kEnumerableProperty2, + bodyUsed: kEnumerableProperty2, + isHistoryNavigation: kEnumerableProperty2, + isReloadNavigation: kEnumerableProperty2, + keepalive: kEnumerableProperty2, + integrity: kEnumerableProperty2, + cache: kEnumerableProperty2, + credentials: kEnumerableProperty2, + attribute: kEnumerableProperty2, + referrerPolicy: kEnumerableProperty2, + referrer: kEnumerableProperty2, + mode: kEnumerableProperty2, + [Symbol.toStringTag]: { + value: "Request", + configurable: true + } + }); + webidl.converters.Request = webidl.interfaceConverter( + Request3 + ); + webidl.converters.RequestInfo = function(V) { + if (typeof V === "string") { + return webidl.converters.USVString(V); + } + if (V instanceof Request3) { + return webidl.converters.Request(V); + } + return webidl.converters.USVString(V); + }; + webidl.converters.AbortSignal = webidl.interfaceConverter( + AbortSignal + ); + webidl.converters.RequestInit = webidl.dictionaryConverter([ + { + key: "method", + converter: webidl.converters.ByteString + }, + { + key: "headers", + converter: webidl.converters.HeadersInit + }, + { + key: "body", + converter: webidl.nullableConverter( + webidl.converters.BodyInit + ) + }, + { + key: "referrer", + converter: webidl.converters.USVString + }, + { + key: "referrerPolicy", + converter: webidl.converters.DOMString, + // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy + allowedValues: referrerPolicy + }, + { + key: "mode", + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#concept-request-mode + allowedValues: requestMode + }, + { + key: "credentials", + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcredentials + allowedValues: requestCredentials + }, + { + key: "cache", + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcache + allowedValues: requestCache + }, + { + key: "redirect", + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestredirect + allowedValues: requestRedirect + }, + { + key: "integrity", + converter: webidl.converters.DOMString + }, + { + key: "keepalive", + converter: webidl.converters.boolean + }, + { + key: "signal", + converter: webidl.nullableConverter( + (signal) => webidl.converters.AbortSignal( + signal, + { strict: false } + ) + ) + }, + { + key: "window", + converter: webidl.converters.any + }, + { + key: "duplex", + converter: webidl.converters.DOMString, + allowedValues: requestDuplex + } + ]); + request$1 = { Request: Request3, makeRequest }; + return request$1; +} +var fetch_1; +var hasRequiredFetch; +function requireFetch() { + if (hasRequiredFetch) return fetch_1; + hasRequiredFetch = 1; + const { + Response, + makeNetworkError, + makeAppropriateNetworkError, + filterResponse, + makeResponse + } = requireResponse(); + const { Headers: Headers2 } = requireHeaders(); + const { Request: Request3, makeRequest } = requireRequest(); + const zlib2 = require$$3$2; + const { + bytesMatch, + makePolicyContainer, + clonePolicyContainer, + requestBadPort, + TAOCheck, + appendRequestOriginHeader, + responseLocationURL, + requestCurrentURL, + setRequestReferrerPolicyOnRedirect, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + createOpaqueTimingInfo, + appendFetchMetadata, + corsCheck, + crossOriginResourcePolicyCheck, + determineRequestsReferrer, + coarsenedSharedCurrentTime, + createDeferredPromise, + isBlobLike: isBlobLike2, + sameOrigin, + isCancelled, + isAborted, + isErrorLike, + fullyReadBody, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlIsHttpHttpsScheme, + urlHasHttpsScheme + } = requireUtil$4(); + const { kState, kHeaders, kGuard, kRealm } = requireSymbols$3(); + const assert2 = require$$0$4; + const { safelyExtractBody } = requireBody(); + const { + redirectStatusSet, + nullBodyStatus, + safeMethodsSet, + requestBodyHeader, + subresourceSet, + DOMException: DOMException2 + } = requireConstants$3(); + const { kHeadersList } = symbols$4; + const EE2 = require$$0$2; + const { Readable: Readable2, pipeline: pipeline2 } = require$$0$5; + const { addAbortListener: addAbortListener2, isErrored: isErrored2, isReadable: isReadable2, nodeMajor: nodeMajor2, nodeMinor: nodeMinor2 } = util$l; + const { dataURLProcessor, serializeAMimeType } = requireDataURL(); + const { TransformStream } = require$$13; + const { getGlobalDispatcher: getGlobalDispatcher2 } = global$1; + const { webidl } = requireWebidl(); + const { STATUS_CODES: STATUS_CODES2 } = require$$2$2; + const GET_OR_HEAD = ["GET", "HEAD"]; + let resolveObjectURL; + let ReadableStream2 = globalThis.ReadableStream; + class Fetch extends EE2 { + constructor(dispatcher2) { + super(); + this.dispatcher = dispatcher2; + this.connection = null; + this.dump = false; + this.state = "ongoing"; + this.setMaxListeners(21); + } + terminate(reason) { + var _a2; + if (this.state !== "ongoing") { + return; + } + this.state = "terminated"; + (_a2 = this.connection) == null ? void 0 : _a2.destroy(reason); + this.emit("terminated", reason); + } + // https://fetch.spec.whatwg.org/#fetch-controller-abort + abort(error2) { + var _a2; + if (this.state !== "ongoing") { + return; + } + this.state = "aborted"; + if (!error2) { + error2 = new DOMException2("The operation was aborted.", "AbortError"); + } + this.serializedAbortReason = error2; + (_a2 = this.connection) == null ? void 0 : _a2.destroy(error2); + this.emit("terminated", error2); + } + } + function fetch(input, init = {}) { + var _a2; + webidl.argumentLengthCheck(arguments, 1, { header: "globalThis.fetch" }); + const p = createDeferredPromise(); + let requestObject; + try { + requestObject = new Request3(input, init); + } catch (e) { + p.reject(e); + return p.promise; + } + const request2 = requestObject[kState]; + if (requestObject.signal.aborted) { + abortFetch(p, request2, null, requestObject.signal.reason); + return p.promise; + } + const globalObject = request2.client.globalObject; + if (((_a2 = globalObject == null ? void 0 : globalObject.constructor) == null ? void 0 : _a2.name) === "ServiceWorkerGlobalScope") { + request2.serviceWorkers = "none"; + } + let responseObject = null; + const relevantRealm = null; + let locallyAborted = false; + let controller = null; + addAbortListener2( + requestObject.signal, + () => { + locallyAborted = true; + assert2(controller != null); + controller.abort(requestObject.signal.reason); + abortFetch(p, request2, responseObject, requestObject.signal.reason); + } + ); + const handleFetchDone = (response2) => finalizeAndReportTiming(response2, "fetch"); + const processResponse = (response2) => { + if (locallyAborted) { + return Promise.resolve(); + } + if (response2.aborted) { + abortFetch(p, request2, responseObject, controller.serializedAbortReason); + return Promise.resolve(); + } + if (response2.type === "error") { + p.reject( + Object.assign(new TypeError("fetch failed"), { cause: response2.error }) + ); + return Promise.resolve(); + } + responseObject = new Response(); + responseObject[kState] = response2; + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kHeadersList] = response2.headersList; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + p.resolve(responseObject); + }; + controller = fetching({ + request: request2, + processResponseEndOfBody: handleFetchDone, + processResponse, + dispatcher: init.dispatcher ?? getGlobalDispatcher2() + // undici + }); + return p.promise; + } + function finalizeAndReportTiming(response2, initiatorType = "other") { + var _a2; + if (response2.type === "error" && response2.aborted) { + return; + } + if (!((_a2 = response2.urlList) == null ? void 0 : _a2.length)) { + return; + } + const originalURL = response2.urlList[0]; + let timingInfo = response2.timingInfo; + let cacheState = response2.cacheState; + if (!urlIsHttpHttpsScheme(originalURL)) { + return; + } + if (timingInfo === null) { + return; + } + if (!response2.timingAllowPassed) { + timingInfo = createOpaqueTimingInfo({ + startTime: timingInfo.startTime + }); + cacheState = ""; + } + timingInfo.endTime = coarsenedSharedCurrentTime(); + response2.timingInfo = timingInfo; + markResourceTiming( + timingInfo, + originalURL, + initiatorType, + globalThis, + cacheState + ); + } + function markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState) { + if (nodeMajor2 > 18 || nodeMajor2 === 18 && nodeMinor2 >= 2) { + performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); + } + } + function abortFetch(p, request2, responseObject, error2) { + var _a2, _b; + if (!error2) { + error2 = new DOMException2("The operation was aborted.", "AbortError"); + } + p.reject(error2); + if (request2.body != null && isReadable2((_a2 = request2.body) == null ? void 0 : _a2.stream)) { + request2.body.stream.cancel(error2).catch((err) => { + if (err.code === "ERR_INVALID_STATE") { + return; + } + throw err; + }); + } + if (responseObject == null) { + return; + } + const response2 = responseObject[kState]; + if (response2.body != null && isReadable2((_b = response2.body) == null ? void 0 : _b.stream)) { + response2.body.stream.cancel(error2).catch((err) => { + if (err.code === "ERR_INVALID_STATE") { + return; + } + throw err; + }); + } + } + function fetching({ + request: request2, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseEndOfBody, + processResponseConsumeBody, + useParallelQueue = false, + dispatcher: dispatcher2 + // undici + }) { + var _a2, _b, _c, _d; + let taskDestination = null; + let crossOriginIsolatedCapability = false; + if (request2.client != null) { + taskDestination = request2.client.globalObject; + crossOriginIsolatedCapability = request2.client.crossOriginIsolatedCapability; + } + const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability); + const timingInfo = createOpaqueTimingInfo({ + startTime: currenTime + }); + const fetchParams = { + controller: new Fetch(dispatcher2), + request: request2, + timingInfo, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseConsumeBody, + processResponseEndOfBody, + taskDestination, + crossOriginIsolatedCapability + }; + assert2(!request2.body || request2.body.stream); + if (request2.window === "client") { + request2.window = ((_c = (_b = (_a2 = request2.client) == null ? void 0 : _a2.globalObject) == null ? void 0 : _b.constructor) == null ? void 0 : _c.name) === "Window" ? request2.client : "no-window"; + } + if (request2.origin === "client") { + request2.origin = (_d = request2.client) == null ? void 0 : _d.origin; + } + if (request2.policyContainer === "client") { + if (request2.client != null) { + request2.policyContainer = clonePolicyContainer( + request2.client.policyContainer + ); + } else { + request2.policyContainer = makePolicyContainer(); + } + } + if (!request2.headersList.contains("accept")) { + const value = "*/*"; + request2.headersList.append("accept", value); + } + if (!request2.headersList.contains("accept-language")) { + request2.headersList.append("accept-language", "*"); + } + if (request2.priority === null) ; + if (subresourceSet.has(request2.destination)) ; + mainFetch(fetchParams).catch((err) => { + fetchParams.controller.terminate(err); + }); + return fetchParams.controller; + } + async function mainFetch(fetchParams, recursive = false) { + const request2 = fetchParams.request; + let response2 = null; + if (request2.localURLsOnly && !urlIsLocal(requestCurrentURL(request2))) { + response2 = makeNetworkError("local URLs only"); + } + tryUpgradeRequestToAPotentiallyTrustworthyURL(request2); + if (requestBadPort(request2) === "blocked") { + response2 = makeNetworkError("bad port"); + } + if (request2.referrerPolicy === "") { + request2.referrerPolicy = request2.policyContainer.referrerPolicy; + } + if (request2.referrer !== "no-referrer") { + request2.referrer = determineRequestsReferrer(request2); + } + if (response2 === null) { + response2 = await (async () => { + const currentURL = requestCurrentURL(request2); + if ( + // - request’s current URL’s origin is same origin with request’s origin, + // and request’s response tainting is "basic" + sameOrigin(currentURL, request2.url) && request2.responseTainting === "basic" || // request’s current URL’s scheme is "data" + currentURL.protocol === "data:" || // - request’s mode is "navigate" or "websocket" + (request2.mode === "navigate" || request2.mode === "websocket") + ) { + request2.responseTainting = "basic"; + return await schemeFetch(fetchParams); + } + if (request2.mode === "same-origin") { + return makeNetworkError('request mode cannot be "same-origin"'); + } + if (request2.mode === "no-cors") { + if (request2.redirect !== "follow") { + return makeNetworkError( + 'redirect mode cannot be "follow" for "no-cors" request' + ); + } + request2.responseTainting = "opaque"; + return await schemeFetch(fetchParams); + } + if (!urlIsHttpHttpsScheme(requestCurrentURL(request2))) { + return makeNetworkError("URL scheme must be a HTTP(S) scheme"); + } + request2.responseTainting = "cors"; + return await httpFetch(fetchParams); + })(); + } + if (recursive) { + return response2; + } + if (response2.status !== 0 && !response2.internalResponse) { + if (request2.responseTainting === "cors") ; + if (request2.responseTainting === "basic") { + response2 = filterResponse(response2, "basic"); + } else if (request2.responseTainting === "cors") { + response2 = filterResponse(response2, "cors"); + } else if (request2.responseTainting === "opaque") { + response2 = filterResponse(response2, "opaque"); + } else { + assert2(false); + } + } + let internalResponse = response2.status === 0 ? response2 : response2.internalResponse; + if (internalResponse.urlList.length === 0) { + internalResponse.urlList.push(...request2.urlList); + } + if (!request2.timingAllowFailed) { + response2.timingAllowPassed = true; + } + if (response2.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request2.headers.contains("range")) { + response2 = internalResponse = makeNetworkError(); + } + if (response2.status !== 0 && (request2.method === "HEAD" || request2.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { + internalResponse.body = null; + fetchParams.controller.dump = true; + } + if (request2.integrity) { + const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason)); + if (request2.responseTainting === "opaque" || response2.body == null) { + processBodyError(response2.error); + return; + } + const processBody = (bytes) => { + if (!bytesMatch(bytes, request2.integrity)) { + processBodyError("integrity mismatch"); + return; + } + response2.body = safelyExtractBody(bytes)[0]; + fetchFinale(fetchParams, response2); + }; + await fullyReadBody(response2.body, processBody, processBodyError); + } else { + fetchFinale(fetchParams, response2); + } + } + function schemeFetch(fetchParams) { + if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { + return Promise.resolve(makeAppropriateNetworkError(fetchParams)); + } + const { request: request2 } = fetchParams; + const { protocol: scheme } = requestCurrentURL(request2); + switch (scheme) { + case "about:": { + return Promise.resolve(makeNetworkError("about scheme is not supported")); + } + case "blob:": { + if (!resolveObjectURL) { + resolveObjectURL = require$$7.resolveObjectURL; + } + const blobURLEntry = requestCurrentURL(request2); + if (blobURLEntry.search.length !== 0) { + return Promise.resolve(makeNetworkError("NetworkError when attempting to fetch resource.")); + } + const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()); + if (request2.method !== "GET" || !isBlobLike2(blobURLEntryObject)) { + return Promise.resolve(makeNetworkError("invalid method")); + } + const bodyWithType = safelyExtractBody(blobURLEntryObject); + const body2 = bodyWithType[0]; + const length = isomorphicEncode(`${body2.length}`); + const type = bodyWithType[1] ?? ""; + const response2 = makeResponse({ + statusText: "OK", + headersList: [ + ["content-length", { name: "Content-Length", value: length }], + ["content-type", { name: "Content-Type", value: type }] + ] + }); + response2.body = body2; + return Promise.resolve(response2); + } + case "data:": { + const currentURL = requestCurrentURL(request2); + const dataURLStruct = dataURLProcessor(currentURL); + if (dataURLStruct === "failure") { + return Promise.resolve(makeNetworkError("failed to fetch the data URL")); + } + const mimeType = serializeAMimeType(dataURLStruct.mimeType); + return Promise.resolve(makeResponse({ + statusText: "OK", + headersList: [ + ["content-type", { name: "Content-Type", value: mimeType }] + ], + body: safelyExtractBody(dataURLStruct.body)[0] + })); + } + case "file:": { + return Promise.resolve(makeNetworkError("not implemented... yet...")); + } + case "http:": + case "https:": { + return httpFetch(fetchParams).catch((err) => makeNetworkError(err)); + } + default: { + return Promise.resolve(makeNetworkError("unknown scheme")); + } + } + } + function finalizeResponse(fetchParams, response2) { + fetchParams.request.done = true; + if (fetchParams.processResponseDone != null) { + queueMicrotask(() => fetchParams.processResponseDone(response2)); + } + } + function fetchFinale(fetchParams, response2) { + if (response2.type === "error") { + response2.urlList = [fetchParams.request.urlList[0]]; + response2.timingInfo = createOpaqueTimingInfo({ + startTime: fetchParams.timingInfo.startTime + }); + } + const processResponseEndOfBody = () => { + fetchParams.request.done = true; + if (fetchParams.processResponseEndOfBody != null) { + queueMicrotask(() => fetchParams.processResponseEndOfBody(response2)); + } + }; + if (fetchParams.processResponse != null) { + queueMicrotask(() => fetchParams.processResponse(response2)); + } + if (response2.body == null) { + processResponseEndOfBody(); + } else { + const identityTransformAlgorithm = (chunk, controller) => { + controller.enqueue(chunk); + }; + const transformStream = new TransformStream({ + start() { + }, + transform: identityTransformAlgorithm, + flush: processResponseEndOfBody + }, { + size() { + return 1; + } + }, { + size() { + return 1; + } + }); + response2.body = { stream: response2.body.stream.pipeThrough(transformStream) }; + } + if (fetchParams.processResponseConsumeBody != null) { + const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response2, nullOrBytes); + const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response2, failure); + if (response2.body == null) { + queueMicrotask(() => processBody(null)); + } else { + return fullyReadBody(response2.body, processBody, processBodyError); + } + return Promise.resolve(); + } + } + async function httpFetch(fetchParams) { + const request2 = fetchParams.request; + let response2 = null; + let actualResponse = null; + const timingInfo = fetchParams.timingInfo; + if (request2.serviceWorkers === "all") ; + if (response2 === null) { + if (request2.redirect === "follow") { + request2.serviceWorkers = "none"; + } + actualResponse = response2 = await httpNetworkOrCacheFetch(fetchParams); + if (request2.responseTainting === "cors" && corsCheck(request2, response2) === "failure") { + return makeNetworkError("cors failure"); + } + if (TAOCheck(request2, response2) === "failure") { + request2.timingAllowFailed = true; + } + } + if ((request2.responseTainting === "opaque" || response2.type === "opaque") && crossOriginResourcePolicyCheck( + request2.origin, + request2.client, + request2.destination, + actualResponse + ) === "blocked") { + return makeNetworkError("blocked"); + } + if (redirectStatusSet.has(actualResponse.status)) { + if (request2.redirect !== "manual") { + fetchParams.controller.connection.destroy(); + } + if (request2.redirect === "error") { + response2 = makeNetworkError("unexpected redirect"); + } else if (request2.redirect === "manual") { + response2 = actualResponse; + } else if (request2.redirect === "follow") { + response2 = await httpRedirectFetch(fetchParams, response2); + } else { + assert2(false); + } + } + response2.timingInfo = timingInfo; + return response2; + } + function httpRedirectFetch(fetchParams, response2) { + const request2 = fetchParams.request; + const actualResponse = response2.internalResponse ? response2.internalResponse : response2; + let locationURL; + try { + locationURL = responseLocationURL( + actualResponse, + requestCurrentURL(request2).hash + ); + if (locationURL == null) { + return response2; + } + } catch (err) { + return Promise.resolve(makeNetworkError(err)); + } + if (!urlIsHttpHttpsScheme(locationURL)) { + return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme")); + } + if (request2.redirectCount === 20) { + return Promise.resolve(makeNetworkError("redirect count exceeded")); + } + request2.redirectCount += 1; + if (request2.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request2, locationURL)) { + return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')); + } + if (request2.responseTainting === "cors" && (locationURL.username || locationURL.password)) { + return Promise.resolve(makeNetworkError( + 'URL cannot contain credentials for request mode "cors"' + )); + } + if (actualResponse.status !== 303 && request2.body != null && request2.body.source == null) { + return Promise.resolve(makeNetworkError()); + } + if ([301, 302].includes(actualResponse.status) && request2.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request2.method)) { + request2.method = "GET"; + request2.body = null; + for (const headerName of requestBodyHeader) { + request2.headersList.delete(headerName); + } + } + if (!sameOrigin(requestCurrentURL(request2), locationURL)) { + request2.headersList.delete("authorization"); + request2.headersList.delete("proxy-authorization", true); + request2.headersList.delete("cookie"); + request2.headersList.delete("host"); + } + if (request2.body != null) { + assert2(request2.body.source != null); + request2.body = safelyExtractBody(request2.body.source)[0]; + } + const timingInfo = fetchParams.timingInfo; + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); + if (timingInfo.redirectStartTime === 0) { + timingInfo.redirectStartTime = timingInfo.startTime; + } + request2.urlList.push(locationURL); + setRequestReferrerPolicyOnRedirect(request2, actualResponse); + return mainFetch(fetchParams, true); + } + async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) { + const request2 = fetchParams.request; + let httpFetchParams = null; + let httpRequest = null; + let response2 = null; + if (request2.window === "no-window" && request2.redirect === "error") { + httpFetchParams = fetchParams; + httpRequest = request2; + } else { + httpRequest = makeRequest(request2); + httpFetchParams = { ...fetchParams }; + httpFetchParams.request = httpRequest; + } + const includeCredentials = request2.credentials === "include" || request2.credentials === "same-origin" && request2.responseTainting === "basic"; + const contentLength = httpRequest.body ? httpRequest.body.length : null; + let contentLengthHeaderValue = null; + if (httpRequest.body == null && ["POST", "PUT"].includes(httpRequest.method)) { + contentLengthHeaderValue = "0"; + } + if (contentLength != null) { + contentLengthHeaderValue = isomorphicEncode(`${contentLength}`); + } + if (contentLengthHeaderValue != null) { + httpRequest.headersList.append("content-length", contentLengthHeaderValue); + } + if (contentLength != null && httpRequest.keepalive) ; + if (httpRequest.referrer instanceof URL) { + httpRequest.headersList.append("referer", isomorphicEncode(httpRequest.referrer.href)); + } + appendRequestOriginHeader(httpRequest); + appendFetchMetadata(httpRequest); + if (!httpRequest.headersList.contains("user-agent")) { + httpRequest.headersList.append("user-agent", typeof esbuildDetection === "undefined" ? "undici" : "node"); + } + if (httpRequest.cache === "default" && (httpRequest.headersList.contains("if-modified-since") || httpRequest.headersList.contains("if-none-match") || httpRequest.headersList.contains("if-unmodified-since") || httpRequest.headersList.contains("if-match") || httpRequest.headersList.contains("if-range"))) { + httpRequest.cache = "no-store"; + } + if (httpRequest.cache === "no-cache" && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.contains("cache-control")) { + httpRequest.headersList.append("cache-control", "max-age=0"); + } + if (httpRequest.cache === "no-store" || httpRequest.cache === "reload") { + if (!httpRequest.headersList.contains("pragma")) { + httpRequest.headersList.append("pragma", "no-cache"); + } + if (!httpRequest.headersList.contains("cache-control")) { + httpRequest.headersList.append("cache-control", "no-cache"); + } + } + if (httpRequest.headersList.contains("range")) { + httpRequest.headersList.append("accept-encoding", "identity"); + } + if (!httpRequest.headersList.contains("accept-encoding")) { + if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { + httpRequest.headersList.append("accept-encoding", "br, gzip, deflate"); + } else { + httpRequest.headersList.append("accept-encoding", "gzip, deflate"); + } + } + httpRequest.headersList.delete("host"); + { + httpRequest.cache = "no-store"; + } + if (httpRequest.mode !== "no-store" && httpRequest.mode !== "reload") ; + if (response2 == null) { + if (httpRequest.mode === "only-if-cached") { + return makeNetworkError("only if cached"); + } + const forwardResponse = await httpNetworkFetch( + httpFetchParams, + includeCredentials, + isNewConnectionFetch + ); + if (!safeMethodsSet.has(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) ; + if (response2 == null) { + response2 = forwardResponse; + } + } + response2.urlList = [...httpRequest.urlList]; + if (httpRequest.headersList.contains("range")) { + response2.rangeRequested = true; + } + response2.requestIncludesCredentials = includeCredentials; + if (response2.status === 407) { + if (request2.window === "no-window") { + return makeNetworkError(); + } + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams); + } + return makeNetworkError("proxy authentication required"); + } + if ( + // response’s status is 421 + response2.status === 421 && // isNewConnectionFetch is false + !isNewConnectionFetch && // request’s body is null, or request’s body is non-null and request’s body’s source is non-null + (request2.body == null || request2.body.source != null) + ) { + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams); + } + fetchParams.controller.connection.destroy(); + response2 = await httpNetworkOrCacheFetch( + fetchParams, + isAuthenticationFetch, + true + ); + } + return response2; + } + async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { + assert2(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); + fetchParams.controller.connection = { + abort: null, + destroyed: false, + destroy(err) { + var _a2; + if (!this.destroyed) { + this.destroyed = true; + (_a2 = this.abort) == null ? void 0 : _a2.call(this, err ?? new DOMException2("The operation was aborted.", "AbortError")); + } + } + }; + const request2 = fetchParams.request; + let response2 = null; + const timingInfo = fetchParams.timingInfo; + { + request2.cache = "no-store"; + } + if (request2.mode === "websocket") ; + let requestBody = null; + if (request2.body == null && fetchParams.processRequestEndOfBody) { + queueMicrotask(() => fetchParams.processRequestEndOfBody()); + } else if (request2.body != null) { + const processBodyChunk = async function* (bytes) { + var _a2; + if (isCancelled(fetchParams)) { + return; + } + yield bytes; + (_a2 = fetchParams.processRequestBodyChunkLength) == null ? void 0 : _a2.call(fetchParams, bytes.byteLength); + }; + const processEndOfBody = () => { + if (isCancelled(fetchParams)) { + return; + } + if (fetchParams.processRequestEndOfBody) { + fetchParams.processRequestEndOfBody(); + } + }; + const processBodyError = (e) => { + if (isCancelled(fetchParams)) { + return; + } + if (e.name === "AbortError") { + fetchParams.controller.abort(); + } else { + fetchParams.controller.terminate(e); + } + }; + requestBody = async function* () { + try { + for await (const bytes of request2.body.stream) { + yield* processBodyChunk(bytes); + } + processEndOfBody(); + } catch (err) { + processBodyError(err); + } + }(); + } + try { + const { body: body2, status, statusText, headersList, socket } = await dispatch({ body: requestBody }); + if (socket) { + response2 = makeResponse({ status, statusText, headersList, socket }); + } else { + const iterator2 = body2[Symbol.asyncIterator](); + fetchParams.controller.next = () => iterator2.next(); + response2 = makeResponse({ status, statusText, headersList }); + } + } catch (err) { + if (err.name === "AbortError") { + fetchParams.controller.connection.destroy(); + return makeAppropriateNetworkError(fetchParams, err); + } + return makeNetworkError(err); + } + const pullAlgorithm = () => { + fetchParams.controller.resume(); + }; + const cancelAlgorithm = (reason) => { + fetchParams.controller.abort(reason); + }; + if (!ReadableStream2) { + ReadableStream2 = require$$13.ReadableStream; + } + const stream2 = new ReadableStream2( + { + async start(controller) { + fetchParams.controller.controller = controller; + }, + async pull(controller) { + await pullAlgorithm(); + }, + async cancel(reason) { + await cancelAlgorithm(reason); + } + }, + { + highWaterMark: 0, + size() { + return 1; + } + } + ); + response2.body = { stream: stream2 }; + fetchParams.controller.on("terminated", onAborted); + fetchParams.controller.resume = async () => { + while (true) { + let bytes; + let isFailure; + try { + const { done, value } = await fetchParams.controller.next(); + if (isAborted(fetchParams)) { + break; + } + bytes = done ? void 0 : value; + } catch (err) { + if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { + bytes = void 0; + } else { + bytes = err; + isFailure = true; + } + } + if (bytes === void 0) { + readableStreamClose(fetchParams.controller.controller); + finalizeResponse(fetchParams, response2); + return; + } + timingInfo.decodedBodySize += (bytes == null ? void 0 : bytes.byteLength) ?? 0; + if (isFailure) { + fetchParams.controller.terminate(bytes); + return; + } + fetchParams.controller.controller.enqueue(new Uint8Array(bytes)); + if (isErrored2(stream2)) { + fetchParams.controller.terminate(); + return; + } + if (!fetchParams.controller.controller.desiredSize) { + return; + } + } + }; + function onAborted(reason) { + if (isAborted(fetchParams)) { + response2.aborted = true; + if (isReadable2(stream2)) { + fetchParams.controller.controller.error( + fetchParams.controller.serializedAbortReason + ); + } + } else { + if (isReadable2(stream2)) { + fetchParams.controller.controller.error(new TypeError("terminated", { + cause: isErrorLike(reason) ? reason : void 0 + })); + } + } + fetchParams.controller.connection.destroy(); + } + return response2; + async function dispatch({ body: body2 }) { + const url = requestCurrentURL(request2); + const agent2 = fetchParams.controller.dispatcher; + return new Promise((resolve, reject) => agent2.dispatch( + { + path: url.pathname + url.search, + origin: url.origin, + method: request2.method, + body: fetchParams.controller.dispatcher.isMockActive ? request2.body && (request2.body.source || request2.body.stream) : body2, + headers: request2.headersList.entries, + maxRedirections: 0, + upgrade: request2.mode === "websocket" ? "websocket" : void 0 + }, + { + body: null, + abort: null, + onConnect(abort2) { + const { connection: connection2 } = fetchParams.controller; + if (connection2.destroyed) { + abort2(new DOMException2("The operation was aborted.", "AbortError")); + } else { + fetchParams.controller.on("terminated", abort2); + this.abort = connection2.abort = abort2; + } + }, + onHeaders(status, headersList, resume2, statusText) { + if (status < 200) { + return; + } + let codings = []; + let location = ""; + const headers2 = new Headers2(); + if (Array.isArray(headersList)) { + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); + if (key.toLowerCase() === "content-encoding") { + codings = val.toLowerCase().split(",").map((x) => x.trim()); + } else if (key.toLowerCase() === "location") { + location = val; + } + headers2[kHeadersList].append(key, val); + } + } else { + const keys = Object.keys(headersList); + for (const key of keys) { + const val = headersList[key]; + if (key.toLowerCase() === "content-encoding") { + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); + } else if (key.toLowerCase() === "location") { + location = val; + } + headers2[kHeadersList].append(key, val); + } + } + this.body = new Readable2({ read: resume2 }); + const decoders = []; + const willFollow = request2.redirect === "follow" && location && redirectStatusSet.has(status); + if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { + for (const coding of codings) { + if (coding === "x-gzip" || coding === "gzip") { + decoders.push(zlib2.createGunzip({ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + flush: zlib2.constants.Z_SYNC_FLUSH, + finishFlush: zlib2.constants.Z_SYNC_FLUSH + })); + } else if (coding === "deflate") { + decoders.push(zlib2.createInflate()); + } else if (coding === "br") { + decoders.push(zlib2.createBrotliDecompress()); + } else { + decoders.length = 0; + break; + } + } + } + resolve({ + status, + statusText, + headersList: headers2[kHeadersList], + body: decoders.length ? pipeline2(this.body, ...decoders, () => { + }) : this.body.on("error", () => { + }) + }); + return true; + }, + onData(chunk) { + if (fetchParams.controller.dump) { + return; + } + const bytes = chunk; + timingInfo.encodedBodySize += bytes.byteLength; + return this.body.push(bytes); + }, + onComplete() { + if (this.abort) { + fetchParams.controller.off("terminated", this.abort); + } + fetchParams.controller.ended = true; + this.body.push(null); + }, + onError(error2) { + var _a2; + if (this.abort) { + fetchParams.controller.off("terminated", this.abort); + } + (_a2 = this.body) == null ? void 0 : _a2.destroy(error2); + fetchParams.controller.terminate(error2); + reject(error2); + }, + onUpgrade(status, headersList, socket) { + if (status !== 101) { + return; + } + const headers2 = new Headers2(); + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); + headers2[kHeadersList].append(key, val); + } + resolve({ + status, + statusText: STATUS_CODES2[status], + headersList: headers2[kHeadersList], + socket + }); + return true; + } + } + )); + } + } + fetch_1 = { + fetch, + Fetch, + fetching, + finalizeAndReportTiming + }; + return fetch_1; +} +var symbols$2; +var hasRequiredSymbols$2; +function requireSymbols$2() { + if (hasRequiredSymbols$2) return symbols$2; + hasRequiredSymbols$2 = 1; + symbols$2 = { + 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") + }; + return symbols$2; +} +var progressevent; +var hasRequiredProgressevent; +function requireProgressevent() { + if (hasRequiredProgressevent) return progressevent; + hasRequiredProgressevent = 1; + const { webidl } = requireWebidl(); + const kState = Symbol("ProgressEvent state"); + class ProgressEvent extends Event { + constructor(type, eventInitDict = {}) { + type = webidl.converters.DOMString(type); + eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}); + super(type, eventInitDict); + this[kState] = { + lengthComputable: eventInitDict.lengthComputable, + loaded: eventInitDict.loaded, + total: eventInitDict.total + }; + } + get lengthComputable() { + webidl.brandCheck(this, ProgressEvent); + return this[kState].lengthComputable; + } + get loaded() { + webidl.brandCheck(this, ProgressEvent); + return this[kState].loaded; + } + get total() { + webidl.brandCheck(this, ProgressEvent); + return this[kState].total; + } + } + webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ + { + key: "lengthComputable", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "loaded", + converter: webidl.converters["unsigned long long"], + defaultValue: 0 + }, + { + key: "total", + converter: webidl.converters["unsigned long long"], + defaultValue: 0 + }, + { + key: "bubbles", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "cancelable", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "composed", + converter: webidl.converters.boolean, + defaultValue: false + } + ]); + progressevent = { + ProgressEvent + }; + return progressevent; +} +var encoding; +var hasRequiredEncoding; +function requireEncoding() { + if (hasRequiredEncoding) return encoding; + hasRequiredEncoding = 1; + function getEncoding(label) { + if (!label) { + return "failure"; + } + switch (label.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"; + } + } + encoding = { + getEncoding + }; + return encoding; +} +var util$6; +var hasRequiredUtil$3; +function requireUtil$3() { + if (hasRequiredUtil$3) return util$6; + hasRequiredUtil$3 = 1; + const { + kState, + kError: kError2, + kResult, + kAborted, + kLastProgressEventFired + } = requireSymbols$2(); + const { ProgressEvent } = requireProgressevent(); + const { getEncoding } = requireEncoding(); + const { DOMException: DOMException2 } = requireConstants$3(); + const { serializeAMimeType, parseMIMEType } = requireDataURL(); + const { types: types2 } = require$$0$3; + const { StringDecoder } = require$$2$4; + const { btoa } = require$$7; + const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false + }; + function readOperation(fr, blob, type, encodingName) { + if (fr[kState] === "loading") { + throw new DOMException2("Invalid state", "InvalidStateError"); + } + fr[kState] = "loading"; + fr[kResult] = null; + fr[kError2] = null; + const stream2 = blob.stream(); + const reader2 = stream2.getReader(); + const bytes = []; + let chunkPromise = reader2.read(); + let isFirstChunk = true; + (async () => { + while (!fr[kAborted]) { + try { + const { done, value } = await chunkPromise; + if (isFirstChunk && !fr[kAborted]) { + queueMicrotask(() => { + fireAProgressEvent("loadstart", fr); + }); + } + isFirstChunk = false; + if (!done && types2.isUint8Array(value)) { + bytes.push(value); + if ((fr[kLastProgressEventFired] === void 0 || Date.now() - fr[kLastProgressEventFired] >= 50) && !fr[kAborted]) { + fr[kLastProgressEventFired] = Date.now(); + queueMicrotask(() => { + fireAProgressEvent("progress", fr); + }); + } + chunkPromise = reader2.read(); + } else if (done) { + queueMicrotask(() => { + fr[kState] = "done"; + try { + const result = packageData(bytes, type, blob.type, encodingName); + if (fr[kAborted]) { + return; + } + fr[kResult] = result; + fireAProgressEvent("load", fr); + } catch (error2) { + fr[kError2] = error2; + fireAProgressEvent("error", fr); + } + if (fr[kState] !== "loading") { + fireAProgressEvent("loadend", fr); + } + }); + break; + } + } catch (error2) { + if (fr[kAborted]) { + return; + } + queueMicrotask(() => { + fr[kState] = "done"; + fr[kError2] = error2; + fireAProgressEvent("error", fr); + if (fr[kState] !== "loading") { + fireAProgressEvent("loadend", fr); + } + }); + break; + } + } + })(); + } + function fireAProgressEvent(e, reader2) { + const event = new ProgressEvent(e, { + bubbles: false, + cancelable: false + }); + reader2.dispatchEvent(event); + } + function packageData(bytes, type, mimeType, encodingName) { + switch (type) { + case "DataURL": { + let dataURL2 = "data:"; + const parsed = parseMIMEType(mimeType || "application/octet-stream"); + if (parsed !== "failure") { + dataURL2 += serializeAMimeType(parsed); + } + dataURL2 += ";base64,"; + const decoder = new StringDecoder("latin1"); + for (const chunk of bytes) { + dataURL2 += btoa(decoder.write(chunk)); + } + dataURL2 += btoa(decoder.end()); + return dataURL2; + } + case "Text": { + let encoding2 = "failure"; + if (encodingName) { + encoding2 = getEncoding(encodingName); + } + if (encoding2 === "failure" && mimeType) { + const type2 = parseMIMEType(mimeType); + if (type2 !== "failure") { + encoding2 = getEncoding(type2.parameters.get("charset")); + } + } + if (encoding2 === "failure") { + encoding2 = "UTF-8"; + } + return decode(bytes, encoding2); + } + case "ArrayBuffer": { + const sequence = combineByteSequences(bytes); + return sequence.buffer; + } + case "BinaryString": { + let binaryString = ""; + const decoder = new StringDecoder("latin1"); + for (const chunk of bytes) { + binaryString += decoder.write(chunk); + } + binaryString += decoder.end(); + return binaryString; + } + } + } + function decode(ioQueue, encoding2) { + const bytes = combineByteSequences(ioQueue); + const BOMEncoding = BOMSniffing(bytes); + let slice2 = 0; + if (BOMEncoding !== null) { + encoding2 = BOMEncoding; + slice2 = BOMEncoding === "UTF-8" ? 3 : 2; + } + const sliced = bytes.slice(slice2); + return new TextDecoder(encoding2).decode(sliced); + } + function BOMSniffing(ioQueue) { + const [a, b, c] = ioQueue; + if (a === 239 && b === 187 && c === 191) { + return "UTF-8"; + } else if (a === 254 && b === 255) { + return "UTF-16BE"; + } else if (a === 255 && b === 254) { + return "UTF-16LE"; + } + return null; + } + function combineByteSequences(sequences) { + const size = sequences.reduce((a, b) => { + return a + b.byteLength; + }, 0); + let offset = 0; + return sequences.reduce((a, b) => { + a.set(b, offset); + offset += b.byteLength; + return a; + }, new Uint8Array(size)); + } + util$6 = { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent + }; + return util$6; +} +var filereader; +var hasRequiredFilereader; +function requireFilereader() { + if (hasRequiredFilereader) return filereader; + hasRequiredFilereader = 1; + const { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent + } = requireUtil$3(); + const { + kState, + kError: kError2, + kResult, + kEvents, + kAborted + } = requireSymbols$2(); + const { webidl } = requireWebidl(); + const { kEnumerableProperty: kEnumerableProperty2 } = util$l; + class FileReader extends EventTarget { + constructor() { + super(); + this[kState] = "empty"; + this[kResult] = null; + this[kError2] = null; + this[kEvents] = { + loadend: null, + error: null, + abort: null, + load: null, + progress: null, + loadstart: null + }; + } + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer + * @param {import('buffer').Blob} blob + */ + readAsArrayBuffer(blob) { + webidl.brandCheck(this, FileReader); + webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsArrayBuffer" }); + blob = webidl.converters.Blob(blob, { strict: false }); + readOperation(this, blob, "ArrayBuffer"); + } + /** + * @see https://w3c.github.io/FileAPI/#readAsBinaryString + * @param {import('buffer').Blob} blob + */ + readAsBinaryString(blob) { + webidl.brandCheck(this, FileReader); + webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsBinaryString" }); + blob = webidl.converters.Blob(blob, { strict: false }); + readOperation(this, blob, "BinaryString"); + } + /** + * @see https://w3c.github.io/FileAPI/#readAsDataText + * @param {import('buffer').Blob} blob + * @param {string?} encoding + */ + readAsText(blob, encoding2 = void 0) { + webidl.brandCheck(this, FileReader); + webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsText" }); + blob = webidl.converters.Blob(blob, { strict: false }); + if (encoding2 !== void 0) { + encoding2 = webidl.converters.DOMString(encoding2); + } + readOperation(this, blob, "Text", encoding2); + } + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL + * @param {import('buffer').Blob} blob + */ + readAsDataURL(blob) { + webidl.brandCheck(this, FileReader); + webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsDataURL" }); + blob = webidl.converters.Blob(blob, { strict: false }); + readOperation(this, blob, "DataURL"); + } + /** + * @see https://w3c.github.io/FileAPI/#dfn-abort + */ + abort() { + if (this[kState] === "empty" || this[kState] === "done") { + this[kResult] = null; + return; + } + if (this[kState] === "loading") { + this[kState] = "done"; + this[kResult] = null; + } + this[kAborted] = true; + fireAProgressEvent("abort", this); + if (this[kState] !== "loading") { + fireAProgressEvent("loadend", this); + } + } + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate + */ + get readyState() { + webidl.brandCheck(this, FileReader); + switch (this[kState]) { + case "empty": + return this.EMPTY; + case "loading": + return this.LOADING; + case "done": + return this.DONE; + } + } + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-result + */ + get result() { + webidl.brandCheck(this, FileReader); + return this[kResult]; + } + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-error + */ + get error() { + webidl.brandCheck(this, FileReader); + return this[kError2]; + } + get onloadend() { + webidl.brandCheck(this, FileReader); + return this[kEvents].loadend; + } + set onloadend(fn) { + webidl.brandCheck(this, FileReader); + if (this[kEvents].loadend) { + this.removeEventListener("loadend", this[kEvents].loadend); + } + if (typeof fn === "function") { + this[kEvents].loadend = fn; + this.addEventListener("loadend", fn); + } else { + this[kEvents].loadend = null; + } + } + get onerror() { + webidl.brandCheck(this, FileReader); + return this[kEvents].error; + } + set onerror(fn) { + webidl.brandCheck(this, FileReader); + if (this[kEvents].error) { + this.removeEventListener("error", this[kEvents].error); + } + if (typeof fn === "function") { + this[kEvents].error = fn; + this.addEventListener("error", fn); + } else { + this[kEvents].error = null; + } + } + get onloadstart() { + webidl.brandCheck(this, FileReader); + return this[kEvents].loadstart; + } + set onloadstart(fn) { + webidl.brandCheck(this, FileReader); + if (this[kEvents].loadstart) { + this.removeEventListener("loadstart", this[kEvents].loadstart); + } + if (typeof fn === "function") { + this[kEvents].loadstart = fn; + this.addEventListener("loadstart", fn); + } else { + this[kEvents].loadstart = null; + } + } + get onprogress() { + webidl.brandCheck(this, FileReader); + return this[kEvents].progress; + } + set onprogress(fn) { + webidl.brandCheck(this, FileReader); + if (this[kEvents].progress) { + this.removeEventListener("progress", this[kEvents].progress); + } + if (typeof fn === "function") { + this[kEvents].progress = fn; + this.addEventListener("progress", fn); + } else { + this[kEvents].progress = null; + } + } + get onload() { + webidl.brandCheck(this, FileReader); + return this[kEvents].load; + } + set onload(fn) { + webidl.brandCheck(this, FileReader); + if (this[kEvents].load) { + this.removeEventListener("load", this[kEvents].load); + } + if (typeof fn === "function") { + this[kEvents].load = fn; + this.addEventListener("load", fn); + } else { + this[kEvents].load = null; + } + } + get onabort() { + webidl.brandCheck(this, FileReader); + return this[kEvents].abort; + } + set onabort(fn) { + webidl.brandCheck(this, FileReader); + if (this[kEvents].abort) { + this.removeEventListener("abort", this[kEvents].abort); + } + if (typeof fn === "function") { + this[kEvents].abort = fn; + this.addEventListener("abort", fn); + } else { + this[kEvents].abort = null; + } + } + } + FileReader.EMPTY = FileReader.prototype.EMPTY = 0; + FileReader.LOADING = FileReader.prototype.LOADING = 1; + FileReader.DONE = FileReader.prototype.DONE = 2; + Object.defineProperties(FileReader.prototype, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors, + readAsArrayBuffer: kEnumerableProperty2, + readAsBinaryString: kEnumerableProperty2, + readAsText: kEnumerableProperty2, + readAsDataURL: kEnumerableProperty2, + abort: kEnumerableProperty2, + readyState: kEnumerableProperty2, + result: kEnumerableProperty2, + error: kEnumerableProperty2, + onloadstart: kEnumerableProperty2, + onprogress: kEnumerableProperty2, + onload: kEnumerableProperty2, + onabort: kEnumerableProperty2, + onerror: kEnumerableProperty2, + onloadend: kEnumerableProperty2, + [Symbol.toStringTag]: { + value: "FileReader", + writable: false, + enumerable: false, + configurable: true + } + }); + Object.defineProperties(FileReader, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors + }); + filereader = { + FileReader + }; + return filereader; +} +var symbols$1; +var hasRequiredSymbols$1; +function requireSymbols$1() { + if (hasRequiredSymbols$1) return symbols$1; + hasRequiredSymbols$1 = 1; + symbols$1 = { + kConstruct: symbols$4.kConstruct + }; + return symbols$1; +} +var util$5; +var hasRequiredUtil$2; +function requireUtil$2() { + if (hasRequiredUtil$2) return util$5; + hasRequiredUtil$2 = 1; + const assert2 = require$$0$4; + const { URLSerializer } = requireDataURL(); + const { isValidHeaderName } = requireUtil$4(); + function urlEquals(A, B, excludeFragment = false) { + const serializedA = URLSerializer(A, excludeFragment); + const serializedB = URLSerializer(B, excludeFragment); + return serializedA === serializedB; + } + function fieldValues(header2) { + assert2(header2 !== null); + const values = []; + for (let value of header2.split(",")) { + value = value.trim(); + if (!value.length) { + continue; + } else if (!isValidHeaderName(value)) { + continue; + } + values.push(value); + } + return values; + } + util$5 = { + urlEquals, + fieldValues + }; + return util$5; +} +var cache; +var hasRequiredCache; +function requireCache() { + var _relevantRequestResponseList, _Cache_instances, batchCacheOperations_fn, queryCache_fn, requestMatchesCachedItem_fn; + if (hasRequiredCache) return cache; + hasRequiredCache = 1; + const { kConstruct } = requireSymbols$1(); + const { urlEquals, fieldValues: getFieldValues } = requireUtil$2(); + const { kEnumerableProperty: kEnumerableProperty2, isDisturbed: isDisturbed2 } = util$l; + const { kHeadersList } = symbols$4; + const { webidl } = requireWebidl(); + const { Response, cloneResponse } = requireResponse(); + const { Request: Request3 } = requireRequest(); + const { kState, kHeaders, kGuard, kRealm } = requireSymbols$3(); + const { fetching } = requireFetch(); + const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = requireUtil$4(); + const assert2 = require$$0$4; + const { getGlobalDispatcher: getGlobalDispatcher2 } = global$1; + const _Cache = class _Cache { + constructor() { + __privateAdd(this, _Cache_instances); + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list + * @type {requestResponseList} + */ + __privateAdd(this, _relevantRequestResponseList); + if (arguments[0] !== kConstruct) { + webidl.illegalConstructor(); + } + __privateSet(this, _relevantRequestResponseList, arguments[1]); + } + async match(request2, options2 = {}) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 1, { header: "Cache.match" }); + request2 = webidl.converters.RequestInfo(request2); + options2 = webidl.converters.CacheQueryOptions(options2); + const p = await this.matchAll(request2, options2); + if (p.length === 0) { + return; + } + return p[0]; + } + async matchAll(request2 = void 0, options2 = {}) { + var _a2; + webidl.brandCheck(this, _Cache); + if (request2 !== void 0) request2 = webidl.converters.RequestInfo(request2); + options2 = webidl.converters.CacheQueryOptions(options2); + let r = null; + if (request2 !== void 0) { + if (request2 instanceof Request3) { + r = request2[kState]; + if (r.method !== "GET" && !options2.ignoreMethod) { + return []; + } + } else if (typeof request2 === "string") { + r = new Request3(request2)[kState]; + } + } + const responses = []; + if (request2 === void 0) { + for (const requestResponse of __privateGet(this, _relevantRequestResponseList)) { + responses.push(requestResponse[1]); + } + } else { + const requestResponses = __privateMethod(this, _Cache_instances, queryCache_fn).call(this, r, options2); + for (const requestResponse of requestResponses) { + responses.push(requestResponse[1]); + } + } + const responseList = []; + for (const response2 of responses) { + const responseObject = new Response(((_a2 = response2.body) == null ? void 0 : _a2.source) ?? null); + const body2 = responseObject[kState].body; + responseObject[kState] = response2; + responseObject[kState].body = body2; + responseObject[kHeaders][kHeadersList] = response2.headersList; + responseObject[kHeaders][kGuard] = "immutable"; + responseList.push(responseObject); + } + return Object.freeze(responseList); + } + async add(request2) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 1, { header: "Cache.add" }); + request2 = webidl.converters.RequestInfo(request2); + const requests = [request2]; + const responseArrayPromise = this.addAll(requests); + return await responseArrayPromise; + } + async addAll(requests) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 1, { header: "Cache.addAll" }); + requests = webidl.converters["sequence"](requests); + const responsePromises = []; + const requestList = []; + for (const request2 of requests) { + if (typeof request2 === "string") { + continue; + } + const r = request2[kState]; + if (!urlIsHttpHttpsScheme(r.url) || r.method !== "GET") { + throw webidl.errors.exception({ + header: "Cache.addAll", + message: "Expected http/s scheme when method is not GET." + }); + } + } + const fetchControllers = []; + for (const request2 of requests) { + const r = new Request3(request2)[kState]; + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: "Cache.addAll", + message: "Expected http/s scheme." + }); + } + r.initiator = "fetch"; + r.destination = "subresource"; + requestList.push(r); + const responsePromise = createDeferredPromise(); + fetchControllers.push(fetching({ + request: r, + dispatcher: getGlobalDispatcher2(), + processResponse(response2) { + if (response2.type === "error" || response2.status === 206 || response2.status < 200 || response2.status > 299) { + responsePromise.reject(webidl.errors.exception({ + header: "Cache.addAll", + message: "Received an invalid status code or the request failed." + })); + } else if (response2.headersList.contains("vary")) { + const fieldValues = getFieldValues(response2.headersList.get("vary")); + for (const fieldValue of fieldValues) { + if (fieldValue === "*") { + responsePromise.reject(webidl.errors.exception({ + header: "Cache.addAll", + message: "invalid vary field value" + })); + for (const controller of fetchControllers) { + controller.abort(); + } + return; + } + } + } + }, + processResponseEndOfBody(response2) { + if (response2.aborted) { + responsePromise.reject(new DOMException("aborted", "AbortError")); + return; + } + responsePromise.resolve(response2); + } + })); + responsePromises.push(responsePromise.promise); + } + const p = Promise.all(responsePromises); + const responses = await p; + const operations = []; + let index = 0; + for (const response2 of responses) { + const operation = { + type: "put", + // 7.3.2 + request: requestList[index], + // 7.3.3 + response: response2 + // 7.3.4 + }; + operations.push(operation); + index++; + } + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + try { + __privateMethod(this, _Cache_instances, batchCacheOperations_fn).call(this, operations); + } catch (e) { + errorData = e; + } + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(void 0); + } else { + cacheJobPromise.reject(errorData); + } + }); + return cacheJobPromise.promise; + } + async put(request2, response2) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 2, { header: "Cache.put" }); + request2 = webidl.converters.RequestInfo(request2); + response2 = webidl.converters.Response(response2); + let innerRequest = null; + if (request2 instanceof Request3) { + innerRequest = request2[kState]; + } else { + innerRequest = new Request3(request2)[kState]; + } + if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") { + throw webidl.errors.exception({ + header: "Cache.put", + message: "Expected an http/s scheme when method is not GET" + }); + } + const innerResponse = response2[kState]; + if (innerResponse.status === 206) { + throw webidl.errors.exception({ + header: "Cache.put", + message: "Got 206 status" + }); + } + if (innerResponse.headersList.contains("vary")) { + const fieldValues = getFieldValues(innerResponse.headersList.get("vary")); + for (const fieldValue of fieldValues) { + if (fieldValue === "*") { + throw webidl.errors.exception({ + header: "Cache.put", + message: "Got * vary field value" + }); + } + } + } + if (innerResponse.body && (isDisturbed2(innerResponse.body.stream) || innerResponse.body.stream.locked)) { + throw webidl.errors.exception({ + header: "Cache.put", + message: "Response body is locked or disturbed" + }); + } + const clonedResponse = cloneResponse(innerResponse); + const bodyReadPromise = createDeferredPromise(); + if (innerResponse.body != null) { + const stream2 = innerResponse.body.stream; + const reader2 = stream2.getReader(); + readAllBytes(reader2).then(bodyReadPromise.resolve, bodyReadPromise.reject); + } else { + bodyReadPromise.resolve(void 0); + } + const operations = []; + const operation = { + type: "put", + // 14. + request: innerRequest, + // 15. + response: clonedResponse + // 16. + }; + operations.push(operation); + const bytes = await bodyReadPromise.promise; + if (clonedResponse.body != null) { + clonedResponse.body.source = bytes; + } + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + try { + __privateMethod(this, _Cache_instances, batchCacheOperations_fn).call(this, operations); + } catch (e) { + errorData = e; + } + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(); + } else { + cacheJobPromise.reject(errorData); + } + }); + return cacheJobPromise.promise; + } + async delete(request2, options2 = {}) { + webidl.brandCheck(this, _Cache); + webidl.argumentLengthCheck(arguments, 1, { header: "Cache.delete" }); + request2 = webidl.converters.RequestInfo(request2); + options2 = webidl.converters.CacheQueryOptions(options2); + let r = null; + if (request2 instanceof Request3) { + r = request2[kState]; + if (r.method !== "GET" && !options2.ignoreMethod) { + return false; + } + } else { + assert2(typeof request2 === "string"); + r = new Request3(request2)[kState]; + } + const operations = []; + const operation = { + type: "delete", + request: r, + options: options2 + }; + operations.push(operation); + const cacheJobPromise = createDeferredPromise(); + let errorData = null; + let requestResponses; + try { + requestResponses = __privateMethod(this, _Cache_instances, batchCacheOperations_fn).call(this, operations); + } catch (e) { + errorData = e; + } + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(!!(requestResponses == null ? void 0 : requestResponses.length)); + } else { + cacheJobPromise.reject(errorData); + } + }); + return cacheJobPromise.promise; + } + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys + * @param {any} request + * @param {import('../../types/cache').CacheQueryOptions} options + * @returns {readonly Request[]} + */ + async keys(request2 = void 0, options2 = {}) { + webidl.brandCheck(this, _Cache); + if (request2 !== void 0) request2 = webidl.converters.RequestInfo(request2); + options2 = webidl.converters.CacheQueryOptions(options2); + let r = null; + if (request2 !== void 0) { + if (request2 instanceof Request3) { + r = request2[kState]; + if (r.method !== "GET" && !options2.ignoreMethod) { + return []; + } + } else if (typeof request2 === "string") { + r = new Request3(request2)[kState]; + } + } + const promise2 = createDeferredPromise(); + const requests = []; + if (request2 === void 0) { + for (const requestResponse of __privateGet(this, _relevantRequestResponseList)) { + requests.push(requestResponse[0]); + } + } else { + const requestResponses = __privateMethod(this, _Cache_instances, queryCache_fn).call(this, r, options2); + for (const requestResponse of requestResponses) { + requests.push(requestResponse[0]); + } + } + queueMicrotask(() => { + const requestList = []; + for (const request3 of requests) { + const requestObject = new Request3("https://a"); + requestObject[kState] = request3; + requestObject[kHeaders][kHeadersList] = request3.headersList; + requestObject[kHeaders][kGuard] = "immutable"; + requestObject[kRealm] = request3.client; + requestList.push(requestObject); + } + promise2.resolve(Object.freeze(requestList)); + }); + return promise2.promise; + } + }; + _relevantRequestResponseList = new WeakMap(); + _Cache_instances = new WeakSet(); + /** + * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm + * @param {CacheBatchOperation[]} operations + * @returns {requestResponseList} + */ + batchCacheOperations_fn = function(operations) { + const cache2 = __privateGet(this, _relevantRequestResponseList); + const backupCache = [...cache2]; + const addedItems = []; + const resultList = []; + try { + for (const operation of operations) { + if (operation.type !== "delete" && operation.type !== "put") { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: 'operation type does not match "delete" or "put"' + }); + } + if (operation.type === "delete" && operation.response != null) { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "delete operation should not have an associated response" + }); + } + if (__privateMethod(this, _Cache_instances, queryCache_fn).call(this, operation.request, operation.options, addedItems).length) { + throw new DOMException("???", "InvalidStateError"); + } + let requestResponses; + if (operation.type === "delete") { + requestResponses = __privateMethod(this, _Cache_instances, queryCache_fn).call(this, operation.request, operation.options); + if (requestResponses.length === 0) { + return []; + } + for (const requestResponse of requestResponses) { + const idx = cache2.indexOf(requestResponse); + assert2(idx !== -1); + cache2.splice(idx, 1); + } + } else if (operation.type === "put") { + if (operation.response == null) { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "put operation should have an associated response" + }); + } + const r = operation.request; + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "expected http or https scheme" + }); + } + if (r.method !== "GET") { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "not get method" + }); + } + if (operation.options != null) { + throw webidl.errors.exception({ + header: "Cache.#batchCacheOperations", + message: "options must not be defined" + }); + } + requestResponses = __privateMethod(this, _Cache_instances, queryCache_fn).call(this, operation.request); + for (const requestResponse of requestResponses) { + const idx = cache2.indexOf(requestResponse); + assert2(idx !== -1); + cache2.splice(idx, 1); + } + cache2.push([operation.request, operation.response]); + addedItems.push([operation.request, operation.response]); + } + resultList.push([operation.request, operation.response]); + } + return resultList; + } catch (e) { + __privateGet(this, _relevantRequestResponseList).length = 0; + __privateSet(this, _relevantRequestResponseList, backupCache); + throw e; + } + }; + /** + * @see https://w3c.github.io/ServiceWorker/#query-cache + * @param {any} requestQuery + * @param {import('../../types/cache').CacheQueryOptions} options + * @param {requestResponseList} targetStorage + * @returns {requestResponseList} + */ + queryCache_fn = function(requestQuery, options2, targetStorage) { + const resultList = []; + const storage = targetStorage ?? __privateGet(this, _relevantRequestResponseList); + for (const requestResponse of storage) { + const [cachedRequest, cachedResponse] = requestResponse; + if (__privateMethod(this, _Cache_instances, requestMatchesCachedItem_fn).call(this, requestQuery, cachedRequest, cachedResponse, options2)) { + resultList.push(requestResponse); + } + } + return resultList; + }; + /** + * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm + * @param {any} requestQuery + * @param {any} request + * @param {any | null} response + * @param {import('../../types/cache').CacheQueryOptions | undefined} options + * @returns {boolean} + */ + requestMatchesCachedItem_fn = function(requestQuery, request2, response2 = null, options2) { + const queryURL = new URL(requestQuery.url); + const cachedURL = new URL(request2.url); + if (options2 == null ? void 0 : options2.ignoreSearch) { + cachedURL.search = ""; + queryURL.search = ""; + } + if (!urlEquals(queryURL, cachedURL, true)) { + return false; + } + if (response2 == null || (options2 == null ? void 0 : options2.ignoreVary) || !response2.headersList.contains("vary")) { + return true; + } + const fieldValues = getFieldValues(response2.headersList.get("vary")); + for (const fieldValue of fieldValues) { + if (fieldValue === "*") { + return false; + } + const requestValue = request2.headersList.get(fieldValue); + const queryValue = requestQuery.headersList.get(fieldValue); + if (requestValue !== queryValue) { + return false; + } + } + return true; + }; + let Cache = _Cache; + Object.defineProperties(Cache.prototype, { + [Symbol.toStringTag]: { + value: "Cache", + configurable: true + }, + match: kEnumerableProperty2, + matchAll: kEnumerableProperty2, + add: kEnumerableProperty2, + addAll: kEnumerableProperty2, + put: kEnumerableProperty2, + delete: kEnumerableProperty2, + keys: kEnumerableProperty2 + }); + const cacheQueryOptionConverters = [ + { + key: "ignoreSearch", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "ignoreMethod", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "ignoreVary", + converter: webidl.converters.boolean, + defaultValue: false + } + ]; + webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters); + webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ + ...cacheQueryOptionConverters, + { + key: "cacheName", + converter: webidl.converters.DOMString + } + ]); + webidl.converters.Response = webidl.interfaceConverter(Response); + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.RequestInfo + ); + cache = { + Cache + }; + return cache; +} +var cachestorage; +var hasRequiredCachestorage; +function requireCachestorage() { + var _caches; + if (hasRequiredCachestorage) return cachestorage; + hasRequiredCachestorage = 1; + const { kConstruct } = requireSymbols$1(); + const { Cache } = requireCache(); + const { webidl } = requireWebidl(); + const { kEnumerableProperty: kEnumerableProperty2 } = util$l; + const _CacheStorage = class _CacheStorage { + constructor() { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map + * @type {Map} + */ + async has(cacheName) { + webidl.brandCheck(this, _CacheStorage); + webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.has" }); + cacheName = webidl.converters.DOMString(cacheName); + return __privateGet(this, _caches).has(cacheName); + } + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open + * @param {string} cacheName + * @returns {Promise} + */ + async open(cacheName) { + webidl.brandCheck(this, _CacheStorage); + webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.open" }); + cacheName = webidl.converters.DOMString(cacheName); + if (__privateGet(this, _caches).has(cacheName)) { + const cache3 = __privateGet(this, _caches).get(cacheName); + return new Cache(kConstruct, cache3); + } + const cache2 = []; + __privateGet(this, _caches).set(cacheName, cache2); + return new Cache(kConstruct, cache2); + } + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete + * @param {string} cacheName + * @returns {Promise} + */ + async delete(cacheName) { + webidl.brandCheck(this, _CacheStorage); + webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.delete" }); + cacheName = webidl.converters.DOMString(cacheName); + return __privateGet(this, _caches).delete(cacheName); + } + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys + * @returns {string[]} + */ + async keys() { + webidl.brandCheck(this, _CacheStorage); + const keys = __privateGet(this, _caches).keys(); + return [...keys]; + } + }; + _caches = new WeakMap(); + let CacheStorage = _CacheStorage; + Object.defineProperties(CacheStorage.prototype, { + [Symbol.toStringTag]: { + value: "CacheStorage", + configurable: true + }, + match: kEnumerableProperty2, + has: kEnumerableProperty2, + open: kEnumerableProperty2, + delete: kEnumerableProperty2, + keys: kEnumerableProperty2 + }); + cachestorage = { + CacheStorage + }; + return cachestorage; +} +var constants$9; +var hasRequiredConstants$1; +function requireConstants$1() { + if (hasRequiredConstants$1) return constants$9; + hasRequiredConstants$1 = 1; + const maxAttributeValueSize = 1024; + const maxNameValuePairSize = 4096; + constants$9 = { + maxAttributeValueSize, + maxNameValuePairSize + }; + return constants$9; +} +var util$4; +var hasRequiredUtil$1; +function requireUtil$1() { + if (hasRequiredUtil$1) return util$4; + hasRequiredUtil$1 = 1; + const assert2 = require$$0$4; + const { kHeadersList } = symbols$4; + function isCTLExcludingHtab(value) { + if (value.length === 0) { + return false; + } + for (const char of value) { + const code = char.charCodeAt(0); + if (code >= 0 || code <= 8 || (code >= 10 || code <= 31) || code === 127) { + return false; + } + } + } + function validateCookieName(name) { + for (const char of name) { + const code = char.charCodeAt(0); + if (code <= 32 || code > 127 || char === "(" || char === ")" || char === ">" || char === "<" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\" || char === '"' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}") { + throw new Error("Invalid cookie name"); + } + } + } + function validateCookieValue(value) { + for (const char of value) { + const code = char.charCodeAt(0); + if (code < 33 || // exclude CTLs (0-31) + code === 34 || code === 44 || code === 59 || code === 92 || code > 126) { + throw new Error("Invalid header value"); + } + } + } + function validateCookiePath(path2) { + for (const char of path2) { + const code = char.charCodeAt(0); + if (code < 33 || char === ";") { + throw new Error("Invalid cookie path"); + } + } + } + function validateCookieDomain(domain) { + if (domain.startsWith("-") || domain.endsWith(".") || domain.endsWith("-")) { + throw new Error("Invalid cookie domain"); + } + } + function toIMFDate(date) { + if (typeof date === "number") { + date = new Date(date); + } + const days = [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ]; + const months = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ]; + const dayName = days[date.getUTCDay()]; + const day = date.getUTCDate().toString().padStart(2, "0"); + const month = months[date.getUTCMonth()]; + const year = date.getUTCFullYear(); + const hour = date.getUTCHours().toString().padStart(2, "0"); + const minute = date.getUTCMinutes().toString().padStart(2, "0"); + const second = date.getUTCSeconds().toString().padStart(2, "0"); + return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`; + } + function validateCookieMaxAge(maxAge) { + if (maxAge < 0) { + throw new Error("Invalid cookie max-age"); + } + } + function stringify2(cookie) { + if (cookie.name.length === 0) { + return null; + } + validateCookieName(cookie.name); + validateCookieValue(cookie.value); + const out2 = [`${cookie.name}=${cookie.value}`]; + if (cookie.name.startsWith("__Secure-")) { + cookie.secure = true; + } + if (cookie.name.startsWith("__Host-")) { + cookie.secure = true; + cookie.domain = null; + cookie.path = "/"; + } + if (cookie.secure) { + out2.push("Secure"); + } + if (cookie.httpOnly) { + out2.push("HttpOnly"); + } + if (typeof cookie.maxAge === "number") { + validateCookieMaxAge(cookie.maxAge); + out2.push(`Max-Age=${cookie.maxAge}`); + } + if (cookie.domain) { + validateCookieDomain(cookie.domain); + out2.push(`Domain=${cookie.domain}`); + } + if (cookie.path) { + validateCookiePath(cookie.path); + out2.push(`Path=${cookie.path}`); + } + if (cookie.expires && cookie.expires.toString() !== "Invalid Date") { + out2.push(`Expires=${toIMFDate(cookie.expires)}`); + } + if (cookie.sameSite) { + out2.push(`SameSite=${cookie.sameSite}`); + } + for (const part of cookie.unparsed) { + if (!part.includes("=")) { + throw new Error("Invalid unparsed"); + } + const [key, ...value] = part.split("="); + out2.push(`${key.trim()}=${value.join("=")}`); + } + return out2.join("; "); + } + let kHeadersListNode; + function getHeadersList(headers2) { + if (headers2[kHeadersList]) { + return headers2[kHeadersList]; + } + if (!kHeadersListNode) { + kHeadersListNode = Object.getOwnPropertySymbols(headers2).find( + (symbol) => symbol.description === "headers list" + ); + assert2(kHeadersListNode, "Headers cannot be parsed"); + } + const headersList = headers2[kHeadersListNode]; + assert2(headersList); + return headersList; + } + util$4 = { + isCTLExcludingHtab, + stringify: stringify2, + getHeadersList + }; + return util$4; +} +var parse$b; +var hasRequiredParse; +function requireParse() { + if (hasRequiredParse) return parse$b; + hasRequiredParse = 1; + const { maxNameValuePairSize, maxAttributeValueSize } = requireConstants$1(); + const { isCTLExcludingHtab } = requireUtil$1(); + const { collectASequenceOfCodePointsFast } = requireDataURL(); + const assert2 = require$$0$4; + function parseSetCookie(header2) { + if (isCTLExcludingHtab(header2)) { + return null; + } + let nameValuePair = ""; + let unparsedAttributes = ""; + let name = ""; + let value = ""; + if (header2.includes(";")) { + const position = { position: 0 }; + nameValuePair = collectASequenceOfCodePointsFast(";", header2, position); + unparsedAttributes = header2.slice(position.position); + } else { + nameValuePair = header2; + } + if (!nameValuePair.includes("=")) { + value = nameValuePair; + } else { + const position = { position: 0 }; + name = collectASequenceOfCodePointsFast( + "=", + nameValuePair, + position + ); + value = nameValuePair.slice(position.position + 1); + } + name = name.trim(); + value = value.trim(); + if (name.length + value.length > maxNameValuePairSize) { + return null; + } + return { + name, + value, + ...parseUnparsedAttributes(unparsedAttributes) + }; + } + function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) { + if (unparsedAttributes.length === 0) { + return cookieAttributeList; + } + assert2(unparsedAttributes[0] === ";"); + unparsedAttributes = unparsedAttributes.slice(1); + let cookieAv = ""; + if (unparsedAttributes.includes(";")) { + cookieAv = collectASequenceOfCodePointsFast( + ";", + unparsedAttributes, + { position: 0 } + ); + unparsedAttributes = unparsedAttributes.slice(cookieAv.length); + } else { + cookieAv = unparsedAttributes; + unparsedAttributes = ""; + } + let attributeName = ""; + let attributeValue = ""; + if (cookieAv.includes("=")) { + const position = { position: 0 }; + attributeName = collectASequenceOfCodePointsFast( + "=", + cookieAv, + position + ); + attributeValue = cookieAv.slice(position.position + 1); + } else { + attributeName = cookieAv; + } + attributeName = attributeName.trim(); + attributeValue = attributeValue.trim(); + if (attributeValue.length > maxAttributeValueSize) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + const attributeNameLowercase = attributeName.toLowerCase(); + if (attributeNameLowercase === "expires") { + const expiryTime = new Date(attributeValue); + cookieAttributeList.expires = expiryTime; + } else if (attributeNameLowercase === "max-age") { + const charCode = attributeValue.charCodeAt(0); + if ((charCode < 48 || charCode > 57) && attributeValue[0] !== "-") { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + if (!/^\d+$/.test(attributeValue)) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + const deltaSeconds = Number(attributeValue); + cookieAttributeList.maxAge = deltaSeconds; + } else if (attributeNameLowercase === "domain") { + let cookieDomain = attributeValue; + if (cookieDomain[0] === ".") { + cookieDomain = cookieDomain.slice(1); + } + cookieDomain = cookieDomain.toLowerCase(); + cookieAttributeList.domain = cookieDomain; + } else if (attributeNameLowercase === "path") { + let cookiePath = ""; + if (attributeValue.length === 0 || attributeValue[0] !== "/") { + cookiePath = "/"; + } else { + cookiePath = attributeValue; + } + cookieAttributeList.path = cookiePath; + } else if (attributeNameLowercase === "secure") { + cookieAttributeList.secure = true; + } else if (attributeNameLowercase === "httponly") { + cookieAttributeList.httpOnly = true; + } else if (attributeNameLowercase === "samesite") { + let enforcement = "Default"; + const attributeValueLowercase = attributeValue.toLowerCase(); + if (attributeValueLowercase.includes("none")) { + enforcement = "None"; + } + if (attributeValueLowercase.includes("strict")) { + enforcement = "Strict"; + } + if (attributeValueLowercase.includes("lax")) { + enforcement = "Lax"; + } + cookieAttributeList.sameSite = enforcement; + } else { + cookieAttributeList.unparsed ?? (cookieAttributeList.unparsed = []); + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); + } + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); + } + parse$b = { + parseSetCookie, + parseUnparsedAttributes + }; + return parse$b; +} +var cookies; +var hasRequiredCookies; +function requireCookies() { + if (hasRequiredCookies) return cookies; + hasRequiredCookies = 1; + const { parseSetCookie } = requireParse(); + const { stringify: stringify2, getHeadersList } = requireUtil$1(); + const { webidl } = requireWebidl(); + const { Headers: Headers2 } = requireHeaders(); + function getCookies(headers2) { + webidl.argumentLengthCheck(arguments, 1, { header: "getCookies" }); + webidl.brandCheck(headers2, Headers2, { strict: false }); + const cookie = headers2.get("cookie"); + const out2 = {}; + if (!cookie) { + return out2; + } + for (const piece of cookie.split(";")) { + const [name, ...value] = piece.split("="); + out2[name.trim()] = value.join("="); + } + return out2; + } + function deleteCookie(headers2, name, attributes) { + webidl.argumentLengthCheck(arguments, 2, { header: "deleteCookie" }); + webidl.brandCheck(headers2, Headers2, { strict: false }); + name = webidl.converters.DOMString(name); + attributes = webidl.converters.DeleteCookieAttributes(attributes); + setCookie(headers2, { + name, + value: "", + expires: /* @__PURE__ */ new Date(0), + ...attributes + }); + } + function getSetCookies(headers2) { + webidl.argumentLengthCheck(arguments, 1, { header: "getSetCookies" }); + webidl.brandCheck(headers2, Headers2, { strict: false }); + const cookies2 = getHeadersList(headers2).cookies; + if (!cookies2) { + return []; + } + return cookies2.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)); + } + function setCookie(headers2, cookie) { + webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" }); + webidl.brandCheck(headers2, Headers2, { strict: false }); + cookie = webidl.converters.Cookie(cookie); + const str = stringify2(cookie); + if (str) { + headers2.append("Set-Cookie", stringify2(cookie)); + } + } + webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: "path", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: "domain", + defaultValue: null + } + ]); + webidl.converters.Cookie = webidl.dictionaryConverter([ + { + converter: webidl.converters.DOMString, + key: "name" + }, + { + converter: webidl.converters.DOMString, + key: "value" + }, + { + converter: webidl.nullableConverter((value) => { + if (typeof value === "number") { + return webidl.converters["unsigned long long"](value); + } + return new Date(value); + }), + key: "expires", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters["long long"]), + key: "maxAge", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: "domain", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: "path", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: "secure", + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: "httpOnly", + defaultValue: null + }, + { + converter: webidl.converters.USVString, + key: "sameSite", + allowedValues: ["Strict", "Lax", "None"] + }, + { + converter: webidl.sequenceConverter(webidl.converters.DOMString), + key: "unparsed", + defaultValue: [] + } + ]); + cookies = { + getCookies, + deleteCookie, + getSetCookies, + setCookie + }; + return cookies; +} +var constants$8; +var hasRequiredConstants; +function requireConstants() { + if (hasRequiredConstants) return constants$8; + hasRequiredConstants = 1; + const uid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; + const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false + }; + const states = { + CONNECTING: 0, + OPEN: 1, + CLOSING: 2, + CLOSED: 3 + }; + const opcodes = { + CONTINUATION: 0, + TEXT: 1, + BINARY: 2, + CLOSE: 8, + PING: 9, + PONG: 10 + }; + const maxUnsigned16Bit = 2 ** 16 - 1; + const parserStates = { + INFO: 0, + PAYLOADLENGTH_16: 2, + PAYLOADLENGTH_64: 3, + READ_DATA: 4 + }; + const emptyBuffer = Buffer.allocUnsafe(0); + constants$8 = { + uid, + staticPropertyDescriptors, + states, + opcodes, + maxUnsigned16Bit, + parserStates, + emptyBuffer + }; + return constants$8; +} +var symbols; +var hasRequiredSymbols; +function requireSymbols() { + if (hasRequiredSymbols) return symbols; + hasRequiredSymbols = 1; + symbols = { + 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") + }; + return symbols; +} +var events; +var hasRequiredEvents; +function requireEvents() { + var _eventInit, _eventInit2, _eventInit3; + if (hasRequiredEvents) return events; + hasRequiredEvents = 1; + const { webidl } = requireWebidl(); + const { kEnumerableProperty: kEnumerableProperty2 } = util$l; + const { MessagePort } = require$$0$7; + const _MessageEvent = class _MessageEvent extends Event { + constructor(type, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent constructor" }); + type = webidl.converters.DOMString(type); + eventInitDict = webidl.converters.MessageEventInit(eventInitDict); + super(type, eventInitDict); + __privateAdd(this, _eventInit); + __privateSet(this, _eventInit, eventInitDict); + } + get data() { + webidl.brandCheck(this, _MessageEvent); + return __privateGet(this, _eventInit).data; + } + get origin() { + webidl.brandCheck(this, _MessageEvent); + return __privateGet(this, _eventInit).origin; + } + get lastEventId() { + webidl.brandCheck(this, _MessageEvent); + return __privateGet(this, _eventInit).lastEventId; + } + get source() { + webidl.brandCheck(this, _MessageEvent); + return __privateGet(this, _eventInit).source; + } + get ports() { + webidl.brandCheck(this, _MessageEvent); + if (!Object.isFrozen(__privateGet(this, _eventInit).ports)) { + Object.freeze(__privateGet(this, _eventInit).ports); + } + return __privateGet(this, _eventInit).ports; + } + initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId = "", source = null, ports = []) { + webidl.brandCheck(this, _MessageEvent); + webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent.initMessageEvent" }); + return new _MessageEvent(type, { + bubbles, + cancelable, + data, + origin, + lastEventId, + source, + ports + }); + } + }; + _eventInit = new WeakMap(); + let MessageEvent = _MessageEvent; + const _CloseEvent = class _CloseEvent extends Event { + constructor(type, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: "CloseEvent constructor" }); + type = webidl.converters.DOMString(type); + eventInitDict = webidl.converters.CloseEventInit(eventInitDict); + super(type, eventInitDict); + __privateAdd(this, _eventInit2); + __privateSet(this, _eventInit2, eventInitDict); + } + get wasClean() { + webidl.brandCheck(this, _CloseEvent); + return __privateGet(this, _eventInit2).wasClean; + } + get code() { + webidl.brandCheck(this, _CloseEvent); + return __privateGet(this, _eventInit2).code; + } + get reason() { + webidl.brandCheck(this, _CloseEvent); + return __privateGet(this, _eventInit2).reason; + } + }; + _eventInit2 = new WeakMap(); + let CloseEvent = _CloseEvent; + const _ErrorEvent = class _ErrorEvent extends Event { + constructor(type, eventInitDict) { + webidl.argumentLengthCheck(arguments, 1, { header: "ErrorEvent constructor" }); + super(type, eventInitDict); + __privateAdd(this, _eventInit3); + type = webidl.converters.DOMString(type); + eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}); + __privateSet(this, _eventInit3, eventInitDict); + } + get message() { + webidl.brandCheck(this, _ErrorEvent); + return __privateGet(this, _eventInit3).message; + } + get filename() { + webidl.brandCheck(this, _ErrorEvent); + return __privateGet(this, _eventInit3).filename; + } + get lineno() { + webidl.brandCheck(this, _ErrorEvent); + return __privateGet(this, _eventInit3).lineno; + } + get colno() { + webidl.brandCheck(this, _ErrorEvent); + return __privateGet(this, _eventInit3).colno; + } + get error() { + webidl.brandCheck(this, _ErrorEvent); + return __privateGet(this, _eventInit3).error; + } + }; + _eventInit3 = new WeakMap(); + let ErrorEvent = _ErrorEvent; + Object.defineProperties(MessageEvent.prototype, { + [Symbol.toStringTag]: { + value: "MessageEvent", + configurable: true + }, + data: kEnumerableProperty2, + origin: kEnumerableProperty2, + lastEventId: kEnumerableProperty2, + source: kEnumerableProperty2, + ports: kEnumerableProperty2, + initMessageEvent: kEnumerableProperty2 + }); + Object.defineProperties(CloseEvent.prototype, { + [Symbol.toStringTag]: { + value: "CloseEvent", + configurable: true + }, + reason: kEnumerableProperty2, + code: kEnumerableProperty2, + wasClean: kEnumerableProperty2 + }); + Object.defineProperties(ErrorEvent.prototype, { + [Symbol.toStringTag]: { + value: "ErrorEvent", + configurable: true + }, + message: kEnumerableProperty2, + filename: kEnumerableProperty2, + lineno: kEnumerableProperty2, + colno: kEnumerableProperty2, + error: kEnumerableProperty2 + }); + webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort); + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.MessagePort + ); + const eventInit = [ + { + key: "bubbles", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "cancelable", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "composed", + converter: webidl.converters.boolean, + defaultValue: false + } + ]; + webidl.converters.MessageEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: "data", + converter: webidl.converters.any, + defaultValue: null + }, + { + key: "origin", + converter: webidl.converters.USVString, + defaultValue: "" + }, + { + key: "lastEventId", + converter: webidl.converters.DOMString, + defaultValue: "" + }, + { + key: "source", + // Node doesn't implement WindowProxy or ServiceWorker, so the only + // valid value for source is a MessagePort. + converter: webidl.nullableConverter(webidl.converters.MessagePort), + defaultValue: null + }, + { + key: "ports", + converter: webidl.converters["sequence"], + get defaultValue() { + return []; + } + } + ]); + webidl.converters.CloseEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: "wasClean", + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: "code", + converter: webidl.converters["unsigned short"], + defaultValue: 0 + }, + { + key: "reason", + converter: webidl.converters.USVString, + defaultValue: "" + } + ]); + webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: "message", + converter: webidl.converters.DOMString, + defaultValue: "" + }, + { + key: "filename", + converter: webidl.converters.USVString, + defaultValue: "" + }, + { + key: "lineno", + converter: webidl.converters["unsigned long"], + defaultValue: 0 + }, + { + key: "colno", + converter: webidl.converters["unsigned long"], + defaultValue: 0 + }, + { + key: "error", + converter: webidl.converters.any + } + ]); + events = { + MessageEvent, + CloseEvent, + ErrorEvent + }; + return events; +} +var util$3; +var hasRequiredUtil; +function requireUtil() { + if (hasRequiredUtil) return util$3; + hasRequiredUtil = 1; + const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = requireSymbols(); + const { states, opcodes } = requireConstants(); + const { MessageEvent, ErrorEvent } = requireEvents(); + function isEstablished(ws) { + return ws[kReadyState] === states.OPEN; + } + function isClosing(ws) { + return ws[kReadyState] === states.CLOSING; + } + function isClosed(ws) { + return ws[kReadyState] === states.CLOSED; + } + function fireEvent(e, target, eventConstructor = Event, eventInitDict) { + const event = new eventConstructor(e, eventInitDict); + target.dispatchEvent(event); + } + function websocketMessageReceived(ws, type, data) { + if (ws[kReadyState] !== states.OPEN) { + return; + } + let dataForEvent; + if (type === opcodes.TEXT) { + try { + dataForEvent = new TextDecoder("utf-8", { fatal: true }).decode(data); + } catch { + failWebsocketConnection(ws, "Received invalid UTF-8 in text frame."); + return; + } + } else if (type === opcodes.BINARY) { + if (ws[kBinaryType] === "blob") { + dataForEvent = new Blob([data]); + } else { + dataForEvent = new Uint8Array(data).buffer; + } + } + fireEvent("message", ws, MessageEvent, { + origin: ws[kWebSocketURL].origin, + data: dataForEvent + }); + } + function isValidSubprotocol(protocol) { + if (protocol.length === 0) { + return false; + } + for (const char of protocol) { + const code = char.charCodeAt(0); + if (code < 33 || code > 126 || char === "(" || char === ")" || char === "<" || char === ">" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\" || char === '"' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}" || code === 32 || // SP + code === 9) { + return false; + } + } + return true; + } + function isValidStatusCode(code) { + if (code >= 1e3 && code < 1015) { + return code !== 1004 && // reserved + code !== 1005 && // "MUST NOT be set as a status code" + code !== 1006; + } + return code >= 3e3 && code <= 4999; + } + function failWebsocketConnection(ws, reason) { + const { [kController]: controller, [kResponse]: response2 } = ws; + controller.abort(); + if ((response2 == null ? void 0 : response2.socket) && !response2.socket.destroyed) { + response2.socket.destroy(); + } + if (reason) { + fireEvent("error", ws, ErrorEvent, { + error: new Error(reason) + }); + } + } + util$3 = { + isEstablished, + isClosing, + isClosed, + fireEvent, + isValidSubprotocol, + isValidStatusCode, + failWebsocketConnection, + websocketMessageReceived + }; + return util$3; +} +var connection; +var hasRequiredConnection; +function requireConnection() { + if (hasRequiredConnection) return connection; + hasRequiredConnection = 1; + const diagnosticsChannel = require$$0$8; + const { uid, states } = requireConstants(); + const { + kReadyState, + kSentClose, + kByteParser, + kReceivedClose + } = requireSymbols(); + const { fireEvent, failWebsocketConnection } = requireUtil(); + const { CloseEvent } = requireEvents(); + const { makeRequest } = requireRequest(); + const { fetching } = requireFetch(); + const { Headers: Headers2 } = requireHeaders(); + const { getGlobalDispatcher: getGlobalDispatcher2 } = global$1; + const { kHeadersList } = symbols$4; + const channels2 = {}; + channels2.open = diagnosticsChannel.channel("undici:websocket:open"); + channels2.close = diagnosticsChannel.channel("undici:websocket:close"); + channels2.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); + let crypto2; + try { + crypto2 = require("crypto"); + } catch { + } + function establishWebSocketConnection(url, protocols, ws, onEstablish, options2) { + const requestURL = url; + requestURL.protocol = url.protocol === "ws:" ? "http:" : "https:"; + const request2 = makeRequest({ + urlList: [requestURL], + serviceWorkers: "none", + referrer: "no-referrer", + mode: "websocket", + credentials: "include", + cache: "no-store", + redirect: "error" + }); + if (options2.headers) { + const headersList = new Headers2(options2.headers)[kHeadersList]; + request2.headersList = headersList; + } + const keyValue = crypto2.randomBytes(16).toString("base64"); + request2.headersList.append("sec-websocket-key", keyValue); + request2.headersList.append("sec-websocket-version", "13"); + for (const protocol of protocols) { + request2.headersList.append("sec-websocket-protocol", protocol); + } + const permessageDeflate = ""; + const controller = fetching({ + request: request2, + useParallelQueue: true, + dispatcher: options2.dispatcher ?? getGlobalDispatcher2(), + processResponse(response2) { + var _a2, _b; + if (response2.type === "error" || response2.status !== 101) { + failWebsocketConnection(ws, "Received network error or non-101 status code."); + return; + } + if (protocols.length !== 0 && !response2.headersList.get("Sec-WebSocket-Protocol")) { + failWebsocketConnection(ws, "Server did not respond with sent protocols."); + return; + } + if (((_a2 = response2.headersList.get("Upgrade")) == null ? void 0 : _a2.toLowerCase()) !== "websocket") { + failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".'); + return; + } + if (((_b = response2.headersList.get("Connection")) == null ? void 0 : _b.toLowerCase()) !== "upgrade") { + failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".'); + return; + } + const secWSAccept = response2.headersList.get("Sec-WebSocket-Accept"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); + if (secWSAccept !== digest) { + failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); + return; + } + const secExtension = response2.headersList.get("Sec-WebSocket-Extensions"); + if (secExtension !== null && secExtension !== permessageDeflate) { + failWebsocketConnection(ws, "Received different permessage-deflate than the one set."); + return; + } + const secProtocol = response2.headersList.get("Sec-WebSocket-Protocol"); + if (secProtocol !== null && secProtocol !== request2.headersList.get("Sec-WebSocket-Protocol")) { + failWebsocketConnection(ws, "Protocol was not set in the opening handshake."); + return; + } + response2.socket.on("data", onSocketData); + response2.socket.on("close", onSocketClose2); + response2.socket.on("error", onSocketError2); + if (channels2.open.hasSubscribers) { + channels2.open.publish({ + address: response2.socket.address(), + protocol: secProtocol, + extensions: secExtension + }); + } + onEstablish(response2); + } + }); + return controller; + } + function onSocketData(chunk) { + if (!this.ws[kByteParser].write(chunk)) { + this.pause(); + } + } + function onSocketClose2() { + const { ws } = this; + const wasClean = ws[kSentClose] && ws[kReceivedClose]; + let code = 1005; + let reason = ""; + const result = ws[kByteParser].closingInfo; + if (result) { + code = result.code ?? 1005; + reason = result.reason; + } else if (!ws[kSentClose]) { + code = 1006; + } + ws[kReadyState] = states.CLOSED; + fireEvent("close", ws, CloseEvent, { + wasClean, + code, + reason + }); + if (channels2.close.hasSubscribers) { + channels2.close.publish({ + websocket: ws, + code, + reason + }); + } + } + function onSocketError2(error2) { + const { ws } = this; + ws[kReadyState] = states.CLOSING; + if (channels2.socketError.hasSubscribers) { + channels2.socketError.publish(error2); + } + this.destroy(); + } + connection = { + establishWebSocketConnection + }; + return connection; +} +var frame; +var hasRequiredFrame; +function requireFrame() { + if (hasRequiredFrame) return frame; + hasRequiredFrame = 1; + const { maxUnsigned16Bit } = requireConstants(); + let crypto2; + try { + crypto2 = require("crypto"); + } catch { + } + class WebsocketFrameSend { + /** + * @param {Buffer|undefined} data + */ + constructor(data) { + this.frameData = data; + this.maskKey = crypto2.randomBytes(4); + } + createFrame(opcode) { + var _a2; + const bodyLength2 = ((_a2 = this.frameData) == null ? void 0 : _a2.byteLength) ?? 0; + let payloadLength = bodyLength2; + let offset = 6; + if (bodyLength2 > maxUnsigned16Bit) { + offset += 8; + payloadLength = 127; + } else if (bodyLength2 > 125) { + offset += 2; + payloadLength = 126; + } + const buffer = Buffer.allocUnsafe(bodyLength2 + offset); + buffer[0] = buffer[1] = 0; + buffer[0] |= 128; + buffer[0] = (buffer[0] & 240) + opcode; + /*! ws. MIT License. Einar Otto Stangvik */ + buffer[offset - 4] = this.maskKey[0]; + buffer[offset - 3] = this.maskKey[1]; + buffer[offset - 2] = this.maskKey[2]; + buffer[offset - 1] = this.maskKey[3]; + buffer[1] = payloadLength; + if (payloadLength === 126) { + buffer.writeUInt16BE(bodyLength2, 2); + } else if (payloadLength === 127) { + buffer[2] = buffer[3] = 0; + buffer.writeUIntBE(bodyLength2, 4, 6); + } + buffer[1] |= 128; + for (let i = 0; i < bodyLength2; i++) { + buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]; + } + return buffer; + } + } + frame = { + WebsocketFrameSend + }; + return frame; +} +var receiver; +var hasRequiredReceiver; +function requireReceiver() { + var _buffers, _byteOffset, _state, _info, _fragments; + if (hasRequiredReceiver) return receiver; + hasRequiredReceiver = 1; + const { Writable } = require$$0$5; + const diagnosticsChannel = require$$0$8; + const { parserStates, opcodes, states, emptyBuffer } = requireConstants(); + const { kReadyState, kSentClose, kResponse, kReceivedClose } = requireSymbols(); + const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = requireUtil(); + const { WebsocketFrameSend } = requireFrame(); + const channels2 = {}; + channels2.ping = diagnosticsChannel.channel("undici:websocket:ping"); + channels2.pong = diagnosticsChannel.channel("undici:websocket:pong"); + class ByteParser extends Writable { + constructor(ws) { + super(); + __privateAdd(this, _buffers, []); + __privateAdd(this, _byteOffset, 0); + __privateAdd(this, _state, parserStates.INFO); + __privateAdd(this, _info, {}); + __privateAdd(this, _fragments, []); + this.ws = ws; + } + /** + * @param {Buffer} chunk + * @param {() => void} callback + */ + _write(chunk, _, callback) { + __privateGet(this, _buffers).push(chunk); + __privateSet(this, _byteOffset, __privateGet(this, _byteOffset) + chunk.length); + this.run(callback); + } + /** + * Runs whenever a new chunk is received. + * Callback is called whenever there are no more chunks buffering, + * or not enough bytes are buffered to parse. + */ + run(callback) { + var _a2; + while (true) { + if (__privateGet(this, _state) === parserStates.INFO) { + if (__privateGet(this, _byteOffset) < 2) { + return callback(); + } + const buffer = this.consume(2); + __privateGet(this, _info).fin = (buffer[0] & 128) !== 0; + __privateGet(this, _info).opcode = buffer[0] & 15; + (_a2 = __privateGet(this, _info)).originalOpcode ?? (_a2.originalOpcode = __privateGet(this, _info).opcode); + __privateGet(this, _info).fragmented = !__privateGet(this, _info).fin && __privateGet(this, _info).opcode !== opcodes.CONTINUATION; + if (__privateGet(this, _info).fragmented && __privateGet(this, _info).opcode !== opcodes.BINARY && __privateGet(this, _info).opcode !== opcodes.TEXT) { + failWebsocketConnection(this.ws, "Invalid frame type was fragmented."); + return; + } + const payloadLength = buffer[1] & 127; + if (payloadLength <= 125) { + __privateGet(this, _info).payloadLength = payloadLength; + __privateSet(this, _state, parserStates.READ_DATA); + } else if (payloadLength === 126) { + __privateSet(this, _state, parserStates.PAYLOADLENGTH_16); + } else if (payloadLength === 127) { + __privateSet(this, _state, parserStates.PAYLOADLENGTH_64); + } + if (__privateGet(this, _info).fragmented && payloadLength > 125) { + failWebsocketConnection(this.ws, "Fragmented frame exceeded 125 bytes."); + return; + } else if ((__privateGet(this, _info).opcode === opcodes.PING || __privateGet(this, _info).opcode === opcodes.PONG || __privateGet(this, _info).opcode === opcodes.CLOSE) && payloadLength > 125) { + failWebsocketConnection(this.ws, "Payload length for control frame exceeded 125 bytes."); + return; + } else if (__privateGet(this, _info).opcode === opcodes.CLOSE) { + if (payloadLength === 1) { + failWebsocketConnection(this.ws, "Received close frame with a 1-byte body."); + return; + } + const body2 = this.consume(payloadLength); + __privateGet(this, _info).closeInfo = this.parseCloseBody(false, body2); + if (!this.ws[kSentClose]) { + const body3 = Buffer.allocUnsafe(2); + body3.writeUInt16BE(__privateGet(this, _info).closeInfo.code, 0); + const closeFrame = new WebsocketFrameSend(body3); + this.ws[kResponse].socket.write( + closeFrame.createFrame(opcodes.CLOSE), + (err) => { + if (!err) { + this.ws[kSentClose] = true; + } + } + ); + } + this.ws[kReadyState] = states.CLOSING; + this.ws[kReceivedClose] = true; + this.end(); + return; + } else if (__privateGet(this, _info).opcode === opcodes.PING) { + const body2 = this.consume(payloadLength); + if (!this.ws[kReceivedClose]) { + const frame2 = new WebsocketFrameSend(body2); + this.ws[kResponse].socket.write(frame2.createFrame(opcodes.PONG)); + if (channels2.ping.hasSubscribers) { + channels2.ping.publish({ + payload: body2 + }); + } + } + __privateSet(this, _state, parserStates.INFO); + if (__privateGet(this, _byteOffset) > 0) { + continue; + } else { + callback(); + return; + } + } else if (__privateGet(this, _info).opcode === opcodes.PONG) { + const body2 = this.consume(payloadLength); + if (channels2.pong.hasSubscribers) { + channels2.pong.publish({ + payload: body2 + }); + } + if (__privateGet(this, _byteOffset) > 0) { + continue; + } else { + callback(); + return; + } + } + } else if (__privateGet(this, _state) === parserStates.PAYLOADLENGTH_16) { + if (__privateGet(this, _byteOffset) < 2) { + return callback(); + } + const buffer = this.consume(2); + __privateGet(this, _info).payloadLength = buffer.readUInt16BE(0); + __privateSet(this, _state, parserStates.READ_DATA); + } else if (__privateGet(this, _state) === parserStates.PAYLOADLENGTH_64) { + if (__privateGet(this, _byteOffset) < 8) { + return callback(); + } + const buffer = this.consume(8); + const upper = buffer.readUInt32BE(0); + if (upper > 2 ** 31 - 1) { + failWebsocketConnection(this.ws, "Received payload length > 2^31 bytes."); + return; + } + const lower = buffer.readUInt32BE(4); + __privateGet(this, _info).payloadLength = (upper << 8) + lower; + __privateSet(this, _state, parserStates.READ_DATA); + } else if (__privateGet(this, _state) === parserStates.READ_DATA) { + if (__privateGet(this, _byteOffset) < __privateGet(this, _info).payloadLength) { + return callback(); + } else if (__privateGet(this, _byteOffset) >= __privateGet(this, _info).payloadLength) { + const body2 = this.consume(__privateGet(this, _info).payloadLength); + __privateGet(this, _fragments).push(body2); + if (!__privateGet(this, _info).fragmented || __privateGet(this, _info).fin && __privateGet(this, _info).opcode === opcodes.CONTINUATION) { + const fullMessage = Buffer.concat(__privateGet(this, _fragments)); + websocketMessageReceived(this.ws, __privateGet(this, _info).originalOpcode, fullMessage); + __privateSet(this, _info, {}); + __privateGet(this, _fragments).length = 0; + } + __privateSet(this, _state, parserStates.INFO); + } + } + if (__privateGet(this, _byteOffset) > 0) { + continue; + } else { + callback(); + break; + } + } + } + /** + * Take n bytes from the buffered Buffers + * @param {number} n + * @returns {Buffer|null} + */ + consume(n) { + if (n > __privateGet(this, _byteOffset)) { + return null; + } else if (n === 0) { + return emptyBuffer; + } + if (__privateGet(this, _buffers)[0].length === n) { + __privateSet(this, _byteOffset, __privateGet(this, _byteOffset) - __privateGet(this, _buffers)[0].length); + return __privateGet(this, _buffers).shift(); + } + const buffer = Buffer.allocUnsafe(n); + let offset = 0; + while (offset !== n) { + const next = __privateGet(this, _buffers)[0]; + const { length } = next; + if (length + offset === n) { + buffer.set(__privateGet(this, _buffers).shift(), offset); + break; + } else if (length + offset > n) { + buffer.set(next.subarray(0, n - offset), offset); + __privateGet(this, _buffers)[0] = next.subarray(n - offset); + break; + } else { + buffer.set(__privateGet(this, _buffers).shift(), offset); + offset += next.length; + } + } + __privateSet(this, _byteOffset, __privateGet(this, _byteOffset) - n); + return buffer; + } + parseCloseBody(onlyCode, data) { + let code; + if (data.length >= 2) { + code = data.readUInt16BE(0); + } + if (onlyCode) { + if (!isValidStatusCode(code)) { + return null; + } + return { code }; + } + let reason = data.subarray(2); + if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) { + reason = reason.subarray(3); + } + if (code !== void 0 && !isValidStatusCode(code)) { + return null; + } + try { + reason = new TextDecoder("utf-8", { fatal: true }).decode(reason); + } catch { + return null; + } + return { code, reason }; + } + get closingInfo() { + return __privateGet(this, _info).closeInfo; + } + } + _buffers = new WeakMap(); + _byteOffset = new WeakMap(); + _state = new WeakMap(); + _info = new WeakMap(); + _fragments = new WeakMap(); + receiver = { + ByteParser + }; + return receiver; +} +var websocket; +var hasRequiredWebsocket; +function requireWebsocket() { + var _events, _bufferedAmount, _protocol, _extensions, _WebSocket_instances, onConnectionEstablished_fn; + if (hasRequiredWebsocket) return websocket; + hasRequiredWebsocket = 1; + const { webidl } = requireWebidl(); + const { DOMException: DOMException2 } = requireConstants$3(); + const { URLSerializer } = requireDataURL(); + const { getGlobalOrigin } = requireGlobal(); + const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = requireConstants(); + const { + kWebSocketURL, + kReadyState, + kController, + kBinaryType, + kResponse, + kSentClose, + kByteParser + } = requireSymbols(); + const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = requireUtil(); + const { establishWebSocketConnection } = requireConnection(); + const { WebsocketFrameSend } = requireFrame(); + const { ByteParser } = requireReceiver(); + const { kEnumerableProperty: kEnumerableProperty2, isBlobLike: isBlobLike2 } = util$l; + const { getGlobalDispatcher: getGlobalDispatcher2 } = global$1; + const { types: types2 } = require$$0$3; + let experimentalWarned = false; + const _WebSocket = class _WebSocket extends EventTarget { + /** + * @param {string} url + * @param {string|string[]} protocols + */ + constructor(url, protocols = []) { + super(); + __privateAdd(this, _WebSocket_instances); + __privateAdd(this, _events, { + open: null, + error: null, + close: null, + message: null + }); + __privateAdd(this, _bufferedAmount, 0); + __privateAdd(this, _protocol, ""); + __privateAdd(this, _extensions, ""); + webidl.argumentLengthCheck(arguments, 1, { header: "WebSocket constructor" }); + if (!experimentalWarned) { + experimentalWarned = true; + process.emitWarning("WebSockets are experimental, expect them to change at any time.", { + code: "UNDICI-WS" + }); + } + const options2 = webidl.converters["DOMString or sequence or WebSocketInit"](protocols); + url = webidl.converters.USVString(url); + protocols = options2.protocols; + const baseURL = getGlobalOrigin(); + let urlRecord; + try { + urlRecord = new URL(url, baseURL); + } catch (e) { + throw new DOMException2(e, "SyntaxError"); + } + if (urlRecord.protocol === "http:") { + urlRecord.protocol = "ws:"; + } else if (urlRecord.protocol === "https:") { + urlRecord.protocol = "wss:"; + } + if (urlRecord.protocol !== "ws:" && urlRecord.protocol !== "wss:") { + throw new DOMException2( + `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, + "SyntaxError" + ); + } + if (urlRecord.hash || urlRecord.href.endsWith("#")) { + throw new DOMException2("Got fragment", "SyntaxError"); + } + if (typeof protocols === "string") { + protocols = [protocols]; + } + if (protocols.length !== new Set(protocols.map((p) => p.toLowerCase())).size) { + throw new DOMException2("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); + } + if (protocols.length > 0 && !protocols.every((p) => isValidSubprotocol(p))) { + throw new DOMException2("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); + } + this[kWebSocketURL] = new URL(urlRecord.href); + this[kController] = establishWebSocketConnection( + urlRecord, + protocols, + this, + (response2) => __privateMethod(this, _WebSocket_instances, onConnectionEstablished_fn).call(this, response2), + options2 + ); + this[kReadyState] = _WebSocket.CONNECTING; + this[kBinaryType] = "blob"; + } + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-close + * @param {number|undefined} code + * @param {string|undefined} reason + */ + close(code = void 0, reason = void 0) { + webidl.brandCheck(this, _WebSocket); + if (code !== void 0) { + code = webidl.converters["unsigned short"](code, { clamp: true }); + } + if (reason !== void 0) { + reason = webidl.converters.USVString(reason); + } + if (code !== void 0) { + if (code !== 1e3 && (code < 3e3 || code > 4999)) { + throw new DOMException2("invalid code", "InvalidAccessError"); + } + } + let reasonByteLength = 0; + if (reason !== void 0) { + reasonByteLength = Buffer.byteLength(reason); + if (reasonByteLength > 123) { + throw new DOMException2( + `Reason must be less than 123 bytes; received ${reasonByteLength}`, + "SyntaxError" + ); + } + } + if (this[kReadyState] === _WebSocket.CLOSING || this[kReadyState] === _WebSocket.CLOSED) ; + else if (!isEstablished(this)) { + failWebsocketConnection(this, "Connection was closed before it was established."); + this[kReadyState] = _WebSocket.CLOSING; + } else if (!isClosing(this)) { + const frame2 = new WebsocketFrameSend(); + if (code !== void 0 && reason === void 0) { + frame2.frameData = Buffer.allocUnsafe(2); + frame2.frameData.writeUInt16BE(code, 0); + } else if (code !== void 0 && reason !== void 0) { + frame2.frameData = Buffer.allocUnsafe(2 + reasonByteLength); + frame2.frameData.writeUInt16BE(code, 0); + frame2.frameData.write(reason, 2, "utf-8"); + } else { + frame2.frameData = emptyBuffer; + } + const socket = this[kResponse].socket; + socket.write(frame2.createFrame(opcodes.CLOSE), (err) => { + if (!err) { + this[kSentClose] = true; + } + }); + this[kReadyState] = states.CLOSING; + } else { + this[kReadyState] = _WebSocket.CLOSING; + } + } + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-send + * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data + */ + send(data) { + webidl.brandCheck(this, _WebSocket); + webidl.argumentLengthCheck(arguments, 1, { header: "WebSocket.send" }); + data = webidl.converters.WebSocketSendData(data); + if (this[kReadyState] === _WebSocket.CONNECTING) { + throw new DOMException2("Sent before connected.", "InvalidStateError"); + } + if (!isEstablished(this) || isClosing(this)) { + return; + } + const socket = this[kResponse].socket; + if (typeof data === "string") { + const value = Buffer.from(data); + const frame2 = new WebsocketFrameSend(value); + const buffer = frame2.createFrame(opcodes.TEXT); + __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) + value.byteLength); + socket.write(buffer, () => { + __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) - value.byteLength); + }); + } else if (types2.isArrayBuffer(data)) { + const value = Buffer.from(data); + const frame2 = new WebsocketFrameSend(value); + const buffer = frame2.createFrame(opcodes.BINARY); + __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) + value.byteLength); + socket.write(buffer, () => { + __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) - value.byteLength); + }); + } else if (ArrayBuffer.isView(data)) { + const ab = Buffer.from(data, data.byteOffset, data.byteLength); + const frame2 = new WebsocketFrameSend(ab); + const buffer = frame2.createFrame(opcodes.BINARY); + __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) + ab.byteLength); + socket.write(buffer, () => { + __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) - ab.byteLength); + }); + } else if (isBlobLike2(data)) { + const frame2 = new WebsocketFrameSend(); + data.arrayBuffer().then((ab) => { + const value = Buffer.from(ab); + frame2.frameData = value; + const buffer = frame2.createFrame(opcodes.BINARY); + __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) + value.byteLength); + socket.write(buffer, () => { + __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) - value.byteLength); + }); + }); + } + } + get readyState() { + webidl.brandCheck(this, _WebSocket); + return this[kReadyState]; + } + get bufferedAmount() { + webidl.brandCheck(this, _WebSocket); + return __privateGet(this, _bufferedAmount); + } + get url() { + webidl.brandCheck(this, _WebSocket); + return URLSerializer(this[kWebSocketURL]); + } + get extensions() { + webidl.brandCheck(this, _WebSocket); + return __privateGet(this, _extensions); + } + get protocol() { + webidl.brandCheck(this, _WebSocket); + return __privateGet(this, _protocol); + } + get onopen() { + webidl.brandCheck(this, _WebSocket); + return __privateGet(this, _events).open; + } + set onopen(fn) { + webidl.brandCheck(this, _WebSocket); + if (__privateGet(this, _events).open) { + this.removeEventListener("open", __privateGet(this, _events).open); + } + if (typeof fn === "function") { + __privateGet(this, _events).open = fn; + this.addEventListener("open", fn); + } else { + __privateGet(this, _events).open = null; + } + } + get onerror() { + webidl.brandCheck(this, _WebSocket); + return __privateGet(this, _events).error; + } + set onerror(fn) { + webidl.brandCheck(this, _WebSocket); + if (__privateGet(this, _events).error) { + this.removeEventListener("error", __privateGet(this, _events).error); + } + if (typeof fn === "function") { + __privateGet(this, _events).error = fn; + this.addEventListener("error", fn); + } else { + __privateGet(this, _events).error = null; + } + } + get onclose() { + webidl.brandCheck(this, _WebSocket); + return __privateGet(this, _events).close; + } + set onclose(fn) { + webidl.brandCheck(this, _WebSocket); + if (__privateGet(this, _events).close) { + this.removeEventListener("close", __privateGet(this, _events).close); + } + if (typeof fn === "function") { + __privateGet(this, _events).close = fn; + this.addEventListener("close", fn); + } else { + __privateGet(this, _events).close = null; + } + } + get onmessage() { + webidl.brandCheck(this, _WebSocket); + return __privateGet(this, _events).message; + } + set onmessage(fn) { + webidl.brandCheck(this, _WebSocket); + if (__privateGet(this, _events).message) { + this.removeEventListener("message", __privateGet(this, _events).message); + } + if (typeof fn === "function") { + __privateGet(this, _events).message = fn; + this.addEventListener("message", fn); + } else { + __privateGet(this, _events).message = null; + } + } + get binaryType() { + webidl.brandCheck(this, _WebSocket); + return this[kBinaryType]; + } + set binaryType(type) { + webidl.brandCheck(this, _WebSocket); + if (type !== "blob" && type !== "arraybuffer") { + this[kBinaryType] = "blob"; + } else { + this[kBinaryType] = type; + } + } + }; + _events = new WeakMap(); + _bufferedAmount = new WeakMap(); + _protocol = new WeakMap(); + _extensions = new WeakMap(); + _WebSocket_instances = new WeakSet(); + /** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + */ + onConnectionEstablished_fn = function(response2) { + this[kResponse] = response2; + const parser = new ByteParser(this); + parser.on("drain", function onParserDrain() { + this.ws[kResponse].socket.resume(); + }); + response2.socket.ws = this; + this[kByteParser] = parser; + this[kReadyState] = states.OPEN; + const extensions = response2.headersList.get("sec-websocket-extensions"); + if (extensions !== null) { + __privateSet(this, _extensions, extensions); + } + const protocol = response2.headersList.get("sec-websocket-protocol"); + if (protocol !== null) { + __privateSet(this, _protocol, protocol); + } + fireEvent("open", this); + }; + let WebSocket = _WebSocket; + WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING; + WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN; + WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING; + WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED; + Object.defineProperties(WebSocket.prototype, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors, + url: kEnumerableProperty2, + readyState: kEnumerableProperty2, + bufferedAmount: kEnumerableProperty2, + onopen: kEnumerableProperty2, + onerror: kEnumerableProperty2, + onclose: kEnumerableProperty2, + close: kEnumerableProperty2, + onmessage: kEnumerableProperty2, + binaryType: kEnumerableProperty2, + send: kEnumerableProperty2, + extensions: kEnumerableProperty2, + protocol: kEnumerableProperty2, + [Symbol.toStringTag]: { + value: "WebSocket", + writable: false, + enumerable: false, + configurable: true + } + }); + Object.defineProperties(WebSocket, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors + }); + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.DOMString + ); + webidl.converters["DOMString or sequence"] = function(V) { + if (webidl.util.Type(V) === "Object" && Symbol.iterator in V) { + return webidl.converters["sequence"](V); + } + return webidl.converters.DOMString(V); + }; + webidl.converters.WebSocketInit = webidl.dictionaryConverter([ + { + key: "protocols", + converter: webidl.converters["DOMString or sequence"], + get defaultValue() { + return []; + } + }, + { + key: "dispatcher", + converter: (V) => V, + get defaultValue() { + return getGlobalDispatcher2(); + } + }, + { + key: "headers", + converter: webidl.nullableConverter(webidl.converters.HeadersInit) + } + ]); + webidl.converters["DOMString or sequence or WebSocketInit"] = function(V) { + if (webidl.util.Type(V) === "Object" && !(Symbol.iterator in V)) { + return webidl.converters.WebSocketInit(V); + } + return { protocols: webidl.converters["DOMString or sequence"](V) }; + }; + webidl.converters.WebSocketSendData = function(V) { + if (webidl.util.Type(V) === "Object") { + if (isBlobLike2(V)) { + return webidl.converters.Blob(V, { strict: false }); + } + if (ArrayBuffer.isView(V) || types2.isAnyArrayBuffer(V)) { + return webidl.converters.BufferSource(V); + } + } + return webidl.converters.USVString(V); + }; + websocket = { + WebSocket + }; + return websocket; +} +const Client2 = client; +const Dispatcher2 = dispatcher; +const errors$3 = errors$4; +const Pool2 = pool; +const BalancedPool2 = balancedPool; +const Agent2 = agent; +const util$2 = util$l; +const { InvalidArgumentError: InvalidArgumentError2 } = errors$3; +const api = api$1; +const buildConnector = connect$2; +const MockClient2 = mockClient; +const MockAgent2 = mockAgent; +const MockPool2 = mockPool; +const mockErrors = mockErrors$1; +const ProxyAgent2 = proxyAgent; +const RetryHandler2 = RetryHandler_1; +const { getGlobalDispatcher, setGlobalDispatcher } = global$1; +const DecoratorHandler2 = DecoratorHandler_1; +const RedirectHandler2 = RedirectHandler_1; +const createRedirectInterceptor = redirectInterceptor; +let hasCrypto; +try { + require("crypto"); + hasCrypto = true; +} catch { + hasCrypto = false; +} +Object.assign(Dispatcher2.prototype, api); +undici.Dispatcher = Dispatcher2; +undici.Client = Client2; +undici.Pool = Pool2; +undici.BalancedPool = BalancedPool2; +undici.Agent = Agent2; +undici.ProxyAgent = ProxyAgent2; +undici.RetryHandler = RetryHandler2; +undici.DecoratorHandler = DecoratorHandler2; +undici.RedirectHandler = RedirectHandler2; +undici.createRedirectInterceptor = createRedirectInterceptor; +undici.buildConnector = buildConnector; +undici.errors = errors$3; +function makeDispatcher(fn) { + return (url, opts, handler2) => { + if (typeof opts === "function") { + handler2 = opts; + opts = null; + } + if (!url || typeof url !== "string" && typeof url !== "object" && !(url instanceof URL)) { + throw new InvalidArgumentError2("invalid url"); + } + if (opts != null && typeof opts !== "object") { + throw new InvalidArgumentError2("invalid opts"); + } + if (opts && opts.path != null) { + if (typeof opts.path !== "string") { + throw new InvalidArgumentError2("invalid opts.path"); + } + let path2 = opts.path; + if (!opts.path.startsWith("/")) { + path2 = `/${path2}`; + } + url = new URL(util$2.parseOrigin(url).origin + path2); + } else { + if (!opts) { + opts = typeof url === "object" ? url : {}; + } + url = util$2.parseURL(url); + } + const { agent: agent2, dispatcher: dispatcher2 = getGlobalDispatcher() } = opts; + if (agent2) { + throw new InvalidArgumentError2("unsupported opts.agent. Did you mean opts.client?"); + } + return fn.call(dispatcher2, { + ...opts, + origin: url.origin, + path: url.search ? `${url.pathname}${url.search}` : url.pathname, + method: opts.method || (opts.body ? "PUT" : "GET") + }, handler2); + }; +} +undici.setGlobalDispatcher = setGlobalDispatcher; +undici.getGlobalDispatcher = getGlobalDispatcher; +if (util$2.nodeMajor > 16 || util$2.nodeMajor === 16 && util$2.nodeMinor >= 8) { + let fetchImpl = null; + undici.fetch = async function fetch(resource) { + if (!fetchImpl) { + fetchImpl = requireFetch().fetch; + } + try { + return await fetchImpl(...arguments); + } catch (err) { + if (typeof err === "object") { + Error.captureStackTrace(err, this); + } + throw err; + } + }; + undici.Headers = requireHeaders().Headers; + undici.Response = requireResponse().Response; + undici.Request = requireRequest().Request; + undici.FormData = requireFormdata().FormData; + undici.File = requireFile().File; + undici.FileReader = requireFilereader().FileReader; + const { setGlobalOrigin, getGlobalOrigin } = requireGlobal(); + undici.setGlobalOrigin = setGlobalOrigin; + undici.getGlobalOrigin = getGlobalOrigin; + const { CacheStorage } = requireCachestorage(); + const { kConstruct } = requireSymbols$1(); + undici.caches = new CacheStorage(kConstruct); +} +if (util$2.nodeMajor >= 16) { + const { deleteCookie, getCookies, getSetCookies, setCookie } = requireCookies(); + undici.deleteCookie = deleteCookie; + undici.getCookies = getCookies; + undici.getSetCookies = getSetCookies; + undici.setCookie = setCookie; + const { parseMIMEType, serializeAMimeType } = requireDataURL(); + undici.parseMIMEType = parseMIMEType; + undici.serializeAMimeType = serializeAMimeType; +} +if (util$2.nodeMajor >= 18 && hasCrypto) { + const { WebSocket } = requireWebsocket(); + undici.WebSocket = WebSocket; +} +undici.request = makeDispatcher(api.request); +undici.stream = makeDispatcher(api.stream); +undici.pipeline = makeDispatcher(api.pipeline); +undici.connect = makeDispatcher(api.connect); +undici.upgrade = makeDispatcher(api.upgrade); +undici.MockClient = MockClient2; +undici.MockPool = MockPool2; +undici.MockAgent = MockAgent2; +undici.mockErrors = mockErrors; +var __createBinding$6 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); +} : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault$6 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +} : function(o, v) { + o["default"] = v; +}); +var __importStar$6 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$6(result, mod, k); + } + __setModuleDefault$6(result, mod); + return result; +}; +var __awaiter$2 = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(lib$1, "__esModule", { value: true }); +lib$1.HttpClient = lib$1.isHttps = lib$1.HttpClientResponse = lib$1.HttpClientError = lib$1.getProxyUrl = lib$1.MediaTypes = lib$1.Headers = lib$1.HttpCodes = void 0; +const http = __importStar$6(require$$2$2); +const https = __importStar$6(require$$3$1); +const pm = __importStar$6(proxy); +const tunnel = __importStar$6(tunnel$1); +const undici_1$1 = undici; +var HttpCodes; +(function(HttpCodes2) { + HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; + HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; + HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; + HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; + HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; + HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; + HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; + HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; + HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; + HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; + HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes || (lib$1.HttpCodes = HttpCodes = {})); +var Headers; +(function(Headers2) { + Headers2["Accept"] = "accept"; + Headers2["ContentType"] = "content-type"; +})(Headers || (lib$1.Headers = Headers = {})); +var MediaTypes; +(function(MediaTypes2) { + MediaTypes2["ApplicationJson"] = "application/json"; +})(MediaTypes || (lib$1.MediaTypes = MediaTypes = {})); +function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ""; +} +lib$1.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = "HttpClientError"; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } +} +lib$1.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter$2(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter$2(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on("data", (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on("end", () => { + resolve(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter$2(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter$2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } +} +lib$1.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; +} +lib$1.isHttps = isHttps; +class HttpClient { + constructor(userAgent2, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent2; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } + } + options(requestUrl, additionalHeaders) { + return __awaiter$2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); + } + get(requestUrl, additionalHeaders) { + return __awaiter$2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter$2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); + } + post(requestUrl, data, additionalHeaders) { + return __awaiter$2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter$2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter$2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter$2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter$2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); + } + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter$2(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter$2(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter$2(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter$2(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers2) { + return __awaiter$2(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error("Client has already been disposed."); + } + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers2); + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; + let numTries = 0; + let response2; + do { + response2 = yield this.requestRaw(info, data); + if (response2 && response2.message && response2.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler2 of this.handlers) { + if (handler2.canHandleAuthentication(response2)) { + authenticationHandler = handler2; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } else { + return response2; + } + } + let redirectsRemaining = this._maxRedirects; + while (response2.message.statusCode && HttpRedirectCodes.includes(response2.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { + const redirectUrl = response2.message.headers["location"]; + if (!redirectUrl) { + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { + throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); + } + yield response2.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header2 in headers2) { + if (header2.toLowerCase() === "authorization") { + delete headers2[header2]; + } + } + } + info = this._prepareRequest(verb, parsedRedirectUrl, headers2); + response2 = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response2.message.statusCode || !HttpResponseRetryCodes.includes(response2.message.statusCode)) { + return response2; + } + numTries += 1; + if (numTries < maxTries) { + yield response2.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response2; + }); + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return __awaiter$2(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve(res); + } + } + this.requestRawWithCallback(info, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + if (typeof data === "string") { + if (!info.options.headers) { + info.options.headers = {}; + } + info.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(void 0, res); + }); + let socket; + req.on("socket", (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); + } + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); + } + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; + } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers2) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === "https:"; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; + info.options.path = (info.parsedUrl.pathname || "") + (info.parsedUrl.search || ""); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers2); + if (this.userAgent != null) { + info.options.headers["user-agent"] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + if (this.handlers) { + for (const handler2 of this.handlers) { + handler2.prepareRequest(info.options); + } + } + return info; + } + _mergeHeaders(headers2) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys$1(this.requestOptions.headers), lowercaseKeys$1(headers2 || {})); + } + return lowercaseKeys$1(headers2 || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header2, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys$1(this.requestOptions.headers)[header2]; + } + return additionalHeaders[header2] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent2; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent2 = this._proxyAgent; + } + if (!useProxy) { + agent2 = this._agent; + } + if (agent2) { + return agent2; + } + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + }), { host: proxyUrl.hostname, port: proxyUrl.port }) + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === "https:"; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent2 = tunnelAgent(agentOptions); + this._proxyAgent = agent2; + } + if (!agent2) { + const options2 = { keepAlive: this._keepAlive, maxSockets }; + agent2 = usingSsl ? new https.Agent(options2) : new http.Agent(options2); + this._agent = agent2; + } + if (usingSsl && this._ignoreSslError) { + agent2.options = Object.assign(agent2.options || {}, { + rejectUnauthorized: false + }); + } + return agent2; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent2; + if (this._keepAlive) { + proxyAgent2 = this._proxyAgentDispatcher; + } + if (proxyAgent2) { + return proxyAgent2; + } + const usingSsl = parsedUrl.protocol === "https:"; + proxyAgent2 = new undici_1$1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { + token: `${proxyUrl.username}:${proxyUrl.password}` + })); + this._proxyAgentDispatcher = proxyAgent2; + if (usingSsl && this._ignoreSslError) { + proxyAgent2.options = Object.assign(proxyAgent2.options.requestTls || {}, { + rejectUnauthorized: false + }); + } + return proxyAgent2; + } + _performExponentialBackoff(retryNumber) { + return __awaiter$2(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise((resolve) => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options2) { + return __awaiter$2(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter$2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response2 = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve(response2); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options2 && options2.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } else { + obj = JSON.parse(contents); + } + response2.result = obj; + } + response2.headers = res.message.headers; + } catch (err) { + } + if (statusCode > 299) { + let msg; + if (obj && obj.message) { + msg = obj.message; + } else if (contents && contents.length > 0) { + msg = contents; + } else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response2.result; + reject(err); + } else { + resolve(response2); + } + })); + }); + } +} +lib$1.HttpClient = HttpClient; +const lowercaseKeys$1 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); +var __createBinding$5 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); +} : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault$5 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +} : function(o, v) { + o["default"] = v; +}); +var __importStar$5 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$5(result, mod, k); + } + __setModuleDefault$5(result, mod); + return result; +}; +var __awaiter$1 = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(utils$n, "__esModule", { value: true }); +utils$n.getApiBaseUrl = utils$n.getProxyFetch = utils$n.getProxyAgentDispatcher = utils$n.getProxyAgent = utils$n.getAuthString = void 0; +const httpClient = __importStar$5(lib$1); +const undici_1 = undici; +function getAuthString(token, options2) { + if (!token && !options2.auth) { + throw new Error("Parameter token or opts.auth is required"); + } else if (token && options2.auth) { + throw new Error("Parameters token and opts.auth may not both be specified"); + } + return typeof options2.auth === "string" ? options2.auth : `token ${token}`; +} +utils$n.getAuthString = getAuthString; +function getProxyAgent(destinationUrl) { + const hc = new httpClient.HttpClient(); + return hc.getAgent(destinationUrl); +} +utils$n.getProxyAgent = getProxyAgent; +function getProxyAgentDispatcher(destinationUrl) { + const hc = new httpClient.HttpClient(); + return hc.getAgentDispatcher(destinationUrl); +} +utils$n.getProxyAgentDispatcher = getProxyAgentDispatcher; +function getProxyFetch(destinationUrl) { + const httpDispatcher = getProxyAgentDispatcher(destinationUrl); + const proxyFetch = (url, opts) => __awaiter$1(this, void 0, void 0, function* () { + return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); + }); + return proxyFetch; +} +utils$n.getProxyFetch = getProxyFetch; +function getApiBaseUrl() { + return process.env["GITHUB_API_URL"] || "https://api.github.com"; +} +utils$n.getApiBaseUrl = getApiBaseUrl; +function getUserAgent() { + if (typeof navigator === "object" && "userAgent" in navigator) { + return navigator.userAgent; + } + if (typeof process === "object" && process.version !== void 0) { + return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; + } + return ""; +} +var beforeAfterHook = { exports: {} }; +var register_1 = register$1; +function register$1(state, name, method, options2) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); + } + if (!options2) { + options2 = {}; + } + if (Array.isArray(name)) { + return name.reverse().reduce(function(callback, name2) { + return register$1.bind(null, state, name2, callback, options2); + }, method)(); + } + return Promise.resolve().then(function() { + if (!state.registry[name]) { + return method(options2); + } + return state.registry[name].reduce(function(method2, registered) { + return registered.hook.bind(null, method2, options2); + }, method)(); + }); +} +var add = addHook$1; +function addHook$1(state, kind, name, hook2) { + var orig = hook2; + if (!state.registry[name]) { + state.registry[name] = []; + } + if (kind === "before") { + hook2 = function(method, options2) { + return Promise.resolve().then(orig.bind(null, options2)).then(method.bind(null, options2)); + }; + } + if (kind === "after") { + hook2 = function(method, options2) { + var result; + return Promise.resolve().then(method.bind(null, options2)).then(function(result_) { + result = result_; + return orig(result, options2); + }).then(function() { + return result; + }); + }; + } + if (kind === "error") { + hook2 = function(method, options2) { + return Promise.resolve().then(method.bind(null, options2)).catch(function(error2) { + return orig(error2, options2); + }); + }; + } + state.registry[name].push({ + hook: hook2, + orig + }); +} +var remove = removeHook$1; +function removeHook$1(state, name, method) { + if (!state.registry[name]) { + return; + } + var index = state.registry[name].map(function(registered) { + return registered.orig; + }).indexOf(method); + if (index === -1) { + return; + } + state.registry[name].splice(index, 1); +} +var register = register_1; +var addHook = add; +var removeHook = remove; +var bind = Function.bind; +var bindable = bind.bind(bind); +function bindApi(hook2, state, name) { + var removeHookRef = bindable(removeHook, null).apply( + null, + name ? [state, name] : [state] + ); + hook2.api = { remove: removeHookRef }; + hook2.remove = removeHookRef; + ["before", "error", "after", "wrap"].forEach(function(kind) { + var args = name ? [state, kind, name] : [state, kind]; + hook2[kind] = hook2.api[kind] = bindable(addHook, null).apply(null, args); + }); +} +function HookSingular() { + var singularHookName = "h"; + var singularHookState = { + registry: {} + }; + var singularHook = register.bind(null, singularHookState, singularHookName); + bindApi(singularHook, singularHookState, singularHookName); + return singularHook; +} +function HookCollection() { + var state = { + registry: {} + }; + var hook2 = register.bind(null, state); + bindApi(hook2, state); + return hook2; +} +var collectionHookDeprecationMessageDisplayed = false; +function Hook() { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn( + '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' + ); + collectionHookDeprecationMessageDisplayed = true; + } + return HookCollection(); +} +Hook.Singular = HookSingular.bind(); +Hook.Collection = HookCollection.bind(); +beforeAfterHook.exports = Hook; +beforeAfterHook.exports.Hook = Hook; +beforeAfterHook.exports.Singular = Hook.Singular; +var Collection = beforeAfterHook.exports.Collection = Hook.Collection; +var VERSION$5 = "9.0.5"; +var userAgent = `octokit-endpoint.js/${VERSION$5} ${getUserAgent()}`; +var DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent + }, + mediaType: { + format: "" + } +}; +function lowercaseKeys(object) { + if (!object) { + return {}; + } + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); +} +function isPlainObject$1(value) { + if (typeof value !== "object" || value === null) + return false; + if (Object.prototype.toString.call(value) !== "[object Object]") + return false; + const proto = Object.getPrototypeOf(value); + if (proto === null) + return true; + const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); +} +function mergeDeep(defaults, options2) { + const result = Object.assign({}, defaults); + Object.keys(options2).forEach((key) => { + if (isPlainObject$1(options2[key])) { + if (!(key in defaults)) + Object.assign(result, { [key]: options2[key] }); + else + result[key] = mergeDeep(defaults[key], options2[key]); + } else { + Object.assign(result, { [key]: options2[key] }); + } + }); + return result; +} +function removeUndefinedProperties(obj) { + for (const key in obj) { + if (obj[key] === void 0) { + delete obj[key]; + } + } + return obj; +} +function merge$2(defaults, route, options2) { + var _a2; + if (typeof route === "string") { + let [method, url] = route.split(" "); + options2 = Object.assign(url ? { method, url } : { url: method }, options2); + } else { + options2 = Object.assign({}, route); + } + options2.headers = lowercaseKeys(options2.headers); + removeUndefinedProperties(options2); + removeUndefinedProperties(options2.headers); + const mergedOptions = mergeDeep(defaults || {}, options2); + if (options2.url === "/graphql") { + if (defaults && ((_a2 = defaults.mediaType.previews) == null ? void 0 : _a2.length)) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter( + (preview) => !mergedOptions.mediaType.previews.includes(preview) + ).concat(mergedOptions.mediaType.previews); + } + mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); + } + return mergedOptions; +} +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); + if (names.length === 0) { + return url; + } + return url + separator + names.map((name) => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); +} +var urlVariableRegex = /\{[^}]+\}/g; +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); +} +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); + if (!matches) { + return []; + } + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); +} +function omit(object, keysToOmit) { + const result = { __proto__: null }; + for (const key of Object.keys(object)) { + if (keysToOmit.indexOf(key) === -1) { + result[key] = object[key]; + } + } + return result; +} +function encodeReserved(str) { + return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { + if (!/%[0-9A-Fa-f]/.test(part)) { + part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); + } + return part; + }).join(""); +} +function encodeUnreserved(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} +function encodeValue(operator, value, key) { + value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); + if (key) { + return encodeUnreserved(key) + "=" + value; + } else { + return value; + } +} +function isDefined(value) { + return value !== void 0 && value !== null; +} +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} +function getValues(context2, operator, key, modifier) { + var value = context2[key], result = []; + if (isDefined(value) && value !== "") { + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + value = value.toString(); + if (modifier && modifier !== "*") { + value = value.substring(0, parseInt(modifier, 10)); + } + result.push( + encodeValue(operator, value, isKeyOperator(operator) ? key : "") + ); + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function(value2) { + result.push( + encodeValue(operator, value2, isKeyOperator(operator) ? key : "") + ); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined(value[k])) { + result.push(encodeValue(operator, value[k], k)); + } + }); + } + } else { + const tmp = []; + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function(value2) { + tmp.push(encodeValue(operator, value2)); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined(value[k])) { + tmp.push(encodeUnreserved(k)); + tmp.push(encodeValue(operator, value[k].toString())); + } + }); + } + if (isKeyOperator(operator)) { + result.push(encodeUnreserved(key) + "=" + tmp.join(",")); + } else if (tmp.length !== 0) { + result.push(tmp.join(",")); + } + } + } + } else { + if (operator === ";") { + if (isDefined(value)) { + result.push(encodeUnreserved(key)); + } + } else if (value === "" && (operator === "&" || operator === "?")) { + result.push(encodeUnreserved(key) + "="); + } else if (value === "") { + result.push(""); + } + } + return result; +} +function parseUrl(template) { + return { + expand: expand$2.bind(null, template) + }; +} +function expand$2(template, context2) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + template = template.replace( + /\{([^\{\}]+)\}|([^\{\}]+)/g, + function(_, expression, literal) { + if (expression) { + let operator = ""; + const values = []; + if (operators.indexOf(expression.charAt(0)) !== -1) { + operator = expression.charAt(0); + expression = expression.substr(1); + } + expression.split(/,/g).forEach(function(variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context2, operator, tmp[1], tmp[2] || tmp[3])); + }); + if (operator && operator !== "+") { + var separator = ","; + if (operator === "?") { + separator = "&"; + } else if (operator !== "#") { + separator = operator; + } + return (values.length !== 0 ? operator : "") + values.join(separator); + } else { + return values.join(","); + } + } else { + return encodeReserved(literal); + } + } + ); + if (template === "/") { + return template; + } else { + return template.replace(/\/$/, ""); + } +} +function parse$a(options2) { + var _a2; + let method = options2.method.toUpperCase(); + let url = (options2.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); + let headers2 = Object.assign({}, options2.headers); + let body2; + let parameters = omit(options2, [ + "method", + "baseUrl", + "url", + "headers", + "request", + "mediaType" + ]); + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); + if (!/^http/.test(url)) { + url = options2.baseUrl + url; + } + const omittedParameters = Object.keys(options2).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); + const remainingParameters = omit(parameters, omittedParameters); + const isBinaryRequest = /application\/octet-stream/i.test(headers2.accept); + if (!isBinaryRequest) { + if (options2.mediaType.format) { + headers2.accept = headers2.accept.split(/,/).map( + (format) => format.replace( + /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, + `application/vnd$1$2.${options2.mediaType.format}` + ) + ).join(","); + } + if (url.endsWith("/graphql")) { + if ((_a2 = options2.mediaType.previews) == null ? void 0 : _a2.length) { + const previewsFromAcceptHeader = headers2.accept.match(/[\w-]+(?=-preview)/g) || []; + headers2.accept = previewsFromAcceptHeader.concat(options2.mediaType.previews).map((preview) => { + const format = options2.mediaType.format ? `.${options2.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format}`; + }).join(","); + } + } + } + if (["GET", "HEAD"].includes(method)) { + url = addQueryParameters(url, remainingParameters); + } else { + if ("data" in remainingParameters) { + body2 = remainingParameters.data; + } else { + if (Object.keys(remainingParameters).length) { + body2 = remainingParameters; + } + } + } + if (!headers2["content-type"] && typeof body2 !== "undefined") { + headers2["content-type"] = "application/json; charset=utf-8"; + } + if (["PATCH", "PUT"].includes(method) && typeof body2 === "undefined") { + body2 = ""; + } + return Object.assign( + { method, url, headers: headers2 }, + typeof body2 !== "undefined" ? { body: body2 } : null, + options2.request ? { request: options2.request } : null + ); +} +function endpointWithDefaults(defaults, route, options2) { + return parse$a(merge$2(defaults, route, options2)); +} +function withDefaults$2(oldDefaults, newDefaults) { + const DEFAULTS2 = merge$2(oldDefaults, newDefaults); + const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); + return Object.assign(endpoint2, { + DEFAULTS: DEFAULTS2, + defaults: withDefaults$2.bind(null, DEFAULTS2), + merge: merge$2.bind(null, DEFAULTS2), + parse: parse$a + }); +} +var endpoint = withDefaults$2(null, DEFAULTS); +class Deprecation extends Error { + constructor(message) { + super(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + this.name = "Deprecation"; + } +} +var once$2 = { exports: {} }; +var wrappy_1 = wrappy$1; +function wrappy$1(fn, cb) { + if (fn && cb) return wrappy$1(fn)(cb); + if (typeof fn !== "function") + throw new TypeError("need wrapper function"); + Object.keys(fn).forEach(function(k) { + wrapper[k] = fn[k]; + }); + return wrapper; + function wrapper() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var ret = fn.apply(this, args); + var cb2 = args[args.length - 1]; + if (typeof ret === "function" && ret !== cb2) { + Object.keys(cb2).forEach(function(k) { + ret[k] = cb2[k]; + }); + } + return ret; + } +} +var wrappy = wrappy_1; +once$2.exports = wrappy(once); +once$2.exports.strict = wrappy(onceStrict); +once.proto = once(function() { + Object.defineProperty(Function.prototype, "once", { + value: function() { + return once(this); + }, + configurable: true + }); + Object.defineProperty(Function.prototype, "onceStrict", { + value: function() { + return onceStrict(this); + }, + configurable: true + }); +}); +function once(fn) { + var f2 = function() { + if (f2.called) return f2.value; + f2.called = true; + return f2.value = fn.apply(this, arguments); + }; + f2.called = false; + return f2; +} +function onceStrict(fn) { + var f2 = function() { + if (f2.called) + throw new Error(f2.onceError); + f2.called = true; + return f2.value = fn.apply(this, arguments); + }; + var name = fn.name || "Function wrapped with `once`"; + f2.onceError = name + " shouldn't be called more than once"; + f2.called = false; + return f2; +} +var onceExports = once$2.exports; +const once$1 = /* @__PURE__ */ getDefaultExportFromCjs(onceExports); +var logOnceCode = once$1((deprecation) => console.warn(deprecation)); +var logOnceHeaders = once$1((deprecation) => console.warn(deprecation)); +var RequestError = class extends Error { + constructor(message, statusCode, options2) { + super(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + this.name = "HttpError"; + this.status = statusCode; + let headers2; + if ("headers" in options2 && typeof options2.headers !== "undefined") { + headers2 = options2.headers; + } + if ("response" in options2) { + this.response = options2.response; + headers2 = options2.response.headers; + } + const requestCopy = Object.assign({}, options2.request); + if (options2.request.headers.authorization) { + requestCopy.headers = Object.assign({}, options2.request.headers, { + authorization: options2.request.headers.authorization.replace( + / .*$/, + " [REDACTED]" + ) + }); + } + requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); + this.request = requestCopy; + Object.defineProperty(this, "code", { + get() { + logOnceCode( + new Deprecation( + "[@octokit/request-error] `error.code` is deprecated, use `error.status`." + ) + ); + return statusCode; + } + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders( + new Deprecation( + "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`." + ) + ); + return headers2 || {}; + } + }); + } +}; +var VERSION$4 = "8.4.0"; +function isPlainObject(value) { + if (typeof value !== "object" || value === null) + return false; + if (Object.prototype.toString.call(value) !== "[object Object]") + return false; + const proto = Object.getPrototypeOf(value); + if (proto === null) + return true; + const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); +} +function getBufferResponse(response2) { + return response2.arrayBuffer(); +} +function fetchWrapper(requestOptions) { + var _a2, _b, _c, _d; + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + const parseSuccessResponseBody = ((_a2 = requestOptions.request) == null ? void 0 : _a2.parseSuccessResponseBody) !== false; + if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); + } + let headers2 = {}; + let status; + let url; + let { fetch } = globalThis; + if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) { + fetch = requestOptions.request.fetch; + } + if (!fetch) { + throw new Error( + "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing" + ); + } + return fetch(requestOptions.url, { + method: requestOptions.method, + body: requestOptions.body, + redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect, + headers: requestOptions.headers, + signal: (_d = requestOptions.request) == null ? void 0 : _d.signal, + // duplex must be set if request.body is ReadableStream or Async Iterables. + // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. + ...requestOptions.body && { duplex: "half" } + }).then(async (response2) => { + url = response2.url; + status = response2.status; + for (const keyAndValue of response2.headers) { + headers2[keyAndValue[0]] = keyAndValue[1]; + } + if ("deprecation" in headers2) { + const matches = headers2.link && headers2.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn( + `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers2.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` + ); + } + if (status === 204 || status === 205) { + return; + } + if (requestOptions.method === "HEAD") { + if (status < 400) { + return; + } + throw new RequestError(response2.statusText, status, { + response: { + url, + status, + headers: headers2, + data: void 0 + }, + request: requestOptions + }); + } + if (status === 304) { + throw new RequestError("Not modified", status, { + response: { + url, + status, + headers: headers2, + data: await getResponseData(response2) + }, + request: requestOptions + }); + } + if (status >= 400) { + const data = await getResponseData(response2); + const error2 = new RequestError(toErrorMessage(data), status, { + response: { + url, + status, + headers: headers2, + data + }, + request: requestOptions + }); + throw error2; + } + return parseSuccessResponseBody ? await getResponseData(response2) : response2.body; + }).then((data) => { + return { + status, + url, + headers: headers2, + data + }; + }).catch((error2) => { + if (error2 instanceof RequestError) + throw error2; + else if (error2.name === "AbortError") + throw error2; + let message = error2.message; + if (error2.name === "TypeError" && "cause" in error2) { + if (error2.cause instanceof Error) { + message = error2.cause.message; + } else if (typeof error2.cause === "string") { + message = error2.cause; + } + } + throw new RequestError(message, 500, { + request: requestOptions + }); + }); +} +async function getResponseData(response2) { + const contentType = response2.headers.get("content-type"); + if (/application\/json/.test(contentType)) { + return response2.json().catch(() => response2.text()).catch(() => ""); + } + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response2.text(); + } + return getBufferResponse(response2); +} +function toErrorMessage(data) { + if (typeof data === "string") + return data; + let suffix; + if ("documentation_url" in data) { + suffix = ` - ${data.documentation_url}`; + } else { + suffix = ""; + } + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; + } + return `${data.message}${suffix}`; + } + return `Unknown error: ${JSON.stringify(data)}`; +} +function withDefaults$1(oldEndpoint, newDefaults) { + const endpoint2 = oldEndpoint.defaults(newDefaults); + const newApi = function(route, parameters) { + const endpointOptions = endpoint2.merge(route, parameters); + if (!endpointOptions.request || !endpointOptions.request.hook) { + return fetchWrapper(endpoint2.parse(endpointOptions)); + } + const request2 = (route2, parameters2) => { + return fetchWrapper( + endpoint2.parse(endpoint2.merge(route2, parameters2)) + ); + }; + Object.assign(request2, { + endpoint: endpoint2, + defaults: withDefaults$1.bind(null, endpoint2) + }); + return endpointOptions.request.hook(request2, endpointOptions); + }; + return Object.assign(newApi, { + endpoint: endpoint2, + defaults: withDefaults$1.bind(null, endpoint2) + }); +} +var request = withDefaults$1(endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION$4} ${getUserAgent()}` + } +}); +var VERSION$3 = "7.1.0"; +function _buildMessageForResponseErrors(data) { + return `Request failed due to following response errors: +` + data.errors.map((e) => ` - ${e.message}`).join("\n"); +} +var GraphqlResponseError = class extends Error { + constructor(request2, headers2, response2) { + super(_buildMessageForResponseErrors(response2)); + this.request = request2; + this.headers = headers2; + this.response = response2; + this.name = "GraphqlResponseError"; + this.errors = response2.errors; + this.data = response2.data; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } +}; +var NON_VARIABLE_OPTIONS = [ + "method", + "baseUrl", + "url", + "headers", + "request", + "query", + "mediaType" +]; +var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; +var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; +function graphql(request2, query, options2) { + if (options2) { + if (typeof query === "string" && "query" in options2) { + return Promise.reject( + new Error(`[@octokit/graphql] "query" cannot be used as variable name`) + ); + } + for (const key in options2) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) + continue; + return Promise.reject( + new Error( + `[@octokit/graphql] "${key}" cannot be used as variable name` + ) + ); + } + } + const parsedOptions = typeof query === "string" ? Object.assign({ query }, options2) : query; + const requestOptions = Object.keys( + parsedOptions + ).reduce((result, key) => { + if (NON_VARIABLE_OPTIONS.includes(key)) { + result[key] = parsedOptions[key]; + return result; + } + if (!result.variables) { + result.variables = {}; + } + result.variables[key] = parsedOptions[key]; + return result; + }, {}); + const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl; + if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { + requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); + } + return request2(requestOptions).then((response2) => { + if (response2.data.errors) { + const headers2 = {}; + for (const key of Object.keys(response2.headers)) { + headers2[key] = response2.headers[key]; + } + throw new GraphqlResponseError( + requestOptions, + headers2, + response2.data + ); + } + return response2.data.data; + }); +} +function withDefaults(request2, newDefaults) { + const newRequest = request2.defaults(newDefaults); + const newApi = (query, options2) => { + return graphql(newRequest, query, options2); + }; + return Object.assign(newApi, { + defaults: withDefaults.bind(null, newRequest), + endpoint: newRequest.endpoint + }); +} +withDefaults(request, { + headers: { + "user-agent": `octokit-graphql.js/${VERSION$3} ${getUserAgent()}` + }, + method: "POST", + url: "/graphql" +}); +function withCustomRequest(customRequest) { + return withDefaults(customRequest, { + method: "POST", + url: "/graphql" + }); +} +var REGEX_IS_INSTALLATION_LEGACY = /^v1\./; +var REGEX_IS_INSTALLATION = /^ghs_/; +var REGEX_IS_USER_TO_SERVER = /^ghu_/; +async function auth$1(token) { + const isApp = token.split(/\./).length === 3; + const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); + const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); + const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; + return { + type: "token", + token, + tokenType + }; +} +function withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) { + return `bearer ${token}`; + } + return `token ${token}`; +} +async function hook(token, request2, route, parameters) { + const endpoint2 = request2.endpoint.merge( + route, + parameters + ); + endpoint2.headers.authorization = withAuthorizationPrefix(token); + return request2(endpoint2); +} +var createTokenAuth = function createTokenAuth2(token) { + if (!token) { + throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); + } + if (typeof token !== "string") { + throw new Error( + "[@octokit/auth-token] Token passed to createTokenAuth is not a string" + ); + } + token = token.replace(/^(token|bearer) +/i, ""); + return Object.assign(auth$1.bind(null, token), { + hook: hook.bind(null, token) + }); +}; +var VERSION$2 = "5.2.0"; +var noop$2 = () => { +}; +var consoleWarn = console.warn.bind(console); +var consoleError = console.error.bind(console); +var userAgentTrail = `octokit-core.js/${VERSION$2} ${getUserAgent()}`; +var Octokit = (_a = class { + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options2 = args[0] || {}; + if (typeof defaults === "function") { + super(defaults(options2)); + return; + } + super( + Object.assign( + {}, + defaults, + options2, + options2.userAgent && defaults.userAgent ? { + userAgent: `${options2.userAgent} ${defaults.userAgent}` + } : null + ) + ); + } + }; + return OctokitWithDefaults; + } + /** + * Attach a plugin (or many) to your Octokit instance. + * + * @example + * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) + */ + static plugin(...newPlugins) { + var _a2; + const currentPlugins = this.plugins; + const NewOctokit = (_a2 = class extends this { + }, _a2.plugins = currentPlugins.concat( + newPlugins.filter((plugin) => !currentPlugins.includes(plugin)) + ), _a2); + return NewOctokit; + } + constructor(options2 = {}) { + const hook2 = new Collection(); + const requestDefaults = { + baseUrl: request.endpoint.DEFAULTS.baseUrl, + headers: {}, + request: Object.assign({}, options2.request, { + // @ts-ignore internal usage only, no need to type + hook: hook2.bind(null, "request") + }), + mediaType: { + previews: [], + format: "" + } + }; + requestDefaults.headers["user-agent"] = options2.userAgent ? `${options2.userAgent} ${userAgentTrail}` : userAgentTrail; + if (options2.baseUrl) { + requestDefaults.baseUrl = options2.baseUrl; + } + if (options2.previews) { + requestDefaults.mediaType.previews = options2.previews; + } + if (options2.timeZone) { + requestDefaults.headers["time-zone"] = options2.timeZone; + } + this.request = request.defaults(requestDefaults); + this.graphql = withCustomRequest(this.request).defaults(requestDefaults); + this.log = Object.assign( + { + debug: noop$2, + info: noop$2, + warn: consoleWarn, + error: consoleError + }, + options2.log + ); + this.hook = hook2; + if (!options2.authStrategy) { + if (!options2.auth) { + this.auth = async () => ({ + type: "unauthenticated" + }); + } else { + const auth2 = createTokenAuth(options2.auth); + hook2.wrap("request", auth2.hook); + this.auth = auth2; + } + } else { + const { authStrategy, ...otherOptions } = options2; + const auth2 = authStrategy( + Object.assign( + { + request: this.request, + log: this.log, + // we pass the current octokit instance as well as its constructor options + // to allow for authentication strategies that return a new octokit instance + // that shares the same internal state as the current one. The original + // requirement for this was the "event-octokit" authentication strategy + // of https://github.com/probot/octokit-auth-probot. + octokit: this, + octokitOptions: otherOptions + }, + options2.auth + ) + ); + hook2.wrap("request", auth2.hook); + this.auth = auth2; + } + const classConstructor = this.constructor; + for (let i = 0; i < classConstructor.plugins.length; ++i) { + Object.assign(this, classConstructor.plugins[i](this, options2)); + } + } +}, _a.VERSION = VERSION$2, _a.plugins = [], _a); +const distWeb$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + Octokit +}, Symbol.toStringTag, { value: "Module" })); +const require$$2$1 = /* @__PURE__ */ getAugmentedNamespace(distWeb$2); +var VERSION$1 = "10.4.1"; +var Endpoints = { + actions: { + addCustomLabelsToSelfHostedRunnerForOrg: [ + "POST /orgs/{org}/actions/runners/{runner_id}/labels" + ], + addCustomLabelsToSelfHostedRunnerForRepo: [ + "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" + ], + addSelectedRepoToOrgSecret: [ + "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" + ], + addSelectedRepoToOrgVariable: [ + "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" + ], + approveWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve" + ], + cancelWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel" + ], + createEnvironmentVariable: [ + "POST /repositories/{repository_id}/environments/{environment_name}/variables" + ], + createOrUpdateEnvironmentSecret: [ + "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" + ], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], + createOrUpdateRepoSecret: [ + "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}" + ], + createOrgVariable: ["POST /orgs/{org}/actions/variables"], + createRegistrationTokenForOrg: [ + "POST /orgs/{org}/actions/runners/registration-token" + ], + createRegistrationTokenForRepo: [ + "POST /repos/{owner}/{repo}/actions/runners/registration-token" + ], + createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], + createRemoveTokenForRepo: [ + "POST /repos/{owner}/{repo}/actions/runners/remove-token" + ], + createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"], + createWorkflowDispatch: [ + "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" + ], + deleteActionsCacheById: [ + "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}" + ], + deleteActionsCacheByKey: [ + "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}" + ], + deleteArtifact: [ + "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}" + ], + deleteEnvironmentSecret: [ + "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" + ], + deleteEnvironmentVariable: [ + "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}" + ], + deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], + deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"], + deleteRepoSecret: [ + "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}" + ], + deleteRepoVariable: [ + "DELETE /repos/{owner}/{repo}/actions/variables/{name}" + ], + deleteSelfHostedRunnerFromOrg: [ + "DELETE /orgs/{org}/actions/runners/{runner_id}" + ], + deleteSelfHostedRunnerFromRepo: [ + "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}" + ], + deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], + deleteWorkflowRunLogs: [ + "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs" + ], + disableSelectedRepositoryGithubActionsOrganization: [ + "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}" + ], + disableWorkflow: [ + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable" + ], + downloadArtifact: [ + "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}" + ], + downloadJobLogsForWorkflowRun: [ + "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs" + ], + downloadWorkflowRunAttemptLogs: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs" + ], + downloadWorkflowRunLogs: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs" + ], + enableSelectedRepositoryGithubActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}" + ], + enableWorkflow: [ + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable" + ], + forceCancelWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel" + ], + generateRunnerJitconfigForOrg: [ + "POST /orgs/{org}/actions/runners/generate-jitconfig" + ], + generateRunnerJitconfigForRepo: [ + "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig" + ], + getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], + getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], + getActionsCacheUsageByRepoForOrg: [ + "GET /orgs/{org}/actions/cache/usage-by-repository" + ], + getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], + getAllowedActionsOrganization: [ + "GET /orgs/{org}/actions/permissions/selected-actions" + ], + getAllowedActionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" + ], + getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getCustomOidcSubClaimForRepo: [ + "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], + getEnvironmentPublicKey: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" + ], + getEnvironmentSecret: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" + ], + getEnvironmentVariable: [ + "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}" + ], + getGithubActionsDefaultWorkflowPermissionsOrganization: [ + "GET /orgs/{org}/actions/permissions/workflow" + ], + getGithubActionsDefaultWorkflowPermissionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions/workflow" + ], + getGithubActionsPermissionsOrganization: [ + "GET /orgs/{org}/actions/permissions" + ], + getGithubActionsPermissionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions" + ], + getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], + getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"], + getPendingDeploymentsForRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" + ], + getRepoPermissions: [ + "GET /repos/{owner}/{repo}/actions/permissions", + {}, + { renamed: ["actions", "getGithubActionsPermissionsRepository"] } + ], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"], + getReviewsForRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals" + ], + getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], + getSelfHostedRunnerForRepo: [ + "GET /repos/{owner}/{repo}/actions/runners/{runner_id}" + ], + getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], + getWorkflowAccessToRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions/access" + ], + getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], + getWorkflowRunAttempt: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}" + ], + getWorkflowRunUsage: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing" + ], + getWorkflowUsage: [ + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing" + ], + listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listEnvironmentSecrets: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets" + ], + listEnvironmentVariables: [ + "GET /repositories/{repository_id}/environments/{environment_name}/variables" + ], + listJobsForWorkflowRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs" + ], + listJobsForWorkflowRunAttempt: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs" + ], + listLabelsForSelfHostedRunnerForOrg: [ + "GET /orgs/{org}/actions/runners/{runner_id}/labels" + ], + listLabelsForSelfHostedRunnerForRepo: [ + "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" + ], + listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], + listOrgVariables: ["GET /orgs/{org}/actions/variables"], + listRepoOrganizationSecrets: [ + "GET /repos/{owner}/{repo}/actions/organization-secrets" + ], + listRepoOrganizationVariables: [ + "GET /repos/{owner}/{repo}/actions/organization-variables" + ], + listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], + listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"], + listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], + listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], + listRunnerApplicationsForRepo: [ + "GET /repos/{owner}/{repo}/actions/runners/downloads" + ], + listSelectedReposForOrgSecret: [ + "GET /orgs/{org}/actions/secrets/{secret_name}/repositories" + ], + listSelectedReposForOrgVariable: [ + "GET /orgs/{org}/actions/variables/{name}/repositories" + ], + listSelectedRepositoriesEnabledGithubActionsOrganization: [ + "GET /orgs/{org}/actions/permissions/repositories" + ], + listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], + listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], + listWorkflowRunArtifacts: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts" + ], + listWorkflowRuns: [ + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs" + ], + listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], + reRunJobForWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" + ], + reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], + reRunWorkflowFailedJobs: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" + ], + removeAllCustomLabelsFromSelfHostedRunnerForOrg: [ + "DELETE /orgs/{org}/actions/runners/{runner_id}/labels" + ], + removeAllCustomLabelsFromSelfHostedRunnerForRepo: [ + "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" + ], + removeCustomLabelFromSelfHostedRunnerForOrg: [ + "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}" + ], + removeCustomLabelFromSelfHostedRunnerForRepo: [ + "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}" + ], + removeSelectedRepoFromOrgSecret: [ + "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" + ], + removeSelectedRepoFromOrgVariable: [ + "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" + ], + reviewCustomGatesForRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" + ], + reviewPendingDeploymentsForRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" + ], + setAllowedActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/selected-actions" + ], + setAllowedActionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions" + ], + setCustomLabelsForSelfHostedRunnerForOrg: [ + "PUT /orgs/{org}/actions/runners/{runner_id}/labels" + ], + setCustomLabelsForSelfHostedRunnerForRepo: [ + "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" + ], + setCustomOidcSubClaimForRepo: [ + "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], + setGithubActionsDefaultWorkflowPermissionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/workflow" + ], + setGithubActionsDefaultWorkflowPermissionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions/workflow" + ], + setGithubActionsPermissionsOrganization: [ + "PUT /orgs/{org}/actions/permissions" + ], + setGithubActionsPermissionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions" + ], + setSelectedReposForOrgSecret: [ + "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories" + ], + setSelectedReposForOrgVariable: [ + "PUT /orgs/{org}/actions/variables/{name}/repositories" + ], + setSelectedRepositoriesEnabledGithubActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/repositories" + ], + setWorkflowAccessToRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions/access" + ], + updateEnvironmentVariable: [ + "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}" + ], + updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"], + updateRepoVariable: [ + "PATCH /repos/{owner}/{repo}/actions/variables/{name}" + ] + }, + activity: { + checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], + deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], + deleteThreadSubscription: [ + "DELETE /notifications/threads/{thread_id}/subscription" + ], + getFeeds: ["GET /feeds"], + getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], + getThread: ["GET /notifications/threads/{thread_id}"], + getThreadSubscriptionForAuthenticatedUser: [ + "GET /notifications/threads/{thread_id}/subscription" + ], + listEventsForAuthenticatedUser: ["GET /users/{username}/events"], + listNotificationsForAuthenticatedUser: ["GET /notifications"], + listOrgEventsForAuthenticatedUser: [ + "GET /users/{username}/events/orgs/{org}" + ], + listPublicEvents: ["GET /events"], + listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], + listPublicEventsForUser: ["GET /users/{username}/events/public"], + listPublicOrgEvents: ["GET /orgs/{org}/events"], + listReceivedEventsForUser: ["GET /users/{username}/received_events"], + listReceivedPublicEventsForUser: [ + "GET /users/{username}/received_events/public" + ], + listRepoEvents: ["GET /repos/{owner}/{repo}/events"], + listRepoNotificationsForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/notifications" + ], + listReposStarredByAuthenticatedUser: ["GET /user/starred"], + listReposStarredByUser: ["GET /users/{username}/starred"], + listReposWatchedByUser: ["GET /users/{username}/subscriptions"], + listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], + listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], + listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], + markNotificationsAsRead: ["PUT /notifications"], + markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], + markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], + setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], + setThreadSubscription: [ + "PUT /notifications/threads/{thread_id}/subscription" + ], + starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], + unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] + }, + apps: { + addRepoToInstallation: [ + "PUT /user/installations/{installation_id}/repositories/{repository_id}", + {}, + { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] } + ], + addRepoToInstallationForAuthenticatedUser: [ + "PUT /user/installations/{installation_id}/repositories/{repository_id}" + ], + checkToken: ["POST /applications/{client_id}/token"], + createFromManifest: ["POST /app-manifests/{code}/conversions"], + createInstallationAccessToken: [ + "POST /app/installations/{installation_id}/access_tokens" + ], + deleteAuthorization: ["DELETE /applications/{client_id}/grant"], + deleteInstallation: ["DELETE /app/installations/{installation_id}"], + deleteToken: ["DELETE /applications/{client_id}/token"], + getAuthenticated: ["GET /app"], + getBySlug: ["GET /apps/{app_slug}"], + getInstallation: ["GET /app/installations/{installation_id}"], + getOrgInstallation: ["GET /orgs/{org}/installation"], + getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], + getSubscriptionPlanForAccount: [ + "GET /marketplace_listing/accounts/{account_id}" + ], + getSubscriptionPlanForAccountStubbed: [ + "GET /marketplace_listing/stubbed/accounts/{account_id}" + ], + getUserInstallation: ["GET /users/{username}/installation"], + getWebhookConfigForApp: ["GET /app/hook/config"], + getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], + listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], + listAccountsForPlanStubbed: [ + "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts" + ], + listInstallationReposForAuthenticatedUser: [ + "GET /user/installations/{installation_id}/repositories" + ], + listInstallationRequestsForAuthenticatedApp: [ + "GET /app/installation-requests" + ], + listInstallations: ["GET /app/installations"], + listInstallationsForAuthenticatedUser: ["GET /user/installations"], + listPlans: ["GET /marketplace_listing/plans"], + listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], + listReposAccessibleToInstallation: ["GET /installation/repositories"], + listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], + listSubscriptionsForAuthenticatedUserStubbed: [ + "GET /user/marketplace_purchases/stubbed" + ], + listWebhookDeliveries: ["GET /app/hook/deliveries"], + redeliverWebhookDelivery: [ + "POST /app/hook/deliveries/{delivery_id}/attempts" + ], + removeRepoFromInstallation: [ + "DELETE /user/installations/{installation_id}/repositories/{repository_id}", + {}, + { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] } + ], + removeRepoFromInstallationForAuthenticatedUser: [ + "DELETE /user/installations/{installation_id}/repositories/{repository_id}" + ], + resetToken: ["PATCH /applications/{client_id}/token"], + revokeInstallationAccessToken: ["DELETE /installation/token"], + scopeToken: ["POST /applications/{client_id}/token/scoped"], + suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], + unsuspendInstallation: [ + "DELETE /app/installations/{installation_id}/suspended" + ], + updateWebhookConfigForApp: ["PATCH /app/hook/config"] + }, + billing: { + getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], + getGithubActionsBillingUser: [ + "GET /users/{username}/settings/billing/actions" + ], + getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], + getGithubPackagesBillingUser: [ + "GET /users/{username}/settings/billing/packages" + ], + getSharedStorageBillingOrg: [ + "GET /orgs/{org}/settings/billing/shared-storage" + ], + getSharedStorageBillingUser: [ + "GET /users/{username}/settings/billing/shared-storage" + ] + }, + checks: { + create: ["POST /repos/{owner}/{repo}/check-runs"], + createSuite: ["POST /repos/{owner}/{repo}/check-suites"], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], + listAnnotations: [ + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations" + ], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], + listForSuite: [ + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs" + ], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], + rerequestRun: [ + "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest" + ], + rerequestSuite: [ + "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest" + ], + setSuitesPreferences: [ + "PATCH /repos/{owner}/{repo}/check-suites/preferences" + ], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] + }, + codeScanning: { + deleteAnalysis: [ + "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}" + ], + getAlert: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", + {}, + { renamedParameters: { alert_id: "alert_number" } } + ], + getAnalysis: [ + "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}" + ], + getCodeqlDatabase: [ + "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" + ], + getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"], + getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], + listAlertInstances: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances" + ], + listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], + listAlertsInstances: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + {}, + { renamed: ["codeScanning", "listAlertInstances"] } + ], + listCodeqlDatabases: [ + "GET /repos/{owner}/{repo}/code-scanning/codeql/databases" + ], + listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], + updateAlert: [ + "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" + ], + updateDefaultSetup: [ + "PATCH /repos/{owner}/{repo}/code-scanning/default-setup" + ], + uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] + }, + codesOfConduct: { + getAllCodesOfConduct: ["GET /codes_of_conduct"], + getConductCode: ["GET /codes_of_conduct/{key}"] + }, + codespaces: { + addRepositoryForSecretForAuthenticatedUser: [ + "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" + ], + addSelectedRepoToOrgSecret: [ + "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" + ], + checkPermissionsForDevcontainer: [ + "GET /repos/{owner}/{repo}/codespaces/permissions_check" + ], + codespaceMachinesForAuthenticatedUser: [ + "GET /user/codespaces/{codespace_name}/machines" + ], + createForAuthenticatedUser: ["POST /user/codespaces"], + createOrUpdateOrgSecret: [ + "PUT /orgs/{org}/codespaces/secrets/{secret_name}" + ], + createOrUpdateRepoSecret: [ + "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" + ], + createOrUpdateSecretForAuthenticatedUser: [ + "PUT /user/codespaces/secrets/{secret_name}" + ], + createWithPrForAuthenticatedUser: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces" + ], + createWithRepoForAuthenticatedUser: [ + "POST /repos/{owner}/{repo}/codespaces" + ], + deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], + deleteFromOrganization: [ + "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}" + ], + deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"], + deleteRepoSecret: [ + "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" + ], + deleteSecretForAuthenticatedUser: [ + "DELETE /user/codespaces/secrets/{secret_name}" + ], + exportForAuthenticatedUser: [ + "POST /user/codespaces/{codespace_name}/exports" + ], + getCodespacesForUserInOrg: [ + "GET /orgs/{org}/members/{username}/codespaces" + ], + getExportDetailsForAuthenticatedUser: [ + "GET /user/codespaces/{codespace_name}/exports/{export_id}" + ], + getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], + getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"], + getPublicKeyForAuthenticatedUser: [ + "GET /user/codespaces/secrets/public-key" + ], + getRepoPublicKey: [ + "GET /repos/{owner}/{repo}/codespaces/secrets/public-key" + ], + getRepoSecret: [ + "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" + ], + getSecretForAuthenticatedUser: [ + "GET /user/codespaces/secrets/{secret_name}" + ], + listDevcontainersInRepositoryForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/codespaces/devcontainers" + ], + listForAuthenticatedUser: ["GET /user/codespaces"], + listInOrganization: [ + "GET /orgs/{org}/codespaces", + {}, + { renamedParameters: { org_id: "org" } } + ], + listInRepositoryForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/codespaces" + ], + listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], + listRepositoriesForSecretForAuthenticatedUser: [ + "GET /user/codespaces/secrets/{secret_name}/repositories" + ], + listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], + listSelectedReposForOrgSecret: [ + "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories" + ], + preFlightWithRepoForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/codespaces/new" + ], + publishForAuthenticatedUser: [ + "POST /user/codespaces/{codespace_name}/publish" + ], + removeRepositoryForSecretForAuthenticatedUser: [ + "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" + ], + removeSelectedRepoFromOrgSecret: [ + "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" + ], + repoMachinesForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/codespaces/machines" + ], + setRepositoriesForSecretForAuthenticatedUser: [ + "PUT /user/codespaces/secrets/{secret_name}/repositories" + ], + setSelectedReposForOrgSecret: [ + "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories" + ], + startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], + stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], + stopInOrganization: [ + "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop" + ], + updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] + }, + copilot: { + addCopilotSeatsForTeams: [ + "POST /orgs/{org}/copilot/billing/selected_teams" + ], + addCopilotSeatsForUsers: [ + "POST /orgs/{org}/copilot/billing/selected_users" + ], + cancelCopilotSeatAssignmentForTeams: [ + "DELETE /orgs/{org}/copilot/billing/selected_teams" + ], + cancelCopilotSeatAssignmentForUsers: [ + "DELETE /orgs/{org}/copilot/billing/selected_users" + ], + getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"], + getCopilotSeatDetailsForUser: [ + "GET /orgs/{org}/members/{username}/copilot" + ], + listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] + }, + dependabot: { + addSelectedRepoToOrgSecret: [ + "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" + ], + createOrUpdateOrgSecret: [ + "PUT /orgs/{org}/dependabot/secrets/{secret_name}" + ], + createOrUpdateRepoSecret: [ + "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" + ], + deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], + deleteRepoSecret: [ + "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" + ], + getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"], + getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], + getRepoPublicKey: [ + "GET /repos/{owner}/{repo}/dependabot/secrets/public-key" + ], + getRepoSecret: [ + "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" + ], + listAlertsForEnterprise: [ + "GET /enterprises/{enterprise}/dependabot/alerts" + ], + listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"], + listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], + listSelectedReposForOrgSecret: [ + "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories" + ], + removeSelectedRepoFromOrgSecret: [ + "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" + ], + setSelectedReposForOrgSecret: [ + "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories" + ], + updateAlert: [ + "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}" + ] + }, + dependencyGraph: { + createRepositorySnapshot: [ + "POST /repos/{owner}/{repo}/dependency-graph/snapshots" + ], + diffRange: [ + "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}" + ], + exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"] + }, + emojis: { get: ["GET /emojis"] }, + gists: { + checkIsStarred: ["GET /gists/{gist_id}/star"], + create: ["POST /gists"], + createComment: ["POST /gists/{gist_id}/comments"], + delete: ["DELETE /gists/{gist_id}"], + deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], + fork: ["POST /gists/{gist_id}/forks"], + get: ["GET /gists/{gist_id}"], + getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], + getRevision: ["GET /gists/{gist_id}/{sha}"], + list: ["GET /gists"], + listComments: ["GET /gists/{gist_id}/comments"], + listCommits: ["GET /gists/{gist_id}/commits"], + listForUser: ["GET /users/{username}/gists"], + listForks: ["GET /gists/{gist_id}/forks"], + listPublic: ["GET /gists/public"], + listStarred: ["GET /gists/starred"], + star: ["PUT /gists/{gist_id}/star"], + unstar: ["DELETE /gists/{gist_id}/star"], + update: ["PATCH /gists/{gist_id}"], + updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] + }, + git: { + createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], + createCommit: ["POST /repos/{owner}/{repo}/git/commits"], + createRef: ["POST /repos/{owner}/{repo}/git/refs"], + createTag: ["POST /repos/{owner}/{repo}/git/tags"], + createTree: ["POST /repos/{owner}/{repo}/git/trees"], + deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], + getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], + getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], + getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], + getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], + getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], + listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], + updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] + }, + gitignore: { + getAllTemplates: ["GET /gitignore/templates"], + getTemplate: ["GET /gitignore/templates/{name}"] + }, + interactions: { + getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], + getRestrictionsForYourPublicRepos: [ + "GET /user/interaction-limits", + {}, + { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] } + ], + removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], + removeRestrictionsForRepo: [ + "DELETE /repos/{owner}/{repo}/interaction-limits" + ], + removeRestrictionsForYourPublicRepos: [ + "DELETE /user/interaction-limits", + {}, + { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] } + ], + setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], + setRestrictionsForYourPublicRepos: [ + "PUT /user/interaction-limits", + {}, + { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] } + ] + }, + issues: { + addAssignees: [ + "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees" + ], + addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], + checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], + checkUserCanBeAssignedToIssue: [ + "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}" + ], + create: ["POST /repos/{owner}/{repo}/issues"], + createComment: [ + "POST /repos/{owner}/{repo}/issues/{issue_number}/comments" + ], + createLabel: ["POST /repos/{owner}/{repo}/labels"], + createMilestone: ["POST /repos/{owner}/{repo}/milestones"], + deleteComment: [ + "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}" + ], + deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], + deleteMilestone: [ + "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}" + ], + get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], + getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], + getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], + getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], + getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], + list: ["GET /issues"], + listAssignees: ["GET /repos/{owner}/{repo}/assignees"], + listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], + listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], + listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], + listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], + listEventsForTimeline: [ + "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline" + ], + listForAuthenticatedUser: ["GET /user/issues"], + listForOrg: ["GET /orgs/{org}/issues"], + listForRepo: ["GET /repos/{owner}/{repo}/issues"], + listLabelsForMilestone: [ + "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels" + ], + listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], + listLabelsOnIssue: [ + "GET /repos/{owner}/{repo}/issues/{issue_number}/labels" + ], + listMilestones: ["GET /repos/{owner}/{repo}/milestones"], + lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], + removeAllLabels: [ + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels" + ], + removeAssignees: [ + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees" + ], + removeLabel: [ + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}" + ], + setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], + unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], + update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], + updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], + updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], + updateMilestone: [ + "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}" + ] + }, + licenses: { + get: ["GET /licenses/{license}"], + getAllCommonlyUsed: ["GET /licenses"], + getForRepo: ["GET /repos/{owner}/{repo}/license"] + }, + markdown: { + render: ["POST /markdown"], + renderRaw: [ + "POST /markdown/raw", + { headers: { "content-type": "text/plain; charset=utf-8" } } + ] + }, + meta: { + get: ["GET /meta"], + getAllVersions: ["GET /versions"], + getOctocat: ["GET /octocat"], + getZen: ["GET /zen"], + root: ["GET /"] + }, + migrations: { + cancelImport: [ + "DELETE /repos/{owner}/{repo}/import", + {}, + { + deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import" + } + ], + deleteArchiveForAuthenticatedUser: [ + "DELETE /user/migrations/{migration_id}/archive" + ], + deleteArchiveForOrg: [ + "DELETE /orgs/{org}/migrations/{migration_id}/archive" + ], + downloadArchiveForOrg: [ + "GET /orgs/{org}/migrations/{migration_id}/archive" + ], + getArchiveForAuthenticatedUser: [ + "GET /user/migrations/{migration_id}/archive" + ], + getCommitAuthors: [ + "GET /repos/{owner}/{repo}/import/authors", + {}, + { + deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors" + } + ], + getImportStatus: [ + "GET /repos/{owner}/{repo}/import", + {}, + { + deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status" + } + ], + getLargeFiles: [ + "GET /repos/{owner}/{repo}/import/large_files", + {}, + { + deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files" + } + ], + getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], + getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], + listForAuthenticatedUser: ["GET /user/migrations"], + listForOrg: ["GET /orgs/{org}/migrations"], + listReposForAuthenticatedUser: [ + "GET /user/migrations/{migration_id}/repositories" + ], + listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], + listReposForUser: [ + "GET /user/migrations/{migration_id}/repositories", + {}, + { renamed: ["migrations", "listReposForAuthenticatedUser"] } + ], + mapCommitAuthor: [ + "PATCH /repos/{owner}/{repo}/import/authors/{author_id}", + {}, + { + deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author" + } + ], + setLfsPreference: [ + "PATCH /repos/{owner}/{repo}/import/lfs", + {}, + { + deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference" + } + ], + startForAuthenticatedUser: ["POST /user/migrations"], + startForOrg: ["POST /orgs/{org}/migrations"], + startImport: [ + "PUT /repos/{owner}/{repo}/import", + {}, + { + deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import" + } + ], + unlockRepoForAuthenticatedUser: [ + "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock" + ], + unlockRepoForOrg: [ + "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock" + ], + updateImport: [ + "PATCH /repos/{owner}/{repo}/import", + {}, + { + deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import" + } + ] + }, + oidc: { + getOidcCustomSubTemplateForOrg: [ + "GET /orgs/{org}/actions/oidc/customization/sub" + ], + updateOidcCustomSubTemplateForOrg: [ + "PUT /orgs/{org}/actions/oidc/customization/sub" + ] + }, + orgs: { + addSecurityManagerTeam: [ + "PUT /orgs/{org}/security-managers/teams/{team_slug}" + ], + assignTeamToOrgRole: [ + "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + assignUserToOrgRole: [ + "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], + blockUser: ["PUT /orgs/{org}/blocks/{username}"], + cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], + checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], + checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], + checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], + convertMemberToOutsideCollaborator: [ + "PUT /orgs/{org}/outside_collaborators/{username}" + ], + createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"], + createInvitation: ["POST /orgs/{org}/invitations"], + createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], + createOrUpdateCustomPropertiesValuesForRepos: [ + "PATCH /orgs/{org}/properties/values" + ], + createOrUpdateCustomProperty: [ + "PUT /orgs/{org}/properties/schema/{custom_property_name}" + ], + createWebhook: ["POST /orgs/{org}/hooks"], + delete: ["DELETE /orgs/{org}"], + deleteCustomOrganizationRole: [ + "DELETE /orgs/{org}/organization-roles/{role_id}" + ], + deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], + enableOrDisableSecurityProductOnAllOrgRepos: [ + "POST /orgs/{org}/{security_product}/{enablement}" + ], + get: ["GET /orgs/{org}"], + getAllCustomProperties: ["GET /orgs/{org}/properties/schema"], + getCustomProperty: [ + "GET /orgs/{org}/properties/schema/{custom_property_name}" + ], + getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], + getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], + getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], + getWebhookDelivery: [ + "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}" + ], + list: ["GET /organizations"], + listAppInstallations: ["GET /orgs/{org}/installations"], + listBlockedUsers: ["GET /orgs/{org}/blocks"], + listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], + listForAuthenticatedUser: ["GET /user/orgs"], + listForUser: ["GET /users/{username}/orgs"], + listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], + listMembers: ["GET /orgs/{org}/members"], + listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], + listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], + listOrgRoles: ["GET /orgs/{org}/organization-roles"], + listOrganizationFineGrainedPermissions: [ + "GET /orgs/{org}/organization-fine-grained-permissions" + ], + listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], + listPatGrantRepositories: [ + "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" + ], + listPatGrantRequestRepositories: [ + "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories" + ], + listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"], + listPatGrants: ["GET /orgs/{org}/personal-access-tokens"], + listPendingInvitations: ["GET /orgs/{org}/invitations"], + listPublicMembers: ["GET /orgs/{org}/public_members"], + listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], + listWebhooks: ["GET /orgs/{org}/hooks"], + patchCustomOrganizationRole: [ + "PATCH /orgs/{org}/organization-roles/{role_id}" + ], + pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: [ + "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" + ], + removeCustomProperty: [ + "DELETE /orgs/{org}/properties/schema/{custom_property_name}" + ], + removeMember: ["DELETE /orgs/{org}/members/{username}"], + removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], + removeOutsideCollaborator: [ + "DELETE /orgs/{org}/outside_collaborators/{username}" + ], + removePublicMembershipForAuthenticatedUser: [ + "DELETE /orgs/{org}/public_members/{username}" + ], + removeSecurityManagerTeam: [ + "DELETE /orgs/{org}/security-managers/teams/{team_slug}" + ], + reviewPatGrantRequest: [ + "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}" + ], + reviewPatGrantRequestsInBulk: [ + "POST /orgs/{org}/personal-access-token-requests" + ], + revokeAllOrgRolesTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" + ], + revokeAllOrgRolesUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}" + ], + revokeOrgRoleTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + revokeOrgRoleUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], + setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], + setPublicMembershipForAuthenticatedUser: [ + "PUT /orgs/{org}/public_members/{username}" + ], + unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], + update: ["PATCH /orgs/{org}"], + updateMembershipForAuthenticatedUser: [ + "PATCH /user/memberships/orgs/{org}" + ], + updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"], + updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"], + updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], + updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] + }, + packages: { + deletePackageForAuthenticatedUser: [ + "DELETE /user/packages/{package_type}/{package_name}" + ], + deletePackageForOrg: [ + "DELETE /orgs/{org}/packages/{package_type}/{package_name}" + ], + deletePackageForUser: [ + "DELETE /users/{username}/packages/{package_type}/{package_name}" + ], + deletePackageVersionForAuthenticatedUser: [ + "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + deletePackageVersionForOrg: [ + "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + deletePackageVersionForUser: [ + "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + getAllPackageVersionsForAPackageOwnedByAnOrg: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", + {}, + { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] } + ], + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions", + {}, + { + renamed: [ + "packages", + "getAllPackageVersionsForPackageOwnedByAuthenticatedUser" + ] + } + ], + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions" + ], + getAllPackageVersionsForPackageOwnedByOrg: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions" + ], + getAllPackageVersionsForPackageOwnedByUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}/versions" + ], + getPackageForAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}" + ], + getPackageForOrganization: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}" + ], + getPackageForUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}" + ], + getPackageVersionForAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + getPackageVersionForOrganization: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + getPackageVersionForUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + listDockerMigrationConflictingPackagesForAuthenticatedUser: [ + "GET /user/docker/conflicts" + ], + listDockerMigrationConflictingPackagesForOrganization: [ + "GET /orgs/{org}/docker/conflicts" + ], + listDockerMigrationConflictingPackagesForUser: [ + "GET /users/{username}/docker/conflicts" + ], + listPackagesForAuthenticatedUser: ["GET /user/packages"], + listPackagesForOrganization: ["GET /orgs/{org}/packages"], + listPackagesForUser: ["GET /users/{username}/packages"], + restorePackageForAuthenticatedUser: [ + "POST /user/packages/{package_type}/{package_name}/restore{?token}" + ], + restorePackageForOrg: [ + "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}" + ], + restorePackageForUser: [ + "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}" + ], + restorePackageVersionForAuthenticatedUser: [ + "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" + ], + restorePackageVersionForOrg: [ + "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" + ], + restorePackageVersionForUser: [ + "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" + ] + }, + projects: { + addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], + createCard: ["POST /projects/columns/{column_id}/cards"], + createColumn: ["POST /projects/{project_id}/columns"], + createForAuthenticatedUser: ["POST /user/projects"], + createForOrg: ["POST /orgs/{org}/projects"], + createForRepo: ["POST /repos/{owner}/{repo}/projects"], + delete: ["DELETE /projects/{project_id}"], + deleteCard: ["DELETE /projects/columns/cards/{card_id}"], + deleteColumn: ["DELETE /projects/columns/{column_id}"], + get: ["GET /projects/{project_id}"], + getCard: ["GET /projects/columns/cards/{card_id}"], + getColumn: ["GET /projects/columns/{column_id}"], + getPermissionForUser: [ + "GET /projects/{project_id}/collaborators/{username}/permission" + ], + listCards: ["GET /projects/columns/{column_id}/cards"], + listCollaborators: ["GET /projects/{project_id}/collaborators"], + listColumns: ["GET /projects/{project_id}/columns"], + listForOrg: ["GET /orgs/{org}/projects"], + listForRepo: ["GET /repos/{owner}/{repo}/projects"], + listForUser: ["GET /users/{username}/projects"], + moveCard: ["POST /projects/columns/cards/{card_id}/moves"], + moveColumn: ["POST /projects/columns/{column_id}/moves"], + removeCollaborator: [ + "DELETE /projects/{project_id}/collaborators/{username}" + ], + update: ["PATCH /projects/{project_id}"], + updateCard: ["PATCH /projects/columns/cards/{card_id}"], + updateColumn: ["PATCH /projects/columns/{column_id}"] + }, + pulls: { + checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + create: ["POST /repos/{owner}/{repo}/pulls"], + createReplyForReviewComment: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" + ], + createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + createReviewComment: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments" + ], + deletePendingReview: [ + "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" + ], + deleteReviewComment: [ + "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}" + ], + dismissReview: [ + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" + ], + get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], + getReview: [ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" + ], + getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + list: ["GET /repos/{owner}/{repo}/pulls"], + listCommentsForReview: [ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments" + ], + listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], + listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], + listRequestedReviewers: [ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" + ], + listReviewComments: [ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments" + ], + listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], + listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + removeRequestedReviewers: [ + "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" + ], + requestReviewers: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" + ], + submitReview: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" + ], + update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], + updateBranch: [ + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch" + ], + updateReview: [ + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" + ], + updateReviewComment: [ + "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}" + ] + }, + rateLimit: { get: ["GET /rate_limit"] }, + reactions: { + createForCommitComment: [ + "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions" + ], + createForIssue: [ + "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions" + ], + createForIssueComment: [ + "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" + ], + createForPullRequestReviewComment: [ + "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" + ], + createForRelease: [ + "POST /repos/{owner}/{repo}/releases/{release_id}/reactions" + ], + createForTeamDiscussionCommentInOrg: [ + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" + ], + createForTeamDiscussionInOrg: [ + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" + ], + deleteForCommitComment: [ + "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}" + ], + deleteForIssue: [ + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}" + ], + deleteForIssueComment: [ + "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}" + ], + deleteForPullRequestComment: [ + "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}" + ], + deleteForRelease: [ + "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}" + ], + deleteForTeamDiscussion: [ + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}" + ], + deleteForTeamDiscussionComment: [ + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}" + ], + listForCommitComment: [ + "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions" + ], + listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], + listForIssueComment: [ + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" + ], + listForPullRequestReviewComment: [ + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" + ], + listForRelease: [ + "GET /repos/{owner}/{repo}/releases/{release_id}/reactions" + ], + listForTeamDiscussionCommentInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" + ], + listForTeamDiscussionInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" + ] + }, + repos: { + acceptInvitation: [ + "PATCH /user/repository_invitations/{invitation_id}", + {}, + { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] } + ], + acceptInvitationForAuthenticatedUser: [ + "PATCH /user/repository_invitations/{invitation_id}" + ], + addAppAccessRestrictions: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", + {}, + { mapToData: "apps" } + ], + addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], + addStatusCheckContexts: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", + {}, + { mapToData: "contexts" } + ], + addTeamAccessRestrictions: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", + {}, + { mapToData: "teams" } + ], + addUserAccessRestrictions: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", + {}, + { mapToData: "users" } + ], + cancelPagesDeployment: [ + "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" + ], + checkAutomatedSecurityFixes: [ + "GET /repos/{owner}/{repo}/automated-security-fixes" + ], + checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], + checkVulnerabilityAlerts: [ + "GET /repos/{owner}/{repo}/vulnerability-alerts" + ], + codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], + compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + compareCommitsWithBasehead: [ + "GET /repos/{owner}/{repo}/compare/{basehead}" + ], + createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], + createCommitComment: [ + "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments" + ], + createCommitSignatureProtection: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" + ], + createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], + createDeployKey: ["POST /repos/{owner}/{repo}/keys"], + createDeployment: ["POST /repos/{owner}/{repo}/deployments"], + createDeploymentBranchPolicy: [ + "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" + ], + createDeploymentProtectionRule: [ + "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" + ], + createDeploymentStatus: [ + "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" + ], + createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], + createForAuthenticatedUser: ["POST /user/repos"], + createFork: ["POST /repos/{owner}/{repo}/forks"], + createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateCustomPropertiesValues: [ + "PATCH /repos/{owner}/{repo}/properties/values" + ], + createOrUpdateEnvironment: [ + "PUT /repos/{owner}/{repo}/environments/{environment_name}" + ], + createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], + createOrgRuleset: ["POST /orgs/{org}/rulesets"], + createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], + createPagesSite: ["POST /repos/{owner}/{repo}/pages"], + createRelease: ["POST /repos/{owner}/{repo}/releases"], + createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], + createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], + createUsingTemplate: [ + "POST /repos/{template_owner}/{template_repo}/generate" + ], + createWebhook: ["POST /repos/{owner}/{repo}/hooks"], + declineInvitation: [ + "DELETE /user/repository_invitations/{invitation_id}", + {}, + { renamed: ["repos", "declineInvitationForAuthenticatedUser"] } + ], + declineInvitationForAuthenticatedUser: [ + "DELETE /user/repository_invitations/{invitation_id}" + ], + delete: ["DELETE /repos/{owner}/{repo}"], + deleteAccessRestrictions: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" + ], + deleteAdminBranchProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" + ], + deleteAnEnvironment: [ + "DELETE /repos/{owner}/{repo}/environments/{environment_name}" + ], + deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], + deleteBranchProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection" + ], + deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], + deleteCommitSignatureProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" + ], + deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], + deleteDeployment: [ + "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}" + ], + deleteDeploymentBranchPolicy: [ + "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" + ], + deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], + deleteInvitation: [ + "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}" + ], + deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"], + deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], + deletePullRequestReviewProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" + ], + deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], + deleteReleaseAsset: [ + "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}" + ], + deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"], + deleteTagProtection: [ + "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}" + ], + deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], + disableAutomatedSecurityFixes: [ + "DELETE /repos/{owner}/{repo}/automated-security-fixes" + ], + disableDeploymentProtectionRule: [ + "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" + ], + disablePrivateVulnerabilityReporting: [ + "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting" + ], + disableVulnerabilityAlerts: [ + "DELETE /repos/{owner}/{repo}/vulnerability-alerts" + ], + downloadArchive: [ + "GET /repos/{owner}/{repo}/zipball/{ref}", + {}, + { renamed: ["repos", "downloadZipballArchive"] } + ], + downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], + downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], + enableAutomatedSecurityFixes: [ + "PUT /repos/{owner}/{repo}/automated-security-fixes" + ], + enablePrivateVulnerabilityReporting: [ + "PUT /repos/{owner}/{repo}/private-vulnerability-reporting" + ], + enableVulnerabilityAlerts: [ + "PUT /repos/{owner}/{repo}/vulnerability-alerts" + ], + generateReleaseNotes: [ + "POST /repos/{owner}/{repo}/releases/generate-notes" + ], + get: ["GET /repos/{owner}/{repo}"], + getAccessRestrictions: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" + ], + getAdminBranchProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" + ], + getAllDeploymentProtectionRules: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" + ], + getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], + getAllStatusCheckContexts: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" + ], + getAllTopics: ["GET /repos/{owner}/{repo}/topics"], + getAppsWithAccessToProtectedBranch: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" + ], + getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], + getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], + getBranchProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection" + ], + getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"], + getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], + getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], + getCollaboratorPermissionLevel: [ + "GET /repos/{owner}/{repo}/collaborators/{username}/permission" + ], + getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], + getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], + getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], + getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], + getCommitSignatureProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" + ], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], + getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], + getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], + getCustomDeploymentProtectionRule: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" + ], + getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"], + getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], + getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], + getDeploymentBranchPolicy: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" + ], + getDeploymentStatus: [ + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" + ], + getEnvironment: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}" + ], + getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], + getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], + getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"], + getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"], + getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"], + getOrgRulesets: ["GET /orgs/{org}/rulesets"], + getPages: ["GET /repos/{owner}/{repo}/pages"], + getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesDeployment: [ + "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" + ], + getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], + getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], + getPullRequestReviewProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" + ], + getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], + getReadme: ["GET /repos/{owner}/{repo}/readme"], + getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], + getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], + getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], + getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], + getRepoRuleSuite: [ + "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" + ], + getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"], + getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"], + getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"], + getStatusChecksProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" + ], + getTeamsWithAccessToProtectedBranch: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" + ], + getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], + getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], + getUsersWithAccessToProtectedBranch: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" + ], + getViews: ["GET /repos/{owner}/{repo}/traffic/views"], + getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + getWebhookConfigForRepo: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/config" + ], + getWebhookDelivery: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}" + ], + listActivities: ["GET /repos/{owner}/{repo}/activity"], + listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], + listBranches: ["GET /repos/{owner}/{repo}/branches"], + listBranchesForHeadCommit: [ + "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head" + ], + listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], + listCommentsForCommit: [ + "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments" + ], + listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], + listCommitStatusesForRef: [ + "GET /repos/{owner}/{repo}/commits/{ref}/statuses" + ], + listCommits: ["GET /repos/{owner}/{repo}/commits"], + listContributors: ["GET /repos/{owner}/{repo}/contributors"], + listCustomDeploymentRuleIntegrations: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps" + ], + listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], + listDeploymentBranchPolicies: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" + ], + listDeploymentStatuses: [ + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" + ], + listDeployments: ["GET /repos/{owner}/{repo}/deployments"], + listForAuthenticatedUser: ["GET /user/repos"], + listForOrg: ["GET /orgs/{org}/repos"], + listForUser: ["GET /users/{username}/repos"], + listForks: ["GET /repos/{owner}/{repo}/forks"], + listInvitations: ["GET /repos/{owner}/{repo}/invitations"], + listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], + listLanguages: ["GET /repos/{owner}/{repo}/languages"], + listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], + listPublic: ["GET /repositories"], + listPullRequestsAssociatedWithCommit: [ + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" + ], + listReleaseAssets: [ + "GET /repos/{owner}/{repo}/releases/{release_id}/assets" + ], + listReleases: ["GET /repos/{owner}/{repo}/releases"], + listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], + listTags: ["GET /repos/{owner}/{repo}/tags"], + listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhookDeliveries: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries" + ], + listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], + merge: ["POST /repos/{owner}/{repo}/merges"], + mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], + pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: [ + "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" + ], + removeAppAccessRestrictions: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", + {}, + { mapToData: "apps" } + ], + removeCollaborator: [ + "DELETE /repos/{owner}/{repo}/collaborators/{username}" + ], + removeStatusCheckContexts: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", + {}, + { mapToData: "contexts" } + ], + removeStatusCheckProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" + ], + removeTeamAccessRestrictions: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", + {}, + { mapToData: "teams" } + ], + removeUserAccessRestrictions: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", + {}, + { mapToData: "users" } + ], + renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], + replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], + requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], + setAdminBranchProtection: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" + ], + setAppAccessRestrictions: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", + {}, + { mapToData: "apps" } + ], + setStatusCheckContexts: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", + {}, + { mapToData: "contexts" } + ], + setTeamAccessRestrictions: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", + {}, + { mapToData: "teams" } + ], + setUserAccessRestrictions: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", + {}, + { mapToData: "users" } + ], + testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], + transfer: ["POST /repos/{owner}/{repo}/transfer"], + update: ["PATCH /repos/{owner}/{repo}"], + updateBranchProtection: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection" + ], + updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], + updateDeploymentBranchPolicy: [ + "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" + ], + updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], + updateInvitation: [ + "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}" + ], + updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"], + updatePullRequestReviewProtection: [ + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" + ], + updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], + updateReleaseAsset: [ + "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}" + ], + updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"], + updateStatusCheckPotection: [ + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", + {}, + { renamed: ["repos", "updateStatusCheckProtection"] } + ], + updateStatusCheckProtection: [ + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" + ], + updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + updateWebhookConfigForRepo: [ + "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config" + ], + uploadReleaseAsset: [ + "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", + { baseUrl: "https://uploads.github.com" } + ] + }, + search: { + code: ["GET /search/code"], + commits: ["GET /search/commits"], + issuesAndPullRequests: ["GET /search/issues"], + labels: ["GET /search/labels"], + repos: ["GET /search/repositories"], + topics: ["GET /search/topics"], + users: ["GET /search/users"] + }, + secretScanning: { + getAlert: [ + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" + ], + listAlertsForEnterprise: [ + "GET /enterprises/{enterprise}/secret-scanning/alerts" + ], + listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + listLocationsForAlert: [ + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations" + ], + updateAlert: [ + "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" + ] + }, + securityAdvisories: { + createFork: [ + "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" + ], + createPrivateVulnerabilityReport: [ + "POST /repos/{owner}/{repo}/security-advisories/reports" + ], + createRepositoryAdvisory: [ + "POST /repos/{owner}/{repo}/security-advisories" + ], + createRepositoryAdvisoryCveRequest: [ + "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve" + ], + getGlobalAdvisory: ["GET /advisories/{ghsa_id}"], + getRepositoryAdvisory: [ + "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}" + ], + listGlobalAdvisories: ["GET /advisories"], + listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"], + listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"], + updateRepositoryAdvisory: [ + "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}" + ] + }, + teams: { + addOrUpdateMembershipForUserInOrg: [ + "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}" + ], + addOrUpdateProjectPermissionsInOrg: [ + "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}" + ], + addOrUpdateRepoPermissionsInOrg: [ + "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" + ], + checkPermissionsForProjectInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}" + ], + checkPermissionsForRepoInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" + ], + create: ["POST /orgs/{org}/teams"], + createDiscussionCommentInOrg: [ + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" + ], + createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], + deleteDiscussionCommentInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" + ], + deleteDiscussionInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" + ], + deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], + getByName: ["GET /orgs/{org}/teams/{team_slug}"], + getDiscussionCommentInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" + ], + getDiscussionInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" + ], + getMembershipForUserInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/memberships/{username}" + ], + list: ["GET /orgs/{org}/teams"], + listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], + listDiscussionCommentsInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" + ], + listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], + listForAuthenticatedUser: ["GET /user/teams"], + listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], + listPendingInvitationsInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/invitations" + ], + listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], + listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], + removeMembershipForUserInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}" + ], + removeProjectInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}" + ], + removeRepoInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" + ], + updateDiscussionCommentInOrg: [ + "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" + ], + updateDiscussionInOrg: [ + "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" + ], + updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] + }, + users: { + addEmailForAuthenticated: [ + "POST /user/emails", + {}, + { renamed: ["users", "addEmailForAuthenticatedUser"] } + ], + addEmailForAuthenticatedUser: ["POST /user/emails"], + addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"], + block: ["PUT /user/blocks/{username}"], + checkBlocked: ["GET /user/blocks/{username}"], + checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], + checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], + createGpgKeyForAuthenticated: [ + "POST /user/gpg_keys", + {}, + { renamed: ["users", "createGpgKeyForAuthenticatedUser"] } + ], + createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], + createPublicSshKeyForAuthenticated: [ + "POST /user/keys", + {}, + { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] } + ], + createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], + createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"], + deleteEmailForAuthenticated: [ + "DELETE /user/emails", + {}, + { renamed: ["users", "deleteEmailForAuthenticatedUser"] } + ], + deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], + deleteGpgKeyForAuthenticated: [ + "DELETE /user/gpg_keys/{gpg_key_id}", + {}, + { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] } + ], + deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], + deletePublicSshKeyForAuthenticated: [ + "DELETE /user/keys/{key_id}", + {}, + { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] } + ], + deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], + deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"], + deleteSshSigningKeyForAuthenticatedUser: [ + "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" + ], + follow: ["PUT /user/following/{username}"], + getAuthenticated: ["GET /user"], + getByUsername: ["GET /users/{username}"], + getContextForUser: ["GET /users/{username}/hovercard"], + getGpgKeyForAuthenticated: [ + "GET /user/gpg_keys/{gpg_key_id}", + {}, + { renamed: ["users", "getGpgKeyForAuthenticatedUser"] } + ], + getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], + getPublicSshKeyForAuthenticated: [ + "GET /user/keys/{key_id}", + {}, + { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] } + ], + getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], + getSshSigningKeyForAuthenticatedUser: [ + "GET /user/ssh_signing_keys/{ssh_signing_key_id}" + ], + list: ["GET /users"], + listBlockedByAuthenticated: [ + "GET /user/blocks", + {}, + { renamed: ["users", "listBlockedByAuthenticatedUser"] } + ], + listBlockedByAuthenticatedUser: ["GET /user/blocks"], + listEmailsForAuthenticated: [ + "GET /user/emails", + {}, + { renamed: ["users", "listEmailsForAuthenticatedUser"] } + ], + listEmailsForAuthenticatedUser: ["GET /user/emails"], + listFollowedByAuthenticated: [ + "GET /user/following", + {}, + { renamed: ["users", "listFollowedByAuthenticatedUser"] } + ], + listFollowedByAuthenticatedUser: ["GET /user/following"], + listFollowersForAuthenticatedUser: ["GET /user/followers"], + listFollowersForUser: ["GET /users/{username}/followers"], + listFollowingForUser: ["GET /users/{username}/following"], + listGpgKeysForAuthenticated: [ + "GET /user/gpg_keys", + {}, + { renamed: ["users", "listGpgKeysForAuthenticatedUser"] } + ], + listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], + listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], + listPublicEmailsForAuthenticated: [ + "GET /user/public_emails", + {}, + { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] } + ], + listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], + listPublicKeysForUser: ["GET /users/{username}/keys"], + listPublicSshKeysForAuthenticated: [ + "GET /user/keys", + {}, + { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] } + ], + listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], + listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"], + listSocialAccountsForUser: ["GET /users/{username}/social_accounts"], + listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"], + listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"], + setPrimaryEmailVisibilityForAuthenticated: [ + "PATCH /user/email/visibility", + {}, + { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] } + ], + setPrimaryEmailVisibilityForAuthenticatedUser: [ + "PATCH /user/email/visibility" + ], + unblock: ["DELETE /user/blocks/{username}"], + unfollow: ["DELETE /user/following/{username}"], + updateAuthenticated: ["PATCH /user"] + } +}; +var endpoints_default = Endpoints; +var endpointMethodsMap = /* @__PURE__ */ new Map(); +for (const [scope, endpoints] of Object.entries(endpoints_default)) { + for (const [methodName, endpoint2] of Object.entries(endpoints)) { + const [route, defaults, decorations] = endpoint2; + const [method, url] = route.split(/ /); + const endpointDefaults = Object.assign( + { + method, + url + }, + defaults + ); + if (!endpointMethodsMap.has(scope)) { + endpointMethodsMap.set(scope, /* @__PURE__ */ new Map()); + } + endpointMethodsMap.get(scope).set(methodName, { + scope, + methodName, + endpointDefaults, + decorations + }); + } +} +var handler = { + has({ scope }, methodName) { + return endpointMethodsMap.get(scope).has(methodName); + }, + getOwnPropertyDescriptor(target, methodName) { + return { + value: this.get(target, methodName), + // ensures method is in the cache + configurable: true, + writable: true, + enumerable: true + }; + }, + defineProperty(target, methodName, descriptor) { + Object.defineProperty(target.cache, methodName, descriptor); + return true; + }, + deleteProperty(target, methodName) { + delete target.cache[methodName]; + return true; + }, + ownKeys({ scope }) { + return [...endpointMethodsMap.get(scope).keys()]; + }, + set(target, methodName, value) { + return target.cache[methodName] = value; + }, + get({ octokit, scope, cache: cache2 }, methodName) { + if (cache2[methodName]) { + return cache2[methodName]; + } + const method = endpointMethodsMap.get(scope).get(methodName); + if (!method) { + return void 0; + } + const { endpointDefaults, decorations } = method; + if (decorations) { + cache2[methodName] = decorate( + octokit, + scope, + methodName, + endpointDefaults, + decorations + ); + } else { + cache2[methodName] = octokit.request.defaults(endpointDefaults); + } + return cache2[methodName]; + } +}; +function endpointsToMethods(octokit) { + const newMethods = {}; + for (const scope of endpointMethodsMap.keys()) { + newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler); + } + return newMethods; +} +function decorate(octokit, scope, methodName, defaults, decorations) { + const requestWithDefaults = octokit.request.defaults(defaults); + function withDecorations(...args) { + let options2 = requestWithDefaults.endpoint.merge(...args); + if (decorations.mapToData) { + options2 = Object.assign({}, options2, { + data: options2[decorations.mapToData], + [decorations.mapToData]: void 0 + }); + return requestWithDefaults(options2); + } + if (decorations.renamed) { + const [newScope, newMethodName] = decorations.renamed; + octokit.log.warn( + `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()` + ); + } + if (decorations.deprecated) { + octokit.log.warn(decorations.deprecated); + } + if (decorations.renamedParameters) { + const options22 = requestWithDefaults.endpoint.merge(...args); + for (const [name, alias] of Object.entries( + decorations.renamedParameters + )) { + if (name in options22) { + octokit.log.warn( + `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead` + ); + if (!(alias in options22)) { + options22[alias] = options22[name]; + } + delete options22[name]; + } + } + return requestWithDefaults(options22); + } + return requestWithDefaults(...args); + } + return Object.assign(withDecorations, requestWithDefaults); +} +function restEndpointMethods(octokit) { + const api2 = endpointsToMethods(octokit); + return { + rest: api2 + }; +} +restEndpointMethods.VERSION = VERSION$1; +function legacyRestEndpointMethods(octokit) { + const api2 = endpointsToMethods(octokit); + return { + ...api2, + rest: api2 + }; +} +legacyRestEndpointMethods.VERSION = VERSION$1; +const distWeb$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + legacyRestEndpointMethods, + restEndpointMethods +}, Symbol.toStringTag, { value: "Module" })); +const require$$3 = /* @__PURE__ */ getAugmentedNamespace(distWeb$1); +var VERSION = "9.2.1"; +function normalizePaginatedListResponse(response2) { + if (!response2.data) { + return { + ...response2, + data: [] + }; + } + const responseNeedsNormalization = "total_count" in response2.data && !("url" in response2.data); + if (!responseNeedsNormalization) + return response2; + const incompleteResults = response2.data.incomplete_results; + const repositorySelection = response2.data.repository_selection; + const totalCount = response2.data.total_count; + delete response2.data.incomplete_results; + delete response2.data.repository_selection; + delete response2.data.total_count; + const namespaceKey = Object.keys(response2.data)[0]; + const data = response2.data[namespaceKey]; + response2.data = data; + if (typeof incompleteResults !== "undefined") { + response2.data.incomplete_results = incompleteResults; + } + if (typeof repositorySelection !== "undefined") { + response2.data.repository_selection = repositorySelection; + } + response2.data.total_count = totalCount; + return response2; +} +function iterator$1(octokit, route, parameters) { + const options2 = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); + const requestMethod = typeof route === "function" ? route : octokit.request; + const method = options2.method; + const headers2 = options2.headers; + let url = options2.url; + return { + [Symbol.asyncIterator]: () => ({ + async next() { + if (!url) + return { done: true }; + try { + const response2 = await requestMethod({ method, url, headers: headers2 }); + const normalizedResponse = normalizePaginatedListResponse(response2); + url = ((normalizedResponse.headers.link || "").match( + /<([^>]+)>;\s*rel="next"/ + ) || [])[1]; + return { value: normalizedResponse }; + } catch (error2) { + if (error2.status !== 409) + throw error2; + url = ""; + return { + value: { + status: 200, + headers: {}, + data: [] + } + }; + } + } + }) + }; +} +function paginate(octokit, route, parameters, mapFn) { + if (typeof parameters === "function") { + mapFn = parameters; + parameters = void 0; + } + return gather( + octokit, + [], + iterator$1(octokit, route, parameters)[Symbol.asyncIterator](), + mapFn + ); +} +function gather(octokit, results2, iterator2, mapFn) { + return iterator2.next().then((result) => { + if (result.done) { + return results2; + } + let earlyExit = false; + function done() { + earlyExit = true; + } + results2 = results2.concat( + mapFn ? mapFn(result.value, done) : result.value.data + ); + if (earlyExit) { + return results2; + } + return gather(octokit, results2, iterator2, mapFn); + }); +} +var composePaginateRest = Object.assign(paginate, { + iterator: iterator$1 +}); +var paginatingEndpoints = [ + "GET /advisories", + "GET /app/hook/deliveries", + "GET /app/installation-requests", + "GET /app/installations", + "GET /assignments/{assignment_id}/accepted_assignments", + "GET /classrooms", + "GET /classrooms/{classroom_id}/assignments", + "GET /enterprises/{enterprise}/dependabot/alerts", + "GET /enterprises/{enterprise}/secret-scanning/alerts", + "GET /events", + "GET /gists", + "GET /gists/public", + "GET /gists/starred", + "GET /gists/{gist_id}/comments", + "GET /gists/{gist_id}/commits", + "GET /gists/{gist_id}/forks", + "GET /installation/repositories", + "GET /issues", + "GET /licenses", + "GET /marketplace_listing/plans", + "GET /marketplace_listing/plans/{plan_id}/accounts", + "GET /marketplace_listing/stubbed/plans", + "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", + "GET /networks/{owner}/{repo}/events", + "GET /notifications", + "GET /organizations", + "GET /orgs/{org}/actions/cache/usage-by-repository", + "GET /orgs/{org}/actions/permissions/repositories", + "GET /orgs/{org}/actions/runners", + "GET /orgs/{org}/actions/secrets", + "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", + "GET /orgs/{org}/actions/variables", + "GET /orgs/{org}/actions/variables/{name}/repositories", + "GET /orgs/{org}/blocks", + "GET /orgs/{org}/code-scanning/alerts", + "GET /orgs/{org}/codespaces", + "GET /orgs/{org}/codespaces/secrets", + "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories", + "GET /orgs/{org}/copilot/billing/seats", + "GET /orgs/{org}/dependabot/alerts", + "GET /orgs/{org}/dependabot/secrets", + "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", + "GET /orgs/{org}/events", + "GET /orgs/{org}/failed_invitations", + "GET /orgs/{org}/hooks", + "GET /orgs/{org}/hooks/{hook_id}/deliveries", + "GET /orgs/{org}/installations", + "GET /orgs/{org}/invitations", + "GET /orgs/{org}/invitations/{invitation_id}/teams", + "GET /orgs/{org}/issues", + "GET /orgs/{org}/members", + "GET /orgs/{org}/members/{username}/codespaces", + "GET /orgs/{org}/migrations", + "GET /orgs/{org}/migrations/{migration_id}/repositories", + "GET /orgs/{org}/organization-roles/{role_id}/teams", + "GET /orgs/{org}/organization-roles/{role_id}/users", + "GET /orgs/{org}/outside_collaborators", + "GET /orgs/{org}/packages", + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", + "GET /orgs/{org}/personal-access-token-requests", + "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories", + "GET /orgs/{org}/personal-access-tokens", + "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories", + "GET /orgs/{org}/projects", + "GET /orgs/{org}/properties/values", + "GET /orgs/{org}/public_members", + "GET /orgs/{org}/repos", + "GET /orgs/{org}/rulesets", + "GET /orgs/{org}/rulesets/rule-suites", + "GET /orgs/{org}/secret-scanning/alerts", + "GET /orgs/{org}/security-advisories", + "GET /orgs/{org}/teams", + "GET /orgs/{org}/teams/{team_slug}/discussions", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", + "GET /orgs/{org}/teams/{team_slug}/invitations", + "GET /orgs/{org}/teams/{team_slug}/members", + "GET /orgs/{org}/teams/{team_slug}/projects", + "GET /orgs/{org}/teams/{team_slug}/repos", + "GET /orgs/{org}/teams/{team_slug}/teams", + "GET /projects/columns/{column_id}/cards", + "GET /projects/{project_id}/collaborators", + "GET /projects/{project_id}/columns", + "GET /repos/{owner}/{repo}/actions/artifacts", + "GET /repos/{owner}/{repo}/actions/caches", + "GET /repos/{owner}/{repo}/actions/organization-secrets", + "GET /repos/{owner}/{repo}/actions/organization-variables", + "GET /repos/{owner}/{repo}/actions/runners", + "GET /repos/{owner}/{repo}/actions/runs", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", + "GET /repos/{owner}/{repo}/actions/secrets", + "GET /repos/{owner}/{repo}/actions/variables", + "GET /repos/{owner}/{repo}/actions/workflows", + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", + "GET /repos/{owner}/{repo}/activity", + "GET /repos/{owner}/{repo}/assignees", + "GET /repos/{owner}/{repo}/branches", + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", + "GET /repos/{owner}/{repo}/code-scanning/alerts", + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + "GET /repos/{owner}/{repo}/code-scanning/analyses", + "GET /repos/{owner}/{repo}/codespaces", + "GET /repos/{owner}/{repo}/codespaces/devcontainers", + "GET /repos/{owner}/{repo}/codespaces/secrets", + "GET /repos/{owner}/{repo}/collaborators", + "GET /repos/{owner}/{repo}/comments", + "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/commits", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", + "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", + "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", + "GET /repos/{owner}/{repo}/commits/{ref}/status", + "GET /repos/{owner}/{repo}/commits/{ref}/statuses", + "GET /repos/{owner}/{repo}/contributors", + "GET /repos/{owner}/{repo}/dependabot/alerts", + "GET /repos/{owner}/{repo}/dependabot/secrets", + "GET /repos/{owner}/{repo}/deployments", + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", + "GET /repos/{owner}/{repo}/environments", + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies", + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps", + "GET /repos/{owner}/{repo}/events", + "GET /repos/{owner}/{repo}/forks", + "GET /repos/{owner}/{repo}/hooks", + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", + "GET /repos/{owner}/{repo}/invitations", + "GET /repos/{owner}/{repo}/issues", + "GET /repos/{owner}/{repo}/issues/comments", + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/issues/events", + "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", + "GET /repos/{owner}/{repo}/issues/{issue_number}/events", + "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", + "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", + "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", + "GET /repos/{owner}/{repo}/keys", + "GET /repos/{owner}/{repo}/labels", + "GET /repos/{owner}/{repo}/milestones", + "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", + "GET /repos/{owner}/{repo}/notifications", + "GET /repos/{owner}/{repo}/pages/builds", + "GET /repos/{owner}/{repo}/projects", + "GET /repos/{owner}/{repo}/pulls", + "GET /repos/{owner}/{repo}/pulls/comments", + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", + "GET /repos/{owner}/{repo}/releases", + "GET /repos/{owner}/{repo}/releases/{release_id}/assets", + "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", + "GET /repos/{owner}/{repo}/rules/branches/{branch}", + "GET /repos/{owner}/{repo}/rulesets", + "GET /repos/{owner}/{repo}/rulesets/rule-suites", + "GET /repos/{owner}/{repo}/secret-scanning/alerts", + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", + "GET /repos/{owner}/{repo}/security-advisories", + "GET /repos/{owner}/{repo}/stargazers", + "GET /repos/{owner}/{repo}/subscribers", + "GET /repos/{owner}/{repo}/tags", + "GET /repos/{owner}/{repo}/teams", + "GET /repos/{owner}/{repo}/topics", + "GET /repositories", + "GET /repositories/{repository_id}/environments/{environment_name}/secrets", + "GET /repositories/{repository_id}/environments/{environment_name}/variables", + "GET /search/code", + "GET /search/commits", + "GET /search/issues", + "GET /search/labels", + "GET /search/repositories", + "GET /search/topics", + "GET /search/users", + "GET /teams/{team_id}/discussions", + "GET /teams/{team_id}/discussions/{discussion_number}/comments", + "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", + "GET /teams/{team_id}/discussions/{discussion_number}/reactions", + "GET /teams/{team_id}/invitations", + "GET /teams/{team_id}/members", + "GET /teams/{team_id}/projects", + "GET /teams/{team_id}/repos", + "GET /teams/{team_id}/teams", + "GET /user/blocks", + "GET /user/codespaces", + "GET /user/codespaces/secrets", + "GET /user/emails", + "GET /user/followers", + "GET /user/following", + "GET /user/gpg_keys", + "GET /user/installations", + "GET /user/installations/{installation_id}/repositories", + "GET /user/issues", + "GET /user/keys", + "GET /user/marketplace_purchases", + "GET /user/marketplace_purchases/stubbed", + "GET /user/memberships/orgs", + "GET /user/migrations", + "GET /user/migrations/{migration_id}/repositories", + "GET /user/orgs", + "GET /user/packages", + "GET /user/packages/{package_type}/{package_name}/versions", + "GET /user/public_emails", + "GET /user/repos", + "GET /user/repository_invitations", + "GET /user/social_accounts", + "GET /user/ssh_signing_keys", + "GET /user/starred", + "GET /user/subscriptions", + "GET /user/teams", + "GET /users", + "GET /users/{username}/events", + "GET /users/{username}/events/orgs/{org}", + "GET /users/{username}/events/public", + "GET /users/{username}/followers", + "GET /users/{username}/following", + "GET /users/{username}/gists", + "GET /users/{username}/gpg_keys", + "GET /users/{username}/keys", + "GET /users/{username}/orgs", + "GET /users/{username}/packages", + "GET /users/{username}/projects", + "GET /users/{username}/received_events", + "GET /users/{username}/received_events/public", + "GET /users/{username}/repos", + "GET /users/{username}/social_accounts", + "GET /users/{username}/ssh_signing_keys", + "GET /users/{username}/starred", + "GET /users/{username}/subscriptions" +]; +function isPaginatingEndpoint(arg) { + if (typeof arg === "string") { + return paginatingEndpoints.includes(arg); + } else { + return false; + } +} +function paginateRest(octokit) { + return { + paginate: Object.assign(paginate.bind(null, octokit), { + iterator: iterator$1.bind(null, octokit) + }) + }; +} +paginateRest.VERSION = VERSION; +const distWeb = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + composePaginateRest, + isPaginatingEndpoint, + paginateRest, + paginatingEndpoints +}, Symbol.toStringTag, { value: "Module" })); +const require$$4 = /* @__PURE__ */ getAugmentedNamespace(distWeb); +(function(exports2) { + var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault2 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar2 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); + } + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; + const Context3 = __importStar2(context); + const Utils = __importStar2(utils$n); + const core_1 = require$$2$1; + const plugin_rest_endpoint_methods_1 = require$$3; + const plugin_paginate_rest_1 = require$$4; + exports2.context = new Context3.Context(); + const baseUrl = Utils.getApiBaseUrl(); + exports2.defaults = { + baseUrl, + request: { + agent: Utils.getProxyAgent(baseUrl), + fetch: Utils.getProxyFetch(baseUrl) + } + }; + exports2.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports2.defaults); + function getOctokitOptions(token, options2) { + const opts = Object.assign({}, options2 || {}); + const auth2 = Utils.getAuthString(token, opts); + if (auth2) { + opts.auth = auth2; + } + return opts; + } + exports2.getOctokitOptions = getOctokitOptions; +})(utils$o); +var __createBinding$4 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); +} : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault$4 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +} : function(o, v) { + o["default"] = v; +}); +var __importStar$4 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$4(result, mod, k); + } + __setModuleDefault$4(result, mod); + return result; +}; +Object.defineProperty(github, "__esModule", { value: true }); +github.getOctokit = github.context = void 0; +const Context2 = __importStar$4(context); +const utils_1$2 = utils$o; +github.context = new Context2.Context(); +function getOctokit(token, options2, ...additionalPlugins) { + const GitHubWithPlugins = utils_1$2.GitHub.plugin(...additionalPlugins); + return new GitHubWithPlugins((0, utils_1$2.getOctokitOptions)(token, options2)); +} +github.getOctokit = getOctokit; +var lib = {}; +var options = {}; +Object.defineProperty(options, "__esModule", { value: true }); +options.STRATEGY_ALL = options.STRATEGY_UPGRADE = options.ACCESS_RESTRICTED = options.ACCESS_PUBLIC = void 0; +options.ACCESS_PUBLIC = "public"; +options.ACCESS_RESTRICTED = "restricted"; +options.STRATEGY_UPGRADE = "upgrade"; +options.STRATEGY_ALL = "all"; +var results = {}; +Object.defineProperty(results, "__esModule", { value: true }); +results.DIFFERENT = results.INITIAL = void 0; +results.INITIAL = "initial"; +results.DIFFERENT = "different"; +var errors$2 = {}; +var __importDefault$5 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; +}; +Object.defineProperty(errors$2, "__esModule", { value: true }); +errors$2.NpmCallError = errors$2.InvalidStrategyError = errors$2.InvalidAccessError = errors$2.InvalidTagError = errors$2.InvalidTokenError = errors$2.InvalidRegistryUrlError = errors$2.InvalidPackagePublishConfigError = errors$2.InvalidPackageVersionError = errors$2.InvalidPackageNameError = errors$2.PackageJsonParseError = errors$2.PackageTarballReadError = errors$2.PackageJsonReadError = errors$2.InvalidPackageError = void 0; +const node_os_1$3 = __importDefault$5(require$$0); +const options_js_1$1 = options; +class InvalidPackageError extends TypeError { + constructor(value) { + super(`Package must be a directory, package.json, or .tgz file, got "${String(value)}"`); + this.name = "PackageJsonReadError"; + } +} +errors$2.InvalidPackageError = InvalidPackageError; +class PackageJsonReadError extends Error { + constructor(manifestPath, originalError) { + const message = [ + `Could not read package.json at ${manifestPath}`, + originalError instanceof Error ? originalError.message : "" + ].filter(Boolean).join(node_os_1$3.default.EOL); + super(message); + this.name = "PackageJsonReadError"; + } +} +errors$2.PackageJsonReadError = PackageJsonReadError; +class PackageTarballReadError extends Error { + constructor(tarballPath, originalError) { + const message = [ + `Could not read package.json from ${tarballPath}`, + originalError instanceof Error ? originalError.message : "" + ].filter(Boolean).join(node_os_1$3.default.EOL); + super(message); + this.name = "PackageTarballReadError"; + } +} +errors$2.PackageTarballReadError = PackageTarballReadError; +class PackageJsonParseError extends SyntaxError { + constructor(packageSpec, originalError) { + const message = [ + `Invalid JSON, could not parse package.json for ${packageSpec}`, + originalError instanceof Error ? originalError.message : "" + ].filter(Boolean).join(node_os_1$3.default.EOL); + super(message); + this.name = "PackageJsonParseError"; + } +} +errors$2.PackageJsonParseError = PackageJsonParseError; +class InvalidPackageNameError extends TypeError { + constructor(value) { + super(`Package name must be a string, got "${String(value)}"`); + this.name = "InvalidPackageNameError"; + } +} +errors$2.InvalidPackageNameError = InvalidPackageNameError; +class InvalidPackageVersionError extends TypeError { + constructor(value) { + super(`Package version must be a valid semantic version, got "${String(value)}"`); + this.name = "InvalidPackageVersionError"; + } +} +errors$2.InvalidPackageVersionError = InvalidPackageVersionError; +class InvalidPackagePublishConfigError extends TypeError { + constructor(value) { + super(`Publish config must be an object, got "${String(value)}"`); + this.name = "InvalidPackagePublishConfigError"; + } +} +errors$2.InvalidPackagePublishConfigError = InvalidPackagePublishConfigError; +class InvalidRegistryUrlError extends TypeError { + constructor(value) { + super(`Registry URL invalid, got "${String(value)}"`); + this.name = "InvalidRegistryUrlError"; + } +} +errors$2.InvalidRegistryUrlError = InvalidRegistryUrlError; +class InvalidTokenError extends TypeError { + constructor() { + super("Token must be a non-empty string."); + this.name = "InvalidTokenError"; + } +} +errors$2.InvalidTokenError = InvalidTokenError; +class InvalidTagError extends TypeError { + constructor(value) { + super(`Tag must be a non-empty string, got "${String(value)}".`); + this.name = "InvalidTagError"; + } +} +errors$2.InvalidTagError = InvalidTagError; +class InvalidAccessError extends TypeError { + constructor(value) { + super(`Access must be "${options_js_1$1.ACCESS_PUBLIC}" or "${options_js_1$1.ACCESS_RESTRICTED}", got "${String(value)}".`); + this.name = "InvalidAccessError"; + } +} +errors$2.InvalidAccessError = InvalidAccessError; +class InvalidStrategyError extends TypeError { + constructor(value) { + super(`Strategy must be "${options_js_1$1.STRATEGY_UPGRADE}" or "${options_js_1$1.STRATEGY_ALL}", got "${String(value)}".`); + this.name = "InvalidStrategyError"; + } +} +errors$2.InvalidStrategyError = InvalidStrategyError; +class NpmCallError extends Error { + constructor(command2, exitCode, stderr) { + super([ + `Call to "npm ${command2}" exited with non-zero exit code ${exitCode}`, + stderr + ].join(node_os_1$3.default.EOL)); + this.name = "NpmCallError"; + } +} +errors$2.NpmCallError = NpmCallError; +var npmPublish$1 = {}; +var readManifest$1 = {}; +const debug$1 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { +}; +var debug_1 = debug$1; +const SEMVER_SPEC_VERSION = "2.0.0"; +const MAX_LENGTH$3 = 256; +const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ +9007199254740991; +const MAX_SAFE_COMPONENT_LENGTH = 16; +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$3 - 6; +const RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" +]; +var constants$7 = { + MAX_LENGTH: MAX_LENGTH$3, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 +}; +var re$1 = { exports: {} }; +(function(module2, exports2) { + const { + MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH2, + MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH2, + MAX_LENGTH: MAX_LENGTH2 + } = constants$7; + const debug2 = debug_1; + exports2 = module2.exports = {}; + const re2 = exports2.re = []; + const safeRe = exports2.safeRe = []; + const src = exports2.src = []; + const t2 = exports2.t = {}; + let R = 0; + const LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + const safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH2], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH2] + ]; + const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + } + return value; + }; + const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug2(name, index, value); + t2[name] = index; + src[index] = value; + re2[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t2.NUMERICIDENTIFIER]}|${src[t2.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t2.NUMERICIDENTIFIERLOOSE]}|${src[t2.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASE", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\.${src[t2.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t2.BUILDIDENTIFIER]}(?:\\.${src[t2.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`); + createToken("FULL", `^${src[t2.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`); + createToken("LOOSE", `^${src[t2.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH2}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?`); + createToken("COERCE", `${src[t2.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t2.COERCE], true); + createToken("COERCERTLFULL", src[t2.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t2.LONETILDE]}\\s+`, true); + exports2.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t2.LONECARET]}\\s+`, true); + exports2.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t2.GTLT]}\\s*(${src[t2.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true); + exports2.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t2.XRANGEPLAIN]})\\s+-\\s+(${src[t2.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t2.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); +})(re$1, re$1.exports); +var reExports = re$1.exports; +const looseOption = Object.freeze({ loose: true }); +const emptyOpts = Object.freeze({}); +const parseOptions$1 = (options2) => { + if (!options2) { + return emptyOpts; + } + if (typeof options2 !== "object") { + return looseOption; + } + return options2; +}; +var parseOptions_1 = parseOptions$1; +const numeric = /^[0-9]+$/; +const compareIdentifiers$1 = (a, b) => { + const anum = numeric.test(a); + const bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; +}; +const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a); +var identifiers = { + compareIdentifiers: compareIdentifiers$1, + rcompareIdentifiers +}; +const debug = debug_1; +const { MAX_LENGTH: MAX_LENGTH$2, MAX_SAFE_INTEGER } = constants$7; +const { safeRe: re, t } = reExports; +const parseOptions = parseOptions_1; +const { compareIdentifiers } = identifiers; +let SemVer$2 = class SemVer { + constructor(version2, options2) { + options2 = parseOptions(options2); + if (version2 instanceof SemVer) { + if (version2.loose === !!options2.loose && version2.includePrerelease === !!options2.includePrerelease) { + return version2; + } else { + version2 = version2.version; + } + } else if (typeof version2 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`); + } + if (version2.length > MAX_LENGTH$2) { + throw new TypeError( + `version is longer than ${MAX_LENGTH$2} characters` + ); + } + debug("SemVer", version2, options2); + this.options = options2; + this.loose = !!options2.loose; + this.includePrerelease = !!options2.includePrerelease; + const m = version2.trim().match(options2.loose ? re[t.LOOSE] : re[t.FULL]); + if (!m) { + throw new TypeError(`Invalid Version: ${version2}`); + } + this.raw = version2; + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } + this.build = m[5] ? m[5].split(".") : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + } + comparePre(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug("prerelease compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + compareBuild(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug("prerelease compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === "number") { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; + } +}; +var semver = SemVer$2; +const SemVer$1 = semver; +const parse$9 = (version2, options2, throwErrors = false) => { + if (version2 instanceof SemVer$1) { + return version2; + } + try { + return new SemVer$1(version2, options2); + } catch (er) { + if (!throwErrors) { + return null; + } + throw er; + } +}; +var parse_1$2 = parse$9; +const parse$8 = parse_1$2; +const valid = (version2, options2) => { + const v = parse$8(version2, options2); + return v ? v.version : null; +}; +var valid_1 = valid; +const argmap = /* @__PURE__ */ new Map([ + ["C", "cwd"], + ["f", "file"], + ["z", "gzip"], + ["P", "preservePaths"], + ["U", "unlink"], + ["strip-components", "strip"], + ["stripComponents", "strip"], + ["keep-newer", "newer"], + ["keepNewer", "newer"], + ["keep-newer-files", "newer"], + ["keepNewerFiles", "newer"], + ["k", "keep"], + ["keep-existing", "keep"], + ["keepExisting", "keep"], + ["m", "noMtime"], + ["no-mtime", "noMtime"], + ["p", "preserveOwner"], + ["L", "follow"], + ["h", "follow"] +]); +var highLevelOpt = (opt) => opt ? Object.keys(opt).map((k) => [ + argmap.has(k) ? argmap.get(k) : k, + opt[k] +]).reduce((set, kv) => (set[kv[0]] = kv[1], set), /* @__PURE__ */ Object.create(null)) : {}; +var warnMixin = (Base) => class extends Base { + warn(code, message, data = {}) { + if (this.file) { + data.file = this.file; + } + if (this.cwd) { + data.cwd = this.cwd; + } + data.code = message instanceof Error && message.code || code; + data.tarCode = code; + if (!this.strict && data.recoverable !== false) { + if (message instanceof Error) { + data = Object.assign(message, data); + message = message.message; + } + this.emit("warn", data.tarCode, message, data); + } else if (message instanceof Error) { + this.emit("error", Object.assign(message, data)); + } else { + this.emit("error", Object.assign(new Error(`${code}: ${message}`), data)); + } + } +}; +var types$1 = {}; +(function(exports2) { + exports2.name = /* @__PURE__ */ new Map([ + ["0", "File"], + // same as File + ["", "OldFile"], + ["1", "Link"], + ["2", "SymbolicLink"], + // Devices and FIFOs aren't fully supported + // they are parsed, but skipped when unpacking + ["3", "CharacterDevice"], + ["4", "BlockDevice"], + ["5", "Directory"], + ["6", "FIFO"], + // same as File + ["7", "ContiguousFile"], + // pax headers + ["g", "GlobalExtendedHeader"], + ["x", "ExtendedHeader"], + // vendor-specific stuff + // skip + ["A", "SolarisACL"], + // like 5, but with data, which should be skipped + ["D", "GNUDumpDir"], + // metadata only, skip + ["I", "Inode"], + // data = link path of next file + ["K", "NextFileHasLongLinkpath"], + // data = path of next file + ["L", "NextFileHasLongPath"], + // skip + ["M", "ContinuationFile"], + // like L + ["N", "OldGnuLongPath"], + // skip + ["S", "SparseFile"], + // skip + ["V", "TapeVolumeHeader"], + // like x + ["X", "OldExtendedHeader"] + ]); + exports2.code = new Map(Array.from(exports2.name).map((kv) => [kv[1], kv[0]])); +})(types$1); +const encode = (num, buf) => { + if (!Number.isSafeInteger(num)) { + throw Error("cannot encode number outside of javascript safe integer range"); + } else if (num < 0) { + encodeNegative(num, buf); + } else { + encodePositive(num, buf); + } + return buf; +}; +const encodePositive = (num, buf) => { + buf[0] = 128; + for (var i = buf.length; i > 1; i--) { + buf[i - 1] = num & 255; + num = Math.floor(num / 256); + } +}; +const encodeNegative = (num, buf) => { + buf[0] = 255; + var flipped = false; + num = num * -1; + for (var i = buf.length; i > 1; i--) { + var byte = num & 255; + num = Math.floor(num / 256); + if (flipped) { + buf[i - 1] = onesComp(byte); + } else if (byte === 0) { + buf[i - 1] = 0; + } else { + flipped = true; + buf[i - 1] = twosComp(byte); + } + } +}; +const parse$7 = (buf) => { + const pre = buf[0]; + const value = pre === 128 ? pos(buf.slice(1, buf.length)) : pre === 255 ? twos(buf) : null; + if (value === null) { + throw Error("invalid base256 encoding"); + } + if (!Number.isSafeInteger(value)) { + throw Error("parsed number outside of javascript safe integer range"); + } + return value; +}; +const twos = (buf) => { + var len = buf.length; + var sum = 0; + var flipped = false; + for (var i = len - 1; i > -1; i--) { + var byte = buf[i]; + var f2; + if (flipped) { + f2 = onesComp(byte); + } else if (byte === 0) { + f2 = byte; + } else { + flipped = true; + f2 = twosComp(byte); + } + if (f2 !== 0) { + sum -= f2 * Math.pow(256, len - i - 1); + } + } + return sum; +}; +const pos = (buf) => { + var len = buf.length; + var sum = 0; + for (var i = len - 1; i > -1; i--) { + var byte = buf[i]; + if (byte !== 0) { + sum += byte * Math.pow(256, len - i - 1); + } + } + return sum; +}; +const onesComp = (byte) => (255 ^ byte) & 255; +const twosComp = (byte) => (255 ^ byte) + 1 & 255; +var largeNumbers = { + encode, + parse: parse$7 +}; +const types = types$1; +const pathModule = require$$0$9.posix; +const large = largeNumbers; +const SLURP$1 = Symbol("slurp"); +const TYPE = Symbol("type"); +let Header$2 = class Header { + constructor(data, off, ex, gex) { + this.cksumValid = false; + this.needPax = false; + this.nullBlock = false; + this.block = null; + this.path = null; + this.mode = null; + this.uid = null; + this.gid = null; + this.size = null; + this.mtime = null; + this.cksum = null; + this[TYPE] = "0"; + this.linkpath = null; + this.uname = null; + this.gname = null; + this.devmaj = 0; + this.devmin = 0; + this.atime = null; + this.ctime = null; + if (Buffer.isBuffer(data)) { + this.decode(data, off || 0, ex, gex); + } else if (data) { + this.set(data); + } + } + decode(buf, off, ex, gex) { + if (!off) { + off = 0; + } + if (!buf || !(buf.length >= off + 512)) { + throw new Error("need 512 bytes for header"); + } + this.path = decString(buf, off, 100); + this.mode = decNumber(buf, off + 100, 8); + this.uid = decNumber(buf, off + 108, 8); + this.gid = decNumber(buf, off + 116, 8); + this.size = decNumber(buf, off + 124, 12); + this.mtime = decDate(buf, off + 136, 12); + this.cksum = decNumber(buf, off + 148, 12); + this[SLURP$1](ex); + this[SLURP$1](gex, true); + this[TYPE] = decString(buf, off + 156, 1); + if (this[TYPE] === "") { + this[TYPE] = "0"; + } + if (this[TYPE] === "0" && this.path.slice(-1) === "/") { + this[TYPE] = "5"; + } + if (this[TYPE] === "5") { + this.size = 0; + } + this.linkpath = decString(buf, off + 157, 100); + if (buf.slice(off + 257, off + 265).toString() === "ustar\x0000") { + this.uname = decString(buf, off + 265, 32); + this.gname = decString(buf, off + 297, 32); + this.devmaj = decNumber(buf, off + 329, 8); + this.devmin = decNumber(buf, off + 337, 8); + if (buf[off + 475] !== 0) { + const prefix = decString(buf, off + 345, 155); + this.path = prefix + "/" + this.path; + } else { + const prefix = decString(buf, off + 345, 130); + if (prefix) { + this.path = prefix + "/" + this.path; + } + this.atime = decDate(buf, off + 476, 12); + this.ctime = decDate(buf, off + 488, 12); + } + } + let sum = 8 * 32; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; + } + this.cksumValid = sum === this.cksum; + if (this.cksum === null && sum === 8 * 32) { + this.nullBlock = true; + } + } + [SLURP$1](ex, global2) { + for (const k in ex) { + if (ex[k] !== null && ex[k] !== void 0 && !(global2 && k === "path")) { + this[k] = ex[k]; + } + } + } + encode(buf, off) { + if (!buf) { + buf = this.block = Buffer.alloc(512); + off = 0; + } + if (!off) { + off = 0; + } + if (!(buf.length >= off + 512)) { + throw new Error("need 512 bytes for header"); + } + const prefixSize = this.ctime || this.atime ? 130 : 155; + const split = splitPrefix(this.path || "", prefixSize); + const path2 = split[0]; + const prefix = split[1]; + this.needPax = split[2]; + this.needPax = encString(buf, off, 100, path2) || this.needPax; + this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax; + this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax; + this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax; + this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax; + this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax; + buf[off + 156] = this[TYPE].charCodeAt(0); + this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax; + buf.write("ustar\x0000", off + 257, 8); + this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax; + this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax; + this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax; + this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax; + this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax; + if (buf[off + 475] !== 0) { + this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax; + } else { + this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax; + this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax; + this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax; + } + let sum = 8 * 32; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; + } + this.cksum = sum; + encNumber(buf, off + 148, 8, this.cksum); + this.cksumValid = true; + return this.needPax; + } + set(data) { + for (const i in data) { + if (data[i] !== null && data[i] !== void 0) { + this[i] = data[i]; + } + } + } + get type() { + return types.name.get(this[TYPE]) || this[TYPE]; + } + get typeKey() { + return this[TYPE]; + } + set type(type) { + if (types.code.has(type)) { + this[TYPE] = types.code.get(type); + } else { + this[TYPE] = type; + } + } +}; +const splitPrefix = (p, prefixSize) => { + const pathSize = 100; + let pp = p; + let prefix = ""; + let ret; + const root = pathModule.parse(p).root || "."; + if (Buffer.byteLength(pp) < pathSize) { + ret = [pp, prefix, false]; + } else { + prefix = pathModule.dirname(pp); + pp = pathModule.basename(pp); + do { + if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) { + ret = [pp, prefix, false]; + } else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) { + ret = [pp.slice(0, pathSize - 1), prefix, true]; + } else { + pp = pathModule.join(pathModule.basename(prefix), pp); + prefix = pathModule.dirname(prefix); + } + } while (prefix !== root && !ret); + if (!ret) { + ret = [p.slice(0, pathSize - 1), "", true]; + } + } + return ret; +}; +const decString = (buf, off, size) => buf.slice(off, off + size).toString("utf8").replace(/\0.*/, ""); +const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)); +const numToDate = (num) => num === null ? null : new Date(num * 1e3); +const decNumber = (buf, off, size) => buf[off] & 128 ? large.parse(buf.slice(off, off + size)) : decSmallNumber(buf, off, size); +const nanNull = (value) => isNaN(value) ? null : value; +const decSmallNumber = (buf, off, size) => nanNull(parseInt( + buf.slice(off, off + size).toString("utf8").replace(/\0.*$/, "").trim(), + 8 +)); +const MAXNUM = { + 12: 8589934591, + 8: 2097151 +}; +const encNumber = (buf, off, size, number) => number === null ? false : number > MAXNUM[size] || number < 0 ? (large.encode(number, buf.slice(off, off + size)), true) : (encSmallNumber(buf, off, size, number), false); +const encSmallNumber = (buf, off, size, number) => buf.write(octalString(number, size), off, size, "ascii"); +const octalString = (number, size) => padOctal(Math.floor(number).toString(8), size); +const padOctal = (string2, size) => (string2.length === size - 1 ? string2 : new Array(size - string2.length - 1).join("0") + string2 + " ") + "\0"; +const encDate = (buf, off, size, date) => date === null ? false : encNumber(buf, off, size, date.getTime() / 1e3); +const NULLS = new Array(156).join("\0"); +const encString = (buf, off, size, string2) => string2 === null ? false : (buf.write(string2 + NULLS, off, size, "utf8"), string2.length !== Buffer.byteLength(string2) || string2.length > size); +var header = Header$2; +var iterator; +var hasRequiredIterator; +function requireIterator() { + if (hasRequiredIterator) return iterator; + hasRequiredIterator = 1; + iterator = function(Yallist2) { + Yallist2.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value; + } + }; + }; + return iterator; +} +var yallist = Yallist$1; +Yallist$1.Node = Node; +Yallist$1.create = Yallist$1; +function Yallist$1(list2) { + var self2 = this; + if (!(self2 instanceof Yallist$1)) { + self2 = new Yallist$1(); + } + self2.tail = null; + self2.head = null; + self2.length = 0; + if (list2 && typeof list2.forEach === "function") { + list2.forEach(function(item) { + self2.push(item); + }); + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self2.push(arguments[i]); + } + } + return self2; +} +Yallist$1.prototype.removeNode = function(node) { + if (node.list !== this) { + throw new Error("removing node which does not belong to this list"); + } + var next = node.next; + var prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + node.list.length--; + node.next = null; + node.prev = null; + node.list = null; + return next; +}; +Yallist$1.prototype.unshiftNode = function(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; +}; +Yallist$1.prototype.pushNode = function(node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; +}; +Yallist$1.prototype.push = function() { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]); + } + return this.length; +}; +Yallist$1.prototype.unshift = function() { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]); + } + return this.length; +}; +Yallist$1.prototype.pop = function() { + if (!this.tail) { + return void 0; + } + var res = this.tail.value; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = null; + } else { + this.head = null; + } + this.length--; + return res; +}; +Yallist$1.prototype.shift = function() { + if (!this.head) { + return void 0; + } + var res = this.head.value; + this.head = this.head.next; + if (this.head) { + this.head.prev = null; + } else { + this.tail = null; + } + this.length--; + return res; +}; +Yallist$1.prototype.forEach = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this); + walker = walker.next; + } +}; +Yallist$1.prototype.forEachReverse = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this); + walker = walker.prev; + } +}; +Yallist$1.prototype.get = function(n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + walker = walker.next; + } + if (i === n && walker !== null) { + return walker.value; + } +}; +Yallist$1.prototype.getReverse = function(n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + walker = walker.prev; + } + if (i === n && walker !== null) { + return walker.value; + } +}; +Yallist$1.prototype.map = function(fn, thisp) { + thisp = thisp || this; + var res = new Yallist$1(); + for (var walker = this.head; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; +}; +Yallist$1.prototype.mapReverse = function(fn, thisp) { + thisp = thisp || this; + var res = new Yallist$1(); + for (var walker = this.tail; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; +}; +Yallist$1.prototype.reduce = function(fn, initial) { + var acc; + var walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; + } + return acc; +}; +Yallist$1.prototype.reduceReverse = function(fn, initial) { + var acc; + var walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; + } + return acc; +}; +Yallist$1.prototype.toArray = function() { + var arr = new Array(this.length); + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; +}; +Yallist$1.prototype.toArrayReverse = function() { + var arr = new Array(this.length); + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; +}; +Yallist$1.prototype.slice = function(from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist$1(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next; + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; +}; +Yallist$1.prototype.sliceReverse = function(from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist$1(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev; + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; +}; +Yallist$1.prototype.splice = function(start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; + } + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next; + } + var ret = []; + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (walker === null) { + walker = this.tail; + } + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev; + } + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]); + } + return ret; +}; +Yallist$1.prototype.reverse = function() { + var head = this.head; + var tail = this.tail; + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; +}; +function insert(self2, node, value) { + var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2); + if (inserted.next === null) { + self2.tail = inserted; + } + if (inserted.prev === null) { + self2.head = inserted; + } + self2.length++; + return inserted; +} +function push(self2, item) { + self2.tail = new Node(item, self2.tail, null, self2); + if (!self2.head) { + self2.head = self2.tail; + } + self2.length++; +} +function unshift(self2, item) { + self2.head = new Node(item, null, self2.head, self2); + if (!self2.tail) { + self2.tail = self2.head; + } + self2.length++; +} +function Node(value, prev, next, list2) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list2); + } + this.list = list2; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } else { + this.prev = null; + } + if (next) { + next.prev = this; + this.next = next; + } else { + this.next = null; + } +} +try { + requireIterator()(Yallist$1); +} catch (er) { +} +var minipass$2 = {}; +const proc$2 = typeof process === "object" && process ? process : { + stdout: null, + stderr: null +}; +const EE$4 = require$$0$2; +const Stream$3 = require$$0$5; +const stringdecoder = require$$2$4; +const SD$2 = stringdecoder.StringDecoder; +const EOF$2 = Symbol("EOF"); +const MAYBE_EMIT_END$2 = Symbol("maybeEmitEnd"); +const EMITTED_END$2 = Symbol("emittedEnd"); +const EMITTING_END$2 = Symbol("emittingEnd"); +const EMITTED_ERROR$2 = Symbol("emittedError"); +const CLOSED$2 = Symbol("closed"); +const READ$2 = Symbol("read"); +const FLUSH$2 = Symbol("flush"); +const FLUSHCHUNK$2 = Symbol("flushChunk"); +const ENCODING$2 = Symbol("encoding"); +const DECODER$2 = Symbol("decoder"); +const FLOWING$2 = Symbol("flowing"); +const PAUSED$2 = Symbol("paused"); +const RESUME$2 = Symbol("resume"); +const BUFFER$1 = Symbol("buffer"); +const PIPES = Symbol("pipes"); +const BUFFERLENGTH$2 = Symbol("bufferLength"); +const BUFFERPUSH$2 = Symbol("bufferPush"); +const BUFFERSHIFT$2 = Symbol("bufferShift"); +const OBJECTMODE$2 = Symbol("objectMode"); +const DESTROYED$2 = Symbol("destroyed"); +const ERROR = Symbol("error"); +const EMITDATA$2 = Symbol("emitData"); +const EMITEND$2 = Symbol("emitEnd"); +const EMITEND2$2 = Symbol("emitEnd2"); +const ASYNC$2 = Symbol("async"); +const ABORT = Symbol("abort"); +const ABORTED$1 = Symbol("aborted"); +const SIGNAL = Symbol("signal"); +const defer$2 = (fn) => Promise.resolve().then(fn); +const doIter$2 = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1"; +const ASYNCITERATOR$2 = doIter$2 && Symbol.asyncIterator || Symbol("asyncIterator not implemented"); +const ITERATOR$2 = doIter$2 && Symbol.iterator || Symbol("iterator not implemented"); +const isEndish$2 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; +const isArrayBuffer$2 = (b) => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; +const isArrayBufferView$2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); +let Pipe$2 = class Pipe { + constructor(src, dest, opts) { + this.src = src; + this.dest = dest; + this.opts = opts; + this.ondrain = () => src[RESUME$2](); + dest.on("drain", this.ondrain); + } + unpipe() { + this.dest.removeListener("drain", this.ondrain); + } + // istanbul ignore next - only here for the prototype + proxyErrors() { + } + end() { + this.unpipe(); + if (this.opts.end) this.dest.end(); + } +}; +let PipeProxyErrors$2 = class PipeProxyErrors extends Pipe$2 { + unpipe() { + this.src.removeListener("error", this.proxyErrors); + super.unpipe(); + } + constructor(src, dest, opts) { + super(src, dest, opts); + this.proxyErrors = (er) => dest.emit("error", er); + src.on("error", this.proxyErrors); + } +}; +let Minipass$2 = class Minipass extends Stream$3 { + constructor(options2) { + super(); + this[FLOWING$2] = false; + this[PAUSED$2] = false; + this[PIPES] = []; + this[BUFFER$1] = []; + this[OBJECTMODE$2] = options2 && options2.objectMode || false; + if (this[OBJECTMODE$2]) this[ENCODING$2] = null; + else this[ENCODING$2] = options2 && options2.encoding || null; + if (this[ENCODING$2] === "buffer") this[ENCODING$2] = null; + this[ASYNC$2] = options2 && !!options2.async || false; + this[DECODER$2] = this[ENCODING$2] ? new SD$2(this[ENCODING$2]) : null; + this[EOF$2] = false; + this[EMITTED_END$2] = false; + this[EMITTING_END$2] = false; + this[CLOSED$2] = false; + this[EMITTED_ERROR$2] = null; + this.writable = true; + this.readable = true; + this[BUFFERLENGTH$2] = 0; + this[DESTROYED$2] = false; + if (options2 && options2.debugExposeBuffer === true) { + Object.defineProperty(this, "buffer", { get: () => this[BUFFER$1] }); + } + if (options2 && options2.debugExposePipes === true) { + Object.defineProperty(this, "pipes", { get: () => this[PIPES] }); + } + this[SIGNAL] = options2 && options2.signal; + this[ABORTED$1] = false; + if (this[SIGNAL]) { + this[SIGNAL].addEventListener("abort", () => this[ABORT]()); + if (this[SIGNAL].aborted) { + this[ABORT](); + } + } + } + get bufferLength() { + return this[BUFFERLENGTH$2]; + } + get encoding() { + return this[ENCODING$2]; + } + set encoding(enc) { + if (this[OBJECTMODE$2]) throw new Error("cannot set encoding in objectMode"); + if (this[ENCODING$2] && enc !== this[ENCODING$2] && (this[DECODER$2] && this[DECODER$2].lastNeed || this[BUFFERLENGTH$2])) + throw new Error("cannot change encoding"); + if (this[ENCODING$2] !== enc) { + this[DECODER$2] = enc ? new SD$2(enc) : null; + if (this[BUFFER$1].length) + this[BUFFER$1] = this[BUFFER$1].map((chunk) => this[DECODER$2].write(chunk)); + } + this[ENCODING$2] = enc; + } + setEncoding(enc) { + this.encoding = enc; + } + get objectMode() { + return this[OBJECTMODE$2]; + } + set objectMode(om) { + this[OBJECTMODE$2] = this[OBJECTMODE$2] || !!om; + } + get ["async"]() { + return this[ASYNC$2]; + } + set ["async"](a) { + this[ASYNC$2] = this[ASYNC$2] || !!a; + } + // drop everything and get out of the flow completely + [ABORT]() { + this[ABORTED$1] = true; + this.emit("abort", this[SIGNAL].reason); + this.destroy(this[SIGNAL].reason); + } + get aborted() { + return this[ABORTED$1]; + } + set aborted(_) { + } + write(chunk, encoding2, cb) { + if (this[ABORTED$1]) return false; + if (this[EOF$2]) throw new Error("write after end"); + if (this[DESTROYED$2]) { + this.emit( + "error", + Object.assign( + new Error("Cannot call write after a stream was destroyed"), + { code: "ERR_STREAM_DESTROYED" } + ) + ); + return true; + } + if (typeof encoding2 === "function") cb = encoding2, encoding2 = "utf8"; + if (!encoding2) encoding2 = "utf8"; + const fn = this[ASYNC$2] ? defer$2 : (f2) => f2(); + if (!this[OBJECTMODE$2] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView$2(chunk)) + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + else if (isArrayBuffer$2(chunk)) chunk = Buffer.from(chunk); + else if (typeof chunk !== "string") + this.objectMode = true; + } + if (this[OBJECTMODE$2]) { + if (this.flowing && this[BUFFERLENGTH$2] !== 0) this[FLUSH$2](true); + if (this.flowing) this.emit("data", chunk); + else this[BUFFERPUSH$2](chunk); + if (this[BUFFERLENGTH$2] !== 0) this.emit("readable"); + if (cb) fn(cb); + return this.flowing; + } + if (!chunk.length) { + if (this[BUFFERLENGTH$2] !== 0) this.emit("readable"); + if (cb) fn(cb); + return this.flowing; + } + if (typeof chunk === "string" && // unless it is a string already ready for us to use + !(encoding2 === this[ENCODING$2] && !this[DECODER$2].lastNeed)) { + chunk = Buffer.from(chunk, encoding2); + } + if (Buffer.isBuffer(chunk) && this[ENCODING$2]) + chunk = this[DECODER$2].write(chunk); + if (this.flowing && this[BUFFERLENGTH$2] !== 0) this[FLUSH$2](true); + if (this.flowing) this.emit("data", chunk); + else this[BUFFERPUSH$2](chunk); + if (this[BUFFERLENGTH$2] !== 0) this.emit("readable"); + if (cb) fn(cb); + return this.flowing; + } + read(n) { + if (this[DESTROYED$2]) return null; + if (this[BUFFERLENGTH$2] === 0 || n === 0 || n > this[BUFFERLENGTH$2]) { + this[MAYBE_EMIT_END$2](); + return null; + } + if (this[OBJECTMODE$2]) n = null; + if (this[BUFFER$1].length > 1 && !this[OBJECTMODE$2]) { + if (this.encoding) this[BUFFER$1] = [this[BUFFER$1].join("")]; + else this[BUFFER$1] = [Buffer.concat(this[BUFFER$1], this[BUFFERLENGTH$2])]; + } + const ret = this[READ$2](n || null, this[BUFFER$1][0]); + this[MAYBE_EMIT_END$2](); + return ret; + } + [READ$2](n, chunk) { + if (n === chunk.length || n === null) this[BUFFERSHIFT$2](); + else { + this[BUFFER$1][0] = chunk.slice(n); + chunk = chunk.slice(0, n); + this[BUFFERLENGTH$2] -= n; + } + this.emit("data", chunk); + if (!this[BUFFER$1].length && !this[EOF$2]) this.emit("drain"); + return chunk; + } + end(chunk, encoding2, cb) { + if (typeof chunk === "function") cb = chunk, chunk = null; + if (typeof encoding2 === "function") cb = encoding2, encoding2 = "utf8"; + if (chunk) this.write(chunk, encoding2); + if (cb) this.once("end", cb); + this[EOF$2] = true; + this.writable = false; + if (this.flowing || !this[PAUSED$2]) this[MAYBE_EMIT_END$2](); + return this; + } + // don't let the internal resume be overwritten + [RESUME$2]() { + if (this[DESTROYED$2]) return; + this[PAUSED$2] = false; + this[FLOWING$2] = true; + this.emit("resume"); + if (this[BUFFER$1].length) this[FLUSH$2](); + else if (this[EOF$2]) this[MAYBE_EMIT_END$2](); + else this.emit("drain"); + } + resume() { + return this[RESUME$2](); + } + pause() { + this[FLOWING$2] = false; + this[PAUSED$2] = true; + } + get destroyed() { + return this[DESTROYED$2]; + } + get flowing() { + return this[FLOWING$2]; + } + get paused() { + return this[PAUSED$2]; + } + [BUFFERPUSH$2](chunk) { + if (this[OBJECTMODE$2]) this[BUFFERLENGTH$2] += 1; + else this[BUFFERLENGTH$2] += chunk.length; + this[BUFFER$1].push(chunk); + } + [BUFFERSHIFT$2]() { + if (this[OBJECTMODE$2]) this[BUFFERLENGTH$2] -= 1; + else this[BUFFERLENGTH$2] -= this[BUFFER$1][0].length; + return this[BUFFER$1].shift(); + } + [FLUSH$2](noDrain) { + do { + } while (this[FLUSHCHUNK$2](this[BUFFERSHIFT$2]()) && this[BUFFER$1].length); + if (!noDrain && !this[BUFFER$1].length && !this[EOF$2]) this.emit("drain"); + } + [FLUSHCHUNK$2](chunk) { + this.emit("data", chunk); + return this.flowing; + } + pipe(dest, opts) { + if (this[DESTROYED$2]) return; + const ended = this[EMITTED_END$2]; + opts = opts || {}; + if (dest === proc$2.stdout || dest === proc$2.stderr) opts.end = false; + else opts.end = opts.end !== false; + opts.proxyErrors = !!opts.proxyErrors; + if (ended) { + if (opts.end) dest.end(); + } else { + this[PIPES].push( + !opts.proxyErrors ? new Pipe$2(this, dest, opts) : new PipeProxyErrors$2(this, dest, opts) + ); + if (this[ASYNC$2]) defer$2(() => this[RESUME$2]()); + else this[RESUME$2](); + } + return dest; + } + unpipe(dest) { + const p = this[PIPES].find((p2) => p2.dest === dest); + if (p) { + this[PIPES].splice(this[PIPES].indexOf(p), 1); + p.unpipe(); + } + } + addListener(ev, fn) { + return this.on(ev, fn); + } + on(ev, fn) { + const ret = super.on(ev, fn); + if (ev === "data" && !this[PIPES].length && !this.flowing) this[RESUME$2](); + else if (ev === "readable" && this[BUFFERLENGTH$2] !== 0) + super.emit("readable"); + else if (isEndish$2(ev) && this[EMITTED_END$2]) { + super.emit(ev); + this.removeAllListeners(ev); + } else if (ev === "error" && this[EMITTED_ERROR$2]) { + if (this[ASYNC$2]) defer$2(() => fn.call(this, this[EMITTED_ERROR$2])); + else fn.call(this, this[EMITTED_ERROR$2]); + } + return ret; + } + get emittedEnd() { + return this[EMITTED_END$2]; + } + [MAYBE_EMIT_END$2]() { + if (!this[EMITTING_END$2] && !this[EMITTED_END$2] && !this[DESTROYED$2] && this[BUFFER$1].length === 0 && this[EOF$2]) { + this[EMITTING_END$2] = true; + this.emit("end"); + this.emit("prefinish"); + this.emit("finish"); + if (this[CLOSED$2]) this.emit("close"); + this[EMITTING_END$2] = false; + } + } + emit(ev, data, ...extra) { + if (ev !== "error" && ev !== "close" && ev !== DESTROYED$2 && this[DESTROYED$2]) + return; + else if (ev === "data") { + return !this[OBJECTMODE$2] && !data ? false : this[ASYNC$2] ? defer$2(() => this[EMITDATA$2](data)) : this[EMITDATA$2](data); + } else if (ev === "end") { + return this[EMITEND$2](); + } else if (ev === "close") { + this[CLOSED$2] = true; + if (!this[EMITTED_END$2] && !this[DESTROYED$2]) return; + const ret2 = super.emit("close"); + this.removeAllListeners("close"); + return ret2; + } else if (ev === "error") { + this[EMITTED_ERROR$2] = data; + super.emit(ERROR, data); + const ret2 = !this[SIGNAL] || this.listeners("error").length ? super.emit("error", data) : false; + this[MAYBE_EMIT_END$2](); + return ret2; + } else if (ev === "resume") { + const ret2 = super.emit("resume"); + this[MAYBE_EMIT_END$2](); + return ret2; + } else if (ev === "finish" || ev === "prefinish") { + const ret2 = super.emit(ev); + this.removeAllListeners(ev); + return ret2; + } + const ret = super.emit(ev, data, ...extra); + this[MAYBE_EMIT_END$2](); + return ret; + } + [EMITDATA$2](data) { + for (const p of this[PIPES]) { + if (p.dest.write(data) === false) this.pause(); + } + const ret = super.emit("data", data); + this[MAYBE_EMIT_END$2](); + return ret; + } + [EMITEND$2]() { + if (this[EMITTED_END$2]) return; + this[EMITTED_END$2] = true; + this.readable = false; + if (this[ASYNC$2]) defer$2(() => this[EMITEND2$2]()); + else this[EMITEND2$2](); + } + [EMITEND2$2]() { + if (this[DECODER$2]) { + const data = this[DECODER$2].end(); + if (data) { + for (const p of this[PIPES]) { + p.dest.write(data); + } + super.emit("data", data); + } + } + for (const p of this[PIPES]) { + p.end(); + } + const ret = super.emit("end"); + this.removeAllListeners("end"); + return ret; + } + // const all = await stream.collect() + collect() { + const buf = []; + if (!this[OBJECTMODE$2]) buf.dataLength = 0; + const p = this.promise(); + this.on("data", (c) => { + buf.push(c); + if (!this[OBJECTMODE$2]) buf.dataLength += c.length; + }); + return p.then(() => buf); + } + // const data = await stream.concat() + concat() { + return this[OBJECTMODE$2] ? Promise.reject(new Error("cannot concat in objectMode")) : this.collect().then( + (buf) => this[OBJECTMODE$2] ? Promise.reject(new Error("cannot concat in objectMode")) : this[ENCODING$2] ? buf.join("") : Buffer.concat(buf, buf.dataLength) + ); + } + // stream.promise().then(() => done, er => emitted error) + promise() { + return new Promise((resolve, reject) => { + this.on(DESTROYED$2, () => reject(new Error("stream destroyed"))); + this.on("error", (er) => reject(er)); + this.on("end", () => resolve()); + }); + } + // for await (let chunk of stream) + [ASYNCITERATOR$2]() { + let stopped = false; + const stop = () => { + this.pause(); + stopped = true; + return Promise.resolve({ done: true }); + }; + const next = () => { + if (stopped) return stop(); + const res = this.read(); + if (res !== null) return Promise.resolve({ done: false, value: res }); + if (this[EOF$2]) return stop(); + let resolve = null; + let reject = null; + const onerr = (er) => { + this.removeListener("data", ondata); + this.removeListener("end", onend); + this.removeListener(DESTROYED$2, ondestroy); + stop(); + reject(er); + }; + const ondata = (value) => { + this.removeListener("error", onerr); + this.removeListener("end", onend); + this.removeListener(DESTROYED$2, ondestroy); + this.pause(); + resolve({ value, done: !!this[EOF$2] }); + }; + const onend = () => { + this.removeListener("error", onerr); + this.removeListener("data", ondata); + this.removeListener(DESTROYED$2, ondestroy); + stop(); + resolve({ done: true }); + }; + const ondestroy = () => onerr(new Error("stream destroyed")); + return new Promise((res2, rej) => { + reject = rej; + resolve = res2; + this.once(DESTROYED$2, ondestroy); + this.once("error", onerr); + this.once("end", onend); + this.once("data", ondata); + }); + }; + return { + next, + throw: stop, + return: stop, + [ASYNCITERATOR$2]() { + return this; + } + }; + } + // for (let chunk of stream) + [ITERATOR$2]() { + let stopped = false; + const stop = () => { + this.pause(); + this.removeListener(ERROR, stop); + this.removeListener(DESTROYED$2, stop); + this.removeListener("end", stop); + stopped = true; + return { done: true }; + }; + const next = () => { + if (stopped) return stop(); + const value = this.read(); + return value === null ? stop() : { value }; + }; + this.once("end", stop); + this.once(ERROR, stop); + this.once(DESTROYED$2, stop); + return { + next, + throw: stop, + return: stop, + [ITERATOR$2]() { + return this; + } + }; + } + destroy(er) { + if (this[DESTROYED$2]) { + if (er) this.emit("error", er); + else this.emit(DESTROYED$2); + return this; + } + this[DESTROYED$2] = true; + this[BUFFER$1].length = 0; + this[BUFFERLENGTH$2] = 0; + if (typeof this.close === "function" && !this[CLOSED$2]) this.close(); + if (er) this.emit("error", er); + else this.emit(DESTROYED$2); + return this; + } + static isStream(s) { + return !!s && (s instanceof Minipass || s instanceof Stream$3 || s instanceof EE$4 && // readable + (typeof s.pipe === "function" || // writable + typeof s.write === "function" && typeof s.end === "function")); + } +}; +minipass$2.Minipass = Minipass$2; +const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; +var normalizeWindowsPath = platform !== "win32" ? (p) => p : (p) => p && p.replace(/\\/g, "/"); +const { Minipass: Minipass$1 } = minipass$2; +const normPath = normalizeWindowsPath; +const SLURP = Symbol("slurp"); +var readEntry = class ReadEntry extends Minipass$1 { + constructor(header2, ex, gex) { + super(); + this.pause(); + this.extended = ex; + this.globalExtended = gex; + this.header = header2; + this.startBlockSize = 512 * Math.ceil(header2.size / 512); + this.blockRemain = this.startBlockSize; + this.remain = header2.size; + this.type = header2.type; + this.meta = false; + this.ignore = false; + switch (this.type) { + case "File": + case "OldFile": + case "Link": + case "SymbolicLink": + case "CharacterDevice": + case "BlockDevice": + case "Directory": + case "FIFO": + case "ContiguousFile": + case "GNUDumpDir": + break; + case "NextFileHasLongLinkpath": + case "NextFileHasLongPath": + case "OldGnuLongPath": + case "GlobalExtendedHeader": + case "ExtendedHeader": + case "OldExtendedHeader": + this.meta = true; + break; + default: + this.ignore = true; + } + this.path = normPath(header2.path); + this.mode = header2.mode; + if (this.mode) { + this.mode = this.mode & 4095; + } + this.uid = header2.uid; + this.gid = header2.gid; + this.uname = header2.uname; + this.gname = header2.gname; + this.size = header2.size; + this.mtime = header2.mtime; + this.atime = header2.atime; + this.ctime = header2.ctime; + this.linkpath = normPath(header2.linkpath); + this.uname = header2.uname; + this.gname = header2.gname; + if (ex) { + this[SLURP](ex); + } + if (gex) { + this[SLURP](gex, true); + } + } + write(data) { + const writeLen = data.length; + if (writeLen > this.blockRemain) { + throw new Error("writing more to entry than is appropriate"); + } + const r = this.remain; + const br = this.blockRemain; + this.remain = Math.max(0, r - writeLen); + this.blockRemain = Math.max(0, br - writeLen); + if (this.ignore) { + return true; + } + if (r >= writeLen) { + return super.write(data); + } + return super.write(data.slice(0, r)); + } + [SLURP](ex, global2) { + for (const k in ex) { + if (ex[k] !== null && ex[k] !== void 0 && !(global2 && k === "path")) { + this[k] = k === "path" || k === "linkpath" ? normPath(ex[k]) : ex[k]; + } + } + } +}; +const Header$1 = header; +const path$b = require$$0$9; +let Pax$1 = class Pax { + constructor(obj, global2) { + this.atime = obj.atime || null; + this.charset = obj.charset || null; + this.comment = obj.comment || null; + this.ctime = obj.ctime || null; + this.gid = obj.gid || null; + this.gname = obj.gname || null; + this.linkpath = obj.linkpath || null; + this.mtime = obj.mtime || null; + this.path = obj.path || null; + this.size = obj.size || null; + this.uid = obj.uid || null; + this.uname = obj.uname || null; + this.dev = obj.dev || null; + this.ino = obj.ino || null; + this.nlink = obj.nlink || null; + this.global = global2 || false; + } + encode() { + const body2 = this.encodeBody(); + if (body2 === "") { + return null; + } + const bodyLen = Buffer.byteLength(body2); + const bufLen = 512 * Math.ceil(1 + bodyLen / 512); + const buf = Buffer.allocUnsafe(bufLen); + for (let i = 0; i < 512; i++) { + buf[i] = 0; + } + new Header$1({ + // XXX split the path + // then the path should be PaxHeader + basename, but less than 99, + // prepend with the dirname + path: ("PaxHeader/" + path$b.basename(this.path)).slice(0, 99), + mode: this.mode || 420, + uid: this.uid || null, + gid: this.gid || null, + size: bodyLen, + mtime: this.mtime || null, + type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", + linkpath: "", + uname: this.uname || "", + gname: this.gname || "", + devmaj: 0, + devmin: 0, + atime: this.atime || null, + ctime: this.ctime || null + }).encode(buf); + buf.write(body2, 512, bodyLen, "utf8"); + for (let i = bodyLen + 512; i < buf.length; i++) { + buf[i] = 0; + } + return buf; + } + encodeBody() { + return this.encodeField("path") + this.encodeField("ctime") + this.encodeField("atime") + this.encodeField("dev") + this.encodeField("ino") + this.encodeField("nlink") + this.encodeField("charset") + this.encodeField("comment") + this.encodeField("gid") + this.encodeField("gname") + this.encodeField("linkpath") + this.encodeField("mtime") + this.encodeField("size") + this.encodeField("uid") + this.encodeField("uname"); + } + encodeField(field) { + if (this[field] === null || this[field] === void 0) { + return ""; + } + const v = this[field] instanceof Date ? this[field].getTime() / 1e3 : this[field]; + const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n"; + const byteLen = Buffer.byteLength(s); + let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1; + if (byteLen + digits >= Math.pow(10, digits)) { + digits += 1; + } + const len = digits + byteLen; + return len + s; + } +}; +Pax$1.parse = (string2, ex, g) => new Pax$1(merge$1(parseKV(string2), ex), g); +const merge$1 = (a, b) => b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a; +const parseKV = (string2) => string2.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null)); +const parseKVLine = (set, line) => { + const n = parseInt(line, 10); + if (n !== Buffer.byteLength(line) + 1) { + return set; + } + line = line.slice((n + " ").length); + const kv = line.split("="); + const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, "$1"); + if (!k) { + return set; + } + const v = kv.join("="); + set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(v * 1e3) : /^[0-9]+$/.test(v) ? +v : v; + return set; +}; +var pax = Pax$1; +var minizlib = {}; +const realZlibConstants = require$$3$2.constants || /* istanbul ignore next */ +{ ZLIB_VERNUM: 4736 }; +var constants$6 = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + Z_VERSION_ERROR: -6, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + DEFLATE: 1, + INFLATE: 2, + GZIP: 3, + GUNZIP: 4, + DEFLATERAW: 5, + INFLATERAW: 6, + UNZIP: 7, + BROTLI_DECODE: 8, + BROTLI_ENCODE: 9, + Z_MIN_WINDOWBITS: 8, + Z_MAX_WINDOWBITS: 15, + Z_DEFAULT_WINDOWBITS: 15, + Z_MIN_CHUNK: 64, + Z_MAX_CHUNK: Infinity, + Z_DEFAULT_CHUNK: 16384, + Z_MIN_MEMLEVEL: 1, + Z_MAX_MEMLEVEL: 9, + Z_DEFAULT_MEMLEVEL: 8, + Z_MIN_LEVEL: -1, + Z_MAX_LEVEL: 9, + Z_DEFAULT_LEVEL: -1, + BROTLI_OPERATION_PROCESS: 0, + BROTLI_OPERATION_FLUSH: 1, + BROTLI_OPERATION_FINISH: 2, + BROTLI_OPERATION_EMIT_METADATA: 3, + BROTLI_MODE_GENERIC: 0, + BROTLI_MODE_TEXT: 1, + BROTLI_MODE_FONT: 2, + BROTLI_DEFAULT_MODE: 0, + BROTLI_MIN_QUALITY: 0, + BROTLI_MAX_QUALITY: 11, + BROTLI_DEFAULT_QUALITY: 11, + BROTLI_MIN_WINDOW_BITS: 10, + BROTLI_MAX_WINDOW_BITS: 24, + BROTLI_LARGE_MAX_WINDOW_BITS: 30, + BROTLI_DEFAULT_WINDOW: 22, + BROTLI_MIN_INPUT_BLOCK_BITS: 16, + BROTLI_MAX_INPUT_BLOCK_BITS: 24, + BROTLI_PARAM_MODE: 0, + BROTLI_PARAM_QUALITY: 1, + BROTLI_PARAM_LGWIN: 2, + BROTLI_PARAM_LGBLOCK: 3, + BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, + BROTLI_PARAM_SIZE_HINT: 5, + BROTLI_PARAM_LARGE_WINDOW: 6, + BROTLI_PARAM_NPOSTFIX: 7, + BROTLI_PARAM_NDIRECT: 8, + BROTLI_DECODER_RESULT_ERROR: 0, + BROTLI_DECODER_RESULT_SUCCESS: 1, + BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, + BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, + BROTLI_DECODER_NO_ERROR: 0, + BROTLI_DECODER_SUCCESS: 1, + BROTLI_DECODER_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, + BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, + BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, + BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, + BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, + BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, + BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, + BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, + BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, + BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, + BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, + BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, + BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, + BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, + BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, + BROTLI_DECODER_ERROR_UNREACHABLE: -31 +}, realZlibConstants)); +const proc$1 = typeof process === "object" && process ? process : { + stdout: null, + stderr: null +}; +const EE$3 = require$$0$2; +const Stream$2 = require$$0$5; +const SD$1 = require$$2$4.StringDecoder; +const EOF$1 = Symbol("EOF"); +const MAYBE_EMIT_END$1 = Symbol("maybeEmitEnd"); +const EMITTED_END$1 = Symbol("emittedEnd"); +const EMITTING_END$1 = Symbol("emittingEnd"); +const EMITTED_ERROR$1 = Symbol("emittedError"); +const CLOSED$1 = Symbol("closed"); +const READ$1 = Symbol("read"); +const FLUSH$1 = Symbol("flush"); +const FLUSHCHUNK$1 = Symbol("flushChunk"); +const ENCODING$1 = Symbol("encoding"); +const DECODER$1 = Symbol("decoder"); +const FLOWING$1 = Symbol("flowing"); +const PAUSED$1 = Symbol("paused"); +const RESUME$1 = Symbol("resume"); +const BUFFERLENGTH$1 = Symbol("bufferLength"); +const BUFFERPUSH$1 = Symbol("bufferPush"); +const BUFFERSHIFT$1 = Symbol("bufferShift"); +const OBJECTMODE$1 = Symbol("objectMode"); +const DESTROYED$1 = Symbol("destroyed"); +const EMITDATA$1 = Symbol("emitData"); +const EMITEND$1 = Symbol("emitEnd"); +const EMITEND2$1 = Symbol("emitEnd2"); +const ASYNC$1 = Symbol("async"); +const defer$1 = (fn) => Promise.resolve().then(fn); +const doIter$1 = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1"; +const ASYNCITERATOR$1 = doIter$1 && Symbol.asyncIterator || Symbol("asyncIterator not implemented"); +const ITERATOR$1 = doIter$1 && Symbol.iterator || Symbol("iterator not implemented"); +const isEndish$1 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; +const isArrayBuffer$1 = (b) => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; +const isArrayBufferView$1 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); +let Pipe$1 = class Pipe2 { + constructor(src, dest, opts) { + this.src = src; + this.dest = dest; + this.opts = opts; + this.ondrain = () => src[RESUME$1](); + dest.on("drain", this.ondrain); + } + unpipe() { + this.dest.removeListener("drain", this.ondrain); + } + // istanbul ignore next - only here for the prototype + proxyErrors() { + } + end() { + this.unpipe(); + if (this.opts.end) + this.dest.end(); + } +}; +let PipeProxyErrors$1 = class PipeProxyErrors2 extends Pipe$1 { + unpipe() { + this.src.removeListener("error", this.proxyErrors); + super.unpipe(); + } + constructor(src, dest, opts) { + super(src, dest, opts); + this.proxyErrors = (er) => dest.emit("error", er); + src.on("error", this.proxyErrors); + } +}; +var minipass$1 = class Minipass2 extends Stream$2 { + constructor(options2) { + super(); + this[FLOWING$1] = false; + this[PAUSED$1] = false; + this.pipes = []; + this.buffer = []; + this[OBJECTMODE$1] = options2 && options2.objectMode || false; + if (this[OBJECTMODE$1]) + this[ENCODING$1] = null; + else + this[ENCODING$1] = options2 && options2.encoding || null; + if (this[ENCODING$1] === "buffer") + this[ENCODING$1] = null; + this[ASYNC$1] = options2 && !!options2.async || false; + this[DECODER$1] = this[ENCODING$1] ? new SD$1(this[ENCODING$1]) : null; + this[EOF$1] = false; + this[EMITTED_END$1] = false; + this[EMITTING_END$1] = false; + this[CLOSED$1] = false; + this[EMITTED_ERROR$1] = null; + this.writable = true; + this.readable = true; + this[BUFFERLENGTH$1] = 0; + this[DESTROYED$1] = false; + } + get bufferLength() { + return this[BUFFERLENGTH$1]; + } + get encoding() { + return this[ENCODING$1]; + } + set encoding(enc) { + if (this[OBJECTMODE$1]) + throw new Error("cannot set encoding in objectMode"); + if (this[ENCODING$1] && enc !== this[ENCODING$1] && (this[DECODER$1] && this[DECODER$1].lastNeed || this[BUFFERLENGTH$1])) + throw new Error("cannot change encoding"); + if (this[ENCODING$1] !== enc) { + this[DECODER$1] = enc ? new SD$1(enc) : null; + if (this.buffer.length) + this.buffer = this.buffer.map((chunk) => this[DECODER$1].write(chunk)); + } + this[ENCODING$1] = enc; + } + setEncoding(enc) { + this.encoding = enc; + } + get objectMode() { + return this[OBJECTMODE$1]; + } + set objectMode(om) { + this[OBJECTMODE$1] = this[OBJECTMODE$1] || !!om; + } + get ["async"]() { + return this[ASYNC$1]; + } + set ["async"](a) { + this[ASYNC$1] = this[ASYNC$1] || !!a; + } + write(chunk, encoding2, cb) { + if (this[EOF$1]) + throw new Error("write after end"); + if (this[DESTROYED$1]) { + this.emit("error", Object.assign( + new Error("Cannot call write after a stream was destroyed"), + { code: "ERR_STREAM_DESTROYED" } + )); + return true; + } + if (typeof encoding2 === "function") + cb = encoding2, encoding2 = "utf8"; + if (!encoding2) + encoding2 = "utf8"; + const fn = this[ASYNC$1] ? defer$1 : (f2) => f2(); + if (!this[OBJECTMODE$1] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView$1(chunk)) + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + else if (isArrayBuffer$1(chunk)) + chunk = Buffer.from(chunk); + else if (typeof chunk !== "string") + this.objectMode = true; + } + if (this[OBJECTMODE$1]) { + if (this.flowing && this[BUFFERLENGTH$1] !== 0) + this[FLUSH$1](true); + if (this.flowing) + this.emit("data", chunk); + else + this[BUFFERPUSH$1](chunk); + if (this[BUFFERLENGTH$1] !== 0) + this.emit("readable"); + if (cb) + fn(cb); + return this.flowing; + } + if (!chunk.length) { + if (this[BUFFERLENGTH$1] !== 0) + this.emit("readable"); + if (cb) + fn(cb); + return this.flowing; + } + if (typeof chunk === "string" && // unless it is a string already ready for us to use + !(encoding2 === this[ENCODING$1] && !this[DECODER$1].lastNeed)) { + chunk = Buffer.from(chunk, encoding2); + } + if (Buffer.isBuffer(chunk) && this[ENCODING$1]) + chunk = this[DECODER$1].write(chunk); + if (this.flowing && this[BUFFERLENGTH$1] !== 0) + this[FLUSH$1](true); + if (this.flowing) + this.emit("data", chunk); + else + this[BUFFERPUSH$1](chunk); + if (this[BUFFERLENGTH$1] !== 0) + this.emit("readable"); + if (cb) + fn(cb); + return this.flowing; + } + read(n) { + if (this[DESTROYED$1]) + return null; + if (this[BUFFERLENGTH$1] === 0 || n === 0 || n > this[BUFFERLENGTH$1]) { + this[MAYBE_EMIT_END$1](); + return null; + } + if (this[OBJECTMODE$1]) + n = null; + if (this.buffer.length > 1 && !this[OBJECTMODE$1]) { + if (this.encoding) + this.buffer = [this.buffer.join("")]; + else + this.buffer = [Buffer.concat(this.buffer, this[BUFFERLENGTH$1])]; + } + const ret = this[READ$1](n || null, this.buffer[0]); + this[MAYBE_EMIT_END$1](); + return ret; + } + [READ$1](n, chunk) { + if (n === chunk.length || n === null) + this[BUFFERSHIFT$1](); + else { + this.buffer[0] = chunk.slice(n); + chunk = chunk.slice(0, n); + this[BUFFERLENGTH$1] -= n; + } + this.emit("data", chunk); + if (!this.buffer.length && !this[EOF$1]) + this.emit("drain"); + return chunk; + } + end(chunk, encoding2, cb) { + if (typeof chunk === "function") + cb = chunk, chunk = null; + if (typeof encoding2 === "function") + cb = encoding2, encoding2 = "utf8"; + if (chunk) + this.write(chunk, encoding2); + if (cb) + this.once("end", cb); + this[EOF$1] = true; + this.writable = false; + if (this.flowing || !this[PAUSED$1]) + this[MAYBE_EMIT_END$1](); + return this; + } + // don't let the internal resume be overwritten + [RESUME$1]() { + if (this[DESTROYED$1]) + return; + this[PAUSED$1] = false; + this[FLOWING$1] = true; + this.emit("resume"); + if (this.buffer.length) + this[FLUSH$1](); + else if (this[EOF$1]) + this[MAYBE_EMIT_END$1](); + else + this.emit("drain"); + } + resume() { + return this[RESUME$1](); + } + pause() { + this[FLOWING$1] = false; + this[PAUSED$1] = true; + } + get destroyed() { + return this[DESTROYED$1]; + } + get flowing() { + return this[FLOWING$1]; + } + get paused() { + return this[PAUSED$1]; + } + [BUFFERPUSH$1](chunk) { + if (this[OBJECTMODE$1]) + this[BUFFERLENGTH$1] += 1; + else + this[BUFFERLENGTH$1] += chunk.length; + this.buffer.push(chunk); + } + [BUFFERSHIFT$1]() { + if (this.buffer.length) { + if (this[OBJECTMODE$1]) + this[BUFFERLENGTH$1] -= 1; + else + this[BUFFERLENGTH$1] -= this.buffer[0].length; + } + return this.buffer.shift(); + } + [FLUSH$1](noDrain) { + do { + } while (this[FLUSHCHUNK$1](this[BUFFERSHIFT$1]())); + if (!noDrain && !this.buffer.length && !this[EOF$1]) + this.emit("drain"); + } + [FLUSHCHUNK$1](chunk) { + return chunk ? (this.emit("data", chunk), this.flowing) : false; + } + pipe(dest, opts) { + if (this[DESTROYED$1]) + return; + const ended = this[EMITTED_END$1]; + opts = opts || {}; + if (dest === proc$1.stdout || dest === proc$1.stderr) + opts.end = false; + else + opts.end = opts.end !== false; + opts.proxyErrors = !!opts.proxyErrors; + if (ended) { + if (opts.end) + dest.end(); + } else { + this.pipes.push(!opts.proxyErrors ? new Pipe$1(this, dest, opts) : new PipeProxyErrors$1(this, dest, opts)); + if (this[ASYNC$1]) + defer$1(() => this[RESUME$1]()); + else + this[RESUME$1](); + } + return dest; + } + unpipe(dest) { + const p = this.pipes.find((p2) => p2.dest === dest); + if (p) { + this.pipes.splice(this.pipes.indexOf(p), 1); + p.unpipe(); + } + } + addListener(ev, fn) { + return this.on(ev, fn); + } + on(ev, fn) { + const ret = super.on(ev, fn); + if (ev === "data" && !this.pipes.length && !this.flowing) + this[RESUME$1](); + else if (ev === "readable" && this[BUFFERLENGTH$1] !== 0) + super.emit("readable"); + else if (isEndish$1(ev) && this[EMITTED_END$1]) { + super.emit(ev); + this.removeAllListeners(ev); + } else if (ev === "error" && this[EMITTED_ERROR$1]) { + if (this[ASYNC$1]) + defer$1(() => fn.call(this, this[EMITTED_ERROR$1])); + else + fn.call(this, this[EMITTED_ERROR$1]); + } + return ret; + } + get emittedEnd() { + return this[EMITTED_END$1]; + } + [MAYBE_EMIT_END$1]() { + if (!this[EMITTING_END$1] && !this[EMITTED_END$1] && !this[DESTROYED$1] && this.buffer.length === 0 && this[EOF$1]) { + this[EMITTING_END$1] = true; + this.emit("end"); + this.emit("prefinish"); + this.emit("finish"); + if (this[CLOSED$1]) + this.emit("close"); + this[EMITTING_END$1] = false; + } + } + emit(ev, data, ...extra) { + if (ev !== "error" && ev !== "close" && ev !== DESTROYED$1 && this[DESTROYED$1]) + return; + else if (ev === "data") { + return !data ? false : this[ASYNC$1] ? defer$1(() => this[EMITDATA$1](data)) : this[EMITDATA$1](data); + } else if (ev === "end") { + return this[EMITEND$1](); + } else if (ev === "close") { + this[CLOSED$1] = true; + if (!this[EMITTED_END$1] && !this[DESTROYED$1]) + return; + const ret2 = super.emit("close"); + this.removeAllListeners("close"); + return ret2; + } else if (ev === "error") { + this[EMITTED_ERROR$1] = data; + const ret2 = super.emit("error", data); + this[MAYBE_EMIT_END$1](); + return ret2; + } else if (ev === "resume") { + const ret2 = super.emit("resume"); + this[MAYBE_EMIT_END$1](); + return ret2; + } else if (ev === "finish" || ev === "prefinish") { + const ret2 = super.emit(ev); + this.removeAllListeners(ev); + return ret2; + } + const ret = super.emit(ev, data, ...extra); + this[MAYBE_EMIT_END$1](); + return ret; + } + [EMITDATA$1](data) { + for (const p of this.pipes) { + if (p.dest.write(data) === false) + this.pause(); + } + const ret = super.emit("data", data); + this[MAYBE_EMIT_END$1](); + return ret; + } + [EMITEND$1]() { + if (this[EMITTED_END$1]) + return; + this[EMITTED_END$1] = true; + this.readable = false; + if (this[ASYNC$1]) + defer$1(() => this[EMITEND2$1]()); + else + this[EMITEND2$1](); + } + [EMITEND2$1]() { + if (this[DECODER$1]) { + const data = this[DECODER$1].end(); + if (data) { + for (const p of this.pipes) { + p.dest.write(data); + } + super.emit("data", data); + } + } + for (const p of this.pipes) { + p.end(); + } + const ret = super.emit("end"); + this.removeAllListeners("end"); + return ret; + } + // const all = await stream.collect() + collect() { + const buf = []; + if (!this[OBJECTMODE$1]) + buf.dataLength = 0; + const p = this.promise(); + this.on("data", (c) => { + buf.push(c); + if (!this[OBJECTMODE$1]) + buf.dataLength += c.length; + }); + return p.then(() => buf); + } + // const data = await stream.concat() + concat() { + return this[OBJECTMODE$1] ? Promise.reject(new Error("cannot concat in objectMode")) : this.collect().then((buf) => this[OBJECTMODE$1] ? Promise.reject(new Error("cannot concat in objectMode")) : this[ENCODING$1] ? buf.join("") : Buffer.concat(buf, buf.dataLength)); + } + // stream.promise().then(() => done, er => emitted error) + promise() { + return new Promise((resolve, reject) => { + this.on(DESTROYED$1, () => reject(new Error("stream destroyed"))); + this.on("error", (er) => reject(er)); + this.on("end", () => resolve()); + }); + } + // for await (let chunk of stream) + [ASYNCITERATOR$1]() { + const next = () => { + const res = this.read(); + if (res !== null) + return Promise.resolve({ done: false, value: res }); + if (this[EOF$1]) + return Promise.resolve({ done: true }); + let resolve = null; + let reject = null; + const onerr = (er) => { + this.removeListener("data", ondata); + this.removeListener("end", onend); + reject(er); + }; + const ondata = (value) => { + this.removeListener("error", onerr); + this.removeListener("end", onend); + this.pause(); + resolve({ value, done: !!this[EOF$1] }); + }; + const onend = () => { + this.removeListener("error", onerr); + this.removeListener("data", ondata); + resolve({ done: true }); + }; + const ondestroy = () => onerr(new Error("stream destroyed")); + return new Promise((res2, rej) => { + reject = rej; + resolve = res2; + this.once(DESTROYED$1, ondestroy); + this.once("error", onerr); + this.once("end", onend); + this.once("data", ondata); + }); + }; + return { next }; + } + // for (let chunk of stream) + [ITERATOR$1]() { + const next = () => { + const value = this.read(); + const done = value === null; + return { value, done }; + }; + return { next }; + } + destroy(er) { + if (this[DESTROYED$1]) { + if (er) + this.emit("error", er); + else + this.emit(DESTROYED$1); + return this; + } + this[DESTROYED$1] = true; + this.buffer.length = 0; + this[BUFFERLENGTH$1] = 0; + if (typeof this.close === "function" && !this[CLOSED$1]) + this.close(); + if (er) + this.emit("error", er); + else + this.emit(DESTROYED$1); + return this; + } + static isStream(s) { + return !!s && (s instanceof Minipass2 || s instanceof Stream$2 || s instanceof EE$3 && (typeof s.pipe === "function" || // readable + typeof s.write === "function" && typeof s.end === "function")); + } +}; +const assert = require$$0$4; +const Buffer$1 = require$$7.Buffer; +const realZlib = require$$3$2; +const constants$5 = minizlib.constants = constants$6; +const Minipass3 = minipass$1; +const OriginalBufferConcat = Buffer$1.concat; +const _superWrite = Symbol("_superWrite"); +class ZlibError extends Error { + constructor(err) { + super("zlib: " + err.message); + this.code = err.code; + this.errno = err.errno; + if (!this.code) + this.code = "ZLIB_ERROR"; + this.message = "zlib: " + err.message; + Error.captureStackTrace(this, this.constructor); + } + get name() { + return "ZlibError"; + } +} +const _opts = Symbol("opts"); +const _flushFlag = Symbol("flushFlag"); +const _finishFlushFlag = Symbol("finishFlushFlag"); +const _fullFlushFlag = Symbol("fullFlushFlag"); +const _handle = Symbol("handle"); +const _onError = Symbol("onError"); +const _sawError = Symbol("sawError"); +const _level = Symbol("level"); +const _strategy = Symbol("strategy"); +const _ended$1 = Symbol("ended"); +class ZlibBase extends Minipass3 { + constructor(opts, mode) { + if (!opts || typeof opts !== "object") + throw new TypeError("invalid options for ZlibBase constructor"); + super(opts); + this[_sawError] = false; + this[_ended$1] = false; + this[_opts] = opts; + this[_flushFlag] = opts.flush; + this[_finishFlushFlag] = opts.finishFlush; + try { + this[_handle] = new realZlib[mode](opts); + } catch (er) { + throw new ZlibError(er); + } + this[_onError] = (err) => { + if (this[_sawError]) + return; + this[_sawError] = true; + this.close(); + this.emit("error", err); + }; + this[_handle].on("error", (er) => this[_onError](new ZlibError(er))); + this.once("end", () => this.close); + } + close() { + if (this[_handle]) { + this[_handle].close(); + this[_handle] = null; + this.emit("close"); + } + } + reset() { + if (!this[_sawError]) { + assert(this[_handle], "zlib binding closed"); + return this[_handle].reset(); + } + } + flush(flushFlag) { + if (this.ended) + return; + if (typeof flushFlag !== "number") + flushFlag = this[_fullFlushFlag]; + this.write(Object.assign(Buffer$1.alloc(0), { [_flushFlag]: flushFlag })); + } + end(chunk, encoding2, cb) { + if (chunk) + this.write(chunk, encoding2); + this.flush(this[_finishFlushFlag]); + this[_ended$1] = true; + return super.end(null, null, cb); + } + get ended() { + return this[_ended$1]; + } + write(chunk, encoding2, cb) { + if (typeof encoding2 === "function") + cb = encoding2, encoding2 = "utf8"; + if (typeof chunk === "string") + chunk = Buffer$1.from(chunk, encoding2); + if (this[_sawError]) + return; + assert(this[_handle], "zlib binding closed"); + const nativeHandle = this[_handle]._handle; + const originalNativeClose = nativeHandle.close; + nativeHandle.close = () => { + }; + const originalClose = this[_handle].close; + this[_handle].close = () => { + }; + Buffer$1.concat = (args) => args; + let result; + try { + const flushFlag = typeof chunk[_flushFlag] === "number" ? chunk[_flushFlag] : this[_flushFlag]; + result = this[_handle]._processChunk(chunk, flushFlag); + Buffer$1.concat = OriginalBufferConcat; + } catch (err) { + Buffer$1.concat = OriginalBufferConcat; + this[_onError](new ZlibError(err)); + } finally { + if (this[_handle]) { + this[_handle]._handle = nativeHandle; + nativeHandle.close = originalNativeClose; + this[_handle].close = originalClose; + this[_handle].removeAllListeners("error"); + } + } + if (this[_handle]) + this[_handle].on("error", (er) => this[_onError](new ZlibError(er))); + let writeReturn; + if (result) { + if (Array.isArray(result) && result.length > 0) { + writeReturn = this[_superWrite](Buffer$1.from(result[0])); + for (let i = 1; i < result.length; i++) { + writeReturn = this[_superWrite](result[i]); + } + } else { + writeReturn = this[_superWrite](Buffer$1.from(result)); + } + } + if (cb) + cb(); + return writeReturn; + } + [_superWrite](data) { + return super.write(data); + } +} +class Zlib extends ZlibBase { + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants$5.Z_NO_FLUSH; + opts.finishFlush = opts.finishFlush || constants$5.Z_FINISH; + super(opts, mode); + this[_fullFlushFlag] = constants$5.Z_FULL_FLUSH; + this[_level] = opts.level; + this[_strategy] = opts.strategy; + } + params(level, strategy) { + if (this[_sawError]) + return; + if (!this[_handle]) + throw new Error("cannot switch params when binding is closed"); + if (!this[_handle].params) + throw new Error("not supported in this implementation"); + if (this[_level] !== level || this[_strategy] !== strategy) { + this.flush(constants$5.Z_SYNC_FLUSH); + assert(this[_handle], "zlib binding closed"); + const origFlush = this[_handle].flush; + this[_handle].flush = (flushFlag, cb) => { + this.flush(flushFlag); + cb(); + }; + try { + this[_handle].params(level, strategy); + } finally { + this[_handle].flush = origFlush; + } + if (this[_handle]) { + this[_level] = level; + this[_strategy] = strategy; + } + } + } +} +class Deflate extends Zlib { + constructor(opts) { + super(opts, "Deflate"); + } +} +class Inflate extends Zlib { + constructor(opts) { + super(opts, "Inflate"); + } +} +const _portable = Symbol("_portable"); +class Gzip extends Zlib { + constructor(opts) { + super(opts, "Gzip"); + this[_portable] = opts && !!opts.portable; + } + [_superWrite](data) { + if (!this[_portable]) + return super[_superWrite](data); + this[_portable] = false; + data[9] = 255; + return super[_superWrite](data); + } +} +class Gunzip extends Zlib { + constructor(opts) { + super(opts, "Gunzip"); + } +} +class DeflateRaw extends Zlib { + constructor(opts) { + super(opts, "DeflateRaw"); + } +} +class InflateRaw extends Zlib { + constructor(opts) { + super(opts, "InflateRaw"); + } +} +class Unzip extends Zlib { + constructor(opts) { + super(opts, "Unzip"); + } +} +class Brotli extends ZlibBase { + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants$5.BROTLI_OPERATION_PROCESS; + opts.finishFlush = opts.finishFlush || constants$5.BROTLI_OPERATION_FINISH; + super(opts, mode); + this[_fullFlushFlag] = constants$5.BROTLI_OPERATION_FLUSH; + } +} +class BrotliCompress extends Brotli { + constructor(opts) { + super(opts, "BrotliCompress"); + } +} +class BrotliDecompress extends Brotli { + constructor(opts) { + super(opts, "BrotliDecompress"); + } +} +minizlib.Deflate = Deflate; +minizlib.Inflate = Inflate; +minizlib.Gzip = Gzip; +minizlib.Gunzip = Gunzip; +minizlib.DeflateRaw = DeflateRaw; +minizlib.InflateRaw = InflateRaw; +minizlib.Unzip = Unzip; +if (typeof realZlib.BrotliCompress === "function") { + minizlib.BrotliCompress = BrotliCompress; + minizlib.BrotliDecompress = BrotliDecompress; +} else { + minizlib.BrotliCompress = minizlib.BrotliDecompress = class { + constructor() { + throw new Error("Brotli is not supported in this version of Node.js"); + } + }; +} +const warner = warnMixin; +const Header2 = header; +const EE$2 = require$$0$2; +const Yallist = yallist; +const maxMetaEntrySize = 1024 * 1024; +const Entry = readEntry; +const Pax2 = pax; +const zlib = minizlib; +const { nextTick } = require$$7$1; +const gzipHeader = Buffer.from([31, 139]); +const STATE = Symbol("state"); +const WRITEENTRY = Symbol("writeEntry"); +const READENTRY = Symbol("readEntry"); +const NEXTENTRY = Symbol("nextEntry"); +const PROCESSENTRY = Symbol("processEntry"); +const EX = Symbol("extendedHeader"); +const GEX = Symbol("globalExtendedHeader"); +const META = Symbol("meta"); +const EMITMETA = Symbol("emitMeta"); +const BUFFER = Symbol("buffer"); +const QUEUE = Symbol("queue"); +const ENDED = Symbol("ended"); +const EMITTEDEND = Symbol("emittedEnd"); +const EMIT = Symbol("emit"); +const UNZIP = Symbol("unzip"); +const CONSUMECHUNK = Symbol("consumeChunk"); +const CONSUMECHUNKSUB = Symbol("consumeChunkSub"); +const CONSUMEBODY = Symbol("consumeBody"); +const CONSUMEMETA = Symbol("consumeMeta"); +const CONSUMEHEADER = Symbol("consumeHeader"); +const CONSUMING = Symbol("consuming"); +const BUFFERCONCAT = Symbol("bufferConcat"); +const MAYBEEND = Symbol("maybeEnd"); +const WRITING = Symbol("writing"); +const ABORTED = Symbol("aborted"); +const DONE = Symbol("onDone"); +const SAW_VALID_ENTRY = Symbol("sawValidEntry"); +const SAW_NULL_BLOCK = Symbol("sawNullBlock"); +const SAW_EOF = Symbol("sawEOF"); +const CLOSESTREAM = Symbol("closeStream"); +const noop$1 = (_) => true; +var parse$6 = warner(class Parser2 extends EE$2 { + constructor(opt) { + opt = opt || {}; + super(opt); + this.file = opt.file || ""; + this[SAW_VALID_ENTRY] = null; + this.on(DONE, (_) => { + if (this[STATE] === "begin" || this[SAW_VALID_ENTRY] === false) { + this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format"); + } + }); + if (opt.ondone) { + this.on(DONE, opt.ondone); + } else { + this.on(DONE, (_) => { + this.emit("prefinish"); + this.emit("finish"); + this.emit("end"); + }); + } + this.strict = !!opt.strict; + this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize; + this.filter = typeof opt.filter === "function" ? opt.filter : noop$1; + const isTBR = opt.file && (opt.file.endsWith(".tar.br") || opt.file.endsWith(".tbr")); + this.brotli = !opt.gzip && opt.brotli !== void 0 ? opt.brotli : isTBR ? void 0 : false; + this.writable = true; + this.readable = false; + this[QUEUE] = new Yallist(); + this[BUFFER] = null; + this[READENTRY] = null; + this[WRITEENTRY] = null; + this[STATE] = "begin"; + this[META] = ""; + this[EX] = null; + this[GEX] = null; + this[ENDED] = false; + this[UNZIP] = null; + this[ABORTED] = false; + this[SAW_NULL_BLOCK] = false; + this[SAW_EOF] = false; + this.on("end", () => this[CLOSESTREAM]()); + if (typeof opt.onwarn === "function") { + this.on("warn", opt.onwarn); + } + if (typeof opt.onentry === "function") { + this.on("entry", opt.onentry); + } + } + [CONSUMEHEADER](chunk, position) { + if (this[SAW_VALID_ENTRY] === null) { + this[SAW_VALID_ENTRY] = false; + } + let header2; + try { + header2 = new Header2(chunk, position, this[EX], this[GEX]); + } catch (er) { + return this.warn("TAR_ENTRY_INVALID", er); + } + if (header2.nullBlock) { + if (this[SAW_NULL_BLOCK]) { + this[SAW_EOF] = true; + if (this[STATE] === "begin") { + this[STATE] = "header"; + } + this[EMIT]("eof"); + } else { + this[SAW_NULL_BLOCK] = true; + this[EMIT]("nullBlock"); + } + } else { + this[SAW_NULL_BLOCK] = false; + if (!header2.cksumValid) { + this.warn("TAR_ENTRY_INVALID", "checksum failure", { header: header2 }); + } else if (!header2.path) { + this.warn("TAR_ENTRY_INVALID", "path is required", { header: header2 }); + } else { + const type = header2.type; + if (/^(Symbolic)?Link$/.test(type) && !header2.linkpath) { + this.warn("TAR_ENTRY_INVALID", "linkpath required", { header: header2 }); + } else if (!/^(Symbolic)?Link$/.test(type) && header2.linkpath) { + this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { header: header2 }); + } else { + const entry2 = this[WRITEENTRY] = new Entry(header2, this[EX], this[GEX]); + if (!this[SAW_VALID_ENTRY]) { + if (entry2.remain) { + const onend = () => { + if (!entry2.invalid) { + this[SAW_VALID_ENTRY] = true; + } + }; + entry2.on("end", onend); + } else { + this[SAW_VALID_ENTRY] = true; + } + } + if (entry2.meta) { + if (entry2.size > this.maxMetaEntrySize) { + entry2.ignore = true; + this[EMIT]("ignoredEntry", entry2); + this[STATE] = "ignore"; + entry2.resume(); + } else if (entry2.size > 0) { + this[META] = ""; + entry2.on("data", (c) => this[META] += c); + this[STATE] = "meta"; + } + } else { + this[EX] = null; + entry2.ignore = entry2.ignore || !this.filter(entry2.path, entry2); + if (entry2.ignore) { + this[EMIT]("ignoredEntry", entry2); + this[STATE] = entry2.remain ? "ignore" : "header"; + entry2.resume(); + } else { + if (entry2.remain) { + this[STATE] = "body"; + } else { + this[STATE] = "header"; + entry2.end(); + } + if (!this[READENTRY]) { + this[QUEUE].push(entry2); + this[NEXTENTRY](); + } else { + this[QUEUE].push(entry2); + } + } + } + } + } + } + } + [CLOSESTREAM]() { + nextTick(() => this.emit("close")); + } + [PROCESSENTRY](entry2) { + let go = true; + if (!entry2) { + this[READENTRY] = null; + go = false; + } else if (Array.isArray(entry2)) { + this.emit.apply(this, entry2); + } else { + this[READENTRY] = entry2; + this.emit("entry", entry2); + if (!entry2.emittedEnd) { + entry2.on("end", (_) => this[NEXTENTRY]()); + go = false; + } + } + return go; + } + [NEXTENTRY]() { + do { + } while (this[PROCESSENTRY](this[QUEUE].shift())); + if (!this[QUEUE].length) { + const re2 = this[READENTRY]; + const drainNow = !re2 || re2.flowing || re2.size === re2.remain; + if (drainNow) { + if (!this[WRITING]) { + this.emit("drain"); + } + } else { + re2.once("drain", (_) => this.emit("drain")); + } + } + } + [CONSUMEBODY](chunk, position) { + const entry2 = this[WRITEENTRY]; + const br = entry2.blockRemain; + const c = br >= chunk.length && position === 0 ? chunk : chunk.slice(position, position + br); + entry2.write(c); + if (!entry2.blockRemain) { + this[STATE] = "header"; + this[WRITEENTRY] = null; + entry2.end(); + } + return c.length; + } + [CONSUMEMETA](chunk, position) { + const entry2 = this[WRITEENTRY]; + const ret = this[CONSUMEBODY](chunk, position); + if (!this[WRITEENTRY]) { + this[EMITMETA](entry2); + } + return ret; + } + [EMIT](ev, data, extra) { + if (!this[QUEUE].length && !this[READENTRY]) { + this.emit(ev, data, extra); + } else { + this[QUEUE].push([ev, data, extra]); + } + } + [EMITMETA](entry2) { + this[EMIT]("meta", this[META]); + switch (entry2.type) { + case "ExtendedHeader": + case "OldExtendedHeader": + this[EX] = Pax2.parse(this[META], this[EX], false); + break; + case "GlobalExtendedHeader": + this[GEX] = Pax2.parse(this[META], this[GEX], true); + break; + case "NextFileHasLongPath": + case "OldGnuLongPath": + this[EX] = this[EX] || /* @__PURE__ */ Object.create(null); + this[EX].path = this[META].replace(/\0.*/, ""); + break; + case "NextFileHasLongLinkpath": + this[EX] = this[EX] || /* @__PURE__ */ Object.create(null); + this[EX].linkpath = this[META].replace(/\0.*/, ""); + break; + default: + throw new Error("unknown meta: " + entry2.type); + } + } + abort(error2) { + this[ABORTED] = true; + this.emit("abort", error2); + this.warn("TAR_ABORT", error2, { recoverable: false }); + } + write(chunk) { + if (this[ABORTED]) { + return; + } + const needSniff = this[UNZIP] === null || this.brotli === void 0 && this[UNZIP] === false; + if (needSniff && chunk) { + if (this[BUFFER]) { + chunk = Buffer.concat([this[BUFFER], chunk]); + this[BUFFER] = null; + } + if (chunk.length < gzipHeader.length) { + this[BUFFER] = chunk; + return true; + } + for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) { + if (chunk[i] !== gzipHeader[i]) { + this[UNZIP] = false; + } + } + const maybeBrotli = this.brotli === void 0; + if (this[UNZIP] === false && maybeBrotli) { + if (chunk.length < 512) { + if (this[ENDED]) { + this.brotli = true; + } else { + this[BUFFER] = chunk; + return true; + } + } else { + try { + new Header2(chunk.slice(0, 512)); + this.brotli = false; + } catch (_) { + this.brotli = true; + } + } + } + if (this[UNZIP] === null || this[UNZIP] === false && this.brotli) { + const ended = this[ENDED]; + this[ENDED] = false; + this[UNZIP] = this[UNZIP] === null ? new zlib.Unzip() : new zlib.BrotliDecompress(); + this[UNZIP].on("data", (chunk2) => this[CONSUMECHUNK](chunk2)); + this[UNZIP].on("error", (er) => this.abort(er)); + this[UNZIP].on("end", (_) => { + this[ENDED] = true; + this[CONSUMECHUNK](); + }); + this[WRITING] = true; + const ret2 = this[UNZIP][ended ? "end" : "write"](chunk); + this[WRITING] = false; + return ret2; + } + } + this[WRITING] = true; + if (this[UNZIP]) { + this[UNZIP].write(chunk); + } else { + this[CONSUMECHUNK](chunk); + } + this[WRITING] = false; + const ret = this[QUEUE].length ? false : this[READENTRY] ? this[READENTRY].flowing : true; + if (!ret && !this[QUEUE].length) { + this[READENTRY].once("drain", (_) => this.emit("drain")); + } + return ret; + } + [BUFFERCONCAT](c) { + if (c && !this[ABORTED]) { + this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c; + } + } + [MAYBEEND]() { + if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED] && !this[CONSUMING]) { + this[EMITTEDEND] = true; + const entry2 = this[WRITEENTRY]; + if (entry2 && entry2.blockRemain) { + const have = this[BUFFER] ? this[BUFFER].length : 0; + this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${entry2.blockRemain} more bytes, only ${have} available)`, { entry: entry2 }); + if (this[BUFFER]) { + entry2.write(this[BUFFER]); + } + entry2.end(); + } + this[EMIT](DONE); + } + } + [CONSUMECHUNK](chunk) { + if (this[CONSUMING]) { + this[BUFFERCONCAT](chunk); + } else if (!chunk && !this[BUFFER]) { + this[MAYBEEND](); + } else { + this[CONSUMING] = true; + if (this[BUFFER]) { + this[BUFFERCONCAT](chunk); + const c = this[BUFFER]; + this[BUFFER] = null; + this[CONSUMECHUNKSUB](c); + } else { + this[CONSUMECHUNKSUB](chunk); + } + while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED] && !this[SAW_EOF]) { + const c = this[BUFFER]; + this[BUFFER] = null; + this[CONSUMECHUNKSUB](c); + } + this[CONSUMING] = false; + } + if (!this[BUFFER] || this[ENDED]) { + this[MAYBEEND](); + } + } + [CONSUMECHUNKSUB](chunk) { + let position = 0; + const length = chunk.length; + while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) { + switch (this[STATE]) { + case "begin": + case "header": + this[CONSUMEHEADER](chunk, position); + position += 512; + break; + case "ignore": + case "body": + position += this[CONSUMEBODY](chunk, position); + break; + case "meta": + position += this[CONSUMEMETA](chunk, position); + break; + default: + throw new Error("invalid state: " + this[STATE]); + } + } + if (position < length) { + if (this[BUFFER]) { + this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]]); + } else { + this[BUFFER] = chunk.slice(position); + } + } + } + end(chunk) { + if (!this[ABORTED]) { + if (this[UNZIP]) { + this[UNZIP].end(chunk); + } else { + this[ENDED] = true; + if (this.brotli === void 0) chunk = chunk || Buffer.alloc(0); + this.write(chunk); + } + } + } +}); +var fsMinipass = {}; +const proc = typeof process === "object" && process ? process : { + stdout: null, + stderr: null +}; +const EE$1 = require$$0$2; +const Stream$1 = require$$0$5; +const SD = require$$2$4.StringDecoder; +const EOF = Symbol("EOF"); +const MAYBE_EMIT_END = Symbol("maybeEmitEnd"); +const EMITTED_END = Symbol("emittedEnd"); +const EMITTING_END = Symbol("emittingEnd"); +const EMITTED_ERROR = Symbol("emittedError"); +const CLOSED = Symbol("closed"); +const READ = Symbol("read"); +const FLUSH = Symbol("flush"); +const FLUSHCHUNK = Symbol("flushChunk"); +const ENCODING = Symbol("encoding"); +const DECODER = Symbol("decoder"); +const FLOWING = Symbol("flowing"); +const PAUSED = Symbol("paused"); +const RESUME = Symbol("resume"); +const BUFFERLENGTH = Symbol("bufferLength"); +const BUFFERPUSH = Symbol("bufferPush"); +const BUFFERSHIFT = Symbol("bufferShift"); +const OBJECTMODE = Symbol("objectMode"); +const DESTROYED = Symbol("destroyed"); +const EMITDATA = Symbol("emitData"); +const EMITEND = Symbol("emitEnd"); +const EMITEND2 = Symbol("emitEnd2"); +const ASYNC = Symbol("async"); +const defer = (fn) => Promise.resolve().then(fn); +const doIter = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1"; +const ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented"); +const ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented"); +const isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; +const isArrayBuffer = (b) => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; +const isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); +class Pipe3 { + constructor(src, dest, opts) { + this.src = src; + this.dest = dest; + this.opts = opts; + this.ondrain = () => src[RESUME](); + dest.on("drain", this.ondrain); + } + unpipe() { + this.dest.removeListener("drain", this.ondrain); + } + // istanbul ignore next - only here for the prototype + proxyErrors() { + } + end() { + this.unpipe(); + if (this.opts.end) + this.dest.end(); + } +} +class PipeProxyErrors3 extends Pipe3 { + unpipe() { + this.src.removeListener("error", this.proxyErrors); + super.unpipe(); + } + constructor(src, dest, opts) { + super(src, dest, opts); + this.proxyErrors = (er) => dest.emit("error", er); + src.on("error", this.proxyErrors); + } +} +var minipass = class Minipass4 extends Stream$1 { + constructor(options2) { + super(); + this[FLOWING] = false; + this[PAUSED] = false; + this.pipes = []; + this.buffer = []; + this[OBJECTMODE] = options2 && options2.objectMode || false; + if (this[OBJECTMODE]) + this[ENCODING] = null; + else + this[ENCODING] = options2 && options2.encoding || null; + if (this[ENCODING] === "buffer") + this[ENCODING] = null; + this[ASYNC] = options2 && !!options2.async || false; + this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null; + this[EOF] = false; + this[EMITTED_END] = false; + this[EMITTING_END] = false; + this[CLOSED] = false; + this[EMITTED_ERROR] = null; + this.writable = true; + this.readable = true; + this[BUFFERLENGTH] = 0; + this[DESTROYED] = false; + } + get bufferLength() { + return this[BUFFERLENGTH]; + } + get encoding() { + return this[ENCODING]; + } + set encoding(enc) { + if (this[OBJECTMODE]) + throw new Error("cannot set encoding in objectMode"); + if (this[ENCODING] && enc !== this[ENCODING] && (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) + throw new Error("cannot change encoding"); + if (this[ENCODING] !== enc) { + this[DECODER] = enc ? new SD(enc) : null; + if (this.buffer.length) + this.buffer = this.buffer.map((chunk) => this[DECODER].write(chunk)); + } + this[ENCODING] = enc; + } + setEncoding(enc) { + this.encoding = enc; + } + get objectMode() { + return this[OBJECTMODE]; + } + set objectMode(om) { + this[OBJECTMODE] = this[OBJECTMODE] || !!om; + } + get ["async"]() { + return this[ASYNC]; + } + set ["async"](a) { + this[ASYNC] = this[ASYNC] || !!a; + } + write(chunk, encoding2, cb) { + if (this[EOF]) + throw new Error("write after end"); + if (this[DESTROYED]) { + this.emit("error", Object.assign( + new Error("Cannot call write after a stream was destroyed"), + { code: "ERR_STREAM_DESTROYED" } + )); + return true; + } + if (typeof encoding2 === "function") + cb = encoding2, encoding2 = "utf8"; + if (!encoding2) + encoding2 = "utf8"; + const fn = this[ASYNC] ? defer : (f2) => f2(); + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + else if (isArrayBuffer(chunk)) + chunk = Buffer.from(chunk); + else if (typeof chunk !== "string") + this.objectMode = true; + } + if (this[OBJECTMODE]) { + if (this.flowing && this[BUFFERLENGTH] !== 0) + this[FLUSH](true); + if (this.flowing) + this.emit("data", chunk); + else + this[BUFFERPUSH](chunk); + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn(cb); + return this.flowing; + } + if (!chunk.length) { + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn(cb); + return this.flowing; + } + if (typeof chunk === "string" && // unless it is a string already ready for us to use + !(encoding2 === this[ENCODING] && !this[DECODER].lastNeed)) { + chunk = Buffer.from(chunk, encoding2); + } + if (Buffer.isBuffer(chunk) && this[ENCODING]) + chunk = this[DECODER].write(chunk); + if (this.flowing && this[BUFFERLENGTH] !== 0) + this[FLUSH](true); + if (this.flowing) + this.emit("data", chunk); + else + this[BUFFERPUSH](chunk); + if (this[BUFFERLENGTH] !== 0) + this.emit("readable"); + if (cb) + fn(cb); + return this.flowing; + } + read(n) { + if (this[DESTROYED]) + return null; + if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) { + this[MAYBE_EMIT_END](); + return null; + } + if (this[OBJECTMODE]) + n = null; + if (this.buffer.length > 1 && !this[OBJECTMODE]) { + if (this.encoding) + this.buffer = [this.buffer.join("")]; + else + this.buffer = [Buffer.concat(this.buffer, this[BUFFERLENGTH])]; + } + const ret = this[READ](n || null, this.buffer[0]); + this[MAYBE_EMIT_END](); + return ret; + } + [READ](n, chunk) { + if (n === chunk.length || n === null) + this[BUFFERSHIFT](); + else { + this.buffer[0] = chunk.slice(n); + chunk = chunk.slice(0, n); + this[BUFFERLENGTH] -= n; + } + this.emit("data", chunk); + if (!this.buffer.length && !this[EOF]) + this.emit("drain"); + return chunk; + } + end(chunk, encoding2, cb) { + if (typeof chunk === "function") + cb = chunk, chunk = null; + if (typeof encoding2 === "function") + cb = encoding2, encoding2 = "utf8"; + if (chunk) + this.write(chunk, encoding2); + if (cb) + this.once("end", cb); + this[EOF] = true; + this.writable = false; + if (this.flowing || !this[PAUSED]) + this[MAYBE_EMIT_END](); + return this; + } + // don't let the internal resume be overwritten + [RESUME]() { + if (this[DESTROYED]) + return; + this[PAUSED] = false; + this[FLOWING] = true; + this.emit("resume"); + if (this.buffer.length) + this[FLUSH](); + else if (this[EOF]) + this[MAYBE_EMIT_END](); + else + this.emit("drain"); + } + resume() { + return this[RESUME](); + } + pause() { + this[FLOWING] = false; + this[PAUSED] = true; + } + get destroyed() { + return this[DESTROYED]; + } + get flowing() { + return this[FLOWING]; + } + get paused() { + return this[PAUSED]; + } + [BUFFERPUSH](chunk) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] += 1; + else + this[BUFFERLENGTH] += chunk.length; + this.buffer.push(chunk); + } + [BUFFERSHIFT]() { + if (this.buffer.length) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] -= 1; + else + this[BUFFERLENGTH] -= this.buffer[0].length; + } + return this.buffer.shift(); + } + [FLUSH](noDrain) { + do { + } while (this[FLUSHCHUNK](this[BUFFERSHIFT]())); + if (!noDrain && !this.buffer.length && !this[EOF]) + this.emit("drain"); + } + [FLUSHCHUNK](chunk) { + return chunk ? (this.emit("data", chunk), this.flowing) : false; + } + pipe(dest, opts) { + if (this[DESTROYED]) + return; + const ended = this[EMITTED_END]; + opts = opts || {}; + if (dest === proc.stdout || dest === proc.stderr) + opts.end = false; + else + opts.end = opts.end !== false; + opts.proxyErrors = !!opts.proxyErrors; + if (ended) { + if (opts.end) + dest.end(); + } else { + this.pipes.push(!opts.proxyErrors ? new Pipe3(this, dest, opts) : new PipeProxyErrors3(this, dest, opts)); + if (this[ASYNC]) + defer(() => this[RESUME]()); + else + this[RESUME](); + } + return dest; + } + unpipe(dest) { + const p = this.pipes.find((p2) => p2.dest === dest); + if (p) { + this.pipes.splice(this.pipes.indexOf(p), 1); + p.unpipe(); + } + } + addListener(ev, fn) { + return this.on(ev, fn); + } + on(ev, fn) { + const ret = super.on(ev, fn); + if (ev === "data" && !this.pipes.length && !this.flowing) + this[RESUME](); + else if (ev === "readable" && this[BUFFERLENGTH] !== 0) + super.emit("readable"); + else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev); + this.removeAllListeners(ev); + } else if (ev === "error" && this[EMITTED_ERROR]) { + if (this[ASYNC]) + defer(() => fn.call(this, this[EMITTED_ERROR])); + else + fn.call(this, this[EMITTED_ERROR]); + } + return ret; + } + get emittedEnd() { + return this[EMITTED_END]; + } + [MAYBE_EMIT_END]() { + if (!this[EMITTING_END] && !this[EMITTED_END] && !this[DESTROYED] && this.buffer.length === 0 && this[EOF]) { + this[EMITTING_END] = true; + this.emit("end"); + this.emit("prefinish"); + this.emit("finish"); + if (this[CLOSED]) + this.emit("close"); + this[EMITTING_END] = false; + } + } + emit(ev, data, ...extra) { + if (ev !== "error" && ev !== "close" && ev !== DESTROYED && this[DESTROYED]) + return; + else if (ev === "data") { + return !data ? false : this[ASYNC] ? defer(() => this[EMITDATA](data)) : this[EMITDATA](data); + } else if (ev === "end") { + return this[EMITEND](); + } else if (ev === "close") { + this[CLOSED] = true; + if (!this[EMITTED_END] && !this[DESTROYED]) + return; + const ret2 = super.emit("close"); + this.removeAllListeners("close"); + return ret2; + } else if (ev === "error") { + this[EMITTED_ERROR] = data; + const ret2 = super.emit("error", data); + this[MAYBE_EMIT_END](); + return ret2; + } else if (ev === "resume") { + const ret2 = super.emit("resume"); + this[MAYBE_EMIT_END](); + return ret2; + } else if (ev === "finish" || ev === "prefinish") { + const ret2 = super.emit(ev); + this.removeAllListeners(ev); + return ret2; + } + const ret = super.emit(ev, data, ...extra); + this[MAYBE_EMIT_END](); + return ret; + } + [EMITDATA](data) { + for (const p of this.pipes) { + if (p.dest.write(data) === false) + this.pause(); + } + const ret = super.emit("data", data); + this[MAYBE_EMIT_END](); + return ret; + } + [EMITEND]() { + if (this[EMITTED_END]) + return; + this[EMITTED_END] = true; + this.readable = false; + if (this[ASYNC]) + defer(() => this[EMITEND2]()); + else + this[EMITEND2](); + } + [EMITEND2]() { + if (this[DECODER]) { + const data = this[DECODER].end(); + if (data) { + for (const p of this.pipes) { + p.dest.write(data); + } + super.emit("data", data); + } + } + for (const p of this.pipes) { + p.end(); + } + const ret = super.emit("end"); + this.removeAllListeners("end"); + return ret; + } + // const all = await stream.collect() + collect() { + const buf = []; + if (!this[OBJECTMODE]) + buf.dataLength = 0; + const p = this.promise(); + this.on("data", (c) => { + buf.push(c); + if (!this[OBJECTMODE]) + buf.dataLength += c.length; + }); + return p.then(() => buf); + } + // const data = await stream.concat() + concat() { + return this[OBJECTMODE] ? Promise.reject(new Error("cannot concat in objectMode")) : this.collect().then((buf) => this[OBJECTMODE] ? Promise.reject(new Error("cannot concat in objectMode")) : this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength)); + } + // stream.promise().then(() => done, er => emitted error) + promise() { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error("stream destroyed"))); + this.on("error", (er) => reject(er)); + this.on("end", () => resolve()); + }); + } + // for await (let chunk of stream) + [ASYNCITERATOR]() { + const next = () => { + const res = this.read(); + if (res !== null) + return Promise.resolve({ done: false, value: res }); + if (this[EOF]) + return Promise.resolve({ done: true }); + let resolve = null; + let reject = null; + const onerr = (er) => { + this.removeListener("data", ondata); + this.removeListener("end", onend); + reject(er); + }; + const ondata = (value) => { + this.removeListener("error", onerr); + this.removeListener("end", onend); + this.pause(); + resolve({ value, done: !!this[EOF] }); + }; + const onend = () => { + this.removeListener("error", onerr); + this.removeListener("data", ondata); + resolve({ done: true }); + }; + const ondestroy = () => onerr(new Error("stream destroyed")); + return new Promise((res2, rej) => { + reject = rej; + resolve = res2; + this.once(DESTROYED, ondestroy); + this.once("error", onerr); + this.once("end", onend); + this.once("data", ondata); + }); + }; + return { next }; + } + // for (let chunk of stream) + [ITERATOR]() { + const next = () => { + const value = this.read(); + const done = value === null; + return { value, done }; + }; + return { next }; + } + destroy(er) { + if (this[DESTROYED]) { + if (er) + this.emit("error", er); + else + this.emit(DESTROYED); + return this; + } + this[DESTROYED] = true; + this.buffer.length = 0; + this[BUFFERLENGTH] = 0; + if (typeof this.close === "function" && !this[CLOSED]) + this.close(); + if (er) + this.emit("error", er); + else + this.emit(DESTROYED); + return this; + } + static isStream(s) { + return !!s && (s instanceof Minipass4 || s instanceof Stream$1 || s instanceof EE$1 && (typeof s.pipe === "function" || // readable + typeof s.write === "function" && typeof s.end === "function")); + } +}; +const MiniPass = minipass; +const EE = require$$0$2.EventEmitter; +const fs$a = require$$0$1; +let writev = fs$a.writev; +if (!writev) { + const binding = process.binding("fs"); + const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback; + writev = (fd, iovec, pos2, cb) => { + const done = (er, bw) => cb(er, bw, iovec); + const req = new FSReqWrap(); + req.oncomplete = done; + binding.writeBuffers(fd, iovec, pos2, req); + }; +} +const _autoClose = Symbol("_autoClose"); +const _close = Symbol("_close"); +const _ended = Symbol("_ended"); +const _fd = Symbol("_fd"); +const _finished = Symbol("_finished"); +const _flags = Symbol("_flags"); +const _flush = Symbol("_flush"); +const _handleChunk = Symbol("_handleChunk"); +const _makeBuf = Symbol("_makeBuf"); +const _mode = Symbol("_mode"); +const _needDrain = Symbol("_needDrain"); +const _onerror = Symbol("_onerror"); +const _onopen = Symbol("_onopen"); +const _onread = Symbol("_onread"); +const _onwrite = Symbol("_onwrite"); +const _open = Symbol("_open"); +const _path = Symbol("_path"); +const _pos = Symbol("_pos"); +const _queue = Symbol("_queue"); +const _read = Symbol("_read"); +const _readSize = Symbol("_readSize"); +const _reading = Symbol("_reading"); +const _remain = Symbol("_remain"); +const _size = Symbol("_size"); +const _write = Symbol("_write"); +const _writing = Symbol("_writing"); +const _defaultFlag = Symbol("_defaultFlag"); +const _errored = Symbol("_errored"); +class ReadStream extends MiniPass { + constructor(path2, opt) { + opt = opt || {}; + super(opt); + this.readable = true; + this.writable = false; + if (typeof path2 !== "string") + throw new TypeError("path must be a string"); + this[_errored] = false; + this[_fd] = typeof opt.fd === "number" ? opt.fd : null; + this[_path] = path2; + this[_readSize] = opt.readSize || 16 * 1024 * 1024; + this[_reading] = false; + this[_size] = typeof opt.size === "number" ? opt.size : Infinity; + this[_remain] = this[_size]; + this[_autoClose] = typeof opt.autoClose === "boolean" ? opt.autoClose : true; + if (typeof this[_fd] === "number") + this[_read](); + else + this[_open](); + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + write() { + throw new TypeError("this is a readable stream"); + } + end() { + throw new TypeError("this is a readable stream"); + } + [_open]() { + fs$a.open(this[_path], "r", (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (er) + this[_onerror](er); + else { + this[_fd] = fd; + this.emit("open", fd); + this[_read](); + } + } + [_makeBuf]() { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])); + } + [_read]() { + if (!this[_reading]) { + this[_reading] = true; + const buf = this[_makeBuf](); + if (buf.length === 0) + return process.nextTick(() => this[_onread](null, 0, buf)); + fs$a.read(this[_fd], buf, 0, buf.length, null, (er, br, buf2) => this[_onread](er, br, buf2)); + } + } + [_onread](er, br, buf) { + this[_reading] = false; + if (er) + this[_onerror](er); + else if (this[_handleChunk](br, buf)) + this[_read](); + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = null; + fs$a.close(fd, (er) => er ? this.emit("error", er) : this.emit("close")); + } + } + [_onerror](er) { + this[_reading] = true; + this[_close](); + this.emit("error", er); + } + [_handleChunk](br, buf) { + let ret = false; + this[_remain] -= br; + if (br > 0) + ret = super.write(br < buf.length ? buf.slice(0, br) : buf); + if (br === 0 || this[_remain] <= 0) { + ret = false; + this[_close](); + super.end(); + } + return ret; + } + emit(ev, data) { + switch (ev) { + case "prefinish": + case "finish": + break; + case "drain": + if (typeof this[_fd] === "number") + this[_read](); + break; + case "error": + if (this[_errored]) + return; + this[_errored] = true; + return super.emit(ev, data); + default: + return super.emit(ev, data); + } + } +} +class ReadStreamSync extends ReadStream { + [_open]() { + let threw = true; + try { + this[_onopen](null, fs$a.openSync(this[_path], "r")); + threw = false; + } finally { + if (threw) + this[_close](); + } + } + [_read]() { + let threw = true; + try { + if (!this[_reading]) { + this[_reading] = true; + do { + const buf = this[_makeBuf](); + const br = buf.length === 0 ? 0 : fs$a.readSync(this[_fd], buf, 0, buf.length, null); + if (!this[_handleChunk](br, buf)) + break; + } while (true); + this[_reading] = false; + } + threw = false; + } finally { + if (threw) + this[_close](); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = null; + fs$a.closeSync(fd); + this.emit("close"); + } + } +} +class WriteStream extends EE { + constructor(path2, opt) { + opt = opt || {}; + super(opt); + this.readable = false; + this.writable = true; + this[_errored] = false; + this[_writing] = false; + this[_ended] = false; + this[_needDrain] = false; + this[_queue] = []; + this[_path] = path2; + this[_fd] = typeof opt.fd === "number" ? opt.fd : null; + this[_mode] = opt.mode === void 0 ? 438 : opt.mode; + this[_pos] = typeof opt.start === "number" ? opt.start : null; + this[_autoClose] = typeof opt.autoClose === "boolean" ? opt.autoClose : true; + const defaultFlag = this[_pos] !== null ? "r+" : "w"; + this[_defaultFlag] = opt.flags === void 0; + this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags; + if (this[_fd] === null) + this[_open](); + } + emit(ev, data) { + if (ev === "error") { + if (this[_errored]) + return; + this[_errored] = true; + } + return super.emit(ev, data); + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + [_onerror](er) { + this[_close](); + this[_writing] = true; + this.emit("error", er); + } + [_open]() { + fs$a.open( + this[_path], + this[_flags], + this[_mode], + (er, fd) => this[_onopen](er, fd) + ); + } + [_onopen](er, fd) { + if (this[_defaultFlag] && this[_flags] === "r+" && er && er.code === "ENOENT") { + this[_flags] = "w"; + this[_open](); + } else if (er) + this[_onerror](er); + else { + this[_fd] = fd; + this.emit("open", fd); + this[_flush](); + } + } + end(buf, enc) { + if (buf) + this.write(buf, enc); + this[_ended] = true; + if (!this[_writing] && !this[_queue].length && typeof this[_fd] === "number") + this[_onwrite](null, 0); + return this; + } + write(buf, enc) { + if (typeof buf === "string") + buf = Buffer.from(buf, enc); + if (this[_ended]) { + this.emit("error", new Error("write() after end()")); + return false; + } + if (this[_fd] === null || this[_writing] || this[_queue].length) { + this[_queue].push(buf); + this[_needDrain] = true; + return false; + } + this[_writing] = true; + this[_write](buf); + return true; + } + [_write](buf) { + fs$a.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + [_onwrite](er, bw) { + if (er) + this[_onerror](er); + else { + if (this[_pos] !== null) + this[_pos] += bw; + if (this[_queue].length) + this[_flush](); + else { + this[_writing] = false; + if (this[_ended] && !this[_finished]) { + this[_finished] = true; + this[_close](); + this.emit("finish"); + } else if (this[_needDrain]) { + this[_needDrain] = false; + this.emit("drain"); + } + } + } + } + [_flush]() { + if (this[_queue].length === 0) { + if (this[_ended]) + this[_onwrite](null, 0); + } else if (this[_queue].length === 1) + this[_write](this[_queue].pop()); + else { + const iovec = this[_queue]; + this[_queue] = []; + writev( + this[_fd], + iovec, + this[_pos], + (er, bw) => this[_onwrite](er, bw) + ); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = null; + fs$a.close(fd, (er) => er ? this.emit("error", er) : this.emit("close")); + } + } +} +class WriteStreamSync extends WriteStream { + [_open]() { + let fd; + if (this[_defaultFlag] && this[_flags] === "r+") { + try { + fd = fs$a.openSync(this[_path], this[_flags], this[_mode]); + } catch (er) { + if (er.code === "ENOENT") { + this[_flags] = "w"; + return this[_open](); + } else + throw er; + } + } else + fd = fs$a.openSync(this[_path], this[_flags], this[_mode]); + this[_onopen](null, fd); + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === "number") { + const fd = this[_fd]; + this[_fd] = null; + fs$a.closeSync(fd); + this.emit("close"); + } + } + [_write](buf) { + let threw = true; + try { + this[_onwrite]( + null, + fs$a.writeSync(this[_fd], buf, 0, buf.length, this[_pos]) + ); + threw = false; + } finally { + if (threw) + try { + this[_close](); + } catch (_) { + } + } + } +} +fsMinipass.ReadStream = ReadStream; +fsMinipass.ReadStreamSync = ReadStreamSync; +fsMinipass.WriteStream = WriteStream; +fsMinipass.WriteStreamSync = WriteStreamSync; +var stripTrailingSlashes = (str) => { + let i = str.length - 1; + let slashesStart = -1; + while (i > -1 && str.charAt(i) === "/") { + slashesStart = i; + i--; + } + return slashesStart === -1 ? str : str.slice(0, slashesStart); +}; +const hlo = highLevelOpt; +const Parser3 = parse$6; +const fs$9 = require$$0$1; +const fsm = fsMinipass; +const path$a = require$$0$9; +const stripSlash = stripTrailingSlashes; +var list_1 = (opt_, files, cb) => { + if (typeof opt_ === "function") { + cb = opt_, files = null, opt_ = {}; + } else if (Array.isArray(opt_)) { + files = opt_, opt_ = {}; + } + if (typeof files === "function") { + cb = files, files = null; + } + if (!files) { + files = []; + } else { + files = Array.from(files); + } + const opt = hlo(opt_); + if (opt.sync && typeof cb === "function") { + throw new TypeError("callback not supported for sync tar functions"); + } + if (!opt.file && typeof cb === "function") { + throw new TypeError("callback only supported with file option"); + } + if (files.length) { + filesFilter(opt, files); + } + if (!opt.noResume) { + onentryFunction(opt); + } + return opt.file && opt.sync ? listFileSync(opt) : opt.file ? listFile(opt, cb) : list(opt); +}; +const onentryFunction = (opt) => { + const onentry = opt.onentry; + opt.onentry = onentry ? (e) => { + onentry(e); + e.resume(); + } : (e) => e.resume(); +}; +const filesFilter = (opt, files) => { + const map = new Map(files.map((f2) => [stripSlash(f2), true])); + const filter = opt.filter; + const mapHas = (file2, r) => { + const root = r || path$a.parse(file2).root || "."; + const ret = file2 === root ? false : map.has(file2) ? map.get(file2) : mapHas(path$a.dirname(file2), root); + map.set(file2, ret); + return ret; + }; + opt.filter = filter ? (file2, entry2) => filter(file2, entry2) && mapHas(stripSlash(file2)) : (file2) => mapHas(stripSlash(file2)); +}; +const listFileSync = (opt) => { + const p = list(opt); + const file2 = opt.file; + let threw = true; + let fd; + try { + const stat2 = fs$9.statSync(file2); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + if (stat2.size < readSize) { + p.end(fs$9.readFileSync(file2)); + } else { + let pos2 = 0; + const buf = Buffer.allocUnsafe(readSize); + fd = fs$9.openSync(file2, "r"); + while (pos2 < stat2.size) { + const bytesRead = fs$9.readSync(fd, buf, 0, readSize, pos2); + pos2 += bytesRead; + p.write(buf.slice(0, bytesRead)); + } + p.end(); + } + threw = false; + } finally { + if (threw && fd) { + try { + fs$9.closeSync(fd); + } catch (er) { + } + } + } +}; +const listFile = (opt, cb) => { + const parse2 = new Parser3(opt); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const file2 = opt.file; + const p = new Promise((resolve, reject) => { + parse2.on("error", reject); + parse2.on("end", resolve); + fs$9.stat(file2, (er, stat2) => { + if (er) { + reject(er); + } else { + const stream2 = new fsm.ReadStream(file2, { + readSize, + size: stat2.size + }); + stream2.on("error", reject); + stream2.pipe(parse2); + } + }); + }); + return cb ? p.then(cb, cb) : p; +}; +const list = (opt) => new Parser3(opt); +var __createBinding$3 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); +} : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault$3 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +} : function(o, v) { + o["default"] = v; +}); +var __importStar$3 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$3(result, mod, k); + } + __setModuleDefault$3(result, mod); + return result; +}; +var __importDefault$4 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; +}; +Object.defineProperty(readManifest$1, "__esModule", { value: true }); +readManifest$1.readManifest = void 0; +const promises_1$1 = __importDefault$4(require$$0); +const node_path_1$1 = __importDefault$4(require$$0); +const valid_js_1$1 = __importDefault$4(valid_1); +const list_js_1 = __importDefault$4(list_1); +const errors$1 = __importStar$3(errors$2); +const SCOPE_RE = /^(@.+)\/.+$/u; +const MANIFEST_BASENAME = "package.json"; +const TARBALL_EXTNAME = ".tgz"; +const isManifest = (file2) => { + return typeof file2 === "string" && node_path_1$1.default.basename(file2) === MANIFEST_BASENAME; +}; +const isDirectory = (file2) => { + return typeof file2 === "string" && node_path_1$1.default.extname(file2) === ""; +}; +const isTarball = (file2) => { + return typeof file2 === "string" && node_path_1$1.default.extname(file2) === TARBALL_EXTNAME; +}; +const validateVersion = (version2) => { + return (0, valid_js_1$1.default)(version2) ?? void 0; +}; +const readPackageJson = async (...pathSegments) => { + const file2 = node_path_1$1.default.resolve(...pathSegments); + try { + return await promises_1$1.default.readFile(file2, "utf8"); + } catch (error2) { + throw new errors$1.PackageJsonReadError(file2, error2); + } +}; +const readTarballPackageJson = async (file2) => { + const data = []; + const onentry = (entry2) => { + if (entry2.path === "package/package.json") { + entry2.on("data", (chunk) => data.push(chunk)); + } + }; + try { + await (0, list_js_1.default)({ file: file2, onentry }); + if (data.length === 0) { + throw new Error("package.json not found inside archive"); + } + } catch (error2) { + throw new errors$1.PackageTarballReadError(file2, error2); + } + return Buffer.concat(data).toString(); +}; +async function readManifest(packagePath) { + var _a2; + let packageSpec; + let manifestContents; + if (!packagePath) { + packageSpec = ""; + manifestContents = await readPackageJson(MANIFEST_BASENAME); + } else if (isManifest(packagePath)) { + packageSpec = node_path_1$1.default.resolve(node_path_1$1.default.dirname(packagePath)); + manifestContents = await readPackageJson(packagePath); + } else if (isDirectory(packagePath)) { + packageSpec = node_path_1$1.default.resolve(packagePath); + manifestContents = await readPackageJson(packagePath, MANIFEST_BASENAME); + } else if (isTarball(packagePath)) { + packageSpec = node_path_1$1.default.resolve(packagePath); + manifestContents = await readTarballPackageJson(packageSpec); + } else { + throw new errors$1.InvalidPackageError(packagePath); + } + let manifestJson; + let name; + let version2; + let publishConfig; + try { + manifestJson = JSON.parse(manifestContents); + name = manifestJson["name"]; + version2 = validateVersion(manifestJson["version"]); + publishConfig = manifestJson["publishConfig"] ?? {}; + } catch (error2) { + throw new errors$1.PackageJsonParseError(packageSpec, error2); + } + if (typeof name !== "string" || name.length === 0) { + throw new errors$1.InvalidPackageNameError(name); + } + if (typeof version2 !== "string") { + throw new errors$1.InvalidPackageVersionError(manifestJson["version"]); + } + if (typeof publishConfig !== "object" || Array.isArray(publishConfig) || !publishConfig) { + throw new errors$1.InvalidPackagePublishConfigError(publishConfig); + } + return { + packageSpec, + name, + version: version2, + publishConfig, + scope: (_a2 = SCOPE_RE.exec(name)) == null ? void 0 : _a2[1] + }; +} +readManifest$1.readManifest = readManifest; +var normalizeOptions = {}; +(function(exports2) { + var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault2 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar2 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); + } + __setModuleDefault2(result, mod); + return result; + }; + var __importDefault2 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.normalizeOptions = exports2.TAG_LATEST = void 0; + const node_os_12 = __importDefault2(require$$0); + const errors2 = __importStar2(errors$2); + const options_js_12 = options; + const REGISTRY_NPM = "https://registry.npmjs.org/"; + exports2.TAG_LATEST = "latest"; + function normalizeOptions2(manifest, options2) { + var _a2, _b, _c, _d; + const defaultTag = ((_a2 = manifest.publishConfig) == null ? void 0 : _a2.tag) ?? exports2.TAG_LATEST; + const defaultRegistry = ((_b = manifest.publishConfig) == null ? void 0 : _b.registry) ?? REGISTRY_NPM; + const defaultAccess = ((_c = manifest.publishConfig) == null ? void 0 : _c.access) ?? (manifest.scope === void 0 ? options_js_12.ACCESS_PUBLIC : void 0); + const defaultProvenance = ((_d = manifest.publishConfig) == null ? void 0 : _d.provenance) ?? false; + return { + token: validateToken(options2.token), + registry: validateRegistry(options2.registry ?? defaultRegistry), + tag: setValue(options2.tag, defaultTag, validateTag), + access: setValue(options2.access, defaultAccess, validateAccess), + provenance: setValue(options2.provenance, defaultProvenance, Boolean), + ignoreScripts: setValue(options2.ignoreScripts, true, Boolean), + dryRun: setValue(options2.dryRun, false, Boolean), + strategy: setValue(options2.strategy, options_js_12.STRATEGY_ALL, validateStrategy), + logger: options2.logger, + temporaryDirectory: options2.temporaryDirectory ?? node_os_12.default.tmpdir() + }; + } + exports2.normalizeOptions = normalizeOptions2; + const setValue = (value, defaultValue, validate2) => ({ + value: validate2(value ?? defaultValue), + isDefault: value === void 0 + }); + const validateToken = (value) => { + if (typeof value === "string" && value.length > 0) { + return value; + } + throw new errors2.InvalidTokenError(); + }; + const validateRegistry = (value) => { + try { + return new URL(value); + } catch { + throw new errors2.InvalidRegistryUrlError(value); + } + }; + const validateTag = (value) => { + if (typeof value === "string" && value.length > 0) { + return value; + } + throw new errors2.InvalidTagError(value); + }; + const validateAccess = (value) => { + if (value === void 0 || value === options_js_12.ACCESS_PUBLIC || value === options_js_12.ACCESS_RESTRICTED) { + return value; + } + throw new errors2.InvalidAccessError(value); + }; + const validateStrategy = (value) => { + if (value === options_js_12.STRATEGY_ALL || value === options_js_12.STRATEGY_UPGRADE) { + return value; + } + throw new errors2.InvalidStrategyError(value); + }; +})(normalizeOptions); +var npm = {}; +var callNpmCli$1 = {}; +var __createBinding$2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); +} : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault$2 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +} : function(o, v) { + o["default"] = v; +}); +var __importStar$2 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$2(result, mod, k); + } + __setModuleDefault$2(result, mod); + return result; +}; +var __importDefault$3 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; +}; +Object.defineProperty(callNpmCli$1, "__esModule", { value: true }); +callNpmCli$1.callNpmCli = callNpmCli$1.EPUBLISHCONFLICT = callNpmCli$1.E404 = callNpmCli$1.PUBLISH = callNpmCli$1.VIEW = void 0; +const node_child_process_1 = __importDefault$3(require$$0); +const node_os_1$2 = __importDefault$3(require$$0); +const errors = __importStar$2(errors$2); +callNpmCli$1.VIEW = "view"; +callNpmCli$1.PUBLISH = "publish"; +callNpmCli$1.E404 = "E404"; +callNpmCli$1.EPUBLISHCONFLICT = "EPUBLISHCONFLICT"; +const NPM = node_os_1$2.default.platform() === "win32" ? "npm.cmd" : "npm"; +const JSON_MATCH_RE = /(\{[\s\S]*\})/mu; +const baseArguments = (options2) => options2.ignoreScripts ? ["--ignore-scripts", "--json"] : ["--json"]; +async function callNpmCli(command2, cliArguments, options2) { + var _a2; + const { stdout, stderr, exitCode } = await execNpm([command2, ...baseArguments(options2), ...cliArguments], options2.environment, options2.logger); + let successData; + let errorCode; + let error2; + if (exitCode === 0) { + successData = parseJson(stdout); + } else { + const errorPayload = parseJson(stdout, stderr); + if ((_a2 = errorPayload == null ? void 0 : errorPayload.error) == null ? void 0 : _a2.code) { + errorCode = String(errorPayload.error.code).toUpperCase(); + } + error2 = new errors.NpmCallError(command2, exitCode, stderr); + } + return { successData, errorCode, error: error2 }; +} +callNpmCli$1.callNpmCli = callNpmCli; +async function execNpm(commandArguments, environment, logger) { + var _a2; + (_a2 = logger == null ? void 0 : logger.debug) == null ? void 0 : _a2.call(logger, `Running command: ${NPM} ${commandArguments.join(" ")}`); + return new Promise((resolve) => { + let stdout = ""; + let stderr = ""; + const npm2 = node_child_process_1.default.spawn(NPM, commandArguments, { + env: { ...process.env, ...environment } + }); + npm2.stdout.on("data", (data) => stdout += data); + npm2.stderr.on("data", (data) => stderr += data); + npm2.on("close", (code) => { + var _a3, _b; + (_a3 = logger == null ? void 0 : logger.debug) == null ? void 0 : _a3.call(logger, `Received stdout: ${stdout}`); + (_b = logger == null ? void 0 : logger.debug) == null ? void 0 : _b.call(logger, `Received stderr: ${stderr}`); + resolve({ + stdout: stdout.trim(), + stderr: stderr.trim(), + exitCode: code ?? 0 + }); + }); + }); +} +function parseJson(...values) { + var _a2; + for (const value of values) { + const jsonValue = (_a2 = JSON_MATCH_RE.exec(value)) == null ? void 0 : _a2[1]; + if (jsonValue) { + try { + return JSON.parse(jsonValue); + } catch { + return void 0; + } + } + } + return void 0; +} +var useNpmEnvironment$1 = {}; +var __importDefault$2 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; +}; +Object.defineProperty(useNpmEnvironment$1, "__esModule", { value: true }); +useNpmEnvironment$1.useNpmEnvironment = void 0; +const promises_1 = __importDefault$2(require$$0); +const node_os_1$1 = __importDefault$2(require$$0); +const node_path_1 = __importDefault$2(require$$0); +async function useNpmEnvironment(manifest, options2, task) { + var _a2; + const { registry, token, logger, temporaryDirectory } = options2; + const { host, origin, pathname } = registry; + const pathnameWithSlash = pathname.endsWith("/") ? pathname : `${pathname}/`; + const config = [ + "; created by jsdevtools/npm-publish", + `//${host}${pathnameWithSlash}:_authToken=\${NODE_AUTH_TOKEN}`, + `registry=${origin}${pathnameWithSlash}`, + "" + ].join(node_os_1$1.default.EOL); + const npmrcDirectory = await promises_1.default.mkdtemp(node_path_1.default.join(temporaryDirectory, "npm-publish-")); + const npmrc = node_path_1.default.join(npmrcDirectory, ".npmrc"); + const environment = { NODE_AUTH_TOKEN: token, npm_config_userconfig: npmrc }; + await promises_1.default.writeFile(npmrc, config, "utf8"); + (_a2 = logger == null ? void 0 : logger.debug) == null ? void 0 : _a2.call(logger, `Temporary .npmrc created at ${npmrc} +${config}`); + try { + return await task(manifest, options2, environment); + } finally { + await promises_1.default.rm(npmrcDirectory, { force: true, recursive: true }); + } +} +useNpmEnvironment$1.useNpmEnvironment = useNpmEnvironment; +(function(exports2) { + var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar(callNpmCli$1, exports2); + __exportStar(useNpmEnvironment$1, exports2); +})(npm); +var compareAndPublish$2 = {}; +var compareAndPublish$1 = {}; +var compareVersions$1 = {}; +const parse$5 = parse_1$2; +const diff = (version1, version2) => { + const v12 = parse$5(version1, null, true); + const v2 = parse$5(version2, null, true); + const comparison = v12.compare(v2); + if (comparison === 0) { + return null; + } + const v1Higher = comparison > 0; + const highVersion = v1Higher ? v12 : v2; + const lowVersion = v1Higher ? v2 : v12; + const highHasPre = !!highVersion.prerelease.length; + const lowHasPre = !!lowVersion.prerelease.length; + if (lowHasPre && !highHasPre) { + if (!lowVersion.patch && !lowVersion.minor) { + return "major"; + } + if (highVersion.patch) { + return "patch"; + } + if (highVersion.minor) { + return "minor"; + } + return "major"; + } + const prefix = highHasPre ? "pre" : ""; + if (v12.major !== v2.major) { + return prefix + "major"; + } + if (v12.minor !== v2.minor) { + return prefix + "minor"; + } + if (v12.patch !== v2.patch) { + return prefix + "patch"; + } + return "prerelease"; +}; +var diff_1 = diff; +const SemVer2 = semver; +const compare$2 = (a, b, loose) => new SemVer2(a, loose).compare(new SemVer2(b, loose)); +var compare_1 = compare$2; +const compare$1 = compare_1; +const gt = (a, b, loose) => compare$1(a, b, loose) > 0; +var gt_1 = gt; +var __importDefault$1 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; +}; +Object.defineProperty(compareVersions$1, "__esModule", { value: true }); +compareVersions$1.compareVersions = void 0; +const diff_js_1 = __importDefault$1(diff_1); +const gt_js_1 = __importDefault$1(gt_1); +const valid_js_1 = __importDefault$1(valid_1); +const options_js_1 = options; +const results_js_1 = results; +function compareVersions(currentVersion, publishedVersions, options2) { + const { versions, "dist-tags": tags } = publishedVersions ?? {}; + const { strategy, tag: publishTag } = options2; + const oldVersion = (0, valid_js_1.default)(tags == null ? void 0 : tags[publishTag.value]) ?? void 0; + const isUnique = !(versions == null ? void 0 : versions.includes(currentVersion)); + let type; + if (isUnique) { + if (!oldVersion) { + type = results_js_1.INITIAL; + } else if ((0, gt_js_1.default)(currentVersion, oldVersion)) { + type = (0, diff_js_1.default)(currentVersion, oldVersion) ?? results_js_1.DIFFERENT; + } else if (strategy.value === options_js_1.STRATEGY_ALL) { + type = results_js_1.DIFFERENT; + } + } + return { type, oldVersion }; +} +compareVersions$1.compareVersions = compareVersions; +var getArguments = {}; +Object.defineProperty(getArguments, "__esModule", { value: true }); +getArguments.getPublishArguments = getArguments.getViewArguments = void 0; +function getViewArguments(packageName, options2, retryWithTag = false) { + const packageSpec = retryWithTag ? `${packageName}@${options2.tag.value}` : packageName; + return [packageSpec, "dist-tags", "versions"]; +} +getArguments.getViewArguments = getViewArguments; +function getPublishArguments(packageSpec, options2) { + const { tag, access, dryRun, provenance } = options2; + const publishArguments = []; + if (packageSpec.length > 0) { + publishArguments.push(packageSpec); + } + if (!tag.isDefault) { + publishArguments.push("--tag", tag.value); + } + if (!access.isDefault && access.value) { + publishArguments.push("--access", access.value); + } + if (!provenance.isDefault && provenance.value) { + publishArguments.push("--provenance"); + } + if (!dryRun.isDefault && dryRun.value) { + publishArguments.push("--dry-run"); + } + return publishArguments; +} +getArguments.getPublishArguments = getPublishArguments; +Object.defineProperty(compareAndPublish$1, "__esModule", { value: true }); +compareAndPublish$1.compareAndPublish = void 0; +const index_js_1$1 = npm; +const compare_versions_js_1 = compareVersions$1; +const get_arguments_js_1 = getArguments; +async function compareAndPublish(manifest, options2, environment) { + const { name, version: version2, packageSpec } = manifest; + const cliOptions = { + environment, + ignoreScripts: options2.ignoreScripts.value, + logger: options2.logger + }; + const viewArguments = (0, get_arguments_js_1.getViewArguments)(name, options2); + const publishArguments = (0, get_arguments_js_1.getPublishArguments)(packageSpec, options2); + let viewCall = await (0, index_js_1$1.callNpmCli)(index_js_1$1.VIEW, viewArguments, cliOptions); + if (!viewCall.successData && !viewCall.error) { + const viewWithTagArguments = (0, get_arguments_js_1.getViewArguments)(name, options2, true); + viewCall = await (0, index_js_1$1.callNpmCli)(index_js_1$1.VIEW, viewWithTagArguments, cliOptions); + } + if (viewCall.error && viewCall.errorCode !== index_js_1$1.E404) { + throw viewCall.error; + } + const isDryRun = options2.dryRun.value; + const comparison = (0, compare_versions_js_1.compareVersions)(version2, viewCall.successData, options2); + const publishCall = comparison.type ?? isDryRun ? await (0, index_js_1$1.callNpmCli)(index_js_1$1.PUBLISH, publishArguments, cliOptions) : { successData: void 0, errorCode: void 0, error: void 0 }; + if (publishCall.error && publishCall.errorCode !== index_js_1$1.EPUBLISHCONFLICT) { + throw publishCall.error; + } + const { successData: publishData } = publishCall; + return { + id: isDryRun && !comparison.type ? void 0 : publishData == null ? void 0 : publishData.id, + files: (publishData == null ? void 0 : publishData.files) ?? [], + type: publishData ? comparison.type : void 0, + oldVersion: comparison.oldVersion + }; +} +compareAndPublish$1.compareAndPublish = compareAndPublish; +(function(exports2) { + var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar(compareAndPublish$1, exports2); +})(compareAndPublish$2); +var formatPublishResult$1 = {}; +var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; +}; +Object.defineProperty(formatPublishResult$1, "__esModule", { value: true }); +formatPublishResult$1.formatPublishResult = void 0; +const node_os_1 = __importDefault(require$$0); +const DRY_RUN_BANNER = "=== DRY RUN === DRY RUN === DRY RUN === DRY RUN === DRY RUN ==="; +const CONTENTS_BANNER = "=== Contents ==="; +function formatPublishResult(manifest, options2, result) { + const lines = []; + lines.push(result.id === void 0 ? `🙅‍♀️ ${manifest.name}@${manifest.version} already published.` : `📦 ${result.id}`); + if (result.files.length > 0) { + lines.push("", CONTENTS_BANNER); + } + for (const { path: path2, size } of result.files) { + lines.push(`${formatSize(size)} ${path2}`); + } + return (options2.dryRun.value ? [DRY_RUN_BANNER, "", ...lines, "", DRY_RUN_BANNER] : lines).join(node_os_1.default.EOL); +} +formatPublishResult$1.formatPublishResult = formatPublishResult; +const formatSize = (size) => { + if (size < 1e3) { + return `${size} B`; + } + if (size < 1e6) { + return `${(size / 1e3).toFixed(1)} kB`; + } + return `${(size / 1e6).toFixed(1)} MB`; +}; +Object.defineProperty(npmPublish$1, "__esModule", { value: true }); +npmPublish$1.npmPublish = void 0; +const read_manifest_js_1 = readManifest$1; +const normalize_options_js_1 = normalizeOptions; +const index_js_1 = npm; +const index_js_2 = compareAndPublish$2; +const format_publish_result_js_1 = formatPublishResult$1; +async function npmPublish(options2) { + var _a2, _b; + const manifest = await (0, read_manifest_js_1.readManifest)(options2.package); + const normalizedOptions = (0, normalize_options_js_1.normalizeOptions)(manifest, options2); + const publishResult = await (0, index_js_1.useNpmEnvironment)(manifest, normalizedOptions, index_js_2.compareAndPublish); + (_b = (_a2 = normalizedOptions.logger) == null ? void 0 : _a2.info) == null ? void 0 : _b.call(_a2, (0, format_publish_result_js_1.formatPublishResult)(manifest, normalizedOptions, publishResult)); + return { + id: publishResult.id, + type: publishResult.type, + oldVersion: publishResult.oldVersion, + name: manifest.name, + version: manifest.version, + registry: normalizedOptions.registry, + tag: normalizedOptions.tag.value, + access: normalizedOptions.access.value, + strategy: normalizedOptions.strategy.value, + dryRun: normalizedOptions.dryRun.value + }; +} +npmPublish$1.npmPublish = npmPublish; +(function(exports2) { + var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.npmPublish = void 0; + __exportStar(options, exports2); + __exportStar(results, exports2); + __exportStar(errors$2, exports2); + var npm_publish_js_1 = npmPublish$1; + Object.defineProperty(exports2, "npmPublish", { enumerable: true, get: function() { + return npm_publish_js_1.npmPublish; + } }); +})(lib); var tasks = {}; -var utils$k = {}; +var utils$l = {}; var array$1 = {}; Object.defineProperty(array$1, "__esModule", { value: true }); array$1.splitWhen = array$1.flatten = void 0; @@ -39,9 +26141,9 @@ function isEnoentCodeError(error2) { return error2.code === "ENOENT"; } errno$1.isEnoentCodeError = isEnoentCodeError; -var fs$7 = {}; -Object.defineProperty(fs$7, "__esModule", { value: true }); -fs$7.createDirentFromStats = void 0; +var fs$8 = {}; +Object.defineProperty(fs$8, "__esModule", { value: true }); +fs$8.createDirentFromStats = void 0; let DirentFromStats$1 = class DirentFromStats { constructor(name, stats) { this.name = name; @@ -57,13 +26159,13 @@ let DirentFromStats$1 = class DirentFromStats { function createDirentFromStats$1(name, stats) { return new DirentFromStats$1(name, stats); } -fs$7.createDirentFromStats = createDirentFromStats$1; +fs$8.createDirentFromStats = createDirentFromStats$1; var path$9 = {}; Object.defineProperty(path$9, "__esModule", { value: true }); path$9.convertPosixPathToPattern = path$9.convertWindowsPathToPattern = path$9.convertPathToPattern = path$9.escapePosixPath = path$9.escapeWindowsPath = path$9.escape = path$9.removeLeadingDotSegment = path$9.makeAbsolute = path$9.unixify = void 0; -const os = require$$0; -const path$8 = require$$0$1; -const IS_WINDOWS_PLATFORM = os.platform() === "win32"; +const os$2 = require$$1; +const path$8 = require$$0$9; +const IS_WINDOWS_PLATFORM = os$2.platform() === "win32"; const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g; @@ -241,7 +26343,7 @@ var relaxedCheck = function(str) { } return false; }; -var isGlob$1 = function isGlob(str, options) { +var isGlob$1 = function isGlob(str, options2) { if (typeof str !== "string" || str === "") { return false; } @@ -249,22 +26351,22 @@ var isGlob$1 = function isGlob(str, options) { return true; } var check = strictCheck; - if (options && options.strict === false) { + if (options2 && options2.strict === false) { check = relaxedCheck; } return check(str); }; var isGlob2 = isGlob$1; -var pathPosixDirname = require$$0$1.posix.dirname; -var isWin32 = require$$0.platform() === "win32"; +var pathPosixDirname = require$$0$9.posix.dirname; +var isWin32 = require$$1.platform() === "win32"; var slash = "/"; var backslash = /\\/g; var enclosure = /[\{\[].*[\}\]]$/; var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; var globParent$1 = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + var options2 = Object.assign({ flipBackslashes: true }, opts); + if (options2.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { str = str.replace(backslash, slash); } if (enclosure.test(str)) { @@ -276,7 +26378,7 @@ var globParent$1 = function globParent(str, opts) { } while (isGlob2(str) || globby.test(str)); return str.replace(escaped, "$1"); }; -var utils$j = {}; +var utils$k = {}; (function(exports2) { exports2.isInteger = (num) => { if (typeof num === "number") { @@ -353,15 +26455,15 @@ var utils$j = {}; flat(args); return result; }; -})(utils$j); -const utils$i = utils$j; -var stringify$4 = (ast, options = {}) => { +})(utils$k); +const utils$j = utils$k; +var stringify$5 = (ast, options2 = {}) => { const stringify2 = (node, parent = {}) => { - const invalidBlock = options.escapeInvalid && utils$i.isInvalidBrace(parent); - const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalidBlock = options2.escapeInvalid && utils$j.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options2.escapeInvalid === true; let output = ""; if (node.value) { - if ((invalidBlock || invalidNode) && utils$i.isOpenOrClose(node)) { + if ((invalidBlock || invalidNode) && utils$j.isOpenOrClose(node)) { return "\\" + node.value; } return node.value; @@ -400,7 +26502,7 @@ var isNumber$2 = function(num) { * Released under the MIT License. */ const isNumber$1 = isNumber$2; -const toRegexRange$1 = (min, max, options) => { +const toRegexRange$1 = (min, max, options2) => { if (isNumber$1(min) === false) { throw new TypeError("toRegexRange: expected the first argument to be a number"); } @@ -410,7 +26512,7 @@ const toRegexRange$1 = (min, max, options) => { if (isNumber$1(max) === false) { throw new TypeError("toRegexRange: expected the second argument to be a number."); } - let opts = { relaxZeros: true, ...options }; + let opts = { relaxZeros: true, ...options2 }; if (typeof opts.strictZeros === "boolean") { opts.relaxZeros = opts.strictZeros === false; } @@ -461,10 +26563,10 @@ const toRegexRange$1 = (min, max, options) => { toRegexRange$1.cache[cacheKey] = state; return state.result; }; -function collatePatterns(neg, pos, options) { - let onlyNegative = filterPatterns(neg, pos, "-", false) || []; - let onlyPositive = filterPatterns(pos, neg, "", false) || []; - let intersected = filterPatterns(neg, pos, "-?", true) || []; +function collatePatterns(neg, pos2, options2) { + let onlyNegative = filterPatterns(neg, pos2, "-", false) || []; + let onlyPositive = filterPatterns(pos2, neg, "", false) || []; + let intersected = filterPatterns(neg, pos2, "-?", true) || []; let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); return subpatterns.join("|"); } @@ -488,7 +26590,7 @@ function splitToRanges(min, max) { stops.sort(compare); return stops; } -function rangeToPattern(start, stop, options) { +function rangeToPattern(start, stop, options2) { if (start === stop) { return { pattern: start, count: [], digits: 0 }; } @@ -507,18 +26609,18 @@ function rangeToPattern(start, stop, options) { } } if (count) { - pattern2 += options.shorthand === true ? "\\d" : "[0-9]"; + pattern2 += options2.shorthand === true ? "\\d" : "[0-9]"; } return { pattern: pattern2, count: [count], digits }; } -function splitToPatterns(min, max, tok, options) { +function splitToPatterns(min, max, tok, options2) { let ranges = splitToRanges(min, max); let tokens = []; let start = min; let prev; for (let i = 0; i < ranges.length; i++) { let max2 = ranges[i]; - let obj = rangeToPattern(String(start), String(max2), options); + let obj = rangeToPattern(String(start), String(max2), options2); let zeros2 = ""; if (!tok.isPadded && prev && prev.pattern === obj.pattern) { if (prev.count.length > 1) { @@ -530,7 +26632,7 @@ function splitToPatterns(min, max, tok, options) { continue; } if (tok.isPadded) { - zeros2 = padZeros(max2, tok, options); + zeros2 = padZeros(max2, tok, options2); } obj.string = zeros2 + obj.pattern + toQuantifier(obj.count); tokens.push(obj); @@ -539,7 +26641,7 @@ function splitToPatterns(min, max, tok, options) { } return tokens; } -function filterPatterns(arr, comparison, prefix, intersection, options) { +function filterPatterns(arr, comparison, prefix, intersection, options2) { let result = []; for (let ele of arr) { let { string: string2 } = ele; @@ -576,19 +26678,19 @@ function toQuantifier(digits) { } return ""; } -function toCharacterClass(a, b, options) { +function toCharacterClass(a, b, options2) { return `[${a}${b - a === 1 ? "" : "-"}${b}]`; } function hasPadding(str) { return /^-?(0+)\d/.test(str); } -function padZeros(value, tok, options) { +function padZeros(value, tok, options2) { if (!tok.isPadded) { return value; } - let diff = Math.abs(tok.maxLen - String(value).length); - let relax = options.relaxZeros !== false; - switch (diff) { + let diff2 = Math.abs(tok.maxLen - String(value).length); + let relax = options2.relaxZeros !== false; + switch (diff2) { case 0: return ""; case 1: @@ -596,7 +26698,7 @@ function padZeros(value, tok, options) { case 2: return relax ? "0{0,2}" : "00"; default: { - return relax ? `0{0,${diff}}` : `0{${diff}}`; + return relax ? `0{0,${diff2}}` : `0{${diff2}}`; } } } @@ -609,7 +26711,7 @@ var toRegexRange_1 = toRegexRange$1; * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. */ -const util$1 = require$$0$2; +const util$1 = require$$0$3; const toRegexRange = toRegexRange_1; const isObject$1 = (val) => val !== null && typeof val === "object" && !Array.isArray(val); const transform = (toNumber) => { @@ -627,11 +26729,11 @@ const zeros = (input) => { while (value[++index] === "0") ; return index > 0; }; -const stringify$3 = (start, end, options) => { +const stringify$4 = (start, end, options2) => { if (typeof start === "string" || typeof end === "string") { return true; } - return options.stringify === true; + return options2.stringify === true; }; const pad = (input, maxLength, toNumber) => { if (maxLength > 0) { @@ -653,10 +26755,10 @@ const toMaxLen = (input, maxLength) => { while (input.length < maxLength) input = "0" + input; return negative ? "-" + input : input; }; -const toSequence = (parts, options, maxLen) => { +const toSequence = (parts, options2, maxLen) => { parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - let prefix = options.capture ? "" : "?:"; + let prefix = options2.capture ? "" : "?:"; let positives = ""; let negatives = ""; let result; @@ -671,46 +26773,46 @@ const toSequence = (parts, options, maxLen) => { } else { result = positives || negatives; } - if (options.wrap) { + if (options2.wrap) { return `(${prefix}${result})`; } return result; }; -const toRange = (a, b, isNumbers, options) => { +const toRange = (a, b, isNumbers, options2) => { if (isNumbers) { - return toRegexRange(a, b, { wrap: false, ...options }); + return toRegexRange(a, b, { wrap: false, ...options2 }); } let start = String.fromCharCode(a); if (a === b) return start; let stop = String.fromCharCode(b); return `[${start}-${stop}]`; }; -const toRegex = (start, end, options) => { +const toRegex = (start, end, options2) => { if (Array.isArray(start)) { - let wrap = options.wrap === true; - let prefix = options.capture ? "" : "?:"; + let wrap = options2.wrap === true; + let prefix = options2.capture ? "" : "?:"; return wrap ? `(${prefix}${start.join("|")})` : start.join("|"); } - return toRegexRange(start, end, options); + return toRegexRange(start, end, options2); }; const rangeError = (...args) => { return new RangeError("Invalid range arguments: " + util$1.inspect(...args)); }; -const invalidRange = (start, end, options) => { - if (options.strictRanges === true) throw rangeError([start, end]); +const invalidRange = (start, end, options2) => { + if (options2.strictRanges === true) throw rangeError([start, end]); return []; }; -const invalidStep = (step, options) => { - if (options.strictRanges === true) { +const invalidStep = (step, options2) => { + if (options2.strictRanges === true) { throw new TypeError(`Expected step "${step}" to be a number`); } return []; }; -const fillNumbers = (start, end, step = 1, options = {}) => { +const fillNumbers = (start, end, step = 1, options2 = {}) => { let a = Number(start); let b = Number(end); if (!Number.isInteger(a) || !Number.isInteger(b)) { - if (options.strictRanges === true) throw rangeError([start, end]); + if (options2.strictRanges === true) throw rangeError([start, end]); return []; } if (a === 0) a = 0; @@ -722,41 +26824,41 @@ const fillNumbers = (start, end, step = 1, options = {}) => { step = Math.max(Math.abs(step), 1); let padded = zeros(startString) || zeros(endString) || zeros(stepString); let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify$3(start, end, options) === false; - let format = options.transform || transform(toNumber); - if (options.toRegex && step === 1) { - return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + let toNumber = padded === false && stringify$4(start, end, options2) === false; + let format = options2.transform || transform(toNumber); + if (options2.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options2); } let parts = { negatives: [], positives: [] }; - let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)); + let push2 = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)); let range = []; let index = 0; while (descending ? a >= b : a <= b) { - if (options.toRegex === true && step > 1) { - push(a); + if (options2.toRegex === true && step > 1) { + push2(a); } else { range.push(pad(format(a, index), maxLen, toNumber)); } a = descending ? a - step : a + step; index++; } - if (options.toRegex === true) { - return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: false, ...options }); + if (options2.toRegex === true) { + return step > 1 ? toSequence(parts, options2, maxLen) : toRegex(range, null, { wrap: false, ...options2 }); } return range; }; -const fillLetters = (start, end, step = 1, options = {}) => { +const fillLetters = (start, end, step = 1, options2 = {}) => { if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) { - return invalidRange(start, end, options); + return invalidRange(start, end, options2); } - let format = options.transform || ((val) => String.fromCharCode(val)); + let format = options2.transform || ((val) => String.fromCharCode(val)); let a = `${start}`.charCodeAt(0); let b = `${end}`.charCodeAt(0); let descending = a > b; let min = Math.min(a, b); let max = Math.max(a, b); - if (options.toRegex && step === 1) { - return toRange(min, max, false, options); + if (options2.toRegex && step === 1) { + return toRange(min, max, false, options2); } let range = []; let index = 0; @@ -765,17 +26867,17 @@ const fillLetters = (start, end, step = 1, options = {}) => { a = descending ? a - step : a + step; index++; } - if (options.toRegex === true) { - return toRegex(range, null, { wrap: false, options }); + if (options2.toRegex === true) { + return toRegex(range, null, { wrap: false, options: options2 }); } return range; }; -const fill$2 = (start, end, step, options = {}) => { +const fill$2 = (start, end, step, options2 = {}) => { if (end == null && isValidValue(start)) { return [start]; } if (!isValidValue(start) || !isValidValue(end)) { - return invalidRange(start, end, options); + return invalidRange(start, end, options2); } if (typeof step === "function") { return fill$2(start, end, 1, { transform: step }); @@ -783,7 +26885,7 @@ const fill$2 = (start, end, step, options = {}) => { if (isObject$1(step)) { return fill$2(start, end, 0, step); } - let opts = { ...options }; + let opts = { ...options2 }; if (opts.capture === true) opts.wrap = true; step = step || opts.step || 1; if (!isNumber(step)) { @@ -797,13 +26899,13 @@ const fill$2 = (start, end, step, options = {}) => { }; var fillRange = fill$2; const fill$1 = fillRange; -const utils$h = utils$j; -const compile$1 = (ast, options = {}) => { +const utils$i = utils$k; +const compile$1 = (ast, options2 = {}) => { const walk2 = (node, parent = {}) => { - const invalidBlock = utils$h.isInvalidBrace(parent); - const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalidBlock = utils$i.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options2.escapeInvalid === true; const invalid = invalidBlock === true || invalidNode === true; - const prefix = options.escapeInvalid === true ? "\\" : ""; + const prefix = options2.escapeInvalid === true ? "\\" : ""; let output = ""; if (node.isOpen === true) { return prefix + node.value; @@ -825,8 +26927,8 @@ const compile$1 = (ast, options = {}) => { return node.value; } if (node.nodes && node.ranges > 0) { - const args = utils$h.reduce(node.nodes); - const range = fill$1(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); + const args = utils$i.reduce(node.nodes); + const range = fill$1(...args, { ...options2, wrap: false, toRegex: true, strictZeros: true }); if (range.length !== 0) { return args.length > 1 && range.length > 1 ? `(${range})` : range; } @@ -842,15 +26944,15 @@ const compile$1 = (ast, options = {}) => { }; var compile_1 = compile$1; const fill = fillRange; -const stringify$2 = stringify$4; -const utils$g = utils$j; +const stringify$3 = stringify$5; +const utils$h = utils$k; const append = (queue2 = "", stash = "", enclose = false) => { const result = []; queue2 = [].concat(queue2); stash = [].concat(stash); if (!stash.length) return queue2; if (!queue2.length) { - return enclose ? utils$g.flatten(stash).map((ele) => `{${ele}}`) : stash; + return enclose ? utils$h.flatten(stash).map((ele) => `{${ele}}`) : stash; } for (const item of queue2) { if (Array.isArray(item)) { @@ -864,10 +26966,10 @@ const append = (queue2 = "", stash = "", enclose = false) => { } } } - return utils$g.flatten(result); + return utils$h.flatten(result); }; -const expand$1 = (ast, options = {}) => { - const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit; +const expand$1 = (ast, options2 = {}) => { + const rangeLimit = options2.rangeLimit === void 0 ? 1e3 : options2.rangeLimit; const walk2 = (node, parent = {}) => { node.queue = []; let p = parent; @@ -877,7 +26979,7 @@ const expand$1 = (ast, options = {}) => { q = p.queue; } if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify$2(node, options))); + q.push(append(q.pop(), stringify$3(node, options2))); return; } if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) { @@ -885,19 +26987,19 @@ const expand$1 = (ast, options = {}) => { return; } if (node.nodes && node.ranges > 0) { - const args = utils$g.reduce(node.nodes); - if (utils$g.exceedsLimit(...args, options.step, rangeLimit)) { + const args = utils$h.reduce(node.nodes); + if (utils$h.exceedsLimit(...args, options2.step, rangeLimit)) { throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit."); } - let range = fill(...args, options); + let range = fill(...args, options2); if (range.length === 0) { - range = stringify$2(node, options); + range = stringify$3(node, options2); } q.push(append(q.pop(), range)); node.nodes = []; return; } - const enclose = utils$g.encloseBrace(node); + const enclose = utils$h.encloseBrace(node); let queue2 = node.queue; let block = node; while (block.type !== "brace" && block.type !== "root" && block.parent) { @@ -925,7 +27027,7 @@ const expand$1 = (ast, options = {}) => { } return queue2; }; - return utils$g.flatten(walk2(ast)); + return utils$h.flatten(walk2(ast)); }; var expand_1 = expand$1; var constants$4 = { @@ -1022,7 +27124,7 @@ var constants$4 = { CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF" /* \uFEFF */ }; -const stringify$1 = stringify$4; +const stringify$2 = stringify$5; const { MAX_LENGTH: MAX_LENGTH$1, CHAR_BACKSLASH, @@ -1052,11 +27154,11 @@ const { CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = constants$4; -const parse$3 = (input, options = {}) => { +const parse$4 = (input, options2 = {}) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } - const opts = options || {}; + const opts = options2 || {}; const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1; if (input.length > max) { throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); @@ -1071,7 +27173,7 @@ const parse$3 = (input, options = {}) => { let depth2 = 0; let value; const advance = () => input[index++]; - const push = (node) => { + const push2 = (node) => { if (node.type === "text" && prev.type === "dot") { prev.type = "text"; } @@ -1085,7 +27187,7 @@ const parse$3 = (input, options = {}) => { prev = node; return node; }; - push({ type: "bos" }); + push2({ type: "bos" }); while (index < length) { block = stack[stack.length - 1]; value = advance(); @@ -1093,11 +27195,11 @@ const parse$3 = (input, options = {}) => { continue; } if (value === CHAR_BACKSLASH) { - push({ type: "text", value: (options.keepEscaping ? value : "") + advance() }); + push2({ type: "text", value: (options2.keepEscaping ? value : "") + advance() }); continue; } if (value === CHAR_RIGHT_SQUARE_BRACKET$1) { - push({ type: "text", value: "\\" + value }); + push2({ type: "text", value: "\\" + value }); continue; } if (value === CHAR_LEFT_SQUARE_BRACKET$1) { @@ -1120,29 +27222,29 @@ const parse$3 = (input, options = {}) => { } } } - push({ type: "text", value }); + push2({ type: "text", value }); continue; } if (value === CHAR_LEFT_PARENTHESES$1) { - block = push({ type: "paren", nodes: [] }); + block = push2({ type: "paren", nodes: [] }); stack.push(block); - push({ type: "text", value }); + push2({ type: "text", value }); continue; } if (value === CHAR_RIGHT_PARENTHESES$1) { if (block.type !== "paren") { - push({ type: "text", value }); + push2({ type: "text", value }); continue; } block = stack.pop(); - push({ type: "text", value }); + push2({ type: "text", value }); block = stack[stack.length - 1]; continue; } if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { const open = value; let next; - if (options.keepQuotes !== true) { + if (options2.keepQuotes !== true) { value = ""; } while (index < length && (next = advance())) { @@ -1151,12 +27253,12 @@ const parse$3 = (input, options = {}) => { continue; } if (next === open) { - if (options.keepQuotes === true) value += next; + if (options2.keepQuotes === true) value += next; break; } value += next; } - push({ type: "text", value }); + push2({ type: "text", value }); continue; } if (value === CHAR_LEFT_CURLY_BRACE$1) { @@ -1172,20 +27274,20 @@ const parse$3 = (input, options = {}) => { ranges: 0, nodes: [] }; - block = push(brace); + block = push2(brace); stack.push(block); - push({ type: "open", value }); + push2({ type: "open", value }); continue; } if (value === CHAR_RIGHT_CURLY_BRACE$1) { if (block.type !== "brace") { - push({ type: "text", value }); + push2({ type: "text", value }); continue; } const type = "close"; block = stack.pop(); block.close = true; - push({ type, value }); + push2({ type, value }); depth2--; block = stack[stack.length - 1]; continue; @@ -1194,16 +27296,16 @@ const parse$3 = (input, options = {}) => { if (block.ranges > 0) { block.ranges = 0; const open = block.nodes.shift(); - block.nodes = [open, { type: "text", value: stringify$1(block) }]; + block.nodes = [open, { type: "text", value: stringify$2(block) }]; } - push({ type: "comma", value }); + push2({ type: "comma", value }); block.commas++; continue; } if (value === CHAR_DOT$1 && depth2 > 0 && block.commas === 0) { const siblings = block.nodes; if (depth2 === 0 || siblings.length === 0) { - push({ type: "text", value }); + push2({ type: "text", value }); continue; } if (prev.type === "dot") { @@ -1228,10 +27330,10 @@ const parse$3 = (input, options = {}) => { block.ranges--; continue; } - push({ type: "dot", value }); + push2({ type: "dot", value }); continue; } - push({ type: "text", value }); + push2({ type: "text", value }); } do { block = stack.pop(); @@ -1249,19 +27351,19 @@ const parse$3 = (input, options = {}) => { parent.nodes.splice(index2, 1, ...block.nodes); } } while (stack.length > 0); - push({ type: "eos" }); + push2({ type: "eos" }); return ast; }; -var parse_1$1 = parse$3; -const stringify = stringify$4; +var parse_1$1 = parse$4; +const stringify$1 = stringify$5; const compile = compile_1; const expand = expand_1; -const parse$2 = parse_1$1; -const braces$1 = (input, options = {}) => { +const parse$3 = parse_1$1; +const braces$1 = (input, options2 = {}) => { let output = []; if (Array.isArray(input)) { for (const pattern2 of input) { - const result = braces$1.create(pattern2, options); + const result = braces$1.create(pattern2, options2); if (Array.isArray(result)) { output.push(...result); } else { @@ -1269,48 +27371,48 @@ const braces$1 = (input, options = {}) => { } } } else { - output = [].concat(braces$1.create(input, options)); + output = [].concat(braces$1.create(input, options2)); } - if (options && options.expand === true && options.nodupes === true) { + if (options2 && options2.expand === true && options2.nodupes === true) { output = [...new Set(output)]; } return output; }; -braces$1.parse = (input, options = {}) => parse$2(input, options); -braces$1.stringify = (input, options = {}) => { +braces$1.parse = (input, options2 = {}) => parse$3(input, options2); +braces$1.stringify = (input, options2 = {}) => { if (typeof input === "string") { - return stringify(braces$1.parse(input, options), options); + return stringify$1(braces$1.parse(input, options2), options2); } - return stringify(input, options); + return stringify$1(input, options2); }; -braces$1.compile = (input, options = {}) => { +braces$1.compile = (input, options2 = {}) => { if (typeof input === "string") { - input = braces$1.parse(input, options); + input = braces$1.parse(input, options2); } - return compile(input, options); + return compile(input, options2); }; -braces$1.expand = (input, options = {}) => { +braces$1.expand = (input, options2 = {}) => { if (typeof input === "string") { - input = braces$1.parse(input, options); + input = braces$1.parse(input, options2); } - let result = expand(input, options); - if (options.noempty === true) { + let result = expand(input, options2); + if (options2.noempty === true) { result = result.filter(Boolean); } - if (options.nodupes === true) { + if (options2.nodupes === true) { result = [...new Set(result)]; } return result; }; -braces$1.create = (input, options = {}) => { +braces$1.create = (input, options2 = {}) => { if (input === "" || input.length < 3) { return [input]; } - return options.expand !== true ? braces$1.compile(input, options) : braces$1.expand(input, options); + return options2.expand !== true ? braces$1.compile(input, options2) : braces$1.expand(input, options2); }; var braces_1 = braces$1; -var utils$f = {}; -const path$7 = require$$0$1; +var utils$g = {}; +const path$7 = require$$0$9; const WIN_SLASH = "\\\\/"; const WIN_NO_SLASH = `[^${WIN_SLASH}]`; const DOT_LITERAL = "\\."; @@ -1501,7 +27603,7 @@ var constants$3 = { } }; (function(exports2) { - const path2 = require$$0$1; + const path2 = require$$0$9; const win32 = process.platform === "win32"; const { REGEX_BACKSLASH, @@ -1526,9 +27628,9 @@ var constants$3 = { } return false; }; - exports2.isWindows = (options) => { - if (options && typeof options.windows === "boolean") { - return options.windows; + exports2.isWindows = (options2) => { + if (options2 && typeof options2.windows === "boolean") { + return options2.windows; } return win32 === true || path2.sep === "\\"; }; @@ -1546,17 +27648,17 @@ var constants$3 = { } return output; }; - exports2.wrapOutput = (input, state = {}, options = {}) => { - const prepend = options.contains ? "" : "^"; - const append2 = options.contains ? "" : "$"; + exports2.wrapOutput = (input, state = {}, options2 = {}) => { + const prepend = options2.contains ? "" : "^"; + const append2 = options2.contains ? "" : "$"; let output = `${prepend}(?:${input})${append2}`; if (state.negated === true) { output = `(?:^(?!${output}).*$)`; } return output; }; -})(utils$f); -const utils$e = utils$f; +})(utils$g); +const utils$f = utils$g; const { CHAR_ASTERISK, /* * */ @@ -1597,8 +27699,8 @@ const depth = (token) => { token.depth = token.isGlobstar ? Infinity : 1; } }; -const scan$1 = (input, options) => { - const opts = options || {}; +const scan$1 = (input, options2) => { + const opts = options2 || {}; const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; const slashes = []; @@ -1617,7 +27719,7 @@ const scan$1 = (input, options) => { let backslashes = false; let negated = false; let negatedExtglob = false; - let finished = false; + let finished2 = false; let braces2 = 0; let prev; let code; @@ -1654,7 +27756,7 @@ const scan$1 = (input, options) => { if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { isBrace = token.isBrace = true; isGlob3 = token.isGlob = true; - finished = true; + finished2 = true; if (scanToEnd === true) { continue; } @@ -1663,7 +27765,7 @@ const scan$1 = (input, options) => { if (braceEscaped !== true && code === CHAR_COMMA) { isBrace = token.isBrace = true; isGlob3 = token.isGlob = true; - finished = true; + finished2 = true; if (scanToEnd === true) { continue; } @@ -1674,7 +27776,7 @@ const scan$1 = (input, options) => { if (braces2 === 0) { braceEscaped = false; isBrace = token.isBrace = true; - finished = true; + finished2 = true; break; } } @@ -1688,7 +27790,7 @@ const scan$1 = (input, options) => { slashes.push(index); tokens.push(token); token = { value: "", depth: 0, isGlob: false }; - if (finished === true) continue; + if (finished2 === true) continue; if (prev === CHAR_DOT && index === start + 1) { start += 2; continue; @@ -1701,7 +27803,7 @@ const scan$1 = (input, options) => { if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { isGlob3 = token.isGlob = true; isExtglob3 = token.isExtglob = true; - finished = true; + finished2 = true; if (code === CHAR_EXCLAMATION_MARK && index === start) { negatedExtglob = true; } @@ -1714,7 +27816,7 @@ const scan$1 = (input, options) => { } if (code === CHAR_RIGHT_PARENTHESES) { isGlob3 = token.isGlob = true; - finished = true; + finished2 = true; break; } } @@ -1726,7 +27828,7 @@ const scan$1 = (input, options) => { if (code === CHAR_ASTERISK) { if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; isGlob3 = token.isGlob = true; - finished = true; + finished2 = true; if (scanToEnd === true) { continue; } @@ -1734,7 +27836,7 @@ const scan$1 = (input, options) => { } if (code === CHAR_QUESTION_MARK) { isGlob3 = token.isGlob = true; - finished = true; + finished2 = true; if (scanToEnd === true) { continue; } @@ -1750,7 +27852,7 @@ const scan$1 = (input, options) => { if (next === CHAR_RIGHT_SQUARE_BRACKET) { isBracket = token.isBracket = true; isGlob3 = token.isGlob = true; - finished = true; + finished2 = true; break; } } @@ -1774,7 +27876,7 @@ const scan$1 = (input, options) => { continue; } if (code === CHAR_RIGHT_PARENTHESES) { - finished = true; + finished2 = true; break; } } @@ -1783,7 +27885,7 @@ const scan$1 = (input, options) => { break; } if (isGlob3 === true) { - finished = true; + finished2 = true; if (scanToEnd === true) { continue; } @@ -1817,9 +27919,9 @@ const scan$1 = (input, options) => { } } if (opts.unescape === true) { - if (glob2) glob2 = utils$e.removeBackslashes(glob2); + if (glob2) glob2 = utils$f.removeBackslashes(glob2); if (base && backslashes === true) { - base = utils$e.removeBackslashes(base); + base = utils$f.removeBackslashes(base); } } const state = { @@ -1880,7 +27982,7 @@ const scan$1 = (input, options) => { }; var scan_1 = scan$1; const constants$2 = constants$3; -const utils$d = utils$f; +const utils$e = utils$g; const { MAX_LENGTH, POSIX_REGEX_SOURCE, @@ -1888,28 +27990,28 @@ const { REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants$2; -const expandRange = (args, options) => { - if (typeof options.expandRange === "function") { - return options.expandRange(...args, options); +const expandRange = (args, options2) => { + if (typeof options2.expandRange === "function") { + return options2.expandRange(...args, options2); } args.sort(); const value = `[${args.join("-")}]`; try { new RegExp(value); } catch (ex) { - return args.map((v) => utils$d.escapeRegex(v)).join(".."); + return args.map((v) => utils$e.escapeRegex(v)).join(".."); } return value; }; const syntaxError = (type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }; -const parse$1 = (input, options) => { +const parse$2 = (input, options2) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } input = REPLACEMENTS[input] || input; - const opts = { ...options }; + const opts = { ...options2 }; const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; let len = input.length; if (len > max) { @@ -1918,7 +28020,7 @@ const parse$1 = (input, options) => { const bos = { type: "bos", value: "", output: opts.prepend || "" }; const tokens = [bos]; const capture = opts.capture ? "" : "?:"; - const win32 = utils$d.isWindows(options); + const win32 = utils$e.isWindows(options2); const PLATFORM_CHARS = constants$2.globChars(win32); const EXTGLOB_CHARS = constants$2.extglobChars(PLATFORM_CHARS); const { @@ -1964,7 +28066,7 @@ const parse$1 = (input, options) => { globstar: false, tokens }; - input = utils$d.removePrefix(input, state); + input = utils$e.removePrefix(input, state); len = input.length; const extglobs = []; const braces2 = []; @@ -1975,13 +28077,13 @@ const parse$1 = (input, options) => { const peek = state.peek = (n = 1) => input[state.index + n]; const advance = state.advance = () => input[++state.index] || ""; const remaining = () => input.slice(state.index + 1); - const consume = (value2 = "", num = 0) => { + const consume2 = (value2 = "", num = 0) => { state.consumed += value2; state.index += num; }; const append2 = (token) => { state.output += token.output != null ? token.output : token.value; - consume(token.value); + consume2(token.value); }; const negate = () => { let count = 1; @@ -2005,7 +28107,7 @@ const parse$1 = (input, options) => { state[type]--; stack.pop(); }; - const push = (tok) => { + const push2 = (tok) => { if (prev.type === "globstar") { const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"); const isExtglob3 = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren"); @@ -2037,8 +28139,8 @@ const parse$1 = (input, options) => { token.output = state.output; const output = (opts.capture ? "(" : "") + token.open; increment("parens"); - push({ type, value: value2, output: state.output ? "" : ONE_CHAR2 }); - push({ type: "paren", extglob: true, value: advance(), output }); + push2({ type, value: value2, output: state.output ? "" : ONE_CHAR2 }); + push2({ type: "paren", extglob: true, value: advance(), output }); extglobs.push(token); }; const extglobClose = (token) => { @@ -2053,14 +28155,14 @@ const parse$1 = (input, options) => { output = token.close = `)$))${extglobStar}`; } if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { - const expression = parse$1(rest, { ...options, fastpaths: false }).output; + const expression = parse$2(rest, { ...options2, fastpaths: false }).output; output = token.close = `)${expression})${extglobStar})`; } if (token.prev.type === "bos") { state.negatedExtglob = true; } } - push({ type: "paren", extglob: true, value, output }); + push2({ type: "paren", extglob: true, value, output }); decrement("parens"); }; if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { @@ -2103,7 +28205,7 @@ const parse$1 = (input, options) => { state.output = input; return state; } - state.output = utils$d.wrapOutput(output, state, options); + state.output = utils$e.wrapOutput(output, state, options2); return state; } while (!eos()) { @@ -2121,7 +28223,7 @@ const parse$1 = (input, options) => { } if (!next) { value += "\\"; - push({ type: "text", value }); + push2({ type: "text", value }); continue; } const match = /^\\+/.exec(remaining()); @@ -2139,7 +28241,7 @@ const parse$1 = (input, options) => { value += advance(); } if (state.brackets === 0) { - push({ type: "text", value }); + push2({ type: "text", value }); continue; } } @@ -2179,7 +28281,7 @@ const parse$1 = (input, options) => { continue; } if (state.quotes === 1 && value !== '"') { - value = utils$d.escapeRegex(value); + value = utils$e.escapeRegex(value); prev.value += value; append2({ value }); continue; @@ -2187,13 +28289,13 @@ const parse$1 = (input, options) => { if (value === '"') { state.quotes = state.quotes === 1 ? 0 : 1; if (opts.keepQuotes === true) { - push({ type: "text", value }); + push2({ type: "text", value }); } continue; } if (value === "(") { increment("parens"); - push({ type: "paren", value }); + push2({ type: "paren", value }); continue; } if (value === ")") { @@ -2205,7 +28307,7 @@ const parse$1 = (input, options) => { extglobClose(extglobs.pop()); continue; } - push({ type: "paren", value, output: state.parens ? ")" : "\\)" }); + push2({ type: "paren", value, output: state.parens ? ")" : "\\)" }); decrement("parens"); continue; } @@ -2218,19 +28320,19 @@ const parse$1 = (input, options) => { } else { increment("brackets"); } - push({ type: "bracket", value }); + push2({ type: "bracket", value }); continue; } if (value === "]") { if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) { - push({ type: "text", value, output: `\\${value}` }); + push2({ type: "text", value, output: `\\${value}` }); continue; } if (state.brackets === 0) { if (opts.strictBrackets === true) { throw new SyntaxError(syntaxError("opening", "[")); } - push({ type: "text", value, output: `\\${value}` }); + push2({ type: "text", value, output: `\\${value}` }); continue; } decrement("brackets"); @@ -2240,10 +28342,10 @@ const parse$1 = (input, options) => { } prev.value += value; append2({ value }); - if (opts.literalBrackets === false || utils$d.hasRegexChars(prevValue)) { + if (opts.literalBrackets === false || utils$e.hasRegexChars(prevValue)) { continue; } - const escaped2 = utils$d.escapeRegex(prev.value); + const escaped2 = utils$e.escapeRegex(prev.value); state.output = state.output.slice(0, -prev.value.length); if (opts.literalBrackets === true) { state.output += escaped2; @@ -2264,13 +28366,13 @@ const parse$1 = (input, options) => { tokensIndex: state.tokens.length }; braces2.push(open); - push(open); + push2(open); continue; } if (value === "}") { const brace = braces2[braces2.length - 1]; if (opts.nobrace === true || !brace) { - push({ type: "text", value, output: value }); + push2({ type: "text", value, output: value }); continue; } let output = ")"; @@ -2295,11 +28397,11 @@ const parse$1 = (input, options) => { brace.value = brace.output = "\\{"; value = output = "\\}"; state.output = out2; - for (const t of toks) { - state.output += t.output || t.value; + for (const t2 of toks) { + state.output += t2.output || t2.value; } } - push({ type: "brace", value, output }); + push2({ type: "brace", value, output }); decrement("braces"); braces2.pop(); continue; @@ -2308,7 +28410,7 @@ const parse$1 = (input, options) => { if (extglobs.length > 0) { extglobs[extglobs.length - 1].conditions++; } - push({ type: "text", value }); + push2({ type: "text", value }); continue; } if (value === ",") { @@ -2318,7 +28420,7 @@ const parse$1 = (input, options) => { brace.comma = true; output = "|"; } - push({ type: "comma", value, output }); + push2({ type: "comma", value, output }); continue; } if (value === "/") { @@ -2330,7 +28432,7 @@ const parse$1 = (input, options) => { prev = bos; continue; } - push({ type: "slash", value, output: SLASH_LITERAL2 }); + push2({ type: "slash", value, output: SLASH_LITERAL2 }); continue; } if (value === ".") { @@ -2344,10 +28446,10 @@ const parse$1 = (input, options) => { continue; } if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") { - push({ type: "text", value, output: DOT_LITERAL2 }); + push2({ type: "text", value, output: DOT_LITERAL2 }); continue; } - push({ type: "dot", value, output: DOT_LITERAL2 }); + push2({ type: "dot", value, output: DOT_LITERAL2 }); continue; } if (value === "?") { @@ -2359,20 +28461,20 @@ const parse$1 = (input, options) => { if (prev && prev.type === "paren") { const next = peek(); let output = value; - if (next === "<" && !utils$d.supportsLookbehinds()) { + if (next === "<" && !utils$e.supportsLookbehinds()) { throw new Error("Node.js v10 or higher is required for regex lookbehinds"); } if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) { output = `\\${value}`; } - push({ type: "text", value, output }); + push2({ type: "text", value, output }); continue; } if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) { - push({ type: "qmark", value, output: QMARK_NO_DOT2 }); + push2({ type: "qmark", value, output: QMARK_NO_DOT2 }); continue; } - push({ type: "qmark", value, output: QMARK2 }); + push2({ type: "qmark", value, output: QMARK2 }); continue; } if (value === "!") { @@ -2393,22 +28495,22 @@ const parse$1 = (input, options) => { continue; } if (prev && prev.value === "(" || opts.regex === false) { - push({ type: "plus", value, output: PLUS_LITERAL2 }); + push2({ type: "plus", value, output: PLUS_LITERAL2 }); continue; } if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) { - push({ type: "plus", value }); + push2({ type: "plus", value }); continue; } - push({ type: "plus", value: PLUS_LITERAL2 }); + push2({ type: "plus", value: PLUS_LITERAL2 }); continue; } if (value === "@") { if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") { - push({ type: "at", extglob: true, value, output: "" }); + push2({ type: "at", extglob: true, value, output: "" }); continue; } - push({ type: "text", value }); + push2({ type: "text", value }); continue; } if (value !== "*") { @@ -2420,7 +28522,7 @@ const parse$1 = (input, options) => { value += match[0]; state.index += match[0].length; } - push({ type: "text", value }); + push2({ type: "text", value }); continue; } if (prev && (prev.type === "globstar" || prev.star === true)) { @@ -2430,7 +28532,7 @@ const parse$1 = (input, options) => { prev.output = star; state.backtrack = true; state.globstar = true; - consume(value); + consume2(value); continue; } let rest = remaining(); @@ -2440,7 +28542,7 @@ const parse$1 = (input, options) => { } if (prev.type === "star") { if (opts.noglobstar === true) { - consume(value); + consume2(value); continue; } const prior = prev.prev; @@ -2448,13 +28550,13 @@ const parse$1 = (input, options) => { const isStart = prior.type === "slash" || prior.type === "bos"; const afterStar = before && (before.type === "star" || before.type === "globstar"); if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) { - push({ type: "star", value, output: "" }); + push2({ type: "star", value, output: "" }); continue; } const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"); const isExtglob3 = extglobs.length && (prior.type === "pipe" || prior.type === "paren"); if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob3) { - push({ type: "star", value, output: "" }); + push2({ type: "star", value, output: "" }); continue; } while (rest.slice(0, 3) === "/**") { @@ -2463,7 +28565,7 @@ const parse$1 = (input, options) => { break; } rest = rest.slice(3); - consume("/**", 3); + consume2("/**", 3); } if (prior.type === "bos" && eos()) { prev.type = "globstar"; @@ -2471,7 +28573,7 @@ const parse$1 = (input, options) => { prev.output = globstar(opts); state.output = prev.output; state.globstar = true; - consume(value); + consume2(value); continue; } if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) { @@ -2482,7 +28584,7 @@ const parse$1 = (input, options) => { prev.value += value; state.globstar = true; state.output += prior.output + prev.output; - consume(value); + consume2(value); continue; } if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") { @@ -2494,8 +28596,8 @@ const parse$1 = (input, options) => { prev.value += value; state.output += prior.output + prev.output; state.globstar = true; - consume(value + advance()); - push({ type: "slash", value: "/", output: "" }); + consume2(value + advance()); + push2({ type: "slash", value: "/", output: "" }); continue; } if (prior.type === "bos" && rest[0] === "/") { @@ -2504,8 +28606,8 @@ const parse$1 = (input, options) => { prev.output = `(?:^|${SLASH_LITERAL2}|${globstar(opts)}${SLASH_LITERAL2})`; state.output = prev.output; state.globstar = true; - consume(value + advance()); - push({ type: "slash", value: "/", output: "" }); + consume2(value + advance()); + push2({ type: "slash", value: "/", output: "" }); continue; } state.output = state.output.slice(0, -prev.output.length); @@ -2514,7 +28616,7 @@ const parse$1 = (input, options) => { prev.value += value; state.output += prev.output; state.globstar = true; - consume(value); + consume2(value); continue; } const token = { type: "star", value, output: star }; @@ -2523,12 +28625,12 @@ const parse$1 = (input, options) => { if (prev.type === "bos" || prev.type === "slash") { token.output = nodot + token.output; } - push(token); + push2(token); continue; } if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) { token.output = value; - push(token); + push2(token); continue; } if (state.index === state.start || prev.type === "slash" || prev.type === "dot") { @@ -2547,25 +28649,25 @@ const parse$1 = (input, options) => { prev.output += ONE_CHAR2; } } - push(token); + push2(token); } while (state.brackets > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]")); - state.output = utils$d.escapeLast(state.output, "["); + state.output = utils$e.escapeLast(state.output, "["); decrement("brackets"); } while (state.parens > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")")); - state.output = utils$d.escapeLast(state.output, "("); + state.output = utils$e.escapeLast(state.output, "("); decrement("parens"); } while (state.braces > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}")); - state.output = utils$d.escapeLast(state.output, "{"); + state.output = utils$e.escapeLast(state.output, "{"); decrement("braces"); } if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) { - push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL2}?` }); + push2({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL2}?` }); } if (state.backtrack === true) { state.output = ""; @@ -2578,15 +28680,15 @@ const parse$1 = (input, options) => { } return state; }; -parse$1.fastpaths = (input, options) => { - const opts = { ...options }; +parse$2.fastpaths = (input, options2) => { + const opts = { ...options2 }; const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } input = REPLACEMENTS[input] || input; - const win32 = utils$d.isWindows(options); + const win32 = utils$e.isWindows(options2); const { DOT_LITERAL: DOT_LITERAL2, SLASH_LITERAL: SLASH_LITERAL2, @@ -2637,23 +28739,23 @@ parse$1.fastpaths = (input, options) => { } } }; - const output = utils$d.removePrefix(input, state); + const output = utils$e.removePrefix(input, state); let source = create(output); if (source && opts.strictSlashes !== true) { source += `${SLASH_LITERAL2}?`; } return source; }; -var parse_1 = parse$1; -const path$6 = require$$0$1; +var parse_1 = parse$2; +const path$6 = require$$0$9; const scan = scan_1; -const parse = parse_1; -const utils$c = utils$f; +const parse$1 = parse_1; +const utils$d = utils$g; const constants$1 = constants$3; const isObject = (val) => val && typeof val === "object" && !Array.isArray(val); -const picomatch$2 = (glob2, options, returnState = false) => { +const picomatch$2 = (glob2, options2, returnState = false) => { if (Array.isArray(glob2)) { - const fns = glob2.map((input) => picomatch$2(input, options, returnState)); + const fns = glob2.map((input) => picomatch$2(input, options2, returnState)); const arrayMatcher = (str) => { for (const isMatch of fns) { const state2 = isMatch(str); @@ -2667,18 +28769,18 @@ const picomatch$2 = (glob2, options, returnState = false) => { if (glob2 === "" || typeof glob2 !== "string" && !isState) { throw new TypeError("Expected pattern to be a non-empty string"); } - const opts = options || {}; - const posix = utils$c.isWindows(options); - const regex = isState ? picomatch$2.compileRe(glob2, options) : picomatch$2.makeRe(glob2, options, false, true); + const opts = options2 || {}; + const posix = utils$d.isWindows(options2); + const regex = isState ? picomatch$2.compileRe(glob2, options2) : picomatch$2.makeRe(glob2, options2, false, true); const state = regex.state; delete regex.state; let isIgnored = () => false; if (opts.ignore) { - const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + const ignoreOpts = { ...options2, ignore: null, onMatch: null, onResult: null }; isIgnored = picomatch$2(opts.ignore, ignoreOpts, returnState); } const matcher2 = (input, returnObject = false) => { - const { isMatch, match, output } = picomatch$2.test(input, regex, options, { glob: glob2, posix }); + const { isMatch, match, output } = picomatch$2.test(input, regex, options2, { glob: glob2, posix }); const result = { glob: glob2, state, regex, posix, input, output, match, isMatch }; if (typeof opts.onResult === "function") { opts.onResult(result); @@ -2704,15 +28806,15 @@ const picomatch$2 = (glob2, options, returnState = false) => { } return matcher2; }; -picomatch$2.test = (input, regex, options, { glob: glob2, posix } = {}) => { +picomatch$2.test = (input, regex, options2, { glob: glob2, posix } = {}) => { if (typeof input !== "string") { throw new TypeError("Expected input to be a string"); } if (input === "") { return { isMatch: false, output: "" }; } - const opts = options || {}; - const format = opts.format || (posix ? utils$c.toPosixSlashes : null); + const opts = options2 || {}; + const format = opts.format || (posix ? utils$d.toPosixSlashes : null); let match = input === glob2; let output = match && format ? format(input) : input; if (match === false) { @@ -2721,124 +28823,124 @@ picomatch$2.test = (input, regex, options, { glob: glob2, posix } = {}) => { } if (match === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { - match = picomatch$2.matchBase(input, regex, options, posix); + match = picomatch$2.matchBase(input, regex, options2, posix); } else { match = regex.exec(output); } } return { isMatch: Boolean(match), match, output }; }; -picomatch$2.matchBase = (input, glob2, options, posix = utils$c.isWindows(options)) => { - const regex = glob2 instanceof RegExp ? glob2 : picomatch$2.makeRe(glob2, options); +picomatch$2.matchBase = (input, glob2, options2, posix = utils$d.isWindows(options2)) => { + const regex = glob2 instanceof RegExp ? glob2 : picomatch$2.makeRe(glob2, options2); return regex.test(path$6.basename(input)); }; -picomatch$2.isMatch = (str, patterns, options) => picomatch$2(patterns, options)(str); -picomatch$2.parse = (pattern2, options) => { - if (Array.isArray(pattern2)) return pattern2.map((p) => picomatch$2.parse(p, options)); - return parse(pattern2, { ...options, fastpaths: false }); +picomatch$2.isMatch = (str, patterns, options2) => picomatch$2(patterns, options2)(str); +picomatch$2.parse = (pattern2, options2) => { + if (Array.isArray(pattern2)) return pattern2.map((p) => picomatch$2.parse(p, options2)); + return parse$1(pattern2, { ...options2, fastpaths: false }); }; -picomatch$2.scan = (input, options) => scan(input, options); -picomatch$2.compileRe = (state, options, returnOutput = false, returnState = false) => { +picomatch$2.scan = (input, options2) => scan(input, options2); +picomatch$2.compileRe = (state, options2, returnOutput = false, returnState = false) => { if (returnOutput === true) { return state.output; } - const opts = options || {}; + const opts = options2 || {}; const prepend = opts.contains ? "" : "^"; const append2 = opts.contains ? "" : "$"; let source = `${prepend}(?:${state.output})${append2}`; if (state && state.negated === true) { source = `^(?!${source}).*$`; } - const regex = picomatch$2.toRegex(source, options); + const regex = picomatch$2.toRegex(source, options2); if (returnState === true) { regex.state = state; } return regex; }; -picomatch$2.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { +picomatch$2.makeRe = (input, options2 = {}, returnOutput = false, returnState = false) => { if (!input || typeof input !== "string") { throw new TypeError("Expected a non-empty string"); } let parsed = { negated: false, fastpaths: true }; - if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) { - parsed.output = parse.fastpaths(input, options); + if (options2.fastpaths !== false && (input[0] === "." || input[0] === "*")) { + parsed.output = parse$1.fastpaths(input, options2); } if (!parsed.output) { - parsed = parse(input, options); + parsed = parse$1(input, options2); } - return picomatch$2.compileRe(parsed, options, returnOutput, returnState); + return picomatch$2.compileRe(parsed, options2, returnOutput, returnState); }; -picomatch$2.toRegex = (source, options) => { +picomatch$2.toRegex = (source, options2) => { try { - const opts = options || {}; + const opts = options2 || {}; return new RegExp(source, opts.flags || (opts.nocase ? "i" : "")); } catch (err) { - if (options && options.debug === true) throw err; + if (options2 && options2.debug === true) throw err; return /$^/; } }; picomatch$2.constants = constants$1; var picomatch_1 = picomatch$2; var picomatch$1 = picomatch_1; -const util = require$$0$2; +const util = require$$0$3; const braces = braces_1; const picomatch = picomatch$1; -const utils$b = utils$f; +const utils$c = utils$g; const isEmptyString = (val) => val === "" || val === "./"; -const micromatch$1 = (list, patterns, options) => { +const micromatch$1 = (list2, patterns, options2) => { patterns = [].concat(patterns); - list = [].concat(list); - let omit = /* @__PURE__ */ new Set(); + list2 = [].concat(list2); + let omit2 = /* @__PURE__ */ new Set(); let keep = /* @__PURE__ */ new Set(); let items = /* @__PURE__ */ new Set(); let negatives = 0; let onResult = (state) => { items.add(state.output); - if (options && options.onResult) { - options.onResult(state); + if (options2 && options2.onResult) { + options2.onResult(state); } }; for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); + let isMatch = picomatch(String(patterns[i]), { ...options2, onResult }, true); let negated = isMatch.state.negated || isMatch.state.negatedExtglob; if (negated) negatives++; - for (let item of list) { + for (let item of list2) { let matched = isMatch(item, true); let match = negated ? !matched.isMatch : matched.isMatch; if (!match) continue; if (negated) { - omit.add(matched.output); + omit2.add(matched.output); } else { - omit.delete(matched.output); + omit2.delete(matched.output); keep.add(matched.output); } } } let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter((item) => !omit.has(item)); - if (options && matches.length === 0) { - if (options.failglob === true) { + let matches = result.filter((item) => !omit2.has(item)); + if (options2 && matches.length === 0) { + if (options2.failglob === true) { throw new Error(`No matches found for "${patterns.join(", ")}"`); } - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns; + if (options2.nonull === true || options2.nullglob === true) { + return options2.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns; } } return matches; }; micromatch$1.match = micromatch$1; -micromatch$1.matcher = (pattern2, options) => picomatch(pattern2, options); -micromatch$1.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); +micromatch$1.matcher = (pattern2, options2) => picomatch(pattern2, options2); +micromatch$1.isMatch = (str, patterns, options2) => picomatch(patterns, options2)(str); micromatch$1.any = micromatch$1.isMatch; -micromatch$1.not = (list, patterns, options = {}) => { +micromatch$1.not = (list2, patterns, options2 = {}) => { patterns = [].concat(patterns).map(String); let result = /* @__PURE__ */ new Set(); let items = []; let onResult = (state) => { - if (options.onResult) options.onResult(state); + if (options2.onResult) options2.onResult(state); items.push(state.output); }; - let matches = new Set(micromatch$1(list, patterns, { ...options, onResult })); + let matches = new Set(micromatch$1(list2, patterns, { ...options2, onResult })); for (let item of items) { if (!matches.has(item)) { result.add(item); @@ -2846,12 +28948,12 @@ micromatch$1.not = (list, patterns, options = {}) => { } return [...result]; }; -micromatch$1.contains = (str, pattern2, options) => { +micromatch$1.contains = (str, pattern2, options2) => { if (typeof str !== "string") { throw new TypeError(`Expected a string: "${util.inspect(str)}"`); } if (Array.isArray(pattern2)) { - return pattern2.some((p) => micromatch$1.contains(str, p, options)); + return pattern2.some((p) => micromatch$1.contains(str, p, options2)); } if (typeof pattern2 === "string") { if (isEmptyString(str) || isEmptyString(pattern2)) { @@ -2861,77 +28963,77 @@ micromatch$1.contains = (str, pattern2, options) => { return true; } } - return micromatch$1.isMatch(str, pattern2, { ...options, contains: true }); + return micromatch$1.isMatch(str, pattern2, { ...options2, contains: true }); }; -micromatch$1.matchKeys = (obj, patterns, options) => { - if (!utils$b.isObject(obj)) { +micromatch$1.matchKeys = (obj, patterns, options2) => { + if (!utils$c.isObject(obj)) { throw new TypeError("Expected the first argument to be an object"); } - let keys = micromatch$1(Object.keys(obj), patterns, options); + let keys = micromatch$1(Object.keys(obj), patterns, options2); let res = {}; for (let key of keys) res[key] = obj[key]; return res; }; -micromatch$1.some = (list, patterns, options) => { - let items = [].concat(list); +micromatch$1.some = (list2, patterns, options2) => { + let items = [].concat(list2); for (let pattern2 of [].concat(patterns)) { - let isMatch = picomatch(String(pattern2), options); + let isMatch = picomatch(String(pattern2), options2); if (items.some((item) => isMatch(item))) { return true; } } return false; }; -micromatch$1.every = (list, patterns, options) => { - let items = [].concat(list); +micromatch$1.every = (list2, patterns, options2) => { + let items = [].concat(list2); for (let pattern2 of [].concat(patterns)) { - let isMatch = picomatch(String(pattern2), options); + let isMatch = picomatch(String(pattern2), options2); if (!items.every((item) => isMatch(item))) { return false; } } return true; }; -micromatch$1.all = (str, patterns, options) => { +micromatch$1.all = (str, patterns, options2) => { if (typeof str !== "string") { throw new TypeError(`Expected a string: "${util.inspect(str)}"`); } - return [].concat(patterns).every((p) => picomatch(p, options)(str)); + return [].concat(patterns).every((p) => picomatch(p, options2)(str)); }; -micromatch$1.capture = (glob2, input, options) => { - let posix = utils$b.isWindows(options); - let regex = picomatch.makeRe(String(glob2), { ...options, capture: true }); - let match = regex.exec(posix ? utils$b.toPosixSlashes(input) : input); +micromatch$1.capture = (glob2, input, options2) => { + let posix = utils$c.isWindows(options2); + let regex = picomatch.makeRe(String(glob2), { ...options2, capture: true }); + let match = regex.exec(posix ? utils$c.toPosixSlashes(input) : input); if (match) { return match.slice(1).map((v) => v === void 0 ? "" : v); } }; micromatch$1.makeRe = (...args) => picomatch.makeRe(...args); micromatch$1.scan = (...args) => picomatch.scan(...args); -micromatch$1.parse = (patterns, options) => { +micromatch$1.parse = (patterns, options2) => { let res = []; for (let pattern2 of [].concat(patterns || [])) { - for (let str of braces(String(pattern2), options)) { - res.push(picomatch.parse(str, options)); + for (let str of braces(String(pattern2), options2)) { + res.push(picomatch.parse(str, options2)); } } return res; }; -micromatch$1.braces = (pattern2, options) => { +micromatch$1.braces = (pattern2, options2) => { if (typeof pattern2 !== "string") throw new TypeError("Expected a string"); - if (options && options.nobrace === true || !/\{.*\}/.test(pattern2)) { + if (options2 && options2.nobrace === true || !/\{.*\}/.test(pattern2)) { return [pattern2]; } - return braces(pattern2, options); + return braces(pattern2, options2); }; -micromatch$1.braceExpand = (pattern2, options) => { +micromatch$1.braceExpand = (pattern2, options2) => { if (typeof pattern2 !== "string") throw new TypeError("Expected a string"); - return micromatch$1.braces(pattern2, { ...options, expand: true }); + return micromatch$1.braces(pattern2, { ...options2, expand: true }); }; var micromatch_1 = micromatch$1; Object.defineProperty(pattern$1, "__esModule", { value: true }); pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0; -const path$5 = require$$0$1; +const path$5 = require$$0$9; const globParent2 = globParent$1; const micromatch = micromatch_1; const GLOBSTAR = "**"; @@ -2942,24 +29044,24 @@ const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; -function isStaticPattern(pattern2, options = {}) { - return !isDynamicPattern(pattern2, options); +function isStaticPattern(pattern2, options2 = {}) { + return !isDynamicPattern(pattern2, options2); } pattern$1.isStaticPattern = isStaticPattern; -function isDynamicPattern(pattern2, options = {}) { +function isDynamicPattern(pattern2, options2 = {}) { if (pattern2 === "") { return false; } - if (options.caseSensitiveMatch === false || pattern2.includes(ESCAPE_SYMBOL)) { + if (options2.caseSensitiveMatch === false || pattern2.includes(ESCAPE_SYMBOL)) { return true; } if (COMMON_GLOB_SYMBOLS_RE.test(pattern2) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern2) || REGEX_GROUP_SYMBOLS_RE.test(pattern2)) { return true; } - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern2)) { + if (options2.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern2)) { return true; } - if (options.braceExpansion !== false && hasBraceExpansion(pattern2)) { + if (options2.braceExpansion !== false && hasBraceExpansion(pattern2)) { return true; } return false; @@ -3026,8 +29128,8 @@ function endsWithSlashGlobStar(pattern2) { } pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar; function isAffectDepthOfReadingPattern(pattern2) { - const basename = path$5.basename(pattern2); - return endsWithSlashGlobStar(pattern2) || isStaticPattern(basename); + const basename2 = path$5.basename(pattern2); + return endsWithSlashGlobStar(pattern2) || isStaticPattern(basename2); } pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; function expandPatternsWithBraceExpansion(patterns) { @@ -3042,8 +29144,8 @@ function expandBraceExpansion(pattern2) { return patterns.filter((pattern3) => pattern3 !== ""); } pattern$1.expandBraceExpansion = expandBraceExpansion; -function getPatternParts(pattern2, options) { - let { parts } = micromatch.scan(pattern2, Object.assign(Object.assign({}, options), { parts: true })); +function getPatternParts(pattern2, options2) { + let { parts } = micromatch.scan(pattern2, Object.assign(Object.assign({}, options2), { parts: true })); if (parts.length === 0) { parts = [pattern2]; } @@ -3054,12 +29156,12 @@ function getPatternParts(pattern2, options) { return parts; } pattern$1.getPatternParts = getPatternParts; -function makeRe(pattern2, options) { - return micromatch.makeRe(pattern2, options); +function makeRe(pattern2, options2) { + return micromatch.makeRe(pattern2, options2); } pattern$1.makeRe = makeRe; -function convertPatternsToRe(patterns, options) { - return patterns.map((pattern2) => makeRe(pattern2, options)); +function convertPatternsToRe(patterns, options2) { + return patterns.map((pattern2) => makeRe(pattern2, options2)); } pattern$1.convertPatternsToRe = convertPatternsToRe; function matchAny(entry2, patternsRe) { @@ -3071,7 +29173,7 @@ function removeDuplicateSlashes(pattern2) { } pattern$1.removeDuplicateSlashes = removeDuplicateSlashes; var stream$4 = {}; -const Stream = require$$0$3; +const Stream = require$$0$5; const PassThrough = Stream.PassThrough; const slice = Array.prototype.slice; var merge2_1 = merge2$1; @@ -3079,24 +29181,24 @@ function merge2$1() { const streamsQueue = []; const args = slice.call(arguments); let merging = false; - let options = args[args.length - 1]; - if (options && !Array.isArray(options) && options.pipe == null) { + let options2 = args[args.length - 1]; + if (options2 && !Array.isArray(options2) && options2.pipe == null) { args.pop(); } else { - options = {}; + options2 = {}; } - const doEnd = options.end !== false; - const doPipeError = options.pipeError === true; - if (options.objectMode == null) { - options.objectMode = true; + const doEnd = options2.end !== false; + const doPipeError = options2.pipeError === true; + if (options2.objectMode == null) { + options2.objectMode = true; } - if (options.highWaterMark == null) { - options.highWaterMark = 64 * 1024; + if (options2.highWaterMark == null) { + options2.highWaterMark = 64 * 1024; } - const mergedStream = PassThrough(options); + const mergedStream = PassThrough(options2); function addStream() { for (let i = 0, len = arguments.length; i < len; i++) { - streamsQueue.push(pauseStreams(arguments[i], options)); + streamsQueue.push(pauseStreams(arguments[i], options2)); } mergeStream(); return this; @@ -3167,10 +29269,10 @@ function merge2$1() { } return mergedStream; } -function pauseStreams(streams, options) { +function pauseStreams(streams, options2) { if (!Array.isArray(streams)) { if (!streams._readableState && streams.pipe) { - streams = streams.pipe(PassThrough(options)); + streams = streams.pipe(PassThrough(options2)); } if (!streams._readableState || !streams.pause || !streams.pipe) { throw new Error("Only readable stream can be merged."); @@ -3178,7 +29280,7 @@ function pauseStreams(streams, options) { streams.pause(); } else { for (let i = 0, len = streams.length; i < len; i++) { - streams[i] = pauseStreams(streams[i], options); + streams[i] = pauseStreams(streams[i], options2); } } return streams; @@ -3210,32 +29312,32 @@ function isEmpty(input) { return input === ""; } string$1.isEmpty = isEmpty; -Object.defineProperty(utils$k, "__esModule", { value: true }); -utils$k.string = utils$k.stream = utils$k.pattern = utils$k.path = utils$k.fs = utils$k.errno = utils$k.array = void 0; +Object.defineProperty(utils$l, "__esModule", { value: true }); +utils$l.string = utils$l.stream = utils$l.pattern = utils$l.path = utils$l.fs = utils$l.errno = utils$l.array = void 0; const array = array$1; -utils$k.array = array; +utils$l.array = array; const errno = errno$1; -utils$k.errno = errno; -const fs$6 = fs$7; -utils$k.fs = fs$6; +utils$l.errno = errno; +const fs$7 = fs$8; +utils$l.fs = fs$7; const path$4 = path$9; -utils$k.path = path$4; +utils$l.path = path$4; const pattern = pattern$1; -utils$k.pattern = pattern; +utils$l.pattern = pattern; const stream$3 = stream$4; -utils$k.stream = stream$3; +utils$l.stream = stream$3; const string = string$1; -utils$k.string = string; +utils$l.string = string; Object.defineProperty(tasks, "__esModule", { value: true }); tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0; -const utils$a = utils$k; +const utils$b = utils$l; function generate(input, settings2) { const patterns = processPatterns(input, settings2); const ignore = processPatterns(settings2.ignore, settings2); const positivePatterns = getPositivePatterns(patterns); const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); - const staticPatterns = positivePatterns.filter((pattern2) => utils$a.pattern.isStaticPattern(pattern2, settings2)); - const dynamicPatterns = positivePatterns.filter((pattern2) => utils$a.pattern.isDynamicPattern(pattern2, settings2)); + const staticPatterns = positivePatterns.filter((pattern2) => utils$b.pattern.isStaticPattern(pattern2, settings2)); + const dynamicPatterns = positivePatterns.filter((pattern2) => utils$b.pattern.isDynamicPattern(pattern2, settings2)); const staticTasks = convertPatternsToTasks( staticPatterns, negativePatterns, @@ -3254,17 +29356,17 @@ tasks.generate = generate; function processPatterns(input, settings2) { let patterns = input; if (settings2.braceExpansion) { - patterns = utils$a.pattern.expandPatternsWithBraceExpansion(patterns); + patterns = utils$b.pattern.expandPatternsWithBraceExpansion(patterns); } if (settings2.baseNameMatch) { patterns = patterns.map((pattern2) => pattern2.includes("/") ? pattern2 : `**/${pattern2}`); } - return patterns.map((pattern2) => utils$a.pattern.removeDuplicateSlashes(pattern2)); + return patterns.map((pattern2) => utils$b.pattern.removeDuplicateSlashes(pattern2)); } function convertPatternsToTasks(positive, negative, dynamic) { const tasks2 = []; - const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive); - const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive); + const patternsOutsideCurrentDirectory = utils$b.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils$b.pattern.getPatternsInsideCurrentDirectory(positive); const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); tasks2.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); @@ -3277,19 +29379,19 @@ function convertPatternsToTasks(positive, negative, dynamic) { } tasks.convertPatternsToTasks = convertPatternsToTasks; function getPositivePatterns(patterns) { - return utils$a.pattern.getPositivePatterns(patterns); + return utils$b.pattern.getPositivePatterns(patterns); } tasks.getPositivePatterns = getPositivePatterns; function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils$a.pattern.convertToPositivePattern); + const negative = utils$b.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils$b.pattern.convertToPositivePattern); return positive; } tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive; function groupPatternsByBaseDirectory(patterns) { const group = {}; return patterns.reduce((collection, pattern2) => { - const base = utils$a.pattern.getBaseDirectory(pattern2); + const base = utils$b.pattern.getBaseDirectory(pattern2); if (base in collection) { collection[base].push(pattern2); } else { @@ -3311,7 +29413,7 @@ function convertPatternGroupToTask(base, positive, negative, dynamic) { positive, negative, base, - patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern)) + patterns: [].concat(positive, negative.map(utils$b.pattern.convertToNegativePattern)) }; } tasks.convertPatternGroupToTask = convertPatternGroupToTask; @@ -3382,11 +29484,11 @@ function read$2(path2, settings2) { } sync$7.read = read$2; var settings$3 = {}; -var fs$5 = {}; +var fs$6 = {}; (function(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0; - const fs2 = require$$0$4; + const fs2 = require$$0$1; exports2.FILE_SYSTEM_ADAPTER = { lstat: fs2.lstat, stat: fs2.stat, @@ -3400,14 +29502,14 @@ var fs$5 = {}; return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods); } exports2.createFileSystemAdapter = createFileSystemAdapter; -})(fs$5); +})(fs$6); Object.defineProperty(settings$3, "__esModule", { value: true }); -const fs$4 = fs$5; +const fs$5 = fs$6; let Settings$2 = class Settings { constructor(_options = {}) { this._options = _options; this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); - this.fs = fs$4.createFileSystemAdapter(this._options.fs); + this.fs = fs$5.createFileSystemAdapter(this._options.fs); this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); } @@ -3450,26 +29552,26 @@ var queueMicrotask_1 = typeof queueMicrotask === "function" ? queueMicrotask.bin var runParallel_1 = runParallel; const queueMicrotask$1 = queueMicrotask_1; function runParallel(tasks2, cb) { - let results, pending, keys; + let results2, pending, keys; let isSync = true; if (Array.isArray(tasks2)) { - results = []; + results2 = []; pending = tasks2.length; } else { keys = Object.keys(tasks2); - results = {}; + results2 = {}; pending = keys.length; } function done(err) { function end() { - if (cb) cb(err, results); + if (cb) cb(err, results2); cb = null; } if (isSync) queueMicrotask$1(end); else end(); } function each(i, err, result) { - results[i] = result; + results2[i] = result; if (--pending === 0 || err) { done(err); } @@ -3505,10 +29607,10 @@ const SUPPORTED_MINOR_VERSION = 10; const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; constants.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; -var utils$9 = {}; -var fs$3 = {}; -Object.defineProperty(fs$3, "__esModule", { value: true }); -fs$3.createDirentFromStats = void 0; +var utils$a = {}; +var fs$4 = {}; +Object.defineProperty(fs$4, "__esModule", { value: true }); +fs$4.createDirentFromStats = void 0; class DirentFromStats2 { constructor(name, stats) { this.name = name; @@ -3524,11 +29626,11 @@ class DirentFromStats2 { function createDirentFromStats(name, stats) { return new DirentFromStats2(name, stats); } -fs$3.createDirentFromStats = createDirentFromStats; -Object.defineProperty(utils$9, "__esModule", { value: true }); -utils$9.fs = void 0; -const fs$2 = fs$3; -utils$9.fs = fs$2; +fs$4.createDirentFromStats = createDirentFromStats; +Object.defineProperty(utils$a, "__esModule", { value: true }); +utils$a.fs = void 0; +const fs$3 = fs$4; +utils$a.fs = fs$3; var common$6 = {}; Object.defineProperty(common$6, "__esModule", { value: true }); common$6.joinPathSegments = void 0; @@ -3544,7 +29646,7 @@ async$3.readdir = async$3.readdirWithFileTypes = async$3.read = void 0; const fsStat$5 = out$1; const rpl = runParallel_1; const constants_1$1 = constants; -const utils$8 = utils$9; +const utils$9 = utils$a; const common$5 = common$6; function read$1(directory, settings2, callback) { if (!settings2.stats && constants_1$1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { @@ -3595,7 +29697,7 @@ function makeRplTaskEntry(entry2, settings2) { done(null, entry2); return; } - entry2.dirent = utils$8.fs.createDirentFromStats(entry2.name, stats); + entry2.dirent = utils$9.fs.createDirentFromStats(entry2.name, stats); done(null, entry2); }); }; @@ -3617,7 +29719,7 @@ function readdir$1(directory, settings2, callback) { const entry2 = { name, path: path2, - dirent: utils$8.fs.createDirentFromStats(name, stats) + dirent: utils$9.fs.createDirentFromStats(name, stats) }; if (settings2.stats) { entry2.stats = stats; @@ -3647,7 +29749,7 @@ Object.defineProperty(sync$5, "__esModule", { value: true }); sync$5.readdir = sync$5.readdirWithFileTypes = sync$5.read = void 0; const fsStat$4 = out$1; const constants_1 = constants; -const utils$7 = utils$9; +const utils$8 = utils$a; const common$4 = common$6; function read(directory, settings2) { if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { @@ -3667,7 +29769,7 @@ function readdirWithFileTypes(directory, settings2) { if (entry2.dirent.isSymbolicLink() && settings2.followSymbolicLinks) { try { const stats = settings2.fs.statSync(entry2.path); - entry2.dirent = utils$7.fs.createDirentFromStats(entry2.name, stats); + entry2.dirent = utils$8.fs.createDirentFromStats(entry2.name, stats); } catch (error2) { if (settings2.throwErrorOnBrokenSymbolicLink) { throw error2; @@ -3686,7 +29788,7 @@ function readdir(directory, settings2) { const entry2 = { name, path: entryPath, - dirent: utils$7.fs.createDirentFromStats(name, stats) + dirent: utils$8.fs.createDirentFromStats(name, stats) }; if (settings2.stats) { entry2.stats = stats; @@ -3696,11 +29798,11 @@ function readdir(directory, settings2) { } sync$5.readdir = readdir; var settings$2 = {}; -var fs$1 = {}; +var fs$2 = {}; (function(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0; - const fs2 = require$$0$4; + const fs2 = require$$0$1; exports2.FILE_SYSTEM_ADAPTER = { lstat: fs2.lstat, stat: fs2.stat, @@ -3716,16 +29818,16 @@ var fs$1 = {}; return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods); } exports2.createFileSystemAdapter = createFileSystemAdapter; -})(fs$1); +})(fs$2); Object.defineProperty(settings$2, "__esModule", { value: true }); -const path$3 = require$$0$1; +const path$3 = require$$0$9; const fsStat$3 = out$1; -const fs = fs$1; +const fs$1 = fs$2; let Settings$1 = class Settings2 { constructor(_options = {}) { this._options = _options; this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); - this.fs = fs.createFileSystemAdapter(this._options.fs); + this.fs = fs$1.createFileSystemAdapter(this._options.fs); this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$3.sep); this.stats = this._getValue(this._options.stats, false); this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); @@ -3791,22 +29893,22 @@ function reusify$1(Constructor) { } var reusify_1 = reusify$1; var reusify = reusify_1; -function fastqueue(context, worker, _concurrency) { - if (typeof context === "function") { +function fastqueue(context2, worker, _concurrency) { + if (typeof context2 === "function") { _concurrency = worker; - worker = context; - context = null; + worker = context2; + context2 = null; } if (!(_concurrency >= 1)) { throw new Error("fastqueue concurrency must be equal to or greater than 1"); } - var cache = reusify(Task); + var cache2 = reusify(Task); var queueHead = null; var queueTail = null; var _running = 0; var errorHandler = null; var self2 = { - push, + push: push2, drain: noop, saturated: noop, pause, @@ -3826,11 +29928,11 @@ function fastqueue(context, worker, _concurrency) { } }, running, - resume, + resume: resume2, idle, length, getQueue, - unshift, + unshift: unshift2, empty: noop, kill, killAndDrain, @@ -3861,7 +29963,7 @@ function fastqueue(context, worker, _concurrency) { } return tasks2; } - function resume() { + function resume2() { if (!self2.paused) return; self2.paused = false; if (queueHead === null) { @@ -3877,9 +29979,9 @@ function fastqueue(context, worker, _concurrency) { function idle() { return _running === 0 && self2.length() === 0; } - function push(value, done) { - var current = cache.get(); - current.context = context; + function push2(value, done) { + var current = cache2.get(); + current.context = context2; current.release = release; current.value = value; current.callback = done || noop; @@ -3895,12 +29997,12 @@ function fastqueue(context, worker, _concurrency) { } } else { _running++; - worker.call(context, current.value, current.worked); + worker.call(context2, current.value, current.worked); } } - function unshift(value, done) { - var current = cache.get(); - current.context = context; + function unshift2(value, done) { + var current = cache2.get(); + current.context = context2; current.release = release; current.value = value; current.callback = done || noop; @@ -3916,12 +30018,12 @@ function fastqueue(context, worker, _concurrency) { } } else { _running++; - worker.call(context, current.value, current.worked); + worker.call(context2, current.value, current.worked); } } function release(holder) { if (holder) { - cache.release(holder); + cache2.release(holder); } var next = queueHead; if (next && _running <= _concurrency) { @@ -3931,7 +30033,7 @@ function fastqueue(context, worker, _concurrency) { } queueHead = next.next; next.next = null; - worker.call(context, next.value, next.worked); + worker.call(context2, next.value, next.worked); if (queueTail === null) { self2.empty(); } @@ -3953,8 +30055,8 @@ function fastqueue(context, worker, _concurrency) { self2.drain(); self2.drain = noop; } - function error2(handler) { - errorHandler = handler; + function error2(handler2) { + errorHandler = handler2; } } function noop() { @@ -3980,25 +30082,25 @@ function Task() { self2.release(self2); }; } -function queueAsPromised(context, worker, _concurrency) { - if (typeof context === "function") { +function queueAsPromised(context2, worker, _concurrency) { + if (typeof context2 === "function") { _concurrency = worker; - worker = context; - context = null; + worker = context2; + context2 = null; } function asyncWrapper(arg, cb) { worker.call(this, arg).then(function(res) { cb(null, res); }, cb); } - var queue2 = fastqueue(context, asyncWrapper, _concurrency); + var queue2 = fastqueue(context2, asyncWrapper, _concurrency); var pushCb = queue2.push; var unshiftCb = queue2.unshift; - queue2.push = push; - queue2.unshift = unshift; + queue2.push = push2; + queue2.unshift = unshift2; queue2.drained = drained; return queue2; - function push(value) { + function push2(value) { var p = new Promise(function(resolve, reject) { pushCb(value, function(err, result) { if (err) { @@ -4011,7 +30113,7 @@ function queueAsPromised(context, worker, _concurrency) { p.catch(noop); return p; } - function unshift(value) { + function unshift2(value) { var p = new Promise(function(resolve, reject) { unshiftCb(value, function(err, result) { if (err) { @@ -4083,7 +30185,7 @@ let Reader$1 = class Reader { }; reader$1.default = Reader$1; Object.defineProperty(async$4, "__esModule", { value: true }); -const events_1 = require$$0$5; +const events_1 = require$$0$2; const fsScandir$2 = out$2; const fastq = queueExports; const common$1 = common$3; @@ -4209,7 +30311,7 @@ function callSuccessCallback(callback, entries) { } var stream$2 = {}; Object.defineProperty(stream$2, "__esModule", { value: true }); -const stream_1$5 = require$$0$3; +const stream_1$5 = require$$0$5; const async_1$3 = async$4; class StreamProvider { constructor(_root, _settings) { @@ -4316,7 +30418,7 @@ class SyncProvider { sync$3.default = SyncProvider; var settings$1 = {}; Object.defineProperty(settings$1, "__esModule", { value: true }); -const path$2 = require$$0$1; +const path$2 = require$$0$9; const fsScandir = out$2; class Settings3 { constructor(_options = {}) { @@ -4375,9 +30477,9 @@ function getSettings(settingsOrOptions = {}) { } var reader = {}; Object.defineProperty(reader, "__esModule", { value: true }); -const path$1 = require$$0$1; +const path$1 = require$$0$9; const fsStat$2 = out$1; -const utils$6 = utils$k; +const utils$7 = utils$l; class Reader2 { constructor(_settings) { this._settings = _settings; @@ -4394,7 +30496,7 @@ class Reader2 { const entry2 = { name: pattern2, path: pattern2, - dirent: utils$6.fs.createDirentFromStats(pattern2, stats) + dirent: utils$7.fs.createDirentFromStats(pattern2, stats) }; if (this._settings.stats) { entry2.stats = stats; @@ -4402,13 +30504,13 @@ class Reader2 { return entry2; } _isFatalError(error2) { - return !utils$6.errno.isEnoentCodeError(error2) && !this._settings.suppressErrors; + return !utils$7.errno.isEnoentCodeError(error2) && !this._settings.suppressErrors; } } reader.default = Reader2; var stream$1 = {}; Object.defineProperty(stream$1, "__esModule", { value: true }); -const stream_1$3 = require$$0$3; +const stream_1$3 = require$$0$5; const fsStat$1 = out$1; const fsWalk$2 = out$3; const reader_1$2 = reader; @@ -4418,15 +30520,15 @@ class ReaderStream extends reader_1$2.default { this._walkStream = fsWalk$2.walkStream; this._stat = fsStat$1.stat; } - dynamic(root, options) { - return this._walkStream(root, options); + dynamic(root, options2) { + return this._walkStream(root, options2); } - static(patterns, options) { + static(patterns, options2) { const filepaths = patterns.map(this._getFullEntryPath, this); const stream2 = new stream_1$3.PassThrough({ objectMode: true }); stream2._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options).then((entry2) => { - if (entry2 !== null && options.entryFilter(entry2)) { + return this._getEntry(filepaths[index], patterns[index], options2).then((entry2) => { + if (entry2 !== null && options2.entryFilter(entry2)) { stream2.push(entry2); } if (index === filepaths.length - 1) { @@ -4440,9 +30542,9 @@ class ReaderStream extends reader_1$2.default { } return stream2; } - _getEntry(filepath, pattern2, options) { + _getEntry(filepath, pattern2, options2) { return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern2)).catch((error2) => { - if (options.errorFilter(error2)) { + if (options2.errorFilter(error2)) { return null; } throw error2; @@ -4467,9 +30569,9 @@ class ReaderAsync extends reader_1$1.default { this._walkAsync = fsWalk$1.walk; this._readerStream = new stream_1$2.default(this._settings); } - dynamic(root, options) { + dynamic(root, options2) { return new Promise((resolve, reject) => { - this._walkAsync(root, options, (error2, entries) => { + this._walkAsync(root, options2, (error2, entries) => { if (error2 === null) { resolve(entries); } else { @@ -4478,9 +30580,9 @@ class ReaderAsync extends reader_1$1.default { }); }); } - async static(patterns, options) { + async static(patterns, options2) { const entries = []; - const stream2 = this._readerStream.static(patterns, options); + const stream2 = this._readerStream.static(patterns, options2); return new Promise((resolve, reject) => { stream2.once("error", reject); stream2.on("data", (entry2) => entries.push(entry2)); @@ -4494,7 +30596,7 @@ var deep = {}; var partial = {}; var matcher = {}; Object.defineProperty(matcher, "__esModule", { value: true }); -const utils$5 = utils$k; +const utils$6 = utils$l; class Matcher { constructor(_patterns, _settings, _micromatchOptions) { this._patterns = _patterns; @@ -4516,9 +30618,9 @@ class Matcher { } } _getPatternSegments(pattern2) { - const parts = utils$5.pattern.getPatternParts(pattern2, this._micromatchOptions); + const parts = utils$6.pattern.getPatternParts(pattern2, this._micromatchOptions); return parts.map((part) => { - const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings); + const dynamic = utils$6.pattern.isDynamicPattern(part, this._settings); if (!dynamic) { return { dynamic: false, @@ -4528,12 +30630,12 @@ class Matcher { return { dynamic: true, pattern: part, - patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions) + patternRe: utils$6.pattern.makeRe(part, this._micromatchOptions) }; }); } _splitSegmentsIntoSections(segments) { - return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern)); + return utils$6.array.splitWhen(segments, (segment) => segment.dynamic && utils$6.pattern.hasGlobStar(segment.pattern)); } } matcher.default = Matcher; @@ -4568,7 +30670,7 @@ class PartialMatcher extends matcher_1.default { } partial.default = PartialMatcher; Object.defineProperty(deep, "__esModule", { value: true }); -const utils$4 = utils$k; +const utils$5 = utils$l; const partial_1 = partial; class DeepFilter { constructor(_settings, _micromatchOptions) { @@ -4584,8 +30686,8 @@ class DeepFilter { return new partial_1.default(patterns, this._settings, this._micromatchOptions); } _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern); - return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + const affectDepthOfReadingPatterns = patterns.filter(utils$5.pattern.isAffectDepthOfReadingPattern); + return utils$5.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); } _filter(basePath, entry2, matcher2, negativeRe) { if (this._isSkippedByDeep(basePath, entry2.path)) { @@ -4594,7 +30696,7 @@ class DeepFilter { if (this._isSkippedSymbolicLink(entry2)) { return false; } - const filepath = utils$4.path.removeLeadingDotSegment(entry2.path); + const filepath = utils$5.path.removeLeadingDotSegment(entry2.path); if (this._isSkippedByPositivePatterns(filepath, matcher2)) { return false; } @@ -4621,13 +30723,13 @@ class DeepFilter { return !this._settings.baseNameMatch && !matcher2.match(entryPath); } _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils$4.pattern.matchAny(entryPath, patternsRe); + return !utils$5.pattern.matchAny(entryPath, patternsRe); } } deep.default = DeepFilter; var entry$1 = {}; Object.defineProperty(entry$1, "__esModule", { value: true }); -const utils$3 = utils$k; +const utils$4 = utils$l; class EntryFilter { constructor(_settings, _micromatchOptions) { this._settings = _settings; @@ -4635,12 +30737,12 @@ class EntryFilter { this.index = /* @__PURE__ */ new Map(); } getFilter(positive, negative) { - const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions); - const negativeRe = utils$3.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); + const positiveRe = utils$4.pattern.convertPatternsToRe(positive, this._micromatchOptions); + const negativeRe = utils$4.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); return (entry2) => this._filter(entry2, positiveRe, negativeRe); } _filter(entry2, positiveRe, negativeRe) { - const filepath = utils$3.path.removeLeadingDotSegment(entry2.path); + const filepath = utils$4.path.removeLeadingDotSegment(entry2.path); if (this._settings.unique && this._isDuplicateEntry(filepath)) { return false; } @@ -4650,8 +30752,8 @@ class EntryFilter { if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) { return false; } - const isDirectory = entry2.dirent.isDirectory(); - const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory); + const isDirectory2 = entry2.dirent.isDirectory(); + const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory2) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory2); if (this._settings.unique && isMatched) { this._createIndexRecord(filepath); } @@ -4673,13 +30775,13 @@ class EntryFilter { if (!this._settings.absolute) { return false; } - const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, entryPath); - return utils$3.pattern.matchAny(fullpath, patternsRe); + const fullpath = utils$4.path.makeAbsolute(this._settings.cwd, entryPath); + return utils$4.pattern.matchAny(fullpath, patternsRe); } - _isMatchToPatterns(filepath, patternsRe, isDirectory) { - const isMatched = utils$3.pattern.matchAny(filepath, patternsRe); - if (!isMatched && isDirectory) { - return utils$3.pattern.matchAny(filepath + "/", patternsRe); + _isMatchToPatterns(filepath, patternsRe, isDirectory2) { + const isMatched = utils$4.pattern.matchAny(filepath, patternsRe); + if (!isMatched && isDirectory2) { + return utils$4.pattern.matchAny(filepath + "/", patternsRe); } return isMatched; } @@ -4687,7 +30789,7 @@ class EntryFilter { entry$1.default = EntryFilter; var error = {}; Object.defineProperty(error, "__esModule", { value: true }); -const utils$2 = utils$k; +const utils$3 = utils$l; class ErrorFilter { constructor(_settings) { this._settings = _settings; @@ -4696,13 +30798,13 @@ class ErrorFilter { return (error2) => this._isNonFatalError(error2); } _isNonFatalError(error2) { - return utils$2.errno.isEnoentCodeError(error2) || this._settings.suppressErrors; + return utils$3.errno.isEnoentCodeError(error2) || this._settings.suppressErrors; } } error.default = ErrorFilter; var entry = {}; Object.defineProperty(entry, "__esModule", { value: true }); -const utils$1 = utils$k; +const utils$2 = utils$l; class EntryTransformer { constructor(_settings) { this._settings = _settings; @@ -4713,8 +30815,8 @@ class EntryTransformer { _transform(entry2) { let filepath = entry2.path; if (this._settings.absolute) { - filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils$1.path.unixify(filepath); + filepath = utils$2.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils$2.path.unixify(filepath); } if (this._settings.markDirectories && entry2.dirent.isDirectory()) { filepath += "/"; @@ -4727,7 +30829,7 @@ class EntryTransformer { } entry.default = EntryTransformer; Object.defineProperty(provider, "__esModule", { value: true }); -const path = require$$0$1; +const path = require$$0$9; const deep_1 = deep; const entry_1 = entry$1; const error_1 = error; @@ -4783,21 +30885,21 @@ class ProviderAsync extends provider_1$2.default { } async read(task) { const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = await this.api(root, task, options); - return entries.map((entry2) => options.transform(entry2)); + const options2 = this._getReaderOptions(task); + const entries = await this.api(root, task, options2); + return entries.map((entry2) => options2.transform(entry2)); } - api(root, task, options) { + api(root, task, options2) { if (task.dynamic) { - return this._reader.dynamic(root, options); + return this._reader.dynamic(root, options2); } - return this._reader.static(task.patterns, options); + return this._reader.static(task.patterns, options2); } } async$7.default = ProviderAsync; var stream = {}; Object.defineProperty(stream, "__esModule", { value: true }); -const stream_1$1 = require$$0$3; +const stream_1$1 = require$$0$5; const stream_2 = stream$1; const provider_1$1 = provider; class ProviderStream extends provider_1$1.default { @@ -4807,19 +30909,19 @@ class ProviderStream extends provider_1$1.default { } read(task) { const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const source = this.api(root, task, options); + const options2 = this._getReaderOptions(task); + const source = this.api(root, task, options2); const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } }); - source.once("error", (error2) => destination.emit("error", error2)).on("data", (entry2) => destination.emit("data", options.transform(entry2))).once("end", () => destination.emit("end")); + source.once("error", (error2) => destination.emit("error", error2)).on("data", (entry2) => destination.emit("data", options2.transform(entry2))).once("end", () => destination.emit("end")); destination.once("close", () => source.destroy()); return destination; } - api(root, task, options) { + api(root, task, options2) { if (task.dynamic) { - return this._reader.dynamic(root, options); + return this._reader.dynamic(root, options2); } - return this._reader.static(task.patterns, options); + return this._reader.static(task.patterns, options2); } } stream.default = ProviderStream; @@ -4835,27 +30937,27 @@ class ReaderSync extends reader_1.default { this._walkSync = fsWalk.walkSync; this._statSync = fsStat.statSync; } - dynamic(root, options) { - return this._walkSync(root, options); + dynamic(root, options2) { + return this._walkSync(root, options2); } - static(patterns, options) { + static(patterns, options2) { const entries = []; for (const pattern2 of patterns) { const filepath = this._getFullEntryPath(pattern2); - const entry2 = this._getEntry(filepath, pattern2, options); - if (entry2 === null || !options.entryFilter(entry2)) { + const entry2 = this._getEntry(filepath, pattern2, options2); + if (entry2 === null || !options2.entryFilter(entry2)) { continue; } entries.push(entry2); } return entries; } - _getEntry(filepath, pattern2, options) { + _getEntry(filepath, pattern2, options2) { try { const stats = this._getStat(filepath); return this._makeEntry(stats, pattern2); } catch (error2) { - if (options.errorFilter(error2)) { + if (options2.errorFilter(error2)) { return null; } throw error2; @@ -4876,15 +30978,15 @@ class ProviderSync extends provider_1.default { } read(task) { const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = this.api(root, task, options); - return entries.map(options.transform); + const options2 = this._getReaderOptions(task); + const entries = this.api(root, task, options2); + return entries.map(options2.transform); } - api(root, task, options) { + api(root, task, options2) { if (task.dynamic) { - return this._reader.dynamic(root, options); + return this._reader.dynamic(root, options2); } - return this._reader.static(task.patterns, options); + return this._reader.static(task.patterns, options2); } } sync$1.default = ProviderSync; @@ -4892,8 +30994,8 @@ var settings = {}; (function(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; - const fs2 = require$$0$4; - const os2 = require$$0; + const fs2 = require$$0$1; + const os2 = require$$1; const CPU_COUNT = Math.max(os2.cpus().length, 1); exports2.DEFAULT_FILE_SYSTEM_ADAPTER = { lstat: fs2.lstat, @@ -4949,119 +31051,1475 @@ const async_1 = async$7; const stream_1 = stream; const sync_1 = sync$1; const settings_1 = settings; -const utils = utils$k; -async function FastGlob(source, options) { +const utils$1 = utils$l; +async function FastGlob(source, options2) { assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); + const works = getWorks(source, async_1.default, options2); const result = await Promise.all(works); - return utils.array.flatten(result); + return utils$1.array.flatten(result); } (function(FastGlob2) { FastGlob2.glob = FastGlob2; FastGlob2.globSync = sync2; FastGlob2.globStream = stream2; FastGlob2.async = FastGlob2; - function sync2(source, options) { + function sync2(source, options2) { assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); + const works = getWorks(source, sync_1.default, options2); + return utils$1.array.flatten(works); } FastGlob2.sync = sync2; - function stream2(source, options) { + function stream2(source, options2) { assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - return utils.stream.merge(works); + const works = getWorks(source, stream_1.default, options2); + return utils$1.stream.merge(works); } FastGlob2.stream = stream2; - function generateTasks(source, options) { + function generateTasks(source, options2) { assertPatternsInput(source); const patterns = [].concat(source); - const settings2 = new settings_1.default(options); + const settings2 = new settings_1.default(options2); return taskManager.generate(patterns, settings2); } FastGlob2.generateTasks = generateTasks; - function isDynamicPattern2(source, options) { + function isDynamicPattern2(source, options2) { assertPatternsInput(source); - const settings2 = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings2); + const settings2 = new settings_1.default(options2); + return utils$1.pattern.isDynamicPattern(source, settings2); } FastGlob2.isDynamicPattern = isDynamicPattern2; function escapePath(source) { assertPatternsInput(source); - return utils.path.escape(source); + return utils$1.path.escape(source); } FastGlob2.escapePath = escapePath; function convertPathToPattern(source) { assertPatternsInput(source); - return utils.path.convertPathToPattern(source); + return utils$1.path.convertPathToPattern(source); } FastGlob2.convertPathToPattern = convertPathToPattern; (function(posix) { function escapePath2(source) { assertPatternsInput(source); - return utils.path.escapePosixPath(source); + return utils$1.path.escapePosixPath(source); } posix.escapePath = escapePath2; function convertPathToPattern2(source) { assertPatternsInput(source); - return utils.path.convertPosixPathToPattern(source); + return utils$1.path.convertPosixPathToPattern(source); } posix.convertPathToPattern = convertPathToPattern2; })(FastGlob2.posix || (FastGlob2.posix = {})); (function(win32) { function escapePath2(source) { assertPatternsInput(source); - return utils.path.escapeWindowsPath(source); + return utils$1.path.escapeWindowsPath(source); } win32.escapePath = escapePath2; function convertPathToPattern2(source) { assertPatternsInput(source); - return utils.path.convertWindowsPathToPattern(source); + return utils$1.path.convertWindowsPathToPattern(source); } win32.convertPathToPattern = convertPathToPattern2; })(FastGlob2.win32 || (FastGlob2.win32 = {})); })(FastGlob || (FastGlob = {})); -function getWorks(source, _Provider, options) { +function getWorks(source, _Provider, options2) { const patterns = [].concat(source); - const settings2 = new settings_1.default(options); + const settings2 = new settings_1.default(options2); const tasks2 = taskManager.generate(patterns, settings2); const provider2 = new _Provider(settings2); return tasks2.map(provider2.read, provider2); } function assertPatternsInput(input) { const source = [].concat(input); - const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + const isValidSource = source.every((item) => utils$1.string.isString(item) && !utils$1.string.isEmpty(item)); if (!isValidSource) { throw new TypeError("Patterns must be a string (non empty) or an array of strings"); } } var out = FastGlob; const glob = /* @__PURE__ */ getDefaultExportFromCjs(out); -async function run(cwd, context, dryRun = false) { - var _a; - console.log("publish-node-package-action", "1.14.0"); - const owner = (_a = context.payload.repository) == null ? void 0 : _a.owner.login; +const registries = { + npm: "https://registry.npmjs.org", + github: "https://npm.pkg.github.com" +}; +async function publishPackages(options2) { + var _a2; + const registry = registries[options2.target || "npm"]; + if (!registry) { + throw new Error(`Invalid registry target: ${options2.target}`); + } + const owner = (_a2 = github.context.payload.repository) == null ? void 0 : _a2.owner.login; + const cwd = process.cwd(); if (!owner) { throw new Error("No owner found in context"); } - const rootPkgFile = require$$0$1.join(cwd, "/package.json"); - const pkg = JSON.parse(require$$0$4.readFileSync(rootPkgFile, "utf-8")); - const pkgFiles = glob.sync( - (pkg.workspaces || []).map((ws) => require$$0$1.join(ws, "package.json")), + const rootPkgFile = require$$0$9.join(cwd, "/package.json"); + const pkg = JSON.parse(require$$0$1.readFileSync(rootPkgFile, "utf-8")); + const childPkgFiles = glob.sync( + (pkg.workspaces || []).map((ws) => require$$0$9.join(ws, "package.json")), { cwd, onlyFiles: true } - ).map((file) => require$$0$1.join(cwd, file)); - [rootPkgFile, ...pkgFiles].forEach((pkgFile) => { - const pkg2 = JSON.parse(require$$0$4.readFileSync(pkgFile, "utf-8")); - const underlineName = pkg2.name.replace(/@(.*)\/(.*)/, "$1__$2"); - const ownerName = "@" + owner + "/" + underlineName; - if (dryRun) { - console.log("dryRun", pkgFile); - console.log("change pkg.name from %s to %s", pkg2.name, ownerName); - } else { + ).map((file2) => require$$0$9.join(cwd, file2)); + for (const pkgFile of [rootPkgFile, ...childPkgFiles]) { + const origin = require$$0$1.readFileSync(pkgFile, "utf-8"); + const pkg2 = JSON.parse(origin); + if (pkg2.private && !options2.includePrivate) continue; + if (options2.target === "github") { + const underlineName = pkg2.name.replace(/@(.*)\/(.*)/, "$1__$2"); + const ownerName = "@" + owner + "/" + underlineName; pkg2.name = ownerName; - require$$0$4.writeFileSync(pkgFile, JSON.stringify(pkg2), "utf-8"); + require$$0$1.writeFileSync(pkgFile, JSON.stringify(pkg2), "utf-8"); } - }); + try { + await lib.npmPublish({ + token: options2.token, + dryRun: options2.dryRun, + package: pkgFile, + tag: options2.tag, + provenance: options2.target === "npm", + registry + }); + } finally { + if (options2.target === "github") { + require$$0$1.writeFileSync(pkgFile, origin, "utf-8"); + } + } + } return ""; } -module.exports = run; +var core$1 = {}; +var command = {}; +var utils = {}; +Object.defineProperty(utils, "__esModule", { value: true }); +utils.toCommandProperties = utils.toCommandValue = void 0; +function toCommandValue(input) { + if (input === null || input === void 0) { + return ""; + } else if (typeof input === "string" || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +utils.toCommandValue = toCommandValue; +function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; +} +utils.toCommandProperties = toCommandProperties; +var __createBinding$1 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); +} : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault$1 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +} : function(o, v) { + o["default"] = v; +}); +var __importStar$1 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding$1(result, mod, k); + } + __setModuleDefault$1(result, mod); + return result; +}; +Object.defineProperty(command, "__esModule", { value: true }); +command.issue = command.issueCommand = void 0; +const os$1 = __importStar$1(require$$1); +const utils_1$1 = utils; +function issueCommand(command2, properties, message) { + const cmd = new Command(command2, properties, message); + process.stdout.write(cmd.toString() + os$1.EOL); +} +command.issueCommand = issueCommand; +function issue(name, message = "") { + issueCommand(name, {}, message); +} +command.issue = issue; +const CMD_STRING = "::"; +class Command { + constructor(command2, properties, message) { + if (!command2) { + command2 = "missing.command"; + } + this.command = command2; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += " "; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } else { + cmdStr += ","; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; + } +} +function escapeData(s) { + return utils_1$1.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); +} +function escapeProperty(s) { + return utils_1$1.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); +} +var fileCommand = {}; +var getRandomValues; +var rnds8 = new Uint8Array(16); +function rng() { + if (!getRandomValues) { + getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto); + if (!getRandomValues) { + throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); + } + } + return getRandomValues(rnds8); +} +const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; +function validate(uuid) { + return typeof uuid === "string" && REGEX.test(uuid); +} +var byteToHex = []; +for (var i = 0; i < 256; ++i) { + byteToHex.push((i + 256).toString(16).substr(1)); +} +function stringify(arr) { + var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); + if (!validate(uuid)) { + throw TypeError("Stringified UUID is invalid"); + } + return uuid; +} +var _nodeId; +var _clockseq; +var _lastMSecs = 0; +var _lastNSecs = 0; +function v1(options2, buf, offset) { + var i = buf && offset || 0; + var b = buf || new Array(16); + options2 = options2 || {}; + var node = options2.node || _nodeId; + var clockseq = options2.clockseq !== void 0 ? options2.clockseq : _clockseq; + if (node == null || clockseq == null) { + var seedBytes = options2.random || (options2.rng || rng)(); + if (node == null) { + node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + if (clockseq == null) { + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; + } + } + var msecs = options2.msecs !== void 0 ? options2.msecs : Date.now(); + var nsecs = options2.nsecs !== void 0 ? options2.nsecs : _lastNSecs + 1; + var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; + if (dt < 0 && options2.clockseq === void 0) { + clockseq = clockseq + 1 & 16383; + } + if ((dt < 0 || msecs > _lastMSecs) && options2.nsecs === void 0) { + nsecs = 0; + } + if (nsecs >= 1e4) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + msecs += 122192928e5; + var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; + b[i++] = tl >>> 24 & 255; + b[i++] = tl >>> 16 & 255; + b[i++] = tl >>> 8 & 255; + b[i++] = tl & 255; + var tmh = msecs / 4294967296 * 1e4 & 268435455; + b[i++] = tmh >>> 8 & 255; + b[i++] = tmh & 255; + b[i++] = tmh >>> 24 & 15 | 16; + b[i++] = tmh >>> 16 & 255; + b[i++] = clockseq >>> 8 | 128; + b[i++] = clockseq & 255; + for (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + return buf || stringify(b); +} +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError("Invalid UUID"); + } + var v; + var arr = new Uint8Array(16); + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 255; + arr[2] = v >>> 8 & 255; + arr[3] = v & 255; + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 255; + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 255; + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 255; + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255; + arr[11] = v / 4294967296 & 255; + arr[12] = v >>> 24 & 255; + arr[13] = v >>> 16 & 255; + arr[14] = v >>> 8 & 255; + arr[15] = v & 255; + return arr; +} +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + var bytes = []; + for (var i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + return bytes; +} +var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +var URL$1 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +function v35(name, version2, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === "string") { + value = stringToBytes(value); + } + if (typeof namespace === "string") { + namespace = parse(namespace); + } + if (namespace.length !== 16) { + throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); + } + var bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 15 | version2; + bytes[8] = bytes[8] & 63 | 128; + if (buf) { + offset = offset || 0; + for (var i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return stringify(bytes); + } + try { + generateUUID.name = name; + } catch (err) { + } + generateUUID.DNS = DNS; + generateUUID.URL = URL$1; + return generateUUID; +} +function md5(bytes) { + if (typeof bytes === "string") { + var msg = unescape(encodeURIComponent(bytes)); + bytes = new Uint8Array(msg.length); + for (var i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +function md5ToHexEncodedArray(input) { + var output = []; + var length32 = input.length * 32; + var hexTab = "0123456789abcdef"; + for (var i = 0; i < length32; i += 8) { + var x = input[i >> 5] >>> i % 32 & 255; + var hex = parseInt(hexTab.charAt(x >>> 4 & 15) + hexTab.charAt(x & 15), 16); + output.push(hex); + } + return output; +} +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +function wordsToMd5(x, len) { + x[len >> 5] |= 128 << len % 32; + x[getOutputLength(len) - 1] = len; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + for (var i = 0; i < x.length; i += 16) { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + return [a, b, c, d]; +} +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + var length8 = input.length * 8; + var output = new Uint32Array(getOutputLength(length8)); + for (var i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 255) << i % 32; + } + return output; +} +function safeAdd(x, y) { + var lsw = (x & 65535) + (y & 65535); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 65535; +} +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +function md5cmn(q, a, b, x, s, t2) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t2)), s), b); +} +function md5ff(a, b, c, d, x, s, t2) { + return md5cmn(b & c | ~b & d, a, b, x, s, t2); +} +function md5gg(a, b, c, d, x, s, t2) { + return md5cmn(b & d | c & ~d, a, b, x, s, t2); +} +function md5hh(a, b, c, d, x, s, t2) { + return md5cmn(b ^ c ^ d, a, b, x, s, t2); +} +function md5ii(a, b, c, d, x, s, t2) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t2); +} +var v3 = v35("v3", 48, md5); +const v3$1 = v3; +function v4(options2, buf, offset) { + options2 = options2 || {}; + var rnds = options2.random || (options2.rng || rng)(); + rnds[6] = rnds[6] & 15 | 64; + rnds[8] = rnds[8] & 63 | 128; + if (buf) { + offset = offset || 0; + for (var i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return stringify(rnds); +} +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + case 1: + return x ^ y ^ z; + case 2: + return x & y ^ x & z ^ y & z; + case 3: + return x ^ y ^ z; + } +} +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} +function sha1(bytes) { + var K = [1518500249, 1859775393, 2400959708, 3395469782]; + var H = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + if (typeof bytes === "string") { + var msg = unescape(encodeURIComponent(bytes)); + bytes = []; + for (var i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + bytes = Array.prototype.slice.call(bytes); + } + bytes.push(128); + var l = bytes.length / 4 + 2; + var N = Math.ceil(l / 16); + var M = new Array(N); + for (var _i = 0; _i < N; ++_i) { + var arr = new Uint32Array(16); + for (var j = 0; j < 16; ++j) { + arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3]; + } + M[_i] = arr; + } + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 4294967295; + for (var _i2 = 0; _i2 < N; ++_i2) { + var W = new Uint32Array(80); + for (var t2 = 0; t2 < 16; ++t2) { + W[t2] = M[_i2][t2]; + } + for (var _t = 16; _t < 80; ++_t) { + W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1); + } + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + for (var _t2 = 0; _t2 < 80; ++_t2) { + var s = Math.floor(_t2 / 20); + var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + return [H[0] >> 24 & 255, H[0] >> 16 & 255, H[0] >> 8 & 255, H[0] & 255, H[1] >> 24 & 255, H[1] >> 16 & 255, H[1] >> 8 & 255, H[1] & 255, H[2] >> 24 & 255, H[2] >> 16 & 255, H[2] >> 8 & 255, H[2] & 255, H[3] >> 24 & 255, H[3] >> 16 & 255, H[3] >> 8 & 255, H[3] & 255, H[4] >> 24 & 255, H[4] >> 16 & 255, H[4] >> 8 & 255, H[4] & 255]; +} +var v5 = v35("v5", 80, sha1); +const v5$1 = v5; +const nil = "00000000-0000-0000-0000-000000000000"; +function version(uuid) { + if (!validate(uuid)) { + throw TypeError("Invalid UUID"); + } + return parseInt(uuid.substr(14, 1), 16); +} +const esmBrowser = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + NIL: nil, + parse, + stringify, + v1, + v3: v3$1, + v4, + v5: v5$1, + validate, + version +}, Symbol.toStringTag, { value: "Module" })); +const require$$2 = /* @__PURE__ */ getAugmentedNamespace(esmBrowser); +var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); +} : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +} : function(o, v) { + o["default"] = v; +}); +var __importStar = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(fileCommand, "__esModule", { value: true }); +fileCommand.prepareKeyValueMessage = fileCommand.issueFileCommand = void 0; +const fs = __importStar(require$$0$1); +const os = __importStar(require$$1); +const uuid_1 = require$$2; +const utils_1 = utils; +function issueFileCommand(command2, message) { + const filePath = process.env[`GITHUB_${command2}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command2}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: "utf8" + }); +} +fileCommand.issueFileCommand = issueFileCommand; +function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${uuid_1.v4()}`; + const convertedValue = utils_1.toCommandValue(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; +} +fileCommand.prepareKeyValueMessage = prepareKeyValueMessage; +var oidcUtils = {}; +var auth = {}; +var __awaiter = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(auth, "__esModule", { value: true }); +auth.PersonalAccessTokenCredentialHandler = auth.BearerCredentialHandler = auth.BasicCredentialHandler = void 0; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options2) { + if (!options2.headers) { + throw Error("The request has no headers"); + } + options2.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } +} +auth.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options2) { + if (!options2.headers) { + throw Error("The request has no headers"); + } + options2.headers["Authorization"] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } +} +auth.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options2) { + if (!options2.headers) { + throw Error("The request has no headers"); + } + options2.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } +} +auth.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; +var hasRequiredOidcUtils; +function requireOidcUtils() { + if (hasRequiredOidcUtils) return oidcUtils; + hasRequiredOidcUtils = 1; + var __awaiter2 = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(oidcUtils, "__esModule", { value: true }); + oidcUtils.OidcClient = void 0; + const http_client_1 = lib$1; + const auth_1 = auth; + const core_1 = requireCore(); + class OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); + } + static getRequestToken() { + const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; + if (!token) { + throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); + } + return token; + } + static getIDTokenUrl() { + const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; + if (!runtimeUrl) { + throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); + } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a2; + return __awaiter2(this, void 0, void 0, function* () { + const httpclient = OidcClient.createHttpClient(); + const res = yield httpclient.getJson(id_token_url).catch((error2) => { + throw new Error(`Failed to get ID Token. + + Error Code : ${error2.statusCode} + + Error Message: ${error2.message}`); + }); + const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter2(this, void 0, void 0, function* () { + try { + let id_token_url = OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + core_1.debug(`ID token url is ${id_token_url}`); + const id_token = yield OidcClient.getCall(id_token_url); + core_1.setSecret(id_token); + return id_token; + } catch (error2) { + throw new Error(`Error message: ${error2.message}`); + } + }); + } + } + oidcUtils.OidcClient = OidcClient; + return oidcUtils; +} +var summary = {}; +var hasRequiredSummary; +function requireSummary() { + if (hasRequiredSummary) return summary; + hasRequiredSummary = 1; + (function(exports2) { + var __awaiter2 = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.summary = exports2.markdownSummary = exports2.SUMMARY_DOCS_URL = exports2.SUMMARY_ENV_VAR = void 0; + const os_12 = require$$1; + const fs_12 = require$$0$1; + const { access, appendFile, writeFile } = fs_12.promises; + exports2.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; + exports2.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; + class Summary { + constructor() { + this._buffer = ""; + } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter2(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; + } + const pathFromEnv = process.env[exports2.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${exports2.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + } + try { + yield access(pathFromEnv, fs_12.constants.R_OK | fs_12.constants.W_OK); + } catch (_a2) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); + } + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); + if (!content) { + return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; + } + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options2) { + return __awaiter2(this, void 0, void 0, function* () { + const overwrite = !!(options2 === null || options2 === void 0 ? void 0 : options2.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); + return this.emptyBuffer(); + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter2(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_12.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, lang && { lang }); + const element = this.wrap("pre", this.wrap("code", code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? "ol" : "ul"; + const listItems = items.map((item) => this.wrap("li", item)).join(""); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows.map((row) => { + const cells = row.map((cell) => { + if (typeof cell === "string") { + return this.wrap("td", cell); + } + const { header: header2, data, colspan, rowspan } = cell; + const tag = header2 ? "th" : "td"; + const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); + return this.wrap(tag, data, attrs); + }).join(""); + return this.wrap("tr", cells); + }).join(""); + const element = this.wrap("table", tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap("details", this.wrap("summary", label) + content); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options2) { + const { width, height } = options2 || {}; + const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); + const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap("hr", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap("br", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, cite && { cite }); + const element = this.wrap("blockquote", text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap("a", text, { href }); + return this.addRaw(element).addEOL(); + } + } + const _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; + })(summary); + return summary; +} +var pathUtils = {}; +var hasRequiredPathUtils; +function requirePathUtils() { + if (hasRequiredPathUtils) return pathUtils; + hasRequiredPathUtils = 1; + var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault2 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar2 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); + } + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(pathUtils, "__esModule", { value: true }); + pathUtils.toPlatformPath = pathUtils.toWin32Path = pathUtils.toPosixPath = void 0; + const path2 = __importStar2(require$$0$9); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); + } + pathUtils.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + pathUtils.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path2.sep); + } + pathUtils.toPlatformPath = toPlatformPath; + return pathUtils; +} +var hasRequiredCore; +function requireCore() { + if (hasRequiredCore) return core$1; + hasRequiredCore = 1; + (function(exports2) { + var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault2 = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar2 = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); + } + __setModuleDefault2(result, mod); + return result; + }; + var __awaiter2 = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getIDToken = exports2.getState = exports2.saveState = exports2.group = exports2.endGroup = exports2.startGroup = exports2.info = exports2.notice = exports2.warning = exports2.error = exports2.debug = exports2.isDebug = exports2.setFailed = exports2.setCommandEcho = exports2.setOutput = exports2.getBooleanInput = exports2.getMultilineInput = exports2.getInput = exports2.addPath = exports2.setSecret = exports2.exportVariable = exports2.ExitCode = void 0; + const command_1 = command; + const file_command_1 = fileCommand; + const utils_12 = utils; + const os2 = __importStar2(require$$1); + const path2 = __importStar2(require$$0$9); + const oidc_utils_1 = requireOidcUtils(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode = exports2.ExitCode || (exports2.ExitCode = {})); + function exportVariable(name, val) { + const convertedVal = utils_12.toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env["GITHUB_ENV"] || ""; + if (filePath) { + return file_command_1.issueFileCommand("ENV", file_command_1.prepareKeyValueMessage(name, val)); + } + command_1.issueCommand("set-env", { name }, convertedVal); + } + exports2.exportVariable = exportVariable; + function setSecret(secret) { + command_1.issueCommand("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + file_command_1.issueFileCommand("PATH", inputPath); + } else { + command_1.issueCommand("add-path", {}, inputPath); + } + process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + function getInput(name, options2) { + const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; + if (options2 && options2.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + if (options2 && options2.trimWhitespace === false) { + return val; + } + return val.trim(); + } + exports2.getInput = getInput; + function getMultilineInput(name, options2) { + const inputs = getInput(name, options2).split("\n").filter((x) => x !== ""); + if (options2 && options2.trimWhitespace === false) { + return inputs; + } + return inputs.map((input) => input.trim()); + } + exports2.getMultilineInput = getMultilineInput; + function getBooleanInput(name, options2) { + const trueValue = ["true", "True", "TRUE"]; + const falseValue = ["false", "False", "FALSE"]; + const val = getInput(name, options2); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); + } + exports2.getBooleanInput = getBooleanInput; + function setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value)); + } + process.stdout.write(os2.EOL); + command_1.issueCommand("set-output", { name }, utils_12.toCommandValue(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + command_1.issue("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error2(message); + } + exports2.setFailed = setFailed; + function isDebug() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug; + function debug2(message) { + command_1.issueCommand("debug", {}, message); + } + exports2.debug = debug2; + function error2(message, properties = {}) { + command_1.issueCommand("error", utils_12.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error2; + function warning(message, properties = {}) { + command_1.issueCommand("warning", utils_12.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning; + function notice(message, properties = {}) { + command_1.issueCommand("notice", utils_12.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info; + function startGroup(name) { + command_1.issue("group", name); + } + exports2.startGroup = startGroup; + function endGroup() { + command_1.issue("endgroup"); + } + exports2.endGroup = endGroup; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } finally { + endGroup(); + } + return result; + }); + } + exports2.group = group; + function saveState(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return file_command_1.issueFileCommand("STATE", file_command_1.prepareKeyValueMessage(name, value)); + } + command_1.issueCommand("save-state", { name }, utils_12.toCommandValue(value)); + } + exports2.saveState = saveState; + function getState(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); + } + exports2.getIDToken = getIDToken; + var summary_1 = requireSummary(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = requireSummary(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = requirePathUtils(); + Object.defineProperty(exports2, "toPosixPath", { enumerable: true, get: function() { + return path_utils_1.toPosixPath; + } }); + Object.defineProperty(exports2, "toWin32Path", { enumerable: true, get: function() { + return path_utils_1.toWin32Path; + } }); + Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { + return path_utils_1.toPlatformPath; + } }); + })(core$1); + return core$1; +} +var coreExports = requireCore(); +const core = /* @__PURE__ */ getDefaultExportFromCjs(coreExports); +async function main() { + const token = core.getInput("token"); + core.setSecret(token); + const options2 = { + token, + tag: core.getInput("tag"), + dryRun: core.getInput("dry-run") === "true", + target: core.getInput("target"), + includePrivate: core.getInput("include-private") === "true" + }; + await publishPackages(options2); +} +main().then(() => { + core.info("Publish packages successfully"); +}).catch((err) => { + core.setFailed(err.message); +});